blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 3 264 | content_id stringlengths 40 40 | detected_licenses listlengths 0 85 | license_type stringclasses 2
values | repo_name stringlengths 5 140 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringclasses 986
values | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 3.89k 681M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 23
values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 145
values | src_encoding stringclasses 34
values | language stringclasses 1
value | is_vendor bool 1
class | is_generated bool 2
classes | length_bytes int64 3 10.4M | extension stringclasses 122
values | content stringlengths 3 10.4M | authors listlengths 1 1 | author_id stringlengths 0 158 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
64d3d9d35ff0f94faac2ebc25f085b7e256f0370 | 5a626c23ff07d12da01fd7bf045ee6ba0e54247d | /Dummy_client/2019-Dummy/DrawModule.cpp | ae46592b6c3256c4a70d0e87959e155c11ddee2b | [] | no_license | snrn2426/MMORPG_prototype | eab98a0cffe213448ef0da8f580f940b02f47f0a | 0091c027eb5937f8c68587b3a50f615a50704f3b | refs/heads/main | 2023-06-07T14:15:34.953342 | 2021-07-05T06:48:24 | 2021-07-05T06:48:24 | 364,250,608 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 17,954 | cpp | /*
* This Code Was Created By Jeff Molofee 2000
* Modified by Shawn T. to handle (%3.2f, num) parameters.
* A HUGE Thanks To Fredric Echols For Cleaning Up
* And Optimizing The Base Code, Making It More Flexible!
* If You've Found This Code Useful, Please Let Me Know.
* Visit My Site At nehe.gamedev.net
*/
#include <windows.h> // Header File For Windows
#include <math.h> // Header File For Windows Math Library
#include <stdio.h> // Header File For Standard Input/Output
#include <stdarg.h> // Header File For Variable Argument Routines
#include <gl\gl.h> // Header File For The OpenGL32 Library
#include <gl\glu.h> // Header File For The GLu32 Library
//#include <gl\glaux.h> // Header File For The Glaux Library
#pragma comment (lib, "opengl32.lib")
#pragma comment (lib, "glu32.lib")
#include "NetworkModule.h"
HDC hDC = NULL; // Private GDI Device Context
HGLRC hRC = NULL; // Permanent Rendering Context
HWND hWnd = NULL; // Holds Our Window Handle
HINSTANCE hInstance; // Holds The Instance Of The Application
GLuint base; // Base Display List For The Font Set
GLfloat cnt1; // 1st Counter Used To Move Text & For Coloring
GLfloat cnt2; // 2nd Counter Used To Move Text & For Coloring
bool keys[256]; // Array Used For The Keyboard Routine
bool active = TRUE; // Window Active Flag Set To TRUE By Default
bool fullscreen = TRUE; // Fullscreen Flag Set To Fullscreen Mode By Default
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); // Declaration For WndProc
GLvoid BuildFont(GLvoid) // Build Our Bitmap Font
{
HFONT font; // Windows Font ID
HFONT oldfont; // Used For Good House Keeping
base = glGenLists(96); // Storage For 96 Characters
font = CreateFont(-24, // Height Of Font
0, // Width Of Font
0, // Angle Of Escapement
0, // Orientation Angle
FW_BOLD, // Font Weight
FALSE, // Italic
FALSE, // Underline
FALSE, // Strikeout
ANSI_CHARSET, // Character Set Identifier
OUT_TT_PRECIS, // Output Precision
CLIP_DEFAULT_PRECIS, // Clipping Precision
ANTIALIASED_QUALITY, // Output Quality
FF_DONTCARE | DEFAULT_PITCH, // Family And Pitch
L"Courier New"); // Font Name
oldfont = (HFONT)SelectObject(hDC, font); // Selects The Font We Want
wglUseFontBitmaps(hDC, 32, 96, base); // Builds 96 Characters Starting At Character 32
SelectObject(hDC, oldfont); // Selects The Font We Want
DeleteObject(font); // Delete The Font
}
GLvoid KillFont(GLvoid) // Delete The Font List
{
glDeleteLists(base, 96); // Delete All 96 Characters
}
GLvoid glPrint(const char *fmt, ...) // Custom GL "Print" Routine
{
char text[256]; // Holds Our String
va_list ap; // Pointer To List Of Arguments
if (fmt == NULL) // If There's No Text
return; // Do Nothing
va_start(ap, fmt); // Parses The String For Variables
vsprintf_s(text, fmt, ap); // And Converts Symbols To Actual Numbers
va_end(ap); // Results Are Stored In Text
glPushAttrib(GL_LIST_BIT); // Pushes The Display List Bits
glListBase(base - 32); // Sets The Base Character to 32
glCallLists(strlen(text), GL_UNSIGNED_BYTE, text); // Draws The Display List Text
glPopAttrib(); // Pops The Display List Bits
}
GLvoid ReSizeGLScene(GLsizei width, GLsizei height) // Resize And Initialize The GL Window
{
if (height == 0) // Prevent A Divide By Zero By
{
height = 1; // Making Height Equal One
}
glViewport(0, 0, width, height); // Reset The Current Viewport
glMatrixMode(GL_PROJECTION); // Select The Projection Matrix
glLoadIdentity(); // Reset The Projection Matrix
// Calculate The Aspect Ratio Of The Window
gluPerspective(45.0f, (GLfloat)width / (GLfloat)height, 0.1f, 100.0f);
glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix
glLoadIdentity(); // Reset The Modelview Matrix
glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix
glLoadIdentity(); // Reset The Modelview Matrix
}
int InitGL(GLvoid) // All Setup For OpenGL Goes Here
{
glShadeModel(GL_SMOOTH); // Enable Smooth Shading
glClearColor(0.0f, 0.0f, 0.0f, 0.5f); // Black Background
glClearDepth(1.0f); // Depth Buffer Setup
glEnable(GL_DEPTH_TEST); // Enables Depth Testing
glDepthFunc(GL_LEQUAL); // The Type Of Depth Testing To Do
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); // Really Nice Perspective Calculations
BuildFont(); // Build The Font
return TRUE; // Initialization Went OK
}
int cuser = 0;
int DrawGLScene(GLvoid) // Here's Where We Do All The Drawing
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Clear Screen And Depth Buffer
glLoadIdentity(); // Reset The Current Modelview Matrix
glTranslatef(0.15f, -0.4f, -1.0f); // Move One Unit Into The Screen
// Pulsing Colors Based On Text Position
glColor3f(1, 1, 1);
// Position The Text On The Screen
glRasterPos2f(0.0f, 0.00f);
glPrint("STRESS TEST [%d]", cuser); // Print GL Text To The Screen
int size = 0;
float *points = nullptr;
GetPointCloud(&size, &points);
cuser = size;
glPointSize(2.0);
glBegin(GL_POINTS);
for (int i = 0; i < size; i++)
{
float x, y, z;
x = points[i * 2] / 400.0 - 1.25;
y = 1.25 - points[i * 2 + 1] / 400.0;
z = -1.0f;
glVertex3f(x, y, z);
}
glEnd();
return TRUE; // Everything Went OK
}
GLvoid KillGLWindow(GLvoid) // Properly Kill The Window
{
if (fullscreen) // Are We In Fullscreen Mode?
{
ChangeDisplaySettings(NULL, 0); // If So Switch Back To The Desktop
ShowCursor(TRUE); // Show Mouse Pointer
}
if (hRC) // Do We Have A Rendering Context?
{
if (!wglMakeCurrent(NULL, NULL)) // Are We Able To Release The DC And RC Contexts?
{
MessageBox(NULL, L"Release Of DC And RC Failed.", L"SHUTDOWN ERROR", MB_OK | MB_ICONINFORMATION);
}
if (!wglDeleteContext(hRC)) // Are We Able To Delete The RC?
{
MessageBox(NULL, L"Release Rendering Context Failed.", L"SHUTDOWN ERROR", MB_OK | MB_ICONINFORMATION);
}
hRC = NULL; // Set RC To NULL
}
if (hDC && !ReleaseDC(hWnd, hDC)) // Are We Able To Release The DC
{
MessageBox(NULL, L"Release Device Context Failed.", L"SHUTDOWN ERROR", MB_OK | MB_ICONINFORMATION);
hDC = NULL; // Set DC To NULL
}
if (hWnd && !DestroyWindow(hWnd)) // Are We Able To Destroy The Window?
{
MessageBox(NULL, L"Could Not Release hWnd.", L"SHUTDOWN ERROR", MB_OK | MB_ICONINFORMATION);
hWnd = NULL; // Set hWnd To NULL
}
if (!UnregisterClass(L"OpenGL", hInstance)) // Are We Able To Unregister Class
{
MessageBox(NULL, L"Could Not Unregister Class.", L"SHUTDOWN ERROR", MB_OK | MB_ICONINFORMATION);
hInstance = NULL; // Set hInstance To NULL
}
KillFont();
}
/* This Code Creates Our OpenGL Window. Parameters Are: *
* title - Title To Appear At The Top Of The Window *
* width - Width Of The GL Window Or Fullscreen Mode *
* height - Height Of The GL Window Or Fullscreen Mode *
* bits - Number Of Bits To Use For Color (8/16/24/32) *
* fullscreenflag - Use Fullscreen Mode (TRUE) Or Windowed Mode (FALSE) */
BOOL CreateGLWindow(const wchar_t* title, int width, int height, int bits, bool fullscreenflag)
{
GLuint PixelFormat; // Holds The Results After Searching For A Match
WNDCLASS wc; // Windows Class Structure
DWORD dwExStyle; // Window Extended Style
DWORD dwStyle; // Window Style
RECT WindowRect; // Grabs Rectangle Upper Left / Lower Right Values
WindowRect.left = (long)0; // Set Left Value To 0
WindowRect.right = (long)width; // Set Right Value To Requested Width
WindowRect.top = (long)0; // Set Top Value To 0
WindowRect.bottom = (long)height; // Set Bottom Value To Requested Height
fullscreen = fullscreenflag; // Set The Global Fullscreen Flag
hInstance = GetModuleHandle(NULL); // Grab An Instance For Our Window
wc.style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC; // Redraw On Size, And Own DC For Window.
wc.lpfnWndProc = (WNDPROC)WndProc; // WndProc Handles Messages
wc.cbClsExtra = 0; // No Extra Window Data
wc.cbWndExtra = 0; // No Extra Window Data
wc.hInstance = hInstance; // Set The Instance
wc.hIcon = LoadIcon(NULL, IDI_WINLOGO); // Load The Default Icon
wc.hCursor = LoadCursor(NULL, IDC_ARROW); // Load The Arrow Pointer
wc.hbrBackground = NULL; // No Background Required For GL
wc.lpszMenuName = NULL; // We Don't Want A Menu
wc.lpszClassName = L"OpenGL"; // Set The Class Name
if (!RegisterClass(&wc)) // Attempt To Register The Window Class
{
MessageBox(NULL, L"Failed To Register The Window Class.", L"ERROR", MB_OK | MB_ICONEXCLAMATION);
return FALSE; // Return FALSE
}
if (fullscreen) // Attempt Fullscreen Mode?
{
DEVMODE dmScreenSettings; // Device Mode
memset(&dmScreenSettings, 0, sizeof(dmScreenSettings)); // Makes Sure Memory's Cleared
dmScreenSettings.dmSize = sizeof(dmScreenSettings); // Size Of The Devmode Structure
dmScreenSettings.dmPelsWidth = width; // Selected Screen Width
dmScreenSettings.dmPelsHeight = height; // Selected Screen Height
dmScreenSettings.dmBitsPerPel = bits; // Selected Bits Per Pixel
dmScreenSettings.dmFields = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT;
// Try To Set Selected Mode And Get Results. NOTE: CDS_FULLSCREEN Gets Rid Of Start Bar.
if (ChangeDisplaySettings(&dmScreenSettings, CDS_FULLSCREEN) != DISP_CHANGE_SUCCESSFUL)
{
// If The Mode Fails, Offer Two Options. Quit Or Use Windowed Mode.
if (MessageBox(NULL, L"The Requested Fullscreen Mode Is Not Supported By\nYour Video Card. Use Windowed Mode Instead?", L"NeHe GL", MB_YESNO | MB_ICONEXCLAMATION) == IDYES)
{
fullscreen = FALSE; // Windowed Mode Selected. Fullscreen = FALSE
}
else
{
// Pop Up A Message Box Letting User Know The Program Is Closing.
MessageBox(NULL, L"Program Will Now Close.", L"ERROR", MB_OK | MB_ICONSTOP);
return FALSE; // Return FALSE
}
}
}
if (fullscreen) // Are We Still In Fullscreen Mode?
{
dwExStyle = WS_EX_APPWINDOW; // Window Extended Style
dwStyle = WS_POPUP; // Windows Style
ShowCursor(FALSE); // Hide Mouse Pointer
}
else
{
dwExStyle = WS_EX_APPWINDOW | WS_EX_WINDOWEDGE; // Window Extended Style
dwStyle = WS_OVERLAPPEDWINDOW; // Windows Style
}
AdjustWindowRectEx(&WindowRect, dwStyle, FALSE, dwExStyle); // Adjust Window To True Requested Size
// Create The Window
if (!(hWnd = CreateWindowEx(dwExStyle, // Extended Style For The Window
L"OpenGL", // Class Name
title, // Window Title
dwStyle | // Defined Window Style
WS_CLIPSIBLINGS | // Required Window Style
WS_CLIPCHILDREN, // Required Window Style
0, 0, // Window Position
WindowRect.right - WindowRect.left, // Calculate Window Width
WindowRect.bottom - WindowRect.top, // Calculate Window Height
NULL, // No Parent Window
NULL, // No Menu
hInstance, // Instance
NULL))) // Dont Pass Anything To WM_CREATE
{
KillGLWindow(); // Reset The Display
MessageBox(NULL, L"Window Creation Error.", L"ERROR", MB_OK | MB_ICONEXCLAMATION);
return FALSE; // Return FALSE
}
static PIXELFORMATDESCRIPTOR pfd = // pfd Tells Windows How We Want Things To Be
{
sizeof(PIXELFORMATDESCRIPTOR), // Size Of This Pixel Format Descriptor
1, // Version Number
PFD_DRAW_TO_WINDOW | // Format Must Support Window
PFD_SUPPORT_OPENGL | // Format Must Support OpenGL
PFD_DOUBLEBUFFER, // Must Support Double Buffering
PFD_TYPE_RGBA, // Request An RGBA Format
bits, // Select Our Color Depth
0, 0, 0, 0, 0, 0, // Color Bits Ignored
0, // No Alpha Buffer
0, // Shift Bit Ignored
0, // No Accumulation Buffer
0, 0, 0, 0, // Accumulation Bits Ignored
16, // 16Bit Z-Buffer (Depth Buffer)
0, // No Stencil Buffer
0, // No Auxiliary Buffer
PFD_MAIN_PLANE, // Main Drawing Layer
0, // Reserved
0, 0, 0 // Layer Masks Ignored
};
if (!(hDC = GetDC(hWnd))) // Did We Get A Device Context?
{
KillGLWindow(); // Reset The Display
MessageBox(NULL, L"Can't Create A GL Device Context.", L"ERROR", MB_OK | MB_ICONEXCLAMATION);
return FALSE; // Return FALSE
}
if (!(PixelFormat = ChoosePixelFormat(hDC, &pfd))) // Did Windows Find A Matching Pixel Format?
{
KillGLWindow(); // Reset The Display
MessageBox(NULL, L"Can't Find A Suitable PixelFormat.", L"ERROR", MB_OK | MB_ICONEXCLAMATION);
return FALSE; // Return FALSE
}
if (!SetPixelFormat(hDC, PixelFormat, &pfd)) // Are We Able To Set The Pixel Format?
{
KillGLWindow(); // Reset The Display
MessageBox(NULL, L"Can't Set The PixelFormat.", L"ERROR", MB_OK | MB_ICONEXCLAMATION);
return FALSE; // Return FALSE
}
if (!(hRC = wglCreateContext(hDC))) // Are We Able To Get A Rendering Context?
{
KillGLWindow(); // Reset The Display
MessageBox(NULL, L"Can't Create A GL Rendering Context.", L"ERROR", MB_OK | MB_ICONEXCLAMATION);
return FALSE; // Return FALSE
}
if (!wglMakeCurrent(hDC, hRC)) // Try To Activate The Rendering Context
{
KillGLWindow(); // Reset The Display
MessageBox(NULL, L"Can't Activate The GL Rendering Context.", L"ERROR", MB_OK | MB_ICONEXCLAMATION);
return FALSE; // Return FALSE
}
ShowWindow(hWnd, SW_SHOW); // Show The Window
SetForegroundWindow(hWnd); // Slightly Higher Priority
SetFocus(hWnd); // Sets Keyboard Focus To The Window
ReSizeGLScene(width, height); // Set Up Our Perspective GL Screen
if (!InitGL()) // Initialize Our Newly Created GL Window
{
KillGLWindow(); // Reset The Display
MessageBox(NULL, L"Initialization Failed.", L"ERROR", MB_OK | MB_ICONEXCLAMATION);
return FALSE; // Return FALSE
}
return TRUE; // Success
}
LRESULT CALLBACK WndProc(HWND hWnd, // Handle For This Window
UINT uMsg, // Message For This Window
WPARAM wParam, // Additional Message Information
LPARAM lParam) // Additional Message Information
{
switch (uMsg) // Check For Windows Messages
{
case WM_ACTIVATE: // Watch For Window Activate Message
{
if (!HIWORD(wParam)) // Check Minimization State
{
active = TRUE; // Program Is Active
}
else
{
active = FALSE; // Program Is No Longer Active
}
return 0; // Return To The Message Loop
}
case WM_SYSCOMMAND: // Intercept System Commands
{
switch (wParam) // Check System Calls
{
case SC_SCREENSAVE: // Screensaver Trying To Start?
case SC_MONITORPOWER: // Monitor Trying To Enter Powersave?
return 0; // Prevent From Happening
}
break; // Exit
}
case WM_CLOSE: // Did We Receive A Close Message?
{
PostQuitMessage(0); // Send A Quit Message
return 0; // Jump Back
}
case WM_KEYDOWN: // Is A Key Being Held Down?
{
keys[wParam] = TRUE; // If So, Mark It As TRUE
return 0; // Jump Back
}
case WM_KEYUP: // Has A Key Been Released?
{
keys[wParam] = FALSE; // If So, Mark It As FALSE
return 0; // Jump Back
}
case WM_SIZE: // Resize The OpenGL Window
{
ReSizeGLScene(LOWORD(lParam), HIWORD(lParam)); // LoWord=Width, HiWord=Height
return 0; // Jump Back
}
}
// Pass All Unhandled Messages To DefWindowProc
return DefWindowProc(hWnd, uMsg, wParam, lParam);
}
int WINAPI WinMain(HINSTANCE hInstance, // Instance
HINSTANCE hPrevInstance, // Previous Instance
LPSTR lpCmdLine, // Command Line Parameters
int nCmdShow) // Window Show State
{
MSG msg; // Windows Message Structure
BOOL done = FALSE; // Bool Variable To Exit Loop
fullscreen = FALSE; // Windowed Mode
// Create Our OpenGL Window
if (!CreateGLWindow(L"NeHe's Bitmap Font Tutorial", 640, 480, 16, fullscreen))
{
return 0; // Quit If Window Was Not Created
}
InitializeNetwork();
while (!done) // Loop That Runs While done=FALSE
{
if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) // Is There A Message Waiting?
{
if (msg.message == WM_QUIT) // Have We Received A Quit Message?
{
done = TRUE; // If So done=TRUE
}
else // If Not, Deal With Window Messages
{
TranslateMessage(&msg); // Translate The Message
DispatchMessage(&msg); // Dispatch The Message
}
}
else // If There Are No Messages
{
// Draw The Scene. Watch For ESC Key And Quit Messages From DrawGLScene()
if ((active && !DrawGLScene()) || keys[VK_ESCAPE]) // Active? Was There A Quit Received?
{
done = TRUE; // ESC or DrawGLScene Signalled A Quit
}
else // Not Time To Quit, Update Screen
{
SwapBuffers(hDC); // Swap Buffers (Double Buffering)
}
if (keys[VK_F1]) // Is F1 Being Pressed?
{
keys[VK_F1] = FALSE; // If So Make Key FALSE
KillGLWindow(); // Kill Our Current Window
fullscreen = !fullscreen; // Toggle Fullscreen / Windowed Mode
// Recreate Our OpenGL Window
if (!CreateGLWindow(L"NeHe's Bitmap Font Tutorial", 640, 480, 16, fullscreen))
{
return 0; // Quit If Window Was Not Created
}
}
}
}
// Shutdown
KillGLWindow(); // Kill The Window
return (msg.wParam); // Exit The Program
}
| [
"snrn2426@gmail.com"
] | snrn2426@gmail.com |
72e33e58136949c64300055202c1fc5c83f9a0f2 | 8c7af9fedd99d385089aa13d9cfb6c932a64aac1 | /实验3-2/MFCApplication1/MFCApplication1Doc.h | 63d4b4226d1832085958c8ab017252fe57013fac | [] | no_license | zhang1-meili/Test2 | 9355592fc11ec75ebfc863e2d92a791ee813031c | 676db7f31192bbaa74a3bd8bd60350dcf004e294 | refs/heads/master | 2021-05-23T20:00:20.265851 | 2020-05-26T07:47:48 | 2020-06-02T06:21:23 | 253,441,721 | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 927 | h |
// MFCApplication1Doc.h : CMFCApplication1Doc 类的接口
//
#pragma once
class CMFCApplication1Doc : public CDocument
{
protected: // 仅从序列化创建
CMFCApplication1Doc();
DECLARE_DYNCREATE(CMFCApplication1Doc)
// 特性
public:
// 操作
public:
CArray <CRect, CRect&> ca;
// 重写
public:
virtual BOOL OnNewDocument();
virtual void Serialize(CArchive& ar);
#ifdef SHARED_HANDLERS
virtual void InitializeSearchContent();
virtual void OnDrawThumbnail(CDC& dc, LPRECT lprcBounds);
#endif // SHARED_HANDLERS
// 实现
public:
virtual ~CMFCApplication1Doc();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
// 生成的消息映射函数
protected:
DECLARE_MESSAGE_MAP()
#ifdef SHARED_HANDLERS
// 用于为搜索处理程序设置搜索内容的 Helper 函数
void SetSearchContent(const CString& value);
#endif // SHARED_HANDLERS
};
| [
"1031601344@qq.com"
] | 1031601344@qq.com |
a7d1cd559d6a26c8e219b43f0bf1171c918b657c | 007d63d4cb49676fd678840a3e1244ad63bdb121 | /released_plugins_more/visiocyte_plugins/neuron_assemble_live/assemble_neuron_live_dialog.h | 329f9115c4d00223af493f8a67dc5b65c5dd2a13 | [
"LicenseRef-scancode-warranty-disclaimer",
"MIT"
] | permissive | satya-arjunan/visiocyte | 1a09cc886b92ca10c80b21d43220b33c6009e079 | 891404d83d844ae94ee8f1cea1bb14deba588c4f | refs/heads/master | 2020-04-23T02:07:33.357029 | 2019-04-08T06:40:03 | 2019-04-08T06:40:03 | 170,835,824 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,588 | h | #ifndef ASSEMBEL_NEURON_LIVE_DIALOG_H
#define ASSEMBEL_NEURON_LIVE_DIALOG_H
#ifndef __ALLOW_VR_FUNCS__
#define __ALLOW_VR_FUNCS__
#endif
#include <QDialog>
#include <QtGui>
#include "visiocyte_interface.h"
#include <map>
#include "../terastitcher/src/core/imagemanager/VirtualVolume.h"
#define WINNAME_ASSEM "assemble_swc_file"
using namespace std;
using namespace iim;
typedef struct NOI{
VISIOCYTELONG n; //the id of noi, match with the n variable of node
VISIOCYTELONG cid; //fragment component id
int type; //type information
float x, y, z; // point coordinates
union{
float r; // radius
float radius;
};
QList<float> fea_val; //feature values
QSet<NOI *> conn; //connections from NOI
long seg_id;
long level;
}NOI;
typedef QHash<VISIOCYTELONG, NOI*>::iterator NodeIter;
class assemble_neuron_live_dialog : public QDialog
{
Q_OBJECT
public:
assemble_neuron_live_dialog(VISIOCYTEPluginCallback2 * callback, QList<NeuronTree> &ntList, Image4DSimple * p_img4d,
LandmarkList marklist, QWidget *parent = 0);
VISIOCYTEPluginCallback2 * callback;
NeuronTree nt;
NeuronTree nt_original;
LandmarkList marklist;
VISIOCYTELONG prev_root;
QHash<VISIOCYTELONG, NOI*> nodes;
int coffset;
VISIOCYTELONG noffset;
Image4DSimple * p_img4d;
QString winname_main, winname_3d, winname_roi,terafly_folder;
QPushButton * btn_link, *btn_loop, *btn_manuallink, *btn_deletelink, *btn_connect, *btn_connectall,
*btn_syncmarker, *btn_break, * btn_save, * btn_quit, *btn_zoomin, *btn_syncmarkeronly,
*btn_findtips, *btn_synctips, *btn_savetips, *btn_updatetips;
QTabWidget * tab;
QListWidget * list_edge, * list_link, *list_marker, *list_tips;
QComboBox * cb_color;
QCheckBox * check_loop, * check_zoomin;
QSpinBox * spin_zoomin;
VirtualVolume* dataTerafly;
QStringList list_tips_information;
VISIOCYTELONG x_min, x_max, y_min, y_max, z_min, z_max; //ROI window
signals:
public slots:
void setColor(int i);
void syncMarker();
void syncMarkerOnly();
void pairMarker();
void delPair();
void connectPair();
void connectAll();
void breakEdge();
void searchPair();
void searchLoop();
void sortsaveSWC();
void highlightPair();
void highlightEdge();
void zoomin();
void findTips();
void syncTips();
void saveTips();
void updateTips();
private:
void creat(QWidget *parent);
void initNeuron(QList<NeuronTree> &ntList_in);
bool connectNode(VISIOCYTELONG pid1, VISIOCYTELONG pid2);
bool breakNode(VISIOCYTELONG pid1, VISIOCYTELONG pid2);
QSet<QPair<VISIOCYTELONG, VISIOCYTELONG> > searchConnection(double xscale, double yscale, double zscale,
double angThr, double disThr, int matchType,
bool b_minusradius);
double getNeuronDiameter();
LandmarkList * getMarkerList();
void updateDisplay(); //deep refresh everything
void update3DView(); //light refresh 3D window
visiocytehandle getImageWindow(); //return the handle if window is open, otherwise 0
visiocytehandle checkImageWindow(); //if window not opened, open it. return the handle
visiocytehandle updateImageWindow(); //deep refresh image window
VisiocyteR_MainWindow * get3DWindow(); //return the handle if window is open, otherwise 0
VisiocyteR_MainWindow * check3DWindow(); //if window not opened, open it. return the handle
VisiocyteR_MainWindow * update3DWindow(); //deep refresh 3D window
void updateROIWindow(const QList<VISIOCYTELONG>& pids);
void updateColor(); //update the neuron type, will sync neuron if changed
};
class pair_marker_dialog : public QDialog
{
Q_OBJECT
public:
pair_marker_dialog(LandmarkList * mList,QWidget *parent = 0);
QListWidget * list1, * list2;
QPushButton * btn_yes, *btn_no;
};
class connect_param_dialog : public QDialog
{
Q_OBJECT
public:
connect_param_dialog();
~connect_param_dialog();
private:
void creat();
void initDlg();
public slots:
void myconfig();
public:
QGridLayout *gridLayout;
QDoubleSpinBox *spin_zscale, *spin_xscale, *spin_yscale, *spin_ang, *spin_dis;
QPushButton *btn_quit, *btn_run;
QComboBox *cb_distanceType, *cb_matchType, *cb_conf;
QTextEdit* text_info;
};
class sort_neuron_dialog : public QDialog
{
Q_OBJECT
public:
sort_neuron_dialog(LandmarkList * mList, VISIOCYTELONG prev_root, VISIOCYTELONG type1_root, QWidget *parent = 0);
QComboBox * cb_marker;
QPushButton * btn_yes, *btn_no;
QRadioButton *radio_marker, *radio_type, *radio_prev;
};
#define NTDIS(a,b) (((a).x-(b).x)*((a).x-(b).x)+((a).y-(b).y)*((a).y-(b).y)+((a).z-(b).z)*((a).z-(b).z))
#define NTDOT(a,b) ((a).x*(b).x+(a).y*(b).y+(a).z*(b).z)
#define NTNORM(a) (sqrt((a).x*(a).x+(a).y*(a).y+(a).z*(a).z))
void update_marker_info(const LocationSimple& mk, QList<int>& info); //info[0]=point id, info[0]=matching point id
void update_marker_info(const LocationSimple& mk, QList<int>& info, int* color);
void set_marker_color(const LocationSimple& mk, RGB8 color);
bool get_marker_info(const LocationSimple& mk, QList<int>& info);
QList<NeuronSWC> generate_swc_typesort(QHash<VISIOCYTELONG, NOI*>& nodes, VISIOCYTELONG n_root);
bool export_list2file(const QList<NeuronSWC>& lN, QString fileSaveName);
QList<NOI *> search_loop(QHash<VISIOCYTELONG, NOI*>& nodes);
#endif // ASSEMBEL_NEURON_LIVE_DIALOG_H
| [
"satya.arjunan@gmail.com"
] | satya.arjunan@gmail.com |
f6e97a1225ede0186a418ae797955f417ec885f9 | 9f520bcbde8a70e14d5870fd9a88c0989a8fcd61 | /pitzDaily/316/phi | a37405dfafefcbe03c317f18e5d24a3ae0477e72 | [] | no_license | asAmrita/adjoinShapOptimization | 6d47c89fb14d090941da706bd7c39004f515cfea | 079cbec87529be37f81cca3ea8b28c50b9ceb8c5 | refs/heads/master | 2020-08-06T21:32:45.429939 | 2019-10-06T09:58:20 | 2019-10-06T09:58:20 | 213,144,901 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 233,326 | /*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1806 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class surfaceScalarField;
location "316";
object phi;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 3 -1 0 0 0 0];
oriented oriented;
internalField nonuniform List<scalar>
12640
(
-1.86497381051e-07
1.8670647913e-07
-3.59793695821e-07
1.73439620867e-07
-5.14363107348e-07
1.54670822573e-07
-6.44591945361e-07
1.30298289628e-07
-7.3618950015e-07
9.16667658123e-08
-7.86124978701e-07
5.00299549322e-08
-8.15322278373e-07
2.92883631822e-08
-8.72704076452e-07
5.74625313019e-08
-9.60643948044e-07
8.8006436481e-08
-1.04147272287e-06
8.08811923951e-08
-1.1151642001e-06
7.37226578421e-08
-1.19635456262e-06
8.12134128767e-08
-1.26787794326e-06
7.15376946394e-08
-1.32238582529e-06
5.45196250657e-08
-1.36881317146e-06
4.6438891635e-08
-1.42497093628e-06
5.6183469379e-08
-1.48320484649e-06
5.82568342861e-08
-1.52700647758e-06
4.3825574179e-08
-1.55307272313e-06
2.60676235145e-08
-1.57061418506e-06
1.75258680748e-08
-1.60401426733e-06
3.33708622886e-08
-1.65827046819e-06
5.4225813073e-08
-1.7190765973e-06
6.0769283208e-08
-1.77864081568e-06
5.95302795553e-08
-1.83214308533e-06
5.34646019626e-08
-1.87834472424e-06
4.61669421458e-08
-1.92129488426e-06
4.29087878371e-08
-1.95866900715e-06
3.73353662675e-08
-1.98800408749e-06
2.92866018946e-08
-2.01087003136e-06
2.28192517046e-08
-2.03281669739e-06
2.18880937396e-08
-2.0517288858e-06
1.88549546544e-08
-2.06287503577e-06
1.10845927277e-08
-2.07363974441e-06
1.06972254182e-08
-2.08326601189e-06
9.53435081842e-09
-2.09017334894e-06
6.81664506494e-09
-2.09987030045e-06
9.58660708493e-09
-2.10848134448e-06
8.48440296024e-09
-2.11200727845e-06
3.37910415713e-09
-2.11607039567e-06
3.91581386662e-09
-2.1356270133e-06
1.94035779765e-08
-2.15706181054e-06
2.12982190027e-08
-2.15517431433e-06
-2.02143924597e-09
-2.13812836042e-06
-1.71789585617e-08
-2.11442239236e-06
-2.38465263685e-08
-2.08298260036e-06
-3.15777381629e-08
-2.04374903805e-06
-3.93814713401e-08
-1.99476665599e-06
-4.91304227359e-08
-1.93692042345e-06
-5.80050500447e-08
-1.88038832081e-06
-5.66886786945e-08
-1.83547238292e-06
-4.50979055119e-08
-1.78437615113e-06
-5.12762279976e-08
-1.68931069455e-06
-9.52547582938e-08
-1.56265331126e-06
-1.26871647019e-07
-1.41552127912e-06
-1.4736193866e-07
-1.23582879903e-06
-1.79930827788e-07
-1.05303255792e-06
-1.83099007822e-07
-8.75909391357e-07
-1.77503842025e-07
-6.73605623289e-07
-2.02761014219e-07
-4.46185255835e-07
-2.27980586701e-07
-1.97736335179e-07
-2.49126147688e-07
6.83975453274e-08
-2.66891501791e-07
3.96235713851e-07
-3.28647257648e-07
6.23559722538e-07
-2.27860896269e-07
7.55790467541e-07
-1.32573877979e-07
8.42296586353e-07
-8.6746332202e-08
9.01948606765e-07
-5.98752418354e-08
9.4914729598e-07
-4.74362624763e-08
9.84428165874e-07
-3.55477715736e-08
1.00183286649e-06
-1.76900963384e-08
9.9700167274e-07
4.53773224126e-09
9.6647140501e-07
3.02511463627e-08
9.07142633515e-07
5.90654230214e-08
8.06743473689e-07
1.0014162324e-07
6.95200736457e-07
1.11302356481e-07
5.76431320488e-07
1.18554966628e-07
4.80153163942e-07
9.59991329388e-08
3.49612480821e-07
1.30302115376e-07
2.16271404542e-07
1.32969738339e-07
2.1593316678e-07
-9.35365448435e-08
2.80293631936e-07
-2.17098240625e-07
2.97086677413e-07
-3.37253749151e-07
2.74881724574e-07
-4.65550173846e-07
2.58641665237e-07
-6.37181373126e-07
2.6337171813e-07
-7.73819041318e-07
1.86742326331e-07
-8.50603016124e-07
1.0616311314e-07
-9.17948287698e-07
1.24881168795e-07
-9.90136516877e-07
1.60259769808e-07
-1.07166426361e-06
1.62447487673e-07
-1.15006190436e-06
1.5215486875e-07
-1.21211304109e-06
1.43279303755e-07
-1.26749749164e-06
1.26945422867e-07
-1.32120237281e-06
1.08245456421e-07
-1.37276985263e-06
9.80463141222e-08
-1.43199392594e-06
1.15433857434e-07
-1.48139950808e-06
1.07697065179e-07
-1.49171345515e-06
5.41396547625e-08
-1.49559288881e-06
2.99416828272e-08
-1.52172636196e-06
4.36289723876e-08
-1.57277535105e-06
8.43906677937e-08
-1.64984649744e-06
1.31250313005e-07
-1.72588292122e-06
1.36776840814e-07
-1.77969955679e-06
1.13301805384e-07
-1.82808088777e-06
1.01816877727e-07
-1.88156846668e-06
9.96070623274e-08
-1.92581987992e-06
8.71289890572e-08
-1.95965305511e-06
7.11153246596e-08
-1.98788475136e-06
5.74804016911e-08
-2.01135740332e-06
4.62301204647e-08
-2.02843872158e-06
3.89239082399e-08
-2.0407644679e-06
3.11193320864e-08
-2.04559369179e-06
1.58580807183e-08
-2.05154844966e-06
1.65678684775e-08
-2.06774790669e-06
2.56650284201e-08
-2.07535220354e-06
1.4303167627e-08
-2.08139921397e-06
1.55191351584e-08
-2.09992432018e-06
2.68668103865e-08
-2.1228996722e-06
2.62201410837e-08
-2.1324138877e-06
1.32658307885e-08
-2.08752079005e-06
-2.56222183248e-08
-2.01770951982e-06
-4.86536893386e-08
-1.98434722347e-06
-3.5503040695e-08
-1.9744400302e-06
-2.72310371917e-08
-1.96876376617e-06
-2.9653083937e-08
-1.96420106966e-06
-3.62940275079e-08
-1.95385004304e-06
-4.98706414587e-08
-1.93679232633e-06
-6.63484528296e-08
-1.90888112544e-06
-8.60643348451e-08
-1.85287734907e-06
-1.12862111852e-07
-1.7572009324e-06
-1.40928002029e-07
-1.65488411008e-06
-1.53767931569e-07
-1.60759095339e-06
-1.42732957769e-07
-1.54709746784e-06
-1.87590524349e-07
-1.43199196674e-06
-2.62702785729e-07
-1.3106781755e-06
-3.01533889003e-07
-1.165045866e-06
-3.29071864739e-07
-9.76211323e-07
-3.66761280392e-07
-7.62358918523e-07
-4.17124168109e-07
-5.13423679651e-07
-4.7754603804e-07
-2.18453636709e-07
-5.44755730525e-07
8.08705813776e-08
-5.66926920391e-07
3.92149862763e-07
-6.40681968978e-07
6.13837849463e-07
-4.50084626746e-07
7.34821652765e-07
-2.53876086666e-07
7.98874322031e-07
-1.51038588942e-07
8.65298723145e-07
-1.2651700341e-07
9.34160227823e-07
-1.16536360053e-07
9.82402513973e-07
-8.40531257583e-08
1.00199799077e-06
-3.7573914656e-08
9.87411513199e-07
1.88368986422e-08
9.42020018272e-07
7.53756617281e-08
8.90158744009e-07
1.10671346687e-07
8.43169254441e-07
1.46878035583e-07
7.71547454696e-07
1.8266954858e-07
6.83841625258e-07
2.05993769738e-07
5.63952151842e-07
2.15643791774e-07
4.31870500815e-07
2.62015361004e-07
2.33292339606e-07
3.31105235094e-07
4.4899830446e-07
-1.26183423016e-07
4.06607741608e-07
-1.8257444362e-07
3.53543013986e-07
-3.39422423534e-07
4.31791273519e-07
-5.28297918849e-07
4.47593279533e-07
-6.96590220159e-07
4.3174271238e-07
-7.75656262116e-07
2.65868811323e-07
-8.11090402704e-07
1.41644502957e-07
-8.8554112433e-07
1.99380056383e-07
-9.74498915664e-07
2.49256056714e-07
-1.06258795657e-06
2.5056587426e-07
-1.14386569102e-06
2.33452907088e-07
-1.21036503507e-06
2.09810273381e-07
-1.26633131905e-06
1.8295434996e-07
-1.32088318626e-06
1.62846157343e-07
-1.35468445365e-06
1.31891831985e-07
-1.30800567866e-06
6.87882818884e-08
-1.22269250979e-06
2.23876459966e-08
-1.20533418239e-06
3.67740982012e-08
-1.26710654549e-06
9.16909814871e-08
-1.41062108176e-06
1.87112886711e-07
-1.56748770443e-06
2.41221423558e-07
-1.65654512812e-06
2.20277842715e-07
-1.71263674514e-06
1.9283200378e-07
-1.77881431085e-06
1.79447993159e-07
-1.83983878519e-06
1.62802780827e-07
-1.88465800465e-06
1.44392310621e-07
-1.92177794991e-06
1.24205579839e-07
-1.95479753198e-06
1.04095392157e-07
-1.98164853925e-06
8.42815403663e-08
-2.0045481783e-06
6.90850756285e-08
-2.01751627328e-06
5.18423472548e-08
-2.02520841982e-06
3.8756021036e-08
-2.03566456923e-06
2.62582709884e-08
-2.02304847934e-06
3.88610375286e-09
-2.01914894654e-06
2.16634643945e-08
-2.05018201949e-06
4.5227844993e-08
-2.06150071241e-06
2.67083817129e-08
-2.06890389442e-06
3.4133290135e-08
-2.10531484896e-06
6.24801616045e-08
-2.13917391735e-06
4.69839167511e-08
-2.16135011644e-06
-3.59187295295e-09
-2.17044300147e-06
-3.96996226688e-08
-2.16073749177e-06
-4.53579930346e-08
-2.14209552355e-06
-4.60163439548e-08
-2.11876379861e-06
-5.31371085422e-08
-2.08929967336e-06
-6.59041303927e-08
-2.05499939859e-06
-8.43251441567e-08
-2.01475312017e-06
-1.06743394026e-07
-1.96763281738e-06
-1.33340489747e-07
-1.91581887586e-06
-1.6482594488e-07
-1.85975052622e-06
-1.97158128855e-07
-1.78841980524e-06
-2.25269860871e-07
-1.67427266102e-06
-2.57069399107e-07
-1.54724391862e-06
-3.14824631391e-07
-1.43838783553e-06
-3.71798969938e-07
-1.31448444491e-06
-4.25720258965e-07
-1.15140203584e-06
-4.92496262442e-07
-9.51698326159e-07
-5.6686638064e-07
-7.2150661365e-07
-6.47790746687e-07
-4.65263103493e-07
-7.34324972803e-07
-1.98896081881e-07
-8.11736084964e-07
1.04926680181e-07
-8.71428133208e-07
3.43847341951e-07
-8.80255078335e-07
5.25207733496e-07
-6.31897832847e-07
6.64332504295e-07
-3.93304124365e-07
7.85799502968e-07
-2.72738177453e-07
8.69604895986e-07
-2.10540176452e-07
9.18062236879e-07
-1.6521684207e-07
9.45499069336e-07
-1.11739857019e-07
9.53163168316e-07
-4.5504546004e-08
9.52389328146e-07
1.93439654927e-08
9.59122579471e-07
6.83883960122e-08
9.53123707699e-07
1.1642269224e-07
9.05247949953e-07
1.94506607043e-07
8.09680961466e-07
2.78010465579e-07
6.89491643326e-07
3.25951641091e-07
5.64331752203e-07
3.40503457091e-07
4.41544361729e-07
3.84578868346e-07
1.99506671951e-07
5.72830223051e-07
6.48352910857e-07
-8.87267632072e-08
4.95354646171e-07
-1.10357829125e-07
3.75219042053e-07
-2.9978677414e-07
6.21290715916e-07
-4.46987958145e-07
5.94879581171e-07
-4.35116966475e-07
4.19927291876e-07
-3.5941062728e-07
1.90180355926e-07
-5.04581645931e-07
2.86828259793e-07
-7.5614860454e-07
4.50961567739e-07
-9.26357915063e-07
4.19486578727e-07
-1.03813474189e-06
3.62363683986e-07
-1.13299585216e-06
3.28349353121e-07
-1.20988694503e-06
2.86752539256e-07
-1.25383437719e-06
2.26959914358e-07
-1.22179831305e-06
1.30866179756e-07
-1.13591937871e-06
4.60465858391e-08
-1.09486778785e-06
2.77393135562e-08
-1.13801628282e-06
6.55236279313e-08
-1.26058851226e-06
1.59322079103e-07
-1.43030302336e-06
2.61378108427e-07
-1.54771238106e-06
3.04496504979e-07
-1.60334269025e-06
2.96827290121e-07
-1.6647338774e-06
2.81638589488e-07
-1.73170123876e-06
2.59770272449e-07
-1.7872516889e-06
2.34965477152e-07
-1.83483734254e-06
2.10358748823e-07
-1.87590477655e-06
1.85423053402e-07
-1.91422934242e-06
1.62496407804e-07
-1.94657314009e-06
1.36394818013e-07
-1.97468162812e-06
1.12349483766e-07
-1.99230175652e-06
8.66620410681e-08
-2.00861444041e-06
6.81104365205e-08
-2.00979011732e-06
3.98892593218e-08
-1.99480263524e-06
1.12081059975e-08
-2.01668635927e-06
2.56832636767e-08
-2.03018198488e-06
3.50606484942e-08
-2.03979282364e-06
5.47157894321e-08
-2.09742862482e-06
8.4207675366e-08
-2.14724145131e-06
8.38018259533e-08
-2.15713051532e-06
7.22315785502e-08
-2.15554117398e-06
4.52491519748e-08
-2.1616575947e-06
2.37745413084e-09
-2.16791560451e-06
-3.35950704931e-08
-2.16217856346e-06
-5.12424716502e-08
-2.14624432113e-06
-6.21006993588e-08
-2.12373955557e-06
-7.57867170461e-08
-2.09542427503e-06
-9.43675741991e-08
-2.06190300794e-06
-1.17990409909e-07
-2.02267377225e-06
-1.46120603719e-07
-1.97716108639e-06
-1.78997679819e-07
-1.92526000176e-06
-2.16876276094e-07
-1.86423342731e-06
-2.58334133496e-07
-1.78666876735e-06
-3.02991898707e-07
-1.68769330032e-06
-3.56217378648e-07
-1.5795681669e-06
-4.23144925251e-07
-1.45707449413e-06
-4.9452051144e-07
-1.30859210179e-06
-5.74471375377e-07
-1.12964861373e-06
-6.7175225805e-07
-9.16461476917e-07
-7.80419378807e-07
-6.71577828474e-07
-8.93087085914e-07
-4.06590523811e-07
-9.99772864463e-07
-1.36929421299e-07
-1.08188004069e-06
1.09927994806e-07
-1.11880967889e-06
2.8041565167e-07
-1.05125676313e-06
4.9546583654e-07
-8.47376516652e-07
6.72433611822e-07
-5.70585871517e-07
7.70817666243e-07
-3.7135016777e-07
8.43276047112e-07
-2.83197854285e-07
9.02913817513e-07
-2.25067838497e-07
9.49587738133e-07
-1.58645808074e-07
9.870096737e-07
-8.31852282421e-08
1.01576020171e-06
-9.66439229177e-09
1.01544468102e-06
6.84572054804e-08
9.54259999082e-07
1.77396139105e-07
8.55538079557e-07
2.93053850012e-07
7.48258237274e-07
3.8508306666e-07
6.09563126147e-07
4.64448485945e-07
4.4477654646e-07
5.05170609856e-07
3.09337929274e-07
5.19836861814e-07
1.61789992586e-07
7.20220430298e-07
8.10105406523e-07
-1.12301657131e-08
5.06654467206e-07
-1.0051524457e-07
4.64539163695e-07
-2.56017833612e-07
7.76869440759e-07
-3.48049228811e-07
6.86992969944e-07
-3.06278476567e-07
3.78189119046e-07
-3.79555995372e-07
2.63461582185e-07
-5.85005961219e-07
4.92278983005e-07
-7.49038694974e-07
6.15011156946e-07
-8.75936553689e-07
5.46400267203e-07
-9.93796876224e-07
4.80257430639e-07
-1.10146779362e-06
4.36077422333e-07
-1.14072442331e-06
3.26066086291e-07
-1.08616584041e-06
1.72454285957e-07
-1.03640003965e-06
8.11271179864e-08
-1.06602418752e-06
7.56692689654e-08
-1.16033221842e-06
1.22032310456e-07
-1.30469257741e-06
2.09861106739e-07
-1.44165817213e-06
2.96262675414e-07
-1.50902464298e-06
3.28724120486e-07
-1.54364327519e-06
3.39096145239e-07
-1.60260758443e-06
3.55769818788e-07
-1.66971409405e-06
3.48721186632e-07
-1.73008261167e-06
3.20112660787e-07
-1.78147435217e-06
2.86333077143e-07
-1.82635509013e-06
2.55210430641e-07
-1.86929746617e-06
2.28339417816e-07
-1.90263845515e-06
1.95798029763e-07
-1.93555621022e-06
1.69278022714e-07
-1.95724252959e-06
1.34001951936e-07
-1.97574669047e-06
1.05132300059e-07
-1.97534732351e-06
6.76730526822e-08
-1.9848678972e-06
4.93553754137e-08
-2.02219138911e-06
4.84593062959e-08
-2.02499619123e-06
2.83902997956e-08
-2.05076385199e-06
6.0708621772e-08
-2.10459923639e-06
1.08420582513e-07
-2.13804576869e-06
1.17519720143e-07
-2.15729393177e-06
1.02916763924e-07
-2.16376923742e-06
7.85674810969e-08
-2.16476996821e-06
4.61056411116e-08
-2.16878830576e-06
6.24359845202e-09
-2.17214701571e-06
-3.03894695139e-08
-2.16715592181e-06
-5.63884207742e-08
-2.15295659589e-06
-7.64502231657e-08
-2.13167350966e-06
-9.72186141244e-08
-2.10453840291e-06
-1.21646178764e-07
-2.07204333897e-06
-1.50628124845e-07
-2.03388953643e-06
-1.84413316103e-07
-1.98938261445e-06
-2.23644645265e-07
-1.93732089941e-06
-2.69074803691e-07
-1.87470528509e-06
-3.21088990961e-07
-1.79697196354e-06
-3.808724734e-07
-1.70215425236e-06
-4.5118968685e-07
-1.59232058339e-06
-5.33161121657e-07
-1.46144600988e-06
-6.2560227917e-07
-1.30115026408e-06
-7.35008989313e-07
-1.10731898065e-06
-8.65866786437e-07
-8.78428055956e-07
-1.00962511823e-06
-6.20957430417e-07
-1.15090201149e-06
-3.52252318042e-07
-1.26883537282e-06
-9.51712426129e-08
-1.33935273409e-06
1.17207309005e-07
-1.3315954092e-06
2.62683333557e-07
-1.19713805245e-06
5.03322564725e-07
-1.08841154747e-06
6.92263810046e-07
-7.59833391783e-07
7.9918680544e-07
-4.78503629127e-07
8.63439603279e-07
-3.47659859677e-07
9.13531047804e-07
-2.75361654247e-07
9.61217087474e-07
-2.06556994307e-07
1.01215832533e-06
-1.34352736693e-07
1.04120560543e-06
-3.89480916392e-08
1.00296801158e-06
1.065186333e-07
9.2169791411e-07
2.58525874443e-07
8.30580714082e-07
3.84003570821e-07
7.13809418799e-07
5.01748715278e-07
5.62218005589e-07
6.159130532e-07
4.31069319024e-07
6.36188194764e-07
2.92317205645e-07
6.58575267314e-07
1.32738655547e-07
8.79739889143e-07
9.42792324872e-07
-3.80886184366e-09
5.10451702328e-07
-1.32299803731e-07
5.93066956291e-07
-2.11960368874e-07
8.5659790964e-07
-2.51001370748e-07
7.26079393539e-07
-2.34703529604e-07
3.61905926218e-07
-4.32352450067e-07
4.61114416273e-07
-6.44370740712e-07
7.04309325743e-07
-7.36952578213e-07
7.07602505862e-07
-8.36944999307e-07
6.46427170512e-07
-9.25639243385e-07
5.6900435212e-07
-9.53315827274e-07
4.63809563907e-07
-8.82663374468e-07
2.55460735109e-07
-8.64024432171e-07
1.53834795233e-07
-9.29366494516e-07
1.46466366846e-07
-1.04698053526e-06
1.93265969731e-07
-1.2179405314e-06
2.92966395707e-07
-1.37473354683e-06
3.6663121704e-07
-1.44011085304e-06
3.61626816964e-07
-1.47035961863e-06
3.58960092538e-07
-1.53826057102e-06
4.06981943033e-07
-1.60935496519e-06
4.26847242154e-07
-1.66688768122e-06
4.06235312768e-07
-1.72087330937e-06
3.74078882258e-07
-1.77472126996e-06
3.40157404065e-07
-1.82176704865e-06
3.02235620902e-07
-1.8466146704e-06
2.53158030413e-07
-1.88230447238e-06
2.31462148145e-07
-1.9076411255e-06
1.94586354758e-07
-1.93063499671e-06
1.56963213092e-07
-1.92566842924e-06
1.00132679819e-07
-1.92721565958e-06
6.91795614659e-08
-1.94368629901e-06
6.57640345567e-08
-1.95622504097e-06
6.09112519926e-08
-2.02787630052e-06
9.9931395201e-08
-2.09698463696e-06
1.29689700329e-07
-2.13466144075e-06
1.45969465895e-07
-2.15428196288e-06
1.37013524815e-07
-2.1655157827e-06
1.14021425815e-07
-2.17125480289e-06
8.41720258375e-08
-2.17434448243e-06
4.90508422829e-08
-2.17770073932e-06
9.4466452777e-09
-2.17923159284e-06
-2.90172893034e-08
-2.17427022062e-06
-6.15072588863e-08
-2.16131703683e-06
-8.95581758086e-08
-2.14136157578e-06
-1.17323600159e-07
-2.11547906869e-06
-1.47674241609e-07
-2.08415851235e-06
-1.82089098178e-07
-2.04713377271e-06
-2.21576180206e-07
-2.0035606293e-06
-2.67351509243e-07
-1.95192971172e-06
-3.2084005762e-07
-1.88962513384e-06
-3.83528494017e-07
-1.81339411113e-06
-4.57239028756e-07
-1.72073731313e-06
-5.44004813025e-07
-1.60864461835e-06
-6.45414189094e-07
-1.46987194772e-06
-7.64567936799e-07
-1.29734387544e-06
-9.07757335814e-07
-1.08871435752e-06
-1.07473236519e-06
-8.47080992484e-07
-1.25151566439e-06
-5.82708451032e-07
-1.41553892007e-06
-3.14809703686e-07
-1.53702338095e-06
-7.28953489987e-08
-1.5815670832e-06
1.16200543889e-07
-1.52100689126e-06
2.93641425514e-07
-1.37492240971e-06
4.98693553341e-07
-1.29381604008e-06
6.65144895383e-07
-9.26564390831e-07
7.78607593939e-07
-5.92181390995e-07
8.65578252355e-07
-4.34826107402e-07
9.34803223342e-07
-3.44802511774e-07
1.00095624664e-06
-2.72904926566e-07
1.05456207768e-06
-1.88190607075e-07
1.04617073664e-06
-3.07170104844e-08
9.87875372024e-07
1.64660147715e-07
9.21102632094e-07
3.25173654065e-07
8.3546993108e-07
4.69590602462e-07
7.14445024765e-07
6.22622217064e-07
5.79522043074e-07
7.50806216752e-07
4.37665465754e-07
7.7806837174e-07
2.91498526894e-07
8.0466405938e-07
1.45012718144e-07
1.02616321392e-06
1.08777194255e-06
-4.81995798617e-08
5.58691727996e-07
-2.06710225217e-07
7.51614560194e-07
-2.74789766381e-07
9.24747237423e-07
-2.24180631422e-07
6.75511423516e-07
-2.9016135626e-07
4.27892064832e-07
-5.24036317711e-07
6.94995119062e-07
-6.42132578004e-07
8.22413810303e-07
-7.17105514271e-07
7.82609353192e-07
-7.76583470578e-07
7.05939930009e-07
-8.6371002482e-07
6.56191575868e-07
-8.299525538e-07
4.30103622966e-07
-7.91221028872e-07
2.16751420969e-07
-8.5184253228e-07
2.14456833053e-07
-9.45226383495e-07
2.39829477003e-07
-1.10496277047e-06
3.52975108663e-07
-1.27434216998e-06
4.62329482212e-07
-1.3432734702e-06
4.35554656751e-07
-1.37167901545e-06
3.9002277031e-07
-1.45421568124e-06
4.41484173739e-07
-1.53943444405e-06
4.92188986264e-07
-1.60323655556e-06
4.90637533793e-07
-1.66094536201e-06
4.6393109716e-07
-1.7161872234e-06
4.29301271311e-07
-1.75860008568e-06
3.82555395574e-07
-1.78761573681e-06
3.31233760699e-07
-1.81872012601e-06
2.84240761754e-07
-1.83537085598e-06
2.48087204907e-07
-1.86408485055e-06
2.23270731803e-07
-1.87264078312e-06
1.65491986064e-07
-1.86987578628e-06
9.73345753404e-08
-1.89364010851e-06
9.28897476588e-08
-1.92918297374e-06
1.01237927943e-07
-1.98761196036e-06
1.19244004397e-07
-2.05176177722e-06
1.63965220351e-07
-2.11882011352e-06
1.96628427058e-07
-2.15017342969e-06
1.7720355641e-07
-2.1645862398e-06
1.5130520198e-07
-2.17402795908e-06
1.23336575847e-07
-2.18083727859e-06
9.08455913861e-08
-2.18537939222e-06
5.34465797615e-08
-2.18851175356e-06
1.24233813386e-08
-2.18896439951e-06
-2.8725359381e-08
-2.18382280904e-06
-6.68108297994e-08
-2.17166121771e-06
-1.01879214187e-07
-2.15284532816e-06
-1.36294742147e-07
-2.1281616476e-06
-1.72507571567e-07
-2.09800199866e-06
-2.12393680719e-07
-2.06212992356e-06
-2.57586451204e-07
-2.01977381619e-06
-3.09845533377e-07
-1.96955067968e-06
-3.71196420019e-07
-1.9092323564e-06
-4.4398129862e-07
-1.8357609607e-06
-5.3086142001e-07
-1.74514154365e-06
-6.34755976489e-07
-1.63140078573e-06
-7.59325166558e-07
-1.48632111708e-06
-9.09820524554e-07
-1.30376056361e-06
-1.0904954835e-06
-1.08340884976e-06
-1.29527791144e-06
-8.3099635342e-07
-1.50411672336e-06
-5.57987565924e-07
-1.68876624965e-06
-2.8391916107e-07
-1.81131457705e-06
-4.45692382257e-08
-1.82116918863e-06
1.51332768063e-07
-1.71719091669e-06
3.50860819756e-07
-1.57474846707e-06
4.61649371253e-07
-1.4049049374e-06
6.46407330111e-07
-1.11156757985e-06
7.82384790728e-07
-7.28363567563e-07
9.06546725107e-07
-5.59218120166e-07
1.00700109574e-06
-4.45463062682e-07
1.07366422482e-06
-3.39820063269e-07
1.08674466493e-06
-2.01426592473e-07
1.05013578747e-06
5.67843671235e-09
1.00856540556e-06
2.06135788353e-07
9.58473975248e-07
3.75229328658e-07
8.75545513696e-07
5.5235652628e-07
7.54449306478e-07
7.43805324368e-07
6.34211481061e-07
8.70995508797e-07
4.69784282475e-07
9.42423645474e-07
2.9859467885e-07
9.75869140706e-07
1.62558884207e-07
1.16209265172e-06
1.25022444441e-06
-9.17654495527e-08
6.50444392189e-07
-2.36251488728e-07
8.96140835406e-07
-2.58941424018e-07
9.47462893064e-07
-1.65257411713e-07
5.8184137959e-07
-3.34301491692e-07
5.96943343551e-07
-5.34551053889e-07
8.95254039256e-07
-6.14208540591e-07
9.02099254806e-07
-6.9636273091e-07
8.64794056236e-07
-6.97444666836e-07
7.07082388e-07
-7.16276533815e-07
6.75064188886e-07
-6.74072071079e-07
3.87925658236e-07
-7.63901731401e-07
3.06583800643e-07
-8.46479908981e-07
2.97019635799e-07
-9.82702918123e-07
3.76032221482e-07
-1.15357887677e-06
5.23832539406e-07
-1.23767508647e-06
5.4641618697e-07
-1.26513516725e-06
4.63011495858e-07
-1.35289380859e-06
4.77774087286e-07
-1.45546959232e-06
5.44050592943e-07
-1.5272966966e-06
5.64008098987e-07
-1.58502263259e-06
5.48355317688e-07
-1.64081390636e-06
5.19707416487e-07
-1.70165327856e-06
4.90132224455e-07
-1.75781562278e-06
4.38708504164e-07
-1.77782192855e-06
3.51222280687e-07
-1.8131233101e-06
3.19526673365e-07
-1.83310441182e-06
2.68046142112e-07
-1.82072509612e-06
2.10866404984e-07
-1.8291517641e-06
1.73886804404e-07
-1.90113740841e-06
1.69276788886e-07
-1.94188738631e-06
1.33584517551e-07
-1.94547588499e-06
1.04742655039e-07
-2.01402840221e-06
1.87697059042e-07
-2.0978319239e-06
2.47658406572e-07
-2.13496467973e-06
2.33649862642e-07
-2.15805267964e-06
2.00179156018e-07
-2.17336795978e-06
1.66503036755e-07
-2.18417982512e-06
1.34023698681e-07
-2.19233803018e-06
9.88685751887e-08
-2.19805736593e-06
5.90196544933e-08
-2.2012520318e-06
1.54611388494e-08
-2.20105959913e-06
-2.90810902741e-08
-2.19575205245e-06
-7.22843997574e-08
-2.18413373605e-06
-1.13662303104e-07
-2.16620123538e-06
-1.54389472983e-07
-2.14249203813e-06
-1.96375555886e-07
-2.11333626496e-06
-2.417035703e-07
-2.07862949073e-06
-2.92446428227e-07
-2.03788672517e-06
-3.50733509924e-07
-1.99012566047e-06
-4.19107582418e-07
-1.93344540648e-06
-5.00818728795e-07
-1.86449407939e-06
-5.99945524677e-07
-1.77781258258e-06
-7.21617483536e-07
-1.66521172723e-06
-8.72063971751e-07
-1.51755759554e-06
-1.05762874673e-06
-1.32903436265e-06
-1.2791928591e-06
-1.09978630709e-06
-1.52467319393e-06
-8.33755935117e-07
-1.77032464931e-06
-5.38310069824e-07
-1.9843700722e-06
-2.40053765725e-07
-2.10978870891e-06
1.35347619711e-08
-2.07499123926e-06
2.16771636761e-07
-1.92068253216e-06
3.7740412712e-07
-1.73564523527e-06
4.96384924977e-07
-1.52414882881e-06
6.62726189141e-07
-1.27818574559e-06
8.26279855866e-07
-8.92156788678e-07
9.53269541788e-07
-6.86419579968e-07
1.05473933482e-06
-5.47189963056e-07
1.1047191824e-06
-3.89962780222e-07
1.09974670532e-06
-1.96709058018e-07
1.07774830634e-06
2.76120091936e-08
1.06134060039e-06
2.22425331263e-07
1.02785031409e-06
4.08552096414e-07
9.53399531362e-07
6.26928508666e-07
8.40908861289e-07
8.56071890979e-07
7.02839226373e-07
1.00910495297e-06
5.23568553099e-07
1.12172972475e-06
3.13198383781e-07
1.18606062106e-06
1.5986070295e-07
1.31528270826e-06
1.41008189884e-06
-1.233777285e-07
7.73866296777e-07
-2.33987517547e-07
1.00678697812e-06
-2.07233078258e-07
9.20750983498e-07
-2.14602610651e-07
5.89221527389e-07
-4.14823643817e-07
7.97175955731e-07
-5.01783124689e-07
9.8223571567e-07
-5.75713391222e-07
9.76068165732e-07
-6.50844086083e-07
9.39969706002e-07
-6.66589222915e-07
7.2286049711e-07
-6.86517205795e-07
6.95035366448e-07
-6.94838375316e-07
3.96252481979e-07
-7.71305677654e-07
3.83045326572e-07
-8.70145481753e-07
3.95838251413e-07
-1.02916882054e-06
5.35030585284e-07
-1.17607415475e-06
6.70733678816e-07
-1.21787899117e-06
5.88225454325e-07
-1.26004651653e-06
5.05175966769e-07
-1.35204288405e-06
5.69762337473e-07
-1.44163913787e-06
6.33639942386e-07
-1.5117528848e-06
6.34114527376e-07
-1.56947157601e-06
6.06060612382e-07
-1.6142362948e-06
5.64468576078e-07
-1.65201867651e-06
5.27914994264e-07
-1.69166426066e-06
4.78347841786e-07
-1.72535250054e-06
3.84906492717e-07
-1.74551807101e-06
3.39676964888e-07
-1.78877043113e-06
3.11277316407e-07
-1.83704483561e-06
2.59115460283e-07
-1.87573997863e-06
2.12553483424e-07
-1.90011943425e-06
1.93612069481e-07
-1.94099641164e-06
1.74390510548e-07
-2.03496764675e-06
1.98621985151e-07
-2.08671062836e-06
2.39335443008e-07
-2.11850904905e-06
2.79352317482e-07
-2.14516269704e-06
2.60201930669e-07
-2.16700888709e-06
2.21919644203e-07
-2.1839428557e-06
1.83323640009e-07
-2.19632505244e-06
1.46281592615e-07
-2.20551680415e-06
1.0792478064e-07
-2.21214230254e-06
6.54968079972e-08
-2.21578626604e-06
1.8946746491e-08
-2.21546654089e-06
-2.95678485844e-08
-2.21006593842e-06
-7.78565859619e-08
-2.19879855874e-06
-1.25104706009e-07
-2.18147595858e-06
-1.71888034215e-07
-2.15837407354e-06
-2.19653863701e-07
-2.12988333432e-06
-2.70370134287e-07
-2.09623479496e-06
-3.26262071392e-07
-2.05746043434e-06
-3.89684440455e-07
-2.01318825222e-06
-4.63548267535e-07
-1.96201926326e-06
-5.52140920573e-07
-1.90050067995e-06
-6.6166753481e-07
-1.82185519935e-06
-8.00378904151e-07
-1.71607365954e-06
-9.78007900696e-07
-1.57214172307e-06
-1.20171940799e-06
-1.38221055647e-06
-1.46923688301e-06
-1.14255722268e-06
-1.76448612032e-06
-8.4896477721e-07
-2.06402006806e-06
-5.09218725922e-07
-2.32432961663e-06
-1.79280995254e-07
-2.43992411491e-06
6.63143083378e-08
-2.32083827357e-06
2.49964464656e-07
-2.10457494066e-06
4.1684828048e-07
-1.90277354737e-06
5.76658727536e-07
-1.6842164344e-06
7.11471207235e-07
-1.41325995838e-06
8.90048117658e-07
-1.0710091578e-06
1.03695818068e-06
-8.33601911161e-07
1.12522700377e-06
-6.35647820224e-07
1.15326382221e-06
-4.18289549346e-07
1.13669804632e-06
-1.80199027106e-07
1.13053816052e-06
3.35010428913e-08
1.13807732229e-06
2.147446052e-07
1.12957191975e-06
4.17113708223e-07
1.06939179239e-06
6.86701781065e-07
9.49908623217e-07
9.757170659e-07
7.73504774571e-07
1.18536515048e-06
5.68498313013e-07
1.32655814615e-06
3.335977124e-07
1.4209393794e-06
1.48613367918e-07
1.50021845923e-06
1.55856904137e-06
-1.47281490274e-07
9.21128366284e-07
-2.46824653769e-07
1.10634589634e-06
-1.90141572348e-07
8.64082893856e-07
-2.64724972583e-07
6.63823395646e-07
-4.404156537e-07
9.72892058712e-07
-4.63682926866e-07
1.00554454982e-06
-5.28723806299e-07
1.04113836138e-06
-5.49762640193e-07
9.61052414704e-07
-6.0765478628e-07
7.80780195392e-07
-5.95820828309e-07
6.83213971503e-07
-6.72413227705e-07
4.72846445433e-07
-7.69072343484e-07
4.79685353816e-07
-8.81280766801e-07
5.08030953309e-07
-1.02933162765e-06
6.83073270593e-07
-1.11149418315e-06
7.52893583572e-07
-1.13270074372e-06
6.09434671102e-07
-1.22495885014e-06
5.97431354931e-07
-1.32982962337e-06
6.74627162509e-07
-1.41381549232e-06
7.176196668e-07
-1.48898497517e-06
7.0927547417e-07
-1.55673495099e-06
6.7381318105e-07
-1.61467480769e-06
6.22410001792e-07
-1.64159074773e-06
5.5482909299e-07
-1.65820428157e-06
4.94963865592e-07
-1.71786150269e-06
4.44556520803e-07
-1.74197160169e-06
3.63772006931e-07
-1.73100321673e-06
3.00297817035e-07
-1.74569609982e-06
2.73789954471e-07
-1.80107729313e-06
2.67898344296e-07
-1.88535178507e-06
2.77834813948e-07
-1.95914084832e-06
2.48104606806e-07
-2.0206040543e-06
2.59989835605e-07
-2.09737707608e-06
3.1600470722e-07
-2.13330691433e-06
3.15187987562e-07
-2.15697639309e-06
2.83777309889e-07
-2.17871639951e-06
2.43558693522e-07
-2.19714301625e-06
2.0163851076e-07
-2.21099170091e-06
1.60007979026e-07
-2.22092451717e-06
1.17722531773e-07
-2.22802703617e-06
7.24528989118e-08
-2.23212397413e-06
2.28846463348e-08
-2.23205213535e-06
-2.98080400974e-08
-2.22674345982e-06
-8.33428750473e-08
-2.21563752803e-06
-1.36395023883e-07
-2.19859219661e-06
-1.89125607024e-07
-2.17573189806e-06
-2.42712480191e-07
-2.14744355803e-06
-2.98855468102e-07
-2.11444556425e-06
-3.59472028315e-07
-2.07762430956e-06
-4.26694337447e-07
-2.03768471437e-06
-5.03690158058e-07
-1.99426156735e-06
-5.95789202658e-07
-1.94433616528e-06
-7.11718094939e-07
-1.88063074339e-06
-8.64288815117e-07
-1.79068388394e-06
-1.06807945895e-06
-1.65943660222e-06
-1.33306885894e-06
-1.47234713104e-06
-1.65649716238e-06
-1.21392627336e-06
-2.02300267831e-06
-8.6444672658e-07
-2.41372775259e-06
-4.60294563169e-07
-2.72863989064e-06
-1.24295612536e-07
-2.77616942702e-06
6.74595121067e-08
-2.51282605301e-06
2.3664912626e-07
-2.27401177497e-06
4.48852969215e-07
-2.11521545842e-06
6.77469625766e-07
-1.91305935344e-06
8.94971676053e-07
-1.63101767948e-06
1.11726120576e-06
-1.2935933924e-06
1.20783495244e-06
-9.24435970526e-07
1.18955586682e-06
-6.17685207664e-07
1.18853513298e-06
-4.17323080815e-07
1.17603704545e-06
-1.68030230319e-07
1.18453753489e-06
2.49969070768e-08
1.2206874423e-06
1.78483201889e-07
1.26548733228e-06
3.71858290438e-07
1.23949662467e-06
7.12896501801e-07
1.07883939234e-06
1.13595394497e-06
8.40053457738e-07
1.42411548728e-06
5.9227538709e-07
1.57436362922e-06
3.5227094064e-07
1.66077102875e-06
1.52155691841e-07
1.70012451021e-06
1.71093316112e-06
-1.39626709158e-07
1.06081017068e-06
-2.18008525929e-07
1.18477401627e-06
-1.94140553936e-07
8.40240507189e-07
-3.27373208814e-07
7.97078502166e-07
-3.79662141583e-07
1.02521043787e-06
-4.25311494929e-07
1.05121253745e-06
-4.91706852164e-07
1.1075875171e-06
-4.75944800822e-07
9.45302650782e-07
-5.86387017673e-07
8.91252545802e-07
-5.6852395865e-07
6.65359961893e-07
-6.61686344759e-07
5.66003276204e-07
-7.62536555005e-07
5.80529172861e-07
-8.84481193215e-07
6.29952216387e-07
-1.02474687706e-06
8.23333627161e-07
-1.08126167487e-06
8.09418696419e-07
-1.11210458325e-06
6.40277087569e-07
-1.20255903624e-06
6.87879613463e-07
-1.29986901658e-06
7.7193235673e-07
-1.37758794365e-06
7.95337489021e-07
-1.44784097342e-06
7.79535818344e-07
-1.52147980688e-06
7.47447992313e-07
-1.61466163296e-06
7.15591605316e-07
-1.65366993377e-06
5.93841990114e-07
-1.65230196876e-06
4.93592041666e-07
-1.65147280829e-06
4.437177392e-07
-1.68738337507e-06
3.99679556117e-07
-1.76234676189e-06
3.75249412474e-07
-1.83223615408e-06
3.43656483492e-07
-1.85984480642e-06
2.95473843723e-07
-1.84306529833e-06
2.60995801488e-07
-1.8978368194e-06
3.02791751467e-07
-2.01422311229e-06
3.76282854533e-07
-2.10038373974e-06
4.0207575168e-07
-2.14034759062e-06
3.55065982641e-07
-2.16748768003e-06
3.10828626653e-07
-2.1914346945e-06
2.67408215724e-07
-2.21194542564e-06
2.220414928e-07
-2.22780119844e-06
1.75743114199e-07
-2.23880424831e-06
1.28593365532e-07
-2.24615297142e-06
7.96557447642e-08
-2.25056725106e-06
2.7141384065e-08
-2.25094203444e-06
-2.96042705269e-08
-2.24583914399e-06
-8.86301025431e-08
-2.23474188986e-06
-1.47692644817e-07
-2.21760122313e-06
-2.06482395864e-07
-2.19445185385e-06
-2.66087703537e-07
-2.16572310764e-06
-3.2783061834e-07
-2.13261050456e-06
-3.92797105421e-07
-2.09719943742e-06
-4.62367630015e-07
-2.06184420587e-06
-5.39269001848e-07
-2.02824648584e-06
-6.29550743827e-07
-1.99545941134e-06
-7.44742108661e-07
-1.95646061785e-06
-9.0337312784e-07
-1.89586641315e-06
-1.1287944134e-06
-1.79063105666e-06
-1.43846402878e-06
-1.61102710215e-06
-1.83620436954e-06
-1.31765349314e-06
-2.31660865186e-06
-8.76881244065e-07
-2.85465481593e-06
-4.07586878141e-07
-3.1981954872e-06
-1.1122412501e-07
-3.07278202053e-06
-1.42317043114e-08
-2.61009468026e-06
1.54198242254e-07
-2.44272062635e-06
4.47693661379e-07
-2.40897520049e-06
7.80841002355e-07
-2.24645504941e-06
1.09673920358e-06
-1.94716217662e-06
1.35224100616e-06
-1.54935616012e-06
1.48980301183e-06
-1.06236226675e-06
1.46232319096e-06
-5.90324908346e-07
1.27272317757e-06
-2.28026094038e-07
1.1946685241e-06
-8.98914311509e-08
1.1944309564e-06
2.49327040332e-08
1.27384977795e-06
9.86913561801e-08
1.43960527441e-06
2.06152830102e-07
1.50016966362e-06
6.51725726157e-07
1.25058856687e-06
1.38562657564e-06
9.00414117289e-07
1.77421191726e-06
6.0712290385e-07
1.86743882679e-06
3.66069005835e-07
1.90178048287e-06
1.67374095597e-07
1.89920266496e-06
1.87818472101e-06
-1.03257405329e-07
1.16403976005e-06
-1.56584060716e-07
1.23809949135e-06
-2.25154683996e-07
9.08825419355e-07
-3.34177103666e-07
9.06113906246e-07
-3.02943684632e-07
9.93995154696e-07
-3.88864750383e-07
1.13717433336e-06
-4.74406415816e-07
1.19312848432e-06
-4.46318676779e-07
9.17260578983e-07
-5.72641282827e-07
1.01758047766e-06
-5.92275976762e-07
6.85004848417e-07
-6.64686635639e-07
6.38413061805e-07
-7.57223613847e-07
6.73045625516e-07
-8.77530868935e-07
7.50262900829e-07
-1.01354846087e-06
9.59348693601e-07
-1.03329104022e-06
8.29161667019e-07
-1.07879575251e-06
6.8578215227e-07
-1.1761498513e-06
7.85230261072e-07
-1.26811046766e-06
8.6389256198e-07
-1.34248339766e-06
8.69716370443e-07
-1.4075000307e-06
8.44553924045e-07
-1.4718942027e-06
8.11853278272e-07
-1.55154913555e-06
7.95249804964e-07
-1.61866453406e-06
6.60952414437e-07
-1.6470896765e-06
5.22007341267e-07
-1.66861481304e-06
4.65240329035e-07
-1.72994442778e-06
4.61005931017e-07
-1.75584768601e-06
4.01143613264e-07
-1.75709264787e-06
3.44880205988e-07
-1.83095897889e-06
3.69289396681e-07
-1.92819667352e-06
3.58164235972e-07
-1.99812439697e-06
3.72644614064e-07
-2.06616793364e-06
4.442413655e-07
-2.10427895104e-06
4.40108261236e-07
-2.14342905607e-06
3.94138196485e-07
-2.1763336699e-06
3.43649601972e-07
-2.20364751776e-06
2.94629132304e-07
-2.22698891559e-06
2.45277982035e-07
-2.24620583136e-06
1.94844198099e-07
-2.25991850711e-06
1.42177221146e-07
-2.26783958708e-06
8.74363129219e-08
-2.27164765548e-06
3.07945795082e-08
-2.27195560627e-06
-2.94662292785e-08
-2.26727349796e-06
-9.35013790454e-08
-2.25624568294e-06
-1.58931588749e-07
-2.23866221248e-06
-2.2429778968e-07
-2.2146274199e-06
-2.90385134055e-07
-2.18453467038e-06
-3.58161581713e-07
-2.15006184512e-06
-4.27584433699e-07
-2.11450106988e-06
-4.98144513843e-07
-2.08279537556e-06
-5.71247529876e-07
-2.06030211432e-06
-6.52306147157e-07
-2.05035345946e-06
-7.54800669824e-07
-2.04931799468e-06
-9.04574565535e-07
-2.03845875625e-06
-1.13979611507e-06
-1.98177980767e-06
-1.49525159313e-06
-1.81965430653e-06
-1.99856678761e-06
-1.47955151046e-06
-2.65689026139e-06
-9.22682743464e-07
-3.41185608306e-06
-3.8881767388e-07
-3.73236512194e-06
-1.38302678814e-07
-3.32359194757e-06
-1.9191089819e-07
-2.55675976818e-06
-2.68883714334e-08
-2.6080471213e-06
3.97165543893e-07
-2.83333490991e-06
8.72219611908e-07
-2.72178814616e-06
1.29995573173e-06
-2.37516882363e-06
1.62690019196e-06
-1.87658368794e-06
1.80312130378e-06
-1.23880948668e-06
1.72511562983e-06
-5.12674997012e-07
1.44331019743e-06
5.377400574e-08
1.2118925681e-06
1.41192005146e-07
1.12521583318e-06
1.11379712213e-07
1.24069944126e-06
-1.70048598773e-08
1.66631684779e-06
-2.20097916674e-07
1.9473282587e-06
3.70857368996e-07
1.48248114479e-06
1.85025161133e-06
9.28589732821e-07
2.32793861431e-06
5.9222358504e-07
2.20385647687e-06
3.39622761782e-07
2.15442571837e-06
1.58219793386e-07
2.08026334695e-06
2.03679753548e-06
-6.91055272428e-08
1.23320370932e-06
-9.2553528921e-08
1.26158838569e-06
-2.45566448143e-07
1.06185602104e-06
-3.04207163657e-07
9.6477348032e-07
-3.0930680249e-07
9.99109741786e-07
-3.87579576433e-07
1.21544899488e-06
-4.45200051539e-07
1.25079473439e-06
-4.41641787423e-07
9.13698535735e-07
-5.50505273715e-07
1.12648328549e-06
-5.89534547354e-07
7.24040273117e-07
-6.60238653557e-07
7.09114074684e-07
-7.44359996409e-07
7.57170025634e-07
-8.4487063363e-07
8.50757335334e-07
-9.27999513572e-07
1.04249380966e-06
-9.221606291e-07
8.23330665545e-07
-1.02113192071e-06
7.847510745e-07
-1.13898274734e-06
9.03078722419e-07
-1.23046476357e-06
9.55377340993e-07
-1.30496845341e-06
9.44228361833e-07
-1.37018974289e-06
9.0979246596e-07
-1.43254835594e-06
8.74218256182e-07
-1.48780784907e-06
8.50512614039e-07
-1.51195869398e-06
6.85097039408e-07
-1.56627610507e-06
5.76323145904e-07
-1.64669151585e-06
5.45654104323e-07
-1.6591348082e-06
4.73443540853e-07
-1.68374648385e-06
4.25738605249e-07
-1.74472408346e-06
4.05822423836e-07
-1.77363082628e-06
3.98150731219e-07
-1.8294068788e-06
4.13880322856e-07
-1.95801294934e-06
5.01180238776e-07
-2.06085921814e-06
5.4702246477e-07
-2.11024314385e-06
4.8942810213e-07
-2.14990061512e-06
4.33726835417e-07
-2.18658660023e-06
3.80258370474e-07
-2.21821391427e-06
3.26168993701e-07
-2.24376259546e-06
2.70728797252e-07
-2.26431443788e-06
2.15286474178e-07
-2.28122901942e-06
1.58971700164e-07
-2.29260537681e-06
9.86790588256e-08
-2.29717155872e-06
3.52138688114e-08
-2.2965351036e-06
-3.02677306573e-08
-2.29127919728e-06
-9.89484243765e-08
-2.28014326752e-06
-1.70288792844e-07
-2.26205735064e-06
-2.42647705077e-07
-2.23663926454e-06
-3.16065624936e-07
-2.20413500736e-06
-3.91023733425e-07
-2.16621616513e-06
-4.65728326606e-07
-2.12773988298e-06
-5.37031607277e-07
-2.0964962734e-06
-6.0276558527e-07
-2.08338749581e-06
-6.65640910599e-07
-2.10050777774e-06
-7.37891606292e-07
-2.15387934184e-06
-8.5134453866e-07
-2.2240115411e-06
-1.06978672341e-06
-2.25751211398e-06
-1.46199520277e-06
-2.13501802484e-06
-2.1212165283e-06
-1.78957928936e-06
-3.0026973502e-06
-1.10939623921e-06
-4.09233095926e-06
-4.33521715431e-07
-4.40848930666e-06
-8.03708462755e-08
-3.67688548856e-06
-4.78791510679e-07
-2.15854347073e-06
-3.83338701578e-07
-2.70366572315e-06
2.68008922405e-07
-3.48485255041e-06
1.00688216538e-06
-3.46084222713e-06
1.64741499323e-06
-3.01587704344e-06
2.11606543542e-06
-2.34543825715e-06
2.34118282233e-06
-1.46413554125e-06
2.2164393495e-06
-3.88023020781e-07
1.74152532408e-06
5.28415159084e-07
1.20683198515e-06
6.7577946056e-07
9.23779008779e-07
3.94182065312e-07
1.01162653743e-06
-1.05192181449e-07
2.02900387025e-06
-1.2372070735e-06
2.95615419235e-06
-5.56490258578e-07
1.8184627931e-06
2.98792613772e-06
8.17992535867e-07
3.32844067419e-06
4.94499262445e-07
2.52708899315e-06
2.41952184614e-07
2.40671508397e-06
1.14519258645e-07
2.20844460355e-06
2.15165936199e-06
-7.80494820486e-08
1.31121591915e-06
-1.3853955417e-07
1.32207094156e-06
-2.07354815792e-07
1.13069618752e-06
-2.61945813185e-07
1.01937307114e-06
-3.2389071901e-07
1.06106778881e-06
-3.9845782732e-07
1.29004617534e-06
-4.39096625656e-07
1.29143388097e-06
-4.92979104088e-07
9.67621923057e-07
-5.40868888312e-07
1.17438137546e-06
-5.82690288319e-07
7.6587472239e-07
-6.54651661551e-07
7.81077470984e-07
-7.34457108652e-07
8.3696634366e-07
-8.2521824089e-07
9.41538837961e-07
-8.90483808082e-07
1.10775912439e-06
-9.19500610508e-07
8.52353063428e-07
-1.01458121093e-06
8.79833842869e-07
-1.11359951661e-06
1.00209757512e-06
-1.19486959726e-06
1.03665387213e-06
-1.26570749037e-06
1.01507947144e-06
-1.33218105782e-06
9.76279875104e-07
-1.39649438245e-06
9.38548743297e-07
-1.44372741927e-06
8.97747666599e-07
-1.50129907338e-06
7.42671295933e-07
-1.59389300898e-06
6.68913208643e-07
-1.62627227762e-06
5.78025656113e-07
-1.65760260052e-06
5.04762492294e-07
-1.74464377162e-06
5.12764791138e-07
-1.78805723678e-06
4.49203505273e-07
-1.81045956617e-06
4.20502683428e-07
-1.9216456277e-06
5.25010572795e-07
-2.02770156743e-06
6.07181861066e-07
-2.06745598542e-06
5.86724852338e-07
-2.11276757714e-06
5.346847627e-07
-2.15734944722e-06
4.78246703014e-07
-2.19689890441e-06
4.19737016628e-07
-2.2312738213e-06
3.60463664467e-07
-2.26227243281e-06
3.01637280359e-07
-2.28690071544e-06
2.3981536649e-07
-2.30470001415e-06
1.76661013421e-07
-2.31808332691e-06
1.1194160997e-07
-2.3255039371e-06
4.24976164079e-08
-2.32558752452e-06
-3.03428806337e-08
-2.31930466547e-06
-1.05420478178e-07
-2.30709723938e-06
-1.82724206993e-07
-2.28820596424e-06
-2.61790714773e-07
-2.26140278707e-06
-3.43212666641e-07
-2.22557533642e-06
-4.27092956489e-07
-2.181773399e-06
-5.09998754717e-07
-2.13521863673e-06
-5.83859510361e-07
-2.0976083665e-06
-6.40760980088e-07
-2.08636041254e-06
-6.77168029647e-07
-2.12757762477e-06
-6.96888693625e-07
-2.25208891809e-06
-7.27037817916e-07
-2.45088896726e-06
-8.7125011811e-07
-2.66843461406e-06
-1.24469189592e-06
-2.65000429804e-06
-2.14014723134e-06
-2.52042570479e-06
-3.13256296277e-06
-1.63495753446e-06
-4.97806745505e-06
-4.49769380902e-07
-5.59380531176e-06
3.95699523666e-07
-4.52251842568e-06
-8.74762640229e-07
-8.88100771415e-07
-3.29343684966e-07
-3.24915959771e-06
1.74281065672e-06
-5.55712824956e-06
3.90402564666e-06
-5.62218460178e-06
5.32626495483e-06
-4.43828715847e-06
5.75016629076e-06
-2.76948959763e-06
5.45441902709e-06
-1.16849798707e-06
4.972824709e-06
9.33504051562e-08
4.20176419612e-06
1.29944494105e-06
2.51792090344e-06
2.35928541774e-06
6.94761865796e-07
2.21724140597e-06
4.4373387961e-07
1.46145003944e-07
3.12978391842e-06
-3.92344549812e-06
5.47070382753e-06
-2.89726661083e-06
2.36618642078e-06
6.09243500118e-06
3.48334698469e-07
5.34604961585e-06
3.193038262e-07
2.55598751114e-06
8.62827936167e-08
2.64001345284e-06
6.72665443976e-08
2.2279168146e-06
2.2189373844e-06
-8.6412601988e-08
1.39769071602e-06
-1.66707190086e-07
1.4024284725e-06
-1.1700194463e-07
1.08100543483e-06
-2.12827247752e-07
1.11521760311e-06
-3.1965139251e-07
1.16790246495e-06
-4.01093919818e-07
1.37149971242e-06
-4.44278888929e-07
1.33464928384e-06
-5.45948209715e-07
1.06929988902e-06
-5.18612237706e-07
1.14707652022e-06
-5.71828352442e-07
8.19095940315e-07
-6.50382122476e-07
8.59631894139e-07
-7.31565059259e-07
9.18152298562e-07
-8.224972797e-07
1.03246459734e-06
-8.8076303683e-07
1.16605010407e-06
-9.33563060802e-07
9.05158351281e-07
-1.02129290255e-06
9.67564358409e-07
-1.10106782964e-06
1.08187918852e-06
-1.16966120836e-06
1.10525914868e-06
-1.23589984921e-06
1.08133628724e-06
-1.30211185077e-06
1.04251349031e-06
-1.3670431547e-06
1.0034927238e-06
-1.42183683054e-06
9.52551584319e-07
-1.49586318876e-06
8.16697913577e-07
-1.53322736365e-06
7.06272154113e-07
-1.56202409918e-06
6.06819717271e-07
-1.64544745671e-06
5.8818360929e-07
-1.68515602668e-06
5.52459542294e-07
-1.79194086846e-06
5.55960274222e-07
-1.93283354045e-06
5.6134840246e-07
-2.00773146774e-06
5.99855035355e-07
-2.04528402602e-06
6.44684636619e-07
-2.0841170392e-06
6.25512528757e-07
-2.12732396126e-06
5.77843628257e-07
-2.1686821195e-06
5.19550810088e-07
-2.20886529224e-06
4.59858378646e-07
-2.24697446339e-06
3.98503092549e-07
-2.28049555559e-06
3.35080894693e-07
-2.30963194902e-06
2.68867074144e-07
-2.33224523643e-06
1.9918174562e-07
-2.3473206358e-06
1.26911236609e-07
-2.35645783196e-06
5.15163930187e-08
-2.3584440524e-06
-2.85029796886e-08
-2.35208019314e-06
-1.11957486629e-07
-2.33815421292e-06
-1.96871625522e-07
-2.31809488514e-06
-2.82141610909e-07
-2.2906177503e-06
-3.70958059214e-07
-2.25114918281e-06
-4.6702644197e-07
-2.1974280229e-06
-5.64035697362e-07
-2.13630170969e-06
-6.45530965222e-07
-2.08161538319e-06
-6.95846288137e-07
-2.05389986425e-06
-7.05306045872e-07
-2.0974998562e-06
-6.53648930482e-07
-2.30380822698e-06
-5.21060536005e-07
-2.71282334242e-06
-4.62805791663e-07
-3.35554454087e-06
-6.02633666188e-07
-3.52575682377e-06
-1.97042858747e-06
-4.00206917107e-06
-2.65677481854e-06
-1.87349780787e-06
-7.10724813801e-06
1.99299522173e-06
-9.4607909343e-06
9.42029043421e-06
-1.19500809675e-05
2.94913257623e-05
-2.0959420772e-05
5.59695994339e-05
-2.97279185457e-05
7.75439495289e-05
-2.71318259402e-05
9.52825018397e-05
-2.33610407072e-05
0.000110411787816
-1.95678591779e-05
0.000123203460739
-1.55614365844e-05
0.000133297091017
-1.1262468643e-05
0.000139993773868
-6.60347249515e-06
0.000142915472099
-1.62269689279e-06
0.000141428497712
3.84603201479e-06
0.000132933005769
1.07126567486e-05
0.00011064541963
2.24331922696e-05
6.41208828481e-05
4.2601302045e-05
2.07615088184e-05
4.04617765924e-05
2.8945762248e-06
2.39589025005e-05
-2.10882421327e-06
1.03489159737e-05
-3.01131289014e-07
7.47787057459e-07
-1.31725862857e-07
2.47046029423e-06
5.19482090799e-08
2.04408222177e-06
2.27081667495e-06
-7.46260758569e-08
1.4722997029e-06
-1.42144237439e-07
1.46992937575e-06
-1.17250401165e-07
1.05613731866e-06
-1.97219460395e-07
1.19519314772e-06
-3.22453727025e-07
1.2931522918e-06
-3.89257938926e-07
1.43832044146e-06
-4.23290895792e-07
1.36870079353e-06
-5.26048611657e-07
1.1720790062e-06
-4.78780436598e-07
1.09981554755e-06
-5.59929887665e-07
9.00253866234e-07
-6.48233284442e-07
9.47931691008e-07
-7.35821331412e-07
1.00574267377e-06
-8.31640359547e-07
1.12830432858e-06
-8.76451761271e-07
1.21086457708e-06
-9.36464966018e-07
9.65181806033e-07
-1.02288597119e-06
1.05399541439e-06
-1.09250901595e-06
1.15151291938e-06
-1.15205930328e-06
1.16482724523e-06
-1.2140100549e-06
1.1433074279e-06
-1.27742353761e-06
1.10594746558e-06
-1.34020943565e-06
1.06629832821e-06
-1.40368421946e-06
1.01603795308e-06
-1.48887320489e-06
9.01886427003e-07
-1.53968356219e-06
7.57088391875e-07
-1.62084451649e-06
6.87980473213e-07
-1.6633519762e-06
6.30685984942e-07
-1.67967506555e-06
5.68770548584e-07
-1.72346102231e-06
5.99720422483e-07
-1.80575993239e-06
6.43607655673e-07
-1.94066702589e-06
7.34710113987e-07
-2.03081511018e-06
7.34790112161e-07
-2.08810636458e-06
6.82765396318e-07
-2.13395728585e-06
6.23654007146e-07
-2.18039186074e-06
5.65938821009e-07
-2.22578016759e-06
5.05194689823e-07
-2.2666505275e-06
4.39315246031e-07
-2.30339887404e-06
3.71766312723e-07
-2.3352765036e-06
3.00676526887e-07
-2.36168019481e-06
2.25509397536e-07
-2.38040997294e-06
1.45556389956e-07
-2.39163892464e-06
6.26390244349e-08
-2.39619132318e-06
-2.40796253029e-08
-2.39157421707e-06
-1.16745705193e-07
-2.37571816422e-06
-2.12946600487e-07
-2.35156415527e-06
-3.06524124114e-07
-2.32127845666e-06
-4.01627119565e-07
-2.27821923994e-06
-5.10385009666e-07
-2.21515223642e-06
-6.27694500687e-07
-2.13515333952e-06
-7.25960177547e-07
-2.04734808894e-06
-7.84210783999e-07
-1.9658391988e-06
-7.87157818025e-07
-1.94505461919e-06
-6.75000144191e-07
-2.21469332779e-06
-2.52320674339e-07
-3.02500848166e-06
3.4691367079e-07
-4.53618580204e-06
9.07748851375e-07
-1.24568025078e-06
-5.26282196243e-06
1.22914488433e-05
-1.61950598808e-05
3.38219351658e-05
-2.86390327553e-05
5.8303613781e-05
-3.39433783661e-05
8.20544019868e-05
-3.5701651543e-05
0.000100163909192
-3.90695075319e-05
0.00011263951887
-4.22039436151e-05
0.000126108402877
-4.06010386308e-05
0.00013949447647
-3.6747416077e-05
0.000151960801145
-3.20344999669e-05
0.000163119332486
-2.67203131807e-05
0.000172615794422
-2.07592344205e-05
0.00018006907201
-1.40571123046e-05
0.000184893665339
-6.44755658977e-06
0.000186345912395
2.39334688328e-06
0.000183943003176
1.31150578493e-05
0.000179398714883
2.69771249456e-05
0.000178500513656
4.34986289114e-05
0.000166546923516
5.24144503744e-05
0.000135568574988
5.49363391752e-05
8.34238079487e-05
6.24921975541e-05
2.99259885598e-05
5.42440556587e-05
8.39598767684e-07
3.15568646052e-05
2.99328390616e-07
2.58418518528e-06
2.56566663337e-06
-6.53688495604e-08
1.53773251423e-06
-1.32886343377e-07
1.53752623349e-06
-1.09371486523e-07
1.03262875276e-06
-1.9875458082e-07
1.28459319185e-06
-3.23348864074e-07
1.41775572113e-06
-3.78135940771e-07
1.49313386209e-06
-3.96243263049e-07
1.38681713654e-06
-5.14791481104e-07
1.29064626829e-06
-5.12653083405e-07
1.0976943698e-06
-5.69992662277e-07
9.57595932972e-07
-6.5169139825e-07
1.02963815875e-06
-7.42540508383e-07
1.09659174757e-06
-8.47007227602e-07
1.23277967586e-06
-8.5981397274e-07
1.22369434176e-06
-9.25898030288e-07
1.03127344098e-06
-1.01423144456e-06
1.14233551123e-06
-1.08196837718e-06
1.21926604691e-06
-1.13506833256e-06
1.21794507617e-06
-1.19390005937e-06
1.2021629588e-06
-1.25488361556e-06
1.16695729032e-06
-1.31764415014e-06
1.12907847338e-06
-1.38503518228e-06
1.08343940531e-06
-1.46462564121e-06
9.81493714666e-07
-1.51612579679e-06
8.08589785948e-07
-1.55826055426e-06
7.30113466146e-07
-1.59075424559e-06
6.63173391258e-07
-1.68294164173e-06
6.60948130126e-07
-1.74609703029e-06
6.62847313556e-07
-1.85213962901e-06
7.4960535475e-07
-1.95097552394e-06
8.33509558204e-07
-2.0140396583e-06
7.97822803037e-07
-2.06968997476e-06
7.38384615388e-07
-2.12334309711e-06
6.77272949564e-07
-2.18169695203e-06
6.2425669952e-07
-2.23736467927e-06
5.60821148891e-07
-2.28490345691e-06
4.86810234904e-07
-2.32637562895e-06
4.13191336609e-07
-2.36409484797e-06
3.3834700482e-07
-2.394512814e-06
2.55872464391e-07
-2.41817809499e-06
1.69155033021e-07
-2.43340320559e-06
7.7777111204e-08
-2.43804087881e-06
-1.95483153971e-08
-2.43174164877e-06
-1.23182215723e-07
-2.41254939649e-06
-2.32276579823e-07
-2.38407593719e-06
-3.35257667027e-07
-2.35368956929e-06
-4.32227983699e-07
-2.31130227069e-06
-5.53280431746e-07
-2.23701854898e-06
-7.02363429246e-07
-2.12927597613e-06
-8.34280107046e-07
-1.99441771701e-06
-9.19327901713e-07
-1.80644207831e-06
-9.76089511505e-07
-1.55536721942e-06
-9.27192496269e-07
-1.72231434037e-06
-8.63398495842e-08
-2.51487999746e-06
1.13834646686e-06
4.22160099064e-06
-5.83119431414e-06
2.54540519195e-05
-2.6498173554e-05
5.11240594796e-05
-4.18663936816e-05
7.25675522456e-05
-5.0083270668e-05
9.28061751028e-05
-5.41826210319e-05
0.000112784047502
-5.56800924807e-05
0.000130144636813
-5.6430594084e-05
0.000144222899307
-5.62826178619e-05
0.000157509674707
-5.38881627094e-05
0.000170335734724
-4.95738059432e-05
0.000182375406971
-4.40745166991e-05
0.000193331962522
-3.76772311816e-05
0.000202942325286
-3.03699519685e-05
0.000210926787059
-2.20418676621e-05
0.000216976787166
-1.24979023993e-05
0.000220928948945
-1.55924214837e-06
0.00022292616472
1.11173083923e-05
0.000223889134956
2.60134455124e-05
0.00022450983971
4.28772713499e-05
0.00021854921819
5.83746331599e-05
0.000202974280389
7.05106524706e-05
0.000182200059954
8.32651103357e-05
0.00014393950856
9.25050136712e-05
7.34677379071e-05
0.00010202754314
1.70208455649e-05
5.90264117915e-05
1.95853103637e-05
-5.09375463361e-08
1.58866815455e-06
-1.02125776495e-07
1.58868745687e-06
-1.1451814316e-07
1.04504347475e-06
-2.25234189989e-07
1.39531496846e-06
-3.23858841313e-07
1.51640599376e-06
-3.76157664272e-07
1.54544008019e-06
-3.90906193107e-07
1.4015991206e-06
-5.15066418415e-07
1.41481987724e-06
-5.28890132544e-07
1.1115267763e-06
-5.78462544839e-07
1.00717994072e-06
-6.51417079997e-07
1.10258978836e-06
-7.3565738242e-07
1.1808491806e-06
-8.32474891428e-07
1.32960996366e-06
-8.21031287588e-07
1.2122577219e-06
-9.04088584929e-07
1.11434106332e-06
-9.93460992882e-07
1.23172212816e-06
-1.06512629956e-06
1.2909453321e-06
-1.1120469837e-06
1.2648901913e-06
-1.17085935229e-06
1.26100080465e-06
-1.22992997419e-06
1.22605134046e-06
-1.29075176836e-06
1.18992561533e-06
-1.36005943227e-06
1.15277293386e-06
-1.43491758458e-06
1.05635875863e-06
-1.4939341403e-06
8.67613487217e-07
-1.55723018816e-06
7.93409772292e-07
-1.65830868244e-06
7.64248757602e-07
-1.77377217233e-06
7.76388366241e-07
-1.85648177386e-06
7.45528670077e-07
-1.91706630918e-06
8.10164368948e-07
-1.95478453299e-06
8.71201876489e-07
-2.01015602098e-06
8.53173324482e-07
-2.05871864722e-06
7.86925604783e-07
-2.11858255593e-06
7.37113456099e-07
-2.18573760622e-06
6.91384726396e-07
-2.23952285647e-06
6.14579096299e-07
-2.29161036181e-06
5.38866736481e-07
-2.34700226446e-06
4.68553721394e-07
-2.39428930533e-06
3.85603430729e-07
-2.43302392299e-06
2.94572218329e-07
-2.45963342251e-06
1.95714669867e-07
-2.4758648656e-06
9.39443597509e-08
-2.48534219074e-06
-1.01553318675e-08
-2.48543852902e-06
-1.2316202594e-07
-2.46010577097e-06
-2.57768063305e-07
-2.37778437897e-06
-4.17708880088e-07
-2.24778431097e-06
-5.62580519554e-07
-2.13220504709e-06
-6.69133010029e-07
-2.07233826003e-06
-7.62677873187e-07
-2.01631226578e-06
-8.90540795938e-07
-1.8781375485e-06
-1.0583454956e-06
-1.55772625017e-06
-1.29739224784e-06
-7.14150355292e-07
-1.77231332604e-06
-2.9220965409e-07
-5.0950740995e-07
6.70610659293e-06
-5.86147758322e-06
3.26083122749e-05
-3.17354031689e-05
6.12545773666e-05
-5.51455418464e-05
8.45173481448e-05
-6.51297120926e-05
0.000104808637457
-7.0374955016e-05
0.000123467174037
-7.28415433527e-05
0.000141112175676
-7.33255117858e-05
0.000157230172101
-7.25489974443e-05
0.000171598610639
-7.06514218891e-05
0.000184947077179
-6.72369581046e-05
0.000197651884732
-6.22789397834e-05
0.000209641885812
-5.60648625699e-05
0.000220736065383
-4.87717668311e-05
0.000230761352053
-4.03955702099e-05
0.000239551647509
-3.08324747318e-05
0.000246972219676
-1.99187856526e-05
0.000252875792423
-7.46323647649e-06
0.000257182644047
6.80991862934e-06
0.0002601632251
2.30323123022e-05
0.00026183432097
4.12057086763e-05
0.000260031019614
6.01775551137e-05
0.000251439927226
7.91013842971e-05
0.000234863884085
9.98410443392e-05
0.000205771168238
0.000121596924673
0.000165392326243
0.000142406364723
7.00316462609e-05
0.000154388739124
8.96165614614e-05
-3.8647461048e-08
1.6273889213e-06
-7.43217255672e-08
1.62444152526e-06
-1.33087355395e-07
1.10381085514e-06
-2.55189125332e-07
1.5174418603e-06
-3.20458976074e-07
1.58168943602e-06
-3.71456567909e-07
1.59647536416e-06
-3.99001836257e-07
1.42915256e-06
-4.93223556455e-07
1.50906755628e-06
-5.26722298042e-07
1.14504360213e-06
-5.7699797148e-07
1.05745854612e-06
-6.4475569167e-07
1.17036238629e-06
-7.18261517131e-07
1.2543531811e-06
-7.93248314974e-07
1.40461641282e-06
-8.04393999473e-07
1.22342007302e-06
-8.87307776368e-07
1.19726497669e-06
-9.69327754861e-07
1.31375517305e-06
-1.03527293452e-06
1.35691600021e-06
-1.08143271046e-06
1.31107046679e-06
-1.1440517067e-06
1.3236463403e-06
-1.20257511222e-06
1.28460846991e-06
-1.25889989857e-06
1.24627758473e-06
-1.33085503165e-06
1.22474561457e-06
-1.40109830929e-06
1.12662519976e-06
-1.46239376756e-06
9.28918164283e-07
-1.52057006453e-06
8.5159089316e-07
-1.56551088811e-06
8.09182061778e-07
-1.60648268234e-06
8.17348125974e-07
-1.6877838365e-06
8.26810596911e-07
-1.80925892976e-06
9.31620548436e-07
-1.91430186473e-06
9.76235933295e-07
-1.97762445912e-06
9.16486476137e-07
-2.04103997124e-06
8.50330391133e-07
-2.11514751772e-06
8.112074773e-07
-2.1740411613e-06
7.50264115524e-07
-2.23131902227e-06
6.71838955889e-07
-2.29999101757e-06
6.07523581331e-07
-2.36245274937e-06
5.31002919854e-07
-2.41774160938e-06
4.40881554867e-07
-2.46607134228e-06
3.42883019854e-07
-2.50625847355e-06
2.35868121964e-07
-2.53288773885e-06
1.20530436001e-07
-2.54012230543e-06
-2.94980302868e-09
-2.5125817552e-06
-1.50771138859e-07
-2.42893435815e-06
-3.41452254547e-07
-2.29909517588e-06
-5.47731363254e-07
-2.16923595747e-06
-6.92544678105e-07
-2.07359974403e-06
-7.64961195107e-07
-1.9840668987e-06
-8.52282030032e-07
-1.8945101027e-06
-9.80386769618e-07
-1.75579798918e-06
-1.19734770905e-06
-1.39114559103e-06
-1.66318196607e-06
6.34230142918e-07
-3.79826916689e-06
8.75148758589e-06
-8.62779182253e-06
3.91155494289e-05
-3.62265449932e-05
7.33045592289e-05
-6.59246484193e-05
9.64266348976e-05
-7.82675762941e-05
0.000116238533154
-8.49416309142e-05
0.000134281136228
-8.84176744883e-05
0.000151167594974
-8.97282028311e-05
0.000167199909967
-8.93580884827e-05
0.000182298346346
-8.76477216488e-05
0.000196373622093
-8.47269865325e-05
0.000209637925159
-8.05015520191e-05
0.000222295091978
-7.49364100827e-05
0.000234357215892
-6.81273107284e-05
0.000245735886945
-6.01507611286e-05
0.000256325862092
-5.09858484655e-05
0.000266021139814
-4.05280099572e-05
0.000274713583499
-2.86115188993e-05
0.000282250008218
-1.50000140909e-05
0.000288633175241
4.26337603509e-07
0.000293814021496
1.78510557642e-05
0.000297485537708
3.75338935459e-05
0.000298287377508
5.93756163852e-05
0.00029382980657
8.35587332022e-05
0.000282184479055
0.00011148611811
0.000259995163272
0.000143786578607
0.000221281531878
0.00018112180775
0.000153338614945
0.000222331466203
0.000242956347126
-3.40239779706e-08
1.66140672489e-06
-6.62281993582e-08
1.65661924615e-06
-1.55314183941e-07
1.19292334404e-06
-2.57612129452e-07
1.61975366304e-06
-2.99969857785e-07
1.62408418133e-06
-3.45571246928e-07
1.64209469808e-06
-4.09348122312e-07
1.49296385025e-06
-4.6258981943e-07
1.56233016729e-06
-5.162328011e-07
1.19869165768e-06
-5.71494264825e-07
1.11273258188e-06
-6.37720336202e-07
1.23658893674e-06
-7.06464762264e-07
1.32312479629e-06
-7.75332930215e-07
1.47349544593e-06
-8.22978778059e-07
1.27107762939e-06
-8.89154796969e-07
1.26345827399e-06
-9.56939261419e-07
1.3815618436e-06
-1.01527562882e-06
1.41527077831e-06
-1.06325789042e-06
1.35908289537e-06
-1.12103059723e-06
1.3814500107e-06
-1.17599545085e-06
1.33959953266e-06
-1.22437298342e-06
1.29468806964e-06
-1.29701898929e-06
1.29742524529e-06
-1.36371993841e-06
1.19334253795e-06
-1.4307549923e-06
9.95967238362e-07
-1.4948023537e-06
9.15643886967e-07
-1.54472797067e-06
8.59105672855e-07
-1.60843924435e-06
8.81052047954e-07
-1.72615661271e-06
9.44515246599e-07
-1.83585295431e-06
1.04131134621e-06
-1.88870257414e-06
1.02908234202e-06
-1.93188370343e-06
9.59671200594e-07
-1.98474569346e-06
9.03190666152e-07
-2.04641891092e-06
8.72876884289e-07
-2.13111193648e-06
8.34951285175e-07
-2.22382268786e-06
7.64544987209e-07
-2.30702581839e-06
6.90725595656e-07
-2.37548621961e-06
5.99469370679e-07
-2.43681897772e-06
5.0221917013e-07
-2.49363139829e-06
3.99690590671e-07
-2.54365524195e-06
2.85881598739e-07
-2.57881282227e-06
1.55688522652e-07
-2.58488342083e-06
3.10732764585e-09
-2.5368887782e-06
-1.9874531009e-07
-2.4481441374e-06
-4.30263594286e-07
-2.36963891089e-06
-6.26220387654e-07
-2.29065439294e-06
-7.71526881007e-07
-2.17916360011e-06
-8.76352533009e-07
-2.03566838999e-06
-9.95737663908e-07
-1.93410794191e-06
-1.08198349147e-06
-2.05376221089e-06
-1.07817121644e-06
-1.76062330909e-06
-1.95644795673e-06
1.36678641814e-05
-1.92277850333e-05
4.9018159195e-05
-4.39784005074e-05
8.65833718307e-05
-7.37913164122e-05
0.000108515271741
-8.78559320072e-05
0.000126820461435
-9.65723317538e-05
0.000143658753397
-0.000101779708637
0.000159696700712
-0.000104455563914
0.000175148238833
-0.000105179801274
0.000190081572485
-0.000104291564823
0.000204450518327
-0.000102016862216
0.000218200590284
-9.84772817267e-05
0.000231387276659
-9.36884807612e-05
0.000244100757225
-8.76501588969e-05
0.000256367625818
-8.03944651973e-05
0.000268157900425
-7.19413220399e-05
0.000279424302311
-6.22525019726e-05
0.000290120664801
-5.1224600477e-05
0.000300206688409
-3.86977585788e-05
0.000309666328468
-2.44599217845e-05
0.000318386465724
-8.29408624976e-06
0.000326066080933
1.01711982971e-05
0.00033248585953
3.11140254329e-05
0.000336807397832
5.50540533264e-05
0.000337515059723
8.28510846361e-05
0.000332708623674
0.00011629264736
0.000318449337448
0.000158046411319
0.000286059218723
0.000213512903411
0.000212390872379
0.000296001721701
0.000455347696087
-3.27863402959e-08
1.69427768708e-06
-6.9619112247e-08
1.69352264244e-06
-1.79270896579e-07
1.30258242112e-06
-2.47295613819e-07
1.68781441266e-06
-2.71297846529e-07
1.64811063832e-06
-3.16127093837e-07
1.68695760327e-06
-4.14003690206e-07
1.59086524976e-06
-4.21745215277e-07
1.57008535562e-06
-5.02700443378e-07
1.27966602001e-06
-5.65901421452e-07
1.17593669e-06
-6.30610053948e-07
1.30131628179e-06
-6.97055692883e-07
1.38957171683e-06
-7.62237997221e-07
1.53870368145e-06
-8.2145446075e-07
1.3303130221e-06
-8.88249683579e-07
1.33026656469e-06
-9.48325543106e-07
1.44165812158e-06
-9.97403002893e-07
1.4643814742e-06
-1.04081587537e-06
1.40251936349e-06
-1.09927423834e-06
1.43993823388e-06
-1.14960459197e-06
1.38997000106e-06
-1.18522119965e-06
1.330337102e-06
-1.24943604943e-06
1.36166639246e-06
-1.31836974988e-06
1.26230080254e-06
-1.39304915926e-06
1.07065958624e-06
-1.46327807604e-06
9.85880379147e-07
-1.5301374264e-06
9.25971250155e-07
-1.61066871941e-06
9.61574349767e-07
-1.74103006053e-06
1.07487203963e-06
-1.81714732472e-06
1.11742637952e-06
-1.86938298753e-06
1.08133027935e-06
-1.92954594347e-06
1.01983878794e-06
-2.02061176874e-06
9.94262446513e-07
-2.08102567268e-06
9.33292847617e-07
-2.13276071406e-06
8.86687918436e-07
-2.20712101643e-06
8.38912819174e-07
-2.2926537791e-06
7.76274903051e-07
-2.37779073199e-06
6.84628136137e-07
-2.45630375472e-06
5.80750993289e-07
-2.52085181792e-06
4.64249785962e-07
-2.57637649057e-06
3.41424767801e-07
-2.62354195993e-06
2.02875303446e-07
-2.62003426904e-06
-3.48772745188e-10
-2.5561017674e-06
-2.62681914949e-07
-2.48959735415e-06
-4.96706193336e-07
-2.42453644671e-06
-6.91209227589e-07
-2.3176679809e-06
-8.782395233e-07
-2.12163961182e-06
-1.07220400002e-06
-1.84782634248e-06
-1.26955560266e-06
-1.6144782577e-06
-1.31552117192e-06
-4.10440839207e-07
-2.28227619308e-06
2.56844643771e-05
-2.80522073953e-05
6.569675415e-05
-5.92401196859e-05
9.77789921173e-05
-7.60600957627e-05
0.000117154666839
-9.31660722459e-05
0.000134243465207
-0.000104943855309
0.000150216944966
-0.000112545176064
0.000165627995888
-0.000117190357862
0.000180682734391
-0.00011951009172
0.000195405416661
-0.000119902406956
0.000209774851151
-0.000118661024381
0.000223755230628
-0.000115997335706
0.000237323106434
-0.000112045301
0.000250503406335
-0.000106868964244
0.000263349318096
-0.000100496286403
0.000275899051303
-9.2944436578e-05
0.000288166415156
-8.4208918664e-05
0.000300155194563
-7.42414956457e-05
0.000311870639882
-6.29402258067e-05
0.000323320837753
-5.01481376733e-05
0.000334511330215
-3.56505933757e-05
0.00034536437306
-1.9147300059e-05
0.000355931228449
-3.95758716238e-07
0.000366017325617
2.10279100695e-05
0.000375271493783
4.5799974395e-05
0.00038315860504
7.49640459833e-05
0.000389154830035
0.00011029658886
0.000392703149208
0.000154498930376
0.000394483956005
0.000211733665296
0.00040367696321
0.000286809862776
0.00037621472108
-3.12429081249e-08
1.72549917881e-06
-8.05175804692e-08
1.74278058853e-06
-2.00149751988e-07
1.42224316223e-06
-2.30677455549e-07
1.71836417675e-06
-2.41321207891e-07
1.65878877814e-06
-2.92311104087e-07
1.73798328262e-06
-3.89698988699e-07
1.68827305918e-06
-3.75741625985e-07
1.55615745179e-06
-4.90106675824e-07
1.3940294709e-06
-5.60267108336e-07
1.2461094349e-06
-6.21199623935e-07
1.36225373219e-06
-6.84517176857e-07
1.45292059e-06
-7.4478683294e-07
1.59898545579e-06
-8.0791055867e-07
1.39345004423e-06
-8.78648145605e-07
1.40102876861e-06
-9.39618386442e-07
1.50265571464e-06
-9.73584291098e-07
1.49837033635e-06
-1.00997349219e-06
1.43894508479e-06
-1.0715811764e-06
1.50158093967e-06
-1.11749028638e-06
1.43591104289e-06
-1.14325914057e-06
1.35614188746e-06
-1.19261120048e-06
1.41105210236e-06
-1.2707385312e-06
1.34044646385e-06
-1.35240160237e-06
1.15233557449e-06
-1.42891353e-06
1.06240377595e-06
-1.50719823246e-06
1.00425546267e-06
-1.57931100128e-06
1.03369457783e-06
-1.67200058929e-06
1.16756305108e-06
-1.73269550007e-06
1.17813279998e-06
-1.81285402034e-06
1.16149363299e-06
-1.8542885393e-06
1.0612858361e-06
-1.9101988553e-06
1.05017836143e-06
-2.01346573595e-06
1.03656761086e-06
-2.12547419839e-06
9.98711143668e-07
-2.20745103181e-06
9.20913115139e-07
-2.279514208e-06
8.48370448986e-07
-2.36558754031e-06
7.70735967818e-07
-2.45138077256e-06
6.66573296535e-07
-2.53699464781e-06
5.49900575037e-07
-2.61056367482e-06
4.15039028211e-07
-2.6381924799e-06
2.30578704872e-07
-2.5980278699e-06
-4.04761491968e-08
-2.55355083628e-06
-3.07073073332e-07
-2.5271421954e-06
-5.23016642821e-07
-2.45065996196e-06
-7.67509495679e-07
-2.26307766926e-06
-1.06563970716e-06
-1.99865037599e-06
-1.33658562134e-06
-1.64487994707e-06
-1.6234588414e-06
6.71779335385e-08
-3.02767475964e-06
2.81043100096e-05
-3.03198746915e-05
6.7013536889e-05
-6.69612801718e-05
9.29529770972e-05
-8.51789892187e-05
0.000116321872593
-9.94280068206e-05
0.000135211213566
-0.000112054354198
0.000152115706871
-0.000121847444511
0.000168058561483
-0.000128487352923
0.000183374882852
-0.000132506223299
0.000198220554326
-0.000134355475458
0.000212673224038
-0.000134354924128
0.000226771184537
-0.000132758931596
0.000240537424452
-0.000129763600129
0.000253997336106
-0.000125505295317
0.000267194439501
-0.000120066196579
0.00028018714635
-0.000113489161206
0.000293032904729
-0.000105790383748
0.0003057818158
-9.69580201912e-05
0.000318482762589
-8.69426073926e-05
0.000331192190273
-7.56497970836e-05
0.000343980622611
-6.29366883236e-05
0.000356937476219
-4.86075588134e-05
0.000370194095732
-3.24039949416e-05
0.000383802507507
-1.40041781745e-05
0.000397765870698
7.06464309852e-06
0.000412304634331
3.12613636519e-05
0.000427795876506
5.94729775929e-05
0.000445151762017
9.29409927921e-05
0.000466417205161
0.000133234230423
0.000496075019641
0.000182077173501
0.000541737283297
0.000241148708607
0.000307867650597
-2.93715128537e-08
1.7549627379e-06
-8.85470977766e-08
1.80201752487e-06
-2.08567002398e-07
1.54228148124e-06
-2.03536571971e-07
1.71336847408e-06
-2.24181325417e-07
1.67946528482e-06
-2.69983428434e-07
1.78380747025e-06
-3.4437421503e-07
1.76270411406e-06
-3.40205453979e-07
1.55198963744e-06
-4.80896136245e-07
1.53474250541e-06
-5.52509898913e-07
1.3177301216e-06
-6.0821779833e-07
1.41798269851e-06
-6.68048525686e-07
1.51275763802e-06
-7.22349159612e-07
1.65331450034e-06
-7.85569623827e-07
1.45669467218e-06
-8.56639707526e-07
1.4721168902e-06
-9.22327647697e-07
1.56837257063e-06
-9.35649089972e-07
1.51172876868e-06
-9.71727654838e-07
1.47504865163e-06
-1.03636742601e-06
1.56625986746e-06
-1.07281536925e-06
1.47239601134e-06
-1.10395166479e-06
1.38730959576e-06
-1.14037842002e-06
1.44750440419e-06
-1.22513051669e-06
1.4252231986e-06
-1.31298287295e-06
1.24020758413e-06
-1.39393210462e-06
1.14336509055e-06
-1.47811657572e-06
1.08845835188e-06
-1.54954683648e-06
1.10513024674e-06
-1.62985125749e-06
1.24787994032e-06
-1.69512804475e-06
1.24341692044e-06
-1.76406386466e-06
1.23044518503e-06
-1.84889116109e-06
1.14612237341e-06
-1.94514567224e-06
1.14644714857e-06
-2.00745729072e-06
1.09889693339e-06
-2.08043696727e-06
1.07171958192e-06
-2.18675731678e-06
1.02727267411e-06
-2.28058777256e-06
9.42244781197e-07
-2.36415476733e-06
8.54345971931e-07
-2.44867266962e-06
7.51139327326e-07
-2.5358482755e-06
6.37131760399e-07
-2.60298627988e-06
4.82271059438e-07
-2.58892422265e-06
2.16588580127e-07
-2.54872885498e-06
-8.05614351868e-08
-2.54795914163e-06
-3.0773106149e-07
-2.53620426329e-06
-5.34571245189e-07
-2.45370053355e-06
-8.49871975236e-07
-2.28861639062e-06
-1.23067906238e-06
-2.10378574262e-06
-1.52152794135e-06
2.9705471471e-07
-4.02442474951e-06
2.82511881925e-05
-3.09822891029e-05
6.69909246085e-05
-6.90594735727e-05
9.05016748337e-05
-9.04714099482e-05
0.000112059788512
-0.000106736251549
0.00013237313918
-0.000119740457621
0.000150780795516
-0.000130461153506
0.000167658532343
-0.000138724443706
0.000183550882576
-0.000144379122733
0.00019873698157
-0.000147691886751
0.000213377039928
-0.000148995229516
0.000227584856363
-0.000148562541452
0.000241443772732
-0.000146617740455
0.000255020064542
-0.000143339856977
0.000268375728411
-0.000138860985383
0.00028157807065
-0.000133268615337
0.000294701554915
-0.00012661276024
0.000307823743278
-0.000118912710907
0.000321023755299
-0.000110158171839
0.000334386726661
-0.000100305707745
0.000348011498735
-8.92746732076e-05
0.000362018916451
-7.69441918439e-05
0.000376560937442
-6.31496332408e-05
0.000391834130784
-4.76771977674e-05
0.000408075855548
-3.02458364244e-05
0.00042565659017
-1.05159517984e-05
0.000444952676065
1.19654697409e-05
0.000466741257442
3.76845872511e-05
0.000492384889371
6.72976504812e-05
0.000524155445185
0.000101464373013
0.000565564612256
0.000140669000963
0.00062186060072
0.000184853444176
0.000230678183047
-3.63044229848e-08
1.79123293857e-06
-8.81056376533e-08
1.85381268669e-06
-1.87235447716e-07
1.64143674856e-06
-1.94884889965e-07
1.72103750264e-06
-2.37676685038e-07
1.72228250428e-06
-2.69790316514e-07
1.81596473963e-06
-3.29632904453e-07
1.82255678338e-06
-3.59243673556e-07
1.58163557422e-06
-4.7507391348e-07
1.65057608042e-06
-5.41272142883e-07
1.38394327426e-06
-5.92556686022e-07
1.46927939798e-06
-6.49347913184e-07
1.56958276023e-06
-6.97483173221e-07
1.70146756534e-06
-7.58647379764e-07
1.51787802994e-06
-8.23992847804e-07
1.5374947548e-06
-8.77153009208e-07
1.62156213988e-06
-8.93426849029e-07
1.52802500647e-06
-9.42253811122e-07
1.52391599533e-06
-1.00277975634e-06
1.62681451893e-06
-1.02864179831e-06
1.49828883905e-06
-1.08234328795e-06
1.44103933481e-06
-1.13675513011e-06
1.50194854079e-06
-1.19211265903e-06
1.4806094928e-06
-1.29166390391e-06
1.33977674325e-06
-1.36882137351e-06
1.22054264759e-06
-1.45311561466e-06
1.17276100925e-06
-1.52577369404e-06
1.17780807791e-06
-1.59915723571e-06
1.32128035976e-06
-1.66977801281e-06
1.31405607795e-06
-1.73849794423e-06
1.29917820598e-06
-1.8369658856e-06
1.24460782427e-06
-1.90511875724e-06
1.21462022624e-06
-1.98523231101e-06
1.17904411496e-06
-2.07246060188e-06
1.15898970144e-06
-2.14813400077e-06
1.10299667589e-06
-2.24244765628e-06
1.03661020939e-06
-2.34437405621e-06
9.56327039053e-07
-2.44146610694e-06
8.4829389782e-07
-2.52507668927e-06
7.20842776134e-07
-2.53311482806e-06
4.90401943285e-07
-2.49166934416e-06
1.75270787815e-07
-2.48816428192e-06
-8.39538374958e-08
-2.51276632815e-06
-2.82949514367e-07
-2.53150909049e-06
-5.15674332301e-07
-2.5397129508e-06
-8.41637744969e-07
-2.44805211667e-06
-1.32243516758e-06
-4.18279553544e-07
-3.55142320876e-06
2.60091722764e-05
-3.04524059847e-05
6.32249047761e-05
-6.81980098253e-05
8.64880639063e-05
-9.23220754004e-05
0.000107569747925
-0.000111552366159
0.000127641308088
-0.00012680709101
0.000146774247596
-0.000138872694791
0.000164647637796
-0.000148333889261
0.000181292542367
-0.000155368772645
0.000196980237055
-0.000160066332971
0.000211935800459
-0.000162647063786
0.00022632181139
-0.000163380942629
0.000240269962309
-0.00016251048071
0.000253891073788
-0.000160238714306
0.000267281251107
-0.000156729964016
0.000280529452649
-0.00015210917312
0.000293724117618
-0.000146463314783
0.000306956727266
-0.000139845442864
0.000320322878416
-0.000132278957491
0.00033392417492
-0.000123759570081
0.000347873183022
-0.000114254804867
0.000362301104665
-0.000103702666849
0.000377367406951
-9.20105397074e-05
0.000393271921615
-7.90541638169e-05
0.000410270970354
-6.46762123021e-05
0.000428709467136
-4.86842323679e-05
0.000449042533352
-3.08488385575e-05
0.000471899583995
-1.08913617714e-05
0.000498172396255
1.14119891575e-05
0.00052905679935
3.64134862696e-05
0.000566496883183
6.40247206953e-05
0.000613119245054
9.40473345247e-05
0.000672722803539
0.000125250325524
0.000155451303565
-5.01531004882e-08
1.84148698157e-06
-8.37002359786e-08
1.88741759316e-06
-1.55005037233e-07
1.71276082427e-06
-2.10469893721e-07
1.77653308452e-06
-2.57160843404e-07
1.76900599891e-06
-2.82695670288e-07
1.84151736635e-06
-3.33883244887e-07
1.87379005532e-06
-3.787700676e-07
1.62652781546e-06
-4.37510690682e-07
1.70934253624e-06
-5.17683935467e-07
1.46413213429e-06
-5.73261519708e-07
1.52487998984e-06
-6.298761305e-07
1.62621075689e-06
-6.73198656532e-07
1.74482152217e-06
-7.33385482337e-07
1.57809330889e-06
-7.96151723985e-07
1.60028350618e-06
-8.45448511143e-07
1.67088704455e-06
-8.92237108141e-07
1.5748475597e-06
-9.42902563052e-07
1.5746003046e-06
-9.849659396e-07
1.66891424833e-06
-1.00878173002e-06
1.52212974478e-06
-1.10679687316e-06
1.53908407104e-06
-1.16899565357e-06
1.56417717294e-06
-1.22067962435e-06
1.53231911521e-06
-1.30990189729e-06
1.42902312845e-06
-1.36748510052e-06
1.27813872334e-06
-1.44803438261e-06
1.2533365045e-06
-1.51484856031e-06
1.24464166219e-06
-1.57193052536e-06
1.37838474317e-06
-1.65007424951e-06
1.39222152672e-06
-1.72167185536e-06
1.37080056786e-06
-1.80039836877e-06
1.323359204e-06
-1.8774097197e-06
1.29166589162e-06
-1.98100807344e-06
1.28268305687e-06
-2.05648562058e-06
1.23452215909e-06
-2.12452920012e-06
1.17109574764e-06
-2.20690346783e-06
1.11904326437e-06
-2.30419229373e-06
1.05367925118e-06
-2.40049847503e-06
9.44690343481e-07
-2.44671811738e-06
7.67160913642e-07
-2.41628444255e-06
4.60100787245e-07
-2.40214557081e-06
1.61234625636e-07
-2.43501829557e-06
-5.09466689212e-08
-2.50058398188e-06
-2.17236815203e-07
-2.62211456508e-06
-3.9412872681e-07
-2.92888532057e-06
-5.34981413075e-07
-2.25620655624e-06
-1.99525545404e-06
2.10087166223e-05
-2.68168659046e-05
5.55514099103e-05
-6.49951701881e-05
7.92186124612e-05
-9.18648307379e-05
0.000100992233555
-0.000114095128839
0.000121527658479
-0.00013208719683
0.000141042036235
-0.000146320907155
0.000159528409743
-0.000157358558636
0.000176887461228
-0.000165692478973
0.000193157566231
-0.000171638463904
0.000208512628764
-0.000175421032599
0.00022314267993
-0.000177276803098
0.000237213072681
-0.000177451079599
0.000250868419929
-0.000176165627194
0.00026423710452
-0.000173607255341
0.000277434487847
-0.000169927256262
0.000290567578237
-0.000165242221798
0.000303740136815
-0.000159635874288
0.000317056876599
-0.00015316221719
0.000330626810107
-0.000145848947407
0.000344567097825
-0.000137699919997
0.000359008654575
-0.000128696419022
0.00037410385742
-0.000118797910643
0.000390036344398
-0.000107943046112
0.000407033494614
-9.60513003283e-05
0.000425383011153
-8.30256686538e-05
0.000445456285341
-6.87573846841e-05
0.000467742997865
-5.31353650379e-05
0.000492920485248
-3.60686280279e-05
0.000521779947886
-1.74472666464e-05
0.000555584038357
2.60962166588e-06
0.000595822833464
2.37862672727e-05
0.000644184289915
4.56862811905e-05
0.000702803409239
6.66314957759e-05
8.55383722439e-05
-5.10213472414e-08
1.89246936965e-06
-7.4292997198e-08
1.91069104056e-06
-1.22530575161e-07
1.76102861893e-06
-2.17929030615e-07
1.87195160681e-06
-2.59579458143e-07
1.81068141934e-06
-2.8663328736e-07
1.86861517321e-06
-3.28195112616e-07
1.91536416429e-06
-3.79357134705e-07
1.67772331226e-06
-4.22840220513e-07
1.75283852175e-06
-5.0163162215e-07
1.54293826661e-06
-5.55444402432e-07
1.57871118147e-06
-6.11424790843e-07
1.68222580476e-06
-6.49833246326e-07
1.78325332192e-06
-7.09723260237e-07
1.63800713561e-06
-7.72423995842e-07
1.66301570133e-06
-8.21231574334e-07
1.71972410941e-06
-8.86288445876e-07
1.63992332494e-06
-9.44049014189e-07
1.63239788617e-06
-9.91702176725e-07
1.71658917036e-06
-1.04968337927e-06
1.5801422551e-06
-1.1520360668e-06
1.6414687065e-06
-1.18564508181e-06
1.59782063857e-06
-1.23144890301e-06
1.57815334329e-06
-1.31470714657e-06
1.51230073088e-06
-1.42133327168e-06
1.38479012224e-06
-1.47734235891e-06
1.30936226431e-06
-1.51646462347e-06
1.28379261435e-06
-1.56028192002e-06
1.42223631097e-06
-1.64695617552e-06
1.47892880361e-06
-1.70929034417e-06
1.43316618051e-06
-1.76918127958e-06
1.38328567272e-06
-1.84274301648e-06
1.36526456879e-06
-1.92164552522e-06
1.36163657964e-06
-2.0295477615e-06
1.34247884654e-06
-2.11753679184e-06
1.25914913496e-06
-2.197116491e-06
1.19869070608e-06
-2.27503488074e-06
1.13168180126e-06
-2.34127680799e-06
1.01102250661e-06
-2.34901871529e-06
7.75028277489e-07
-2.33151641467e-06
4.42695390629e-07
-2.35306175445e-06
1.82899576493e-07
-2.41675132994e-06
1.28630753774e-08
-2.55767713133e-06
-7.62610493685e-08
-2.96903427383e-06
1.71443594932e-08
-3.9347922028e-06
4.30583744829e-07
1.31527935391e-05
-1.90835004281e-05
4.46666904477e-05
-5.83309371907e-05
6.88947237374e-05
-8.92229446387e-05
9.18824947048e-05
-0.00011485218562
0.000113486941356
-0.000135699104827
0.000133767816173
-0.000152367618033
0.000152832326164
-0.000165385017556
0.000170744100918
-0.000175269978882
0.000187543070995
-0.000182491128145
0.000203321265261
-0.000187416360067
0.000218235313643
-0.000190334803507
0.000232461738929
-0.000191502975978
0.000246167577921
-0.000191156696071
0.00025950477734
-0.000189502642327
0.000272611133181
-0.000186713467256
0.000285612354977
-0.000182928377048
0.0002986254821
-0.000178255288071
0.000311763160974
-0.000172773529134
0.000325138001424
-0.000166537063534
0.000338866854952
-0.00015957782613
0.000353075549732
-0.000151908647591
0.00036790475392
-0.000143525651125
0.000383517336087
-0.000134410508607
0.000400107432252
-0.000124533138271
0.000417911605747
-0.000113855442207
0.000437222833257
-0.000102336826948
0.000458408323658
-8.99427549824e-05
0.000481931691066
-7.66585591055e-05
0.000508374876085
-6.25116064452e-05
0.000538539345794
-4.76115354134e-05
0.000573394105119
-3.22449508069e-05
0.000613855613678
-1.66750083974e-05
0.000661422903459
-1.88070936227e-06
0.000717320291612
1.07342714592e-05
2.00626085423e-05
-4.23299848021e-08
1.93491700316e-06
-6.27078905421e-08
1.93112911972e-06
-1.13536370168e-07
1.81187914702e-06
-2.01833244342e-07
1.96028277122e-06
-2.44380859976e-07
1.85326162761e-06
-2.8031455536e-07
1.90456704681e-06
-3.16149471926e-07
1.95123962799e-06
-3.78103662556e-07
1.73969063623e-06
-4.25724658144e-07
1.80048114299e-06
-4.94573840733e-07
1.61181049619e-06
-5.40425870697e-07
1.62458771182e-06
-5.93749770933e-07
1.73557081743e-06
-6.26334353117e-07
1.81586972516e-06
-6.85928940181e-07
1.69763239432e-06
-7.47148110136e-07
1.72426245433e-06
-7.95787469121e-07
1.7683877596e-06
-8.72433339616e-07
1.71660273824e-06
-9.3311144488e-07
1.69309579226e-06
-9.83814466229e-07
1.76732830457e-06
-1.04977980774e-06
1.64613605461e-06
-1.11495307343e-06
1.70667894276e-06
-1.15503647206e-06
1.63793820732e-06
-1.18711154219e-06
1.61025588712e-06
-1.25412396662e-06
1.57933781215e-06
-1.33394339356e-06
1.46462713905e-06
-1.41448480485e-06
1.3899361419e-06
-1.47529396709e-06
1.34463515341e-06
-1.53318196061e-06
1.48015903628e-06
-1.62886443722e-06
1.57465071467e-06
-1.69512522687e-06
1.49946598487e-06
-1.74922688278e-06
1.43742570246e-06
-1.80897617039e-06
1.4250611583e-06
-1.86602027225e-06
1.41873318161e-06
-1.94699382968e-06
1.42352130715e-06
-2.03427389761e-06
1.34650036912e-06
-2.14105702129e-06
1.30555340257e-06
-2.23144715478e-06
1.22215268369e-06
-2.28166638564e-06
1.06135438717e-06
-2.28147494088e-06
7.74938182074e-07
-2.29172968459e-06
4.53078226728e-07
-2.33421338575e-06
2.25490615308e-07
-2.42486684823e-06
1.03627848449e-07
-2.63835865492e-06
1.37265108635e-07
-2.83367856297e-06
2.12309020742e-07
3.37832909238e-07
-2.74134202703e-06
3.02563537579e-05
-4.90022339833e-05
5.6298141101e-05
-8.43724795114e-05
8.08329802886e-05
-0.000113757429648
0.000103652539108
-0.000137671367243
0.00012490532755
-0.000156951524785
0.000144708061156
-0.000172170015858
0.000163183065497
-0.000183859725552
0.000180447624699
-0.000192534278555
0.000196614921084
-0.00019865818882
0.000211819101963
-0.000202620320346
0.000226222667412
-0.000204738158461
0.000239998843717
-0.000205278952995
0.000253314495075
-0.00020447216496
0.000266323715909
-0.000202511702872
0.00027916729294
-0.000199556912376
0.000291974323423
-0.000195735306024
0.000304865181598
-0.000191146076333
0.000317955416312
-0.000185863722977
0.000331360076862
-0.000179941707268
0.000345198265963
-0.000173416014793
0.000359598090467
-0.000166308478021
0.000374702331237
-0.000158629895748
0.000390675083504
-0.000150383254345
0.00040770951142
-0.000141567542963
0.000426036870796
-0.000132182755169
0.000445936973144
-0.000122236850078
0.00046775014476
-0.000111755807601
0.000491890223205
-0.000100798473218
0.00051885739157
-8.94785876178e-05
0.000549242552672
-7.79965198723e-05
0.000583686043963
-6.66882759969e-05
0.000623082667165
-5.60714452586e-05
0.00066830785815
-4.71057233167e-05
0.000719903772242
-4.08615125295e-05
-3.89606114928e-05
-4.69689143475e-08
1.98183650191e-06
-4.87992865224e-08
1.93296636976e-06
-1.20500252706e-07
1.88361280293e-06
-1.66035252839e-07
2.00584186369e-06
-2.17714526754e-07
1.9049678804e-06
-2.64674665387e-07
1.95156836494e-06
-3.02322721413e-07
1.98890696593e-06
-3.70624920296e-07
1.80802242317e-06
-4.15158076474e-07
1.84503880871e-06
-4.87952741649e-07
1.68462030013e-06
-5.25490974163e-07
1.66215053229e-06
-5.73281684429e-07
1.7833957436e-06
-6.03166148992e-07
1.84578339843e-06
-6.64651100915e-07
1.75914413771e-06
-7.19397909583e-07
1.77903797225e-06
-7.66296220526e-07
1.81531846243e-06
-8.55065128859e-07
1.80539166116e-06
-9.14116128172e-07
1.75218222275e-06
-9.58271227141e-07
1.81151109056e-06
-1.02432362708e-06
1.71222357579e-06
-1.05796376903e-06
1.74035298582e-06
-1.10161003511e-06
1.68161663488e-06
-1.15563867711e-06
1.6643119206e-06
-1.21740082549e-06
1.64112431381e-06
-1.30911190134e-06
1.55636636392e-06
-1.39086665377e-06
1.47171336764e-06
-1.42839841401e-06
1.38219669389e-06
-1.51081046867e-06
1.56261399786e-06
-1.59987586815e-06
1.66376120396e-06
-1.68130792564e-06
1.58094225388e-06
-1.76317838422e-06
1.51934516116e-06
-1.84376753074e-06
1.50570577611e-06
-1.88913159835e-06
1.46416693409e-06
-1.94083132413e-06
1.47529436636e-06
-2.02213698295e-06
1.42788222929e-06
-2.10292164801e-06
1.3864208653e-06
-2.18478410867e-06
1.30412005019e-06
-2.23391756401e-06
1.11058561391e-06
-2.24523728982e-06
7.86378391956e-07
-2.27755807045e-06
4.8549692294e-07
-2.35090659139e-06
2.98961195732e-07
-2.58868477491e-06
3.41502884436e-07
-2.99373088994e-06
5.42255403906e-07
-3.8324053194e-06
1.0509491443e-06
1.78420084654e-05
-2.44158412789e-05
4.44383534665e-05
-7.55983501352e-05
6.94451962343e-05
-0.000109378993382
9.28185029485e-05
-0.000137130409622
0.000114790558139
-0.000159643116277
0.000135301789693
-0.00017746247256
0.000154375409887
-0.000191243379963
0.000172112053544
-0.000201596146364
0.00018864606927
-0.00020906809827
0.000204125163381
-0.000214137105737
0.000218709304409
-0.000217204292116
0.000232569361805
-0.000218598050312
0.000245877864557
-0.000218587293525
0.000258799288561
-0.000217393434097
0.000271485364489
-0.000215197637578
0.000284074546468
-0.000212145971602
0.000296693671216
-0.000208354330769
0.000309460896827
-0.000203913225666
0.000322489461866
-0.000198892234917
0.000335891903538
-0.000193344115393
0.0003497845344
-0.000187308625608
0.000364292193407
-0.000180816123021
0.000379553400185
-0.000173891086671
0.000395726024717
-0.000166555854824
0.000412993502486
-0.000158834983112
0.000431571524101
-0.000150760719665
0.000451714972848
-0.000142380218014
0.000473724589407
-0.000133765311343
0.000497952248588
-0.000125025988245
0.000524802851608
-0.000116329025078
0.000554729934611
-0.000107923447506
0.000588217443786
-0.000100175648564
0.000625752863602
-9.36067284093e-05
0.000667621179349
-8.89738946033e-05
0.000713970186104
-8.72104531787e-05
-8.96018034443e-05
-4.74740521648e-08
2.02943574409e-06
-5.38112838218e-08
1.93936128199e-06
-1.20553562086e-07
1.95038405589e-06
-1.51186895008e-07
2.03651347651e-06
-1.98866955909e-07
1.95268355144e-06
-2.46093616923e-07
1.99881930819e-06
-2.86011963852e-07
2.02886189256e-06
-3.53658685419e-07
1.87569543598e-06
-3.94132440864e-07
1.88553042354e-06
-4.78444434672e-07
1.76896304538e-06
-5.1060659113e-07
1.69433910374e-06
-5.48753729624e-07
1.82157087754e-06
-5.85535296305e-07
1.88259426868e-06
-6.5178378092e-07
1.82542541753e-06
-6.97483221141e-07
1.8247685481e-06
-7.449180742e-07
1.86277645688e-06
-8.36548623078e-07
1.89705917705e-06
-8.90705059073e-07
1.80636638012e-06
-9.23879508484e-07
1.84472097202e-06
-9.87334426557e-07
1.77571125471e-06
-1.0253901147e-06
1.77844117167e-06
-1.07971599999e-06
1.73597080177e-06
-1.15473413336e-06
1.73935767273e-06
-1.21754536926e-06
1.70396071302e-06
-1.33603036598e-06
1.6748734132e-06
-1.41817698912e-06
1.55388664494e-06
-1.48207240942e-06
1.44612363735e-06
-1.51250103354e-06
1.59308583589e-06
-1.57138997618e-06
1.72270544528e-06
-1.65923604312e-06
1.66884513612e-06
-1.73667949832e-06
1.59684579659e-06
-1.79946648984e-06
1.5685586488e-06
-1.87044113419e-06
1.53521082676e-06
-1.93606117117e-06
1.54099234015e-06
-2.00816785685e-06
1.50007619009e-06
-2.07135630554e-06
1.4497035215e-06
-2.14813334023e-06
1.3809887412e-06
-2.20152843178e-06
1.16409409322e-06
-2.22812312384e-06
8.13068480793e-07
-2.26394200768e-06
5.21427409651e-07
-2.35760478254e-06
3.92733149949e-07
-2.47190740165e-06
4.55846461355e-07
-2.28760446665e-06
3.57930500015e-07
1.48583308683e-06
-2.72253751958e-06
3.39844174947e-05
-5.69141706275e-05
5.73240759558e-05
-9.89376622274e-05
8.10289943867e-05
-0.000133083578758
0.000103641909749
-0.000159743036261
0.000124789898137
-0.000180790853027
0.000144453514839
-0.000197125863813
0.000162686478595
-0.000209476142351
0.000179603784187
-0.000218513272362
0.000195359593211
-0.000224823747446
0.00021012483035
-0.000228902195493
0.000224076238164
-0.000231155559899
0.000237390601457
-0.000231912276036
0.000250238641548
-0.00023143519839
0.000262779645031
-0.000229934306686
0.000275158942999
-0.00022757681298
0.00028750818178
-0.000224495100408
0.000299947377276
-0.0002207934319
0.000312588014783
-0.000216553786288
0.000325536764568
-0.000211840924894
0.000338899519926
-0.000206706825658
0.000352785588743
-0.000201194659687
0.000367311997937
-0.000195342502065
0.000382607945553
-0.000189187002928
0.000398819424163
-0.000182767295548
0.000416113948064
-0.000176129457376
0.000434685159779
-0.00016933186687
0.000454756857734
-0.000162451830785
0.000476585591537
-0.000155593938003
0.000500460405357
-0.000148900669222
0.000526697406821
-0.000142565884855
0.000555625688576
-0.000136851598525
0.000587558745911
-0.000132108591647
0.000622748644838
-0.000128796518724
0.000661292800523
-0.000127517967327
0.000703058486894
-0.00012897607551
-0.000133959687397
-3.79165197964e-08
2.06730132915e-06
-7.49943711135e-08
1.97645040157e-06
-1.2004514077e-07
1.99547068483e-06
-1.52782209409e-07
2.06928011988e-06
-1.92446161175e-07
1.99237855587e-06
-2.3059632055e-07
2.03701021773e-06
-2.70198920764e-07
2.06849523356e-06
-3.32950067986e-07
1.93847148554e-06
-3.67282980864e-07
1.91989958018e-06
-4.64507739879e-07
1.86620566889e-06
-4.98625482798e-07
1.72848470753e-06
-5.25049605984e-07
1.84802700953e-06
-5.66357008047e-07
1.92393744904e-06
-6.44743815119e-07
1.90383909088e-06
-6.83038085065e-07
1.863091608e-06
-7.28332068145e-07
1.908108972e-06
-8.03325182683e-07
1.97207998807e-06
-8.5325856723e-07
1.85633531045e-06
-8.89898636547e-07
1.88139580459e-06
-9.57799805495e-07
1.84364278333e-06
-1.01635808083e-06
1.83703045276e-06
-1.10047909078e-06
1.82012114531e-06
-1.1834327721e-06
1.82234040777e-06
-1.2478383559e-06
1.76839606302e-06
-1.30173069047e-06
1.72879383019e-06
-1.38268865491e-06
1.63486855269e-06
-1.46556697993e-06
1.52903142441e-06
-1.47154182827e-06
1.59910505361e-06
-1.54711465537e-06
1.79833452433e-06
-1.62494756321e-06
1.74673902536e-06
-1.71118706081e-06
1.68315228168e-06
-1.79326860337e-06
1.65070821599e-06
-1.88723559039e-06
1.62925564431e-06
-1.94045525243e-06
1.59429545669e-06
-1.99416807785e-06
1.55387899853e-06
-2.04521917538e-06
1.50085173262e-06
-2.11228239873e-06
1.44816867756e-06
-2.18029297542e-06
1.23220967714e-06
-2.23079880637e-06
8.63680110362e-07
-2.31682232084e-06
6.0755315281e-07
-2.57646935159e-06
6.52457184122e-07
-2.900894735e-06
7.80273705321e-07
-3.55737696296e-06
1.01440737592e-06
1.79017294973e-05
-2.41816076504e-05
4.41817934572e-05
-8.31939135605e-05
6.87648438157e-05
-0.00012352038213
9.16391284461e-05
-0.000155957580001
0.000113314317987
-0.000181417991864
0.000133554922894
-0.000201031256581
0.000152298281707
-0.000215869042545
0.000169625168357
-0.000226802864746
0.000185680963935
-0.000234568919767
0.000200642107775
-0.000239784756284
0.000214696090278
-0.000242956053707
0.000228029131096
-0.000244488481467
0.000240819341514
-0.000244702369857
0.000253232443893
-0.000243848184829
0.000265419215692
-0.00024212096489
0.000277514967549
-0.000239672456042
0.000289640880652
-0.000236620912848
0.000301906600838
-0.00023305906231
0.000314413541514
-0.000229060649665
0.000327258534026
-0.000224685852825
0.00034053759564
-0.000219985833807
0.000354349687466
-0.000215006706026
0.000368800426504
-0.000209793199227
0.000384005764655
-0.000204392298328
0.000400095628908
-0.000198857111539
0.000417217412788
-0.000193251184376
0.000435539030642
-0.00018765341496
0.000455250962785
-0.00018216367967
0.000476566348145
-0.000176909222387
0.000499717638246
-0.000172051844087
0.000524947697912
-0.000167795821484
0.000552492474406
-0.000164396265154
0.000582551523208
-0.000162167548786
0.000615243146044
-0.000161488061649
0.00065053480395
-0.000162809549126
0.00068817787355
-0.000166619125429
-0.00017331455831
-3.42058790942e-08
2.10163356583e-06
-7.94631964002e-08
2.02176573036e-06
-1.19087302006e-07
2.03512935903e-06
-1.56507526427e-07
2.10674151409e-06
-1.91142246994e-07
2.02705335299e-06
-2.18174141738e-07
2.06407476845e-06
-2.56839181431e-07
2.10719354198e-06
-3.16507286935e-07
1.99817848263e-06
-3.43126594973e-07
1.94653679605e-06
-4.46709661462e-07
1.96982253674e-06
-4.89364853234e-07
1.77116783432e-06
-5.07705677758e-07
1.86639937856e-06
-5.43146552495e-07
1.95940471026e-06
-6.36959776148e-07
1.99768994986e-06
-6.69506853463e-07
1.895673006e-06
-7.09849731942e-07
1.9484792216e-06
-7.62700552755e-07
2.02497098171e-06
-8.11001909922e-07
1.90467147942e-06
-8.58972887835e-07
1.92939746683e-06
-9.32064683296e-07
1.91677089468e-06
-9.80854064061e-07
1.88585013255e-06
-1.07336228651e-06
1.91266354084e-06
-1.12221244304e-06
1.87122504941e-06
-1.18830474171e-06
1.83452066429e-06
-1.26598437002e-06
1.80650139572e-06
-1.37781248421e-06
1.74672123915e-06
-1.48719140294e-06
1.63843341356e-06
-1.5373793129e-06
1.64932438913e-06
-1.56037215997e-06
1.82138229814e-06
-1.63881212829e-06
1.82524776076e-06
-1.72527571604e-06
1.76968843637e-06
-1.79903857476e-06
1.72455457339e-06
-1.85185085876e-06
1.68214885197e-06
-1.92580388685e-06
1.66833861707e-06
-1.98992203205e-06
1.6180955719e-06
-2.04591876285e-06
1.55695893022e-06
-2.07574178735e-06
1.47810754574e-06
-2.16433755283e-06
1.32091658062e-06
-2.22727418255e-06
9.26682201747e-07
-2.32779604068e-06
7.0813197313e-07
-2.49767546877e-06
8.22379052176e-07
-2.38681788939e-06
6.69357297087e-07
-9.14407293082e-07
-4.58034637757e-07
3.10447393478e-05
-5.61406297175e-05
5.46736531058e-05
-0.000106822596492
7.84293412684e-05
-0.000147275832032
0.000100841875207
-0.000178369908857
0.000121704519375
-0.000202280461589
0.00014100840763
-0.00022033499151
0.000158796738659
-0.000233657231782
0.000175197465563
-0.000243203459485
0.000190389563675
-0.000249760893645
0.000204571611122
-0.000253966688103
0.000217943169737
-0.000256327502559
0.000230694068939
-0.000257239275537
0.000242998866667
-0.000257007064165
0.000255014502495
-0.000255863718886
0.000266879974186
-0.000253986336372
0.000278717557246
-0.000251509942524
0.000290635197267
-0.000248538461707
0.000302729621277
-0.000245153402692
0.000315089774876
-0.000241420728316
0.000327800310682
-0.000237396322619
0.000340944967123
-0.000233130432104
0.000354609768221
-0.000228671454555
0.000368886054246
-0.000224069435285
0.000383873393992
-0.000219379587042
0.000399682401517
-0.000214666064154
0.000416437372006
-0.000210006092182
0.000434278443484
-0.000205494415158
0.000453362718528
-0.000201247871366
0.000473863388347
-0.000197409799144
0.000495965485852
-0.000194153836901
0.000519856345079
-0.000191686576949
0.000545708462606
-0.000190248293438
0.000573652025682
-0.000190111041755
0.000603735403678
-0.00019157138342
0.000635869757206
-0.000194943881259
0.00066978209031
-0.00020053143502
-0.000208417130763
-3.08256255777e-08
2.13240828667e-06
-7.41026092054e-08
2.06505704792e-06
-1.20720175696e-07
2.08178408091e-06
-1.55411576126e-07
2.14146947912e-06
-1.86114644626e-07
2.05779240731e-06
-2.05456553308e-07
2.08345635511e-06
-2.41464404552e-07
2.1432423138e-06
-3.12533488269e-07
2.0692717255e-06
-3.39985790415e-07
1.97402806045e-06
-4.13119626675e-07
2.0429824509e-06
-4.7478397817e-07
1.83285790061e-06
-4.96271685599e-07
1.88791763623e-06
-5.31406786602e-07
1.99458248177e-06
-6.08851468336e-07
2.07516656541e-06
-6.45650155515e-07
1.93250341824e-06
-6.86632979028e-07
1.9895034071e-06
-7.23237357274e-07
2.06161069854e-06
-7.72464281262e-07
1.95393245834e-06
-8.21605727177e-07
1.97857932996e-06
-9.12058706508e-07
2.00725599988e-06
-9.63166046412e-07
1.93699606594e-06
-1.03887845846e-06
1.98841314544e-06
-1.08591336981e-06
1.91829717597e-06
-1.15550365988e-06
1.90414493707e-06
-1.23652413663e-06
1.88755036635e-06
-1.33629856562e-06
1.84651594929e-06
-1.47371718576e-06
1.77587470219e-06
-1.57815660225e-06
1.7538025283e-06
-1.56611280884e-06
1.80938827559e-06
-1.6545942055e-06
1.91379544381e-06
-1.75726221559e-06
1.87243300853e-06
-1.85648964862e-06
1.82386661623e-06
-1.90537586802e-06
1.73113185329e-06
-1.95418052218e-06
1.71724271407e-06
-1.99776203605e-06
1.66177757357e-06
-2.05557547041e-06
1.61488679525e-06
-2.06946774889e-06
1.49211049058e-06
-2.13786894243e-06
1.38937911184e-06
-2.22668634107e-06
1.01554880697e-06
-2.52401519609e-06
1.00549098401e-06
-2.83999234602e-06
1.13831313566e-06
-2.88260556602e-06
7.11985515667e-07
1.28883966247e-05
-1.62292804412e-05
3.90926837601e-05
-8.23448729341e-05
6.39474134032e-05
-0.000131677166176
8.71098564092e-05
-0.000170438110847
0.000108782876312
-0.000200042783167
0.000128787878353
-0.000222285336325
0.000147140015439
-0.0002386870107
0.000163966060101
-0.00025048316416
0.000179450570548
-0.000258687860613
0.000193806083494
-0.000264116301845
0.000207249579579
-0.000267410083446
0.000219987423669
-0.000269065250662
0.000232207456116
-0.000269459214571
0.00024407588861
-0.00026887540553
0.000255737194399
-0.000267524934195
0.000267315759106
-0.000265564812083
0.000278918574021
-0.000263112670283
0.000290638500498
-0.000260258304678
0.000302557749795
-0.000257072573243
0.000314751300226
-0.000253614205933
0.000327290072814
-0.000249935028519
0.000340243775603
-0.000246084073664
0.000353683423407
-0.000242111045166
0.000367683626308
-0.000238069582543
0.000382324785924
-0.000234020690548
0.000397695312857
-0.00023003653133
0.000413893846858
-0.000226204561834
0.000431031253843
-0.000222631750263
0.000449231865944
-0.000219448406194
0.00046863309932
-0.000216810947684
0.000489382158884
-0.000214902809112
0.000511628125746
-0.000213932459111
0.000535507348241
-0.000214127449398
0.000561119626491
-0.000215723270624
0.000588493888853
-0.000218945619597
0.000617538184943
-0.000223988154711
0.000647997909879
-0.000230991180859
-0.000239747412394
-2.89182651164e-08
2.16145129786e-06
-7.1105825065e-08
2.1073027956e-06
-1.24465635277e-07
2.13518510445e-06
-1.45703787348e-07
2.16275062627e-06
-1.72107797633e-07
2.08423788767e-06
-1.9391041886e-07
2.10529848373e-06
-2.2353803252e-07
2.17290266278e-06
-3.01748875701e-07
2.14752686737e-06
-3.36433218578e-07
2.00874073436e-06
-3.65735024818e-07
2.07231356622e-06
-4.53820378455e-07
1.9209768969e-06
-4.81279729152e-07
1.91541239996e-06
-5.16488014544e-07
2.02982302457e-06
-5.55224692951e-07
2.11394381136e-06
-6.07554160466e-07
1.98487172365e-06
-6.53065144922e-07
2.03504883228e-06
-6.81453599928e-07
2.09003771016e-06
-7.40884064747e-07
2.01340322128e-06
-7.93394162687e-07
2.03112328882e-06
-8.71959241531e-07
2.08586201605e-06
-9.24584225782e-07
1.98965733014e-06
-9.6874585064e-07
2.03261313621e-06
-1.03549579661e-06
1.98508410394e-06
-1.11991024811e-06
1.98859487897e-06
-1.19333672764e-06
1.96100707015e-06
-1.29341319468e-06
1.94662375836e-06
-1.42003835084e-06
1.90253387559e-06
-1.54304373521e-06
1.87683939663e-06
-1.60175512977e-06
1.86814172128e-06
-1.6388439673e-06
1.95093117074e-06
-1.74318320686e-06
1.97684173865e-06
-1.80395967917e-06
1.88472627099e-06
-1.91026988824e-06
1.83753910788e-06
-1.9904471392e-06
1.79752302394e-06
-2.04475544702e-06
1.71619495416e-06
-2.07249659765e-06
1.64272481563e-06
-2.11497756227e-06
1.53466957168e-06
-2.06324868523e-06
1.33772182067e-06
-2.28611715592e-06
1.23844768605e-06
-2.69199373241e-06
1.41144887861e-06
-3.26136217163e-06
1.70776205906e-06
-5.72656845923e-06
3.17692340283e-06
2.09712126269e-05
-4.29270031796e-05
4.70502139613e-05
-0.000108423814379
7.18174663091e-05
-0.000156444307694
9.46109365815e-05
-0.00019323146616
0.000115522415484
-0.000220954158487
0.000134608503405
-0.000241371329074
0.000151989258702
-0.000256067675627
0.000167862723181
-0.000266356538674
0.000182462882182
-0.000273287930524
0.000196030227174
-0.00027768355811
0.000208793562433
-0.000280173332233
0.00022095957116
-0.000281231174385
0.000232708444048
-0.000281208004657
0.000244193635156
-0.000280360514585
0.000255544028145
-0.000278875246369
0.000266867314761
-0.000276888018454
0.000278253829482
-0.00027449910647
0.000289780406588
-0.000271784805314
0.000301513988734
-0.000268806082216
0.000313514819977
-0.000265614967723
0.000325839120102
-0.00026225926317
0.000338541227258
-0.000258786118938
0.00035167530791
-0.000255245066264
0.000365296850763
-0.00025169106713
0.000379464229088
-0.000248188009627
0.000394240574386
-0.000244812815813
0.000409696062704
-0.00024165998534
0.000425910457243
-0.000238846077504
0.00044297547606
-0.000236513353602
0.000460996194686
-0.000234831595209
0.000480090384079
-0.000233996925583
0.000500384161742
-0.000234226173617
0.000522001988916
-0.000235745224714
0.000545047915488
-0.00023876917209
0.000569576201379
-0.000243473898377
0.000595540256094
-0.000249952250999
0.000622747349773
-0.000258198295329
-0.000267682961382
-2.91306194733e-08
2.19053386448e-06
-8.4609220075e-08
2.16280013555e-06
-1.21767756549e-07
2.17238267405e-06
-1.2346213107e-07
2.16448638941e-06
-1.52913707514e-07
2.11373016067e-06
-1.84085447613e-07
2.13651052209e-06
-2.08633951218e-07
2.19749937611e-06
-2.67627711459e-07
2.20655610428e-06
-3.19482315114e-07
2.06062960294e-06
-3.35159825903e-07
2.08802793217e-06
-4.31613850638e-07
2.01745804647e-06
-4.59743536298e-07
1.94357508677e-06
-4.86978862228e-07
2.05710083912e-06
-5.0604820121e-07
2.13305188099e-06
-5.68020412293e-07
2.04687737688e-06
-6.05800038554e-07
2.07286769332e-06
-6.38225492697e-07
2.12250369726e-06
-7.09479702748e-07
2.08469177048e-06
-7.56398062916e-07
2.07808191713e-06
-7.99790215193e-07
2.12929179154e-06
-8.64635643741e-07
2.05453826016e-06
-9.08871805364e-07
2.0768876824e-06
-9.90855059552e-07
2.06710478504e-06
-1.06031359524e-06
2.05809054297e-06
-1.12251289133e-06
2.02324380686e-06
-1.22153900022e-06
2.04568487963e-06
-1.32379709598e-06
2.00482628084e-06
-1.43287244888e-06
1.98594982082e-06
-1.53804818661e-06
1.97334855304e-06
-1.57637501665e-06
1.98930414277e-06
-1.63991818424e-06
2.04044232737e-06
-1.7589585847e-06
2.00384455085e-06
-1.87300604324e-06
1.9516789394e-06
-1.93686000601e-06
1.86147273031e-06
-2.03892461688e-06
1.81835466673e-06
-2.15141441228e-06
1.75529804534e-06
-2.27255684068e-06
1.65588333112e-06
-2.45963879423e-06
1.52486022865e-06
-2.64590595663e-06
1.42489582887e-06
-2.51722773077e-06
1.28286899536e-06
-1.96830249701e-06
1.15884955893e-06
7.49079392244e-07
4.59607299039e-07
3.01323823022e-05
-7.2310439512e-05
5.51077621148e-05
-0.000133399128287
7.90397590308e-05
-0.000180376211056
0.000101095838233
-0.000215287457469
0.00012111537549
-0.000240973616153
0.000139220229763
-0.000259476109785
0.000155618506266
-0.000272465879179
0.000170565895087
-0.000281303854154
0.000184332316248
-0.000287054276462
0.000197176058204
-0.000290527224757
0.000209329374609
-0.000292326573065
0.000220992368752
-0.000292894094256
0.000232332320205
-0.000292547882252
0.000243486290031
-0.000291514411701
0.000254565360197
-0.000289954243886
0.000265659376579
-0.000287981962976
0.000276841543687
-0.000285681202118
0.00028817253113
-0.000283115722702
0.000299703940234
-0.000280337422856
0.000311481039946
-0.000277392001227
0.000323544733335
-0.000274322892698
0.000335932808605
-0.000271174132326
0.000348680695706
-0.000267992893161
0.000361822122434
-0.000264832433909
0.000375390145299
-0.000261755972733
0.000389418974583
-0.000258841583803
0.000403946798672
-0.000256187747923
0.00041901954634
-0.000253918762703
0.000434695226869
-0.000252188974163
0.00045104824581
-0.000251184556783
0.000468172835407
-0.000251121464755
0.000486184283421
-0.000252237579492
0.000505216083792
-0.000254777003451
0.000525409157502
-0.000258962231232
0.000546889239971
-0.000264954008871
0.000569711723596
-0.000272774766145
0.000593809185888
-0.000282295796208
-0.000292560826676
-3.29955574257e-08
2.22365729095e-06
-9.473225459e-08
2.22460034595e-06
-1.01090697523e-07
2.17878952967e-06
-1.00969463315e-07
2.16441038217e-06
-1.37472991603e-07
2.15027813622e-06
-1.73593169724e-07
2.17267785645e-06
-1.94696065386e-07
2.21864213095e-06
-2.31308293321e-07
2.24321059515e-06
-2.93545192666e-07
2.12290634068e-06
-3.06169835139e-07
2.10067996477e-06
-4.00414890094e-07
2.11173840956e-06
-4.37027245628e-07
1.98022455008e-06
-4.48656647993e-07
2.06876752322e-06
-4.66641086355e-07
2.15107303798e-06
-5.39460672364e-07
2.11973784377e-06
-5.620950534e-07
2.0955412797e-06
-5.93109125194e-07
2.15355483313e-06
-6.74446355668e-07
2.16607156565e-06
-7.07976570456e-07
2.11165000744e-06
-7.39084265563e-07
2.16043612534e-06
-8.10032255555e-07
2.12552641164e-06
-8.48125605681e-07
2.1150174143e-06
-9.36562050187e-07
2.1555808122e-06
-9.8789726996e-07
2.10946458756e-06
-1.07042176024e-06
2.10580562065e-06
-1.14592944569e-06
2.12123243126e-06
-1.22716206105e-06
2.08609813759e-06
-1.32388225476e-06
2.08271055338e-06
-1.42190005285e-06
2.07140984177e-06
-1.49577760306e-06
2.06322428996e-06
-1.5658087657e-06
2.11052738823e-06
-1.73234666909e-06
2.17044794238e-06
-1.84244710089e-06
2.06184578179e-06
-2.02193877528e-06
2.04104402649e-06
-2.20054732802e-06
1.99703803116e-06
-2.40041205527e-06
1.95524027723e-06
-2.63228171166e-06
1.88781388206e-06
-2.95136077344e-06
1.84405534401e-06
-3.32709664152e-06
1.80074117074e-06
-3.45989982342e-06
1.41580661589e-06
-2.75755407288e-06
4.56493508477e-07
1.17529526825e-05
-1.40509827259e-05
3.74584917619e-05
-9.80158978991e-05
6.23944200999e-05
-0.00015833494282
8.54674757232e-05
-0.000203449169704
0.00010656372916
-0.000236383630748
0.000125582193013
-0.000259992012195
0.000142672258873
-0.000276566112706
0.000158101486622
-0.000287895045829
0.000172169373544
-0.000295371678495
0.000185168799754
-0.000300053639187
0.000197364740703
-0.000302723100604
0.000208984235166
-0.00030394600242
0.000220214417712
-0.00030412421116
0.000231205342358
-0.000303538741865
0.000242075160136
-0.000302384164161
0.000252916021625
-0.000300795040524
0.000263799741003
-0.000298865617235
0.000274782722835
-0.000296664119334
0.000285909976646
-0.00029424291215
0.000297218165694
-0.000291645548474
0.00030873765733
-0.00028891143038
0.000320493556918
-0.000286078730861
0.00033250585615
-0.000283186371214
0.000344789084953
-0.000280276062013
0.000357352102297
-0.000277395392012
0.000370198751218
-0.000274602562245
0.000383329955065
-0.000271972729364
0.00039674754239
-0.00026960527863
0.000410459744444
-0.000267630911859
0.000424488101649
-0.000266217285515
0.000438875402886
-0.000265571821218
0.000453694330123
-0.000265940364256
0.000469056139154
-0.000267599367915
0.000485118483032
-0.000270839314266
0.000502088311886
-0.000275932063113
0.000520213954539
-0.000283079667596
0.000539732266129
-0.000292293107446
0.00056080509127
-0.000303368641423
-0.000314708521883
-3.0370939102e-08
2.25398393473e-06
-6.26449757102e-08
2.25689859984e-06
-8.88681027578e-08
2.20505114784e-06
-1.00076183067e-07
2.17566173051e-06
-1.3091736105e-07
2.18116470762e-06
-1.62199533461e-07
2.20400312964e-06
-1.77361421385e-07
2.23385153924e-06
-2.06208291777e-07
2.27210119365e-06
-2.66225727096e-07
2.18295616848e-06
-2.87056870429e-07
2.12154919523e-06
-3.55541698602e-07
2.18025871251e-06
-4.17951345412e-07
2.04266781757e-06
-4.18780060904e-07
2.06963596683e-06
-4.3471220069e-07
2.16705009113e-06
-5.14299442146e-07
2.19936452587e-06
-5.34555107073e-07
2.11583666957e-06
-5.59953150901e-07
2.17899875562e-06
-6.27231045144e-07
2.23339081439e-06
-6.6017133119e-07
2.14462990711e-06
-6.87584208297e-07
2.18789156852e-06
-7.68309805492e-07
2.20628875311e-06
-8.03400404959e-07
2.15014921231e-06
-8.64596219726e-07
2.2168171848e-06
-9.16278691506e-07
2.16118593831e-06
-9.90933912479e-07
2.18050049791e-06
-1.03818504739e-06
2.16852258741e-06
-1.11935991262e-06
2.16731555513e-06
-1.20734771142e-06
2.17074449128e-06
-1.29831247911e-06
2.16242368672e-06
-1.39405723447e-06
2.15901986193e-06
-1.47612462496e-06
2.19263922818e-06
-1.54665836497e-06
2.24102343507e-06
-1.76663289221e-06
2.28187209894e-06
-2.02623301942e-06
2.30070545648e-06
-2.26586029712e-06
2.23674630556e-06
-2.46613520528e-06
2.15558776778e-06
-2.65644341828e-06
2.07820591811e-06
-2.90794485122e-06
2.09565118519e-06
-3.27549284179e-06
2.16838498908e-06
-3.97182155534e-06
2.11213386742e-06
-6.52191570901e-06
3.00661759791e-06
1.82406913713e-05
-3.88136439164e-05
4.39615393332e-05
-0.000123736605391
6.84599288443e-05
-0.000182833204068
9.08100778164e-05
-0.000225799220156
0.000110937595983
-0.000256511074019
0.000128927146066
-0.00027798150028
0.000145014203726
-0.000292653115171
0.000159519675054
-0.000302400463262
0.000172775813984
-0.000308627763648
0.000185087963381
-0.000312365733175
0.000196718248638
-0.000314353329839
0.000207881038659
-0.000315108735199
0.000218745420567
-0.000314988535852
0.000229441295294
-0.000314234558696
0.000240066676876
-0.000313009488051
0.000250694753576
-0.000311423058897
0.000261379975468
-0.000309550780843
0.000272162909192
-0.000307446994219
0.000283073843365
-0.000305153787548
0.000294135183237
-0.000302706829386
0.000305362590046
-0.000300138778399
0.000316764843867
-0.000297480926044
0.000328342656081
-0.000294764124808
0.000340087072446
-0.000292020420076
0.000351978435667
-0.000289286696983
0.000363986897648
-0.00028661096717
0.000376075169275
-0.000284060946074
0.000388203726678
-0.000281733785428
0.000400338317076
-0.000279765458749
0.000412459536588
-0.000278338472746
0.000424574450021
-0.00027768671409
0.000436730801133
-0.000278096705069
0.000449034366338
-0.000279902913738
0.000461670756965
-0.000283475702244
0.000474929181344
-0.000289190479624
0.000489224851154
-0.000297375330356
0.000505083820483
-0.000308152132454
0.000523083748789
-0.000321368599747
-0.000334498602195
-2.37451771744e-08
2.27785887173e-06
-3.69769880258e-08
2.2701932242e-06
-8.56897270816e-08
2.25381436832e-06
-1.03030005259e-07
2.19304759631e-06
-1.20642413215e-07
2.19882181739e-06
-1.42883509175e-07
2.22629278181e-06
-1.55814288282e-07
2.24682726842e-06
-1.80092423497e-07
2.29641934485e-06
-2.42062283451e-07
2.2449692851e-06
-2.75085817021e-07
2.15460923658e-06
-3.03014343038e-07
2.20822247198e-06
-3.954710016e-07
2.13516455778e-06
-4.02677350702e-07
2.07688369789e-06
-4.13965787819e-07
2.17837944528e-06
-4.64317655043e-07
2.24976127192e-06
-5.05098062726e-07
2.15666214665e-06
-5.23571888539e-07
2.19751494729e-06
-5.55498697973e-07
2.26536175076e-06
-6.14251480718e-07
2.20342602065e-06
-6.43723741644e-07
2.21740260781e-06
-7.05675771962e-07
2.26828382657e-06
-7.44754550585e-07
2.18926785546e-06
-7.72067198735e-07
2.24416992328e-06
-8.44819906062e-07
2.23397865292e-06
-8.9899800362e-07
2.23471674294e-06
-9.57914419448e-07
2.22747926632e-06
-1.02505593731e-06
2.23449875443e-06
-1.09421312634e-06
2.23994822353e-06
-1.1771034574e-06
2.2453655087e-06
-1.25866194942e-06
2.24062934149e-06
-1.34699342293e-06
2.28102084133e-06
-1.38720068585e-06
2.28127926771e-06
-1.44704952969e-06
2.34177583214e-06
-1.49379587985e-06
2.34751605072e-06
-1.58053677655e-06
2.32355322348e-06
-1.67697057469e-06
2.25209993873e-06
-1.79819335942e-06
2.19950961951e-06
-1.87090968138e-06
2.16842710922e-06
-1.86062524226e-06
2.15821221702e-06
-2.11254380746e-06
2.36416028383e-06
-3.0822760082e-06
3.97624019233e-06
2.44384800195e-05
-6.63340935938e-05
4.96805255786e-05
-0.000148978539458
7.35452743525e-05
-0.000206697852098
9.50927929824e-05
-0.00024734665506
0.000114238662743
-0.000275656876035
0.000131205180976
-0.000294947962138
0.000146325829873
-0.000307773713136
0.000159971690512
-0.000316046275767
0.000172496589251
-0.000321152614182
0.000184207472219
-0.000324076567865
0.000195354850298
-0.00032550065845
0.000206134262227
-0.000325888097393
0.000216693159327
-0.000325547382217
0.000227139800317
-0.000324681148863
0.000237552065398
-0.000323421701433
0.000247985080088
-0.000321856021723
0.000258477248068
-0.000320042896055
0.000269054667363
-0.000318024360431
0.000279734081348
-0.000315833147593
0.000290524417969
-0.00031349711164
0.000301426802541
-0.000311041107863
0.000312432981409
-0.000308487049204
0.000323522554432
-0.000305853641569
0.000334660039735
-0.000303157848567
0.000345793167776
-0.000300419768638
0.000356853642278
-0.000297671386537
0.000367760984669
-0.000294968237188
0.00037842938067
-0.000292402136492
0.000388777028989
-0.000290113072427
0.000398737710116
-0.000288299136138
0.000408275004095
-0.000287224006092
0.00041740116207
-0.000287222871541
0.000426203396744
-0.0002887051501
0.000434883240563
-0.000292155540163
0.000443806762989
-0.000298113939338
0.000453569562914
-0.000307138189305
0.000465047487032
-0.000319630069826
0.00047942441504
-0.000335745615254
-0.000352274460922
-2.4627201641e-08
2.30244383004e-06
-4.84621715081e-08
2.29405522911e-06
-6.85568636908e-08
2.27395042314e-06
-8.34171011663e-08
2.20795287927e-06
-9.71371318275e-08
2.21258944753e-06
-1.16719384171e-07
2.24592184434e-06
-1.34811803319e-07
2.26496674059e-06
-1.54563295393e-07
2.31621999031e-06
-2.13239047439e-07
2.30368650835e-06
-2.58187705082e-07
2.19959652792e-06
-2.61952281768e-07
2.21202865992e-06
-3.56539528083e-07
2.22979068591e-06
-3.90823872805e-07
2.11120672678e-06
-3.85162867547e-07
2.1727640036e-06
-3.96266076667e-07
2.26091096201e-06
-4.66406142946e-07
2.2268449383e-06
-4.76017472383e-07
2.2071713442e-06
-4.87823512196e-07
2.27721299675e-06
-5.63620118838e-07
2.27926386148e-06
-5.89088645079e-07
2.24291370084e-06
-6.16879653326e-07
2.29611630161e-06
-6.76709360192e-07
2.2491375078e-06
-6.93725718516e-07
2.26122748344e-06
-7.64888647452e-07
2.30518025962e-06
-8.02364221072e-07
2.27223204735e-06
-8.7730854682e-07
2.3024624143e-06
-9.22204478484e-07
2.27943608377e-06
-9.8180583555e-07
2.2995935311e-06
-1.05814822934e-06
2.32175624358e-06
-1.12980754296e-06
2.31234220533e-06
-1.18796664143e-06
2.33923628764e-06
-1.24180631258e-06
2.33517929951e-06
-1.26378488809e-06
2.36381534699e-06
-1.25960845794e-06
2.34339866241e-06
-1.27477886759e-06
2.33878956219e-06
-1.30958452103e-06
2.28697639029e-06
-1.32056652761e-06
2.21056012584e-06
-1.22133374809e-06
2.06933230915e-06
-9.74173674312e-07
1.9111480005e-06
-5.55038579766e-07
1.94499676168e-06
1.10709040876e-06
2.31424897515e-06
2.91958200291e-05
-9.44228277312e-05
5.45997774489e-05
-0.000174382411898
7.78098703188e-05
-0.000229907854941
9.84330107602e-05
-0.00026796971897
0.000116548129196
-0.000293771931997
0.000132499685137
-0.000310899465461
0.000146702544268
-0.000321976525861
0.000159563875495
-0.000328907563158
0.000171444487486
-0.000333033183699
0.000182641107764
-0.000335273145279
0.00019338456287
-0.000336244070615
0.000203846879729
-0.000336350370304
0.000214151877535
-0.000335852335825
0.000224386074877
-0.000334915300985
0.000234608266577
-0.000333643847611
0.000244857117548
-0.000332104826097
0.000255156707835
-0.000330342439252
0.000265520238405
-0.00032838784272
0.000275952148441
-0.000326265008591
0.000286448644764
-0.000323993557633
0.000296996353287
-0.000321588765006
0.000307569003471
-0.000319059646718
0.00031812284954
-0.000316407433851
0.000328592433592
-0.000313627378197
0.000338888605016
-0.000310715885837
0.000348900154123
-0.000307682883428
0.000358499305331
-0.000304567340873
0.000367550292457
-0.000301453082761
0.000375919804948
-0.000298482558968
0.000383488674903
-0.000295867993005
0.000390165410908
-0.000293900750933
0.000395905342802
-0.000292962810863
0.000400741739502
-0.00029354156437
0.00040484524477
-0.000296258961687
0.000408617622582
-0.000301886362846
0.00041284575276
-0.000311366240484
0.000418764444573
-0.000325548911473
0.000427947309995
-0.000344928563723
-0.000366704525957
-2.25485910447e-08
2.32512566064e-06
-5.18140622572e-08
2.32339024831e-06
-5.33722305263e-08
2.27556230405e-06
-5.78411877852e-08
2.21247064522e-06
-7.79117707423e-08
2.23270769106e-06
-9.75475438786e-08
2.26560756666e-06
-1.18475440338e-07
2.28594565616e-06
-1.34024813259e-07
2.3318159273e-06
-1.77637959062e-07
2.34734564135e-06
-2.34698970073e-07
2.25670129734e-06
-2.44992935924e-07
2.22236257055e-06
-2.93502403859e-07
2.27834066628e-06
-3.71084677083e-07
2.18883313128e-06
-3.55944263001e-07
2.15766713502e-06
-3.53538912982e-07
2.2585511267e-06
-4.20476918803e-07
2.29383082258e-06
-4.37477532625e-07
2.22421669722e-06
-4.43569994409e-07
2.28334975075e-06
-4.99346859831e-07
2.33508546198e-06
-5.30972771803e-07
2.27458168647e-06
-5.43741118831e-07
2.30892580013e-06
-6.11086559456e-07
2.31652502028e-06
-6.34506534961e-07
2.28468657548e-06
-6.81304629816e-07
2.35201788198e-06
-7.32060855998e-07
2.32302614387e-06
-7.80044805278e-07
2.35048524959e-06
-8.25259786431e-07
2.32468929928e-06
-8.87683723402e-07
2.36205758844e-06
-9.44976996723e-07
2.37909337063e-06
-1.01230097211e-06
2.37971356528e-06
-1.06437580832e-06
2.3913634913e-06
-1.13057232515e-06
2.40143137035e-06
-1.18029549973e-06
2.41359566136e-06
-1.22770564176e-06
2.3908675714e-06
-1.25844012646e-06
2.36958522188e-06
-1.2858822686e-06
2.31449201276e-06
-1.27530654005e-06
2.20008781125e-06
-1.19813608207e-06
1.99223839978e-06
-9.68755580682e-07
1.68180834885e-06
-2.06854152182e-07
1.1831710677e-06
8.28935573443e-06
-6.1818880925e-06
3.46497428183e-05
-0.000120783064891
5.93153179954e-05
-0.000199047839739
8.14435648134e-05
-0.000252035985893
0.000100921545426
-0.000287447611311
0.000117934849472
-0.000310785168428
0.000132888800412
-0.000325853362131
0.000146237707803
-0.000335325387013
0.000158400116062
-0.00034106992996
0.000169727151703
-0.000344360179873
0.00018049426173
-0.000346040217027
0.000190906263521
-0.000346656033878
0.000201108936747
-0.000346553005028
0.000211202173484
-0.000345945533168
0.000221251909345
-0.000344964997143
0.000231299716371
-0.000343691613841
0.000241369841412
-0.000342174909814
0.000251473951361
-0.000340446506613
0.000261613947631
-0.000338527795569
0.000271783155562
-0.000336434171585
0.000281965703411
-0.000334176059283
0.000292133543164
-0.000331756556753
0.000302241049416
-0.000329167103324
0.000312218464461
-0.000326384797562
0.000321966629075
-0.000323375490306
0.000331355473987
-0.000320104678219
0.000340227493018
-0.000316554851378
0.000348405622385
-0.000312745423391
0.000355703587399
-0.000308751007563
0.000361936367913
-0.000304715311982
0.000366929202732
-0.00030086081905
0.00037052485117
-0.000297496414745
0.000372592269461
-0.000295030266035
0.000373042957985
-0.000293992233233
0.000371880045186
-0.000295096141927
0.000369311810851
-0.000299318006175
0.000366094697512
-0.000308149336504
0.000363980770451
-0.000323435142941
0.000366056448137
-0.000347004562522
-0.00037280996325
-1.19793379122e-08
2.33707280396e-06
-2.79651210386e-08
2.33940686069e-06
-3.34051639082e-08
2.28104783359e-06
-5.54658383753e-08
2.23457706457e-06
-7.48479096179e-08
2.25213790714e-06
-8.86785446854e-08
2.27948837706e-06
-1.04607757823e-07
2.30192505493e-06
-1.11378402935e-07
2.33863874078e-06
-1.38386619977e-07
2.37440289169e-06
-2.00590194726e-07
2.31894888456e-06
-2.32443391077e-07
2.25425776703e-06
-2.28285745931e-07
2.27422782464e-06
-3.21053369107e-07
2.28164329364e-06
-3.40056430629e-07
2.17671483304e-06
-3.21666141412e-07
2.24020959579e-06
-3.48917965288e-07
2.32112999021e-06
-4.01229969178e-07
2.2765743755e-06
-3.99734494907e-07
2.28189964683e-06
-4.13524600538e-07
2.34892123494e-06
-4.73193860766e-07
2.33429347696e-06
-4.82836152529e-07
2.31861045536e-06
-5.32029112167e-07
2.36575905036e-06
-5.70223094897e-07
2.32291957111e-06
-5.77642967351e-07
2.35947659506e-06
-6.48985267578e-07
2.39440557843e-06
-6.80359353734e-07
2.38189589117e-06
-7.43585826557e-07
2.3879525022e-06
-7.90985827811e-07
2.40949533092e-06
-8.44123738758e-07
2.43227053003e-06
-9.22376881905e-07
2.45800817303e-06
-9.85706140074e-07
2.45473744583e-06
-1.05835260951e-06
2.47412654636e-06
-1.12641085276e-06
2.48170466251e-06
-1.19845913412e-06
2.46296729408e-06
-1.27860848401e-06
2.44979571522e-06
-1.35635105097e-06
2.39230681123e-06
-1.45105321689e-06
2.29486495722e-06
-1.58015854012e-06
2.12140907685e-06
-1.76136949794e-06
1.86307819018e-06
-2.21908237054e-06
1.64097742716e-06
1.45557534363e-05
-2.29560128124e-05
3.98209829554e-05
-0.000146048087913
6.33735525126e-05
-0.000222600255872
8.42371787441e-05
-0.000272899496895
0.000102488701463
-0.000305699049238
0.000118407053392
-0.000326703456074
0.000132428256167
-0.000339874514155
0.000145015146522
-0.00034791223507
0.000156577419797
-0.000352632165614
0.000167444040887
-0.000355226766145
0.000177861956604
-0.000356458098735
0.0001880067849
-0.000356800828689
0.000197997718368
-0.0003565439044
0.000207912091181
-0.000355859871643
0.000217797444881
-0.000354850315451
0.0002276805231
-0.000353574656134
0.000237573398492
-0.000352067748023
0.000247477233451
-0.000350350303562
0.000257384134885
-0.000348434657462
0.000267277374232
-0.000346327370104
0.000277129473828
-0.000344028116117
0.000286897246401
-0.000341524284736
0.000296513928083
-0.000338783738274
0.000305880616008
-0.000335751436894
0.000314860593419
-0.00033235541798
0.000323279503808
-0.000328523538386
0.000330932024542
-0.000324207324219
0.000337593123214
-0.000319406475645
0.00034303040778
-0.000314188255535
0.000347013925065
-0.000308698800378
0.000349320585045
-0.000303167480137
0.00034973103328
-0.000297906884704
0.000348018260895
-0.000293317521567
0.000343923232942
-0.000289897318389
0.000337123661339
-0.00028829650137
0.000327162187582
-0.000289356756396
0.000313495065711
-0.000294482294256
0.000295635370406
-0.000305575890925
0.00027855154206
-0.00032992084005
-0.000389261349599
-3.13677743559e-09
2.34034379575e-06
-4.8326785011e-09
2.34117648488e-06
-6.07241695017e-09
2.28234101834e-06
-6.29318410178e-08
2.29148644843e-06
-7.5905100882e-08
2.26516074956e-06
-8.06369620225e-08
2.28427124971e-06
-8.8596703908e-08
2.30993939539e-06
-8.74373462075e-08
2.33753277236e-06
-1.02690374727e-07
2.3897073191e-06
-1.59407473012e-07
2.37571489828e-06
-2.07877514334e-07
2.30277344232e-06
-2.08530665679e-07
2.27492465517e-06
-2.4566552068e-07
2.31882506616e-06
-3.15827160733e-07
2.24692305014e-06
-2.98453550038e-07
2.2228819654e-06
-2.86568720441e-07
2.30929371986e-06
-3.48068588789e-07
2.33812164855e-06
-3.58198615857e-07
2.29207691845e-06
-3.49093327562e-07
2.33986114174e-06
-4.05682480013e-07
2.39092723999e-06
-4.25675429941e-07
2.33864591024e-06
-4.35163204423e-07
2.37528741403e-06
-4.94947165289e-07
2.38274397333e-06
-5.13912649859e-07
2.37847967075e-06
-5.60137530943e-07
2.44066835174e-06
-6.04338248909e-07
2.42613312322e-06
-6.50568260454e-07
2.4342183669e-06
-6.99333257315e-07
2.45829612582e-06
-7.59378233333e-07
2.49235019838e-06
-8.2570457781e-07
2.52437007501e-06
-8.96851225561e-07
2.52592024587e-06
-9.78843787604e-07
2.5561570181e-06
-1.06348681315e-06
2.56638616856e-06
-1.16687486031e-06
2.56639626671e-06
-1.28381709982e-06
2.5667806418e-06
-1.42542314606e-06
2.53397291758e-06
-1.59984913767e-06
2.46935176537e-06
-1.83050151328e-06
2.35210823956e-06
-2.13489641798e-06
2.16747512994e-06
-3.00872037799e-06
2.51496854434e-06
2.07019965928e-05
-4.66664743839e-05
4.39122598752e-05
-0.000169258207561
6.61660757636e-05
-0.000244853953692
8.58818242635e-05
-0.000292615153534
0.000103026807536
-0.00032284396178
0.000117966345827
-0.000341642939312
0.000131175823981
-0.000353083947893
0.000143119546284
-0.00035985591982
0.000154189702715
-0.000363702288936
0.000164687606001
-0.000365724638461
0.000174829405664
-0.000366599868752
0.000184761745667
-0.000366733138983
0.000194579111075
-0.000366361240099
0.000204338965369
-0.000365619695336
0.000214073302064
-0.000364584621057
0.000223796662571
-0.000363297984372
0.000233511165998
-0.000361782218411
0.000243209242745
-0.000360048345862
0.000252874533628
-0.000358099912739
0.0002624811444
-0.000355933943487
0.000271990239318
-0.000353537171949
0.000281342641545
-0.000350876645666
0.000290448091624
-0.000347889145122
0.000299174883955
-0.000344478184061
0.00030734488335
-0.000340525371
0.000314737093739
-0.000335915702088
0.000321099223915
-0.000330569407064
0.000326163440932
-0.000324470648384
0.000329661213936
-0.000317685984057
0.000331332557704
-0.000310370116513
0.000330926406026
-0.000302761311718
0.000328188601563
-0.000295169100268
0.000322834597067
-0.000287963582165
0.000314492457433
-0.000281555203051
0.000302602392401
-0.000276406614835
0.000286128140201
-0.000272882492427
0.000263001451739
-0.000271355973252
0.00022740290966
-0.000269977543085
0.000163957265344
-0.000266475806815
-0.00022530438457
-5.06661135874e-09
2.34538223724e-06
-1.12674890753e-08
2.34740972716e-06
-5.77920997041e-09
2.27689968821e-06
-3.91118630228e-08
2.32487133357e-06
-6.08980824491e-08
2.28699750105e-06
-6.58562432379e-08
2.28928349789e-06
-6.88381005218e-08
2.31297693617e-06
-6.75196689799e-08
2.33627101132e-06
-7.10348180559e-08
2.39327898679e-06
-1.06937521621e-07
2.4116696106e-06
-1.65621711716e-07
2.36150510191e-06
-1.94914669548e-07
2.30426377683e-06
-1.82517166208e-07
2.30647367306e-06
-2.46278328879e-07
2.31073090666e-06
-2.78951527786e-07
2.2556021207e-06
-2.46472290009e-07
2.27686230434e-06
-2.59277154099e-07
2.3509767528e-06
-3.15474923762e-07
2.34832116028e-06
-2.97976411148e-07
2.32240967822e-06
-3.0971925592e-07
2.40271658834e-06
-3.67133553053e-07
2.39610152318e-06
-3.68562137223e-07
2.37675844024e-06
-4.14553138483e-07
2.42877511144e-06
-4.49037503764e-07
2.41300358978e-06
-4.59768334777e-07
2.451436986e-06
-5.11821513739e-07
2.47822299917e-06
-5.55090392063e-07
2.47752262475e-06
-6.08100147088e-07
2.51133936046e-06
-6.56096661097e-07
2.54037906249e-06
-7.22035486693e-07
2.59033929932e-06
-8.08091861195e-07
2.61200626235e-06
-8.89655457236e-07
2.63774972901e-06
-9.81725453998e-07
2.65848502577e-06
-1.10358570201e-06
2.68827984795e-06
-1.24519888457e-06
2.70843039137e-06
-1.41698479308e-06
2.70579288611e-06
-1.61788258049e-06
2.67028808896e-06
-1.89076865509e-06
2.62501656287e-06
-2.19079085197e-06
2.46752886408e-06
-3.28906529265e-06
3.61326692847e-06
2.16427274212e-05
-7.15981877058e-05
4.58015100987e-05
-0.000193416931732
6.74358661807e-05
-0.000266488248781
8.62787507258e-05
-0.000311457984288
0.00010253388752
-0.000339099052808
0.000116671339214
-0.000355780353138
0.000129219020018
-0.000365631596076
0.000140647923202
-0.000371284794402
0.000151332228204
-0.000374386567265
0.000161545159659
-0.000375937544612
0.000171473331328
-0.000376528015091
0.000181237054318
-0.000376496836664
0.000190909435015
-0.000376033594598
0.000200531461869
-0.000375241695478
0.00021012264917
-0.000374175780468
0.000219687896646
-0.000372863203209
0.000229221396319
-0.000371315688118
0.000238708384536
-0.000369535303078
0.00024812514616
-0.000367516641769
0.000257437306809
-0.000365246070076
0.00026659464139
-0.000362694470464
0.000275520616352
-0.000359802582847
0.000284098389526
-0.000356466878347
0.000292159201728
-0.000352538955307
0.000299479746954
-0.000347845873831
0.000305791283188
-0.000342227195881
0.00031079785564
-0.000335575936706
0.000314197487719
-0.000327870236018
0.000315699816639
-0.00031918827401
0.000315035384258
-0.000309705642489
0.000311953897089
-0.000299679819587
0.000306208860993
-0.000289424070034
0.00029752668693
-0.000279281469071
0.000285543516898
-0.000269572131758
0.000269709968663
-0.0002605730826
0.000249015190776
-0.000252187953602
0.000221862184158
-0.000244203110932
0.000183839322899
-0.000231955134523
0.000128937775338
-0.000211574614218
-9.63667131215e-05
-8.13129511399e-09
2.35365091557e-06
-2.04166249745e-08
2.35976868088e-06
-3.25927414812e-08
2.28913602498e-06
-8.60250213491e-09
2.30093497357e-06
-4.11397965419e-08
2.31959181686e-06
-4.89787596073e-08
2.29717959186e-06
-4.92755700655e-08
2.31333255819e-06
-4.90255099175e-08
2.33608109944e-06
-3.75568877265e-08
2.38186875864e-06
-5.12412489379e-08
2.42540985438e-06
-1.03914199976e-07
2.41423036364e-06
-1.52038061898e-07
2.35243546917e-06
-1.55856424077e-07
2.31033992906e-06
-1.64692358436e-07
2.31961500792e-06
-2.34338413498e-07
2.32529653096e-06
-2.27816401657e-07
2.27038947815e-06
-1.98311317984e-07
2.3215204622e-06
-2.46987520602e-07
2.39704877876e-06
-2.57901252845e-07
2.3333711213e-06
-2.43176119998e-07
2.38803571321e-06
-2.93565202665e-07
2.44653660911e-06
-3.13424704816e-07
2.39665940214e-06
-3.25264011422e-07
2.44065652706e-06
-3.61800397015e-07
2.44957983337e-06
-3.83708125959e-07
2.47338380736e-06
-4.14472571407e-07
2.50902449358e-06
-4.64689551865e-07
2.52777539029e-06
-4.9984701879e-07
2.54652992274e-06
-5.52878516212e-07
2.59344173809e-06
-6.2764932695e-07
2.66513847601e-06
-6.93683130155e-07
2.67806643385e-06
-7.65970638811e-07
2.71005883339e-06
-8.62609394207e-07
2.75514073533e-06
-9.96854893224e-07
2.82254184433e-06
-1.1484673459e-06
2.86005020814e-06
-1.3382252876e-06
2.89556492908e-06
-1.59122099302e-06
2.923299569e-06
-1.90588706585e-06
2.93969008216e-06
-2.17681274355e-06
2.73845110037e-06
-3.04234804456e-06
4.47872855874e-06
2.19617067121e-05
-9.66023360053e-05
4.62519491132e-05
-0.000217707226195
6.7456175195e-05
-0.000287692500643
8.56135945292e-05
-0.000329615409323
0.000101154203204
-0.000354639659095
0.000114651508843
-0.000369277649944
0.000126678345021
-0.000377658420521
0.000137709802129
-0.000382316236672
0.00014810129541
-0.000384778044112
0.000158099002412
-0.000385935233148
0.00016786277325
-0.000386291766307
0.00017749030394
-0.000386124346082
0.000187037181321
-0.000385580449726
0.000196531414096
-0.000384735904543
0.000205982933397
-0.00038362727515
0.000215389269615
-0.000382269513443
0.000224738398136
-0.000380664789675
0.000234009616754
-0.000378806493312
0.000243172722026
-0.000376679717465
0.000252185327392
-0.000374258644222
0.000260985431783
-0.000371494542353
0.000269477105007
-0.000368294221657
0.000277512932687
-0.00036450267121
0.000284882232048
-0.000359908218451
0.000291313043524
-0.000354276650228
0.000296489207627
-0.00034740332276
0.000300076723866
-0.000339163414476
0.000301750637218
-0.000329544108927
0.000301215043387
-0.000318652627648
0.000298212282853
-0.000306702845232
0.000292520875607
-0.000293988361085
0.000283942265061
-0.00028084545179
0.000272279217041
-0.000267618388677
0.000257284348145
-0.000254577238395
0.000238587962172
-0.00024187667396
0.000215317660986
-0.000228917484313
0.000185814343878
-0.00021469983855
0.00014170897777
-0.000187849661363
7.32576335695e-05
-0.000143123081567
-2.31089971602e-05
-5.14309187629e-09
2.35876889893e-06
-1.13996029883e-08
2.36606687524e-06
-4.92086150485e-08
2.32699557575e-06
-1.57678345893e-08
2.26755280146e-06
-2.76325867765e-08
2.33151630587e-06
-3.19745474572e-08
2.30158103492e-06
-2.87918169917e-08
2.31021200785e-06
-2.61646560987e-08
2.33351586893e-06
-8.31329569004e-09
2.36407938008e-06
-5.41475468957e-09
2.42257169455e-06
-3.03922809024e-08
2.43926386234e-06
-8.81727515255e-08
2.41026871679e-06
-1.22618382975e-07
2.34483481389e-06
-1.16264276017e-07
2.31331101914e-06
-1.43213647345e-07
2.35229709857e-06
-1.97473300058e-07
2.32469777397e-06
-1.75270252618e-07
2.29936823772e-06
-1.56593668023e-07
2.37842216727e-06
-2.03926488422e-07
2.38075096848e-06
-1.99714168396e-07
2.38387097135e-06
-1.9673250171e-07
2.44359897836e-06
-2.36800423815e-07
2.43677120784e-06
-2.45763126675e-07
2.44966132068e-06
-2.70460996621e-07
2.47431900668e-06
-2.96093277968e-07
2.49905515312e-06
-3.18198587262e-07
2.53116786306e-06
-3.552063356e-07
2.56481853427e-06
-3.94332169164e-07
2.5856900939e-06
-4.49831131452e-07
2.64897273067e-06
-4.94749550019e-07
2.7100874458e-06
-5.47402690206e-07
2.73074274855e-06
-6.22723691364e-07
2.78539910611e-06
-7.24641367945e-07
2.85707130065e-06
-8.5003355315e-07
2.94793376303e-06
-1.00527805347e-06
3.01529492352e-06
-1.21068351071e-06
3.10095756649e-06
-1.50005746598e-06
3.21265611386e-06
-1.8082381459e-06
3.24787142164e-06
-2.08712774563e-06
3.01730044991e-06
-2.40530081494e-06
4.79691861198e-06
2.18975563256e-05
-0.000120905589268
4.58782930291e-05
-0.000241688089187
6.65894429402e-05
-0.000308403712972
8.41388697661e-05
-0.000347164873791
9.90841064383e-05
-0.000369584916907
0.000112068105768
-0.000382261660163
0.00012368931084
-0.000389279627357
0.000134418525941
-0.000393045447654
0.000144590309949
-0.000394949818717
0.000154425136645
-0.000395770047165
0.000164059317104
-0.000395925930962
0.000173571812413
-0.000395636823691
0.000183004401999
-0.00039501301956
0.000192375250661
-0.000394106732198
0.000201687165376
-0.0003929391673
0.000210932148899
-0.000391514473367
0.000220093299691
-0.000389825915481
0.000229144930439
-0.000387858098026
0.000238050973417
-0.000385585733003
0.000246761263092
-0.000382968905409
0.000255201194743
-0.000379934444003
0.000263252542611
-0.000376345538988
0.000270732287819
-0.000371982384818
0.000277382394093
-0.00036655829403
0.000282879327683
-0.000359773551812
0.000286861529348
-0.000351385493179
0.000288964779041
-0.000341266629359
0.000288854035304
-0.000329433319314
0.000286244178091
-0.000316042729569
0.00028090751265
-0.000301366108145
0.000272669866166
-0.000285750651227
0.000261400109605
-0.000269575599387
0.000247002679701
-0.000253220869099
0.000229403604214
-0.000236977954
0.000208604362015
-0.000221077083744
0.000184215369147
-0.000204528230916
0.000155194909042
-0.000185678981414
0.000109570426506
-0.000142224590372
2.35933974708e-05
-5.71455327219e-05
4.84515377208e-07
-3.10198692883e-09
2.36201385242e-06
-8.01809954689e-09
2.37105973474e-06
-4.55288028887e-08
2.3645713338e-06
-4.22512172283e-08
2.26433283774e-06
-8.21335641839e-09
2.29753703726e-06
-7.66039668509e-09
2.30109096834e-06
-2.75657963389e-09
2.30537039814e-06
2.04162392799e-09
2.32878154197e-06
1.34975294342e-08
2.3526870484e-06
3.0295604457e-08
2.40583570507e-06
2.69439836509e-08
2.44267564439e-06
-9.44983626271e-09
2.4467193154e-06
-6.09614330036e-08
2.39640016255e-06
-8.55644143838e-08
2.33796506885e-06
-7.11512219325e-08
2.33793431996e-06
-1.18330820271e-07
2.37192952297e-06
-1.42255975887e-07
2.32334310787e-06
-1.05439806576e-07
2.34165568524e-06
-1.1901168437e-07
2.39437319495e-06
-1.465315673e-07
2.41143794461e-06
-1.30161876491e-07
2.42727665249e-06
-1.46146160384e-07
2.45280054581e-06
-1.67671434092e-07
2.47123062548e-06
-1.80021364605e-07
2.48671118763e-06
-1.98095594546e-07
2.51717050578e-06
-2.23475984834e-07
2.55658811627e-06
-2.47908891082e-07
2.58929064471e-06
-2.94089808612e-07
2.63190911399e-06
-3.24305861244e-07
2.67922608031e-06
-3.49855195498e-07
2.73566939085e-06
-4.02502803458e-07
2.78341714466e-06
-4.58359389603e-07
2.84127468847e-06
-5.37385398443e-07
2.9361016732e-06
-6.30199073528e-07
3.04075212754e-06
-7.63621458459e-07
3.14869278429e-06
-9.66225165728e-07
3.30354376007e-06
-1.25291654196e-06
3.49933610745e-06
-1.61281332301e-06
3.60784096977e-06
-2.21013992898e-06
3.61472813905e-06
-2.17681518939e-06
4.76334794346e-06
2.1330307949e-05
-0.000144412804051
4.48449147684e-05
-0.000265202849948
6.5067115182e-05
-0.00032862600941
8.20796930946e-05
-0.000364177514065
9.6522103504e-05
-0.000384027370334
0.000109088093425
-0.000394827677465
0.000120388650812
-0.000400580200823
0.000130883858405
-0.000403540661078
0.000140886121882
-0.000404952080953
0.0001505919
-0.000405475817892
0.000160117075655
-0.000405451095261
0.000169525310448
-0.000405045043608
0.000178847669933
-0.000404335361986
0.000188094967371
-0.000403354010415
0.000197264755453
-0.000402108934792
0.000206344867509
-0.000400594563266
0.000215314481647
-0.000398795506371
0.000224143589509
-0.000396687181332
0.000232790645315
-0.00039423276329
0.000241197694646
-0.000391375928111
0.000249276150825
-0.000388012872833
0.000256881548118
-0.00038395090825
0.000263789092752
-0.000378889902248
0.000269687615658
-0.000372456790137
0.000274200050182
-0.000364285962626
0.000276923489736
-0.000354108907111
0.000277473502378
-0.000341816610003
0.000275519232567
-0.000327479022238
0.000270802653911
-0.000311326081665
0.000263141853621
-0.000293705233208
0.000252421845384
-0.000275030564778
0.000238577126462
-0.000255730752728
0.000221569982209
-0.000236213536502
0.00020136359457
-0.000216771307544
0.000178092723619
-0.000197805891498
0.000151488976391
-0.000177924106749
0.000122782637268
-0.000156972253102
5.03458715308e-05
-6.97874422544e-05
-1.04206785088e-06
-5.75742037452e-06
-5.57495492304e-07
-9.1657406764e-10
2.36291058302e-06
-8.52934955739e-09
2.37871516884e-06
-1.68850028426e-08
2.37297949776e-06
-4.41579256297e-08
2.29165945539e-06
-1.27127792439e-08
2.26614975517e-06
2.35251561942e-09
2.28608487986e-06
1.97971783482e-08
2.28798984909e-06
2.97271877762e-08
2.3189167962e-06
3.54710763665e-08
2.34700827056e-06
5.93776930737e-08
2.38199397778e-06
6.64210232962e-08
2.43569606015e-06
6.51600982044e-08
2.44804022067e-06
1.90408169077e-08
2.44257583745e-06
-3.0340718359e-08
2.38739873433e-06
-4.13376154342e-08
2.34898292651e-06
-3.32130361444e-08
2.36385594356e-06
-7.3178433106e-08
2.36335969914e-06
-6.83311587147e-08
2.33685906827e-06
-4.41583671097e-08
2.3702513185e-06
-5.48205080894e-08
2.42215110533e-06
-7.16442523369e-08
2.44414869381e-06
-6.63139588675e-08
2.44751733999e-06
-7.61967081822e-08
2.48115851092e-06
-9.05668735026e-08
2.50112560335e-06
-1.06630398863e-07
2.53327768374e-06
-1.18475677585e-07
2.56847680252e-06
-1.43988175663e-07
2.61484604101e-06
-1.61751838998e-07
2.64971472836e-06
-1.79846879052e-07
2.69736087059e-06
-1.9210142743e-07
2.74795862874e-06
-2.21480287981e-07
2.81282444097e-06
-2.55576094507e-07
2.87538644152e-06
-2.99287711991e-07
2.97982432139e-06
-3.52618158333e-07
3.09406827056e-06
-4.49119704612e-07
3.24518702532e-06
-5.93118037936e-07
3.44750876102e-06
-7.37582283816e-07
3.64388991924e-06
-1.0187693334e-06
3.88908391165e-06
-1.58841639586e-06
4.18436279585e-06
-3.16525935837e-06
6.34022872537e-06
1.99045749047e-05
-0.000167482932765
4.32223818156e-05
-0.000288520798804
6.31161684475e-05
-0.000348519884167
7.96800539919e-05
-0.000380741460655
9.36793153589e-05
-0.000398026674429
0.000105880620554
-0.000407029012018
0.000116907922738
-0.000411607520177
0.000127206731437
-0.000413839477727
0.000137065794695
-0.000414811144096
0.000146658462925
-0.000415068480405
0.000156082339749
-0.000414874961605
0.000165388214655
-0.000414350904942
0.000174598606329
-0.000413545737311
0.000183718680534
-0.000412474066511
0.000192741983616
-0.00041113221795
0.00020165306492
-0.000409505623448
0.000210427790212
-0.00040757020916
0.000219032233552
-0.000405291601219
0.000227419539255
-0.000402620044454
0.000235523701164
-0.000399480064744
0.00024324010341
-0.000395729248994
0.000250392857965
-0.000391103636819
0.000256708100978
-0.000385205119421
0.000261815749588
-0.00037756441483
0.000265284749544
-0.000367754939332
0.000266677206741
-0.000355501337978
0.00026560045478
-0.000340739838274
0.000261742879541
-0.000323621387517
0.000254889176355
-0.000304472323592
0.000244918995313
-0.000283734986765
0.00023179392281
-0.000261905337994
0.00021553475265
-0.000239471501091
0.000196171699188
-0.000216850314854
0.000173616946117
-0.000194216311563
0.000147379692623
-0.00017156842946
0.00011249846641
-0.000143042755131
5.98688602105e-05
-0.000104342443493
2.52746982708e-06
-1.24459591458e-05
-5.96288465372e-07
-2.63358252743e-06
-1.15369947746e-06
8.47168215452e-09
2.35457981684e-06
6.04309186195e-09
2.38122369635e-06
1.5406501974e-08
2.363678819e-06
-2.44960365793e-08
2.33161925487e-06
-4.00670076811e-08
2.28177645921e-06
-1.33907308274e-08
2.25946975582e-06
2.85974844353e-08
2.24606423729e-06
4.99727113443e-08
2.2976065376e-06
5.9633065237e-08
2.33741411322e-06
7.82096624177e-08
2.36348379699e-06
1.03497145183e-07
2.41047280791e-06
1.08088332654e-07
2.44351230107e-06
1.02079991015e-07
2.44864321356e-06
5.22962728521e-08
2.43723930642e-06
7.26016679127e-09
2.3940713398e-06
1.31998702898e-08
2.3579691534e-06
1.3691694314e-08
2.36292045278e-06
-9.69024329312e-09
2.36029348436e-06
1.21233794852e-09
2.35940046325e-06
2.83211026742e-08
2.39509455638e-06
2.43088158268e-08
2.44821171175e-06
5.94831016288e-09
2.46592649628e-06
1.3055979183e-08
2.47409855887e-06
5.16035326836e-09
2.50906848778e-06
-6.20919477799e-09
2.54469506328e-06
-8.80683786248e-09
2.57112157861e-06
-1.22983937672e-08
2.61838433526e-06
-1.4242665563e-08
2.65170484974e-06
-1.85590624294e-08
2.7017209311e-06
-2.2639444676e-08
2.75208017965e-06
-4.01411581183e-08
2.83036016588e-06
-6.43771636745e-08
2.89964842922e-06
-6.94479953936e-08
2.98490857601e-06
-8.00670200221e-08
3.10470154791e-06
-1.10153606313e-07
3.2752468077e-06
-7.23719527861e-08
3.40975956525e-06
1.44159236484e-08
3.557075323e-06
1.81878432625e-07
3.7216739851e-06
3.75926644831e-07
3.99035645199e-06
-7.34081422521e-06
1.40572321934e-05
1.91823093532e-05
-0.000194006066446
4.1753344938e-05
-0.000311091826691
6.11760745273e-05
-0.000367942618505
7.72505568372e-05
-0.000396815955367
9.07786772048e-05
-0.000411554808543
0.000102604914057
-0.00041885525975
0.000113362067385
-0.000422364679947
0.000123471442104
-0.000423948853516
0.000133192180186
-0.000424531878648
0.000142672734913
-0.000424549027154
0.000151992838932
-0.000424195054412
0.000161191570341
-0.000423549622122
0.00017028409408
-0.000422638244796
0.000179270899446
-0.00042146085359
0.000188142230435
-0.000420003529296
0.000196879850415
-0.00041824322225
0.000205456635281
-0.000416146971791
0.000213834934404
-0.000413669876901
0.000221962555133
-0.000410747640837
0.00022976492279
-0.000407282407225
0.000237118533369
-0.000403082833332
0.00024380949062
-0.000397794568023
0.000249506562961
-0.000390902165191
0.000253775514871
-0.000381833344468
0.000256132972209
-0.000370112375188
0.000256115040324
-0.000355483395026
0.000253334568464
-0.000337959335132
0.000247513802272
-0.000317800616328
0.000238492594946
-0.000295451073161
0.000226220679327
-0.000271462968715
0.000210743684647
-0.000246428370449
0.0001921970641
-0.00022092475884
0.000170812196294
-0.0001954653447
0.000146876469027
-0.00017028047757
0.00012011824165
-0.00014481007193
8.26623801222e-05
-0.000105586828915
1.82493383519e-05
-3.99293814706e-05
3.79816445423e-06
2.00525217069e-06
1.03145775766e-06
1.33271745721e-07
-1.22223225849e-07
2.33453524981e-08
2.33122653706e-06
2.98969444736e-08
2.37471941621e-06
3.03853619734e-08
2.36324709873e-06
3.73103031877e-09
2.35833097524e-06
-3.43613071915e-08
2.31992634005e-06
-2.70628217431e-08
2.25222712096e-06
1.73211368797e-08
2.20173896656e-06
5.16806806862e-08
2.2633101357e-06
7.41429754412e-08
2.31501764011e-06
9.03736499946e-08
2.34731939805e-06
1.23035391886e-07
2.37787826899e-06
1.36939108269e-07
2.42967351354e-06
1.53877718571e-07
2.43176785737e-06
1.38450810556e-07
2.45272625877e-06
9.93129893279e-08
2.43326761206e-06
6.3222601489e-08
2.39411443482e-06
7.70894119449e-08
2.34910854615e-06
7.61301668558e-08
2.36130687074e-06
6.45353749354e-08
2.37104952963e-06
8.04876798405e-08
2.37919469304e-06
1.11703006909e-07
2.41704922347e-06
1.10755385719e-07
2.46692555851e-06
9.86871435791e-08
2.48621780274e-06
1.03601160877e-07
2.50420590269e-06
1.12442701523e-07
2.53590408448e-06
1.16460951876e-07
2.5671540304e-06
1.26432627219e-07
2.6084629375e-06
1.25352811698e-07
2.65283469744e-06
1.33813241268e-07
2.69331020357e-06
1.23644529622e-07
2.76229580366e-06
1.33679991235e-07
2.82036659879e-06
1.38817859107e-07
2.89454688605e-06
1.49388788685e-07
2.97437219586e-06
1.58509230866e-07
3.09558880671e-06
2.13221027913e-07
3.22056731878e-06
3.38338867867e-07
3.28459330706e-06
5.41244637885e-07
3.35419997592e-06
9.76175466124e-07
3.28677335234e-06
2.00971021024e-06
2.95720273021e-06
-1.51425006165e-05
3.12102296901e-05
1.85912811223e-05
-0.000227739660561
4.13152768716e-05
-0.000333815709443
5.98069264599e-05
-0.000386434209656
7.50724985033e-05
-0.000412081497787
8.79826627699e-05
-0.0004244649577
9.93688210208e-05
-0.000430241408695
0.000109828102076
-0.000432823953224
0.000119735325666
-0.000433856068718
0.000129309271757
-0.000434105814565
0.000138669534401
-0.000433909277783
0.000147877222363
-0.000433402728214
0.000156960067567
-0.000432632451524
0.000165926463735
-0.000431604623355
0.000174772719668
-0.000430307090633
0.00018348612857
-0.00042871691779
0.000192045906413
-0.000426802978598
0.000200422066382
-0.000424523108955
0.00020857326971
-0.000421821056422
0.000216441794658
-0.000418616141002
0.000223943724778
-0.00041478431132
0.000230932831838
-0.000410071914075
0.000237149076963
-0.000404010785335
0.000242194820045
-0.00039594788352
0.000245567648756
-0.000385206149699
0.000246736322199
-0.000371281034798
0.000245222959379
-0.000353970014043
0.000240661554665
-0.000333397938154
0.000232823330498
-0.000309962367504
0.000221613447532
-0.000284241162316
0.000207051052206
-0.000256900611795
0.000189239268322
-0.000228616484369
0.000168350137806
-0.000200035669197
0.000144694851205
-0.00017181002577
0.000118977521784
-0.000144563042995
9.26267716499e-05
-0.000118459349609
3.75146524638e-05
-5.04747098121e-05
2.27111426363e-07
-2.64181973588e-06
9.5263078188e-07
1.27979480884e-06
5.21149425643e-07
5.6475986666e-07
3.98959428551e-07
3.64401119858e-08
2.29492623658e-06
4.73686892852e-08
2.36387550997e-06
4.25517601039e-08
2.36813235532e-06
3.62459884379e-08
2.36469880752e-06
1.03830139619e-08
2.34584741857e-06
-1.19078127776e-08
2.27457486546e-06
-4.83553487233e-09
2.19472440313e-06
3.90991431976e-08
2.21943667622e-06
7.58053200211e-08
2.27837719038e-06
1.02762258832e-07
2.32043067347e-06
1.30410092119e-07
2.35029869451e-06
1.68556925187e-07
2.39159440288e-06
1.77454678132e-07
2.42293605075e-06
1.97111816937e-07
2.43313368402e-06
1.84672221708e-07
2.44576923639e-06
1.58539583256e-07
2.42030703899e-06
1.35403629554e-07
2.37230116352e-06
1.49026676108e-07
2.34774037486e-06
1.54279975291e-07
2.36585125636e-06
1.52795291947e-07
2.38073456544e-06
1.71587459691e-07
2.39831016723e-06
2.01677183068e-07
2.43689040792e-06
2.08626296588e-07
2.47932274182e-06
2.09813835374e-07
2.50307156865e-06
2.29143603935e-07
2.51662744539e-06
2.4860514354e-07
2.54774503088e-06
2.52940117917e-07
2.60418208717e-06
2.67868523867e-07
2.63796062851e-06
2.73055457194e-07
2.68817635135e-06
2.94610789319e-07
2.74079114754e-06
3.12216735897e-07
2.80280997814e-06
3.27784705034e-07
2.87902571038e-06
3.33599228273e-07
2.96859788041e-06
3.52687663505e-07
3.0765591744e-06
4.16336119128e-07
3.15690584761e-06
4.80896260579e-07
3.22006764143e-06
5.59862238082e-07
3.27525454992e-06
5.97218975932e-07
3.24948087265e-06
9.9925608276e-08
3.45478803452e-06
8.81843593843e-07
3.04290690423e-05
2.21393701834e-05
-0.000248996984706
4.21614934848e-05
-0.000353837704205
5.90313489788e-05
-0.000403303978393
7.31537666637e-05
-0.000426203855186
8.53019256357e-05
-0.000436613071888
9.61930294492e-05
-0.000441132478514
0.000106332087447
-0.000442962983778
0.000116024788361
-0.000443548746623
0.000125441554184
-0.000443522559882
0.000134671013139
-0.000443138717412
0.000143755708853
-0.000442487405037
0.000152712623729
-0.000441589347133
0.000161543926567
-0.000440435906465
0.000170242117587
-0.000439005260906
0.000178791752529
-0.00043726653116
0.000187169619594
-0.000435180822807
0.000195342883774
-0.000432696349315
0.000203266453444
-0.000429744600955
0.000210876744818
-0.000426226406176
0.000218079466607
-0.000421987005608
0.000224700655895
-0.000416693074286
0.000230424332222
-0.000409734432216
0.000234777064512
-0.000400300585861
0.000237186160307
-0.000387615220604
0.000237080280287
-0.000371175134167
0.000233982517615
-0.000350872250012
0.000227565588302
-0.000326981005246
0.000217665976881
-0.000300062790873
0.00020426830112
-0.000270843522906
0.000187472781708
-0.000240105080996
0.000167442217528
-0.000208586095239
0.000144346387115
-0.000176939961071
0.000118157744096
-0.000145621507238
8.71140211474e-05
-0.000113519476985
4.497065934e-05
-7.63162130695e-05
2.75510602128e-06
-8.25919161574e-06
3.77918644412e-07
-2.64662434641e-07
7.78787032739e-07
8.78897040467e-07
4.40777731728e-07
9.02813804058e-07
8.39715377474e-07
4.01433780931e-08
2.25478026355e-06
5.392277367e-08
2.35014930337e-06
5.90669042214e-08
2.36305253888e-06
6.08992473908e-08
2.36293109801e-06
5.54938625651e-08
2.35131496726e-06
2.62192612812e-08
2.30390897734e-06
-4.20254549561e-09
2.22520369523e-06
3.15469718273e-08
2.18374800259e-06
7.64765375613e-08
2.23351352055e-06
1.14388696852e-07
2.28258699861e-06
1.45100891382e-07
2.3196562584e-06
1.8714185567e-07
2.3496232847e-06
2.16644851836e-07
2.39350295739e-06
2.32085123539e-07
2.41776129652e-06
2.55200546552e-07
2.42271904892e-06
2.49924335169e-07
2.42564631751e-06
2.28629031533e-07
2.39365661715e-06
2.11622146941e-07
2.36480424535e-06
2.29387995276e-07
2.34814277757e-06
2.39636952171e-07
2.37054129072e-06
2.58747177784e-07
2.3792562206e-06
2.69719949732e-07
2.42597314144e-06
3.08365328704e-07
2.44073347233e-06
3.27725155226e-07
2.48376733436e-06
3.43144854077e-07
2.50126192851e-06
3.64249560856e-07
2.52669630563e-06
3.86171049291e-07
2.58231682151e-06
4.0776475829e-07
2.61642259648e-06
4.37713200273e-07
2.65828240498e-06
4.65342283338e-07
2.71321720248e-06
4.68705570637e-07
2.79950077492e-06
4.86483970145e-07
2.86130266263e-06
5.03852956973e-07
2.95129591426e-06
5.35128837334e-07
3.0453138152e-06
5.65636180172e-07
3.12646106791e-06
5.72661593095e-07
3.2130356634e-06
5.25958544808e-07
3.32199735396e-06
3.30048854632e-07
3.44545517613e-06
-4.64733350668e-07
4.24962220667e-06
8.41382609626e-06
2.15506950083e-05
2.49552254791e-05
-0.000265538214649
4.28572014354e-05
-0.000371739557076
5.81899223219e-05
-0.00041863660412
7.12094047713e-05
-0.000439223260933
8.26194823467e-05
-0.00044802308815
9.30346030223e-05
-0.000451547549512
0.000102864290581
-0.000452792631373
0.0001123444642
-0.000453028887275
0.000121599541672
-0.000452777609415
0.000130690019628
-0.000452229170661
0.00013964213383
-0.000451439496283
0.000148463620686
-0.000450410811955
0.000157151316721
-0.000449123580425
0.000165694391732
-0.000447548313596
0.000174074891741
-0.000445647007912
0.000182267270487
-0.000443373177495
0.00019023580911
-0.000440664862527
0.000197931533081
-0.000437440298496
0.000205284541399
-0.000433579386547
0.00021218886903
-0.00042889130399
0.000218436389268
-0.000422940563747
0.000223643670837
-0.000414941682095
0.000227252279759
-0.000403909164163
0.000228619826425
-0.000388982742659
0.000227146189423
-0.00036970148561
0.000222372977693
-0.000346099041367
0.000214029582712
-0.000318637653625
0.00020203272213
-0.00028806597243
0.000186458233954
-0.000255269108878
0.000167502572772
-0.000221149596761
0.000145442599285
-0.00018652630156
0.00012066068782
-0.000152158368871
9.34367716906e-05
-0.000118397900003
6.2455724955e-05
-8.25388248593e-05
1.50806054269e-05
-2.89413696649e-05
3.9327220411e-06
2.88863807628e-06
1.82923672423e-06
1.83878375372e-06
1.0964374311e-06
1.61167679737e-06
5.17022986908e-07
1.48215651396e-06
1.35668207077e-06
2.88023043988e-08
2.22611815987e-06
5.38910986551e-08
2.32515013094e-06
7.01211789315e-08
2.34689885694e-06
8.20117555166e-08
2.35111103941e-06
8.68163990934e-08
2.34657666807e-06
7.18459387456e-08
2.31894121568e-06
2.90529704207e-08
2.26805712571e-06
3.14882971941e-08
2.18137337207e-06
7.85701765285e-08
2.18649507379e-06
1.2472318459e-07
2.23650256005e-06
1.64935585364e-07
2.27951480062e-06
2.00626165276e-07
2.31400488144e-06
2.48054128802e-07
2.34614707543e-06
2.75437652922e-07
2.39044839676e-06
3.14905708377e-07
2.38331967032e-06
3.30192389102e-07
2.41042472277e-06
3.1819435811e-07
2.40571809562e-06
3.12296029997e-07
2.37076349004e-06
3.07250810243e-07
2.3532457212e-06
3.14427880976e-07
2.36342251529e-06
3.47507688519e-07
2.34623449589e-06
3.75498518804e-07
2.39804110853e-06
3.99044272949e-07
2.41724529489e-06
4.37307805882e-07
2.44556016589e-06
4.62672586891e-07
2.47595414122e-06
4.83118733868e-07
2.50630620165e-06
5.22820208578e-07
2.54267166324e-06
5.59083672157e-07
2.58021392131e-06
5.93018934593e-07
2.62440217295e-06
5.98033672585e-07
2.70825841015e-06
6.24689200464e-07
2.77290308763e-06
6.46881039345e-07
2.83917279478e-06
6.72933361743e-07
2.92529402219e-06
7.03867288519e-07
3.0144490909e-06
7.26490158449e-07
3.10383465771e-06
7.26362221106e-07
3.21320343966e-06
6.76924464306e-07
3.37149089119e-06
6.22686266302e-07
3.49974014092e-06
3.49220876653e-07
4.52329918791e-06
5.99793051206e-06
1.59023054361e-05
2.55728194908e-05
-0.000285112924874
4.25836965623e-05
-0.000388750325841
5.68410589084e-05
-0.000432893878119
6.90154686642e-05
-0.000451397594544
7.98320722034e-05
-0.000458839625706
8.98499458527e-05
-0.000461565367225
9.9409500543e-05
-0.000462352138853
0.000108692610905
-0.000462311958008
0.000117787999109
-0.00046187296379
0.000126734666392
-0.000461175808339
0.000135546544679
-0.000460251347823
0.000144224397939
-0.000459088640006
0.00015276095493
-0.000457660113038
0.000161142673728
-0.000455930007873
0.000169349370943
-0.000453853680271
0.000177353269683
-0.000451377050288
0.000185115703978
-0.000448427269987
0.000192583642501
-0.000444908208632
0.000199680295446
-0.000440676010042
0.00020628644925
-0.000435497426375
0.000212151683183
-0.000428805765411
0.00021681191527
-0.000419601879988
0.00021961535462
-0.000406712570977
0.000219853894465
-0.000389221251164
0.0002169136713
-0.000366761238325
0.000210374453333
-0.000339559810722
0.000200040375636
-0.000308303561809
0.000185920804893
-0.000273946411846
0.000168185496293
-0.000237533804198
0.000147109009003
-0.000200073142134
0.000123032513304
-0.000162450021527
9.64757787746e-05
-0.000125601836534
6.77541871605e-05
-8.96764002277e-05
2.85836875787e-05
-4.33682222833e-05
1.00753731686e-06
-1.36521785342e-06
1.70065711736e-06
2.19549139654e-06
1.45735568054e-06
2.08202862286e-06
1.00063190645e-06
2.0683088792e-06
4.89911821912e-07
1.99274092517e-06
1.84653347905e-06
1.3431276152e-08
2.2126877124e-06
5.02875084701e-08
2.28835234049e-06
7.59828881125e-08
2.32127484418e-06
9.74128942405e-08
2.32975343784e-06
1.11391112359e-07
2.3326683356e-06
1.09257766325e-07
2.32114160231e-06
8.80330371422e-08
2.28934489545e-06
5.38578062545e-08
2.21560954768e-06
7.9391642162e-08
2.161025034e-06
1.31226880027e-07
2.18473505522e-06
1.81774239011e-07
2.22903915294e-06
2.26678706619e-07
2.26917407611e-06
2.70377391709e-07
2.30252214567e-06
3.23488538313e-07
2.33740981824e-06
3.48318763046e-07
2.35855889141e-06
3.91689995045e-07
2.3671225229e-06
4.011814237e-07
2.39629244764e-06
4.11513173286e-07
2.36049429626e-06
4.1142279419e-07
2.35339881343e-06
4.14960041896e-07
2.35994685542e-06
4.27907542244e-07
2.33334672281e-06
4.8155405938e-07
2.34445484935e-06
5.13441161369e-07
2.38541750182e-06
5.47955640151e-07
2.41110405476e-06
5.79153244358e-07
2.44481380522e-06
6.20332183085e-07
2.46518441287e-06
6.62487219123e-07
2.50057179263e-06
7.07261701103e-07
2.53549445913e-06
7.2377944397e-07
2.60794049159e-06
7.54635819494e-07
2.67745989647e-06
7.93101290475e-07
2.73449429067e-06
8.22801876087e-07
2.80952497908e-06
8.49917897844e-07
2.89823669768e-06
8.70155924104e-07
2.99424380257e-06
8.65721767113e-07
3.10831270218e-06
7.94127276454e-07
3.28481733578e-06
6.59296206112e-07
3.50636493352e-06
3.01385152511e-07
3.85781702994e-06
-5.39410393408e-07
5.36421511405e-06
6.75852137215e-06
8.60457109263e-06
2.49164768325e-05
-0.00030327075709
4.13287684181e-05
-0.000405162528186
5.49145862868e-05
-0.000446479619951
6.652004361e-05
-0.000463002982903
7.69129090563e-05
-0.000469232428913
8.66285280937e-05
-0.000471280931084
9.59656942214e-05
-0.000471689257051
0.000105071686657
-0.000471417909013
0.000114012039459
-0.000470813280611
0.000122811894526
-0.000469975631613
0.000131477301716
-0.000468916726066
0.000140004493747
-0.000467615804982
0.000148383389222
-0.000466038982214
0.000156598382784
-0.000464144975422
0.000164627357071
-0.000461882627926
0.000172440401471
-0.000459190067412
0.000179995813491
-0.000455982653323
0.000187236286537
-0.000452148651983
0.000194077457471
-0.000447517149433
0.000200384996461
-0.000441804932961
0.00020585602637
-0.000434276760644
0.000209931058215
-0.000423676876554
0.000211858268587
-0.000408639742917
0.000210871858362
-0.000388234801591
0.000206362831565
-0.000362252167038
0.000197970185864
-0.000331167110065
0.000185590410128
-0.000295923727474
0.000169338749027
-0.000257694644276
0.000149490944486
-0.000217685919959
0.000126414174004
-0.000176996370809
0.000100465292256
-0.00013650113042
7.16479181197e-05
-9.67843138757e-05
3.78960555212e-05
-5.59241313551e-05
5.71234423098e-06
-1.1184248346e-05
1.83851598858e-06
2.50863084973e-06
1.65171906342e-06
2.38225633793e-06
1.36774392467e-06
2.36593501236e-06
9.55902453317e-07
2.48003167468e-06
4.45972188308e-07
2.50255231623e-06
2.29237373167e-06
1.45396507432e-08
2.1982895731e-06
4.99934169019e-08
2.25299025124e-06
8.28210978011e-08
2.28852715847e-06
1.08254960775e-07
2.30439633812e-06
1.29314417207e-07
2.3116829464e-06
1.36553992835e-07
2.31397163778e-06
1.34483894525e-07
2.29148168084e-06
1.10078022429e-07
2.24008013756e-06
9.22751610617e-08
2.17889191058e-06
1.33112076934e-07
2.14396490867e-06
1.94024132102e-07
2.16819752061e-06
2.51299844403e-07
2.21197174207e-06
3.03527894089e-07
2.25036812885e-06
3.60201079356e-07
2.28081055888e-06
4.00686397007e-07
2.31814669016e-06
4.30225496629e-07
2.33765413148e-06
4.79758484086e-07
2.34682829808e-06
4.91528256507e-07
2.34879149886e-06
5.07090927816e-07
2.33790099948e-06
5.22818926524e-07
2.34428267483e-06
5.39299691235e-07
2.31692930225e-06
5.80627869474e-07
2.30318760078e-06
6.28296091175e-07
2.33780957044e-06
6.65869383759e-07
2.37358986375e-06
7.02411591632e-07
2.40832991482e-06
7.48414315316e-07
2.4192380657e-06
8.04993540884e-07
2.44404772356e-06
8.37579557186e-07
2.5029629435e-06
8.75660712692e-07
2.56991413706e-06
9.24473372301e-07
2.62869953969e-06
9.64414812481e-07
2.69460134395e-06
9.94611758389e-07
2.77937309181e-06
1.0189359201e-06
2.87395107835e-06
1.02914150624e-06
2.98407806012e-06
1.00819008186e-06
3.12928361486e-06
9.19565298564e-07
3.37347959665e-06
7.8682866856e-07
3.63920402821e-06
6.0346265847e-07
4.0412584871e-06
6.18875776486e-07
5.34895378866e-06
4.29834349087e-06
4.92515408123e-06
2.30257663263e-05
-0.00032199805581
3.9305365936e-05
-0.000421442064341
5.25576154244e-05
-0.000459731818345
6.38099782636e-05
-0.000474255296825
7.39095436912e-05
-0.000479331946905
8.33963258413e-05
-0.000480767668052
9.25478713517e-05
-0.000480840760723
0.000101491541512
-0.000480361540908
0.000110279492446
-0.00047960119674
0.000118929120107
-0.000478625227307
0.000127442175104
-0.000477429751354
0.00013581235931
-0.000475985960837
0.000144027857895
-0.000474254453292
0.00015207154079
-0.000472188630774
0.000159919597903
-0.00046973065721
0.000167540043276
-0.000466810483935
0.000174888005112
-0.000463330585376
0.000181901636359
-0.000459162251974
0.000188488194258
-0.000454103675125
0.000194496060145
-0.000447812765152
0.000199557302456
-0.000439337968603
0.000203000983055
-0.000427120520944
0.000203971175588
-0.000409609897326
0.000201657067932
-0.000385920649663
0.000195476500424
-0.00035607154406
0.000185149230148
-0.000320839773842
0.000170678643783
-0.000281453037769
0.000152291246991
-0.000239307158756
0.000130371236097
-0.000195765806518
0.000105415164345
-0.000152040228588
7.80516358667e-05
-0.000109137493283
4.9353894728e-05
-6.8086078381e-05
1.42781298615e-05
-2.0847913925e-05
1.09944641641e-06
1.99450086308e-06
1.16507960724e-06
2.44300718197e-06
1.12587248238e-06
2.42143384158e-06
9.84568563024e-07
2.50718623135e-06
7.46840270076e-07
2.71767673592e-06
3.66054739592e-07
2.88308283196e-06
2.65840540877e-06
2.99591476899e-08
2.1683392354e-06
5.64078496658e-08
2.22660328068e-06
9.11472408001e-08
2.25386226141e-06
1.18560546002e-07
2.27706008254e-06
1.42980707528e-07
2.28733898475e-06
1.62631937354e-07
2.29439484405e-06
1.63928193691e-07
2.29025624273e-06
1.57035387648e-07
2.24704020692e-06
1.39630628629e-07
2.19636301021e-06
1.41005373155e-07
2.14265650652e-06
1.99332782199e-07
2.10993907077e-06
2.67828745957e-07
2.14354883269e-06
3.3175746162e-07
2.1865146715e-06
3.90297973019e-07
2.2223455908e-06
4.52109668655e-07
2.25641072143e-06
4.97569729728e-07
2.29226843739e-06
5.39661994879e-07
2.30480809709e-06
5.77380082581e-07
2.31114300824e-06
6.00251536653e-07
2.31509824374e-06
6.29973066182e-07
2.31462855444e-06
6.55434704872e-07
2.29153141905e-06
6.92797534632e-07
2.26588741635e-06
7.41608493848e-07
2.28906003859e-06
7.85957635164e-07
2.32930134297e-06
8.34731513957e-07
2.35961495659e-06
8.80646444461e-07
2.37337960365e-06
9.28460199073e-07
2.39628796243e-06
9.77965403808e-07
2.45351051467e-06
1.0350477347e-06
2.51288174654e-06
1.08499227889e-06
2.57880061622e-06
1.13097408676e-06
2.64865844709e-06
1.17461182942e-06
2.73576837351e-06
1.20797171989e-06
2.84062122796e-06
1.2281511004e-06
2.96392917527e-06
1.21484816843e-06
3.1426217926e-06
1.20037549001e-06
3.38800158384e-06
1.1686839337e-06
3.67094958703e-06
1.2789073578e-06
3.93117831905e-06
1.35859312467e-06
5.26930272252e-06
2.5771846883e-06
3.70664791468e-06
2.11092598419e-05
-0.00034053009165
3.71529455305e-05
-0.000437485718219
5.00923632145e-05
-0.000472671205342
6.10496592649e-05
-0.000485212559794
7.0907649838e-05
-0.000489189901773
8.01986256755e-05
-0.000490058607146
8.91807038185e-05
-0.000489822802402
9.7966626921e-05
-0.000489147428862
0.000106600058047
-0.000488234594415
0.000115094131012
-0.00048711926862
0.000123448479111
-0.000485784069221
0.000131655537284
-0.0004841929899
0.000139702456718
-0.000482301344045
0.000147570921911
-0.000480057067409
0.000155235572755
-0.000477395278905
0.000162662335224
-0.000474237216571
0.000169802984944
-0.00047047120404
0.000176590811463
-0.000465950046491
0.000182923768255
-0.000460436598753
0.000188630445552
-0.000453519408628
0.000193262361915
-0.000443969850131
0.000196020171109
-0.000429878293835
0.000195943324264
-0.000409533009574
0.000192193638293
-0.000382170915638
0.000184240954504
-0.000348118799469
0.000171908577315
-0.00030850731423
0.00015532120746
-0.000264865585517
0.000134817761664
-0.000218803605845
0.000110862803727
-0.000171810794201
8.39435175186e-05
-0.000125120847788
5.42718016632e-05
-7.94653764194e-05
2.12776644678e-05
-3.5091414177e-05
6.14447667231e-07
-1.84600317138e-07
5.67304912094e-07
2.04167166023e-06
7.12807512506e-07
2.29749987282e-06
6.87345240226e-07
2.44687011759e-06
5.83761987834e-07
2.61072203177e-06
4.52582431522e-07
2.84873856736e-06
2.87473131369e-07
3.04818796444e-06
2.94575603846e-06
4.3051433492e-08
2.12542643325e-06
6.69311771284e-08
2.20281733928e-06
9.64980523978e-08
2.22437807433e-06
1.25587505481e-07
2.24805128787e-06
1.51559329726e-07
2.26144743272e-06
1.77212774367e-07
2.26882017e-06
1.95958710582e-07
2.27158597177e-06
1.90938379468e-07
2.2521334062e-06
1.97412962985e-07
2.18995860579e-06
1.86844839013e-07
2.15329411122e-06
2.07244205147e-07
2.08961090805e-06
2.73990125486e-07
2.07687495977e-06
3.48724381836e-07
2.11185551277e-06
4.2042421625e-07
2.15072158667e-06
4.8726326294e-07
2.189647547e-06
5.57765057802e-07
2.22184293303e-06
6.0844969372e-07
2.25419767091e-06
6.52119565927e-07
2.2675464559e-06
6.92515279975e-07
2.27477359293e-06
7.34872960932e-07
2.27233908181e-06
7.72396492771e-07
2.25407440207e-06
8.07334802183e-07
2.23101290335e-06
8.54951264102e-07
2.24150621779e-06
9.11218756264e-07
2.2730948903e-06
9.62837977636e-07
2.30805493991e-06
1.01494530493e-06
2.32132846229e-06
1.06373955248e-06
2.34754707052e-06
1.12559659839e-06
2.39170300089e-06
1.18521627632e-06
2.45330712669e-06
1.24375438863e-06
2.52030053802e-06
1.29938779313e-06
2.59305558223e-06
1.34551678857e-06
2.68966249503e-06
1.38304693425e-06
2.8031152628e-06
1.4153558025e-06
2.9316448004e-06
1.44423937362e-06
3.11377336904e-06
1.49618696559e-06
3.33609865566e-06
1.55777094797e-06
3.60946156802e-06
1.6899836918e-06
3.79900802235e-06
1.78626289157e-06
5.17314315075e-06
2.31144044995e-06
3.1814655567e-06
1.97934365332e-05
-0.000358012033966
3.5238226307e-05
-0.000452930485984
4.77367794815e-05
-0.000485169737575
5.83658509709e-05
-0.000495841606658
6.79801217575e-05
-0.000498804144177
7.70770359904e-05
-0.000499155490481
8.58880935121e-05
-0.000498633827867
9.4511241507e-05
-0.000497770544621
0.000102983150449
-0.000496706471625
0.000111314121731
-0.00049545020889
0.000119502650784
-0.000493972568101
0.000127540491704
-0.000492230801178
0.000135414087752
-0.000490174910815
0.000143104068952
-0.000487747019143
0.000150583556826
-0.000484874736953
0.000157816295225
-0.000481469924284
0.000164750471158
-0.000477405348486
0.000171314130643
-0.000472513673582
0.000177394886826
-0.000466517321875
0.00018279870636
-0.000458923194759
0.000186977633751
-0.000448148743644
0.00018898661662
-0.000431887240601
0.000187764381709
-0.000408310736187
0.000182467640565
-0.000376874124219
0.000172644800551
-0.000338295896662
0.000158244845471
-0.000294107285029
0.00013953140812
-0.000246152065582
0.00011697801651
-0.000196250169632
9.11665509384e-05
-0.000145999261181
6.25863120019e-05
-9.65405016283e-05
3.09551557667e-05
-4.78337474363e-05
4.01039208262e-06
-8.14611604738e-06
9.93531668174e-07
2.83226671108e-06
6.5830395247e-07
2.3768904683e-06
4.94453531545e-07
2.46132549033e-06
3.68341755113e-07
2.57294980172e-06
2.59242588974e-07
2.71980855837e-06
1.95774073723e-07
2.91222473956e-06
1.58221682518e-07
3.08553962717e-06
3.10403564e-06
4.39636117884e-08
2.08147811848e-06
7.03735517272e-08
2.17647107293e-06
9.31428740603e-08
2.20168497188e-06
1.24178883781e-07
2.21709609407e-06
1.55184544436e-07
2.23052475325e-06
1.86696284572e-07
2.23739140174e-06
2.18536986423e-07
2.23982702721e-06
2.35652911167e-07
2.23509649865e-06
2.40378764727e-07
2.18530804727e-06
2.59312997477e-07
2.13443509576e-06
2.5660126771e-07
2.09239444053e-06
2.91812004109e-07
2.04173750166e-06
3.56521582959e-07
2.04721768033e-06
4.39499931545e-07
2.06781740999e-06
5.2025960923e-07
2.10896393989e-06
5.95886610474e-07
2.14629236064e-06
6.7310236108e-07
2.17705909776e-06
7.29673730299e-07
2.21104987244e-06
7.82714398948e-07
2.22180607461e-06
8.33023041926e-07
2.22210080059e-06
8.78774617501e-07
2.20838977567e-06
9.22650979008e-07
2.18720144198e-06
9.73792133446e-07
2.19042822366e-06
1.03378153815e-06
2.21316714387e-06
1.09437005294e-06
2.24752534342e-06
1.14921108476e-06
2.26654269525e-06
1.20578773369e-06
2.29102121241e-06
1.26972098827e-06
2.32781620205e-06
1.33396434641e-06
2.38910395877e-06
1.39781277714e-06
2.45648479396e-06
1.46030106213e-06
2.53059190108e-06
1.52382492592e-06
2.62616016339e-06
1.57644573129e-06
2.75051259613e-06
1.63034517764e-06
2.87777294242e-06
1.68951135035e-06
3.05464206988e-06
1.75083221737e-06
3.27483674868e-06
1.8408474673e-06
3.51949483624e-06
1.9099891036e-06
3.72997721025e-06
2.08322480554e-06
4.99989706354e-06
2.26664847533e-06
2.99809521753e-06
1.8861844295e-05
-0.000374607228747
3.35821632763e-05
-0.000467650789537
4.55590298537e-05
-0.000497146585762
5.58201852102e-05
-0.000506102739501
6.51707180633e-05
-0.000508154650772
7.40597260253e-05
-0.000508044469045
8.26874794306e-05
-0.000507261549968
9.11362856882e-05
-0.000506219318718
9.94360736836e-05
-0.000505006227386
0.000107594673553
-0.000503608776986
0.000115609681933
-0.000501987545271
0.0001234722936
-0.000500093382237
0.000131168293958
-0.000497870880826
0.000138677220935
-0.000495255915855
0.000145970619415
-0.000492168104797
0.000153009876579
-0.000488509150354
0.000159739317104
-0.000484134757279
0.000166081303258
-0.000478855627496
0.000171911981134
-0.000472347967381
0.000177011533468
-0.000464022714671
0.000180709608406
-0.000451846785505
0.000181898694906
-0.000433076294011
0.000179426315878
-0.00040583831515
0.000172470975349
-0.000369918737942
0.000160685682861
-0.000326510538701
0.000144159030169
-0.000277580568357
0.000123290386513
-0.000225283380097
9.86873609753e-05
-0.000171647134269
7.11651045329e-05
-0.000118477012583
4.18775924061e-05
-6.72528331703e-05
1.0697010745e-05
-1.66529293101e-05
1.00227853901e-07
2.4506606887e-06
3.86777149387e-07
2.54570015318e-06
3.09367583172e-07
2.45427450546e-06
1.98003706818e-07
2.57266338233e-06
6.49092652477e-08
2.70603693839e-06
-1.59384524919e-08
2.80065053736e-06
-7.22299645974e-09
2.90345777998e-06
-2.10842355422e-08
3.09954263682e-06
3.08289326737e-06
4.22433772203e-08
2.0393694211e-06
5.9431668239e-08
2.15937902183e-06
8.44589932201e-08
2.17674529706e-06
1.19944683588e-07
2.18169772798e-06
1.59753084712e-07
2.19080502666e-06
2.00364583265e-07
2.19686931859e-06
2.41534465233e-07
2.19874570577e-06
2.79557256565e-07
2.19715961191e-06
2.88812178231e-07
2.17613603627e-06
3.17034322846e-07
2.10629003861e-06
3.4223543165e-07
2.06727018586e-06
3.6058180506e-07
2.02346309957e-06
3.78493215911e-07
2.02938138356e-06
4.56094713778e-07
1.99029039943e-06
5.43386117451e-07
2.02174990052e-06
6.35707428261e-07
2.0540499147e-06
7.20378570371e-07
2.09246503318e-06
8.03219698146e-07
2.12828582847e-06
8.68642249478e-07
2.15645769134e-06
9.27420414557e-07
2.16339432616e-06
9.81055410936e-07
2.15482343116e-06
1.02912535773e-06
2.13919799531e-06
1.09034214814e-06
2.12927545536e-06
1.15424947696e-06
2.14932111002e-06
1.21683151578e-06
2.18500186319e-06
1.28412459016e-06
2.19930407917e-06
1.34805430703e-06
2.22714161248e-06
1.41383402996e-06
2.26208030592e-06
1.4832469383e-06
2.31972873732e-06
1.55539373179e-06
2.38436922139e-06
1.62812613669e-06
2.45788522692e-06
1.69459390589e-06
2.55971318483e-06
1.76432717763e-06
2.68080288544e-06
1.84618138087e-06
2.79594382342e-06
1.92204039168e-06
2.97882623632e-06
1.98972206497e-06
3.20720918685e-06
2.06013158633e-06
3.44917317933e-06
2.10507455166e-06
3.68505638236e-06
2.13135068157e-06
4.97372305092e-06
2.22475176637e-06
2.90467527224e-06
1.81510742452e-05
-0.000390533487938
3.21501238329e-05
-0.000481649807981
4.35710083732e-05
-0.000508567441544
5.34356527926e-05
-0.000515967354523
6.24997409695e-05
-0.000517218707433
7.11611878024e-05
-0.000516705882817
7.95883224984e-05
-0.000515688650583
8.78478185448e-05
-0.000514478780459
9.5962937186e-05
-0.000513121312083
0.000103939007617
-0.000511584814146
0.000111772623166
-0.0005098211284
0.000119454299561
-0.000507775026913
0.000126969055497
-0.000505385605619
0.000134295195224
-0.000502582024636
0.000141402572051
-0.000499275450726
0.000148249976435
-0.000495356523613
0.000154777579629
-0.000490662329206
0.000160901558064
-0.000484979574611
0.000166485396719
-0.000477931774785
0.000171279995073
-0.000468817281738
0.000174464974718
-0.000455031734304
0.000174755223815
-0.000433366505941
0.000170923413299
-0.000402006471414
0.000162202590754
-0.000361197857895
0.000148380099013
-0.00031268799753
0.000129698505002
-0.00025889893169
0.000106658561513
-0.000202243430879
7.98627349969e-05
-0.00014485131706
5.00966119498e-05
-8.87109043466e-05
1.7263783335e-05
-3.44197807968e-05
-1.85025577266e-07
7.95897443708e-07
-3.91031618665e-08
2.30473322576e-06
1.01665356114e-07
2.40490874293e-06
5.05449943334e-08
2.50537023849e-06
-3.66799788985e-08
2.65986880006e-06
-1.40187831471e-07
2.80953238326e-06
-1.98286410217e-07
2.85878022492e-06
-1.075730074e-07
2.812838696e-06
-9.00423947826e-08
3.08191500956e-06
2.99294138083e-06
3.43901801322e-08
2.00500251201e-06
5.7134465199e-08
2.13671098479e-06
8.91081210667e-08
2.14486111109e-06
1.28244788038e-07
2.14265510909e-06
1.75446444207e-07
2.14369961194e-06
2.24977392148e-07
2.14743491006e-06
2.74515813569e-07
2.14930296955e-06
3.23375026167e-07
2.14839362865e-06
3.5611046932e-07
2.14348887793e-06
3.65646112441e-07
2.09683718733e-06
4.00349852922e-07
2.0326441036e-06
4.44038389913e-07
1.97985473968e-06
4.75684432625e-07
1.99781501712e-06
5.08939405109e-07
1.95711533309e-06
5.74585977907e-07
1.95618281387e-06
6.68712599307e-07
1.96000123933e-06
7.69444981508e-07
1.99181128812e-06
8.59033813789e-07
2.03877352622e-06
9.5189843574e-07
2.06366944665e-06
1.02229046884e-06
2.09307557811e-06
1.08421989229e-06
2.09296500084e-06
1.14486078033e-06
2.0786242102e-06
1.20896264739e-06
2.06523748549e-06
1.27685084491e-06
2.08149440815e-06
1.34701660603e-06
2.11489415852e-06
1.4136049748e-06
2.13276912091e-06
1.48376529696e-06
2.15702895451e-06
1.55580987433e-06
2.19007841995e-06
1.62988968503e-06
2.24568684571e-06
1.70510607382e-06
2.30918626379e-06
1.78549862117e-06
2.37752241294e-06
1.86986498234e-06
2.47537501662e-06
1.95766574799e-06
2.59302759414e-06
2.03805213066e-06
2.71559373317e-06
2.11669033645e-06
2.90023543211e-06
2.21801420867e-06
3.10595256259e-06
2.31764551943e-06
3.34959037995e-06
2.42096191632e-06
3.58184127031e-06
2.19807555618e-06
5.19657461303e-06
2.3328971572e-06
2.76992383909e-06
1.76327752203e-05
-0.000405833353497
3.09179979181e-05
-0.000494935003309
4.17650119001e-05
-0.000519414426689
5.12132765549e-05
-0.00052541558726
5.9970617681e-05
-0.000525976012886
6.8384396501e-05
-0.000525119623527
7.65924720601e-05
-0.000523896686891
8.46467854911e-05
-0.000522533054986
9.25642258468e-05
-0.000521038714579
0.000100347575218
-0.000519368127178
0.000107992246688
-0.000517465765032
0.000115487890026
-0.000515270636805
0.000122818594528
-0.000512716277721
0.000129961248263
-0.000509724646748
0.000136883880703
-0.000506198051999
0.000143542397058
-0.000502015009158
0.000149872535856
-0.000496992437534
0.000155783715636
-0.000490890724305
0.000161125528584
-0.000483273558102
0.000165615723051
-0.000473307447013
0.000168250684364
-0.000457666662967
0.00016755519584
-0.000432670989943
0.000162250533173
-0.000396701759681
0.000151661092687
-0.000350608379155
0.000135742124486
-0.000296768982354
0.000114925000624
-0.000238081792115
8.98405724719e-05
-0.000177159061366
6.09843308275e-05
-0.000115995128469
2.84938026225e-05
-5.622016675e-05
2.30909411074e-06
-8.23481552331e-06
2.59424469011e-07
2.84558220703e-06
6.08382504587e-08
2.50330986379e-06
-1.91750767098e-08
2.48490406382e-06
-9.4305040091e-08
2.58048086587e-06
-1.5226802596e-07
2.71782022456e-06
-1.83449940264e-07
2.84073000867e-06
-2.17481405131e-07
2.89282691696e-06
-1.38055335064e-07
2.73338869558e-06
-5.00694841125e-08
2.99409947065e-06
2.9428321543e-06
1.77560995549e-08
1.9873953632e-06
6.24670881786e-08
2.09210970774e-06
1.01083077432e-07
2.10634837168e-06
1.47254022293e-07
2.09658637218e-06
2.02407659078e-07
2.08864785419e-06
2.59827613516e-07
2.09011701547e-06
3.16344388854e-07
2.09288697604e-06
3.71637673612e-07
2.09319871392e-06
4.24780935378e-07
2.09044005136e-06
4.43260023239e-07
2.0784478812e-06
4.48258426464e-07
2.02773130345e-06
4.76672533304e-07
1.9515221406e-06
5.6220721828e-07
1.91236303416e-06
6.101191283e-07
1.90928504631e-06
6.59124491634e-07
1.90725779772e-06
7.21955634914e-07
1.89724954454e-06
8.13176681081e-07
1.90066768838e-06
9.14377117212e-07
1.93765170318e-06
1.01719965444e-06
1.96092258138e-06
1.10830882317e-06
2.00204140059e-06
1.18347992153e-06
2.01786479394e-06
1.25026742132e-06
2.01190440622e-06
1.32002412245e-06
1.99554451805e-06
1.39166332043e-06
2.00991564568e-06
1.46496311138e-06
2.0416516853e-06
1.54305653363e-06
2.05472848752e-06
1.61968413759e-06
2.08044954329e-06
1.69578314855e-06
2.11402352832e-06
1.77759134721e-06
2.16392148009e-06
1.86597395086e-06
2.22084441242e-06
1.95940229643e-06
2.28413145104e-06
2.04520727958e-06
2.38960285455e-06
2.14969296821e-06
2.48857414367e-06
2.2436384227e-06
2.62168045682e-06
2.35210712262e-06
2.79181171692e-06
2.47527274324e-06
2.98284272543e-06
2.62070012075e-06
3.20423438214e-06
2.74221993795e-06
3.46030013679e-06
2.42081208433e-06
5.51811076457e-06
2.55123542511e-06
2.63946278947e-06
1.72632429706e-05
-0.000420545311681
2.98472577804e-05
-0.000507519002361
4.01173603553e-05
-0.000529684511605
4.91392795516e-05
-0.000534437479287
5.75748821235e-05
-0.000534411580593
6.57235134965e-05
-0.000533268214251
7.36954078327e-05
-0.000531868538538
8.15294607153e-05
-0.000530367065098
8.92368513517e-05
-0.000528746064002
9.68179402939e-05
-0.000526949176942
0.000104266868978
-0.00052491465674
0.000111572283179
-0.00052257601601
0.00011871720069
-0.000519861161891
0.000125676924365
-0.000516684338414
0.000132417542439
-0.00051293863911
0.000138891758381
-0.000508489195138
0.000145030641484
-0.000503131291631
0.000150736197315
-0.000496596252126
0.000155842900327
-0.000488380233392
0.000160031083899
-0.000477495601886
0.000162074093042
-0.00045970964532
0.000160298241198
-0.00043089509664
0.000153404579779
-0.000389808065616
0.00014084795802
-0.000338051706919
0.000122771826919
-0.000278692830681
9.97813176054e-05
-0.000215091354407
7.26934064709e-05
-0.000150071187397
4.30494057566e-05
-8.63510592208e-05
1.00182147571e-05
-2.31884865469e-05
-2.83671659864e-07
2.06710364988e-06
-7.09664363341e-08
2.63288759868e-06
-8.81956793657e-08
2.52053661766e-06
-1.30106126303e-07
2.52680514889e-06
-1.69335422509e-07
2.61970345203e-06
-1.79783721979e-07
2.72827014102e-06
-1.57859003334e-07
2.81880685283e-06
-1.42898024958e-07
2.87789455169e-06
-1.28541748748e-07
2.71912839226e-06
5.19599264504e-09
2.86027863148e-06
2.94811089961e-06
-2.75866246328e-09
1.99017896652e-06
4.98860038646e-08
2.03954816012e-06
9.91073448107e-08
2.05722591322e-06
1.62175993352e-07
2.0336222769e-06
2.29379104241e-07
2.02155075091e-06
2.95424975454e-07
2.02417704731e-06
3.5845941444e-07
2.02995793817e-06
4.18607579911e-07
2.03315389441e-06
4.76773554943e-07
2.03237452645e-06
5.26675944706e-07
2.02864222872e-06
5.43175902452e-07
2.01132319918e-06
5.39051023853e-07
1.95573318775e-06
5.79670752046e-07
1.8718236564e-06
6.68148780404e-07
1.82088691128e-06
7.51639357743e-07
1.82384751313e-06
8.1335639076e-07
1.83561266184e-06
8.80400244075e-07
1.83370440146e-06
9.68043391993e-07
1.85008579696e-06
1.06737303229e-06
1.86166920841e-06
1.17319568569e-06
1.8962920103e-06
1.2755876384e-06
1.9155438875e-06
1.3524913821e-06
1.9350671599e-06
1.42661157132e-06
1.92148706935e-06
1.50696969049e-06
1.92961775479e-06
1.59018543299e-06
1.95849305451e-06
1.66856459029e-06
1.97640179833e-06
1.75240211778e-06
1.99666119128e-06
1.83733539229e-06
2.02913910344e-06
1.92417437478e-06
2.07713033184e-06
2.02024918522e-06
2.12481584798e-06
2.11907132876e-06
2.18535159487e-06
2.21824742509e-06
2.29046414157e-06
2.31868476798e-06
2.38816727313e-06
2.43483047165e-06
2.50557397809e-06
2.56357646815e-06
2.66311226566e-06
2.69486611336e-06
2.85159889729e-06
2.84517126723e-06
3.05393897658e-06
2.97700643884e-06
3.32857057246e-06
2.63984133132e-06
5.85510540073e-06
2.7820793696e-06
2.49727689865e-06
1.69792830561e-05
-0.00043474258129
2.88897776771e-05
-0.000519429515236
3.85955657616e-05
-0.00053939029084
4.71916629065e-05
-0.000543033548559
5.52968996232e-05
-0.000542516774793
6.31668295901e-05
-0.000541138095024
7.0887897657e-05
-0.000539589555385
7.84882822519e-05
-0.000537967400078
8.59745025858e-05
-0.000536232237736
9.33448606717e-05
-0.000534319491968
0.000100592290912
-0.000532162047315
0.000107704404671
-0.000529688093044
0.000114663069689
-0.000526819792695
0.000121441886244
-0.000523463122752
0.000128004922171
-0.000519501644645
0.000134301354383
-0.000514785598546
0.000140257420313
-0.000509087330415
0.000145766953203
-0.000502105758723
0.00015064815102
-0.000493261405553
0.000154539224568
-0.000481386650105
0.000155942845994
-0.000461113233492
0.000152984037323
-0.000427936260429
0.000144383855219
-0.0003812078343
0.000129775164818
-0.000323442990839
0.000109523626072
-0.000258441322695
8.43591103186e-05
-0.000189926845439
5.46574385562e-05
-0.000120369548273
2.0311505152e-05
-5.2004610617e-05
1.25524668046e-07
-3.00187431587e-06
-2.7786009096e-07
2.47052927232e-06
-1.59788111344e-07
2.51483628408e-06
-1.6822610937e-07
2.52898067063e-06
-1.91703242253e-07
2.55028398889e-06
-2.02446003182e-07
2.63044878379e-06
-1.87682785643e-07
2.71351352727e-06
-1.5086945635e-07
2.78201721409e-06
-1.04491645821e-07
2.83153703467e-06
-1.00493351018e-07
2.71509753256e-06
-3.52549243488e-08
2.79520066795e-06
2.91282237717e-06
-1.39743289023e-08
2.00431004533e-06
2.93195842988e-08
1.99636823062e-06
9.26768293686e-08
1.99397884647e-06
1.7254058813e-07
1.95386631643e-06
2.47840364482e-07
1.94635873806e-06
3.20883944629e-07
1.95124156474e-06
3.91523658435e-07
1.959425942e-06
4.59052691293e-07
1.96573163861e-06
5.23416676217e-07
1.9681151029e-06
5.86213968831e-07
1.96594675682e-06
6.38484682234e-07
1.95915011949e-06
6.57639922956e-07
1.93667013902e-06
6.55277353272e-07
1.87427222463e-06
6.94517293033e-07
1.78172708258e-06
7.88127985786e-07
1.73031692486e-06
8.8628817177e-07
1.73753463483e-06
9.74513297874e-07
1.74555943873e-06
1.05614115387e-06
1.76853692442e-06
1.13770470375e-06
1.78018109803e-06
1.23399245448e-06
1.80007784806e-06
1.34294323868e-06
1.80666238051e-06
1.44437834723e-06
1.83369857599e-06
1.52719862867e-06
1.83872940737e-06
1.61166264872e-06
1.84521341315e-06
1.70128313311e-06
1.86892875016e-06
1.79256508745e-06
1.88517355674e-06
1.87870670132e-06
1.91057216348e-06
1.96477611175e-06
1.94312254678e-06
2.06050418318e-06
1.98145651982e-06
2.15671729687e-06
2.02865329144e-06
2.24534203352e-06
2.0967751543e-06
2.36372075691e-06
2.17212481439e-06
2.47811592178e-06
2.27381349161e-06
2.59737509261e-06
2.3863449009e-06
2.72172386949e-06
2.53878729979e-06
2.86502585223e-06
2.70832295795e-06
3.00354194517e-06
2.915469457e-06
3.1899443238e-06
3.14198177892e-06
2.95318914685e-06
6.09197855855e-06
3.00337896816e-06
2.4469701655e-06
1.67194757173e-05
-0.000448458736319
2.79968742233e-05
-0.000530706953783
3.71661071666e-05
-0.000548559528074
4.53464543929e-05
-0.000551213866711
5.31183605873e-05
-0.00055028863277
6.06997116635e-05
-0.000548719388643
6.81577750354e-05
-0.000547047560106
7.5512828182e-05
-0.000545322397309
8.27681121083e-05
-0.000543487470302
8.99204494425e-05
-0.000541471782841
9.69617821286e-05
-0.000539203338014
0.000103878770774
-0.000536605043651
0.000110652128928
-0.000533593116015
0.000117253711972
-0.000530064673823
0.000123645539147
-0.000525893442222
0.000129772950134
-0.000520912982423
0.00013555728966
-0.000514871644776
0.000140883320691
-0.000507431766437
0.00014555194389
-0.000497930005967
0.000149154022965
-0.00048498870373
0.000149864514606
-0.000461823702139
0.000145611766169
-0.000423683470959
0.00013518451497
-0.000370780557591
0.00011843457148
-0.000306693032439
9.59682166794e-05
-0.00023597497797
6.88838194905e-05
-0.000162842500749
3.87460812375e-05
-9.0231614709e-05
5.30469189436e-06
-1.8562990017e-05
-1.77301343171e-07
2.48019680647e-06
-2.35865626005e-07
2.52914430997e-06
-2.18222100966e-07
2.49721806513e-06
-2.18789941552e-07
2.52956237525e-06
-2.25627817976e-07
2.55713143944e-06
-2.18741956018e-07
2.62357377656e-06
-1.94139296788e-07
2.68892631451e-06
-1.54983383477e-07
2.74287250824e-06
-1.02703495623e-07
2.77928134821e-06
-8.67163469826e-08
2.69920110791e-06
-6.59119978438e-08
2.77432017178e-06
2.84698218934e-06
8.56181713813e-09
1.99579067531e-06
3.66483303572e-08
1.96837607998e-06
1.08717065988e-07
1.92201315158e-06
1.84931711598e-07
1.87775821548e-06
2.56896232725e-07
1.87450197167e-06
3.31554053023e-07
1.87669205591e-06
4.10673504723e-07
1.8804153763e-06
4.88729074319e-07
1.88778496964e-06
5.63619761658e-07
1.89333273077e-06
6.35706517643e-07
1.89396621319e-06
7.05670141988e-07
1.88928981714e-06
7.63408266444e-07
1.87903114628e-06
7.91205138157e-07
1.84656918161e-06
8.00724278331e-07
1.77229636537e-06
8.38562196915e-07
1.69256244347e-06
9.36563150554e-07
1.63961494868e-06
1.04117566371e-06
1.64102729464e-06
1.1424419926e-06
1.66734936825e-06
1.23934937503e-06
1.68335093444e-06
1.3321607429e-06
1.70734035481e-06
1.42476696626e-06
1.71412639332e-06
1.52800948396e-06
1.73052142851e-06
1.62470945519e-06
1.74209170696e-06
1.71602734526e-06
1.75395454592e-06
1.81158680493e-06
1.77342618367e-06
1.90435431865e-06
1.79246035737e-06
1.99600006612e-06
1.81898072104e-06
2.08455094401e-06
1.85462668915e-06
2.1763035235e-06
1.88975614548e-06
2.27736693947e-06
1.92764132392e-06
2.386232029e-06
1.9879563346e-06
2.50357011444e-06
2.05482914615e-06
2.64057334384e-06
2.1368420112e-06
2.77010247326e-06
2.25683484957e-06
2.89332924988e-06
2.41558598769e-06
3.02011080967e-06
2.58155262982e-06
3.14016164728e-06
2.79532898019e-06
3.27365198354e-06
3.00862129794e-06
3.1899630229e-06
6.17527178266e-06
3.11633765287e-06
2.52057192756e-06
1.64346111303e-05
-0.000461777162031
2.71320498801e-05
-0.000541404430217
3.58034584487e-05
-0.000557230917307
4.35845126291e-05
-0.000558994868282
5.10229755564e-05
-0.000557727027176
5.83074884105e-05
-0.000556003828636
6.54915624992e-05
-0.000554231564563
7.25906479958e-05
-0.00055242141937
7.96062218355e-05
-0.000550502988015
8.65342733935e-05
-0.000548399784914
9.33660234778e-05
-0.000546035044532
0.000100087333726
-0.000543326315104
0.000106677818226
-0.000540183565855
0.000113107635293
-0.000536494459593
0.000119336785226
-0.000532122564142
0.000125306510626
-0.000526882682599
0.000130933331809
-0.000520498443555
0.000136091886411
-0.000512590300174
0.000140564992374
-0.000502403091582
0.00014389018526
-0.00048831387717
0.000143846073155
-0.000461779561484
0.000138178979705
-0.000418016355853
0.000125806884236
-0.000358408430703
0.000106844899854
-0.000287731068576
8.20417590054e-05
-0.000211171822732
5.21682873914e-05
-0.000132968969761
1.79281595577e-05
-5.59913749694e-05
-7.89115766328e-07
1.54362057874e-07
-4.60352368122e-07
2.1514926931e-06
-2.99520189665e-07
2.36835277853e-06
-2.64947416141e-07
2.46267141606e-06
-2.47292016467e-07
2.51192489667e-06
-2.41655747399e-07
2.55150956101e-06
-2.25145226455e-07
2.60707729359e-06
-1.97053568298e-07
2.66084957126e-06
-1.57514956763e-07
2.70335699916e-06
-1.0130636159e-07
2.72308965979e-06
-9.01467031438e-08
2.68800565442e-06
-7.6956861061e-08
2.76126931584e-06
2.76999122605e-06
4.42354181825e-08
1.95172614667e-06
7.66601528097e-08
1.93607486022e-06
1.35313018732e-07
1.86347458786e-06
2.01981089411e-07
1.81119975227e-06
2.7107192567e-07
1.80552155036e-06
3.44261635208e-07
1.80361315512e-06
4.23612347113e-07
1.8011755956e-06
5.08460891751e-07
1.80304767004e-06
5.94913950493e-07
1.80699084851e-06
6.78162368982e-07
1.81082801029e-06
7.58399477037e-07
1.80916023577e-06
8.36097711917e-07
1.80143791863e-06
8.96701197003e-07
1.78606662026e-06
9.30957285322e-07
1.73813533473e-06
9.59806938202e-07
1.66380170647e-06
1.02200548062e-06
1.57749877418e-06
1.10314753381e-06
1.55996564862e-06
1.20935848398e-06
1.56121686487e-06
1.31662141183e-06
1.57616428155e-06
1.42042043157e-06
1.60361487149e-06
1.5170932395e-06
1.61752243079e-06
1.61593240928e-06
1.63174759664e-06
1.71746448264e-06
1.64062080358e-06
1.81287479888e-06
1.65860316292e-06
1.91012077364e-06
1.67623536092e-06
2.00439058199e-06
1.69824440355e-06
2.09229209899e-06
1.73113163295e-06
2.18942207809e-06
1.75754891754e-06
2.3008536634e-06
1.77837505516e-06
2.41013648041e-06
1.81841125734e-06
2.53035135974e-06
1.86779167133e-06
2.66280162701e-06
1.92243040994e-06
2.78980396096e-06
2.00987401436e-06
2.92103359829e-06
2.12564217085e-06
3.04337771549e-06
2.29326244922e-06
3.13793963595e-06
2.48700856826e-06
3.21298643492e-06
2.72041436756e-06
3.25992425683e-06
2.96135170263e-06
3.42629590236e-06
6.00881100225e-06
3.14273753771e-06
2.80396249418e-06
1.61167775016e-05
-0.000474751293707
2.62934220778e-05
-0.000551581064741
3.45054404297e-05
-0.000565442862554
4.19002767382e-05
-0.000566389606956
4.90008237327e-05
-0.000564827470244
5.59772954692e-05
-0.000562980203612
6.28751237706e-05
-0.000561129307009
6.97074245651e-05
-0.000559253647001
7.64749534045e-05
-0.000557270454674
8.317323672e-05
-0.000555098015562
8.97929320445e-05
-0.000552654694573
9.63192485513e-05
-0.000549852592407
0.00010273079772
-0.000546595080593
0.000108996197847
-0.000542759829543
0.000115073533859
-0.000538199873556
0.000120899803264
-0.000532708928976
0.00012638694584
-0.000525985565899
0.000131398299925
-0.000517601636094
0.00013569829137
-0.000506703066243
0.000138764338392
-0.000491379904161
0.000137895853422
-0.00046091105859
0.000130682032971
-0.00041080250613
0.000116230796861
-0.000343957197774
9.49611690365e-05
-0.000266461409227
6.80268269386e-05
-0.000184237534629
3.77651214588e-05
-0.000102707126588
2.44806759223e-06
-2.06741048633e-05
-9.27914740624e-08
2.69527058914e-06
-3.02046148457e-07
2.36079327898e-06
-3.2405875431e-07
2.39040059704e-06
-3.02819588199e-07
2.44145832418e-06
-2.71236784223e-07
2.48036236664e-06
-2.53583401651e-07
2.53387425108e-06
-2.29155550203e-07
2.58266741862e-06
-1.98852250869e-07
2.63056539633e-06
-1.63799629507e-07
2.66831782438e-06
-1.10624194455e-07
2.66993468618e-06
-9.32670296913e-08
2.67072871863e-06
-7.32568346206e-08
2.74118282169e-06
2.69679437531e-06
6.44539508668e-08
1.88733090923e-06
1.14686607457e-07
1.88594981868e-06
1.52083833113e-07
1.82618660604e-06
2.20926117259e-07
1.74247080902e-06
2.94422839377e-07
1.73213956002e-06
3.70178883081e-07
1.72797203788e-06
4.4723784442e-07
1.72423096092e-06
5.29951944982e-07
1.72044717699e-06
6.19167261474e-07
1.71788878978e-06
7.12843645275e-07
1.71726405117e-06
8.03316322026e-07
1.71879917651e-06
8.91024349719e-07
1.71383874666e-06
9.74801655224e-07
1.70239530978e-06
1.02988118582e-06
1.6831553789e-06
1.06858528561e-06
1.62518882101e-06
1.11430431736e-06
1.53186529022e-06
1.19707104332e-06
1.47728054424e-06
1.28865777728e-06
1.46970878336e-06
1.38500412565e-06
1.47989341886e-06
1.50152208839e-06
1.48716947641e-06
1.60783582152e-06
1.51127758419e-06
1.7055284136e-06
1.5341195229e-06
1.80284980555e-06
1.54336063923e-06
1.90375016631e-06
1.5577594113e-06
2.00347465384e-06
1.5765649147e-06
2.09492074478e-06
1.60684930281e-06
2.19967608149e-06
1.62642619186e-06
2.31266989388e-06
1.64460227376e-06
2.42218768946e-06
1.66890763377e-06
2.53847012444e-06
1.7021795824e-06
2.66384639924e-06
1.74247144434e-06
2.79027360129e-06
1.7960469191e-06
2.91599348051e-06
1.88420149769e-06
3.05447871747e-06
1.98718883906e-06
3.19754985516e-06
2.15022979439e-06
3.30747582337e-06
2.37719147414e-06
3.32892125529e-06
2.69882889718e-06
3.06838768101e-06
3.22176708079e-06
3.07623794499e-06
6.0007429269e-06
3.07420383903e-06
2.80590951899e-06
1.58695744636e-05
-0.000487546668609
2.55599538648e-05
-0.000561271332861
3.33107883199e-05
-0.000573193553924
4.03049240665e-05
-0.000573383596223
4.70468303933e-05
-0.000571569244351
5.36959007339e-05
-0.000569629159642
6.02920283008e-05
-0.000567725339897
6.68459832643e-05
-0.000565807523933
7.33574500742e-05
-0.000563781857543
7.9821239438e-05
-0.000561561751681
8.62273867738e-05
-0.00055906079713
9.25605791813e-05
-0.000556185746474
9.87985873243e-05
-0.00055283305577
0.0001049087996
-0.000548870013277
0.000110847586339
-0.000544138635927
0.000116547755848
-0.000538409077726
0.000121917142805
-0.000531354935119
0.000126806628222
-0.000522491106019
0.000130962743523
-0.000510859166025
0.000133795350587
-0.000494212496334
0.00013202715356
-0.000459142839647
0.000123136638869
-0.000401911975353
0.000106483880167
-0.000327304432223
8.2677857065e-05
-0.000242655468003
5.25571289073e-05
-0.000154116706912
1.83675661328e-05
-6.85176800695e-05
-1.16847580203e-06
-1.13801695093e-06
-6.12881504797e-07
2.13970598858e-06
-4.6099263958e-07
2.20893540351e-06
-4.0502159112e-07
2.33445719919e-06
-3.48823920968e-07
2.38528460499e-06
-3.03556809746e-07
2.43511741545e-06
-2.73390971494e-07
2.50372868307e-06
-2.41405774346e-07
2.55070186947e-06
-2.05459722657e-07
2.59463908116e-06
-1.66883042214e-07
2.62976628153e-06
-1.33299382353e-07
2.63636928994e-06
-1.08033518118e-07
2.64542877755e-06
-7.50180423173e-08
2.70829305311e-06
2.62174380089e-06
7.09036063468e-08
1.81660563549e-06
1.33044128864e-07
1.8239406616e-06
1.6972465904e-07
1.78963372658e-06
2.43676590735e-07
1.66863689303e-06
3.21809232572e-07
1.65412518538e-06
4.01209092968e-07
1.6486905933e-06
4.81344870545e-07
1.64421275091e-06
5.63015914646e-07
1.63889283084e-06
6.4871849684e-07
1.63230169715e-06
7.42208169829e-07
1.6238892906e-06
8.42067098655e-07
1.61905390848e-06
9.42222027366e-07
1.61379633856e-06
1.04020164311e-06
1.60452395019e-06
1.1349280399e-06
1.58853245181e-06
1.19991620566e-06
1.56029840543e-06
1.22719407578e-06
1.50467826763e-06
1.28731829182e-06
1.41724017085e-06
1.38265236158e-06
1.37445371521e-06
1.47622405395e-06
1.38639778393e-06
1.57298616425e-06
1.39047791028e-06
1.67094858941e-06
1.41338258058e-06
1.78718932428e-06
1.41794230721e-06
1.89306910406e-06
1.43753838168e-06
1.9875462612e-06
1.4633358806e-06
2.08480838336e-06
1.47935234657e-06
2.19734234296e-06
1.49436147768e-06
2.30166089506e-06
1.52214984266e-06
2.40504313461e-06
1.54126232495e-06
2.52609625145e-06
1.54789773756e-06
2.64544196214e-06
1.58288298269e-06
2.76531853156e-06
1.62264282571e-06
2.88885305597e-06
1.67256933276e-06
3.04573980361e-06
1.72736310514e-06
3.22277933414e-06
1.81020717812e-06
3.41242589035e-06
1.96071120123e-06
3.59089479121e-06
2.19879926937e-06
3.71552309273e-06
2.57422019128e-06
3.51949201538e-06
3.41783999876e-06
2.52152276467e-06
6.99874985586e-06
3.35075251833e-06
1.97676341039e-06
1.59797325435e-05
-0.000500175335462
2.50920433927e-05
-0.000570383350486
3.22760054451e-05
-0.000580377260482
3.88031912219e-05
-0.000579910573516
4.514579598e-05
-0.000577911681332
5.1441829294e-05
-0.000575925061226
5.77198657504e-05
-0.000574003272686
6.39847080326e-05
-0.000572072284871
7.02332312086e-05
-0.0005700303157
7.64588810406e-05
-0.000567787348798
8.26510066845e-05
-0.000565252879014
8.87940244645e-05
-0.000562328727469
9.4865188192e-05
-0.000558904188223
0.000100831182164
-0.00055483598079
0.000106646979829
-0.000549954411331
0.000112241527765
-0.000544003607083
0.000117519262429
-0.000536632654067
0.000122317652933
-0.000527289482712
0.00012636701654
-0.000514908515791
0.00012900152203
-0.000496846984541
0.000126251065257
-0.000456392360733
0.000115553757965
-0.000391214664159
9.66201339905e-05
-0.000308370850309
7.04541350306e-05
-0.000216489481761
3.87827617758e-05
-0.000122445549101
3.66082634468e-06
-3.33956396326e-05
-9.26788248187e-08
2.61549529403e-06
-3.22826957872e-07
2.36986658218e-06
-4.21810081535e-07
2.30793713973e-06
-4.23547896349e-07
2.33621682575e-06
-3.89307106638e-07
2.35106649187e-06
-3.44791399306e-07
2.39062337499e-06
-3.11025884748e-07
2.4699850552e-06
-2.76621087054e-07
2.51631948662e-06
-2.37787680227e-07
2.55582895491e-06
-1.94553983264e-07
2.58655092487e-06
-1.61330712518e-07
2.6031704279e-06
-1.13151834602e-07
2.59733025376e-06
-5.95020329073e-08
2.6545693057e-06
2.56229959616e-06
7.20817314758e-08
1.74459766677e-06
1.42797973105e-07
1.75334902614e-06
1.93559439292e-07
1.73899458804e-06
2.69129538492e-07
1.59318815935e-06
3.50791848183e-07
1.57258623848e-06
4.33704395804e-07
1.56590087585e-06
5.17081829229e-07
1.56095721117e-06
6.01632074523e-07
1.55446299638e-06
6.88809138231e-07
1.54524424014e-06
7.79514885942e-07
1.53330177132e-06
8.79317570154e-07
1.51936825558e-06
9.87230005199e-07
1.50599884015e-06
1.09954796303e-06
1.49231824656e-06
1.20905639449e-06
1.47913177513e-06
1.30792592552e-06
1.46153176766e-06
1.37574747613e-06
1.43695332895e-06
1.4109978297e-06
1.38207804573e-06
1.4700164593e-06
1.31551583203e-06
1.56367128824e-06
1.29281712989e-06
1.6619580304e-06
1.29226173602e-06
1.76118622515e-06
1.31422107936e-06
1.85286716761e-06
1.32632143489e-06
1.9498728845e-06
1.34058712475e-06
2.05470732847e-06
1.35855099366e-06
2.16579346594e-06
1.36831165221e-06
2.26664536395e-06
1.39354948386e-06
2.37395020517e-06
1.41488134628e-06
2.49193554711e-06
1.42331288384e-06
2.60066524381e-06
1.4392083977e-06
2.71289172235e-06
1.47070048188e-06
2.85176659072e-06
1.48382320988e-06
3.00472940393e-06
1.51966635818e-06
3.17653432039e-06
1.55563484961e-06
3.36386025335e-06
1.62300679506e-06
3.6033590088e-06
1.72136036676e-06
3.93975343183e-06
1.86259298809e-06
4.42803929354e-06
2.08613102203e-06
4.97056602843e-06
2.87543379442e-06
2.21990502949e-06
9.75143446145e-06
4.30352327702e-06
-1.06603156217e-07
1.67395739417e-05
-0.000512610851796
2.49454689812e-05
-0.000578588848228
3.13658796563e-05
-0.000586797366883
3.7343597492e-05
-0.000585888059531
4.32528453521e-05
-0.000583820754372
4.91787732276e-05
-0.000581850856537
5.51285011467e-05
-0.00057995289984
6.10973587543e-05
-0.000578041064649
6.70783754743e-05
-0.000576011271232
7.30636123303e-05
-0.000573772536301
7.90421494245e-05
-0.00057123137545
8.49987374896e-05
-0.000568285281466
9.09107294306e-05
-0.000564816151479
9.6744916792e-05
-0.000560670144094
0.000102455315599
-0.000555664790152
0.00010796761802
-0.000549515892896
0.000113183558679
-0.000541848580637
0.000117926255039
-0.000532032166154
0.000121912654457
-0.000518894900086
0.000124393769795
-0.000499328081626
0.000120571474669
-0.000452570046707
0.000107930815467
-0.000378574014074
8.65538104129e-05
-0.000286993907112
5.77234475153e-05
-0.000187659222692
2.35930961686e-05
-8.83151039054e-05
-8.19758576416e-07
-8.98265669711e-06
-6.71007572846e-07
2.46675196137e-06
-5.68548473393e-07
2.2674180215e-06
-5.34679863905e-07
2.27408510443e-06
-4.90679528106e-07
2.29223656569e-06
-4.49649248409e-07
2.31005781941e-06
-4.06049334319e-07
2.3470466396e-06
-3.69227891195e-07
2.43318776164e-06
-3.30577028637e-07
2.47769306847e-06
-2.86964182101e-07
2.51224122121e-06
-2.38461781315e-07
2.53807930314e-06
-1.79347685083e-07
2.54408181959e-06
-1.03754384344e-07
2.52170707413e-06
-2.62731231505e-08
2.57721468279e-06
2.53599896045e-06
7.11539383329e-08
1.67363180272e-06
1.56599468666e-07
1.66804436066e-06
2.22669443936e-07
1.67306574526e-06
2.93244268321e-07
1.52274229901e-06
3.80645466208e-07
1.4853117632e-06
4.6686599534e-07
1.47980659542e-06
5.52204156132e-07
1.47574372502e-06
6.38836676516e-07
1.46795419855e-06
7.2898642578e-07
1.45521727472e-06
8.24216800715e-07
1.43819323578e-06
9.25282346996e-07
1.41842327065e-06
1.03361532107e-06
1.39778430071e-06
1.14971949883e-06
1.37632942348e-06
1.2708024587e-06
1.35816055306e-06
1.39067400082e-06
1.34176698951e-06
1.49963921797e-06
1.32808840697e-06
1.56550547194e-06
1.31630443134e-06
1.59973630269e-06
1.28136839498e-06
1.66131173336e-06
1.23131753465e-06
1.73910975316e-06
1.21453377601e-06
1.82526501669e-06
1.22813081613e-06
1.91637788364e-06
1.23526612456e-06
2.02002574685e-06
1.23699054559e-06
2.12662516668e-06
1.25199826586e-06
2.23393044003e-06
1.26104568402e-06
2.34091093124e-06
1.28660063267e-06
2.4426032866e-06
1.31321742337e-06
2.55039446869e-06
1.31554934147e-06
2.67379556245e-06
1.31583709105e-06
2.81080655224e-06
1.33372601008e-06
2.93737031446e-06
1.35730402712e-06
3.07651474782e-06
1.38057331991e-06
3.2373839239e-06
1.39483236172e-06
3.43704159051e-06
1.42342126653e-06
3.71535659885e-06
1.44320615497e-06
4.1690072044e-06
1.40905380612e-06
5.01273997669e-06
1.24243883739e-06
7.29760710828e-06
5.92413703174e-07
7.34590253778e-06
9.70378547013e-06
6.61206999925e-06
6.27453830468e-07
1.76419157756e-05
-0.000523640294288
2.47188243448e-05
-0.000585665407988
3.03675745089e-05
-0.000592445844242
3.58116902073e-05
-0.000591331969124
4.13008398434e-05
-0.000589309749272
4.68624238513e-05
-0.000587412324011
5.24845023034e-05
-0.000585574889798
5.81556383583e-05
-0.000583712132336
6.38669182556e-05
-0.000581722497147
6.96104159982e-05
-0.000579515990243
7.53761283713e-05
-0.000576997051521
8.11502112505e-05
-0.000574059333816
8.69111095438e-05
-0.000570577024098
9.26268758404e-05
-0.000566385888973
9.82511854277e-05
-0.000561289082033
0.000103707451128
-0.000554972143907
0.000108895099053
-0.000547036216408
0.000113621191168
-0.000536758244979
0.000117590818046
-0.00052286451392
0.00011996179613
-0.000501699032081
0.000114949572135
-0.000447557815985
0.000100233608465
-0.00036385807403
7.64111093636e-05
-0.00026317150128
4.52884704275e-05
-0.00015653658083
9.97703326685e-06
-5.30033628751e-05
-7.07562264483e-07
1.7019616743e-06
-6.50749495201e-07
2.40995778067e-06
-6.33005648933e-07
2.24969131036e-06
-6.06498960841e-07
2.24759696569e-06
-5.60946931795e-07
2.24670555118e-06
-5.19052450903e-07
2.26818638599e-06
-4.88608952116e-07
2.31662778865e-06
-4.42585323216e-07
2.38719023935e-06
-3.92598109447e-07
2.42773344357e-06
-3.36663223298e-07
2.45633594343e-06
-2.7492918354e-07
2.47637155143e-06
-1.96503835223e-07
2.46568536407e-06
-1.2079787065e-07
2.44608432957e-06
-3.98671756292e-08
2.49622210984e-06
2.49619173227e-06
7.00481592636e-08
1.60367454068e-06
1.74452441848e-07
1.563778974e-06
2.50430782547e-07
1.59722288978e-06
3.2209449042e-07
1.45121212674e-06
4.16218798347e-07
1.39131796021e-06
5.02885482249e-07
1.39326661757e-06
5.86457497896e-07
1.3922959199e-06
6.72508036952e-07
1.38202704189e-06
7.6522549394e-07
1.3626230304e-06
8.66362640833e-07
1.33717937745e-06
9.75511554332e-07
1.30939686389e-06
1.09140679827e-06
1.28201018847e-06
1.21074297479e-06
1.25711199419e-06
1.33306120938e-06
1.2359568123e-06
1.45732862771e-06
1.21760798177e-06
1.57868144612e-06
1.20683699011e-06
1.68713087128e-06
1.20794920305e-06
1.75957529557e-06
1.2090105755e-06
1.79689102244e-06
1.19408015118e-06
1.84240023784e-06
1.16909638634e-06
1.92036933667e-06
1.15022535072e-06
2.01402843908e-06
1.14166385623e-06
2.10392541262e-06
1.14714381793e-06
2.19859597146e-06
1.15737009815e-06
2.29877690091e-06
1.16089754265e-06
2.40885079183e-06
1.17655285063e-06
2.52242212644e-06
1.19966626013e-06
2.63685709699e-06
1.20113402195e-06
2.74251758023e-06
1.2101980712e-06
2.85384854614e-06
1.2224217263e-06
2.99260459604e-06
1.21857670747e-06
3.13561807037e-06
1.23759572641e-06
3.26817096093e-06
1.26230203348e-06
3.42103001692e-06
1.27062967214e-06
3.62206991924e-06
1.24220179226e-06
3.88308133006e-06
1.14811614171e-06
4.25220846545e-06
8.73434665018e-07
4.73980809574e-06
1.04335255978e-07
7.91946956689e-06
6.52425937455e-06
6.57034643302e-06
1.97662592849e-06
1.74749040384e-05
-0.000534544571628
2.39236517089e-05
-0.000592113908895
2.90843917487e-05
-0.000597606378296
3.41188266085e-05
-0.000596366242106
3.9239659149e-05
-0.000594430456822
4.44576485575e-05
-0.000592630217857
4.97588172979e-05
-0.000590875984782
5.51327575068e-05
-0.000589086015071
6.05725393111e-05
-0.000587162232926
6.60725543437e-05
-0.000585015967633
7.16254098528e-05
-0.000582549875427
7.72200886662e-05
-0.000579653985902
8.28374993485e-05
-0.000576194412138
8.84484885853e-05
-0.000571996859215
9.40073265267e-05
-0.000566847904258
9.94368291928e-05
-0.000560401633616
0.000104634537952
-0.000552233912673
0.000109389647355
-0.000541513342777
0.000113394551683
-0.00052686939605
0.000115692617636
-0.000503997083781
0.000109282475783
-0.000441147656002
9.21695501235e-05
-0.000346745242202
6.58367389097e-05
-0.000236838720631
3.40528653803e-05
-0.000124752460121
-1.38738460269e-07
-1.881135158e-05
-8.52993260179e-07
2.41625387906e-06
-7.36946816542e-07
2.29393975203e-06
-7.24415917289e-07
2.23718438887e-06
-6.88076619868e-07
2.21128052089e-06
-6.54632519759e-07
2.21328476151e-06
-6.12848310586e-07
2.22642701805e-06
-5.7993865243e-07
2.28374490932e-06
-5.22026324595e-07
2.32930658445e-06
-4.58127469759e-07
2.36386511704e-06
-3.89410335737e-07
2.38765082883e-06
-3.12163892522e-07
2.39916123046e-06
-2.13324081246e-07
2.36687739529e-06
-1.48397526853e-07
2.38113756025e-06
-7.84476780473e-08
2.42639729282e-06
2.41772759341e-06
7.60281955562e-08
1.52784420011e-06
1.88049196507e-07
1.45190698274e-06
2.71744023791e-07
1.51369102015e-06
3.71299049897e-07
1.3518016216e-06
4.64827949765e-07
1.29792308562e-06
5.48272771153e-07
1.30995328806e-06
6.27825146265e-07
1.31287437889e-06
7.14753773957e-07
1.29522988803e-06
8.143494358e-07
1.26316037384e-06
9.26402895804e-07
1.22525949935e-06
1.04770952428e-06
1.18822307665e-06
1.17368370767e-06
1.15616649935e-06
1.29960925998e-06
1.13131263542e-06
1.42334848323e-06
1.11233782093e-06
1.5428516909e-06
1.09821658532e-06
1.65290754435e-06
1.09688367287e-06
1.75401487867e-06
1.10693654315e-06
1.85475662583e-06
1.10835627838e-06
1.94573685766e-06
1.10318095554e-06
2.01242793346e-06
1.10247810193e-06
2.06567972604e-06
1.09703830403e-06
2.12551822892e-06
1.08188133813e-06
2.19944595241e-06
1.07326511292e-06
2.28877382656e-06
1.0680809986e-06
2.38175717806e-06
1.06794224056e-06
2.47558439395e-06
1.08274339837e-06
2.56776132247e-06
1.1075023322e-06
2.67117430609e-06
1.09773146338e-06
2.80046775692e-06
1.08091705691e-06
2.93808326641e-06
1.08482076069e-06
3.04594469217e-06
1.11073865045e-06
3.14220662747e-06
1.14134932072e-06
3.25498067647e-06
1.14955955221e-06
3.37542697921e-06
1.15020175328e-06
3.48391551691e-06
1.13381412256e-06
3.55776193976e-06
1.07434227097e-06
3.46517262203e-06
9.65825585748e-07
2.62058734424e-06
9.48923686778e-07
4.82197076119e-06
4.32222876176e-06
5.12488020263e-06
1.67371370412e-06
1.64445037419e-05
-0.000545864177763
2.26766457665e-05
-0.000598345950434
2.75509679698e-05
-0.000602480587834
3.22670702648e-05
-0.000601082240723
3.70576815473e-05
-0.000599220981093
4.19465375949e-05
-0.000597519002834
4.69301659236e-05
-0.000595859556501
5.20050306034e-05
-0.0005941608341
5.71693523407e-05
-0.000592326517564
6.24219008456e-05
-0.000590268484967
6.77595940632e-05
-0.000587887542109
7.31758062675e-05
-0.00058507017514
7.86556294465e-05
-0.00058167421556
8.41746349473e-05
-0.000577515848061
8.96891230061e-05
-0.000572362378231
9.51240331641e-05
-0.000565836531769
0.000100375873021
-0.000557485741936
0.000105216366425
-0.000546353822793
0.000109329218082
-0.000530982230255
0.000111629088039
-0.000506296927868
0.000103593429682
-0.000433112039208
8.35278772779e-05
-0.000326679755602
5.31585578541e-05
-0.000206469359373
1.7146972127e-05
-8.87406463203e-05
-1.50491394106e-06
-1.59422126763e-07
-1.15653456994e-06
2.06792515428e-06
-9.46173899373e-07
2.08361615596e-06
-8.63031548357e-07
2.15407154022e-06
-8.08486632023e-07
2.15676191792e-06
-7.6649371694e-07
2.17131767242e-06
-7.25272725744e-07
2.18523273242e-06
-6.72289517653e-07
2.23079055038e-06
-5.99531529584e-07
2.25657969885e-06
-5.19746255755e-07
2.28411307724e-06
-4.34783478235e-07
2.30272368846e-06
-3.38197286627e-07
2.30260717264e-06
-2.41846229939e-07
2.27055848641e-06
-1.78828742142e-07
2.31820402449e-06
-1.08695683799e-07
2.35622495081e-06
2.30908818459e-06
1.03503155321e-07
1.4244723314e-06
1.98638164327e-07
1.35694206692e-06
3.0084294335e-07
1.41165150192e-06
4.36551384602e-07
1.21624919425e-06
5.31340409343e-07
1.2032876992e-06
6.26637601858e-07
1.21480799894e-06
7.24372012153e-07
1.21529525802e-06
8.38417964867e-07
1.18134310381e-06
9.67603733605e-07
1.13413535109e-06
1.10241746411e-06
1.09060426625e-06
1.23379209715e-06
1.05700198966e-06
1.35512865778e-06
1.03497598875e-06
1.46264593124e-06
1.02393247299e-06
1.55625082635e-06
1.01885870135e-06
1.64124747372e-06
1.01333371344e-06
1.72930546708e-06
1.00892948467e-06
1.82587136e-06
1.01046682746e-06
1.92428106654e-06
1.01003562032e-06
2.02079931328e-06
1.00674362764e-06
2.11720889688e-06
1.00614164713e-06
2.20144850323e-06
1.01286373996e-06
2.26579713558e-06
1.01759102234e-06
2.31672673657e-06
1.02238314906e-06
2.37289185888e-06
1.01195120449e-06
2.44047554174e-06
1.00038123951e-06
2.53284144647e-06
9.90390773273e-07
2.65185038671e-06
9.88499242656e-07
2.77251771354e-06
9.77067671656e-07
2.87387305072e-06
9.79564138501e-07
2.96334476215e-06
9.9535577897e-07
3.04938193499e-06
1.0247075734e-06
3.15269688158e-06
1.03805408395e-06
3.259840924e-06
1.04242381972e-06
3.35301285077e-06
1.05707351587e-06
3.42621086142e-06
1.06066059441e-06
3.46528807277e-06
1.0352887004e-06
3.40780930281e-06
1.02334967564e-06
3.24745801691e-06
1.10878944482e-06
4.34572715041e-06
3.22370195499e-06
4.65235262832e-06
1.36692674061e-06
1.54327999428e-05
-0.000556644673416
2.13247297112e-05
-0.000604237854927
2.58978894305e-05
-0.000607053687795
3.03006067639e-05
-0.0006054848913
3.47636789825e-05
-0.00060368399024
3.93216807634e-05
-0.000602076950832
4.39825891537e-05
-0.000600520420189
4.87510362982e-05
-0.000598929244965
5.36316495385e-05
-0.000597207100587
5.86288242005e-05
-0.000595265634144
6.37452007177e-05
-0.00059300389635
6.89801173963e-05
-0.000590305072233
7.43249068609e-05
-0.000587018987847
7.97622192614e-05
-0.000582953145449
8.52526023688e-05
-0.000577852748684
9.07271192937e-05
-0.0005713110375
9.60820220778e-05
-0.000562840633863
0.00010107327952
-0.000551345066294
0.00010538381363
-0.000535292742883
0.000107802963332
-0.00050871607867
9.7987510789e-05
-0.000423296635278
7.49902826902e-05
-0.000303682481272
4.18817185583e-05
-0.000173360746723
2.64598826325e-06
-4.95046353681e-05
-4.30799836991e-07
2.91739999115e-06
-7.45153260822e-07
2.38233092641e-06
-9.08529366953e-07
2.2470332457e-06
-9.33315312696e-07
2.17889008599e-06
-9.28873668541e-07
2.15234877152e-06
-8.87045736079e-07
2.12951728445e-06
-8.46353976752e-07
2.14456944334e-06
-7.70550981861e-07
2.15501774555e-06
-6.81326861904e-07
2.16738797396e-06
-5.82626247985e-07
2.18544810199e-06
-4.79169080295e-07
2.19930295895e-06
-3.67477333282e-07
2.19095426596e-06
-2.85482468993e-07
2.18859896465e-06
-2.05836675606e-07
2.23855025363e-06
-1.27829256885e-07
2.27833371618e-06
2.18125330401e-06
1.52106285931e-07
1.27259032316e-06
2.21991422889e-07
1.28724557686e-06
3.37193383238e-07
1.29664968007e-06
5.04690140821e-07
1.04892164745e-06
6.24665201066e-07
1.08348098222e-06
7.18225451125e-07
1.12142459525e-06
8.29324201846e-07
1.10438158421e-06
9.63189657705e-07
1.04766504563e-06
1.10292627507e-06
9.94580097415e-07
1.23427045827e-06
9.59432558239e-07
1.35231296181e-06
9.39120169212e-07
1.45708183045e-06
9.30355446289e-07
1.55205495562e-06
9.290949167e-07
1.6450220789e-06
9.26015509548e-07
1.73802402967e-06
9.20444761689e-07
1.82736875204e-06
9.19689653374e-07
1.91692814993e-06
9.2100520476e-07
2.00143175235e-06
9.25622416324e-07
2.07705951344e-06
9.31198144412e-07
2.1530603199e-06
9.30214667842e-07
2.23604105528e-06
9.29949481073e-07
2.32154767542e-06
9.32141464076e-07
2.40833888503e-06
9.35638353553e-07
2.49152386162e-06
9.28798970842e-07
2.5753610663e-06
9.16563301638e-07
2.65954902576e-06
9.06210459003e-07
2.74257788735e-06
9.05470150216e-07
2.81991327677e-06
8.99726614702e-07
2.89606650149e-06
9.03404299953e-07
2.97585437727e-06
9.15560401669e-07
3.07720427213e-06
9.23368095687e-07
3.17366630071e-06
9.41598897134e-07
3.25163462207e-06
9.64491843395e-07
3.32733908218e-06
9.81408617432e-07
3.40620889958e-06
9.81886203881e-07
3.4643571589e-06
9.77224312584e-07
3.49945239035e-06
9.88134079589e-07
3.56521621644e-06
1.04292786246e-06
4.28777027932e-06
2.50080597579e-06
4.51386912858e-06
1.14077317482e-06
1.46174790302e-05
-0.000566748370719
1.99949516764e-05
-0.000609615329646
2.41945227753e-05
-0.000611253225771
2.82497800837e-05
-0.000609540100598
3.23651695851e-05
-0.000607799331012
3.65771986175e-05
-0.000606288935537
4.09016289017e-05
-0.000604844813408
4.5350022029e-05
-0.000603377607402
4.99332784003e-05
-0.000601790331762
5.46619341896e-05
-0.000599994268311
5.95454312296e-05
-0.000597887374433
6.45906270982e-05
-0.000595350250927
6.97974888642e-05
-0.000592225834138
7.51585261043e-05
-0.000588314169026
8.06419367969e-05
-0.00058333614707
8.61907306211e-05
-0.000576859820531
9.17023426833e-05
-0.000568352236189
9.69208771858e-05
-0.000556563584705
0.000101529606508
-0.000539901458474
0.000104161636063
-0.000511348113867
9.21821543186e-05
-0.000411317121571
6.59998542475e-05
-0.00027750031504
3.144103106e-05
-0.000138801691851
-1.51025197562e-06
-1.65531595593e-05
-1.22869286537e-06
2.63592540304e-06
-1.14941114377e-06
2.30310683956e-06
-1.1357904118e-06
2.23345327117e-06
-1.11977469117e-06
2.16290670365e-06
-1.09182196522e-06
2.12442556754e-06
-1.04617262558e-06
2.08389685314e-06
-9.78574759767e-07
2.07700109622e-06
-8.88744538501e-07
2.06521894707e-06
-7.82881912691e-07
2.06156018511e-06
-6.61978275068e-07
2.06458150767e-06
-5.36705829405e-07
2.07407034164e-06
-4.15629339269e-07
2.06991418221e-06
-3.24345826827e-07
2.09735086068e-06
-2.25998846563e-07
2.14028561344e-06
-1.29547789321e-07
2.18186477261e-06
2.05175605667e-06
1.87668744193e-07
1.08509116599e-06
2.65284879746e-07
1.20984763004e-06
3.6225315341e-07
1.19987457964e-06
5.02090504387e-07
9.09239879197e-07
6.47566729481e-07
9.38177871797e-07
7.57254173691e-07
1.01193872555e-06
9.03616444982e-07
9.58231311336e-07
1.05468002449e-06
8.96804433502e-07
1.19091802629e-06
8.58530930546e-07
1.30637031415e-06
8.44151584808e-07
1.40716368967e-06
8.38481887912e-07
1.49673075248e-06
8.40928732538e-07
1.57785864849e-06
8.48095835344e-07
1.65967032845e-06
8.44321465887e-07
1.74729709207e-06
8.3292730956e-07
1.84023653476e-06
8.26852877342e-07
1.93269178209e-06
8.28646845844e-07
2.02354783347e-06
8.34856464274e-07
2.11455842146e-06
8.40270422185e-07
2.20152452478e-06
8.43324167371e-07
2.28446691856e-06
8.4707436822e-07
2.36830214246e-06
8.48363924726e-07
2.45951442242e-06
8.44470244019e-07
2.5575670131e-06
8.30776582193e-07
2.65429206524e-06
8.19854508784e-07
2.73723201375e-06
8.23275467064e-07
2.81367280536e-06
8.29023398446e-07
2.87565327217e-06
8.37734364771e-07
2.94033798989e-06
8.38700646644e-07
3.02267010597e-06
8.3322398778e-07
3.10962527675e-06
8.36401562434e-07
3.18651199893e-06
8.64745618497e-07
3.25996273477e-06
8.91067056944e-07
3.33101947359e-06
9.10419295604e-07
3.4047202315e-06
9.08256355245e-07
3.48012183438e-06
9.0191309305e-07
3.56956564978e-06
8.98765593167e-07
3.73593999069e-06
8.76402308017e-07
4.32919247322e-06
1.9075762749e-06
4.46622022804e-06
1.00365393065e-06
1.39080210398e-05
-0.000576190171037
1.86893295687e-05
-0.000614396615168
2.24575426064e-05
-0.000615021395016
2.61242682295e-05
-0.00061320677674
2.98619311144e-05
-0.000611536946441
3.37045864374e-05
-0.000610131550369
3.76721070278e-05
-0.000608812301071
4.17809372187e-05
-0.000607486411539
4.60473856053e-05
-0.000606056759014
5.04881250545e-05
-0.000604434989923
5.51201862237e-05
-0.000602519419591
5.99595122613e-05
-0.000600189562189
6.50174501136e-05
-0.000597283758223
7.0299595556e-05
-0.000593596301672
7.57866453768e-05
-0.000588823185331
8.14409930977e-05
-0.000582514158564
8.71647321363e-05
-0.000574075962417
9.27055463211e-05
-0.00056210438345
9.77603498367e-05
-0.000544956246831
0.000100761646308
-0.000514349402207
8.60058642422e-05
-0.00039656142773
5.51340383917e-05
-0.000246628371917
1.59538307588e-05
-9.96217020733e-05
-1.30821086453e-06
7.08924576449e-07
-1.21322790639e-06
2.54099398322e-06
-1.2625811057e-06
2.35250354353e-06
-1.30789731369e-06
2.27880567273e-06
-1.31927200726e-06
2.17431374685e-06
-1.28832148651e-06
2.09350633683e-06
-1.2351415543e-06
2.03074771957e-06
-1.14150672442e-06
1.98339810063e-06
-1.03179774488e-06
1.95554402318e-06
-9.03986143695e-07
1.93378481875e-06
-7.54425966074e-07
1.91506124227e-06
-6.12273433515e-07
1.93195954202e-06
-4.86263295462e-07
1.94394791537e-06
-3.73190585993e-07
1.98432181023e-06
-2.58535158475e-07
2.02563606118e-06
-1.30859061393e-07
2.05429903716e-06
1.920903062e-06
1.74087708682e-07
9.11218190216e-07
3.0398818298e-07
1.08016534694e-06
4.1643351278e-07
1.08762970646e-06
4.68827723744e-07
8.57016655972e-07
6.04330429585e-07
8.0287380515e-07
8.00481804897e-07
8.16021603374e-07
9.75166404164e-07
7.83770416804e-07
1.1121618875e-06
7.60009763346e-07
1.22048005283e-06
7.50387813282e-07
1.30022809481e-06
7.64560497339e-07
1.37510621667e-06
7.63745307783e-07
1.463056384e-06
7.53109054614e-07
1.56469962791e-06
7.46574302441e-07
1.66893459759e-06
7.40201244974e-07
1.76838843114e-06
7.33581076617e-07
1.86335474724e-06
7.31988729135e-07
1.95584130382e-06
7.36256450354e-07
2.04742555542e-06
7.43362605057e-07
2.13804647562e-06
7.49733456648e-07
2.22767406031e-06
7.53773756561e-07
2.31830617468e-06
7.56511363856e-07
2.40957275286e-06
7.57155162265e-07
2.50011801297e-06
7.53970430336e-07
2.58433096231e-06
7.46593797173e-07
2.66954953592e-06
7.34652784487e-07
2.75653369622e-06
7.3629236096e-07
2.84321095501e-06
7.42335680573e-07
2.93347807406e-06
7.47442231083e-07
3.01446744625e-06
7.5768922116e-07
3.07714975089e-06
7.70501589119e-07
3.1301778599e-06
7.83390921861e-07
3.19330316758e-06
8.01618206712e-07
3.26434311309e-06
8.20089936186e-07
3.33135083894e-06
8.43462631666e-07
3.39899346306e-06
8.40729461036e-07
3.47387750417e-06
8.27142959807e-07
3.56121824757e-06
8.11475959796e-07
3.61868878939e-06
8.19046366532e-07
4.07250023657e-06
1.45370851365e-06
4.37780763705e-06
6.98424389237e-07
1.32516092277e-05
-0.000585063917982
1.73948689048e-05
-0.000618539800485
2.06827491465e-05
-0.000618309201094
2.39195415111e-05
-0.000616443501406
2.72459731565e-05
-0.000614863320859
3.06916727842e-05
-0.000613577204516
3.42774690245e-05
-0.000612398062388
3.80223767406e-05
-0.000611231292907
4.19468236893e-05
-0.000609981185573
4.60732058913e-05
-0.000608561355388
5.0426602114e-05
-0.000606872801035
5.50335661632e-05
-0.000604796512393
5.99198838718e-05
-0.000602170062582
6.51082123954e-05
-0.000598784617365
7.05987835698e-05
-0.00059431374521
7.63815082067e-05
-0.000588296870386
8.23659875371e-05
-0.000580060430046
8.8326742853e-05
-0.000568065120684
9.40020382678e-05
-0.000550631529835
9.76679453577e-05
-0.000518015327704
7.99960337851e-05
-0.00037888951557
4.53961301895e-05
-0.000212028728626
2.42009604319e-06
-5.66455343638e-05
-5.5721299489e-07
3.68625143398e-06
-1.02948795533e-06
3.0132983189e-06
-1.3343321921e-06
2.65738121287e-06
-1.49308519582e-06
2.43759279289e-06
-1.54912747767e-06
2.23038916329e-06
-1.52395962513e-06
2.06837099078e-06
-1.44572468468e-06
1.95254609533e-06
-1.33173275767e-06
1.86944073384e-06
-1.19435989831e-06
1.81820760047e-06
-1.04478234026e-06
1.78424684154e-06
-8.91019401418e-07
1.76134082094e-06
-7.35949265378e-07
1.77693614938e-06
-5.80301154396e-07
1.78834577449e-06
-4.29507261341e-07
1.8335702051e-06
-3.01205400242e-07
1.89741873281e-06
-1.34893713147e-07
1.88799422708e-06
1.78605848739e-06
1.23653225897e-07
7.87732281921e-07
3.03326719806e-07
9.0071419122e-07
4.70517708034e-07
9.20668579185e-07
5.49686222132e-07
7.7807643522e-07
6.82205082097e-07
6.70603558506e-07
8.51029993731e-07
6.47427293745e-07
9.78485790474e-07
6.56513584439e-07
1.06369359554e-06
6.74972875048e-07
1.15182138748e-06
6.62411916224e-07
1.26116891778e-06
6.55355126296e-07
1.37456089336e-06
6.50487435368e-07
1.48265075185e-06
6.45145791606e-07
1.5871841079e-06
6.42160358781e-07
1.68717406945e-06
6.40323493662e-07
1.7809004596e-06
6.39960614772e-07
1.86966752431e-06
6.43321676395e-07
1.95721440119e-06
6.48804167618e-07
2.04616972102e-06
6.54496369109e-07
2.13648055652e-06
6.59506569498e-07
2.2284848741e-06
6.61846858882e-07
2.32028278273e-06
6.6478302896e-07
2.41161696574e-06
6.65879024342e-07
2.50640455635e-06
6.59227609197e-07
2.60546010062e-06
6.47567420997e-07
2.69979378391e-06
6.40334468049e-07
2.79158567946e-06
6.44498023941e-07
2.88191577354e-06
6.51990429656e-07
2.96776281437e-06
6.61565742778e-07
3.04820002831e-06
6.77208188768e-07
3.12866323135e-06
6.90032381118e-07
3.20376054509e-06
7.08262259482e-07
3.25423314709e-06
7.51196716199e-07
3.28771217277e-06
7.8665002285e-07
3.33340822505e-06
7.97863215738e-07
3.38732734741e-06
7.8687981358e-07
3.46364814506e-06
7.50946855589e-07
3.58733338084e-06
6.88009600404e-07
3.81948528954e-06
5.86978401056e-07
4.24055721683e-06
1.03290350523e-06
4.42488237976e-06
5.14143561234e-07
1.26386658109e-05
-0.000593277539364
1.60898464722e-05
-0.000621990863883
1.88521946393e-05
-0.000621071458537
2.16205613461e-05
-0.000619211791767
2.45030694637e-05
-0.000617745770649
2.75233957559e-05
-0.000616597485883
3.0700537302e-05
-0.000615575171269
3.40536085583e-05
-0.000614584340341
3.76055296648e-05
-0.00061353308854
4.13835743406e-05
-0.000612339385659
4.54208247483e-05
-0.000610910038238
4.97555816749e-05
-0.000609131256866
5.44308998144e-05
-0.000606845368032
5.94912189784e-05
-0.000603844924454
6.49668851238e-05
-0.000599789397795
7.08870368134e-05
-0.000594217010872
7.71772935051e-05
-0.000586350668114
8.36607483795e-05
-0.000574548554649
9.00813530281e-05
-0.000557052124777
9.45301910584e-05
-0.000522464224608
7.33289551982e-05
-0.000357688339698
3.58650860149e-05
-0.000174564712694
-1.35543854583e-06
-1.94248386092e-05
-1.26467260886e-06
3.5955180658e-06
-1.485294053e-06
3.23395163942e-06
-1.72118402594e-06
2.89330505752e-06
-1.84079126142e-06
2.55723368413e-06
-1.86784528483e-06
2.2574787204e-06
-1.81331039014e-06
2.0138714137e-06
-1.70290140003e-06
1.84217351173e-06
-1.55736017074e-06
1.72393721318e-06
-1.39034157214e-06
1.65122981307e-06
-1.21677127827e-06
1.61071964417e-06
-1.03874255646e-06
1.58335861216e-06
-8.53350718635e-07
1.59159337323e-06
-6.74530034748e-07
1.60957432905e-06
-4.88593922699e-07
1.64768637825e-06
-3.47500641546e-07
1.75634802899e-06
-1.54761698883e-07
1.69535906052e-06
1.63131432585e-06
8.2464741611e-08
7.05499730422e-07
2.65801191359e-07
7.17611364924e-07
4.15409389362e-07
7.71309984184e-07
5.04502458948e-07
6.89248961476e-07
6.50870225163e-07
5.24452122266e-07
7.7400837154e-07
5.24471613764e-07
8.97472566005e-07
5.33212849975e-07
1.03400836563e-06
5.38590209002e-07
1.15895335899e-06
5.37611586536e-07
1.27707627091e-06
5.37368119303e-07
1.38873986766e-06
5.38953179913e-07
1.49251262502e-06
5.41494194077e-07
1.58935666063e-06
5.45431474683e-07
1.67970648851e-06
5.50081401697e-07
1.76366625138e-06
5.56103111614e-07
1.84362113852e-06
5.63463017284e-07
1.92737901095e-06
5.65138923002e-07
2.0233433593e-06
5.58620365452e-07
2.12733573527e-06
5.55598525677e-07
2.23122873886e-06
5.5803277986e-07
2.33365796258e-06
5.6242373245e-07
2.43579879569e-06
5.63797888514e-07
2.53732618872e-06
5.57744914885e-07
2.63715353204e-06
5.47773890736e-07
2.73313513086e-06
5.44366182134e-07
2.82663413334e-06
5.51004114738e-07
2.91963915605e-06
5.58961673259e-07
3.01343794656e-06
5.67740482319e-07
3.10686152579e-06
5.83753611203e-07
3.18856784478e-06
6.08278773288e-07
3.24939532011e-06
6.47460545973e-07
3.30200169535e-06
6.98611577336e-07
3.33273676848e-06
7.56010897113e-07
3.34446929917e-06
7.86173687603e-07
3.35653785413e-06
7.74969361646e-07
3.40097154676e-06
7.0683454167e-07
3.50741737896e-06
5.81819056364e-07
3.76370663664e-06
3.31076986754e-07
4.23041595003e-06
5.66365307734e-07
4.42766706541e-06
3.1709976196e-07
1.20114096878e-05
-0.000600861091841
1.47400130161e-05
-0.000624719333173
1.69399291509e-05
-0.000623271265328
1.92063106869e-05
-0.000621478093794
2.1615661231e-05
-0.000620155058989
2.41838182136e-05
-0.000619165598283
2.6925243874e-05
-0.00061831656455
2.98564383344e-05
-0.000617515511402
3.30007495891e-05
-0.000616677382929
3.63889307901e-05
-0.000615727552773
4.0061316279e-05
-0.000614582411837
4.40682538019e-05
-0.00061313818208
4.84716178618e-05
-0.000611248719829
5.33414154585e-05
-0.000608714707916
5.87493051712e-05
-0.00060519727437
6.47790898487e-05
-0.000600246776795
7.14089210782e-05
-0.000592980479992
7.85825507685e-05
-0.000581722157398
8.59946251558e-05
-0.000564464218171
9.13179777699e-05
-0.000527787573732
6.41821552899e-05
-0.000330552466244
1.96512885231e-05
-0.000130033601437
-9.09554059644e-07
1.13605075788e-06
-1.31986342857e-06
4.00587370015e-06
-1.80232064619e-06
3.71645235242e-06
-2.11792907097e-06
3.2089514785e-06
-2.240382599e-06
2.67972603282e-06
-2.23172893992e-06
2.24886273871e-06
-2.14314661657e-06
1.92532865338e-06
-2.00091629774e-06
1.6999832913e-06
-1.82553388279e-06
1.54859748946e-06
-1.62725404617e-06
1.45299451271e-06
-1.42332959334e-06
1.40684310001e-06
-1.21528394528e-06
1.37536388498e-06
-1.00335588181e-06
1.37971876892e-06
-7.97630954812e-07
1.40390374517e-06
-5.86832050314e-07
1.43693598557e-06
-4.03074563495e-07
1.57267619951e-06
-2.09451850025e-07
1.5017663921e-06
1.42190547674e-06
7.19208382413e-08
6.33793287997e-07
2.39160541392e-07
5.5059125884e-07
3.83121700954e-07
6.2762719128e-07
4.95397520777e-07
5.77225927734e-07
6.42286103969e-07
3.77741766897e-07
7.75213122434e-07
3.91706782757e-07
9.09274317254e-07
3.99306292145e-07
1.03996314921e-06
4.08046833375e-07
1.16168098128e-06
4.16030388774e-07
1.27475288431e-06
4.2442519817e-07
1.38022443381e-06
4.33603040946e-07
1.47799251206e-06
4.43841222198e-07
1.56844098516e-06
4.55091557397e-07
1.65244930111e-06
4.66175834534e-07
1.73571561425e-06
4.72934068005e-07
1.82982120849e-06
4.6945215023e-07
1.93664982567e-06
4.58402242399e-07
2.04610348652e-06
4.49256810353e-07
2.15406760666e-06
4.47719476155e-07
2.25956213211e-06
4.52618791146e-07
2.36260358139e-06
4.5945243438e-07
2.46410770778e-06
4.62354948725e-07
2.56612957375e-06
4.55768545043e-07
2.66961353554e-06
4.44324176991e-07
2.77178485256e-06
4.42211683203e-07
2.87136411858e-06
4.51428650306e-07
2.97107556136e-06
4.5923474254e-07
3.07550914989e-06
4.63293020876e-07
3.17794587127e-06
4.81267471758e-07
3.2657331325e-06
5.20520821137e-07
3.33793971191e-06
5.75225413955e-07
3.39289940804e-06
6.43760365865e-07
3.41137667911e-06
7.37543549284e-07
3.38948420996e-06
8.08201105148e-07
3.32575746551e-06
8.38895118254e-07
3.27442918333e-06
7.58317571337e-07
3.28828854768e-06
5.68601195344e-07
3.38135313449e-06
2.38254333071e-07
3.86985513809e-06
7.80213355586e-08
4.42935419001e-06
-2.42244529761e-07
1.1378243101e-05
-0.000607809776234
1.33306513563e-05
-0.000626671672336
1.49211430373e-05
-0.000624861713347
1.66530848697e-05
-0.000623209998818
1.85644288564e-05
-0.000622066368219
2.06572974314e-05
-0.000621258438226
2.29380332633e-05
-0.000620597277306
2.5417162553e-05
-0.000619994622816
2.81156026218e-05
-0.000619375808938
3.10653726205e-05
-0.000618677310685
3.43124444215e-05
-0.000617829472337
3.79185938179e-05
-0.000616744319702
4.19648719553e-05
-0.000615294984557
4.65492006378e-05
-0.00061329902265
5.17899370317e-05
-0.000610437991774
5.78272188521e-05
-0.000606284041642
6.47326690336e-05
-0.00059988589598
7.26980403615e-05
-0.000589687511734
8.15530381778e-05
-0.000573319190141
8.91183798433e-05
-0.000535352896975
5.69186373403e-05
-0.000298352514736
5.8628009271e-06
-7.89773449544e-05
3.56776768115e-07
6.64212363266e-06
-1.39680227128e-06
5.75952156027e-06
-2.26747305543e-06
4.58717592864e-06
-2.63851423282e-06
3.58003497246e-06
-2.74274586941e-06
2.78399552386e-06
-2.66246582383e-06
2.16861946352e-06
-2.51265715212e-06
1.77555919515e-06
-2.31822082213e-06
1.50558773667e-06
-2.1016578276e-06
1.33207756096e-06
-1.87068867888e-06
1.22207196672e-06
-1.63751458838e-06
1.17371973936e-06
-1.4132549725e-06
1.15115904914e-06
-1.17789725181e-06
1.14441949723e-06
-9.37518972618e-07
1.16358371725e-06
-7.12676246059e-07
1.21215467132e-06
-4.90145289301e-07
1.35018680889e-06
-2.69544657235e-07
1.28125808018e-06
1.15238627663e-06
8.36506494909e-08
5.50399074179e-07
1.89815949256e-07
4.44680537113e-07
3.73486071011e-07
4.4423423565e-07
5.36083153504e-07
4.14872461276e-07
6.45780645388e-07
2.68196496127e-07
7.71793995353e-07
2.65840189744e-07
8.99149511945e-07
2.72089892112e-07
1.0209948249e-06
2.8633516512e-07
1.13663443147e-06
3.00515383662e-07
1.24650219952e-06
3.14677403943e-07
1.35163159195e-06
3.28586076126e-07
1.45192916744e-06
3.43653055313e-07
1.54704030848e-06
3.60083110666e-07
1.64053792456e-06
3.72778666638e-07
1.73959777425e-06
3.73970591055e-07
1.84439590162e-06
3.64750139134e-07
1.95355938897e-06
3.4933290508e-07
2.0638435972e-06
3.39063716346e-07
2.17244601347e-06
3.39205742218e-07
2.2797445587e-06
3.45400659754e-07
2.38475891026e-06
3.54514752882e-07
2.48656137938e-06
3.60611719654e-07
2.59119567016e-06
3.51192626126e-07
2.70303150729e-06
3.32520007447e-07
2.81559777387e-06
3.2968935535e-07
2.92155578303e-06
3.45472292765e-07
3.02519549736e-06
3.5563319135e-07
3.13869340303e-06
3.49760342023e-07
3.25525104368e-06
3.64770916205e-07
3.35707664818e-06
4.18629457219e-07
3.44337504409e-06
4.890395318e-07
3.51435392574e-06
5.72736055691e-07
3.54755882006e-06
7.04381867273e-07
3.50738215623e-06
8.48339489076e-07
3.36153132174e-06
9.84558129722e-07
3.15071332849e-06
9.69956081894e-07
2.99686197311e-06
7.22612023013e-07
3.10601836931e-06
1.29084171538e-07
3.77852211513e-06
-5.9435083025e-07
4.66686137063e-06
-1.13049242178e-06
1.07554045737e-05
-0.000613898181899
1.18327887318e-05
-0.000627749069622
1.27618387923e-05
-0.000625790837667
1.39285612045e-05
-0.000624376775527
1.53242799121e-05
-0.000623462124207
1.69271686944e-05
-0.000622861345163
1.87289121121e-05
-0.000622399028486
2.07292591654e-05
-0.000621994971771
2.29428473011e-05
-0.000621589394077
2.53997240813e-05
-0.000621134182818
2.81484762647e-05
-0.000620578216649
3.12599941907e-05
-0.000619855827685
3.48339750759e-05
-0.00061886895282
3.90009694528e-05
-0.00061746599931
4.39340049219e-05
-0.000615371010443
4.98271137859e-05
-0.000612177118593
5.68458161354e-05
-0.000606904577385
6.53712985897e-05
-0.00059821294803
7.54207446175e-05
-0.000583368625261
8.64733075392e-05
-0.000546405404145
5.54770012818e-05
-0.000267355996231
2.62741312997e-06
-2.61274341709e-05
-8.73560697579e-07
1.01431794485e-05
-2.56729809581e-06
7.45332507178e-06
-3.26990265056e-06
5.28983528635e-06
-3.44021864196e-06
3.75039479773e-06
-3.35244135445e-06
2.69625313929e-06
-3.15445954928e-06
1.97067245042e-06
-2.89910006535e-06
1.52023441383e-06
-2.62861436098e-06
1.23514135395e-06
-2.36275646747e-06
1.06626284257e-06
-2.11159156961e-06
9.7095507613e-07
-1.86414252175e-06
9.2632491904e-07
-1.61261109514e-06
8.99686982401e-07
-1.36535538084e-06
8.97227431087e-07
-1.12502628318e-06
9.2332008656e-07
-8.77725308931e-07
9.64916581254e-07
-5.64698972152e-07
1.03724627466e-06
-2.38865143965e-07
9.55476798064e-07
9.13560048097e-07
1.42866197288e-07
4.07922674001e-07
2.61936588485e-07
3.25957193394e-07
4.07101944542e-07
2.99336420343e-07
5.03651561096e-07
3.18524730968e-07
6.05577140679e-07
1.66399302343e-07
7.24427604871e-07
1.47112069436e-07
8.46339816138e-07
1.50297061191e-07
9.59660509504e-07
1.73127759459e-07
1.06970851703e-06
1.90577499648e-07
1.17981135456e-06
2.04679880644e-07
1.29332357185e-06
2.15178059678e-07
1.40849262237e-06
2.28583973677e-07
1.52439971082e-06
2.44275749271e-07
1.63758565017e-06
2.59689063517e-07
1.74301993234e-06
2.68632898786e-07
1.84796549499e-06
2.59898473139e-07
1.96017118596e-06
2.37220823209e-07
2.07354894417e-06
2.25775834189e-07
2.18463274498e-06
2.28208942029e-07
2.29633173518e-06
2.33782822411e-07
2.40475614577e-06
2.46162549202e-07
2.5082493205e-06
2.57184171374e-07
2.62111128288e-06
2.3838192067e-07
2.75048840568e-06
2.03195101147e-07
2.87922835271e-06
2.00980340716e-07
2.997622401e-06
2.27125457755e-07
3.10501120125e-06
2.48249550641e-07
3.20524402714e-06
2.49578952172e-07
3.32457416056e-06
2.45397598446e-07
3.45641120688e-06
2.8685283768e-07
3.57651950066e-06
3.68860481023e-07
3.69135668056e-06
4.57866943759e-07
3.78034044802e-06
6.15275615928e-07
3.7852742603e-06
8.42977695326e-07
3.5866568201e-06
1.18355912791e-06
3.23200042829e-06
1.32456821209e-06
2.60403612121e-06
1.35064662749e-06
2.51861442264e-06
2.14546419828e-07
3.62277215065e-06
-1.69856289997e-06
4.96426437338e-06
-2.47179007708e-06
1.00165918169e-05
-0.000618950353691
1.01499569633e-05
-0.00062788260045
1.03771480923e-05
-0.000626018252049
1.09649583271e-05
-0.000624964770621
1.1852825791e-05
-0.000624350117342
1.29740274009e-05
-0.000623982626845
1.42942372961e-05
-0.000623719286219
1.579803844e-05
-0.000623498799774
1.74908843478e-05
-0.000623282252923
1.93972932302e-05
-0.00062304059515
2.15631224283e-05
-0.000622744042073
2.4061134751e-05
-0.000622353830849
2.70021036219e-05
-0.000621809906322
3.05483793248e-05
-0.000621012256565
3.49435321573e-05
-0.000619766134388
4.04976392328e-05
-0.000617731202874
4.76008619601e-05
-0.00061400774969
5.67112552076e-05
-0.000607323316811
6.71965052267e-05
-0.000593853832281
7.8544790455e-05
-0.000557753677598
3.33231745362e-05
-0.000222134292638
4.86551590087e-07
6.70923923751e-06
-3.08202842099e-06
1.3711798219e-05
-4.68723314108e-06
9.05859203767e-06
-4.82131087247e-06
5.42396014627e-06
-4.51630386516e-06
3.44542226979e-06
-4.09825864189e-06
2.27823717018e-06
-3.7034156954e-06
1.57585694785e-06
-3.30960780056e-06
1.12645653139e-06
-2.93971120786e-06
8.65279393708e-07
-2.61802304031e-06
7.4461404624e-07
-2.34613212855e-06
6.99109739711e-07
-2.08014572136e-06
6.6039036742e-07
-1.80552201773e-06
6.25121966024e-07
-1.52279489108e-06
6.14563090454e-07
-1.22238992967e-06
6.22977731924e-07
-8.99333282515e-07
6.41922342604e-07
-5.30675480221e-07
6.68640703395e-07
-1.98981089935e-07
6.23861583872e-07
7.14622870668e-07
1.89252489868e-07
2.19208590752e-07
3.76136988523e-07
1.39392328841e-07
4.86921606776e-07
1.88781972356e-07
5.5901226197e-07
2.46646005277e-07
5.59815825115e-07
1.6573895137e-07
6.60520025734e-07
4.65319077598e-08
7.7929782501e-07
3.1627606344e-08
8.86034889358e-07
6.64943296658e-08
1.00084617342e-06
7.58676388703e-08
1.12809051445e-06
7.75344005229e-08
1.25945837368e-06
8.39071797853e-08
1.3891775458e-06
9.89595339534e-08
1.51034449949e-06
1.23201762637e-07
1.61865123703e-06
1.51473931429e-07
1.71665633654e-06
1.70718082439e-07
1.81836655773e-06
1.58280087536e-07
1.93854383444e-06
1.1713121764e-07
2.07221328789e-06
9.21920757372e-08
2.20369648957e-06
9.68024668563e-08
2.3320081652e-06
1.05545394691e-07
2.47033692416e-06
1.07892355198e-07
2.62114101418e-06
1.0643799147e-07
2.75209971852e-06
1.07460940343e-07
2.85303640582e-06
1.02303545885e-07
2.9571071967e-06
9.69280179063e-08
3.07495986011e-06
1.09301912632e-07
3.19844117572e-06
1.24766546199e-07
3.31945629439e-06
1.28536310639e-07
3.43255223261e-06
1.32262090936e-07
3.55953087661e-06
1.59779852339e-07
3.72332619655e-06
2.04950467257e-07
3.91541731557e-06
2.6560007882e-07
4.12963061949e-06
4.00579146488e-07
4.32883360373e-06
6.43426583075e-07
4.19091658917e-06
1.32113934057e-06
4.26922798862e-06
1.24629497694e-06
3.0169144225e-06
2.60290003715e-06
7.71844111845e-07
2.4576718805e-06
3.49046342695e-06
-4.4182775083e-06
4.94729238988e-06
-3.92852410003e-06
8.93565247478e-06
-0.000622938901901
7.98783258923e-06
-0.000626935129163
7.54333909725e-06
-0.000625574097168
7.64288505466e-06
-0.000625064582623
8.10313517065e-06
-0.000624810554449
8.7919817729e-06
-0.000624671596284
9.64972580339e-06
-0.000624577108501
1.0651027881e-05
-0.000624500147031
1.17942729612e-05
-0.00062442552264
1.30961935098e-05
-0.000624342524113
1.45925765239e-05
-0.000624240423755
1.63439251479e-05
-0.00062410516973
1.84485304807e-05
-0.000623914496007
2.10659405407e-05
-0.000623629643551
2.44704825156e-05
-0.000623170654025
2.91179367829e-05
-0.000622378617699
3.58817228862e-05
-0.000620771507667
4.59572573628e-05
-0.00061739880501
5.92254573113e-05
-0.000607122012981
7.59180632338e-05
-0.000574446223995
8.3665777292e-06
-0.000154582692136
3.27868621494e-06
1.17971368541e-05
-7.96442923333e-06
2.49550218442e-05
-8.30200412786e-06
9.39619887002e-06
-6.90190466377e-06
4.02388824387e-06
-5.73861456848e-06
2.28215207852e-06
-4.83838546213e-06
1.37802702163e-06
-4.17010451636e-06
9.07594043553e-07
-3.64303760594e-06
5.99409725598e-07
-3.20247757963e-06
4.24743524558e-07
-2.82418945821e-06
3.66356153603e-07
-2.48695788064e-06
3.61914132384e-07
-2.17433421958e-06
3.47808685409e-07
-1.87004122134e-06
3.20877919036e-07
-1.56037748205e-06
3.04953039899e-07
-1.24774408562e-06
3.10399222529e-07
-9.35515753714e-07
3.29744903141e-07
-6.09669613549e-07
3.42860384783e-07
-2.97338418846e-07
3.11610801245e-07
4.17342816451e-07
2.19449069789e-07
3.58949845166e-07
5.47850353249e-07
7.94619324305e-07
9.60463582524e-07
1.00707493531e-06
1.03876520324e-06
1.10531898697e-06
1.18124192416e-06
1.25882877726e-06
1.34278483616e-06
1.44179146236e-06
1.56503891471e-06
1.71655878614e-06
1.88732485178e-06
2.04565274543e-06
2.16283013763e-06
2.25506212505e-06
2.35190276505e-06
2.45747723529e-06
2.56539834213e-06
2.6718524685e-06
2.77933580476e-06
2.88164281191e-06
2.97858502557e-06
3.08787374233e-06
3.21262381182e-06
3.3411150669e-06
3.47331864439e-06
3.63301565626e-06
3.83785225059e-06
4.10321811595e-06
4.50348847445e-06
5.14667236556e-06
6.467734926e-06
7.71398609925e-06
1.03150086305e-05
1.27703151985e-05
8.35118551531e-06
4.4225957464e-06
6.48350655195e-06
4.54817812612e-06
3.97391372935e-06
3.90920865562e-06
4.09857112226e-06
4.42692059025e-06
4.84977944824e-06
5.34961356429e-06
5.92408260049e-06
6.5815565558e-06
7.34113579036e-06
8.23597254685e-06
9.32148621273e-06
1.06918533235e-05
1.25212153571e-05
1.51426116837e-05
1.93711251532e-05
2.69723377409e-05
4.48503484635e-05
9.54041755573e-05
-5.91785051215e-05
-4.73812890009e-05
-2.24261809391e-05
-1.30299709833e-05
-9.00607498699e-06
-6.72391569678e-06
-5.34588232204e-06
-4.43828150719e-06
-3.83886396057e-06
-3.41410981311e-06
-3.04773971618e-06
-2.68580862014e-06
-2.33797954731e-06
-2.0170779338e-06
-1.71209878044e-06
-1.40167469285e-06
-1.0719028948e-06
-7.29007233793e-07
-4.17342816451e-07
)
;
boundaryField
{
frontAndBack
{
type empty;
value nonuniform 0();
}
upperWall
{
type calculated;
value uniform 0;
}
lowerWall
{
type calculated;
value uniform 0;
}
inlet
{
type calculated;
value nonuniform List<scalar>
20
(
-0.000625
-0.000625
-0.000625
-0.000625
-0.000625
-0.000625
-0.000625
-0.000625
-0.000625
-0.000625
-0.000625
-0.000625
-0.000625
-0.000625
-0.000625
-0.000625
-0.000625
-0.000625
-0.000625
-0.000625
)
;
}
outlet
{
type calculated;
value nonuniform List<scalar>
20
(
0.000482810359566
0.000610084625605
0.000699050246177
0.000747949791178
0.000772716403379
0.000782796100688
0.000778927017673
0.000764611399065
0.00074741638074
0.000727532752018
0.000704884661222
0.000679328186192
0.000650682883961
0.000618687047338
0.000582952780981
0.000542873804078
0.000497200260852
0.0004423772902
0.000372161849558
0.000295002660875
)
;
}
}
// ************************************************************************* //
| [
"as998@snu.edu.in"
] | as998@snu.edu.in | |
2733492e913b3bb9cb6cebe87cca2d51fb1707ef | 627e86f245fef245380be69421669140ba9fd9b1 | /ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/jni/ReactCommon/TurboModuleManager.h | 26be4a311341a1b758d06094f1f0df81e78723af | [
"CC-BY-4.0",
"MIT",
"CC-BY-NC-SA-4.0",
"CC-BY-SA-4.0"
] | permissive | rashtell/react-native | 3b840624fae3216187a5c0a3c3d1a578394018c8 | 1610c08a678cb3d352187076db68be4cf73e0a9a | refs/heads/master | 2023-03-15T13:03:14.782409 | 2019-11-22T18:08:38 | 2019-11-22T18:10:38 | 223,503,867 | 2 | 0 | MIT | 2023-03-03T17:27:43 | 2019-11-22T23:38:32 | null | UTF-8 | C++ | false | false | 2,138 | h | /*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#pragma once
#include <memory>
#include <unordered_map>
#include <fb/fbjni.h>
#include <jsi/jsi.h>
#include <ReactCommon/TurboModule.h>
#include <ReactCommon/JavaTurboModule.h>
#include <react/jni/CxxModuleWrapper.h>
#include <react/jni/JMessageQueueThread.h>
#include <ReactCommon/CallInvokerHolder.h>
#include <ReactCommon/TurboModuleManagerDelegate.h>
namespace facebook {
namespace react {
class TurboModuleManager : public jni::HybridClass<TurboModuleManager> {
public:
static auto constexpr kJavaDescriptor = "Lcom/facebook/react/turbomodule/core/TurboModuleManager;";
static jni::local_ref<jhybriddata> initHybrid(
jni::alias_ref<jhybridobject> jThis,
jlong jsContext,
jni::alias_ref<CallInvokerHolder::javaobject> jsCallInvokerHolder,
jni::alias_ref<CallInvokerHolder::javaobject> nativeCallInvokerHolder,
jni::alias_ref<TurboModuleManagerDelegate::javaobject> delegate
);
static void registerNatives();
private:
friend HybridBase;
jni::global_ref<TurboModuleManager::javaobject> javaPart_;
jsi::Runtime* runtime_;
std::shared_ptr<CallInvoker> jsCallInvoker_;
std::shared_ptr<CallInvoker> nativeCallInvoker_;
jni::global_ref<TurboModuleManagerDelegate::javaobject> delegate_;
using TurboModuleCache = std::unordered_map<std::string, std::shared_ptr<react::TurboModule>>;
/**
* TODO(T48018690):
* All modules are currently long-lived.
* We need to come up with a mechanism to allow modules to specify whether
* they want to be long-lived or short-lived.
*/
std::shared_ptr<TurboModuleCache> turboModuleCache_;
void installJSIBindings();
explicit TurboModuleManager(
jni::alias_ref<TurboModuleManager::jhybridobject> jThis,
jsi::Runtime *rt,
std::shared_ptr<CallInvoker> jsCallInvoker,
std::shared_ptr<CallInvoker> nativeCallInvoker,
jni::alias_ref<TurboModuleManagerDelegate::javaobject> delegate
);
};
} // namespace react
} // namespace facebook
| [
"facebook-github-bot@users.noreply.github.com"
] | facebook-github-bot@users.noreply.github.com |
47da3301feff22bccba20d88ca51b840ea100934 | b53bdc4576f948e6066bbead8a93451fa1598726 | /Luogu/ShengXuan/P6563(2).cpp | 832c62090f929112942c24ac88bb06f44356e01e | [] | no_license | Clouder0/AlgorithmPractice | da2e28cb60d19fe7a99e9f3d1ba99810897244a4 | 42faedfd9eb49d6df3d8031d883784c3514a7e8b | refs/heads/main | 2023-07-08T11:07:17.631345 | 2023-07-06T12:15:33 | 2023-07-06T12:15:33 | 236,957,049 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,198 | cpp | #include <cstdio>
#include <algorithm>
using namespace std;
const long long inf = 1ll << 60;
const int maxn = 7200;
int T,n,a[maxn];
long long f[maxn][maxn];
int q[maxn],qt,qh;
int main()
{
scanf("%d",&T);
while(T--)
{
scanf("%d",&n);
for (int i = 1; i <= n; ++i) scanf("%d",a + i);
for (int i = 1; i <= n; ++i) for (int j = i + 1; j <= n; ++j) f[j][i] = inf;
for (int r = 2; r <= n; ++r)
{
qh = qt = 1, q[1] = r - 1, f[r][r - 1] = a[r - 1];
for (int l = r - 2, p = r; l > 0; --l)
{
while (p > l && f[p - 1][l] > f[r][p]) --p;
//x in [l,p - 1] f[l][x] <= f[x + 1][r]
//x in [p,r] f[l][x] > f[x + 1][r]
//l <-,p <-
f[r][l] = a[p] + f[p][l];
while (qt >= qh && q[qh] >= p) ++qh;//should in [l,p - 1]
if (qt >= qh) f[r][l] = min(f[r][l], f[r][q[qh] + 1] + a[q[qh]]);
while (qt >= qh && f[r][q[qt] + 1] + a[q[qt]] >= f[r][l + 1] + a[l]) --qt;
q[++qt] = l;
}
}
printf("%lld\n",f[n][1]);
}
return 0;
} | [
"clouder0@outlook.com"
] | clouder0@outlook.com |
f0cb6263df660f3ea2a4b13c1e5ed95f004bb4ab | 4fbbce8221efba06e5c2334ba850fbd17568b888 | /TreeVariant/TreeVariant.cpp | a7d3da1ef8d9c20e2514b3b7db4d1c954241f30a | [
"Apache-2.0"
] | permissive | CreatorSergey/PascalParser | 92d9caeaf743ceba9998c3cbbf2a8101607c40a1 | f99d8578cbb6538f8d2f63a3226abc2290d69be1 | refs/heads/master | 2020-07-24T03:05:04.043892 | 2017-08-20T15:26:33 | 2017-08-20T15:26:33 | 207,782,919 | 1 | 0 | Apache-2.0 | 2019-09-11T10:14:22 | 2019-09-11T10:14:21 | null | UTF-8 | C++ | false | false | 18,174 | cpp | /*
* Copyright (C) 2017 Smirnov Vladimir mapron1@gmail.com
* Source code 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 or in file COPYING-APACHE-2.0.txt
*
* 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.h
*/
#include "TreeVariant.h"
#include <ByteOrderStream.h>
#include <QFile>
#include <QBuffer>
#include <QDebug>
const TreeVariant TreeVariant::emptyValue;
// ----------------------------------------------
TreeVariant::TreeVariant() :
QVariant()
{
}
//--------------------------------------------------------------------------------
TreeVariant::TreeVariantList& TreeVariant:: asList()
{
_type = List;
return _list;
}
//--------------------------------------------------------------------------------
TreeVariant::TreeVariantMap &TreeVariant::asMap()
{
_type = Map;
return _map;
}
const TreeVariant::TreeVariantList &TreeVariant::asList() const
{
return _list;
}
const TreeVariant::TreeVariantMap &TreeVariant::asMap() const
{
return _map;
}
QStringList TreeVariant::keys() const
{
return _mapKeys;
}
//--------------------------------------------------------------------------------
TreeVariant::VariantType TreeVariant::vtype() const
{return _type;}
void TreeVariant::setVtype(TreeVariant::VariantType type)
{_type=type;}
//--------------------------------------------------------------------------------
TreeVariant TreeVariant::fromQVariant(QVariant val)
{
TreeVariant return_value = val;
if (val.type() == QVariant::Map)
{
QVariantMap vm = val.toMap();
QMapIterator<QString, QVariant> i(vm);
while (i.hasNext())
{
i.next();
return_value._map.insert(i.key(), TreeVariant::fromQVariant(i.value())) ;
return_value._mapKeys << i.key();
}
return_value._type = Map;
}
if (val.type() == QVariant::List || val.type() == QVariant::StringList)
{
QVariantList vm = val.toList();
QListIterator<QVariant> i(vm);
while (i.hasNext())
{
return_value._list.push_back( TreeVariant::fromQVariant(i.next()) );
}
return_value._type = List;
}
return return_value;
}
//--------------------------------------------------------------------------------
TreeVariant &TreeVariant::operator [](const QString& index)
{
_type = Map;
if (!_map.contains(index))
_mapKeys << index;
return _map[index];
}
//--------------------------------------------------------------------------------
const TreeVariant TreeVariant::operator [](const QString& index) const
{
if (_type != Map)
return emptyValue;
if (!_map.contains(index))
return emptyValue;
return _map.value(index);
}
//--------------------------------------------------------------------------------
TreeVariant &TreeVariant::operator [](const int index)
{
while(_list.size() <= index)
_list.append(TreeVariant());
_type = List;
return _list[index];
}
//--------------------------------------------------------------------------------
const TreeVariant& TreeVariant::operator [](const int index) const
{
if(_list.size() <= index || index < 0)
return emptyValue;
return _list[index];
}
//--------------------------------------------------------------------------------
QMap<QString, QString> TreeVariant::asStringMap() const
{
QMap<QString, QString> ret;
if (vtype() == TreeVariant::Map)
{
const TreeVariantMap& vm = asMap();
foreach (QString key, vm.keys())
ret.insert(key, vm[key].toString());
}
return ret;
}
QVariantMap TreeVariant::asVariantMap() const
{
QVariantMap ret;
if (vtype() == TreeVariant::Map)
{
const TreeVariantMap& vm = asMap();
foreach (QString key, vm.keys())
ret.insert(key, vm[key].asVariant());
}
return ret;
}
//--------------------------------------------------------------------------------
QStringList TreeVariant::asStringList() const
{
QStringList ret;
if (vtype() == TreeVariant::List)
{
const TreeVariantList& vm = this->asList();
for (int i=0;i<vm.size();i++)
ret << vm[i].toString() ;
}
return ret;
}
QVariant TreeVariant::asVariant() const
{
if (vtype() == TreeVariant::List)
{
QVariantList ret;
const TreeVariantList& vm = this->asList();
for (int i=0;i<vm.size();i++)
ret << vm[i].asVariant();
return ret;
}
if (vtype() == TreeVariant::Map)
{
return asVariantMap();
}
return *this;
}
//--------------------------------------------------------------------------------
void TreeVariant::remove(const QString& key)
{
_type = Map;
_map.remove(key);
_mapKeys.removeAll(key);
}
//--------------------------------------------------------------------------------
void TreeVariant::append(const TreeVariant &val)
{
_type = List;
_list.append(val);
}
//--------------------------------------------------------------------------------
int TreeVariant::listSize() const
{
return _list.size();
}
int TreeVariant::mapSize() const
{
return _map.size();
}
//--------------------------------------------------------------------------------
bool TreeVariant::contains(const QString &key) const
{
if ( _type != Map)
return false;
return _map.contains(key);
}
//--------------------------------------------------------------------------------
bool TreeVariant::saveToFile(QString filename, QString type, QDataStream::ByteOrder byteOrder) const
{
QFile file(filename);
if (!file.open(QIODevice::WriteOnly))
return false;
if (type == "extensionGuess")
{
if (filename.right(5) == ".yaml"|| filename.right(5) == "-yaml")
type = "yaml";
if (filename.right(5) == ".json")
type = "json";
if (filename.right(7) == ".ubjson")
type = "ubjson";
}
const bool res = saveToDevice(&file, type, byteOrder);
file.close();
return res;
}
//--------------------------------------------------------------------------------
bool TreeVariant::saveToDevice(QIODevice *device, QString type, QDataStream::ByteOrder byteOrder) const
{
QString yaml;
if (type == "yaml")
{
this->toYamlString(yaml);
device->write(yaml.toUtf8());
}
else if (type == "json")
{
this->toYamlString(yaml, true);
device->write(yaml.toUtf8());
}
else if (type == "ubjson")
{
QDataStream ds(device);
ds.setByteOrder(byteOrder);
this->toUbjson(ds);
}
else
return false;
return true;
}
//--------------------------------------------------------------------------------
bool TreeVariant::saveToByteArray(QByteArray &buffer, QString type, QDataStream::ByteOrder byteOrder) const
{
QBuffer buf(&buffer);
buf.open(QIODevice::WriteOnly);
bool res = this->saveToDevice(&buf, type, byteOrder);
return res;
}
//--------------------------------------------------------------------------------
QDebug operator<<(QDebug dbg, const TreeVariant &c)
{
QString yaml;
c.toYamlString(yaml);
dbg.nospace() << yaml.toUtf8().constData();
return dbg.nospace();
}
QDebug operator<<(QDebug dbg, const TreeVariant::VariantType &c)
{
switch (c)
{
case TreeVariant::Scalar: dbg.nospace() << "scalar";
break;
case TreeVariant::Map: dbg.nospace() << "map";
break;
case TreeVariant::List: dbg.nospace() << "list";
break;
}
return dbg.space();
}
//--------------------------------------------------------------------------------
TreeVariant *TreeVariant::findBy(QString field, TreeVariant value)
{
TreeVariant *return_value=nullptr;
if (_type == TreeVariant::List)
{
for (int i=0;i<_list.size();i++)
{
if (_list[i].contains(field) && _list[i][field] == value)
return &(_list[i]);
}
}
return return_value;
}
//--------------------------------------------------------------------------------
void TreeVariant::merge(const TreeVariant &overwrite,const QStringList& except, bool owerwrite_lists, bool trunc_lists)
{
if (_type == Map)
{
foreach (QString key, overwrite._mapKeys)
{
TreeVariant val = overwrite._map[key];
bool isExcept = except.contains(key);
if (!isExcept && ( val._type == Map || val._type == List)) {
(*this)[key].merge(val, except, owerwrite_lists, trunc_lists);
} else {
(*this)[key] = val;
}
}
}
else if (_type == List)
{
if (trunc_lists)
{
while (_list.size() > overwrite._list.size())
_list.removeLast();
}
for (int j=0; j< overwrite._list.size(); j++)
{
if (owerwrite_lists && _list.size() > j)
_list[j].merge(overwrite._list[j], except, owerwrite_lists, trunc_lists);
else
_list.append(overwrite._list[j]);
}
}
else // simple copy
{
_type = overwrite._type;
(*this) = overwrite;
}
}
void TreeVariant::clear()
{
QVariant::clear();
_list.clear();
_map.clear();
_mapKeys.clear();
}
//--------------------------------------------------------------------------------
bool TreeVariant::toYamlString(QString &ret, bool json, int level) const
{
// Old ugly code. Function supports json and yaml output (yaml may be compressed to inline)
QString indent_str = QString(" ").repeated(level);
bool ok;
this->toDouble(&ok);
switch (_type)
{
case TreeVariant::Scalar:{
if (!this->isValid())
ret += "~";
else if (this->type() == QVariant::Bool)
ret += this->toBool() ? "true" : "false";
else if (ok)
ret += this->toString();
else
ret += escape(toString());
break;
}case TreeVariant::Map: {
if (!json && isFlatList()){
ret += "{";
int i=0;
foreach (const QString& key,_mapKeys)
{
if (i++ > 0) ret += ", ";
ret += escape(key) + ": " ;
_map[key].toYamlString(ret, json, level + 1);
}
ret += "}";
break;
}
if (json) ret += "{\r\n";
int i=0;
foreach (const QString& key,_mapKeys)
{
const QString escapedKey = escape(key);
const bool nonFlat = !json && !_map[key].isFlatList();
ret += indent_str + escapedKey + ": " ;
if (nonFlat) ret += "\r\n";
_map[key].toYamlString(ret, json, level + 1);
if (nonFlat) ret += (json && i< _map.size()-1 ?",":"");
else ret += QString(json && i< _map.size()-1 ?",":"") + "\r\n";
i++;
}
if (json) ret += indent_str + "}"+ "\r\n";
}
break;
case TreeVariant::List: {
if (isFlatList())
{
ret += "[";
for (int i=0; i< _list.size(); i++)
{
if (i >0) ret += ", ";
_list[i].toYamlString(ret, json, level + 1);
}
ret += "]";
break;
}
if (json) ret += "[\r\n";
for (int i=0; i< _list.size(); i++)
{
ret += indent_str;
if (!json) ret += "- ";
const bool nonFlat = !json && !_list[i].isFlatList();
if (nonFlat) ret += "\r\n";
_list[i].toYamlString(ret, json, level + 1) ;
if (nonFlat) {;}
else ret += QString(json && i< _list.size()-1 ?",":"") + "\r\n";
}
if (json) ret += indent_str + "]"+"\r\n";
}
break;
}
return true;
}
void TreeVariant::optimize()
{
switch (_type)
{
case TreeVariant::Scalar: break;
case TreeVariant::List:
for (int i=0;i<_list.size();i++)
_list[i].optimize();
break;
case TreeVariant::Map: {
foreach (const QString& key, _mapKeys)
{
_map[key].optimize();
if (_map[key].isZero()) {
_map.remove(key);
_mapKeys.removeAll(key);
}
}
}
}
}
bool TreeVariant::isZero()
{
switch (_type)
{
case TreeVariant::Scalar: return !this->isValid();
case TreeVariant::List: return !_list.size();
case TreeVariant::Map: return !_map.size();
}
return true;
}
void TreeVariant::toUbjson(QDataStream &ds) const
{
// QByteArray ret;
// QByteArray t;
switch (_type)
{
case TreeVariant::Scalar:
{
bool okD;
double valueD = this->toDouble(&okD);
bool okI;
int valueI = this->toInt(&okI);
if (_typeHint!=TH_none){
okI = false;
okD = false;
}
if (this->type() == QVariant::Bool || _typeHint == TH_bool){
ds << (quint8)(this->toBool() ? 'T' : 'F');
}else if (this->type() == QVariant::Invalid || this->isNull()){
ds << (quint8)'Z' ;
}else if (okD || _typeHint == TH_float || _typeHint == TH_double){
if (_typeHint == TH_float){
ds << (quint8)'d' << (float) valueD;
}else{
ds << (quint8)'D' << valueD;
}
}else if (okI || _typeHint == TH_int || _typeHint == TH_int16|| _typeHint == TH_byte|| _typeHint == TH_int64){
if (_typeHint == TH_byte){
ds << (quint8)'B';
unsigned char value = valueI;
ds << value;
}else if (_typeHint == TH_int16){
ds << (quint8)'i';
short value = valueI;
ds << value;
}else{
ds << (quint8)'I' <<valueI;
}
}else{
QByteArray str = this->toString().toUtf8();
str += '\0';
if (str.size() < 254){
ds << (quint8)'s';
unsigned char sizeC = (unsigned char) str.size();
ds << sizeC;
ds.writeRawData(str.constData(), str.size());
}else{
ds << (quint8)'S';
int sizeI = (int) str.size();
ds << sizeI;
ds.writeRawData(str.constData(), str.size());
}
}
}
break;
case TreeVariant::Map: {
if (_map.size() < 254){
ds << (quint8)'o';
unsigned char sizeC = (unsigned char) _map.size();
ds << sizeC;
}else{
ds << (quint8)'O';
int sizeI = (int) _map.size();
ds << sizeI;
}
foreach (const QString& k, _mapKeys)
{
TreeVariant key(k);
key._typeHint=_typeHintKeys;
key.toUbjson(ds);
_map[k].toUbjson(ds);
}
}
break;
case TreeVariant::List: {
if (_list.size() < 254){
ds << (quint8)'a';
unsigned char sizeC = (unsigned char) _list.size();
ds << sizeC;
}else{
ds << (quint8)'A';
int sizeI = (int) _list.size();
ds <<sizeI;
}
for (int i=0; i< _list.size(); i++)
{
_list[i].toUbjson(ds);
}
}
break;
}
}
//--------------------------------------------------------------------------------
bool TreeVariant::isFlatList() const
{
if (_type == Scalar) return true;
if (_type == List)
for (int i=0; i < _list.size(); i++){
if (_list[i]._type != Scalar) return false;
}
if (_type == Map){
if ( _map.size() > 5) return false;
foreach (const QString k, _mapKeys){
if (_map[k]._type != Scalar) return false;
}
}
return true;
}
//--------------------------------------------------------------------------------
void TreeVariant::addLists(QString val1,QString val2,QString val3,QString val4,QString val5) {
_type = Map;
if (!val1.isEmpty()) (*this)[val1].setVtype(List);
if (!val2.isEmpty()) (*this)[val2].setVtype(List);
if (!val3.isEmpty()) (*this)[val3].setVtype(List);
if (!val4.isEmpty()) (*this)[val4].setVtype(List);
if (!val5.isEmpty()) (*this)[val5].setVtype(List);
}
//--------------------------------------------------------------------------------
void TreeVariant::addMaps(QString val1, QString val2, QString val3, QString val4, QString val5)
{
_type = Map;
if (!val1.isEmpty()) (*this)[val1].setVtype(Map);
if (!val2.isEmpty()) (*this)[val2].setVtype(Map);
if (!val3.isEmpty()) (*this)[val3].setVtype(Map);
if (!val4.isEmpty()) (*this)[val4].setVtype(Map);
if (!val5.isEmpty()) (*this)[val5].setVtype(Map);
}
//--------------------------------------------------------------------------------
//--------------------------------------------------------------------------------
const TreeVariant &TreeVariant::operator=(const QStringList a)
{
this->_list.clear();
foreach (QString s, a){
this->append(TreeVariant(s));
}
return *this;
}
bool TreeVariant::operator==(const TreeVariant &a) const
{
bool typeEquals = _type == a._type ;
bool listRquals =_type != List || _list == a._list;
bool mapEquals = _type != Map || _map == a._map ;
bool varEquals = _type != Scalar || QVariant::operator ==(a);
return typeEquals && listRquals && mapEquals && varEquals;
}
bool TreeVariant::operator!=(const TreeVariant &a) const
{
return _type != a._type || _list != a._list || _map != a._map || QVariant::operator !=(a);
}
QStringList TreeVariant::hints =QStringList() << ""<< "bool"<< "byte"<< "int16"<< "int"<< "int64"<< "string"<< "float"<< "double";
void TreeVariant::setTypeHint(QString hint)
{
setTypeHint(getTypeHintByName(hint));
}
void TreeVariant::setTypeHintKeys(QString hint)
{
setTypeHintKeys(getTypeHintByName(hint));
}
void TreeVariant::setTypeHint(TreeVariant::TypeHint hint)
{
_typeHint = hint;
}
void TreeVariant::setTypeHintKeys(TreeVariant::TypeHint hint)
{
_typeHintKeys = hint;
}
TreeVariant::TypeHint TreeVariant::getTypeHintByName(QString hint)
{
TreeVariant::TypeHint typeHint = TypeHint(hints.indexOf(hint));
if (typeHint < 0) typeHint =TH_none;
return typeHint;
}
QString TreeVariant::getJoinedValues(const QStringList &keys, const QString &glue) const
{
QStringList parts;
foreach (const QString &key, keys)
parts << _map.value(key).toString();
return parts.join(glue);
}
QString TreeVariant::getJoinedValues(const QList<int> &keys, const QString &glue) const
{
QStringList parts;
foreach (int key, keys)
parts << _list.value(key).toString();
return parts.join(glue);
}
QString TreeVariant::escape(QString str) const
{
static const QLatin1String f1("\\\""), f2("\\r"), f3("\\n"), f4("\\\\");
if (str.size() < 25 && QRegExp("[0-9A-Za-z_]+").exactMatch(str)) return str;
return QString("\"") + str.replace('\\',f4).replace('\"',f1).replace('\r',f2).replace('\n',f3) + "\"";
}
QString TreeVariant::unescape(QString str) const
{
static const QLatin1String f1("\\\""),t1("\""), f2("\\r"),t2("\r"), f3("\\n"), t3("\n"), f4("\\\\"), t4("\\");
return str.trimmed().replace(f1, t1).replace(f2, t2).replace(f3, t3).replace(f4, t4);
}
| [
"mapron1@gmail.com"
] | mapron1@gmail.com |
f1472f2e47bd6e840d28f5f37dafa5b760cb9e94 | 2ae76b911b189aa971cb88b68382580ba30128b4 | /SapphireBase/SapphireCPakReader.cpp | 0ef71864566e1cd2a796a82fa95fa92224d2cfdf | [] | no_license | zxycode007/Sapphire | c863733e69523d03b19c2f6db9ec67498aec282b | 710f538d1c0fe0a70f49d35a5c70d4ce6d133b9f | refs/heads/master | 2021-01-21T04:54:55.316069 | 2016-06-24T10:38:58 | 2016-06-24T10:38:58 | 45,906,974 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,982 | cpp | #include "SapphireCPakReader.h"
#ifdef _SAPPHIRE_COMPILE_WITH_PAK_ARCHIVE_LOADER_
#include "SapphireOS.h"
#include "SapphireCoreUtil.h"
namespace Sapphire
{
inline bool isHeaderValid(const SPAKFileHeader& header)
{
const c8* tag = header.tag;
return tag[0] == 'P' &&
tag[1] == 'A' &&
tag[2] == 'C' &&
tag[3] == 'K';
}
//! Constructor
CArchiveLoaderPAK::CArchiveLoaderPAK(IFileSystem* fs)
: FileSystem(fs)
{
#ifdef _DEBUG
setDebugName("CArchiveLoaderPAK");
#endif
}
//! returns true if the file maybe is able to be loaded by this class
bool CArchiveLoaderPAK::isALoadableFileFormat(const path& filename) const
{
return hasFileExtension(filename, "pak");
}
//! Check to see if the loader can create archives of this type.
bool CArchiveLoaderPAK::isALoadableFileFormat(E_FILE_ARCHIVE_TYPE fileType) const
{
return fileType == EFAT_PAK;
}
//! Creates an archive from the filename
/** \param file File handle to check.
\return Pointer to newly created archive, or 0 upon error. */
IFileArchive* CArchiveLoaderPAK::createArchive(const path& filename, bool ignoreCase, bool ignorePaths) const
{
IFileArchive *archive = 0;
IReadFile* file = FileSystem->createAndOpenFile(filename);
if (file)
{
archive = createArchive(file, ignoreCase, ignorePaths);
file->drop();
}
return archive;
}
//! creates/loads an archive from the file.
//! \return Pointer to the created archive. Returns 0 if loading failed.
IFileArchive* CArchiveLoaderPAK::createArchive(IReadFile* file, bool ignoreCase, bool ignorePaths) const
{
IFileArchive *archive = 0;
if (file)
{
file->seek(0);
archive = new CPakReader(file, ignoreCase, ignorePaths);
}
return archive;
}
//! Check if the file might be loaded by this class
/** Check might look into the file.
\param file File handle to check.
\return True if file seems to be loadable. */
bool CArchiveLoaderPAK::isALoadableFileFormat(IReadFile* file) const
{
SPAKFileHeader header;
file->read(&header, sizeof(header));
return isHeaderValid(header);
}
/*!
PAK Reader
*/
CPakReader::CPakReader(IReadFile* file, bool ignoreCase, bool ignorePaths)
: CFileList((file ? file->getFileName() : path("")), ignoreCase, ignorePaths), File(file)
{
#ifdef _DEBUG
setDebugName("CPakReader");
#endif
if (File)
{
File->grab();
scanLocalHeader();
sort();
}
}
CPakReader::~CPakReader()
{
if (File)
File->drop();
}
const IFileList* CPakReader::getFileList() const
{
return this;
}
bool CPakReader::scanLocalHeader()
{
SPAKFileHeader header;
// Read and validate the header
File->read(&header, sizeof(header));
if (!isHeaderValid(header))
return false;
// Seek to the table of contents
#if (SAPPHIRE_CONFIG_ENDIAN == SAPPHIRE_BIG_ENDIAN)
header.offset = Byteswap::byteswap(header.offset);
header.length = Byteswap::byteswap(header.length);
#endif
File->seek(header.offset);
const int numberOfFiles = header.length / sizeof(SPAKFileEntry);
// Loop through each entry in the table of contents
for (int i = 0; i < numberOfFiles; i++)
{
// read an entry
SPAKFileEntry entry;
File->read(&entry, sizeof(entry));
#ifdef _DEBUG
Printer::log(entry.name);
#endif
#if (SAPPHIRE_CONFIG_ENDIAN == SAPPHIRE_BIG_ENDIAN)
entry.offset = Byteswap::byteswap(entry.offset);
entry.length = Byteswap::byteswap(entry.length);
#endif
addItem(path(entry.name), entry.offset, entry.length, false);
}
return true;
}
//! opens a file by file name
IReadFile* CPakReader::createAndOpenFile(const path& filename)
{
SINT32 index = findFile(filename, false);
if (index != -1)
return createAndOpenFile(index);
return 0;
}
//! opens a file by index
IReadFile* CPakReader::createAndOpenFile(UINT32 index)
{
if (index >= Files.size())
return 0;
const SFileListEntry &entry = Files[index];
return createLimitReadFile(entry.FullName, File, entry.Offset, entry.Size);
}
}
#endif | [
"373982141@qq.com"
] | 373982141@qq.com |
47388ead7dc2fc0fd579ef43bc02c20bdd8b367a | 55b8cf2aa4bf6d58106c124f011da1dd8a627045 | /ceres_fit.cpp | 1a5f4bbe49972e5a01bb86fd8b4bf17cebbf71d7 | [] | no_license | Artemkth/cfitter | 4776ab059563ec01ae5feaa24dfeb88f86c7eae5 | 0a8b35490dc1b0970406752ff6051bfbbcb2c3c9 | refs/heads/master | 2021-07-05T04:39:11.609218 | 2020-09-10T07:40:25 | 2020-09-10T07:40:25 | 171,827,150 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 6,186 | cpp | //core interface definitions
#include"ceres_fit.h"
//for core algebraic functions
#include<cmath>
typedef std::pair<std::array<double, 3>, std::vector<double>> CPair;
//inline function to return rotation matrix(for fit with elliptic core)
inline Eigen::Matrix<double, 2, 2> rotMatrix(const double& phi) {
Eigen::Matrix<double, 2, 2> retMatrix;
retMatrix << cos(phi), -sin(phi),
sin(phi), cos(phi);
return retMatrix;
}
#ifndef M_PI
constexpr double M_PI = 3.14159265358979323846;
#endif
//functors for ceres fitting
//radial
class RadialGaussFtor : public ceres::SizedCostFunction<1, 2, 1, 1> {
private:
CPair VFPoint;
public:
RadialGaussFtor(const CPair& pnt) :VFPoint(pnt)
{}
bool Evaluate(double const* const* parameters,
double* residuals,
double** jacobians) const
{
//symbols for block parameters
const double& x = VFPoint.first[0];
const double& y = VFPoint.first[1];
//first row of parameters is to be supposed coordinate of the peak
const double& x0 = parameters[0][0];
const double& y0 = parameters[0][1];
//second row is only radius
const double& r = parameters[1][0];
//only failure scenario is one of the radii being lower or equal to zero
if (r <= 0.)
return false;
//third row is "amplitude"
const double& am = parameters[2][0];
//useful thing to precalculate
double expFactor = exp(-((x - x0) * (x - x0) + (y - y0) * (y - y0)) / (2. * r * r));
//manual promises that residuals is never NULL
//and there should be only one :p
residuals[0] = VFPoint.second[2] - am * expFactor ;
//if jacobian array is nullptr there is no jacobian terms to compute
if (jacobians == nullptr)
return true;
//first row is derivatives due to assumed position
if (jacobians[0] != nullptr)
{
jacobians[0][0] = - (x - x0) * expFactor / (2. * r * r);
jacobians[0][1] = - (y - y0) * expFactor / (2. * r * r);
}
//radius row derivatives
if (jacobians[1] != nullptr)
jacobians[1][0] = -((x - x0) * (x - x0) + (y - y0) * (y - y0)) * expFactor / (2. * r * r * r);
//amplitude derivative
if (jacobians[2] != nullptr)
jacobians[2][0] = - expFactor;
//nothing here should fail, right?
return true;
}
};
//functors for ceres fitting
//elliptical
class ElipticalGaussFtor : public ceres::SizedCostFunction<1, 2, 2, 1, 1> {
private:
CPair VFPoint;
public:
ElipticalGaussFtor(const CPair& pnt) :VFPoint(pnt)
{}
bool Evaluate(double const* const* parameters,
double* residuals,
double** jacobians) const
{
//first row of parameters is to be supposed coordinate of the peak
const double& x0 = parameters[0][0];
const double& y0 = parameters[0][1];
//relative position vector
Eigen::Matrix<double, 2, 1> dispVect;
dispVect << (VFPoint.first[0] - x0), (VFPoint.first[1] - y0);
//second row is radii of minor and major axis
const double& rx = parameters[1][0];
const double& ry = parameters[1][1];
//only failure scenario is one of the radii being exact zero(avoiding div 0)
if (rx <= 0.||ry <= 0.)
return false;
//initialize diagonalized dispersion matrix
Eigen::DiagonalMatrix<double, 2> rDiag;
rDiag.diagonal() << 1. / (2. * rx * rx), 1. / (2. * ry * ry);
//third row is rotation angle
const double& phi = parameters[2][0];
auto rmat = rotMatrix(phi);
//rotated dispersion matrix
auto DispMat = rmat * rDiag * rmat.transpose();
//exp parameter
Eigen::Matrix<double, 1, 1> eparam = dispVect.transpose() * DispMat * dispVect;
//useful thing to precalculate
double expFactor = exp(-eparam(0, 0));
//fourth row is "amplitude"
const double& am = parameters[3][0];
//manual promises that residuals is never NULL
//and there should be only one :p
residuals[0] = VFPoint.second[2] - am * expFactor;
//if jacobian array is nullptr there is no jacobian terms to compute
if (jacobians == nullptr)
return true;
//first row is derivatives due to assumed position
if (jacobians[0] != nullptr)
{
auto grad = 2. * expFactor * DispMat * dispVect;
jacobians[0][0] = - grad(0, 0);
jacobians[0][1] = - grad(1, 0);
}
//radius row derivatives
if (jacobians[1] != nullptr)
{
Eigen::DiagonalMatrix<double, 2> tmp;
tmp.diagonal() << 1. / (rx * rx * rx), 0.;
Eigen::Matrix<double,1,1> res = expFactor * dispVect.transpose() * rmat * tmp * rmat.transpose() * dispVect;
jacobians[1][0] = - res(0, 0);
tmp.diagonal() << 0., 1. / (ry * ry * ry);
res = expFactor * dispVect.transpose() * rmat * tmp * rmat.transpose() * dispVect;
jacobians[1][1] = - res(0, 0);
}
//angle row derivate
if (jacobians[2] != nullptr)
{
auto drotMat = rotMatrix(phi + M_PI / 2.0);
auto res = expFactor * dispVect.transpose() * ( drotMat * rDiag * rmat.transpose() + rmat * rDiag * drotMat.transpose() ) * dispVect;
jacobians[2][0] = - res(0, 0);
}
//amplitude derivative
if (jacobians[3] != nullptr)
jacobians[3][0] = - expFactor;
//nothing here should fail, right?
return true;
}
};
CeresFitEngine::CeresFitEngine()
{
options.max_num_iterations = 100;
options.linear_solver_type = ceres::DENSE_QR;
options.minimizer_type = ceres::TRUST_REGION;
}
CGaussParams<double> CeresFitEngine::fitVortCoreCGauss(const std::vector<CPair>& pts, const std::array<double, 2>& initPos, const double& initR)
{
CGaussParams<double> result;
result.pos = initPos;
result.r = initR;
double am = 1.;
ceres::Problem problem;
for (const auto& x : pts)
problem.AddResidualBlock(
new RadialGaussFtor(x),
nullptr,
result.pos.data(),
&result.r,
&am
);
ceres::Solve(options, &problem, &summary);
return result;
}
EGaussParams<double> CeresFitEngine::fitVortCoreEGauss(const std::vector<CPair>& pts, const std::array<double, 2>& initPos,
const std::array<double, 2>& initR, const double& initAng)
{
EGaussParams<double> result;
result.pos = initPos;
result.prAxis = initR;
result.angle = initAng;
double am = 1.;
ceres::Problem problem;
for (const auto& x : pts)
problem.AddResidualBlock(
new ElipticalGaussFtor(x),
nullptr,
result.pos.data(),
result.prAxis.data(),
&result.angle,
&am
);
ceres::Solve(options, &problem, &summary);
return result;
}
| [
"artemb@kth.se"
] | artemb@kth.se |
ea8b6ee0388c5aa2b14f25a4fd8877dd90a5e400 | d71d6eefa6337e480111a5af12180f34df6f9270 | /MTT/Current/Testcom2.cpp | 61353728312ab1777a6bfdc1dab274a606484a61 | [] | no_license | renconan/qt | fc2b3f4a07630e34ed9acdfaf94e6db99791fcc9 | c19154874ba9f48ee99e91c7999e9c8856cb3a80 | refs/heads/master | 2021-01-22T07:58:45.174666 | 2017-09-06T01:22:01 | 2017-09-06T02:51:52 | 102,321,688 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 119,771 | cpp | #include <string.h>
#include <QTime>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <assert.h>
#include <ctype.h>
#include "Config.h"
#include "Defpam.h"
#ifdef ARMLINUX
#include <unistd.h> //write read
#endif
extern float StartCurrent,EndCurrent,ActStep;
extern TEMPRORARYDATA *temprorarydata;
extern unsigned char result[70],receive_data[70];
extern double out_time,change_timedata;
extern float LogicResolution;
extern float FreqRevision,VaPhaseRevision,VbPhaseRevision,VcPhaseRevision;
extern float IaPhaseRevision,IbPhaseRevision,IcPhaseRevision;
extern float V1RelaPhase,V2RelaPhase,V3RelaPhase,I1RelaPhase,I2RelaPhase,I3RelaPhase;
unsigned char ID=0x00,response[3];
double max_output_v_a; //,max_f_v_a=50,min_f_v_a=0.5,output_offset_v_a=0,amp_v_a=360;
double max_output_v_b; //,max_f_v_b=50,min_f_v_b=0.5,output_offset_v_b=0,amp_v_b=120;
double max_output_v_c; //,max_f_v_c=50,min_f_v_c=0.5,output_offset_v_c=0,amp_v_c=240;
double max_output_v_z;
double max_output_i_a;//,max_f_i_a=50,min_f_i_a=0.5,output_offset_i_a=0,amp_i_a=75;
double max_output_i_b;//,max_f_i_b=50,min_f_i_b=0.5,output_offset_i_b=0,amp_i_b=195;
double max_output_i_c;//,max_f_i_c=50,min_f_i_c=0.5,output_offset_i_c=0,amp_i_c=315;
extern float MAX_V_VALUEDATA_DC,MAX_V_VALUEDATA_AC,MIN_V_VALUEDATA_DC,MIN_V_VALUEDATA_AC;
extern float MAX_I_VALUEDATA_DC,MAX_I_VALUEDATA_AC,MIN_I_VALUEDATA_DC,MIN_I_VALUEDATA_AC;
extern int V1DC;
unsigned char data_i_a[70],data_i_b[70],data_i_c[70],data_v_b[70],data_v_a[70],data_v_c[70],data_v_z[70];
unsigned char alive_status=0;
extern float faultduration;
int is_digit(unsigned char ch)
{
if(ch>='0'&&ch<='9')
return 1;
else
return 0;
}
int is_space(unsigned char ch)
{
if(ch==' ')
return 1;
else
return 0;
}
double my_atof(unsigned char *s)
{
double power,value;
int i,sign;
assert(s!=NULL);//ÅжÏ×Ö·ûŽ®ÊÇ·ñΪ¿Õ
for(i=0;is_space(s[i]);i++);//³ýÈ¥×Ö·ûŽ®Ç°µÄ¿Õžñ
sign=(s[i]=='-')?-1:1;
if(s[i]=='-'||s[i]=='+')//ÒªÊÇÓзûºÅλŸÍǰœøÒ»Î»
i++;
for(value=0.0;is_digit(s[i]);i++)//ŒÆËãСÊýµãÇ®µÄÊý×Ö
value=value*10.0+(s[i]-'0');
if(s[i]=='.')
i++;
for(power=1.0;is_digit(s[i]);i++)//ŒÆËãСÊýµãºóµÄÊý×Ö
{
value=value*10.0+(s[i]-'0');
power*=10.0;
}
return sign*value/power;
}
unsigned long pow_my(int base,int n)
{
unsigned long result=1;
while(n-->0)
{
result *= base;
}
return result;
}
/*-----------------------------------------------------------------------------
º¯ÊýÃû: serial_read
²ÎÊý: int fd,char *str,unsigned int len,unsigned int timeout
·µ»ØÖµ: Ôڹ涚µÄʱŒäÄÚ¶ÁÈ¡ÊýŸÝ£¬³¬Ê±ÔòÍ˳ö£¬³¬Ê±Ê±ŒäΪmsŒ¶±ð
ÃèÊö: ÏòfdÃèÊö·ûµÄŽ®¿ÚœÓÊÕÊýŸÝ£¬³€¶ÈΪlen£¬ŽæÈëstr£¬timeout Ϊ³¬Ê±Ê±Œä
*-----------------------------------------------------------------------------*/
int serial_read(int fd, unsigned char *str, unsigned int len,unsigned char *cmp_data,int cmp_len)
{
int ret; //ÿŽÎ¶ÁµÄœá¹û
int sret; //selectŒà¿Øœá¹û
int readlen = 0; //ʵŒÊ¶ÁµœµÄ×ÖœÚÊý
unsigned char * ptr;
unsigned int ii=50000;
ptr = str;
while(readlen<len&&ii>0)
{
ret=read(fd,ptr,1);
if(ret <0)
{
perror("read err:");
break;
}
else if(ret == 0)
{
ii--;
continue;
}
if(readlen<cmp_len)
{
if((*ptr^(*cmp_data))!=0)
{
cmp_data-=readlen;
ptr-=readlen;
readlen=0;
continue;
}
cmp_data++;
}
ii=50000;
readlen += ret; //žüжÁµÄ³€¶È
ptr += ret;
}
return readlen;
}
#ifdef ARMLINUX
//check_f ÊÇ·ñÐèҪУÑé Ö÷ÒªÐèÒªžÄÕâžöº¯Êý
int receive_send(int fd,unsigned char *Send_str,int Send_len,unsigned char *cmp_data,int Receive_len,int cmp_len,int check_f)
{
unsigned char send_checksum,receive_checksum;
unsigned char *ptr,*ptr1;
int reclen=0;
unsigned char buff[512];
int i=0;
ptr=Send_str;
ptr1=Send_str;
send_checksum=0,receive_checksum=0;
if(Send_len!=0)
{
for(i=0;i<Send_len;i++)
{
send_checksum=*ptr^send_checksum;
ptr++;
}
// write(fd,Send_str,Send_len); //·¢ËÍ×Ö·û³öÈ¥
*(Send_str+Send_len)=send_checksum;
// *(Send_str+Send_len)=send_checksum;
write(fd,Send_str,Send_len+1); //·¢ËÍ×Ö·û³öÈ¥
// write(fd,&send_checksum,1); //·¢ËÍУÑéÂë
}
if(Receive_len!=0)
{
// delayus(100);
reclen= serial_read(fd,receive_data,Receive_len+check_f,cmp_data,cmp_len);
if(reclen==(Receive_len+check_f))
{
if(memcmp(cmp_data,receive_data,cmp_len)==0) //Èç¹û±ÈœÏµÄ×Ö·û²»¶Ô Ôò·µ»Ø-1
return 1;
else return -1;
}
else return -1;
}
return 1;
}
int transmit(int fd, unsigned char *buffer,int length, int length2)
{
unsigned char ackpacket[5]={0x0f,0x5a,0xf0,0xa5,0x00};
unsigned char send_data1[70]={0xa5,0xa5,0xa5,0xa5};
int send_len,re_len,cmp_len;
int i;
send_len=length+1;
if(length2)
re_len=(length2-1)+5;
else
re_len=5;
cmp_len=5;
send_data1[4]=0x00; //ÕâÀïÊÇ·ñÓÐÎÊÌâ
buffer=buffer+4;
for(i=0;i<length-4;i++)
{
send_data1[5+i]=*buffer; // ·¢Ë͵ÄÊýŸÝsend_data1
buffer++;
}
while(1)
{
i=receive_send(fd,send_data1,send_len,ackpacket,re_len,cmp_len,0);
if(i==1)
{
for(i=0;i<length2;i++)
result[i]=receive_data[5+i]; //receive_data ǰ5λÊÇÓŠŽðÐźÅ
memset(receive_data,0,70);
return(0);
}
memset(receive_data,0,70);
}
} /*µçѹ,µçÁ÷ARTÏà¶ÔÖµŒÆËã*/
int chang_amp(double out_value,double *max_output_data)
{
int i;
if(out_value>*max_output_data)
out_value=*max_output_data;
i=(int)(out_value/(*max_output_data)*32767);
if(abs(i)>32766)
i=i/abs(i)*32766;
return(i);
}
//2016-06-01
int chang_ampStep(double out_value,double *max_output_data)
{
int i;
if(out_value>*max_output_data)
out_value=*max_output_data;
i=(int)(out_value/(*max_output_data)*8388608);
if(abs(i)>8388608)
i=i/abs(i)*8388608;
return(i);
}
void frec(double x,int length,unsigned char *buffer)
{
char data1,data2;
int i;
x=x-(int)x;
for(i=0;i<length;i++)
{
x=x*16;
data1=(int)(x);
data1=data1<<4;
x=x-(int)x;
x=x*16;
data2=(int)(x);
buffer[i]=data1|data2;
x=x-(int)x;
}
buffer[i]=NULL;
return;
}
void frec1( const float f, int BitsInt, int Bytes,unsigned char *rt)
{
unsigned char intBytes[5]={0,0,0,0,0}; //float Bytes[4];
int i;
union {
char B[4];
long L;
} CB;
short i1, i2;
// integer part
//IntPart = abs((int)f)*(int)pow(2, (16-BitsInt));
/*for(int i=0; i<2; i++)
intBytes[i] =0x00;// BytePart[1-i];*/
// fraction part
CB.L =(long)((fabs(f)-abs((int)f))*pow(2, (Bytes*8-BitsInt)));
i2 = BitsInt/8;
i1 = Bytes - i2; // bytes of fraction part
for (i=0; i<i1; i++)
intBytes[i+i2] += CB.B[i1-i-1];
// singed value
/*if (Signed)
{
if (f<0 && intBytes[0] < 112)
intBytes[0] += 112; // 0x80
else if (f>0 && intBytes[0] >= 112)
intBytes[0] -= 112; // 0x80
}*/
for(i=0; i<Bytes;i++)
*rt++ = intBytes[i];
return;
}
char *strncat1( char *buffer,char *buffer1)
{
int i,j;
for(i=0;buffer[i]!=NULL;)
i++;
for(j=0;buffer1[j]!=NULL;j++,i++)
buffer[i]=buffer1[j];
buffer[i]=NULL;
return(buffer);
}
unsigned char autoc(unsigned char *p)
{
unsigned char data,temp;
if( memcmp(p,"0x",2)==0 )
{
temp=*(p+2);
if(temp>='0'&&temp<='9')
data=(temp-48)<<4;
else if(temp>='A'&&temp<='F')
data=(temp-55)<<4;
else if(temp>='a'&&temp<='f')
data=(temp-87)<<4;
temp=*(p+3);
if(temp>='0'&&temp<='9')
data=data|(temp-48);
else if(temp>='A'&&temp<='F')
data=data|(temp-55);
else if(temp>='a'&&temp<='f')
data=data|(temp-87);
return(data);
}
else
return(0);
}
//×ÖŽ®ÃüÁîœâÊͳÌÐò
void artExec(int fd, char *command_str,unsigned char *result1,int max_result_length)
{
unsigned char *p1,*p2,*p3,*p4,data_cmp[70],data1,data2,data_cmp1[70];
unsigned char sys_data[40],inp_data[40],seq_data[40],amp_data[40],out_data2[70],*out_data;
int i,j,k,length,status=0;
double x,max_output;
int y;
long time_out;
float startvalue,endvalue,actstep;
int tripvalue,returnvalue;
p4=(unsigned char *)command_str;
p1=(unsigned char *)command_str;
p2=p1;
if(memcmp(p1,"sys:",4)==0) //system commands
{
for(i=0;i<40;i++)
sys_data[i]=0x00;
for(i=0;i<4;i++)
sys_data[i]=0xa5;
p1=p1+4;
if(memcmp(p1,"reset",5)==0)
{
sys_data[4]=0x00;
sys_data[5]=0x03;
sys_data[6]=0x01; //command: sys:reset,[01].function:execute a reset on an ART device.two bytes respomse.
length=7;
}
else if(memcmp(p1,"test?",5)==0)
{
sys_data[4]=0x00;
sys_data[5]=0x03;
sys_data[6]=0x02; //command: sys:test? [02].function:start self test of an ART device.two bytes response.
length=7;
}
else if(memcmp(p1,"cfg?",4)==0)
{
sys_data[4]=0x00;
sys_data[5]=0x03;
sys_data[6]=0x03; //command: sys:cfg? [03].function: get system information of an ART device.twenty three bytes respponse.
length=7; //include:ART serial number
}
else if(memcmp(p1,"status?",7)==0)
{
sys_data[4]=0x00;
sys_data[5]=0x04;
sys_data[6]=0x04; //commande: sys:status?[(<bit_number>)] [04].funtion: get status of an ART device.two bytes response.
p1=p1+7;
if(p1==NULL)
sys_data[7]=0x00;
else
sys_data[7]=*p1|0x1f;
length=8;
}
else if(memcmp(p1,"rptrps",6)==0)
{
sys_data[4]=0x00;
sys_data[5]=0x03;
sys_data[6]=0x05; //command: sys:rptrps [05].function:request to resend last resopnse.no response.
length=7;
}
else if(memcmp(p1,"flash:run",9)==0)
{
sys_data[4]=0x00;
sys_data[5]=0x03;
sys_data[6]=0x0e;
length=7;
}
transmit(fd,sys_data,length,max_result_length);
}
else if(memcmp(p1,"out:",4)==0) //output commands
{
p1=p1+4;
if(memcmp(p1,"ana:",4)==0)
{
for(i=0;i<39;i++)
{
out_data2[i]=0x00;
}
for(i=0;i<4;i++)
{
out_data2[i]=0xa5;
data_v_a[i]=0xa5;
data_i_a[i]=0xa5;
data_v_b[i]=0xa5;
data_i_b[i]=0xa5;
data_v_c[i]=0xa5;
data_i_c[i]=0xa5;
data_v_z[i]=0xa5;
}
p1=p1+4;
if(memcmp(p1,"v(",2)==0)
{
p2=p1+7;
if(memcmp(p2,"on",2)==0)
{
out_data2[4]=0x00; //command: out:[ana:]v(<generator>):on OR out:[ana:]on [11].
out_data2[5]=0x04; //function:Switch on all generators listed in <generator_list>.
out_data2[6]=0x11; //Switch on all defined generators if the 2nd byte is all ones.
if(memcmp(p1,"v(1:",4)==0)
out_data2[7]=0x00;
else if(memcmp(p1,"v(2:",4)==0)
out_data2[7]=0x04;
else if(memcmp(p1,"v(3:",4)==0)
out_data2[7]=0x08;
else if(memcmp(p1,"v(4:",4)==0)
out_data2[7]=0x0c;
p1=p1+4;
data1=(p1[0]&0x3)-1;
out_data2[7]=out_data2[7]|data1;
if (out_data2[7]==0xff)
out_data2[7]=0x03;
length=8;
transmit(fd,out_data2,length,max_result_length);
}
else if(memcmp(p2,"off",3)==0)
{
out_data2[4]=0x00;
out_data2[5]=0x04;
out_data2[6]=0x12;
if(memcmp(p1,"v(1:",4)==0)
out_data2[7]=0x00;
else if(memcmp(p1,"v(2:",4)==0)
out_data2[7]=0x04;
else if(memcmp(p1,"v(3:",4)==0)
out_data2[7]=0x08;
else if(memcmp(p1,"v(4:",4)==0)
out_data2[7]=0x0c;
p1=p1+4;
data1=(p1[0]&0x3)-1;
out_data2[7]=out_data2[7]|data1;
if (out_data2[7]==0xff)
out_data2[7]=0x03;
length=8;
transmit(fd,out_data2,length,max_result_length);
}
else
{
if(memcmp(p1,"v(1:",4)==0)
{
p2=p1+4;
if(memcmp(p2,"1):",3)==0)
{
max_output=max_output_v_a;
out_data=data_v_a;
data1=0x00;
}
else if(memcmp(p2,"2):",3)==0)
{
out_data=data_v_b;
max_output=max_output_v_b;
data1=0x01;
}
else if(memcmp(p2,"3):",3)==0)
{
out_data=data_v_c;
max_output=max_output_v_c;
data1=0x02;
}
else if(memcmp(p2,"4):",3)==0)
{
out_data=data_v_z;
max_output=max_output_v_z;
data1=0x03;
}
out_data[8]=0x00;
out_data[9]=out_data[9]&0xfb;
out_data[7]=data1;
}
else if(memcmp(p1,"v(2:",4)==0)
{
p2=p1+4;
if(memcmp(p2,"1):",3)==0)
{
out_data=data_i_a;
max_output=max_output_i_a;
data1=0x04;
}
else if(memcmp(p2,"2):",3)==0)
{
out_data=data_i_b;
max_output=max_output_i_b;
data1=0x05;
}
else if(memcmp(p2,"3):",3)==0)
{
out_data=data_i_c;
max_output=max_output_i_c;
data1=0x06;
}
out_data[7]=data1;
out_data[8]=0x10;
out_data[9]=out_data[9]|0x04;
}
else if(memcmp(p1,"v(3:",4)==0)
out_data[7]=0x08;
else if(memcmp(p1,"v(4:",4)==0)
out_data[7]=0x0c;
out_data[4]=0x00;
out_data[5]=0x37;
out_data[6]=0x10;
p1=p1+7;
if(memcmp(p1,"sig1:",5)==0)
{
status=0;
p2=out_data+11;
k=1;
}
else if(memcmp(p1,"sig2:",5)==0)
{
status=1;
p2=out_data+23;
k=2;
}
p1=p1+5;
if(memcmp(p1,"a(",2)==0)
{
p1=p1+2;
for(i=0;*p1!=NULL;i++)
data_cmp[i]=*p1++;
data_cmp[i]='\0';
x=my_atof(data_cmp);
p1=p1-5;
if(memcmp(p1,"step",4)==0)
{
y=chang_ampStep(x,&max_output);
p2[25]=(unsigned char)(y>>8);
p2[24]=(unsigned char)(y>>16);
p2[26]=(unsigned char)y;
p2[27]=0x00;
}
else
{
y=chang_amp(x,&max_output);
p2[1]=(unsigned char)y;
p2[0]=(unsigned char)(y>>8);
p2[2]=0x00;
p2[3]=0x00;
}
}
else if(memcmp(p1,"f(",2)==0)
{
p1=p1+2;
for(i=0;*p1!=NULL;i++)
data_cmp[i]=*p1++;
data_cmp[i]='\0'; //NULL;
x=my_atof(data_cmp);
y=(int)fabs(x);
p1=p1-5;
if(memcmp(p1,"step",4)==0)
{
p2[29]=(unsigned char)y; /* //p3[0]; */
p2[28]=(unsigned char)(y>>8); /* //p3[1]; */
//frec(x,2,data_cmp1);
frec1(x,16,5,data_cmp1);
p2[30]=data_cmp1[2];
p2[31]=data_cmp1[3];
p2[32]=data_cmp1[4];
//p2[30]=data_cmp1[0];
// p2[31]=data_cmp1[1];
if (x<0 && p2[28] < 0x80)
p2[28]+=0x80;
else if (x>0 && p2[28] >= 0x80)
p2[28]-=0x80;
}
else
{
p2[5]=(unsigned char)y; /* //p3[0]; */
p2[4]=(unsigned char)(y>>8); /* //p3[1]; */
// frec(x,2,data_cmp1);
// p2[6]=data_cmp1[0];
// p2[7]=data_cmp1[1];
frec1(x,16,5,data_cmp1);
p2[6]=data_cmp1[2];
p2[7]=data_cmp1[3];
p2[8]=data_cmp1[4];
}
}
else if(memcmp(p1,"p(",2)==0)
{
p1=p1+2;
for(i=0;*p1!=NULL;i++)
data_cmp[i]=*p1++;
data_cmp[i]='\0';/*NULL;*/
x=my_atof(data_cmp);
y=(int)x;
data2=(unsigned char)y;
data1=(unsigned char)(y>>8);
p1=p1-5;
if(memcmp(p1,"step",4)==0)
{
p2[33]=(data1<<6)|(data2>>2);
p2[34]=data2<<6;
//frec1(x,10,3,data_cmp1);
frec(x,2,data_cmp1);
//p2[34]=p2[10]|(data_cmp1[0]>>2);//07-7-13 18:17œâÊÍÏàλ²œ³€ŽíÎ󣬵ŒÖÂÏàλ×Ô¶¯Ôڱ仯
p2[34]=p2[34]|(data_cmp1[0]>>2);
p2[35]=(data_cmp1[0]<<6)|(data_cmp1[1]>>2);
/*frec1(x,10,3,data_cmp1);
p2[33]=data_cmp1[1];
p2[34]=data_cmp1[2];
p2[35]=data_cmp1[3];*/
}
else
{
p2[9]=(data1<<6)|(data2>>2);
p2[10]=data2<<6;
frec(x,2,data_cmp1);
//frec1(x,10,3,data_cmp1);
p2[10]=p2[10]|(data_cmp1[0]>>2);
p2[11]=(data_cmp1[0]<<6)|(data_cmp1[1]>>2);
/* frec1(x,10,3,data_cmp1);
// p2[9]=data_cmp1[1];
p2[10]=data_cmp1[1];
p2[11]=data_cmp1[2];*/
}
}
else if(memcmp(p1,"wav(",4)==0)
{
p1=p1+4;
if(memcmp(p1,"sin",3)==0)
{
if(k==1)
out_data[10]=out_data[10]&0x00;//0xf0
else if(k==2)
out_data[10]=out_data[10]&0x0f;
}
else if(memcmp(p1,"sum",3)==0)
{
p1=p1+3;
if(k==1)
{
out_data[10]=out_data[10]&0xf0;
out_data[10]=out_data[10]|0x8;
}
else if(k==2)
{
out_data[23]=out_data[23]&0xf;
out_data[23]=out_data[23]|0x80;
}
p1++;
if(memcmp(p1,"harmonic",8)==0)
{
p1=p1+8;
p1++;
for(i=0;p1[i]!=')';)
i++;
i--;
data2=0;
data1=1;
for(j=i;j>=0;j--)
{
data2=data2+(unsigned char)((p1[j]&0xf)*data1);
data1=(unsigned char)(data1*10);
}
if(k==1)
out_data[13]=data2;
else
out_data[25]=data2;
}
/* //Ä©Íê³É */
length=59;
}
else if(memcmp(p1,"tri",3)==0||memcmp(p1,"square",6)==0)
{
if(memcmp(p1,"square",6)==0)
{
if(k==1)
out_data[10]=(out_data[10]&0xf3)|0x3;
else if(k==2)
out_data[10]=(out_data[10]&0x3f)|0x30;
p1=p1+6;
}
else if(memcmp(p1,"tri",3)==0)
{
if(k==1)
out_data[10]=(out_data[10]&0xf2)|0x2;
else if(k==2)
out_data[10]=(out_data[10]&0x2f)|0x20;
p1=p1+3;
}
if(p1[0]!=')')
{
p1++;
for(i=0;p1[i]!=')';i++)
data_cmp[i]=p1[i];
data_cmp[i]='\0'; //NULL;
x=my_atof(data_cmp);
x=1/x/2*10000;
y=(int)x;
p2[3]=(unsigned char)(y>>8); //p3[1];
p2[4]=(unsigned char)y; //p3[0];
frec(x,1,data_cmp1);
p2[5]=data_cmp1[0];
x=my_atof(data_cmp);
x=1/x*10000;
y=(int)x;
p2[6]=(unsigned char)(y>>8); //p3[1];
p2[7]=(unsigned char)y; //p3[0];
frec(x,1,data_cmp1);
p2[8]=data_cmp1[0];
}
else
{
p2[2]=0;
p2[3]=0;
p2[4]=0xc8;
p2[5]=0;
p2[6]=01;
p2[7]=0x90;
}
}
else if(memcmp(p1,"dc",2)==0)
{
if(k==1)
out_data[10]=(out_data[10]&0xf0)|0x6;
else if(k==2)
out_data[10]=(out_data[10]&0xf)|0x60;
}
else if(memcmp(p1,"exp",3)==0)
{
if(k==1)
out_data[10]=(out_data[10]&0xf7)|0x7;
else if(k==2)
out_data[10]=(out_data[10]&0x7f)|0x70;
p1=p1+3;
if(p1[0]!=')')
{
p1++;
for(i=0;p1[i]!=')';i++)
data_cmp[i]=p1[i];
data_cmp[i]='\0'; //NULL;
x=my_atof(data_cmp);
x=x*100000000;
time_out=(long)(x);
p2[3]=(unsigned char)(time_out>>16);
p2[4]=(unsigned char)(time_out>>8);
p2[5]=(unsigned char)(time_out);
}
}
else if(memcmp(p1,"user",4)==0)
{
if(k==1)
{
out_data[10]=(out_data[10]&0xf4)|0x4;
p1=p1+4;
p1++;
for(i=0;p1[i]!=')'&&p1[i]!=',';)
i++;
i--;
data2=0;
data1=1;
for(j=i;j>=0;j--)
{
data2=data2+(unsigned char)((p1[j]&0xf)*data1);
data1=(unsigned char)(data1*10);
}
out_data[13]=data2;
}
else if(k==2)
{
out_data[10]=(out_data[10]&0x4f)|0x40;
p1=p1+4;
p1++;
for(i=0;p1[i]!=')'&&p1[i]!=',';)
i++;
i--;
data2=0;
data1=1;
for(j=i;j>=0;j--)
{
data2=data2+(unsigned char)((p1[j]&0xf)*data1);
data1=(unsigned char)(data1*10);
}
out_data[25]=data2;
}
}
length=59;
}
length=59;
}}
else if(memcmp(p1,"i(",2)==0)
{
p2=p1+7;
if(memcmp(p2,"on",2)==0)
{
out_data2[4]=0x00;
out_data2[5]=0x04;
out_data2[6]=0x11;
if(memcmp(p1,"i(1:1",5)==0)
out_data2[7]=0x04;
else if(memcmp(p1,"i(1:2",5)==0)
out_data2[7]=0x05;
else if(memcmp(p1,"i(1:3",5)==0)
out_data2[7]=0x06;
length=8;
transmit(fd,out_data2,length,max_result_length);
}
else if(memcmp(p2,"off",3)==0)
{
out_data2[4]=0x00;
out_data2[5]=0x04;
out_data2[6]=0x12;
if(memcmp(p1,"i(1:",4)==0)
out_data2[7]=0x00;
else if(memcmp(p1,"i(2:",4)==0)
out_data2[7]=0x04;
else if(memcmp(p1,"i(3:",4)==0)
out_data2[7]=0x08;
else if(memcmp(p1,"i(4:",4)==0)
out_data2[7]=0x0c;
p1=p1+4;
data1=(p1[0]&0x3)-1;
out_data2[7]=out_data2[7]|data1;
length=8;
transmit(fd,out_data2,length,max_result_length);
}
else
{
if(memcmp(p1,"i(1:",4)==0)
{
p2=p1+4;
if(memcmp(p2,"1):",3)==0)
{
max_output=max_output_i_a;
out_data=data_i_a;
data1=0x00;
}
else if(memcmp(p2,"2):",3)==0)
{
out_data=data_i_b;
max_output=max_output_i_b;
data1=0x01;
}
else if(memcmp(p2,"3):",3)==0)
{
out_data=data_i_c;
max_output=max_output_i_c;
data1=0x02;
}
out_data[8]=0x00;
out_data[9]=out_data[9]&0xfb;
out_data[7]=data1;
}
else if(memcmp(p1,"i(2:",4)==0)
{
p2=p1+4;
if(memcmp(p2,"1):",3)==0)
{
out_data=data_i_a;
max_output=max_output_i_a;
data1=0x04;
}
else if(memcmp(p2,"2):",3)==0)
{
out_data=data_i_b;
max_output=max_output_i_b;
data1=0x05;
}
else if(memcmp(p2,"3):",3)==0)
{
out_data=data_i_c;
max_output=max_output_i_c;
data1=0x06;
}
out_data[7]=data1;
out_data[8]=0x10;
out_data[9]=out_data[9]|0x04;
}
else if(memcmp(p1,"i(3:",4)==0)
out_data[7]=0x08;
else if(memcmp(p1,"i(4:",4)==0)
out_data[7]=0x0c;
out_data[4]=0x00;
out_data[5]=0x37;
out_data[6]=0x10;
p1=p1+7;
if(memcmp(p1,"sig1:",5)==0)
{
status=0;
p2=out_data+11;
k=1;
}
else if(memcmp(p1,"sig2:",5)==0)
{
status=1;
p2=out_data+23;
k=2;
}
p1=p1+5;
if(memcmp(p1,"a(",2)==0)
{
p1=p1+2;
for(i=0;*p1!=NULL;i++)
data_cmp[i]=*p1++;
data_cmp[i]='\0';//NULL;
x=my_atof(data_cmp);
p1=p1-5;
if(memcmp(p1,"step",4)==0)
{
y=chang_ampStep(x,&max_output);
p2[25]=(unsigned char)(y>>8);
p2[24]=(unsigned char)(y>>16);
p2[26]=(unsigned char)y;
p2[27]=0x00;
}
else
{
y=chang_amp(x,&max_output);
p2[1]=(unsigned char)y;
p2[0]=(unsigned char)(y>>8);
p2[2]=0x00;
p2[3]=0x00;
}
}
else if(memcmp(p1,"f(",2)==0)
{
p1=p1+2;
for(i=0;*p1!=NULL;i++)
data_cmp[i]=*p1++;
data_cmp[i]='\0'; //NULL;
x=my_atof(data_cmp);
y=(int)fabs(x);
p1=p1-5;
/* //p3=&y ; */
if(memcmp(p1,"step",4)==0)
{
p2[29]=(unsigned char)y; /* //p3[0]; */
p2[28]=(unsigned char)(y>>8); /* //p3[1]; */
frec(x,2,data_cmp1);
p2[30]=data_cmp1[0];
p2[31]=data_cmp1[1];
if (x<0 && p2[28] < 0x80)
p2[28]+=0x80;
else if (x>0 && p2[28] >= 0x80)
p2[28]-=0x80;
}
else
{
p2[5]=(unsigned char)y; /* //p3[0]; */
p2[4]=(unsigned char)(y>>8); /* //p3[1]; */
frec(x,2,data_cmp1);
p2[6]=data_cmp1[0];
p2[7]=data_cmp1[1];
}
}
else if(memcmp(p1,"p(",2)==0)
{
p1=p1+2;
for(i=0;*p1!=NULL;i++)
data_cmp[i]=*p1++;
data_cmp[i]='\0';/*NULL;*/
x=my_atof(data_cmp);
y=(int)x;
data2=(unsigned char)y;
data1=(unsigned char)(y>>8);
p1=p1-5;
if(memcmp(p1,"step",4)==0)
{
p2[33]=(data1<<6)|(data2>>2);
p2[34]=data2<<6;
frec(x,2,data_cmp1);
//p2[34]=p2[10]|(data_cmp1[0]>>2);//07-7-13 18:17œâÊÍÏàλ²œ³€ŽíÎ󣬵ŒÖÂÏàλ×Ô¶¯Ôڱ仯
p2[34]=p2[34]|(data_cmp1[0]>>2);
p2[35]=(data_cmp1[0]<<6)|(data_cmp1[1]>>2);
}
else
{
p2[9]=(data1<<6)|(data2>>2);
p2[10]=data2<<6;
frec(x,2,data_cmp1);
p2[10]=p2[10]|(data_cmp1[0]>>2);
p2[11]=(data_cmp1[0]<<6)|(data_cmp1[1]>>2);
}
}
else if(memcmp(p1,"wav(",4)==0)
{
p1=p1+4;
if(memcmp(p1,"sin",3)==0)
{
if(k==1)
out_data[10]=out_data[10]&0x00;//0xf0
else if(k==2)
out_data[10]=out_data[10]&0x0f;
}
else if(memcmp(p1,"sum",3)==0)
{
p1=p1+3;
if(k==1)
{
out_data[10]=out_data[10]&0xf0;
out_data[10]=out_data[10]|0x8;
}
else if(k==2)
{
out_data[23]=out_data[23]&0xf;
out_data[23]=out_data[23]|0x80;
}
p1++;
if(memcmp(p1,"harmonic",8)==0)
{
p1=p1+8;
p1++;
for(i=0;p1[i]!=')';)
i++;
i--;
data2=0;
data1=1;
for(j=i;j>=0;j--)
{
data2=data2+(unsigned char)((p1[j]&0xf)*data1);
data1=(unsigned char)(data1*10);
}
if(k==1)
out_data[13]=data2;
else
out_data[25]=data2;
}
/* //Ä©Íê³É */
length=59;
}
else if(memcmp(p1,"tri",3)==0||memcmp(p1,"square",6)==0)
{
if(memcmp(p1,"square",6)==0)
{
if(k==1)
out_data[10]=(out_data[10]&0xf3)|0x3;
else if(k==2)
out_data[10]=(out_data[10]&0x3f)|0x30;
p1=p1+6;
}
else if(memcmp(p1,"tri",3)==0)
{
if(k==1)
out_data[10]=(out_data[10]&0xf2)|0x2;
else if(k==2)
out_data[10]=(out_data[10]&0x2f)|0x20;
p1=p1+3;
}
if(p1[0]!=')')
{
p1++;
for(i=0;p1[i]!=')';i++)
data_cmp[i]=p1[i];
data_cmp[i]='\0'; //NULL;
x=my_atof(data_cmp);
x=1/x/2*10000;
y=(int)x;
p2[3]=(unsigned char)(y>>8); //p3[1];
p2[4]=(unsigned char)y; //p3[0];
frec(x,1,data_cmp1);
p2[5]=data_cmp1[0];
x=my_atof(data_cmp);
x=1/x*10000;
y=(int)x;
p2[6]=(unsigned char)(y>>8); //p3[1];
p2[7]=(unsigned char)y; //p3[0];
frec(x,1,data_cmp1);
p2[8]=data_cmp1[0];
}
else
{
p2[2]=0;
p2[3]=0;
p2[4]=0xc8;
p2[5]=0;
p2[6]=01;
p2[7]=0x90;
}
}
else if(memcmp(p1,"dc",2)==0)
{
if(k==1)
out_data[10]=(out_data[10]&0xf0)|0x6;
else if(k==2)
out_data[10]=(out_data[10]&0xf)|0x60;
}
else if(memcmp(p1,"exp",3)==0)
{
if(k==1)
out_data[10]=(out_data[10]&0xf7)|0x7;
else if(k==2)
out_data[10]=(out_data[10]&0x7f)|0x70;
p1=p1+3;
if(p1[0]!=')')
{
p1++;
for(i=0;p1[i]!=')';i++)
data_cmp[i]=p1[i];
data_cmp[i]='\0'; //NULL;
x=my_atof(data_cmp);
x=x*100000000;
time_out=(long)(x);
p2[3]=(unsigned char)(time_out>>16);
p2[4]=(unsigned char)(time_out>>8);
p2[5]=(unsigned char)(time_out);
}
}
else if(memcmp(p1,"user",4)==0)
{
if(k==1)
{
out_data[10]=(out_data[10]&0xf4)|0x4;
p1=p1+4;
p1++;
for(i=0;p1[i]!=')'&&p1[i]!=',';)
i++;
i--;
data2=0;
data1=1;
for(j=i;j>=0;j--)
{
data2=data2+(unsigned char)((p1[j]&0xf)*data1);
data1=(unsigned char)(data1*10);
}
out_data[13]=data2;
}
else if(k==2)
{
out_data[10]=(out_data[10]&0x4f)|0x40;
p1=p1+4;
p1++;
for(i=0;p1[i]!=')'&&p1[i]!=',';)
i++;
i--;
data2=0;
data1=1;
for(j=i;j>=0;j--)
{
data2=data2+(unsigned char)((p1[j]&0xf)*data1);
data1=(unsigned char)(data1*10);
}
out_data[25]=data2;
}
}
length=59;
}
length=59;
}}
else if(memcmp(p1,"mix:",4)==0)
{
p1=p1+4;
if(memcmp(p1,"v(",2)==0)
{
p1=p1+2;
if(p1[0]=='1')
{
p1=p1+2;
if(p1[0]=='1')
{
out_data=data_v_a;
out_data[7]=0x00;
out_data[8]=0x00;
}
if(p1[0]=='2')
{
out_data=data_v_b;
out_data[7]=0x01;
out_data[8]=0x00;
}
if(p1[0]=='3')
{
out_data=data_v_c;
out_data[7]=0x02;
out_data[8]=0x00;
}
if(p1[0]=='4')
{
out_data=data_v_z;
out_data[7]=0x03;
out_data[8]=0x00;
}
}
else if(p1[0]=='2')
{
p1=p1+2;
if(p1[0]=='1')
{
out_data=data_v_a;
out_data[7]=0x04;
out_data[8]=0x10;
}
if(p1[0]=='2')
{
out_data=data_v_b;
out_data[7]=0x05;
out_data[8]=0x10;
}
if(p1[0]=='3')
{
out_data=data_v_c;
out_data[7]=0x06;
out_data[8]=0x10;
}
if(p1[0]=='4')
{
out_data=data_v_z;
out_data[7]=0x07;
out_data[8]=0x10;
}
}
else if(p1[0]=='3')
{
p1=p1+2;
}
else if(p1[0]=='4')
{
p1=p1+2;
}
out_data[4]=0x00;
out_data[5]=0x37;
out_data[6]=0x10;
p1=p1+2;
if(memcmp(p1,"sig1",4)==0)
out_data[9]=out_data[9]&0x4;
else if(memcmp(p1,"add",3)==0)
{
out_data[9]=out_data[9]&0x05;
}
else if(memcmp(p1,"mult",4)==0)
out_data[9]=out_data[9]&0x06;
else if(memcmp(p1,"sum",3)==0)
out_data[9]=out_data[9]&0x07;
}
else if(memcmp(p1,"i(",2)==0)
{
p1=p1+2;
if(p1[0]=='1')
{
p1=p1+2;
if(p1[0]=='1')
{
out_data=data_i_a;
out_data[7]=0x04;
out_data[8]=0x00;
}
if(p1[0]=='2')
{
out_data=data_i_b;
out_data[7]=0x05;
out_data[8]=0x00;
}
if(p1[0]=='3')
{
out_data=data_i_c;
out_data[7]=0x06;
out_data[8]=0x00;
}
}
else if(p1[0]=='2')
{
p1=p1+2;
if(p1[0]=='1')
{
out_data=data_i_a;
out_data[7]=0x04;
out_data[8]=0x10;
}
if(p1[0]=='2')
{
out_data=data_i_b;
out_data[7]=0x05;
out_data[8]=0x10;
}
if(p1[0]=='3')
{
out_data=data_i_c;
out_data[7]=0x06;
out_data[8]=0x10;
}
}
else if(p1[0]=='3')
{
p1=p1+2;
}
else if(p1[0]=='4')
{
p1=p1+2;
}
out_data[4]=0x00;
out_data[5]=0x37;
out_data[6]=0x10;
p1=p1+2;
if(memcmp(p1,"sig1",4)==0)
out_data[9]=out_data[9]&0x4;
else if(memcmp(p1,"add",3)==0)
{
out_data[9]=out_data[9]&0x05;
}
else if(memcmp(p1,"mult",4)==0)
out_data[9]=out_data[9]&0x06;
else if(memcmp(p1,"sum",3)==0)
out_data[9]=out_data[9]&0x07;
}
length=59;
transmit(fd,out_data,length,max_result_length);
}
else if(memcmp(p1,"on",2)==0)
{
out_data2[4]=0x00;
out_data2[5]=0x04;
out_data2[6]=0x11;
out_data2[7]=0x00;
length=8;
transmit(fd,out_data2,length,max_result_length);
out_data2[7]=0x04;
transmit(fd,out_data2,length,max_result_length);
}
else if(memcmp(p1,"off",3)==0)
{
//µçѹµçÁ÷ÿÏà·Ö±ð¹Ø±Õ
length=8;
out_data2[4]=0x00;
out_data2[5]=0x04;
out_data2[6]=0x12;
out_data2[7]=0xc0;
transmit(fd,out_data2,length,max_result_length);
out_data2[7]=0xc1;
transmit(fd,out_data2,length,max_result_length);
out_data2[7]=0xc2;
transmit(fd,out_data2,length,max_result_length);
out_data2[7]=0xc3; //deng
transmit(fd,out_data2,length,max_result_length);
out_data2[7]=0xc4;
transmit(fd,out_data2,length,max_result_length);
out_data2[7]=0xc5;
transmit(fd,out_data2,length,max_result_length);
out_data2[7]=0xc6;
transmit(fd,out_data2,length,max_result_length);
}
/*else if(memcmp(p1,"clr",3)==0)
{
out_data2[4]=0x00;
out_data2[5]=0x03;
out_data2[6]=0x13;
length=7;
transmit(fd,(out_data2,length,max_result_length,result);
}030627*/
/* else if(memcmp(p1,"user:app",8)==0)
{
p1=p1+9;
out_data2[6]=0x15;
l=8;
for(i=0;p1[0]!=',';i++)
data_cmp[k]=p1[k];
data_cmp[k]=';';//NULL;
p1=p1+k+1;
i=atoi(data_cmp);
out_data2[7]=i;
for(j=0;p1[0]!=')';)
{
for(i=0;p1[0]!=','&&p1[0]!=')';i++)
data_cmp[i]=p1[i];
data_cmp[i]='\0';//NULL;
x=my_atof(data_cmp);
y=chang_amp(x,&max_output);
out_data2[l++]=(unsigned char)y;
out_data2[l++]=(unsigned char)(y>>8);
p1=p1+k;
if(p1[0]!=')')
p1=p1+1;
}
out_data2[4]=(l-4)>>8;
out_data2[5]=(l-4);
length=l;
transmit(fd,(out_data2,length,max_result_length,result);
}030627*/
/*else if(memcmp(p1,"user:init",9)==0)
{
p1=p1+10;
p2=p1;
out_data2[6]=0x14;
i=0;
j=0;
m=9;
l=10;
for(i=0;p2[0]!=')';i++)
{
for(j=0;p2[0]!=';';)
{
j++;
for(k=0;p2[k]!=','&&p2[k]!=')';k++)
data_cmp[k]=p2[k];
data_cmp[k]=';';//NULL;
p2=p2+k+1;
time_out=atoi(data_cmp);
out_data2[l++]=(unsigned char)(time_out>>8);
out_data2[l++]=(unsigned char)(time_out);
for(k=0;p2[k]!=','&&p2[k]!=';'&&p2[k]!=')';k++)
data_cmp[k]=p2[k];
data_cmp[k]=';'; //NULL;
p2=p2+k;
if(p2[0]!=';'&&p2[0]!=')')
p2=p2+1;
x=my_atof(data_cmp)/10000;
y=(int)x;
if(y>0)
{
out_data2[l++]=0x80;
out_data2[l++]=0x00;
out_data2[l++]=0x00;
}
else
{
frec(x,3,data_cmp1);
out_data2[l++]=data_cmp1[0];
out_data2[l++]=data_cmp1[1];
out_data2[l++]=data_cmp1[2];
}
}
if(p2[0]!=')')
p2=p2+1;
out_data2[m]=j+1;
m=l;
}
i++;
if(i<127)
{
out_data2[7]=i;
out_data2[8]=0;
}
else
{
out_data2[7]=127;
out_data2[8]=i-127;
}
out_data2[4]=(l-4)>>8;
out_data2[5]=(l-4);
length=l;
transmit(fd,(out_data2,length,max_result_length,result);
}030627*/
/* else if(memcmp(p1,"user:clr",8)==0)
{
p1=p1+8;
out_data2[4]=0x00;
out_data2[5]=0x04;
out_data2[6]=0x16;
if(p1[0]=='(')
{
for(k=0;p1[0]!=')';k++)
data_cmp[k]=p1[k];
data_cmp[k]=';';//NULL;
//p1=p1+k+1;
i=atoi(data_cmp);
out_data2[7]=i;
}
else
out_data2[7]=0x7f;
length=8;
transmit(fd,(out_data2,length,max_result_length,result);
}030627*/
/*else if(memcmp(p1,"user:mem?",9)==0)
{
p1=p1+9;
out_data2[4]=0x00;
out_data2[5]=0x04;
out_data2[6]=0x17;
if(p1[0]=='(')
{
for(k=0;p1[0]!=')';k++)
data_cmp[k]=p1[k];
data_cmp[k]=';';//NULL;
//p1=p1+k+1;
i=atoi(data_cmp);
out_data2[7]=i;
}
else
out_data2[7]=0x7f;
length=8;
transmit(fd,(out_data2,length,max_result_length,result);
} 030627*/
/* else if(memcmp(p1,"wtbl:app(",9)==0)
{
p1=p1+9;
wavetable[0]=0xa5;
wavetable[1]=0xa5;
wavetable[2]=0xa5;
wavetable[3]=0xa5;
wavetable[6]=0x18;
for(k=0;p1[k]!=',';k++)
data_cmp[k]=p1[k];
data_cmp[k]=';';//NULL;
p1=p1+k+1;
i=atoi(data_cmp);
wavetable[7]=i;
l=8;
for(;p1[0]!=')';)
{
for(i=0;p1[i]!=','&&p1[i]!=')';i++)
data_cmp[i]=p1[i];
data_cmp[i]='\0';//NULL;
x=my_atof(data_cmp);
y=(int)(x*32767);
if(abs(y)>32767)
y=y/abs(y)*32767;
//y=chang_amp(x,&max_output);
wavetable[l++]=(unsigned char)(y>>8);
wavetable[l++]=(unsigned char)(y);
p1=p1+i;
if(p1[0]!=')')
p1=p1+1;
}
wavetable[4]=(l-4)>>8;
wavetable[5]=(l-4);
length=l;
transmit(fd,(wavetable,length,max_result_length,result);
} 030627*/
}
else if(memcmp(p1,"dig:",4)==0)
{
p1=p1+4;
for(i=0;i<39;i++)
{
out_data2[i]=0x00;
}
for(i=0;i<4;i++)
{
out_data2[i]=0xa5;
}
if(memcmp(p1,"on(",3)==0)
{
p1=p1+3;
out_data2[4]=0x00;
out_data2[5]=0x05;
out_data2[6]=0x19;
out_data2[7]=0x0;
out_data2[8]=0x0;
/*if(p1[0]=='1'&&p1[2]=='0')
out_data2[8]=0x01;
else if(p1[0]=='0'&&p1[2]=='1')
out_data2[8]=0x02;
else if(p1[0]=='1'&&p1[2]=='1')
out_data2[8]=0x03;*/
out_data2[8]=autoc(p1);
length=9;
transmit(fd,out_data2,length,max_result_length);
}
else if(memcmp(p1,"off(",4)==0)
{
p1=p1+4;
out_data2[4]=0x00;
out_data2[5]=0x05;
out_data2[6]=0x1a;
/*if(p1[0]=='1'&&p1[2]=='0')
out_data2[8]=0x01;
else if(p1[0]=='0'&&p1[2]=='1')
out_data2[8]=0x02;
else if(p1[0]=='1'&&p1[2]=='1')
out_data2[8]=0x03;
//out_data2[8]=p1[0]; */
out_data2[8]=autoc(p1);
length=9;
transmit(fd,out_data2,length,max_result_length);
}
/*else if(memcmp(p1,"set(",4)==0)
{
p1=p1+4;
out_data2[4]=0x00;
out_data2[5]=0x05;
out_data2[6]=0x1b;
out_data2[7]=0x0;
for(i=0;p1[i]!=')';i++)
{
if(p1[i]==',')
i++;
out_data2[8]=out_data2[8]|(p1[i]&0xf);
}
//out_data2[8]=p1[0]&0xf;
length=9;
transmit(fd,(out_data2,length,max_result_length,result);
}030627*/
//transmit(fd,(out_data2,length,max_result_length,result);
}
else if(memcmp(p1,"cfg?",4)==0)
{
out_data2[4]=0x00;
out_data2[5]=0x03;
out_data2[6]=0x1c;
length=7;
transmit(fd,out_data2,length,max_result_length);
}
else if(memcmp(p1,"returnlimit",11)==0)
{
startvalue=StartCurrent;
endvalue=EndCurrent;
actstep=ActStep;
tripvalue=fabs(startvalue-endvalue)/actstep+1;
if(V1DC==0)
{
if(startvalue<endvalue)
returnvalue=startvalue/actstep;
else if(startvalue>endvalue)
returnvalue=(MAX_I_VALUEDATA_AC-startvalue)/actstep;
}
else if(V1DC==1)
{
if(startvalue<endvalue)
returnvalue=startvalue/actstep;
else if(startvalue>endvalue)
returnvalue=(MAX_I_VALUEDATA_DC-startvalue)/actstep;
}
for(i=0;i<39;i++)
{
out_data2[i]=0x00;
}
for(i=0;i<4;i++)
{
out_data2[i]=0xa5;
}
out_data2[4]=0x00;
out_data2[5]=0x07;
out_data2[6]=0x82;
out_data2[7]=(unsigned char)(tripvalue>>8);
out_data2[8]=(unsigned char)(tripvalue);
out_data2[9]=(unsigned char)((returnvalue+32768)>>8);
out_data2[10]=(unsigned char)(returnvalue);
length=11;
transmit(fd,out_data2,length,max_result_length);
}
}
else if(memcmp(p1,"inp:",4)==0)
{
for(i=0;i<40;i++)
inp_data[i]=0x00;
for(i=0;i<4;i++)
inp_data[i]=0xa5;
inp_data[i]=0x00;
p1=p1+4;
if(memcmp(p1,"ana:",4)==0)
{
p1=p1+4;
}
else if(memcmp(p1,"dig(0):get?",8)==0)
{
inp_data[5]=0x04;
inp_data[6]=0x24;
inp_data[7]=0x00;
length=8;
transmit(fd,inp_data,length,max_result_length);
}
else if(memcmp(p1,"dig(1):get?",8)==0)
{
inp_data[5]=0x04;
inp_data[6]=0x24;
inp_data[7]=0x01;
length=8;
transmit(fd,inp_data,length,max_result_length);
}
else if(memcmp(p1,"dig:interval(",13)==0) //¿ª¹ØÁ¿·Ö±æÂÊ¡£
{
p1=p1+13;
inp_data[5]=0x07;
inp_data[6]=0x2d;
inp_data[7]=0x00;
inp_data[8]=0x00;
time_out=(long)(1000*LogicResolution/50);
inp_data[7]=(unsigned char)(time_out>>16);
inp_data[8]=(unsigned char)(time_out>>8);
inp_data[9]=(unsigned char)(time_out); //ÔÚϵͳÉèÖÃÀïÔöŒÓ¡°¿ª¹ØÁ¿·Ö±æÂÊ¡±ºó
// inp_data[9]=0x3c; //3ms mxg 2003_3_4
inp_data[10]=0x01; //0x01£º²»±£ŽæœÓµã¶¶¶¯ÊýŸÝ£¬0x00:±£ŽæœÓµã¶¶¶¯ÊýŸÝ¡£
length=11;
transmit(fd,inp_data,length,max_result_length);
}
else if(memcmp(p1,"cfg?",4)==0)
{
p1=p1+4;
inp_data[5]=0x03;
inp_data[6]=0x2c;
length=7;
transmit(fd,inp_data,length,max_result_length);
}
else if(memcmp(p1,"buf:",4)==0)
{
p1=p1+4;
if(memcmp(p1,"get?",4)==0)
{
inp_data[5]=0x03;
inp_data[6]=0x29;
length=7;
transmit(fd,inp_data,length,max_result_length);
}
else if(memcmp(p1,"clr",3)==0)
{
inp_data[5]=0x03;
inp_data[6]=0x2a;
length=7;
transmit(fd,inp_data,length,max_result_length);
}
else if(memcmp(p1,"sam(",4)==0)
{
p1=p1+4;
inp_data[5]=0x05;
inp_data[6]=0x28;
if(memcmp(p1,"output",6)==0)
{
inp_data[7]=0x60;
p1=p1+7;
if(memcmp(p1,"v(",2)==0)
{
inp_data[7]=inp_data[7]|(((p1[0]-1)&0xf)<<2);
p1=p1+3;
inp_data[7]=inp_data[7]|((p1[0]-1)&0x03);
inp_data[8]=0x00;
}
}
else if(memcmp(p1,"input",5)==0)
{
inp_data[7]=0x00;
inp_data[8]=0x00;
}
else if(memcmp(p1,"bin",3)==0)
{
p1=p1+4;
inp_data[7]=0x80;
for(i=0;p1[i]!=')';)
i++;
i--;
data2=0;
data1=1;
for(j=i;j>=0;j--)
{
data2=data2+(unsigned char)((p1[j]&0xf)*data1);
data1=(unsigned char)(data1*10);
}
inp_data[8]=data2;
}
length=9;
transmit(fd,inp_data,length,max_result_length);
}
}
else if(memcmp(p1,"dig(",4)==0)
{
p1=p1+4;
for(j=0;p1[j]!=')';)
j++;
p2=p1+j+2;
if(memcmp(p2,"thres(",6)==0)
{
inp_data[5]=0x06;
inp_data[6]=0x25;
p2=p2+6;
inp_data[7]=p1[0]&0xf;
//p1=p1+2;
x=my_atof(p2);
y=(int)x;
inp_data[8]=(unsigned char)y; //p3[0];
//frec(x,1,data_cmp1);
inp_data[9]=0x00; //data_cmp1[0];
length=10;
transmit(fd,inp_data,length,max_result_length);
}
else if(memcmp(p2,"thres?",6)==0)
{
inp_data[5]=0x04;
inp_data[6]=0x26;
while((p1-1)[0]!=')')
{
inp_data[7]=p1[0]&0xf;
p1=p1+2;
length=8;
transmit(fd,inp_data,length,max_result_length);
}
}
}
}
else if(memcmp(p1,"amp:",4)==0) //Amplifier commands
{
for(i=0;i<40;i++)
amp_data[i]=0x00;
p1=p1+4;
amp_data[0]=0xa5;
amp_data[1]=0xa5;
amp_data[2]=0xa5;
amp_data[3]=0xa5;
amp_data[4]=0x00;
if(memcmp(p1,"def(",4)==0)
{
p1=p1+4;
p2=p1;
for(i=0;p1[i]!=')';p2++,i++)
;
p2=p2-5;
if(memcmp(p2,"reset",5)==0)
{
amp_data[5]=0x04;
amp_data[6]=0x31;
data1=(p1[0]&0x07)<<2;
data2=p1[2]&0x03;
data1=data1|data2;
p1=p1+4;
if(memcmp(p1,"int",3)==0)
data1=data1&0x7f;
else if(memcmp(p1,"ext",3)==0)
data1=data1|0x80;
amp_data[7]=data1;
length=8;
}
else
{
amp_data[5]=0x04;
amp_data[6]=0x30;
data1=(p1[0]&0x07)<<2;
data2=p1[2]&0x03;
data1=data1|data2;
p1=p1+4;
if(memcmp(p1,"int",3)==0)
data1=data1&0x7f;
else if(memcmp(p1,"ext",3)==0)
data1=data1|0x80;
p1=p1+4;
if(memcmp(p1,"v,",2)==0)
{data1=data1&0xbf;status=1;}
else if(memcmp(p1,"i,",3)==0)
{data1=data1|0x40;status=2;}
amp_data[7]=data1;
p1=p1+2;
x=my_atof(p1);
y=(int)x;
amp_data[8]=(unsigned char)y; //p3[0];
x=x-(int)x;
frec(x,1,data_cmp1);
amp_data[9]=data_cmp1[0];
for(i=0;p1[i]!=',';)
i++;
p1=p1+i+1;
x=my_atof(p1);
y=(int)x;
data1=(unsigned char)y; //p3[0];
data2=(unsigned char)(y>>8); //p3[1];
p3[0]=data2;
p3[1]=data1;
if(status==1)
{
y=y<<6;
amp_data[10]=p3[0];
amp_data[11]=p3[1];
frec(x,3,data_cmp1);
p3[0]=0;
p3[1]=data_cmp1[0];
p3[2]=data_cmp1[1];
p3[3]=data_cmp1[2];
time_out=time_out<<6;
amp_data[11]=amp_data[11]|p3[0];
amp_data[12]=p3[1];
}
else if(status==2)
{
amp_data[10]=p3[0];
frec(x,2,data_cmp1);
amp_data[11]=data_cmp1[0];
amp_data[12]=data_cmp1[1];
}
out_data=amp_data+13;
k=0;
for(j=0;j<2;j++)
{
for(i=0;p1[i]!=',';)
{i++;}
p1=p1+i+1;
x=my_atof(p1);
y=(int)x;
//p3=&y;
out_data[k]=(unsigned char)(y>>8); //p3[1];
k++;
out_data[k]=(unsigned char)y; //p3[0];
k++;
frec(x,2,data_cmp1);
out_data[k]=data_cmp1[0];
k++;
out_data[k]=data_cmp1[1];
k++;
}
for(i=0;p1[i]!=',';)
i++;
p1=p1+i+1;
x=my_atof(p1);
y=(int)x;
//p3=&y;
out_data[k]=(unsigned char)y;//p3[0];
k++;
frec(x,1,data_cmp1);
out_data[k]=data_cmp1[0];
length=23;
}
}
else if(memcmp(p1,"def?(",5)==0)
{
p1=p1+5;
amp_data[5]=0x04;
amp_data[6]=0x32;
if(p1[0]=='1')
{
switch(p1[2])
{
case '1':
amp_data[7]=0x00;
break;
case '2':
amp_data[7]=0x01;
break;
case '3':
amp_data[7]=0x02;
break;
case '4':
amp_data[7]=0x03;
break;
}
}
else if(p1[0]=='2')
{
switch(p1[2])
{
case '1':
amp_data[7]=0x04;
break;
case '2':
amp_data[7]=0x05;
break;
case '3':
amp_data[7]=0x06;
break;
}
}
length=8;
}
else if(memcmp(p1,"route(",6)==0)
{
p1=p1+6;
amp_data[5]=0x04;
amp_data[6]=0x33;
amp_data[7]=0x00;
if(memcmp(p1,"v,",2)==0)
{
data1=0x00;
}
else if(memcmp(p1,"i,",2)==0)
data1=0x11;
p1=p1+2;
if(memcmp(p1,"clr",3)==0)
amp_data[7]=0x80;
amp_data[7]=amp_data[7]|data1;
length=8;
}
else if(memcmp(p1,"route?(",7)==0)
{
p1=p1+7;
amp_data[5]=0x04;
amp_data[6]=0x34;
if(memcmp(p1,"v,",2)==0)
data1=0x00;
if(memcmp(p1,"i,",2)==0)
data1=0x01;
amp_data[7]=data1;
length=8;
}
else if(memcmp(p1,"list?",5)==0)
{
p1=p1+5;
amp_data[5]=0x04;
amp_data[6]=0x35;
length=7;
}
else if(memcmp(p1,"ctrl(",5)==0)
{
p1=p1+5;
amp_data[5]=0x0c;
if(memcmp(p1,"v,",2)==0)
amp_data[6]=0x36;
else if(memcmp(p1,"i,",2)==0)
amp_data[6]=0x37;
p1=p1+2;
amp_data[7]=p1[0]&0x7;
p1=p1+2;
for(i=0;p1[i]!=')'&&p1[i]!=',';)
{i++;}
p1=p1+i;
x=my_atof(p1);
y=(long int)x;
amp_data[8]=(unsigned char)(y>>8);
amp_data[9]=(unsigned char)(y>>24);
amp_data[10]=(unsigned char)(y>>16);
if(p1[0]==',')
{
p1++;
for(i=0;p1[i]!=')';)
{i++;}
x=my_atof(p1);
y=(int)x;
amp_data[11]=(unsigned char)(y>>8);
amp_data[12]=(unsigned char)y;
frec(x,1,data_cmp1);
amp_data[13]=data_cmp1[0];
}
length=14;
}
else if(memcmp(p1,"ctrl?(",6)==0)
{
p1=p1+6;
amp_data[5]=0x04;
amp_data[6]=0x38;
if(memcmp(p1,"v,",2)==0)
data1=0x00;
if(memcmp(p1,"i,",2)==0)
data1=0x01;
amp_data[7]=data1;
length=8;
}
else if(memcmp(p1,"on(",3)==0)
{
p1=p1+3;
amp_data[5]=0x04;
amp_data[6]=0x39;
amp_data[7]=p1[0]&0xf;
length=8;
}
else if(memcmp(p1,"off(",4)==0)
{
p1=p1+4;
amp_data[5]=0x04;
amp_data[6]=0x3a;
amp_data[7]=p1[0]&0xf;
length=8;
}
transmit(fd,amp_data,length,max_result_length);
}
else if(memcmp(p1,"seq:",4)==0)
{
for(i=0;i<40;i++)
seq_data[i]=0x00;
seq_data[0]=0xa5;
seq_data[1]=0xa5;
seq_data[2]=0xa5;
seq_data[3]=0xa5;
p1=p1+4;
if(memcmp(p1,"begin",5)==0)
{
seq_data[4]=0x00;
seq_data[5]=0x03;
seq_data[6]=0x40;
length=7;
}
else if(memcmp(p1,"end",3)==0)
{
seq_data[4]=0x00;
seq_data[5]=0x03;
seq_data[6]=0x41;
length=7;
}
else if(memcmp(p1,"clr",3)==0)
{
seq_data[4]=0x00;
seq_data[5]=0x03;
seq_data[6]=0x42;
length=7;
}
else if(memcmp(p1,"resumetime(",11)==0)
{
p1=p1+11;
seq_data[5]=0x06;
seq_data[6]=0x50;
for(i=0;p1[i]!=')';i++)
data_cmp[i]=p1[i];
data_cmp[i]='\0'; //NULL;
//p1=p1+i;
x=my_atof(data_cmp);
time_out=(long)(1000000*x/50);
//p3=&time_out;
seq_data[7]=(unsigned char)(time_out>>16); //p3[0];
seq_data[8]=(unsigned char)(time_out>>8); //p3[4];
seq_data[9]=(unsigned char)(time_out); //p3[3];
length=10;
}
else if(memcmp(p1,"wait(",5)==0)
{
p1=p1+5;
seq_data[4]=0x00;
seq_data[5]=0x0F;
seq_data[6]=0x43;
seq_data[7]=0;
seq_data[8]=0;
seq_data[9]=0;
seq_data[10]=0;
seq_data[11]=0;
seq_data[12]=0;
seq_data[13]=0;
seq_data[14]=0;
seq_data[15]=0;
seq_data[16]=0;
seq_data[17]=0;
seq_data[18]=0;
if(memcmp(p1,"and",3)==0||memcmp(p1,"or",2)==0)
{
if(memcmp(p1,"and",3)==0)
{
p1=p1+3;
seq_data[7]=seq_data[7]|0x80;
}
else if(memcmp(p1,"or",2)==0)
{
p1=p1+2;
seq_data[7]=seq_data[7]|0xc0;
}
if(memcmp(p1,"bin(",4)==0)
{
p1=p1+4;
switch(p1[0])
{
case '0':{
break;
}
case '1':{
seq_data[9]=seq_data[9]|0x01;
break;
}
case '2':{
seq_data[9]=seq_data[9]|0x01;
seq_data[11]=seq_data[11]|0x01;
break;
}
}
p1=p1+3;
if(memcmp(p1,"bin(",4)==0)
{
p1=p1+4;
switch(p1[0])
{
case '0':{
break;
}
case '1':{
seq_data[9]=seq_data[9]|0x02;
break;
}
case '2':{
seq_data[9]=seq_data[9]|0x02;
seq_data[11]=seq_data[11]|0x02;
break;
}
}
p1=p1+3;
if(memcmp(p1,"bin(",4)==0)
{
p1=p1+4;
switch(p1[0])
{
case '0':{
break;
}
case '1':{
seq_data[9]=seq_data[9]|0x04;
break;
}
case '2':{
seq_data[9]=seq_data[9]|0x04;
seq_data[11]=seq_data[11]|0x04;
break;
}
}
p1=p1+3;
if(memcmp(p1,"bin(",4)==0)
{
p1=p1+4;
switch(p1[0])
{
case '0':{
break;
}
case '1':{
seq_data[9]=seq_data[9]|0x08;
break;
}
case '2':{
seq_data[9]=seq_data[9]|0x08;
seq_data[11]=seq_data[11]|0x08;
break;
}
}
p1=p1+3;
}}}}
if((seq_data[9]&0x0f)==0)
seq_data[7]=seq_data[7]&0xf;
data1=p1[0]+1; //移动到 orbin(1),bin(1),bin(1),bin(1),2,1,0,1) 中的2
seq_data[7]=seq_data[7]|((data1&0x03)<<4);
if(p1[2]=='1'||p1[2]=='2') //延时有效
{ if(p1[2]=='1')
{
seq_data[7]=seq_data[7]|0x04;
time_out=(long)(1000*faultduration);
seq_data[15]=(unsigned char)(time_out>>16);//p3[0];
seq_data[16]=(unsigned char)(time_out>>8);//p3[4];
seq_data[17]=(unsigned char)(time_out);//p3[3];
}
else if(p1[2]=='2')
{
seq_data[7]=seq_data[7]|0x04;
time_out=(long)(1000*faultduration);
seq_data[15]=(unsigned char)(time_out>>16);//p3[0];
seq_data[16]=(unsigned char)(time_out>>8);//p3[4];
seq_data[17]=(unsigned char)(time_out);//p3[3];
seq_data[18]=1;
}
}
if(p1[3]==',')
{
p1=p1+4;
for(i=0;p1[i]!=',';i++)
data_cmp[i]=p1[i];
data_cmp[i]='\0';//NULL;
p1=p1+i;
if(out_time==-1)
x=my_atof(data_cmp);
else if(out_time!=-1)
x=out_time;
time_out=(long)(1000*x);
seq_data[12]=(unsigned char)(time_out>>16);//p3[0];
seq_data[13]=(unsigned char)(time_out>>8);//p3[4];
seq_data[14]=(unsigned char)(time_out);//p3[3];
data1=(p1[1]+1)&0x03|0x8;
seq_data[7]=seq_data[7]|data1;
}
}
else
{
seq_data[7]=0x08;
for(i=0;p1[i]!=',';i++)
data_cmp[i]=p1[i];
data_cmp[i]='\0'; //NULL;
p1=p1+i;
if(out_time==-1)
x=my_atof(data_cmp);
else if(out_time!=-1)
x=out_time;
time_out=(long)(1000*x); /*//*/
seq_data[12]=(unsigned char)(time_out>>16); /* //p3[0]; */
seq_data[13]=(unsigned char)(time_out>>8); /* //p3[4]; */
seq_data[14]=(unsigned char)(time_out); /* //p3[3]; */
data1=(p1[1]+1)&0x03;
seq_data[7]=seq_data[7]|data1;
}
length=19;
}
else if(memcmp(p1,"status?(",8)==0)
{
p1=p1+8;
seq_data[4]=0x00;
seq_data[5]=0x03;
if(memcmp(p1,"step",4)==0)
seq_data[6]=0x44;
else if(memcmp(p1,"mem",3)==0)
seq_data[6]=0x45;
length=7;
}
else if(memcmp(p1,"brk",3)==0)
{
seq_data[4]=0x00;
seq_data[5]=0x03;
seq_data[6]=0x46;
length=7;
}
else if(memcmp(p1,"exec",4)==0)
{
seq_data[4]=0x00;
seq_data[5]=0x03;
seq_data[6]=0x47;
length=7;
}
else if(memcmp(p1,"stop",4)==0)
{
seq_data[4]=0x00;
seq_data[5]=0x03;
seq_data[6]=0x48;
length=7;
}
else if(memcmp(p1,"mode",4)==0)
{
seq_data[4]=0x00;
seq_data[5]=0x04;
seq_data[6]=0x49;
seq_data[7]=0x00;
length=8;
}
transmit(fd,seq_data,length,max_result_length);
}
else if(memcmp(p1,"others:",7)==0)
{
for(i=0;i<4;i++)
seq_data[i]=0xa5;
seq_data[i]=0x00;
p1=p1+7;
if(memcmp(p1,"steptime(",9)==0)
{
p1=p1+9;
seq_data[5]=0x06;
seq_data[6]=0x57;
/*for(i=0;p1[i]!=')';i++)
data_cmp[i]=p1[i];*/
for(i=0;*p1!=NULL;i++)
data_cmp[i]=*p1++;
data_cmp[i]='\0'; /* //NULL; */
/* //p1=p1+i; */
//x=my_atof(data_cmp);
x=change_timedata;
time_out=(long)(1000000*x/50);
/* //p3=&time_out; */
seq_data[7]=(unsigned char)(time_out>>16);/* //p3[0]; */
seq_data[8]=(unsigned char)(time_out>>8); /* //p3[4]; */
seq_data[9]=(unsigned char)(time_out); /* //p3[3]; */
length=10;
}
else if(memcmp(p1,"ana:",4)==0)
{
seq_data[5]=0x07;
seq_data[6]=0x53;
p1=p1+4;
if(memcmp(p1,"v(1:1",5)==0)
{
seq_data[7]=0x00;
x=V1RelaPhase;
}
else if(memcmp(p1,"v(1:2",5)==0)
{
seq_data[7]=0x01;
x=V2RelaPhase;
}
else if(memcmp(p1,"v(1:3",5)==0)
{
seq_data[7]=0x02;
x=V3RelaPhase;
}
else if(memcmp(p1,"i(1:1",5)==0)
{
seq_data[7]=0x04;
x=I1RelaPhase;
}
else if(memcmp(p1,"i(1:2",5)==0)
{
seq_data[7]=0x05;
x=I2RelaPhase;
}
else if(memcmp(p1,"i(1:3",5)==0)
{
seq_data[7]=0x06;
x=I3RelaPhase;
}
p1=p1+7;
if(memcmp(p1,"rel_phase(",10)==0)
{
y=(int)x;
data2=(unsigned char)y;
data1=(unsigned char)(y>>8);
seq_data[8]=(data1<<6)|(data2>>2);
seq_data[9]=data2<<6;
frec(x,2,data_cmp1);
seq_data[9]=seq_data[9]|(data_cmp1[0]>>2);
seq_data[10]=(data_cmp1[0]<<6)|(data_cmp1[1]>>2);
}
length=11;
}
else if(memcmp(p1,"revision:get",12)==0)
{
seq_data[5]=0x03;
seq_data[6]=0x59;
length=7;
}
else if(memcmp(p1,"revision:valueget:",18)==0)
{
seq_data[5]=0x04;
seq_data[6]=0x5e;
p1=p1+18;
if(memcmp(p1,"v(1:1",5)==0)
seq_data[7]=0x00;
else if(memcmp(p1,"v(1:2",5)==0)
seq_data[7]=0x01;
else if(memcmp(p1,"v(1:3",5)==0)
seq_data[7]=0x02;
else if(memcmp(p1,"v(1:4",5)==0)
seq_data[7]=0x03;
else if(memcmp(p1,"i(1:1",5)==0)
seq_data[7]=0x04;
else if(memcmp(p1,"i(1:2",5)==0)
seq_data[7]=0x05;
else if(memcmp(p1,"i(1:3",5)==0)
seq_data[7]=0x06;
length=8;
}
transmit(fd,seq_data,length,max_result_length);
}
p1=p4;
return;
}
// amplifier parmeter change
void channel_input(int fd,int type,double value, double phan,double frec,int sin_dc_status1,int channel_status,double value_step,double phase_step,double frec_step)
{
int i;
char buffer[40],buffer1[100],p1[100],p2[100],buffer4[40];
char p3[100],buffer3[40];
if(sin_dc_status1==0)
value=value*1.414;
if(type==1)//type=1 -->voltage
{
if(channel_status==1)
{
for(i=0;i<40;i++)
data_v_a[i]=0x00;
strcpy(p1,"out:ana:v(1:1):sig1:");
if (phan!=360)
phan+=VaPhaseRevision;//07-10-08 16:10,ÏàλУ׌
}
else if(channel_status==2)
{
for(i=0;i<40;i++)
data_v_b[i]=0x00;
strcpy(p1,"out:ana:v(1:2):sig1:");
if (phan!=360) //2008-12-25
phan+=VbPhaseRevision;//07-10-08 16:10,ÏàλУ׌
}
else if(channel_status==3)
{
for(i=0;i<40;i++)
data_v_c[i]=0x00;
strcpy(p1,"out:ana:v(1:3):sig1:");
if(phan!=360) //2008-12-25
phan+=VcPhaseRevision;//07-10-08 16:10,ÏàλУ׌
}
}
if(type==0)
{
if(channel_status==1)
{
for(i=0;i<40;i++)
data_i_a[i]=0x00;
strcpy(p1,"out:ana:i(1:1):sig1:");
if(phan!=360) //2008-12-25
phan+=IaPhaseRevision;//
}
else if(channel_status==2)
{
for(i=0;i<40;i++)
data_i_b[i]=0x00;
strcpy(p1,"out:ana:i(1:2):sig1:");
if(phan!=360) //2008-12-25
phan+=IbPhaseRevision;//07-10-08 16:10,ÏàλУ׌
}
else if(channel_status==3)
{
for(i=0;i<40;i++)
data_i_c[i]=0x00;
strcpy(p1,"out:ana:i(1:3):sig1:");
if(phan!=360) //2008-12-25
phan+=IcPhaseRevision;//07-10-08 16:10,ÏàλУ׌
}
}
if(phan<0)
phan+=360;
if(phase_step<0)
phase_step+=360;
for(i=0;p1[i]!=NULL;i++)
buffer4[i]=p1[i];
buffer4[i]=NULL;
buffer1[0]=NULL;
// p2=buffer2;
p2[0]=')';
p2[1]=NULL;
gcvt(value,6,buffer);
strcpy(p1,"a(") ;
for(i=0;p1[i]!=NULL;i++)
buffer3[i]=p1[i];
buffer3[i]=NULL;
strncat1(buffer1,buffer4);
strncat1(buffer1,buffer3);
strncat1(buffer1,buffer);
strncat1(buffer1,p2);
artExec(fd,buffer1,result,0);
if(sin_dc_status1==0)
value_step=value_step*1.414;
gcvt(value_step,6,buffer);
buffer1[0]=NULL;
strncat1(buffer1,buffer4);
strncat1(buffer1,buffer3);
strncat1(buffer1,buffer);
strcpy(p3,",step");
strcat(buffer1,p3);
strncat1(buffer1,p2);
artExec(fd,buffer1,result,0);
buffer1[0]=NULL;
gcvt(frec,7,buffer);
strcpy(p1,"f(");
for(i=0;p1[i]!=NULL;i++)
buffer3[i]=p1[i];
buffer3[i]=NULL;
buffer1[0]=NULL;
strncat1(buffer1,buffer4);
strncat1(buffer1,buffer3);
strncat1(buffer1,buffer);
strncat1(buffer1,p2);
artExec(fd,buffer1,result,0);
gcvt(frec_step,6,buffer);
buffer1[0]=NULL;
strncat1(buffer1,buffer4);
strncat1(buffer1,buffer3);
strncat1(buffer1,buffer);
strcpy(p3,",step");
strcat(buffer1,p3);
strncat1(buffer1,p2);
artExec(fd,buffer1,result,0);
buffer1[0]=NULL;
gcvt(phan,7,buffer);
strcpy(p1,"p(");
for(i=0;p1[i]!=NULL;i++)
buffer3[i]=p1[i];
buffer3[i]=NULL;
strncat1(buffer1,buffer4);
strncat1(buffer1,buffer3);
strncat1(buffer1,buffer);
strncat1(buffer1,p2);
artExec(fd,buffer1,result,0);
gcvt(phase_step,6,buffer);
buffer1[0]=NULL;
strncat1(buffer1,buffer4);
strncat1(buffer1,buffer3);
strncat1(buffer1,buffer);
strcpy(p3,",step");
strcat(buffer1,p3);
strncat1(buffer1,p2);
artExec(fd,buffer1,result,0);
if(sin_dc_status1==0)
strcpy(p1,"wav(sin)");
else
strcpy(p1,"wav(dc)");
for(i=0;p1[i]!=NULL;i++)
buffer3[i]=p1[i];
buffer3[i]=NULL;
buffer1[0]=NULL;
strncat1(buffer1,buffer4);
strncat1(buffer1,buffer3);
artExec(fd,buffer1,result,0);
if(type==1)
{
if(channel_status==1)
{
strcpy(p1,"out:ana:mix:v(1:1,sig1)");
for(i=0;p1[i]!=NULL;i++)
buffer1[i]=p1[i];
buffer1[i]=NULL;
artExec(fd,buffer1,result,0);
}
else if(channel_status==2)
{
strcpy(p1,"out:ana:mix:v(1:2,sig1)");
for(i=0;p1[i]!=NULL;i++)
buffer1[i]=p1[i];
buffer1[i]=NULL;
artExec(fd,buffer1,result,0);
}
else if(channel_status==3)
{
strcpy(p1,"out:ana:mix:v(1:3,sig1)");
for(i=0;p1[i]!=NULL;i++)
buffer1[i]=p1[i];
buffer1[i]=NULL;
artExec(fd,buffer1,result,0);
}
}
if(type==0)
{
if(channel_status==1)
{
strcpy(p1,"out:ana:mix:i(1:1,sig1)");
for(i=0;p1[i]!=NULL;i++)
buffer1[i]=p1[i];
buffer1[i]=NULL;
artExec(fd,buffer1,result,0);
}
else if(channel_status==2)
{
strcpy(p1,"out:ana:mix:i(1:2,sig1)");
for(i=0;p1[i]!=NULL;i++)
buffer1[i]=p1[i];
buffer1[i]=NULL;
artExec(fd,buffer1,result,0);
}
else if(channel_status==3)
{
strcpy(p1,"out:ana:mix:i(1:3,sig1)");
for(i=0;p1[i]!=NULL;i++)
buffer1[i]=p1[i];
buffer1[i]=NULL;
artExec(fd,buffer1,result,0);
}
}
}
unsigned long BytesToUnlong( unsigned char bytes[], int NoBytes)
{
unsigned long value=0; //, value1=0, value2=0;
if ( NoBytes <= 0 ||
NoBytes > 4 )
return -1;
for (int i=0; i<NoBytes; i++)
{
value +=(unsigned long)(*(bytes+i)*(pow_my(256,(NoBytes-i-1)))); // =bytes[0]*256*...+bytes[1]*...
}
return value;
}
// to convert bytes to a float.
// BitsInt - bits of integer part(maximum, 16)
// Bytes - total bytes for transaction
//
float BytesToFloat(unsigned char bytes[], int BitsInt, int Bytes, int Signed)
{
float rtn =(float)BytesToUnlong( bytes, Bytes);
if (Signed && *bytes > 128)
rtn -= (float)pow(256, Bytes);
rtn /= (float)pow(2, (Bytes*8-BitsInt));
return rtn;
}
void online(int fd) //online
{
int i,k;
unsigned char send_str[17]={0xa5,0xa5,0xa5,0xa5,0xff,0x00,0x0c,0x0f};
unsigned char receive_str1[4]={0xf0,0xf0,0xf0,0xf0};
unsigned char receive_str2[10]={0x0f,0x5a,0xf0,0xa5,0xff,0x0f,0x5a,0xf0,0xa5,0x00};
while(1)
{
receive_send(fd,send_str,0,receive_str1,12,4,1);
for(i=0;i<8;i++)
send_str[8+i]=receive_data[4+i];
send_str[16]=ID;
k=receive_send(fd,send_str,17,receive_str2,10,10,0);
if(k==1)
break;
}
}
int read_max(int fd)
{
int SIGNED=1;
artExec(fd,"amp:def?(1:1)",result,24);//from ART read amplifer_va's parameter.
response[0]=result[10];
response[1]=result[11];
response[2]=result[12];
max_output_v_a=BytesToFloat(response,10,3,SIGNED);//get va's max absolute output level.
artExec(fd,"amp:def?(1:2)",result,24); //from ART read amplifer_vb's parameter.
response[0]=result[10];
response[1]=result[11];
response[2]=result[12];
max_output_v_b=BytesToFloat(response,10,3,SIGNED);//get vb's max absolute output level.
artExec(fd,"amp:def?(1:3)",result,24); //from ART read amplifer_vc's parameter.
response[0]=result[10];
response[1]=result[11];
response[2]=result[12];
max_output_v_c=BytesToFloat(response,10,3,SIGNED);//get vc's max absolute output level.
artExec(fd,"amp:def?(1:4)",result,24); //from ART read amplifer_vc's parameter.
response[0]=result[10];
response[1]=result[11];
response[2]=result[12];
max_output_v_z=BytesToFloat(response,10,3,SIGNED);//get vb's max absolute output level.
artExec(fd,"amp:def?(2:1)",result,24);//from ART read amplifer_i's parameter.
response[0]=result[10];
response[1]=result[11];
response[2]=result[12];
max_output_i_a=BytesToFloat(response,8,3,SIGNED);//get i1's max absolute output level.
artExec(fd,"amp:def?(2:2)",result,24);//from ART read amplifer_i's parameter.
response[0]=result[10];
response[1]=result[11];
response[2]=result[12];
max_output_i_b=BytesToFloat(response,8,3,SIGNED);//get i2's max absolute output level.
artExec(fd,"amp:def?(2:3)",result,24);//from ART read amplifer_i's parameter.
response[0]=result[10];
response[1]=result[11];
response[2]=result[12];
max_output_i_c=BytesToFloat(response,8,3,SIGNED);//get i3's max absolute output level.
artExec(fd,"others:revision:get",result,59);//¶ÁƵÂÊ¡¢Ïàλ²¹³¥²ÎÊý
response[0]=result[7];
response[1]=result[8];
response[2]=result[9];
FreqRevision=BytesToFloat(response,4,3,SIGNED);//ƵÂʲ¹³¥²ÎÊý
response[0]=result[10];
response[1]=result[11];
response[2]=result[12];
VaPhaseRevision=BytesToFloat(response,4,3,SIGNED);//VaÏàλ²¹³¥²ÎÊý
response[0]=result[13];
response[1]=result[14];
response[2]=result[15];
VbPhaseRevision=BytesToFloat(response,4,3,SIGNED);//VbÏàλ²¹³¥²ÎÊý
response[0]=result[16];
response[1]=result[17];
response[2]=result[18];
VcPhaseRevision=BytesToFloat(response,4,3,SIGNED);//VcÏàλ²¹³¥²ÎÊý
response[0]=result[22];
response[1]=result[23];
response[2]=result[24];
IaPhaseRevision=BytesToFloat(response,4,3,SIGNED);//IaÏàλ²¹³¥²ÎÊý
response[0]=result[25];
response[1]=result[26];
response[2]=result[27];
IbPhaseRevision=BytesToFloat(response,4,3,SIGNED);//IbÏàλ²¹³¥²ÎÊý
response[0]=result[28];
response[1]=result[29];
response[2]=result[30];
IcPhaseRevision=BytesToFloat(response,4,3,SIGNED);//IcÏàλ²¹³¥²ÎÊý
return (1);
}
#endif
| [
"275159401@qq.com"
] | 275159401@qq.com |
97b046a1af81d082bbcc30b0315f6efcb78ad7ae | 94516a020ccdb5b154669c96bdcdbd17ef0bc5a2 | /Source/qtPlist/plistparser.h | a1d19821b12abf57a6221a897267395aff9538c6 | [
"Zlib"
] | permissive | raydelto/Turquoise2D | d5380e01fa9cc8a8685ca0e385d67df080274ece | 247a0e747d8750248db12f830c9408a85d4712bc | refs/heads/master | 2022-09-06T13:59:32.477183 | 2020-05-28T02:51:28 | 2020-05-28T02:51:28 | 266,917,031 | 0 | 0 | Zlib | 2020-05-26T01:35:20 | 2020-05-26T01:35:19 | null | UTF-8 | C++ | false | false | 414 | h | #pragma once
// Qt includes
#include <QIODevice>
#include <QVariant>
#include <QVariantList>
#include <QVariantMap>
#include <QDomElement>
class PListParser {
public:
static QVariant parsePList(QIODevice *device);
private:
static QVariant parseElement(const QDomElement &e);
static QVariantList parseArrayElement(const QDomElement& node);
static QVariantMap parseDictElement(const QDomElement& element);
};
| [
"erayzesen@gmail.com"
] | erayzesen@gmail.com |
2c16b1032faf25c3fc97c93c3c7d7a7a6eb0e7f2 | d4a78a9099884c1e1c203f7e5b78b844de053ff7 | /tensorflow/lite/tools/optimize/subgraph_quantizer_test.cc | 7652429e32f1dbc031c46ce6bd259aa58971a144 | [
"Apache-2.0"
] | permissive | pint1022/tensorflow | b4b7632c0f833135a0bb37ab5a939a6c1ec51ef6 | ab1f872bbcf7749112f76a7f9ba17406e8fbbf4e | refs/heads/master | 2020-04-15T00:16:48.132100 | 2019-02-05T17:48:11 | 2019-02-05T17:48:11 | 164,233,910 | 2 | 2 | Apache-2.0 | 2019-01-05T16:53:25 | 2019-01-05T16:53:25 | null | UTF-8 | C++ | false | false | 10,773 | 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/lite/tools/optimize/subgraph_quantizer.h"
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include "tensorflow/core/lib/io/path.h"
#include "tensorflow/core/platform/init_main.h"
#include "tensorflow/core/util/command_line_flags.h"
#include "tensorflow/lite/schema/schema_generated.h"
#include "tensorflow/lite/tools/optimize/symmetric_per_channel_params.h"
#include "tensorflow/lite/tools/optimize/test_util.h"
namespace {
tensorflow::string* g_test_model_dir = nullptr;
} // namespace
namespace tflite {
namespace optimize {
namespace internal {
namespace {
std::unique_ptr<FlatBufferModel> ReadTestModel1() {
auto model_path = tensorflow::io::JoinPath(*g_test_model_dir,
kModelWithMinus128Plus127Weights);
return FlatBufferModel::BuildFromFile(model_path.c_str());
}
std::unique_ptr<FlatBufferModel> ReadTestModel2() {
auto model_path =
tensorflow::io::JoinPath(*g_test_model_dir, kModelWith0Plus10Weights);
return FlatBufferModel::BuildFromFile(model_path.c_str());
}
TEST(SubgraphQuantizerTest, VerifyConvQuantizationWithUnitScale) {
ASSERT_TRUE(g_test_model_dir);
ASSERT_FALSE(g_test_model_dir->empty());
auto test_model = ReadTestModel1();
ASSERT_TRUE(test_model);
auto readonly_model = test_model->GetModel();
ASSERT_TRUE(readonly_model);
ASSERT_TRUE(readonly_model->subgraphs());
ASSERT_GE(readonly_model->subgraphs()->size(), 1);
tflite::ModelT model;
readonly_model->UnPackTo(&model);
auto subgraph = model.subgraphs[0].get();
FailOnErrorReporter error_reporter;
SubgraphQuantizer quantizer(&model, subgraph, &error_reporter);
auto status = quantizer.QuantizeOperator(0);
ASSERT_EQ(kTfLiteOk, status);
auto conv_op = subgraph->operators[0].get();
const int input_tensor_idx = 0;
const int weights_tensor_idx = 1;
const int bias_tensor_index = 2;
const int output_tensor_idx = 0;
const auto bias_tensor =
subgraph->tensors[conv_op->inputs[bias_tensor_index]].get();
const auto input_tensor =
subgraph->tensors[conv_op->inputs[input_tensor_idx]].get();
const auto weights_tensor =
subgraph->tensors[conv_op->inputs[weights_tensor_idx]].get();
const auto output_tensor =
subgraph->tensors[conv_op->outputs[output_tensor_idx]].get();
EXPECT_EQ(bias_tensor->type, TensorType_INT32);
EXPECT_EQ(input_tensor->type, TensorType_INT8);
EXPECT_EQ(weights_tensor->type, TensorType_INT8);
ASSERT_TRUE(weights_tensor->quantization);
const int out_channel_size = weights_tensor->shape[0];
std::unique_ptr<SymmetricPerChannelParams> bias_params;
std::unique_ptr<SymmetricPerChannelParams> weights_params;
ASSERT_EQ(kTfLiteOk, SymmetricPerChannelParams::ReadFromTensor(
*weights_tensor, &weights_params));
ASSERT_EQ(kTfLiteOk, SymmetricPerChannelParams::ReadFromTensor(*bias_tensor,
&bias_params));
ASSERT_EQ(bias_params->scales().size(), out_channel_size);
ASSERT_EQ(weights_params->scales().size(), out_channel_size);
ASSERT_EQ(input_tensor->quantization->scale.size(), 1);
ASSERT_EQ(output_tensor->quantization->scale.size(), 1);
const float eps = 1e-7;
// Bias scale should be input * per_channel_weight_scale.
for (size_t i = 0; i < out_channel_size; i++) {
EXPECT_NEAR(
bias_params->scales()[i],
input_tensor->quantization->scale[0] * weights_params->scales()[i],
eps);
}
for (size_t i = 0; i < out_channel_size; i++) {
EXPECT_EQ(weights_params->scales()[i], 1);
EXPECT_EQ(bias_params->scales()[i], 1);
}
EXPECT_EQ(input_tensor->quantization->scale[0], 1);
EXPECT_EQ(output_tensor->quantization->scale[0], 1);
const auto bias_buffer = model.buffers[bias_tensor->buffer].get();
ASSERT_EQ(bias_buffer->data.size(), sizeof(int32_t) * bias_tensor->shape[0]);
const int32_t* bias_values =
reinterpret_cast<int32_t*>(bias_buffer->data.data());
const auto original_bias_buffer =
readonly_model->buffers()->Get(bias_tensor->buffer);
const float* bias_float_buffer =
reinterpret_cast<const float*>(original_bias_buffer->data()->data());
for (size_t i = 0; i < bias_tensor->shape[0]; i++) {
auto dequantized_value = bias_values[i] * bias_params->scales()[i];
EXPECT_NEAR(dequantized_value, bias_float_buffer[i], eps);
}
const auto weights_buffer = model.buffers[weights_tensor->buffer].get();
const auto original_weights_buffer =
readonly_model->buffers()->Get(weights_tensor->buffer);
const int8_t* weight_values =
reinterpret_cast<int8_t*>(weights_buffer->data.data());
const float* weights_float_buffer =
reinterpret_cast<const float*>(original_weights_buffer->data()->data());
ASSERT_EQ(sizeof(float) * weights_buffer->data.size(),
original_weights_buffer->data()->size());
int num_values_in_channel = weights_buffer->data.size() / out_channel_size;
for (size_t channel_idx = 0; channel_idx < out_channel_size; channel_idx++) {
for (size_t j = 0; j < num_values_in_channel; j++) {
size_t element_idx = channel_idx * out_channel_size + j;
auto dequantized_value =
weight_values[element_idx] * weights_params->scales()[channel_idx];
EXPECT_NEAR(dequantized_value, weights_float_buffer[element_idx], eps);
}
}
}
TEST(SubgraphQuantizerTest, VerifyConvQuantization) {
ASSERT_TRUE(g_test_model_dir);
ASSERT_FALSE(g_test_model_dir->empty());
auto test_model = ReadTestModel2();
ASSERT_TRUE(test_model);
auto readonly_model = test_model->GetModel();
ASSERT_TRUE(readonly_model);
ASSERT_TRUE(readonly_model->subgraphs());
ASSERT_GE(readonly_model->subgraphs()->size(), 1);
tflite::ModelT model;
readonly_model->UnPackTo(&model);
auto subgraph = model.subgraphs[0].get();
FailOnErrorReporter error_reporter;
SubgraphQuantizer quantizer(&model, subgraph, &error_reporter);
auto status = quantizer.QuantizeOperator(0);
ASSERT_EQ(kTfLiteOk, status);
auto conv_op = subgraph->operators[0].get();
const int input_tensor_idx = 0;
const int weights_tensor_idx = 1;
const int bias_tensor_index = 2;
const int output_tensor_idx = 0;
const auto bias_tensor =
subgraph->tensors[conv_op->inputs[bias_tensor_index]].get();
const auto input_tensor =
subgraph->tensors[conv_op->inputs[input_tensor_idx]].get();
const auto weights_tensor =
subgraph->tensors[conv_op->inputs[weights_tensor_idx]].get();
const auto output_tensor =
subgraph->tensors[conv_op->outputs[output_tensor_idx]].get();
EXPECT_EQ(bias_tensor->type, TensorType_INT32);
EXPECT_EQ(input_tensor->type, TensorType_INT8);
EXPECT_EQ(weights_tensor->type, TensorType_INT8);
ASSERT_TRUE(weights_tensor->quantization);
const int out_channel_size = weights_tensor->shape[0];
std::unique_ptr<SymmetricPerChannelParams> bias_params;
std::unique_ptr<SymmetricPerChannelParams> weights_params;
ASSERT_EQ(kTfLiteOk, SymmetricPerChannelParams::ReadFromTensor(
*weights_tensor, &weights_params));
ASSERT_EQ(kTfLiteOk, SymmetricPerChannelParams::ReadFromTensor(*bias_tensor,
&bias_params));
ASSERT_EQ(bias_params->scales().size(), out_channel_size);
ASSERT_EQ(weights_params->scales().size(), out_channel_size);
ASSERT_EQ(input_tensor->quantization->scale.size(), 1);
ASSERT_EQ(output_tensor->quantization->scale.size(), 1);
const float eps = 1e-7;
// Bias scale should be input * per_channel_weight_scale.
for (size_t i = 0; i < out_channel_size; i++) {
EXPECT_NEAR(
bias_params->scales()[i],
input_tensor->quantization->scale[0] * weights_params->scales()[i],
eps);
}
const auto bias_buffer = model.buffers[bias_tensor->buffer].get();
ASSERT_EQ(bias_buffer->data.size(), sizeof(int32_t) * bias_tensor->shape[0]);
const int32_t* bias_values =
reinterpret_cast<int32_t*>(bias_buffer->data.data());
const auto original_bias_buffer =
readonly_model->buffers()->Get(bias_tensor->buffer);
const float* bias_float_buffer =
reinterpret_cast<const float*>(original_bias_buffer->data()->data());
for (size_t i = 0; i < bias_tensor->shape[0]; i++) {
auto scale = bias_params->scales()[i];
auto dequantized_value = bias_values[i] * scale;
EXPECT_NEAR(dequantized_value, bias_float_buffer[i], scale / 2);
}
const auto weights_buffer = model.buffers[weights_tensor->buffer].get();
const auto original_weights_buffer =
readonly_model->buffers()->Get(weights_tensor->buffer);
const int8_t* weight_values =
reinterpret_cast<int8_t*>(weights_buffer->data.data());
const float* weights_float_buffer =
reinterpret_cast<const float*>(original_weights_buffer->data()->data());
ASSERT_EQ(sizeof(float) * weights_buffer->data.size(),
original_weights_buffer->data()->size());
int num_values_in_channel = weights_buffer->data.size() / out_channel_size;
for (size_t channel_idx = 0; channel_idx < out_channel_size; channel_idx++) {
for (size_t j = 0; j < num_values_in_channel; j++) {
size_t element_idx = channel_idx * out_channel_size + j;
auto scale = weights_params->scales()[channel_idx];
auto dequantized_value = weight_values[element_idx] * scale;
EXPECT_NEAR(dequantized_value, weights_float_buffer[element_idx],
scale / 2);
}
}
}
} // namespace
} // namespace internal
} // namespace optimize
} // namespace tflite
int main(int argc, char** argv) {
tensorflow::string model_file;
const std::vector<tensorflow::Flag> flag_list = {
tensorflow::Flag("test_model_file", &model_file,
"Path to test tflite model file."),
};
const bool parse_result = tensorflow::Flags::Parse(&argc, argv, flag_list);
CHECK(parse_result) << "Required test_model_file";
g_test_model_dir =
new tensorflow::string(tensorflow::io::Dirname(model_file));
::tensorflow::port::InitMain(argv[0], &argc, &argv);
return RUN_ALL_TESTS();
}
| [
"gardener@tensorflow.org"
] | gardener@tensorflow.org |
a1395fb345da06b987db523034a128b6415e7904 | 356dc08b712d5cc23d1f0faacae01a145ba01f0b | /Src/sslib/Path.h | 09ef91817f9d9f2d608b1d8dc91b357a21649df9 | [
"LicenseRef-scancode-nysl-0.9982"
] | permissive | ytakanashi/TimeStampKeeper | 80f2840dbce627cf8766ee26d3495621fc782486 | 8593bd23ec2e34dadc1c90886ec892502babd5ce | refs/heads/master | 2021-12-14T13:38:46.311925 | 2021-12-06T10:47:19 | 2021-12-06T10:47:19 | 56,291,207 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,026 | h | //Path.h
#ifndef _PATH_H_CF78ED0E_4800_4E6F_903D_7DDF669BD13F
#define _PATH_H_CF78ED0E_4800_4E6F_903D_7DDF669BD13F
namespace sslib{
namespace path{
//スペースが含まれていれば'"'で囲む
tstring quote(const tstring& file_path);
//MAX_PATHを超えるパスの為の接頭辞'\\?\'を追加
tstring addLongPathPrefix(const tstring& file_path);
//MAX_PATHを超えるパスの為の接頭辞'\\?\'を削除
tstring removeLongPathPrefix(const tstring& file_path);
//ディレクトリを再帰的に検索してlistに追加
void recursiveSearch(std::list<tstring>* path_list,const TCHAR* search_dir,const TCHAR* wildcard=_T("*"),bool include_dir=false);
//ファイル名に使えない文字が含まれるかどうか
bool isBadName(const TCHAR* file_name);
//末尾にスラッシュ/バックスラッシュを追加
tstring addTailSlash(const tstring& file_path);
//末尾のスラッシュ/バックスラッシュを削除
tstring removeTailSlash(const tstring& file_path);
//区切り文字を推測、含まれなければ'\'を返す
inline int guessDelimiter(const TCHAR* file_path){
return (str::locateLastCharacter(file_path,'\\')!=-1)?
'\\':
(str::locateLastCharacter(file_path,'/')!=-1)?
'/':
'\\';
}
//カレントディレクトリを取得
tstring getCurrentDirectory();
//親ディレクトリを取得
tstring getParentDirectory(const tstring& file_path_orig);
//ルートディレクトリを取得
tstring getRootDirectory(const tstring& file_path);
//ルートディレクトリを削除
tstring removeRootDirectory(const tstring& file_path);
//実行ファイル名を取得
tstring getExeName();
//実行ファイルのディレクトリを取得
tstring getExeDirectory();
//ファイル名を取得
tstring getFileName(const tstring& file_path_orig);
//拡張子を削除
tstring removeExtension(const tstring& file_path);
//拡張子を取得
tstring getExtension(const tstring& file_path);
//短いファイル名を取得
tstring getShortPathName(const TCHAR* file_path);
//長いファイル名を取得
tstring getLongPathName(const TCHAR* file_path);
//二重引用符を取り除く
tstring removeQuotation(const tstring& file_path);
//末尾の条件に合致する文字を削除
tstring removeLastCharacters(const tstring& file_path,int(*check)(int c));
//末尾の記号を削除
tstring removeLastSymbols(const tstring& file_path);
//末尾の数字を削除
tstring removeLastNumbers(const tstring& file_path);
//末尾の数字と記号を削除
tstring removeLastNumbersAndSymbols(const tstring& file_path);
//末尾のスペースとドットを削除
tstring removeSpacesAndDots(const tstring& file_path);
//一時ディレクトリのパスを取得(末尾に\有り)
tstring getTempDirPath();
//相対パスを取得する
//注意:ディレクトリの場合末尾に区切り文字が追加される
tstring makeRelativePath(const TCHAR* base_path_orig,DWORD base_path_attr,const TCHAR* file_path_orig,DWORD file_path_attr);
//ルートであるか否か
bool isRoot(const TCHAR* file_path);
//絶対パスであるか否か
bool isAbsolutePath(const TCHAR* file_path);
//相対パスであるか否か
bool isRelativePath(const TCHAR* file_path);
//ディレクトリであるかどうか
bool isDirectory(const TCHAR* file_path);
//ファイルが存在するか否か
bool fileExists(const TCHAR* file_path);
//空のディレクトリである
bool isEmptyDirectory(const TCHAR* dir_path);
//フルパスを取得
bool getFullPath(TCHAR* full_path,unsigned int buffer_size,const TCHAR*relative_path,const TCHAR*base_dir=NULL);
//ワイルドカードを含むパスである
bool containsWildcard(const TCHAR* file_path);
//分割ファイル名の拡張子を作成
tstring createPartExtension(long count,int digit=3);
//namespace path
}
//namespace sslib
}
#endif //_PATH_H_CF78ED0E_4800_4E6F_903D_7DDF669BD13F
| [
"Y.R.Takanashi@gmail.com"
] | Y.R.Takanashi@gmail.com |
209fc2b03daeaee98aa64f246591be41b7f72726 | 13a239fb1ea5500b926fbb66709557fa2bf7a466 | /main.cpp | aa8a4c354d68bbe80d6dd4523c749242a456f3f1 | [] | no_license | DesislavaPA/OpticsApp | 21ac9ae40470aa1783392cadf7a43b9fc15e461b | 9a377d4ad408fc0efa7714677a47903ab260c290 | refs/heads/main | 2023-01-23T14:05:23.469974 | 2020-12-02T12:25:32 | 2020-12-02T12:25:32 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 13,105 | cpp | #include <iostream>
#include <fstream>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <cstring>
#include <vector>
#include <iomanip>
#include <bits/stdc++.h>
#include "./include/Suppliers.h"
#include "./include/Materials.h"
#include "./include/Optics.h"
#include "./include/main.h"
using namespace std;
/*Local DB*/
vector <Suppliers> v_suppliers;
vector <Optics> v_optics;
/*using manipulators to format the output to print the DB as table*/
void printElement(string text, int width)
{
const char separator = ' ';
cout << left << setw(width) << setfill(separator) << text;
}
/*By given bulstat to find how many optics entries he has in the DB*/
int get_optics_count(string bulstat)
{
int count = 0;
for(int i = 0; i < v_optics.size(); i++)
{
if(!bulstat.compare(v_optics[i].supplier.get_bulstat()))
count++;
}
return count;
}
bool check_if_supplier_exists(string bulstat)
{
for(int i = 0; i < v_suppliers.size(); i++)
{
if(!bulstat.compare(v_suppliers[i].get_bulstat()))
return true;
}
return false;
}
Suppliers get_supplier_from_local_db(string bulstat)
{
for(int i = 0; i < v_suppliers.size(); i++)
{
if(!bulstat.compare(v_suppliers[i].get_bulstat()))
return v_suppliers[i];
}
return Suppliers();
}
bool check_if_optics_exists(Optics *op)
{
for(int i = 0; i < v_optics.size(); i++)
{
if( (op->get_type() == v_optics[i].get_type())
&& (op->get_price() == v_optics[i].get_price())
&& (op->get_width() == v_optics[i].get_width())
&& (op->get_diopter() == v_optics[i].get_diopter())
&& (!op->get_material_type().compare(v_optics[i].get_material_type()))
&& (!op->supplier.get_bulstat().compare(v_optics[i].supplier.get_bulstat()))
)
{
return true;
}
}
return false;
}
/****************************************************
* Function Name: read_info_from_file()
* Input : The name of the file
* Logic : Read the file line by line
* Note : Used for testing purposes
*****************************************************/
void read_info_from_file(string file_name)
{
string line;
ifstream ifs(file_name);
while(getline(ifs, line)){
cout << line << '\n';
}
}
void write_suppliers_info_to_file(Suppliers s)
{
ofstream ofs("Suppliers.txt", ios_base::app);
ofs << s;
ofs.close();
}
void write_optics_info_to_file(Optics opt)
{
ofstream ofs("Optics.txt", ios_base::app);
ofs << opt;
ofs.close();
}
/*The following three functions below are used to format and print the DBs as tables*/
void show_suppliers_info()
{
if(v_suppliers.size() == 0)
return;
cout << endl << "-------------------------------------------------------------------------------------------------------------------------------" << endl;
printElement("Supplier name:", 35);
printElement("Supplier BULSTAT:", 35);
printElement("Supplier location:", 35);
printElement("Supplier phone number:", 35);
cout << endl << "===============================================================================================================================" << endl;
for(int i = 0; i < v_suppliers.size(); i++)
cout << v_suppliers[i] << endl;
cout << "-------------------------------------------------------------------------------------------------------------------------------" << endl;
}
void show_optic_header()
{
cout << endl << "-------------------------------------------------------------------------------------------------------------------------------" << endl;
printElement("Id:", 10);
printElement("Optic type:", 35);
printElement("Materials:", 35);
printElement("Diopter:", 10);
printElement("Width:", 10);
printElement("Price:", 10);
printElement("Supplier BULSTAT:", 35);
cout << endl << "===============================================================================================================================" << endl;
}
void show_optics_info()
{
const char separator = ' ';
if(v_suppliers.size() == 0)
return;
show_optic_header();
for(int i = 0; i < v_optics.size(); i++)
{
cout << left << setw(10) << setfill(separator) << i;
cout << v_optics[i] << endl;
}
cout << "-------------------------------------------------------------------------------------------------------------------------------" << endl;
}
/*****************************************************************
* Function Name: process_choice()
* Input : string choice - chosen supplier's bulstat;
* vector<double> order_prices - list with the
prices of all product that the user will order;
* Return : true - the user want to continue ordering;
* false - user completed the order;
* Logic : If the user entered "exit" calculate the cost
of the order; else show the optics of the chosen
supplier;
*****************************************************************/
bool process_choice(string choice, vector<double> order_prices)
{
double order_price = 0.0;
const char separator = ' ';
if(!choice.compare("exit"))
{
for(int i = 0; i < order_prices.size(); i++)
order_price += order_prices[i];
if(order_price > 0)
cout << endl << "The total cost of your order is:" << order_price << " lv" << endl;
return false;
}
else
{
if(get_optics_count(choice))
{
show_optic_header();
for(int i = 0; i < v_optics.size(); i++)
{
if(!choice.compare(v_optics[i].supplier.get_bulstat()))
{
cout << left << setw(10) << setfill(separator) << i;
cout << v_optics[i] << endl;
}
}
cout << "----------------------------------------------------------------------------------------------------------------------" << endl;
}
}
return true;
}
/*************************************************************
* Function Name: check_optics_id()
* Input : The bulstat of the chosen supplier;
The id of the chosen product/optics;
* Return : true - entered id is correct;
false - entered id is not correct;
* Logic : The id's of the products/optics from one
supplier are not consistently ordered. This
function finds out if the entered id is
relevant for the chosen supplier;
**************************************************************/
bool check_optics_id(string bulstat, int id)
{
for(int i = 0; i < v_optics.size(); i++)
{
if(!bulstat.compare(v_optics[i].supplier.get_bulstat()))
{
if(i == id)
return true;
}
}
return false;
}
/****************************************************************
* Function Name: order_products_from_supplier()
* Input : The bulstat of the chosen supplier;
* Return : The final cost of the ordered items from this
supplier;
* Logic : If supplier has products, allow user to add as
many as he want, until he presses "-1" which
indicates you should calculate the final
cost of the added products and return it;
*****************************************************************/
double order_products_from_supplier(string bulstat)
{
int id = 0;
int product_count = 0;
double order_price = 0.0;
double product_price = 0.0;
vector<double> orders;
if(!get_optics_count(bulstat))
{
cout << "This supplier doesn't have products yet!" << endl;
return 0;
}
while(1)
{
cout << endl << "Enter the ID of the product/s you want to order!" << endl;
cout << "Enter '-1' if you want to complete the order from this supplier!" << endl;
cin >> id;
if(id != -1)
{
if( id < 0 || !check_optics_id(bulstat, id))
{
cout << "Chosen ID is wrong!" << endl;
continue;
}
cout << endl << "How many pieces of this product would you like to order?" << endl;
cin >> product_count;
product_price = v_optics.at(id).get_price();
order_price = product_price * product_count;
orders.push_back(order_price);
order_price = 0.0;
}
else
break;
}
for(int i = 0; i < orders.size(); i++)
order_price += orders[i];
return order_price;
}
/*********************************************************
* Function Name: MakeOrders()
* Description : Handles the case of ordering products
until the user presses "exit". Keep the
costs of all the prices from different
suppliers which will be used at the end
to calculate the final cost of the order;
**********************************************************/
void MakeOrders()
{
string choice;
double order_price = 0.0;
vector<double> order_prices;
show_suppliers_info();
while(1)
{
cout << endl << "Enter 'exit' if you want to return to the main menu!" << endl;
cout << "Enter supplier BULSTAT to view his products:" << endl;
if(!cin)
{
cin.clear();
cin.ignore(numeric_limits<streamsize>::max(),'\n');
}
getline(cin, choice);
if(!process_choice(choice, order_prices))
return;
order_price = order_products_from_supplier(choice);
order_prices.push_back(order_price);
}
return;
}
/*******************************************************************
* Function Name: enterSuppliersInfo()
* Description : Handles the case of adding new supplier in the DB
* Logic : Get the data from user input, create new Supplier
object, add it in the local DB and into the file;
Checks for duplicated bulstats;
* Notes : NONE
********************************************************************/
void enterSuppliersInfo()
{
Suppliers supplier;
int err = supplier.create_new_supplier_from_ui(&supplier);
if(!err)
{
v_suppliers.push_back(supplier);
write_suppliers_info_to_file(supplier);
//used for testing
//read_info_from_file("Suppliers.txt");
}
else
cout << "Supplier with this bulstat already exists!" << endl;
}
/****************************************************************
* Function Name: enterOpticsInfo()
* Description : Handles the case of adding new optics in the DB
* Logic : Get the data from user input, create new Optics
object, add it in the local DB and into the file;
Checks for duplicated entries and exsisting
suppliers;
* Notes : NONE
******************************************************************/
void enterOpticsInfo()
{
Optics optic;
int err = optic.create_new_optics_from_ui(&optic);
if(!err)
{
v_optics.push_back(optic);
write_optics_info_to_file(optic);
//used for testing
//read_info_from_file("Optics.txt");
}
else
cout << "Couldn't create optic entry!" << endl;
}
/***************************************************************
* Function Name: convert_line_to_obj()
* Description : Function that takes line read from file,
splits the data, create and add an object
(Supplier/Optics) in the local DB, depending
on the given type (SUPPLIER_OBJ/OPTICS_OBJ);
* Input : string line - line read from file;
* int type - type of object to create;
****************************************************************/
void convert_line_to_obj(string line, int type)
{
stringstream check(line);
vector <string> obj_elements;
string obj_element;
string::size_type sz;
while(getline(check, obj_element, '#'))
obj_elements.push_back(obj_element);
//https://stackoverflow.com/questions/5685471/error-jump-to-case-label
switch(type)
{
case SUPPLIER_OBJ:
{
/*Indexes*/
/*1 - name; 2 - bulstat; 3 - location; 4 - phone_number;*/
Suppliers supplier(obj_elements[1], obj_elements[2], obj_elements[3], obj_elements[4]);
v_suppliers.push_back(supplier);
}
break;
case OPTICS_OBJ:
{
/*Indexes*/
/*1 - type; 2 - price; 3 - material type; 4 - width; 5 - diopter; 6 - supplier name;*/
Optics optic(obj_elements[1], stod (obj_elements[2], &sz), stod (obj_elements[4], &sz), stod (obj_elements[5], &sz), obj_elements[3], obj_elements[6]);
v_optics.push_back(optic);
}
break;
default:
break;
}
}
void read_startup_db(string file_name, int type)
{
string line;
ifstream ifs(file_name);
while(getline(ifs, line))
convert_line_to_obj(line, type);
}
void print_menu()
{
cout << "Menu: " << endl;
cout << "Press '1' to enter new supplier in the DB! " << endl;
cout << "Press '2' to enter optics information in the DB! " << endl;
cout << "Press '3' to order materials from a supplier!" << endl;
cout << "Press '4' to view full db!" << endl;
cout << "Press '5' to exit the program! " << endl;
}
int main()
{
int choice = 0;
read_startup_db("Suppliers.txt", SUPPLIER_OBJ);
read_startup_db("Optics.txt", OPTICS_OBJ);
while(1)
{
print_menu();
cout << endl << "Enter the next operation you would like to proceed: " << endl;
cin >> choice;
switch ( choice ) {
case 1:
enterSuppliersInfo();
break;
case 2:
enterOpticsInfo();
break;
case 3:
MakeOrders();
break;
case 4:
show_suppliers_info();
show_optics_info();
break;
case 5:
exit(1);
break;
default:
break;
}
}
return 0;
}
| [
"dessiandreeva10@gmail.com"
] | dessiandreeva10@gmail.com |
c2a15d0237b9b3237da51588b84ee98e8a46da28 | fbd563aafc1c5b5a54e1d1f78b5328f1a51a3540 | /chrome/updater/app/server/win/server.h | a4b75cd100ebc7bd4241949f46372464a4ce8e38 | [
"BSD-3-Clause"
] | permissive | EiraGe/chromium | 47e40a127cdfcd89b8eac93c23572c8762ce4913 | 4aab8648a821dd0c432b1b5abc2435723a272d98 | refs/heads/master | 2022-12-04T17:32:53.054384 | 2020-06-25T20:55:34 | 2020-06-25T20:55:34 | 246,615,946 | 0 | 0 | BSD-3-Clause | 2020-03-11T15:58:42 | 2020-03-11T15:58:41 | null | UTF-8 | C++ | false | false | 3,428 | h | // Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_UPDATER_APP_SERVER_WIN_SERVER_H_
#define CHROME_UPDATER_APP_SERVER_WIN_SERVER_H_
#include <wrl/implements.h>
#include <wrl/module.h>
#include <string>
#include "base/memory/scoped_refptr.h"
#include "base/sequenced_task_runner.h"
#include "base/win/scoped_com_initializer.h"
#include "chrome/updater/app/app.h"
#include "chrome/updater/update_service.h"
namespace updater {
class Configurator;
class UpdateService;
// The COM objects involved in this server are free threaded. Incoming COM calls
// arrive on COM RPC threads. Outgoing COM calls are posted from a blocking
// sequenced task runner in the thread pool. Calls to the update service occur
// in the main sequence, which is bound to the main thread.
//
// The free-threaded COM objects exposed by this server are entered either by
// COM RPC threads, when their functions are invoked by COM clients, or by
// threads from the updater's thread pool, when callbacks posted by the
// update service are handled. Access to the shared state maintained by these
// objects is synchronized by a lock. The sequencing of callbacks is ensured
// by using a sequenced task runner, since the callbacks can't use base
// synchronization primitives on the main sequence where they are posted from.
//
// This class is responsible for the lifetime of the COM server, as well as
// class factory registration.
//
// The instance of the this class is managed by a singleton and it leaks at
// runtime.
class ComServerApp : public App {
public:
ComServerApp();
scoped_refptr<base::SequencedTaskRunner> main_task_runner() {
return main_task_runner_;
}
scoped_refptr<UpdateService> service() { return service_; }
private:
~ComServerApp() override;
// Overrides for App.
void InitializeThreadPool() override;
void Initialize() override;
void FirstTaskRun() override;
// Registers and unregisters the out-of-process COM class factories.
HRESULT RegisterClassObjects();
void UnregisterClassObjects();
// Waits until the last COM object is released.
void WaitForExitSignal();
// Called when the last object is released.
void SignalExit();
// Creates an out-of-process WRL Module.
void CreateWRLModule();
// Handles object unregistration then triggers program shutdown. This
// function runs on a COM RPC thread when the WRL module is destroyed.
void Stop();
// Identifier of registered class objects used for unregistration.
DWORD cookies_[2] = {};
// While this object lives, COM can be used by all threads in the program.
base::win::ScopedCOMInitializer com_initializer_;
// Task runner bound to the main sequence and the update service instance.
scoped_refptr<base::SequencedTaskRunner> main_task_runner_;
// The UpdateService to use for handling the incoming COM requests. This
// instance of the service runs the in-process update service code, which is
// delegating to the update_client component.
scoped_refptr<UpdateService> service_;
// The updater's Configurator.
scoped_refptr<Configurator> config_;
};
// Returns a singleton application object bound to this COM server.
scoped_refptr<ComServerApp> AppServerSingletonInstance();
} // namespace updater
#endif // CHROME_UPDATER_APP_SERVER_WIN_SERVER_H_
| [
"commit-bot@chromium.org"
] | commit-bot@chromium.org |
4f81d52b8ab4c4310d4db63ea209c21ace589abf | 12b3d6a41cc251e2e78d88f0ca761b5d2c08f80c | /include/Strategie.hpp | 9fc1f63e1cd2bbe31ee52f0e6d53250c118dd529 | [] | no_license | alexquenelle/Epitech-Project-Trade | 6dcfefa9ff5613a5fdc29a048289914619aee8b3 | e9b6079aafed96b968fc1c66b31178dfd98ee0bb | refs/heads/main | 2023-06-16T14:29:06.810066 | 2021-06-29T16:08:43 | 2021-06-29T16:08:43 | 381,421,944 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 428 | hpp | /*
** EPITECH PROJECT, 2021
** B-CNA-410-BDX-4-1-trade-alexandre.quenelle
** File description:
** Strategie
*/
#ifndef STRATEGIE_HPP_
#define STRATEGIE_HPP_
#include "manager.hpp"
#include "Crypto.hpp"
#include "Settings.hpp"
void run_strategie(Crypto *USDT_BTC, Crypto *USDT_ETH, Crypto *BTC_ETH, Settings *settings);
double get_amount_crypto(Crypto *crypto, float percent_of_usdt, value pair);
#endif /* !STRATEGIE_HPP_ */ | [
"noreply@github.com"
] | alexquenelle.noreply@github.com |
42460ad64d0a4f122e13de919b3ebff2bc0478d8 | 5df66b7c0cf0241831ea7d8345aa4102f77eba03 | /Carberp Botnet/source - absource/pro/all source/BlackJoeWhiteJoe/include/pipnss/nsIKeyModule.h | c58f16d5c2f5366d05d282dd7c46d65a13b5e940 | [
"LicenseRef-scancode-warranty-disclaimer"
] | no_license | bengalm/fireroothacker | e8f20ae69f4246fc4fe8c48bbb107318f7a79265 | ceb71ba972caca198524fe91a45d1e53b80401f6 | refs/heads/main | 2023-04-02T03:00:41.437494 | 2021-04-06T00:26:28 | 2021-04-06T00:26:28 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 8,247 | h | /*
* DO NOT EDIT. THIS FILE IS GENERATED FROM e:/builds/moz2_slave/mozilla-1.9.1-win32-xulrunner/build/security/manager/ssl/public/nsIKeyModule.idl
*/
#ifndef __gen_nsIKeyModule_h__
#define __gen_nsIKeyModule_h__
#ifndef __gen_nsISupports_h__
#include "nsISupports.h"
#endif
/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
/* starting interface: nsIKeyObject */
#define NS_IKEYOBJECT_IID_STR "4b31f4ed-9424-4710-b946-79b7e33cf3a8"
#define NS_IKEYOBJECT_IID \
{0x4b31f4ed, 0x9424, 0x4710, \
{ 0xb9, 0x46, 0x79, 0xb7, 0xe3, 0x3c, 0xf3, 0xa8 }}
class NS_NO_VTABLE NS_SCRIPTABLE nsIKeyObject : public nsISupports {
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IKEYOBJECT_IID)
enum { SYM_KEY = 1 };
enum { PRIVATE_KEY = 2 };
enum { PUBLIC_KEY = 3 };
enum { RC4 = 1 };
enum { AES_CBC = 2 };
enum { HMAC = 257 };
/* [noscript] void initKey (in short aAlgorithm, in voidPtr aKey); */
NS_IMETHOD InitKey(PRInt16 aAlgorithm, void * aKey) = 0;
/* [noscript] voidPtr getKeyObj (); */
NS_IMETHOD GetKeyObj(void * *_retval NS_OUTPARAM) = 0;
/* short getType (); */
NS_SCRIPTABLE NS_IMETHOD GetType(PRInt16 *_retval NS_OUTPARAM) = 0;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsIKeyObject, NS_IKEYOBJECT_IID)
/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIKEYOBJECT \
NS_IMETHOD InitKey(PRInt16 aAlgorithm, void * aKey); \
NS_IMETHOD GetKeyObj(void * *_retval NS_OUTPARAM); \
NS_SCRIPTABLE NS_IMETHOD GetType(PRInt16 *_retval NS_OUTPARAM);
/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIKEYOBJECT(_to) \
NS_IMETHOD InitKey(PRInt16 aAlgorithm, void * aKey) { return _to InitKey(aAlgorithm, aKey); } \
NS_IMETHOD GetKeyObj(void * *_retval NS_OUTPARAM) { return _to GetKeyObj(_retval); } \
NS_SCRIPTABLE NS_IMETHOD GetType(PRInt16 *_retval NS_OUTPARAM) { return _to GetType(_retval); }
/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIKEYOBJECT(_to) \
NS_IMETHOD InitKey(PRInt16 aAlgorithm, void * aKey) { return !_to ? NS_ERROR_NULL_POINTER : _to->InitKey(aAlgorithm, aKey); } \
NS_IMETHOD GetKeyObj(void * *_retval NS_OUTPARAM) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetKeyObj(_retval); } \
NS_SCRIPTABLE NS_IMETHOD GetType(PRInt16 *_retval NS_OUTPARAM) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetType(_retval); }
#if 0
/* Use the code below as a template for the implementation class for this interface. */
/* Header file */
class nsKeyObject : public nsIKeyObject
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIKEYOBJECT
nsKeyObject();
private:
~nsKeyObject();
protected:
/* additional members */
};
/* Implementation file */
NS_IMPL_ISUPPORTS1(nsKeyObject, nsIKeyObject)
nsKeyObject::nsKeyObject()
{
/* member initializers and constructor code */
}
nsKeyObject::~nsKeyObject()
{
/* destructor code */
}
/* [noscript] void initKey (in short aAlgorithm, in voidPtr aKey); */
NS_IMETHODIMP nsKeyObject::InitKey(PRInt16 aAlgorithm, void * aKey)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* [noscript] voidPtr getKeyObj (); */
NS_IMETHODIMP nsKeyObject::GetKeyObj(void * *_retval NS_OUTPARAM)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* short getType (); */
NS_IMETHODIMP nsKeyObject::GetType(PRInt16 *_retval NS_OUTPARAM)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* End of implementation class template. */
#endif
/* starting interface: nsIKeyObjectFactory */
#define NS_IKEYOBJECTFACTORY_IID_STR "264eb54d-e20d-49a0-890c-1a5986ea81c4"
#define NS_IKEYOBJECTFACTORY_IID \
{0x264eb54d, 0xe20d, 0x49a0, \
{ 0x89, 0x0c, 0x1a, 0x59, 0x86, 0xea, 0x81, 0xc4 }}
class NS_NO_VTABLE NS_SCRIPTABLE nsIKeyObjectFactory : public nsISupports {
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IKEYOBJECTFACTORY_IID)
/* nsIKeyObject lookupKeyByName (in ACString aName); */
NS_SCRIPTABLE NS_IMETHOD LookupKeyByName(const nsACString & aName, nsIKeyObject **_retval NS_OUTPARAM) = 0;
/* nsIKeyObject unwrapKey (in short aAlgorithm, [array, size_is (aWrappedKeyLen), const] in octet aWrappedKey, in unsigned long aWrappedKeyLen); */
NS_SCRIPTABLE NS_IMETHOD UnwrapKey(PRInt16 aAlgorithm, const PRUint8 *aWrappedKey, PRUint32 aWrappedKeyLen, nsIKeyObject **_retval NS_OUTPARAM) = 0;
/* nsIKeyObject keyFromString (in short aAlgorithm, in ACString aKey); */
NS_SCRIPTABLE NS_IMETHOD KeyFromString(PRInt16 aAlgorithm, const nsACString & aKey, nsIKeyObject **_retval NS_OUTPARAM) = 0;
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsIKeyObjectFactory, NS_IKEYOBJECTFACTORY_IID)
/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIKEYOBJECTFACTORY \
NS_SCRIPTABLE NS_IMETHOD LookupKeyByName(const nsACString & aName, nsIKeyObject **_retval NS_OUTPARAM); \
NS_SCRIPTABLE NS_IMETHOD UnwrapKey(PRInt16 aAlgorithm, const PRUint8 *aWrappedKey, PRUint32 aWrappedKeyLen, nsIKeyObject **_retval NS_OUTPARAM); \
NS_SCRIPTABLE NS_IMETHOD KeyFromString(PRInt16 aAlgorithm, const nsACString & aKey, nsIKeyObject **_retval NS_OUTPARAM);
/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIKEYOBJECTFACTORY(_to) \
NS_SCRIPTABLE NS_IMETHOD LookupKeyByName(const nsACString & aName, nsIKeyObject **_retval NS_OUTPARAM) { return _to LookupKeyByName(aName, _retval); } \
NS_SCRIPTABLE NS_IMETHOD UnwrapKey(PRInt16 aAlgorithm, const PRUint8 *aWrappedKey, PRUint32 aWrappedKeyLen, nsIKeyObject **_retval NS_OUTPARAM) { return _to UnwrapKey(aAlgorithm, aWrappedKey, aWrappedKeyLen, _retval); } \
NS_SCRIPTABLE NS_IMETHOD KeyFromString(PRInt16 aAlgorithm, const nsACString & aKey, nsIKeyObject **_retval NS_OUTPARAM) { return _to KeyFromString(aAlgorithm, aKey, _retval); }
/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIKEYOBJECTFACTORY(_to) \
NS_SCRIPTABLE NS_IMETHOD LookupKeyByName(const nsACString & aName, nsIKeyObject **_retval NS_OUTPARAM) { return !_to ? NS_ERROR_NULL_POINTER : _to->LookupKeyByName(aName, _retval); } \
NS_SCRIPTABLE NS_IMETHOD UnwrapKey(PRInt16 aAlgorithm, const PRUint8 *aWrappedKey, PRUint32 aWrappedKeyLen, nsIKeyObject **_retval NS_OUTPARAM) { return !_to ? NS_ERROR_NULL_POINTER : _to->UnwrapKey(aAlgorithm, aWrappedKey, aWrappedKeyLen, _retval); } \
NS_SCRIPTABLE NS_IMETHOD KeyFromString(PRInt16 aAlgorithm, const nsACString & aKey, nsIKeyObject **_retval NS_OUTPARAM) { return !_to ? NS_ERROR_NULL_POINTER : _to->KeyFromString(aAlgorithm, aKey, _retval); }
#if 0
/* Use the code below as a template for the implementation class for this interface. */
/* Header file */
class nsKeyObjectFactory : public nsIKeyObjectFactory
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIKEYOBJECTFACTORY
nsKeyObjectFactory();
private:
~nsKeyObjectFactory();
protected:
/* additional members */
};
/* Implementation file */
NS_IMPL_ISUPPORTS1(nsKeyObjectFactory, nsIKeyObjectFactory)
nsKeyObjectFactory::nsKeyObjectFactory()
{
/* member initializers and constructor code */
}
nsKeyObjectFactory::~nsKeyObjectFactory()
{
/* destructor code */
}
/* nsIKeyObject lookupKeyByName (in ACString aName); */
NS_IMETHODIMP nsKeyObjectFactory::LookupKeyByName(const nsACString & aName, nsIKeyObject **_retval NS_OUTPARAM)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* nsIKeyObject unwrapKey (in short aAlgorithm, [array, size_is (aWrappedKeyLen), const] in octet aWrappedKey, in unsigned long aWrappedKeyLen); */
NS_IMETHODIMP nsKeyObjectFactory::UnwrapKey(PRInt16 aAlgorithm, const PRUint8 *aWrappedKey, PRUint32 aWrappedKeyLen, nsIKeyObject **_retval NS_OUTPARAM)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* nsIKeyObject keyFromString (in short aAlgorithm, in ACString aKey); */
NS_IMETHODIMP nsKeyObjectFactory::KeyFromString(PRInt16 aAlgorithm, const nsACString & aKey, nsIKeyObject **_retval NS_OUTPARAM)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* End of implementation class template. */
#endif
#endif /* __gen_nsIKeyModule_h__ */
| [
"ludi@ps.ac.cn"
] | ludi@ps.ac.cn |
d78bfe997b73ce0acc8bc1dcd9743ec3965a15e4 | 79da5b42f7708d6b44b83b621eb8cd534f4d5282 | /src/oldFiles/main.cpp | e5ea9e4a1dd4498755647048bc30ef62b5290f85 | [] | no_license | Saafan/HospitalMazeGame | 12dd6431a07c70e5c827cc4af54fc9e70dce8503 | 638875b20976a7a3fde662989b710eeb7f56bb59 | refs/heads/master | 2023-02-15T12:27:42.996258 | 2021-01-15T00:47:58 | 2021-01-15T00:47:58 | 320,993,866 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 34,529 | cpp | #include <algorithm>
#include <sstream>
#include <iomanip>
#include <fstream>
#include <windows.h>
#include "TextureBuilder.h"
#include "Model_3DS.h"
#include "GLTexture.h"
#include "Renderer.h"
#include "Model.h"
#include "Object.h"
#include "ModelsGenerator.h"
#include "Randomize.h"
#include <math.h>
#include "UI.h"
#include "LightModel.h"
std::vector<Object> objs;
GLTexture tex_ground;
std::vector<bool> modelExpand(objs.size(), false);
std::vector<float[3]> modelTrans(objs.size());
std::vector<LightModel> lights;
Model sphere;
std::vector<bool> views{ true, false, false };
bool backup = false;
bool updateData = true;
Model* lastHit = nullptr;
vec3 cameraPos;
vec3 cameraCenter;
int coinsVal = 0;
int scoreVal = 0;
int healthVal = 100;
UI coins({ 1.00f, 0.0f, 0.0f }, "Coins: ", & coinsVal, { 1.2f, 2.2f, 0.0f });
UI health({ 1.00f, 0.0f, 0.0f }, "Health: ", & healthVal, { 1.2f, 1.90f, 0.0f }, "%%");
int WIDTH = 1100;
int HEIGHT = 950;
bool rotateAround = false;
bool moveWithCenter = true;
bool mouseLock = false;
float mouseDeltX, mouseDeltY = 0;
float radius = 1.5f;
float angle = -45.11f;
float elapsedTime = 0.0f;
static float lightColor[]{ 1.0f, 1.0f, 1.0f };
static float lightPos[]{ 5.6f, 10.0f, 7.5f };
void WriteHeader();
std::stringstream code;
std::vector<Model> models;
std::vector<std::vector<Model>> modelsHistory;
bool firstPerson = true;
vec3 GetCharacterPos()
{
vec3 pos;
for (const auto& model : models)
{
if (model.group != -1)
if (objs.at(model.group).name._Equal("Character"))
if (model.collider)
{
pos.x = model.position.at(0);
pos.y = model.position.at(1);
pos.z = model.position.at(2);
}
}
return pos;
}
vec3 firstCenter;
vec3 thirdCenter;
float firstAngle;
void SetupCamera()
{
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
//glOrtho(-0.5, 0.5, -0.5, 0.5, -1, 1);
gluPerspective(60, 16 / 9, 0.001, 100);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
if (rotateAround)
{
cameraPos.x = std::sin(angle * 3.14f / 180.0f) * radius;
cameraPos.z = std::cos(angle * 3.14f / 180.0f) * radius;
}
if (firstPerson)
{
firstCenter.x = -std::cos(firstAngle * 3.14f / 180.0f) * 10;
firstCenter.z = std::sin(firstAngle * 3.14f / 180.0f) * 10;
gluLookAt(cameraPos.x, cameraPos.y + 0.6f, cameraPos.z, cameraPos.x + firstCenter.x, cameraCenter.y + firstCenter.y, cameraPos.z + firstCenter.z, 0.0f, 1.0f, 0.0f);
}
else
{
thirdCenter.x = -std::cos(firstAngle * 3.14f / 180.0f) * 4;
thirdCenter.z = std::sin(firstAngle * 3.14f / 180.0f) * 4;
gluLookAt(cameraPos.x + thirdCenter.x, cameraPos.y + 3.0, cameraPos.z + thirdCenter.z, cameraCenter.x, cameraCenter.y, cameraCenter.z, 0.0f, 1.0f, 0.0f);
}
}
void SetupLights()
{
for (auto& light : lights)
light.Render();
}
void SortObjects()
{
for (auto& objOfGroup : objs)
if (!objOfGroup.obj.empty())
objOfGroup.obj.clear();
for (auto& model : models)
if (model.group != -1)
{
objs.at(model.group).obj.push_back(&model);
model.groupCenter = objs.at(model.group).center;
model.groupTrans = objs.at(model.group).transGroup;
}
}
void ShowModelAttributes(Model& model, std::string name)
{
if (!model.path.empty())
name = model.GetName() + " " + model.id;
ImGui::Checkbox(std::string("Select " + model.id).c_str(), &model.selected); ImGui::SameLine();
if (ImGui::CollapsingHeader(name.c_str()))
{
ImGui::Checkbox(std::string("Hide " + model.id).c_str(), &(model.hidden));
ImGui::Checkbox(std::string("Uniform Scale " + model.id).c_str(), &model.uniformScale);
ImGui::ColorEdit3(std::string("Color " + model.id).c_str(), &model.color.R);
ImGui::DragFloat3(std::string("Position " + model.id).c_str(), &model.position.at(0), 0.01f);
if (model.uniformScale)
{
ImGui::DragFloat(std::string("Scale " + model.id).c_str(), &model.scale.at(0), 0.001f);
model.scale.at(2) = model.scale.at(1) = model.scale.at(0);
}
else
ImGui::DragFloat3(std::string("Scale " + model.id).c_str(), &model.scale.at(0), 0.001f);
ImGui::DragFloat3(std::string("Rotate " + model.id).c_str(), &model.rotate.at(0), 0.5f);
if (model.GetPrimitive() == Primitive::Tours)
{
ImGui::DragFloat(std::string("Inner Radius " + model.id).c_str(), &model.size, 0.1f);
ImGui::DragFloat(std::string("Outer Radius " + model.id).c_str(), &model.modelHeight, 0.1f);
}
if (model.GetPrimitive() == Primitive::Cone)
{
ImGui::DragFloat(std::string("Base " + model.id).c_str(), &model.size, 0.05f);
ImGui::DragFloat(std::string("Height " + model.id).c_str(), &model.modelHeight, 0.05f);
}
if (model.GetPrimitive() == Primitive::Sphere)
{
ImGui::DragFloat(std::string("Radius " + model.id).c_str(), &model.size, 0.01f);
}
if (model.GetPrimitive() == Primitive::Cylinder)
{
ImGui::DragFloat(std::string("Base Radius " + model.id).c_str(), &model.size, 0.01f);
ImGui::DragFloat(std::string("Top Radius " + model.id).c_str(), &model.radius, 0.01f);
ImGui::DragFloat(std::string("Height " + model.id).c_str(), &model.modelHeight, 0.01f);
}
if (model.GetPrimitive() != Primitive::Cube && model.GetPrimitive() != Primitive::WireCube && model.GetPrimitive() != Primitive::Teapot && model.GetPrimitive() != Primitive::Model)
{
ImGui::DragInt(std::string("Slices " + model.id).c_str(), &model.slices, 1);
ImGui::DragInt(std::string("Stacks " + model.id).c_str(), &model.stacks, 1);
}
if (model.GetPrimitive() == Primitive::Model)
{
static char tempBuf[60] = { 0 };
ImGui::InputText(std::string("Model Name " + model.id + " " + model.path).c_str(), tempBuf, IM_ARRAYSIZE(tempBuf));
ImGui::SameLine();
if (ImGui::Button(std::string("Apply Path Model" + model.id).c_str()))
model.Assign3DModel("models/" + std::string(tempBuf) + "/" + std::string(tempBuf) + ".3ds");
}
if (model.GetPrimitive() == Primitive::WireCube)
{
ImGui::Checkbox(std::string("Animate Within " + model.id).c_str(), &model.animated);
ImGui::Checkbox(std::string("Collider " + model.id).c_str(), &model.collider);
if (ImGui::CollapsingHeader(std::string("Sound: " + name).c_str()))
{
static char tempBuf0[60] = { 0 };
ImGui::InputText(std::string("Collision Sound Name " + model.id).c_str(), tempBuf0, IM_ARRAYSIZE(tempBuf0));
ImGui::SameLine();
if (ImGui::Button(std::string("Apply Path Sound" + model.id).c_str()))
model.soundFileName = tempBuf0;
static char tempBuf1[60] = { 0 };
ImGui::InputText(std::string("Animation Sound Name " + model.id).c_str(), tempBuf1, IM_ARRAYSIZE(tempBuf1));
ImGui::SameLine();
if (ImGui::Button(std::string("Apply Path AnimSound" + model.id).c_str()))
model.animSoundFileName = tempBuf1;
}
}
if (ImGui::CollapsingHeader(std::string("Animate: " + name).c_str()))
{
ImGui::DragFloat3("Animate Pos", &model.transFactor[0], 0.0001); ImGui::SameLine();
if (ImGui::Button(std::string("Reset Pos" + model.id).c_str()))
model.transFactor[0] = model.transFactor[1] = model.transFactor[2] = 0.0f;
ImGui::DragFloat3("Animate Rot", &model.rotFactor[0], 0.0001); ImGui::SameLine();
if (ImGui::Button(std::string("Reset Rot" + model.id).c_str()))
model.rotFactor[0] = model.rotFactor[1] = model.rotFactor[2] = 0.0f;
ImGui::DragFloat3("Animate Scale", &model.scaleFactor[0], 0.0001); ImGui::SameLine();
if (ImGui::Button(std::string("Reset Scale" + model.id).c_str()))
model.scaleFactor[0] = model.scaleFactor[1] = model.scaleFactor[2] = 0.0f;
ImGui::DragFloat("Animation Time", &model.animTime, 0.001);
}
if (ImGui::Button(std::string("Reset Position: " + name).c_str()))
model.position.at(0) = model.position.at(1) = model.position.at(2) = 0;
ImGui::SameLine();
if (ImGui::Button(std::string("Reset Rotation: " + name).c_str()))
model.rotate.at(0) = model.rotate.at(1) = model.rotate.at(2) = 0;
ImGui::SameLine();
if (ImGui::Button(std::string("Reset Scale: " + name).c_str()))
model.scale.at(0) = model.scale.at(1) = model.scale.at(2) = 1;
ImGui::SameLine();
if (ImGui::Button(std::string("Reset Color: " + name).c_str()))
model.color.R = model.color.G = model.color.B = 1;
if (ImGui::Button(std::string("Delete: " + name).c_str()))
{
for (size_t q = 0; q < models.size(); q++)
if (&models.at(q) == &model)
models.erase(models.begin() + q);
SortObjects();
return;
}
if (ImGui::Button(std::string("Duplicate: " + name).c_str()))
{
Model newModel = model;
newModel.id = std::to_string(model.numofModels++);
models.push_back(newModel);
SortObjects();
return;
}
ImGui::Indent(20);
if (ImGui::CollapsingHeader(std::string("Group " + name + " in ").c_str()))
for (size_t i = 0; i < objs.size(); i++)
{
if (ImGui::Button(std::string(objs.at(i).name + " " + name).c_str()))
{
model.group = i;
SortObjects();
}
if ((i % 3 != 0) || i == 0)
ImGui::SameLine();
}
ImGui::Spacing();
ImGui::Unindent(20);
if (ImGui::Button(std::string("Delete " + model.id + " from Group").c_str()))
{
model.group = -1;
model.TranslateAccum(model.groupTrans.at(0), model.groupTrans.at(1), model.groupTrans.at(2));
model.groupCenter.at(0) = model.groupCenter.at(1) = model.groupCenter.at(2) = 0.0f;
model.groupTrans.at(0) = model.groupTrans.at(1) = model.groupTrans.at(2) = 0.0f;
SortObjects();
}
ImGui::Spacing();
}
}
void CheckAllCollisions();
Model cubeDirection;
void RenderUI()
{
glDisable(GL_DEPTH_TEST);
if (firstPerson)
{
coins.Translate(cameraPos.x + firstCenter.x, cameraCenter.y + firstCenter.y + 4.4f, cameraPos.z + firstCenter.z);
health.Translate(cameraPos.x + firstCenter.x, cameraCenter.y + firstCenter.y + 4.0f, cameraPos.z + firstCenter.z);
}
else
{
coins.Translate(cameraCenter.x, cameraCenter.y + 2.2f, cameraCenter.z);
health.Translate(cameraCenter.x, cameraCenter.y + 2.0f, cameraCenter.z);
}
coins.Render();
health.Render();
glEnable(GL_DEPTH_TEST);
}
void ClearSelected()
{
for (auto& model : models)
model.selected = false;
}
void SelectUnSelectGroup(int i)
{
for (auto& model : models)
if (model.group == i)
model.selected = !model.selected;
}
void MouseMove()
{
ImGuiIO& io = ImGui::GetIO();
mouseDeltX = io.MouseDelta.x / 100.0f;
mouseDeltY = io.MouseDelta.y / 100.0f;
if (io.MouseDown[0] && !ImGui::IsAnyWindowHovered() && !ImGui::IsAnyWindowFocused())
{
for (auto& model : models)
if (model.selected)
model.TranslateAccum(-mouseDeltY, 0, mouseDeltX);
if (io.MouseDown[0] && !mouseLock)
firstAngle -= mouseDeltX * 10;
}
}
void RenderIMGUI()
{
CheckAllCollisions();
MouseMove();
cameraPos = GetCharacterPos();
static bool showCode = false;
ImGui::Begin("3D Editor");
ImGui::Checkbox("Lock Mouse", &mouseLock);
if (ImGui::Button("Unselect All"))
ClearSelected();
static int selectedType = 1;
ImGui::RadioButton("First Person View", &selectedType, 0); ImGui::SameLine();
ImGui::RadioButton("Third Person View", &selectedType, 1);
if (selectedType == 0)
firstPerson = true;
else
firstPerson = false;
ImGui::Checkbox("Show Code", &showCode);
if (ImGui::CollapsingHeader("Camera Settings"))
{
if (ImGui::Button("Reset Camera Position"))
{
cameraPos.x = cameraPos.y = cameraPos.z = 0;
cameraCenter.x = cameraCenter.y = cameraCenter.z = 0;
angle = 0.0f;
radius = 1.5f;
}
static int selectedType = 1;
ImGui::RadioButton("Rotate Around", &selectedType, 0); ImGui::SameLine();
ImGui::RadioButton("Move with Center", &selectedType, 1);
rotateAround = false;
moveWithCenter = false;
if (selectedType == 0)
rotateAround = true;
if (selectedType == 1)
moveWithCenter = true;
ImGui::DragFloat3("Camera Eye", &cameraPos.x, 0.1f);
ImGui::DragFloat3("Camera Center", &cameraCenter.x, 0.1f);
}
if (ImGui::CollapsingHeader("UI"))
{
if (ImGui::Button("Reset Camera Position"))
{
}
ImGui::DragFloat3("Camera Center", &cameraCenter.x, 0.1f);
}
if (ImGui::CollapsingHeader("Light Settings"))
{
if (ImGui::Button("Reset Light Setup"))
for (size_t i = 0; i < lights.size(); i++)
lightColor[0] = lightColor[1] = lightColor[2] = 1.0f;
for (size_t i = 0; i < lights.size(); i++)
{
if (ImGui::CollapsingHeader(std::string("Light " + std::to_string(i)).c_str()))
{
ImGui::Indent(20);
ImGui::ColorEdit3(std::string("Light Color: " + std::to_string(i)).c_str(), lights.at(i).diffuse);
ImGui::DragFloat3(std::string("Light Position: " + std::to_string(i)).c_str(), lights.at(i).position, 0.1f);
static int selectedType = 0;
ImGui::RadioButton("Exponent", &selectedType, 0); ImGui::SameLine();
ImGui::RadioButton("Cutoff", &selectedType, 1); ImGui::SameLine();
ImGui::RadioButton("Direction", &selectedType, 2);
if (lights.at(i).type == LightType::EXPONENT)
ImGui::DragFloat(std::string("Exponent: " + std::to_string(i)).c_str(), &lights.at(i).exponent, 0.1f);
if (lights.at(i).type == LightType::CUTOFF)
ImGui::DragFloat(std::string("Cutoff Angle: " + std::to_string(i)).c_str(), &lights.at(i).angle, 0.1f);
if (lights.at(i).type == LightType::DIRECTION)
ImGui::DragFloat3(std::string("Direction: " + std::to_string(i)).c_str(), lights.at(i).direction, 0.1f);
switch (selectedType)
{
case 0: lights.at(i).type = LightType::EXPONENT; break;
case 1: lights.at(i).type = LightType::CUTOFF; break;
case 2: lights.at(i).type = LightType::DIRECTION; break;
default:
break;
}
ImGui::Unindent(20);
}
}
}
ImGui::Spacing();
ImGui::Spacing();
ImGui::Spacing();
if (ImGui::Button("Cube"))
{
Model* cube = new Model();
cube->CreateCube();
models.push_back(*cube);
}
ImGui::SameLine();
if (ImGui::Button("Sphere"))
{
Model* sphere = new Model();
sphere->CreateSphere();
models.push_back(*sphere);
}
ImGui::SameLine();
if (ImGui::Button("Torus"))
{
Model* torus = new Model();
torus->CreateTours();
models.push_back(*torus);
}
if (ImGui::Button("Cylinder"))
{
Model* cylinder = new Model();
cylinder->CreateCylinder();
models.push_back(*cylinder);
}
ImGui::SameLine();
if (ImGui::Button("Cone"))
{
Model* cone = new Model();
cone->CreateCone();
models.push_back(*cone);
}
ImGui::SameLine();
if (ImGui::Button("Teapot"))
{
Model* teapot = new Model();
teapot->CreateTeapot(0.5f);
models.push_back(*teapot);
}
if (ImGui::Button("Collision Box"))
{
Model* cube = new Model();
cube->CreateWireCube();
cube->collider = true;
models.push_back(*cube);
}
ImGui::SameLine();
if (ImGui::Button("Group"))
objs.emplace_back("Group" + std::to_string(Randomize(0, 1000)));
if (ImGui::Button("3D Model"))
{
Model* model3D = new Model();
model3D->Assign3DModel("");
models.push_back(*model3D);
}
ImGui::SameLine();
if (ImGui::Button("Light"))
if (lights.size() < GL_MAX_LIGHTS)
{
LightModel light(lights.size());
lights.push_back(light);
}
static int i;
for (auto& obj : objs)
{
if (ImGui::Button(std::string("(Un)Select " + obj.name).c_str()))
if (!obj.obj.empty())
SelectUnSelectGroup(obj.obj.at(0)->group);
ImGui::SameLine();
if (ImGui::CollapsingHeader(std::string("Group " + obj.name).c_str()))
{
float arr[]{ 0.1, 0.1, 0.1 };
ImGui::DragFloat3(std::string("Position: " + obj.name).c_str(), &obj.transGroup.at(0), 0.1f);
ImGui::SameLine();
if (ImGui::Button("Reset Position"))
obj.transGroup.at(0) = obj.transGroup.at(1) = obj.transGroup.at(2) = 0.0f;
obj.Translate();
ImGui::DragFloat3(std::string("Rotation: " + obj.name).c_str(), &obj.rotateGroup.at(0), 0.1f);
ImGui::SameLine();
if (ImGui::Button("Reset Rotation"))
obj.rotateGroup.at(0) = obj.rotateGroup.at(1) = obj.rotateGroup.at(2) = 0.0f;
obj.Rotate();
if (ImGui::Button(std::string("Duplicate Group " + obj.name).c_str()))
{
for (auto& model : obj.obj)
{
Model newModel = *model;
newModel.group = objs.size();
newModel.id = std::to_string(model->numofModels++);
models.push_back(newModel);
}
objs.emplace_back(obj.name + std::to_string(Randomize(0, 1000)));
SortObjects();
break;
}
ImGui::Checkbox(std::string("Show Center " + obj.name).c_str(), &obj.showCenter);
if (obj.showCenter)
{
ImGui::DragFloat3(std::string("Center Position: " + obj.name).c_str(), &obj.center.at(0), 0.01f);
ImGui::Checkbox(std::string("Centralize: " + obj.name).c_str(), &obj.centralize);
if (obj.centralize)
obj.CalculateEstimatedCenter();
obj.RenderCenter();
ImGui::Spacing();
ImGui::Spacing();
}
ImGui::Indent(20);
for (size_t j = 0; j < obj.obj.size(); j++)
{
if (obj.obj.size() == j)
{
SortObjects();
break;
}
std::string name = obj.obj.at(j)->GetPrimitveString() + std::to_string(i++);
ShowModelAttributes(*obj.obj.at(j), name);
}
ImGui::Unindent(20);
}
ImGui::Spacing();
ImGui::Spacing();
}
for (auto& model : models)
if (model.group == -1)
{
std::string name = model.GetPrimitveString() + std::to_string(i++);
ShowModelAttributes(model, name);
}
i = 0;
ImGui::Text("Application average %.3f ms/frame (%.1f FPS)", 1000.0f / ImGui::GetIO().Framerate, ImGui::GetIO().Framerate);
ImGui::End();
std::string codeString;
code.str("");
code << std::setprecision(4) << std::noshowbase;
if (models.empty())
code << " \n \n";
for (size_t i = 0; i < models.size(); i++)
{
Model& model = models.at(i);
std::string name = model.GetPrimitveString() + std::to_string(i);
if (model.group != -1)
code << " // " + name + " of Group " + objs.at(model.group).name + "\n";
else
code << " // " + name + "\n";
code << "Model " << name << ";\n";
if (model.GetPrimitive() == Primitive::Cube)
code << name << ".CreateCube(" << model.size << ");\n";
if (model.GetPrimitive() == Primitive::WireCube)
code << name << ".CreateWireCube(" << model.size << ");\n";
if (model.GetPrimitive() == Primitive::Teapot)
code << name << ".CreateTeapot(" << model.size << ");\n";
if (model.GetPrimitive() == Primitive::Tours)
code << name << ".CreateTours(" << (model.size) << ", " << (model.modelHeight) << ", " << (model.slices) << ", " << (model.stacks) << ");\n";
if (model.GetPrimitive() == Primitive::Cone)
code << name << ".CreateCone(" << (model.size) << ", " << (model.modelHeight) << ", " << (model.slices) << ", " << (model.stacks) << ");\n";
if (model.GetPrimitive() == Primitive::Sphere)
code << name << ".CreateSphere(" << (model.size) << ", " << (model.slices) << ", " << (model.stacks) << ");\n";
if (model.GetPrimitive() == Primitive::Cylinder)
code << name << ".CreateCylinder(" << (model.size) << ", " << (model.radius) << ", " << (model.modelHeight) << ", " << (model.slices) << ", " << (model.stacks) << ");\n";
if (model.GetPrimitive() == Primitive::Model)
code << name << ".Assign3DModel(\"" << model.path << "\");\n";
code << name << ".Translate(" << model.position.at(0) << ", " << model.position.at(1) << ", " << model.position.at(2) << ");\n";
if (model.scale.at(0) != 1 || model.scale.at(1) != 1 || model.scale.at(2) != 1)
code << name << ".Scale(" << model.scale.at(0) << ", " << model.scale.at(1) << ", " << model.scale.at(2) << ");\n";
if (model.rotate.at(0) != 0 || model.rotate.at(1) != 0 || model.rotate.at(2) != 0)
code << name << ".Rotate(" << model.rotate.at(0) << ", " << model.rotate.at(1) << ", " << model.rotate.at(2) << ");\n";
if (model.color.R != 1 || model.color.G != 1 || model.color.B != 1)
code << name << ".SetColor(" << model.color.R << ", " << model.color.G << ", " << model.color.B << ");\n";
if (model.collider)
code << name << ".collider = " << "true;\n";
if (model.animated)
{
code << name << ".animated = " << "true;\n";
code << name << ".SetAnimParam(" << model.transFactor.at(0) << ", " << model.transFactor.at(1) << ", " << model.transFactor.at(2) << ", " << model.rotFactor.at(0) << ", " << model.rotFactor.at(1) << ", " << model.rotFactor.at(2) << ", " << model.scaleFactor.at(0) << ", " << model.scaleFactor.at(1) << ", " << model.scaleFactor.at(2) << ");\n";
}
if (model.soundFileName != "")
code << name << ".soundFileName = \"" << model.soundFileName << "\";\n";
if (model.animSoundFileName != "")
code << name << ".animSoundFileName = \"" << model.animSoundFileName << "\";\n";
if (model.group != -1)
code << name << ".group = " << model.group << ";\n";
code << "models.emplace_back(" << name << ");\n\n";
}
if (showCode)
{
ImGui::Begin("Code:");
codeString = code.str();
char* c = const_cast<char*>(codeString.c_str());
if (ImGui::Button("Copy Code"))
ImGui::SetClipboardText(c);
ImGui::InputTextMultiline("Code: ", c, codeString.length());
ImGui::Text("W, A, S, D Buttons to change Camera's Eye");
ImGui::Text("UP, LEFT, DOWN, RIGHT Arrows to change Camera's Center");
ImGui::End();
}
if (updateData)
WriteHeader();
WIDTH = glutGet(GLUT_WINDOW_WIDTH);
HEIGHT = glutGet(GLUT_WINDOW_HEIGHT);
glViewport(0, 0, WIDTH, HEIGHT);
}
void RenderScene(void)
{
SetupCamera();
SetupLights();
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glClearColor(0.2f, 0.5f, 0.8f, 1.0f);
for (auto& model : models)
{
if (model.animateNow)
if (model.animated)
model.Animate();
model.Render();
}
RenderUI();
RenderIMGUI();
}
bool ModelsIntresect(Model& model1, Model& model2, float x, float z)
{
if (std::abs((model1.position.at(0) + x) - model2.position.at(0)) < model1.scale.at(0) / 4 + model2.scale.at(0) / 4)
if (std::abs(model1.position.at(1) - model2.position.at(1)) < model1.scale.at(1) / 4 + model2.scale.at(1) / 4)
if (std::abs((model1.position.at(2) + z) - model2.position.at(2)) < model1.scale.at(2) / 4 + model2.scale.at(2) / 4)
return true;
return false;
}
Model* CheckCollision(float x, float z)
{
for (auto& model : models)
if (model.collider)
for (auto& modelCollision : models)
if (modelCollision.collider && &modelCollision != &model && model.group != -1)
if (ModelsIntresect(model, modelCollision, x, z) && objs.at(model.group).name == "Character")
{
lastHit = &modelCollision;
modelCollision.PlaySoundOnce();
return &modelCollision;
}
lastHit = nullptr;
return nullptr;
}
static int historyNum = 0;
void key(unsigned char key, int x, int y)
{
ImGuiIO& io = ImGui::GetIO();
io.AddInputCharacter(key);
if (key == '[')
if (modelsHistory.size() - historyNum > 0)
{
historyNum++;
models = modelsHistory[modelsHistory.size() - historyNum];
}
//#TODO Work on The Redo
if (key == ']')
if (historyNum > 1)
{
historyNum--;
models = modelsHistory[(modelsHistory.size() - historyNum)];
}
if (key == 'w')
{
if (moveWithCenter)
{
cameraCenter.z -= 0.5f;
cameraPos.z -= 0.5f;
}
else
radius -= 0.5f;
}
if (key == 's')
if (moveWithCenter)
{
cameraCenter.z += 0.5f;
cameraPos.z += 0.5f;
}
else
radius += 0.5f;
if (key == 'a')
if (moveWithCenter)
{
cameraCenter.x -= 0.5f;
cameraPos.x -= 0.5f;
}
else
angle -= 5.0f;
if (key == 'd')
if (moveWithCenter)
{
cameraCenter.x += 0.5f;
cameraPos.x += 0.5f;
}
else
angle += 5.0f;
if (key == 'q')
cameraPos.y += 0.5f;
if (key == 'e')
cameraPos.y -= 0.5f;
if (key == 'i')
cameraCenter.z -= 0.1f;
if (key == 'k')
cameraCenter.z += 0.1f;
if (key == 'j')
cameraCenter.x -= 0.1f;
if (key == 'l')
cameraCenter.x += 0.1f;
if (key == 'z')
for (auto& model : models)
if (model.selected)
model.TranslateAccum(0, 0.1, 0);
if (key == 'x')
for (auto& model : models)
if (model.selected)
model.TranslateAccum(0, -0.1, 0);
if (key == 'r')
if (lastHit != nullptr && lastHit->collider && lastHit->animated)
{
for (auto& model : models)
{
if (model.animateNow || model.animated)
for (size_t i = 0; i < 3; i++)
{
model.positionAnim[i] = 0.0f;
model.rotateAnim[i] = 0.0f;
model.scaleAnim[i] = 0.0f;
lastHit->positionAnim[i] = 0.0f;
lastHit->rotateAnim[i] = 0.0f;
lastHit->scaleAnim[i] = 0.0f;
}
}
lastHit->PlayAnimSoundOnce();
lastHit->animateNow = true;
for (auto& model : objs.at(lastHit->group).obj)
{
model->transFactor = lastHit->transFactor;
model->rotFactor = lastHit->rotFactor;
model->scaleFactor = lastHit->scaleFactor;
model->animateNow = true;
}
}
if (key == 't')
{
angle = -45.11f;
radius = 1.5f;
}
if (key == 'y')
{
angle = -120.11f;
radius = 5.5f;
}
if (key == 'u')
{
angle = 7.11f;
radius = -7.5f;
}
}
bool CheckCoinsCollision()
{
std::string name = "coin";
if (objs.at(lastHit->group).name.substr(0, name.length()) == name)
{
for (auto& model : objs.at(lastHit->group).obj)
{
model->collider = false;
model->hidden = true;
}
if (lastHit != nullptr)
coinsVal += 10;
lastHit = nullptr;
return true;
}
return false;
}
bool CheckKeyCollision1()
{
std::string name = "key1";
if (objs.at(lastHit->group).name.substr(0, name.length()) == name)
{
for (auto& model : objs.at(lastHit->group).obj)
{
model->collider = false;
model->hidden = true;
}
for (auto& model : models)
{
if (model.group != -1)
{
if (objs.at(model.group).name == "smallBridge")
{
model.collider = false;
model.hidden = true;
}
}
}
return true;
}
return false;
}
bool CheckKeyCollision2()
{
std::string name = "key2";
if (objs.at(lastHit->group).name.substr(0, name.length()) == name)
{
for (auto& model : objs.at(lastHit->group).obj)
{
model->collider = false;
model->hidden = true;
}
for (auto& model : models)
{
if (model.group != -1)
{
if (objs.at(model.group).name == "chain")
{
model.collider = false;
model.hidden = true;
}
}
}
return true;
}
return false;
}
bool CheckHealthKitCollision()
{
std::string name = "HealthKit";
if (objs.at(lastHit->group).name.substr(0, name.length()) == name)
{
//#TODO HealthKit Collision Logic
return true;
}
return false;
}
bool CheckDeskCollision()
{
std::string name = "Desk";
if (objs.at(lastHit->group).name.substr(0, name.length()) == name)
{
//#TODO Desk Collision Logic
return true;
}
return false;
}
bool CheckPrescriptionCollision()
{
std::string name = "prescription";
if (objs.at(lastHit->group).name.substr(0, name.length()) == name)
{
for (auto& model : models)
{
if (coinsVal >= 50) {
if (model.group != -1)
{
if (objs.at(model.group).name == "door")
{
model.collider = false;
model.Rotate(0, 150, 0);
model.Translate(2.14, 0, -0.34);
model.soundFileName = "prescription.wav";
}
if (objs.at(model.group).name == "hidee")
{
model.collider = false;
model.hidden = true;
}
}
}
}
return true;
}
return false;
}
void CheckAllCollisions()
{
if (lastHit == nullptr || lastHit->group == -1)
return;
if (!CheckCoinsCollision())
if (!CheckKeyCollision1())
if (!CheckKeyCollision2())
if (!CheckDeskCollision())
if (!CheckPrescriptionCollision())
CheckHealthKitCollision();
}
void key(int key, int x, int y)
{
ImGuiIO& io = ImGui::GetIO();
io.AddInputCharacter(key + 256);
if (firstPerson)
cameraPos = GetCharacterPos();
else
cameraCenter = GetCharacterPos();
bool pass = false;
const float limit = 0.2f;
const float speed = 0.1f;
for (auto& model : models)
if (model.group != -1)
if (objs.at(model.group).name == "Character")
{
if ((key == GLUT_KEY_DOWN && CheckCollision(-limit, 0.0f) == nullptr) || (key == GLUT_KEY_UP && CheckCollision(limit, 0.0f) == nullptr) || (key == GLUT_KEY_LEFT && CheckCollision(0.0f, -limit) == nullptr) || (key == GLUT_KEY_RIGHT && CheckCollision(0.0f, limit) == nullptr))
pass = true;
if (pass)
if (key == GLUT_KEY_UP) {
model.TranslateAccum(speed, 0.0f, 0.0f);
if (firstPerson)
cameraCenter.z -= speed;
else
cameraPos.z -= speed;
}
else if (key == GLUT_KEY_DOWN)
{
model.TranslateAccum(-speed, 0.0f, 0.0f);
if (firstPerson)
cameraCenter.z += speed;
else
cameraPos.z += speed;
}
else if (key == GLUT_KEY_LEFT)
{
model.TranslateAccum(0.0f, 0.0f, -speed);
if (firstPerson)
cameraCenter.x -= speed;
else
cameraPos.x += speed;
}
else if (key == GLUT_KEY_RIGHT)
{
model.TranslateAccum(0.0f, 0.0f, speed);
if (firstPerson)
cameraCenter.x += speed;
else
cameraPos.x -= speed;
}
}
}
void glut_display_func()
{
// Start the Dear ImGui frame
ImGui_ImplOpenGL2_NewFrame();
ImGui_ImplGLUT_NewFrame();
RenderScene();
// Rendering
ImGui::Render();
ImGuiIO& io = ImGui::GetIO();
ImGui_ImplOpenGL2_RenderDrawData(ImGui::GetDrawData());
glutSwapBuffers();
glutPostRedisplay();
}
void Generate(int value)
{
GenerateModels(models, objs);
}
void WriteHeader()
{
time_t now = time(0);
tm* ltm = localtime(&now);
std::stringstream groupCode;
for (size_t i = 0; i < objs.size(); i++)
{
std::string groupName = objs.at(i).name + std::to_string(i);
groupCode << "Object " << groupName << "(\"" << objs.at(i).name << "\");\n";
if (!objs.at(i).centralize)
groupCode << groupName + ".centralize = false;\n";
if (objs.at(i).center.at(0) == 0 && objs.at(i).center.at(1) == 0 && objs.at(i).center.at(2) == 0)
groupCode << groupName + ".SetCenter(" << objs.at(i).center.at(0) << "," << objs.at(i).center.at(1) << "," << objs.at(i).center.at(2) << ");\n";
if (objs.at(i).transGroup.at(0) == 0 && objs.at(i).transGroup.at(1) == 0 && objs.at(i).transGroup.at(2) == 0)
groupCode << groupName + ".SetGroupTranslate(" << objs.at(i).transGroup.at(0) << "," << objs.at(i).transGroup.at(1) << "," << objs.at(i).transGroup.at(2) << ");\n";
if (objs.at(i).rotateGroup.at(0) == 0 && objs.at(i).rotateGroup.at(1) == 0 && objs.at(i).rotateGroup.at(2) == 0)
groupCode << groupName + ".SetGroupRotate(" << objs.at(i).rotateGroup.at(0) << "," << objs.at(i).rotateGroup.at(1) << "," << objs.at(i).rotateGroup.at(2) << ");\n";
groupCode << "objs" << ".emplace_back(" << groupName << ");\n\n";
}
if (backup)
{
std::stringstream path;
path << "src/backup/" << 1900 + ltm->tm_year << "-" << ltm->tm_mon << "-" << ltm->tm_mday << " at " << ltm->tm_hour << "." << ltm->tm_min << "." << ltm->tm_sec << ".h";
std::string pathStr = path.str();
std::ofstream myFile(pathStr);
if (myFile.is_open())
{
myFile << "#pragma once\n#include \"Model.h\"\nvoid GenerateModels(std::vector<Model>& models, std::vector<Object>& objs)\n{\n\n";
myFile << "//Backup at: " << 1900 + ltm->tm_year << "-" << ltm->tm_mon << "-" << ltm->tm_mday << " at: " << ltm->tm_hour << ":" << ltm->tm_min << ":" << ltm->tm_sec << "\n\n";
myFile << groupCode.str();
myFile << code.str();
myFile << "}\n";
}
}
else
{
std::ofstream myFile("src/ModelsGenerator.h");
if (myFile.is_open())
{
myFile << "#pragma once\n#include \"Model.h\"\nvoid GenerateModels(std::vector<Model>& models, std::vector<Object>& objs)\n{\n\n";
myFile << groupCode.str();
myFile << code.str();
myFile << "}\n";
}
}
}
void HistoryTimer(int value)
{
bool same = true;
//#TODO Optimize to only include the changed
if (!modelsHistory.empty())
for (size_t i = 0; i < (models.size() < modelsHistory.at(modelsHistory.size() - 1).size() ? models.size() : modelsHistory.at(modelsHistory.size() - 1).size()); i++)
{
Model& modelHis = modelsHistory.at(modelsHistory.size() - 1).at(i);
Model& model = models.at(i);
for (size_t i = 0; i < model.position.size(); i++)
if (model.position.at(i) != modelHis.position.at(i) || model.groupTrans.at(i) != modelHis.groupTrans.at(i) || model.scale.at(i) != modelHis.scale.at(i) || model.rotate.at(i) != modelHis.rotate.at(i))
same = false;
}
else
same = false;
if (!same)
{
modelsHistory.erase(modelsHistory.end() - historyNum, modelsHistory.end());
historyNum = 0;
modelsHistory.push_back(models);
}
glutTimerFunc(2000, HistoryTimer, 2000);
}
void WriteHeaderBackup()
{
backup = true;
WriteHeader();
}
int main(int argc, char** argv)
{
srand(time(0));
float R = (float)((rand() % 100) / 100.0f);
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DEPTH | GLUT_DOUBLE | GLUT_RGB);
glutInitWindowPosition(100, 100);
glutInitWindowSize(WIDTH, HEIGHT);
glutCreateWindow("Garden Game");
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_BLEND);
glEnable(GL_DEPTH_TEST);
glEnable(GL_LIGHTING);
glEnable(GL_LIGHT0);
glEnable(GL_NORMALIZE);
glEnable(GL_COLOR_MATERIAL);
glEnable(GL_TEXTURE_2D);
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
IMGUI_CHECKVERSION();
ImGui::CreateContext();
ImGuiIO& io = ImGui::GetIO(); (void)io;
ImGui::StyleColorsDark();
ImGui_ImplGLUT_Init();
ImGui_ImplGLUT_InstallFuncs();
ImGui_ImplOpenGL2_Init();
gluOrtho2D(0, WIDTH, 0, HEIGHT);
glutDisplayFunc(glut_display_func);
glutKeyboardFunc(key);
glutSpecialFunc(key);
Generate(100);
glutTimerFunc(10, HistoryTimer, 10);
SortObjects();
std::atexit(WriteHeaderBackup);
for (auto& model : models)
{
if (model.GetPrimitive() == Primitive::WireCube)
model.collider = true;
model.hidden = false;
if (model.group != -1)
{
if (objs.at(model.group).name == "Character")
{
objs.at(model.group).obj.at(0)->position.at(0) = 1.13;
objs.at(model.group).obj.at(0)->position.at(1) = 0;
objs.at(model.group).obj.at(0)->position.at(2) = -1.1;
objs.at(model.group).obj.at(1)->position.at(0) = 1.1;
objs.at(model.group).obj.at(1)->position.at(1) = 0.64;
objs.at(model.group).obj.at(1)->position.at(2) = -1.08;
}
if (objs.at(model.group).name == "door")
{
objs.at(model.group).obj.at(0)->Translate(2.33, 0, 0.04);
objs.at(model.group).obj.at(0)->Rotate(0, 90, 0);
objs.at(model.group).obj.at(1)->Translate(2.35, 0.870, 0.04);
objs.at(model.group).obj.at(1)->Rotate(0, 90, 0);
}
}
}
glEnable(GL_DEPTH_TEST);
glEnable(GL_LIGHTING);
glEnable(GL_LIGHT0);
glEnable(GL_NORMALIZE);
glEnable(GL_COLOR_MATERIAL);
glShadeModel(GL_SMOOTH);
LightModel baseLight(0);
baseLight.SetPosition(5.6f, 10.0f, 7.5f);
lights.push_back(baseLight);
glutMainLoop();
// Cleanup
ImGui_ImplOpenGL2_Shutdown();
ImGui_ImplGLUT_Shutdown();
ImGui::DestroyContext();
return 1;
} | [
"abdullah.safaan@gmail.com"
] | abdullah.safaan@gmail.com |
cdf65b8bdd5f3eca802a34d4df5f81744e529168 | eafdba6a2e9ee8a31270d576f5da60df6e72eb0c | /BOJ 대회 스코어보드/BOJ 대회 스코어보드.cpp | b906eb9d9729c31c5359d592a69695e1a7a0738d | [] | no_license | DahamChoi/Algorithm2 | a076b14bc0f7d86710a4447b2f64a2dc76624fd0 | 3fc30d1751c447e388b976a2ce7c5955513cbaa9 | refs/heads/master | 2023-06-01T10:21:51.507089 | 2021-06-27T09:00:53 | 2021-06-27T09:00:53 | 374,948,754 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 7,771 | cpp | #include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <ctime>
#include <string>
using namespace std;
struct competition {
string start;
long long panalty, last, ce, cscore, format;
};
struct problem {
long long order, pscore;
};
struct submission {
string uid, date;
long long sid, pid, result, presult, score;
};
struct result {
long long type, try_cnt, good_solution_pid, penalty_1, penalty_2, try_cnt_2, good_solution_score;
};
struct user {
string id;
long long score, penalty, last_ac_id, last_submission_id;
map<long long, result> problem_result;
};
struct compare {
bool operator()(const pair<string, user>& _left, const pair<string, user>& _right) {
const user& left = _left.second; const user& right = _right.second;
if (left.score == right.score) {
if (left.penalty == right.penalty) {
if (left.last_ac_id == right.last_ac_id) {
if (left.last_submission_id == right.last_submission_id) {
return left.id < right.id;
}
return left.last_submission_id < right.last_submission_id;
}
return left.last_ac_id < right.last_ac_id;
}
return left.penalty < right.penalty;
}
return left.score > right.score;
}
};
long long get_solution_time(const string& start, const string& end) {
tm end_time = {
atoi(end.substr(17, 2).c_str()),
atoi(end.substr(14, 2).c_str()),
atoi(end.substr(11, 2).c_str()),
atoi(end.substr(8, 2).c_str()),
atoi(end.substr(5, 2).c_str()) - 1,
atoi(end.substr(0, 4).c_str()) - 1900
};
tm start_time = {
atoi(start.substr(17, 2).c_str()),
atoi(start.substr(14, 2).c_str()),
atoi(start.substr(11, 2).c_str()),
atoi(start.substr(8, 2).c_str()),
atoi(start.substr(5, 2).c_str()) - 1,
atoi(start.substr(0, 4).c_str()) - 1900
};
double diff = (difftime(mktime(&end_time), mktime(&start_time)));
long long tm_min = diff / 60;
return tm_min;
}
string make_string(long long min) {
string s1 = to_string(min / 60);
string s2 = to_string(min % 60);
if (s2.size() == 1) {
s2.insert(s2.begin(), '0');
}
return s1 + ":" + s2;
}
int main() {
ios::sync_with_stdio(false); cin.tie(NULL);
// 대회 정보
competition compet;
cin >> compet.panalty;
string str;
cin >> str;
compet.start = str + ' ';
cin >> str;
compet.start.insert(compet.start.end(), str.begin(), str.end());
cin >> compet.last >> compet.ce >> compet.cscore >> compet.format;
// 문제 정보
long long N; cin >> N;
map<long long, problem> problems;
for (long long i = 0; i < N; i++) {
long long id, order, pscore; cin >> id >> order >> pscore;
problems[id] = { order, pscore };
}
// 유저 정보
long long M; cin >> M;
map<string, user> users;
for (long long i = 0; i < M; i++) {
string str; cin >> str;
users[str].id = str;
for (auto& it : problems) {
users[str].problem_result[it.first];
}
}
// 제출 정보
long long S; cin >> S;
vector<submission> submissions(S);
for (long long i = 0; i < S; i++) {
cin >> submissions[i].sid >> submissions[i].pid >> submissions[i].uid >> submissions[i].result >> submissions[i].presult >> submissions[i].score;
string str;
cin >> str;
submissions[i].date = str + ' ';
cin >> str;
submissions[i].date.insert(submissions[i].date.end(), str.begin(), str.end());
}
for (auto& it : submissions) {
if (users[it.uid].id.empty() || (compet.ce == 1 && it.result == 11) || it.result == 13) {
continue;
}
users[it.uid].last_submission_id = it.sid;
auto& p_result = users[it.uid].problem_result[it.pid];
// 일반 대회
if (compet.cscore == 0) {
if (it.result == 4) {
if (p_result.good_solution_pid == 0) {
p_result.good_solution_pid = it.pid;
p_result.penalty_1 = (p_result.try_cnt++) * compet.panalty;
p_result.penalty_2 = get_solution_time(compet.start, it.date);
++users[it.uid].score;
p_result.type = 1;
}
users[it.uid].last_ac_id = it.sid;
}
else if (p_result.good_solution_pid == 0) {
++p_result.try_cnt;
}
}
// 점수 대회
else {
if (it.result == 4) {
if (it.score > 0) {
if (it.score > p_result.good_solution_score) {
p_result.good_solution_score = it.score;
p_result.penalty_1 = (p_result.try_cnt_2++) * compet.panalty;
p_result.penalty_2 = get_solution_time(compet.start, it.date);
p_result.type = 1;
p_result.try_cnt = p_result.try_cnt_2;
}
else {
++p_result.try_cnt_2;
}
}
else {
if (p_result.good_solution_score < problems[it.pid].pscore) {
p_result.good_solution_score = problems[it.pid].pscore;
p_result.penalty_1 = (p_result.try_cnt_2++) * compet.panalty;
p_result.penalty_2 = get_solution_time(compet.start, it.date);
p_result.type = 1;
p_result.try_cnt = p_result.try_cnt_2;
}
else {
++p_result.try_cnt_2;
}
}
users[it.uid].last_ac_id = it.sid;
}
else {
++p_result.try_cnt_2;
}
}
}
for (auto& it : users) {
if (compet.last == 0) {
for (auto& it2 : it.second.problem_result) {
it.second.penalty += (it2.second.penalty_1 + it2.second.penalty_2);
}
}
else {
long long max_value = 0;
for (auto& it2 : it.second.problem_result) {
max_value = max(it2.second.penalty_2, max_value);
it.second.penalty += it2.second.penalty_1;
}
it.second.penalty += max_value;
}
if (compet.cscore == 1) {
for (auto& it2 : it.second.problem_result) {
it.second.score += it2.second.good_solution_score;
}
}
}
vector<pair<string, user>> users_vector(users.begin(), users.end());
sort(users_vector.begin(), users_vector.end(), compare());
long long rank = 1;
for (long long i = 0; i < users_vector.size(); i++) {
if (users[users_vector[i].first].id.empty()) {
continue;
}
cout << rank << "," << users_vector[i].first << ",";
vector<pair<long long, result>> problem_result_vector(
users_vector[i].second.problem_result.begin(), users_vector[i].second.problem_result.end());
sort(problem_result_vector.begin(), problem_result_vector.end(), [&](const pair<long long, result>& left, const pair<long long, result>& right) {
return problems[left.first].order < problems[right.first].order;
});
for (auto& it : problem_result_vector) {
// 일반 대회
if (compet.cscore == 0) {
if (it.second.try_cnt == 0) {
cout << "0/--,";
}
else {
if (it.second.type == 1) {
long long penalty = (compet.last == 0 ? it.second.penalty_1 + it.second.penalty_2 : it.second.penalty_2);
cout << "a/" << it.second.try_cnt << "/" <<
(compet.format == 1 ? make_string(penalty) : to_string(penalty)) << ",";
}
else {
cout << "w/" << it.second.try_cnt << "/--,";
}
}
}
// 점수 대회
else {
if (it.second.try_cnt_2 == 0) {
cout << "0/--,";
}
else {
if (it.second.type == 1) {
if (it.second.good_solution_score == problems[it.first].pscore) {
cout << "a/";
}
else {
cout << "p/";
}
long long penalty = (compet.last == 0 ? it.second.penalty_1 + it.second.penalty_2 : it.second.penalty_2);
cout << it.second.good_solution_score << "/" << it.second.try_cnt << "/" <<
(compet.format == 1 ? make_string(penalty) : to_string(penalty)) << ",";
}
else {
cout << "w/" << it.second.try_cnt_2 << "/--,";
}
}
}
}
cout << users_vector[i].second.score << "/" <<
(compet.format == 1 ? make_string(users_vector[i].second.penalty) : to_string(users_vector[i].second.penalty)) << '\n';
if (i + 1 < users_vector.size() &&
!(users_vector[i].second.score == users_vector[i + 1].second.score &&
users_vector[i].second.penalty == users_vector[i + 1].second.penalty)) {
rank = i + 2;
}
}
return 0;
} | [
"rorigu32@gmail.com"
] | rorigu32@gmail.com |
27e37e04c411c4376e4d9e2a312663b27a946a00 | 56a7a0bf05cb154f7996918beeff7819841d7fd3 | /tile.cpp | 9459c04c89a9c1df057361373b773f16da4dbde2 | [] | no_license | jpfingst/snake_v1 | f7306378d00f420d166bfceb75ac7a0771c4c1e1 | 973000bebe040d6541f7ab8417f57b59e8cf7b89 | refs/heads/master | 2020-04-13T01:47:51.211689 | 2018-12-23T11:07:45 | 2018-12-23T11:07:45 | 162,883,972 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 351 | cpp | #include "tile.h"
Tile::Tile(float x, float y, int tileType)
{
box.x = x;
box.y = y;
box.w = TILE_WIDTH;
box.h = TILE_HEIGHT;
this->type = tileType;
}
Tile::~Tile()
{
}
void Tile::render()
{
gTileTexture.render( box.x, box.y, &gTileClips[ type ] );
}
int Tile::getType()
{
return type;
}
SDL_Rect Tile::getBox()
{
return box;
}
| [
"juergen.pfingstner@gmail.com"
] | juergen.pfingstner@gmail.com |
2c1a2e8a3a51ff609bda10769a22addab9b446a5 | ae0db002fc10256c3171ab17f13e339d8c8d8f04 | /Desktop/Sample programs/C++/Programs/Program3/Creatures.cpp | c319e153498e4787d24dfaf8f2786f7add3c8b01 | [] | no_license | DavidWallacedot/Magical-Creatures-Zoo | 7345f0cf23415154633a0e9a02861ca94d9b2383 | 2b0fd01b2e1f633ea02e1718993b74f43d181de5 | refs/heads/master | 2021-05-11T14:12:50.176737 | 2018-01-16T15:16:29 | 2018-01-16T15:16:29 | 117,697,529 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,303 | cpp | /*
Author: David Wallace
Date: 11/11/2017
name: Creatures.cpp
purpose: constructs a zoo of magical creatures for hagrid
*/
#include "Creatures.h"
int main(){
creature creaturez;
int numCreatures=0;
char userInput = 'y';
while (tolower(userInput) == 'y' ){
creature zoo[100];//array of type creature
cout<<"What would you like to do?\n";
cout<<"1. Enter new magical creatures or load from a file.\n";
cout<<"2. Remove magical creature from the zoo\n";
cout<<"3. Print all creatures.\n";
cout<<"4. Print statistics on creature cost.\n";
cout<<"5. End program.\n";
cout<<"Enter 1, 2, 3, 4 or 5.\n";
cout<<"CHOICE: ";
int input =0;
cin>>input;
while(input<0 || input>5){//validates userInput
cout<<"Your choice was invalid. Choose a number 1 - 5\nCHOICE: ";
cin>>input;
}
switch(input){//determines which function to call
case 1:
cout<<endl;
numCreatures += enterCreatures(numCreatures,zoo);
break;
case 2:
numCreatures = deleteMagicalCreature(numCreatures,zoo);
break;
case 3:
cout<<endl;
printCreatures(numCreatures,zoo);
break;
case 4:
cout<<endl;
printStatistics(numCreatures,zoo);
break;
case 5:
cout<<endl;
saveCreaturesToFile(numCreatures,zoo);
userInput = 'n';
break;
}
}
return 0;
} | [
"davidwallacedot@yahoo.com"
] | davidwallacedot@yahoo.com |
842c399fe32d0bdef3d09a466487d1558b61e3cb | db8715dd187d5111ba521d0d040255d76f7d7ad9 | /build/moc_transactionview.cpp | 805ce01920cf456374a721c8de28dffdbb1d33ad | [
"MIT"
] | permissive | zm112211mz/mycoin | 01ed0e56cfd7deb6dc68951ca8b298b7afa53da0 | 85b1970cb12b0949fe71d66ff7517e4a25dee46c | refs/heads/master | 2021-01-23T11:47:50.566630 | 2014-05-20T09:37:42 | 2014-05-20T09:37:42 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 6,571 | cpp | /****************************************************************************
** Meta object code from reading C++ file 'transactionview.h'
**
** Created by: The Qt Meta Object Compiler version 67 (Qt 5.0.1)
**
** WARNING! All changes made in this file will be lost!
*****************************************************************************/
#include "../src/qt/transactionview.h"
#include <QtCore/qbytearray.h>
#include <QtCore/qmetatype.h>
#if !defined(Q_MOC_OUTPUT_REVISION)
#error "The header file 'transactionview.h' doesn't include <QObject>."
#elif Q_MOC_OUTPUT_REVISION != 67
#error "This file was generated using the moc from 5.0.1. It"
#error "cannot be used with the include files from this version of Qt."
#error "(The moc has changed too much.)"
#endif
QT_BEGIN_MOC_NAMESPACE
struct qt_meta_stringdata_TransactionView_t {
QByteArrayData data[20];
char stringdata[227];
};
#define QT_MOC_LITERAL(idx, ofs, len) \
Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \
offsetof(qt_meta_stringdata_TransactionView_t, stringdata) + ofs \
- idx * sizeof(QByteArrayData) \
)
static const qt_meta_stringdata_TransactionView_t qt_meta_stringdata_TransactionView = {
{
QT_MOC_LITERAL(0, 0, 15),
QT_MOC_LITERAL(1, 16, 13),
QT_MOC_LITERAL(2, 30, 0),
QT_MOC_LITERAL(3, 31, 14),
QT_MOC_LITERAL(4, 46, 16),
QT_MOC_LITERAL(5, 63, 11),
QT_MOC_LITERAL(6, 75, 11),
QT_MOC_LITERAL(7, 87, 9),
QT_MOC_LITERAL(8, 97, 9),
QT_MOC_LITERAL(9, 107, 10),
QT_MOC_LITERAL(10, 118, 8),
QT_MOC_LITERAL(11, 127, 10),
QT_MOC_LITERAL(12, 138, 3),
QT_MOC_LITERAL(13, 142, 10),
QT_MOC_LITERAL(14, 153, 13),
QT_MOC_LITERAL(15, 167, 6),
QT_MOC_LITERAL(16, 174, 13),
QT_MOC_LITERAL(17, 188, 6),
QT_MOC_LITERAL(18, 195, 13),
QT_MOC_LITERAL(19, 209, 16)
},
"TransactionView\0doubleClicked\0\0"
"contextualMenu\0dateRangeChanged\0"
"showDetails\0copyAddress\0editLabel\0"
"copyLabel\0copyAmount\0copyTxID\0chooseDate\0"
"idx\0chooseType\0changedPrefix\0prefix\0"
"changedAmount\0amount\0exportClicked\0"
"focusTransaction\0"
};
#undef QT_MOC_LITERAL
static const uint qt_meta_data_TransactionView[] = {
// content:
7, // revision
0, // classname
0, 0, // classinfo
15, 14, // methods
0, 0, // properties
0, 0, // enums/sets
0, 0, // constructors
0, // flags
1, // signalCount
// signals: name, argc, parameters, tag, flags
1, 1, 89, 2, 0x05,
// slots: name, argc, parameters, tag, flags
3, 1, 92, 2, 0x08,
4, 0, 95, 2, 0x08,
5, 0, 96, 2, 0x08,
6, 0, 97, 2, 0x08,
7, 0, 98, 2, 0x08,
8, 0, 99, 2, 0x08,
9, 0, 100, 2, 0x08,
10, 0, 101, 2, 0x08,
11, 1, 102, 2, 0x0a,
13, 1, 105, 2, 0x0a,
14, 1, 108, 2, 0x0a,
16, 1, 111, 2, 0x0a,
18, 0, 114, 2, 0x0a,
19, 1, 115, 2, 0x0a,
// signals: parameters
QMetaType::Void, QMetaType::QModelIndex, 2,
// slots: parameters
QMetaType::Void, QMetaType::QPoint, 2,
QMetaType::Void,
QMetaType::Void,
QMetaType::Void,
QMetaType::Void,
QMetaType::Void,
QMetaType::Void,
QMetaType::Void,
QMetaType::Void, QMetaType::Int, 12,
QMetaType::Void, QMetaType::Int, 12,
QMetaType::Void, QMetaType::QString, 15,
QMetaType::Void, QMetaType::QString, 17,
QMetaType::Void,
QMetaType::Void, QMetaType::QModelIndex, 2,
0 // eod
};
void TransactionView::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
if (_c == QMetaObject::InvokeMetaMethod) {
TransactionView *_t = static_cast<TransactionView *>(_o);
switch (_id) {
case 0: _t->doubleClicked((*reinterpret_cast< const QModelIndex(*)>(_a[1]))); break;
case 1: _t->contextualMenu((*reinterpret_cast< const QPoint(*)>(_a[1]))); break;
case 2: _t->dateRangeChanged(); break;
case 3: _t->showDetails(); break;
case 4: _t->copyAddress(); break;
case 5: _t->editLabel(); break;
case 6: _t->copyLabel(); break;
case 7: _t->copyAmount(); break;
case 8: _t->copyTxID(); break;
case 9: _t->chooseDate((*reinterpret_cast< int(*)>(_a[1]))); break;
case 10: _t->chooseType((*reinterpret_cast< int(*)>(_a[1]))); break;
case 11: _t->changedPrefix((*reinterpret_cast< const QString(*)>(_a[1]))); break;
case 12: _t->changedAmount((*reinterpret_cast< const QString(*)>(_a[1]))); break;
case 13: _t->exportClicked(); break;
case 14: _t->focusTransaction((*reinterpret_cast< const QModelIndex(*)>(_a[1]))); break;
default: ;
}
} else if (_c == QMetaObject::IndexOfMethod) {
int *result = reinterpret_cast<int *>(_a[0]);
void **func = reinterpret_cast<void **>(_a[1]);
{
typedef void (TransactionView::*_t)(const QModelIndex & );
if (*reinterpret_cast<_t *>(func) == static_cast<_t>(&TransactionView::doubleClicked)) {
*result = 0;
}
}
}
}
const QMetaObject TransactionView::staticMetaObject = {
{ &QWidget::staticMetaObject, qt_meta_stringdata_TransactionView.data,
qt_meta_data_TransactionView, qt_static_metacall, 0, 0}
};
const QMetaObject *TransactionView::metaObject() const
{
return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject;
}
void *TransactionView::qt_metacast(const char *_clname)
{
if (!_clname) return 0;
if (!strcmp(_clname, qt_meta_stringdata_TransactionView.stringdata))
return static_cast<void*>(const_cast< TransactionView*>(this));
return QWidget::qt_metacast(_clname);
}
int TransactionView::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
_id = QWidget::qt_metacall(_c, _id, _a);
if (_id < 0)
return _id;
if (_c == QMetaObject::InvokeMetaMethod) {
if (_id < 15)
qt_static_metacall(this, _c, _id, _a);
_id -= 15;
} else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
if (_id < 15)
*reinterpret_cast<int*>(_a[0]) = -1;
_id -= 15;
}
return _id;
}
// SIGNAL 0
void TransactionView::doubleClicked(const QModelIndex & _t1)
{
void *_a[] = { 0, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
QMetaObject::activate(this, &staticMetaObject, 0, _a);
}
QT_END_MOC_NAMESPACE
| [
"zhumin@qiyi.com"
] | zhumin@qiyi.com |
6804ece782b85e640bc67df8397f69a120f4fe5d | 6b2a8dd202fdce77c971c412717e305e1caaac51 | /solutions_5688567749672960_1/C++/Amoo/e.cpp | 91746c559ef1b6ef1f36e8ef09809b840c8bdc3f | [] | no_license | alexandraback/datacollection | 0bc67a9ace00abbc843f4912562f3a064992e0e9 | 076a7bc7693f3abf07bfdbdac838cb4ef65ccfcf | refs/heads/master | 2021-01-24T18:27:24.417992 | 2017-05-23T09:23:38 | 2017-05-23T09:23:38 | 84,313,442 | 2 | 4 | null | null | null | null | UTF-8 | C++ | false | false | 690 | cpp | //ITNOG
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i, s, e) for(int i = s; i < e; i ++)
const int maxN = 1000*1000 + 5;
const int mod = 1000*1000*1000 + 7;
int ch(int x)
{
int res = 0;
while(x)
{
res *= 10, res += x % 10;
x /= 10;
}
return res;
}
int solve()
{
int n; cin >> n;
int cur = n, cnt = 0;
while(cur)
{
if(cur % 10 == 0) { cur --; cnt ++; continue; }
cur = min(cur - 1, ch(cur));
cnt ++;
}
return cnt;
}
main()
{
ios::sync_with_stdio(0); cin.tie();
int T; cin >> T;
rep(i,1,T+1)
{
cout << "Case #" << i << ": " << solve() << endl;
}
return 0;
}
| [
"eewestman@gmail.com"
] | eewestman@gmail.com |
86b1824446008f5318646fad122f3ee795337d3b | ac2c7ce45a28c8ceb10d543944db90f6025e8a58 | /src/serialization/urihandler.hpp | 92aa51d9286c1658a0fb32a331707170e0092c2d | [
"MIT",
"BSD-3-Clause",
"Zlib",
"BSL-1.0"
] | permissive | degarashi/revenant | a5997ccc9090690abd03a19e749606c9cdf935d4 | 9e671320a5c8790f6bdd1b14934f81c37819f7b3 | refs/heads/master | 2021-01-11T00:15:06.876412 | 2019-09-08T13:00:26 | 2019-09-08T13:00:26 | 70,564,404 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 372 | hpp | #pragma once
#include "../uri/handler.hpp"
#include <cereal/types/vector.hpp>
#include <cereal/types/utility.hpp>
namespace rev {
template <class Ar>
void serialize(Ar& ar, UriHandlerV& u) {
ar(u._handler);
}
}
#include <cereal/types/polymorphic.hpp>
#include <cereal/archives/binary.hpp>
#include <cereal/archives/json.hpp>
CEREAL_REGISTER_TYPE(::rev::URIHandler);
| [
"slice013@gmail.com"
] | slice013@gmail.com |
22b9056192209a59cca64df7c404432238b3992f | 25546f0b7145c278888a74e0b068df4ebb30d204 | /druai_idl_test/src/druai_action_client.cpp | 8676cfafa0c0e6b89447f0d643a2baf23d24e49c | [] | no_license | TimCraig/ROS2-Workspace | 7400102ba71ecdc62066d1c1c4de10d8d39575ad | ab48b54ec784800c5bbc9a8bea198f94b5fc9e9f | refs/heads/master | 2020-11-24T12:57:50.806171 | 2020-05-01T09:22:45 | 2020-05-01T09:22:45 | 228,155,480 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,642 | cpp |
#include <inttypes.h>
#include <memory>
#include <string>
#include <iostream>
#include "druai_idl/action/druai_action.hpp"
#include "rclcpp/rclcpp.hpp"
// TODO(jacobperron): Remove this once it is included as part of 'rclcpp.hpp'
#include "rclcpp_action/rclcpp_action.hpp"
class DruaiActionClient : public rclcpp::Node
{
public:
using DruaiAction = druai_idl::action::DruaiAction;
using GoalHandleDruai = rclcpp_action::ClientGoalHandle<DruaiAction>;
explicit DruaiActionClient(const rclcpp::NodeOptions& node_options = rclcpp::NodeOptions())
: Node("druai_action_client", node_options), m_bGoalDone(false)
{
m_pActionClient = rclcpp_action::create_client<DruaiAction>(
get_node_base_interface(),
get_node_graph_interface(),
get_node_logging_interface(),
get_node_waitables_interface(),
"druai_action");
// Not sure why they do this timer thing to invoke SendGoal rather than just calling it? TTC
m_pTimer = create_wall_timer(
std::chrono::milliseconds(500),
std::bind(&DruaiActionClient::SendGoal, this));
return;
}
bool IsGoalDone() const
{
return (m_bGoalDone);
}
void SendGoal()
{
using namespace std::placeholders;
m_pTimer->cancel();
m_bGoalDone = false;
if (!m_pActionClient)
{
RCLCPP_ERROR(get_logger(), "Action client not initialized");
}
if (!m_pActionClient->wait_for_action_server(std::chrono::seconds(10)))
{
RCLCPP_ERROR(get_logger(), "Action server not available after waiting");
m_bGoalDone = true;
return;
}
auto GoalMsg = DruaiAction::Goal();
GoalMsg.start = 10;
GoalMsg.step = 2;
GoalMsg.end = 20;
RCLCPP_INFO(get_logger(), "Sending goal: start=%d step=%d end=%d", GoalMsg.start, GoalMsg.step, GoalMsg.end);
auto SendGoalOptions = rclcpp_action::Client<DruaiAction>::SendGoalOptions();
SendGoalOptions.goal_response_callback =
std::bind(&DruaiActionClient::GoalResponseCallback, this, _1);
SendGoalOptions.feedback_callback =
std::bind(&DruaiActionClient::FeedbackCallback, this, _1, _2);
SendGoalOptions.result_callback =
std::bind(&DruaiActionClient::ResultCallback, this, _1);
auto GoalHandleFuture = m_pActionClient->async_send_goal(GoalMsg, SendGoalOptions);
return;
}
private:
rclcpp_action::Client<DruaiAction>::SharedPtr m_pActionClient;
rclcpp::TimerBase::SharedPtr m_pTimer;
bool m_bGoalDone;
void GoalResponseCallback(std::shared_future<GoalHandleDruai::SharedPtr> Future)
{
auto pGoalHandle = Future.get();
if (!pGoalHandle)
{
RCLCPP_ERROR(get_logger(), "Goal was rejected by server");
}
else
{
RCLCPP_INFO(get_logger(), "Goal accepted by server, waiting for result");
}
return;
}
void FeedbackCallback(GoalHandleDruai::SharedPtr,
const std::shared_ptr<const DruaiAction::Feedback> pFeedback)
{
RCLCPP_INFO(get_logger(), "Next number in sequence received: %d", pFeedback->current);
return;
}
void ResultCallback(const GoalHandleDruai::WrappedResult& Result)
{
m_bGoalDone = true;
switch (Result.code)
{
case rclcpp_action::ResultCode::SUCCEEDED:
RCLCPP_INFO(get_logger(), "Result Received: final=%d", Result.result->final);
break;
case rclcpp_action::ResultCode::ABORTED:
RCLCPP_ERROR(get_logger(), "Goal was aborted");
break;
case rclcpp_action::ResultCode::CANCELED:
RCLCPP_ERROR(get_logger(), "Goal was canceled");
break;
default:
RCLCPP_ERROR(get_logger(), "Unknown result code");
break;
}
return;
}
}; // class DruaiActionClient
int main(int argc, char* argv[])
{
rclcpp::init(argc, argv);
auto pClient = std::make_shared<DruaiActionClient>();
// pClient->SendGoal();
// Keep the node running until the goal is done
while (!pClient->IsGoalDone())
{
rclcpp::spin_some(pClient);
}
rclcpp::shutdown();
return 0;
}
| [
"noreply@github.com"
] | TimCraig.noreply@github.com |
13fd346882e33310c65a3ee9ef50387865f1903e | c098ec56ee465fd4ccfe3cdeb74ed632ec2a0075 | /uudeview/uud32acx/uulib.cpp | 3e186ab16262e5a7c32f6d69a1ca0e28755ca188 | [] | no_license | maiken2051/uudeview | 326875690b025ee65d982c7429b33033d7a73ef3 | 0b8eba1f9406104b73696870d68ad221064ca13d | refs/heads/master | 2021-01-20T08:47:10.694490 | 2013-01-26T23:02:31 | 2013-01-26T23:02:31 | 7,598,749 | 0 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 30,486 | cpp | /*
* This file is part of the UUDeview ActiveX Control, a powerful,
* simple and friendly multi-part multi-file encoder/decoder
* software component.
*
* Copyright (c) 1997, 2001 by:
* Michael Newcomb <miken@miken.com>
* Frank Pilhofer <fp@informatik.uni-frankfurt.de>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* --> Commercial reuse is prohibited <--
*
*/
//
// ------------------------- UULIB.C ------------------------------------------
//
/*
* This file implements the externally visible functions, as declared
* in uudeview.h, and some internal interfacing functions
*/
#include "uudcore.h"
#pragma hdrstop
#include "windows.h" // Just for GetTickCount!
char * uulib_id = "$Id: uulib.c,v 1.24 2002/03/11 09:15:47 fp Exp $";
#ifdef SYSTEM_WINDLL
BOOL _export WINAPI
DllEntryPoint (HINSTANCE hInstance, DWORD seginfo,
LPVOID lpCmdLine)
{
/* Don't do anything, so just return true */
return TRUE;
}
#endif
/*
* In DOS, we must open the file binary, O_BINARY is defined there
*/
#ifndef O_BINARY
#define O_BINARY 0
#endif
/* for braindead systems */
#ifndef SEEK_SET
#ifdef L_BEGIN
#define SEEK_SET L_BEGIN
#else
#define SEEK_SET 0
#endif
#endif
/*
* Callback functions and their opaque arguments
*/
void (*uu_MsgCallback) _ANSI_ARGS_((void *, char *, int)) = NULL;
int (*uu_BusyCallback) _ANSI_ARGS_((void *, uuprogress *)) = NULL;
int (*uu_FileCallback) _ANSI_ARGS_((void *, char *, char *, int)) = NULL;
char * (*uu_FNameFilter) _ANSI_ARGS_((void *, char *)) = NULL;
void *uu_MsgCBArg = NULL;
void *uu_BusyCBArg = NULL;
void *uu_FileCBArg = NULL;
void *uu_FFCBArg = NULL;
/*
* Global variables
*/
#if SKIP
int uu_fast_scanning = 0; /* assumes at most 1 part per file */
int uu_bracket_policy = 0; /* gives part numbers in [] higher priority */
int uu_verbose = 1; /* enables/disables messages¬es */
int uu_desperate = 0; /* desperate mode */
int uu_ignreply = 0; /* ignore replies */
int uu_debug = 0; /* debugging mode (print __FILE__/__LINE__) */
int uu_errno = 0; /* the errno that caused this UURET_IOERR */
int uu_dumbness = 0; /* switch off the program's intelligence */
int uu_overwrite = 1; /* whether it's ok to overwrite ex. files */
int uu_ignmode = 0; /* ignore the original file mode */
int uu_handletext = 0; /* do we want text/plain messages */
int uu_usepreamble = 0; /* do we want Mime preambles/epilogues */
int uu_tinyb64 = 0; /* detect short B64 outside of MIME */
int uu_remove_input = 0; /* remove input files after decoding */
int uu_more_mime = 0; /* strictly adhere to MIME headers */
#endif
headercount hlcount = {
3, /* restarting after a MIME body */
2, /* after useful data in freestyle mode */
1 /* after useful data and an empty line */
};
/*
* version string
*/
char uulibversion[256] = VERSION "pl" PATCH;
/*
* prefix to the files on disk, usually a path name to save files to
*/
char *uusavepath;
/*
* extension to use when encoding single-part files
*/
char *uuencodeext;
/*
* areas to malloc
*/
char *uulib_msgstring;
char *uugen_inbuffer;
char *uugen_fnbuffer;
/*
* The Global List of Files
*/
uulist *UUGlobalFileList = NULL;
/*
* time values for BusyCallback. msecs is MILLIsecs here
*/
static long uu_busy_msecs = 0; /* call callback function each msecs */
static long uu_last_secs = 0; /* secs of last call to callback */
static long uu_last_usecs = 0; /* usecs of last call to callback */
/*
* progress information
*/
uuprogress progress;
/*
* Linked list of files we want to delete after decoding
*/
#if SKIP
typedef struct _itbd {
char *fname;
struct _itbd *NEXT;
} itbd;
static itbd * ftodel = NULL;
#endif
#if SKIP
/*
* for the busy poll
*/
unsigned long uuyctr;
/*
* Areas to allocate. Instead of using static memory areas, we malloc()
* the memory in UUInitialize() and release them in UUCleanUp to prevent
* blowing up of the binary size
* This is a table with the pointers to allocate and required sizes.
* They are guaranteed to be never NULL.
*/
typedef struct {
char **ptr;
size_t size;
} allomap;
static allomap toallocate[] = {
{ &uugen_fnbuffer, 1024 }, /* generic filename buffer */
{ &uugen_inbuffer, 1024 }, /* generic input data buffer */
{ &uucheck_lastname, 256 }, /* from uucheck.c */
{ &uucheck_tempname, 256 },
{ &uuestr_itemp, 256 }, /* from uuencode.c:UUEncodeStream() */
{ &uuestr_otemp, 1024 },
{ &uulib_msgstring, 1024 }, /* from uulib.c:UUMessage() */
{ &uuncdl_fulline, 300 }, /* from uunconc.c:UUDecodeLine() */
{ &uuncdp_oline, 1200 }, /* from uunconc.c:UUDecodePart() */
{ &uunconc_UUxlat, 256 * sizeof (int) }, /* from uunconc.c:toplevel */
{ &uunconc_UUxlen, 64 * sizeof (int) },
{ &uunconc_B64xlat, 256 * sizeof (int) },
{ &uunconc_XXxlat, 256 * sizeof (int) },
{ &uunconc_BHxlat, 256 * sizeof (int) },
{ &uunconc_save, 3*300 }, /* from uunconc.c:decoding buffer */
{ &uuscan_shlline, 1024 }, /* from uuscan.c:ScanHeaderLine() */
{ &uuscan_pvvalue, 300 }, /* from uuscan.c:ParseValue() */
{ &uuscan_phtext, 300 }, /* from uuscan.c:ParseHeader() */
{ &uuscan_sdline, 300 }, /* from uuscan.c:ScanData() */
{ &uuscan_sdbhds1, 300 },
{ &uuscan_sdbhds2, 300 },
{ &uuscan_spline, 300 }, /* from uuscan.c:ScanPart() */
{ &uuutil_bhwtmp, 300 }, /* from uuutil.c:UUbhwrite() */
{ NULL, 0 }
};
#endif
/*
* Handle the printing of messages. Works like printf.
*/
#if defined(STDC_HEADERS) || defined(HAVE_STDARG_H)
int
UUDWrap::UUMessage (char *file, int line, int level, char *format, ...)
#else
int
UUMessage (va_alist)
va_dcl
#endif
{
char *msgptr;
#if defined(STDC_HEADERS) || defined(HAVE_STDARG_H)
va_list ap;
va_start (ap, format);
#else
char *file, *format;
int line, level;
va_list ap;
va_start (ap);
file = va_arg (ap, char *);
line = va_arg (ap, int);
level = va_arg (ap, int);
format = va_arg (ap, char *);
#endif
if (uu_debug) {
sprintf (uulib_msgstring, "%s(%d): %s", file, line, msgnames[level]);
msgptr = uulib_msgstring + strlen (uulib_msgstring);
}
else {
sprintf (uulib_msgstring, "%s", msgnames[level]);
msgptr = uulib_msgstring + strlen (uulib_msgstring);
}
#if SKIP
if (uu_MsgCallback && (level>UUMSG_NOTE || uu_verbose)) {
vsprintf (msgptr, format, ap);
(*uu_MsgCallback) (uu_MsgCBArg, uulib_msgstring, level);
}
#endif
if (level>UUMSG_NOTE || uu_verbose)
{
vsprintf (msgptr, format, ap);
MessageHandler(uulib_msgstring, level);
}
va_end (ap);
return UURET_OK;
}
/*
* Call the Busy Callback from time to time. This function must be
* polled from the Busy loops.
*/
int
UUDWrap::UUBusyPoll (void)
{
#if SKIP
#ifdef HAVE_GETTIMEOFDAY
struct timeval tv;
long msecs;
if (uu_BusyCallback) {
(void) gettimeofday (&tv, NULL);
msecs = 1000*(tv.tv_sec-uu_last_secs)+(tv.tv_usec-uu_last_usecs)/1000;
if (uu_last_secs==0 || msecs > uu_busy_msecs) {
uu_last_secs = tv.tv_sec;
uu_last_usecs = tv.tv_usec;
return (*uu_BusyCallback) (uu_BusyCBArg, &progress);
}
}
#else
time_t now;
long msecs;
if (uu_BusyCallback) {
if (uu_busy_msecs <= 0) {
msecs = 1;
}
else {
now = time(NULL);
msecs = 1000 * (now - uu_last_secs);
}
if (uu_last_secs==0 || msecs > uu_busy_msecs) {
uu_last_secs = now;
uu_last_usecs = 0;
return (*uu_BusyCallback) (uu_BusyCBArg, &progress);
}
}
#endif
#endif
unsigned long tc = GetTickCount();
if (uu_last_usecs == 0 || (tc - uu_last_usecs) > BUSY_MSECS)
{
uu_last_usecs = tc;
return(BusyCallback(&progress));
}
return 0;
}
/*
* Initialization function
*/
#if SKIP
int UUEXPORT
UUInitialize (void)
{
allomap *aiter;
progress.action = 0;
progress.curfile[0] = '\0';
ftodel = NULL;
uusavepath = NULL;
uuencodeext = NULL;
mssdepth = 0;
memset (&localenv, 0, sizeof (headers));
memset (&sstate, 0, sizeof (scanstate));
nofnum = 0;
mimseqno = 0;
lastvalid = 0;
lastenc = 0;
uuyctr = 0;
/*
* Allocate areas
*/
for (aiter=toallocate; aiter->ptr; aiter++)
*(aiter->ptr) = NULL;
for (aiter=toallocate; aiter->ptr; aiter++) {
if ((*(aiter->ptr) = (char *) malloc (aiter->size)) == NULL) {
/*
* oops. we may not print a message here, because we need these
* areas (uulib_msgstring) in UUMessage()
*/
for (aiter=toallocate; aiter->ptr; aiter++) {
_FP_free (*(aiter->ptr));
}
return UURET_NOMEM;
}
}
/*
* Must be called after areas have been malloced
*/
UUInitConc ();
return UURET_OK;
}
#endif
/*
* Set and get Options
*/
int UUEXPORT
UUGetOption (int option, int *ivalue, char *cvalue, int clength)
{
int result;
switch (option) {
case UUOPT_VERSION:
_FP_strncpy (cvalue, uulibversion, clength);
result = 0;
break;
case UUOPT_FAST:
if (ivalue) *ivalue = uu_fast_scanning;
result = uu_fast_scanning;
break;
case UUOPT_DUMBNESS:
if (ivalue) *ivalue = uu_dumbness;
result = uu_dumbness;
break;
case UUOPT_BRACKPOL:
if (ivalue) *ivalue = uu_bracket_policy;
result = uu_bracket_policy;
break;
case UUOPT_VERBOSE:
if (ivalue) *ivalue = uu_verbose;
result = uu_verbose;
break;
case UUOPT_DESPERATE:
if (ivalue) *ivalue = uu_desperate;
result = uu_desperate;
break;
case UUOPT_IGNREPLY:
if (ivalue) *ivalue = uu_ignreply;
result = uu_ignreply;
break;
case UUOPT_DEBUG:
if (ivalue) *ivalue = uu_debug;
result = uu_debug;
break;
case UUOPT_ERRNO:
if (ivalue) *ivalue = uu_errno;
result = uu_errno;
break;
case UUOPT_OVERWRITE:
if (ivalue) *ivalue = uu_overwrite;
result = uu_overwrite;
break;
case UUOPT_SAVEPATH:
_FP_strncpy (cvalue, uusavepath, clength);
result = 0;
break;
case UUOPT_PROGRESS:
if (clength==sizeof(uuprogress)) {
memcpy (cvalue, &progress, sizeof (uuprogress));
result = 0;
}
else
result = -1;
break;
case UUOPT_IGNMODE:
if (ivalue) *ivalue = uu_ignmode;
result = uu_ignmode;
break;
case UUOPT_USETEXT:
if (ivalue) *ivalue = uu_handletext;
result = uu_handletext;
break;
case UUOPT_PREAMB:
if (ivalue) *ivalue = uu_usepreamble;
result = uu_usepreamble;
break;
case UUOPT_TINYB64:
if (ivalue) *ivalue = uu_tinyb64;
result = uu_tinyb64;
break;
case UUOPT_ENCEXT:
_FP_strncpy (cvalue, uuencodeext, clength);
result = 0;
break;
case UUOPT_REMOVE:
if (ivalue) *ivalue = uu_remove_input;
result = uu_remove_input;
break;
case UUOPT_MOREMIME:
if (ivalue) *ivalue = uu_more_mime;
result = uu_more_mime;
break;
case UUOPT_STRICTFN:
if (ivalue) *ivalue = uu_strict_filename;
result = uu_strict_filename;
break;
default:
return -1;
}
return result;
}
int UUEXPORT
UUSetOption (int option, int ivalue, char *cvalue)
{
switch (option) {
case UUOPT_FAST:
uu_fast_scanning = ivalue;
break;
case UUOPT_DUMBNESS:
uu_dumbness = ivalue;
break;
case UUOPT_BRACKPOL:
uu_bracket_policy = ivalue;
break;
case UUOPT_VERBOSE:
uu_verbose = ivalue;
break;
case UUOPT_DESPERATE:
uu_desperate = ivalue;
break;
case UUOPT_IGNREPLY:
uu_ignreply = ivalue;
break;
case UUOPT_DEBUG:
uu_debug = ivalue;
break;
case UUOPT_OVERWRITE:
uu_overwrite = ivalue;
break;
case UUOPT_SAVEPATH:
_FP_free (uusavepath);
uusavepath = _FP_strdup (cvalue);
break;
case UUOPT_IGNMODE:
uu_ignmode = ivalue;
break;
case UUOPT_USETEXT:
uu_handletext = ivalue;
break;
case UUOPT_PREAMB:
uu_usepreamble = ivalue;
break;
case UUOPT_TINYB64:
uu_tinyb64 = ivalue;
break;
case UUOPT_ENCEXT:
_FP_free (uuencodeext);
uuencodeext = _FP_strdup (cvalue);
break;
case UUOPT_REMOVE:
uu_remove_input = ivalue;
break;
case UUOPT_MOREMIME:
uu_more_mime = ivalue;
break;
case UUOPT_STRICTFN:
uu_strict_filename = ivalue;
break;
default:
return UURET_ILLVAL;
}
return UURET_OK;
}
char * UUEXPORT
UUstrerror (int code)
{
return uuretcodes[code];
}
/*
* Set the various Callback functions
*/
#if SKIP
int UUEXPORT
UUSetMsgCallback (void *opaque,
void (*func) _ANSI_ARGS_((void *, char *, int)))
{
uu_MsgCallback = func;
uu_MsgCBArg = opaque;
return UURET_OK;
}
int UUEXPORT
UUSetBusyCallback (void *opaque,
int (*func) _ANSI_ARGS_((void *, uuprogress *)),
long msecs)
{
uu_BusyCallback = func;
uu_BusyCBArg = opaque;
uu_busy_msecs = msecs;
return UURET_OK;
}
int UUEXPORT
UUSetFileCallback (void *opaque,
int (*func) _ANSI_ARGS_((void *, char *, char *, int)))
{
uu_FileCallback = func;
uu_FileCBArg = opaque;
return UURET_OK;
}
int UUEXPORT
UUSetFNameFilter (void *opaque,
char * (*func) _ANSI_ARGS_((void *, char *)))
{
uu_FNameFilter = func;
uu_FFCBArg = opaque;
return UURET_OK;
}
#endif
/*
* Return a pointer to the nth element of the GlobalFileList
* zero-based, returns NULL if item is too large.
*/
uulist * UUEXPORT
UUGetFileListItem (int item)
{
uulist *iter=UUGlobalFileList;
if (item < 0)
return NULL;
while (item && iter) {
iter = iter->NEXT;
item--;
}
return iter;
}
/*
* call the current filter
*/
#if SKIP
char * UUEXPORT
UUFNameFilter (char *fname)
{
if (uu_FNameFilter)
return (*uu_FNameFilter) (uu_FFCBArg, fname);
return fname;
}
#endif
/*
* Load a File. We call ScanPart repeatedly until at EOF and
* add the parts to UUGlobalFileList
*/
int UUEXPORT
UULoadFile (char *filename, char *fileid, int delflag)
{
int res, sr, count=0;
struct stat finfo;
fileread *loaded;
uufile *fload;
itbd *killem;
FILE *datei;
if ((datei = fopen (filename, "rb")) == NULL) {
UUMessage (uulib_id, __LINE__, UUMSG_ERROR,
uustring (S_NOT_OPEN_SOURCE),
filename, strerror (uu_errno = errno));
return UURET_IOERR;
}
if (fstat (fileno(datei), &finfo) == -1) {
UUMessage (uulib_id, __LINE__, UUMSG_ERROR,
uustring (S_NOT_STAT_FILE),
filename, strerror (uu_errno = errno));
fclose (datei);
return UURET_IOERR;
}
/*
* schedule for destruction
*/
if (delflag && fileid==NULL) {
if ((killem = (itbd *) malloc (sizeof (itbd))) == NULL) {
UUMessage (uulib_id, __LINE__, UUMSG_WARNING,
uustring (S_OUT_OF_MEMORY), sizeof (itbd));
}
else if ((killem->fname = _FP_strdup (filename)) == NULL) {
UUMessage (uulib_id, __LINE__, UUMSG_WARNING,
uustring (S_OUT_OF_MEMORY), strlen(filename)+1);
_FP_free (killem);
}
else {
killem->NEXT = ftodel;
ftodel = killem;
}
}
progress.action = 0;
progress.partno = 0;
progress.numparts = 1;
progress.fsize = (long) ((finfo.st_size>0)?finfo.st_size:-1);
progress.percent = 0;
progress.foffset = 0;
_FP_strncpy (progress.curfile,
(strlen(filename)>255)?
(filename+strlen(filename)-255):filename,
256);
progress.action = UUACT_SCANNING;
if (fileid == NULL)
fileid = filename;
while (!feof (datei) && !ferror (datei)) {
/*
* Peek file, or some systems won't detect EOF
*/
res = fgetc (datei);
if (feof (datei) || ferror (datei))
break;
else
ungetc (res, datei);
if ((loaded = ScanPart (datei, fileid, &sr)) == NULL) {
if (sr != UURET_NODATA && sr != UURET_OK && sr != UURET_CONT) {
UUkillfread (loaded);
if (sr != UURET_CANCEL) {
UUMessage (uulib_id, __LINE__, UUMSG_ERROR,
uustring (S_READ_ERROR), filename,
strerror (uu_errno));
}
UUCheckGlobalList ();
progress.action = 0;
fclose (datei);
return sr;
}
continue;
}
if (ferror (datei)) {
UUMessage (uulib_id, __LINE__, UUMSG_ERROR,
uustring (S_READ_ERROR), filename,
strerror (uu_errno = errno));
UUCheckGlobalList ();
progress.action = 0;
fclose (datei);
return UURET_IOERR;
}
if ((loaded->uudet == QP_ENCODED || loaded->uudet == PT_ENCODED) &&
(loaded->filename == NULL || *(loaded->filename) == '\0') &&
!uu_handletext && (loaded->flags&FL_PARTIAL)==0) {
/*
* Don't want text
*/
UUkillfread (loaded);
continue;
}
if ((loaded->subject == NULL || *(loaded->subject) == '\0') &&
(loaded->mimeid == NULL || *(loaded->mimeid) == '\0') &&
(loaded->filename== NULL || *(loaded->filename)== '\0') &&
(loaded->uudet == 0)) {
/*
* no useful data here
*/
UUkillfread (loaded);
if (uu_fast_scanning && sr != UURET_CONT) break;
continue;
}
if ((fload = UUPreProcessPart (loaded, &res)) == NULL) {
/*
* no useful data found
*/
if (res != UURET_NODATA) {
UUMessage (uulib_id, __LINE__, UUMSG_ERROR,
uustring (S_READ_ERROR), filename,
(res==UURET_IOERR)?strerror(uu_errno):UUstrerror(res));
}
UUkillfread (loaded);
if (uu_fast_scanning && sr != UURET_CONT) break;
continue;
}
if ((loaded->subject && *(loaded->subject)) ||
(loaded->mimeid && *(loaded->mimeid)) ||
(loaded->filename&& *(loaded->filename))||
(loaded->uudet)) {
UUMessage (uulib_id, __LINE__, UUMSG_MESSAGE,
uustring (S_LOADED_PART),
filename,
(loaded->subject) ? loaded->subject : "",
(fload->subfname) ? fload->subfname : "",
(loaded->filename) ? loaded->filename : "",
fload->partno,
(loaded->begin) ? "begin" : "",
(loaded->end) ? "end" : "",
codenames[loaded->uudet]);
}
if ((res = UUInsertPartToList (fload))) {
/*
* couldn't use the data
*/
UUkillfile (fload);
if (res != UURET_NODATA) {
UUCheckGlobalList ();
progress.action = 0;
fclose (datei);
return res;
}
if (uu_fast_scanning && sr != UURET_CONT)
break;
continue;
}
/*
* if in fast mode, we don't look any further, because we're told
* that each source file holds at most one encoded part
*/
if (uu_fast_scanning && sr != UURET_CONT)
break;
if (loaded->uudet)
count++;
}
fclose (datei);
if (!uu_fast_scanning && count==0) {
UUMessage (uulib_id, __LINE__, UUMSG_NOTE,
uustring (S_NO_DATA_FOUND), filename);
}
progress.action = 0;
UUCheckGlobalList ();
return UURET_OK;
}
/*
* decode to a temporary file. this is well handled by uudecode()
*/
#if SKIP
int UUEXPORT
UUDecodeToTemp (uulist *thefile)
{
return UUDecode (thefile);
}
#endif
/*
* decode file first to temp file, then copy it to a final location
*/
int UUEXPORT
UUDecodeFile (uulist *thefile, char *destname)
{
FILE *target, *source;
struct stat finfo;
int fildes, res;
size_t bytes;
if (thefile == NULL)
return UURET_ILLVAL;
if ((res = UUDecode (thefile)) != UURET_OK)
if (res != UURET_NOEND || !uu_desperate)
return res;
if (thefile->binfile == NULL) {
UUMessage (uulib_id, __LINE__, UUMSG_ERROR,
uustring (S_NO_BIN_FILE));
return UURET_IOERR;
}
if ((source = fopen (thefile->binfile, "rb")) == NULL) {
UUMessage (uulib_id, __LINE__, UUMSG_ERROR,
uustring (S_NOT_OPEN_FILE),
thefile->binfile, strerror (uu_errno = errno));
return UURET_IOERR;
}
/*
* for system security, strip setuid/setgid bits from mode
*/
if ((thefile->mode & 0777) != thefile->mode) {
UUMessage (uulib_id, __LINE__, UUMSG_NOTE,
uustring (S_STRIPPED_SETUID),
destname, (int)thefile->mode);
thefile->mode &= 0777;
}
/*
* Determine the name of the target file according to the rules:
*
* IF (destname!=NULL) THEN filename=destname;
* ELSE
* filename = thefile->filename
* IF (FilenameFilter!=NULL) THEN filename=FilenameFilter(filename);
* filename = SaveFilePath + filename
* END
*/
if (destname)
strcpy (uugen_fnbuffer, destname);
else {
sprintf (uugen_fnbuffer, "%s%s",
(uusavepath)?uusavepath:"",
UUFNameFilter ((thefile->filename)?
thefile->filename:"unknown.xxx"));
}
/*
* if we don't want to overwrite existing files, check if it's there
*/
if (!uu_overwrite) {
if (stat (uugen_fnbuffer, &finfo) == 0) {
UUMessage (uulib_id, __LINE__, UUMSG_ERROR,
uustring (S_TARGET_EXISTS), uugen_fnbuffer);
fclose (source);
return UURET_EXISTS;
}
}
if (fstat (fileno(source), &finfo) == -1) {
UUMessage (uulib_id, __LINE__, UUMSG_ERROR,
uustring (S_NOT_STAT_FILE),
thefile->binfile, strerror (uu_errno = errno));
fclose (source);
return UURET_IOERR;
}
progress.action = 0;
_FP_strncpy (progress.curfile,
(strlen(uugen_fnbuffer)>255)?
(uugen_fnbuffer+strlen(uugen_fnbuffer)-255):uugen_fnbuffer,
256);
progress.partno = 0;
progress.numparts = 1;
progress.fsize = (long) ((finfo.st_size)?finfo.st_size:-1);
progress.foffset = 0;
progress.percent = 0;
progress.action = UUACT_COPYING;
if ((fildes = open (uugen_fnbuffer,
O_WRONLY | O_CREAT | O_BINARY | O_TRUNC,
(uu_ignmode)?0666:thefile->mode)) == -1) {
progress.action = 0;
UUMessage (uulib_id, __LINE__, UUMSG_ERROR,
uustring (S_NOT_OPEN_TARGET),
uugen_fnbuffer, strerror (uu_errno = errno));
fclose (source);
return UURET_IOERR;
}
if ((target = fdopen (fildes, "wb")) == NULL) {
progress.action = 0;
UUMessage (uulib_id, __LINE__, UUMSG_ERROR,
uustring (S_IO_ERR_TARGET),
uugen_fnbuffer, strerror (uu_errno = errno));
fclose (source);
close (fildes);
return UURET_IOERR;
}
while (!feof (source)) {
if (UUBUSYPOLL(ftell(source),progress.fsize)) {
UUMessage (uulib_id, __LINE__, UUMSG_NOTE,
uustring (S_DECODE_CANCEL));
fclose (source);
fclose (target);
unlink (uugen_fnbuffer);
return UURET_CANCEL;
}
bytes = fread (uugen_inbuffer, 1, 1024, source);
if (ferror (source) || (bytes == 0 && !feof (source))) {
progress.action = 0;
UUMessage (uulib_id, __LINE__, UUMSG_ERROR,
uustring (S_READ_ERROR),
thefile->binfile, strerror (uu_errno = errno));
fclose (source);
fclose (target);
unlink (uugen_fnbuffer);
return UURET_IOERR;
}
if (fwrite (uugen_inbuffer, 1, bytes, target) != bytes) {
progress.action = 0;
UUMessage (uulib_id, __LINE__, UUMSG_ERROR,
uustring (S_WR_ERR_TARGET),
uugen_fnbuffer, strerror (uu_errno = errno));
fclose (source);
fclose (target);
unlink (uugen_fnbuffer);
return UURET_IOERR;
}
}
fclose (target);
fclose (source);
/*
* after a successful decoding run, we delete the temporary file
*/
if (unlink (thefile->binfile)) {
UUMessage (uulib_id, __LINE__, UUMSG_WARNING,
uustring (S_TMP_NOT_REMOVED),
thefile->binfile,
strerror (uu_errno = errno));
}
_FP_free (thefile->binfile);
thefile->binfile = NULL;
thefile->state &= ~UUFILE_TMPFILE;
thefile->state |= UUFILE_DECODED;
progress.action = 0;
return UURET_OK;
}
/*
* Calls a function repeatedly with all the info we have for a file
* If the function returns non-zero, we break and don't send any more
*/
int UUEXPORT
UUInfoFile (uulist *thefile, void *opaque)
{
int errflag=0, res, bhflag=0, dd;
long maxpos;
FILE *inpfile;
/*
* We might need to ask our callback function to download the file
*/
if (uu_FileCallback) {
if ((res = (*uu_FileCallback) (uu_FileCBArg,
thefile->thisfile->data->sfname,
uugen_fnbuffer,
1)) != UURET_OK)
return res;
if ((inpfile = fopen (uugen_fnbuffer, "rb")) == NULL) {
(*uu_FileCallback) (uu_FileCBArg, thefile->thisfile->data->sfname,
uugen_fnbuffer, 0);
UUMessage (uulib_id, __LINE__, UUMSG_ERROR,
uustring (S_NOT_OPEN_FILE), uugen_fnbuffer,
strerror (uu_errno = errno));
return UURET_IOERR;
}
}
else {
if ((inpfile = fopen (thefile->thisfile->data->sfname, "rb")) == NULL) {
UUMessage (uulib_id, __LINE__, UUMSG_ERROR,
uustring (S_NOT_OPEN_FILE),
thefile->thisfile->data->sfname,
strerror (uu_errno=errno));
return UURET_IOERR;
}
_FP_strncpy (uugen_fnbuffer, thefile->thisfile->data->sfname, 1024);
}
/*
* seek to beginning of info
*/
fseek (inpfile, thefile->thisfile->data->startpos, SEEK_SET);
maxpos = thefile->thisfile->data->startpos + thefile->thisfile->data->length;
while (!feof (inpfile) &&
(uu_fast_scanning || ftell(inpfile) < maxpos)) {
if (_FP_fgets (uugen_inbuffer, 511, inpfile) == NULL)
break;
uugen_inbuffer[511] = '\0';
if (ferror (inpfile))
break;
dd = UUValidData (uugen_inbuffer, 0, &bhflag);
if (thefile->uudet == B64ENCODED && dd == B64ENCODED)
break;
else if (thefile->uudet == BH_ENCODED && bhflag)
break;
else if ((thefile->uudet == UU_ENCODED || thefile->uudet == XX_ENCODED) &&
strncmp (uugen_inbuffer, "begin ", 6) == 0)
break;
else if (thefile->uudet == YENC_ENCODED &&
strncmp (uugen_inbuffer, "=ybegin ", 8) == 0)
break;
// if ((*func) (opaque, uugen_inbuffer))
// break;
if (UUInfoHandler(opaque, uugen_inbuffer))
break;
}
if (ferror (inpfile)) {
UUMessage (uulib_id, __LINE__, UUMSG_ERROR,
uustring (S_READ_ERROR),
uugen_fnbuffer, strerror (uu_errno = errno));
errflag = 1;
}
fclose (inpfile);
if (uu_FileCallback)
(*uu_FileCallback) (uu_FileCBArg,
thefile->thisfile->data->sfname,
uugen_fnbuffer, 0);
if (errflag)
return UURET_IOERR;
return UURET_OK;
}
int UUEXPORT
UURenameFile (uulist *thefile, char *newname)
{
char *oldname;
if (thefile == NULL)
return UURET_ILLVAL;
oldname = thefile->filename;
if ((thefile->filename = _FP_strdup (newname)) == NULL) {
UUMessage (uulib_id, __LINE__, UUMSG_ERROR,
uustring (S_NOT_RENAME),
oldname, newname);
thefile->filename = oldname;
return UURET_NOMEM;
}
_FP_free (oldname);
return UURET_OK;
}
int UUEXPORT
UURemoveTemp (uulist *thefile)
{
if (thefile == NULL)
return UURET_ILLVAL;
if (thefile->binfile) {
if (unlink (thefile->binfile)) {
UUMessage (uulib_id, __LINE__, UUMSG_WARNING,
uustring (S_TMP_NOT_REMOVED),
thefile->binfile,
strerror (uu_errno = errno));
}
_FP_free (thefile->binfile);
thefile->binfile = NULL;
thefile->state &= ~UUFILE_TMPFILE;
}
return UURET_OK;
}
int UUEXPORT
UUCleanUp (void)
{
itbd *iter=ftodel, *ptr;
uulist *liter;
uufile *fiter;
// allomap *aiter;
/*
* delete temporary input files (such as the copy of stdin)
*/
while (iter) {
if (unlink (iter->fname)) {
UUMessage (uulib_id, __LINE__, UUMSG_WARNING,
uustring (S_TMP_NOT_REMOVED),
iter->fname, strerror (uu_errno = errno));
}
_FP_free (iter->fname);
ptr = iter;
iter = iter->NEXT;
_FP_free (ptr);
}
ftodel = NULL;
/*
* Delete input files after successful decoding
*/
if (uu_remove_input) {
liter = UUGlobalFileList;
while (liter) {
if (liter->state & UUFILE_DECODED) {
fiter = liter->thisfile;
while (fiter) {
if (fiter->data && fiter->data->sfname) {
/*
* Error code ignored. We might want to delete a file multiple
* times
*/
unlink (fiter->data->sfname);
}
fiter = fiter->NEXT;
}
}
liter = liter->NEXT;
}
}
UUkilllist (UUGlobalFileList);
UUGlobalFileList = NULL;
_FP_free (uusavepath);
_FP_free (uuencodeext);
_FP_free (sstate.source);
uusavepath = NULL;
uuencodeext = NULL;
UUkillheaders (&localenv);
UUkillheaders (&sstate.envelope);
memset (&localenv, 0, sizeof (headers));
memset (&sstate, 0, sizeof (scanstate));
while (mssdepth) {
mssdepth--;
UUkillheaders (&(multistack[mssdepth].envelope));
_FP_free (multistack[mssdepth].source);
}
/*
* clean up the malloc'ed stuff
*/
#if SKIP
for (aiter=toallocate; aiter->ptr; aiter++) {
_FP_free (*(aiter->ptr));
*(aiter->ptr) = NULL;
}
#endif
return UURET_OK;
}
| [
"uud@miken.com"
] | uud@miken.com |
ad938b7bf2d1e152efcd4f0291a8aa7b9adb57b6 | 4277663d968e3ab9cc46d692252a6a91b9d50757 | /src/model/topology.cpp | 25d441ae3628c281f5cb75b4b9926032971bf495 | [] | no_license | qiyangjie/timeloop | 37457a0e1b4082e59861546b12813c964176845b | bce09c2ca2c6d6a4b487d51e19458caf16d507aa | refs/heads/master | 2020-06-01T02:47:07.490555 | 2019-06-05T17:50:25 | 2019-06-05T17:50:25 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 16,496 | cpp | /* Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of NVIDIA CORPORATION nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``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 <cassert>
#include <string>
#include "model/topology.hpp"
namespace model
{
std::ostream& operator<<(std::ostream& out, const Topology& topology)
{
int level_id = 0;
for (auto & level : topology.levels_)
{
out << "Level " << level_id << std::endl;
out << "-------" << std::endl;
level->Print(out);
level_id++;
}
if (topology.is_evaluated_)
{
out << "Total topology energy: " << topology.Energy() << " pJ" << std::endl;
out << "Total topology area: " << topology.Area() << " um^2" << std::endl;
out << "Max topology cycles: " << topology.Cycles() << std::endl;
}
return out;
}
void Topology::Spec(const Topology::Specs& specs)
{
specs_ = specs;
for (auto& level : levels_)
{
level.reset();
}
levels_.clear();
for (unsigned i = 0; i < specs.NumLevels(); i++)
{
auto level_specs = specs.GetLevel(i);
// What type of level is this?
if (level_specs->Type() == "BufferLevel")
{
BufferLevel::Specs& specs = *std::static_pointer_cast<BufferLevel::Specs>(level_specs);
std::shared_ptr<BufferLevel> buffer_level = std::make_shared<BufferLevel>(specs);
std::shared_ptr<Level> level = std::static_pointer_cast<Level>(buffer_level);
levels_.push_back(level);
}
else if (level_specs->Type() == "ArithmeticUnits")
{
ArithmeticUnits::Specs& specs = *std::static_pointer_cast<ArithmeticUnits::Specs>(level_specs);
std::shared_ptr<ArithmeticUnits> arithmetic_level = std::make_shared<ArithmeticUnits>(specs);
std::shared_ptr<Level> level = std::static_pointer_cast<Level>(arithmetic_level);
levels_.push_back(level);
}
else
{
std::cerr << "ERROR: illegal level specs type: " << level_specs->Type() << std::endl;
exit(1);
}
}
is_specced_ = true;
}
// The hierarchical ParseSpecs functions are static and do not
// affect the internal specs_ data structure, which is set by
// the dynamic Spec() call later.
// This function implements the "classic" hierarchical topology
// with arithmetic units at level 0 and storage units at level 1+.
Topology::Specs Topology::ParseSpecs(libconfig::Setting& storage,
libconfig::Setting& arithmetic)
{
Specs specs;
assert(storage.isList());
// Level 0: arithmetic.
auto level_specs_p = std::make_shared<ArithmeticUnits::Specs>(ArithmeticUnits::ParseSpecs(arithmetic));
specs.AddLevel(0, std::static_pointer_cast<LevelSpecs>(level_specs_p));
// Storage levels.
int num_storage_levels = storage.getLength();
for (int i = 0; i < num_storage_levels; i++)
{
libconfig::Setting& level = storage[i];
auto level_specs_p = std::make_shared<BufferLevel::Specs>(BufferLevel::ParseSpecs(level));
specs.AddLevel(i, std::static_pointer_cast<LevelSpecs>(level_specs_p));
}
Validate(specs);
return specs;
}
// Make sure the topology is consistent,
// and update unspecified parameters if they can
// be inferred from other specified parameters.
void Topology::Validate(Topology::Specs& specs)
{
// Intra-level topology validation is carried out by the levels
// themselves. We take care of inter-layer issues here. This
// breaks abstraction since we will be poking at levels' private
// specs. FIXME.
// Assumption here is that level i always connects to level
// i-1 via a 1:1 or fanout network. The network module will
// eventually be factored out, at which point we can make the
// interconnection more generic and specifiable.
BufferLevel::Specs& inner = *specs.GetStorageLevel(0);
ArithmeticUnits::Specs& arithmetic_specs = *specs.GetArithmeticLevel();
unsigned inner_start_pvi, inner_end_pvi;
if (inner.sharing_type == BufferLevel::DataSpaceIDSharing::Shared)
{
inner_start_pvi = inner_end_pvi = unsigned(problem::GetShape()->NumDataSpaces);
}
else
{
inner_start_pvi = 0;
inner_end_pvi = unsigned(problem::GetShape()->NumDataSpaces) - 1;
}
auto inner_start_pv = problem::Shape::DataSpaceID(inner_start_pvi);
if (inner.Instances(inner_start_pv).Get() == arithmetic_specs.Instances().Get())
{
for (unsigned pvi = inner_start_pvi; pvi <= inner_end_pvi; pvi++)
{
inner.FanoutX(problem::Shape::DataSpaceID(pvi)) = 1;
inner.FanoutY(problem::Shape::DataSpaceID(pvi)) = 1;
inner.Fanout(problem::Shape::DataSpaceID(pvi)) = 1;
}
}
else
{
// fanout
assert(arithmetic_specs.Instances().Get() % inner.Instances(inner_start_pv).Get() == 0);
unsigned fanout_in = arithmetic_specs.Instances().Get() / inner.Instances(inner_start_pv).Get();
for (unsigned pvi = inner_start_pvi; pvi <= inner_end_pvi; pvi++)
inner.Fanout(problem::Shape::DataSpaceID(pvi)) = fanout_in;
// fanout x
assert(arithmetic_specs.MeshX().IsSpecified());
assert(arithmetic_specs.MeshX().Get() % inner.MeshX(inner_start_pv).Get() == 0);
unsigned fanoutX_in = arithmetic_specs.MeshX().Get() / inner.MeshX(inner_start_pv).Get();
for (unsigned pvi = inner_start_pvi; pvi <= inner_end_pvi; pvi++)
inner.FanoutX(problem::Shape::DataSpaceID(pvi)) = fanoutX_in;
// fanout y
assert(arithmetic_specs.MeshY().IsSpecified());
assert(arithmetic_specs.MeshY().Get() % inner.MeshY(inner_start_pv).Get() == 0);
unsigned fanoutY_in = arithmetic_specs.MeshY().Get() / inner.MeshY(inner_start_pv).Get();
for (unsigned pvi = inner_start_pvi; pvi <= inner_end_pvi; pvi++)
inner.FanoutY(problem::Shape::DataSpaceID(pvi)) = fanoutY_in;
}
for (unsigned i = 0; i < specs.NumStorageLevels()-1; i++)
{
BufferLevel::Specs& inner = *specs.GetStorageLevel(i);
BufferLevel::Specs& outer = *specs.GetStorageLevel(i+1);
// FIXME: for partitioned levels, we're only going to look at the
// pvi==0 partition. Our buffer.cpp's ParseSpecs function guarantees
// that all partitions will have identical specs anyway.
// HOWEVER, if we're deriving any specs, we need to set them for all
// pvs for partitioned buffers.
// All of this
// will go away once we properly separate out partitions from
// datatypes.
unsigned inner_start_pvi, inner_end_pvi;
if (inner.sharing_type == BufferLevel::DataSpaceIDSharing::Shared)
{
inner_start_pvi = inner_end_pvi = unsigned(problem::GetShape()->NumDataSpaces);
}
else
{
inner_start_pvi = 0;
inner_end_pvi = unsigned(problem::GetShape()->NumDataSpaces) - 1;
}
auto inner_start_pv = problem::Shape::DataSpaceID(inner_start_pvi);
unsigned outer_start_pvi, outer_end_pvi;
if (outer.sharing_type == BufferLevel::DataSpaceIDSharing::Shared)
{
outer_start_pvi = outer_end_pvi = unsigned(problem::GetShape()->NumDataSpaces);
}
else
{
outer_start_pvi = 0;
outer_end_pvi = unsigned(problem::GetShape()->NumDataSpaces) - 1;
}
auto outer_start_pv = problem::Shape::DataSpaceID(outer_start_pvi);
assert(inner.Instances(inner_start_pv).Get() % outer.Instances(outer_start_pv).Get() == 0);
unsigned fanout = inner.Instances(inner_start_pv).Get() / outer.Instances(outer_start_pv).Get();
if (outer.Fanout(outer_start_pv).IsSpecified())
assert(outer.Fanout(outer_start_pv).Get() == fanout);
else
{
for (unsigned pvi = outer_start_pvi; pvi <= outer_end_pvi; pvi++)
outer.Fanout(problem::Shape::DataSpaceID(pvi)) = fanout;
}
assert(inner.MeshX(inner_start_pv).Get() % outer.MeshX(outer_start_pv).Get() == 0);
unsigned fanoutX = inner.MeshX(inner_start_pv).Get() / outer.MeshX(outer_start_pv).Get();
if (outer.FanoutX(outer_start_pv).IsSpecified())
assert(outer.FanoutX(outer_start_pv).Get() == fanoutX);
else
{
for (unsigned pvi = outer_start_pvi; pvi <= outer_end_pvi; pvi++)
outer.FanoutX(problem::Shape::DataSpaceID(pvi)) = fanoutX;
}
assert(inner.MeshY(inner_start_pv).Get() % outer.MeshY(outer_start_pv).Get() == 0);
unsigned fanoutY = inner.MeshY(inner_start_pv).Get() / outer.MeshY(outer_start_pv).Get();
if (outer.FanoutY(outer_start_pv).IsSpecified())
assert(outer.FanoutY(outer_start_pv).Get() == fanoutY);
else
{
for (unsigned pvi = outer_start_pvi; pvi <= outer_end_pvi; pvi++)
outer.FanoutY(problem::Shape::DataSpaceID(pvi)) = fanoutY;
}
assert(outer.Fanout(outer_start_pv).Get() ==
outer.FanoutX(outer_start_pv).Get() * outer.FanoutY(outer_start_pv).Get());
}
}
//
// Level accessors.
//
// Specs.
unsigned Topology::Specs::NumLevels() const
{
return levels.size();
}
unsigned Topology::Specs::NumStorageLevels() const
{
return storage_map.size();
}
std::shared_ptr<LevelSpecs> Topology::Specs::GetLevel(unsigned level_id) const
{
return levels.at(level_id);
}
std::shared_ptr<BufferLevel::Specs> Topology::Specs::GetStorageLevel(unsigned storage_level_id) const
{
auto level_id = storage_map.at(storage_level_id);
return std::static_pointer_cast<BufferLevel::Specs>(levels.at(level_id));
}
std::shared_ptr<ArithmeticUnits::Specs> Topology::Specs::GetArithmeticLevel() const
{
auto level_id = arithmetic_map;
return std::static_pointer_cast<ArithmeticUnits::Specs>(levels.at(level_id));
}
// Topology class.
unsigned Topology::NumLevels() const
{
assert(is_specced_);
return levels_.size();
}
unsigned Topology::NumStorageLevels() const
{
assert(is_specced_);
return specs_.NumStorageLevels();
}
std::shared_ptr<Level> Topology::GetLevel(unsigned level_id) const
{
return levels_.at(level_id);
}
std::shared_ptr<BufferLevel> Topology::GetStorageLevel(unsigned storage_level_id) const
{
auto level_id = specs_.StorageMap(storage_level_id);
return std::static_pointer_cast<BufferLevel>(levels_.at(level_id));
}
std::shared_ptr<ArithmeticUnits> Topology::GetArithmeticLevel() const
{
auto level_id = specs_.ArithmeticMap();
return std::static_pointer_cast<ArithmeticUnits>(levels_.at(level_id));
}
// PreEvaluationCheck(): allows for a very fast capacity-check
// based on given working-set sizes that can be trivially derived
// by the caller. The more powerful Evaluate() function also
// performs these checks, but computes both tile sizes and access counts
// and requires full tiling data that is generated by a very slow
// Nest::ComputeWorkingSets() algorithm. The PreEvaluationCheck()
// function is an optional call that extensive design-space searches
// can use to fail early.
// FIXME: integrate with Evaluate() and re-factor.
// FIXME: what about instances and fanout checks?
bool Topology::PreEvaluationCheck(const Mapping& mapping, analysis::NestAnalysis* analysis)
{
auto masks = tiling::TransposeMasks(mapping.datatype_bypass_nest);
auto working_set_sizes = analysis->GetWorkingSetSizes_LTW();
bool success = true;
for (unsigned storage_level = 0; storage_level < NumStorageLevels(); storage_level++)
{
success &= GetStorageLevel(storage_level)->PreEvaluationCheck(
working_set_sizes.at(storage_level), masks.at(storage_level));
if (!success)
{
break;
}
}
return success;
}
bool Topology::Evaluate(Mapping& mapping, analysis::NestAnalysis* analysis,
const problem::Workload& workload)
{
assert(is_specced_);
bool success = true;
// Compute working-set tile hierarchy for the nest.
auto ws_tiles = analysis->GetWorkingSets();
// Ugh... FIXME.
auto compute_cycles = analysis->GetBodyInfo().accesses;
// Create a mask indicating which levels support distributed multicast.
tiling::CompoundMaskNest distribution_supported;
for (unsigned pv = 0; pv < unsigned(problem::GetShape()->NumDataSpaces); pv++)
{
distribution_supported[pv].reset();
for (unsigned storage_level = 0; storage_level < NumStorageLevels(); storage_level++)
{
if (GetStorageLevel(storage_level)->DistributedMulticastSupported())
{
distribution_supported[pv].set(storage_level);
}
}
}
// Collapse tiles into a specified number of tiling levels. The solutions are
// received in a set of per-problem::Shape::DataSpaceID arrays.
auto collapsed_tiles = tiling::CollapseTiles(ws_tiles, specs_.NumStorageLevels(),
mapping.datatype_bypass_nest,
distribution_supported);
// Transpose the tiles into level->datatype structure.
auto tiles = tiling::TransposeTiles(collapsed_tiles);
assert(tiles.size() == NumStorageLevels());
// Transpose the datatype bypass nest into level->datatype structure.
auto keep_masks = tiling::TransposeMasks(mapping.datatype_bypass_nest);
assert(keep_masks.size() >= NumStorageLevels());
// Area of all the compute + buffer elements in inner levels
// (needed for wire energy calculation).
// FIXME: Breaks abstraction by making assumptions about arithmetic
// (multiplier) organization and querying multiplier area.
double inner_tile_area = GetArithmeticLevel()->AreaPerInstance();
for (unsigned storage_level_id = 0; storage_level_id < NumStorageLevels(); storage_level_id++)
{
auto storage_level = GetStorageLevel(storage_level_id);
// Evaluate Loop Nest on hardware structures: calculate
// primary statistics.
success &= storage_level->Evaluate(tiles[storage_level_id],
keep_masks[storage_level_id],
inner_tile_area,
compute_cycles);
if (!success)
break;
// The inner tile area is the area of the local sub-level that I will
// send data to. Note that it isn't the area of the entire sub-level
// because I may only have reach into a part of the level, which will
// reduce my wire energy costs. To determine this, we use the fanout
// from this level inwards.
// FIXME: We need a better model.
double cur_level_area = storage_level->AreaPerInstance();
inner_tile_area = cur_level_area + (inner_tile_area * storage_level->MaxFanout());
}
success &= GetArithmeticLevel()->HackEvaluate(analysis, workload);
if (success)
is_evaluated_ = true;
return success;
}
double Topology::Energy() const
{
double energy = 0;
for (auto level : levels_)
{
assert(level->Energy() >= 0);
energy += level->Energy();
}
return energy;
}
double Topology::Area() const
{
double area = 0;
for (auto level : levels_)
{
assert(level->Area() >= 0);
area += level->Area();
}
return area;
}
std::uint64_t Topology::Cycles() const
{
std::uint64_t cycles = 0;
for (auto level : levels_)
{
cycles = std::max(cycles, level->Cycles());
}
return cycles;
}
double Topology::Utilization() const
{
// FIXME.
return (GetArithmeticLevel()->IdealCycles() / Cycles());
}
std::uint64_t Topology::MACCs() const
{
return GetArithmeticLevel()->MACCs();
}
} // namespace model
| [
"aparashar@nvidia.com"
] | aparashar@nvidia.com |
08a0e1f14437e6644c8da5f459700e2670652e3f | 23c524e47a96829d3b8e0aa6792fd40a20f3dd41 | /.history/vector/main_20210422151051.cpp | b62ab0de02146913207b23b304e7f8b861ef03a8 | [] | no_license | nqqw/ft_containers | 4c16d32fb209aea2ce39e7ec25d7f6648aed92e8 | f043cf52059c7accd0cef7bffcaef0f6cb2c126b | refs/heads/master | 2023-06-25T16:08:19.762870 | 2021-07-23T17:28:09 | 2021-07-23T17:28:09 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,704 | cpp | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.cpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: dbliss <dbliss@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/04/22 13:32:30 by dbliss #+# #+# */
/* Updated: 2021/04/22 15:10:51 by dbliss ### ########.fr */
/* */
/* ************************************************************************** */
#include "Vector.hpp"
#include "Iterator.hpp"
#include <iostream>
#include <unistd.h>
#include <vector>
#define red "\x1b[31m"
#define green "\x1b[32m"
#define yellow "\x1b[33m"
#define blue "\x1b[34m"
#define cend "\x1b[0m"
void print_int_array(ft::vector<int> &vec)
{
ft::vector<int>::iterator it = vec.begin();
ft::vector<int>::iterator ite = vec.end();
while (it != ite)
{
std::cout << *it << " ";
it++;
}
std::cout << std::endl;
std::cout << std::endl;
}
void constructor_test()
{
std::cout << blue << "***************[ Default constructor test ]***************" << cend << std::endl;
std::cout << green << "Testing empty vector int: " << cend << std::endl;
ft::vector<int> vec;
std::cout << "Vector size is: " << vec.size() << std::endl << std::endl;
std::cout << blue << "***************[ Fill constructor test ]***************" << cend << std::endl;
std::cout << green << "Testing vector<int> vec1(10, 42): " << cend << std::endl;
ft::vector<int> vec1(10, 42);
print_int_array(vec1);
std::cout << std::endl;
std::cout << blue << "***************[ Range constructor test ]***************" << cend << std::endl;
ft::vector<int> vec2;
for (int i = 0; i < 10; ++i)
{
vec2.push_back(i);
}
ft::vector<int>::iterator it = vec2.begin();
ft::vector<int> vec3(it, it + 2);
print_int_array(vec3);
std::cout << std::endl;
std::cout << blue << "***************[ Copy constructor test ]***************" << cend << std::endl;
std::cout << green << "Making copy vector<int> vec4(vec1): " << cend << std::endl;
ft::vector<int> vec4 = vec1;
ft::vector<int>::iterator its = vec4.begin();
ft::vector<int>::iterator ites = vec4.end();
while (its != ites)
{
std::cout << *its << " ";
its++;
}
std::cout << std::endl;
}
int main()
{
constructor_test();
return 0;
} | [
"dbliss@at-q1.msk.21-school.ru"
] | dbliss@at-q1.msk.21-school.ru |
bd4f7b0ea8996745c57b0c4258c678796ff18db3 | 2abb5b2237e5b879e2fcf414e0400c70099291de | /UnitTesting/TestObjectiveFunctional/Polynomial.cpp | 065001cd08c88b3991a7892b3c4ddfded0b042fc | [] | no_license | dimitarpg13/FloodV3 | 860e6e3fc726def8851408aea573ebe531d406d1 | d816a635161656b65b0edc9675336f10fadc8f27 | refs/heads/master | 2021-01-11T04:19:49.944314 | 2017-04-03T18:06:31 | 2017-04-03T18:06:31 | 71,177,040 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 3,841 | cpp | /****************************************************************************************************************/
/* */
/* Flood: An Open Source Neural Networks C++ Library */
/* www.cimne.com/flood */
/* */
/* P O L Y N O M I A L C L A S S */
/* */
/* Roberto Lopez */
/* International Center for Numerical Methods in Engineering (CIMNE) */
/* Technical University of Catalonia (UPC) */
/* Barcelona, Spain */
/* E-mail: rlopez@cimne.upc.edu */
/* */
/****************************************************************************************************************/
// Flood includes
#include "Polynomial.h"
// System includes
#include <string>
#include <sstream>
#include <iostream>
#include <fstream>
#include <cmath>
using namespace Flood;
// GENERAL CONSTRUCTOR
Polynomial::Polynomial(MultilayerPerceptron* new_multilayer_perceptron_pointer)
: ObjectiveFunctional(new_multilayer_perceptron_pointer)
{
}
// DEFAULT CONSTRUCTOR
Polynomial::Polynomial(void) : ObjectiveFunctional()
{
}
// DESTRUCTOR
Polynomial::~Polynomial(void)
{
}
// METHODS
// Vector<double> get_coefficients(void) method
Vector<double> Polynomial::get_coefficients(void)
{
return(coefficients);
}
// void set_coefficients(Vector<double>) method
void Polynomial::set_coefficients(Vector<double> new_coefficients)
{
coefficients = new_coefficients;
}
double Polynomial::calculate_output(double input)
{
int size = coefficients.get_size();
double output = 0.0;
for(int i = 0; i < size; i++)
{
output += coefficients[i]*pow(input,i);
}
return(output);
}
// double calculate_objective(void) method
double Polynomial::calculate_objective(void)
{
calculate_evaluation_count++;
double input = multilayer_perceptron_pointer->get_independent_parameter(0);
double objective = calculate_output(input);
return(objective);
}
// Flood: An Open Source Neural Networks C++ Library.
// Copyright (C) 2005-2010 Roberto Lopez
//
// This library is free software; you can redistribute it and/or
// modify it under the s of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
| [
"dimitar_pg13@hotmail.com"
] | dimitar_pg13@hotmail.com |
3df3f1918717fd7af5da48b261d7b681aedd8736 | f77d2d84af7b1d555a96f5ab9f42f1b7c7abd60c | /src/skiplist/QuadList_insert.h | 0cbf2120f587db69e4cd530791d256826f5692a0 | [] | no_license | pangpang20/data-structure | d8e43a2cf167c88a64d9128b165ed438f194d3e5 | 53a2f76919eda2add01f6e60bc40c4c13365d481 | refs/heads/main | 2023-05-01T01:43:06.359569 | 2021-05-26T07:14:23 | 2021-05-26T07:14:23 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 705 | h | /******************************************************************************************
* Data Structures in C++
* ISBN: 7-302-33064-6 & 7-302-33065-3 & 7-302-29652-2 & 7-302-26883-3
* Junhui DENG, deng@tsinghua.edu.cn
* Computer Science & Technology, Tsinghua University
* Copyright (c) 2003-2020. All rights reserved.
******************************************************************************************/
#pragma once
template <typename T> QListNodePosi<T> //将e作为p的后继、b的上邻插入Quadlist
Quadlist<T>::insertAfterAbove ( T const& e, QListNodePosi<T> p, QListNodePosi<T> b )
{ _size++; return p->insertAsSuccAbove ( e, b ); } //返回新节点位置(below = NULL) | [
"melodyhaya@gmail.com"
] | melodyhaya@gmail.com |
d5b1766119e03b8569ec462c3b61f599324d120f | f69a16affcc4a132fbd97cf68dbad9a57bded7c7 | /src/fltest/flowtest.cc | ee2608af245ab1fbb7e1dae2228a36c361f82787 | [] | no_license | christianparpart/flow | aa89208a61ca2a21c0efe498bacad74ac9b52f10 | 4c2ced8f05068293277b3da7c50fc9eda9a904d3 | refs/heads/master | 2020-03-17T15:39:13.509770 | 2018-07-23T12:20:10 | 2018-07-23T12:20:10 | 133,718,646 | 4 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 7,966 | cc | // This file is part of the "x0" project, http://github.com/christianparpart/x0>
// (c) 2009-2018 Christian Parpart <christian@parpart.family>
//
// Licensed under the MIT License (the "License"); you may not use this
// file except in compliance with the License. You may obtain a copy of
// the License at: http://opensource.org/licenses/MIT
#include "flowtest.h"
#include <flow/SourceLocation.h>
/*
TestProgram ::= FlowProgram [Initializer Message*]
FlowProgram ::= <flow program code until Initializer>
Initializer ::= '#' '----' LF
Message ::= '#' [Location] DiagnosticsType ':' MessageText LF
DiagnosticsType ::= 'TokenError' | 'SyntaxError' | 'TypeError' | 'Warning' | 'LinkError'
Location ::= '[' FilePos ['..' FilePos] ']'
FilePos ::= Line ':' Column
Column ::= NUMBER
Line ::= NUMBER
MessageText ::= TEXT (LF INDENT TEXT)*
NUMBER ::= ('0'..'9')+
TEXT ::= <until LF>
LF ::= '\n' | '\r\n'
INDENT ::= (' ' | '\t')+
*/
namespace flowtest {
// ----------------------------------------------------------------------------
// lexic
Lexer::Lexer()
: Lexer("", "") {
}
Lexer::Lexer(std::string filename, std::string contents)
: filename_{std::move(filename)},
source_{std::move(contents)},
startOffset_{0},
currentToken_{Token::Eof},
currentPos_{},
numberValue_{0},
stringValue_{} {
size_t i = source_.find("\n# ----\n");
if (i != std::string::npos) {
nextChar(i + 8);
startOffset_ = i + 1;
currentToken_ = Token::InitializerMark;
} else {
startOffset_ = source_.size();
currentToken_ = Token::Eof;
}
}
int Lexer::nextChar(off_t i) {
while (i > 0 && !eof_()) {
currentPos_.advance(currentChar());
i--;
}
return currentChar();
}
bool Lexer::peekSequenceMatch(const std::string& sequence) const {
if (currentOffset() + sequence.size() > source_.size())
return false;
for (size_t i = 0; i < sequence.size(); ++i)
if (source_[currentOffset() + i] != sequence[i])
return false;
return true;
}
Token Lexer::nextToken() {
skipSpace();
switch (currentChar()) {
case -1:
return currentToken_ = Token::Eof;
case '#':
// if (peekSequenceMatch("# ----\n")) {
// nextChar(7);
// return currentToken_ = Token::InitializerMark;
// }
nextChar();
return currentToken_ = Token::Begin;
case '.':
if (peekChar() == '.') {
nextChar(2);
return currentToken_ = Token::DotDot;
}
break;
case ':':
nextChar();
return currentToken_ = Token::Colon;
case '[':
nextChar();
return currentToken_ = Token::BrOpen;
case ']':
nextChar();
return currentToken_ = Token::BrClose;
case '\n':
nextChar();
return currentToken_ = Token::LF;
default:
if (currentToken_ == Token::Colon) {
return currentToken_ = parseMessageText();
}
if (std::isdigit(currentChar())) {
return currentToken_ = parseNumber();
}
if (std::isalpha(currentChar())) {
return currentToken_ = parseIdent();
}
}
throw LexerError{fmt::format("Unexpected character {} ({:x}) during tokenization.",
currentChar() ? (char) currentChar() : '?', currentChar())};
}
Token Lexer::parseIdent() {
stringValue_.clear();
while (std::isalpha(currentChar())) {
stringValue_ += static_cast<char>(currentChar());
nextChar();
}
if (stringValue_ == "TokenError")
return Token::TokenError;
if (stringValue_ == "SyntaxError")
return Token::SyntaxError;
if (stringValue_ == "TypeError")
return Token::TypeError;
if (stringValue_ == "Warning")
return Token::Warning;
if (stringValue_ == "LinkError")
return Token::LinkError;
throw LexerError{fmt::format("Unexpected identifier '{}' during tokenization.",
stringValue_)};
}
Token Lexer::parseMessageText() {
stringValue_.clear();
while (!eof_() && currentChar() != '\n') {
stringValue_ += static_cast<char>(currentChar());
nextChar();
}
return Token::MessageText;
}
Token Lexer::parseNumber() {
numberValue_ = 0;
while (std::isdigit(currentChar())) {
numberValue_ *= 10;
numberValue_ += currentChar() - '0';
nextChar();
}
return Token::Number;
}
void Lexer::skipSpace() {
for (;;) {
switch (currentChar()) {
case ' ':
case '\t':
nextChar();
break;
default:
return;
}
}
}
bool Lexer::consumeIf(Token t) {
if (currentToken() != t)
return false;
nextToken();
return true;
}
void Lexer::consume(Token t) {
if (currentToken() != t)
throw LexerError{fmt::format("Unexpected token {}. Expected {} instead.", currentToken(), t)};
nextToken();
}
int Lexer::consumeNumber() {
unsigned result = numberValue_;
consume(Token::Number);
return result;
}
std::string Lexer::consumeText(Token t) {
std::string result = stringValue();
consume(t);
return result;
}
std::string join(const std::initializer_list<Token>& tokens) {
std::string s;
for (Token t: tokens) {
if (!s.empty())
s += ", ";
s += fmt::format("{}", t);
}
return s;
}
void Lexer::consumeOneOf(std::initializer_list<Token>&& tokens) {
if (std::find(tokens.begin(), tokens.end(), currentToken()) == tokens.end())
throw LexerError{fmt::format("Unexpected token {}. Expected on of {} instead.",
currentToken(), join(tokens))};
nextToken();
}
// ----------------------------------------------------------------------------
// parser
Parser::Parser(std::string filename, std::string source)
: lexer_{std::move(filename), std::move(source)} {
}
std::error_code Parser::parse(flow::diagnostics::Report* report) {
lexer_.consume(Token::InitializerMark);
while (!lexer_.eof())
report->push_back(parseMessage());
return std::error_code{};
}
Message Parser::parseMessage() {
// Message ::= '#' [Location] DiagnosticsType ':' MessageText (LF | EOF)
lexer_.consume(Token::Begin);
SourceLocation location = tryParseLocation();
DiagnosticsType type = parseDiagnosticsType();
lexer_.consume(Token::Colon);
std::string text = lexer_.consumeText(Token::MessageText);
lexer_.consumeOneOf({Token::LF, Token::Eof});
return Message{type, location, text};
}
DiagnosticsType Parser::parseDiagnosticsType() {
// DiagnosticsType ::= 'TokenError' | 'SyntaxError' | 'TypeError' | 'Warning' | 'LinkError'
switch (lexer_.currentToken()) {
case Token::TokenError:
lexer_.nextToken();
return DiagnosticsType::TokenError;
case Token::SyntaxError:
lexer_.nextToken();
return DiagnosticsType::SyntaxError;
case Token::TypeError:
lexer_.nextToken();
return DiagnosticsType::TypeError;
case Token::Warning:
lexer_.nextToken();
return DiagnosticsType::Warning;
case Token::LinkError:
lexer_.nextToken();
return DiagnosticsType::LinkError;
default:
throw SyntaxError{"Unexpected token. Expected DiagnosticsType instead."};
}
}
SourceLocation Parser::tryParseLocation() { // TODO
// Location ::= '[' FilePos ['..' FilePos] ']'
if (!lexer_.consumeIf(Token::BrOpen))
return SourceLocation{};
FilePos begin = parseFilePos();
if (lexer_.consumeIf(Token::DotDot)) {
FilePos end = parseFilePos();
return SourceLocation{"", begin, end};
} else {
return SourceLocation{"", begin, FilePos{}};
}
}
FilePos Parser::parseFilePos() {
// FilePos ::= Line [':' Column]
// Column ::= NUMBER
// Line ::= NUMBER
unsigned line = lexer_.consumeNumber();
if (lexer_.consumeIf(Token::Colon)) {
unsigned column = lexer_.consumeNumber();
return FilePos{line, column};
} else {
return FilePos{line, 0};
}
}
} // namespace flowtest
| [
"christian@parpart.family"
] | christian@parpart.family |
a332d03c9b0f0b1a02eeb4debbbd5cd40901737e | 138fbf302f4c4797c9bc992fa7aae1db0a2dc597 | /lib/libcds/tests/test-hdr/ordered_list/hdr_michael_hrc.cpp | 305fcf15ac42a90441597c268ac5548641f5ec1b | [
"BSD-2-Clause"
] | permissive | dimak08/seminar_in_algorithms | 19cb7bed711963000cebb30f8b459df801df5be5 | 681e105dbdefa781eb0618192886b7b5004c7a6c | refs/heads/master | 2021-01-18T05:48:57.474752 | 2015-09-23T16:10:39 | 2015-09-23T16:10:39 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,064 | cpp | //$$CDS-header$$
#include "ordered_list/hdr_michael.h"
#include <cds/container/michael_list_hrc.h>
namespace ordlist {
namespace {
struct HRC_cmp_traits: public cc::michael_list::type_traits
{
typedef MichaelListTestHeader::cmp<MichaelListTestHeader::item> compare ;
};
}
void MichaelListTestHeader::HRC_cmp()
{
// traits-based version
typedef cc::MichaelList< cds::gc::HRC, item, HRC_cmp_traits > list ;
test< list >() ;
// option-based version
typedef cc::MichaelList< cds::gc::HRC, item,
cc::michael_list::make_traits<
cc::opt::compare< cmp<item> >
>::type
> opt_list ;
test< opt_list >() ;
}
namespace {
struct HRC_less_traits: public cc::michael_list::type_traits
{
typedef MichaelListTestHeader::lt<MichaelListTestHeader::item> less ;
};
}
void MichaelListTestHeader::HRC_less()
{
// traits-based version
typedef cc::MichaelList< cds::gc::HRC, item, HRC_less_traits > list ;
test< list >() ;
// option-based version
typedef cc::MichaelList< cds::gc::HRC, item,
cc::michael_list::make_traits<
cc::opt::less< lt<item> >
>::type
> opt_list ;
test< opt_list >() ;
}
namespace {
struct HRC_cmpmix_traits: public cc::michael_list::type_traits
{
typedef MichaelListTestHeader::cmp<MichaelListTestHeader::item> compare ;
typedef MichaelListTestHeader::lt<MichaelListTestHeader::item> less ;
};
}
void MichaelListTestHeader::HRC_cmpmix()
{
// traits-based version
typedef cc::MichaelList< cds::gc::HRC, item, HRC_cmpmix_traits> list ;
test< list >() ;
// option-based version
typedef cc::MichaelList< cds::gc::HRC, item,
cc::michael_list::make_traits<
cc::opt::compare< cmp<item> >
,cc::opt::less< lt<item> >
>::type
> opt_list ;
test< opt_list >() ;
}
namespace {
struct HRC_ic_traits: public cc::michael_list::type_traits
{
typedef MichaelListTestHeader::lt<MichaelListTestHeader::item> less ;
typedef cds::atomicity::item_counter item_counter ;
};
}
void MichaelListTestHeader::HRC_ic()
{
// traits-based version
typedef cc::MichaelList< cds::gc::HRC, item, HRC_ic_traits > list ;
test< list >() ;
// option-based version
typedef cc::MichaelList< cds::gc::HRC, item,
cc::michael_list::make_traits<
cc::opt::less< lt<item> >
,cc::opt::item_counter< cds::atomicity::item_counter >
>::type
> opt_list ;
test< opt_list >() ;
}
} // namespace ordlist
| [
"jakob.gruber@gmail.com"
] | jakob.gruber@gmail.com |
f6fb5dbedc7b93d079de6a87afea57f993facb6e | 7d7df8fd1529137060c9b420ade369dd816b9cee | /src/convert_old_robot_log.cpp | d8798b57174470a242c37ac00e8bf32a61a4ab4d | [
"BSD-3-Clause"
] | permissive | open-dynamic-robot-initiative/robot_interfaces | 28eb944e3e45da2c46899041d74b50bec53f9d9f | 9d771e712f5b5841e52d94ab82bc5db9645b5dc9 | refs/heads/master | 2022-11-30T02:17:57.244189 | 2022-11-28T08:12:05 | 2022-11-28T08:12:05 | 203,580,199 | 21 | 5 | BSD-3-Clause | 2023-09-14T09:23:46 | 2019-08-21T12:32:44 | C++ | UTF-8 | C++ | false | false | 3,175 | cpp | /**
* @file
* @brief Convert old TriFinger robot logs from before the fix in
* Status::error_message.
*
* In the past Status::error_message was a variable-sized std::string. Since
* this is incompatible with the fixed-size requirement for shared memory time
* series, it was changed to a fixed-size char-array in commit 4ca02a17.
* Unfortunately, this makes old logfiles incompatible with the RobotLogReader
* using the fixed type.
*
* This file provides a utility to load log files of the old format and convert
* them to the new format, so that they can be processed with the latest version
* of the code.
*
* @copyright Copyright (c) 2021, Max Planck Gesellschaft.
* @license BSD 3-clause
*/
#include <filesystem>
#include <iostream>
#include <string>
#include <vector>
#include <cereal/types/string.hpp>
#include <robot_interfaces/finger_types.hpp>
#include <robot_interfaces/status.hpp>
using namespace robot_interfaces;
//! Old version of the Status message (taken from commit 4ca02a17^, stripped
//! down to the relevant parts).
struct OldStatus
{
uint32_t action_repetitions = 0;
Status::ErrorStatus error_status = Status::ErrorStatus::NO_ERROR;
std::string error_message;
template <class Archive>
void serialize(Archive& archive)
{
archive(action_repetitions, error_status, error_message);
}
};
typedef RobotBinaryLogReader<TriFingerTypes::Action,
TriFingerTypes::Observation,
OldStatus>
OldLogReader;
int main(int argc, char* argv[])
{
if (argc != 3)
{
std::cerr << "Error: Invalid number of arguments." << std::endl;
std::cerr << "Usage: " << argv[0] << " <old_logfile> <new_logfile>"
<< std::endl;
return 1;
}
std::string old_logfile(argv[1]);
std::string new_logfile(argv[2]);
if (!std::filesystem::is_regular_file(old_logfile))
{
std::cout << "Error: Input " << old_logfile << " is not a regular file."
<< std::endl;
return 2;
}
if (std::filesystem::exists(new_logfile))
{
std::cout << "Error: Output destination " << new_logfile
<< " already exists." << std::endl;
return 3;
}
OldLogReader old_log(old_logfile);
TriFingerTypes::BinaryLogReader new_log;
// copy data
for (OldLogReader::LogEntry old_entry : old_log.data)
{
TriFingerTypes::BinaryLogReader::LogEntry new_entry;
// copy all fields that are unchanged
new_entry.timeindex = old_entry.timeindex;
new_entry.timestamp = old_entry.timestamp;
new_entry.observation = old_entry.observation;
new_entry.desired_action = old_entry.desired_action;
new_entry.applied_action = old_entry.applied_action;
// copy status
new_entry.status.action_repetitions =
old_entry.status.action_repetitions;
new_entry.status.set_error(old_entry.status.error_status,
old_entry.status.error_message);
new_log.data.push_back(new_entry);
}
new_log.write_file(new_logfile);
}
| [
"felix.widmaier@tuebingen.mpg.de"
] | felix.widmaier@tuebingen.mpg.de |
e7b0d22a9815722fe204f70da807642807fc9221 | e5b136d24afe47484371ca8087c43f024aa6fdb3 | /src/connectivity/bluetooth/core/bt-host/l2cap/bredr_dynamic_channel.h | 3bcb8307d3fc6116d11622705c0ecbac50fbbdd2 | [
"BSD-3-Clause"
] | permissive | deveshd020/fuchsia | 92d5ded7c84a7f9eae092d4c35ef923cd7852bd4 | 810c7b868d2e7b580f5ccbe1cb26e45746ae3ac5 | refs/heads/master | 2021-01-03T09:43:21.757097 | 2020-02-06T01:06:22 | 2020-02-06T01:06:22 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 13,608 | h | // Copyright 2018 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef SRC_CONNECTIVITY_BLUETOOTH_CORE_BT_HOST_L2CAP_BREDR_DYNAMIC_CHANNEL_H_
#define SRC_CONNECTIVITY_BLUETOOTH_CORE_BT_HOST_L2CAP_BREDR_DYNAMIC_CHANNEL_H_
#include <lib/fit/function.h>
#include <unordered_map>
#include "src/connectivity/bluetooth/core/bt-host/l2cap/bredr_command_handler.h"
#include "src/connectivity/bluetooth/core/bt-host/l2cap/dynamic_channel_registry.h"
#include "src/connectivity/bluetooth/core/bt-host/l2cap/l2cap.h"
#include "src/connectivity/bluetooth/core/bt-host/l2cap/signaling_channel.h"
#include "src/connectivity/bluetooth/core/bt-host/l2cap/types.h"
namespace bt {
namespace l2cap {
namespace internal {
// Implements factories for BR/EDR dynamic channels and dispatches incoming
// signaling channel requests to the corresponding channels by local ID.
//
// Must be run only on the L2CAP thread.
class BrEdrDynamicChannelRegistry final : public DynamicChannelRegistry {
public:
BrEdrDynamicChannelRegistry(SignalingChannelInterface* sig, DynamicChannelCallback close_cb,
ServiceRequestCallback service_request_cb);
~BrEdrDynamicChannelRegistry() override = default;
std::optional<ExtendedFeatures> extended_features() { return extended_features_; };
private:
// DynamicChannelRegistry override
DynamicChannelPtr MakeOutbound(PSM psm, ChannelId local_cid, ChannelParameters params) override;
DynamicChannelPtr MakeInbound(PSM psm, ChannelId local_cid, ChannelId remote_cid,
ChannelParameters params) override;
// Signaling channel request handlers
void OnRxConnReq(PSM psm, ChannelId remote_cid,
BrEdrCommandHandler::ConnectionResponder* responder);
void OnRxConfigReq(ChannelId local_cid, uint16_t flags, ChannelConfiguration config,
BrEdrCommandHandler::ConfigurationResponder* responder);
void OnRxDisconReq(ChannelId local_cid, ChannelId remote_cid,
BrEdrCommandHandler::DisconnectionResponder* responder);
void OnRxInfoReq(InformationType type, BrEdrCommandHandler::InformationResponder* responder);
// Signaling channel response handlers
void OnRxExtendedFeaturesInfoRsp(const BrEdrCommandHandler::InformationResponse& rsp);
// Send extended features information request.
// TODO(929): Send fixed channels information request.
void SendInformationRequests();
// If an extended features information response has been received, returns the value of the ERTM
// bit in the peer's feature mask.
std::optional<bool> PeerSupportsERTM() const;
using State = uint8_t;
enum StateBit : State {
// Extended Features Information Request (transmitted from local to remote)
kExtendedFeaturesSent = (1 << 0),
// Extended Features Information Response (transmitted from remote to local)
kExtendedFeaturesReceived = (1 << 1),
};
// Bit field assembled using the bit masks above.
State state_;
SignalingChannelInterface* const sig_;
std::optional<ExtendedFeatures> extended_features_;
};
class BrEdrDynamicChannel;
using BrEdrDynamicChannelPtr = std::unique_ptr<BrEdrDynamicChannel>;
// Creates, configures, and tears down dynamic channels using the BR/EDR
// signaling channel. The lifetime of this object matches that of the channel
// itself: created in order to start an outbound channel or in response to an
// inbound channel request, then destroyed immediately after the channel is
// closed. This is intended to be created and owned by
// BrEdrDynamicChannelRegistry.
//
// This implements the state machine described by v5.0 Vol 3 Part A Sec 6. The
// state of OPEN ("user data transfer state") matches the implementation of the
// |DynamicChannel::IsOpen()|.
//
// Channel Configuration design:
// Implementation-defined behavior:
// * Inbound and outbound configuration requests/responses are exchanged simultaneously
// * If the desired channel mode is ERTM, the configuration request is not sent until the extended
// features mask is received from the peer.
// * If the peer doesn't support ERTM, the local device will negotiate Basic Mode instead of ERTM
// * after both configuration requests have been accepted, if they are inconsistent, the channel
// is disconnected (this can happen if the peer doesn't follow the spec)
// Configuration Request Handling:
// * when the peer requests an MTU below the minumum, send an Unacceptable Parameters response
// suggesting the minimum MTU.
// * allow peer to send a maximum of 2 configuration requests with undesired channel modes
// before disconnecting
// * reject all channel modes other than Basic Mode and ERTM
// Negative Configuration Response Handling:
// A maximum of 2 negotiation attempts will be made before disconnecting, according to the
// following rules:
// * if the response does not contain the Retransmission & Flow Control option, disconnect
// * when the response specifies a different channel mode than the peer sent in a configuration
// request, disconnect
// * when the response rejected Basic Mode, disconnect
// * otherwise, send a second configuration request with Basic Mode
//
// Must be run only on the L2CAP thread.
class BrEdrDynamicChannel final : public DynamicChannel {
public:
using ResponseHandlerAction = SignalingChannel::ResponseHandlerAction;
static BrEdrDynamicChannelPtr MakeOutbound(DynamicChannelRegistry* registry,
SignalingChannelInterface* signaling_channel, PSM psm,
ChannelId local_cid, ChannelParameters params,
std::optional<bool> peer_supports_ertm);
static BrEdrDynamicChannelPtr MakeInbound(DynamicChannelRegistry* registry,
SignalingChannelInterface* signaling_channel, PSM psm,
ChannelId local_cid, ChannelId remote_cid,
ChannelParameters params,
std::optional<bool> peer_supports_ertm);
// DynamicChannel overrides
~BrEdrDynamicChannel() override = default;
void Open(fit::closure open_cb) override;
// Mark this channel as closed and disconnected. Send a Disconnection Request
// to the peer if possible (peer had sent an ID for its endpoint). |done_cb|
// will be called when Disconnection Response is received or if channel is
// already not connected.
void Disconnect(DisconnectDoneCallback done_cb) override;
bool IsConnected() const override;
bool IsOpen() const override;
// Must not be called until channel is open.
ChannelInfo info() const override;
// Inbound request handlers. Request must have a destination channel ID that
// matches this instance's |local_cid|.
void OnRxConfigReq(uint16_t flags, ChannelConfiguration config,
BrEdrCommandHandler::ConfigurationResponder* responder);
void OnRxDisconReq(BrEdrCommandHandler::DisconnectionResponder* responder);
// Called when the peer indicates whether it supports Enhanced Retransmission Mode.
// Kicks off the configuration process if the preferred channel mode is ERTM.
void SetEnhancedRetransmissionSupport(bool supported);
// Reply with affirmative connection response and begin configuration.
void CompleteInboundConnection(BrEdrCommandHandler::ConnectionResponder* responder);
// Contains options configured by remote configuration requests (Core Spec v5.1, Vol 3, Part A,
// Sections 5 and 7.1.1).
const ChannelConfiguration& remote_config() const { return remote_config_; }
// Contains options configured by local configuration requests (Core Spec v5.1, Vol 3, Part A,
// Sections 5 and 7.1.2).
const ChannelConfiguration& local_config() const { return local_config_; }
private:
// The channel configuration state is described in v5.0 Vol 3 Part A Sec 6 (in
// particular in Fig. 6.2) as having numerous substates in order to capture
// the different orders in which configuration packets may be transmitted. It
// is implemented here as a bitfield where bits are set as each packet is
// transmitted.
//
// The initial state for a channel prior to any signaling packets transmitted
// is 0.
using State = uint8_t;
enum StateBit : State {
// Connection Req (transmitted in either direction)
kConnRequested = (1 << 0),
// Connection Rsp (transmitted in opposite direction of Connection Req)
kConnResponded = (1 << 1),
// Configuration Req (transmitted from local to remote)
kLocalConfigSent = (1 << 2),
// Configuration Rsp (successful; transmitted from remote to local)
kLocalConfigAccepted = (1 << 3),
// Configuration Req (transmitted from remote to local)
kRemoteConfigReceived = (1 << 4),
// Configuration Rsp (successful; transmitted from local to remote)
kRemoteConfigAccepted = (1 << 5),
// Disconnection Req (transmitted in either direction)
kDisconnected = (1 << 6),
};
// TODO(NET-1319): Add Extended Flow Specification steps (exchange &
// controller configuration)
BrEdrDynamicChannel(DynamicChannelRegistry* registry,
SignalingChannelInterface* signaling_channel, PSM psm, ChannelId local_cid,
ChannelId remote_cid, ChannelParameters params,
std::optional<bool> peer_supports_ertm);
// Deliver the result of channel connection and configuration to the |Open|
// originator. Can be called multiple times but only the first invocation
// passes the result.
void PassOpenResult();
// Error during channel connection or configuration (before it is open).
// Deliver the error open result to the |Open| originator. Disconnect the
// remote endpoint of the channel if possible. If the channel is already open,
// use |Disconnect| instead.
void PassOpenError();
// The local configuration channel mode may need to be changed from ERTM to Basic Mode if the peer
// does not support ERTM. This channel must not be waiting for extended features when this method
// is called. No-op if extended features have not been received yet (e.g. when a basic mode
// channel configuration flow is initiated before extended features have been received).
void UpdateLocalConfigForErtm();
// Returns true if the preferred channel parameters require waiting for an extended features
// information response and the response has not yet been received. Must be false before sending
// local config.
bool IsWaitingForPeerErtmSupport();
// Begin the local channel Configuration Request flow if it has not yet
// happened. The channel must not be waiting for the extended features info response.
void TrySendLocalConfig();
// Send local configuration request.
void SendLocalConfig();
// Returns true if both the remote and local configs have been accepted.
bool BothConfigsAccepted() const;
// Returns true if negotiated channel modes are consistent. Must not be called until after both
// configs have been accepted (|BothConfigsAccepted()| is true).
[[nodiscard]] bool AcceptedChannelModesAreConsistent() const;
// Checks options in a configuration request for unacceptable MTU and Retransmission and Flow
// Control options. Returns a configuration object where for each unacceptable option, there
// is a corresponding option with a value that would have been accepted if sent in the
// original request.
[[nodiscard]] ChannelConfiguration CheckForUnacceptableConfigReqOptions(
const ChannelConfiguration& config);
// Try to recover from a configuration response with the "Unacceptable Parameters" result.
// Returns true if the negative reponse could be recovered from, and false otherwise (in which
// case an error should be reported).
[[nodiscard]] bool TryRecoverFromUnacceptableParametersConfigRsp(
const ChannelConfiguration& config);
// Response handlers for outbound requests
ResponseHandlerAction OnRxConnRsp(const BrEdrCommandHandler::ConnectionResponse& rsp);
ResponseHandlerAction OnRxConfigRsp(const BrEdrCommandHandler::ConfigurationResponse& rsp);
SignalingChannelInterface* const signaling_channel_;
// Bit field assembled using the bit masks above. When zero, it represents a
// closed (i.e. not yet open) channel.
State state_;
// This shall be reset to nullptr after invocation to enforce its single-use
// semantics. See |DynamicChannel::Open| for details.
fit::closure open_result_cb_;
// Support for ERTM is indicated in the peer's extended features mask, received in the extended
// features information response. Since the response may not yet have been received when this
// channel is created, this value may be assigned in either the constructor or in the
// |SetEnhancedRetransmissionSupport| callback.
std::optional<bool> peer_supports_ertm_;
// Contains options configured by remote configuration requests (Core Spec v5.1, Vol 3, Part A,
// Sections 5 and 7.1.1).
ChannelConfiguration remote_config_;
// Contains options configured by local configuration requests (Core Spec v5.1, Vol 3, Part A,
// Sections 5 and 7.1.2).
ChannelConfiguration local_config_;
fxl::WeakPtrFactory<BrEdrDynamicChannel> weak_ptr_factory_;
};
} // namespace internal
} // namespace l2cap
} // namespace bt
#endif // SRC_CONNECTIVITY_BLUETOOTH_CORE_BT_HOST_L2CAP_BREDR_DYNAMIC_CHANNEL_H_
| [
"commit-bot@chromium.org"
] | commit-bot@chromium.org |
af9b0cee36f8770a1dd9952e833f4e4cfacf068d | 9953aaeed410e1fd26f738466e585bcfa187c527 | /IDE/ScriptIDE/ScriptIDE.h | 6e003699d4838775a19f04465be5945804531bf5 | [] | no_license | zhaoliangcn/LScript | 5ab470aa1f2b674a067802c4fd306c79a7ac9e8c | 97205f823cc3aaaf56308a74fa1b3f28d302b89b | refs/heads/master | 2022-09-23T06:34:40.999691 | 2022-07-26T08:10:39 | 2022-07-26T08:10:39 | 33,216,059 | 6 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 1,182 | h | // 这段 MFC 示例源代码演示如何使用 MFC Microsoft Office Fluent 用户界面
// (“Fluent UI”)。该示例仅供参考,
// 用以补充《Microsoft 基础类参考》和
// MFC C++ 库软件随附的相关电子文档。
// 复制、使用或分发 Fluent UI 的许可条款是单独提供的。
// 若要了解有关 Fluent UI 许可计划的详细信息,请访问
// https://go.microsoft.com/fwlink/?LinkId=238214.
//
// 版权所有(C) Microsoft Corporation
// 保留所有权利。
// ScriptIDE.h: ScriptIDE 应用程序的主头文件
//
#pragma once
#ifndef __AFXWIN_H__
#error "在包含此文件之前包含“stdafx.h”以生成 PCH 文件"
#endif
#include "resource.h" // 主符号
// CScriptIDEApp:
// 有关此类的实现,请参阅 ScriptIDE.cpp
//
class CScriptIDEApp : public CWinAppEx
{
public:
CScriptIDEApp();
// 重写
public:
virtual BOOL InitInstance();
virtual int ExitInstance();
// 实现
UINT m_nAppLook;
BOOL m_bHiColorIcons;
virtual void PreLoadState();
virtual void LoadCustomState();
virtual void SaveCustomState();
afx_msg void OnAppAbout();
DECLARE_MESSAGE_MAP()
};
extern CScriptIDEApp theApp;
| [
"zhaoliangcn@126.com"
] | zhaoliangcn@126.com |
d3766278190274d941bfb90359d035b9be23aa73 | aebb18d99659c990c35683fc5c6050a4fac6109e | /InputLayer.h | 8f8c370054d6779a3fee5f1b3f1e7b93b136a8c9 | [] | no_license | belisariops/ConvolutionalNetwork | 4899b3d5808b464a4a10c2e5d348ea95aa5926a8 | 4794bf828b7bea084c5698b3656e825e6d7ceb4b | refs/heads/master | 2021-07-09T15:26:22.058815 | 2017-10-09T19:19:21 | 2017-10-09T19:19:21 | 104,827,645 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 313 | h | //
// Created by belisariops on 9/25/17.
//
#ifndef CONVOLUTIONALNETWORK_INPUTLAYER_H
#define CONVOLUTIONALNETWORK_INPUTLAYER_H
#include "NeuralLayer.h"
#include "Filter.h"
class InputLayer {
public:
InputLayer(int width,int height, int channels);
private:
};
#endif //CONVOLUTIONALNETWORK_INPUTLAYER_H
| [
"belisariops@gmail.com"
] | belisariops@gmail.com |
76571858f06d83c35ef775982350e2b2650fc6fa | 7d84cd94d836f8f37e850023f0721e81f585208d | /AI Assignment 2/Base/Source/Waiter/State_Cashier.h | 181c8fd5a60c83cbab1cb298f26cca7be255411c | [] | no_license | thjsamuel/AI-assignment-2 | bda65a9c8acf2ea012d0ea66284221ca3cc646b4 | fb05b38b5de81f36afb83216e251d10577137f03 | refs/heads/master | 2021-03-27T14:10:41.536574 | 2017-02-07T12:10:46 | 2017-02-07T12:10:46 | 78,397,388 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 493 | h | #ifndef STATE_CASHIER_H
#define STATE_CASHIER_H
#include "../State.h"
class CWaiter;
struct Telegram;
class CState_Cashier : public CState<CWaiter>
{
public:
static CState_Cashier* GetInstance();
virtual void Enter(CWaiter* waiter, double dt);
virtual void Execute(CWaiter* waiter, double dt);
virtual void Exit(CWaiter* waiter, double dt);
virtual bool OnMessage(CWaiter* waiter, const Telegram& telegram);
private:
CState_Cashier();
};
#endif // STATE_Cashier_H | [
"153942B@mymail.nyp.edu.sg"
] | 153942B@mymail.nyp.edu.sg |
47112fda6642ed0ed39be20365dcdd5272d13dd4 | 636f92553b5077f82e9c2b6dfa84508a7d7ede0a | /Happic Engine/Src/ECS/ECSBaseSystem.h | 3fdc6074e8013239ccaef7d8b76dde5e59f13489 | [] | no_license | Happic-Games/Happic-Game-Engine | c7f3edaa88ca9388ea4b295775d0bad06ecdb3a8 | 18af6621abf43883640d14e815cd0bc7819c761e | refs/heads/master | 2020-04-20T08:36:59.879767 | 2019-02-03T06:04:20 | 2019-02-03T06:04:20 | 168,744,549 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 896 | h | #pragma once
#include "ECSHandles.h"
#include "ECSBaseComponent.h"
#include "../Core/SubEngines.h"
#include <vector>
namespace Happic { namespace ECS {
typedef std::vector<ComponentID> ComponentInputSignature;
class EntityComponentSystem;
class BaseSystem
{
public:
BaseSystem() {}
virtual ~BaseSystem() {}
virtual void ProcessEntity(EntityID entity, Core::IDisplayInput* pInput, float dt) = 0;
inline const ComponentInputSignature& GetInputSignature() const { return m_inputSignature; }
inline static SystemID RegisterSystemType() { return ++s_lastID; }
protected:
void AddComponentType(ComponentID componentID);
void RemoveComponentType(ComponentID componentID);
protected:
EntityComponentSystem* m_pECS;
SubEngines m_subEngines;
private:
ComponentInputSignature m_inputSignature;
friend class EntityComponentSystem;
static SystemID s_lastID;
};
} }
| [
"eunoiagamess@gmail.com"
] | eunoiagamess@gmail.com |
3e7023b558a94c7b7322a2f994cf2ee775a64c21 | dce7440578f056113ee73f00c57fcce07d932cdf | /Hw7/myApp.cpp | a0d5cc84d40423c558f940b00948d83e0b11847d | [] | no_license | HoofaPoofa/ALVESHW7-1 | 51e46734d57ea441b05d2e1bb12b8dd925db5e31 | 28886e6dd3283de3a4cad52d178ff9fc3062586c | refs/heads/main | 2023-09-02T14:42:54.032034 | 2021-11-05T06:30:15 | 2021-11-05T06:30:15 | 424,808,744 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 870 | cpp | #include<iostream>
#include<fstream>
#include<string>
#include<sstream>
#include "derek_LED.h"
using namespace std;
#define LED_PATH "/sys/class/leds/beaglebone:green:usr"
int main(int argc, char* argv[]){
if(argc!=2){
cout << "Usage is makeLEDs <command>" << endl;
cout << " command is one of: on, off, flash or status" << endl;
cout << " e.g. makeLEDs flash" << endl;
}
cout << "Starting the makeLEDs program" << endl;
string cmd(argv[1]);
LED leds[4] = { LED(0), LED(1), LED(2), LED(3) };
for(int i=0; i<=3; i++){
if(cmd=="on")leds[i].turnOn();
else if(cmd=="off")leds[i].turnOff();
else if(cmd=="flash")leds[i].flash("100"); //default is "50"
else if(cmd=="status")leds[i].outputState();
else{ cout << "Invalid command!" << endl; }
}
cout << "Finished the makeLEDs program" << endl;
return 0;
}
| [
"jason.alves@wne.edu"
] | jason.alves@wne.edu |
b2e398b070ad6943428d976d088187c234a9c041 | ab62c54954906229220b2e707bde48224fab25fc | /lib/Target/ARM/ARMFPUName.def | 1fef3b3bc5e20744f0a4bc521ec40968c1c4b630 | [
"NCSA",
"LicenseRef-scancode-arm-llvm-sga"
] | permissive | sys-bio/roadrunner-dep-llvm-3.5.2 | c4918566618bb4b7dfe0be47bb2e2814b75f9ef1 | 3cae879d3cef83ad9963c9386643b6760a33c88a | refs/heads/master | 2021-01-10T02:47:31.374083 | 2015-09-29T21:59:47 | 2015-09-29T21:59:47 | 43,401,649 | 0 | 2 | NOASSERTION | 2020-03-26T09:55:59 | 2015-09-30T00:11:13 | C++ | UTF-8 | C++ | false | false | 1,080 | def | //===-- ARMFPUName.def - List of the ARM FPU names --------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file contains the list of the supported ARM FPU names.
//
//===----------------------------------------------------------------------===//
// NOTE: NO INCLUDE GUARD DESIRED!
#ifndef ARM_FPU_NAME
#error "You must define ARM_FPU_NAME(NAME, ID) before including ARMFPUName.h"
#endif
ARM_FPU_NAME("vfp", VFP)
ARM_FPU_NAME("vfpv2", VFPV2)
ARM_FPU_NAME("vfpv3", VFPV3)
ARM_FPU_NAME("vfpv3-d16", VFPV3_D16)
ARM_FPU_NAME("vfpv4", VFPV4)
ARM_FPU_NAME("vfpv4-d16", VFPV4_D16)
ARM_FPU_NAME("fp-armv8", FP_ARMV8)
ARM_FPU_NAME("neon", NEON)
ARM_FPU_NAME("neon-vfpv4", NEON_VFPV4)
ARM_FPU_NAME("neon-fp-armv8", NEON_FP_ARMV8)
ARM_FPU_NAME("crypto-neon-fp-armv8", CRYPTO_NEON_FP_ARMV8)
ARM_FPU_NAME("softvfp", SOFTVFP)
#undef ARM_FPU_NAME
| [
"0u812@github.com"
] | 0u812@github.com |
f568832abe92913c301645a81b4245b0ec83dea2 | 538f2b2a2e83518af6c9f37a83b35ef21ba5de6b | /13-vertex-animation/FSGL/src/Data/QuaternionKeyframe/FSGLQuaternionKeyframe.cpp | 73734155813444b928ac842872d9bc548d8537d3 | [] | no_license | LIANGMA314/OpenGLES3-Experiments | 647af9ae842aa9664f69cd0c3f04e699ca7a8601 | 3ae2bf53787eb2e6f95a29f56bf6e2fb81ff27bf | refs/heads/master | 2020-04-26T01:43:10.440623 | 2018-05-10T03:47:52 | 2018-05-10T03:47:52 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 533 | cpp | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/*
* File: FSGLQuaternionKeyframe.cpp
* Author: demensdeum
*
* Created on November 5, 2017, 3:30 PM
*/
#include "FSGLQuaternionKeyframe.h"
FSGLQuaternionKeyframe::FSGLQuaternionKeyframe() {
}
FSGLQuaternionKeyframe::FSGLQuaternionKeyframe(const FSGLQuaternionKeyframe& orig) {
}
FSGLQuaternionKeyframe::~FSGLQuaternionKeyframe() {
}
| [
"demensdeum@gmail.com"
] | demensdeum@gmail.com |
64704f49210f936da3943ad37efb7f1f20455256 | 2ea95f366f918ce0ed64d482c338827a0541420e | /APril Long/worthy.cpp | 940b07f9b171600d4bd7876f6f57ce23c6e9c68b | [] | no_license | Pavankalyan0105/CP | a972241dd0d85492862893bb0259a0cd9f1a8a57 | afb0cdddacf16570bbb93f1755a97758716e0347 | refs/heads/master | 2023-04-27T02:47:51.632668 | 2021-05-16T09:44:22 | 2021-05-16T09:44:22 | 357,893,027 | 0 | 0 | null | 2021-04-21T03:46:10 | 2021-04-14T12:12:43 | Python | UTF-8 | C++ | false | false | 863 | cpp | #include <iostream>
using namespace std;
typedef long long ll;
void solve(){
ll r , c, k;
cin>>r>>c>>k;
long long arr[r+1][c+1] = {0};
for(long long i=1;i<=r;i++)
for(long long j=1;j<=c;j++)
cin>>arr[i][j];
long long p[r+1][c+1];
for(long long i=1;i<=r;i++)
for(long long j=1;j<=c;j++)
p[i][j] = p[i-1][j] + p[i][j-1] - p[i-1][j-1] + arr[i][j];
int count = 0;
long long n = (r<c)?r:c;
long long sm=0;
for(ll i=1;i<=n;i++)
for(ll x=1;x<=(r-i+1);x++)
for(ll y=1;y<=(c-i+1);y++)
{
sm = p[x+i-1][y+i-1] - p[x+i-1][y-1] - p[x-1][y+i-1] + p[x-1][y-1];
if((sm/(i*i))>=k)
count+=1;
}
cout<<count;
}
int main()
{
int T;
cin>>T;
while(T--)
{
solve();
}
}
| [
"pavankalyan0105@gmail.com"
] | pavankalyan0105@gmail.com |
6ca28ae3e24051be6c93f5d55c00e719ddcd9261 | 3ba3b29e73b240a346202332b6ffac7d55cd5cff | /Angine/Animator.h | 1550e0ba51e6950f6f0221b4ef7c42fde4480d3e | [] | no_license | 4rgc/NinjaPlatformer | bc630dfbd120debc7c43327d851718b0af35ffa9 | c1f5a70bd2196331e551caa93fd66f54e6a0971f | refs/heads/master | 2020-12-31T07:10:47.191018 | 2018-11-04T22:07:40 | 2018-11-04T22:07:40 | 86,575,901 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 200 | h | #pragma once
//Not implemented and is not used
namespace Angine {
class Animator {
SpriteBatch p_spriteBatch;
GLTexture p_texture;
int p_numTiles;
public:
Animator();
~Animator();
};
} | [
"justkrut514@outlook.com"
] | justkrut514@outlook.com |
22aac0f2d0eb9c41b1d432e58c18ae502f3275f8 | ea30d9545b1caabd1cf5b616d3b8ed8b25659524 | /src/Minesweeper.cpp | 8ecaf4fa538da2eaf017a49f24a682d4e965fd48 | [
"MIT"
] | permissive | joao29a/Minesweeper | 85dff3622bdb1fd0a6e480b6b2dfb76cf1fe5697 | 5362b176bc2d689edf3152a2e52ad4ea9d1ac61f | refs/heads/master | 2021-01-16T21:15:20.505958 | 2016-06-04T08:05:48 | 2016-06-04T08:05:48 | 60,396,843 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 10,356 | cpp | #include "hdr/Minesweeper.hpp"
Minesweeper::Minesweeper(){
done = false;
displayVideo = NULL;
images = NULL;
textFont = NULL;
flagsQuantity = 0;
resetParams();
}
void Minesweeper::resetParams(){
visibilityQuantity = 0;
gameOver = false;
initTime = false;
startTime = 0;
cheatActived = false;
srand(time(NULL));
}
void Minesweeper::resetGame(){
resetParams();
flagsQuantity = BOMB_TOTAL;
mineTable.clear();
minesCoord.clear();
digitsCoord.clear();
vector<square> rows(SIZE_COL);
mineTable.resize(SIZE_ROW,rows);
TOP_SCORE = getTopScore();
insertMines();
insertDigits();
}
string Minesweeper::getTopScore(){
ifstream file;
file.open(getScoreFilename().c_str(), ifstream::in);
if (!file.is_open()) return string("-");
string line, bestWord;
int hour, min, sec, total, best = 24*60*60;
while (getline(file, line)){
sscanf(line.c_str(), "%d:%d:%d", &hour, &min, &sec);
total = (hour * 60 * 60) + (min * 60) + sec;
if (total < best){
best = total;
bestWord = string(line);
}
}
return bestWord;
}
void Minesweeper::setGameParams(int row, int col, int bomb_total){
SIZE_ROW = (Uint32)row;
SIZE_COL = (Uint32)col;
BOMB_TOTAL = (Uint32)bomb_total;
TOP_SCORE = getTopScore();
flagsQuantity = BOMB_TOTAL;
vector<square> rows(SIZE_COL);
mineTable.resize(SIZE_ROW,rows);
}
void Minesweeper::insertMines(){
Uint32 row,col;
for(Uint32 i = 0; i < BOMB_TOTAL; i++){
randomizeCoords(&row,&col);
while (mineTable[row][col].value == BOMB)
randomizeCoords(&row,&col);
mineTable[row][col].value = BOMB;
minesCoord.push_back({row,col});
}
}
void Minesweeper::insertDigits(){
for(Uint32 i = 0; i < BOMB_TOTAL; i++)
for(auto& coords: getAroundCoords(minesCoord[i][0], minesCoord[i][1]))
incrementKeyDigit(coords[0],coords[1]);
for(auto& itMap: digitsCoord){
Uint32 row = itMap.first / SIZE_COL;
Uint32 col = itMap.first % SIZE_COL;
mineTable[row][col].value = itMap.second;
}
}
listVector Minesweeper::getAroundCoords(Uint32 row, Uint32 col){
listVector coords;
int neighbours[][2] = {{0,1},{0,-1},{-1,0},{-1,1},{-1,-1},{1,0},
{1,1},{1,-1}};
for (Uint32 i = 0; i < 8; i++){
int newRow = row + neighbours[i][0];
int newCol = col + neighbours[i][1];
if (newRow >= 0 && newRow < (int)SIZE_ROW && newCol >= 0 &&
newCol < (int)SIZE_COL)
coords.push_back({(Uint32)newRow,(Uint32)newCol});
}
return coords;
}
void Minesweeper::incrementKeyDigit(Uint32 row, Uint32 col){
Uint32 coord = row * SIZE_COL + col;
if (mineTable[row][col].value != BOMB){
if (digitsCoord.find(coord) == digitsCoord.end()){
digitsCoord[coord] = 1;
}
else
digitsCoord[coord]++;
}
}
bool Minesweeper::isPlayerWinner(){
if (visibilityQuantity == (SIZE_ROW * SIZE_COL - BOMB_TOTAL)
&& flagsQuantity == 0)
return true;
else
return false;
}
void Minesweeper::quitGame(){
done = true;
}
void Minesweeper::keyPressedDown(SDLKey key){
if (key == SDLK_ESCAPE)
quitGame();
else if (key == SDLK_r)
resetGame();
else if (key == SDLK_s){
cheat << "s";
}
else if (key == SDLK_h){
cheat << "h";
}
else if (key == SDLK_o){
cheat << "o";
}
else if (key == SDLK_w){
cheat << "w";
}
}
void Minesweeper::leftButtonDown(int x, int y){
if (!initTime){
startTime = time(NULL);
initTime = true;
}
if (y - OFFSET < 0) return;
Uint32 col = x / WIDTH;
Uint32 row = (y - OFFSET) / HEIGHT;
if (mineTable[row][col].flag == true ||
mineTable[row][col].visibility == true) return;
mineTable[row][col].visibility = true;
if (mineTable[row][col].value == BOMB){
gameOver = true;
showMines();
}
else if (mineTable[row][col].value != BLANK) visibilityQuantity++;
else{
visibilityQuantity++;
revealBlankPositions(row,col);
}
}
void Minesweeper::revealBlankPositions(Uint32 row, Uint32 col){
for(auto& coords: getAroundCoords(row,col)){
if (mineTable[coords[0]][coords[1]].visibility == true ||
mineTable[coords[0]][coords[1]].flag == true) continue;
mineTable[coords[0]][coords[1]].visibility = true;
visibilityQuantity++;
if (mineTable[coords[0]][coords[1]].value == BLANK)
revealBlankPositions(coords[0],coords[1]);
}
}
void Minesweeper::rightButtonDown(int x, int y){
if (gameOver) return;
if (y - OFFSET < 0 || isPlayerWinner()) return;
int col = x / WIDTH;
int row = (y - OFFSET) / HEIGHT;
if (mineTable[row][col].visibility == true &&
mineTable[row][col].value == BOMB){
mineTable[row][col].visibility = false;
return;
}
if (mineTable[row][col].visibility == true) return;
if (mineTable[row][col].flag == false && flagsQuantity > 0){
mineTable[row][col].flag = true;
flagsQuantity--;
}
else if (mineTable[row][col].flag == true){
mineTable[row][col].flag = false;
flagsQuantity++;
}
}
void Minesweeper::randomizeCoords(Uint32* row, Uint32* col){
*row = rand() % SIZE_ROW;
*col = rand() % SIZE_COL;
}
bool Minesweeper::initGame(){
if (SDL_Init(SDL_INIT_EVERYTHING) < 0 || TTF_Init() < 0){
cout << SDL_GetError() << endl;
return false;
}
displayVideo = SDL_SetVideoMode(WIDTH * SIZE_COL, HEIGHT * SIZE_ROW + OFFSET,
32, SDL_HWSURFACE | SDL_DOUBLEBUF);
images = Render::assignImage(IMAGE_PATH);
textFont = TTF_OpenFont(FONT_PATH, 23);
if (displayVideo == NULL || images == NULL || textFont == NULL){
cout << SDL_GetError() << endl;
return false;
}
SDL_WM_SetCaption("Minesweeper", "Mines");
return true;
}
void Minesweeper::waitPlayer(SDL_Event* event){
while ((isPlayerWinner() || gameOver) && !done){
checkEvents(event);
struct timespec timespec_st = {0,NANOSEC};
nanosleep(×pec_st,NULL);
}
}
void Minesweeper::checkCheat(){
if (((int) cheat.str().find("show")) != -1){
cheatActived = true;
showMines();
cheat.str(string());
}
}
void Minesweeper::startGame(){
SDL_Event event;
thread timer(&Minesweeper::renderTimerText,this);
while (!done){
checkEvents(&event);
mtx.lock();
renderGame();
mtx.unlock();
if (isPlayerWinner() || gameOver){
if (isPlayerWinner() && !cheatActived)
saveScore();
waitPlayer(&event);
}
checkCheat();
struct timespec timespec_st = {0,NANOSEC};
nanosleep(×pec_st,NULL);
//used to not consume 100% of the cpu 0,1s
}
timer.join();
SDL_FreeSurface(displayVideo);
SDL_FreeSurface(images);
SDL_Quit();
TTF_Quit();
}
void Minesweeper::saveScore(){
ofstream file;
file.open(getScoreFilename().c_str(), ofstream::app);
file << getTimer() << endl;
file.close();
}
string Minesweeper::getScoreFilename(){
stringstream o;
o << "/scores/" << SIZE_ROW << "x" << SIZE_COL << "x" << BOMB_TOTAL;
o << ".txt";
return string(PATH) + o.str();
}
void Minesweeper::showMines(){
for(auto& coords: minesCoord)
mineTable[coords[0]][coords[1]].visibility = true;
}
SDL_Surface* Minesweeper::getTextSurface(const char* message){
return TTF_RenderUTF8_Solid(textFont,message,textColor);
}
void Minesweeper::renderGame(){
for (Uint32 i = 0; i < SIZE_ROW; i++){
for (Uint32 j = 0; j < SIZE_COL; j++){
Uint32 x = j * WIDTH;
Uint32 y = i * HEIGHT;
if (mineTable[i][j].visibility == false){
if (mineTable[i][j].flag == false)
Render::drawImage(displayVideo,images,x,y + OFFSET,
0,11*WIDTH,WIDTH,HEIGHT);
else
Render::drawImage(displayVideo,images,x,y + OFFSET
,0,10*WIDTH,WIDTH,HEIGHT);
}
else
Render::drawImage(displayVideo,images,x,y + OFFSET,0,
mineTable[i][j].value*WIDTH,WIDTH,HEIGHT);
}
}
renderFlagText();
// render the best score
renderText(getTextSurface(TOP_SCORE.c_str()),(WIDTH/2) * SIZE_COL -
2*(WIDTH/2)-WIDTH,0, WIDTH+5*WIDTH/2,HEIGHT);
SDL_Flip(displayVideo);
}
void Minesweeper::renderText(SDL_Surface* surface, int x, int y,
int w, int h){
Render::drawRect(displayVideo,x,y,w,h,0,0,0);
Render::drawImage(displayVideo,surface,x,y,0,0,w,h);
SDL_FreeSurface(surface);
}
void Minesweeper::renderFlagText(){
stringstream message;
message << setw(3) << setfill('0') << flagsQuantity;
renderText(getTextSurface(message.str().c_str()),0,0,
WIDTH+WIDTH/2,HEIGHT);
}
const char* Minesweeper::getTimer(){
time_t timeNow = 0;
int hours,minutes,seconds;
hours = minutes = seconds = 0;
if (initTime){
timeNow = time(NULL) - startTime;
hours = timeNow / 3600;
minutes = (timeNow / 60) % 60;
seconds = timeNow % 60;
}
stringstream messageHour,messageMinutes,messageSeconds;
messageHour << setw(2) << setfill('0') << hours;
messageMinutes << setw(2) << setfill('0') << minutes;
messageSeconds << setw(2) << setfill('0') << seconds;
return (messageHour.str() + ":" + messageMinutes.str() +
":" + messageSeconds.str()).c_str();
}
void Minesweeper::renderTimerText(){
while(!done){
if (!gameOver && !isPlayerWinner()){
mtx.lock();
renderText(getTextSurface(getTimer()),WIDTH * SIZE_COL -
4*(WIDTH/2)-WIDTH,0,
WIDTH+5*WIDTH/2,HEIGHT);
SDL_Flip(displayVideo);
mtx.unlock();
}
struct timespec timespec_st;
if (initTime) {
timespec_st = {1,0};
nanosleep(×pec_st,NULL);
}
else {
timespec_st = {0,NANOSEC};
nanosleep(×pec_st,NULL);
}
}
}
void Minesweeper::printMines(){
for(Uint32 i = 0; i < SIZE_ROW; i++){
for(Uint32 j = 0; j < SIZE_COL; j++){
cout << mineTable[i][j].value << " ";
}
cout << endl;
}
}
int main(int argc, char **argv){
Minesweeper obj;
if (argc == 2 && atoi(argv[1]) == 1 || argc == 1)
obj.setGameParams(9,9,10);
else if (argc == 2 && atoi(argv[1]) == 2)
obj.setGameParams(16,16,40);
else if (argc == 2 && atoi(argv[1]) == 3)
obj.setGameParams(16,30,99);
else{
if (argc < 4) return 1;
int row = atoi(argv[1]);
int col = atoi(argv[2]);
int mines = atoi(argv[3]);
if (col >= 9 && mines <= 999 && mines <= row * col)
obj.setGameParams(row,col,mines);
else
return 1;
}
if (!obj.initGame()) return 1;
obj.insertMines();
obj.insertDigits();
obj.startGame();
return 0;
}
| [
"joao29a@gmail.com"
] | joao29a@gmail.com |
cc2c96e8521a776d8b4c83caa136ab132e4bea00 | a7764174fb0351ea666faa9f3b5dfe304390a011 | /src/Graphic3d/Graphic3d_Group_9.cxx | ee3426e3b295b206f68d9123ca743262d17ebfae | [] | no_license | uel-dataexchange/Opencascade_uel | f7123943e9d8124f4fa67579e3cd3f85cfe52d91 | 06ec93d238d3e3ea2881ff44ba8c21cf870435cd | refs/heads/master | 2022-11-16T07:40:30.837854 | 2020-07-08T01:56:37 | 2020-07-08T01:56:37 | 276,290,778 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 10,786 | cxx |
// File Graphic3d_Group_9.cxx (Quadrangle)
// Created Fevrier 1992
// Author NW,JPB,CAL
// Modified
// 27/08/97 ; PCT : ajout coordonnee texture
//-Copyright MatraDatavision 1991,1992
//-Version
//-Design Declaration des variables specifiques aux groupes
// de primitives
//-Warning Un groupe est defini dans une structure
// Il s'agit de la plus petite entite editable
//-References
//-Language C++ 2.0
//-Declarations
// for the class
#include <Graphic3d_Group.jxx>
#include <Graphic3d_Group.pxx>
#include <Graphic3d_VertexN.hxx>
#include <Graphic3d_VertexC.hxx>
#include <Graphic3d_VertexNT.hxx>
//-Methods, in order
void Graphic3d_Group::QuadrangleMesh (const Graphic3d_Array2OfVertex& ListVertex, const Standard_Boolean EvalMinMax) {
if (IsDeleted ()) return;
if (! MyContainsFacet) MyStructure->GroupsWithFacet (+1);
MyContainsFacet = Standard_True;
MyIsEmpty = Standard_False;
Standard_Real X, Y, Z;
// Min-Max Update
if (EvalMinMax) {
Standard_Integer i, j;
Standard_Integer LowerRow = ListVertex.LowerRow ();
Standard_Integer UpperRow = ListVertex.UpperRow ();
Standard_Integer LowerCol = ListVertex.LowerCol ();
Standard_Integer UpperCol = ListVertex.UpperCol ();
// Parcours des sommets
for (i=LowerRow; i<=UpperRow; i++)
for (j=LowerCol; j<=UpperCol; j++) {
ListVertex (i, j).Coord (X, Y, Z);
if (X < MyBounds.XMin) MyBounds.XMin = Standard_ShortReal (X);
if (Y < MyBounds.YMin) MyBounds.YMin = Standard_ShortReal (Y);
if (Z < MyBounds.ZMin) MyBounds.ZMin = Standard_ShortReal (Z);
if (X > MyBounds.XMax) MyBounds.XMax = Standard_ShortReal (X);
if (Y > MyBounds.YMax) MyBounds.YMax = Standard_ShortReal (Y);
if (Z > MyBounds.ZMax) MyBounds.ZMax = Standard_ShortReal (Z);
}
}
MyGraphicDriver->QuadrangleMesh (MyCGroup, ListVertex, EvalMinMax);
Update ();
}
void Graphic3d_Group::QuadrangleMesh (const Graphic3d_Array2OfVertexN& ListVertex, const Standard_Boolean EvalMinMax) {
if (IsDeleted ()) return;
if (! MyContainsFacet) MyStructure->GroupsWithFacet (+1);
MyContainsFacet = Standard_True;
MyIsEmpty = Standard_False;
Standard_Real X, Y, Z;
Standard_Integer i, j;
Standard_Integer LowerRow = ListVertex.LowerRow ();
Standard_Integer UpperRow = ListVertex.UpperRow ();
Standard_Integer LowerCol = ListVertex.LowerCol ();
Standard_Integer UpperCol = ListVertex.UpperCol ();
// Min-Max Update
if (EvalMinMax) {
// Parcours des sommets
for (i=LowerRow; i<=UpperRow; i++)
for (j=LowerCol; j<=UpperCol; j++) {
ListVertex (i, j).Coord (X, Y, Z);
if (X < MyBounds.XMin) MyBounds.XMin = Standard_ShortReal (X);
if (Y < MyBounds.YMin) MyBounds.YMin = Standard_ShortReal (Y);
if (Z < MyBounds.ZMin) MyBounds.ZMin = Standard_ShortReal (Z);
if (X > MyBounds.XMax) MyBounds.XMax = Standard_ShortReal (X);
if (Y > MyBounds.YMax) MyBounds.YMax = Standard_ShortReal (Y);
if (Z > MyBounds.ZMax) MyBounds.ZMax = Standard_ShortReal (Z);
}
}
MyGraphicDriver->QuadrangleMesh (MyCGroup, ListVertex, EvalMinMax);
Update ();
}
void Graphic3d_Group::QuadrangleMesh(const Graphic3d_Array2OfVertexNT& ListVertex,const Standard_Boolean EvalMinMax)
{
if (IsDeleted ()) return;
if (! MyContainsFacet) MyStructure->GroupsWithFacet (+1);
MyContainsFacet = Standard_True;
MyIsEmpty = Standard_False;
Standard_Real X, Y, Z;
Standard_Integer i, j;
Standard_Integer LowerRow = ListVertex.LowerRow ();
Standard_Integer UpperRow = ListVertex.UpperRow ();
Standard_Integer LowerCol = ListVertex.LowerCol ();
Standard_Integer UpperCol = ListVertex.UpperCol ();
// Min-Max Update
if (EvalMinMax) {
// Parcours des sommets
for (i=LowerRow; i<=UpperRow; i++)
for (j=LowerCol; j<=UpperCol; j++) {
ListVertex (i, j).Coord (X, Y, Z);
if (X < MyBounds.XMin) MyBounds.XMin = Standard_ShortReal (X);
if (Y < MyBounds.YMin) MyBounds.YMin = Standard_ShortReal (Y);
if (Z < MyBounds.ZMin) MyBounds.ZMin = Standard_ShortReal (Z);
if (X > MyBounds.XMax) MyBounds.XMax = Standard_ShortReal (X);
if (Y > MyBounds.YMax) MyBounds.YMax = Standard_ShortReal (Y);
if (Z > MyBounds.ZMax) MyBounds.ZMax = Standard_ShortReal (Z);
}
}
MyGraphicDriver->QuadrangleMesh (MyCGroup, ListVertex, EvalMinMax);
Update ();
}
void Graphic3d_Group::QuadrangleSet (const Graphic3d_Array1OfVertex& ListVertex, const Aspect_Array1OfEdge& ListEdge, const Standard_Boolean EvalMinMax) {
if (IsDeleted ()) return;
if (! MyContainsFacet) MyStructure->GroupsWithFacet (+1);
MyContainsFacet = Standard_True;
MyIsEmpty = Standard_False;
Standard_Integer i, j;
i = ListVertex.Length ();
j = ListEdge.Length ();
if ((i <= 3) || (j <= 3))
Graphic3d_GroupDefinitionError::Raise ("Bad number of vertices");
// Min-Max Update
if (EvalMinMax) {
Standard_Real X, Y, Z;
Standard_Integer Lower = ListVertex.Lower ();
Standard_Integer Upper = ListVertex.Upper ();
// Parcours des sommets
for (j=0, i=Lower; i<=Upper; i++, j++) {
ListVertex (i).Coord (X, Y, Z);
if (X < MyBounds.XMin) MyBounds.XMin = Standard_ShortReal (X);
if (Y < MyBounds.YMin) MyBounds.YMin = Standard_ShortReal (Y);
if (Z < MyBounds.ZMin) MyBounds.ZMin = Standard_ShortReal (Z);
if (X > MyBounds.XMax) MyBounds.XMax = Standard_ShortReal (X);
if (Y > MyBounds.YMax) MyBounds.YMax = Standard_ShortReal (Y);
if (Z > MyBounds.ZMax) MyBounds.ZMax = Standard_ShortReal (Z);
}
}
MyGraphicDriver->QuadrangleSet
(MyCGroup, ListVertex, ListEdge, EvalMinMax);
Update ();
}
void Graphic3d_Group::QuadrangleSet (const Graphic3d_Array1OfVertexN& ListVertex, const Aspect_Array1OfEdge& ListEdge, const Standard_Boolean EvalMinMax) {
if (IsDeleted ()) return;
if (! MyContainsFacet) MyStructure->GroupsWithFacet (+1);
MyContainsFacet = Standard_True;
MyIsEmpty = Standard_False;
Standard_Integer i, j;
i = ListVertex.Length ();
j = ListEdge.Length ();
if ((i <= 3) || (j <= 3))
Graphic3d_GroupDefinitionError::Raise ("Bad number of vertices");
// Min-Max Update
if (EvalMinMax) {
Standard_Real X, Y, Z;
Standard_Integer Lower = ListVertex.Lower ();
Standard_Integer Upper = ListVertex.Upper ();
// Parcours des sommets
for (j=0, i=Lower; i<=Upper; i++, j++) {
ListVertex (i).Coord (X, Y, Z);
if (X < MyBounds.XMin) MyBounds.XMin = Standard_ShortReal (X);
if (Y < MyBounds.YMin) MyBounds.YMin = Standard_ShortReal (Y);
if (Z < MyBounds.ZMin) MyBounds.ZMin = Standard_ShortReal (Z);
if (X > MyBounds.XMax) MyBounds.XMax = Standard_ShortReal (X);
if (Y > MyBounds.YMax) MyBounds.YMax = Standard_ShortReal (Y);
if (Z > MyBounds.ZMax) MyBounds.ZMax = Standard_ShortReal (Z);
}
}
MyGraphicDriver->QuadrangleSet
(MyCGroup, ListVertex, ListEdge, EvalMinMax);
Update ();
}
void Graphic3d_Group::QuadrangleSet (const Graphic3d_Array1OfVertexC& ListVertex, const Aspect_Array1OfEdge& ListEdge, const Standard_Boolean EvalMinMax) {
if (IsDeleted ()) return;
if (! MyContainsFacet) MyStructure->GroupsWithFacet (+1);
MyContainsFacet = Standard_True;
MyIsEmpty = Standard_False;
Standard_Integer i, j;
i = ListVertex.Length ();
j = ListEdge.Length ();
if ((i <= 3) || (j <= 3))
Graphic3d_GroupDefinitionError::Raise ("Bad number of vertices");
// Min-Max Update
if (EvalMinMax) {
Standard_Real X, Y, Z;
Standard_Integer Lower = ListVertex.Lower ();
Standard_Integer Upper = ListVertex.Upper ();
// Parcours des sommets
for (j=0, i=Lower; i<=Upper; i++, j++) {
ListVertex (i).Coord (X, Y, Z);
if (X < MyBounds.XMin) MyBounds.XMin = Standard_ShortReal (X);
if (Y < MyBounds.YMin) MyBounds.YMin = Standard_ShortReal (Y);
if (Z < MyBounds.ZMin) MyBounds.ZMin = Standard_ShortReal (Z);
if (X > MyBounds.XMax) MyBounds.XMax = Standard_ShortReal (X);
if (Y > MyBounds.YMax) MyBounds.YMax = Standard_ShortReal (Y);
if (Z > MyBounds.ZMax) MyBounds.ZMax = Standard_ShortReal (Z);
}
}
MyGraphicDriver->QuadrangleSet
(MyCGroup, ListVertex, ListEdge, EvalMinMax);
Update ();
}
void Graphic3d_Group::QuadrangleSet (const Graphic3d_Array1OfVertexNC& ListVertex, const Aspect_Array1OfEdge& ListEdge, const Standard_Boolean EvalMinMax) {
if (IsDeleted ()) return;
if (! MyContainsFacet) MyStructure->GroupsWithFacet (+1);
MyContainsFacet = Standard_True;
MyIsEmpty = Standard_False;
Standard_Integer i, j;
i = ListVertex.Length ();
j = ListEdge.Length ();
if ((i <= 3) || (j <= 3))
Graphic3d_GroupDefinitionError::Raise ("Bad number of vertices");
// Min-Max Update
if (EvalMinMax) {
Standard_Real X, Y, Z;
Standard_Integer Lower = ListVertex.Lower ();
Standard_Integer Upper = ListVertex.Upper ();
// Parcours des sommets
for (j=0, i=Lower; i<=Upper; i++, j++) {
ListVertex (i).Coord (X, Y, Z);
if (X < MyBounds.XMin) MyBounds.XMin = Standard_ShortReal (X);
if (Y < MyBounds.YMin) MyBounds.YMin = Standard_ShortReal (Y);
if (Z < MyBounds.ZMin) MyBounds.ZMin = Standard_ShortReal (Z);
if (X > MyBounds.XMax) MyBounds.XMax = Standard_ShortReal (X);
if (Y > MyBounds.YMax) MyBounds.YMax = Standard_ShortReal (Y);
if (Z > MyBounds.ZMax) MyBounds.ZMax = Standard_ShortReal (Z);
}
}
MyGraphicDriver->QuadrangleSet
(MyCGroup, ListVertex, ListEdge, EvalMinMax);
Update ();
}
void Graphic3d_Group::QuadrangleSet(const Graphic3d_Array1OfVertexNT& ListVertex,const Aspect_Array1OfEdge& ListEdge,const Standard_Boolean EvalMinMax)
{
if (IsDeleted ()) return;
if (! MyContainsFacet) MyStructure->GroupsWithFacet (+1);
MyContainsFacet = Standard_True;
MyIsEmpty = Standard_False;
Standard_Integer i, j;
i = ListVertex.Length ();
j = ListEdge.Length ();
if ((i <= 3) || (j <= 3))
Graphic3d_GroupDefinitionError::Raise ("Bad number of vertices");
// Min-Max Update
if (EvalMinMax) {
Standard_Real X, Y, Z;
Standard_Integer Lower = ListVertex.Lower ();
Standard_Integer Upper = ListVertex.Upper ();
// Parcours des sommets
for (j=0, i=Lower; i<=Upper; i++, j++) {
ListVertex (i).Coord (X, Y, Z);
if (X < MyBounds.XMin) MyBounds.XMin = Standard_ShortReal (X);
if (Y < MyBounds.YMin) MyBounds.YMin = Standard_ShortReal (Y);
if (Z < MyBounds.ZMin) MyBounds.ZMin = Standard_ShortReal (Z);
if (X > MyBounds.XMax) MyBounds.XMax = Standard_ShortReal (X);
if (Y > MyBounds.YMax) MyBounds.YMax = Standard_ShortReal (Y);
if (Z > MyBounds.ZMax) MyBounds.ZMax = Standard_ShortReal (Z);
}
}
MyGraphicDriver->QuadrangleSet
(MyCGroup, ListVertex, ListEdge, EvalMinMax);
Update ();
}
| [
"shoka.sho2@excel.co.jp"
] | shoka.sho2@excel.co.jp |
4e3461f6608374f4c3c895faad25fcb69066612e | 0db7e969dd5712edc29f84d63e8789ba5492cdd1 | /codechef/new/trial.cpp | 6750c9e29bf1a0f5b7356b94042e4c8f864ae97b | [] | no_license | gokart23/Competitive-Programming | 21b3ab436e4bf4a10fe061c0fbe919cf7b16cf24 | a45a72eee42a1263c608dc0b2834d17cbc1ad424 | refs/heads/master | 2021-01-22T11:05:05.486205 | 2017-12-02T21:30:54 | 2017-12-02T21:30:54 | 45,769,546 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,145 | cpp | #include <cstdio>
#include <vector>
#include <cstring>
#include <algorithm>
using namespace std;
long int n;
inline void fastread_lint(long int *a)
{
char c=0; *a=0;
while(c<33){c=getchar_unlocked();}
while(c>33){*a=(*a<<3)+(*a<<1)+c-'0'; c=getchar_unlocked();}
}
long long int get(long int arr[],long int idx)
{
long long int ans=0;
while(idx>0)
{
ans = ans + arr[idx-1];
idx = idx - (idx&(-idx));
}
return ans;
}
void update(long int arr[],long int idx)
{
while(idx<n)
{
arr[idx-1]++;
idx = idx + (idx&(-idx));
}
}
int main(void)
{
long int i;
long long int ans =0;
fastread_lint(&n);
vector< pair<long int ,long int> > pr(n);long int arr[n];
for(i=0;i<n;i++)
{
fastread_lint(&pr[i].first);
fastread_lint(&pr[i].second);
arr[i] = pr[i].second;
}
sort(pr.begin(),pr.end());
sort(arr,arr+n);
for(i=0;i<n;i++)
{
long int ind = (int)(lower_bound(arr,arr+n,pr[i].second)-arr);
pr[i].second = ind + 1;
}
memset(arr,0,sizeof arr);
for(i=n-1;i>=0;i--)
{
ans = ans + get(arr,pr[i].second-1);
update(arr,pr[i].second);
}
printf("%lld\n",ans);
return 0;
} | [
"kar.meher95@gmail.com"
] | kar.meher95@gmail.com |
85f75d3d4d9360df5fcb51c6214d56ce3b6de303 | 84fd0927233bfe7b0f24bc97335ce4284ee84e59 | /include/caffe/layers/attention_pooling_layer.hpp | e4882dea0c92fe8599b8ba6d3b49a772d96cfe35 | [] | no_license | jialinwu17/caffe | a5e708df86de7bf2362c15628af8596941c7dfed | b6e6fd6a8a7c3d0612cdef14a28b45322dad3512 | refs/heads/master | 2021-01-21T22:35:28.795149 | 2017-09-02T01:51:28 | 2017-09-02T01:51:28 | 102,165,194 | 4 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,799 | hpp | #ifndef CAFFE_SOFTROI_POOLING_LAYER_HPP_
#define CAFFE_SOFTROI_POOLING_LAYER_HPP_
#include <vector>
#include "caffe/blob.hpp"
#include "caffe/common.hpp"
#include "caffe/layer.hpp"
#include "caffe/proto/caffe.pb.h"
namespace caffe {
/**
* @brief Perform position-sensitive max pooling on regions of interest specified by input, takes
* as input N position-sensitive score maps and a list of R regions of interest.
* ROIPoolingLayer takes 2 inputs and produces 1 output. bottom[0] is
* [N x (C x K^2) x H x W] position-sensitive score maps on which pooling is performed. bottom[1] is
* [R x 5] containing a list R ROI tuples with batch index and coordinates of
* regions of interest. Each row in bottom[1] is a ROI tuple in format
* [batch_index x1 y1 x2 y2], where batch_index corresponds to the index of
* instance in the first input and x1 y1 x2 y2 are 0-indexed coordinates
* of ROI rectangle (including its boundaries). The output top[0] is [R x C x K x K] score maps pooled
* within the ROI tuples.
* @param param provides PSROIPoolingParameter psroi_pooling_param,
* with PSROIPoolingLayer options:
* - output_dim. The pooled output channel number.
* - group_size. The number of groups to encode position-sensitive score maps
* - spatial_scale. Multiplicative spatial scale factor to translate ROI
* coordinates from their input scale to the scale used when pooling.
* R-FCN
* Written by Yi Li
*/
template <typename Dtype>
class AttentionPoolingLayer : public Layer<Dtype> {
public:
explicit AttentionPoolingLayer(const LayerParameter& param)
: Layer<Dtype>(param) {}
virtual void LayerSetUp(const vector<Blob<Dtype>*>& bottom,
const vector<Blob<Dtype>*>& top);
virtual void Reshape(const vector<Blob<Dtype>*>& bottom,
const vector<Blob<Dtype>*>& top);
virtual inline const char* type() const { return "AttentionPoolingLayer"; }
virtual inline int MinBottomBlobs() const { return 2; }
virtual inline int MaxBottomBlobs() const { return 2; }
virtual inline int MinTopBlobs() const { return 1; }
virtual inline int MaxTopBlobs() const { return 1; }
protected:
virtual void Forward_cpu(const vector<Blob<Dtype>*>& bottom,
const vector<Blob<Dtype>*>& top);
virtual void Forward_gpu(const vector<Blob<Dtype>*>& bottom,
const vector<Blob<Dtype>*>& top);
virtual void Backward_cpu(const vector<Blob<Dtype>*>& top,
const vector<bool>& propagate_down, const vector<Blob<Dtype>*>& bottom);
virtual void Backward_gpu(const vector<Blob<Dtype>*>& top,
const vector<bool>& propagate_down, const vector<Blob<Dtype>*>& bottom);
Dtype spatial_scale_;
int output_dim_;
int K;
int N_;
int height_;
int width_;
};
} // namespace caffe
#endif // CAFFE_PSROI_POOLING_LAYER_HPP_
| [
"18701637167@163.com"
] | 18701637167@163.com |
b9bee9a7c23a964350c9e0bc16a6efdfa74e189e | 4b39e2a2ab18abf722e730ccf16e51d377ee2477 | /Project 1/main.cpp | e6521c0ebba08551189e89d58eaa548b7ccc89cb | [] | no_license | ricky-ho/UCLA-CS32 | e61d6250b71b9b1b1328beade67a0e84169b074a | 9403a80e3ac4b768b920eb42229bdd511d4442e0 | refs/heads/master | 2020-12-08T10:50:44.457172 | 2020-01-10T04:51:27 | 2020-01-10T04:51:27 | 232,964,714 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 68 | cpp | #include "Game.h"
int main()
{
Game g(7,7,7);
g.play();
}
| [
"noreply@github.com"
] | ricky-ho.noreply@github.com |
e88774b96606527ca26034473d6f8dcef1e87d29 | 361ed5d2675cefcc0006243d9278bbf841e384ef | /mcrouter/routes/ShardSelectionRouteFactory.h | c5012e48d42946ab30a582ff2a7d213b725ddde9 | [
"MIT"
] | permissive | miezoy/mcrouter | 8919de002e02c05b1fedb6929aa27dc71dd9739f | 47445ecdd0a7eee1f54957594cfadbb32c618e2d | refs/heads/master | 2020-09-15T06:39:10.495858 | 2019-11-20T23:58:09 | 2019-11-20T23:59:24 | 223,369,362 | 0 | 1 | MIT | 2019-11-22T09:29:54 | 2019-11-22T09:29:53 | null | UTF-8 | C++ | false | false | 9,993 | h | /*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#pragma once
#include <algorithm>
#include <cassert>
#include <unordered_map>
#include <vector>
#include <folly/Range.h>
#include <folly/dynamic.h>
#include <mcrouter/config.h>
#include <mcrouter/lib/config/RouteHandleFactory.h>
#include <mcrouter/lib/fbi/cpp/util.h>
#include <mcrouter/lib/routes/DefaultShadowSelectorPolicy.h>
namespace facebook {
namespace memcache {
namespace mcrouter {
// Alias for eager shard selector factory.
template <class RouterInfo>
using RouteHandleWithChildrenFactoryFn =
std::function<typename RouterInfo::RouteHandlePtr(
RouteHandleFactory<typename RouterInfo::RouteHandleIf>& factory,
const folly::dynamic& json,
std::vector<typename RouterInfo::RouteHandlePtr> children)>;
template <class RouterInfo>
using ChildrenFactoryMap = std::
unordered_map<std::string, RouteHandleWithChildrenFactoryFn<RouterInfo>>;
/**
* Create a route handle for sharding requests to servers.
*
* Sample json format:
* {
* "pool": {
* "type": "pool",
* "name": "A",
* "servers": [
* "server1:12345",
* "server2:12345"
* ],
* "shards": [
* [1, 3, 6],
* [2, 4, 5]
* ]
* },
* "out_of_range": "ErrorRoute"
* }
*
* Alternatively, "shards" can be an array of strings of comma-separated
* shard ids. For example:
* {
* "pool": {
* "type": "pool",
* "name": "A",
* "servers": [
* "server1:12345",
* "server2:12345"
* ],
* "shards": [
* "1,3,6",
* "2,4,5"
* ]
* },
* }
*
*
* NOTE:
* - "shards" and "servers" must have the same number of entries, in exactly
* the same order (e.g. shards[5] shows the shards processed by servers[5]).
*
* @tparam ShardSelector Class responsible for selecting the shard responsible
* for handling the request. The ShardSelector constructor
* accepts a MapType shardsMap that maps
* shardId -> destinationId.
* @tparam MapType C++ type container that maps shardId -> destinationId.
*
* @param factory RouteHandleFactory to create destinations.
* @param json JSON object with RouteHandle representation.
*/
template <
class RouterInfo,
class ShardSelector,
class MapType = std::vector<uint16_t>>
typename RouterInfo::RouteHandlePtr createShardSelectionRoute(
RouteHandleFactory<typename RouterInfo::RouteHandleIf>& factory,
const folly::dynamic& json);
/**
* Creates a route handle that sends requests to destinations based on the
* shards map.
* If there are multiple servers serving the same shard, these destinations
* will be grouped together under the route handle specified by the
* "children_type" property.
*
* Sample json format:
* {
* "children_type": "RouteHandle",
* "children_settings" : { .. },
* "pools" : [
* {
* "pool": {
* "type": "pool",
* "name": "A",
* "servers": [
* "server1:12345",
* "server2:12345"
* ],
* "shards": [
* [1, 3, 6],
* [2, 4, 5]
* ]
* },
* }
* ],
* "out_of_range": "ErrorRoute"
* }
*
* DETAILS:
* - "shards" can also be an array of strings of comma-separated shard ids,
* as stated in the documentation of createShardSelectionRoute() above.
*
* - "children_type" the name of route handle that will group the servers that
* are responsible for a given shard. Can be: LoadBalancerRoute,
* LatestRoute, CustomJsonmRoute, or one of the names provided in the
* childrenFactoryMap. If CustomJsonmRoute is used, "children_settings"
* will have access to "$children_list$", which expands to the list of
* servers that serve a given shard. Check EagerShardSelectionRouteTest for
* more details.
*
* - "children_settings" is the properties of the route handle specified
* in the "children_type" option.
*
* - "pools" is an array of pools (or tiers).
* - "shards" and "servers" must have the same number of entries, in exactly
* the same order (e.g. shards[5] has the shards processed by servers[5]).
*
* @tparam ShardSelector Class responsible for selecting the shard responsible
* for handling the request. The ShardSelector constructor
* takes a shardsMap (unordered_map) that maps
* shardId -> destinationIndex.
* @tparam MapType C++ type container that maps shardId -> destinationIdx
*
* @param factory The route handle factory.
* @param json JSON object with the config of this route handle.
* @param childrenFactoryMap Map with factory functions of custom route handles
* that are supported to group the destinations that
* handle a given shard.
*
* @return Pointer to the EagerShardSelectionRoute.
*/
template <
class RouterInfo,
class ShardSelector,
class MapType = std::unordered_map<uint32_t, uint32_t>>
typename RouterInfo::RouteHandlePtr createEagerShardSelectionRoute(
RouteHandleFactory<typename RouterInfo::RouteHandleIf>& factory,
const folly::dynamic& json,
const ChildrenFactoryMap<RouterInfo>& childrenFactoryMap = {});
/**
* Creates a route handle that sends requests to destinations based on the
* shards map and shadows requests based on a shadow shards map.
* If there are multiple servers serving the same shard, these destinations
* will be grouped together under the route handle specified by the
* "children_type" property. Similarly hosts under the same "shadow_shard"
* will be grouped under the same route handle specified by the
* "shadow_children_type" property.
*
* Sample json format:
* {
* "children_type": "RouteHandle",
* "children_settings" : { .. },
* "pools" : [
* {
* "pool": {
* "type": "pool",
* "name": "A",
* "servers": [
* "server1:12345",
* "server2:12345"
* ],
* "shards": [
* [1, 3, 6],
* [2, 4, 5],
* "shadow_shards": [
* [7, 8, 9],
* [10, 11, 12]
* ]
* },
* }
* ],
* "out_of_range": "ErrorRoute",
* "shadow_children_type" : "RouteHandle",
* "shadow_children_settings" : { .. }
* }
*
* DETAILS:
* - "shards" and "shadow_shards" can also be an array of strings of
* comma-separated shard ids, as stated in the documentation of
* createShardSelectionRoute() above.
*
* - "children_type" the name of route handle that will group the servers that
* are responsible for a given shard. Can be: LoadBalancerRoute,
* LatestRoute, CustomJsonmRoute, or one of the names provided in the
* childrenFactoryMap. If CustomJsonmRoute is used, "children_settings"
* will have access to "$children_list$", which expands to the list of
* servers that serve a given shard. Check EagerShardSelectionRouteTest for
* more details.
*
* - "shadow_children_tye" is the name of the route handle that will group the
* server responsible for a given "shadow_shard". It currently supports
* LoadBalancerRoute, LatestRoute and one of the names provided in the
* childrenFactoryMap.
*
* - "children_settings" is the properties of the route handle specified
* in the "children_type" option.
*
* - "shadow_children_settings" is the properties of the route handle specified
* in the "shadow_children_type" option.
*
* - "pools" is an array of pools (or tiers).
* - "shards" and "servers" must have the same number of entries, in exactly
* the same order (e.g. shards[5] has the shards processed by servers[5]).
*
* @tparam ShardSelector Class responsible for selecting the shard responsible
* for handling the request. The ShardSelector constructor
* takes a shardsMap (unordered_map) that maps
* shardId -> destinationIndex.
* @tparam MapType C++ type container that maps shardId -> destinationIdx
*
* @param factory The route handle factory.
* @param json JSON object with the config of this route handle.
* @param childrenFactoryMap Map with factory functions of custom route handles
* that are supported to group the destinations that
* handle a given shard.
* @param shadowchildrenFactoryMap Map with factory functions of custom route
* handles that are supported to group the
destinations that handle a given shadow shard.
* @param shadowSelectorPolicy Optional policy implementing
* makePostShadowReplyFn()
* @param seed Seed to randbom number generator used to determine
* if to shadow.
*
* @return Pointer to the EagerShardSelectionRoute.
*/
template <
class RouterInfo,
class ShardSelector,
class MapType = std::unordered_map<uint32_t, uint32_t>,
class ShadowSelectorPolicy = DefaultShadowSelectorPolicy>
typename RouterInfo::RouteHandlePtr createEagerShardSelectionShadowRoute(
RouteHandleFactory<typename RouterInfo::RouteHandleIf>& factory,
const folly::dynamic& json,
const ChildrenFactoryMap<RouterInfo>& childrenFactoryMap = {},
const ChildrenFactoryMap<RouterInfo>& shadowChildrenFactoryMap = {},
const folly::Optional<ShadowSelectorPolicy>& shadowSelectorPolicy =
folly::none,
const uint32_t seed = nowUs());
} // namespace mcrouter
} // namespace memcache
} // namespace facebook
#include "mcrouter/routes/ShardSelectionRouteFactory-inl.h"
| [
"facebook-github-bot@users.noreply.github.com"
] | facebook-github-bot@users.noreply.github.com |
4a4650199ebaf1283043347ca07615c30c9a266f | 6e7d89d6982b77e0b3bfd3b08daf9b5937cc16c1 | /Parking_Meter_GE_Coordinator_3/Parking_Meter_GE_Coordinator_3.ino | d412d10d6922143bd34b9be602d1811c592024fe | [] | no_license | Blitz72/Arduino-Projects | 77bab39fc5653174c3490512a9224c4862fa46b3 | 1e00e669c4f62137b6fa7b7a44af4acabf9d749a | refs/heads/master | 2020-05-31T00:30:19.441695 | 2019-06-03T15:46:00 | 2019-06-03T15:46:00 | 190,035,959 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 11,259 | ino | /******************************************************************
This is an example for the Adafruit RA8875 Driver board for TFT displays
---------------> http://www.adafruit.com/products/1590
The RA8875 is a TFT driver for up to 800x480 dotclock'd displays
It is tested to work with displays in the Adafruit shop. Other displays
may need timing adjustments and are not guanteed to work.
Adafruit invests time and resources providing this open
source code, please support Adafruit and open-source hardware
by purchasing products from Adafruit!
Written by Limor Fried/Ladyada for Adafruit Industries.
BSD license, check license.txt for more information.
All text above must be included in any redistribution.
******************************************************************/
#include <SPI.h>
#include "Adafruit_GFX.h"
#include "Adafruit_RA8875.h"
#include <EEPROM.h>
//using namespace std;
// Library only supports hardware SPI at this time
// Connect SCLK to UNO Digital #13 (Hardware SPI clock)
// Connect MISO to UNO Digital #12 (Hardware SPI MISO)
// Connect MOSI to UNO Digital #11 (Hardware SPI MOSI)
// Connect SCLK to MEGA Digital #52 (Hardware SPI clock)
// Connect MISO to MEGA Digital #50 (Hardware SPI MISO)
// Connect MOSI to MEGA Digital #51 (Hardware SPI MOSI)
#define RA8875_INT 21 // MEGA 2560 R3 interrupt pins 2, 3, 18, 19, 20, 21; UNO R3 = 2, 3
#define RA8875_CS 53 // MEGA 2560 R3 = 53; UNO R3 = 10
#define RA8875_RESET 49 // MEGA 2560 R3 reset used is 49 which next to hardware SPI; UNO R3 reset was 9 next to hardware SPI
#define eePromAddress 0
#define red RA8875_RED
//#define green RA8875_GREEN
#define green 0x07a0 // just a bit darker than RA8875_GREEN
#define blue RA8875_BLUE
#define yellow RA8875_YELLOW
#define white RA8875_WHITE
#define black RA8875_BLACK
#define gray 0xe71c
Adafruit_RA8875 tft = Adafruit_RA8875(RA8875_CS, RA8875_RESET);
uint16_t tx, ty;
tsPoint_t _tsLCDPoints[3];
tsPoint_t _tsTSPoints[3];
tsMatrix_t _tsMatrix;
struct CalibrationObject {
int32_t An;
int32_t Bn;
int32_t Cn;
int32_t Dn;
int32_t En;
int32_t Fn;
int32_t divider;
boolean calibrated;
};
class ParkingMeter {
private:
byte address[4];
char mins[2];
char secs[2];
char _status;
char latitude[5];
char longitude[5];
byte id;
public:
ParkingMeter() {
Serial.println("Created default ParkingMeter!");
}
ParkingMeter(byte _id) {
setId(_id);
}
void setId(byte _id) {
id = _id;
}
byte getId() {
return id;
}
void setAddress(byte a[]) {
for (int i = 0; i < 4; i++) {
address[i] = a[i];
}
}
void setMins(char m[]) {
mins[0] = m[0];
mins[1] = m[1];
}
void setSecs(char s[]) {
secs[0] = s[0];
secs[1] = s[1];
}
void setStatus(char s) {
_status = s;
}
char getStatus() {
return _status;
}
void setLat(char l[]) {
for (int i = 0; i < 5; i++) {
latitude[i] = l[i];
}
}
void setLong(char l[]) {
for (int i = 0; i < 5; i++) {
longitude[i] = l[i];
}
}
int getTimer() {
int minutes = (mins[0] - 0x30) * 10 + mins[1] - 0x30;
int seconds = (secs[0] - 0x30) * 10 + secs[1] - 0x30;
return minutes * 100 + seconds;
}
void printInfo() {
};
void updateInfo() {
}
};
//ParkingMeter meterArray[10] = {p};
CalibrationObject cal;
// ================================================================= SETUP ============================================================================
void setup()
{
Serial.begin(9600);
Serial1.begin(9600); // Xbee serial port
Serial.println(F("RA8875 start"));
/* Initialise the display using 'RA8875_480x272' or 'RA8875_800x480' */
if (!tft.begin(RA8875_800x480)) {
Serial.println(F("RA8875 Not Found!"));
// while (1); // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! PUT BACK IN WHEN WORHING !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
}
Serial.println(F("Found RA8875"));
tft.displayOn(true);
tft.GPIOX(true); // Enable TFT - display enable tied to GPIOX
tft.PWM1config(true, RA8875_PWM_CLK_DIV1024); // PWM output for backlight
tft.PWM1out(255);
pinMode(RA8875_INT, INPUT);
digitalWrite(RA8875_INT, HIGH);
tft.touchEnable(true);
EEPROM.get(eePromAddress, cal);
// Serial.println(cal.An);
// Serial.println(cal.Bn);
// Serial.println(cal.Cn);
// Serial.println(cal.Dn);
// Serial.println(cal.En);
// Serial.println(cal.Fn);
// Serial.println(cal.divider);
// Serial.println(cal.calibrated);
for (int i = 0; i < 11; i++) {
tft.drawRect(0, i*40, tft.width() - 1, 40, RA8875_WHITE);
}
// tft.drawRect(0, 0, tft.width() - 1, 40, RA8875_WHITE);
tft.drawRect(0, 440, tft.width() - 1, 39, RA8875_WHITE);
tft.fillRect(1, 1, tft.width() - 3, 38, gray);
tft.fillRect(1, 441, tft.width() - 3, 37, gray);
tft.textMode();
tft.textEnlarge(1);
tft.textSetCursor(20, 3);
const char string[] = "LOCATION SERIAL # TIME LEFT";
tft.textTransparent(RA8875_BLACK);
tft.textWrite(string);
const byte MAX_SIZE = 10;
ParkingMeter meterArray[MAX_SIZE];
for (int i = 0; i < MAX_SIZE; i++) {
meterArray[i].setId(i);
Serial.println(meterArray[i].getId());
}
}
// ================================================================== LOOP ============================================================================
void loop() {
delay(500);
} // end of loop()
// ================================================================ FUNCTIONS =========================================================================
void serialEvent1() {
noInterrupts();
byte address[4] = {0};
char minArray[2] = {0};
char secArray[2] = {0};
char _status = 'R';
char latArray[5] = {0};
char lonArray[5] = {0};
byte inByte;
while (Serial1.available() > 0) { // should be a receive packet frame 0x90
// Serial.print(Serial1.read(), HEX);
// Serial.print(", ");
inByte = Serial1.read();
if (inByte == 0x7e) {
for (int i = 0; i < 2; i++) {
Serial1.read(); // discard length bytes
}
inByte = Serial1.read();
if (inByte == 0x90) {
for (int i = 0; i < 4; i++) {
Serial1.read(); // discard bytes 4 - 7, first half of 64-bit address
}
for (int i = 0; i < 4; i++) {
address[i] = Serial1.read(); // read offset 8 - 11, second half of 64-bit address
}
for (int i = 0; i < 3; i++) {
Serial1.read(); // discard offset 12 - 14
}
minArray[0] = Serial1.read(); // time left from parking meter, offset 15
minArray[1] = Serial1.read();
secArray[0] = Serial1.read();
secArray[1] = Serial1.read();
_status = Serial1.read();
for (int i = 0; i < 5; i++) {
latArray[i] = Serial1.read();
}
for (int i = 0; i < 5; i++) {
lonArray[i] = Serial1.read();
}
}
}
}
interrupts();
printInfo(address, minArray, secArray, _status, latArray, lonArray);
if (minArray[0] > 0x20 && minArray[0] < 0x7f && latArray[0] > 0x20 and latArray[0] < 0x7f &&
lonArray[0] > 0x20 && lonArray[0] < 0x7f && lonArray[5] > 0x20 && lonArray[5] < 0x7f ) {
updateInfo(address, minArray, secArray, _status, latArray, lonArray);
}
}
void printInfo(byte address[], char minutes[], char seconds[], char _status, char latitude[], char longitude[]) {
Serial.print(F("Address: "));
for (int i = 0; i < 4; i++) {
Serial.print(address[i], HEX);
}
Serial.println();
Serial.print(F("Time left: ")); Serial.print(minutes[0]); Serial.print(minutes[1]);
Serial.print(F(":")); Serial.print(seconds[0]); Serial.println(seconds[1]);
Serial.print(F("Status: ")); Serial.println(_status);
Serial.print(F("Position: 41."));
for (int i = 0; i < 5; i++) {
Serial.print(latitude[i]);
}
Serial.print(", -81.");
for (int i = 0; i < 5; i++) {
Serial.print(longitude[i]);
}
Serial.println();
Serial.println();
}
void updateInfo(byte address[], char minutes[], char seconds[], char _status, char latitude[], char longitude[]) {
uint16_t bgColor;
uint16_t textColor;
int mins = (minutes[0] - 0x30) * 10;
mins += minutes[1] - 0x30;
int secs = (seconds[0] - 0x30) * 10;
secs += seconds[1] - 0x30;
int timer = mins * 100 + secs;
if (_status == 'R') {
bgColor = blue;
textColor = white;
} else if (_status == 'A') {
if (timer > 500) {
bgColor = green;
textColor = black;
}
if (timer > 0 && timer <= 500) {
bgColor = yellow;
textColor = black;
}
if (timer <= 0) {
bgColor = red;
textColor = white;
}
} else if (_status == 'X') {
bgColor = red;
textColor = white;
}
uint16_t _latitude = (latitude[0] - 0x30) * 10000; // convert latitude char array into uinsigned integer
_latitude += (latitude[1] - 0x30) * 1000;
_latitude += (latitude[2] - 0x30) * 100;
_latitude += (latitude[3] - 0x30) * 10;
_latitude += (latitude[4] - 0x30);
uint16_t _longitude = (longitude[0] - 0x30) * 10000; // convert longitude char array into uinsigned integer
_longitude += (longitude[1] - 0x30) * 1000;
_longitude += (longitude[2] - 0x30) * 100;
_longitude += (longitude[3] - 0x30) * 10;
_longitude += (longitude[4] - 0x30);
tft.drawRect(0, 40, tft.width() - 1, 40, white);
tft.fillRect(1, 41, tft.width() - 3, 38, bgColor);
if (_latitude >= 54036 && _latitude <= 54056 && _longitude >= 56060 && _longitude <= 56141) {
tft.textSetCursor(20, 43);
tft.textTransparent(textColor);
tft.textWrite("SECURITY");
}
tft.textSetCursor(290, 43);
tft.textTransparent(textColor);
// convert hex values of the address to ascii for easy prining in the tft.textWrite() function
byte add[8] = {0};
((address[0] >> 4) < 10) ? add[0] = (address[0] >> 4) + 0x30 : add[0] = (address[0] >> 4) + 0x37;
((address[0] & 0x0f) < 10) ? add[1] = (address[0] & 0x0f) + 0x30 : add[1] = (address[0] & 0x0f) + 0x37;
((address[1] >> 4) < 10) ? add[2] = (address[1] >> 4) + 0x30 : add[2] = (address[1] >> 4) + 0x37;
((address[1] & 0x0f) < 10) ? add[3] = (address[1] & 0x0f) + 0x30 : add[3] = (address[1] & 0x0f) + 0x37;
((address[2] >> 4) < 10) ? add[4] = (address[2] >> 4) + 0x30 : add[4] = (address[2] >> 4) + 0x37;
((address[2] & 0x0f) < 10) ? add[5] = (address[2] & 0x0f) + 0x30 : add[5] = (address[2] & 0x0f) + 0x37;
((address[3] >> 4) < 10) ? add[6] = (address[3] >> 4) + 0x30 : add[6] = (address[3] >> 4) + 0x37;
((address[3] & 0x0f) < 10) ? add[7] = (address[3] & 0x0f) + 0x30 : add[7] = (address[3] & 0x0f) + 0x37;
tft.textWrite(add, 8);
tft.textSetCursor(520, 43);
tft.fillRect(520, 43, 100, 35, bgColor);
tft.textTransparent(textColor);
if (_status == 'A' || _status == 'X') {
tft.textWrite(minutes, 2);
tft.textWrite(":");
tft.textWrite(seconds, 2);
} else if (_status == 'R') {
tft.textWrite("INACTIVE");
}
}
| [
"bauer.david@att.net"
] | bauer.david@att.net |
e2ea6fe62c559782c55c52d18eff09c4610bdca2 | d0fb46aecc3b69983e7f6244331a81dff42d9595 | /drds/src/model/DescribeDrdsInstanceLevelTasksRequest.cc | 9f9b7efbd8a4b7f3a7385538852f4d766c8b2d9d | [
"Apache-2.0"
] | permissive | aliyun/aliyun-openapi-cpp-sdk | 3d8d051d44ad00753a429817dd03957614c0c66a | e862bd03c844bcb7ccaa90571bceaa2802c7f135 | refs/heads/master | 2023-08-29T11:54:00.525102 | 2023-08-29T03:32:48 | 2023-08-29T03:32:48 | 115,379,460 | 104 | 82 | NOASSERTION | 2023-09-14T06:13:33 | 2017-12-26T02:53:27 | C++ | UTF-8 | C++ | false | false | 1,645 | cc | /*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <alibabacloud/drds/model/DescribeDrdsInstanceLevelTasksRequest.h>
using AlibabaCloud::Drds::Model::DescribeDrdsInstanceLevelTasksRequest;
DescribeDrdsInstanceLevelTasksRequest::DescribeDrdsInstanceLevelTasksRequest() :
RpcServiceRequest("drds", "2019-01-23", "DescribeDrdsInstanceLevelTasks")
{
setMethod(HttpRequest::Method::Post);
}
DescribeDrdsInstanceLevelTasksRequest::~DescribeDrdsInstanceLevelTasksRequest()
{}
std::string DescribeDrdsInstanceLevelTasksRequest::getDrdsInstanceId()const
{
return drdsInstanceId_;
}
void DescribeDrdsInstanceLevelTasksRequest::setDrdsInstanceId(const std::string& drdsInstanceId)
{
drdsInstanceId_ = drdsInstanceId;
setParameter("DrdsInstanceId", drdsInstanceId);
}
std::string DescribeDrdsInstanceLevelTasksRequest::getAccessKeyId()const
{
return accessKeyId_;
}
void DescribeDrdsInstanceLevelTasksRequest::setAccessKeyId(const std::string& accessKeyId)
{
accessKeyId_ = accessKeyId;
setParameter("AccessKeyId", accessKeyId);
}
| [
"sdk-team@alibabacloud.com"
] | sdk-team@alibabacloud.com |
e990603eef69d1c60d6461389b904da70545a3ac | ad27946aa93951e574a7a288a410c7b2ccd51fd4 | /debug.cpp | 48c744fc995d52b8dc9d5e256c3ddf8e969b6c05 | [] | no_license | zpriddy/CSE310-Project2 | 6f2d8dc38b233bdc821b334c49029db3e3154f97 | fb55fdf30c52eee4a9f8d6691451984fc3710ba8 | refs/heads/master | 2020-05-18T19:51:54.676344 | 2013-10-23T17:54:26 | 2013-10-23T17:54:26 | 13,641,886 | 1 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 807 | cpp | /*******************************************************************************
* FILE NAME: degub.cpp
* DATE: 2013-10-16
* AUTHOR: Zachary Priddy
* me@zpriddy.com
* zpriddy@asu.edu
*
* DESC:
*
*
******************************************************************************/
#include <cstdlib>
#include <iostream>
using namespace std;
//Change this to 1 to display debug messages
int DEBUG=0;
void debug(string out)
{
if(DEBUG == 1)
{
cout << "DEBUG:\n";
cout << out << "\n";
}
}
void debug(int out)
{
if(DEBUG == 1)
{
cout << "DEBUG:\n";
cout << out << "\n";
}
}
void debug(string desc, int out)
{
if(DEBUG == 1)
{
cout << "DEBUG: " << desc << "\n";
cout << out << "\n";
}
} | [
"me@zpriddy.com"
] | me@zpriddy.com |
34cdc075c39565c356c6f88fde1c5ca397e7e225 | 1711ba6906fcfbebe0f5e6b91c5a388bf694f88f | /DHL_yk/RegDlg.cpp | 9aa3ab5173bbb12dfe0e78e79074be66e00eb43a | [] | no_license | killvxk/remotectrl-1 | 00a19b6aeb006eb587d6b225e26bf8d5cf56a491 | c17fb3961918b624262e76f14a7cfb8ba226a311 | refs/heads/master | 2021-05-27T15:41:38.169865 | 2014-06-20T14:12:47 | 2014-06-20T14:12:47 | null | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 22,927 | cpp | // RegDlg.cpp : implementation file
//
#include "stdafx.h"
#include "DHL_yk.h"
#include "RegDlg.h"
#include "RegDataDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CRegDlg dialog
CRegDlg::CRegDlg(CWnd* pParent, CIOCPServer* pIOCPServer, ClientContext *pContext)
: CDialog(CRegDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CRegDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
m_iocpServer = pIOCPServer;
m_pContext = pContext;
m_hIcon = AfxGetApp()->LoadIcon(IDI_REG_ICON);
how=0;
isEnable=true;
isEdit=false;
}
void CRegDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CRegDlg)
DDX_Control(pDX, IDC_LIST, m_list);
DDX_Control(pDX, IDC_TREE, m_tree);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CRegDlg, CDialog)
//{{AFX_MSG_MAP(CRegDlg)
ON_WM_SIZE()
ON_NOTIFY(TVN_SELCHANGED, IDC_TREE, OnSelchangedTree)
ON_WM_CLOSE()
ON_NOTIFY(NM_RCLICK, IDC_TREE, OnRclickTree)
ON_COMMAND(IDM_REGT_DEL, OnRegtDel)
ON_COMMAND(IDM_REGT_CREAT, OnRegtCreat)
ON_NOTIFY(NM_RCLICK, IDC_LIST, OnRclickList)
ON_COMMAND(IDM_REGL_EDIT, OnReglEdit)
ON_COMMAND(IDM_REGL_DELKEY, OnReglDelkey)
ON_COMMAND(IDM_REGL_STR, OnReglStr)
ON_COMMAND(IDM_REGL_DWORD, OnReglDword)
ON_COMMAND(IDM_REGL_EXSTR, OnReglExstr)
ON_NOTIFY(NM_DBLCLK, IDC_LIST, OnDblclkList)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CRegDlg message handlers
BOOL CRegDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
CString str;
sockaddr_in sockAddr;
memset(&sockAddr, 0, sizeof(sockAddr));
int nSockAddrLen = sizeof(sockAddr);
BOOL bResult = getpeername(m_pContext->m_Socket, (SOCKADDR*)&sockAddr, &nSockAddrLen);
str.Format("\\\\%s - 注册表管理", bResult != INVALID_SOCKET ? inet_ntoa(sockAddr.sin_addr) : "");
SetWindowText(str);
size[0]=120;size[1]=80;size[2]=310;
m_list.InsertColumn(0,"名称",LVCFMT_LEFT,size[0],-1);
m_list.InsertColumn(1,"类型",LVCFMT_LEFT,size[1],-1);
m_list.InsertColumn(2,"数据",LVCFMT_LEFT,size[2],-1);
m_list.SetExtendedStyle(LVS_EX_FULLROWSELECT);
//////添加图标//////
m_HeadIcon.Create(16,16,TRUE,2,2);
m_HeadIcon.Add(AfxGetApp()->LoadIcon(IDI_STR_ICON));
m_HeadIcon.Add(AfxGetApp()->LoadIcon(IDI_DWORD_ICON));
m_list.SetImageList(&m_HeadIcon,LVSIL_SMALL);
//树控件设置
HICON hIcon = NULL;
m_ImageList_tree.Create(18, 18, ILC_COLOR16,10, 0);
hIcon = (HICON)::LoadImage(::AfxGetInstanceHandle(),MAKEINTRESOURCE(IDI_FATHER_ICON), IMAGE_ICON, 18, 18, 0);
m_ImageList_tree.Add(hIcon);
hIcon = (HICON)::LoadImage(::AfxGetInstanceHandle(),MAKEINTRESOURCE(IDI_DIR_ICON), IMAGE_ICON, 32, 32, 0);
m_ImageList_tree.Add(hIcon);
hIcon = (HICON)::LoadImage(::AfxGetInstanceHandle(),MAKEINTRESOURCE(IDI_DIR_ICON2), IMAGE_ICON, 32, 32, 0);
m_ImageList_tree.Add(hIcon);
m_tree.SetImageList ( &m_ImageList_tree,TVSIL_NORMAL );
DWORD dwStyle = GetWindowLong(m_tree.m_hWnd,GWL_STYLE);
dwStyle |=TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT;
SetWindowLong(m_tree.m_hWnd,GWL_STYLE,dwStyle);
m_hRoot = m_tree.InsertItem("注册表管理",0,0,0,0);
/*
HKCU=m_tree.InsertItem("HKEY_CURRENT_USER",1,2,m_hRoot,0);
HKLM=m_tree.InsertItem("HKEY_LOCAL_MACHINE",1,2,m_hRoot,0);
HKUS=m_tree.InsertItem("HKEY_USERS",1,2,m_hRoot,0);
HKCC=m_tree.InsertItem("HKEY_CURRENT_CONFIG",1,2,m_hRoot,0);
HKCR=m_tree.InsertItem("HKEY_CLASSES_ROOT",1,2,m_hRoot,0);
*/
HKCR=m_tree.InsertItem("HKEY_CLASSES_ROOT",1,2,m_hRoot,0);
HKCU=m_tree.InsertItem("HKEY_CURRENT_USER",1,2,m_hRoot,0);
HKLM=m_tree.InsertItem("HKEY_LOCAL_MACHINE",1,2,m_hRoot,0);
HKUS=m_tree.InsertItem("HKEY_USERS",1,2,m_hRoot,0);
HKCC=m_tree.InsertItem("HKEY_CURRENT_CONFIG",1,2,m_hRoot,0);
m_tree.Expand(m_hRoot,TVE_EXPAND);
CreatStatusBar();
CRect rect;
GetWindowRect(&rect);
rect.bottom+=20;
MoveWindow(&rect,true);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
// 创建状态条
static UINT indicators[] =
{
ID_SEPARATOR
};
void CRegDlg::CreatStatusBar()
{
if (!m_wndStatusBar.Create(this) ||
!m_wndStatusBar.SetIndicators(indicators,
sizeof(indicators)/sizeof(UINT)))
{
TRACE0("Failed to create status bar\n");
return ; // fail to create
}
m_wndStatusBar.SetPaneInfo(0, m_wndStatusBar.GetItemID(0), SBPS_STRETCH, 120);
RepositionBars(AFX_IDW_CONTROLBAR_FIRST, AFX_IDW_CONTROLBAR_LAST, 0); //显示状态栏
CRect rc;
::GetWindowRect(this->m_hWnd,rc);
//rc.top=rc.bottom-30;
m_wndStatusBar.MoveWindow(rc);
CString str;
m_wndStatusBar.SetPaneText(0,str);
}
void CRegDlg::OnSize(UINT nType, int cx, int cy)
{
CDialog::OnSize(nType, cx, cy);
// TODO: Add your message handler code here
if(m_list.m_hWnd==NULL)return;
if(m_tree.m_hWnd==NULL)return;
CRect treeRec,listRec;
treeRec.top=treeRec.left=0;
//dlgrc.right=cx;
//dlgrc.bottom=cy;
treeRec.right=cx*0.3;
treeRec.bottom=cy-20;
m_tree.MoveWindow(treeRec);
listRec.top=0;
listRec.left =treeRec.right+10;
listRec.right=cx;
listRec.bottom=cy-20;
m_list.MoveWindow(listRec);
int dcx=cx-treeRec.right-15;
for(int i=0;i<3;i++){
double dd=size[i];
dd/=510;
dd*=dcx;
int lenth=dd;
m_list.SetColumnWidth(i,(lenth));
}
if(m_wndStatusBar.m_hWnd!=NULL){
CRect rc;
rc.top=cy-20;
rc.left=0;
rc.right=cx;
rc.bottom=cy;
m_wndStatusBar.MoveWindow(rc);
}
}
void CRegDlg::OnReceiveComplete()
{
//BYTE b=m_pContext->m_DeCompressionBuffer.GetBuffer(0)[0];
switch (m_pContext->m_DeCompressionBuffer.GetBuffer(0)[0])
{
case TOKEN_REG_PATH: //接收项
addPath((char*)(m_pContext->m_DeCompressionBuffer.GetBuffer(1)));
EnableCursor(true);
break;
case TOKEN_REG_KEY: //接收键 ,值
addKey((char*)(m_pContext->m_DeCompressionBuffer.GetBuffer(1)));
EnableCursor(true);
break;
case TOKEN_REG_OK:
TestOK();
isEdit=false;
EnableCursor(true);
break;
default:
EnableCursor(true);
isEdit=false;
break;
}
}
void CRegDlg::addPath(char *tmp)
{
if(tmp==NULL) return;
int msgsize=sizeof(REGMSG);
REGMSG msg;
memcpy((void*)&msg,tmp,msgsize);
DWORD size =msg.size;
int count=msg.count;
if(size>0&&count>0){ //一点保护措施
for(int i=0;i<count;i++){
char* szKeyName=tmp+size*i+msgsize;
m_tree.InsertItem(szKeyName,1,2,SelectNode,0);//插入子键名称
m_tree.Expand(SelectNode,TVE_EXPAND);
}
}
}
void CRegDlg::addKey(char *buf)
{
m_list.DeleteAllItems();
int nitem=m_list.InsertItem(0,"(默认)",0);
m_list.SetItemText(nitem,1,"REG_SZ");
m_list.SetItemText(nitem,2,"(数值未设置)");
if(buf==NULL) return;
REGMSG msg;
memcpy((void*)&msg,buf,sizeof(msg));
char* tmp=buf+sizeof(msg);
for(int i=0;i<msg.count;i++)
{
BYTE Type=tmp[0]; //取出标志头
tmp+=sizeof(BYTE);
char* szValueName=tmp; //取出名字
tmp+=msg.size;
BYTE* szValueDate=(BYTE*)tmp; //取出值
tmp+=msg.valsize;
if(Type==MREG_SZ)
{
int nitem=m_list.InsertItem(0,szValueName,0);
m_list.SetItemText(nitem,1,"REG_SZ");
m_list.SetItemText(nitem,2,(char*)szValueDate);
}
if(Type==MREG_DWORD)
{
char ValueDate[256];
DWORD d=(DWORD)szValueDate;
memcpy((void*)&d,szValueDate,sizeof(DWORD));
CString value;
value.Format("0x%x",d);
sprintf(ValueDate," (%wd)",d);
value+=" ";
value+=ValueDate;
int nitem=m_list.InsertItem(0,szValueName,1);
m_list.SetItemText(nitem,1,"REG_DWORD");
m_list.SetItemText(nitem,2,value);
}
if(Type==MREG_BINARY)
{
char ValueDate[256];
sprintf(ValueDate,"%wd",szValueDate);
int nitem=m_list.InsertItem(0,szValueName,1);
m_list.SetItemText(nitem,1,"REG_BINARY");
m_list.SetItemText(nitem,2,ValueDate);
}
if(Type==MREG_EXPAND_SZ)
{
int nitem=m_list.InsertItem(0,szValueName,0);
m_list.SetItemText(nitem,1,"REG_EXPAND_SZ");
m_list.SetItemText(nitem,2,(char*)szValueDate);
}
}
}
char CRegDlg::getFatherPath(CString &FullPath)
{
char bToken;
if(!FullPath.Find("HKEY_CLASSES_ROOT")) //判断主键
{
//MKEY=HKEY_CLASSES_ROOT;
bToken=MHKEY_CLASSES_ROOT;
FullPath.Delete(0,sizeof("HKEY_CLASSES_ROOT"));
}else
if(!FullPath.Find("HKEY_CURRENT_USER"))
{
bToken=MHKEY_CURRENT_USER;
FullPath.Delete(0,sizeof("HKEY_CURRENT_USER"));
}else
if(!FullPath.Find("HKEY_LOCAL_MACHINE"))
{
bToken=MHKEY_LOCAL_MACHINE;
FullPath.Delete(0,sizeof("HKEY_LOCAL_MACHINE"));
}else
if(!FullPath.Find("HKEY_USERS"))
{
bToken=MHKEY_USERS;
FullPath.Delete(0,sizeof("HKEY_USERS"));
}else
if(!FullPath.Find("HKEY_CURRENT_CONFIG"))
{
bToken=MHKEY_CURRENT_CONFIG;
FullPath.Delete(0,sizeof("HKEY_CURRENT_CONFIG"));
}
return bToken;
}
void CRegDlg::OnSelchangedTree(NMHDR* pNMHDR, LRESULT* pResult)
{
NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
// TODO: Add your control notification handler code here
if(!isEnable) return;
TVITEM item = pNMTreeView->itemNew;
if(item.hItem == m_hRoot)
{
return;
}
SelectNode=item.hItem; //保存用户打开的子树节点句柄
m_list.DeleteAllItems();
CString FullPath=GetFullPath(SelectNode);
m_wndStatusBar.SetPaneText(0,FullPath);
HTREEITEM CurrentNode = item.hItem; //取得此节点的全路径
while(m_tree.GetChildItem(CurrentNode)!=NULL)
{
m_tree.DeleteItem(m_tree.GetChildItem(CurrentNode)); //删除 会产生 OnSelchangingTree事件 ***
}
char bToken=getFatherPath(FullPath);
//愈加一个键
int nitem=m_list.InsertItem(0,"(默认)",0);
m_list.SetItemText(nitem,1,"REG_SZ");
m_list.SetItemText(nitem,2,"(数值未设置)");
//BeginWaitCursor();
//char *buf=new char[FullPath.GetLength]
FullPath.Insert(0,bToken);//插入 那个根键
bToken=COMMAND_REG_FIND;
FullPath.Insert(0,bToken); //插入查询命令
EnableCursor(false);
m_iocpServer->Send(m_pContext, (LPBYTE)(FullPath.GetBuffer(0)), FullPath.GetLength()+1);
*pResult = 0;
}
void CRegDlg::TestOK()
{
//执行了什么操作 1,删除项 2,新建项 3,删除键 4, 新建键 5,编辑键
if(how==1){
while(m_tree.GetChildItem(SelectNode)!=NULL)
{
m_tree.DeleteItem(m_tree.GetChildItem(SelectNode)); //删除 会产生 OnSelchangingTree事件 ***
}
m_tree.DeleteItem(SelectNode);
how=0;
}else if(how==2)
{
m_tree.InsertItem(Path,1,2,SelectNode,0);//插入子键名称
m_tree.Expand(SelectNode,TVE_EXPAND);
Path="";
}else if(how==3){
m_list.DeleteItem(index);
index=0;
}else if(how==4){
int nitem;
DWORD d;
char ValueDate[256];
CString value;
ZeroMemory(ValueDate,256);
switch(type){
case MREG_SZ: //加了字串
nitem=m_list.InsertItem(0,Key,0);
m_list.SetItemText(nitem,1,"REG_SZ");
m_list.SetItemText(nitem,2,Value);
break;
case MREG_DWORD: //加了DWORD
d=atod(Value.GetBuffer(0));
//Value.ReleaseBuffer();
value.Format("0x%x",d);
sprintf(ValueDate," (%wd)",d);
value+=" ";
value+=ValueDate;
nitem=m_list.InsertItem(0,Key,1);
m_list.SetItemText(nitem,1,"REG_DWORD");
m_list.SetItemText(nitem,2,value);
break;
case MREG_EXPAND_SZ:
nitem=m_list.InsertItem(0,Key,0);
m_list.SetItemText(nitem,1,"REG_EXPAND_SZ");
m_list.SetItemText(nitem,2,Value);
break;
default:
break;
}
}else if(how==5){
// int nitem;
DWORD d;
char ValueDate[256];
CString value;
ZeroMemory(ValueDate,256);
switch(type){
case MREG_SZ: //加了字串
m_list.SetItemText(index,2,Value);
break;
case MREG_DWORD: //加了DWORD
d=atod(Value.GetBuffer(0));
//Value.ReleaseBuffer();
value.Format("0x%x",d);
sprintf(ValueDate," (%wd)",d);
value+=" ";
value+=ValueDate;
m_list.SetItemText(index,2,value);
break;
case MREG_EXPAND_SZ:
m_list.SetItemText(index,2,Value);
break;
default:
break;
}
}
how=0;
}
void CRegDlg::EnableCursor(bool b)
{
if(b){
isEnable=true;
::SetCursor(::LoadCursor(NULL,IDC_ARROW));
}else{
isEnable=false;
::SetCursor(LoadCursor(NULL, IDC_WAIT));
}
}
CString CRegDlg::GetFullPath(HTREEITEM hCurrent)
{
CString strTemp;
CString strReturn = "";
while(1){
if(hCurrent==m_hRoot) return strReturn;
strTemp = m_tree.GetItemText(hCurrent); //得到当前的
if(strTemp.Right(1) != "\\")
strTemp += "\\";
strReturn = strTemp + strReturn;
hCurrent = m_tree.GetParentItem(hCurrent); //得到父的
}
return strReturn;
}
DWORD CRegDlg::atod(char *ch)
{
int len=strlen(ch);
DWORD d=0;
for(int i=0;i<len;i++){
int t=ch[i]-48; //这位上的数字
if(ch[i]>57||ch[i]<48){ //不是数字
return d;
}
d*=10;
d+=t;
}
return d;
}
void CRegDlg::OnClose()
{
// TODO: Add your message handler code here and/or call default
closesocket(m_pContext->m_Socket);
CDialog::OnClose();
}
/* 得到列表的类型
MREG_SZ,
MREG_DWORD,
MREG_BINARY,
MREG_EXPAND_SZ*/
BYTE CRegDlg::getType(int index)
{
if(index<0) return 100;
CString strType=m_list.GetItemText(index,1); //得到类型
if(strType=="REG_SZ")
return MREG_SZ;
else if(strType=="REG_DWORD")
return MREG_DWORD;
else if(strType=="REG_EXPAND_SZ")
return MREG_EXPAND_SZ;
else
return 100;
}
void CRegDlg::OnRclickTree(NMHDR* pNMHDR, LRESULT* pResult)
{
// TODO: Add your control notification handler code here
if(!isEnable) return;
CPoint point;
GetCursorPos(&point);
m_tree.ScreenToClient(&point);
UINT uFlags;
HTREEITEM hItem = m_tree.HitTest(point, &uFlags);
if ((hItem != NULL) && (TVHT_ONITEM & uFlags))
{
if(hItem== m_hRoot)
{
return;
}
SelectNode=hItem;
m_tree.Select(hItem, TVGN_CARET);
CMenu popup;
popup.LoadMenu(IDR_REGT_MENU);
CMenu* pM = popup.GetSubMenu(0);
CPoint p;
GetCursorPos(&p);
pM->TrackPopupMenu(TPM_LEFTALIGN, p.x, p.y, this);
}
*pResult = 0;
}
void CRegDlg::OnRegtDel()
{
// TODO: Add your command handler code here
CString FullPath=GetFullPath(SelectNode); //得到全路径
char bToken=getFatherPath(FullPath);
// COMMAND_REG_DELPATH
FullPath.Insert(0,bToken);//插入 那个根键
bToken=COMMAND_REG_DELPATH;
FullPath.Insert(0,bToken); //插入查询命令
how=1;
m_iocpServer->Send(m_pContext, (LPBYTE)(FullPath.GetBuffer(0)), FullPath.GetLength()+1);
}
void CRegDlg::OnRegtCreat()
{
// TODO: Add your command handler code here
CRegDataDlg dlg(this);
//dlg.EnableKey();
dlg.EKey=true;
dlg.DoModal();
if(dlg.isOK){
//MessageBox(dlg.m_path); COMMAND_REG_CREATEPATH
CString FullPath=GetFullPath(SelectNode); //得到全路径
//FullPath+="\\";
FullPath+=dlg.m_path;
char bToken=getFatherPath(FullPath);
// COMMAND_REG_DELPATH
FullPath.Insert(0,bToken);//插入 那个根键
bToken=COMMAND_REG_CREATEPATH;
FullPath.Insert(0,bToken); //插入查询命令
how=2;
Path=dlg.m_path;
m_iocpServer->Send(m_pContext, (LPBYTE)(FullPath.GetBuffer(0)), FullPath.GetLength()+1);
}
}
void CRegDlg::OnRclickList(NMHDR* pNMHDR, LRESULT* pResult)
{
// TODO: Add your control notification handler code here
if(!isEnable) return;
if( SelectNode== m_hRoot)
{
return;
}
CMenu popup;
popup.LoadMenu(IDR_REGL_MENU);
CMenu* pM = popup.GetSubMenu(0);
CPoint p;
GetCursorPos(&p);
if (m_list.GetSelectedCount() == 0) //没有选中
{
pM->EnableMenuItem(0, MF_BYPOSITION | MF_GRAYED); //编辑
pM->EnableMenuItem(1, MF_BYPOSITION | MF_GRAYED); //删除
}else{
if(getType(m_list.GetSelectionMark())==100)
pM->EnableMenuItem(0, MF_BYPOSITION | MF_GRAYED); //编辑
pM->EnableMenuItem(2, MF_BYPOSITION | MF_GRAYED); //新建
}
pM->TrackPopupMenu(TPM_LEFTALIGN, p.x, p.y, this);
*pResult = 0;
}
void CRegDlg::OnReglEdit()
{
// TODO: Add your command handler code here
int index=m_list.GetSelectionMark();
if(index<0)return;
BYTE b=getType(index);
switch(b){
case MREG_SZ:
isEdit=true; //变为可编辑状态
Key=m_list.GetItemText(index,0); //得到名
Value=m_list.GetItemText(index,2); //得到值
OnReglStr();
how=5;
this->index=index;
break;
case MREG_DWORD:
Key=m_list.GetItemText(index,0); //得到名
Value.Format("%s",m_list.GetItemText(index,2)); //得到值
Value.Delete(0,Value.Find('(')+1); // 去掉括号
Value.Delete(Value.GetLength()-1); //
isEdit=true; //变为可编辑状态
OnReglDword();
how=5;
this->index=index;
break;
case MREG_EXPAND_SZ:
isEdit=true; //变为可编辑状态
Key=m_list.GetItemText(index,0); //得到名
Value=m_list.GetItemText(index,2); //得到值
OnReglExstr();
how=5;
this->index=index;
break;
default:
break;
}
}
//删除键 COMMAND_REG_DELKEY
void CRegDlg::OnReglDelkey()
{
// TODO: Add your command handler code here
REGMSG msg;
int index=m_list.GetSelectionMark();
CString FullPath=GetFullPath(SelectNode); //得到全路径
char bToken=getFatherPath(FullPath);
CString key=m_list.GetItemText(index,0); //得到键名
msg.size=FullPath.GetLength(); // 项名大小
msg.valsize=key.GetLength(); //键名大小
int datasize=sizeof(msg)+msg.size+msg.valsize+4;
char *buf=new char[datasize];
ZeroMemory(buf,datasize);
buf[0]=COMMAND_REG_DELKEY; //命令头
buf[1]=bToken; //主键
memcpy(buf+2,(void*)&msg,sizeof(msg)); //数据头
if(msg.size>0) //根键 就不用写项了
memcpy(buf+2+sizeof(msg),FullPath.GetBuffer(0),FullPath.GetLength()); //项值
memcpy(buf+2+sizeof(msg)+FullPath.GetLength(),key.GetBuffer(0),key.GetLength()); //键值
how=3;
this->index=index;
m_iocpServer->Send(m_pContext, (LPBYTE)(buf), datasize);
delete[] buf;
}
void CRegDlg::OnReglStr()
{
// TODO: Add your command handler code here
CRegDataDlg dlg(this);
if(isEdit){ //是编辑
dlg.m_path=Key;
dlg.m_key=Value;
dlg.EPath=true;
}
dlg.DoModal();
if(dlg.isOK){
CString FullPath=GetFullPath(SelectNode); //得到全路径
char bToken=getFatherPath(FullPath);
DWORD size=1+1+1+sizeof(REGMSG)+FullPath.GetLength()+dlg.m_path.GetLength()+dlg.m_key.GetLength()+6;
char* buf=new char[size];
//char *buf = (char *)LocalAlloc(LPTR, size);
ZeroMemory(buf,size);
REGMSG msg;
msg.count=FullPath.GetLength(); //项大小
msg.size=dlg.m_path.GetLength(); //键大小
msg.valsize=dlg.m_key.GetLength(); //数据大小
buf[0]= COMMAND_REG_CREATKEY; //数据头
buf[1]=MREG_SZ; //值类型
buf[2]=bToken; //父键
memcpy(buf+3,(void*)&msg,sizeof(msg)); //数据头
char* tmp=buf+3+sizeof(msg);
if(msg.count>0)
memcpy(tmp,FullPath.GetBuffer(0),msg.count); //项
tmp+=msg.count;
memcpy(tmp,dlg.m_path.GetBuffer(0),msg.size); //键名
tmp+=msg.size;
memcpy(tmp,dlg.m_key.GetBuffer(0),msg.valsize); //值
tmp=buf+3+sizeof(msg);
// 善后
type=MREG_SZ;
how=4;
Key=dlg.m_path;
Value=dlg.m_key;
//
m_iocpServer->Send(m_pContext, (LPBYTE)(buf), size);
delete[] buf;
//LocalFree(buf);
}
}
void CRegDlg::OnReglDword()
{
// TODO: Add your command handler code here
CRegDataDlg dlg(this);
dlg.isDWORD=true;
if(isEdit){ //是编辑
dlg.m_path=Key;
dlg.m_key=Value;
dlg.EPath=true;
}
dlg.DoModal();
if(dlg.isOK){
CString FullPath=GetFullPath(SelectNode); //得到全路径
char bToken=getFatherPath(FullPath);
DWORD size=1+1+1+sizeof(REGMSG)+FullPath.GetLength()+dlg.m_path.GetLength()+dlg.m_key.GetLength()+6;
char* buf=new char[size];
//char *buf = (char *)LocalAlloc(LPTR, size);
ZeroMemory(buf,size);
REGMSG msg;
msg.count=FullPath.GetLength(); //项大小
msg.size=dlg.m_path.GetLength(); //键大小
msg.valsize=dlg.m_key.GetLength(); //数据大小
buf[0]= COMMAND_REG_CREATKEY; //数据头
buf[1]=MREG_DWORD; //值类型
buf[2]=bToken; //父键
memcpy(buf+3,(void*)&msg,sizeof(msg)); //数据头
char* tmp=buf+3+sizeof(msg);
if(msg.count>0)
memcpy(tmp,FullPath.GetBuffer(0),msg.count); //项
tmp+=msg.count;
memcpy(tmp,dlg.m_path.GetBuffer(0),msg.size); //键名
tmp+=msg.size;
memcpy(tmp,dlg.m_key.GetBuffer(0),msg.valsize); //值
tmp=buf+3+sizeof(msg);
// 善后
type=MREG_DWORD;
how=4;
Key=dlg.m_path;
Value=dlg.m_key;
//
m_iocpServer->Send(m_pContext, (LPBYTE)(buf), size);
delete[] buf;
//LocalFree(buf);
}
}
void CRegDlg::OnReglExstr()
{
// TODO: Add your command handler code here
CRegDataDlg dlg(this);
if(isEdit){ //是编辑
dlg.m_path=Key;
dlg.m_key=Value;
dlg.EPath=true;
}
dlg.DoModal();
if(dlg.isOK){
CString FullPath=GetFullPath(SelectNode); //得到全路径
char bToken=getFatherPath(FullPath);
DWORD size=1+1+1+sizeof(REGMSG)+FullPath.GetLength()+dlg.m_path.GetLength()+dlg.m_key.GetLength()+6;
char* buf=new char[size];
//char *buf = (char *)LocalAlloc(LPTR, size);
ZeroMemory(buf,size);
REGMSG msg;
msg.count=FullPath.GetLength(); //项大小
msg.size=dlg.m_path.GetLength(); //键大小
msg.valsize=dlg.m_key.GetLength(); //数据大小
buf[0]= COMMAND_REG_CREATKEY; //数据头
buf[1]=MREG_EXPAND_SZ; //值类型
buf[2]=bToken; //父键
memcpy(buf+3,(void*)&msg,sizeof(msg)); //数据头
char* tmp=buf+3+sizeof(msg);
if(msg.count>0)
memcpy(tmp,FullPath.GetBuffer(0),msg.count); //项
tmp+=msg.count;
memcpy(tmp,dlg.m_path.GetBuffer(0),msg.size); //键名
tmp+=msg.size;
memcpy(tmp,dlg.m_key.GetBuffer(0),msg.valsize); //值
tmp=buf+3+sizeof(msg);
// 善后
type=MREG_EXPAND_SZ;
how=4;
Key=dlg.m_path;
Value=dlg.m_key;
//
m_iocpServer->Send(m_pContext, (LPBYTE)(buf), size);
delete[] buf;
//LocalFree(buf);
}
}
void CRegDlg::OnDblclkList(NMHDR* pNMHDR, LRESULT* pResult)
{
// TODO: Add your control notification handler code here
OnReglEdit();
*pResult = 0;
}
| [
"ouwenniu@qq.com"
] | ouwenniu@qq.com |
42fdd0563fd3faa97c8d925292a797dce5d2332f | 81f4ebf8666ff68f407c3cbd7165a59df4483901 | /Source/WebKit/qt/WidgetSupport/QStyleFacadeImp.cpp | 97c790aa630e57c251cb7ac6c098d9668eb20eb6 | [
"BSD-2-Clause"
] | permissive | andrwwbstr/webkit | 0a09927fc5f9d9d7b207f566a8f85cdd682a7795 | 9f70a9b57fcd7fa0431c080f1efd03b150cafe47 | refs/heads/qtwebkit-stable | 2023-01-01T19:57:45.819146 | 2016-07-04T21:57:08 | 2016-07-04T21:57:08 | 63,253,127 | 0 | 0 | null | 2016-07-13T14:29:15 | 2016-07-13T14:29:14 | null | UTF-8 | C++ | false | false | 17,556 | cpp | /*
* This file is part of the theme implementation for form controls in WebCore.
*
* Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
* Copyright (C) 2011-2012 Nokia Corporation and/or its subsidiary(-ies).
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*
*/
#include "config.h"
#include "QStyleFacadeImp.h"
#include <QApplication>
#include <QLineEdit>
#include <QPainter>
#include <QPushButton>
#include <QStyleFactory>
#include <QStyleOption>
#include <QWebPageAdapter.h>
#include <QWebPageClient.h>
using namespace WebCore;
namespace WebKit {
static QStyle::State convertToQStyleState(QStyleFacade::State state)
{
QStyle::State result;
#define CONVERT_STATE(ProxiedState, Value) \
if (state & QStyleFacade::ProxiedState) \
result |= QStyle::ProxiedState;
FOR_EACH_MAPPED_STATE(CONVERT_STATE, )
#undef CONVERT_STATE
return result;
}
static QStyle::SubControl convertToQStyleSubControl(QStyleFacade::SubControl sc)
{
#define CONVERT_SUBCONTROL(F, Value) \
case QStyleFacade::F: return QStyle::F
switch (sc) {
FOR_EACH_SUBCONTROL(CONVERT_SUBCONTROL, SEMICOLON);
}
Q_UNREACHABLE();
return QStyle::SC_None;
#undef CONVERT_SUBCONTROL
}
static void initGenericStyleOption(QStyleOption* option, QWidget* widget, const QStyleFacadeOption& facadeOption)
{
if (widget)
option->init(widget);
else
// If a widget is not directly available for rendering, we fallback to default
// value for an active widget.
option->state = QStyle::State_Active | QStyle::State_Enabled;
option->rect = facadeOption.rect;
option->state = convertToQStyleState(facadeOption.state);
if (facadeOption.direction != Qt::LayoutDirectionAuto)
option->direction = facadeOption.direction;
option->palette = facadeOption.palette;
}
static void initSpecificStyleOption(QStyleOption*, const QStyleFacadeOption&)
{
}
static void initSpecificStyleOption(QStyleOptionSlider* sliderOption, const QStyleFacadeOption& facadeOption)
{
sliderOption->orientation = facadeOption.slider.orientation;
sliderOption->upsideDown = facadeOption.slider.upsideDown;
sliderOption->minimum = facadeOption.slider.minimum;
sliderOption->maximum = facadeOption.slider.maximum;
sliderOption->sliderPosition = facadeOption.slider.position;
sliderOption->sliderValue = facadeOption.slider.value;
sliderOption->singleStep = facadeOption.slider.singleStep;
sliderOption->pageStep = facadeOption.slider.pageStep;
sliderOption->activeSubControls = convertToQStyleSubControl(facadeOption.slider.activeSubControls);
}
template <typename StyleOption>
class MappedStyleOption : public StyleOption {
public:
MappedStyleOption(QWidget* widget, const QStyleFacadeOption& facadeOption)
{
initGenericStyleOption(this, widget, facadeOption);
initSpecificStyleOption(this, facadeOption);
}
};
static QStyle::PixelMetric convertPixelMetric(QStyleFacade::PixelMetric state)
{
#define CONVERT_METRIC(Metric) \
case QStyleFacade::Metric: return QStyle::Metric
switch (state) {
FOR_EACH_MAPPED_METRIC(CONVERT_METRIC, SEMICOLON);
}
Q_UNREACHABLE();
return QStyle::PM_CustomBase;
#undef CONVERT_METRIC
}
static QStyleFacade::SubControl convertToQStyleFacadeSubControl(QStyle::SubControl sc)
{
#define CONVERT_SUBCONTROL(F, Value) \
case QStyle::F: return QStyleFacade::F
switch (sc) {
FOR_EACH_SUBCONTROL(CONVERT_SUBCONTROL, SEMICOLON);
}
Q_UNREACHABLE();
return QStyleFacade::SC_None;
#undef CONVERT_SUBCONTROL
}
QStyleFacadeImp::QStyleFacadeImp(QWebPageAdapter* page)
: m_page(page)
, m_style(0)
{
m_fallbackStyle = QStyleFactory::create(QLatin1String("windows"));
m_ownFallbackStyle = true;
if (!m_fallbackStyle) {
m_fallbackStyle = QApplication::style();
m_ownFallbackStyle = false;
}
}
QStyleFacadeImp::~QStyleFacadeImp()
{
if (m_ownFallbackStyle)
delete m_fallbackStyle;
}
QRect QStyleFacadeImp::buttonSubElementRect(QStyleFacade::ButtonSubElement buttonElement, State state, const QRect& originalRect) const
{
QStyleOptionButton option;
option.state = convertToQStyleState(state);
option.rect = originalRect;
QStyle::SubElement subElement = QStyle::SE_CustomBase;
switch (buttonElement) {
case PushButtonLayoutItem: subElement = QStyle::SE_PushButtonLayoutItem; break;
case PushButtonContents: subElement = QStyle::SE_PushButtonContents; break;
default: Q_UNREACHABLE();
}
return style()->subElementRect(subElement, &option);
}
int QStyleFacadeImp::findFrameLineWidth() const
{
if (!m_lineEdit)
m_lineEdit.reset(new QLineEdit());
return style()->pixelMetric(QStyle::PM_DefaultFrameWidth, 0, m_lineEdit.data());
}
int QStyleFacadeImp::simplePixelMetric(QStyleFacade::PixelMetric metric, State state) const
{
QStyleOption opt;
opt.state = convertToQStyleState(state);
return style()->pixelMetric(convertPixelMetric(metric), &opt, 0);
}
int QStyleFacadeImp::buttonMargin(State state, const QRect& originalRect) const
{
QStyleOptionButton styleOption;
styleOption.state = convertToQStyleState(state);
styleOption.rect = originalRect;
return style()->pixelMetric(QStyle::PM_ButtonMargin, &styleOption, 0);
}
int QStyleFacadeImp::sliderLength(Qt::Orientation orientation) const
{
QStyleOptionSlider opt;
opt.orientation = orientation;
return style()->pixelMetric(QStyle::PM_SliderLength, &opt);
}
int QStyleFacadeImp::sliderThickness(Qt::Orientation orientation) const
{
QStyleOptionSlider opt;
opt.orientation = orientation;
return style()->pixelMetric(QStyle::PM_SliderThickness, &opt);
}
int QStyleFacadeImp::progressBarChunkWidth(const QSize& size) const
{
QStyleOptionProgressBarV2 option;
option.rect.setSize(size);
// FIXME: Until http://bugreports.qt.nokia.com/browse/QTBUG-9171 is fixed,
// we simulate one square animating across the progress bar.
return style()->pixelMetric(QStyle::PM_ProgressBarChunkWidth, &option);
}
void QStyleFacadeImp::getButtonMetrics(QString *buttonFontFamily, int *buttonFontPixelSize) const
{
QPushButton button;
QFont defaultButtonFont = QApplication::font(&button);
*buttonFontFamily = defaultButtonFont.family();
*buttonFontPixelSize = 0;
#ifdef Q_OS_MAC
button.setAttribute(Qt::WA_MacSmallSize);
QFontInfo fontInfo(defaultButtonFont);
*buttonFontPixelSize = fontInfo.pixelSize();
#endif
}
QSize QStyleFacadeImp::comboBoxSizeFromContents(State state, const QSize& contentsSize) const
{
QStyleOptionComboBox opt;
opt.state = convertToQStyleState(state);
return style()->sizeFromContents(QStyle::CT_ComboBox, &opt, contentsSize);
}
QSize QStyleFacadeImp::pushButtonSizeFromContents(State state, const QSize& contentsSize) const
{
QStyleOptionButton opt;
opt.state = convertToQStyleState(state);
return style()->sizeFromContents(QStyle::CT_PushButton, &opt, contentsSize);
}
void QStyleFacadeImp::paintButton(QPainter* painter, QStyleFacade::ButtonType type, const QStyleFacadeOption &proxyOption)
{
QWidget* widget = qobject_cast<QWidget*>(widgetForPainter(painter));
MappedStyleOption<QStyleOptionButton> option(widget, proxyOption);
if (type == PushButton)
style()->drawControl(QStyle::CE_PushButton, &option, painter, widget);
else if (type == RadioButton)
style()->drawControl(QStyle::CE_RadioButton, &option, painter, widget);
else if (type == CheckBox)
style()->drawControl(QStyle::CE_CheckBox, &option, painter, widget);
}
void QStyleFacadeImp::paintTextField(QPainter *painter, const QStyleFacadeOption &proxyOption)
{
QWidget* widget = qobject_cast<QWidget*>(widgetForPainter(painter));
MappedStyleOption<QStyleOptionFrameV2> panel(widget, proxyOption);
panel.lineWidth = findFrameLineWidth();
panel.features = QStyleOptionFrameV2::None;
style()->drawPrimitive(QStyle::PE_PanelLineEdit, &panel, painter, widget);
}
void QStyleFacadeImp::paintComboBox(QPainter *painter, const QStyleFacadeOption &proxyOption)
{
QWidget* widget = qobject_cast<QWidget*>(widgetForPainter(painter));
MappedStyleOption<QStyleOptionComboBox> opt(widget, proxyOption);
QRect rect = opt.rect;
#if defined(Q_OS_MAC) && !defined(QT_NO_STYLE_MAC)
// QMacStyle makes the combo boxes a little bit smaller to leave space for the focus rect.
// Because of it, the combo button is drawn at a point to the left of where it was expect to be and may end up
// overlapped with the text. This will force QMacStyle to draw the combo box with the expected width.
if (m_style->inherits("QMacStyle")) {
rect.setX(rect.x() - 3);
rect.setWidth(rect.width() + 2 * 3);
}
#endif
painter->translate(rect.topLeft());
opt.rect.moveTo(QPoint(0, 0));
opt.rect.setSize(rect.size());
style()->drawComplexControl(QStyle::CC_ComboBox, &opt, painter, widget);
painter->translate(-rect.topLeft());
}
void QStyleFacadeImp::paintComboBoxArrow(QPainter *painter, const QStyleFacadeOption &proxyOption)
{
QWidget* widget = qobject_cast<QWidget*>(widgetForPainter(painter));
MappedStyleOption<QStyleOptionComboBox> opt(widget, proxyOption);
opt.subControls = QStyle::SC_ComboBoxArrow;
// for drawing the combo box arrow, rely only on the fallback style
m_fallbackStyle->drawComplexControl(QStyle::CC_ComboBox, &opt, painter, widget);
}
void QStyleFacadeImp::paintSliderTrack(QPainter* painter, const QStyleFacadeOption& proxyOption)
{
QWidget* widget = qobject_cast<QWidget*>(widgetForPainter(painter));
MappedStyleOption<QStyleOptionSlider> option(widget, proxyOption);
option.subControls = QStyle::SC_SliderGroove;
option.upsideDown = proxyOption.slider.upsideDown;
option.minimum = proxyOption.slider.minimum;
option.maximum = proxyOption.slider.maximum;
option.sliderPosition = proxyOption.slider.position;
option.orientation = proxyOption.slider.orientation;
style()->drawComplexControl(QStyle::CC_Slider, &option, painter, widget);
if (option.state & QStyle::State_HasFocus) {
QStyleOptionFocusRect focusOption;
focusOption.rect = option.rect;
style()->drawPrimitive(QStyle::PE_FrameFocusRect, &focusOption, painter, widget);
}
}
void QStyleFacadeImp::paintSliderThumb(QPainter* painter, const QStyleFacadeOption& proxyOption)
{
QWidget* widget = qobject_cast<QWidget*>(widgetForPainter(painter));
MappedStyleOption<QStyleOptionSlider> option(widget, proxyOption);
option.subControls = QStyle::SC_SliderHandle;
if (option.state & QStyle::State_Sunken)
option.activeSubControls = QStyle::SC_SliderHandle;
style()->drawComplexControl(QStyle::CC_Slider, &option, painter, widget);
}
void QStyleFacadeImp::paintInnerSpinButton(QPainter* painter, const QStyleFacadeOption& proxyOption, bool spinBoxUp)
{
QWidget* widget = qobject_cast<QWidget*>(widgetForPainter(painter));
MappedStyleOption<QStyleOptionSpinBox> option(widget, proxyOption);
option.subControls = QStyle::SC_SpinBoxUp | QStyle::SC_SpinBoxDown;
if (!(option.state & QStyle::State_ReadOnly)) {
if (option.state & QStyle::State_Enabled)
option.stepEnabled = QAbstractSpinBox::StepUpEnabled | QAbstractSpinBox::StepDownEnabled;
if (option.state & QStyle::State_Sunken) {
if (spinBoxUp)
option.activeSubControls = QStyle::SC_SpinBoxUp;
else
option.activeSubControls = QStyle::SC_SpinBoxDown;
}
}
QRect buttonRect = option.rect;
// Default to moving the buttons a little bit within the editor frame.
int inflateX = -2;
int inflateY = -2;
#if defined(Q_OS_MAC) && !defined(QT_NO_STYLE_MAC)
// QMacStyle will position the aqua buttons flush to the right.
// This will move them more within the control for better style, a la
// Chromium look & feel.
if (m_style->inherits("QMacStyle")) {
inflateX = -4;
// Render mini aqua spin buttons for QMacStyle to fit nicely into
// the editor area, like Chromium.
option.state |= QStyle::State_Mini;
}
#endif
buttonRect.setX(buttonRect.x() - inflateX);
buttonRect.setWidth(buttonRect.width() + 2 * inflateX);
buttonRect.setY(buttonRect.y() - inflateY);
buttonRect.setHeight(buttonRect.height() + 2 * inflateY);
option.rect = buttonRect;
style()->drawComplexControl(QStyle::CC_SpinBox, &option, painter, widget);
}
void QStyleFacadeImp::paintProgressBar(QPainter* painter, const QStyleFacadeOption& proxyOption, double progress, double animationProgress)
{
QWidget* widget = qobject_cast<QWidget*>(widgetForPainter(painter));
MappedStyleOption<QStyleOptionProgressBarV2> option(widget, proxyOption);
option.maximum = std::numeric_limits<int>::max();
option.minimum = 0;
option.progress = progress * std::numeric_limits<int>::max();
const QPoint topLeft = option.rect.topLeft();
painter->translate(topLeft);
option.rect.moveTo(QPoint(0, 0));
if (progress < 0) {
// FIXME: Until http://bugreports.qt.nokia.com/browse/QTBUG-9171 is fixed,
// we simulate one square animating across the progress bar.
style()->drawControl(QStyle::CE_ProgressBarGroove, &option, painter, widget);
int chunkWidth = style()->pixelMetric(QStyle::PM_ProgressBarChunkWidth, &option);
QColor color = (option.palette.highlight() == option.palette.background()) ? option.palette.color(QPalette::Active, QPalette::Highlight) : option.palette.color(QPalette::Highlight);
if (option.direction == Qt::RightToLeft)
painter->fillRect(option.rect.right() - chunkWidth - animationProgress * option.rect.width(), 0, chunkWidth, option.rect.height(), color);
else
painter->fillRect(animationProgress * option.rect.width(), 0, chunkWidth, option.rect.height(), color);
} else
style()->drawControl(QStyle::CE_ProgressBar, &option, painter, widget);
painter->translate(-topLeft);
}
int QStyleFacadeImp::scrollBarExtent(bool mini)
{
QStyleOptionSlider o;
o.orientation = Qt::Vertical;
o.state &= ~QStyle::State_Horizontal;
if (mini)
o.state |= QStyle::State_Mini;
return style()->pixelMetric(QStyle::PM_ScrollBarExtent, &o, 0);
}
bool QStyleFacadeImp::scrollBarMiddleClickAbsolutePositionStyleHint() const
{
return style()->styleHint(QStyle::SH_ScrollBar_MiddleClickAbsolutePosition);
}
void QStyleFacadeImp::paintScrollCorner(QPainter* painter, const QRect& rect)
{
QWidget* widget = qobject_cast<QWidget*>(widgetForPainter(painter));
QStyleOption option;
option.rect = rect;
style()->drawPrimitive(QStyle::PE_PanelScrollAreaCorner, &option, painter, widget);
}
QStyleFacade::SubControl QStyleFacadeImp::hitTestScrollBar(const QStyleFacadeOption &proxyOption, const QPoint &pos)
{
MappedStyleOption<QStyleOptionSlider> opt(0, proxyOption);
QStyle::SubControl sc = style()->hitTestComplexControl(QStyle::CC_ScrollBar, &opt, pos, 0);
return convertToQStyleFacadeSubControl(sc);
}
QRect QStyleFacadeImp::scrollBarSubControlRect(const QStyleFacadeOption &proxyOption, QStyleFacade::SubControl subControl)
{
MappedStyleOption<QStyleOptionSlider> opt(0, proxyOption);
return style()->subControlRect(QStyle::CC_ScrollBar, &opt, convertToQStyleSubControl(subControl), 0);
}
void QStyleFacadeImp::paintScrollBar(QPainter *painter, const QStyleFacadeOption &proxyOption)
{
QWidget* widget = qobject_cast<QWidget*>(widgetForPainter(painter));
MappedStyleOption<QStyleOptionSlider> opt(widget, proxyOption);
if (m_style->inherits("QMacStyle")) {
// FIXME: Disable transient scrollbar animations on OSX to avoid hiding the whole webview with the scrollbar fade out animation.
opt.styleObject = 0;
}
painter->fillRect(opt.rect, opt.palette.background());
const QPoint topLeft = opt.rect.topLeft();
painter->translate(topLeft);
opt.rect.moveTo(QPoint(0, 0));
style()->drawComplexControl(QStyle::CC_ScrollBar, &opt, painter, widget);
opt.rect.moveTo(topLeft);
}
QObject* QStyleFacadeImp::widgetForPainter(QPainter* painter)
{
QPaintDevice* dev = 0;
if (painter)
dev = painter->device();
if (dev && dev->devType() == QInternal::Widget)
return static_cast<QWidget*>(dev);
return 0;
}
QStyle* QStyleFacadeImp::style() const
{
if (m_style)
return m_style;
if (m_page) {
if (QWebPageClient* pageClient = m_page->client.data())
m_style = pageClient->style();
}
if (!m_style)
m_style = QApplication::style();
return m_style;
}
}
| [
"annulen@yandex.ru"
] | annulen@yandex.ru |
da7d5e4efd445a47c152d7c64bf8d3bdd79ce917 | 09c2ba193806628b014f1090eb9a4f184110d9bb | /depotlocker.cpp | 0d438cd403fbccfd8f8c539e73da4208bbd45f02 | [] | no_license | UnsineSoft/TheImaginedServer | 5a1b09806a41546d4eec26d00f7170d1516e4004 | c78c89d321bb4a051127186548843ebcb7497035 | refs/heads/master | 2021-01-24T20:58:41.676305 | 2014-03-25T02:17:19 | 2014-03-25T02:17:19 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,477 | cpp | //////////////////////////////////////////////////////////////////////
// OpenTibia - an opensource roleplaying game
//////////////////////////////////////////////////////////////////////
//
//////////////////////////////////////////////////////////////////////
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software Foundation,
// Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//////////////////////////////////////////////////////////////////////
#include "otpch.h"
#include "depotlocker.h"
#include "tools.h"
DepotLocker::DepotLocker(uint16_t _type) :
Container(_type)
{
maxSize = 3;
}
DepotLocker::~DepotLocker()
{
//
}
Attr_ReadValue DepotLocker::readAttr(AttrTypes_t attr, PropStream& propStream)
{
if(attr != ATTR_DEPOT_ID)
return Item::readAttr(attr, propStream);
uint16_t depotId;
if(!propStream.getShort(depotId))
return ATTR_READ_ERROR;
setAttribute("depotid", depotId);
return ATTR_READ_CONTINUE;
}
ReturnValue DepotLocker::__queryAdd(int32_t index, const Thing* thing, uint32_t count,
uint32_t flags, Creature* actor/* = NULL*/) const
{
return Container::__queryAdd(index, thing, count, flags, actor);
}
void DepotLocker::postAddNotification(Creature* actor, Thing* thing, const Cylinder* oldParent, int32_t index, CylinderLink_t /*link = LINK_OWNER*/)
{
if(getParent())
getParent()->postAddNotification(actor, thing, oldParent, index, LINK_PARENT);
}
void DepotLocker::postRemoveNotification(Creature* actor, Thing* thing, const Cylinder* newParent, int32_t index, bool isCompleteRemoval, CylinderLink_t /*link = LINK_OWNER*/)
{
if(getParent())
getParent()->postRemoveNotification(actor, thing, newParent, index, isCompleteRemoval, LINK_PARENT);
}
void DepotLocker::removeInbox(Inbox* inbox)
{
ItemList::iterator cit = std::find(itemlist.begin(), itemlist.end(), inbox);
if(cit == itemlist.end())
return;
itemlist.erase(cit);
}
| [
"patman57@gmail.com"
] | patman57@gmail.com |
531a161257e59c93e70149173e31799d121bb93c | 3480576fb99c23fd9e0923b7779aacf79cc8d715 | /test1/8.cpp | e1d008c43e0d731fd5a974cf1983d6d2faa15db5 | [] | no_license | podobry-m/2sem | 0ee7dbb46fe123cff51d44696499ae56f25f0c8f | 96f3f2ebf9e004190a9620f2b610810194a37f00 | refs/heads/master | 2023-04-26T12:15:08.127371 | 2021-05-22T14:45:16 | 2021-05-22T14:45:16 | 337,356,595 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 298 | cpp | void fix_list(BehaviorPattern *root)
{
BehaviorPattern *t = root;
if (root != NULL)
{
root->prev = NULL;
do
{
if (t->next == NULL)
break;
(t->next)->prev = t;
t = t->next;
} while (t != root);
}
}
| [
"podobrii.ma@phystech.edu"
] | podobrii.ma@phystech.edu |
f2ca57acd8c2b09eb1f35848190c799adb978035 | 110eaf9fdd50707f8ae6aefb88ba54e5a3fd8cd1 | /workspace/webrtc/api/peer_connection_interface.h | 17d9004eb252b7a0337de92b88946e1b3f7ee75a | [] | no_license | DaHuMao/gn-build-workspace | 9d6047a80863d94bb8c39f62c217ecacf109eabb | e99582662cf912638bd703b0cc5887e6c3c44ec2 | refs/heads/main | 2023-07-15T11:41:54.189847 | 2021-08-29T04:50:54 | 2021-08-29T04:50:54 | 375,058,361 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 70,775 | h | /*
* Copyright 2012 The WebRTC 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 in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
// This file contains the PeerConnection interface as defined in
// https://w3c.github.io/webrtc-pc/#peer-to-peer-connections
//
// The PeerConnectionFactory class provides factory methods to create
// PeerConnection, MediaStream and MediaStreamTrack objects.
//
// The following steps are needed to setup a typical call using WebRTC:
//
// 1. Create a PeerConnectionFactoryInterface. Check constructors for more
// information about input parameters.
//
// 2. Create a PeerConnection object. Provide a configuration struct which
// points to STUN and/or TURN servers used to generate ICE candidates, and
// provide an object that implements the PeerConnectionObserver interface,
// which is used to receive callbacks from the PeerConnection.
//
// 3. Create local MediaStreamTracks using the PeerConnectionFactory and add
// them to PeerConnection by calling AddTrack (or legacy method, AddStream).
//
// 4. Create an offer, call SetLocalDescription with it, serialize it, and send
// it to the remote peer
//
// 5. Once an ICE candidate has been gathered, the PeerConnection will call the
// observer function OnIceCandidate. The candidates must also be serialized and
// sent to the remote peer.
//
// 6. Once an answer is received from the remote peer, call
// SetRemoteDescription with the remote answer.
//
// 7. Once a remote candidate is received from the remote peer, provide it to
// the PeerConnection by calling AddIceCandidate.
//
// The receiver of a call (assuming the application is "call"-based) can decide
// to accept or reject the call; this decision will be taken by the application,
// not the PeerConnection.
//
// If the application decides to accept the call, it should:
//
// 1. Create PeerConnectionFactoryInterface if it doesn't exist.
//
// 2. Create a new PeerConnection.
//
// 3. Provide the remote offer to the new PeerConnection object by calling
// SetRemoteDescription.
//
// 4. Generate an answer to the remote offer by calling CreateAnswer and send it
// back to the remote peer.
//
// 5. Provide the local answer to the new PeerConnection by calling
// SetLocalDescription with the answer.
//
// 6. Provide the remote ICE candidates by calling AddIceCandidate.
//
// 7. Once a candidate has been gathered, the PeerConnection will call the
// observer function OnIceCandidate. Send these candidates to the remote peer.
#ifndef API_PEER_CONNECTION_INTERFACE_H_
#define API_PEER_CONNECTION_INTERFACE_H_
#include <stdio.h>
#include <memory>
#include <string>
#include <vector>
#include "api/adaptation/resource.h"
#include "api/async_dns_resolver.h"
#include "api/async_resolver_factory.h"
#include "api/audio/audio_mixer.h"
#include "api/audio_codecs/audio_decoder_factory.h"
#include "api/audio_codecs/audio_encoder_factory.h"
#include "api/audio_options.h"
#include "api/call/call_factory_interface.h"
#include "api/crypto/crypto_options.h"
#include "api/data_channel_interface.h"
#include "api/dtls_transport_interface.h"
#include "api/fec_controller.h"
#include "api/ice_transport_interface.h"
#include "api/jsep.h"
#include "api/media_stream_interface.h"
#include "api/neteq/neteq_factory.h"
#include "api/network_state_predictor.h"
#include "api/packet_socket_factory.h"
#include "api/rtc_error.h"
#include "api/rtc_event_log/rtc_event_log_factory_interface.h"
#include "api/rtc_event_log_output.h"
#include "api/rtp_receiver_interface.h"
#include "api/rtp_sender_interface.h"
#include "api/rtp_transceiver_interface.h"
#include "api/sctp_transport_interface.h"
#include "api/set_local_description_observer_interface.h"
#include "api/set_remote_description_observer_interface.h"
#include "api/stats/rtc_stats_collector_callback.h"
#include "api/stats_types.h"
#include "api/task_queue/task_queue_factory.h"
#include "api/transport/bitrate_settings.h"
#include "api/transport/enums.h"
#include "api/transport/network_control.h"
#include "api/transport/sctp_transport_factory_interface.h"
#include "api/transport/webrtc_key_value_config.h"
#include "api/turn_customizer.h"
#include "media/base/media_config.h"
#include "media/base/media_engine.h"
// TODO(bugs.webrtc.org/7447): We plan to provide a way to let applications
// inject a PacketSocketFactory and/or NetworkManager, and not expose
// PortAllocator in the PeerConnection api.
#include "p2p/base/port_allocator.h" // nogncheck
#include "rtc_base/network_monitor_factory.h"
#include "rtc_base/rtc_certificate.h"
#include "rtc_base/rtc_certificate_generator.h"
#include "rtc_base/socket_address.h"
#include "rtc_base/ssl_certificate.h"
#include "rtc_base/ssl_stream_adapter.h"
#include "rtc_base/system/rtc_export.h"
namespace rtc {
class Thread;
} // namespace rtc
namespace webrtc {
// MediaStream container interface.
class StreamCollectionInterface : public rtc::RefCountInterface {
public:
// TODO(ronghuawu): Update the function names to c++ style, e.g. find -> Find.
virtual size_t count() = 0;
virtual MediaStreamInterface* at(size_t index) = 0;
virtual MediaStreamInterface* find(const std::string& label) = 0;
virtual MediaStreamTrackInterface* FindAudioTrack(const std::string& id) = 0;
virtual MediaStreamTrackInterface* FindVideoTrack(const std::string& id) = 0;
protected:
// Dtor protected as objects shouldn't be deleted via this interface.
~StreamCollectionInterface() override = default;
};
class StatsObserver : public rtc::RefCountInterface {
public:
virtual void OnComplete(const StatsReports& reports) = 0;
protected:
~StatsObserver() override = default;
};
enum class SdpSemantics { kPlanB, kUnifiedPlan };
class RTC_EXPORT PeerConnectionInterface : public rtc::RefCountInterface {
public:
// See https://w3c.github.io/webrtc-pc/#dom-rtcsignalingstate
enum SignalingState {
kStable,
kHaveLocalOffer,
kHaveLocalPrAnswer,
kHaveRemoteOffer,
kHaveRemotePrAnswer,
kClosed,
};
// See https://w3c.github.io/webrtc-pc/#dom-rtcicegatheringstate
enum IceGatheringState {
kIceGatheringNew,
kIceGatheringGathering,
kIceGatheringComplete
};
// See https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnectionstate
enum class PeerConnectionState {
kNew,
kConnecting,
kConnected,
kDisconnected,
kFailed,
kClosed,
};
// See https://w3c.github.io/webrtc-pc/#dom-rtciceconnectionstate
enum IceConnectionState {
kIceConnectionNew,
kIceConnectionChecking,
kIceConnectionConnected,
kIceConnectionCompleted,
kIceConnectionFailed,
kIceConnectionDisconnected,
kIceConnectionClosed,
kIceConnectionMax,
};
// TLS certificate policy.
enum TlsCertPolicy {
// For TLS based protocols, ensure the connection is secure by not
// circumventing certificate validation.
kTlsCertPolicySecure,
// For TLS based protocols, disregard security completely by skipping
// certificate validation. This is insecure and should never be used unless
// security is irrelevant in that particular context.
kTlsCertPolicyInsecureNoCheck,
};
struct RTC_EXPORT IceServer {
IceServer();
IceServer(const IceServer&);
~IceServer();
// TODO(jbauch): Remove uri when all code using it has switched to urls.
// List of URIs associated with this server. Valid formats are described
// in RFC7064 and RFC7065, and more may be added in the future. The "host"
// part of the URI may contain either an IP address or a hostname.
std::string uri;
std::vector<std::string> urls;
std::string username;
std::string password;
TlsCertPolicy tls_cert_policy = kTlsCertPolicySecure;
// If the URIs in |urls| only contain IP addresses, this field can be used
// to indicate the hostname, which may be necessary for TLS (using the SNI
// extension). If |urls| itself contains the hostname, this isn't
// necessary.
std::string hostname;
// List of protocols to be used in the TLS ALPN extension.
std::vector<std::string> tls_alpn_protocols;
// List of elliptic curves to be used in the TLS elliptic curves extension.
std::vector<std::string> tls_elliptic_curves;
bool operator==(const IceServer& o) const {
return uri == o.uri && urls == o.urls && username == o.username &&
password == o.password && tls_cert_policy == o.tls_cert_policy &&
hostname == o.hostname &&
tls_alpn_protocols == o.tls_alpn_protocols &&
tls_elliptic_curves == o.tls_elliptic_curves;
}
bool operator!=(const IceServer& o) const { return !(*this == o); }
};
typedef std::vector<IceServer> IceServers;
enum IceTransportsType {
// TODO(pthatcher): Rename these kTransporTypeXXX, but update
// Chromium at the same time.
kNone,
kRelay,
kNoHost,
kAll
};
// https://tools.ietf.org/html/draft-ietf-rtcweb-jsep-24#section-4.1.1
enum BundlePolicy {
kBundlePolicyBalanced,
kBundlePolicyMaxBundle,
kBundlePolicyMaxCompat
};
// https://tools.ietf.org/html/draft-ietf-rtcweb-jsep-24#section-4.1.1
enum RtcpMuxPolicy {
kRtcpMuxPolicyNegotiate,
kRtcpMuxPolicyRequire,
};
enum TcpCandidatePolicy {
kTcpCandidatePolicyEnabled,
kTcpCandidatePolicyDisabled
};
enum CandidateNetworkPolicy {
kCandidateNetworkPolicyAll,
kCandidateNetworkPolicyLowCost
};
enum ContinualGatheringPolicy { GATHER_ONCE, GATHER_CONTINUALLY };
enum class RTCConfigurationType {
// A configuration that is safer to use, despite not having the best
// performance. Currently this is the default configuration.
kSafe,
// An aggressive configuration that has better performance, although it
// may be riskier and may need extra support in the application.
kAggressive
};
// TODO(hbos): Change into class with private data and public getters.
// TODO(nisse): In particular, accessing fields directly from an
// application is brittle, since the organization mirrors the
// organization of the implementation, which isn't stable. So we
// need getters and setters at least for fields which applications
// are interested in.
struct RTC_EXPORT RTCConfiguration {
// This struct is subject to reorganization, both for naming
// consistency, and to group settings to match where they are used
// in the implementation. To do that, we need getter and setter
// methods for all settings which are of interest to applications,
// Chrome in particular.
RTCConfiguration();
RTCConfiguration(const RTCConfiguration&);
explicit RTCConfiguration(RTCConfigurationType type);
~RTCConfiguration();
bool operator==(const RTCConfiguration& o) const;
bool operator!=(const RTCConfiguration& o) const;
bool dscp() const { return media_config.enable_dscp; }
void set_dscp(bool enable) { media_config.enable_dscp = enable; }
bool cpu_adaptation() const {
return media_config.video.enable_cpu_adaptation;
}
void set_cpu_adaptation(bool enable) {
media_config.video.enable_cpu_adaptation = enable;
}
bool suspend_below_min_bitrate() const {
return media_config.video.suspend_below_min_bitrate;
}
void set_suspend_below_min_bitrate(bool enable) {
media_config.video.suspend_below_min_bitrate = enable;
}
bool prerenderer_smoothing() const {
return media_config.video.enable_prerenderer_smoothing;
}
void set_prerenderer_smoothing(bool enable) {
media_config.video.enable_prerenderer_smoothing = enable;
}
bool experiment_cpu_load_estimator() const {
return media_config.video.experiment_cpu_load_estimator;
}
void set_experiment_cpu_load_estimator(bool enable) {
media_config.video.experiment_cpu_load_estimator = enable;
}
int audio_rtcp_report_interval_ms() const {
return media_config.audio.rtcp_report_interval_ms;
}
void set_audio_rtcp_report_interval_ms(int audio_rtcp_report_interval_ms) {
media_config.audio.rtcp_report_interval_ms =
audio_rtcp_report_interval_ms;
}
int video_rtcp_report_interval_ms() const {
return media_config.video.rtcp_report_interval_ms;
}
void set_video_rtcp_report_interval_ms(int video_rtcp_report_interval_ms) {
media_config.video.rtcp_report_interval_ms =
video_rtcp_report_interval_ms;
}
static const int kUndefined = -1;
// Default maximum number of packets in the audio jitter buffer.
static const int kAudioJitterBufferMaxPackets = 200;
// ICE connection receiving timeout for aggressive configuration.
static const int kAggressiveIceConnectionReceivingTimeout = 1000;
////////////////////////////////////////////////////////////////////////
// The below few fields mirror the standard RTCConfiguration dictionary:
// https://w3c.github.io/webrtc-pc/#rtcconfiguration-dictionary
////////////////////////////////////////////////////////////////////////
// TODO(pthatcher): Rename this ice_servers, but update Chromium
// at the same time.
IceServers servers;
// TODO(pthatcher): Rename this ice_transport_type, but update
// Chromium at the same time.
IceTransportsType type = kAll;
BundlePolicy bundle_policy = kBundlePolicyBalanced;
RtcpMuxPolicy rtcp_mux_policy = kRtcpMuxPolicyRequire;
std::vector<rtc::scoped_refptr<rtc::RTCCertificate>> certificates;
int ice_candidate_pool_size = 0;
//////////////////////////////////////////////////////////////////////////
// The below fields correspond to constraints from the deprecated
// constraints interface for constructing a PeerConnection.
//
// absl::optional fields can be "missing", in which case the implementation
// default will be used.
//////////////////////////////////////////////////////////////////////////
// If set to true, don't gather IPv6 ICE candidates.
// TODO(deadbeef): Remove this? IPv6 support has long stopped being
// experimental
bool disable_ipv6 = false;
// If set to true, don't gather IPv6 ICE candidates on Wi-Fi.
// Only intended to be used on specific devices. Certain phones disable IPv6
// when the screen is turned off and it would be better to just disable the
// IPv6 ICE candidates on Wi-Fi in those cases.
bool disable_ipv6_on_wifi = false;
// By default, the PeerConnection will use a limited number of IPv6 network
// interfaces, in order to avoid too many ICE candidate pairs being created
// and delaying ICE completion.
//
// Can be set to INT_MAX to effectively disable the limit.
int max_ipv6_networks = cricket::kDefaultMaxIPv6Networks;
// Exclude link-local network interfaces
// from consideration for gathering ICE candidates.
bool disable_link_local_networks = false;
// If set to true, use RTP data channels instead of SCTP.
// TODO(deadbeef): Remove this. We no longer commit to supporting RTP data
// channels, though some applications are still working on moving off of
// them.
bool enable_rtp_data_channel = false;
// Minimum bitrate at which screencast video tracks will be encoded at.
// This means adding padding bits up to this bitrate, which can help
// when switching from a static scene to one with motion.
absl::optional<int> screencast_min_bitrate;
// Use new combined audio/video bandwidth estimation?
absl::optional<bool> combined_audio_video_bwe;
// TODO(bugs.webrtc.org/9891) - Move to crypto_options
// Can be used to disable DTLS-SRTP. This should never be done, but can be
// useful for testing purposes, for example in setting up a loopback call
// with a single PeerConnection.
absl::optional<bool> enable_dtls_srtp;
/////////////////////////////////////////////////
// The below fields are not part of the standard.
/////////////////////////////////////////////////
// Can be used to disable TCP candidate generation.
TcpCandidatePolicy tcp_candidate_policy = kTcpCandidatePolicyEnabled;
// Can be used to avoid gathering candidates for a "higher cost" network,
// if a lower cost one exists. For example, if both Wi-Fi and cellular
// interfaces are available, this could be used to avoid using the cellular
// interface.
CandidateNetworkPolicy candidate_network_policy =
kCandidateNetworkPolicyAll;
// The maximum number of packets that can be stored in the NetEq audio
// jitter buffer. Can be reduced to lower tolerated audio latency.
int audio_jitter_buffer_max_packets = kAudioJitterBufferMaxPackets;
// Whether to use the NetEq "fast mode" which will accelerate audio quicker
// if it falls behind.
bool audio_jitter_buffer_fast_accelerate = false;
// The minimum delay in milliseconds for the audio jitter buffer.
int audio_jitter_buffer_min_delay_ms = 0;
// Whether the audio jitter buffer adapts the delay to retransmitted
// packets.
bool audio_jitter_buffer_enable_rtx_handling = false;
// Timeout in milliseconds before an ICE candidate pair is considered to be
// "not receiving", after which a lower priority candidate pair may be
// selected.
int ice_connection_receiving_timeout = kUndefined;
// Interval in milliseconds at which an ICE "backup" candidate pair will be
// pinged. This is a candidate pair which is not actively in use, but may
// be switched to if the active candidate pair becomes unusable.
//
// This is relevant mainly to Wi-Fi/cell handoff; the application may not
// want this backup cellular candidate pair pinged frequently, since it
// consumes data/battery.
int ice_backup_candidate_pair_ping_interval = kUndefined;
// Can be used to enable continual gathering, which means new candidates
// will be gathered as network interfaces change. Note that if continual
// gathering is used, the candidate removal API should also be used, to
// avoid an ever-growing list of candidates.
ContinualGatheringPolicy continual_gathering_policy = GATHER_ONCE;
// If set to true, candidate pairs will be pinged in order of most likely
// to work (which means using a TURN server, generally), rather than in
// standard priority order.
bool prioritize_most_likely_ice_candidate_pairs = false;
// Implementation defined settings. A public member only for the benefit of
// the implementation. Applications must not access it directly, and should
// instead use provided accessor methods, e.g., set_cpu_adaptation.
struct cricket::MediaConfig media_config;
// If set to true, only one preferred TURN allocation will be used per
// network interface. UDP is preferred over TCP and IPv6 over IPv4. This
// can be used to cut down on the number of candidate pairings.
// Deprecated. TODO(webrtc:11026) Remove this flag once the downstream
// dependency is removed.
bool prune_turn_ports = false;
// The policy used to prune turn port.
PortPrunePolicy turn_port_prune_policy = NO_PRUNE;
PortPrunePolicy GetTurnPortPrunePolicy() const {
return prune_turn_ports ? PRUNE_BASED_ON_PRIORITY
: turn_port_prune_policy;
}
// If set to true, this means the ICE transport should presume TURN-to-TURN
// candidate pairs will succeed, even before a binding response is received.
// This can be used to optimize the initial connection time, since the DTLS
// handshake can begin immediately.
bool presume_writable_when_fully_relayed = false;
// If true, "renomination" will be added to the ice options in the transport
// description.
// See: https://tools.ietf.org/html/draft-thatcher-ice-renomination-00
bool enable_ice_renomination = false;
// If true, the ICE role is re-determined when the PeerConnection sets a
// local transport description that indicates an ICE restart.
//
// This is standard RFC5245 ICE behavior, but causes unnecessary role
// thrashing, so an application may wish to avoid it. This role
// re-determining was removed in ICEbis (ICE v2).
bool redetermine_role_on_ice_restart = true;
// This flag is only effective when |continual_gathering_policy| is
// GATHER_CONTINUALLY.
//
// If true, after the ICE transport type is changed such that new types of
// ICE candidates are allowed by the new transport type, e.g. from
// IceTransportsType::kRelay to IceTransportsType::kAll, candidates that
// have been gathered by the ICE transport but not matching the previous
// transport type and as a result not observed by PeerConnectionObserver,
// will be surfaced to the observer.
bool surface_ice_candidates_on_ice_transport_type_changed = false;
// The following fields define intervals in milliseconds at which ICE
// connectivity checks are sent.
//
// We consider ICE is "strongly connected" for an agent when there is at
// least one candidate pair that currently succeeds in connectivity check
// from its direction i.e. sending a STUN ping and receives a STUN ping
// response, AND all candidate pairs have sent a minimum number of pings for
// connectivity (this number is implementation-specific). Otherwise, ICE is
// considered in "weak connectivity".
//
// Note that the above notion of strong and weak connectivity is not defined
// in RFC 5245, and they apply to our current ICE implementation only.
//
// 1) ice_check_interval_strong_connectivity defines the interval applied to
// ALL candidate pairs when ICE is strongly connected, and it overrides the
// default value of this interval in the ICE implementation;
// 2) ice_check_interval_weak_connectivity defines the counterpart for ALL
// pairs when ICE is weakly connected, and it overrides the default value of
// this interval in the ICE implementation;
// 3) ice_check_min_interval defines the minimal interval (equivalently the
// maximum rate) that overrides the above two intervals when either of them
// is less.
absl::optional<int> ice_check_interval_strong_connectivity;
absl::optional<int> ice_check_interval_weak_connectivity;
absl::optional<int> ice_check_min_interval;
// The min time period for which a candidate pair must wait for response to
// connectivity checks before it becomes unwritable. This parameter
// overrides the default value in the ICE implementation if set.
absl::optional<int> ice_unwritable_timeout;
// The min number of connectivity checks that a candidate pair must sent
// without receiving response before it becomes unwritable. This parameter
// overrides the default value in the ICE implementation if set.
absl::optional<int> ice_unwritable_min_checks;
// The min time period for which a candidate pair must wait for response to
// connectivity checks it becomes inactive. This parameter overrides the
// default value in the ICE implementation if set.
absl::optional<int> ice_inactive_timeout;
// The interval in milliseconds at which STUN candidates will resend STUN
// binding requests to keep NAT bindings open.
absl::optional<int> stun_candidate_keepalive_interval;
// Optional TurnCustomizer.
// With this class one can modify outgoing TURN messages.
// The object passed in must remain valid until PeerConnection::Close() is
// called.
webrtc::TurnCustomizer* turn_customizer = nullptr;
// Preferred network interface.
// A candidate pair on a preferred network has a higher precedence in ICE
// than one on an un-preferred network, regardless of priority or network
// cost.
absl::optional<rtc::AdapterType> network_preference;
// Configure the SDP semantics used by this PeerConnection. Note that the
// WebRTC 1.0 specification requires kUnifiedPlan semantics. The
// RtpTransceiver API is only available with kUnifiedPlan semantics.
//
// kPlanB will cause PeerConnection to create offers and answers with at
// most one audio and one video m= section with multiple RtpSenders and
// RtpReceivers specified as multiple a=ssrc lines within the section. This
// will also cause PeerConnection to ignore all but the first m= section of
// the same media type.
//
// kUnifiedPlan will cause PeerConnection to create offers and answers with
// multiple m= sections where each m= section maps to one RtpSender and one
// RtpReceiver (an RtpTransceiver), either both audio or both video. This
// will also cause PeerConnection to ignore all but the first a=ssrc lines
// that form a Plan B stream.
//
// For users who wish to send multiple audio/video streams and need to stay
// interoperable with legacy WebRTC implementations or use legacy APIs,
// specify kPlanB.
//
// For all other users, specify kUnifiedPlan.
SdpSemantics sdp_semantics = SdpSemantics::kPlanB;
// TODO(bugs.webrtc.org/9891) - Move to crypto_options or remove.
// Actively reset the SRTP parameters whenever the DTLS transports
// underneath are reset for every offer/answer negotiation.
// This is only intended to be a workaround for crbug.com/835958
// WARNING: This would cause RTP/RTCP packets decryption failure if not used
// correctly. This flag will be deprecated soon. Do not rely on it.
bool active_reset_srtp_params = false;
// Defines advanced optional cryptographic settings related to SRTP and
// frame encryption for native WebRTC. Setting this will overwrite any
// settings set in PeerConnectionFactory (which is deprecated).
absl::optional<CryptoOptions> crypto_options;
// Configure if we should include the SDP attribute extmap-allow-mixed in
// our offer on session level.
bool offer_extmap_allow_mixed = true;
// TURN logging identifier.
// This identifier is added to a TURN allocation
// and it intended to be used to be able to match client side
// logs with TURN server logs. It will not be added if it's an empty string.
std::string turn_logging_id;
// Added to be able to control rollout of this feature.
bool enable_implicit_rollback = false;
// Whether network condition based codec switching is allowed.
absl::optional<bool> allow_codec_switching;
// The delay before doing a usage histogram report for long-lived
// PeerConnections. Used for testing only.
absl::optional<int> report_usage_pattern_delay_ms;
//
// Don't forget to update operator== if adding something.
//
};
// See: https://www.w3.org/TR/webrtc/#idl-def-rtcofferansweroptions
struct RTCOfferAnswerOptions {
static const int kUndefined = -1;
static const int kMaxOfferToReceiveMedia = 1;
// The default value for constraint offerToReceiveX:true.
static const int kOfferToReceiveMediaTrue = 1;
// These options are left as backwards compatibility for clients who need
// "Plan B" semantics. Clients who have switched to "Unified Plan" semantics
// should use the RtpTransceiver API (AddTransceiver) instead.
//
// offer_to_receive_X set to 1 will cause a media description to be
// generated in the offer, even if no tracks of that type have been added.
// Values greater than 1 are treated the same.
//
// If set to 0, the generated directional attribute will not include the
// "recv" direction (meaning it will be "sendonly" or "inactive".
int offer_to_receive_video = kUndefined;
int offer_to_receive_audio = kUndefined;
bool voice_activity_detection = true;
bool ice_restart = false;
// If true, will offer to BUNDLE audio/video/data together. Not to be
// confused with RTCP mux (multiplexing RTP and RTCP together).
bool use_rtp_mux = true;
// If true, "a=packetization:<payload_type> raw" attribute will be offered
// in the SDP for all video payload and accepted in the answer if offered.
bool raw_packetization_for_video = false;
// This will apply to all video tracks with a Plan B SDP offer/answer.
int num_simulcast_layers = 1;
// If true: Use SDP format from draft-ietf-mmusic-scdp-sdp-03
// If false: Use SDP format from draft-ietf-mmusic-sdp-sdp-26 or later
bool use_obsolete_sctp_sdp = false;
RTCOfferAnswerOptions() = default;
RTCOfferAnswerOptions(int offer_to_receive_video,
int offer_to_receive_audio,
bool voice_activity_detection,
bool ice_restart,
bool use_rtp_mux)
: offer_to_receive_video(offer_to_receive_video),
offer_to_receive_audio(offer_to_receive_audio),
voice_activity_detection(voice_activity_detection),
ice_restart(ice_restart),
use_rtp_mux(use_rtp_mux) {}
};
// Used by GetStats to decide which stats to include in the stats reports.
// |kStatsOutputLevelStandard| includes the standard stats for Javascript API;
// |kStatsOutputLevelDebug| includes both the standard stats and additional
// stats for debugging purposes.
enum StatsOutputLevel {
kStatsOutputLevelStandard,
kStatsOutputLevelDebug,
};
// Accessor methods to active local streams.
// This method is not supported with kUnifiedPlan semantics. Please use
// GetSenders() instead.
virtual rtc::scoped_refptr<StreamCollectionInterface> local_streams() = 0;
// Accessor methods to remote streams.
// This method is not supported with kUnifiedPlan semantics. Please use
// GetReceivers() instead.
virtual rtc::scoped_refptr<StreamCollectionInterface> remote_streams() = 0;
// Add a new MediaStream to be sent on this PeerConnection.
// Note that a SessionDescription negotiation is needed before the
// remote peer can receive the stream.
//
// This has been removed from the standard in favor of a track-based API. So,
// this is equivalent to simply calling AddTrack for each track within the
// stream, with the one difference that if "stream->AddTrack(...)" is called
// later, the PeerConnection will automatically pick up the new track. Though
// this functionality will be deprecated in the future.
//
// This method is not supported with kUnifiedPlan semantics. Please use
// AddTrack instead.
virtual bool AddStream(MediaStreamInterface* stream) = 0;
// Remove a MediaStream from this PeerConnection.
// Note that a SessionDescription negotiation is needed before the
// remote peer is notified.
//
// This method is not supported with kUnifiedPlan semantics. Please use
// RemoveTrack instead.
virtual void RemoveStream(MediaStreamInterface* stream) = 0;
// Add a new MediaStreamTrack to be sent on this PeerConnection, and return
// the newly created RtpSender. The RtpSender will be associated with the
// streams specified in the |stream_ids| list.
//
// Errors:
// - INVALID_PARAMETER: |track| is null, has a kind other than audio or video,
// or a sender already exists for the track.
// - INVALID_STATE: The PeerConnection is closed.
virtual RTCErrorOr<rtc::scoped_refptr<RtpSenderInterface>> AddTrack(
rtc::scoped_refptr<MediaStreamTrackInterface> track,
const std::vector<std::string>& stream_ids) = 0;
// Remove an RtpSender from this PeerConnection.
// Returns true on success.
// TODO(steveanton): Replace with signature that returns RTCError.
virtual bool RemoveTrack(RtpSenderInterface* sender) = 0;
// Plan B semantics: Removes the RtpSender from this PeerConnection.
// Unified Plan semantics: Stop sending on the RtpSender and mark the
// corresponding RtpTransceiver direction as no longer sending.
//
// Errors:
// - INVALID_PARAMETER: |sender| is null or (Plan B only) the sender is not
// associated with this PeerConnection.
// - INVALID_STATE: PeerConnection is closed.
// TODO(bugs.webrtc.org/9534): Rename to RemoveTrack once the other signature
// is removed.
virtual RTCError RemoveTrackNew(
rtc::scoped_refptr<RtpSenderInterface> sender);
// AddTransceiver creates a new RtpTransceiver and adds it to the set of
// transceivers. Adding a transceiver will cause future calls to CreateOffer
// to add a media description for the corresponding transceiver.
//
// The initial value of |mid| in the returned transceiver is null. Setting a
// new session description may change it to a non-null value.
//
// https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnection-addtransceiver
//
// Optionally, an RtpTransceiverInit structure can be specified to configure
// the transceiver from construction. If not specified, the transceiver will
// default to having a direction of kSendRecv and not be part of any streams.
//
// These methods are only available when Unified Plan is enabled (see
// RTCConfiguration).
//
// Common errors:
// - INTERNAL_ERROR: The configuration does not have Unified Plan enabled.
// Adds a transceiver with a sender set to transmit the given track. The kind
// of the transceiver (and sender/receiver) will be derived from the kind of
// the track.
// Errors:
// - INVALID_PARAMETER: |track| is null.
virtual RTCErrorOr<rtc::scoped_refptr<RtpTransceiverInterface>>
AddTransceiver(rtc::scoped_refptr<MediaStreamTrackInterface> track) = 0;
virtual RTCErrorOr<rtc::scoped_refptr<RtpTransceiverInterface>>
AddTransceiver(rtc::scoped_refptr<MediaStreamTrackInterface> track,
const RtpTransceiverInit& init) = 0;
// Adds a transceiver with the given kind. Can either be MEDIA_TYPE_AUDIO or
// MEDIA_TYPE_VIDEO.
// Errors:
// - INVALID_PARAMETER: |media_type| is not MEDIA_TYPE_AUDIO or
// MEDIA_TYPE_VIDEO.
virtual RTCErrorOr<rtc::scoped_refptr<RtpTransceiverInterface>>
AddTransceiver(cricket::MediaType media_type) = 0;
virtual RTCErrorOr<rtc::scoped_refptr<RtpTransceiverInterface>>
AddTransceiver(cricket::MediaType media_type,
const RtpTransceiverInit& init) = 0;
// Creates a sender without a track. Can be used for "early media"/"warmup"
// use cases, where the application may want to negotiate video attributes
// before a track is available to send.
//
// The standard way to do this would be through "addTransceiver", but we
// don't support that API yet.
//
// |kind| must be "audio" or "video".
//
// |stream_id| is used to populate the msid attribute; if empty, one will
// be generated automatically.
//
// This method is not supported with kUnifiedPlan semantics. Please use
// AddTransceiver instead.
virtual rtc::scoped_refptr<RtpSenderInterface> CreateSender(
const std::string& kind,
const std::string& stream_id) = 0;
// If Plan B semantics are specified, gets all RtpSenders, created either
// through AddStream, AddTrack, or CreateSender. All senders of a specific
// media type share the same media description.
//
// If Unified Plan semantics are specified, gets the RtpSender for each
// RtpTransceiver.
virtual std::vector<rtc::scoped_refptr<RtpSenderInterface>> GetSenders()
const = 0;
// If Plan B semantics are specified, gets all RtpReceivers created when a
// remote description is applied. All receivers of a specific media type share
// the same media description. It is also possible to have a media description
// with no associated RtpReceivers, if the directional attribute does not
// indicate that the remote peer is sending any media.
//
// If Unified Plan semantics are specified, gets the RtpReceiver for each
// RtpTransceiver.
virtual std::vector<rtc::scoped_refptr<RtpReceiverInterface>> GetReceivers()
const = 0;
// Get all RtpTransceivers, created either through AddTransceiver, AddTrack or
// by a remote description applied with SetRemoteDescription.
//
// Note: This method is only available when Unified Plan is enabled (see
// RTCConfiguration).
virtual std::vector<rtc::scoped_refptr<RtpTransceiverInterface>>
GetTransceivers() const = 0;
// The legacy non-compliant GetStats() API. This correspond to the
// callback-based version of getStats() in JavaScript. The returned metrics
// are UNDOCUMENTED and many of them rely on implementation-specific details.
// The goal is to DELETE THIS VERSION but we can't today because it is heavily
// relied upon by third parties. See https://crbug.com/822696.
//
// This version is wired up into Chrome. Any stats implemented are
// automatically exposed to the Web Platform. This has BYPASSED the Chrome
// release processes for years and lead to cross-browser incompatibility
// issues and web application reliance on Chrome-only behavior.
//
// This API is in "maintenance mode", serious regressions should be fixed but
// adding new stats is highly discouraged.
//
// TODO(hbos): Deprecate and remove this when third parties have migrated to
// the spec-compliant GetStats() API. https://crbug.com/822696
virtual bool GetStats(StatsObserver* observer,
MediaStreamTrackInterface* track, // Optional
StatsOutputLevel level) = 0;
// The spec-compliant GetStats() API. This correspond to the promise-based
// version of getStats() in JavaScript. Implementation status is described in
// api/stats/rtcstats_objects.h. For more details on stats, see spec:
// https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnection-getstats
// TODO(hbos): Takes shared ownership, use rtc::scoped_refptr<> instead. This
// requires stop overriding the current version in third party or making third
// party calls explicit to avoid ambiguity during switch. Make the future
// version abstract as soon as third party projects implement it.
virtual void GetStats(RTCStatsCollectorCallback* callback) = 0;
// Spec-compliant getStats() performing the stats selection algorithm with the
// sender. https://w3c.github.io/webrtc-pc/#dom-rtcrtpsender-getstats
virtual void GetStats(
rtc::scoped_refptr<RtpSenderInterface> selector,
rtc::scoped_refptr<RTCStatsCollectorCallback> callback) = 0;
// Spec-compliant getStats() performing the stats selection algorithm with the
// receiver. https://w3c.github.io/webrtc-pc/#dom-rtcrtpreceiver-getstats
virtual void GetStats(
rtc::scoped_refptr<RtpReceiverInterface> selector,
rtc::scoped_refptr<RTCStatsCollectorCallback> callback) = 0;
// Clear cached stats in the RTCStatsCollector.
// Exposed for testing while waiting for automatic cache clear to work.
// https://bugs.webrtc.org/8693
virtual void ClearStatsCache() {}
// Create a data channel with the provided config, or default config if none
// is provided. Note that an offer/answer negotiation is still necessary
// before the data channel can be used.
//
// Also, calling CreateDataChannel is the only way to get a data "m=" section
// in SDP, so it should be done before CreateOffer is called, if the
// application plans to use data channels.
virtual rtc::scoped_refptr<DataChannelInterface> CreateDataChannel(
const std::string& label,
const DataChannelInit* config) = 0;
// NOTE: For the following 6 methods, it's only safe to dereference the
// SessionDescriptionInterface on signaling_thread() (for example, calling
// ToString).
// Returns the more recently applied description; "pending" if it exists, and
// otherwise "current". See below.
virtual const SessionDescriptionInterface* local_description() const = 0;
virtual const SessionDescriptionInterface* remote_description() const = 0;
// A "current" description the one currently negotiated from a complete
// offer/answer exchange.
virtual const SessionDescriptionInterface* current_local_description()
const = 0;
virtual const SessionDescriptionInterface* current_remote_description()
const = 0;
// A "pending" description is one that's part of an incomplete offer/answer
// exchange (thus, either an offer or a pranswer). Once the offer/answer
// exchange is finished, the "pending" description will become "current".
virtual const SessionDescriptionInterface* pending_local_description()
const = 0;
virtual const SessionDescriptionInterface* pending_remote_description()
const = 0;
// Tells the PeerConnection that ICE should be restarted. This triggers a need
// for negotiation and subsequent CreateOffer() calls will act as if
// RTCOfferAnswerOptions::ice_restart is true.
// https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnection-restartice
// TODO(hbos): Remove default implementation when downstream projects
// implement this.
virtual void RestartIce() = 0;
// Create a new offer.
// The CreateSessionDescriptionObserver callback will be called when done.
virtual void CreateOffer(CreateSessionDescriptionObserver* observer,
const RTCOfferAnswerOptions& options) = 0;
// Create an answer to an offer.
// The CreateSessionDescriptionObserver callback will be called when done.
virtual void CreateAnswer(CreateSessionDescriptionObserver* observer,
const RTCOfferAnswerOptions& options) = 0;
// Sets the local session description.
//
// According to spec, the local session description MUST be the same as was
// returned by CreateOffer() or CreateAnswer() or else the operation should
// fail. Our implementation however allows some amount of "SDP munging", but
// please note that this is HIGHLY DISCOURAGED. If you do not intent to munge
// SDP, the method below that doesn't take |desc| as an argument will create
// the offer or answer for you.
//
// The observer is invoked as soon as the operation completes, which could be
// before or after the SetLocalDescription() method has exited.
virtual void SetLocalDescription(
std::unique_ptr<SessionDescriptionInterface> desc,
rtc::scoped_refptr<SetLocalDescriptionObserverInterface> observer) {}
// Creates an offer or answer (depending on current signaling state) and sets
// it as the local session description.
//
// The observer is invoked as soon as the operation completes, which could be
// before or after the SetLocalDescription() method has exited.
virtual void SetLocalDescription(
rtc::scoped_refptr<SetLocalDescriptionObserverInterface> observer) {}
// Like SetLocalDescription() above, but the observer is invoked with a delay
// after the operation completes. This helps avoid recursive calls by the
// observer but also makes it possible for states to change in-between the
// operation completing and the observer getting called. This makes them racy
// for synchronizing peer connection states to the application.
// TODO(https://crbug.com/webrtc/11798): Delete these methods in favor of the
// ones taking SetLocalDescriptionObserverInterface as argument.
virtual void SetLocalDescription(SetSessionDescriptionObserver* observer,
SessionDescriptionInterface* desc) = 0;
virtual void SetLocalDescription(SetSessionDescriptionObserver* observer) {}
// Sets the remote session description.
//
// (Unlike "SDP munging" before SetLocalDescription(), modifying a remote
// offer or answer is allowed by the spec.)
//
// The observer is invoked as soon as the operation completes, which could be
// before or after the SetRemoteDescription() method has exited.
virtual void SetRemoteDescription(
std::unique_ptr<SessionDescriptionInterface> desc,
rtc::scoped_refptr<SetRemoteDescriptionObserverInterface> observer) = 0;
// Like SetRemoteDescription() above, but the observer is invoked with a delay
// after the operation completes. This helps avoid recursive calls by the
// observer but also makes it possible for states to change in-between the
// operation completing and the observer getting called. This makes them racy
// for synchronizing peer connection states to the application.
// TODO(https://crbug.com/webrtc/11798): Delete this method in favor of the
// ones taking SetRemoteDescriptionObserverInterface as argument.
virtual void SetRemoteDescription(SetSessionDescriptionObserver* observer,
SessionDescriptionInterface* desc) {}
// According to spec, we must only fire "negotiationneeded" if the Operations
// Chain is empty. This method takes care of validating an event previously
// generated with PeerConnectionObserver::OnNegotiationNeededEvent() to make
// sure that even if there was a delay (e.g. due to a PostTask) between the
// event being generated and the time of firing, the Operations Chain is empty
// and the event is still valid to be fired.
virtual bool ShouldFireNegotiationNeededEvent(uint32_t event_id) {
return true;
}
virtual PeerConnectionInterface::RTCConfiguration GetConfiguration() = 0;
// Sets the PeerConnection's global configuration to |config|.
//
// The members of |config| that may be changed are |type|, |servers|,
// |ice_candidate_pool_size| and |prune_turn_ports| (though the candidate
// pool size can't be changed after the first call to SetLocalDescription).
// Note that this means the BUNDLE and RTCP-multiplexing policies cannot be
// changed with this method.
//
// Any changes to STUN/TURN servers or ICE candidate policy will affect the
// next gathering phase, and cause the next call to createOffer to generate
// new ICE credentials, as described in JSEP. This also occurs when
// |prune_turn_ports| changes, for the same reasoning.
//
// If an error occurs, returns false and populates |error| if non-null:
// - INVALID_MODIFICATION if |config| contains a modified parameter other
// than one of the parameters listed above.
// - INVALID_RANGE if |ice_candidate_pool_size| is out of range.
// - SYNTAX_ERROR if parsing an ICE server URL failed.
// - INVALID_PARAMETER if a TURN server is missing |username| or |password|.
// - INTERNAL_ERROR if an unexpected error occurred.
//
// TODO(nisse): Make this pure virtual once all Chrome subclasses of
// PeerConnectionInterface implement it.
virtual RTCError SetConfiguration(
const PeerConnectionInterface::RTCConfiguration& config);
// Provides a remote candidate to the ICE Agent.
// A copy of the |candidate| will be created and added to the remote
// description. So the caller of this method still has the ownership of the
// |candidate|.
// TODO(hbos): The spec mandates chaining this operation onto the operations
// chain; deprecate and remove this version in favor of the callback-based
// signature.
virtual bool AddIceCandidate(const IceCandidateInterface* candidate) = 0;
// TODO(hbos): Remove default implementation once implemented by downstream
// projects.
virtual void AddIceCandidate(std::unique_ptr<IceCandidateInterface> candidate,
std::function<void(RTCError)> callback) {}
// Removes a group of remote candidates from the ICE agent. Needed mainly for
// continual gathering, to avoid an ever-growing list of candidates as
// networks come and go. Note that the candidates' transport_name must be set
// to the MID of the m= section that generated the candidate.
// TODO(bugs.webrtc.org/8395): Use IceCandidateInterface instead of
// cricket::Candidate, which would avoid the transport_name oddity.
virtual bool RemoveIceCandidates(
const std::vector<cricket::Candidate>& candidates) = 0;
// SetBitrate limits the bandwidth allocated for all RTP streams sent by
// this PeerConnection. Other limitations might affect these limits and
// are respected (for example "b=AS" in SDP).
//
// Setting |current_bitrate_bps| will reset the current bitrate estimate
// to the provided value.
virtual RTCError SetBitrate(const BitrateSettings& bitrate) = 0;
// Enable/disable playout of received audio streams. Enabled by default. Note
// that even if playout is enabled, streams will only be played out if the
// appropriate SDP is also applied. Setting |playout| to false will stop
// playout of the underlying audio device but starts a task which will poll
// for audio data every 10ms to ensure that audio processing happens and the
// audio statistics are updated.
// TODO(henrika): deprecate and remove this.
virtual void SetAudioPlayout(bool playout) {}
// Enable/disable recording of transmitted audio streams. Enabled by default.
// Note that even if recording is enabled, streams will only be recorded if
// the appropriate SDP is also applied.
// TODO(henrika): deprecate and remove this.
virtual void SetAudioRecording(bool recording) {}
// Looks up the DtlsTransport associated with a MID value.
// In the Javascript API, DtlsTransport is a property of a sender, but
// because the PeerConnection owns the DtlsTransport in this implementation,
// it is better to look them up on the PeerConnection.
virtual rtc::scoped_refptr<DtlsTransportInterface> LookupDtlsTransportByMid(
const std::string& mid) = 0;
// Returns the SCTP transport, if any.
virtual rtc::scoped_refptr<SctpTransportInterface> GetSctpTransport()
const = 0;
// Returns the current SignalingState.
virtual SignalingState signaling_state() = 0;
// Returns an aggregate state of all ICE *and* DTLS transports.
// This is left in place to avoid breaking native clients who expect our old,
// nonstandard behavior.
// TODO(jonasolsson): deprecate and remove this.
virtual IceConnectionState ice_connection_state() = 0;
// Returns an aggregated state of all ICE transports.
virtual IceConnectionState standardized_ice_connection_state() = 0;
// Returns an aggregated state of all ICE and DTLS transports.
virtual PeerConnectionState peer_connection_state() = 0;
virtual IceGatheringState ice_gathering_state() = 0;
// Returns the current state of canTrickleIceCandidates per
// https://w3c.github.io/webrtc-pc/#attributes-1
virtual absl::optional<bool> can_trickle_ice_candidates() {
// TODO(crbug.com/708484): Remove default implementation.
return absl::nullopt;
}
// When a resource is overused, the PeerConnection will try to reduce the load
// on the sysem, for example by reducing the resolution or frame rate of
// encoded streams. The Resource API allows injecting platform-specific usage
// measurements. The conditions to trigger kOveruse or kUnderuse are up to the
// implementation.
// TODO(hbos): Make pure virtual when implemented by downstream projects.
virtual void AddAdaptationResource(rtc::scoped_refptr<Resource> resource) {}
// Start RtcEventLog using an existing output-sink. Takes ownership of
// |output| and passes it on to Call, which will take the ownership. If the
// operation fails the output will be closed and deallocated. The event log
// will send serialized events to the output object every |output_period_ms|.
// Applications using the event log should generally make their own trade-off
// regarding the output period. A long period is generally more efficient,
// with potential drawbacks being more bursty thread usage, and more events
// lost in case the application crashes. If the |output_period_ms| argument is
// omitted, webrtc selects a default deemed to be workable in most cases.
virtual bool StartRtcEventLog(std::unique_ptr<RtcEventLogOutput> output,
int64_t output_period_ms) = 0;
virtual bool StartRtcEventLog(std::unique_ptr<RtcEventLogOutput> output) = 0;
// Stops logging the RtcEventLog.
virtual void StopRtcEventLog() = 0;
// Terminates all media, closes the transports, and in general releases any
// resources used by the PeerConnection. This is an irreversible operation.
//
// Note that after this method completes, the PeerConnection will no longer
// use the PeerConnectionObserver interface passed in on construction, and
// thus the observer object can be safely destroyed.
virtual void Close() = 0;
// The thread on which all PeerConnectionObserver callbacks will be invoked,
// as well as callbacks for other classes such as DataChannelObserver.
//
// Also the only thread on which it's safe to use SessionDescriptionInterface
// pointers.
// TODO(deadbeef): Make pure virtual when all subclasses implement it.
virtual rtc::Thread* signaling_thread() const { return nullptr; }
protected:
// Dtor protected as objects shouldn't be deleted via this interface.
~PeerConnectionInterface() override = default;
};
// PeerConnection callback interface, used for RTCPeerConnection events.
// Application should implement these methods.
class PeerConnectionObserver {
public:
virtual ~PeerConnectionObserver() = default;
// Triggered when the SignalingState changed.
virtual void OnSignalingChange(
PeerConnectionInterface::SignalingState new_state) = 0;
// Triggered when media is received on a new stream from remote peer.
virtual void OnAddStream(rtc::scoped_refptr<MediaStreamInterface> stream) {}
// Triggered when a remote peer closes a stream.
virtual void OnRemoveStream(rtc::scoped_refptr<MediaStreamInterface> stream) {
}
// Triggered when a remote peer opens a data channel.
virtual void OnDataChannel(
rtc::scoped_refptr<DataChannelInterface> data_channel) = 0;
// Triggered when renegotiation is needed. For example, an ICE restart
// has begun.
// TODO(hbos): Delete in favor of OnNegotiationNeededEvent() when downstream
// projects have migrated.
virtual void OnRenegotiationNeeded() {}
// Used to fire spec-compliant onnegotiationneeded events, which should only
// fire when the Operations Chain is empty. The observer is responsible for
// queuing a task (e.g. Chromium: jump to main thread) to maybe fire the
// event. The event identified using |event_id| must only fire if
// PeerConnection::ShouldFireNegotiationNeededEvent() returns true since it is
// possible for the event to become invalidated by operations subsequently
// chained.
virtual void OnNegotiationNeededEvent(uint32_t event_id) {}
// Called any time the legacy IceConnectionState changes.
//
// Note that our ICE states lag behind the standard slightly. The most
// notable differences include the fact that "failed" occurs after 15
// seconds, not 30, and this actually represents a combination ICE + DTLS
// state, so it may be "failed" if DTLS fails while ICE succeeds.
//
// TODO(jonasolsson): deprecate and remove this.
virtual void OnIceConnectionChange(
PeerConnectionInterface::IceConnectionState new_state) {}
// Called any time the standards-compliant IceConnectionState changes.
virtual void OnStandardizedIceConnectionChange(
PeerConnectionInterface::IceConnectionState new_state) {}
// Called any time the PeerConnectionState changes.
virtual void OnConnectionChange(
PeerConnectionInterface::PeerConnectionState new_state) {}
// Called any time the IceGatheringState changes.
virtual void OnIceGatheringChange(
PeerConnectionInterface::IceGatheringState new_state) = 0;
// A new ICE candidate has been gathered.
virtual void OnIceCandidate(const IceCandidateInterface* candidate) = 0;
// Gathering of an ICE candidate failed.
// See https://w3c.github.io/webrtc-pc/#event-icecandidateerror
// |host_candidate| is a stringified socket address.
virtual void OnIceCandidateError(const std::string& host_candidate,
const std::string& url,
int error_code,
const std::string& error_text) {}
// Gathering of an ICE candidate failed.
// See https://w3c.github.io/webrtc-pc/#event-icecandidateerror
virtual void OnIceCandidateError(const std::string& address,
int port,
const std::string& url,
int error_code,
const std::string& error_text) {}
// Ice candidates have been removed.
// TODO(honghaiz): Make this a pure virtual method when all its subclasses
// implement it.
virtual void OnIceCandidatesRemoved(
const std::vector<cricket::Candidate>& candidates) {}
// Called when the ICE connection receiving status changes.
virtual void OnIceConnectionReceivingChange(bool receiving) {}
// Called when the selected candidate pair for the ICE connection changes.
virtual void OnIceSelectedCandidatePairChanged(
const cricket::CandidatePairChangeEvent& event) {}
// This is called when a receiver and its track are created.
// TODO(zhihuang): Make this pure virtual when all subclasses implement it.
// Note: This is called with both Plan B and Unified Plan semantics. Unified
// Plan users should prefer OnTrack, OnAddTrack is only called as backwards
// compatibility (and is called in the exact same situations as OnTrack).
virtual void OnAddTrack(
rtc::scoped_refptr<RtpReceiverInterface> receiver,
const std::vector<rtc::scoped_refptr<MediaStreamInterface>>& streams) {}
// This is called when signaling indicates a transceiver will be receiving
// media from the remote endpoint. This is fired during a call to
// SetRemoteDescription. The receiving track can be accessed by:
// |transceiver->receiver()->track()| and its associated streams by
// |transceiver->receiver()->streams()|.
// Note: This will only be called if Unified Plan semantics are specified.
// This behavior is specified in section 2.2.8.2.5 of the "Set the
// RTCSessionDescription" algorithm:
// https://w3c.github.io/webrtc-pc/#set-description
virtual void OnTrack(
rtc::scoped_refptr<RtpTransceiverInterface> transceiver) {}
// Called when signaling indicates that media will no longer be received on a
// track.
// With Plan B semantics, the given receiver will have been removed from the
// PeerConnection and the track muted.
// With Unified Plan semantics, the receiver will remain but the transceiver
// will have changed direction to either sendonly or inactive.
// https://w3c.github.io/webrtc-pc/#process-remote-track-removal
// TODO(hbos,deadbeef): Make pure virtual when all subclasses implement it.
virtual void OnRemoveTrack(
rtc::scoped_refptr<RtpReceiverInterface> receiver) {}
// Called when an interesting usage is detected by WebRTC.
// An appropriate action is to add information about the context of the
// PeerConnection and write the event to some kind of "interesting events"
// log function.
// The heuristics for defining what constitutes "interesting" are
// implementation-defined.
virtual void OnInterestingUsage(int usage_pattern) {}
};
// PeerConnectionDependencies holds all of PeerConnections dependencies.
// A dependency is distinct from a configuration as it defines significant
// executable code that can be provided by a user of the API.
//
// All new dependencies should be added as a unique_ptr to allow the
// PeerConnection object to be the definitive owner of the dependencies
// lifetime making injection safer.
struct RTC_EXPORT PeerConnectionDependencies final {
explicit PeerConnectionDependencies(PeerConnectionObserver* observer_in);
// This object is not copyable or assignable.
PeerConnectionDependencies(const PeerConnectionDependencies&) = delete;
PeerConnectionDependencies& operator=(const PeerConnectionDependencies&) =
delete;
// This object is only moveable.
PeerConnectionDependencies(PeerConnectionDependencies&&);
PeerConnectionDependencies& operator=(PeerConnectionDependencies&&) = default;
~PeerConnectionDependencies();
// Mandatory dependencies
PeerConnectionObserver* observer = nullptr;
// Optional dependencies
// TODO(bugs.webrtc.org/7447): remove port allocator once downstream is
// updated. For now, you can only set one of allocator and
// packet_socket_factory, not both.
std::unique_ptr<cricket::PortAllocator> allocator;
std::unique_ptr<rtc::PacketSocketFactory> packet_socket_factory;
// Factory for creating resolvers that look up hostnames in DNS
std::unique_ptr<webrtc::AsyncDnsResolverFactoryInterface>
async_dns_resolver_factory;
// Deprecated - use async_dns_resolver_factory
std::unique_ptr<webrtc::AsyncResolverFactory> async_resolver_factory;
std::unique_ptr<webrtc::IceTransportFactory> ice_transport_factory;
std::unique_ptr<rtc::RTCCertificateGeneratorInterface> cert_generator;
std::unique_ptr<rtc::SSLCertificateVerifier> tls_cert_verifier;
std::unique_ptr<webrtc::VideoBitrateAllocatorFactory>
video_bitrate_allocator_factory;
};
// PeerConnectionFactoryDependencies holds all of the PeerConnectionFactory
// dependencies. All new dependencies should be added here instead of
// overloading the function. This simplifies dependency injection and makes it
// clear which are mandatory and optional. If possible please allow the peer
// connection factory to take ownership of the dependency by adding a unique_ptr
// to this structure.
struct RTC_EXPORT PeerConnectionFactoryDependencies final {
PeerConnectionFactoryDependencies();
// This object is not copyable or assignable.
PeerConnectionFactoryDependencies(const PeerConnectionFactoryDependencies&) =
delete;
PeerConnectionFactoryDependencies& operator=(
const PeerConnectionFactoryDependencies&) = delete;
// This object is only moveable.
PeerConnectionFactoryDependencies(PeerConnectionFactoryDependencies&&);
PeerConnectionFactoryDependencies& operator=(
PeerConnectionFactoryDependencies&&) = default;
~PeerConnectionFactoryDependencies();
// Optional dependencies
rtc::Thread* network_thread = nullptr;
rtc::Thread* worker_thread = nullptr;
rtc::Thread* signaling_thread = nullptr;
std::unique_ptr<TaskQueueFactory> task_queue_factory;
std::unique_ptr<cricket::MediaEngineInterface> media_engine;
std::unique_ptr<CallFactoryInterface> call_factory;
std::unique_ptr<RtcEventLogFactoryInterface> event_log_factory;
std::unique_ptr<FecControllerFactoryInterface> fec_controller_factory;
std::unique_ptr<NetworkStatePredictorFactoryInterface>
network_state_predictor_factory;
std::unique_ptr<NetworkControllerFactoryInterface> network_controller_factory;
// This will only be used if CreatePeerConnection is called without a
// |port_allocator|, causing the default allocator and network manager to be
// used.
std::unique_ptr<rtc::NetworkMonitorFactory> network_monitor_factory;
std::unique_ptr<NetEqFactory> neteq_factory;
std::unique_ptr<SctpTransportFactoryInterface> sctp_factory;
std::unique_ptr<WebRtcKeyValueConfig> trials;
};
// PeerConnectionFactoryInterface is the factory interface used for creating
// PeerConnection, MediaStream and MediaStreamTrack objects.
//
// The simplest method for obtaiing one, CreatePeerConnectionFactory will
// create the required libjingle threads, socket and network manager factory
// classes for networking if none are provided, though it requires that the
// application runs a message loop on the thread that called the method (see
// explanation below)
//
// If an application decides to provide its own threads and/or implementation
// of networking classes, it should use the alternate
// CreatePeerConnectionFactory method which accepts threads as input, and use
// the CreatePeerConnection version that takes a PortAllocator as an argument.
class RTC_EXPORT PeerConnectionFactoryInterface
: public rtc::RefCountInterface {
public:
class Options {
public:
Options() {}
// If set to true, created PeerConnections won't enforce any SRTP
// requirement, allowing unsecured media. Should only be used for
// testing/debugging.
bool disable_encryption = false;
// Deprecated. The only effect of setting this to true is that
// CreateDataChannel will fail, which is not that useful.
bool disable_sctp_data_channels = false;
// If set to true, any platform-supported network monitoring capability
// won't be used, and instead networks will only be updated via polling.
//
// This only has an effect if a PeerConnection is created with the default
// PortAllocator implementation.
bool disable_network_monitor = false;
// Sets the network types to ignore. For instance, calling this with
// ADAPTER_TYPE_ETHERNET | ADAPTER_TYPE_LOOPBACK will ignore Ethernet and
// loopback interfaces.
int network_ignore_mask = rtc::kDefaultNetworkIgnoreMask;
// Sets the maximum supported protocol version. The highest version
// supported by both ends will be used for the connection, i.e. if one
// party supports DTLS 1.0 and the other DTLS 1.2, DTLS 1.0 will be used.
rtc::SSLProtocolVersion ssl_max_version = rtc::SSL_PROTOCOL_DTLS_12;
// Sets crypto related options, e.g. enabled cipher suites.
CryptoOptions crypto_options = CryptoOptions::NoGcm();
};
// Set the options to be used for subsequently created PeerConnections.
virtual void SetOptions(const Options& options) = 0;
// The preferred way to create a new peer connection. Simply provide the
// configuration and a PeerConnectionDependencies structure.
// TODO(benwright): Make pure virtual once downstream mock PC factory classes
// are updated.
virtual RTCErrorOr<rtc::scoped_refptr<PeerConnectionInterface>>
CreatePeerConnectionOrError(
const PeerConnectionInterface::RTCConfiguration& configuration,
PeerConnectionDependencies dependencies);
// Deprecated creator - does not return an error code on error.
// TODO(bugs.webrtc.org:12238): Deprecate and remove.
virtual rtc::scoped_refptr<PeerConnectionInterface> CreatePeerConnection(
const PeerConnectionInterface::RTCConfiguration& configuration,
PeerConnectionDependencies dependencies);
// Deprecated; |allocator| and |cert_generator| may be null, in which case
// default implementations will be used.
//
// |observer| must not be null.
//
// Note that this method does not take ownership of |observer|; it's the
// responsibility of the caller to delete it. It can be safely deleted after
// Close has been called on the returned PeerConnection, which ensures no
// more observer callbacks will be invoked.
virtual rtc::scoped_refptr<PeerConnectionInterface> CreatePeerConnection(
const PeerConnectionInterface::RTCConfiguration& configuration,
std::unique_ptr<cricket::PortAllocator> allocator,
std::unique_ptr<rtc::RTCCertificateGeneratorInterface> cert_generator,
PeerConnectionObserver* observer);
// Returns the capabilities of an RTP sender of type |kind|.
// If for some reason you pass in MEDIA_TYPE_DATA, returns an empty structure.
// TODO(orphis): Make pure virtual when all subclasses implement it.
virtual RtpCapabilities GetRtpSenderCapabilities(
cricket::MediaType kind) const;
// Returns the capabilities of an RTP receiver of type |kind|.
// If for some reason you pass in MEDIA_TYPE_DATA, returns an empty structure.
// TODO(orphis): Make pure virtual when all subclasses implement it.
virtual RtpCapabilities GetRtpReceiverCapabilities(
cricket::MediaType kind) const;
virtual rtc::scoped_refptr<MediaStreamInterface> CreateLocalMediaStream(
const std::string& stream_id) = 0;
// Creates an AudioSourceInterface.
// |options| decides audio processing settings.
virtual rtc::scoped_refptr<AudioSourceInterface> CreateAudioSource(
const cricket::AudioOptions& options) = 0;
// Creates a new local VideoTrack. The same |source| can be used in several
// tracks.
virtual rtc::scoped_refptr<VideoTrackInterface> CreateVideoTrack(
const std::string& label,
VideoTrackSourceInterface* source) = 0;
// Creates an new AudioTrack. At the moment |source| can be null.
virtual rtc::scoped_refptr<AudioTrackInterface> CreateAudioTrack(
const std::string& label,
AudioSourceInterface* source) = 0;
// Starts AEC dump using existing file. Takes ownership of |file| and passes
// it on to VoiceEngine (via other objects) immediately, which will take
// the ownerhip. If the operation fails, the file will be closed.
// A maximum file size in bytes can be specified. When the file size limit is
// reached, logging is stopped automatically. If max_size_bytes is set to a
// value <= 0, no limit will be used, and logging will continue until the
// StopAecDump function is called.
// TODO(webrtc:6463): Delete default implementation when downstream mocks
// classes are updated.
virtual bool StartAecDump(FILE* file, int64_t max_size_bytes) {
return false;
}
// Stops logging the AEC dump.
virtual void StopAecDump() = 0;
protected:
// Dtor and ctor protected as objects shouldn't be created or deleted via
// this interface.
PeerConnectionFactoryInterface() {}
~PeerConnectionFactoryInterface() override = default;
};
// CreateModularPeerConnectionFactory is implemented in the "peerconnection"
// build target, which doesn't pull in the implementations of every module
// webrtc may use.
//
// If an application knows it will only require certain modules, it can reduce
// webrtc's impact on its binary size by depending only on the "peerconnection"
// target and the modules the application requires, using
// CreateModularPeerConnectionFactory. For example, if an application
// only uses WebRTC for audio, it can pass in null pointers for the
// video-specific interfaces, and omit the corresponding modules from its
// build.
//
// If |network_thread| or |worker_thread| are null, the PeerConnectionFactory
// will create the necessary thread internally. If |signaling_thread| is null,
// the PeerConnectionFactory will use the thread on which this method is called
// as the signaling thread, wrapping it in an rtc::Thread object if needed.
RTC_EXPORT rtc::scoped_refptr<PeerConnectionFactoryInterface>
CreateModularPeerConnectionFactory(
PeerConnectionFactoryDependencies dependencies);
} // namespace webrtc
#endif // API_PEER_CONNECTION_INTERFACE_H_
| [
"zhangtongxiao@fenbi.com"
] | zhangtongxiao@fenbi.com |
9adfafd3d010df3264cc68646a6103e887382755 | 3e375244058ed4f0f27b9d42ecbadb1e8e7ff820 | /src/zeq/window.hpp | 1d7ffaf994e456304642eb2c4f7e7c5529f1bcf6 | [] | no_license | Zaela/ZEQ | e53fd136a06e2638efb395c80572fbc486a00c62 | 5f3386b80eb75b432f7c20fa3054d4b39a6adc30 | refs/heads/master | 2021-01-10T14:42:49.591211 | 2016-02-22T00:49:11 | 2016-02-22T00:49:11 | 50,164,457 | 1 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 819 | hpp |
#ifndef _ZEQ_WINDOW_HPP_
#define _ZEQ_WINDOW_HPP_
#include "define.hpp"
#include "opengl.hpp"
#include "input.hpp"
#include "model_resources.hpp"
#include "zone_model.hpp"
#include "entity_list.hpp"
#include "animated_model.hpp"
#include "config.hpp"
#include "log.hpp"
#include <vector>
#include <string>
class Window : public sf::RenderWindow
{
private:
Input m_input;
bool m_running;
double m_prevTime;
PerfTimer m_deltaTimer;
ZoneModel* m_zoneModel;
EntityList m_entityList;
private:
static void clear();
void pollInput(double delta);
void drawAll();
public:
Window();
virtual ~Window();
bool mainLoop();
void loadZoneModel(const std::string& shortname);
Camera& getCamera() { return m_input.getCamera(); }
};
#endif//_ZEQ_WINDOW_HPP_
| [
"zaelas@gmail.com"
] | zaelas@gmail.com |
a8bbafaea5020dab1d7f48ef0ff11c815cab34d0 | 17216697080c5afdd5549aff14f42c39c420d33a | /src/src/Share/ShareLib/LinuxPublic/ACE_wrappers/examples/APG/Misc_IPC/UDP_Unicast.cpp | 6d08e55a8cd0e9c712eccfa564d4daf6c77edb66 | [
"MIT"
] | permissive | AI549654033/RDHelp | 9c8b0cc196de98bcd81b2ccc4fc352bdc3783159 | 0f5f9c7d098635c7216713d7137c845c0d999226 | refs/heads/master | 2022-07-03T16:04:58.026641 | 2020-05-18T06:04:36 | 2020-05-18T06:04:36 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,818 | cpp | /**
* $Id: UDP_Unicast.cpp 80826 2008-03-04 14:51:23Z wotte $
*
* Sample code from The ACE Programmer's Guide,
* Copyright 2003 Addison-Wesley. All Rights Reserved.
*/
// Listing 1 code/ch09
#include "ace/OS_NS_string.h"
#include "ace/Log_Msg.h"
#include "ace/INET_Addr.h"
#include "ace/SOCK_Dgram.h"
int send_unicast (const ACE_INET_Addr &to)
{
const char *message = "this is the message!\n";
ACE_INET_Addr my_addr (static_cast<u_short> (10101));
ACE_SOCK_Dgram udp (my_addr);
ssize_t sent = udp.send (message,
ACE_OS::strlen (message) + 1,
to);
udp.close ();
if (sent == -1)
ACE_ERROR_RETURN ((LM_ERROR, ACE_TEXT ("%p\n"),
ACE_TEXT ("send")), -1);
return 0;
}
// Listing 1
// Listing 2 code/ch09
void echo_dgram (void)
{
ACE_INET_Addr my_addr (static_cast<u_short> (10102));
ACE_INET_Addr your_addr;
ACE_SOCK_Dgram udp (my_addr);
char buff[BUFSIZ];
size_t buflen = sizeof (buff);
ssize_t recv_cnt = udp.recv (buff, buflen, your_addr);
if (recv_cnt > 0)
udp.send (buff, static_cast<size_t> (buflen), your_addr);
udp.close ();
return;
}
// Listing 2
// Listing 3 code/ch09
#include "ace/SOCK_CODgram.h"
// Exclude 3
static void show_codgram (void)
{
char buff[BUFSIZ];
size_t buflen = sizeof (buff);
// Exclude 3
const ACE_TCHAR *peer = ACE_TEXT ("other_host:8042");
ACE_INET_Addr peer_addr (peer);
ACE_SOCK_CODgram udp;
if (0 != udp.open (peer_addr))
ACE_ERROR ((LM_ERROR, ACE_TEXT ("%p\n"), peer));
// ...
if (-1 == udp.send (buff, buflen))
ACE_ERROR ((LM_ERROR, ACE_TEXT ("%p\n"), ACE_TEXT ("send")));
// Listing 3
}
int ACE_TMAIN (int, ACE_TCHAR *[])
{
show_codgram ();
return 0;
}
| [
"jim_xie@trendmicro.com"
] | jim_xie@trendmicro.com |
6937e89d6a0c19e6a4c8843368cd8f531504cb30 | a1abe87ee9e276ba60d26a63378c4ea3e35d7517 | /Source/SpriteRender/INTERFACE/Material/MaterialInstanceFactory.cpp | 9f6f74a1c3cd5baab241cae36d0f4838a6c58f22 | [] | no_license | AlexeyOgurtsov/SpriteRender | c3b1f855c4f869d3b60091a048beecf270577908 | f3eb9945dbc1f059fd0b0398ffc5557f7c086f13 | refs/heads/master | 2020-03-30T23:29:59.105528 | 2019-02-14T08:05:01 | 2019-02-14T08:05:01 | 151,702,572 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 982 | cpp | #include "MaterialInstanceFactory.h"
#include "ISprite/SpriteMaterialSystemConstants.h"
#include "SpriteRender/Material/DefaultMaterialInstanceRS.h"
#include "SpriteRender/Material/DefaultSpriteMaterial.h"
#include "SpriteRender/INTERFACE/ISpriteRenderSubsystem.h"
#include "ISpriteMaterialManager.h"
#include <boost/assert.hpp>
namespace Dv
{
namespace Spr
{
namespace Ren
{
std::shared_ptr<SpriteMaterialInstanceRenderState> CreateMatInst_Default(ISpriteRenderSubsystem* pInRenderSubsystem, ID3D11ShaderResourceView* pInTexture2D)
{
auto const pMaterial = dynamic_cast<IMPL::DefaultSpriteMaterial*>(pInRenderSubsystem->GetMaterials()->FindById(DEFAULT_MATERIAL_ID));
IMPL::DefaultShaderConfigId ShaderConfigId = PrepareShader_ForDefaultMaterialInstance(pMaterial, pInTexture2D);
return std::make_shared<IMPL::DefaultMaterialInstanceRS>
(
IMPL::SDefaultMaterialInstanceRSInitializer{pMaterial, pInTexture2D, ShaderConfigId }
);
}
} // Dv::Spr::Ren
} // Dv::Spr
} // Dv | [
"alexey_eng@mail.ru"
] | alexey_eng@mail.ru |
2eee6e9b0fdf67e29c5a331b727d1b3ee6fc77a7 | 1dbf007249acad6038d2aaa1751cbde7e7842c53 | /tms/include/huaweicloud/tms/v1/model/Resources.h | a0a4e5cacd5a1560d872e7acfa594dc3c8fe3956 | [] | permissive | huaweicloud/huaweicloud-sdk-cpp-v3 | 24fc8d93c922598376bdb7d009e12378dff5dd20 | 71674f4afbb0cd5950f880ec516cfabcde71afe4 | refs/heads/master | 2023-08-04T19:37:47.187698 | 2023-08-03T08:25:43 | 2023-08-03T08:25:43 | 324,328,641 | 11 | 10 | Apache-2.0 | 2021-06-24T07:25:26 | 2020-12-25T09:11:43 | C++ | UTF-8 | C++ | false | false | 3,006 | h |
#ifndef HUAWEICLOUD_SDK_TMS_V1_MODEL_Resources_H_
#define HUAWEICLOUD_SDK_TMS_V1_MODEL_Resources_H_
#include <huaweicloud/tms/v1/TmsExport.h>
#include <huaweicloud/core/utils/ModelBase.h>
#include <huaweicloud/core/http/HttpResponse.h>
#include <huaweicloud/core/utils/Object.h>
#include <string>
#include <huaweicloud/tms/v1/model/CreateTagRequest.h>
#include <vector>
namespace HuaweiCloud {
namespace Sdk {
namespace Tms {
namespace V1 {
namespace Model {
using namespace HuaweiCloud::Sdk::Core::Utils;
using namespace HuaweiCloud::Sdk::Core::Http;
/// <summary>
/// 资源列表
/// </summary>
class HUAWEICLOUD_TMS_V1_EXPORT Resources
: public ModelBase
{
public:
Resources();
virtual ~Resources();
/////////////////////////////////////////////
/// ModelBase overrides
void validate() override;
web::json::value toJson() const override;
bool fromJson(const web::json::value& json) override;
/////////////////////////////////////////////
/// Resources members
/// <summary>
/// ProjectID
/// </summary>
std::string getProjectId() const;
bool projectIdIsSet() const;
void unsetprojectId();
void setProjectId(const std::string& value);
/// <summary>
/// Project名称
/// </summary>
std::string getProjectName() const;
bool projectNameIsSet() const;
void unsetprojectName();
void setProjectName(const std::string& value);
/// <summary>
/// 资源详情
/// </summary>
Object getResourceDetail() const;
bool resourceDetailIsSet() const;
void unsetresourceDetail();
void setResourceDetail(const Object& value);
/// <summary>
/// 资源ID
/// </summary>
std::string getResourceId() const;
bool resourceIdIsSet() const;
void unsetresourceId();
void setResourceId(const std::string& value);
/// <summary>
/// 资源名称
/// </summary>
std::string getResourceName() const;
bool resourceNameIsSet() const;
void unsetresourceName();
void setResourceName(const std::string& value);
/// <summary>
/// 资源类型
/// </summary>
std::string getResourceType() const;
bool resourceTypeIsSet() const;
void unsetresourceType();
void setResourceType(const std::string& value);
/// <summary>
/// 标签列表
/// </summary>
std::vector<CreateTagRequest>& getTags();
bool tagsIsSet() const;
void unsettags();
void setTags(const std::vector<CreateTagRequest>& value);
protected:
std::string projectId_;
bool projectIdIsSet_;
std::string projectName_;
bool projectNameIsSet_;
Object resourceDetail_;
bool resourceDetailIsSet_;
std::string resourceId_;
bool resourceIdIsSet_;
std::string resourceName_;
bool resourceNameIsSet_;
std::string resourceType_;
bool resourceTypeIsSet_;
std::vector<CreateTagRequest> tags_;
bool tagsIsSet_;
};
}
}
}
}
}
#endif // HUAWEICLOUD_SDK_TMS_V1_MODEL_Resources_H_
| [
"hwcloudsdk@huawei.com"
] | hwcloudsdk@huawei.com |
61f12f051d6c820cd28509148782400836a6c6ff | 429d3a2db68a73a0d287b82c11f341351e020141 | /supervisor.h | 9d581b1ccb05b6b31b7086ecdc228bdc2e2d651f | [] | no_license | nwmiller/CS2303-Assignment6 | 711f821a72ad1773f50d31bde9f4e9f0635931d2 | 9de7c5a477a41f6c9534c6b67d0b7ef180228a43 | refs/heads/master | 2021-01-10T19:56:36.433492 | 2012-10-27T20:44:01 | 2012-10-27T20:44:01 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,302 | h | /** File supervisor.h
*
* @author Nathaniel Miller
*
* Holds the Supervisor class and
* any function headers associated with the Supervisor class.
* This class is subclass of the Employee class.
*/
#ifndef SUPERVISOR_H
#define SUPERVISOR_H
#include <string>
#include <iostream>
#include <stdio.h>
#include "empl.h"
using namespace std;
/** The Supervisor subclass of the Employee class.
* This class holds more detail/extra information
* about an Employee.
*/
class Supervisor: public Employee
{
public:
/* Constructs a supervisor with fields initially empty.
*/
Supervisor();
/* function prototypes */
/* Constructs a supervisor with the given name, salary,
* department and number of subordinates.
* @param name The supervisor's name.
* @param salary The supervisor's salary.
* @param super_dept The supervisor's department.
* @param subords The number of suboridnates.
*/
Supervisor(string name, int salary, string dept, int subords);
/* prints a supervisor and all its information */
void print_super();
/* prints a supervisor and its information, virtual declaration version */
virtual void printv();
protected:
string department; // data field for the department
int subordinates; // data field for the # of subordinates
};
#endif
| [
"n.william.m@gmail.com"
] | n.william.m@gmail.com |
ea778f8fdb470c79a0170b94c68c4723fa209c7d | 731b465f79940ee90d540e027d083ea30373cc89 | /match.h | 295992ee3bf857e982b57e965cf3ab5da570601e | [] | no_license | juancarlosfarah/tube-matcher | cfdc468d4d07a587b0ab12b13a436eb65965040b | 672c2d5997c66fd9228ec6f79d520f7ff6f131da | refs/heads/master | 2021-01-02T14:09:08.058283 | 2016-02-16T17:51:32 | 2016-02-16T17:51:32 | 24,989,820 | 0 | 0 | null | 2014-10-17T11:01:10 | 2014-10-09T13:14:59 | C++ | UTF-8 | C++ | false | false | 1,327 | h | #ifndef MATCH_H
#define MATCH_H
/* function: GetPerfectMatches
* ===========================
* takes a string and an input file stream
* and prints the lines in that file that
* contain all the characters in the string.
*/
void GetPerfectMatches(
std::string,
std::ifstream&
);
/* function: GetPerfectUnmatches
* =============================
* takes a string and an input file stream
* and prints the lines in that file that
* contain no characters in the string.
*/
void GetPerfectUnmatches(
std::string s,
std::ifstream& file
);
/* function: IsPerfectMatch
* ========================
* takes two strings and compares them to
* see if the characters in the first one
* are all in the second.
*/
bool IsPerfectMatch(
std::string matcher,
std::string matchee
);
/* function: IsCharInString
* ========================
* takes a character and a string and
* returns true if the character is
* in the string.
*/
bool IsCharInString(
char c,
std::string s
);
/* function: IsPerfectUnmatch
* ==========================
* takes two strings and compares them
* to see if none of the characters of
* the first string are in the second.
*/
bool IsPerfectUnmatch(
std::string matcher,
std::string matchee
);
#endif
| [
"farah.juancarlos@gmail.com"
] | farah.juancarlos@gmail.com |
dc87e02b2bafe1f36cc3fd4a552d605354e636bd | b128d5b4f9abaa65055665e5ee64c49d797f51df | /CommonHardware/ButtonPad.h | 1ec8e45f195727e97bdfc3065d981c1a8ea7963e | [
"MIT"
] | permissive | casparkleijne/majorproblem | 14ac03ba74f9e6f8f57449b2f5ad8f5a8a987d7e | a5854a9e8e12125d709b28f3f5025ee0996bf18f | refs/heads/master | 2020-04-15T02:27:03.737683 | 2019-01-19T11:32:06 | 2019-01-19T11:32:06 | 164,315,213 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 117 | h | #pragma once
#include <Arduino.h>
class ButtonPad
{
public:
ButtonPad();
~ButtonPad();
uint8_t Listen();
};
| [
"caspar.kleijne@hyperdata.nl"
] | caspar.kleijne@hyperdata.nl |
b60caaf90f106ec11cf3e54835c7188deadcc2d1 | 8a9bb0bba06a3fb9da06f48b5fb43af6a2a4bb47 | /LeetCode/KthSmallestElementInASortedMatrix.cpp | 2fbcd9371016bed878ab421685f4eb901a108a75 | [] | no_license | ruifshi/LeetCode | 4cae3f54e5e5a8ee53c4a7400bb58d177a560be8 | 11786b6bc379c7b09b3f49fc8743cc15d46b5c0d | refs/heads/master | 2022-07-14T09:39:55.001968 | 2022-06-26T02:06:00 | 2022-06-26T02:06:00 | 158,513,101 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,164 | cpp | #include "stdafx.h"
#include "KthSmallestElementInASortedMatrix.h"
#include <queue>
#include <algorithm>
struct mycomp {
bool operator()(const pair<int, pair<int, int>> &a, const pair<int, pair<int, int>> &b) {
return a.first > b.first;
}
};
// O(K log min(matrix.size(), k)
int Solution::kthSmallest(vector<vector<int>>& matrix, int k) {
if (matrix.size() == 0) return 0;
if (k == 1) return matrix[0][0];
// value to indices
// always hold the smallest elements in the front
priority_queue<pair<int, pair<int, int>>, vector<pair<int, pair<int,int>>>, mycomp> q;
// matrix is row and column sorted so take the first row values
// and then we'll iterate along the columns
for (int i = 0; i < min((int)matrix.size(), k); i++) {
q.push({ matrix[i][0], { i, 0 } });
}
// in k iterations, we will have the kth number since q has smallest
// numbers in the front
int val = 0;
while (k-- > 0) {
val = q.top().first;
int row = q.top().second.first;
int col = q.top().second.second;
q.pop();
if (col < matrix[0].size() - 1) {
q.push({ matrix[row][col + 1], {row, col + 1} });
}
}
return val;
} | [
"ruifshi@hotmail.com"
] | ruifshi@hotmail.com |
4c08faf7b46f203e19e6116d0b8b53acb547f4aa | 3886504fcbb5d7b12397998592cbafb874c470eb | /sdk/src/client/AsyncCallerContext.cc | 5bf3e7faefa7d71be6f605179ed1fc9bff0fe9e7 | [
"Apache-2.0"
] | permissive | OpenInspur/inspur-oss-cpp-sdk | 1c9ff9c4de58f42db780a165059862bf52a2be8b | a0932232aaf46aab7c5a2079f72d80cc5d634ba2 | refs/heads/master | 2022-12-04T15:14:11.657799 | 2020-08-13T03:29:37 | 2020-08-13T03:29:37 | 286,946,985 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 481 | cc | #include <inspurcloud/oss/client/AsyncCallerContext.h>
#include "../utils/Utils.h"
using namespace InspurCloud::OSS;
AsyncCallerContext::AsyncCallerContext() :
uuid_(GenerateUuid())
{
}
AsyncCallerContext::AsyncCallerContext(const std::string &uuid) :
uuid_(uuid)
{
}
AsyncCallerContext::~AsyncCallerContext()
{
}
const std::string &AsyncCallerContext::Uuid()const
{
return uuid_;
}
void AsyncCallerContext::setUuid(const std::string &uuid)
{
uuid_ = uuid;
}
| [
"wangtengfei@inspur.com"
] | wangtengfei@inspur.com |
8fa7e1dd79173b06ace44c763e7ecb98ef63f8d2 | b96b500e7e56a8b819bfdb4aac0d328aa1171715 | /torch_glow/src/FusingOptimizer.h | 72ccdc093515c1ac03ab240ffeba4ac511a4eb20 | [
"Apache-2.0"
] | permissive | Bensonlp/glow | d6fb02dbdbb214278fbf49d28fac7fa5abe7d86d | daf9c6a45ef61b92ad754306567dc45758394727 | refs/heads/master | 2020-06-30T07:30:16.464629 | 2019-08-06T01:15:46 | 2019-08-06T01:18:57 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 867 | h | /**
* Copyright (c) 2017-present, Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef GLOW_TORCH_GLOW_SRC_FUSINGOPTIMIZER_H
#define GLOW_TORCH_GLOW_SRC_FUSINGOPTIMIZER_H
#include <torch/csrc/jit/ir.h>
namespace glow {
void FuseLinear(std::shared_ptr<torch::jit::Graph> &graph);
}
#endif // GLOW_TORCH_GLOW_SRC_FUSINGOPTIMIZER_H
| [
"facebook-github-bot@users.noreply.github.com"
] | facebook-github-bot@users.noreply.github.com |
17083dfae08bf0975fc97cd625df1a43a4fe8472 | b85b494c0e8c1776d7b4643553693c1563df4b0b | /Chapter 15/task4.h | 59ed6f00de439e99a71853b4824cb383cd02dff4 | [] | no_license | lut1y/Stephen_Prata_Ansi_C_plusplus-6thE-Code-Example-and-Answers | c9d1f79b66ac7ed7f48b3ce85de3c7ae9337cb58 | e14dd78639b1016ed8f842e8adaa597347c4446e | refs/heads/master | 2023-07-05T13:08:51.860207 | 2021-08-12T16:02:34 | 2021-08-12T16:02:34 | 393,147,210 | 0 | 0 | null | null | null | null | WINDOWS-1251 | C++ | false | false | 3,111 | h | #ifndef TASK4_H_
#define TASK4_H_
#include <stdexcept>
#include <string>
using std::string;
namespace TASK4 {
class Sales {
public:
enum {MONTHS = 12}; // может быть статической константой
class bad_index : public std::logic_error {
private:
int bi; // недопустимое значение индекса
public:
explicit bad_index(int ix,
const std::string & s = "Index error in Sales object\n");
int bi_val() const {return bi;}
virtual ~bad_index() throw() {}
};
explicit Sales(int yy = 0);
Sales(int yy, const double * gr, int n);
virtual ~Sales() { }
int Year() const { return year; }
virtual double operator[](int i) const;
virtual double & operator[](int i);
private:
double gross[MONTHS];
int year;
};
class LabeledSales : public Sales {
public:
class nbad_index : public Sales::bad_index {
private:
std::string lbl;
public:
nbad_index(const std::string & lb, int ix,
const std::string & s = "Index error in LabeledSales object\n");
const std::string & label_val() const {return lbl;}
virtual ~nbad_index() throw() {}
};
explicit LabeledSales(const std::string & lb = "none", int yy = 0);
LabeledSales(const std::string & lb, int yy, const double * gr, int n);
virtual ~LabeledSales() { }
const std::string & Label() const {return label;}
virtual double operator[](int i) const;
virtual double & operator[](int i);
private:
std::string label;
};
// ***** Описание методов *****
Sales::bad_index::bad_index(int ix, const string & s )
: std::logic_error(s), bi(ix) {}
Sales::Sales(int yy) {
year = yy;
for (int i = 0; i < MONTHS; ++i)
gross[i] = 0;
}
Sales::Sales(int yy, const double * gr, int n) {
year = yy;
int lim = (n < MONTHS)? n : MONTHS;
int i;
for (i = 0; i < lim; ++i)
gross[i] = gr[i];
// для i > n и i < MONTHS
for ( ; i < MONTHS; ++i)
gross[i] = 0;
}
double Sales::operator[](int i) const {
if(i < 0 || i >= MONTHS)
throw bad_index(i);
return gross[i];
}
double & Sales::operator[](int i) {
if(i < 0 || i >= MONTHS)
throw bad_index(i);
return gross[i];
}
LabeledSales::nbad_index::nbad_index(const string & lb, int ix,
const string & s ) : Sales::bad_index(ix, s) {
lbl = lb;
}
LabeledSales::LabeledSales(const string & lb, int yy)
: Sales(yy) {
label = lb;
}
LabeledSales::LabeledSales(const string & lb, int yy, const double * gr, int n)
: Sales(yy, gr, n) {
label = lb;
}
double LabeledSales::operator[](int i) const {
if(i < 0 || i >= MONTHS)
throw nbad_index(Label(), i);
return Sales::operator[](i);
}
double & LabeledSales::operator[](int i) {
if(i < 0 || i >= MONTHS)
throw nbad_index(Label(), i);
return Sales::operator[](i);
}
}
#endif
| [
"lut1y@mail.ru"
] | lut1y@mail.ru |
310601ac771913858c66bca0bea2a7f80230fcaa | 5322a839683e485fb6778d1a0b3849601c34bb19 | /VBO.cpp | 89e092b0d72cbfd442884c68a9e79d5e3763b404 | [] | no_license | Patrikgyllvin/Game-Prototype | 64a793bb642b36d469dc650eddaa071bb61c546e | db2941e2ef22d294cc3332ec01f125a9e5c8e98f | refs/heads/master | 2022-04-09T05:55:14.917957 | 2020-02-14T19:23:47 | 2020-02-14T19:23:47 | 240,491,210 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 392 | cpp | #include "VBO.h"
void VBO::create()
{
glGenBuffers( 1, &id );
}
void VBO::bufferData( GLsizei size, GLvoid* data, GLenum drawMode)
{
glBufferData( GL_ARRAY_BUFFER, size, data, drawMode );
}
void VBO::bind()
{
glBindBuffer( GL_ARRAY_BUFFER, id );
}
void VBO::unbind()
{
glBindBuffer( GL_ARRAY_BUFFER, 0 );
}
void VBO::destroy()
{
glDeleteBuffers( 1, &id );
} | [
"patrikgyllvin@icloud.com"
] | patrikgyllvin@icloud.com |
10b3f5dde4be683414b5e066635e093551c0cbe3 | 88ae8695987ada722184307301e221e1ba3cc2fa | /chrome/browser/ui/web_applications/app_browser_controller.cc | f47307596cc1185ec2b42ff739a35bc516aaf917 | [
"BSD-3-Clause"
] | permissive | iridium-browser/iridium-browser | 71d9c5ff76e014e6900b825f67389ab0ccd01329 | 5ee297f53dc7f8e70183031cff62f37b0f19d25f | refs/heads/master | 2023-08-03T16:44:16.844552 | 2023-07-20T15:17:00 | 2023-07-23T16:09:30 | 220,016,632 | 341 | 40 | BSD-3-Clause | 2021-08-13T13:54:45 | 2019-11-06T14:32:31 | null | UTF-8 | C++ | false | false | 23,246 | cc | // Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/ui/web_applications/app_browser_controller.h"
#include "base/feature_list.h"
#include "base/functional/bind.h"
#include "base/strings/escape.h"
#include "base/strings/string_piece.h"
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ssl/security_state_tab_helper.h"
#include "chrome/browser/themes/browser_theme_pack.h"
#include "chrome/browser/themes/theme_properties.h"
#include "chrome/browser/themes/theme_service.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_list.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/browser_window_state.h"
#include "chrome/browser/ui/color/chrome_color_id.h"
#include "chrome/browser/ui/tabs/tab_menu_model_factory.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/common/chrome_features.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/themes/autogenerated_theme_util.h"
#include "chrome/grit/generated_resources.h"
#include "chromeos/constants/chromeos_features.h"
#include "components/security_state/core/security_state.h"
#include "components/url_formatter/url_formatter.h"
#include "components/webapps/browser/installable/installable_manager.h"
#include "content/public/browser/navigation_controller.h"
#include "content/public/browser/navigation_entry.h"
#include "content/public/browser/navigation_handle.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/url_constants.h"
#include "extensions/common/constants.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/base/models/image_model.h"
#include "ui/color/color_id.h"
#include "ui/color/color_recipe.h"
#include "ui/color/color_transform.h"
#include "ui/display/display.h"
#include "ui/display/screen.h"
#include "ui/gfx/color_palette.h"
#include "ui/gfx/color_utils.h"
#include "ui/gfx/favicon_size.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/resize_utils.h"
#include "ui/gfx/image/image_skia.h"
#include "ui/native_theme/native_theme.h"
#include "url/gurl.h"
#include "url/origin.h"
#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "chrome/browser/apps/icon_standardizer.h"
#include "chrome/browser/ash/system_web_apps/types/system_web_app_delegate.h"
#include "chromeos/ui/base/chromeos_ui_constants.h"
#endif
namespace {
SkColor GetAltColor(SkColor color) {
return color_utils::BlendForMinContrast(
color, color, absl::nullopt,
kAutogeneratedThemeActiveTabPreferredContrast)
.color;
}
} // namespace
namespace web_app {
// static
bool AppBrowserController::IsWebApp(const Browser* browser) {
return browser && browser->app_controller();
}
// static
bool AppBrowserController::IsForWebApp(const Browser* browser,
const AppId& app_id) {
return IsWebApp(browser) && browser->app_controller()->app_id() == app_id;
}
// static
Browser* AppBrowserController::FindForWebApp(const Profile& profile,
const AppId& app_id) {
const BrowserList* browser_list = BrowserList::GetInstance();
for (auto it = browser_list->begin_browsers_ordered_by_activation();
it != browser_list->end_browsers_ordered_by_activation(); ++it) {
Browser* browser = *it;
if (browser->type() == Browser::TYPE_POPUP)
continue;
if (browser->profile() != &profile)
continue;
if (!IsForWebApp(browser, app_id))
continue;
return browser;
}
return nullptr;
}
// static
std::u16string AppBrowserController::FormatUrlOrigin(
const GURL& url,
url_formatter::FormatUrlTypes format_types) {
auto origin = url::Origin::Create(url);
return url_formatter::FormatUrl(origin.opaque() ? url : origin.GetURL(),
format_types, base::UnescapeRule::SPACES,
nullptr, nullptr, nullptr);
}
const ui::ThemeProvider* AppBrowserController::GetThemeProvider() const {
return theme_provider_.get();
}
AppBrowserController::AppBrowserController(
Browser* browser,
AppId app_id,
bool has_tab_strip)
: content::WebContentsObserver(nullptr),
browser_(browser),
app_id_(std::move(app_id)),
has_tab_strip_(has_tab_strip),
theme_provider_(
ThemeService::CreateBoundThemeProvider(browser_->profile(), this)) {
browser->tab_strip_model()->AddObserver(this);
}
AppBrowserController::AppBrowserController(Browser* browser, AppId app_id)
: AppBrowserController(browser, std::move(app_id), false) {}
void AppBrowserController::Init() {
UpdateThemePack();
}
AppBrowserController::~AppBrowserController() {
browser()->tab_strip_model()->RemoveObserver(this);
}
bool AppBrowserController::ShouldShowCustomTabBar() const {
if (!IsInstalled())
return false;
content::WebContents* web_contents =
browser()->tab_strip_model()->GetActiveWebContents();
if (!web_contents)
return false;
GURL start_url = GetAppStartUrl();
base::StringPiece start_url_scheme = start_url.scheme_piece();
bool is_internal_start_url_scheme =
start_url_scheme == extensions::kExtensionScheme ||
start_url_scheme == content::kChromeUIScheme ||
start_url_scheme == content::kChromeUIUntrustedScheme;
auto should_show_toolbar_for_url = [&](const GURL& url) -> bool {
// If the url is unset, it doesn't give a signal as to whether the toolbar
// should be shown or not. In lieu of more information, do not show the
// toolbar.
if (url.is_empty())
return false;
// Show toolbar when not using 'https', unless this is an internal app,
// or origin is secure (e.g. localhost).
if (!is_internal_start_url_scheme && !url.SchemeIs(url::kHttpsScheme) &&
!webapps::InstallableManager::IsOriginConsideredSecure(url)) {
return true;
}
// Page URLs that are not within scope
// (https://www.w3.org/TR/appmanifest/#dfn-within-scope) of the app
// corresponding to |start_url| show the toolbar.
return !IsUrlInAppScope(url);
};
GURL visible_url = web_contents->GetVisibleURL();
GURL last_committed_url = web_contents->GetLastCommittedURL();
if (last_committed_url.is_empty() && visible_url.is_empty())
return should_show_toolbar_for_url(initial_url());
if (should_show_toolbar_for_url(visible_url) ||
should_show_toolbar_for_url(last_committed_url)) {
return true;
}
// Insecure external web sites show the toolbar.
// Note: IsContentSecure is false until a navigation is committed.
if (!last_committed_url.is_empty() && !is_internal_start_url_scheme &&
!webapps::InstallableManager::IsContentSecure(web_contents)) {
return true;
}
return false;
}
bool AppBrowserController::has_tab_strip() const {
return has_tab_strip_;
}
bool AppBrowserController::HasTitlebarMenuButton() const {
#if BUILDFLAG(IS_CHROMEOS_ASH)
// Hide for system apps.
return !system_app();
#else
return true;
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
}
bool AppBrowserController::HasTitlebarAppOriginText() const {
bool hide = base::FeatureList::IsEnabled(features::kHideWebAppOriginText);
#if BUILDFLAG(IS_CHROMEOS_ASH)
// Do not show origin text for System Apps.
if (system_app())
hide = true;
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
return !hide;
}
bool AppBrowserController::HasTitlebarContentSettings() const {
#if BUILDFLAG(IS_CHROMEOS_ASH)
// Do not show content settings for System Apps.
return !system_app();
#else
return true;
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
}
std::vector<PageActionIconType> AppBrowserController::GetTitleBarPageActions()
const {
#if BUILDFLAG(IS_CHROMEOS_ASH)
if (system_app()) {
return {PageActionIconType::kFind, PageActionIconType::kZoom};
}
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
std::vector<PageActionIconType> types_enabled;
types_enabled.push_back(PageActionIconType::kFind);
types_enabled.push_back(PageActionIconType::kManagePasswords);
types_enabled.push_back(PageActionIconType::kTranslate);
types_enabled.push_back(PageActionIconType::kZoom);
types_enabled.push_back(PageActionIconType::kFileSystemAccess);
types_enabled.push_back(PageActionIconType::kCookieControls);
types_enabled.push_back(PageActionIconType::kLocalCardMigration);
types_enabled.push_back(PageActionIconType::kSaveCard);
return types_enabled;
}
bool AppBrowserController::IsInstalled() const {
return false;
}
std::unique_ptr<TabMenuModelFactory>
AppBrowserController::GetTabMenuModelFactory() const {
return nullptr;
}
bool AppBrowserController::AppUsesWindowControlsOverlay() const {
return false;
}
bool AppBrowserController::AppUsesBorderlessMode() const {
return false;
}
bool AppBrowserController::AppUsesTabbed() const {
return false;
}
bool AppBrowserController::IsIsolatedWebApp() const {
return false;
}
void AppBrowserController::SetIsolatedWebAppTrueForTesting() {}
bool AppBrowserController::IsWindowControlsOverlayEnabled() const {
return false;
}
void AppBrowserController::ToggleWindowControlsOverlayEnabled(
base::OnceClosure on_complete) {
std::move(on_complete).Run();
}
gfx::Rect AppBrowserController::GetDefaultBounds() const {
return gfx::Rect();
}
bool AppBrowserController::HasReloadButton() const {
return true;
}
#if !BUILDFLAG(IS_CHROMEOS)
bool AppBrowserController::HasProfileMenuButton() const {
return false;
}
#endif // !BUILDFLAG(IS_CHROMEOS)
#if BUILDFLAG(IS_CHROMEOS_ASH)
const ash::SystemWebAppDelegate* AppBrowserController::system_app() const {
return nullptr;
}
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
std::u16string AppBrowserController::GetLaunchFlashText() const {
// Isolated Web Apps should show the app's name instead of the origin.
// App Short Name is considered trustworthy because manifest comes from signed
// web bundle.
// TODO:(crbug.com/b/1394199) Disable IWA launch flash text for OSs that
// already display name on title bar.
if (IsIsolatedWebApp()) {
return GetAppShortName();
}
return GetFormattedUrlOrigin();
}
bool AppBrowserController::IsHostedApp() const {
return false;
}
WebAppBrowserController* AppBrowserController::AsWebAppBrowserController() {
return nullptr;
}
bool AppBrowserController::CanUserUninstall() const {
return false;
}
void AppBrowserController::Uninstall(
webapps::WebappUninstallSource webapp_uninstall_source) {
NOTREACHED();
}
void AppBrowserController::UpdateCustomTabBarVisibility(bool animate) const {
browser()->window()->UpdateCustomTabBarVisibility(ShouldShowCustomTabBar(),
animate);
}
void AppBrowserController::DidStartNavigation(
content::NavigationHandle* navigation_handle) {
if (!initial_url().is_empty())
return;
if (!navigation_handle->IsInPrimaryMainFrame())
return;
if (navigation_handle->GetURL().is_empty())
return;
SetInitialURL(navigation_handle->GetURL());
}
void AppBrowserController::DidFinishNavigation(
content::NavigationHandle* navigation_handle) {
if (!navigation_handle->IsInPrimaryMainFrame() ||
navigation_handle->IsSameDocument())
return;
// For borderless mode when we navigate out of scope and then back to scope,
// the draggable regions stay same and nothing triggers to re-initialize them.
// So if they are cleared, they don't work anymore when coming back to scope.
if (AppUsesBorderlessMode())
return;
// Reset the draggable regions so they are not cached on navigation.
draggable_region_ = absl::nullopt;
}
void AppBrowserController::DOMContentLoaded(
content::RenderFrameHost* render_frame_host) {
// We hold off changing theme color for a new tab until the page is loaded.
UpdateThemePack();
}
void AppBrowserController::DidChangeThemeColor() {
UpdateThemePack();
}
void AppBrowserController::OnBackgroundColorChanged() {
UpdateThemePack();
}
absl::optional<SkColor> AppBrowserController::GetThemeColor() const {
ui::NativeTheme* native_theme = ui::NativeTheme::GetInstanceForNativeUi();
if (native_theme->InForcedColorsMode()) {
// use system [Window ThemeColor] when enable high contrast
return native_theme->GetSystemThemeColor(
ui::NativeTheme::SystemThemeColor::kWindow);
}
absl::optional<SkColor> result;
// HTML meta theme-color tag overrides manifest theme_color, see spec:
// https://www.w3.org/TR/appmanifest/#theme_color-member
content::WebContents* web_contents =
browser()->tab_strip_model()->GetActiveWebContents();
if (web_contents) {
absl::optional<SkColor> color = web_contents->GetThemeColor();
if (color)
result = color;
}
if (!result)
return absl::nullopt;
// The frame/tabstrip code expects an opaque color.
return SkColorSetA(*result, SK_AlphaOPAQUE);
}
absl::optional<SkColor> AppBrowserController::GetBackgroundColor() const {
absl::optional<SkColor> color;
if (auto* web_contents = browser()->tab_strip_model()->GetActiveWebContents())
color = web_contents->GetBackgroundColor();
return color ? SkColorSetA(*color, SK_AlphaOPAQUE) : color;
}
std::u16string AppBrowserController::GetTitle() const {
content::WebContents* web_contents =
browser()->tab_strip_model()->GetActiveWebContents();
if (!web_contents)
return std::u16string();
content::NavigationEntry* entry =
web_contents->GetController().GetVisibleEntry();
return entry ? entry->GetTitle() : std::u16string();
}
std::string AppBrowserController::GetTitleForMediaControls() const {
#if BUILDFLAG(IS_CHROMEOS_ASH)
// Only return the app name if we're a System Web App.
if (system_app())
return base::UTF16ToUTF8(GetAppShortName());
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
return std::string();
}
GURL AppBrowserController::GetAppNewTabUrl() const {
return GetAppStartUrl();
}
bool AppBrowserController::IsUrlInHomeTabScope(const GURL& url) const {
return false;
}
bool AppBrowserController::ShouldShowAppIconOnTab(int index) const {
return false;
}
#if BUILDFLAG(IS_MAC)
bool AppBrowserController::AlwaysShowToolbarInFullscreen() const {
return true;
}
void AppBrowserController::ToggleAlwaysShowToolbarInFullscreen() {}
#endif
void AppBrowserController::OnTabStripModelChanged(
TabStripModel* tab_strip_model,
const TabStripModelChange& change,
const TabStripSelectionChange& selection) {
if (selection.active_tab_changed()) {
content::WebContentsObserver::Observe(selection.new_contents);
// Update theme when tabs change unless there are no tabs, or if the tab has
// not finished loading, we will update later in DOMContentLoaded().
if (tab_strip_model->count() > 0 &&
selection.new_contents->IsDocumentOnLoadCompletedInPrimaryMainFrame()) {
UpdateThemePack();
}
}
if (change.type() == TabStripModelChange::kInserted) {
for (const auto& contents : change.GetInsert()->contents)
OnTabInserted(contents.contents);
} else if (change.type() == TabStripModelChange::kRemoved) {
for (const auto& contents : change.GetRemove()->contents)
OnTabRemoved(contents.contents);
// WebContents should be null when the last tab is closed.
DCHECK_EQ(web_contents() == nullptr, tab_strip_model->empty());
}
// Do not update the UI during window shutdown.
if (!selection.new_contents) {
return;
}
UpdateCustomTabBarVisibility(/*animate=*/false);
}
CustomThemeSupplier* AppBrowserController::GetThemeSupplier() const {
return theme_pack_.get();
}
bool AppBrowserController::ShouldUseCustomFrame() const {
return true;
}
void AppBrowserController::AddColorMixers(
ui::ColorProvider* provider,
const ui::ColorProviderManager::Key& key) const {
constexpr SkAlpha kSeparatorOpacity = 0.15f * 255.0f;
#if !BUILDFLAG(IS_CHROMEOS_ASH)
// This color is the same as the default active frame color.
const absl::optional<SkColor> theme_color = GetThemeColor();
ui::ColorTransform default_background =
key.color_mode == ui::ColorProviderManager::ColorMode::kLight
? ui::ColorTransform(ui::kColorFrameActiveUnthemed)
: ui::HSLShift(ui::kColorFrameActiveUnthemed,
ThemeProperties::GetDefaultTint(
ThemeProperties::TINT_FRAME, true));
#endif
ui::ColorMixer& mixer = provider->AddMixer();
absl::optional<SkColor> bg_color = GetBackgroundColor();
// TODO(kylixrd): The definition of kColorPwaBackground isn't fully fleshed
// out yet. Whether or not the PWA background color is set is used in many
// locations to derive other colors. Those specific locations would need to be
// addressed in their own context.
if (bg_color)
mixer[kColorPwaBackground] = {bg_color.value()};
mixer[kColorPwaMenuButtonIcon] = {kColorToolbarButtonIcon};
mixer[kColorPwaSecurityChipForeground] = {ui::kColorSecondaryForeground};
mixer[kColorPwaSecurityChipForegroundDangerous] = {
ui::kColorAlertHighSeverity};
mixer[kColorPwaSecurityChipForegroundPolicyCert] = {
ui::kColorDisabledForeground};
mixer[kColorPwaSecurityChipForegroundSecure] = {
kColorPwaSecurityChipForeground};
auto separator_color =
ui::GetColorWithMaxContrast(kColorPwaToolbarBackground);
mixer[kColorPwaTabBarBottomSeparator] = ui::AlphaBlend(
separator_color, kColorPwaToolbarBackground, kSeparatorOpacity);
mixer[kColorPwaTabBarTopSeparator] =
ui::AlphaBlend(separator_color, kColorPwaTheme, kSeparatorOpacity);
#if BUILDFLAG(IS_CHROMEOS_ASH)
// Ash system frames differ from ChromeOS browser frames.
mixer[kColorPwaTheme] = {chromeos::kDefaultFrameColor};
#else
mixer[kColorPwaTheme] = theme_color ? ui::ColorTransform(theme_color.value())
: default_background;
#endif
mixer[kColorPwaToolbarBackground] = {ui::kColorEndpointBackground};
mixer[kColorPwaToolbarButtonIcon] =
ui::DeriveDefaultIconColor(ui::kColorEndpointForeground);
mixer[kColorPwaToolbarButtonIconDisabled] =
ui::SetAlpha(kColorPwaToolbarButtonIcon, gfx::kDisabledControlAlpha);
if (bg_color)
mixer[kColorWebContentsBackground] = {kColorPwaBackground};
mixer[kColorInfoBarBackground] = {kColorPwaToolbarBackground};
mixer[kColorInfoBarForeground] = {kColorPwaToolbarButtonIcon};
}
void AppBrowserController::OnReceivedInitialURL() {
UpdateCustomTabBarVisibility(/*animate=*/false);
// If the window bounds have not been overridden, there is no need to resize
// the window.
if (!browser()->bounds_overridden())
return;
// The saved bounds will only be wrong if they are content bounds.
if (!chrome::SavedBoundsAreContentBounds(browser()))
return;
// TODO(crbug.com/964825): Correctly set the window size at creation time.
// This is currently not possible because the current url is not easily known
// at popup construction time.
browser()->window()->SetContentsSize(browser()->override_bounds().size());
}
void AppBrowserController::OnTabInserted(content::WebContents* contents) {
if (!contents->GetVisibleURL().is_empty() && initial_url_.is_empty())
SetInitialURL(contents->GetVisibleURL());
}
void AppBrowserController::OnTabRemoved(content::WebContents* contents) {}
ui::ImageModel AppBrowserController::GetFallbackAppIcon() const {
gfx::ImageSkia page_icon = browser()->GetCurrentPageIcon().AsImageSkia();
if (!page_icon.isNull()) {
#if BUILDFLAG(IS_CHROMEOS_ASH)
return ui::ImageModel::FromImageSkia(
apps::CreateStandardIconImage(page_icon));
#else
return ui::ImageModel::FromImageSkia(page_icon);
#endif
}
// The icon may be loading still. Return a transparent icon rather
// than using a placeholder to avoid flickering.
SkBitmap bitmap;
bitmap.allocN32Pixels(gfx::kFaviconSize, gfx::kFaviconSize);
bitmap.eraseColor(SK_ColorTRANSPARENT);
return ui::ImageModel::FromImageSkia(
gfx::ImageSkia::CreateFrom1xBitmap(bitmap));
}
void AppBrowserController::UpdateDraggableRegion(const SkRegion& region) {
draggable_region_ = region;
if (on_draggable_region_set_for_testing_)
std::move(on_draggable_region_set_for_testing_).Run();
}
void AppBrowserController::SetOnUpdateDraggableRegionForTesting(
base::OnceClosure done) {
on_draggable_region_set_for_testing_ = std::move(done);
}
void AppBrowserController::UpdateThemePack() {
absl::optional<SkColor> theme_color = GetThemeColor();
AutogeneratedThemeColors colors;
// TODO(crbug.com/1053823): Add tests for theme properties being set in this
// branch.
absl::optional<SkColor> background_color = GetBackgroundColor();
if (theme_color == last_theme_color_ &&
background_color == last_background_color_) {
return;
}
last_theme_color_ = theme_color;
last_background_color_ = background_color;
bool ignore_custom_colors = false;
#if BUILDFLAG(IS_CHROMEOS_ASH)
// Some system web apps use the system theme color, and should not update
// the theme pack here. Otherwise the colorIds for the window caption bar will
// be remapped through `BrowserThemePack::BuildFromColors`, and colors will be
// resolved differently than the colors set in the function `AddUiColorMixer`.
if (chromeos::features::IsJellyrollEnabled() && system_app() &&
system_app()->UseSystemThemeColor()) {
ignore_custom_colors = true;
}
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
bool no_custom_colors = !theme_color && !background_color;
bool non_tabbed_no_frame_color = !has_tab_strip_ && !theme_color;
if (ignore_custom_colors || no_custom_colors || non_tabbed_no_frame_color) {
theme_pack_ = nullptr;
if (browser_->window()) {
browser_->window()->UserChangedTheme(
BrowserThemeChangeType::kWebAppTheme);
}
return;
}
if (!theme_color) {
theme_color = GetAltColor(*background_color);
} else if (!background_color) {
background_color =
ui::NativeTheme::GetInstanceForNativeUi()->ShouldUseDarkColors()
? gfx::kGoogleGrey900
: SK_ColorWHITE;
}
// For regular web apps, frame gets theme color and active tab gets
// background color.
colors.frame_color = *theme_color;
colors.active_tab_color = *background_color;
colors.ntp_color = *background_color;
colors.frame_text_color =
color_utils::GetColorWithMaxContrast(colors.frame_color);
colors.active_tab_text_color =
color_utils::GetColorWithMaxContrast(colors.active_tab_color);
theme_pack_ = base::MakeRefCounted<BrowserThemePack>(
ui::ColorProviderManager::ThemeInitializerSupplier::ThemeType::
kAutogenerated);
BrowserThemePack::BuildFromColors(colors, theme_pack_.get());
if (browser_->window())
browser_->window()->UserChangedTheme(BrowserThemeChangeType::kWebAppTheme);
}
void AppBrowserController::SetInitialURL(const GURL& initial_url) {
DCHECK(initial_url_.is_empty());
initial_url_ = initial_url;
OnReceivedInitialURL();
}
} // namespace web_app
| [
"jengelh@inai.de"
] | jengelh@inai.de |
0b525721b405fd1ab3f27640276e34b2c801731d | dd129fb6461d1b44dceb196caaa220e9f8398d18 | /topics/eventloop/eventloop-two-timers.cc | 22c7e1d8ed6f653bcdde3cb196fd38a3cd4fa793 | [] | no_license | jfasch/jf-linux-trainings | 3af777b4c603dd5c3f6832c0034be44a062b493a | aebff2e6e0f98680aa14e1b7ad4a22e73a6f31b4 | refs/heads/master | 2020-04-29T19:13:33.398276 | 2020-03-29T20:45:33 | 2020-03-29T20:45:33 | 176,347,614 | 0 | 1 | null | 2019-10-01T06:02:49 | 2019-03-18T18:35:28 | C++ | UTF-8 | C++ | false | false | 1,482 | cc | #include <jf/eventloop-epoll.h>
#include <jf/timerfd.h>
#include <jf/graceful-termination.h>
#include <iostream>
int main()
{
try {
jf::EventLoop_epoll loop;
jf::GracefulTermination graceful_termination({SIGTERM, SIGINT, SIGQUIT});
jf::PeriodicTimerFD timer1(/*initial: 1s*/{1, 0}, /*interval: 1s*/{1, 0});
jf::PeriodicTimerFD timer2(/*initial: 2s*/{2, 0}, /*interval: 2s*/{2, 0});
auto graceful_termination_callback =
[&graceful_termination](int, jf::EventLoop*) {
graceful_termination.set_requested();
};
auto timer1_callback =
[&timer1](int, jf::EventLoop*) {
std::cout << "Timer 1 expired " << timer1.reap_expirations() << " times" << std::endl;
};
auto timer2_callback =
[&timer2](int, jf::EventLoop*) {
std::cout << "Timer 2 expired " << timer2.reap_expirations() << " times" << std::endl;
};
loop.watch_in(graceful_termination.fd(), graceful_termination_callback);
loop.watch_in(timer1.fd(), timer1_callback);
loop.watch_in(timer2.fd(), timer2_callback);
timer1.start();
timer2.start();
// run
while (! graceful_termination.requested())
loop.run_one();
std::cout << "Shutdown ..." << std::endl;
}
catch (const std::exception& e) {
std::cerr << e.what() << std::endl;
exit(1);
}
}
| [
"jf@faschingbauer.co.at"
] | jf@faschingbauer.co.at |
94e669be9b40a1f541158b0e955e9253ba4db318 | 9916fcf60ec7699108a95cc4d6b891463d7910eb | /tests/when_all.h | b5c66703450723ce0fd1269d9f599993f98354b9 | [
"Apache-2.0"
] | permissive | dgu123/club | 2c29dad187a1d2607aa09dc8d3832305111c978e | b542772f88d5030c575c4165f92ca4a8561c942e | refs/heads/master | 2021-01-20T23:18:09.167808 | 2016-06-21T12:25:00 | 2016-06-21T12:25:00 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,486 | h | // Copyright 2016 Peter Jankuliak
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef __WHEN_ALL_H__
#define __WHEN_ALL_H__
class WhenAll {
using Handler = std::function<void()>;
public:
template<class H> WhenAll(H handler)
: _instance_count(new size_t(0))
, _handler(std::make_shared<Handler>(std::move(handler)))
{}
WhenAll()
: _instance_count(new size_t(0))
, _handler(std::make_shared<Handler>())
{}
WhenAll(const WhenAll&) = delete;
void operator=(const WhenAll&) = delete;
std::function<void()> make_continuation() {
auto handler = _handler;
auto count = _instance_count;
++*count;
return [handler, count]() {
if (--*count == 0) {
(*handler)();
}
};
}
template<class F> void on_complete(F on_complete) {
*_handler = std::move(on_complete);
}
private:
std::shared_ptr<size_t> _instance_count;
std::shared_ptr<Handler> _handler;
};
#endif // ifndef __WHEN_ALL_H__
| [
"p.jankuliak@gmail.com"
] | p.jankuliak@gmail.com |
10d7b6308f48dd63e96a733d92e792065951b2ef | b22588340d7925b614a735bbbde1b351ad657ffc | /athena/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/util/EGIdentification_mem_check.cxx | 44cd4cd017577e52bdfb48f10c049dcacb7d52c6 | [] | no_license | rushioda/PIXELVALID_athena | 90befe12042c1249cbb3655dde1428bb9b9a42ce | 22df23187ef85e9c3120122c8375ea0e7d8ea440 | refs/heads/master | 2020-12-14T22:01:15.365949 | 2020-01-19T03:59:35 | 2020-01-19T03:59:35 | 234,836,993 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,145 | cxx | /*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
/* To run with something like
valgrind --tool=memcheck --leak-check=full --suppressions=$ROOTSYS/etc/valgrind-root.supp --error-limit=no --track-origins=yes --smc-check=all --trace-children=yes --track-fds=yes --num-callers=30 $ROOTCOREBIN/bin/x86_64-slc6-gcc49-opt/EGIdentification_mem_check>valgrind.log 2>&1 &
In order to identify memory leaks in out methods
Look here:
http://valgrind.org/docs/manual/faq.html#faq.deflost
*/
#include "EgammaAnalysisInterfaces/IAsgPhotonIsEMSelector.h"
#include "EgammaAnalysisInterfaces/IAsgForwardElectronIsEMSelector.h"
#include "EgammaAnalysisInterfaces/IAsgElectronIsEMSelector.h"
#include "EgammaAnalysisInterfaces/IAsgElectronLikelihoodTool.h"
#include "AsgTools/AnaToolHandle.h"
#include "AsgTools/MessageCheck.h"
int main(){
using namespace asg::msgUserCode;
ANA_CHECK_SET_TYPE (int);
asg::AnaToolHandle<IAsgElectronLikelihoodTool> MediumLH("AsgElectronLikelihoodTool/MediumLH");
ANA_CHECK(MediumLH.setProperty("WorkingPoint", "MediumLHElectron"));
ANA_CHECK(MediumLH.initialize());
return 0;
}
| [
"rushioda@lxplus754.cern.ch"
] | rushioda@lxplus754.cern.ch |
4af5e9134fc85f0051366bee500a5cd1f0e59bdc | 7ef1d66d1d27831558c2c7b4d756852264302643 | /FYP data 参考/Qt windows circel icon/circlebutton/topbutton/widget.h | ff6b3e83ed095076cae9d4af195cd3c67b32021d | [] | no_license | 15831944/Plasimo-display-assistant | 9598dcba9cda870d2d3a91b1526b59cecd5cb5c5 | 4bad6f353b4373e033d592ff4af70be1cac36fb4 | refs/heads/master | 2023-03-16T18:22:07.167578 | 2018-01-23T14:58:56 | 2018-01-23T14:58:56 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 484 | h | #ifndef WIDGET_H
#define WIDGET_H
#include <QWidget>
#include <QLabel>
#include <QButtonGroup>
namespace Ui {
class Widget;
}
class Widget : public QWidget
{
Q_OBJECT
public:
explicit Widget(QWidget *parent = 0);
~Widget();
private:
Ui::Widget *ui;
QLabel *labellog;//登录
QLabel *labellogm;//数字
QLabel *labellogmoney;//收银员
QButtonGroup *m_pushButtonGroup;
private slots:
void buttonslot(int num=0);
};
#endif // WIDGET_H
| [
"362914124@qq.com"
] | 362914124@qq.com |
3b2ae71c0f69ac779ae9f2bae43a9dd5430b3bb7 | 4ad2ec9e00f59c0e47d0de95110775a8a987cec2 | /_Practice/IOI wcipeg/Balancing Act/main.cpp | e441369534e0cb6ebd396243810be20229ce0ea0 | [] | no_license | atatomir/work | 2f13cfd328e00275672e077bba1e84328fccf42f | e8444d2e48325476cfbf0d4cfe5a5aa1efbedce9 | refs/heads/master | 2021-01-23T10:03:44.821372 | 2021-01-17T18:07:15 | 2021-01-17T18:07:15 | 33,084,680 | 2 | 1 | null | 2015-08-02T20:16:02 | 2015-03-29T18:54:24 | C++ | UTF-8 | C++ | false | false | 1,448 | cpp | #include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;
#define maxN 20011
int n,i,x,y;
vector<int> list[maxN];
int dad[maxN],dpDown[maxN],dpUp[maxN],dpMax[maxN];
int ans,ansid;
void dfs(int node){
dpDown[node]=1;
for(int i=0;i<list[node].size();i++){
int newNode = list[node][i];
if(dad[newNode]!=0) {
list[node][i] = list[node][ list[node].size()-1 ];
list[node].pop_back();
i--; continue;
}
dad[newNode] = node; dfs(newNode);
dpDown[node] += dpDown[newNode];
}
}
void dfsUp(int node){
for(int i =0;i<list[node].size();i++){
int newNode = list[node][i];
dpUp[newNode] = dpUp[node]+ dpDown[node]-dpDown[newNode] ;
dfsUp(newNode);
}
}
int main()
{
#ifndef ONLINE_JUDGE
freopen("test.in","r",stdin);
#endif // ONLINE_JUDGE
scanf("%d",&n);
for(i=1;i<n;i++){
scanf("%d%d",&x,&y);
list[x].push_back(y);
list[y].push_back(x);
}
dad[1] = -1;
dfs(1);
dpUp[1] = 0;
dfsUp(1);
for(i=1;i<=n;i++)
for(int j=0;j<list[i].size();j++)
dpMax[i] = max(dpMax[i], dpDown[ list[i][j] ] );
ans = 20001;
for(i=1;i<=n;i++){
int cc = max(dpUp[i],dpMax[i]);
if(cc<ans) {
ans = cc;
ansid = i;
}
}
printf("%d %d",ansid,ans);
return 0;
}
| [
"atatomir5@gmail.com"
] | atatomir5@gmail.com |
2b1e324688814e3f271b757d4a352f029bc7be87 | c5784387ccf8154a3526c7499d98cb5e3e30b079 | /code/themes/string/aho_corasick/DA/KeysTree.h | ae42d711813d9e6d9b07322f43917335cf5f80de | [] | no_license | ArtDu/Algorithms | a858f915338da7c3bb1ef707e39622fe73426b04 | 18a39e323d483d9cd1322b4b7465212c01fda43a | refs/heads/master | 2023-03-04T14:25:42.214472 | 2022-04-14T18:28:15 | 2022-04-14T18:28:15 | 197,545,456 | 3 | 3 | null | 2023-02-27T10:52:36 | 2019-07-18T08:27:49 | C++ | UTF-8 | C++ | false | false | 861 | h | //
// Created by art on 04.03.19.
//
#ifndef AHOCORASICK_KEYSTREE_H
#define AHOCORASICK_KEYSTREE_H
#include <iostream>
#include <map>
#include <vector>
#include <string>
#include <queue>
using namespace std;
class KTNode {
public:
map<string, KTNode *> to;
string _key;
vector<int32_t> _list;
int32_t dist;
KTNode *suffLink;
KTNode(string key, int32_t list, int32_t dist);
KTNode(string key, int32_t dist);
};
class KeysTree {
public:
KeysTree();
void BuildTree(vector<vector<string >> &patterns);
void Search(vector<pair<pair<int32_t, int32_t>, string >> &text);
void TreePrint();
private:
void NodePrint(KTNode *node, int dpth, std::string x);
void AddSuffLinks();
void BuildOnePattern(vector<string> &pattern, int32_t &pattNum);
KTNode *root;
};
#endif //AHOCORASICK_KEYSTREE_H
| [
"rusartdub@gmail.com"
] | rusartdub@gmail.com |
4231fcdc52fc78218aff850ac7279c5b20e03e86 | 1d78efdff80fa91f80b40e80555345c8ece58045 | /src/common/test/test_term_emitter.cpp | 40fb2edcf6da8b068f7f5c74d536d04b6c89eda5 | [] | no_license | monadicus/prologcoin | d40511962cc8d0361f0f04f537ad805b5c0183d2 | bece12ebea698b652a1b737e9aa07e22a1647106 | refs/heads/master | 2020-03-07T16:40:40.676306 | 2018-03-31T21:18:53 | 2018-03-31T21:18:53 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 6,498 | cpp | #include <iostream>
#include <iomanip>
#include <assert.h>
#include <common/term.hpp>
#include <common/term_ops.hpp>
#include <common/term_emitter.hpp>
using namespace prologcoin::common;
static void header( const std::string &str )
{
std::cout << "\n";
std::cout << "--- [" + str + "] " + std::string(60 - str.length(), '-') << "\n";
std::cout << "\n";
}
static void test_simple_term()
{
header("test_simple_term()");
heap h;
term_ops ops;
std::stringstream ss;
term_emitter emit(ss, h, ops);
con_cell h_2("h", 2);
con_cell f_1("f", 1);
con_cell p_3("p", 3);
auto h_2_str = h.new_str(h_2);
auto Z = h.arg(h_2_str, 0);
auto W = h.arg(h_2_str, 1);
auto f_1_str = h.new_str(f_1);
h.set_arg(f_1_str, 0, W);
auto p_3_str = h.new_str(p_3);
h.set_arg(p_3_str, 0, Z);
h.set_arg(p_3_str, 1, h_2_str);
h.set_arg(p_3_str, 2, f_1_str);
emit.print(p_3_str);
std::cout << ss.str() << "\n";
assert(ss.str() == "p(C, h(C, D), f(D))");
}
static size_t my_rand(size_t bound)
{
static uint64_t state = 4711;
if (bound == 0) {
state = 4711;
return 0;
}
state = 13*state + 734672631;
return state % bound;
}
static term new_term(heap &heap, size_t max_depth, size_t depth = 0)
{
size_t arity = (depth >= max_depth) ? 0 : my_rand(6);
char functorName[2];
functorName[0] = 'a' + (char)arity;
functorName[1] = '\0';
auto str = heap.new_str(con_cell(functorName, arity));
for (size_t j = 0; j < arity; j++) {
auto arg = new_term(heap, max_depth, depth+1);
heap.set_arg(str, j, arg);
}
return str;
}
const char *BIG_TERM_GOLD =
"e(b(e(b(e(a, a, a, a)), b(e(a, a, a, a)), b(e(a, a, a, a)), b(c(a, a)))), \n"
" f(e(b(e(a, a, a, a)), f(a, f(a, a, a, a, a), a, f(a, a, a, a, a), a), \n"
" b(e(a, a, a, a)), b(e(a, a, a, a))), \n"
" d(c(b(a), c(a, a)), f(a, b(a), a, d(a, a, a), e(a, a, a, a)), \n"
" f(c(a, a), b(a), c(a, a), f(a, a, a, a, a), a)), \n"
" b(e(f(a, a, a, a, a), e(a, a, a, a), b(a), c(a, a))), \n"
" f(e(f(a, a, a, a, a), c(a, a), b(a), e(a, a, a, a)), b(c(a, a)), \n"
" f(c(a, a), f(a, a, a, a, a), a, b(a), e(a, a, a, a)), \n"
" d(a, d(a, a, a), e(a, a, a, a)), b(e(a, a, a, a))), \n"
" d(c(b(a), c(a, a)), b(e(a, a, a, a)), d(e(a, a, a, a), d(a, a, a), a))), \n"
" b(e(d(e(a, a, a, a), f(a, a, a, a, a), c(a, a)), \n"
" f(c(a, a), f(a, a, a, a, a), c(a, a), b(a), e(a, a, a, a)), \n"
" b(e(a, a, a, a)), d(e(a, a, a, a), b(a), c(a, a)))), \n"
" f(a, \n"
" d(a, d(e(a, a, a, a), f(a, a, a, a, a), a), \n"
" f(c(a, a), b(a), e(a, a, a, a), b(a), a)), \n"
" d(a, d(c(a, a), b(a), c(a, a)), b(e(a, a, a, a))), b(a), \n"
" d(a, b(a), \n"
" f(e(a, a, a, a), d(a, a, a), c(a, a), d(a, a, a), e(a, a, a, a)))))\n";
static std::string cut(const char *from, const char *to)
{
std::string r;
for (const char *p = from; p < to; p++) {
r += (char)*p;
}
return r;
}
static void test_big_term()
{
header("test_big_term()");
heap h;
const size_t DEPTH = 5;
cell term = new_term(h, DEPTH);
std::stringstream ss;
term_ops ops;
term_emitter emitter(ss, h, ops);
emitter.set_max_column(78);
emitter.print(term);
ss << "\n";
std::string str = ss.str();
const char *goldScan = BIG_TERM_GOLD;
const char *actScan = str.c_str();
size_t lineCnt = 0;
bool err = false;
while (goldScan[0] != '\0') {
const char *goldNextLine = strchr(goldScan, '\n');
const char *actNextLine = strchr(actScan, '\n');
if (goldNextLine == NULL && actNextLine != NULL) {
std::cout << "There was no next line in gold template.\n";
std::cout << "Actual: " << cut(actScan, actNextLine) << "\n";
err = true;
break;
}
if (goldNextLine != NULL && actNextLine == NULL) {
std::cout << "Actual feed terminated to early.\n";
std::cout << "Expect: " << cut(goldScan, goldNextLine) << "\n";
err = true;
break;
}
size_t goldNextLineLen = goldNextLine - goldScan;
size_t actNextLineLen = actNextLine - actScan;
if (goldNextLineLen != actNextLineLen) {
std::cout << "Difference at line " << lineCnt << ":\n";
std::cout << "(Due to different lengths: ExpectLen: " << goldNextLineLen << " ActualLen: "<< actNextLineLen << ")\n";
std::cout << "Actual: " << cut(actScan, actNextLine) << "\n";
std::cout << "Expect: " << cut(goldScan, goldNextLine) << "\n";
err = true;
break;
}
std::string actual = cut(actScan, actNextLine);
std::string expect = cut(goldScan, goldNextLine);
if (actual != expect) {
std::cout << "Difference at line " << lineCnt << ":\n";
for (size_t i = 0; i < actual.length(); i++) {
if (actual[i] != expect[i]) {
std::cout << "(at column " << i << ")\n";
break;
}
}
std::cout << "Actual: " << actual << "\n";
std::cout << "Expect: " << expect << "\n";
err = true;
break;
}
goldScan = &goldNextLine[1];
actScan = &actNextLine[1];
lineCnt++;
}
if (!err) {
std::cout << str;
std::cout << "OK\n";
}
std::cout << "\n";
assert(!err);
}
static void test_ops()
{
header("test_ops()");
heap h;
term_ops ops;
std::stringstream ss;
term_emitter emit(ss, h, ops);
con_cell plus_2("+", 2);
con_cell times_2("*", 2);
con_cell mod_2("mod", 2);
con_cell pow_2("^", 2);
con_cell minus_1("-", 1);
auto plus_expr = h.new_str(plus_2);
auto plus_expr1 = h.new_str(plus_2);
h.set_arg(plus_expr1, 0, int_cell(1));
h.set_arg(plus_expr1, 1, int_cell(2));
h.set_arg(plus_expr, 0, plus_expr1);
h.set_arg(plus_expr, 1, int_cell(3));
auto times_expr = h.new_str(times_2);
h.set_arg(times_expr, 0, int_cell(42));
h.set_arg(times_expr, 1, plus_expr);
auto mod_expr = h.new_str(mod_2);
h.set_arg(mod_expr, 0, times_expr);
h.set_arg(mod_expr, 1, int_cell(100));
auto pow_expr = h.new_str(pow_2);
h.set_arg(pow_expr, 0, mod_expr);
h.set_arg(pow_expr, 1, int_cell(123));
auto minus1_expr = h.new_str(minus_1);
h.set_arg(minus1_expr, 0, pow_expr);
auto minus1_expr1 = h.new_str(minus_1);
h.set_arg(minus1_expr1, 0, minus1_expr);
emit.print(minus1_expr1);
std::cout << "Expr: " << ss.str() << "\n";
assert( ss.str() == "- - (42*(1+2+3) mod 100)^123" );
}
int main(int argc, char *argv[])
{
test_simple_term();
test_big_term();
test_ops();
return 0;
}
| [
"datavetaren@datavetaren.se"
] | datavetaren@datavetaren.se |
5b35a1aecaef850758742ab2a145d1e01768eb09 | cb393fe99ef421b9ea87f1a91d8fff7a74e2ddaa | /C言語プログラミング/3-1if文_List3-3.cpp | 7b46a8b4e6c7807f705ef6f6b0cd080865c9e84e | [] | no_license | yutatanaka/C_Programing | d1e8f8f5a88f53f7bc01375eb8f8c5a41faed6f7 | df8e2249ca512a76f0fd843f72b9c771da7e3a33 | refs/heads/master | 2021-01-20T19:19:35.239946 | 2017-02-02T15:09:23 | 2017-02-02T15:09:23 | 63,483,652 | 0 | 0 | null | null | null | null | SHIFT_JIS | C++ | false | false | 385 | cpp |
/*
if文・その2
読み込んだ整数値は5で割り切れないか
*/
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
int main()
{
int no;
printf("整数を入力してください:");
scanf("%d", &no);
if (no % 5)
{
puts("その数は5で割り切れません。");
}
else
{
puts("その数は5で割り切れます。");
}
getchar();
return 0;
} | [
"koryotennis99@gmail.com"
] | koryotennis99@gmail.com |
b9e5d4d496763b010fd48042946bce19ae46dde2 | e50b837397bd9ad03471de010fbfc09d58285454 | /src/iosocketdll/classes/CGenericMessage/CheckCheckSum.cpp | e9ef8c4bdae449a6d63c0818409a5382d4e1fbec | [] | no_license | tomy11245/spgame | 568db63706d05434bda0de33509142b03a4b65af | 295855b756127c582b9e750058175c4088e30d22 | refs/heads/master | 2021-01-20T09:41:02.970540 | 2015-01-15T09:25:50 | 2015-01-15T09:25:50 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 195 | cpp | bool __thiscall CGenericMessage::CheckCheckSum() //+2440
{
DecryptBody( (char *)(this+4) ,*(LPDWORD)this - 4);
if ( this->MakeDigest() == *(LPDWORD)(this+0xC) )
return false;
return true;
}
| [
"umehkg@users.noreply.github.com"
] | umehkg@users.noreply.github.com |
0a05971d92cfcfbb1e472d15677615954462b275 | 621ea614b1cd8c5c56cddf0a39f14f527e2209e9 | /libraries/nRF24L01/Projects/Дистанционное управление с обратной связью/TX_response/TX_response.ino | d976ba5be441b1fea227ac46320eb402fb9c3eac | [] | no_license | koson/ss2s_hub | ce2a1941b006ed02f773e07aa65012d3211d252c | f540acd050979788ef61ad14c456a719bfd66ad6 | refs/heads/master | 2023-03-19T00:54:31.489150 | 2020-04-04T00:04:15 | 2020-04-04T00:04:15 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,444 | ino | //--------------------- НАСТРОЙКИ ----------------------
#define CH_AMOUNT 8 // число каналов (должно совпадать с приёмником)
#define CH_NUM 0x60 // номер канала (должен совпадать с приёмником)
//--------------------- НАСТРОЙКИ ----------------------
//--------------------- ДЛЯ РАЗРАБОТЧИКОВ -----------------------
// УРОВЕНЬ МОЩНОСТИ ПЕРЕДАТЧИКА
// На выбор RF24_PA_MIN, RF24_PA_LOW, RF24_PA_HIGH, RF24_PA_MAX
#define SIG_POWER RF24_PA_LOW
// СКОРОСТЬ ОБМЕНА
// На выбор RF24_2MBPS, RF24_1MBPS, RF24_250KBPS
// должна быть одинакова на приёмнике и передатчике!
// при самой низкой скорости имеем самую высокую чувствительность и дальность!!
// ВНИМАНИЕ!!! enableAckPayload НЕ РАБОТАЕТ НА СКОРОСТИ 250 kbps!
#define SIG_SPEED RF24_1MBPS
//--------------------- ДЛЯ РАЗРАБОТЧИКОВ -----------------------
//--------------------- БИБЛИОТЕКИ ----------------------
#include <SPI.h>
#include "nRF24L01.h"
#include "RF24.h"
RF24 radio(9, 10); // "создать" модуль на пинах 9 и 10 Для Уно
//RF24 radio(9, 53); // для Меги
byte address[][6] = {"1Node", "2Node", "3Node", "4Node", "5Node", "6Node"}; // возможные номера труб
//--------------------- БИБЛИОТЕКИ ----------------------
//--------------------- ПЕРЕМЕННЫЕ ----------------------
int transmit_data[CH_AMOUNT]; // массив пересылаемых данных
int telemetry[2]; // массив принятых от приёмника данных телеметрии
byte rssi;
int trnsmtd_pack = 1, failed_pack;
unsigned long RSSI_timer;
//--------------------- ПЕРЕМЕННЫЕ ----------------------
void setup() {
Serial.begin(9600); // открываем порт для связи с ПК
radioSetup();
}
void loop() {
if (radio.write(&transmit_data, sizeof(transmit_data))) { // отправка пакета
trnsmtd_pack++;
if (!radio.available()) { // если получаем пустой ответ
} else {
while (radio.available() ) { // если в ответе что-то есть
radio.read(&telemetry, sizeof(telemetry)); // читаем
// получили забитый данными массив telemetry ответа от приёмника
}
}
} else {
failed_pack++;
}
if (millis() - RSSI_timer > 1000) { // таймер RSSI
// рассчёт качества связи (0 - 100%) на основе числа ошибок и числа успешных передач
rssi = (1 - ((float)failed_pack / trnsmtd_pack)) * 100;
// сбросить значения
failed_pack = 0;
trnsmtd_pack = 0;
RSSI_timer = millis();
}
}
void radioSetup() {
radio.begin(); // активировать модуль
radio.setAutoAck(1); // режим подтверждения приёма, 1 вкл 0 выкл
radio.setRetries(0, 15); // (время между попыткой достучаться, число попыток)
radio.enableAckPayload(); // разрешить отсылку данных в ответ на входящий сигнал
radio.setPayloadSize(32); // размер пакета, в байтах
radio.openWritingPipe(address[0]); // мы - труба 0, открываем канал для передачи данных
radio.setChannel(CH_NUM); // выбираем канал (в котором нет шумов!)
radio.setPALevel(SIG_POWER); // уровень мощности передатчика
radio.setDataRate(SIG_SPEED); // скорость обмена
// должна быть одинакова на приёмнике и передатчике!
// при самой низкой скорости имеем самую высокую чувствительность и дальность!!
radio.powerUp(); // начать работу
radio.stopListening(); // не слушаем радиоэфир, мы передатчик
}
| [
"ss.samsung86@gmail.com"
] | ss.samsung86@gmail.com |
483e5d73bd20c40b5af894cddef79d459722f374 | 6185d684498d6003c2fb968a87888a1c6f6fdc56 | /EpgDataCap3/EpgDataCap3/Descriptor/BroadcasterNameDesc.cpp | acc65bf8fece09ec1c6ca27e763422353a270871 | [] | no_license | Telurin/EDCB10.69_mod5 | 8a3791f497f20f7a82651fbf5c5615748c1a7e47 | 7585af187aa8fda74f2bb44bbb685264ecf566e1 | refs/heads/master | 2016-09-06T21:48:31.866335 | 2013-03-12T13:54:33 | 2013-03-12T13:54:33 | null | 0 | 0 | null | null | null | null | SHIFT_JIS | C++ | false | false | 1,596 | cpp | #include "StdAfx.h"
#include "BroadcasterNameDesc.h"
CBroadcasterNameDesc::CBroadcasterNameDesc(void)
{
char_nameLength = 0;
char_name = NULL;
}
CBroadcasterNameDesc::~CBroadcasterNameDesc(void)
{
SAFE_DELETE_ARRAY(char_name);
}
BOOL CBroadcasterNameDesc::Decode( BYTE* data, DWORD dataSize, DWORD* decodeReadSize )
{
if( data == NULL ){
return FALSE;
}
SAFE_DELETE_ARRAY(char_name);
char_nameLength = 0;
//////////////////////////////////////////////////////
//サイズのチェック
//最低限descriptor_tagとdescriptor_lengthのサイズは必須
if( dataSize < 2 ){
return FALSE;
}
//->サイズのチェック
DWORD readSize = 0;
//////////////////////////////////////////////////////
//解析処理
descriptor_tag = data[0];
descriptor_length = data[1];
readSize += 2;
if( descriptor_tag != 0xD8 ){
//タグ値がおかしい
_OutputDebugString( L"++++CBroadcasterNameDesc:: descriptor_tag err 0xD8 != 0x%02X", descriptor_tag );
return FALSE;
}
if( readSize+descriptor_length > dataSize ){
//サイズ異常
_OutputDebugString( L"++++CBroadcasterNameDesc:: size err %d > %d", readSize+descriptor_length, dataSize );
return FALSE;
}
if( descriptor_length > 0 ){
char_nameLength = descriptor_length;
char_name = new CHAR[char_nameLength +1];
if( char_nameLength > 0 ){
memcpy(char_name, data+readSize, char_nameLength);
}
char_name[char_nameLength] = '\0';
readSize += char_nameLength;
}else{
return FALSE;
}
//->解析処理
if( decodeReadSize != NULL ){
*decodeReadSize = 2+descriptor_length;
}
return TRUE;
}
| [
"epgdatabap@yahoo.co.jp"
] | epgdatabap@yahoo.co.jp |
b36ad3b4fabd2bc726ab9d2829a1c91b7aefbeeb | 32ada5e36b078504926dd55d7138f93adb7776b1 | /Library/TrainingFolder2020/amppz2018/k.cpp | 6634fe788b1b0cd3c2494a149bf7bf6e8e9f61d1 | [] | no_license | SourangshuGhosh/olympiad | 007a009adaeb9ecff3e2f5eb5e0b79f71dbca0b4 | d8574f07ef733350a55d0b4a705b4418d43437b6 | refs/heads/master | 2022-11-25T14:32:43.741953 | 2020-07-28T16:56:23 | 2020-07-28T16:56:23 | 283,265,127 | 4 | 0 | null | 2020-07-28T16:15:43 | 2020-07-28T16:15:42 | null | UTF-8 | C++ | false | false | 1,371 | cpp | #include <bits/stdc++.h>
using namespace std;
const int MAXN = 1000005;
using lint = long long;
int n;
char mnv[MAXN], mxv[MAXN], str[MAXN];
int hmax[MAXN], sfxmin[MAXN];
int sgn(char c){
if(c == '0') return 0;
if(c == '+') return 1;
return -1;
}
lint validate(char *c){
int csgn = 0; lint ret = 0;
for(int i=0; i<n; i++){
csgn += sgn(c[i]);
if(csgn < 0){
puts("NIE");
exit(0);
}
ret += csgn;
}
if(csgn != 0){
puts("NIE");
exit(0);
}
return ret;
}
int main(){
cin >> str;
n = strlen(str);
for(int i=0; i<n; i++){
char c1 = str[i];
char c2 = str[i];
if(str[i] == '_') c1 = '-', c2 = '+';
hmax[i + 1] = hmax[i] + sgn(c2);
}
int cur = hmax[n];
memcpy(mxv, str, sizeof(str));
memcpy(mnv, str, sizeof(str));
for(int i=n-1; i>=0; i--){
if(mxv[i] == '_'){
if(cur >= 2) mxv[i] = '-', cur -= 2;
else if(cur >= 1) mxv[i] = '0', cur -= 1;
else mxv[i] = '+';
}
}
sfxmin[n+1] = 1e9;
for(int i=n; i; i--){
sfxmin[i] = min(sfxmin[i + 1], hmax[i]);
}
int curh = 0;
for(int i=0; i<n; i++){
if(mnv[i] == '_'){
if(curh - 1 + sfxmin[i+1] - hmax[i+1] >= 0) mnv[i] = '-';
else if(curh + sfxmin[i+1] - hmax[i+1] >= 0) mnv[i] = '0';
else mnv[i] = '+';
}
curh += sgn(mnv[i]);
}
// cout << mnv << endl;
// cout << mxv << endl;
lint v1 = validate(mnv);
lint v2 = validate(mxv);
printf("%lld %lld\n", v1, v2);
}
| [
"koosaga@MacBook-Pro.local"
] | koosaga@MacBook-Pro.local |
8008297f428d5fcf1a4946f0ba8c21283ccec3a4 | b72989976e21a43752510146101a11e7184a6476 | /dbtoaster/dbt_c++/q3Agg.cpp | b832a54705bfbbce2d13e8ab033af77bb69c8aab | [] | no_license | gauravsaxena81/GraphIVM | 791c2f90d7a24943664f0e3427ffb26bded20029 | d3d1d18206910a41ed6ce4e338488bf53f56ac54 | refs/heads/master | 2021-01-21T21:54:54.679396 | 2015-11-20T00:11:24 | 2015-11-20T00:11:24 | 34,547,806 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,368 | cpp | #include "q3Agg.hpp"
#include <chrono>
namespace dbtoaster{
class CustomProgram_1 : public Program
{
public:
void process_stream_event(const event_t& ev) {
//cout << "on_" << dbtoaster::event_name[ev.type] << "_";
// cout << get_relation_name(ev.id) << "(" << ev.data << ")" << endl;
Program::process_stream_event(ev);
}
};
class CustomProgram_2 : public Program
{
public:
// CustomProgram_2(int argc = 0, char* argv[] = 0) : Program(argc,argv) {}
void process_streams() {
Program::process_streams();
int which = 2;
int MAX = 50000;
long X = 1000000000;
if(which == 2) {//JT
const STRING_TYPE *s = new STRING_TYPE("2992-01-01");
data.on_insert_USERS(X);
for( long i = 1; i <= MAX; ++i ) {
data.on_insert_TWEET(X, X + i, *s);
}
for( long i = 1; i <= MAX; ++i ) {
//data.on_insert_RETWEET(X + i, X + i, *s, X + i);
}
const auto start_time = std::chrono::steady_clock::now();
for( long i = 1; i <= MAX; ++i ) {
//data.on_delete_RETWEET(X + i, X + i, *s, X + i);
data.on_insert_RETWEET(X + i, X + i, *s, X + i);
}
double time_in_seconds = std::chrono::duration_cast<std::chrono::milliseconds> (std::chrono::steady_clock::now() - start_time).count();
std::cout << time_in_seconds<<"ms"<<std::endl;
api.print();
}
if(which == 1) {//PT
const STRING_TYPE *s = new STRING_TYPE("2992-01-01");
for( long i = 1; i <= MAX; ++i ) {
data.on_insert_RETWEET(X, X + i, *s, 2);
}
const auto start_time = std::chrono::steady_clock::now();
for( long i = 1; i <= MAX; ++i ) {
//data.on_insert_RETWEET(X, X + i, *s, 2);
data.on_delete_RETWEET(X, X + i, *s, 2);
}
double time_in_seconds = std::chrono::duration_cast<std::chrono::milliseconds> (std::chrono::steady_clock::now() - start_time).count();
std::cout << time_in_seconds<<"ms"<<std::endl;
}
}
};
}
/**
* In order to compile this file one would have to include a header containing
* the definition of "dbtoaster::Program" and "dbtoaster::Program::snapshot_t"
* as generated by the dbtoaster C++ code generator. Using the "-c" dbtoaster
* command line option the generated header file is automatically included and
* compiled against this file.
*/
/**
* Determines whether "--async" was specified as a command line argument.
*
* @param argc
* @param argv
* @return true if "--async" is one of the command line arguments
*/
bool async_mode(int argc, char* argv[])
{
for(int i = 1; i < argc; ++i)
if( !strcmp(argv[i],"--async") )
return true;
return false;
}
/**
* Main function that executes the sql program corresponding to the header file
* included. If "-async" is among the command line arguments then the execution
* is performed asynchronous in a seperate thread, otherwise it is performed in
* the same thread. If performed in a separate thread and while not finished it
* continuously gets snapshots of the results and prints them in xml format. At
* the end of the execution the final results are also printed.
*
* @param argc
* @param argv
* @return
*/
int main(int argc, char* argv[]) {
bool async = async_mode(argc,argv);
//dbtoaster::Program p;//(argc,argv);
//dbtoaster::CustomProgram_1 p;
dbtoaster::CustomProgram_2 p;
//dbtoaster::Program::snapshot_t snap;
dbtoaster::CustomProgram_2::snapshot_t snap;
cout << "Initializing program:" << endl;
p.init();
p.run( async );
cout << "Running program:" << endl;
while( !p.is_finished() )
{
snap = p.get_snapshot();
DBT_SERIALIZATION_NVP_OF_PTR(cout, snap);
}
cout << "Printing final result:" << endl;
snap = p.get_snapshot();
//DBT_SERIALIZATION_NVP_OF_PTR(cout, snap);
cout << std::endl;
return 0;
}
| [
"gsaxena81@gmail.com"
] | gsaxena81@gmail.com |
902b252d06174ea73166051cafdcef595d969669 | 81bba18ddbf8f8d7145ec517f6496d4dc6193f7b | /05_learning/utilities.cpp | 365d8189c82d1b6437c56702e6948371a12f139e | [] | no_license | voje/TV | a498fa23284433d844ff7e096f700efcc04cc3d6 | cb2ec7be83cf6e7cdbbe9bf9f2aacc815e759e0c | refs/heads/master | 2022-12-02T11:53:26.390231 | 2020-08-06T13:23:52 | 2020-08-06T13:24:00 | 54,552,511 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,077 | cpp | #include <sstream>
#include <iostream>
#include "utilities.h"
#ifdef _WIN32
string join(const string& root, const string& path) {
if (root[root.size()-1] == '\\')
return root + path;
else if (path[0] == '\\')
return path;
else return root + "\\" + path;
}
#else
string join(const string& root, const string& path) {
if (path[0] == '/')
return path;
else if (root[root.size()-1] == '/')
return root + path;
else return root + "/" + path;
}
#endif
vector<string> &split(const string &s, char delimiter, vector<string> &elements) {
stringstream ss(s);
string item;
while (getline(ss, item, delimiter))
elements.push_back(item);
return elements;
}
vector<string> split(const string &s, char delimiter) {
vector<string> elements;
split(s, delimiter, elements);
return elements;
}
void read(const FileNode& node, vector<string>& out) {
if (node.isSeq()) {
for (FileNodeIterator it = node.begin(); it != node.end(); it++) {
out.push_back(string(*it));
}
}
}
| [
"kristjan.voje@gmail.com"
] | kristjan.voje@gmail.com |
eac3bfbe5d0d6929ae3ee6ebd25d78440836eff3 | b9c1098de9e26cedad92f6071b060dfeb790fbae | /src/formats/packed/pack_utils.h | 8067dc027d1cd6815ba594058e0a8455fece4ee0 | [] | no_license | vitamin-caig/zxtune | 2a6f38a941f3ba2548a0eb8310eb5c61bb934dbe | 9940f3f0b0b3b19e94a01cebf803d1a14ba028a1 | refs/heads/master | 2023-08-31T01:03:45.603265 | 2023-08-27T11:50:45 | 2023-08-27T11:51:26 | 13,986,319 | 138 | 13 | null | 2021-09-13T13:58:32 | 2013-10-30T12:51:01 | C++ | UTF-8 | C++ | false | false | 3,905 | h | /**
*
* @file
*
* @brief Packed-related utilities
*
* @author vitamin.caig@gmail.com
*
**/
#pragma once
// common includes
#include <types.h>
// library includes
#include <binary/data_builder.h>
#include <binary/dump.h>
// std includes
#include <algorithm>
#include <cassert>
#include <cstring>
class ByteStream
{
public:
ByteStream(const uint8_t* data, std::size_t size)
: Data(data)
, End(Data + size)
, Size(size)
{}
bool Eof() const
{
return Data >= End;
}
uint8_t GetByte()
{
return Eof() ? 0 : *Data++;
}
uint_t GetLEWord()
{
const uint_t lo = GetByte();
const uint_t hi = GetByte();
return 256 * hi + lo;
}
std::size_t GetRestBytes() const
{
return End - Data;
}
std::size_t GetProcessedBytes() const
{
return Size - GetRestBytes();
}
private:
const uint8_t* Data;
const uint8_t* const End;
const std::size_t Size;
};
template<class Iterator, class ConstIterator>
void RecursiveCopy(ConstIterator srcBegin, ConstIterator srcEnd, Iterator dstBegin)
{
const ConstIterator constDst = dstBegin;
if (std::distance(srcEnd, constDst) >= 0)
{
std::copy(srcBegin, srcEnd, dstBegin);
}
else
{
Iterator dst = dstBegin;
for (ConstIterator src = srcBegin; src != srcEnd; ++src, ++dst)
{
*dst = *src;
}
}
}
inline void Reverse(Binary::DataBuilder& data)
{
auto* start = &data.Get<uint8_t>(0);
auto* end = start + data.Size();
std::reverse(start, end);
}
inline void Fill(Binary::DataBuilder& data, std::size_t count, uint8_t byte)
{
auto* dst = static_cast<uint8_t*>(data.Allocate(count));
std::fill_n(dst, count, byte);
}
template<class T>
inline void Generate(Binary::DataBuilder& data, std::size_t count, T generator)
{
auto* dst = static_cast<uint8_t*>(data.Allocate(count));
std::generate_n(dst, count, std::move(generator));
}
// offset to back
inline bool CopyFromBack(std::size_t offset, Binary::DataBuilder& dst, std::size_t count)
{
if (offset > dst.Size())
{
return false; // invalid backref
}
auto* dstStart = static_cast<uint8_t*>(dst.Allocate(count));
const auto* srcStart = dstStart - offset;
RecursiveCopy(srcStart, srcStart + count, dstStart);
return true;
}
// src - first or last byte of source data to copy (e.g. hl)
// dst - first or last byte of target data to copy (e.g. de)
// count - count of bytes to copy (e.g. bc)
// dirCode - second byte of ldir/lddr operation (0xb8 for lddr, 0xb0 for ldir)
class DataMovementChecker
{
public:
DataMovementChecker(uint_t src, uint_t dst, uint_t count, uint_t dirCode)
: Forward(0xb0 == dirCode)
, Backward(0xb8 == dirCode)
, Source(src)
, Target(dst)
, Size(count)
{
(void)Source; // to make compiler happy
}
bool IsValid() const
{
return Size && (Forward || Backward);
// do not check other due to overlap possibility
}
uint_t FirstOfMovedData() const
{
assert(Forward != Backward);
return Forward ? Target : (Target - Size + 1) & 0xffff;
}
uint_t LastOfMovedData() const
{
assert(Forward != Backward);
return Backward ? Target : (Target + Size - 1) & 0xffff;
}
private:
const bool Forward;
const bool Backward;
const uint_t Source;
const uint_t Target;
const uint_t Size;
};
inline std::size_t MatchedSize(const uint8_t* dataBegin, const uint8_t* dataEnd, const uint8_t* patBegin,
const uint8_t* patEnd)
{
const std::size_t dataSize = dataEnd - dataBegin;
const std::size_t patSize = patEnd - patBegin;
if (dataSize >= patSize)
{
const std::pair<const uint8_t*, const uint8_t*> mismatch = std::mismatch(patBegin, patEnd, dataBegin);
return mismatch.first - patBegin;
}
else
{
const std::pair<const uint8_t*, const uint8_t*> mismatch = std::mismatch(dataBegin, dataEnd, patBegin);
return mismatch.first - dataBegin;
}
}
| [
"vitamin.caig@gmail.com"
] | vitamin.caig@gmail.com |
5060b976ec9d56f7dfcd6dac756bcdc4c911ef46 | 968a4cb2feb13518940f9d125c4d6b5ae2094595 | /Applications/AdaptiveParaView/Plugin/vtkGridSampler2.h | c0a26564e0bb0555e778c32348b11dee4c34a780 | [
"LicenseRef-scancode-paraview-1.2"
] | permissive | wildmichael/ParaView3-enhancements-old | b4f2327e09cac3f81fa8c5cdb7a56bcdf960b6c1 | d889161ab8458787ec7aa3d8163904b8d54f07c5 | refs/heads/master | 2021-05-26T12:33:58.622473 | 2009-10-29T09:17:57 | 2009-10-29T09:17:57 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,277 | h | /*=========================================================================
Program: Visualization Toolkit
Module: $RCSfile: vtkGridSampler2.h,v $
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
// .NAME vtkGridSampler2 - A function that maps data extent and requested
// resolution and data extent to i,j,k stride choice.
// .SECTION Description
// Supply this with a whole extent, then give it a resolution request. It
// computes stride choices to match that resolution. Resolution of 0.0 is
// defined as requesting minimal resolution, resolution of 1.0 is defined
// as a request for full resolution (stride = 1,1,1).
//
// TODO: cache results!
// separate out split path and stride determination
// allow user specified stride and split determination
// publish max splits via a Get method
#ifndef __vtkGridSampler2_h
#define __vtkGridSampler2_h
#include "vtkObject.h"
class vtkIntArray;
class VTK_EXPORT vtkGridSampler2 : public vtkObject
{
public:
static vtkGridSampler2 *New();
vtkTypeRevisionMacro(vtkGridSampler2,vtkObject);
virtual void PrintSelf(ostream& os, vtkIndent indent);
void SetWholeExtent(int *);
vtkIntArray *GetSplitPath();
void SetSpacing(double *);
void ComputeAtResolution(double r);
void GetStrides(int *);
void GetStridedExtent(int *);
void GetStridedSpacing(double *);
double GetStridedResolution();
protected:
vtkGridSampler2();
~vtkGridSampler2();
double SuggestSampling(int axis);
void ComputeSplits(int *spLen, int **sp);
int WholeExtent[6];
double Spacing[3];
double RequestedResolution;
bool PathValid;
bool SamplingValid;
vtkIntArray *SplitPath;
int Strides[3];
int StridedExtent[6];
double StridedResolution;
double StridedSpacing[3];
private:
vtkGridSampler2(const vtkGridSampler2&); // Not implemented.
void operator=(const vtkGridSampler2&);
};
#endif
| [
"dave.demarle"
] | dave.demarle |
b4e00e41d838f1a370a00a88af69c64d6807a4fd | ed0124801e8cea3c955cd35de1e4b7de0c4cc7de | /base_server.h | d0d264611104513d62b9f9aa8195a9c44efe5569 | [] | no_license | Pramy/agent | 47287b22d75bb74041f68e28d70fc0153957f19c | e8a32ec4af093fc5116fb9331e4497037a06dd1b | refs/heads/master | 2022-06-28T17:21:58.279131 | 2020-05-11T11:12:04 | 2020-05-11T11:13:36 | 257,616,156 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,390 | h | //
// Created by tuffy on 2020/4/23.
//
#ifndef AGENT_BASE_SERVER_H
#define AGENT_BASE_SERVER_H
//#define PRINT(a) (std::cout << a << std::endl)
#define ERROR_SOCKET (-1)
#include <netdb.h>
#include <string>
#include <vector>
#include <iostream>
#include <functional>
class BaseServer{
public:
typedef int SocketFD;
typedef std::function<void(SocketFD)> SocketCallFun;
typedef std::function<bool(SocketFD, const addrinfo&)> SocketCreateCallFun;
typedef std::function<void(SocketFD, const std::string&)> SocketMsgFun;
BaseServer(): after_create_tasks(), after_accept_tasks(), after_connect_tasks(),
before_read_tasks(), after_read_tasks(), before_write_tasks(),
after_write_tasks() {};
virtual SocketFD CreateServer(const std::string &host, const int &port);
virtual SocketFD CreateClient(const std::string &host, const int &port);
virtual SocketFD Accept(SocketFD sock,sockaddr_in &remote_addr, socklen_t &len);
virtual ssize_t Write(SocketFD socket_fd, const std::string &msg);
virtual std::string Read(SocketFD socket_fd);
virtual int Close(SocketFD socket_fd);
bool IsTowPower(unsigned i);
unsigned AdjustSize(unsigned i);
void AddAfterCreateTasks(const SocketCallFun &fn);
void AddAfterAcceptTasks(const SocketCallFun &fn);
void AddAfterConnectTasks(const SocketCallFun &fn);
void AddBeforeReadTasks(const SocketCallFun &fn);
void AddAfterReadTasks(const SocketMsgFun &fn);
void AddBeforeWriteTasks(const SocketMsgFun &fn);
void AddAfterWriteTasks(const SocketMsgFun &fn);
template <typename T, typename... Args>
void RunAllTasks(const std::vector<T>& tasks, Args... args);
virtual bool Connect(SocketFD sock, const addrinfo &addr);
virtual bool BindAndListen(SocketFD sock, const addrinfo &addr);
virtual SocketFD CreateSocket(const std::string &host,
const int &port,
const SocketCreateCallFun &fn);
private:
std::vector<SocketCallFun> after_create_tasks{};
std::vector<SocketCallFun> after_accept_tasks{};
std::vector<SocketCallFun> after_connect_tasks{};
std::vector<SocketCallFun> before_read_tasks{};
std::vector<SocketMsgFun> after_read_tasks{};
std::vector<SocketMsgFun> before_write_tasks{};
std::vector<SocketMsgFun> after_write_tasks{};
};
#endif // AGENT_BASE_SERVER_H
| [
"tuffychen@tencent.com"
] | tuffychen@tencent.com |
3b2a8e225bfd25ff3fc2a7aef2fa5fab235c2860 | d09945668f19bb4bc17087c0cb8ccbab2b2dd688 | /atcoder/agc001-040/agc021/c.cpp | 180263dadac3e2ea38540ec22af08bc2685beee8 | [] | no_license | kmjp/procon | 27270f605f3ae5d80fbdb28708318a6557273a57 | 8083028ece4be1460150aa3f0e69bdb57e510b53 | refs/heads/master | 2023-09-04T11:01:09.452170 | 2023-09-03T15:25:21 | 2023-09-03T15:25:21 | 30,825,508 | 23 | 2 | null | 2023-08-18T14:02:07 | 2015-02-15T11:25:23 | C++ | UTF-8 | C++ | false | false | 2,240 | cpp | #include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;
#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
//-------------------------------------------------------
int H,W,A,B;
int OH,OW,OA,OB;
string S[1010];
void output() {
int y;
cout<<"YES"<<endl;
FOR(y,OH) cout<<S[y]<<endl;
exit(0);
}
void solve() {
int i,j,k,l,r,x,y; string s;
cin>>H>>W>>A>>B;
if(H*W<2*(A+B)) return _P("NO\n");
OH=H,OW=W,OA=A,OB=B;
FOR(y,H) S[y]=string(W,'.');
if(H%2==1) {
for(x=0;x<W-1&&A;x+=2) S[H-1][x]='<', S[H-1][x+1]='>', A--;
H--;
}
if(W%2==1) {
for(y=0;y<H-1&&B;y+=2) S[y][W-1]='^', S[y+1][W-1]='v', B--;
W--;
}
for(y=0;y<H;y+=2) {
for(x=0;x<W;x+=2) {
if(A) {
S[y][x]='<', S[y][x+1]='>', A--;
if(A) S[y+1][x]='<', S[y+1][x+1]='>', A--;
}
else if(B) {
S[y][x]='^', S[y+1][x]='v', B--;
if(B) S[y][x+1]='^', S[y+1][x+1]='v', B--;
}
}
}
if(A==0 && B==0) output();
H=OH,W=OW,A=OA,B=OB;
if(H%2 && W%2 && H>=3 && W>=3 && A>=2 && B>=2) {
A-=2;
B-=2;
FOR(y,H) S[y]=string(W,'.');
S[H-3][W-3]=S[H-1][W-2]='<';
S[H-3][W-2]=S[H-1][W-1]='>';
S[H-2][W-3]=S[H-3][W-1]='^';
S[H-1][W-3]=S[H-2][W-1]='v';
for(y=0;y<H-3&&B;y+=2) S[y][W-1]='^',S[y+1][W-1]='v',B--;
for(x=0;x<W-3&&A;x+=2) S[H-1][x]='<',S[H-1][x+1]='>',A--;
for(y=0;y<H-1;y+=2) {
for(x=0;x<W-1;x+=2) {
if(S[y][x]!='.') continue;
if(A) {
S[y][x]='<', S[y][x+1]='>', A--;
if(A) S[y+1][x]='<', S[y+1][x+1]='>', A--;
}
else if(B) {
S[y][x]='^', S[y+1][x]='v', B--;
if(B) S[y][x+1]='^', S[y+1][x+1]='v', B--;
}
}
}
if(A==0 && B==0) output();
}
cout<<"NO"<<endl;
}
int main(int argc,char** argv){
string s;int i;
if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
cout.tie(0); solve(); return 0;
}
| [
"kmjp@users.noreply.github.com"
] | kmjp@users.noreply.github.com |
529cc5f916cc090f6c4eeb5201a5e8c3b972e9ca | b63d8a7b366b9e9ed3108acbcf5c1b2ef14c2699 | /05 - Contest - Stacks and Binary Search/04 - C impresses everyone.cpp | c9ca2f6d2793ece70c522e8038cfa2df4130a80e | [] | no_license | pedroccufc/programming-challenges | 6da2db0c6d47fe702c4eb6a06198a07c0829b8be | 6cc119c68f59d135434e2869efb79fe4e474cdf4 | refs/heads/master | 2021-02-12T21:16:01.617928 | 2020-08-28T03:10:22 | 2020-08-28T03:10:22 | 244,631,575 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 592 | cpp | #include <bits/stdc++.h>
#define ALL(C) C.begin(), C.end()
using namespace std;
typedef long long ll;
int main(){
// Número de voltas
ll N;
cin >> N;
// Sequência de pedras adicionadas a cada turno
std::vector<ll> A;
A.resize(N+1);
A[0] = 0;
for (ll i = 1; i <= N; i++) {
cin >> A[i];
A[i] += A[i-1];
}
// Número de consultas
ll Q, x;
cin >> Q;
for (ll i = 0; i < Q; i++) {
cin >> x;
int idx = A[N] - x + 1;
idx = std::lower_bound(ALL(A), idx) - A.begin();
if (idx & 1) {
cout << "A" << endl;
} else {
cout << "B" << endl;
}
}
return 0;
} | [
"pedroccufc@gmail.com"
] | pedroccufc@gmail.com |
f8536e35e1ed91023b317ecb18f87dca640b8387 | 18b1b51b1fcc43c2fae3d62b90f6d8fc96c739d0 | /VirtualAudioCable/JumpDesktopAudio/AdapterCommon.cpp | 2f3bb9f07f292d27f9ec214243440d0d4e815704 | [] | no_license | Blizzy01/TempStorage | 8eed0c23e0786c9783d8b309fa01a9af635c3349 | 367c904a8bf213d4d3a4a67115116f836a3f9a53 | refs/heads/master | 2023-07-03T15:48:56.651397 | 2021-05-01T19:05:34 | 2021-05-01T19:05:34 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 6,619 | cpp | #include "AdapterCommon.h"
#include "RegistryHelper.h"
#include "SubdeviceHelper.h"
#include "MinipairDescriptorFactory.h"
#include "MiniportWaveRT.h"
LONG AdapterCommon::m_Instances = 0;
AdapterCommon::~AdapterCommon()
{
PAGED_CODE();
DPF_ENTER(("[CAdapterCommon::~CAdapterCommon]"));
if (m_pDeviceHelper)
{
ExFreePoolWithTag(m_pDeviceHelper, MINIADAPTER_POOLTAG);
}
InterlockedDecrement(&AdapterCommon::m_Instances);
ASSERT(AdapterCommon::m_Instances == 0);
}
/*
Creates a new AdapterCommon
Arguments:
Unknown -
UnknownOuter -
PoolType
*/
NTSTATUS AdapterCommon::Create
(
_Out_ PUNKNOWN * Unknown,
_In_ REFCLSID,
_In_opt_ PUNKNOWN UnknownOuter,
_When_((PoolType & NonPagedPoolMustSucceed) != 0,
__drv_reportError("Must succeed pool allocations are forbidden. "
"Allocation failures cause a system crash"))
_In_ POOL_TYPE PoolType,
_In_ PDEVICE_OBJECT DeviceObject,
_In_ PIRP StartupIrp
)
{
PAGED_CODE();
DPF_ENTER(("[CAdapterCommon::Create]"));
ASSERT(Unknown);
ASSERT(StartupIrp);
NTSTATUS ntStatus;
//
// This is a singleton, check before creating instance.
//
if (InterlockedCompareExchange(&AdapterCommon::m_Instances, 1, 0) != 0)
{
ntStatus = STATUS_DEVICE_BUSY;
DPF(D_TERSE, ("NewAdapterCommon failed, adapter already created."));
goto Done;
}
//
// Allocate an adapter object.
//
AdapterCommon* p = new(PoolType, MINIADAPTER_POOLTAG) AdapterCommon(UnknownOuter);
if (p == NULL)
{
ntStatus = STATUS_INSUFFICIENT_RESOURCES;
DPF(D_TERSE, ("NewAdapterCommon failed, 0x%x", ntStatus));
goto Done;
}
ntStatus = p->Init(StartupIrp, DeviceObject);
IF_FAILED_ACTION_RETURN(ntStatus, DPF(D_TERSE, ("Error initializing Adapter, 0x%x", ntStatus)));
//
// Success.
//
*Unknown = PUNKNOWN((IAdapterCommon*)(p));
(*Unknown)->AddRef();
ntStatus = STATUS_SUCCESS;
Done:
return ntStatus;
} // NewAdapterCommon
/*
Initialize the Adapter.
*/
NTSTATUS __stdcall AdapterCommon::Init(IRP* StartupIrp, PDEVICE_OBJECT DeviceObject)
{
PAGED_CODE();
DPF_ENTER(("[CAdapterCommon::Init]"));
ASSERT(DeviceObject);
NTSTATUS ntStatus = STATUS_SUCCESS;
m_pDeviceObject = DeviceObject;
m_pDeviceHelper = new(NonPagedPoolNx, MINIADAPTER_POOLTAG) SubdeviceHelper(this);
if (!m_pDeviceHelper)
{
m_pDeviceHelper = NULL;
ntStatus = STATUS_INSUFFICIENT_RESOURCES;
}
if (NT_SUCCESS(ntStatus))
{
ntStatus = PcGetPhysicalDeviceObject(DeviceObject, &m_pPhysicalDeviceObject);
if (!NT_SUCCESS(ntStatus)) DPF(D_TERSE, ("PcGetPhysicalDeviceObject failed, 0x%x", ntStatus));
}
ntStatus = InstallVirtualCable(StartupIrp);
IF_FAILED_ACTION_RETURN(ntStatus, DPF(D_TERSE, ("InstallVirtualCable failed, 0x%x", ntStatus)));
if (!NT_SUCCESS(ntStatus))
{
m_pDeviceObject = NULL;
if (m_pDeviceHelper) ExFreePoolWithTag(m_pDeviceHelper, MINIADAPTER_POOLTAG);
m_pPhysicalDeviceObject = NULL;
}
return ntStatus;
}
NTSTATUS AdapterCommon::InstallVirtualCable(IRP * irp)
{
NTSTATUS ntStatus = STATUS_SUCCESS;
IUnknown* unknownMic;
IUnknown* unknownSpeaker;
ntStatus = InstallVirtualMic(irp, &unknownMic);
IF_FAILED_ACTION_RETURN(ntStatus, DPF(D_TERSE, ("InstallVirtualMic failed, 0x%x", ntStatus)));
ntStatus = InstallVirtualSpeaker(irp, &unknownSpeaker);
IF_FAILED_ACTION_RETURN(ntStatus, DPF(D_TERSE, ("InstallVirtualSpeaker failed, 0x%x", ntStatus)));
// Is there a purpuse for this code to exist ?
// Not checking return value
MiniportWaveRT* microphone;
ntStatus = unknownMic->QueryInterface(IID_MiniportWaveRT, (PVOID*)µphone);
MiniportWaveRT* speaker;
ntStatus = unknownSpeaker->QueryInterface(IID_MiniportWaveRT, (PVOID*)&speaker);
microphone->SetPairedMiniport(speaker);
return STATUS_SUCCESS;
}
NTSTATUS AdapterCommon::InstallVirtualMic(IRP* Irp, IUnknown** unknownMiniport)
{
PAGED_CODE();
NTSTATUS ntStatus = STATUS_NOT_IMPLEMENTED;
ENDPOINT_MINIPAIR* pCaptureMiniport = NULL;
ntStatus = MinipairDescriptorFactory::CreateMicrophone(&pCaptureMiniport);
if (!NT_SUCCESS(ntStatus))
{
return ntStatus;
}
// Missing status code check
m_pDeviceHelper->InstallMinipair(Irp, pCaptureMiniport, NULL, NULL, NULL, NULL, unknownMiniport);
return ntStatus;
}
NTSTATUS AdapterCommon::InstallVirtualSpeaker(IRP* Irp, IUnknown** unknownMiniport)
{
PAGED_CODE();
NTSTATUS ntStatus = STATUS_NOT_IMPLEMENTED;
ENDPOINT_MINIPAIR* pRenderMiniport = NULL;
ntStatus = MinipairDescriptorFactory::CreateSpeaker(&pRenderMiniport);
if (!NT_SUCCESS(ntStatus))
{
return ntStatus;
}
// Missing status code check
m_pDeviceHelper->InstallMinipair(Irp, pRenderMiniport, NULL, NULL, NULL, NULL, unknownMiniport);
return ntStatus;
}
STDMETHODIMP AdapterCommon::NonDelegatingQueryInterface
(
_In_ REFIID Interface,
_COM_Outptr_ PVOID * Object
)
/*++
Routine Description:
QueryInterface routine for AdapterCommon
Arguments:
Interface -
Object -
Return Value:
NT status code.
--*/
{
PAGED_CODE();
ASSERT(Object);
if (IsEqualGUIDAligned(Interface, IID_IUnknown))
{
*Object = PVOID(PUNKNOWN((IAdapterCommon*)(this)));
}
else if (IsEqualGUIDAligned(Interface, IID_IAdapterCommon))
{
*Object = PVOID((IAdapterCommon*)(this));
}
else if (IsEqualGUIDAligned(Interface, IID_IAdapterPowerManagement))
{
*Object = PVOID(PADAPTERPOWERMANAGEMENT(this));
}
else
{
*Object = NULL;
}
if (*Object)
{
PUNKNOWN(*Object)->AddRef();
return STATUS_SUCCESS;
}
return STATUS_INVALID_PARAMETER;
} // NonDelegatingQueryInterface
PDEVICE_OBJECT __stdcall AdapterCommon::GetDeviceObject(void)
{
return m_pDeviceObject;
}
PDEVICE_OBJECT __stdcall AdapterCommon::GetPhysicalDeviceObject(void)
{
return m_pPhysicalDeviceObject;
}
#pragma code_seg()
NTSTATUS __stdcall AdapterCommon::WriteEtwEvent(EPcMiniportEngineEvent miniportEventType, ULONGLONG ullData1, ULONGLONG ullData2, ULONGLONG ullData3, ULONGLONG ullData4)
{
NTSTATUS ntStatus = STATUS_SUCCESS;
if (m_pPortClsEtwHelper)
{
ntStatus = m_pPortClsEtwHelper->MiniportWriteEtwEvent(miniportEventType, ullData1, ullData2, ullData3, ullData4);
}
return ntStatus;
}
#pragma code_seg("PAGE")
void __stdcall AdapterCommon::SetEtwHelper(PPORTCLSETWHELPER _pPortClsEtwHelper)
{
PAGED_CODE();
SAFE_RELEASE(m_pPortClsEtwHelper);
m_pPortClsEtwHelper = _pPortClsEtwHelper;
if (m_pPortClsEtwHelper)
{
m_pPortClsEtwHelper->AddRef();
}
}
void __stdcall AdapterCommon::Cleanup()
{
PAGED_CODE();
DPF_ENTER(("[AdapterCommon::Cleanup]"));
// Non consistent coding style
if (m_pDeviceHelper) m_pDeviceHelper->Clean();
}
| [
"Tudi@users.noreply.github.com"
] | Tudi@users.noreply.github.com |
5570d1e1f25dcc0b32bbfb6783bfb775d2ce656a | 9b06cdf4b01150b4c144599c5db5b7c82fb554b4 | /libraries/AirConditioner/AirConditionerDisplay.cpp | d2509fdc44c30ad55b0399d4b6fbdc96d091c941 | [] | no_license | RafaelSilva-RFS/Air-Conditioner-Remote | 42282cb4688db1bf753361e8570357539e8a47d9 | e908167e87f6865d4b83be5156a967dfc3054179 | refs/heads/main | 2023-04-03T15:33:16.915871 | 2021-04-21T03:20:03 | 2021-04-21T03:20:03 | 327,997,064 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 7,459 | cpp | #include "Arduino.h"
#include "AirConditionerDisplay.h"
AirConditionerDisplay::AirConditionerDisplay(){ };
void AirConditionerDisplay::Init(Adafruit_SSD1306 _display, AirConditionerEstateModel AirConditionerEstateDto){
display = _display;
// Show initial display buffer contents on the screen -- the library initializes this with an Adafruit splash screen.
display.display();
delay(2000); // Pause for 2 seconds
// Clear the buffer
display.clearDisplay();
DisplayUpdate(AirConditionerEstateDto);
// DrawClock(10, 33);
display.display();
};
void AirConditionerDisplay::DisplayUpdate(AirConditionerEstateModel AirConditionerEstateDto){
//On/Off
if(AirConditionerEstateDto.OnOff != AirConditionerPreviousEstateDto.OnOff && AirConditionerEstateDto.OnOff == 0) {
display.clearDisplay();
display.display();
AirConditionerPreviousEstateDto.OnOff = AirConditionerEstateDto.OnOff;
return;
} else if(AirConditionerEstateDto.OnOff != AirConditionerPreviousEstateDto.OnOff && AirConditionerEstateDto.OnOff == 1) {
display.clearDisplay();
DrawDegrees(AirConditionerEstateDto.Degrees, AirConditionerEstateDto.DegreesMode);
DrawTemperatureMode(AirConditionerEstateDto.DegreesMode);
DrawCoolMode(AirConditionerEstateDto.CoolMode);
DrawFanMode(AirConditionerEstateDto.FanMode);
DrawSleepMode(AirConditionerEstateDto.SleepClock);
AirConditionerPreviousEstateDto.OnOff = AirConditionerEstateDto.OnOff;
AirConditionerPreviousEstateDto.FanMode = AirConditionerEstateDto.FanMode;
AirConditionerPreviousEstateDto.Degrees = AirConditionerEstateDto.Degrees;
AirConditionerPreviousEstateDto.CoolMode = AirConditionerEstateDto.CoolMode;
AirConditionerPreviousEstateDto.SleepClock = AirConditionerEstateDto.SleepClock;
AirConditionerPreviousEstateDto.DegreesMode = AirConditionerEstateDto.DegreesMode;
return;
};
// DrawDegrees
if(AirConditionerEstateDto.Degrees != AirConditionerPreviousEstateDto.Degrees) {
DrawDegrees(AirConditionerEstateDto.Degrees, AirConditionerEstateDto.DegreesMode);
AirConditionerPreviousEstateDto.Degrees = AirConditionerEstateDto.Degrees;
};
// DrawTemperatureMode
if(AirConditionerEstateDto.DegreesMode != AirConditionerPreviousEstateDto.DegreesMode) {
DrawTemperatureMode(AirConditionerEstateDto.DegreesMode);
DrawDegrees(AirConditionerEstateDto.Degrees, AirConditionerEstateDto.DegreesMode);
AirConditionerPreviousEstateDto.DegreesMode = AirConditionerEstateDto.DegreesMode;
};
// DrawCoolMode
if(AirConditionerEstateDto.CoolMode != AirConditionerPreviousEstateDto.CoolMode) {
DrawCoolMode(AirConditionerEstateDto.CoolMode);
AirConditionerPreviousEstateDto.CoolMode = AirConditionerEstateDto.CoolMode;
};
// DrawFanMode
if(AirConditionerEstateDto.FanMode != AirConditionerPreviousEstateDto.FanMode) {
DrawFanMode(AirConditionerEstateDto.FanMode);
AirConditionerPreviousEstateDto.FanMode = AirConditionerEstateDto.FanMode;
};
// DrawSleepMode
if(AirConditionerEstateDto.SleepClock != AirConditionerPreviousEstateDto.SleepClock) {
DrawSleepMode(AirConditionerEstateDto.SleepClock);
AirConditionerPreviousEstateDto.SleepClock = AirConditionerEstateDto.SleepClock;
};
};
void AirConditionerDisplay::DrawCentreString(const String &buf, int x, int y)
{
display.setTextSize(3);
display.setTextColor(SSD1306_WHITE);
int16_t x1, y1;
uint16_t w, h;
display.getTextBounds(buf, x, y, &x1, &y1, &w, &h); //calc width of new string
int16_t cursorX = (display.width() - w) / 2;
int16_t cursorY = (display.height() - h) / 2;
display.setCursor(cursorX, cursorY);
display.print(buf);
display.display();
};
void AirConditionerDisplay::DrawDegrees(int degreeIndex, int temperatureIndex){
CleanDegrees();
if(temperatureIndex == 0) {
DrawCentreString(TemperatureCelsius[degreeIndex], 0, -38);
};
if(temperatureIndex == 1) {
DrawCentreString(TemperatureFahrenheit[degreeIndex], 0, -38);
};
display.display();
};
void AirConditionerDisplay::CleanDegrees(){
display.fillRect (0, 13, 128, 21, SSD1306_BLACK);
};
void AirConditionerDisplay::DrawFanMode(int fanModeIndex){
CleanFanMode();
switch(fanModeIndex) {
case 0:
display.drawBitmap(20, 47, fan3Icon, 16, 16, 1);
break;
case 1:
display.drawBitmap(20, 47, fan2Icon, 16, 16, 1);
break;
case 2:
display.drawBitmap(20, 47, fan1Icon, 16, 16, 1);
break;
case 3:
display.drawBitmap(20, 47, autoIcon, 16, 16, 1);
break;
};
display.display();
};
void AirConditionerDisplay::CleanFanMode(){
display.fillRect (19, 48, 16, 16, SSD1306_BLACK);
};
void AirConditionerDisplay::DrawCoolMode(int coolModeIndex){
CleanCoolMode();
switch(coolModeIndex) {
case 0:
display.drawBitmap(0, 48, autoIcon, 16, 16, 1);
break;
case 1:
display.drawBitmap(0, 48, airConditionerIcon, 16, 16, 1);
break;
case 2:
display.drawBitmap(0, 48, umidityIcon, 16, 16, 1);
break;
case 3:
display.drawBitmap(0, 48, fan3Icon, 16, 16, 1);
break;
case 4:
display.drawBitmap(0, 48, heaterIcon, 16, 16, 1);
break;
};
display.display();
};
void AirConditionerDisplay::CleanCoolMode(){
display.fillRect (0, 48, 16, 16, SSD1306_BLACK);
};
void AirConditionerDisplay::DrawTemperatureMode(int temperatureIndex){
CleanTemperatureMode();
display.setTextSize(1);
display.setTextColor(SSD1306_WHITE);
display.setCursor(113, -2);
display.write(9);
display.setCursor(119, 0);
if(temperatureIndex == 0) {
display.print(F("C"));
};
if(temperatureIndex == 1) {
display.print(F("F"));
};
display.display();
};
void AirConditionerDisplay::CleanTemperatureMode(){
display.fillRect (114, 0, 14, 7, SSD1306_BLACK);
};
void AirConditionerDisplay::DrawSleepMode(int sleepModeIndex){
sleepHours = "";
sleepHours.concat(sleepModeIndex);
sleepHours.concat("h");
CleanSleepMode();
if(sleepModeIndex > 0) {
display.drawBitmap(40, 48, sleepOnIcon, 16, 16, 1);
display.setCursor(60, 53);
display.setTextSize(1);
display.setTextColor(SSD1306_WHITE);
display.print(sleepHours);
}
display.display();
};
void AirConditionerDisplay::CleanSleepMode(){
display.fillRect (38, 48, 40, 16, SSD1306_BLACK);
};
void AirConditionerDisplay::DrawClock(int hour, int min){
CleanDrawClock();
clockHours = "";
clockHours.concat(hour);
clockHours.concat(":");
if(min < 10 ) { clockHours.concat("0"); };
clockHours.concat(min);
display.setTextSize(1);
display.setTextColor(SSD1306_WHITE);
display.setCursor(95, 53);
display.print(clockHours);
// Corrige falha na tela
display.fillRect (0, 0, 10, 10, SSD1306_BLACK);
display.display();
};
void AirConditionerDisplay::CleanDrawClock(){
display.fillRect (78, 48, 50, 16, SSD1306_BLACK);
};
| [
"rfs_designer@live.com"
] | rfs_designer@live.com |
cf555346b9c3db24c46556d7672f84ecb6619f2c | 5162ecef09ce3e8e2b1b83620cd93067ea026555 | /applications/constVolumePSR/cv_param_sparse.cpp | aaa8c2a55bb3c6406d0216002a5808ad9f40b51d | [
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | LLNL/zero-rk | 572c527deb53c7064179d40eebad53e48328c708 | ffc09d1f8b9978eb22b2daf192648a20bd0fb125 | refs/heads/master | 2023-08-23T16:09:45.431124 | 2023-06-30T18:27:43 | 2023-06-30T18:28:21 | 194,750,365 | 29 | 19 | null | null | null | null | UTF-8 | C++ | false | false | 20,040 | cpp | #include "cv_param_sparse.h"
//n is length of perm_c which is allocated by calling function
void read_perm_c_from_file(int n, int* perm_c)
{
int ncheck = 0;
char line[1024];
FILE *infile;
infile=fopen("perm_c.txt", "r");
//assumes perm_c has correct number of lines
while (fgets(line, 1023, infile) != NULL && ncheck <= n) {
perm_c[ncheck++] = atoi(line);
}
if(ncheck != n)
{
printf("ERROR: perm_c.txt not consistent with mechanism.");
exit(-1);
}
return;
}
JsparseTermList * alloc_JsparseTermList(const int inpFD, const int inpFC)
{
JsparseTermList *w;
w=(JsparseTermList *)malloc(sizeof(JsparseTermList));
if(w==NULL)
{
printf("ERROR: allocation 1 failed in alloc_JsparseTermList(...)\n");
return NULL;
}
w->nFwdDestroy=inpFD;
w->nFwdCreate =inpFC;
w->fwdDestroy=(JsparseIdx *)malloc(sizeof(JsparseIdx)*inpFD);
if(w->fwdDestroy==NULL)
{
free(w);
printf("ERROR: allocation 2 failed in alloc_JsparseTermList(...)\n");
return NULL;
}
w->fwdCreate=(JsparseIdx *)malloc(sizeof(JsparseIdx)*inpFC);
if(w->fwdCreate==NULL)
{
free(w->fwdDestroy);
free(w);
printf("ERROR: allocation 3 failed in alloc_JsparseTermList(...)\n");
return NULL;
}
return w;
}
void free_JsparseTermList(JsparseTermList *w)
{
if(w != NULL)
{
free(w->fwdCreate);
free(w->fwdDestroy);
free(w);
}
}
Jsparse * alloc_Jsparse(zerork::mechanism &mechInp, double tol,
bool doILU, bool fakeUpdate, int threshType,
double DiagPivotThresh, int permutationType)
{
int nSpc=mechInp.getNumSpecies();
int nStep=mechInp.getNumSteps();
int nReac,nProd;
int j,k,m,rowIdx,colIdx,nzAddr;
int nFD,nFC;
int *isNonZero; // local dense matrix indicating the non-zero terms
Jsparse *w;
w=(Jsparse *)malloc(sizeof(Jsparse));
if(w==NULL)
{
printf("ERROR: allocation 1 failed in alloc_Jsparse(...)\n");
fflush(stdout);
return NULL;
}
countJacobianTerms(mechInp,&nFD,&nFC);
w->termList=alloc_JsparseTermList(nFD,nFC);
if(w->termList==NULL)
{
free(w);
printf("ERROR: allocation 2 failed in alloc_Jsparse(...)\n");
fflush(stdout);
return NULL;
}
w->nSize=nSpc+2; //+1; // matrix size
// allocate temporary arrays
isNonZero = (int *)malloc(sizeof(int)*(w->nSize)*(w->nSize));
// allocate memory that is related to the matrix dimension
w->mtxColSum = (int *)malloc(sizeof(int)*(w->nSize+1));
w->diagIdx = (int *)malloc(sizeof(int)*(w->nSize));
w->lastRowIdx = (int *)malloc(sizeof(int)*(w->nSize));
// initialize the dense nonzero flags
for(j=0; j<nSpc; j++) // process the first nSpc columns
{
for(k=0; k<nSpc; k++) // process the first nSpc rows
{isNonZero[j*(w->nSize)+k]=0;}
isNonZero[j*(w->nSize)+j]=1; // mark the diagonal
isNonZero[j*(w->nSize)+nSpc]=1; // mark the T row
isNonZero[j*(w->nSize)+nSpc+1]=1;// mark the mass row?
}
for(k=0; k<(w->nSize); k++) // mark nSize rows in the temperature column
{isNonZero[nSpc*(w->nSize)+k]=1;}
for(k=0; k<(w->nSize); k++) // mark nSize rows in the mass column
{isNonZero[(nSpc+1)*(w->nSize)+k]=1;}
// re-parse the system filling in the Jacobian term data
// Jacobian = d ydot(k)/ dy(j)
nFD=nFC=0;
for(j=0; j<nStep; j++)
{
nReac=mechInp.getOrderOfStep(j);
nProd=mechInp.getNumProductsOfStep(j);
for(k=0; k<nReac; k++)
{
colIdx=mechInp.getSpecIdxOfStepReactant(j,k); // species being perturbed
// forward destruction
for(m=0; m<nReac; m++)
{
rowIdx=mechInp.getSpecIdxOfStepReactant(j,m); // species being destroyed
isNonZero[colIdx*(w->nSize)+rowIdx]=1; // mark location in dense
w->termList->fwdDestroy[nFD].concIdx=colIdx;
w->termList->fwdDestroy[nFD].rxnIdx=j;
w->termList->fwdDestroy[nFD].sparseIdx=rowIdx;
++nFD;
}
// forward creation
for(m=0; m<nProd; m++)
{
rowIdx=mechInp.getSpecIdxOfStepProduct(j,m); // species being created
isNonZero[colIdx*(w->nSize)+rowIdx]=1; // mark location in dense
w->termList->fwdCreate[nFC].concIdx=colIdx;
w->termList->fwdCreate[nFC].rxnIdx=j;
w->termList->fwdCreate[nFC].sparseIdx=rowIdx;
++nFC;
}
}
}
// check the jacobian term count
if(nFD != w->termList->nFwdDestroy)
{
printf("ERROR: in alloc_Jterm_param()\n");
printf(" nFD = %d != %d = w->nFwdDestroy\n",nFD,
w->termList->nFwdDestroy);
exit(-1);
}
if(nFC != w->termList->nFwdCreate)
{
printf("ERROR: in alloc_Jterm_param()\n");
printf(" nFC = %d != %d = w->nFwdCreate\n",nFC,
w->termList->nFwdCreate);
exit(-1);
}
w->num_noninteger_jacobian_nonzeros =
mechInp.getNonIntegerReactionNetwork()->GetNumJacobianNonzeros();
int* noninteger_row_id;
int* noninteger_column_id;
// non-integer reaction network
if(w->num_noninteger_jacobian_nonzeros > 0) {
noninteger_row_id = (int *)malloc(sizeof(int)*(w->num_noninteger_jacobian_nonzeros));
noninteger_column_id = (int *)malloc(sizeof(int)*(w->num_noninteger_jacobian_nonzeros));
w->noninteger_jacobian = (double *)malloc(sizeof(double)*(w->num_noninteger_jacobian_nonzeros));
w->noninteger_sparse_id = (int *)malloc(sizeof(int)*(w->num_noninteger_jacobian_nonzeros));
for(int j=0; j<w->num_noninteger_jacobian_nonzeros; ++j) {
noninteger_row_id[j] = 0;
noninteger_column_id[j] = 0;
w->noninteger_jacobian[j] = 0.0;
w->noninteger_sparse_id[j] = 0;
}
mechInp.getNonIntegerReactionNetwork()->GetJacobianPattern(
noninteger_row_id,noninteger_column_id);
for(int j=0; j<w->num_noninteger_jacobian_nonzeros; ++j) {
int dense_id = noninteger_row_id[j]+noninteger_column_id[j]*w->nSize;
isNonZero[dense_id]=1; // mark location in dense
}
} // end if(w->num_noninteger_jacobian_nonzeros > 0)
// count the number of nonzero terms in the dense matrix
w->nNonZero=1; // start the count at one so it can still serve as a flag
w->mtxColSum[0]=0;
for(j=0; j<(w->nSize); j++) // process column j
{
for(k=0; k<(w->nSize); k++)
{
if(isNonZero[j*(w->nSize)+k]==1)
{
isNonZero[j*(w->nSize)+k]=w->nNonZero;
w->nNonZero++;
}
}
// after counting column j store the running total in column j+1
// of the column sum
w->mtxColSum[j+1]=w->nNonZero-1;
}
// now at each nonzero term, isNonZero is storing the (address+1) in the
// actual compressed column storage data array
w->nNonZero--; // decrement the count
//printf("# number of nonzero terms = %d\n",w->nNonZero);
fflush(stdout);
// allocate matrix data
w->mtxData=(double *)malloc(sizeof(double)*w->nNonZero);
w->mtxRowIdx=(int *)malloc(sizeof(int)*w->nNonZero);
for(j=0; j<w->nNonZero; j++)
{w->mtxData[j]=0.0;} // initialize to zero for the print function
// scan the the isNonZero array to determine the row indexes
// and the special data addresses
for(j=0; j<(w->nSize); j++) // process column j
{
for(k=0; k<(w->nSize); k++) // row k
{
nzAddr=isNonZero[j*(w->nSize)+k];
if(nzAddr>=1)
{w->mtxRowIdx[nzAddr-1]=k;}
}
// record the diagonal address
w->diagIdx[j] = isNonZero[j*(w->nSize)+j]-1;
//w->lastRowIdx[j] = isNonZero[(j+1)*(w->nSize)-1]-1;
w->lastRowIdx[j] = isNonZero[(j+1)*(w->nSize)-2]-1;//actually point to Temp row
}
// use the isNonZero array as a lookup to store the proper compressed
// column data storage
for(j=0; j<nFD; j++)
{
rowIdx=w->termList->fwdDestroy[j].sparseIdx;
colIdx=w->termList->fwdDestroy[j].concIdx;
nzAddr=isNonZero[colIdx*(w->nSize)+rowIdx];
if(nzAddr==0)
{
printf("ERROR: %d term in fwdDestroy points to a zero J term\n",
j);
printf(" at J(%d,%d)\n",rowIdx,colIdx);
exit(-1);
}
w->termList->fwdDestroy[j].sparseIdx=nzAddr-1; // reset to sparse addr
}
for(j=0; j<nFC; j++)
{
rowIdx=w->termList->fwdCreate[j].sparseIdx;
colIdx=w->termList->fwdCreate[j].concIdx;
nzAddr=isNonZero[colIdx*(w->nSize)+rowIdx];
if(nzAddr==0)
{
printf("ERROR: %d term in fwdCreate points to a zero J term\n",
j);
printf(" at J(%d,%d)\n",rowIdx,colIdx);
exit(-1);
}
w->termList->fwdCreate[j].sparseIdx=nzAddr-1; // reset to sparse addr
}
for(int j=0; j<w->num_noninteger_jacobian_nonzeros; ++j) {
int dense_id = noninteger_row_id[j]+noninteger_column_id[j]*w->nSize;
nzAddr=isNonZero[dense_id];
w->noninteger_sparse_id[j] = nzAddr-1;
}
if(w->num_noninteger_jacobian_nonzeros>0) {
free(noninteger_row_id);
free(noninteger_column_id);
}
// Now the JsparseTermList should contain a consistent set of indexes
// for processing the Jacobian term by term. Note that each element
// in the list is independent, so the lists of JsparseIdx can be sorted
// to try to improve cache locality
// sparse solver specific allocations
// SuperLU
w->isFirstFactor=1; // indicate to do the full factorization
/* Set the default input options:
options.Fact = DOFACT;
options.Equil = YES;
options.ColPerm = COLAMD;
options.Trans = NOTRANS;
options.IterRefine = NOREFINE;
options.DiagPivotThresh = 1.0;
options.SymmetricMode = NO;
options.PivotGrowth = NO;
options.ConditionNumber = NO;
options.PrintStat = YES;
*/
set_default_options(&(w->optionSLU));
/* Set the default options for ILU
options.Fact = DOFACT;
options.Equil = YES;
options.ColPerm = COLAMD;
options.Trans = NOTRANS;
options.IterRefine = NOREFINE;
options.DiagPivotThresh = 0.1; //different from complete LU
options.SymmetricMode = NO;
options.PivotGrowth = NO;
options.ConditionNumber = NO;
options.PrintStat = YES;
options.RowPerm = LargeDiag_MC64;
options.ILU_DropTol = 1e-4;
options.ILU_FillTol = 1e-2;
options.ILU_FillFactor = 10.0;
options.ILU_DropRule = DROP_BASIC | DROP_AREA;
options.ILU_Norm = INF_NORM;
options.ILU_MILU = SILU;
*/
ilu_set_default_options(&(w->optionSLU));
w->optionSLU.ILU_DropTol = 5e-4;
w->optionSLU.ILU_FillTol = 1e-4;
w->optionSLU.ILU_FillFactor = 2.0;
w->optionSLU.DiagPivotThresh = DiagPivotThresh;
w->optionSLU.ILU_DropRule = DROP_BASIC | DROP_AREA;
w->optionSLU.ILU_MILU = SILU; //SMILU_{1,2,3};
// w->optionSLU.ColPerm = MMD_AT_PLUS_A; // best for iso-octane
// w->optionSLU.ColPerm = COLAMD;
// w->optionSLU.ColPerm = MMD_ATA;
w->optionSLU.ColPerm = MY_PERMC;
w->optionSLU.RowPerm = LargeDiag_MC64;
w->optionSLU.Equil=YES;
// w->optionSLU.SymmetricMode = YES; //Small DiagPivotThresh and MMD_AT_PLUS_A
w->vecRHS=(double *)malloc(sizeof(double)*(w->nSize));
w->vecSoln=(double *)malloc(sizeof(double)*(w->nSize));
w->rowPermutation=(int *)malloc(sizeof(int)*(w->nSize));
w->colPermutation=(int *)malloc(sizeof(int)*(w->nSize));
w->colElimTree=(int *)malloc(sizeof(int)*(w->nSize));
w->reduceData=(double *)malloc(sizeof(double)*w->nNonZero);
w->reduceRowIdx=(int *)malloc(sizeof(int)*w->nNonZero);
w->reduceColSum=(int *)malloc(sizeof(int)*(w->nSize+1));
// create a compressed column matrix
// SLU_NC ==
// SLU_D == data type double precision
// SLU_GE == matrix structure general
//dCreate_CompCol_Matrix(&(w->Mslu),w->nSize,w->nSize,w->nNonZero,
// w->mtxData,w->mtxRowIdx,w->mtxColSum,
// SLU_NC,SLU_D,SLU_GE);
dCreate_CompCol_Matrix(&(w->Mslu),
w->nSize,
w->nSize,
w->nNonZero,
w->reduceData,
w->reduceRowIdx,
w->reduceColSum,
SLU_NC,SLU_D,SLU_GE);
w->Rvec=(double *)malloc(sizeof(double)*(w->nSize));
w->Cvec=(double *)malloc(sizeof(double)*(w->nSize));
dCreate_Dense_Matrix(&(w->Bslu),w->nSize,1,w->vecRHS,w->nSize,
SLU_DN,SLU_D,SLU_GE);
dCreate_Dense_Matrix(&(w->Xslu),w->nSize,1,w->vecSoln,w->nSize,
SLU_DN,SLU_D,SLU_GE);
StatInit(&(w->statSLU)); // initialize SuperLU statistics
w->offDiagThreshold=tol;
w->ILU = doILU;
w->fakeUpdate = fakeUpdate;
w->threshType = threshType;
//Metis column permutation
w->permutationType = permutationType;
#ifdef CVIDT_USE_METIS
METIS_SetDefaultOptions(w->metis_options);
//Set to -1 for default
w->metis_options[METIS_OPTION_NUMBERING] = 0; // C-numbering
w->metis_options[METIS_OPTION_PFACTOR] = 0; // Default: 0 ["Good values often in the range of 60 to 200"]
w->metis_options[METIS_OPTION_CCORDER] = 1; // Default: 0
w->metis_options[METIS_OPTION_COMPRESS] = 1; // Default: 1
w->metis_options[METIS_OPTION_NITER] = 10; // Default: 10
w->metis_options[METIS_OPTION_NSEPS] = 1; // Default: 1
w->metis_options[METIS_OPTION_RTYPE] = METIS_RTYPE_SEP1SIDED; // Default: ??
//METIS_RTYPE_FM FM-based cut refinnement. (SegFault)
//METIS_RTYPE_GREEDY Greedy-based cut and volume refinement. (SegFault)
//METIS_RTYPE_SEP2SIDED Two-sided node FM refinement.
//METIS_RTYPE_SEP1SIDED One-sided node FM refinement.
w->metis_options[METIS_OPTION_CTYPE] = METIS_CTYPE_RM; // Default: SHEM
//METIS_CTYPE_RM Random matching.
//METIS_CTYPE_SHEM Sorted heavy-edge matching.
w->metis_options[METIS_OPTION_UFACTOR] = 1; // Default: 1 or 30 (ptype=rb or ptype=kway)
w->metis_options[METIS_OPTION_SEED] = 0; // Default: ??
#endif
if(w->permutationType < 1 || w->permutationType > 3)
{
printf("ERROR: Invalid permutationType: %d.",w->permutationType);
exit(-1);
}
if(w->permutationType == 3)
{
read_perm_c_from_file(w->nSize,w->colPermutation);
}
free(isNonZero);
return w;
}
void free_Jsparse(Jsparse *w)
{
if(w!=NULL)
{
StatFree(&(w->statSLU));
Destroy_SuperMatrix_Store(&(w->Bslu));
Destroy_SuperMatrix_Store(&(w->Xslu));
if(!w->isFirstFactor) {
Destroy_SuperNode_Matrix(&(w->Lslu));
Destroy_CompCol_Matrix(&(w->Uslu));
}
free(w->mtxData);
free(w->mtxRowIdx);
free(w->mtxColSum);
free(w->diagIdx);
free(w->lastRowIdx);
free(w->reduceData);
free(w->reduceRowIdx);
free(w->reduceColSum);
Destroy_SuperMatrix_Store(&(w->Mslu));
// SuperLU data
free(w->vecSoln);
free(w->vecRHS);
free(w->Rvec);
free(w->Cvec);
free(w->rowPermutation);
free(w->colPermutation);
free(w->colElimTree);
free_JsparseTermList(w->termList);
if(w->num_noninteger_jacobian_nonzeros>0) {
free(w->noninteger_sparse_id);
free(w->noninteger_jacobian);
}
free(w);
}
}
// void print_Jsparse(Jsparse *w)
// {
// int j,k,nElems;
// int rowIdx;
// double val;
// printf("# Number of nonzero elements: %d\n",w->nNonZero);
// for(j=0; j<w->nSize; j++)
// {
// nElems=w->mtxColSum[j+1]-w->mtxColSum[j];
// printf(" Col %d has %d nonzero elements\n",j,nElems);
// for(k=0; k<nElems; k++)
// {
// val=w->mtxData[w->mtxColSum[j]+k];
// rowIdx=w->mtxRowIdx[w->mtxColSum[j]+k];
// printf(" J(%d,%d) = %14.6e\n",rowIdx,j,val);
// }
// printf("\n");
// //exit(-1);
// }
// printf("# Number of forward destruction terms: %d\n",
// w->termList->nFwdDestroy);
// printf("# Number of forward creation terms: %d\n",
// w->termList->nFwdCreate);
// printf("# Number of reverse destruction terms: %d\n",
// w->termList->nRevDestroy);
// printf("# Number of reverse creation terms: %d\n",
// w->termList->nRevCreate);
// printf("# Forward Destruction Terms:\n");
// printf("# i.e. both species are reactants in the same reaction\n");
// printf("#\n# numer denom\n");
// printf("# J term rxn ID spc ID spc ID sparse mtx ID\n");
// for(j=0; j<(w->termList->nFwdDestroy); j++)
// {
// printf("%6d %6d %6d %6d %6d\n",j,
// w->termList->fwdDestroy[j].rxnIdx,
// w->mtxRowIdx[w->termList->fwdDestroy[j].sparseIdx],
// w->termList->fwdDestroy[j].concIdx,
// w->termList->fwdDestroy[j].sparseIdx);
// }
// printf("\n\n");
// printf("# Forward Creation Terms:\n");
// printf("# i.e. numerator species is a product and the denominator\n");
// printf("# is a reactant in the same reaction\n");
// printf("#\n# numer denom\n");
// printf("# J term rxn ID spc ID spc ID\n");
// for(j=0; j<(w->termList->nFwdCreate); j++)
// {
// printf("%6d %6d %6d %6d %6d\n",j,
// w->termList->fwdCreate[j].rxnIdx,
// w->mtxRowIdx[w->termList->fwdCreate[j].sparseIdx],
// w->termList->fwdCreate[j].concIdx,
// w->termList->fwdCreate[j].sparseIdx);
// }
// printf("\n\n");
// printf("# Reverse Destruction Terms:\n");
// printf("# i.e. both species are products in the same reversible reaction\n");
// printf("#\n# numer denom\n");
// printf("# J term rxn ID spc ID spc ID sparse mtx ID\n");
// for(j=0; j<(w->termList->nRevDestroy); j++)
// {
// printf("%6d %6d %6d %6d %6d\n",j,
// w->termList->revDestroy[j].rxnIdx,
// w->mtxRowIdx[w->termList->revDestroy[j].sparseIdx],
// w->termList->revDestroy[j].concIdx,
// w->termList->revDestroy[j].sparseIdx);
// }
// printf("\n\n");
// printf("# Reverse Creation Terms:\n");
// printf("# i.e. numerator species is a reactant and the denominator\n");
// printf("# is a product in the same reversible reaction\n");
// printf("#\n# numer denom\n");
// printf("# J term rxn ID spc ID spc ID\n");
// for(j=0; j<(w->termList->nRevCreate); j++)
// {
// printf("%6d %6d %6d %6d %6d\n",j,
// w->termList->revCreate[j].rxnIdx,
// w->mtxRowIdx[w->termList->revCreate[j].sparseIdx],
// w->termList->revCreate[j].concIdx,
// w->termList->revCreate[j].sparseIdx);
// }
// }
void countJacobianTerms(zerork::mechanism &mechInp, int *nFwdDestroy, int *nFwdCreate)
{
int j;
int nStep=mechInp.getNumSteps();
double nuSumReac,nuSumProd;
(*nFwdDestroy)=0;
(*nFwdCreate)=0;
for(j=0; j<nStep; j++)
{
nuSumReac=mechInp.getOrderOfStep(j);
nuSumProd=mechInp.getNumProductsOfStep(j);
(*nFwdDestroy)+=nuSumReac*nuSumReac;
(*nFwdCreate)+=nuSumReac*nuSumProd;
}
}
double getElement_Jsparse(Jsparse *w,const int rowIdx, const int colIdx)
{
int nElem=w->mtxColSum[colIdx+1]-w->mtxColSum[colIdx];
int j;
int currentRow;
for(j=0; j<nElem; j++)
{
currentRow=w->mtxRowIdx[w->mtxColSum[colIdx]+j];
if(rowIdx == currentRow)
{return w->mtxData[w->mtxColSum[colIdx]+j];}
else if(rowIdx < currentRow)
{return 0.0;}
}
return 0.0;
}
void calcReaction_Jsparse(Jsparse *w, const double invPosConc[],
const double fwdROP[])
{
int j;
int rxnId,concId,sparseId;
// set the full sparse array
for(j=0; j<w->nNonZero; j++)
{w->mtxData[j]=0.0;}
// process the forward destruction terms
for(j=0; j<w->termList->nFwdDestroy; j++)
{
concId = w->termList->fwdDestroy[j].concIdx;
rxnId = w->termList->fwdDestroy[j].rxnIdx;
sparseId = w->termList->fwdDestroy[j].sparseIdx;
//printf(" j = %d, concId = %d, rxnId = %d, sparseId = %d\n",j,concId,rxnId,sparseId); fflush(stdout);
w->mtxData[sparseId]-=fwdROP[rxnId]*invPosConc[concId];
}
// process the forward creation terms
for(j=0; j<w->termList->nFwdCreate; j++)
{
concId = w->termList->fwdCreate[j].concIdx;
rxnId = w->termList->fwdCreate[j].rxnIdx;
sparseId = w->termList->fwdCreate[j].sparseIdx;
w->mtxData[sparseId]+=fwdROP[rxnId]*invPosConc[concId];
}
}
void change_JsparseThresh(Jsparse *w, double newThresh)
{w->offDiagThreshold=newThresh;}
| [
"whitesides1@llnl.gov"
] | whitesides1@llnl.gov |
d7072a09a4498f5974e46e79bf2829e128709100 | 40f608d1961960345da32c52a143269fe615ee01 | /MPR121test/MPR121test.ino | ede715c7d81014f6ef2eaf9a23148bc626a208b9 | [] | no_license | awk6873/arduino-elevator-model | c608d27fd2ba2db28baadc4d058d39da1a093398 | 280cea5cc4090e9a10d879e1d3a6df6087f55109 | refs/heads/main | 2023-04-20T16:10:08.529325 | 2021-05-05T16:42:12 | 2021-05-05T16:42:12 | 363,899,771 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,555 | ino | /*********************************************************
This is a library for the MPR121 12-channel Capacitive touch sensor
Designed specifically to work with the MPR121 Breakout in the Adafruit shop
----> https://www.adafruit.com/products/
These sensors use I2C communicate, at least 2 pins are required
to interface
Adafruit invests time and resources providing this open source code,
please support Adafruit and open-source hardware by purchasing
products from Adafruit!
Written by Limor Fried/Ladyada for Adafruit Industries.
BSD license, all text above must be included in any redistribution
**********************************************************/
#include <Wire.h>
#include "Adafruit_MPR121.h"
#ifndef _BV
#define _BV(bit) (1 << (bit))
#endif
// You can have up to 4 on one i2c bus but one is enough for testing!
Adafruit_MPR121 cap = Adafruit_MPR121();
// Keeps track of the last pins touched
// so we know when buttons are 'released'
uint16_t lasttouched = 0;
uint16_t currtouched = 0;
void setup() {
Serial.begin(9600);
while (!Serial) { // needed to keep leonardo/micro from starting too fast!
delay(10);
}
pinMode(A5, INPUT_PULLUP);
Serial.println("Adafruit MPR121 Capacitive Touch sensor test");
// Default address is 0x5A, if tied to 3.3V its 0x5B
// If tied to SDA its 0x5C and if SCL then 0x5D
if (!cap.begin(0x5A)) {
Serial.println("MPR121 not found, check wiring?");
while (1);
}
Serial.println("MPR121 found!");
}
void loop() {
// Get the currently touched pads
currtouched = cap.touched();
for (uint8_t i=0; i<12; i++) {
// it if *is* touched and *wasnt* touched before, alert!
if ((currtouched & _BV(i)) && !(lasttouched & _BV(i)) ) {
Serial.print(i); Serial.println(" touched");
}
// if it *was* touched and now *isnt*, alert!
if (!(currtouched & _BV(i)) && (lasttouched & _BV(i)) ) {
Serial.print(i); Serial.println(" released");
}
}
// reset our state
lasttouched = currtouched;
// comment out this line for detailed data from the sensor!
return;
// debugging info, what
Serial.print("\t\t\t\t\t\t\t\t\t\t\t\t\t 0x"); Serial.println(cap.touched(), HEX);
Serial.print("Filt: ");
for (uint8_t i=0; i<12; i++) {
Serial.print(cap.filteredData(i)); Serial.print("\t");
}
Serial.println();
Serial.print("Base: ");
for (uint8_t i=0; i<12; i++) {
Serial.print(cap.baselineData(i)); Serial.print("\t");
}
Serial.println();
// put a delay so it isn't overwhelming
delay(100);
}
| [
"akabaev@beeline.ru"
] | akabaev@beeline.ru |
9d6686a69eec2779c31a476217e8f0bbc3558446 | a71e120698165b95c6c3f4cdb9b8ec1e5e118170 | /Validation/VstQuaeroUtils/src/Refine.cc | 2c0841102de90517e7740c98aed9323585c9fbee | [] | no_license | peiffer/usercode | 173d69b64e2a4f7082c9009f84336aa7c45f32c5 | 7558c340d4cda8ec5a5b00aabcf94d5b3591e178 | refs/heads/master | 2021-01-14T14:27:32.667867 | 2016-09-06T13:59:05 | 2016-09-06T13:59:05 | 57,212,842 | 0 | 0 | null | 2016-04-27T12:47:54 | 2016-04-27T12:47:54 | null | UTF-8 | C++ | false | false | 65,595 | cc | /*******************************************
Implements Refine, a class that "refines" a sample of events,
cutting away events outside the boundaries we are able to analyze.
********************************************/
#include "Validation/VstQuaeroUtils/interface/Refine.hh"
#include <string>
#include <cfloat>
using namespace std;
/* Constructor. Arguments include which collider (tev1, tev2, lep2, hera, or lhc)
and which experiment (aleph, l3, cdf, d0, h1, or cms) Refine should assume.
int _level specifies the level of refinement, with higher levels implementing
more refinement. HintSpec is passed in as an argument if this refinement restricts
itself to a subsample in which a hint (of new physics) is observed. */
Refine::Refine(string _collider, string _experiment, string partitionRuleName, int _level, HintSpec _hintSpec):
collider(_collider), experiment(_experiment),
partitionRule((partitionRuleName=="" ? _collider+"-Vista" : partitionRuleName)),
level(_level), hintSpec(_hintSpec)
{
// Ensure _collider and _experiment are understood
assert(
((collider=="tev1")&&
((experiment=="d0"))) ||
((collider=="tev2")&&
((experiment=="cdf")||(experiment=="d0"))) ||
((collider=="lhc")&&
((experiment=="cms")||(experiment=="atlas"))) ||
((collider=="lep2")&&
((experiment=="aleph")||(experiment=="l3"))) ||
((collider=="hera")&&
((experiment=="h1")))
);
minWt = 0;
return;
}
bool Refine::satisfiesCriteriaQ(QuaeroEvent& e)
{
vector<QuaeroRecoObject> o = e.getObjects();
double wt = e.getWeight();
bool debug = false;
// if((e.getEventType()=="sig")&&(wt>10)) wt = 10;
double zvtx = e.getZVtx();
double sumPt = 0;
for(size_t i=0; i<o.size(); i++)
sumPt += o[i].getFourVector().perp();
sumPt += e.getPmiss().perp();
string fs = partitionRule.getFinalState(e).getTextString();
bool ans = true;
/*************************************************
LEP II
**************************************************/
if((collider=="lep2")&&
((experiment=="l3")||(experiment=="aleph")))
{
if(experiment=="aleph")
{
for(size_t i=0; i<o.size(); i++)
if((o[i].getObjectTypeSansSign()=="e")||
(o[i].getObjectTypeSansSign()=="mu")||
(o[i].getObjectTypeSansSign()=="tau")||
(o[i].getObjectTypeSansSign()=="ph"))
for(size_t j=0; j<o.size(); j++)
if(o[j].getObjectType()=="ph")
if(i!=j)
if((Math::deltaphi(o[i].getFourVector().phi(),o[j].getFourVector().phi())<3./180*M_PI)&&
(fabs(o[i].getFourVector().theta()-o[j].getFourVector().theta())<3./180*M_PI))
{
o[i] = QuaeroRecoObject(o[i].getObjectType(),
o[i].getFourVector()+o[j].getFourVector());
o.erase(o.begin()+j);
break;
}
}
// Cluster at a larger scale
int k1=0,k2=0;
while((k1>=0)&&(k2>=0))
{
k1=k2=-1;
double y_cut = 0.01;
double yij_min = y_cut;
for(size_t i=0; i<o.size(); i++)
if((o[i].getObjectType()=="j") ||
(o[i].getObjectType()=="b") ||
(o[i].getObjectTypeSansSign()=="tau"))
for(size_t j=i+1; j<o.size(); j++)
if((o[j].getObjectType()=="j") ||
(o[j].getObjectType()=="b") ||
(o[i].getObjectTypeSansSign()=="tau"))
{
double yij = pow((o[i].getFourVector()+o[j].getFourVector()).m()/e.getRootS(),2.);
if(yij < yij_min)
{
yij_min = yij;
k1=i; k2=j;
}
}
if((k1>=0)&&(k2>=0))
{
o[k1] = QuaeroRecoObject("j",o[k1].getFourVector()+o[k2].getFourVector());
o.erase(o.begin()+k2);
}
}
// e = QuaeroEvent(e.getEventType(), e.getRunNumber(), e.getWeight(), o, e.getRootS(), e.getZVtx());
e.setObjects(o);
fs = partitionRule.getFinalState(e).getTextString();
bool nothingInterestingInEvent =
((e.numberOfObjects(25,0.7)==0) ||
(fs=="1pmiss") ||
((e.numberOfObjects(25,0.7)==1)&&(e.numberOfObjects("uncl",25,0.7)==1))
);
bool eventContainsFarForwardObject = false;
for(size_t i=0; i<o.size(); i++)
if((fabs(cos(o[i].getFourVector().theta()))>0.9)&&
(o[i].getFourVector().e()>10))
eventContainsFarForwardObject = true;
if(experiment=="l3")
{
// In events with two like-sign electrons, make them opposite sign
if( (e.numberOfObjects("e+")==2) )
for(size_t i=0; i<o.size(); i++)
if(o[i].getObjectType()=="e+")
{
o[i].chargeConjugate();
break;
}
if( (e.numberOfObjects("e-")==2) )
for(size_t i=0; i<o.size(); i++)
if(o[i].getObjectType()=="e-")
{
o[i].chargeConjugate();
break;
}
/*
// Massage electron energy of Monte Carlo
if(e.getEventType()!="data")
{
for(size_t i=0; i<o.size(); i++)
if((o[i].getObjectTypeSansSign()=="e")&&(o[i].getFourVector().e()>20))
{
double E = o[i].getFourVector().e();
double q =
( E -
(E>20)*1.0*(E -20)/((e.getRootS()-10)-20) -
(E>e.getRootS()-10)*(E-(e.getRootS()-10))*3.5/10 -
(E>e.getRootS())*(E-e.getRootS())/2 )
/ o[i].getFourVector().e();
o[i] = QuaeroRecoObject(o[i].getObjectType(),o[i].getFourVector()*q);
}
}
for(int i=0; i<o.size(); i++)
{
if((o[i].getObjectTypeSansSign()=="e")&&
(fabs(cos(o[i].getFourVector().theta()))>0.65))
o[i].changeComponentType("ph");
}
e.setObjects(o);
if((e.numberOfObjects("e+")==1)&&
(e.numberOfObjects("ph")==1))
for(size_t i=0; i<o.size(); i++)
if(o[i].getObjectType()=="ph")
o[i].changeComponentType("e-");
if((e.numberOfObjects("e-")==1)&&
(e.numberOfObjects("ph")==1))
for(size_t i=0; i<o.size(); i++)
if(o[i].getObjectType()=="ph")
o[i].changeComponentType("e+");
if((e.numberOfObjects("e")==0)&&
(e.numberOfObjects("ph")==2))
for(size_t i=0; i<o.size(); i++)
if((o[i].getObjectType()=="ph")&&
(fabs(cos(o[i].getFourVector().theta()))>0.65))
o[i].changeComponentType( ((cos(o[i].getFourVector().theta())>0) ? "e-" : "e+") );
e.setObjects(o);
*/
bool poorlyMeasuredBackToBack = false;
if((o.size()==2) &&
(Math::deltaphi(o[0].getFourVector().phi(),o[1].getFourVector().phi())>3.0) &&
(e.getPmiss().perp()>10) )
poorlyMeasuredBackToBack = true;
/*
if(e.numberOfObjects("e")==1)
{
int j=-1;
for(size_t i=0; i<o.size(); i++)
if(o[i].getObjectType()=="ph")
if((j<0)||(o[j].getFourVector().perp()<o[i].getFourVector().perp()))
j=i;
if(j>=0)
{
if(e.numberOfObjects("e+")==1)
o[j].changeComponentType("e-");
else
o[j].changeComponentType("e+");
}
}
// The simulation does not appear to do a good job of reproducing the tracking efficiency
// for electrons with |cos(theta)| > 0.6. We are removing events with an electron and with a
// photon reconstructed with |cos(theta)| > 0.6.
if( (e.numberOfObjects("e")==1) &&
(e.numberOfObjects("ph")>=1) &&
(fabs(cos(e.getThisObject("ph",1)->getFourVector().theta()))>0.6) )
ans = false;
*/
// Adjust energies
if((e.getEventType()!="data")&&(level>=5))
{
for(size_t i=0; i<o.size(); i++)
if(o[i].getObjectType()=="j")
o[i] = QuaeroRecoObject("j",o[i].getFourVector()*Math::gasdev(1,0.01));
else if(o[i].getObjectTypeSansSign()=="mu")
o[i] = QuaeroRecoObject(o[i].getObjectType(),o[i].getFourVector()*Math::gasdev(1,0.05));
else if((o[i].getObjectTypeSansSign()=="e") ||
(o[i].getObjectType()=="ph"))
o[i] = QuaeroRecoObject(o[i].getObjectType(),o[i].getFourVector()*0.99);
}
// Slightly smear azimuthal angle of Monte Carlo events
if((e.getEventType()!="data")&&(level>=5))
for(size_t i=0; i<o.size(); i++)
{
CLHEP::HepLorentzVector p = o[i].getFourVector();
double pt = p.perp();
double phi = p.phi()+Math::gasdev(0,0.005);
p = CLHEP::HepLorentzVector(p.e(), CLHEP::Hep3Vector(pt*cos(phi),pt*sin(phi),p.pz()));
o[i] = QuaeroRecoObject(o[i].getObjectType(),p);
}
e.setObjects(o);
fs = partitionRule.getFinalState(e).getTextString();
bool lowEnergySingleObjectEvent = false;
int i1=-1;
for(size_t i=0; i<o.size(); i++)
if(o[i].getFourVector().e()>10)
if(i1<0)
i1=i;
else
i1=99;
if((i1>=0)&&(i1!=99))
if((o[i1].getFourVector().e()<75)||
(o[i1].getFourVector().e() > (e.getRootS()/2-10))||
(fabs(cos(o[i1].getFourVector().theta()))>0.5))
lowEnergySingleObjectEvent = true;
bool forwardDoubleObjectEvent = false;
i1=-1; int i2=-1;
for(size_t i=0; i<o.size(); i++)
if(o[i].getFourVector().e()>10)
if(i1<0)
i1=i;
else
if(i2<0)
i2=i;
else
i1=99;
if((i1>=0)&&(i2>=0)&&(i1!=99))
if((fabs(cos(o[i1].getFourVector().theta()))>0.5)||
(fabs(cos(o[i2].getFourVector().theta()))>0.5))
forwardDoubleObjectEvent = true;
/*
// Remove events with poorly measured electron, producing collinear missing energy
if((fs=="1e+1e-1pmiss"))
{
double dphi = Math::deltaphi( e.getThisObject("e+")->getFourVector().phi(), e.getThisObject("e+")->getFourVector().phi() );
if(dphi>3.0)
ans = false;
}
*/
/* We see additional events in the data in the final states 1j and 1j1pmiss.
From scanning events, we note that these appear to be due to events with a cosmic ray muon
that brems in the hadronic calorimeter, screwing up the reconstruction of the event.
The hypothesis that this excess is due to new physics is discarded by the fact that
no such excess is seen in the Aleph data, where we have been able to do a more thorough
job of removing cosmic ray events. We therefore remove the 1j and 1j1pmiss final states. */
/*
bool disallowedFinalState = false;
if( (fs=="1e+1pmiss") ||
(fs=="1e-1pmiss") ||
(fs=="1j") ||
(fs=="1j1pmiss") )
disallowedFinalState = true;
if((fs=="1e+1j")||(fs=="1e-1j"))
{
for(size_t i=0; i<o.size(); i++)
if(o[i].getObjectType()=="j")
{
if(fs=="1e+1j")
o[i].changeComponentType("e-");
if(fs=="1e-1j")
o[i].changeComponentType("e+");
break;
}
fs = "1e+1e-";
}
if( (fs=="1e+1j1pmiss") ||
(fs=="1e-1j1pmiss") ||
(fs=="1j1ph1pmiss") ||
(fs=="1j1ph1pmiss") )
{
double dphi = Math::deltaphi( e.getThisObject("j")->getFourVector().phi(), e.getPmiss().phi() );
if((dphi<0.1)||(dphi>M_PI-0.1))
ans = false;
}
*/
double pmissPolar = fabs(cos(e.getPmiss().theta()));
bool missingEnergyPointingIntoSpacCal = ((e.getPmiss().e()>15)&&(pmissPolar>0.7)&&(pmissPolar<0.75));
bool missingEnergyPointingDownBeamPipe = ((e.getPmiss().e()>15)&&(pmissPolar>0.9));
bool hasObjectFarForward = false;
for(size_t i=0; i<o.size(); i++)
if((fabs(cos(o[i].getFourVector().theta()))>0.9)&&
(o[i].getFourVector().e()>10))
hasObjectFarForward = true;
bool photonPmissEvent = false;
if((fs=="1ph1pmiss")||
(fs=="2ph1pmiss")||
(fs=="3ph1pmiss")||
(fs=="4ph1pmiss"))
photonPmissEvent = true;
bool photonOnlyEvent = false;
if((fs=="1ph")||
(fs=="2ph")||
(fs=="3ph")||
(fs=="4ph"))
photonOnlyEvent = true;
if( nothingInterestingInEvent ||
missingEnergyPointingIntoSpacCal ||
missingEnergyPointingDownBeamPipe ||
lowEnergySingleObjectEvent ||
forwardDoubleObjectEvent ||
hasObjectFarForward
//photonPmissEvent ||
//photonOnlyEvent ||
//poorlyMeasuredBackToBack ||
//disallowedFinalState
)
ans = false;
}
if(experiment=="aleph")
{
bool cosmicEvent = false;
if((e.numberOfObjects("mu+",10)==1)&&
(e.numberOfObjects("mu-",10)==1))
{
CLHEP::HepLorentzVector mu1 = e.getThisObject("mu+",1)->getFourVector();
CLHEP::HepLorentzVector mu2 = e.getThisObject("mu-",1)->getFourVector();
// double m = (mu1+mu2).m();
if( (Math::deltaphi(mu1.phi(),mu2.phi())>3.13) )
cosmicEvent = true;
}
bool screwedUpReconstructionOfBremEvent = false;
if((e.numberOfObjects("e+",10)==1)&&
(e.numberOfObjects("e-",10)==1)&&
(e.numberOfObjects("ph",10)==1))
{
CLHEP::HepLorentzVector e1 = e.getThisObject("e+",1)->getFourVector();
CLHEP::HepLorentzVector e2 = e.getThisObject("e-",1)->getFourVector();
if( (Math::deltaphi(e1.phi(),e2.phi())>3.0) )
screwedUpReconstructionOfBremEvent = true;
}
bool conversion = false;
if( (fs=="2e+") ||
(fs=="2e-") ||
(fs=="2mu+") ||
(fs=="2mu-") )
conversion = true;
for(int i=0; i<e.numberOfObjects("e+",10); i++)
for(int j=0; j<e.numberOfObjects("e-",10); j++)
if( (e.getThisObject("e+",i+1)->getFourVector()+
e.getThisObject("e-",j+1)->getFourVector()).m() < 5 )
conversion = true;
bool photonPmissEvent = false;
if((fs=="1ph")|| // contributions from cosmic rays that we do not model
((fs=="2ph")&& // One of two different issues:
((fabs(e.getRootS()-183)<1) || // (1) Kyle and I never ran over the multiph-183 file
((e.getThisObject("ph",1)!=NULL)&& // (2) cosmic rays again
(e.getThisObject("ph",2)!=NULL)&&
(Math::deltaphi(e.getThisObject("ph",1)->getFourVector().phi(),
e.getThisObject("ph",2)->getFourVector().phi()) < 1))
))||
(fs=="1ph1pmiss")||
(fs=="2ph1pmiss")||
(fs=="3ph1pmiss")||
(fs=="4ph1pmiss"))
photonPmissEvent = true;
bool mistakenOneProngTau = false;
if( (o.size()==2)&&
( (o[0].getObjectTypeSansSign()=="tau") ||
(o[1].getObjectTypeSansSign()=="tau") ) &&
( (o[0].getObjectTypeSansSign()=="e") ||
(o[0].getObjectTypeSansSign()=="mu") ||
(o[0].getObjectTypeSansSign()=="tau") ) &&
( (o[1].getObjectTypeSansSign()=="e") ||
(o[1].getObjectTypeSansSign()=="mu") ||
(o[1].getObjectTypeSansSign()=="tau") ) &&
( Math::deltaphi(o[0].getFourVector().phi(),o[1].getFourVector().phi()) > 3.13 )
)
mistakenOneProngTau = true;
if((fs=="1e+1j")||(fs=="1e-1j"))
{
for(size_t i=0; i<o.size(); i++)
if(o[i].getObjectType()=="j")
{
if(fs=="1e+1j")
o[i].changeComponentType("e-");
if(fs=="1e-1j")
o[i].changeComponentType("e+");
break;
}
fs = "1e+1e-";
}
if(
nothingInterestingInEvent ||
eventContainsFarForwardObject ||
cosmicEvent ||
screwedUpReconstructionOfBremEvent ||
conversion ||
mistakenOneProngTau ||
((level>=5) &&
(photonPmissEvent))
)
ans = false;
}
}
/*************************************************
HERA
**************************************************/
if((collider=="hera")&&
((experiment=="h1")||(experiment=="zeus")))
{
double maxEta = 2.44; // = -log(tan(10./180*M_PI/2));
double oPtMin = ((level<=1) ? 15 : 20);
if(e.getEventType()=="sig")
{
// All e's are e+'s in the H1 General Search
for(size_t i=0; i<o.size(); i++)
if(o[i].getObjectType()=="e-")
o[i].chargeConjugate();
// Merge any jets with deltaR < 1.0
for(size_t i=0; i<o.size(); i++)
for(size_t j=i+1; j<o.size(); j++)
if((o[i].getObjectType()=="j")&&
(o[j].getObjectTypeSansSign()=="j")&&
(Math::deltaR(o[i].getFourVector().phi(),
Math::theta2eta(o[i].getFourVector().theta()),
o[j].getFourVector().phi(),
Math::theta2eta(o[j].getFourVector().theta())) < 1.0))
{
o[i] = QuaeroRecoObject("j",o[i].getFourVector()+o[j].getFourVector());
o.erase(o.begin()+j);
j--;
}
// Any object with 10 < theta < 140 degrees is converted to unclustered energy
for(size_t i=0; i<o.size(); i++)
if((o[i].getFourVector().theta()*180./M_PI < 10)||
(o[i].getFourVector().theta()*180./M_PI > 140))
o[i].changeComponentType("uncl");
e.setObjects(o);
fs = partitionRule.getFinalState(e).getTextString();
// Remove events with E - pz > 75 GeV, following the H1 General Search
double energy=0, pz=0;
for(size_t i=0; i<o.size(); i++)
{
energy += o[i].getFourVector().e();
pz += fabs(o[i].getFourVector().pz());
}
if(energy-pz>75) // see email from Caron to Knuteson on 2/21/2005
ans = false;
if((e.getEventType()=="sig")&&
(level==11))
{
// KILL.qbg -- see investigateKills_summary.txt
wt *= 0.99;
// KILL.noz -- see investigateKills_summary.txt
if((o.size()==2)&&
((o[0].getObjectType()=="ph")||
(o[1].getObjectType()=="ph")))
wt *= 0.99;
// electrons are sometimes killed
int z = e.numberOfObjects("e",oPtMin);
if(z>=1)
{
if(e.numberOfObjects("j",oPtMin)==0)
wt *= pow(0.80,1.*z);
if(e.numberOfObjects("j",oPtMin)==1)
wt *= pow(1729./2400*1.1,1.*z);
if(e.numberOfObjects("j",oPtMin)==2)
wt *= pow(616./947,1.*z);
if(e.numberOfObjects("j",oPtMin)==3)
wt *= pow(0.55,1.*z);
if(e.numberOfObjects("j",oPtMin)==4)
wt *= pow(0.54,1.*z);
if(e.getThisObject("e+",1)!=0)
{
double eta = Math::theta2eta(e.getThisObject("e+",1)->getFourVector().theta());
wt *= (1-min(3.,max(-1.,eta-0.8))*0.10);
if(eta>1)
wt *= .5;
}
}
// photons are sometimes killed
if(e.numberOfObjects("ph",oPtMin)>=1)
{
if(e.numberOfObjects("j",oPtMin)==0)
wt *= 0.80;
if(e.numberOfObjects("j",oPtMin)==1)
wt *= 16./36;
if(e.numberOfObjects("j",oPtMin)>=2)
wt *= 0.25;
if(e.getThisObject("ph",1)!=0)
wt *= (1-min(3.,max(-1.,(Math::theta2eta(e.getThisObject("ph",1)->getFourVector().theta())-1.2)))*0.20);
}
// muons are sometimes killed
if(e.numberOfObjects("mu",oPtMin)>=1)
{
if(e.getThisObject("mu+",1)!=0)
{
double eta = Math::theta2eta(e.getThisObject("mu+",1)->getFourVector().theta());
if(eta>1)
wt *= 0.5;
}
}
}
for(size_t i=0; i<o.size(); i++)
if(o[i].getObjectType()=="kill")
{
if((o[i].getFourVector().perp()>20)&&
(o[i].getFourVector().theta()*180./M_PI > 10)&&
(o[i].getFourVector().theta()*180./M_PI < 140))
ans = false;
else
o[i].changeComponentType("uncl");
}
if(e.getEventType()!="data")
{
// Remove events containing a photon within deltaR < 1.0 of a jet
for(size_t i=0; i<o.size(); i++)
for(size_t j=0; j<o.size(); j++)
if((o[i].getObjectType()=="j")&&
(o[j].getObjectType()=="ph")&&
(Math::deltaR(o[i].getFourVector().phi(),
Math::theta2eta(o[i].getFourVector().theta()),
o[j].getFourVector().phi(),
Math::theta2eta(o[j].getFourVector().theta())) < 1.0))
ans = false;
// Remove events containing an electron within deltaR < 1.0 of a jet
for(size_t i=0; i<o.size(); i++)
for(size_t j=0; j<o.size(); j++)
if((o[i].getObjectType()=="j")&&
(o[j].getObjectTypeSansSign()=="e")&&
(Math::deltaR(o[i].getFourVector().phi(),
Math::theta2eta(o[i].getFourVector().theta()),
o[j].getFourVector().phi(),
Math::theta2eta(o[j].getFourVector().theta())) < 1.0))
ans = false;
}
}
// Remove the 1mu+1pmiss final state
// There is a large discrepancy here, hypothesized to result from a low-pT track
// being misreconstructed to high-pT
// Also remove other final states with only one object
if( ( ( e.numberOfObjects("e",oPtMin)+
e.numberOfObjects("mu",oPtMin)+
e.numberOfObjects("ph",oPtMin)+
e.numberOfObjects("j",oPtMin,maxEta) ) < 2 ) )
ans = false;
}
/*************************************************
Tevatron I
**************************************************/
if((collider=="tev1")&&
(experiment=="d0"))
{
for(size_t i=0; i<o.size(); i++)
if((o[i].getObjectType()=="e-")||
(o[i].getObjectType()=="mu-")) // all leptons are positive at D0 Run I
o[i].chargeConjugate();
for(size_t i=0; i<o.size(); i++)
if(o[i].getObjectType()=="j")
for(size_t j=i+1; j<o.size(); j++)
if(o[j].getObjectType()=="j")
if(Math::deltaR(o[i].getFourVector().phi(),
Math::theta2eta(o[i].getFourVector().theta()),
o[j].getFourVector().phi(),
Math::theta2eta(o[j].getFourVector().theta()))<0.7)
{
o[i] = QuaeroRecoObject("j",o[i].getFourVector()+o[j].getFourVector());
o.erase(o.begin()+j);
j--;
}
e.setObjects(o);
fs = partitionRule.getFinalState(e).getTextString();
bool allowedFinalState = false;
if(
(fs=="1e+2j1pmiss")||
(fs=="1e+3j1pmiss")||
(fs=="1e+4j1pmiss")||
(fs=="1e+5j1pmiss")||
(fs=="1e+6j1pmiss")||
(fs=="2e+2j")||
(fs=="2e+3j")||
(fs=="2e+4j")||
(fs=="1e+1mu+")||
(fs=="1e+1j1mu+")||
(fs=="1e+2j1mu+")||
(fs=="1e+3j1mu+")||
(fs=="1e+1mu+1pmiss")||
(fs=="1e+1j1mu+1pmiss")||
(fs=="1e+2j1mu+1pmiss")||
(fs=="1e+3j1mu+1pmiss")
)
allowedFinalState = true;
bool allowedTopology = false;
CLHEP::HepLorentzVector jetSum;
for(size_t i=0; i<o.size(); i++)
if(o[i].getObjectType()=="j")
jetSum = jetSum + o[i].getFourVector();
if((e.numberOfObjects("e+",20)>=1)&&
(e.getPmiss().perp()>30)&&
(e.numberOfObjects("j",20)>=2)&&
((e.getThisObject("e+",1)->getFourVector()+e.getPmiss()).m()>30)&&
((e.getThisObject("e+",1)->getFourVector()+e.getPmiss()).perp()>45)&&
(jetSum.perp()>45)&&
(Math::deltaphi(e.getThisObject("j",1)->getFourVector().phi(),e.getPmiss().phi())>0.25)&&
(Math::deltaphi(e.getThisObject("j",2)->getFourVector().phi(),e.getPmiss().phi())>0.25))
allowedTopology = true; // cuts_1e0mu0tau0ph2j0b1met
if((e.numberOfObjects("e+",15)>=1)&&
(e.numberOfObjects("mu+",15)>=1))
allowedTopology = true; // cuts_1e1mu0tau0ph0j0b0met
if((e.numberOfObjects("e+",20)>=2)&&
(e.numberOfObjects("j",20)>=2))
allowedTopology = true;
if(e.getEventType()=="sig")
{
// These numbers come from Quaero_d0/particleIDefficiencies.txt
if(e.numberOfObjects("e+")>=2) // 2e0mu0tau0ph2j0b0met
wt *= 0.70;
if((e.numberOfObjects("e+")==1)&&
(e.numberOfObjects("mu+")==0)) // 1e0mu0tau0ph2j0b1met
wt *= 0.61;
if((e.numberOfObjects("e+")==1)&&
(e.numberOfObjects("mu+")==1)) // 1e1mu0tau0ph0j0b0met
wt *= 0.30;
}
if(
(!allowedFinalState)||
(!allowedTopology)
)
ans = false;
}
/*************************************************
Tevatron II
**************************************************/
if((collider=="tev2")&&
((experiment=="d0")))
{
string eventType = e.getEventType();
if(
(eventType.find("data_1pc")!=string::npos)||
(eventType.find("dataset_1pc")!=string::npos)||
(eventType.find("data_10pc")!=string::npos)||
(eventType.find("dataset_10pc")!=string::npos)||
(eventType.find("hipt-data")!=string::npos)
)
eventType = "data";
e.reType(eventType);
string rn = e.getRunNumber();
// Remove duplicate objects
vector<string> orderedObjects;
orderedObjects.push_back("e");
orderedObjects.push_back("mu");
orderedObjects.push_back("tau");
orderedObjects.push_back("ph");
orderedObjects.push_back("b");
orderedObjects.push_back("j");
for(size_t i=0; i<o.size(); i++)
{
vector<string>::iterator k=find(orderedObjects.begin(),orderedObjects.end(),o[i].getObjectTypeSansSign());
if(k!=orderedObjects.end())
for(size_t j=0; j<o.size(); j++)
if((i!=j)&&(find(k+1,orderedObjects.end(),o[j].getObjectTypeSansSign())!=orderedObjects.end()))
if(Math::deltaR(o[i].getFourVector().phi(),
Math::theta2eta(o[i].getFourVector().theta()),
o[j].getFourVector().phi(),
Math::theta2eta(o[j].getFourVector().theta())) < 0.4)
{
o[j] = QuaeroRecoObject("uncl",o[j].getFourVector());
}
}
// Remove electrons in the ICD
for(size_t i=0; i<o.size(); i++)
if((o[i].getObjectTypeSansSign()=="e"))
{
double e_eta = Math::theta2eta(o[i].getFourVector().theta());
if((abs(e_eta)>1.1)&&
(abs(e_eta)<1.5))
o[i] = QuaeroRecoObject("uncl",o[i].getFourVector());
}
e.setObjects(o);
fs = partitionRule.getFinalState(e).getTextString();
bool disallowedFinalState = false;
if(level>=5)
{
if((fs=="1e+")||(fs=="1e-")||
(fs=="1mu+")||(fs=="1mu-")||
(fs=="1tau+")||(fs=="1tau-")||
(fs=="1ph")||(fs=="1ph1pmiss")||
(fs=="1j1pmiss_sumPt0-400")||(fs=="1j1pmiss_sumPt400+")||
(fs=="1j_sumPt0-400")||(fs=="1j_sumPt400+")
)
disallowedFinalState = true; // cut out "runt" final states
}
if(level>=7)
{
if(eventType!="data")
for(size_t i=0; i<o.size(); i++)
if(o[i].getObjectTypeSansSign()=="e")
if(drand48()<0.01)
o[i] = QuaeroRecoObject(((string)"e")+((o[i].getSign()=="+") ? "-" : "+"),o[i].getFourVector());
}
double ptThreshold0 = 10, ptThreshold01 = 15, ptThreshold1 = 20, ptThreshold12 = 25, ptThreshold2 = 35, ptThreshold3 = 50;
if(level>=6)
{
ptThreshold0 = 17;
ptThreshold01 = 20;
ptThreshold1 = 25;
ptThreshold12 = 30;
ptThreshold2 = 40;
ptThreshold3 = 60;
}
bool passesSingleCentralElectronTrigger = (e.numberOfObjects("e",ptThreshold1,1.0)>=1);
bool passesSinglePlugElectronTrigger = (e.numberOfObjects("e",25,2.5)>=1);
/* bool passesPrescaledSinglePlugElectronTrigger = ((e.numberOfObjects("e",ptThreshold12,2.5)-
e.numberOfObjects("e",ptThreshold12,1.0)>=1)&&
((eventType!="data")||
((rn.length()>1)&&(rn.substr(rn.length()-1)=="0"))) ); */
bool passesDiEmObjectTrigger =
( ( (e.numberOfObjects("e",ptThreshold1,2.5)+
e.numberOfObjects("ph",ptThreshold1,2.5)) >=2 ) &&
( (e.numberOfObjects("e",ptThreshold1+5,2.5)+
e.numberOfObjects("ph",ptThreshold1+5,2.5)) >=1 ) );
/* bool passesPrescaledSingleCentralElectronTrigger =
( (e.numberOfObjects("e",ptThreshold01,1.0)>=1) &&
((eventType!="data")||
((rn.length()>1)&&(rn.substr(rn.length()-1)=="0"))) );
bool passesPrescaledSingleCentralMuonTrigger =
( (e.numberOfObjects("mu",ptThreshold01,1.0)>=1) &&
((eventType!="data")||
((rn.length()>1)&&(rn.substr(rn.length()-1)=="0"))) );
bool passesPrescaledSingleCentralPhotonTrigger =
( (e.numberOfObjects("ph",ptThreshold2,1.0)>=1) &&
((eventType!="data")||
((rn.length()>1)&&(rn.substr(rn.length()-2)=="00"))) ); */
int cem8 = e.numberOfObjects("e",ptThreshold0,1.0);
int cem20 = e.numberOfObjects("e",ptThreshold01,1.0);
int pem8 = e.numberOfObjects("e",ptThreshold1,2.5)-e.numberOfObjects("e",ptThreshold1,1.0);
int muo8 = e.numberOfObjects("mu",ptThreshold0,1.0);
int muo20 = e.numberOfObjects("mu",ptThreshold01,1.0);
int trk8 = e.numberOfObjects("tau",ptThreshold0,1.0);
bool passesDileptonTrigger =
( (cem8>=2) || (muo8>=2) || ((muo8>=1)&&(e.numberOfObjects("mu",ptThreshold0,2.5)>=2)) ||
(cem8 && pem8) || (cem8 && muo8) || (cem20 && trk8) ||
(pem8 && muo8) || (muo20 && trk8) );
bool passesSingleMuonTrigger = false;
for(size_t i=0; i<o.size(); i++)
if((o[i].getObjectTypeSansSign()=="mu")&&
(o[i].getFourVector().perp()>ptThreshold1)&&
(fabs(Math::theta2eta(o[i].getFourVector().theta()))<2.5)&&
(Math::deltaphi(o[i].getFourVector().phi(),-M_PI/2)>0.5))
passesSingleMuonTrigger = true;
// bool passesDiTauTrigger =
// ( (e.numberOfObjects("tau",ptThreshold0,1.0)>=2) );
bool passesSinglePhotonTrigger = (e.numberOfObjects("ph",
(level<=5 ? 55 : 60),
1.0)>=1);
bool passesDiPhotonTrigger = (e.numberOfObjects("ph", ptThreshold1, 2.5)>=2);
bool passesPhotonLeptonTrigger = ( ( (e.numberOfObjects("ph", ptThreshold1, 2.5)>=1) &&
(e.numberOfObjects("e",ptThreshold0,1.0)+
e.numberOfObjects("mu",ptThreshold0,1.0)
// +e.numberOfObjects("tau",ptThreshold1,1.0)
)>=1) );
// bool passesPhotonBTrigger = ( (e.numberOfObjects("ph", ptThreshold2, 1.0)>=1) &&
// (e.numberOfObjects("b", ptThreshold0, 1.0)>=1) );
bool passesCentralLeptonBTrigger = ( ( (e.numberOfObjects("e", ptThreshold1, 1.0)+
e.numberOfObjects("mu", ptThreshold1, 1.0)) >= 1 ) &&
(e.numberOfObjects("b", ptThreshold0, 1.0)>=1) );
// bool passesPlugElectronBTrigger = ( (e.numberOfObjects("e", ptThreshold1, 2.5)>=1) &&
// (e.numberOfObjects("b", ptThreshold1, 1.0)>=1) );
bool passesPlugElectronCentralTauTrigger = ( (e.numberOfObjects("e", ptThreshold2, 2.5)>=1) &&
(e.numberOfObjects("tau", ptThreshold0, 1.0)>=1) );
bool passesSingleJetTrigger = ((e.numberOfObjects("j", (level<=5 ? 150 : 200),1.0)+
e.numberOfObjects("b", (level<=5 ? 150 : 200),1.0))
>=1);
bool passesSinglePlugPhotonTrigger = (e.numberOfObjects("ph", (level<=5 ? 250 : 300),2.5) >= 1 );
// bool passesPlugPhotonBTrigger = ( (e.numberOfObjects("ph", ptThreshold2, 2.5) >= 1) &&
// ( (e.numberOfObjects("b",ptThreshold0,1.0)>=1) ) );
bool passesCentralPhotonTauTrigger = ( (e.numberOfObjects("ph", ptThreshold2, 1.0)>=1) &&
(e.numberOfObjects("tau",ptThreshold2, 1.0)>=1) );
bool passesPlugPhotonTauTrigger = ( (e.numberOfObjects("ph", ptThreshold2, 2.5) >= 1) &&
(e.numberOfObjects("tau",ptThreshold2,1.0)>=1) );
bool passesPhoton_diTau_Trigger = ( (e.numberOfObjects("ph",ptThreshold2,2.5) >= 1) &&
(e.numberOfObjects("tau",ptThreshold0,1.0)>=2) );
bool passesPhoton_diB_Trigger = ( (e.numberOfObjects("ph",ptThreshold2,1.0) >= 1) &&
(e.numberOfObjects("b",ptThreshold1,1.0)>=2) );
bool passesPhoton_tauB_Trigger = ( (e.numberOfObjects("ph",ptThreshold2,2.5) >= 1) &&
(e.numberOfObjects("b",ptThreshold1,1.0)>=1) &&
(e.numberOfObjects("tau",ptThreshold1,1.0)>=1) );
bool passesPrescaledJet25Trigger = ((e.numberOfObjects("j",40,1.0)+
e.numberOfObjects("b",40,1.0) >= 1)&&
(e.getEventType()!="data")&& // labeled as "jet25" instead
(e.getEventType()!="sig")&&
((eventType!="jet25")||(rn.substr(rn.length()-1)=="0"))); // take only every tenth event from jet25
bool passesPrescaledJet25TauTrigger = ((e.numberOfObjects("j",40,1.0)+
e.numberOfObjects("b",40,1.0) >= 1)&&
(e.numberOfObjects("tau",ptThreshold0,1.0)>=1)&&
(e.getEventType()!="data")&& // labeled as "jet25" instead
(e.getEventType()!="sig"));
bool passesPrescaledJet25jetBTrigger = ((e.numberOfObjects("j",ptThreshold3,1.0)>=1)&&
(e.numberOfObjects("b",ptThreshold1,1.0)>=1)&&
(e.getEventType()!="data")&& // labeled as "jet25" instead
(e.getEventType()!="sig"));
bool passesPrescaledJet25BTrigger = ((e.numberOfObjects("b",ptThreshold3,1.0)>=1)&&
(e.getEventType()!="data")&& // labeled as "jet25" instead
(e.getEventType()!="sig"));
bool passesTrigger =
( passesSingleCentralElectronTrigger ||
passesSinglePlugElectronTrigger ||
passesDiEmObjectTrigger ||
passesSingleMuonTrigger ||
passesDileptonTrigger ||
// passesDiTauTrigger ||
passesSinglePhotonTrigger ||
passesSinglePlugPhotonTrigger ||
passesDiPhotonTrigger ||
passesPhotonLeptonTrigger ||
// passesPhotonBTrigger ||
passesCentralLeptonBTrigger ||
// passesPlugElectronBTrigger ||
passesPlugElectronCentralTauTrigger ||
passesSingleJetTrigger ||
passesPrescaledJet25Trigger ||
passesPrescaledJet25TauTrigger ||
passesPrescaledJet25jetBTrigger ||
passesPrescaledJet25BTrigger ||
/*
passesPrescaledSingleCentralElectronTrigger ||
passesPrescaledSingleCentralMuonTrigger ||
passesPrescaledSinglePlugElectronTrigger ||
passesPrescaledSingleCentralPhotonTrigger ||
*/
// passesPlugPhotonBTrigger ||
passesCentralPhotonTauTrigger ||
passesPlugPhotonTauTrigger ||
passesPhoton_diTau_Trigger ||
passesPhoton_diB_Trigger ||
passesPhoton_tauB_Trigger
);
if((e.getEventType()=="sig")&&
(!passesTrigger)&&
(e.numberOfObjects("j",40,1.0)+e.numberOfObjects("b",40,1.0) >= 1))
{
if(level>=10)
wt *= 0.00012; // jet25 prescale
passesTrigger = true;
}
if(level>=5)
if((!passesTrigger)||
(disallowedFinalState))
ans = false;
}
if((collider=="tev2")&&
((experiment=="cdf")))
{
string eventType = e.getEventType();
if( (zvtx==0) &&
( ( (eventType.length()>=6) &&
(eventType.substr(0,6)=="cosmic") ) ||
(eventType=="sig") ) )
{
while((zvtx==0)||(fabs(zvtx)>60))
zvtx = Math::gasdev(0,30.); // units are cm
for(size_t i=0; i<o.size(); i++)
{
double newObjectEta = QuaeroRecoObject::getEventEta("cdf", o[i].getObjectType(),
Math::theta2eta(o[i].getFourVector().theta()), zvtx);
double newObjectPt = o[i].getFourVector().e()*fabs(sin(Math::eta2theta(newObjectEta)));
o[i] =
QuaeroRecoObject(o[i].getObjectType(),
QuaeroRecoObject::setLorentzVectorMPtEtaPhi(o[i].getFourVector().m(),
newObjectPt,
newObjectEta,
o[i].getFourVector().phi()));
}
e.setObjects(o);
}
else
{
if((e.getZVtx()==0)||
(fabs(e.getZVtx())>60))
return(false); // does not contain a legal ZVertex
}
//remove Nj_sumPt400+ events where j2 has pT < 75, because they are regular QCD events that coincide with a cosmic. So, j2 is prompt (and so is j3,j4 etc), j1 is cosmic, and typically j2 pT < 75 GeV.
if(e.sumPt()>=400 &&
e.numberOfObjects("j") >= 2 &&
e.numberOfObjects("b")==0 &&
e.numberOfObjects("e")==0 &&
e.numberOfObjects("mu")==0 &&
e.numberOfObjects("tau")==0 &&
e.numberOfObjects("ph")==0
) {
if(e.getThisObject("j",2)->getFourVector().perp() < 75)
return(false);
}
// Remove suspected cosmic rays
bool failsCosmicCut = false;
// Note events that have a kill object
bool killed = false;
for(size_t i=0; i<o.size(); i++)
if(o[i].getObjectType()=="kill")
killed = true;
// Remove b's and tau's from the plug
if((eventType=="data")||
(eventType=="jet20")||
(eventType=="sig"))
for(size_t i=0; i<o.size(); i++)
if(((o[i].getObjectTypeSansSign()=="b")||
(o[i].getObjectTypeSansSign()=="tau"))&&
//(fabs(QuaeroRecoObject::getDetectorEta("cdf", o[i].getObjectTypeSansSign(), Math::theta2eta(o[i].getFourVector().theta()), e.getZVtx()))>1.0)
(fabs(Math::theta2eta(o[i].getFourVector().theta()))>1.0)
)
o[i] = QuaeroRecoObject("j",o[i].getFourVector());
// Remove taus with |eta|<0.1
// These taus tend to be misreconstructed electrons in our Monte Carlo samples
/*
for(size_t i=0; i<o.size(); i++)
if((o[i].getObjectTypeSansSign()=="tau")&&
(fabs(QuaeroRecoObject::getDetectorEta("cdf", o[i].getObjectTypeSansSign(), Math::theta2eta(o[i].getFourVector().theta()), e.getZVtx()))<0.1))
o[i] = QuaeroRecoObject("j",o[i].getFourVector());
*/
// If this is a mrenna or mad sample, then it was reconstructed with gen5, with different tau id.
// The p(e->tau) rate should be doubled in the Z->ee samples, where one e fakes a tau.
// This modification is motivated by a Vista 1e+1tau-[12]j:mass(e+,tau-) discrepancy.
if(((eventType.length()>=11)&&
(eventType.substr(0,11)=="mrenna_e+e-")) ||
((eventType.length()>=8)&&
(eventType.substr(0,8)=="mad_e+e-")))
{
string electronCharge="";
for(size_t i=0; i<o.size(); i++)
if(o[i].getObjectTypeSansSign()=="e")
if(electronCharge=="")
electronCharge = o[i].getSign();
else
electronCharge="moreThanOneElectron";
if(electronCharge.length()==1)
for(size_t i=0; i<o.size(); i++)
if((o[i].getObjectTypeSansSign()=="tau")&&
(fabs(Math::theta2eta(o[i].getFourVector().theta()))<1.0)&&
(o[i].getFourVector().perp()>partitionRule.getPmin()))
if(o[i].getSign()!=electronCharge) // the tau and electron have opposite charge, hence the tau could have come from the other electron
wt *= 2;
}
// Check if event has an electron and another EM object within deltaR < 0.2
for(size_t i=0; i<o.size(); i++)
if(o[i].getObjectTypeSansSign()=="e")
for(size_t j=i+1; j<o.size(); j++)
if((o[j].getObjectTypeSansSign()=="e")||
(o[j].getObjectTypeSansSign()=="ph"))
if(Math::deltaR(o[i].getFourVector().phi(),
Math::theta2eta(o[i].getFourVector().theta()),
o[j].getFourVector().phi(),
Math::theta2eta(o[j].getFourVector().theta())) < 0.2)
{
o[j] = QuaeroRecoObject("uncl",o[j].getFourVector());
}
if(level>5)
{
// An electron with 1.1<|detEta|<1.2 has dubious charge
string chargeOfWellDeterminedLepton = "";
int iOfDubiousChargeElectron = -1;
for(size_t i=0; i<o.size(); i++)
{
if((o[i].getObjectTypeSansSign()=="mu") // ||(o[i].getObjectTypeSansSign()=="tau")
)
chargeOfWellDeterminedLepton += o[i].getSign();
else if(o[i].getObjectTypeSansSign()=="e")
{
double detEta = QuaeroRecoObject::getDetectorEta("cdf", "e", o[i].getFourVector().pseudoRapidity(), zvtx);
if((fabs(detEta)>1.1)&&(fabs(detEta)<1.2))
iOfDubiousChargeElectron=i;
else
chargeOfWellDeterminedLepton += o[i].getSign();
}
}
if((iOfDubiousChargeElectron>=0)&&
(chargeOfWellDeterminedLepton==o[iOfDubiousChargeElectron].getSign()))
o[iOfDubiousChargeElectron].chargeConjugate();
// Fix sign of plug electrons
string centralElectronIfPresent = "";
for(size_t i=0; i<o.size(); i++)
if((o[i].getObjectTypeSansSign()=="e")&&
(fabs(Math::theta2eta(o[i].getFourVector().theta()))<0.9))
centralElectronIfPresent = o[i].getObjectType();
for(size_t i=0; i<o.size(); i++)
if((o[i].getObjectTypeSansSign()=="e")&&
(fabs(Math::theta2eta(o[i].getFourVector().theta()))>0.9))
if(centralElectronIfPresent==o[i].getObjectType())
o[i].chargeConjugate();
// Two plug electrons with the same sign should have opposite sign
string plugElectronIfPresent = "";
// double pTofHighestPtPlugElectron = 0;
for(size_t i=0; i<o.size(); i++)
if((o[i].getObjectTypeSansSign()=="e")&&
(fabs(Math::theta2eta(o[i].getFourVector().theta()))>0.9))
for(size_t j=i+1; j<o.size(); j++)
if((o[j].getObjectTypeSansSign()=="e")&&
(fabs(Math::theta2eta(o[j].getFourVector().theta()))>0.9)&&
(o[i].getObjectType()==o[j].getObjectType()))
if(o[i].getFourVector().perp()<o[j].getFourVector().perp())
o[i].chargeConjugate();
else
o[j].chargeConjugate();
// Check if event has lepton with deltaR < 0.75 from nearest jet
for(size_t i=0; i<o.size(); i++)
if((o[i].getObjectTypeSansSign()=="e")||
(o[i].getObjectTypeSansSign()=="tau")||
(o[i].getObjectTypeSansSign()=="mu"))
for(size_t j=0; j<o.size(); j++)
if(j!=i)
if(((o[j].getObjectTypeSansSign()=="j")
||(o[j].getObjectTypeSansSign()=="b")
||(o[j].getObjectTypeSansSign()=="tau")
)&&
(o[j].getFourVector().perp()>partitionRule.getPmin())&&
(fabs(Math::theta2eta(o[j].getFourVector().theta()))<2.5))
if(Math::deltaR(o[i].getFourVector().phi(),
Math::theta2eta(o[i].getFourVector().theta()),
o[j].getFourVector().phi(),
Math::theta2eta(o[j].getFourVector().theta())) < 0.75)
return(false); // contains lepton too close to a jet
// Correct for triggerEfficiencies between CMUP and CMX
if((eventType!="data")&&
(eventType!="jet20"))
{
string locationOfSingleTriggerMuon = "";
for(size_t i=0; i<o.size(); i++)
if((o[i].getObjectTypeSansSign()=="e")||
(o[i].getObjectTypeSansSign()=="tau")||
(o[i].getObjectTypeSansSign()=="ph")||
((o[i].getObjectTypeSansSign()=="mu")&&
(locationOfSingleTriggerMuon!="")))
{
locationOfSingleTriggerMuon="thereIsAnotherTriggerObject";
break;
}
else if(o[i].getObjectTypeSansSign()=="mu")
if(fabs(Math::theta2eta(o[i].getFourVector().theta()))<0.6)
locationOfSingleTriggerMuon=="CMUP";
else
locationOfSingleTriggerMuon=="CMX";
if(locationOfSingleTriggerMuon=="CMUP")
wt *= 0.98; // CMUP trigger efficiency is 2% less than "average" muon efficiency
if(locationOfSingleTriggerMuon=="CMX")
wt *= 1.02; // CMX trigger efficiency is 2% higher than "average" muon efficiency
}
// Impose Bayesian interpretation on muon momentum
for(size_t i=0; i<o.size(); i++)
if((o[i].getObjectTypeSansSign()=="mu"))
{
double phat = o[i].getFourVector().perp();
double p = phat;
double sigma = 0.002;
if(p<200) sigma=(phat-60)/140*0.002; // this (and the next line, the if statement) is hack in order to not run into trouble at trigger thresholds
if(sigma>0.001)
p = (-1/phat + sqrt(1/(phat*phat) + 8 * (sigma*sigma)))/(4*(sigma*sigma));
o[i] = QuaeroRecoObject(o[i].getObjectType(),o[i].getFourVector() * (p/phat) );
}
}
// Any object with (|eta| > 2.5) || (pT < 15) is converted to unclustered energy
// Option: change to pT < 10 GeV for investigating low-pT leptons
if(!((hintSpec.collider=="tev2")&&
(hintSpec.experiment=="cdf")&&
(hintSpec.finalState=="lowPtDileptons")))
for(size_t i=0; i<o.size(); i++)
if( (fabs(Math::theta2eta(o[i].getFourVector().theta()))>2.5) ||
(o[i].getFourVector().perp()<15) )
o[i] = QuaeroRecoObject("uncl",o[i].getFourVector());
CLHEP::HepLorentzVector uncl = CLHEP::HepLorentzVector(0,0,0,0);
for(size_t i=o.size()-1; ; i--) {
if(o[i].getObjectType()=="uncl")
{
uncl = uncl + o[i].getFourVector();
o.erase(o.begin()+i);
}
if( i==0 ) break;
}
if(uncl.perp()>0)
o.push_back(QuaeroRecoObject("uncl",uncl));
double highJetPtThreshold = 200; // units are GeV
bool usingChargedTrackJets = false;
if(usingChargedTrackJets)
highJetPtThreshold = 100; // units are GeV
if(level>=5)
{
if((level>=10)&&
((eventType=="sig")||
(usingChargedTrackJets)))
{
// Cluster events passing SingleJetTrigger to a significantly higher scale (say 50 GeV)
double kTscale = 15;
bool lowPtJets = false;
bool highPtJets = false;
if((e.numberOfObjects("j",highJetPtThreshold,1.0)+
e.numberOfObjects("b",highJetPtThreshold,1.0) >= 1)||
(usingChargedTrackJets))
{
kTscale = 50;
highPtJets = true;
}
else if(e.numberOfObjects("e",25,1)+
e.numberOfObjects("mu",25,1)+
e.numberOfObjects("ph",25,2.5)==0)
lowPtJets = true;
if(highPtJets)
{
int k1=0,k2=0;
double minDeltaRjj = 0;
while(minDeltaRjj<0.7)
{
k1=k2=-1;
minDeltaRjj=0.7;
for(size_t i=0; i<o.size(); i++)
if((o[i].getObjectType()=="j") ||
(o[i].getObjectType()=="b"))
for(size_t j=i+1; j<o.size(); j++)
if((o[j].getObjectType()=="j") ||
(o[j].getObjectType()=="b"))
{
double deltaRjj = Math::deltaR(o[i].getFourVector().phi(), Math::theta2eta(o[i].getFourVector().theta()),
o[j].getFourVector().phi(), Math::theta2eta(o[j].getFourVector().theta()));
if(deltaRjj < minDeltaRjj)
{
minDeltaRjj = deltaRjj;
k1=i; k2=j;
}
}
if((k1>=0)&&(k2>=0))
{
o[k1] = QuaeroRecoObject("j",o[k1].getFourVector()+o[k2].getFourVector());
o.erase(o.begin()+k2);
}
}
}
int k1=0,k2=0;
while((k1>=0)&&(k2>=0))
{
k1=k2=-1;
int nj=0;
for(size_t i=0; i<o.size(); i++)
if(o[i].getObjectType()=="j")
nj++;
// Find the highest pt jet
bool noIndex = true;
size_t highestPtJet = 0;
double highestJetPt = 0;
for(size_t i=0; i<o.size(); i++)
if((o[i].getObjectType()=="j")||
(o[i].getObjectType()=="b"))
if(o[i].getFourVector().perp()>highestJetPt)
{
highestJetPt = o[i].getFourVector().perp();
highestPtJet = i;
noIndex = false;
}
double m_cut = (((nj>4)&&(!lowPtJets)) ? FLT_MAX : kTscale);
double mij_min = m_cut;
for(size_t i=0; i<o.size(); i++)
if( noIndex || i!=highestPtJet)
if((o[i].getObjectType()=="j") ||
(o[i].getObjectType()=="b") ||
(o[i].getObjectTypeSansSign()=="tau"))
for(size_t j=i+1; j<o.size(); j++)
if( noIndex || j!=highestPtJet)
if((o[j].getObjectType()=="j") ||
(o[j].getObjectType()=="b") ||
(o[i].getObjectTypeSansSign()=="tau"))
{
double mij = (o[i].getFourVector()+o[j].getFourVector()).m();
if(mij < mij_min)
{
mij_min = mij;
k1=i; k2=j;
}
}
if((k1>=0)&&(k2>=0))
{
o[k1] = QuaeroRecoObject("j",o[k1].getFourVector()+o[k2].getFourVector());
o.erase(o.begin()+k2);
}
}
}
}
// Flag events that contain a plug objects that has been counted twice: as both a photon and an electron
// This is a reconstruction screw-up
{
int iph = -1;
for(size_t i=0; i<o.size(); i++)
if(o[i].getObjectType()=="ph")
if(iph==-1)
iph = i;
else
iph = -2;
if(iph>=0)
{
CLHEP::HepLorentzVector ph = o[iph].getFourVector();
bool killThePhoton = false;
for(size_t i=0; i<o.size(); i++)
if(o[i].getObjectTypeSansSign()=="e")
{
CLHEP::HepLorentzVector ele = o[i].getFourVector();
if(((fabs(Math::theta2eta(ele.theta()))>1)||
(fabs(Math::theta2eta(ph.theta()))>1))&&
(Math::deltaR(ele.phi(),ele.theta(),
ph.phi(),ph.theta())<1.8)&&
((fabs(ele.e()-ph.e())<5)||
((fabs(ele.e()-ph.e())<10)&&
(fabs(max(fabs(Math::theta2eta(ele.theta())),
fabs(Math::theta2eta(ph.theta())))-1.2)<0.1))))
killThePhoton = true;
}
if(killThePhoton)
{
//o.erase(o.begin()+iph);
o[iph] = QuaeroRecoObject("uncl",o[iph].getFourVector());
}
}
}
e.setObjects(o);
e.reVertex(zvtx);
fs = partitionRule.getFinalState(e).getTextString();
string rn = e.getRunNumber();
string::size_type pos = rn.find (".",0); // find the dot
string runNumberString = rn.substr(0,pos); // keep only the run number string.
// int runNumber = atoi(runNumberString.c_str());
if(level>=5)
{
bool disallowedFinalState = false;
if((fs=="1j_sumPt0-400")||
(fs=="1j1pmiss_sumPt0-400")||
(fs=="1b_sumPt0-400")||
(fs=="1b1pmiss_sumPt0-400")||
(fs=="1b_sumPt400+"))
disallowedFinalState = true; // cut out low-pt 1j and 1j1pmiss final states
if((fs=="1e+")||(fs=="1e-")||
(fs=="1mu+")||(fs=="1mu-"))
disallowedFinalState = true; // cut out 1e and 1mu final states
if((fs=="1tau+")||(fs=="1tau-")||
(fs=="1pmiss1tau+")||(fs=="1pmiss1tau-"))
disallowedFinalState = true; // cut out 1tau final states
if((fs=="1ph"))
disallowedFinalState = true; // cut out 1ph final state
if((fs=="1pmiss"))
disallowedFinalState = true; // cut out 1pmiss final state
if(disallowedFinalState)
return(false);
/* The CDF silicon detector was not as efficient at identifying bottom quarks early in Run II.
The jet20 trigger had a lower prescale early in Run II.
The sumPt0-400 final states with identified bottom quarks thus need to have reduced SM prediction. */
if((e.getEventType()!="data")&&
(e.getEventType()!="jet20")&&
((fs=="1b1j_sumPt0-400")||
(fs=="1b2j_sumPt0-400")||
(fs=="1b3j_sumPt0-400")||
(fs=="1b4j_sumPt0-400")||
// In early runs we did not have as good b-tagging *nor* as good phoenix electron id,
// so we take a hit for this in the first ~150 pb^-1
((e.numberOfObjects("e",15,2.5)-
e.numberOfObjects("e",15,1.0)>=1)&&
(e.numberOfObjects("b",15,1.0)>=1))
))
wt *= 0.98;
}
bool jet20DuplicateEvent = false;
if(e.getEventType()=="jet20")
{
if(rn=="179056.3633137")
jet20DuplicateEvent = true;
}
double ptThreshold0 = 10, ptThreshold01 = 15, ptThreshold1 = 20, ptThreshold12 = 25, ptThreshold2 = 35, ptThreshold3 = 50, ptThreshold4 = 75;
if(level>=6)
{
ptThreshold0 = 17;
ptThreshold01 = 20;
ptThreshold1 = 25;
ptThreshold12 = 30;
ptThreshold2 = 40;
ptThreshold3 = 60;
ptThreshold4 = 90;
}
bool passesTrigger = false;
if((e.numberOfObjects("e")>=1))
{
if(
( (e.numberOfObjects("e",ptThreshold1,1.0)>=1)
// &&((eventType!="data")||((rn.length()>1)&&(rn.substr(rn.length()-1)=="0")))
) || // passesSingleCentralElectron25Trigger
(e.numberOfObjects("e",ptThreshold2,1.0)>=1) || // passesSingleCentralElectron40Trigger
( (e.numberOfObjects("e",ptThreshold1,1.0)>=1) &&
(e.getPmiss().perp()>ptThreshold0) &&
(e.numberOfObjects("j",ptThreshold0,2.5)+
e.numberOfObjects("b",ptThreshold0,1.0)>=2) ) || // passesSingleCentralElectronWjetsTrigger
( (e.numberOfObjects("e",ptThreshold2,2.5)>=1) // passesSinglePlugElectron40Trigger
// && ((eventType!="data")||((rn.length()>1)&&(rn.substr(rn.length()-1)=="0")))
) ||
(e.numberOfObjects("e",ptThreshold3,2.5)>=1) || // passesSinglePlugElectron60Trigger
( (e.numberOfObjects("e",ptThreshold2,2.5)>=1) &&
(e.getPmiss().perp()>ptThreshold0) &&
(e.numberOfObjects("j",ptThreshold0,2.5)+
e.numberOfObjects("b",ptThreshold0,1.0)>=2) ) || // passesSinglePlugElectronWjetsTrigger
/*
((e.numberOfObjects("e",ptThreshold12,2.5)-
e.numberOfObjects("e",ptThreshold12,1.0)>=1)&&
((eventType!="data")||
((rn.length()>1)&&(rn.substr(rn.length()-1)=="0"))) ) || // passesDoublyPrescaledSinglePlugElectronTrigger
*/
( ( (e.numberOfObjects("e",ptThreshold1,2.5)+
e.numberOfObjects("ph",ptThreshold1,2.5)) >=2 ) &&
( e.numberOfObjects("e",ptThreshold1,2.5) >= 1 ) ) || // passesDiEmObjectTrigger with electron
( (e.numberOfObjects("e",ptThreshold01,1.0)>=1)
&& ((eventType!="data")||((rn.length()>2)&&(rn.substr(rn.length()-2)=="00")))
) || // passesDoublyPrescaledSingleCentralElectron20Trigger
( (e.numberOfObjects("ph", ptThreshold1, 2.5)>=1) &&
(e.numberOfObjects("e",ptThreshold1,1.0)>=1) ) || // passesCentralElectronPlusPhotonTrigger
( (e.numberOfObjects("e", ptThreshold1, 1.0)>=1) &&
(e.numberOfObjects("b", ptThreshold0, 1.0)>=1) ) || // passesCentralElectronBTrigger
/*
( (e.numberOfObjects("e", ptThreshold1, 2.5)>=1) &&
(e.numberOfObjects("b", ptThreshold1, 1.0)>=1) ) || // passesPlugElectronBTrigger
*/
( (e.numberOfObjects("e", ptThreshold2, 2.5)>=1) &&
(e.numberOfObjects("tau", ptThreshold0, 1.0)>=1) ) // passesPlugElectronCentralTauTrigger
)
passesTrigger = true;
}
if((!passesTrigger)&&(e.numberOfObjects("mu")>=1))
{
if(
(e.numberOfObjects("mu",ptThreshold2,1.0)>=1) || // passesSingleCentralMuon40Trigger
( (e.numberOfObjects("mu",ptThreshold1,1.0)>=1)
// && ((eventType!="data")||((rn.length()>1)&&(rn.substr(rn.length()-1)=="0")))
) || // passesSingleCentralMuon25Trigger
( (e.numberOfObjects("mu",ptThreshold01,1.0)>=1)
&& ((eventType!="data")||((rn.length()>2)&&(rn.substr(rn.length()-2)=="00")))
) || // passesDoublyPrescaledSingleCentralMuon20Trigger
( (e.numberOfObjects("mu",ptThreshold1,1.0)>=1) &&
(e.getPmiss().perp()>ptThreshold0) &&
(e.numberOfObjects("j",ptThreshold0,2.5)+
e.numberOfObjects("b",ptThreshold0,1.0)>=2) ) || // passesSingleCentralMuonWjetsTrigger
( (e.numberOfObjects("ph", ptThreshold1, 2.5)>=1) &&
(e.numberOfObjects("mu",ptThreshold0,1.0)>=1) ) || // passesMuonPhotonTrigger
( (e.numberOfObjects("mu", ptThreshold1, 1.0)>=1) &&
(e.numberOfObjects("b", ptThreshold0, 1.0)>=1) ) // passesCentralMuonBTrigger
)
passesTrigger = true;
}
if((!passesTrigger)&&(e.numberOfObjects("tau")>=1))
{
if(e.numberOfObjects("tau",ptThreshold1,1.0)>=2) // passesDiTauTrigger
{
int numberOfTausInCentralDetector=0;
for(size_t j=0; j<o.size(); j++)
if((o[j].getObjectTypeSansSign()=="tau")&&
(fabs(QuaeroRecoObject::getDetectorEta("cdf", "tau", Math::theta2eta(o[j].getFourVector().theta()), e.getZVtx()))<1))
numberOfTausInCentralDetector++;
if(numberOfTausInCentralDetector>=2) // need to have two taus with |detEta|<1, in addition to |eta|<1.
passesTrigger=true;
}
if(
( (e.numberOfObjects("ph", ptThreshold2, 1.0)>=1) &&
(e.numberOfObjects("tau",ptThreshold2, 1.0)>=1) ) || // passesCentralPhotonTauTrigger
( (e.numberOfObjects("ph", ptThreshold2, 2.5) >= 1) &&
(e.numberOfObjects("tau",ptThreshold2,1.0)>=1) ) || // passesPlugPhotonTauTrigger
( (e.numberOfObjects("ph",ptThreshold2,2.5) >= 1) &&
(e.numberOfObjects("tau",ptThreshold0,1.0)>=2) ) || // passesPhoton_diTau_Trigger
( (e.numberOfObjects("ph",ptThreshold2,2.5) >= 1) &&
(e.numberOfObjects("b",ptThreshold1,1.0)>=1) &&
(e.numberOfObjects("tau",ptThreshold1,1.0)>=1) ) // passesTauPhotonBTrigger
)
passesTrigger = true;
}
if((!passesTrigger)&&(e.numberOfObjects("ph", ptThreshold1)>=1))
{
if(
//( (e.numberOfObjects("ph",ptThreshold1,1.0)>=1) &&
// ((eventType!="data")|| // passesPrescaledSingleCentralPhotonTrigger
// ((rn.length()>1)&&(rn.substr(rn.length()-2)=="00"))) ) || // We use this trigger to allow us to get a good handle of j->ph fakes between 25 and 60 GeV
(e.numberOfObjects("ph",(level<=5 ? 55 : 60),1.0)>=1) || // passesSinglePhotonTrigger
( (e.numberOfObjects("ph", ptThreshold1, 2.5)>=2) &&
(e.numberOfObjects("ph", ptThreshold1, 1.0)>=1) ) || // passesDiPhotonTrigger
/*
( (e.numberOfObjects("ph", ptThreshold2, 1.0)>=1) &&
(e.numberOfObjects("b", ptThreshold0, 1.0)>=1) ) || // passesPhotonBTrigger
*/
(e.numberOfObjects("ph", (level<=5 ? 250 : 300),2.5) >= 1 ) || // passesSinglePlugPhotonTrigger
/*
( (e.numberOfObjects("ph", ptThreshold2, 2.5) >= 1) &&
(e.numberOfObjects("b",ptThreshold0,1.0)>=1) ) || // passesPlugPhotonBTrigger
*/
( (e.numberOfObjects("ph",ptThreshold2,1.0) >= 1) &&
(e.numberOfObjects("b",ptThreshold1,1.0)>=2) ) // passesPhoton_diB_Trigger
)
passesTrigger = true;
}
if((!passesTrigger)&&(e.numberOfObjects("b", ptThreshold2, 1.0)>=2))
{
if(
/*
( (e.numberOfObjects("b", ptThreshold4, 1.0)>=2) ) || // passesDiBjetTrigger
*/
( (e.numberOfObjects("b", ptThreshold3, 1.0)>=3) &&
(e.numberOfObjects("b", ptThreshold4, 1.0)>=1) ) // passesTriBjetTrigger
)
passesTrigger = true;
}
if((!passesTrigger))
{
if(
((e.numberOfObjects("j", (level<=5 ? 150 : highJetPtThreshold),1.0)+
e.numberOfObjects("b", (level<=5 ? 150 : highJetPtThreshold),1.0))>=1) || // passesSingleJetTrigger
((e.numberOfObjects("j",40,1.0)+e.numberOfObjects("b",40,1.0) >= 1)&&
(eventType!="data")&& // labeled as "jet20" instead
(eventType!="sig")&&
((eventType!="jet20")||(rn.substr(rn.length()-1)=="0")) // take only every tenth event from jet20
) || // passesPrescaledJet20Trigger
((e.numberOfObjects("j",40,1.0)+e.numberOfObjects("b",40,1.0) >= 1)&&
(e.numberOfObjects("tau",ptThreshold0,1.0)>=1)&&
(eventType!="data")&& // labeled as "jet20" instead
(eventType!="sig")) || // passesPrescaledJet20TauTrigger
((e.numberOfObjects("j",ptThreshold3,1.0)>=1)&&
(e.numberOfObjects("b",ptThreshold1,1.0)>=1)&&
(eventType!="data")&& // labeled as "jet20" instead
(eventType!="sig")) || // passesPrescaledJet20jetBTrigger
((e.numberOfObjects("b",ptThreshold3,1.0)>=1)&&
(eventType!="data")&& // labeled as "jet20" instead
(eventType!="sig")) // passesPrescaledJet20BTrigger
)
passesTrigger = true;
}
if(!passesTrigger)
{
int cem8 = e.numberOfObjects("e",ptThreshold0,1.0);
int cem20 = e.numberOfObjects("e",ptThreshold01,1.0);
int pem8 = e.numberOfObjects("e",ptThreshold1,2.5)-e.numberOfObjects("e",ptThreshold1,1.0);
int muo8 = e.numberOfObjects("mu",ptThreshold0,1.0);
int muo20 = e.numberOfObjects("mu",ptThreshold01,1.0);
int trk8 = e.numberOfObjects("tau",ptThreshold0,1.0);
bool passesDileptonTrigger =
( // (cem8>=2) ||
(muo8>=2) ||
((muo8>=1)&&(e.numberOfObjects("mu",ptThreshold0,2.5)>=2)) ||
// (cem8 && pem8) ||
(cem8 && muo8) ||
(cem20 && trk8) ||
(pem8 && muo8) ||
(muo20 && trk8) ||
((hintSpec.collider=="tev2")&&
(hintSpec.experiment=="cdf")&&
(hintSpec.finalState=="lowPtDileptons")&&
(((e.numberOfObjects("mu",4,0.6)>=1)&&
(e.numberOfObjects("mu",4,1.0)>=2))||
(e.numberOfObjects("e",4,1.0)>=2)))
);
if(passesDileptonTrigger)
passesTrigger = true;
}
if((eventType=="sig")&&
(!passesTrigger)&&
(e.numberOfObjects("j",40,1.0)+e.numberOfObjects("b",40,1.0) >= 1))
{
if(level>=10)
wt *= 0.00012; // jet20 prescale
passesTrigger = true;
}
// Cosmic processes cannot produce b jets
bool thisIsAnUnintendedUseOfThisGeneratedProcess = false;
if( ( ( (eventType.length()>=6) &&
(eventType.substr(0,6)=="cosmic") ) ) )
for(size_t i=0; i<o.size(); i++)
if(o[i].getObjectType()=="b")
thisIsAnUnintendedUseOfThisGeneratedProcess = true;
if( ( (eventType=="mrenna_e+e-")||
(eventType=="mrenna_e+e-j")||
(eventType=="mad_e+e-") ) &&
(fs=="1b1e+") )
thisIsAnUnintendedUseOfThisGeneratedProcess = true;
// Our reconstruction can reconstruct a mrenna_e+e- Monte Carlo event as containing an electron and a jet.
// Our misReconstruction can than call that jet a tau by applying p(j->tau).
// In the data, this does not happen.
// This contribution to our background estimate in the 1e1tauX final states must therefore be removed.
if( ( (eventType=="mrenna_e+e-")||
(eventType=="mrenna_e+e-j")||
(eventType=="mad_e+e-") ) &&
((fs=="1e+1tau+") ||
(fs=="1e+1tau-"))
)
thisIsAnUnintendedUseOfThisGeneratedProcess = true;
// Pythia W->lnu should not fake 1l1pmiss1tau+.
// This should be handled by MadEvent W->lnu (+1 or more reconstructed jets)
if( ( (eventType=="sewkad")|| // Pythia W->enu
(eventType=="wewk7m")|| // Pythia W->munu
(eventType=="wexo0m")||
(eventType=="we0s8m") ) &&
( ( (fs.find("1e")!=string::npos) ||
(fs.find("1mu")!=string::npos) ) &&
(fs.find("1tau")!=string::npos) ) )
thisIsAnUnintendedUseOfThisGeneratedProcess = true;
// zx0sd[em] should not be used for m(ll)>20 GeV
if( (eventType=="zx0sde") && // Pythia Z->ee, m>10 GeV
( (e.numberOfObjects("e+")==0) ||
(e.numberOfObjects("e-")==0) ||
( (e.getThisObject("e+")->getFourVector()+e.getThisObject("e-")->getFourVector()).m() > 20) // units are GeV
) )
thisIsAnUnintendedUseOfThisGeneratedProcess = true;
if( (eventType=="zx0sdm") && // Pythia Z->mumu, m>10 GeV
( (e.numberOfObjects("mu+")==0) ||
(e.numberOfObjects("mu-")==0) ||
( (e.getThisObject("mu+")->getFourVector()+e.getThisObject("mu-")->getFourVector()).m() > 20) // units are GeV
) )
thisIsAnUnintendedUseOfThisGeneratedProcess = true;
if(level>=5)
if(
(!passesTrigger) ||
failsCosmicCut ||
thisIsAnUnintendedUseOfThisGeneratedProcess ||
jet20DuplicateEvent ||
killed
) {
ans = false;
if (debug)
cout << " Refined out because " <<
"[(!passesTrigger)||failsCosmicCut||thisIsAnUnintendedUseOfThisGeneratedProcess||jet20DuplicateEvent||killed]=[" <<
(!passesTrigger) <<"||"<<
failsCosmicCut <<"||"<<
thisIsAnUnintendedUseOfThisGeneratedProcess <<"||"<<
jet20DuplicateEvent <<"||"<<
killed << "]" << endl;
}
}
/*************************************************
Cleanup
**************************************************/
e.reWeight(wt);
e.setObjects(o);
e.reVertex(zvtx);
/*************************************************
Hint
**************************************************/
if(hintSpec.active==true)
{
if(collider!=hintSpec.collider)
ans = false;
if(experiment!=hintSpec.experiment)
ans = false;
if(fs!=hintSpec.finalState)
{
if(((hintSpec.finalState=="1bb1w")||
(hintSpec.finalState=="1bb1w+")||
(hintSpec.finalState=="1bb1w-"))&&
((fs=="1b1e+1j1pmiss")||
(fs=="1b1j1mu+1pmiss")
))
; // okay
if((fs.length()>hintSpec.finalState.length())&&
(hintSpec.finalState==fs.substr(0,hintSpec.finalState.length()))&&
(fs.substr(hintSpec.finalState.length(),6)=="_sumPt"))
; // okay
else
ans = false; // not okay
}
if(e.sumPt()<hintSpec.sumPtCut)
ans = false;
}
return(ans);
}
void Refine::setMinWt(double _minWt)
{
assert(_minWt>=0);
minWt = _minWt;
return;
}
bool Refine::passesMinWt(QuaeroEvent& e, double& runningWeight)
{
bool passesSpecialCriteria = false;
if((collider=="tev2")&&
(experiment=="cdf"))
passesSpecialCriteria = passesSpecialSleuthCriteriaQ(e);
double minWt1 = minWt;
if(passesSpecialCriteria)
minWt1 = minWt/10;
if(e.getWeight()>=minWt1)
return(true);
else
{
runningWeight += e.getWeight();
if(((int)(runningWeight/minWt1)) > ((int)((runningWeight-e.getWeight())/minWt1)))
{
runningWeight -= minWt1;
e.reWeight(minWt1);
return(true);
}
}
return(false);
}
bool Refine::passesSpecialSleuthCriteriaQ(const QuaeroEvent& e)
{
bool passesSpecialCriteria = false;
if((e.numberOfObjects("e",15,2.5)+
e.numberOfObjects("mu",15,2.5) >= 1) &&
(e.numberOfObjects("j",15,2.5)+
e.numberOfObjects("b",15,2.5) >=4 ))
passesSpecialCriteria = true; // top lepton + jets
if((e.numberOfObjects("e",15,2.5)+
e.numberOfObjects("mu",15,2.5) >= 2) &&
(e.numberOfObjects("j",15,2.5)+
e.numberOfObjects("b",15,2.5) >=2 ))
passesSpecialCriteria = true; // top dilepton
if((e.numberOfObjects("e",15,2.5) >= 1) &&
(e.numberOfObjects("mu",15,2.5) >= 1))
passesSpecialCriteria = true; // 1e1muX
if((e.numberOfObjects("e",20,2.5) >= 1) &&
(e.numberOfObjects("tau",20,2.5) >= 1))
passesSpecialCriteria = true; // 1e1tauX
if((e.numberOfObjects("tau",15,2.5) >= 1)&&
(e.numberOfObjects("j",17,2.5) >= 2)&&
(e.sumPt()>400))
passesSpecialCriteria = true; // 1jj1tau
if((e.numberOfObjects("tau",15,2.5) >= 1)&&
(e.sumPt()>400))
passesSpecialCriteria = true; // 1pmiss1tau
if((e.numberOfObjects("e",15,2.5)+
e.numberOfObjects("mu",15,2.5)>=1)&&
(e.numberOfObjects("ph",15,2.5)>=1)&&
(e.numberOfObjects("j",15,2.5)>=3)&&
(e.getPmiss().perp()>12) &&
(e.sumPt() > 200))
passesSpecialCriteria = true; // 1e+2jj1ph1pmiss
if((e.numberOfObjects("e",15,2.5)+
e.numberOfObjects("mu",15,2.5)>=2)&&
(e.numberOfObjects("b",15,1.0)>=1)&&
(e.numberOfObjects("j",15,2.5)>=1)&&
(e.getPmiss().perp()>12) &&
(e.sumPt() > 200))
passesSpecialCriteria = true; // 1e+1e-1bb1pmiss
if((e.numberOfObjects("b",200,2.5)>=1)&&
(e.getPmiss().perp()>50) &&
(e.sumPt() > 700))
passesSpecialCriteria = true; // 1bb1pmiss
if((e.numberOfObjects("j",15,2.5)>=4)&&
(e.getPmiss().perp()>50) &&
(e.sumPt() > 800))
passesSpecialCriteria = true; // 1bb1pmiss
if((e.numberOfObjects("e",15,2.5)+
e.numberOfObjects("mu",15,2.5)>=1)&&
(e.numberOfObjects("ph",15,2.5)>=2)&&
(e.getPmiss().perp()>12))
passesSpecialCriteria = true; // 1e+2ph1pmiss
if(e.numberOfObjects("e+",15,2.5)+
e.numberOfObjects("mu+",15,2.5)>=2)
passesSpecialCriteria = true; // 2e+X
if((e.numberOfObjects("e",15,2.5)+
e.numberOfObjects("mu",15,2.5)>=3))
passesSpecialCriteria = true; // trilepton
return(passesSpecialCriteria);
}
| [
"mrenna@fnal.gov"
] | mrenna@fnal.gov |
b6c378f30012bc381709b779fe11cf79bf0a6f10 | 9a1fe44fa09ed0f2205d1bd5c86feddb73c48dc2 | /renderarea.cpp | b8fa62f55a0824d81220d94e1c3aeaf952488669 | [
"MIT"
] | permissive | vtpp2014/rrt-simulator | ac8efa63cd79d93bbeece2ba101ea7f0b8600118 | fc90183802374fb12fe10f974eb757da14e645d3 | refs/heads/master | 2021-01-19T22:28:55.197026 | 2017-03-26T07:44:58 | 2017-03-26T07:44:58 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,010 | cpp | #include "renderarea.h"
#include <queue>
#include <QTimer>
RenderArea::RenderArea(QWidget *parent) : QWidget(parent)
{
setAttribute(Qt::WA_StaticContents);
scribbling = false;
rrt = new RRT;
}
/**
* @brief Draw the world.
* @param painter
*/
void RenderArea::drawField(QPainter &painter)
{
painter.save();
painter.setRenderHint(QPainter::Antialiasing);
QRect field;
field.setTopLeft(QPoint(this->x(), this->y()));
field.setBottomRight(QPoint(this->width()-1, this->height()-1));
painter.setPen(Qt::black);
painter.setBrush(QBrush(Qt::green));
painter.drawRect(field);
painter.restore();
}
/**
* @brief Draw the start position of the bot.
* @param painter
*/
void RenderArea::drawStartPos(QPainter &painter)
{
painter.save();
painter.setRenderHint(QPainter::Antialiasing);
painter.setPen(Qt::black);
painter.setBrush(QBrush(Qt::red));
painter.drawEllipse(this->x() + START_POS_X - BOT_RADIUS, this->y() + START_POS_Y - BOT_RADIUS, 2 * BOT_RADIUS, 2 * BOT_RADIUS);
painter.restore();
}
/**
* @brief Draw the end point.
* @param painter
*/
void RenderArea::drawEndPos(QPainter &painter)
{
painter.save();
painter.setRenderHint(QPainter::Antialiasing);
painter.setPen(Qt::black);
painter.setBrush(QBrush(Qt::blue));
painter.drawEllipse(END_POS_X - BOT_RADIUS, END_POS_Y - BOT_RADIUS, 2 * BOT_RADIUS, 2 * BOT_RADIUS);
painter.restore();
}
/**
* @brief Draw all the rectangular obstacles.
* @param painter
*/
void RenderArea::drawObstacles(QPainter &painter)
{
painter.save();
painter.setRenderHint(QPainter::Antialiasing);
painter.setPen(Qt::black);
painter.setBrush(QBrush(Qt::black));
pair<Vector2f, Vector2f> obstacle;
for(int i = 0; i < (int)rrt->obstacles->obstacles.size(); i++) {
obstacle = rrt->obstacles->obstacles[i];
QPoint topLeft(obstacle.first.x(), obstacle.first.y());
QPoint bottomRight(obstacle.second.x(), obstacle.second.y());
QRect rect(topLeft, bottomRight);
painter.drawRect(rect);
}
painter.restore();
}
/**
* @brief Draw all the nodes generated in the RRT algorithm.
* @param painter
*/
void RenderArea::drawNodes(QPainter &painter)
{
painter.save();
painter.setRenderHint(QPainter::Antialiasing);
painter.setPen(Qt::black);
painter.setBrush(QBrush(Qt::black));
Vector2f pos;
for(int i = 0; i < (int)rrt->nodes.size(); i++) {
for(int j = 0; j < (int)rrt->nodes[i]->children.size(); j++) {
pos = rrt->nodes[i]->children[j]->position;
painter.drawEllipse(pos.x()-1.5, pos.y()-1.5, 3, 3);
}
pos = rrt->nodes[i]->position;
painter.drawEllipse(pos.x() - NODE_RADIUS, pos.y() - NODE_RADIUS, 2 * NODE_RADIUS, 2 * NODE_RADIUS);
}
painter.setPen(Qt::red);
painter.setBrush(QBrush(Qt::red));
// if a path exists, draw it.
for(int i = 0; i < (int)rrt->path.size() - 1; i++) {
QPointF p1(rrt->path[i]->position.x(), rrt->path[i]->position.y());
QPointF p2(rrt->path[i+1]->position.x(), rrt->path[i+1]->position.y());
painter.drawLine(p1, p2);
}
painter.restore();
}
void RenderArea::paintEvent(QPaintEvent *)
{
QPainter painter(this);
drawField(painter);
drawStartPos(painter);
drawEndPos(painter);
drawObstacles(painter);
drawNodes(painter);
emit painting();
}
void RenderArea::mousePressEvent(QMouseEvent *event)
{
if (event->button() == Qt::LeftButton) {
lastMouseClickedPoint = event->pos();
scribbling = true;
}
}
void RenderArea::mouseMoveEvent(QMouseEvent *event)
{
}
void RenderArea::mouseReleaseEvent(QMouseEvent *event)
{
if (event->button() == Qt::LeftButton && scribbling) {
QPoint curPoint = event->pos();
rrt->obstacles->addObstacle(Vector2f(lastMouseClickedPoint.x(), lastMouseClickedPoint.y()), Vector2f(curPoint.x(), curPoint.y()));
update();
scribbling = false;
}
}
| [
"ragnarok0211@gmail.com"
] | ragnarok0211@gmail.com |
2e6d924db741b8a5c591d86576e86e4200845031 | 3b467e2e3dd0c5d3d9a9c8dda44ec7ec9b2e9b8b | /Practicas arboles/Practica 1/ejercicio6.cpp | b45bd1a123d4e595652a4d8ac0e68bb4ecd5a87f | [
"MIT"
] | permissive | moooises/Estructuras-de-Datos-no-Lineales | 4f3850fca315d02b1bbb764099d2661b4cea28f6 | c060f6500e707e594a31cf4029bd6884eb070ef5 | refs/heads/master | 2020-06-12T00:24:53.763208 | 2019-06-27T17:42:26 | 2019-06-27T17:42:26 | 194,135,026 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,349 | cpp | #include <iostream>
#include <fstream>
#include <cmath>
#include <algorithm>
#include "abin_E-S.h"
#include "abin.h"
using namespace std;
typedef char tElto;
const tElto fin='#';
template <typename T>
int desequilibrio(const Abin<T>& A,typename Abin<T>::nodo n){
if(n==Abin<T>::NODO_NULO)return 0;
else{
int des=abs(A.alturaB(A.hijoDrchoB(n))-A.alturaB(A.hijoIzqdoB(n)));// Esto es para dejarlo mas claro
return max(max(desequilibrio(A,A.hijoDrchoB(n)),desequilibrio(A,A.hijoIzqdoB(n))),des);
}
}
/**
Esta forma tb vale, pero es mas correcta y eficiente la de arriba
template <typename T>
int desequilibrio(Abin<T>& A,typename Abin<T>::nodo n,int maxi){
if(n!=Abin<T>::NODO_NULO){
int aux=abs(A.alturaB(A.hijoDrchoB(n))-A.alturaB(A.hijoIzqdoB(n)));
if(aux>maxi)maxi=aux;
return max(desequilibrio(A,A.hijoDrchoB(n),maxi),desequilibrio(A,A.hijoIzqdoB(n),maxi));
}
else{
return maxi;
}
}
*/
template <typename T>
int desequilibriorec(const Abin<T>& A, typename Abin<T>::nodo n){
return desequilibrio(A,A.raizB());
}
int main(){
Abin<tElto> A;
ifstream fe("abin.dat");
rellenarAbin(fe,A);
fe.close();
cout << "\n*** Mostrar árbol binario***\n";
imprimirAbin(A);
cout<<"El maximo desequilibrio del arbol es "<<desequilibriorec(A,A.raizB());
}
| [
"noreply@github.com"
] | moooises.noreply@github.com |
69195555c3b403abfa801ba143d82229a9c3d031 | 38e04d83cab701a60729d6b909714075aec21867 | /03_day/ex02/FragTrap.cpp | c4c4e81d177eee658f978651236269649c149164 | [] | no_license | 2ndcouteau/Piscine-Cpp | 38bd61159fe5803ae67465b0e7174597f9e65ce1 | 9219612a0ef037dfcaf8dac0bc0634a6681213dc | refs/heads/master | 2020-04-22T11:43:39.955278 | 2019-02-12T18:02:47 | 2019-02-12T18:02:47 | 170,350,999 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,226 | cpp | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* FragTrap.cpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: qrosa <qrosa@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/01/11 09:53:57 by qrosa #+# #+# */
/* Updated: 2019/01/11 21:05:58 by qrosa ### ########.fr */
/* */
/* ************************************************************************** */
#include "FragTrap.hpp"
// CONSTRUTORS / DESTRUCTORS
FragTrap::FragTrap(void)
{
std::cout << " FragTrap Default Constructor " << std::endl;
}
FragTrap::FragTrap(std::string name) :
ClapTrap(name, 100, 100, 100, 100, 1, 30, 20, 5, 25)
{
std::cout << " FragTrap Default Constructor : Hellooo, VaultHunter, and thank you for answering Hyperion's summons! " << std::endl;
return;
}
FragTrap::FragTrap(FragTrap const &src)
{
std::cout << " FragTrap Copy Constructor " << std::endl;
*this = src;
return;
}
FragTrap::~FragTrap(void)
{
std::cout << " FragTrap Destructor : Save Me! Save Me! Oops too late, I'm DEAD. TT" << std::endl;
return;
}
void FragTrap::vaulthunter_dot_exe(std::string const & target)
{
std::string attacks[5] = {
"Brra, Dildo in your face !",
"Brrr Brrr Brrr Kalash Kalash!",
"Toi et Moi, Octogone, pas d'arbitre...",
"I am gonna Clap Clap Clap your Ass Ass Ass !",
"MegaPunchOfTheDeath !"
};
if (this->_energy_points < this->_energy_cost_attack)
std::cout << "Not enough energy point to attack." << std::endl;
else
{
this->_energy_points -= this->_energy_cost_attack;
std::cout << "Valhunter's attack on " << target << ": \"" << attacks[std::rand() % 5] << "\"" << std::endl;
}
}
FragTrap& FragTrap::operator=(FragTrap const & rhs)
{
ClapTrap::operator=(rhs);
return(*this);
}
| [
"qrosa@e2r4p15.42.fr"
] | qrosa@e2r4p15.42.fr |
9ec5bc43e8bd499e50c5d5def012d35e95772856 | 6a8ffbac8a94c65f5a8e10ec62c6740c8837d952 | /CombinedMethod.h | 55bf26c8281096cbd11ccce5b4e9aec071fd8358 | [] | no_license | gsabbih6/CFD_Practise | 228ba7e5dda8f4b051d0461e2dd91ec3d534f31c | bd3c6874828c9c898305706149630b9f311394bc | refs/heads/master | 2023-05-15T10:54:48.018904 | 2021-06-01T06:14:37 | 2021-06-01T06:14:37 | 314,637,886 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,570 | h | //
// Created by Admin on 11/5/20.
//
#ifndef HW2_CFD_COMBINEDMETHOD_H
#define HW2_CFD_COMBINEDMETHOD_H
#include <iostream>
#include <vector>
using namespace std;
class CombinedMethod {
public:
double simpleExplicit(double current, double prev,
double next, double CFL);
void crankNickolson(vector<vector<double> > &matrix, int Mdim, int Ndim,
// double arow, double brow, double crow,
vector<double> rmatrix);
double rmsd(vector<double> residualTemp);
double exact(double initTemp, double currT, double alpha, double space, double time);
vector<vector<double>> computeCrankNicholson(vector<vector<double>> grid, double CFL);
vector<vector<double>> computeSimpleExplicit(vector<vector<double>> grid, double CFL);
vector<vector<double>> computeExact(vector<vector<double>> grid,
double alpha, double deltaX, double deltaT);
void myplot(int totalLength = 1, double deltaX = 0.05, int maxT = 3, double alpha = 0.1);
void crankNickPlot(double timestep = 0.05, double totalLength = 1.0,
double deltaX = 0.05, double maxT = 3, double alpha = 0.1);
void
simpleExplicPlot(double CFL = 0.45, double totalLength = 1, double deltaX = 0.05, double maxT = 3, double alpha = 0.1);
vector<vector<double>> initialize(vector<vector<double>> grid, double solStepSize, double deltaX);
double getTimeStep(double CLF, double deltaX, double alpha);
};
#endif //HW2_CFD_COMBINEDMETHOD_H
| [
"gsabbih5@gmail.comm"
] | gsabbih5@gmail.comm |
82adaab37cdb95119a07a4c194628cf1ea18ff61 | 86a47af04be052b5b8c6d6f6c8c72d7290b8d6f3 | /include/stats1d.h | d336aa692aa804d74fe0cf04fb0f40117e3cd8d0 | [] | no_license | PeteBlackerThe3rd/gncTK | 182c0eaa792a89a90a77d9aada3576caadb01117 | a368e04718195e675d4bf5bc456c517ed49ec10f | refs/heads/master | 2020-11-26T12:57:55.652878 | 2019-12-19T15:02:10 | 2019-12-19T15:02:10 | 229,077,713 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,980 | h | #ifndef GNCTK_STATS1D_H_
#define GNCTK_STATS1D_H_
/*-----------------------------------------------------------\\
|| ||
|| LIDAR fusion GNC project ||
|| ---------------------------- ||
|| ||
|| Surrey Space Centre - STAR lab ||
|| (c) Surrey University 2017 ||
|| Pete dot Blacker at Gmail dot com ||
|| ||
\\-----------------------------------------------------------//
stats1d.h
one dimensional statistical summary storage object
---------------------------------------------------
This object stores the statistical summary of a set of
one dimensional continuous values. Including the Naive mean,
min, max, standard deviation, min_inlier, max_inlier and a
histogram of densities.
-------------------------------------------------------------*/
#include <string>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <cv_bridge/cv_bridge.h>
namespace gncTK
{
class Stats1D;
};
class gncTK::Stats1D
{
public:
Stats1D(std::vector<double> values, int histogramBinCount = 20, float inlierThreshold = 3);
// return a string list with basic stat header for CSV writing
static std::vector<std::string> csvGetBasicHeaders();
// return a string list with basic stats for CSV writing
std::vector<std::string> csvGetBasic();
// return a string list with all stats for CSV writing
std::vector<std::string> csvGetAll();
// return a cv::Mat with the statistics and histogram displayed
cv::Mat getStatsImage();
double mean;
double min,max;
double meanInlier, minInlier, maxInlier;
double stdDev;
unsigned int n;
std::vector<double> histogramBins;
std::vector<int> histogramTotals;
};
#endif /* GNCTK_STATS_1D_H_ */
| [
"P.Blacker@surrey.ac.uk"
] | P.Blacker@surrey.ac.uk |
ceab6f16b33633b0a177ea173e1e68a15e230e3a | a54fe0243eece943c2609df64819e736bff85937 | /src/auvsi16/misc/non-ros/auvsi_comm_protocol/main.cpp | 4416f3626c19f5316cf5d6688d7dad571ef1533c | [] | no_license | krishnayoga/auvsi16 | eb9b5827b4254abdd2e1ccfbff2a9333ac7857d4 | d4b609eb334190840542a1aa20c9c9e1ee9e1383 | refs/heads/master | 2022-07-10T23:56:35.465918 | 2017-04-14T05:47:06 | 2017-04-14T05:47:06 | 88,235,120 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 629 | cpp | #include "include/auvsicommunication.hpp"
#define MAX_BUFFER 3000
using namespace std;
int main(int argc , char *argv[])
{
string hostname = "127.0.0.1";
int port_number = 80;
auvsiCommunication auvsi_protocol(hostname, port_number, "courseA", "rooster.php");
auvsi_protocol.setPayloadCommunication(heartbeat, "20111995", "bomb", -123.231234,412.21234);
cout << auvsi_protocol.getPayload();
while (1)
cout << auvsi_protocol.sendTCP();
return 0;
}
/*
* PHP Test File - json_test.php
<?php
$request_body = file_get_contents('php://input');
var_dump(json_decode($request_body, true));
?>
*/
| [
"ida.bagus52@ui.ac.id"
] | ida.bagus52@ui.ac.id |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.