blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 3 264 | content_id stringlengths 40 40 | detected_licenses listlengths 0 85 | license_type stringclasses 2
values | repo_name stringlengths 5 140 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringclasses 905
values | visit_date timestamp[us]date 2015-08-09 11:21:18 2023-09-06 10:45:07 | revision_date timestamp[us]date 1997-09-14 05:04:47 2023-09-17 19:19:19 | committer_date timestamp[us]date 1997-09-14 05:04:47 2023-09-06 06:22:19 | github_id int64 3.89k 681M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 22
values | gha_event_created_at timestamp[us]date 2012-06-07 00:51:45 2023-09-14 21:58:39 ⌀ | gha_created_at timestamp[us]date 2008-03-27 23:40:48 2023-08-21 23:17:38 ⌀ | gha_language stringclasses 141
values | src_encoding stringclasses 34
values | language stringclasses 1
value | is_vendor bool 1
class | is_generated bool 2
classes | length_bytes int64 3 10.4M | extension stringclasses 115
values | content stringlengths 3 10.4M | authors listlengths 1 1 | author_id stringlengths 0 158 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
9ca3e0e4c929626492c0e3ce93cabbfab5a7deb9 | 92f5e3d6ca927e314b1fff4806b99b9a85f13b29 | /uppsrc/CtrlLib/ChCoco.cpp | 646804d51f57268183a8f2411ca521e553d7b589 | [
"BSD-2-Clause"
] | permissive | nilrum/UppLib | 993fd7ccafa38d546f45f57142c65c57fe2463e0 | e5bad6a9bf7e2a40f094a23897ec75ac6bf27d96 | refs/heads/master | 2021-01-05T12:22:12.630521 | 2020-02-17T04:51:41 | 2020-02-17T04:51:41 | 241,022,697 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 9,021 | cpp | #include "ChCoco.h"
#ifdef PLATFORM_COCOA
namespace Upp {
Image Hot3(const Image& m)
{
Size sz = m.GetSize();
return WithHotSpots(m, sz.cx / 3, sz.cy / 3, sz.cx - sz.cx / 3, sz.cy - sz.cy / 3);
}
Image Coco_ThemeImage(Color bg, int cx, int cy, int margin, int type,
int value, int state, bool focus)
{
Size isz(cx + 2 * margin, cy + 2 * margin);
ImageDraw iw(DPI(isz));
iw.DrawRect(DPI(isz), bg);
Coco_ThemePaint(iw.GetCGHandle(), Rect(margin, margin, cx, cy), type, value, state, focus);
return Hot3(iw);
}
Image Coco_ThemeImage(int cx, int cy, int margin, int type, int value, int state, bool focus)
{
return Hot3(RecreateAlpha(Coco_ThemeImage(White(), cx, cy, margin, type, value, state, focus),
Coco_ThemeImage(Black(), cx, cy, margin, type, value, state, focus)));
}
Color AvgColor(const Image& m, const Rect& rr)
{
int n = rr.GetWidth() * rr.GetHeight();
if(n <= 0)
return White();
int r = 0;
int g = 0;
int b = 0;
for(int y = rr.top; y < rr.bottom; y++)
for(int x = rr.left; x < rr.right; x++) {
RGBA c = m[y][x];
r += c.r;
g += c.g;
b += c.b;
}
return Color(r / n, g / n, b / n);
}
Color AvgColor(const Image& m, int margin = 0)
{
return AvgColor(m, Rect(m.GetSize()).Deflated(margin));
}
void ClampedAutoCrop(Image *h, int count)
{
AutoCrop(h, count);
for(int i = 0; i < count; i++)
ClampHotSpots(h[i]);
}
Image ClampedAutoCrop(const Image& m)
{
Image h = m;
ClampedAutoCrop(&h, 1);
return h;
}
void SOImages(int imli, int type, int value)
{
Image h[4];
h[0] = Coco_ThemeImage(20, 20, 10, type, value, CTRL_NORMAL);
h[1] = Coco_ThemeImage(20, 20, 10, type, value, CTRL_HOT); // same as Normal
h[2] = Coco_ThemeImage(20, 20, 10, type, value, CTRL_PRESSED);
h[3] = Coco_ThemeImage(20, 20, 10, type, value, CTRL_DISABLED);
ClampedAutoCrop(h, 4);
for(int i = 0; i < 4; i++)
CtrlsImg::Set(imli++, Hot3(h[i]));
}
void CocoButton(Image *h, int type, int value)
{
h[0] = Coco_ThemeImage(40, 32, 10, type, value, CTRL_NORMAL);
h[1] = Coco_ThemeImage(40, 32, 10, type, value, CTRL_HOT); // same as Normal
h[2] = Coco_ThemeImage(40, 32, 10, type, value, CTRL_PRESSED);
h[3] = Coco_ThemeImage(40, 32, 10, type, value, CTRL_DISABLED);
ClampedAutoCrop(h, 4);
for(int i = 0; i < 4; i++)
h[i] = Hot3(h[i]);
}
void CocoButton(Button::Style& s, int type, int value)
{
Image h[4];
CocoButton(h, type, value);
for(int i = 0; i < 4; i++) {
s.look[i] = h[i];
Image gg = CreateImage(h[i].GetSize(), SColorFace());
Over(gg, h[i]);
s.monocolor[i] = s.textcolor[i] = i == CTRL_DISABLED ? SColorDisabled()
: Grayscale(AvgColor(gg, h[i].GetSize().cy / 3)) > 160 ? Black()
: White();
}
s.overpaint = 5;
s.pressoffset = Point(0, 0);
}
Color CocoBrush(int k)
{
return AvgColor(Coco_ThemeImage(16, 16, 0, COCO_BRUSH, k));
}
Color CocoColor(int k, Color bg = SColorFace())
{
return AvgColor(Coco_ThemeImage(bg, 16, 16, 0, COCO_NSCOLOR, k));
}
Color GetInkColor(const Image& m)
{
int x = m.GetSize().cx / 2;
bool dark = !IsDark(SColorText());
int best = 1000;
Color bestc = SColorText();
for(int y = 0; y < m.GetHeight(); y++) {
Color c = m[y][x];
int g = Grayscale(c);
if(dark)
g = 255 - g;
if(g < best) {
best = g;
bestc = c;
}
}
return bestc;
}
void ChHostSkin()
{
CtrlImg::Reset();
CtrlsImg::Reset();
ChReset();
GUI_GlobalStyle_Write(GUISTYLE_XP);
DUMP(Coco_Metric(0)); // kThemeMetricScrollBarWidth
DUMP(Coco_Metric(7)); // kThemeMetricFocusRectOutset
DUMP(Coco_Metric(19)); // kThemeMetricPushButtonHeight
int button_height = Coco_Metric(19); // kThemeMetricPushButtonHeight
SwapOKCancel_Write(true);
SColorFace_Write(CocoColor(COCO_WINDOW, White())); // ThemeBrushDialogBackgroundActive
SColorHighlight_Write(CocoColor(COCO_SELECTEDPAPER));
SColorHighlightText_Write(CocoColor(COCO_SELECTEDTEXT));
SColorText_Write(CocoColor(COCO_TEXT));
SColorPaper_Write(CocoColor(COCO_PAPER));
SColorDisabled_Write(CocoColor(COCO_DISABLED));
SOImages(CtrlsImg::I_S0, COCO_RADIOBUTTON, 0);
SOImages(CtrlsImg::I_S1, COCO_RADIOBUTTON, 1);
SOImages(CtrlsImg::I_O0, COCO_CHECKBOX, 0);
SOImages(CtrlsImg::I_O1, COCO_CHECKBOX, 1);
SOImages(CtrlsImg::I_O2, COCO_CHECKBOX, 2);
CocoButton(Button::StyleNormal().Write(), COCO_BUTTON, 0);
CocoButton(Button::StyleOk().Write(), COCO_BUTTON, 1);
CocoButton(Button::StyleEdge().Write(), COCO_BEVELBUTTON, 0);
CocoButton(Button::StyleScroll().Write(), COCO_BEVELBUTTON, 0);
{
auto& s = ToolButton::StyleDefault().Write();
Image h[4];
CocoButton(h, COCO_ROUNDEDBUTTON, 0);
s.look[CTRL_NORMAL] = Image();
s.look[CTRL_HOT] = h[CTRL_HOT];
s.look[CTRL_PRESSED] = h[CTRL_PRESSED];
s.look[CTRL_DISABLED] = Image();
CocoButton(h, COCO_ROUNDEDBUTTON, 1);
s.look[CTRL_CHECKED] = h[CTRL_NORMAL];
s.look[CTRL_HOTCHECKED] = h[CTRL_HOT];
}
// ColoredOverride(CtrlsImg::Iml(), CtrlsImg::Iml()); return _DBG_;
{
Color menuink = CocoColor(COCO_SELECTEDMENUTEXT);
SColorMenu_Write(AvgColor(ClampedAutoCrop(Coco_ThemeImage(30, 20, 10, COCO_MENU, 0, CTRL_NORMAL))));
SColorMenuText_Write(SColorText());
MenuBar::Style& s = MenuBar::StyleDefault().Write();
s.pullshift.y = 0;
SColorMenu_Write(SColorFace());
s.topitem[1] = s.topitem[0] = SColorFace();
s.topitemtext[1] = SColorText();
Image m = ClampedAutoCrop(Coco_ThemeImage(50, 50, 10, COCO_MENUITEM, 0, CTRL_HOT));
Rect r = m.GetSize();
if(r.GetWidth() > 10 && r.GetHeight() > 10)
r.Deflate(5);
m = Crop(m, r);
s.item = s.topitem[2] = Hot3(m);
s.topitemtext[0] = SColorText();
s.itemtext = s.topitemtext[2] = menuink;
s.look = SColorFace();
s.opaquetest = false;
}
{
ScrollBar::Style& s = ScrollBar::StyleDefault().Write();
s.arrowsize = 0; // no arrows
s.through = true;
int sz = Coco_Metric(0); // kThemeMetricScrollBarWidth
s.barsize = s.thumbwidth = DPI(sz);
s.thumbmin = 3 * s.barsize / 2;
for(int status = CTRL_NORMAL; status <= CTRL_DISABLED; status++) {
s.vupper[status] = s.vlower[status] =
Hot3(Coco_ThemeImage(SColorFace(), sz, 40, 0, COCO_SCROLLTRACK, 0, status));
Image thumb = Coco_ThemeImage(sz, 50, 0, COCO_SCROLLTHUMB, 0, status);
Rect bounds = FindBounds(thumb);
thumb = Crop(thumb, Rect(0, bounds.top, thumb.GetWidth(), bounds.bottom));
thumb = AddMargins(thumb, 0, 1, 0, 1, RGBAZero());
s.vthumb[status] = Hot3(thumb);
s.hupper[status] = s.hlower[status] =
Hot3(Coco_ThemeImage(SColorFace(), 40, sz, 0, COCO_SCROLLTRACK, 1, status));
thumb = Coco_ThemeImage(50, sz, 0, COCO_SCROLLTHUMB, 1, status);
bounds = FindBounds(thumb);
thumb = Crop(thumb, Rect(bounds.left, 0, bounds.right, thumb.GetHeight()));
thumb = AddMargins(thumb, 1, 0, 1, 0 , RGBAZero());
s.hthumb[status] = Hot3(thumb);
}
}
ColoredOverride(CtrlsImg::Iml(), CtrlsImg::Iml());
{
Color e = GetInkColor(Coco_ThemeImage(SColorFace(), 100, 50, 10, COCO_COMBOBOX));
CtrlsImg::Set(CtrlsImg::I_EFE,
WithHotSpots(AddMargins(CreateImage(Size(1, 1), SColorPaper()), 1, 1, 1, 1, e),
1, 1, 0, 0));
CtrlsImg::Set(CtrlsImg::I_VE,
WithHotSpots(AddMargins(CreateImage(Size(3, 3), SColorPaper()), 1, 1, 1, 1, e),
2, 2, 0, 0));
MultiButton::Style& s = MultiButton::StyleDefault().Write();
// s.trivialsep = true;
// s.edge[0] = Null;
s.clipedge = true;
s.border = s.trivialborder = 0;
for(int i = CTRL_NORMAL; i <= CTRL_DISABLED; i++) {
Image m = Coco_ThemeImage(150, button_height + 1, 0, COCO_BUTTON, 1, i); // TODO: ChWithOffset...
Size isz = m.GetSize();
int x3 = isz.cx / 3;
s.left[i] = Hot3(Crop(m, 0, 0, x3, isz.cy));
s.trivial[i] = s.look[i] = s.right[i] = Hot3(Crop(m, 2 * x3, 0, isz.cx - 2 * x3, isz.cy));
Image mm = Crop(m, x3, 0, x3, isz.cy);
s.lmiddle[i] = Hot3(AddMargins(mm, 1, 0, 0, 0, SColorPaper()));
s.rmiddle[i] = Hot3(AddMargins(mm, 0, 0, 1, 0, SColorPaper()));
s.monocolor[i] = s.fmonocolor[i] = Button::StyleOk().monocolor[i];
}
}
{
SpinButtons::Style& sp = SpinButtons::StyleDefault().Write();
sp.dec = sp.inc = Button::StyleNormal();
for(int i = CTRL_NORMAL; i <= CTRL_DISABLED; i++) {
Image m = ClampedAutoCrop(Coco_ThemeImage(50, button_height + 1, 0, COCO_BUTTON, 0, i));
Size isz = m.GetSize();
int cy = isz.cy / 2;
Color c = Button::StyleNormal().monocolor[i];
sp.inc.look[i] = ChLookWith(Hot3(Crop(m, 0, 0, isz.cx, cy)), CtrlImg::spinup(), c);
sp.dec.look[i] = ChLookWith(Hot3(Crop(m, 0, cy, isz.cx, isz.cy - cy)), CtrlImg::spindown(), c);
}
}
auto nsimg = [](int ii) { return ClampedAutoCrop(Coco_ThemeImage(48, 48, 10, COCO_NSIMAGE, ii)); };
CtrlImg::Set(CtrlImg::I_information, nsimg(1));
CtrlImg::Set(CtrlImg::I_question, nsimg(0));
CtrlImg::Set(CtrlImg::I_exclamation, nsimg(0));
CtrlImg::Set(CtrlImg::I_error, nsimg(0));
// DDUMP(Coco_ThemeColor(1));
// Coco_ThemeColor(1));
}
};
#endif | [
"inilrum@gmail.com"
] | inilrum@gmail.com |
fa4382b723518869ab7cff7979bd0cc2f3a4be40 | 098e3ecbe63e94fb20e00c8ac6034336292e49b0 | /OperatingSystems/IO/input_handler.cpp | 2992791961b6f31e2d92530fd7441c791027969d | [
"MIT"
] | permissive | adithyap/coursework | 4794e7170d5b33d047be07f18a93fc1b6341c95d | 0b1cf7575ef0b1afa599df90fca2e1f7f3e3347f | refs/heads/master | 2021-01-10T14:50:36.713772 | 2016-09-29T03:20:47 | 2016-09-29T03:20:47 | 44,405,941 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,778 | cpp | #include "input_handler.hpp"
std::deque<Instruction*> InputHandler::instructions;
void InputHandler::init_handler(char* inputfile)
{
if (fopen(inputfile, "r") == NULL)
{
printf("InputHandler::read_input - Unable to open file %s", inputfile);
return;
}
std::ifstream infile(inputfile);
std::string temp;
while(std::getline(infile, temp))
{
// Check for commment
if (temp[0] == '#')
{
continue;
}
// Get tokens
std::vector<std::string> tokens = Helper::split(temp, ' ');
// Process tokens
// Handle wrong token count
// Read into ints
if (tokens.size() != 2)
{
// Wrong input
printf("InputHandler::read_input - Wrong token length %lu", tokens.size());
continue;
}
int time_issued = (int) strtol(tokens[0].c_str(), NULL, 10);
int track = (int) strtol (tokens[1].c_str(), NULL, 10);
Instruction *instr_obj = new Instruction(time_issued, track);
instructions.push_back(instr_obj);
}
}
Instruction* InputHandler::get_next_instruction()
{
if (instructions.size() == 0)
{
// Queue is empty
return NULL;
}
Instruction *instr_obj = instructions.front();
instructions.pop_front();
return instr_obj;
}
int InputHandler::get_next_instruction_time()
{
if (instructions.size() == 0)
{
// Queue is empty
return -1;
}
return instructions.front()->time_issued;
}
void InputHandler::display()
{
// for (std::deque<Instruction*>::iterator it = instructions.begin(); it != instructions.end(); it++)
// {
// }
printf("Total instructions: %lu\n", instructions.size());
}
| [
"adithya91@gmail.com"
] | adithya91@gmail.com |
a4bbd2601fb737a84113e564c86e7d3a3a8374d0 | 1a05088e2a78b1c7c1bfcf1183a4e8a898ba5e1f | /bin/rxc_instal/RxC/source/Program-2-RxC/rxc1.cpp | b1e102689d1ae25987a7dd77d1a9e839f7b28227 | [] | no_license | jeantristanb/analyse_vcf | 1b3b48dedf0a7c6267c09182d13b681960247594 | 7ec7bb855287ae3ed79ad5ab52ec6018a6546c9e | refs/heads/master | 2023-01-01T14:30:23.882172 | 2020-10-27T07:02:55 | 2020-10-27T07:02:55 | 258,503,506 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,300 | cpp | // Time-stamp: <2008-08-21 16:26:55 zaykind>
// (written by Dmitri Zaykin)
#include "rxc.h"
template <class T> void Swap (T &a, T &b) { T temp = a; a = b; b = temp; }
void Perm (RxC_labels *v2, Rndm &rn, int n) {
for(int i=0; i<n-1; i++) {
Swap (v2[i].r, v2[rn(n-i)+i].r);
}
}
void FillBag (RxC_labels *v2, int **x, int rlen, int clen)
{
int i, j, v, w=0;
for(i=0; i<rlen; i++) {
for(j=0; j<clen; j++) {
for(v=0; v<x[i][j]; v++) {
v2[w].r = i;
v2[w].c = j;
++w;
}
}
}
}
int Empty(int *Check, int n) {
for(int i=0; i<n; i++) {
if(Check[i] != 0) return 0;
}
return 1;
}
int** Read(istream& Input_File, int &r, int &c, int& ssize)
{
Input_File >> r >> c; assert(Input_File.good());
int i, j, **x = 0; x=Talloc(x,r,c);
for(ssize=0, i=0; i<r; i++) {
for(j=0; j<c; j++) {
Input_File >> x[i][j]; assert(Input_File.good());
ssize += x[i][j];
}
}
int k, *Check = new int [r];
for(j=0; j<c; j++) {
for(k=0; k<r; k++) { Check[k] = 0; }
for(i=0; i<r; i++) {
Check[i] = x[i][j] ? 1:0;
}
if(Empty(Check,r)) {
cout << "Empty column #" << (j+1) << " ...\n";
Tfree (x, r);
x = 0;
}
}
delete [] Check;
return x;
}
| [
"jeantristanb@free.fr"
] | jeantristanb@free.fr |
5eb16c21ea5cdc49658e1a128f8bcd1dff5d3e80 | 9bf20cde9b498bcc4528866b7802491a6a7876dc | /eomaia/net/IOEventLoop.cpp | 55cf689c6ffd86650b92c10ec316173f70022c30 | [
"MIT"
] | permissive | xiaonaiquan/eomaia | c17a99a6852becf57828642294d8a5586830688c | ef8f80b99c26a3bda763be429437a80507b53a54 | refs/heads/master | 2022-06-29T10:29:50.789338 | 2020-05-15T06:13:18 | 2020-05-15T06:13:18 | 261,698,619 | 0 | 0 | MIT | 2020-05-06T08:33:52 | 2020-05-06T08:33:51 | null | UTF-8 | C++ | false | false | 2,448 | cpp | #include <net/IOEventLoop.h>
#include <signal.h>
#include <base/LogInterface.h>
#include <base/Thread.h>
#include <iostream>
using namespace std;
using namespace eomaia::net;
using namespace base;
//这个类初始化后避免程序被signal信号意外退出
class IgnoreSigPipe
{
public:
static IgnoreSigPipe* getInstance ()
{
return singnal;
}
private:
IgnoreSigPipe()
{
::signal(SIGPIPE, SIG_IGN);
//endl;
}
static IgnoreSigPipe* singnal ;
};
IgnoreSigPipe* IgnoreSigPipe::singnal = new IgnoreSigPipe();
const int IOEventLoop::PollTimeMs = 3000;
IOEventLoop::IOEventLoop()
:eventCtrl(new IOEventCtrl(this)),
thisTheadId(Thread::getNowThreadId()),
timerQueue(new TimerQueue(this))
{
}
IOEventLoop::~IOEventLoop()
{
delete eventCtrl;
}
void IOEventLoop::run()
{
if(!inThisThread())
{
thisTheadId = Thread::getNowThreadId();
base::Log::OUT( base::Log::Warn)<<"Loop create and run in different thread";
}
while(true)
{
eventCtrl->waitAndRunHandle(PollTimeMs);
runAllFunctionInLoop();
}
}
void IOEventLoop::addEvent(std::shared_ptr<IOEvent> event)
{
eventCtrl->addEvent(event);
}
void IOEventLoop::removeEvent(std::shared_ptr<IOEvent> event)
{
eventCtrl->deleteEvent(event);
}
void IOEventLoop::removeEvent(int fd)
{
eventCtrl->deleteEvent(fd);
}
void IOEventLoop::modifyEvent(std::shared_ptr<IOEvent> event)
{
eventCtrl->modifyEvent(event);
}
void IOEventLoop::modifyEvent(int fd)
{
eventCtrl->modifyEvent(fd);
}
void IOEventLoop::runInLoop(const DefaultFunction func)
{
if(inThisThread())
{
func();
}
else
{
addFunInLoop(func);
}
}
void IOEventLoop::addFunInLoop(DefaultFunction func)
{
std::lock_guard<std::mutex> lock(mutex);
functions.push_back(func);
}
void IOEventLoop::runAllFunctionInLoop()
{
std::lock_guard<std::mutex> lock(mutex);
for(unsigned int i=0;i<functions.size();i++)
{
functions[i]();
}
functions.clear();
}
bool IOEventLoop::inThisThread()
{
return (thisTheadId == Thread::getNowThreadId());
}
void IOEventLoop::runOniceAfter(const DefaultFunction callback,uint32_t interval)
{
timerQueue->runOniceAfter(callback,interval);
}
void IOEventLoop::runEveryInterval(const DefaultFunction callback,uint32_t interval)
{
timerQueue->runEveryInterval(callback,interval);
}
| [
"orcaer@yeah.net"
] | orcaer@yeah.net |
401ccfac0e7805a016286d648d7a69ef21b23222 | 1c6177c68e9be37366a70c5699ea421af00546fb | /PhanTranA2/ItemCommandGroup.h | e080c6d8b83b6bf4d64560072e7ffc821a626622 | [] | no_license | tpakhoa1996/text-based-game | 7c6be901d9dbac8f2fa83110bc921df8cba13de5 | 3a4654fb222eef341b05f05979c0c81f2872d6d0 | refs/heads/master | 2020-03-28T19:03:10.307395 | 2018-09-18T04:23:27 | 2018-09-18T04:26:03 | 148,939,759 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 320 | h | #pragma once
#include "CommandGroup.h"
#include "Character.h"
#include "GameHelper.h"
#include "ItemContainer.h"
#include "ItemGroupContext.h"
class ItemCommandGroup : public CommandGroup {
public:
ItemCommandGroup(GameHelper*, ItemContainer*);
~ItemCommandGroup();
private:
ItemGroupContext *context = nullptr;
};
| [
"khoaphananhtran@gmail.com"
] | khoaphananhtran@gmail.com |
d062550f8b1d1dc9ecc0010c240565e7b6c48e78 | 7b4ccbe30b2d5282a18503135bbd9ab548453e2b | /03_CppCoreProgramming/03_ClassAndObject/0805_CopyConstructFunc.cpp | 4439edf94f2579dcd5fdb6c377ed8f7017176ae0 | [] | no_license | lybglory/CCPlusPlus | 3e04014917864b5b07bbe53b52befb7f40272c22 | 648a24e8bc5c47bdab97687820940c8c04500bdc | refs/heads/master | 2022-03-05T17:14:50.090415 | 2022-02-04T10:17:29 | 2022-02-04T10:17:29 | 228,967,508 | 0 | 0 | null | 2022-02-04T12:06:09 | 2019-12-19T03:28:40 | C | GB18030 | C++ | false | false | 1,368 | cpp | #define _CRT_SECURE_NO_WARNINGS
#include<iostream>
using namespace std;
class Person {
public:
Person() {
cout << "no param contructor!" << endl;
mAge = 10;
}
Person(int age) {
cout << "param constructor!" << endl;
mAge = age;
}
Person(const Person& person) {
cout << "copy constructor!" << endl;
mAge = person.mAge;
}
~Person() {
cout << "destructor!" << endl;
}
public:
int mAge;
};
//1. 旧对象初始化新对象
void CopyFunc01() {
Person p(10);
Person p1(p);
Person p2 = Person(p);
Person p3 = p; // 相当于Person p2 = Person(p);
}
//2. 传递的参数是普通对象,函数参数也是普通对象,传递将会调用拷贝构造
void doBussiness(Person p) {}
void CopyFunc02() {
Person p(10);
doBussiness(p);
}
//3. 函数返回局部对象
Person MyBusiness() {
Person p(10);
cout << "局部p:" << (int*)&p << endl;
return p;
}
void CopyFunc03() {
//vs release、qt下没有调用拷贝构造函数
//vs debug下调用一次拷贝构造函数
Person p = MyBusiness();
cout << "局部p:" << (int*)&p << endl;
}
void main_0805_07() {
CopyFunc01();
CopyFunc02();
CopyFunc03();
}
//void MyBussiness(Person &_result) {
// _result.X:X(); //调用Person默认拷贝构造函数
// //.....对_result进行处理
// return;
//}
//int main() {
// Person p; //这里只分配空间,不初始化
// MyBussiness(p);
//}
| [
"lybglory@outlook.com"
] | lybglory@outlook.com |
056e81226335ed7c766eb07aa2a6e4aaf7416c69 | 081a2ef5c53fb7f4fa0c7f01fd34e1310df83e47 | /Source/modules/imogen_gui/Header/Header.h | b1fea81e31a2e9cdfd6d4d82b9bcd8f71ab5d189 | [
"MIT"
] | permissive | JaeDukSeo/imogen | f7b7b4db9b57f682fd79eb6bb1878995946c1b50 | d21dbe95d5d7b9d97bbc687663355e3f12ff15d4 | refs/heads/master | 2023-06-20T14:22:45.433904 | 2021-07-21T13:37:13 | 2021-07-21T13:37:13 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 700 | h | #pragma once
#include "InputIcon.h"
#include "OutputLevel/OutputLevel.h"
#include "PresetBar/PresetBar.h"
#include "ScaleChooser.h"
#include "AboutPopup/LogoButton.h"
#include "MidiSettings/KeyboardButton.h"
namespace Imogen
{
class Header : public juce::Component
{
public:
Header (State& stateToUse, UndoManager& undoToUse);
private:
void paint (juce::Graphics& g) final;
void resized() final;
State& state;
UndoManager& undo;
LogoButton logo;
KeyboardButton keyboardButton;
InputIcon inputIcon {state};
OutputLevel outputLevel {state};
PresetBar presetBar {state, undo};
ScaleChooser scale {state.internals};
};
} // namespace Imogen
| [
"ben.the.vining@gmail.com"
] | ben.the.vining@gmail.com |
fc2fb4df058f5af8c5ba45e406c3c01ff50b4dbb | 9d9441ad6f705a9b2c5a2cc203319a823bfcb445 | /Crumbs/Source/CoreTech/RedJaguarEngine/States/State_LevelMenu.h | 35111845e9e746df7b01a499b2be52b303b4d99f | [] | no_license | JpDeathBlade/Kitchen-Krashers | 9ee004f2d4ccce8272a11c48368b5622cd123810 | 1569a178e51e5772585142e25b3c33418718a0d4 | refs/heads/master | 2021-03-24T12:29:44.268405 | 2017-12-28T14:48:43 | 2017-12-28T14:48:43 | 39,348,358 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,093 | h | #ifndef REDJAGUAR_JS_STATE_LEVELMENU_H_
#define REDJAGUAR_JS_STATE_LEVELMENU_H_
#include "RJ_IGameState.h"
#include "..\\Text\\C3DFont.h"
#include "../Event/EventDefinitions.h"
#include "../Event/IListener.h"
#include "../../../Gameplay/Gameplay.h"
struct tStateConfig;
class State_LevelMenu : public RJ_IGameState, IListener
{
private:
enum EMenu { eMIN = 0, eLEVELONE = eMIN, eLEVELTWO, eLEVELTHREE, eBACK, eMAX = eBACK};
int m_nSelection;
C3DFont Font;
tStateConfig* tSC;
HighScores m_tHighScores[5];
int NumPlayers;
int LevelSelect;
int texBack;
int texFreezer;
int texSink;
int texStove;
bool renderSelection;
bool m_bTutorial;
public:
State_LevelMenu(void);
State_LevelMenu(int _numPlayers);
State_LevelMenu(const State_LevelMenu& ref);
State_LevelMenu& operator=(const State_LevelMenu& ref);
virtual ~State_LevelMenu(void) {}
virtual void OnPush(void);
virtual void OnEnter(void);
virtual void OnExit(void);
virtual void HandleEvent(CEvent* pEvent);
virtual bool Input(double _fDelta);
virtual bool InputUnder(double _fDelta);
virtual bool Update(double _fDelta);
virtual bool UpdateUnder(double _fDelta);
virtual bool Render(double _fDelta);
virtual bool RenderUnder(double _fDelta);
//////////////////////////////////////////////////////////////////////////
//Load/Save High Scores
//Single Player
////Level 1
bool LoadHighScores1(void);
bool SaveHighScores1(void);
////Level 2
bool LoadHighScores2(void);
bool SaveHighScores2(void);
////Level 3
bool LoadHighScores3(void);
bool SaveHighScores3(void);
//////////////////////////////////////////////////////////////////////////
//Multiplayer
////Level 1
bool LoadHighScores1M(void);
bool SaveHighScores1M(void);
////Level 2
bool LoadHighScores2M(void);
bool SaveHighScores2M(void);
////Level 3
bool LoadHighScores3M(void);
bool SaveHighScores3M(void);
//////////////////////////////////////////////////////////////////////////
void LoadSettings();
void SendLevelMenuEvent(void);
};
#endif | [
"joseph.stuhr@lmnsolutions.com"
] | joseph.stuhr@lmnsolutions.com |
f4182ad45eaa89734e20c7d1bc38b55fc7721110 | 485ff07efdbb3e56b9633e3134b1c81271c2d8a3 | /cpp/SampleDockBarDialog/cmdSampleDockBarDialog.cpp | 980e985865669e06b93b8750e48b956b8980b586 | [
"LicenseRef-scancode-warranty-disclaimer"
] | no_license | mcneel/rhino-developer-samples | 8f8a332d4d6a9a5fa064be6c1532e665d37c8f13 | 4fb376adcf94f9d583878d1c1208038f86bde312 | refs/heads/7 | 2023-08-18T22:04:34.036498 | 2023-06-08T16:28:43 | 2023-06-08T16:28:43 | 72,225,588 | 526 | 362 | NOASSERTION | 2023-09-06T20:29:31 | 2016-10-28T16:52:21 | C++ | UTF-8 | C++ | false | false | 4,152 | cpp | // cmdSampleDockBarDialog.cpp : command file
//
#include "StdAfx.h"
#include "SampleDockBarDialogPlugIn.h"
#include "SampleTabbedDockBarDialog.h"
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
//
// BEGIN SampleDockBarDialog command
//
#pragma region SampleDockBarDialog command
// Do NOT put the definition of class CCommandSampleDockBarDialog in a header
// file. There is only ONE instance of a CCommandSampleDockBarDialog class
// and that instance is the static theSampleDockBarDialogCommand that appears
// immediately below the class definition.
class CCommandSampleDockBarDialog : public CRhinoCommand
{
public:
// The one and only instance of CCommandSampleDockBarDialog is created below.
// No copy constructor or operator= is required.
// Values of member variables persist for the duration of the application.
// CCommandSampleDockBarDialog::CCommandSampleDockBarDialog()
// is called exactly once when static theSampleDockBarDialogCommand is created.
CCommandSampleDockBarDialog() = default;
// CCommandSampleDockBarDialog::~CCommandSampleDockBarDialog()
// is called exactly once when static theSampleDockBarDialogCommand is destroyed.
// The destructor should not make any calls to the Rhino SDK.
// If your command has persistent settings, then override
// CRhinoCommand::SaveProfile and CRhinoCommand::LoadProfile.
~CCommandSampleDockBarDialog() = default;
// Returns a unique UUID for this command.
// If you try to use an id that is already being used, then
// your command will not work. Use GUIDGEN.EXE to make unique UUID.
UUID CommandUUID() override
{
// {1CB91610-1762-4C93-8582-1D50BFC43152}
static const GUID SampleDockBarDialogCommand_UUID =
{ 0x1CB91610, 0x1762, 0x4C93, { 0x85, 0x82, 0x1D, 0x50, 0xBF, 0xC4, 0x31, 0x52 } };
return SampleDockBarDialogCommand_UUID;
}
// Returns the English command name.
// If you want to provide a localized command name, then override
// CRhinoCommand::LocalCommandName.
const wchar_t* EnglishCommandName() override { return L"SampleDockBarDialog"; }
// Rhino calls RunCommand to run the command.
CRhinoCommand::result RunCommand(const CRhinoCommandContext& context) override;
};
// The one and only CCommandSampleDockBarDialog object
// Do NOT create any other instance of a CCommandSampleDockBarDialog class.
static class CCommandSampleDockBarDialog theSampleDockBarDialogCommand;
CRhinoCommand::result CCommandSampleDockBarDialog::RunCommand(const CRhinoCommandContext& context)
{
ON_UUID tabId = CSampleTabbedDockBarDialog::Id();
if (context.IsInteractive())
{
CRhinoTabbedDockBarDialog::OpenDockbarTab(context.m_doc, tabId);
}
else
{
bool bVisible = CRhinoTabbedDockBarDialog::IsTabVisible(context.m_doc, tabId);
ON_wString str;
str.Format(L"%ls is %ls. New value", LocalCommandName(), bVisible ? L"visible" : L"hidden");
CRhinoGetOption go;
go.SetCommandPrompt(str);
int h_option = go.AddCommandOption(RHCMDOPTNAME(L"Hide"));
int s_option = go.AddCommandOption(RHCMDOPTNAME(L"Show"));
int t_option = go.AddCommandOption(RHCMDOPTNAME(L"Toggle"));
go.GetOption();
if (go.CommandResult() != CRhinoCommand::success)
return go.CommandResult();
const CRhinoCommandOption* option = go.Option();
if (0 == option)
return CRhinoCommand::failure;
int option_index = option->m_option_index;
if (h_option == option_index && bVisible)
CRhinoTabbedDockBarDialog::ShowDockbarTab(context.m_doc, tabId, false, false, nullptr);
else if (s_option == option_index && !bVisible)
CRhinoTabbedDockBarDialog::ShowDockbarTab(context.m_doc, tabId, true, true, nullptr);
else if (t_option == option_index)
CRhinoTabbedDockBarDialog::ShowDockbarTab(context.m_doc, tabId, !bVisible, !bVisible, nullptr);
}
return CRhinoCommand::success;
}
#pragma endregion
//
// END SampleDockBarDialog command
//
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////
| [
"dale@mcneel.com"
] | dale@mcneel.com |
55e0395daeea59e65aeb41fba747c6f0587aad6b | 793855fd70e55afbd4ab808468e6da5e6905ccf3 | /hw8/product_parser.h | 57389ac4b9d0f21246826720658109a885be6dc0 | [] | no_license | valentea/hw-2304317973 | a948c6096d00d16074e7d608d63701415d184310 | 31b763b299b2ccff42a7c6bf684232846ac29e72 | refs/heads/master | 2021-01-13T13:20:22.781618 | 2017-05-09T18:21:04 | 2017-05-09T18:21:04 | 78,605,636 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,951 | h | #ifndef PRODUCT_PARSER_H
#define PRODUCT_PARSER_H
#include <string>
#include <iostream>
#include "product.h"
class ProductParser {
public:
ProductParser();
virtual ~ProductParser();
/**
* Parses product info from the given input stream
*/
Product *parse(std::string category,
std::istream &is,
bool &error,
std::string &errorMsg,
int &lineno);
/**
* Returns the product category for this parser
*/
virtual std::string categoryID() = 0;
protected:
/**
* Parses the common data members of a product
*/
void parseCommonProduct(std::istream &is,
bool &error,
std::string &errorMsg,
int &lineno);
/**
* Parses the unique data members of a specific product type
* and allocates a specific Product object
*/
virtual Product *parseSpecificProduct(std::string category,
std::istream &is,
bool &error,
std::string &errorMsg,
int &lineno) = 0;
/**
* Dynamically allocates a specific product type from the data
* parsed and stored in the specific product parser
*/
virtual Product *makeProduct() = 0;
std::string prodName_;
double price_;
int qty_;
};
class ProductBookParser : public ProductParser {
public:
ProductBookParser();
Product *parseSpecificProduct(std::string category,
std::istream &is,
bool &error,
std::string &errorMsg,
int &lineno);
std::string categoryID();
protected:
Product *makeProduct();
private:
std::string isbn_;
std::string author_;
};
class ProductClothingParser : public ProductParser {
public:
ProductClothingParser();
Product *parseSpecificProduct(std::string category,
std::istream &is,
bool &error,
std::string &errorMsg,
int &lineno);
std::string categoryID();
protected:
Product *makeProduct();
private:
std::string size_;
std::string brand_;
};
class ProductMovieParser : public ProductParser {
public:
ProductMovieParser();
Product *parseSpecificProduct(std::string category,
std::istream &is,
bool &error,
std::string &errorMsg,
int &lineno);
std::string categoryID();
protected:
Product *makeProduct();
private:
std::string genre_;
std::string rating_;
};
#endif
| [
"valentea@usc.edu"
] | valentea@usc.edu |
7e14b517e3ab06ccad93924250303aca4fc73e50 | 43b3fbca48883d627141321d55f75ba282fac2a9 | /am-modulator/am-modulator.h | 04eedb1fa3033b0c57e507b9dad6099ed5ec7c6f | [] | no_license | antonjan/transmitting-tests | d86c9652df8a765cdaa26e797f6015f6a4baf13b | 8d90df8a549526319182131382e107e40b942135 | refs/heads/master | 2021-02-04T19:05:13.283600 | 2020-02-28T07:22:17 | 2020-02-28T07:22:17 | 243,700,567 | 2 | 0 | null | 2020-02-28T07:09:31 | 2020-02-28T07:09:30 | null | UTF-8 | C++ | false | false | 1,916 | h | #
/*
* Copyright (C) 2019
* Jan van Katwijk (J.vanKatwijk@gmail.com)
* Lazy Chair Computing
*
* This file is part of the am modulator
*
* am modulator is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* am modulator is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with modulator; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __AM_MODULATOR__
#define __AM_MODULATOR__
#include <stdint.h>
#include <stdio.h>
#include <QMainWindow>
#include <QLabel>
#include <sndfile.h>
#include "ringbuffer.h"
#include "tcp-client.h"
#include "spectrum-viewer.h"
#include "ui_am-modulator.h"
#include "ringbuffer.h"
class QSettings;
class fileProcessor;
class amModulator: public QMainWindow,
private Ui_MainWindow {
Q_OBJECT
public:
amModulator (QSettings *modulatorSettings,
int rate,
tcpClient *theGenerator,
QWidget *parent = NULL);
~amModulator (void);
private slots:
void go (void);
private:
fileProcessor *theReader;
QSettings *modulatorSettings;
int rate;
tcpClient *theGenerator;
RingBuffer<std::complex<float>> *scopeBuffer;
spectrumViewer *scope;
std::atomic<bool> running;
SNDFILE *infile;
SF_INFO sf_info;
void closeEvent (QCloseEvent *event);
public slots:
void showSpectrum (void);
};
#endif
| [
"J.vanKatwijk@gmail.com"
] | J.vanKatwijk@gmail.com |
ca01de953f8bfd8dce3fd3eabaa1b9597a37beac | 07cd8cc063c11bc25cc904a072883cf19f61a757 | /src/Event/EventBaseObject.h | 7fa29381d4c98967a3fe9b065757947fb1e2ea6d | [] | no_license | GbaLog/socks5 | 67c252ac439f53661e15bd1c56c6cf2ca647bf65 | 0c7198bee99394069b36aa2c8f4aa5bb169a1273 | refs/heads/master | 2022-11-11T14:23:22.817101 | 2020-07-05T15:51:05 | 2020-07-05T15:51:05 | 242,535,220 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 246 | h | #ifndef EventBaseObjectH
#define EventBaseObjectH
#include "EventSocketCommon.h"
class EventBaseObject
{
public:
EventBaseObject();
EventBasePtr get() const;
private:
EventBasePtr _base;
};
#endif // EVENTBASEOBJECT_H
| [
"gbalog@inbox.ru"
] | gbalog@inbox.ru |
f530768bcce71fbb23226c19a37672c6cd8f7e06 | 7763ebabad16e792d41ba2753a9746bf7496a26e | /cocos2D/Utility/Code/Background/ObjectBGEntity.h | d053d7c2a1ac35b7becf074dd0187d9b39e32aa5 | [] | no_license | flowerfx/ColorLockPuzzle | a4dc1ebf4ccfce74da5bb1f4472c71d2182351bc | 2e17e6305a437a1e1c76093d82f63703ecfa3def | refs/heads/master | 2021-01-10T23:31:44.419176 | 2020-05-06T14:04:09 | 2020-05-06T14:04:09 | 69,724,573 | 1 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 1,810 | h | #ifndef __OBJECT_BG_ENTITY_H__
#define __OBJECT_BG_ENTITY_H__
#include "../DisplayView.h"
#if USE_DYNAMIC_BG
#include "../Object/BasicObject.h"
#include "cocos2d.h"
#include "RKString_Code/RKString.h"
USING_NS_CC;
namespace Utility
{
namespace Background
{
class BGEntity : public Object::BasicObject
{
protected:
Vec2 p_PointToMoveTo;
Vec2 p_VectorMove;
RKString p_name_object_bg;
bool p_HaveFadeZoom;
bool p_HaveFadeOpacity;
void InitWithName(RKString name);
std::map<RKString, xml::BasicDec *> p_action_dec;
bool p_isFinishAction;
bool p_haveActionDone;
Vec2 p_PosThreadHoldRemove;
bool IsOutOfTHreadHold();
virtual bool OnFinishAction(Object::BASIC_ACTION ba);
virtual void EventActionFinish();
public:
BGEntity();
BGEntity(RKString name);
virtual ~BGEntity();
void SetScaleBG(Vec2 s);
Vec2 GetScaleBG();
bool VisibleBG();
void VisibleBG(bool b);
Vec2 GetSizeBG();
void SetSizeBG(Vec2 s);
void SetPositionBG(Vec2 p);
Vec2 GetPositionBG();
bool HaveFadeZoom() { return p_HaveFadeZoom; }
void SetHaveFadeZoom(bool val) { p_HaveFadeZoom = val; }
bool HaveFadeOpacity() { return p_HaveFadeOpacity; }
void SetHaveFadeOpacity(bool val) { p_HaveFadeOpacity = val; }
void SetActionDec(std::map<RKString, xml::BasicDec *> action);
virtual void Init() ;
virtual void Draw(Renderer *renderer, const Mat4& transform, uint32_t flags) ;
virtual void Visit(Renderer *renderer, const Mat4& transform, uint32_t flags) ;
virtual void Update(float dt) ;
void MoveToPoint(Vec2 p);
void TimeMove(float s) { time_move_to = s; }
void SetTheThreadHold(Vec2 value, Vec2 vectormove);
bool IsFinishAction() { return p_isFinishAction; }
};
}
}
#endif
#endif //__OBJECT_BG_ENTITY_H__
| [
"qchien.gl@hotmail.com"
] | qchien.gl@hotmail.com |
97f6a485f531ceb1909a53fca3a2f0f179483bb8 | 11ef4bbb8086ba3b9678a2037d0c28baaf8c010e | /Source Code/server/binaries/chromium/gen/content/common/frame_messages.mojom-shared.cc | fa864356d8aa8f773504f8c921b7b4788c45da26 | [] | no_license | lineCode/wasmview.github.io | 8f845ec6ba8a1ec85272d734efc80d2416a6e15b | eac4c69ea1cf0e9af9da5a500219236470541f9b | refs/heads/master | 2020-09-22T21:05:53.766548 | 2019-08-24T05:34:04 | 2019-08-24T05:34:04 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,550 | cc | // Copyright 2016 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.
#if defined(_MSC_VER)
#pragma warning(push)
#pragma warning(disable:4065)
#endif
#include "content/common/frame_messages.mojom-shared.h"
#include <utility>
#include "base/logging.h"
#include "base/stl_util.h" // for base::size()
#include "mojo/public/cpp/bindings/lib/validate_params.h"
#include "mojo/public/cpp/bindings/lib/validation_context.h"
#include "mojo/public/cpp/bindings/lib/validation_errors.h"
#include "mojo/public/cpp/bindings/lib/validation_util.h"
#include "content/common/frame_messages.mojom-params-data.h"
namespace content {
namespace mojom {
namespace internal {
// static
bool DidCommitProvisionalLoadInterfaceParams_Data::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) {
if (!data)
return true;
if (!ValidateStructHeaderAndClaimMemory(data, validation_context))
return false;
// NOTE: The memory backing |object| may be smaller than |sizeof(*object)| if
// the message comes from an older version.
const DidCommitProvisionalLoadInterfaceParams_Data* object = static_cast<const DidCommitProvisionalLoadInterfaceParams_Data*>(data);
static constexpr struct {
uint32_t version;
uint32_t num_bytes;
} kVersionSizes[] = {{ 0, 24 }};
if (object->header_.version <=
kVersionSizes[base::size(kVersionSizes) - 1].version) {
// Scan in reverse order to optimize for more recent versions.
for (int i = base::size(kVersionSizes) - 1; i >= 0; --i) {
if (object->header_.version >= kVersionSizes[i].version) {
if (object->header_.num_bytes == kVersionSizes[i].num_bytes)
break;
ReportValidationError(
validation_context,
mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER);
return false;
}
}
} else if (object->header_.num_bytes <
kVersionSizes[base::size(kVersionSizes) - 1].num_bytes) {
ReportValidationError(
validation_context,
mojo::internal::VALIDATION_ERROR_UNEXPECTED_STRUCT_HEADER);
return false;
}
if (!mojo::internal::ValidateHandleOrInterfaceNonNullable(
object->interface_provider_request, 1, validation_context)) {
return false;
}
if (!mojo::internal::ValidateHandleOrInterface(object->interface_provider_request,
validation_context)) {
return false;
}
if (!mojo::internal::ValidateHandleOrInterfaceNonNullable(
object->document_interface_broker_content_request, 2, validation_context)) {
return false;
}
if (!mojo::internal::ValidateHandleOrInterface(object->document_interface_broker_content_request,
validation_context)) {
return false;
}
if (!mojo::internal::ValidateHandleOrInterfaceNonNullable(
object->document_interface_broker_blink_request, 3, validation_context)) {
return false;
}
if (!mojo::internal::ValidateHandleOrInterface(object->document_interface_broker_blink_request,
validation_context)) {
return false;
}
return true;
}
DidCommitProvisionalLoadInterfaceParams_Data::DidCommitProvisionalLoadInterfaceParams_Data()
: header_({sizeof(*this), 0}) {}
} // namespace internal
} // namespace mojom
} // namespace content
#if defined(_MSC_VER)
#pragma warning(pop)
#endif | [
"wasmview@gmail.com"
] | wasmview@gmail.com |
feed8e403517bf33bf3eae16a798f418fc47367c | f3c60e4671480bae1a4b0117687da7d8b5cd06a9 | /others/04/6255.cpp | c8be5dbf872d8b71044941b7c140d9e6f488d25b | [] | no_license | nathanPro/mac0214 | c971fd96d1a4517685b1cf7bb12379348889aad9 | 57b99deda183ab280901d019fa58e0f2016fe675 | refs/heads/master | 2021-01-21T04:53:57.302770 | 2016-06-23T16:23:49 | 2016-06-23T16:23:49 | 51,778,456 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 896 | cpp | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 20;
const int S = 1<<N;
int n;
int d[N][N], ans[N], as;
int sol[S];
int i, j, s, t, tc;
int main(){
scanf(" %d", &tc);
for(t=1;t<tc+1;t++){
scanf(" %d", &n);
for(i=0;i<n;i++)
for(j=0;j<n;j++) scanf(" %d", &d[i][j]);
sol[(1<<n)-1] = t;
for(s = (1<<n)-1;s;--s)
if(sol[s] == t){
for(i=0;i<n;i++)
if(s&(1<<i)){
int dbt = 0;
for(j=0;j<n;j++) if(s&(1<<j)) dbt += d[i][j];
if(dbt > 0) sol[s-(1<<i)] = t;
}
}
as = 0;
for(i=0;i<n;i++) if(sol[1<<i] == t) ans[as++] = i;
if(as){
for(i=0;i<as;i++) printf("%d%c", ans[i]+1, " \n"[i+1==as]);
} else printf("%d\n", as);
}
}
| [
"nathan@vieiraproenca.com"
] | nathan@vieiraproenca.com |
2d02c475178db226a274c37b7fa31795825c877f | 5b18ff19d7f2a48d6d0f9821b92d5f89f474f5da | /ForwardMancala.cpp | afaefdc9e005243ef9645ba541145c660155d669 | [] | no_license | qmaruf/Topcoder | bf85d21ae2c10273f79264835f80c834c74d31cf | 5eebe752633598954471f809037a042807314ec8 | refs/heads/master | 2021-07-11T19:17:22.501667 | 2017-10-14T06:23:39 | 2017-10-14T06:23:39 | 106,244,088 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,639 | cpp | #include <bits/stdc++.h>
using namespace std;
struct ForwardMancala{
int tccheck(vector<int> vec)
{
int c = 0;
for(int i = 0; i < vec.size(); i++)
if(vec[i]){
// cout<<vec[i]<<endl;
c++;
}
// cout<<"c "<<c<<endl;
return c;
}
int get_min_pos(vector<int> vec)
{
// cout<<"in gmp"<<endl;
int val = 100;
int pos = -1;
for(int i = 0; i < vec.size(); i++)
{
if(vec[i])
{
if(vec[i] < val)
{
val = vec[i];
pos = i;
}
}
}
return pos;
}
vector <int> findMoves(vector <int> start)
{
int sz = start.size();
vector <int> ret;
while(true)
{
int c = tccheck(start);
// cout<<"ccc "<<c<<endl;
if(c <= 1)break;
int pos = get_min_pos(start);
ret.push_back(pos);
int val = start[pos];
start[pos] = 0;
pos = (pos+1)%sz;
while(val > 0)
{
val--;
start[pos] += 1;
pos = (pos+1)%sz;
}
}
return ret;
}
// BEGIN CUT HERE
public:
void run_test(int Case) { if ((Case == -1) || (Case == 0)) test_case_0(); if ((Case == -1) || (Case == 1)) test_case_1(); if ((Case == -1) || (Case == 2)) test_case_2(); if ((Case == -1) || (Case == 3)) test_case_3(); if ((Case == -1) || (Case == 4)) test_case_4(); }
private:
template <typename T> string print_array(const vector<T> &V) { ostringstream os; os << "{ "; for (typename vector<T>::const_iterator iter = V.begin(); iter != V.end(); ++iter) os << '\"' << *iter << "\","; os << " }"; return os.str(); }
void verify_case(int Case, const vector <int> &Expected, const vector <int> &Received) { cerr << "Test Case #" << Case << "..."; if (Expected == Received) cerr << "PASSED" << endl; else { cerr << "FAILED" << endl; cerr << "\tExpected: " << print_array(Expected) << endl; cerr << "\tReceived: " << print_array(Received) << endl; } }
void test_case_0() { int Arr0[] = {6,1,0,1}; vector <int> Arg0(Arr0, Arr0 + (sizeof(Arr0) / sizeof(Arr0[0]))); int Arr1[] = {1, 2, 3, 1, 2, 3 }; vector <int> Arg1(Arr1, Arr1 + (sizeof(Arr1) / sizeof(Arr1[0]))); verify_case(0, Arg1, findMoves(Arg0)); }
void test_case_1() { int Arr0[] = {0,10,0,0,0}; vector <int> Arg0(Arr0, Arr0 + (sizeof(Arr0) / sizeof(Arr0[0]))); int Arr1[] = { }; vector <int> Arg1(Arr1, Arr1 + (sizeof(Arr1) / sizeof(Arr1[0]))); verify_case(1, Arg1, findMoves(Arg0)); }
void test_case_2() { int Arr0[] = {0,1,0,1,0,1}; vector <int> Arg0(Arr0, Arr0 + (sizeof(Arr0) / sizeof(Arr0[0]))); int Arr1[] = {3, 4, 1, 2, 3, 4 }; vector <int> Arg1(Arr1, Arr1 + (sizeof(Arr1) / sizeof(Arr1[0]))); verify_case(2, Arg1, findMoves(Arg0)); }
void test_case_3() { int Arr0[] = {5,0,0,1,3,0,2,0}; vector <int> Arg0(Arr0, Arr0 + (sizeof(Arr0) / sizeof(Arr0[0]))); int Arr1[] = {3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7 }; vector <int> Arg1(Arr1, Arr1 + (sizeof(Arr1) / sizeof(Arr1[0]))); verify_case(3, Arg1, findMoves(Arg0)); }
void test_case_4() { int Arr0[] = {10,10,10,10,10,10,10,10,10,10}; vector <int> Arg0(Arr0, Arr0 + (sizeof(Arr0) / sizeof(Arr0[0]))); int Arr1[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; vector <int> Arg1(Arr1, Arr1 + (sizeof(Arr1) / sizeof(Arr1[0]))); verify_case(4, Arg1, findMoves(Arg0)); }
// END CUT HERE
};
// BEGIN CUT HERE
int main()
{
ForwardMancala ___test;
___test.run_test(-1);
int gbase;
//cin>>gbase; // erase this line if you are not using dev-cpp! :)
return 0;
}
// END CUT HERE
| [
"maruf.csdu@gmail.com"
] | maruf.csdu@gmail.com |
59f6424f50e375b6d62b5e8ca2624ccb5be8cee5 | 3fc7a3a162cb18fe246ab400b6ad46f73d88923e | /OD-BRT/src/node_factory.h | 9c75d1cd82efb9ae6f2299a7990ec2a19875b9a7 | [] | no_license | Hutchinson-Lab/StatEcoNet-AAAI21 | 1c0e10a0b05b3be39e98d7af7cb650f7319bc369 | cc48869c0437e6237a3a7d6e51e71db53f8b81f2 | refs/heads/main | 2023-08-16T05:55:52.014362 | 2021-06-16T22:51:55 | 2021-06-16T22:51:55 | 318,672,495 | 9 | 1 | null | 2023-08-10T06:03:39 | 2020-12-05T01:04:27 | Jupyter Notebook | UTF-8 | C++ | false | false | 1,662 | h | //------------------------------------------------------------------------------
// GBM by Greg Ridgeway Copyright (C) 2003
//
// File: node_factory.h
//
// License: GNU GPL (version 2 or later)
//
// Contents: manager for allocation and destruction of all nodes
//
// Owner: gregr@rand.org
//
// History: 3/26/2001 gregr created
// 2/14/2003 gregr: adapted for R implementation
//
//------------------------------------------------------------------------------
#ifndef NODEFACTORY_H
#define NODEFACTORY_H
#include <stack>
#include <list>
#include "node_terminal.h"
#include "node_continuous.h"
#include "node_categorical.h"
#define NODEFACTORY_NODGBM_RESERVE ((unsigned long)50)
using namespace std;
class CNodeFactory
{
public:
CNodeFactory();
~CNodeFactory();
GBMRESULT Initialize(unsigned long cDepth);
CNodeTerminal* GetNewNodeTerminal();
CNodeContinuous* GetNewNodeContinuous();
CNodeCategorical* GetNewNodeCategorical();
GBMRESULT RecycleNode(CNodeTerminal *pNode);
GBMRESULT RecycleNode(CNodeContinuous *pNode);
GBMRESULT RecycleNode(CNodeCategorical *pNode);
private:
stack<PCNodeTerminal> TerminalStack;
stack<PCNodeContinuous> ContinuousStack;
stack<PCNodeCategorical> CategoricalStack;
CNodeTerminal* pNodeTerminalTemp;
CNodeContinuous* pNodeContinuousTemp;
CNodeCategorical* pNodeCategoricalTemp;
CNodeTerminal aBlockTerminal[NODEFACTORY_NODGBM_RESERVE];
CNodeContinuous aBlockContinuous[NODEFACTORY_NODGBM_RESERVE];
CNodeCategorical aBlockCategorical[NODEFACTORY_NODGBM_RESERVE];
};
#endif // NODEFACTORY_H
| [
"seoe@oregonstate.edu"
] | seoe@oregonstate.edu |
0607bc3ad38b1370a64a92177936fcccca6a128d | a181a8e4c629a5337e19a6cd1a59007464935bbb | /src/hr/mcard.h | e69b75c9b658b85542790db9632d5ef2245fe07e | [] | no_license | ddpub/cafe | 1dfde966cbee6acb1cd622370d4291946dfe41e1 | e7ba88d1c9dcc1e449ebc6a2401c1f21192eac00 | refs/heads/master | 2021-10-27T21:56:56.684590 | 2011-10-02T18:31:19 | 2011-10-02T18:31:19 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 135 | h |
#ifndef mcardH
#define mcardH
bool WriteCard(std::string login, std::string password, bool low_co=false);
bool MSR_test();
#endif
| [
"dmitry.dergachev@gmail.com"
] | dmitry.dergachev@gmail.com |
8e087fe1b9e3edc55ac8a89bd64b1cd752c50246 | 08b8cf38e1936e8cec27f84af0d3727321cec9c4 | /data/crawl/git/old_hunk_3277.cpp | 8a94f915a1dd45fc80c6601e71ddd8275d9a161e | [] | no_license | ccdxc/logSurvey | eaf28e9c2d6307140b17986d5c05106d1fd8e943 | 6b80226e1667c1e0760ab39160893ee19b0e9fb1 | refs/heads/master | 2022-01-07T21:31:55.446839 | 2018-04-21T14:12:43 | 2018-04-21T14:12:43 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 110 | cpp | return negative ? 0 : positive;
}
/*
* Return the length of the "simple" part of a path match limiter.
*/
| [
"993273596@qq.com"
] | 993273596@qq.com |
e08dc0143fdbaad49850711f476e2f4a260627a9 | 4406f3159ef889915723a5776c0aa0c14c4e0038 | /code/instructions/inc/target_address.h | 2d9224e60d64a557be352d812f538a079262b603 | [
"MIT",
"LicenseRef-scancode-warranty-disclaimer",
"CC0-1.0"
] | permissive | ambaker-usgs/asl-manzano | a20d2a8637025b56cd32940b68f81a00cf396347 | b2ce9da3193398511ad37e159dd34a45548530cb | refs/heads/master | 2021-01-11T15:47:08.627503 | 2017-01-23T23:28:06 | 2017-01-23T23:28:06 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,264 | h | // Manzano Software //
#ifndef _MZN_TARGET_ADDRESS_H_
#define _MZN_TARGET_ADDRESS_H_
#include <sstream>
#include <stdexcept>
#include "target.h"
#include "mzn_except.h"
namespace mzn {
//! Provides the information needed to identify a seismic network component
/*! A target address can be incomplete or partial,
and then merge together with another to form a full target address.
It can be passed around cheaply and concentrates all the utilities of
figuring out what is the intended target.
@see TargetAddress
@author rfigueroa@usgs.gov
*/
// -------------------------------------------------------------------------- //
struct TargetAddress {
//! sn childs : station
Target sn_child = Target{Scope::none_};
//! st childs : digitizer, data_processor
Target st_child = Target{Scope::none_};
//! q childs : sensor
Target q_child = Target{Scope::none_};
// --------------------------------------------------------------------- //
TargetAddress() = default;
~TargetAddress() = default;
// --------------------------------------------------------------------- //
explicit
TargetAddress(Target in_sn_child,
Target in_st_child = Target{Scope::none_},
Target in_q_child = Target{Scope::none_}) :
sn_child(in_sn_child),
st_child(in_st_child),
q_child(in_q_child) {}
//! called from green_manzano (user_interpreter::run_user_input)
//! when this ta is not complete, it can add parents from other ta
//! in this case the current_ta_ from InstructionInterpreter
//! @throws warning if fails
// --------------------------------------------------------------------- //
void add_targets_from_ta(TargetAddress const & from_ta);
//! called from green_manzano, to add one target at a time from
//! a series of targets read from a string
//! @throws warning if fails
// --------------------------------------------------------------------- //
void add_target(Target const & ta);
//! or is full address
// --------------------------------------------------------------------- //
inline
bool scope_is_complete() const {return ( Scope::none_ != scope() ); }
//! For a ta that is complete, these functions are interested in the scope
//! of the end of the address
// --------------------------------------------------------------------- //
inline
bool scope_is_sn() const { return sn_child.scope == Scope::none_ and
st_child.scope == Scope::none_ and
q_child.scope == Scope::none_; }
inline
bool scope_is_st() const { return sn_child.scope == Scope::station and
st_child.scope == Scope::none_ and
q_child.scope == Scope::none_; }
inline
bool scope_is_q() const { return sn_child.scope == Scope::station and
st_child.scope == Scope::digitizer and
q_child.scope == Scope::none_; }
inline
bool scope_is_s() const { return sn_child.scope == Scope::station and
st_child.scope == Scope::digitizer and
q_child.scope == Scope::sensor; }
inline
bool scope_is_dp() const { return sn_child.scope == Scope::station and
st_child.scope == Scope::data_processor and
q_child.scope == Scope::none_; }
// scope at the end of the address
// --------------------------------------------------------------------- //
Scope scope() const;
//! scope at the end of the address
//! should be used with full address all over the program
// --------------------------------------------------------------------- //
Target target() const;
//! removes the target at the end of the address
// --------------------------------------------------------------------- //
void remove_one_target();
//! hash using the target at the end of the address
//! should be used with full address all over the program
// --------------------------------------------------------------------- //
uint32_t const hash() const;
};
// -------------------------------------------------------------------------- //
inline
std::ostream & operator<<(std::ostream & os,
TargetAddress const & target_address) {
if (target_address.sn_child.scope != Scope::none_)
os << target_address.sn_child;
if (target_address.st_child.scope != Scope::none_)
os << target_address.st_child;
if (target_address.q_child.scope != Scope::none_)
os << target_address.q_child;
if ( target_address.scope_is_sn() )
os << "sn";
return os;
}
// -------------------------------------------------------------------------- //
inline
bool operator==(TargetAddress const & lhs,
TargetAddress const & rhs) {
return (lhs.sn_child == rhs.sn_child) and
(lhs.st_child == rhs.st_child) and
(lhs.q_child == rhs.q_child);
}
} // end namespace
#endif
| [
"rfigueroa@usgs.gov"
] | rfigueroa@usgs.gov |
e22d5c78c2c0f33064fb0f2a1ca53a5c8f3b618e | 50e0f9b28924b0fd241d8e94e517533cc49b0d98 | /src/CxxAbbCore/include/CxxAbb/Timestamp.h | 90340879e22afe9a13f38e9d34d324df1599a58e | [] | no_license | PrabodhaSrimal/CxxABB | 120c30689257a969d408461eb6ed6be069579baf | 759ed2f29661ad138ed7cfcb7fc32e1ccc21e796 | refs/heads/master | 2021-06-13T08:26:00.458020 | 2017-03-23T07:39:38 | 2017-03-23T07:39:38 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,538 | h | /**
* _| _|
* _|_|_| _| _| _| _| _|_|_| _|_|_| _|_|_|
* _| _|_| _|_| _| _| _| _| _| _|
* _| _| _| _| _| _| _| _| _| _| _|
* _|_|_| _| _| _| _| _|_|_| _|_|_| _|_|_|
*
* CxxABB - C++ Application Building Blocks
*
* Copyright (C) 2017 Prabodha Srimal <prabodha007@gmail.com>
*
*
* Timestamp.h
*
* FileId : $Id: Timestamp.h 20 2012-11-22 07:46:58Z prabodar $
*
* Created by : Prabodha Srimal <prabodha007@gmail.com> - Sep 16, 2012
* Edited by : $Author: prabodar $
* Edited date : $Date: 2012-11-22 13:16:58 +0530 (Thu, 22 Nov 2012) $
* Version : $Revision: 20 $
*
* Library : CxxAbbCore
* Module : Core
* Comment : Timestamp representation
*
*/
#ifndef CXXABB_CORE_TIMESTAMP_H_
#define CXXABB_CORE_TIMESTAMP_H_
#include <CxxAbb/Core.h>
#include <ctime>
namespace CxxAbb
{
/** @brief Timestamp class for representing instance in time (Microsecond Resolution)
* This class also support difference between two instance in time
* The void Now() method updates the timestamp for current instance of time.
* Base point of timestamp may vary in platform implementation. Usually its Epoch.
*/
class CXXABB_API Timestamp
{
public:
typedef CxxAbb::Int64 TimeVal; /// monotonic time value in microsecond resolution (Epoch)
/// 100 nanosecond units since 1582-10-15 Midnight (Gregorian Calendar Start)
typedef CxxAbb::Int64 UtcTimeVal;
typedef CxxAbb::Int64 TimeDiff; /// difference between two Timestamps in microseconds
static const CxxAbb::UInt32 MuSecPerSecond = 1000000;
/** @brief Creates timestamp for NOW
*
*/
Timestamp();
/** @brief Create timestamp from timeval
*/
Timestamp(TimeVal _timeval);
/** @brief Copy ctor
*
*/
Timestamp(const Timestamp& _other);
/** @brief Dtor
*
*/
~Timestamp();
/** @brief Set current timestamp for NOW
* This has platform specific impl
*/
void Now();
/** @brief Swap
*
*/
void Swap(Timestamp& _timestamp);
/** @brief Operators
*
*/
Timestamp& operator = (const Timestamp& _other);
Timestamp& operator = (TimeVal _tv);
bool operator == (const Timestamp& _ts) const;
bool operator != (const Timestamp& _ts) const;
bool operator > (const Timestamp& _ts) const;
bool operator >= (const Timestamp& _ts) const;
bool operator < (const Timestamp& _ts) const;
bool operator <= (const Timestamp& _ts) const;
Timestamp operator + (TimeDiff _diff) const;
Timestamp operator - (TimeDiff _diff) const;
TimeDiff operator - (const Timestamp& _ts) const;
Timestamp& operator += (TimeDiff _diff);
Timestamp& operator -= (TimeDiff _diff);
/** @brief Get Epoch representation of current timestamp
* @return std::time_t Epoch time in time_t (seconds)
* Epoch is based on 1970-01-01 Midnight
*/
std::time_t Epoch() const;
/** @brief Get UTC representation of current timestamp
* @return UtcTimeVal 100 nanoseconds units since UTC base
*/
UtcTimeVal Utc() const;
/** @brief Get Epoch representation of current timestamp in Microseconds
* @return TimeVal Epoch time in Microseconds
* Epoch is based on 1970-01-01 Midnight
*/
TimeVal EpochMicroseconds() const;
/** @brief Get elapsed time in microseconds
* @return TimeDiff Now - *this
*/
TimeDiff Elapsed() const;
/** @brief Check if given interval is elapsed
*
*/
bool IsElapsed(TimeDiff _interval) const;
/** @brief Converters from Epoch
*
*/
static Timestamp FromEpoch(std::time_t t);
/** @brief Converters from UTC
*
*/
static Timestamp FromUtc(UtcTimeVal val);
/** @brief Resolution of the timestamp
* Always 1000000
*/
static TimeVal Resolution()
{
return MuSecPerSecond;
}
private:
/// Current timestamp in microsecond resolution. Base point is not considered.
TimeVal t_Value;
};
// inlines
inline void Timestamp::Swap(Timestamp& _timestamp)
{
std::swap(t_Value, _timestamp.t_Value);
}
inline Timestamp& Timestamp::operator = (const Timestamp& _other)
{
t_Value = _other.t_Value;
return *this;
}
inline Timestamp& Timestamp::operator = (TimeVal _tv)
{
t_Value = _tv;
return *this;
}
inline bool Timestamp::operator == (const Timestamp& _ts) const
{
return (t_Value == _ts.t_Value);
}
inline bool Timestamp::operator !=(const Timestamp& _ts) const
{
return (t_Value != _ts.t_Value);
}
inline bool Timestamp::operator > (const Timestamp& _ts) const
{
return (t_Value > _ts.t_Value);
}
inline bool Timestamp::operator >= (const Timestamp& _ts) const
{
return (t_Value >= _ts.t_Value);
}
inline bool Timestamp::operator < (const Timestamp& _ts) const
{
return (t_Value < _ts.t_Value);
}
inline bool Timestamp::operator <= (const Timestamp& _ts) const
{
return (t_Value <= _ts.t_Value);
}
inline Timestamp Timestamp::operator + (TimeDiff _diff) const
{
return (t_Value + _diff);
}
inline Timestamp Timestamp::operator - (TimeDiff _diff) const
{
return (t_Value - _diff);
}
inline Timestamp::TimeDiff Timestamp::operator - (const Timestamp& _ts) const
{
return TimeDiff(t_Value - _ts.t_Value);
}
inline Timestamp& Timestamp::operator += (TimeDiff _diff)
{
t_Value += _diff;
return *this;
}
inline Timestamp& Timestamp::operator -= (TimeDiff _diff)
{
t_Value -= _diff;
return *this;
}
} /* namespace CxxAbb */
#endif /* CXXABB_CORE_TIMESTAMP_H_ */
| [
"prabodha007@gmail.com"
] | prabodha007@gmail.com |
a55a86b88743904330f4759df743e90c95a279a4 | d9b4adb8bdd3a19859b050c1735d06a380bb9929 | /poj-cpp/1083/14260736_WA.cc | e3d014851a673e107c63927389d889050d70912f | [] | no_license | conwnet/way-of-algorithm | eea4901ab62a6bc189e5c60209dc1e8610f76806 | 201df876cf55a7eae7e55789f2fa43d2f2545628 | refs/heads/master | 2021-07-31T19:17:48.871429 | 2021-07-24T17:42:30 | 2021-07-24T17:42:30 | 75,063,660 | 20 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 588 | cc | #include <stdio.h>
#include <string.h>
int arr[500];
int main()
{
int T, a, b, i, N;
scanf("%d", &T);
while(T--) {
memset(arr, 0, sizeof(arr));
scanf("%d", &N);
while(N--) {
scanf("%d%d", &a, &b);
for(i=a; i<=b; i++) arr[i]++;
}
int maxn = 0;
for(i=0; i<=400; i++)
if(arr[i]>maxn) maxn = arr[i];
printf("%d\n", maxn*10);
}
return 0;
}
| [
"netcon@live.com"
] | netcon@live.com |
f1141b4542c527f0c306daeef3fde0b92ad14afa | 189f52bf5454e724d5acc97a2fa000ea54d0e102 | /ras/fluidisedBed/0.65/U.particles | c949ce7f4cd8caafd8d7e49f9c7c626d07b68ad0 | [] | no_license | pyotr777/openfoam_samples | 5399721dd2ef57545ffce68215d09c49ebfe749d | 79c70ac5795decff086dd16637d2d063fde6ed0d | refs/heads/master | 2021-01-12T16:52:18.126648 | 2016-11-05T08:30:29 | 2016-11-05T08:30:29 | 71,456,654 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 149,415 | particles | /*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1606+ |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
location "0.65";
object U.particles;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -1 0 0 0 0];
internalField nonuniform List<vector>
6000
(
(-0.0119175 -0.43545 0)
(-0.00594249 -0.442552 0)
(0.0101403 -0.436193 0)
(0.0298626 -0.430585 0)
(0.0428598 -0.441055 0)
(0.0483537 -0.466175 0)
(0.0421434 -0.481051 0)
(0.0325114 -0.482384 0)
(0.0222593 -0.486531 0)
(0.0158881 -0.503515 0)
(0.0138844 -0.522708 0)
(0.0132617 -0.54323 0)
(0.00294123 -0.56083 0)
(-0.00352087 -0.573017 0)
(-0.00222444 -0.569858 0)
(0.00120413 -0.57389 0)
(0.00148119 -0.577127 0)
(-0.00675022 -0.555693 0)
(-0.0139713 -0.540805 0)
(-0.0184141 -0.518927 0)
(-0.022144 -0.499761 0)
(-0.0290306 -0.482899 0)
(-0.0396776 -0.4792 0)
(-0.0489914 -0.476169 0)
(-0.054306 -0.460434 0)
(-0.0474862 -0.435465 0)
(-0.0332501 -0.427475 0)
(-0.0125038 -0.437805 0)
(0.00464431 -0.443128 0)
(0.011984 -0.43655 0)
(0.0163112 -0.00534396 0)
(0.000843346 0.0438418 0)
(0.0149319 0.0385921 0)
(0.0419555 0.0267179 0)
(0.0677547 0.0171959 0)
(0.0814015 0.00408382 0)
(0.0809527 -0.00979948 0)
(0.0704345 -0.0113507 0)
(0.0551313 0.000966141 0)
(0.0347885 0.0211643 0)
(0.00123602 0.0280717 0)
(-0.0250056 0.0150252 0)
(-0.0317884 0.0088275 0)
(-0.0239153 0.0193127 0)
(-0.00729038 0.0153205 0)
(0.011489 0.0174665 0)
(0.0253512 0.0187692 0)
(0.0288457 0.00868913 0)
(0.0173914 0.0172669 0)
(-0.0136726 0.0254166 0)
(-0.0446051 0.0180863 0)
(-0.0638059 -0.000936377 0)
(-0.0787159 -0.0119265 0)
(-0.0887687 -0.00812676 0)
(-0.0879032 0.00491327 0)
(-0.072355 0.0181058 0)
(-0.045684 0.0281837 0)
(-0.0183551 0.0417354 0)
(-0.00420217 0.0445288 0)
(-0.0169416 -0.00726984 0)
(-0.0128791 0.0301045 0)
(-0.0142893 -0.000858955 0)
(0.0147775 -0.0323079 0)
(0.039793 -0.0408096 0)
(0.0652941 -0.0260974 0)
(0.0846854 -0.00101701 0)
(0.0900608 0.0098091 0)
(0.0846071 0.0111046 0)
(0.0669323 0.0104505 0)
(0.0355494 0.00964108 0)
(-0.00925541 -0.0014769 0)
(-0.0376575 -0.0305815 0)
(-0.0429868 -0.0711006 0)
(-0.0312771 -0.101198 0)
(-0.00863322 -0.107866 0)
(0.0159372 -0.107703 0)
(0.0337553 -0.0940479 0)
(0.0404994 -0.0600812 0)
(0.0290567 -0.0203841 0)
(-0.00376854 0.00475879 0)
(-0.0482102 0.0110741 0)
(-0.0767473 0.0119075 0)
(-0.0926462 0.0126024 0)
(-0.0969836 0.0108732 0)
(-0.0900531 -0.0023502 0)
(-0.0698191 -0.0289765 0)
(-0.04421 -0.043509 0)
(-0.0186058 -0.0350848 0)
(0.0123898 -0.00618257 0)
(0.0130568 0.0274339 0)
(0.00692242 0.128347 0)
(-0.00760377 0.0855054 0)
(0.0051471 0.0544008 0)
(0.0158941 0.0443849 0)
(0.0317243 0.0492664 0)
(0.0546908 0.0670324 0)
(0.0686573 0.0812436 0)
(0.0675803 0.0817802 0)
(0.057577 0.074655 0)
(0.0338345 0.0635228 0)
(-0.0100921 0.0434894 0)
(-0.044169 0.0105278 0)
(-0.0575277 -0.0155285 0)
(-0.0436676 -0.0382179 0)
(-0.0123976 -0.0526282 0)
(0.0238636 -0.0475786 0)
(0.047708 -0.0288514 0)
(0.0527275 -0.0081006 0)
(0.0337358 0.0200532 0)
(-0.00334012 0.0506902 0)
(-0.0441029 0.0685209 0)
(-0.0654028 0.0783485 0)
(-0.0741596 0.0845677 0)
(-0.0743148 0.0820946 0)
(-0.0590702 0.0663056 0)
(-0.0364256 0.0481137 0)
(-0.0213115 0.0430927 0)
(-0.01038 0.0519777 0)
(0.00484937 0.0803856 0)
(-0.00645549 0.124831 0)
(0.00650925 0.150332 0)
(-0.0101002 0.112628 0)
(-0.013008 0.067048 0)
(-0.0131387 0.0554566 0)
(-0.00881027 0.0690181 0)
(0.00567206 0.100183 0)
(0.0213876 0.13585 0)
(0.0223142 0.158414 0)
(0.0107338 0.159026 0)
(-0.010747 0.151894 0)
(-0.0473681 0.127595 0)
(-0.0804553 0.08071 0)
(-0.0864647 0.0253563 0)
(-0.063292 -0.0211288 0)
(-0.017328 -0.0480388 0)
(0.0351648 -0.0385013 0)
(0.070713 -0.00362046 0)
(0.0839628 0.0417414 0)
(0.0699502 0.0950162 0)
(0.0345478 0.136656 0)
(0.0021166 0.156681 0)
(-0.0172231 0.162211 0)
(-0.0281064 0.159571 0)
(-0.0255483 0.134096 0)
(-0.00967908 0.0985997 0)
(0.0035623 0.0660558 0)
(0.00728542 0.0517423 0)
(0.00727338 0.0617576 0)
(0.00640032 0.104533 0)
(-0.005982 0.146248 0)
(-0.0058772 0.120153 0)
(-0.0128505 0.0916252 0)
(-0.0238224 0.0380962 0)
(-0.0326317 0.025952 0)
(-0.0376355 0.0434091 0)
(-0.0328719 0.0854257 0)
(-0.0214216 0.145507 0)
(-0.0177722 0.202174 0)
(-0.0340459 0.234146 0)
(-0.060313 0.238689 0)
(-0.0872725 0.213745 0)
(-0.105262 0.157434 0)
(-0.0998542 0.0814183 0)
(-0.0716955 0.00289855 0)
(-0.0204402 -0.0488163 0)
(0.0415006 -0.0319036 0)
(0.0831832 0.036867 0)
(0.0993038 0.107965 0)
(0.0967745 0.176742 0)
(0.0758727 0.22311 0)
(0.0515729 0.240973 0)
(0.0272017 0.232261 0)
(0.014007 0.198333 0)
(0.0185989 0.140082 0)
(0.0293753 0.0812668 0)
(0.0326504 0.0385626 0)
(0.0269681 0.020177 0)
(0.0185358 0.0304141 0)
(0.00867749 0.0807575 0)
(0.00434487 0.11592 0)
(-0.0112246 -0.0558354 0)
(0.000775526 -0.0934533 0)
(-0.0101585 -0.0996047 0)
(-0.0249953 -0.0794872 0)
(-0.0393918 -0.0384173 0)
(-0.0430722 0.0221846 0)
(-0.0385727 0.110891 0)
(-0.0396095 0.198727 0)
(-0.0545126 0.266648 0)
(-0.0766729 0.297142 0)
(-0.0977497 0.284481 0)
(-0.105862 0.228712 0)
(-0.100391 0.128688 0)
(-0.0672472 0.00476061 0)
(-0.0162855 -0.0615114 0)
(0.0400506 -0.0373211 0)
(0.082286 0.0627326 0)
(0.0941991 0.174233 0)
(0.0945139 0.250707 0)
(0.0859394 0.2891 0)
(0.068816 0.293079 0)
(0.0487229 0.257056 0)
(0.0361239 0.190251 0)
(0.0359889 0.100365 0)
(0.0392088 0.0122102 0)
(0.0316419 -0.0520501 0)
(0.0162829 -0.0970429 0)
(0.00312654 -0.122017 0)
(-0.00521496 -0.11962 0)
(0.00714246 -0.0768538 0)
(0.00599149 -0.326627 0)
(0.0219347 -0.324849 0)
(0.0297686 -0.296573 0)
(0.0280985 -0.270358 0)
(0.018162 -0.22364 0)
(-0.00245773 -0.132856 0)
(-0.0226758 0.000775476 0)
(-0.0403105 0.152659 0)
(-0.0569942 0.26104 0)
(-0.0722563 0.309673 0)
(-0.0787437 0.311311 0)
(-0.0743851 0.267438 0)
(-0.0681043 0.153929 0)
(-0.0501271 -0.0105795 0)
(-0.0102266 -0.102404 0)
(0.0303685 -0.0627349 0)
(0.0515355 0.0789093 0)
(0.0549879 0.216448 0)
(0.06243 0.287294 0)
(0.0701781 0.310691 0)
(0.0650447 0.300975 0)
(0.0501699 0.244977 0)
(0.0329104 0.129318 0)
(0.0132915 -0.027635 0)
(-0.00839403 -0.161627 0)
(-0.0270295 -0.242587 0)
(-0.034558 -0.285635 0)
(-0.033865 -0.313685 0)
(-0.0235547 -0.33892 0)
(-0.00740426 -0.339613 0)
(0.0175873 -0.333692 0)
(0.03557 -0.34624 0)
(0.0509835 -0.348181 0)
(0.0607886 -0.345978 0)
(0.0691278 -0.334424 0)
(0.0602028 -0.294187 0)
(0.035114 -0.226336 0)
(0.01289 -0.0703271 0)
(-0.0169098 0.131808 0)
(-0.0328785 0.242084 0)
(-0.0341387 0.257904 0)
(-0.0210351 0.219545 0)
(-0.0219475 0.110331 0)
(-0.0272346 -0.0716883 0)
(-0.00631862 -0.192782 0)
(0.0133125 -0.133631 0)
(0.0126887 0.0251338 0)
(-0.00426381 0.163139 0)
(0.00738555 0.223365 0)
(0.0247474 0.24228 0)
(0.0216068 0.207995 0)
(0.00494831 0.079571 0)
(-0.02418 -0.113326 0)
(-0.0436251 -0.249663 0)
(-0.0657846 -0.311087 0)
(-0.0689612 -0.341302 0)
(-0.0599573 -0.350666 0)
(-0.0497187 -0.353498 0)
(-0.0346285 -0.351379 0)
(-0.0181736 -0.339215 0)
(0.0140994 -0.302972 0)
(0.0346598 -0.308715 0)
(0.0531022 -0.317371 0)
(0.0673029 -0.317608 0)
(0.0723666 -0.315641 0)
(0.068492 -0.321316 0)
(0.0487157 -0.331775 0)
(0.0529241 -0.288493 0)
(0.04723 -0.174675 0)
(0.0493886 -0.0602242 0)
(0.0463576 -0.0348207 0)
(0.0479963 -0.0637293 0)
(0.0390538 -0.124664 0)
(0.00305767 -0.235054 0)
(-0.00336297 -0.304134 0)
(-0.0279016 -0.292576 0)
(-0.0476911 -0.202962 0)
(-0.0623256 -0.123145 0)
(-0.0604614 -0.0849014 0)
(-0.0588774 -0.0686142 0)
(-0.0577831 -0.106947 0)
(-0.0567693 -0.215947 0)
(-0.0531211 -0.306045 0)
(-0.0474154 -0.337647 0)
(-0.0666901 -0.324341 0)
(-0.0719543 -0.318313 0)
(-0.0678031 -0.320975 0)
(-0.0539956 -0.322852 0)
(-0.0350211 -0.315229 0)
(-0.015158 -0.308135 0)
(0.0133825 -0.260441 0)
(0.0397414 -0.273224 0)
(0.0592511 -0.278442 0)
(0.0656191 -0.278925 0)
(0.0620336 -0.280821 0)
(0.0474791 -0.296754 0)
(0.0154326 -0.316891 0)
(0.00612198 -0.304947 0)
(0.023741 -0.275348 0)
(0.0513656 -0.243117 0)
(0.0634696 -0.23586 0)
(0.0430806 -0.245654 0)
(0.0314789 -0.275993 0)
(0.0287752 -0.347261 0)
(0.00353771 -0.375691 0)
(-0.0589034 -0.385048 0)
(-0.0527922 -0.31545 0)
(-0.0407174 -0.278331 0)
(-0.0541852 -0.257086 0)
(-0.0723493 -0.254165 0)
(-0.0468411 -0.258206 0)
(-0.0232266 -0.287032 0)
(-0.00560285 -0.311132 0)
(-0.0163981 -0.321894 0)
(-0.0502087 -0.298154 0)
(-0.0651639 -0.281857 0)
(-0.0683968 -0.281034 0)
(-0.0618359 -0.282359 0)
(-0.0425418 -0.279525 0)
(-0.01397 -0.268364 0)
(0.0178045 -0.220031 0)
(0.0420867 -0.235391 0)
(0.057698 -0.240087 0)
(0.0597968 -0.242244 0)
(0.050731 -0.246176 0)
(0.0340753 -0.255574 0)
(-0.0076185 -0.284717 0)
(-0.03452 -0.284443 0)
(-0.0270716 -0.234313 0)
(0.00627376 -0.219441 0)
(0.0251557 -0.213931 0)
(-0.00129422 -0.222315 0)
(-0.00691217 -0.271846 0)
(0.0141392 -0.350371 0)
(0.00371652 -0.388529 0)
(-0.0506293 -0.36984 0)
(-0.033072 -0.307006 0)
(-0.00286315 -0.265562 0)
(-0.0106765 -0.230216 0)
(-0.0326152 -0.227667 0)
(-0.00628817 -0.229834 0)
(0.0312102 -0.247176 0)
(0.0323408 -0.294213 0)
(0.00448378 -0.288528 0)
(-0.0360331 -0.257631 0)
(-0.0525472 -0.247374 0)
(-0.0617179 -0.244177 0)
(-0.0593815 -0.244275 0)
(-0.0436585 -0.241856 0)
(-0.0192139 -0.227719 0)
(0.0177066 -0.183741 0)
(0.038908 -0.195625 0)
(0.048662 -0.199606 0)
(0.0440574 -0.202776 0)
(0.0251596 -0.211413 0)
(-0.003149 -0.22961 0)
(-0.0313188 -0.251044 0)
(-0.0584214 -0.250478 0)
(-0.0699639 -0.203993 0)
(-0.0171911 -0.170091 0)
(-0.0100641 -0.16457 0)
(-0.0376443 -0.180557 0)
(-0.0290161 -0.255793 0)
(-0.0122096 -0.329918 0)
(-0.018917 -0.358575 0)
(-0.0399464 -0.339548 0)
(-0.0154224 -0.28097 0)
(0.0261876 -0.232047 0)
(0.0228765 -0.183965 0)
(0.000975401 -0.185008 0)
(0.0176475 -0.184769 0)
(0.0669323 -0.224938 0)
(0.0565979 -0.262498 0)
(0.0301391 -0.254836 0)
(-0.00114997 -0.227566 0)
(-0.0312038 -0.207697 0)
(-0.0494911 -0.201616 0)
(-0.0532022 -0.202192 0)
(-0.042476 -0.201876 0)
(-0.0191638 -0.192452 0)
(0.0169092 -0.145624 0)
(0.0333881 -0.153799 0)
(0.0375755 -0.154048 0)
(0.0266275 -0.156549 0)
(0.000744197 -0.168403 0)
(-0.0328451 -0.192337 0)
(-0.0635968 -0.217454 0)
(-0.0792723 -0.21402 0)
(-0.0850164 -0.164609 0)
(-0.0551201 -0.124309 0)
(-0.0410338 -0.120429 0)
(-0.0617866 -0.136955 0)
(-0.0447342 -0.231814 0)
(-0.0268564 -0.310742 0)
(-0.0226196 -0.3399 0)
(-0.028539 -0.324485 0)
(-0.0052886 -0.27234 0)
(0.0488919 -0.20133 0)
(0.0484923 -0.138717 0)
(0.0305564 -0.140891 0)
(0.058464 -0.146614 0)
(0.085253 -0.188666 0)
(0.081011 -0.224716 0)
(0.0630168 -0.216197 0)
(0.0212841 -0.179083 0)
(-0.0127289 -0.156051 0)
(-0.0346582 -0.151591 0)
(-0.0432332 -0.156135 0)
(-0.0380284 -0.160643 0)
(-0.0184293 -0.154792 0)
(0.0173469 -0.107285 0)
(0.0310281 -0.108275 0)
(0.031739 -0.100717 0)
(0.0157294 -0.0941991 0)
(-0.020558 -0.101328 0)
(-0.0619849 -0.134239 0)
(-0.0895933 -0.170977 0)
(-0.0967378 -0.174517 0)
(-0.104561 -0.126153 0)
(-0.0904757 -0.0709668 0)
(-0.0667883 -0.064412 0)
(-0.0632574 -0.101086 0)
(-0.0491213 -0.214996 0)
(-0.0216701 -0.292235 0)
(-0.0118624 -0.316683 0)
(-0.0273317 -0.312261 0)
(-0.00190461 -0.268481 0)
(0.0585314 -0.183385 0)
(0.0582751 -0.10075 0)
(0.0588297 -0.0858614 0)
(0.0903576 -0.0957411 0)
(0.106852 -0.151258 0)
(0.103116 -0.180269 0)
(0.0886599 -0.158299 0)
(0.038367 -0.117764 0)
(0.00599674 -0.102198 0)
(-0.0100629 -0.101563 0)
(-0.0214206 -0.107623 0)
(-0.02489 -0.117443 0)
(-0.0164918 -0.119132 0)
(0.0140891 -0.0729694 0)
(0.0256263 -0.073077 0)
(0.0270878 -0.0637005 0)
(0.0215291 -0.0554368 0)
(0.00829011 -0.0520055 0)
(-0.0290026 -0.0631072 0)
(-0.110057 -0.100954 0)
(-0.120655 -0.119408 0)
(-0.1061 -0.0850209 0)
(-0.100833 -0.0294515 0)
(-0.0920412 -0.0223001 0)
(-0.0859889 -0.082163 0)
(-0.0487797 -0.20884 0)
(-0.00398817 -0.2703 0)
(0.000856945 -0.279665 0)
(-0.0389781 -0.274536 0)
(-0.00529516 -0.261542 0)
(0.0573332 -0.17634 0)
(0.0905402 -0.0737711 0)
(0.0902313 -0.0412358 0)
(0.0976422 -0.0553695 0)
(0.123548 -0.0994377 0)
(0.122232 -0.121167 0)
(0.0825981 -0.0968259 0)
(0.0556528 -0.0660321 0)
(0.0433321 -0.0572333 0)
(0.0359343 -0.0564366 0)
(0.028525 -0.060237 0)
(0.0205722 -0.0657076 0)
(0.00702263 -0.0756204 0)
(0.00707727 -0.0448264 0)
(0.00842055 -0.0340822 0)
(0.0013334 -0.0234104 0)
(-0.00222088 -0.0155941 0)
(-0.0051738 -0.00635231 0)
(-0.0150653 -0.00196071 0)
(-0.0475802 -0.0291111 0)
(-0.13653 -0.0508064 0)
(-0.12854 -0.0166064 0)
(-0.107309 0.0200948 0)
(-0.105984 0.0186042 0)
(-0.0871895 -0.0442335 0)
(-0.0239502 -0.172135 0)
(0.00231618 -0.239789 0)
(-0.00814489 -0.248584 0)
(-0.0401133 -0.243629 0)
(-0.028531 -0.224762 0)
(0.021088 -0.130937 0)
(0.0847968 -0.0325132 0)
(0.0916525 0.00553375 0)
(0.11494 0.00845413 0)
(0.141574 -0.04053 0)
(0.123766 -0.0586113 0)
(0.088941 -0.0333192 0)
(0.0695199 -0.0116161 0)
(0.0604916 -0.012784 0)
(0.0517322 -0.0244201 0)
(0.043157 -0.0329131 0)
(0.0318391 -0.0344215 0)
(0.0156644 -0.0233041 0)
(-0.000687068 -0.0135616 0)
(-0.0120162 -0.00464657 0)
(-0.0201355 0.00325563 0)
(-0.0251273 0.0141248 0)
(-0.0276974 0.0321255 0)
(-0.031689 0.0492403 0)
(-0.0396699 0.0478584 0)
(-0.0939187 0.0192092 0)
(-0.164477 0.0339349 0)
(-0.108822 0.0950357 0)
(-0.081247 0.0794501 0)
(-0.0617717 -0.0111213 0)
(-0.00166576 -0.142243 0)
(0.00874853 -0.202964 0)
(0.00177857 -0.209274 0)
(-0.0344841 -0.202805 0)
(-0.0320805 -0.180993 0)
(-0.00853016 -0.0992455 0)
(0.0505005 0.023292 0)
(0.0892903 0.0852978 0)
(0.123022 0.0693586 0)
(0.145224 0.0106023 0)
(0.131951 0.00917405 0)
(0.119501 0.0441498 0)
(0.112741 0.0427467 0)
(0.102602 0.0187393 0)
(0.0845754 -0.00276553 0)
(0.0606436 -0.0125936 0)
(0.0260002 -0.0123224 0)
(0.00502798 -0.00536467 0)
(-0.00458253 0.00128697 0)
(-0.0195621 0.00977784 0)
(-0.0361801 0.0169924 0)
(-0.0519858 0.03001 0)
(-0.0634208 0.0574516 0)
(-0.0687591 0.0955108 0)
(-0.0748324 0.120015 0)
(-0.0853766 0.109516 0)
(-0.138119 0.0866722 0)
(-0.129507 0.137764 0)
(-0.0641613 0.157396 0)
(-0.011881 0.0400121 0)
(0.0113948 -0.101897 0)
(0.012628 -0.166375 0)
(0.0115583 -0.16945 0)
(-0.0288638 -0.159411 0)
(-0.0301942 -0.134756 0)
(-0.0323415 -0.0624572 0)
(0.000617496 0.0763951 0)
(0.068143 0.156406 0)
(0.132101 0.113246 0)
(0.171871 0.0584614 0)
(0.211019 0.0684161 0)
(0.161236 0.031827 0)
(0.157434 0.0470386 0)
(0.147942 0.037941 0)
(0.120715 0.0216074 0)
(0.0774881 0.0119444 0)
(0.0330674 0.0105187 0)
(0.00515899 0.00680759 0)
(-0.0049779 0.0119494 0)
(-0.021916 0.0268955 0)
(-0.0527675 0.0338025 0)
(-0.091606 0.0418843 0)
(-0.134333 0.0738134 0)
(-0.158651 0.125595 0)
(-0.166147 0.177879 0)
(-0.156086 0.188371 0)
(-0.160822 0.167637 0)
(-0.153027 0.177749 0)
(-0.0464835 0.214955 0)
(0.0139376 0.118932 0)
(0.0203009 -0.0527345 0)
(0.0148863 -0.126548 0)
(0.0223162 -0.126937 0)
(-0.019031 -0.112441 0)
(-0.0277378 -0.0806182 0)
(-0.0494328 -0.000995964 0)
(-0.0278843 0.15399 0)
(0.0617136 0.208974 0)
(0.138031 0.117122 0)
(0.2575 0.0691621 0)
(0.100125 0.00388477 0)
(0.0739757 0.0202337 0)
(0.0708183 0.0374534 0)
(0.0612849 0.0403168 0)
(0.0481355 0.0333321 0)
(0.0480946 0.0300678 0)
(0.0443145 0.0392738 0)
(0.0189054 0.0249025 0)
(-0.0148932 0.0259152 0)
(-0.0210015 0.049926 0)
(-0.0600475 0.0597597 0)
(-0.153246 0.0760336 0)
(-0.258782 0.103418 0)
(-0.300376 0.129112 0)
(-0.320867 0.182386 0)
(-0.302447 0.203804 0)
(-0.236891 0.211701 0)
(-0.177071 0.198655 0)
(-0.066015 0.26487 0)
(0.0125388 0.185901 0)
(0.0164937 -0.0108593 0)
(0.00917119 -0.101278 0)
(0.0306863 -0.0850196 0)
(-0.00762426 -0.061367 0)
(-0.0256496 -0.0214986 0)
(-0.0586031 0.0635966 0)
(-0.0176827 0.218026 0)
(0.0629931 0.226322 0)
(0.236474 0.0906952 0)
(0.0743524 0.0235507 0)
(0.0377662 0.0347301 0)
(0.0397208 0.0349637 0)
(0.0392417 0.0350038 0)
(0.0341158 0.0312231 0)
(0.0258043 0.0230311 0)
(0.0206381 0.0142508 0)
(0.016237 0.0114285 0)
(0.00781899 0.0139368 0)
(-0.0313987 0.0490142 0)
(-0.0433061 0.0689623 0)
(-0.0985714 0.140857 0)
(-0.0952478 0.267569 0)
(-0.142631 0.27715 0)
(-0.241349 0.274264 0)
(-0.322228 0.246846 0)
(-0.395366 0.213986 0)
(-0.375361 0.172776 0)
(-0.230106 0.204719 0)
(-0.0991356 0.280025 0)
(-0.0224815 0.236176 0)
(-0.00180245 0.00469058 0)
(-0.0204 -0.110684 0)
(0.0334709 -0.0559424 0)
(5.05333e-05 -0.00271426 0)
(-0.0292967 0.0440502 0)
(-0.0607564 0.134481 0)
(0.0134826 0.252381 0)
(0.14465 0.198499 0)
(0.121187 0.0703963 0)
(0.0480354 0.0616312 0)
(0.0389355 0.0553108 0)
(0.0354805 0.0481607 0)
(0.032421 0.0414355 0)
(0.0288956 0.0344509 0)
(0.0246023 0.0254444 0)
(0.0209345 0.0157272 0)
(0.01563 0.00819484 0)
(0.00525306 0.000761919 0)
(0.0135237 0.0566025 0)
(0.0386882 0.181929 0)
(-0.0299219 0.206517 0)
(-0.079188 0.246131 0)
(-0.125678 0.261183 0)
(-0.169952 0.260111 0)
(-0.208063 0.237421 0)
(-0.233058 0.202618 0)
(-0.322783 0.165518 0)
(-0.357362 0.150846 0)
(-0.154847 0.255422 0)
(-0.0704628 0.226798 0)
(-0.0364171 -0.0520261 0)
(-0.0330362 -0.115918 0)
(0.00314692 -0.0534768 0)
(-0.00397726 0.0623451 0)
(-0.0399415 0.117844 0)
(-0.045586 0.180765 0)
(0.0567408 0.225918 0)
(0.105816 0.0728588 0)
(0.0715679 0.0670336 0)
(0.0602623 0.0690668 0)
(0.0540953 0.0672505 0)
(0.0462912 0.0622693 0)
(0.0377167 0.0557128 0)
(0.0292312 0.0489517 0)
(0.0213983 0.0397236 0)
(0.014926 0.0277132 0)
(0.00933452 0.0148268 0)
(0.00253723 0.00132476 0)
(0.0284471 0.122258 0)
(-0.0201063 0.163823 0)
(-0.0584903 0.197231 0)
(-0.0872852 0.234522 0)
(-0.117845 0.254484 0)
(-0.149279 0.25578 0)
(-0.174815 0.237899 0)
(-0.191303 0.206736 0)
(-0.211277 0.176942 0)
(-0.283998 0.13017 0)
(-0.283129 0.132206 0)
(-0.122504 0.135583 0)
(-0.0815606 -0.122397 0)
(-0.072148 -0.117636 0)
(-0.050858 -0.0538189 0)
(-0.0234883 0.0948152 0)
(-0.039476 0.159366 0)
(-0.00454557 0.156844 0)
(0.100205 0.0857677 0)
(0.0881644 0.0607676 0)
(0.0825229 0.0689282 0)
(0.0795904 0.0767693 0)
(0.0740887 0.0792983 0)
(0.0637728 0.077111 0)
(0.0493449 0.0703188 0)
(0.0297065 0.0643895 0)
(0.0156516 0.0578691 0)
(0.00815799 0.0452325 0)
(0.00310125 0.0277282 0)
(-0.000761876 0.00758197 0)
(0.0166535 0.0861284 0)
(-0.0280816 0.147908 0)
(-0.0558707 0.194629 0)
(-0.0853222 0.23704 0)
(-0.113189 0.261205 0)
(-0.13946 0.265602 0)
(-0.162646 0.249008 0)
(-0.181634 0.216755 0)
(-0.198151 0.179413 0)
(-0.222002 0.136873 0)
(-0.257845 0.0800562 0)
(-0.218945 -0.00858795 0)
(-0.14262 -0.156699 0)
(-0.127151 -0.127893 0)
(-0.109655 -0.0626959 0)
(-0.0494455 0.0804923 0)
(-0.0149813 0.111997 0)
(0.104473 0.0598159 0)
(0.09665 0.0449312 0)
(0.097863 0.0556419 0)
(0.0979924 0.0722439 0)
(0.0978094 0.0848987 0)
(0.0961433 0.0904126 0)
(0.0912404 0.0886728 0)
(0.0746684 0.0796136 0)
(0.0202291 0.0710821 0)
(0.0014728 0.0711786 0)
(-0.00185704 0.0592165 0)
(-0.00329018 0.040487 0)
(-0.00282963 0.0141145 0)
(-0.00136178 0.0491206 0)
(-0.0336005 0.134297 0)
(-0.0604278 0.196542 0)
(-0.0854632 0.244064 0)
(-0.108425 0.272344 0)
(-0.130114 0.278185 0)
(-0.152048 0.262602 0)
(-0.171767 0.22941 0)
(-0.188559 0.182848 0)
(-0.202834 0.130809 0)
(-0.220838 0.0747716 0)
(-0.241296 0.00738126 0)
(-0.193313 -0.167555 0)
(-0.17372 -0.149128 0)
(-0.156704 -0.106731 0)
(-0.0538283 0.00205232 0)
(0.0673911 -0.0320618 0)
(0.0971731 0.0203038 0)
(0.104177 0.0235639 0)
(0.105051 0.0514974 0)
(0.108857 0.0744437 0)
(0.112642 0.0913404 0)
(0.116511 0.0995024 0)
(0.117163 0.10123 0)
(0.107762 0.108067 0)
(0.0368157 0.114606 0)
(-0.00228447 0.0826777 0)
(-0.00848613 0.0682049 0)
(-0.00745027 0.050238 0)
(-0.00424172 0.0205545 0)
(-0.0151422 0.0510064 0)
(-0.0465691 0.13322 0)
(-0.0690291 0.201878 0)
(-0.0855299 0.252353 0)
(-0.100883 0.284314 0)
(-0.124498 0.292944 0)
(-0.146987 0.274306 0)
(-0.161247 0.237474 0)
(-0.171957 0.186616 0)
(-0.18144 0.126023 0)
(-0.193603 0.0590079 0)
(-0.217355 -0.0119925 0)
(-0.228853 -0.140817 0)
(-0.188877 -0.173052 0)
(-0.162969 -0.179985 0)
(-0.00724666 -0.219345 0)
(0.0864799 -0.0774059 0)
(0.0996677 -0.0276315 0)
(0.098669 0.00881855 0)
(0.103483 0.0462127 0)
(0.110179 0.0781604 0)
(0.119797 0.100169 0)
(0.134388 0.118391 0)
(0.164414 0.153071 0)
(0.181513 0.247365 0)
(0.150629 0.303557 0)
(0.0257472 0.180708 0)
(-0.00987739 0.0940984 0)
(-0.00144069 0.0632987 0)
(0.00344764 0.0289815 0)
(-0.0301947 0.0551953 0)
(-0.0686797 0.137076 0)
(-0.0870078 0.208242 0)
(-0.0966431 0.263731 0)
(-0.113971 0.310472 0)
(-0.133037 0.335684 0)
(-0.133611 0.299518 0)
(-0.139051 0.244395 0)
(-0.145612 0.187317 0)
(-0.151329 0.121065 0)
(-0.16245 0.0446781 0)
(-0.178156 -0.0360655 0)
(-0.1954 -0.116659 0)
(-0.176388 -0.189145 0)
(-0.144317 -0.231337 0)
(-0.0169187 -0.275373 0)
(0.0715239 -0.10635 0)
(0.0798636 -0.0648157 0)
(0.0814022 -0.0035818 0)
(0.0886541 0.0448844 0)
(0.0991501 0.0851658 0)
(0.117462 0.118446 0)
(0.149578 0.169809 0)
(0.153885 0.268193 0)
(0.148367 0.353556 0)
(0.184129 0.418789 0)
(0.151629 0.36351 0)
(0.0867612 0.193858 0)
(0.0444399 0.0981152 0)
(0.0395872 0.0439503 0)
(-0.0586868 0.0736269 0)
(-0.109725 0.151545 0)
(-0.150214 0.224279 0)
(-0.174649 0.353707 0)
(-0.164491 0.480582 0)
(-0.127571 0.48483 0)
(-0.0975841 0.425887 0)
(-0.0924142 0.310053 0)
(-0.100241 0.193734 0)
(-0.112901 0.114141 0)
(-0.125958 0.0320233 0)
(-0.139541 -0.050556 0)
(-0.153556 -0.131524 0)
(-0.156707 -0.200124 0)
(-0.135255 -0.257936 0)
(0.0129644 -0.256877 0)
(0.0515286 -0.163195 0)
(0.0469859 -0.0872601 0)
(0.0519194 -0.0162344 0)
(0.0602724 0.0478709 0)
(0.0764362 0.0977151 0)
(0.113906 0.160792 0)
(0.137856 0.187663 0)
(0.102597 0.191929 0)
(0.0816916 0.264722 0)
(0.138953 0.364607 0)
(0.169321 0.32984 0)
(0.231299 0.213163 0)
(0.137437 0.0815542 0)
(0.103008 0.0475626 0)
(-0.170835 0.0774021 0)
(-0.165512 0.0890673 0)
(-0.210827 0.187987 0)
(-0.173014 0.277853 0)
(-0.127698 0.348724 0)
(-0.0610475 0.300704 0)
(-0.0292712 0.210248 0)
(-0.0402545 0.0517546 0)
(-0.0887399 -0.00420198 0)
(-0.0657354 0.110378 0)
(-0.0846865 0.0127056 0)
(-0.10383 -0.0659344 0)
(-0.119005 -0.146632 0)
(-0.130553 -0.2231 0)
(-0.1245 -0.292811 0)
(-0.0199633 -0.283514 0)
(-0.00547113 -0.194972 0)
(-0.0015264 -0.102782 0)
(0.00552135 -0.0184283 0)
(0.0167637 0.0518693 0)
(0.0636502 0.139735 0)
(0.12155 -0.0681317 0)
(0.0502181 -0.242661 0)
(-0.011878 -0.293697 0)
(-0.0193003 -0.226899 0)
(0.0336095 -0.0792236 0)
(0.0734397 -0.122378 0)
(0.0612813 -0.353387 0)
(-0.0375971 -0.716759 0)
(-0.0302177 -0.661454 0)
(0.00613571 -0.702955 0)
(0.0369038 -0.778245 0)
(-0.0218362 -0.512705 0)
(-0.035908 -0.344515 0)
(-0.0236091 -0.245833 0)
(0.0147388 -0.34269 0)
(0.0343546 -0.439598 0)
(0.0488691 -0.562894 0)
(0.0610018 -0.642728 0)
(0.0221784 -0.603532 0)
(-0.0783499 -0.162026 0)
(-0.0677182 -0.0966596 0)
(-0.0945728 -0.170245 0)
(-0.109859 -0.24625 0)
(-0.106939 -0.305789 0)
(-0.0643374 -0.292745 0)
(-0.0563973 -0.210179 0)
(-0.0566517 -0.118109 0)
(-0.0561117 -0.025568 0)
(-0.0166995 0.0405261 0)
(0.025068 -0.483043 0)
(-0.0603784 -0.71184 0)
(-0.0642714 -0.712019 0)
(-0.0512095 -0.698294 0)
(-0.0456664 -0.688668 0)
(-0.0388029 -0.670311 0)
(-0.0392968 -0.72367 0)
(-0.042741 -0.799901 0)
(-0.0472289 -0.840609 0)
(-0.0226613 -0.820522 0)
(0.0141839 -0.856608 0)
(0.0278857 -0.829274 0)
(0.0189429 -0.756068 0)
(0.0235629 -0.716298 0)
(0.0195435 -0.691193 0)
(0.0199065 -0.686357 0)
(0.0288063 -0.701753 0)
(0.050439 -0.739295 0)
(0.0745034 -0.7838 0)
(0.0974644 -0.827355 0)
(0.0815846 -0.823424 0)
(-0.061457 -0.5861 0)
(-0.0780479 -0.213954 0)
(-0.102459 -0.273738 0)
(-0.105937 -0.314259 0)
(-0.0943816 -0.298556 0)
(-0.0993695 -0.230219 0)
(-0.112885 -0.14506 0)
(-0.0906201 -0.119949 0)
(-0.0528104 -0.730668 0)
(-0.0965432 -0.84156 0)
(-0.084242 -0.803889 0)
(-0.0599666 -0.75688 0)
(-0.0379548 -0.716136 0)
(-0.0253336 -0.697856 0)
(-0.0212796 -0.701036 0)
(-0.0229498 -0.723477 0)
(-0.0162077 -0.763327 0)
(-0.0268964 -0.82947 0)
(-0.0183967 -0.842212 0)
(-0.00425517 -0.862438 0)
(0.00953208 -0.783762 0)
(-0.00560027 -0.69464 0)
(-0.00138281 -0.677056 0)
(0.00116964 -0.666032 0)
(0.00760877 -0.679003 0)
(0.0239465 -0.706755 0)
(0.0498129 -0.750098 0)
(0.0737105 -0.792025 0)
(0.0983749 -0.834359 0)
(0.120881 -0.872301 0)
(0.10326 -0.872454 0)
(-0.111766 -0.547353 0)
(-0.0973104 -0.316648 0)
(-0.111566 -0.338415 0)
(-0.108104 -0.321891 0)
(-0.122389 -0.267308 0)
(-0.104472 -0.274577 0)
(-0.0970456 -0.830321 0)
(-0.125257 -0.887617 0)
(-0.105194 -0.854771 0)
(-0.0835413 -0.806907 0)
(-0.0618717 -0.762915 0)
(-0.035705 -0.716405 0)
(-0.0187667 -0.686941 0)
(-0.0144564 -0.677999 0)
(-0.00956055 -0.697008 0)
(-0.00532209 -0.723639 0)
(-0.0187069 -0.798615 0)
(-0.0074207 -0.84624 0)
(-0.0211589 -0.842011 0)
(-0.00472269 -0.733982 0)
(-0.0235974 -0.654811 0)
(-0.0129339 -0.646472 0)
(-0.00839458 -0.649149 0)
(0.00631321 -0.67281 0)
(0.0243026 -0.708436 0)
(0.0521474 -0.753422 0)
(0.0782891 -0.79455 0)
(0.102149 -0.831609 0)
(0.12528 -0.864673 0)
(0.150235 -0.902653 0)
(-0.00686429 -0.737859 0)
(-0.130616 -0.396559 0)
(-0.126863 -0.375931 0)
(-0.103758 -0.353517 0)
(-0.096446 -0.336334 0)
(-0.115936 -0.95616 0)
(-0.163847 -0.92443 0)
(-0.133532 -0.876601 0)
(-0.112106 -0.847191 0)
(-0.0868831 -0.807476 0)
(-0.0638947 -0.764675 0)
(-0.0354512 -0.71866 0)
(-0.016635 -0.682081 0)
(-0.00341489 -0.660125 0)
(0.0034143 -0.662092 0)
(0.013423 -0.673547 0)
(-0.00315455 -0.757682 0)
(0.0106721 -0.837 0)
(-0.0285233 -0.811737 0)
(-0.0124012 -0.677259 0)
(-0.0319059 -0.628994 0)
(-0.0214765 -0.624588 0)
(-0.0127896 -0.637337 0)
(0.00734639 -0.668488 0)
(0.0271897 -0.708144 0)
(0.0579273 -0.75346 0)
(0.0840993 -0.79316 0)
(0.106506 -0.826464 0)
(0.133982 -0.854577 0)
(0.156926 -0.881583 0)
(0.0273865 -0.775025 0)
(-0.15492 -0.436679 0)
(-0.153491 -0.410277 0)
(-0.116833 -0.387394 0)
(-0.10261 -0.394559 0)
(-0.158702 -0.965279 0)
(-0.173679 -0.892673 0)
(-0.140125 -0.871088 0)
(-0.117795 -0.837289 0)
(-0.0940924 -0.804451 0)
(-0.0692961 -0.763388 0)
(-0.037925 -0.71912 0)
(-0.0172626 -0.678752 0)
(0.00240217 -0.649119 0)
(0.0117189 -0.638917 0)
(0.0233159 -0.644082 0)
(0.00583071 -0.705693 0)
(0.0246426 -0.812195 0)
(-0.0322842 -0.781519 0)
(-0.0243399 -0.639153 0)
(-0.0394929 -0.604638 0)
(-0.0261287 -0.605678 0)
(-0.0102219 -0.628133 0)
(0.0102156 -0.662309 0)
(0.031466 -0.704488 0)
(0.064158 -0.749867 0)
(0.0910524 -0.787711 0)
(0.11474 -0.817786 0)
(0.134256 -0.837216 0)
(0.160811 -0.868479 0)
(0.0609511 -0.818599 0)
(-0.177043 -0.470065 0)
(-0.176657 -0.449809 0)
(-0.130981 -0.443844 0)
(-0.108327 -0.474788 0)
(-0.167479 -0.940597 0)
(-0.168278 -0.877384 0)
(-0.147425 -0.850227 0)
(-0.124233 -0.828347 0)
(-0.102184 -0.796084 0)
(-0.0757658 -0.7591 0)
(-0.0424918 -0.715716 0)
(-0.0204148 -0.674209 0)
(0.00115478 -0.641178 0)
(0.0177509 -0.620165 0)
(0.0322543 -0.618983 0)
(0.017607 -0.659432 0)
(0.0289966 -0.782995 0)
(-0.0399696 -0.752542 0)
(-0.0334298 -0.616801 0)
(-0.0389672 -0.583159 0)
(-0.0252239 -0.5896 0)
(-0.00817654 -0.618324 0)
(0.0141287 -0.654209 0)
(0.0386122 -0.697451 0)
(0.0714455 -0.742633 0)
(0.100543 -0.778701 0)
(0.121397 -0.804695 0)
(0.13983 -0.821114 0)
(0.159201 -0.842485 0)
(0.103856 -0.844982 0)
(-0.189331 -0.509127 0)
(-0.18699 -0.501288 0)
(-0.130887 -0.51579 0)
(-0.0908764 -0.619711 0)
(-0.17063 -0.921552 0)
(-0.17647 -0.856387 0)
(-0.147581 -0.833893 0)
(-0.133277 -0.814291 0)
(-0.111162 -0.785995 0)
(-0.0834998 -0.751678 0)
(-0.049359 -0.70891 0)
(-0.0244235 -0.668961 0)
(0.000504331 -0.634578 0)
(0.0186553 -0.606278 0)
(0.0344761 -0.599481 0)
(0.0275069 -0.629415 0)
(0.0359487 -0.754193 0)
(-0.0436803 -0.724946 0)
(-0.0379089 -0.601788 0)
(-0.0366957 -0.562743 0)
(-0.020522 -0.576487 0)
(-0.00334121 -0.602897 0)
(0.0211558 -0.641692 0)
(0.0486179 -0.687111 0)
(0.0816435 -0.732742 0)
(0.108607 -0.76682 0)
(0.126529 -0.789869 0)
(0.144267 -0.803513 0)
(0.160348 -0.823354 0)
(0.139719 -0.863102 0)
(-0.17216 -0.562376 0)
(-0.173124 -0.562393 0)
(-0.105138 -0.609967 0)
(-0.0860106 -0.836271 0)
(-0.174285 -0.887768 0)
(-0.172768 -0.837275 0)
(-0.1552 -0.816736 0)
(-0.136735 -0.799231 0)
(-0.118704 -0.77379 0)
(-0.0934104 -0.741754 0)
(-0.0592228 -0.69968 0)
(-0.031485 -0.659549 0)
(-0.00438221 -0.622623 0)
(0.0152955 -0.595922 0)
(0.0342291 -0.581097 0)
(0.0340599 -0.612625 0)
(0.0420677 -0.725464 0)
(-0.0398539 -0.699217 0)
(-0.0381118 -0.590484 0)
(-0.0294518 -0.545381 0)
(-0.0158576 -0.558221 0)
(0.00288742 -0.585023 0)
(0.0288441 -0.62893 0)
(0.0593175 -0.67671 0)
(0.0903509 -0.722125 0)
(0.114137 -0.754855 0)
(0.130138 -0.774653 0)
(0.146844 -0.785199 0)
(0.16305 -0.803361 0)
(0.167688 -0.849377 0)
(-0.0276906 -0.739949 0)
(-0.115825 -0.650687 0)
(-0.0307149 -0.773634 0)
(-0.111574 -0.905662 0)
(-0.177307 -0.865262 0)
(-0.17526 -0.818025 0)
(-0.15949 -0.800012 0)
(-0.140677 -0.783273 0)
(-0.123579 -0.761523 0)
(-0.100916 -0.731377 0)
(-0.0693848 -0.691058 0)
(-0.0387903 -0.649682 0)
(-0.00998449 -0.60845 0)
(0.011321 -0.581333 0)
(0.0265817 -0.565798 0)
(0.0355709 -0.602179 0)
(0.0398575 -0.699809 0)
(-0.0374796 -0.666322 0)
(-0.0419777 -0.574771 0)
(-0.0270809 -0.527981 0)
(-0.0141029 -0.537355 0)
(0.00752775 -0.567515 0)
(0.0365222 -0.615727 0)
(0.0686444 -0.668645 0)
(0.0978422 -0.712941 0)
(0.120033 -0.742253 0)
(0.133944 -0.758389 0)
(0.148821 -0.766779 0)
(0.166157 -0.78148 0)
(0.175086 -0.82483 0)
(0.120689 -0.863125 0)
(-0.00704053 -0.778695 0)
(-0.016996 -0.870106 0)
(-0.133643 -0.8727 0)
(-0.185883 -0.836261 0)
(-0.18115 -0.795227 0)
(-0.160924 -0.779157 0)
(-0.145714 -0.767819 0)
(-0.129912 -0.747641 0)
(-0.107579 -0.722228 0)
(-0.0777373 -0.6845 0)
(-0.0456415 -0.63921 0)
(-0.01546 -0.593756 0)
(0.00967735 -0.563165 0)
(0.0226878 -0.549666 0)
(0.0385173 -0.589352 0)
(0.0356846 -0.67282 0)
(-0.0377561 -0.620191 0)
(-0.0496015 -0.552625 0)
(-0.028769 -0.508432 0)
(-0.0123297 -0.518273 0)
(0.0127253 -0.553865 0)
(0.0443162 -0.607287 0)
(0.0763036 -0.663119 0)
(0.105628 -0.704987 0)
(0.126945 -0.727689 0)
(0.137932 -0.740111 0)
(0.154786 -0.74623 0)
(0.167874 -0.760626 0)
(0.171635 -0.795032 0)
(0.13669 -0.83162 0)
(0.0513069 -0.835431 0)
(-0.0256335 -0.83677 0)
(-0.135958 -0.840403 0)
(-0.183556 -0.807615 0)
(-0.182394 -0.773205 0)
(-0.169521 -0.758972 0)
(-0.151602 -0.748547 0)
(-0.137082 -0.732764 0)
(-0.114546 -0.713301 0)
(-0.0839409 -0.679676 0)
(-0.0521773 -0.633587 0)
(-0.0194926 -0.583609 0)
(0.00760465 -0.544767 0)
(0.0248487 -0.531037 0)
(0.044832 -0.570436 0)
(0.0343728 -0.633538 0)
(-0.0355521 -0.56905 0)
(-0.0572036 -0.527094 0)
(-0.0322958 -0.489406 0)
(-0.0106937 -0.503291 0)
(0.0187766 -0.543951 0)
(0.0538522 -0.601148 0)
(0.0860165 -0.657284 0)
(0.11314 -0.694425 0)
(0.13369 -0.711848 0)
(0.143396 -0.720034 0)
(0.158261 -0.724486 0)
(0.1695 -0.73637 0)
(0.174272 -0.767316 0)
(0.143386 -0.801018 0)
(0.0593642 -0.801077 0)
(-0.0277661 -0.803376 0)
(-0.135868 -0.8067 0)
(-0.184349 -0.778408 0)
(-0.186156 -0.748942 0)
(-0.17555 -0.735775 0)
(-0.158061 -0.72769 0)
(-0.144077 -0.717595 0)
(-0.121783 -0.701918 0)
(-0.0920063 -0.674043 0)
(-0.0601684 -0.630302 0)
(-0.024544 -0.576955 0)
(0.00760532 -0.530204 0)
(0.0308407 -0.512176 0)
(0.0526834 -0.545923 0)
(0.0313574 -0.584172 0)
(-0.033691 -0.520283 0)
(-0.0602333 -0.501329 0)
(-0.0333215 -0.472511 0)
(-0.00695717 -0.4913 0)
(0.0271802 -0.536868 0)
(0.0656581 -0.596506 0)
(0.0980577 -0.647954 0)
(0.123165 -0.680621 0)
(0.140449 -0.694417 0)
(0.148053 -0.699488 0)
(0.16063 -0.699574 0)
(0.172226 -0.70997 0)
(0.175182 -0.738542 0)
(0.144341 -0.767688 0)
(0.0596557 -0.765552 0)
(-0.0312728 -0.76848 0)
(-0.141261 -0.774854 0)
(-0.188696 -0.748994 0)
(-0.189751 -0.720481 0)
(-0.178236 -0.709892 0)
(-0.164036 -0.70767 0)
(-0.150768 -0.699491 0)
(-0.130102 -0.688468 0)
(-0.102151 -0.66523 0)
(-0.0699552 -0.627811 0)
(-0.0315355 -0.573463 0)
(0.00508877 -0.519635 0)
(0.0353613 -0.494439 0)
(0.0580283 -0.518092 0)
(0.0286457 -0.534294 0)
(-0.0334754 -0.476249 0)
(-0.0574017 -0.471965 0)
(-0.0304942 -0.455201 0)
(-0.000231431 -0.480632 0)
(0.0381952 -0.530698 0)
(0.0785977 -0.589653 0)
(0.111129 -0.635649 0)
(0.132805 -0.66301 0)
(0.145586 -0.673624 0)
(0.152116 -0.674875 0)
(0.166268 -0.674885 0)
(0.172786 -0.684776 0)
(0.170569 -0.708752 0)
(0.136642 -0.731601 0)
(0.0523061 -0.728956 0)
(-0.0283879 -0.731457 0)
(-0.135586 -0.737727 0)
(-0.185699 -0.716571 0)
(-0.191698 -0.69469 0)
(-0.185342 -0.684842 0)
(-0.16851 -0.68313 0)
(-0.15573 -0.678323 0)
(-0.138017 -0.67106 0)
(-0.112606 -0.653298 0)
(-0.08123 -0.621811 0)
(-0.0424725 -0.56937 0)
(-0.000588668 -0.511864 0)
(0.0356166 -0.47589 0)
(0.0593186 -0.485463 0)
(0.0297001 -0.487784 0)
(-0.0304351 -0.435401 0)
(-0.0490925 -0.437842 0)
(-0.0249003 -0.436684 0)
(0.00906379 -0.470576 0)
(0.0504487 -0.524074 0)
(0.0914338 -0.580314 0)
(0.121754 -0.622023 0)
(0.14015 -0.642844 0)
(0.151324 -0.649491 0)
(0.156348 -0.649576 0)
(0.167331 -0.64856 0)
(0.175035 -0.656404 0)
(0.174231 -0.677041 0)
(0.143079 -0.696895 0)
(0.0552957 -0.69505 0)
(-0.0286858 -0.696974 0)
(-0.141239 -0.702926 0)
(-0.190791 -0.684775 0)
(-0.195919 -0.665878 0)
(-0.188716 -0.657927 0)
(-0.172728 -0.657757 0)
(-0.161863 -0.654557 0)
(-0.143921 -0.650741 0)
(-0.120824 -0.638713 0)
(-0.0922517 -0.61177 0)
(-0.0546147 -0.563862 0)
(-0.0104702 -0.504138 0)
(0.0323597 -0.458851 0)
(0.0553322 -0.449136 0)
(0.0304337 -0.443828 0)
(-0.0248888 -0.394489 0)
(-0.0378704 -0.402314 0)
(-0.0180022 -0.417791 0)
(0.0205023 -0.459794 0)
(0.0626093 -0.517092 0)
(0.102518 -0.570502 0)
(0.128638 -0.606383 0)
(0.144665 -0.620799 0)
(0.154671 -0.623685 0)
(0.159291 -0.62197 0)
(0.171347 -0.620266 0)
(0.178395 -0.627427 0)
(0.175965 -0.644597 0)
(0.145343 -0.660746 0)
(0.0580076 -0.656698 0)
(-0.0315336 -0.65941 0)
(-0.145637 -0.665076 0)
(-0.194287 -0.650752 0)
(-0.200098 -0.635386 0)
(-0.194285 -0.629301 0)
(-0.177772 -0.63168 0)
(-0.16611 -0.629825 0)
(-0.148183 -0.629155 0)
(-0.126414 -0.620955 0)
(-0.10131 -0.599072 0)
(-0.0672001 -0.555978 0)
(-0.0235596 -0.495927 0)
(0.0255362 -0.442391 0)
(0.0487463 -0.413996 0)
(0.0289815 -0.400367 0)
(-0.018016 -0.350804 0)
(-0.0269491 -0.36733 0)
(-0.0101312 -0.398659 0)
(0.0312689 -0.449139 0)
(0.073648 -0.510132 0)
(0.110062 -0.5608 0)
(0.13258 -0.587975 0)
(0.145863 -0.597423 0)
(0.156265 -0.596018 0)
(0.161693 -0.593056 0)
(0.174915 -0.591451 0)
(0.182452 -0.597094 0)
(0.180882 -0.610741 0)
(0.155177 -0.624626 0)
(0.0696851 -0.618743 0)
(-0.028597 -0.618533 0)
(-0.146023 -0.626899 0)
(-0.198249 -0.616038 0)
(-0.204914 -0.60452 0)
(-0.200325 -0.600503 0)
(-0.182459 -0.604303 0)
(-0.170714 -0.605392 0)
(-0.150989 -0.606106 0)
(-0.130783 -0.601275 0)
(-0.107937 -0.584616 0)
(-0.0782579 -0.54668 0)
(-0.0367404 -0.486873 0)
(0.0159424 -0.425045 0)
(0.0422481 -0.381488 0)
(0.0255606 -0.353409 0)
(-0.00817201 -0.308008 0)
(-0.0154332 -0.332453 0)
(0.000396924 -0.377131 0)
(0.041064 -0.437268 0)
(0.0825521 -0.50219 0)
(0.114023 -0.547895 0)
(0.13314 -0.566923 0)
(0.145936 -0.570171 0)
(0.157112 -0.567756 0)
(0.164442 -0.564076 0)
(0.179936 -0.562388 0)
(0.186305 -0.565773 0)
(0.183964 -0.575753 0)
(0.158789 -0.585914 0)
(0.0741833 -0.577778 0)
(-0.0270648 -0.576602 0)
(-0.145939 -0.586223 0)
(-0.20042 -0.57866 0)
(-0.207475 -0.570491 0)
(-0.20477 -0.571187 0)
(-0.188144 -0.576892 0)
(-0.176059 -0.58049 0)
(-0.155704 -0.582182 0)
(-0.135084 -0.579194 0)
(-0.11301 -0.567446 0)
(-0.0868174 -0.534431 0)
(-0.0489134 -0.474917 0)
(0.00259023 -0.404039 0)
(0.0325591 -0.3469 0)
(0.0176879 -0.306275 0)
(0.00666461 -0.267683 0)
(-0.00287642 -0.29686 0)
(0.013046 -0.351802 0)
(0.052184 -0.425048 0)
(0.090117 -0.492176 0)
(0.115156 -0.530935 0)
(0.13148 -0.542632 0)
(0.146318 -0.541512 0)
(0.15961 -0.539343 0)
(0.169271 -0.535072 0)
(0.18508 -0.533123 0)
(0.191 -0.532699 0)
(0.187914 -0.539833 0)
(0.159879 -0.546203 0)
(0.0738817 -0.53449 0)
(-0.0232665 -0.531448 0)
(-0.142463 -0.54249 0)
(-0.200641 -0.540266 0)
(-0.209279 -0.534446 0)
(-0.207859 -0.541078 0)
(-0.19337 -0.548662 0)
(-0.183152 -0.555441 0)
(-0.162802 -0.558258 0)
(-0.14074 -0.557905 0)
(-0.11789 -0.547684 0)
(-0.0943066 -0.519353 0)
(-0.0622669 -0.462234 0)
(-0.0160956 -0.379048 0)
(0.0180152 -0.307337 0)
(0.00312702 -0.263859 0)
(0.0237473 -0.224348 0)
(0.0102497 -0.259604 0)
(0.0258059 -0.328515 0)
(0.0639132 -0.413623 0)
(0.095899 -0.479168 0)
(0.114874 -0.51036 0)
(0.130829 -0.517173 0)
(0.147463 -0.514849 0)
(0.16431 -0.510413 0)
(0.175879 -0.505965 0)
(0.190603 -0.502302 0)
(0.197086 -0.497817 0)
(0.193691 -0.502497 0)
(0.166545 -0.504815 0)
(0.079876 -0.492677 0)
(-0.0233657 -0.488056 0)
(-0.141027 -0.498707 0)
(-0.198494 -0.499506 0)
(-0.208316 -0.496658 0)
(-0.208385 -0.50745 0)
(-0.198379 -0.517607 0)
(-0.190288 -0.529412 0)
(-0.17144 -0.536803 0)
(-0.149624 -0.537234 0)
(-0.125118 -0.527531 0)
(-0.101266 -0.50255 0)
(-0.0742811 -0.450025 0)
(-0.0358007 -0.358608 0)
(0.00161323 -0.269236 0)
(-0.0130024 -0.225472 0)
(0.0315227 -0.177927 0)
(0.0200657 -0.226456 0)
(0.0417635 -0.310183 0)
(0.0750526 -0.399815 0)
(0.0995059 -0.460642 0)
(0.11548 -0.486935 0)
(0.13343 -0.490872 0)
(0.152043 -0.488308 0)
(0.170172 -0.482512 0)
(0.182747 -0.475111 0)
(0.196922 -0.469119 0)
(0.20334 -0.46203 0)
(0.199541 -0.463972 0)
(0.172873 -0.462427 0)
(0.0904521 -0.447008 0)
(-0.0147267 -0.440474 0)
(-0.127325 -0.451383 0)
(-0.190413 -0.4572 0)
(-0.202896 -0.455513 0)
(-0.204531 -0.468371 0)
(-0.200177 -0.483855 0)
(-0.195825 -0.500254 0)
(-0.182408 -0.511672 0)
(-0.16294 -0.515312 0)
(-0.137149 -0.507314 0)
(-0.10842 -0.48369 0)
(-0.0819875 -0.436147 0)
(-0.0534644 -0.347076 0)
(-0.012508 -0.236533 0)
(-0.016696 -0.179816 0)
(0.0427881 -0.139582 0)
(0.0313905 -0.205764 0)
(0.059223 -0.291456 0)
(0.0840559 -0.37979 0)
(0.10281 -0.437011 0)
(0.118482 -0.461193 0)
(0.138997 -0.464875 0)
(0.159662 -0.460242 0)
(0.177531 -0.453487 0)
(0.190185 -0.444059 0)
(0.202267 -0.434848 0)
(0.207757 -0.423617 0)
(0.202408 -0.422247 0)
(0.169823 -0.415471 0)
(0.0865042 -0.399612 0)
(-0.0058742 -0.393769 0)
(-0.106321 -0.401355 0)
(-0.173143 -0.407611 0)
(-0.191647 -0.409968 0)
(-0.195288 -0.424867 0)
(-0.19669 -0.444528 0)
(-0.198314 -0.463918 0)
(-0.193073 -0.480709 0)
(-0.178964 -0.489428 0)
(-0.153835 -0.484035 0)
(-0.120257 -0.462859 0)
(-0.0882009 -0.419114 0)
(-0.0644396 -0.333479 0)
(-0.033479 -0.20239 0)
(-0.0244951 -0.134769 0)
(0.0424265 -0.121549 0)
(0.0423509 -0.185393 0)
(0.0692324 -0.26476 0)
(0.0891863 -0.356238 0)
(0.107391 -0.413348 0)
(0.125984 -0.436945 0)
(0.147464 -0.440384 0)
(0.168355 -0.434233 0)
(0.186186 -0.423273 0)
(0.197918 -0.410367 0)
(0.20682 -0.397455 0)
(0.212737 -0.385054 0)
(0.204776 -0.37742 0)
(0.170481 -0.36803 0)
(0.0939461 -0.353434 0)
(0.00717892 -0.347206 0)
(-0.0844255 -0.351821 0)
(-0.152999 -0.357865 0)
(-0.176186 -0.362514 0)
(-0.182799 -0.376046 0)
(-0.188363 -0.397423 0)
(-0.195786 -0.421965 0)
(-0.198533 -0.44577 0)
(-0.192333 -0.459618 0)
(-0.173503 -0.458905 0)
(-0.13992 -0.441459 0)
(-0.0999447 -0.398794 0)
(-0.067549 -0.313545 0)
(-0.049995 -0.180137 0)
(-0.0207005 -0.102579 0)
(0.0236225 -0.11005 0)
(0.0487873 -0.158878 0)
(0.0731421 -0.241053 0)
(0.0934441 -0.334058 0)
(0.115654 -0.389934 0)
(0.140312 -0.413243 0)
(0.162658 -0.415767 0)
(0.181162 -0.406557 0)
(0.194932 -0.391509 0)
(0.203822 -0.374494 0)
(0.209421 -0.357359 0)
(0.21362 -0.342597 0)
(0.203417 -0.329252 0)
(0.165555 -0.317864 0)
(0.0965494 -0.30527 0)
(0.0193439 -0.298849 0)
(-0.0627627 -0.300502 0)
(-0.131042 -0.305334 0)
(-0.158565 -0.313066 0)
(-0.16713 -0.326504 0)
(-0.175875 -0.348693 0)
(-0.18861 -0.376185 0)
(-0.199518 -0.40697 0)
(-0.202096 -0.424358 0)
(-0.19231 -0.428355 0)
(-0.164536 -0.412848 0)
(-0.120682 -0.36933 0)
(-0.0763695 -0.293548 0)
(-0.04957 -0.164803 0)
(-0.0361835 -0.071625 0)
(0.0126093 -0.103791 0)
(0.0647537 -0.133651 0)
(0.0738842 -0.221939 0)
(0.099693 -0.314617 0)
(0.131681 -0.366818 0)
(0.16054 -0.386937 0)
(0.181256 -0.386884 0)
(0.195268 -0.374469 0)
(0.204012 -0.3554 0)
(0.208323 -0.334231 0)
(0.210228 -0.313999 0)
(0.212111 -0.295496 0)
(0.19974 -0.278826 0)
(0.160308 -0.266701 0)
(0.0977412 -0.255752 0)
(0.0283513 -0.249149 0)
(-0.0444352 -0.248794 0)
(-0.108414 -0.251892 0)
(-0.139445 -0.259515 0)
(-0.149973 -0.273984 0)
(-0.160407 -0.295812 0)
(-0.176553 -0.324682 0)
(-0.194547 -0.360318 0)
(-0.204278 -0.384841 0)
(-0.203914 -0.389447 0)
(-0.184314 -0.382504 0)
(-0.143124 -0.34285 0)
(-0.0905815 -0.269794 0)
(-0.043959 -0.145467 0)
(-0.0494068 -0.0520706 0)
(0.0146875 -0.0888681 0)
(0.0649828 -0.118087 0)
(0.0776957 -0.203341 0)
(0.114817 -0.287441 0)
(0.153588 -0.335762 0)
(0.183276 -0.356474 0)
(0.19996 -0.354547 0)
(0.207968 -0.338074 0)
(0.21106 -0.315678 0)
(0.211113 -0.28984 0)
(0.210403 -0.264155 0)
(0.208498 -0.241794 0)
(0.192704 -0.22518 0)
(0.15223 -0.213093 0)
(0.0955605 -0.203517 0)
(0.0348233 -0.19717 0)
(-0.0282764 -0.195342 0)
(-0.0857707 -0.196701 0)
(-0.119547 -0.20257 0)
(-0.132585 -0.217679 0)
(-0.14397 -0.239306 0)
(-0.161821 -0.266106 0)
(-0.184441 -0.299771 0)
(-0.203116 -0.334129 0)
(-0.204431 -0.345282 0)
(-0.192882 -0.344264 0)
(-0.159142 -0.317084 0)
(-0.107526 -0.24903 0)
(-0.0322525 -0.140172 0)
(-0.035271 -0.0344345 0)
(0.00155593 -0.0849007 0)
(0.0631955 -0.109396 0)
(0.0754923 -0.183919 0)
(0.129436 -0.257377 0)
(0.172348 -0.303922 0)
(0.20047 -0.322252 0)
(0.214144 -0.316598 0)
(0.218042 -0.295608 0)
(0.217169 -0.264489 0)
(0.213336 -0.234631 0)
(0.208691 -0.207481 0)
(0.201733 -0.184648 0)
(0.181938 -0.168448 0)
(0.142443 -0.157231 0)
(0.0915464 -0.148598 0)
(0.0395473 -0.142493 0)
(-0.0133337 -0.139725 0)
(-0.0635357 -0.139474 0)
(-0.0982933 -0.143071 0)
(-0.114534 -0.155085 0)
(-0.127392 -0.175254 0)
(-0.146363 -0.202541 0)
(-0.171318 -0.238811 0)
(-0.197082 -0.278969 0)
(-0.204382 -0.294527 0)
(-0.198778 -0.295035 0)
(-0.169032 -0.275535 0)
(-0.119556 -0.215154 0)
(-0.0502667 -0.109458 0)
(-0.0518084 -0.0152841 0)
(-0.00515555 -0.060993 0)
(0.0481766 -0.0794963 0)
(0.0929803 -0.165396 0)
(0.146686 -0.232072 0)
(0.186616 -0.272143 0)
(0.215074 -0.282568 0)
(0.226718 -0.27241 0)
(0.227797 -0.243972 0)
(0.221793 -0.208545 0)
(0.212578 -0.175537 0)
(0.203153 -0.147034 0)
(0.19135 -0.12457 0)
(0.168502 -0.10925 0)
(0.131013 -0.0988653 0)
(0.0863651 -0.0908215 0)
(0.0427264 -0.0846688 0)
(-0.000486528 -0.0811289 0)
(-0.0430861 -0.0795695 0)
(-0.0760634 -0.0807968 0)
(-0.0950611 -0.0894216 0)
(-0.110159 -0.106604 0)
(-0.130413 -0.131338 0)
(-0.156062 -0.164505 0)
(-0.184435 -0.210127 0)
(-0.199777 -0.242906 0)
(-0.197944 -0.249379 0)
(-0.176263 -0.238899 0)
(-0.130692 -0.188389 0)
(-0.0664587 -0.0799155 0)
(-0.0616574 0.00894923 0)
(0.00529323 -0.0193561 0)
(0.0353972 -0.0634743 0)
(0.108266 -0.143096 0)
(0.159902 -0.20098 0)
(0.198738 -0.23238 0)
(0.225343 -0.237012 0)
(0.235542 -0.221261 0)
(0.23386 -0.185641 0)
(0.222861 -0.147371 0)
(0.208463 -0.112756 0)
(0.194182 -0.0840561 0)
(0.177944 -0.0624306 0)
(0.153198 -0.0479704 0)
(0.118517 -0.0379606 0)
(0.0801735 -0.0300958 0)
(0.0441458 -0.023757 0)
(0.00968234 -0.0196445 0)
(-0.0249945 -0.0170913 0)
(-0.0545524 -0.0164751 0)
(-0.0745813 -0.0218585 0)
(-0.0911463 -0.0353351 0)
(-0.111908 -0.0564767 0)
(-0.138425 -0.0863891 0)
(-0.168163 -0.129245 0)
(-0.19202 -0.177635 0)
(-0.195298 -0.19214 0)
(-0.181726 -0.189509 0)
(-0.143581 -0.151281 0)
(-0.0892621 -0.0472575 0)
(-0.0859611 0.0328024 0)
(0.0249822 0.0134909 0)
(0.0410215 -0.0388157 0)
(0.117883 -0.111096 0)
(0.17102 -0.164388 0)
(0.208148 -0.188718 0)
(0.232697 -0.186406 0)
(0.241029 -0.161931 0)
(0.235595 -0.121572 0)
(0.219828 -0.0819358 0)
(0.200622 -0.0473217 0)
(0.181881 -0.0195698 0)
(0.162101 0.000852191 0)
(0.136739 0.014714 0)
(0.105693 0.024747 0)
(0.0735577 0.0327016 0)
(0.0441684 0.0392143 0)
(0.016892 0.043708 0)
(-0.0105529 0.0468135 0)
(-0.0356572 0.0485022 0)
(-0.0550799 0.0457613 0)
(-0.0721364 0.0361912 0)
(-0.092331 0.0194808 0)
(-0.117244 -0.00524277 0)
(-0.145685 -0.0411269 0)
(-0.175658 -0.0950965 0)
(-0.188396 -0.130552 0)
(-0.182301 -0.134764 0)
(-0.150672 -0.112102 0)
(-0.0975731 -0.0242912 0)
(-0.0953397 0.0602411 0)
(0.0475013 0.0478658 0)
(0.0547058 -0.00611492 0)
(0.125667 -0.0771308 0)
(0.178626 -0.123596 0)
(0.214163 -0.138893 0)
(0.236262 -0.128044 0)
(0.241344 -0.0942358 0)
(0.231307 -0.052607 0)
(0.211357 -0.0138192 0)
(0.188387 0.0189056 0)
(0.166381 0.044678 0)
(0.144548 0.0637535 0)
(0.120028 0.0772977 0)
(0.0931401 0.0875121 0)
(0.066613 0.0955412 0)
(0.042506 0.101943 0)
(0.0204121 0.106372 0)
(-0.00145571 0.109331 0)
(-0.0221648 0.110976 0)
(-0.0397354 0.10962 0)
(-0.0559472 0.103467 0)
(-0.0743915 0.0917296 0)
(-0.096745 0.073449 0)
(-0.122564 0.0459596 0)
(-0.152232 0.00198471 0)
(-0.178878 -0.0546923 0)
(-0.1792 -0.0718708 0)
(-0.158024 -0.0608202 0)
(-0.110127 0.00802959 0)
(-0.103464 0.0908746 0)
(0.0660097 0.0848392 0)
(0.0664817 0.0287281 0)
(0.134038 -0.0398098 0)
(0.185247 -0.0769845 0)
(0.217933 -0.0814228 0)
(0.235587 -0.0603573 0)
(0.234205 -0.0217305 0)
(0.218995 0.0185915 0)
(0.195676 0.0542696 0)
(0.17061 0.0836463 0)
(0.147182 0.10684 0)
(0.125001 0.124537 0)
(0.102436 0.137746 0)
(0.0796387 0.147812 0)
(0.0577331 0.155374 0)
(0.0375298 0.160877 0)
(0.0188721 0.164252 0)
(0.000922251 0.165934 0)
(-0.0159622 0.166233 0)
(-0.0309418 0.164729 0)
(-0.044994 0.160837 0)
(-0.0605656 0.15412 0)
(-0.0801597 0.143144 0)
(-0.103432 0.125008 0)
(-0.129214 0.0935618 0)
(-0.160521 0.041088 0)
(-0.172802 0.00254124 0)
(-0.160504 0.000687568 0)
(-0.119792 0.0469742 0)
(-0.108409 0.121009 0)
(0.0775297 0.126965 0)
(0.074571 0.0670183 0)
(0.143045 0.00289923 0)
(0.190404 -0.0219828 0)
(0.217715 -0.0132098 0)
(0.226489 0.0126856 0)
(0.216481 0.0510431 0)
(0.19549 0.087553 0)
(0.169737 0.118608 0)
(0.144609 0.143701 0)
(0.121983 0.163474 0)
(0.101357 0.178782 0)
(0.0817431 0.190373 0)
(0.0629137 0.198942 0)
(0.0449595 0.204863 0)
(0.0280394 0.208457 0)
(0.0121426 0.209929 0)
(-0.00287843 0.20966 0)
(-0.016668 0.208141 0)
(-0.028879 0.205856 0)
(-0.0400365 0.203262 0)
(-0.0514358 0.200734 0)
(-0.0657542 0.197719 0)
(-0.0852322 0.191743 0)
(-0.11046 0.176075 0)
(-0.146907 0.136553 0)
(-0.1681 0.089611 0)
(-0.16144 0.0744568 0)
(-0.126967 0.0969322 0)
(-0.114465 0.15301 0)
(0.0837921 0.17369 0)
(0.0818631 0.110677 0)
(0.152269 0.0547476 0)
(0.191741 0.0445743 0)
(0.207739 0.057748 0)
(0.204243 0.0823132 0)
(0.183748 0.116583 0)
(0.158486 0.1454 0)
(0.134649 0.168049 0)
(0.114037 0.186272 0)
(0.095896 0.200879 0)
(0.0793296 0.212473 0)
(0.0636465 0.221435 0)
(0.048571 0.228021 0)
(0.0339897 0.232424 0)
(0.0198803 0.234812 0)
(0.00627062 0.235371 0)
(-0.00677586 0.234373 0)
(-0.0189764 0.232259 0)
(-0.0299677 0.229704 0)
(-0.0396018 0.227548 0)
(-0.0479988 0.226674 0)
(-0.0562322 0.227678 0)
(-0.06572 0.230421 0)
(-0.07973 0.233476 0)
(-0.112085 0.226337 0)
(-0.182028 0.177358 0)
(-0.181114 0.148956 0)
(-0.143661 0.144891 0)
(-0.10668 0.185461 0)
(0.086797 0.225172 0)
(0.0907872 0.161309 0)
(0.155006 0.116159 0)
(0.181819 0.108788 0)
(0.182987 0.11703 0)
(0.164932 0.138135 0)
(0.14293 0.160511 0)
(0.12427 0.179691 0)
(0.107861 0.196057 0)
(0.0928368 0.209957 0)
(0.078763 0.221674 0)
(0.0652728 0.231341 0)
(0.0521362 0.239026 0)
(0.0392599 0.244776 0)
(0.0265878 0.24864 0)
(0.0140912 0.250676 0)
(0.00179617 0.25098 0)
(-0.0102029 0.24974 0)
(-0.0216726 0.247318 0)
(-0.0322001 0.24436 0)
(-0.0412691 0.241812 0)
(-0.048468 0.240835 0)
(-0.0539721 0.242553 0)
(-0.0578854 0.247641 0)
(-0.0620063 0.256101 0)
(-0.0679419 0.265358 0)
(-0.118333 0.257813 0)
(-0.205137 0.22153 0)
(-0.162882 0.183706 0)
(-0.103843 0.19184 0)
(0.0846268 0.280532 0)
(0.0927816 0.216318 0)
(0.144142 0.167822 0)
(0.156763 0.15254 0)
(0.14441 0.155543 0)
(0.129145 0.168753 0)
(0.116328 0.184312 0)
(0.10385 0.199147 0)
(0.0915747 0.212878 0)
(0.079489 0.225206 0)
(0.0675059 0.235926 0)
(0.0555688 0.244919 0)
(0.0436804 0.252119 0)
(0.03187 0.257503 0)
(0.0201597 0.261079 0)
(0.00857634 0.262877 0)
(-0.00284198 0.26296 0)
(-0.0140202 0.261459 0)
(-0.0247758 0.258654 0)
(-0.0347349 0.255108 0)
(-0.0433057 0.251789 0)
(-0.0498612 0.25007 0)
(-0.0541548 0.251519 0)
(-0.0561967 0.257538 0)
(-0.0585474 0.269288 0)
(-0.061617 0.285142 0)
(-0.0810273 0.304016 0)
(-0.189935 0.293433 0)
(-0.169826 0.224424 0)
(-0.0988081 0.183155 0)
(0.0734584 0.338253 0)
(0.0794746 0.248184 0)
(0.119754 0.189244 0)
(0.123772 0.171648 0)
(0.116044 0.174021 0)
(0.108552 0.184853 0)
(0.100073 0.198125 0)
(0.0906453 0.211878 0)
(0.0806199 0.225072 0)
(0.0701297 0.237106 0)
(0.0592603 0.247636 0)
(0.0481197 0.256458 0)
(0.0368337 0.263468 0)
(0.0255246 0.268628 0)
(0.0142939 0.271943 0)
(0.00323065 0.273449 0)
(-0.00758824 0.273208 0)
(-0.0180815 0.271328 0)
(-0.028103 0.268023 0)
(-0.0373603 0.263749 0)
(-0.0453385 0.259413 0)
(-0.0513091 0.256552 0)
(-0.0547309 0.257258 0)
(-0.0557927 0.263653 0)
(-0.0583379 0.277679 0)
(-0.0676459 0.2993 0)
(-0.0957091 0.335584 0)
(-0.166955 0.351173 0)
(-0.148794 0.26112 0)
(-0.070512 0.171656 0)
(0.0614026 0.367305 0)
(0.0549899 0.239036 0)
(0.0904125 0.185701 0)
(0.100133 0.177362 0)
(0.0990336 0.182593 0)
(0.0950402 0.193701 0)
(0.0891131 0.207254 0)
(0.0816725 0.221365 0)
(0.0730692 0.234924 0)
(0.063557 0.247281 0)
(0.0533429 0.258048 0)
(0.0426175 0.267001 0)
(0.0315852 0.274022 0)
(0.0204455 0.279072 0)
(0.00936565 0.282167 0)
(-0.00151277 0.283356 0)
(-0.0120665 0.282711 0)
(-0.0221782 0.280335 0)
(-0.0316919 0.276398 0)
(-0.0403663 0.271255 0)
(-0.0477682 0.265641 0)
(-0.0531196 0.261036 0)
(-0.0554757 0.259987 0)
(-0.0549975 0.265676 0)
(-0.057086 0.281592 0)
(-0.0736188 0.310126 0)
(-0.131461 0.364944 0)
(-0.162073 0.343433 0)
(-0.104216 0.272345 0)
(-0.0422123 0.163447 0)
(0.0501603 0.340335 0)
(0.0479399 0.220484 0)
(0.0720377 0.180711 0)
(0.0854633 0.177094 0)
(0.0880048 0.18555 0)
(0.0861976 0.198718 0)
(0.0819814 0.213681 0)
(0.0758614 0.228905 0)
(0.0682032 0.243389 0)
(0.0593387 0.256498 0)
(0.0495564 0.267846 0)
(0.0390601 0.277211 0)
(0.0280734 0.284468 0)
(0.016847 0.289575 0)
(0.00560038 0.292551 0)
(-0.00546833 0.293452 0)
(-0.0161665 0.292354 0)
(-0.0262944 0.289363 0)
(-0.0356801 0.284628 0)
(-0.044103 0.278433 0)
(-0.0511771 0.271331 0)
(-0.0561821 0.264473 0)
(-0.0578188 0.260288 0)
(-0.0559277 0.262525 0)
(-0.0543062 0.277908 0)
(-0.0540296 0.34423 0)
(-0.101491 0.382827 0)
(-0.0914735 0.314248 0)
(-0.0683281 0.23942 0)
(-0.0220272 0.144118 0)
(0.0391658 0.275481 0)
(0.0500089 0.202077 0)
(0.0656914 0.173793 0)
(0.0774692 0.173735 0)
(0.081374 0.185624 0)
(0.0807672 0.201495 0)
(0.0776063 0.218447 0)
(0.072396 0.235248 0)
(0.0654721 0.251037 0)
(0.0571001 0.265239 0)
(0.047596 0.277464 0)
(0.0372221 0.287483 0)
(0.0261768 0.29518 0)
(0.0146927 0.30051 0)
(0.00301883 0.303485 0)
(-0.00857819 0.304155 0)
(-0.0197817 0.302597 0)
(-0.0302806 0.298923 0)
(-0.0400038 0.293251 0)
(-0.0485556 0.285833 0)
(-0.0556025 0.277108 0)
(-0.0606341 0.267913 0)
(-0.0626108 0.26003 0)
(-0.0619062 0.255588 0)
(-0.060924 0.258061 0)
(-0.041514 0.315531 0)
(-0.000441673 0.38744 0)
(0.024219 0.343973 0)
(-0.0143257 0.241899 0)
(-0.0055694 0.138826 0)
(0.0351059 0.2293 0)
(0.0510081 0.182017 0)
(0.0633058 0.165174 0)
(0.0730232 0.169609 0)
(0.0771725 0.184564 0)
(0.0772732 0.20307 0)
(0.0749051 0.222182 0)
(0.0704826 0.240796 0)
(0.0642543 0.258143 0)
(0.0563719 0.273698 0)
(0.0470458 0.287057 0)
(0.0366712 0.297933 0)
(0.0255122 0.306211 0)
(0.0137209 0.311882 0)
(0.00156307 0.314948 0)
(-0.0106699 0.315463 0)
(-0.0226277 0.313474 0)
(-0.0338532 0.309082 0)
(-0.0440436 0.302443 0)
(-0.0529968 0.293734 0)
(-0.0603373 0.283313 0)
(-0.0655294 0.271878 0)
(-0.0679573 0.260606 0)
(-0.0681447 0.250128 0)
(-0.0696166 0.2398 0)
(-0.0684238 0.238245 0)
(-0.0139391 0.344933 0)
(0.0651856 0.344776 0)
(0.0499579 0.294257 0)
(0.0207093 0.16175 0)
(0.0333659 0.190863 0)
(0.0493822 0.161974 0)
(0.0610677 0.155933 0)
(0.0696396 0.165266 0)
(0.0738327 0.183049 0)
(0.0745504 0.203918 0)
(0.0729703 0.225151 0)
(0.0693577 0.245691 0)
(0.0637841 0.264865 0)
(0.0565934 0.281975 0)
(0.0479195 0.296591 0)
(0.0378716 0.308477 0)
(0.0266274 0.317527 0)
(0.0143585 0.323715 0)
(0.00140775 0.326994 0)
(-0.0118841 0.327445 0)
(-0.0249449 0.325036 0)
(-0.0371759 0.319836 0)
(-0.0480689 0.312098 0)
(-0.0572876 0.302066 0)
(-0.0646534 0.290009 0)
(-0.0699726 0.276401 0)
(-0.0726018 0.262266 0)
(-0.072632 0.248084 0)
(-0.0726815 0.232415 0)
(-0.0738339 0.217768 0)
(-0.0706266 0.212946 0)
(0.0024903 0.268229 0)
(0.0515915 0.270089 0)
(0.0441399 0.211325 0)
(0.0323165 0.158932 0)
(0.0471908 0.143309 0)
(0.0583671 0.146605 0)
(0.0661982 0.160709 0)
(0.0704902 0.181111 0)
(0.0718472 0.204116 0)
(0.0710813 0.227431 0)
(0.0684583 0.249995 0)
(0.0641366 0.270996 0)
(0.0581765 0.289756 0)
(0.0505321 0.305798 0)
(0.0409638 0.318972 0)
(0.0295996 0.329128 0)
(0.0167337 0.336141 0)
(0.00270907 0.339756 0)
(-0.0120774 0.340264 0)
(-0.0263545 0.33746 0)
(-0.0397251 0.331255 0)
(-0.0521116 0.321969 0)
(-0.0621124 0.310285 0)
(-0.0693005 0.296555 0)
(-0.0739393 0.281073 0)
(-0.0759286 0.264684 0)
(-0.0758943 0.247522 0)
(-0.0744883 0.229302 0)
(-0.0736424 0.209819 0)
(-0.0725699 0.191604 0)
(-0.0570206 0.182019 0)
(-0.0090254 0.207482 0)
(0.00992861 0.245232 0)
(0.0337405 0.130002 0)
(0.0451636 0.126519 0)
(0.0548892 0.138007 0)
(0.0621305 0.156055 0)
(0.0666107 0.178711 0)
(0.0686372 0.20366 0)
(0.0688774 0.228966 0)
(0.0676251 0.25351 0)
(0.0649947 0.27646 0)
(0.0607575 0.297313 0)
(0.0543125 0.315921 0)
(0.044815 0.332327 0)
(0.0329187 0.345698 0)
(0.0203407 0.356356 0)
(0.0059172 0.36226 0)
(-0.0102858 0.364084 0)
(-0.0244862 0.358727 0)
(-0.0379382 0.349536 0)
(-0.0535819 0.336223 0)
(-0.0663729 0.319831 0)
(-0.0740234 0.302915 0)
(-0.0777219 0.2852 0)
(-0.0787097 0.266534 0)
(-0.0777731 0.247148 0)
(-0.0753371 0.226856 0)
(-0.0726802 0.205114 0)
(-0.0703309 0.183044 0)
(-0.0628584 0.165396 0)
(-0.0402347 0.172555 0)
(-0.0189 0.220312 0)
(0.0363217 0.100563 0)
(0.0424255 0.112157 0)
(0.0501322 0.130621 0)
(0.0570744 0.151406 0)
(0.0617998 0.175912 0)
(0.06455 0.202605 0)
(0.0658868 0.22982 0)
(0.0662568 0.256453 0)
(0.0657868 0.282158 0)
(0.0640304 0.307497 0)
(0.0603754 0.33388 0)
(0.0546707 0.36072 0)
(0.0431361 0.378199 0)
(0.0287027 0.388714 0)
(0.00974458 0.397323 0)
(-0.00944419 0.396836 0)
(-0.0240492 0.393475 0)
(-0.0392262 0.388035 0)
(-0.0554682 0.372065 0)
(-0.0697452 0.344521 0)
(-0.0783475 0.313157 0)
(-0.0807765 0.289407 0)
(-0.0803952 0.267864 0)
(-0.0783849 0.2463 0)
(-0.0752889 0.223813 0)
(-0.0710568 0.200839 0)
(-0.0672187 0.176625 0)
(-0.0614635 0.155622 0)
(-0.0487291 0.150398 0)
(-0.0323918 0.172487 0)
(0.0316342 0.0708208 0)
(0.0371704 0.0991711 0)
(0.0438756 0.123415 0)
(0.0507218 0.146702 0)
(0.0557714 0.172803 0)
(0.0591311 0.201151 0)
(0.0615881 0.230262 0)
(0.064002 0.259618 0)
(0.0669619 0.290528 0)
(0.0709597 0.326914 0)
(0.0669611 0.358203 0)
(0.0590833 0.380049 0)
(0.0439071 0.394952 0)
(0.0227486 0.408984 0)
(0.00444217 0.418714 0)
(-0.0122475 0.413657 0)
(-0.0267293 0.408065 0)
(-0.0411321 0.405794 0)
(-0.0542449 0.397483 0)
(-0.0675745 0.377233 0)
(-0.0847756 0.343944 0)
(-0.0849787 0.297156 0)
(-0.0808843 0.268716 0)
(-0.0774495 0.244739 0)
(-0.0736157 0.220597 0)
(-0.0689271 0.195664 0)
(-0.0633258 0.170871 0)
(-0.0573375 0.147498 0)
(-0.047994 0.133751 0)
(-0.0354618 0.139381 0)
(0.0217443 0.0480435 0)
(0.0293412 0.0873036 0)
(0.0363318 0.11546 0)
(0.0430745 0.141677 0)
(0.0482396 0.169541 0)
(0.05207 0.199433 0)
(0.0558786 0.230688 0)
(0.0615523 0.264258 0)
(0.0681964 0.303104 0)
(0.0686086 0.334905 0)
(0.0605136 0.360784 0)
(0.0477804 0.388697 0)
(0.0281838 0.4124 0)
(0.00955857 0.424911 0)
(-0.000650361 0.427436 0)
(-0.0117023 0.426814 0)
(-0.0249577 0.418453 0)
(-0.0369635 0.41345 0)
(-0.0472615 0.407183 0)
(-0.0582503 0.39379 0)
(-0.0735748 0.365282 0)
(-0.0951493 0.320906 0)
(-0.0830155 0.270083 0)
(-0.0751067 0.242329 0)
(-0.0703363 0.21676 0)
(-0.0654806 0.190409 0)
(-0.0588894 0.164733 0)
(-0.0519374 0.140234 0)
(-0.0447447 0.119438 0)
(-0.0381052 0.112092 0)
(0.0136557 0.0340081 0)
(0.0209427 0.0768504 0)
(0.0281545 0.107339 0)
(0.0342364 0.136625 0)
(0.0391307 0.166208 0)
(0.0434233 0.197555 0)
(0.0495029 0.231948 0)
(0.0568744 0.272282 0)
(0.0602817 0.30138 0)
(0.0527797 0.332245 0)
(0.0365574 0.368428 0)
(0.0140333 0.403309 0)
(0.000388858 0.425564 0)
(-0.00234853 0.428822 0)
(-0.00164263 0.427036 0)
(-0.00251397 0.433451 0)
(-0.0117015 0.429513 0)
(-0.0234537 0.421524 0)
(-0.0312707 0.411551 0)
(-0.0439393 0.405229 0)
(-0.0546404 0.384225 0)
(-0.0783322 0.342696 0)
(-0.0913562 0.283395 0)
(-0.0727414 0.238668 0)
(-0.065451 0.212194 0)
(-0.0602161 0.185238 0)
(-0.0538888 0.15763 0)
(-0.0461418 0.131749 0)
(-0.039815 0.104874 0)
(-0.0371923 0.080036 0)
(0.00815175 0.0254877 0)
(0.0132363 0.0681561 0)
(0.0196622 0.100252 0)
(0.0244024 0.131966 0)
(0.0288123 0.162599 0)
(0.0343364 0.195815 0)
(0.0418433 0.235031 0)
(0.0357315 0.265236 0)
(0.0252831 0.305656 0)
(-0.00109091 0.355901 0)
(-0.0286303 0.393058 0)
(-0.037839 0.411989 0)
(-0.0278956 0.418461 0)
(-0.0111192 0.420642 0)
(4.85941e-06 0.422464 0)
(0.0109689 0.430593 0)
(0.0166044 0.436976 0)
(0.0142172 0.433791 0)
(0.00420579 0.424427 0)
(-0.00848639 0.416349 0)
(-0.021216 0.400309 0)
(-0.0422559 0.370297 0)
(-0.0741857 0.307229 0)
(-0.0757933 0.237746 0)
(-0.0590977 0.206498 0)
(-0.0530705 0.179455 0)
(-0.0471446 0.149992 0)
(-0.0390046 0.121635 0)
(-0.0317659 0.0912769 0)
(-0.0254293 0.0513042 0)
(0.00418245 0.0210558 0)
(0.00634844 0.0614772 0)
(0.0102344 0.0958212 0)
(0.0140141 0.127292 0)
(0.0181641 0.159453 0)
(0.0237968 0.200105 0)
(-0.00350333 0.243742 0)
(-0.0429436 0.299639 0)
(-0.0766595 0.349374 0)
(-0.083361 0.382247 0)
(-0.0862263 0.398914 0)
(-0.0734697 0.40032 0)
(-0.048053 0.393475 0)
(-0.022792 0.396997 0)
(0.000364279 0.40868 0)
(0.0200003 0.414761 0)
(0.040385 0.424685 0)
(0.0583226 0.432741 0)
(0.0560685 0.44018 0)
(0.0444815 0.433103 0)
(0.0243016 0.42011 0)
(0.00028356 0.392045 0)
(-0.0290016 0.337331 0)
(-0.061395 0.260019 0)
(-0.0550546 0.198976 0)
(-0.0443302 0.172078 0)
(-0.0384586 0.14316 0)
(-0.0309961 0.11159 0)
(-0.0224348 0.0794885 0)
(-0.0148913 0.0353081 0)
(0.000547162 0.0197981 0)
(-0.000777242 0.0575193 0)
(-0.000212721 0.0925145 0)
(0.00212369 0.125116 0)
(0.000949199 0.166574 0)
(-0.0464986 0.232476 0)
(-0.112048 0.297446 0)
(-0.129094 0.334997 0)
(-0.123598 0.35817 0)
(-0.1168 0.379721 0)
(-0.102913 0.385896 0)
(-0.0842307 0.375553 0)
(-0.056466 0.365733 0)
(-0.0312207 0.368021 0)
(-0.0041659 0.378929 0)
(0.0221495 0.386273 0)
(0.0500034 0.394155 0)
(0.0818454 0.416427 0)
(0.0946668 0.441148 0)
(0.0878869 0.450195 0)
(0.0732292 0.443636 0)
(0.0510232 0.419913 0)
(0.0254001 0.368037 0)
(-0.00983923 0.283865 0)
(-0.0521017 0.20258 0)
(-0.035335 0.161854 0)
(-0.0287556 0.135497 0)
(-0.0227744 0.102263 0)
(-0.0146106 0.0693156 0)
(-0.00830718 0.0260161 0)
(-0.00327358 0.0201457 0)
(-0.0085503 0.0561838 0)
(-0.0135579 0.0912299 0)
(-0.0189079 0.138067 0)
(-0.076083 0.211409 0)
(-0.129639 0.286739 0)
(-0.141133 0.321552 0)
(-0.133662 0.336709 0)
(-0.114947 0.343352 0)
(-0.112811 0.368927 0)
(-0.0987007 0.378707 0)
(-0.073326 0.353127 0)
(-0.0531517 0.345047 0)
(-0.0314037 0.344385 0)
(-0.00757315 0.35041 0)
(0.0190004 0.35543 0)
(0.0471049 0.361037 0)
(0.0796477 0.389847 0)
(0.106724 0.429596 0)
(0.117464 0.455361 0)
(0.115282 0.457098 0)
(0.105474 0.445096 0)
(0.0904341 0.408362 0)
(0.065096 0.333779 0)
(-0.00741814 0.218653 0)
(-0.0426783 0.143628 0)
(-0.0208767 0.123225 0)
(-0.0146504 0.0946953 0)
(-0.00844712 0.0609729 0)
(-0.00412691 0.020958 0)
(-0.0115054 0.024587 0)
(-0.0154674 0.0600794 0)
(-0.0522296 0.10676 0)
(-0.0793013 0.165191 0)
(-0.117745 0.242345 0)
(-0.132255 0.295371 0)
(-0.121506 0.321577 0)
(-0.0887256 0.331675 0)
(-0.0726274 0.335704 0)
(-0.0727733 0.346489 0)
(-0.0738838 0.360139 0)
(-0.0554955 0.343915 0)
(-0.0425875 0.333546 0)
(-0.0260542 0.328752 0)
(-0.00762341 0.3288 0)
(0.0134832 0.330689 0)
(0.0371538 0.335256 0)
(0.0631886 0.358344 0)
(0.101684 0.411426 0)
(0.129994 0.443332 0)
(0.141898 0.454943 0)
(0.144048 0.450388 0)
(0.141253 0.431689 0)
(0.135871 0.383266 0)
(0.0863535 0.295913 0)
(0.012973 0.180194 0)
(-0.0146685 0.110417 0)
(-0.00599182 0.0869896 0)
(-0.00256491 0.0546259 0)
(-0.00113567 0.0185463 0)
(-0.0422392 0.0308445 0)
(-0.019181 0.0561324 0)
(-0.0632243 0.103179 0)
(-0.0772933 0.168814 0)
(-0.0962942 0.240117 0)
(-0.0791793 0.287207 0)
(-0.0413787 0.312079 0)
(-0.0345747 0.327379 0)
(-0.0371476 0.335579 0)
(-0.036191 0.341393 0)
(-0.0474792 0.356946 0)
(-0.0421369 0.342713 0)
(-0.0326182 0.328674 0)
(-0.0210502 0.320462 0)
(-0.00908653 0.316889 0)
(0.00584955 0.315337 0)
(0.0229979 0.317911 0)
(0.0435083 0.332261 0)
(0.0767897 0.371034 0)
(0.126021 0.419628 0)
(0.146012 0.444232 0)
(0.15621 0.444113 0)
(0.160869 0.433171 0)
(0.170929 0.404482 0)
(0.145194 0.350298 0)
(0.1502 0.273354 0)
(-0.00219596 0.119863 0)
(-0.000470216 0.0795365 0)
(0.00266361 0.049736 0)
(0.0012871 0.0173408 0)
(-0.0364237 0.0240071 0)
(-0.00482398 0.0450505 0)
(-0.018913 0.105151 0)
(-0.0225933 0.174603 0)
(-0.0115353 0.239248 0)
(0.00530071 0.281677 0)
(-0.00439488 0.3124 0)
(-0.010941 0.327595 0)
(-0.0144874 0.337669 0)
(-0.0194971 0.348838 0)
(-0.0322227 0.360889 0)
(-0.0334337 0.344078 0)
(-0.0266822 0.327358 0)
(-0.01915 0.319453 0)
(-0.013016 0.314114 0)
(-0.00488889 0.309779 0)
(0.00487389 0.309275 0)
(0.0188562 0.31476 0)
(0.0418794 0.331662 0)
(0.0888203 0.371899 0)
(0.134316 0.426436 0)
(0.153401 0.438575 0)
(0.161833 0.429341 0)
(0.175292 0.406534 0)
(0.169465 0.364599 0)
(0.193606 0.303218 0)
(0.137189 0.222709 0)
(0.013508 0.0811383 0)
(0.00682138 0.0473937 0)
(0.00510687 0.0186346 0)
(0.015661 0.00993943 0)
(0.0264793 0.060585 0)
(0.0341002 0.128626 0)
(0.0374556 0.196889 0)
(0.0279317 0.251078 0)
(0.0154693 0.286625 0)
(0.00761335 0.312265 0)
(-0.000270108 0.331439 0)
(-0.0078026 0.345153 0)
(-0.0153811 0.354679 0)
(-0.0229877 0.361501 0)
(-0.0274683 0.34495 0)
(-0.0233571 0.328749 0)
(-0.0197256 0.321714 0)
(-0.0176545 0.317403 0)
(-0.0173859 0.314355 0)
(-0.0153727 0.311352 0)
(-0.00966402 0.309791 0)
(0.00247499 0.310648 0)
(0.0292946 0.323059 0)
(0.0883102 0.380331 0)
(0.138568 0.419536 0)
(0.154488 0.420312 0)
(0.169397 0.402355 0)
(0.171128 0.363498 0)
(0.197398 0.299421 0)
(0.202874 0.26234 0)
(0.137483 0.168367 0)
(0.0152364 0.0560342 0)
(0.0123228 0.0224131 0)
(0.0272308 0.0262203 0)
(0.0492448 0.0864753 0)
(0.0492579 0.155701 0)
(0.0329518 0.215508 0)
(0.0241006 0.254053 0)
(0.0170993 0.288217 0)
(0.00772143 0.317309 0)
(-0.00193643 0.339693 0)
(-0.0120123 0.352058 0)
(-0.0151025 0.355551 0)
(-0.0170962 0.357361 0)
(-0.0202562 0.342903 0)
(-0.0186856 0.332802 0)
(-0.019496 0.329416 0)
(-0.0223707 0.328019 0)
(-0.0268526 0.326053 0)
(-0.0311014 0.322728 0)
(-0.0334521 0.31833 0)
(-0.0330334 0.31158 0)
(-0.0239864 0.305225 0)
(0.00715659 0.321844 0)
(0.082083 0.372649 0)
(0.126056 0.408229 0)
(0.14582 0.399515 0)
(0.14956 0.349996 0)
(0.181418 0.290158 0)
(0.199362 0.266986 0)
(0.196907 0.216337 0)
(0.0498233 0.113431 0)
(0.0249845 0.0340004 0)
(0.0352366 0.0412227 0)
(0.0390167 0.112582 0)
(0.0285127 0.167968 0)
(0.0221317 0.216093 0)
(0.0152415 0.257685 0)
(0.009598 0.294247 0)
(0.000505055 0.327486 0)
(-0.0141915 0.352582 0)
(-0.0165141 0.354329 0)
(-0.0121213 0.351584 0)
(-0.00935294 0.348382 0)
(-0.00943736 0.340135 0)
(-0.0118585 0.338446 0)
(-0.0167085 0.339096 0)
(-0.0229827 0.339437 0)
(-0.0300342 0.338531 0)
(-0.0373623 0.336005 0)
(-0.0440882 0.331864 0)
(-0.0506151 0.325361 0)
(-0.0568218 0.314191 0)
(-0.0541722 0.305059 0)
(-0.0180403 0.319889 0)
(0.0491676 0.371833 0)
(0.0974545 0.367399 0)
(0.0866563 0.310283 0)
(0.118622 0.284822 0)
(0.156703 0.264371 0)
(0.172028 0.223624 0)
(0.113 0.195667 0)
(0.0783569 0.0734658 0)
(0.0286328 0.0517181 0)
(0.0162311 0.114441 0)
(0.0108125 0.169302 0)
(0.00472904 0.219293 0)
(0.00112892 0.263215 0)
(-0.00426572 0.305021 0)
(-0.0221807 0.351888 0)
(-0.0217318 0.358166 0)
(-0.0097956 0.347941 0)
(-0.000728106 0.342711 0)
(0.00251022 0.340761 0)
(-0.000237032 0.342035 0)
(-0.00600046 0.345307 0)
(-0.0131789 0.348057 0)
(-0.0212729 0.349417 0)
(-0.0298467 0.349085 0)
(-0.0386404 0.346969 0)
(-0.047099 0.343165 0)
(-0.0549702 0.337672 0)
(-0.0640806 0.329505 0)
(-0.0761802 0.316016 0)
(-0.07959 0.304692 0)
(-0.049545 0.315539 0)
(0.0182438 0.304974 0)
(0.0255439 0.284385 0)
(0.0337907 0.26732 0)
(0.0803432 0.265444 0)
(0.105629 0.23916 0)
(0.0949856 0.216765 0)
(0.0603255 0.160172 0)
(0.0060464 0.0400476 0)
(-0.00659725 0.11322 0)
(-0.0138169 0.172795 0)
(-0.0171819 0.224125 0)
(-0.0191793 0.271548 0)
(-0.0317321 0.326446 0)
(-0.0330874 0.360568 0)
(-0.00493503 0.342682 0)
(0.00889716 0.334864 0)
(0.01327 0.336056 0)
(0.0119221 0.340736 0)
(0.00625559 0.347274 0)
(-0.000620391 0.352828 0)
(-0.00893716 0.356933 0)
(-0.0183122 0.359153 0)
(-0.0284429 0.359274 0)
(-0.0388938 0.3572 0)
(-0.0490816 0.353028 0)
(-0.0583176 0.347032 0)
(-0.0668707 0.339095 0)
(-0.0769352 0.328299 0)
(-0.0898383 0.312695 0)
(-0.098788 0.295243 0)
(-0.0680895 0.269608 0)
(-0.0353394 0.262136 0)
(-0.0311589 0.251003 0)
(0.00118281 0.259073 0)
(0.0411358 0.24552 0)
(0.0571973 0.234867 0)
(0.0398121 0.210545 0)
(-0.0124664 0.046046 0)
(-0.0336008 0.117406 0)
(-0.0417108 0.177845 0)
(-0.0442031 0.231464 0)
(-0.0513719 0.280383 0)
(-0.0459478 0.323643 0)
(-8.33735e-05 0.330556 0)
(0.0205745 0.321753 0)
(0.0228744 0.327877 0)
(0.0228777 0.335644 0)
(0.019399 0.344723 0)
(0.0133306 0.353723 0)
(0.00586848 0.361104 0)
(-0.00353817 0.366661 0)
(-0.014232 0.369894 0)
(-0.0260792 0.370586 0)
(-0.0384545 0.368578 0)
(-0.0505887 0.363948 0)
(-0.062066 0.356895 0)
(-0.0726174 0.347307 0)
(-0.0812594 0.335222 0)
(-0.0891406 0.32009 0)
(-0.0992709 0.300805 0)
(-0.106652 0.274083 0)
(-0.0913162 0.249697 0)
(-0.0816887 0.237614 0)
(-0.0658516 0.231382 0)
(-0.0202573 0.236562 0)
(0.0216565 0.240932 0)
(0.0256956 0.247233 0)
(-0.0307622 0.0550175 0)
(-0.0611719 0.130955 0)
(-0.075633 0.187162 0)
(-0.0706878 0.228223 0)
(-0.0470034 0.254753 0)
(0.00175902 0.297461 0)
(0.0317315 0.301387 0)
(0.0322141 0.314557 0)
(0.0320439 0.326732 0)
(0.0308797 0.338137 0)
(0.0267455 0.349931 0)
(0.0202083 0.360894 0)
(0.0120756 0.369944 0)
(0.00201004 0.376816 0)
(-0.00979666 0.3811 0)
(-0.0230237 0.38244 0)
(-0.0370042 0.380565 0)
(-0.0513322 0.375418 0)
(-0.0646707 0.367375 0)
(-0.0756306 0.35661 0)
(-0.0850976 0.342625 0)
(-0.0938165 0.324924 0)
(-0.0999806 0.304394 0)
(-0.106502 0.280139 0)
(-0.110747 0.250674 0)
(-0.105736 0.227987 0)
(-0.0951752 0.210804 0)
(-0.0669174 0.210137 0)
(-0.0144286 0.232467 0)
(0.0089279 0.265102 0)
(-0.0875208 0.0869246 0)
(-0.0371502 0.120067 0)
(-0.0561435 0.166641 0)
(-0.00897376 0.164447 0)
(0.0138613 0.233358 0)
(0.0410442 0.273555 0)
(0.0427741 0.292936 0)
(0.041249 0.311314 0)
(0.0402072 0.326983 0)
(0.037728 0.341676 0)
(0.0335075 0.355442 0)
(0.0273544 0.367926 0)
(0.0189726 0.378744 0)
(0.00828182 0.38735 0)
(-0.00443358 0.393001 0)
(-0.0190351 0.395309 0)
(-0.0344923 0.393852 0)
(-0.0510988 0.388355 0)
(-0.0671838 0.378866 0)
(-0.0800981 0.365757 0)
(-0.0894513 0.349661 0)
(-0.0954962 0.33058 0)
(-0.100418 0.307802 0)
(-0.105006 0.28145 0)
(-0.108525 0.252579 0)
(-0.108025 0.224277 0)
(-0.102121 0.200433 0)
(-0.0864469 0.185711 0)
(-0.0466125 0.207247 0)
(-0.00788856 0.25882 0)
(0.000685576 0.0981949 0)
(0.0196394 0.0786799 0)
(0.0294063 0.0936601 0)
(0.0343482 0.151936 0)
(0.0482276 0.236002 0)
(0.0528328 0.263246 0)
(0.0498767 0.287939 0)
(0.0485357 0.30885 0)
(0.0470929 0.327487 0)
(0.0445234 0.344611 0)
(0.0405947 0.360264 0)
(0.0339949 0.375293 0)
(0.0245026 0.38928 0)
(0.0128919 0.400957 0)
(-0.000844052 0.409526 0)
(-0.0171469 0.414897 0)
(-0.03374 0.414992 0)
(-0.052101 0.410393 0)
(-0.0691461 0.397336 0)
(-0.0832816 0.378945 0)
(-0.0929614 0.357754 0)
(-0.0971978 0.335534 0)
(-0.0994571 0.310883 0)
(-0.101246 0.283191 0)
(-0.103083 0.252676 0)
(-0.102336 0.222491 0)
(-0.0984145 0.194397 0)
(-0.0887648 0.171773 0)
(-0.0633648 0.175678 0)
(-0.0242391 0.222021 0)
(0.017206 0.087118 0)
(0.033311 0.0720939 0)
(0.0514274 0.0949351 0)
(0.053338 0.183067 0)
(0.0607485 0.224624 0)
(0.0559977 0.256477 0)
(0.0542151 0.283615 0)
(0.0532802 0.307331 0)
(0.0521625 0.328577 0)
(0.0506092 0.347315 0)
(0.0458376 0.366745 0)
(0.0369616 0.387261 0)
(0.0247911 0.405331 0)
(0.0108802 0.419632 0)
(-0.006231 0.430343 0)
(-0.0238568 0.435931 0)
(-0.0408008 0.436484 0)
(-0.0587356 0.43451 0)
(-0.0775314 0.421393 0)
(-0.093968 0.4001 0)
(-0.0993176 0.372523 0)
(-0.0977594 0.341964 0)
(-0.0968744 0.313818 0)
(-0.0962287 0.284205 0)
(-0.0956775 0.252642 0)
(-0.0941115 0.220585 0)
(-0.0904106 0.189879 0)
(-0.0837667 0.162323 0)
(-0.0666071 0.149688 0)
(-0.0322837 0.174876 0)
(0.02135 0.0756924 0)
(0.0433055 0.0735425 0)
(0.0595887 0.123785 0)
(0.062606 0.178984 0)
(0.0573528 0.217249 0)
(0.0554771 0.251423 0)
(0.0546529 0.281271 0)
(0.0545653 0.307609 0)
(0.055067 0.330296 0)
(0.0533682 0.353545 0)
(0.044794 0.379663 0)
(0.0317256 0.402804 0)
(0.0169694 0.420097 0)
(0.00205443 0.434394 0)
(-0.0115721 0.44523 0)
(-0.0254089 0.448709 0)
(-0.0406044 0.448678 0)
(-0.0554251 0.447017 0)
(-0.070586 0.437138 0)
(-0.0879221 0.412662 0)
(-0.101151 0.38163 0)
(-0.0992367 0.348301 0)
(-0.093101 0.317009 0)
(-0.0892258 0.28508 0)
(-0.0868858 0.251902 0)
(-0.0842367 0.218378 0)
(-0.0801537 0.185917 0)
(-0.0745029 0.15518 0)
(-0.0645032 0.129917 0)
(-0.0371909 0.134405 0)
(0.0264583 0.0655582 0)
(0.0501968 0.082306 0)
(0.056506 0.131328 0)
(0.053381 0.172843 0)
(0.0512771 0.213118 0)
(0.0505435 0.249029 0)
(0.0508718 0.281212 0)
(0.0522881 0.309194 0)
(0.0536523 0.336083 0)
(0.0492086 0.365266 0)
(0.0339887 0.391859 0)
(0.0211499 0.415097 0)
(0.00675328 0.432781 0)
(-0.00579083 0.444603 0)
(-0.0140022 0.452262 0)
(-0.0223078 0.457217 0)
(-0.0323737 0.457478 0)
(-0.0428405 0.454669 0)
(-0.052206 0.446843 0)
(-0.0631137 0.426287 0)
(-0.0871589 0.388148 0)
(-0.0932438 0.34625 0)
(-0.0884585 0.318921 0)
(-0.0808523 0.285722 0)
(-0.0762998 0.25085 0)
(-0.07261 0.216036 0)
(-0.0683162 0.181728 0)
(-0.0627958 0.148773 0)
(-0.0573681 0.11488 0)
(-0.0433962 0.0965459 0)
(0.0305889 0.0524307 0)
(0.0432718 0.0873922 0)
(0.0436466 0.127726 0)
(0.0423218 0.170376 0)
(0.0413534 0.210889 0)
(0.0415089 0.248601 0)
(0.0429343 0.282624 0)
(0.0457556 0.314099 0)
(0.0440866 0.340042 0)
(0.0297424 0.374101 0)
(0.0133837 0.403377 0)
(0.00271799 0.425714 0)
(-0.00625433 0.442498 0)
(-0.012396 0.449237 0)
(-0.0152439 0.452621 0)
(-0.0170122 0.459647 0)
(-0.0190084 0.461707 0)
(-0.0219034 0.459281 0)
(-0.0254047 0.451668 0)
(-0.0301408 0.43642 0)
(-0.0449717 0.406844 0)
(-0.0635269 0.357045 0)
(-0.0732421 0.311415 0)
(-0.0719688 0.284322 0)
(-0.0644372 0.249139 0)
(-0.0590212 0.213532 0)
(-0.0541801 0.177721 0)
(-0.0489574 0.141503 0)
(-0.0444642 0.102643 0)
(-0.0373758 0.0612678 0)
(0.0259772 0.0389114 0)
(0.0301895 0.0823025 0)
(0.0298651 0.125601 0)
(0.0292785 0.167784 0)
(0.028301 0.209709 0)
(0.0284406 0.248949 0)
(0.0325606 0.285083 0)
(0.03183 0.304115 0)
(0.0124736 0.346268 0)
(-0.00726776 0.387818 0)
(-0.0164763 0.413595 0)
(-0.0222356 0.431682 0)
(-0.0217025 0.443981 0)
(-0.0188143 0.44776 0)
(-0.0159626 0.450227 0)
(-0.0112108 0.455679 0)
(-0.00422034 0.458533 0)
(0.00208212 0.458247 0)
(0.00578171 0.4532 0)
(0.0077085 0.441588 0)
(0.0103405 0.419291 0)
(0.00704181 0.373438 0)
(-0.0147427 0.321076 0)
(-0.0402458 0.284698 0)
(-0.048446 0.249098 0)
(-0.0428184 0.211343 0)
(-0.0372148 0.174478 0)
(-0.0330217 0.133952 0)
(-0.0276883 0.0927946 0)
(-0.0216173 0.0382041 0)
(0.0138367 0.0272219 0)
(0.0159764 0.0776154 0)
(0.0162003 0.121151 0)
(0.0146719 0.165218 0)
(0.0124995 0.207723 0)
(0.0098918 0.251017 0)
(-0.0051192 0.275356 0)
(-0.019079 0.313886 0)
(-0.0323421 0.357569 0)
(-0.0430706 0.395946 0)
(-0.0455707 0.416653 0)
(-0.0438221 0.429326 0)
(-0.0354136 0.435046 0)
(-0.0250418 0.438989 0)
(-0.0161904 0.443568 0)
(-0.00482655 0.444487 0)
(0.00755755 0.447839 0)
(0.0204612 0.449543 0)
(0.0312751 0.449485 0)
(0.0399422 0.43797 0)
(0.0467121 0.420334 0)
(0.0527433 0.387572 0)
(0.0451359 0.344491 0)
(0.0303726 0.298299 0)
(-0.00126447 0.259617 0)
(-0.021266 0.211879 0)
(-0.0179485 0.171085 0)
(-0.0142692 0.129303 0)
(-0.0111334 0.0841775 0)
(-0.0094408 0.0293203 0)
(0.00497103 0.0238026 0)
(0.00416391 0.0717557 0)
(0.00263319 0.116656 0)
(-0.000668862 0.160101 0)
(-0.00655898 0.209163 0)
(-0.020992 0.247261 0)
(-0.0266847 0.285292 0)
(-0.0382084 0.334758 0)
(-0.0527435 0.376015 0)
(-0.0583584 0.399388 0)
(-0.0615148 0.412153 0)
(-0.0538382 0.419317 0)
(-0.0429235 0.420389 0)
(-0.0294376 0.423827 0)
(-0.0159488 0.428621 0)
(-0.00125285 0.429914 0)
(0.0132967 0.433562 0)
(0.0283535 0.436735 0)
(0.042563 0.440893 0)
(0.0495876 0.434719 0)
(0.0534893 0.420843 0)
(0.0527929 0.389337 0)
(0.0492983 0.348153 0)
(0.0486609 0.307855 0)
(0.0399922 0.265285 0)
(0.0246283 0.221474 0)
(0.00255027 0.170957 0)
(0.00590618 0.125911 0)
(0.00421786 0.0778226 0)
(-0.000541945 0.0267523 0)
(-0.0011289 0.0228964 0)
(-0.00491492 0.0664247 0)
(-0.010253 0.109405 0)
(-0.011048 0.15672 0)
(-0.0162653 0.208301 0)
(-0.018418 0.254682 0)
(-0.0143618 0.301201 0)
(-0.0140526 0.342019 0)
(-0.0439618 0.381164 0)
(-0.0590192 0.405864 0)
(-0.0624996 0.408717 0)
(-0.0534652 0.406356 0)
(-0.0431903 0.405937 0)
(-0.0298239 0.407832 0)
(-0.0151513 0.412481 0)
(-0.00029286 0.415602 0)
(0.0138798 0.420365 0)
(0.0278835 0.425553 0)
(0.0399685 0.433768 0)
(0.0476801 0.435821 0)
(0.0383792 0.419127 0)
(0.0187795 0.392288 0)
(0.0215455 0.360569 0)
(0.0331064 0.312541 0)
(0.0332333 0.262699 0)
(0.0321785 0.215137 0)
(0.0269826 0.166348 0)
(0.0300007 0.126989 0)
(0.016335 0.0734015 0)
(0.00680715 0.0255122 0)
(-0.00506565 0.0210996 0)
(-0.0123145 0.0605417 0)
(-0.00904737 0.101105 0)
(-0.00899889 0.159041 0)
(-0.00151793 0.213367 0)
(0.0106496 0.268532 0)
(0.00949934 0.320133 0)
(0.00206663 0.355528 0)
(-0.00776168 0.386381 0)
(-0.0474827 0.413278 0)
(-0.0586322 0.407697 0)
(-0.0490157 0.395447 0)
(-0.038868 0.393996 0)
(-0.0269832 0.394478 0)
(-0.0134375 0.398848 0)
(9.59949e-05 0.403623 0)
(0.0128697 0.410022 0)
(0.0247758 0.41806 0)
(0.0340141 0.430798 0)
(0.0316425 0.437756 0)
(0.00405518 0.422594 0)
(-0.00347375 0.402208 0)
(-0.0129032 0.374612 0)
(-0.0165283 0.328441 0)
(-0.00732847 0.267625 0)
(0.00724095 0.211633 0)
(0.0123297 0.157395 0)
(0.0167166 0.109055 0)
(0.013875 0.075413 0)
(0.0216419 0.0306365 0)
(-0.0163713 0.0237419 0)
(2.82839e-05 0.0503035 0)
(0.00946262 0.113975 0)
(0.0124245 0.171134 0)
(0.0165234 0.227395 0)
(0.0154421 0.279801 0)
(0.00837735 0.323812 0)
(0.000990613 0.361848 0)
(-0.00567956 0.395467 0)
(-0.0308445 0.424812 0)
(-0.0505809 0.406516 0)
(-0.0448687 0.388171 0)
(-0.0336854 0.384232 0)
(-0.0228179 0.384357 0)
(-0.0109529 0.387993 0)
(0.00116337 0.393414 0)
(0.0128015 0.40082 0)
(0.0238015 0.411169 0)
(0.0312306 0.428579 0)
(0.0195248 0.445505 0)
(0.000931744 0.431934 0)
(-0.00814735 0.407786 0)
(-0.0168905 0.377841 0)
(-0.0263237 0.340803 0)
(-0.0351426 0.287886 0)
(-0.0347162 0.225232 0)
(-0.0292163 0.165954 0)
(-0.024296 0.110381 0)
(-0.0182022 0.0577624 0)
(0.0528832 0.0420343 0)
(1.76249e-05 0.0250692 0)
(0.0236984 0.0722508 0)
(0.017352 0.132329 0)
(0.0106909 0.185047 0)
(0.00511341 0.236021 0)
(0.00210314 0.282072 0)
(-0.00264905 0.326602 0)
(-0.0104681 0.369025 0)
(-0.0197924 0.405146 0)
(-0.0360362 0.428785 0)
(-0.0448005 0.405171 0)
(-0.0404446 0.382784 0)
(-0.029245 0.376334 0)
(-0.0188575 0.376019 0)
(-0.00827124 0.378586 0)
(0.00272803 0.383413 0)
(0.0137487 0.390443 0)
(0.0251751 0.400748 0)
(0.0333742 0.421846 0)
(0.0246454 0.449195 0)
(0.0116503 0.44256 0)
(-0.00180213 0.416125 0)
(-0.0127118 0.3808 0)
(-0.0200941 0.341675 0)
(-0.0274019 0.297347 0)
(-0.0373883 0.244527 0)
(-0.0464491 0.185725 0)
(-0.050228 0.127484 0)
(-0.0463052 0.069385 0)
(-0.0243299 0.0194561 0)
(0.0157479 0.0308408 0)
(0.00542585 0.0898073 0)
(-0.00443114 0.142505 0)
(-0.0103668 0.190911 0)
(-0.0147138 0.238256 0)
(-0.0178866 0.284918 0)
(-0.0229076 0.332427 0)
(-0.0313439 0.378942 0)
(-0.039292 0.41105 0)
(-0.0442189 0.42231 0)
(-0.039671 0.398173 0)
(-0.0339555 0.377656 0)
(-0.0247806 0.369547 0)
(-0.0153521 0.367998 0)
(-0.00571779 0.369452 0)
(0.00423216 0.373227 0)
(0.0145587 0.379053 0)
(0.0258985 0.387544 0)
(0.0370379 0.403659 0)
(0.0376949 0.442345 0)
(0.0304648 0.452933 0)
(0.0155659 0.431312 0)
(0.00119319 0.388591 0)
(-0.00543149 0.345031 0)
(-0.0113019 0.299125 0)
(-0.0175741 0.250193 0)
(-0.0254774 0.19763 0)
(-0.0332717 0.142981 0)
(-0.0389289 0.0879124 0)
(-0.0349303 0.0286448 0)
(-0.00152193 0.0367047 0)
(-0.0169093 0.0968391 0)
(-0.0289245 0.149455 0)
(-0.0358536 0.196358 0)
(-0.0395183 0.241238 0)
(-0.0419248 0.287474 0)
(-0.0454133 0.337229 0)
(-0.0514464 0.385352 0)
(-0.0495512 0.406282 0)
(-0.0438316 0.398217 0)
(-0.0315942 0.382039 0)
(-0.0253211 0.3697 0)
(-0.0191102 0.36187 0)
(-0.0114141 0.359411 0)
(-0.00296536 0.360441 0)
(0.00552716 0.363699 0)
(0.014415 0.368661 0)
(0.0240991 0.37528 0)
(0.0358153 0.386604 0)
(0.0473675 0.418302 0)
(0.0447953 0.456825 0)
(0.0378291 0.449665 0)
(0.021926 0.399629 0)
(0.0156246 0.350323 0)
(0.0129101 0.303895 0)
(0.00866479 0.2562 0)
(0.000464118 0.204026 0)
(-0.00797719 0.150043 0)
(-0.0124355 0.0969528 0)
(-0.0199847 0.0376402 0)
(-0.0250775 0.0455314 0)
(-0.0478873 0.108218 0)
(-0.0579721 0.157943 0)
(-0.0611421 0.199697 0)
(-0.0617357 0.238793 0)
(-0.0640818 0.284216 0)
(-0.0637317 0.329666 0)
(-0.0533979 0.366095 0)
(-0.0387627 0.369234 0)
(-0.0274468 0.354791 0)
(-0.0181215 0.35608 0)
(-0.0138552 0.355744 0)
(-0.011085 0.352267 0)
(-0.00583808 0.35057 0)
(0.000629869 0.351991 0)
(0.00694254 0.35559 0)
(0.0134938 0.360524 0)
(0.0204105 0.366556 0)
(0.0300303 0.377215 0)
(0.0414819 0.402715 0)
(0.0451094 0.450426 0)
(0.050381 0.452875 0)
(0.0449577 0.40815 0)
(0.0402552 0.35386 0)
(0.0392504 0.307164 0)
(0.037791 0.262348 0)
(0.0303391 0.211944 0)
(0.0192975 0.157155 0)
(0.00911576 0.0998775 0)
(-0.00381477 0.0349197 0)
(-0.0770094 0.0694366 0)
(-0.0884601 0.123127 0)
(-0.0873291 0.165082 0)
(-0.0823636 0.200837 0)
(-0.0765991 0.230522 0)
(-0.072768 0.254995 0)
(-0.0525147 0.276044 0)
(-0.0348434 0.293448 0)
(-0.0177371 0.303668 0)
(-0.00727774 0.312364 0)
(0.000141959 0.325093 0)
(0.00276091 0.335135 0)
(0.00084102 0.34112 0)
(0.00209705 0.342436 0)
(0.00546015 0.344682 0)
(0.00884369 0.348897 0)
(0.0124631 0.354219 0)
(0.0163604 0.360772 0)
(0.0228403 0.372111 0)
(0.0300191 0.394778 0)
(0.0346971 0.429571 0)
(0.0516129 0.442222 0)
(0.0624438 0.404745 0)
(0.064295 0.351656 0)
(0.0650955 0.306763 0)
(0.066518 0.267026 0)
(0.0590371 0.220058 0)
(0.0463586 0.165209 0)
(0.0310013 0.107504 0)
(0.0102715 0.04164 0)
(-0.0210847 -0.0190381 0)
(-0.0871185 0.110944 0)
(-0.0921465 0.163082 0)
(-0.0900643 0.190442 0)
(-0.0696482 0.190526 0)
(-0.0469431 0.18589 0)
(-0.0371826 0.225742 0)
(-0.0219299 0.254085 0)
(-0.00413845 0.274369 0)
(0.00931146 0.288509 0)
(0.0178414 0.303682 0)
(0.0217026 0.316563 0)
(0.017703 0.32841 0)
(0.0128536 0.335106 0)
(0.0114283 0.338635 0)
(0.0110839 0.343286 0)
(0.0114672 0.348582 0)
(0.0125805 0.354987 0)
(0.0158347 0.365577 0)
(0.0188414 0.382564 0)
(0.0227057 0.398105 0)
(0.0426615 0.405349 0)
(0.0680834 0.386354 0)
(0.0826202 0.340159 0)
(0.0863773 0.301126 0)
(0.0900764 0.268501 0)
(0.0886986 0.231202 0)
(0.0744283 0.176851 0)
(0.0569593 0.117818 0)
(0.0308163 0.0478179 0)
(0.030042 -0.078227 0)
(0.0292947 -0.041178 0)
(0.00431459 0.0406001 0)
(-0.0123946 0.0903101 0)
(-0.0199252 0.115649 0)
(-0.0272304 0.167664 0)
(-0.0210153 0.211631 0)
(-0.00909687 0.243647 0)
(0.00612658 0.267134 0)
(0.019816 0.283386 0)
(0.0293304 0.297954 0)
(0.0344406 0.310085 0)
(0.0331914 0.319567 0)
(0.0260234 0.327226 0)
(0.0182539 0.332868 0)
(0.0132018 0.337735 0)
(0.00978778 0.342342 0)
(0.00789255 0.346951 0)
(0.00773204 0.353385 0)
(0.0068937 0.35908 0)
(0.0125839 0.358952 0)
(0.0314863 0.350407 0)
(0.0546886 0.338817 0)
(0.0830776 0.309201 0)
(0.0955736 0.286439 0)
(0.0997927 0.265721 0)
(0.105388 0.242296 0)
(0.102293 0.199019 0)
(0.101472 0.129238 0)
(0.0894147 0.05921 0)
(0.0347503 -0.0646522 0)
(0.041258 -0.028645 0)
(0.0440091 0.0259977 0)
(0.0272505 0.0741633 0)
(0.00410949 0.125029 0)
(-0.00672928 0.175764 0)
(-0.00470507 0.217516 0)
(0.00299954 0.249374 0)
(0.0138105 0.272819 0)
(0.0253517 0.29003 0)
(0.0338581 0.303177 0)
(0.0387362 0.313336 0)
(0.0391425 0.319643 0)
(0.0343949 0.323137 0)
(0.0246085 0.326688 0)
(0.014823 0.3307 0)
(0.00693357 0.334018 0)
(0.00100512 0.33539 0)
(-0.00346666 0.33539 0)
(-0.00549398 0.332459 0)
(0.00378167 0.32593 0)
(0.0231938 0.30926 0)
(0.0403424 0.286692 0)
(0.0540997 0.256452 0)
(0.0742786 0.244103 0)
(0.0861868 0.24807 0)
(0.0820931 0.21616 0)
(0.000907703 0.0928891 0)
(-0.0108665 0.0143969 0)
(-0.0282235 -0.0496264 0)
(0.0369428 -0.0376361 0)
(0.0402314 0.0118022 0)
(0.0470676 0.0693601 0)
(0.0358373 0.11367 0)
(0.0193294 0.156955 0)
(0.00899525 0.199101 0)
(0.00856412 0.236366 0)
(0.0132522 0.26649 0)
(0.0204409 0.289815 0)
(0.0278015 0.307055 0)
(0.0330822 0.318702 0)
(0.0362417 0.325684 0)
(0.036805 0.327638 0)
(0.0334969 0.326904 0)
(0.0249598 0.326124 0)
(0.0141538 0.326811 0)
(0.0031016 0.327689 0)
(-0.00621349 0.326717 0)
(-0.0126554 0.323866 0)
(-0.0129224 0.319806 0)
(-0.00326682 0.31041 0)
(0.0117617 0.290831 0)
(0.0247138 0.263249 0)
(0.0312099 0.226089 0)
(0.0264756 0.183791 0)
(0.00952395 0.158014 0)
(-0.0089455 0.122696 0)
(-0.0243113 0.081833 0)
(-0.0222638 0.0234832 0)
(-0.0321429 -0.0457495 0)
(0.0347422 -0.00376137 0)
(0.0352505 0.0598472 0)
(0.0381491 0.120076 0)
(0.0317739 0.160232 0)
(0.0255063 0.193937 0)
(0.0198236 0.22873 0)
(0.0189259 0.261516 0)
(0.020968 0.289103 0)
(0.0239758 0.310775 0)
(0.0264236 0.326731 0)
(0.0276875 0.337404 0)
(0.0281509 0.343335 0)
(0.0271822 0.344497 0)
(0.0240864 0.341707 0)
(0.0179476 0.336957 0)
(0.00925691 0.333483 0)
(-0.000749053 0.331755 0)
(-0.00991339 0.329979 0)
(-0.0160717 0.326992 0)
(-0.0157572 0.32203 0)
(-0.00874714 0.31051 0)
(-0.00178635 0.291364 0)
(0.00440518 0.262465 0)
(0.00524806 0.224067 0)
(-0.00396216 0.181997 0)
(-0.0183174 0.15053 0)
(-0.0208685 0.128196 0)
(-0.0151942 0.112983 0)
(-0.0132569 0.0631306 0)
(-0.0219958 -0.0188556 0)
(0.0299262 0.0318096 0)
(0.0228819 0.101755 0)
(0.0236748 0.16628 0)
(0.0311295 0.196137 0)
(0.0319357 0.225551 0)
(0.0301953 0.257055 0)
(0.0276302 0.286288 0)
(0.025806 0.310743 0)
(0.0243105 0.329891 0)
(0.0226605 0.344169 0)
(0.0207706 0.354161 0)
(0.0188474 0.360061 0)
(0.0164829 0.361853 0)
(0.0129004 0.360342 0)
(0.0077118 0.357267 0)
(0.00154667 0.354435 0)
(-0.00523477 0.3522 0)
(-0.0121837 0.350181 0)
(-0.0175113 0.346853 0)
(-0.0186796 0.339838 0)
(-0.0166441 0.326215 0)
(-0.0160651 0.3074 0)
(-0.0158378 0.278717 0)
(-0.0193953 0.24209 0)
(-0.0273479 0.204252 0)
(-0.0303529 0.176263 0)
(-0.0203272 0.158235 0)
(-0.00146698 0.146487 0)
(0.00301344 0.105718 0)
(-0.00716773 0.0158986 0)
(0.0139455 0.0600529 0)
(0.00999069 0.140834 0)
(0.0435259 0.170107 0)
(0.0685597 0.196583 0)
(0.0647155 0.237296 0)
(0.0505965 0.27457 0)
(0.0373084 0.30384 0)
(0.0282841 0.326315 0)
(0.0222329 0.343728 0)
(0.0177075 0.357013 0)
(0.0140176 0.366772 0)
(0.0108891 0.373274 0)
(0.00783037 0.376732 0)
(0.00431919 0.377593 0)
(0.000438104 0.376939 0)
(-0.00329042 0.376236 0)
(-0.00725161 0.375687 0)
(-0.0120498 0.374445 0)
(-0.0168744 0.371107 0)
(-0.0203089 0.363852 0)
(-0.0232087 0.350978 0)
(-0.0269103 0.332142 0)
(-0.0313499 0.30603 0)
(-0.0376503 0.272912 0)
(-0.0439515 0.237998 0)
(-0.0412301 0.20903 0)
(-0.0241348 0.18561 0)
(0.00245916 0.167916 0)
(0.0142846 0.137348 0)
(0.0135577 0.0510517 0)
(0.00646228 0.074118 0)
(0.0453292 0.135425 0)
(0.0729869 0.158877 0)
(0.0734268 0.197995 0)
(0.0675922 0.23857 0)
(0.0562187 0.277382 0)
(0.0418208 0.310216 0)
(0.0284006 0.335128 0)
(0.0184609 0.353219 0)
(0.0118014 0.366304 0)
(0.00723587 0.375792 0)
(0.00394006 0.382456 0)
(0.00136368 0.38692 0)
(-0.00100046 0.389783 0)
(-0.00327028 0.391664 0)
(-0.0051202 0.393083 0)
(-0.00716576 0.393875 0)
(-0.0104736 0.393276 0)
(-0.0148202 0.390096 0)
(-0.0193611 0.383207 0)
(-0.0244384 0.371966 0)
(-0.030524 0.356164 0)
(-0.0378286 0.3351 0)
(-0.0464356 0.307678 0)
(-0.0533773 0.275632 0)
(-0.0515368 0.243385 0)
(-0.0358044 0.210817 0)
(-0.0133264 0.177716 0)
(0.0112649 0.153104 0)
(0.0223043 0.0821428 0)
(0.0300838 0.095738 0)
(0.0570687 0.119015 0)
(0.061196 0.157797 0)
(0.0610429 0.199329 0)
(0.0559135 0.242253 0)
(0.0458354 0.283643 0)
(0.0333365 0.317924 0)
(0.0208052 0.343337 0)
(0.0110195 0.360941 0)
(0.00439934 0.37331 0)
(0.000183396 0.382186 0)
(-0.00243817 0.388522 0)
(-0.00396154 0.393088 0)
(-0.00477189 0.396597 0)
(-0.00510858 0.399662 0)
(-0.00523591 0.402312 0)
(-0.00593065 0.404125 0)
(-0.00791423 0.404314 0)
(-0.0112084 0.401785 0)
(-0.0155024 0.395716 0)
(-0.0208784 0.385821 0)
(-0.0274128 0.372143 0)
(-0.0351297 0.354701 0)
(-0.0446953 0.332732 0)
(-0.0564568 0.304487 0)
(-0.0662737 0.267969 0)
(-0.0686264 0.221702 0)
(-0.0669171 0.172751 0)
(-0.0376346 0.13876 0)
(0.00434871 0.0962125 0)
(0.0388188 0.0685975 0)
(0.0426199 0.113478 0)
(0.044753 0.156905 0)
(0.0437027 0.201233 0)
(0.0372018 0.248277 0)
(0.0268475 0.292317 0)
(0.016422 0.326481 0)
(0.00730857 0.350493 0)
(0.000272779 0.366847 0)
(-0.00445156 0.37822 0)
(-0.00721591 0.386281 0)
(-0.00844473 0.391991 0)
(-0.0084604 0.396212 0)
(-0.00760248 0.399719 0)
(-0.00620963 0.403053 0)
(-0.00464516 0.406339 0)
(-0.00372625 0.409063 0)
(-0.00409067 0.410321 0)
(-0.0060427 0.408939 0)
(-0.00947772 0.403966 0)
(-0.0142667 0.395071 0)
(-0.0204062 0.382256 0)
(-0.0279446 0.365365 0)
(-0.03683 0.343457 0)
(-0.0469662 0.314269 0)
(-0.0573811 0.275085 0)
(-0.0642129 0.226636 0)
(-0.0650963 0.177521 0)
(-0.0623444 0.129653 0)
(-0.0385587 0.0837456 0)
(0.0222973 0.0440182 0)
(0.0245612 0.107538 0)
(0.0259563 0.155442 0)
(0.0234965 0.203549 0)
(0.0159185 0.254827 0)
(0.00568554 0.300539 0)
(-0.00213694 0.333285 0)
(-0.00781913 0.355472 0)
(-0.0116776 0.370504 0)
(-0.0139215 0.380929 0)
(-0.014731 0.388148 0)
(-0.0141893 0.393078 0)
(-0.0124341 0.396719 0)
(-0.00979945 0.399983 0)
(-0.00670339 0.403343 0)
(-0.0035223 0.407123 0)
(-0.00102044 0.41082 0)
(0.000227986 0.413244 0)
(-0.000243717 0.413145 0)
(-0.00230475 0.409331 0)
(-0.00559281 0.401366 0)
(-0.00994264 0.389299 0)
(-0.0154108 0.372912 0)
(-0.0219293 0.35106 0)
(-0.0291838 0.321702 0)
(-0.0365269 0.282524 0)
(-0.043064 0.233184 0)
(-0.0451731 0.180843 0)
(-0.0434616 0.128946 0)
(-0.0386415 0.0699722 0)
(0.00875798 0.0367827 0)
(0.00692797 0.10154 0)
(0.00668117 0.153656 0)
(0.00166811 0.206009 0)
(-0.00792919 0.262793 0)
(-0.0164962 0.308026 0)
(-0.0206547 0.338039 0)
(-0.0226708 0.358123 0)
(-0.0233792 0.37186 0)
(-0.0231221 0.381425 0)
(-0.0219007 0.387842 0)
(-0.0195247 0.39196 0)
(-0.0160024 0.39494 0)
(-0.0116733 0.397927 0)
(-0.00700103 0.401535 0)
(-0.00241488 0.405639 0)
(0.00170845 0.409981 0)
(0.00454854 0.41356 0)
(0.005664 0.414781 0)
(0.00524666 0.412099 0)
(0.00390546 0.404853 0)
(0.00199203 0.39328 0)
(-0.000559757 0.377346 0)
(-0.00379977 0.355942 0)
(-0.00764842 0.327126 0)
(-0.0122493 0.288242 0)
(-0.0177347 0.238098 0)
(-0.0209777 0.182738 0)
(-0.0210043 0.125591 0)
(-0.0220227 0.0499864 0)
(-0.00062739 0.035563 0)
(-0.00805613 0.0977708 0)
(-0.0146968 0.153741 0)
(-0.0205809 0.209937 0)
(-0.0337861 0.272666 0)
(-0.0374165 0.313144 0)
(-0.037261 0.339817 0)
(-0.035759 0.358199 0)
(-0.0336832 0.37098 0)
(-0.0311971 0.379765 0)
(-0.0281247 0.385508 0)
(-0.0240628 0.388933 0)
(-0.0189923 0.391331 0)
(-0.0133049 0.394057 0)
(-0.00741128 0.397636 0)
(-0.00153758 0.401997 0)
(0.00390509 0.407091 0)
(0.00824205 0.411758 0)
(0.0109985 0.41408 0)
(0.0124077 0.412313 0)
(0.0132455 0.405523 0)
(0.0139682 0.394141 0)
(0.0144212 0.378448 0)
(0.0143952 0.357591 0)
(0.0137681 0.329765 0)
(0.0118283 0.291789 0)
(0.0075589 0.241285 0)
(0.00306389 0.183598 0)
(-0.000401757 0.121167 0)
(-0.00637904 0.0444504 0)
(-0.00821726 0.0365923 0)
(-0.0235177 0.096431 0)
(-0.0390221 0.155546 0)
(-0.054123 0.227216 0)
(-0.0581606 0.28031 0)
(-0.0548308 0.31472 0)
(-0.0503499 0.338895 0)
(-0.0459861 0.3569 0)
(-0.0416968 0.369616 0)
(-0.037371 0.378075 0)
(-0.032667 0.382925 0)
(-0.0271903 0.385231 0)
(-0.0210502 0.387118 0)
(-0.0145947 0.389872 0)
(-0.00805784 0.393458 0)
(-0.00141866 0.39769 0)
(0.00507273 0.403019 0)
(0.010958 0.408984 0)
(0.0153986 0.412666 0)
(0.0184048 0.41174 0)
(0.0213952 0.405534 0)
(0.0249988 0.394424 0)
(0.028512 0.378897 0)
(0.0315929 0.35877 0)
(0.0346623 0.331851 0)
(0.0370931 0.294528 0)
(0.0354338 0.2444 0)
(0.0292148 0.185563 0)
(0.0187323 0.12176 0)
(0.00619635 0.046107 0)
(-0.0191273 0.0392885 0)
(-0.0339409 0.100464 0)
(-0.0708601 0.160214 0)
(-0.0799521 0.227771 0)
(-0.0709298 0.276706 0)
(-0.0622382 0.305801 0)
(-0.0553413 0.328694 0)
(-0.0496134 0.345374 0)
(-0.0438379 0.357204 0)
(-0.0381653 0.365715 0)
(-0.0326953 0.372617 0)
(-0.0271502 0.376824 0)
(-0.0211249 0.379294 0)
(-0.0148557 0.381913 0)
(-0.00856087 0.385179 0)
(-0.00213713 0.389015 0)
(0.00418033 0.392517 0)
(0.010049 0.393329 0)
(0.0148024 0.385982 0)
(0.0194203 0.381348 0)
(0.0248731 0.380266 0)
(0.0307556 0.37376 0)
(0.0361513 0.356971 0)
(0.0430566 0.337178 0)
(0.0526087 0.315816 0)
(0.0606517 0.287264 0)
(0.0653397 0.244461 0)
(0.0510005 0.186249 0)
(0.0398978 0.12587 0)
(0.0214596 0.0479019 0)
(-0.0827511 0.053628 0)
(-0.0473949 0.0626078 0)
(-0.0344064 0.0716979 0)
(-0.0252976 0.109356 0)
(-0.0300303 0.172512 0)
(-0.0206451 0.201198 0)
(-0.0195599 0.233246 0)
(-0.0162186 0.250396 0)
(-0.0140801 0.266564 0)
(-0.0127273 0.283433 0)
(-0.0131607 0.304848 0)
(-0.0145296 0.327701 0)
(-0.0132055 0.340584 0)
(-0.0104289 0.344081 0)
(-0.00796429 0.345661 0)
(-0.00516399 0.34757 0)
(-0.00224226 0.340557 0)
(-0.00203642 0.318418 0)
(-0.00132196 0.295531 0)
(0.00239464 0.280085 0)
(0.00658586 0.266981 0)
(0.00999048 0.252011 0)
(0.0122492 0.228173 0)
(0.0152296 0.203341 0)
(0.0219913 0.18587 0)
(0.0347657 0.179203 0)
(0.0412862 0.140316 0)
(0.0495825 0.114781 0)
(0.0743057 0.128577 0)
(0.0485304 0.0525367 0)
(-0.0130348 -0.00331434 0)
(-0.00728932 0.00104343 0)
(0.00602415 0.030302 0)
(0.0205107 0.0614382 0)
(0.0247269 0.100923 0)
(0.0215486 0.140171 0)
(0.0170956 0.176728 0)
(0.0139113 0.207812 0)
(0.0115981 0.234569 0)
(0.009514 0.257988 0)
(0.0073668 0.278162 0)
(0.00404957 0.295073 0)
(-0.000205748 0.307539 0)
(-0.00401611 0.314517 0)
(-0.00717247 0.317056 0)
(-0.0103141 0.315727 0)
(-0.013696 0.309411 0)
(-0.0157282 0.298958 0)
(-0.0143969 0.286017 0)
(-0.0108851 0.270168 0)
(-0.00786023 0.250935 0)
(-0.00664718 0.2282 0)
(-0.00682789 0.202065 0)
(-0.0077743 0.172978 0)
(-0.00949324 0.140891 0)
(-0.00955038 0.106035 0)
(-0.00380031 0.0697897 0)
(0.00726354 0.035822 0)
(0.0163858 0.0116275 0)
(0.0354579 0.0182193 0)
(0.0119138 -0.0113209 0)
(0.0154804 0.00302316 0)
(0.033794 0.0321199 0)
(0.0418472 0.0747591 0)
(0.0412993 0.1194 0)
(0.036903 0.16309 0)
(0.0319111 0.200129 0)
(0.0276055 0.231829 0)
(0.0239648 0.257959 0)
(0.020015 0.279617 0)
(0.0159911 0.296405 0)
(0.010941 0.308812 0)
(0.00473011 0.317941 0)
(-0.00142806 0.324001 0)
(-0.007028 0.326573 0)
(-0.0127074 0.325891 0)
(-0.0183501 0.322651 0)
(-0.0220975 0.317358 0)
(-0.0228082 0.308714 0)
(-0.0213844 0.295063 0)
(-0.0196856 0.276624 0)
(-0.0192652 0.253893 0)
(-0.0205462 0.227658 0)
(-0.0236153 0.197008 0)
(-0.0271753 0.161393 0)
(-0.0300966 0.119335 0)
(-0.0300083 0.0752967 0)
(-0.0232806 0.0319736 0)
(-0.00978417 -7.70342e-05 0)
(-0.00980743 -0.0159291 0)
(0.0208203 -0.000530943 0)
(0.0290526 0.019623 0)
(0.0450119 0.0589475 0)
(0.0489633 0.111839 0)
(0.0478386 0.16343 0)
(0.0431569 0.208674 0)
(0.0394462 0.245165 0)
(0.0328603 0.274991 0)
(0.0266393 0.297307 0)
(0.0206856 0.314667 0)
(0.0151503 0.327255 0)
(0.00972167 0.336203 0)
(0.0038669 0.342392 0)
(-0.0018979 0.346615 0)
(-0.00726927 0.348855 0)
(-0.012704 0.349338 0)
(-0.0179592 0.348266 0)
(-0.0217706 0.345308 0)
(-0.0236947 0.339342 0)
(-0.0243707 0.329417 0)
(-0.0248539 0.315124 0)
(-0.0260826 0.295748 0)
(-0.0289215 0.271476 0)
(-0.0339159 0.240524 0)
(-0.0365931 0.203856 0)
(-0.0407989 0.159464 0)
(-0.0417608 0.108505 0)
(-0.0391355 0.0559065 0)
(-0.0249243 0.0160919 0)
(-0.0191158 -0.00458471 0)
(0.0271962 0.0132739 0)
(0.0388118 0.0474148 0)
(0.0511723 0.0970525 0)
(0.0526176 0.155366 0)
(0.0546686 0.207159 0)
(0.0434105 0.252406 0)
(0.0326913 0.288038 0)
(0.02461 0.313918 0)
(0.0160336 0.330564 0)
(0.0105512 0.342851 0)
(0.00533717 0.350832 0)
(0.00149174 0.356425 0)
(-0.00206141 0.360232 0)
(-0.00521387 0.362991 0)
(-0.00804065 0.364977 0)
(-0.0108256 0.36609 0)
(-0.0135268 0.366272 0)
(-0.0156095 0.365364 0)
(-0.0170934 0.362544 0)
(-0.0181935 0.357008 0)
(-0.0197796 0.348165 0)
(-0.0212809 0.334192 0)
(-0.026007 0.315304 0)
(-0.0317525 0.286943 0)
(-0.040637 0.249778 0)
(-0.0501888 0.204009 0)
(-0.0483596 0.151954 0)
(-0.0482286 0.0931282 0)
(-0.0367085 0.0435285 0)
(-0.0258751 0.010262 0)
(0.0325239 0.0330949 0)
(0.0487623 0.078541 0)
(0.0571375 0.13458 0)
(0.0548519 0.189619 0)
(0.0479346 0.244973 0)
(0.0278255 0.292235 0)
(0.0120367 0.322098 0)
(0.0044205 0.341793 0)
(-0.00306354 0.352205 0)
(-0.0058976 0.360033 0)
(-0.00831396 0.364653 0)
(-0.00917255 0.367949 0)
(-0.0095081 0.370201 0)
(-0.00934004 0.372015 0)
(-0.0090845 0.37359 0)
(-0.00855413 0.37494 0)
(-0.00810273 0.375825 0)
(-0.00722553 0.376081 0)
(-0.00634671 0.375474 0)
(-0.00558443 0.373476 0)
(-0.00579709 0.369652 0)
(-0.00598096 0.361832 0)
(-0.0105942 0.350301 0)
(-0.0158109 0.328129 0)
(-0.0299177 0.295398 0)
(-0.0475962 0.246654 0)
(-0.0542466 0.190236 0)
(-0.0571062 0.13283 0)
(-0.049714 0.0748492 0)
(-0.0332764 0.0297406 0)
(0.043483 0.0479416 0)
(0.0616602 0.109233 0)
(0.0566339 0.165599 0)
(0.04335 0.222427 0)
(0.0163676 0.283387 0)
(-0.00401262 0.325295 0)
(-0.0178603 0.344154 0)
(-0.0219336 0.356884 0)
(-0.0245201 0.362914 0)
(-0.0239558 0.367554 0)
(-0.0225104 0.370325 0)
(-0.0200438 0.372245 0)
(-0.0170058 0.373602 0)
(-0.0135088 0.374768 0)
(-0.0100398 0.375581 0)
(-0.00621216 0.377044 0)
(-0.00260565 0.378505 0)
(0.00149895 0.379366 0)
(0.00548235 0.379955 0)
(0.0091705 0.379916 0)
(0.0121473 0.378808 0)
(0.0145934 0.375382 0)
(0.0137124 0.369826 0)
(0.0112243 0.356074 0)
(-0.00230697 0.333925 0)
(-0.0222376 0.289614 0)
(-0.0476343 0.227628 0)
(-0.0604343 0.169015 0)
(-0.0646873 0.107844 0)
(-0.0462633 0.0456393 0)
(0.0613363 0.0566887 0)
(0.0595813 0.145207 0)
(0.0413574 0.20692 0)
(0.00133719 0.275511 0)
(-0.0291911 0.321866 0)
(-0.0424724 0.348014 0)
(-0.0485735 0.356338 0)
(-0.0477968 0.362578 0)
(-0.0450132 0.365876 0)
(-0.0408486 0.368452 0)
(-0.0358554 0.370081 0)
(-0.0302217 0.371118 0)
(-0.0240607 0.371948 0)
(-0.0175064 0.37273 0)
(-0.010711 0.373745 0)
(-0.00410576 0.375065 0)
(0.00309078 0.37616 0)
(0.0102463 0.37736 0)
(0.0171995 0.378598 0)
(0.0237217 0.379668 0)
(0.0297419 0.379998 0)
(0.0350971 0.379089 0)
(0.0389184 0.377054 0)
(0.0406067 0.370771 0)
(0.033913 0.360481 0)
(0.0193609 0.331121 0)
(-0.0114502 0.281793 0)
(-0.0483637 0.212209 0)
(-0.0668537 0.147044 0)
(-0.0633298 0.057004 0)
(0.0339076 0.0741007 0)
(0.015294 0.17147 0)
(-0.00340412 0.250227 0)
(-0.0486628 0.314601 0)
(-0.0700557 0.346055 0)
(-0.0781285 0.356489 0)
(-0.0756544 0.359001 0)
(-0.0700132 0.361701 0)
(-0.0628689 0.363851 0)
(-0.0553296 0.365434 0)
(-0.0473577 0.366258 0)
(-0.038976 0.366536 0)
(-0.0301492 0.366624 0)
(-0.0209008 0.366845 0)
(-0.0112335 0.367642 0)
(-0.00141907 0.368585 0)
(0.00863426 0.369913 0)
(0.0184155 0.371766 0)
(0.027839 0.373858 0)
(0.036815 0.375808 0)
(0.0453913 0.37706 0)
(0.0535674 0.377283 0)
(0.0613069 0.376653 0)
(0.06742 0.374789 0)
(0.0692835 0.371479 0)
(0.0601703 0.358146 0)
(0.037769 0.323332 0)
(-0.00646226 0.256551 0)
(-0.0257095 0.177178 0)
(-0.0465611 0.0776495 0)
(-0.00544585 0.0743541 0)
(-0.0457284 0.1842 0)
(-0.0733215 0.275515 0)
(-0.0982228 0.332301 0)
(-0.11081 0.35251 0)
(-0.110407 0.351223 0)
(-0.0996539 0.350408 0)
(-0.0891102 0.352667 0)
(-0.0784078 0.355354 0)
(-0.0677971 0.357293 0)
(-0.0571011 0.35815 0)
(-0.0462096 0.358152 0)
(-0.0350101 0.357523 0)
(-0.0233612 0.356976 0)
(-0.0112337 0.3571 0)
(0.00118111 0.357849 0)
(0.0135505 0.359782 0)
(0.0255534 0.362418 0)
(0.037172 0.36517 0)
(0.0484664 0.367509 0)
(0.0594965 0.368876 0)
(0.0704001 0.368872 0)
(0.0814375 0.367728 0)
(0.0923303 0.366573 0)
(0.102901 0.36746 0)
(0.101999 0.366404 0)
(0.0889079 0.343188 0)
(0.060936 0.282974 0)
(0.0333897 0.189832 0)
(-0.000232275 0.0750571 0)
(-0.0495847 0.0888759 0)
(-0.119674 0.218858 0)
(-0.159631 0.301071 0)
(-0.15507 0.339959 0)
(-0.148139 0.349647 0)
(-0.134462 0.346133 0)
(-0.118617 0.343657 0)
(-0.104055 0.344111 0)
(-0.0906505 0.345387 0)
(-0.0775728 0.346398 0)
(-0.0645706 0.3466 0)
(-0.0515024 0.346017 0)
(-0.0382489 0.344895 0)
(-0.0247038 0.343755 0)
(-0.0107919 0.34325 0)
(0.00332177 0.344048 0)
(0.0173138 0.346387 0)
(0.0310446 0.349546 0)
(0.0445529 0.352796 0)
(0.0578973 0.355686 0)
(0.0710947 0.357741 0)
(0.0842713 0.358546 0)
(0.0977934 0.358374 0)
(0.112606 0.358456 0)
(0.128713 0.361986 0)
(0.141519 0.365099 0)
(0.147113 0.354722 0)
(0.145848 0.31172 0)
(0.106464 0.22536 0)
(0.0479501 0.0899234 0)
(-0.168907 0.0905456 0)
(-0.182505 0.147745 0)
(-0.217634 0.250974 0)
(-0.17697 0.299787 0)
(-0.162637 0.318932 0)
(-0.13998 0.322851 0)
(-0.126412 0.329098 0)
(-0.11137 0.334324 0)
(-0.0975149 0.337841 0)
(-0.0831263 0.339521 0)
(-0.068597 0.339653 0)
(-0.0540118 0.338738 0)
(-0.0394416 0.33733 0)
(-0.0248313 0.33596 0)
(-0.0101245 0.335325 0)
(0.00462644 0.336265 0)
(0.0192967 0.338742 0)
(0.0339266 0.34204 0)
(0.0486245 0.345547 0)
(0.0634133 0.348695 0)
(0.0781532 0.350799 0)
(0.0926366 0.351083 0)
(0.106739 0.349217 0)
(0.121727 0.345452 0)
(0.136495 0.34173 0)
(0.159008 0.339821 0)
(0.175498 0.32262 0)
(0.21798 0.276245 0)
(0.18456 0.183758 0)
(0.170389 0.100924 0)
(-0.159382 -0.0035913 0)
(-0.178154 -0.038598 0)
(-0.198969 0.0397718 0)
(-0.162182 0.0883063 0)
(-0.155482 0.142015 0)
(-0.133907 0.170761 0)
(-0.12606 0.217928 0)
(-0.111889 0.247286 0)
(-0.0989957 0.269935 0)
(-0.0842423 0.282268 0)
(-0.0693069 0.289217 0)
(-0.054227 0.29199 0)
(-0.0392797 0.292306 0)
(-0.024346 0.291533 0)
(-0.00944199 0.291305 0)
(0.0054542 0.292533 0)
(0.0202867 0.295146 0)
(0.0351489 0.298699 0)
(0.0501578 0.301267 0)
(0.0653669 0.301464 0)
(0.080543 0.297897 0)
(0.095108 0.289072 0)
(0.108334 0.271767 0)
(0.122632 0.247346 0)
(0.132594 0.204827 0)
(0.156537 0.180416 0)
(0.165106 0.125178 0)
(0.205356 0.0786845 0)
(0.183669 -0.00368211 0)
(0.166866 0.016633 0)
(-0.119969 -0.0619782 0)
(-0.154492 -0.102331 0)
(-0.167686 -0.0812242 0)
(-0.143338 -0.0594808 0)
(-0.138126 -0.0260334 0)
(-0.119689 -0.00934182 0)
(-0.114101 0.0270496 0)
(-0.101965 0.0478693 0)
(-0.0912485 0.0717502 0)
(-0.0781098 0.0879418 0)
(-0.0646076 0.0991908 0)
(-0.050687 0.104588 0)
(-0.0366368 0.105842 0)
(-0.0223807 0.104973 0)
(-0.00815719 0.104748 0)
(0.00616777 0.106062 0)
(0.0205864 0.109119 0)
(0.0348809 0.114105 0)
(0.0488539 0.11672 0)
(0.0627274 0.11454 0)
(0.0764459 0.106347 0)
(0.0893145 0.0920602 0)
(0.100519 0.0695571 0)
(0.112419 0.0467588 0)
(0.119704 0.0108919 0)
(0.140792 -0.00356205 0)
(0.147448 -0.0379683 0)
(0.175626 -0.0612302 0)
(0.162432 -0.0892142 0)
(0.130995 -0.0525567 0)
(-0.0601066 -0.0488539 0)
(-0.111784 -0.0907236 0)
(-0.126803 -0.097993 0)
(-0.122838 -0.096569 0)
(-0.120861 -0.0844732 0)
(-0.10834 -0.0785456 0)
(-0.103248 -0.0581452 0)
(-0.0929968 -0.0473747 0)
(-0.0832743 -0.0360637 0)
(-0.0714099 -0.0295736 0)
(-0.0591456 -0.0259589 0)
(-0.0464515 -0.0259248 0)
(-0.0335047 -0.0283023 0)
(-0.0202644 -0.0312171 0)
(-0.00706593 -0.0324624 0)
(0.00627557 -0.0315844 0)
(0.019833 -0.0282872 0)
(0.0331819 -0.0221356 0)
(0.0459212 -0.0166811 0)
(0.058393 -0.0145521 0)
(0.0707334 -0.016677 0)
(0.0823396 -0.0228711 0)
(0.0925079 -0.0344335 0)
(0.102718 -0.0468613 0)
(0.109238 -0.0685885 0)
(0.124747 -0.0735013 0)
(0.128765 -0.0869797 0)
(0.137717 -0.0904763 0)
(0.122285 -0.0875065 0)
(0.0709895 -0.0477055 0)
(-0.0213588 -0.0300118 0)
(-0.0586754 -0.0614096 0)
(-0.0790949 -0.0781385 0)
(-0.0890542 -0.085421 0)
(-0.0929662 -0.0855028 0)
(-0.0913624 -0.0841557 0)
(-0.0888785 -0.0770611 0)
(-0.082529 -0.0720689 0)
(-0.0747009 -0.0675299 0)
(-0.0648347 -0.0656224 0)
(-0.0540319 -0.0657261 0)
(-0.0425744 -0.0680006 0)
(-0.0307132 -0.0715868 0)
(-0.0185344 -0.0750081 0)
(-0.00631277 -0.0766251 0)
(0.00603574 -0.0760208 0)
(0.0185258 -0.0729684 0)
(0.0308237 -0.0673764 0)
(0.0425808 -0.0616306 0)
(0.0539383 -0.057881 0)
(0.0648752 -0.0569765 0)
(0.0748354 -0.058992 0)
(0.0831899 -0.0642777 0)
(0.0902022 -0.0706082 0)
(0.0941026 -0.0790856 0)
(0.0980177 -0.0803831 0)
(0.0956348 -0.0809127 0)
(0.086509 -0.0744464 0)
(0.0650945 -0.0593429 0)
(0.0255372 -0.0298362 0)
(-0.00932861 -0.0198742 0)
(-0.0333422 -0.0459466 0)
(-0.0509018 -0.0635919 0)
(-0.0624844 -0.0738772 0)
(-0.0691543 -0.0782349 0)
(-0.0717432 -0.0790081 0)
(-0.0715177 -0.0764108 0)
(-0.0682318 -0.073508 0)
(-0.062705 -0.0709099 0)
(-0.0552326 -0.0696521 0)
(-0.0464469 -0.0698014 0)
(-0.0367768 -0.0712745 0)
(-0.0265771 -0.0734955 0)
(-0.0160834 -0.0755557 0)
(-0.00547875 -0.0765334 0)
(0.00526795 -0.0759478 0)
(0.0159673 -0.0736839 0)
(0.0265557 -0.0700896 0)
(0.0368412 -0.0663746 0)
(0.0466445 -0.0637611 0)
(0.0556747 -0.062932 0)
(0.063469 -0.0640804 0)
(0.0695006 -0.0670722 0)
(0.0734325 -0.0707765 0)
(0.0745304 -0.0742613 0)
(0.0729793 -0.0740414 0)
(0.0670013 -0.070411 0)
(0.0555279 -0.0609979 0)
(0.0370845 -0.0445331 0)
(0.0110842 -0.0198272 0)
(-0.0047856 -0.0141745 0)
(-0.0200167 -0.0359604 0)
(-0.0334769 -0.0526502 0)
(-0.0440263 -0.0640148 0)
(-0.0513476 -0.070659 0)
(-0.0555678 -0.0737498 0)
(-0.0569755 -0.0741102 0)
(-0.0556411 -0.0733435 0)
(-0.0519767 -0.072343 0)
(-0.046375 -0.0718614 0)
(-0.0393447 -0.0721525 0)
(-0.0313354 -0.0731869 0)
(-0.0227272 -0.0746107 0)
(-0.0137936 -0.0758586 0)
(-0.0047079 -0.0763612 0)
(0.00445422 -0.0757973 0)
(0.0135934 -0.0741261 0)
(0.0226257 -0.0716467 0)
(0.03139 -0.0690763 0)
(0.0396301 -0.0671566 0)
(0.0469814 -0.0663404 0)
(0.0529854 -0.0667162 0)
(0.057139 -0.067999 0)
(0.0590103 -0.0693449 0)
(0.0581552 -0.0696728 0)
(0.0544314 -0.0672032 0)
(0.047351 -0.0612432 0)
(0.0366173 -0.0506419 0)
(0.0223806 -0.0348445 0)
(0.00571272 -0.0140175 0)
(-0.00264974 -0.0109404 0)
(-0.0123857 -0.0293912 0)
(-0.0222309 -0.0446713 0)
(-0.0309262 -0.0562028 0)
(-0.0377351 -0.0640903 0)
(-0.0423451 -0.0688905 0)
(-0.0446388 -0.0712719 0)
(-0.0445903 -0.0722059 0)
(-0.04239 -0.0724782 0)
(-0.0383476 -0.0727151 0)
(-0.0328748 -0.0732355 0)
(-0.026386 -0.0740912 0)
(-0.0192463 -0.0750884 0)
(-0.0117327 -0.0758833 0)
(-0.00402955 -0.0761259 0)
(0.00374959 -0.0756072 0)
(0.0115069 -0.0743207 0)
(0.0191364 -0.0724935 0)
(0.0264664 -0.0705663 0)
(0.033226 -0.0689942 0)
(0.0390474 -0.0680494 0)
(0.0434982 -0.0677217 0)
(0.0461368 -0.0676732 0)
(0.0466042 -0.0672034 0)
(0.0446587 -0.0654047 0)
(0.0402707 -0.0612014 0)
(0.0334712 -0.0539369 0)
(0.0244861 -0.0430627 0)
(0.0139906 -0.0284868 0)
(0.00323894 -0.0107511 0)
(-0.00143295 -0.00895213 0)
(-0.00766916 -0.0248801 0)
(-0.0146904 -0.0387737 0)
(-0.0214915 -0.050036 0)
(-0.0273135 -0.0585374 0)
(-0.0316833 -0.064499 0)
(-0.0343098 -0.0683406 0)
(-0.0350476 -0.0706667 0)
(-0.0339313 -0.0720717 0)
(-0.0311509 -0.0730626 0)
(-0.0270161 -0.0739588 0)
(-0.0218785 -0.0748704 0)
(-0.0160668 -0.0757195 0)
(-0.00984476 -0.0763122 0)
(-0.00340212 -0.0764409 0)
(0.00312719 -0.07598 0)
(0.00962951 -0.0749383 0)
(0.0159781 -0.0734738 0)
(0.0219916 -0.0718589 0)
(0.0274069 -0.0703629 0)
(0.0318843 -0.0691242 0)
(0.0350451 -0.0680626 0)
(0.0365369 -0.0668442 0)
(0.0361177 -0.0649017 0)
(0.0337065 -0.0615528 0)
(0.0294131 -0.0561193 0)
(0.0234919 -0.0481612 0)
(0.0163817 -0.0374548 0)
(0.00882571 -0.0241303 0)
(0.00184864 -0.00876564 0)
(-0.00066565 -0.00764582 0)
(-0.00459646 -0.0216868 0)
(-0.00949769 -0.0343698 0)
(-0.014635 -0.0451876 0)
(-0.0193618 -0.0539286 0)
(-0.023199 -0.0606332 0)
(-0.0258035 -0.065522 0)
(-0.0269602 -0.0689556 0)
(-0.0265999 -0.0713434 0)
(-0.0248039 -0.073072 0)
(-0.021782 -0.074426 0)
(-0.0178125 -0.0755456 0)
(-0.0131773 -0.0764293 0)
(-0.0081174 -0.0769839 0)
(-0.00281939 -0.0770951 0)
(0.00257288 -0.0766937 0)
(0.00793258 -0.0757943 0)
(0.0131204 -0.0745025 0)
(0.0179539 -0.072983 0)
(0.0221893 -0.0713855 0)
(0.0255291 -0.0697571 0)
(0.0276629 -0.0679797 0)
(0.0283349 -0.0657534 0)
(0.0274157 -0.0626409 0)
(0.024939 -0.0581647 0)
(0.0211004 -0.0519091 0)
(0.0162311 -0.0436285 0)
(0.0108025 -0.0332753 0)
(0.00546486 -0.0210586 0)
(0.000975467 -0.00747564 0)
(-0.000168504 -0.00674643 0)
(-0.00254518 -0.0193775 0)
(-0.0058807 -0.0310538 0)
(-0.0096517 -0.0413825 0)
(-0.0133484 -0.0501473 0)
(-0.0165508 -0.0573007 0)
(-0.0189287 -0.0629317 0)
(-0.0202456 -0.0672348 0)
(-0.0203749 -0.0704651 0)
(-0.0193161 -0.0728928 0)
(-0.0171913 -0.0747471 0)
(-0.0142056 -0.076171 0)
(-0.0105906 -0.0772084 0)
(-0.00655882 -0.0778312 0)
(-0.00228633 -0.0779862 0)
(0.00208208 -0.0776413 0)
(0.00641431 -0.0768128 0)
(0.010568 -0.0755686 0)
(0.0143686 -0.074004 0)
(0.0175981 -0.0721913 0)
(0.0200069 -0.0701218 0)
(0.0213556 -0.0676661 0)
(0.0214778 -0.0645777 0)
(0.0203337 -0.0605417 0)
(0.0180257 -0.0552503 0)
(0.0147822 -0.0484679 0)
(0.0109337 -0.0400846 0)
(0.00690425 -0.0301403 0)
(0.00321389 -0.0188484 0)
(0.0004061 -0.00659603 0)
(0.000142362 -0.0061127 0)
(-0.0011849 -0.0176916 0)
(-0.00338185 -0.0285524 0)
(-0.00607607 -0.0384113 0)
(-0.00887994 -0.0470818 0)
(-0.0114508 -0.0544834 0)
(-0.0135007 -0.060629 0)
(-0.014805 -0.0656048 0)
(-0.015216 -0.069548 0)
(-0.0146816 -0.0726234 0)
(-0.013255 -0.0749928 0)
(-0.0110754 -0.0767793 0)
(-0.00832401 -0.0780463 0)
(-0.00518214 -0.0788051 0)
(-0.0018096 -0.0790421 0)
(0.0016552 -0.078749 0)
(0.0050829 -0.077942 0)
(0.00833629 -0.0766633 0)
(0.0112552 -0.074963 0)
(0.0136512 -0.0728653 0)
(0.0153234 -0.0703326 0)
(0.016099 -0.0672471 0)
(0.0158852 -0.0634266 0)
(0.0147029 -0.058668 0)
(0.0126853 -0.052795 0)
(0.0100559 -0.0456924 0)
(0.0071081 -0.0373323 0)
(0.00419252 -0.0277887 0)
(0.00170799 -0.0172451 0)
(4.29982e-05 -0.00598173 0)
(0.00031636 -0.00566533 0)
(-0.000319897 -0.0164645 0)
(-0.00170869 -0.0266793 0)
(-0.00358379 -0.0361188 0)
(-0.00565591 -0.0446384 0)
(-0.00765608 -0.0521553 0)
(-0.00934738 -0.0586451 0)
(-0.0105338 -0.0641294 0)
(-0.0110712 -0.068663 0)
(-0.0108832 -0.0723239 0)
(-0.00997594 -0.0752024 0)
(-0.00843406 -0.0773836 0)
(-0.00639223 -0.0789281 0)
(-0.00399919 -0.0798665 0)
(-0.00139486 -0.0802089 0)
(0.00129427 -0.0799623 0)
(0.00394782 -0.0791425 0)
(0.00643974 -0.0777745 0)
(0.00862851 -0.0758799 0)
(0.010357 -0.0734565 0)
(0.0114704 -0.0704596 0)
(0.0118527 -0.0668011 0)
(0.0114654 -0.0623688 0)
(0.0103625 -0.0570546 0)
(0.00868052 -0.0507769 0)
(0.00661756 -0.0434954 0)
(0.00441714 -0.0352243 0)
(0.00235651 -0.0260415 0)
(0.00073482 -0.0160885 0)
(-0.000169317 -0.00555241 0)
(0.000389748 -0.00535449 0)
(0.000183682 -0.015585 0)
(-0.00065178 -0.0253008 0)
(-0.00192627 -0.0343861 0)
(-0.00342631 -0.0427389 0)
(-0.00494548 -0.0502883 0)
(-0.00629506 -0.0569965 0)
(-0.00731257 -0.0628515 0)
(-0.00787029 -0.0678572 0)
(-0.00788742 -0.0720283 0)
(-0.00734375 -0.0753899 0)
(-0.00628396 -0.0779775 0)
(-0.00480266 -0.0798292 0)
(-0.00301724 -0.080976 0)
(-0.00104585 -0.0814391 0)
(0.00100056 -0.0812338 0)
(0.00301484 -0.0803759 0)
(0.00488587 -0.07888 0)
(0.00649291 -0.076753 0)
(0.00770923 -0.0739839 0)
(0.00842069 -0.0705405 0)
(0.00855568 -0.0663774 0)
(0.00810941 -0.0614495 0)
(0.00714786 -0.0557213 0)
(0.0057948 -0.0491727 0)
(0.00421566 -0.0418047 0)
(0.00260507 -0.0336485 0)
(0.00117656 -0.0247706 0)
(0.000151507 -0.0152699 0)
(-0.000270402 -0.00525822 0)
(0.000393386 -0.00514483 0)
(0.000430351 -0.0149703 0)
(-4.3893e-05 -0.0243128 0)
(-0.000894502 -0.0331147 0)
(-0.00196568 -0.041311 0)
(-0.00310128 -0.0488477 0)
(-0.00415379 -0.0556862 0)
(-0.00499216 -0.0617996 0)
(-0.00550902 -0.067165 0)
(-0.00562976 -0.0717579 0)
(-0.00532328 -0.0755543 0)
(-0.00460872 -0.0785394 0)
(-0.00354963 -0.0807134 0)
(-0.00223572 -0.0820892 0)
(-0.000763625 -0.0826841 0)
(0.00077269 -0.0825154 0)
(0.00228147 -0.0815986 0)
(0.00366805 -0.0799458 0)
(0.00483231 -0.0775624 0)
(0.00567483 -0.0744467 0)
(0.00611442 -0.0705952 0)
(0.00611022 -0.0660097 0)
(0.00567509 -0.060699 0)
(0.00487371 -0.0546753 0)
(0.00381126 -0.0479534 0)
(0.00262134 -0.040554 0)
(0.00145617 -0.0325113 0)
(0.000477461 -0.0238757 0)
(-0.000153016 -0.0147088 0)
(-0.000293664 -0.00506399 0)
(0.000354346 -0.00500892 0)
(0.000506648 -0.0145544 0)
(0.000255042 -0.0236282 0)
(-0.00030695 -0.0322152 0)
(-0.00106726 -0.0402804 0)
(-0.00190927 -0.0477858 0)
(-0.00271917 -0.0546974 0)
(-0.00339294 -0.0609835 0)
(-0.00384268 -0.066609 0)
(-0.00400367 -0.0715299 0)
(-0.00384247 -0.0756928 0)
(-0.00336336 -0.0790433 0)
(-0.00260758 -0.0815386 0)
(-0.00164238 -0.0831561 0)
(-0.00054554 -0.083892 0)
(0.000605071 -0.0837553 0)
(0.00173276 -0.0827619 0)
(0.00275848 -0.0809305 0)
(0.00360041 -0.0782815 0)
(0.00418191 -0.0748397 0)
(0.00444674 -0.070639 0)
(0.00437391 -0.0657213 0)
(0.00398375 -0.0601306 0)
(0.00333406 -0.0539052 0)
(0.0025112 -0.0470766 0)
(0.00162101 -0.0396735 0)
(0.000780749 -0.0317271 0)
(0.000111189 -0.023272 0)
(-0.000271322 -0.0143403 0)
(-0.000268613 -0.00494225 0)
(0.00029478 -0.00492488 0)
(0.000482252 -0.0142834 0)
(0.000358988 -0.0231718 0)
(-1.21247e-05 -0.0316048 0)
(-0.000551973 -0.0395693 0)
(-0.00117464 -0.0470412 0)
(-0.00179344 -0.0539921 0)
(-0.00232692 -0.0603902 0)
(-0.00270433 -0.066196 0)
(-0.00287127 -0.0713577 0)
(-0.00279565 -0.0758091 0)
(-0.00247307 -0.0794722 0)
(-0.00192854 -0.0822675 0)
(-0.00121149 -0.0841278 0)
(-0.000384484 -0.0850102 0)
(0.000487494 -0.0849015 0)
(0.00133997 -0.0838177 0)
(0.00210648 -0.0817969 0)
(0.00272027 -0.0788918 0)
(0.0031234 -0.0751653 0)
(0.00327862 -0.070686 0)
(0.00317779 -0.0655227 0)
(0.00284352 -0.0597369 0)
(0.00232516 -0.0533784 0)
(0.00169211 -0.0464854 0)
(0.00102692 -0.0390888 0)
(0.000418653 -0.0312149 0)
(-4.38448e-05 -0.0228855 0)
(-0.000278556 -0.0141105 0)
(-0.000219594 -0.00487092 0)
(0.000230616 -0.00487571 0)
(0.000408665 -0.0141139 0)
(0.000353658 -0.0228804 0)
(0.000106304 -0.0312091 0)
(-0.000278743 -0.0391022 0)
(-0.000739157 -0.0465461 0)
(-0.00120984 -0.053518 0)
(-0.0016279 -0.0599876 0)
(-0.00193728 -0.0659149 0)
(-0.00209321 -0.0712466 0)
(-0.00206658 -0.0759127 0)
(-0.00184787 -0.079825 0)
(-0.00144987 -0.0828798 0)
(-0.00090704 -0.0849677 0)
(-0.000269535 -0.0859942 0)
(0.0004066 -0.0859099 0)
(0.00106475 -0.0847298 0)
(0.00164733 -0.0825246 0)
(0.00210015 -0.0793923 0)
(0.00238131 -0.0754348 0)
(0.00246835 -0.0707466 0)
(0.00236146 -0.0654099 0)
(0.0020829 -0.0594926 0)
(0.00167358 -0.0530478 0)
(0.00118824 -0.0461158 0)
(0.00069028 -0.0387265 0)
(0.0002463 -0.0309017 0)
(-7.94415e-05 -0.0226533 0)
(-0.000230432 -0.0139762 0)
(-0.000164151 -0.00483278 0)
(0.000171508 -0.00484894 0)
(0.000319811 -0.0140131 0)
(0.000297396 -0.0227036 0)
(0.000129508 -0.0309659 0)
(-0.000146957 -0.0388122 0)
(-0.000487527 -0.0462364 0)
(-0.000844028 -0.0532202 0)
(-0.0011686 -0.0597355 0)
(-0.00141751 -0.0657435 0)
(-0.00155457 -0.0711921 0)
(-0.00155432 -0.0760119 0)
(-0.00140474 -0.080112 0)
(-0.00110976 -0.0833754 0)
(-0.000691205 -0.0856597 0)
(-0.000188329 -0.0868179 0)
(0.000349018 -0.0867545 0)
(0.000868388 -0.0854825 0)
(0.00131847 -0.083114 0)
(0.00165626 -0.0797957 0)
(0.00185359 -0.0756624 0)
(0.00189908 -0.0708242 0)
(0.00179792 -0.0653686 0)
(0.00157053 -0.0593642 0)
(0.00125004 -0.0528638 0)
(0.000878954 -0.045907 0)
(0.000505152 -0.038522 0)
(0.000177646 -0.0307265 0)
(-5.79083e-05 -0.0225255 0)
(-0.000163501 -0.0139047 0)
(-0.000112854 -0.00481527 0)
(0.000122029 -0.00483598 0)
(0.000235149 -0.0139571 0)
(0.000225865 -0.0226033 0)
(0.000109095 -0.0308266 0)
(-9.08232e-05 -0.0386452 0)
(-0.000342678 -0.0460577 0)
(-0.000611334 -0.0530494 0)
(-0.00086089 -0.0595944 0)
(-0.00105767 -0.065656 0)
(-0.0011729 -0.0711839 0)
(-0.00118492 -0.076111 0)
(-0.0010811 -0.0803468 0)
(-0.000859686 -0.0837678 0)
(-0.000532794 -0.0862089 0)
(-0.000129932 -0.0874776 0)
(0.00030435 -0.0874315 0)
(0.000720291 -0.0860812 0)
(0.00107195 -0.0835804 0)
(0.00132636 -0.0801201 0)
(0.00146621 -0.0758591 0)
(0.0014876 -0.0709165 0)
(0.00139819 -0.0653807 0)
(0.00121587 -0.0593189 0)
(0.000967 -0.0527821 0)
(0.000684058 -0.0458082 0)
(0.000402683 -0.0384234 0)
(0.000158365 -0.0306421 0)
(-1.70237e-05 -0.0224651 0)
(-9.8522e-05 -0.0138725 0)
(-7.06382e-05 -0.00480985 0)
(8.3379e-05 -0.00483117 0)
(0.000163935 -0.0139293 0)
(0.000158388 -0.0225525 0)
(7.50669e-05 -0.0307555 0)
(-7.03398e-05 -0.0385601 0)
(-0.000256267 -0.0459675 0)
(-0.000457446 -0.0529657 0)
(-0.000647287 -0.0595309 0)
(-0.000800188 -0.0656282 0)
(-0.000893551 -0.0712096 0)
(-0.000909408 -0.0762102 0)
(-0.000835696 -0.0805411 0)
(-0.000667656 -0.0840756 0)
(-0.000410775 -0.0866338 0)
(-8.64581e-05 -0.0879882 0)
(0.000266273 -0.0879562 0)
(0.000600909 -0.0865451 0)
(0.00087707 -0.0839452 0)
(0.00107024 -0.0803822 0)
(0.00117077 -0.0760319 0)
(0.00117922 -0.0710179 0)
(0.001104 -0.0654284 0)
(0.000960236 -0.0593286 0)
(0.000768589 -0.0527674 0)
(0.000553556 -0.0457804 0)
(0.000341299 -0.038392 0)
(0.000157139 -0.0306146 0)
(2.29593e-05 -0.022446 0)
(-4.52246e-05 -0.0138638 0)
(-3.87552e-05 -0.00481106 0)
(5.49024e-05 -0.00483094 0)
(0.000109147 -0.0139187 0)
(0.000103825 -0.0225322 0)
(4.32452e-05 -0.0307273 0)
(-6.27095e-05 -0.0385269 0)
(-0.000199359 -0.0459343 0)
(-0.000348762 -0.0529388 0)
(-0.00049146 -0.0595184 0)
(-0.000608209 -0.0656398 0)
(-0.000681483 -0.0712571 0)
(-0.000696677 -0.0763075 0)
(-0.000643007 -0.0807034 0)
(-0.000514542 -0.0843167 0)
(-0.000312815 -0.0869579 0)
(-5.29992e-05 -0.0883747 0)
(0.000231788 -0.0883536 0)
(0.000499695 -0.086899 0)
(0.000716275 -0.0842293 0)
(0.000863644 -0.0805952 0)
(0.000937017 -0.0761841 0)
(0.000939197 -0.0711222 0)
(0.00087826 -0.0654971 0)
(0.000766658 -0.0593718 0)
(0.000620358 -0.0527933 0)
(0.00045762 -0.0457954 0)
(0.00029741 -0.0384008 0)
(0.000157551 -0.0306204 0)
(5.28379e-05 -0.0224507 0)
(-6.68195e-06 -0.0138682 0)
(-1.64902e-05 -0.00481556 0)
(3.51534e-05 -0.00483311 0)
(7.04057e-05 -0.0139181 0)
(6.50037e-05 -0.0225299 0)
(2.0912e-05 -0.0307244 0)
(-5.57986e-05 -0.0385251 0)
(-0.000155277 -0.0459357 0)
(-0.00026494 -0.0529467 0)
(-0.000370711 -0.0595371 0)
(-0.000458285 -0.0656751 0)
(-0.000514245 -0.0713165 0)
(-0.00052695 -0.0764001 0)
(-0.000487211 -0.0808394 0)
(-0.000389079 -0.0845057 0)
(-0.000232022 -0.0872033 0)
(-2.66732e-05 -0.0886632 0)
(0.000199811 -0.0886503 0)
(0.000411443 -0.0871667 0)
(0.000579801 -0.0844501 0)
(0.000691968 -0.0807687 0)
(0.000745959 -0.0763173 0)
(0.000745385 -0.0712239 0)
(0.000697416 -0.0655751 0)
(0.000612038 -0.0594325 0)
(0.000501421 -0.0528411 0)
(0.000379021 -0.0458335 0)
(0.000258422 -0.0384311 0)
(0.000152012 -0.0306439 0)
(6.96515e-05 -0.0224678 0)
(1.74959e-05 -0.0138794 0)
(-2.33401e-06 -0.00482139 0)
(2.25119e-05 -0.00483632 0)
(4.58391e-05 -0.0139227 0)
(4.16459e-05 -0.0225372 0)
(1.05909e-05 -0.0307354 0)
(-4.37123e-05 -0.0385404 0)
(-0.000114755 -0.0459562 0)
(-0.000193823 -0.0529735 0)
(-0.000270858 -0.0595724 0)
(-0.000335352 -0.0657222 0)
(-0.000377176 -0.0713796 0)
(-0.000387241 -0.0764851 0)
(-0.000358018 -0.0809528 0)
(-0.000284162 -0.0846538 0)
(-0.000164257 -0.0873884 0)
(-5.69079e-06 -0.088877 0)
(0.000170047 -0.08887 0)
(0.000333425 -0.087368 0)
(0.000461806 -0.0846213 0)
(0.000545922 -0.0809094 0)
(0.000585251 -0.0764321 0)
(0.000583385 -0.0713182 0)
(0.000546325 -0.0656538 0)
(0.000481887 -0.0594992 0)
(0.000399204 -0.0528981 0)
(0.000308068 -0.0458818 0)
(0.00021809 -0.038471 0)
(0.000137768 -0.0306751 0)
(7.35743e-05 -0.0224902 0)
(2.91744e-05 -0.0138931 0)
(5.36121e-06 -0.00482743 0)
(1.54863e-05 -0.00483978 0)
(3.31387e-05 -0.0139295 0)
(3.21158e-05 -0.0225488 0)
(1.23827e-05 -0.0307526 0)
(-2.40118e-05 -0.0385634 0)
(-7.28526e-05 -0.0459851 0)
(-0.000128199 -0.0530086 0)
(-0.000182964 -0.0596144 0)
(-0.00022954 -0.0657724 0)
(-0.000260407 -0.0714406 0)
(-0.000268623 -0.0765602 0)
(-0.000248234 -0.081046 0)
(-0.000194772 -0.084769 0)
(-0.000106603 -0.0875271 0)
(1.12231e-05 -0.0890341 0)
(0.000142384 -0.0890314 0)
(0.000263834 -0.0875182 0)
(0.000358251 -0.084753 0)
(0.000419069 -0.0810223 0)
(0.000446433 -0.0765288 0)
(0.000443486 -0.071402 0)
(0.000415019 -0.0657274 0)
(0.000366989 -0.0595643 0)
(0.000306126 -0.0529555 0)
(0.000239446 -0.0459316 0)
(0.000173651 -0.0385125 0)
(0.00011448 -0.0307076 0)
(6.61002e-05 -0.0225133 0)
(3.06019e-05 -0.0139069 0)
(8.0753e-06 -0.00483305 0)
(1.28305e-05 -0.00484299 0)
(3.00923e-05 -0.0139367 0)
(3.43831e-05 -0.0225612 0)
(2.53178e-05 -0.030771 0)
(3.95225e-06 -0.0385879 0)
(-2.70705e-05 -0.0460154 0)
(-6.37895e-05 -0.0530444 0)
(-0.000101305 -0.0596557 0)
(-0.000134219 -0.0658198 0)
(-0.000157057 -0.071495 0)
(-0.000164656 -0.0766234 0)
(-0.000152477 -0.0811204 0)
(-0.000116995 -0.0848569 0)
(-5.66953e-05 -0.0876294 0)
(2.50986e-05 -0.0891478 0)
(0.000116674 -0.089148 0)
(0.000201143 -0.0876285 0)
(0.000265948 -0.0848524 0)
(0.000306568 -0.0811106 0)
(0.000323374 -0.0766074 0)
(0.000318883 -0.0714728 0)
(0.000296742 -0.0657916 0)
(0.000261354 -0.0596227 0)
(0.000217564 -0.053008 0)
(0.000170297 -0.0459774 0)
(0.000124133 -0.0385508 0)
(8.28589e-05 -0.0307376 0)
(4.90768e-05 -0.0225345 0)
(2.38846e-05 -0.0139195 0)
(7.01515e-06 -0.00483791 0)
(1.35625e-05 -0.00484567 0)
(3.48075e-05 -0.0139429 0)
(4.65024e-05 -0.0225722 0)
(4.80929e-05 -0.0307874 0)
(3.99981e-05 -0.0386097 0)
(2.37774e-05 -0.0460424 0)
(1.97511e-06 -0.0530762 0)
(-2.21227e-05 -0.0596917 0)
(-4.4787e-05 -0.0658598 0)
(-6.21524e-05 -0.0715396 0)
(-7.05023e-05 -0.0766732 0)
(-6.65231e-05 -0.0811768 0)
(-4.75988e-05 -0.0849212 0)
(-1.2487e-05 -0.087702 0)
(3.68178e-05 -0.0892271 0)
(9.26843e-05 -0.0892292 0)
(0.000143913 -0.0877065 0)
(0.000182184 -0.0849245 0)
(0.000204565 -0.0811765 0)
(0.000211426 -0.076668 0)
(0.00020461 -0.0715289 0)
(0.000186747 -0.0658438 0)
(0.000160961 -0.0596709 0)
(0.000130626 -0.0530518 0)
(9.90933e-05 -0.0460159 0)
(6.93933e-05 -0.0385831 0)
(4.39322e-05 -0.0307628 0)
(2.42396e-05 -0.0225521 0)
(1.07805e-05 -0.0139298 0)
(3.10963e-06 -0.00484184 0)
(1.69377e-05 -0.00484764 0)
(4.57706e-05 -0.0139474 0)
(6.68183e-05 -0.0225803 0)
(7.94423e-05 -0.0307997 0)
(8.36421e-05 -0.0386264 0)
(8.02169e-05 -0.0460631 0)
(7.06884e-05 -0.0531004 0)
(5.71482e-05 -0.0597189 0)
(4.20566e-05 -0.0658897 0)
(2.80239e-05 -0.0715719 0)
(1.7593e-05 -0.0767084 0)
(1.30359e-05 -0.0812154 0)
(1.61394e-05 -0.0849638 0)
(2.78168e-05 -0.0877491 0)
(4.71417e-05 -0.0892779 0)
(7.01238e-05 -0.0892812 0)
(9.07862e-05 -0.087757 0)
(0.000104591 -0.0849722 0)
(0.000109892 -0.0812214 0)
(0.000106933 -0.0767104 0)
(9.6911e-05 -0.0715693 0)
(8.15714e-05 -0.0658822 0)
(6.29958e-05 -0.0597069 0)
(4.3411e-05 -0.0530847 0)
(2.49832e-05 -0.046045 0)
(9.60412e-06 -0.0386074 0)
(-1.30971e-06 -0.0307817 0)
(-6.97474e-06 -0.0225653 0)
(-7.3435e-06 -0.0139375 0)
(-2.95585e-06 -0.00484476 0)
(2.2406e-05 -0.00484879 0)
(6.18288e-05 -0.0139497 0)
(9.4024e-05 -0.0225846 0)
(0.000118303 -0.0308066 0)
(0.000134372 -0.0386361 0)
(0.000142484 -0.0460754 0)
(0.000143408 -0.0531148 0)
(0.000138341 -0.059735 0)
(0.000128774 -0.065907 0)
(0.000116332 -0.0715902 0)
(0.000102607 -0.0767276 0)
(8.8988e-05 -0.0812358 0)
(7.65189e-05 -0.0849858 0)
(6.57708e-05 -0.087773 0)
(5.67176e-05 -0.0893034 0)
(4.86773e-05 -0.0893074 0)
(4.05092e-05 -0.0877828 0)
(3.1108e-05 -0.0849973 0)
(1.99006e-05 -0.0812458 0)
(6.95096e-06 -0.0767344 0)
(-7.14976e-06 -0.0715929 0)
(-2.14169e-05 -0.0659053 0)
(-3.46173e-05 -0.0597292 0)
(-4.5424e-05 -0.0531054 0)
(-5.25734e-05 -0.0460634 0)
(-5.50196e-05 -0.0386228 0)
(-5.20693e-05 -0.0307935 0)
(-4.34756e-05 -0.0225734 0)
(-2.94828e-05 -0.0139421 0)
(-1.06946e-05 -0.00484663 0)
(2.9577e-05 -0.00484905 0)
(8.21379e-05 -0.0139493 0)
(0.000127146 -0.0225845 0)
(0.000163862 -0.0308072 0)
(0.000191776 -0.0386376 0)
(0.000210724 -0.0460778 0)
(0.000220908 -0.0531178 0)
(0.000222844 -0.0597382 0)
(0.000217272 -0.06591 0)
(0.000205035 -0.0715927 0)
(0.000186943 -0.0767296 0)
(0.000163631 -0.0812373 0)
(0.000135473 -0.0849871 0)
(0.000102701 -0.0877743 0)
(6.6086e-05 -0.089305 0)
(2.80293e-05 -0.0893093 0)
(-8.04554e-06 -0.0877851 0)
(-4.00541e-05 -0.0850002 0)
(-6.76338e-05 -0.0812496 0)
(-9.09359e-05 -0.0767393 0)
(-0.000109932 -0.0715988 0)
(-0.000124296 -0.0659121 0)
(-0.000133497 -0.0597365 0)
(-0.000136921 -0.0531128 0)
(-0.000134003 -0.0460702 0)
(-0.000124342 -0.0386284 0)
(-0.000107787 -0.0307977 0)
(-8.44984e-05 -0.0225761 0)
(-5.49398e-05 -0.0139436 0)
(-1.97764e-05 -0.00484742 0)
(3.81867e-05 -0.00484835 0)
(0.000106114 -0.0139461 0)
(0.000165503 -0.0225793 0)
(0.000215557 -0.0308007 0)
(0.000255581 -0.0386301 0)
(0.000285085 -0.0460692 0)
(0.000303822 -0.053108 0)
(0.000311774 -0.059727 0)
(0.000309086 -0.0658971 0)
(0.000295966 -0.071578 0)
(0.000272567 -0.0767129 0)
(0.000238864 -0.0812187 0)
(0.000194617 -0.0849668 0)
(0.000139723 -0.0877527 0)
(7.56898e-05 -0.0892825 0)
(7.88019e-06 -0.0892869 0)
(-5.58717e-05 -0.0877637 0)
(-0.000110433 -0.0849805 0)
(-0.000154591 -0.0812321 0)
(-0.000188738 -0.0767241 0)
(-0.000213376 -0.0715861 0)
(-0.000228769 -0.0659017 0)
(-0.000234974 -0.0597281 0)
(-0.00023196 -0.053106 0)
(-0.000219718 -0.0460646 0)
(-0.00019835 -0.0386238 0)
(-0.000168136 -0.0307938 0)
(-0.000129558 -0.0225731 0)
(-8.32647e-05 -0.0139417 0)
(-2.99905e-05 -0.00484712 0)
(4.80671e-05 -0.00484661 0)
(0.000133381 -0.0139397 0)
(0.000208664 -0.0225688 0)
(0.000273045 -0.0307865 0)
(0.00032567 -0.0386125 0)
(0.000365766 -0.0460485 0)
(0.000392721 -0.0530842 0)
(0.000406079 -0.0596999 0)
(0.000405493 -0.0658667 0)
(0.00039064 -0.0715442 0)
(0.000361104 -0.0766757 0)
(0.000316262 -0.0811782 0)
(0.000255293 -0.0849232 0)
(0.00017776 -0.0877065 0)
(8.58853e-05 -0.0892346 0)
(-1.20465e-05 -0.0892389 0)
(-0.000103832 -0.0877173 0)
(-0.000181341 -0.0849369 0)
(-0.000242562 -0.0811917 0)
(-0.000288145 -0.0766874 0)
(-0.000319113 -0.0715532 0)
(-0.00033627 -0.0658727 0)
(-0.000340192 -0.0597028 0)
(-0.000331337 -0.0530841 0)
(-0.000310152 -0.0460461 0)
(-0.000277156 -0.0386084 0)
(-0.000232985 -0.0307816 0)
(-0.000178395 -0.0225641 0)
(-0.0001142 -0.0139363 0)
(-4.12157e-05 -0.00484569 0)
(5.91221e-05 -0.00484378 0)
(0.000163727 -0.0139298 0)
(0.000256396 -0.0225523 0)
(0.000336175 -0.0307639 0)
(0.000402058 -0.0385842 0)
(0.000453025 -0.0460147 0)
(0.000488143 -0.053045 0)
(0.00050658 -0.0596555 0)
(0.000507568 -0.065817 0)
(0.000490315 -0.0714893 0)
(0.000453893 -0.0766157 0)
(0.000397119 -0.0811133 0)
(0.000318602 -0.0848538 0)
(0.000217568 -0.0876331 0)
(9.69524e-05 -0.0891586 0)
(-3.1999e-05 -0.0891627 0)
(-0.000152664 -0.0876434 0)
(-0.000253893 -0.0848669 0)
(-0.000332889 -0.0811265 0)
(-0.000390585 -0.0766274 0)
(-0.000428526 -0.0714986 0)
(-0.000448034 -0.0658236 0)
(-0.000450159 -0.0596593 0)
(-0.00043579 -0.0530462 0)
(-0.000405772 -0.0460137 0)
(-0.000360982 -0.0385816 0)
(-0.000302366 -0.0307604 0)
(-0.000230926 -0.0225489 0)
(-0.000147635 -0.0139273 0)
(-5.33965e-05 -0.00484308 0)
(7.13083e-05 -0.00483975 0)
(0.000197056 -0.0139163 0)
(0.000308614 -0.0225296 0)
(0.000404938 -0.0307323 0)
(0.000484871 -0.0385442 0)
(0.000547166 -0.0459666 0)
(0.000590598 -0.0529891 0)
(0.000614 -0.0595918 0)
(0.000616217 -0.0657458 0)
(0.000596032 -0.0714108 0)
(0.00055203 -0.0765302 0)
(0.000482484 -0.0810211 0)
(0.000385429 -0.0847552 0)
(0.000259743 -0.087529 0)
(0.000109103 -0.0890508 0)
(-5.21926e-05 -0.0890546 0)
(-0.00020298 -0.0875385 0)
(-0.000329009 -0.0847674 0)
(-0.000426688 -0.0810335 0)
(-0.000497252 -0.0765414 0)
(-0.000542784 -0.07142 0)
(-0.000565122 -0.0657526 0)
(-0.000565768 -0.0595961 0)
(-0.000546014 -0.052991 0)
(-0.000507066 -0.0459665 0)
(-0.000450128 -0.0385426 0)
(-0.000376428 -0.0307299 0)
(-0.000287198 -0.022527 0)
(-0.000183562 -0.0139143 0)
(-6.65243e-05 -0.00483922 0)
(8.46191e-05 -0.00483443 0)
(0.000233359 -0.0138986 0)
(0.000365338 -0.0224998 0)
(0.00047942 -0.0306909 0)
(0.000574303 -0.0384914 0)
(0.000648516 -0.0459028 0)
(0.000700564 -0.0529145 0)
(0.000728959 -0.0595069 0)
(0.00073219 -0.0656508 0)
(0.000708626 -0.0713059 0)
(0.00065638 -0.0764158 0)
(0.000573173 -0.0808975 0)
(0.00045645 -0.084623 0)
(0.000304734 -0.0873894 0)
(0.000122487 -0.0889063 0)
(-7.28039e-05 -0.0889097 0)
(-0.000255265 -0.0873981 0)
(-0.000407421 -0.0846343 0)
(-0.000524849 -0.080909 0)
(-0.00060911 -0.0764263 0)
(-0.000662848 -0.0713147 0)
(-0.000688425 -0.0656574 0)
(-0.000687796 -0.0595113 0)
(-0.000662646 -0.0529169 0)
(-0.000614525 -0.0459033 0)
(-0.000544943 -0.0384905 0)
(-0.000455397 -0.0306891 0)
(-0.00034734 -0.0224979 0)
(-0.000222048 -0.0138971 0)
(-8.06222e-05 -0.00483403 0)
(9.90726e-05 -0.00482769 0)
(0.000272679 -0.0138766 0)
(0.000426651 -0.0224625 0)
(0.000559763 -0.0306386 0)
(0.000670571 -0.0384245 0)
(0.000757386 -0.0458216 0)
(0.000818448 -0.0528195 0)
(0.000851963 -0.0593982 0)
(0.000856067 -0.0655288 0)
(0.000828724 -0.071171 0)
(0.000767571 -0.0762683 0)
(0.000669761 -0.0807379 0)
(0.000532128 -0.084452 0)
(0.000352829 -0.0872084 0)
(0.000137189 -0.0887188 0)
(-9.39616e-05 -0.0887219 0)
(-0.000309859 -0.0872162 0)
(-0.000489652 -0.0844622 0)
(-0.000628029 -0.0807484 0)
(-0.000726885 -0.0762779 0)
(-0.000789456 -0.0711791 0)
(-0.000818652 -0.0655351 0)
(-0.000816889 -0.0594025 0)
(-0.000786243 -0.0528219 0)
(-0.000728605 -0.0458225 0)
(-0.000645783 -0.0384241 0)
(-0.000539535 -0.0306374 0)
(-0.000411535 -0.022461 0)
(-0.000263201 -0.0138754 0)
(-9.57335e-05 -0.00482738 0)
(0.000114701 -0.00481939 0)
(0.000315088 -0.0138496 0)
(0.000492665 -0.0224168 0)
(0.000646122 -0.0305743 0)
(0.000773878 -0.038342 0)
(0.000874031 -0.0457212 0)
(0.000944557 -0.0527014 0)
(0.00098336 -0.0592628 0)
(0.000988227 -0.0653764 0)
(0.000956714 -0.0710019 0)
(0.000885968 -0.0760829 0)
(0.000772556 -0.0805366 0)
(0.000612679 -0.0842356 0)
(0.000404145 -0.0869787 0)
(0.000153227 -0.0884805 0)
(-0.000115735 -0.0884832 0)
(-0.000366935 -0.0869857 0)
(-0.000575991 -0.0842447 0)
(-0.000736615 -0.080546 0)
(-0.000851035 -0.0760915 0)
(-0.000923103 -0.0710093 0)
(-0.0009563 -0.0653822 0)
(-0.000953522 -0.0592669 0)
(-0.00091724 -0.0527038 0)
(-0.000849687 -0.0457222 0)
(-0.000752968 -0.0383419 0)
(-0.000629101 -0.0305735 0)
(-0.000479974 -0.0224157 0)
(-0.000307147 -0.0138487 0)
(-0.000111911 -0.00481916 0)
(0.000131542 -0.00480937 0)
(0.000360663 -0.0138172 0)
(0.000563485 -0.0223618 0)
(0.000738621 -0.0304968 0)
(0.000884365 -0.0382421 0)
(0.000998601 -0.0455992 0)
(0.00107905 -0.0525575 0)
(0.0011233 -0.0590973 0)
(0.0011288 -0.0651894 0)
(0.00109269 -0.0707936 0)
(0.00101162 -0.0758536 0)
(0.000881546 -0.0802867 0)
(0.000698037 -0.083966 0)
(0.000458584 -0.0866916 0)
(0.000170538 -0.088182 0)
(-0.00013812 -0.0881844 0)
(-0.000426457 -0.0866977 0)
(-0.000666436 -0.0839739 0)
(-0.000850674 -0.080295 0)
(-0.000981697 -0.0758613 0)
(-0.00106398 -0.0708002 0)
(-0.00110161 -0.0651946 0)
(-0.00109796 -0.059101 0)
(-0.0010559 -0.0525598 0)
(-0.000978032 -0.0456003 0)
(-0.000866741 -0.0382422 0)
(-0.000724308 -0.0304962 0)
(-0.000552835 -0.0223609 0)
(-0.000354012 -0.0138165 0)
(-0.000129211 -0.00480919 0)
(0.000149631 -0.00479743 0)
(0.000409468 -0.0137788 0)
(0.000639182 -0.0222965 0)
(0.000837324 -0.0304046 0)
(0.00100207 -0.038123 0)
(0.0011311 -0.0454531 0)
(0.00122187 -0.0523846 0)
(0.00127167 -0.0588975 0)
(0.00127761 -0.0649628 0)
(0.0012364 -0.0705403 0)
(0.00114418 -0.0755735 0)
(0.000996329 -0.0799801 0)
(0.000787776 -0.0836337 0)
(0.00051579 -0.0863364 0)
(0.00018896 -0.0878119 0)
(-0.000161013 -0.087814 0)
(-0.000488133 -0.0863418 0)
(-0.000760633 -0.0836406 0)
(-0.00096988 -0.0799874 0)
(-0.00111862 -0.0755803 0)
(-0.00121193 -0.0705461 0)
(-0.00125449 -0.0649674 0)
(-0.00125018 -0.0589008 0)
(-0.00120229 -0.0523867 0)
(-0.00111374 -0.0454541 0)
(-0.000987227 -0.0381231 0)
(-0.000825294 -0.0304042 0)
(-0.000630247 -0.0222959 0)
(-0.000403898 -0.0137782 0)
(-0.000147683 -0.00479729 0)
(0.000168995 -0.00478337 0)
(0.000461534 -0.0137337 0)
(0.000719765 -0.0222198 0)
(0.00094219 -0.0302959 0)
(0.00112688 -0.0379821 0)
(0.00127132 -0.0452799 0)
(0.0013727 -0.0521788 0)
(0.00142805 -0.0586589 0)
(0.00143408 -0.0646911 0)
(0.00138714 -0.0702351 0)
(0.00128285 -0.0752346 0)
(0.00111602 -0.0796074 0)
(0.00088104 -0.0832278 0)
(0.000575094 -0.0859008 0)
(0.000208217 -0.087357 0)
(-0.000184196 -0.0873588 0)
(-0.000551354 -0.0859054 0)
(-0.00085779 -0.0832338 0)
(-0.00109342 -0.0796137 0)
(-0.00126106 -0.0752405 0)
(-0.00136633 -0.0702402 0)
(-0.00141447 -0.0646951 0)
(-0.00140985 -0.0586618 0)
(-0.00135617 -0.0521807 0)
(-0.00125668 -0.0452808 0)
(-0.00111439 -0.0379823 0)
(-0.000932083 -0.0302956 0)
(-0.00071227 -0.0222193 0)
(-0.000456868 -0.0137333 0)
(-0.000167367 -0.00478326 0)
(0.000189648 -0.00476695 0)
(0.000516844 -0.0136813 0)
(0.00080515 -0.0221304 0)
(0.00105304 -0.0301688 0)
(0.00125849 -0.037817 0)
(0.0014188 -0.0450762 0)
(0.00153093 -0.0519359 0)
(0.00159158 -0.0583761 0)
(0.00159719 -0.0643677 0)
(0.00154368 -0.0698703 0)
(0.00142625 -0.0748275 0)
(0.00123917 -0.0791574 0)
(0.000976451 -0.0827354 0)
(0.000635452 -0.0853704 0)
(0.000227894 -0.0868017 0)
(-0.00020731 -0.0868032 0)
(-0.000615133 -0.0853743 0)
(-0.000956591 -0.0827406 0)
(-0.00121991 -0.0791628 0)
(-0.00140771 -0.0748326 0)
(-0.00152603 -0.0698747 0)
(-0.00158059 -0.0643712 0)
(-0.00157621 -0.0583787 0)
(-0.00151697 -0.0519375 0)
(-0.00140647 -0.045077 0)
(-0.00124799 -0.0378172 0)
(-0.00104455 -0.0301686 0)
(-0.000798864 -0.0221299 0)
(-0.000512936 -0.0136809 0)
(-0.000188286 -0.00476685 0)
(0.000211584 -0.0047479 0)
(0.000575318 -0.0136205 0)
(0.000895144 -0.0220267 0)
(0.00116952 -0.0300213 0)
(0.00139637 -0.0376246 0)
(0.00157278 -0.0448381 0)
(0.0016955 -0.051651 0)
(0.00176099 -0.0580432 0)
(0.00176535 -0.0639854 0)
(0.00170418 -0.069437 0)
(0.00157231 -0.0743416 0)
(0.00136365 -0.0786176 0)
(0.00107204 -0.082142 0)
(0.000695397 -0.0847284 0)
(0.000247426 -0.0861282 0)
(-0.000229843 -0.0861295 0)
(-0.000678058 -0.0847317 0)
(-0.00105512 -0.0821463 0)
(-0.00134728 -0.0786222 0)
(-0.00155659 -0.0743459 0)
(-0.00168924 -0.0694407 0)
(-0.00175132 -0.0639884 0)
(-0.00174802 -0.0580454 0)
(-0.00168375 -0.0516524 0)
(-0.00156241 -0.0448388 0)
(-0.00138754 -0.0376248 0)
(-0.0011624 -0.0300211 0)
(-0.000889873 -0.0220264 0)
(-0.000572045 -0.0136202 0)
(-0.000210446 -0.00474782 0)
(0.000234776 -0.00472593 0)
(0.000636802 -0.0135507 0)
(0.000989414 -0.0219072 0)
(0.00129109 -0.0298508 0)
(0.00153967 -0.0374017 0)
(0.00173212 -0.0445613 0)
(0.00186495 -0.0513186 0)
(0.0019344 -0.0576533 0)
(0.00193633 -0.0635356 0)
(0.00186607 -0.0689249 0)
(0.00171823 -0.0737646 0)
(0.00148658 -0.0779735 0)
(0.00116518 -0.0814307 0)
(0.00075303 -0.0839564 0)
(0.000266096 -0.085317 0)
(-0.000251127 -0.085318 0)
(-0.00073828 -0.0839591 0)
(-0.00115081 -0.0814343 0)
(-0.0014727 -0.0779774 0)
(-0.00170492 -0.0737683 0)
(-0.00185345 -0.0689281 0)
(-0.00192449 -0.0635382 0)
(-0.00192348 -0.0576551 0)
(-0.00185507 -0.0513198 0)
(-0.00172341 -0.0445619 0)
(-0.00153226 -0.0374019 0)
(-0.00128511 -0.0298507 0)
(-0.000984998 -0.0219069 0)
(-0.000634062 -0.0135504 0)
(-0.000233825 -0.00472586 0)
(0.000259171 -0.00470072 0)
(0.000701055 -0.0134706 0)
(0.00108748 -0.0217701 0)
(0.00141694 -0.0296547 0)
(0.00168727 -0.0371447 0)
(0.00189527 -0.0442411 0)
(0.00203728 -0.0509326 0)
(0.00210935 -0.0571986 0)
(0.00210718 -0.063009 0)
(0.002026 -0.0683227 0)
(0.00186038 -0.0730829 0)
(0.00160432 -0.077209 0)
(0.00125262 -0.0805831 0)
(0.000806054 -0.083034 0)
(0.000283061 -0.0843467 0)
(-0.000270362 -0.0843475 0)
(-0.000793548 -0.0830362 0)
(-0.00124045 -0.0805861 0)
(-0.00159257 -0.0772123 0)
(-0.00184914 -0.0730859 0)
(-0.00201536 -0.0683253 0)
(-0.00209722 -0.0630112 0)
(-0.00210017 -0.0572002 0)
(-0.00202898 -0.0509336 0)
(-0.00188796 -0.0442416 0)
(-0.00168106 -0.0371448 0)
(-0.00141193 -0.0296546 0)
(-0.00108378 -0.0217699 0)
(-0.000698763 -0.0134704 0)
(-0.000258376 -0.00470066 0)
(0.000284687 -0.00467191 0)
(0.000767738 -0.0133792 0)
(0.00118867 -0.0216134 0)
(0.00154604 -0.02943 0)
(0.00183765 -0.0368493 0)
(0.0020602 -0.0438719 0)
(0.00220991 -0.0504861 0)
(0.00228269 -0.0566707 0)
(0.00227421 -0.0623949 0)
(0.0021798 -0.0676173 0)
(0.00199431 -0.0722809 0)
(0.00171249 -0.0763062 0)
(0.0013306 -0.079579 0)
(0.000851897 -0.0819396 0)
(0.000297401 -0.0831951 0)
(-0.000286669 -0.0831958 0)
(-0.000841329 -0.0819414 0)
(-0.00132032 -0.0795814 0)
(-0.00170258 -0.0763088 0)
(-0.00198485 -0.0722834 0)
(-0.00217084 -0.0676195 0)
(-0.00226584 -0.0623967 0)
(-0.00227498 -0.0566719 0)
(-0.00220295 -0.0504869 0)
(-0.00205408 -0.0438723 0)
(-0.00183245 -0.0368494 0)
(-0.00154185 -0.0294299 0)
(-0.00118558 -0.0216132 0)
(-0.000765823 -0.013379 0)
(-0.000284023 -0.00467186 0)
(0.00031121 -0.00463911 0)
(0.000836405 -0.0132753 0)
(0.00129214 -0.0214348 0)
(0.00167704 -0.0291734 0)
(0.00198892 -0.0365109 0)
(0.00222441 -0.0434476 0)
(0.00237963 -0.0499712 0)
(0.00245052 -0.0560595 0)
(0.0024329 -0.0616812 0)
(0.00232247 -0.0667942 0)
(0.00211485 -0.0713415 0)
(0.00180618 -0.0752453 0)
(0.00139504 -0.0783969 0)
(0.000887919 -0.0806509 0)
(0.000308207 -0.0818401 0)
(-0.000299173 -0.0818407 0)
(-0.00087902 -0.0806523 0)
(-0.00138639 -0.0783989 0)
(-0.00179784 -0.0752474 0)
(-0.0021069 -0.0713436 0)
(-0.00231495 -0.0667959 0)
(-0.00242588 -0.0616826 0)
(-0.00244406 -0.0560605 0)
(-0.0023738 -0.0499718 0)
(-0.00221929 -0.0434479 0)
(-0.00198458 -0.036511 0)
(-0.00167354 -0.0291732 0)
(-0.00128956 -0.0214346 0)
(-0.000834807 -0.0132751 0)
(-0.000310656 -0.00463906 0)
(0.00033859 -0.00460187 0)
(0.000906489 -0.0131573 0)
(0.00139682 -0.0212318 0)
(0.00180828 -0.028881 0)
(0.00213874 -0.0361243 0)
(0.00238479 -0.0429614 0)
(0.00254259 -0.0493789 0)
(0.00260823 -0.0553539 0)
(0.00257798 -0.0608542 0)
(0.00244831 -0.065837 0)
(0.00221627 -0.0702459 0)
(0.00188019 -0.0740054 0)
(0.00144192 -0.0770149 0)
(0.000911687 -0.0791461 0)
(0.000314683 -0.0802607 0)
(-0.000307109 -0.0802611 0)
(-0.000904222 -0.0791471 0)
(-0.00143466 -0.0770164 0)
(-0.00187319 -0.0740071 0)
(-0.0022096 -0.0702475 0)
(-0.00244201 -0.0658384 0)
(-0.0025721 -0.0608553 0)
(-0.00260283 -0.0553547 0)
(-0.00253772 -0.0493794 0)
(-0.00238051 -0.0429616 0)
(-0.00213511 -0.0361243 0)
(-0.00180536 -0.0288808 0)
(-0.00139467 -0.0212316 0)
(-0.000905156 -0.0131572 0)
(-0.000338128 -0.00460183 0)
(0.000366642 -0.0045597 0)
(0.000977294 -0.0130238 0)
(0.0015014 -0.0210015 0)
(0.00193774 -0.0285485 0)
(0.0022843 -0.0356835 0)
(0.00253768 -0.0424051 0)
(0.00269423 -0.0486991 0)
(0.00275047 -0.0545413 0)
(0.00270347 -0.0598985 0)
(0.00255111 -0.0647276 0)
(0.00229262 -0.0689734 0)
(0.00192949 -0.0725645 0)
(0.00146769 -0.0754108 0)
(0.00092128 -0.0774047 0)
(0.000316248 -0.0784379 0)
(-0.000309925 -0.0784382 0)
(-0.000915043 -0.0774055 0)
(-0.00146161 -0.075412 0)
(-0.00192364 -0.0725658 0)
(-0.00228703 -0.0689746 0)
(-0.00254584 -0.0647287 0)
(-0.00269855 -0.0598994 0)
(-0.00274596 -0.0545419 0)
(-0.00269016 -0.0486995 0)
(-0.00253411 -0.0424053 0)
(-0.00228127 -0.0356835 0)
(-0.00193531 -0.0285484 0)
(-0.00149961 -0.0210013 0)
(-0.000976183 -0.0130237 0)
(-0.000366257 -0.00455966 0)
(0.000395139 -0.00451203 0)
(0.00104798 -0.0128729 0)
(0.00160431 -0.0207408 0)
(0.00206302 -0.028171 0)
(0.00242225 -0.0351816 0)
(0.00267878 -0.0417698 0)
(0.00282932 -0.04792 0)
(0.00287121 -0.053607 0)
(0.00280288 -0.0587966 0)
(0.00262441 -0.0634459 0)
(0.00233815 -0.067502 0)
(0.00194974 -0.0709003 0)
(0.00146973 -0.073564 0)
(0.000915548 -0.0754087 0)
(0.000312613 -0.0763558 0)
(-0.000307356 -0.076356 0)
(-0.000910356 -0.0754093 0)
(-0.00146466 -0.0735649 0)
(-0.00194485 -0.0709013 0)
(-0.00233349 -0.067503 0)
(-0.00262001 -0.0634467 0)
(-0.00279878 -0.0587972 0)
(-0.00286744 -0.0536075 0)
(-0.00282593 -0.0479203 0)
(-0.0026758 -0.0417699 0)
(-0.00241973 -0.0351815 0)
(-0.002061 -0.0281709 0)
(-0.00160282 -0.0207406 0)
(-0.00104705 -0.0128728 0)
(-0.000394818 -0.004512 0)
(0.00042381 -0.00445823 0)
(0.00111753 -0.0127025 0)
(0.00170369 -0.0204457 0)
(0.00218129 -0.0277428 0)
(0.00254872 -0.0346104 0)
(0.00280313 -0.0410446 0)
(0.00294196 -0.0470281 0)
(0.00296387 -0.0525342 0)
(0.00286947 -0.0575287 0)
(0.00266198 -0.0619697 0)
(0.00234793 -0.0658089 0)
(0.00193781 -0.0689908 0)
(0.0014467 -0.0714556 0)
(0.000894258 -0.073143 0)
(0.000303812 -0.0740018 0)
(-0.000299458 -0.0740019 0)
(-0.000889953 -0.0731434 0)
(-0.00144249 -0.0714562 0)
(-0.00193375 -0.0689915 0)
(-0.00234404 -0.0658095 0)
(-0.00265831 -0.0619703 0)
(-0.00286605 -0.0575291 0)
(-0.00296073 -0.0525346 0)
(-0.00293913 -0.0470282 0)
(-0.00280065 -0.0410446 0)
(-0.00254662 -0.0346103 0)
(-0.0021796 -0.0277426 0)
(-0.00170244 -0.0204455 0)
(-0.00111676 -0.0127024 0)
(-0.000423542 -0.00445819 0)
(0.000452332 -0.00439753 0)
(0.00118477 -0.0125102 0)
(0.00179733 -0.0201119 0)
(0.00228922 -0.027257 0)
(0.00265922 -0.0339606 0)
(0.00290513 -0.0402169 0)
(0.00302565 -0.0460071 0)
(0.00302157 -0.0513037 0)
(0.00289664 -0.0560726 0)
(0.00265837 -0.0602754 0)
(0.00231838 -0.0638706 0)
(0.00189227 -0.0668157 0)
(0.00139876 -0.0690697 0)
(0.000858103 -0.070596 0)
(0.000290176 -0.0713668 0)
(-0.000286584 -0.0713669 0)
(-0.000854547 -0.0705963 0)
(-0.00139528 -0.0690701 0)
(-0.0018889 -0.0668162 0)
(-0.00231516 -0.0638711 0)
(-0.00265532 -0.0602758 0)
(-0.00289379 -0.0560729 0)
(-0.00301895 -0.0513039 0)
(-0.0030233 -0.0460072 0)
(-0.00290307 -0.0402169 0)
(-0.00265747 -0.0339605 0)
(-0.00228782 -0.0272568 0)
(-0.0017963 -0.0201118 0)
(-0.00118413 -0.01251 0)
(-0.000452109 -0.0043975 0)
(0.000480326 -0.00432906 0)
(0.00124828 -0.012293 0)
(0.00188267 -0.0197341 0)
(0.00238296 -0.0267055 0)
(0.00274861 -0.0332206 0)
(0.00297854 -0.0392716 0)
(0.0030735 -0.0448384 0)
(0.00303741 -0.049893 0)
(0.00287849 -0.0544037 0)
(0.00260959 -0.0583379 0)
(0.00224794 -0.0616646 0)
(0.00181365 -0.064357 0)
(0.00132753 -0.0663938 0)
(0.000808582 -0.0677596 0)
(0.000272283 -0.0684449 0)
(-0.00026933 -0.068445 0)
(-0.000805656 -0.0677598 0)
(-0.00132466 -0.0663941 0)
(-0.00181086 -0.0643573 0)
(-0.00224526 -0.0616649 0)
(-0.00260706 -0.0583382 0)
(-0.00287612 -0.0544039 0)
(-0.00303524 -0.0498931 0)
(-0.00307154 -0.0448384 0)
(-0.00297683 -0.0392716 0)
(-0.00274715 -0.0332205 0)
(-0.00238179 -0.0267053 0)
(-0.00188181 -0.0197339 0)
(-0.00124775 -0.0122928 0)
(-0.000480141 -0.00432903 0)
(0.00050734 -0.00425172 0)
(0.0013064 -0.0120473 0)
(0.00195667 -0.0193056 0)
(0.00245805 -0.0260782 0)
(0.00281108 -0.0323765 0)
(0.0030166 -0.0381906 0)
(0.00307844 -0.0434995 0)
(0.00300511 -0.0482768 0)
(0.00281055 -0.0524955 0)
(0.0025138 -0.0561323 0)
(0.00213736 -0.0591703 0)
(0.00170445 -0.0616001 0)
(0.00123588 -0.063419 0)
(0.000747797 -0.0646288 0)
(0.000250877 -0.0652326 0)
(-0.000248457 -0.0652326 0)
(-0.000745397 -0.0646289 0)
(-0.00123352 -0.0634191 0)
(-0.00170215 -0.0616003 0)
(-0.00213515 -0.0591705 0)
(-0.0025117 -0.0561325 0)
(-0.00280859 -0.0524956 0)
(-0.00300331 -0.0482768 0)
(-0.00307682 -0.0434995 0)
(-0.00301517 -0.0381905 0)
(-0.00280988 -0.0323763 0)
(-0.00245708 -0.0260781 0)
(-0.00195596 -0.0193055 0)
(-0.00130596 -0.0120472 0)
(-0.000507186 -0.00425169 0)
(0.000532838 -0.00416416 0)
(0.00135713 -0.0117688 0)
(0.00201576 -0.0188185 0)
(0.00250933 -0.0253629 0)
(0.00284019 -0.0314111 0)
(0.00301218 -0.0369518 0)
(0.00303378 -0.0419644 0)
(0.00291964 -0.0464266 0)
(0.00269059 -0.05032 0)
(0.00237186 -0.0536346 0)
(0.00198994 -0.05637 0)
(0.00156893 -0.058534 0)
(0.00112763 -0.0601397 0)
(0.000678226 -0.0612009 0)
(0.000226794 -0.0617284 0)
(-0.000224818 -0.0617284 0)
(-0.000676265 -0.0612009 0)
(-0.0011257 -0.0601398 0)
(-0.00156705 -0.0585341 0)
(-0.00198812 -0.05637 0)
(-0.00237013 -0.0536346 0)
(-0.00268897 -0.05032 0)
(-0.00291815 -0.0464265 0)
(-0.00303243 -0.0419643 0)
(-0.003011 -0.0369517 0)
(-0.00283919 -0.0314109 0)
(-0.00250853 -0.0253627 0)
(-0.00201517 -0.0188183 0)
(-0.00135677 -0.0117687 0)
(-0.00053271 -0.00416414 0)
(0.000556169 -0.00406469 0)
(0.00139809 -0.0114518 0)
(0.00205573 -0.0182622 0)
(0.00253093 -0.0245437 0)
(0.00282895 -0.0303029 0)
(0.00295826 -0.0355284 0)
(0.00293391 -0.0402027 0)
(0.00277825 -0.0443114 0)
(0.0025194 -0.0478495 0)
(0.00218767 -0.0508234 0)
(0.00181124 -0.0532499 0)
(0.00141267 -0.0551519 0)
(0.00100713 -0.0565534 0)
(0.000602516 -0.0574753 0)
(0.000200904 -0.0579323 0)
(-0.000199296 -0.0579323 0)
(-0.000600919 -0.0574753 0)
(-0.00100556 -0.0565534 0)
(-0.00141113 -0.0551519 0)
(-0.00180975 -0.0532499 0)
(-0.00218625 -0.0508233 0)
(-0.00251807 -0.0478494 0)
(-0.00277702 -0.0443113 0)
(-0.0029328 -0.0402026 0)
(-0.00295729 -0.0355283 0)
(-0.00282812 -0.0303028 0)
(-0.00253027 -0.0245435 0)
(-0.00205524 -0.0182621 0)
(-0.00139779 -0.0114517 0)
(-0.000556063 -0.00406466 0)
(0.000576542 -0.00395104 0)
(0.00142638 -0.0110887 0)
(0.00207163 -0.0176234 0)
(0.00251626 -0.0236004 0)
(0.00277015 -0.0290253 0)
(0.00284864 -0.0338885 0)
(0.0027754 -0.0381803 0)
(0.00258145 -0.0418994 0)
(0.00230133 -0.0450583 0)
(0.00196803 -0.0476814 0)
(0.00160861 -0.0498009 0)
(0.00124201 -0.0514503 0)
(0.000878953 -0.0526596 0)
(0.000523318 -0.0534526 0)
(0.000174061 -0.0538451 0)
(-0.000172758 -0.0538451 0)
(-0.000522023 -0.0534526 0)
(-0.000877674 -0.0526596 0)
(-0.00124076 -0.0514502 0)
(-0.0016074 -0.0498008 0)
(-0.00196687 -0.0476813 0)
(-0.00230024 -0.0450582 0)
(-0.00258043 -0.0418993 0)
(-0.00277448 -0.0381801 0)
(-0.00284783 -0.0338884 0)
(-0.00276946 -0.0290251 0)
(-0.00251571 -0.0236002 0)
(-0.00207122 -0.0176233 0)
(-0.00142613 -0.0110887 0)
(-0.000576454 -0.00395101 0)
(0.000592977 -0.00382017 0)
(0.00143846 -0.0106698 0)
(0.00205766 -0.0168842 0)
(0.00245817 -0.022507 0)
(0.00265699 -0.0275447 0)
(0.00267901 -0.0319947 0)
(0.0025582 -0.0358604 0)
(0.0023338 -0.0391596 0)
(0.00204432 -0.0419246 0)
(0.00172211 -0.0441964 0)
(0.00139048 -0.046018 0)
(0.00106354 -0.0474284 0)
(0.000747577 -0.0484594 0)
(0.000443162 -0.0491342 0)
(0.000147072 -0.0494679 0)
(-0.000146021 -0.0494679 0)
(-0.000442117 -0.0491341 0)
(-0.000746546 -0.0484593 0)
(-0.00106253 -0.0474283 0)
(-0.0013895 -0.0460179 0)
(-0.00172116 -0.0441963 0)
(-0.00204343 -0.0419244 0)
(-0.00233297 -0.0391595 0)
(-0.00255745 -0.0358602 0)
(-0.00267834 -0.0319945 0)
(-0.00265642 -0.0275446 0)
(-0.00245771 -0.0225068 0)
(-0.00205732 -0.0168841 0)
(-0.00143825 -0.0106697 0)
(-0.000592903 -0.00382014 0)
(0.000604251 -0.00366783 0)
(0.00143005 -0.0101812 0)
(0.00200725 -0.0160205 0)
(0.00234947 -0.0212295 0)
(0.00248419 -0.0258206 0)
(0.00244849 -0.0298047 0)
(0.00228686 -0.0332059 0)
(0.00204428 -0.0360648 0)
(0.00175935 -0.0384322 0)
(0.00146051 -0.0403612 0)
(0.00116561 -0.0418998 0)
(0.000883666 -0.0430876 0)
(0.000617199 -0.0439543 0)
(0.000364372 -0.0445213 0)
(0.000120674 -0.0448015 0)
(-0.000119833 -0.0448015 0)
(-0.000363536 -0.0445212 0)
(-0.000616372 -0.0439543 0)
(-0.000882855 -0.0430875 0)
(-0.00116482 -0.0418997 0)
(-0.00145975 -0.0403611 0)
(-0.00175863 -0.0384321 0)
(-0.0020436 -0.0360646 0)
(-0.00228624 -0.0332058 0)
(-0.00244794 -0.0298045 0)
(-0.00248373 -0.0258204 0)
(-0.00234909 -0.0212293 0)
(-0.00200697 -0.0160204 0)
(-0.00142987 -0.0101812 0)
(-0.000604191 -0.00366781 0)
(0.000608852 -0.0034879 0)
(0.00139595 -0.00960366 0)
(0.00191323 -0.0149996 0)
(0.00218387 -0.0197246 0)
(0.00224966 -0.0238048 0)
(0.00216115 -0.027274 0)
(0.00197108 -0.0301827 0)
(0.00172562 -0.0325936 0)
(0.00145928 -0.0345711 0)
(0.00119423 -0.0361732 0)
(0.000942366 -0.0374473 0)
(0.000708251 -0.0384295 0)
(0.00049157 -0.0391461 0)
(0.000289013 -0.0396147 0)
(9.55222e-05 -0.0398464 0)
(-9.48558e-05 -0.0398464 0)
(-0.00028835 -0.0396147 0)
(-0.000490915 -0.039146 0)
(-0.000707608 -0.0384294 0)
(-0.00094174 -0.0374472 0)
(-0.00119362 -0.0361731 0)
(-0.00145871 -0.034571 0)
(-0.00172508 -0.0325934 0)
(-0.00197058 -0.0301825 0)
(-0.00216072 -0.0272738 0)
(-0.00224928 -0.0238046 0)
(-0.00218356 -0.0197244 0)
(-0.001913 -0.0149994 0)
(-0.00139581 -0.00960358 0)
(-0.000608802 -0.00348788 0)
(0.000604936 -0.00327121 0)
(0.0013301 -0.00890921 0)
(0.00176855 -0.013777 0)
(0.00195763 -0.017938 0)
(0.00195636 -0.0214438 0)
(0.00182698 -0.0243595 0)
(0.00162518 -0.0267627 0)
(0.00139293 -0.0287319 0)
(0.0011574 -0.0303365 0)
(0.000933659 -0.0316325 0)
(0.000728277 -0.032662 0)
(0.000542402 -0.0334557 0)
(0.000373927 -0.034035 0)
(0.000218861 -0.034414 0)
(7.21784e-05 -0.0346015 0)
(-7.16591e-05 -0.0346015 0)
(-0.000218344 -0.034414 0)
(-0.000373416 -0.0340349 0)
(-0.000541901 -0.0334556 0)
(-0.000727788 -0.0326619 0)
(-0.000933188 -0.0316323 0)
(-0.00115695 -0.0303364 0)
(-0.0013925 -0.0287317 0)
(-0.00162479 -0.0267625 0)
(-0.00182664 -0.0243594 0)
(-0.00195606 -0.0214436 0)
(-0.00195738 -0.0179379 0)
(-0.00176836 -0.0137769 0)
(-0.00132998 -0.00890914 0)
(-0.000604896 -0.00327118 0)
(0.000590345 -0.00300354 0)
(0.00122558 -0.00805745 0)
(0.00156739 -0.0122938 0)
(0.00167149 -0.0158058 0)
(0.00161351 -0.018683 0)
(0.00146128 -0.0210241 0)
(0.00126627 -0.0229259 0)
(0.00106168 -0.0244717 0)
(0.000866042 -0.0257268 0)
(0.000687902 -0.0267395 0)
(0.000529708 -0.0275444 0)
(0.000390401 -0.0281655 0)
(0.000266983 -0.0286192 0)
(0.000155414 -0.0289163 0)
(5.11199e-05 -0.0290633 0)
(-5.07253e-05 -0.0290633 0)
(-0.000155021 -0.0289163 0)
(-0.000266595 -0.0286191 0)
(-0.00039002 -0.0281654 0)
(-0.000529337 -0.0275443 0)
(-0.000687543 -0.0267394 0)
(-0.000865699 -0.0257266 0)
(-0.00106136 -0.0244715 0)
(-0.00126597 -0.0229257 0)
(-0.00146101 -0.021024 0)
(-0.00161327 -0.0186829 0)
(-0.00167129 -0.0158057 0)
(-0.00156725 -0.0122937 0)
(-0.00122549 -0.00805738 0)
(-0.000590311 -0.00300352 0)
(0.000562356 -0.00266184 0)
(0.00107442 -0.00698969 0)
(0.00130622 -0.0104744 0)
(0.00133163 -0.0132578 0)
(0.0012358 -0.0154721 0)
(0.00108226 -0.0172389 0)
(0.000911544 -0.018659 0)
(0.000745904 -0.0198079 0)
(0.000595719 -0.0207399 0)
(0.000464466 -0.0214924 0)
(0.000351886 -0.0220913 0)
(0.000255787 -0.022554 0)
(0.000173012 -0.0228925 0)
(9.99434e-05 -0.0231144 0)
(3.27546e-05 -0.0232242 0)
(-3.24671e-05 -0.0232242 0)
(-9.96576e-05 -0.0231143 0)
(-0.00017273 -0.0228925 0)
(-0.00025551 -0.022554 0)
(-0.000351616 -0.0220912 0)
(-0.000464204 -0.0214923 0)
(-0.000595469 -0.0207397 0)
(-0.000745668 -0.0198078 0)
(-0.000911324 -0.0186588 0)
(-0.00108206 -0.0172388 0)
(-0.00123563 -0.0154719 0)
(-0.00133148 -0.0132577 0)
(-0.00130611 -0.0104743 0)
(-0.00107435 -0.00698963 0)
(-0.00056233 -0.00266182 0)
(0.000514795 -0.00220758 0)
(0.000864358 -0.00562312 0)
(0.00098221 -0.00822914 0)
(0.000947634 -0.0102248 0)
(0.000839987 -0.0117686 0)
(0.000707597 -0.0129819 0)
(0.000576161 -0.0139506 0)
(0.000457312 -0.0147332 0)
(0.000355053 -0.0153685 0)
(0.000269568 -0.0158824 0)
(0.000199239 -0.0162922 0)
(0.000141646 -0.0166094 0)
(9.40524e-05 -0.0168416 0)
(5.36118e-05 -0.016994 0)
(1.74594e-05 -0.0170695 0)
(-1.72653e-05 -0.0170695 0)
(-5.34188e-05 -0.016994 0)
(-9.38616e-05 -0.0168416 0)
(-0.000141459 -0.0166093 0)
(-0.000199056 -0.0162921 0)
(-0.000269392 -0.0158824 0)
(-0.000354884 -0.0153684 0)
(-0.000457152 -0.0147331 0)
(-0.000576013 -0.0139505 0)
(-0.000707461 -0.0129818 0)
(-0.000839868 -0.0117685 0)
(-0.000947534 -0.0102247 0)
(-0.000982132 -0.00822906 0)
(-0.000864307 -0.00562306 0)
(-0.000514775 -0.00220756 0)
(0.000415641 -0.00157119 0)
(0.000564071 -0.00384077 0)
(0.000585306 -0.00545421 0)
(0.000527004 -0.0066364 0)
(0.000440878 -0.00752957 0)
(0.000352544 -0.00822438 0)
(0.00027309 -0.00877764 0)
(0.000206129 -0.0092249 0)
(0.000151879 -0.00958874 0)
(0.00010914 -0.00988372 0)
(7.61973e-05 -0.0101194 0)
(5.11976e-05 -0.0103022 0)
(3.22951e-05 -0.0104363 0)
(1.76947e-05 -0.0105243 0)
(5.65249e-06 -0.010568 0)
(-5.54114e-06 -0.010568 0)
(-1.7584e-05 -0.0105243 0)
(-3.21857e-05 -0.0104363 0)
(-5.10903e-05 -0.0103022 0)
(-7.60927e-05 -0.0101194 0)
(-0.000109039 -0.00988367 0)
(-0.000151782 -0.00958868 0)
(-0.000206037 -0.00922483 0)
(-0.000273004 -0.00877756 0)
(-0.000352467 -0.00822431 0)
(-0.000440809 -0.0075295 0)
(-0.000526946 -0.00663633 0)
(-0.00058526 -0.00545415 0)
(-0.00056404 -0.00384073 0)
(-0.000415628 -0.00157117 0)
(0.000117554 -0.000714611 0)
(8.32151e-05 -0.0015592 0)
(8.56799e-05 -0.00210128 0)
(7.15725e-05 -0.00247784 0)
(5.14801e-05 -0.00275712 0)
(3.19329e-05 -0.0029735 0)
(1.57087e-05 -0.00314605 0)
(3.51724e-06 -0.003286 0)
(-4.79477e-06 -0.00340024 0)
(-9.69165e-06 -0.00349317 0)
(-1.17251e-05 -0.00356763 0)
(-1.14533e-05 -0.0036255 0)
(-9.41683e-06 -0.00366801 0)
(-6.13602e-06 -0.00369597 0)
(-2.11504e-06 -0.00370983 0)
(2.15155e-06 -0.00370983 0)
(6.17231e-06 -0.00369596 0)
(9.45266e-06 -0.003668 0)
(1.14884e-05 -0.00362548 0)
(1.17593e-05 -0.00356761 0)
(9.72462e-06 -0.00349315 0)
(4.82623e-06 -0.00340022 0)
(-3.48763e-06 -0.00328598 0)
(-1.56813e-05 -0.00314603 0)
(-3.19081e-05 -0.00297347 0)
(-5.14583e-05 -0.00275709 0)
(-7.15544e-05 -0.00247781 0)
(-8.5666e-05 -0.00210126 0)
(-8.3206e-05 -0.00155919 0)
(-0.00011755 -0.000714605 0)
)
;
boundaryField
{
inlet
{
type fixedValue;
value uniform (0 0 0);
}
outlet
{
type fixedValue;
value uniform (0 0 0);
}
walls
{
type fixedValue;
value uniform (0 0 0);
}
frontAndBackPlanes
{
type empty;
}
}
// ************************************************************************* //
| [
"peterbryz@yahoo.com"
] | peterbryz@yahoo.com |
c06523719c6e9996df3c041ac0a8f6e1d5a81c54 | 1bb56905724adfefb7e6b066a8e57a57bd25ca2d | /Tempest V1/headers/board.h | b06d0934232ac5e316e5741e7d0261325687020f | [] | no_license | DonnieSantos/TempestMUD | 0918819def4b4b466c12963db924fa3f981600fc | b612795d086b4e713ff02de1b068803f6e0e8d0b | refs/heads/master | 2021-01-10T18:47:20.908539 | 2015-12-07T02:14:18 | 2015-12-07T02:14:18 | 47,522,159 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 436 | h | #ifndef BOARD_H
#define BOARD_H
#include "windows.h"
class board
{
public:
board();
~board();
void load_board(string);
void add_note(string, string, string);
void set_name(string);
string remove_note(string, string, int);
string get_name();
string get_note(int);
string display_list();
private:
int size;
string name;
note *notelist;
CRITICAL_SECTION CriticalSection;
};
#endif | [
"DonaldJSantos@Gmail.com"
] | DonaldJSantos@Gmail.com |
138faf009ef17eecf32f7f3524f6d7f0e38161ef | 86763f7958dfb47f41752599de4d4b359354f31f | /TSOIR/Game/Enemies/Patterns/SoIRPattern.h | 61210ba1cbb8782da93d5224d6769537725f929c | [] | no_license | BenzinOzor/TheShootingOfIsaac_Rebirth | 616b496db8ae80b481efd27ee7a70594da6356e8 | 080c9b0500e175b8f097057be846c06fc4f17a31 | refs/heads/main | 2023-08-21T21:19:29.903063 | 2021-10-17T17:19:55 | 2021-10-17T17:19:55 | 415,336,030 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,855 | h | #pragma once
#include <vector>
#include "TSOIR/SoIRDefines.h"
#include "TSOIR/Game/Projectiles/SoIRProjectile.h"
class TSOIR_EXPORT SoIRPattern
{
public:
struct Group
{
std::string m_sName = "";
std::vector< std::string > m_oPatterns;
};
struct Desc
{
std::string m_sName = "";
SoIREnemyRef m_pEnemy;
fzn::CallbackBase* m_pEndCallback = nullptr;
EntityAnimDesc m_oAnim;
// PROJECTILE SETTINGS
SoIRProjectileType m_eType = SoIRProjectileType::eNbTypes;
SoIRProjectilePattern m_ePattern = SoIRProjectilePattern::eNbPatterns;
SoIRProjectilePropertiesMask m_uProperties = 0;
int m_iNumber = 0;
bool m_bCirclePatternRandomAngle = false;
float m_fSpreadAngle = 0.f;
float m_fHomingRadius = 0.f;
float m_fDamage = 0.f;
bool m_bFriendlyFire = false;
// PATTERN SETTINGS
float m_fDuration = 0.f;
float m_fTimeBeforeRotation = 0.f;
float m_fTimeAfterRotation = 0.f;
float m_fAngleStep = 0.f; // Angle to add each frame. If 0, we use Final Angle.
float m_fInitialAngle = 0.f;
float m_fFinalAngle = 0.f; // If there is a final angle, it means the pattern position will be interpolated. (no need for a step angle)
float m_fRotationDirectionDuration = 0.f;
bool m_bRotationClosestToPlayer = false;
bool m_bTargetPlayer = false;
int m_iFollowPlayerRotation = 0;
float m_fShotSpeed = 0.f;
float m_fTearDelay = 0.f;
SinusoidParams m_oSinParams;
bool IsValid() const;
};
SoIRPattern();
~SoIRPattern();
bool IsValid() const;
void Init();
void Start( const Desc& _oDesc );
void Restart();
void Stop( bool _bStopAnimation = true );
void Reset( bool _bStopAnimation = true );
bool Update(); // returns true if still running.
const Desc& GetDesc() const;
bool IsRunning() const;
float GetTimer() const;
protected:
void _OnAnimationEvent( std::string _sEvent, const fzn::Anm2* _pAnim );
bool _UpdateLaserPattern();
bool _UpdateTearPattern();
void _Shoot();
bool _CanRotate();
float _GetPlayerDistanceFromLaser( const sf::Vector2f& _vLaserDir, const sf::Vector2f& _vPlayerDir );
Desc m_oDesc;
float m_fCurrentAngle; // Updated when using AngleStep.
float m_fLastAngleStep;
float m_fRotationDirection;
bool m_bFirstShot;
sf::Vector2f m_vPreviousPlayerDirection;
float m_fPatternTimer;
float m_fTearTimer;
float m_fRotationDirectionTimer;
std::vector< SoIRProjectileRef > m_oProjectiles;
fzn::Anm2::TriggerCallback m_pAnimCallback;
bool m_bShootOnAnimTrigger;
};
| [
"fryfonbly@gmail.com"
] | fryfonbly@gmail.com |
be53f78c011124661471093e4f9fe6296f0df46e | 0a9c86bd80cd0238b4ad46eb14141f8764c4d13d | /game/BehaviorSeekComponent.cpp | e2c6ce22e86d8cfb67bc093097be358a88313388 | [
"BSD-3-Clause",
"BSD-2-Clause"
] | permissive | sd2017/TriggerTime | 744665719f68d0b7fe107ff537db046ec12ce671 | 9265dee6a178e43bf7365e3aa2f7f2ca22df074f | refs/heads/master | 2023-08-18T12:29:23.032342 | 2021-09-18T10:35:56 | 2021-09-18T10:35:56 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,121 | cpp | /*
* Copyright (c) 2014, Stanislav Vorobiov
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "BehaviorSeekComponent.h"
#include "SceneObject.h"
#include "Settings.h"
#include "Utils.h"
namespace af
{
BehaviorSeekComponent::BehaviorSeekComponent()
: started_(false)
{
reset();
}
BehaviorSeekComponent::~BehaviorSeekComponent()
{
}
void BehaviorSeekComponent::accept(ComponentVisitor& visitor)
{
visitor.visitPhasedComponent(shared_from_this());
}
void BehaviorSeekComponent::update(float dt)
{
if (!started_ || finished() || !target_ || parent()->stunned()) {
return;
}
b2Vec2 dir = parent()->getDirection(1.0f);
b2Vec2 targetDir = target_->pos() - parent()->pos();
if (useTorque_) {
b2Vec2 dir = angle2vec(parent()->angle() + parent()->angularVelocity() / 6.0f, 1.0f);
if (b2Cross(dir, targetDir) >= 0.0f) {
parent()->applyTorque(parent()->inertia() * (angularVelocity_ - parent()->angularVelocity() + parent()->angularVelocityDamped()), true);
} else {
parent()->applyTorque(parent()->inertia() * (-angularVelocity_ - parent()->angularVelocity() + parent()->angularVelocityDamped()), true);
}
} else {
float angle = angleBetween(dir, targetDir);
float angVelocity = 0.0f;
if (angle >= 0.0f) {
angVelocity = angularVelocity_;
} else {
angVelocity = -angularVelocity_;
}
if (fabs(angVelocity * settings.physics.fixedTimestep) > fabs(angle)) {
angVelocity = angle / settings.physics.fixedTimestep;
}
if ((fabs(angVelocity) <= b2_epsilon) && !loop()) {
angVelocity = 0.0f;
finished_ = true;
}
if (joint_) {
joint_->setMotorSpeed(angVelocity);
} else {
parent()->setAngularVelocity(angVelocity);
}
}
}
void BehaviorSeekComponent::reset()
{
if (started_ && !finished()) {
if (joint_) {
joint_->setMotorSpeed(0);
} else {
parent()->setAngularVelocity(0);
}
}
started_ = false;
finished_ = false;
angularVelocity_ = 0.0f;
target_.reset();
useTorque_ = false;
joint_.reset();
setLoop(false);
}
void BehaviorSeekComponent::start()
{
if (!scene()) {
return;
}
started_ = true;
finished_ = false;
}
void BehaviorSeekComponent::onRegister()
{
}
void BehaviorSeekComponent::onUnregister()
{
target_.reset();
}
}
| [
"sheffmail@mail.ru"
] | sheffmail@mail.ru |
e0168b0f09fce4d4894cb734d9dcd9195c9d7902 | 66db32f989f8743c4a7b39983f8dc368b7b454e6 | /udp_bench/src/server.cpp | e977e8dd48bc68209aaa51a3c5a0358a9e502efc | [] | no_license | wangqiangcc/samples | 98d4ffe78758f3fe66db77b0b56532bd2f3a0363 | 7143c2e160f44323553dd0a6933c1f435f6d1326 | refs/heads/master | 2023-06-08T16:57:13.231230 | 2017-07-25T02:14:11 | 2017-07-25T02:14:11 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,169 | cpp | #include <cstdlib>
#include <iostream>
#include <string>
#include <functional>
#include <asio.hpp>
using asio::ip::udp;
enum PacketType
{
E_INFO = 1,
E_HEARTBEAT,
E_PACKET,
E_BAD_PACKET,
E_QUIT
};
class server
{
public:
server(asio::io_service& io_service, short port)
: io_service_(io_service),
socket_(io_service, udp::endpoint(udp::v4(), port)),
bytes(0), packets(0), bad_packets(0)
{
socket_.async_receive_from(asio::buffer(data_, max_length),
sender_endpoint_,
std::bind(&server::handle_receive_from, this,
std::placeholders::_1,
std::placeholders::_2));
}
void handle_receive_from(const asio::error_code& error,
size_t bytes_recvd)
{
if (!error && bytes_recvd > 0)
{
PacketType packet_type = checkPacket(data_, bytes_recvd);
switch (packet_type)
{
case E_QUIT:
{
std::stringstream sstr;
sstr << "Packets " << packets << "\nBytes " << bytes << "\nBad packets " << bad_packets << std::ends;
size_t response_length = sstr.str().length();
if (response_length > max_length)
{
response_length = max_length;
}
strncpy(data_, sstr.str().c_str(), response_length);
/* Echo back the quit message to terminate the session */
socket_.async_send_to(asio::buffer(data_, response_length),
sender_endpoint_,
std::bind(&server::handle_send_to, this,
std::placeholders::_1,
std::placeholders::_2));
break;
}
default:
{
socket_.async_receive_from(asio::buffer(data_, max_length),
sender_endpoint_,
std::bind(&server::handle_receive_from, this,
std::placeholders::_1,
std::placeholders::_2));
break;
}
}
}
else
{
if (error)
{
std::cout << "Error code " << error << " bytes received " << bytes_recvd << std::endl;
++bad_packets;
}
socket_.async_receive_from(asio::buffer(data_, max_length),
sender_endpoint_,
std::bind(&server::handle_receive_from, this,
std::placeholders::_1,
std::placeholders::_2));
}
return;
}
void handle_send_to(const asio::error_code& /*error*/, size_t /*bytes_sent*/)
{
std::cout << "Quit message sent\n";
std::cout << "Packets " << packets << "\nBytes " << bytes << "\nBad packets " << bad_packets << std::endl;
return; // io_service will complete with one worker
}
private:
bool validatePacket(const char *data, size_t length)
{
struct packet_header
{
uint32_t version_mark; // 'quit' or version pattern
uint32_t packet_length;
} checkHeader;
if (length < sizeof(packet_header))
{
return false;
}
/* can't cast due to possible alignment issues so copy minimum amount */
memcpy(&checkHeader, data, sizeof(packet_header));
if (checkHeader.packet_length != length)
{
return false;
}
return true;
}
PacketType checkPacket(const char *data, size_t length)
{
bytes += length;
++packets;
if (length >= 4 && strncmp(data, "quit",4) == 0)
{
std::cout << "detected quit request\n";
return E_QUIT;
}
if (!validatePacket(data, length))
{
++bad_packets;
return E_BAD_PACKET;
}
return E_PACKET;
}
asio::io_service& io_service_;
udp::socket socket_;
udp::endpoint sender_endpoint_;
enum { max_length = 1468 };
char data_[max_length];
size_t bytes;
size_t packets;
size_t bad_packets;
};
int main(int argc, char* argv[])
{
try
{
if (argc != 2)
{
std::cerr << "Usage: async_udp_server <port>\n";
return 1;
}
asio::io_service io_service;
using namespace std; // For atoi.
server s(io_service, atoi(argv[1]));
io_service.run();
}
catch (std::exception& e)
{
std::cerr << "Exception: " << e.what() << "\n";
}
return 0;
} | [
"efw.org@qq.com"
] | efw.org@qq.com |
a74340141baaa40af27a4ec049806333761e1f34 | 1cde834a4f3052b5135deb5bc294988a5026ce34 | /AbstractHardware/Registers/STM32F446/dma_registers.hpp | 982c28df35385544098645de2bf7c518683226a9 | [] | no_license | KorolyovNikita/stmdemoproject | 6abe665740fe3edea5a408b1a341593b005ba33d | e9b6aa0329ef3aa12c35adac246057a2f4f4acbd | refs/heads/master | 2023-03-13T21:33:39.088190 | 2021-03-08T16:53:35 | 2021-03-08T16:53:35 | 345,728,409 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 97,503 | hpp | /******************************************************************************
* Filename : dma_registers.hpp
*
* Details : DMA controller
* This header file is auto-generated for STM32F446 device.
******************************************************************************/
#pragma once
#include "fieldvalue.hpp"
struct DMA2
{
static constexpr auto periphNum = 2;
// low interrupt status register
struct LISR : Register<0x40026400, ReadMode, 0x0>
{
// Stream x transfer complete interrupt flag (x = 3..0)
struct TCIF3 : RegisterField<LISR, 27, 1, ReadMode>
{
};
// Stream x half transfer interrupt flag (x=3..0)
struct HTIF3 : RegisterField<LISR, 26, 1, ReadMode>
{
};
// Stream x transfer error interrupt flag (x=3..0)
struct TEIF3 : RegisterField<LISR, 25, 1, ReadMode>
{
};
// Stream x direct mode error interrupt flag (x=3..0)
struct DMEIF3 : RegisterField<LISR, 24, 1, ReadMode>
{
};
// Stream x FIFO error interrupt flag (x=3..0)
struct FEIF3 : RegisterField<LISR, 22, 1, ReadMode>
{
};
// Stream x transfer complete interrupt flag (x = 3..0)
struct TCIF2 : RegisterField<LISR, 21, 1, ReadMode>
{
};
// Stream x half transfer interrupt flag (x=3..0)
struct HTIF2 : RegisterField<LISR, 20, 1, ReadMode>
{
};
// Stream x transfer error interrupt flag (x=3..0)
struct TEIF2 : RegisterField<LISR, 19, 1, ReadMode>
{
};
// Stream x direct mode error interrupt flag (x=3..0)
struct DMEIF2 : RegisterField<LISR, 18, 1, ReadMode>
{
};
// Stream x FIFO error interrupt flag (x=3..0)
struct FEIF2 : RegisterField<LISR, 16, 1, ReadMode>
{
};
// Stream x transfer complete interrupt flag (x = 3..0)
struct TCIF1 : RegisterField<LISR, 11, 1, ReadMode>
{
};
// Stream x half transfer interrupt flag (x=3..0)
struct HTIF1 : RegisterField<LISR, 10, 1, ReadMode>
{
};
// Stream x transfer error interrupt flag (x=3..0)
struct TEIF1 : RegisterField<LISR, 9, 1, ReadMode>
{
};
// Stream x direct mode error interrupt flag (x=3..0)
struct DMEIF1 : RegisterField<LISR, 8, 1, ReadMode>
{
};
// Stream x FIFO error interrupt flag (x=3..0)
struct FEIF1 : RegisterField<LISR, 6, 1, ReadMode>
{
};
// Stream x transfer complete interrupt flag (x = 3..0)
struct TCIF0 : RegisterField<LISR, 5, 1, ReadMode>
{
};
// Stream x half transfer interrupt flag (x=3..0)
struct HTIF0 : RegisterField<LISR, 4, 1, ReadMode>
{
};
// Stream x transfer error interrupt flag (x=3..0)
struct TEIF0 : RegisterField<LISR, 3, 1, ReadMode>
{
};
// Stream x direct mode error interrupt flag (x=3..0)
struct DMEIF0 : RegisterField<LISR, 2, 1, ReadMode>
{
};
// Stream x FIFO error interrupt flag (x=3..0)
struct FEIF0 : RegisterField<LISR, 0, 1, ReadMode>
{
};
};
// high interrupt status register
struct HISR : Register<0x40026404, ReadMode, 0x0>
{
// Stream x transfer complete interrupt flag (x=7..4)
struct TCIF7 : RegisterField<HISR, 27, 1, ReadMode>
{
};
// Stream x half transfer interrupt flag (x=7..4)
struct HTIF7 : RegisterField<HISR, 26, 1, ReadMode>
{
};
// Stream x transfer error interrupt flag (x=7..4)
struct TEIF7 : RegisterField<HISR, 25, 1, ReadMode>
{
};
// Stream x direct mode error interrupt flag (x=7..4)
struct DMEIF7 : RegisterField<HISR, 24, 1, ReadMode>
{
};
// Stream x FIFO error interrupt flag (x=7..4)
struct FEIF7 : RegisterField<HISR, 22, 1, ReadMode>
{
};
// Stream x transfer complete interrupt flag (x=7..4)
struct TCIF6 : RegisterField<HISR, 21, 1, ReadMode>
{
};
// Stream x half transfer interrupt flag (x=7..4)
struct HTIF6 : RegisterField<HISR, 20, 1, ReadMode>
{
};
// Stream x transfer error interrupt flag (x=7..4)
struct TEIF6 : RegisterField<HISR, 19, 1, ReadMode>
{
};
// Stream x direct mode error interrupt flag (x=7..4)
struct DMEIF6 : RegisterField<HISR, 18, 1, ReadMode>
{
};
// Stream x FIFO error interrupt flag (x=7..4)
struct FEIF6 : RegisterField<HISR, 16, 1, ReadMode>
{
};
// Stream x transfer complete interrupt flag (x=7..4)
struct TCIF5 : RegisterField<HISR, 11, 1, ReadMode>
{
};
// Stream x half transfer interrupt flag (x=7..4)
struct HTIF5 : RegisterField<HISR, 10, 1, ReadMode>
{
};
// Stream x transfer error interrupt flag (x=7..4)
struct TEIF5 : RegisterField<HISR, 9, 1, ReadMode>
{
};
// Stream x direct mode error interrupt flag (x=7..4)
struct DMEIF5 : RegisterField<HISR, 8, 1, ReadMode>
{
};
// Stream x FIFO error interrupt flag (x=7..4)
struct FEIF5 : RegisterField<HISR, 6, 1, ReadMode>
{
};
// Stream x transfer complete interrupt flag (x=7..4)
struct TCIF4 : RegisterField<HISR, 5, 1, ReadMode>
{
};
// Stream x half transfer interrupt flag (x=7..4)
struct HTIF4 : RegisterField<HISR, 4, 1, ReadMode>
{
};
// Stream x transfer error interrupt flag (x=7..4)
struct TEIF4 : RegisterField<HISR, 3, 1, ReadMode>
{
};
// Stream x direct mode error interrupt flag (x=7..4)
struct DMEIF4 : RegisterField<HISR, 2, 1, ReadMode>
{
};
// Stream x FIFO error interrupt flag (x=7..4)
struct FEIF4 : RegisterField<HISR, 0, 1, ReadMode>
{
};
};
// low interrupt flag clear register
struct LIFCR : Register<0x40026408, ReadWriteMode, 0x0>
{
// Stream x clear transfer complete interrupt flag (x = 3..0)
struct CTCIF3 : RegisterField<LIFCR, 27, 1, ReadWriteMode>
{
};
// Stream x clear half transfer interrupt flag (x = 3..0)
struct CHTIF3 : RegisterField<LIFCR, 26, 1, ReadWriteMode>
{
};
// Stream x clear transfer error interrupt flag (x = 3..0)
struct CTEIF3 : RegisterField<LIFCR, 25, 1, ReadWriteMode>
{
};
// Stream x clear direct mode error interrupt flag (x = 3..0)
struct CDMEIF3 : RegisterField<LIFCR, 24, 1, ReadWriteMode>
{
};
// Stream x clear FIFO error interrupt flag (x = 3..0)
struct CFEIF3 : RegisterField<LIFCR, 22, 1, ReadWriteMode>
{
};
// Stream x clear transfer complete interrupt flag (x = 3..0)
struct CTCIF2 : RegisterField<LIFCR, 21, 1, ReadWriteMode>
{
};
// Stream x clear half transfer interrupt flag (x = 3..0)
struct CHTIF2 : RegisterField<LIFCR, 20, 1, ReadWriteMode>
{
};
// Stream x clear transfer error interrupt flag (x = 3..0)
struct CTEIF2 : RegisterField<LIFCR, 19, 1, ReadWriteMode>
{
};
// Stream x clear direct mode error interrupt flag (x = 3..0)
struct CDMEIF2 : RegisterField<LIFCR, 18, 1, ReadWriteMode>
{
};
// Stream x clear FIFO error interrupt flag (x = 3..0)
struct CFEIF2 : RegisterField<LIFCR, 16, 1, ReadWriteMode>
{
};
// Stream x clear transfer complete interrupt flag (x = 3..0)
struct CTCIF1 : RegisterField<LIFCR, 11, 1, ReadWriteMode>
{
};
// Stream x clear half transfer interrupt flag (x = 3..0)
struct CHTIF1 : RegisterField<LIFCR, 10, 1, ReadWriteMode>
{
};
// Stream x clear transfer error interrupt flag (x = 3..0)
struct CTEIF1 : RegisterField<LIFCR, 9, 1, ReadWriteMode>
{
};
// Stream x clear direct mode error interrupt flag (x = 3..0)
struct CDMEIF1 : RegisterField<LIFCR, 8, 1, ReadWriteMode>
{
};
// Stream x clear FIFO error interrupt flag (x = 3..0)
struct CFEIF1 : RegisterField<LIFCR, 6, 1, ReadWriteMode>
{
};
// Stream x clear transfer complete interrupt flag (x = 3..0)
struct CTCIF0 : RegisterField<LIFCR, 5, 1, ReadWriteMode>
{
};
// Stream x clear half transfer interrupt flag (x = 3..0)
struct CHTIF0 : RegisterField<LIFCR, 4, 1, ReadWriteMode>
{
};
// Stream x clear transfer error interrupt flag (x = 3..0)
struct CTEIF0 : RegisterField<LIFCR, 3, 1, ReadWriteMode>
{
};
// Stream x clear direct mode error interrupt flag (x = 3..0)
struct CDMEIF0 : RegisterField<LIFCR, 2, 1, ReadWriteMode>
{
};
// Stream x clear FIFO error interrupt flag (x = 3..0)
struct CFEIF0 : RegisterField<LIFCR, 0, 1, ReadWriteMode>
{
};
};
// high interrupt flag clear register
struct HIFCR : Register<0x4002640c, ReadWriteMode, 0x0>
{
// Stream x clear transfer complete interrupt flag (x = 7..4)
struct CTCIF7 : RegisterField<HIFCR, 27, 1, ReadWriteMode>
{
};
// Stream x clear half transfer interrupt flag (x = 7..4)
struct CHTIF7 : RegisterField<HIFCR, 26, 1, ReadWriteMode>
{
};
// Stream x clear transfer error interrupt flag (x = 7..4)
struct CTEIF7 : RegisterField<HIFCR, 25, 1, ReadWriteMode>
{
};
// Stream x clear direct mode error interrupt flag (x = 7..4)
struct CDMEIF7 : RegisterField<HIFCR, 24, 1, ReadWriteMode>
{
};
// Stream x clear FIFO error interrupt flag (x = 7..4)
struct CFEIF7 : RegisterField<HIFCR, 22, 1, ReadWriteMode>
{
};
// Stream x clear transfer complete interrupt flag (x = 7..4)
struct CTCIF6 : RegisterField<HIFCR, 21, 1, ReadWriteMode>
{
};
// Stream x clear half transfer interrupt flag (x = 7..4)
struct CHTIF6 : RegisterField<HIFCR, 20, 1, ReadWriteMode>
{
};
// Stream x clear transfer error interrupt flag (x = 7..4)
struct CTEIF6 : RegisterField<HIFCR, 19, 1, ReadWriteMode>
{
};
// Stream x clear direct mode error interrupt flag (x = 7..4)
struct CDMEIF6 : RegisterField<HIFCR, 18, 1, ReadWriteMode>
{
};
// Stream x clear FIFO error interrupt flag (x = 7..4)
struct CFEIF6 : RegisterField<HIFCR, 16, 1, ReadWriteMode>
{
};
// Stream x clear transfer complete interrupt flag (x = 7..4)
struct CTCIF5 : RegisterField<HIFCR, 11, 1, ReadWriteMode>
{
};
// Stream x clear half transfer interrupt flag (x = 7..4)
struct CHTIF5 : RegisterField<HIFCR, 10, 1, ReadWriteMode>
{
};
// Stream x clear transfer error interrupt flag (x = 7..4)
struct CTEIF5 : RegisterField<HIFCR, 9, 1, ReadWriteMode>
{
};
// Stream x clear direct mode error interrupt flag (x = 7..4)
struct CDMEIF5 : RegisterField<HIFCR, 8, 1, ReadWriteMode>
{
};
// Stream x clear FIFO error interrupt flag (x = 7..4)
struct CFEIF5 : RegisterField<HIFCR, 6, 1, ReadWriteMode>
{
};
// Stream x clear transfer complete interrupt flag (x = 7..4)
struct CTCIF4 : RegisterField<HIFCR, 5, 1, ReadWriteMode>
{
};
// Stream x clear half transfer interrupt flag (x = 7..4)
struct CHTIF4 : RegisterField<HIFCR, 4, 1, ReadWriteMode>
{
};
// Stream x clear transfer error interrupt flag (x = 7..4)
struct CTEIF4 : RegisterField<HIFCR, 3, 1, ReadWriteMode>
{
};
// Stream x clear direct mode error interrupt flag (x = 7..4)
struct CDMEIF4 : RegisterField<HIFCR, 2, 1, ReadWriteMode>
{
};
// Stream x clear FIFO error interrupt flag (x = 7..4)
struct CFEIF4 : RegisterField<HIFCR, 0, 1, ReadWriteMode>
{
};
};
// stream x configuration register
struct S0CR : Register<0x40026410, ReadWriteMode, 0x0>
{
// Channel selection
struct CHSEL : RegisterField<S0CR, 25, 3, ReadWriteMode>
{
template<auto val, class = typename std::enable_if_t<(val >= 0 && val <= 7)>>
using Channel = FieldValue<CHSEL, val>;
};
// Memory burst transfer configuration
struct MBURST : RegisterField<S0CR, 23, 2, ReadWriteMode>
{
};
// Peripheral burst transfer configuration
struct PBURST : RegisterField<S0CR, 21, 2, ReadWriteMode>
{
};
// Current target (only in double buffer mode)
struct CT : RegisterField<S0CR, 19, 1, ReadWriteMode>
{
};
// Double buffer mode
struct DBM : RegisterField<S0CR, 18, 1, ReadWriteMode>
{
};
// Priority level
struct PL : RegisterField<S0CR, 16, 2, ReadWriteMode>
{
using Low = FieldValue<PL, 0U>;
using Medium = FieldValue<PL, 1U>;
using High = FieldValue<PL, 2U>;
using Very_high = FieldValue<PL, 3U>;
template<auto val, class = typename std::enable_if_t<(val >= 0 && val <= 3)>>
using Priority = FieldValue<PL, val>;
};
// Peripheral increment offset size
struct PINCOS : RegisterField<S0CR, 15, 1, ReadWriteMode>
{
};
// Memory data size
struct MSIZE : RegisterField<S0CR, 13, 2, ReadWriteMode>
{
using Byte = FieldValue<MSIZE, 0U>;
using Half_Word = FieldValue<MSIZE, 1U>;
using Word = FieldValue<MSIZE, 2U>;
};
// Peripheral data size
struct PSIZE : RegisterField<S0CR, 11, 2, ReadWriteMode>
{
using Byte = FieldValue<PSIZE, 0U>;
using Half_Word = FieldValue<PSIZE, 1U>;
using Word = FieldValue<PSIZE, 2U>;
};
// Memory increment mode
struct MINC : RegisterField<S0CR, 10, 1, ReadWriteMode>
{
using Fixed = FieldValue<MINC, 0U>;
using Incremented = FieldValue<MINC, 1U>;
};
// Peripheral increment mode
struct PINC : RegisterField<S0CR, 9, 1, ReadWriteMode>
{
using Fixed = FieldValue<PINC, 0U>;
using Incremented = FieldValue<PINC, 1U>;
};
// Circular mode
struct CIRC : RegisterField<S0CR, 8, 1, ReadWriteMode>
{
using Disable = FieldValue<CIRC, 0U>;
using Enable = FieldValue<CIRC, 1U>;
};
// Data transfer direction
struct DIR : RegisterField<S0CR, 6, 2, ReadWriteMode>
{
using peripheral_to_memory = FieldValue<DIR, 0U>;
using memory_to_peripheral = FieldValue<DIR, 1U>;
using memory_to_memory = FieldValue<DIR, 2U>;
};
// Peripheral flow controller
struct PFCTRL : RegisterField<S0CR, 5, 1, ReadWriteMode>
{
using DMA = FieldValue<PFCTRL, 0U>;
using Peripheral = FieldValue<PFCTRL, 1U>;
};
// Transfer complete interrupt enable
struct TCIE : RegisterField<S0CR, 4, 1, ReadWriteMode>
{
using Disable = FieldValue<TCIE, 0U>;
using Enable = FieldValue<TCIE, 1U>;
};
// Half transfer interrupt enable
struct HTIE : RegisterField<S0CR, 3, 1, ReadWriteMode>
{
using Disable = FieldValue<HTIE, 0U>;
using Enable = FieldValue<HTIE, 1U>;
};
// Transfer error interrupt enable
struct TEIE : RegisterField<S0CR, 2, 1, ReadWriteMode>
{
using Disable = FieldValue<TEIE, 0U>;
using Enable = FieldValue<TEIE, 1U>;
};
// Direct mode error interrupt enable
struct DMEIE : RegisterField<S0CR, 1, 1, ReadWriteMode>
{
using Disable = FieldValue<DMEIE, 0U>;
using Enable = FieldValue<DMEIE, 1U>;
};
// Stream enable / flag stream ready when read low
struct EN : RegisterField<S0CR, 0, 1, ReadWriteMode>
{
using Disable = FieldValue<EN, 0U>;
using Enable = FieldValue<EN, 1U>;
};
};
// stream x configuration register
template<auto num>
struct SxCR : Register<0x40026410 + 24 * num, ReadWriteMode, 0x0>
{
// Channel selection
struct CHSEL : RegisterField<SxCR, 25, 3, ReadWriteMode>
{
template<auto val, class = typename std::enable_if_t<(val >= 0 && val <= 7)>>
using Channel = FieldValue<CHSEL, val>;
};
// Memory burst transfer configuration
struct MBURST : RegisterField<SxCR, 23, 2, ReadWriteMode>
{
};
// Peripheral burst transfer configuration
struct PBURST : RegisterField<SxCR, 21, 2, ReadWriteMode>
{
};
// Current target (only in double buffer mode)
struct CT : RegisterField<SxCR, 19, 1, ReadWriteMode>
{
};
// Double buffer mode
struct DBM : RegisterField<SxCR, 18, 1, ReadWriteMode>
{
};
// Priority level
struct PL : RegisterField<SxCR, 16, 2, ReadWriteMode>
{
using Low = FieldValue<PL, 0U>;
using Medium = FieldValue<PL, 1U>;
using High = FieldValue<PL, 2U>;
using Very_high = FieldValue<PL, 3U>;
template<auto val, class = typename std::enable_if_t<(val >= 0 && val <= 3)>>
using Priority = FieldValue<PL, val>;
};
// Peripheral increment offset size
struct PINCOS : RegisterField<SxCR, 15, 1, ReadWriteMode>
{
};
// Memory data size
struct MSIZE : RegisterField<SxCR, 13, 2, ReadWriteMode>
{
using Byte = FieldValue<MSIZE, 0U>;
using Half_Word = FieldValue<MSIZE, 1U>;
using Word = FieldValue<MSIZE, 2U>;
};
// Peripheral data size
struct PSIZE : RegisterField<SxCR, 11, 2, ReadWriteMode>
{
using Byte = FieldValue<PSIZE, 0U>;
using Half_Word = FieldValue<PSIZE, 1U>;
using Word = FieldValue<PSIZE, 2U>;
};
// Memory increment mode
struct MINC : RegisterField<SxCR, 10, 1, ReadWriteMode>
{
using Fixed = FieldValue<MINC, 0U>;
using Incremented = FieldValue<MINC, 1U>;
};
// Peripheral increment mode
struct PINC : RegisterField<SxCR, 9, 1, ReadWriteMode>
{
using Fixed = FieldValue<PINC, 0U>;
using Incremented = FieldValue<PINC, 1U>;
};
// Circular mode
struct CIRC : RegisterField<SxCR, 8, 1, ReadWriteMode>
{
using Disable = FieldValue<CIRC, 0U>;
using Enable = FieldValue<CIRC, 1U>;
};
// Data transfer direction
struct DIR : RegisterField<SxCR, 6, 2, ReadWriteMode>
{
using peripheral_to_memory = FieldValue<DIR, 0U>;
using memory_to_peripheral = FieldValue<DIR, 1U>;
using memory_to_memory = FieldValue<DIR, 2U>;
};
// Peripheral flow controller
struct PFCTRL : RegisterField<SxCR, 5, 1, ReadWriteMode>
{
using DMA = FieldValue<PFCTRL, 0U>;
using Peripheral = FieldValue<PFCTRL, 1U>;
};
// Transfer complete interrupt enable
struct TCIE : RegisterField<SxCR, 4, 1, ReadWriteMode>
{
using Disable = FieldValue<TCIE, 0U>;
using Enable = FieldValue<TCIE, 1U>;
};
// Half transfer interrupt enable
struct HTIE : RegisterField<SxCR, 3, 1, ReadWriteMode>
{
using Disable = FieldValue<HTIE, 0U>;
using Enable = FieldValue<HTIE, 1U>;
};
// Transfer error interrupt enable
struct TEIE : RegisterField<SxCR, 2, 1, ReadWriteMode>
{
using Disable = FieldValue<TEIE, 0U>;
using Enable = FieldValue<TEIE, 1U>;
};
// Direct mode error interrupt enable
struct DMEIE : RegisterField<SxCR, 1, 1, ReadWriteMode>
{
using Disable = FieldValue<DMEIE, 0U>;
using Enable = FieldValue<DMEIE, 1U>;
};
// Stream enable / flag stream ready when read low
struct EN : RegisterField<SxCR, 0, 1, ReadWriteMode>
{
using Disable = FieldValue<EN, 0U>;
using Enable = FieldValue<EN, 1U>;
};
};
// stream x number of data register
struct S0NDTR : Register<0x40026414, ReadWriteMode, 0x0>
{
// Number of data items to transfer
struct NDT : RegisterField<S0NDTR, 0, 16, ReadWriteMode>
{
};
};
// stream x peripheral address register
struct S0PAR : Register<0x40026418, ReadWriteMode, 0x0>
{
// Peripheral address
struct PA : RegisterField<S0PAR, 0, 32, ReadWriteMode>
{
template<auto val, class = typename std::enable_if_t<(val >= 0 && val <= 4294967295)>>
using Address = FieldValue<PA, val>;
};
};
// stream x memory 0 address register
struct S0M0AR : Register<0x4002641c, ReadWriteMode, 0x0>
{
// Memory 0 address
struct M0A : RegisterField<S0M0AR, 0, 32, ReadWriteMode>
{
};
};
// stream x memory 1 address register
struct S0M1AR : Register<0x40026420, ReadWriteMode, 0x0>
{
// Memory 1 address (used in case of Double buffer mode)
struct M1A : RegisterField<S0M1AR, 0, 32, ReadWriteMode>
{
};
};
// stream x FIFO control register
struct S0FCR : Register<0x40026424, ReadWriteMode, 0x21>
{
// FIFO error interrupt enable
struct FEIE : RegisterField<S0FCR, 7, 1, ReadWriteMode>
{
};
// FIFO status
struct FS : RegisterField<S0FCR, 3, 3, ReadMode>
{
};
// Direct mode disable
struct DMDIS : RegisterField<S0FCR, 2, 1, ReadWriteMode>
{
};
// FIFO threshold selection
struct FTH : RegisterField<S0FCR, 0, 2, ReadWriteMode>
{
};
};
// stream x configuration register
struct S1CR : Register<0x40026428, ReadWriteMode, 0x0>
{
// Channel selection
struct CHSEL : RegisterField<S1CR, 25, 3, ReadWriteMode>
{
};
// Memory burst transfer configuration
struct MBURST : RegisterField<S1CR, 23, 2, ReadWriteMode>
{
};
// Peripheral burst transfer configuration
struct PBURST : RegisterField<S1CR, 21, 2, ReadWriteMode>
{
};
// ACK
struct ACK : RegisterField<S1CR, 20, 1, ReadWriteMode>
{
};
// Current target (only in double buffer mode)
struct CT : RegisterField<S1CR, 19, 1, ReadWriteMode>
{
};
// Double buffer mode
struct DBM : RegisterField<S1CR, 18, 1, ReadWriteMode>
{
};
// Priority level
struct PL : RegisterField<S1CR, 16, 2, ReadWriteMode>
{
};
// Peripheral increment offset size
struct PINCOS : RegisterField<S1CR, 15, 1, ReadWriteMode>
{
};
// Memory data size
struct MSIZE : RegisterField<S1CR, 13, 2, ReadWriteMode>
{
};
// Peripheral data size
struct PSIZE : RegisterField<S1CR, 11, 2, ReadWriteMode>
{
};
// Memory increment mode
struct MINC : RegisterField<S1CR, 10, 1, ReadWriteMode>
{
};
// Peripheral increment mode
struct PINC : RegisterField<S1CR, 9, 1, ReadWriteMode>
{
};
// Circular mode
struct CIRC : RegisterField<S1CR, 8, 1, ReadWriteMode>
{
};
// Data transfer direction
struct DIR : RegisterField<S1CR, 6, 2, ReadWriteMode>
{
};
// Peripheral flow controller
struct PFCTRL : RegisterField<S1CR, 5, 1, ReadWriteMode>
{
};
// Transfer complete interrupt enable
struct TCIE : RegisterField<S1CR, 4, 1, ReadWriteMode>
{
};
// Half transfer interrupt enable
struct HTIE : RegisterField<S1CR, 3, 1, ReadWriteMode>
{
};
// Transfer error interrupt enable
struct TEIE : RegisterField<S1CR, 2, 1, ReadWriteMode>
{
};
// Direct mode error interrupt enable
struct DMEIE : RegisterField<S1CR, 1, 1, ReadWriteMode>
{
};
// Stream enable / flag stream ready when read low
struct EN : RegisterField<S1CR, 0, 1, ReadWriteMode>
{
};
};
// stream x number of data register
struct S1NDTR : Register<0x4002642c, ReadWriteMode, 0x0>
{
// Number of data items to transfer
struct NDT : RegisterField<S1NDTR, 0, 16, ReadWriteMode>
{
};
};
// stream x peripheral address register
struct S1PAR : Register<0x40026430, ReadWriteMode, 0x0>
{
// Peripheral address
struct PA : RegisterField<S1PAR, 0, 32, ReadWriteMode>
{
};
};
// stream x memory 0 address register
struct S1M0AR : Register<0x40026434, ReadWriteMode, 0x0>
{
// Memory 0 address
struct M0A : RegisterField<S1M0AR, 0, 32, ReadWriteMode>
{
};
};
// stream x memory 1 address register
struct S1M1AR : Register<0x40026438, ReadWriteMode, 0x0>
{
// Memory 1 address (used in case of Double buffer mode)
struct M1A : RegisterField<S1M1AR, 0, 32, ReadWriteMode>
{
};
};
// stream x FIFO control register
struct S1FCR : Register<0x4002643c, ReadWriteMode, 0x21>
{
// FIFO error interrupt enable
struct FEIE : RegisterField<S1FCR, 7, 1, ReadWriteMode>
{
};
// FIFO status
struct FS : RegisterField<S1FCR, 3, 3, ReadMode>
{
};
// Direct mode disable
struct DMDIS : RegisterField<S1FCR, 2, 1, ReadWriteMode>
{
};
// FIFO threshold selection
struct FTH : RegisterField<S1FCR, 0, 2, ReadWriteMode>
{
};
};
// stream x configuration register
struct S2CR : Register<0x40026440, ReadWriteMode, 0x0>
{
// Channel selection
struct CHSEL : RegisterField<S2CR, 25, 3, ReadWriteMode>
{
};
// Memory burst transfer configuration
struct MBURST : RegisterField<S2CR, 23, 2, ReadWriteMode>
{
};
// Peripheral burst transfer configuration
struct PBURST : RegisterField<S2CR, 21, 2, ReadWriteMode>
{
};
// ACK
struct ACK : RegisterField<S2CR, 20, 1, ReadWriteMode>
{
};
// Current target (only in double buffer mode)
struct CT : RegisterField<S2CR, 19, 1, ReadWriteMode>
{
};
// Double buffer mode
struct DBM : RegisterField<S2CR, 18, 1, ReadWriteMode>
{
};
// Priority level
struct PL : RegisterField<S2CR, 16, 2, ReadWriteMode>
{
};
// Peripheral increment offset size
struct PINCOS : RegisterField<S2CR, 15, 1, ReadWriteMode>
{
};
// Memory data size
struct MSIZE : RegisterField<S2CR, 13, 2, ReadWriteMode>
{
};
// Peripheral data size
struct PSIZE : RegisterField<S2CR, 11, 2, ReadWriteMode>
{
};
// Memory increment mode
struct MINC : RegisterField<S2CR, 10, 1, ReadWriteMode>
{
};
// Peripheral increment mode
struct PINC : RegisterField<S2CR, 9, 1, ReadWriteMode>
{
};
// Circular mode
struct CIRC : RegisterField<S2CR, 8, 1, ReadWriteMode>
{
};
// Data transfer direction
struct DIR : RegisterField<S2CR, 6, 2, ReadWriteMode>
{
};
// Peripheral flow controller
struct PFCTRL : RegisterField<S2CR, 5, 1, ReadWriteMode>
{
};
// Transfer complete interrupt enable
struct TCIE : RegisterField<S2CR, 4, 1, ReadWriteMode>
{
};
// Half transfer interrupt enable
struct HTIE : RegisterField<S2CR, 3, 1, ReadWriteMode>
{
};
// Transfer error interrupt enable
struct TEIE : RegisterField<S2CR, 2, 1, ReadWriteMode>
{
};
// Direct mode error interrupt enable
struct DMEIE : RegisterField<S2CR, 1, 1, ReadWriteMode>
{
};
// Stream enable / flag stream ready when read low
struct EN : RegisterField<S2CR, 0, 1, ReadWriteMode>
{
};
};
// stream x number of data register
struct S2NDTR : Register<0x40026444, ReadWriteMode, 0x0>
{
// Number of data items to transfer
struct NDT : RegisterField<S2NDTR, 0, 16, ReadWriteMode>
{
};
};
// stream x peripheral address register
struct S2PAR : Register<0x40026448, ReadWriteMode, 0x0>
{
// Peripheral address
struct PA : RegisterField<S2PAR, 0, 32, ReadWriteMode>
{
};
};
// stream x memory 0 address register
struct S2M0AR : Register<0x4002644c, ReadWriteMode, 0x0>
{
// Memory 0 address
struct M0A : RegisterField<S2M0AR, 0, 32, ReadWriteMode>
{
};
};
// stream x memory 1 address register
struct S2M1AR : Register<0x40026450, ReadWriteMode, 0x0>
{
// Memory 1 address (used in case of Double buffer mode)
struct M1A : RegisterField<S2M1AR, 0, 32, ReadWriteMode>
{
};
};
// stream x FIFO control register
struct S2FCR : Register<0x40026454, ReadWriteMode, 0x21>
{
// FIFO error interrupt enable
struct FEIE : RegisterField<S2FCR, 7, 1, ReadWriteMode>
{
};
// FIFO status
struct FS : RegisterField<S2FCR, 3, 3, ReadMode>
{
};
// Direct mode disable
struct DMDIS : RegisterField<S2FCR, 2, 1, ReadWriteMode>
{
};
// FIFO threshold selection
struct FTH : RegisterField<S2FCR, 0, 2, ReadWriteMode>
{
};
};
// stream x configuration register
struct S3CR : Register<0x40026458, ReadWriteMode, 0x0>
{
// Channel selection
struct CHSEL : RegisterField<S3CR, 25, 3, ReadWriteMode>
{
};
// Memory burst transfer configuration
struct MBURST : RegisterField<S3CR, 23, 2, ReadWriteMode>
{
};
// Peripheral burst transfer configuration
struct PBURST : RegisterField<S3CR, 21, 2, ReadWriteMode>
{
};
// ACK
struct ACK : RegisterField<S3CR, 20, 1, ReadWriteMode>
{
};
// Current target (only in double buffer mode)
struct CT : RegisterField<S3CR, 19, 1, ReadWriteMode>
{
};
// Double buffer mode
struct DBM : RegisterField<S3CR, 18, 1, ReadWriteMode>
{
};
// Priority level
struct PL : RegisterField<S3CR, 16, 2, ReadWriteMode>
{
};
// Peripheral increment offset size
struct PINCOS : RegisterField<S3CR, 15, 1, ReadWriteMode>
{
};
// Memory data size
struct MSIZE : RegisterField<S3CR, 13, 2, ReadWriteMode>
{
};
// Peripheral data size
struct PSIZE : RegisterField<S3CR, 11, 2, ReadWriteMode>
{
};
// Memory increment mode
struct MINC : RegisterField<S3CR, 10, 1, ReadWriteMode>
{
};
// Peripheral increment mode
struct PINC : RegisterField<S3CR, 9, 1, ReadWriteMode>
{
};
// Circular mode
struct CIRC : RegisterField<S3CR, 8, 1, ReadWriteMode>
{
};
// Data transfer direction
struct DIR : RegisterField<S3CR, 6, 2, ReadWriteMode>
{
};
// Peripheral flow controller
struct PFCTRL : RegisterField<S3CR, 5, 1, ReadWriteMode>
{
};
// Transfer complete interrupt enable
struct TCIE : RegisterField<S3CR, 4, 1, ReadWriteMode>
{
};
// Half transfer interrupt enable
struct HTIE : RegisterField<S3CR, 3, 1, ReadWriteMode>
{
};
// Transfer error interrupt enable
struct TEIE : RegisterField<S3CR, 2, 1, ReadWriteMode>
{
};
// Direct mode error interrupt enable
struct DMEIE : RegisterField<S3CR, 1, 1, ReadWriteMode>
{
};
// Stream enable / flag stream ready when read low
struct EN : RegisterField<S3CR, 0, 1, ReadWriteMode>
{
};
};
// stream x number of data register
struct S3NDTR : Register<0x4002645c, ReadWriteMode, 0x0>
{
// Number of data items to transfer
struct NDT : RegisterField<S3NDTR, 0, 16, ReadWriteMode>
{
};
};
// stream x peripheral address register
struct S3PAR : Register<0x40026460, ReadWriteMode, 0x0>
{
// Peripheral address
struct PA : RegisterField<S3PAR, 0, 32, ReadWriteMode>
{
};
};
// stream x memory 0 address register
struct S3M0AR : Register<0x40026464, ReadWriteMode, 0x0>
{
// Memory 0 address
struct M0A : RegisterField<S3M0AR, 0, 32, ReadWriteMode>
{
};
};
// stream x memory 1 address register
struct S3M1AR : Register<0x40026468, ReadWriteMode, 0x0>
{
// Memory 1 address (used in case of Double buffer mode)
struct M1A : RegisterField<S3M1AR, 0, 32, ReadWriteMode>
{
};
};
// stream x FIFO control register
struct S3FCR : Register<0x4002646c, ReadWriteMode, 0x21>
{
// FIFO error interrupt enable
struct FEIE : RegisterField<S3FCR, 7, 1, ReadWriteMode>
{
};
// FIFO status
struct FS : RegisterField<S3FCR, 3, 3, ReadMode>
{
};
// Direct mode disable
struct DMDIS : RegisterField<S3FCR, 2, 1, ReadWriteMode>
{
};
// FIFO threshold selection
struct FTH : RegisterField<S3FCR, 0, 2, ReadWriteMode>
{
};
};
// stream x configuration register
struct S4CR : Register<0x40026470, ReadWriteMode, 0x0>
{
// Channel selection
struct CHSEL : RegisterField<S4CR, 25, 3, ReadWriteMode>
{
};
// Memory burst transfer configuration
struct MBURST : RegisterField<S4CR, 23, 2, ReadWriteMode>
{
};
// Peripheral burst transfer configuration
struct PBURST : RegisterField<S4CR, 21, 2, ReadWriteMode>
{
};
// ACK
struct ACK : RegisterField<S4CR, 20, 1, ReadWriteMode>
{
};
// Current target (only in double buffer mode)
struct CT : RegisterField<S4CR, 19, 1, ReadWriteMode>
{
};
// Double buffer mode
struct DBM : RegisterField<S4CR, 18, 1, ReadWriteMode>
{
};
// Priority level
struct PL : RegisterField<S4CR, 16, 2, ReadWriteMode>
{
};
// Peripheral increment offset size
struct PINCOS : RegisterField<S4CR, 15, 1, ReadWriteMode>
{
};
// Memory data size
struct MSIZE : RegisterField<S4CR, 13, 2, ReadWriteMode>
{
};
// Peripheral data size
struct PSIZE : RegisterField<S4CR, 11, 2, ReadWriteMode>
{
};
// Memory increment mode
struct MINC : RegisterField<S4CR, 10, 1, ReadWriteMode>
{
};
// Peripheral increment mode
struct PINC : RegisterField<S4CR, 9, 1, ReadWriteMode>
{
};
// Circular mode
struct CIRC : RegisterField<S4CR, 8, 1, ReadWriteMode>
{
};
// Data transfer direction
struct DIR : RegisterField<S4CR, 6, 2, ReadWriteMode>
{
};
// Peripheral flow controller
struct PFCTRL : RegisterField<S4CR, 5, 1, ReadWriteMode>
{
};
// Transfer complete interrupt enable
struct TCIE : RegisterField<S4CR, 4, 1, ReadWriteMode>
{
};
// Half transfer interrupt enable
struct HTIE : RegisterField<S4CR, 3, 1, ReadWriteMode>
{
};
// Transfer error interrupt enable
struct TEIE : RegisterField<S4CR, 2, 1, ReadWriteMode>
{
};
// Direct mode error interrupt enable
struct DMEIE : RegisterField<S4CR, 1, 1, ReadWriteMode>
{
};
// Stream enable / flag stream ready when read low
struct EN : RegisterField<S4CR, 0, 1, ReadWriteMode>
{
};
};
// stream x number of data register
struct S4NDTR : Register<0x40026474, ReadWriteMode, 0x0>
{
// Number of data items to transfer
struct NDT : RegisterField<S4NDTR, 0, 16, ReadWriteMode>
{
};
};
// stream x peripheral address register
struct S4PAR : Register<0x40026478, ReadWriteMode, 0x0>
{
// Peripheral address
struct PA : RegisterField<S4PAR, 0, 32, ReadWriteMode>
{
};
};
// stream x memory 0 address register
struct S4M0AR : Register<0x4002647c, ReadWriteMode, 0x0>
{
// Memory 0 address
struct M0A : RegisterField<S4M0AR, 0, 32, ReadWriteMode>
{
};
};
// stream x memory 1 address register
struct S4M1AR : Register<0x40026480, ReadWriteMode, 0x0>
{
// Memory 1 address (used in case of Double buffer mode)
struct M1A : RegisterField<S4M1AR, 0, 32, ReadWriteMode>
{
};
};
// stream x FIFO control register
struct S4FCR : Register<0x40026484, ReadWriteMode, 0x21>
{
// FIFO error interrupt enable
struct FEIE : RegisterField<S4FCR, 7, 1, ReadWriteMode>
{
};
// FIFO status
struct FS : RegisterField<S4FCR, 3, 3, ReadMode>
{
};
// Direct mode disable
struct DMDIS : RegisterField<S4FCR, 2, 1, ReadWriteMode>
{
};
// FIFO threshold selection
struct FTH : RegisterField<S4FCR, 0, 2, ReadWriteMode>
{
};
};
// stream x configuration register
struct S5CR : Register<0x40026488, ReadWriteMode, 0x0>
{
// Channel selection
struct CHSEL : RegisterField<S5CR, 25, 3, ReadWriteMode>
{
};
// Memory burst transfer configuration
struct MBURST : RegisterField<S5CR, 23, 2, ReadWriteMode>
{
};
// Peripheral burst transfer configuration
struct PBURST : RegisterField<S5CR, 21, 2, ReadWriteMode>
{
};
// ACK
struct ACK : RegisterField<S5CR, 20, 1, ReadWriteMode>
{
};
// Current target (only in double buffer mode)
struct CT : RegisterField<S5CR, 19, 1, ReadWriteMode>
{
};
// Double buffer mode
struct DBM : RegisterField<S5CR, 18, 1, ReadWriteMode>
{
};
// Priority level
struct PL : RegisterField<S5CR, 16, 2, ReadWriteMode>
{
};
// Peripheral increment offset size
struct PINCOS : RegisterField<S5CR, 15, 1, ReadWriteMode>
{
};
// Memory data size
struct MSIZE : RegisterField<S5CR, 13, 2, ReadWriteMode>
{
};
// Peripheral data size
struct PSIZE : RegisterField<S5CR, 11, 2, ReadWriteMode>
{
};
// Memory increment mode
struct MINC : RegisterField<S5CR, 10, 1, ReadWriteMode>
{
};
// Peripheral increment mode
struct PINC : RegisterField<S5CR, 9, 1, ReadWriteMode>
{
};
// Circular mode
struct CIRC : RegisterField<S5CR, 8, 1, ReadWriteMode>
{
};
// Data transfer direction
struct DIR : RegisterField<S5CR, 6, 2, ReadWriteMode>
{
};
// Peripheral flow controller
struct PFCTRL : RegisterField<S5CR, 5, 1, ReadWriteMode>
{
};
// Transfer complete interrupt enable
struct TCIE : RegisterField<S5CR, 4, 1, ReadWriteMode>
{
};
// Half transfer interrupt enable
struct HTIE : RegisterField<S5CR, 3, 1, ReadWriteMode>
{
};
// Transfer error interrupt enable
struct TEIE : RegisterField<S5CR, 2, 1, ReadWriteMode>
{
};
// Direct mode error interrupt enable
struct DMEIE : RegisterField<S5CR, 1, 1, ReadWriteMode>
{
};
// Stream enable / flag stream ready when read low
struct EN : RegisterField<S5CR, 0, 1, ReadWriteMode>
{
};
};
// stream x number of data register
struct S5NDTR : Register<0x4002648c, ReadWriteMode, 0x0>
{
// Number of data items to transfer
struct NDT : RegisterField<S5NDTR, 0, 16, ReadWriteMode>
{
};
};
// stream x peripheral address register
struct S5PAR : Register<0x40026490, ReadWriteMode, 0x0>
{
// Peripheral address
struct PA : RegisterField<S5PAR, 0, 32, ReadWriteMode>
{
};
};
// stream x memory 0 address register
struct S5M0AR : Register<0x40026494, ReadWriteMode, 0x0>
{
// Memory 0 address
struct M0A : RegisterField<S5M0AR, 0, 32, ReadWriteMode>
{
};
};
// stream x memory 1 address register
struct S5M1AR : Register<0x40026498, ReadWriteMode, 0x0>
{
// Memory 1 address (used in case of Double buffer mode)
struct M1A : RegisterField<S5M1AR, 0, 32, ReadWriteMode>
{
};
};
// stream x FIFO control register
struct S5FCR : Register<0x4002649c, ReadWriteMode, 0x21>
{
// FIFO error interrupt enable
struct FEIE : RegisterField<S5FCR, 7, 1, ReadWriteMode>
{
};
// FIFO status
struct FS : RegisterField<S5FCR, 3, 3, ReadMode>
{
};
// Direct mode disable
struct DMDIS : RegisterField<S5FCR, 2, 1, ReadWriteMode>
{
};
// FIFO threshold selection
struct FTH : RegisterField<S5FCR, 0, 2, ReadWriteMode>
{
};
};
// stream x configuration register
struct S6CR : Register<0x400264a0, ReadWriteMode, 0x0>
{
// Channel selection
struct CHSEL : RegisterField<S6CR, 25, 3, ReadWriteMode>
{
};
// Memory burst transfer configuration
struct MBURST : RegisterField<S6CR, 23, 2, ReadWriteMode>
{
};
// Peripheral burst transfer configuration
struct PBURST : RegisterField<S6CR, 21, 2, ReadWriteMode>
{
};
// ACK
struct ACK : RegisterField<S6CR, 20, 1, ReadWriteMode>
{
};
// Current target (only in double buffer mode)
struct CT : RegisterField<S6CR, 19, 1, ReadWriteMode>
{
};
// Double buffer mode
struct DBM : RegisterField<S6CR, 18, 1, ReadWriteMode>
{
};
// Priority level
struct PL : RegisterField<S6CR, 16, 2, ReadWriteMode>
{
};
// Peripheral increment offset size
struct PINCOS : RegisterField<S6CR, 15, 1, ReadWriteMode>
{
};
// Memory data size
struct MSIZE : RegisterField<S6CR, 13, 2, ReadWriteMode>
{
};
// Peripheral data size
struct PSIZE : RegisterField<S6CR, 11, 2, ReadWriteMode>
{
};
// Memory increment mode
struct MINC : RegisterField<S6CR, 10, 1, ReadWriteMode>
{
};
// Peripheral increment mode
struct PINC : RegisterField<S6CR, 9, 1, ReadWriteMode>
{
};
// Circular mode
struct CIRC : RegisterField<S6CR, 8, 1, ReadWriteMode>
{
};
// Data transfer direction
struct DIR : RegisterField<S6CR, 6, 2, ReadWriteMode>
{
};
// Peripheral flow controller
struct PFCTRL : RegisterField<S6CR, 5, 1, ReadWriteMode>
{
};
// Transfer complete interrupt enable
struct TCIE : RegisterField<S6CR, 4, 1, ReadWriteMode>
{
};
// Half transfer interrupt enable
struct HTIE : RegisterField<S6CR, 3, 1, ReadWriteMode>
{
};
// Transfer error interrupt enable
struct TEIE : RegisterField<S6CR, 2, 1, ReadWriteMode>
{
};
// Direct mode error interrupt enable
struct DMEIE : RegisterField<S6CR, 1, 1, ReadWriteMode>
{
};
// Stream enable / flag stream ready when read low
struct EN : RegisterField<S6CR, 0, 1, ReadWriteMode>
{
};
};
// stream x number of data register
struct S6NDTR : Register<0x400264a4, ReadWriteMode, 0x0>
{
// Number of data items to transfer
struct NDT : RegisterField<S6NDTR, 0, 16, ReadWriteMode>
{
};
};
// stream x peripheral address register
struct S6PAR : Register<0x400264a8, ReadWriteMode, 0x0>
{
// Peripheral address
struct PA : RegisterField<S6PAR, 0, 32, ReadWriteMode>
{
};
};
// stream x memory 0 address register
struct S6M0AR : Register<0x400264ac, ReadWriteMode, 0x0>
{
// Memory 0 address
struct M0A : RegisterField<S6M0AR, 0, 32, ReadWriteMode>
{
};
};
// stream x memory 1 address register
struct S6M1AR : Register<0x400264b0, ReadWriteMode, 0x0>
{
// Memory 1 address (used in case of Double buffer mode)
struct M1A : RegisterField<S6M1AR, 0, 32, ReadWriteMode>
{
};
};
// stream x FIFO control register
struct S6FCR : Register<0x400264b4, ReadWriteMode, 0x21>
{
// FIFO error interrupt enable
struct FEIE : RegisterField<S6FCR, 7, 1, ReadWriteMode>
{
};
// FIFO status
struct FS : RegisterField<S6FCR, 3, 3, ReadMode>
{
};
// Direct mode disable
struct DMDIS : RegisterField<S6FCR, 2, 1, ReadWriteMode>
{
};
// FIFO threshold selection
struct FTH : RegisterField<S6FCR, 0, 2, ReadWriteMode>
{
};
};
// stream x configuration register
struct S7CR : Register<0x400264b8, ReadWriteMode, 0x0>
{
// Channel selection
struct CHSEL : RegisterField<S7CR, 25, 3, ReadWriteMode>
{
};
// Memory burst transfer configuration
struct MBURST : RegisterField<S7CR, 23, 2, ReadWriteMode>
{
};
// Peripheral burst transfer configuration
struct PBURST : RegisterField<S7CR, 21, 2, ReadWriteMode>
{
};
// ACK
struct ACK : RegisterField<S7CR, 20, 1, ReadWriteMode>
{
};
// Current target (only in double buffer mode)
struct CT : RegisterField<S7CR, 19, 1, ReadWriteMode>
{
};
// Double buffer mode
struct DBM : RegisterField<S7CR, 18, 1, ReadWriteMode>
{
};
// Priority level
struct PL : RegisterField<S7CR, 16, 2, ReadWriteMode>
{
};
// Peripheral increment offset size
struct PINCOS : RegisterField<S7CR, 15, 1, ReadWriteMode>
{
};
// Memory data size
struct MSIZE : RegisterField<S7CR, 13, 2, ReadWriteMode>
{
};
// Peripheral data size
struct PSIZE : RegisterField<S7CR, 11, 2, ReadWriteMode>
{
};
// Memory increment mode
struct MINC : RegisterField<S7CR, 10, 1, ReadWriteMode>
{
};
// Peripheral increment mode
struct PINC : RegisterField<S7CR, 9, 1, ReadWriteMode>
{
};
// Circular mode
struct CIRC : RegisterField<S7CR, 8, 1, ReadWriteMode>
{
};
// Data transfer direction
struct DIR : RegisterField<S7CR, 6, 2, ReadWriteMode>
{
};
// Peripheral flow controller
struct PFCTRL : RegisterField<S7CR, 5, 1, ReadWriteMode>
{
};
// Transfer complete interrupt enable
struct TCIE : RegisterField<S7CR, 4, 1, ReadWriteMode>
{
};
// Half transfer interrupt enable
struct HTIE : RegisterField<S7CR, 3, 1, ReadWriteMode>
{
};
// Transfer error interrupt enable
struct TEIE : RegisterField<S7CR, 2, 1, ReadWriteMode>
{
};
// Direct mode error interrupt enable
struct DMEIE : RegisterField<S7CR, 1, 1, ReadWriteMode>
{
};
// Stream enable / flag stream ready when read low
struct EN : RegisterField<S7CR, 0, 1, ReadWriteMode>
{
};
};
// stream x number of data register
struct S7NDTR : Register<0x400264bc, ReadWriteMode, 0x0>
{
// Number of data items to transfer
struct NDT : RegisterField<S7NDTR, 0, 16, ReadWriteMode>
{
};
};
// stream x peripheral address register
struct S7PAR : Register<0x400264c0, ReadWriteMode, 0x0>
{
// Peripheral address
struct PA : RegisterField<S7PAR, 0, 32, ReadWriteMode>
{
};
};
// stream x memory 0 address register
struct S7M0AR : Register<0x400264c4, ReadWriteMode, 0x0>
{
// Memory 0 address
struct M0A : RegisterField<S7M0AR, 0, 32, ReadWriteMode>
{
};
};
// stream x memory 1 address register
struct S7M1AR : Register<0x400264c8, ReadWriteMode, 0x0>
{
// Memory 1 address (used in case of Double buffer mode)
struct M1A : RegisterField<S7M1AR, 0, 32, ReadWriteMode>
{
};
};
// stream x FIFO control register
struct S7FCR : Register<0x400264cc, ReadWriteMode, 0x21>
{
// FIFO error interrupt enable
struct FEIE : RegisterField<S7FCR, 7, 1, ReadWriteMode>
{
};
// FIFO status
struct FS : RegisterField<S7FCR, 3, 3, ReadMode>
{
};
// Direct mode disable
struct DMDIS : RegisterField<S7FCR, 2, 1, ReadWriteMode>
{
};
// FIFO threshold selection
struct FTH : RegisterField<S7FCR, 0, 2, ReadWriteMode>
{
};
};
// Large Registers
// low interrupt status register
template<auto num>
struct ISR_FEIF : RegisterField<Register<0x40026400 + 4 * (num / 4), ReadMode, 0x21>, 0 + (6 * (num%4) + 4 * ((num%4) == 2)), 8, ReadMode>
{
};
// low interrupt status register
template<auto num>
struct ISR_DMEIF : RegisterField<Register<0x40026400 + 4 * (num / 4), ReadMode, 0x21>, 2 + (6 * (num%4) + 4 * ((num%4) == 2)), 8, ReadMode>
{
};
// low interrupt status register
template<auto num>
struct ISR_TEIF : RegisterField<Register<0x40026400 + 4 * (num / 4), ReadMode, 0x21>, 3 + (6 * (num%4) + 4 * ((num%4) == 2)), 8, ReadMode>
{
};
// low interrupt status register
template<auto num>
struct ISR_HTIF : RegisterField<Register<0x40026400 + 4 * (num / 4), ReadMode, 0x21>, 4 + (6 * (num%4) + 4 * ((num%4) == 2)), 8, ReadMode>
{
};
// low interrupt status register
template<auto num>
struct ISR_TCIF : RegisterField<Register<0x40026400 + 4 * (num / 4), ReadMode, 0x21>, 5 + (6 * (num%4) + 4 * ((num%4) == 2)), 8, ReadMode>
{
};
// low interrupt flag clear register
template<auto num>
struct IFCR_CFEIF : RegisterField<Register<0x40026408 + 4 * (num / 4), ReadWriteMode, 0x21>, 0 + (6 * (num%4) + 4 * ((num%4) == 2)), 8, ReadWriteMode>
{
};
// low interrupt flag clear register
template<auto num>
struct IFCR_CDMEIF : RegisterField<Register<0x40026408 + 4 * (num / 4), ReadWriteMode, 0x21>, 2 + (6 * (num%4) + 4 * ((num%4) == 2)), 8, ReadWriteMode>
{
};
// low interrupt flag clear register
template<auto num>
struct IFCR_CTEIF : RegisterField<Register<0x40026408 + 4 * (num / 4), ReadWriteMode, 0x21>, 3 + (6 * (num%4) + 4 * ((num%4) == 2)), 8, ReadWriteMode>
{
};
// low interrupt flag clear register
template<auto num>
struct IFCR_CHTIF : RegisterField<Register<0x40026408 + 4 * (num / 4), ReadWriteMode, 0x21>, 4 + (6 * (num%4) + 4 * ((num%4) == 2)), 8, ReadWriteMode>
{
};
// low interrupt flag clear register
template<auto num>
struct IFCR_CTCIF : RegisterField<Register<0x40026408 + 4 * (num / 4), ReadWriteMode, 0x21>, 5 + (6 * (num%4) + 4 * ((num%4) == 2)), 8, ReadWriteMode>
{
};
// stream x number of data register
template<auto num>
struct SxNDTR : RegisterField<Register<0x40026414 + 24 * (num / 1), ReadWriteMode, 0x21>, 16 * (num % 1), 16, ReadWriteMode>
{
};
// stream x peripheral address register
template<auto num>
struct SxPAR : RegisterField<Register<0x40026418 + 24 * (num / 1), ReadWriteMode, 0x21>, 32 * (num % 1), 32, ReadWriteMode>
{
template<auto val, class = typename std::enable_if_t<(val >= 0 && val <= 4294967295)>>
using Address = FieldValue<SxPAR, val>;
};
// stream x memory 0 address register
template<auto num>
struct SxM0AR : RegisterField<Register<0x4002641c + 24 * (num / 1), ReadWriteMode, 0x21>, 32 * (num % 1), 32, ReadWriteMode>
{
};
// stream x memory 1 address register
template<auto num>
struct SxM1AR : RegisterField<Register<0x40026420 + 24 * (num / 1), ReadWriteMode, 0x21>, 32 * (num % 1), 32, ReadWriteMode>
{
};
};
struct DMA1
{
static constexpr auto periphNum = 1;
// low interrupt status register
struct LISR : Register<0x40026000, ReadMode, 0x0>
{
// Stream x transfer complete interrupt flag (x = 3..0)
struct TCIF3 : RegisterField<LISR, 27, 1, ReadMode>
{
};
// Stream x half transfer interrupt flag (x=3..0)
struct HTIF3 : RegisterField<LISR, 26, 1, ReadMode>
{
};
// Stream x transfer error interrupt flag (x=3..0)
struct TEIF3 : RegisterField<LISR, 25, 1, ReadMode>
{
};
// Stream x direct mode error interrupt flag (x=3..0)
struct DMEIF3 : RegisterField<LISR, 24, 1, ReadMode>
{
};
// Stream x FIFO error interrupt flag (x=3..0)
struct FEIF3 : RegisterField<LISR, 22, 1, ReadMode>
{
};
// Stream x transfer complete interrupt flag (x = 3..0)
struct TCIF2 : RegisterField<LISR, 21, 1, ReadMode>
{
};
// Stream x half transfer interrupt flag (x=3..0)
struct HTIF2 : RegisterField<LISR, 20, 1, ReadMode>
{
};
// Stream x transfer error interrupt flag (x=3..0)
struct TEIF2 : RegisterField<LISR, 19, 1, ReadMode>
{
};
// Stream x direct mode error interrupt flag (x=3..0)
struct DMEIF2 : RegisterField<LISR, 18, 1, ReadMode>
{
};
// Stream x FIFO error interrupt flag (x=3..0)
struct FEIF2 : RegisterField<LISR, 16, 1, ReadMode>
{
};
// Stream x transfer complete interrupt flag (x = 3..0)
struct TCIF1 : RegisterField<LISR, 11, 1, ReadMode>
{
};
// Stream x half transfer interrupt flag (x=3..0)
struct HTIF1 : RegisterField<LISR, 10, 1, ReadMode>
{
};
// Stream x transfer error interrupt flag (x=3..0)
struct TEIF1 : RegisterField<LISR, 9, 1, ReadMode>
{
};
// Stream x direct mode error interrupt flag (x=3..0)
struct DMEIF1 : RegisterField<LISR, 8, 1, ReadMode>
{
};
// Stream x FIFO error interrupt flag (x=3..0)
struct FEIF1 : RegisterField<LISR, 6, 1, ReadMode>
{
};
// Stream x transfer complete interrupt flag (x = 3..0)
struct TCIF0 : RegisterField<LISR, 5, 1, ReadMode>
{
};
// Stream x half transfer interrupt flag (x=3..0)
struct HTIF0 : RegisterField<LISR, 4, 1, ReadMode>
{
};
// Stream x transfer error interrupt flag (x=3..0)
struct TEIF0 : RegisterField<LISR, 3, 1, ReadMode>
{
};
// Stream x direct mode error interrupt flag (x=3..0)
struct DMEIF0 : RegisterField<LISR, 2, 1, ReadMode>
{
};
// Stream x FIFO error interrupt flag (x=3..0)
struct FEIF0 : RegisterField<LISR, 0, 1, ReadMode>
{
};
};
// high interrupt status register
struct HISR : Register<0x40026004, ReadMode, 0x0>
{
// Stream x transfer complete interrupt flag (x=7..4)
struct TCIF7 : RegisterField<HISR, 27, 1, ReadMode>
{
};
// Stream x half transfer interrupt flag (x=7..4)
struct HTIF7 : RegisterField<HISR, 26, 1, ReadMode>
{
};
// Stream x transfer error interrupt flag (x=7..4)
struct TEIF7 : RegisterField<HISR, 25, 1, ReadMode>
{
};
// Stream x direct mode error interrupt flag (x=7..4)
struct DMEIF7 : RegisterField<HISR, 24, 1, ReadMode>
{
};
// Stream x FIFO error interrupt flag (x=7..4)
struct FEIF7 : RegisterField<HISR, 22, 1, ReadMode>
{
};
// Stream x transfer complete interrupt flag (x=7..4)
struct TCIF6 : RegisterField<HISR, 21, 1, ReadMode>
{
};
// Stream x half transfer interrupt flag (x=7..4)
struct HTIF6 : RegisterField<HISR, 20, 1, ReadMode>
{
};
// Stream x transfer error interrupt flag (x=7..4)
struct TEIF6 : RegisterField<HISR, 19, 1, ReadMode>
{
};
// Stream x direct mode error interrupt flag (x=7..4)
struct DMEIF6 : RegisterField<HISR, 18, 1, ReadMode>
{
};
// Stream x FIFO error interrupt flag (x=7..4)
struct FEIF6 : RegisterField<HISR, 16, 1, ReadMode>
{
};
// Stream x transfer complete interrupt flag (x=7..4)
struct TCIF5 : RegisterField<HISR, 11, 1, ReadMode>
{
};
// Stream x half transfer interrupt flag (x=7..4)
struct HTIF5 : RegisterField<HISR, 10, 1, ReadMode>
{
};
// Stream x transfer error interrupt flag (x=7..4)
struct TEIF5 : RegisterField<HISR, 9, 1, ReadMode>
{
};
// Stream x direct mode error interrupt flag (x=7..4)
struct DMEIF5 : RegisterField<HISR, 8, 1, ReadMode>
{
};
// Stream x FIFO error interrupt flag (x=7..4)
struct FEIF5 : RegisterField<HISR, 6, 1, ReadMode>
{
};
// Stream x transfer complete interrupt flag (x=7..4)
struct TCIF4 : RegisterField<HISR, 5, 1, ReadMode>
{
};
// Stream x half transfer interrupt flag (x=7..4)
struct HTIF4 : RegisterField<HISR, 4, 1, ReadMode>
{
};
// Stream x transfer error interrupt flag (x=7..4)
struct TEIF4 : RegisterField<HISR, 3, 1, ReadMode>
{
};
// Stream x direct mode error interrupt flag (x=7..4)
struct DMEIF4 : RegisterField<HISR, 2, 1, ReadMode>
{
};
// Stream x FIFO error interrupt flag (x=7..4)
struct FEIF4 : RegisterField<HISR, 0, 1, ReadMode>
{
};
};
// low interrupt flag clear register
struct LIFCR : Register<0x40026008, ReadWriteMode, 0x0>
{
// Stream x clear transfer complete interrupt flag (x = 3..0)
struct CTCIF3 : RegisterField<LIFCR, 27, 1, ReadWriteMode>
{
};
// Stream x clear half transfer interrupt flag (x = 3..0)
struct CHTIF3 : RegisterField<LIFCR, 26, 1, ReadWriteMode>
{
};
// Stream x clear transfer error interrupt flag (x = 3..0)
struct CTEIF3 : RegisterField<LIFCR, 25, 1, ReadWriteMode>
{
};
// Stream x clear direct mode error interrupt flag (x = 3..0)
struct CDMEIF3 : RegisterField<LIFCR, 24, 1, ReadWriteMode>
{
};
// Stream x clear FIFO error interrupt flag (x = 3..0)
struct CFEIF3 : RegisterField<LIFCR, 22, 1, ReadWriteMode>
{
};
// Stream x clear transfer complete interrupt flag (x = 3..0)
struct CTCIF2 : RegisterField<LIFCR, 21, 1, ReadWriteMode>
{
};
// Stream x clear half transfer interrupt flag (x = 3..0)
struct CHTIF2 : RegisterField<LIFCR, 20, 1, ReadWriteMode>
{
};
// Stream x clear transfer error interrupt flag (x = 3..0)
struct CTEIF2 : RegisterField<LIFCR, 19, 1, ReadWriteMode>
{
};
// Stream x clear direct mode error interrupt flag (x = 3..0)
struct CDMEIF2 : RegisterField<LIFCR, 18, 1, ReadWriteMode>
{
};
// Stream x clear FIFO error interrupt flag (x = 3..0)
struct CFEIF2 : RegisterField<LIFCR, 16, 1, ReadWriteMode>
{
};
// Stream x clear transfer complete interrupt flag (x = 3..0)
struct CTCIF1 : RegisterField<LIFCR, 11, 1, ReadWriteMode>
{
};
// Stream x clear half transfer interrupt flag (x = 3..0)
struct CHTIF1 : RegisterField<LIFCR, 10, 1, ReadWriteMode>
{
};
// Stream x clear transfer error interrupt flag (x = 3..0)
struct CTEIF1 : RegisterField<LIFCR, 9, 1, ReadWriteMode>
{
};
// Stream x clear direct mode error interrupt flag (x = 3..0)
struct CDMEIF1 : RegisterField<LIFCR, 8, 1, ReadWriteMode>
{
};
// Stream x clear FIFO error interrupt flag (x = 3..0)
struct CFEIF1 : RegisterField<LIFCR, 6, 1, ReadWriteMode>
{
};
// Stream x clear transfer complete interrupt flag (x = 3..0)
struct CTCIF0 : RegisterField<LIFCR, 5, 1, ReadWriteMode>
{
};
// Stream x clear half transfer interrupt flag (x = 3..0)
struct CHTIF0 : RegisterField<LIFCR, 4, 1, ReadWriteMode>
{
};
// Stream x clear transfer error interrupt flag (x = 3..0)
struct CTEIF0 : RegisterField<LIFCR, 3, 1, ReadWriteMode>
{
};
// Stream x clear direct mode error interrupt flag (x = 3..0)
struct CDMEIF0 : RegisterField<LIFCR, 2, 1, ReadWriteMode>
{
};
// Stream x clear FIFO error interrupt flag (x = 3..0)
struct CFEIF0 : RegisterField<LIFCR, 0, 1, ReadWriteMode>
{
};
};
// high interrupt flag clear register
struct HIFCR : Register<0x4002600c, ReadWriteMode, 0x0>
{
// Stream x clear transfer complete interrupt flag (x = 7..4)
struct CTCIF7 : RegisterField<HIFCR, 27, 1, ReadWriteMode>
{
};
// Stream x clear half transfer interrupt flag (x = 7..4)
struct CHTIF7 : RegisterField<HIFCR, 26, 1, ReadWriteMode>
{
};
// Stream x clear transfer error interrupt flag (x = 7..4)
struct CTEIF7 : RegisterField<HIFCR, 25, 1, ReadWriteMode>
{
};
// Stream x clear direct mode error interrupt flag (x = 7..4)
struct CDMEIF7 : RegisterField<HIFCR, 24, 1, ReadWriteMode>
{
};
// Stream x clear FIFO error interrupt flag (x = 7..4)
struct CFEIF7 : RegisterField<HIFCR, 22, 1, ReadWriteMode>
{
};
// Stream x clear transfer complete interrupt flag (x = 7..4)
struct CTCIF6 : RegisterField<HIFCR, 21, 1, ReadWriteMode>
{
};
// Stream x clear half transfer interrupt flag (x = 7..4)
struct CHTIF6 : RegisterField<HIFCR, 20, 1, ReadWriteMode>
{
};
// Stream x clear transfer error interrupt flag (x = 7..4)
struct CTEIF6 : RegisterField<HIFCR, 19, 1, ReadWriteMode>
{
};
// Stream x clear direct mode error interrupt flag (x = 7..4)
struct CDMEIF6 : RegisterField<HIFCR, 18, 1, ReadWriteMode>
{
};
// Stream x clear FIFO error interrupt flag (x = 7..4)
struct CFEIF6 : RegisterField<HIFCR, 16, 1, ReadWriteMode>
{
};
// Stream x clear transfer complete interrupt flag (x = 7..4)
struct CTCIF5 : RegisterField<HIFCR, 11, 1, ReadWriteMode>
{
};
// Stream x clear half transfer interrupt flag (x = 7..4)
struct CHTIF5 : RegisterField<HIFCR, 10, 1, ReadWriteMode>
{
};
// Stream x clear transfer error interrupt flag (x = 7..4)
struct CTEIF5 : RegisterField<HIFCR, 9, 1, ReadWriteMode>
{
};
// Stream x clear direct mode error interrupt flag (x = 7..4)
struct CDMEIF5 : RegisterField<HIFCR, 8, 1, ReadWriteMode>
{
};
// Stream x clear FIFO error interrupt flag (x = 7..4)
struct CFEIF5 : RegisterField<HIFCR, 6, 1, ReadWriteMode>
{
};
// Stream x clear transfer complete interrupt flag (x = 7..4)
struct CTCIF4 : RegisterField<HIFCR, 5, 1, ReadWriteMode>
{
};
// Stream x clear half transfer interrupt flag (x = 7..4)
struct CHTIF4 : RegisterField<HIFCR, 4, 1, ReadWriteMode>
{
};
// Stream x clear transfer error interrupt flag (x = 7..4)
struct CTEIF4 : RegisterField<HIFCR, 3, 1, ReadWriteMode>
{
};
// Stream x clear direct mode error interrupt flag (x = 7..4)
struct CDMEIF4 : RegisterField<HIFCR, 2, 1, ReadWriteMode>
{
};
// Stream x clear FIFO error interrupt flag (x = 7..4)
struct CFEIF4 : RegisterField<HIFCR, 0, 1, ReadWriteMode>
{
};
};
// stream x configuration register
struct S0CR : Register<0x40026010, ReadWriteMode, 0x0>
{
// Channel selection
struct CHSEL : RegisterField<S0CR, 25, 3, ReadWriteMode>
{
template<auto val, class = typename std::enable_if_t<(val >= 0 && val <= 7)>>
using Channel = FieldValue<CHSEL, val>;
};
// Memory burst transfer configuration
struct MBURST : RegisterField<S0CR, 23, 2, ReadWriteMode>
{
};
// Peripheral burst transfer configuration
struct PBURST : RegisterField<S0CR, 21, 2, ReadWriteMode>
{
};
// Current target (only in double buffer mode)
struct CT : RegisterField<S0CR, 19, 1, ReadWriteMode>
{
};
// Double buffer mode
struct DBM : RegisterField<S0CR, 18, 1, ReadWriteMode>
{
};
// Priority level
struct PL : RegisterField<S0CR, 16, 2, ReadWriteMode>
{
using Low = FieldValue<PL, 0U>;
using Medium = FieldValue<PL, 1U>;
using High = FieldValue<PL, 2U>;
using Very_high = FieldValue<PL, 3U>;
template<auto val, class = typename std::enable_if_t<(val >= 0 && val <= 3)>>
using Priority = FieldValue<PL, val>;
};
// Peripheral increment offset size
struct PINCOS : RegisterField<S0CR, 15, 1, ReadWriteMode>
{
};
// Memory data size
struct MSIZE : RegisterField<S0CR, 13, 2, ReadWriteMode>
{
using Byte = FieldValue<MSIZE, 0U>;
using Half_Word = FieldValue<MSIZE, 1U>;
using Word = FieldValue<MSIZE, 2U>;
};
// Peripheral data size
struct PSIZE : RegisterField<S0CR, 11, 2, ReadWriteMode>
{
using Byte = FieldValue<PSIZE, 0U>;
using Half_Word = FieldValue<PSIZE, 1U>;
using Word = FieldValue<PSIZE, 2U>;
};
// Memory increment mode
struct MINC : RegisterField<S0CR, 10, 1, ReadWriteMode>
{
using Fixed = FieldValue<MINC, 0U>;
using Incremented = FieldValue<MINC, 1U>;
};
// Peripheral increment mode
struct PINC : RegisterField<S0CR, 9, 1, ReadWriteMode>
{
using Fixed = FieldValue<PINC, 0U>;
using Incremented = FieldValue<PINC, 1U>;
};
// Circular mode
struct CIRC : RegisterField<S0CR, 8, 1, ReadWriteMode>
{
using Disable = FieldValue<CIRC, 0U>;
using Enable = FieldValue<CIRC, 1U>;
};
// Data transfer direction
struct DIR : RegisterField<S0CR, 6, 2, ReadWriteMode>
{
using peripheral_to_memory = FieldValue<DIR, 0U>;
using memory_to_peripheral = FieldValue<DIR, 1U>;
using memory_to_memory = FieldValue<DIR, 2U>;
};
// Peripheral flow controller
struct PFCTRL : RegisterField<S0CR, 5, 1, ReadWriteMode>
{
using DMA = FieldValue<PFCTRL, 0U>;
using Peripheral = FieldValue<PFCTRL, 1U>;
};
// Transfer complete interrupt enable
struct TCIE : RegisterField<S0CR, 4, 1, ReadWriteMode>
{
using Disable = FieldValue<TCIE, 0U>;
using Enable = FieldValue<TCIE, 1U>;
};
// Half transfer interrupt enable
struct HTIE : RegisterField<S0CR, 3, 1, ReadWriteMode>
{
using Disable = FieldValue<HTIE, 0U>;
using Enable = FieldValue<HTIE, 1U>;
};
// Transfer error interrupt enable
struct TEIE : RegisterField<S0CR, 2, 1, ReadWriteMode>
{
using Disable = FieldValue<TEIE, 0U>;
using Enable = FieldValue<TEIE, 1U>;
};
// Direct mode error interrupt enable
struct DMEIE : RegisterField<S0CR, 1, 1, ReadWriteMode>
{
using Disable = FieldValue<DMEIE, 0U>;
using Enable = FieldValue<DMEIE, 1U>;
};
// Stream enable / flag stream ready when read low
struct EN : RegisterField<S0CR, 0, 1, ReadWriteMode>
{
using Disable = FieldValue<EN, 0U>;
using Enable = FieldValue<EN, 1U>;
};
};
// stream x configuration register
template<auto num>
struct SxCR : Register<0x40026010 + 24 * num, ReadWriteMode, 0x0>
{
// Channel selection
struct CHSEL : RegisterField<SxCR, 25, 3, ReadWriteMode>
{
template<auto val, class = typename std::enable_if_t<(val >= 0 && val <= 7)>>
using Channel = FieldValue<CHSEL, val>;
};
// Memory burst transfer configuration
struct MBURST : RegisterField<SxCR, 23, 2, ReadWriteMode>
{
};
// Peripheral burst transfer configuration
struct PBURST : RegisterField<SxCR, 21, 2, ReadWriteMode>
{
};
// Current target (only in double buffer mode)
struct CT : RegisterField<SxCR, 19, 1, ReadWriteMode>
{
};
// Double buffer mode
struct DBM : RegisterField<SxCR, 18, 1, ReadWriteMode>
{
};
// Priority level
struct PL : RegisterField<SxCR, 16, 2, ReadWriteMode>
{
using Low = FieldValue<PL, 0U>;
using Medium = FieldValue<PL, 1U>;
using High = FieldValue<PL, 2U>;
using Very_high = FieldValue<PL, 3U>;
template<auto val, class = typename std::enable_if_t<(val >= 0 && val <= 3)>>
using Priority = FieldValue<PL, val>;
};
// Peripheral increment offset size
struct PINCOS : RegisterField<SxCR, 15, 1, ReadWriteMode>
{
};
// Memory data size
struct MSIZE : RegisterField<SxCR, 13, 2, ReadWriteMode>
{
using Byte = FieldValue<MSIZE, 0U>;
using Half_Word = FieldValue<MSIZE, 1U>;
using Word = FieldValue<MSIZE, 2U>;
};
// Peripheral data size
struct PSIZE : RegisterField<SxCR, 11, 2, ReadWriteMode>
{
using Byte = FieldValue<PSIZE, 0U>;
using Half_Word = FieldValue<PSIZE, 1U>;
using Word = FieldValue<PSIZE, 2U>;
};
// Memory increment mode
struct MINC : RegisterField<SxCR, 10, 1, ReadWriteMode>
{
using Fixed = FieldValue<MINC, 0U>;
using Incremented = FieldValue<MINC, 1U>;
};
// Peripheral increment mode
struct PINC : RegisterField<SxCR, 9, 1, ReadWriteMode>
{
using Fixed = FieldValue<PINC, 0U>;
using Incremented = FieldValue<PINC, 1U>;
};
// Circular mode
struct CIRC : RegisterField<SxCR, 8, 1, ReadWriteMode>
{
using Disable = FieldValue<CIRC, 0U>;
using Enable = FieldValue<CIRC, 1U>;
};
// Data transfer direction
struct DIR : RegisterField<SxCR, 6, 2, ReadWriteMode>
{
using peripheral_to_memory = FieldValue<DIR, 0U>;
using memory_to_peripheral = FieldValue<DIR, 1U>;
using memory_to_memory = FieldValue<DIR, 2U>;
};
// Peripheral flow controller
struct PFCTRL : RegisterField<SxCR, 5, 1, ReadWriteMode>
{
using DMA = FieldValue<PFCTRL, 0U>;
using Peripheral = FieldValue<PFCTRL, 1U>;
};
// Transfer complete interrupt enable
struct TCIE : RegisterField<SxCR, 4, 1, ReadWriteMode>
{
using Disable = FieldValue<TCIE, 0U>;
using Enable = FieldValue<TCIE, 1U>;
};
// Half transfer interrupt enable
struct HTIE : RegisterField<SxCR, 3, 1, ReadWriteMode>
{
using Disable = FieldValue<HTIE, 0U>;
using Enable = FieldValue<HTIE, 1U>;
};
// Transfer error interrupt enable
struct TEIE : RegisterField<SxCR, 2, 1, ReadWriteMode>
{
using Disable = FieldValue<TEIE, 0U>;
using Enable = FieldValue<TEIE, 1U>;
};
// Direct mode error interrupt enable
struct DMEIE : RegisterField<SxCR, 1, 1, ReadWriteMode>
{
using Disable = FieldValue<DMEIE, 0U>;
using Enable = FieldValue<DMEIE, 1U>;
};
// Stream enable / flag stream ready when read low
struct EN : RegisterField<SxCR, 0, 1, ReadWriteMode>
{
using Disable = FieldValue<EN, 0U>;
using Enable = FieldValue<EN, 1U>;
};
};
// stream x number of data register
struct S0NDTR : Register<0x40026014, ReadWriteMode, 0x0>
{
// Number of data items to transfer
struct NDT : RegisterField<S0NDTR, 0, 16, ReadWriteMode>
{
};
};
// stream x peripheral address register
struct S0PAR : Register<0x40026018, ReadWriteMode, 0x0>
{
// Peripheral address
struct PA : RegisterField<S0PAR, 0, 32, ReadWriteMode>
{
template<auto val, class = typename std::enable_if_t<(val >= 0 && val <= 4294967295)>>
using Address = FieldValue<PA, val>;
};
};
// stream x memory 0 address register
struct S0M0AR : Register<0x4002601c, ReadWriteMode, 0x0>
{
// Memory 0 address
struct M0A : RegisterField<S0M0AR, 0, 32, ReadWriteMode>
{
};
};
// stream x memory 1 address register
struct S0M1AR : Register<0x40026020, ReadWriteMode, 0x0>
{
// Memory 1 address (used in case of Double buffer mode)
struct M1A : RegisterField<S0M1AR, 0, 32, ReadWriteMode>
{
};
};
// stream x FIFO control register
struct S0FCR : Register<0x40026024, ReadWriteMode, 0x21>
{
// FIFO error interrupt enable
struct FEIE : RegisterField<S0FCR, 7, 1, ReadWriteMode>
{
};
// FIFO status
struct FS : RegisterField<S0FCR, 3, 3, ReadMode>
{
};
// Direct mode disable
struct DMDIS : RegisterField<S0FCR, 2, 1, ReadWriteMode>
{
};
// FIFO threshold selection
struct FTH : RegisterField<S0FCR, 0, 2, ReadWriteMode>
{
};
};
// stream x configuration register
struct S1CR : Register<0x40026028, ReadWriteMode, 0x0>
{
// Channel selection
struct CHSEL : RegisterField<S1CR, 25, 3, ReadWriteMode>
{
};
// Memory burst transfer configuration
struct MBURST : RegisterField<S1CR, 23, 2, ReadWriteMode>
{
};
// Peripheral burst transfer configuration
struct PBURST : RegisterField<S1CR, 21, 2, ReadWriteMode>
{
};
// ACK
struct ACK : RegisterField<S1CR, 20, 1, ReadWriteMode>
{
};
// Current target (only in double buffer mode)
struct CT : RegisterField<S1CR, 19, 1, ReadWriteMode>
{
};
// Double buffer mode
struct DBM : RegisterField<S1CR, 18, 1, ReadWriteMode>
{
};
// Priority level
struct PL : RegisterField<S1CR, 16, 2, ReadWriteMode>
{
};
// Peripheral increment offset size
struct PINCOS : RegisterField<S1CR, 15, 1, ReadWriteMode>
{
};
// Memory data size
struct MSIZE : RegisterField<S1CR, 13, 2, ReadWriteMode>
{
};
// Peripheral data size
struct PSIZE : RegisterField<S1CR, 11, 2, ReadWriteMode>
{
};
// Memory increment mode
struct MINC : RegisterField<S1CR, 10, 1, ReadWriteMode>
{
};
// Peripheral increment mode
struct PINC : RegisterField<S1CR, 9, 1, ReadWriteMode>
{
};
// Circular mode
struct CIRC : RegisterField<S1CR, 8, 1, ReadWriteMode>
{
};
// Data transfer direction
struct DIR : RegisterField<S1CR, 6, 2, ReadWriteMode>
{
};
// Peripheral flow controller
struct PFCTRL : RegisterField<S1CR, 5, 1, ReadWriteMode>
{
};
// Transfer complete interrupt enable
struct TCIE : RegisterField<S1CR, 4, 1, ReadWriteMode>
{
};
// Half transfer interrupt enable
struct HTIE : RegisterField<S1CR, 3, 1, ReadWriteMode>
{
};
// Transfer error interrupt enable
struct TEIE : RegisterField<S1CR, 2, 1, ReadWriteMode>
{
};
// Direct mode error interrupt enable
struct DMEIE : RegisterField<S1CR, 1, 1, ReadWriteMode>
{
};
// Stream enable / flag stream ready when read low
struct EN : RegisterField<S1CR, 0, 1, ReadWriteMode>
{
};
};
// stream x number of data register
struct S1NDTR : Register<0x4002602c, ReadWriteMode, 0x0>
{
// Number of data items to transfer
struct NDT : RegisterField<S1NDTR, 0, 16, ReadWriteMode>
{
};
};
// stream x peripheral address register
struct S1PAR : Register<0x40026030, ReadWriteMode, 0x0>
{
// Peripheral address
struct PA : RegisterField<S1PAR, 0, 32, ReadWriteMode>
{
};
};
// stream x memory 0 address register
struct S1M0AR : Register<0x40026034, ReadWriteMode, 0x0>
{
// Memory 0 address
struct M0A : RegisterField<S1M0AR, 0, 32, ReadWriteMode>
{
};
};
// stream x memory 1 address register
struct S1M1AR : Register<0x40026038, ReadWriteMode, 0x0>
{
// Memory 1 address (used in case of Double buffer mode)
struct M1A : RegisterField<S1M1AR, 0, 32, ReadWriteMode>
{
};
};
// stream x FIFO control register
struct S1FCR : Register<0x4002603c, ReadWriteMode, 0x21>
{
// FIFO error interrupt enable
struct FEIE : RegisterField<S1FCR, 7, 1, ReadWriteMode>
{
};
// FIFO status
struct FS : RegisterField<S1FCR, 3, 3, ReadMode>
{
};
// Direct mode disable
struct DMDIS : RegisterField<S1FCR, 2, 1, ReadWriteMode>
{
};
// FIFO threshold selection
struct FTH : RegisterField<S1FCR, 0, 2, ReadWriteMode>
{
};
};
// stream x configuration register
struct S2CR : Register<0x40026040, ReadWriteMode, 0x0>
{
// Channel selection
struct CHSEL : RegisterField<S2CR, 25, 3, ReadWriteMode>
{
};
// Memory burst transfer configuration
struct MBURST : RegisterField<S2CR, 23, 2, ReadWriteMode>
{
};
// Peripheral burst transfer configuration
struct PBURST : RegisterField<S2CR, 21, 2, ReadWriteMode>
{
};
// ACK
struct ACK : RegisterField<S2CR, 20, 1, ReadWriteMode>
{
};
// Current target (only in double buffer mode)
struct CT : RegisterField<S2CR, 19, 1, ReadWriteMode>
{
};
// Double buffer mode
struct DBM : RegisterField<S2CR, 18, 1, ReadWriteMode>
{
};
// Priority level
struct PL : RegisterField<S2CR, 16, 2, ReadWriteMode>
{
};
// Peripheral increment offset size
struct PINCOS : RegisterField<S2CR, 15, 1, ReadWriteMode>
{
};
// Memory data size
struct MSIZE : RegisterField<S2CR, 13, 2, ReadWriteMode>
{
};
// Peripheral data size
struct PSIZE : RegisterField<S2CR, 11, 2, ReadWriteMode>
{
};
// Memory increment mode
struct MINC : RegisterField<S2CR, 10, 1, ReadWriteMode>
{
};
// Peripheral increment mode
struct PINC : RegisterField<S2CR, 9, 1, ReadWriteMode>
{
};
// Circular mode
struct CIRC : RegisterField<S2CR, 8, 1, ReadWriteMode>
{
};
// Data transfer direction
struct DIR : RegisterField<S2CR, 6, 2, ReadWriteMode>
{
};
// Peripheral flow controller
struct PFCTRL : RegisterField<S2CR, 5, 1, ReadWriteMode>
{
};
// Transfer complete interrupt enable
struct TCIE : RegisterField<S2CR, 4, 1, ReadWriteMode>
{
};
// Half transfer interrupt enable
struct HTIE : RegisterField<S2CR, 3, 1, ReadWriteMode>
{
};
// Transfer error interrupt enable
struct TEIE : RegisterField<S2CR, 2, 1, ReadWriteMode>
{
};
// Direct mode error interrupt enable
struct DMEIE : RegisterField<S2CR, 1, 1, ReadWriteMode>
{
};
// Stream enable / flag stream ready when read low
struct EN : RegisterField<S2CR, 0, 1, ReadWriteMode>
{
};
};
// stream x number of data register
struct S2NDTR : Register<0x40026044, ReadWriteMode, 0x0>
{
// Number of data items to transfer
struct NDT : RegisterField<S2NDTR, 0, 16, ReadWriteMode>
{
};
};
// stream x peripheral address register
struct S2PAR : Register<0x40026048, ReadWriteMode, 0x0>
{
// Peripheral address
struct PA : RegisterField<S2PAR, 0, 32, ReadWriteMode>
{
};
};
// stream x memory 0 address register
struct S2M0AR : Register<0x4002604c, ReadWriteMode, 0x0>
{
// Memory 0 address
struct M0A : RegisterField<S2M0AR, 0, 32, ReadWriteMode>
{
};
};
// stream x memory 1 address register
struct S2M1AR : Register<0x40026050, ReadWriteMode, 0x0>
{
// Memory 1 address (used in case of Double buffer mode)
struct M1A : RegisterField<S2M1AR, 0, 32, ReadWriteMode>
{
};
};
// stream x FIFO control register
struct S2FCR : Register<0x40026054, ReadWriteMode, 0x21>
{
// FIFO error interrupt enable
struct FEIE : RegisterField<S2FCR, 7, 1, ReadWriteMode>
{
};
// FIFO status
struct FS : RegisterField<S2FCR, 3, 3, ReadMode>
{
};
// Direct mode disable
struct DMDIS : RegisterField<S2FCR, 2, 1, ReadWriteMode>
{
};
// FIFO threshold selection
struct FTH : RegisterField<S2FCR, 0, 2, ReadWriteMode>
{
};
};
// stream x configuration register
struct S3CR : Register<0x40026058, ReadWriteMode, 0x0>
{
// Channel selection
struct CHSEL : RegisterField<S3CR, 25, 3, ReadWriteMode>
{
};
// Memory burst transfer configuration
struct MBURST : RegisterField<S3CR, 23, 2, ReadWriteMode>
{
};
// Peripheral burst transfer configuration
struct PBURST : RegisterField<S3CR, 21, 2, ReadWriteMode>
{
};
// ACK
struct ACK : RegisterField<S3CR, 20, 1, ReadWriteMode>
{
};
// Current target (only in double buffer mode)
struct CT : RegisterField<S3CR, 19, 1, ReadWriteMode>
{
};
// Double buffer mode
struct DBM : RegisterField<S3CR, 18, 1, ReadWriteMode>
{
};
// Priority level
struct PL : RegisterField<S3CR, 16, 2, ReadWriteMode>
{
};
// Peripheral increment offset size
struct PINCOS : RegisterField<S3CR, 15, 1, ReadWriteMode>
{
};
// Memory data size
struct MSIZE : RegisterField<S3CR, 13, 2, ReadWriteMode>
{
};
// Peripheral data size
struct PSIZE : RegisterField<S3CR, 11, 2, ReadWriteMode>
{
};
// Memory increment mode
struct MINC : RegisterField<S3CR, 10, 1, ReadWriteMode>
{
};
// Peripheral increment mode
struct PINC : RegisterField<S3CR, 9, 1, ReadWriteMode>
{
};
// Circular mode
struct CIRC : RegisterField<S3CR, 8, 1, ReadWriteMode>
{
};
// Data transfer direction
struct DIR : RegisterField<S3CR, 6, 2, ReadWriteMode>
{
};
// Peripheral flow controller
struct PFCTRL : RegisterField<S3CR, 5, 1, ReadWriteMode>
{
};
// Transfer complete interrupt enable
struct TCIE : RegisterField<S3CR, 4, 1, ReadWriteMode>
{
};
// Half transfer interrupt enable
struct HTIE : RegisterField<S3CR, 3, 1, ReadWriteMode>
{
};
// Transfer error interrupt enable
struct TEIE : RegisterField<S3CR, 2, 1, ReadWriteMode>
{
};
// Direct mode error interrupt enable
struct DMEIE : RegisterField<S3CR, 1, 1, ReadWriteMode>
{
};
// Stream enable / flag stream ready when read low
struct EN : RegisterField<S3CR, 0, 1, ReadWriteMode>
{
};
};
// stream x number of data register
struct S3NDTR : Register<0x4002605c, ReadWriteMode, 0x0>
{
// Number of data items to transfer
struct NDT : RegisterField<S3NDTR, 0, 16, ReadWriteMode>
{
};
};
// stream x peripheral address register
struct S3PAR : Register<0x40026060, ReadWriteMode, 0x0>
{
// Peripheral address
struct PA : RegisterField<S3PAR, 0, 32, ReadWriteMode>
{
};
};
// stream x memory 0 address register
struct S3M0AR : Register<0x40026064, ReadWriteMode, 0x0>
{
// Memory 0 address
struct M0A : RegisterField<S3M0AR, 0, 32, ReadWriteMode>
{
};
};
// stream x memory 1 address register
struct S3M1AR : Register<0x40026068, ReadWriteMode, 0x0>
{
// Memory 1 address (used in case of Double buffer mode)
struct M1A : RegisterField<S3M1AR, 0, 32, ReadWriteMode>
{
};
};
// stream x FIFO control register
struct S3FCR : Register<0x4002606c, ReadWriteMode, 0x21>
{
// FIFO error interrupt enable
struct FEIE : RegisterField<S3FCR, 7, 1, ReadWriteMode>
{
};
// FIFO status
struct FS : RegisterField<S3FCR, 3, 3, ReadMode>
{
};
// Direct mode disable
struct DMDIS : RegisterField<S3FCR, 2, 1, ReadWriteMode>
{
};
// FIFO threshold selection
struct FTH : RegisterField<S3FCR, 0, 2, ReadWriteMode>
{
};
};
// stream x configuration register
struct S4CR : Register<0x40026070, ReadWriteMode, 0x0>
{
// Channel selection
struct CHSEL : RegisterField<S4CR, 25, 3, ReadWriteMode>
{
};
// Memory burst transfer configuration
struct MBURST : RegisterField<S4CR, 23, 2, ReadWriteMode>
{
};
// Peripheral burst transfer configuration
struct PBURST : RegisterField<S4CR, 21, 2, ReadWriteMode>
{
};
// ACK
struct ACK : RegisterField<S4CR, 20, 1, ReadWriteMode>
{
};
// Current target (only in double buffer mode)
struct CT : RegisterField<S4CR, 19, 1, ReadWriteMode>
{
};
// Double buffer mode
struct DBM : RegisterField<S4CR, 18, 1, ReadWriteMode>
{
};
// Priority level
struct PL : RegisterField<S4CR, 16, 2, ReadWriteMode>
{
};
// Peripheral increment offset size
struct PINCOS : RegisterField<S4CR, 15, 1, ReadWriteMode>
{
};
// Memory data size
struct MSIZE : RegisterField<S4CR, 13, 2, ReadWriteMode>
{
};
// Peripheral data size
struct PSIZE : RegisterField<S4CR, 11, 2, ReadWriteMode>
{
};
// Memory increment mode
struct MINC : RegisterField<S4CR, 10, 1, ReadWriteMode>
{
};
// Peripheral increment mode
struct PINC : RegisterField<S4CR, 9, 1, ReadWriteMode>
{
};
// Circular mode
struct CIRC : RegisterField<S4CR, 8, 1, ReadWriteMode>
{
};
// Data transfer direction
struct DIR : RegisterField<S4CR, 6, 2, ReadWriteMode>
{
};
// Peripheral flow controller
struct PFCTRL : RegisterField<S4CR, 5, 1, ReadWriteMode>
{
};
// Transfer complete interrupt enable
struct TCIE : RegisterField<S4CR, 4, 1, ReadWriteMode>
{
};
// Half transfer interrupt enable
struct HTIE : RegisterField<S4CR, 3, 1, ReadWriteMode>
{
};
// Transfer error interrupt enable
struct TEIE : RegisterField<S4CR, 2, 1, ReadWriteMode>
{
};
// Direct mode error interrupt enable
struct DMEIE : RegisterField<S4CR, 1, 1, ReadWriteMode>
{
};
// Stream enable / flag stream ready when read low
struct EN : RegisterField<S4CR, 0, 1, ReadWriteMode>
{
};
};
// stream x number of data register
struct S4NDTR : Register<0x40026074, ReadWriteMode, 0x0>
{
// Number of data items to transfer
struct NDT : RegisterField<S4NDTR, 0, 16, ReadWriteMode>
{
};
};
// stream x peripheral address register
struct S4PAR : Register<0x40026078, ReadWriteMode, 0x0>
{
// Peripheral address
struct PA : RegisterField<S4PAR, 0, 32, ReadWriteMode>
{
};
};
// stream x memory 0 address register
struct S4M0AR : Register<0x4002607c, ReadWriteMode, 0x0>
{
// Memory 0 address
struct M0A : RegisterField<S4M0AR, 0, 32, ReadWriteMode>
{
};
};
// stream x memory 1 address register
struct S4M1AR : Register<0x40026080, ReadWriteMode, 0x0>
{
// Memory 1 address (used in case of Double buffer mode)
struct M1A : RegisterField<S4M1AR, 0, 32, ReadWriteMode>
{
};
};
// stream x FIFO control register
struct S4FCR : Register<0x40026084, ReadWriteMode, 0x21>
{
// FIFO error interrupt enable
struct FEIE : RegisterField<S4FCR, 7, 1, ReadWriteMode>
{
};
// FIFO status
struct FS : RegisterField<S4FCR, 3, 3, ReadMode>
{
};
// Direct mode disable
struct DMDIS : RegisterField<S4FCR, 2, 1, ReadWriteMode>
{
};
// FIFO threshold selection
struct FTH : RegisterField<S4FCR, 0, 2, ReadWriteMode>
{
};
};
// stream x configuration register
struct S5CR : Register<0x40026088, ReadWriteMode, 0x0>
{
// Channel selection
struct CHSEL : RegisterField<S5CR, 25, 3, ReadWriteMode>
{
};
// Memory burst transfer configuration
struct MBURST : RegisterField<S5CR, 23, 2, ReadWriteMode>
{
};
// Peripheral burst transfer configuration
struct PBURST : RegisterField<S5CR, 21, 2, ReadWriteMode>
{
};
// ACK
struct ACK : RegisterField<S5CR, 20, 1, ReadWriteMode>
{
};
// Current target (only in double buffer mode)
struct CT : RegisterField<S5CR, 19, 1, ReadWriteMode>
{
};
// Double buffer mode
struct DBM : RegisterField<S5CR, 18, 1, ReadWriteMode>
{
};
// Priority level
struct PL : RegisterField<S5CR, 16, 2, ReadWriteMode>
{
};
// Peripheral increment offset size
struct PINCOS : RegisterField<S5CR, 15, 1, ReadWriteMode>
{
};
// Memory data size
struct MSIZE : RegisterField<S5CR, 13, 2, ReadWriteMode>
{
};
// Peripheral data size
struct PSIZE : RegisterField<S5CR, 11, 2, ReadWriteMode>
{
};
// Memory increment mode
struct MINC : RegisterField<S5CR, 10, 1, ReadWriteMode>
{
};
// Peripheral increment mode
struct PINC : RegisterField<S5CR, 9, 1, ReadWriteMode>
{
};
// Circular mode
struct CIRC : RegisterField<S5CR, 8, 1, ReadWriteMode>
{
};
// Data transfer direction
struct DIR : RegisterField<S5CR, 6, 2, ReadWriteMode>
{
};
// Peripheral flow controller
struct PFCTRL : RegisterField<S5CR, 5, 1, ReadWriteMode>
{
};
// Transfer complete interrupt enable
struct TCIE : RegisterField<S5CR, 4, 1, ReadWriteMode>
{
};
// Half transfer interrupt enable
struct HTIE : RegisterField<S5CR, 3, 1, ReadWriteMode>
{
};
// Transfer error interrupt enable
struct TEIE : RegisterField<S5CR, 2, 1, ReadWriteMode>
{
};
// Direct mode error interrupt enable
struct DMEIE : RegisterField<S5CR, 1, 1, ReadWriteMode>
{
};
// Stream enable / flag stream ready when read low
struct EN : RegisterField<S5CR, 0, 1, ReadWriteMode>
{
};
};
// stream x number of data register
struct S5NDTR : Register<0x4002608c, ReadWriteMode, 0x0>
{
// Number of data items to transfer
struct NDT : RegisterField<S5NDTR, 0, 16, ReadWriteMode>
{
};
};
// stream x peripheral address register
struct S5PAR : Register<0x40026090, ReadWriteMode, 0x0>
{
// Peripheral address
struct PA : RegisterField<S5PAR, 0, 32, ReadWriteMode>
{
};
};
// stream x memory 0 address register
struct S5M0AR : Register<0x40026094, ReadWriteMode, 0x0>
{
// Memory 0 address
struct M0A : RegisterField<S5M0AR, 0, 32, ReadWriteMode>
{
};
};
// stream x memory 1 address register
struct S5M1AR : Register<0x40026098, ReadWriteMode, 0x0>
{
// Memory 1 address (used in case of Double buffer mode)
struct M1A : RegisterField<S5M1AR, 0, 32, ReadWriteMode>
{
};
};
// stream x FIFO control register
struct S5FCR : Register<0x4002609c, ReadWriteMode, 0x21>
{
// FIFO error interrupt enable
struct FEIE : RegisterField<S5FCR, 7, 1, ReadWriteMode>
{
};
// FIFO status
struct FS : RegisterField<S5FCR, 3, 3, ReadMode>
{
};
// Direct mode disable
struct DMDIS : RegisterField<S5FCR, 2, 1, ReadWriteMode>
{
};
// FIFO threshold selection
struct FTH : RegisterField<S5FCR, 0, 2, ReadWriteMode>
{
};
};
// stream x configuration register
struct S6CR : Register<0x400260a0, ReadWriteMode, 0x0>
{
// Channel selection
struct CHSEL : RegisterField<S6CR, 25, 3, ReadWriteMode>
{
};
// Memory burst transfer configuration
struct MBURST : RegisterField<S6CR, 23, 2, ReadWriteMode>
{
};
// Peripheral burst transfer configuration
struct PBURST : RegisterField<S6CR, 21, 2, ReadWriteMode>
{
};
// ACK
struct ACK : RegisterField<S6CR, 20, 1, ReadWriteMode>
{
};
// Current target (only in double buffer mode)
struct CT : RegisterField<S6CR, 19, 1, ReadWriteMode>
{
};
// Double buffer mode
struct DBM : RegisterField<S6CR, 18, 1, ReadWriteMode>
{
};
// Priority level
struct PL : RegisterField<S6CR, 16, 2, ReadWriteMode>
{
};
// Peripheral increment offset size
struct PINCOS : RegisterField<S6CR, 15, 1, ReadWriteMode>
{
};
// Memory data size
struct MSIZE : RegisterField<S6CR, 13, 2, ReadWriteMode>
{
};
// Peripheral data size
struct PSIZE : RegisterField<S6CR, 11, 2, ReadWriteMode>
{
};
// Memory increment mode
struct MINC : RegisterField<S6CR, 10, 1, ReadWriteMode>
{
};
// Peripheral increment mode
struct PINC : RegisterField<S6CR, 9, 1, ReadWriteMode>
{
};
// Circular mode
struct CIRC : RegisterField<S6CR, 8, 1, ReadWriteMode>
{
};
// Data transfer direction
struct DIR : RegisterField<S6CR, 6, 2, ReadWriteMode>
{
};
// Peripheral flow controller
struct PFCTRL : RegisterField<S6CR, 5, 1, ReadWriteMode>
{
};
// Transfer complete interrupt enable
struct TCIE : RegisterField<S6CR, 4, 1, ReadWriteMode>
{
};
// Half transfer interrupt enable
struct HTIE : RegisterField<S6CR, 3, 1, ReadWriteMode>
{
};
// Transfer error interrupt enable
struct TEIE : RegisterField<S6CR, 2, 1, ReadWriteMode>
{
};
// Direct mode error interrupt enable
struct DMEIE : RegisterField<S6CR, 1, 1, ReadWriteMode>
{
};
// Stream enable / flag stream ready when read low
struct EN : RegisterField<S6CR, 0, 1, ReadWriteMode>
{
};
};
// stream x number of data register
struct S6NDTR : Register<0x400260a4, ReadWriteMode, 0x0>
{
// Number of data items to transfer
struct NDT : RegisterField<S6NDTR, 0, 16, ReadWriteMode>
{
};
};
// stream x peripheral address register
struct S6PAR : Register<0x400260a8, ReadWriteMode, 0x0>
{
// Peripheral address
struct PA : RegisterField<S6PAR, 0, 32, ReadWriteMode>
{
};
};
// stream x memory 0 address register
struct S6M0AR : Register<0x400260ac, ReadWriteMode, 0x0>
{
// Memory 0 address
struct M0A : RegisterField<S6M0AR, 0, 32, ReadWriteMode>
{
};
};
// stream x memory 1 address register
struct S6M1AR : Register<0x400260b0, ReadWriteMode, 0x0>
{
// Memory 1 address (used in case of Double buffer mode)
struct M1A : RegisterField<S6M1AR, 0, 32, ReadWriteMode>
{
};
};
// stream x FIFO control register
struct S6FCR : Register<0x400260b4, ReadWriteMode, 0x21>
{
// FIFO error interrupt enable
struct FEIE : RegisterField<S6FCR, 7, 1, ReadWriteMode>
{
};
// FIFO status
struct FS : RegisterField<S6FCR, 3, 3, ReadMode>
{
};
// Direct mode disable
struct DMDIS : RegisterField<S6FCR, 2, 1, ReadWriteMode>
{
};
// FIFO threshold selection
struct FTH : RegisterField<S6FCR, 0, 2, ReadWriteMode>
{
};
};
// stream x configuration register
struct S7CR : Register<0x400260b8, ReadWriteMode, 0x0>
{
// Channel selection
struct CHSEL : RegisterField<S7CR, 25, 3, ReadWriteMode>
{
};
// Memory burst transfer configuration
struct MBURST : RegisterField<S7CR, 23, 2, ReadWriteMode>
{
};
// Peripheral burst transfer configuration
struct PBURST : RegisterField<S7CR, 21, 2, ReadWriteMode>
{
};
// ACK
struct ACK : RegisterField<S7CR, 20, 1, ReadWriteMode>
{
};
// Current target (only in double buffer mode)
struct CT : RegisterField<S7CR, 19, 1, ReadWriteMode>
{
};
// Double buffer mode
struct DBM : RegisterField<S7CR, 18, 1, ReadWriteMode>
{
};
// Priority level
struct PL : RegisterField<S7CR, 16, 2, ReadWriteMode>
{
};
// Peripheral increment offset size
struct PINCOS : RegisterField<S7CR, 15, 1, ReadWriteMode>
{
};
// Memory data size
struct MSIZE : RegisterField<S7CR, 13, 2, ReadWriteMode>
{
};
// Peripheral data size
struct PSIZE : RegisterField<S7CR, 11, 2, ReadWriteMode>
{
};
// Memory increment mode
struct MINC : RegisterField<S7CR, 10, 1, ReadWriteMode>
{
};
// Peripheral increment mode
struct PINC : RegisterField<S7CR, 9, 1, ReadWriteMode>
{
};
// Circular mode
struct CIRC : RegisterField<S7CR, 8, 1, ReadWriteMode>
{
};
// Data transfer direction
struct DIR : RegisterField<S7CR, 6, 2, ReadWriteMode>
{
};
// Peripheral flow controller
struct PFCTRL : RegisterField<S7CR, 5, 1, ReadWriteMode>
{
};
// Transfer complete interrupt enable
struct TCIE : RegisterField<S7CR, 4, 1, ReadWriteMode>
{
};
// Half transfer interrupt enable
struct HTIE : RegisterField<S7CR, 3, 1, ReadWriteMode>
{
};
// Transfer error interrupt enable
struct TEIE : RegisterField<S7CR, 2, 1, ReadWriteMode>
{
};
// Direct mode error interrupt enable
struct DMEIE : RegisterField<S7CR, 1, 1, ReadWriteMode>
{
};
// Stream enable / flag stream ready when read low
struct EN : RegisterField<S7CR, 0, 1, ReadWriteMode>
{
};
};
// stream x number of data register
struct S7NDTR : Register<0x400260bc, ReadWriteMode, 0x0>
{
// Number of data items to transfer
struct NDT : RegisterField<S7NDTR, 0, 16, ReadWriteMode>
{
};
};
// stream x peripheral address register
struct S7PAR : Register<0x400260c0, ReadWriteMode, 0x0>
{
// Peripheral address
struct PA : RegisterField<S7PAR, 0, 32, ReadWriteMode>
{
};
};
// stream x memory 0 address register
struct S7M0AR : Register<0x400260c4, ReadWriteMode, 0x0>
{
// Memory 0 address
struct M0A : RegisterField<S7M0AR, 0, 32, ReadWriteMode>
{
};
};
// stream x memory 1 address register
struct S7M1AR : Register<0x400260c8, ReadWriteMode, 0x0>
{
// Memory 1 address (used in case of Double buffer mode)
struct M1A : RegisterField<S7M1AR, 0, 32, ReadWriteMode>
{
};
};
// stream x FIFO control register
struct S7FCR : Register<0x400260cc, ReadWriteMode, 0x21>
{
// FIFO error interrupt enable
struct FEIE : RegisterField<S7FCR, 7, 1, ReadWriteMode>
{
};
// FIFO status
struct FS : RegisterField<S7FCR, 3, 3, ReadMode>
{
};
// Direct mode disable
struct DMDIS : RegisterField<S7FCR, 2, 1, ReadWriteMode>
{
};
// FIFO threshold selection
struct FTH : RegisterField<S7FCR, 0, 2, ReadWriteMode>
{
};
};
// Large Registers
// low interrupt status register
template<auto num>
struct ISR_FEIF : RegisterField<Register<0x40026000 + 4 * (num / 4), ReadMode, 0x21>, 0 + (6 * (num%4) + 4 * ((num%4) == 2)), 8, ReadMode>
{
};
// low interrupt status register
template<auto num>
struct ISR_DMEIF : RegisterField<Register<0x40026000 + 4 * (num / 4), ReadMode, 0x21>, 2 + (6 * (num%4) + 4 * ((num%4) == 2)), 8, ReadMode>
{
};
// low interrupt status register
template<auto num>
struct ISR_TEIF : RegisterField<Register<0x40026000 + 4 * (num / 4), ReadMode, 0x21>, 3 + (6 * (num%4) + 4 * ((num%4) == 2)), 8, ReadMode>
{
};
// low interrupt status register
template<auto num>
struct ISR_HTIF : RegisterField<Register<0x40026000 + 4 * (num / 4), ReadMode, 0x21>, 4 + (6 * (num%4) + 4 * ((num%4) == 2)), 8, ReadMode>
{
};
// low interrupt status register
template<auto num>
struct ISR_TCIF : RegisterField<Register<0x40026000 + 4 * (num / 4), ReadMode, 0x21>, 5 + (6 * (num%4) + 4 * ((num%4) == 2)), 8, ReadMode>
{
};
// low interrupt flag clear register
template<auto num>
struct IFCR_CFEIF : RegisterField<Register<0x40026008 + 4 * (num / 4), ReadWriteMode, 0x21>, 0 + (6 * (num%4) + 4 * ((num%4) == 2)), 8, ReadWriteMode>
{
};
// low interrupt flag clear register
template<auto num>
struct IFCR_CDMEIF : RegisterField<Register<0x40026008 + 4 * (num / 4), ReadWriteMode, 0x21>, 2 + (6 * (num%4) + 4 * ((num%4) == 2)), 8, ReadWriteMode>
{
};
// low interrupt flag clear register
template<auto num>
struct IFCR_CTEIF : RegisterField<Register<0x40026008 + 4 * (num / 4), ReadWriteMode, 0x21>, 3 + (6 * (num%4) + 4 * ((num%4) == 2)), 8, ReadWriteMode>
{
};
// low interrupt flag clear register
template<auto num>
struct IFCR_CHTIF : RegisterField<Register<0x40026008 + 4 * (num / 4), ReadWriteMode, 0x21>, 4 + (6 * (num%4) + 4 * ((num%4) == 2)), 8, ReadWriteMode>
{
};
// low interrupt flag clear register
template<auto num>
struct IFCR_CTCIF : RegisterField<Register<0x40026008 + 4 * (num / 4), ReadWriteMode, 0x21>, 5 + (6 * (num%4) + 4 * ((num%4) == 2)), 8, ReadWriteMode>
{
};
// stream x number of data register
template<auto num>
struct SxNDTR : RegisterField<Register<0x40026014 + 24 * (num / 1), ReadWriteMode, 0x21>, 16 * (num % 1), 16, ReadWriteMode>
{
};
// stream x peripheral address register
template<auto num>
struct SxPAR : RegisterField<Register<0x40026018 + 24 * (num / 1), ReadWriteMode, 0x21>, 32 * (num % 1), 32, ReadWriteMode>
{
template<auto val, class = typename std::enable_if_t<(val >= 0 && val <= 4294967295)>>
using Address = FieldValue<SxPAR, val>;
};
// stream x memory 0 address register
template<auto num>
struct SxM0AR : RegisterField<Register<0x4002601c + 24 * (num / 1), ReadWriteMode, 0x21>, 32 * (num % 1), 32, ReadWriteMode>
{
};
// stream x memory 1 address register
template<auto num>
struct SxM1AR : RegisterField<Register<0x40026020 + 24 * (num / 1), ReadWriteMode, 0x21>, 32 * (num % 1), 32, ReadWriteMode>
{
};
};
| [
"humansource.hex@gmail.com"
] | humansource.hex@gmail.com |
4ab972745759a361676f23356d247100fdd3104a | f37a800cd831b948949ecc054c5be2aac87b4331 | /lab6-sound/tinyos/support/cpp/ali/GyroRegression/PathLength.hpp | 62bdbb5ce06db449ca9fb5e244fe83e846dfc55b | [] | no_license | ChenchengLiang/Practical-Course-on-WSNs-Lab-WS16-17 | e1f3018900cecaa49731163b3f3ff79a50321c5b | c7f2573ad558c514d6d6985cd78c6131e74db04d | refs/heads/master | 2020-03-31T10:40:51.605436 | 2018-10-08T20:48:24 | 2018-10-08T20:48:24 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,156 | hpp | /** Copyright (c) 2010, University of Szeged
* 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 University of Szeged 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.
*
* Author: Ali Baharev
*/
#ifndef PATHLENGTH_HPP_
#define PATHLENGTH_HPP_
#include <ostream>
#include "InputData.hpp"
#include "CompileTimeConstants.hpp"
namespace gyro {
template<typename T>
class PathLength {
public:
PathLength(const double* rotmat, const Input& data, std::ostream& os) :
R(rotmat),
time_stamp(data.time_stamp()),
a_x(data.acc_x()),
a_y(data.acc_y()),
a_z(data.acc_z()),
N(data.N()),
g_ref(data.g_ref()),
log(os)
{
logging = false;
}
T f(const T* x) {
init(x);
for (int i=1; i<N; ++i) {
update_path_length(i);
}
return s;
}
void verbose() {
logging = true;
}
private:
void init(const T* const x) {
v[X] = v[Y] = v[Z] = 0.0;
r[X] = r[Y] = r[Z] = 0.0;
s = 0.0;
for (int i=0, k=0; i<3; ++i) {
for (int j=0; j<3; ++j) {
C[i][j] = x[k++];
}
}
/* for (int i=0; i<3; ++i) {
for (int j=0; j<3; ++j) {
C[i][j] = 0.0;
}
}
*/
C[0][0] += 1.0;
C[1][1] += 1.0;
C[2][2] += 1.0;
d[X] = x[ 9];
d[Y] = x[10];
d[Z] = x[11];
}
void update_path_length(int sample) {
T am[3];
for (int i=0; i<3; ++i) {
am[i] = C[i][0]*a_x[sample] + C[i][1]*a_y[sample] + C[i][2]*a_z[sample] + d[i];
}
const int p = 9*sample;
for (int i=0; i<3; ++i) {
const int k = p + 3*i;
a[i] = R[k]*am[X]+R[k+1]*am[Y]+R[k+2]*am[Z];
}
a[2] -= g_ref;
//log << "====================================================" << endl;
for (int i=0; i<3; ++i) {
//log << "a[" << i << "] = " << a[i] << std::endl;
}
const double dt = (time_stamp[sample]-time_stamp[sample-1])/TICKS_PER_SEC;
v[X] += (a[X]*dt);
v[Y] += (a[Y]*dt);
v[Z] += (a[Z]*dt);
for (int i=0; i<3; ++i) {
//log << "v[" << i << "] = " << v[i] << std::endl;
}
r[X] += (v[X]*dt);
r[Y] += (v[Y]*dt);
r[Z] += (v[Z]*dt);
T v_len = sqrt(pow(v[X], 2) + pow(v[Y], 2) + pow(v[Z], 2));
s += v_len*dt;
if (logging) {
write(sample);
}
//log << "s = " << s << std::endl;
}
void write(int i) {
log << i;
log << '\t' << a_x[i] << '\t' << a_y[i] << '\t' << a_z[i];
log << '\t' << a[X] << '\t' << a[Y] << '\t' << a[Z];
log << '\t' << v[X] << '\t' << v[Y] << '\t' << v[Z];
log << '\t' << r[X] << '\t' << r[Y] << '\t' << r[Z] << '\t' << s;
log << '\n' << std::flush;
}
PathLength& operator=(const PathLength& );
const double* const R;
const double* const time_stamp;
const double* const a_x;
const double* const a_y;
const double* const a_z;
const int N;
const double g_ref;
std::ostream& log;
bool logging;
T C[3][3];
T d[3];
T a[3];
T v[3];
T r[3];
T s;
enum { X, Y, Z };
};
}
#endif
| [
"lcckkkhaha@163.com"
] | lcckkkhaha@163.com |
e4a33ec74c74026de9abeb73bc5f512293ef635b | e807e9babc6a574c89f14d66d3da0cdc87a363e7 | /libraries/LedControl-1.0.6/src/LedControl_modified.h | 75590e1dee0dcee9535afa373451a7cf48452cf6 | [
"LicenseRef-scancode-warranty-disclaimer",
"MIT"
] | permissive | andrewvh4/GPS_Clock_Software | 9613950d2eb995cf6b321da470d4f770116d9201 | a5c0f288f48f27f62b0a89c9375486c3e2839fb4 | refs/heads/master | 2021-07-09T12:15:04.357723 | 2020-06-29T00:57:45 | 2020-06-29T00:57:45 | 138,968,938 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 7,224 | h | /*
* LedControl.h - A library for controling Leds with a MAX7219/MAX7221
* Copyright (c) 2007 Eberhard Fahle
*
* 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:
*
* 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 LedControl_h
#define LedControl_h
#include <avr/pgmspace.h>
#if (ARDUINO >= 100)
#include <Arduino.h>
#else
#include <WProgram.h>
#endif
/*
* Segments to be switched on for characters and digits on
* 7-Segment Displays
*/
const static byte charTable [] PROGMEM = {
B01111110,B00110000,B01101101,B01111001,B00110011,B01011011,B01011111,B01110000,
B01111111,B01111011,B01110111,B00011111,B00001101,B00111101,B01001111,B01000111,
B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,B10000000,B00000001,B10000000,B00000000,
B01111110,B00110000,B01101101,B01111001,B00110011,B01011011,B01011111,B01110000,
B01111111,B01111011,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,
B00000000,B01110111,B00011111,B00001101,B00111101,B01001111,B01000111,B00000000,
B00110111,B00000000,B00000000,B00000000,B00001110,B00000000,B00000000,B00000000,
B01100111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00001000,
B00000000,B01110111,B00011111,B00001101,B00111101,B01001111,B01000111,B00000000,
B00110111,B00000000,B00000000,B00000000,B00001110,B00000000,B00010101,B00011101,
B01100111,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,
B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000,B00000000
};
class LedControl {
private :
/* The array for shifting the data to the devices */
byte spidata[16];
/* Send out a single command to the device */
void spiTransfer(int addr, byte opcode, byte data);
/* We keep track of the led-status for all 8 devices in this array */
byte status[64];
/* Data is shifted out of this pin*/
int SPI_MOSI;
/* The clock is signaled on this pin */
int SPI_CLK;
/* This one is driven LOW for chip selectzion */
int SPI_CS;
/* The maximum number of devices we use */
int maxDevices;
public:
/*
* Create a new controler
* Params :
* dataPin pin on the Arduino where data gets shifted out
* clockPin pin for the clock
* csPin pin for selecting the device
* numDevices maximum number of devices that can be controled
*/
LedControl(int dataPin, int clkPin, int csPin, int numDevices=1);
LedControl(); //Added Default Constructor
/*
* Gets the number of devices attached to this LedControl.
* Returns :
* int the number of devices on this LedControl
*/
int getDeviceCount();
/*
* Set the shutdown (power saving) mode for the device
* Params :
* addr The address of the display to control
* status If true the device goes into power-down mode. Set to false
* for normal operation.
*/
void shutdown(int addr, bool status);
/*
* Set the number of digits (or rows) to be displayed.
* See datasheet for sideeffects of the scanlimit on the brightness
* of the display.
* Params :
* addr address of the display to control
* limit number of digits to be displayed (1..8)
*/
void setScanLimit(int addr, int limit);
/*
* Set the brightness of the display.
* Params:
* addr the address of the display to control
* intensity the brightness of the display. (0..15)
*/
void setIntensity(int addr, int intensity);
/*
* Switch all Leds on the display off.
* Params:
* addr address of the display to control
*/
void clearDisplay(int addr);
/*
* Set the status of a single Led.
* Params :
* addr address of the display
* row the row of the Led (0..7)
* col the column of the Led (0..7)
* state If true the led is switched on,
* if false it is switched off
*/
void setLed(int addr, int row, int col, boolean state);
/*
* Set all 8 Led's in a row to a new state
* Params:
* addr address of the display
* row row which is to be set (0..7)
* value each bit set to 1 will light up the
* corresponding Led.
*/
void setRow(int addr, int row, byte value);
/*
* Set all 8 Led's in a column to a new state
* Params:
* addr address of the display
* col column which is to be set (0..7)
* value each bit set to 1 will light up the
* corresponding Led.
*/
void setColumn(int addr, int col, byte value);
/*
* Display a hexadecimal digit on a 7-Segment Display
* Params:
* addr address of the display
* digit the position of the digit on the display (0..7)
* value the value to be displayed. (0x00..0x0F)
* dp sets the decimal point.
*/
void setDigit(int addr, int digit, byte value, boolean dp);
/*
* Display a character on a 7-Segment display.
* There are only a few characters that make sense here :
* '0','1','2','3','4','5','6','7','8','9','0',
* 'A','b','c','d','E','F','H','L','P',
* '.','-','_',' '
* Params:
* addr address of the display
* digit the position of the character on the display (0..7)
* value the character to be displayed.
* dp sets the decimal point.
*/
void setChar(int addr, int digit, char value, boolean dp);
};
#endif //LedControl.h
| [
"31864022+andrewvh4@users.noreply.github.com"
] | 31864022+andrewvh4@users.noreply.github.com |
d872f32886ebdbaf2713740965a08d50de1fa705 | e247fd7ff5883f39d5ef327e8bc0d97b251d725c | /14将字符串按逆序输出(对称元素互换).cpp | 6c4c0e2a4a91e707f0dd4bafa8dc33682d5b9a25 | [] | no_license | suxueshi/chapter5_array_test | 772d8f5e34ab6b2537319f232bb43c7e1c7f09e6 | 4887d39525509c2f0e7f67dd4a0ac6de31abd083 | refs/heads/master | 2022-12-03T08:55:33.918891 | 2020-08-12T05:27:51 | 2020-08-12T05:27:51 | 286,925,266 | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 851 | cpp | //#include<iostream>
//#include<string>
//using namespace std;
//
////int main() { //用字符数组 注意字符数组每次都要指定确定的大小
//// const int n = 10;
//// int i;
//// char a[n], temp;
//// cout << "please input a string: ";
//// for (i = 0; i < n; i++)
//// cin >> a[i];
//// for (i = 0; i < n / 2; i++) {
//// temp = a[i];
//// a[i] = a[n - 1 - i]; //注意要减个1
//// a[n - 1 - i] = temp;
//// }
//// for (i = 0; i < n; i++)
//// cout << a[i];
//// cout << endl;
////}
//
//int main() {
// string a;
// int i, n;
// char temp;
// cout << "please input a string: ";
// cin >> a;
// n = a.size(); //用这个函数计算字符串a的长度
// for (i = 0; i < n / 2; i++) {
// temp = a[i];
// a[i] = a[n - 1 - i]; //注意要减个1
// a[n - 1 - i] = temp;
// }
// cout << a << endl;
// return 0;
//
//}
//
| [
"1136975295@qq.com"
] | 1136975295@qq.com |
6262ee02795389d828febc720e2c1cd0a5dae30b | 1cad39cb98cb0d0cf0cb876a8a1e7b7d66b41038 | /pcl_labeller_draw_func.cpp | 927cf9d4597282cf25b35ed88883bf6a6cbcc929 | [
"MIT"
] | permissive | lesterlo/PointCloud-Object-Labeller | 261847954199c797ef95fcf1daeb8d92a0dc555d | 7c3cbc3a49fed357fd86fcdda282f3426a225b50 | refs/heads/master | 2021-06-18T19:23:30.778545 | 2021-01-15T11:00:20 | 2021-01-15T11:00:20 | 145,687,497 | 6 | 2 | MIT | 2019-04-04T13:44:30 | 2018-08-22T09:34:53 | C++ | UTF-8 | C++ | false | false | 27,641 | cpp | // License: MIT. Please Check the license file in root directory
// Copyright (c) (2018) Lester Lo
//###################################################
//
// UI Render function
//
//###################################################
#include "pcl_labeller.h"
#include "config.h"
#include "../build/ui_pcl_labeller.h"
void
PCL_Labeller::drawAllLabel(int highlisted_index)
{
int render_id = 0;
//Remove all shape and Coordinate System before Drawing
viewer->removeAllShapes();//Clear all bounding cube first
viewer->removeAllCoordinateSystems(); //Clear all CoordinateSystem
//Add the element
viewer->addCoordinateSystem(); //Add the Center Axis
for(HSTM_Label item : label_holder)
{
//Get common element
//Rotation
Eigen::Quaternionf box_rotate = Eigen::Quaternionf( //Rotation of the Cube
Eigen::AngleAxisf(TO_RAD(item.rotate_x), Eigen::Vector3f::UnitX()) *
Eigen::AngleAxisf(TO_RAD(item.rotate_y), Eigen::Vector3f::UnitY()) *
Eigen::AngleAxisf(TO_RAD(item.rotate_z), Eigen::Vector3f::UnitZ())
);
//Translation
Eigen::Vector3f box_vector = Eigen::Vector3f(
//Translation of center of the bounding box
item.center_x,
item.center_y,
item.center_z
);
//Draw the Reference 3D axis
if(render_id == highlisted_index)
viewer->addCoordinateSystem(
REF_AXIS_WIDTH, //Scale size
Eigen::Affine3f( //Add Pose
Eigen::Translation3f(box_vector)//Add translation
//* box_rotate//Add X, Y, Z rotation
),
"cs_"+std::to_string(render_id)//Specific ID, for coordinateSystem (cs_)
);
//Draw the bounding cube
viewer->addCube(
box_vector, //Ceter of the Box
box_rotate, //Rotation of the Box
item.x_size, //width
item.y_size, //Height
item.z_size, //Depth
"bb_"+std::to_string(render_id)//Specific ID, for bounding box (bb_)
);
//Make the cube to wireframe
viewer->setShapeRenderingProperties(
pcl::visualization::PCL_VISUALIZER_REPRESENTATION,
pcl::visualization::PCL_VISUALIZER_REPRESENTATION_WIREFRAME,
"bb_"+std::to_string(render_id)
);
//Make the cube to red/green depends on the selected item
viewer->setShapeRenderingProperties(
pcl::visualization::PCL_VISUALIZER_COLOR,
render_id == highlisted_index ? 0.0:1.0, //Red Color
render_id == highlisted_index ? 1.0:0.0, //Green Color
0.0, //Blue Color
"bb_"+std::to_string(render_id)//Use the spcific ID, for bounding box (bb_)
);
//Set the Wireframe line width
viewer->setShapeRenderingProperties(
pcl::visualization::PCL_VISUALIZER_LINE_WIDTH,
BCUBE_LINEWIDTH, //Line Width
"bb_"+std::to_string(render_id)//Use the spcific ID, for bounding box (bb_)
);
// viewer->addText3D(
// item.name,
// pcl::PointXYZ(
// item.center_x + 15.0,
// item.center_y + 15.0,
// item.center_z + 15.0),
// 1.0, //textScale
// 1.0, //red color
// 1.0, //green color
// 1.0, //blue color
// std::to_string(render_id)
// );//Add anotation Text
//Display object depend on tab
switch(ui->tabWidget->currentIndex())
{
//In Bounding Box tab, draw ceter line reference
case 0:
{
Eigen::Vector3f ref_Arrow =
box_rotate *
Eigen::Vector3f( //Translation from the local coordinate of skeleton node
0.0,
0.0,
0.5
) +
box_vector; //Translation of center of the bounding box
//Render the Arrow
viewer->addArrow(
pcl::PointXYZ(
ref_Arrow(0),
ref_Arrow(1),
ref_Arrow(2)
),
pcl::PointXYZ(
box_vector(0),
box_vector(1),
box_vector(2)
),
render_id == highlisted_index ? 0.0:1.0, //Red Color
render_id == highlisted_index ? 1.0:0.0, //Green Color
0.0, //Blue color
false, //Disable the distance display
"box_pose_ref_Arrow_"+std::to_string(render_id)
);
viewer->setShapeRenderingProperties(
pcl::visualization::PCL_VISUALIZER_LINE_WIDTH,
REF_ARROW_LINEWIDTH, //Line Width
"box_pose_ref_Arrow_"+std::to_string(render_id)//Use the spcific ID
);
//Render a line
viewer->addLine(
pcl::PointXYZ(
ref_Arrow(0),
ref_Arrow(1),
ref_Arrow(2)
),
pcl::PointXYZ(
box_vector(0),
box_vector(1),
box_vector(2)
),
render_id == highlisted_index ? 0.0:1.0, //Red Color
render_id == highlisted_index ? 1.0:0.0, //Green Color
0.0, //Blue color
"box_pose_ref_line_"+std::to_string(render_id)
);
viewer->setShapeRenderingProperties(
pcl::visualization::PCL_VISUALIZER_LINE_WIDTH,
REF_ARROW_LINEWIDTH, //Line Width
"box_pose_ref_line_"+std::to_string(render_id)//Use the spcific ID
);
}break;
//In skeleton Tab, draw skeleton
case 1:
{
//Render the Skeleton
bool drawSkeleton = true;
if (drawSkeleton)
{
//Add Skeleton Node drawing
//Sk1
Eigen::Vector3f sk1_shift =
box_rotate *
Eigen::Vector3f( //Translation from the local coordinate of skeleton node
item.sk_n1_x,
item.sk_n1_y,
item.sk_n1_z
) +
box_vector; //Translation of center of the bounding box
viewer->addSphere(
pcl::PointXYZ(
//Apply The Vector to the pointxyz
sk1_shift(0),
sk1_shift(1),
sk1_shift(2)
),
SK_NODE_SIZE, //Radius of the sphere
render_id == highlisted_index ? 0.0:1.0, //Red Color
render_id == highlisted_index ? 1.0:0.0, //Green Color
0.0, //Blue color
"sk1_"+std::to_string(render_id)
);
//Sk2
Eigen::Vector3f sk2_shift =
box_rotate *
Eigen::Vector3f( //Translation from the local coordinate of skeleton node
item.sk_n2_x,
item.sk_n2_y,
item.sk_n2_z
) +
box_vector; //Translation of center of the bounding box
viewer->addSphere(
pcl::PointXYZ(
//Apply The Vector to the pointxyz
sk2_shift(0),
sk2_shift(1),
sk2_shift(2)
),
SK_NODE_SIZE, //Radius of the sphere
render_id == highlisted_index ? 0.0:1.0, //Red Color
render_id == highlisted_index ? 1.0:0.0, //Green Color
0.0, //Blue color
"sk2_"+std::to_string(render_id)
);
//Sk3
Eigen::Vector3f sk3_shift =
box_rotate *
Eigen::Vector3f( //Translation from the local coordinate of skeleton node
item.sk_n3_x,
item.sk_n3_y,
item.sk_n3_z
) +
box_vector; //Translation of center of the bounding box
viewer->addSphere(
pcl::PointXYZ(
//Apply The Vector to the pointxyz
sk3_shift(0),
sk3_shift(1),
sk3_shift(2)
),
SK_NODE_SIZE, //Radius of the sphere
render_id == highlisted_index ? 0.0:1.0, //Red Color
render_id == highlisted_index ? 1.0:0.0, //Green Color
0.0, //Blue color
"sk3_"+std::to_string(render_id)
);
//Sk4
Eigen::Vector3f sk4_shift =
box_rotate *
Eigen::Vector3f( //Translation from the local coordinate of skeleton node
item.sk_n4_x,
item.sk_n4_y,
item.sk_n4_z
) +
box_vector; //Translation of center of the bounding box
viewer->addSphere(
pcl::PointXYZ(
//Apply The Vector to the pointxyz
sk4_shift(0),
sk4_shift(1),
sk4_shift(2)
),
SK_NODE_SIZE, //Radius of the sphere
render_id == highlisted_index ? 0.0:1.0, //Red Color
render_id == highlisted_index ? 1.0:0.0, //Green Color
0.0, //Blue color
"sk4_"+std::to_string(render_id)
);
//Sk5
Eigen::Vector3f sk5_shift =
box_rotate *
Eigen::Vector3f( //Translation from the local coordinate of skeleton node
item.sk_n5_x,
item.sk_n5_y,
item.sk_n5_z
) +
box_vector; //Translation of center of the bounding box
viewer->addSphere(
pcl::PointXYZ(
//Apply The Vector to the pointxyz
sk5_shift(0),
sk5_shift(1),
sk5_shift(2)
),
SK_NODE_SIZE, //Radius of the sphere
render_id == highlisted_index ? 0.0:1.0, //Red Color
render_id == highlisted_index ? 1.0:0.0, //Green Color
0.0, //Blue color
"sk5_"+std::to_string(render_id)
);
//Sk6
Eigen::Vector3f sk6_shift =
box_rotate *
Eigen::Vector3f( //Translation from the local coordinate of skeleton node
item.sk_n6_x,
item.sk_n6_y,
item.sk_n6_z
) +
box_vector; //Translation of center of the bounding box
viewer->addSphere(
pcl::PointXYZ(
//Apply The Vector to the pointxyz
sk6_shift(0),
sk6_shift(1),
sk6_shift(2)
),
SK_NODE_SIZE, //Radius of the sphere
render_id == highlisted_index ? 0.0:1.0, //Red Color
render_id == highlisted_index ? 1.0:0.0, //Green Color
0.0, //Blue color
"sk6_"+std::to_string(render_id)
);
//Sk7
Eigen::Vector3f sk7_shift =
box_rotate *
Eigen::Vector3f( //Translation from the local coordinate of skeleton node
item.sk_n7_x,
item.sk_n7_y,
item.sk_n7_z
) +
box_vector; //Translation of center of the bounding box
viewer->addSphere(
pcl::PointXYZ(
//Apply The Vector to the pointxyz
sk7_shift(0),
sk7_shift(1),
sk7_shift(2)
),
SK_NODE_SIZE, //Radius of the sphere
render_id == highlisted_index ? 0.0:1.0, //Red Color
render_id == highlisted_index ? 1.0:0.0, //Green Color
0.0, //Blue color
"sk7_"+std::to_string(render_id)
);
//Sk8
Eigen::Vector3f sk8_shift =
box_rotate *
Eigen::Vector3f( //Translation from the local coordinate of skeleton node
item.sk_n8_x,
item.sk_n8_y,
item.sk_n8_z
) +
box_vector; //Translation of center of the bounding box
viewer->addSphere(
pcl::PointXYZ(
//Apply The Vector to the pointxyz
sk8_shift(0),
sk8_shift(1),
sk8_shift(2)
),
SK_NODE_SIZE, //Radius of the sphere
render_id == highlisted_index ? 0.0:1.0, //Red Color
render_id == highlisted_index ? 1.0:0.0, //Green Color
0.0, //Blue color
"sk8_"+std::to_string(render_id)
);
//Sk9
Eigen::Vector3f sk9_shift =
box_rotate *
Eigen::Vector3f( //Translation from the local coordinate of skeleton node
item.sk_n9_x,
item.sk_n9_y,
item.sk_n9_z
) +
box_vector; //Translation of center of the bounding box
viewer->addSphere(
pcl::PointXYZ(
//Apply The Vector to the pointxyz
sk9_shift(0),
sk9_shift(1),
sk9_shift(2)
),
SK_NODE_SIZE, //Radius of the sphere
render_id == highlisted_index ? 0.0:1.0, //Red Color
render_id == highlisted_index ? 1.0:0.0, //Green Color
0.0, //Blue color
"sk9_"+std::to_string(render_id)
);
//Sk10
Eigen::Vector3f sk10_shift =
box_rotate *
Eigen::Vector3f( //Translation from the local coordinate of skeleton node
item.sk_n10_x,
item.sk_n10_y,
item.sk_n10_z
) +
box_vector; //Translation of center of the bounding box
viewer->addSphere(
pcl::PointXYZ(
//Apply The Vector to the pointxyz
sk10_shift(0),
sk10_shift(1),
sk10_shift(2)
),
SK_NODE_SIZE, //Radius of the sphere
render_id == highlisted_index ? 0.0:1.0, //Red Color
render_id == highlisted_index ? 1.0:0.0, //Green Color
0.0, //Blue color
"sk10_"+std::to_string(render_id)
);
//Sk11
Eigen::Vector3f sk11_shift =
box_rotate *
Eigen::Vector3f( //Translation from the local coordinate of skeleton node
item.sk_n11_x,
item.sk_n11_y,
item.sk_n11_z
) +
box_vector; //Translation of center of the bounding box
viewer->addSphere(
pcl::PointXYZ(
//Apply The Vector to the pointxyz
sk11_shift(0),
sk11_shift(1),
sk11_shift(2)
),
SK_NODE_SIZE, //Radius of the sphere
render_id == highlisted_index ? 0.0:1.0, //Red Color
render_id == highlisted_index ? 1.0:0.0, //Green Color
0.0, //Blue color
"sk11_"+std::to_string(render_id)
);
//Sk12
Eigen::Vector3f sk12_shift =
box_rotate *
Eigen::Vector3f( //Translation from the local coordinate of skeleton node
item.sk_n12_x,
item.sk_n12_y,
item.sk_n12_z
) +
box_vector; //Translation of center of the bounding box
viewer->addSphere(
pcl::PointXYZ(
//Apply The Vector to the pointxyz
sk12_shift(0),
sk12_shift(1),
sk12_shift(2)
),
SK_NODE_SIZE, //Radius of the sphere
render_id == highlisted_index ? 0.0:1.0, //Red Color
render_id == highlisted_index ? 1.0:0.0, //Green Color
0.0, //Blue color
"sk12_"+std::to_string(render_id)
);
//Sk13
Eigen::Vector3f sk13_shift =
box_rotate *
Eigen::Vector3f( //Translation from the local coordinate of skeleton node
item.sk_n13_x,
item.sk_n13_y,
item.sk_n13_z
) +
box_vector; //Translation of center of the bounding box
viewer->addSphere(
pcl::PointXYZ(
//Apply The Vector to the pointxyz
sk13_shift(0),
sk13_shift(1),
sk13_shift(2)
),
SK_NODE_SIZE, //Radius of the sphere
render_id == highlisted_index ? 0.0:1.0, //Red Color
render_id == highlisted_index ? 1.0:0.0, //Green Color
0.0, //Blue color
"sk13_"+std::to_string(render_id)
);
//Sk14
Eigen::Vector3f sk14_shift =
box_rotate *
Eigen::Vector3f( //Translation from the local coordinate of skeleton node
item.sk_n14_x,
item.sk_n14_y,
item.sk_n14_z
) +
box_vector; //Translation of center of the bounding box
viewer->addSphere(
pcl::PointXYZ(
//Apply The Vector to the pointxyz
sk14_shift(0),
sk14_shift(1),
sk14_shift(2)
),
SK_NODE_SIZE, //Radius of the sphere
render_id == highlisted_index ? 0.0:1.0, //Red Color
render_id == highlisted_index ? 1.0:0.0, //Green Color
0.0, //Blue color
"sk14_"+std::to_string(render_id)
);
//Sk15
Eigen::Vector3f sk15_shift =
box_rotate *
Eigen::Vector3f( //Translation from the local coordinate of skeleton node
item.sk_n15_x,
item.sk_n15_y,
item.sk_n15_z
) +
box_vector; //Translation of center of the bounding box
viewer->addSphere(
pcl::PointXYZ(
//Apply The Vector to the pointxyz
sk15_shift(0),
sk15_shift(1),
sk15_shift(2)
),
SK_NODE_SIZE, //Radius of the sphere
render_id == highlisted_index ? 0.0:1.0, //Red Color
render_id == highlisted_index ? 1.0:0.0, //Green Color
0.0, //Blue color
"sk15_"+std::to_string(render_id)
);
//Add Skeleton Line drawing
//Line 1-2
viewer->addLine(
pcl::PointXYZ(
sk1_shift.x(),
sk1_shift.y(),
sk1_shift.z()
),
pcl::PointXYZ(
sk2_shift.x(),
sk2_shift.y(),
sk2_shift.z()
),
render_id == highlisted_index ? 0.0:1.0, //Red Color
render_id == highlisted_index ? 1.0:0.0, //Green Color
0.0, //Blue color
"line_sk1-2_"+std::to_string(render_id)
);
viewer->setShapeRenderingProperties(
pcl::visualization::PCL_VISUALIZER_LINE_WIDTH,
SK_BONE_LINEWIDTH, //Line Width
"line_sk1-2_"+std::to_string(render_id)//Use the spcific ID
);
//Line 2-3
viewer->addLine(
pcl::PointXYZ(
sk2_shift.x(),
sk2_shift.y(),
sk2_shift.z()
),
pcl::PointXYZ(
sk3_shift.x(),
sk3_shift.y(),
sk3_shift.z()
),
render_id == highlisted_index ? 0.0:1.0, //Red Color
render_id == highlisted_index ? 1.0:0.0, //Green Color
0.0, //Blue color
"line_sk2-3_"+std::to_string(render_id)
);
viewer->setShapeRenderingProperties(
pcl::visualization::PCL_VISUALIZER_LINE_WIDTH,
SK_BONE_LINEWIDTH, //Line Width
"line_sk2-3_"+std::to_string(render_id)//Use the spcific ID
);
//Line 2-4
viewer->addLine(
pcl::PointXYZ(
sk2_shift.x(),
sk2_shift.y(),
sk2_shift.z()
),
pcl::PointXYZ(
sk4_shift.x(),
sk4_shift.y(),
sk4_shift.z()
),
render_id == highlisted_index ? 0.0:1.0, //Red Color
render_id == highlisted_index ? 1.0:0.0, //Green Color
0.0, //Blue color
"line_sk2-4_"+std::to_string(render_id)
);
viewer->setShapeRenderingProperties(
pcl::visualization::PCL_VISUALIZER_LINE_WIDTH,
SK_BONE_LINEWIDTH, //Line Width
"line_sk2-4_"+std::to_string(render_id)//Use the spcific ID
);
//Line 2-7
viewer->addLine(
pcl::PointXYZ(
sk2_shift.x(),
sk2_shift.y(),
sk2_shift.z()
),
pcl::PointXYZ(
sk7_shift.x(),
sk7_shift.y(),
sk7_shift.z()
),
render_id == highlisted_index ? 0.0:1.0, //Red Color
render_id == highlisted_index ? 1.0:0.0, //Green Color
0.0, //Blue color
"line_sk2-7_"+std::to_string(render_id)
);
viewer->setShapeRenderingProperties(
pcl::visualization::PCL_VISUALIZER_LINE_WIDTH,
SK_BONE_LINEWIDTH, //Line Width
"line_sk2-7_"+std::to_string(render_id)//Use the spcific ID
);
//Line 4-5
viewer->addLine(
pcl::PointXYZ(
sk4_shift.x(),
sk4_shift.y(),
sk4_shift.z()
),
pcl::PointXYZ(
sk5_shift.x(),
sk5_shift.y(),
sk5_shift.z()
),
render_id == highlisted_index ? 0.0:1.0, //Red Color
render_id == highlisted_index ? 1.0:0.0, //Green Color
0.0, //Blue color
"line_sk4-5_"+std::to_string(render_id)
);
viewer->setShapeRenderingProperties(
pcl::visualization::PCL_VISUALIZER_LINE_WIDTH,
SK_BONE_LINEWIDTH, //Line Width
"line_sk4-5_"+std::to_string(render_id)//Use the spcific ID
);
//Line 5-6
viewer->addLine(
pcl::PointXYZ(
sk5_shift.x(),
sk5_shift.y(),
sk5_shift.z()
),
pcl::PointXYZ(
sk6_shift.x(),
sk6_shift.y(),
sk6_shift.z()
),
render_id == highlisted_index ? 0.0:1.0, //Red Color
render_id == highlisted_index ? 1.0:0.0, //Green Color
0.0, //Blue color
"line_sk5-6_"+std::to_string(render_id)
);
viewer->setShapeRenderingProperties(
pcl::visualization::PCL_VISUALIZER_LINE_WIDTH,
SK_BONE_LINEWIDTH, //Line Width
"line_sk5-6_"+std::to_string(render_id)//Use the spcific ID
);
//Line 7-8
viewer->addLine(
pcl::PointXYZ(
sk7_shift.x(),
sk7_shift.y(),
sk7_shift.z()
),
pcl::PointXYZ(
sk8_shift.x(),
sk8_shift.y(),
sk8_shift.z()
),
render_id == highlisted_index ? 0.0:1.0, //Red Color
render_id == highlisted_index ? 1.0:0.0, //Green Color
0.0, //Blue color
"line_sk7-8_"+std::to_string(render_id)
);
viewer->setShapeRenderingProperties(
pcl::visualization::PCL_VISUALIZER_LINE_WIDTH,
SK_BONE_LINEWIDTH, //Line Width
"line_sk7-8_"+std::to_string(render_id)//Use the spcific ID
);
//Line 8-9
viewer->addLine(
pcl::PointXYZ(
sk8_shift.x(),
sk8_shift.y(),
sk8_shift.z()
),
pcl::PointXYZ(
sk9_shift.x(),
sk9_shift.y(),
sk9_shift.z()
),
render_id == highlisted_index ? 0.0:1.0, //Red Color
render_id == highlisted_index ? 1.0:0.0, //Green Color
0.0, //Blue color
"line_sk8-9_"+std::to_string(render_id)
);
viewer->setShapeRenderingProperties(
pcl::visualization::PCL_VISUALIZER_LINE_WIDTH,
SK_BONE_LINEWIDTH, //Line Width
"line_sk8-9_"+std::to_string(render_id)//Use the spcific ID
);
//Line 3-10
viewer->addLine(
pcl::PointXYZ(
sk3_shift.x(),
sk3_shift.y(),
sk3_shift.z()
),
pcl::PointXYZ(
sk10_shift.x(),
sk10_shift.y(),
sk10_shift.z()
),
render_id == highlisted_index ? 0.0:1.0, //Red Color
render_id == highlisted_index ? 1.0:0.0, //Green Color
0.0, //Blue color
"line_sk3-10_"+std::to_string(render_id)
);
viewer->setShapeRenderingProperties(
pcl::visualization::PCL_VISUALIZER_LINE_WIDTH,
SK_BONE_LINEWIDTH, //Line Width
"line_sk3-10_"+std::to_string(render_id)//Use the spcific ID
);
//Line 10-11
viewer->addLine(
pcl::PointXYZ(
sk10_shift.x(),
sk10_shift.y(),
sk10_shift.z()
),
pcl::PointXYZ(
sk11_shift.x(),
sk11_shift.y(),
sk11_shift.z()
),
render_id == highlisted_index ? 0.0:1.0, //Red Color
render_id == highlisted_index ? 1.0:0.0, //Green Color
0.0, //Blue color
"line_sk10-11_"+std::to_string(render_id)
);
viewer->setShapeRenderingProperties(
pcl::visualization::PCL_VISUALIZER_LINE_WIDTH,
SK_BONE_LINEWIDTH, //Line Width
"line_sk10-11_"+std::to_string(render_id)//Use the spcific ID
);
//Line 11-12
viewer->addLine(
pcl::PointXYZ(
sk11_shift.x(),
sk11_shift.y(),
sk11_shift.z()
),
pcl::PointXYZ(
sk12_shift.x(),
sk12_shift.y(),
sk12_shift.z()
),
render_id == highlisted_index ? 0.0:1.0, //Red Color
render_id == highlisted_index ? 1.0:0.0, //Green Color
0.0, //Blue color
"line_sk11-12_"+std::to_string(render_id)
);
viewer->setShapeRenderingProperties(
pcl::visualization::PCL_VISUALIZER_LINE_WIDTH,
SK_BONE_LINEWIDTH, //Line Width
"line_sk11-12_"+std::to_string(render_id)//Use the spcific ID
);
//Line 3-13
viewer->addLine(
pcl::PointXYZ(
sk3_shift.x(),
sk3_shift.y(),
sk3_shift.z()
),
pcl::PointXYZ(
sk13_shift.x(),
sk13_shift.y(),
sk13_shift.z()
),
render_id == highlisted_index ? 0.0:1.0, //Red Color
render_id == highlisted_index ? 1.0:0.0, //Green Color
0.0, //Blue color
"line_sk3-13_"+std::to_string(render_id)
);
viewer->setShapeRenderingProperties(
pcl::visualization::PCL_VISUALIZER_LINE_WIDTH,
SK_BONE_LINEWIDTH, //Line Width
"line_sk3-13_"+std::to_string(render_id)//Use the spcific ID
);
//Line 13-4
viewer->addLine(
pcl::PointXYZ(
sk13_shift.x(),
sk13_shift.y(),
sk13_shift.z()
),
pcl::PointXYZ(
sk14_shift.x(),
sk14_shift.y(),
sk14_shift.z()
),
render_id == highlisted_index ? 0.0:1.0, //Red Color
render_id == highlisted_index ? 1.0:0.0, //Green Color
0.0, //Blue color
"line_sk13-14_"+std::to_string(render_id)
);
viewer->setShapeRenderingProperties(
pcl::visualization::PCL_VISUALIZER_LINE_WIDTH,
SK_BONE_LINEWIDTH, //Line Width
"line_sk13-14_"+std::to_string(render_id)//Use the spcific ID
);
//Line 14-15
viewer->addLine(
pcl::PointXYZ(
sk14_shift.x(),
sk14_shift.y(),
sk14_shift.z()
),
pcl::PointXYZ(
sk15_shift.x(),
sk15_shift.y(),
sk15_shift.z()
),
render_id == highlisted_index ? 0.0:1.0, //Red Color
render_id == highlisted_index ? 1.0:0.0, //Green Color
0.0, //Blue color
"line_sk14-15_"+std::to_string(render_id)
);
viewer->setShapeRenderingProperties(
pcl::visualization::PCL_VISUALIZER_LINE_WIDTH,
SK_BONE_LINEWIDTH, //Line Width
"line_sk14-15_"+std::to_string(render_id)//Use the spcific ID
);
}//END-if(draw_skeleton)
}break;
}
render_id++;//Inrement the id counter
}
ui->qvtkWidget->GetRenderWindow()->Render();//Update the qvtkWidget to show the updated render view
}
void
PCL_Labeller::clean_viewer()
{
// Clear and empty the viewer
viewer->removeAllPointClouds(); //Clear all Point Cloud
viewer->removeAllCoordinateSystems(); //Clear all CoordinateSystem
viewer->removeAllShapes(); //Clear all Shape such as Cube
} | [
"21245380+lesterlo@users.noreply.github.com"
] | 21245380+lesterlo@users.noreply.github.com |
50152e2dc0099e6f11d58ed87c54d57b6fd0417f | 13ecbad44007570ed82a924e43992c628f5dd79f | /include/NumCpp/Functions/isnan.hpp | ae0300ace057b36cd5fad0ce9861a3a45de781a0 | [
"MIT"
] | permissive | ScaryTreeFF/NumCpp | fc43610a5cd1b6eb203417ff07302ce3d259fd5c | 05a22d8375c04620eca941cc1ae4177ec27bca74 | refs/heads/master | 2020-06-22T21:17:28.453147 | 2019-07-22T03:48:21 | 2019-07-22T03:48:21 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,971 | hpp | /// @file
/// @author David Pilger <dpilger26@gmail.com>
/// [GitHub Repository](https://github.com/dpilger26/NumCpp)
/// @version 1.1
///
/// @section License
/// Copyright 2019 David Pilger
///
/// 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.
///
/// @section Description
/// Functions for working with NdArrays
///
#pragma once
#include "NumCpp/Core/DtypeInfo.hpp"
#include "NumCpp/NdArray.hpp"
#include <algorithm>
#include <cmath>
namespace nc
{
//============================================================================
// Method Description:
/// Test for NaN and return result as a boolean.
///
/// NumPy Reference: https://www.numpy.org/devdocs/reference/generated/numpy.isnan.html
///
/// @param
/// inValue
///
/// @return
/// bool
///
template<typename dtype>
bool isnan(dtype inValue) noexcept
{
static_assert(!DtypeInfo<dtype>::isInteger(), "ERROR: isnan: can only be used with floating point types.");
return std::isnan(inValue);
}
//============================================================================
// Method Description:
/// Test element-wise for NaN and return result as a boolean array.
///
/// NumPy Reference: https://www.numpy.org/devdocs/reference/generated/numpy.isnan.html
///
/// @param
/// inArray
///
/// @return
/// NdArray
///
template<typename dtype>
NdArray<bool> isnan(const NdArray<dtype>& inArray) noexcept
{
static_assert(!DtypeInfo<dtype>::isInteger(), "ERROR: isnan: can only be used with floating point types.");
NdArray<bool> returnArray(inArray.shape());
std::transform(inArray.cbegin(), inArray.cend(), returnArray.begin(),
[](dtype inValue) noexcept -> bool
{ return isnan(inValue); });
return returnArray;
}
}
| [
"dpilger26@gmail.com"
] | dpilger26@gmail.com |
504a1377732acc2551f62424773093c144ce056e | f6ed095d8ce2edb8a966bf19c04cafd4b01df7ad | /tensorpipe/channel/channel.h | f122ef8c25c490ed68f6a217fc8e6de06ce93542 | [
"BSD-3-Clause"
] | permissive | osalpekar/tensorpipe | f5be94dbaf811a5315ff8e09630a1a96555fb19e | bff4c20ebd6e64b084307015660c14d005cd7da3 | refs/heads/master | 2021-04-21T11:12:35.338027 | 2020-03-24T16:53:26 | 2020-03-24T16:56:17 | 249,774,598 | 0 | 0 | NOASSERTION | 2020-03-24T17:33:57 | 2020-03-24T17:33:56 | null | UTF-8 | C++ | false | false | 3,973 | h | /*
* Copyright (c) Facebook, Inc. and its affiliates.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree.
*/
#pragma once
#include <future>
#include <memory>
#include <vector>
#include <tensorpipe/common/optional.h>
#include <tensorpipe/transport/connection.h>
// Channels are an out of band mechanism to transfer data between
// processes. Examples include a direct address space to address space
// memory copy on the same machine, or a GPU-to-GPU memory copy.
//
// Construction of a channel happens as follows.
//
// 1) During initialization of a pipe, the connecting peer sends its
// list of channel factories and their domain descriptors. The
// domain descriptor is used to determine whether or not a
// channel can be used by a pair of peers.
// 2) The listening side of the pipe compares the list it received
// its own list to determine the list of channels should be used
// for the peers.
// 3) For every channel that should be constructed, the listening
// side registers a slot with its low level listener. These slots
// uniquely identify inbound connections on this listener (by
// sending a word-sized indentifier immediately after connecting)
// and can be used to construct new connections. These slots are
// sent to the connecting side of the pipe, which then attempts
// to establish a new connection for every token.
// 4) At this time, we have a new control connection for every
// channel that is about to be constructed. Both sides of the
// pipe can now create the channel instance using the newly
// created connection. Further initialization that needs to
// happen is defered to the channel implementation. We assume the
// channel is usable from the moment it is constructed.
//
namespace tensorpipe {
namespace channel {
// Abstract base class for channel classes.
class Channel {
public:
using TDescriptor = std::vector<uint8_t>;
using TDescriptorCallback = std::function<void(const Error&, TDescriptor)>;
using TSendCallback = std::function<void(const Error&)>;
using TRecvCallback = std::function<void(const Error&)>;
enum class Endpoint : bool { kConnect, kListen };
virtual ~Channel();
// Send memory region to peer.
virtual void send(
const void* ptr,
size_t length,
TDescriptorCallback descriptorCallback,
TSendCallback callback) = 0;
// Receive memory region from peer.
virtual void recv(
TDescriptor descriptor,
void* ptr,
size_t length,
TRecvCallback callback) = 0;
};
// Abstract base class for channel factory classes.
//
// Instances of these classes are expected to be registered with a
// context. All registered instances are assumed to be eligible
// channels for all pairs.
//
class ChannelFactory {
public:
explicit ChannelFactory(std::string name);
virtual ~ChannelFactory();
// Return the factory's name.
const std::string& name() const;
// Return string to describe the domain for this channel.
//
// Two processes with a channel factory of the same type whose
// domain descriptors are identical can connect to each other.
//
virtual const std::string& domainDescriptor() const = 0;
// Return newly created channel using the specified connection.
//
// It is up to the channel to either use this connection for further
// initialization, or use it directly. Either way, the returned
// channel should be immediately usable. If the channel isn't fully
// initialized yet, take care to queue these operations to execute
// as soon as initialization has completed.
//
virtual std::shared_ptr<Channel> createChannel(
std::shared_ptr<transport::Connection>,
Channel::Endpoint) = 0;
virtual void join();
private:
std::string name_;
};
} // namespace channel
} // namespace tensorpipe
| [
"facebook-github-bot@users.noreply.github.com"
] | facebook-github-bot@users.noreply.github.com |
ff723cdab48cd19c57d0f9b69bda34648900f09f | b5f07cd637489b6ffa35618a093af8305ea19847 | /ru_aas/aas_I_015_030_Zavarak_Guns.Takistan/mapname.hpp | f9a37874cac15c5e69f8f812c99afca587501a75 | [] | no_license | Nailer-C5/arma3-aas | 23e6c8522600222b631dcf04a0dd5d3676b6f5ac | e0de3e94e3dcef83bcc443d479e229c2852c2558 | refs/heads/master | 2022-07-02T01:08:32.615062 | 2022-05-29T02:00:42 | 2022-05-29T02:00:42 | 181,523,347 | 1 | 2 | null | 2020-04-04T04:44:17 | 2019-04-15T16:14:26 | SQF | UTF-8 | C++ | false | false | 4,307 | hpp | #define MAP_DESCRIPTION "aas_I_015_030_Zavarak_Guns by ClubArmaholics"
#define OVERVIEWTEXT $STR_AAS_HISTORY
#define AAS_SMALL_MISSION
#define AAS_DEFAULT_WEATHER 0 //Погода по умолчанию - 0 -чисто. 1 - штормовая (ваврьируется от 0 до 1)
#define AAS_DEFAULT_FOG 0 //Туман по умолчанию 0 чисто, 1 - сильнейший туман
#define AAS_DEFAULT_TIME_HOUR 12 //Время по умолчанию
#define AAS_DEFAULT_TIME_MINUTE 00 //Минуты по умолчанию
#define dst 400 // Дистанция обзора в метрах
#define mzl 0.056 //Размер карты HUD для примера - малые карты 0.1, средние - 0.2, большие 0.3 и больше
//Оставляем один из пунктов
//1_боты зеленка
/*
#define awu ["rhsusf_usmc_marpat_wd_rifleman","rhsusf_usmc_marpat_wd_rifleman_m590","rhsusf_usmc_marpat_wd_rifleman_law","rhsusf_usmc_marpat_wd_rifleman","rhsusf_usmc_marpat_wd_rifleman","rhsusf_usmc_marpat_wd_rifleman_m4","rhsusf_usmc_marpat_wd_rifleman_m4","rhsusf_usmc_marpat_wd_rifleman","rhsusf_usmc_marpat_wd_rifleman"]
#define aeu ["rhs_msv_emr_rifleman","rhs_msv_emr_efreitor","rhs_msv_emr_junior_sergeant","rhs_msv_emr_machinegunner","rhs_msv_emr_officer","rhs_msv_emr_arifleman","rhs_msv_emr_marksman","rhs_msv_emr_sergeant","rhs_msv_emr_RShG2","rhs_msv_emr_grenadier"]
*/
//2_боты ганслингер
/*
#define awu ["rhsusf_usmc_recon_marpat_wd_teamleader_fast","rhsusf_usmc_recon_marpat_wd_machinegunner_m249_fast","rhsusf_usmc_recon_marpat_wd_marksman_fast","rhsusf_usmc_recon_marpat_wd_marksman_fast","rhsusf_usmc_recon_marpat_wd_rifleman_fast","rhsusf_usmc_recon_marpat_wd_autorifleman_fast","rhsusf_usmc_recon_marpat_wd_rifleman_at_fast","rhsusf_usmc_recon_marpat_wd_rifleman_at_fast","rhsusf_usmc_recon_marpat_wd_marksman_fast"]
#define aeu ["rhs_mvd_izlom_sergeant","rhs_mvd_izlom_machinegunner","rhs_mvd_izlom_marksman","rhs_mvd_izlom_marksman_vss","rhs_mvd_izlom_rifleman_asval","rhs_mvd_izlom_rifleman","rhs_mvd_izlom_arifleman","rhs_mvd_izlom_rifleman_LAT","rhs_mvd_izlom_efreitor","rhs_mvd_izlom_grenadier_rpg"]
*/
//3_боты пески
#define awu ["rhsusf_usmc_recon_marpat_d_officer","rhsusf_usmc_recon_marpat_d_rifleman_fast","rhsusf_usmc_recon_marpat_d_marksman","rhsusf_usmc_marpat_d_grenadier","rhsusf_usmc_marpat_d_autorifleman","rhsusf_usmc_marpat_d_gunner","rhsusf_usmc_marpat_d_autorifleman_m249","rhsusf_usmc_marpat_d_squadleader","rhsusf_usmc_marpat_d_fso","rhsusf_usmc_marpat_d_riflemanat"]
#define aeu ["rhs_vmf_recon_sergeant","rhs_vmf_recon_efreitor","rhs_vmf_recon_medic","rhs_vmf_recon_arifleman","rhs_vmf_recon_marksman","rhs_vmf_recon_rifleman_akms","rhs_vmf_recon_grenadier","rhs_vmf_recon_marksman_vss","rhs_vmf_rifleman_scout_akm","rhs_vmf_recon_rifleman_lat"]
//Один из четырех наборов
//1_Набор правил "зеленка" (Черноруссия и подобнные) RULES_ZEL.sqf
//#define Rulchoice SETUP_ZEL
//2_Набор правил "пески" (Такистан и подобнные) RULES_PES.sqf
#define Rulchoice SETUP_PES
//3_Набор правил специально для Gunslingers RULES_GUNS.sqf
//#define Rulchoice SETUP_GUNS
//4_Набор правил специально для карт by [HA]Galactic RULES_GAL.sqf
//#define Rulchoice SETUP_GAL
//Бойцы которых можно отключить пишем false или true
#define boecgp true // 1 рюкзак не положен (0 - боец)
#define macpso true // 2
#define machgn true // 3
#define sanit true // 4
#define remont true // 5
#define rshg true // 6
#define rpg7 false // 7
#define ptrk1 false // 8
#define tpod true // 9
#define agsm false // 10
#define Jav false // 11
#define pzrk1 false // 12
#define snip true // 13
#define spez true // 14
#define saper true // 15
#define zavdv true // 16
#define opbpla false // 17
//Кому рюкзак не положен. Если выключаем класс, соответственно надо изменить цифру
#define bpb ((playerClass==0) or (playerClass==1))
| [
"nailer.c5@gmail.com"
] | nailer.c5@gmail.com |
b469f309f038b876be923551fceab6d889bd7549 | 7a72569b960f8533f5b40581f273f8ea6e803505 | /experiment.h | ffdfeeb3c62a36a08db358bd3175ad376376d4bf | [] | no_license | Don42/qt_statistics | aa19df39c866a2626e44deb5e7981fb1ab54738d | 7f4a2310731688951584395aa2aae0d96fe7b865 | refs/heads/master | 2021-01-19T14:09:57.393012 | 2016-02-08T12:53:52 | 2016-02-08T12:53:52 | 3,065,395 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 510 | h | #ifndef EXPERIMENT_H
#define EXPERIMENT_H
class Experiment
{
public:
Experiment();
~Experiment(){};
char conductExperiment(char Mode);
static const char allwaysSwitch = 1;
static const char allwaysStay = 2;
static const char win = 1;
static const char lose = 0;
private:
char winningDoor;
char choosenDoor;
//char switchingDoor;
char openDoor;
//char remainingDoor;
};
#endif //EXPERIMENT_H
| [
"DonMarco42@gmail.com"
] | DonMarco42@gmail.com |
3e4fe24919e99e0903e8f44f6cb18a699b743eea | 8ecd015006ca1aa7014b41f9417182f5a37ba9ae | /main.cpp | 017f418e2f50fccc114a24f313af510259d121ca | [] | no_license | AndersonUniversity/EmptyProjectForGithubClassroom | 16621ed91fe690a7c75e6717aa6b19dfb3cd8761 | e627d52e4a406193e0471dd5235e941eb96dca71 | refs/heads/master | 2021-08-16T06:13:04.674907 | 2017-11-19T04:22:05 | 2017-11-19T04:22:05 | 111,260,005 | 0 | 0 | null | 2017-11-19T03:08:49 | 2017-11-19T03:08:48 | null | UTF-8 | C++ | false | false | 132 | cpp | //
// Created by Jennifer Coy on 11/18/17.
//
#include <iostream>
using namespace std;
int main() {
cout << "Hello" << endl;
} | [
"jjcoy@anderson.edu"
] | jjcoy@anderson.edu |
d626b39a15f868a0d1ab9577843c21e4f070f05a | b4b4e324cbc6159a02597aa66f52cb8e1bc43bc1 | /C++ code/Codeforces/618G(6).cpp | b664870a03d00a8501b8fde3162dd33fc4953925 | [] | no_license | fsps60312/old-C-code | 5d0ffa0796dde5ab04c839e1dc786267b67de902 | b4be562c873afe9eacb45ab14f61c15b7115fc07 | refs/heads/master | 2022-11-30T10:55:25.587197 | 2017-06-03T16:23:03 | 2017-06-03T16:23:03 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,467 | cpp | #include<cstdio>
#include<cassert>
using namespace std;
//const double EPS=1e-15;
int N;
double P,Q;
double Solve()
{
static double a[51][51],b[51][51];//spaces, value: possibility
for(int i=0;i<=50;i++)for(int j=0;j<=50;j++)a[i][j]=b[i][j]=0.0;
for(int i=1;i<=50;i++)
{
for(int v=1;v<=50;v++)
{
if(v==1)a[i][v]+=P;
if(v==2)a[i][v]+=Q,b[i][v]+=Q;
a[i][v]+=a[i][v-1]*a[i-1][v-1];
b[i][v]+=b[i][v-1]*a[i-1][v-1];
}
}
// for(int i=1;i<=50;i++)printf("a[3][%d]=%.10f\n",i,a[3][i]);
for(int space=50;space>=1;space--)
{
for(int v=1;v<=50;v++)
{
a[space][v]*=1.0-a[space-1][v];
b[space][v]*=1.0-a[space-1][v];
}
}
static double dp[51][51],sum[51][51];//slime count, value: excepted sum
for(int v=1;v<=50;v++)dp[1][v]=v;
for(int slime=2;slime<=50;slime++)
{
for(int v=1;v<=50;v++)
{
double &d=dp[slime][v]=0.0,&s=sum[slime][v]=0.0;
for(int nxt=1;nxt<=50;nxt++)if(nxt!=v)
{
if(v==1)
{
d+=dp[slime-1][nxt]*b[slime-1][nxt];
s+=b[slime-1][nxt];
}
else if(v>nxt)
{
d+=dp[slime-1][nxt]*a[slime-1][nxt];
s+=a[slime-1][nxt];
}
}
// assert(s!=0.0);
// printf("sum=%.10f\n",s);
d=v+d/s;
}
}
if(N<=50)
{
double ans=0.0;
for(int i=1;i<=50;i++)if(a[N][i]!=0.0)ans+=dp[N][i]*a[N][i];
return ans;
}
assert(0);
return -1.0;
}
int main()
{
freopen("in.txt","r",stdin);
while(scanf("%d%lf",&N,&P)==2)
{
P/=1e9,Q=1.0-P;
printf("%.10f\n",Solve());
}
return 0;
}
| [
"fsps60312@yahoo.com.tw"
] | fsps60312@yahoo.com.tw |
5d9bdc3186e6d3be048794cc1b245870137739c0 | ae1ed0ef73d53f6c992112dd9da5e5000f5d3d34 | /20210507manual_control/Core/Inc/Function.hpp | c0bb8093d946194e9699c99a6677d7ab681f6526 | [] | no_license | aytysd/robocon-2021 | 2b4fe786cb242cf23afe1086bb3979984a64c6bc | c3f725e3259415827296400a60b1118d280a8353 | refs/heads/master | 2023-08-26T16:10:51.153964 | 2021-10-11T08:47:03 | 2021-10-11T08:47:03 | 356,548,335 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,360 | hpp | /*
* Function.hpp
*
* Created on: 7 May 2021
*
*@Author: Ayato Yoshida
*
*@Purpose_of_this_class:(activate motor, solenoid valve, and LED)
*
*@Input(motor_number)in(uint8_t motor_number)of(void drive_motor)
*@Input(direction ( 0:Free, 1:CW, 2:CCW, 3:Brake )in(uint8_t direction)of(void drive_motor)
*@Input(PWM)in(uint8_t PWM)of(void drive_motor)
*@Input(speed you expect)in(uint16_t speed)of(void drive_motor)
*@Input(PID_Enabled ( enable:true, disable:false, )in(bool PID_Enabled)of(void drive_motor)
*
*
*@Input( angular_velocity( degree per second ( e.g. 90, 180 )in( uint8_t angular_velocity )of( void drive_motor_Rope )
*
*@Output(motor_number, direction, PWM)to(MDC)
*@Output(color(1:Red, 2:Green, 3:Blue),brightness(0~20))to(LED)
*
*@Attention_(description)
*
*@Usertouch(void drive_motor)&_(variable_name)
*
*/
#ifndef INC_FUNCTION_HPP_
#define INC_FUNCTION_HPP_
#include "main.h"
#define OMNI_RADIUS 53.5
class Function{
public:
void drive_motor(uint8_t motor_number, uint8_t direction, uint16_t speed, bool PID_Enabled, bool Jump_Enabled );
void drive_solenoid_valve( uint8_t port_number, uint8_t ON_OFF);
void drive_LED( uint8_t g, uint8_t r, uint8_t b, uint8_t w );
void drive_motor_Rope( uint8_t motor_number, uint8_t direction, uint16_t angular_velocity, bool PID_Enabled );
};
#endif /* INC_FUNCTION_HPP_ */
| [
"i10795@nara.kosen-ac.jp"
] | i10795@nara.kosen-ac.jp |
4185c62bd927e4b3bb3daf42bba215804f0940fb | 22ffb871637a28e8e4ba7dfb2060a5a2e456cc01 | /program15/program15(b).cpp | 5e6c3f65fdb6087f962bc692fab8197df202b24e | [] | no_license | Garvnanwani/OS_Lab_Sem4 | ddedeac83b22931e7096f3d39afea2208cffe0cf | 8e62331c900c7da298e95aca96013e2d4eea3e43 | refs/heads/main | 2023-05-07T18:16:02.280011 | 2021-05-31T16:48:06 | 2021-05-31T16:48:06 | 342,928,020 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,428 | cpp | #include<stdio.h>
#include<math.h>
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n,head,i,j,k,seek=0,max,diff,curr;
float avg;
string direction;
vector<int> left, right;
printf("Enter the max range of disk\n");
scanf("%d",&max);
printf("Enter the size of queue request\n");
scanf("%d",&n);
int queue[n];
printf("Enter the queue of disk positions to be read\n");
for(i=0;i<n;i++)
scanf("%d",&queue[i]);
printf("Enter the direction\n");
cin>>direction;
printf("Enter the initial head position\n");
scanf("%d",&head);
for (i = 0; i < n; i++)
{
if (queue[i] <= head)
left.push_back(queue[i]);
if (queue[i] > head)
right.push_back(queue[i]);
}
std::sort(left.begin(), left.end());
std::sort(right.begin(), right.end());
printf("Disk head moves from \t to \t with seek\n" );
int run = 2;
while (run-->0) {
if (direction == "left") {
for ( i = left.size() - 1; i >= 0; i--) {curr = left[i];
diff = abs(curr - head);
printf("%d \t\t %d \t %d\n",head,curr,diff);
seek += diff;
head = curr;
}
direction = "right";
std::reverse(right.begin(), right.end());
}
else if (direction == "right") {
for ( i = 0; i < right.size(); i++) {
curr = right[i];
diff = abs(curr - head);
printf("%d \t\t %d \t %d\n",head,curr,diff);
seek += diff;
head = curr;
}
direction = "left";
std::reverse(left.begin(), left.end());
}
}
printf("Total seek time is %d\n",seek);
avg=seek/(float)n;
printf("Average seek time is %f\n",avg);
return 0;
}
| [
"garvwashere@gmail.com"
] | garvwashere@gmail.com |
2bbe4ce9476014e64b3d5597d785e71769670d02 | 074ca8a789800fe07f13a0ca6fda45b11ca312b3 | /crpc/rpcmeta.pb.h | 95fe569302335684c6b15e4a3c61cd7ef8a21030 | [] | no_license | longqun/crpc | e82ce35e0944e6d4f3de41f9c0146121880bd96a | b6dcaabcbd38e11a88d84fd7f3dfe74aa2b5cd06 | refs/heads/master | 2023-08-25T00:33:05.825892 | 2021-11-07T16:02:51 | 2021-11-07T16:02:51 | 372,860,663 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | true | 13,959 | h | // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: rpcmeta.proto
#ifndef PROTOBUF_INCLUDED_rpcmeta_2eproto
#define PROTOBUF_INCLUDED_rpcmeta_2eproto
#include <string>
#include <google/protobuf/stubs/common.h>
#if GOOGLE_PROTOBUF_VERSION < 3006001
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
#if 3006001 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc.
#endif
#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/arena.h>
#include <google/protobuf/arenastring.h>
#include <google/protobuf/generated_message_table_driven.h>
#include <google/protobuf/generated_message_util.h>
#include <google/protobuf/inlined_string_field.h>
#include <google/protobuf/metadata.h>
#include <google/protobuf/message.h>
#include <google/protobuf/repeated_field.h> // IWYU pragma: export
#include <google/protobuf/extension_set.h> // IWYU pragma: export
#include <google/protobuf/unknown_field_set.h>
// @@protoc_insertion_point(includes)
#define PROTOBUF_INTERNAL_EXPORT_protobuf_rpcmeta_2eproto
namespace protobuf_rpcmeta_2eproto {
// Internal implementation detail -- do not use these members.
struct TableStruct {
static const ::google::protobuf::internal::ParseTableField entries[];
static const ::google::protobuf::internal::AuxillaryParseTableField aux[];
static const ::google::protobuf::internal::ParseTable schema[1];
static const ::google::protobuf::internal::FieldMetadata field_metadata[];
static const ::google::protobuf::internal::SerializationTable serialization_table[];
static const ::google::protobuf::uint32 offsets[];
};
void AddDescriptors();
} // namespace protobuf_rpcmeta_2eproto
namespace crpc {
class RpcMeta;
class RpcMetaDefaultTypeInternal;
extern RpcMetaDefaultTypeInternal _RpcMeta_default_instance_;
} // namespace crpc
namespace google {
namespace protobuf {
template<> ::crpc::RpcMeta* Arena::CreateMaybeMessage<::crpc::RpcMeta>(Arena*);
} // namespace protobuf
} // namespace google
namespace crpc {
// ===================================================================
class RpcMeta : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:crpc.RpcMeta) */ {
public:
RpcMeta();
virtual ~RpcMeta();
RpcMeta(const RpcMeta& from);
inline RpcMeta& operator=(const RpcMeta& from) {
CopyFrom(from);
return *this;
}
#if LANG_CXX11
RpcMeta(RpcMeta&& from) noexcept
: RpcMeta() {
*this = ::std::move(from);
}
inline RpcMeta& operator=(RpcMeta&& from) noexcept {
if (GetArenaNoVirtual() == from.GetArenaNoVirtual()) {
if (this != &from) InternalSwap(&from);
} else {
CopyFrom(from);
}
return *this;
}
#endif
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _internal_metadata_.unknown_fields();
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return _internal_metadata_.mutable_unknown_fields();
}
static const ::google::protobuf::Descriptor* descriptor();
static const RpcMeta& default_instance();
static void InitAsDefaultInstance(); // FOR INTERNAL USE ONLY
static inline const RpcMeta* internal_default_instance() {
return reinterpret_cast<const RpcMeta*>(
&_RpcMeta_default_instance_);
}
static constexpr int kIndexInFileMessages =
0;
void Swap(RpcMeta* other);
friend void swap(RpcMeta& a, RpcMeta& b) {
a.Swap(&b);
}
// implements Message ----------------------------------------------
inline RpcMeta* New() const final {
return CreateMaybeMessage<RpcMeta>(NULL);
}
RpcMeta* New(::google::protobuf::Arena* arena) const final {
return CreateMaybeMessage<RpcMeta>(arena);
}
void CopyFrom(const ::google::protobuf::Message& from) final;
void MergeFrom(const ::google::protobuf::Message& from) final;
void CopyFrom(const RpcMeta& from);
void MergeFrom(const RpcMeta& from);
void Clear() final;
bool IsInitialized() const final;
size_t ByteSizeLong() const final;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) final;
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const final;
::google::protobuf::uint8* InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const final;
int GetCachedSize() const final { return _cached_size_.Get(); }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const final;
void InternalSwap(RpcMeta* other);
private:
inline ::google::protobuf::Arena* GetArenaNoVirtual() const {
return NULL;
}
inline void* MaybeArenaPtr() const {
return NULL;
}
public:
::google::protobuf::Metadata GetMetadata() const final;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// optional string service_name = 1;
bool has_service_name() const;
void clear_service_name();
static const int kServiceNameFieldNumber = 1;
const ::std::string& service_name() const;
void set_service_name(const ::std::string& value);
#if LANG_CXX11
void set_service_name(::std::string&& value);
#endif
void set_service_name(const char* value);
void set_service_name(const char* value, size_t size);
::std::string* mutable_service_name();
::std::string* release_service_name();
void set_allocated_service_name(::std::string* service_name);
// optional string method_name = 2;
bool has_method_name() const;
void clear_method_name();
static const int kMethodNameFieldNumber = 2;
const ::std::string& method_name() const;
void set_method_name(const ::std::string& value);
#if LANG_CXX11
void set_method_name(::std::string&& value);
#endif
void set_method_name(const char* value);
void set_method_name(const char* value, size_t size);
::std::string* mutable_method_name();
::std::string* release_method_name();
void set_allocated_method_name(::std::string* method_name);
// optional int32 data_size = 3;
bool has_data_size() const;
void clear_data_size();
static const int kDataSizeFieldNumber = 3;
::google::protobuf::int32 data_size() const;
void set_data_size(::google::protobuf::int32 value);
// @@protoc_insertion_point(class_scope:crpc.RpcMeta)
private:
void set_has_service_name();
void clear_has_service_name();
void set_has_method_name();
void clear_has_method_name();
void set_has_data_size();
void clear_has_data_size();
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
::google::protobuf::internal::HasBits<1> _has_bits_;
mutable ::google::protobuf::internal::CachedSize _cached_size_;
::google::protobuf::internal::ArenaStringPtr service_name_;
::google::protobuf::internal::ArenaStringPtr method_name_;
::google::protobuf::int32 data_size_;
friend struct ::protobuf_rpcmeta_2eproto::TableStruct;
};
// ===================================================================
// ===================================================================
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#endif // __GNUC__
// RpcMeta
// optional string service_name = 1;
inline bool RpcMeta::has_service_name() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void RpcMeta::set_has_service_name() {
_has_bits_[0] |= 0x00000001u;
}
inline void RpcMeta::clear_has_service_name() {
_has_bits_[0] &= ~0x00000001u;
}
inline void RpcMeta::clear_service_name() {
service_name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
clear_has_service_name();
}
inline const ::std::string& RpcMeta::service_name() const {
// @@protoc_insertion_point(field_get:crpc.RpcMeta.service_name)
return service_name_.GetNoArena();
}
inline void RpcMeta::set_service_name(const ::std::string& value) {
set_has_service_name();
service_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
// @@protoc_insertion_point(field_set:crpc.RpcMeta.service_name)
}
#if LANG_CXX11
inline void RpcMeta::set_service_name(::std::string&& value) {
set_has_service_name();
service_name_.SetNoArena(
&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
// @@protoc_insertion_point(field_set_rvalue:crpc.RpcMeta.service_name)
}
#endif
inline void RpcMeta::set_service_name(const char* value) {
GOOGLE_DCHECK(value != NULL);
set_has_service_name();
service_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
// @@protoc_insertion_point(field_set_char:crpc.RpcMeta.service_name)
}
inline void RpcMeta::set_service_name(const char* value, size_t size) {
set_has_service_name();
service_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
::std::string(reinterpret_cast<const char*>(value), size));
// @@protoc_insertion_point(field_set_pointer:crpc.RpcMeta.service_name)
}
inline ::std::string* RpcMeta::mutable_service_name() {
set_has_service_name();
// @@protoc_insertion_point(field_mutable:crpc.RpcMeta.service_name)
return service_name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
inline ::std::string* RpcMeta::release_service_name() {
// @@protoc_insertion_point(field_release:crpc.RpcMeta.service_name)
if (!has_service_name()) {
return NULL;
}
clear_has_service_name();
return service_name_.ReleaseNonDefaultNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
inline void RpcMeta::set_allocated_service_name(::std::string* service_name) {
if (service_name != NULL) {
set_has_service_name();
} else {
clear_has_service_name();
}
service_name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), service_name);
// @@protoc_insertion_point(field_set_allocated:crpc.RpcMeta.service_name)
}
// optional string method_name = 2;
inline bool RpcMeta::has_method_name() const {
return (_has_bits_[0] & 0x00000002u) != 0;
}
inline void RpcMeta::set_has_method_name() {
_has_bits_[0] |= 0x00000002u;
}
inline void RpcMeta::clear_has_method_name() {
_has_bits_[0] &= ~0x00000002u;
}
inline void RpcMeta::clear_method_name() {
method_name_.ClearToEmptyNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
clear_has_method_name();
}
inline const ::std::string& RpcMeta::method_name() const {
// @@protoc_insertion_point(field_get:crpc.RpcMeta.method_name)
return method_name_.GetNoArena();
}
inline void RpcMeta::set_method_name(const ::std::string& value) {
set_has_method_name();
method_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value);
// @@protoc_insertion_point(field_set:crpc.RpcMeta.method_name)
}
#if LANG_CXX11
inline void RpcMeta::set_method_name(::std::string&& value) {
set_has_method_name();
method_name_.SetNoArena(
&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value));
// @@protoc_insertion_point(field_set_rvalue:crpc.RpcMeta.method_name)
}
#endif
inline void RpcMeta::set_method_name(const char* value) {
GOOGLE_DCHECK(value != NULL);
set_has_method_name();
method_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value));
// @@protoc_insertion_point(field_set_char:crpc.RpcMeta.method_name)
}
inline void RpcMeta::set_method_name(const char* value, size_t size) {
set_has_method_name();
method_name_.SetNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
::std::string(reinterpret_cast<const char*>(value), size));
// @@protoc_insertion_point(field_set_pointer:crpc.RpcMeta.method_name)
}
inline ::std::string* RpcMeta::mutable_method_name() {
set_has_method_name();
// @@protoc_insertion_point(field_mutable:crpc.RpcMeta.method_name)
return method_name_.MutableNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
inline ::std::string* RpcMeta::release_method_name() {
// @@protoc_insertion_point(field_release:crpc.RpcMeta.method_name)
if (!has_method_name()) {
return NULL;
}
clear_has_method_name();
return method_name_.ReleaseNonDefaultNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited());
}
inline void RpcMeta::set_allocated_method_name(::std::string* method_name) {
if (method_name != NULL) {
set_has_method_name();
} else {
clear_has_method_name();
}
method_name_.SetAllocatedNoArena(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), method_name);
// @@protoc_insertion_point(field_set_allocated:crpc.RpcMeta.method_name)
}
// optional int32 data_size = 3;
inline bool RpcMeta::has_data_size() const {
return (_has_bits_[0] & 0x00000004u) != 0;
}
inline void RpcMeta::set_has_data_size() {
_has_bits_[0] |= 0x00000004u;
}
inline void RpcMeta::clear_has_data_size() {
_has_bits_[0] &= ~0x00000004u;
}
inline void RpcMeta::clear_data_size() {
data_size_ = 0;
clear_has_data_size();
}
inline ::google::protobuf::int32 RpcMeta::data_size() const {
// @@protoc_insertion_point(field_get:crpc.RpcMeta.data_size)
return data_size_;
}
inline void RpcMeta::set_data_size(::google::protobuf::int32 value) {
set_has_data_size();
data_size_ = value;
// @@protoc_insertion_point(field_set:crpc.RpcMeta.data_size)
}
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif // __GNUC__
// @@protoc_insertion_point(namespace_scope)
} // namespace crpc
// @@protoc_insertion_point(global_scope)
#endif // PROTOBUF_INCLUDED_rpcmeta_2eproto
| [
"642954659@qq.com"
] | 642954659@qq.com |
ee17490e3617ba2e1e9214000ed2b432a8c758d2 | a0239111f1365833a8d3f0ce99ba0a15590b2371 | /Samples/IFCTools/main.cpp | dc87bafef2f8f3817552aad35ffe37466475b9d4 | [] | no_license | SuperMap/OGDC | 71c9f629e3e6ccde604446f1504d07a809ee82ae | c4e3fe509dd8772794d144fe0d906cfd123e5f66 | refs/heads/master | 2023-09-06T08:44:59.595550 | 2022-03-15T08:23:59 | 2022-03-15T08:23:59 | 6,771,763 | 30 | 15 | null | null | null | null | UTF-8 | C++ | false | false | 165 | cpp | #include "ifctools.h"
#include <QtWidgets/QApplication>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
IFCTools w;
w.show();
return a.exec();
}
| [
"heqian@supermap.com"
] | heqian@supermap.com |
ebcd79eaa6cb0f9fa50c3741a957af01ca304ca9 | 2c3c263eaebadeccf6811ab0bc4a475c98f389d5 | /11_Power.cpp | 3eb1c053ed4cf24de5fb6883b8bfddcb245743e3 | [] | no_license | wangdschina/sword_finger_offer | ebb88b644ad102fd5eb363914a90cff48beca7fd | 7b3f893134d7899f84c1eff0e5e7152f5ccce191 | refs/heads/main | 2023-02-15T09:52:12.506567 | 2020-12-30T07:38:12 | 2020-12-30T07:38:12 | 308,794,159 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,074 | cpp | //概述:数值的整数次方
//题目:实现函数 double Power(double base, int exponent),求 base 的exponent次方。
//不得使用库函数,同时不需要考虑大数问题。
//解题:分解求解。例如求32次方,可以先求16次方,然后求得结果相乘。
//时间复杂度:O(logn)
//it's me.
double Power(double base, int exponent)
{
if (EqualFloat(base, 0.0))
return 0;
if (exponent == 0)
return 1;
unsigned int absExp = exponent < 0 ? -exponent : exponent;
double ret = PowerCore(base, absExp);
return exponent < 0 ? (1 / ret) : (ret);
}
bool EqualFloat(double a, double b)
{
static const double Exp = 0.0000001f;
if ((a - b) <= Exp && (a - b) >= -Exp)
return true;
else
return false;
}
double PowerCore(double base, unsigned int exp)
{
double retsult = 0;
if (exp >= 2)
{
double temp = PowerCore(base, exp / 2);
return exp % 2 ? (temp * temp * base) : (temp * temp);
}
return base;
}
//*************************************************************************//
//method
bool g_InvalidInput = false;
double Power(double base, int exponent)
{
g_InvalidInput = false;
if (EqualFloat(base, 0.0) && exponent < 0)
{
g_InvalidInput = true;
return 0.0;
}
unsigned int absExponent = (unsigned int)(exponent);
if (exponent < 0)
absExponent = (unsigned int)(-exponent);
double result = PowerWithUnsignedExponent(base, absExponent);
if (exponent < 0)
result = 1.0 / result;
return result;
}
double PowerWithUnsignedExponent(double base, unsigned int exponent)
{
if (exponent == 0)
return 0;
if (exponent == 1)
return base;
double result = PowerWithUnsignedExponent(base, exponent >> 1); //采用移位的操作更加高效
result *= result;
if (exponent & 0x1) //高效的做法
result *= base;
return result;
}
//*************************************************************************//
| [
"wangdengsheng0@163.com"
] | wangdengsheng0@163.com |
d98bab7a6563bffdd2bfeb52033095df493da876 | be460e66f05c0259cf45e6c0cdb653fc2913972d | /acm/Salvare-Template/geometry/circle/head.cpp | 1b60bba873a9c0dc31035af53c6e6ddbfcd869c5 | [] | no_license | Salvare219/CodeLibrary | 3247aee350402dac3d94e059a8dc97d5d5436524 | 8961a6d1718c58d12c21a857b23e825c16bdab14 | refs/heads/master | 2021-06-16T18:38:21.693960 | 2017-05-09T12:47:36 | 2017-05-09T12:47:36 | 81,569,241 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 615 | cpp | #include <math.h>
#define eps 1e-8
struct point{double x,y;};
double xmult(point p1,point p2,point p0)
{
return (p1.x-p0.x)*(p2.y-p0.y)-(p2.x-p0.x)*(p1.y-p0.y);
}
double distance(point p1,point p2)
{
return sqrt((p1.x-p2.x)*(p1.x-p2.x)+(p1.y-p2.y)*(p1.y-p2.y));
}
double disptoline(point p,point l1,point l2)
{
return fabs(xmult(p,l1,l2))/distance(l1,l2);
}
point intersection(point u1,point u2,point v1,point v2)
{
point ret=u1;
double t=((u1.x-v1.x)*(v1.y-v2.y)-(u1.y-v1.y)*(v1.x-v2.x))
/((u1.x-u2.x)*(v1.y-v2.y)-(u1.y-u2.y)*(v1.x-v2.x));
ret.x+=(u2.x-u1.x)*t;
ret.y+=(u2.y-u1.y)*t;
return ret;
}
| [
"635149007@qq.com"
] | 635149007@qq.com |
5abace1bdb5a19fcfa157cb379b6809e9c4252fa | 48f1e6f0307188494446d30dfd55490609a54eb3 | /Project/GpssGeneratorQt/nodeswindow.h | e715f597db1893959ce8c3045192dc4e30ade5c8 | [] | no_license | kwetril/GpssGeneratorQt | 385527ac58eb30bc6c641585c4acf39198841ab2 | 24437ad58dd129b9ca4eea57d0f2ca9c6e396b20 | refs/heads/master | 2020-06-03T11:33:24.409180 | 2013-02-21T19:04:45 | 2013-02-21T19:04:45 | 8,340,670 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,403 | h | #ifndef NODESWINDOW_H
#define NODESWINDOW_H
#include <QWidget>
#include <QPushButton>
#include <QBoxLayout>
#include <QFrame>
#include <QLabel>
#include <QComboBox>
#include <vector>
#include "networkdescriptor.h"
#include "abstractnavigatablewindow.h"
using std::vector;
namespace GeneratorGpss
{
class NetworkDescriptor;
class NodeWidget;
class NodesWindow : public AbstractNavigatableWindow
{
Q_OBJECT
private:
//order of fields definition may be important!
QLabel nodesLbl;
QPushButton addNodeBtn;
QFrame nodesFrame;
QVBoxLayout nodesFrameLayout;
vector<NodeWidget*> nodeWidgets;
public:
NodesWindow(NetworkDescriptor *netDesc,QWidget *parent = 0);
virtual void updateDescriptor();
virtual void updateInterface();
virtual ~NodesWindow();
private:
NodeWidget *createNewNodeWidget();
public slots:
void addNodeClick();
void deleteNodeClick();
};
class NodeWidget : public QWidget
{
Q_OBJECT
public:
NodeWidget(int id, QWidget *parent=0);
virtual ~NodeWidget();
private:
int id;
QHBoxLayout mainLayout;
QLabel nodeName;
QLabel nodeTypeLbl;
QComboBox nodeType;
QPushButton deleteButton;
public:
void setPossibleNodeTypes(vector<NodeTypeEnum> &nodeTypes);
NodeTypeEnum getNodeType();
QLabel *getNodeName();
int getId();
QPushButton *getDeleteButton();
};
}
#endif // NODESWINDOW_H
| [
"andrey_klim@bk.ru"
] | andrey_klim@bk.ru |
cc63df5d3d6f6df6aa5748534e86b809a5703434 | e183f28d20ccc944d84e4a0da77c8b5739c4c02c | /src/Siner_ADF4351.h | ab02df48b0db7ad047f472c25aef5226a8b7b6cc | [
"MIT"
] | permissive | msiner/Siner_ADF4351 | 6b5ae3da17544402b925edbc4974a83d63aca66e | 600d58d25b1e25a371599b2304ccc61b6e7e9c1d | refs/heads/main | 2021-06-27T15:28:00.628106 | 2020-09-11T04:20:34 | 2020-09-11T04:20:34 | 220,824,401 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,018 | h | /*
Copyright (c) 2019 Mark Siner
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 SINER_ADF4351_H
#define SINER_ADF4351_H
#include <Arduino.h>
#include <SPI.h>
const uint8_t ADF4351_NUM_REGS = 6;
/**
* Siner_ADF4351 implements dynamic runtime control of an ADF4351
* RF synthesizer.
*
* The intended method of operation is to set the public attributes, excluding
* the ones with a "result" prefix, to the desired values, and then call
* program().
**/
class Siner_ADF4351 {
public:
// desired output frequency in Hz
uint32_t frequencyHz = 0;
// reference input frequency in Hz
uint32_t referenceHz = 25000000;
bool outputEnable = true;
int8_t outputPower = -4;
bool auxEnable = false;
int8_t auxPower = -4;
bool auxDivide = true;
bool muteTillLockDetect = true;
bool phaseAdjust = false;
uint16_t phaseDegrees = 1;
bool referenceDouble = false;
bool referenceDivide = false;
bool integerN = false;
uint32_t registers[ADF4351_NUM_REGS] = {0xFFFFFFFF};
uint32_t resultInt = 0;
uint32_t resultDiv = 0;
uint32_t resultFrac = 0;
uint32_t resultMod = 0;
uint32_t resultPrescaler = 0;
uint32_t resultFrequency = 0;
uint32_t resultPfdHz = 0;
/**
* The empty constructor enables use of computeRegisterValues()
* without configuring communication to a chip.
* In this configuration, writeRegister() is a NOOP.
**/
Siner_ADF4351(void);
// Use built-in SPI peripheral
Siner_ADF4351(int pinLoad, SPIClass& spi);
// Use bit-banged SPI via GPIO pins
Siner_ADF4351(int pinLoad, int pinClock, int pinData);
~Siner_ADF4351(void);
void begin(void);
bool computeRegisterValues(void);
void writeRegister(uint32_t regVal);
void writeRegisters(void);
bool program(void);
protected:
int pinLoad = -1;
int pinClock = -1;
int pinData = -1;
SPIClass* spi = NULL;
uint8_t registerMask = 0;
uint32_t lastMod = 0;
uint32_t lastPhaseValue = 0;
bool lastReferenceDouble = false;
bool lastReferenceDivide = false;
};
#endif // SINER_ADF4351_H | [
"msiner@gmail.com"
] | msiner@gmail.com |
bff5be2f1c153ed44b39eae47c4fb0cc2133cdec | 807e9ea716886bec6652999b8337fb7965f99b2f | /src/360/derived_size.cpp | b41153a15ddcc012e13bbf424e46d2778a8e5980 | [] | no_license | duguruiyuan/interview-4 | 973c7172297bbd1bca3825e3c670caec7b519ab4 | c37628d110ac1384b0d19bd323deb055706ad5eb | refs/heads/master | 2021-01-18T07:06:22.013173 | 2015-04-03T11:15:29 | 2015-04-03T11:15:29 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 620 | cpp | #include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <iostream>
using namespace std;
class Base {
public:
virtual void func(){
cout << "func" << endl;
char *q;
};
virtual void func2(){
cout << "func2" << endl;
char *p;
};
Base() {
cout << "Base Constructor" << endl;
}
virtual ~Base() {
cout << "Base Destructor" << endl;
}
int x;
};
int main(void) {
printf("sizeof Base: %d\n", sizeof(Base));
Base *b = new Base;
b->func();
b->func2();
printf("sizeof Base 's func: %d\n", sizeof(Base::func));
printf("sizeof Base 's x: %d\n", sizeof(b->x));
delete b;
return 0;
}
| [
"root@ubuntu.(none)"
] | root@ubuntu.(none) |
7409a38b4f878a23d7aaf61084ebc8e1860bec9e | 0cacf65c864da9b43d6a8b7fa30400b46f574eec | /Libs/Widgets/Plugins/ctkMatrixWidgetPlugin.h | 80d8be4dc98f868e1b6e03e496c7b019a7319ca6 | [
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | bpayne/CTK | f083e9ac703eeb8dceea1b40871236628e6f6311 | f228840719de0457f1b34f18d3c3ec45ab47d349 | refs/heads/master | 2021-01-18T16:17:20.656222 | 2010-09-08T14:22:22 | 2010-09-08T14:34:13 | 896,755 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,244 | h | /*=========================================================================
Library: CTK
Copyright (c) 2010 Kitware Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.commontk.org/LICENSE
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 __ctkMatrixWidgetPlugin_h
#define __ctkMatrixWidgetPlugin_h
// CTK includes
#include "ctkWidgetsAbstractPlugin.h"
class CTK_WIDGETS_PLUGINS_EXPORT ctkMatrixWidgetPlugin :
public QObject,
public ctkWidgetsAbstractPlugin
{
Q_OBJECT
public:
ctkMatrixWidgetPlugin(QObject *_parent = 0);
QWidget *createWidget(QWidget *_parent);
QString domXml() const;
// QIcon icon() const;
QString includeFile() const;
bool isContainer() const;
QString name() const;
};
#endif
| [
"jchris.fillionr@kitware.com"
] | jchris.fillionr@kitware.com |
dbc43a44498da30909c0979643183ede77c0ef8f | c95a83e1a741b8c0eb810dd018d91060e5872dd8 | /Game/Shared/GameButeMgr.h | 476dce83a6c80164fdce7cafd6293104e7ec1959 | [] | no_license | rickyharis39/nolf2 | ba0b56e2abb076e60d97fc7a2a8ee7be4394266c | 0da0603dc961e73ac734ff365bfbfb8abb9b9b04 | refs/heads/master | 2021-01-01T17:21:00.678517 | 2011-07-23T12:11:19 | 2011-07-23T12:11:19 | 38,495,312 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,985 | h | // ----------------------------------------------------------------------- //
//
// MODULE : GameButeMgr.h
//
// PURPOSE : GameButeMgr definition - Base class for all bute mgrs
//
// CREATED : 3/30/99
//
// ----------------------------------------------------------------------- //
#ifndef __GAME_BUTE_MGR_H__
#define __GAME_BUTE_MGR_H__
#include "ButeMgr.h"
#pragma warning( disable : 4786 )
#include <hash_map>
void GBM_DisplayError(const char* szMsg);
// ----------------------------------------------------------------------- //
//
// Character pointer hash map definition...
//
// ----------------------------------------------------------------------- //
struct eqstr_nocase
{
bool operator()(const char* s1, const char* s2) const
{
return stricmp(s1, s2) == 0;
}
};
struct GBM_hash_str_nocase
{
// Copied for stl-port's std::hash<const char*>.
// Added tolower function on the string.
unsigned long operator()(const char* str) const
{
unsigned long hash = 0;
for ( ; *str; ++str)
hash = 5*hash + tolower(*str);
return hash;
}
};
typedef std::hash_map<const char *,int, GBM_hash_str_nocase, eqstr_nocase> IndexTable;
class CGameButeMgr
{
public :
virtual LTBOOL Init(const char* szAttributeFile="") = 0;
virtual void Term( ) { m_buteMgr.Term( ); m_strAttributeFile.Empty( ); }
CGameButeMgr()
{
m_buteMgr.Init(GBM_DisplayError);
m_pCryptKey = LTNULL;
m_bInRezFile = LTTRUE;
}
virtual ~CGameButeMgr() { Term( ); }
inline void SetInRezFile(LTBOOL bInRezFile) { m_bInRezFile = bInRezFile; }
char const* GetAttributeFile( ) { return m_strAttributeFile; }
virtual void Save();
protected :
CString m_strAttributeFile;
CButeMgr m_buteMgr;
char* m_pCryptKey;
LTBOOL m_bInRezFile;
LTBOOL Parse(const char* sButeFile);
};
#endif // __GAME_BUTE_MGR_H__ | [
"vytautasrask@gmail.com"
] | vytautasrask@gmail.com |
8d4b9b07522dc73ccfbc0719fe3f1d8c898203ec | 478ccaac4dcaa0f89f13fa6ce5eec5987a9a8112 | /w02_hw01_noRefresh_01/src/circle.cpp | 719c2e37028faddcca7b44ed36be402691f613c1 | [] | no_license | dmtta/mastd863_sims2014 | a39555b24e4db16fa5c91210b3344a93d3903e50 | d19fb4fdf7d6fb7ad62be08c19b65f79342c098e | refs/heads/master | 2016-08-04T14:56:46.125457 | 2015-04-30T00:50:23 | 2015-04-30T00:50:23 | 23,607,074 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 679 | cpp | #include "ofMain.h"
#include "circle.h"
circle::circle()
{
radius = ofGetWidth()*(ofRandom(0.001,0.005));
speedX = ofRandom(0.05,.10);
speedY = ofRandom(0.05,.10);
pos.x = ofGetWindowWidth()*0.5;
pos.y = ofGetWindowHeight()*0.5;
pos.z = 0.0;
}
void circle::setInit(ofPoint _pos){
pos = _pos;
}
//------------------------------------------------------------------
void circle::update(){
pos.x = pos.x;
pos.y = pos.y+speedY;
if (pos.y+radius/2>=ofGetHeight() || pos.y<=0+radius/2){
speedY = speedY*-1;
}
}
//------------------------------------------------------------------
void circle::draw() {
ofSetColor(255,0,0);
ofCircle(pos, radius);
}
| [
"mastd863@newschool.edu"
] | mastd863@newschool.edu |
cae95269989be98e9177e89eeccadad8e37f4bdd | 6bbe534f3d300116a27bcc9f812a417e4274ac23 | /MQTT_Temphumidity.ino | 8447bda26c5a2b276205042ff1eec0825f64df45 | [] | no_license | GandalfLove/ArduinoProjects | 3c0f4cde18c873e5503ccd59769c416498e225fa | e464f852c8d9c0b359159157ca606b4d861f83ff | refs/heads/main | 2023-03-12T10:18:33.924139 | 2021-03-07T00:24:21 | 2021-03-07T00:24:21 | 345,007,058 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,876 | ino | #include <SPI.h> //Pins 11, 12, 13, 10, and 4 reserved for
#include <Ethernet.h>
#include <PubSubClient.h>
#include <DHT.h>
#define DHTPIN 2 //Assign DHT pin to 2
#define DHTTYPE DHT11 //Set DHT type to DHT11
DHT dht = (DHTPIN, DHTTYPE); //DHT sensor configuration
unsigned long readTime;
//Ethernet Setup
byte mac[] = {0xFE, 0x85, 0xC8, 0x32, 0xD7, 0x78}; //Arduino Mac address
IPAddress ip = (192, 168, 0, 4); //Arduino IP address for static IP assignment
IPAddress server = (192, 168, 0, 170); //set to MQTT host server domain or IP
char message_buff[100]; // this buffers our incoming messages so we can do something on certain commands
EthernetClient ethClient;
PubSubClient mqttclient(ethClient);
//Callback Function
void callback(char* topic, byte* payload, unsigned int length) {
Serial.print("Message arrived [");
Serial.print(topic);
Serial.print("] ");
int i = 0;
for (i = 0; i < length; i++) {
Serial.print((char)payload[i]);
message_buff[i] = payload[i];
}
message_buff[i] = '\0';
String msgString = String(message_buff);
if (msgString.equals("OFF")) {
mqttclient.publish("Temp/Humidity", "acknowedging OFF");
}
else if (msgString.equals("ON")) {
mqttclient.publish("Temp/Humidity", "acknowedging ON");
}
Serial.println();
}
// Reconnect loop function
void reconnect() {
while (!mqttclient.connected())
{
Serial.print("Attempting MQTT connection...");
// Attempt to connect
if (mqttclient.connect("ArduinoClient"))
{
Serial.println("connected");
//Upon Completion Publish Announcement
mqttclient.publish("Temp/Humidity", "ArduinoConnected");
//Resubscribe
mqttclient.subscribe("Temp/Humidity");
} else
{
Serial.print("failed, rc=");
Serial.print(mqttclient.state());
Serial.println(" try again in 5 seconds");
// Wait 5 seconds before retrying
delay(5000);
}
}
}
void setup()
{
Serial.begin(9600);
mqttclient.setServer(server, 1883);
mqttclient.setCallback(callback);
Ethernet.begin(mac, ip);
dht.begin();
// Allow the hardware to initialize
delay(2000);
Serial.println(ip);
readTime = 0;
}
void loop()
{
if (!mqttclient.connected())
{
reconnect();
}
else
{
mqttclient.connect ("ArduinoClient");
}
mqttclient.loop();
//check if 5 seconds has elapsed since the last time we read the sensors.
if (millis() > readTime + 5000) {
sensorRead();
}
}
void sensorRead() {
readTime = millis();
// Reading temperature or humidity takes about 250 milliseconds!
// Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
float h = dht.readHumidity();
// Read temperature as Celsius (the default)
float t = dht.readTemperature();
// Read temperature as Fahrenheit (isFahrenheit = true)
float f = dht.readTemperature(true);
// Check if any reads failed and exit early (to try again).
if (isnan(h) || isnan(t) || isnan(f)) {
Serial.println("Failed to read from DHT sensor!");
return;
}
// Compute heat index in Fahrenheit (the default)
float hif = dht.computeHeatIndex(f, h);
// Compute heat index in Celsius (isFahreheit = false)
float hic = dht.computeHeatIndex(t, h, false);
char buffer[10];
dtostrf(((1.8 * t) + 32), 0, 0, buffer);
mqttclient.publish("Temp/Humidity", buffer);
//Serial.println(buffer);
dtostrf(h , 0, 0, buffer);
mqttclient.publish("Temp/Humidity", buffer);
//client.publish("inTopic/humidity",sprintf(buf, "%f", h));
/*Serial.print("Humidity: ");
Serial.print(h);
Serial.print(" %\t");
Serial.print("Temperature: ");
Serial.print(t);
Serial.print(" *C ");
Serial.print(f);
Serial.print(" *F\t");
Serial.print("Heat index: ");
Serial.print(hic);
Serial.print(" *C ");
Serial.print(hif);
Serial.println(" *F"); */
}
| [
"surfpipes50@gmail.com"
] | surfpipes50@gmail.com |
b2f56e0ddc65b6550ba438987561caa06c33f02b | 11eea8da1b414871e0f8608dd61ee543e81b4b19 | /review/linkedForwardStar.cpp | 8a1cefa6e7c5f42d5a9f8ad1158ccc6db4ded073 | [] | no_license | Tomistong/MyLuoguRepo | 57ed57ad504978f7402bd1bbeba30b2f4ae32a22 | 5dfe5e99b0909f9fe5416d5eaad01f368a2bf891 | refs/heads/master | 2023-08-29T05:18:29.981970 | 2021-10-06T04:23:02 | 2021-10-06T04:23:02 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 684 | cpp | #include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
const int maxn = 8e6+10;
struct edge{
int to,w,nxt;
edge() { nxt = -1; }
}g[maxn];
int tot, head[maxn];
void addEdge(int u, int to, int w) {
tot++;
g[tot].to = to;
g[tot].w = w;
g[tot].nxt = head[u];
head[u] = tot;
}
int main() {
int n,m,flg;
scanf("%d %d %d", &n, &m, &flg);
for(int i=0;i<=n;i++) head[i]=-1;
for(int i=1;i<=m;i++) {
int x,y,v;
scanf("%d %d %d", &x, &y, &v);
if(flg) {
addEdge(x,y,v);
}else {
addEdge(x,y,v);
addEdge(y,x,v);
}
}
for(int u=1;u<=n;u++) {
for(int i=head[u]; ~i; i=g[i].nxt) {
printf("%d %d %d\n", u, g[i].to, g[i].w);
}
}
return 0;
} | [
"wumingyun2120@outlook.com"
] | wumingyun2120@outlook.com |
78d0263d6bbf4d6088661ec4ec2cae76d3951df3 | 2c78b4a6c5479bd388669b2f954b10cfa3e5a67f | /third_party/spdlog/bm/spdlog/details/null_mutex.h | ebb56a59a6d2c18669637b6910ea4dd3afdbc4ca | [
"Apache-2.0",
"MIT"
] | permissive | p4lang/behavioral-model | f543d155215df7b37843b36e5d11d63712404218 | 7d7c3c7c5b82c14a8d70ecd82ad15635425f01d9 | refs/heads/main | 2023-09-03T19:31:48.415229 | 2023-08-21T16:45:31 | 2023-08-21T16:45:31 | 29,883,110 | 507 | 399 | Apache-2.0 | 2023-09-08T00:58:09 | 2015-01-26T21:43:23 | C++ | UTF-8 | C++ | false | false | 1,946 | h | /*************************************************************************/
/* spdlog - an extremely fast and easy to use c++11 logging library. */
/* Copyright (c) 2014 Gabi Melman. */
/* */
/* 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. */
/*************************************************************************/
#pragma once
// null, no cost mutex
namespace spdlog
{
namespace details
{
struct null_mutex
{
void lock() {}
void unlock() {}
bool try_lock()
{
return true;
}
};
}
}
| [
"antonin@barefootnetworks.com"
] | antonin@barefootnetworks.com |
109bebc30e4175c28e9440ccaf7c5173fad33cce | 22984470959e10c62a26ff9a5a057a1c1b9e5e65 | /src/s390/disasm-s390.cc | 5368d8e350f9cb6f78971a6f89db341ec1abcaff | [
"BSD-3-Clause",
"bzip2-1.0.6",
"Apache-2.0",
"SunPro"
] | permissive | aircom-inc/v8 | 0353f44e3b652f652b1c244031df313ebb540c75 | 64d18ccef86ff182d4577cac5a651046557685dd | refs/heads/master | 2020-05-26T22:31:35.180580 | 2019-05-24T08:27:44 | 2019-05-24T09:03:52 | 188,400,002 | 1 | 0 | null | 2019-05-24T10:08:36 | 2019-05-24T10:08:35 | null | UTF-8 | C++ | false | false | 38,271 | cc | // Copyright 2014 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.
// A Disassembler object is used to disassemble a block of code instruction by
// instruction. The default implementation of the NameConverter object can be
// overriden to modify register names or to do symbol lookup on addresses.
//
// The example below will disassemble a block of code and print it to stdout.
//
// NameConverter converter;
// Disassembler d(converter);
// for (byte* pc = begin; pc < end;) {
// v8::internal::EmbeddedVector<char, 256> buffer;
// byte* prev_pc = pc;
// pc += d.InstructionDecode(buffer, pc);
// printf("%p %08x %s\n",
// prev_pc, *reinterpret_cast<int32_t*>(prev_pc), buffer);
// }
//
// The Disassembler class also has a convenience method to disassemble a block
// of code into a FILE*, meaning that the above functionality could also be
// achieved by just calling Disassembler::Disassemble(stdout, begin, end);
#include <assert.h>
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#if V8_TARGET_ARCH_S390
#include "src/base/platform/platform.h"
#include "src/codegen/macro-assembler.h"
#include "src/codegen/register-configuration.h"
#include "src/diagnostics/disasm.h"
#include "src/s390/constants-s390.h"
namespace v8 {
namespace internal {
//------------------------------------------------------------------------------
// Decoder decodes and disassembles instructions into an output buffer.
// It uses the converter to convert register names and call destinations into
// more informative description.
class Decoder {
public:
Decoder(const disasm::NameConverter& converter, Vector<char> out_buffer)
: converter_(converter), out_buffer_(out_buffer), out_buffer_pos_(0) {
out_buffer_[out_buffer_pos_] = '\0';
}
~Decoder() {}
// Writes one disassembled instruction into 'buffer' (0-terminated).
// Returns the length of the disassembled machine instruction in bytes.
int InstructionDecode(byte* instruction);
private:
// Bottleneck functions to print into the out_buffer.
void PrintChar(const char ch);
void Print(const char* str);
// Printing of common values.
void PrintRegister(int reg);
void PrintDRegister(int reg);
void PrintSoftwareInterrupt(SoftwareInterruptCodes svc);
// Handle formatting of instructions and their options.
int FormatRegister(Instruction* instr, const char* option);
int FormatFloatingRegister(Instruction* instr, const char* option);
int FormatMask(Instruction* instr, const char* option);
int FormatDisplacement(Instruction* instr, const char* option);
int FormatImmediate(Instruction* instr, const char* option);
int FormatOption(Instruction* instr, const char* option);
void Format(Instruction* instr, const char* format);
void Unknown(Instruction* instr);
void UnknownFormat(Instruction* instr, const char* opcname);
bool DecodeSpecial(Instruction* instr);
bool DecodeGeneric(Instruction* instr);
const disasm::NameConverter& converter_;
Vector<char> out_buffer_;
int out_buffer_pos_;
DISALLOW_COPY_AND_ASSIGN(Decoder);
};
// Support for assertions in the Decoder formatting functions.
#define STRING_STARTS_WITH(string, compare_string) \
(strncmp(string, compare_string, strlen(compare_string)) == 0)
// Append the ch to the output buffer.
void Decoder::PrintChar(const char ch) { out_buffer_[out_buffer_pos_++] = ch; }
// Append the str to the output buffer.
void Decoder::Print(const char* str) {
char cur = *str++;
while (cur != '\0' && (out_buffer_pos_ < (out_buffer_.length() - 1))) {
PrintChar(cur);
cur = *str++;
}
out_buffer_[out_buffer_pos_] = 0;
}
// Print the register name according to the active name converter.
void Decoder::PrintRegister(int reg) {
Print(converter_.NameOfCPURegister(reg));
}
// Print the double FP register name according to the active name converter.
void Decoder::PrintDRegister(int reg) {
Print(RegisterName(DoubleRegister::from_code(reg)));
}
// Print SoftwareInterrupt codes. Factoring this out reduces the complexity of
// the FormatOption method.
void Decoder::PrintSoftwareInterrupt(SoftwareInterruptCodes svc) {
switch (svc) {
case kCallRtRedirected:
Print("call rt redirected");
return;
case kBreakpoint:
Print("breakpoint");
return;
default:
if (svc >= kStopCode) {
out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%d - 0x%x",
svc & kStopCodeMask, svc & kStopCodeMask);
} else {
out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%d", svc);
}
return;
}
}
// Handle all register based formatting in this function to reduce the
// complexity of FormatOption.
int Decoder::FormatRegister(Instruction* instr, const char* format) {
DCHECK_EQ(format[0], 'r');
if (format[1] == '1') { // 'r1: register resides in bit 8-11
int reg = instr->Bits<SixByteInstr, int>(39, 36);
PrintRegister(reg);
return 2;
} else if (format[1] == '2') { // 'r2: register resides in bit 12-15
int reg = instr->Bits<SixByteInstr, int>(35, 32);
// indicating it is a r0 for displacement, in which case the offset
// should be 0.
if (format[2] == 'd') {
if (reg == 0) return 4;
PrintRegister(reg);
return 3;
} else {
PrintRegister(reg);
return 2;
}
} else if (format[1] == '3') { // 'r3: register resides in bit 16-19
int reg = instr->Bits<SixByteInstr, int>(31, 28);
PrintRegister(reg);
return 2;
} else if (format[1] == '4') { // 'r4: register resides in bit 20-23
int reg = instr->Bits<SixByteInstr, int>(27, 24);
PrintRegister(reg);
return 2;
} else if (format[1] == '5') { // 'r5: register resides in bit 24-27
int reg = instr->Bits<SixByteInstr, int>(23, 20);
PrintRegister(reg);
return 2;
} else if (format[1] == '6') { // 'r6: register resides in bit 28-31
int reg = instr->Bits<SixByteInstr, int>(19, 16);
PrintRegister(reg);
return 2;
} else if (format[1] == '7') { // 'r6: register resides in bit 32-35
int reg = instr->Bits<SixByteInstr, int>(15, 12);
PrintRegister(reg);
return 2;
}
UNREACHABLE();
}
int Decoder::FormatFloatingRegister(Instruction* instr, const char* format) {
DCHECK_EQ(format[0], 'f');
// reuse 1, 5 and 6 because it is coresponding
if (format[1] == '1') { // 'r1: register resides in bit 8-11
RRInstruction* rrinstr = reinterpret_cast<RRInstruction*>(instr);
int reg = rrinstr->R1Value();
PrintDRegister(reg);
return 2;
} else if (format[1] == '2') { // 'f2: register resides in bit 12-15
RRInstruction* rrinstr = reinterpret_cast<RRInstruction*>(instr);
int reg = rrinstr->R2Value();
PrintDRegister(reg);
return 2;
} else if (format[1] == '3') { // 'f3: register resides in bit 16-19
RRDInstruction* rrdinstr = reinterpret_cast<RRDInstruction*>(instr);
int reg = rrdinstr->R1Value();
PrintDRegister(reg);
return 2;
} else if (format[1] == '5') { // 'f5: register resides in bit 24-28
RREInstruction* rreinstr = reinterpret_cast<RREInstruction*>(instr);
int reg = rreinstr->R1Value();
PrintDRegister(reg);
return 2;
} else if (format[1] == '6') { // 'f6: register resides in bit 29-32
RREInstruction* rreinstr = reinterpret_cast<RREInstruction*>(instr);
int reg = rreinstr->R2Value();
PrintDRegister(reg);
return 2;
} else if (format[1] == '4') {
VRR_E_Instruction* vrreinstr = reinterpret_cast<VRR_E_Instruction*>(instr);
int reg = vrreinstr->R4Value();
PrintDRegister(reg);
return 2;
}
UNREACHABLE();
}
// FormatOption takes a formatting string and interprets it based on
// the current instructions. The format string points to the first
// character of the option string (the option escape has already been
// consumed by the caller.) FormatOption returns the number of
// characters that were consumed from the formatting string.
int Decoder::FormatOption(Instruction* instr, const char* format) {
switch (format[0]) {
case 'o': {
if (instr->Bit(10) == 1) {
Print("o");
}
return 1;
}
case '.': {
if (instr->Bit(0) == 1) {
Print(".");
} else {
Print(" "); // ensure consistent spacing
}
return 1;
}
case 'r': {
return FormatRegister(instr, format);
}
case 'f': {
return FormatFloatingRegister(instr, format);
}
case 'i': { // int16
return FormatImmediate(instr, format);
}
case 'u': { // uint16
int32_t value = instr->Bits(15, 0);
out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%d", value);
return 6;
}
case 'l': {
// Link (LK) Bit 0
if (instr->Bit(0) == 1) {
Print("l");
}
return 1;
}
case 'a': {
// Absolute Address Bit 1
if (instr->Bit(1) == 1) {
Print("a");
}
return 1;
}
case 't': { // 'target: target of branch instructions
// target26 or target16
DCHECK(STRING_STARTS_WITH(format, "target"));
if ((format[6] == '2') && (format[7] == '6')) {
int off = ((instr->Bits(25, 2)) << 8) >> 6;
out_buffer_pos_ += SNPrintF(
out_buffer_ + out_buffer_pos_, "%+d -> %s", off,
converter_.NameOfAddress(reinterpret_cast<byte*>(instr) + off));
return 8;
} else if ((format[6] == '1') && (format[7] == '6')) {
int off = ((instr->Bits(15, 2)) << 18) >> 16;
out_buffer_pos_ += SNPrintF(
out_buffer_ + out_buffer_pos_, "%+d -> %s", off,
converter_.NameOfAddress(reinterpret_cast<byte*>(instr) + off));
return 8;
}
break;
case 'm': {
return FormatMask(instr, format);
}
}
case 'd': { // ds value for offset
return FormatDisplacement(instr, format);
}
default: {
UNREACHABLE();
}
}
UNREACHABLE();
}
int Decoder::FormatMask(Instruction* instr, const char* format) {
DCHECK_EQ(format[0], 'm');
int32_t value = 0;
if ((format[1] == '1')) { // prints the mask format in bits 8-12
value = reinterpret_cast<RRInstruction*>(instr)->R1Value();
out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "0x%x", value);
return 2;
} else if (format[1] == '2') { // mask format in bits 16-19
value = reinterpret_cast<RXInstruction*>(instr)->B2Value();
out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "0x%x", value);
return 2;
} else if (format[1] == '3') { // mask format in bits 20-23
value = reinterpret_cast<RRFInstruction*>(instr)->M4Value();
out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "0x%x", value);
return 2;
} else if (format[1] == '4') { // mask format in bits 32-35
value = reinterpret_cast<VRR_C_Instruction*>(instr)->M4Value();
out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "0x%x", value);
return 2;
} else if (format[1] == '5') { // mask format in bits 28-31
value = reinterpret_cast<VRR_C_Instruction*>(instr)->M5Value();
out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "0x%x", value);
return 2;
} else if (format[1] == '6') { // mask format in bits 24-27
value = reinterpret_cast<VRR_C_Instruction*>(instr)->M6Value();
out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "0x%x", value);
return 2;
}
out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%d", value);
return 2;
}
int Decoder::FormatDisplacement(Instruction* instr, const char* format) {
DCHECK_EQ(format[0], 'd');
if (format[1] == '1') { // displacement in 20-31
RSInstruction* rsinstr = reinterpret_cast<RSInstruction*>(instr);
uint16_t value = rsinstr->D2Value();
out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%d", value);
return 2;
} else if (format[1] == '2') { // displacement in 20-39
RXYInstruction* rxyinstr = reinterpret_cast<RXYInstruction*>(instr);
int32_t value = rxyinstr->D2Value();
out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%d", value);
return 2;
} else if (format[1] == '4') { // SS displacement 2 36-47
SSInstruction* ssInstr = reinterpret_cast<SSInstruction*>(instr);
uint16_t value = ssInstr->D2Value();
out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%d", value);
return 2;
} else if (format[1] == '3') { // SS displacement 1 20 - 32
SSInstruction* ssInstr = reinterpret_cast<SSInstruction*>(instr);
uint16_t value = ssInstr->D1Value();
out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%d", value);
return 2;
} else { // s390 specific
int32_t value = SIGN_EXT_IMM16(instr->Bits(15, 0) & ~3);
out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%d", value);
return 1;
}
}
int Decoder::FormatImmediate(Instruction* instr, const char* format) {
DCHECK_EQ(format[0], 'i');
if (format[1] == '1') { // immediate in 16-31
RIInstruction* riinstr = reinterpret_cast<RIInstruction*>(instr);
int16_t value = riinstr->I2Value();
out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%d", value);
return 2;
} else if (format[1] == '2') { // immediate in 16-48
RILInstruction* rilinstr = reinterpret_cast<RILInstruction*>(instr);
int32_t value = rilinstr->I2Value();
out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%d", value);
return 2;
} else if (format[1] == '3') { // immediate in I format
IInstruction* iinstr = reinterpret_cast<IInstruction*>(instr);
int8_t value = iinstr->IValue();
out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%d", value);
return 2;
} else if (format[1] == '4') { // immediate in 16-31, but outputs as offset
RIInstruction* riinstr = reinterpret_cast<RIInstruction*>(instr);
int16_t value = riinstr->I2Value() * 2;
if (value >= 0)
out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "*+");
else
out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "*");
out_buffer_pos_ += SNPrintF(
out_buffer_ + out_buffer_pos_, "%d -> %s", value,
converter_.NameOfAddress(reinterpret_cast<byte*>(instr) + value));
return 2;
} else if (format[1] == '5') { // immediate in 16-31, but outputs as offset
RILInstruction* rilinstr = reinterpret_cast<RILInstruction*>(instr);
int32_t value = rilinstr->I2Value() * 2;
if (value >= 0)
out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "*+");
else
out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "*");
out_buffer_pos_ += SNPrintF(
out_buffer_ + out_buffer_pos_, "%d -> %s", value,
converter_.NameOfAddress(reinterpret_cast<byte*>(instr) + value));
return 2;
} else if (format[1] == '6') { // unsigned immediate in 16-31
RIInstruction* riinstr = reinterpret_cast<RIInstruction*>(instr);
uint16_t value = riinstr->I2UnsignedValue();
out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%d", value);
return 2;
} else if (format[1] == '7') { // unsigned immediate in 16-47
RILInstruction* rilinstr = reinterpret_cast<RILInstruction*>(instr);
uint32_t value = rilinstr->I2UnsignedValue();
out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%d", value);
return 2;
} else if (format[1] == '8') { // unsigned immediate in 8-15
SSInstruction* ssinstr = reinterpret_cast<SSInstruction*>(instr);
uint8_t value = ssinstr->Length();
out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%d", value);
return 2;
} else if (format[1] == '9') { // unsigned immediate in 16-23
RIEInstruction* rie_instr = reinterpret_cast<RIEInstruction*>(instr);
uint8_t value = rie_instr->I3Value();
out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%d", value);
return 2;
} else if (format[1] == 'a') { // unsigned immediate in 24-31
RIEInstruction* rie_instr = reinterpret_cast<RIEInstruction*>(instr);
uint8_t value = rie_instr->I4Value();
out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%d", value);
return 2;
} else if (format[1] == 'b') { // unsigned immediate in 32-39
RIEInstruction* rie_instr = reinterpret_cast<RIEInstruction*>(instr);
uint8_t value = rie_instr->I5Value();
out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%d", value);
return 2;
} else if (format[1] == 'c') { // signed immediate in 8-15
SSInstruction* ssinstr = reinterpret_cast<SSInstruction*>(instr);
int8_t value = ssinstr->Length();
out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%d", value);
return 2;
} else if (format[1] == 'd') { // signed immediate in 32-47
SILInstruction* silinstr = reinterpret_cast<SILInstruction*>(instr);
int16_t value = silinstr->I2Value();
out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "%d", value);
return 2;
} else if (format[1] == 'e') { // immediate in 16-47, but outputs as offset
RILInstruction* rilinstr = reinterpret_cast<RILInstruction*>(instr);
int32_t value = rilinstr->I2Value() * 2;
if (value >= 0)
out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "*+");
else
out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_, "*");
out_buffer_pos_ += SNPrintF(
out_buffer_ + out_buffer_pos_, "%d -> %s", value,
converter_.NameOfAddress(reinterpret_cast<byte*>(instr) + value));
return 2;
}
UNREACHABLE();
}
// Format takes a formatting string for a whole instruction and prints it into
// the output buffer. All escaped options are handed to FormatOption to be
// parsed further.
void Decoder::Format(Instruction* instr, const char* format) {
char cur = *format++;
while ((cur != 0) && (out_buffer_pos_ < (out_buffer_.length() - 1))) {
if (cur == '\'') { // Single quote is used as the formatting escape.
format += FormatOption(instr, format);
} else {
out_buffer_[out_buffer_pos_++] = cur;
}
cur = *format++;
}
out_buffer_[out_buffer_pos_] = '\0';
}
// The disassembler may end up decoding data inlined in the code. We do not want
// it to crash if the data does not resemble any known instruction.
#define VERIFY(condition) \
if (!(condition)) { \
Unknown(instr); \
return; \
}
// For currently unimplemented decodings the disassembler calls Unknown(instr)
// which will just print "unknown" of the instruction bits.
void Decoder::Unknown(Instruction* instr) { Format(instr, "unknown"); }
// For currently unimplemented decodings the disassembler calls
// UnknownFormat(instr) which will just print opcode name of the
// instruction bits.
void Decoder::UnknownFormat(Instruction* instr, const char* name) {
char buffer[100];
snprintf(buffer, sizeof(buffer), "%s (unknown-format)", name);
Format(instr, buffer);
}
#undef VERIFY
#undef STRING_STARTS_WITH
// Handles special cases of instructions;
// @return true if successfully decoded
bool Decoder::DecodeSpecial(Instruction* instr) {
Opcode opcode = instr->S390OpcodeValue();
switch (opcode) {
case BKPT:
Format(instr, "bkpt");
break;
case DUMY:
Format(instr, "dumy\t'r1, 'd2 ( 'r2d, 'r3 )");
break;
/* RR format */
case LDR:
Format(instr, "ldr\t'f1,'f2");
break;
case BCR:
Format(instr, "bcr\t'm1,'r2");
break;
case OR:
Format(instr, "or\t'r1,'r2");
break;
case CR:
Format(instr, "cr\t'r1,'r2");
break;
case MR:
Format(instr, "mr\t'r1,'r2");
break;
case HER_Z:
Format(instr, "her\t'r1,'r2");
break;
/* RI-b format */
case BRAS:
Format(instr, "bras\t'r1,'i1");
break;
/* RRE format */
case MDBR:
Format(instr, "mdbr\t'f5,'f6");
break;
case SDBR:
Format(instr, "sdbr\t'f5,'f6");
break;
case ADBR:
Format(instr, "adbr\t'f5,'f6");
break;
case CDBR:
Format(instr, "cdbr\t'f5,'f6");
break;
case MEEBR:
Format(instr, "meebr\t'f5,'f6");
break;
case SQDBR:
Format(instr, "sqdbr\t'f5,'f6");
break;
case SQEBR:
Format(instr, "sqebr\t'f5,'f6");
break;
case LCDBR:
Format(instr, "lcdbr\t'f5,'f6");
break;
case LCEBR:
Format(instr, "lcebr\t'f5,'f6");
break;
case LTEBR:
Format(instr, "ltebr\t'f5,'f6");
break;
case LDEBR:
Format(instr, "ldebr\t'f5,'f6");
break;
case CEBR:
Format(instr, "cebr\t'f5,'f6");
break;
case AEBR:
Format(instr, "aebr\t'f5,'f6");
break;
case SEBR:
Format(instr, "sebr\t'f5,'f6");
break;
case DEBR:
Format(instr, "debr\t'f5,'f6");
break;
case LTDBR:
Format(instr, "ltdbr\t'f5,'f6");
break;
case LDGR:
Format(instr, "ldgr\t'f5,'f6");
break;
case DDBR:
Format(instr, "ddbr\t'f5,'f6");
break;
case LZDR:
Format(instr, "lzdr\t'f5");
break;
/* RRF-e format */
case FIEBRA:
Format(instr, "fiebra\t'f5,'m2,'f6,'m3");
break;
case FIDBRA:
Format(instr, "fidbra\t'f5,'m2,'f6,'m3");
break;
/* RX-a format */
case IC_z:
Format(instr, "ic\t'r1,'d1('r2d,'r3)");
break;
case AL:
Format(instr, "al\t'r1,'d1('r2d,'r3)");
break;
case LE:
Format(instr, "le\t'f1,'d1('r2d,'r3)");
break;
case LD:
Format(instr, "ld\t'f1,'d1('r2d,'r3)");
break;
case STE:
Format(instr, "ste\t'f1,'d1('r2d,'r3)");
break;
case STD:
Format(instr, "std\t'f1,'d1('r2d,'r3)");
break;
/* S format */
// TRAP4 is used in calling to native function. it will not be generated
// in native code.
case TRAP4:
Format(instr, "trap4");
break;
/* RIL-a format */
case CFI:
Format(instr, "cfi\t'r1,'i2");
break;
case CGFI:
Format(instr, "cgfi\t'r1,'i2");
break;
case AFI:
Format(instr, "afi\t'r1,'i2");
break;
case AGFI:
Format(instr, "agfi\t'r1,'i2");
break;
case MSFI:
Format(instr, "msfi\t'r1,'i2");
break;
case MSGFI:
Format(instr, "msgfi\t'r1,'i2");
break;
case ALSIH:
Format(instr, "alsih\t'r1,'i2");
break;
case ALSIHN:
Format(instr, "alsihn\t'r1,'i2");
break;
case CIH:
Format(instr, "cih\t'r1,'i2");
break;
case AIH:
Format(instr, "aih\t'r1,'i2");
break;
case LGFI:
Format(instr, "lgfi\t'r1,'i2");
break;
/* SIY format */
case ASI:
Format(instr, "asi\t'd2('r3),'ic");
break;
case AGSI:
Format(instr, "agsi\t'd2('r3),'ic");
break;
/* RXY-a format */
case LT:
Format(instr, "lt\t'r1,'d2('r2d,'r3)");
break;
case LDY:
Format(instr, "ldy\t'f1,'d2('r2d,'r3)");
break;
case LEY:
Format(instr, "ley\t'f1,'d2('r2d,'r3)");
break;
case STDY:
Format(instr, "stdy\t'f1,'d2('r2d,'r3)");
break;
case STEY:
Format(instr, "stey\t'f1,'d2('r2d,'r3)");
break;
/* RXE format */
case LDEB:
Format(instr, "ldeb\t'f1,'d2('r2d,'r3)");
break;
default:
return false;
}
return true;
}
// Handles common cases of instructions;
// @return true if successfully decoded
bool Decoder::DecodeGeneric(Instruction* instr) {
Opcode opcode = instr->S390OpcodeValue();
switch (opcode) {
/* 2 bytes */
#define DECODE_RR_INSTRUCTIONS(name, opcode_name, opcode_value) \
case opcode_name: \
Format(instr, #name "\t'r1,'r2"); \
break;
S390_RR_OPCODE_LIST(DECODE_RR_INSTRUCTIONS)
#undef DECODE_RR_INSTRUCTIONS
/* 4 bytes */
#define DECODE_RS_A_INSTRUCTIONS(name, opcode_name, opcode_value) \
case opcode_name: \
Format(instr, #name "\t'r1,'r2,'d1('r3)"); \
break;
S390_RS_A_OPCODE_LIST(DECODE_RS_A_INSTRUCTIONS)
#undef DECODE_RS_A_INSTRUCTIONS
#define DECODE_RSI_INSTRUCTIONS(name, opcode_name, opcode_value) \
case opcode_name: \
Format(instr, #name "\t'r1,'r2,'i4"); \
break;
S390_RSI_OPCODE_LIST(DECODE_RSI_INSTRUCTIONS)
#undef DECODE_RSI_INSTRUCTIONS
#define DECODE_RI_A_INSTRUCTIONS(name, opcode_name, opcode_value) \
case opcode_name: \
Format(instr, #name "\t'r1,'i1"); \
break;
S390_RI_A_OPCODE_LIST(DECODE_RI_A_INSTRUCTIONS)
#undef DECODE_RI_A_INSTRUCTIONS
#define DECODE_RI_B_INSTRUCTIONS(name, opcode_name, opcode_value) \
case opcode_name: \
Format(instr, #name "\t'r1,'i4"); \
break;
S390_RI_B_OPCODE_LIST(DECODE_RI_B_INSTRUCTIONS)
#undef DECODE_RI_B_INSTRUCTIONS
#define DECODE_RI_C_INSTRUCTIONS(name, opcode_name, opcode_value) \
case opcode_name: \
Format(instr, #name "\t'm1,'i4"); \
break;
S390_RI_C_OPCODE_LIST(DECODE_RI_C_INSTRUCTIONS)
#undef DECODE_RI_C_INSTRUCTIONS
#define DECODE_RRE_INSTRUCTIONS(name, opcode_name, opcode_value) \
case opcode_name: \
Format(instr, #name "\t'r5,'r6"); \
break;
S390_RRE_OPCODE_LIST(DECODE_RRE_INSTRUCTIONS)
#undef DECODE_RRE_INSTRUCTIONS
#define DECODE_RRF_A_INSTRUCTIONS(name, opcode_name, opcode_val) \
case opcode_name: \
Format(instr, #name "\t'r5,'r6,'r3"); \
break;
S390_RRF_A_OPCODE_LIST(DECODE_RRF_A_INSTRUCTIONS)
#undef DECODE_RRF_A_INSTRUCTIONS
#define DECODE_RRF_C_INSTRUCTIONS(name, opcode_name, opcode_val) \
case opcode_name: \
Format(instr, #name "\t'r5,'r6,'m2"); \
break;
S390_RRF_C_OPCODE_LIST(DECODE_RRF_C_INSTRUCTIONS)
#undef DECODE_RRF_C_INSTRUCTIONS
#define DECODE_RRF_E_INSTRUCTIONS(name, opcode_name, opcode_val) \
case opcode_name: \
Format(instr, #name "\t'r5,'m2,'f6"); \
break;
S390_RRF_E_OPCODE_LIST(DECODE_RRF_E_INSTRUCTIONS)
#undef DECODE_RRF_E_INSTRUCTIONS
#define DECODE_RX_A_INSTRUCTIONS(name, opcode_name, opcode_value) \
case opcode_name: \
Format(instr, #name "\t'r1,'d1('r2d,'r3)"); \
break;
S390_RX_A_OPCODE_LIST(DECODE_RX_A_INSTRUCTIONS)
#undef DECODE_RX_A_INSTRUCTIONS
#define DECODE_RX_B_INSTRUCTIONS(name, opcode_name, opcode_value) \
case opcode_name: \
Format(instr, #name "\t'm1,'d1('r2d,'r3)"); \
break;
S390_RX_B_OPCODE_LIST(DECODE_RX_B_INSTRUCTIONS)
#undef DECODE_RX_B_INSTRUCTIONS
#define DECODE_RRD_INSTRUCTIONS(name, opcode_name, opcode_value) \
case opcode_name: \
Format(instr, #name "\t'f3,'f5,'f6"); \
break;
S390_RRD_OPCODE_LIST(DECODE_RRD_INSTRUCTIONS)
#undef DECODE_RRD_INSTRUCTIONS
#define DECODE_SI_INSTRUCTIONS(name, opcode_name, opcode_value) \
case opcode_name: \
Format(instr, #name "\t'd1('r3),'i8"); \
break;
S390_SI_OPCODE_LIST(DECODE_SI_INSTRUCTIONS)
#undef DECODE_SI_INSTRUCTIONS
/* 6 bytes */
#define DECODE_VRR_A_INSTRUCTIONS(name, opcode_name, opcode_value) \
case opcode_name: \
Format(instr, #name "\t'f1,'f2,'m4,'m5,'m6"); \
break;
S390_VRR_A_OPCODE_LIST(DECODE_VRR_A_INSTRUCTIONS)
#undef DECODE_VRR_A_INSTRUCTIONS
#define DECODE_VRR_B_INSTRUCTIONS(name, opcode_name, opcode_value) \
case opcode_name: \
Format(instr, #name "\t'f1,'f2,'f3,'m4,'m6"); \
break;
S390_VRR_B_OPCODE_LIST(DECODE_VRR_B_INSTRUCTIONS)
#undef DECODE_VRR_B_INSTRUCTIONS
#define DECODE_VRR_C_INSTRUCTIONS(name, opcode_name, opcode_value) \
case opcode_name: \
Format(instr, #name "\t'f1,'f2,'f3,'m4"); \
break;
S390_VRR_C_OPCODE_LIST(DECODE_VRR_C_INSTRUCTIONS)
#undef DECODE_VRR_C_INSTRUCTIONS
#define DECODE_VRR_E_INSTRUCTIONS(name, opcode_name, opcode_value) \
case opcode_name: \
Format(instr, #name "\t'f1,'f2,'f3,'f4,'m5,'m3"); \
break;
S390_VRR_E_OPCODE_LIST(DECODE_VRR_E_INSTRUCTIONS)
#undef DECODE_VRR_E_INSTRUCTIONS
#define DECODE_VRX_INSTRUCTIONS(name, opcode_name, opcode_value) \
case opcode_name: \
Format(instr, #name "\t'f1,'d1('r2d,'r3),'m4"); \
break;
S390_VRX_OPCODE_LIST(DECODE_VRX_INSTRUCTIONS)
#undef DECODE_VRX_INSTRUCTIONS
#define DECODE_VRS_A_INSTRUCTIONS(name, opcode_name, opcode_value) \
case opcode_name: \
Format(instr, #name "\t'f1,'f2,'d1('r3),'m4"); \
break;
S390_VRS_A_OPCODE_LIST(DECODE_VRS_A_INSTRUCTIONS)
#undef DECODE_VRS_A_INSTRUCTIONS
#define DECODE_VRS_B_INSTRUCTIONS(name, opcode_name, opcode_value) \
case opcode_name: \
Format(instr, #name "\t'f1,'r2,'d1('r3),'m4"); \
break;
S390_VRS_B_OPCODE_LIST(DECODE_VRS_B_INSTRUCTIONS)
#undef DECODE_VRS_B_INSTRUCTIONS
#define DECODE_VRS_C_INSTRUCTIONS(name, opcode_name, opcode_value) \
case opcode_name: \
Format(instr, #name "\t'r1,'f2,'d1('r3),'m4"); \
break;
S390_VRS_C_OPCODE_LIST(DECODE_VRS_C_INSTRUCTIONS)
#undef DECODE_VRS_C_INSTRUCTIONS
#define DECODE_VRI_A_INSTRUCTIONS(name, opcode_name, opcode_value) \
case opcode_name: \
Format(instr, #name "\t'f1,'i1,'m4"); \
break;
S390_VRI_A_OPCODE_LIST(DECODE_VRI_A_INSTRUCTIONS)
#undef DECODE_VRI_A_INSTRUCTIONS
#define DECODE_VRI_C_INSTRUCTIONS(name, opcode_name, opcode_value) \
case opcode_name: \
Format(instr, #name "\t'f1,'f2,'i1,'m4"); \
break;
S390_VRI_C_OPCODE_LIST(DECODE_VRI_C_INSTRUCTIONS)
#undef DECODE_VRI_C_INSTRUCTIONS
#define DECODE_RIL_A_INSTRUCTIONS(name, opcode_name, opcode_value) \
case opcode_name: \
Format(instr, #name "\t'r1,'i7"); \
break;
S390_RIL_A_OPCODE_LIST(DECODE_RIL_A_INSTRUCTIONS)
#undef DECODE_RIL_A_INSTRUCTIONS
#define DECODE_RIL_B_INSTRUCTIONS(name, opcode_name, opcode_value) \
case opcode_name: \
Format(instr, #name "\t'r1,'ie"); \
break;
S390_RIL_B_OPCODE_LIST(DECODE_RIL_B_INSTRUCTIONS)
#undef DECODE_RIL_B_INSTRUCTIONS
#define DECODE_RIL_C_INSTRUCTIONS(name, opcode_name, opcode_value) \
case opcode_name: \
Format(instr, #name "\t'm1,'ie"); \
break;
S390_RIL_C_OPCODE_LIST(DECODE_RIL_C_INSTRUCTIONS)
#undef DECODE_RIL_C_INSTRUCTIONS
#define DECODE_SIY_INSTRUCTIONS(name, opcode_name, opcode_value) \
case opcode_name: \
Format(instr, #name "\t'd2('r3),'i8"); \
break;
S390_SIY_OPCODE_LIST(DECODE_SIY_INSTRUCTIONS)
#undef DECODE_SIY_INSTRUCTIONS
#define DECODE_RIE_D_INSTRUCTIONS(name, opcode_name, opcode_value) \
case opcode_name: \
Format(instr, #name "\t'r1,'r2,'i1"); \
break;
S390_RIE_D_OPCODE_LIST(DECODE_RIE_D_INSTRUCTIONS)
#undef DECODE_RIE_D_INSTRUCTIONS
#define DECODE_RIE_E_INSTRUCTIONS(name, opcode_name, opcode_value) \
case opcode_name: \
Format(instr, #name "\t'r1,'r2,'i4"); \
break;
S390_RIE_E_OPCODE_LIST(DECODE_RIE_E_INSTRUCTIONS)
#undef DECODE_RIE_E_INSTRUCTIONS
#define DECODE_RIE_F_INSTRUCTIONS(name, opcode_name, opcode_value) \
case opcode_name: \
Format(instr, #name "\t'r1,'r2,'i9,'ia,'ib"); \
break;
S390_RIE_F_OPCODE_LIST(DECODE_RIE_F_INSTRUCTIONS)
#undef DECODE_RIE_F_INSTRUCTIONS
#define DECODE_RSY_A_INSTRUCTIONS(name, opcode_name, opcode_value) \
case opcode_name: \
Format(instr, #name "\t'r1,'r2,'d2('r3)"); \
break;
S390_RSY_A_OPCODE_LIST(DECODE_RSY_A_INSTRUCTIONS)
#undef DECODE_RSY_A_INSTRUCTIONS
#define DECODE_RSY_B_INSTRUCTIONS(name, opcode_name, opcode_value) \
case opcode_name: \
Format(instr, #name "\t'm2,'r1,'d2('r3)"); \
break;
S390_RSY_B_OPCODE_LIST(DECODE_RSY_B_INSTRUCTIONS)
#undef DECODE_RSY_B_INSTRUCTIONS
#define DECODE_RXY_A_INSTRUCTIONS(name, opcode_name, opcode_value) \
case opcode_name: \
Format(instr, #name "\t'r1,'d2('r2d,'r3)"); \
break;
S390_RXY_A_OPCODE_LIST(DECODE_RXY_A_INSTRUCTIONS)
#undef DECODE_RXY_A_INSTRUCTIONS
#define DECODE_RXY_B_INSTRUCTIONS(name, opcode_name, opcode_value) \
case opcode_name: \
Format(instr, #name "\t'm1,'d2('r2d,'r3)"); \
break;
S390_RXY_B_OPCODE_LIST(DECODE_RXY_B_INSTRUCTIONS)
#undef DECODE_RXY_B_INSTRUCTIONS
#define DECODE_RXE_INSTRUCTIONS(name, opcode_name, opcode_value) \
case opcode_name: \
Format(instr, #name "\t'f1,'d1('r2d, 'r3)"); \
break;
S390_RXE_OPCODE_LIST(DECODE_RXE_INSTRUCTIONS)
#undef DECODE_RXE_INSTRUCTIONS
#define DECODE_SIL_INSTRUCTIONS(name, opcode_name, opcode_value) \
case opcode_name: \
Format(instr, #name "\t'd3('r3),'id"); \
break;
S390_SIL_OPCODE_LIST(DECODE_SIL_INSTRUCTIONS)
#undef DECODE_SIL_INSTRUCTIONS
#define DECODE_SS_A_INSTRUCTIONS(name, opcode_name, opcode_value) \
case opcode_name: \
Format(instr, #name "\t'd3('i8,'r3),'d4('r7)"); \
break;
S390_SS_A_OPCODE_LIST(DECODE_SS_A_INSTRUCTIONS)
#undef DECODE_SS_A_INSTRUCTIONS
default:
return false;
}
return true;
}
// Disassemble the instruction at *instr_ptr into the output buffer.
int Decoder::InstructionDecode(byte* instr_ptr) {
Instruction* instr = Instruction::At(instr_ptr);
int instrLength = instr->InstructionLength();
// Print the Instruction bits.
if (instrLength == 2) {
out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
"%04x ", instr->InstructionBits<TwoByteInstr>());
} else if (instrLength == 4) {
out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
"%08x ", instr->InstructionBits<FourByteInstr>());
} else {
out_buffer_pos_ += SNPrintF(out_buffer_ + out_buffer_pos_,
"%012" PRIx64 " ", instr->InstructionBits<SixByteInstr>());
}
bool decoded = DecodeSpecial(instr);
if (!decoded)
decoded = DecodeGeneric(instr);
if (!decoded)
Unknown(instr);
return instrLength;
}
} // namespace internal
} // namespace v8
//------------------------------------------------------------------------------
namespace disasm {
const char* NameConverter::NameOfAddress(byte* addr) const {
v8::internal::SNPrintF(tmp_buffer_, "%p", static_cast<void*>(addr));
return tmp_buffer_.begin();
}
const char* NameConverter::NameOfConstant(byte* addr) const {
return NameOfAddress(addr);
}
const char* NameConverter::NameOfCPURegister(int reg) const {
return RegisterName(i::Register::from_code(reg));
}
const char* NameConverter::NameOfByteCPURegister(int reg) const {
UNREACHABLE(); // S390 does not have the concept of a byte register
}
const char* NameConverter::NameOfXMMRegister(int reg) const {
// S390 does not have XMM register
// TODO(joransiu): Consider update this for Vector Regs
UNREACHABLE();
}
const char* NameConverter::NameInCode(byte* addr) const {
// The default name converter is called for unknown code. So we will not try
// to access any memory.
return "";
}
//------------------------------------------------------------------------------
int Disassembler::InstructionDecode(v8::internal::Vector<char> buffer,
byte* instruction) {
v8::internal::Decoder d(converter_, buffer);
return d.InstructionDecode(instruction);
}
// The S390 assembler does not currently use constant pools.
int Disassembler::ConstantPoolSizeAt(byte* instruction) { return -1; }
void Disassembler::Disassemble(FILE* f, byte* begin, byte* end,
UnimplementedOpcodeAction unimplemented_action) {
NameConverter converter;
Disassembler d(converter, unimplemented_action);
for (byte* pc = begin; pc < end;) {
v8::internal::EmbeddedVector<char, 128> buffer;
buffer[0] = '\0';
byte* prev_pc = pc;
pc += d.InstructionDecode(buffer, pc);
v8::internal::PrintF(f, "%p %08x %s\n", static_cast<void*>(prev_pc),
*reinterpret_cast<int32_t*>(prev_pc), buffer.begin());
}
}
} // namespace disasm
#endif // V8_TARGET_ARCH_S390
| [
"commit-bot@chromium.org"
] | commit-bot@chromium.org |
17491f2234de1390ee67e9a61421c8f2452e4827 | 0176f9982a21aba65e27c56c282d6f52d1652bdc | /Source/ShooterGame/Classes/Player/ShooterPlayerController_Menu.h | 928fe594100d320c17015ca4cd453edd67792917 | [] | no_license | joeypla/SimBiotic | 006575b9762a85bab09530f17518611d04c8224e | 3ffa1f1dd99d65bf6718256367350a2aef3d7d28 | refs/heads/master | 2021-01-18T01:33:00.042976 | 2015-01-09T04:04:06 | 2015-01-09T04:04:06 | 28,893,905 | 3 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 330 | h | // Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
#include "ShooterTypes.h"
#include "ShooterPlayerController_Menu.generated.h"
UCLASS()
class AShooterPlayerController_Menu : public APlayerController
{
GENERATED_UCLASS_BODY()
/** After game is initialized */
virtual void PostInitializeComponents() override;
};
| [
"joey.pla@gmail.com"
] | joey.pla@gmail.com |
8beea1809181348d076152d32c70f26199c0afcf | c365d25ee2237b3c260198827b33b0253d43eaf4 | /spoj/micemaze.cpp | 457ff3de938cba01fef5ca1d00a4f5a8eba7c1f1 | [] | no_license | germanohn/competitive-programming | fb1249910ce951fe290e9a5be3876d3870ab8aa3 | fab9dc0e2998dd395c1b9d6639f8c187cf637669 | refs/heads/master | 2021-06-12T08:17:52.907705 | 2021-03-17T19:06:19 | 2021-03-17T19:06:19 | 58,595,999 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,348 | cpp | /* faz um dijkstra de cada rato ate a saida e ve se passa no tempo
// Cuidado: primeiro tinha tentado fazer um dijkstra so da saida
// para todos. Mas isso nao vale pois o grafo é direcionado*/
#include <bits/stdc++.h>
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
using namespace std;
typedef pair<int, int> pii;
const int MAX = 105;
int n, e, t, m;
int dis[MAX];
vector<pii> adj[MAX];
void solve (int no) {
priority_queue<pii> p;
dis[no] = 0;
p.push (mp (0, no));
while (!p.empty ()) {
int x = p.top ().ss;
p.pop ();
for (int i = 0; i < adj[x].size (); i++) {
pii next = adj[x][i];
if (dis[next.ff] > dis[x] + next.ss) {
dis[next.ff] = dis[x] + next.ss;
p.push (mp (-dis[next.ff], next.ff));
}
}
}
}
int main () {
scanf ("%d %d %d %d", &n, &e, &t, &m);
int a, b, p;
for (int i = 0; i < m; i++) {
scanf ("%d %d %d", &a, &b, &p);
adj[a].pb (mp (b, p));
}
int cont = 1;
for (int i = 1; i <= n; i++) {
if (i != e) {
for (int j = 1; j <= n; j++) {
dis[j] = INT_MAX;
}
solve (i);
if (dis[e] <= t) {
cont++;
}
}
}
printf ("%d\n", cont);
}
| [
"germanohn@hotmail.com"
] | germanohn@hotmail.com |
d5a0857cb90a057fb16da724572d4e7b5a05165f | 31c3e1b5b749c180f62996108a317d836d8d7e0e | /FactorNode3/FactorClass.cpp | e276628576f5fcd03992d2f128429c399e52da44 | [] | no_license | kingpeterking/FactorNode3 | c06fe8ce6fa47b0359a715d5d3cddfbfd6ad1ee5 | a13100381bd9cf7c65b7109576a6c0e6dfc68dd7 | refs/heads/master | 2021-07-01T20:14:23.075173 | 2017-09-10T15:14:01 | 2017-09-10T15:14:01 | 103,039,381 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,315 | cpp | #include "stdafx.h"
#include "FactorClass.h"
#include "iostream"
using namespace std;
FactorNode::FactorNode()
{
// Create 0 as a Long Number
LongNumber Zero(1);
Zero.SetLongNumber(0, 0);
Zero.SetLongNumberBase(10);
Zero.SetLongNumberSign(0);
// Creates a new node
ParentNode = nullptr;
NumberOfChildren = 0; // Haven't added children yet
Level = 0;
AValue = Zero;
BValue = Zero;
Total = Zero;
Remainder = Zero;
FactorComplete = false;
}
FactorNode::FactorNode(FactorNode * FactorNodeParentPassed, int LevelPassed, LongNumber AValuePassed, LongNumber BValuePassed, LongNumber TotalPassed, LongNumber RemainderPassed, bool FactorCompletePassed)
{
// Creates a new node
ParentNode = FactorNodeParentPassed;
NumberOfChildren = 0; // Haven't added children yet
Level = LevelPassed;
AValue = AValuePassed;
BValue = BValuePassed;
Total = TotalPassed;
Remainder = RemainderPassed;
ChildrenNodes = new FactorNode*[20](); // create space for 20 children
FactorComplete = FactorCompletePassed;
}
FactorNode::~FactorNode()
{
}
void FactorNode::FactorNodeAddChild(FactorNode* FactorNodeChildPassed)
{
NumberOfChildren++;
ChildrenNodes[NumberOfChildren] = FactorNodeChildPassed;
}
FactorNode *FactorNode::GetChild(int iChildIndex)
{
return ChildrenNodes[iChildIndex];
}
FactorNode * FactorNode::GetParentFromChild()
{
return ParentNode;
}
FactorNode * GetChildFromParent(FactorNode * Parent, int iChildIndex)
{
return Parent->ChildrenNodes[iChildIndex];
}
void FactorNode::SetChild(FactorNode & Child)
{
NumberOfChildren++;
ChildrenNodes[NumberOfChildren] = &Child;
}
void SetParentChild(FactorNode * Parent, FactorNode & Child)
{
int iNoChildren = Parent->GetNumberOfChidren();
Parent->ChildrenNodes[iNoChildren] = &Child;
iNoChildren++;
Parent->SetNumberOfChildren(iNoChildren);
}
void FactorNode::SetAValue(LongNumber AValuePassed)
{
AValue = AValuePassed;
}
void FactorNode::SetBValue(LongNumber BValuePassed)
{
BValue = BValuePassed;
}
void FactorNode::SetRemainder(LongNumber RemainderPassed)
{
Remainder = RemainderPassed;
}
void FactorNode::SetNumberOfChildren(int NumberOfChildrenPassed)
{
NumberOfChildren = NumberOfChildrenPassed;
}
void FactorNode::SetFactorComplete(bool YN)
{
FactorComplete = YN;
}
LongNumber FactorNode::GetAValue()
{
return AValue;
}
LongNumber FactorNode::GetBValue()
{
return BValue;
}
LongNumber FactorNode::GetRemainder()
{
return Remainder;
}
LongNumber FactorNode::GetTotal()
{
return Total;
}
int FactorNode::GetLevel()
{
return Level;
}
int FactorNode::GetNumberOfChidren()
{
return NumberOfChildren;
}
bool FactorNode::GetFactorComplete()
{
return FactorComplete;
}
void PrintFactorNode(FactorNode * FNode)
{
// Print the details for this node
cout << "Node : " << endl;
cout << " NumberOfChildren : " << FNode->GetNumberOfChidren() << endl;
cout << " Level : " << FNode->GetLevel() << endl;
cout << " AValue : ";
PrintLongNumberLR(FNode->GetAValue());
cout << " BValue : ";
PrintLongNumberLR(FNode->GetBValue());
cout << " Total : ";
PrintLongNumberLR(FNode->GetTotal());
cout << " Remainder : ";
PrintLongNumberLR(FNode->GetRemainder());
cout << " Factor Complete: ";
if (FNode->GetFactorComplete())
{
cout << "Y";
}
else
{
cout << "N";
}
cout << endl;
}
| [
"king.peter.king@gmail.com"
] | king.peter.king@gmail.com |
150cf8cecafe083fbdc4bfdb9d96049b579448bd | a46013ab49c9d82ae57e7f0aa7b9c9190bc77cb1 | /p2/macros.hpp | 1af451a4518c03ddebbbce06af0ce450a5945ccf | [] | no_license | fernansd/ED | 1a5a18acd017a8dd37abdd68cef748e83c4324af | 632e8b33eda8c431b0d8c6cdeb80ecb715a5e212 | refs/heads/master | 2021-01-21T14:01:22.394293 | 2016-06-02T11:16:41 | 2016-06-02T11:16:41 | 52,434,188 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 802 | hpp | /*!
\file macros.hpp
\brief Macros para el diseño de pantallas
*/
#ifndef MACROS_HPP
#define MACROS_HPP
/// Macro que permite situar el cursor en cualquier posición de la consola
#define LUGAR(x,y) printf("\033[%d;%dH",x,y)
/// Macro que borra por completo la consola de comandos
#define BORRAR printf("\33[2J")
/// Macro que crea un efecto parpadeante sobre texto
#define PARPADEO printf("%c[5m",27)
/// Macro que desactiva los efectos de texto, a partir de su uso
#define APAGA printf("%c[0m",27)
/// Macro que invierte los colores aplicados sobre el texto
#define INVERSO printf("%c[7m",27)
/// Macro que crea un efecto de subrayado sobre el texto
#define SUBRAYADO printf("%c[4m",27)
/// Macro que resalta el texto
#define INTENSIDAD printf("%c[1m",27)
#endif
| [
"i42sadef@uco.es"
] | i42sadef@uco.es |
b2ce6fa3e78366272246abc5c5c203fe6fefbaec | baf1b9b4efd0e2082b639458174f98b1736868e9 | /Sonar Battles/Category.hpp | 435a1200eacd79fbc203e2ddec644c20f18c97ac | [] | no_license | KarelCasier/Sonar-Battles | fd7b87a02779657226212ddb3f64b78edafcd85a | a650801bb1e3817bd586baf1ed838f12409d92c6 | refs/heads/master | 2021-01-10T19:06:05.967679 | 2014-07-18T20:09:05 | 2014-07-18T20:09:05 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 268 | hpp | #pragma once
// GameObject category, used to dispatch commands
namespace Category
{
enum Type
{
None = 0,
Scene = 1 << 0,
PlayerSub = 1 << 1,
EnemySub = 1 << 2,
PlayerProjectile = 1 << 3,
EnemyProjectile = 1 << 4,
Unknown = 1 << 10,
};
} | [
"KarelCasier@me.com"
] | KarelCasier@me.com |
58c8bb2dbf4b0022b399736c6048cea392eb6f77 | 5592ad8f55d8a59af9b39ec4141538725b584d6b | /src/masternode.cpp | 8d47616e245a0278e7c25ee7589a8daa3bb45ed7 | [
"MIT"
] | permissive | ccbcryptocashback/CCB | cb87071d01e70ae76124b5995fb1f007e8e74037 | 805df4e1003bdaf4b9be8333b1b04890170954db | refs/heads/master | 2020-03-20T20:02:38.322772 | 2018-05-20T09:42:51 | 2018-05-20T09:42:51 | 137,667,434 | 0 | 1 | MIT | 2018-07-07T23:39:38 | 2018-06-17T15:58:10 | C++ | UTF-8 | C++ | false | false | 28,455 | cpp | // Copyright (c) 2014-2015 The Dash developers
// Copyright (c) 2015-2017 The PIVX developers
// Copyright (c) 2018 The CryptoCashBack developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "masternode.h"
#include "addrman.h"
#include "masternodeman.h"
#include "Darksend.h"
#include "sync.h"
#include "util.h"
#include <boost/lexical_cast.hpp>
// keep track of the scanning errors I've seen
map<uint256, int> mapSeenMasternodeScanningErrors;
// cache block hashes as we calculate them
std::map<int64_t, uint256> mapCacheBlockHashes;
//Get the last hash that matches the modulus given. Processed in reverse order
bool GetBlockHash(uint256& hash, int nBlockHeight)
{
if (chainActive.Tip() == NULL) return false;
if (nBlockHeight == 0)
nBlockHeight = chainActive.Tip()->nHeight;
if (mapCacheBlockHashes.count(nBlockHeight)) {
hash = mapCacheBlockHashes[nBlockHeight];
return true;
}
const CBlockIndex* BlockLastSolved = chainActive.Tip();
const CBlockIndex* BlockReading = chainActive.Tip();
if (BlockLastSolved == NULL || BlockLastSolved->nHeight == 0 || chainActive.Tip()->nHeight + 1 < nBlockHeight) return false;
int nBlocksAgo = 0;
if (nBlockHeight > 0) nBlocksAgo = (chainActive.Tip()->nHeight + 1) - nBlockHeight;
assert(nBlocksAgo >= 0);
int n = 0;
for (unsigned int i = 1; BlockReading && BlockReading->nHeight > 0; i++) {
if (n >= nBlocksAgo) {
hash = BlockReading->GetBlockHash();
mapCacheBlockHashes[nBlockHeight] = hash;
return true;
}
n++;
if (BlockReading->pprev == NULL) {
assert(BlockReading);
break;
}
BlockReading = BlockReading->pprev;
}
return false;
}
CMasternode::CMasternode()
{
LOCK(cs);
vin = CTxIn();
addr = CService();
pubKeyCollateralAddress = CPubKey();
pubKeyMasternode = CPubKey();
sig = std::vector<unsigned char>();
activeState = MASTERNODE_ENABLED;
sigTime = GetAdjustedTime();
lastPing = CMasternodePing();
cacheInputAge = 0;
cacheInputAgeBlock = 0;
unitTest = false;
allowFreeTx = true;
nActiveState = MASTERNODE_ENABLED,
protocolVersion = PROTOCOL_VERSION;
nLastDsq = 0;
nScanningErrorCount = 0;
nLastScanningErrorBlockHeight = 0;
lastTimeChecked = 0;
nLastDsee = 0; // temporary, do not save. Remove after migration to v12
nLastDseep = 0; // temporary, do not save. Remove after migration to v12
}
CMasternode::CMasternode(const CMasternode& other)
{
LOCK(cs);
vin = other.vin;
addr = other.addr;
pubKeyCollateralAddress = other.pubKeyCollateralAddress;
pubKeyMasternode = other.pubKeyMasternode;
sig = other.sig;
activeState = other.activeState;
sigTime = other.sigTime;
lastPing = other.lastPing;
cacheInputAge = other.cacheInputAge;
cacheInputAgeBlock = other.cacheInputAgeBlock;
unitTest = other.unitTest;
allowFreeTx = other.allowFreeTx;
nActiveState = MASTERNODE_ENABLED,
protocolVersion = other.protocolVersion;
nLastDsq = other.nLastDsq;
nScanningErrorCount = other.nScanningErrorCount;
nLastScanningErrorBlockHeight = other.nLastScanningErrorBlockHeight;
lastTimeChecked = 0;
nLastDsee = other.nLastDsee; // temporary, do not save. Remove after migration to v12
nLastDseep = other.nLastDseep; // temporary, do not save. Remove after migration to v12
}
CMasternode::CMasternode(const CMasternodeBroadcast& mnb)
{
LOCK(cs);
vin = mnb.vin;
addr = mnb.addr;
pubKeyCollateralAddress = mnb.pubKeyCollateralAddress;
pubKeyMasternode = mnb.pubKeyMasternode;
sig = mnb.sig;
activeState = MASTERNODE_ENABLED;
sigTime = mnb.sigTime;
lastPing = mnb.lastPing;
cacheInputAge = 0;
cacheInputAgeBlock = 0;
unitTest = false;
allowFreeTx = true;
nActiveState = MASTERNODE_ENABLED,
protocolVersion = mnb.protocolVersion;
nLastDsq = mnb.nLastDsq;
nScanningErrorCount = 0;
nLastScanningErrorBlockHeight = 0;
lastTimeChecked = 0;
nLastDsee = 0; // temporary, do not save. Remove after migration to v12
nLastDseep = 0; // temporary, do not save. Remove after migration to v12
}
//
// When a new masternode broadcast is sent, update our information
//
bool CMasternode::UpdateFromNewBroadcast(CMasternodeBroadcast& mnb)
{
if (mnb.sigTime > sigTime) {
pubKeyMasternode = mnb.pubKeyMasternode;
pubKeyCollateralAddress = mnb.pubKeyCollateralAddress;
sigTime = mnb.sigTime;
sig = mnb.sig;
protocolVersion = mnb.protocolVersion;
addr = mnb.addr;
lastTimeChecked = 0;
int nDoS = 0;
if (mnb.lastPing == CMasternodePing() || (mnb.lastPing != CMasternodePing() && mnb.lastPing.CheckAndUpdate(nDoS, false))) {
lastPing = mnb.lastPing;
mnodeman.mapSeenMasternodePing.insert(make_pair(lastPing.GetHash(), lastPing));
}
return true;
}
return false;
}
//
// Deterministically calculate a given "score" for a Masternode depending on how close it's hash is to
// the proof of work for that block. The further away they are the better, the furthest will win the election
// and get paid this block
//
uint256 CMasternode::CalculateScore(int mod, int64_t nBlockHeight)
{
if (chainActive.Tip() == NULL) return 0;
uint256 hash = 0;
uint256 aux = vin.prevout.hash + vin.prevout.n;
if (!GetBlockHash(hash, nBlockHeight)) {
LogPrintf("CalculateScore ERROR - nHeight %d - Returned 0\n", nBlockHeight);
return 0;
}
CHashWriter ss(SER_GETHASH, PROTOCOL_VERSION);
ss << hash;
uint256 hash2 = ss.GetHash();
CHashWriter ss2(SER_GETHASH, PROTOCOL_VERSION);
ss2 << hash;
ss2 << aux;
uint256 hash3 = ss2.GetHash();
uint256 r = (hash3 > hash2 ? hash3 - hash2 : hash2 - hash3);
return r;
}
void CMasternode::Check(bool forceCheck)
{
if (ShutdownRequested()) return;
if (!forceCheck && (GetTime() - lastTimeChecked < MASTERNODE_CHECK_SECONDS)) return;
lastTimeChecked = GetTime();
//once spent, stop doing the checks
if (activeState == MASTERNODE_VIN_SPENT) return;
if (!IsPingedWithin(MASTERNODE_REMOVAL_SECONDS)) {
activeState = MASTERNODE_REMOVE;
return;
}
if (!IsPingedWithin(MASTERNODE_EXPIRATION_SECONDS)) {
activeState = MASTERNODE_EXPIRED;
return;
}
if (!unitTest) {
CValidationState state;
CMutableTransaction tx = CMutableTransaction();
CTxOut vout = CTxOut(999.99 * COIN, DarKsendPool.collateralPubKey);
tx.vin.push_back(vin);
tx.vout.push_back(vout);
{
TRY_LOCK(cs_main, lockMain);
if (!lockMain) return;
if (!AcceptableInputs(mempool, state, CTransaction(tx), false, NULL)) {
activeState = MASTERNODE_VIN_SPENT;
return;
}
}
}
activeState = MASTERNODE_ENABLED; // OK
}
int64_t CMasternode::SecondsSincePayment()
{
CScript pubkeyScript;
pubkeyScript = GetScriptForDestination(pubKeyCollateralAddress.GetID());
int64_t sec = (GetAdjustedTime() - GetLastPaid());
int64_t month = 60 * 60 * 24 * 30;
if (sec < month) return sec; //if it's less than 30 days, give seconds
CHashWriter ss(SER_GETHASH, PROTOCOL_VERSION);
ss << vin;
ss << sigTime;
uint256 hash = ss.GetHash();
// return some deterministic value for unknown/unpaid but force it to be more than 30 days old
return month + hash.GetCompact(false);
}
int64_t CMasternode::GetLastPaid()
{
CBlockIndex* pindexPrev = chainActive.Tip();
if (pindexPrev == NULL) return false;
CScript mnpayee;
mnpayee = GetScriptForDestination(pubKeyCollateralAddress.GetID());
CHashWriter ss(SER_GETHASH, PROTOCOL_VERSION);
ss << vin;
ss << sigTime;
uint256 hash = ss.GetHash();
// use a deterministic offset to break a tie -- 2.5 minutes
int64_t nOffset = hash.GetCompact(false) % 150;
if (chainActive.Tip() == NULL) return false;
const CBlockIndex* BlockReading = chainActive.Tip();
int nMnCount = mnodeman.CountEnabled() * 1.25;
int n = 0;
for (unsigned int i = 1; BlockReading && BlockReading->nHeight > 0; i++) {
if (n >= nMnCount) {
return 0;
}
n++;
if (masternodePayments.mapMasternodeBlocks.count(BlockReading->nHeight)) {
/*
Search for this payee, with at least 2 votes. This will aid in consensus allowing the network
to converge on the same payees quickly, then keep the same schedule.
*/
if (masternodePayments.mapMasternodeBlocks[BlockReading->nHeight].HasPayeeWithVotes(mnpayee, 2)) {
return BlockReading->nTime + nOffset;
}
}
if (BlockReading->pprev == NULL) {
assert(BlockReading);
break;
}
BlockReading = BlockReading->pprev;
}
return 0;
}
std::string CMasternode::GetStatus()
{
switch (nActiveState) {
case CMasternode::MASTERNODE_PRE_ENABLED:
return "PRE_ENABLED";
case CMasternode::MASTERNODE_ENABLED:
return "ENABLED";
case CMasternode::MASTERNODE_EXPIRED:
return "EXPIRED";
case CMasternode::MASTERNODE_OUTPOINT_SPENT:
return "OUTPOINT_SPENT";
case CMasternode::MASTERNODE_REMOVE:
return "REMOVE";
case CMasternode::MASTERNODE_WATCHDOG_EXPIRED:
return "WATCHDOG_EXPIRED";
case CMasternode::MASTERNODE_POSE_BAN:
return "POSE_BAN";
default:
return "UNKNOWN";
}
}
bool CMasternode::IsValidNetAddr()
{
// TODO: regtest is fine with any addresses for now,
// should probably be a bit smarter if one day we start to implement tests for this
return Params().NetworkID() == CBaseChainParams::REGTEST ||
(IsReachable(addr) && addr.IsRoutable());
}
CMasternodeBroadcast::CMasternodeBroadcast()
{
vin = CTxIn();
addr = CService();
pubKeyCollateralAddress = CPubKey();
pubKeyMasternode1 = CPubKey();
sig = std::vector<unsigned char>();
activeState = MASTERNODE_ENABLED;
sigTime = GetAdjustedTime();
lastPing = CMasternodePing();
cacheInputAge = 0;
cacheInputAgeBlock = 0;
unitTest = false;
allowFreeTx = true;
protocolVersion = PROTOCOL_VERSION;
nLastDsq = 0;
nScanningErrorCount = 0;
nLastScanningErrorBlockHeight = 0;
}
CMasternodeBroadcast::CMasternodeBroadcast(CService newAddr, CTxIn newVin, CPubKey pubKeyCollateralAddressNew, CPubKey pubKeyMasternodeNew, int protocolVersionIn)
{
vin = newVin;
addr = newAddr;
pubKeyCollateralAddress = pubKeyCollateralAddressNew;
pubKeyMasternode = pubKeyMasternodeNew;
sig = std::vector<unsigned char>();
activeState = MASTERNODE_ENABLED;
sigTime = GetAdjustedTime();
lastPing = CMasternodePing();
cacheInputAge = 0;
cacheInputAgeBlock = 0;
unitTest = false;
allowFreeTx = true;
protocolVersion = protocolVersionIn;
nLastDsq = 0;
nScanningErrorCount = 0;
nLastScanningErrorBlockHeight = 0;
}
CMasternodeBroadcast::CMasternodeBroadcast(const CMasternode& mn)
{
vin = mn.vin;
addr = mn.addr;
pubKeyCollateralAddress = mn.pubKeyCollateralAddress;
pubKeyMasternode = mn.pubKeyMasternode;
sig = mn.sig;
activeState = mn.activeState;
sigTime = mn.sigTime;
lastPing = mn.lastPing;
cacheInputAge = mn.cacheInputAge;
cacheInputAgeBlock = mn.cacheInputAgeBlock;
unitTest = mn.unitTest;
allowFreeTx = mn.allowFreeTx;
protocolVersion = mn.protocolVersion;
nLastDsq = mn.nLastDsq;
nScanningErrorCount = mn.nScanningErrorCount;
nLastScanningErrorBlockHeight = mn.nLastScanningErrorBlockHeight;
}
bool CMasternodeBroadcast::Create(std::string strService, std::string strKeyMasternode, std::string strTxHash, std::string strOutputIndex, std::string& strErrorRet, CMasternodeBroadcast& mnbRet, bool fOffline)
{
CTxIn txin;
CPubKey pubKeyCollateralAddressNew;
CKey keyCollateralAddressNew;
CPubKey pubKeyMasternodeNew;
CKey keyMasternodeNew;
//need correct blocks to send ping
if (!fOffline && !masternodeSync.IsBlockchainSynced()) {
strErrorRet = "Sync in progress. Must wait until sync is complete to start Masternode";
LogPrintf("CMasternodeBroadcast::Create -- %s\n", strErrorRet);
return false;
}
if (!DarKsendSigner.GetKeysFromSecret(strKeyMasternode, keyMasternodeNew, pubKeyMasternodeNew)) {
strErrorRet = strprintf("Invalid masternode key %s", strKeyMasternode);
LogPrintf("CMasternodeBroadcast::Create -- %s\n", strErrorRet);
return false;
}
if (!pwalletMain->GetMasternodeVinAndKeys(txin, pubKeyCollateralAddressNew, keyCollateralAddressNew, strTxHash, strOutputIndex)) {
strErrorRet = strprintf("Could not allocate txin %s:%s for masternode %s", strTxHash, strOutputIndex, strService);
LogPrintf("CMasternodeBroadcast::Create -- %s\n", strErrorRet);
return false;
}
CService service = CService(strService);
int mainnetDefaultPort = Params(CBaseChainParams::MAIN).GetDefaultPort();
if (Params().NetworkID() == CBaseChainParams::MAIN) {
if (service.GetPort() != mainnetDefaultPort) {
strErrorRet = strprintf("Invalid port %u for masternode %s, only %d is supported on mainnet.", service.GetPort(), strService, mainnetDefaultPort);
LogPrintf("CMasternodeBroadcast::Create -- %s\n", strErrorRet);
return false;
}
} else if (service.GetPort() == mainnetDefaultPort) {
strErrorRet = strprintf("Invalid port %u for masternode %s, %d is the only supported on mainnet.", service.GetPort(), strService, mainnetDefaultPort);
LogPrintf("CMasternodeBroadcast::Create -- %s\n", strErrorRet);
return false;
}
return Create(txin, CService(strService), keyCollateralAddressNew, pubKeyCollateralAddressNew, keyMasternodeNew, pubKeyMasternodeNew, strErrorRet, mnbRet);
}
bool CMasternodeBroadcast::Create(CTxIn txin, CService service, CKey keyCollateralAddressNew, CPubKey pubKeyCollateralAddressNew, CKey keyMasternodeNew, CPubKey pubKeyMasternodeNew, std::string& strErrorRet, CMasternodeBroadcast& mnbRet)
{
// wait for reindex and/or import to finish
if (fImporting || fReindex) return false;
LogPrint("masternode", "CMasternodeBroadcast::Create -- pubKeyCollateralAddressNew = %s, pubKeyMasternodeNew.GetID() = %s\n",
CBitcoinAddress(pubKeyCollateralAddressNew.GetID()).ToString(),
pubKeyMasternodeNew.GetID().ToString());
CMasternodePing mnp(txin);
if (!mnp.Sign(keyMasternodeNew, pubKeyMasternodeNew)) {
strErrorRet = strprintf("Failed to sign ping, masternode=%s", txin.prevout.ToStringShort());
LogPrintf("CMasternodeBroadcast::Create -- %s\n", strErrorRet);
mnbRet = CMasternodeBroadcast();
return false;
}
mnbRet = CMasternodeBroadcast(service, txin, pubKeyCollateralAddressNew, pubKeyMasternodeNew, PROTOCOL_VERSION);
if (!mnbRet.IsValidNetAddr()) {
strErrorRet = strprintf("Invalid IP address (port=%u), masternode=%s", service.GetPort(), txin.prevout.ToStringShort());
LogPrintf("CMasternodeBroadcast::Create -- %s\n", strErrorRet);
mnbRet = CMasternodeBroadcast();
return false;
}
mnbRet.lastPing = mnp;
if (!mnbRet.Sign(keyCollateralAddressNew)) {
strErrorRet = strprintf("Failed to sign broadcast, masternode=%s", txin.prevout.ToStringShort());
LogPrintf("CMasternodeBroadcast::Create -- %s\n", strErrorRet);
mnbRet = CMasternodeBroadcast();
return false;
}
return true;
}
bool CMasternodeBroadcast::CheckAndUpdate(int& nDos)
{
// make sure signature isn't in the future (past is OK)
if (sigTime > GetAdjustedTime() + 60 * 60) {
LogPrintf("mnb - Signature rejected, too far into the future %s\n", vin.ToString());
nDos = 1;
return false;
}
std::string vchPubKey(pubKeyCollateralAddress.begin(), pubKeyCollateralAddress.end());
std::string vchPubKey2(pubKeyMasternode.begin(), pubKeyMasternode.end());
std::string strMessage = addr.ToString() + boost::lexical_cast<std::string>(sigTime) + vchPubKey + vchPubKey2 + boost::lexical_cast<std::string>(protocolVersion);
if (protocolVersion < masternodePayments.GetMinMasternodePaymentsProto()) {
LogPrintf("mnb - ignoring outdated Masternode %s protocol version %d\n", vin.ToString(), protocolVersion);
return false;
}
CScript pubkeyScript;
pubkeyScript = GetScriptForDestination(pubKeyCollateralAddress.GetID());
if (pubkeyScript.size() != 25) {
LogPrintf("mnb - pubkey the wrong size\n");
nDos = 100;
return false;
}
CScript pubkeyScript2;
pubkeyScript2 = GetScriptForDestination(pubKeyMasternode.GetID());
if (pubkeyScript2.size() != 25) {
LogPrintf("mnb - pubkey2 the wrong size\n");
nDos = 100;
return false;
}
if (!vin.scriptSig.empty()) {
LogPrintf("mnb - Ignore Not Empty ScriptSig %s\n", vin.ToString());
return false;
}
std::string errorMessage = "";
if (!DarKsendSigner.VerifyMessage(pubKeyCollateralAddress, sig, strMessage, errorMessage)) {
LogPrintf("mnb - Got bad Masternode address signature\n");
nDos = 100;
return false;
}
if (Params().NetworkID() == CBaseChainParams::MAIN) {
if (addr.GetPort() != 19551) return false;
} else if (addr.GetPort() == 19551)
return false;
//search existing Masternode list, this is where we update existing Masternodes with new mnb broadcasts
CMasternode* pmn = mnodeman.Find(vin);
// no such masternode, nothing to update
if (pmn == NULL)
return true;
else {
// this broadcast older than we have, it's bad.
if (pmn->sigTime > sigTime) {
LogPrintf("mnb - Bad sigTime %d for Masternode %20s %105s (existing broadcast is at %d)\n",
sigTime, addr.ToString(), vin.ToString(), pmn->sigTime);
return false;
}
// masternode is not enabled yet/already, nothing to update
if (!pmn->IsEnabled()) return true;
}
// mn.pubkey = pubkey, IsVinAssociatedWithPubkey is validated once below,
// after that they just need to match
if (pmn->pubKeyCollateralAddress == pubKeyCollateralAddress && !pmn->IsBroadcastedWithin(MASTERNODE_MIN_MNB_SECONDS)) {
//take the newest entry
LogPrintf("mnb - Got updated entry for %s\n", addr.ToString());
if (pmn->UpdateFromNewBroadcast((*this))) {
pmn->Check();
if (pmn->IsEnabled()) Relay();
}
masternodeSync.AddedMasternodeList(GetHash());
}
return true;
}
bool CMasternodeBroadcast::CheckInputsAndAdd(int& nDoS)
{
// we are a masternode with the same vin (i.e. already activated) and this mnb is ours (matches our Masternode privkey)
// so nothing to do here for us
if (fMasterNode && vin.prevout == activeMasternode.vin.prevout && pubKeyMasternode == activeMasternode.pubKeyMasternode)
return true;
// search existing Masternode list
CMasternode* pmn = mnodeman.Find(vin);
if (pmn != NULL) {
// nothing to do here if we already know about this masternode and it's enabled
if (pmn->IsEnabled()) return true;
// if it's not enabled, remove old MN first and continue
else
mnodeman.Remove(pmn->vin);
}
CValidationState state;
CMutableTransaction tx = CMutableTransaction();
CTxOut vout = CTxOut(999.99 * COIN, DarKsendPool.collateralPubKey);
tx.vin.push_back(vin);
tx.vout.push_back(vout);
{
TRY_LOCK(cs_main, lockMain);
if (!lockMain) {
// not mnb fault, let it to be checked again later
mnodeman.mapSeenMasternodeBroadcast.erase(GetHash());
masternodeSync.mapSeenSyncMNB.erase(GetHash());
return false;
}
if (!AcceptableInputs(mempool, state, CTransaction(tx), false, NULL)) {
//set nDos
state.IsInvalid(nDoS);
return false;
}
}
LogPrint("masternode", "mnb - Accepted Masternode entry\n");
if (GetInputAge(vin) < MASTERNODE_MIN_CONFIRMATIONS) {
LogPrintf("mnb - Input must have at least %d confirmations\n", MASTERNODE_MIN_CONFIRMATIONS);
// maybe we miss few blocks, let this mnb to be checked again later
mnodeman.mapSeenMasternodeBroadcast.erase(GetHash());
masternodeSync.mapSeenSyncMNB.erase(GetHash());
return false;
}
// verify that sig time is legit in past
// should be at least not earlier than block when 1000 CCB tx got MASTERNODE_MIN_CONFIRMATIONS
uint256 hashBlock = 0;
CTransaction tx2;
GetTransaction(vin.prevout.hash, tx2, hashBlock, true);
BlockMap::iterator mi = mapBlockIndex.find(hashBlock);
if (mi != mapBlockIndex.end() && (*mi).second) {
CBlockIndex* pMNIndex = (*mi).second; // block for 1000 CCB tx -> 1 confirmation
CBlockIndex* pConfIndex = chainActive[pMNIndex->nHeight + MASTERNODE_MIN_CONFIRMATIONS - 1]; // block where tx got MASTERNODE_MIN_CONFIRMATIONS
if (pConfIndex->GetBlockTime() > sigTime) {
LogPrintf("mnb - Bad sigTime %d for Masternode %20s %105s (%i conf block is at %d)\n",
sigTime, addr.ToString(), vin.ToString(), MASTERNODE_MIN_CONFIRMATIONS, pConfIndex->GetBlockTime());
return false;
}
}
LogPrintf("mnb - Got NEW Masternode entry - %s - %s - %s - %lli \n", GetHash().ToString(), addr.ToString(), vin.ToString(), sigTime);
CMasternode mn(*this);
mnodeman.Add(mn);
// if it matches our Masternode privkey, then we've been remotely activated
if (pubKeyMasternode == activeMasternode.pubKeyMasternode && protocolVersion == PROTOCOL_VERSION) {
activeMasternode.EnableHotColdMasterNode(vin, addr);
}
bool isLocal = addr.IsRFC1918() || addr.IsLocal();
if (Params().NetworkID() == CBaseChainParams::REGTEST) isLocal = false;
if (!isLocal) Relay();
return true;
}
void CMasternodeBroadcast::Relay()
{
CInv inv(MSG_MASTERNODE_ANNOUNCE, GetHash());
RelayInv(inv);
}
bool CMasternodeBroadcast::Sign(CKey& keyCollateralAddress)
{
std::string errorMessage;
std::string vchPubKey(pubKeyCollateralAddress.begin(), pubKeyCollateralAddress.end());
std::string vchPubKey2(pubKeyMasternode.begin(), pubKeyMasternode.end());
sigTime = GetAdjustedTime();
std::string strMessage = addr.ToString() + boost::lexical_cast<std::string>(sigTime) + vchPubKey + vchPubKey2 + boost::lexical_cast<std::string>(protocolVersion);
if (!DarKsendSigner.SignMessage(strMessage, errorMessage, sig, keyCollateralAddress)) {
LogPrintf("CMasternodeBroadcast::Sign() - Error: %s\n", errorMessage);
return false;
}
if (!DarKsendSigner.VerifyMessage(pubKeyCollateralAddress, sig, strMessage, errorMessage)) {
LogPrintf("CMasternodeBroadcast::Sign() - Error: %s\n", errorMessage);
return false;
}
return true;
}
CMasternodePing::CMasternodePing()
{
vin = CTxIn();
blockHash = uint256(0);
sigTime = 0;
vchSig = std::vector<unsigned char>();
}
CMasternodePing::CMasternodePing(CTxIn& newVin)
{
vin = newVin;
blockHash = chainActive[chainActive.Height() - 12]->GetBlockHash();
sigTime = GetAdjustedTime();
vchSig = std::vector<unsigned char>();
}
bool CMasternodePing::Sign(CKey& keyMasternode, CPubKey& pubKeyMasternode)
{
std::string errorMessage;
std::string strMasterNodeSignMessage;
sigTime = GetAdjustedTime();
std::string strMessage = vin.ToString() + blockHash.ToString() + boost::lexical_cast<std::string>(sigTime);
if (!DarKsendSigner.SignMessage(strMessage, errorMessage, vchSig, keyMasternode)) {
LogPrintf("CMasternodePing::Sign() - Error: %s\n", errorMessage);
return false;
}
if (!DarKsendSigner.VerifyMessage(pubKeyMasternode, vchSig, strMessage, errorMessage)) {
LogPrintf("CMasternodePing::Sign() - Error: %s\n", errorMessage);
return false;
}
return true;
}
bool CMasternodePing::CheckAndUpdate(int& nDos, bool fRequireEnabled)
{
if (sigTime > GetAdjustedTime() + 60 * 60) {
LogPrintf("CMasternodePing::CheckAndUpdate - Signature rejected, too far into the future %s\n", vin.ToString());
nDos = 1;
return false;
}
if (sigTime <= GetAdjustedTime() - 60 * 60) {
LogPrintf("CMasternodePing::CheckAndUpdate - Signature rejected, too far into the past %s - %d %d \n", vin.ToString(), sigTime, GetAdjustedTime());
nDos = 1;
return false;
}
LogPrint("masternode", "CMasternodePing::CheckAndUpdate - New Ping - %s - %s - %lli\n", GetHash().ToString(), blockHash.ToString(), sigTime);
// see if we have this Masternode
CMasternode* pmn = mnodeman.Find(vin);
if (pmn != NULL && pmn->protocolVersion >= masternodePayments.GetMinMasternodePaymentsProto()) {
if (fRequireEnabled && !pmn->IsEnabled()) return false;
// LogPrintf("mnping - Found corresponding mn for vin: %s\n", vin.ToString());
// update only if there is no known ping for this masternode or
// last ping was more then MASTERNODE_MIN_MNP_SECONDS-60 ago comparing to this one
if (!pmn->IsPingedWithin(MASTERNODE_MIN_MNP_SECONDS - 60, sigTime)) {
std::string strMessage = vin.ToString() + blockHash.ToString() + boost::lexical_cast<std::string>(sigTime);
std::string errorMessage = "";
if (!DarKsendSigner.VerifyMessage(pmn->pubKeyMasternode, vchSig, strMessage, errorMessage)) {
LogPrintf("CMasternodePing::CheckAndUpdate - Got bad Masternode address signature %s\n", vin.ToString());
nDos = 33;
return false;
}
BlockMap::iterator mi = mapBlockIndex.find(blockHash);
if (mi != mapBlockIndex.end() && (*mi).second) {
if ((*mi).second->nHeight < chainActive.Height() - 24) {
LogPrintf("CMasternodePing::CheckAndUpdate - Masternode %s block hash %s is too old\n", vin.ToString(), blockHash.ToString());
// Do nothing here (no Masternode update, no mnping relay)
// Let this node to be visible but fail to accept mnping
return false;
}
} else {
if (fDebug) LogPrintf("CMasternodePing::CheckAndUpdate - Masternode %s block hash %s is unknown\n", vin.ToString(), blockHash.ToString());
// maybe we stuck so we shouldn't ban this node, just fail to accept it
// TODO: or should we also request this block?
return false;
}
pmn->lastPing = *this;
//mnodeman.mapSeenMasternodeBroadcast.lastPing is probably outdated, so we'll update it
CMasternodeBroadcast mnb(*pmn);
uint256 hash = mnb.GetHash();
if (mnodeman.mapSeenMasternodeBroadcast.count(hash)) {
mnodeman.mapSeenMasternodeBroadcast[hash].lastPing = *this;
}
pmn->Check(true);
if (!pmn->IsEnabled()) return false;
LogPrint("masternode", "CMasternodePing::CheckAndUpdate - Masternode ping accepted, vin: %s\n", vin.ToString());
Relay();
return true;
}
LogPrint("masternode", "CMasternodePing::CheckAndUpdate - Masternode ping arrived too early, vin: %s\n", vin.ToString());
//nDos = 1; //disable, this is happening frequently and causing banned peers
return false;
}
LogPrint("masternode", "CMasternodePing::CheckAndUpdate - Couldn't find compatible Masternode entry, vin: %s\n", vin.ToString());
return false;
}
void CMasternodePing::Relay()
{
CInv inv(MSG_MASTERNODE_PING, GetHash());
RelayInv(inv);
}
| [
"root"
] | root |
57d6cb16c071810da3f3bfb36aa688c08e3a7eab | 40c229d54c9931a0d1c269e74754d852b471141c | /PotentiometerExample/PotentiometerExample.ino | c3ba223ac661b0a728e233de7d812574b98654df | [] | no_license | bomanimc/Teaching-Arduino | aaa56ee8ebd5c84937b8a402ffae48eb7d7d3665 | bb53f541fcae5c7607435dc5cbe82d4c165bd010 | refs/heads/main | 2023-08-14T11:01:08.381291 | 2021-10-14T00:23:32 | 2021-10-14T00:23:32 | 302,478,495 | 3 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 661 | ino | int ledPin = 13; // select the pin for the LED
int sensorPin = A0;
int sensorValue = 0;
int delayPeriod = 0;
void setup() {
Serial.begin(9600); // setup serial
// declare the ledPin as an OUTPUT:
pinMode(ledPin, OUTPUT);
// declare the sensorPin as an INPUT:
pinMode(sensorPin, INPUT); //analog input
}
void loop() {
sensorValue = analogRead(sensorPin);
delayPeriod = map(sensorValue, 0, 1023, 250, 2000);
Serial.println(sensorValue); // debug value
// turn the ledPin on
digitalWrite(ledPin, HIGH);
delay(delayPeriod);
// turn the ledPin off:
digitalWrite(ledPin, LOW);
delay(delayPeriod);
}
| [
"bomanimc@gmail.com"
] | bomanimc@gmail.com |
581885895bf6ec2fd17ea3e5f42ec4fece420f81 | a7ce738ad9af61cc23a4d6ea16e5428ea94eeec7 | /C++/interaction.cpp | 2a2676a09b0d349cdb3c8225521f7d939cd83acd | [] | no_license | rdwhitley/Coding4Beginners | 85b933e6731a2e98d84c4e165d6b9f5a9a1174ac | f16b073c9b98954a0d1c2a8eb33c01ecb4ffe97b | refs/heads/master | 2021-02-09T02:53:46.645400 | 2020-03-19T13:40:09 | 2020-03-19T13:40:09 | 244,230,872 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 739 | cpp | #include <iostream>
using namespace std;
int main()
{
// int age;
// cout << "what is your age: ";
// cin >> age;
// cout << "\nYou are " << age << " years old. \n";
// string name;
// cout << "what is your name: ";
// cin >> name;
// cout << "\nHello, " << name << ". I hope you're well today?\n";
// float num1, num2;
// cout << "Enter two whole numbers: ";
// cin >> num1 >> num2;
// cout << num1 << " + " << num2 << " is: " << num1 + num2 << " \n";
// string mystr;
// cout << "Enter a sentence: \n";
// getline(cin, mystr);
// cout << "Your sentence is: " << mystr.size() << " characters long. \n";
string name;
cout << "Enter your full name: \n";
getline(cin, name);
cout << "\n Hello, " << name << "\n";
} | [
"raw96@icloud.com"
] | raw96@icloud.com |
6cebc7b6bc4b5053eca837ab04f0afcce512ae16 | 1a8ad862cba5a3a701a29dad8ef283ef3820a150 | /369/C[ Valera and Elections ].cpp | 62832b5f8822152aa0d55e96b80582ec2604c34a | [
"MIT"
] | permissive | iamjanvijay/codeforces-jvj_iit-submissions | 4264ef259e3cd385281350798668b8958701e336 | 2a2aac7e93ca92e75887eff92361174aa36207c8 | refs/heads/master | 2021-06-24T17:21:51.719587 | 2017-09-02T14:20:45 | 2017-09-02T14:20:45 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,602 | cpp | #include <bits/stdc++.h>
using namespace std;
#define sd(x) scanf("%d",&x)
#define su(x) scanf("%u",&x)
#define slld(x) scanf("%lld",&x)
#define sc(x) scanf("%c",&x)
#define ss(x) scanf("%s",x)
#define sf(x) scanf("%f",&x)
#define slf(x) scanf("%lf",&x)
#define ll long long int
#define mod(x,n) (x+n)%n
// bool checked[100007];
bool isR[100007];
vector< int > G[100007];
vector<int> V;
// map<int,int> M[100007];
// void initChk()
// {
// for(int i=0;i<100007;i++)
// checked[i] = false;
// }
bool dfs1(int src,int par)
{
int i;
bool flag = false;
for(i=0;i<G[src].size();i++)
{
if( G[src][i] != par )
flag |= dfs1(G[src][i],src);
}
isR[src] |= flag;
return isR[src];
}
void dfs2(int src,int par)
{
int i;
bool flag = true;
for(i=0;i<G[src].size();i++)
{
if( G[src][i] != par && isR[G[src][i]] )
{
flag = false;
dfs2(G[src][i],src);
}
}
if(flag)
V.push_back(src);
}
int main()
{
// freopen("input_file_name.in","r",stdin);
// freopen("output_file_name.out","w",stdout);
int i,j,k,l,m,n;
bool flag = true;
sd(n);
for(i=0;i<n-1;i++)
{
sd(j); sd(k); sd(l);
if(l==2)
{
// M[j][k] = G[j].size();
G[j].push_back( k ) ;
// M[k][j] = G[k].size();
G[k].push_back( j );
isR[j] = isR[k] = true;
flag = false;
}
else
{
// M[j][k] = G[j].size();
G[j].push_back( k ) ;
// M[k][j] = G[k].size();
G[k].push_back( j );
}
}
dfs1(1,0);
// initChk();
dfs2(1,0);
if(flag)
{
printf("0\n");
return 0;
}
printf("%d\n", V.size() );
for(i=0;i<V.size();i++)
printf("%d ", V[i] );
printf("\n");
return 0;
} | [
"janvijay.singhcd.cse14@itbhu.ac.in"
] | janvijay.singhcd.cse14@itbhu.ac.in |
792ec076193320fa256ca0b5c28c8b17237ec38e | 2c9f8ea5545372945645d8ca8be41834e961e39f | /ArduinoRFM69/rfm69-ook-relay-rssi/rfm69-ook-relay-rssi.ino | 823ca6c73fba59d73e665b75ed42dfbcae742241 | [
"MIT"
] | permissive | rinie/embapps | 43598ebbb8cf08d6f4b0feb4345e6bf45eb10912 | ecb9f27dc291ea86e24cf0eba0f1a84066b4355a | refs/heads/master | 2021-01-24T01:47:10.489627 | 2018-09-13T20:16:36 | 2018-09-13T20:16:36 | 36,110,809 | 0 | 0 | null | 2015-11-11T06:46:53 | 2015-05-23T06:48:49 | C++ | UTF-8 | C++ | false | false | 4,882 | ino | #define RF69_COMPAT 1 // define this to use the RF69 driver i.s.o. RF12
#define STATLOG 0 //0=no statistics logging 1=statistics logging
#include <JeeLib.h>
//#include <Time.h>
#include "radio-ook.h"
#include "decodeOOK.h"
//#include "decodeOOK_TEST.h"
// Config items ------------------------------------------------------------
// node settings for sending out each received OOK packet to another JeeNode
#define GROUP 5
#define NODEID 19
#define FREQ_BAND 868 //868 or 433
#define SERIAL_BAUD 57600
#if FREQ_BAND == 433
#define RF12_BAND RF12_433MHZ
uint32_t frqkHz = 433920;
#else
#define RF12_BAND RF12_868MHZ
uint32_t frqkHz = 868280;
#endif
const uint8_t max_decoders = 6; //Too many decoders slows processing down.
DecodeOOK* decoders[max_decoders] = {NULL};
uint8_t di = 0;
void printOOK (class DecodeOOK* decoder);
void relay (class DecodeOOK* decoder);
#if FREQ_BAND == 433
//433MHz
#include "decoders433.h"
//OregonDecoderV2 orscV2( 5, "ORSV2", printOOK);
//CrestaDecoder cres( 6, "CRES ", printOOK);
KakuDecoder kaku( 7, "KAKU ", printOOK);
//XrfDecoder xrf( 8, "XRF ", printOOK);
//HezDecoder hez( 9, "HEZ ", printOOK);
//ElroDecoder elro( 10, "ELRO ", printOOK);
//FlamingoDecoder flam( 11, "FMGO ", printOOK);
//SmokeDecoder smok( 12, "SMK ", printOOK);
//ByronbellDecoder byro( 13, "BYR ", printOOK);
//KakuADecoder kakuA( 14, "KAKUA", printOOK);
WS249 ws249( 20, "WS249", printOOK);
Philips phi( 21, "PHI ", printOOK);
OregonDecoderV1 orscV1( 22, "ORSV1", printOOK);
//OregonDecoderV3 orscV3( 23, "ORSV3", printOOK);
void setupDecoders() {
decoders[di++] = &ws249;
decoders[di++] = φ
decoders[di++] = &orscV1;
decoders[di++] = &kaku;
}
#else
//868MHz
#include "decoders868.h"
//VisonicDecoder viso( 1, "VISO ", printOOK);
EMxDecoder emx( 2, "EMX ", printOOK);
//KSxDecoder ksx( 3, "KSX ", printOOK);
FSxDecoder fsx( 4, "FS20 ", printOOK);
//FSxDecoderA fsxa( 44, "FS20A", printOOK);
//
void setupDecoders() {
decoders[di++] = &emx;
decoders[di++] = &fsx;
}
#endif
// End config items --------------------------------------------------------
//global instance of the OOK RF69 class
RF69A rf;
uint8_t ookbuf[32];
void printDigits(int val) {
// utility function for digital clock display: prints preceding colon and leading 0
Serial.print(":");
if (val < 10)
Serial.print('0');
Serial.print(val);
}
void printHex(int val) {
if (val < 16)
Serial.print('0');
Serial.print(val, HEX);
}
//small circular buffer for ON rssi signals
#define RSSI_BUF_EXP 3 //keep it powers of 2
#define RSSI_BUF_SIZE (1<<RSSI_BUF_EXP)
uint8_t rssi_buf[RSSI_BUF_SIZE];
uint8_t rssi_buf_i = 0;
void printRSSI() {
uint16_t avgonrssi = 0;
uint16_t avgoffrssi = 0;
for (uint8_t i = 0; i < RSSI_BUF_SIZE; i += 2) {
avgonrssi += rssi_buf[i];
avgoffrssi += rssi_buf[i + 1];
//Serial.print(" (");
//Serial.print(rssi_buf[i+1]);
//Serial.print("/");
//Serial.print(rssi_buf[i]);
//Serial.print(") ");
}
Serial.print(" (");
Serial.print(avgoffrssi >> RSSI_BUF_EXP - 1);
Serial.print("/");
Serial.print(avgonrssi >> RSSI_BUF_EXP - 1);
Serial.print(")");
}
void printOOK (class DecodeOOK* decoder) {
relay(decoder);
//return;
uint8_t pos;
const uint8_t* data = decoder->getData(pos);
//Serial.println("");
//Serial.print(hour());
//printDigits(minute());
//printDigits(second());
//Serial.print(" ");
//int8_t textbuf[25];
//rf12_settings_text(textbuf);
//Serial.print(textbuf);
//Serial.print(' ');
Serial.print(decoder->tag);
Serial.print(' ');
for (uint8_t i = 0; i < pos; ++i) {
printHex(data[i]);
}
printRSSI();
Serial.println();
decoder->resetDecoder();
}
void relay (class DecodeOOK* decoder) {
uint8_t pos;
const uint8_t* data = decoder->getData(pos);
rf.exit_receive();
rf12_initialize(NODEID, RF12_BAND, GROUP, 1600);
rf12_sendNow(0, data, pos);
rf12_sendWait(1);
rf.init(11, 42, frqkHz);
}
void processBit(uint16_t pulse_dur, uint8_t signal, uint8_t rssi) {
if (rssi) {
if (signal) {
rssi_buf_i += 2;
rssi_buf_i &= (RSSI_BUF_SIZE - 2);
rssi_buf[rssi_buf_i] = rssi;
} else {
rssi_buf[rssi_buf_i + 1] = rssi;
}
}
for (uint8_t i = 0; decoders[i]; i++) {
if (decoders[i]->nextPulse(pulse_dur, signal))
decoders[i]->decoded(decoders[i]);
}
}
void setup() {
Serial.begin(SERIAL_BAUD);
Serial.print(F("\r\n[OOK-RX-rssi]\r\n"));
setupDecoders();
if (di > max_decoders)
Serial.print(F("ERROR: decoders-array too small. Memory corruption."));
rf12_initialize(11, RF12_BAND, 42, 1600);// calls rf69_initialize()
//setup for OOK
rf.init(11, 42, frqkHz);
}
void loop() {
rf.receiveOOK_forever(processBit);
}
| [
"info@sevenwatt.com"
] | info@sevenwatt.com |
a593c1ea012265bacfb9960a8afe030d47c21ee2 | 9ab722e6b9e4ce741cc6f865ba97e0fdc0ad14e5 | /library/third_party/skia/src/core/SkPathHeap.h | 1a0023ccd98a4acfd71d2a274125f610476efc27 | [
"MIT"
] | permissive | csjy309450/PuTTY-ng | b892c6474c8ff797f1d0bf555b08351da4fe617b | 0af73729d45d51936810f675d481c47e5588407b | refs/heads/master | 2022-12-24T13:31:22.786842 | 2020-03-08T16:53:51 | 2020-03-08T16:53:51 | 296,880,184 | 1 | 0 | MIT | 2020-09-19T13:54:25 | 2020-09-19T13:54:24 | null | UTF-8 | C++ | false | false | 1,012 | h | #ifndef SkPathHeap_DEFINED
#define SkPathHeap_DEFINED
#include "SkRefCnt.h"
#include "SkChunkAlloc.h"
#include "SkTDArray.h"
class SkPath;
class SkFlattenableReadBuffer;
class SkFlattenableWriteBuffer;
class SkPathHeap : public SkRefCnt {
public:
SkPathHeap();
SkPathHeap(SkFlattenableReadBuffer&);
virtual ~SkPathHeap();
/** Copy the path into the heap, and return the new total number of paths.
Thus, the returned value will be index+1, where index is the index of
this newly added (copied) path.
*/
int append(const SkPath&);
// called during picture-playback
int count() const { return fPaths.count(); }
const SkPath& operator[](int index) const {
return *fPaths[index];
}
void flatten(SkFlattenableWriteBuffer&) const;
private:
// we store the paths in the heap (placement new)
SkChunkAlloc fHeap;
// we just store ptrs into fHeap here
SkTDArray<SkPath*> fPaths;
};
#endif
| [
"wlwlxj@gmail.com@b2b8c3b8-ce47-b78c-ec54-380d862a5473"
] | wlwlxj@gmail.com@b2b8c3b8-ce47-b78c-ec54-380d862a5473 |
88e59d2429683ba8289b9c05440d7a9519c45fd7 | 22dd94544e986aeaf856deddcfe317db74693a26 | /deps/rocksdb-master/db/version_set_test.cc | 402762efa11a7e577d8ffe0bf05beba7fe24dd0b | [
"BSD-3-Clause"
] | permissive | kushalbabel/ssdb-rocks | 6ba0232106038ff53b3a8f5b71095cc421a90f04 | 184d3d46d4674ca20f6ce2268419bbeb1bb9ad4b | refs/heads/master | 2020-08-30T13:46:27.230418 | 2019-10-30T00:14:18 | 2019-10-30T00:14:18 | 218,398,454 | 0 | 0 | BSD-3-Clause | 2019-10-29T22:53:06 | 2019-10-29T22:53:06 | null | UTF-8 | C++ | false | false | 8,161 | cc | // Copyright (c) 2013, Facebook, Inc. All rights reserved.
// This source code is licensed under the BSD-style license found in the
// LICENSE file in the root directory of this source tree. An additional grant
// of patent rights can be found in the PATENTS file in the same directory.
//
// Copyright (c) 2011 The LevelDB Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. See the AUTHORS file for names of contributors.
#include "db/version_set.h"
#include "util/logging.h"
#include "util/testharness.h"
#include "util/testutil.h"
namespace rocksdb {
class GenerateFileLevelTest {
public:
std::vector<FileMetaData*> files_;
FileLevel file_level_;
Arena arena_;
GenerateFileLevelTest() { }
~GenerateFileLevelTest() {
for (unsigned int i = 0; i < files_.size(); i++) {
delete files_[i];
}
}
void Add(const char* smallest, const char* largest,
SequenceNumber smallest_seq = 100,
SequenceNumber largest_seq = 100) {
FileMetaData* f = new FileMetaData;
f->fd = FileDescriptor(files_.size() + 1, 0, 0);
f->smallest = InternalKey(smallest, smallest_seq, kTypeValue);
f->largest = InternalKey(largest, largest_seq, kTypeValue);
files_.push_back(f);
}
int Compare() {
int diff = 0;
for (size_t i = 0; i < files_.size(); i++) {
if (file_level_.files[i].fd.GetNumber() != files_[i]->fd.GetNumber()) {
diff++;
}
}
return diff;
}
};
TEST(GenerateFileLevelTest, Empty) {
DoGenerateFileLevel(&file_level_, files_, &arena_);
ASSERT_EQ(0u, file_level_.num_files);
ASSERT_EQ(0, Compare());
}
TEST(GenerateFileLevelTest, Single) {
Add("p", "q");
DoGenerateFileLevel(&file_level_, files_, &arena_);
ASSERT_EQ(1u, file_level_.num_files);
ASSERT_EQ(0, Compare());
}
TEST(GenerateFileLevelTest, Multiple) {
Add("150", "200");
Add("200", "250");
Add("300", "350");
Add("400", "450");
DoGenerateFileLevel(&file_level_, files_, &arena_);
ASSERT_EQ(4u, file_level_.num_files);
ASSERT_EQ(0, Compare());
}
class FindLevelFileTest {
public:
FileLevel file_level_;
bool disjoint_sorted_files_;
Arena arena_;
FindLevelFileTest() : disjoint_sorted_files_(true) { }
~FindLevelFileTest() {
}
void LevelFileInit(size_t num = 0) {
char* mem = arena_.AllocateAligned(num * sizeof(FdWithKeyRange));
file_level_.files = new (mem)FdWithKeyRange[num];
file_level_.num_files = 0;
}
void Add(const char* smallest, const char* largest,
SequenceNumber smallest_seq = 100,
SequenceNumber largest_seq = 100) {
InternalKey smallest_key = InternalKey(smallest, smallest_seq, kTypeValue);
InternalKey largest_key = InternalKey(largest, largest_seq, kTypeValue);
Slice smallest_slice = smallest_key.Encode();
Slice largest_slice = largest_key.Encode();
char* mem = arena_.AllocateAligned(
smallest_slice.size() + largest_slice.size());
memcpy(mem, smallest_slice.data(), smallest_slice.size());
memcpy(mem + smallest_slice.size(), largest_slice.data(),
largest_slice.size());
// add to file_level_
size_t num = file_level_.num_files;
auto& file = file_level_.files[num];
file.fd = FileDescriptor(num + 1, 0, 0);
file.smallest_key = Slice(mem, smallest_slice.size());
file.largest_key = Slice(mem + smallest_slice.size(),
largest_slice.size());
file_level_.num_files++;
}
int Find(const char* key) {
InternalKey target(key, 100, kTypeValue);
InternalKeyComparator cmp(BytewiseComparator());
return FindFile(cmp, file_level_, target.Encode());
}
bool Overlaps(const char* smallest, const char* largest) {
InternalKeyComparator cmp(BytewiseComparator());
Slice s(smallest != nullptr ? smallest : "");
Slice l(largest != nullptr ? largest : "");
return SomeFileOverlapsRange(cmp, disjoint_sorted_files_, file_level_,
(smallest != nullptr ? &s : nullptr),
(largest != nullptr ? &l : nullptr));
}
};
TEST(FindLevelFileTest, LevelEmpty) {
LevelFileInit(0);
ASSERT_EQ(0, Find("foo"));
ASSERT_TRUE(! Overlaps("a", "z"));
ASSERT_TRUE(! Overlaps(nullptr, "z"));
ASSERT_TRUE(! Overlaps("a", nullptr));
ASSERT_TRUE(! Overlaps(nullptr, nullptr));
}
TEST(FindLevelFileTest, LevelSingle) {
LevelFileInit(1);
Add("p", "q");
ASSERT_EQ(0, Find("a"));
ASSERT_EQ(0, Find("p"));
ASSERT_EQ(0, Find("p1"));
ASSERT_EQ(0, Find("q"));
ASSERT_EQ(1, Find("q1"));
ASSERT_EQ(1, Find("z"));
ASSERT_TRUE(! Overlaps("a", "b"));
ASSERT_TRUE(! Overlaps("z1", "z2"));
ASSERT_TRUE(Overlaps("a", "p"));
ASSERT_TRUE(Overlaps("a", "q"));
ASSERT_TRUE(Overlaps("a", "z"));
ASSERT_TRUE(Overlaps("p", "p1"));
ASSERT_TRUE(Overlaps("p", "q"));
ASSERT_TRUE(Overlaps("p", "z"));
ASSERT_TRUE(Overlaps("p1", "p2"));
ASSERT_TRUE(Overlaps("p1", "z"));
ASSERT_TRUE(Overlaps("q", "q"));
ASSERT_TRUE(Overlaps("q", "q1"));
ASSERT_TRUE(! Overlaps(nullptr, "j"));
ASSERT_TRUE(! Overlaps("r", nullptr));
ASSERT_TRUE(Overlaps(nullptr, "p"));
ASSERT_TRUE(Overlaps(nullptr, "p1"));
ASSERT_TRUE(Overlaps("q", nullptr));
ASSERT_TRUE(Overlaps(nullptr, nullptr));
}
TEST(FindLevelFileTest, LevelMultiple) {
LevelFileInit(4);
Add("150", "200");
Add("200", "250");
Add("300", "350");
Add("400", "450");
ASSERT_EQ(0, Find("100"));
ASSERT_EQ(0, Find("150"));
ASSERT_EQ(0, Find("151"));
ASSERT_EQ(0, Find("199"));
ASSERT_EQ(0, Find("200"));
ASSERT_EQ(1, Find("201"));
ASSERT_EQ(1, Find("249"));
ASSERT_EQ(1, Find("250"));
ASSERT_EQ(2, Find("251"));
ASSERT_EQ(2, Find("299"));
ASSERT_EQ(2, Find("300"));
ASSERT_EQ(2, Find("349"));
ASSERT_EQ(2, Find("350"));
ASSERT_EQ(3, Find("351"));
ASSERT_EQ(3, Find("400"));
ASSERT_EQ(3, Find("450"));
ASSERT_EQ(4, Find("451"));
ASSERT_TRUE(! Overlaps("100", "149"));
ASSERT_TRUE(! Overlaps("251", "299"));
ASSERT_TRUE(! Overlaps("451", "500"));
ASSERT_TRUE(! Overlaps("351", "399"));
ASSERT_TRUE(Overlaps("100", "150"));
ASSERT_TRUE(Overlaps("100", "200"));
ASSERT_TRUE(Overlaps("100", "300"));
ASSERT_TRUE(Overlaps("100", "400"));
ASSERT_TRUE(Overlaps("100", "500"));
ASSERT_TRUE(Overlaps("375", "400"));
ASSERT_TRUE(Overlaps("450", "450"));
ASSERT_TRUE(Overlaps("450", "500"));
}
TEST(FindLevelFileTest, LevelMultipleNullBoundaries) {
LevelFileInit(4);
Add("150", "200");
Add("200", "250");
Add("300", "350");
Add("400", "450");
ASSERT_TRUE(! Overlaps(nullptr, "149"));
ASSERT_TRUE(! Overlaps("451", nullptr));
ASSERT_TRUE(Overlaps(nullptr, nullptr));
ASSERT_TRUE(Overlaps(nullptr, "150"));
ASSERT_TRUE(Overlaps(nullptr, "199"));
ASSERT_TRUE(Overlaps(nullptr, "200"));
ASSERT_TRUE(Overlaps(nullptr, "201"));
ASSERT_TRUE(Overlaps(nullptr, "400"));
ASSERT_TRUE(Overlaps(nullptr, "800"));
ASSERT_TRUE(Overlaps("100", nullptr));
ASSERT_TRUE(Overlaps("200", nullptr));
ASSERT_TRUE(Overlaps("449", nullptr));
ASSERT_TRUE(Overlaps("450", nullptr));
}
TEST(FindLevelFileTest, LevelOverlapSequenceChecks) {
LevelFileInit(1);
Add("200", "200", 5000, 3000);
ASSERT_TRUE(! Overlaps("199", "199"));
ASSERT_TRUE(! Overlaps("201", "300"));
ASSERT_TRUE(Overlaps("200", "200"));
ASSERT_TRUE(Overlaps("190", "200"));
ASSERT_TRUE(Overlaps("200", "210"));
}
TEST(FindLevelFileTest, LevelOverlappingFiles) {
LevelFileInit(2);
Add("150", "600");
Add("400", "500");
disjoint_sorted_files_ = false;
ASSERT_TRUE(! Overlaps("100", "149"));
ASSERT_TRUE(! Overlaps("601", "700"));
ASSERT_TRUE(Overlaps("100", "150"));
ASSERT_TRUE(Overlaps("100", "200"));
ASSERT_TRUE(Overlaps("100", "300"));
ASSERT_TRUE(Overlaps("100", "400"));
ASSERT_TRUE(Overlaps("100", "500"));
ASSERT_TRUE(Overlaps("375", "400"));
ASSERT_TRUE(Overlaps("450", "450"));
ASSERT_TRUE(Overlaps("450", "500"));
ASSERT_TRUE(Overlaps("450", "700"));
ASSERT_TRUE(Overlaps("600", "700"));
}
} // namespace rocksdb
int main(int argc, char** argv) {
return rocksdb::test::RunAllTests();
}
| [
"ideawu@local"
] | ideawu@local |
874d24a4c886086aadfd7c37a78efa43852a9b51 | 1ebd94367c6cc789797bdd1879176d9740456459 | /Project2/Project1/DirMgr.cpp | a4355b2d04b2ffc1773964c348256ccf84de3893 | [] | no_license | nigandhi/Code-Similarity-Analysis | 05764a50be42eca35238979c0a390b020f7b6b25 | f866bdff71433ac111dbbf2de1e9f7e171a6af86 | refs/heads/master | 2021-01-10T06:25:23.449149 | 2015-11-08T20:29:56 | 2015-11-08T20:29:56 | 45,797,351 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,603 | cpp | ///////////////////////////////////////////////////////////////////////
// DirMgr.cpp - Search a path for Directories //
// Author: Nirav Gandhi, Syracuse University //
// (315) 395-4842, nigandhi@syr.edu //
///////////////////////////////////////////////////////////////////////
/*
Module Operations:
==================
This module takes path as arguments to its function
and returns the directories present on that path.
Build Process:
==============
Required files
FileSystem.h
Maintenance History:
====================
ver 1.0 : 12 Feb 14
- first release
*/
#include "DirMgr.h"
#include <iostream>
#include "FileSystem.h"
DirMgr::directories& DirMgr::searchd(const std::string& path)
{
directories temp1 = FileSystem::Directory::getDirectories(path);
for (auto dir : temp1)
{
int flag = 1;
//std::cout << dir << "\n";
if (dir.at(dir.length() - 1) != '.' && flag==1)
{
std::string temp = path;
if (temp.at(temp.length() - 1) != '\\')
{
temp.append("\\");
}
temp.append(dir);
dir = temp;
for (auto dir1 : _directories)
{
if (dir == dir1)
flag++;
}
if (flag==1)
_directories.push_back(temp);
}
}
return _directories;
}
#ifdef TEST_DIRMGR
int main(int argc, char* argv[])
{
_directories = searchd(".");
// std::cout << "Recursive";
do
{
directories tempdir = _directories;
_directories.clear();
for (auto temp : tempdir)
{
mydirectories = searchd(temp);
}
count++;
} while (_directories.capacity() != tempdir.capacity());
}
#endif | [
"nsg12792@gmail.com"
] | nsg12792@gmail.com |
cc42554de1409b7ec2b8733fc5f2378e2a34b7b4 | 29dadf124b248e22094f2b97f32ec9ccacf8dc11 | /main.cpp | 8094c4e238e0528d0e3d94924c63155b4f3d359f | [] | no_license | hubert-mazur/konwersja-do-odcieni-szarosci-projekt | 26146384c993672517fa83aab8113e7751f03db4 | cfb6de0704523f4d5dd622e1830e3c85d33cf79c | refs/heads/master | 2020-06-01T04:55:40.130205 | 2019-06-06T20:41:16 | 2019-06-06T20:41:16 | 190,644,938 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 303 | cpp | #include <wx/wx.h>
#include "GUIframe.h"
class MyApp : public wxApp {
public:
virtual bool OnInit();
virtual int OnExit() { return 0; }
};
IMPLEMENT_APP(MyApp);
bool MyApp::OnInit()
{
GUIframe *mainFrame = new GUIframe(NULL);
mainFrame->Show(true);
SetTopWindow(mainFrame);
return true;
} | [
"hiusvii@gmail.com"
] | hiusvii@gmail.com |
4ecdc8a443a09a58e65a21e5cb5cdc0bb383271d | f8dd1dfb0f81de16b9c8f681c85c6995b63ce037 | /tensorflow/compiler/xla/client/xla_client/xla_builder.cc | 596f39b4fd2febc9158741611564218e50006ae4 | [
"Apache-2.0"
] | permissive | DandelionCN/tensorflow | 74688926778ae06da1f406967baf6b251b3f3c4e | 1712002ad02f044f7569224bf465e0ea00e6a6c4 | refs/heads/master | 2020-03-06T19:10:37.847848 | 2018-03-27T17:11:49 | 2018-03-27T17:11:49 | 127,022,134 | 1 | 0 | Apache-2.0 | 2018-03-27T17:24:51 | 2018-03-27T17:24:51 | null | UTF-8 | C++ | false | false | 30,757 | cc | /* Copyright 2018 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#include "tensorflow/compiler/xla/client/xla_client/xla_builder.h"
#include <numeric>
#include <string>
#include <utility>
#include "tensorflow/compiler/xla/service/hlo_opcode.h"
#include "tensorflow/compiler/xla/service/shape_inference.h"
#include "tensorflow/compiler/xla/util.h"
#include "tensorflow/core/lib/strings/strcat.h"
#include "tensorflow/core/platform/mutex.h"
namespace xla {
using tensorflow::strings::StrCat;
namespace {
int64 GetUniqueId() {
static tensorflow::mutex mu(tensorflow::LINKER_INITIALIZED);
static int64 built_counter = 0;
tensorflow::mutex_lock loc(mu);
const int64 id = built_counter++;
return id;
}
// Returns true if an instruction with the given opcode can be the root of the
// computation.
bool CanBeRoot(HloOpcode opcode) {
switch (opcode) {
case HloOpcode::kSend:
case HloOpcode::kOutfeed:
case HloOpcode::kTrace:
return false;
default:
return true;
}
}
} // namespace
StatusOr<Shape> XlaBuilder::GetShape(const XlaOp& op) const {
TF_ASSIGN_OR_RETURN(auto instr, LookUpInstruction(op));
return instr->shape();
}
StatusOr<Shape> XlaOp::GetShape() const {
TF_RET_CHECK(builder_ != nullptr);
return builder_->GetShape(*this);
}
XlaBuilder::XlaBuilder(const string& computation_name)
: name_(computation_name) {}
XlaBuilder::~XlaBuilder() {}
void XlaBuilder::NoteError(const Status& error) {
CHECK(!error.ok());
if (die_immediately_on_error_) {
LOG(FATAL) << "error building computation: " << error;
}
if (first_error_.ok()) {
first_error_ = error;
first_error_backtrace_.CreateCurrent(/*skip_count=*/1);
}
}
StatusOr<ProgramShape> XlaBuilder::GetProgramShape(int64* root_id) {
TF_RET_CHECK(root_id != nullptr);
ProgramShape program_shape;
// Not all instructions can be roots. Walk backwards from the last added
// instruction until a valid root is found.
int64 index = instructions_.size() - 1;
for (; index >= 0; index--) {
TF_ASSIGN_OR_RETURN(HloOpcode opcode,
StringToHloOpcode(instructions_[index].opcode()));
if (CanBeRoot(opcode)) {
break;
}
}
if (index < 0) {
return FailedPrecondition("no root instruction was found");
}
*root_id = instructions_[index].id();
*program_shape.mutable_result() = instructions_[index].shape();
// Check that the parameter numbers are continuous from 0, and add parameter
// shapes and names to the program shape.
const int64 param_count = parameter_numbers_.size();
for (int64 i = 0; i < param_count; i++) {
program_shape.add_parameters();
program_shape.add_parameter_names();
}
for (const HloInstructionProto& instr : instructions_) {
// Parameter number uniqueness is guaranteed in XlaBuilder::Parameter(). So
// to verify continuity, we just need to verify that every parameter is in
// the right range.
if (instr.opcode() == HloOpcodeString(HloOpcode::kParameter)) {
const int64 index = instr.parameter_number();
TF_RET_CHECK(index >= 0 && index < param_count)
<< "invalid parameter number: " << index;
*program_shape.mutable_parameters(index) = instr.shape();
*program_shape.mutable_parameter_names(index) = instr.name();
}
}
return program_shape;
}
StatusOr<ProgramShape> XlaBuilder::GetProgramShape() {
int64 root_id;
return GetProgramShape(&root_id);
}
StatusOr<XlaComputation> XlaBuilder::Build() {
if (!first_error_.ok()) {
string backtrace;
first_error_backtrace_.Dump(tensorflow::DebugWriteToString, &backtrace);
return AppendStatus(first_error_, backtrace);
}
HloComputationProto entry;
entry.set_name(name_);
{
int64 root_id;
ProgramShape program_shape;
TF_ASSIGN_OR_RETURN(program_shape, GetProgramShape(&root_id));
entry.mutable_program_shape()->Swap(&program_shape);
entry.set_root_id(root_id);
}
for (auto& instruction : instructions_) {
entry.add_instructions()->Swap(&instruction);
}
const int64 id = GetUniqueId();
entry.set_id(id);
XlaComputation computation(id);
HloModuleProto* module = computation.mutable_proto();
module->set_name(entry.name());
module->set_id(entry.id());
module->set_entry_computation_name(entry.name());
module->set_entry_computation_id(entry.id());
*module->mutable_program_shape() = entry.program_shape();
for (auto& e : embedded_) {
module->add_computations()->Swap(&e.second);
}
module->add_computations()->Swap(&entry);
return std::move(computation);
}
StatusOr<XlaOp> XlaBuilder::InDimBroadcast(
const Shape& shape, const XlaOp& operand,
tensorflow::gtl::ArraySlice<int64> broadcast_dimensions) {
HloInstructionProto instr;
*instr.mutable_shape() = shape;
for (int64 dim : broadcast_dimensions) {
instr.add_dimensions(dim);
}
return AddInstruction(std::move(instr), HloOpcode::kBroadcast, {operand});
}
StatusOr<XlaOp> XlaBuilder::AddBroadcastSequence(const Shape& output_shape,
const XlaOp& operand) {
TF_ASSIGN_OR_RETURN(const Shape& operand_shape, operand.GetShape());
CHECK(ShapeUtil::IsScalar(operand_shape) ||
ShapeUtil::Rank(operand_shape) == ShapeUtil::Rank(output_shape));
Shape broadcast_shape =
ShapeUtil::ChangeElementType(output_shape, operand_shape.element_type());
// Do explicit broadcast for scalar.
if (ShapeUtil::IsScalar(operand_shape)) {
return InDimBroadcast(broadcast_shape, operand, {});
}
// Do explicit broadcast for degenerate broadcast.
std::vector<int64> broadcast_dimensions;
std::vector<int64> reshaped_dimensions;
for (int i = 0; i < ShapeUtil::Rank(operand_shape); i++) {
if (operand_shape.dimensions(i) == output_shape.dimensions(i)) {
broadcast_dimensions.push_back(i);
reshaped_dimensions.push_back(operand_shape.dimensions(i));
} else {
TF_RET_CHECK(operand_shape.dimensions(i) == 1)
<< "An explicit broadcast sequence requires the broadcasted "
"dimensions to be trivial; operand shape: "
<< operand_shape << "; output_shape: " << output_shape;
}
}
// Eliminate the size one dimensions.
TF_ASSIGN_OR_RETURN(XlaOp reshaped_operand,
Reshape(ShapeUtil::MakeShape(operand_shape.element_type(),
reshaped_dimensions),
operand));
// Broadcast 'reshape' up to the larger size.
return InDimBroadcast(broadcast_shape, reshaped_operand,
broadcast_dimensions);
}
XlaOp XlaBuilder::BinaryOp(
HloOpcode binop, const XlaOp& lhs, const XlaOp& rhs,
tensorflow::gtl::ArraySlice<int64> broadcast_dimensions) {
return NoteErrorOrReturn([&]() -> StatusOr<XlaOp> {
HloInstructionProto instr;
TF_ASSIGN_OR_RETURN(const Shape& lhs_shape, lhs.GetShape());
TF_ASSIGN_OR_RETURN(const Shape& rhs_shape, rhs.GetShape());
TF_ASSIGN_OR_RETURN(*instr.mutable_shape(),
ShapeInference::InferBinaryOpShape(
binop, lhs_shape, rhs_shape, broadcast_dimensions));
const int64 lhs_rank = ShapeUtil::Rank(lhs_shape);
const int64 rhs_rank = ShapeUtil::Rank(rhs_shape);
XlaOp updated_lhs = lhs;
XlaOp updated_rhs = rhs;
if (!broadcast_dimensions.empty() && lhs_rank != rhs_rank) {
const bool should_broadcast_lhs = lhs_rank < rhs_rank;
XlaOp from = should_broadcast_lhs ? lhs : rhs;
const Shape& from_shape = should_broadcast_lhs ? lhs_shape : rhs_shape;
std::vector<int64> to_size;
for (int64 size : instr.shape().dimensions()) {
to_size.push_back(size);
}
for (int64 from_dim = 0; from_dim < ShapeUtil::Rank(from_shape);
from_dim++) {
int64 to_dim = broadcast_dimensions[from_dim];
to_size[to_dim] = from_shape.dimensions(from_dim);
}
const Shape& broadcasted_shape =
ShapeUtil::MakeShape(from_shape.element_type(), to_size);
TF_ASSIGN_OR_RETURN(
XlaOp broadcasted_operand,
InDimBroadcast(broadcasted_shape, from, broadcast_dimensions));
updated_lhs = should_broadcast_lhs ? broadcasted_operand : lhs;
updated_rhs = !should_broadcast_lhs ? broadcasted_operand : rhs;
}
TF_ASSIGN_OR_RETURN(Shape updated_lhs_shape, updated_lhs.GetShape());
if (!ShapeUtil::SameDimensions(instr.shape(), updated_lhs_shape)) {
TF_ASSIGN_OR_RETURN(updated_lhs,
AddBroadcastSequence(instr.shape(), updated_lhs));
}
TF_ASSIGN_OR_RETURN(Shape updated_rhs_shape, updated_rhs.GetShape());
if (!ShapeUtil::SameDimensions(instr.shape(), updated_rhs_shape)) {
TF_ASSIGN_OR_RETURN(updated_rhs,
AddBroadcastSequence(instr.shape(), updated_rhs));
}
return AddInstruction(std::move(instr), binop, {updated_lhs, updated_rhs});
}());
}
XlaOp XlaBuilder::Add(const XlaOp& lhs, const XlaOp& rhs,
tensorflow::gtl::ArraySlice<int64> broadcast_dimensions) {
return BinaryOp(HloOpcode::kAdd, lhs, rhs, broadcast_dimensions);
}
XlaOp XlaBuilder::Mul(const XlaOp& lhs, const XlaOp& rhs,
tensorflow::gtl::ArraySlice<int64> broadcast_dimensions) {
return BinaryOp(HloOpcode::kMultiply, lhs, rhs, broadcast_dimensions);
}
XlaOp XlaBuilder::ConstantLiteral(const Literal& literal) {
return NoteErrorOrReturn([&]() -> StatusOr<XlaOp> {
HloInstructionProto instr;
*instr.mutable_shape() = literal.shape();
*instr.mutable_literal() = literal.ToProto();
return AddInstruction(std::move(instr), HloOpcode::kConstant);
}());
}
XlaOp XlaBuilder::Call(const XlaComputation& computation,
tensorflow::gtl::ArraySlice<XlaOp> operands) {
return NoteErrorOrReturn([&]() -> StatusOr<XlaOp> {
HloInstructionProto instr;
std::vector<const Shape*> operand_shape_ptrs;
std::vector<Shape> operand_shapes;
for (const auto& operand : operands) {
TF_ASSIGN_OR_RETURN(const Shape& shape, operand.GetShape());
operand_shapes.push_back(shape);
}
c_transform(operand_shapes, std::back_inserter(operand_shape_ptrs),
[](const Shape& shape) { return &shape; });
TF_ASSIGN_OR_RETURN(*instr.mutable_shape(),
ShapeInference::InferCallShape(
operand_shape_ptrs,
/*to_apply=*/computation.GetProgramShape()));
// Add called computation.
instr.add_called_computation_ids(
computation.proto().entry_computation_id());
for (const HloComputationProto& e : computation.proto().computations()) {
embedded_.insert({e.id(), e});
}
return AddInstruction(std::move(instr), HloOpcode::kCall, operands);
}());
}
XlaOp XlaBuilder::Parameter(int64 parameter_number, const Shape& shape,
const string& name) {
return NoteErrorOrReturn([&]() -> StatusOr<XlaOp> {
HloInstructionProto instr;
if (parameter_numbers_.find(parameter_number) != parameter_numbers_.end()) {
return InvalidArgument("parameter %lld already registered",
parameter_number);
}
parameter_numbers_.insert(parameter_number);
instr.set_parameter_number(parameter_number);
instr.set_name(name);
*instr.mutable_shape() = shape;
return AddInstruction(std::move(instr), HloOpcode::kParameter);
}());
}
XlaOp XlaBuilder::Broadcast(
const XlaOp& operand, tensorflow::gtl::ArraySlice<int64> broadcast_sizes) {
return NoteErrorOrReturn([&]() -> StatusOr<XlaOp> {
TF_ASSIGN_OR_RETURN(const Shape& operand_shape, operand.GetShape());
TF_ASSIGN_OR_RETURN(
const Shape& shape,
ShapeInference::InferBroadcastShape(operand_shape, broadcast_sizes));
// The client-level broadcast op just appends dimensions on the left (adds
// lowest numbered dimensions). The HLO broadcast instruction is more
// flexible and can add new dimensions anywhere. The instruction's
// dimensions field maps operand dimensions to dimensions in the broadcast
// output, so to append dimensions on the left the instruction's dimensions
// should just be the n highest dimension numbers of the output shape where
// n is the number of input dimensions.
const int64 operand_rank = ShapeUtil::Rank(operand_shape);
std::vector<int64> dimensions(operand_rank);
for (int i = 0; i < operand_rank; ++i) {
dimensions[i] = i + ShapeUtil::Rank(shape) - operand_rank;
}
return InDimBroadcast(shape, operand, dimensions);
}());
}
StatusOr<XlaOp> XlaBuilder::Reshape(const Shape& shape, const XlaOp& operand) {
HloInstructionProto instr;
*instr.mutable_shape() = shape;
return AddInstruction(std::move(instr), HloOpcode::kReshape, {operand});
}
XlaOp XlaBuilder::Slice(const XlaOp& operand,
tensorflow::gtl::ArraySlice<int64> start_indices,
tensorflow::gtl::ArraySlice<int64> limit_indices,
tensorflow::gtl::ArraySlice<int64> strides) {
return UnimplementedOp();
}
XlaOp XlaBuilder::SliceInDim(const XlaOp& operand, int64 start_index,
int64 limit_index, int64 stride, int64 dimno) {
return UnimplementedOp();
}
XlaOp XlaBuilder::DynamicSlice(const XlaOp& operand, const XlaOp& start_indices,
tensorflow::gtl::ArraySlice<int64> slice_sizes) {
return UnimplementedOp();
}
XlaOp XlaBuilder::DynamicUpdateSlice(const XlaOp& operand, const XlaOp& update,
const XlaOp& start_indices) {
return UnimplementedOp();
}
XlaOp XlaBuilder::ConcatInDim(tensorflow::gtl::ArraySlice<XlaOp> operands,
int64 dimension) {
return UnimplementedOp();
}
XlaOp XlaBuilder::Pad(const XlaOp& operand, const XlaOp& padding_value,
const PaddingConfig& padding_config) {
return UnimplementedOp();
}
XlaOp XlaBuilder::Reshape(const XlaOp& operand,
tensorflow::gtl::ArraySlice<int64> dimensions,
tensorflow::gtl::ArraySlice<int64> new_sizes) {
return NoteErrorOrReturn([&]() -> StatusOr<XlaOp> {
TF_ASSIGN_OR_RETURN(const Shape& operand_shape, operand.GetShape());
TF_ASSIGN_OR_RETURN(const Shape& shape,
ShapeInference::InferReshapeShape(
operand_shape, dimensions, new_sizes));
XlaOp transposed = IsIdentityPermutation(dimensions)
? operand
: Transpose(operand, dimensions);
return Reshape(shape, transposed);
}());
}
XlaOp XlaBuilder::Reshape(const XlaOp& operand,
tensorflow::gtl::ArraySlice<int64> new_sizes) {
return NoteErrorOrReturn([&]() -> StatusOr<XlaOp> {
TF_ASSIGN_OR_RETURN(auto shape, operand.GetShape());
std::vector<int64> dimensions(shape.dimensions_size());
std::iota(dimensions.begin(), dimensions.end(), 0);
return Reshape(operand, dimensions, new_sizes);
}());
}
XlaOp XlaBuilder::Collapse(const XlaOp& operand,
tensorflow::gtl::ArraySlice<int64> dimensions) {
return UnimplementedOp();
}
void XlaBuilder::Trace(const string& tag, const XlaOp& operand) {
UnimplementedOp();
}
XlaOp XlaBuilder::Select(const XlaOp& pred, const XlaOp& on_true,
const XlaOp& on_false) {
return UnimplementedOp();
}
XlaOp XlaBuilder::Tuple(tensorflow::gtl::ArraySlice<XlaOp> elements) {
return UnimplementedOp();
}
XlaOp XlaBuilder::GetTupleElement(const XlaOp& tuple_data, int64 index) {
return UnimplementedOp();
}
XlaOp XlaBuilder::Eq(const XlaOp& lhs, const XlaOp& rhs,
tensorflow::gtl::ArraySlice<int64> broadcast_dimensions) {
return UnimplementedOp();
}
XlaOp XlaBuilder::Ne(const XlaOp& lhs, const XlaOp& rhs,
tensorflow::gtl::ArraySlice<int64> broadcast_dimensions) {
return UnimplementedOp();
}
XlaOp XlaBuilder::Ge(const XlaOp& lhs, const XlaOp& rhs,
tensorflow::gtl::ArraySlice<int64> broadcast_dimensions) {
return UnimplementedOp();
}
XlaOp XlaBuilder::Gt(const XlaOp& lhs, const XlaOp& rhs,
tensorflow::gtl::ArraySlice<int64> broadcast_dimensions) {
return UnimplementedOp();
}
XlaOp XlaBuilder::Le(const XlaOp& lhs, const XlaOp& rhs,
tensorflow::gtl::ArraySlice<int64> broadcast_dimensions) {
return UnimplementedOp();
}
XlaOp XlaBuilder::Lt(const XlaOp& lhs, const XlaOp& rhs,
tensorflow::gtl::ArraySlice<int64> broadcast_dimensions) {
return UnimplementedOp();
}
XlaOp XlaBuilder::Dot(const XlaOp& lhs, const XlaOp& rhs) {
return UnimplementedOp();
}
XlaOp XlaBuilder::DotGeneral(const XlaOp& lhs, const XlaOp& rhs,
const DotDimensionNumbers& dimension_numbers) {
return UnimplementedOp();
}
XlaOp XlaBuilder::Conv(const XlaOp& lhs, const XlaOp& rhs,
tensorflow::gtl::ArraySlice<int64> window_strides,
Padding padding) {
return UnimplementedOp();
}
XlaOp XlaBuilder::ConvWithGeneralPadding(
const XlaOp& lhs, const XlaOp& rhs,
tensorflow::gtl::ArraySlice<int64> window_strides,
tensorflow::gtl::ArraySlice<std::pair<int64, int64>> padding) {
return UnimplementedOp();
}
XlaOp XlaBuilder::ConvWithGeneralDimensions(
const XlaOp& lhs, const XlaOp& rhs,
tensorflow::gtl::ArraySlice<int64> window_strides, Padding padding,
const ConvolutionDimensionNumbers& dimension_numbers) {
return UnimplementedOp();
}
XlaOp XlaBuilder::ConvGeneral(
const XlaOp& lhs, const XlaOp& rhs,
tensorflow::gtl::ArraySlice<int64> window_strides,
tensorflow::gtl::ArraySlice<std::pair<int64, int64>> padding,
const ConvolutionDimensionNumbers& dimension_numbers) {
return UnimplementedOp();
}
XlaOp XlaBuilder::ConvGeneralDilated(
const XlaOp& lhs, const XlaOp& rhs,
tensorflow::gtl::ArraySlice<int64> window_strides,
tensorflow::gtl::ArraySlice<std::pair<int64, int64>> padding,
tensorflow::gtl::ArraySlice<int64> lhs_dilation,
tensorflow::gtl::ArraySlice<int64> rhs_dilation,
const ConvolutionDimensionNumbers& dimension_numbers) {
return UnimplementedOp();
}
XlaOp XlaBuilder::Fft(const XlaOp& operand, const FftType fft_type,
const tensorflow::gtl::ArraySlice<int64> fft_length) {
return UnimplementedOp();
}
XlaOp XlaBuilder::Infeed(const Shape& shape, const string& config) {
return UnimplementedOp();
}
void XlaBuilder::Outfeed(const XlaOp& operand, const Shape& shape_with_layout,
const string& outfeed_config) {
UnimplementedOp();
}
XlaOp XlaBuilder::CustomCall(const string& call_target_name,
tensorflow::gtl::ArraySlice<XlaOp> operands,
const Shape& shape) {
return UnimplementedOp();
}
XlaOp XlaBuilder::HostCompute(tensorflow::gtl::ArraySlice<XlaOp> operands,
const string& channel_name,
int64 cost_estimate_ns, const Shape& shape) {
return UnimplementedOp();
}
XlaOp XlaBuilder::Complex(
const XlaOp& real, const XlaOp& imag,
tensorflow::gtl::ArraySlice<int64> broadcast_dimensions) {
return UnimplementedOp();
}
XlaOp XlaBuilder::Conj(const XlaOp& operand) { return UnimplementedOp(); }
XlaOp XlaBuilder::Sub(const XlaOp& lhs, const XlaOp& rhs,
tensorflow::gtl::ArraySlice<int64> broadcast_dimensions) {
return UnimplementedOp();
}
XlaOp XlaBuilder::Div(const XlaOp& lhs, const XlaOp& rhs,
tensorflow::gtl::ArraySlice<int64> broadcast_dimensions) {
return UnimplementedOp();
}
XlaOp XlaBuilder::Rem(const XlaOp& lhs, const XlaOp& rhs,
tensorflow::gtl::ArraySlice<int64> broadcast_dimensions) {
return UnimplementedOp();
}
XlaOp XlaBuilder::Max(const XlaOp& lhs, const XlaOp& rhs,
tensorflow::gtl::ArraySlice<int64> broadcast_dimensions) {
return UnimplementedOp();
}
XlaOp XlaBuilder::Min(const XlaOp& lhs, const XlaOp& rhs,
tensorflow::gtl::ArraySlice<int64> broadcast_dimensions) {
return UnimplementedOp();
}
XlaOp XlaBuilder::And(const XlaOp& lhs, const XlaOp& rhs,
tensorflow::gtl::ArraySlice<int64> broadcast_dimensions) {
return UnimplementedOp();
}
XlaOp XlaBuilder::Or(const XlaOp& lhs, const XlaOp& rhs,
tensorflow::gtl::ArraySlice<int64> broadcast_dimensions) {
return UnimplementedOp();
}
XlaOp XlaBuilder::Xor(const XlaOp& lhs, const XlaOp& rhs,
tensorflow::gtl::ArraySlice<int64> broadcast_dimensions) {
return UnimplementedOp();
}
XlaOp XlaBuilder::Not(const XlaOp& operand) { return UnimplementedOp(); }
XlaOp XlaBuilder::ShiftLeft(
const XlaOp& lhs, const XlaOp& rhs,
tensorflow::gtl::ArraySlice<int64> broadcast_dimensions) {
return UnimplementedOp();
}
XlaOp XlaBuilder::ShiftRightArithmetic(
const XlaOp& lhs, const XlaOp& rhs,
tensorflow::gtl::ArraySlice<int64> broadcast_dimensions) {
return UnimplementedOp();
}
XlaOp XlaBuilder::ShiftRightLogical(
const XlaOp& lhs, const XlaOp& rhs,
tensorflow::gtl::ArraySlice<int64> broadcast_dimensions) {
return UnimplementedOp();
}
XlaOp XlaBuilder::Abs(const XlaOp& operand) { return UnimplementedOp(); }
XlaOp XlaBuilder::Atan2(
const XlaOp& y, const XlaOp& x,
tensorflow::gtl::ArraySlice<int64> broadcast_dimensions) {
return UnimplementedOp();
}
XlaOp XlaBuilder::Exp(const XlaOp& operand) { return UnimplementedOp(); }
XlaOp XlaBuilder::Floor(const XlaOp& operand) { return UnimplementedOp(); }
XlaOp XlaBuilder::Ceil(const XlaOp& operand) { return UnimplementedOp(); }
XlaOp XlaBuilder::Round(const XlaOp& operand) { return UnimplementedOp(); }
XlaOp XlaBuilder::Log(const XlaOp& operand) { return UnimplementedOp(); }
XlaOp XlaBuilder::Sign(const XlaOp& operand) { return UnimplementedOp(); }
XlaOp XlaBuilder::Cos(const XlaOp& operand) { return UnimplementedOp(); }
XlaOp XlaBuilder::Sin(const XlaOp& operand) { return UnimplementedOp(); }
XlaOp XlaBuilder::Tanh(const XlaOp& operand) { return UnimplementedOp(); }
XlaOp XlaBuilder::Real(const XlaOp& operand) { return UnimplementedOp(); }
XlaOp XlaBuilder::Imag(const XlaOp& operand) { return UnimplementedOp(); }
XlaOp XlaBuilder::IsFinite(const XlaOp& operand) { return UnimplementedOp(); }
XlaOp XlaBuilder::Transpose(const XlaOp& operand,
tensorflow::gtl::ArraySlice<int64> permutation) {
return NoteErrorOrReturn([&]() -> StatusOr<XlaOp> {
HloInstructionProto instr;
TF_ASSIGN_OR_RETURN(const Shape& operand_shape, operand.GetShape());
TF_ASSIGN_OR_RETURN(
*instr.mutable_shape(),
ShapeInference::InferTransposeShape(operand_shape, permutation));
for (int64 dim : permutation) {
instr.add_dimensions(dim);
}
return AddInstruction(std::move(instr), HloOpcode::kTranspose, {operand});
}());
}
XlaOp XlaBuilder::Rev(const XlaOp& operand,
tensorflow::gtl::ArraySlice<int64> dimensions) {
return UnimplementedOp();
}
XlaOp XlaBuilder::Sort(const XlaOp& operand) { return UnimplementedOp(); }
XlaOp XlaBuilder::SqrtF32(const XlaOp& operand) { return UnimplementedOp(); }
XlaOp XlaBuilder::Pow(const XlaOp& lhs, const XlaOp& rhs,
tensorflow::gtl::ArraySlice<int64> broadcast_dimensions) {
return UnimplementedOp();
}
XlaOp XlaBuilder::ConvertElementType(const XlaOp& operand,
PrimitiveType new_element_type) {
return UnimplementedOp();
}
XlaOp XlaBuilder::BitcastConvertType(const XlaOp& operand,
PrimitiveType new_element_type) {
return UnimplementedOp();
}
XlaOp XlaBuilder::SquareF32(const XlaOp& operand) { return UnimplementedOp(); }
XlaOp XlaBuilder::ReciprocalF32(const XlaOp& operand) {
return UnimplementedOp();
}
XlaOp XlaBuilder::Neg(const XlaOp& operand) { return UnimplementedOp(); }
XlaOp XlaBuilder::Clamp(const XlaOp& min, const XlaOp& operand,
const XlaOp& max) {
return UnimplementedOp();
}
XlaOp XlaBuilder::Map(tensorflow::gtl::ArraySlice<XlaOp> operands,
const XlaComputation& computation,
tensorflow::gtl::ArraySlice<int64> dimensions,
tensorflow::gtl::ArraySlice<XlaOp> static_operands) {
return UnimplementedOp();
}
XlaOp XlaBuilder::RngNormal(const XlaOp& mu, const XlaOp& sigma,
const Shape& shape) {
return UnimplementedOp();
}
XlaOp XlaBuilder::RngUniform(const XlaOp& a, const XlaOp& b,
const Shape& shape) {
return UnimplementedOp();
}
XlaOp XlaBuilder::While(const XlaComputation& condition,
const XlaComputation& body, const XlaOp& init) {
return UnimplementedOp();
}
XlaOp XlaBuilder::Gather(const XlaOp& input, const XlaOp& gather_indices,
const GatherDimensionNumbers& dimension_numbers,
tensorflow::gtl::ArraySlice<int64> window_bounds) {
return UnimplementedOp();
}
XlaOp XlaBuilder::Conditional(const XlaOp& predicate, const XlaOp& true_operand,
const XlaComputation& true_computation,
const XlaOp& false_operand,
const XlaComputation& false_computation) {
return UnimplementedOp();
}
XlaOp XlaBuilder::Reduce(
const XlaOp& operand, const XlaOp& init_value,
const XlaComputation& computation,
tensorflow::gtl::ArraySlice<int64> dimensions_to_reduce) {
return UnimplementedOp();
}
XlaOp XlaBuilder::ReduceAll(const XlaOp& operand, const XlaOp& init_value,
const XlaComputation& computation) {
return UnimplementedOp();
}
XlaOp XlaBuilder::ReduceWindow(
const XlaOp& operand, const XlaOp& init_value,
const XlaComputation& computation,
tensorflow::gtl::ArraySlice<int64> window_dimensions,
tensorflow::gtl::ArraySlice<int64> window_strides, Padding padding) {
return UnimplementedOp();
}
XlaOp XlaBuilder::ReduceWindowWithGeneralPadding(
const XlaOp& operand, const XlaOp& init_value,
const XlaComputation& computation,
tensorflow::gtl::ArraySlice<int64> window_dimensions,
tensorflow::gtl::ArraySlice<int64> window_strides,
tensorflow::gtl::ArraySlice<std::pair<int64, int64>> padding) {
return UnimplementedOp();
}
XlaOp XlaBuilder::BatchNormTraining(const XlaOp& operand, const XlaOp& scale,
const XlaOp& offset, float epsilon,
int64 feature_index) {
return UnimplementedOp();
}
XlaOp XlaBuilder::BatchNormInference(const XlaOp& operand, const XlaOp& scale,
const XlaOp& offset, const XlaOp& mean,
const XlaOp& variance, float epsilon,
int64 feature_index) {
return UnimplementedOp();
}
XlaOp XlaBuilder::BatchNormGrad(const XlaOp& operand, const XlaOp& scale,
const XlaOp& batch_mean, const XlaOp& batch_var,
const XlaOp& grad_output, float epsilon,
int64 feature_index) {
return UnimplementedOp();
}
XlaOp XlaBuilder::CrossReplicaSum(const XlaOp& operand) {
return UnimplementedOp();
}
XlaOp XlaBuilder::SelectAndScatter(
const XlaOp& operand, const XlaComputation& select,
tensorflow::gtl::ArraySlice<int64> window_dimensions,
tensorflow::gtl::ArraySlice<int64> window_strides, Padding padding,
const XlaOp& source, const XlaOp& init_value,
const XlaComputation& scatter) {
return UnimplementedOp();
}
XlaOp XlaBuilder::SelectAndScatterWithGeneralPadding(
const XlaOp& operand, const XlaComputation& select,
tensorflow::gtl::ArraySlice<int64> window_dimensions,
tensorflow::gtl::ArraySlice<int64> window_strides,
tensorflow::gtl::ArraySlice<std::pair<int64, int64>> padding,
const XlaOp& source, const XlaOp& init_value,
const XlaComputation& scatter) {
return UnimplementedOp();
}
XlaOp XlaBuilder::ReducePrecision(const XlaOp& operand, const int exponent_bits,
const int mantissa_bits) {
return UnimplementedOp();
}
void XlaBuilder::Send(const XlaOp& operand, const ChannelHandle& handle) {
UnimplementedOp();
}
XlaOp XlaBuilder::Recv(const Shape& shape, const ChannelHandle& handle) {
return UnimplementedOp();
}
StatusOr<XlaOp> XlaBuilder::AddInstruction(
HloInstructionProto&& instr, HloOpcode opcode,
tensorflow::gtl::ArraySlice<XlaOp> operands) {
const int64 handle = instructions_.size();
instr.set_id(handle);
instr.set_opcode(HloOpcodeString(opcode));
if (instr.name().empty()) {
instr.set_name(StrCat(instr.opcode(), ".", handle));
} else {
// Append the handle to make sure the name is unique.
instr.set_name(StrCat(instr.name(), ".", handle));
}
for (const auto& operand : operands) {
TF_RET_CHECK(operand.builder_ != nullptr);
TF_RET_CHECK(operand.builder_ == this)
<< "Do not add XlaOp from builder " << operand.builder_->name()
<< " to builder " << this->name();
instr.add_operand_ids(operand.handle());
// TODO(b/74197823): Set metadata and sharding.
}
instructions_.push_back(instr);
XlaOp op(handle, this);
return op;
}
StatusOr<const HloInstructionProto*> XlaBuilder::LookUpInstruction(
const XlaOp& op) const {
TF_RET_CHECK(op.builder_ == this);
if (op.handle() >= instructions_.size() || op.handle() < 0) {
return InvalidArgument("no XlaOp value %lld", op.handle());
}
return &instructions_[op.handle()];
}
XlaOp XlaBuilder::UnimplementedOp() {
NoteError(Unimplemented("Op not yet implemented"));
return {};
}
} // namespace xla
| [
"gardener@tensorflow.org"
] | gardener@tensorflow.org |
d00e7bb81cf7c5eee055ecb75ba91020001840cf | ea4927b310fe328833d66bd76aee964702c42f6c | /lua/lua_source_lstate.cpp | a072d1b3efe44020051b7853265bf96d3c5c78e7 | [] | no_license | nanguazhude/lua_test_register | 973c2340409b7a45c33876270e5a18c2d3bb0a31 | bb055c4c3653a720c4ed5eead4b79280f4d19484 | refs/heads/master | 2020-03-30T05:08:44.493069 | 2018-09-29T12:55:38 | 2018-09-29T12:55:38 | 150,783,147 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 8,498 | cpp | /*
** $Id: lstate.c,v 2.133.1.1 2017/04/19 17:39:34 roberto Exp $
** Global State
** See Copyright Notice in lua.h
*/
#define lstate_c
#define LUA_CORE
#include "lprefix.h"
#include <stddef.h>
#include <string.h>
#include "lua.h"
#include "lapi.h"
#include "ldebug.h"
#include "ldo.h"
#include "lfunc.h"
#include "lgc.h"
#include "llex.h"
#include "lmem.h"
#include "lstate.h"
#include "lstring.h"
#include "ltable.h"
#include "ltm.h"
#if !defined(LUAI_GCPAUSE)
#define LUAI_GCPAUSE 200 /* 200% */
#endif
#if !defined(LUAI_GCMUL)
#define LUAI_GCMUL 200 /* GC runs 'twice the speed' of memory allocation */
#endif
/*
** a macro to help the creation of a unique random seed when a state is
** created; the seed is used to randomize hashes.
*/
#if !defined(luai_makeseed)
#include <time.h>
#define luai_makeseed() cast(unsigned int, time(NULL))
#endif
/*
** thread state + extra space
*/
typedef struct LX {
lu_byte extra_[LUA_EXTRASPACE];
lua_State l;
} LX;
/*
** Main thread combines a thread state and the global state
*/
typedef struct LG {
LX l;
global_State g;
} LG;
#define fromstate(L) (cast(LX *, cast(lu_byte *, (L)) - offsetof(LX, l)))
/*
** Compute an initial seed as random as possible. Rely on Address Space
** Layout Randomization (if present) to increase randomness..
*/
#define addbuff(b,p,e) \
{ size_t t = cast(size_t, e); \
memcpy(b + p, &t, sizeof(t)); p += sizeof(t); }
static unsigned int makeseed (lua_State *L) {
char buff[4 * sizeof(size_t)];
unsigned int h = luai_makeseed();
int p = 0;
addbuff(buff, p, L); /* heap variable */
addbuff(buff, p, &h); /* local variable */
addbuff(buff, p, luaO_nilobject); /* global variable */
addbuff(buff, p, &lua_newstate); /* public function */
lua_assert(p == sizeof(buff));
return luaS_hash(buff, p, h);
}
/*
** set GCdebt to a new value keeping the value (totalbytes + GCdebt)
** invariant (and avoiding underflows in 'totalbytes')
*/
void luaE_setdebt (global_State *g, l_mem debt) {
l_mem tb = gettotalbytes(g);
lua_assert(tb > 0);
if (debt < tb - MAX_LMEM)
debt = tb - MAX_LMEM; /* will make 'totalbytes == MAX_LMEM' */
g->totalbytes = tb - debt;
g->GCdebt = debt;
}
CallInfo *luaE_extendCI (lua_State *L) {
CallInfo *ci = luaM_new(L, CallInfo);
lua_assert(L->ci->next == NULL);
L->ci->next = ci;
ci->previous = L->ci;
ci->next = NULL;
L->nci++;
return ci;
}
/*
** free all CallInfo structures not in use by a thread
*/
void luaE_freeCI (lua_State *L) {
CallInfo *ci = L->ci;
CallInfo *next = ci->next;
ci->next = NULL;
while ((ci = next) != NULL) {
next = ci->next;
luaM_free(L, ci);
L->nci--;
}
}
/*
** free half of the CallInfo structures not in use by a thread
*/
void luaE_shrinkCI (lua_State *L) {
CallInfo *ci = L->ci;
CallInfo *next2; /* next's next */
/* while there are two nexts */
while (ci->next != NULL && (next2 = ci->next->next) != NULL) {
luaM_free(L, ci->next); /* free next */
L->nci--;
ci->next = next2; /* remove 'next' from the list */
next2->previous = ci;
ci = next2; /* keep next's next */
}
}
static void stack_init (lua_State *L1, lua_State *L) {
int i; CallInfo *ci;
/* initialize stack array */
L1->stack = luaM_newvector(L, BASIC_STACK_SIZE, TValue);
L1->stacksize = BASIC_STACK_SIZE;
for (i = 0; i < BASIC_STACK_SIZE; i++)
setnilvalue(L1->stack + i); /* erase new stack */
L1->top = L1->stack;
L1->stack_last = L1->stack + L1->stacksize - EXTRA_STACK;
/* initialize first ci */
ci = &L1->base_ci;
ci->next = ci->previous = NULL;
ci->callstatus = 0;
ci->func = L1->top;
setnilvalue(L1->top++); /* 'function' entry for this 'ci' */
ci->top = L1->top + LUA_MINSTACK;
L1->ci = ci;
}
static void freestack (lua_State *L) {
if (L->stack == NULL)
return; /* stack not completely built yet */
L->ci = &L->base_ci; /* free the entire 'ci' list */
luaE_freeCI(L);
lua_assert(L->nci == 0);
luaM_freearray(L, L->stack, L->stacksize); /* free stack array */
}
/*
** Create registry table and its predefined values
*/
static void init_registry (lua_State *L, global_State *g) {
TValue temp;
/* create registry */
Table *registry = luaH_new(L);
sethvalue(L, &g->l_registry, registry);
luaH_resize(L, registry, LUA_RIDX_LAST, 0);
/* registry[LUA_RIDX_MAINTHREAD] = L */
setthvalue(L, &temp, L); /* temp = L */
luaH_setint(L, registry, LUA_RIDX_MAINTHREAD, &temp);
/* registry[LUA_RIDX_GLOBALS] = table of globals */
sethvalue(L, &temp, luaH_new(L)); /* temp = new table (global table) */
luaH_setint(L, registry, LUA_RIDX_GLOBALS, &temp);
}
/*
** open parts of the state that may cause memory-allocation errors.
** ('g->version' != NULL flags that the state was completely build)
*/
static void f_luaopen (lua_State *L, void *ud) {
global_State *g = G(L);
UNUSED(ud);
stack_init(L, L); /* init stack */
init_registry(L, g);
luaS_init(L);
luaT_init(L);
luaX_init(L);
g->gcrunning = 1; /* allow gc */
g->version = lua_version(NULL);
luai_userstateopen(L);
}
/*
** preinitialize a thread with consistent values without allocating
** any memory (to avoid errors)
*/
static void preinit_thread (lua_State *L, global_State *g) {
G(L) = g;
L->stack = NULL;
L->ci = NULL;
L->nci = 0;
L->stacksize = 0;
L->twups = L; /* thread has no upvalues */
L->errorJmp = NULL;
L->nCcalls = 0;
L->hook = NULL;
L->hookmask = 0;
L->basehookcount = 0;
L->allowhook = 1;
resethookcount(L);
L->openupval = NULL;
L->nny = 1;
L->status = LUA_OK;
L->errfunc = 0;
}
static void close_state (lua_State *L) {
global_State *g = G(L);
luaF_close(L, L->stack); /* close all upvalues for this thread */
luaC_freeallobjects(L); /* collect all objects */
if (g->version) /* closing a fully built state? */
luai_userstateclose(L);
luaM_freearray(L, G(L)->strt.hash, G(L)->strt.size);
freestack(L);
lua_assert(gettotalbytes(g) == sizeof(LG));
(*g->frealloc)(g->ud, fromstate(L), sizeof(LG), 0); /* free main block */
}
LUA_API lua_State *lua_newthread (lua_State *L) {
global_State *g = G(L);
lua_State *L1;
lua_lock(L);
luaC_checkGC(L);
/* create new thread */
L1 = &cast(LX *, luaM_newobject(L, LUA_TTHREAD, sizeof(LX)))->l;
L1->marked = luaC_white(g);
L1->tt = LUA_TTHREAD;
/* link it on list 'allgc' */
L1->next = g->allgc;
g->allgc = obj2gco(L1);
/* anchor it on L stack */
setthvalue(L, L->top, L1);
api_incr_top(L);
preinit_thread(L1, g);
L1->hookmask = L->hookmask;
L1->basehookcount = L->basehookcount;
L1->hook = L->hook;
resethookcount(L1);
/* initialize L1 extra space */
memcpy(lua_getextraspace(L1), lua_getextraspace(g->mainthread),
LUA_EXTRASPACE);
luai_userstatethread(L, L1);
stack_init(L1, L); /* init stack */
lua_unlock(L);
return L1;
}
void luaE_freethread (lua_State *L, lua_State *L1) {
LX *l = fromstate(L1);
luaF_close(L1, L1->stack); /* close all upvalues for this thread */
lua_assert(L1->openupval == NULL);
luai_userstatefree(L, L1);
freestack(L1);
luaM_free(L, l);
}
LUA_API lua_State *lua_newstate (lua_Alloc f, void *ud) {
int i;
lua_State *L;
global_State *g;
LG *l = cast(LG *, (*f)(ud, NULL, LUA_TTHREAD, sizeof(LG)));
if (l == NULL) return NULL;
L = &l->l.l;
g = &l->g;
L->next = NULL;
L->tt = LUA_TTHREAD;
g->currentwhite = bitmask(WHITE0BIT);
L->marked = luaC_white(g);
preinit_thread(L, g);
g->frealloc = f;
g->ud = ud;
g->mainthread = L;
g->seed = makeseed(L);
g->gcrunning = 0; /* no GC while building state */
g->GCestimate = 0;
g->strt.size = g->strt.nuse = 0;
g->strt.hash = NULL;
setnilvalue(&g->l_registry);
g->panic = NULL;
g->version = NULL;
g->gcstate = GCSpause;
g->gckind = KGC_NORMAL;
g->allgc = g->finobj = g->tobefnz = g->fixedgc = NULL;
g->sweepgc = NULL;
g->gray = g->grayagain = NULL;
g->weak = g->ephemeron = g->allweak = NULL;
g->twups = NULL;
g->totalbytes = sizeof(LG);
g->GCdebt = 0;
g->gcfinnum = 0;
g->gcpause = LUAI_GCPAUSE;
g->gcstepmul = LUAI_GCMUL;
for (i=0; i < LUA_NUMTAGS; i++) g->mt[i] = NULL;
if (luaD_rawrunprotected(L, f_luaopen, NULL) != LUA_OK) {
/* memory allocation error: free partial state */
close_state(L);
L = NULL;
}
return L;
}
LUA_API void lua_close (lua_State *L) {
L = G(L)->mainthread; /* only the main thread can be closed */
lua_lock(L);
close_state(L);
}
| [
"nanguazhude@vip.qq.com"
] | nanguazhude@vip.qq.com |
ce1eb726cb1ef9044fdb795c45798755ee4bdfb3 | 650965dfff8359969a8d09979ce1cb464a6b72e0 | /YouDao_2010/poj_YouDao_Qualification02_A.cpp | 654c2eebedca1d7da1c3bb60c8f4a278d6773d90 | [
"Apache-2.0"
] | permissive | antonio081014/ACM-POJ-CodeBase | 124b5541c5f3ed95e19d2fc7d9ba7aceea8cf71e | fda83207fa5c4ffd09f16880ff4e34a742716269 | refs/heads/master | 2020-05-26T07:46:07.987029 | 2013-11-07T18:25:07 | 2013-11-07T18:25:07 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,422 | cpp | //Sun May 30 06:49:55 CDT 2010
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
using namespace std;
int main(int argc, const char* argv[])
{
// freopen("input.in", "r", stdin);
// freopen("output.out", "w", stdout);
int T;
cin >> T;
while (T--)
{
int N, M;
cin >> N >> M;
double sum = 0;
int score = 0;
vector<pair<double, int> > v(M);
for (int i = 0; i < N; i++)
{
double temp1;
int temp2;
cin >> temp1 >> temp2;
sum += temp1 * temp2;
score += temp2;
}
for (int i = 0; i < M; i++)
{
double temp1;
int temp2;
cin >> temp1 >> temp2;
v[i] = make_pair(-temp1*temp2, temp2);
}
sort(v.begin(), v.end());
if(90 * score <= sum)
{
cout << 0 << endl;
continue;
}
bool flag = true;
for(int i=0; i<M; i++)
{
sum -= v[i].first;
score += v[i].second;
if(90 * score <= sum )
{
cout << i+1 << endl;
flag = false;
break;
}
}
if(flag)
{
cout << "Impossible" << endl;
}
}
// fclose(stdin);
// fclose(stdout);
return 0;
}
| [
"antonio081014@antonio081014.com"
] | antonio081014@antonio081014.com |
c838dc75d806423c6582e447a22566d8b3d69a00 | b7eb06db315aef40f342ab03d5b832a9d882fee3 | /Source/PoyectoVR_Fuego/PoyectoVR_FuegoGameModeBase.h | c4fb2969c508ee2f60cfa5d25e5f85c82d6d1061 | [] | no_license | CSM-RV/PoyectoVR_Extintor | fba82ac95b792e1e862d6aef2177b6511e118c3f | 3f7de23ed466ff0791e72b74b10ea92d307584f5 | refs/heads/master | 2021-07-08T00:46:48.172113 | 2019-04-30T16:00:35 | 2019-04-30T16:00:35 | 153,829,223 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 341 | h | // Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/GameModeBase.h"
#include "PoyectoVR_FuegoGameModeBase.generated.h"
/**
*
*/
UCLASS()
class POYECTOVR_FUEGO_API APoyectoVR_FuegoGameModeBase : public AGameModeBase
{
GENERATED_BODY()
};
| [
"jose.alonsozp@outlook.com"
] | jose.alonsozp@outlook.com |
8a4f15aae738b6256ddea62691d9f2b1f87f0a3e | e157a637f9cc34ad59d9397dc0b3a5eb25760314 | /16234_인구 이동.cpp | f259c572ef150f4f009f122627b904b29a6daa41 | [] | no_license | straightmin/Baekjoon-Algorithm | 23b3db8ba582be550e84bb2c2d5061c71e8995dc | 30255e1e0b41079caf34fced48a41e35f4fc3b6e | refs/heads/main | 2023-07-18T16:50:53.604361 | 2021-08-29T14:32:43 | 2021-08-29T14:32:43 | 393,053,928 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,504 | cpp | #include <iostream>
#include <utility>
#include <queue>
#include <algorithm>
using namespace std;
int n, l, r;
int map[50][50];
bool visit[50][50];
int dx[] = {0,0,-1,1};
int dy[] = {-1,1,0,0};
bool in(int y, int x){
return (y >= 0 && y < n && x >= 0 && x < n);
}
bool bfs(int y, int x){
queue<pair<int, int> > q;
queue<pair<int, int> > open;
int count = 1;
int population = map[y][x];
q.push({y, x});
open.push({y, x});
visit[y][x] = true;
while(!q.empty()){
pair<int, int> curr = q.front();
q.pop();
int cy = curr.first;
int cx = curr.second;
for(int i = 0; i < 4; i++){
y = dy[i] + cy;
x = dx[i] + cx;
if(!in(y, x)) continue;
int diff = abs(map[y][x] - map[cy][cx]);
if(diff < l || diff > r) continue;
if(visit[y][x]) continue;
population += map[y][x];
q.push({y, x});
open.push({y, x});
visit[y][x] = true;
count++;
}
}
population /= count;
while(!open.empty()){
pair<int, int> opend = open.front();
open.pop();
map[opend.first][opend.second] = population;
}
if(count == 1) return false;
return true;
}
int main(){
cin >> n >> l >> r;
for(int i = 0; i < n; i++){
for(int j = 0; j < n; j++){
cin >> map[i][j];
}
}
bool opend = true;
int day = 0;
while(true){
opend = false;
fill(visit[0], visit[49]+50, false);
for(int i = 0; i < n; i++){
for(int j = 0; j < n; j++){
if(visit[i][j]) continue;
if(bfs(i, j)) opend = true;
}
}
if(!opend) break;
day++;
}
cout << day;
}
| [
"straightmin@gmail.com"
] | straightmin@gmail.com |
7f672b2aab120c388e2cf319e4e791adcc29efd5 | 023d42ce4139d4a2274362631f19ece8cf8b0693 | /learncpp/ex_1.10a/main.cpp | 6d19e793a4d19a01ba08ab9a5d0e5bf8f1c95152 | [] | no_license | themattinthehatt/tutorials | a74471eda2f444a22336f38d7b9664e18972e6f2 | 49ab9f95670a817d119a3142566a7be8482cc01b | refs/heads/master | 2021-01-11T10:47:55.679749 | 2018-01-13T21:39:41 | 2018-01-13T21:39:41 | 79,058,682 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 70 | cpp | #include "math.h"
#include "geometry.h"
int main()
{
return 0;
}
| [
"themattinthehatt@gmail.com"
] | themattinthehatt@gmail.com |
8cb6ad355994eb76f3ea48f7308250bf139de742 | b7ee9ac14d6981e18fa1b19214366878a4884a42 | /Projects/Irrlicht/Include/triangle3d.h | 0d4ebbd152223483e337078b4420b4376e169ccf | [
"MIT"
] | permissive | skylicht-lab/skylicht-engine | 89d51b4240ca6ed5a7f15b413df5711288580e9e | ff0e875581840efd15503cdfa49f112b6adade98 | refs/heads/master | 2023-09-01T02:23:45.865965 | 2023-08-29T08:21:41 | 2023-08-29T08:21:41 | 220,988,542 | 492 | 46 | MIT | 2023-06-05T10:18:45 | 2019-11-11T13:34:56 | C++ | UTF-8 | C++ | false | false | 11,404 | h | // Copyright (C) 2002-2012 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __IRR_TRIANGLE_3D_H_INCLUDED__
#define __IRR_TRIANGLE_3D_H_INCLUDED__
#include "vector3d.h"
#include "line3d.h"
#include "plane3d.h"
#include "aabbox3d.h"
namespace irr
{
namespace core
{
#define INLINE_CROSSPRODUCT(ret, a, b) ret.X = a.Y * b.Z - a.Z * b.Y; ret.Y = a.Z * b.X - a.X * b.Z; ret.Z = a.X * b.Y - a.Y * b.X
//! 3d triangle template class for doing collision detection and other things.
template <class T>
class triangle3d
{
public:
//! Constructor for an all 0 triangle
triangle3d() {}
//! Constructor for triangle with given three vertices
triangle3d(vector3d<T> v1, vector3d<T> v2, vector3d<T> v3) : pointA(v1), pointB(v2), pointC(v3) {}
//! Equality operator
bool operator==(const triangle3d<T>& other) const
{
return other.pointA==pointA && other.pointB==pointB && other.pointC==pointC;
}
//! Inequality operator
bool operator!=(const triangle3d<T>& other) const
{
return !(*this==other);
}
//! Determines if the triangle is totally inside a bounding box.
/** \param box Box to check.
\return True if triangle is within the box, otherwise false. */
bool isTotalInsideBox(const aabbox3d<T>& box) const
{
return (box.isPointInside(pointA) &&
box.isPointInside(pointB) &&
box.isPointInside(pointC));
}
//! Determines if the triangle is totally outside a bounding box.
/** \param box Box to check.
\return True if triangle is outside the box, otherwise false. */
bool isTotalOutsideBox(const aabbox3d<T>& box) const
{
return ((pointA.X > box.MaxEdge.X && pointB.X > box.MaxEdge.X && pointC.X > box.MaxEdge.X) ||
(pointA.Y > box.MaxEdge.Y && pointB.Y > box.MaxEdge.Y && pointC.Y > box.MaxEdge.Y) ||
(pointA.Z > box.MaxEdge.Z && pointB.Z > box.MaxEdge.Z && pointC.Z > box.MaxEdge.Z) ||
(pointA.X < box.MinEdge.X && pointB.X < box.MinEdge.X && pointC.X < box.MinEdge.X) ||
(pointA.Y < box.MinEdge.Y && pointB.Y < box.MinEdge.Y && pointC.Y < box.MinEdge.Y) ||
(pointA.Z < box.MinEdge.Z && pointB.Z < box.MinEdge.Z && pointC.Z < box.MinEdge.Z));
}
//! Get the closest point on a triangle to a point on the same plane.
/** \param p Point which must be on the same plane as the triangle.
\return The closest point of the triangle */
core::vector3d<T> closestPointOnTriangle(const core::vector3d<T>& p) const
{
const core::vector3d<T> rab = line3d<T>(pointA, pointB).getClosestPoint(p);
const core::vector3d<T> rbc = line3d<T>(pointB, pointC).getClosestPoint(p);
const core::vector3d<T> rca = line3d<T>(pointC, pointA).getClosestPoint(p);
const T d1 = rab.getDistanceFrom(p);
const T d2 = rbc.getDistanceFrom(p);
const T d3 = rca.getDistanceFrom(p);
if (d1 < d2)
return d1 < d3 ? rab : rca;
return d2 < d3 ? rbc : rca;
}
//! Check if a point is inside the triangle (border-points count also as inside)
/*
\param p Point to test. Assumes that this point is already
on the plane of the triangle.
\return True if the point is inside the triangle, otherwise false. */
bool isPointInside(const vector3d<T>& p) const
{
static vector3d<f64> af64;
af64.X = (f64)pointA.X;
af64.Y = (f64)pointA.Y;
af64.Z = (f64)pointA.Z;
static vector3d<f64> bf64;
bf64.X = (f64)pointB.X;
bf64.Y = (f64)pointB.Y;
bf64.Z = (f64)pointB.Z;
static vector3d<f64> cf64;
cf64.X = (f64)pointC.X;
cf64.Y = (f64)pointC.Y;
cf64.Z = (f64)pointC.Z;
static vector3d<f64> pf64;
pf64.X = (f64)p.X;
pf64.Y = (f64)p.Y;
pf64.Z = (f64)p.Z;
return (isOnSameSide(pf64, af64, bf64, cf64) &&
isOnSameSide(pf64, bf64, af64, cf64) &&
isOnSameSide(pf64, cf64, af64, bf64));
}
//! Check if a point is inside the triangle (border-points count also as inside)
/** This method uses a barycentric coordinate system.
It is faster than isPointInside but is more susceptible to floating point rounding
errors. This will especially be noticable when the FPU is in single precision mode
(which is for example set on default by Direct3D).
\param p Point to test. Assumes that this point is already
on the plane of the triangle.
\return True if point is inside the triangle, otherwise false. */
bool isPointInsideFast(const vector3d<T>& p) const
{
const vector3d<T> a = pointC - pointA;
const vector3d<T> b = pointB - pointA;
const vector3d<T> c = p - pointA;
const f64 dotAA = a.dotProduct( a);
const f64 dotAB = a.dotProduct( b);
const f64 dotAC = a.dotProduct( c);
const f64 dotBB = b.dotProduct( b);
const f64 dotBC = b.dotProduct( c);
// get coordinates in barycentric coordinate system
const f64 invDenom = 1/(dotAA * dotBB - dotAB * dotAB);
const f64 u = (dotBB * dotAC - dotAB * dotBC) * invDenom;
const f64 v = (dotAA * dotBC - dotAB * dotAC ) * invDenom;
// We count border-points as inside to keep downward compatibility.
// Rounding-error also needed for some test-cases.
return (u > -ROUNDING_ERROR_f32) && (v >= 0) && (u + v < 1+ROUNDING_ERROR_f32);
}
//! Get an intersection with a 3d line.
/** \param line Line to intersect with.
\param outIntersection Place to store the intersection point, if there is one.
\return True if there was an intersection, false if not. */
bool getIntersectionWithLimitedLine(const line3d<T>& line,
vector3d<T>& outIntersection) const
{
return getIntersectionWithLine(line.start,
line.getVector(), outIntersection) &&
outIntersection.isBetweenPoints(line.start, line.end);
}
//! Get an intersection with a 3d line.
/** Please note that also points are returned as intersection which
are on the line, but not between the start and end point of the line.
If you want the returned point be between start and end
use getIntersectionWithLimitedLine().
\param linePoint Point of the line to intersect with.
\param lineVect Vector of the line to intersect with.
\param outIntersection Place to store the intersection point, if there is one.
\return True if there was an intersection, false if there was not. */
bool getIntersectionWithLine(const vector3d<T>& linePoint,
const vector3d<T>& lineVect, vector3d<T>& outIntersection) const
{
if (getIntersectionOfPlaneWithLine(linePoint, lineVect, outIntersection))
return isPointInside(outIntersection);
return false;
}
//! Calculates the intersection between a 3d line and the plane the triangle is on.
/** \param lineVect Vector of the line to intersect with.
\param linePoint Point of the line to intersect with.
\param outIntersection Place to store the intersection point, if there is one.
\return True if there was an intersection, else false. */
bool getIntersectionOfPlaneWithLine(const vector3d<T>& linePoint,
const vector3d<T>& lineVect, vector3d<T>& outIntersection) const
{
// Work with f64 to get more precise results (makes enough difference to be worth the casts).
static vector3d<f64> linePointf64;
linePointf64.X = linePoint.X;
linePointf64.Y = linePoint.Y;
linePointf64.Z = linePoint.Z;
// Fix error build
// Setting: C++/All Options/Conformance Mode: OFF
static vector3d<f64> lineVectf64;
lineVectf64.X = lineVect.X;
lineVectf64.Y = lineVect.Y;
lineVectf64.Z = lineVect.Z;
static vector3d<f64> outIntersectionf64;
static core::triangle3d<irr::f64> trianglef64;
trianglef64.pointA.X = (f64)pointA.X;
trianglef64.pointA.Y = (f64)pointA.Y;
trianglef64.pointA.Z = (f64)pointA.Z;
trianglef64.pointB.X = (f64)pointB.X;
trianglef64.pointB.Y = (f64)pointB.Y;
trianglef64.pointB.Z = (f64)pointB.Z;
trianglef64.pointC.X = (f64)pointC.X;
trianglef64.pointC.Y = (f64)pointC.Y;
trianglef64.pointC.Z = (f64)pointC.Z;
const vector3d<irr::f64> normalf64 = trianglef64.getNormal().normalize();
f64 t2;
if ( core::iszero ( t2 = normalf64.dotProduct(lineVectf64) ) )
return false;
f64 d = trianglef64.pointA.dotProduct(normalf64);
f64 t = -(normalf64.dotProduct(linePointf64) - d) / t2;
outIntersectionf64.X = linePointf64.X + (lineVectf64.X * t);
outIntersectionf64.Y = linePointf64.Y + (lineVectf64.Y * t);
outIntersectionf64.Z = linePointf64.Z + (lineVectf64.Z * t);
outIntersection.X = (T)outIntersectionf64.X;
outIntersection.Y = (T)outIntersectionf64.Y;
outIntersection.Z = (T)outIntersectionf64.Z;
return true;
}
//! Get the normal of the triangle.
/** Please note: The normal is not always normalized. */
vector3d<T> getNormal() const
{
return (pointB - pointA).crossProduct(pointC - pointA);
}
//! Test if the triangle would be front or backfacing from any point.
/** Thus, this method assumes a camera position from which the
triangle is definitely visible when looking at the given direction.
Do not use this method with points as it will give wrong results!
\param lookDirection Look direction.
\return True if the plane is front facing and false if it is backfacing. */
bool isFrontFacing(const vector3d<T>& lookDirection) const
{
const vector3d<T> n = getNormal().normalize();
const f32 d = (f32)n.dotProduct(lookDirection);
return F32_LOWER_EQUAL_0(d);
}
//! Get the plane of this triangle.
plane3d<T> getPlane() const
{
return plane3d<T>(pointA, pointB, pointC);
}
//! Get the area of the triangle
T getArea() const
{
return (pointB - pointA).crossProduct(pointC - pointA).getLength() * 0.5f;
}
//! sets the triangle's points
void set(const core::vector3d<T>& a, const core::vector3d<T>& b, const core::vector3d<T>& c)
{
pointA = a;
pointB = b;
pointC = c;
}
//! the three points of the triangle
vector3d<T> pointA;
vector3d<T> pointB;
vector3d<T> pointC;
private:
// Using f64 instead of <T> to avoid integer overflows when T=int (maybe also less floating point troubles).
bool isOnSameSide(const vector3d<f64>& p1, const vector3d<f64>& p2,
const vector3d<f64>& a, const vector3d<f64>& b) const
{
static vector3d<f64> bminusa;
bminusa.X = b.X - a.X;
bminusa.Y = b.Y - a.Y;
bminusa.Z = b.Z - a.Z;
static vector3d<f64> p1minusa;
p1minusa.X = p1.X - a.X;
p1minusa.Y = p1.Y - a.Y;
p1minusa.Z = p1.Z - a.Z;
static vector3d<f64> p2minusa;
p2minusa.X = p2.X - a.X;
p2minusa.Y = p2.Y - a.Y;
p2minusa.Z = p2.Z - a.Z;
static vector3d<f64> cp1;
INLINE_CROSSPRODUCT(cp1, bminusa, p1minusa);
static vector3d<f64> cp2;
INLINE_CROSSPRODUCT(cp2, bminusa, p2minusa);
f64 res = cp1.dotProduct(cp2);
if ( res < 0 )
{
// This catches some floating point troubles.
// Unfortunately slightly expensive and we don't really know the best epsilon for iszero.
bminusa.normalize();
p1minusa.normalize();
INLINE_CROSSPRODUCT(cp1, bminusa, p1minusa);
if ( core::iszero(cp1.X, (f64)ROUNDING_ERROR_f32)
&& core::iszero(cp1.Y, (f64)ROUNDING_ERROR_f32)
&& core::iszero(cp1.Z, (f64)ROUNDING_ERROR_f32) )
{
res = 0.f;
}
}
return (res >= 0.0f);
}
};
//! Typedef for a f32 3d triangle.
typedef triangle3d<f32> triangle3df;
//! Typedef for an integer 3d triangle.
typedef triangle3d<s32> triangle3di;
} // end namespace core
} // end namespace irr
#endif
| [
"hongduc.pr@gmail.com"
] | hongduc.pr@gmail.com |
e6760efc4a9164a122762879c35db694ab6c4aca | 61e4fa969cd7c5cfb2ae7cd3df076b94db4c611f | /Client/SkinFramework/ApiHook/XTPSkinManagerApiHookBase.h | 318d477e773edf8271286bf536d37282405f95b1 | [] | no_license | wonderkun/star_Rat_3.1 | 95135dd0bf6c3c9b1767367faa4092b75bf2555f | 3037ebcff27832914b396bc1459913fd3640f4b1 | refs/heads/master | 2023-04-20T08:31:56.841790 | 2021-05-08T10:14:09 | 2021-05-08T10:14:09 | 338,203,129 | 2 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 3,276 | h | // XTPSkinManagerApiHookBase.h: interface for the CXTPSkinManagerApiHookBase class.
//
// (c)1998-2020 Codejock Software, All Rights Reserved.
//
// THIS SOURCE FILE IS THE PROPERTY OF CODEJOCK SOFTWARE AND IS NOT TO BE
// RE-DISTRIBUTED BY ANY MEANS WHATSOEVER WITHOUT THE EXPRESSED WRITTEN
// CONSENT OF CODEJOCK SOFTWARE.
//
// THIS SOURCE CODE CAN ONLY BE USED UNDER THE TERMS AND CONDITIONS OUTLINED
// IN THE XTREME TOOLKIT PRO LICENSE AGREEMENT. CODEJOCK SOFTWARE GRANTS TO
// YOU (ONE SOFTWARE DEVELOPER) THE LIMITED RIGHT TO USE THIS SOFTWARE ON A
// SINGLE COMPUTER.
//
// CONTACT INFORMATION:
// support@codejock.com
// http://www.codejock.com
//
/////////////////////////////////////////////////////////////////////////////
//{{AFX_CODEJOCK_PRIVATE
#if !defined(__XTPSKINMANAGERAPIHOOKBASE_H__)
# define __XTPSKINMANAGERAPIHOOKBASE_H__
//}}AFX_CODEJOCK_PRIVATE
# if _MSC_VER > 1000
# pragma once
# endif // _MSC_VER > 1000
# include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h"
class CXTPWinThemeWrapper;
//{{AFX_CODEJOCK_PRIVATE
# define XTP_LDR_IS_DATAFILE(handle) (((ULONG_PTR)(handle)) & (ULONG_PTR)1)
# define XTP_LDR_IS_IMAGEMAPPING(handle) (((ULONG_PTR)(handle)) & (ULONG_PTR)2)
# define XTP_LDR_IS_RESOURCE(handle) \
(XTP_LDR_IS_IMAGEMAPPING(handle) || XTP_LDR_IS_DATAFILE(handle))
/////////////////////////////////////////////////////////////////////////////
// CXTPSkinManagerApiHookBase
class _XTP_EXT_CLASS CXTPSkinManagerApiHookBase
: public CObject
, public CXTPSynchronized
{
DECLARE_DYNAMIC(CXTPSkinManagerApiHookBase);
public:
virtual ~CXTPSkinManagerApiHookBase();
virtual void InitializeHookManagement() = 0;
virtual void FinalizeHookManagement() = 0;
virtual void ExcludeModule(LPCTSTR lpszModule, BOOL bWin9x) = 0;
virtual LPVOID GetOriginalFunctionAddress(int nFunction) const = 0;
virtual BOOL AdjustWindowRectExOrig(LPRECT lpRect, DWORD dwStyle, BOOL bMenu,
DWORD dwExStyle) = 0;
virtual LRESULT CallWindowProcOrig(WNDPROC lpPrevWndFunc, HWND hWnd, UINT Msg, WPARAM wParam,
LPARAM lParam) = 0;
virtual LPVOID GetOpenThemeDataOriginalPtr() const = 0;
virtual LPVOID GetCloseThemeDataOriginalPtr() const = 0;
virtual void ConnectWrapper(CXTPWinThemeWrapper* pThemeWrapper) = 0;
static BOOL AFX_CDECL IsSystemWindowModule(WNDPROC lpWndProc);
BOOL IsLegacyImplementation() const;
static PVOID GetAfxWndProc();
protected:
explicit CXTPSkinManagerApiHookBase(BOOL bLegacy);
static BOOL AFX_CDECL IsHookedByAppHelpDll(LPVOID lpProc);
BOOL CallHookDefWindowProc(HWND hWnd, LPVOID pfnOrig, XTPSkinDefaultProc defProc, LPVOID lpPrev,
UINT nMessage, WPARAM& wParam, LPARAM& lParam, LRESULT& lResult);
private:
BOOL m_bLegacy;
static PVOID sm_pfnAfxWndProc;
};
AFX_INLINE BOOL CXTPSkinManagerApiHookBase::IsLegacyImplementation() const
{
return m_bLegacy;
}
AFX_INLINE PVOID CXTPSkinManagerApiHookBase::GetAfxWndProc()
{
return sm_pfnAfxWndProc;
}
//}}AFX_CODEJOCK_PRIVATE
# include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h"
#endif // !defined(__XTPSKINMANAGERAPIHOOKBASE_H__)
| [
"yicheng.wxm@alibaba-inc.com"
] | yicheng.wxm@alibaba-inc.com |
d57fe87b42731815f4d21b1d6e2e71be18132679 | 2d361696ad060b82065ee116685aa4bb93d0b701 | /src/app/blast/blast_report.cpp | 5457e44b4f29daac72c7577797b213e1af11efd6 | [
"LicenseRef-scancode-public-domain"
] | permissive | AaronNGray/GenomeWorkbench | 5151714257ce73bdfb57aec47ea3c02f941602e0 | 7156b83ec589e0de8f7b0a85699d2a657f3e1c47 | refs/heads/master | 2022-11-16T12:45:40.377330 | 2020-07-10T00:54:19 | 2020-07-10T00:54:19 | 278,501,064 | 1 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 15,191 | cpp | /* $Id: blast_report.cpp 575478 2018-11-29 16:05:31Z zaretska $
* ===========================================================================
*
* PUBLIC DOMAIN NOTICE
* National Center for Biotechnology Information
*
* This software/database is a "United States Government Work" under the
* terms of the United States Copyright Act. It was written as part of
* the author's official duties as a United States Government employee and
* thus cannot be copyrighted. This software/database is freely available
* to the public for use. The National Library of Medicine and the U.S.
* Government have not placed any restriction on its use or reproduction.
*
* Although all reasonable efforts have been taken to ensure the accuracy
* and reliability of the software and data, the NLM and the U.S.
* Government do not and cannot warrant the performance or results that
* may be obtained by using this software or data. The NLM and the U.S.
* Government disclaim all warranties, express or implied, including
* warranties of performance, merchantability or fitness for any particular
* purpose.
*
* Please cite the author in any work or product based on this material.
*
* ===========================================================================
*
* Author: Irena Zaretskaya
*
*/
/** @file blast_report.cpp
* Stand-alone command line HTML report for BLAST. Uses tempalates for descriptions and alignments. Outputs metadata as json
*/
#include <ncbi_pch.hpp>
#include <corelib/ncbiapp.hpp>
#include <corelib/ncbistre.hpp>
#include <serial/iterator.hpp>
#include <algo/blast/api/version.hpp>
#include <algo/blast/api/remote_blast.hpp>
#include <algo/blast/blastinput/blast_input_aux.hpp>
#include <algo/blast/format/blast_format.hpp>
#include <algo/blast/api/objmgr_query_data.hpp>
#include "blast_app_util.hpp"
#ifndef SKIP_DOXYGEN_PROCESSING
USING_NCBI_SCOPE;
USING_SCOPE(blast);
#endif
#define EXIT_CODE__FORMAT_SUCCESS 0
#define EXIT_CODE__NO_RESULTS_FOUND 1
#define EXIT_CODE__INVALID_INPUT_FORMAT 2
#define EXIT_CODE__BLAST_ARCHIVE_ERROR 3
#define EXIT_CODE__CANNOT_ACCESS_FILE 4
#define EXIT_CODE__QUERY_INDEX_INVALID 5
#define EXIT_CODE__NETWORK_CONNECTION_ERROR 5
class CBlastReportApp : public CNcbiApplication
{
public:
/** @inheritDoc */
CBlastReportApp() {
CRef<CVersion> version(new CVersion());
version->SetVersionInfo(new CBlastVersion());
SetFullVersion(version);
m_LoadFromArchive = false;
}
private:
/** @inheritDoc */
virtual void Init();
/** @inheritDoc */
virtual int Run();
/// Prints the BLAST formatted output
int PrintFormattedOutput(void);
/// Extracts the queries to be formatted
/// @param query_is_protein Are the queries protein sequences? [in]
CRef<CBlastQueryVector> x_ExtractQueries(bool query_is_protein);
/// Build the query from a PSSM
/// @param pssm PSSM to inspect [in]
CRef<CBlastSearchQuery>
x_BuildQueryFromPssm(const CPssmWithParameters& pssm);
/// Package a scope and Seq-loc into a SSeqLoc from a Bioseq
/// @param bioseq Bioseq to inspect [in]
/// @param scope Scope object to add the sequence data to [in|out]
SSeqLoc x_QueryBioseqToSSeqLoc(const CBioseq& bioseq, CRef<CScope> scope);
/// Our link to the NCBI BLAST service
CRef<CRemoteBlast> m_RmtBlast;
/// The source of CScope objects for queries
CRef<CBlastScopeSource> m_QueryScopeSource;
/// Tracks whether results come from an archive file.
bool m_LoadFromArchive;
};
void CBlastReportApp::Init()
{
HideStdArgs(fHideLogfile | fHideConffile | fHideFullVersion | fHideXmlHelp | fHideDryRun);
auto_ptr<CArgDescriptions> arg_desc(new CArgDescriptions);
arg_desc->SetUsageContext(GetArguments().GetProgramBasename(),
"Stand-alone BLAST formatter client, version "
+ CBlastVersion().Print());
arg_desc->SetCurrentGroup("Input options");
// add input file for seq-align here?
arg_desc->AddKey(kArgArchive, "ArchiveFile", "File containing BLAST Archive format in ASN.1 (i.e.: output format 11)",
CArgDescriptions::eInputFile);
arg_desc->AddDefaultKey(kArgAlignSeqList, "alignseqlist", "List of comma separated seqids to display", CArgDescriptions::eString, "");
arg_desc->AddDefaultKey(kArgMetadata, "searchmetadata", "Search Metadata indicator", CArgDescriptions::eBoolean,"f");
arg_desc->AddDefaultKey(kArgQueryIndex, "queryindex", "Query Index", CArgDescriptions::eInteger, "0");
CFormattingArgs fmt_args;
fmt_args.SetArgumentDescriptions(*arg_desc);
arg_desc->SetCurrentGroup("Output configuration options");
arg_desc->AddDefaultKey(kArgOutput, "output_file", "Output file name",
CArgDescriptions::eOutputFile, "-");
arg_desc->SetCurrentGroup("Miscellaneous options");
arg_desc->AddFlag(kArgParseDeflines,
"Should the query and subject defline(s) be parsed?", true);
arg_desc->SetCurrentGroup("");
CDebugArgs debug_args;
debug_args.SetArgumentDescriptions(*arg_desc);
SetupArgDescriptions(arg_desc.release());
}
SSeqLoc
CBlastReportApp::x_QueryBioseqToSSeqLoc(const CBioseq& bioseq,
CRef<CScope> scope)
{
static bool first_time = true;
_ASSERT(scope);
if ( !HasRawSequenceData(bioseq) && first_time ) {
_ASSERT(m_QueryScopeSource);
m_QueryScopeSource->AddDataLoaders(scope);
first_time = false;
}
else {
scope->AddBioseq(bioseq);
}
CRef<CSeq_loc> seqloc(new CSeq_loc);
seqloc->SetWhole().Assign(*bioseq.GetFirstId());
return SSeqLoc(seqloc, scope);
}
CRef<CBlastSearchQuery>
CBlastReportApp::x_BuildQueryFromPssm(const CPssmWithParameters& pssm)
{
if ( !pssm.HasQuery() ) {
throw runtime_error("PSSM has no query");
}
CRef<CScope> scope(new CScope(*CObjectManager::GetInstance()));
const CSeq_entry& seq_entry = pssm.GetQuery();
if ( !seq_entry.IsSeq() ) {
throw runtime_error("Cannot have multiple queries in a PSSM");
}
SSeqLoc ssl = x_QueryBioseqToSSeqLoc(seq_entry.GetSeq(), scope);
CRef<CBlastSearchQuery> retval;
retval.Reset(new CBlastSearchQuery(*ssl.seqloc, *ssl.scope));
_ASSERT(ssl.scope.GetPointer() == scope.GetPointer());
return retval;
}
CRef<CBlastQueryVector>
CBlastReportApp::x_ExtractQueries(bool query_is_protein)
{
CRef<CBlast4_queries> b4_queries = m_RmtBlast->GetQueries();
_ASSERT(b4_queries);
const size_t kNumQueries = b4_queries->GetNumQueries();
CRef<CBlastQueryVector> retval(new CBlastQueryVector);
SDataLoaderConfig dlconfig(query_is_protein, SDataLoaderConfig::eUseNoDataLoaders);
dlconfig.OptimizeForWholeLargeSequenceRetrieval(false);
m_QueryScopeSource.Reset(new CBlastScopeSource(dlconfig));
if (b4_queries->IsPssm()) {
retval->AddQuery(x_BuildQueryFromPssm(b4_queries->GetPssm()));
} else if (b4_queries->IsSeq_loc_list()) {
CRef<CScope> scope = m_QueryScopeSource->NewScope();
ITERATE(CBlast4_queries::TSeq_loc_list, seqloc,
b4_queries->GetSeq_loc_list()) {
_ASSERT( !(*seqloc)->GetId()->IsLocal() );
CRef<CBlastSearchQuery> query(new CBlastSearchQuery(**seqloc,
*scope));
retval->AddQuery(query);
}
} else if (b4_queries->IsBioseq_set()) {
CTypeConstIterator<CBioseq> itr(ConstBegin(b4_queries->GetBioseq_set(),
eDetectLoops));
CRef<CScope> scope(new CScope(*CObjectManager::GetInstance()));
for (; itr; ++itr) {
SSeqLoc ssl = x_QueryBioseqToSSeqLoc(*itr, scope);
CRef<CBlastSearchQuery> query(new CBlastSearchQuery(*ssl.seqloc,
*ssl.scope));
retval->AddQuery(query);
}
}
(void)kNumQueries; // eliminate compiler warning;
_ASSERT(kNumQueries == retval->size());
return retval;
}
static int s_GetError(string errorName, string defaultMessage, int defaultErrCode, string &errorMsg,string blastArchName = "")
{
CNcbiApplication* app = CNcbiApplication::Instance();
string message = defaultMessage;
int status = 0;
if (app) {
const CNcbiRegistry& registry = app->GetConfig();
string errorCode;
string errorInfo = registry.Get("Errors", errorName);
if(!errorInfo.empty()) {
NStr::SplitInTwo(errorInfo, ":", errorCode, message);
status = NStr::StringToInt(errorCode,NStr::fConvErr_NoThrow);
message = NStr::Replace(message,"#filename",blastArchName);
}
}
if(!status || message.empty()) {
errorMsg = defaultMessage;
status = defaultErrCode;
}
else {
errorMsg = message;
}
return status;
}
int CBlastReportApp::PrintFormattedOutput(void)
{
int retval = EXIT_CODE__FORMAT_SUCCESS;
const CArgs& args = GetArgs();
CNcbiOstream& out = args[kArgOutput].AsOutputFile();
CFormattingArgs fmt_args;
string alignSeqList = args[kArgAlignSeqList].HasValue() ? args[kArgAlignSeqList].AsString() : kEmptyStr;
bool searchMetadata = args[kArgMetadata].HasValue() ? args[kArgMetadata].AsBoolean() : false;
unsigned int queryIndex = args[kArgQueryIndex].HasValue() ? args[kArgQueryIndex].AsInteger() : 0;
CRef<CBlastOptionsHandle> opts_handle = m_RmtBlast->GetSearchOptions();
CBlastOptions& opts = opts_handle->SetOptions();
fmt_args.ExtractAlgorithmOptions(args, opts);
{{
CDebugArgs debug_args;
debug_args.ExtractAlgorithmOptions(args, opts);
if (debug_args.ProduceDebugOutput()) {
opts.DebugDumpText(NcbiCerr, "BLAST options", 1);
}
}}
const EBlastProgramType p = opts.GetProgramType();
CRef<CBlastQueryVector> queries = x_ExtractQueries(Blast_QueryIsProtein(p)?true:false);
CRef<CScope> scope = queries->GetScope(0);
_ASSERT(queries);
CRef<CBlastDatabaseArgs> db_args(new CBlastDatabaseArgs()); // FIXME, what about rpsblast?
int filtering_algorithm = -1;
if (m_RmtBlast->IsDbSearch())
{
CRef<CBlast4_database> db = m_RmtBlast->GetDatabases();
_ASSERT(db);
_TRACE("Fetching results for " + Blast_ProgramNameFromType(p) + " on "
+ db->GetName());
filtering_algorithm = m_RmtBlast->GetDbFilteringAlgorithmId();
CRef<CSearchDatabase> search_db(new CSearchDatabase(db->GetName(), db->IsProtein()
? CSearchDatabase::eBlastDbIsProtein
: CSearchDatabase::eBlastDbIsNucleotide));
db_args->SetSearchDatabase(search_db);
}
CRef<CLocalDbAdapter> db_adapter;
InitializeSubject(db_args, opts_handle, true, db_adapter, scope);
CBlastFormat formatter(opts, *db_adapter,
fmt_args.GetFormattedOutputChoice(),
static_cast<bool>(args[kArgParseDeflines]),
out,
fmt_args.GetNumDescriptions(),
fmt_args.GetNumAlignments(),
*scope,
opts.GetMatrixName(),
fmt_args.ShowGis(),
fmt_args.DisplayHtmlOutput(),
opts.GetQueryGeneticCode(),
opts.GetDbGeneticCode(),
opts.GetSumStatisticsMode(),
false,
filtering_algorithm);
formatter.SetLineLength(fmt_args.GetLineLength());
formatter.SetAlignSeqList(alignSeqList);
CRef<CSearchResultSet> results = m_RmtBlast->GetResultSet();
try {
if(queryIndex > results->GetNumQueries() - 1) {
string msg;
retval = s_GetError("InvalidQueryIndex", "Invalid query index.", EXIT_CODE__QUERY_INDEX_INVALID, msg);
NCBI_THROW(CInputException, eInvalidInput,msg);
}
bool hasAlignments = (*results)[queryIndex].HasAlignments();
//BlastFormatter_PreFetchSequenceData(*results, scope, fmt_args.GetFormattedOutputChoice());//*****Do we need to do this here???
CBlastFormat::DisplayOption displayOption;
if(searchMetadata) {
displayOption = CBlastFormat::eMetadata;
}
else if(!alignSeqList.empty()){
displayOption = CBlastFormat::eAlignments;
}
else {
displayOption = CBlastFormat::eDescriptions;
}
if(hasAlignments || displayOption == CBlastFormat::eMetadata) {
formatter.PrintReport((*results)[queryIndex], displayOption);
}
if(!hasAlignments) {
retval = EXIT_CODE__NO_RESULTS_FOUND;
}
}catch (const CException & e) {
cerr << e.GetMsg() << endl;
}
return retval;
}
int CBlastReportApp::Run(void)
{
int status = EXIT_CODE__FORMAT_SUCCESS;
const CArgs& args = GetArgs();
string msg;
try {
SetDiagPostLevel(eDiag_Warning);
if (args[kArgArchive].HasValue()) {
CNcbiIstream& istr = args[kArgArchive].AsInputFile();
m_RmtBlast.Reset(new CRemoteBlast(istr));
if (m_RmtBlast->LoadFromArchive()) {
if(!m_RmtBlast->IsErrMsgArchive()) {
status = PrintFormattedOutput();
return status;
}
else {
status = s_GetError("NetConError", "Network connection error", EXIT_CODE__NETWORK_CONNECTION_ERROR, msg);
}
}
}
}
catch (const CSerialException&) {
status = s_GetError("InvailInputFormat", "Invalid input format for BLAST Archive.", EXIT_CODE__INVALID_INPUT_FORMAT, msg);
}
catch (const CException& e) {
if (e.GetErrCode() == CBlastException::eInvalidArgument) {
status = s_GetError("ErrorBlastArchive", "Error processing BLAST Archive.", EXIT_CODE__BLAST_ARCHIVE_ERROR, msg);
}
else {
status = s_GetError("ErrorAccessingFile", e.GetMsg(), EXIT_CODE__CANNOT_ACCESS_FILE, msg,args[kArgArchive].AsString());
}
}
//cerr << "****retval:" << status << endl;
cerr << msg << endl;
return status;
}
#ifndef SKIP_DOXYGEN_PROCESSING
int main(int argc, const char* argv[] /*, const char* envp[]*/)
{
return CBlastReportApp().AppMain(argc, argv);
}
#endif /* SKIP_DOXYGEN_PROCESSING */
| [
"aaronngray@gmail.com"
] | aaronngray@gmail.com |
2451eb4e5c1a4a85e141c8c6ab84b936fd4f3efc | df39e29fbe243318d268aef27facf4725b9d7b7d | /taswira/BitmapImage.h | d5b417d5985946b261b472a834cb57a028c3eb1f | [] | no_license | NyaliaLui/TaswiraCreator | c9552bb52221cbcb9e746730640865879cdc6ba3 | ec0446c8cfb47168e73d32cc093ff018cf650d62 | refs/heads/main | 2023-03-07T10:03:40.533217 | 2021-02-05T01:09:54 | 2021-02-05T01:09:54 | 331,774,385 | 1 | 0 | null | 2021-02-05T01:09:56 | 2021-01-21T22:42:02 | C++ | UTF-8 | C++ | false | false | 6,800 | h | #ifndef BITMAPIMAGE_H
#define BITMAPIMAGE_H
#include "BitmapFileHeader.h"
#include "BitmapInfoHeader.h"
#include "Pixel.h"
#include <fstream>
#include <stdexcept>
#include <string>
#include <iostream>
namespace taswira {
class BitmapImage {
public:
BitmapImage(int fileHeaderSize, int infoHeaderSize,
int height, int width, int bytesPerPixel, int pallets)
:FileHeaderSize(fileHeaderSize),
InfoHeaderSize(infoHeaderSize),
FileSize(fileHeaderSize + infoHeaderSize + (width * height * bytesPerPixel)),
PixelPadding(25),
Height(height),
Width(width),
BytesPerPixel(bytesPerPixel),
Pallets(pallets),
LeftMargin(PixelPadding),
RightMargin(width - PixelPadding),
BottomMargin(PixelPadding),
TopMargin(height - PixelPadding),
FileHeader(FileSize, fileHeaderSize, infoHeaderSize),
InfoHeader(width, height, infoHeaderSize, bytesPerPixel, pallets),
PixelData(new Pixel* [height])
{
for (int i = 0; i < height; ++i) {
PixelData[i] = new Pixel[width];
}
}
BitmapImage(const BitmapImage& image)
:FileHeaderSize(image.FileHeaderSize),
InfoHeaderSize(image.InfoHeaderSize),
FileSize(image.FileSize),
PixelPadding(image.PixelPadding),
Height(image.Height),
Width(image.Width),
BytesPerPixel(image.BytesPerPixel),
Pallets(image.Pallets),
LeftMargin(image.LeftMargin),
RightMargin(image.RightMargin),
BottomMargin(image.BottomMargin),
TopMargin(image.TopMargin),
FileHeader(image.FileHeader),
InfoHeader(image.InfoHeader),
PixelData(new Pixel* [Height])
{
for (int i = 0; i < Height; ++i) {
PixelData[i] = new Pixel[Width];
}
for (int i = 0; i < Height; ++i) {
for (int j = 0; j < Width; ++j) {
PixelData[i][j] = image.PixelData[i][j];
}
}
}
BitmapImage& operator = (const BitmapImage& image) {
this->FileHeaderSize = image.FileHeaderSize;
this->InfoHeaderSize = image.InfoHeaderSize;
this->FileSize = image.FileSize;
this->PixelPadding = image.PixelPadding;
this->Height = image.Height;
this->Width = image.Width;
this->BytesPerPixel = image.BytesPerPixel;
this->Pallets = image.Pallets;
this->LeftMargin = image.LeftMargin;
this->RightMargin = image.RightMargin;
this->BottomMargin = image.BottomMargin;
this->TopMargin = image.TopMargin;
this->FileHeader = image.FileHeader;
this->InfoHeader = image.InfoHeader;
this->PixelData = new Pixel * [Height];
for (int i = 0; i < Height; ++i) {
PixelData[i] = new Pixel[Width];
}
for (int i = 0; i < Height; ++i) {
for (int j = 0; j < Width; ++j) {
PixelData[i][j] = image.PixelData[i][j];
}
}
return (*this);
}
~BitmapImage(void) {
if (!PixelData || PixelData != NULL || PixelData != nullptr) {
for (int i = 0; i < Height; ++i) {
delete[] PixelData[i];
PixelData[i] = nullptr;
}
delete[] PixelData;
PixelData = nullptr;
}
}
//---- Setters
Pixel& PixelAt(int i, int j) {
if (!PixelData) {
throw std::logic_error("taswira::BitmapImage::PixelAt -- PixelData is not defined!");
}
return PixelData[i][j];
}
void WriteToDisk(std::string filename) {
std::ofstream fout;
fout.open(filename.c_str(), std::ios::binary);
fout.write((char*)&FileHeader, FileHeaderSize);
fout.write((char*)&InfoHeader, InfoHeaderSize);
// writing pixel data
for (int i = 0; i < Height; ++i) {
for (int j = 0; j < Width; ++j) {
fout.write((char*)&PixelData[i][j], BytesPerPixel);
}
}
fout.close();
}
//---- Getters
int& ImageFileHeaderSize(void) {
return this->FileHeaderSize;
}
int& ImageInfoHeaderSize(void) {
return this->InfoHeaderSize;
}
int& ImageFileSize(void) {
return this->FileSize;
}
int& ImagePixelPadding(void) {
return this->PixelPadding;
}
int& ImageWidth(void) {
return this->Width;
}
int& ImageHeight(void) {
return this->Height;
}
int& ImageBytesPerPixel(void) {
return this->BytesPerPixel;
}
int& ImagePallets(void) {
return this->Pallets;
}
int& ImageLeftMargin(void) {
return this->LeftMargin;
}
int& ImageRightMargin(void) {
return this->RightMargin;
}
int& ImageBottomMargin(void) {
return this->BottomMargin;
}
int& ImageTopMargin(void) {
return this->TopMargin;
}
taswira::BitmapFileHeader& ImageFileHeader(void) {
return this->FileHeader;
}
taswira::BitmapInfoHeader& ImageInfoHeader(void) {
return this->InfoHeader;
}
taswira::Pixel** ImagePixelData(void) {
return this->PixelData;
}
private:
int FileHeaderSize;
int InfoHeaderSize;
int FileSize;
int PixelPadding;
int Height;
int Width;
int BytesPerPixel;
int Pallets;
int LeftMargin;
int RightMargin;
int BottomMargin;
int TopMargin;
taswira::BitmapFileHeader FileHeader;
taswira::BitmapInfoHeader InfoHeader;
taswira::Pixel** PixelData;
BitmapImage(void)
:FileHeaderSize(0),
InfoHeaderSize(0),
FileSize(0),
PixelPadding(25),
Height(0),
Width(0),
BytesPerPixel(0),
Pallets(0),
LeftMargin(0),
RightMargin(0),
BottomMargin(0),
TopMargin(0),
FileHeader(FileSize, 0, 0),
InfoHeader(0, 0, 0, 0, 0),
PixelData(nullptr)
{ }
};
}
#endif // !BITMAPIMAGE_H | [
"luinyalia@gmail.com"
] | luinyalia@gmail.com |
afdf11504d3132240dd6501efaefd53a8af64bdc | e71551968ccc826f536c13ce5ef68e7f6d3c2b83 | /src/IHM/DbTableWidget.h | 60ff3927cd413b644c63302ad8ac27a5499b9619 | [] | no_license | FCHcap/Cubator | 2c77cc3ec4db06c2f26d81acd2ef2cc4e06a75c6 | cfac8d3e8b86c9c5a43e7f5dd1ac01b0cb4edca6 | refs/heads/master | 2020-04-11T07:19:36.865124 | 2018-06-14T09:31:39 | 2018-06-14T09:31:39 | 30,690,083 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 420 | h | #ifndef DBTABLEWIDGET_H
#define DBTABLEWIDGET_H
// QT
#include <QTableWidget>
#include <QtGui>
// CUBATOR
#include <Messages.h>
class DbTableWidget : public QTableWidget
{
Q_OBJECT
public:
explicit DbTableWidget(QWidget *parent = 0);
void allowChanges(bool allow);
protected:
void contextMenuEvent(QContextMenuEvent *event);
protected:
bool _allowChanges;
};
#endif // DBTABLEWIDGET_H
| [
"olive.emmanuel@gmail.com"
] | olive.emmanuel@gmail.com |
556132af4b5403df28c3e2f0e87bb75b0f82e052 | 863865383db63dfd3f775d96f9d0082bf5f73dac | /major_research/eight/src/host/layers.h | 0a581418e8e18de32b59435e4b1eedc17b3f506d | [] | no_license | tinaba96/master | 478ce9e976369a10a21db8b2b53747a019bda4b1 | a6f9fdb6d14cd8631a15269eaba008a09e71ba80 | refs/heads/master | 2023-08-22T19:16:44.416845 | 2023-08-12T09:00:44 | 2023-08-12T09:00:44 | 664,298,705 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 12,503 | h | #include <math.h>
#include <stdio.h>
class sigmoid{
public:
/*
sigmoid()
{
float* out
}
*/
//void forward(float* in, int insize)
void forward(float* in, float* out)
{
//std::cout << 1/(1+exp(-90)) ;
for(int i = 0; i < 919; ++i) //insize
{
in[i] = in[i];
out[i] = 1/(1+exp(-in[i]));
//std::cout << out[i] << " " << std::endl;
}
//std::cout << "check" << std::endl;
}
void backward(float* dout, float* out)
{
float tmp[919];
for(int o = 0; o < 919; ++o)
{
tmp[o] = dout[o] * (1 - out[o]) * out[o];
}
for(int o = 0; o < 919; ++o)
{
dout[o] = tmp[o];
//std::cout << dout[o];
}
}
};
class relu{
public:
int mask[975*320];
//void forward(float* in, float* out, int insize)
void forward(float* in, float* out)
{
for(int i = 0; i < 320*975; ++i) //insize
{
out[i] = std::max(float(0), in[i]);
if(out[i] == 0)
{
mask[i] = 1;
}
}
for(int i = 0; i < 320*5; ++i)
{
//std::cout << out[i];
//std::cout << mask[i];
}
}
void backward(float* dout)
{
/*
for(int i = 0; i < 975*320; ++i)
{
std::cout << mask[i];
}
*/
for(int o = 0; o < 320*975; ++o)
{
//std::cout << mask[o];
if(mask[o] == 1)
{
dout[o] = 0;
}else{
dout[o] = dout[o];
}
//std::cout << dout[o];
//float dx[o] = dout[o] * ( out[o] > float(0) ? float(1) : float(0));
}
}
};
class relu2{
public:
int mask2[925];
//void forward(float* in, float* out, int insize)
void forward(float* in, float* out)
{
for(int i = 0; i < 925; ++i) //insize
{
out[i] = std::max(float(0), in[i]);
//std::cout << out[i] << std::endl;
if(out[i] == 0)
{
mask2[i] = 1;
}
//std::cout << mask2[i];
}
for(int i = 0; i < 5; ++i)
{
//std::cout << out[i];
//std::cout << mask[i];
}
}
void backward(float* dout)
{
/*
for(int i = 0; i < 975*320; ++i)
{
std::cout << mask[i];
}
*/
for(int o = 0; o < 925; ++o)
{
//std::cout << mask[o];
if(mask2[o] == 1)
{
dout[o] = 0;
}else{
dout[o] = dout[o];
}
//std::cout << dout[o];
//float dx[o] = dout[o] * ( out[o] > float(0) ? float(1) : float(0));
}
}
};
class relu3{
public:
int mask2[919];
//void forward(float* in, float* out, int insize)
void forward(float* in, float* out)
{
for(int i = 0; i < 919; ++i) //insize
{
out[i] = std::max(float(0), in[i]);
//std::cout << out[i] << std::endl;
if(out[i] == 0)
{
mask2[i] = 1;
}
//std::cout << mask2[i];
}
for(int i = 0; i < 5; ++i)
{
//std::cout << out[i];
//std::cout << mask[i];
}
}
void backward(float* dout, float* out)
{
/*
for(int i = 0; i < 975*320; ++i)
{
std::cout << mask[i];
}
*/
for(int o = 0; o < 919; ++o)
{
//std::cout << mask[o];
if(mask2[o] == 1)
{
dout[o] = 0;
}else{
dout[o] = out[o];
}
//std::cout << dout[o];
//float dx[o] = dout[o] * ( out[o] > float(0) ? float(1) : float(0));
}
}
};
class dropout{
public:
/*
dropout(float ratio, bool mask){
float ratio = ratio;
bool mask = mask;
}
*/
float mask[640*75];
void forward(float* in, float* out, int insize, float ratio, bool train_flg = true)
{
float num;
if(train_flg){
for(int i = 0; i < insize; ++i)
{
num = (float)rand()/RAND_MAX;
if(num > ratio){
mask[i] = 1;
//std::cout << num << std::endl;
}else{
mask[i] = 0;
}
out[i] = (0.00000001 + in[i]) * mask[i];
}
}else{
for(int i = 0; i < insize; ++i)
{
out[i] = in[i] * (1.0 - ratio);
}
}
//return out
}//forward
void backward(float* dout, int outsize)
{
for(int o = 0; o < outsize; ++o)
{
dout[o] = (0.0000001 + dout[o]) * mask[o];
}
//return dout
}
};
class fullc{
/*
private:
float* w;
float* b;
fullc(float* w, float*b)
{
float* act[75*320];
}
*/
public:
//float paramsw2[75*640*925];
//float paramsb2[925];
//float gradsw2[75*640*925];
//float gradsb2[925];
float act[75*640];
//void forward(float* in, float* out, int insize, int kernelsize)
//void forward(float in, float out, float kernel, float b)
void forward(float* in, float* out, float* kernel, float* b)
{
for(int i = 0; i < 1000; ++i)
{
//std::cout << in[i];
}
for(int i = 0; i < 75*640; ++i)
{
act[i] = in[i];
}
for(int i = 0; i < 75*320; ++i)
{
//std::cout << act[i];
}
//kernel = 75*320*925
for(int i = 0; i < 925; ++i) //outsize
{
out[i] = 0;
int start = 75*640*i;
for(int j = 0; j < 75*640; ++j) //insize
{
out[i] += (0.00000001 + in[j]) * kernel[start+j];
}
out[i] += b[i];
//std::cout << out[i];
}
/*
for(int i = 0; i < 75*640; ++i) //outsize
{
out[i] = 0;
int start = 75*640*i;
for(int j = 0; j < 925; ++j) //insize
{
out[i] += (0.00000001 + in[j]) * kernel[start+j];
}
out[i] += b[i];
//std::cout << out[i];
}
*/
}
void backward(float* dout, float* paramsw2, float* gradsw2, float* gradsb2)
{
//dout = 75*320
//paramsw2 = 75*320
float tmp[75*640];
for (int j = 0; j < 75*640; ++j)
{
tmp[j] = 0; //initializing was very important. otherwise, so many nan (-nan) was happening.
}
for (int j = 0; j < 925; ++j)
{
//std::cout << act[j];
int begin = j*75*640;
for(int i = 0; i < 75*640; ++i)
{
tmp[i] += (0.0000001 + dout[j]) * paramsw2[begin+i];
gradsw2[begin+i] += act[i] * (0.00000001 + dout[j]);
}
gradsb2[j] += dout[j];
}
for(int i = 0; i < 75*640; ++i)
{
//std::cout << tmp[i];
dout[i] = tmp[i];
}
for(int i = 0; i < 919; ++i)
{
//std::cout << dout[i];
}
}
};
class fullc2{
/*
private:
float* w;
float* b;
fullc(float* w, float*b)
{
float* act[75*320];
}
*/
public:
//float paramsw3[925*919];
//float paramsb3[919];
//float gradsw3[925*919];
//float gradsb3[919];
float act2[925];
//void forward(float* in, float* out, int insize, int kernelsize)
//void forward(float in, float out, float kernel, float b)
void forward(float* in, float* out, float* kernel, float* b)
{
for(int i = 0; i < 925*919; ++i)
{
//std::cout << kernel[i];
}
for(int i = 0; i < 1000; ++i)
{
//std::cout << in[i];
}
for(int i = 0; i < 925; ++i)
{
act2[i] = in[i];
}
for(int i = 0; i < 925; ++i)
{
//std::cout << act2[i];
}
//kernel = 75*320*919
for(int i = 0; i < 919; ++i) //outsize
{
out[i] = 0;
int start = 925*i;
for(int j = 0; j < 925; ++j) //insize
{
//std::cout << kernel[start+j] << std::endl;
out[i] += in[j] * kernel[start+j];
//out[i] += (0.0000000001 + in[j]) * kernel[start+j];
}
//std::cout << out[i] << std::endl;
out[i] += b[i];
}
}
void backward(float* dout, float* paramsw3, float* gradsw3, float* gradsb3)
{
for(int i = 0; i < 925; ++i)
{
//std::cout << act[i];
}
//dout = 925
float tmp[925];
for (int j = 0; j < 925; ++j)
{
tmp[j] = 0; //initializing was very important. otherwise, so many nan (-nan) was happening.
}
for (int j = 0; j < 919; ++j)
{
int begin = j*925;
for(int i = 0; i < 925; ++i)
{
//tmp[i] += (0.000001 + dout[j]) * paramsw3[begin+i];
tmp[i] += dout[j] * paramsw3[begin+i];
//tmp[i] += dout[j] * paramsw3[919*i+j];
//std::cout << paramsw3[begin+i];
//gradsw3[begin+i] += act2[i] * (0.0000001 + dout[j]);
gradsw3[begin+i] += act2[i] * dout[j];
}
gradsb3[j] += dout[j];
}
for(int i = 0; i < 925; ++i)
{
dout[i] = tmp[i];
//std::cout << dout[i];
//std::cout << gradsw2[i];
}
}
};
class conv1d{
public:
float paramsw1[26*4*320];
float paramsb1[975*320];
float gradsw1[26*4*320];
float gradsb1[975*320];
float actc[4000];
//void forward(float* in, float* out, int datasize, float* kernel, int kernelsize)
void forward(float* in, float* out, float* kernel, float* b)
{
for(int i = 0; i < 4000; ++i)
{
actc[i] = in[i];
}
//kernelsize = 26*4*320
//datasize = 4000
for(int i = 0; i < 26*4*320; ++i)
{
//std::cout << kernel[i];
//std::cout << in[i];
}
//std::cout << std::endl;
for(int nk = 0; nk < 320; ++nk)
{
int st = nk*975;
int stk = nk*26*4;
for(int i = 0; i < 975; ++i) // batch-kernelsize
{
out[st+i] = 0;
for(int t =0; t < 4; ++t) // datasize/batch
{
int startk = t*26;
for(int j = i, k = 0; k < 26; j++, k++) //kernelsize
{
out[st+i] += (0.00000001 + in[t+4*(k+i)]) * kernel[stk+startk+k];
//std::cout << out[st+i];
}
}
out[st+i] += b[i];
}
}
for(int i = 0; i < 320*5; ++i)
{
//std::cout << out[i];
}
}
void backward(float* dout, float* paramsw1, float* gradsw1, float* gradsb1)
{
for(int i = 0; i < 320*975; ++i)
{
//std::cout << dout[i];
//std::cout << actc[i];
}
//gradsw1 = 26*4*320
//dout:出力勾配マップ 975*320
/*
for(int j = 0; j < 320; ++j)
{
int begin = j*975;
int beginslide = j*26*4;
for(int slide = 0; slide < 26; ++slide)
{
int sstart = 4*slide;
for(int t = 0; t < 4; ++t)
{
for(int i = 0, c = 0; i < 975; ++i, ++c) //kernelsize
{
int beg = 4*(c+slide)+t;
//std::cout << beg << ":";
gradsw1[beginslide+sstart+t] += actc[beg] * dout[begin+i];
//std::cout << gradsw1[i];
}
}
}
}
*/
for(int j = 0; j < 320; ++j)
{
int begin = j*26*4;
int begind = j*975;
for(int t = 0; t < 4; ++t)
{
int sstart = 26*t;
for(int s = 0; s < 26; ++s)
{
for(int i = 0, c = 0; i < 975; ++i, ++c) //kernelsize
{
gradsw1[begin+sstart+s] += (0.000000001 + actc[4*(c+s)+t]) * dout[begind+i];
}
//std::cout << begin+sstart+s << " ";
}
}
}
for(int j = 0; j < 320; ++j)
{
int start = j*975;
for(int o = 0; o < 975; ++o)
{
gradsb1[start+o] += dout[start+o];
}
}
//padding
float tmpc[50+26*4*320];
for(int i = 0; i < 25; ++i)
{
tmpc[i] = {0};
}
for(int i = 0; i < 26*4*320; ++i)
{
tmpc[25+i] = dout[i];
}
for(int i = 0; i < 25; ++i)
{
tmpc[25+26*4*320+i] = {0};
}
for (int j = 0; j < 1000; ++j) //insize
{
int st = j*4;
//float dout[1025]
//kernelsize = 26*4*320
for(int t = 0; t < 320; ++t)//320
{
int start = t*26*4;
for(int k = 0, i = 0; k < 26; i++, k++) //kernelsize
{
//int startk = 4*k;
//int startkp = 4*(26-k);
for(int c = 0; c < 4; ++c)
{
//dout[st+c] += tmpc[start+startk+c] * paramsw1[start+startkp+c];
}
}
}
}
for(int i = 0; i < 1000; ++i)
{
//std::cout << dout[i];
}
}
};
class mpool{
public:
int max[975*320];
//void forward(float* in, float* out, int kernelsize,) //kernelsize = 13
void forward(float* in, float* out) //kernelsize = 13
{
int cnt = 0;
for(int i = 0; i < 975*320; ++i)
{
max[i] = -1;
}
//975->75
for(int j = 0; j < 320; ++j)
{
int start = 75*13*j;
int starto = 75*j;
for(int i = 0; i < 75; ++i) //sizeof(in)/kernelsize
{
int begin = 13*i;
//out[i] = 0;
int tmp = 0;
int num = 0;
for(int k = 0; k < 13; ++k) // krnelsize
{
if(in[start+begin+k] > tmp)
{
tmp = in[start+begin+k];
num = start+begin+k;
}
}
out[starto+i] = tmp;
max[num] = 1;
}
}
for(int i = 0; i < 975*320; ++i)
{
//std::cout << max[i];
if(max[i] == 1)
{
cnt += 1;
}
}
//std::cout << cnt << std::endl;
}
void backward(float* dout)
{
/*
for(int i = 0; i < 975*320; ++i)
{
std::cout << max[i];
}
*/
for(int i = 0; i < 975*320; ++i)
{
//std::cout << max[i];
if(max[i] != -1)
{
dout[i] = dout[i];
}else{
dout[i] = 0;
}
//std::cout << dout[i];
}
}
};
| [
"tinaba178.96@gmail.com"
] | tinaba178.96@gmail.com |
7166b5ae99edc9dc01a877931577d2943081eaf8 | f7b9c3497570442c72f17761370ee03b4ad3c295 | /src/script/lua_api/l_env.h | 420866d5d223008beb02dd81503d231b68e70b23 | [] | no_license | githubnanyang/MineWorld | 18c5e4c328ad5eafb08ca40046ded584aa6d3c3e | 55ffe1ec71329ff655f51df0baeec78d209f8c39 | refs/heads/master | 2023-03-20T03:24:11.288924 | 2014-10-12T07:23:56 | 2014-10-12T07:23:56 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,631 | h | /*
Minetest
Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef L_ENV_H_
#define L_ENV_H_
#include "lua_api/l_base.h"
#include "environment.h"
class ModApiEnvMod : public ModApiBase {
private:
// set_node(pos, node)
// pos = {x=num, y=num, z=num}
static int l_set_node(lua_State *L);
static int l_add_node(lua_State *L);
// remove_node(pos)
// pos = {x=num, y=num, z=num}
static int l_remove_node(lua_State *L);
// swap_node(pos, node)
// pos = {x=num, y=num, z=num}
static int l_swap_node(lua_State *L);
// get_node(pos)
// pos = {x=num, y=num, z=num}
static int l_get_node(lua_State *L);
// get_node_or_nil(pos)
// pos = {x=num, y=num, z=num}
static int l_get_node_or_nil(lua_State *L);
// get_node_light(pos, timeofday)
// pos = {x=num, y=num, z=num}
// timeofday: nil = current time, 0 = night, 0.5 = day
static int l_get_node_light(lua_State *L);
// place_node(pos, node)
// pos = {x=num, y=num, z=num}
static int l_place_node(lua_State *L);
// dig_node(pos)
// pos = {x=num, y=num, z=num}
static int l_dig_node(lua_State *L);
// punch_node(pos)
// pos = {x=num, y=num, z=num}
static int l_punch_node(lua_State *L);
// get_node_max_level(pos)
// pos = {x=num, y=num, z=num}
static int l_get_node_max_level(lua_State *L);
// get_node_level(pos)
// pos = {x=num, y=num, z=num}
static int l_get_node_level(lua_State *L);
// set_node_level(pos)
// pos = {x=num, y=num, z=num}
static int l_set_node_level(lua_State *L);
// add_node_level(pos)
// pos = {x=num, y=num, z=num}
static int l_add_node_level(lua_State *L);
// get_meta(pos)
static int l_get_meta(lua_State *L);
// get_node_timer(pos)
static int l_get_node_timer(lua_State *L);
// add_entity(pos, entityname) -> ObjectRef or nil
// pos = {x=num, y=num, z=num}
static int l_add_entity(lua_State *L);
// add_item(pos, itemstack or itemstring or table) -> ObjectRef or nil
// pos = {x=num, y=num, z=num}
static int l_add_item(lua_State *L);
// get_player_by_name(name)
static int l_get_player_by_name(lua_State *L);
// get_objects_inside_radius(pos, radius)
static int l_get_objects_inside_radius(lua_State *L);
// set_timeofday(val)
// val = 0...1
static int l_set_timeofday(lua_State *L);
// get_timeofday() -> 0...1
static int l_get_timeofday(lua_State *L);
// get_gametime()
static int l_get_gametime(lua_State *L);
// find_node_near(pos, radius, nodenames) -> pos or nil
// nodenames: eg. {"ignore", "group:tree"} or "default:dirt"
static int l_find_node_near(lua_State *L);
// find_nodes_in_area(minp, maxp, nodenames) -> list of positions
// nodenames: eg. {"ignore", "group:tree"} or "default:dirt"
static int l_find_nodes_in_area(lua_State *L);
// get_perlin(seeddiff, octaves, persistence, scale)
// returns world-specific PerlinNoise
static int l_get_perlin(lua_State *L);
// get_perlin_map(noiseparams, size)
// returns world-specific PerlinNoiseMap
static int l_get_perlin_map(lua_State *L);
// get_voxel_manip()
// returns world-specific voxel manipulator
static int l_get_voxel_manip(lua_State *L);
// clear_objects()
// clear all objects in the environment
static int l_clear_objects(lua_State *L);
// spawn_tree(pos, treedef)
static int l_spawn_tree(lua_State *L);
// line_of_sight(pos1, pos2, stepsize) -> true/false
static int l_line_of_sight(lua_State *L);
// find_path(pos1, pos2, searchdistance,
// max_jump, max_drop, algorithm) -> table containing path
static int l_find_path(lua_State *L);
// transforming_liquid_add(pos)
static int l_transforming_liquid_add(lua_State *L);
// forceload_block(blockpos)
// forceloads a block
static int l_forceload_block(lua_State *L);
// forceload_free_block(blockpos)
// stops forceloading a position
static int l_forceload_free_block(lua_State *L);
public:
static void Initialize(lua_State *L, int top);
};
class LuaABM : public ActiveBlockModifier
{
private:
int m_id;
std::set<std::string> m_trigger_contents;
std::set<std::string> m_required_neighbors;
float m_trigger_interval;
u32 m_trigger_chance;
public:
LuaABM(lua_State *L, int id,
const std::set<std::string> &trigger_contents,
const std::set<std::string> &required_neighbors,
float trigger_interval, u32 trigger_chance):
m_id(id),
m_trigger_contents(trigger_contents),
m_required_neighbors(required_neighbors),
m_trigger_interval(trigger_interval),
m_trigger_chance(trigger_chance)
{
}
virtual std::set<std::string> getTriggerContents()
{
return m_trigger_contents;
}
virtual std::set<std::string> getRequiredNeighbors()
{
return m_required_neighbors;
}
virtual float getTriggerInterval()
{
return m_trigger_interval;
}
virtual u32 getTriggerChance()
{
return m_trigger_chance;
}
virtual void trigger(ServerEnvironment *env, v3s16 p, MapNode n,
u32 active_object_count, u32 active_object_count_wider);
};
#endif /* L_ENV_H_ */
| [
"jineee@eyou.com"
] | jineee@eyou.com |
415809d9f37b07d689e777a1daa27f30c904ec6d | 4ac4f89db715cf03258a8bb9b4b9d9dd18f0e492 | /Src/HomograpyTransform/vector3.cpp | 9134813e55dda639b8c100467190512a9629c257 | [
"MIT"
] | permissive | azhugg/OpenCV-Practice | 033c78e4720cc4a34bcfab80e5f91736155e9b6c | 5d69c9689aa68da905bc25bec65f7a7ba67a8b87 | refs/heads/master | 2021-06-04T02:45:10.327558 | 2016-09-16T16:02:57 | 2016-09-16T16:02:57 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,743 | cpp |
//#include "stdafx.h"
#include "vector3.h"
#include <math.h>
bool Vector3::IsEmpty() const
{
return (x==0) && (y==0) && (z==0);
}
float Vector3::Length() const
{
return sqrt(x*x + y*y + z*z);
}
float Vector3::LengthRoughly(const Vector3 &rhs) const
{
Vector3 v = *this - rhs;
return v.x*v.x + v.y*v.y + v.z*v.z;
}
Vector3 Vector3::Normal() const
{
const float len = Length();
if (len < 0.001f)
return Vector3(0,0,0);
return *this / len;
}
void Vector3::Normalize()
{
*this = Normal();
}
Vector3 Vector3::operator + () const
{
return *this;
}
Vector3 Vector3::operator - () const
{
return Vector3(-x, -y, -z);
}
Vector3 Vector3::operator + ( const Vector3& rhs ) const
{
return Vector3(x+rhs.x, y+rhs.y, z+rhs.z);
}
Vector3 Vector3::operator - ( const Vector3& rhs ) const
{
return Vector3(x-rhs.x, y-rhs.y, z-rhs.z);
}
Vector3& Vector3::operator += ( const Vector3& rhs )
{
x += rhs.x;
y += rhs.y;
z += rhs.z;
return *this;
}
Vector3& Vector3::operator -= ( const Vector3& rhs )
{
x -= rhs.x;
y -= rhs.y;
z -= rhs.z;
return *this;
}
Vector3& Vector3::operator *= ( const Vector3& rhs )
{
x *= rhs.x;
y *= rhs.y;
z *= rhs.z;
return *this;
}
Vector3& Vector3::operator /= ( const Vector3& rhs )
{
x /= rhs.x;
y /= rhs.y;
z /= rhs.z;
return *this;
}
float Vector3::DotProduct( const Vector3& v ) const
{
return x * v.x + y * v.y + z * v.z;
}
Vector3 Vector3::CrossProduct( const Vector3& v ) const
{
return Vector3(
(y * v.z) - (z * v.y),
(z * v.x) - (x * v.z),
(x * v.y) - (y * v.x) );
}
Vector3 Vector3::Interpolate( const Vector3 &v, const float alpha) const
{
return Vector3(x + (alpha * ( v.x - x ) ),
y + (alpha * ( v.y - y ) ),
z + (alpha * ( v.z - z ) ) );
}
| [
"jjuiddong@gmail.com"
] | jjuiddong@gmail.com |
8fac5ee0a926e187e124b48512c6ca3fa753dd4e | b93cda7e5d90fb5a84c24603619671c1767ba3dc | /pku/1130/4720454_AC_0MS_704K.cc | f77336657ab6dbb1d255fd7cc29c015a0db3fde2 | [] | no_license | denofiend/acm | e7008ff49bf6bea0042dabf94bbae05ebc28fe8a | 409910ca43c888c0e2734699f982ff67b6613699 | refs/heads/master | 2022-11-23T14:51:02.445949 | 2020-07-31T11:42:24 | 2020-07-31T11:42:24 | 284,022,401 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,570 | cc |
#include <iostream>
using namespace std;
template <class T> void out(T x, int n){ for (int i = 0; i < n; ++i) cout << x[i] << ' '; cout << endl; }
template <class T> void out(T x, int n, int m){ for (int i = 0; i < n; ++i) out(x[i], m); cout << endl; }
#define OUT(x) (cout << #x << " = " << x << endl)
#define FOR(i, a, b) for (int i = (int)a; i < (int)b; ++i)
#define REP(i, b) FOR (i, 0, b)
#define FORD(i, a, b) for (int i = (int)a; i >= (int)b; --i)
int g[200][200], ET, n;
int queue[20000], vis[200], vis2[200][200];
void input(){
scanf("%d%d", &n, &ET);
memset(g, 0, sizeof(g));
int sta, end;
while (EOF != scanf("%d %d", &sta, &end))
{
g[sta][end] = 1;
}
}
bool dfs(int sta, int end, int m){
//printf("<%d %d %d>\n", sta, end, m);
if (sta == m || end == m || vis2[sta][end]) return false;
//printf("<%d %d %d>\n", sta, end, m);
if (g[sta][end]) return true;
REP (i, n)
{
if (m == i) continue;
if (g[sta][i] && !vis2[sta][i])
{
vis2[sta][i] = 1;
if (dfs(i, end, m)) return true;
else vis2[sta][i] = 0;
}
}
return false;
}
void solve(){
int head, tail;
memset(vis, 0, sizeof(vis));
head = tail = 0;
queue[tail++] = ET;
vis[ET] = 1;
while (head < tail)
{
int tmp = queue[head++];
REP (i, n)
{
if (g[i][tmp] && !vis[i])
{
//printf("[%d %d]\n", tmp, i);
queue[tail++] = i;
vis[i] = 1;
memset(vis2, 0, sizeof(vis2));
if (0 == i || !dfs(0, ET, i))
{
printf("Put guards in room %d.\n", i);
return;
}
}
}
}
}
int main(){
input();
solve();
return 0;
}
| [
"zhaoxu3@huajiao.tv"
] | zhaoxu3@huajiao.tv |
46059399d79dba8aab9bdff18bae3fdd129184d4 | 5456502f97627278cbd6e16d002d50f1de3da7bb | /cc/trees/proxy_impl.cc | 2c3942695ed42ada91f31e5bd1f5e7ea322102ae | [
"BSD-3-Clause"
] | permissive | TrellixVulnTeam/Chromium_7C66 | 72d108a413909eb3bd36c73a6c2f98de1573b6e5 | c8649ab2a0f5a747369ed50351209a42f59672ee | refs/heads/master | 2023-03-16T12:51:40.231959 | 2017-12-20T10:38:26 | 2017-12-20T10:38:26 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 22,683 | 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 "cc/trees/proxy_impl.h"
#include <algorithm>
#include <string>
#include "base/auto_reset.h"
#include "base/memory/ptr_util.h"
#include "base/trace_event/trace_event.h"
#include "base/trace_event/trace_event_argument.h"
#include "base/trace_event/trace_event_synthetic_delay.h"
#include "cc/debug/benchmark_instrumentation.h"
#include "cc/debug/devtools_instrumentation.h"
#include "cc/input/browser_controls_offset_manager.h"
#include "cc/output/compositor_frame_sink.h"
#include "cc/output/context_provider.h"
#include "cc/scheduler/compositor_timing_history.h"
#include "cc/scheduler/delay_based_time_source.h"
#include "cc/trees/layer_tree_host_in_process.h"
#include "cc/trees/layer_tree_impl.h"
#include "cc/trees/mutator_host.h"
#include "cc/trees/task_runner_provider.h"
#include "gpu/command_buffer/client/gles2_interface.h"
namespace cc {
namespace {
// Measured in seconds.
const double kSmoothnessTakesPriorityExpirationDelay = 0.25;
unsigned int nextBeginFrameId = 0;
} // namespace
ProxyImpl::ProxyImpl(ChannelImpl* channel_impl,
LayerTreeHostInProcess* layer_tree_host,
TaskRunnerProvider* task_runner_provider)
: layer_tree_host_id_(layer_tree_host->GetId()),
commit_completion_waits_for_activation_(false),
commit_completion_event_(nullptr),
activation_completion_event_(nullptr),
next_frame_is_newly_committed_frame_(false),
inside_draw_(false),
input_throttled_until_commit_(false),
task_runner_provider_(task_runner_provider),
smoothness_priority_expiration_notifier_(
task_runner_provider->ImplThreadTaskRunner(),
base::Bind(&ProxyImpl::RenewTreePriority, base::Unretained(this)),
base::TimeDelta::FromSecondsD(
kSmoothnessTakesPriorityExpirationDelay)),
rendering_stats_instrumentation_(
layer_tree_host->rendering_stats_instrumentation()),
channel_impl_(channel_impl) {
TRACE_EVENT0("cc", "ProxyImpl::ProxyImpl");
DCHECK(IsImplThread());
DCHECK(IsMainThreadBlocked());
// Double checking we set this correctly since double->int truncations are
// silent and have been done mistakenly: crbug.com/568120.
DCHECK(!smoothness_priority_expiration_notifier_.delay().is_zero());
layer_tree_host_impl_ = layer_tree_host->CreateLayerTreeHostImpl(this);
const LayerTreeSettings& settings = layer_tree_host->GetSettings();
SchedulerSettings scheduler_settings(settings.ToSchedulerSettings());
std::unique_ptr<CompositorTimingHistory> compositor_timing_history(
new CompositorTimingHistory(
scheduler_settings.using_synchronous_renderer_compositor,
CompositorTimingHistory::RENDERER_UMA,
rendering_stats_instrumentation_));
scheduler_.reset(new Scheduler(this, scheduler_settings, layer_tree_host_id_,
task_runner_provider_->ImplThreadTaskRunner(),
std::move(compositor_timing_history)));
DCHECK_EQ(scheduler_->visible(), layer_tree_host_impl_->visible());
}
ProxyImpl::BlockedMainCommitOnly::BlockedMainCommitOnly()
: layer_tree_host(nullptr) {}
ProxyImpl::BlockedMainCommitOnly::~BlockedMainCommitOnly() {}
ProxyImpl::~ProxyImpl() {
TRACE_EVENT0("cc", "ProxyImpl::~ProxyImpl");
DCHECK(IsImplThread());
DCHECK(IsMainThreadBlocked());
// Prevent the scheduler from performing actions while we're in an
// inconsistent state.
scheduler_->Stop();
// Take away the CompositorFrameSink before destroying things so it doesn't
// try to call into its client mid-shutdown.
layer_tree_host_impl_->ReleaseCompositorFrameSink();
scheduler_ = nullptr;
layer_tree_host_impl_ = nullptr;
// We need to explicitly shutdown the notifier to destroy any weakptrs it is
// holding while still on the compositor thread. This also ensures any
// callbacks holding a ProxyImpl pointer are cancelled.
smoothness_priority_expiration_notifier_.Shutdown();
}
void ProxyImpl::InitializeMutatorOnImpl(
std::unique_ptr<LayerTreeMutator> mutator) {
TRACE_EVENT0("cc,compositor-worker", "ProxyImpl::InitializeMutatorOnImpl");
DCHECK(IsImplThread());
layer_tree_host_impl_->SetLayerTreeMutator(std::move(mutator));
}
void ProxyImpl::UpdateBrowserControlsStateOnImpl(
BrowserControlsState constraints,
BrowserControlsState current,
bool animate) {
DCHECK(IsImplThread());
layer_tree_host_impl_->browser_controls_manager()->UpdateBrowserControlsState(
constraints, current, animate);
}
void ProxyImpl::InitializeCompositorFrameSinkOnImpl(
CompositorFrameSink* compositor_frame_sink) {
TRACE_EVENT0("cc", "ProxyImpl::InitializeCompositorFrameSinkOnImplThread");
DCHECK(IsImplThread());
LayerTreeHostImpl* host_impl = layer_tree_host_impl_.get();
bool success = host_impl->InitializeRenderer(compositor_frame_sink);
channel_impl_->DidInitializeCompositorFrameSink(success);
if (success)
scheduler_->DidCreateAndInitializeCompositorFrameSink();
}
void ProxyImpl::MainThreadHasStoppedFlingingOnImpl() {
DCHECK(IsImplThread());
layer_tree_host_impl_->MainThreadHasStoppedFlinging();
}
void ProxyImpl::SetInputThrottledUntilCommitOnImpl(bool is_throttled) {
DCHECK(IsImplThread());
if (is_throttled == input_throttled_until_commit_)
return;
input_throttled_until_commit_ = is_throttled;
RenewTreePriority();
}
void ProxyImpl::SetDeferCommitsOnImpl(bool defer_commits) const {
DCHECK(IsImplThread());
scheduler_->SetDeferCommits(defer_commits);
}
void ProxyImpl::SetNeedsRedrawOnImpl(const gfx::Rect& damage_rect) {
DCHECK(IsImplThread());
layer_tree_host_impl_->SetViewportDamage(damage_rect);
SetNeedsRedrawOnImplThread();
}
void ProxyImpl::SetNeedsCommitOnImpl() {
DCHECK(IsImplThread());
SetNeedsCommitOnImplThread();
}
void ProxyImpl::BeginMainFrameAbortedOnImpl(
CommitEarlyOutReason reason,
base::TimeTicks main_thread_start_time,
std::vector<std::unique_ptr<SwapPromise>> swap_promises) {
TRACE_EVENT1("cc", "ProxyImpl::BeginMainFrameAbortedOnImplThread", "reason",
CommitEarlyOutReasonToString(reason));
DCHECK(IsImplThread());
DCHECK(scheduler_->CommitPending());
if (CommitEarlyOutHandledCommit(reason)) {
SetInputThrottledUntilCommitOnImpl(false);
}
layer_tree_host_impl_->BeginMainFrameAborted(reason,
std::move(swap_promises));
scheduler_->NotifyBeginMainFrameStarted(main_thread_start_time);
scheduler_->BeginMainFrameAborted(reason);
}
void ProxyImpl::SetVisibleOnImpl(bool visible) {
TRACE_EVENT1("cc", "ProxyImpl::SetVisibleOnImplThread", "visible", visible);
DCHECK(IsImplThread());
layer_tree_host_impl_->SetVisible(visible);
scheduler_->SetVisible(visible);
}
void ProxyImpl::ReleaseCompositorFrameSinkOnImpl(CompletionEvent* completion) {
DCHECK(IsImplThread());
// Unlike DidLoseCompositorFrameSinkOnImplThread, we don't need to call
// LayerTreeHost::DidLoseCompositorFrameSink since it already knows.
scheduler_->DidLoseCompositorFrameSink();
layer_tree_host_impl_->ReleaseCompositorFrameSink();
completion->Signal();
}
void ProxyImpl::FinishGLOnImpl(CompletionEvent* completion) {
TRACE_EVENT0("cc", "ProxyImpl::FinishGLOnImplThread");
DCHECK(IsImplThread());
if (layer_tree_host_impl_->compositor_frame_sink()) {
ContextProvider* context_provider =
layer_tree_host_impl_->compositor_frame_sink()->context_provider();
if (context_provider)
context_provider->ContextGL()->Finish();
}
completion->Signal();
}
void ProxyImpl::MainFrameWillHappenOnImplForTesting(
CompletionEvent* completion,
bool* main_frame_will_happen) {
DCHECK(IsImplThread());
if (layer_tree_host_impl_->compositor_frame_sink()) {
*main_frame_will_happen = scheduler_->MainFrameForTestingWillHappen();
} else {
*main_frame_will_happen = false;
}
completion->Signal();
}
void ProxyImpl::NotifyReadyToCommitOnImpl(
CompletionEvent* completion,
LayerTreeHostInProcess* layer_tree_host,
base::TimeTicks main_thread_start_time,
bool hold_commit_for_activation) {
TRACE_EVENT0("cc", "ProxyImpl::NotifyReadyToCommitOnImpl");
DCHECK(!commit_completion_event_);
DCHECK(IsImplThread() && IsMainThreadBlocked());
DCHECK(scheduler_);
DCHECK(scheduler_->CommitPending());
if (!layer_tree_host_impl_) {
TRACE_EVENT_INSTANT0("cc", "EarlyOut_NoLayerTree",
TRACE_EVENT_SCOPE_THREAD);
completion->Signal();
return;
}
// Ideally, we should inform to impl thread when BeginMainFrame is started.
// But, we can avoid a PostTask in here.
scheduler_->NotifyBeginMainFrameStarted(main_thread_start_time);
layer_tree_host_impl_->ReadyToCommit();
commit_completion_event_ = completion;
commit_completion_waits_for_activation_ = hold_commit_for_activation;
DCHECK(!blocked_main_commit().layer_tree_host);
blocked_main_commit().layer_tree_host = layer_tree_host;
scheduler_->NotifyReadyToCommit();
}
void ProxyImpl::DidLoseCompositorFrameSinkOnImplThread() {
TRACE_EVENT0("cc", "ProxyImpl::DidLoseCompositorFrameSinkOnImplThread");
DCHECK(IsImplThread());
channel_impl_->DidLoseCompositorFrameSink();
scheduler_->DidLoseCompositorFrameSink();
}
void ProxyImpl::SetBeginFrameSource(BeginFrameSource* source) {
// During shutdown, destroying the CompositorFrameSink may unset the
// BeginFrameSource.
if (scheduler_) {
// TODO(enne): this overrides any preexisting begin frame source. Those
// other sources will eventually be removed and this will be the only path.
scheduler_->SetBeginFrameSource(source);
}
}
void ProxyImpl::DidReceiveCompositorFrameAckOnImplThread() {
TRACE_EVENT0("cc,benchmark",
"ProxyImpl::DidReceiveCompositorFrameAckOnImplThread");
DCHECK(IsImplThread());
scheduler_->DidReceiveCompositorFrameAck();
channel_impl_->DidReceiveCompositorFrameAck();
}
void ProxyImpl::OnCanDrawStateChanged(bool can_draw) {
TRACE_EVENT1("cc", "ProxyImpl::OnCanDrawStateChanged", "can_draw", can_draw);
DCHECK(IsImplThread());
scheduler_->SetCanDraw(can_draw);
}
void ProxyImpl::NotifyReadyToActivate() {
TRACE_EVENT0("cc", "ProxyImpl::NotifyReadyToActivate");
DCHECK(IsImplThread());
scheduler_->NotifyReadyToActivate();
}
void ProxyImpl::NotifyReadyToDraw() {
TRACE_EVENT0("cc", "ProxyImpl::NotifyReadyToDraw");
DCHECK(IsImplThread());
scheduler_->NotifyReadyToDraw();
}
void ProxyImpl::SetNeedsRedrawOnImplThread() {
TRACE_EVENT0("cc", "ProxyImpl::SetNeedsRedrawOnImplThread");
DCHECK(IsImplThread());
scheduler_->SetNeedsRedraw();
}
void ProxyImpl::SetNeedsOneBeginImplFrameOnImplThread() {
TRACE_EVENT0("cc", "ProxyImpl::SetNeedsOneBeginImplFrameOnImplThread");
DCHECK(IsImplThread());
scheduler_->SetNeedsOneBeginImplFrame();
}
void ProxyImpl::SetNeedsPrepareTilesOnImplThread() {
DCHECK(IsImplThread());
scheduler_->SetNeedsPrepareTiles();
}
void ProxyImpl::SetNeedsCommitOnImplThread() {
TRACE_EVENT0("cc", "ProxyImpl::SetNeedsCommitOnImplThread");
DCHECK(IsImplThread());
scheduler_->SetNeedsBeginMainFrame();
}
void ProxyImpl::SetVideoNeedsBeginFrames(bool needs_begin_frames) {
TRACE_EVENT1("cc", "ProxyImpl::SetVideoNeedsBeginFrames",
"needs_begin_frames", needs_begin_frames);
DCHECK(IsImplThread());
// In tests the layer tree is destroyed after the scheduler is.
if (scheduler_)
scheduler_->SetVideoNeedsBeginFrames(needs_begin_frames);
}
void ProxyImpl::PostAnimationEventsToMainThreadOnImplThread(
std::unique_ptr<MutatorEvents> events) {
TRACE_EVENT0("cc", "ProxyImpl::PostAnimationEventsToMainThreadOnImplThread");
DCHECK(IsImplThread());
channel_impl_->SetAnimationEvents(std::move(events));
}
bool ProxyImpl::IsInsideDraw() {
return inside_draw_;
}
void ProxyImpl::RenewTreePriority() {
DCHECK(IsImplThread());
bool smoothness_takes_priority =
layer_tree_host_impl_->pinch_gesture_active() ||
layer_tree_host_impl_->page_scale_animation_active() ||
layer_tree_host_impl_->IsActivelyScrolling();
// Schedule expiration if smoothness currently takes priority.
if (smoothness_takes_priority)
smoothness_priority_expiration_notifier_.Schedule();
// We use the same priority for both trees by default.
TreePriority tree_priority = SAME_PRIORITY_FOR_BOTH_TREES;
// Smoothness takes priority if we have an expiration for it scheduled.
if (smoothness_priority_expiration_notifier_.HasPendingNotification())
tree_priority = SMOOTHNESS_TAKES_PRIORITY;
// New content always takes priority when there is an invalid viewport size or
// ui resources have been evicted.
if (layer_tree_host_impl_->active_tree()->ViewportSizeInvalid() ||
layer_tree_host_impl_->EvictedUIResourcesExist() ||
input_throttled_until_commit_) {
// Once we enter NEW_CONTENTS_TAKES_PRIORITY mode, visible tiles on active
// tree might be freed. We need to set RequiresHighResToDraw to ensure that
// high res tiles will be required to activate pending tree.
layer_tree_host_impl_->SetRequiresHighResToDraw();
tree_priority = NEW_CONTENT_TAKES_PRIORITY;
}
layer_tree_host_impl_->SetTreePriority(tree_priority);
// Only put the scheduler in impl latency prioritization mode if we don't
// have a scroll listener. This gives the scroll listener a better chance of
// handling scroll updates within the same frame. The tree itself is still
// kept in prefer smoothness mode to allow checkerboarding.
ScrollHandlerState scroll_handler_state =
layer_tree_host_impl_->scroll_affects_scroll_handler()
? ScrollHandlerState::SCROLL_AFFECTS_SCROLL_HANDLER
: ScrollHandlerState::SCROLL_DOES_NOT_AFFECT_SCROLL_HANDLER;
scheduler_->SetTreePrioritiesAndScrollState(tree_priority,
scroll_handler_state);
}
void ProxyImpl::PostDelayedAnimationTaskOnImplThread(const base::Closure& task,
base::TimeDelta delay) {
DCHECK(IsImplThread());
task_runner_provider_->ImplThreadTaskRunner()->PostDelayedTask(FROM_HERE,
task, delay);
}
void ProxyImpl::DidActivateSyncTree() {
TRACE_EVENT0("cc", "ProxyImpl::DidActivateSyncTreeOnImplThread");
DCHECK(IsImplThread());
if (activation_completion_event_) {
TRACE_EVENT_INSTANT0("cc", "ReleaseCommitbyActivation",
TRACE_EVENT_SCOPE_THREAD);
activation_completion_event_->Signal();
activation_completion_event_ = nullptr;
}
}
void ProxyImpl::WillPrepareTiles() {
DCHECK(IsImplThread());
scheduler_->WillPrepareTiles();
}
void ProxyImpl::DidPrepareTiles() {
DCHECK(IsImplThread());
scheduler_->DidPrepareTiles();
}
void ProxyImpl::DidCompletePageScaleAnimationOnImplThread() {
DCHECK(IsImplThread());
channel_impl_->DidCompletePageScaleAnimation();
}
void ProxyImpl::OnDrawForCompositorFrameSink(bool resourceless_software_draw) {
DCHECK(IsImplThread());
scheduler_->OnDrawForCompositorFrameSink(resourceless_software_draw);
}
void ProxyImpl::WillBeginImplFrame(const BeginFrameArgs& args) {
DCHECK(IsImplThread());
layer_tree_host_impl_->WillBeginImplFrame(args);
}
void ProxyImpl::DidFinishImplFrame() {
DCHECK(IsImplThread());
layer_tree_host_impl_->DidFinishImplFrame();
}
void ProxyImpl::ScheduledActionSendBeginMainFrame(const BeginFrameArgs& args) {
DCHECK(IsImplThread());
unsigned int begin_frame_id = nextBeginFrameId++;
benchmark_instrumentation::ScopedBeginFrameTask begin_frame_task(
benchmark_instrumentation::kSendBeginFrame, begin_frame_id);
std::unique_ptr<BeginMainFrameAndCommitState> begin_main_frame_state(
new BeginMainFrameAndCommitState);
begin_main_frame_state->begin_frame_id = begin_frame_id;
begin_main_frame_state->begin_frame_args = args;
begin_main_frame_state->begin_frame_callbacks =
layer_tree_host_impl_->ProcessLayerTreeMutations();
begin_main_frame_state->scroll_info =
layer_tree_host_impl_->ProcessScrollDeltas();
begin_main_frame_state->evicted_ui_resources =
layer_tree_host_impl_->EvictedUIResourcesExist();
channel_impl_->BeginMainFrame(std::move(begin_main_frame_state));
devtools_instrumentation::DidRequestMainThreadFrame(layer_tree_host_id_);
}
DrawResult ProxyImpl::ScheduledActionDrawIfPossible() {
TRACE_EVENT0("cc", "ProxyImpl::ScheduledActionDraw");
DCHECK(IsImplThread());
// The scheduler should never generate this call when it can't draw.
DCHECK(layer_tree_host_impl_->CanDraw());
bool forced_draw = false;
return DrawInternal(forced_draw);
}
DrawResult ProxyImpl::ScheduledActionDrawForced() {
TRACE_EVENT0("cc", "ProxyImpl::ScheduledActionDrawForced");
DCHECK(IsImplThread());
bool forced_draw = true;
return DrawInternal(forced_draw);
}
void ProxyImpl::ScheduledActionCommit() {
TRACE_EVENT0("cc", "ProxyImpl::ScheduledActionCommit");
DCHECK(IsImplThread());
DCHECK(IsMainThreadBlocked());
DCHECK(commit_completion_event_);
layer_tree_host_impl_->BeginCommit();
blocked_main_commit().layer_tree_host->FinishCommitOnImplThread(
layer_tree_host_impl_.get());
// Remove the LayerTreeHost reference before the completion event is signaled
// and cleared. This is necessary since blocked_main_commit() allows access
// only while we have the completion event to ensure the main thread is
// blocked for a commit.
blocked_main_commit().layer_tree_host = nullptr;
if (commit_completion_waits_for_activation_) {
// For some layer types in impl-side painting, the commit is held until the
// sync tree is activated. It's also possible that the sync tree has
// already activated if there was no work to be done.
TRACE_EVENT_INSTANT0("cc", "HoldCommit", TRACE_EVENT_SCOPE_THREAD);
commit_completion_waits_for_activation_ = false;
activation_completion_event_ = commit_completion_event_;
} else {
commit_completion_event_->Signal();
}
commit_completion_event_ = nullptr;
scheduler_->DidCommit();
// Delay this step until afer the main thread has been released as it's
// often a good bit of work to update the tree and prepare the new frame.
layer_tree_host_impl_->CommitComplete();
SetInputThrottledUntilCommitOnImpl(false);
next_frame_is_newly_committed_frame_ = true;
}
void ProxyImpl::ScheduledActionActivateSyncTree() {
TRACE_EVENT0("cc", "ProxyImpl::ScheduledActionActivateSyncTree");
DCHECK(IsImplThread());
layer_tree_host_impl_->ActivateSyncTree();
}
void ProxyImpl::ScheduledActionBeginCompositorFrameSinkCreation() {
TRACE_EVENT0("cc",
"ProxyImpl::ScheduledActionBeginCompositorFrameSinkCreation");
DCHECK(IsImplThread());
channel_impl_->RequestNewCompositorFrameSink();
}
void ProxyImpl::ScheduledActionPrepareTiles() {
TRACE_EVENT0("cc", "ProxyImpl::ScheduledActionPrepareTiles");
DCHECK(IsImplThread());
layer_tree_host_impl_->PrepareTiles();
}
void ProxyImpl::ScheduledActionInvalidateCompositorFrameSink() {
TRACE_EVENT0("cc", "ProxyImpl::ScheduledActionInvalidateCompositorFrameSink");
DCHECK(IsImplThread());
DCHECK(layer_tree_host_impl_->compositor_frame_sink());
layer_tree_host_impl_->compositor_frame_sink()->Invalidate();
}
void ProxyImpl::SendBeginMainFrameNotExpectedSoon() {
DCHECK(IsImplThread());
channel_impl_->BeginMainFrameNotExpectedSoon();
}
DrawResult ProxyImpl::DrawInternal(bool forced_draw) {
TRACE_EVENT_SYNTHETIC_DELAY("cc.Draw");
DCHECK(IsImplThread());
DCHECK(layer_tree_host_impl_.get());
base::AutoReset<bool> mark_inside(&inside_draw_, true);
if (layer_tree_host_impl_->pending_tree()) {
bool update_lcd_text = false;
layer_tree_host_impl_->pending_tree()->UpdateDrawProperties(
update_lcd_text);
}
// This method is called on a forced draw, regardless of whether we are able
// to produce a frame, as the calling site on main thread is blocked until its
// request completes, and we signal completion here. If CanDraw() is false, we
// will indicate success=false to the caller, but we must still signal
// completion to avoid deadlock.
// We guard PrepareToDraw() with CanDraw() because it always returns a valid
// frame, so can only be used when such a frame is possible. Since
// DrawLayers() depends on the result of PrepareToDraw(), it is guarded on
// CanDraw() as well.
LayerTreeHostImpl::FrameData frame;
bool draw_frame = false;
DrawResult result;
if (layer_tree_host_impl_->CanDraw()) {
result = layer_tree_host_impl_->PrepareToDraw(&frame);
draw_frame = forced_draw || result == DRAW_SUCCESS;
} else {
result = DRAW_ABORTED_CANT_DRAW;
}
if (draw_frame) {
if (layer_tree_host_impl_->DrawLayers(&frame))
// Drawing implies we submitted a frame to the CompositorFrameSink.
scheduler_->DidSubmitCompositorFrame();
result = DRAW_SUCCESS;
} else {
DCHECK_NE(DRAW_SUCCESS, result);
}
layer_tree_host_impl_->DidDrawAllLayers(frame);
bool start_ready_animations = draw_frame;
layer_tree_host_impl_->UpdateAnimationState(start_ready_animations);
// Tell the main thread that the the newly-commited frame was drawn.
if (next_frame_is_newly_committed_frame_) {
next_frame_is_newly_committed_frame_ = false;
channel_impl_->DidCommitAndDrawFrame();
}
DCHECK_NE(INVALID_RESULT, result);
return result;
}
bool ProxyImpl::IsImplThread() const {
return task_runner_provider_->IsImplThread();
}
bool ProxyImpl::IsMainThreadBlocked() const {
return task_runner_provider_->IsMainThreadBlocked();
}
ProxyImpl::BlockedMainCommitOnly& ProxyImpl::blocked_main_commit() {
DCHECK(IsMainThreadBlocked() && commit_completion_event_);
return main_thread_blocked_commit_vars_unsafe_;
}
} // namespace cc
| [
"lixiaodonglove7@aliyun.com"
] | lixiaodonglove7@aliyun.com |
670a440ca923b87e81c4aee4804765fdfffc1097 | bd7a3bb90dc00b5a73c3993941afd89eb776bf3c | /Elab_C_File/10-06.cpp | 58478050e282fafe462facb1475f4002530b16e1 | [] | no_license | cjtim/c_lab | 7532fc5f24a8a6bb0cda129caa7c249f2e1aed4b | c35d06cbc49bbbd00a748fe1e8a0511faf022591 | refs/heads/master | 2020-11-30T11:19:22.464903 | 2020-04-05T16:20:56 | 2020-04-05T16:20:56 | 230,385,991 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,972 | cpp | #include <iostream>
#include <cmath>
#include <string>
using namespace std;
class Time{
private:
int hour;
int minute;
int second;
public:
Time(int hour, int minute, int second){
if(second >= 60){
this->minute += 1;
this->second -= 60;
}
else{
this->second = second;
}
if(minute >= 60){
this->hour += 1;
this->minute -= 60;
}
else{
this->minute = minute;
}
if(hour >= 24){
this->hour = hour - 24;
}
else{
this->hour = hour;
}
}
Time(int duration){
int hour = duration/3600;
duration -= hour*3600;
int minute = duration/60;
duration -= minute*60;
int second = duration;
if(second >= 60){
this->minute += 1;
this->second -= 60;
}
else{
this->second = second;
}
if(minute >= 60){
this->hour += 1;
this->minute -= 60;
}
else{
this->minute = minute;
}
if(hour >= 24){
this->hour = hour - 24;
}
else{
this->hour = hour;
}
}
void setHour(int hr){
hour = hr;
}
void setMinute(int min){
minute = min;
}
void setSecond(int sec){
second = sec;
}
int getDuration(){
return hour*3600 + minute*60 + second;
}
int getHour(){
return hour;
}
int getMinute(){
return minute;
}
int getSecond(){
return second;
}
Time add(Time other){
Time tmp(getDuration() + other.getDuration());
return tmp;
}
int subtract(Time other){
if( getDuration() - other.getDuration() < 0 ){
return 86400 + getDuration() - other.getDuration();
}
else{
return getDuration() - other.getDuration();
}
}
int equals(Time other){
if(getDuration() == other.getDuration()){
return 1;
}
else{
return 0;
}
}
string toString(){
string hr, min, sec;
if(hour >= 10){hr = to_string(hour);}
else{hr = string(1, '0').append(to_string(hour));}
if (minute >= 10){min = to_string(minute);}
else{min = string(1, '0').append(to_string(minute));}
if(second >= 10){sec = to_string(second);}
else{sec = string(1, '0').append(to_string(second));}
return hr + ":" + min + ":" + sec;
}
};
int main()
{
// implement program to test class Time
Time a(23,0,0);
Time b(86400);
cout << a.toString() << endl;
cout << b.toString() << endl;
cout << a.getDuration() << endl;
cout << b.getDuration() << endl;
cout << "Subtract " << a.subtract(b) << endl;
cout << "Subtract " << b.subtract(a) << endl;
}
| [
"47479090+cjtim@users.noreply.github.com"
] | 47479090+cjtim@users.noreply.github.com |
6d3b95b38b41526f3e638c6e7a98ef8d7eefacc6 | b78193cb8c3473ec7b16cd79cf8ccd7358e490c4 | /teensy-midi-processor.ino | 2ce4701c785ecf3a9b59a3e9ac2c74f9cbaa341f | [] | no_license | jipumarino/teensy-midi-processor | 3d14031463ff043d3720fedcbd477e223c2e3b4e | 9239240c7c1dec1a9a3462939163034a43efbce4 | refs/heads/master | 2021-07-14T01:34:53.083740 | 2016-10-13T16:41:11 | 2016-10-13T16:43:18 | 58,155,514 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,124 | ino | const int ledPin = 13;
// Realtime MIDI messages
const byte MIDI_CLOCK = 0xF8;
const byte MIDI_START = 0xFA;
const byte MIDI_CONTINUE = 0xFB;
const byte MIDI_STOP = 0xFC;
const byte OCTATRACK_AUTO_CH = 10;
// LaunchKey Mini InControl Pads (including round pads)
// Row 1: 0x60 ... 0x68
// Row 2: 0x70 ... 0x78
const byte LK_INCONTROL_CH = 1;
const byte LK_FWD_TRANSPORT_PAD = 0x70;
const byte LK_LEFT_ARROW = 0x6A;
const byte LK_RIGHT_ARROW = 0x6B;
const byte LK_UP_ARROW = 0x68;
const byte LK_DOWN_ARROW = 0x69;
const byte LK_RED = 0x05;
const byte LK_GREEN = 0x30;
const byte LK_YELLOW = 0x13;
const byte LK_OFF = 0x00;
bool fwdTransportEnabled = false;
int resetLKShortcutCount = 0;
void setup() {
pinMode(ledPin, OUTPUT);
usbMIDI.setHandleNoteOff(onNoteOff);
usbMIDI.setHandleNoteOn(onNoteOn);
usbMIDI.setHandleRealTimeSystem(onRealTimeSystem);
usbMIDI.setHandleControlChange(onControlChange);
digitalWrite(ledPin, HIGH);
delay(500);
digitalWrite(ledPin, LOW);
}
void loop() {
usbMIDI.read();
}
void onNoteOn(byte channel, byte note, byte velocity) {
if ( channel == LK_INCONTROL_CH ) {
switch(note) {
case LK_FWD_TRANSPORT_PAD:
toggleFwdTransport();
break;
}
} else {
usbMIDI.sendNoteOn(note, velocity, channel);
}
}
void onNoteOff(byte channel, byte note, byte velocity) {
if ( channel != LK_INCONTROL_CH ) {
usbMIDI.sendNoteOff(note, velocity, channel);
}
}
void onControlChange(byte channel, byte control, byte value) {
if ( channel == LK_INCONTROL_CH ) {
switch( control ) {
case LK_LEFT_ARROW:
case LK_RIGHT_ARROW:
if ( value == 0 ) {
resetLKShortcut(-1);
} else {
resetLKShortcut(+1);
}
break;
}
} else {
usbMIDI.sendControlChange(control, value, channel);
}
}
void resetLKShortcut(int countChange) {
resetLKShortcutCount += countChange;
if ( resetLKShortcutCount >= 2) {
resetLK();
}
}
void resetLK() {
enableLKInControl();
setFwdTransport(true);
}
void enableLKInControl() {
usbMIDI.sendNoteOn(0x0C, 0x7F, LK_INCONTROL_CH);
}
void setLKInControlLed(byte pad, byte color) {
usbMIDI.sendNoteOn(pad, color, LK_INCONTROL_CH);
}
void toggleFwdTransport() {
if ( fwdTransportEnabled ) {
setFwdTransport(false);
} else {
setFwdTransport(true);
}
}
void setFwdTransport(bool value) {
if ( value ) {
setLKInControlLed(LK_FWD_TRANSPORT_PAD, LK_GREEN);
} else {
setLKInControlLed(LK_FWD_TRANSPORT_PAD, LK_RED);
}
fwdTransportEnabled = value;
}
void onRealTimeSystem(byte msg) {
if ( ( fwdTransportEnabled && ( msg == MIDI_START || msg == MIDI_STOP || msg == MIDI_CONTINUE ) ) || msg == MIDI_CLOCK ) {
sendRealTime(msg);
}
}
void sendRealTime(byte msg) {
// USB MIDI message:
// 4 bits Cable Number 0: 0x0
// 4 bits Code Index Number "Single Byte": 0xF
// 8 bits Status, msg byte received
// 16 bits zero padding
// All together: 0x0F[msg]0000
// Reverse for endianness: 0x0000[msg]0F
// Discard leading zeroes: 0x[msg]0F
usb_midi_write_packed(((msg & 0xFF) << 8) | 0x0F);
}
| [
"juan@scribd.com"
] | juan@scribd.com |
a0a15f86803d6bc8458197c62651e076e103f089 | 74abcff999dbab58450a151b60521ffc397e6956 | /instrument.hpp | 35ea56555ae55a910c47338eccde16de46f8c967 | [] | no_license | farooq7/MIDI-Player | 0f1383a22b69128612cb69b727a49748eac8d869 | c9be4f5e059f45f78e32bcf160fcd2249fd6b7e9 | refs/heads/master | 2020-03-31T03:35:56.624017 | 2018-10-06T18:55:00 | 2018-10-06T18:57:18 | 151,871,080 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,639 | hpp | #ifndef INSTRUMENT_HPP
#define INSTRUMENT_HPP
#include "event.hpp"
#include "track.hpp"
const double envelope_scale_factor = 0.25;
// The default instrument. A simple fixed length note instrument using a sinusoid weighted by an envelope function.
class DefaultInstrument
{
public:
DefaultInstrument() = delete; // No default constructor. A DefaultInstrument must have an associated track.
DefaultInstrument(const DefaultInstrument &) = delete; // Cannot be copied.
DefaultInstrument & operator=(const DefaultInstrument &) = delete; // Cannot be assigned.
DefaultInstrument(const Track &track, double rate); // Construct a Default Instrument using the specified track. param track the track to read events from.
// Returns true of the DefaultInstrument has stopped processing events.
// This can occu e.g. if all events have been consumed or a EndTrackEvent has been processed.
bool halted();
// Return the sample after the (real) time increment. Samples the
// instrument based on its state after processing all events prior to this time.
// \param deltaT the time increment in seconds.
double sample(double deltaT);
void reset();
private:
Track track_;
double tempo = 500000.0;
bool halt;
int iter = 0;
double sampleRate;
double getFrequency(double notenum);
double getEnvelope(double time);
struct Note
{
double note_num = 0.0;
double note_velocity = 0.0;
float note_duration = 0.0;
double time_start = 0.0;
void reset()
{
note_num = 0.0;
note_velocity = 0.0;
time_start = 0.0;
note_duration = 0.0;
}
} note_;
vector <Note> notes;
};
#endif | [
"farooq7@vt.edu"
] | farooq7@vt.edu |
fc018538621f8de3316c2537fb562c1fb23ec8b3 | 0745826a1032c04ce702eacf26800ccf833f3320 | /editor/echo/Editor/UI/NewNodeDialog/NewNodeDialog.cpp | 4dd94cff3cb3457ec54ccd82eeb2026510bf6a07 | [
"MIT"
] | permissive | jinsuoliu/echo | a9fc505dd42fa86009db27059fa80b8cc0142a76 | a6053f60a7d295ba0bc2b20833c9107b0ce371f9 | refs/heads/master | 2020-07-30T20:57:11.508987 | 2019-09-19T14:12:13 | 2019-09-19T14:12:13 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 6,924 | cpp | #include "Studio.h"
#include "NewNodeDialog.h"
#include "EchoEngine.h"
#include "NodeTreePanel.h"
#include <engine/core/base/class.h>
namespace Studio
{
NewNodeDialog::NewNodeDialog(QWidget* parent)
: QDialog(parent)
, m_viewNodeByModule(true)
{
setupUi(this);
// hide default window title
setWindowFlags(windowFlags() | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint);
// sort proxy model
m_standardModel = new QStandardItemModel(m_treeView);
m_filterProxyModel = new QSortFilterProxyModel(m_treeView);
m_filterProxyModel->setSourceModel(m_standardModel);
m_filterProxyModel->setSortCaseSensitivity(Qt::CaseInsensitive);
//m_filterProxyModel->setFilterKeyColumn(0);
m_treeView->setModel(m_filterProxyModel);
m_treeView->setAttribute(Qt::WA_MacShowFocusRect,0);
m_searchLineEdit->setAttribute(Qt::WA_MacShowFocusRect,0);
// connect signal slot
QObject::connect(m_treeView, SIGNAL(clicked(QModelIndex)), this, SLOT(onSelectNode(QModelIndex)));
QObject::connect(m_confirm, SIGNAL(clicked()), this, SLOT(onConfirmNode()));
QObject::connect(m_cancel, SIGNAL(clicked()), this, SLOT(reject()));
QObject::connect(m_viewNodeButton, SIGNAL(clicked()), this, SLOT(onSwitchNodeVeiwType()));
QObject::connect(m_treeView, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(onConfirmNode()));
QObject::connect(m_searchLineEdit, SIGNAL(textChanged(const QString &)), this, SLOT(onSearchTextChanged()));
recoverEditSettings();
}
NewNodeDialog::~NewNodeDialog()
{
}
// instance
NewNodeDialog* NewNodeDialog::instance()
{
NewNodeDialog* inst = new NewNodeDialog();
return inst;
}
// get node type
Echo::String NewNodeDialog::getSelectedNodeType()
{
NewNodeDialog* inst = instance();
inst->setVisible(true);
if (inst->exec() == QDialog::Accepted)
{
return inst->m_result;
}
return "";
}
void NewNodeDialog::initNodeDisplayByModule()
{
m_standardModel->clear();
addNode( "Node");
m_treeView->expandAll();
}
QStandardItem* NewNodeDialog::getModuleItem(const Echo::String& nodeName)
{
Echo::ClassInfo* cinfo = Echo::Class::getClassInfo(nodeName);
Echo::String moduleName = (cinfo && !cinfo->m_module.empty()) ? cinfo->m_module : "Core";
Echo::String moduleDisplayName = Echo::StringUtil::Replace(moduleName, "Module", "");
QStandardItem* rootItem = m_standardModel->invisibleRootItem();
for (int i = 0; i < rootItem->rowCount(); i++)
{
QStandardItem* moduleItem = rootItem->child(i, 0);
if (moduleItem->text().toStdString().c_str() == moduleDisplayName)
{
return moduleItem;
}
}
// create module item
QStandardItem* nodeItem = new QStandardItem;
nodeItem->setText( moduleDisplayName.c_str());
nodeItem->setData( "module", Qt::UserRole);
rootItem->setChild(rootItem->rowCount(), nodeItem);
return getModuleItem( nodeName);
}
// create QTreewidgetItem by nodename
QStandardItem* NewNodeDialog::createQTreeWidgetItemByNodeName(const Echo::String& nodeName, QStandardItem* parent, bool isCreateWhenNodeIsVirtual)
{
bool isNodeVirtual = Echo::Class::isVirtual(nodeName);
if (isNodeVirtual && !isCreateWhenNodeIsVirtual)
return nullptr;
QStandardItem* nodeItem = new QStandardItem();
parent->setChild(parent->rowCount(), nodeItem);
nodeItem->setText( nodeName.c_str());
nodeItem->setData( "node", Qt::UserRole);
if (!isNodeVirtual)
{
// iconpath
Echo::Node* node = (Echo::Node*)Echo::Class::create(nodeName);
Echo::String iconPath = node->getEditor() ? node->getEditor()->getEditorIcon() : "";
EchoSafeDelete(node, Node);
Echo::String rootPath = AStudio::instance()->getRootPath();
// get icon path by node name
Echo::String lowerCaseNodeName = nodeName;
Echo::StringUtil::LowerCase(lowerCaseNodeName);
Echo::String qIconPath = Echo::StringUtil::Format(":/icon/node/%s.png", lowerCaseNodeName.c_str());
nodeItem->setIcon(QIcon(iconPath.empty() ? qIconPath.c_str() : (rootPath + iconPath).c_str()));
}
return nodeItem;
}
void NewNodeDialog::addNode(const Echo::String& nodeName)
{
// use module item as parent
QStandardItem* moduleParent = getModuleItem(nodeName);
createQTreeWidgetItemByNodeName(nodeName, moduleParent, false);
// recursive all children
Echo::StringArray childNodes;
if (Echo::Class::getChildClasses(childNodes, nodeName.c_str(), false))
{
for (const Echo::String& childNode : childNodes)
{
addNode(childNode);
}
}
}
void NewNodeDialog::initNodeDisplayByInherite()
{
m_standardModel->clear();
// begin with "Node"
addNode("Node", m_standardModel->invisibleRootItem());
// expand all items
m_treeView->expandAll();
}
void NewNodeDialog::addNode(const Echo::String& nodeName, QStandardItem* parent)
{
// create by node name
QStandardItem* nodeItem = createQTreeWidgetItemByNodeName(nodeName, parent, true);
// recursive all children
Echo::StringArray childNodes;
if( Echo::Class::getChildClasses(childNodes, nodeName.c_str(), false))
{
for (const Echo::String& childNode : childNodes)
{
addNode(childNode, nodeItem);
}
}
}
void NewNodeDialog::onSelectNode(QModelIndex index)
{
Echo::String text = m_filterProxyModel->data(index, Qt::DisplayRole).toString().toStdString().c_str();
Echo::String userData = m_filterProxyModel->data(index, Qt::UserRole).toString().toStdString().c_str();
m_confirm->setEnabled( userData == "node" && !Echo::Class::isVirtual(text));
}
void NewNodeDialog::onConfirmNode()
{
Echo::String text = m_filterProxyModel->data( m_treeView->currentIndex(), Qt::DisplayRole).toString().toStdString().c_str();
if (!Echo::Class::isVirtual( text))
{
m_result = text;
accept();
hide();
}
}
void NewNodeDialog::onSwitchNodeVeiwType()
{
m_viewNodeByModule = !m_viewNodeByModule;
if (m_viewNodeByModule)
{
initNodeDisplayByModule();
m_viewNodeButton->setIcon(QIcon(":/icon/Icon/res/view_type_list.png"));
m_viewNodeButton->setToolTip("Display node by Module");
}
else
{
initNodeDisplayByInherite();
m_viewNodeButton->setIcon(QIcon(":/icon/Icon/res/view_type_grid.png"));
m_viewNodeButton->setToolTip("Display node by inheritance relationships");
}
// save config
AStudio::instance()->getConfigMgr()->setValue("NewNodeDialog_NodeViewType", m_viewNodeByModule ? "Module" : "Inherit");
}
void NewNodeDialog::recoverEditSettings()
{
Echo::String viewType = AStudio::instance()->getConfigMgr()->getValue("NewNodeDialog_NodeViewType");
if (!viewType.empty() && m_viewNodeByModule && viewType != "Module")
{
onSwitchNodeVeiwType();
}
else
{
initNodeDisplayByModule();
}
}
void NewNodeDialog::onSearchTextChanged()
{
Echo::String pattern = m_searchLineEdit->text().toStdString().c_str();
QRegExp regExp(pattern.c_str(), Qt::CaseInsensitive);
m_filterProxyModel->setFilterRegExp(regExp);
m_treeView->expandAll();
}
}
| [
"qq79402005@gmail.com"
] | qq79402005@gmail.com |
73a03f667dc52a105d2fe747e40b17c19df84018 | 62408a02b44f2fd20c6d54e1f5def0184e69194c | /UVA/12503/12668976_AC_0ms_0kB.cpp | a57e453f6e97af5f7ed519bdc4c30b924a53a9fa | [] | no_license | benedicka/Competitive-Programming | 24eb90b8150aead5c13287b62d9dc860c4b9232e | a94ccfc2d726e239981d598e98d1aa538691fa47 | refs/heads/main | 2023-03-22T10:14:34.889913 | 2021-03-16T05:33:43 | 2021-03-16T05:33:43 | 348,212,250 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 486 | cpp | #include<stdio.h>
#include<string.h>
int main()
{
int t,n,ans,a;
scanf("%d",&t);
for (int i=0;i<t;i++)
{
char x[200];
int move[120];
scanf("%d",&n);
ans=0;
for (int j=0;j<n;j++)
{
scanf("%s",&x);
if (x[0]=='L')
{
move[j]=-1;
ans=ans-1;
}
else if (x[0]=='R')
{
move[j]=1;
ans=ans+1;
}
else if (x[0]=='S')
{
scanf("%*s%d",&a);
move[j]=move[a-1];
ans=ans+move[j];
}
}
printf("%d\n",ans);
}
return 0;
} | [
"43498540+benedicka@users.noreply.github.com"
] | 43498540+benedicka@users.noreply.github.com |
6c0f268091f55d9420b2046149c28e3b2470c7d1 | 6eb2fc380fe3681ce3df7f6c2355f94bb3f52a2d | /2.2 Peptide Encoding Problem/2.2.cpp | 0291c4e798bb329e3897933c587e6ca3870a8226 | [] | no_license | sashawow1234/bioinformatics | bec53f290bf1f9726fb30212808637aaf0b9d981 | f7c4801e5e77a3d3d59078343c02c9ef32da4ec4 | refs/heads/master | 2020-04-13T02:50:26.680691 | 2018-12-24T12:12:50 | 2018-12-24T12:12:50 | 162,913,618 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,902 | cpp | #include <iostream>
#include <string>
#include <map>
using namespace std;
map<string, char> RNACodonTable = {{"AAA", 'K'},
{"AAC", 'N'},
{"AAG", 'K'},
{"AAU", 'N'},
{"ACA", 'T'},
{"ACC", 'T'},
{"ACG", 'T'},
{"ACU", 'T'},
{"AGA", 'R'},
{"AGC", 'S'},
{"AGG", 'R'},
{"AGU", 'S'},
{"AUA", 'I'},
{"AUC", 'I'},
{"AUG", 'M'},
{"AUU", 'I'},
{"CAA", 'Q'},
{"CAC", 'H'},
{"CAG", 'Q'},
{"CAU", 'H'},
{"CCA", 'P'},
{"CCC", 'P'},
{"CCG", 'P'},
{"CCU", 'P'},
{"CGA", 'R'},
{"CGC", 'R'},
{"CGG", 'R'},
{"CGU", 'R'},
{"CUA", 'L'},
{"CUC", 'L'},
{"CUG", 'L'},
{"CUU", 'L'},
{"GAA", 'E'},
{"GAC", 'D'},
{"GAG", 'E'},
{"GAU", 'D'},
{"GCA", 'A'},
{"GCC", 'A'},
{"GCG", 'A'},
{"GCU", 'A'},
{"GGA", 'G'},
{"GGC", 'G'},
{"GGG", 'G'},
{"GGU", 'G'},
{"GUA", 'V'},
{"GUC", 'V'},
{"GUG", 'V'},
{"GUU", 'V'},
{"UAA", ' '},
{"UAC", 'Y'},
{"UAG", ' '},
{"UAU", 'Y'},
{"UCA", 'S'},
{"UCC", 'S'},
{"UCG", 'S'},
{"UCU", 'S'},
{"UGA", ' '},
{"UGC", 'C'},
{"UGG", 'W'},
{"UGU", 'C'},
{"UUA", 'L'},
{"UUC", 'F'},
{"UUG", 'L'},
{"UUU", 'F'}};
string Reverse(string pattern)
{
string reversedString;
for (int i = 0; i < pattern.length(); i++)
{
switch (pattern[i])
{
case 'A':
reversedString = 'T' + reversedString;
break;
case 'C':
reversedString = 'G' + reversedString;
break;
case 'G':
reversedString = 'C' + reversedString;
break;
case 'T':
reversedString = 'A' + reversedString;
break;
}
}
return reversedString;
}
string Translate(string pattern)
{
string peptide;
for (int i = 0; i < pattern.length(); i += 3)
{
peptide += RNACodonTable.at(pattern.substr(i, 3));
}
return peptide;
}
string GetTranscription(string dna)
{
string rna;
for (int i = 0; i < dna.length(); i++)
{
if (dna[i] == 'T')
{
rna.push_back('U');
}
else
{
rna.push_back(dna[i]);
}
}
return rna;
}
int main()
{
string text;
string peptide;
string geneticCode;
cin >> text;
cin >> peptide;
for (int i = 0; i < text.length() - peptide.length() * 3 + 1; i++)
{
string rna = GetTranscription(text.substr(i, peptide.length() * 3));
string reserveRNA = GetTranscription(Reverse(text.substr(i, peptide.length() * 3)));
if (peptide == Translate(rna) || peptide == Translate(reserveRNA))
{
geneticCode += text.substr(i, peptide.length() * 3) + "\n";
}
}
if (!geneticCode.empty())
{
geneticCode.pop_back();
}
cout << geneticCode << endl;
return 0;
}
| [
"sashawow1234@gmail.com"
] | sashawow1234@gmail.com |
e0eeb0ea7a06f21e60761b8c828b3162eef1d629 | f405913222192fdaaadee0fe64940b7bf40266df | /Plugins/SimpleUGC/Source/SimpleUGC/Public/UGCBlueprintLibrary.h | a0ed67c5e9e96dc1c1592a7292d418abaa6340ae | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | InfiniteGamingProductions/AirSim-UGC | e6f96009520a1ae37d3eab4e9726c0179ca35e32 | fc2f2477fe8f0b9f8b707d4357b795d3c8b6e3a1 | refs/heads/main | 2023-05-09T00:49:19.726511 | 2021-06-01T10:23:45 | 2021-06-01T10:23:45 | 359,653,598 | 3 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 516 | h | // Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "Kismet/BlueprintFunctionLibrary.h"
#include "UGCRegistry.h"
#include "UGCBlueprintLibrary.generated.h"
UCLASS()
class SIMPLEUGC_API UUGCBlueprintLibrary : public UBlueprintFunctionLibrary
{
GENERATED_BODY()
public:
// Gets the UGC Registry found in the GameInstance
UFUNCTION(BlueprintPure, Category = "SimpleUGC", meta = (WorldContext = "WorldContextObject"))
static UUGCRegistry * GetUGCRegistry(UObject* WorldContextObject);
};
| [
"31736942+Infin8Gamer1@users.noreply.github.com"
] | 31736942+Infin8Gamer1@users.noreply.github.com |
feed3043cd4aea046ba708515f2cfc65b9ff29b4 | 59dc5d428e102bf72eb7245dbbe7a47a66728378 | /visitpy/visitpy/PyavtDatabaseMetaData.h | 60dc220fd63da6254daf09ea48502bafc34558e1 | [] | no_license | HarinarayanKrishnan/VisIt26RC_Trunk | 6716769694d1a309f994056209171f67e5131642 | 581a0825d81169572b48dd80c1946131c03d0858 | refs/heads/master | 2016-09-06T07:14:00.094983 | 2013-05-15T14:36:48 | 2013-05-15T14:36:48 | 7,009,345 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,591 | h | /*****************************************************************************
*
* Copyright (c) 2000 - 2012, Lawrence Livermore National Security, LLC
* Produced at the Lawrence Livermore National Laboratory
* LLNL-CODE-442911
* All rights reserved.
*
* This file is part of VisIt. For details, see https://visit.llnl.gov/. The
* full copyright notice is contained in the file COPYRIGHT located at the root
* of the VisIt distribution or at http://www.llnl.gov/visit/copyright.html.
*
* 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 disclaimer below.
* - Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the disclaimer (as noted below) in the
* documentation and/or other materials provided with the distribution.
* - Neither the name of the LLNS/LLNL 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 LAWRENCE LIVERMORE NATIONAL SECURITY,
* LLC, THE U.S. DEPARTMENT OF ENERGY 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 PY_AVTDATABASEMETADATA_H
#define PY_AVTDATABASEMETADATA_H
#include <Python.h>
#include <avtDatabaseMetaData.h>
#include <visitpy_exports.h>
//
// Functions exposed to the VisIt module.
//
#define AVTDATABASEMETADATA_NMETH 108
void VISITPY_API PyavtDatabaseMetaData_StartUp(avtDatabaseMetaData *subj, void *data);
void VISITPY_API PyavtDatabaseMetaData_CloseDown();
VISITPY_API PyMethodDef * PyavtDatabaseMetaData_GetMethodTable(int *nMethods);
bool VISITPY_API PyavtDatabaseMetaData_Check(PyObject *obj);
VISITPY_API avtDatabaseMetaData * PyavtDatabaseMetaData_FromPyObject(PyObject *obj);
VISITPY_API PyObject * PyavtDatabaseMetaData_New();
VISITPY_API PyObject * PyavtDatabaseMetaData_Wrap(const avtDatabaseMetaData *attr);
void VISITPY_API PyavtDatabaseMetaData_SetParent(PyObject *obj, PyObject *parent);
void VISITPY_API PyavtDatabaseMetaData_SetDefaults(const avtDatabaseMetaData *atts);
std::string VISITPY_API PyavtDatabaseMetaData_GetLogString();
std::string VISITPY_API PyavtDatabaseMetaData_ToString(const avtDatabaseMetaData *, const char *);
VISITPY_API PyObject * PyavtDatabaseMetaData_getattr(PyObject *self, char *name);
int VISITPY_API PyavtDatabaseMetaData_setattr(PyObject *self, char *name, PyObject *args);
VISITPY_API extern PyMethodDef PyavtDatabaseMetaData_methods[AVTDATABASEMETADATA_NMETH];
#endif
| [
"brugger@18c085ea-50e0-402c-830e-de6fd14e8384"
] | brugger@18c085ea-50e0-402c-830e-de6fd14e8384 |
73294311a632d6d3526636cba24ec2be4ea28477 | 1ef7f309bf775b45ee69e80b9db0d242184c3bc2 | /v3d_main/mozak/terafly/src/control/COperation.cpp | cee11848127423c1fcc4cd13e2c685ce44a6ad12 | [
"MIT"
] | permissive | Vaa3D/v3d_external | 8eebb703b6bc7be5af73597fe0b2972d93e8490f | 5405addd44bba9867eaa7037d6e985cc9ed311e7 | refs/heads/master | 2023-08-17T19:13:40.159258 | 2022-08-22T13:38:11 | 2022-08-22T13:38:11 | 50,527,479 | 43 | 48 | MIT | 2022-10-19T12:29:00 | 2016-01-27T18:12:19 | C++ | UTF-8 | C++ | false | false | 534 | cpp | #include "COperation.h"
int teramanager::ImportOperation::gid = 0;
int teramanager::NewViewerOperation::gid = 0;
int teramanager::RestoreViewerOperation::gid = 0;
int teramanager::AnnotationOperation::gid = 0;
int teramanager::ZoominRoiOperation::gid = 0;
int teramanager::ConverterLoadBlockOperation::gid = 0;
int teramanager::ConverterWriteBlockOperation::gid = 0;
int teramanager::TiffLoadMetadata::gid = 0;
int teramanager::TiffLoadData::gid = 0;
int teramanager::TiffInitData::gid = 0;
int teramanager::TiffAppendData::gid = 0;
| [
"71705889+JazzBrain@users.noreply.github.com"
] | 71705889+JazzBrain@users.noreply.github.com |
1623a09164c0bb23ea03a23a7ab06f6e96d5bba9 | 75a925b7dceb3ecc32b9a056f1d448c8cfc17b95 | /caveofprogramming/basic/Const/src/Const.cpp | 22313ab499badc8633e7281c58d62db3dd70b7f8 | [] | no_license | forresil/cxx_programming | 460238c644ffe18115aa0bf1c4a0d0d11e3d209f | db71a514decf4abc1e91d9d9562f45f1c047462c | refs/heads/master | 2020-08-12T15:36:52.839173 | 2020-01-18T12:05:40 | 2020-01-18T12:05:40 | 214,791,955 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,456 | cpp | //============================================================================
// Name : Const.cpp
// Author : forresil
// Version :
// Copyright : C++ Tutorial for Complete Beginers (Udemy)
// Description : Hello World in C++, Ansi-style
//============================================================================
#include <iostream>
using namespace std;
class Animal
{
private:
string name;
public:
void setName(string name)
{
this->name = name;
}
;
void speak() const // here const prevents Object to be changed!!
{
cout << "My Name is: " << name << endl;
}
};
int main()
{
cout << "Const\n" << endl; // prints Title
const double PI = 3.141592;
cout << PI << endl;
Animal animal;
animal.setName("Freddy");
animal.speak();
// POINTER to CONSTANT
int value = 8;
const int *pValue = &value; //CONST prevents pointer's content to be changed!
cout << *pValue << endl;
//*pValue = 12; //error: assignment of read-only location '* pValue'
cout << *pValue << endl;
// CONSTANT POINTER
int number = 11;
int * const pNumber = &number; //* CONST prevents pointer to be reassigned!
pValue = &number;
cout << *pValue << endl;
//pNumber = &value; //error: assignment of read-only variable 'pNumber'
cout << *pValue << endl;
// CONSTANT POINTER to a CONSTANT
const double * const pConstant = &PI; // Constant pointer to constant integer
cout << "Constant Pointer: " << *pConstant << endl;
return 0;
}
| [
"forresil@gmail.com"
] | forresil@gmail.com |
fafd71ed2b18113fc303a46b6a5b20c2548b5a79 | 71be5a14a1b55e7127b09037fd39c52b6edfe960 | /cpp_basic/15_等号操作符重载.cpp | 197d4a6c0a0aadf9622fc3dfeab417112dff375a | [] | no_license | Allen-Walker/notebook | ec53d2c684772154e2be73c6fa0703772dd235df | bf8004e263a0d375a117e31acf4505185168c76d | refs/heads/master | 2023-06-02T03:09:41.378110 | 2021-06-16T06:46:14 | 2021-06-16T06:46:14 | 176,452,913 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,200 | cpp | #define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <string.h>
using namespace std;
class Person
{
public:
char *m_name; //char m_name[64] //则不用担心深拷贝浅拷贝的问题
int m_sex;
Person()
{
this->m_sex = 0;
this->m_name = NULL;
}
Person(const char *name, int sex)
{
if (name)
{
m_name = (char *)malloc(strlen(name) + 1);
strcpy(m_name, name);
}
m_sex = sex;
}
Person(const Person &another)
{
//深拷贝
m_name = new char[strlen(another.m_name) + 1];
strcpy(m_name, another.m_name);
m_sex = another.m_sex;
}
Person &operator=(const Person &another) //返回值为Person & -- 可以进行连等操作
{
//防止自身赋值
if (this == &another)
return *this;
//回收自身堆中资源
if (this->m_name)
{
delete[] this->m_name;
this->m_sex = 0;
}
// 进行深拷贝
m_name = new char[strlen(another.m_name) + 1];
strcpy(m_name, another.m_name);
m_sex = another.m_sex;
return *this;
}
~Person()
{
if (m_name)
{
delete[] this->m_name;
this->m_name = NULL;
}
}
};
int main(void)
{
return 0;
} | [
"1067406596@qq.com"
] | 1067406596@qq.com |
18b6458dfeca6804d421c5cad5c3aa8605ae4710 | 45afa6a1611e370524dae5966f924cc9a6578ac0 | /src/utils.cpp | 2f0c96274ae52b2da6f902887782103d0036526f | [
"BSD-2-Clause-Patent",
"LicenseRef-scancode-generic-cla"
] | permissive | gorazdko/bytewords-cli | 497c2eb2fb6af1de00500400a9c9b5dade868967 | 48a64adad259b7ec88caf2999bb13f4ae6104833 | refs/heads/master | 2023-04-14T19:51:54.923295 | 2020-12-16T22:06:25 | 2020-12-16T22:06:25 | 364,088,055 | 1 | 0 | null | 2021-05-03T23:31:56 | 2021-05-03T23:31:55 | null | UTF-8 | C++ | false | false | 3,171 | cpp | //
// utils.cpp
//
// Copyright © 2020 by Blockchain Commons, LLC
// Licensed under the "BSD-2-Clause Plus Patent License"
//
#include "utils.hpp"
#include <math.h>
#include <stdexcept>
#include <sstream>
#include <chrono>
#include <array>
#include <bc-bytewords/bc-bytewords.h>
using namespace std;
string data_to_hex(const ByteVector& in) {
auto hex = "0123456789abcdef";
string result;
for(auto c: in) {
result.append(1, hex[(c >> 4) & 0xF]);
result.append(1, hex[c & 0xF]);
}
return result;
}
uint8_t hex_digit_to_bin(char hex) {
if (hex >= '0' && hex <= '9') {
return hex - '0';
} else if (hex >= 'A' && hex <= 'F') {
return hex - 'A' + 10;
} else if (hex >= 'a' && hex <= 'f') {
return hex - 'a' + 10;
} else {
throw runtime_error("Invalid hex digit");
}
}
ByteVector hex_to_data(const string& hex) {
ByteVector result;
auto len = hex.length();
if(len % 2 != 0) {
throw runtime_error("Hex string must have even number of characters.");
}
auto count = len / 2;
result.reserve(count);
for(auto i = 0; i < count; i++) {
auto b1 = hex_digit_to_bin(hex[i * 2]);
auto b2 = hex_digit_to_bin(hex[i * 2 + 1]);
result.push_back((b1 << 4) | b2);
}
return result;
}
string join(const StringVector &strings, const string &separator) {
ostringstream result;
bool first = true;
for(auto s: strings) {
if(!first) {
result << separator;
}
result << s;
first = false;
}
return result.str();
}
string to_upper(const string& s) {
string out;
transform(s.begin(), s.end(), back_inserter(out), ::toupper);
return out;
}
string Bytewords::encode(Style style, const ByteVector& bytes) {
auto a = bytewords_encode(static_cast<bw_style>(style), &bytes[0], bytes.size());
auto s = string(a);
free(a);
return s;
}
ByteVector Bytewords::decode(Style style, const string& string) {
uint8_t* out_buf;
size_t out_len;
auto success = bytewords_decode(static_cast<bw_style>(style), string.c_str(), &out_buf, &out_len);
if(!success) {
throw runtime_error("Invalid Bytewords.");
}
auto result = ByteVector(out_buf, out_buf + out_len);
free(out_buf);
return result;
}
ByteVector string_to_data(const string& s) {
return ByteVector(s.begin(), s.end());
}
string data_to_string(const ByteVector& d) {
return string(d.begin(), d.end());
}
ByteVector read_data_from_stdin() {
// Based on https://stackoverflow.com/a/39758021/2413963
(void)freopen(nullptr, "rb", stdin);
if(ferror(stdin))
throw runtime_error(strerror(errno));
size_t len;
array<char, 1024> buf;
ByteVector result;
while((len = fread(buf.data(), sizeof(buf[0]), buf.size(), stdin)) > 0)
{
if(ferror(stdin) && !feof(stdin))
throw runtime_error(strerror(errno));
result.insert(result.end(), buf.data(), buf.data() + len);
}
return result;
}
void write_data_to_stdout(const ByteVector& data) {
fwrite(data.data(), 1, data.size(), stdout);
}
| [
"wolf@wolfmcnally.com"
] | wolf@wolfmcnally.com |
995e8b08aa42f666ec909f6562add4a392983d6d | 24169ed433d6fb46ee6c00d49a31ee834f517dce | /GFlowSim/src/gflow.hpp | fea7b22712902e7d175d21c7abc9211736609e4e | [] | no_license | nrupprecht/GFlow | 0ae566e33305c31c1fead7834a0b89f611abb715 | 445bf3cbdbcdc68aa51b5737f60d96634009a731 | refs/heads/master | 2021-11-22T22:07:31.721612 | 2020-04-22T18:51:21 | 2020-04-22T18:51:21 | 60,136,842 | 2 | 2 | null | 2020-02-10T23:10:33 | 2016-06-01T01:49:26 | C++ | UTF-8 | C++ | false | false | 14,691 | hpp | #ifndef __GFLOW_HPP__GFLOW__
#define __GFLOW_HPP__GFLOW__
#include "base/base.hpp"
#include "utility/utility.hpp"
#include "other/timedobject.hpp"
// Note to self: Using debuggers in MPI parallel: https://www.open-mpi.org/faq/?category=debugging
// mpirun -np 2 xterm -e lldb ./bin/driver
namespace GFlowSimulation {
//! \brief What mode of running is going on.
//!
//! IDLE means the simulation is not currently running.
//! INIT is the mode for initialization, like relaxing objects.
//! SIM is the mode for actually running a simulation.
enum class RunMode { IDLE, INIT, SIM };
/*
* \brief GFlow
*
* The simulation class.
*
*/
class GFlow {
public:
//! \brief Constructor.
GFlow(int);
//! \brief Destructor.
~GFlow();
//! \brief Initialize - returns true if all pointers are non-null.
bool initialize();
//! \brief Initialize a base object to point at GFlow's data.
void initializeBase(Base*);
//! \brief Run the simulation for some amount of time.
void run(long double=-1);
//! \brief Write data from data master to file.
void writeData(string);
// --- Accessors
//! \brief Whether a SimData has been allocated.
bool hasSimData() { return simData!=nullptr; }
//! \brief Whether an integrator has been allocated.
bool hasIntegrator() { return integrator!=nullptr; }
//! \brief Whether an interaction handler has been allocated.
bool hasHandler() { return handler!=nullptr; }
//! \brief Whether a data master has been allocated.
bool hasDataMaster() { return dataMaster!=nullptr; }
//! \brief Whether a force master has been allocated.
bool hasForceMaster() { return forceMaster!=nullptr; }
//! \brief Get argc
int getArgC() const { return argc; }
//! \brief Get argv
char** getArgV() const { return argv; }
//! \brief Get the requested time.
long double getRequestedTime() const;
//! \brief Get the total amount of time ever requested.
//!
//! Get the total amount of time that has ever been requested of this
//! GFlow object. Time can be requested and run, and then more time can
//! be requested and run, so the most recent amount of requested time is
//! not necessarily the total amount of time ever requested.
long double getTotalRequestedTime() const;
//! \brief Get fulfilled time.
long double getElapsedTime() const;
//! \brief Get all the time the simulation ran for.
long double getTotalTime() const;
//! \brief Get the strength of the boundary force.
real getBoundaryForce() const;
//! \brief Get the energy associated with the domain.
real getBoundaryEnergy() const;
//! \brief Get the current time step.
real getDT() const;
//! \brief Get the iteration.
long int getIter() const;
//! \brief Get the number of forces
int getNumInteractions() const;
//! \brief Get the number of particles
int getNumParticles() const;
//! \brief Get the bounds - mutating version.
Bounds& getBounds();
//! \brief Get the bounds - const version.
const Bounds& getBounds() const;
//! \brief Get the boundary conditions
const BCFlag* getBCs() const;
//! \brief Get a single boundary condition
BCFlag getBC(int) const;
//! \brief Get the number of types of particles in the simulation
int getNTypes() const;
//! \brief Get the dimensionality of the simulation.
int getSimDimensions() const;
//! \brief Get the use forces flag.
bool getUseForces() const;
//! \brief Get the command line arguments.
pair<int, char**> getCommand() const;
//! \brief Get the vector of nonbonded interactions.
const vector<shared_ptr<class Interaction> >& getInteractions() const;
//! \brief Get the vector of bonded interactions.
const vector<shared_ptr<class Bonded> >& getBondedInteractions() const;
//! \brief Get the sim data object.
shared_ptr<class SimData> getSimData();
//! \brief Get the data master object.
class DataMaster* getDataMaster();
//! \brief Get the force master object.
class ForceMaster* getForceMaster() ;
//! \brief Get the integrator.
class Integrator* getIntegrator();
//! \brief Get the topology.
class Topology* getTopology();
//! \brief Get the interaction handler.
class InteractionHandler* getInteractionHandler();
//! \brief Get the number of integrators that gflow has.
int getNumIntegrators() const;
//! \brief Get the minimum image displacement between two positions.
void getDisplacement(const real*, const real*, real*);
//! \brief Get the minimum image of a displacement vector.
void minimumImage(real*);
//! \brief Get the minimum image distance of a single component.
void minimumImage(real&, int);
//! \brief Get the minimum image distance between two positions.
real getDistance(const real*, const real*);
//! \brief Get the minimum image distance squared between two positions.
real getDistanceSqr(const real*, const real*);
//! \brief Get the run mode of the simulation.
RunMode getRunMode();
// --- Mutators
//! \brief Add an interaction.
//!
//! GFlow only adds the interaction if it is non null.
void addInteraction(shared_ptr<Interaction>);
//! \brief Add a bonded interaction.
void addBonded(shared_ptr<class Bonded>);
//! \brief Add a body.
void addBody(shared_ptr<class Body>);
//! \brief Add another integrator.
void addIntegrator(shared_ptr<class Integrator>);
//! \brief Set the command info
void setCommand(int, char**);
//! \brief Set all wrap values to the same value.
void setAllBCs(BCFlag);
//! \brief Set a single boundary condition.
void setBC(const int, const BCFlag);
//! \brief Set the use forces flag.
void setUseForces(bool);
//! \brief Set the simulation bounds.
void setBounds(const Bounds&);
//! \brief Set the repulsion stength for repulsing boundary conditions.
void setRepulsion(real);
//! \brief Set the dissipation stength for repulsing boundary conditions.
void setDissipation(real);
//! \brief Set the attraction acceleration.
void setAttraction(real);
//! \brief Set the print updates flag.
void setPrintUpdates(bool);
//! \brief Set the update printing interval.
void setUpdateInterval(real);
//! \brief Set the run mode.
void setRunMode(RunMode);
//! \brief Set the amount of time we should run for.
void requestTime(real);
//! \brief Set the elapsed time.
void setElapsedTime(real);
//! \brief Keep positions in bounds.
void wrapPositions();
//! \brief "Reflect" positions off the bounds.
void reflectPositions();
//! \brief Apply a force to keep particles in bounds.
void repulsePositions();
//! \brief Apply a harmonic force to keep particles attracted to the center of the simulation
void attractPositions();
//! \brief Instructs the interaction handler to remove particles that are overlapping by more than some fraction.
void removeOverlapping(real);
//! \brief Add a data object.
void addDataObject(shared_ptr<class DataObject>);
//! \brief Add a modifier object.
void addModifier(shared_ptr<class Modifier>);
//! \brief Reset all timers (use e.g. after doing relaxation of a random initial state).
void resetAllTimes();
//! \brief Set the start recording time.
void setStartRecTime(real);
//! \brief Set the frames per second for all data objects.
void setFPS(real);
//! \brief Set the fps of particular data objects.
void setFPS(int, real);
//! \brief Set the time step.
void setDT(real);
//! \brief Set the max timestep.
void setMaxDT(real);
//! \brief Set data master command line data.
void setDMCmd(int, char**);
//! \brief Give a file to datamaster. The datamaster can then write this file out as part of a run summary.
//!
//! This is used to record what the setup file was.
void giveFileToDataMaster(string, string);
//! \brief Get the boltzmann constant.
real getKB() { return KB; }
//! \brief Start the mpi timer.
void startMPIExchangeTimer();
//! \brief Stop the mpi timer.
void stopMPIExchangeTimer();
//! \brief Start the mpi timer.
void startMPIGhostTimer();
//! \brief Stop the mpi timer.
void stopMPIGhostTimer();
//! \brief Sync running flag among all processors.
void syncRunning();
/// --- Flags
bool& simulation_running() { return _running; }
bool& simdata_needs_remake() { return _simdata_needs_remake; }
bool& simdata_remade() { return _simdata_remade; }
bool& handler_needs_remake() { return _handler_needs_remake; }
bool& handler_remade() { return _handler_remade; }
//! \brief Return the use ghosts flag. Only getting.
bool use_ghosts() const { return _use_ghosts; }
//! \brief Set the terminate flag to true.
void terminate();
//! \brief Tell gflow that an exception has occured.
void registerException(Exception*);
// Creators are a friend classes --- all must be since friendship is not inherited
friend class Creator;
friend class BoxCreator;
friend class BondBoxCreator;
friend class BipartiteBoxCreator;
friend class DebugCreator;
friend class FlowCreator;
friend class FileParseCreator;
friend class LineCrystalCreator;
friend class PolymerCreator;
friend class FillAreaCreator;
// Other friend classes
friend class ForceMaster;
friend class DataMaster;
friend class DataObject;
//friend class Base;
protected:
// --- Private helper functions
//! Clear all the force arrays.
inline void clearForces();
//! \brief Check whether any modifiers need to be removed.
inline void handleModifiers();
// --- Data - public so anyone can access it
shared_ptr<class SimData> simData;
class Integrator *integrator = nullptr; // Integrator
class InteractionHandler *handler = nullptr;
class DataMaster *dataMaster = nullptr; // DataMaster object for unified data collection
class ForceMaster *forceMaster = nullptr; // ForceMaster object for defining and storing interparticle forces
class Topology *topology = nullptr; // Processor topology
//! \brief Additional integrators. \todo Do this better.
vector<shared_ptr<class Integrator> > additional_integrators;
//! \brief A vector of objects that should modify the simulation at some point(s) during execution.
std::list<shared_ptr<class Modifier> > modifiers;
//! \brief All the short range, non-bonded, forces that can happen - which ones correspond to which pairs of particles is controlled by
// the ForceMaster object.
vector<shared_ptr<class Interaction> > interactions;
//! \brief All the bonded forces that can happen.
vector<shared_ptr<class Bonded> > bondedInteractions;
//! \brief All the bodies in the simulation.
vector<shared_ptr<class Body> > bodies;
//! \brief A vector of pointers to all objects that inherit from group, and might need to have global ids modified.
vector<shared_ptr<class Group> > global_id_reliant;
//! \brief How much time we have been requested to run for.
long double requested_time = 0.;
//! \brief How much time has ever been requested.
long double total_requested_time = 0.;
//! \brief How much of the requested time has been run.
long double elapsed_time = 0.;
//! \brief How much time has been run over all runs.
long double total_time = 0.;
//! \brief The number of iterations that have passed.
long int iter = 0;
//! \brief The simulation bounds.
Bounds simulation_bounds;
//! \brief Boundary types.
BCFlag *boundaryConditions = nullptr;
//! \brief The number of dimensions
int sim_dimensions;
//! \brief Strength of boundary repulsion forces.
real repulsion = 500.f;
//! \brief Dissipation for the boundary repulsion forces.
real dissipation = 0.f;
//! \brief The attraction towards the center of the simulation
real center_attraction = 0.f;
//! \brief Total boundary force applied this iteration.
real boundaryForce = 0.f;
//! \brief Energy due to e.g. particles being repulsed by a boundary potential.
real boundaryEnergy = 0.f;
// The command info (optional)
int argc = 0;
char **argv = nullptr;
// Timing
//! \brief Timer used to time how long the bonded interactions take.
TimedObject bonded_timer;
//! \brief Timer used to time how long the body execution takes.
TimedObject body_timer;
//! \brief Timer used to time how long the simulation took running modifiers.
TimedObject modifier_timer;
//! \brief Timer used to time how much time mpi particle exchange operations take up. This timer should be started and stopped
//! by classes invoking MPI.
TimedObject mpi_exchange_timer;
//! \brief Timer used to time how much time mpi ghost syncronization operations take up. This timer should be started and stopped
//! by classes invoking MPI.
TimedObject mpi_ghost_timer;
//! \brief Whether to print updates to a screen.
bool print_updates = false;
//! \brief The ostream with which to print updates.
std::ostream *monitor = &cout;
//! \brief At what intervals to print updates (in simulation seconds).
real update_interval = 250.;
//! \brief The run mode of the simulation.
RunMode runMode = RunMode::IDLE;
// --- Flags
//! \brief If true, this processor has called for the simulation to terminate.
bool _terminate = false;
//! \brief If true, the simulation should continue to run.
bool _running = false;
//! \brief If true, do tasks related to force computation.
bool _use_forces = true;
//! \brief If true, and using mpi, create ghost particles.
bool _use_ghosts = true;
//! \brief A list of "exception" that have been raised.
vector<Exception*> error_handling;
bool _simdata_needs_remake = false;
bool _simdata_remade = false;
bool _handler_needs_remake = false;
bool _handler_remade = false;
//! \brief The time at which terminate() was called.
long double termination_time = -1;
// --- Physical constants. These are static, since they should be the same for all objects
//! \brief Boltzmann constant.
real KB = 1.;
};
}
#endif // __GFLOW_HPP__GFLOW__
| [
"nathaniel.rupprecht@gmail.com"
] | nathaniel.rupprecht@gmail.com |
90bba384de75557f31a5b81ef4f9e50b9c0c6862 | 7edb6356b505d585a9019401375dde82963395fa | /Classes/Fisrt.cpp | c6a116b0a77c2a4f4abfd351a1ef4aca8ebe9eea | [
"MIT"
] | permissive | kimikimi911/growup | f989d1bf920d43aff33b44440a14550e884ab11b | 5459b32dd20a741d9add80bcfb41a068b05c7aaa | refs/heads/master | 2021-01-10T08:21:56.576236 | 2016-02-02T09:13:26 | 2016-02-02T09:13:26 | 50,903,943 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 15,714 | cpp | #include "First.h"
#include "GameMain.h"
#include "Music.h"
//#include "GamePause.h"
#include "GameOver.h"
#include "GameNext.h"
USING_NS_CC;
Scene * First::createScene()
{
auto scene = Scene::create();
// 'layer' is an autorelease object
auto layer = First::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 First::init()
{
//////////////////////////////
// 1. super init first
if (!Scene::init())
{
return false;
}
visibleSize = Director::getInstance()->getVisibleSize();
origin = Director::getInstance()->getVisibleOrigin();
/////////////////////////////
//背景图片
Sprite *spriteBGbottom = Sprite::create("first/home_bg1.png");
spriteBGbottom->setAnchorPoint(Vec2(0.5,0.5));
spriteBGbottom->setPosition(visibleSize.width/2, visibleSize.height/2);
this->addChild(spriteBGbottom,-2);
//图标
Sprite *spriteTitle = Sprite::create("first/title.png");
spriteTitle->setAnchorPoint(Vec2(0.5,0.5));
spriteTitle->setPosition(visibleSize.width/2, 1650);
this->addChild(spriteTitle,-2);
//判断出现哪个图标
for(int i=1;i<=12;i++)
{
cocos2d::__String* level_stat = String::createWithFormat("game_round_stat%d",i);
if( UserDefault::getInstance()->getIntegerForKey(level_stat->getCString()))
{
std::string ee;
if (UserDefault::getInstance()->getIntegerForKey(level_stat->getCString())== 1) {
ee = "ready";
}else if(UserDefault::getInstance()->getIntegerForKey(level_stat->getCString())== 2)
{
ee = "done";
}else if(UserDefault::getInstance()->getIntegerForKey(level_stat->getCString())== 0)
{
ee = "no";
}
level_icon_show.insert(std::make_pair(Value(i).asString(),Value(ee)));
}else{
level_icon_show.insert(std::make_pair(Value(i).asString(),Value("no")));
}
}
int big_radis = 420;
int big_radis_sin30 = 210;
int big_radis_cos30 = 364;//这里自己算好,就取整了
int center_x = 540;
int center_y = 700;
auto start1Item = MenuItemImage::create(
"first/le1_" + level_icon_show.at(Value(1).asString()).asString() + ".png",
"first/le1_" + level_icon_show.at(Value(1).asString()).asString() + ".png",
CC_CALLBACK_1(First::menuStartCallback, this, 1));
start1Item->setPosition(Vec2(center_x,center_y+big_radis));
auto start2Item = MenuItemImage::create(
"first/le2_" + level_icon_show.at(Value(2).asString()).asString() + ".png",
"first/le2_" + level_icon_show.at(Value(2).asString()).asString() + ".png",
CC_CALLBACK_1(First::menuStartCallback, this,2));
start2Item->setPosition(Vec2(center_x+big_radis_sin30,center_y+big_radis_cos30));
auto start3Item = MenuItemImage::create(
"first/le3_" + level_icon_show.at(Value(3).asString()).asString() + ".png",
"first/le3_" + level_icon_show.at(Value(3).asString()).asString() + ".png",
CC_CALLBACK_1(First::menuStartCallback, this,3));
start3Item->setPosition(Vec2(center_x+big_radis_cos30,center_y+big_radis_sin30));
auto start4Item = MenuItemImage::create(
"first/le4_" + level_icon_show.at(Value(4).asString()).asString() + ".png",
"first/le4_" + level_icon_show.at(Value(4).asString()).asString() + ".png",
CC_CALLBACK_1(First::menuStartCallback, this,4));
start4Item->setPosition(Vec2(center_x+big_radis,center_y));
auto start5Item = MenuItemImage::create(
"first/le5_" + level_icon_show.at(Value(5).asString()).asString() + ".png",
"first/le5_" + level_icon_show.at(Value(5).asString()).asString() + ".png",
CC_CALLBACK_1(First::menuStartCallback, this,5));
start5Item->setPosition(Vec2(center_x+big_radis_cos30,center_y-big_radis_sin30));
auto start6Item = MenuItemImage::create(
"first/le6_" + level_icon_show.at(Value(6).asString()).asString() + ".png",
"first/le6_" + level_icon_show.at(Value(6).asString()).asString() + ".png",
CC_CALLBACK_1(First::menuStartCallback, this,6));
start6Item->setPosition(Vec2(center_x+big_radis_sin30,center_y-big_radis_cos30));
auto start7Item = MenuItemImage::create(
"first/le7_" + level_icon_show.at(Value(7).asString()).asString() + ".png",
"first/le7_" + level_icon_show.at(Value(7).asString()).asString() + ".png",
CC_CALLBACK_1(First::menuStartCallback, this,7));
start7Item->setPosition(Vec2(center_x,center_y-big_radis));
auto start8Item = MenuItemImage::create(
"first/le8_" + level_icon_show.at(Value(8).asString()).asString() + ".png",
"first/le8_" + level_icon_show.at(Value(8).asString()).asString() + ".png",
CC_CALLBACK_1(First::menuStartCallback, this,8));
start8Item->setPosition(Vec2(center_x-big_radis_sin30,center_y-big_radis_cos30));
auto start9Item = MenuItemImage::create(
"first/le9_" + level_icon_show.at(Value(9).asString()).asString() + ".png",
"first/le9_" + level_icon_show.at(Value(9).asString()).asString() + ".png",
CC_CALLBACK_1(First::menuStartCallback, this,9));
start9Item->setPosition(Vec2(center_x-big_radis_cos30,center_y-big_radis_sin30));
auto start10Item = MenuItemImage::create(
"first/le10_" + level_icon_show.at(Value(10).asString()).asString() + ".png",
"first/le10_" + level_icon_show.at(Value(10).asString()).asString() + ".png",
CC_CALLBACK_1(First::menuStartCallback, this,10));
start10Item->setPosition(Vec2(center_x-big_radis,center_y));
auto start11Item = MenuItemImage::create(
"first/le11_" + level_icon_show.at(Value(11).asString()).asString() + ".png",
"first/le11_" + level_icon_show.at(Value(11).asString()).asString() + ".png",
CC_CALLBACK_1(First::menuStartCallback, this,11));
start11Item->setPosition(Vec2(center_x-big_radis_cos30,center_y+big_radis_sin30));
auto start12Item = MenuItemImage::create(
"first/le12_" + level_icon_show.at(Value(12).asString()).asString() + ".png",
"first/le12_" + level_icon_show.at(Value(12).asString()).asString() + ".png",
CC_CALLBACK_1(First::menuStartCallback, this,12));
start12Item->setPosition(Vec2(center_x-big_radis_sin30,center_y+big_radis_cos30));
auto createbuttonItem = MenuItemImage::create(
"first/create.png",
"first/create.png",
CC_CALLBACK_1(First::menucreatebuttonCallback, this));
createbuttonItem->setPosition(Vec2(center_x,center_y));
auto menu = Menu::create(start1Item, start2Item, start3Item,start4Item,start5Item,start6Item,start7Item,start8Item,start9Item,start10Item,start11Item,start12Item,createbuttonItem,NULL);
menu->setPosition(Vec2::ZERO);
this->addChild(menu, -1);
//if(UserDefault::getInstance()->getBoolForKey("onMusic")==true){
// Music::loadMusic();
// Music::playGameLayerMusic();
//}
/*
//开始按钮
auto startItem = MenuItemImage::create(
"setting/start.png",
"setting/start.png",
CC_CALLBACK_1(Choose::menuStartCallback, this));
startItem->setPosition(Vec2(origin.x + visibleSize.width/2-200 ,
origin.y + visibleSize.height/2+200));
//gamecenter按钮
auto gameCenterItem = MenuItemImage::create(
"setting/gamecenter.png",
"setting/gamecenter.png",
CC_CALLBACK_1(Choose::menuGamecenterCallback, this));
gameCenterItem->setPosition(Vec2(origin.x + visibleSize.width-185 ,
origin.y + 215));
//宝贝界面按钮
auto babyItem = MenuItemImage::create(
"setting/baby.png",
"setting/baby.png",
CC_CALLBACK_1(Choose::menuBabyCallback, this));
babyItem->setPosition(Vec2(origin.x + visibleSize.width/2+200 ,
origin.y + visibleSize.height/2-300));
//去除广告按钮
auto adItem = MenuItemImage::create(
"setting/noad.png",
"setting/noad.png",
CC_CALLBACK_1(Choose::menuAdCallback, this));
adItem->setPosition(Vec2(origin.x + 170 ,
origin.y + visibleSize.height-200));
//分享按钮
auto shareItem = MenuItemImage::create(
"setting/share.png",
"setting/share.png",
CC_CALLBACK_1(Choose::menuShareCallback, this));
shareItem->setPosition(Vec2(origin.x + 185 ,
origin.y + 215));
//评价按钮
auto commentItem = MenuItemImage::create(
"setting/comment.png",
"setting/comment.png",
CC_CALLBACK_1(Choose::menuCommentCallback, this));
commentItem->setPosition(Vec2(origin.x + visibleSize.width/2 ,
origin.y + 215));
auto menu = Menu::create(startItem, gameCenterItem, babyItem, adItem, shareItem, commentItem, NULL);
menu->setPosition(Vec2::ZERO);
this->addChild(menu, 1);
auto music_pic = "";
if(UserDefault::getInstance()->getBoolForKey("onMusic"))
{
music_pic = "setting/music.png";
}else{
//UserDefault::getInstance()->setBoolForKey("onMusic",true);
//UserDefault::getInstance()->flush();
music_pic = "setting/nomusic.png";
}
//去除音乐按钮
auto musicItem = MenuItemImage::create(
music_pic,
music_pic,
CC_CALLBACK_1(Choose::menuMusicCallback, this));
musicItem->setPosition(Vec2(origin.x + visibleSize.width-170 ,
origin.y + visibleSize.height-200));
menu_music = Menu::create(musicItem, NULL);
menu_music->setPosition(Vec2::ZERO);
this->addChild(menu_music, 1);
*/
return true;
}
//void First::menuStartCallback(Ref* pSender)
void First::menuStartCallback(Ref* pSender,int num)
{
UserDefault::getInstance()->setIntegerForKey("game_round", num);
Director::getInstance()->replaceScene(GameMain::createScene());
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
//exit(0);
#endif
}
void First::menucreatebuttonCallback(Ref* pSender)
{
//Director::getInstance()->replaceScene(HelloWorld::createScene());
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
//exit(0);
#endif
}
/*
void First::menuBabyCallback(Ref* pSender)
{
Director::getInstance()->replaceScene(Baby::create());
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
//exit(0);
#endif
}
void First::menuAdCallback(Ref* pSender)
{
Director::getInstance()->replaceScene(HelloWorld::createScene());
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
//exit(0);
#endif
}
void First::menuMusicCallback(Ref* pSender)
{
if(UserDefault::getInstance()->getBoolForKey("onMusic"))
{
UserDefault::getInstance()->setBoolForKey("onMusic",false);
log("123456789");
Music::stopBackgroundMusic();
}else{
UserDefault::getInstance()->setBoolForKey("onMusic",true);
Music::loadMusic();
Music::playGameLayerMusic();
}
//UserDefault::getInstance()->flush();
this->removeChild(menu_music);
//重新显示音乐按钮
auto music_pic = "";
log("%d", UserDefault::getInstance()->getBoolForKey("onMusic"));
//UserDefault::getInstance()->setBoolForKey("onMusic",true);
//UserDefault::getInstance()->flush();
log("%d", UserDefault::getInstance()->getBoolForKey("onMusic"));
if(UserDefault::getInstance()->getBoolForKey("onMusic"))
{
music_pic = "setting/music.png";
log("1----");
}else{
music_pic = "setting/nomusic.png";
log("2----");
}
auto musicItem = MenuItemImage::create(
music_pic,
music_pic,
CC_CALLBACK_1(Choose::menuMusicCallback, this));
musicItem->setPosition(Vec2(origin.x + visibleSize.width-170 ,
origin.y + visibleSize.height-200));
menu_music = Menu::create(musicItem, NULL);
menu_music->setPosition(Vec2::ZERO);
this->addChild(menu_music, 1);
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
//exit(0);
#endif
}
void First::menuShareCallback(Ref* pSender)
{
Director::getInstance()->replaceScene(HelloWorld::createScene());
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
//exit(0);
#endif
}
void First::menuCommentCallback(Ref* pSender)
{
Director::getInstance()->replaceScene(HelloWorld::createScene());
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
//exit(0);
#endif
}
*/
| [
"iversonkimi@126.com"
] | iversonkimi@126.com |
07de4bea70575792eeb5f9606cf91d849f613bf8 | c8abb7c0a610348eb0b8474ce66463584ec5bc98 | /Public/Src/Sandbox/Linux/UnitTests/realpath.cpp | 550b28855938f41c9ce991b31c369ee4b7f998a2 | [
"MIT"
] | permissive | microsoft/BuildXL | d31b74ba23057dd251bcd9040390a7e751f04fae | f884dd1e34ed50f76d27d3fb1b8679235995653d | refs/heads/main | 2023-08-31T21:19:44.385093 | 2023-08-30T23:36:57 | 2023-08-30T23:36:57 | 152,813,045 | 436 | 114 | MIT | 2023-09-13T09:49:08 | 2018-10-12T22:16:45 | C# | UTF-8 | C++ | false | false | 1,623 | cpp | // Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
#define BOOST_TEST_MODULE LinuxSandboxTest
#define _DO_NOT_EXPORT
#include <boost/test/included/unit_test.hpp>
#include <limits.h>
#include <string.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
using namespace std;
BOOST_AUTO_TEST_SUITE(RealPath)
BOOST_AUTO_TEST_CASE(TestRealPathAccesses)
{
// .
// {root}
// `-- symlink1 [->real1]
// `-- real1
// `-- symlink2 [->real2]
// `-- real2
// `-- file.txt
// `-- symlink4.txt [-> real3]
// `-- real3.txt
// `-- symlink3 [->real2]
char buf[PATH_MAX];
// Should report access on intermediates symink1 and symlink2
char* res = realpath("symlink1/symlink2/file.txt", buf);
BOOST_CHECK(res);
// Sanity check path was fully resolved
BOOST_CHECK(strstr(res, "symlink") == nullptr);
BOOST_CHECK(strstr(res, "real2/file.txt"));
// Check that if the full path is a symlink we report it too
// Should report access on symink3
res = realpath("real2/symlink4.txt", buf);
BOOST_CHECK(res);
BOOST_CHECK(strstr(res, "symlink") == nullptr);
BOOST_CHECK(strstr(res, "real3.txt"));
// Access a non-existent path through symlinks
// Even though the call fails, the intermediate symlink should be reported
res = realpath("symlink3/nonexistentfile.txt", buf);
int err = errno;
BOOST_CHECK(res == nullptr);
BOOST_CHECK_EQUAL(err, ENOENT);
}
BOOST_AUTO_TEST_SUITE_END() | [
"maly@microsoft.com"
] | maly@microsoft.com |
13dafbb64fddf90e60a809a10754ce40bf081a36 | d40a652e89ffe2ef70a35089da6708a7ab2dbc2c | /Gaia/Core/Scene.h | 4b1e5602004f68a54e573231eafc8a65ca4376e3 | [
"MIT"
] | permissive | tim0901/Gaia | 94841b7008940d4bf1946c4edfe2c57c80ad844a | 896e606e48057b98f571ac8798974807fa0374f8 | refs/heads/master | 2022-12-18T10:21:16.828421 | 2022-12-02T04:13:14 | 2022-12-02T04:13:14 | 159,555,348 | 1 | 0 | MIT | 2020-03-15T22:51:35 | 2018-11-28T19:40:34 | C++ | UTF-8 | C++ | false | false | 3,731 | h | #ifndef SCENE_H
#define SCENE_H
#include "Camera.h"
#include "../Objects/Object.h"
#include "../Materials/Material.h"
#include "Light.h"
#include "../Accelerators/BVH.h"
#include "../Maths/random.h"
// A scene containing a camera, a list of objects and the materials they use
class Scene{
public:
Scene() {}
~Scene() {
// Delete each material stored in the array
for (int i = 0; i < materialList.size(); i++) {
delete materialList[i];
}
materialList.clear();
// Delete each light stored in the array
for (int i = 0; i < lightList.size(); i++) {
delete lightList[i];
}
lightList.clear();
// Delete each mesh
for (int i = 0; i < meshList.size(); i++) {
delete meshList[i];
}
meshList.clear();
}
bool Intersect(Ray r, IntersectionRecord& rec, double tMin = 0.001, double tMax = DBL_MAX) const {
return sceneBVH->Intersect(r, rec, tMin, tMax);
//return objectList.Intersect(r, rec, tMin, tMax);
}
// Return the transmittance between two points - for now this is a binary value based
// solely on the geometry of the
Vec3d TransmittanceBetween(const Vec3d& p1, const Vec3d& p2) const;
// Insert a material into the list
template <typename T>
void InsertMaterial(const T& mat) {
materialList.push_back(new T(mat));
}
Material* FindMaterial(const std::string materialName) const {
for (int i = 0; i < materialList.size(); i++) {
if (materialList[i]->name == materialName) {
return materialList[i];
}
}
std::cout << "No material found with name: " << materialName << "\n";
return nullptr;
}
// Add an object to the scene
template<typename T>
void InsertObject(const T& obj) {
objectList.InsertObject(obj);
}
template<typename T>
void InsertObject(const std::shared_ptr<T>& obj) {
objectList.InsertObject(obj);
}
// Add a light to the scene
template<typename T>
void InsertLight(const T& light) {
lightList.push_back(light);
}
void BuildLightSampler() {
lightDistribution = std::uniform_int_distribution<int>(0, lightList.size() - 1);
}
// Add an area light to the scene
// This method ensures the light and geometry are linked properly
template <typename T>
void InsertAreaLight(const T& light) {
lightList.push_back(new T(light));
lightList.back()->ReturnAttachedObject()->AttachLight(lightList.back());
}
template<typename T>
void InsertAreaLight(const T& obj, const Vec3d& lum) {
this->InsertObject(obj);
this->InsertAreaLight(AreaLight(this->objectList.list->back(), lum));
}
template<typename T>
void InsertAreaLight(const std::shared_ptr<T>& obj, const Vec3d& lum) {
this->InsertObject(obj);
this->InsertAreaLight(AreaLight(this->objectList.list->back(), lum));
}
Light* ChooseLight() {
// Choose a light to sample
//This is a naive implementation - we simply pick a random light from the list
return lightList[lightDistribution(rng.rng)];
}
// Load a mesh from file, create a BVH and add it to the scene
void LoadMesh(const std::string file, const Vec3d& location, std::vector<Material*> mats, const float& scale = 1.0f, const int& refinementLevel = 0) {
Mesh* mesh = new Mesh(file, location, mats, scale, refinementLevel);
this->InsertObject(std::make_shared<BVH>(mesh->tris));
meshList.push_back(mesh);
}
// Encapsulate the entire scene in a BVH
void GenerateSceneBVH() {
sceneBVH = std::make_unique<BVH>(objectList.list);
}
int xDim = 0;
int yDim = 0;
int samples = 0;
Camera camera;
ObjectList objectList;
std::unique_ptr<BVH> sceneBVH;
std::vector<Mesh*> meshList;
std::vector<Light*> lightList;
std::vector<Material*> materialList;
std::string fileName = "UntitledRender";
std::uniform_int_distribution<int> lightDistribution;
};
#endif // !SCENE_H
| [
"alexander1.richardson@gmail.com"
] | alexander1.richardson@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.