blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 4 201 | content_id stringlengths 40 40 | detected_licenses listlengths 0 85 | license_type stringclasses 2
values | repo_name stringlengths 7 100 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringclasses 260
values | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 11.4k 681M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 17
values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 80
values | src_encoding stringclasses 28
values | language stringclasses 1
value | is_vendor bool 1
class | is_generated bool 2
classes | length_bytes int64 8 9.86M | extension stringclasses 52
values | content stringlengths 8 9.86M | authors listlengths 1 1 | author stringlengths 0 119 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2ae96ad706bc6fe28f1d81600bc21976fbb2867d | c58b721fef4913f6000cc4f37284a20ad2bfd4a7 | /Section11_Functions/FunctionOverloading/main.cpp | 7a23d5edc1aa649bd36791b9168d6be167453889 | [] | no_license | TylerBrown380/cPlusPlusPractice | f5a1d29d92a8ed28ce91bc8cdba86ca8a9b092b8 | 33106e4641f3035a4be91360097b98c2db839841 | refs/heads/master | 2023-03-04T20:00:32.249570 | 2021-02-16T16:48:58 | 2021-02-16T16:48:58 | 335,035,504 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 891 | cpp | #include <iostream>
#include <string>
#include <vector>
using namespace std;
void print(int);
void print(double);
void print(string);
void print(string, string);
void print(vector<string>);
void print(int num) {
cout << "Printing int: " << num << endl;
}
void print(double num) {
cout << "Printing double: " << num << endl;
}
void print(string val) {
cout << "Printing string: " << val << endl;
}
void print(string val, string val2) {
cout << "Printing string1: " << val << endl;
cout << "Printing string2: " << val2 << endl;
}
void print(vector<string> str) {
for(auto v: str) {
cout << v << " ";
}
cout << "\n" << endl;
}
int main() {
print(1);
print(5.8);
print(123.3F);
print("C-style string");
string s {"C++ string"};
print("C-style string", s);
vector<string> v{"hi", "test", "value"};
print(v);
return 0;
}
| [
"Tylerbrown380@u.boisestate.edu"
] | Tylerbrown380@u.boisestate.edu |
d0829a718589f6ea362960bf6fc0a975fd05602a | 278fdd5782ba35057b2855c53658846c4aeea9de | /4thDemo/potato.cpp | 12ef9f460d2099106baa7548885a75e4746824bd | [] | no_license | liuyueweiyu/AppProjectHomework | 33b9d0b623dd9e6546e6462a4df7932e0d2f929b | 527f59e29bdf3c43c00c00aa128b094be6b0e8f4 | refs/heads/master | 2020-03-31T05:17:25.125647 | 2019-01-04T10:53:07 | 2019-01-04T10:53:07 | 151,940,304 | 0 | 2 | null | null | null | null | WINDOWS-1252 | C++ | false | false | 4,897 | cpp | #include "stdafx.h"
#include <iostream>
using namespace std;
#include "./gdal/gdal_priv.h"
#pragma comment(lib,"gdal_i.lib")
const int N = 300;
GDALDataset* poSrcpotato;
GDALDataset* poDstDS;
GByte* buffTmpPotato[6];
char* potato = "potato.jpg";
char* dstPath[7] = {"dist1.tif", "dist2.tif", "dist3.tif", "dist4.tif", "dist5.tif", "dist6.tif"};
double ma[N][N];
double mar[10][10][10];
int len[6];
/// ·½ÏòÏòÁ¿
int xx[30] = {-2, -2, -2, -2, -2, -1, -1, 0, -1, -1, -1, 0, 0, 0, 1, 1, 1, 0, 1, 1, 2, 2, 2, 2, 2};
int yy[30] = {-2, -1, 0, 1, 2, -2, 2, -2, -1, 0, 1, -1, 0, 1, -1, 0, 1, 2, -2, 2, -2, -1, 0, 1, 2};
int imgXlen;
int imgYlen;
int bandNum;
int li1, li2, li3;
void Ini()
{
len[0] = len[2] = len[3] = len[4] = 3;
len[1] = 5;
len[5] = 5;
mar[0][0][0] = 0; mar[0][0][1] = 0.2; mar[0][0][2] = 0;
mar[0][1][0] = 0.2; mar[0][1][1] = 0.2; mar[0][1][2] = 0.2;
mar[0][2][0] = 0; mar[0][2][1] = 0.2; mar[0][2][2] = 0;
mar[1][0][0] = 0.2; mar[1][0][1] = 0; mar[1][0][2] = 0; mar[1][0][3] = 0; mar[1][0][4] = 0;
mar[1][1][0] = 0; mar[1][1][1] = 0.2; mar[1][1][2] = 0; mar[1][1][3] = 0; mar[1][1][4] = 0;
mar[1][2][0] = 0; mar[1][2][1] = 0; mar[1][2][2] = 0.2; mar[1][2][3] = 0; mar[1][2][4] = 0;
mar[1][3][0] = 0; mar[1][3][1] = 0; mar[1][3][2] = 0; mar[1][3][3] = 0.2; mar[1][3][4] = 0;
mar[1][4][0] = 0; mar[1][4][1] = 0; mar[1][4][2] = 0; mar[1][4][3] = 0; mar[1][4][4] = 0.2;
mar[2][0][0] = -1; mar[2][0][1] = -1; mar[2][0][2] = -1;
mar[2][1][0] = -1; mar[2][1][1] = 8; mar[2][1][2] = -1;
mar[2][2][0] = -1; mar[2][2][1] = -1; mar[2][2][2] = -1;
mar[3][0][0] = -1; mar[3][0][1] = -1; mar[3][0][2] = -1;
mar[3][1][0] = -1; mar[3][1][1] = 9; mar[3][1][2] = -1;
mar[3][2][0] = -1; mar[3][2][1] = -1; mar[3][2][2] = -1;
mar[4][0][0] = -1; mar[4][0][1] = -1; mar[4][0][2] = 0;
mar[4][1][0] = -1; mar[4][1][1] = 0; mar[4][1][2] = 1;
mar[4][2][0] = 0; mar[4][2][1] = 1; mar[4][2][2] = 1;
mar[5][0][0] = 0.0120 / 25; mar[5][0][1] = 0.1253 / 25; mar[5][0][2] = 0.2736 / 25; mar[5][0][3] = 0.1253 / 25; mar[5][0][4] = 0.0120 / 25;
mar[5][1][0] = 0.1253 / 25; mar[5][1][1] = 1.3054 / 25; mar[5][1][2] = 2.8514 / 25; mar[5][1][3] = 1.3054 / 25; mar[5][1][4] = 0.1253 / 25;
mar[5][2][0] = 0.2376 / 25; mar[5][2][1] = 2.8514 / 25; mar[5][2][2] = 6.2279 / 25; mar[5][2][3] = 2.8514 / 25; mar[5][2][4] = 0.2376 / 25;
mar[5][3][0] = 0.1253 / 25; mar[5][3][1] = 1.3054 / 25; mar[5][3][2] = 2.8514 / 25; mar[5][3][3] = 1.3054 / 25; mar[5][3][4] = 0.1253 / 25;
mar[5][4][0] = 0.0120 / 25; mar[5][4][1] = 0.1253 / 25; mar[5][4][2] = 0.2736 / 25; mar[5][4][3] = 0.1253 / 25; mar[5][4][4] = 0.0120 / 25;
}
int main()
{
Ini();
GDALAllRegister();
poSrcpotato = (GDALDataset*)GDALOpenShared(potato, GA_ReadOnly);
imgXlen = poSrcpotato -> GetRasterXSize();
imgYlen = poSrcpotato -> GetRasterYSize();
bandNum = poSrcpotato -> GetRasterCount();
for(int i = 0; i < 6; i ++){
buffTmpPotato[i] = (GByte*)CPLMalloc(imgXlen*imgYlen * sizeof(GByte));
for(int j = 1; j <= 3; j ++){
poSrcpotato -> GetRasterBand(j) -> RasterIO(GF_Read, 0, 0, imgXlen, imgYlen, buffTmpPotato[i], imgXlen, imgYlen, GDT_Byte, 0, 0);
}
}
for(int i = 0; i < imgXlen; i ++){
for(int j = 0; j < imgXlen; j ++){
// printf("%f\n", (double)buffTmpPotato[j * imgXlen + i]);
ma[i][j] = (double)buffTmpPotato[0][j * imgXlen + i];
}
}
for(int ncase = 0; ncase < 6; ncase ++){
poDstDS = GetGDALDriverManager() -> GetDriverByName("GTiff") -> Create(dstPath[ncase], imgXlen, imgYlen, bandNum, GDT_Byte, NULL);
for(int i = 1; i <= bandNum; i ++){
// poDstDS -> GetRasterBand(i) -> RasterIO(GF_Write, 0, 0, imgXlen, imgYlen, buffTmpPotato[ncase], imgXlen, imgYlen, GDT_Byte, 0, 0);
}
li1 = imgXlen - len[ncase] / 2;
li2 = imgYlen - len[ncase] / 2;
li3 = (len[ncase] * len[ncase] - 1) / 2;
// printf("%d %d %d\n", li1, li2, li3);
for(int i = len[ncase] / 2; i < li1; i ++){
for(int j = len[ncase] / 2; j < li2; j ++){
double t;
t = 0;
for(int k = -li3; k <= li3; k ++){
// printf("%d %d\n", xx[12 + k], yy[12 + k]);
// int x; scanf("%d", &x);
t += (double)ma[i + xx[12 + k]][j + yy[12 + k]] * mar[ncase][len[ncase] / 2 + xx[12 + k]][len[ncase] / 2 + yy[12 + k]];
}
if(t > 255){
buffTmpPotato[ncase][j * imgXlen + i] = (GByte)255;
}
else if(t < 0){
buffTmpPotato[ncase][j * imgXlen + i] = (GByte)0;
}
else{
buffTmpPotato[ncase][j * imgXlen + i] = (GByte)t;
}
}
}
for (int i = 1; i <= bandNum; i ++) {
poDstDS -> GetRasterBand(i) -> RasterIO(GF_Write, 0, 0, imgXlen, imgYlen, buffTmpPotato[ncase], imgXlen, imgYlen, GDT_Byte, 0, 0);
}
CPLFree(buffTmpPotato[ncase]);
GDALClose(poDstDS);
}
system("pause");
return 0;
}
| [
"noreply@github.com"
] | noreply@github.com |
1aa9b5c44dffe44226115d6973efadd832d3da41 | c510fb068ea3c29ed6fc6c82182d9c2b7944eaa1 | /Knight.h | 09ab327e780452bbc27874f7b05717b85571ef2b | [] | no_license | davidberiro/cpp_chess_game | 0bad8a59a0c65574fdc74b645f99d6f27d2bf257 | ed28667c474303ac2cf51dba292fa6c6a9076d47 | refs/heads/master | 2021-01-11T21:06:57.709272 | 2017-01-19T15:45:50 | 2017-01-19T15:45:50 | 79,247,981 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 495 | h | //
// Created by davidberiro on 1/17/17.
//
#include "Piece.h"
#ifndef EX2_KNIGHT_H
#define EX2_KNIGHT_H
class Knight : public Piece
{
public:
Knight(const char file, const int rank, std::string color);
virtual std::vector<Coordinate> getLegalMovesOnEmptyBoard(Piece *board[]) override ;
// virtual std::string getPieceCode();
// virtual std::string getPieceType();
virtual ~Knight() override;
//private:
// std::string pieceCode = "\u265E";
};
#endif //EX2_KNIGHT_H | [
"david.benchimol@mail.huji.ac.il"
] | david.benchimol@mail.huji.ac.il |
5b6ef092fd39d16a70b6713cb53503292a643674 | 829b3f2d0ae685d01fe097c03bf5c1976cbc4723 | /deps/boost/include/boost/spirit/home/support/detail/what_function.hpp | a1d85718c3939b86bfbaf383e039b63b07b86eef | [
"Apache-2.0"
] | permissive | liyoung1992/mediasoup-sfu-cpp | f0f0321f8974beb1f4263c9e658402620d82385f | b76564e068626b0d675f5486e56da3d69151e287 | refs/heads/main | 2023-08-21T21:40:51.710022 | 2021-10-14T06:29:18 | 2021-10-14T06:29:18 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,554 | hpp | /*=============================================================================
Copyright (c) 2001-2011 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef BOOST_SPIRIT_SUPPORT_DETAIL_WHAT_FUNCTION_HPP
#define BOOST_SPIRIT_SUPPORT_DETAIL_WHAT_FUNCTION_HPP
#if defined(_MSC_VER)
#pragma once
#endif
#include <string>
#include <boost/spirit/home/support/info.hpp>
#include <boost/detail/workaround.hpp>
namespace boost { namespace spirit { namespace detail
{
template <typename Context>
struct what_function
{
what_function(info& what_, Context& context_)
: what(what_), context(context_)
{
what.value = std::list<info>();
}
template <typename Component>
void operator()(Component const& component) const
{
#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1600))
component; // suppresses warning: C4100: 'component' : unreferenced formal parameter
#endif
boost::get<std::list<info> >(what.value).
push_back(component.what(context));
}
info& what;
Context& context;
// silence MSVC warning C4512: assignment operator could not be generated
BOOST_DELETED_FUNCTION(what_function& operator= (what_function const&))
};
}}}
#endif
| [
"yanhua133@126.com"
] | yanhua133@126.com |
f36cfb39efb76782ebf8d3cde8c085fbb896c493 | 328ddf0987a66abf0d23cba45fe5b56969912ed4 | /Proyecto Final/PABLO_JACOBO_ESTADISTICA5.cpp | 09f514931927a41ec64ad5373804e85d5d7298c1 | [] | no_license | p-jacobo2012240/Solo-por-Diversion | 43bb333f773146e147c642751736080678cd1439 | 5a86b970ee4641f03bf7a154e60ce55add5e3798 | refs/heads/master | 2021-06-24T11:57:22.373397 | 2019-06-04T04:36:02 | 2019-06-04T04:36:02 | 144,332,979 | 6 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,151 | cpp | #include <iostream>
using namespace std;
float estadistica(){
const float MEDIA = 30;
const int OPS = 4;
const int OPS1 = 8;
int edad[10000];
int limiteArray[30];
float res1, res2, op, ot;
int result;
int sum;
cout<<"Carnet --> 9490-18-1319"<<endl;
cout<<"Nombre --> Pablo Daniel Jacobo Sanchez"<<endl;
cout<<"Seccion --> D"<<endl;
cout<<""<<endl;
for(int i=0; i<=29; i ++ ){
cout<<"N0: "<<i<<" "<<"Ingrese la edad : \t";
cin>>edad[i];
}
//Media
for(int i = 0; i<=30 ; i ++){
sum += edad[i];
}
//Mediana
for(int o = 0; o<=29; o ++ ){
limiteArray[o] = edad[14];
res1 = limiteArray[o];
limiteArray[o] = edad[15];
res2 = limiteArray[o];
op = res1 / res2;
}
//Moda
for(int o = 0; o<=29; o ++ ){
limiteArray[o] = edad[OPS];
res1 = limiteArray[o];
limiteArray[o] = edad[OPS1];
res2 = limiteArray[o];
ot = res1 / res2;
}
cout<<"La Media es: "<<sum / MEDIA <<endl;
cout<<"La Mediana es: "<<op<<endl;
cout<<"La Moda es "<<ot<<endl;
system("pause");
}
void procedimiento_op(){
estadistica();
}
int main(){
procedimiento_op();
}
| [
"pablojacobo1998@gmail.com"
] | pablojacobo1998@gmail.com |
869597e798b2fadda42127d51fe11fb6c99d1c28 | 1d001b1ddbf760a5eb2c33c15739c48b66ab264a | /PocketDungeon/src/OtterEngine/Music/SoundManager.cpp | 2dd96fa46c9c98e9cee70422167e9f80e9deccc6 | [] | no_license | TallineauHugo/Epitech_projects_TEK3 | b0e93f93dd3ec87ba09afbb74ca1fbe04fcfe227 | 4d9defd8c0d2ce6aab8bb2297a7800538afd69d3 | refs/heads/master | 2022-12-05T10:10:39.581211 | 2020-08-27T22:27:18 | 2020-08-27T22:27:18 | 290,886,179 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 869 | cpp | #include "SoundManager.hpp"
SoundManager::SoundManager()
{
}
SoundManager::~SoundManager()
{
}
bool SoundManager::addSound(const std::string &filename)
{
_sounds.insert(_sounds.begin(), new sf::Music);
if (!_sounds[0]->openFromFile(filename))
return false;
_sounds[0]->play();
return true;
}
void SoundManager::refresh()
{
for (std::size_t i = 0; i < _sounds.size(); i++) {
if (_sounds[i]->getStatus() == sf::SoundSource::Status::Stopped) {
_sounds.erase(_sounds.begin()+i);
i--;
}
}
}
void SoundManager::pauseSounds()
{
for (std::size_t i = 0; i < _sounds.size(); i++) {
_sounds[i]->pause();
}
}
void SoundManager::resumeSounds()
{
for (std::size_t i = 0; i < _sounds.size(); i++) {
_sounds[i]->play();
}
}
void SoundManager::stopSounds()
{
while (_sounds.size() > 0) {
_sounds[0]->stop();
_sounds.erase(_sounds.begin());
}
}
| [
"hugo.tallineau@epitech.eu"
] | hugo.tallineau@epitech.eu |
344bf0e7ba4a89f0dc7eaeb18c9c27384400db4a | 7bfba906555507e66c15ec720b51188fcae529f7 | /WOE/GLVector.cpp | ce05774133226ac16b2434f8324c3a4af637ba9e | [
"MIT"
] | permissive | WhoBrokeTheBuild/Water-and-Oil-Engine | 4e3193bc11f72235962cec41d03a57b513388d64 | aaaed0664a394dd1f670524832b5ca3ec065512e | refs/heads/master | 2021-01-10T20:00:57.713726 | 2014-04-24T08:52:54 | 2014-04-24T08:52:54 | 18,625,783 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 412 | cpp | #include "GLVector.h"
#if defined(_WOE_OPENGL)
GLVec2 GLVec2::ZERO = GLVec2(0.0f);
GLVec2 GLVec2::ONE = GLVec2(1.0f);
GLVec2 GLVec2::NEG_ONE = GLVec2(-1.0f);
GLVec3 GLVec3::ZERO = GLVec3(0.0f);
GLVec3 GLVec3::ONE = GLVec3(1.0f);
GLVec3 GLVec3::NEG_ONE = GLVec3(-1.0f);
GLVec4 GLVec4::ZERO = GLVec4(0.0f);
GLVec4 GLVec4::ONE = GLVec4(1.0f);
GLVec4 GLVec4::NEG_ONE = GLVec4(-1.0f);
#endif // _WOE_OPENGL | [
"sdl.slane@gmail.com"
] | sdl.slane@gmail.com |
ebe576397cc29900fdcf36c324dff5f4a8da7d2e | 25b52864d1de026b090663d130b63e00acb0560f | /ChemistryLib/PhreeqcKernelData/CreateInitialAqueousSolution.h | 167a2a6408c41b44e571b46bd12a036eea786068 | [
"BSD-2-Clause",
"BSD-3-Clause"
] | permissive | kosakowski/OGS6-MP-LT-Drum | f6365f7e38e89c0cffcc8a2d9d848cba1dd5fa31 | 01d8ef8839e5dbe50d09621393cb137d278eeb7e | refs/heads/drum_LT_balance_rebase | 2022-12-19T21:19:52.010498 | 2019-12-10T09:35:28 | 2019-12-10T09:35:28 | 299,912,976 | 1 | 0 | NOASSERTION | 2020-09-30T12:53:14 | 2020-09-30T12:33:38 | null | UTF-8 | C++ | false | false | 707 | h | /**
* \file
* \copyright
* Copyright (c) 2012-2019, OpenGeoSys Community (http://www.opengeosys.org)
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
* http://www.opengeosys.org/project/license
*
*/
#pragma once
#include <string>
#include <vector>
namespace BaseLib
{
class ConfigTree;
}
namespace ChemistryLib
{
namespace PhreeqcKernelData
{
class InitialAqueousSolution;
InitialAqueousSolution createInitialAqueousSolution(
BaseLib::ConfigTree const& config,
std::vector<std::pair<int, std::string>> const&
process_id_to_component_name_map);
} // namespace PhreeqcKernelData
} // namespace ChemistryLib
| [
"renchao.lu@gmail.com"
] | renchao.lu@gmail.com |
91052c7bb2a0344e9ffdb1d635affd7a4dfed630 | 291ff781fc82f33c1300b838eb4c58944dface62 | /2020/week1/14503_robot.cpp | 01566ee810f68474bcf96c55ecffa3e6d149f270 | [] | no_license | catch4/Song | d63b5fd1690b527071b31dd33f98bc0443451031 | 3101552e7fe8b72e2384bf3143c11d00061d771a | refs/heads/master | 2023-04-17T05:40:38.590707 | 2021-05-05T12:32:20 | 2021-05-05T12:32:20 | 268,486,625 | 0 | 0 | null | null | null | null | UHC | C++ | false | false | 1,217 | cpp | /*
Catch study 1주차
백준_14503 로봇청소기
https://www.acmicpc.net/problem/14503
*/
#include <iostream>
#include <vector>
int main() {
int n, m,d,n_d,y,x,cnt=1,rot_cnt=0;
// 북동남서
int dy[4] = { -1,0,1,0 }, dx[4] = { 0,1,0,-1 };
std::cin >> n >> m>>y>>x>>d;
std::vector<std::vector<int>> ck(n, std::vector<int>(m,0));
for (int i = 0; i < n; i++)
for (int j = 0; j < m; j++)
std::cin >> ck[i][j];
ck[y][x] = 2;
while (1)
{
// 4번 회전 한 경우
if (rot_cnt == 4)
{
int n_d = (d + 2) % 4;
int n_y = y + dy[n_d], n_x = x + dx[n_d];
// 뒤에 벽이거나 막힌 경우 while문 탈출
if (n_y < 0 || n_y >= n || n_x < 0 || n_x >= m || ck[n_y][n_x] == 1) break;
y = n_y;
x = n_x;
rot_cnt = 0;
continue;
}
// 왼쪽 방향
if (!d) d = 3;
else d -= 1;
int n_y = y + dy[d], n_x = x + dx[d];
// 왼쪽이 청소 불가능한 경우
if (n_y < 0 || n_y >= n || n_x < 0 || n_x >= m || ck[n_y][n_x])
rot_cnt++;
else // 왼쪽이 청소 가능한 경우
{
rot_cnt = 0;
ck[n_y][n_x] = 2;
cnt++;
y = n_y;
x = n_x;
}
}
std::cout << cnt;
return 0;
}
| [
"thdalsrl10@gmail.com"
] | thdalsrl10@gmail.com |
de5b3793a6d98b4ecc9af1615e7109f554743b29 | 5d7f6d3b3f3f24a81d823c075980a9bf71ac2c51 | /cocos/editor-support/cocostudio/WidgetReader/PageViewReader/PageViewReader.h | beef6870a366d80c25aa2151c1ed2636f33ed671 | [] | no_license | u0u0/Cocos2d-Lua-Community | bf6a96c5ccbc06725303d5cfa6c04fa21ae8f98d | 1549d24cb63dbad6a2d0a8ac455a5bb50ca7314f | refs/heads/master | 2023-08-22T01:45:59.023807 | 2023-08-10T02:40:25 | 2023-08-10T02:40:25 | 227,271,518 | 194 | 71 | null | 2023-06-28T12:30:42 | 2019-12-11T03:49:02 | C++ | UTF-8 | C++ | false | false | 2,639 | h | /****************************************************************************
Copyright (c) 2014 cocos2d-x.org
Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd.
http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#ifndef __TestCpp__PageViewReader__
#define __TestCpp__PageViewReader__
#include "editor-support/cocostudio/WidgetReader/LayoutReader/LayoutReader.h"
#include "editor-support/cocostudio/CocosStudioExport.h"
namespace cocostudio
{
class CC_STUDIO_DLL PageViewReader : public LayoutReader
{
DECLARE_CLASS_NODE_READER_INFO
public:
PageViewReader();
virtual ~PageViewReader();
static PageViewReader* getInstance();
static void destroyInstance();
virtual void setPropsFromJsonDictionary(cocos2d::ui::Widget* widget, const rapidjson::Value& options);
virtual void setPropsFromBinary(cocos2d::ui::Widget* widget, CocoLoader* cocoLoader, stExpCocoNode* cocoNode) ;
flatbuffers::Offset<flatbuffers::Table> createOptionsWithFlatBuffers(const tinyxml2::XMLElement* objectData,
flatbuffers::FlatBufferBuilder* builder);
void setPropsWithFlatBuffers(cocos2d::Node* node, const flatbuffers::Table* pageViewOptions);
cocos2d::Node* createNodeWithFlatBuffers(const flatbuffers::Table* pageViewOptions);
int getResourceType(std::string key);
};
}
#endif /* defined(__TestCpp__PageViewReader__) */
| [
"hello@tyrantek.com"
] | hello@tyrantek.com |
5ac098aa2bab2520717c6bd48049b33a0c1d1dcb | 8947812c9c0be1f0bb6c30d1bb225d4d6aafb488 | /04_Sample/BeatBean/Source/Common.h | 23badff157823e369d7bba9510d07e4751c893f7 | [
"MIT"
] | permissive | alissastanderwick/OpenKODE-Framework | cbb298974e7464d736a21b760c22721281b9c7ec | d4382d781da7f488a0e7667362a89e8e389468dd | refs/heads/master | 2021-10-25T01:33:37.821493 | 2016-07-12T01:29:35 | 2016-07-12T01:29:35 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,957 | h | /* --------------------------------------------------------------------------
*
* File Common.h
*
* Ported By Young-Hwan Mun
* Contact xmsoft77@gmail.com
*
* Created By t2cn on 2009/10/10
*
* --------------------------------------------------------------------------
*
* Copyright (c) 2010-2013 XMSoft. All rights reserved.
*
* --------------------------------------------------------------------------
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library in the file COPYING.LIB;
* if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
* -------------------------------------------------------------------------- */
#ifndef __Common_h__
#define __Common_h__
enum BubbleType
{
NoType = 0xFFF00000,
BlueType = 0xFFF10000,
GreenType = 0xFFF20000,
RedType = 0xFFF30000,
OrangeType = 0xFFF40000,
PurpleType = 0xFFF50000,
};
class Common
{
public :
static Common* sharedCommon ( KDvoid );
protected :
KDvoid init ( KDvoid );
public :
KDvoid playOverSound ( KDvoid );
KDvoid playRightSound ( KDvoid );
KDvoid playWrongSound ( KDvoid );
KDvoid setPlay ( KDbool bPlay );
public :
KDbool m_bIsPlay;
};
#endif // __Common_h__
| [
"mcodegeeks@gmail.com"
] | mcodegeeks@gmail.com |
dba52252c5ad33e3d9bd21372cafad29486d26c6 | b9a754d09984634d2f88e91241c47583d8ce1b15 | /src/Diagnostic/DiagnosticRadiationSpectrum.cpp | 29c404eb78497e37c117242f851a9c4d5c97ce19 | [] | no_license | iouatu/mySmilei | 9aa97d3fb1f9e5ddf477e4bc4eff22d7667b8f8f | 41c2496d21ac03d0dd9b9d8ec41d60cdbf13bf1b | refs/heads/main | 2023-07-23T01:42:48.705778 | 2021-08-18T18:13:01 | 2021-08-18T18:13:01 | 397,676,095 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 7,502 | cpp | #include "PyTools.h"
#include <iomanip>
#include "DiagnosticRadiationSpectrum.h"
#include "HistogramFactory.h"
#include "RadiationTools.h"
#include "RadiationTables.h"
using namespace std;
// Constructor
DiagnosticRadiationSpectrum::DiagnosticRadiationSpectrum(
Params ¶ms,
SmileiMPI *smpi,
Patch *patch,
RadiationTables *radiation_tables_,
int diagId
) : DiagnosticParticleBinningBase( params, smpi, patch, diagId, "RadiationSpectrum", false, PyUnicode_FromString( "" ), excludedAxes() )
{
ostringstream name( "" );
name << "DiagRadiationSpectrum #" << diagId;
string errorPrefix = name.str();
// Check that reference_angular_frequency_SI is correctly defined
if (params.reference_angular_frequency_SI<=0.) {
ERROR("DiagRadiationSpectrum requires 'reference_angular_frequency_SI' to be defined.");
}
// minimum chi beyond which the radiation spectrum is computed (uses minimum_chi_continuous)
minimum_chi_continuous_ = radiation_tables_->getMinimumChiContinuous();
// Normalization parameters
two_third = 2./3.;
double squared_fine_structure_constant = 5.325135447834466e-5;
double normalized_classical_electron_time = 9.399637140638142e-24*params.reference_angular_frequency_SI;
double factor = two_third*squared_fine_structure_constant/normalized_classical_electron_time;
factor *= sqrt(3.)/2./M_PI;
// Histogram axes that should not be allowed
vector<string> excluded_axes( 0 );
excluded_axes.push_back( "a" );
excluded_axes.push_back( "b" );
excluded_axes.push_back( "theta" );
excluded_axes.push_back( "phi" );
// Get the "photon energy axis"
PyObject* photon_energy_axis = PyTools::extract_py( "photon_energy_axis", "DiagRadiationSpectrum", diagId );
ostringstream t("");
t << errorPrefix << "photon_energy_axis : ";
photon_axis = HistogramFactory::createAxis( photon_energy_axis, params, species, patch, excluded_axes, t.str(), false );
total_axes++;
dims.push_back( photon_axis->nbins );
// construct the list of photon_energies
photon_energies.resize( photon_axis->nbins );
delta_energies.resize( photon_axis->nbins );
double emin = photon_axis->actual_min;
double emax = photon_axis->actual_max;
double spacing = (emax-emin) / photon_axis->nbins;
for( int i=0; i<photon_axis->nbins; i++ ) {
photon_energies[i] = emin + (i+0.5)*spacing;
if( photon_axis->logscale ) {
photon_energies[i] = pow(10., photon_energies[i]);
delta_energies[i] = pow(10., emin+i*spacing) * ( pow(10., spacing) - 1. );
} else {
delta_energies[i] = spacing;
}
delta_energies[i] *= factor;
}
// Calculate the size of the output array
uint64_t total_size = (uint64_t)output_size * photon_axis->nbins;
if( total_size > 2147483648 ) { // 2^31
ERROR( errorPrefix << ": too many points (" << total_size << " > 2^312)" );
}
output_size = ( unsigned int ) total_size;
// Output info on diagnostics
if( smpi->isMaster() ) {
MESSAGE( 2, photon_axis->info( "photon energy" ) );
}
} // END DiagnosticRadiationSpectrum::DiagnosticRadiationSpectrum
DiagnosticRadiationSpectrum::~DiagnosticRadiationSpectrum()
{
delete photon_axis;
} // END DiagnosticRadiationSpectrum::~DiagnosticRadiationSpectrum
// Called only by patch master of process master
void DiagnosticRadiationSpectrum::openFile( Params& params, SmileiMPI* smpi )
{
if( !smpi->isMaster() || file_ ) {
return;
}
DiagnosticParticleBinningBase::openFile( params, smpi );
// write photon_energy_axis
string str1 = "photon_energy_axis";
ostringstream mystream( "" );
mystream << photon_axis->min << " " << photon_axis->max << " "
<< photon_axis->nbins << " " << photon_axis->logscale << " " << photon_axis->edge_inclusive;
string str2 = mystream.str();
file_->attr( str1, str2 );
file_->flush();
}
// run one particle binning diagnostic
void DiagnosticRadiationSpectrum::run( Patch* patch, int timestep, SimWindow* simWindow )
{
vector<int> int_buffer;
vector<double> double_buffer;
// // Update spatial_min and spatial_max if needed
// if( simWindow ) {
// bool did_move = false;
// for( unsigned int i=0; i<histogram->axes.size(); i++ ) {
// if( histogram->axes[i]->type == "moving_x" ) {
// spatial_min[0] = histogram->axes[i]->min + simWindow->getXmoved();
// spatial_max[0] = histogram->axes[i]->max + simWindow->getXmoved();
// did_move = true;
// }
// }
// if( ! did_move ) {
// spatial_max[0] += simWindow->getXmoved() - spatial_min[0];
// spatial_min[0] = simWindow->getXmoved();
// }
// }
// loop species
for( unsigned int ispec=0 ; ispec < species.size() ; ispec++ ) {
Species *s = patch->vecSpecies[species[ispec]];
unsigned int npart = s->particles->size();
int_buffer .resize( npart );
double_buffer.resize( npart );
fill(int_buffer.begin(), int_buffer.end(), 0);
histogram->digitize( s, double_buffer, int_buffer, simWindow );
// Sum the data into the data_sum
// ------------------------------
int ind;
double gamma_inv, gamma, chi, xi, zeta, nu, cst;
double two_third_ov_chi, increment0, increment;
int iphoton_energy_max;
for( unsigned int ipart = 0 ; ipart < npart ; ipart++ ) {
ind = int_buffer[ipart];
if( ind<0 ) continue; // skip already discarded particles
ind *= photon_axis->nbins;
// Get the quantum parameter
chi = s->particles->chi( ipart );
// Update the spectrum only if the quantum parameter is sufficiently high
if( chi <= minimum_chi_continuous_ ) continue;
// Emitting particle energy (maximum of the spectrum)
gamma = s->particles->LorentzFactor( ipart );
gamma_inv = 1./gamma;
two_third_ov_chi = two_third/chi;
increment0 = gamma_inv * s->particles->weight( ipart );
// Compute the maximum iteration of the loop on bins
// ensures that xi<1;
// that is no radiation corresponds to photon energy larger than the radiating particle energy
if( photon_axis->logscale ) {
gamma = log10( gamma );
}
iphoton_energy_max = int( (gamma - photon_axis->actual_min) * photon_axis->coeff );
//iphoton_energy_max can not be greater than photon_energy_nbins
iphoton_energy_max = min( iphoton_energy_max, photon_axis->nbins );
// Loop on bins
for( int i=0; i<iphoton_energy_max; i++ ) {
xi = photon_energies[i] * gamma_inv;
zeta = xi / (1.-xi); // xi<1 is ensured above
nu = two_third_ov_chi * zeta;
cst = xi * zeta;
increment = increment0 * delta_energies[i] * xi * RadiationTools::computeBesselPartsRadiatedPower(nu,cst);
#pragma omp atomic
data_sum[ind+i] += increment;
}
}
}
} // END run
| [
"iustin.ouatu@physics.ox.ac.uk"
] | iustin.ouatu@physics.ox.ac.uk |
4b1f9336e302316e79fbae13c8dae34685c6e199 | a6b93dc0ede380fdd916e7e1eb127ab2955a59a7 | /libsrc/pylith/faults/KinSrcRamp.cc | 9bd6f81850a9c08fe373e5e89cb333eddf63b2c5 | [
"MIT"
] | permissive | Tantribology/pylith | 240cf8f319df41d825ae2d2ef1d8d11653833fe5 | d4435b3b894035e25b65064ab5b499e15f179cde | refs/heads/main | 2023-07-01T04:45:05.106044 | 2021-08-04T02:03:34 | 2021-08-04T02:03:34 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 6,623 | cc | // -*- C++ -*-
//
// ----------------------------------------------------------------------
//
// Brad T. Aagaard, U.S. Geological Survey
// Charles A. Williams, GNS Science
// Matthew G. Knepley, University at Buffalo
//
// This code was developed as part of the Computational Infrastructure
// for Geodynamics (http://geodynamics.org).
//
// Copyright (c) 2010-2021 University of California, Davis
//
// See LICENSE.md for license information.
//
// ----------------------------------------------------------------------
//
#include <portinfo>
#include "KinSrcRamp.hh" // implementation of object methods
#include "pylith/faults/KinSrcAuxiliaryFactory.hh" // USES KinSrcAuxiliaryFactory
#include "pylith/utils/journals.hh" // USES PYLITH_COMPONENT_*
#include "pylith/utils/error.hh" // USES PYLITH_METHOD_BEGIN/END
#include "spatialdata/geocoords/CoordSys.hh" // USES CoordSys
#include <cassert> // USES assert()
// ---------------------------------------------------------------------------------------------------------------------
// Default constructor.
pylith::faults::KinSrcRamp::KinSrcRamp(void) {
pylith::utils::PyreComponent::setName("kinsrcramp");
} // constructor
// ---------------------------------------------------------------------------------------------------------------------
// Destructor.
pylith::faults::KinSrcRamp::~KinSrcRamp(void) {}
// ---------------------------------------------------------------------------------------------------------------------
// Slip time function kernel.
void
pylith::faults::KinSrcRamp::slipFn(const PylithInt dim,
const PylithInt numS,
const PylithInt numA,
const PylithInt sOff[],
const PylithInt sOff_x[],
const PylithScalar s[],
const PylithScalar s_t[],
const PylithScalar s_x[],
const PylithInt aOff[],
const PylithInt aOff_x[],
const PylithScalar a[],
const PylithScalar a_t[],
const PylithScalar a_x[],
const PylithReal t,
const PylithScalar x[],
const PylithInt numConstants,
const PylithScalar constants[],
PylithScalar slip[]) {
const PylithInt _numA = 3;
assert(_numA == numA);
assert(aOff);
assert(a);
assert(slip);
const PylithInt i_initiationTime = 0;
const PylithInt i_finalSlip = 1;
const PylithInt i_riseTime = 2;
const PylithScalar initiationTime = a[aOff[i_initiationTime]];
const PylithScalar* finalSlip = &a[aOff[i_finalSlip]];
const PylithScalar riseTime = a[aOff[i_riseTime]];
const PylithInt i_originTime = 0;
const PylithScalar originTime = constants[i_originTime];
const PylithScalar t0 = originTime + initiationTime;
if (t >= t0 + riseTime) {
for (PylithInt i = 0; i < dim; ++i) {
slip[i] = finalSlip[i];
} // for
} else if (t >= t0) {
for (PylithInt i = 0; i < dim; ++i) {
slip[i] = finalSlip[i] * (t - t0) / riseTime;
} // for
} // if/else
} // slipFn
// ---------------------------------------------------------------------------------------------------------------------
// Slip rate time function kernel.
void
pylith::faults::KinSrcRamp::slipRateFn(const PylithInt dim,
const PylithInt numS,
const PylithInt numA,
const PylithInt sOff[],
const PylithInt sOff_x[],
const PylithScalar s[],
const PylithScalar s_t[],
const PylithScalar s_x[],
const PylithInt aOff[],
const PylithInt aOff_x[],
const PylithScalar a[],
const PylithScalar a_t[],
const PylithScalar a_x[],
const PylithReal t,
const PylithScalar x[],
const PylithInt numConstants,
const PylithScalar constants[],
PylithScalar slipRate[]) {
const PylithInt _numA = 3;
assert(_numA == numA);
assert(aOff);
assert(a);
assert(slipRate);
const PylithInt i_initiationTime = 0;
const PylithInt i_finalSlip = 1;
const PylithInt i_riseTime = 2;
const PylithScalar initiationTime = a[aOff[i_initiationTime]];
const PylithScalar* finalSlip = &a[aOff[i_finalSlip]];
const PylithScalar riseTime = a[aOff[i_riseTime]];
const PylithInt i_originTime = 0;
const PylithScalar originTime = constants[i_originTime];
const PylithScalar t0 = originTime + initiationTime;
if ((t >= t0) && (t < t0 + riseTime)) {
for (PylithInt i = 0; i < dim; ++i) {
slipRate[i] = finalSlip[i] / riseTime;
} // for
} // if
} // slipRateFn
// ---------------------------------------------------------------------------------------------------------------------
// Preinitialize earthquake source. Set names/sizes of auxiliary subfields.
void
pylith::faults::KinSrcRamp::_auxiliaryFieldSetup(const spatialdata::units::Nondimensional& normalizer,
const spatialdata::geocoords::CoordSys* cs) {
PYLITH_METHOD_BEGIN;
PYLITH_COMPONENT_DEBUG("_auxiliaryFieldSetup()");
assert(_auxiliaryFactory);
assert(cs);
_auxiliaryFactory->initialize(_auxiliaryField, normalizer, cs->getSpaceDim());
// :ATTENTION: The order for adding subfields must match the order of the auxiliary fields in the slip time function
// kernel.
_auxiliaryFactory->addInitiationTime(); // 0
_auxiliaryFactory->addFinalSlip(); // 1
_auxiliaryFactory->addRiseTime(); // 2
_slipFnKernel = pylith::faults::KinSrcRamp::slipFn;
_slipRateFnKernel = pylith::faults::KinSrcRamp::slipRateFn;
PYLITH_METHOD_END;
} // _auxiliaryFieldSetup
// End of file
| [
"baagaard@usgs.gov"
] | baagaard@usgs.gov |
aff0f8a63292a1486c22dc9c8fe9a9ee746fa34a | e7087ad3076b1b6f60a10ea561211968c6993d2a | /tabulate/CNFobject.cpp | a22be649073709213d37cee6aa101e7aa467342d | [] | no_license | norgardp/tabulate | 0a8da48b3a0e49789dda9a7b71534c79a2b13752 | 8c1dd5cee8e23408ca0221861dd9ffd609102890 | refs/heads/master | 2020-03-29T23:48:45.648084 | 2020-01-09T15:52:02 | 2020-01-09T15:52:02 | 150,490,213 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 21,277 | cpp | #include "stdafx.h"
#include "CNFobject.h"
// ========================================================================
//
// ========================= OBJECT INSTANTIATION =========================
//
// ========================================================================
CNFobject::CNFobject()
{
}
CNFobject::CNFobject(const DataStructure::InitializationOptions& options)
{
InitializeSequenceAnalyzer();
UnpackInitilizerStruct(options);
}
CNFobject::CNFobject(const std::string lib_name,
const bool overwrite,
const OutputOption output_opt)
{
InitializeSequenceAnalyzer();
SetLibraryFilename(lib_name);
SetOverwriteMode(overwrite);
SetOutputOption(output_opt);
}
CNFobject::~CNFobject()
{
}
void CNFobject::InitializeSequenceAnalyzer()
{
HRESULT hr{ pSequenceAnalyzer.CreateInstance(__uuidof(CanberraSequenceAnalyzerLib::SequenceAnalyzer)) };
if (FAILED(hr))
pSequenceAnalyzer = nullptr;
}
void CNFobject::SetLibraryFilename(const std::string name)
{
if (!name.empty())
library_name = name.c_str();
}
void CNFobject::SetAnalysisFilename(const std::string name)
{
if (!name.empty())
analysis_name = name.c_str();
}
void CNFobject::SetEnergyTolerance(const double tol)
{
energy_tolerance = tol;
}
void CNFobject::SetOutputOption(const OutputOption option)
{
output_option = option;
}
void CNFobject::SetOverwriteMode(const bool mode)
{
overwrite = mode;
}
void CNFobject::SetLibraryDimensions(const std::vector<LibraryStruct>& library_struc)
{
psLibrary = library_struc;
}
void CNFobject::UnpackInitilizerStruct(const DataStructure::InitializationOptions& init)
{
SetLibraryFilename(init.Library);
SetAnalysisFilename(init.Analysis);
SetOverwriteMode(init.OverwriteMode);
SetOutputOption(init.OutputFormat);
SetEnergyTolerance(init.EnergyTolerance);
SetLibraryDimensions(init.NuclidesInLibrary);
}
void CNFobject::CreateInstance(const std::string& datafile)
{
OpenDatafile(datafile);
PerformAnalysis();
PopulateDataStructure();
}
void CNFobject::OpenDatafile(const std::string& datafile)
{
CanberraDataAccessLib::OpenMode open_mode;
CanberraDataAccessLib::CloseMode close_mode;
if (!datafile.empty())
{
if (overwrite)
{
open_mode = CanberraDataAccessLib::OpenMode::dReadWrite;
close_mode = CanberraDataAccessLib::CloseMode::dUpdate;
}
else
{
// If overwrite == false, then the data file still needs to be open
// in read/write mode to permit the modification of the energy
// tolerance used for the NID routine.
open_mode = CanberraDataAccessLib::OpenMode::dReadWrite;
close_mode = CanberraDataAccessLib::CloseMode::dNoUpdate;
}
}
OpenFile(datafile, open_mode, close_mode);
}
// ===============================================================================
//
// ========================= NUCLIDE ANALYSIS and IMPORT =========================
//
// ===============================================================================
void CNFobject::PerformAnalysis()
{
_bstr_t fake;
if (pSequenceAnalyzer != nullptr)
pSequenceAnalyzer->Analyze(pDataAccess, &start_step, analysis_name,
FALSE, FALSE, FALSE, TRUE, fake, NULL);
}
void CNFobject::PopulateDataStructure()
{
ResizeDataStructure();
PopulateHeaderStructure();
PopulateNuclideData();
output_string.clear();
IDInterestingPeaks();
}
void CNFobject::ResizeDataStructure()
{
psData.Nuclides.resize((size_t)libDim.NumberOfNuclides);
}
void CNFobject::PopulateHeaderStructure()
{
psData.SampleID = ReturnStringParam(CAM_T_SIDENT, 0, CAM_N_SIDENT);
psData.AcquisitionStart = ReturnTimeSParam(CAM_X_ASTIME, 0);
psData.AcquisitionStart.pop_back(); // remove trailing '\0'
psData.LiveTime = ReturnTimeNParam(CAM_X_ELIVE, 0);
psData.RealTime = ReturnTimeNParam(CAM_X_EREAL, 0);
psData.DeadTimePct = 100 * (psData.RealTime - psData.LiveTime) / psData.RealTime;
}
void CNFobject::PopulateNuclideData()
{
USHORT record;
LONG line_count = ReturnRecordCount(CAM_CLS_PEAK);
LONG Ldummy;
DOUBLE Ddummy;
double PPCTIME{ 0 };
for (LONG i{ 0 }; i < line_count; i++)
{
record = static_cast<USHORT>(i) + 1;
PPCTIME = ReturnTimeNParam(CAM_X_PPELIVE, record);
psData.Nuclides.push_back(ReturnNuclideInformation(record));
}
}
DataStructure::NuclideStructure::NuclideStruct CNFobject::ReturnNuclideInformation(const USHORT i)
{
LONG Ldummy;
FLOAT Fdummy;
DataStructure::NuclideStructure::NuclideStruct data;
data.Iterations = ReturnNumericParam(CAM_L_PSITER, i, Ldummy);
data.Area = ReturnNumericParam(CAM_F_PSAREA, i, Fdummy);
data.Energy = ReturnNumericParam(CAM_F_PSENERGY, i, Fdummy);
data.FWHM = ReturnNumericParam(CAM_F_PSFWHM, i, Fdummy);
data.Rate = ReturnNumericParam(CAM_F_PSCTSS, i, Fdummy);
data.Error = ReturnNumericParam(CAM_F_PSCERR, i, Fdummy);
// PAN 2020-Jan-06; test for multiplet in peak-search algorithm output
// Trying to figure out why data is missing from Ruth-Ann's data when
// TABULATE works on it.
//long psmult = ReturnNumericParam(CAM_L_PSPMULT, i, Ldummy);
return data;
}
void CNFobject::IDInterestingPeaks()
{
size_t max_nuclides{ psLibrary.size() };
size_t max_lines;
FLOAT tolerance{ static_cast<FLOAT>(energy_tolerance) };
for (size_t i{ 0 }; i < max_nuclides; i++)
{
max_lines = psLibrary.at(i).PeakEnergy.size();
psLibrary.at(i).PeakSearchResult.resize(max_lines);
for (size_t j{ 0 }; j < max_lines; j++)
FindLibraryPeakInData(psLibrary.at(i).PeakEnergy.at(j), tolerance, psLibrary.at(i).NuclideName);
}
}
void CNFobject::FindLibraryPeakInData(const FLOAT centroid, const FLOAT tolerance,
std::string nuclide_name)
{
FLOAT hilimit{ centroid + tolerance / 2 };
FLOAT lolimit{ centroid - tolerance / 2 };
size_t total_found_peaks{ psData.Nuclides.size() };
bool peak_was_not_found{ true };
for (size_t i{ 0 }; i < total_found_peaks; i++)
{
FLOAT peak_energy{ psData.Nuclides.at(i).Energy };
if ((peak_energy > lolimit) && (peak_energy < hilimit))
{
// peak was found
peak_was_not_found = false;
psDataFound.Nuclides.push_back(psData.Nuclides.at(i));
psData.Nuclides.erase(psData.Nuclides.begin() + i);
total_found_peaks--;
i--;
size_t current_iterator = psDataFound.Nuclides.size() - 1;
psDataFound.Nuclides.at(current_iterator).NucName = nuclide_name;
psDataFound.Nuclides.at(current_iterator).IdealEnergy = centroid;
break;
}
}
if (peak_was_not_found)
{
NoData = MakeBlank();
NoData.Nuclides.at(0).NucName = nuclide_name;
NoData.Nuclides.at(0).IdealEnergy = centroid;
psDataFound.Nuclides.push_back(NoData.Nuclides.at(0));
}
}
// ======================================================================
//
// ========================= HEADER FILE OUTPUT =========================
//
// ======================================================================
// Output file header construction looks generally like this:
// [header info supplied by primary routine]
// , , , , NA - 24, , , CO - 60, ,
// Filename , Acquisition start, Sample ID, % Dead, 1368.63, IT, FWHM, 661.32, IT, FWHM
// [-------------------------------------] [------------------------] [-------------------//---------------]
// Header-Common Header-Mode Header-Nuclide
// Line 1: empty empty nuclide name + empty fields
// Line 2: descriptors mode-specific descriptors field descriptors
//
std::string CNFobject::ReturnFormattedHeader()
{
output_string.clear();
std::stringstream ss;
bool use_descriptors{ true };
WriteNuclideHeader(ss, !use_descriptors);
WriteNuclideHeader(ss, use_descriptors);
return output_string;
}
void CNFobject::WriteNuclideHeader(std::stringstream& ss, const bool use_descriptors)
{
WriteHeaderCommonData(ss, use_descriptors);
WriteHeaderModeData(ss, use_descriptors);
size_t max_nuclides{ psDataFound.Nuclides.size() };
bool last_line{ false };
for (size_t i{ 0 }; i < max_nuclides; i++)
{
if (i == (max_nuclides - 1))
last_line = true;
WriteHeaderNuclide(ss, i, use_descriptors, last_line);
}
InsertEndline(ss);
}
void CNFobject::WriteHeaderCommonData(std::stringstream& ss, const bool use_descriptors)
{
std::string filename_to_pass, acquisition_to_pass;
if (use_descriptors)
{
filename_to_pass = std::string("Filename");
acquisition_to_pass = std::string("Acquisition Start");
}
else
{
filename_to_pass = std::string(fwf_filename, ' ');
acquisition_to_pass = std::string(fwf_acquisition_start, ' ');
}
WriteCAMFilename(ss, filename_to_pass);
WriteCAMAcquisitionTime(ss, acquisition_to_pass);
}
void CNFobject::WriteHeaderModeData(std::stringstream& ss, const bool use_descriptors)
{
std::string param1_to_pass, param2_to_pass, param3_to_pass;
switch (output_option)
{
case OutputOption::b:
param1_to_pass = (use_descriptors) ? std::string("EReal") : std::string(fwf_realtime, ' ');
param2_to_pass = (use_descriptors) ? std::string("ELive") : std::string(fwf_livetime, ' ');
WriteCAMRealTime(ss, param1_to_pass);
WriteCAMLiveTime(ss, param2_to_pass);
break;
case OutputOption::d:
param1_to_pass = (use_descriptors) ? std::string("EReal") : std::string(fwf_realtime, ' ');
param2_to_pass = (use_descriptors) ? std::string("ELive") : std::string(fwf_livetime, ' ');
param3_to_pass = (use_descriptors) ? std::string("% Dead") : std::string(fwf_deadtime_pct, ' ');
WriteCAMRealTime(ss, param1_to_pass);
WriteCAMLiveTime(ss, param2_to_pass);
WriteCAMDeadTime(ss, param3_to_pass);
break;
case OutputOption::a:
case OutputOption::c:
param1_to_pass = (use_descriptors) ? std::string("Sample ID") : std::string(fwf_sample_id, ' ');
param2_to_pass = (use_descriptors) ? std::string("% Dead") : std::string(fwf_deadtime_pct, ' ');
WriteCAMSampleID(ss, param1_to_pass);
WriteCAMDeadTime(ss, param2_to_pass);
break;
}
}
void CNFobject::WriteHeaderNuclide(std::stringstream& ss, const size_t i, const bool use_descriptors, const bool last_line)
{
std::string param1, param2, param3;
size_t max_nuclides{ psDataFound.Nuclides.size() };
if (use_descriptors)
WriteHeaderPeakEnergy(ss, i);
else
WriteHeaderPeakName(ss, i);
switch (output_option)
{
case OutputOption::a:
param1 = (use_descriptors) ? std::string("IT") : std::string(fwf_iterations, ' ');
param2 = (use_descriptors) ? std::string("FWHM") : std::string(fwf_peak_fwhm, ' ');
param3 = (use_descriptors) ? std::string("Energy") : std::string(fwf_peak_energy, ' ');
WritePeaksearchIterations(ss, param1, false);
WritePeakWidth(ss, param2, false);
WritePeakEnergy(ss, param3, last_line);
break;
case OutputOption::b:
param1 = (use_descriptors) ? std::string("FWHM") : std::string(fwf_peak_fwhm, ' ');
WritePeakWidth(ss, param1, last_line);
break;
case OutputOption::c:
param1 = (use_descriptors) ? std::string("%Err") : std::string(fwf_peak_error, ' ');
param2 = (use_descriptors) ? std::string("FWHM") : std::string(fwf_peak_fwhm, ' ');
param3 = (use_descriptors) ? std::string("Energy") : std::string(fwf_peak_energy, ' ');
WritePeakError(ss, param1, false);
WritePeakWidth(ss, param2, false);
WritePeakEnergy(ss, param3, last_line);
break;
case OutputOption::d:
param1 = (use_descriptors) ? std::string("FWHM") : std::string(fwf_peak_fwhm, ' ');
param2 = (use_descriptors) ? std::string("%Err") : std::string(fwf_peak_error, ' ');
WritePeakWidth(ss, param1, false);
WritePeakError(ss, param2, last_line);
break;
}
}
// =======================================================================
//
// ========================= NUCLIDE DATA OUTPUT =========================
//
// =======================================================================
std::string CNFobject::ReturnFormattedLine()
{
output_string.clear();
std::stringstream ss;
WriteDataCommon(ss);
WriteDataModeData(ss);
WriteDataNuclide(ss);
InsertEndline(ss);
return output_string;
}
void CNFobject::WriteDataCommon(std::stringstream& ss)
{
WriteCAMFilename(ss);
WriteCAMAcquisitionTime(ss);
}
void CNFobject::WriteDataModeData(std::stringstream& ss)
{
switch (output_option)
{
case OutputOption::b:
WriteCAMRealTime(ss);
WriteCAMLiveTime(ss);
break;
case OutputOption::d:
WriteCAMRealTime(ss);
WriteCAMLiveTime(ss);
WriteCAMDeadTime(ss);
break;
case OutputOption::a:
case OutputOption::c:
WriteCAMSampleID(ss);
WriteCAMDeadTime(ss);
break;
}
}
void CNFobject::WriteDataNuclide(std::stringstream& ss)
{
bool last_element{ false };
size_t max_nuclides{ psDataFound.Nuclides.size() };
for (size_t i{ 0 }; i < max_nuclides; i++)
{
if (i == (max_nuclides - 1))
last_element = true;
WriteDataNuclideMode(ss, i, last_element);
}
}
void CNFobject::WriteDataNuclideMode(std::stringstream& ss, const size_t i, const bool final_element)
{
switch (output_option)
{
case OutputOption::a:
WritePeakArea(ss, i, false);
WritePeaksearchIterations(ss, i, false);
WritePeakWidth(ss, i, false);
WritePeakEnergy(ss, i, final_element);
break;
case OutputOption::b:
WritePeakArea(ss, i, false);
WritePeakWidth(ss, i, final_element);
break;
case OutputOption::c:
WritePeakArea(ss, i, false);
WritePeakError(ss, i, false);
WritePeakWidth(ss, i, false);
WritePeakEnergy(ss, i, final_element);
break;
case OutputOption::d:
WritePeakArea(ss, i, false);
WritePeakWidth(ss, i, false);
WritePeakError(ss, i, final_element);
break;
}
}
// ==============================================================================
//
// ========================= OUTPUT FORMATING FUNCTIONS =========================
//
// ==============================================================================
// --------------> Header File Stuff
void CNFobject::WriteHeaderPeakName(std::stringstream& ss, const size_t i)
{
SetStreamParameters(ss, fwf_peak_area, false);
WriteStreamDataStr(ss, psDataFound.Nuclides.at(i).NucName, false);
}
void CNFobject::WriteHeaderPeakEnergy(std::stringstream& ss, const size_t i)
{
SetStreamParameters(ss, fwf_peak_area, fwf_precision_energy);
WriteStreamData(ss, psDataFound.Nuclides.at(i).IdealEnergy , false);
}
// <------------- Header File Stuff
void CNFobject::WritePeakArea(std::stringstream& ss, const size_t i, const bool final_element)
{
SetStreamParameters(ss, fwf_peak_area, fwf_precision_area);
WriteStreamData(ss, psDataFound.Nuclides.at(i).Area, final_element);
}
void CNFobject::WritePeakArea(std::stringstream& ss, const std::string user_string, const bool final_element)
{
SetStreamParameters(ss, fwf_peak_area, fwf_precision_area);
WriteStreamData(ss, user_string, final_element);
}
void CNFobject::WritePeakEnergy(std::stringstream& ss, const size_t i, const bool final_element)
{
SetStreamParameters(ss, fwf_peak_energy, fwf_precision_energy);
WriteStreamData(ss, psDataFound.Nuclides.at(i).Energy, final_element);
}
void CNFobject::WritePeakEnergy(std::stringstream& ss, const std::string user_string, const bool final_element)
{
SetStreamParameters(ss, fwf_peak_energy, fwf_precision_energy);
WriteStreamData(ss, user_string, final_element);
}
void CNFobject::WritePeakEnergy(std::stringstream& ss, bool final_element)
{
SetStreamParameters(ss, fwf_peak_energy, fwf_precision_energy);
WriteStreamData(ss, std::string(fwf_peak_energy, ' '), final_element);
}
void CNFobject::WritePeakError(std::stringstream& ss, const size_t i, const bool final_element)
{
SetStreamParameters(ss, fwf_peak_error, fwf_precision_error);
WriteStreamData(ss, psDataFound.Nuclides.at(i).Error, final_element);
}
void CNFobject::WritePeakError(std::stringstream& ss, const std::string user_string, const bool final_element)
{
SetStreamParameters(ss, fwf_peak_error, fwf_precision_error);
WriteStreamData(ss, user_string, final_element);
}
void CNFobject::WritePeakWidth(std::stringstream& ss, const size_t i, const bool final_element)
{
SetStreamParameters(ss, fwf_peak_fwhm, fwf_precision_npa);
WriteStreamData(ss, psDataFound.Nuclides.at(i).FWHM, final_element);
}
void CNFobject::WritePeakWidth(std::stringstream& ss, const std::string user_string, const bool final_element)
{
SetStreamParameters(ss, fwf_peak_fwhm, fwf_precision_npa);
WriteStreamData(ss, user_string, final_element);
}
void CNFobject::WritePeaksearchIterations(std::stringstream& ss, const size_t i, const bool final_element)
{
SetStreamParameters(ss, fwf_iterations, fwf_precision_iterations);
WriteStreamData(ss, psDataFound.Nuclides.at(i).Iterations, final_element);
}
void CNFobject::WritePeaksearchIterations(std::stringstream& ss, const std::string user_string, bool final_element)
{
SetStreamParameters(ss, fwf_iterations, fwf_precision_iterations);
WriteStreamData(ss, user_string, final_element);
}
void CNFobject::WriteCAMFilename(std::stringstream& ss)
{
SetStreamParameters(ss, fwf_filename, true);
WriteStreamDataStr(ss, ReturnSimpleFilename(), false);
}
void CNFobject::WriteCAMFilename(std::stringstream& ss, std::string user_string)
{
SetStreamParameters(ss, fwf_filename, true);
WriteStreamDataStr(ss, user_string, false);
}
void CNFobject::WriteCAMAcquisitionTime(std::stringstream& ss)
{
SetStreamParameters(ss, fwf_acquisition_start, false);
WriteStreamDataStr(ss, psData.AcquisitionStart, false);
}
void CNFobject::WriteCAMAcquisitionTime(std::stringstream& ss, std::string user_string)
{
SetStreamParameters(ss, fwf_acquisition_start, false);
WriteStreamDataStr(ss, user_string, false);
}
void CNFobject::WriteCAMRealTime(std::stringstream& ss)
{
SetStreamParameters(ss, fwf_realtime, fwf_precision_time);
WriteStreamData(ss, psData.RealTime, false);
}
void CNFobject::WriteCAMRealTime(std::stringstream& ss, std::string user_string)
{
SetStreamParameters(ss, fwf_realtime, fwf_precision_time);
WriteStreamData(ss, user_string, false);
}
void CNFobject::WriteCAMLiveTime(std::stringstream& ss)
{
SetStreamParameters(ss, fwf_livetime, fwf_precision_time);
WriteStreamData(ss, psData.LiveTime, false);
}
void CNFobject::WriteCAMLiveTime(std::stringstream& ss, std::string user_string)
{
SetStreamParameters(ss, fwf_livetime, fwf_precision_time);
WriteStreamData(ss, user_string, false);
}
void CNFobject::WriteCAMDeadTime(std::stringstream& ss)
{
SetStreamParameters(ss, fwf_deadtime_pct, fwf_precision_time);
WriteStreamData(ss, psData.DeadTimePct, false);
}
void CNFobject::WriteCAMDeadTime(std::stringstream& ss, std::string user_string)
{
SetStreamParameters(ss, fwf_deadtime_pct, fwf_precision_time);
WriteStreamData(ss, user_string, false);
}
void CNFobject::WriteCAMSampleID(std::stringstream& ss)
{
SetStreamParameters(ss, fwf_sample_id, true);
WriteStreamDataStr(ss, psData.SampleID , false);
}
void CNFobject::WriteCAMSampleID(std::stringstream& ss, std::string user_string)
{
SetStreamParameters(ss, fwf_sample_id, true);
WriteStreamDataStr(ss, user_string, false);
}
// ===========================================================================
//
// ========================= OUTPUT STREAM FUNCTIONS =========================
//
// ===========================================================================
void CNFobject::SetStreamParameters(std::stringstream& ss, const size_t field_width, const bool left_align)
{
std::stringstream().swap(ss);
if (left_align)
ss << std::left << std::setw(field_width);
else
ss << std::right << std::setw(field_width);
}
void CNFobject::SetStreamParameters(std::stringstream& ss, const size_t field_width, const size_t precision)
{
std::stringstream().swap(ss);
ss.precision(precision);
ss << std::setw(field_width) << std::fixed;
}
void CNFobject::WriteStreamDataStr(std::stringstream& ss, std::string& param, const bool last)
{
ss << param;
std::string local_string(ss.str());
output_string.append(local_string);
if (!last)
output_string.append(",");
}
void CNFobject::InsertEndline(std::stringstream& ss)
{
std::stringstream().swap(ss);
ss << std::endl;
output_string.append(ss.str());
}
// ===========================================================================
//
// ========================= MISCELLANEOUS FUNCTIONS =========================
//
// ===========================================================================
std::string CNFobject::ReturnSimpleFilename()
{
std::string filename = ReturnFilename();
// Remove pathname if present
const size_t last_slash_index = filename.find_last_of("\\/");
if (std::string::npos != last_slash_index)
filename.erase(0, last_slash_index + 1);
// Remove file extension if present
const size_t period_index = filename.rfind(".");
if (std::string::npos != period_index)
filename.erase(period_index);
return filename;
}
DataStructure::DataStruct CNFobject::MakeBlank()
{
DataStructure::DataStruct return_value;
return_value.Nuclides.resize(1);
return_value.Nuclides.at(0).Area = static_cast<FLOAT>(0.0);
return_value.Nuclides.at(0).Energy = static_cast<FLOAT>(0.0);
return_value.Nuclides.at(0).Error = static_cast<FLOAT>(0.0);
return_value.Nuclides.at(0).FWHM = static_cast<FLOAT>(0.0);
return_value.Nuclides.at(0).Iterations = static_cast<LONG>(0.0);
return_value.Nuclides.at(0).Rate = static_cast<FLOAT>(0.0);
return return_value;
}
| [
"norgardp@missouri.edu"
] | norgardp@missouri.edu |
8e152443a9f9c50a2d5c4d318cb75c033b13d244 | fb01bcbc274d3e2f13b2215fd23951f7c9d3c886 | /Plugin/SubDomain/MainDlg.cpp | fb486b2b8d80d91913ec68fe7b566d9e9185000c | [] | no_license | 15831944/WebRobot-v1.8.2 | 95585f36233607a6fcc4d602cb955f539aeb6cf8 | 1e870044ffd6fac9dfd6ecb56ebf0f261398ab5a | refs/heads/master | 2021-05-30T10:05:15.128454 | 2016-01-22T08:43:32 | 2016-01-22T08:43:32 | null | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 25,753 | cpp | // MainDlg.cpp : implementation file
//
#include "stdafx.h"
#include "SubDomain.h"
#include "MainDlg.h"
#include "HtmlCode.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CMainDlg dialog
CMainDlg::CMainDlg(CWnd* pParent /*=NULL*/)
: CDialog(CMainDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CMainDlg)
m_nMaxThread = ((CSubDomainApp *)AfxGetApp())->m_IniFile.GetInt("SubDomain", "nMaxThreadNum", 200);
m_strDomain = _T("");
m_checkGetDetailInfo = ((CSubDomainApp *)AfxGetApp())->m_IniFile.GetInt("SubDomain", "GetDetailInfo", FALSE);
//}}AFX_DATA_INIT
m_bScanning = FALSE;
dwThreadsUsed = 0;
hSemaphore = NULL;
bStopScan = TRUE;
}
void CMainDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CMainDlg)
DDX_Control(pDX, IDC_BUTTON_SCAN, m_btnScan);
DDX_Control(pDX, IDC_LIST, m_ListCtrl);
DDX_Text(pDX, IDC_EDIT_THREAD, m_nMaxThread);
DDX_Text(pDX, IDC_EDIT_DOMAIN, m_strDomain);
DDX_Check(pDX, IDC_CHECK_GET_INFO, m_checkGetDetailInfo);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CMainDlg, CDialog)
//{{AFX_MSG_MAP(CMainDlg)
ON_WM_SIZE()
ON_BN_CLICKED(IDC_BUTTON_SCAN, OnButtonScan)
ON_NOTIFY(NM_RCLICK, IDC_LIST, OnRclickList)
ON_COMMAND(ID_MENUITEM_COPY_DOMAIN, OnMenuitemCopyDomain)
ON_COMMAND(ID_MENUITEM_COPY_IP, OnMenuitemCopyIp)
ON_COMMAND(ID_MENUITEM_SAVE_DOMAIN, OnMenuitemSaveDomain)
ON_COMMAND(ID_MENUITEM_SAVE_DOMAIN_IP, OnMenuitemSaveDomainIp)
ON_COMMAND(ID_MENUITEM_DELETE_SELETED, OnMenuitemDeleteSeleted)
ON_COMMAND(ID_MENUITEM_CLEAR_LIST, OnMenuitemClearList)
ON_WM_MEASUREITEM()
ON_COMMAND(ID_MENUITEM_OPEN_URL, OnMenuitemOpenUrl)
ON_NOTIFY(NM_DBLCLK, IDC_LIST, OnDblclkList)
ON_COMMAND(ID_MENUITEM_COPY_HTTP_DOMAIN, OnMenuitemCopyHttpDomain)
ON_COMMAND(ID_MENUITEM_SAVE_HTTP_DOMAIN, OnMenuitemSaveHttpDomain)
ON_COMMAND(ID_MENUITEM_SAVE_HTML, OnMenuitemSaveHtml)
//}}AFX_MSG_MAP
ON_MESSAGE(WM_ON_INSERT_RESULT, OnMessageInsertResult)
END_MESSAGE_MAP()
BEGIN_EASYSIZE_MAP(CMainDlg)
EASYSIZE(IDC_LIST, ES_BORDER, IDC_EDIT_DOMAIN, ES_BORDER, ES_BORDER, 0)//左上右下
END_EASYSIZE_MAP
/////////////////////////////////////////////////////////////////////////////
// CMainDlg message handlers
void TransParentDC(CRect rect,CDC * pDC)
{
CDC m_MemDC;
m_MemDC.CreateCompatibleDC(pDC);
CBitmap m_Bitmap;
m_Bitmap.CreateCompatibleBitmap
(pDC,rect.Width(),rect.Height());
CBitmap *pOldBitmap =
m_MemDC.SelectObject(&m_Bitmap);
m_MemDC.FillSolidRect(0,0,rect.Width(),
rect.Height(),GetSysColor(COLOR_MENU));
COLORREF cor = pDC->GetPixel(0,0);
for(int y = 0; y < rect.Height();y++)
{
for(int x = 0; x < rect.Width(); x++)
{
COLORREF ch = pDC->GetPixel(x,y);
if(ch != cor)
m_MemDC.SetPixelV(x,y,ch);
}
}
pDC->BitBlt(0,0,rect.Width(),
rect.Height(),&m_MemDC,0,0,SRCCOPY);
m_MemDC.SelectObject(pOldBitmap);
m_Bitmap.DeleteObject();
}
CSize CMainDlg::LoadMyBitmap(CImageList *imgList, UINT nID)//使bmp图片透明
{
CDC * pDC = GetDC();
CDC m_MemDC;
m_MemDC.CreateCompatibleDC(pDC);
CSize m_Size = pDC->GetTextExtent("刷新");
ReleaseDC(pDC);
CRect rect(0,0,60,32);
CBitmap *pBitmap, *pOldBitmap;
pBitmap = new CBitmap;
pBitmap->LoadBitmap(nID);
pOldBitmap = m_MemDC.SelectObject(pBitmap);
TransParentDC(rect,&m_MemDC);
m_MemDC.SelectObject(pOldBitmap);
imgList->Add(pBitmap,GetSysColor(COLOR_MENU));
pBitmap->DeleteObject();
delete pBitmap;
return m_Size;
}
BOOL CMainDlg::OnInitDialog()
{
CDialog::OnInitDialog();
INIT_EASYSIZE;
// TODO: Add extra initialization here
char strFilePath[MAX_PATH] = {0};
GetModuleFileName(NULL, strFilePath, sizeof(strFilePath));
PathRemoveFileSpec(strFilePath);
lstrcat(strFilePath, "\\plugin\\");
lstrcat(strFilePath, "SubDomain.txt");
m_strDictionaryPath.Format("%s", strFilePath);
m_wndStatusBar.Create(WS_CHILD | WS_VISIBLE | CCS_BOTTOM, CRect(0, 0, 0, 0), this, 0x1200001);
int strPartDim[2]= {300, -1};
m_wndStatusBar.SetParts(2, strPartDim);
PostMessage(WM_SIZE);
m_ImageList.Create(16, 16, ILC_COLORDDB | ILC_MASK, 0, 1);
LoadMyBitmap(&m_ImageList, IDB_BITMAP_URL);
m_ListCtrl.InsertColumn(0, _T("域名"), LVCFMT_LEFT, 200);
m_ListCtrl.InsertColumn(1, _T("IP"), LVCFMT_LEFT, 300);
m_ListCtrl.InsertColumn(2, _T("主机名称"), LVCFMT_LEFT, 150);
m_ListCtrl.InsertColumn(3, _T("服务器类型"), LVCFMT_LEFT, 120);
m_ListCtrl.InsertColumn(4, _T("标题"), LVCFMT_LEFT, 200);
m_ListCtrl.SetExtendedStyle(m_ListCtrl.GetExtendedStyle() | LVS_EX_SUBITEMIMAGES | LVS_EX_FULLROWSELECT);
m_ListCtrl.SetImageList(&m_ImageList, LVSIL_SMALL);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CMainDlg::OnSize(UINT nType, int cx, int cy)
{
CDialog::OnSize(nType, cx, cy);
UPDATE_EASYSIZE;
// TODO: Add your message handler code here
if (GetParent()->m_hWnd != NULL && m_wndStatusBar.m_hWnd != NULL)
{
RECT rc;
GetParent()->GetClientRect(&rc);
MoveWindow(&rc);
m_wndStatusBar.MoveWindow(&rc);
}
}
void CMainDlg::StatusTextOut(int iPane,LPCTSTR ptzFormat, ...)
{
TCHAR tzText[1024];
va_list vlArgs;
va_start(vlArgs, ptzFormat);
wvsprintf(tzText, ptzFormat, vlArgs);
va_end(vlArgs);
m_wndStatusBar.SetText(tzText, iPane, 0);
}
__inline VOID MyOutputDebugString(LPCTSTR ptzFormat, ...)
{
va_list vlArgs;
TCHAR tzText[1024];
va_start(vlArgs, ptzFormat);
wvsprintf(tzText, ptzFormat, vlArgs);
OutputDebugString(tzText);
va_end(vlArgs);
}
void CMainDlg::OnButtonScan()
{
UpdateData();
if (!m_bScanning)
{
m_ListCtrl.DeleteAllItems();
if (m_nMaxThread <= 0 || m_nMaxThread > 1024)
{
StatusTextOut(0, "线程数设置错误!");
return;
}
bStopScan = FALSE;
m_bScanning = TRUE;//标记为正在扫描
SetDlgItemText(IDC_BUTTON_SCAN, "停止");
((CSubDomainApp *)AfxGetApp())->m_IniFile.SetInt("SubDomain", "nMaxThreadNum", m_nMaxThread);
((CSubDomainApp *)AfxGetApp())->m_IniFile.SetInt("SubDomain", "GetDetailInfo", m_checkGetDetailInfo);
HANDLE hScan = CreateThread(0, 0, ScanThread, this, 0, NULL);
WaitForSingleObject(hScan, 100);
CloseHandle(hScan);
}
else
{
bStopScan = TRUE;
m_bScanning = FALSE;
m_btnScan.EnableWindow(FALSE);
StatusTextOut(0, "%s", "正在等待所有扫描线程结束...");
SetDlgItemText(IDC_BUTTON_SCAN, "扫描");
}
}
DWORD WINAPI CMainDlg::ScanThread(LPVOID lparam)
{
CMainDlg *pThis = (CMainDlg *)lparam;
// 初始化Winsock
WSADATA wsaData;
if (WSAStartup(MAKEWORD(2, 2), &wsaData) != 0)
return 0;
pThis->sDomainArray.RemoveAll();
//读取字典
try
{
CStdioFile file;
CString strBuffer, strTmp;
file.Open(pThis->m_strDictionaryPath, CFile::modeRead);
while(file.ReadString(strBuffer) > 0)
{
try
{
if(strBuffer.GetLength() > 0)
{
strTmp = strBuffer;
strTmp += ".";
strTmp += pThis->m_strDomain;
pThis->sDomainArray.Add(strTmp);
}
}
catch (...){}
}
file.Close();
}
catch (...){}
if (InitializeCriticalSectionAndSpinCount(&pThis->cs, 0x80000400))
{
pThis->dwThreadsUsed = 0;
pThis->startScanSubDomain(&pThis->sDomainArray);
DeleteCriticalSection(&pThis->cs);
}
pThis->m_bScanning = FALSE;
pThis->StatusTextOut(0, "%s", "扫描完成!");
pThis->StatusTextOut(1, "");
pThis->m_btnScan.EnableWindow(TRUE);
pThis->SetDlgItemText(IDC_BUTTON_SCAN, "开始");
WSACleanup();
return 0;
}
CString GetIP(CString strDomain, CString &strHostName)
{
CString strReturn;
struct hostent *remoteHost;
struct in_addr addr;
remoteHost = gethostbyname(strDomain);
if(remoteHost == NULL)
return "";
strHostName = remoteHost->h_name;
int i = 0;
while (remoteHost->h_addr_list[i] != 0) {
addr.s_addr = *(u_long *) remoteHost->h_addr_list[i++];
strReturn += inet_ntoa(addr);
strReturn += ",";
}
return strReturn;
}
typedef struct tagThreadParameter
{
CString strDomain;
CString strIP;
CString strHostName;
CString strServerInfo;
CString strTitle;
CMainDlg *pThis;
}ThreadParameter,*LPThreadParameter;
int CMainDlg::startScanSubDomain(CStringArray *sArray)
{
DWORD dwError;
BOOL bSemaphore = FALSE;
DWORD dwThreadId;
HANDLE hObject = NULL;
LONG previousCount;
int nMaxThread;
int nScannedCount = 0;
CString strDomain, strIP, strHostName;
int nTotalNum = sArray->GetSize();
nMaxThread = m_nMaxThread;
m_nIpScanned = 0;
hSemaphore = CreateSemaphore(0, nMaxThread, nMaxThread, 0);
if (!hSemaphore)
{
StatusTextOut(0, "Fail To Create Semaphore");
return 0;
}
for (int i = 0; i < nTotalNum; i++)
{
if (bStopScan)
break;
strDomain = sArray->GetAt(i);
if (GetTickCount()%10 == 0)
StatusTextOut(0, "%s", strDomain);
if (GetTickCount()%5 == 0)
StatusTextOut(1, "进度: %d/%d", i, nTotalNum);
ThreadParameter *lparam = new ThreadParameter;
lparam->strDomain = strDomain;
lparam->pThis = this;
hObject = CreateThread(0, 0, DomainScanThread, lparam, 0, &dwThreadId);
if (hObject)
{
EnterCriticalSection(&cs);
++nScannedCount;
++dwThreadsUsed;
LeaveCriticalSection(&cs);
CloseHandle(hObject);
}
WaitForSingleObject(hSemaphore, INFINITE);
}
while (dwThreadsUsed)
{
WaitForSingleObject(hSemaphore, INFINITE);
if (!bStopScan)//不是强制终止的才显示
{
StatusTextOut(0, "仍有%d线程正在扫描...", dwThreadsUsed);
StatusTextOut(1, "");
}
EnterCriticalSection(&cs);
bSemaphore = ReleaseSemaphore(hSemaphore, 1, &previousCount);
LeaveCriticalSection(&cs);
if (!bSemaphore)
{
dwError = GetLastError();
StatusTextOut(1, "Error Code: %d", dwError);
Sleep(1000);
break;
}
if (previousCount + 1 != nMaxThread)
{
Sleep(200);
if (m_nIpScanned != nScannedCount)//说明还没扫描完
continue;
}
break;
}
if ( hSemaphore )
CloseHandle(hSemaphore);
return 0;
}
LRESULT CMainDlg::OnMessageInsertResult(WPARAM wParam, LPARAM lParam)
{
ThreadParameter *par = (ThreadParameter *)lParam;
int nCount = m_ListCtrl.GetItemCount();
m_ListCtrl.InsertItem(nCount, par->strDomain, 0);
m_ListCtrl.SetItemText(nCount, 1, par->strIP);
m_ListCtrl.SetItemText(nCount, 2, par->strHostName);
m_ListCtrl.SetItemText(nCount, 3, par->strServerInfo);
m_ListCtrl.SetItemText(nCount, 4, par->strTitle);
ShowRowNum();
delete par;
return 0;
}
void CMainDlg::ShowRowNum()
{
CString strColumnHeaderText;
strColumnHeaderText.Format("域名 - (%d)", m_ListCtrl.GetItemCount());
LVCOLUMN lvCom = {0};
char szBuffer[256] = {0};
strcpy(szBuffer, strColumnHeaderText.GetBuffer(0));
lvCom.mask = LVCF_TEXT;
lvCom.cchTextMax = 256;
lvCom.pszText = szBuffer;
m_ListCtrl.SetColumn(0, &lvCom);
strColumnHeaderText.ReleaseBuffer();
}
INT IsTextUTF8(LPSTR lpstrInputStream, INT iLen)
{
INT i;
DWORD cOctets; // octets to go in this UTF-8 encoded character
UCHAR chr;
BOOL bAllAscii= TRUE;
cOctets= 0;
for( i=0; i < iLen; i++ ) {
chr= *(lpstrInputStream+i);
if( (chr&0x80) != 0 ) bAllAscii= FALSE;
if( cOctets == 0 ) {
//
// 7 bit ascii after 7 bit ascii is just fine. Handle start of encoding case.
//
if( chr >= 0x80 ) {
//
// count of the leading 1 bits is the number of characters encoded
//
do {
chr <<= 1;
cOctets++;
}
while( (chr&0x80) != 0 );
cOctets--; // count includes this character
if( cOctets == 0 ) return FALSE; // must start with 11xxxxxx
}
}
else {
// non-leading bytes must start as 10xxxxxx
if( (chr&0xC0) != 0x80 ) {
return FALSE;
}
cOctets--; // processed another octet in encoding
}
}
// End of text. Check for consistency.
if( cOctets > 0 ) { // anything left over at the end is an error
return FALSE;
}
if( bAllAscii ) { // Not utf-8 if all ascii. Forces caller to use code pages for conversion
return FALSE;
}
return TRUE;
}
//UTF8转ANSI
void Utf8ToAnsi(CString &strUTF8)
{
//获取转换为多字节后需要的缓冲区大小,创建多字节缓冲区
UINT nLen = MultiByteToWideChar(CP_UTF8,NULL,strUTF8,-1,NULL,NULL);
WCHAR *wszBuffer = new WCHAR[nLen+1];
nLen = MultiByteToWideChar(CP_UTF8,NULL,strUTF8,-1,wszBuffer,nLen);
wszBuffer[nLen] = 0;
nLen = WideCharToMultiByte(936,NULL,wszBuffer,-1,NULL,NULL,NULL,NULL);
CHAR *szBuffer = new CHAR[nLen+1];
nLen = WideCharToMultiByte(936,NULL,wszBuffer,-1,szBuffer,nLen,NULL,NULL);
szBuffer[nLen] = 0;
strUTF8 = szBuffer;
//清理内存
delete []szBuffer;
delete []wszBuffer;
}
CString GetServerDetailInfo(CString strServer, CString &strTitle)
{
strServer.Insert(0, "http://");
CString strReturn = "Unknown", szAllData, szData;
CInternetSession ss(_T("session"), 0, INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, INTERNET_FLAG_DONT_CACHE | INTERNET_FLAG_RELOAD);//设置不缓冲
CHttpFile *pF = NULL;
try
{
ss.SetOption(INTERNET_OPTION_CONNECT_TIMEOUT, 10 * 1000);
pF = (CHttpFile *)ss.OpenURL(strServer, 1, INTERNET_FLAG_EXISTING_CONNECT | INTERNET_FLAG_TRANSFER_ASCII | INTERNET_FLAG_NO_AUTO_REDIRECT);
pF->QueryInfo(HTTP_QUERY_RAW_HEADERS_CRLF, szAllData, 0);
int nPos1 = szAllData.Find("Server: ", 0);
if (nPos1 == -1)
{
strReturn = "Unknown";
}
else
{
nPos1 += 8;
int nPos2 = szAllData.Find("\r\n", nPos1);
strReturn = szAllData.Mid(nPos1, nPos2 - nPos1);
if (strReturn.Find("Microsoft", 0) != -1)
{
strReturn.Insert(0, "Windows, ");
}
}
szAllData.Empty();
while(pF->ReadString(szData))
szAllData += szData;
szAllData.MakeLower();
nPos1 = szAllData.Find("<title>", 0);
if (nPos1 != -1)
{
int nPos2 = szAllData.Find("</title>", nPos1);
if (nPos2 != -1)
{
strTitle = szAllData.Mid(nPos1 + 7, nPos2 - nPos1 - 7);
if (IsTextUTF8(strTitle.GetBuffer(0), strTitle.GetLength()))
Utf8ToAnsi(strTitle);
}
}
}
catch(...)
{
strReturn = "";
}
if (pF != NULL)
{
pF->Close();
delete pF;
pF = NULL;
}
if (ss != NULL)
{
ss.Close();
delete ss;
}
return strReturn;
}
DWORD WINAPI CMainDlg::DomainScanThread(LPVOID lparam)
{
ThreadParameter *par = (ThreadParameter *)lparam;
CMainDlg *pThis = par->pThis;
CString strDomain = par->strDomain;
CString strIP, strHostName;
strIP = GetIP(par->strDomain, strHostName);
if (strIP != "")
{
par->strIP = strIP;
par->strHostName = strHostName;
if (pThis->m_checkGetDetailInfo)
par->strServerInfo = GetServerDetailInfo(strDomain, par->strTitle);
EnterCriticalSection(&pThis->cs);
pThis->SendMessage(WM_ON_INSERT_RESULT, 0, (LPARAM)par);//OnMessageInsertResult
LeaveCriticalSection(&pThis->cs);
}
EnterCriticalSection(&pThis->cs);
++pThis->m_nIpScanned;
if (pThis->dwThreadsUsed)
--pThis->dwThreadsUsed;
ReleaseSemaphore(pThis->hSemaphore, 1, 0);
LeaveCriticalSection(&pThis->cs);
//delete par;
return 0;
}
void CMainDlg::OnRclickList(NMHDR* pNMHDR, LRESULT* pResult)
{
// TODO: Add your control notification handler code here
CNewMenu OnLineMenu, *pSubMenu;
OnLineMenu.LoadMenu(IDR_MENU_LIST);
OnLineMenu.SetMenuDrawMode(CNewMenu::STYLE_XP_2003);
pSubMenu = (CNewMenu *)OnLineMenu.GetSubMenu(0);
CPoint oPoint;
GetCursorPos(&oPoint);
int count = pSubMenu->GetMenuItemCount();
if (m_ListCtrl.GetSelectedCount() == 0)
{
for (int i = count - 1; i >= 0; i--)
{
pSubMenu->DeleteMenu(i, MF_BYPOSITION);
}
}
pSubMenu->TrackPopupMenu(TPM_LEFTALIGN, oPoint.x, oPoint.y, this);
*pResult = 0;
}
void CMainDlg::OnMenuitemCopyDomain()
{
// TODO: Add your command handler code here
int nItem;
CString strText(_T(""));
POSITION pos = m_ListCtrl.GetFirstSelectedItemPosition();
//获取所有选中项目的内容。
while (pos)
{
nItem = m_ListCtrl.GetNextSelectedItem(pos);
strText += m_ListCtrl.GetItemText(nItem, 0) + _T("\r\n");
}
strText.MakeLower();
//将内容保存到剪贴板。
if (!strText.IsEmpty())
{
if (OpenClipboard())
{
EmptyClipboard();
HGLOBAL hClipboardData = GlobalAlloc(GHND | GMEM_SHARE, (strText.GetLength() + 1) * sizeof(TCHAR));
if (hClipboardData)
{
TCHAR* pszData = (TCHAR *)GlobalLock(hClipboardData);
_tcscpy(pszData, strText);
GlobalUnlock(hClipboardData);
SetClipboardData(CF_TEXT, hClipboardData);
}
CloseClipboard();
}
}
}
void CMainDlg::OnMenuitemCopyIp()
{
// TODO: Add your command handler code here
int nItem;
CString strText(_T(""));
POSITION pos = m_ListCtrl.GetFirstSelectedItemPosition();
//获取所有选中项目的内容。
while (pos)
{
nItem = m_ListCtrl.GetNextSelectedItem(pos);
strText += m_ListCtrl.GetItemText(nItem, 1) + _T("\r\n");
}
//将内容保存到剪贴板。
if (!strText.IsEmpty())
{
if (OpenClipboard())
{
EmptyClipboard();
HGLOBAL hClipboardData = GlobalAlloc(GHND | GMEM_SHARE, (strText.GetLength() + 1) * sizeof(TCHAR));
if (hClipboardData)
{
TCHAR* pszData = (TCHAR *)GlobalLock(hClipboardData);
_tcscpy(pszData, strText);
GlobalUnlock(hClipboardData);
SetClipboardData(CF_TEXT, hClipboardData);
}
CloseClipboard();
}
}
}
void CMainDlg::OnMenuitemSaveDomain()
{
// TODO: Add your command handler code here
CTime time = CTime::GetCurrentTime(); ///构造CTime对象
CString strTime = time.Format("Domain:%Y-%m-%d %H-%M-%S");
CFileDialog dlg(FALSE, _T("txt"), strTime, OFN_OVERWRITEPROMPT, _T("*.txt|*.txt||"), NULL);
if (dlg.DoModal() != IDOK)
return;
CFile file;
CString strData;
if (file.Open(dlg.GetPathName(), CFile::modeCreate | CFile::modeWrite))
{
for (int i = 0; i < m_ListCtrl.GetItemCount(); i++)
{
strData.Empty();
strData.Format(_T("%s\r\n"), m_ListCtrl.GetItemText(i, 0));
strData.MakeLower();
file.Write(strData, strData.GetLength());
}
file.Close();
::MessageBox(0, "列表内容导出成功", "提示", MB_ICONINFORMATION);
}
}
void CMainDlg::OnMenuitemSaveDomainIp()
{
// TODO: Add your command handler code here
CTime time = CTime::GetCurrentTime(); ///构造CTime对象
CString strTime = time.Format("Domain_IP:%Y-%m-%d %H-%M-%S");
CFileDialog dlg(FALSE, _T("txt"), strTime, OFN_OVERWRITEPROMPT, _T("*.txt|*.txt||"), NULL);
if (dlg.DoModal() != IDOK)
return;
CFile file;
CString strData;
if (file.Open(dlg.GetPathName(), CFile::modeCreate | CFile::modeWrite))
{
for (int i = 0; i < m_ListCtrl.GetItemCount(); i++)
{
strData.Empty();
strData.Format(_T("%s\t%s\r\n"), m_ListCtrl.GetItemText(i, 0), m_ListCtrl.GetItemText(i, 1));
strData.MakeLower();
file.Write(strData, strData.GetLength());
}
file.Close();
::MessageBox(0, "列表内容导出成功", "提示", MB_ICONINFORMATION);
}
}
void CMainDlg::OnMenuitemDeleteSeleted()
{
// TODO: Add your command handler code here
POSITION pos = m_ListCtrl.GetFirstSelectedItemPosition();
if (pos == NULL)
return;
else
{
for (int i = m_ListCtrl.GetItemCount() - 1; i >= 0; i--)
{
if (m_ListCtrl.GetItemState(i, LVIS_SELECTED) == LVIS_SELECTED)
m_ListCtrl.DeleteItem(i);
}
}
StatusTextOut(0, "");
ShowRowNum();
}
void CMainDlg::OnMenuitemClearList()
{
// TODO: Add your command handler code here
m_ListCtrl.DeleteAllItems();
ShowRowNum();
}
void CMainDlg::OnMeasureItem(int nIDCtl, LPMEASUREITEMSTRUCT lpMeasureItemStruct)
{
// TODO: Add your message handler code here and/or call default
lpMeasureItemStruct->itemHeight = 23;
CDialog::OnMeasureItem(nIDCtl, lpMeasureItemStruct);
}
void CMainDlg::OnMenuitemOpenUrl()
{
// TODO: Add your command handler code here
int nItem;
CString strText(_T(""));
POSITION pos = m_ListCtrl.GetFirstSelectedItemPosition();
//获取所有选中项目的内容。
while (pos)
{
nItem = m_ListCtrl.GetNextSelectedItem(pos);
strText = "http://" + m_ListCtrl.GetItemText(nItem, 0);
ShellExecute(0, "open", strText, NULL, NULL, SW_SHOW);
}
}
void CMainDlg::OnDblclkList(NMHDR* pNMHDR, LRESULT* pResult)
{
// TODO: Add your control notification handler code here
int nItem;
CString strText(_T(""));
POSITION pos = m_ListCtrl.GetFirstSelectedItemPosition();
//获取所有选中项目的内容。
while (pos)
{
nItem = m_ListCtrl.GetNextSelectedItem(pos);
strText = "http://" + m_ListCtrl.GetItemText(nItem, 0);
ShellExecute(0, "open", strText, NULL, NULL, SW_SHOW);
}
*pResult = 0;
}
void CMainDlg::OnMenuitemCopyHttpDomain()
{
// TODO: Add your command handler code here
int nItem;
CString strText(_T(""));
POSITION pos = m_ListCtrl.GetFirstSelectedItemPosition();
//获取所有选中项目的内容。
while (pos)
{
nItem = m_ListCtrl.GetNextSelectedItem(pos);
strText += "http://" + m_ListCtrl.GetItemText(nItem, 0) + _T("/\r\n");
}
strText.MakeLower();
//将内容保存到剪贴板。
if (!strText.IsEmpty())
{
if (OpenClipboard())
{
EmptyClipboard();
HGLOBAL hClipboardData = GlobalAlloc(GHND | GMEM_SHARE, (strText.GetLength() + 1) * sizeof(TCHAR));
if (hClipboardData)
{
TCHAR* pszData = (TCHAR *)GlobalLock(hClipboardData);
_tcscpy(pszData, strText);
GlobalUnlock(hClipboardData);
SetClipboardData(CF_TEXT, hClipboardData);
}
CloseClipboard();
}
}
}
void CMainDlg::OnMenuitemSaveHttpDomain()
{
// TODO: Add your command handler code here
CTime time = CTime::GetCurrentTime(); ///构造CTime对象
CString strTime = time.Format("Http Domain:%Y-%m-%d %H-%M-%S");
CFileDialog dlg(FALSE, _T("txt"), strTime, OFN_OVERWRITEPROMPT, _T("*.txt|*.txt||"), NULL);
if (dlg.DoModal() != IDOK)
return;
CFile file;
CString strData;
if (file.Open(dlg.GetPathName(), CFile::modeCreate | CFile::modeWrite))
{
for (int i = 0; i < m_ListCtrl.GetItemCount(); i++)
{
strData.Empty();
strData.Format(_T("http://%s/\r\n"), m_ListCtrl.GetItemText(i, 0));
strData.MakeLower();
file.Write(strData, strData.GetLength());
}
file.Close();
::MessageBox(0, "列表内容导出成功", "提示", MB_ICONINFORMATION);
}
}
void CMainDlg::PostNcDestroy()
{
// TODO: Add your specialized code here and/or call the base class
delete this; //主程序结束的时候销毁
CDialog::PostNcDestroy();
}
void CMainDlg::SaveTreeCtrlData(CString strSavePath)
{
UpdateData();
SYSTEMTIME SysTime;
GetLocalTime(&SysTime);
char strLogFileName[MAX_PATH] = {0};
char strTime1[MAX_PATH] = {0};
char strTime2[MAX_PATH] = {0};
wsprintf
(
strTime1,
"\\SubDomain:%d-%02d-%02d %02d^%02d^%02d.htm",
SysTime.wYear, SysTime.wMonth, SysTime.wDay,
SysTime.wHour, SysTime.wMinute, SysTime.wSecond
);
wsprintf
(
strTime2,
"%d-%02d-%02d %02d:%02d:%02d",
SysTime.wYear, SysTime.wMonth, SysTime.wDay,
SysTime.wHour, SysTime.wMinute, SysTime.wSecond
);
CFile file;
if (!file.Open(strSavePath, CFile::modeCreate | CFile::modeWrite))
return;
file.Write(HTMLHeader, sizeof(HTMLHeader));
file.Write(strTime2, strlen(strTime2));
file.Write(HTMLData, sizeof(HTMLData));
//获取IP和服务器信息
CString strHostIP, strTmp1;
strTmp1 = "</tr> \r\n <tr>\r\n <td class=sub width=\"20%\">域名</td>\r\n <td class=sub width=\"15%\">IP</td>\r\n <td class=sub width=\"15%\">主机名称</td>\r\n <td class=sub width=\"20%\">服务器类型</td>\r\n <td class=sub width=\"30%\">标题</td>\r\n</tr>\r\n </tr>";
file.Write(strTmp1, strTmp1.GetLength());
for (int i = 0; i < m_ListCtrl.GetItemCount(); i++)
{
strHostIP = m_ListCtrl.GetItemText(i, 1);
strHostIP.TrimRight(",");
strHostIP.Replace(",", "<br>");
strTmp1 = " <tr>\r\n <td class=\"default\" width=\"20%\"><a href=\"";
strTmp1 += "http://" + m_ListCtrl.GetItemText(i, 0);
strTmp1 += "/\" target=\"_blank\">";
strTmp1 += m_ListCtrl.GetItemText(i, 0);
strTmp1 += "</a></td>\r\n <td class=default width=\"15%\">";
strTmp1 += strHostIP;
strTmp1 += "</td>\r\n <td class=default width=\"15%\">";
strTmp1 += m_ListCtrl.GetItemText(i, 2);
strTmp1 += "</td>\r\n <td class=default width=\"20%\">";
strTmp1 += m_ListCtrl.GetItemText(i, 3);
strTmp1 += "</td>\r\n <td class=default width=\"30%\">";
strTmp1 += m_ListCtrl.GetItemText(i, 4);
strTmp1 += "</td></tr>";
file.Write(strTmp1, strTmp1.GetLength());
}
file.Write(HTMLEnd, sizeof(HTMLEnd));
file.Close();
}
void CMainDlg::OnMenuitemSaveHtml()
{
SYSTEMTIME SysTime;
GetLocalTime(&SysTime);
char strFileName[MAX_PATH] = {0};
wsprintf
(
strFileName,
"SubDomain:%d-%02d-%02d %02d^%02d^%02d.htm",
SysTime.wYear, SysTime.wMonth, SysTime.wDay,
SysTime.wHour, SysTime.wMinute, SysTime.wSecond
);
CFileDialog dlg(FALSE, _T("htm"), strFileName, OFN_OVERWRITEPROMPT, _T("htm文件(*.htm)|*.htm||"), NULL);
if (dlg.DoModal() != IDOK)
return;
SaveTreeCtrlData(dlg.GetPathName());
::MessageBox(0, "数据导出成功!", "提示", MB_ICONINFORMATION);
}
| [
"c4bbage@qq.com"
] | c4bbage@qq.com |
7953bd818a768401546af4d06131828e7d86f854 | 5486779c8ff01bfdbd3a6b3264ff896e0594eb87 | /lectures/AI/Search/PathPlannerApp/PathPlannerApp.solution/Src/PathPlannerAStar.h | 7f46acd23f36474cd1c1e16a5ef04d5ef37f607d | [] | no_license | NickSKim/csci321 | b10c1df202628945110c20a9160b246e41f39041 | 0dcffcb921ff50ddae02d5acfff387d4fbfaa1c3 | refs/heads/master | 2021-08-23T18:17:59.732956 | 2017-12-06T00:16:25 | 2017-12-06T00:16:25 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,444 | h | /**
* Author: Syrus Mesdaghi, SyrusM@hotmail.com
*/
// PathPlannerAStar.h: interface for the PathPlannerAStar class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(PATHPLANNERASTAR_H)
#define PATHPLANNERASTAR_H
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "PathPlannerBase.h"
#include "PlannerNode.h"
// STL
#include <vector>
#include <list>
using namespace std;
// computes the hash code of a pair of coordinates
// WARNING: this methode will fail if the x or y values are greater than 0xFFFF or 65,535
// TODO: write the hash code macro
#define COMPUTE_HASH_CODE(x, y) (0xFFFF0000 & (x << 16) | (0xFFFF & y))
class PathPlannerAStar : public PathPlannerBase
{
public:
PlannerNode* current;
vector<PlannerNode *> open;
vector<PlannerNode *> solution;
list<PlannerNode *>::iterator iterator;
int ix, iy, gx, gy;
bool foundGoal,
isDone,
diagonalPenalty;
float heuristicWeight;
PlannerNode **closedHashTable; // pointer to hashTable's table
// some prime numbers that can be used for hash table size
// 101, 151, 199, 307, 401, 499, 599, 797, 911, 997, 1999, 4001
// NOTE: when you turn in your project, it should be using hash table size of
// 199. When writing your hash table functions, you should try table sizes
// of 1 and 4001.
int closedHashTableSize;
public:
PathPlannerAStar();
virtual ~PathPlannerAStar();
void Draw(CDC *dc);
void PlanPath(int ix, int iy, int gx, int gy);
void Run();
bool IsDone();
void ShowInfo();
void Settings();
void CleanUp();
// inserts the node into the provided vector. it searches the vector to find the "correct" insertion point.
// it assumes that vec is already sorted. the PlannerNode class MUST provide a compare() function that allows SmartInsert
// determine wether a node is <, >, or == to another
void SmartInsert(vector<PlannerNode *> *vec, PlannerNode * node);
// inserts node into hashTable[]
void HashTableInsert(PlannerNode *node);
// removes node from give the x and y
PlannerNode* HashTableRemove(int x, int y);
// checkes wether or not a node with coordinates x, y, exists in the table.
// if so, it returns the pointer to that node else it returns NULL
PlannerNode* HashTableFind(int x, int y);
};
#endif // !defined(PATHPLANNERASTAR_H)
| [
"geoffrey.matthews@wwu.edu"
] | geoffrey.matthews@wwu.edu |
f6c873049aa17d9345b578ed22ecfb987328dfb5 | 50c1c675fef2c560dd904df9ab80791847f83f2c | /include/CPLEXSolverSystem.hxx | 698b5c4627022e5198e4c6813783f82fa82d9093 | [] | no_license | xlou/BOT | 3bf9089c91b86f22ec2d2da01ffac00bd009c12f | 1046b11ffd038468693055422f5b00c50ba96a9b | refs/heads/master | 2016-09-06T01:56:02.951423 | 2013-02-01T16:34:59 | 2013-02-01T16:34:59 | 2,142,202 | 5 | 3 | null | null | null | null | UTF-8 | C++ | false | false | 12,302 | hxx | /*!
* @author Xinghua Lou <xinghua.lou@iwr.uni-heidelberg.de>
*
* @section LICENSE
*
* BOT. Copyright (c) 2010 by Xinghua Lou.
*
* This software was developed by Xinghua Lou.
* Enquiries shall be directed to: xinghua.lou@iwr.uni-heidelberg.de.
*
* All advertising materials mentioning features or use of this software must
* display the following acknowledgement: ``This product includes the BOT
* library developed by Xinghua Lou. Please direct enquiries concerning BOT to
* xinghua.lou@iwr.uni-heidelberg.de.
*
* 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.
* - All advertising materials mentioning features or use of this software must
* display the following acknowledgement: ``This product includes the BOT
* library developed by Xinghua Lou. Please direct enquiries concerning BOT to
* xinghua.lou@iwr.uni-heidelberg.de.
* - The names of the authors must not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef __CPLEX_SOLVER_SYSTEM_HXX__
#define __CPLEX_SOLVER_SYSTEM_HXX__
#include "TypeDefinition.hxx"
#include "SolverSystem.hxx"
#include "vigra/matrix.hxx"
#include <ilcplex/ilocplex.h>
ILOSTLBEGIN
using namespace vigra::linalg;
namespace bot
{
/*! A class that solves ILP/QP problems using CPLEX
*
*/
class CPLEXSolverSystem : public SolverSystem
{
public:
/*! Default constructor, initialize the concert environment
*
*/
CPLEXSolverSystem()
{
env.setOut(env.getNullStream());
};
/*! Destructor, end the concert environment
*
*/
~CPLEXSolverSystem()
{
env.end();
};
/*! Setup the binary ilp objective function
* @param f The coefficients of the objective function
* @param vars The random variables
* @param model The model where the optimization problem will be added
*/
void setup_lp_objective(
const Matrix2D& f,
const IloNumVarArray& vars,
IloModel& model) const
{
IloObjective objective(env);
for (int32 elem = 0; elem < f.size(); elem ++)
objective.setLinearCoef(vars[elem], static_cast<IloNum >(f[elem]));
model.add(objective);
};
/*! Extract the solution
* @param cplex The CPLEX solver object
* @param vars The random variables
* @return x The solution as a matrix
*/
void extract_solution(
const IloCplex& cplex,
const IloNumVarArray& vars,
Matrix2D& x) const
{
IloNumArray vals(env);
cplex.getValues(vals, vars);
x.reshape(Shape2D(vals.getSize(), 1), static_cast<MatrixElem >(0));
for (int32 ind = 0; ind < vals.getSize(); ind ++)
x[ind] = static_cast<MatrixElem >(vals[ind]);
};
/*! Setup linear constraints, i.e.
* lb <= Ax <= ub
* @param A The constraint matrix
* @param lb The lower bound
* @param up The upper bound
* @param vars The random variables
* @param model The cplex optimziation model
*/
void setup_linear_constraints(
const Matrix2D& A, const Matrix2D& lb, const Matrix2D& ub,
const IloNumVarArray& vars, IloModel& model) const
{
if (A.size() == 0)
return ;
IloRangeArray constraints(env);
// add constraints one by one
for (int32 row = 0; row < A.shape(0); row ++) {
// set the coefficients
IloRange constraint(env, -IloInfinity, IloInfinity);
for (int32 col = 0; col < A.shape(1); col ++) {
if (A(row, col) == 0)
continue;
constraint.setLinearCoef(vars[col], static_cast<IloNum >(A(row, col)));
}
// add bounds
if (lb.shape(0) == A.shape(0))
constraint.setLB(lb(row, 0));
if (ub.shape(0) == A.shape(0))
constraint.setUB(ub(row, 0));
// add to the constraint array
constraints.add(constraint);
}
model.add(constraints);
};
/*! Solve a binary integer linear programminig (binary ilp) problem with
* given equality and inequality constraints. In particular, it solves
* a problem as follows:
* max f'*x
* s.t. Aineq*x <= bineq
* Aeq*x = beq
* each variable in x is binary
* @param f The coefficient of the objective function
* @param Aineq The inequality constraints: Aineq * x <= bineq
* @param bineq The inequality constraints: Aineq * x <= bineq
* @param Aeq The equality constraints: Aineq * x = bineq
* @param beq The equality constraints: Aineq * x = bineq
* @param x0 The initial solution
* @param x The solution
* @param msg The return message
*/
std::string solve_bilp(
const Matrix2D& f,
const Matrix2D& Aineq, const Matrix2D& bineq,
const Matrix2D& Aeq, const Matrix2D& beq,
const Matrix2D& x0,
Matrix2D& x) const
{
std::string msg("Error occured during cplex problem formulation");
try {
// create the model and the random variables
IloModel model(env);
IloNumVarArray vars(env, f.size(), 0, 1, ILOINT);
// add the constraints
Matrix2D lb;
setup_linear_constraints(Aineq, lb, bineq, vars, model); // inequality
setup_linear_constraints(Aeq, beq, beq, vars, model); // equality
// add the objective functions
setup_lp_objective(f, vars, model);
// call cplex to solve it
IloCplex cplex(model);
cplex.solve();
// get cplex status
if (cplex.getStatus() == IloAlgorithm::Optimal)
msg = "Optimal solution obtained";
else {
msg = "*Warning* Fail to obtain the optimal solution";
std::cout << "cplex.getStatus() gives: " << cplex.getStatus() << std::endl;
}
// extract the solution
extract_solution(cplex, vars, x);
}
catch (IloException& e) {
msg = "*Warning* Concert exception caught: ";
}
catch (...) {
msg = "*Warning* Unknown exception caught";
}
return msg;
};
/*! Setup the quadratic programming objective function
* @param H The coefficients of the quadratic objective
* @param f The coefficients of the linear objective
* @param vars The random variables
* @param model The model where the optimization problem will be added
*/
void setup_qp_objective(
const Matrix2D& H, const Matrix2D& f,
const IloNumVarArray& vars,
IloModel& model) const
{
IloNumExpr expr(env);
// add the quadratic terms
for (int32 row = 0; row < H.shape(0); row ++) {
for (int32 col = row; col < H.shape(1); col ++) {
MatrixElem h = H(row, col);
if (h == 0)
continue ;
if (col == row)
expr = expr + static_cast<IloNum >(0.5*h)*vars[row]*vars[row];
else
expr = expr + static_cast<IloNum >(h)*vars[row]*vars[col];
}
}
// add the linear terms
for (int32 elem = 0; elem < f.size(); elem ++) {
if (f[elem] == 0)
continue;
expr = expr + static_cast<IloNum >(f[elem])*vars[elem];
}
// add to the model
model.add(IloObjective(env, expr));
};
/*! Setup the bounds
* @param vars The array of random variables
* @param lb A Matrix2D object that contains the lower bounds
* @param ub A Matrix2D object that contains the upper bounds
*/
void setup_bounds(
IloNumVarArray& vars,
const Matrix2D& lb, const Matrix2D& ub) const
{
// set the lower bounds
IloNumArray lbAry(env, vars.getSize());
for (int32 ind = 0; ind < lbAry.getSize(); ind ++)
lbAry[ind] = lb.size() == 0 ? -IloInfinity : lb[ind];
// set the upper bounds
IloNumArray ubAry(env, vars.getSize());
for (int32 ind = 0; ind < ubAry.getSize(); ind ++)
ubAry[ind] = ub.size() == 0 ? IloInfinity : ub[ind];
vars.setBounds(lbAry, ubAry);
};
/*! Solve a quadaratic programminig (qp) problem with given equality and
* inequality constraints and bounds. In particular, it solve:
* min 0.5*x'*H*x+f*x
* st. Aineq*x <= bineq
* Aeq*x = beq
* lb <= x <= ub
* @param H Double matrix for objective function (quadratic term)
* @param f Double matrix (vector) for objective function (linear term)
* @param Aineq The inequality constraints: Aineq * x <= bineq
* @param bineq The inequality constraints: Aineq * x <= bineq
* @param Aeq The equality constraints: Aineq * x = bineq
* @param beq The equality constraints: Aineq * x = bineq
* @param lb The lower bound
* @param ub The upper bound
* @param x0 The initial solution
* @param x The solution
* @return A std::string as the message of the solution status
*/
std::string solve_qp(
const Matrix2D& H, const Matrix2D& f,
const Matrix2D& Aineq, const Matrix2D& bineq,
const Matrix2D& Aeq, const Matrix2D& beq,
const Matrix2D& lb, const Matrix2D& ub,
const Matrix2D& x0, Matrix2D& x) const
{
std::string msg("Error occured during cplex problem formulation");
try {
// create the model and the random variables
IloModel model(env);
IloNumVarArray vars(env, f.size(), -IloInfinity, IloInfinity, ILOFLOAT);
setup_bounds(vars, lb, ub);
// add the constraints
Matrix2D empty_matrix;
setup_linear_constraints(Aineq, empty_matrix, bineq, vars, model); // inequality
setup_linear_constraints(Aeq, beq, beq, vars, model); // equality
// add the objective functions
setup_qp_objective(H, f, vars, model);
// call cplex to solve it
IloCplex cplex(model);
cplex.solve();
if (cplex.getStatus() == IloAlgorithm::Optimal)
msg = "Optimal solution obtained";
else {
msg = "*Warning* Fail to obtain the optimal solution";
std::cout << "cplex.getStatus() gives: " << cplex.getStatus() << std::endl;
}
extract_solution(cplex, vars, x);
}
catch (IloException& e) {
msg = "*Warning* Concert exception caught: ";
}
catch (...) {
msg = "*Warning* Unknown exception caught";
}
return msg;
};
private:
IloEnv env;
};
}
#endif /* __CPLEX_SOLVER_SYSTEM_HXX__ */
| [
"xinghua.lou@gmail.com"
] | xinghua.lou@gmail.com |
d57c75893dde1d3a683a6f392ccd85034ab4bc78 | ff3400d81a40796903a8e228c42181b3db4c5c84 | /domains/cpp/Introduction/arrays-introduction.cpp | 28999270c5e3f8bf8913fc00685988edf537ea00 | [] | no_license | redaced/hackerrank | 860556600dabee9337edee3942b21c5c7b68c6d0 | 70e325e7235f4d2e8642edd96b47996ffbc1570f | refs/heads/master | 2020-04-15T13:38:06.807068 | 2019-06-07T08:43:33 | 2019-06-07T08:43:33 | 59,559,128 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 333 | cpp | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
int a[n];
for (int i = 0; i < n; i++){
cin >> a[i];
}
for (int i = n-1; i >= 0; i--){
cout << a[i] << " ";
}
return 0;
} | [
"redaced@yahoo.com"
] | redaced@yahoo.com |
4e39177f37b737b2d78f21ee5a38c5466ea42a94 | df889323b01f408e0949b2592e2ef35371e67bac | /CS32/Homeworks/Homework1/Homework1Final/newMap.h | f73dc8425808129c809896e3e1503e6ffbea6e5b | [] | no_license | thenathanyang/UCLA | 0c750744b5bf283e16abac904a110850efab7fef | fc7781361c93370b80a265615189253995693070 | refs/heads/master | 2021-09-08T07:35:48.921714 | 2021-09-02T02:07:56 | 2021-09-02T02:14:01 | 57,343,142 | 1 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 3,328 | h | // newMapp.h
#ifndef NEWMAP_INCLUDED
#define NEWMAP_INCLUDED
#include <string>
typedef std::string KeyType;
typedef double ValueType;
const int DEFAULT_MAX_ITEMS = 200;
class Map
{
public:
Map(int arraySize = DEFAULT_MAX_ITEMS); // Create an empty map (i.e., one with no key/value pairs)
~Map(); // Destructor
Map(const Map& other); // Copy constructor
Map& operator=(const Map& rhs); // Assignment operator
bool empty() const; // Return true if the map is empty, otherwise false.
int size() const; // Return the number of key/value pairs in the map.
bool insert(const KeyType& key, const ValueType& value);
// If key is not equal to any key currently in the map, and if the
// key/value pair can be added to the map, then do so and return true.
// Otherwise, make no change to the map and return false (indicating
// that either the key is already in the map, or the map has a fixed
// capacity and is full).
bool update(const KeyType& key, const ValueType& value);
// If key is equal to a key currently in the map, then make that key no
// longer map to the value it currently maps to, but instead map to
// the value of the second parameter; return true in this case.
// Otherwise, make no change to the map and return false.
bool insertOrUpdate(const KeyType& key, const ValueType& value);
// If key is equal to a key currently in the map, then make that key no
// longer map to the value it currently maps to, but instead map to
// the value of the second parameter; return true in this case.
// If key is not equal to any key currently in the map and if the
// key/value pair can be added to the map, then do so and return true.
// Otherwise, make no change to the map and return false (indicating
// that the key is not already in the map and the map has a fixed
// capacity and is full).
bool erase(const KeyType& key);
// If key is equal to a key currently in the map, remove the key/value
// pair with that key from the map and return true. Otherwise, make
// no change to the map and return false.
bool contains(const KeyType& key) const;
// Return true if key is equal to a key currently in the map, otherwise
// false.
bool get(const KeyType& key, ValueType& value) const; // WHY CONST?!?!
// If key is equal to a key currently in the map, set value to the
// value in the map that that key maps to, and return true. Otherwise,
// make no change to the value parameter of this function and return
// false.
bool get(int i, KeyType& key, ValueType& value) const;
// If 0 <= i < size(), copy into the key and value parameters the
// key and value of one of the key/value pairs in the map and return
// true. Otherwise, leave the key and value parameters unchanged and
// return false. (See below for details about this function.)
void swap(Map& other);
// Exchange the contents of this map with the other one.
private:
struct mapPair
{
KeyType key;
ValueType value;
};
mapPair* m_pair;
int m_pairCounter;
int m_arraySize;
};
#endif // NEWMAP_INCLUDED
| [
"thenathanyang@gmail.com"
] | thenathanyang@gmail.com |
3f9ca6ce0466046287e2ded2afc0d06f7dd2fd66 | a81ef0380fbaee53abe0854c630b87146c5f0005 | /ios/UnityLibrary/Classes/Native/UnityEngine.UIModule.cpp | 03809d04e2bbe01e419ef8a6e07bc39db769ca37 | [] | no_license | soundring/flutter_ar_sample | 40658eb4949d09f340d8690574bd93e8daf5b4e9 | 51e77195d8abc5006cdd27f71fc54794cd79d63e | refs/heads/master | 2023-07-31T09:36:34.106749 | 2021-09-12T09:57:07 | 2021-09-12T09:59:40 | 405,570,101 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 131 | cpp | version https://git-lfs.github.com/spec/v1
oid sha256:fe31f66bb6ebc38a5ddebd54efd11607bee55d13279ac6e6bbf403cd90d20a28
size 201517
| [
"soundringing@yahoo.co.jp"
] | soundringing@yahoo.co.jp |
917fe5cceeb8c697c56b03813a46d6fe1c650f8c | 02aeba135a05ccfecf79eea6d44cb87547203f12 | /01_C语言/04_EP45.cpp | a441a066b1860a0735c08aedcdab6b1c2bf9776a | [] | no_license | happiless/DataStrcture_And_Algorithm | ce1bc590c58d352e06bc3b1ab6d4606e4762a688 | aea3bf33481b6e1b63cb44190a53b5fd3889b99a | refs/heads/main | 2023-04-02T06:35:25.114686 | 2021-04-09T05:36:02 | 2021-04-09T05:36:02 | 342,106,642 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,063 | cpp | /*************************************************************************
> File Name: 04_EP45.cpp
> Author: ma6174
> Mail: ma6174@163.com
> Created Time: Tue 09 Mar 2021 04:42:03 PM CST
************************************************************************/
#include<iostream>
#include<stdio.h>
using namespace std;
long long Triangle (long long n) {
return n * (n + 1) >> 1;
}
long long Pentagonal (long long n) {
return n * (3 * n - 1) >> 1;
}
long long Heaxgonal (long long n) {
return n * (2 * n -1);
}
long long binary_search (long long (*arr)(long long), long long n, long long x) {
long long head = 1, tail = n, mid;
while (head <= tail) {
mid = (head + tail) >> 1;
if (arr(mid) == x) return mid;
if (arr(mid) < x) head = mid + 1;
else tail = mid - 1;
}
return -1;
}
int main() {
long long n = 143;
while (1) {
n++;
long long temp = Heaxgonal(n);
if (binary_search(Triangle, temp, temp) == -1) continue;
if (binary_search(Pentagonal, temp, temp) == -1) continue;
printf("%lld\n", temp);
break;
}
return 0;
}
| [
"1484212228@qq.com"
] | 1484212228@qq.com |
534db7a606d939c07d136373d1c76a6bf32a7cc9 | f96e122d57404f4131e705be7a974c8886067d94 | /include/VertexColoring/Coloring.h | 5514860091755cbefc12571740963b0314a181bf | [] | no_license | zeta1999/QuantumAnnealing | c4f078a0f9a85d4bd73b0b23fbe531c6ea773d96 | 7a4e33e97fc5c6585f4b5fae6e99dfe2a7f5f2e1 | refs/heads/master | 2021-05-28T20:31:36.037960 | 2015-08-06T20:24:31 | 2015-08-06T20:24:31 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,742 | h | #ifndef COLORING_H
#define COLORING_H
#include "Solver/State.h"
#include "VertexColoring/Graph.h"
#include <random>
#include <algorithm>
#include "VertexColoring/VertexElementaryMutation.h"
class Coloring : public State
{
public:
Coloring(Graph &g, int colors);
virtual ~Coloring();
void initStart(pcg32 &rng);
void updateLocal(int vertex, int previousColor);
int spin(int vertex, int vertex2) const;
int getNumberOfEdgesInConflict() const { return edgesInConflict;};
int getMaxColors() const {return maxColors;};
void affectColor(int vertex, int color) {coloring[vertex] = color;};
bool goodColoring() const;
std::vector<std::vector<int>> colorClasses; //Color classes vectors are sorted
///Unordered set of vertices in conflict. There are no duplicates due to the nature of the data structure.
std::vector<int> verticesInConflict; //Vertices in conflict vector is sorted
std::vector<std::vector<int>> F;
std::vector<int> coloring;
std::vector<int> bestColoring;
private:
Graph& graph;
int maxColors;
int edgesInConflict;
bool inConflict(int vertex) const;
void saveColoring();
};
template <typename Vector, typename T>
static void eraseSorted(Vector &vec, T value)
{
auto pr = std::equal_range(std::begin(vec), std::end(vec), value);
vec.erase(pr.first, pr.second);
}
template <typename Vector, typename T>
static void insertSorted(Vector &vec, T value){
typename Vector::iterator i = std::lower_bound( std::begin(vec), std::end(vec), value );
if (i == std::end(vec) || value < *i){
vec.insert(i, value);
}
}
#endif // COLORING_H
| [
"fabien.dufoulon@supelec.fr"
] | fabien.dufoulon@supelec.fr |
b56a577dc1a59b55e88f0ab05d741eb433e908ae | 711e5c8b643dd2a93fbcbada982d7ad489fb0169 | /XPSP1/NT/inetsrv/iis/config/src/stores/fixedtable/sdtfxd.h | 13267c2a6e8ad23682bcbe291299d299fbbb21c4 | [] | no_license | aurantst/windows-XP-SP1 | 629a7763c082fd04d3b881e0d32a1cfbd523b5ce | d521b6360fcff4294ae6c5651c539f1b9a6cbb49 | refs/heads/master | 2023-03-21T01:08:39.870106 | 2020-09-28T08:10:11 | 2020-09-28T08:10:11 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 7,981 | h | // Copyright (C) 1999-2001 Microsoft Corporation. All rights reserved.
#ifndef __SDTFXD_H_
#define __SDTFXD_H_
#include "catalog.h"
#include "sdtfxd_data.h"
#include "utsem.h"
#ifndef __TFILEMAPPING_H__
#include "TFileMapping.h"
#endif
// ------------------------------------------------------------------
// class CSDTFxd:
// ------------------------------------------------------------------
class CSDTFxd :
public ISimpleTableInterceptor,
public ISimpleTableRead2,
public ISimpleTableAdvanced
{
public:
CSDTFxd ();
~CSDTFxd ();
// -----------------------------------------
// IUnknown, IClassFactory, ISimpleLogicTableDispenser:
// -----------------------------------------
//IUnknown
public:
STDMETHOD (QueryInterface) (REFIID riid, OUT void **ppv);
STDMETHOD_(ULONG,AddRef) ();
STDMETHOD_(ULONG,Release) ();
//ISimpleDataTableDispenser
public:
STDMETHOD(Intercept) (
LPCWSTR i_wszDatabase,
LPCWSTR i_wszTable,
ULONG i_TableID,
LPVOID i_QueryData,
LPVOID i_QueryMeta,
DWORD i_eQueryFormat,
DWORD i_fTable,
IAdvancedTableDispenser* i_pISTDisp,
LPCWSTR i_wszLocator,
LPVOID i_pSimpleTable,
LPVOID* o_ppv
);
// -----------------------------------------
// ISimpleTable*:
// -----------------------------------------
//ISimpleTableRead2
public:
STDMETHOD (GetRowIndexByIdentity) (ULONG * i_cb, LPVOID * i_pv, ULONG* o_piRow);
STDMETHOD (GetRowIndexBySearch) (ULONG i_iStartingRow, ULONG i_cColumns, ULONG* i_aiColumns, ULONG* i_acbSizes, LPVOID* i_apvValues, ULONG* o_piRow);
STDMETHOD (GetColumnValues) (ULONG i_iRow, ULONG i_cColumns, ULONG* i_aiColumns, ULONG* o_acbSizes, LPVOID* o_apvValues);
STDMETHOD (GetTableMeta) (ULONG *o_pcVersion, DWORD * o_pfTable, ULONG * o_pcRows, ULONG * o_pcColumns );
STDMETHOD (GetColumnMetas) (ULONG i_cColumns, ULONG* i_aiColumns, SimpleColumnMeta* o_aColumnMetas);
//ISimpleTableAdvanced
public:
STDMETHOD (PopulateCache) ();
STDMETHOD (GetDetailedErrorCount) (ULONG* o_pcErrs);
STDMETHOD (GetDetailedError) (ULONG i_iErr, STErr* o_pSTErr);
// -----------------------------------------
// Member variables:
// -----------------------------------------
private:
bool m_bDidMeta;
unsigned long m_cColumns; // This duplicate to m_pTableMeta->CountOfColumns eliminate a bunch of UI4FromIndexs
unsigned long m_cColumnsPlusPrivate; // Since this information is needed all over the place, we have this to eliminate an 'add'.
unsigned long m_cIndexMeta;
unsigned long m_ciRows;
ULONG m_cPrimaryKeys; // This is the number of promary keys there are in the table.
ULONG m_cRef; // Interface reference count.
DWORD m_fIsTable; // Either component is posing as class factory / dispenser or table.
ULONG m_iZerothRow; // When a query is executed, the consumer's 0th row, is m_iZerothRow. All Rows must be between 0 & m_ciRows
const ColumnMeta * m_pColumnMeta; // Pointer to the ColumnMeta
const void * m_pFixedTableUnqueried; // We need to keep this around since, hash indexes refer to the row from the beginning of the table.
const void * m_pFixedTable;
const HashedIndex * m_pHashedIndex;
const HashTableHeader * m_pHashTableHeader;
const IndexMeta * m_pIndexMeta; // Pointer to the first IndexMeta row for this table & index named in the query.
const TableMeta * m_pTableMeta; // Pointer to the TableMeta, part of this meta is the pointer to the actual data (if exists as FIXED table).
TFileMapping m_FixedTableHeapFile; // If the Meta comes from a file, this object maps a view of the file.
const FixedTableHeap * m_pFixedTableHeap; // This can either be a pointer to g_pFixedTableHeap or one that we generate for extensible schema
static const LPWSTR wszCoreMetaFile; // hardcoded name of the file that contains the meta for the meta
static const LPWSTR wszMachineCfgFile;
HRESULT GetPointersToHeapMetaStructures(ISimpleTableDispenser2 * pISTDisp);
HRESULT GetColumnMetaQuery( const STQueryCell *pQueryCell, unsigned long cQueryCells, LPCWSTR &wszTable, unsigned long &iOrder) const;
HRESULT GetColumnMetaTable( STQueryCell * pQueryCell, unsigned long cQueryCells);
HRESULT GetDatabaseMetaQuery(const STQueryCell *pQueryCell, unsigned long cQueryCells, LPCWSTR &wszDatabase) const;
HRESULT GetDatabaseMetaTable(STQueryCell * pQueryCell, unsigned long cQueryCells);
HRESULT GetIndexMeta( const STQueryCell *pQueryCell, unsigned long cQueryCells);
HRESULT GetIndexMetaQuery( const STQueryCell *pQueryCell, unsigned long cQueryCells, LPCWSTR &wszTable, LPCWSTR &InternalName, unsigned long &iOrder) const;
HRESULT GetIndexMetaTable( STQueryCell * pQueryCell, unsigned long cQueryCells);
HRESULT GetQueryMetaQuery( const STQueryCell *pQueryCell, unsigned long cQueryCells, LPCWSTR &wszTable, LPCWSTR &wszInternalName, LPCWSTR &wszCellName) const;
HRESULT GetQueryMetaTable( STQueryCell * pQueryCell, unsigned long cQueryCells);
HRESULT GetRelationMetaQuery(const STQueryCell *pQueryCell, unsigned long cQueryCells, LPCWSTR &wszTablePrimary, LPCWSTR &TableForeign) const;
HRESULT GetRelationMetaTable(STQueryCell * pQueryCell, unsigned long cQueryCells);
HRESULT GetTableMetaQuery( const STQueryCell *pQueryCell, unsigned long cQueryCells, LPCWSTR &wszDatabase, LPCWSTR &wszTable) const;
HRESULT GetTableMetaTable( STQueryCell * pQueryCell, unsigned long cQueryCells);
HRESULT GetTagMetaQuery( const STQueryCell *pQueryCell, unsigned long cQueryCells, LPCWSTR &wszTable, unsigned long &iOrder, LPCWSTR &PublicName) const;
HRESULT GetTagMetaTable( STQueryCell * pQueryCell, unsigned long cQueryCells);
inline int StringInsensitiveCompare(LPCWSTR sz1, LPCWSTR sz2) const
{
if(sz1 == sz2 || 0 == wcscmp(sz1, sz2))//try case sensitive compare first
return 0;
return _wcsicmp(sz1, sz2);
}
inline int StringCompare(LPCWSTR sz1, LPCWSTR sz2) const
{
if(sz1 == sz2)
return 0;
if(*sz1 != *sz2)//check the first character before calling wcscmp
return -1;
return wcscmp(sz1, sz2);
}
inline bool IsStringFromPool(LPCWSTR sz) const
{
return (reinterpret_cast<const unsigned char *>(sz) > m_pFixedTableHeap->Get_PooledDataHeap() && reinterpret_cast<const unsigned char *>(sz) < m_pFixedTableHeap->Get_PooledDataHeap()+m_pFixedTableHeap->Get_cbPooledHeap());
}
};
#endif //__SDTFXD_H_
| [
"112426112@qq.com"
] | 112426112@qq.com |
87c074a68f8f01a926449fae889ed4ba8553ba3a | 13f67a8813233b162c687207649c0252e95d0455 | /tonic-suite/asr/src/bin/sum-mllt-accs.cc | d722930cef481525901270311b28845dbb5a50b4 | [
"BSD-3-Clause"
] | permissive | jhauswald/djinn | 19010e7ee604f756a82bde4c99a2418e463633a1 | f5e4d4a22c9c3c1561846c87a9cb25f77e470dcb | refs/heads/master | 2021-01-12T21:38:03.599604 | 2015-08-19T15:59:37 | 2015-08-19T15:59:37 | 37,376,692 | 1 | 1 | null | 2015-06-13T15:31:20 | 2015-06-13T15:31:19 | null | UTF-8 | C++ | false | false | 1,758 | cc | // bin/sum-mllt.cc
// Copyright 2014 LINSE/UFSC; Augusto Henrique Hentz
// See ../../COPYING for clarification regarding multiple authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
// WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
// MERCHANTABLITY OR NON-INFRINGEMENT.
// See the Apache 2 License for the specific language governing permissions and
// limitations under the License.
#include "util/common-utils.h"
#include "transform/mllt.h"
int main(int argc, char *argv[]) {
try {
using namespace kaldi;
typedef kaldi::int32 int32;
const char *usage =
"Sum stats obtained with gmm-acc-mllt.\n"
"Usage: sum-mllt-accs [options] <stats-out> <stats-in1> <stats-in2> "
"...\n";
bool binary = true;
ParseOptions po(usage);
po.Register("binary", &binary, "Write accumulators in binary mode.");
po.Read(argc, argv);
if (po.NumArgs() < 2) {
po.PrintUsage();
exit(1);
}
MlltAccs mllt_accs;
std::string stats_out_filename = po.GetArg(1);
for (int32 i = 2; i <= po.NumArgs(); i++) {
bool binary_in, add = true;
Input ki(po.GetArg(i), &binary_in);
mllt_accs.Read(ki.Stream(), binary_in, add);
}
Output ko(stats_out_filename, binary);
mllt_accs.Write(ko.Stream(), binary);
return 0;
} catch (const std::exception &e) {
std::cerr << e.what();
return -1;
}
}
| [
"ypkang@umich.edu"
] | ypkang@umich.edu |
735927e14743b84db9d9b5b4d490fed9a8a72db2 | 8b491a0ae78a5aadda660aae7e9207394fa362a8 | /UVa 514 - Rails/src/UVa 514 - Rails.cpp | e8ec826c95548e66ab9609bf55c1082ec8b44d56 | [] | no_license | GIMPS/UVa-Solutions | 77dfba09a534ce64dcee58ff6e4bbd99582c875c | 4ec248126c86a24d723ed556a796ba507ccbbb5c | refs/heads/master | 2021-01-23T05:29:53.942348 | 2013-04-11T10:48:58 | 2013-04-11T10:48:58 | 86,313,322 | 0 | 1 | null | 2017-03-27T08:57:52 | 2017-03-27T08:57:52 | null | UTF-8 | C++ | false | false | 692 | cpp | #include <iostream>
#include <stack>
using namespace std;
int main() {
int n, target[1000];
int i;
while (true) {
cin >> n;
if (n == 0)
break;
while (true) {
cin >> target[0];
if (target[0] == 0){
cout << endl;
break;
}
for (i = 1; i < n; i++) {
cin >> target[i];
}
int currCoach = 1, targetIndex = 0;
stack<int> station;
while(currCoach<=n){
station.push(currCoach);
while(!station.empty() && station.top() == target[targetIndex]){
station.pop();
targetIndex++;
if(targetIndex>=n) break;
}
currCoach++;
}
if(station.empty()) cout << "Yes" << endl;
else cout << "No" << endl;
}
}
return 0;
}
| [
"arnold.koroa@gmail.com"
] | arnold.koroa@gmail.com |
bc52183fdfea6155adb81dbc5df29a01849bf602 | 7af7bebd6e3eff10ab73f7d88f872101d11df150 | /mainwindow.cxx | 1eb83d1a014326ea46af2c53bf34f18a0b864a84 | [] | no_license | stoyan-shopov/cdctest | 3a13354b70eddf25cdc2936b835266d89410aa97 | 39271014df6f1b4913853a4b0947be79af819725 | refs/heads/master | 2023-01-04T06:52:15.788878 | 2020-07-15T09:18:14 | 2020-10-30T15:03:17 | 279,819,383 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,331 | cxx | #include "mainwindow.hxx"
#include "ui_mainwindow.h"
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
, ui(new Ui::MainWindow)
{
ui->setupUi(this);
connect(ui->pushButtonScanPorts, SIGNAL(clicked(bool)), this, SLOT(scanPorts()));
connect(ui->pushButtonStartTest, SIGNAL(clicked(bool)), this, SLOT(startTest()));
connect(ui->pushButtonEndTest, SIGNAL(clicked(bool)), this, SLOT(endTest()));
connect(ui->pushButtonPrintStatistics, SIGNAL(clicked(bool)), this, SLOT(printStatistics()));
connect(ui->pushButtonScanPorts, SIGNAL(clicked(bool)), this, SLOT(scanPorts()));
ui->pushButtonStartTest->setEnabled(true);
ui->pushButtonEndTest->setEnabled(false);
ui->pushButtonPrintStatistics->setEnabled(false);
ui->pushButtonScanPorts->setEnabled(true);
ui->comboBoxAvailablePorts->setEnabled(true);
scanPorts();
connect(& port, SIGNAL(readyRead()), this, SLOT(portReadyRead()));
connect(& port, SIGNAL(errorOccurred(QSerialPort::SerialPortError)), this, SLOT(portError(QSerialPort::SerialPortError)));
}
MainWindow::~MainWindow()
{
delete ui;
}
void MainWindow::startTest()
{
if (!ui->comboBoxAvailablePorts->currentText().size())
{
ui->plainTextEdit->appendPlainText("No port selected");
return;
}
port.setPortName(ui->comboBoxAvailablePorts->currentText());
if (!port.open(QSerialPort::ReadWrite))
{
ui->plainTextEdit->appendPlainText("Failed to open serial port: " + port.errorString());
return;
}
ui->plainTextEdit->appendPlainText("Test started");
ui->pushButtonStartTest->setEnabled(false);
ui->pushButtonEndTest->setEnabled(true);
ui->pushButtonPrintStatistics->setEnabled(true);
ui->pushButtonScanPorts->setEnabled(false);
ui->comboBoxAvailablePorts->setEnabled(false);
timer.start();
data.clear();
xdata.clear();
total_count = xcount = 0;
for (int i = 0; i < PACKET_PRELOAD_COUNT; i ++)
{
QByteArray d = QByteArray(USB_BLOCK_SIZE, dataChar);
data += d;
dataChar ++;
if (dataChar == 'z')
dataChar = 'a';
else
dataChar ++;
if (port.write(d) == -1)
{
ui->plainTextEdit->appendPlainText("Error writing data");
endTest();
return;
}
}
}
void MainWindow::portReadyRead()
{
xdata += port.readAll();
if (!(data.startsWith(xdata)))
{
ui->plainTextEdit->appendPlainText(QString("Data loopback mismatch, bytes transferred: %1").arg(total_count));
port.close();
endTest();
return;
}
while (xdata.size() >= USB_BLOCK_SIZE)
{
xdata = xdata.remove(0, USB_BLOCK_SIZE);
data = data.remove(0, USB_BLOCK_SIZE);
if (dataChar == 'z')
dataChar = 'a';
else
dataChar ++;
QByteArray d = QByteArray(USB_BLOCK_SIZE, dataChar);
data += d;
if (port.write(d) == -1)
{
ui->plainTextEdit->appendPlainText("Error writing data");
endTest();
return;
}
total_count += USB_BLOCK_SIZE;
}
if (total_count >= (xcount + 1) * 10 * 1024 * 1024)
{
xcount = total_count / (10 * 1024 * 1024);
ui->plainTextEdit->appendPlainText(QString("%1 megabytes transferred").arg(xcount * 10));
}
}
void MainWindow::portError(QSerialPort::SerialPortError error)
{
if (isHandlingError || error == QSerialPort::NoError)
return;
isHandlingError = true;
ui->plainTextEdit->appendPlainText(QString("Error occurred, code: %1").arg(error));
endTest();
isHandlingError = false;
}
void MainWindow::endTest()
{
port.close();
printStatistics();
ui->plainTextEdit->appendPlainText("\nEnd of test.");
ui->pushButtonStartTest->setEnabled(true);
ui->pushButtonEndTest->setEnabled(false);
ui->pushButtonPrintStatistics->setEnabled(false);
ui->pushButtonScanPorts->setEnabled(true);
ui->comboBoxAvailablePorts->setEnabled(true);
}
void MainWindow::printStatistics()
{
ui->plainTextEdit->appendPlainText(QString("Checkpoint, bytes transferred: %1 in %2 seconds").arg(total_count).arg(timer.elapsed() / 1000));
ui->plainTextEdit->appendPlainText(QString("Average speed %1 bytes/s").arg(((double) total_count * 1000) / (double) timer.elapsed()));
}
void MainWindow::scanPorts()
{
QList<QSerialPortInfo> ports = QSerialPortInfo::availablePorts();
ui->comboBoxAvailablePorts->clear();
for (const auto & p : ports)
ui->comboBoxAvailablePorts->addItem(p.portName());
}
| [
"sshopov@vmware.com"
] | sshopov@vmware.com |
44965965fcd93d52a91a76230c7cf3d3aa3b9eea | 30e1dc84fe8c54d26ef4a1aff000a83af6f612be | /src/external/boost/boost_1_68_0/libs/scope_exit/test/world_seq_nova.cpp | 0360e86b8fabc04cc4ddb916aa99ecf70ae39a26 | [
"BSD-3-Clause",
"BSL-1.0"
] | permissive | Sitispeaks/turicreate | 0bda7c21ee97f5ae7dc09502f6a72abcb729536d | d42280b16cb466a608e7e723d8edfbe5977253b6 | refs/heads/main | 2023-05-19T17:55:21.938724 | 2021-06-14T17:53:17 | 2021-06-14T17:53:17 | 385,034,849 | 1 | 0 | BSD-3-Clause | 2021-07-11T19:23:21 | 2021-07-11T19:23:20 | null | UTF-8 | C++ | false | false | 291 | cpp |
// Copyright (C) 2012 Lorenzo Caminiti
// Distributed under the Boost Software License, Version 1.0
// (see accompanying file LICENSE_1_0.txt or a copy at
// http://www.boost.org/LICENSE_1_0.txt)
// Home at http://www.boost.org/libs/scope_exit
#include "nova.hpp"
#include "world_seq.cpp"
| [
"znation@apple.com"
] | znation@apple.com |
4df0e061aa00bd8be23c2dfd2dc5b3df4f3e13ff | 9b73190670304ded6e5e019862d4d7d9e9edf7ff | /Source/Sunlit/Private/Ship.cpp | ba99044277921d3e0408e10ea8e565d5129e18cd | [] | no_license | Koo294/Sunlit | 6fc14f059149181d86392e38f62bc8c6c4fc2e6f | 51dce5c321b1308d89cd6650e8e83860ca8e6c57 | refs/heads/master | 2021-01-24T09:34:04.617463 | 2017-01-07T16:14:19 | 2017-01-07T16:14:19 | 69,301,264 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 25,637 | cpp | // Fill out your copyright notice in the Description page of Project Settings.
#include "Sunlit.h"
#include "EnergyConsumer.h"
#include "Weapon.h"
#include "Shield.h"
#include "Thruster.h"
#include "ShipController.h"
#include "ShipHUDWidget.h"
#include "ShipTargetWidget.h"
#include "Ship.h"
// Sets default values
AShip::AShip()
{
// Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it.
PrimaryActorTick.bCanEverTick = true;
ShipMesh = CreateDefaultSubobject<USkeletalMeshComponent>(TEXT("ShipMesh"));
RootComponent = ShipMesh;
ShipMesh->SetCollisionEnabled(ECollisionEnabled::QueryAndPhysics);
ShipMesh->bGenerateOverlapEvents = true;
ShieldEMainMesh = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("ShieldEMainMesh"));
ShieldEMainMesh->AttachToComponent(RootComponent, FAttachmentTransformRules(EAttachmentRule::KeepRelative, false), "hull");
ShieldEMainMesh->SetCollisionEnabled(ECollisionEnabled::NoCollision);
ShieldEMainMesh->SetRelativeRotation(FRotator(0.f, 0.f, -90.f));
ShieldKMainMesh = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("ShieldKMainMesh"));
ShieldKMainMesh->AttachToComponent(RootComponent, FAttachmentTransformRules(EAttachmentRule::KeepRelative, false), "hull");
ShieldKMainMesh->SetCollisionEnabled(ECollisionEnabled::NoCollision);
ShieldKMainMesh->SetRelativeRotation(FRotator(0.f, 0.f, -90.f));
TargetingRange = CreateDefaultSubobject<USphereComponent>(TEXT("TargetingRange"));
TargetingRange->AttachToComponent(RootComponent, FAttachmentTransformRules(EAttachmentRule::KeepRelative, false), "hull");
TargetingRange->OnComponentBeginOverlap.AddDynamic(this, &AShip::OnTargetingRangeBeginOverlap);
TargetingRange->OnComponentEndOverlap.AddDynamic(this, &AShip::OnTargetingRangeEndOverlap);
TargetingRange->SetCollisionObjectType(ECollisionChannel::ECC_GameTraceChannel1);
Camera = CreateDefaultSubobject<UCameraComponent>(TEXT("Camera"));
Camera->AttachToComponent(RootComponent, FAttachmentTransformRules(EAttachmentRule::KeepRelative, false), "hull");
Camera->SetRelativeRotation(FRotator(0.f, 0.f, -90.f));
BatteryPercent = 1.f;
BatteryChargeRate = 40.f;
BatteryCapacity = 100.f;
BatteryDrainBuffer = 0.f;
onShutdown = false;
RestartThreshold = 0.1f;
MaxYawSpeed = 90.f;
MaxPitchSpeed = 90.f;
MaxRollSpeed = 90.f;
YawAccel = 90.f;
PitchAccel = 90.f;
RollAccel = 90.f;
YawSensitivity = 2.f;
PitchSensitivity = 2.f;
RollSensitivity = 1.f;
ForwardThrustSensitivity = 1.f;
RightThrustSensitivity = 2.f;
UpThrustSensitivity = 2.f;
MaxForwardSpeed = 500.f;
BrakeThrust = 10000.f;
BrakeFalloff = 100.f;
CombatMode = false;
DecoupledMode = false;
}
void AShip::OnConstruction(const FTransform& Transform)
{
Super::OnConstruction(Transform);
}
void AShip::ConsumeBattery(float ConsumeCharge)
{
if (ConsumeCharge <= 0.f) return;
BatteryDrainBuffer += ConsumeCharge;
}
float AShip::GetBatteryCharge()
{
return BatteryPercent*BatteryCapacity;
}
// Called when the game starts or when spawned
void AShip::BeginPlay()
{
Super::BeginPlay();
ShipMesh->SetSimulatePhysics(true);
ShipMesh->SetEnableGravity(false);
//Construct loadout
if (WeaponEMainType)
{
WeaponEMain = NewObject<UWeapon>(this, WeaponEMainType);
WeaponEMain->SetShip(this);
WeaponEMain->OnUpdateEnergyLevel.AddDynamic(this, &AShip::OnWeaponEUpdateEnergyLevel);
}
if (WeaponKMainType)
{
WeaponKMain = NewObject<UWeapon>(this, WeaponKMainType);
WeaponKMain->SetShip(this);
WeaponKMain->OnUpdateEnergyLevel.AddDynamic(this, &AShip::OnWeaponKUpdateEnergyLevel);
}
if (ShieldEMainType)
{
ShieldEMain = NewObject<UShield>(this, ShieldEMainType);
ShieldEMain->SetShip(this);
ShieldEMain->OnUpdateEnergyLevel.AddDynamic(this, &AShip::OnShieldEUpdateEnergyLevel);
}
if (ShieldKMainType)
{
ShieldKMain = NewObject<UShield>(this, ShieldKMainType);
ShieldKMain->SetShip(this);
ShieldKMain->OnUpdateEnergyLevel.AddDynamic(this, &AShip::OnShieldKUpdateEnergyLevel);
}
//Construct thrusters
if (ConstructThrusters(ThrustersForward, ThrustersForwardType))
ThrustersForward[0]->OnUpdateEnergyLevel.AddDynamic(this, &AShip::OnMainEnginesUpdateEnergyLevel);
ConstructThrusters(ThrustersBackward, ThrustersBackwardType);
if (ConstructThrusters(ThrustersLeft, ThrustersLeftType))
ThrustersLeft[0]->OnUpdateEnergyLevel.AddDynamic(this, &AShip::OnEnginesUpdateEnergyLevel);
ConstructThrusters(ThrustersRight, ThrustersRightType);
ConstructThrusters(ThrustersUp, ThrustersUpType);
ConstructThrusters(ThrustersDown, ThrustersDownType);
//Dynamic mats
TArray<UMaterialInterface*> ShipMaterials = ShipMesh->GetMaterials();
for (int32 i = 0; i < MaterialIndexMain.Num(); i++)
if (MaterialIndexMain[i] < ShipMaterials.Num())
{
UMaterialInstanceDynamic* DynamicShipMaterial = UMaterialInstanceDynamic::Create(ShipMaterials[MaterialIndexMain[i]], this);
ShipMesh->SetMaterial(MaterialIndexMain[i], DynamicShipMaterial);
MaterialsMain.Add(DynamicShipMaterial);
}
if (ShieldEMain)
{
ShieldEMainMat = UMaterialInstanceDynamic::Create(ShieldEMain->ShieldMat, this);
ShieldEMainMesh->SetMaterial(0, ShieldEMainMat);
}
if (ShieldKMain)
{
ShieldKMainMat = UMaterialInstanceDynamic::Create(ShieldKMain->ShieldMat, this);
ShieldKMainMesh->SetMaterial(0, ShieldKMainMat);
}
}
bool AShip::ConstructThrusters(TArray<class UThruster*>& Thrusters, TArray<FThrusterInfo>& ThrustersType)
{
for (int32 i = 0; i < ThrustersType.Num(); i++)
{
Thrusters.Add(NewObject<UThruster>(this, ThrustersType[i].ThrusterClass));
Thrusters[i]->SetShip(this);
UParticleSystemComponent* ThrusterParticles = NewObject<UParticleSystemComponent>(this);
ThrusterParticles->RegisterComponentWithWorld(GetWorld());
AddOwnedComponent(ThrusterParticles);
ThrusterParticles->AttachToComponent(ShipMesh, FAttachmentTransformRules(EAttachmentRule::SnapToTarget, false), ThrustersType[i].ThrusterSocketName);
ThrusterParticles->Template = Thrusters[i]->ThrusterParticlesType;
ThrusterParticles->SetActive(true, true);
Thrusters[i]->SetParticleComponent(ThrusterParticles);
}
return (Thrusters.Num() > 0);
}
void AShip::SetThrustAmount(TArray<class UThruster*>& Thrusters, float Amount, float DeltaTime)
{
for (int32 i = 0; i < Thrusters.Num(); i++)
{
Thrusters[i]->Thrust(Amount, DeltaTime);
}
}
void AShip::CalculateRotationAxis(float & AxisRotation, float & AxisInput, float & AxisNewRotation, float &AxisAccel, float & AxisMaxRotation, float DeltaTime)
{
if (AxisRotation > AxisInput*AxisMaxRotation)
{
AxisNewRotation = AxisRotation - (AxisRotation < 0 ? FMath::Abs(AxisInput) : 1)*AxisAccel*DeltaTime;
if (AxisNewRotation < AxisInput*AxisMaxRotation)
{
AxisNewRotation = AxisInput*AxisMaxRotation;
}
else if (AxisNewRotation > AxisMaxRotation)
{
AxisNewRotation = AxisMaxRotation;
}
}
else if (AxisRotation < AxisInput*AxisMaxRotation)
{
AxisNewRotation = AxisRotation + (AxisRotation > 0 ? FMath::Abs(AxisInput) : 1)*AxisAccel*DeltaTime;
if (AxisNewRotation > AxisInput*AxisMaxRotation)
{
AxisNewRotation = AxisInput*AxisMaxRotation;
}
else if (AxisNewRotation < -AxisMaxRotation)
{
AxisNewRotation = -AxisMaxRotation;
}
}
}
void AShip::CalculateRotationToDeltaAxis(float & AxisRotation, float AxisDelta, float & AxisNewRotation, float & AxisAccel, float & AxisMaxRotation, float DeltaTime)
{
float DecelDistance = FMath::Square(AxisRotation) / (2*AxisAccel);
if (AxisDelta > 0.f)
{
if (AxisDelta < DecelDistance)
{
AxisNewRotation = AxisRotation*(1 - ((DecelDistance - AxisDelta) / DecelDistance));
}
else
{
if (AxisRotation > -AxisMaxRotation)
{
float AccelFalloffMult = 1.f;
if (AxisDelta < DeltaAccelFalloff)
{
AccelFalloffMult = 1 - ((DeltaAccelFalloff - AxisDelta) / DeltaAccelFalloff);
}
AxisNewRotation = AxisRotation - DeltaTime*AxisAccel*AccelFalloffMult;
}
if (AxisRotation < -AxisMaxRotation || AxisNewRotation < -AxisMaxRotation) AxisNewRotation = -AxisMaxRotation;
}
}
else if (AxisDelta < 0.f)
{
if (AxisDelta > -DecelDistance)
{
AxisNewRotation = AxisRotation*(1 - ((DecelDistance + AxisDelta) / DecelDistance));
}
else
{
if (AxisRotation < AxisMaxRotation)
{
float AccelFalloffMult = 1.f;
if (AxisDelta > -DeltaAccelFalloff)
{
AccelFalloffMult = 1 - ((DeltaAccelFalloff + AxisDelta) / DeltaAccelFalloff);
}
AxisNewRotation = AxisRotation + DeltaTime*AxisAccel*AccelFalloffMult;
}
if (AxisRotation > AxisMaxRotation || AxisNewRotation > AxisMaxRotation) AxisNewRotation = AxisMaxRotation;
}
}
}
void AShip::CalculateThrustAxis(float & AxisVelocity, float & AxisInput, float & AxisThrust, TArray<class UThruster*>& PosThrusters, TArray<class UThruster*>& NegThrusters, float DeltaTime)
{
if (AxisVelocity > AxisInput*MaxForwardSpeed)
{
SetThrustAmount(PosThrusters, 0.f, DeltaTime);
bool UsingThrusters = false;
float ThrustPercent = (AxisVelocity < 0 ? FMath::Abs(AxisInput) : 1);
AxisThrust = ThrustPercent*-CurrentThrustSum(NegThrusters);
if (AxisVelocity > 0 && AxisThrust > -BrakeThrust)
{
AxisThrust = -BrakeThrust;
SetThrustAmount(NegThrusters, 0.f, DeltaTime);
}
else UsingThrusters = true;
if (AxisVelocity < AxisInput*MaxForwardSpeed + BrakeFalloff)
{
float BrakePercent = (AxisVelocity - AxisInput*MaxForwardSpeed) / BrakeFalloff;
AxisThrust *= BrakePercent;
if (UsingThrusters) SetThrustAmount(NegThrusters, ThrustPercent*BrakePercent, DeltaTime);
}
else if (UsingThrusters) SetThrustAmount(NegThrusters, ThrustPercent, DeltaTime);
}
else if (AxisVelocity < AxisInput*MaxForwardSpeed)
{
SetThrustAmount(NegThrusters, 0.f, DeltaTime);
bool UsingThrusters = false;
float ThrustPercent = (AxisVelocity > 0 ? FMath::Abs(AxisInput) : 1);
AxisThrust = ThrustPercent*CurrentThrustSum(PosThrusters);
if (AxisVelocity < 0 && AxisThrust < BrakeThrust)
{
AxisThrust = BrakeThrust;
SetThrustAmount(PosThrusters, 0.f, DeltaTime);
}
else UsingThrusters = true;
if (AxisVelocity > AxisInput*MaxForwardSpeed - BrakeFalloff)
{
float BrakePercent = (AxisInput*MaxForwardSpeed - AxisVelocity) / BrakeFalloff;
AxisThrust *= BrakePercent;
if (UsingThrusters) SetThrustAmount(PosThrusters, ThrustPercent*BrakePercent, DeltaTime);
}
else if (UsingThrusters) SetThrustAmount(PosThrusters, ThrustPercent, DeltaTime);
}
else
{
SetThrustAmount(PosThrusters, 0.f, DeltaTime);
SetThrustAmount(NegThrusters, 0.f, DeltaTime);
}
}
// Called every frame
void AShip::Tick(float DeltaTime)
{
//ROTATION
FVector CurrentRotation = GetActorRotation().UnrotateVector(ShipMesh->GetPhysicsAngularVelocity("hull"));
FVector NewRotation = CurrentRotation;
if (CombatMode)
{
FRotator DeltaTarget = GetActorRotation().UnrotateVector(TargetShips[CombatTarget]->GetActorLocation() - GetActorLocation()).Rotation();
DeltaTarget.Normalize();
CalculateRotationToDeltaAxis(CurrentRotation.Z, -DeltaTarget.Yaw, NewRotation.Z, YawAccel, MaxYawSpeed, DeltaTime);
CalculateRotationToDeltaAxis(CurrentRotation.Y, DeltaTarget.Pitch, NewRotation.Y, PitchAccel, MaxPitchSpeed, DeltaTime);
}
else
{
CalculateRotationAxis(CurrentRotation.Z, RotationInput.Z, NewRotation.Z, YawAccel, MaxYawSpeed, DeltaTime);
CalculateRotationAxis(CurrentRotation.Y, RotationInput.Y, NewRotation.Y, PitchAccel, MaxPitchSpeed, DeltaTime);
}
CalculateRotationAxis(CurrentRotation.X, RotationInput.X, NewRotation.X, RollAccel, MaxRollSpeed, DeltaTime);
ShipMesh->SetPhysicsAngularVelocity(GetActorRotation().RotateVector(NewRotation), false, "hull");
//GEngine->AddOnScreenDebugMessage(-1, 2.f, FColor::Green, FString::Printf(TEXT("InputRotation: %f yaw, %f pitch, %f roll"), RotationInput.Z, RotationInput.Y, RotationInput.X));
//if (debugunit) GEngine->AddOnScreenDebugMessage(-1, 2.f, FColor::Red, FString::Printf(TEXT("NewRotation: %f yaw, %f pitch, %f roll"), NewRotation.Z, NewRotation.Y, NewRotation.X));
//THRUST
FVector ShipVelocity = GetActorRotation().UnrotateVector(ShipMesh->GetPhysicsLinearVelocity("hull"));
FVector ThrustForce = FVector::ZeroVector;
CalculateThrustAxis(ShipVelocity.X, ThrustInput.X, ThrustForce.X, ThrustersForward, ThrustersBackward, DeltaTime);
CalculateThrustAxis(ShipVelocity.Y, ThrustInput.Y, ThrustForce.Y, ThrustersLeft, ThrustersRight, DeltaTime);
CalculateThrustAxis(ShipVelocity.Z, ThrustInput.Z, ThrustForce.Z, ThrustersDown, ThrustersUp, DeltaTime);
ShipMesh->AddForce(GetActorRotation().RotateVector(ThrustForce), "hull");
//GEngine->AddOnScreenDebugMessage(-1, 2.f, FColor::Green, FString::Printf(TEXT("InputThrust: %f X, %f Y, %f Z"), ThrustInput.X, ThrustInput.Y, ThrustInput.Z));
//GEngine->AddOnScreenDebugMessage(-1, 2.f, FColor::Red, FString::Printf(TEXT("ShipVelocity: %f X, %f Y, %f Z"), ShipVelocity.X, ShipVelocity.Y, ShipVelocity.Z));
//GEngine->AddOnScreenDebugMessage(-1, 2.f, FColor::Green, FString::Printf(TEXT("ThrustForce: %f X, %f Y, %f Z"), ThrustForce.X, ThrustForce.Y, ThrustForce.Z));
//CAMERA
if (PlayerShipController)
{
FRotator CameraRot = FRotator(NewRotation.Z * CameraRotateMult, NewRotation.Y * CameraRotateMult, NewRotation.X * CameraRotateMult);
CameraRot = CameraRot.Add(0.f, 0.f, -90.f);
FVector CameraOff = CameraOffset;
CameraOff += FVector(-ThrustForce.X, ThrustForce.Y, ThrustForce.Z)*CameraThrustMult;
//GEngine->AddOnScreenDebugMessage(-1, 2.f, FColor::Green, FString::Printf(TEXT("CameraOffset: %f X, %f Y, %f Z"), CameraOff.X, CameraOff.Y, CameraOff.Z));
CameraThrustAverage += DeltaTime*CameraAverageEx * (CameraOff - CameraThrustAverage);
CameraOff = CameraThrustAverage;
CameraOff = CameraRot.RotateVector(CameraOff);
Camera->SetRelativeLocationAndRotation(CameraOff, CameraRot);
}
Super::Tick(DeltaTime);
//BATTERY
if (BatteryPercent < 1.f && BatteryEfficiency)
BatteryPercent += DeltaTime*BatteryEfficiency->GetFloatValue(BatteryPercent)*BatteryChargeRate / BatteryCapacity;
BatteryPercent -= BatteryDrainBuffer / BatteryCapacity;
BatteryDrainBuffer = 0.f;
if (!onShutdown && BatteryPercent < 0.f)
SystemShutdown();
if (onShutdown && BatteryPercent > RestartThreshold)
SystemRestart();
if (BatteryPercent > 1.f)
BatteryPercent = 1.f;
if (PlayerShipController)
{
PlayerShipController->GetHUD()->SetBatteryCharge(BatteryPercent);
}
//if (debugunit) GEngine->AddOnScreenDebugMessage(-1, 2.f, FColor::Red, FString::Printf(TEXT("Battery: %f"), BatteryPercent));
//HUD
if (PlayerShipController)
{
int32 ViewportX, ViewportY;
PlayerShipController->GetViewportSize(ViewportX, ViewportY);
for (int32 i = 0; i < TargetShips.Num(); i++)
{
FVector2D TargetOnScreen;
bool TargetInView = false;
if (UGameplayStatics::ProjectWorldToScreen(PlayerShipController, TargetShips[i]->GetActorLocation(), TargetOnScreen))
{
if (TargetOnScreen.X > 0.f && TargetOnScreen.X < ViewportX && TargetOnScreen.Y > 0.f && TargetOnScreen.Y < ViewportY)
{
TargetInView = true;
PlayerShipController->GetHUD()->MoveShipTarget(i, TargetOnScreen, false);
PlayerShipController->GetHUD()->GetShipTarget(i)->SetTargetInView(true);
PlayerShipController->GetHUD()->GetShipTarget(i)->SetArrowDir(0.f);
}
}
if (!TargetInView)
{
FVector ShipOffset = GetActorRotation().UnrotateVector(TargetShips[i]->GetActorLocation() - GetActorLocation());
float ShipTargetDirection;
if (ShipOffset.Y > 0)
{
if (ShipOffset.Z > 0)
{
ShipTargetDirection = FMath::Atan(ShipOffset.Z / ShipOffset.Y) + PI;
}
else if (ShipOffset.Z < 0)
{
ShipTargetDirection = FMath::Atan(ShipOffset.Y / -ShipOffset.Z) + PI/2;
}
else ShipTargetDirection = PI;
}
else if (ShipOffset.Y < 0)
{
if (ShipOffset.Z > 0)
{
ShipTargetDirection = FMath::Atan(-ShipOffset.Y / ShipOffset.Z) + 3*PI/2;
}
else if (ShipOffset.Z < 0)
{
ShipTargetDirection = FMath::Atan(-ShipOffset.Z / -ShipOffset.Y);
}
else ShipTargetDirection = 0;
}
else
{
if (ShipOffset.Z > 0)
{
ShipTargetDirection = 3*PI / 2;
}
else if (ShipOffset.Z < 0)
{
ShipTargetDirection = PI / 2;
}
else ShipTargetDirection = 0;
}
float ViewportRatio = (float)ViewportX / (float)ViewportY;
float OffsetRatio = FMath::Abs(ShipOffset.Y / ShipOffset.Z);
float ViewOffsetRatio;
if (ViewportRatio > OffsetRatio)
{
ViewOffsetRatio = FMath::Abs(((float)ViewportY / 2.f) / ShipOffset.Z);
}
else
{
ViewOffsetRatio = FMath::Abs(((float)ViewportX / 2.f) / ShipOffset.Y);
}
TargetOnScreen = FVector2D(-ShipOffset.Y, ShipOffset.Z)*ViewOffsetRatio + FVector2D((float)ViewportX/2.f, (float)ViewportY/2.f);
PlayerShipController->GetHUD()->MoveShipTarget(i, TargetOnScreen, true);
PlayerShipController->GetHUD()->GetShipTarget(i)->SetArrowDir(FMath::RadiansToDegrees(ShipTargetDirection));
PlayerShipController->GetHUD()->GetShipTarget(i)->SetTargetInView(false);
}
}
}
}
float AShip::CurrentThrustSum(const TArray<class UThruster*>& Thrusters)
{
float ThrustSum = 0;
for (int32 i = 0; i < Thrusters.Num(); i++)
{
float ThrusterLevel = Thrusters[i]->GetEnergyLevel();
ThrusterLevel = (ThrusterLevel - Thrusters[i]->ThrustThreshold) / (1 - Thrusters[i]->ThrustThreshold);
ThrusterLevel = FMath::Max(ThrusterLevel, 0.f);
ThrustSum += ThrusterLevel*Thrusters[i]->ThrustMax;
}
return ThrustSum;
}
void AShip::ShutdownConsumer(UEnergyConsumer * Consumer)
{
if (Consumer && Consumer->GetActive())
{
Consumer->SetActive(false);
ActiveShutdown.Add(Consumer);
}
}
void AShip::SystemShutdown()
{
onShutdown = true;
ShutdownConsumer(WeaponEMain);
ShutdownConsumer(WeaponKMain);
ShutdownConsumer(ShieldEMain);
ShutdownConsumer(ShieldKMain);
for (int32 i = 0; i < ThrustersBackward.Num(); i++)
ShutdownConsumer(ThrustersBackward[i]);
for (int32 i = 0; i < ThrustersForward.Num(); i++)
ShutdownConsumer(ThrustersForward[i]);
for (int32 i = 0; i < ThrustersLeft.Num(); i++)
ShutdownConsumer(ThrustersLeft[i]);
for (int32 i = 0; i < ThrustersRight.Num(); i++)
ShutdownConsumer(ThrustersRight[i]);
for (int32 i = 0; i < ThrustersUp.Num(); i++)
ShutdownConsumer(ThrustersUp[i]);
for (int32 i = 0; i < ThrustersDown.Num(); i++)
ShutdownConsumer(ThrustersDown[i]);
}
void AShip::SystemRestart()
{
onShutdown = false;
for (int32 i = 0; i < ActiveShutdown.Num(); i++)
{
ActiveShutdown[i]->SetActive(true);
}
ActiveShutdown.Empty();
}
void AShip::SetConsumerActive(UEnergyConsumer* Consumer, bool Active)
{
if (Consumer)
if (onShutdown)
if (Active)
ActiveShutdown.Add(Consumer);
else
ActiveShutdown.Remove(Consumer);
else
Consumer->SetActive(Active);
}
void AShip::SetWeaponEActive(bool Active)
{
SetConsumerActive(WeaponEMain, Active);
}
void AShip::SetWeaponKActive(bool Active)
{
SetConsumerActive(WeaponKMain, Active);
}
void AShip::SetWeaponETriggered(bool Triggered)
{
if (WeaponEMain)
WeaponEMain->SetTriggered(Triggered);
}
void AShip::SetWeaponKTriggered(bool Triggered)
{
if (WeaponKMain)
WeaponKMain->SetTriggered(Triggered);
}
void AShip::GetWeaponFireParameters(UWeapon * Weapon, FTransform & Transform, FVector & InitialVelocity, UWorld *& World)
{
FName WeaponSocket;
if (Weapon == WeaponEMain) WeaponSocket = WeaponESocket;
else if (Weapon == WeaponKMain) WeaponSocket = WeaponKSocket;
else return;
InitialVelocity = ShipMesh->GetPhysicsLinearVelocity("hull");
Transform = ShipMesh->GetSocketTransform(WeaponSocket, ERelativeTransformSpace::RTS_World);
World = GetWorld();
}
void AShip::SetShieldEActive(bool Active)
{
SetConsumerActive(ShieldEMain, Active);
}
void AShip::SetShieldKActive(bool Active)
{
SetConsumerActive(ShieldKMain, Active);
}
void AShip::SetMainEnginesActive(bool Active)
{
for (int32 i = 0; i < ThrustersForward.Num(); i++)
SetConsumerActive(ThrustersForward[i], Active);
for (int32 i = 0; i < ThrustersBackward.Num(); i++)
SetConsumerActive(ThrustersBackward[i], Active);
MainEnginesActive = Active;
}
void AShip::SetEnginesActive(bool Active)
{
for (int32 i = 0; i < ThrustersLeft.Num(); i++)
SetConsumerActive(ThrustersLeft[i], Active);
for (int32 i = 0; i < ThrustersRight.Num(); i++)
SetConsumerActive(ThrustersRight[i], Active);
for (int32 i = 0; i < ThrustersUp.Num(); i++)
SetConsumerActive(ThrustersUp[i], Active);
for (int32 i = 0; i < ThrustersDown.Num(); i++)
SetConsumerActive(ThrustersDown[i], Active);
EnginesActive = Active;
}
bool AShip::GetMainEnginesActive()
{
return MainEnginesActive;
}
bool AShip::GetEnginesActive()
{
return EnginesActive;
}
void AShip::ThrustForward(float Val)
{
ThrustInput.X = FMath::Clamp(Val / ForwardThrustSensitivity, -1.f, 1.f);
}
void AShip::ThrustRight(float Val)
{
ThrustInput.Y = FMath::Clamp(Val / RightThrustSensitivity, -1.f, 1.f);
}
void AShip::ThrustUp(float Val)
{
ThrustInput.Z = FMath::Clamp(Val / UpThrustSensitivity, -1.f, 1.f);
}
void AShip::RotateYaw(float Val)
{
RotationInput.Z = FMath::Clamp(-Val / YawSensitivity, -1.f, 1.f);
}
void AShip::RotatePitch(float Val)
{
RotationInput.Y = FMath::Clamp(Val / PitchSensitivity, -1.f, 1.f);
}
void AShip::RotateRoll(float Val)
{
RotationInput.X = FMath::Clamp(-Val / RollSensitivity, -1.f, 1.f);
}
bool AShip::SetCombatMode(bool ToCombat)
{
if (ToCombat)
{
if (TargetShips.Num() > 0)
{
int32 NewCombatTarget = 0;
float DeltaSum = 360.f;
for (int32 i = 0; i < TargetShips.Num(); i++)
{
FRotator DeltaTarget = GetActorRotation().UnrotateVector(TargetShips[i]->GetActorLocation() - GetActorLocation()).Rotation();
DeltaTarget.Normalize();
if (FMath::Abs(DeltaTarget.Yaw) + FMath::Abs(DeltaTarget.Pitch) < DeltaSum)
{
DeltaSum = FMath::Abs(DeltaTarget.Yaw) + FMath::Abs(DeltaTarget.Pitch);
NewCombatTarget = i;
}
}
CombatTarget = NewCombatTarget;
CombatMode = true;
}
else CombatMode = false;
}
else CombatMode = false;
return CombatMode;
}
bool AShip::GetCombatMode()
{
return CombatMode;
}
void AShip::SetPlayerShipController(AShipController * Controller)
{
PlayerShipController = Controller;
}
void AShip::OnWeaponEUpdateEnergyLevel(float EnergyLevel)
{
for (int32 i = 0; i < MaterialsMain.Num(); i++)
MaterialsMain[i]->SetScalarParameterValue("GunEGlowLevel", EnergyLevel);
}
void AShip::OnWeaponKUpdateEnergyLevel(float EnergyLevel)
{
for (int32 i = 0; i < MaterialsMain.Num(); i++)
MaterialsMain[i]->SetScalarParameterValue("GunKGlowLevel", EnergyLevel);
}
void AShip::OnShieldEUpdateEnergyLevel(float EnergyLevel)
{
for (int32 i = 0; i < MaterialsMain.Num(); i++)
MaterialsMain[i]->SetScalarParameterValue("ShieldEGlowLevel", EnergyLevel);
if (ShieldEMainMat)
{
float ShieldGlowLevel = EnergyLevel;
ShieldGlowLevel = (ShieldGlowLevel - ShieldEMain->BlockThreshold) / (1 - ShieldEMain->BlockThreshold);
ShieldGlowLevel = FMath::Max(ShieldGlowLevel, 0.f);
ShieldEMainMat->SetScalarParameterValue("Power", ShieldGlowLevel);
}
}
void AShip::OnShieldKUpdateEnergyLevel(float EnergyLevel)
{
for (int32 i = 0; i < MaterialsMain.Num(); i++)
MaterialsMain[i]->SetScalarParameterValue("ShieldKGlowLevel", EnergyLevel);
if (ShieldKMainMat)
{
float ShieldGlowLevel = EnergyLevel;
ShieldGlowLevel = (ShieldGlowLevel - ShieldKMain->BlockThreshold) / (1 - ShieldKMain->BlockThreshold);
ShieldGlowLevel = FMath::Max(ShieldGlowLevel, 0.f);
ShieldKMainMat->SetScalarParameterValue("Power", ShieldGlowLevel);
}
}
void AShip::OnMainEnginesUpdateEnergyLevel(float EnergyLevel)
{
for (int32 i = 0; i < MaterialsMain.Num(); i++)
MaterialsMain[i]->SetScalarParameterValue("MainEngineGlowLevel", EnergyLevel);
}
void AShip::OnEnginesUpdateEnergyLevel(float EnergyLevel)
{
for (int32 i = 0; i < MaterialsMain.Num(); i++)
MaterialsMain[i]->SetScalarParameterValue("EngineGlowLevel", EnergyLevel);
}
void AShip::OnTargetingRangeBeginOverlap(UPrimitiveComponent * OverlappedComponent, AActor * OtherActor, UPrimitiveComponent * OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult & SweepResult)
{
if (OtherActor == this) return;
AShip* NewTargetShip = Cast<AShip>(OtherActor);
if (NewTargetShip && OtherComp->GetClass() == USkeletalMeshComponent::StaticClass())
{
if (!TargetShips.Contains(NewTargetShip))
{
TargetShips.Add(NewTargetShip);
if (PlayerShipController) PlayerShipController->GetHUD()->AddShipTarget(NewTargetShip->ShipName);
GEngine->AddOnScreenDebugMessage(-1, 2.f, FColor::Green, FString::Printf(TEXT("Target ship count %d"), TargetShips.Num()));
}
}
}
void AShip::OnTargetingRangeEndOverlap(UPrimitiveComponent * OverlappedComponent, AActor * OtherActor, UPrimitiveComponent * OtherComp, int32 OtherBodyIndex)
{
if (OtherActor == this) return;
AShip* OldTargetShip = Cast<AShip>(OtherActor);
if (OldTargetShip && OtherComp->GetClass() == USkeletalMeshComponent::StaticClass())
{
int32 RemovedIndex;
TargetShips.Find(OldTargetShip, RemovedIndex);
if (PlayerShipController) PlayerShipController->GetHUD()->RemoveShipTarget(RemovedIndex);
if (CombatMode)
{
if (RemovedIndex == CombatTarget)
{
SetCombatMode(false);
if (PlayerShipController) PlayerShipController->SetCombatControls(false);
}
else if (RemovedIndex < CombatTarget)
CombatTarget--;
}
TargetShips.RemoveAt(RemovedIndex);
GEngine->AddOnScreenDebugMessage(-1, 2.f, FColor::Green, FString::Printf(TEXT("Target ship count %d"), TargetShips.Num()));
}
} | [
"leoleoly@aol.com"
] | leoleoly@aol.com |
3fac579a54468aa43a649f98e2fe3c741ff75ea5 | 1a07cd2d06aa18d625306b23738489156f287c1f | /emule/DropTarget.cpp | cbe94b1c740e37a875d49c647233cba297e0caec | [] | no_license | skynetto/EmuleRefactoring | 94b2e250a446f93ee27784c8b6bfc9755f51bcb2 | 83469d473be1f5d9c2bc73131837dfe01923aa8e | refs/heads/master | 2023-04-08T19:38:22.637212 | 2021-04-18T19:11:18 | 2021-04-18T19:11:18 | 354,520,045 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 16,570 | cpp | //this file is part of eMule
//Copyright (C)2002-2008 Merkur ( strEmail.Format("%s@%s", "devteam", "emule-project.net") / http://www.emule-project.net )
//
//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., 675 Mass Ave, Cambridge, MA 02139, USA.
#include "stdafx.h"
#include "emule.h"
#include "emuledlg.h"
#include "DropTarget.h"
#include "OtherFunctions.h"
#include <intshcut.h>
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
#define FILEEXT_INETSHRTCUTA "url" // ANSI string
#define FILEEXT_INETSHRTCUTW L"url" // Unicode string
#define FILEEXT_INETSHRTCUT _T(FILEEXT_INETSHRTCUTA)
#define FILEEXTDOT_INETSHRTCUTA "." FILEEXT_INETSHRTCUTA // ANSI string
#define FILEEXTDOT_INETSHRTCUTW L"." FILEEXT_INETSHRTCUTW // Unicode string
#define FILEEXTDOT_INETSHRTCUT _T(".") FILEEXT_INETSHRTCUT
//#define FILETYPE_INETSHRTCUT _T("Internet Shortcut File")
//#define FILEFLT_INETSHRTCUT FILETYPE_INETSHRTCUT _T("s (*") FILEEXTDOT_INETSHRTCUT _T(")|*") FILEEXTDOT_INETSHRTCUT _T("|")
BOOL IsUrlSchemeSupportedW(LPCWSTR pszUrl)
{
static const struct SCHEME
{
LPCWSTR pszPrefix;
int iLen;
} _aSchemes[] =
{
#define SCHEME_ENTRY(prefix) { prefix, _countof(prefix)-1 }
SCHEME_ENTRY(L"ed2k://"),
SCHEME_ENTRY(L"magnet:?")
#undef SCHEME_ENTRY
};
for (unsigned i = 0; i < _countof(_aSchemes); ++i)
if (wcsncmp(pszUrl, _aSchemes[i].pszPrefix, _aSchemes[i].iLen) == 0)
return TRUE;
return FALSE;
}
// GetFileExtA -- ANSI version
//
// This function is thought to be used only for filenames which have been
// validated by 'GetFullPathName' or similar functions.
LPCSTR GetFileExtA(LPCSTR pszPathA, int iLen /*= -1*/)
{
// Just search the last '.'-character which comes after an optionally
// available last '\'-char.
int iPos = iLen >= 0 ? iLen : (int)strlen(pszPathA);
while (iPos-- > 0) {
if (pszPathA[iPos] == '.')
return &pszPathA[iPos];
if (pszPathA[iPos] == '\\')
break;
}
return NULL;
}
// GetFileExtW -- Unicode version
//
// This function is thought to be used only for filenames which have been
// validated by 'GetFullPathName' or similar functions.
LPCWSTR GetFileExtW(LPCWSTR pszPathW, int iLen /*= -1*/)
{
// Just search the last '.'-character which comes after an optionally
// available last '\'-char.
int iPos = iLen >= 0 ? iLen : (int)wcslen(pszPathW);
while (iPos-- > 0) {
if (pszPathW[iPos] == L'.')
return &pszPathW[iPos];
if (pszPathW[iPos] == L'\\')
break;
}
return NULL;
}
//////////////////////////////////////////////////////////////////////////////
// PASTEURLDATA
struct PASTEURLDATA
{
PASTEURLDATA()
: m_eType(InvalidType)
, m_dwFlags()
{
}
explicit PASTEURLDATA(BSTR bstrText, DWORD dwFlags = 0)
: m_eType(HTMLText)
, m_dwFlags(dwFlags)
, m_bstrURLs(bstrText)
{
}
explicit PASTEURLDATA(IDispatch *pIDispatch, DWORD dwFlags = 0)
: m_eType(Document)
, m_dwFlags(dwFlags)
, m_pIDispDoc(pIDispatch)
{
}
enum DataType
{
InvalidType = -1,
Text,
HTMLText,
Document
} m_eType;
DWORD m_dwFlags;
union
{
BSTR m_bstrURLs;
IDispatch *m_pIDispDoc;
};
};
//////////////////////////////////////////////////////////////////////////////
// CMainFrameDropTarget
CMainFrameDropTarget::CMainFrameDropTarget()
: m_bDropDataValid()
, m_cfHTML((CLIPFORMAT)RegisterClipboardFormat(_T("HTML Format")))
, m_cfShellURL((CLIPFORMAT)RegisterClipboardFormat(CFSTR_SHELLURL))
{
ASSERT(m_cfHTML != 0);
ASSERT(m_cfShellURL != 0);
}
HRESULT CMainFrameDropTarget::PasteHTMLDocument(IHTMLDocument2 *doc, PASTEURLDATA* /*pPaste*/)
{
HRESULT hrPasteResult = S_FALSE; // default: nothing was pasted
int iURLElements = 0;
// get_links HREF all <LINK> and <AREA> elements -> that's *wrong* it also contains all <A> elements!
// get_anchors HREF all <A> elements which have a NAME or ID value!
//
// Links
//
CComPtr<IHTMLElementCollection> links;
if (doc->get_links(&links) == S_OK) {
long lLinks;
if (links->get_length(&lLinks) == S_OK && lLinks > 0) {
iURLElements += lLinks;
CComVariant vaIndex(0L);
CComVariant vaNull(0L);
for (long i = 0; i < lLinks; ++i) {
vaIndex.lVal = i;
CComPtr<IDispatch> item;
if (links->item(vaIndex, vaNull, &item) == S_OK) {
CComPtr<IHTMLAnchorElement> anchor;
if (SUCCEEDED(item->QueryInterface(&anchor))) {
CComBSTR bstrHref;
if (anchor->get_href(&bstrHref) == S_OK && bstrHref.Length() > 0 && IsUrlSchemeSupportedW(bstrHref)) {
theApp.emuledlg->ProcessED2KLink(CString(bstrHref));
hrPasteResult = S_OK;
}
anchor.Release(); // conserve memory
}
}
}
}
links.Release(); // conserve memory
}
//
// Text
//
// The explicit handling of text is needed, if we're looking at contents which were copied
// to the clipboard in HTML format -- although it is simple raw text!! This situation applies,
// if the user opens the "View Partial Source" HTML window for some selected HTML contents,
// and copies some text (e.g. a URL) to the clipboard. In that case we'll get the raw text
// as HTML contents!!!
//
// PROBLEM: We can *not* always process the HTML elements (anchors, ...) *and* the inner text.
// The following example (a rather *usual* one) would lead to the adding of the same URL twice
// because the URL is noted as a HREF *and* as the inner text.
//
// <P><A href="http://www.domain.com/image.gif">http://www.domain.com/image.gif</A></P>
//
// So, in practice, the examination of the 'innerText' is only done, if there were no other
// HTML elements in the document.
//
if (iURLElements == 0) {
CComPtr<IHTMLElement> el;
if (doc->get_body(&el) == S_OK) {
CComBSTR bstr;
if (el->get_innerText(&bstr) == S_OK && bstr.Length() > 0) {
LPCWSTR pwsz = bstr;
while (*pwsz != L'\0' && iswspace(*pwsz)) // Skip white spaces
++pwsz;
// PROBLEM: The 'innerText' does not contain any HTML tags, but it *MAY* contain
// HTML comments like "<!--StartFragment-->...<!--EndFragment-->". Those
// tags have to be explicitly parsed to get the real raw text contents.
// Those Start- and End-tags are available if the text is copied into the clipboard
// from a HTML window which was open with "View Partial Source"!
static const WCHAR _wszStartFrag[] = L"<!--StartFragment-->";
if (wcsncmp(pwsz, _wszStartFrag, _countof(_wszStartFrag) - 1) == 0) {
pwsz += _countof(_wszStartFrag) - 1;
// If there's a Start-tag, search for an End-tag.
static const WCHAR _wszEndFrag[] = L"<!--EndFragment-->";
LPWSTR pwszEnd = (LPWSTR)bstr + bstr.Length();
pwszEnd -= _countof(_wszEndFrag) - 1;
if (pwszEnd >= pwsz) {
if (wcsncmp(pwszEnd, _wszEndFrag, _countof(_wszEndFrag) - 1) == 0)
*pwszEnd = L'\0'; // Ugly but efficient, terminate the BSTR!
}
}
// Search all white-space terminated strings and check for a valid URL-scheme
while (*pwsz != L'\0') {
while (*pwsz != L'\0' && iswspace(*pwsz)) // Skip white spaces
++pwsz;
if (IsUrlSchemeSupportedW(pwsz)) {
LPCWSTR pwszEnd = pwsz;
while (*pwszEnd != L'\0' && !iswspace(*pwszEnd)) // Search next white space (end of current string)
++pwszEnd;
int iLen = (int)(pwszEnd - pwsz);
if (iLen > 0) {
CString strURL(pwsz, iLen);
theApp.emuledlg->ProcessED2KLink(strURL);
hrPasteResult = S_OK;
pwsz += iLen;
}
} else {
while (*pwsz != L'\0' && !iswspace(*pwsz)) // Search next white space (end of current string)
++pwsz;
}
while (*pwsz != L'\0' && iswspace(*pwsz)) // Skip white spaces
++pwsz;
}
}
}
}
return hrPasteResult;
}
HRESULT CMainFrameDropTarget::PasteHTML(PASTEURLDATA *pPaste)
{
HRESULT hrPasteResult = S_FALSE; // default: nothing was pasted
if (pPaste->m_bstrURLs[0] != L'\0') {
CComPtr<IHTMLDocument2> doc;
if (SUCCEEDED(doc.CoCreateInstance(CLSID_HTMLDocument, NULL))) {
SAFEARRAY *psfHtmlLines = SafeArrayCreateVector(VT_VARIANT, 0, 1);
if (psfHtmlLines != NULL) {
VARIANT *pva;
if (SafeArrayAccessData(psfHtmlLines, (void**)&pva) == S_OK) {
pva->vt = VT_BSTR;
pva->bstrVal = pPaste->m_bstrURLs;
VERIFY(SafeArrayUnaccessData(psfHtmlLines) == S_OK);
// Build the HTML document
//
// NOTE: 'bstrHTML' may contain a complete HTML document (see CF_HTML) or
// just a fragment (without <HTML>, <BODY>, ... tags).
//
// WOW! We even can pump partially (but well defined) HTML stuff into the
// document (e.g. contents without <HTML>, <BODY>...) *and* we are capable
// of accessing the HTML object model (can use 'get_links'...)
if (doc->write(psfHtmlLines) == S_OK)
hrPasteResult = PasteHTMLDocument(doc, pPaste);
else
hrPasteResult = E_FAIL;
} else
hrPasteResult = E_OUTOFMEMORY;
// Destroy the array *and* all of the data (BSTRs!)
if (SafeArrayAccessData(psfHtmlLines, (void**)&pva) == S_OK) {
// 'Remove' the BSTR which was specified before, to *NOT* have it deleted by 'SafeArrayDestroy'
pva->vt = VT_NULL;
pva->bstrVal = NULL;
VERIFY(SafeArrayUnaccessData(psfHtmlLines) == S_OK);
}
VERIFY(SafeArrayDestroy(psfHtmlLines) == S_OK);
} else
hrPasteResult = E_OUTOFMEMORY;
} else
hrPasteResult = E_FAIL;
}
return hrPasteResult;
}
HRESULT CMainFrameDropTarget::PasteHTML(COleDataObject &data)
{
HRESULT hrPasteResult = E_FAIL;
HGLOBAL hMem = data.GetGlobalData(m_cfHTML);
if (hMem != NULL) {
LPCSTR pszClipboard = (LPCSTR)GlobalLock(hMem);
if (pszClipboard != NULL) {
hrPasteResult = S_FALSE; // default: nothing was pasted
LPCSTR pszHTML = strchr(pszClipboard, '<');
if (pszHTML != NULL) {
CComBSTR bstrHTMLText(pszHTML);
PASTEURLDATA Paste(bstrHTMLText);
hrPasteResult = PasteHTML(&Paste);
}
GlobalUnlock(hMem);
}
GlobalFree(hMem);
}
return hrPasteResult;
}
HRESULT CMainFrameDropTarget::PasteText(CLIPFORMAT cfData, COleDataObject &data)
{
HRESULT hrPasteResult = E_FAIL;
HANDLE hMem = data.GetGlobalData(cfData);
if (hMem != NULL) {
LPCSTR pszUrlA = (LPCSTR)GlobalLock(hMem);
if (pszUrlA != NULL) {
// skip white space
while (isspace(*pszUrlA))
++pszUrlA;
hrPasteResult = S_FALSE; // default: nothing was pasted
if (_strnicmp(pszUrlA, "ed2k://|", 8) == 0 || _strnicmp(pszUrlA, "magnet:?", 8) == 0) {
const CString strData(pszUrlA);
for (int iPos = 0; iPos >= 0;) {
const CString &sLink(strData.Tokenize(_T("\r\n"), iPos));
if (!sLink.IsEmpty()) {
theApp.emuledlg->ProcessED2KLink(sLink);
hrPasteResult = S_OK;
}
}
}
GlobalUnlock(hMem);
}
GlobalFree(hMem);
}
return hrPasteResult;
}
HRESULT CMainFrameDropTarget::AddUrlFileContents(LPCTSTR pszFileName)
{
HRESULT hrResult = S_FALSE;
if (ExtensionIs(pszFileName, FILEEXTDOT_INETSHRTCUT)) {
CComPtr<IUniformResourceLocatorW> pIUrl;
hrResult = CoCreateInstance(CLSID_InternetShortcut, NULL, CLSCTX_INPROC_SERVER, IID_IUniformResourceLocatorW, (void**)&pIUrl);
if (SUCCEEDED(hrResult)) {
CComPtr<IPersistFile> pIFile;
hrResult = pIUrl.QueryInterface(&pIFile);
if (SUCCEEDED(hrResult)) {
hrResult = pIFile->Load(CComBSTR(pszFileName), STGM_READ | STGM_SHARE_DENY_WRITE);
if (SUCCEEDED(hrResult)) {
LPWSTR pwszUrl;
hrResult = pIUrl->GetURL(&pwszUrl);
if (hrResult == S_OK) {
if (pwszUrl != NULL && pwszUrl[0] != L'\0' && IsUrlSchemeSupportedW(pwszUrl))
theApp.emuledlg->ProcessED2KLink(pwszUrl);
else
hrResult = S_FALSE;
CoTaskMemFree(pwszUrl);
}
}
}
}
}
return hrResult;
}
HRESULT CMainFrameDropTarget::PasteHDROP(COleDataObject &data)
{
HRESULT hrPasteResult = E_FAIL;
HANDLE hMem = data.GetGlobalData(CF_HDROP);
if (hMem != NULL) {
LPDROPFILES lpDrop = (LPDROPFILES)GlobalLock(hMem);
if (lpDrop != NULL) {
if (lpDrop->fWide) {
LPCWSTR pszFileNameW = (LPCWSTR)((LPBYTE)lpDrop + lpDrop->pFiles);
while (*pszFileNameW != L'\0') {
if (FAILED(AddUrlFileContents(pszFileNameW)))
break;
hrPasteResult = S_OK;
pszFileNameW += wcslen(pszFileNameW) + 1;
}
} else {
LPCSTR pszFileNameA = (LPCSTR)((LPBYTE)lpDrop + lpDrop->pFiles);
while (*pszFileNameA != '\0') {
if (FAILED(AddUrlFileContents(CString(pszFileNameA))))
break;
hrPasteResult = S_OK;
pszFileNameA += strlen(pszFileNameA) + 1;
}
}
GlobalUnlock(hMem);
}
GlobalFree(hMem);
}
return hrPasteResult;
}
BOOL CMainFrameDropTarget::IsSupportedDropData(COleDataObject *pDataObject)
{
BOOL bResult;
//************************************************************************
//*** THIS FUNCTION HAS TO BE AS FAST AS POSSIBLE!!!
//************************************************************************
if (m_cfHTML && pDataObject->IsDataAvailable(m_cfHTML)) {
// If the data is in 'HTML Format', there is no need to check the contents.
bResult = TRUE;
} else if (m_cfShellURL && pDataObject->IsDataAvailable(m_cfShellURL)) {
// If the data is in 'UniformResourceLocator', there is no need to check the contents.
bResult = TRUE;
} else if (pDataObject->IsDataAvailable(CF_UNICODETEXT)) {
//
// Check text data
//
bResult = FALSE;
HANDLE hMem = pDataObject->GetGlobalData(CF_UNICODETEXT);
if (hMem != NULL) {
LPCWSTR lpszUrl = (LPCWSTR)GlobalLock(hMem);
if (lpszUrl != NULL) {
// skip white space
while (isspace(*lpszUrl))
++lpszUrl;
bResult = IsUrlSchemeSupportedW(lpszUrl);
GlobalUnlock(hMem);
}
GlobalFree(hMem);
}
} else if (pDataObject->IsDataAvailable(CF_HDROP)) {
//
// Check HDROP data
//
bResult = FALSE;
HANDLE hMem = pDataObject->GetGlobalData(CF_HDROP);
if (hMem != NULL) {
LPDROPFILES lpDrop = (LPDROPFILES)GlobalLock(hMem);
if (lpDrop != NULL) {
// Just check, if there's at least one file we can import
if (lpDrop->fWide) {
LPCWSTR pszFileW = (LPCWSTR)((LPBYTE)lpDrop + lpDrop->pFiles);
while (*pszFileW != L'\0') {
int iLen = (int)wcslen(pszFileW);
LPCWSTR pszExtW = GetFileExtW(pszFileW, iLen);
if (pszExtW != NULL && _wcsicmp(pszExtW, FILEEXTDOT_INETSHRTCUTW) == 0) {
bResult = TRUE;
break;
}
pszFileW += iLen + 1;
}
} else {
LPCSTR pszFileA = (LPCSTR)((LPBYTE)lpDrop + lpDrop->pFiles);
while (*pszFileA != '\0') {
int iLen = (int)strlen(pszFileA);
LPCSTR pszExtA = GetFileExtA(pszFileA, iLen);
if (pszExtA != NULL && _stricmp(pszExtA, FILEEXTDOT_INETSHRTCUTA) == 0) {
bResult = TRUE;
break;
}
pszFileA += iLen + 1;
}
}
GlobalUnlock(hMem);
}
GlobalFree(hMem);
}
} else {
// Unknown data format
bResult = FALSE;
}
return bResult;
}
DROPEFFECT CMainFrameDropTarget::OnDragEnter(CWnd*, COleDataObject *pDataObject, DWORD, CPoint)
{
m_bDropDataValid = IsSupportedDropData(pDataObject);
return m_bDropDataValid ? DROPEFFECT_COPY : DROPEFFECT_NONE;
}
DROPEFFECT CMainFrameDropTarget::OnDragOver(CWnd*, COleDataObject*, DWORD, CPoint)
{
return m_bDropDataValid ? DROPEFFECT_COPY : DROPEFFECT_NONE;
}
BOOL CMainFrameDropTarget::OnDrop(CWnd*, COleDataObject *pDataObject, DROPEFFECT /*dropEffect*/, CPoint /*point*/)
{
if (m_bDropDataValid) {
if (m_cfHTML && pDataObject->IsDataAvailable(m_cfHTML))
PasteHTML(*pDataObject);
else if (m_cfShellURL && pDataObject->IsDataAvailable(m_cfShellURL))
PasteText(m_cfShellURL, *pDataObject);
else if (pDataObject->IsDataAvailable(CF_TEXT))
PasteText(CF_TEXT, *pDataObject);
else if (pDataObject->IsDataAvailable(CF_HDROP))
return PasteHDROP(*pDataObject) == S_OK;
return TRUE;
}
return FALSE;
}
void CMainFrameDropTarget::OnDragLeave(CWnd*)
{
// Do *NOT* set m_bDropDataValid to FALSE!
// 'OnDragLeave' may be called from MFC when scrolling!
// In that case it's not really a "leave".
//m_bDropDataValid = FALSE;
} | [
"s95227@libero.it"
] | s95227@libero.it |
ebaad837714c9a026fd177bb3bd729e42aea061c | 83d0bafc7369d4857bb51fa47f26d627d782ce0e | /test.cc | 833efc05c38e5f4bca0d71d8debcfe0b500541f2 | [] | no_license | kyuseobkim/Dijkstra | 70ecf41b7731e3820c42e57a8d6e4a93156da3c9 | fa85e557674db1f53f7123881ebb44a2dea29399 | refs/heads/master | 2022-07-09T13:46:01.662416 | 2020-05-13T21:08:56 | 2020-05-13T21:08:56 | 263,483,607 | 0 | 0 | null | 2020-05-13T20:09:37 | 2020-05-13T00:22:24 | C++ | UTF-8 | C++ | false | false | 2,817 | cc | #include <algorithm>
#include <vector>
#include "graph.h"
#include "shortest_path.h"
#include "gtest/gtest.h"
using namespace std;
namespace dijkstra {
namespace {
class GraphTest : public ::testing::Test {
protected:
void SetUp() override {
g3.add(0, 1);
}
// void TearDown() override { }
Graph g1 {0, 10};
Graph g2 {1, 10};
Graph g3 {0.5, 10};
};
TEST_F(GraphTest, NoEdges) {
EXPECT_EQ(g1.V(), 10);
EXPECT_EQ(g1.E(), 0);
}
TEST_F(GraphTest, FullyConnected) {
EXPECT_EQ(g2.V(), 10);
EXPECT_EQ(g2.E(), 45);
}
TEST_F(GraphTest, GetEdgeValue) {
double v = g1.get_edge_value(0, 5);
EXPECT_EQ(g1.get_edge_value(0, 5), v);
g1.set_edge_value(0, 5, 10);
EXPECT_EQ(g1.get_edge_value(0, 5), 10);
}
TEST_F(GraphTest, Neighbors) {
EXPECT_TRUE(g3.adjacent(0, 1));
EXPECT_TRUE(g3.adjacent(1, 0));
vector<int> n = g3.neighbors(0);
EXPECT_GE(n.size(), 1);
EXPECT_NE(find(n.begin(), n.end(), 1), n.end());
}
class PathTest : public ::testing::Test {
protected:
void SetUp() override {
g3.add(0, 1);
g3.set_edge_value(0, 1, 0.1);
}
// void TearDown() override { }
Graph g3 {0, 10};
ShortestPath sp {g3};
};
TEST_F(PathTest, PathSize) {
EXPECT_TRUE(g3.adjacent(0, 1));
EXPECT_TRUE(g3.adjacent(1, 0));
vector<int> n = g3.neighbors(0);
EXPECT_GE(n.size(), 1);
EXPECT_NE(find(n.begin(), n.end(), 1), n.end());
EXPECT_EQ(g3.get_edge_value(0, 1), 0.1);
EXPECT_EQ(g3.get_edge_value(1, 0), 0.1);
EXPECT_EQ(sp.path_size(0, 0), 0);
EXPECT_EQ(sp.path_size(0, 1), 0.1);
vector<int> path = sp.path(0, 1);
ASSERT_EQ(path.size(), 2);
EXPECT_EQ(path[0], 0);
EXPECT_EQ(path[1], 1);
}
TEST_F(PathTest, SimplePath) {
g3.add(0, 2);
g3.set_edge_value(0, 2, 5);
g3.add(1, 2);
g3.set_edge_value(1, 2, 4);
EXPECT_EQ(sp.path_size(0, 2), 4.1);
EXPECT_EQ(sp.path_size(1, 2), 4);
vector<int> path = sp.path(0, 2);
ASSERT_EQ(path.size(), 3);
EXPECT_EQ(path[0], 0);
EXPECT_EQ(path[1], 1);
EXPECT_EQ(path[2], 2);
path = sp.path(1, 2);
ASSERT_EQ(path.size(), 2);
EXPECT_EQ(path[0], 1);
EXPECT_EQ(path[1], 2);
path = sp.path(2, 0);
ASSERT_EQ(path.size(), 3);
EXPECT_EQ(path[0], 2);
EXPECT_EQ(path[1], 1);
EXPECT_EQ(path[2], 0);
g3.set_edge_value(0, 2, 4);
g3.set_edge_value(1, 2, 5);
EXPECT_EQ(sp.path_size(0, 2), 4);
EXPECT_EQ(sp.path_size(1, 2), 4.1);
path = sp.path(1, 2);
ASSERT_EQ(path.size(), 3);
EXPECT_EQ(path[0], 1);
EXPECT_EQ(path[1], 0);
EXPECT_EQ(path[2], 2);
}
}
}
int main(int argc, char **argv) {
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
| [
"kyukim@wharton.upenn.edu"
] | kyukim@wharton.upenn.edu |
4aad306ea2c27c635e9a79ef8fe25cd6df171428 | d282a2c69ad94303056462468d56ed9c6e317425 | /OpenGLSample/shader.h | 61e6ad55e5df410c12c4f3bb97a4f26cbfe26d94 | [] | no_license | kandroid29/OpenGLSamples | b2b894176b9de36db083647b6a7a1563edfeb49c | 24193436fd682f96bae5695b2ec4efd2e44a9a9a | refs/heads/master | 2020-05-19T16:29:33.465475 | 2019-05-06T02:31:47 | 2019-05-06T02:31:47 | 185,110,198 | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 3,949 | h | #ifndef _SHADER_H_
#define _SHADER_H_
#include <GL/glew.h>
#include <iterator> // std::istreambuf_iterator
#include <string>
#include <vector>
#include <iostream>
#include <fstream>
struct ShaderFile
{
GLenum shaderType;
const char* filePath;
ShaderFile(GLenum type, const char* path)
:shaderType(type), filePath(path) {}
};
class Shader
{
public:
Shader(const char* vertexPath, const char* fragPath) :programId(0)
{
std::vector<ShaderFile> fileVec;
fileVec.push_back(ShaderFile(GL_VERTEX_SHADER, vertexPath));
fileVec.push_back(ShaderFile(GL_FRAGMENT_SHADER, fragPath));
loadFromFile(fileVec);
}
Shader(const char* vertexPath, const char* fragPath, const char* geometryPath) :programId(0)
{
std::vector<ShaderFile> fileVec;
fileVec.push_back(ShaderFile(GL_VERTEX_SHADER, vertexPath));
fileVec.push_back(ShaderFile(GL_FRAGMENT_SHADER, fragPath));
fileVec.push_back(ShaderFile(GL_GEOMETRY_SHADER, geometryPath));
loadFromFile(fileVec);
}
void use()
{
glUseProgram(this->programId);
}
~Shader()
{
if (this->programId)
{
glDeleteProgram(this->programId);
}
}
public:
GLuint programId;
private:
/*
* 从文件加载顶点和片元着色器
* 传递参数为 [(着色器文件类型,着色器文件路径)+]
*/
void loadFromFile(std::vector<ShaderFile>& shaderFileVec)
{
std::vector<GLuint> shaderObjectIdVec;
std::string vertexSource, fragSource;
std::vector<std::string> sourceVec;
size_t shaderCount = shaderFileVec.size();
// 读取文件源代码
for (size_t i = 0; i < shaderCount; ++i)
{
std::string shaderSource;
if (!loadShaderSource(shaderFileVec[i].filePath, shaderSource))
{
std::cout << "Error::Shader could not load file:" << shaderFileVec[i].filePath << std::endl;
return;
}
sourceVec.push_back(shaderSource);
}
bool bSuccess = true;
// 编译shader object
for (size_t i = 0; i < shaderCount; ++i)
{
GLuint shaderId = glCreateShader(shaderFileVec[i].shaderType);
const char *c_str = sourceVec[i].c_str();
glShaderSource(shaderId, 1, &c_str, NULL);
glCompileShader(shaderId);
GLint compileStatus = 0;
glGetShaderiv(shaderId, GL_COMPILE_STATUS, &compileStatus); // 检查编译状态
if (compileStatus == GL_FALSE) // 获取错误报告
{
GLint maxLength = 0;
glGetShaderiv(shaderId, GL_INFO_LOG_LENGTH, &maxLength);
std::vector<GLchar> errLog(maxLength);
glGetShaderInfoLog(shaderId, maxLength, &maxLength, &errLog[0]);
std::cout << "Error::Shader file [" << shaderFileVec[i].filePath << " ] compiled failed,"
<< &errLog[0] << std::endl;
bSuccess = false;
}
shaderObjectIdVec.push_back(shaderId);
}
// 链接shader program
if (bSuccess)
{
this->programId = glCreateProgram();
for (size_t i = 0; i < shaderCount; ++i)
{
glAttachShader(this->programId, shaderObjectIdVec[i]);
}
glLinkProgram(this->programId);
GLint linkStatus;
glGetProgramiv(this->programId, GL_LINK_STATUS, &linkStatus);
if (linkStatus == GL_FALSE)
{
GLint maxLength = 0;
glGetProgramiv(this->programId, GL_INFO_LOG_LENGTH, &maxLength);
std::vector<GLchar> errLog(maxLength);
glGetProgramInfoLog(this->programId, maxLength, &maxLength, &errLog[0]);
std::cout << "Error::shader link failed," << &errLog[0] << std::endl;
}
}
// 链接完成后detach 并释放shader object
for (size_t i = 0; i < shaderCount; ++i)
{
if (this->programId != 0)
{
glDetachShader(this->programId, shaderObjectIdVec[i]);
}
glDeleteShader(shaderObjectIdVec[i]);
}
}
/*
* 读取着色器程序源码
*/
bool loadShaderSource(const char* filePath, std::string& source)
{
source.clear();
std::ifstream in_stream(filePath);
if (!in_stream)
{
return false;
}
source.assign(std::istreambuf_iterator<char>(in_stream),
std::istreambuf_iterator<char>()); // 文件流迭代器构造字符串
return true;
}
};
#endif
| [
"zhengkan@guoshujinfu.com"
] | zhengkan@guoshujinfu.com |
f16d42d6e25f4983e15f9371597a063dc3201654 | bcb632916e553f6ae67107e47040356f43e09599 | /chrome/browser/nearby_sharing/sharesheet/nearby_share_action.cc | f8d620abc522cc87bb770dc0e46929917beffe2b | [
"BSD-3-Clause"
] | permissive | sasdf/chromium | 15e3ac52aac81edf75d07553cd3db9b6d0bb5712 | 7b7481cfda84de5ba11a09117b09739f51482f4d | refs/heads/master | 2022-12-08T13:43:23.675269 | 2020-08-28T14:13:54 | 2020-08-28T14:13:54 | 291,071,459 | 0 | 0 | BSD-3-Clause | 2020-08-28T14:49:55 | 2020-08-28T14:46:57 | null | UTF-8 | C++ | false | false | 4,579 | cc | // Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/nearby_sharing/sharesheet/nearby_share_action.h"
#include <memory>
#include <vector>
#include "base/files/file_path.h"
#include "base/logging.h"
#include "chrome/app/vector_icons/vector_icons.h"
#include "chrome/browser/chromeos/file_manager/app_id.h"
#include "chrome/browser/chromeos/file_manager/fileapi_util.h"
#include "chrome/browser/nearby_sharing/attachment.h"
#include "chrome/browser/nearby_sharing/file_attachment.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/sharesheet/sharesheet_types.h"
#include "chrome/browser/ui/webui/nearby_share/nearby_share_dialog_ui.h"
#include "chrome/common/webui_url_constants.h"
#include "chrome/grit/generated_resources.h"
#include "storage/browser/file_system/file_system_context.h"
#include "storage/browser/file_system/file_system_url.h"
#include "third_party/skia/include/core/SkColor.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/gfx/geometry/size.h"
#include "ui/gfx/image/image_skia.h"
#include "ui/gfx/paint_vector_icon.h"
#include "ui/views/controls/webview/webview.h"
#include "url/gurl.h"
namespace {
std::vector<base::FilePath> ResolveFileUrls(
Profile* profile,
const std::vector<GURL>& file_urls) {
std::vector<base::FilePath> file_paths;
storage::FileSystemContext* fs_context =
file_manager::util::GetFileSystemContextForExtensionId(
profile, file_manager::kFileManagerAppId);
for (const auto& file_url : file_urls) {
storage::FileSystemURL fs_url = fs_context->CrackURL(file_url);
file_paths.push_back(fs_url.path());
}
return file_paths;
}
std::vector<std::unique_ptr<Attachment>> CreateAttachmentsFromIntent(
Profile* profile,
apps::mojom::IntentPtr intent) {
std::vector<std::unique_ptr<Attachment>> attachments;
// TODO(knollr): Support other attachment types.
if (intent->file_urls) {
std::vector<base::FilePath> file_paths =
ResolveFileUrls(profile, *intent->file_urls);
for (auto& file_path : file_paths) {
attachments.push_back(
std::make_unique<FileAttachment>(std::move(file_path)));
}
}
return attachments;
}
} // namespace
namespace {
constexpr int kCornerRadius = 12;
gfx::Size ComputeSize() {
// TODO(vecore): compute expected size based on screen size
return {500, 500};
}
} // namespace
NearbyShareAction::NearbyShareAction() = default;
NearbyShareAction::~NearbyShareAction() = default;
const base::string16 NearbyShareAction::GetActionName() {
return l10n_util::GetStringUTF16(IDS_NEARBY_SHARE_FEATURE_NAME);
}
const gfx::ImageSkia NearbyShareAction::GetActionIcon() {
return gfx::CreateVectorIcon(kNearbyShareIcon, sharesheet::kIconSize,
gfx::kPlaceholderColor);
}
void NearbyShareAction::LaunchAction(
sharesheet::SharesheetController* controller,
views::View* root_view,
apps::mojom::IntentPtr intent) {
// Store so we can trigger the share sheet close later.
controller_ = controller;
gfx::Size size = ComputeSize();
controller->SetSharesheetSize(size.width(), size.height());
// TODO(vecore): SharesheetController will eventually provide the profile.
auto* profile = ProfileManager::GetLastUsedProfileAllowedByPolicy();
auto view = std::make_unique<views::WebView>(profile);
// If this is not done, we don't see anything in our view.
view->SetPreferredSize(size);
views::WebView* web_view = root_view->AddChildView(std::move(view));
// TODO(vecore): Query this from the container view
web_view->holder()->SetCornerRadii(gfx::RoundedCornersF(kCornerRadius));
// load chrome://nearby into the webview
web_view->LoadInitialURL(GURL(chrome::kChromeUINearbyShareURL));
auto* webui = web_view->GetWebContents()->GetWebUI();
DCHECK(webui != nullptr);
nearby_ui_ =
webui->GetController()->GetAs<nearby_share::NearbyShareDialogUI>();
DCHECK(nearby_ui_ != nullptr);
nearby_ui_->AddObserver(this);
nearby_ui_->SetAttachments(
CreateAttachmentsFromIntent(profile, std::move(intent)));
}
void NearbyShareAction::OnClose() {
// The nearby WebUI requested to close through user action
if (controller_) {
controller_->CloseSharesheet();
}
}
void NearbyShareAction::OnClosing(
sharesheet::SharesheetController* controller) {
if (nearby_ui_) {
nearby_ui_->RemoveObserver(this);
nearby_ui_ = nullptr;
}
controller_ = nullptr;
}
| [
"commit-bot@chromium.org"
] | commit-bot@chromium.org |
75a9cfb003b9a424bc1519524323bfe68535742b | fbf49b83a8fdff970e4458f1476243303bb95ce4 | /MFC4-14-2/MFC4-14-2/MFC4-14-2Doc.h | 0ec8e8295837fefebecfbc2c93a0cb6fea0a9840 | [] | no_license | LUCKYlhl23/VCVS2020 | bfe096315af28b13f724329a1e8ae6d14f27d5ba | 19b8e32319f7bb6301f6e6ed08bc94e7aa99c9a8 | refs/heads/master | 2021-04-02T02:26:14.226348 | 2020-06-28T01:00:25 | 2020-06-28T01:00:25 | 248,234,182 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 882 | h |
// MFC4-14-2Doc.h: CMFC4142Doc 类的接口
//
#pragma once
class CMFC4142Doc : public CDocument
{
protected: // 仅从序列化创建
CMFC4142Doc() noexcept;
DECLARE_DYNCREATE(CMFC4142Doc)
// 特性
public:
CString filename;
// 操作
public:
// 重写
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 ~CMFC4142Doc();
#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
};
| [
"1291968750@qq.com"
] | 1291968750@qq.com |
567cb713fb23374bef59c2b99572984388cfc970 | 6c2c909460af9b7f9017ed277c193ebda1717a94 | /x86Cpu/cpu/ctrl_xfer_pro.cc | 7f2d227178b1f2aeaa251160f2321220a48fba2c | [] | no_license | lakizoli/PEReader | 8e9fa79ce5b14224c6230a5db4fc43e8c1d3a57f | 4db1c8bad0f97aea7665e8b5106a35fc97484450 | refs/heads/master | 2021-05-04T16:35:36.705957 | 2018-04-03T13:44:34 | 2018-04-03T13:44:34 | 120,253,329 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,524 | cc | ////////////////////////////////////////////////////////////////////////
// $Id: ctrl_xfer_pro.cc 12613 2015-01-25 20:55:10Z sshwarts $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2001-2015 The Bochs Project
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA B 02110-1301 USA
/////////////////////////////////////////////////////////////////////////
#define NEED_CPU_REG_SHORTCUTS 1
#include "config.h"
#include "cpu.h"
#define LOG_THIS BX_CPU_THIS_PTR
/* pass zero in check_rpl if no needed selector RPL checking for
non-conforming segments */
void BX_CPU_C::check_cs(bx_descriptor_t *descriptor, Bit16u cs_raw, Bit8u check_rpl, Bit8u check_cpl)
{
// descriptor AR byte must indicate code segment else #GP(selector)
if (descriptor->valid==0 || descriptor->segment==0 ||
IS_DATA_SEGMENT(descriptor->type))
{
BX_ERROR(("check_cs(0x%04x): not a valid code segment !", cs_raw));
exception(BX_GP_EXCEPTION, cs_raw & 0xfffc);
}
#if BX_SUPPORT_X86_64
if (long_mode()) {
if (descriptor->u.segment.l && descriptor->u.segment.d_b) {
BX_ERROR(("check_cs(0x%04x): Both CS.L and CS.D_B bits enabled !", cs_raw));
exception(BX_GP_EXCEPTION, cs_raw & 0xfffc);
}
}
#endif
// if non-conforming, code segment descriptor DPL must = CPL else #GP(selector)
if (IS_CODE_SEGMENT_NON_CONFORMING(descriptor->type)) {
if (descriptor->dpl != check_cpl) {
BX_ERROR(("check_cs(0x%04x): non-conforming code seg descriptor dpl != cpl, dpl=%d, cpl=%d",
cs_raw, descriptor->dpl, check_cpl));
exception(BX_GP_EXCEPTION, cs_raw & 0xfffc);
}
/* RPL of destination selector must be <= CPL else #GP(selector) */
if (check_rpl > check_cpl) {
BX_ERROR(("check_cs(0x%04x): non-conforming code seg selector rpl > cpl, rpl=%d, cpl=%d",
cs_raw, check_rpl, check_cpl));
exception(BX_GP_EXCEPTION, cs_raw & 0xfffc);
}
}
// if conforming, then code segment descriptor DPL must <= CPL else #GP(selector)
else {
if (descriptor->dpl > check_cpl) {
BX_ERROR(("check_cs(0x%04x): conforming code seg descriptor dpl > cpl, dpl=%d, cpl=%d",
cs_raw, descriptor->dpl, check_cpl));
exception(BX_GP_EXCEPTION, cs_raw & 0xfffc);
}
}
// code segment must be present else #NP(selector)
if (! descriptor->p) {
BX_ERROR(("check_cs(0x%04x): code segment not present !", cs_raw));
exception(BX_NP_EXCEPTION, cs_raw & 0xfffc);
}
}
void BX_CPP_AttrRegparmN(3)
BX_CPU_C::load_cs(bx_selector_t *selector, bx_descriptor_t *descriptor, Bit8u cpl)
{
// Add cpl to the selector value.
selector->value = (0xfffc & selector->value) | cpl;
touch_segment(selector, descriptor);
#ifdef BX_SUPPORT_CS_LIMIT_DEMOTION
// Handle special case of CS.LIMIT demotion (new descriptor limit is
// smaller than current one)
if (BX_CPU_THIS_PTR sregs[BX_SEG_REG_CS].cache.u.segment.limit_scaled > descriptor->u.segment.limit_scaled)
BX_CPU_THIS_PTR iCache.flushICacheEntries();
#endif
BX_CPU_THIS_PTR sregs[BX_SEG_REG_CS].selector = *selector;
BX_CPU_THIS_PTR sregs[BX_SEG_REG_CS].cache = *descriptor;
BX_CPU_THIS_PTR sregs[BX_SEG_REG_CS].selector.rpl = cpl;
BX_CPU_THIS_PTR sregs[BX_SEG_REG_CS].cache.valid = SegValidCache;
#if BX_SUPPORT_X86_64
if (long_mode()) {
handleCpuModeChange();
}
#endif
updateFetchModeMask(/* CS reloaded */);
#if BX_CPU_LEVEL >= 4
handleAlignmentCheck(/* CPL change */);
#endif
// Loading CS will invalidate the EIP fetch window.
invalidate_prefetch_q();
}
void BX_CPU_C::branch_far32(bx_selector_t *selector,
bx_descriptor_t *descriptor, Bit32u eip, Bit8u cpl)
{
/* instruction pointer must be in code segment limit else #GP(0) */
if (eip > descriptor->u.segment.limit_scaled) {
BX_ERROR(("branch_far32: EIP > limit"));
exception(BX_GP_EXCEPTION, 0);
}
/* Load CS:IP from destination pointer */
/* Load CS-cache with new segment descriptor */
load_cs(selector, descriptor, cpl);
/* Change the EIP value */
EIP = eip;
}
void BX_CPU_C::branch_far64(bx_selector_t *selector,
bx_descriptor_t *descriptor, bx_address rip, Bit8u cpl)
{
#if BX_SUPPORT_X86_64
if (long_mode() && descriptor->u.segment.l) {
if (! IsCanonical(rip)) {
BX_ERROR(("branch_far64: canonical RIP violation"));
exception(BX_GP_EXCEPTION, 0);
}
}
else
#endif
{
rip &= 0xffffffff;
/* instruction pointer must be in code segment limit else #GP(0) */
if (rip > descriptor->u.segment.limit_scaled) {
BX_ERROR(("branch_far64: RIP > limit"));
exception(BX_GP_EXCEPTION, 0);
}
}
/* Load CS:IP from destination pointer */
/* Load CS-cache with new segment descriptor */
load_cs(selector, descriptor, cpl);
/* Change the RIP value */
RIP = rip;
}
| [
"lakizoli@yahoo.com"
] | lakizoli@yahoo.com |
9dd3f7f795e0b6ca522ed33c9a8bc9c94daa6bda | 2558d081018b41203812933efe70365b71681987 | /Stack/infixtoprefix.cpp | 3adc80aacb61ad374f770eb916f14ed24b7f3aaa | [] | no_license | erwasim1/DSA | a166a2b662e1ba0ce64c3c84bc894cec0b5dbcef | c17ec591147142a467ffdc5d54028cdb3efaf1b0 | refs/heads/master | 2023-06-24T14:06:36.261310 | 2021-07-27T04:34:22 | 2021-07-27T04:34:22 | 389,848,274 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,248 | cpp | #include<iostream>
#include<stack>
#include<math.h>
#include<algorithm>
using namespace std;
int prec(char c){
if(c=='^'){
return 3;
}
if(c=='/'||c=='*'){
return 2;
}
if(c=='+'||c=='-'){
return 1;
}
else{
return -1;
}
}
string intopre(string s){
reverse(s.begin(),s.end());
stack<char>st;
string res;
for(int i=0;i<s.length();i++){
if((s[i]>='a'&&s[i]<='z')||(s[i]>='A'&&s[i]<='Z')){
res+=s[i];
}
else if(s[i]==')'){
st.push(s[i]);
}
else if(s[i]=='('){
while(!st.empty()&&st.top()!=')'){
res+=st.top();
st.pop();
}
if(!st.empty()){
st.pop();
}
}
else{
while(!st.empty()&&prec(st.top())>=prec(s[i])){
res+=st.top();
st.pop();
}
st.push(s[i]);
}
}
while(!st.empty()){
res+=st.top();
st.pop();
}
reverse(res.begin(),res.end());
return res;
}
int main(){
string s="(a-b/c)*(a/k-l)";
cout<<intopre(s)<<endl;
} | [
"wasimzaffar58@gmail.com"
] | wasimzaffar58@gmail.com |
e1cd0cec2f768cc1ae143478e8b9638225924f09 | b20353e26e471ed53a391ee02ea616305a63bbb0 | /trunk/engine/include/CommonTest.h | 614d85b9a4b8d64c8d6a4584ec4de119b5acda5e | [] | no_license | trancx/ybtx | 61de88ef4b2f577e486aba09c9b5b014a8399732 | 608db61c1b5e110785639d560351269c1444e4c4 | refs/heads/master | 2022-12-17T05:53:50.650153 | 2020-09-19T12:10:09 | 2020-09-19T12:10:09 | 291,492,104 | 0 | 0 | null | 2020-08-30T15:00:16 | 2020-08-30T15:00:15 | null | UTF-8 | C++ | false | false | 570 | h | #pragma once
//$id$
#include "CommonDefs.h"
namespace sqr
{
COMMON_API const char* RegTestSuiteTickMgr();
COMMON_API const char* RegTestSuitePkgFile();
COMMON_API const char* RegTestSuitePatternCOR();
COMMON_API const char* RegTestSuitePatternDlg();
COMMON_API const char* RegTestSuiteIniFile();
COMMON_API const char* RegTestSuiteTableFile();
COMMON_API const char* RegTestSuiteVariant();
COMMON_API const char* RegTestSuiteSafeContainer();
COMMON_API const char* RegTestSuiteIDPtrMap();
COMMON_API const char* RegTestSuiteRenderSlot();
}
| [
"CoolManBob@a2c23ad7-41ce-4a1d-83b7-33535e6483ee"
] | CoolManBob@a2c23ad7-41ce-4a1d-83b7-33535e6483ee |
dc31cbd3fa85059ad19a9a6895bfe9fefed8d906 | fb67fd4f2fd06406554dd0a62fe83b8dc9d503d8 | /extensions/browser/api/declarative_net_request/composite_matcher_unittest.cc | 6abec512fe00e83a4f3a426af833a99732332c5d | [
"BSD-3-Clause"
] | permissive | Meron469/chromium | b5ffeb719ac3089edb4b4bd224e2b007cebdb012 | d97ee8ce68bbda058a33c02f302c99cb70885ec5 | refs/heads/master | 2023-03-03T01:26:56.988416 | 2019-10-21T15:35:15 | 2019-10-21T15:35:15 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 22,744 | cc | // 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.
#include "extensions/browser/api/declarative_net_request/composite_matcher.h"
#include <string>
#include <utility>
#include <vector>
#include "components/version_info/version_info.h"
#include "extensions/browser/api/declarative_net_request/constants.h"
#include "extensions/browser/api/declarative_net_request/request_action.h"
#include "extensions/browser/api/declarative_net_request/ruleset_matcher.h"
#include "extensions/browser/api/declarative_net_request/ruleset_source.h"
#include "extensions/browser/api/declarative_net_request/test_utils.h"
#include "extensions/common/api/declarative_net_request/constants.h"
#include "extensions/common/api/declarative_net_request/test_utils.h"
#include "extensions/common/features/feature_channel.h"
#include "extensions/common/permissions/permissions_data.h"
#include "net/http/http_request_headers.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
namespace extensions {
namespace declarative_net_request {
using PageAccess = PermissionsData::PageAccess;
using RedirectActionInfo = CompositeMatcher::RedirectActionInfo;
class CompositeMatcherTest : public ::testing::Test {
public:
CompositeMatcherTest() : channel_(::version_info::Channel::UNKNOWN) {}
private:
// Run this on the trunk channel to ensure the API is available.
ScopedCurrentChannel channel_;
DISALLOW_COPY_AND_ASSIGN(CompositeMatcherTest);
};
// Ensure CompositeMatcher respects priority of individual rulesets.
TEST_F(CompositeMatcherTest, RulesetPriority) {
TestRule block_rule = CreateGenericRule();
block_rule.condition->url_filter = std::string("google.com");
block_rule.id = kMinValidID;
TestRule redirect_rule_1 = CreateGenericRule();
redirect_rule_1.condition->url_filter = std::string("example.com");
redirect_rule_1.priority = kMinValidPriority;
redirect_rule_1.action->type = std::string("redirect");
redirect_rule_1.action->redirect.emplace();
redirect_rule_1.action->redirect->url = std::string("http://ruleset1.com");
redirect_rule_1.id = kMinValidID + 1;
// Create the first ruleset matcher.
const size_t kSource1ID = 1;
const size_t kSource1Priority = 1;
std::unique_ptr<RulesetMatcher> matcher_1;
ASSERT_TRUE(CreateVerifiedMatcher(
{block_rule, redirect_rule_1},
CreateTemporarySource(kSource1ID, kSource1Priority), &matcher_1));
// Now create a second ruleset matcher.
const size_t kSource2ID = 2;
const size_t kSource2Priority = 2;
TestRule allow_rule = block_rule;
allow_rule.action->type = std::string("allow");
TestRule redirect_rule_2 = redirect_rule_1;
redirect_rule_2.action->redirect.emplace();
redirect_rule_2.action->redirect->url = std::string("http://ruleset2.com");
std::unique_ptr<RulesetMatcher> matcher_2;
ASSERT_TRUE(CreateVerifiedMatcher(
{allow_rule, redirect_rule_2},
CreateTemporarySource(kSource2ID, kSource2Priority), &matcher_2));
// Create a composite matcher with the two rulesets.
std::vector<std::unique_ptr<RulesetMatcher>> matchers;
matchers.push_back(std::move(matcher_1));
matchers.push_back(std::move(matcher_2));
auto composite_matcher =
std::make_unique<CompositeMatcher>(std::move(matchers));
GURL google_url = GURL("http://google.com");
RequestParams google_params;
google_params.url = &google_url;
google_params.element_type = url_pattern_index::flat::ElementType_SUBDOCUMENT;
google_params.is_third_party = false;
// The second ruleset should get more priority.
EXPECT_FALSE(
composite_matcher->GetBlockOrCollapseAction(google_params).has_value());
GURL example_url = GURL("http://example.com");
RequestParams example_params;
example_params.url = &example_url;
example_params.element_type =
url_pattern_index::flat::ElementType_SUBDOCUMENT;
example_params.is_third_party = false;
RedirectActionInfo action_info = composite_matcher->GetRedirectAction(
example_params, PageAccess::kAllowed);
ASSERT_TRUE(action_info.action);
EXPECT_EQ(GURL("http://ruleset2.com"), action_info.action->redirect_url);
EXPECT_FALSE(action_info.notify_request_withheld);
// Now switch the priority of the two rulesets. This requires re-constructing
// the two ruleset matchers.
matcher_1.reset();
matcher_2.reset();
matchers.clear();
ASSERT_TRUE(CreateVerifiedMatcher(
{block_rule, redirect_rule_1},
CreateTemporarySource(kSource1ID, kSource2Priority), &matcher_1));
ASSERT_TRUE(CreateVerifiedMatcher(
{allow_rule, redirect_rule_2},
CreateTemporarySource(kSource2ID, kSource1Priority), &matcher_2));
matchers.push_back(std::move(matcher_1));
matchers.push_back(std::move(matcher_2));
composite_matcher = std::make_unique<CompositeMatcher>(std::move(matchers));
// Reusing request params means that their allow_rule_caches must be cleared.
google_params.allow_rule_cache.clear();
example_params.allow_rule_cache.clear();
// The first ruleset should get more priority.
EXPECT_TRUE(
composite_matcher->GetBlockOrCollapseAction(google_params).has_value());
action_info = composite_matcher->GetRedirectAction(example_params,
PageAccess::kAllowed);
ASSERT_TRUE(action_info.action);
EXPECT_EQ(GURL("http://ruleset1.com"), action_info.action->redirect_url);
EXPECT_FALSE(action_info.notify_request_withheld);
}
// Ensure allow rules in a higher priority matcher override redirect
// and removeHeader rules from lower priority matchers.
TEST_F(CompositeMatcherTest, AllowRuleOverrides) {
TestRule allow_rule_1 = CreateGenericRule();
allow_rule_1.id = kMinValidID;
allow_rule_1.condition->url_filter = std::string("google.com");
allow_rule_1.action->type = std::string("allow");
TestRule remove_headers_rule_1 = CreateGenericRule();
remove_headers_rule_1.id = kMinValidID + 1;
remove_headers_rule_1.condition->url_filter = std::string("example.com");
remove_headers_rule_1.action->type = std::string("removeHeaders");
remove_headers_rule_1.action->remove_headers_list =
std::vector<std::string>({"referer", "setCookie"});
// Create the first ruleset matcher, which allows requests to google.com and
// removes headers from requests to example.com.
const size_t kSource1ID = 1;
const size_t kSource1Priority = 1;
std::unique_ptr<RulesetMatcher> matcher_1;
ASSERT_TRUE(CreateVerifiedMatcher(
{allow_rule_1, remove_headers_rule_1},
CreateTemporarySource(kSource1ID, kSource1Priority), &matcher_1));
// Now set up rules and the second matcher.
TestRule allow_rule_2 = allow_rule_1;
allow_rule_2.condition->url_filter = std::string("example.com");
TestRule redirect_rule_2 = CreateGenericRule();
redirect_rule_2.condition->url_filter = std::string("google.com");
redirect_rule_2.priority = kMinValidPriority;
redirect_rule_2.action->type = std::string("redirect");
redirect_rule_2.action->redirect.emplace();
redirect_rule_2.action->redirect->url = std::string("http://ruleset2.com");
redirect_rule_2.id = kMinValidID + 1;
// Create a second ruleset matcher, which allows requests to example.com and
// redirects requests to google.com.
const size_t kSource2ID = 2;
const size_t kSource2Priority = 2;
std::unique_ptr<RulesetMatcher> matcher_2;
ASSERT_TRUE(CreateVerifiedMatcher(
{allow_rule_2, redirect_rule_2},
CreateTemporarySource(kSource2ID, kSource2Priority), &matcher_2));
// Create a composite matcher with the two rulesets.
std::vector<std::unique_ptr<RulesetMatcher>> matchers;
matchers.push_back(std::move(matcher_1));
matchers.push_back(std::move(matcher_2));
auto composite_matcher =
std::make_unique<CompositeMatcher>(std::move(matchers));
// Send a request to google.com which should be redirected.
GURL google_url = GURL("http://google.com");
RequestParams google_params;
google_params.url = &google_url;
google_params.element_type = url_pattern_index::flat::ElementType_SUBDOCUMENT;
google_params.is_third_party = false;
// The second ruleset should get more priority.
RedirectActionInfo action_info =
composite_matcher->GetRedirectAction(google_params, PageAccess::kAllowed);
ASSERT_TRUE(action_info.action);
EXPECT_EQ(GURL("http://ruleset2.com"), action_info.action->redirect_url);
EXPECT_FALSE(action_info.notify_request_withheld);
// Send a request to example.com with headers, expect the allow rule to be
// matched and the headers to remain.
GURL example_url = GURL("http://example.com");
RequestParams example_params;
example_params.url = &example_url;
example_params.element_type =
url_pattern_index::flat::ElementType_SUBDOCUMENT;
example_params.is_third_party = false;
// Expect no headers to be removed.
std::vector<RequestAction> remove_header_actions;
EXPECT_EQ(0u, composite_matcher->GetRemoveHeadersMask(
example_params, 0u, &remove_header_actions));
EXPECT_TRUE(remove_header_actions.empty());
remove_header_actions.clear();
// Now switch the priority of the two rulesets. This requires re-constructing
// the two ruleset matchers.
matcher_1.reset();
matcher_2.reset();
matchers.clear();
ASSERT_TRUE(CreateVerifiedMatcher(
{allow_rule_1, remove_headers_rule_1},
CreateTemporarySource(kSource1ID, kSource2Priority), &matcher_1));
ASSERT_TRUE(CreateVerifiedMatcher(
{allow_rule_2, redirect_rule_2},
CreateTemporarySource(kSource2ID, kSource1Priority), &matcher_2));
matchers.push_back(std::move(matcher_1));
matchers.push_back(std::move(matcher_2));
composite_matcher = std::make_unique<CompositeMatcher>(std::move(matchers));
// Reusing request params means that their allow_rule_caches must be cleared.
google_params.allow_rule_cache.clear();
example_params.allow_rule_cache.clear();
// The first ruleset should get more priority and so the request to google.com
// should not be redirected.
action_info =
composite_matcher->GetRedirectAction(google_params, PageAccess::kAllowed);
EXPECT_FALSE(action_info.action.has_value());
EXPECT_FALSE(action_info.notify_request_withheld);
// The request to example.com should now have its headers removed.
example_params.allow_rule_cache.clear();
uint8_t expected_mask =
kRemoveHeadersMask_Referer | kRemoveHeadersMask_SetCookie;
EXPECT_EQ(expected_mask, composite_matcher->GetRemoveHeadersMask(
example_params, 0u, &remove_header_actions));
ASSERT_EQ(1u, remove_header_actions.size());
RequestAction expected_action =
CreateRequestActionForTesting(RequestAction::Type::REMOVE_HEADERS);
expected_action.request_headers_to_remove.push_back(
net::HttpRequestHeaders::kReferer);
expected_action.response_headers_to_remove.push_back("set-cookie");
EXPECT_EQ(expected_action, remove_header_actions[0]);
}
// Tests that header masks are correctly attributed to rules for multiple
// matchers in a CompositeMatcher.
TEST_F(CompositeMatcherTest, HeadersMaskForRules) {
auto create_remove_headers_rule =
[](int id, const std::string& url_filter,
const std::vector<std::string>& remove_headers_list) {
TestRule rule = CreateGenericRule();
rule.id = id;
rule.condition->url_filter = url_filter;
rule.action->type = std::string("removeHeaders");
rule.action->remove_headers_list = remove_headers_list;
return rule;
};
TestRule static_rule_1 = create_remove_headers_rule(
kMinValidID, "g*", std::vector<std::string>({"referer", "cookie"}));
TestRule static_rule_2 = create_remove_headers_rule(
kMinValidID + 1, "g*", std::vector<std::string>({"setCookie"}));
TestRule dynamic_rule_1 = create_remove_headers_rule(
kMinValidID, "google.com", std::vector<std::string>({"referer"}));
TestRule dynamic_rule_2 = create_remove_headers_rule(
kMinValidID + 2, "google.com", std::vector<std::string>({"setCookie"}));
// Create the first ruleset matcher, which matches all requests with "g" in
// their URL.
const size_t kSource1ID = 1;
const size_t kSource1Priority = 1;
std::unique_ptr<RulesetMatcher> matcher_1;
ASSERT_TRUE(CreateVerifiedMatcher(
{static_rule_1, static_rule_2},
CreateTemporarySource(kSource1ID, kSource1Priority), &matcher_1));
// Create a second ruleset matcher, which matches all requests from
// |google.com|.
const size_t kSource2ID = 2;
const size_t kSource2Priority = 2;
std::unique_ptr<RulesetMatcher> matcher_2;
ASSERT_TRUE(CreateVerifiedMatcher(
{dynamic_rule_1, dynamic_rule_2},
CreateTemporarySource(kSource2ID, kSource2Priority), &matcher_2));
// Create a composite matcher with the two rulesets.
std::vector<std::unique_ptr<RulesetMatcher>> matchers;
matchers.push_back(std::move(matcher_1));
matchers.push_back(std::move(matcher_2));
auto composite_matcher =
std::make_unique<CompositeMatcher>(std::move(matchers));
GURL google_url = GURL("http://google.com");
RequestParams google_params;
google_params.url = &google_url;
google_params.element_type = url_pattern_index::flat::ElementType_SUBDOCUMENT;
google_params.is_third_party = false;
const uint8_t expected_mask = kRemoveHeadersMask_Referer |
kRemoveHeadersMask_Cookie |
kRemoveHeadersMask_SetCookie;
std::vector<RequestAction> actions;
EXPECT_EQ(expected_mask, composite_matcher->GetRemoveHeadersMask(
google_params, 0u, &actions));
// Construct expected request actions to be taken for a request to google.com.
// Static actions are attributed to |matcher_1| and dynamic actions are
// attributed to |matcher_2|.
RequestAction static_action_1 =
CreateRequestActionForTesting(RequestAction::Type::REMOVE_HEADERS);
static_action_1.request_headers_to_remove.push_back(
net::HttpRequestHeaders::kCookie);
RequestAction dynamic_action_1 =
CreateRequestActionForTesting(RequestAction::Type::REMOVE_HEADERS);
dynamic_action_1.request_headers_to_remove.push_back(
net::HttpRequestHeaders::kReferer);
RequestAction dynamic_action_2 =
CreateRequestActionForTesting(RequestAction::Type::REMOVE_HEADERS);
dynamic_action_2.response_headers_to_remove.push_back("set-cookie");
std::vector<RequestAction> expected_actions;
expected_actions.push_back(std::move(static_action_1));
expected_actions.push_back(std::move(dynamic_action_1));
expected_actions.push_back(std::move(dynamic_action_2));
EXPECT_TRUE(AreRequestActionsEqual(expected_actions, actions));
GURL gmail_url = GURL("http://gmail.com");
RequestParams gmail_params;
gmail_params.url = &gmail_url;
gmail_params.element_type = url_pattern_index::flat::ElementType_SUBDOCUMENT;
gmail_params.is_third_party = false;
actions.clear();
EXPECT_EQ(expected_mask, composite_matcher->GetRemoveHeadersMask(
gmail_params, 0u, &actions));
// Reinitialize |static_action_1| as the original |static_action_1| is owned
// by |expected_actions| and will be deleted when |expected_actions| is
// cleared.
static_action_1 =
CreateRequestActionForTesting(RequestAction::Type::REMOVE_HEADERS);
static_action_1.request_headers_to_remove.push_back(
net::HttpRequestHeaders::kCookie);
static_action_1.request_headers_to_remove.push_back(
net::HttpRequestHeaders::kReferer);
RequestAction static_action_2 =
CreateRequestActionForTesting(RequestAction::Type::REMOVE_HEADERS);
static_action_2.response_headers_to_remove.push_back("set-cookie");
expected_actions.clear();
expected_actions.push_back(std::move(static_action_1));
expected_actions.push_back(std::move(static_action_2));
EXPECT_TRUE(AreRequestActionsEqual(expected_actions, actions));
}
// Ensure CompositeMatcher detects requests to be notified based on the rule
// matched and whether the extenion has access to the request.
TEST_F(CompositeMatcherTest, NotifyWithholdFromPageAccess) {
TestRule redirect_rule = CreateGenericRule();
redirect_rule.condition->url_filter = std::string("google.com");
redirect_rule.priority = kMinValidPriority;
redirect_rule.action->type = std::string("redirect");
redirect_rule.action->redirect.emplace();
redirect_rule.action->redirect->url = std::string("http://ruleset1.com");
redirect_rule.id = kMinValidID;
TestRule upgrade_rule = CreateGenericRule();
upgrade_rule.condition->url_filter = std::string("example.com");
upgrade_rule.priority = kMinValidPriority + 1;
upgrade_rule.action->type = std::string("upgradeScheme");
upgrade_rule.id = kMinValidID + 1;
const size_t kSource1ID = 1;
const size_t kSource1Priority = 1;
std::unique_ptr<RulesetMatcher> matcher_1;
ASSERT_TRUE(CreateVerifiedMatcher(
{redirect_rule, upgrade_rule},
CreateTemporarySource(kSource1ID, kSource1Priority), &matcher_1));
// Create a composite matcher.
std::vector<std::unique_ptr<RulesetMatcher>> matchers;
matchers.push_back(std::move(matcher_1));
auto composite_matcher =
std::make_unique<CompositeMatcher>(std::move(matchers));
GURL google_url = GURL("http://google.com");
GURL example_url = GURL("http://example.com");
GURL yahoo_url = GURL("http://yahoo.com");
GURL ruleset1_url = GURL("http://ruleset1.com");
GURL https_example_url = GURL("https://example.com");
struct {
GURL& request_url;
PageAccess access;
base::Optional<GURL> expected_final_url;
bool should_notify_withheld;
} test_cases[] = {
// If access to the request is allowed, we should not notify that
// the request is withheld.
{google_url, PageAccess::kAllowed, ruleset1_url, false},
{example_url, PageAccess::kAllowed, https_example_url, false},
{yahoo_url, PageAccess::kAllowed, base::nullopt, false},
// Notify the request is withheld if it matches with a redirect rule.
{google_url, PageAccess::kWithheld, base::nullopt, true},
// If the page access to the request is withheld but it matches with
// an upgrade rule, or no rule, then we should not notify.
{example_url, PageAccess::kWithheld, https_example_url, false},
{yahoo_url, PageAccess::kWithheld, base::nullopt, false},
// If access to the request is denied instead of withheld, the extension
// should not be notified.
{google_url, PageAccess::kDenied, base::nullopt, false},
// If the page access to the request is denied but it matches with
// an upgrade rule, or no rule, then we should not notify.
{example_url, PageAccess::kDenied, https_example_url, false},
{yahoo_url, PageAccess::kDenied, base::nullopt, false},
};
for (const auto& test_case : test_cases) {
RequestParams params;
params.url = &test_case.request_url;
params.element_type = url_pattern_index::flat::ElementType_SUBDOCUMENT;
params.is_third_party = false;
RedirectActionInfo redirect_action_info =
composite_matcher->GetRedirectAction(params, test_case.access);
EXPECT_EQ(test_case.should_notify_withheld,
redirect_action_info.notify_request_withheld);
}
}
// Tests that the redirect url within an extension's ruleset is chosen based on
// the highest priority matching rule.
TEST_F(CompositeMatcherTest, GetRedirectUrlFromPriority) {
TestRule abc_redirect = CreateGenericRule();
abc_redirect.condition->url_filter = std::string("*abc*");
abc_redirect.priority = kMinValidPriority;
abc_redirect.action->type = std::string("redirect");
abc_redirect.action->redirect.emplace();
abc_redirect.action->redirect->url = std::string("http://google.com");
abc_redirect.id = kMinValidID;
TestRule def_upgrade = CreateGenericRule();
def_upgrade.condition->url_filter = std::string("*def*");
def_upgrade.priority = kMinValidPriority + 1;
def_upgrade.action->type = std::string("upgradeScheme");
def_upgrade.id = kMinValidID + 1;
TestRule ghi_redirect = CreateGenericRule();
ghi_redirect.condition->url_filter = std::string("*ghi*");
ghi_redirect.priority = kMinValidPriority + 2;
ghi_redirect.action->type = std::string("redirect");
ghi_redirect.action->redirect.emplace();
ghi_redirect.action->redirect->url = std::string("http://example.com");
ghi_redirect.id = kMinValidID + 2;
// In terms of priority: ghi > def > abc.
const size_t kSource1ID = 1;
const size_t kSource1Priority = 1;
std::unique_ptr<RulesetMatcher> matcher_1;
ASSERT_TRUE(CreateVerifiedMatcher(
{abc_redirect, def_upgrade, ghi_redirect},
CreateTemporarySource(kSource1ID, kSource1Priority), &matcher_1));
// Create a composite matcher.
std::vector<std::unique_ptr<RulesetMatcher>> matchers;
matchers.push_back(std::move(matcher_1));
auto composite_matcher =
std::make_unique<CompositeMatcher>(std::move(matchers));
struct {
GURL request_url;
base::Optional<GURL> expected_final_url;
} test_cases[] = {
// Test requests which match exactly one rule.
{GURL("http://abc.com"), GURL("http://google.com")},
{GURL("http://def.com"), GURL("https://def.com")},
{GURL("http://ghi.com"), GURL("http://example.com")},
// The upgrade rule has a higher priority than the redirect rule matched
// so the request should be upgraded.
{GURL("http://abcdef.com"), GURL("https://abcdef.com")},
// The upgrade rule has a lower priority than the redirect rule matched so
// the request should be redirected.
{GURL("http://defghi.com"), GURL("http://example.com")},
// The request should be redirected as it does not match the upgrade rule
// because of its scheme.
{GURL("https://abcdef.com"), GURL("http://google.com")},
{GURL("http://xyz.com"), base::nullopt},
};
for (const auto& test_case : test_cases) {
RequestParams params;
params.url = &test_case.request_url;
params.element_type = url_pattern_index::flat::ElementType_SUBDOCUMENT;
params.is_third_party = false;
RedirectActionInfo redirect_action_info =
composite_matcher->GetRedirectAction(params, PageAccess::kAllowed);
if (test_case.expected_final_url) {
ASSERT_TRUE(redirect_action_info.action);
EXPECT_EQ(test_case.expected_final_url,
redirect_action_info.action->redirect_url);
} else {
EXPECT_FALSE(redirect_action_info.action.has_value());
}
EXPECT_FALSE(redirect_action_info.notify_request_withheld);
}
}
} // namespace declarative_net_request
} // namespace extensions
| [
"commit-bot@chromium.org"
] | commit-bot@chromium.org |
96b016cf6884da8d1397d2555267d60f3e034a46 | 26df6604faf41197c9ced34c3df13839be6e74d4 | /src/org/apache/poi/sl/draw/binding/CTGroupTransform2D.cpp | 2a1c1bd9d5f0fbd46518e8cc6d7f8ec261d8d41c | [
"Apache-2.0"
] | permissive | pebble2015/cpoi | 58b4b1e38a7769b13ccfb2973270d15d490de07f | 6dcc0c5e13e3e722b4ef9fd0baffbf62bf71ead6 | refs/heads/master | 2021-07-09T09:02:41.986901 | 2017-10-08T12:12:56 | 2017-10-08T12:12:56 | 105,988,119 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,963 | cpp | // Generated from /POI/java/org/apache/poi/sl/draw/binding/CTGroupTransform2D.java
#include <org/apache/poi/sl/draw/binding/CTGroupTransform2D.hpp>
#include <java/lang/Boolean.hpp>
#include <java/lang/Integer.hpp>
#include <java/lang/NullPointerException.hpp>
#include <org/apache/poi/sl/draw/binding/CTPoint2D.hpp>
#include <org/apache/poi/sl/draw/binding/CTPositiveSize2D.hpp>
template<typename T>
static T* npc(T* t)
{
if(!t) throw new ::java::lang::NullPointerException();
return t;
}
poi::sl::draw::binding::CTGroupTransform2D::CTGroupTransform2D(const ::default_init_tag&)
: super(*static_cast< ::default_init_tag* >(0))
{
clinit();
}
poi::sl::draw::binding::CTGroupTransform2D::CTGroupTransform2D()
: CTGroupTransform2D(*static_cast< ::default_init_tag* >(0))
{
ctor();
}
poi::sl::draw::binding::CTPoint2D* poi::sl::draw::binding::CTGroupTransform2D::getOff()
{
return off;
}
void poi::sl::draw::binding::CTGroupTransform2D::setOff(CTPoint2D* value)
{
this->off = value;
}
bool poi::sl::draw::binding::CTGroupTransform2D::isSetOff()
{
return (this->off != nullptr);
}
poi::sl::draw::binding::CTPositiveSize2D* poi::sl::draw::binding::CTGroupTransform2D::getExt()
{
return ext;
}
void poi::sl::draw::binding::CTGroupTransform2D::setExt(CTPositiveSize2D* value)
{
this->ext = value;
}
bool poi::sl::draw::binding::CTGroupTransform2D::isSetExt()
{
return (this->ext != nullptr);
}
poi::sl::draw::binding::CTPoint2D* poi::sl::draw::binding::CTGroupTransform2D::getChOff()
{
return chOff;
}
void poi::sl::draw::binding::CTGroupTransform2D::setChOff(CTPoint2D* value)
{
this->chOff = value;
}
bool poi::sl::draw::binding::CTGroupTransform2D::isSetChOff()
{
return (this->chOff != nullptr);
}
poi::sl::draw::binding::CTPositiveSize2D* poi::sl::draw::binding::CTGroupTransform2D::getChExt()
{
return chExt;
}
void poi::sl::draw::binding::CTGroupTransform2D::setChExt(CTPositiveSize2D* value)
{
this->chExt = value;
}
bool poi::sl::draw::binding::CTGroupTransform2D::isSetChExt()
{
return (this->chExt != nullptr);
}
int32_t poi::sl::draw::binding::CTGroupTransform2D::getRot()
{
if(rot == nullptr) {
return 0;
} else {
return (npc(rot))->intValue();
}
}
void poi::sl::draw::binding::CTGroupTransform2D::setRot(int32_t value)
{
this->rot = ::java::lang::Integer::valueOf(value);
}
bool poi::sl::draw::binding::CTGroupTransform2D::isSetRot()
{
return (this->rot != nullptr);
}
void poi::sl::draw::binding::CTGroupTransform2D::unsetRot()
{
this->rot = nullptr;
}
bool poi::sl::draw::binding::CTGroupTransform2D::isFlipH()
{
if(flipH == nullptr) {
return false;
} else {
return (npc(flipH))->booleanValue();
}
}
void poi::sl::draw::binding::CTGroupTransform2D::setFlipH(bool value)
{
this->flipH = ::java::lang::Boolean::valueOf(value);
}
bool poi::sl::draw::binding::CTGroupTransform2D::isSetFlipH()
{
return (this->flipH != nullptr);
}
void poi::sl::draw::binding::CTGroupTransform2D::unsetFlipH()
{
this->flipH = nullptr;
}
bool poi::sl::draw::binding::CTGroupTransform2D::isFlipV()
{
if(flipV == nullptr) {
return false;
} else {
return (npc(flipV))->booleanValue();
}
}
void poi::sl::draw::binding::CTGroupTransform2D::setFlipV(bool value)
{
this->flipV = ::java::lang::Boolean::valueOf(value);
}
bool poi::sl::draw::binding::CTGroupTransform2D::isSetFlipV()
{
return (this->flipV != nullptr);
}
void poi::sl::draw::binding::CTGroupTransform2D::unsetFlipV()
{
this->flipV = nullptr;
}
extern java::lang::Class *class_(const char16_t *c, int n);
java::lang::Class* poi::sl::draw::binding::CTGroupTransform2D::class_()
{
static ::java::lang::Class* c = ::class_(u"org.apache.poi.sl.draw.binding.CTGroupTransform2D", 49);
return c;
}
java::lang::Class* poi::sl::draw::binding::CTGroupTransform2D::getClass0()
{
return class_();
}
| [
"zhang.chen.yu@outlook.com"
] | zhang.chen.yu@outlook.com |
4fc31869d4cce16075f4e3de90ae0aa86b1610c3 | c108353546cee4c5642a1e37eff3ec7d50b396a9 | /つっぱり超相撲a版/dohyo.h | 7e04698c0129fc4f68273ee3e37ed85217f57a75 | [] | no_license | YoshiroAraya/TEAM_E_Ver.2 | 231494e70b9eeb4779c93d0351de7d99e8b14b4a | efb04be9b28a886209d43aad6d6d202ddb20ace1 | refs/heads/master | 2022-02-22T00:43:08.478535 | 2019-10-03T02:34:59 | 2019-10-03T02:34:59 | 186,321,163 | 0 | 0 | null | 2019-05-15T00:58:29 | 2019-05-13T00:47:43 | RPC | SHIFT_JIS | C++ | false | false | 1,421 | h | //=============================================================================
//
// 土俵処理 [dohyo.h]
// Author : 長山拓実
//
//=============================================================================
#ifndef _DOHYO_H_
#define _DOHYO_H_
#include "main.h"
#include "sceneX.h"
//========================================
// マクロ定義
//========================================
//========================================
// クラスの定義
//========================================
//=====================
// 土俵クラス
//=====================
class CDohyo : public CSceneX
{
public:
CDohyo(); // コンストラクタ
~CDohyo(); // デストラクタ
HRESULT Init(D3DXVECTOR3 pos); // 土俵初期化処理
void Uninit(void); // 土俵終了処理
void Update(void); // 土俵更新処理
void Draw(void); // 土俵描画処理
static HRESULT LoadModel(void); // モデル読み込み
static void UnloadModel(void); // モデルテクスチャ解放
static HRESULT LoadMat(void); // マテリアル読み込み
static void UnloadMat(void); // マテリアル解放
static CDohyo *Create(D3DXVECTOR3 pos); // オブジェクトの生成
private:
static LPDIRECT3DTEXTURE9 *m_pTexture; // テクスチャへのポインタ
LPDIRECT3DVERTEXBUFFER9 m_pVtxBuff; // 頂点バッファへのポインタ
D3DXMATRIX m_mtxWorld; // ワールドマトリックス
};
#endif
| [
"megumiki0718@gmail.com"
] | megumiki0718@gmail.com |
c34072ec0f6674e628a72e2e2503e4116313fda1 | b84aa8a1745f3346f22b9a0ae1c977a244dfb3cd | /SDK/RC_SettingsInfo_BindReload_classes.hpp | f3e7314495992dcad9bae4e2c0ec7ab5c7c07de4 | [] | no_license | frankie-11/Rogue-SDK-11.8 | 615a9e51f280a504bb60a4cbddb8dfc4de6239d8 | 20becc4b2fff71cfec160fb7f2ee3a9203031d09 | refs/heads/master | 2023-01-10T06:00:59.427605 | 2020-11-08T16:13:01 | 2020-11-08T16:13:01 | 311,102,184 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 690 | hpp | #pragma once
// RogueCompany (4.24) SDK
#ifdef _MSC_VER
#pragma pack(push, 0x8)
#endif
namespace SDK
{
//---------------------------------------------------------------------------
//Classes
//---------------------------------------------------------------------------
// BlueprintGeneratedClass SettingsInfo_BindReload.SettingsInfo_BindReload_C
// 0xFFFFFFFFA2474080 (0x0000 - 0x5DB8BF80)
class USettingsInfo_BindReload_C : public UKSSettingsInfo_Binding
{
public:
static UClass* StaticClass()
{
static auto ptr = UObject::FindClass("BlueprintGeneratedClass SettingsInfo_BindReload.SettingsInfo_BindReload_C");
return ptr;
}
};
}
#ifdef _MSC_VER
#pragma pack(pop)
#endif
| [
"60810131+frankie-11@users.noreply.github.com"
] | 60810131+frankie-11@users.noreply.github.com |
9c7e5e12349677f168191df69fde2b6646f43c76 | 25b4afbcad749a833504269be17a9ad785370fef | /Pod/musicFramework/core/elements/MetronomeNote.h | 8fa7af832975924086ded34b31c27d33438cf430 | [
"MIT"
] | permissive | Bone111/MusicXMLParser | 87eee0a990a49a57a54a59e6ef2baa981c83a740 | 674f6b52634abb95008cc04ee02f4df0055851a6 | refs/heads/master | 2020-03-27T04:26:35.847365 | 2017-09-30T08:19:53 | 2017-09-30T08:19:53 | 145,939,832 | 3 | 2 | MIT | 2018-08-24T03:51:52 | 2018-08-24T03:51:51 | null | UTF-8 | C++ | false | false | 2,890 | h | // MusicXML Class Library
// Copyright (c) by Matthew James Briggs
// Distributed under the MIT License
#pragma once
#include "../../core/ForwardDeclare.h"
#include "../../core/ElementInterface.h"
#include <iosfwd>
#include <memory>
#include <vector>
namespace mx
{
namespace core
{
MX_FORWARD_DECLARE_ELEMENT( MetronomeBeam )
MX_FORWARD_DECLARE_ELEMENT( MetronomeDot )
MX_FORWARD_DECLARE_ELEMENT( MetronomeTuplet )
MX_FORWARD_DECLARE_ELEMENT( MetronomeType )
MX_FORWARD_DECLARE_ELEMENT( MetronomeNote )
inline MetronomeNotePtr makeMetronomeNote() { return std::make_shared<MetronomeNote>(); }
class MetronomeNote : public ElementInterface
{
public:
MetronomeNote();
virtual bool hasAttributes() const;
virtual std::ostream& streamAttributes( std::ostream& os ) const;
virtual std::ostream& streamName( std::ostream& os ) const;
virtual bool hasContents() const;
virtual std::ostream& streamContents( std::ostream& os, const int indentLevel, bool& isOneLineOnly ) const;
/* _________ MetronomeType minOccurs = 1, maxOccurs = 1 _________ */
MetronomeTypePtr getMetronomeType() const;
void setMetronomeType( const MetronomeTypePtr& value );
/* _________ MetronomeDot minOccurs = 0, maxOccurs = unbounded _________ */
const MetronomeDotSet& getMetronomeDotSet() const;
void addMetronomeDot( const MetronomeDotPtr& value );
void removeMetronomeDot( const MetronomeDotSetIterConst& value );
void clearMetronomeDotSet();
MetronomeDotPtr getMetronomeDot( const MetronomeDotSetIterConst& setIterator ) const;
/* _________ MetronomeBeam minOccurs = 0, maxOccurs = unbounded _________ */
const MetronomeBeamSet& getMetronomeBeamSet() const;
void addMetronomeBeam( const MetronomeBeamPtr& value );
void removeMetronomeBeam( const MetronomeBeamSetIterConst& value );
void clearMetronomeBeamSet();
MetronomeBeamPtr getMetronomeBeam( const MetronomeBeamSetIterConst& setIterator ) const;
/* _________ MetronomeTuplet minOccurs = 0, maxOccurs = 1 _________ */
MetronomeTupletPtr getMetronomeTuplet() const;
void setMetronomeTuplet( const MetronomeTupletPtr& value );
bool getHasMetronomeTuplet() const;
void setHasMetronomeTuplet( const bool value );
bool fromXElement( std::ostream& message, xml::XElement& xelement );
private:
MetronomeTypePtr myMetronomeType;
MetronomeDotSet myMetronomeDotSet;
MetronomeBeamSet myMetronomeBeamSet;
MetronomeTupletPtr myMetronomeTuplet;
bool myHasMetronomeTuplet;
};
}
}
| [
"403554355@qq.com"
] | 403554355@qq.com |
91f1c1d9362e3689deece091d7fac308d9cefb40 | 346985c30c4da4fb94a85579620c0bbab05cc175 | /file_manipulation_on_C_1.cpp | fa3b2b6a179caf92b00c800545cc00e31f827b88 | [] | no_license | rkreutz/classes | cad454aa951cb497dcb0aa67fc9d2b07eb29e83d | 39923ac0c0eacd6915ca9c4e6cd06163a395521c | refs/heads/master | 2021-01-01T06:32:56.328821 | 2015-05-18T16:53:37 | 2015-05-18T16:53:37 | 35,829,994 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,013 | cpp | #include <cstdlib>
#include <iostream>
#include <stdlib.h>
#include <stdio.h>
int main()
{
FILE *pfile;
char x,arquivo[80],c;
printf("Digite C para criar um arquivo ou L para ler um arquivo.('s' finalizar programa)\n");
while(x!='s')
{
printf("Operacao: ");
gets(&x);
if(x=='C'||x=='c')
{
printf("Digite o nome do seu arquivo: ");
gets(arquivo);
pfile=fopen(arquivo,"w");
while(c!='.')
{
scanf("%c",&c);
fputc(c,pfile);
}
fclose(pfile);
}
if(x=='L'||x=='l')
{
printf("Digite o nome do arquivo: ");
gets(arquivo);
pfile=fopen(arquivo,"r");
if(pfile!=NULL)
{
while(c!=EOF)
{
c=fgetc(pfile);
if(c!=EOF) printf("%c",c);
}
}
else printf("\narquivo nao existe");
fclose(pfile);
}
printf("\n");
}
printf("\n\n\n");
system("PAUSE");
return EXIT_SUCCESS;
}
| [
"rodrigo.kreutz@acad.pucrs.br"
] | rodrigo.kreutz@acad.pucrs.br |
305e406d3a209086cfe19369aa8e8dda20606f9f | c286bfbb9306bf9ba68449b074e5720e4c82f80f | /codeforces/990A.cpp | 7eb1138dbd31c9bc66a200f3ea895976f3b7bd63 | [] | no_license | smarty1palak/cp_summer | 496c773eef0716a99b63570cd670790470b4e0a5 | af0f7cde616c34a3220e72e7955507253658e8df | refs/heads/master | 2021-06-05T14:44:01.839854 | 2019-10-11T12:30:52 | 2019-10-11T12:30:52 | 133,849,944 | 0 | 0 | null | 2019-10-11T12:32:39 | 2018-05-17T17:57:14 | C++ | UTF-8 | C++ | false | false | 246 | cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
long long n,m,a,b;
cin>>n>>m>>a>>b;
if(n%m==0)
cout<<0<<endl;
else
{
long long x=n%m;
long long abolish=x*b;
long long build=(m-x)*a;
cout<<min(abolish,build)<<endl;
}
} | [
"smarty1palak@gmail.com"
] | smarty1palak@gmail.com |
76192ff2d432c0fc755a4cdd144a2793186518fa | 54320ef64dd0548a5b5016feed14c606a5fd1e76 | /Edgar_Hakobyan/Homework/c++/27.10.15/tort.cpp | 7db0bd913502153c68f037e1e82f723d105bbf99 | [] | no_license | ITC-Vanadzor/ITC-7 | 9859ebbd0d824d3a480ea281bbdb14edbb6a374e | d2bfcdc3a1faea4cdc1d7e555404445ac8768c66 | refs/heads/master | 2021-01-17T15:43:29.646485 | 2019-02-17T19:07:36 | 2019-02-17T19:07:36 | 44,699,731 | 0 | 4 | null | 2017-04-13T18:45:36 | 2015-10-21T19:38:34 | JavaScript | UTF-8 | C++ | false | false | 300 | cpp | #include <iostream>
int main()
{
int qanak=0;
std::cout<<"greq hyureri qanak@`";
std::cin>>qanak;
if(qanak%2==0)
{
std::cout<<"ktrvacqneri minimal qanakutyun@ klini` "<<qanak/2<<std::endl;
}
else
{
std::cout<<"ktrvacqneri minimal qanakutyun@ klini` "<<qanak-1<<std::endl;
}
return 0;
}
| [
"edgar-hakobyan-1994@mail.ru"
] | edgar-hakobyan-1994@mail.ru |
650b77b41b0a58a5b34721d8b46527a8b39a64ba | b319692696eefea1d77e76a1817912717493999e | /Labs/Lab18/Questao01.cpp | 8b6623af7e89e23da89798863841f4320e500554 | [] | no_license | JoaoCleiton12/ProgramacaoDeComputadores | 761b7dc0a3af7b429166ddf74f60e1edb10b36bc | 8b001abfed1c8c20456a993a62194a4b7545dfa7 | refs/heads/master | 2023-09-03T14:00:14.380099 | 2021-10-10T23:13:27 | 2021-10-10T23:13:27 | 415,393,424 | 0 | 0 | null | null | null | null | ISO-8859-1 | C++ | false | false | 495 | cpp | #include <iostream>
using namespace std;
int main()
{
int i = 0;
while (++i < 4)
cout << "Oi! ";
do
cout << "Tchau! ";
while (i++ <= 8);
}
/*i inicialmente é igual a 0, durante do laço while, será exibido
tres "Oi!", apos o fim do laço while i assume valor 4. Inicia-se um outro laço,
o Do-While, em que primeiro será exibido "Tchau!" e caso o valor de i(inicialmente é 4,
e sofrerá um incremento de +1) seja menor ou igual a 8, a palavra "Tchau!" continuará sendo exibida.
*/ | [
"joaocleiton60359@gmail.com"
] | joaocleiton60359@gmail.com |
e058eaca011e00cdcdd6ee183c470bfbd4561311 | e8917d1d6381c132a808704654abd13d6a4569e4 | /edge.cpp | 8f3f9b7925b9876914785f3ec3498a89107e9d25 | [] | no_license | ninigino/cvgl | a17a848f4d60dcdef897c1d14c511b746c1b63d5 | e11198014c0bc04b202d07a6e14481d17d5178c3 | refs/heads/master | 2021-08-08T05:08:56.345442 | 2017-11-09T15:51:09 | 2017-11-09T15:51:09 | 110,132,631 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,662 | cpp | #include <opencv2/opencv.hpp>
#include <stdio.h>
#define FLAG 0
char *preset_file = "fruits.jpg";
void convertColorToGray(cv::Mat &input, cv::Mat &processed);
void func_sobel(cv::Mat &input, cv::Mat &processed);
int main(int argc, char *argv[]){
char *input_file;
cv::Mat input, gray, processed;
if(argc == 2){
input_file = argv[1];
}
else{
input_file = preset_file;
}
input = cv::imread(input_file, 1);
if(input.empty()){
fprintf(stderr, "cannot open %s\n", input_file);
exit(0);
}
//convertColorToGray(input, gray);
func_sobel(input, processed);
cv::namedWindow("original image", 1);
cv::namedWindow("processed image", 1);
cv::imshow("original image", input);
cv::imshow("processed image", processed);
cv::waitKey(0);
cv::imwrite("processed.jpg", processed);
return 0;
}
void convertColorToGray(cv::Mat &input, cv::Mat &processed){
#if FLAGS //use built-in function
cv::Mat temp;
std::vector<cv::Mat> planes;
cv::cvtColor(input, temp, cv_BGR2YCrCb);
cv::split(temp, planes);
processed = planes[0];
#else
cv::Size s = input.size();
processed.create(s, CV_8UC1);
for(int j=0; j<s.height; j++){
uchar *ptr1, *ptr2;
ptr1 = input.ptr<uchar>(j);
ptr2 = processed.ptr<uchar>(j);
for(int i=0; i<s.width; i++){
double y = 0.114 * ((double)ptr1[0] + 0.587 * (double)ptr1[1] + 0.299 * (double)ptr1[2]);
if(y > 255) y = 255;
if(y < 0) y = 0;
*ptr2 = (uchar)y;
ptr1 += 3;
ptr2++;
}
}
#endif
}
void func_sobel(cv::Mat &input, cv::Mat &processed){
cv::Mat temp;
cv::Sobel(input, temp, CV_8U, 1, 1);
processed = temp;
}
| [
"hyuga.hmn15@gmail.com"
] | hyuga.hmn15@gmail.com |
b555655f918d0dfb220143202f2143050e2bc276 | cee57f404a35751595d610215ceba027af1e10c4 | /Tutorials/compressible/obliqueShock/0.004/U | 671c5b879a8d327c07e31c94757ff9b410593c9a | [] | no_license | AAShevelev/HLLCFoam | de1313535496b657b078cb13f6eb10cc666c9cd0 | 022e730047c3f67d0c394894e2300acfa6d44873 | refs/heads/master | 2022-11-26T14:30:35.242410 | 2020-07-27T09:09:55 | 2020-07-27T09:09:55 | 282,840,750 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 226,704 | /*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1812 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
location "0.004";
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -1 0 0 0 0];
internalField nonuniform List<vector>
8475
(
(851.84 3.06604e-14 0)
(851.84 1.66893e-13 0)
(851.84 4.69425e-14 0)
(851.84 -1.0088e-13 0)
(851.84 -2.48845e-13 0)
(851.84 -2.31003e-13 0)
(851.84 -2.56161e-13 0)
(851.84 -1.54008e-13 0)
(851.84 -4.39192e-13 0)
(851.84 -5.28428e-13 0)
(851.84 -4.61927e-13 0)
(851.84 -4.96514e-13 0)
(851.84 -4.4288e-13 0)
(851.84 -3.98322e-13 0)
(851.84 -2.7746e-13 0)
(851.84 5.56939e-13 0)
(851.84 1.14561e-12 0)
(851.84 1.08111e-12 0)
(851.84 1.88021e-12 0)
(851.84 1.83351e-12 0)
(851.84 2.2548e-12 0)
(851.84 2.30915e-12 0)
(851.84 2.42569e-12 0)
(851.84 2.83732e-12 0)
(851.84 3.18082e-12 0)
(851.84 3.12794e-12 0)
(851.84 3.50976e-12 0)
(851.84 3.11386e-12 0)
(851.84 3.47268e-12 0)
(851.84 2.35548e-12 0)
(851.84 2.42105e-12 0)
(851.84 5.39319e-13 0)
(851.84 2.22159e-10 0)
(851.84 -8.10653e-09 0)
(851.84 8.9135e-07 0)
(851.84 -3.21486e-05 0)
(851.832 0.0040889 0)
(851.349 -0.155857 0)
(851.84 1.81987e-13 0)
(851.84 5.02028e-15 0)
(851.84 -1.69182e-13 0)
(851.84 -1.29686e-13 0)
(851.84 -2.57564e-13 0)
(851.84 -2.43006e-13 0)
(851.84 -3.2509e-13 0)
(851.84 -4.64156e-13 0)
(851.84 -4.12072e-13 0)
(851.84 -5.49481e-13 0)
(851.84 -5.5779e-13 0)
(851.84 -4.98983e-13 0)
(851.84 -7.53387e-13 0)
(851.84 -7.68921e-13 0)
(851.84 -4.72871e-13 0)
(851.84 1.00741e-13 0)
(851.84 -9.16492e-14 0)
(851.84 1.6244e-13 0)
(851.84 7.09402e-13 0)
(851.84 9.71962e-13 0)
(851.84 1.1882e-12 0)
(851.84 1.26734e-12 0)
(851.84 1.50413e-12 0)
(851.84 1.4554e-12 0)
(851.84 1.69749e-12 0)
(851.84 1.43452e-12 0)
(851.84 1.61281e-12 0)
(851.84 1.53646e-12 0)
(851.84 1.38605e-12 0)
(851.84 1.28202e-12 0)
(851.84 1.23277e-12 0)
(851.84 3.74738e-12 0)
(851.84 1.45538e-10 0)
(851.84 1.20616e-08 0)
(851.84 4.48885e-07 0)
(851.84 5.08411e-05 0)
(851.837 0.00131 0)
(851.72 0.193085 0)
(851.84 -2.96259e-14 0)
(851.84 -2.36063e-13 0)
(851.84 -1.39863e-13 0)
(851.84 -1.87736e-13 0)
(851.84 -8.70884e-14 0)
(851.84 -5.6122e-13 0)
(851.84 -6.03881e-13 0)
(851.84 -7.35621e-13 0)
(851.84 -3.95971e-13 0)
(851.84 -3.34906e-13 0)
(851.84 -3.41438e-13 0)
(851.84 -4.92306e-13 0)
(851.84 -6.80884e-13 0)
(851.84 -6.55125e-13 0)
(851.84 -6.60227e-13 0)
(851.84 -2.9906e-13 0)
(851.84 -4.20146e-13 0)
(851.84 -4.36605e-13 0)
(851.84 2.69695e-14 0)
(851.84 4.38852e-13 0)
(851.84 2.56915e-13 0)
(851.84 8.3679e-13 0)
(851.84 9.8355e-13 0)
(851.84 1.25335e-12 0)
(851.84 1.21243e-12 0)
(851.84 1.47115e-12 0)
(851.84 1.44908e-12 0)
(851.84 1.5151e-12 0)
(851.84 1.18667e-12 0)
(851.84 1.32835e-12 0)
(851.84 1.03064e-12 0)
(851.84 2.11477e-12 0)
(851.84 4.43098e-11 0)
(851.84 5.41233e-09 0)
(851.84 8.6951e-08 0)
(851.84 1.50897e-05 0)
(851.84 0.000146589 0)
(851.823 0.0330779 0)
(851.84 -2.02026e-13 0)
(851.84 -3.4866e-13 0)
(851.84 1.98675e-15 0)
(851.84 -2.09127e-13 0)
(851.84 -2.41146e-13 0)
(851.84 -4.09963e-13 0)
(851.84 -3.09675e-13 0)
(851.84 -5.24938e-14 0)
(851.84 -1.55383e-13 0)
(851.84 -2.68997e-13 0)
(851.84 -2.76522e-13 0)
(851.84 -1.75979e-13 0)
(851.84 -3.32542e-13 0)
(851.84 -2.16775e-13 0)
(851.84 -5.77804e-13 0)
(851.84 -8.40268e-13 0)
(851.84 -6.7335e-13 0)
(851.84 -5.85713e-13 0)
(851.84 -3.13964e-13 0)
(851.84 -1.28916e-13 0)
(851.84 2.26478e-13 0)
(851.84 2.18011e-13 0)
(851.84 5.95302e-13 0)
(851.84 7.77496e-13 0)
(851.84 1.01982e-12 0)
(851.84 9.89042e-13 0)
(851.84 1.01189e-12 0)
(851.84 1.08966e-12 0)
(851.84 1.02473e-12 0)
(851.84 1.01757e-12 0)
(851.84 8.12955e-13 0)
(851.84 1.52804e-12 0)
(851.84 2.52021e-13 0)
(851.84 1.10573e-09 0)
(851.84 5.25251e-10 0)
(851.84 2.01496e-06 0)
(851.84 1.2199e-06 0)
(851.839 0.00310971 0)
(851.84 -7.34417e-14 0)
(851.84 4.57003e-15 0)
(851.84 -3.8954e-15 0)
(851.84 5.52951e-15 0)
(851.84 -1.16853e-13 0)
(851.84 -1.07653e-13 0)
(851.84 -8.12044e-14 0)
(851.84 -3.92192e-14 0)
(851.84 -1.57319e-13 0)
(851.84 -2.37385e-13 0)
(851.84 -2.81489e-13 0)
(851.84 -6.84088e-13 0)
(851.84 -2.4598e-13 0)
(851.84 -4.50054e-13 0)
(851.84 -5.20196e-13 0)
(851.84 -5.80942e-13 0)
(851.84 -4.66547e-13 0)
(851.84 -6.10564e-13 0)
(851.84 -6.02809e-13 0)
(851.84 -2.82279e-13 0)
(851.84 -3.18984e-13 0)
(851.84 -3.0073e-13 0)
(851.84 -8.26809e-14 0)
(851.84 3.88151e-14 0)
(851.84 4.74629e-14 0)
(851.84 1.15542e-13 0)
(851.84 9.0807e-14 0)
(851.84 -1.11232e-14 0)
(851.84 4.8937e-13 0)
(851.84 4.71395e-13 0)
(851.84 6.75872e-13 0)
(851.84 7.43573e-13 0)
(851.84 5.55941e-13 0)
(851.84 9.44518e-11 0)
(851.84 -1.44313e-10 0)
(851.84 1.27104e-07 0)
(851.84 -7.55015e-08 0)
(851.84 0.000175345 0)
(851.84 -7.62208e-14 0)
(851.84 -9.65096e-15 0)
(851.84 -1.49647e-13 0)
(851.84 -8.07057e-14 0)
(851.84 1.8371e-13 0)
(851.84 3.3195e-13 0)
(851.84 3.72162e-13 0)
(851.84 1.30394e-13 0)
(851.84 -1.6068e-14 0)
(851.84 -5.19377e-14 0)
(851.84 -1.13077e-13 0)
(851.84 3.13941e-14 0)
(851.84 -2.51741e-13 0)
(851.84 -2.37235e-13 0)
(851.84 -6.40518e-14 0)
(851.84 -1.67145e-13 0)
(851.84 -2.70757e-13 0)
(851.84 -3.58719e-13 0)
(851.84 -4.49041e-13 0)
(851.84 -3.15867e-13 0)
(851.84 -6.57762e-13 0)
(851.84 -5.84954e-13 0)
(851.84 -6.93348e-13 0)
(851.84 -6.80495e-13 0)
(851.84 -6.1542e-13 0)
(851.84 -2.68043e-13 0)
(851.84 -3.37946e-13 0)
(851.84 -1.76804e-14 0)
(851.84 6.63617e-14 0)
(851.84 4.1748e-13 0)
(851.84 3.80635e-13 0)
(851.84 1.57018e-13 0)
(851.84 -1.02985e-13 0)
(851.84 3.51183e-12 0)
(851.84 -1.03885e-11 0)
(851.84 5.07826e-09 0)
(851.84 -3.82966e-09 0)
(851.84 7.07205e-06 0)
(851.84 8.49946e-14 0)
(851.84 -1.31564e-14 0)
(851.84 -1.84606e-13 0)
(851.84 -8.30136e-14 0)
(851.84 -1.06853e-13 0)
(851.84 -1.36719e-13 0)
(851.84 -2.95274e-14 0)
(851.84 -1.09567e-13 0)
(851.84 -2.90106e-13 0)
(851.84 -2.4755e-13 0)
(851.84 -1.47234e-13 0)
(851.84 -5.56926e-15 0)
(851.84 -1.3216e-13 0)
(851.84 -3.88274e-14 0)
(851.84 1.57922e-14 0)
(851.84 -1.2118e-13 0)
(851.84 -2.85149e-14 0)
(851.84 -1.82382e-13 0)
(851.84 -5.11722e-13 0)
(851.84 -6.77321e-13 0)
(851.84 -8.03294e-13 0)
(851.84 -6.43874e-13 0)
(851.84 -7.61518e-13 0)
(851.84 -6.4001e-13 0)
(851.84 -5.1461e-13 0)
(851.84 -3.29155e-13 0)
(851.84 -2.71273e-13 0)
(851.84 -2.23759e-13 0)
(851.84 -1.63373e-13 0)
(851.84 -1.75611e-13 0)
(851.84 7.6328e-14 0)
(851.84 2.20888e-14 0)
(851.84 2.74398e-13 0)
(851.84 -3.30139e-13 0)
(851.84 -1.32789e-12 0)
(851.84 1.42735e-10 0)
(851.84 -3.51798e-11 0)
(851.84 2.15857e-07 0)
(851.84 3.07497e-14 0)
(851.84 -1.38863e-13 0)
(851.84 -1.69532e-13 0)
(851.84 -2.80592e-13 0)
(851.84 -2.88455e-13 0)
(851.84 -2.66286e-13 0)
(851.84 -3.44003e-13 0)
(851.84 -2.83868e-13 0)
(851.84 -1.92118e-13 0)
(851.84 -1.95572e-13 0)
(851.84 -1.19167e-13 0)
(851.84 -2.99569e-14 0)
(851.84 7.65664e-14 0)
(851.84 4.16353e-13 0)
(851.84 3.32803e-14 0)
(851.84 1.19743e-13 0)
(851.84 -1.18661e-13 0)
(851.84 -2.18536e-13 0)
(851.84 -4.14548e-13 0)
(851.84 -1.07573e-12 0)
(851.84 -8.96025e-13 0)
(851.84 -8.90263e-13 0)
(851.84 -9.71511e-13 0)
(851.84 -7.73515e-13 0)
(851.84 -7.29336e-13 0)
(851.84 -5.47247e-13 0)
(851.84 -3.61586e-13 0)
(851.84 -3.77196e-13 0)
(851.84 -2.31935e-13 0)
(851.84 -2.59236e-13 0)
(851.84 -2.75718e-13 0)
(851.84 -9.02466e-14 0)
(851.84 -3.09913e-14 0)
(851.84 1.89006e-13 0)
(851.84 -2.33686e-13 0)
(851.84 9.29357e-13 0)
(851.84 -4.05278e-12 0)
(851.84 5.42794e-09 0)
(851.84 -1.3895e-14 0)
(851.84 1.94251e-13 0)
(851.84 -8.88929e-15 0)
(851.84 -1.80099e-13 0)
(851.84 -3.21588e-13 0)
(851.84 -1.5749e-13 0)
(851.84 -8.78789e-14 0)
(851.84 -1.5761e-13 0)
(851.84 -1.32848e-13 0)
(851.84 -9.21757e-14 0)
(851.84 -2.71984e-13 0)
(851.84 -4.743e-13 0)
(851.84 -3.27961e-13 0)
(851.84 -3.38903e-13 0)
(851.84 -2.93306e-13 0)
(851.84 -4.38819e-13 0)
(851.84 -6.19196e-13 0)
(851.84 -4.97608e-13 0)
(851.84 -2.24262e-13 0)
(851.84 -3.08676e-13 0)
(851.84 -4.28227e-13 0)
(851.84 -6.99255e-13 0)
(851.84 -6.94374e-13 0)
(851.84 -1.01038e-12 0)
(851.84 -9.61717e-13 0)
(851.84 -8.44248e-13 0)
(851.84 -6.3136e-13 0)
(851.84 -4.65706e-13 0)
(851.84 -5.10012e-13 0)
(851.84 -2.00786e-13 0)
(851.84 -2.27611e-13 0)
(851.84 -1.43963e-13 0)
(851.84 -1.64687e-14 0)
(851.84 6.89295e-14 0)
(851.84 8.11921e-14 0)
(851.84 5.08976e-13 0)
(851.84 1.76565e-13 0)
(851.84 1.26813e-10 0)
(851.84 -6.30137e-14 0)
(851.84 1.56491e-13 0)
(851.84 8.54233e-14 0)
(851.84 6.5771e-14 0)
(851.84 9.32437e-14 0)
(851.84 1.13299e-13 0)
(851.84 -2.33265e-13 0)
(851.84 -2.05008e-13 0)
(851.84 -8.84653e-14 0)
(851.84 -2.02352e-13 0)
(851.84 -3.55266e-13 0)
(851.84 -4.36635e-13 0)
(851.84 -3.66451e-13 0)
(851.84 -7.6933e-13 0)
(851.84 -5.58327e-13 0)
(851.84 -5.56836e-13 0)
(851.84 -3.26635e-13 0)
(851.84 -2.91261e-13 0)
(851.84 -4.68002e-13 0)
(851.84 -4.54775e-13 0)
(851.84 -3.88978e-13 0)
(851.84 -6.43261e-13 0)
(851.84 -5.54811e-13 0)
(851.84 -5.18562e-13 0)
(851.84 -4.89849e-13 0)
(851.84 -7.60302e-13 0)
(851.84 -6.42115e-13 0)
(851.84 -5.29339e-13 0)
(851.84 -3.51931e-13 0)
(851.84 -3.2222e-13 0)
(851.84 -1.7568e-13 0)
(851.84 -2.3247e-13 0)
(851.84 -2.8684e-13 0)
(851.84 -1.89335e-13 0)
(851.84 -1.02192e-13 0)
(851.84 -1.0113e-13 0)
(851.84 -1.17369e-13 0)
(851.84 1.01684e-12 0)
(851.84 6.77792e-14 0)
(851.84 -7.80291e-14 0)
(851.84 2.16899e-13 0)
(851.84 1.26402e-13 0)
(851.84 2.38952e-13 0)
(851.84 2.64781e-13 0)
(851.84 3.18741e-13 0)
(851.84 1.03305e-13 0)
(851.84 8.31499e-15 0)
(851.84 -8.58225e-14 0)
(851.84 3.22299e-14 0)
(851.84 2.40569e-14 0)
(851.84 -5.46022e-13 0)
(851.84 -7.28118e-13 0)
(851.84 -7.04636e-13 0)
(851.84 -6.83454e-13 0)
(851.84 -4.86404e-13 0)
(851.84 -2.31104e-13 0)
(851.84 -2.92895e-13 0)
(851.84 -3.74941e-13 0)
(851.84 -5.25601e-13 0)
(851.84 -4.75547e-13 0)
(851.84 -4.4002e-13 0)
(851.84 -1.26151e-13 0)
(851.84 -8.1898e-14 0)
(851.84 -1.36058e-13 0)
(851.84 -3.37045e-13 0)
(851.84 -3.67006e-13 0)
(851.84 -4.4182e-13 0)
(851.84 -3.76087e-13 0)
(851.84 -4.1865e-13 0)
(851.84 -5.08852e-13 0)
(851.84 -5.29437e-13 0)
(851.84 -3.21139e-13 0)
(851.84 -1.35972e-13 0)
(851.84 1.84835e-13 0)
(851.84 4.17632e-14 0)
(851.84 -5.89003e-14 0)
(851.84 3.78704e-14 0)
(851.84 -1.14489e-15 0)
(851.84 -6.26369e-14 0)
(851.84 -5.61639e-14 0)
(851.84 2.63778e-14 0)
(851.84 -4.57127e-14 0)
(851.84 9.89492e-14 0)
(851.84 2.13521e-13 0)
(851.84 2.42976e-13 0)
(851.84 1.11882e-13 0)
(851.84 1.53157e-14 0)
(851.84 2.76698e-13 0)
(851.84 -3.29383e-13 0)
(851.84 -4.19814e-13 0)
(851.84 -4.76274e-13 0)
(851.84 -4.1195e-13 0)
(851.84 -2.71514e-13 0)
(851.84 -1.99359e-13 0)
(851.84 5.00438e-14 0)
(851.84 -2.0964e-13 0)
(851.84 -4.32173e-13 0)
(851.84 -4.23961e-13 0)
(851.84 -5.09481e-13 0)
(851.84 -5.96397e-13 0)
(851.84 8.1879e-14 0)
(851.84 2.54723e-13 0)
(851.84 -2.44323e-14 0)
(851.84 -2.61119e-13 0)
(851.84 -4.34128e-13 0)
(851.84 -6.59606e-13 0)
(851.84 -8.14547e-13 0)
(851.84 -7.13018e-13 0)
(851.84 -6.38177e-13 0)
(851.84 -5.00574e-13 0)
(851.84 -3.98252e-13 0)
(851.84 -3.24848e-13 0)
(851.84 -5.68385e-13 0)
(851.84 -2.08584e-13 0)
(851.84 -2.37648e-14 0)
(851.84 -1.46936e-13 0)
(851.84 -2.08244e-13 0)
(851.84 -2.0694e-14 0)
(851.84 -1.76262e-13 0)
(851.84 -1.94031e-13 0)
(851.84 5.2217e-14 0)
(851.84 4.55258e-13 0)
(851.84 4.01481e-13 0)
(851.84 1.84598e-13 0)
(851.84 -1.89592e-13 0)
(851.84 -2.6497e-13 0)
(851.84 -3.0074e-13 0)
(851.84 -3.16441e-13 0)
(851.84 -2.67113e-13 0)
(851.84 -4.458e-14 0)
(851.84 1.33592e-13 0)
(851.84 1.8583e-13 0)
(851.84 8.11718e-14 0)
(851.84 4.7956e-14 0)
(851.84 -7.07739e-14 0)
(851.84 -2.67604e-13 0)
(851.84 -5.79611e-13 0)
(851.84 -5.02426e-13 0)
(851.84 -4.95863e-13 0)
(851.84 -4.44576e-13 0)
(851.84 -3.09283e-13 0)
(851.84 -6.25773e-13 0)
(851.84 -6.55904e-13 0)
(851.84 -5.17749e-13 0)
(851.84 -4.2851e-13 0)
(851.84 -2.65906e-13 0)
(851.84 -2.19174e-13 0)
(851.84 -8.12959e-15 0)
(851.84 7.31359e-14 0)
(851.84 -3.21416e-13 0)
(851.84 -3.82184e-13 0)
(851.84 -2.879e-13 0)
(851.84 3.48114e-14 0)
(851.84 2.26793e-13 0)
(851.84 1.72014e-13 0)
(851.84 7.53379e-14 0)
(851.84 1.32136e-14 0)
(851.84 1.30084e-13 0)
(851.84 2.25169e-13 0)
(851.84 5.49882e-14 0)
(851.84 7.45016e-15 0)
(851.84 9.50352e-15 0)
(851.84 -2.03021e-13 0)
(851.84 -3.71165e-13 0)
(851.84 -5.46404e-13 0)
(851.84 -3.3598e-13 0)
(851.84 -1.15127e-13 0)
(851.84 -1.89505e-15 0)
(851.84 4.02693e-14 0)
(851.84 -2.81831e-14 0)
(851.84 -6.5977e-14 0)
(851.84 -3.00015e-13 0)
(851.84 -2.14857e-14 0)
(851.84 -2.72851e-14 0)
(851.84 -2.7688e-16 0)
(851.84 -2.46531e-13 0)
(851.84 -4.82003e-13 0)
(851.84 -6.40853e-13 0)
(851.84 -6.0475e-13 0)
(851.84 -5.97162e-13 0)
(851.84 -5.68351e-13 0)
(851.84 -3.65502e-13 0)
(851.84 2.23213e-14 0)
(851.84 4.03712e-14 0)
(851.84 2.78595e-13 0)
(851.84 3.36297e-13 0)
(851.84 1.30002e-13 0)
(851.84 2.61694e-13 0)
(851.84 1.98389e-13 0)
(851.84 2.42197e-13 0)
(851.84 2.21127e-14 0)
(851.84 -6.1171e-15 0)
(851.84 2.79136e-13 0)
(851.84 2.66947e-13 0)
(851.84 1.86356e-13 0)
(851.84 1.04572e-13 0)
(851.84 -1.89395e-13 0)
(851.84 -2.02701e-13 0)
(851.84 -5.15534e-14 0)
(851.84 -1.35792e-13 0)
(851.84 -4.5469e-14 0)
(851.84 -8.56774e-14 0)
(851.84 2.54109e-15 0)
(851.84 1.6969e-13 0)
(851.84 8.01238e-14 0)
(851.84 -3.88478e-14 0)
(851.84 -2.09114e-14 0)
(851.84 -2.25712e-13 0)
(851.84 -1.89199e-13 0)
(851.84 -5.01414e-14 0)
(851.84 -4.35159e-14 0)
(851.84 5.46392e-14 0)
(851.84 1.20223e-13 0)
(851.84 3.92066e-14 0)
(851.84 -6.4133e-14 0)
(851.84 -2.13999e-13 0)
(851.84 -3.71859e-13 0)
(851.84 -4.09302e-13 0)
(851.84 -3.98778e-13 0)
(851.84 -3.14704e-13 0)
(851.84 -2.22095e-13 0)
(851.84 3.38834e-14 0)
(851.84 4.6709e-14 0)
(851.84 2.75659e-13 0)
(851.84 1.16338e-13 0)
(851.84 1.66758e-13 0)
(851.84 2.27939e-13 0)
(851.84 2.85661e-13 0)
(851.84 -1.44463e-13 0)
(851.84 -1.19115e-13 0)
(851.84 -9.55214e-14 0)
(851.84 6.38187e-14 0)
(851.84 2.96502e-13 0)
(851.84 2.8386e-13 0)
(851.84 5.81254e-14 0)
(851.84 2.15663e-15 0)
(851.84 -2.25404e-13 0)
(851.84 -2.76685e-13 0)
(851.84 -4.06379e-13 0)
(851.84 -1.94894e-13 0)
(851.84 8.06587e-14 0)
(851.84 2.37065e-13 0)
(851.84 1.55441e-13 0)
(851.84 -8.477e-14 0)
(851.84 -2.67866e-13 0)
(851.84 -4.99571e-13 0)
(851.84 -4.47426e-13 0)
(851.84 -2.85592e-13 0)
(851.84 -2.64852e-13 0)
(851.84 -1.78565e-13 0)
(851.84 -6.22741e-14 0)
(851.84 3.17945e-14 0)
(851.84 4.69553e-14 0)
(851.84 3.49189e-14 0)
(851.84 -1.24474e-13 0)
(851.84 -1.05786e-13 0)
(851.84 -2.00683e-13 0)
(851.84 -1.4074e-13 0)
(851.84 -4.02146e-14 0)
(851.84 2.65776e-13 0)
(851.84 3.15969e-13 0)
(851.84 5.20312e-13 0)
(851.84 9.08582e-14 0)
(851.84 7.52521e-14 0)
(851.84 3.17866e-13 0)
(851.84 4.57445e-13 0)
(851.84 3.03648e-14 0)
(851.84 -1.15647e-13 0)
(851.84 -3.82249e-14 0)
(851.84 8.44356e-14 0)
(851.84 2.21567e-13 0)
(851.84 1.59802e-13 0)
(851.84 2.16063e-13 0)
(851.84 6.95197e-15 0)
(851.84 -2.88288e-13 0)
(851.84 -4.4095e-13 0)
(851.84 -4.4743e-13 0)
(851.84 -4.04321e-13 0)
(851.84 -5.42128e-14 0)
(851.84 1.60209e-13 0)
(851.84 1.75544e-13 0)
(851.84 2.80748e-13 0)
(851.84 3.67075e-13 0)
(851.84 6.84197e-13 0)
(851.84 3.73774e-13 0)
(851.84 4.45851e-14 0)
(851.84 1.04574e-13 0)
(851.84 5.61339e-14 0)
(851.84 9.15805e-14 0)
(851.84 -2.78242e-13 0)
(851.84 -2.96172e-13 0)
(851.84 -3.17658e-13 0)
(851.84 -1.96535e-13 0)
(851.84 -3.92072e-13 0)
(851.84 6.81978e-14 0)
(851.84 1.06547e-13 0)
(851.84 1.322e-14 0)
(851.84 1.87991e-13 0)
(851.84 6.07275e-14 0)
(851.84 1.86053e-14 0)
(851.84 -1.12375e-14 0)
(851.84 5.09159e-13 0)
(851.84 3.44918e-13 0)
(851.84 4.00288e-13 0)
(851.84 9.74246e-14 0)
(851.84 6.04349e-14 0)
(851.84 1.09682e-13 0)
(851.84 1.32507e-13 0)
(851.84 6.24716e-14 0)
(851.84 1.69172e-14 0)
(851.84 4.11874e-15 0)
(851.84 -1.36901e-13 0)
(851.84 -1.40109e-13 0)
(851.84 -1.63668e-13 0)
(851.84 -1.68472e-13 0)
(851.84 -2.12665e-13 0)
(851.84 -2.93963e-13 0)
(851.84 -2.02948e-13 0)
(851.84 -9.26014e-14 0)
(851.84 1.90743e-13 0)
(851.84 1.81667e-13 0)
(851.84 2.08783e-13 0)
(851.84 3.49295e-13 0)
(851.84 6.28511e-13 0)
(851.84 2.68113e-13 0)
(851.84 4.3273e-13 0)
(851.84 4.52727e-13 0)
(851.84 -6.04634e-14 0)
(851.84 -3.89673e-13 0)
(851.84 -5.74545e-13 0)
(851.84 -4.47692e-13 0)
(851.84 -3.14413e-13 0)
(851.84 1.41619e-15 0)
(851.84 3.19832e-14 0)
(851.84 1.46654e-13 0)
(851.84 1.63363e-13 0)
(851.84 2.34688e-13 0)
(851.84 2.51199e-13 0)
(851.84 4.20483e-13 0)
(851.84 4.53928e-13 0)
(851.84 3.03086e-13 0)
(851.84 1.61582e-13 0)
(851.84 -5.94936e-14 0)
(851.84 -1.56559e-13 0)
(851.84 -9.98124e-14 0)
(851.84 -9.88545e-14 0)
(851.84 -1.34437e-14 0)
(851.84 -2.0372e-13 0)
(851.84 -3.37599e-13 0)
(851.84 -1.25475e-13 0)
(851.84 -3.70922e-13 0)
(851.84 -4.19851e-13 0)
(851.84 -1.95886e-13 0)
(851.84 -1.22836e-13 0)
(851.84 -6.92531e-14 0)
(851.84 -2.07458e-13 0)
(851.84 4.94439e-14 0)
(851.84 6.93356e-14 0)
(851.84 1.58926e-13 0)
(851.84 2.14106e-13 0)
(851.84 4.73572e-13 0)
(851.84 7.30929e-14 0)
(851.84 -4.63188e-14 0)
(851.84 2.54352e-13 0)
(851.84 -3.97972e-14 0)
(851.84 -2.2019e-13 0)
(851.84 -1.89682e-13 0)
(851.84 -7.72412e-14 0)
(851.84 2.69169e-14 0)
(851.84 2.68125e-14 0)
(851.84 1.1087e-13 0)
(851.84 2.88471e-13 0)
(851.84 9.08796e-14 0)
(851.84 -3.89873e-14 0)
(851.84 2.50801e-13 0)
(851.84 4.2347e-13 0)
(851.84 2.73921e-13 0)
(851.84 3.67439e-13 0)
(851.84 2.90495e-13 0)
(851.84 9.6877e-14 0)
(851.84 6.51368e-15 0)
(851.84 1.4375e-13 0)
(851.84 -4.10556e-14 0)
(851.84 -2.33338e-13 0)
(851.84 -3.08962e-13 0)
(851.84 -2.00954e-13 0)
(851.84 -2.70847e-13 0)
(851.84 -6.33068e-14 0)
(851.84 -1.1398e-14 0)
(851.84 4.59491e-13 0)
(851.84 4.19311e-13 0)
(851.84 3.40667e-13 0)
(851.84 2.20533e-13 0)
(851.84 3.17101e-13 0)
(851.84 2.52532e-13 0)
(851.84 1.54114e-13 0)
(851.84 3.45784e-13 0)
(851.84 3.58705e-13 0)
(851.84 1.95139e-13 0)
(851.84 -1.54597e-13 0)
(851.84 -1.99272e-13 0)
(851.84 -3.3976e-13 0)
(851.84 -7.65324e-13 0)
(851.84 -9.1102e-13 0)
(851.84 -5.88703e-13 0)
(851.84 -2.81326e-13 0)
(851.84 -1.36628e-13 0)
(851.84 1.35966e-13 0)
(851.84 1.61261e-13 0)
(851.84 2.52803e-13 0)
(851.84 3.97239e-14 0)
(851.84 -7.59722e-14 0)
(851.84 -1.47107e-13 0)
(851.84 -2.5946e-13 0)
(851.84 -1.31689e-13 0)
(851.84 -2.06232e-13 0)
(851.84 -2.16565e-13 0)
(851.84 -2.45925e-13 0)
(851.84 -3.57165e-14 0)
(851.84 -4.78028e-14 0)
(851.84 -2.83704e-14 0)
(851.84 -1.26422e-13 0)
(851.84 -2.55757e-13 0)
(851.84 -6.84536e-14 0)
(851.84 -4.01754e-14 0)
(851.84 -1.11447e-13 0)
(851.84 3.13407e-13 0)
(851.84 3.82976e-13 0)
(851.84 1.08576e-13 0)
(851.84 1.14407e-13 0)
(851.84 1.70072e-13 0)
(851.84 1.16926e-13 0)
(851.84 4.8571e-14 0)
(851.84 3.59308e-13 0)
(851.84 2.98303e-13 0)
(851.84 2.23434e-13 0)
(851.84 -2.01716e-14 0)
(851.84 -1.69517e-13 0)
(851.84 -1.6268e-13 0)
(851.84 -6.14071e-13 0)
(851.84 -5.35747e-13 0)
(851.84 -3.96437e-13 0)
(851.84 -2.01036e-13 0)
(851.84 -3.07946e-13 0)
(851.84 -3.0092e-13 0)
(851.84 -1.28384e-13 0)
(851.84 2.8698e-13 0)
(851.84 4.0405e-13 0)
(851.84 1.40726e-15 0)
(851.84 6.54616e-13 0)
(851.84 3.34503e-13 0)
(851.84 -4.48668e-14 0)
(851.84 -1.61506e-13 0)
(851.84 -1.83281e-13 0)
(851.84 -1.20622e-13 0)
(851.84 -1.74428e-13 0)
(851.84 -3.09744e-14 0)
(851.84 -6.57344e-14 0)
(851.84 -1.178e-13 0)
(851.84 -1.34706e-13 0)
(851.84 1.07081e-13 0)
(851.84 2.34368e-13 0)
(851.84 2.74326e-13 0)
(851.84 1.47408e-13 0)
(851.84 4.25778e-13 0)
(851.84 1.06057e-13 0)
(851.84 6.6899e-14 0)
(851.84 9.47983e-14 0)
(851.84 1.79228e-13 0)
(851.84 1.27412e-13 0)
(851.84 2.23344e-13 0)
(851.84 3.43171e-13 0)
(851.84 4.10509e-13 0)
(851.84 3.85078e-14 0)
(851.84 -1.87317e-13 0)
(851.84 1.60982e-13 0)
(851.84 5.65194e-13 0)
(851.84 8.28225e-13 0)
(851.84 9.08374e-13 0)
(851.84 8.28929e-13 0)
(851.84 4.57786e-13 0)
(851.84 1.26297e-13 0)
(851.84 8.97399e-14 0)
(851.84 1.21964e-13 0)
(851.84 -4.27061e-14 0)
(851.84 -1.03412e-13 0)
(851.84 7.41174e-14 0)
(851.84 -3.82851e-14 0)
(851.84 -1.57755e-13 0)
(851.84 -9.043e-14 0)
(851.84 -1.57403e-13 0)
(851.84 -3.32064e-13 0)
(851.84 -2.45318e-13 0)
(851.84 -3.59177e-13 0)
(851.84 5.07231e-14 0)
(851.84 -3.51855e-14 0)
(851.84 -1.98593e-13 0)
(851.84 -9.97209e-14 0)
(851.84 -9.4459e-14 0)
(851.84 -2.80841e-14 0)
(851.84 -4.43592e-14 0)
(851.84 -1.88028e-13 0)
(851.84 -1.13488e-13 0)
(851.84 -1.04023e-13 0)
(851.84 -6.72336e-14 0)
(851.84 4.08986e-14 0)
(851.84 1.54896e-13 0)
(851.84 -3.26969e-14 0)
(851.84 3.9714e-14 0)
(851.84 -1.67407e-14 0)
(851.84 7.09241e-14 0)
(851.84 4.44399e-13 0)
(851.84 3.46782e-13 0)
(851.84 5.02534e-13 0)
(851.84 3.95098e-13 0)
(851.84 2.33874e-13 0)
(851.84 -1.44962e-13 0)
(851.84 4.97939e-13 0)
(851.84 7.19755e-14 0)
(851.84 1.83597e-13 0)
(851.84 2.86403e-13 0)
(851.84 6.48523e-14 0)
(851.84 -8.96232e-15 0)
(851.84 1.70538e-13 0)
(851.84 6.74024e-14 0)
(851.84 -2.06241e-13 0)
(851.84 -4.03961e-13 0)
(851.84 -1.33273e-13 0)
(851.84 -1.11364e-13 0)
(851.84 -3.84097e-14 0)
(851.84 -5.56264e-14 0)
(851.84 -2.99526e-13 0)
(851.84 1.18033e-13 0)
(851.84 1.30553e-13 0)
(851.84 -5.54714e-14 0)
(851.84 -2.11996e-14 0)
(851.84 6.73837e-14 0)
(851.84 -2.26042e-13 0)
(851.84 1.55557e-13 0)
(851.84 -5.43179e-14 0)
(851.84 -3.25221e-13 0)
(851.84 -1.53525e-13 0)
(851.84 -1.6e-13 0)
(851.84 -2.62807e-13 0)
(851.84 -1.93652e-13 0)
(851.84 1.33282e-13 0)
(851.84 2.4364e-13 0)
(851.84 -1.50244e-14 0)
(851.84 -1.0574e-13 0)
(851.84 -2.3212e-13 0)
(851.84 3.35325e-15 0)
(851.84 4.87403e-13 0)
(851.84 2.18973e-13 0)
(851.84 3.11564e-13 0)
(851.84 1.15711e-13 0)
(851.84 2.4191e-13 0)
(851.84 1.26885e-13 0)
(851.84 6.05352e-14 0)
(851.84 -7.60982e-14 0)
(851.84 1.13084e-13 0)
(851.84 -3.09791e-13 0)
(851.84 -1.05447e-13 0)
(851.84 6.48334e-14 0)
(851.84 -4.2474e-14 0)
(851.84 -2.39438e-13 0)
(851.84 -1.89068e-13 0)
(851.84 -9.63851e-14 0)
(851.84 1.04223e-13 0)
(851.84 1.98055e-13 0)
(851.84 2.86242e-13 0)
(851.84 4.87683e-14 0)
(851.84 2.3318e-13 0)
(851.84 2.7762e-13 0)
(851.84 1.92856e-13 0)
(851.84 1.49463e-13 0)
(851.84 7.13489e-14 0)
(851.84 -6.80435e-14 0)
(851.84 2.63478e-14 0)
(851.84 2.94405e-14 0)
(851.84 -1.54009e-13 0)
(851.84 3.00859e-14 0)
(851.84 2.21147e-13 0)
(851.84 -1.90816e-13 0)
(851.84 -2.51501e-13 0)
(851.84 -2.34232e-13 0)
(851.84 -1.74878e-13 0)
(851.84 -4.09549e-13 0)
(851.84 -3.37055e-13 0)
(851.84 -1.70797e-13 0)
(851.84 -9.94177e-14 0)
(851.84 1.64245e-13 0)
(851.84 1.70469e-13 0)
(851.84 2.90255e-13 0)
(851.84 1.074e-13 0)
(851.84 -2.17206e-13 0)
(851.84 1.25075e-14 0)
(851.84 -3.23732e-14 0)
(851.84 9.31757e-14 0)
(851.84 -2.21261e-13 0)
(851.84 -3.2171e-13 0)
(851.84 -2.33389e-13 0)
(851.84 5.32114e-14 0)
(851.84 3.08686e-13 0)
(851.84 1.53381e-13 0)
(851.84 3.91801e-14 0)
(851.84 9.51431e-14 0)
(851.84 8.06688e-14 0)
(851.84 2.43758e-13 0)
(851.84 -9.0375e-14 0)
(851.84 1.59003e-14 0)
(851.84 -7.86316e-15 0)
(851.84 -6.43421e-14 0)
(851.84 -1.64766e-13 0)
(851.84 -6.13608e-14 0)
(851.84 -1.61472e-13 0)
(851.84 4.5559e-14 0)
(851.84 4.80401e-14 0)
(851.84 1.21825e-14 0)
(851.84 -8.18535e-15 0)
(851.84 2.16269e-13 0)
(851.84 1.07691e-14 0)
(851.84 1.44659e-13 0)
(851.84 -3.30001e-13 0)
(851.84 -2.96609e-13 0)
(851.84 -6.27522e-13 0)
(851.84 -4.54916e-13 0)
(851.84 -2.62278e-13 0)
(851.84 -4.48851e-13 0)
(851.84 -2.85121e-13 0)
(851.84 -1.61511e-13 0)
(851.84 -5.94541e-14 0)
(851.84 2.47998e-14 0)
(851.84 4.59113e-13 0)
(851.84 4.38279e-13 0)
(851.84 4.20673e-13 0)
(851.84 2.33905e-13 0)
(851.84 5.11013e-13 0)
(851.84 4.83278e-13 0)
(851.84 4.75041e-13 0)
(851.84 3.12191e-13 0)
(851.84 1.60513e-13 0)
(851.84 3.03793e-13 0)
(851.84 2.47033e-13 0)
(851.84 5.30255e-14 0)
(851.84 -7.77567e-14 0)
(851.84 8.50765e-14 0)
(851.84 -1.10894e-13 0)
(851.84 -1.27839e-13 0)
(851.84 -7.66497e-14 0)
(851.84 -1.12219e-13 0)
(851.84 -3.82838e-13 0)
(851.84 -2.86012e-13 0)
(851.84 2.69237e-15 0)
(851.84 1.15964e-13 0)
(851.84 2.33895e-13 0)
(851.84 3.28045e-13 0)
(851.84 3.0193e-13 0)
(851.84 3.16154e-13 0)
(851.84 5.45466e-13 0)
(851.84 4.08307e-13 0)
(851.84 3.10388e-14 0)
(851.84 -2.27065e-13 0)
(851.84 -2.7493e-13 0)
(851.84 -1.08726e-13 0)
(851.84 5.40406e-14 0)
(851.84 1.9393e-13 0)
(851.84 -2.98731e-13 0)
(851.84 7.24126e-15 0)
(851.84 3.73444e-14 0)
(851.84 2.07634e-13 0)
(851.84 7.67694e-14 0)
(851.84 1.06997e-13 0)
(851.84 1.56014e-13 0)
(851.84 4.0306e-14 0)
(851.84 -4.73728e-14 0)
(851.84 5.01461e-14 0)
(851.84 1.21e-13 0)
(851.84 -9.98158e-14 0)
(851.84 9.75321e-14 0)
(851.84 3.40798e-13 0)
(851.84 5.83049e-13 0)
(851.84 2.35815e-13 0)
(851.84 4.82684e-14 0)
(851.84 1.82919e-13 0)
(851.84 -2.9046e-14 0)
(851.84 4.52921e-14 0)
(851.84 -1.03969e-13 0)
(851.84 -8.05155e-14 0)
(851.84 2.38565e-13 0)
(851.84 1.76476e-13 0)
(851.84 2.81864e-13 0)
(851.84 2.41269e-13 0)
(851.84 3.10184e-13 0)
(851.84 2.8877e-13 0)
(851.84 2.80724e-13 0)
(851.84 2.41634e-13 0)
(851.84 4.07598e-13 0)
(851.84 1.38521e-13 0)
(851.84 -9.65762e-14 0)
(851.84 -2.17768e-13 0)
(851.84 1.10163e-13 0)
(851.84 1.54465e-13 0)
(851.84 3.46489e-13 0)
(851.84 5.20262e-13 0)
(851.84 3.14592e-13 0)
(851.84 2.81437e-13 0)
(851.84 1.59993e-13 0)
(851.84 1.22525e-13 0)
(851.84 5.43649e-14 0)
(851.84 9.33156e-14 0)
(851.84 2.09371e-14 0)
(851.84 1.45411e-13 0)
(851.84 2.46521e-13 0)
(851.84 5.9922e-14 0)
(851.84 -1.67715e-13 0)
(851.84 -3.23105e-13 0)
(851.84 -4.56532e-13 0)
(851.84 6.07801e-14 0)
(851.84 -2.8214e-14 0)
(851.84 1.22015e-13 0)
(851.84 2.48634e-13 0)
(851.84 9.56664e-14 0)
(851.84 1.24271e-13 0)
(851.84 4.29035e-14 0)
(851.84 2.52669e-13 0)
(851.84 4.11558e-13 0)
(851.84 5.51808e-13 0)
(851.84 5.76434e-13 0)
(851.84 3.33056e-13 0)
(851.84 2.96699e-13 0)
(851.84 -1.82639e-14 0)
(851.84 1.2513e-13 0)
(851.84 3.05782e-13 0)
(851.84 4.12654e-13 0)
(851.84 1.73266e-13 0)
(851.84 6.86297e-14 0)
(851.84 -5.88576e-14 0)
(851.84 6.6695e-14 0)
(851.84 1.37402e-13 0)
(851.84 7.36226e-14 0)
(851.84 3.52787e-14 0)
(851.84 -3.05486e-13 0)
(851.84 -2.31973e-13 0)
(851.84 -2.33508e-13 0)
(851.84 -3.14497e-13 0)
(851.84 -5.12712e-13 0)
(851.84 -4.47198e-13 0)
(851.84 9.05779e-14 0)
(851.84 2.60303e-13 0)
(851.84 2.36057e-13 0)
(851.84 -6.97425e-14 0)
(851.84 -3.41263e-13 0)
(851.84 -5.2228e-13 0)
(851.84 -5.29121e-13 0)
(851.84 -6.94445e-13 0)
(851.84 -4.72209e-13 0)
(851.84 -4.47303e-13 0)
(851.84 -1.62999e-13 0)
(851.84 -3.02613e-14 0)
(851.84 -1.54092e-13 0)
(851.84 -2.69115e-14 0)
(851.84 -3.86035e-14 0)
(851.84 5.96929e-14 0)
(851.84 2.50591e-13 0)
(851.84 -1.52432e-14 0)
(851.84 -4.36939e-14 0)
(851.84 -1.24909e-13 0)
(851.84 -6.67164e-14 0)
(851.84 1.16522e-13 0)
(851.84 1.55748e-13 0)
(851.84 -1.16002e-14 0)
(851.84 -3.06423e-14 0)
(851.84 -2.73151e-13 0)
(851.84 -1.34119e-13 0)
(851.84 9.99973e-14 0)
(851.84 2.7408e-13 0)
(851.84 5.14381e-13 0)
(851.84 5.9523e-13 0)
(851.84 2.6026e-13 0)
(851.84 -1.30145e-13 0)
(851.84 -4.8302e-14 0)
(851.84 -1.30528e-13 0)
(851.84 -2.92792e-13 0)
(851.84 -1.09566e-13 0)
(851.84 -2.8409e-13 0)
(851.84 -6.96295e-14 0)
(851.84 2.07217e-13 0)
(851.84 2.22814e-13 0)
(851.84 -1.17585e-13 0)
(851.84 -2.76079e-13 0)
(851.84 -1.50314e-13 0)
(851.84 6.24679e-14 0)
(851.84 -3.04988e-13 0)
(851.84 -5.2287e-13 0)
(851.84 -2.66875e-13 0)
(851.84 -1.38251e-13 0)
(851.84 1.40388e-14 0)
(851.84 4.74457e-15 0)
(851.84 -3.91562e-14 0)
(851.84 -1.45209e-13 0)
(851.84 -1.57632e-14 0)
(851.84 5.43779e-14 0)
(851.84 3.86575e-13 0)
(851.84 7.92336e-15 0)
(851.84 -9.58591e-15 0)
(851.84 -8.47123e-14 0)
(851.84 2.0973e-14 0)
(851.84 9.88719e-15 0)
(851.84 8.7252e-14 0)
(851.84 -1.80352e-13 0)
(851.84 -2.5138e-13 0)
(851.84 -2.51166e-13 0)
(851.84 -1.45702e-13 0)
(851.84 1.46307e-13 0)
(851.84 3.20692e-13 0)
(851.84 5.7396e-14 0)
(851.84 2.32164e-13 0)
(851.84 4.40442e-13 0)
(851.84 4.03796e-13 0)
(851.84 5.03684e-13 0)
(851.84 5.71974e-13 0)
(851.84 7.25499e-13 0)
(851.84 1.10731e-12 0)
(851.84 8.30673e-13 0)
(851.84 5.67676e-13 0)
(851.84 6.14214e-13 0)
(851.84 4.70264e-13 0)
(851.84 2.40411e-13 0)
(851.84 1.50122e-13 0)
(851.84 2.69765e-13 0)
(851.84 2.29179e-13 0)
(851.84 1.66164e-14 0)
(851.84 -1.44291e-13 0)
(851.84 -3.59866e-14 0)
(851.84 -2.00906e-14 0)
(851.84 1.60813e-14 0)
(851.84 9.99311e-14 0)
(851.84 5.63976e-14 0)
(851.84 5.46838e-14 0)
(851.84 5.43199e-14 0)
(851.84 4.53852e-15 0)
(851.84 9.52624e-14 0)
(851.84 -2.86759e-14 0)
(851.84 1.98189e-13 0)
(851.84 4.19154e-13 0)
(851.84 2.39597e-13 0)
(851.84 1.99045e-13 0)
(851.84 -1.71859e-13 0)
(851.84 1.70927e-14 0)
(851.84 -1.97131e-13 0)
(851.84 -2.79746e-14 0)
(851.84 1.24681e-13 0)
(851.84 -1.6952e-13 0)
(851.84 -1.23506e-13 0)
(851.84 2.14021e-13 0)
(851.84 2.97626e-13 0)
(851.84 3.47681e-13 0)
(851.84 3.90611e-13 0)
(851.84 6.52998e-13 0)
(851.84 7.76564e-13 0)
(851.84 8.19971e-13 0)
(851.84 7.15309e-13 0)
(851.84 6.38448e-13 0)
(851.84 3.21454e-13 0)
(851.84 5.69362e-13 0)
(851.84 5.38217e-13 0)
(851.84 4.2493e-13 0)
(851.84 3.09903e-13 0)
(851.84 4.97734e-13 0)
(851.84 4.26439e-13 0)
(851.84 1.3348e-13 0)
(851.84 -5.31292e-14 0)
(851.84 1.7474e-13 0)
(851.84 7.91708e-14 0)
(851.84 1.09997e-13 0)
(851.84 -1.33053e-13 0)
(851.84 -2.32471e-13 0)
(851.84 -1.39397e-13 0)
(851.84 -2.62996e-13 0)
(851.84 -6.20387e-14 0)
(851.84 2.60518e-13 0)
(851.84 4.8863e-13 0)
(851.84 1.1905e-13 0)
(851.84 2.41842e-13 0)
(851.84 2.093e-13 0)
(851.84 3.15178e-13 0)
(851.84 2.18369e-13 0)
(851.84 4.70865e-13 0)
(851.84 4.33562e-13 0)
(851.84 1.21004e-13 0)
(851.84 -1.86395e-13 0)
(851.84 -5.47653e-14 0)
(851.84 -1.24568e-14 0)
(851.84 -8.76539e-14 0)
(851.84 1.98269e-13 0)
(851.84 4.33175e-13 0)
(851.84 5.82772e-13 0)
(851.84 5.07441e-13 0)
(851.84 6.96099e-13 0)
(851.84 5.93009e-13 0)
(851.84 5.83095e-13 0)
(851.84 6.56596e-13 0)
(851.84 7.74358e-13 0)
(851.84 6.12457e-13 0)
(851.84 7.33687e-13 0)
(851.84 9.10811e-13 0)
(851.84 1.02542e-12 0)
(851.84 1.11104e-12 0)
(851.84 1.06515e-12 0)
(851.84 3.97137e-13 0)
(851.84 2.17268e-13 0)
(851.84 2.55299e-14 0)
(851.84 2.3101e-14 0)
(851.84 8.52519e-14 0)
(851.84 4.0987e-14 0)
(851.84 -5.47276e-14 0)
(851.84 -2.26699e-13 0)
(851.84 -1.73617e-13 0)
(851.84 -1.92519e-13 0)
(851.84 -4.66796e-13 0)
(851.84 -3.34485e-13 0)
(851.84 -2.54713e-13 0)
(851.84 4.034e-14 0)
(851.84 3.95902e-13 0)
(851.84 5.78096e-13 0)
(851.84 3.43557e-13 0)
(851.84 2.05615e-13 0)
(851.84 -1.98366e-13 0)
(851.84 5.96616e-15 0)
(851.84 1.41608e-13 0)
(851.84 -2.02333e-14 0)
(851.84 -2.87413e-14 0)
(851.84 2.45412e-13 0)
(851.84 9.77947e-14 0)
(851.84 1.39668e-13 0)
(851.84 -3.31542e-14 0)
(851.84 6.17447e-14 0)
(851.84 3.99702e-13 0)
(851.84 6.26139e-13 0)
(851.84 6.15587e-13 0)
(851.84 3.82699e-13 0)
(851.84 4.59948e-13 0)
(851.84 4.0344e-13 0)
(851.84 1.03169e-12 0)
(851.84 8.26965e-13 0)
(851.84 6.63513e-13 0)
(851.84 5.32529e-13 0)
(851.84 3.01492e-13 0)
(851.84 -5.83484e-15 0)
(851.84 -1.37308e-13 0)
(851.84 1.34429e-13 0)
(851.84 2.83046e-13 0)
(851.84 2.64871e-13 0)
(851.84 1.34116e-13 0)
(851.84 2.99242e-13 0)
(851.84 -2.12597e-13 0)
(851.84 -2.03061e-13 0)
(851.84 -2.18033e-13 0)
(851.84 -2.79571e-13 0)
(851.84 -1.79297e-13 0)
(851.84 -2.99692e-13 0)
(851.84 -1.25879e-13 0)
(851.84 1.16202e-13 0)
(851.84 1.98379e-13 0)
(851.84 1.90841e-13 0)
(851.84 4.80639e-13 0)
(851.84 2.59983e-13 0)
(851.84 1.68631e-13 0)
(851.84 8.0708e-14 0)
(851.84 -2.41654e-13 0)
(851.84 1.33914e-13 0)
(851.84 1.43181e-13 0)
(851.84 1.5557e-14 0)
(851.84 1.83194e-13 0)
(851.84 2.64391e-13 0)
(851.84 -6.4041e-14 0)
(851.84 -2.74977e-13 0)
(851.84 -1.08866e-13 0)
(851.84 1.48611e-13 0)
(851.84 5.6224e-13 0)
(851.84 6.19983e-13 0)
(851.84 3.29383e-13 0)
(851.84 2.7754e-13 0)
(851.84 3.89099e-13 0)
(851.84 2.0354e-13 0)
(851.84 2.55837e-13 0)
(851.84 2.53019e-13 0)
(851.84 5.32005e-13 0)
(851.84 2.77526e-15 0)
(851.84 -4.63444e-14 0)
(851.84 4.43744e-13 0)
(851.84 3.51461e-13 0)
(851.84 2.19278e-13 0)
(851.84 -3.73977e-14 0)
(851.84 -1.83377e-14 0)
(851.84 -1.27224e-13 0)
(851.84 -1.27049e-13 0)
(851.84 9.91891e-14 0)
(851.84 7.32741e-14 0)
(851.84 -3.02405e-13 0)
(851.84 -3.20409e-13 0)
(851.84 -3.46219e-13 0)
(851.84 -2.87501e-13 0)
(851.84 -3.26222e-13 0)
(851.84 -6.55041e-14 0)
(851.84 -2.78746e-14 0)
(851.84 2.65575e-14 0)
(851.84 7.82355e-14 0)
(851.84 6.4535e-14 0)
(851.84 -1.07605e-13 0)
(851.84 -3.69511e-14 0)
(851.84 5.18084e-13 0)
(851.84 2.04891e-13 0)
(851.84 5.57791e-14 0)
(851.84 -3.42301e-13 0)
(851.84 -2.62641e-13 0)
(851.84 -1.45492e-13 0)
(851.84 1.11893e-13 0)
(851.84 2.03525e-13 0)
(851.84 6.9202e-13 0)
(851.84 3.89302e-13 0)
(851.84 3.53633e-13 0)
(851.84 2.42441e-13 0)
(851.84 3.81949e-13 0)
(851.84 4.30021e-13 0)
(851.84 4.49542e-13 0)
(851.84 -1.43219e-13 0)
(851.84 -1.65124e-13 0)
(851.84 -3.53937e-15 0)
(851.84 3.02322e-14 0)
(851.84 -2.15043e-13 0)
(851.84 3.04208e-13 0)
(851.84 1.93237e-13 0)
(851.84 1.14315e-13 0)
(851.84 1.67123e-13 0)
(851.84 1.92623e-14 0)
(851.84 -6.79544e-14 0)
(851.84 -1.5636e-13 0)
(851.84 -4.02699e-13 0)
(851.84 -3.41795e-13 0)
(851.84 -1.1436e-13 0)
(851.84 -2.18316e-14 0)
(851.84 -1.90704e-13 0)
(851.84 -1.55728e-13 0)
(851.84 -5.00117e-14 0)
(851.84 -1.14338e-13 0)
(851.84 -4.02878e-13 0)
(851.84 -4.62018e-13 0)
(851.84 -3.19927e-13 0)
(851.84 -1.56871e-13 0)
(851.84 5.71646e-14 0)
(851.84 2.25404e-13 0)
(851.84 -1.89589e-13 0)
(851.84 -1.53797e-13 0)
(851.84 -2.60594e-14 0)
(851.84 2.80157e-13 0)
(851.84 1.92896e-13 0)
(851.84 3.84338e-14 0)
(851.84 7.30187e-14 0)
(851.84 -9.03471e-14 0)
(851.84 8.31207e-14 0)
(851.84 -7.44824e-14 0)
(851.84 -7.41699e-14 0)
(851.84 -3.99131e-13 0)
(851.84 3.81487e-14 0)
(851.84 -1.84997e-13 0)
(851.84 -2.01575e-13 0)
(851.84 -2.15809e-13 0)
(851.84 2.58186e-13 0)
(851.84 5.18466e-14 0)
(851.84 2.12833e-13 0)
(851.84 9.7756e-14 0)
(851.84 9.99856e-14 0)
(851.84 1.37414e-13 0)
(851.84 -1.85281e-13 0)
(851.84 -2.53308e-13 0)
(851.84 -3.1483e-13 0)
(851.84 -1.32505e-13 0)
(851.84 -6.28923e-14 0)
(851.84 3.99344e-13 0)
(851.84 -1.27227e-13 0)
(851.84 -1.58025e-13 0)
(851.84 -4.49738e-13 0)
(851.84 -2.50817e-13 0)
(851.84 -3.50844e-14 0)
(851.84 -1.65354e-13 0)
(851.84 -8.33085e-14 0)
(851.84 -6.30916e-14 0)
(851.84 4.35202e-14 0)
(851.84 -6.26938e-14 0)
(851.84 1.07371e-13 0)
(851.84 -4.39923e-14 0)
(851.84 -4.54151e-14 0)
(851.84 -1.50412e-13 0)
(851.84 8.90011e-14 0)
(851.84 -2.41666e-13 0)
(851.84 -2.4954e-13 0)
(851.84 3.26413e-13 0)
(851.84 6.24492e-13 0)
(851.84 4.35019e-13 0)
(851.84 -4.14823e-14 0)
(851.84 -2.25333e-13 0)
(851.84 3.01173e-15 0)
(851.84 1.23491e-13 0)
(851.84 -8.72918e-14 0)
(851.84 -5.59227e-14 0)
(851.84 -2.1504e-13 0)
(851.84 -1.95017e-13 0)
(851.84 -4.33772e-14 0)
(851.84 1.18789e-13 0)
(851.84 8.37429e-14 0)
(851.84 2.73822e-13 0)
(851.84 3.42517e-13 0)
(851.84 1.84645e-13 0)
(851.84 1.26756e-13 0)
(851.84 1.83149e-13 0)
(851.84 4.25924e-13 0)
(851.84 3.20207e-13 0)
(851.84 3.02103e-13 0)
(851.84 3.6327e-13 0)
(851.84 -8.28102e-14 0)
(851.84 -3.04915e-13 0)
(851.84 1.97327e-13 0)
(851.84 2.64608e-13 0)
(851.84 4.65153e-13 0)
(851.84 2.79331e-13 0)
(851.84 1.12667e-13 0)
(851.84 1.19816e-13 0)
(851.84 2.85443e-13 0)
(851.84 1.60563e-13 0)
(851.84 1.07158e-13 0)
(851.84 4.86987e-14 0)
(851.84 2.35187e-14 0)
(851.84 -1.94139e-13 0)
(851.84 -2.55735e-13 0)
(851.84 -7.76695e-14 0)
(851.84 -1.2351e-13 0)
(851.84 6.46455e-14 0)
(851.84 -5.78581e-14 0)
(851.84 -2.54187e-13 0)
(851.84 -8.40034e-14 0)
(851.84 1.34189e-13 0)
(851.84 1.53068e-13 0)
(851.84 4.88024e-14 0)
(851.84 6.88595e-15 0)
(851.84 -8.50073e-14 0)
(851.84 -2.3964e-14 0)
(851.84 1.25093e-13 0)
(851.84 6.79431e-14 0)
(851.84 5.8428e-14 0)
(851.84 1.19587e-13 0)
(851.84 -7.39794e-15 0)
(851.84 4.66636e-13 0)
(851.84 8.15211e-13 0)
(851.84 7.08259e-13 0)
(851.84 2.19928e-13 0)
(851.84 3.91729e-13 0)
(851.84 2.16493e-13 0)
(851.84 5.3433e-13 0)
(851.84 2.88735e-13 0)
(851.84 2.01412e-13 0)
(851.84 1.22088e-13 0)
(851.84 2.44319e-13 0)
(851.84 1.76766e-13 0)
(851.84 5.08541e-14 0)
(851.84 1.11299e-13 0)
(851.84 1.12186e-13 0)
(851.84 3.10555e-13 0)
(851.84 2.14719e-13 0)
(851.84 1.94548e-13 0)
(851.84 -3.17643e-13 0)
(851.84 -2.18093e-13 0)
(851.84 -1.99429e-13 0)
(851.84 3.33716e-14 0)
(851.84 -2.06903e-14 0)
(851.84 1.1309e-13 0)
(851.84 -1.04038e-13 0)
(851.84 -1.04774e-13 0)
(851.84 2.41714e-14 0)
(851.84 -9.58398e-14 0)
(851.84 -1.0813e-13 0)
(851.84 -1.21234e-13 0)
(851.84 -3.09528e-14 0)
(851.84 9.30642e-16 0)
(851.84 -4.12133e-14 0)
(851.84 -1.6522e-13 0)
(851.84 1.19637e-13 0)
(851.84 -1.29667e-13 0)
(851.84 -7.53904e-15 0)
(851.84 1.20177e-13 0)
(851.84 4.14954e-13 0)
(851.84 5.05342e-13 0)
(851.84 2.93922e-13 0)
(851.84 2.33426e-13 0)
(851.84 -6.21121e-14 0)
(851.84 -2.80253e-13 0)
(851.84 -1.17837e-13 0)
(851.84 -3.02244e-14 0)
(851.84 -1.98969e-14 0)
(851.84 -7.87025e-14 0)
(851.84 -4.92294e-14 0)
(851.84 -4.45526e-15 0)
(851.84 3.83056e-14 0)
(851.84 -4.47813e-14 0)
(851.84 3.03368e-13 0)
(851.84 6.2157e-13 0)
(851.84 5.48777e-13 0)
(851.84 1.7795e-13 0)
(851.84 8.98347e-14 0)
(851.84 2.97122e-13 0)
(851.84 4.15936e-13 0)
(851.84 2.27706e-13 0)
(851.84 3.01183e-13 0)
(851.84 1.03638e-13 0)
(851.84 5.58987e-14 0)
(851.84 -1.40206e-13 0)
(851.84 1.25359e-14 0)
(851.84 -1.04732e-14 0)
(851.84 -3.39327e-14 0)
(851.84 -1.34352e-13 0)
(851.84 -2.90908e-13 0)
(851.84 -1.26028e-13 0)
(851.84 -7.05465e-14 0)
(851.84 -1.29223e-14 0)
(851.84 6.06356e-14 0)
(851.84 6.86199e-14 0)
(851.84 1.31125e-13 0)
(851.84 2.95201e-13 0)
(851.84 1.67606e-13 0)
(851.84 1.07682e-13 0)
(851.84 1.43843e-13 0)
(851.84 3.56011e-13 0)
(851.84 4.82987e-13 0)
(851.84 -2.7365e-13 0)
(851.84 -2.58666e-13 0)
(851.84 -2.91007e-13 0)
(851.84 -3.45998e-14 0)
(851.84 2.37199e-13 0)
(851.84 -9.10419e-14 0)
(851.84 1.51827e-16 0)
(851.84 7.59546e-14 0)
(851.84 2.31684e-13 0)
(851.84 2.054e-13 0)
(851.84 -2.41561e-13 0)
(851.84 1.09272e-13 0)
(851.84 2.81164e-13 0)
(851.84 5.88983e-13 0)
(851.84 7.20904e-13 0)
(851.84 6.56099e-13 0)
(851.84 -3.12865e-14 0)
(851.84 -1.53901e-13 0)
(851.84 -1.38169e-13 0)
(851.84 1.09617e-13 0)
(851.84 2.88332e-13 0)
(851.84 1.31871e-15 0)
(851.84 4.73919e-14 0)
(851.84 -6.81093e-15 0)
(851.84 -2.88947e-14 0)
(851.84 1.06215e-13 0)
(851.84 4.72899e-14 0)
(851.84 -1.1431e-13 0)
(851.84 -6.48294e-14 0)
(851.84 -4.97274e-14 0)
(851.84 -1.40273e-14 0)
(851.84 7.00917e-14 0)
(851.84 -8.6135e-14 0)
(851.84 -1.81469e-13 0)
(851.84 -1.73413e-13 0)
(851.84 -3.07675e-13 0)
(851.84 -7.65067e-13 0)
(851.84 7.23836e-14 0)
(851.84 3.72202e-13 0)
(851.84 -1.07862e-13 0)
(851.84 -1.16909e-13 0)
(851.84 1.24068e-13 0)
(851.84 6.45496e-14 0)
(851.84 1.95588e-13 0)
(851.84 2.24953e-13 0)
(851.84 2.36659e-14 0)
(851.84 2.17712e-14 0)
(851.84 -8.06739e-14 0)
(851.84 -3.6698e-13 0)
(851.84 -3.71194e-13 0)
(851.84 -2.05651e-13 0)
(851.84 2.14637e-13 0)
(851.84 1.06289e-13 0)
(851.84 4.42277e-14 0)
(851.84 7.71443e-14 0)
(851.84 5.90523e-14 0)
(851.84 2.60607e-14 0)
(851.84 2.65041e-13 0)
(851.84 5.17906e-13 0)
(851.84 5.13778e-14 0)
(851.84 -2.43965e-15 0)
(851.84 -2.49773e-14 0)
(851.84 -1.88625e-14 0)
(851.84 1.32891e-13 0)
(851.84 -1.42738e-13 0)
(851.84 -2.71622e-14 0)
(851.84 -9.11153e-14 0)
(851.84 -1.10622e-13 0)
(851.84 6.26783e-14 0)
(851.84 1.18642e-13 0)
(851.84 -2.24454e-14 0)
(851.84 -2.21393e-13 0)
(851.84 -5.5158e-13 0)
(851.84 -6.32676e-13 0)
(851.84 -4.26443e-13 0)
(851.84 -3.10531e-13 0)
(851.84 -5.26858e-14 0)
(851.84 -3.45184e-14 0)
(851.84 2.91646e-14 0)
(851.84 1.07662e-13 0)
(851.84 1.7323e-13 0)
(851.84 2.17435e-14 0)
(851.84 -1.57678e-13 0)
(851.84 -1.06427e-13 0)
(851.84 -3.12238e-13 0)
(851.84 -1.95773e-13 0)
(851.84 1.02096e-13 0)
(851.84 3.29828e-14 0)
(851.84 -1.77555e-13 0)
(851.84 -5.78883e-14 0)
(851.84 -6.52386e-14 0)
(851.84 -1.26439e-13 0)
(851.84 -7.32356e-14 0)
(851.84 1.50362e-13 0)
(851.84 2.21764e-13 0)
(851.84 2.91647e-13 0)
(851.84 4.49328e-13 0)
(851.84 5.39122e-14 0)
(851.84 9.8339e-14 0)
(851.84 2.25674e-13 0)
(851.84 1.02706e-13 0)
(851.84 1.31483e-13 0)
(851.84 6.71813e-14 0)
(851.84 5.64725e-14 0)
(851.84 6.5751e-14 0)
(851.84 -3.34245e-14 0)
(851.84 -5.09948e-14 0)
(851.84 -1.13403e-13 0)
(851.84 1.66045e-13 0)
(851.84 -8.61069e-14 0)
(851.84 6.77611e-14 0)
(851.84 -6.57643e-13 0)
(851.84 -7.42281e-13 0)
(851.84 -3.98604e-13 0)
(851.84 -5.27723e-13 0)
(851.84 1.73359e-13 0)
(851.84 1.60162e-13 0)
(851.84 -2.09084e-13 0)
(851.84 -1.75711e-14 0)
(851.84 -1.46083e-14 0)
(851.84 4.35428e-14 0)
(851.84 1.24697e-15 0)
(851.84 4.33639e-14 0)
(851.84 -1.27075e-13 0)
(851.84 -1.74494e-13 0)
(851.84 5.42907e-14 0)
(851.84 -1.23664e-13 0)
(851.84 -2.40211e-13 0)
(851.84 -2.06649e-13 0)
(851.84 -1.78011e-13 0)
(851.84 -7.66992e-15 0)
(851.84 -2.90636e-15 0)
(851.84 7.72596e-14 0)
(851.84 -5.10755e-14 0)
(851.84 -6.07424e-14 0)
(851.84 2.16252e-14 0)
(851.84 2.94988e-13 0)
(851.84 1.57079e-13 0)
(851.84 2.83225e-13 0)
(851.84 3.10388e-13 0)
(851.84 3.32712e-13 0)
(851.84 2.68055e-13 0)
(851.84 2.13475e-13 0)
(851.84 1.68423e-13 0)
(851.84 3.71145e-14 0)
(851.84 8.01472e-14 0)
(851.84 -5.39357e-14 0)
(851.84 4.38012e-14 0)
(851.84 -3.29992e-14 0)
(851.84 -8.23014e-14 0)
(851.84 -1.84617e-13 0)
(851.84 -1.71942e-13 0)
(851.84 -1.70448e-13 0)
(851.84 -1.5067e-13 0)
(851.84 2.81809e-14 0)
(851.84 -1.59527e-13 0)
(851.84 -6.20142e-13 0)
(851.84 -3.36141e-13 0)
(851.84 -1.58483e-13 0)
(851.84 -1.57771e-13 0)
(851.84 -1.41415e-13 0)
(851.84 -7.34162e-14 0)
(851.84 -2.10897e-13 0)
(851.84 -2.3787e-13 0)
(851.84 -2.46365e-13 0)
(851.84 -1.22421e-13 0)
(851.84 -1.80753e-13 0)
(851.84 -1.62941e-14 0)
(851.84 -9.61802e-14 0)
(851.84 -3.07868e-13 0)
(851.84 -8.42719e-14 0)
(851.84 6.2005e-14 0)
(851.84 -1.62272e-13 0)
(851.84 2.25684e-14 0)
(851.84 -1.58183e-13 0)
(851.84 1.67593e-14 0)
(851.84 1.64992e-13 0)
(851.84 2.31931e-13 0)
(851.84 5.9196e-13 0)
(851.84 4.6073e-13 0)
(851.84 6.49538e-13 0)
(851.84 3.74252e-13 0)
(851.84 3.81815e-13 0)
(851.84 3.41043e-13 0)
(851.84 1.48306e-13 0)
(851.84 -2.87631e-14 0)
(851.84 9.53415e-14 0)
(851.84 -3.32271e-13 0)
(851.84 -3.33278e-13 0)
(851.84 -3.33859e-13 0)
(851.84 -2.2526e-13 0)
(851.84 -2.28736e-13 0)
(851.84 -1.13964e-13 0)
(851.84 -6.20266e-14 0)
(851.84 -3.72504e-13 0)
(851.84 -3.00999e-13 0)
(851.84 -3.14239e-13 0)
(851.84 -1.94344e-13 0)
(851.84 -2.55199e-13 0)
(851.84 -2.80056e-13 0)
(851.84 -2.22326e-13 0)
(851.84 -4.72813e-13 0)
(851.84 -3.18395e-13 0)
(851.84 3.8679e-14 0)
(851.84 2.89596e-13 0)
(851.84 1.85174e-13 0)
(851.84 5.56095e-13 0)
(851.84 5.22169e-13 0)
(851.84 3.05065e-13 0)
(851.84 2.08541e-13 0)
(851.84 8.90617e-14 0)
(851.84 -6.42079e-14 0)
(851.84 -2.23311e-13 0)
(851.84 -2.50573e-13 0)
(851.84 6.5019e-14 0)
(851.84 1.61371e-13 0)
(851.84 1.83139e-13 0)
(851.84 2.80054e-13 0)
(851.84 3.52923e-14 0)
(851.84 2.90494e-14 0)
(851.84 -8.00246e-15 0)
(851.84 -1.40858e-13 0)
(851.84 -1.25162e-13 0)
(851.84 -3.56208e-13 0)
(851.84 -2.425e-13 0)
(851.84 -2.91642e-13 0)
(851.84 -5.37191e-13 0)
(851.84 -4.03853e-13 0)
(851.84 -2.67343e-13 0)
(851.84 -1.34745e-13 0)
(851.84 5.78962e-14 0)
(851.84 5.82571e-14 0)
(851.84 7.24414e-14 0)
(851.84 -2.40414e-13 0)
(851.84 -3.51185e-13 0)
(851.84 -2.20328e-13 0)
(851.84 1.56952e-14 0)
(851.84 1.00315e-13 0)
(851.84 -1.16897e-13 0)
(851.84 3.44253e-14 0)
(851.84 -3.19347e-13 0)
(851.84 2.6166e-13 0)
(851.84 2.97374e-13 0)
(851.84 8.7595e-14 0)
(851.84 1.44536e-13 0)
(851.84 3.64401e-13 0)
(851.84 4.78324e-13 0)
(851.84 5.381e-13 0)
(851.84 4.82837e-13 0)
(851.84 -3.94078e-14 0)
(851.84 1.1425e-13 0)
(851.84 6.31287e-15 0)
(851.84 -1.71216e-13 0)
(851.84 -1.86244e-13 0)
(851.84 -2.19887e-13 0)
(851.84 -2.88931e-13 0)
(851.84 -2.85068e-13 0)
(851.84 -1.36143e-13 0)
(851.84 -4.41994e-14 0)
(851.84 -1.12483e-13 0)
(851.84 -2.02994e-13 0)
(851.84 -7.53692e-14 0)
(851.84 -4.81973e-14 0)
(851.84 1.18439e-13 0)
(851.84 2.01069e-13 0)
(851.84 3.98929e-13 0)
(851.84 5.6833e-15 0)
(851.84 1.67397e-13 0)
(851.84 -6.30569e-14 0)
(851.84 -8.90279e-15 0)
(851.84 2.4288e-14 0)
(851.84 4.40467e-14 0)
(851.84 -1.92112e-13 0)
(851.84 -3.47368e-13 0)
(851.84 -3.01288e-13 0)
(851.84 -2.09748e-13 0)
(851.84 -3.8713e-14 0)
(851.84 -2.92666e-14 0)
(851.84 1.50549e-13 0)
(851.84 -2.40035e-14 0)
(851.84 1.60149e-13 0)
(851.84 8.23019e-14 0)
(851.84 1.29059e-13 0)
(851.84 5.3457e-13 0)
(851.84 9.14379e-13 0)
(851.84 5.7318e-13 0)
(851.84 4.67197e-13 0)
(851.84 -1.38273e-14 0)
(851.84 -1.74256e-13 0)
(851.84 -1.85251e-13 0)
(851.84 -1.75073e-13 0)
(851.84 -2.16918e-13 0)
(851.84 -3.07449e-13 0)
(851.84 -2.9278e-13 0)
(851.84 -2.35056e-13 0)
(851.84 -2.92883e-13 0)
(851.84 -1.73391e-13 0)
(851.84 1.00969e-13 0)
(851.84 1.09821e-13 0)
(851.84 2.15879e-13 0)
(851.84 1.26848e-13 0)
(851.84 1.30783e-13 0)
(851.84 3.5253e-13 0)
(851.84 7.05332e-14 0)
(851.84 -9.07901e-16 0)
(851.84 -5.25986e-14 0)
(851.84 -8.3824e-14 0)
(851.84 -2.43587e-13 0)
(851.84 -1.78374e-13 0)
(851.84 -2.77442e-13 0)
(851.84 -4.28757e-13 0)
(851.84 -5.83914e-13 0)
(851.84 -9.46693e-13 0)
(851.84 -4.6242e-13 0)
(851.84 -1.95019e-13 0)
(851.84 -4.03125e-14 0)
(851.84 4.85008e-14 0)
(851.84 -1.52966e-13 0)
(851.84 -1.18658e-13 0)
(851.84 -3.15818e-13 0)
(851.84 -3.23631e-13 0)
(851.84 -4.95253e-13 0)
(851.84 -4.87304e-13 0)
(851.84 -1.67542e-13 0)
(851.84 1.294e-14 0)
(851.84 1.63377e-14 0)
(851.84 1.6084e-13 0)
(851.84 -1.16801e-14 0)
(851.84 -3.29961e-14 0)
(851.84 8.84649e-14 0)
(851.84 5.13925e-14 0)
(851.84 -6.5588e-14 0)
(851.84 -1.33135e-13 0)
(851.84 -8.80357e-14 0)
(851.84 6.1506e-14 0)
(851.84 3.50859e-14 0)
(851.84 2.22201e-13 0)
(851.84 3.18853e-13 0)
(851.84 3.32033e-13 0)
(851.84 3.78655e-13 0)
(851.84 4.9841e-13 0)
(851.84 2.88701e-13 0)
(851.84 3.13675e-13 0)
(851.84 4.82581e-13 0)
(851.84 3.20328e-13 0)
(851.84 1.01357e-13 0)
(851.84 -1.93847e-13 0)
(851.84 -2.7675e-13 0)
(851.84 -4.46412e-13 0)
(851.84 -3.70884e-13 0)
(851.84 -5.36626e-13 0)
(851.84 -5.23628e-13 0)
(851.84 -3.2421e-13 0)
(851.84 -2.1873e-13 0)
(851.84 -2.83269e-13 0)
(851.84 -2.35029e-13 0)
(851.84 -2.68755e-13 0)
(851.84 -4.86357e-13 0)
(851.84 -4.56727e-13 0)
(851.84 -4.02409e-13 0)
(851.84 -2.46582e-13 0)
(851.84 -3.11654e-14 0)
(851.84 3.81675e-15 0)
(851.84 8.52131e-14 0)
(851.84 -5.57251e-14 0)
(851.84 6.73019e-15 0)
(851.84 -1.74536e-13 0)
(851.84 -1.43177e-13 0)
(851.84 -1.83542e-13 0)
(851.84 -1.04955e-13 0)
(851.84 -1.58278e-13 0)
(851.84 -1.78097e-13 0)
(851.84 -2.28067e-13 0)
(851.84 -2.18774e-13 0)
(851.84 -1.69496e-13 0)
(851.84 -1.36982e-13 0)
(851.84 6.26341e-14 0)
(851.84 3.73553e-13 0)
(851.84 4.27356e-13 0)
(851.84 3.65052e-13 0)
(851.84 9.89026e-14 0)
(851.84 -1.76456e-13 0)
(851.84 -2.80204e-13 0)
(851.84 -2.33358e-13 0)
(851.84 -3.41824e-13 0)
(851.84 -5.38594e-13 0)
(851.84 -4.24978e-13 0)
(851.84 -1.98406e-13 0)
(851.84 -1.68531e-13 0)
(851.84 -3.0885e-13 0)
(851.84 -3.09882e-13 0)
(851.84 -3.87287e-13 0)
(851.84 -5.14724e-13 0)
(851.84 -5.94757e-13 0)
(851.84 -8.59076e-13 0)
(851.84 -7.04873e-13 0)
(851.84 -6.65089e-13 0)
(851.84 -4.05042e-13 0)
(851.84 -2.99475e-13 0)
(851.84 -3.35412e-13 0)
(851.84 -2.03913e-13 0)
(851.84 3.10183e-15 0)
(851.84 -4.74801e-14 0)
(851.84 -9.44955e-14 0)
(851.84 -1.56657e-13 0)
(851.84 -3.03535e-13 0)
(851.84 -2.21773e-13 0)
(851.84 -3.15919e-13 0)
(851.84 -5.18732e-14 0)
(851.84 4.04143e-14 0)
(851.84 -9.04186e-14 0)
(851.84 -1.86314e-13 0)
(851.84 -2.01442e-13 0)
(851.84 -2.63055e-13 0)
(851.84 2.32417e-13 0)
(851.84 3.80473e-13 0)
(851.84 1.12925e-13 0)
(851.84 6.70094e-14 0)
(851.84 1.03539e-13 0)
(851.84 8.50999e-14 0)
(851.84 4.97932e-14 0)
(851.84 1.37382e-13 0)
(851.84 1.57019e-13 0)
(851.84 1.6838e-14 0)
(851.84 -1.37542e-13 0)
(851.84 -1.15862e-13 0)
(851.84 -1.96254e-13 0)
(851.84 -2.83786e-13 0)
(851.84 -2.14178e-13 0)
(851.84 -4.97177e-13 0)
(851.84 -2.93725e-13 0)
(851.84 -4.24236e-13 0)
(851.84 -4.77341e-13 0)
(851.84 -7.22885e-13 0)
(851.84 -5.97698e-13 0)
(851.84 -6.32063e-13 0)
(851.84 -5.33977e-13 0)
(851.84 -4.5974e-13 0)
(851.84 -3.84407e-13 0)
(851.84 -5.69997e-14 0)
(851.84 1.13108e-13 0)
(851.84 3.31078e-14 0)
(851.84 1.72491e-14 0)
(851.84 -1.21366e-13 0)
(851.84 -6.06479e-14 0)
(851.84 -6.2994e-14 0)
(851.84 2.72412e-15 0)
(851.84 -5.37816e-14 0)
(851.84 1.14776e-13 0)
(851.84 -1.09749e-14 0)
(851.84 -1.26387e-13 0)
(851.84 2.61656e-14 0)
(851.84 -2.33832e-13 0)
(851.84 6.70949e-14 0)
(851.84 1.86119e-13 0)
(851.84 2.26431e-13 0)
(851.84 3.80692e-13 0)
(851.84 4.20551e-13 0)
(851.84 3.11954e-13 0)
(851.84 2.65332e-13 0)
(851.84 3.90929e-14 0)
(851.84 1.09921e-13 0)
(851.84 5.96012e-15 0)
(851.84 -1.40157e-13 0)
(851.84 -1.48033e-13 0)
(851.84 -8.93607e-14 0)
(851.84 -3.86694e-13 0)
(851.84 -4.80137e-13 0)
(851.84 -3.71249e-13 0)
(851.84 -4.7411e-13 0)
(851.84 -6.06826e-13 0)
(851.84 -4.39849e-13 0)
(851.84 -5.50942e-13 0)
(851.84 -5.14839e-13 0)
(851.84 -4.39509e-13 0)
(851.84 -3.31633e-13 0)
(851.84 -2.43062e-13 0)
(851.84 -5.4255e-16 0)
(851.84 -2.00023e-14 0)
(851.84 8.24097e-14 0)
(851.84 1.48629e-13 0)
(851.84 1.28182e-13 0)
(851.84 4.56598e-14 0)
(851.84 1.49622e-13 0)
(851.84 -2.02633e-13 0)
(851.84 -1.04492e-13 0)
(851.84 -1.7537e-13 0)
(851.84 -2.95294e-14 0)
(851.84 1.45211e-13 0)
(851.84 -3.34108e-14 0)
(851.84 4.28706e-14 0)
(851.84 -1.16453e-13 0)
(851.84 -2.20116e-13 0)
(851.84 -1.57446e-13 0)
(851.84 -6.41528e-14 0)
(851.84 6.69023e-15 0)
(851.84 2.4526e-13 0)
(851.84 1.14279e-13 0)
(851.84 1.76931e-13 0)
(851.84 1.19926e-13 0)
(851.84 3.63119e-13 0)
(851.84 4.35309e-13 0)
(851.84 3.32949e-13 0)
(851.84 2.05666e-13 0)
(851.84 2.20624e-13 0)
(851.84 1.22672e-13 0)
(851.84 -2.86752e-13 0)
(851.84 -4.0585e-13 0)
(851.84 -2.41084e-13 0)
(851.84 -5.53749e-14 0)
(851.84 -3.21361e-13 0)
(851.84 -5.04445e-13 0)
(851.84 -4.2732e-13 0)
(851.84 -3.38238e-13 0)
(851.84 3.55428e-15 0)
(851.84 2.96776e-14 0)
(851.84 -7.63542e-14 0)
(851.84 -7.38941e-14 0)
(851.84 -4.00121e-14 0)
(851.84 8.22457e-14 0)
(851.84 -7.78253e-14 0)
(851.84 4.79528e-14 0)
(851.84 4.5377e-14 0)
(851.84 -2.49928e-13 0)
(851.84 -2.81949e-13 0)
(851.84 -6.77167e-14 0)
(851.84 -4.30903e-14 0)
(851.84 3.22135e-14 0)
(851.84 -4.8061e-14 0)
(851.84 -2.34413e-13 0)
(851.84 -2.83916e-13 0)
(851.84 -1.29287e-13 0)
(851.84 -1.51894e-13 0)
(851.84 2.33859e-14 0)
(851.84 3.88893e-14 0)
(851.84 1.26065e-13 0)
(851.84 7.26352e-14 0)
(851.84 1.64938e-13 0)
(851.84 9.58142e-14 0)
(851.84 -2.53559e-13 0)
(851.84 9.19512e-15 0)
(851.84 -1.52034e-13 0)
(851.84 1.7832e-13 0)
(851.84 4.17859e-13 0)
(851.84 1.8918e-13 0)
(851.84 3.85402e-13 0)
(851.84 6.01646e-14 0)
(851.84 -2.54201e-14 0)
(851.84 9.32819e-14 0)
(851.84 2.2947e-13 0)
(851.84 -2.83563e-14 0)
(851.84 -8.01297e-14 0)
(851.84 4.653e-14 0)
(851.84 5.07804e-14 0)
(851.84 1.28712e-14 0)
(851.84 1.86174e-13 0)
(851.84 2.93944e-13 0)
(851.84 2.28507e-13 0)
(851.84 3.52491e-13 0)
(851.84 2.89347e-13 0)
(851.84 1.54861e-13 0)
(851.84 4.7703e-13 0)
(851.84 1.60917e-13 0)
(851.84 1.20304e-13 0)
(851.84 7.74095e-14 0)
(851.84 7.19872e-14 0)
(851.84 -1.05153e-13 0)
(851.84 -2.81073e-13 0)
(851.84 -4.37689e-13 0)
(851.84 1.08744e-14 0)
(851.84 1.65128e-13 0)
(851.84 -1.57158e-13 0)
(851.84 -2.07967e-13 0)
(851.84 1.33696e-13 0)
(851.84 3.87747e-13 0)
(851.84 3.62359e-13 0)
(851.84 3.2569e-13 0)
(851.84 2.33518e-13 0)
(851.84 -5.63806e-14 0)
(851.84 -1.89291e-13 0)
(851.84 -7.41239e-14 0)
(851.84 -4.41228e-14 0)
(851.84 3.78405e-13 0)
(851.84 2.13883e-13 0)
(851.84 2.48003e-13 0)
(851.84 -1.27375e-13 0)
(851.84 2.51758e-13 0)
(851.84 3.49102e-13 0)
(851.84 5.4203e-13 0)
(851.84 7.50453e-13 0)
(851.84 5.7975e-13 0)
(851.84 -2.48277e-14 0)
(851.84 1.13947e-13 0)
(851.84 3.95639e-14 0)
(851.84 1.1385e-13 0)
(851.84 3.7831e-14 0)
(851.84 -5.6734e-14 0)
(851.84 2.06317e-15 0)
(851.84 3.69968e-14 0)
(851.84 1.03299e-14 0)
(851.84 2.3905e-13 0)
(851.84 -3.82278e-14 0)
(851.84 7.36736e-14 0)
(851.84 -9.50312e-14 0)
(851.84 -1.1255e-13 0)
(851.84 -1.64654e-13 0)
(851.84 -1.58864e-13 0)
(851.84 -2.11667e-13 0)
(851.84 -3.49726e-13 0)
(851.84 -3.02745e-13 0)
(851.84 -5.65977e-13 0)
(851.84 -7.08154e-13 0)
(851.84 -2.88511e-13 0)
(851.84 -9.85644e-14 0)
(851.84 1.65844e-13 0)
(851.84 1.27014e-13 0)
(851.84 -5.01182e-14 0)
(851.84 4.30791e-14 0)
(851.84 -7.12981e-14 0)
(851.84 -2.51775e-16 0)
(851.84 -6.13331e-15 0)
(851.84 1.43147e-13 0)
(851.84 2.02478e-13 0)
(851.84 5.01184e-13 0)
(851.84 3.32308e-13 0)
(851.84 3.87903e-13 0)
(851.84 5.85034e-13 0)
(851.84 5.85314e-13 0)
(851.84 5.0403e-13 0)
(851.84 -9.39767e-14 0)
(851.84 -9.48371e-14 0)
(851.84 -4.81632e-14 0)
(851.84 -2.11058e-13 0)
(851.84 -2.66361e-13 0)
(851.84 -2.33599e-13 0)
(851.84 -1.86131e-13 0)
(851.84 -1.74875e-14 0)
(851.84 2.78845e-14 0)
(851.84 2.76758e-13 0)
(851.84 2.91877e-13 0)
(851.84 2.01354e-13 0)
(851.84 6.9342e-14 0)
(851.84 -6.57475e-14 0)
(851.84 -7.38054e-14 0)
(851.84 -5.45221e-14 0)
(851.84 -3.37652e-13 0)
(851.84 -4.99886e-13 0)
(851.84 -5.39639e-13 0)
(851.84 -3.70497e-13 0)
(851.84 -4.4113e-13 0)
(851.84 -5.95868e-13 0)
(851.84 -2.84462e-13 0)
(851.84 -2.92119e-13 0)
(851.84 -3.39262e-14 0)
(851.84 5.25068e-14 0)
(851.84 -1.10693e-13 0)
(851.84 1.0495e-13 0)
(851.84 9.08227e-14 0)
(851.84 2.94571e-13 0)
(851.84 3.00848e-13 0)
(851.84 3.72862e-13 0)
(851.84 4.12634e-13 0)
(851.84 4.19556e-13 0)
(851.84 3.88338e-13 0)
(851.84 5.72729e-13 0)
(851.84 4.08759e-13 0)
(851.84 1.86495e-13 0)
(851.84 2.72886e-14 0)
(851.84 -4.87549e-14 0)
(851.84 -8.6805e-14 0)
(851.84 -1.07089e-13 0)
(851.84 -2.93344e-13 0)
(851.84 3.21642e-14 0)
(851.84 1.25805e-13 0)
(851.84 3.35877e-13 0)
(851.84 3.50655e-13 0)
(851.84 1.93236e-13 0)
(851.84 2.68107e-13 0)
(851.84 3.68358e-15 0)
(851.84 -9.61522e-14 0)
(851.84 -1.75443e-13 0)
(851.84 -1.22509e-13 0)
(851.84 -1.69769e-13 0)
(851.84 -3.98926e-13 0)
(851.84 -3.48418e-13 0)
(851.84 -1.6879e-13 0)
(851.84 -8.74551e-14 0)
(851.84 3.08502e-14 0)
(851.84 -8.39533e-14 0)
(851.84 5.82643e-14 0)
(851.84 3.11129e-13 0)
(851.84 3.0853e-13 0)
(851.84 4.85894e-13 0)
(851.84 5.33514e-13 0)
(851.84 5.26136e-13 0)
(851.84 8.05802e-13 0)
(851.84 6.49412e-13 0)
(851.84 6.76754e-13 0)
(851.84 7.10933e-13 0)
(851.84 5.49876e-13 0)
(851.84 3.58555e-13 0)
(851.84 1.18784e-13 0)
(851.84 -2.01756e-13 0)
(851.84 -3.12581e-13 0)
(851.84 -9.52664e-15 0)
(851.84 9.55749e-14 0)
(851.84 -3.12594e-14 0)
(851.84 -3.7842e-14 0)
(851.84 1.32526e-13 0)
(851.84 3.2182e-13 0)
(851.84 3.71745e-13 0)
(851.84 3.11281e-13 0)
(851.84 2.52938e-13 0)
(851.84 2.95116e-13 0)
(851.84 2.47465e-13 0)
(851.84 1.85728e-13 0)
(851.84 -1.08092e-13 0)
(851.84 -2.82517e-13 0)
(851.84 6.28665e-14 0)
(851.84 1.81001e-13 0)
(851.84 2.3297e-13 0)
(851.84 6.37626e-14 0)
(851.84 -5.74499e-14 0)
(851.84 -1.30144e-13 0)
(851.84 -2.21253e-13 0)
(851.84 -1.86729e-13 0)
(851.84 5.03689e-14 0)
(851.84 6.99059e-14 0)
(851.84 6.38677e-15 0)
(851.84 1.05875e-13 0)
(851.84 2.97797e-14 0)
(851.84 7.15601e-13 0)
(851.84 8.13486e-13 0)
(851.84 8.32785e-13 0)
(851.84 4.06827e-13 0)
(851.84 2.81557e-13 0)
(851.84 2.47535e-13 0)
(851.84 3.63729e-13 0)
(851.84 5.31498e-13 0)
(851.84 2.85986e-13 0)
(851.84 -1.21622e-13 0)
(851.84 -1.36608e-13 0)
(851.84 -1.5365e-13 0)
(851.84 -3.35222e-14 0)
(851.84 6.44509e-14 0)
(851.84 1.464e-13 0)
(851.84 2.65988e-14 0)
(851.84 2.71702e-14 0)
(851.84 2.18995e-14 0)
(851.84 2.1702e-13 0)
(851.84 4.43819e-16 0)
(851.84 -1.00003e-14 0)
(851.84 2.44744e-14 0)
(851.84 1.67244e-13 0)
(851.84 -1.3811e-13 0)
(851.84 4.64604e-13 0)
(851.84 2.42075e-13 0)
(851.84 7.46886e-14 0)
(851.84 5.38688e-13 0)
(851.84 3.97932e-13 0)
(851.84 -2.85126e-14 0)
(851.84 -2.74135e-13 0)
(851.84 -2.86748e-13 0)
(851.84 -4.38323e-13 0)
(851.84 5.95273e-13 0)
(851.84 2.95325e-13 0)
(851.84 4.86971e-13 0)
(851.84 5.73731e-13 0)
(851.84 5.67837e-13 0)
(851.84 5.68706e-13 0)
(851.84 6.5246e-13 0)
(851.84 6.48381e-13 0)
(851.84 6.09743e-13 0)
(851.84 8.34651e-13 0)
(851.84 6.5687e-13 0)
(851.84 4.22103e-13 0)
(851.84 3.66997e-13 0)
(851.84 4.51267e-13 0)
(851.84 1.64903e-13 0)
(851.84 9.01555e-14 0)
(851.84 -3.97626e-13 0)
(851.84 -7.4879e-14 0)
(851.84 2.19142e-13 0)
(851.84 8.32456e-14 0)
(851.84 -1.19989e-13 0)
(851.84 -1.25268e-13 0)
(851.84 -2.63164e-13 0)
(851.84 -1.93314e-13 0)
(851.84 3.2414e-15 0)
(851.84 5.8418e-14 0)
(851.84 -9.2092e-14 0)
(851.84 -1.76921e-13 0)
(851.84 -1.28685e-14 0)
(851.84 8.50344e-14 0)
(851.84 1.22006e-13 0)
(851.84 2.70429e-13 0)
(851.84 3.17374e-13 0)
(851.84 5.54275e-14 0)
(851.84 2.08784e-13 0)
(851.84 1.16501e-13 0)
(851.84 2.93785e-13 0)
(851.84 -1.08334e-13 0)
(851.84 -1.17688e-13 0)
(851.84 3.34233e-13 0)
(851.84 4.45443e-13 0)
(851.84 5.25255e-13 0)
(851.84 4.88532e-13 0)
(851.84 4.71892e-13 0)
(851.84 2.78921e-13 0)
(851.84 2.09266e-13 0)
(851.84 4.8346e-13 0)
(851.84 6.62468e-13 0)
(851.84 3.79409e-13 0)
(851.84 3.20356e-13 0)
(851.84 2.87562e-13 0)
(851.84 1.36759e-13 0)
(851.84 1.60973e-13 0)
(851.84 4.17037e-13 0)
(851.84 4.12739e-13 0)
(851.84 1.49292e-14 0)
(851.84 -1.29537e-13 0)
(851.84 5.90384e-14 0)
(851.84 2.1968e-15 0)
(851.84 -3.78153e-14 0)
(851.84 -2.68082e-13 0)
(851.84 -1.29437e-13 0)
(851.84 -1.1501e-13 0)
(851.84 1.01409e-13 0)
(851.84 7.85548e-14 0)
(851.84 1.95399e-13 0)
(851.84 -3.24969e-14 0)
(851.84 3.98255e-15 0)
(851.84 3.15689e-13 0)
(851.84 2.44085e-13 0)
(851.84 -7.10276e-15 0)
(851.84 6.04717e-14 0)
(851.84 -1.33122e-13 0)
(851.84 1.68002e-14 0)
(851.84 1.51391e-14 0)
(851.84 3.66019e-13 0)
(851.84 3.36734e-13 0)
(851.84 5.59964e-13 0)
(851.84 3.66712e-13 0)
(851.84 4.15193e-13 0)
(851.84 6.22893e-13 0)
(851.84 2.72185e-13 0)
(851.84 3.16321e-14 0)
(851.84 1.97322e-13 0)
(851.84 2.71624e-13 0)
(851.84 1.45929e-13 0)
(851.84 -6.05683e-14 0)
(851.84 -6.18009e-14 0)
(851.84 1.52316e-13 0)
(851.84 8.00328e-14 0)
(851.84 5.67046e-14 0)
(851.84 -1.48403e-13 0)
(851.84 6.60078e-13 0)
(851.84 1.67656e-13 0)
(851.84 5.28336e-14 0)
(851.84 -2.11131e-13 0)
(851.84 -1.23936e-13 0)
(851.84 -3.40787e-14 0)
(851.84 1.11061e-13 0)
(851.84 3.87766e-15 0)
(851.84 -8.72025e-14 0)
(851.84 -4.37639e-14 0)
(851.84 5.20697e-14 0)
(851.84 -9.99851e-15 0)
(851.84 -1.07053e-13 0)
(851.84 3.10781e-13 0)
(851.84 -9.48553e-14 0)
(851.84 -8.74511e-14 0)
(851.84 5.18386e-14 0)
(851.84 -7.78966e-14 0)
(851.84 2.14459e-13 0)
(851.84 3.20078e-14 0)
(851.84 3.34112e-13 0)
(851.84 3.21539e-13 0)
(851.84 3.48569e-13 0)
(851.84 3.34377e-13 0)
(851.84 6.74896e-13 0)
(851.84 6.24266e-13 0)
(851.84 7.23437e-13 0)
(851.84 5.99849e-13 0)
(851.84 4.08171e-13 0)
(851.84 3.35337e-13 0)
(851.84 5.15357e-13 0)
(851.84 6.73701e-13 0)
(851.84 4.18253e-13 0)
(851.84 5.67557e-13 0)
(851.84 2.2608e-13 0)
(851.84 2.10699e-13 0)
(851.84 1.35937e-13 0)
(851.84 -1.27489e-13 0)
(851.84 -2.39401e-13 0)
(851.84 -6.6379e-14 0)
(851.84 -5.07456e-14 0)
(851.84 -5.37506e-14 0)
(851.84 -1.9723e-15 0)
(851.84 8.42049e-14 0)
(851.84 9.88544e-14 0)
(851.84 1.11591e-13 0)
(851.84 2.4411e-14 0)
(851.84 -6.48274e-14 0)
(851.84 -1.53825e-13 0)
(851.84 -3.37634e-13 0)
(851.84 2.6504e-13 0)
(851.84 2.76267e-13 0)
(851.84 2.03232e-13 0)
(851.84 -1.65823e-14 0)
(851.84 6.65088e-15 0)
(851.84 3.55192e-13 0)
(851.84 4.25176e-13 0)
(851.84 5.888e-13 0)
(851.84 4.18979e-13 0)
(851.84 3.54296e-13 0)
(851.84 2.88832e-13 0)
(851.84 3.29272e-13 0)
(851.84 3.40121e-13 0)
(851.84 4.75053e-13 0)
(851.84 6.0919e-13 0)
(851.84 4.52501e-13 0)
(851.84 2.46836e-13 0)
(851.84 2.91511e-14 0)
(851.84 -1.14743e-13 0)
(851.84 2.49532e-13 0)
(851.84 3.29753e-13 0)
(851.84 2.43857e-13 0)
(851.84 1.43416e-14 0)
(851.84 -4.49811e-14 0)
(851.84 -2.85236e-13 0)
(851.84 -5.10564e-13 0)
(851.84 -9.97583e-13 0)
(851.84 1.57282e-14 0)
(851.84 -3.64966e-14 0)
(851.84 -4.42803e-14 0)
(851.84 -3.47985e-14 0)
(851.84 8.33356e-14 0)
(851.84 1.57146e-13 0)
(851.84 2.36497e-13 0)
(851.84 2.10281e-13 0)
(851.84 -1.12408e-13 0)
(851.84 -1.1554e-13 0)
(851.84 9.1036e-14 0)
(851.84 3.05062e-13 0)
(851.84 4.03904e-13 0)
(851.84 3.56707e-13 0)
(851.84 2.81143e-13 0)
(851.84 1.44192e-13 0)
(851.84 4.3092e-13 0)
(851.84 5.09267e-13 0)
(851.84 2.7252e-13 0)
(851.84 5.2742e-13 0)
(851.84 6.09591e-13 0)
(851.84 5.57453e-13 0)
(851.84 6.09317e-13 0)
(851.84 -2.55132e-14 0)
(851.84 -1.61651e-13 0)
(851.84 6.09465e-14 0)
(851.84 1.058e-13 0)
(851.84 -2.29408e-14 0)
(851.84 8.04309e-14 0)
(851.84 -5.52352e-13 0)
(851.84 -4.63951e-13 0)
(851.84 -4.08333e-13 0)
(851.84 -4.85462e-13 0)
(851.84 -7.41813e-13 0)
(851.84 -7.41848e-13 0)
(851.84 -7.13259e-13 0)
(851.84 -8.36873e-13 0)
(851.84 -9.25469e-13 0)
(851.84 3.14032e-14 0)
(851.84 -1.12419e-14 0)
(851.84 5.38912e-14 0)
(851.84 1.01109e-13 0)
(851.84 -8.48027e-14 0)
(851.84 -1.5947e-13 0)
(851.84 -2.67358e-13 0)
(851.84 -2.78522e-13 0)
(851.84 -2.31185e-13 0)
(851.84 -2.23025e-13 0)
(851.84 2.20054e-13 0)
(851.84 4.6293e-13 0)
(851.84 4.40608e-13 0)
(851.84 4.671e-13 0)
(851.84 3.74492e-13 0)
(851.84 4.30874e-13 0)
(851.84 3.62345e-13 0)
(851.84 3.59016e-13 0)
(851.84 4.82605e-13 0)
(851.84 5.7933e-13 0)
(851.84 4.8812e-13 0)
(851.84 3.17357e-13 0)
(851.84 1.5058e-13 0)
(851.84 -1.16848e-14 0)
(851.84 4.03906e-14 0)
(851.84 -1.14811e-13 0)
(851.84 -1.59056e-13 0)
(851.84 -1.30326e-13 0)
(851.84 -1.91572e-13 0)
(851.84 -3.38257e-13 0)
(851.84 -5.96327e-13 0)
(851.84 -8.96112e-13 0)
(851.84 -1.06944e-12 0)
(851.84 -1.0039e-12 0)
(851.84 -1.08922e-12 0)
(851.84 -1.17718e-12 0)
(851.84 -1.18474e-12 0)
(851.84 -1.22874e-12 0)
(851.84 3.56226e-15 0)
(851.84 -7.96367e-14 0)
(851.84 -2.15972e-13 0)
(851.84 -5.98716e-14 0)
(851.84 -1.83933e-14 0)
(851.84 -9.23251e-14 0)
(851.84 -1.46826e-13 0)
(851.84 -3.24657e-13 0)
(851.84 1.4273e-13 0)
(851.84 3.49868e-13 0)
(851.84 4.45493e-13 0)
(851.84 4.65697e-13 0)
(851.84 3.62031e-13 0)
(851.84 2.23586e-13 0)
(851.84 4.96973e-13 0)
(851.84 6.5765e-13 0)
(851.84 6.26951e-13 0)
(851.84 3.95562e-13 0)
(851.84 3.6947e-13 0)
(851.84 1.55828e-13 0)
(851.84 3.15023e-13 0)
(851.84 3.18699e-13 0)
(851.84 2.35254e-13 0)
(851.84 2.2727e-13 0)
(851.84 2.00845e-13 0)
(851.84 -3.85996e-13 0)
(851.84 -2.35522e-13 0)
(851.84 -1.09847e-13 0)
(851.84 -4.49066e-14 0)
(851.84 -1.76201e-13 0)
(851.84 -4.43557e-13 0)
(851.84 -8.43046e-13 0)
(851.84 -1.17976e-12 0)
(851.84 -1.41965e-12 0)
(851.84 -1.55285e-12 0)
(851.84 -1.52062e-12 0)
(851.84 -1.2956e-12 0)
(851.84 -1.33424e-12 0)
(851.84 -3.81223e-15 0)
(851.84 3.44458e-14 0)
(851.84 -1.23777e-15 0)
(851.84 -8.35336e-14 0)
(851.84 1.32783e-14 0)
(851.84 4.96595e-14 0)
(851.84 1.86758e-13 0)
(851.84 4.61202e-13 0)
(851.84 4.84114e-13 0)
(851.84 5.47807e-13 0)
(851.84 2.8346e-13 0)
(851.84 1.15278e-13 0)
(851.84 3.98584e-13 0)
(851.84 4.70447e-13 0)
(851.84 7.15678e-13 0)
(851.84 5.55408e-13 0)
(851.84 6.27402e-13 0)
(851.84 7.77862e-13 0)
(851.84 7.12135e-13 0)
(851.84 6.71609e-13 0)
(851.84 4.90528e-13 0)
(851.84 3.02993e-13 0)
(851.84 4.28393e-14 0)
(851.84 -1.00007e-13 0)
(851.84 -4.58842e-13 0)
(851.84 -7.19313e-13 0)
(851.84 -6.90605e-13 0)
(851.84 -8.6563e-13 0)
(851.84 -1.03349e-12 0)
(851.84 -1.02954e-12 0)
(851.84 -1.16278e-12 0)
(851.84 -1.34498e-12 0)
(851.84 -1.26684e-12 0)
(851.84 -1.31546e-12 0)
(851.84 -1.43617e-12 0)
(851.84 -1.40086e-12 0)
(851.84 -1.62923e-12 0)
(851.84 -1.4209e-12 0)
(851.84 -8.82937e-15 0)
(851.84 -7.21356e-14 0)
(851.84 5.77479e-14 0)
(851.84 5.70216e-14 0)
(851.84 -4.31046e-14 0)
(851.84 3.43331e-14 0)
(851.84 1.77497e-13 0)
(851.84 2.35382e-13 0)
(851.84 1.75194e-13 0)
(851.84 7.6069e-14 0)
(851.84 3.97853e-13 0)
(851.84 7.26072e-13 0)
(851.84 6.3418e-13 0)
(851.84 5.65675e-13 0)
(851.84 3.94702e-13 0)
(851.84 5.70673e-13 0)
(851.84 5.11201e-13 0)
(851.84 5.17488e-13 0)
(851.84 5.21607e-13 0)
(851.84 3.2219e-13 0)
(851.84 -1.03629e-14 0)
(851.84 -1.02345e-14 0)
(851.84 -8.1605e-14 0)
(851.84 2.20969e-13 0)
(851.84 -4.50832e-13 0)
(851.84 -6.19727e-13 0)
(851.84 -1.0318e-12 0)
(851.84 -1.15945e-12 0)
(851.84 -1.55902e-12 0)
(851.84 -1.78785e-12 0)
(851.84 -1.84036e-12 0)
(851.84 -1.79468e-12 0)
(851.84 -1.73175e-12 0)
(851.84 -1.63908e-12 0)
(851.84 -1.55874e-12 0)
(851.84 -1.5636e-12 0)
(851.84 -1.68052e-12 0)
(851.84 -1.66748e-12 0)
(851.84 5.01907e-14 0)
(851.84 1.66973e-13 0)
(851.84 2.3156e-13 0)
(851.84 2.11941e-13 0)
(851.84 1.39047e-13 0)
(851.84 1.48861e-13 0)
(851.84 2.92359e-13 0)
(851.84 2.99078e-13 0)
(851.84 5.118e-13 0)
(851.84 4.68243e-13 0)
(851.84 3.52034e-13 0)
(851.84 3.41157e-13 0)
(851.84 5.59201e-13 0)
(851.84 5.4804e-13 0)
(851.84 6.80889e-13 0)
(851.84 8.36011e-13 0)
(851.84 7.45316e-13 0)
(851.84 4.56772e-13 0)
(851.84 3.15793e-13 0)
(851.84 7.22884e-14 0)
(851.84 -3.68741e-13 0)
(851.84 -2.65455e-13 0)
(851.84 -4.19193e-13 0)
(851.84 -4.18532e-13 0)
(851.84 -4.29359e-13 0)
(851.84 -6.58885e-13 0)
(851.84 -8.19466e-13 0)
(851.84 -1.17718e-12 0)
(851.84 -1.46191e-12 0)
(851.84 -1.73295e-12 0)
(851.84 -1.74341e-12 0)
(851.84 -1.62271e-12 0)
(851.84 -1.45493e-12 0)
(851.84 -1.52181e-12 0)
(851.84 -1.76338e-12 0)
(851.84 -1.44622e-12 0)
(851.84 -1.17583e-12 0)
(851.84 -9.46492e-13 0)
(851.84 2.34954e-14 0)
(851.84 -5.83012e-14 0)
(851.84 5.40084e-15 0)
(851.84 2.82528e-13 0)
(851.84 4.22112e-13 0)
(851.84 2.90337e-13 0)
(851.84 4.49649e-13 0)
(851.84 3.56629e-13 0)
(851.84 3.17343e-13 0)
(851.84 4.11363e-13 0)
(851.84 3.15544e-13 0)
(851.84 4.41117e-13 0)
(851.84 3.61705e-13 0)
(851.84 2.91932e-13 0)
(851.84 2.72736e-13 0)
(851.84 1.2968e-13 0)
(851.84 3.34158e-14 0)
(851.84 1.74119e-13 0)
(851.84 2.87055e-14 0)
(851.84 -6.0399e-13 0)
(851.84 -3.95592e-14 0)
(851.84 -5.4668e-13 0)
(851.84 -6.19336e-13 0)
(851.84 -8.57562e-13 0)
(851.84 -8.99069e-13 0)
(851.84 -8.07683e-13 0)
(851.84 -9.21787e-13 0)
(851.84 -1.03616e-12 0)
(851.84 -1.37086e-12 0)
(851.84 -1.35804e-12 0)
(851.84 -1.39788e-12 0)
(851.84 -1.45935e-12 0)
(851.84 -1.61312e-12 0)
(851.84 -1.69747e-12 0)
(851.84 -1.62425e-12 0)
(851.84 -1.33228e-12 0)
(851.84 -1.18378e-12 0)
(851.84 -9.21483e-13 0)
(851.84 -1.3023e-13 0)
(851.84 2.38552e-13 0)
(851.84 2.41534e-13 0)
(851.84 3.27925e-13 0)
(851.84 2.90061e-13 0)
(851.84 5.16666e-13 0)
(851.84 4.37109e-13 0)
(851.84 6.20267e-13 0)
(851.84 6.71342e-13 0)
(851.84 5.74066e-13 0)
(851.84 4.079e-13 0)
(851.84 3.97083e-13 0)
(851.84 1.30465e-13 0)
(851.84 4.38588e-14 0)
(851.84 8.91196e-14 0)
(851.84 -3.38208e-13 0)
(851.84 -3.43037e-13 0)
(851.84 -4.71139e-13 0)
(851.84 -8.68269e-13 0)
(851.84 -1.01408e-12 0)
(851.84 -1.10966e-12 0)
(851.84 -1.36138e-12 0)
(851.84 -1.5022e-12 0)
(851.84 -1.53315e-12 0)
(851.84 -1.52174e-12 0)
(851.84 -1.20534e-12 0)
(851.84 -1.35452e-12 0)
(851.84 -1.47814e-12 0)
(851.84 -1.68308e-12 0)
(851.84 -1.18825e-12 0)
(851.84 -1.39456e-12 0)
(851.84 -1.48654e-12 0)
(851.84 -1.93945e-12 0)
(851.84 -1.52539e-12 0)
(851.84 -1.49516e-12 0)
(851.84 -1.32497e-12 0)
(851.84 -1.21489e-12 0)
(851.84 -1.1431e-12 0)
(851.84 -6.85882e-14 0)
(851.84 -2.67632e-15 0)
(851.84 -2.39197e-15 0)
(851.84 -2.3726e-15 0)
(851.84 -1.89022e-17 0)
(851.84 7.43493e-15 0)
(851.84 7.76593e-15 0)
(851.84 5.10127e-15 0)
(851.84 1.28144e-14 0)
(851.84 1.15796e-14 0)
(851.84 9.63235e-15 0)
(851.84 -5.08879e-15 0)
(851.84 -6.73778e-14 0)
(851.84 -4.62029e-14 0)
(851.84 1.96133e-15 0)
(851.84 -3.17307e-13 0)
(851.84 -2.05252e-13 0)
(851.84 -2.25203e-13 0)
(851.84 -4.25878e-13 0)
(851.84 -5.86566e-13 0)
(851.84 -1.03621e-12 0)
(851.84 -1.061e-12 0)
(851.84 -1.23634e-12 0)
(851.84 -1.28994e-12 0)
(851.84 -1.24091e-12 0)
(851.84 -1.09965e-12 0)
(851.84 -1.09785e-12 0)
(851.84 -1.23023e-12 0)
(851.84 -1.70318e-12 0)
(851.84 -1.54893e-12 0)
(851.84 -1.49523e-12 0)
(851.84 -1.38583e-12 0)
(851.84 -1.47705e-12 0)
(851.84 -1.39189e-12 0)
(851.84 -1.5163e-12 0)
(851.84 -1.49032e-12 0)
(851.84 -1.34883e-12 0)
(851.84 -1.13039e-12 0)
(825.724 20.6399 0)
(789.783 5.62084 0)
(754.277 77.9322 0)
(721.813 76.166 1.68311e-16)
(689.305 123.236 -7.41734e-23)
(674.972 157.19 0)
(681.226 165.744 -1.5235e-16)
(698.544 197.69 0)
(706.417 192.658 1.75764e-16)
(713.775 199.486 0)
(713.32 199.284 0)
(709.833 196.316 -1.55387e-16)
(707.747 189.76 3.089e-16)
(709.331 188.888 -1.48139e-16)
(712.677 188.776 0)
(716.097 189.662 1.7127e-16)
(718.59 191.185 1.82461e-16)
(718.94 193.14 -1.63159e-16)
(718.403 193.362 1.49473e-16)
(717.126 193.281 0)
(715.253 193.248 1.67563e-16)
(712.93 192.69 1.71479e-16)
(710.783 191.534 -1.80781e-16)
(709.812 190.63 1.88634e-16)
(709.446 189.848 1.97312e-16)
(709.507 189.247 2.32377e-25)
(709.694 189.168 2.54896e-25)
(709.941 189.202 1.71757e-16)
(710.26 189.488 -3.47426e-16)
(710.689 189.811 -1.78694e-16)
(711.04 190.278 -1.89592e-16)
(711.025 191.047 -2.41701e-25)
(710.971 191.052 -1.68986e-16)
(710.828 191.451 -1.77563e-16)
(710.652 191.637 0)
(710.282 191.618 -1.74199e-16)
(709.884 191.429 -1.83218e-16)
(709.501 191.165 0)
(709.268 190.651 -1.71365e-16)
(709.359 190.548 3.25668e-25)
(709.663 190.506 -1.72193e-16)
(710.185 190.531 -1.80626e-16)
(710.887 190.735 0)
(711.613 190.861 1.91464e-16)
(712.24 191.024 -2.04164e-25)
(712.471 191.172 1.8159e-16)
(712.408 191.179 -1.68194e-16)
(712.23 191.164 1.81473e-16)
(711.953 191.117 1.91283e-16)
(711.694 191.049 -1.99376e-16)
(711.506 190.985 0)
(711.313 190.971 -1.94897e-16)
(711.038 190.923 -1.91817e-16)
(710.651 190.81 -3.64684e-25)
(710.153 190.692 1.95946e-16)
(709.508 190.585 -1.98236e-16)
(708.868 190.204 0)
(708.83 189.937 0)
(708.96 189.917 0)
(709.378 189.894 0)
(710.12 189.982 0)
(710.987 190.171 2.05889e-16)
(711.764 190.311 2.10354e-16)
(712.427 190.393 4.20685e-16)
(713.045 190.539 0)
(713.393 190.873 0)
(713.38 190.973 -2.09445e-16)
(713.213 190.962 -1.86463e-16)
(712.864 190.895 2.04292e-16)
(712.469 190.783 0)
(712.141 190.758 2.22299e-16)
(711.855 190.969 2.15583e-16)
(711.544 190.748 0)
(711.334 191.189 -2.10117e-16)
(711.476 191.37 0)
(848.29 4.41211 9.86934e-17)
(840.55 24.067 0)
(817.322 57.5038 0)
(798.011 100.334 0)
(719.472 278.273 -1.24676e-16)
(738.621 135.937 -1.25386e-16)
(681.742 297.709 1.47398e-16)
(676.737 284.29 0)
(693.698 222.014 -1.85162e-16)
(692.831 220.937 0)
(700.964 191.17 0)
(702.477 185.682 1.34025e-16)
(705.864 183.612 -1.47357e-16)
(709.782 186.982 1.68837e-16)
(711.443 187.5 0)
(711.806 187.237 0)
(712.167 187.99 0)
(711.825 191.817 0)
(711.111 193.025 -1.47009e-16)
(709.914 193.29 0)
(708.396 193.421 0)
(707.736 191.711 0)
(707.988 190.737 1.73251e-16)
(708.389 190.582 0)
(709.481 190.146 1.70243e-16)
(710.374 189.209 1.96012e-16)
(710.424 189.202 1.73943e-16)
(710.275 189.264 1.53573e-16)
(709.876 189.523 1.6958e-16)
(709.445 190.001 1.76607e-16)
(709.13 189.967 0)
(708.739 190.671 1.65453e-16)
(708.727 190.827 0)
(708.76 191.151 1.64976e-16)
(708.961 191.42 0)
(709.184 191.439 1.66703e-16)
(709.183 191.324 0)
(709.169 191.013 0)
(709.131 190.591 1.64391e-16)
(709.163 190.555 -1.59176e-16)
(709.268 190.541 1.68725e-16)
(709.488 190.564 -1.92025e-19)
(709.835 190.734 0)
(710.24 190.791 0)
(710.283 190.883 1.83608e-16)
(710.183 190.853 -1.6492e-16)
(709.927 190.765 1.77262e-16)
(709.516 190.627 0)
(708.99 190.512 0)
(708.603 190.353 1.98519e-16)
(708.373 190.148 2.01609e-16)
(708.204 190.102 1.98272e-16)
(708.047 190.043 0)
(707.852 189.928 1.90434e-16)
(707.581 189.884 0)
(707.353 189.787 -2.15304e-19)
(707.388 189.732 0)
(707.601 189.65 0)
(708.023 189.602 0)
(708.564 189.635 -1.96561e-16)
(709.256 189.793 0)
(709.974 190.002 2.06702e-16)
(710.533 189.978 -2.12119e-16)
(710.923 189.991 -3.80334e-16)
(710.917 189.999 -1.72636e-16)
(710.818 190.038 -1.82446e-16)
(710.633 189.988 1.9496e-16)
(710.306 189.812 -4.22413e-19)
(709.925 189.603 -2.14254e-16)
(709.642 189.577 -2.25876e-16)
(709.386 190.055 -2.01036e-16)
(709.337 190.293 -1.84474e-16)
(709.367 190.561 1.94428e-16)
(709.484 191.158 4.1735e-19)
(710.133 191.827 0)
(851.752 0.119871 -9.71165e-17)
(851.42 0.469443 0)
(849.981 2.22651 0)
(846.005 10.4934 -1.01089e-16)
(829.954 18.1656 -1.32962e-16)
(802.376 94.4317 2.46992e-16)
(749.835 97.3072 -1.62741e-16)
(690.83 175.943 0)
(694.429 177.953 0)
(700.576 195.971 0)
(701.03 202.944 0)
(702.929 198.809 0)
(708.163 193.394 0)
(711.335 185.351 0)
(710.338 183.479 1.60644e-16)
(709.701 183.455 0)
(710.842 184.244 0)
(709.802 190.629 0)
(708.721 191.565 3.64713e-19)
(707.41 190.998 1.83046e-16)
(707.666 189.827 -1.71211e-16)
(708.075 189.922 1.55477e-16)
(708.596 189.981 -4.66314e-19)
(709.163 189.441 1.76506e-16)
(709.76 188.607 -3.40617e-16)
(710.614 188.032 1.66852e-16)
(711.534 188.493 0)
(711.49 190.164 -3.34043e-16)
(711.279 190.418 1.5411e-16)
(710.756 190.833 1.68237e-16)
(710.203 191.042 1.75787e-16)
(709.601 191.192 0)
(709.091 191.726 0)
(708.691 192.126 1.90879e-16)
(708.657 191.839 0)
(708.68 191.674 1.79643e-16)
(708.441 191.386 0)
(708.468 190.502 0)
(708.666 190.374 1.61859e-16)
(709.047 190.458 -1.74997e-16)
(709.55 190.678 0)
(710.197 190.986 1.577e-19)
(710.858 191.67 0)
(711.063 192.081 0)
(710.956 192.118 1.62516e-16)
(710.554 191.979 1.74932e-16)
(709.969 191.569 -1.85001e-16)
(709.269 191.105 1.90621e-16)
(708.563 190.804 0)
(708.079 190.399 0)
(708.038 190.043 -1.87528e-16)
(708.105 190.013 0)
(708.224 190.022 1.90197e-16)
(708.37 189.841 2.05904e-16)
(708.429 189.779 1.85852e-16)
(708.403 189.778 3.42652e-16)
(708.322 189.609 0)
(708.371 189.519 0)
(708.637 189.425 0)
(709.207 189.501 1.91598e-16)
(709.938 189.62 1.99192e-16)
(710.698 189.948 -4.22655e-16)
(711.043 189.968 0)
(710.998 189.922 1.7764e-16)
(710.814 189.764 1.92019e-16)
(710.541 189.515 -4.62629e-19)
(710.147 189.19 0)
(709.626 188.953 2.09997e-16)
(709.078 189.087 4.38586e-16)
(708.753 189.248 2.3686e-16)
(708.517 189.973 2.09091e-16)
(708.552 190.368 0)
(708.803 190.935 -7.23674e-19)
(709.179 192.021 2.08111e-16)
(710.027 192.714 0)
(851.837 0.00517104 9.66219e-17)
(851.828 0.0125383 0)
(851.789 0.0747345 1.01496e-16)
(851.626 0.177783 2.02826e-16)
(850.738 2.03514 -1.01066e-16)
(847.051 5.58635 -7.63099e-18)
(829.216 37.7848 -9.62649e-17)
(773.475 123.794 9.47364e-17)
(740.78 136.49 0)
(693.526 256.846 0)
(682.601 256.629 1.67227e-16)
(691.718 213.086 0)
(697.136 200.982 0)
(701.04 188.457 0)
(702.102 185.641 -1.58366e-16)
(704.899 188.25 0)
(707.537 188.989 0)
(706.611 191.884 0)
(706.445 191.224 1.58812e-16)
(706.42 188.752 -1.52706e-16)
(706.501 188.707 1.48304e-16)
(706.773 189.386 -1.48506e-16)
(706.69 189.433 -1.48627e-16)
(706.39 188.998 -1.6175e-16)
(706.239 187.83 1.58827e-16)
(706.433 187.527 -1.56634e-16)
(706.456 188.287 0)
(706.255 188.872 1.50451e-16)
(705.945 189.06 -1.60127e-16)
(705.193 189.895 -1.58314e-16)
(705.26 190.407 -1.55485e-16)
(705.883 191.375 -1.6916e-16)
(706.765 192.022 0)
(707.058 191.754 -1.75538e-16)
(706.798 191.41 0)
(705.676 192.102 -1.75085e-16)
(704.887 191.687 -1.91927e-16)
(704.844 190.466 0)
(705.055 190.248 3.31972e-19)
(705.534 189.856 1.77641e-16)
(706.014 189.765 0)
(706.634 189.981 3.60816e-16)
(707.576 190.589 -1.85723e-16)
(708.337 191.259 0)
(708.701 191.465 2.1084e-19)
(708.559 191.525 -1.66227e-16)
(708.225 191.4 1.78603e-16)
(707.672 191.093 -1.85945e-16)
(706.96 190.78 0)
(706.368 190.325 2.03428e-16)
(706.154 189.837 0)
(706.178 189.77 0)
(706.342 189.772 -1.77665e-16)
(706.675 189.527 -4.26614e-16)
(706.711 189.425 9.51495e-20)
(706.723 189.303 -1.66786e-16)
(706.778 189.265 0)
(706.898 189.338 0)
(707.182 189.392 0)
(707.649 189.558 -1.93373e-16)
(708.402 189.871 -1.9688e-16)
(709.432 190.089 1.46676e-19)
(710.073 189.7 0)
(710.011 189.569 -1.77059e-16)
(709.582 189.273 0)
(708.696 189.026 4.02429e-16)
(707.708 188.466 0)
(706.872 188.326 -2.24733e-16)
(706.429 188.783 -5.37694e-20)
(706.455 188.958 -1.84987e-16)
(706.62 189.389 -1.95774e-16)
(707.131 190.098 0)
(707.665 190.844 -4.31519e-16)
(708.085 192.138 2.137e-16)
(708.99 192.462 -1.95859e-16)
(851.84 0.000236535 -9.72825e-17)
(851.84 0.000643943 1.01554e-16)
(851.839 0.00127056 -1.01656e-16)
(851.834 0.00944395 -1.01414e-16)
(851.811 0.017401 1.0104e-16)
(851.678 0.254877 -2.01145e-16)
(850.755 0.753297 1.01843e-16)
(844.774 12.0706 -2.10034e-16)
(818.645 51.8273 0)
(762.186 96.2927 0)
(730.519 157.186 -1.85942e-16)
(713.741 188.91 0)
(701.42 181.982 0)
(692.394 186.873 0)
(695.853 185.513 -1.48134e-16)
(699.972 192.229 -1.65271e-16)
(704.331 194.623 0)
(707.286 188.117 -1.88204e-16)
(708.572 185.949 0)
(709.378 186.455 -1.67403e-16)
(710.057 188.55 0)
(709.586 191.109 -1.67433e-16)
(708.986 191.099 -1.53458e-16)
(708.095 190.224 -1.68354e-16)
(707.221 188.695 0)
(707.133 188.926 0)
(706.893 189.589 0)
(706.306 190.022 0)
(705.037 190.778 0)
(704.205 189.91 1.63055e-16)
(704.353 189.468 0)
(704.995 189.213 1.60869e-16)
(705.905 189.854 0)
(706.26 191.593 0)
(706.077 191.981 -1.55739e-16)
(705.809 191.1 0)
(705.804 189.525 4.49018e-20)
(705.78 188.526 1.71209e-16)
(705.802 188.46 -1.56547e-16)
(705.766 188.835 0)
(705.679 189.089 0)
(705.804 189.118 -1.6861e-16)
(705.754 190.062 1.21956e-19)
(705.813 190.561 -1.89741e-16)
(705.911 191.11 -3.73285e-16)
(706.258 191.127 -2.07614e-16)
(706.302 191.006 -1.92619e-16)
(706.258 190.809 -1.70285e-16)
(706.129 190.467 -1.86141e-16)
(706.031 189.887 -3.96087e-16)
(705.96 189.519 -2.0986e-16)
(705.99 189.179 -2.09935e-16)
(706 188.977 -1.9657e-16)
(705.959 188.887 -9.01432e-21)
(705.801 188.871 -3.77779e-16)
(705.611 188.851 -2.07966e-16)
(705.554 188.827 -1.91319e-16)
(705.606 188.841 -1.74573e-16)
(705.827 188.804 -1.84727e-16)
(706.304 188.916 1.92222e-16)
(707.152 188.545 -1.98379e-16)
(708.174 188.439 2.05516e-16)
(708.785 188.972 0)
(708.749 189.012 1.74605e-16)
(708.376 188.979 0)
(707.663 188.72 -2.01319e-16)
(706.844 188.469 2.13498e-16)
(706.204 188.587 2.36155e-16)
(706.105 188.746 -2.09167e-16)
(706.202 189.006 1.87473e-16)
(706.57 189.126 0)
(706.712 190.811 2.07729e-16)
(707.394 191.21 2.18079e-16)
(707.568 192.427 -2.22644e-16)
(708.094 192.211 1.99173e-16)
(851.84 1.11905e-05 0)
(851.84 1.80585e-05 -1.03235e-16)
(851.84 7.40213e-05 0)
(851.84 0.000126932 0)
(851.839 0.00134438 0)
(851.835 0.00273098 1.00591e-16)
(851.809 0.041505 0)
(851.613 0.21085 1.00759e-16)
(850.148 2.0065 0)
(838.914 21.1869 0)
(808.314 69.3136 0)
(763.835 146.342 0)
(726.335 156.971 0)
(695.078 230.552 1.74653e-16)
(694.498 221.205 6.22321e-18)
(695.626 207.123 -8.5843e-18)
(699.153 199.21 1.5551e-16)
(702.24 191.777 -4.56536e-18)
(704.403 192.137 -1.64655e-16)
(707.344 190.845 3.12807e-16)
(706.707 190.629 -1.59372e-16)
(706.289 190.588 5.6167e-19)
(706.023 190.053 3.18197e-16)
(706.161 189.843 7.11388e-19)
(707.076 189.151 0)
(707.938 191.28 -1.85881e-16)
(707.697 192.482 0)
(707.174 192.631 1.55502e-16)
(706.138 192.248 -1.69736e-16)
(705.162 191.396 -3.60887e-16)
(704.518 190.532 0)
(704.315 190.189 0)
(704.135 190.611 0)
(704.159 190.977 0)
(704.322 191.29 1.73536e-16)
(704.828 190.859 0)
(705.38 189.976 1.90834e-16)
(705.828 189.112 -1.94701e-16)
(706.013 188.858 0)
(706.019 189.567 0)
(705.992 189.595 0)
(705.816 189.677 0)
(705.332 190.997 1.73611e-16)
(705.333 191.302 1.71781e-16)
(705.45 191.179 1.85945e-16)
(705.556 191.347 1.80658e-16)
(706.038 190.842 0)
(705.984 190.669 1.74368e-16)
(705.984 190.247 2.12083e-16)
(706.248 189.26 2.14787e-16)
(706.266 189.189 1.79279e-16)
(706.361 189.047 1.79139e-16)
(706.469 188.88 1.78549e-16)
(706.452 188.842 1.69481e-16)
(706.309 188.861 1.83059e-16)
(706.094 188.945 1.95313e-16)
(705.889 188.921 2.19321e-16)
(705.878 188.929 2.00029e-16)
(705.96 188.915 1.73873e-16)
(706.322 189.037 0)
(706.91 188.279 4.18531e-16)
(707.179 188.218 0)
(707.116 188.234 -1.80175e-16)
(706.985 188.061 -1.93624e-16)
(706.733 187.924 0)
(706.284 187.98 0)
(706.133 188.433 -2.07934e-16)
(706.163 188.6 0)
(706.295 189.075 0)
(706.509 190.127 -2.03797e-16)
(706.795 191.362 0)
(707.194 192.025 -7.11859e-19)
(707.877 191.9 0)
(707.84 192.375 0)
(707.792 192.073 -1.82313e-16)
(851.84 3.08017e-07 0)
(851.84 8.91507e-07 0)
(851.84 1.48799e-06 0)
(851.84 8.8379e-06 0)
(851.84 1.58577e-05 0)
(851.84 0.000207847 0)
(851.839 0.000674319 0)
(851.834 0.00705478 0)
(851.791 0.0473168 0)
(851.409 0.414769 0)
(849.011 4.25655 0)
(836.196 27.0083 0)
(803.521 62.7831 0)
(753.554 152.529 -1.8141e-16)
(723.766 156.756 3.99864e-17)
(703.664 167.756 1.5967e-16)
(701.385 177.791 -1.44288e-16)
(704.256 184.124 1.58813e-16)
(706.424 197.606 1.59769e-16)
(706.431 197.045 -1.49373e-16)
(706.705 193.731 1.5507e-16)
(705.394 191.511 -3.56727e-19)
(705.678 189.007 -1.68222e-16)
(706.092 189.149 1.5043e-16)
(707.993 190.434 -1.65421e-16)
(709.036 192.548 7.31233e-19)
(708.792 192.604 0)
(707.533 192.529 -3.23096e-16)
(705.297 192.416 3.43873e-20)
(703.677 190.96 6.05958e-20)
(703.727 189.857 0)
(704.046 189.704 0)
(704.678 189.478 0)
(705.08 190.104 0)
(705.452 190.346 1.84336e-16)
(705.949 190.08 0)
(706.426 189.663 -1.90698e-16)
(706.811 188.921 -1.98126e-16)
(706.97 188.633 0)
(707.098 189.228 -1.61681e-16)
(706.918 189.651 0)
(706.34 190.046 0)
(705.635 191.331 0)
(705.674 191.399 -1.63153e-16)
(705.815 191.852 0)
(706.364 190.874 0)
(706.683 191.487 0)
(707.396 190.224 0)
(707.446 190.001 -1.66361e-16)
(707.493 189.611 0)
(707.485 189.318 -1.93203e-16)
(707.489 189.051 0)
(707.42 188.951 -1.88141e-16)
(707.227 189.006 -1.89592e-16)
(706.958 189.157 0)
(706.71 189.339 -2.01224e-16)
(706.512 189.3 0)
(706.439 189.164 1.88748e-16)
(706.477 189.166 0)
(706.719 188.774 0)
(707.189 188.226 -3.58659e-16)
(707.189 187.935 0)
(707.03 187.885 3.8863e-16)
(706.855 187.496 2.06445e-16)
(706.608 187.697 0)
(706.55 187.944 0)
(706.497 188.432 1.85018e-16)
(706.604 189.102 0)
(707.085 189.836 0)
(707.558 190.864 2.15744e-16)
(707.962 191.436 0)
(708.046 192.346 -2.27331e-16)
(708.299 192.006 0)
(708.221 191.953 0)
(707.914 191.462 1.87284e-16)
(851.84 1.02886e-08 0)
(851.84 1.93254e-08 0)
(851.84 7.9757e-08 0)
(851.84 1.52079e-07 0)
(851.84 1.0875e-06 0)
(851.84 3.38172e-06 0)
(851.84 2.98269e-05 0)
(851.84 0.000180767 0)
(851.839 0.00126512 0)
(851.829 0.0113215 0)
(851.765 0.0753416 0)
(851.234 0.680659 0)
(847.981 5.88789 0)
(829.474 32.0319 0)
(789.111 117.337 1.68731e-16)
(758.56 100.172 0)
(718.725 224.059 0)
(695.385 228.096 0)
(699.383 222.413 0)
(698.441 211.884 0)
(703.562 191.558 0)
(704.155 186.042 1.52824e-16)
(704.871 188.561 0)
(705.878 189.521 0)
(707.287 190.355 1.76421e-16)
(707.742 192.37 1.63324e-16)
(707.396 192.74 0)
(706.299 193.154 1.62165e-16)
(704.544 193.429 1.73479e-16)
(703.38 191.763 1.86073e-16)
(703.081 190.064 0)
(703.191 189.508 0)
(703.4 189.328 0)
(703.639 189.733 0)
(704.018 189.944 -1.79631e-16)
(704.569 189.658 0)
(705.269 189.042 1.80757e-16)
(706.091 188.464 1.80715e-16)
(707.039 188.019 0)
(707.958 188.955 1.90872e-16)
(708.099 190.348 0)
(707.848 190.785 0)
(707.419 191.537 0)
(707.391 191.716 1.60649e-16)
(707.373 192.334 0)
(707.765 191.168 0)
(707.785 190.807 0)
(707.993 190.275 0)
(708.005 189.86 1.68763e-16)
(707.831 189.377 0)
(707.524 189.001 1.93811e-16)
(707.275 188.75 0)
(707.189 188.643 2.09316e-16)
(707.011 188.982 2.15736e-16)
(706.935 189.216 0)
(706.977 189.302 1.74525e-16)
(707.097 189.472 0)
(707.245 189.403 -4.00367e-16)
(707.45 189.372 0)
(707.791 188.6 0)
(707.833 188.236 1.75833e-16)
(707.695 187.878 0)
(707.42 187.883 -2.04835e-16)
(707.276 187.469 -2.11299e-16)
(706.946 188.039 0)
(706.859 188.437 0)
(706.933 188.963 -1.85675e-16)
(707.342 189.862 0)
(707.525 191.33 0)
(707.58 192.495 0)
(707.843 192.684 -2.30861e-16)
(708.055 192.122 0)
(708.095 191.924 0)
(707.94 191.646 0)
(707.564 190.662 -1.8978e-16)
(851.84 2.08377e-10 0)
(851.84 7.76033e-10 0)
(851.84 1.63489e-09 0)
(851.84 7.76409e-09 -1.02646e-16)
(851.84 2.06596e-08 0)
(851.84 1.44573e-07 0)
(851.84 6.99319e-07 0)
(851.84 5.16445e-06 1.00738e-16)
(851.84 4.09682e-05 0)
(851.84 0.00025102 0)
(851.838 0.00218951 0)
(851.824 0.0135495 0)
(851.719 0.141997 0)
(850.823 0.947051 1.02514e-16)
(845.234 13.7718 0)
(832.429 19.2637 -1.0138e-16)
(769.155 193.57 0)
(748.806 21.7627 0)
(716.833 192.385 0)
(706.212 175.253 0)
(702.916 186.101 -1.73131e-16)
(705.397 190.054 0)
(709.415 195.395 0)
(708.929 193.658 0)
(707.991 188.801 0)
(708.392 187.556 0)
(707.93 190.064 -1.54452e-16)
(706.802 191.709 0)
(705.853 191.725 0)
(705.669 190.295 0)
(705.355 190.625 -2.04387e-16)
(705.51 189.972 -1.75647e-16)
(705.862 189.893 -1.62035e-16)
(706.07 190.588 0)
(706.034 190.715 1.52672e-16)
(706.006 190.405 0)
(706.192 189.129 1.64435e-16)
(706.47 188.436 -1.57486e-16)
(707.26 187.724 0)
(707.915 188.294 1.86495e-16)
(707.886 190.313 0)
(707.599 190.53 0)
(707.433 190.943 0)
(707.56 191.074 1.66679e-16)
(707.707 191.703 0)
(708.405 191.388 2.00538e-16)
(708.646 190.73 0)
(708.717 190.407 0)
(708.724 189.922 1.71352e-16)
(708.547 189.239 0)
(708.09 188.774 0)
(707.596 188.26 0)
(706.965 188.273 -2.05779e-16)
(706.571 188.894 1.87108e-16)
(706.577 188.971 0)
(706.771 189.017 1.79059e-16)
(707.061 189.452 0)
(707.357 189.317 4.0524e-16)
(707.804 189.031 0)
(708.192 188.198 -1.91378e-16)
(708.17 187.987 1.80203e-16)
(708.095 187.635 -2.02088e-16)
(707.874 188.035 1.91019e-16)
(707.947 187.783 1.7298e-16)
(707.645 188.314 -1.74489e-16)
(707.566 188.878 0)
(707.905 189.288 1.91148e-16)
(708.394 190.376 0)
(708.219 191.08 0)
(707.975 191.468 0)
(707.598 191.62 2.0805e-16)
(707.371 191.685 -2.16919e-16)
(707.181 191.413 0)
(706.876 190.674 0)
(706.506 189.699 1.96607e-16)
(851.84 4.41239e-12 0)
(851.84 1.39442e-11 0)
(851.84 6.35622e-11 0)
(851.84 1.65824e-10 1.02859e-16)
(851.84 8.34553e-10 0)
(851.84 3.18597e-09 0)
(851.84 2.28085e-08 0)
(851.84 1.37471e-07 -1.00876e-16)
(851.84 1.08003e-06 0)
(851.84 7.13712e-06 0)
(851.84 6.02908e-05 1.01725e-16)
(851.84 0.000396878 0)
(851.837 0.00369427 0)
(851.815 0.0226524 -1.02734e-16)
(851.628 0.260515 1.04194e-16)
(850.792 1.33814 1.05091e-16)
(836.119 19.3042 1.08953e-16)
(827.282 44.156 1.06791e-16)
(754.268 237.039 0)
(744.601 25.379 -1.12223e-16)
(705.752 209.897 3.36697e-16)
(703.262 229.266 1.39174e-16)
(697.451 229.567 1.57618e-16)
(700.172 197.103 -1.60775e-16)
(704.254 190.197 1.54781e-16)
(710.16 189.709 1.71543e-16)
(712.402 194.787 1.62406e-16)
(711.7 195.549 1.52062e-16)
(709.258 196.775 0)
(706.861 195.801 1.76921e-16)
(705.234 192.29 1.8856e-16)
(705.004 189.801 1.70073e-16)
(705.156 189.726 1.56766e-16)
(705.26 190.722 0)
(705.209 191.01 -1.78991e-16)
(705.328 190.325 0)
(705.842 189.518 -1.60395e-16)
(706.805 188.655 1.73693e-16)
(708.212 187.754 -1.82365e-16)
(708.819 189.083 -2.04149e-16)
(708.502 190.501 0)
(708.322 190.492 1.67349e-16)
(708.093 190.502 0)
(707.932 190.753 -1.77704e-16)
(707.932 190.888 0)
(708.153 190.955 -1.81198e-16)
(708.432 190.427 0)
(708.374 190.249 0)
(708.431 189.689 -3.76397e-16)
(708.369 189.264 0)
(708.088 189.061 0)
(707.67 188.592 0)
(707.198 188.279 2.06331e-16)
(706.899 188.751 -1.88298e-16)
(706.908 188.861 1.69709e-16)
(707.073 189 -1.81119e-16)
(707.316 189.582 0)
(707.876 188.933 -1.83986e-16)
(707.943 188.628 1.73087e-16)
(707.964 188.193 1.80742e-16)
(707.789 187.752 -2.01046e-16)
(707.703 187.542 1.93435e-16)
(707.716 187.687 -1.78411e-16)
(707.829 187.94 0)
(707.83 188.939 4.06072e-16)
(707.906 189.95 0)
(708.426 190.549 -2.11048e-16)
(708.319 192.216 0)
(708.199 192.388 -1.8194e-16)
(707.962 192.396 0)
(707.725 191.919 0)
(707.28 191.359 -4.77939e-19)
(706.461 190.574 0)
(705.948 188.836 0)
(706.018 188.758 0)
(851.84 -6.09023e-16 0)
(851.84 2.15985e-13 0)
(851.84 1.23506e-12 0)
(851.84 5.6278e-12 -5.12072e-17)
(851.84 1.9741e-11 0)
(851.84 1.03933e-10 -5.07004e-17)
(851.84 5.60533e-10 5.04211e-17)
(851.84 4.17639e-09 0)
(851.84 2.58303e-08 -5.05748e-17)
(851.84 2.38347e-07 0)
(851.84 1.30992e-06 -1.01759e-16)
(851.84 1.54919e-05 0)
(851.84 6.46558e-05 -5.12803e-17)
(851.839 0.000954559 0)
(851.835 0.00322486 -1.54663e-16)
(851.795 0.0598018 0)
(851.243 0.337651 -1.60178e-16)
(849.827 5.06688 -1.62983e-16)
(832.543 -2.96018 5.34784e-17)
(818.715 67.3563 1.54306e-16)
(765.158 140.518 -2.45418e-16)
(727.978 169.025 -2.51666e-16)
(701.164 175.749 -2.85284e-16)
(702.177 170.584 8.76319e-17)
(707.082 178.243 -2.44473e-16)
(710.329 184.745 -2.70977e-16)
(711.091 195.245 0)
(710.506 196.765 -2.29386e-16)
(709.264 197.338 -8.33736e-17)
(708.318 195.296 -2.579e-16)
(706.883 192.051 0)
(706.911 190.142 0)
(707.606 190.113 0)
(707.393 192.074 0)
(706.799 192.474 0)
(706.224 190.42 0)
(706.484 189.567 0)
(707.482 188.536 0)
(708.857 187.522 1.90852e-16)
(708.696 189.472 0)
(708.622 189.33 0)
(708.467 189.02 -1.75667e-16)
(708.087 189.075 0)
(707.733 190.237 -9.1795e-17)
(707.732 190.445 0)
(707.796 190.401 0)
(707.867 190.644 0)
(708.234 189.524 0)
(708.25 189.282 1.71647e-16)
(708.276 188.84 0)
(708.195 188.58 0)
(708.023 188.515 0)
(707.737 188.407 0)
(707.446 188.866 0)
(707.435 189.027 -1.72167e-16)
(707.507 189.189 0)
(707.639 189.303 0)
(708.069 188.632 0)
(708.087 188.32 -1.73078e-16)
(707.852 187.888 0)
(707.594 187.174 -9.24194e-17)
(707.665 187.144 0)
(707.848 187.38 9.51986e-17)
(708.028 188.026 0)
(707.976 189.699 -2.01097e-16)
(708.678 190.04 0)
(709.229 191.541 1.14642e-16)
(708.938 192.778 0)
(708.842 192.792 1.81659e-16)
(708.311 193.002 -1.00338e-16)
(708.336 191.379 0)
(707.733 190.565 3.05406e-16)
(706.783 189.631 0)
(706.687 188.439 0)
(706.715 188.486 0)
(851.84 -3.55617e-13 0)
(851.84 -3.76286e-14 4.70002e-17)
(851.84 -4.1743e-14 5.00391e-17)
(851.84 1.13783e-13 1.01883e-16)
(851.84 -2.12363e-13 0)
(851.84 2.76846e-12 5.30453e-17)
(851.84 1.71623e-11 -5.05596e-17)
(851.84 9.92092e-11 0)
(851.84 9.28431e-10 5.05886e-17)
(851.84 4.32577e-09 -5.07329e-17)
(851.84 6.40839e-08 0)
(851.84 1.68682e-07 0)
(851.84 4.31511e-06 5.13266e-17)
(851.84 5.63889e-06 0)
(851.84 0.00027505 5.13495e-17)
(851.838 0.000252461 -5.16477e-17)
(851.829 0.0208883 1.17658e-20)
(851.758 0.0325778 5.23418e-17)
(851.193 1.04641 -5.39574e-17)
(849.262 4.94911 0)
(837.017 14.4294 6.30745e-17)
(794.195 105.218 1.34705e-16)
(746.779 146.618 1.11899e-16)
(735.254 158.526 1.02123e-16)
(693.647 252.9 8.60325e-17)
(696.95 209.236 7.93081e-17)
(699.688 202.519 0)
(706.81 202.044 1.70389e-16)
(709.126 200.293 8.41372e-17)
(707.982 198.899 7.86531e-17)
(706.968 192.045 0)
(708.044 187.532 0)
(708.587 189.221 -8.77553e-17)
(707.795 192.774 0)
(706.85 193.316 0)
(706.311 190.076 0)
(706.919 188.443 0)
(708.45 187.765 -8.70045e-17)
(709.403 187.377 0)
(708.991 187.419 0)
(708.913 187.991 0)
(708.848 188.761 -8.24748e-17)
(708.629 189.158 0)
(708.24 189.945 -4.04333e-20)
(707.875 190.595 0)
(707.514 190.754 0)
(707.283 190.398 0)
(707.486 190.114 0)
(707.758 189.539 9.65225e-17)
(707.996 189.165 0)
(708.232 188.968 0)
(708.25 188.889 0)
(708.215 189.047 0)
(708.313 189.265 -9.36769e-17)
(708.306 189.558 0)
(708.226 189.386 0)
(708.238 189.236 0)
(708.509 188.477 0)
(708.398 188.05 0)
(707.783 187.366 0)
(707.545 186.756 9.55972e-17)
(707.607 186.976 0)
(707.841 187.386 -9.634e-17)
(708.042 188.319 0)
(708.294 189.606 1.00079e-16)
(708.981 190.459 0)
(709.259 191.957 -1.15008e-16)
(709.184 192.581 0)
(709.105 192.564 0)
(709.126 191.564 1.93875e-16)
(708.567 191.206 0)
(707.523 191.884 -1.12688e-16)
(707.87 189.831 0)
(708.113 188.984 0)
(708.03 188.796 0)
(851.84 -2.28416e-13 0)
(851.84 -1.44409e-14 -5.17895e-17)
(851.84 -2.55966e-13 -4.78636e-17)
(851.84 -3.89318e-13 -5.68809e-17)
(851.84 3.44345e-13 0)
(851.84 5.85395e-13 0)
(851.84 6.89534e-13 0)
(851.84 3.68975e-12 5.01799e-17)
(851.84 1.69906e-11 0)
(851.84 2.30505e-10 5.07522e-17)
(851.84 6.52415e-10 0)
(851.84 1.57873e-08 5.11415e-17)
(851.84 2.01224e-08 5.13084e-17)
(851.84 1.02404e-06 0)
(851.84 8.13582e-07 0)
(851.84 7.0986e-05 5.18377e-17)
(851.84 0.000113997 5.21319e-17)
(851.838 0.00306395 0)
(851.825 0.014867 0)
(851.742 0.0958093 0)
(851.18 0.759209 0)
(844.447 12.7315 -5.96994e-17)
(831.923 22.966 5.32525e-17)
(786.242 165.478 0)
(738.852 22.6574 0)
(703.766 152.038 0)
(706.619 165.564 0)
(719.586 180.065 -9.26815e-17)
(716.042 199.732 0)
(709.436 198.986 0)
(709.44 189.866 0)
(711.136 189.543 0)
(711.773 193.177 8.18066e-17)
(711.015 194.199 0)
(708.593 194.65 0)
(707.264 190.227 0)
(707.861 187.206 0)
(708.417 186.019 8.08751e-17)
(709.003 185.337 0)
(708.918 186.429 0)
(708.668 187.349 0)
(708.58 188.231 8.65553e-17)
(708.555 188.641 0)
(708.083 190.657 8.74441e-17)
(707.877 190.975 0)
(707.454 191.496 0)
(707.099 191.012 0)
(707.288 190.031 0)
(707.555 189.65 -8.5589e-17)
(708.048 188.925 0)
(708.332 188.967 0)
(708.509 189.062 0)
(708.678 189.082 0)
(708.989 189.388 9.86015e-17)
(709.069 189.73 9.31378e-17)
(708.929 189.815 0)
(709.026 188.941 9.06239e-17)
(709.257 188.107 0)
(709.066 187.62 0)
(707.975 187.108 9.9219e-17)
(707.729 186.094 0)
(707.822 186.298 0)
(707.8 187.171 9.95913e-17)
(707.751 188.346 0)
(708.018 189.195 -1.84969e-20)
(708.303 190.471 0)
(708.529 191.657 0)
(708.57 191.847 1.01971e-16)
(708.507 191.732 0)
(708.46 191.037 -9.87471e-17)
(708.004 191.179 1.07862e-16)
(708.292 189.464 0)
(708.543 189.398 9.97345e-17)
(708.837 188.865 0)
(708.83 188.819 0)
(851.84 2.82468e-13 -4.94948e-17)
(851.84 3.04297e-13 0)
(851.84 1.6753e-13 0)
(851.84 8.91721e-14 0)
(851.84 5.17486e-13 -5.98499e-17)
(851.84 3.73558e-13 4.94034e-17)
(851.84 4.55072e-13 -4.94978e-17)
(851.84 4.60549e-13 -4.8056e-17)
(851.84 9.94337e-13 0)
(851.84 3.68686e-12 -5.09426e-17)
(851.84 5.17705e-11 0)
(851.84 1.41775e-10 -5.11593e-17)
(851.84 3.22602e-09 -5.12753e-17)
(851.84 7.77214e-09 -5.14161e-17)
(851.84 2.04122e-07 0)
(851.84 6.73934e-07 0)
(851.84 1.01339e-05 0)
(851.84 5.90503e-05 5.24595e-17)
(851.84 0.000407404 0)
(851.837 0.00305821 0)
(851.816 0.0302898 0)
(851.585 0.11454 0)
(850.646 3.00219 -5.47849e-17)
(841.867 -0.253749 0)
(822.898 68.1082 0)
(772.859 101.222 0)
(737.959 160.913 0)
(699.219 258.996 8.80547e-17)
(695.058 243.804 0)
(697.554 200.719 0)
(701.574 190.075 0)
(707.795 186.183 0)
(711.551 185.375 0)
(711.019 189.901 0)
(709.414 192.148 0)
(707.546 190.672 -8.9912e-17)
(707.339 185.83 0)
(707.993 184.318 -8.01393e-17)
(708.985 184.308 0)
(709.497 186.637 0)
(709.886 187.025 0)
(709.106 190.04 0)
(708.879 190.253 0)
(708.198 190.933 0)
(707.651 191.062 0)
(706.978 191.385 0)
(706.498 190.694 0)
(706.552 190.354 9.46226e-17)
(706.838 190.036 -8.40936e-17)
(707.335 190.137 -9.31001e-17)
(707.807 189.964 0)
(708.102 189.834 0)
(708.435 189.604 0)
(708.739 189.533 0)
(709.025 189.388 1.78285e-19)
(709.342 188.8 0)
(709.815 187.731 -1.81292e-16)
(709.894 187.315 0)
(709.524 187.225 0)
(708.624 186.686 -9.84652e-17)
(708.23 185.33 0)
(707.653 187.126 0)
(707.273 188.384 8.20537e-20)
(707.263 188.799 0)
(707.646 189.216 -9.64339e-17)
(707.884 190.547 -9.3897e-17)
(707.728 191.041 0)
(707.604 191.09 -9.6159e-17)
(707.397 191.097 0)
(707.27 190.356 0)
(707.39 190.219 -9.29192e-17)
(707.83 189.599 0)
(708.444 189.701 -2.17964e-16)
(708.809 188.904 0)
(709.07 188.923 0)
(851.84 5.25978e-13 1.65233e-31)
(851.84 3.75211e-13 -6.34027e-17)
(851.84 2.78594e-13 -5.0682e-17)
(851.84 3.90716e-13 -4.98188e-17)
(851.84 3.65004e-13 5.00012e-17)
(851.84 1.18314e-13 -4.77523e-17)
(851.84 -1.08429e-13 4.98218e-17)
(851.84 -2.86418e-13 0)
(851.84 -4.38378e-13 0)
(851.84 -4.20766e-13 5.25836e-17)
(851.84 6.24016e-13 0)
(851.84 9.78748e-12 0)
(851.84 4.35953e-11 0)
(851.84 6.05502e-10 1.02986e-16)
(851.84 3.11557e-09 5.16902e-17)
(851.84 3.43379e-08 5.19175e-17)
(851.84 2.23382e-07 0)
(851.84 1.75846e-06 -1.76379e-24)
(851.84 1.30084e-05 0)
(851.84 0.000102919 5.25876e-17)
(851.839 0.00065598 5.28665e-17)
(851.834 0.00811162 5.31745e-17)
(851.795 0.0316999 5.33051e-17)
(851.498 0.4542 0)
(849.52 3.69627 5.45357e-17)
(842.533 8.9744 5.33915e-17)
(793.422 139.912 0)
(745.702 20.3789 -3.60009e-17)
(710.935 165.862 8.7272e-17)
(712.2 174.804 7.901e-17)
(716.365 178.784 0)
(718.083 180.727 0)
(717.377 181.488 0)
(715.339 191.172 0)
(713.402 195.433 0)
(709.27 194.436 8.50799e-17)
(706.955 186.544 0)
(707.7 183.56 9.17917e-17)
(708.345 184.595 0)
(708.346 188.434 0)
(708.234 190.833 0)
(708.542 191.387 -8.49294e-17)
(708.505 191.206 0)
(708.274 191.053 0)
(707.797 190.717 0)
(706.878 191.441 9.9727e-17)
(706.894 190.565 0)
(706.977 190.51 -8.3321e-17)
(707.216 190.215 8.723e-17)
(707.69 190.375 9.05792e-17)
(708.365 189.979 0)
(708.393 189.676 0)
(708.548 189.179 0)
(708.921 188.842 0)
(709.369 188.73 -9.62313e-17)
(710.016 187.901 0)
(710.419 187.067 9.43487e-17)
(710.229 186.954 0)
(709.617 187.024 9.61344e-17)
(709.056 186.615 0)
(708.72 185.935 0)
(707.923 187.138 0)
(707.422 188.675 -9.8956e-17)
(707.656 188.931 0)
(708.235 189.677 0)
(708.1 190.006 -6.22723e-20)
(707.605 190.433 0)
(707.237 190.757 0)
(706.869 190.73 0)
(706.726 190.138 0)
(706.846 190.238 0)
(707.473 189.482 0)
(708.126 189.595 1.06481e-16)
(708.868 188.754 0)
(709.236 189.101 0)
(851.84 -2.46993e-14 4.89742e-17)
(851.84 2.03498e-13 -2.38108e-32)
(851.84 3.58441e-13 -4.64355e-32)
(851.84 4.99236e-13 -9.7999e-32)
(851.84 2.37122e-13 0)
(851.84 2.92989e-14 0)
(851.84 -9.6188e-14 0)
(851.84 -2.74131e-13 0)
(851.84 -3.07864e-13 0)
(851.84 -2.71309e-13 0)
(851.84 2.25802e-13 0)
(851.84 5.26772e-13 0)
(851.84 2.17521e-12 0)
(851.84 1.4261e-11 -5.13481e-17)
(851.84 1.10977e-10 -5.16937e-17)
(851.84 8.72723e-10 -5.18995e-17)
(851.84 6.56018e-09 0)
(851.84 5.38539e-08 -5.24098e-17)
(851.84 3.71908e-07 0)
(851.84 3.16751e-06 -5.27032e-17)
(851.84 2.18336e-05 -5.29317e-17)
(851.84 0.00021474 -5.31304e-17)
(851.839 0.000816569 -5.32621e-17)
(851.829 0.0181435 0)
(851.755 0.0201559 -5.405e-17)
(851.302 1.11537 -5.39391e-17)
(843.224 2.56287 0)
(827.13 39.9882 -7.1931e-17)
(772.6 144.204 -1.15276e-16)
(737.22 186.495 -1.02908e-16)
(703.842 184.663 0)
(701.758 173.066 0)
(708.012 170.626 0)
(714.763 188.514 0)
(713.529 200.505 0)
(709.868 198.889 0)
(708.544 187.569 0)
(709.396 185.109 0)
(710.678 185.58 0)
(710.987 190.396 0)
(710.386 193.344 0)
(710.077 193.137 1.3357e-19)
(709.513 192.193 0)
(708.786 191.443 0)
(707.986 190.884 -9.31191e-17)
(706.872 190.855 -9.77808e-17)
(706.557 190.416 -8.93964e-17)
(706.642 190.465 0)
(707.075 190.229 0)
(707.607 190.368 -9.38879e-17)
(707.863 191.516 0)
(708.349 190.489 -1.05593e-16)
(708.691 189.664 0)
(709.161 189.504 0)
(709.927 189.501 -9.70928e-17)
(710.926 187.795 0)
(711.03 187.336 0)
(710.719 186.929 0)
(709.796 187.479 -1.96785e-16)
(709.366 186.899 1.03385e-16)
(708.916 186.476 0)
(708.027 188.537 -9.55889e-17)
(707.936 189.059 0)
(708.277 189.202 -1.00079e-16)
(708.118 190.371 9.8108e-17)
(707.991 190.542 -4.76519e-20)
(707.729 190.736 0)
(707.455 190.824 1.00061e-16)
(706.917 191.007 -1.03572e-16)
(706.851 190.098 9.8372e-17)
(706.953 190.065 -9.18934e-17)
(707.437 189.504 0)
(707.958 189.629 1.03393e-16)
(708.804 189.342 -1.07965e-16)
(709.27 189.631 0)
(851.84 3.90235e-13 -6.39131e-17)
(851.84 2.44356e-14 5.8053e-17)
(851.84 5.53881e-14 5.0107e-17)
(851.84 -4.24381e-15 6.1188e-17)
(851.84 -9.73307e-14 0)
(851.84 1.61446e-13 0)
(851.84 -1.21737e-13 0)
(851.84 -6.72541e-14 0)
(851.84 1.88328e-15 0)
(851.84 1.1425e-13 0)
(851.84 2.05256e-13 0)
(851.84 2.22223e-13 0)
(851.84 1.69759e-14 0)
(851.84 -3.4824e-13 -5.04741e-17)
(851.84 2.18214e-12 0)
(851.84 2.0465e-11 0)
(851.84 2.09553e-10 0)
(851.84 1.37543e-09 0)
(851.84 1.26732e-08 0)
(851.84 7.25556e-08 0)
(851.84 9.04983e-07 0)
(851.84 2.75786e-06 -5.30453e-17)
(851.84 7.30029e-05 0)
(851.84 0.000104942 0)
(851.837 0.00454123 0)
(851.812 0.0131882 0)
(851.544 0.351204 0)
(850.172 3.01467 0)
(840 12.6663 -5.39805e-17)
(811.118 79.2 0)
(774.532 110.733 0)
(728.5 152.273 0)
(704.005 231.412 9.5489e-17)
(708.56 212.358 0)
(706.373 212.481 0)
(704.343 205.171 0)
(705.1 187.276 -9.98002e-17)
(706.385 181.161 0)
(708.518 183.774 0)
(709.907 189.776 0)
(709.391 190.857 0)
(708.218 191.797 9.35757e-17)
(707.939 192.064 0)
(708.327 191.696 0)
(708.424 191.299 7.97587e-17)
(708.29 191.013 0)
(707.967 190.879 1.6796e-16)
(708.014 190.848 0)
(708.395 190.637 0)
(708.434 191.055 1.06414e-16)
(708.581 190.664 -1.04232e-16)
(708.751 190.148 8.99398e-17)
(708.915 189.513 0)
(709.189 189.265 -8.49983e-17)
(709.879 189.112 9.61743e-17)
(710.605 187.689 0)
(710.586 187.359 0)
(710.237 187.179 0)
(709.641 187.781 1.02349e-16)
(709.33 188.056 -1.00632e-16)
(708.76 188.336 0)
(707.826 189.753 1.85099e-16)
(707.932 189.977 0)
(708.042 190.631 9.18212e-17)
(707.871 190.813 -9.36294e-17)
(707.753 190.751 1.02985e-16)
(707.658 190.569 0)
(707.267 190.832 -9.87149e-17)
(706.9 190.37 1.86816e-16)
(706.958 190.188 -8.98593e-17)
(707.005 190.446 9.38803e-17)
(707.516 189.857 -9.93774e-17)
(707.824 190.763 -1.03828e-16)
(708.722 190.082 1.09765e-16)
(709.144 190.076 0)
(851.84 -2.38602e-13 5.30464e-17)
(851.84 -2.47915e-13 0)
(851.84 -1.06103e-13 5.34997e-17)
(851.84 -5.8419e-13 5.38417e-17)
(851.84 -7.10023e-13 0)
(851.84 -2.89616e-13 0)
(851.84 -1.90646e-13 0)
(851.84 -1.15172e-13 0)
(851.84 5.56232e-14 0)
(851.84 3.17061e-13 5.25584e-17)
(851.84 5.67904e-13 0)
(851.84 4.39815e-13 0)
(851.84 3.22528e-13 5.40493e-17)
(851.84 3.87392e-13 5.23114e-17)
(851.84 3.44522e-13 0)
(851.84 9.92825e-13 0)
(851.84 6.26645e-12 0)
(851.84 3.98354e-11 5.22608e-17)
(851.84 3.39403e-10 0)
(851.84 2.58672e-09 0)
(851.84 1.75761e-08 0)
(851.84 2.06986e-07 5.30199e-17)
(851.84 8.97252e-07 0)
(851.84 1.51766e-05 0)
(851.84 6.85424e-05 0)
(851.839 0.00105625 0)
(851.832 0.0102034 0)
(851.778 0.0464531 0)
(851.368 0.700347 1.09356e-16)
(848.082 5.8896 0)
(837.463 24.1344 0)
(793.591 116.1 5.32731e-17)
(749.262 98.6174 -9.44896e-17)
(712.368 157.925 -8.56907e-17)
(711.703 176.868 0)
(713.837 187.217 -8.10617e-17)
(712.406 183.988 8.6882e-17)
(713.126 178.98 0)
(714.237 186.086 0)
(712.34 192.655 -7.75177e-17)
(709.146 196.932 -8.37321e-17)
(706.58 195.932 -9.63421e-17)
(706.477 191.641 -1.0788e-16)
(706.816 190.269 0)
(707.118 189.752 0)
(707.352 189.639 0)
(707.299 190.149 -1.86191e-16)
(707.535 190.45 0)
(708.366 190.38 0)
(708.879 190.81 0)
(708.894 190.819 9.91334e-17)
(709.063 190.542 -8.32203e-17)
(709.224 189.605 0)
(709.372 189.082 8.15636e-17)
(709.8 188.422 0)
(710.037 187.617 0)
(709.943 187.246 -8.88901e-17)
(709.584 187.338 0)
(709.091 187.939 -1.04951e-16)
(708.907 188.056 -1.00051e-16)
(708.249 188.688 0)
(707.719 190.038 -1.92085e-16)
(708.073 190.087 -1.01666e-16)
(707.85 190.971 -1.00933e-16)
(707.773 190.977 -9.11517e-17)
(707.686 190.714 -9.86153e-17)
(707.551 190.358 -9.85946e-17)
(707.097 190.169 -1.06789e-16)
(706.971 190.183 -2.01066e-16)
(706.998 190.387 -9.22968e-17)
(707.143 190.748 -9.83638e-17)
(707.636 190.669 2.0913e-16)
(707.854 191.331 -1.05299e-16)
(708.69 190.899 -1.09319e-16)
(709.003 190.642 -1.02034e-16)
(851.84 -6.77114e-14 0)
(851.84 -1.40449e-13 0)
(851.84 -2.52602e-13 -6.05475e-17)
(851.84 -3.36095e-13 -5.38704e-17)
(851.84 -3.94011e-13 5.959e-17)
(851.84 -7.07116e-13 0)
(851.84 -1.73139e-13 5.11864e-17)
(851.84 2.35934e-14 0)
(851.84 3.07054e-14 4.88355e-17)
(851.84 2.12742e-13 -5.67353e-17)
(851.84 -4.16624e-13 0)
(851.84 -6.92997e-14 0)
(851.84 -4.59028e-14 -4.90856e-17)
(851.84 2.83216e-14 0)
(851.84 9.05272e-14 -5.22625e-17)
(851.84 -3.33031e-13 -6.16818e-17)
(851.84 4.53188e-13 0)
(851.84 1.40143e-12 -1.03117e-16)
(851.84 6.55448e-12 0)
(851.84 8.55869e-11 -5.26787e-17)
(851.84 5.35732e-10 -5.28472e-17)
(851.84 5.1054e-09 -5.30703e-17)
(851.84 4.51346e-08 -5.32484e-17)
(851.84 3.2589e-07 -5.32855e-17)
(851.84 3.43901e-06 0)
(851.84 3.42188e-05 -5.38259e-17)
(851.84 0.000208129 0)
(851.838 0.00236538 -5.45174e-17)
(851.826 0.0121334 -1.44714e-20)
(851.725 0.145868 0)
(851.085 1.07195 0)
(844.61 8.91908 -6.10578e-17)
(821.901 61.2552 -5.41119e-17)
(777.098 77.4419 1.1472e-16)
(728.328 218.364 8.12538e-17)
(707.492 231.459 9.6017e-17)
(699.632 188.624 0)
(706.845 174.182 -8.04315e-17)
(711.279 188.469 0)
(708.989 193.433 1.62475e-16)
(706.285 195.943 3.18413e-19)
(706.262 193.216 8.91096e-17)
(707.097 190.478 7.89729e-17)
(708.364 188.651 0)
(709.344 188.934 0)
(709.279 189.345 9.44e-17)
(708.723 189.556 1.7171e-16)
(708.15 189.911 0)
(708.256 189.892 8.01497e-17)
(708.265 189.8 0)
(708.375 189.809 0)
(708.593 189.773 9.52259e-17)
(708.857 189.471 0)
(709.258 188.654 -8.88373e-17)
(709.379 188.125 0)
(709.444 187.474 9.20644e-17)
(709.382 186.967 -5.13355e-20)
(709.122 187.534 0)
(708.84 188.485 1.08171e-19)
(708.572 189.259 1.05463e-19)
(708.165 190.185 -8.87217e-17)
(708.178 190.631 8.98802e-17)
(708.295 191.031 1.81248e-16)
(708.194 191.137 5.89887e-20)
(707.924 191.046 9.79993e-17)
(707.8 190.567 1.079e-16)
(707.778 190.244 1.04396e-16)
(707.51 190.351 9.22267e-17)
(707.429 190.775 8.98768e-17)
(707.489 191.298 9.76998e-17)
(707.426 192.455 5.98746e-19)
(707.824 192.081 -1.07895e-16)
(707.982 192.31 1.07781e-16)
(708.338 192.07 1.05945e-16)
(708.937 190.828 3.91985e-20)
(851.84 -1.09964e-13 5.4706e-17)
(851.84 -2.28968e-13 0)
(851.84 -3.43243e-13 0)
(851.84 -1.86699e-13 0)
(851.84 -6.30637e-15 -4.33423e-32)
(851.84 2.54939e-13 -6.10301e-17)
(851.84 1.38944e-13 -5.20726e-32)
(851.84 8.08439e-14 5.20074e-17)
(851.84 3.68231e-14 -5.14186e-17)
(851.84 -2.40538e-13 0)
(851.84 -3.41794e-13 0)
(851.84 -2.31613e-13 -5.39964e-17)
(851.84 -1.19468e-13 0)
(851.84 4.11469e-14 5.06094e-17)
(851.84 1.74294e-13 5.14533e-17)
(851.84 3.47184e-13 8.11527e-32)
(851.84 -5.33194e-14 0)
(851.84 -4.55326e-13 -1.30325e-31)
(851.84 -2.82566e-13 0)
(851.84 1.56174e-12 2.32745e-30)
(851.84 2.05453e-11 5.29919e-17)
(851.84 1.46406e-10 5.31015e-17)
(851.84 1.20909e-09 5.31933e-17)
(851.84 1.24283e-08 5.32853e-17)
(851.84 9.38382e-08 0)
(851.84 1.03566e-06 5.39856e-17)
(851.84 7.03386e-06 0)
(851.84 5.61903e-05 5.45171e-17)
(851.84 0.000447863 -5.47064e-17)
(851.837 0.00301793 0)
(851.813 0.0323266 0)
(851.557 0.261112 0)
(849.548 4.03583 5.77669e-17)
(839.788 16.0236 0)
(795.393 99.4878 -9.19229e-17)
(751.411 133.448 0)
(724.565 153.591 0)
(723.08 170.198 7.85445e-17)
(716.221 185.576 0)
(707.06 192.36 -9.13772e-17)
(703.556 196.887 1.03595e-16)
(704.164 193.297 0)
(706.944 189.285 0)
(710.513 187.076 0)
(710.771 187.461 0)
(709.969 188.068 -8.4293e-17)
(708.471 189.289 -9.25349e-17)
(707.52 189.417 0)
(707.3 188.718 -9.05333e-17)
(707.361 188.681 0)
(707.669 188.853 0)
(708.042 189.48 0)
(708.784 188.766 0)
(708.954 188.307 9.65838e-17)
(708.989 187.69 0)
(709.112 187.255 -8.3306e-17)
(709.463 186.942 3.9995e-22)
(709.729 187.974 0)
(709.421 189.906 9.51415e-17)
(709.177 190.347 9.42414e-17)
(708.84 191.397 9.51748e-17)
(708.793 191.7 0)
(708.735 191.545 -8.98107e-17)
(708.539 191.173 9.69482e-17)
(708.245 190.639 1.04507e-16)
(708.256 189.745 0)
(707.949 190.159 0)
(707.903 190.595 0)
(708.355 190.727 9.97025e-17)
(708.15 192.727 0)
(708.397 192.335 2.28887e-16)
(708.506 192.274 0)
(708.413 192.308 0)
(708.338 191.662 9.30791e-17)
(708.673 191.027 9.01931e-17)
(851.84 -2.69586e-13 -4.74036e-17)
(851.84 -2.32057e-13 5.00765e-17)
(851.84 -4.14202e-13 -5.29742e-17)
(851.84 -1.5328e-13 -5.23482e-17)
(851.84 -3.99875e-13 -4.80515e-17)
(851.84 -1.98495e-13 4.79458e-17)
(851.84 -5.5682e-14 -4.81146e-17)
(851.84 -3.07003e-13 -5.92392e-17)
(851.84 -5.57241e-14 0)
(851.84 -2.8539e-14 0)
(851.84 -1.29865e-13 0)
(851.84 -3.86038e-13 -1.61196e-31)
(851.84 -2.58472e-13 0)
(851.84 -1.34906e-13 -5.43367e-17)
(851.84 -3.50382e-14 5.111e-17)
(851.84 -2.39151e-14 1.00852e-16)
(851.84 -2.78737e-13 0)
(851.84 -5.01647e-13 1.30901e-16)
(851.84 -4.7765e-13 0)
(851.84 -4.299e-13 5.3427e-17)
(851.84 -5.37297e-13 0)
(851.84 3.69408e-12 0)
(851.84 3.69032e-11 0)
(851.84 3.14833e-10 0)
(851.84 3.54483e-09 0)
(851.84 2.28642e-08 0)
(851.84 2.34514e-07 0)
(851.84 1.42388e-06 0)
(851.84 1.32234e-05 0)
(851.84 0.000101652 0)
(851.839 0.000861552 0)
(851.832 0.00999279 -5.49601e-17)
(851.76 0.073064 0)
(851.245 0.912602 0)
(843.814 9.29043 0)
(825.358 49.008 -5.62905e-17)
(791.407 127.626 0)
(730.318 149.26 0)
(700.583 169.091 -8.72074e-17)
(704.434 174.307 0)
(710.571 187.898 0)
(710.66 186.8 -7.73469e-17)
(711.752 186.125 -8.09257e-17)
(713.108 190.397 0)
(712.717 191.607 7.84954e-17)
(711.149 191.896 0)
(708.935 191.484 0)
(707.148 190.133 9.88278e-17)
(705.891 188.373 0)
(705.982 187.912 -9.73739e-17)
(706.661 188.24 -8.56983e-17)
(707.882 188.942 0)
(708.97 188.566 0)
(709.073 188.343 0)
(709.202 187.73 8.18263e-17)
(709.385 187.305 0)
(709.86 187.287 1.80405e-16)
(710.338 188.539 -1.0001e-16)
(710.097 191.228 9.40093e-17)
(709.91 191.816 -8.62844e-17)
(709.566 192.496 0)
(709.477 192.167 0)
(709.317 191.715 0)
(708.99 191.312 -1.00225e-16)
(708.919 190.008 -1.02248e-16)
(708.575 189.575 -1.08599e-16)
(708.198 190.478 -1.00477e-16)
(708.63 190.549 -9.37535e-17)
(708.668 192.784 -9.50138e-17)
(708.486 193.103 -9.69212e-17)
(708.267 193.601 -1.95432e-16)
(708.534 192.808 -8.90783e-17)
(708.292 192.8 0)
(708.449 191.276 -2.24757e-16)
(708.767 189.854 -1.04721e-16)
(851.84 4.5205e-14 0)
(851.84 1.41512e-13 -5.2452e-17)
(851.84 1.13263e-13 4.90715e-17)
(851.84 9.14753e-14 4.92112e-17)
(851.84 3.70618e-14 -5.07275e-17)
(851.84 -1.45626e-14 0)
(851.84 3.88386e-13 0)
(851.84 1.15782e-13 0)
(851.84 1.8811e-13 0)
(851.84 2.57723e-13 0)
(851.84 3.02982e-13 0)
(851.84 4.06533e-13 6.08022e-17)
(851.84 1.14982e-13 0)
(851.84 3.97519e-14 0)
(851.84 -1.77228e-13 -5.25894e-17)
(851.84 -4.4286e-13 2.82983e-31)
(851.84 -4.56666e-13 0)
(851.84 -4.09327e-13 -5.71268e-17)
(851.84 -5.58097e-13 0)
(851.84 -4.45206e-13 0)
(851.84 -2.38226e-13 0)
(851.84 -3.52164e-13 0)
(851.84 5.52914e-13 0)
(851.84 9.40162e-12 0)
(851.84 8.29144e-11 0)
(851.84 7.66733e-10 0)
(851.84 5.28157e-09 5.43075e-17)
(851.84 4.7306e-08 0)
(851.84 3.71187e-07 0)
(851.84 2.93882e-06 0)
(851.84 3.54792e-05 -5.48398e-17)
(851.84 0.00019497 5.51019e-17)
(851.838 0.00323876 5.51924e-17)
(851.817 0.0156448 0)
(851.552 0.380757 0)
(850.072 3.12579 5.85795e-17)
(842.218 16.5929 -5.55637e-17)
(803.626 70.864 0)
(743.225 120.726 9.28396e-17)
(728.664 196.558 -6.84876e-17)
(707.531 219.924 8.33976e-17)
(706.956 182.622 8.51493e-17)
(710.264 185.407 8.48199e-17)
(712.196 192.713 0)
(710.958 192.966 -8.29207e-17)
(708.79 193.148 0)
(707.806 192.274 0)
(706.885 190.954 -4.29028e-19)
(705.611 188.331 8.65279e-17)
(705.888 187.523 1.63971e-16)
(707.039 187.311 8.60168e-17)
(708.743 188.402 9.60295e-17)
(709.694 189.02 1.09981e-16)
(709.759 188.878 0)
(709.894 188.788 -2.75406e-19)
(710.153 188.651 9.06373e-17)
(710.731 188.764 -1.86364e-16)
(711.011 190.609 2.14981e-16)
(710.731 191.762 -2.40058e-19)
(710.482 192.091 8.83641e-17)
(709.906 192.44 9.62808e-17)
(709.325 192.427 0)
(708.897 191.644 0)
(708.539 190.565 1.05553e-16)
(708.589 189.167 0)
(708.278 189.677 9.66995e-17)
(708.397 190.092 1.78803e-16)
(709.524 191.079 1.05859e-16)
(709.245 192.924 0)
(708.977 193.134 9.51513e-17)
(708.745 192.77 1.06159e-16)
(708.664 192.203 1.0314e-16)
(708.311 191.619 0)
(708.251 189.427 9.666e-17)
(708.54 189.2 9.09134e-17)
(851.84 -2.18618e-13 0)
(851.84 -1.16048e-13 -5.45639e-17)
(851.84 1.51101e-13 0)
(851.84 1.73216e-13 0)
(851.84 2.63247e-13 6.01871e-17)
(851.84 1.71363e-13 0)
(851.84 -5.29416e-14 0)
(851.84 3.93003e-13 0)
(851.84 1.18888e-13 0)
(851.84 4.52645e-13 5.11391e-17)
(851.84 6.65992e-13 0)
(851.84 8.02696e-13 5.06569e-17)
(851.84 7.1414e-13 -5.73754e-17)
(851.84 3.22368e-13 5.60877e-17)
(851.84 1.88264e-13 0)
(851.84 5.41682e-14 -7.53407e-32)
(851.84 -3.86458e-14 0)
(851.84 -2.10887e-13 0)
(851.84 -9.30132e-14 0)
(851.84 -2.09485e-13 0)
(851.84 -8.4544e-14 6.36973e-17)
(851.84 5.10932e-14 0)
(851.84 3.10772e-14 5.11787e-17)
(851.84 1.91067e-13 0)
(851.84 2.2887e-12 0)
(851.84 1.65424e-11 0)
(851.84 1.72056e-10 -5.43169e-17)
(851.84 1.12698e-09 5.43953e-17)
(851.84 1.24996e-08 0)
(851.84 8.75079e-08 0)
(851.84 9.73984e-07 5.49348e-17)
(851.84 7.80754e-06 0)
(851.84 6.94845e-05 -5.51225e-17)
(851.839 0.000859642 -5.53719e-17)
(851.833 0.00564842 0)
(851.786 0.0892704 -5.61582e-17)
(851.353 0.285 5.63189e-17)
(846.243 11.744 0)
(828.228 29.1804 -5.50619e-17)
(768.083 166.301 9.23428e-17)
(726.318 138.312 -4.05303e-18)
(725.789 151.559 0)
(721.74 183.605 0)
(717.41 191.864 0)
(711.308 193.8 0)
(709.081 194.018 0)
(707.657 194.934 9.34052e-17)
(705.694 193.236 -9.1368e-17)
(704.674 188.185 -8.70867e-17)
(705.065 187.338 -8.17067e-17)
(706.565 187.012 0)
(708.43 187.974 -9.78718e-17)
(709.127 189.062 -1.0667e-16)
(709.423 188.862 0)
(709.639 188.954 -9.94721e-17)
(709.803 188.966 -9.42624e-17)
(710.504 188.666 9.15308e-17)
(710.998 190.03 -9.9069e-17)
(710.971 192.222 -9.27501e-17)
(710.669 192.778 0)
(710.104 192.938 -9.37368e-17)
(709.394 192.684 0)
(708.652 191.613 -1.01228e-16)
(707.929 190.318 0)
(707.819 189.284 0)
(708.01 189.426 8.85967e-17)
(709.223 189.161 -1.95762e-16)
(709.584 191.881 0)
(709.426 192.422 0)
(709.282 192.421 0)
(709.097 192.134 9.88475e-17)
(708.616 191.398 0)
(707.96 189.071 1.13976e-16)
(708.212 188.103 0)
(708.72 188.033 0)
(851.84 -3.11099e-14 0)
(851.84 -1.2571e-13 5.35184e-17)
(851.84 -2.5534e-13 0)
(851.84 -1.52768e-14 0)
(851.84 -2.83026e-13 -4.78747e-17)
(851.84 -2.28544e-13 0)
(851.84 -3.26368e-13 -5.7468e-17)
(851.84 -4.43248e-13 5.17029e-17)
(851.84 -2.75302e-13 0)
(851.84 -2.8536e-13 -5.75302e-17)
(851.84 -6.58876e-14 0)
(851.84 -1.01604e-13 -7.12883e-17)
(851.84 1.49267e-13 6.52756e-17)
(851.84 2.46779e-13 -5.85641e-17)
(851.84 2.55658e-13 5.5485e-17)
(851.84 2.18827e-13 -5.25634e-17)
(851.84 5.25839e-14 5.89843e-17)
(851.84 -1.84276e-13 0)
(851.84 -1.21681e-14 6.33088e-17)
(851.84 2.66141e-14 0)
(851.84 -1.7957e-13 8.73872e-32)
(851.84 -2.56716e-13 0)
(851.84 -2.51945e-13 -1.08664e-31)
(851.84 -3.05853e-13 5.50939e-17)
(851.84 -5.68341e-13 0)
(851.84 -3.69473e-13 5.32589e-17)
(851.84 3.46616e-12 0)
(851.84 4.03569e-11 -3.60405e-29)
(851.84 2.61033e-10 0)
(851.84 3.49426e-09 5.47578e-17)
(851.84 2.00772e-08 0)
(851.84 2.78646e-07 5.50669e-17)
(851.84 1.83192e-06 0)
(851.84 2.40198e-05 1.11087e-16)
(851.84 0.000207698 0)
(851.838 0.00134589 1.11621e-16)
(851.822 0.0260275 0)
(851.593 0.138368 5.64112e-17)
(850.111 4.00588 1.63208e-18)
(829.448 6.61805 -5.70035e-17)
(803.892 93.379 -1.7614e-16)
(768.548 174.1 -6.15752e-17)
(726.627 167.596 -8.66585e-17)
(708.555 176.805 0)
(710.73 181.234 -8.31899e-17)
(713.581 193.713 0)
(710.757 196.485 -1.67231e-16)
(706.395 193.522 -9.50324e-17)
(705.74 188.425 0)
(706.157 187.451 -8.14089e-17)
(707.417 186.798 -8.77264e-17)
(708.798 187.548 -9.5067e-17)
(709.687 189.256 -1.03612e-16)
(709.835 189.808 0)
(709.922 190.2 9.94931e-17)
(710.771 187.939 8.90569e-17)
(710.663 188.108 8.2369e-17)
(710.422 189.016 0)
(710.303 190.388 -9.11835e-17)
(709.974 192.363 0)
(709.731 192.831 -8.63031e-17)
(709.114 192.826 0)
(708.075 192.177 9.92211e-17)
(707.505 190.178 0)
(707.643 189.395 -1.03504e-16)
(708.171 189.26 -8.99133e-17)
(709.585 189.559 3.4645e-19)
(709.356 191.622 0)
(709.211 191.805 0)
(709.283 191.278 -1.00371e-16)
(709.232 190.405 -9.37308e-17)
(708.228 190.071 -1.05796e-16)
(708.346 187.989 -1.01441e-16)
(708.554 187.339 0)
(708.949 187.359 0)
(851.84 4.88425e-14 0)
(851.84 2.63882e-14 4.74082e-17)
(851.84 -4.22587e-14 0)
(851.84 1.20334e-13 5.98255e-17)
(851.84 1.7658e-13 1.20422e-16)
(851.84 -1.02073e-13 0)
(851.84 1.55534e-14 9.93608e-17)
(851.84 -1.06677e-13 -4.85897e-17)
(851.84 -2.8345e-14 0)
(851.84 -3.48048e-13 0)
(851.84 -3.30618e-13 0)
(851.84 -6.43751e-13 0)
(851.84 -8.09715e-13 0)
(851.84 -4.19779e-13 0)
(851.84 -6.84932e-13 -1.11437e-16)
(851.84 -3.69123e-13 -5.68516e-17)
(851.84 1.97422e-14 -5.09898e-17)
(851.84 2.209e-13 -5.02841e-17)
(851.84 2.37889e-14 -5.8192e-17)
(851.84 -5.91873e-14 -6.0135e-17)
(851.84 1.46727e-14 -1.04545e-16)
(851.84 -1.08096e-13 0)
(851.84 -3.96345e-13 -1.06742e-16)
(851.84 -4.3376e-13 -1.08353e-16)
(851.84 -1.16582e-13 -5.17884e-17)
(851.84 -1.75116e-13 -5.7238e-17)
(851.84 1.24558e-13 0)
(851.84 8.63977e-13 -1.1212e-16)
(851.84 1.10176e-11 -5.50969e-17)
(851.84 6.7398e-11 -1.09303e-16)
(851.84 8.37781e-10 0)
(851.84 5.62533e-09 -1.10127e-16)
(851.84 6.94827e-08 0)
(851.84 6.5799e-07 -1.11033e-16)
(851.84 4.50669e-06 0)
(851.84 8.80435e-05 -5.56784e-17)
(851.839 0.000257881 0)
(851.833 0.013531 -7.52862e-21)
(851.765 0.0182463 7.9027e-20)
(850.677 2.15925 5.8369e-17)
(846.201 11.2416 5.69932e-18)
(830.768 36.2837 7.48124e-17)
(773.662 146.081 4.44058e-17)
(754.007 52.2527 0)
(709.918 247.918 1.0397e-16)
(707.986 225.398 9.02923e-17)
(704.093 209.663 9.65837e-17)
(704.589 195.001 -1.28323e-18)
(705.466 191.85 0)
(705.514 188.728 9.24155e-17)
(706.184 185.623 9.2933e-17)
(707.379 186.039 -1.46327e-19)
(708.978 188.4 9.58631e-17)
(710.042 190.229 0)
(711.081 187.401 -2.09007e-16)
(711.73 186.339 -8.86987e-17)
(711.481 186.348 -1.76673e-16)
(710.751 187.753 0)
(710.551 189.821 8.27793e-17)
(710.043 191.443 0)
(709.337 192.594 9.1323e-17)
(708.243 192.811 0)
(707.008 191.85 0)
(707.11 190.171 0)
(707.338 190.116 8.9295e-17)
(708.258 189.433 0)
(709.015 190.736 1.08204e-16)
(709.167 190.883 0)
(709.07 190.726 -9.42585e-17)
(709.178 189.564 9.83303e-17)
(708.306 190.129 0)
(708.38 188.127 1.19396e-16)
(708.794 186.45 0)
(708.865 186.577 0)
(709.255 187.144 0)
(851.84 1.76453e-13 0)
(851.84 3.90252e-13 -1.63481e-31)
(851.84 4.29839e-13 4.76052e-17)
(851.84 6.8081e-13 -1.56621e-31)
(851.84 5.77133e-13 -5.37849e-17)
(851.84 2.7764e-13 0)
(851.84 8.46568e-14 -4.82782e-17)
(851.84 7.33162e-14 0)
(851.84 1.4696e-13 0)
(851.84 2.52159e-13 0)
(851.84 1.99258e-13 0)
(851.84 -4.59528e-14 0)
(851.84 -1.92927e-13 0)
(851.84 -3.43288e-13 0)
(851.84 -8.3128e-13 -2.1825e-31)
(851.84 -2.35678e-14 5.75811e-32)
(851.84 8.32046e-14 0)
(851.84 5.09065e-13 -1.67083e-32)
(851.84 2.18116e-13 0)
(851.84 3.30641e-13 1.16679e-31)
(851.84 1.6272e-13 -1.61351e-32)
(851.84 -1.31245e-14 0)
(851.84 -1.14388e-13 2.5609e-32)
(851.84 -1.93019e-13 -4.77182e-32)
(851.84 -5.5915e-14 -1.03162e-31)
(851.84 1.55367e-13 -5.39309e-17)
(851.84 7.67723e-14 -5.37456e-17)
(851.84 3.5635e-13 1.17428e-31)
(851.84 4.84955e-13 5.66448e-17)
(851.84 3.15974e-12 1.176e-16)
(851.84 1.65125e-11 -5.46362e-17)
(851.84 2.36298e-10 5.50888e-17)
(851.84 1.48559e-09 0)
(851.84 2.15503e-08 5.54349e-17)
(851.84 1.76303e-07 0)
(851.84 2.05861e-06 0)
(851.84 2.51804e-05 -5.60394e-17)
(851.84 0.000206113 -5.61562e-17)
(851.837 0.00292021 5.63104e-17)
(851.81 0.0315838 0)
(851.645 0.290237 5.79857e-17)
(850.226 2.6864 -5.74771e-17)
(840.573 17.0022 1.25688e-16)
(811.469 83.4212 -5.62838e-17)
(757.095 126.397 0)
(713.936 161.811 -8.3117e-17)
(713.928 169.672 -8.30227e-17)
(716.582 185.24 1.64523e-16)
(714.787 189.958 0)
(709.268 187.438 9.41212e-17)
(709.023 185.057 -9.30806e-17)
(710.279 186.08 1.76096e-16)
(710.712 189.197 -8.83856e-17)
(710.49 189.34 -8.70246e-17)
(710.652 187.451 1.86964e-16)
(710.928 184.375 -1.02901e-16)
(710.874 183.877 9.58509e-17)
(711.039 184.68 0)
(710.112 189.699 0)
(709.575 191.272 0)
(708.682 192.585 -9.18165e-17)
(706.981 193.795 -1.00126e-16)
(706.677 191.484 0)
(706.976 191.053 -9.07726e-17)
(707.346 191.154 0)
(708.476 189.493 -1.05367e-16)
(708.274 191.453 0)
(708.627 190.613 0)
(708.641 190.109 9.17069e-17)
(708.287 190.046 0)
(708.422 188.563 -9.81591e-17)
(708.694 187.853 0)
(709.035 187.259 -1.04527e-16)
(709.284 186.832 -1.02956e-16)
(709.701 187.274 0)
(851.84 3.40414e-13 0)
(851.84 2.01116e-13 -5.41355e-17)
(851.84 4.05613e-13 -6.18198e-17)
(851.84 -8.76204e-15 -7.07548e-17)
(851.84 -6.45567e-14 5.89639e-17)
(851.84 -6.0641e-14 0)
(851.84 -1.22141e-13 0)
(851.84 7.89962e-14 -4.84825e-17)
(851.84 1.88777e-13 0)
(851.84 6.67226e-14 0)
(851.84 2.35716e-13 0)
(851.84 2.41813e-13 5.4316e-17)
(851.84 2.28552e-13 0)
(851.84 3.07152e-13 0)
(851.84 5.32346e-13 7.19489e-33)
(851.84 4.51864e-13 4.98995e-17)
(851.84 3.48464e-13 0)
(851.84 4.18401e-13 6.75345e-32)
(851.84 6.00619e-13 0)
(851.84 4.19798e-13 5.58831e-17)
(851.84 1.30516e-14 5.65033e-17)
(851.84 1.53674e-13 0)
(851.84 1.06001e-13 5.1209e-17)
(851.84 5.5589e-14 5.50887e-17)
(851.84 4.02572e-14 5.66749e-17)
(851.84 8.77496e-14 5.44792e-17)
(851.84 1.35924e-13 -4.60443e-32)
(851.84 1.59171e-13 5.68977e-17)
(851.84 2.06638e-13 0)
(851.84 2.8948e-13 -5.34749e-17)
(851.84 4.83811e-13 5.28311e-17)
(851.84 3.31462e-12 5.40464e-17)
(851.84 7.36351e-11 5.52597e-17)
(851.84 4.0365e-10 0)
(851.84 7.81395e-09 5.56213e-17)
(851.84 5.30467e-08 0)
(851.84 7.90233e-07 7.17373e-25)
(851.84 5.97895e-06 5.62322e-17)
(851.84 9.03021e-05 0)
(851.839 0.000626514 -5.72386e-17)
(851.835 0.00735697 0)
(851.788 0.0360098 5.72684e-17)
(851.286 1.12401 -5.82375e-17)
(847.647 3.23066 1.19294e-16)
(823.668 62.0022 5.68235e-17)
(779.205 82.2179 0)
(742.286 179.372 1.16901e-16)
(713.623 243.333 -1.00982e-16)
(702.716 222.37 9.54601e-17)
(703.74 186.407 -8.82512e-17)
(706.358 185.34 1.71138e-16)
(709.463 187.177 -1.02305e-16)
(709.418 189.044 4.2872e-19)
(709.445 187.501 1.63624e-16)
(709.985 185.629 -8.89966e-17)
(710.751 182.94 -2.18834e-19)
(711.195 182.553 0)
(711.389 186.24 0)
(710.488 188.821 8.67321e-17)
(709.34 190.732 0)
(707.479 193.335 1.98788e-16)
(706.163 193.113 1.10435e-16)
(706.361 192.244 -1.0192e-16)
(706.691 192.162 9.01559e-17)
(707.75 191.172 0)
(708.33 190.146 9.88192e-17)
(708.001 190.671 -8.7985e-17)
(708.238 190.073 0)
(708.378 189.426 0)
(708.48 188.655 0)
(708.692 188.548 9.5542e-17)
(709.157 187.608 0)
(709.55 187.321 1.04903e-16)
(710.103 186.591 1.05672e-16)
(710.476 187.143 0)
(851.84 6.09546e-13 7.38202e-17)
(851.84 4.53366e-13 0)
(851.84 4.33221e-13 0)
(851.84 -9.49946e-14 0)
(851.84 -1.36352e-13 -5.17679e-17)
(851.84 -8.87071e-14 0)
(851.84 -1.01523e-13 5.56114e-17)
(851.84 -6.29409e-14 6.3529e-17)
(851.84 -1.91361e-13 0)
(851.84 -2.77863e-14 0)
(851.84 6.61379e-14 0)
(851.84 2.3781e-13 -4.99781e-17)
(851.84 3.34106e-13 0)
(851.84 4.78099e-13 0)
(851.84 9.24856e-13 5.94649e-17)
(851.84 4.39632e-13 5.35307e-17)
(851.84 4.10567e-13 0)
(851.84 2.42938e-13 1.2638e-16)
(851.84 1.82963e-13 0)
(851.84 2.95234e-13 0)
(851.84 1.60561e-13 0)
(851.84 1.35219e-13 0)
(851.84 1.08351e-13 5.9039e-17)
(851.84 4.3796e-13 0)
(851.84 4.7176e-13 5.72473e-17)
(851.84 3.70906e-13 0)
(851.84 1.44593e-13 5.59655e-17)
(851.84 -1.15867e-13 0)
(851.84 -1.28255e-13 0)
(851.84 -4.08898e-13 0)
(851.84 -3.8735e-13 0)
(851.84 -5.11873e-13 -5.30391e-17)
(851.84 3.93481e-13 -5.48241e-17)
(851.84 2.10334e-11 0)
(851.84 1.43902e-10 -5.57348e-17)
(851.84 2.19799e-09 -5.598e-17)
(851.84 1.61901e-08 2.0194e-26)
(851.84 2.08315e-07 -5.63909e-17)
(851.84 1.95911e-06 0)
(851.84 1.69116e-05 5.70647e-17)
(851.84 0.00016659 0)
(851.838 0.00161052 -5.72111e-17)
(851.822 0.0207545 0)
(851.664 0.185611 -5.77196e-17)
(849.498 3.77729 -6.09314e-17)
(841.223 17.6798 0)
(796.386 119.504 -5.78172e-17)
(753.896 81.9314 0)
(718.378 157.222 -8.90552e-17)
(718.887 167.986 0)
(716.539 184.789 -8.95231e-17)
(713.399 186.321 0)
(708.461 188.084 9.98479e-17)
(707.898 185.373 -9.40866e-17)
(708.28 184.877 0)
(709.315 183.319 9.0687e-17)
(711.262 182.449 0)
(711.907 188.737 0)
(711.127 190.925 -8.55015e-17)
(709.521 192.089 9.08336e-17)
(707.29 193.956 -2.20976e-16)
(707.352 193.478 1.0087e-16)
(707.478 193.083 1.7549e-16)
(707.551 192.969 -9.0754e-17)
(708.044 192.007 8.85945e-17)
(708.193 191.147 -8.82953e-17)
(707.932 190.628 1.02359e-16)
(708.166 189.26 0)
(708.395 188.454 8.98254e-17)
(708.608 188.063 9.33399e-17)
(708.961 188.418 -9.90227e-17)
(709.702 187.554 1.07977e-16)
(710.099 187.51 -1.09937e-16)
(710.601 186.992 1.08754e-16)
(710.925 187.378 -9.73185e-17)
(851.84 -1.94701e-13 -5.04466e-17)
(851.84 -9.6064e-14 0)
(851.84 2.08326e-13 0)
(851.84 2.75284e-13 0)
(851.84 2.54723e-13 -5.22994e-17)
(851.84 3.65927e-13 0)
(851.84 3.34531e-13 -9.77778e-17)
(851.84 4.9609e-13 0)
(851.84 1.67077e-13 0)
(851.84 2.27171e-13 0)
(851.84 7.08676e-14 0)
(851.84 2.08674e-13 0)
(851.84 1.24884e-13 0)
(851.84 3.71826e-14 0)
(851.84 -1.03939e-13 0)
(851.84 9.05084e-14 -7.62173e-17)
(851.84 -2.23338e-13 0)
(851.84 -3.78968e-14 -6.01889e-17)
(851.84 -5.76317e-14 0)
(851.84 1.56686e-13 0)
(851.84 -2.99994e-13 0)
(851.84 -1.40712e-13 0)
(851.84 2.7145e-13 -5.35688e-17)
(851.84 7.24289e-13 0)
(851.84 4.56683e-13 -5.75014e-17)
(851.84 1.68405e-13 0)
(851.84 1.87895e-13 0)
(851.84 3.33179e-13 0)
(851.84 -6.75704e-14 0)
(851.84 -2.45958e-13 0)
(851.84 -3.77297e-13 0)
(851.84 -4.11468e-14 0)
(851.84 -3.67061e-13 0)
(851.84 1.3019e-13 0)
(851.84 5.24796e-12 0)
(851.84 4.60934e-11 1.1202e-16)
(851.84 5.07861e-10 5.62154e-17)
(851.84 5.2536e-09 0)
(851.84 4.33469e-08 0)
(851.84 5.84678e-07 0)
(851.84 3.12491e-06 0)
(851.84 8.21579e-05 5.72496e-17)
(851.839 0.000280867 0)
(851.834 0.0103088 0)
(851.766 0.0509537 0)
(851.237 1.21401 0)
(843.463 7.40938 6.63376e-17)
(822.96 54.4757 0)
(776.565 128.121 0)
(737.52 198.704 0)
(712.423 187.332 0)
(704.983 182.136 0)
(705.204 182.94 0)
(705.838 182.264 0)
(707.284 183.045 9.27103e-17)
(709.862 182.483 0)
(713.213 186.69 0)
(712.449 194.674 0)
(711.055 195.745 0)
(707.996 195.276 -9.87837e-17)
(707.172 193.807 9.46866e-17)
(707.779 193.91 -9.13892e-17)
(709.002 194.306 -1.05219e-16)
(709.395 193.994 9.8939e-17)
(709.22 193.284 -8.98265e-17)
(708.61 192.115 9.74589e-17)
(708.049 190.252 0)
(708.091 188.135 9.75215e-17)
(708.207 187.866 -8.909e-17)
(708.469 187.865 -9.39056e-17)
(709.016 188.065 1.00821e-16)
(710 187.86 -1.09016e-16)
(710.398 187.553 1.15603e-16)
(710.669 187.207 -1.11821e-16)
(710.774 187.528 9.65089e-17)
(851.84 -2.31695e-13 0)
(851.84 -9.78834e-14 0)
(851.84 -1.20742e-13 0)
(851.84 -4.4056e-14 0)
(851.84 -7.36906e-16 9.99127e-17)
(851.84 1.62238e-13 -4.82389e-17)
(851.84 6.53751e-13 9.78451e-17)
(851.84 8.4106e-13 -4.85821e-17)
(851.84 1.13129e-12 -5.46099e-17)
(851.84 8.93847e-13 0)
(851.84 7.74162e-13 -5.12334e-17)
(851.84 4.34325e-13 0)
(851.84 1.93725e-13 -5.7042e-17)
(851.84 -4.97907e-14 -5.35101e-17)
(851.84 -8.86238e-14 5.2721e-17)
(851.84 7.53148e-14 0)
(851.84 2.47301e-13 0)
(851.84 2.14467e-13 5.20032e-17)
(851.84 9.03963e-14 0)
(851.84 1.12187e-13 5.84117e-17)
(851.84 2.53973e-13 0)
(851.84 7.53387e-15 6.29255e-17)
(851.84 -2.35842e-13 0)
(851.84 -2.36271e-13 -6.45161e-17)
(851.84 -8.01513e-14 5.6898e-17)
(851.84 1.64458e-14 0)
(851.84 1.83367e-13 0)
(851.84 1.14734e-13 5.23572e-17)
(851.84 -1.38721e-13 0)
(851.84 -1.56949e-13 6.50003e-17)
(851.84 -3.9854e-13 0)
(851.84 -8.60852e-14 0)
(851.84 5.66539e-14 0)
(851.84 -1.79714e-13 0)
(851.84 -3.95209e-13 0)
(851.84 7.00065e-13 -5.59585e-17)
(851.84 1.43349e-11 0)
(851.84 1.14419e-10 0)
(851.84 1.69271e-09 0)
(851.84 9.08402e-09 0)
(851.84 2.38737e-07 0)
(851.84 7.79028e-07 5.72735e-17)
(851.84 3.08056e-05 0)
(851.84 9.17043e-05 0)
(851.838 0.00350042 0)
(851.815 0.0123856 0)
(851.516 0.538598 0)
(849.472 3.7985 0)
(837.237 27.4176 0)
(799.383 83.9512 0)
(738.128 123.098 7.28201e-17)
(713.882 203.676 0)
(704.017 216.546 0)
(703.294 194.016 0)
(705.122 186.277 -9.81803e-17)
(707.402 184.305 0)
(710.283 186.152 0)
(709.975 193.955 0)
(708.722 195.397 0)
(706.198 194 -1.04888e-16)
(706.644 192.278 1.00328e-16)
(708.377 192.175 -9.08404e-17)
(711.495 193.127 -1.05943e-16)
(712.265 193.316 -1.00147e-16)
(711.803 192.823 0)
(710.605 191.197 -9.8698e-17)
(709.796 189.181 -1.07407e-16)
(709.201 187.78 -2.1763e-16)
(708.644 187.602 0)
(708.681 187.702 8.86997e-17)
(709.046 187.951 0)
(709.936 187.688 0)
(710.442 187.316 0)
(710.83 187.325 -1.15205e-16)
(710.754 187.849 0)
(851.84 2.45599e-13 0)
(851.84 1.37076e-13 0)
(851.84 -1.59692e-14 5.01514e-17)
(851.84 -2.6559e-14 0)
(851.84 -3.57773e-14 -5.26562e-17)
(851.84 2.55784e-13 5.51268e-17)
(851.84 2.55294e-13 -5.12491e-17)
(851.84 4.61242e-13 2.80627e-32)
(851.84 6.04391e-13 -1.43054e-32)
(851.84 7.31219e-13 0)
(851.84 4.07847e-13 3.42937e-32)
(851.84 3.64275e-13 -5.0673e-17)
(851.84 4.8401e-13 7.07605e-32)
(851.84 2.84814e-13 -1.22595e-31)
(851.84 4.11466e-13 -9.97188e-17)
(851.84 5.21782e-13 0)
(851.84 6.50807e-13 0)
(851.84 6.00143e-13 -1.0369e-16)
(851.84 6.883e-13 -5.64774e-17)
(851.84 5.02682e-13 -5.73201e-17)
(851.84 6.75252e-13 -5.58918e-17)
(851.84 3.7264e-13 -5.73958e-17)
(851.84 1.90739e-13 -5.37859e-17)
(851.84 9.06879e-14 5.3089e-17)
(851.84 9.30777e-14 -5.32926e-17)
(851.84 3.91553e-13 -6.34936e-17)
(851.84 2.30932e-13 -7.45698e-17)
(851.84 -2.85518e-13 -6.62107e-17)
(851.84 -3.24311e-14 -6.09933e-17)
(851.84 -1.56102e-13 -7.18215e-17)
(851.84 1.45717e-14 0)
(851.84 -4.37126e-14 0)
(851.84 3.58378e-13 -6.54726e-17)
(851.84 2.30649e-13 -5.84054e-17)
(851.84 6.0291e-15 -6.63728e-17)
(851.84 -2.84662e-14 0)
(851.84 -3.20986e-13 0)
(851.84 3.73468e-12 -5.77325e-17)
(851.84 3.99542e-11 -5.66923e-17)
(851.84 5.1102e-10 -5.68308e-17)
(851.84 3.87687e-09 0)
(851.84 7.28082e-08 -5.73255e-17)
(851.84 3.3646e-07 0)
(851.84 9.48905e-06 -5.77786e-17)
(851.84 3.50858e-05 -5.78412e-17)
(851.839 0.00121307 -5.81897e-17)
(851.831 0.00823885 0)
(851.751 0.115291 0)
(850.973 1.19923 -5.89987e-17)
(843.214 16.7922 -5.92399e-17)
(816.279 49.6644 -1.43044e-16)
(752.817 178.087 0)
(736.306 125.569 0)
(718.547 176.804 -1.00725e-16)
(708.877 187.612 0)
(707.51 185.041 0)
(708.363 184.944 0)
(707.949 192.964 0)
(706.378 195.557 0)
(704.516 192.408 8.84416e-17)
(705.595 190.428 -8.5354e-17)
(709.237 189.577 9.30746e-17)
(712.406 192.721 1.11603e-16)
(712.331 193.631 1.01863e-16)
(711.342 193.285 0)
(710.499 190.492 1.01956e-16)
(710.223 188.363 2.17658e-16)
(709.557 187.841 1.04842e-16)
(708.741 187.429 0)
(708.604 187.333 -1.00567e-16)
(708.805 187.372 0)
(709.384 187.254 -1.01357e-16)
(709.923 187.081 0)
(710.559 187.027 1.11542e-16)
(710.471 188.279 0)
(851.84 2.08715e-13 5.23024e-17)
(851.84 -1.73556e-14 0)
(851.84 -7.07559e-14 -4.99383e-17)
(851.84 -1.59233e-14 4.98333e-17)
(851.84 1.48531e-13 4.81343e-17)
(851.84 6.18942e-14 0)
(851.84 6.23205e-13 5.96273e-17)
(851.84 4.671e-13 5.22439e-17)
(851.84 5.49347e-13 9.1805e-32)
(851.84 2.95123e-13 0)
(851.84 6.97506e-14 -1.07659e-31)
(851.84 2.49683e-13 6.08687e-17)
(851.84 1.31587e-13 1.25286e-16)
(851.84 1.75742e-13 5.23023e-17)
(851.84 2.59792e-13 5.03348e-17)
(851.84 2.63549e-13 -5.13954e-17)
(851.84 5.59212e-13 0)
(851.84 5.27799e-13 -8.24748e-32)
(851.84 3.75845e-13 1.0602e-16)
(851.84 2.59042e-13 0)
(851.84 -8.77355e-14 -2.7383e-31)
(851.84 1.58646e-13 0)
(851.84 3.4679e-14 -1.05055e-31)
(851.84 -1.20137e-14 0)
(851.84 1.10373e-13 -5.33326e-17)
(851.84 1.87033e-13 5.25467e-17)
(851.84 1.76013e-13 5.6196e-17)
(851.84 1.6997e-13 0)
(851.84 3.73551e-13 6.83618e-32)
(851.84 8.38872e-13 0)
(851.84 9.09307e-13 5.45337e-17)
(851.84 5.97601e-13 5.45141e-17)
(851.84 2.91987e-13 1.09564e-16)
(851.84 7.94909e-13 5.36133e-17)
(851.84 9.85232e-13 5.46944e-17)
(851.84 1.10886e-12 0)
(851.84 1.08201e-12 5.56753e-17)
(851.84 5.88402e-13 5.59694e-17)
(851.84 1.90648e-12 1.14317e-16)
(851.84 1.59786e-11 5.68753e-17)
(851.84 1.50594e-10 5.71491e-17)
(851.84 1.4499e-09 5.73718e-17)
(851.84 2.21344e-08 5.75723e-17)
(851.84 1.28794e-07 1.15396e-16)
(851.84 3.32907e-06 5.79268e-17)
(851.84 1.52075e-05 5.83035e-17)
(851.84 0.000440831 0)
(851.837 0.00115357 5.87488e-17)
(851.807 0.0646292 5.88049e-17)
(851.421 0.150103 1.18786e-16)
(847.8 9.59753 6.30022e-17)
(820.282 40.0113 5.91041e-17)
(787.623 87.2704 6.19105e-17)
(739.716 193.287 1.07398e-16)
(714.734 179.258 9.95641e-17)
(706.779 181.703 0)
(710.492 181.925 0)
(711.102 193.893 0)
(707.426 197.349 8.68147e-17)
(705.373 188.311 0)
(707.201 185.56 8.56149e-17)
(712.517 186.348 9.55318e-17)
(714.217 192.319 0)
(713.518 192.815 8.83836e-17)
(711.81 191.757 9.75359e-17)
(711.148 188.875 1.10333e-16)
(710.827 187.879 -1.07494e-16)
(710.387 187.509 0)
(709.643 187.309 0)
(709.241 186.863 9.74733e-17)
(709.289 186.789 0)
(709.532 186.911 9.55185e-17)
(709.939 186.854 1.0425e-16)
(710.131 188.217 9.65366e-17)
(709.89 188.965 0)
(851.84 1.73983e-14 -5.14751e-17)
(851.84 -1.00121e-13 5.22955e-17)
(851.84 -3.09612e-14 4.83202e-17)
(851.84 3.27708e-15 -7.03589e-33)
(851.84 1.89573e-13 -5.82435e-17)
(851.84 9.75715e-14 0)
(851.84 8.91284e-14 -4.9885e-17)
(851.84 -5.04094e-14 0)
(851.84 -1.47797e-13 5.00874e-17)
(851.84 -3.06072e-13 0)
(851.84 2.13415e-14 5.10133e-17)
(851.84 -1.60026e-13 0)
(851.84 -3.94603e-13 -5.12079e-17)
(851.84 -1.45088e-13 0)
(851.84 2.34282e-13 0)
(851.84 2.79163e-13 5.41797e-17)
(851.84 3.80983e-13 0)
(851.84 6.11822e-13 6.09193e-17)
(851.84 4.98333e-14 -5.87061e-17)
(851.84 3.05862e-14 -5.91457e-17)
(851.84 -1.90672e-13 5.99482e-17)
(851.84 5.2527e-14 0)
(851.84 3.82016e-13 6.28168e-17)
(851.84 6.84337e-13 0)
(851.84 4.91094e-13 5.602e-17)
(851.84 1.60317e-13 0)
(851.84 1.77898e-13 0)
(851.84 6.97124e-13 0)
(851.84 6.00786e-13 5.33766e-17)
(851.84 8.62781e-13 0)
(851.84 8.67287e-13 -5.47509e-17)
(851.84 6.95671e-13 -6.07789e-17)
(851.84 7.03911e-13 -6.37242e-17)
(851.84 8.75048e-13 -6.08381e-17)
(851.84 1.07571e-12 0)
(851.84 1.23624e-12 -5.58648e-17)
(851.84 9.16907e-13 -1.11438e-16)
(851.84 7.97523e-13 0)
(851.84 6.25683e-13 -5.47287e-17)
(851.84 8.38654e-13 0)
(851.84 5.6755e-12 -5.71157e-17)
(851.84 5.48325e-11 -5.74184e-17)
(851.84 3.85424e-10 -5.75287e-17)
(851.84 9.19709e-09 -5.77166e-17)
(851.84 3.08038e-08 0)
(851.84 1.48255e-06 0)
(851.84 1.88213e-06 0)
(851.84 0.000189475 -5.86641e-17)
(851.839 0.000100954 0)
(851.827 0.0272887 -5.90356e-17)
(851.652 0.0857364 -5.92103e-17)
(849.537 4.98779 -6.29303e-17)
(840.594 21.7842 -7.1189e-17)
(804.263 83.4158 0)
(749.471 151.466 -1.07952e-16)
(716.545 160.938 0)
(717.196 172.113 0)
(711.651 198.409 0)
(704.915 201.639 -8.83244e-17)
(701.011 190.714 0)
(704.207 186.607 -8.66401e-17)
(711.831 187.408 -9.68419e-17)
(714.725 193.83 0)
(713.455 195.349 -8.84633e-17)
(711.476 193.551 -1.96911e-16)
(711.201 188.768 -2.23127e-16)
(710.911 187.448 0)
(710.503 187.249 -1.05977e-16)
(709.977 187.145 0)
(709.813 186.951 -1.01026e-16)
(709.832 186.978 0)
(709.985 187.122 0)
(710.355 187.38 -1.02108e-16)
(710.321 189.068 -9.71869e-17)
(710.059 189.705 0)
(851.84 -1.1786e-13 -5.96113e-17)
(851.84 -1.14049e-13 -5.02487e-17)
(851.84 -2.19705e-14 -4.96813e-17)
(851.84 2.47645e-13 -9.80737e-17)
(851.84 3.58387e-13 -4.83851e-17)
(851.84 2.00378e-13 0)
(851.84 -1.11495e-14 -4.8637e-17)
(851.84 -1.72372e-13 0)
(851.84 -2.60538e-13 0)
(851.84 -2.38226e-13 0)
(851.84 -2.69481e-13 0)
(851.84 -2.49716e-13 0)
(851.84 -1.57142e-13 0)
(851.84 -1.83187e-13 5.07247e-17)
(851.84 -1.76895e-13 5.14835e-17)
(851.84 -3.98264e-14 5.01462e-17)
(851.84 -9.14181e-16 -6.40076e-17)
(851.84 -3.75238e-14 7.27172e-17)
(851.84 -1.13662e-14 0)
(851.84 2.69648e-14 1.10862e-16)
(851.84 1.26619e-13 -5.56008e-17)
(851.84 1.61052e-13 5.48883e-17)
(851.84 2.83495e-13 5.84901e-17)
(851.84 3.89425e-13 -5.93297e-17)
(851.84 2.64669e-13 5.25977e-17)
(851.84 3.67592e-13 -5.26481e-17)
(851.84 4.38561e-13 5.48349e-17)
(851.84 5.43185e-13 6.32139e-17)
(851.84 5.34951e-13 -6.21412e-17)
(851.84 3.44798e-13 6.29971e-17)
(851.84 6.24314e-13 0)
(851.84 5.83532e-13 0)
(851.84 4.20229e-13 0)
(851.84 7.2117e-13 6.15932e-17)
(851.84 8.31753e-13 5.40773e-17)
(851.84 9.091e-13 5.59087e-17)
(851.84 6.85073e-13 1.16134e-16)
(851.84 5.25295e-13 0)
(851.84 4.92377e-13 0)
(851.84 4.27805e-13 0)
(851.84 3.90883e-14 0)
(851.84 1.25545e-12 0)
(851.84 2.07173e-11 0)
(851.84 1.22787e-10 5.77854e-17)
(851.84 3.50925e-09 0)
(851.84 1.07129e-08 0)
(851.84 4.54549e-07 0)
(851.84 1.14777e-06 0)
(851.84 6.26566e-05 5.89206e-17)
(851.84 0.000276816 0)
(851.835 0.00752074 1.18847e-16)
(851.771 0.0867951 0)
(851.209 0.984529 0)
(844.739 11.3578 6.06768e-17)
(823.865 51.4912 0)
(767.375 160.083 6.39203e-17)
(728.438 109.364 0)
(707.702 194.396 0)
(702.621 201.056 0)
(702.581 190.062 -9.0327e-17)
(706.742 183.188 8.78274e-17)
(713.745 185.16 0)
(714.824 194.966 -9.46406e-17)
(713.005 195.801 0)
(711.465 192.587 -6.9257e-19)
(711.356 188.651 1.07812e-16)
(710.96 187.407 0)
(710.303 187.299 1.05247e-16)
(709.881 187.242 0)
(709.996 187.354 0)
(710.466 187.507 0)
(710.854 189.051 0)
(710.77 190.374 0)
(710.531 190.487 0)
(710.033 190.526 -9.42594e-17)
(851.84 1.99112e-13 -1.43405e-31)
(851.84 1.07435e-13 0)
(851.84 -7.24558e-14 0)
(851.84 -1.05792e-13 -1.75461e-31)
(851.84 1.32906e-13 1.10932e-16)
(851.84 3.63547e-13 5.33079e-17)
(851.84 4.06126e-13 1.10098e-16)
(851.84 4.90629e-13 0)
(851.84 3.40858e-13 5.83226e-17)
(851.84 3.82422e-13 0)
(851.84 2.00185e-13 5.14361e-17)
(851.84 -1.90422e-13 0)
(851.84 -2.47373e-13 0)
(851.84 6.53531e-14 -6.17689e-17)
(851.84 -2.11192e-13 -4.99979e-17)
(851.84 -3.50209e-13 1.36897e-31)
(851.84 -5.99889e-13 5.11414e-17)
(851.84 -5.05494e-13 2.92009e-32)
(851.84 -1.71169e-13 0)
(851.84 -3.49295e-13 1.19484e-31)
(851.84 -1.38242e-13 7.11568e-17)
(851.84 1.46665e-13 -5.97568e-17)
(851.84 3.02914e-13 -5.3005e-17)
(851.84 3.35277e-13 5.49777e-17)
(851.84 5.49108e-13 -1.9469e-31)
(851.84 7.43878e-13 5.85543e-17)
(851.84 6.42179e-13 1.54042e-31)
(851.84 6.5686e-13 -5.33967e-17)
(851.84 7.47242e-13 5.41139e-17)
(851.84 6.11405e-13 -3.0799e-32)
(851.84 8.63217e-13 0)
(851.84 3.98048e-13 0)
(851.84 6.14377e-13 0)
(851.84 4.51865e-13 6.9703e-17)
(851.84 6.15609e-13 -6.1072e-17)
(851.84 4.8332e-13 0)
(851.84 8.38136e-13 -1.42903e-31)
(851.84 6.78198e-13 0)
(851.84 7.59962e-13 6.80096e-17)
(851.84 3.34364e-13 0)
(851.84 2.52666e-13 0)
(851.84 4.1145e-14 0)
(851.84 1.17121e-12 0)
(851.84 8.27538e-12 -6.26639e-30)
(851.84 4.86322e-11 0)
(851.84 9.95388e-10 5.83682e-17)
(851.84 6.10128e-09 0)
(851.84 1.29093e-07 5.87399e-17)
(851.84 1.05414e-06 -5.89996e-17)
(851.84 1.64715e-05 0)
(851.84 0.000176803 -5.95763e-17)
(851.838 0.00204233 0)
(851.818 0.0231014 5.98124e-17)
(851.524 0.462632 -6.07149e-17)
(849.055 4.72558 6.09437e-17)
(833.01 37.8705 -7.67276e-17)
(786.631 79.7951 0)
(728.615 161.134 1.00262e-16)
(701.837 244.133 0)
(700.751 211.627 2.06675e-16)
(707.891 184.643 -9.94135e-17)
(712.544 184.845 9.35951e-17)
(711.767 196.822 9.18109e-17)
(709.676 197.85 0)
(709.67 193.051 2.1572e-16)
(710.14 189.16 0)
(709.61 187.982 1.04967e-16)
(709.394 187.091 0)
(709.471 187.246 9.04119e-17)
(709.889 187.924 0)
(710.508 190.217 0)
(710.336 190.635 8.84841e-17)
(709.879 190.684 0)
(709.783 190.128 1.08985e-16)
(709.639 189.795 9.67563e-17)
(851.84 3.9025e-13 5.18301e-17)
(851.84 1.51695e-13 -5.20275e-17)
(851.84 1.75059e-13 4.92725e-17)
(851.84 2.79755e-13 4.80953e-17)
(851.84 1.76613e-13 -4.82652e-17)
(851.84 5.12002e-13 -4.84364e-17)
(851.84 5.78052e-13 -5.70411e-17)
(851.84 5.73189e-13 6.55384e-17)
(851.84 2.12216e-13 -5.57865e-17)
(851.84 3.40819e-13 0)
(851.84 1.75254e-13 1.84082e-31)
(851.84 2.42801e-13 0)
(851.84 4.37329e-13 5.76432e-17)
(851.84 -6.84455e-14 0)
(851.84 -9.30267e-14 5.00331e-17)
(851.84 -6.4595e-13 -5.46962e-17)
(851.84 -7.65848e-13 5.51706e-17)
(851.84 -7.40304e-13 2.4108e-31)
(851.84 -3.96902e-13 -5.15308e-17)
(851.84 -1.33175e-13 -2.64619e-31)
(851.84 -2.03481e-13 0)
(851.84 8.36445e-14 6.31812e-17)
(851.84 4.12255e-13 0)
(851.84 4.2365e-13 0)
(851.84 3.68981e-13 7.02544e-32)
(851.84 6.8762e-13 0)
(851.84 1.41136e-12 -1.33967e-16)
(851.84 1.50402e-12 5.85533e-17)
(851.84 1.58607e-12 0)
(851.84 1.49823e-12 -6.1297e-17)
(851.84 9.42536e-13 0)
(851.84 1.09764e-12 0)
(851.84 9.60221e-13 0)
(851.84 7.95535e-13 -1.09703e-16)
(851.84 5.64023e-13 6.35942e-17)
(851.84 4.26715e-13 -6.44436e-17)
(851.84 3.76051e-13 -1.1702e-16)
(851.84 6.58857e-13 0)
(851.84 6.47813e-13 -1.106e-16)
(851.84 7.80353e-13 -5.67962e-17)
(851.84 5.74309e-13 0)
(851.84 7.53035e-13 0)
(851.84 3.36089e-13 -6.18708e-17)
(851.84 2.70478e-13 -5.96883e-17)
(851.84 1.94983e-12 0)
(851.84 1.87954e-11 -1.17301e-16)
(851.84 2.75507e-10 -5.85345e-17)
(851.84 3.24091e-09 -5.87963e-17)
(851.84 3.31943e-08 0)
(851.84 5.44529e-07 -5.93481e-17)
(851.84 3.84415e-06 5.95795e-17)
(851.84 7.44454e-05 -5.97282e-17)
(851.839 0.000648362 -1.19845e-16)
(851.831 0.0117614 0)
(851.728 0.146894 -1.21072e-16)
(850.379 1.98906 -6.09067e-17)
(839.921 25.9262 -6.03377e-17)
(792.523 55.3973 -1.15626e-16)
(742.112 180.264 -9.54594e-17)
(725.948 183.181 -1.01696e-16)
(708.969 174.348 0)
(716.005 180.07 -9.55866e-17)
(713.562 193.456 0)
(708.244 193.061 0)
(708.175 190.245 -1.00368e-16)
(708.994 188.821 -8.66771e-17)
(709.162 187.338 -1.7501e-16)
(708.962 188.113 -8.80957e-17)
(708.961 188.796 -9.07662e-17)
(709.607 189.926 0)
(709.563 190.785 0)
(709.035 190.976 -9.22015e-17)
(707.973 190.434 0)
(707.943 189.55 -1.0376e-16)
(708.265 188.961 0)
(851.84 -2.11586e-13 0)
(851.84 -3.38984e-14 5.94818e-17)
(851.84 -1.08428e-13 -5.47188e-17)
(851.84 -1.07994e-13 5.66125e-17)
(851.84 2.02643e-13 -5.68502e-17)
(851.84 1.08808e-13 0)
(851.84 -1.77838e-13 -5.18594e-17)
(851.84 -1.73383e-13 -4.88159e-17)
(851.84 -4.72804e-15 0)
(851.84 1.9142e-13 0)
(851.84 1.18478e-13 -5.20342e-17)
(851.84 6.22737e-13 0)
(851.84 7.01953e-13 -6.58326e-17)
(851.84 2.93716e-13 0)
(851.84 1.55502e-13 -5.09797e-17)
(851.84 1.34181e-13 0)
(851.84 8.28621e-14 -6.38055e-17)
(851.84 2.67376e-13 -5.74936e-17)
(851.84 2.27764e-13 6.03267e-17)
(851.84 6.22424e-13 -5.98661e-17)
(851.84 7.65278e-13 0)
(851.84 5.987e-13 -6.42691e-17)
(851.84 4.41748e-13 0)
(851.84 4.2016e-13 0)
(851.84 4.8873e-13 -5.81873e-17)
(851.84 3.61482e-13 0)
(851.84 6.65218e-13 5.84287e-17)
(851.84 8.17919e-13 -5.57692e-17)
(851.84 6.58421e-13 0)
(851.84 1.0448e-12 0)
(851.84 1.16175e-12 0)
(851.84 9.97811e-13 0)
(851.84 8.03412e-13 0)
(851.84 8.67034e-13 5.9545e-17)
(851.84 7.96399e-13 -6.84205e-17)
(851.84 1.04829e-12 1.36532e-16)
(851.84 8.77617e-13 5.87816e-17)
(851.84 8.55116e-13 0)
(851.84 7.05641e-13 6.65696e-17)
(851.84 7.67849e-13 7.18501e-17)
(851.84 6.03663e-13 0)
(851.84 5.08054e-13 5.80034e-17)
(851.84 2.46383e-13 1.1159e-16)
(851.84 1.74074e-13 0)
(851.84 -4.17597e-13 0)
(851.84 -3.5431e-13 5.8449e-17)
(851.84 7.77475e-12 1.18978e-16)
(851.84 8.22023e-11 0)
(851.84 1.30999e-09 0)
(851.84 9.85118e-09 5.93466e-17)
(851.84 2.0339e-07 -5.95554e-17)
(851.84 1.38519e-06 5.97487e-17)
(851.84 3.22361e-05 6.00101e-17)
(851.84 0.000261472 -6.01912e-17)
(851.836 0.00475719 1.20691e-16)
(851.782 0.0687014 6.06085e-17)
(850.995 1.07764 6.19421e-17)
(843.842 13.8592 0)
(808.093 75.401 1.08862e-16)
(757.711 187.522 -8.10382e-17)
(749.872 82.9108 0)
(715.671 219.822 9.80255e-17)
(700.029 223.74 9.99653e-17)
(700.31 194.824 9.50033e-17)
(702.425 190.987 0)
(706.006 188.711 2.02974e-16)
(708.179 185.686 1.12917e-16)
(707.826 188.418 2.11041e-16)
(708.543 188.158 0)
(708.958 190.215 9.20561e-17)
(708.535 190.752 9.27187e-17)
(707.268 191.265 0)
(706.257 189.596 1.14716e-16)
(706.282 188.326 1.05609e-16)
(706.73 188.407 9.15117e-17)
(851.84 -2.60284e-13 0)
(851.84 -2.8428e-13 0)
(851.84 -4.36985e-13 0)
(851.84 -4.6562e-13 1.10475e-31)
(851.84 -9.50564e-13 -4.55666e-31)
(851.84 -4.99762e-13 5.74231e-17)
(851.84 -2.87554e-13 1.08863e-16)
(851.84 -2.82247e-13 0)
(851.84 1.54973e-13 0)
(851.84 -1.40339e-13 0)
(851.84 3.72336e-14 0)
(851.84 3.0383e-13 0)
(851.84 -1.11985e-14 5.18097e-17)
(851.84 -3.04208e-13 0)
(851.84 -3.80492e-13 5.10163e-17)
(851.84 9.05596e-14 0)
(851.84 2.07673e-13 5.91899e-17)
(851.84 6.56334e-13 6.31039e-17)
(851.84 3.82418e-13 -5.60612e-17)
(851.84 4.30708e-13 5.32562e-17)
(851.84 5.88062e-13 0)
(851.84 5.65911e-13 0)
(851.84 6.41291e-13 5.29506e-17)
(851.84 6.0519e-13 6.16585e-17)
(851.84 8.16824e-13 0)
(851.84 7.71012e-13 5.37104e-17)
(851.84 4.79026e-13 0)
(851.84 4.82113e-13 0)
(851.84 4.24578e-13 5.30959e-17)
(851.84 5.07474e-13 0)
(851.84 1.09767e-12 -5.99492e-17)
(851.84 1.09838e-12 -5.34359e-17)
(851.84 1.07796e-12 0)
(851.84 8.53766e-13 5.71685e-17)
(851.84 1.10555e-12 -5.40705e-17)
(851.84 9.61246e-13 -1.08785e-16)
(851.84 7.91495e-13 -6.141e-17)
(851.84 9.99165e-13 0)
(851.84 7.98748e-13 6.79771e-17)
(851.84 6.1627e-13 -7.23233e-17)
(851.84 5.43121e-13 -7.48603e-17)
(851.84 1.26313e-13 -1.39598e-16)
(851.84 1.29393e-13 1.19702e-31)
(851.84 -6.25046e-13 -6.15808e-17)
(851.84 -9.00373e-13 -5.74238e-17)
(851.84 -7.11994e-13 -5.806e-17)
(851.84 -8.18653e-13 -1.13538e-16)
(851.84 1.80071e-12 5.81849e-17)
(851.84 2.4364e-11 0)
(851.84 4.96283e-10 0)
(851.84 4.03047e-09 0)
(851.84 7.24957e-08 5.97778e-17)
(851.84 7.66779e-07 -5.99903e-17)
(851.84 1.0848e-05 6.01346e-17)
(851.84 0.000167271 -1.20649e-16)
(851.838 0.00216604 -6.05869e-17)
(851.808 0.0422713 6.09571e-17)
(851.434 0.523829 0)
(846.038 10.3919 0)
(828.774 47.0103 3.45436e-17)
(794.125 123.98 0)
(715.735 148.187 -1.03568e-16)
(704.753 180.006 -9.77024e-17)
(706.806 186.202 -1.904e-16)
(710.156 179.58 0)
(711.493 185.049 -2.14298e-16)
(711.237 187.004 0)
(709.52 189.695 -8.54152e-17)
(709.299 190.647 -8.55354e-17)
(709.116 190.785 -1.76898e-16)
(708.272 190.898 -9.68531e-17)
(706.691 190.685 0)
(705.809 188.66 -2.26809e-16)
(705.665 187.472 -1.02616e-16)
(706.137 187.681 -1.83754e-16)
(851.84 -1.42749e-13 6.17717e-17)
(851.84 2.70512e-13 -5.75714e-17)
(851.84 1.439e-13 5.63105e-17)
(851.84 -7.93843e-14 -6.25423e-17)
(851.84 1.11254e-14 5.35146e-17)
(851.84 -1.18517e-13 -1.07541e-16)
(851.84 1.9505e-13 -5.73442e-17)
(851.84 3.95642e-13 0)
(851.84 2.06503e-13 5.37331e-17)
(851.84 1.29919e-13 -5.39748e-17)
(851.84 2.51505e-13 5.23664e-17)
(851.84 1.68372e-13 -5.60599e-17)
(851.84 -1.10192e-13 1.75554e-31)
(851.84 -1.21507e-13 -6.23628e-17)
(851.84 9.95261e-14 -5.2621e-17)
(851.84 2.35176e-13 -5.1629e-17)
(851.84 6.76625e-13 -5.44327e-17)
(851.84 5.2869e-13 -5.54412e-17)
(851.84 4.53871e-13 1.22868e-16)
(851.84 5.7049e-13 -1.20653e-16)
(851.84 4.76098e-13 0)
(851.84 6.70075e-13 -6.40722e-17)
(851.84 5.25166e-13 -6.03977e-17)
(851.84 4.7192e-13 -5.98644e-17)
(851.84 3.63974e-13 0)
(851.84 2.91712e-13 -1.35979e-16)
(851.84 1.20646e-13 6.60594e-17)
(851.84 -1.34228e-13 0)
(851.84 1.84834e-13 -6.89683e-17)
(851.84 -1.37768e-13 -6.07561e-17)
(851.84 4.10358e-13 1.17688e-16)
(851.84 6.93013e-13 -7.75844e-32)
(851.84 1.06278e-12 5.36863e-17)
(851.84 1.15601e-12 -6.04617e-17)
(851.84 1.0825e-12 1.305e-16)
(851.84 1.1142e-12 1.00932e-31)
(851.84 6.85083e-13 1.18713e-16)
(851.84 4.29695e-13 5.60599e-17)
(851.84 7.29351e-13 -6.46022e-17)
(851.84 5.98735e-13 1.25573e-16)
(851.84 4.76124e-13 0)
(851.84 1.5499e-14 7.27516e-17)
(851.84 1.73407e-13 -1.13941e-16)
(851.84 -3.78978e-13 1.31284e-16)
(851.84 -3.64408e-13 6.63714e-17)
(851.84 -4.25702e-13 1.29823e-16)
(851.84 -3.84566e-13 6.42315e-17)
(851.84 -5.17703e-13 -5.70498e-17)
(851.84 7.45868e-13 0)
(851.84 8.51432e-12 0)
(851.84 1.87692e-10 -5.95839e-17)
(851.84 1.70695e-09 -5.97655e-17)
(851.84 2.99457e-08 2.78348e-26)
(851.84 3.50962e-07 6.01249e-17)
(851.84 6.22664e-06 6.03999e-17)
(851.84 7.69965e-05 1.21437e-16)
(851.839 0.0013408 -1.22022e-16)
(851.826 0.0140822 6.11627e-17)
(851.618 0.333009 0)
(849.945 4.09394 6.50281e-17)
(839.44 23.1666 -6.13738e-17)
(784.669 66.0649 0)
(737.813 155.988 0)
(707.871 251.541 1.11281e-16)
(702.67 201.424 8.74876e-17)
(707.915 193.778 9.25849e-17)
(710.742 192.805 0)
(708.38 191.98 0)
(707.29 189.708 1.92332e-16)
(707.751 188.867 9.81427e-17)
(707.729 189.321 0)
(707.184 190.061 -9.18895e-17)
(706.554 188.912 1.00236e-16)
(705.73 187.653 0)
(705.605 187.844 2.20845e-16)
(851.84 -5.27394e-13 -1.00352e-16)
(851.84 -4.24644e-13 -1.5219e-31)
(851.84 7.44708e-14 -5.05681e-17)
(851.84 1.04648e-13 0)
(851.84 1.03105e-14 0)
(851.84 -9.84811e-14 -9.90539e-32)
(851.84 -3.4705e-13 0)
(851.84 -3.43967e-13 -4.89992e-17)
(851.84 -4.65036e-13 -9.85475e-17)
(851.84 -4.93034e-13 5.22598e-17)
(851.84 -5.68749e-13 -5.29292e-17)
(851.84 -6.58339e-13 -8.6232e-32)
(851.84 -6.65104e-13 -1.09622e-16)
(851.84 -1.30597e-13 6.55755e-17)
(851.84 -1.05116e-13 0)
(851.84 2.13268e-13 5.14343e-17)
(851.84 2.2589e-13 0)
(851.84 3.33328e-13 0)
(851.84 5.60926e-13 -1.04481e-16)
(851.84 5.63353e-13 5.97068e-17)
(851.84 4.65961e-13 0)
(851.84 2.33947e-13 -2.14433e-31)
(851.84 1.74139e-13 0)
(851.84 1.25469e-13 0)
(851.84 1.52019e-13 -5.61279e-17)
(851.84 3.14523e-14 6.28395e-17)
(851.84 4.81466e-14 -1.28796e-16)
(851.84 1.21645e-13 -5.26907e-17)
(851.84 1.64971e-13 0)
(851.84 -1.69645e-13 5.81317e-17)
(851.84 -3.09633e-14 -1.19763e-16)
(851.84 1.91993e-13 7.0345e-17)
(851.84 5.14066e-13 -6.22773e-17)
(851.84 7.67799e-13 0)
(851.84 7.07766e-13 -5.84103e-17)
(851.84 7.89773e-13 6.01504e-17)
(851.84 8.6439e-13 -6.27629e-17)
(851.84 5.77315e-13 -6.53884e-17)
(851.84 6.65576e-13 5.52118e-17)
(851.84 8.10858e-13 -5.52481e-17)
(851.84 7.90266e-13 5.59391e-17)
(851.84 5.11592e-13 0)
(851.84 2.35819e-13 5.59268e-17)
(851.84 2.14337e-13 -5.72229e-17)
(851.84 2.75959e-14 0)
(851.84 -4.36792e-13 -6.63153e-17)
(851.84 -7.35454e-13 -6.66559e-17)
(851.84 -3.74901e-13 0)
(851.84 5.76858e-14 0)
(851.84 -7.07735e-14 0)
(851.84 3.25367e-12 4.62553e-30)
(851.84 6.72529e-11 0)
(851.84 8.64234e-10 5.99467e-17)
(851.84 1.27753e-08 -6.02002e-17)
(851.84 2.08112e-07 0)
(851.84 2.29507e-06 -6.08235e-17)
(851.84 4.10143e-05 6.10913e-17)
(851.84 0.00039874 -6.13524e-17)
(851.834 0.00779081 0)
(851.771 0.0876454 6.19137e-17)
(850.823 1.33581 6.32816e-17)
(841.935 18.7679 0)
(801.669 81.8586 6.21498e-17)
(744.609 172.037 9.23771e-17)
(733.397 107.864 -1.13142e-16)
(715.13 190.575 0)
(710.054 200.274 0)
(704.065 195.323 0)
(703.851 187.724 -9.79115e-17)
(706.13 186.063 0)
(708.422 188.363 0)
(708.339 190.168 1.63348e-19)
(707.731 189.663 0)
(706.342 187.788 0)
(705.633 187.742 -2.06778e-16)
(851.84 -4.07238e-14 6.22182e-17)
(851.84 -5.80368e-14 5.30817e-17)
(851.84 -7.62823e-14 -4.96995e-17)
(851.84 -2.2834e-14 0)
(851.84 3.1509e-15 0)
(851.84 -7.14727e-14 5.60581e-17)
(851.84 -2.77195e-13 0)
(851.84 -5.84922e-13 -2.87048e-31)
(851.84 -5.93191e-13 4.92243e-17)
(851.84 -7.38946e-13 0)
(851.84 -7.0862e-13 0)
(851.84 -4.85298e-13 1.24014e-31)
(851.84 -4.37861e-13 5.09968e-17)
(851.84 -1.87831e-13 0)
(851.84 -1.66761e-13 0)
(851.84 -1.62435e-13 0)
(851.84 -2.3695e-13 0)
(851.84 -1.89077e-13 0)
(851.84 4.58845e-14 6.55504e-17)
(851.84 -1.00937e-14 0)
(851.84 2.5972e-13 0)
(851.84 3.06264e-13 5.25676e-17)
(851.84 2.15817e-13 0)
(851.84 2.14141e-13 0)
(851.84 3.28679e-13 5.63742e-17)
(851.84 3.38732e-13 0)
(851.84 3.23091e-13 5.50057e-17)
(851.84 3.71626e-13 5.37925e-17)
(851.84 1.77812e-13 0)
(851.84 3.39668e-13 0)
(851.84 2.68538e-13 6.56213e-17)
(851.84 4.01518e-13 -6.74451e-17)
(851.84 3.71126e-13 5.54123e-17)
(851.84 2.71241e-13 6.00242e-17)
(851.84 3.54453e-13 0)
(851.84 1.61173e-14 0)
(851.84 5.52449e-13 0)
(851.84 1.00334e-12 0)
(851.84 7.29779e-13 -1.10137e-16)
(851.84 6.73243e-13 6.7996e-17)
(851.84 4.46582e-13 -6.83362e-17)
(851.84 2.2819e-13 0)
(851.84 6.31512e-14 -5.59709e-17)
(851.84 1.63005e-14 5.69915e-17)
(851.84 -2.07085e-13 -5.72687e-17)
(851.84 -4.08212e-13 0)
(851.84 -6.12209e-13 6.44224e-17)
(851.84 -4.5508e-13 -7.77635e-17)
(851.84 -8.08542e-13 6.5633e-17)
(851.84 -4.90021e-13 -6.99019e-17)
(851.84 -2.27217e-13 7.10031e-17)
(851.84 1.54799e-12 -5.98754e-17)
(851.84 2.76894e-11 6.03229e-17)
(851.84 4.40839e-10 0)
(851.84 5.14145e-09 -6.06326e-17)
(851.84 8.30163e-08 0)
(851.84 8.85604e-07 0)
(851.84 1.53463e-05 0)
(851.84 0.000177754 -6.15378e-17)
(851.837 0.00271787 -6.16965e-17)
(851.795 0.057673 6.2011e-17)
(851.207 0.810564 0)
(844.142 13.67 -7.03543e-17)
(814.438 65.9582 -1.07175e-16)
(772.845 150.703 0)
(717.837 194.253 0)
(703.011 190.407 0)
(704.205 184.622 0)
(705.891 183.452 0)
(709.116 184.562 0)
(711.331 190.97 0)
(711.409 191.701 1.02869e-16)
(710.478 189.853 0)
(708.321 187.359 0)
(707.102 187.806 1.01491e-16)
(851.84 4.71826e-14 0)
(851.84 2.83363e-13 -5.67023e-17)
(851.84 2.02427e-13 4.88035e-17)
(851.84 -1.93061e-14 0)
(851.84 9.25346e-14 0)
(851.84 1.16086e-13 0)
(851.84 -4.68512e-14 0)
(851.84 -4.51473e-13 5.24622e-17)
(851.84 -7.03956e-13 5.02558e-17)
(851.84 -8.64712e-13 -5.06598e-17)
(851.84 -5.206e-13 5.04851e-17)
(851.84 -4.32397e-13 5.06724e-17)
(851.84 -2.21191e-13 0)
(851.84 -3.17356e-14 -5.2062e-17)
(851.84 -8.72258e-14 -5.02456e-17)
(851.84 -4.94647e-14 0)
(851.84 -8.888e-14 -6.25198e-17)
(851.84 -4.00451e-13 0)
(851.84 -4.27935e-13 0)
(851.84 -3.60244e-13 0)
(851.84 3.45819e-15 0)
(851.84 2.80911e-13 -5.42735e-17)
(851.84 1.89224e-13 -5.40843e-17)
(851.84 -1.45579e-13 -5.81159e-17)
(851.84 5.13427e-14 0)
(851.84 -2.84632e-14 -5.54102e-17)
(851.84 3.3937e-13 -6.19695e-17)
(851.84 4.21157e-13 -5.8064e-17)
(851.84 5.3495e-13 0)
(851.84 5.48991e-13 -5.91114e-17)
(851.84 5.83932e-13 0)
(851.84 6.94232e-13 8.19256e-17)
(851.84 1.79747e-13 1.90046e-31)
(851.84 5.04166e-14 -6.24118e-17)
(851.84 -3.68125e-13 0)
(851.84 -6.25805e-14 0)
(851.84 -1.68512e-13 5.53742e-17)
(851.84 -6.30268e-14 0)
(851.84 -1.91615e-13 5.80775e-17)
(851.84 -4.35589e-14 -5.83255e-17)
(851.84 6.77452e-14 6.51888e-17)
(851.84 -2.74918e-14 0)
(851.84 -1.1391e-13 6.03854e-17)
(851.84 -1.35832e-14 -6.45726e-17)
(851.84 -4.16262e-13 6.35283e-17)
(851.84 -5.74345e-13 5.67127e-17)
(851.84 -7.19296e-13 6.2958e-17)
(851.84 -6.71683e-13 6.62289e-17)
(851.84 -9.2951e-13 -6.15512e-17)
(851.84 -6.40852e-13 6.18401e-17)
(851.84 -3.0193e-13 0)
(851.84 -1.94623e-14 5.93674e-17)
(851.84 1.41734e-12 -5.94838e-17)
(851.84 1.17508e-11 6.00129e-17)
(851.84 1.67802e-10 6.06563e-17)
(851.84 2.09277e-09 0)
(851.84 3.09558e-08 0)
(851.84 4.44923e-07 6.12638e-17)
(851.84 6.91554e-06 6.14728e-17)
(851.84 0.000116179 0)
(851.838 0.00193832 -1.24153e-16)
(851.815 0.0311955 6.23098e-17)
(851.43 0.530458 0)
(847.507 9.56421 6.37415e-17)
(829.696 42.467 6.24995e-17)
(777.385 77.9865 6.39783e-17)
(723.261 192.968 0)
(701.272 203.066 0)
(704.133 193.315 8.76467e-17)
(709.379 191.146 -1.02184e-16)
(711.033 191.725 9.749e-17)
(709.804 191.958 0)
(708.418 189.496 1.05214e-16)
(707.573 187.222 0)
(708.277 186.907 9.18858e-17)
(851.84 5.39804e-13 2.55505e-17)
(851.84 2.97376e-13 5.07062e-17)
(851.84 2.11086e-13 0)
(851.84 2.48173e-13 0)
(851.84 7.24065e-14 0)
(851.84 -3.01877e-13 -2.76894e-17)
(851.84 -2.68178e-13 -2.47336e-17)
(851.84 -3.32302e-13 -2.5918e-17)
(851.84 -3.16935e-13 -3.00162e-17)
(851.84 -3.37799e-13 6.04441e-17)
(851.84 -3.15508e-13 -5.91237e-17)
(851.84 -1.812e-13 3.07035e-17)
(851.84 1.73891e-13 -2.74424e-17)
(851.84 -1.16644e-14 7.56209e-17)
(851.84 -1.07457e-13 5.03585e-17)
(851.84 -9.45912e-14 0)
(851.84 -1.72342e-13 5.93622e-17)
(851.84 -1.48794e-13 2.55302e-17)
(851.84 -2.41086e-13 3.10472e-17)
(851.84 7.19101e-14 0)
(851.84 3.74856e-15 -2.63223e-17)
(851.84 6.23612e-14 5.2825e-17)
(851.84 2.40664e-14 5.29123e-17)
(851.84 1.86936e-14 2.87767e-17)
(851.84 -2.18658e-13 0)
(851.84 -2.5173e-14 6.49958e-17)
(851.84 -2.02367e-13 2.85295e-17)
(851.84 -3.46569e-14 2.64041e-17)
(851.84 1.82633e-13 0)
(851.84 2.05825e-13 6.54882e-17)
(851.84 -1.43812e-13 0)
(851.84 2.19382e-14 0)
(851.84 2.00989e-13 -9.29203e-17)
(851.84 -1.19176e-13 0)
(851.84 -7.5524e-14 0)
(851.84 -1.08507e-13 -2.72468e-17)
(851.84 -2.70737e-13 -2.77087e-17)
(851.84 -2.51407e-13 0)
(851.84 -2.91137e-13 0)
(851.84 -3.10066e-13 -2.81311e-17)
(851.84 -4.06337e-13 0)
(851.84 -3.01255e-13 -2.97091e-17)
(851.84 -4.02575e-13 0)
(851.84 -4.59329e-13 -3.48429e-17)
(851.84 -5.39955e-13 0)
(851.84 -4.25185e-13 -6.00659e-17)
(851.84 -3.53863e-13 -1.00463e-16)
(851.84 -7.13213e-13 0)
(851.84 -6.68339e-13 0)
(851.84 -4.09246e-13 0)
(851.84 -4.98955e-13 -3.68515e-17)
(851.84 -4.34915e-13 0)
(851.84 -4.60088e-13 0)
(851.84 -4.37099e-13 -3.06242e-17)
(851.84 4.33322e-12 -3.11351e-17)
(851.84 7.45932e-11 0)
(851.84 9.5725e-10 -3.05066e-17)
(851.84 1.81224e-08 -9.18886e-17)
(851.84 2.57117e-07 0)
(851.84 4.53245e-06 -3.09281e-17)
(851.84 7.06087e-05 9.3261e-17)
(851.839 0.000919316 -9.36325e-17)
(851.827 0.0177734 0)
(851.645 0.262359 -9.50281e-17)
(849.602 4.13348 -3.43499e-17)
(836.144 24.2796 -1.08625e-16)
(769.095 167.807 0)
(738.473 81.7365 -5.37837e-17)
(716.36 181.051 -1.69046e-16)
(711.929 186.429 1.58763e-16)
(709.071 187.44 -1.57165e-16)
(706.317 189.616 0)
(706.111 193.773 -1.54266e-16)
(706.078 194.597 5.27532e-17)
(707.335 191.697 -1.4385e-16)
(851.84 5.90438e-13 -5.40283e-32)
(851.84 5.55186e-13 3.6169e-17)
(851.84 -2.506e-13 -3.02806e-17)
(851.84 -2.08002e-13 0)
(851.84 -2.63463e-13 0)
(851.84 -3.44242e-13 2.71071e-17)
(851.84 -5.87934e-13 2.44382e-17)
(851.84 -5.75299e-13 2.48466e-17)
(851.84 -4.10277e-13 -2.49523e-17)
(851.84 -4.57829e-13 0)
(851.84 -3.59052e-13 0)
(851.84 -1.87982e-13 -3.00305e-17)
(851.84 -4.80726e-15 2.74004e-17)
(851.84 -2.61182e-14 -2.52249e-17)
(851.84 1.12239e-13 -2.51971e-17)
(851.84 5.80693e-14 -2.58392e-17)
(851.84 9.70381e-14 -2.93843e-17)
(851.84 1.4827e-13 -5.90225e-17)
(851.84 2.49194e-13 -2.73981e-17)
(851.84 4.48123e-13 -2.96594e-17)
(851.84 4.4733e-13 -4.045e-33)
(851.84 1.68268e-13 -2.6288e-17)
(851.84 1.6036e-13 -3.01267e-17)
(851.84 1.166e-13 5.90785e-17)
(851.84 5.65407e-15 -3.08195e-17)
(851.84 -1.81922e-13 -3.86316e-17)
(851.84 -1.64758e-14 1.92018e-32)
(851.84 -2.43614e-13 5.93513e-32)
(851.84 -2.42102e-13 3.28898e-17)
(851.84 -2.09481e-13 -3.11957e-17)
(851.84 -5.39877e-14 -2.84176e-17)
(851.84 -2.94507e-13 -2.86521e-17)
(851.84 -1.76813e-13 -1.16316e-32)
(851.84 -2.68863e-13 0)
(851.84 9.01867e-14 -3.45611e-17)
(851.84 -3.31842e-14 3.24903e-32)
(851.84 3.19978e-14 -5.86933e-17)
(851.84 -1.6371e-14 -3.23448e-17)
(851.84 -4.24795e-13 -3.22369e-17)
(851.84 -5.78791e-13 2.81534e-17)
(851.84 -6.42261e-13 -3.22061e-17)
(851.84 -2.8129e-13 9.92494e-32)
(851.84 -6.37689e-13 -3.26739e-17)
(851.84 -4.98237e-13 9.87553e-33)
(851.84 -3.19006e-13 0)
(851.84 -4.33675e-13 -3.02889e-17)
(851.84 -3.13963e-13 -4.11835e-32)
(851.84 -3.6419e-13 -3.04269e-17)
(851.84 -3.43581e-13 -2.93002e-17)
(851.84 -4.1116e-13 0)
(851.84 -3.39911e-13 -1.26722e-32)
(851.84 -2.03321e-13 -3.11597e-17)
(851.84 -3.7065e-13 -3.0402e-17)
(851.84 -1.81831e-13 -6.03718e-17)
(851.84 1.23574e-13 2.97043e-17)
(851.84 3.07726e-12 -2.98499e-17)
(851.84 3.52765e-11 1.94959e-29)
(851.84 6.86871e-10 3.19492e-28)
(851.84 8.94405e-09 -3.08237e-17)
(851.84 1.64552e-07 3.09778e-17)
(851.84 1.95339e-06 -6.22278e-17)
(851.84 3.65265e-05 1.70042e-23)
(851.84 0.000439703 -3.13592e-17)
(851.833 0.00862661 3.96371e-21)
(851.729 0.128784 -6.33705e-17)
(850.248 2.71214 3.25758e-17)
(833.301 22.3798 -3.21837e-17)
(802.546 104.653 3.01744e-17)
(749.848 176.363 1.56768e-17)
(703.955 171.519 -1.1158e-16)
(703.487 180.082 5.19721e-17)
(713.064 180.828 -4.94862e-17)
(711.401 194.027 1.19058e-18)
(710.038 193.721 -9.32659e-17)
(708.479 189.622 6.15279e-20)
(851.84 2.47256e-13 -2.64046e-17)
(851.84 3.3125e-13 -5.21515e-17)
(851.84 1.58076e-13 4.86756e-17)
(851.84 -4.91129e-14 0)
(851.84 -2.68339e-13 0)
(851.84 -2.66861e-13 0)
(851.84 -2.78678e-13 0)
(851.84 -2.41718e-13 0)
(851.84 -2.54785e-13 0)
(851.84 -2.80127e-13 0)
(851.84 -1.8934e-13 0)
(851.84 -1.56652e-13 0)
(851.84 -4.58424e-14 0)
(851.84 2.02008e-13 0)
(851.84 4.26769e-13 9.06049e-32)
(851.84 4.4939e-13 3.31561e-32)
(851.84 3.63915e-13 -6.28644e-32)
(851.84 3.70133e-13 1.62985e-32)
(851.84 2.95607e-14 -2.89511e-17)
(851.84 -2.38873e-13 -1.36949e-31)
(851.84 -3.85059e-14 2.69257e-17)
(851.84 8.09371e-14 3.62048e-32)
(851.84 1.91207e-13 3.63358e-32)
(851.84 -4.39986e-14 -5.31074e-17)
(851.84 -8.02912e-14 -4.58584e-32)
(851.84 -1.8567e-13 3.28442e-17)
(851.84 -2.6292e-13 4.296e-17)
(851.84 -3.93154e-13 -1.12275e-31)
(851.84 -1.15579e-13 -5.30925e-17)
(851.84 1.33759e-14 7.42617e-32)
(851.84 3.14026e-13 3.8196e-32)
(851.84 -3.46019e-13 3.34831e-17)
(851.84 -4.95731e-13 -1.31639e-31)
(851.84 -3.97568e-13 -2.75061e-17)
(851.84 -2.33419e-13 2.97962e-17)
(851.84 -7.06429e-13 -4.2969e-32)
(851.84 -5.84944e-13 2.74233e-17)
(851.84 -6.18343e-13 3.55473e-32)
(851.84 -7.80193e-13 2.99623e-17)
(851.84 -1.55033e-12 -3.22274e-17)
(851.84 -1.14303e-12 2.96625e-17)
(851.84 -1.187e-12 2.99014e-17)
(851.84 -5.68703e-13 6.02759e-32)
(851.84 -3.97314e-13 3.57915e-17)
(851.84 -4.99061e-14 0)
(851.84 -4.02078e-13 4.94995e-32)
(851.84 -3.70599e-13 3.21838e-17)
(851.84 -4.23582e-13 3.6265e-17)
(851.84 -4.80189e-13 3.30518e-17)
(851.84 -4.6059e-13 0)
(851.84 -5.19643e-13 3.45034e-17)
(851.84 -7.55757e-15 2.0056e-31)
(851.84 -1.19516e-13 3.52425e-17)
(851.84 1.79154e-13 3.01196e-17)
(851.84 6.67336e-13 -3.73356e-17)
(851.84 -2.42064e-13 3.70996e-17)
(851.84 1.20087e-12 3.05421e-17)
(851.84 1.74445e-11 1.02651e-29)
(851.84 3.53388e-10 3.08703e-17)
(851.84 4.21599e-09 0)
(851.84 7.97798e-08 3.63588e-26)
(851.84 9.1051e-07 5.70245e-25)
(851.84 2.30457e-05 3.13462e-17)
(851.84 0.000174593 3.14561e-17)
(851.835 0.008564 3.15931e-17)
(851.759 0.0289508 0)
(850.313 3.98177 8.64541e-19)
(844.113 9.67799 3.67851e-17)
(798.046 134.406 1.5763e-17)
(759.746 21.7927 5.73045e-17)
(705.159 236.75 0)
(703.893 213.936 4.86376e-17)
(706.701 207.21 4.30531e-17)
(705.286 199.609 -4.87617e-19)
(705.65 187.811 4.76561e-17)
(851.84 -9.60256e-14 0)
(851.84 -1.2118e-13 2.6294e-17)
(851.84 5.4153e-14 -3.11764e-32)
(851.84 1.47079e-13 0)
(851.84 -2.3361e-13 0)
(851.84 -2.8777e-13 0)
(851.84 1.45561e-14 -2.68227e-17)
(851.84 1.09584e-13 0)
(851.84 1.91072e-14 0)
(851.84 4.11175e-13 0)
(851.84 3.8724e-13 0)
(851.84 3.44852e-13 0)
(851.84 3.42703e-13 0)
(851.84 1.31705e-13 0)
(851.84 2.70529e-13 -4.23586e-32)
(851.84 6.737e-13 2.5694e-17)
(851.84 5.82361e-13 2.58522e-17)
(851.84 3.22269e-13 2.68939e-17)
(851.84 3.69851e-13 2.7204e-17)
(851.84 2.39136e-13 5.24345e-17)
(851.84 -2.76254e-14 -2.60316e-17)
(851.84 -1.18852e-14 -4.19017e-32)
(851.84 1.67889e-13 6.51366e-17)
(851.84 3.83681e-13 3.37772e-17)
(851.84 1.69863e-13 -9.72817e-32)
(851.84 -7.15945e-15 2.89283e-17)
(851.84 -7.91739e-14 0)
(851.84 -2.06963e-14 8.48614e-32)
(851.84 -1.08262e-13 5.56344e-17)
(851.84 8.07679e-16 -9.10257e-32)
(851.84 -3.9189e-13 3.36887e-17)
(851.84 -4.89206e-13 -2.89892e-17)
(851.84 -2.88301e-13 3.14536e-17)
(851.84 -7.63988e-13 3.15992e-17)
(851.84 -7.9833e-13 0)
(851.84 -1.28844e-12 3.18269e-17)
(851.84 -1.05042e-12 0)
(851.84 -1.72493e-12 3.67665e-17)
(851.84 -1.65245e-12 0)
(851.84 -1.51739e-12 2.96537e-17)
(851.84 -1.29978e-12 -2.81163e-17)
(851.84 -1.26568e-12 2.79819e-17)
(851.84 -1.12627e-12 5.6706e-17)
(851.84 -1.05295e-12 0)
(851.84 -1.22143e-12 3.24489e-17)
(851.84 -7.24706e-13 3.37704e-17)
(851.84 -7.46691e-13 -3.40368e-17)
(851.84 -5.9906e-13 0)
(851.84 -4.01961e-13 0)
(851.84 -3.10405e-13 -3.4302e-17)
(851.84 -2.99791e-13 0)
(851.84 -2.33214e-13 2.9899e-17)
(851.84 2.08239e-13 0)
(851.84 -4.19763e-14 0)
(851.84 1.59871e-14 -6.93701e-32)
(851.84 1.45408e-13 0)
(851.84 2.40149e-13 0)
(851.84 1.64202e-12 3.07755e-17)
(851.84 8.67972e-12 3.08894e-17)
(851.84 2.01266e-10 3.10068e-17)
(851.84 1.7949e-09 3.10911e-17)
(851.84 5.45218e-08 6.24298e-17)
(851.84 5.11469e-07 0)
(851.84 1.5782e-05 -3.14715e-17)
(851.84 0.00017382 0)
(851.837 0.00442796 3.17612e-17)
(851.783 0.0675544 3.21386e-17)
(851.239 1.13174 3.22708e-17)
(842.848 10.6692 7.07615e-17)
(823.604 64.9239 -3.22755e-17)
(750.676 144.792 4.29291e-17)
(720.435 160.859 4.90467e-17)
(713.911 188.216 -4.34679e-17)
(711.389 189.109 9.48582e-17)
(710.335 186.529 4.83716e-17)
(851.84 -2.84641e-13 0)
(851.84 -2.17842e-13 2.40575e-17)
(851.84 -6.48525e-14 -5.13708e-17)
(851.84 2.87536e-13 0)
(851.84 5.19963e-14 0)
(851.84 -3.57434e-14 0)
(851.84 -5.76198e-14 3.28717e-17)
(851.84 -1.70973e-14 0)
(851.84 -1.4117e-14 0)
(851.84 2.66918e-13 0)
(851.84 6.15108e-13 -2.56793e-17)
(851.84 6.82151e-13 -2.61441e-17)
(851.84 7.69836e-13 0)
(851.84 6.45535e-13 0)
(851.84 4.9203e-13 2.79903e-17)
(851.84 6.29533e-13 2.81887e-17)
(851.84 5.53984e-13 0)
(851.84 7.20085e-13 0)
(851.84 5.90018e-13 0)
(851.84 3.86177e-13 -3.08282e-17)
(851.84 3.09323e-13 2.60507e-17)
(851.84 3.01477e-13 1.58488e-32)
(851.84 3.09479e-13 -2.78329e-17)
(851.84 3.56689e-13 0)
(851.84 8.45662e-13 6.7954e-17)
(851.84 7.82104e-13 -2.89677e-17)
(851.84 3.47309e-13 0)
(851.84 3.347e-13 5.54115e-17)
(851.84 2.74665e-13 -3.07925e-17)
(851.84 9.28077e-16 5.868e-17)
(851.84 -3.00936e-13 2.8613e-17)
(851.84 -5.89635e-13 6.33087e-17)
(851.84 -5.2667e-13 0)
(851.84 -7.02018e-13 3.24927e-17)
(851.84 -1.11276e-12 0)
(851.84 -8.72067e-13 0)
(851.84 -1.21698e-12 0)
(851.84 -1.29511e-12 0)
(851.84 -1.43143e-12 2.78733e-17)
(851.84 -1.15747e-12 3.20271e-17)
(851.84 -1.2284e-12 4.24654e-32)
(851.84 -1.06427e-12 -1.02854e-31)
(851.84 -1.18529e-12 -2.83757e-17)
(851.84 -9.5462e-13 0)
(851.84 -1.12542e-12 -2.84668e-17)
(851.84 -1.08219e-12 3.07838e-17)
(851.84 -1.08002e-12 6.59439e-17)
(851.84 -6.57821e-13 0)
(851.84 -2.7938e-13 -2.88306e-17)
(851.84 -9.52518e-15 2.92299e-17)
(851.84 -7.80818e-14 0)
(851.84 -4.30765e-13 2.92004e-17)
(851.84 -1.22656e-13 2.96565e-17)
(851.84 -2.82774e-13 0)
(851.84 -3.77711e-13 3.20086e-17)
(851.84 -2.57022e-13 0)
(851.84 -1.77204e-13 3.04353e-17)
(851.84 -2.09811e-13 3.03828e-17)
(851.84 -2.3862e-13 4.75516e-32)
(851.84 2.89943e-12 -6.1235e-17)
(851.84 1.23742e-10 3.11148e-17)
(851.84 1.08886e-09 -8.0497e-28)
(851.84 3.70523e-08 0)
(851.84 3.22205e-07 6.30316e-17)
(851.84 1.09952e-05 -3.16758e-17)
(851.84 8.61948e-05 -3.1832e-17)
(851.838 0.0031529 3.19741e-17)
(851.81 0.0158892 -6.41276e-17)
(851.24 1.36024 -3.39152e-19)
(848.117 4.97925 1.96259e-18)
(815.302 68.0949 -5.08439e-17)
(765.371 97.9525 -2.02832e-17)
(720.452 219.445 9.81288e-18)
(704.855 195.092 -8.41342e-20)
(707.195 189.267 -5.24582e-17)
(851.84 3.39469e-13 -2.41364e-17)
(851.84 -1.33438e-13 -4.81486e-17)
(851.84 -6.63534e-14 -3.95051e-32)
(851.84 -2.90906e-13 2.76539e-17)
(851.84 -3.02051e-13 0)
(851.84 -3.22989e-13 0)
(851.84 -4.33518e-13 0)
(851.84 -4.56196e-13 0)
(851.84 -1.37045e-13 0)
(851.84 1.79204e-13 2.61862e-17)
(851.84 1.12248e-13 2.5693e-17)
(851.84 5.39663e-13 2.56387e-17)
(851.84 4.73401e-13 0)
(851.84 1.61904e-13 3.24585e-17)
(851.84 1.46936e-14 0)
(851.84 1.7027e-14 -2.56654e-17)
(851.84 2.19524e-13 0)
(851.84 3.7818e-13 0)
(851.84 3.41563e-13 -2.73524e-17)
(851.84 2.85732e-13 0)
(851.84 1.08674e-13 0)
(851.84 5.4543e-13 3.30212e-17)
(851.84 1.50653e-13 0)
(851.84 2.70482e-13 0)
(851.84 1.12623e-13 -3.18788e-17)
(851.84 5.08011e-13 0)
(851.84 4.22326e-13 2.64927e-17)
(851.84 2.44544e-13 -3.26532e-17)
(851.84 1.12867e-13 0)
(851.84 6.60182e-14 -2.717e-17)
(851.84 -1.13542e-13 6.204e-32)
(851.84 -2.24105e-13 -2.70429e-17)
(851.84 -7.20925e-13 2.74028e-17)
(851.84 -6.95734e-13 -5.47467e-17)
(851.84 -8.1937e-13 2.76245e-17)
(851.84 -8.75694e-13 0)
(851.84 -1.0761e-12 2.74618e-17)
(851.84 -9.572e-13 3.4852e-17)
(851.84 -7.91116e-13 -3.41233e-17)
(851.84 -9.96496e-13 8.1853e-33)
(851.84 -1.10966e-12 -7.20336e-32)
(851.84 -1.27554e-12 -3.21117e-17)
(851.84 -1.30714e-12 0)
(851.84 -1.09869e-12 3.52482e-17)
(851.84 -9.07991e-13 0)
(851.84 -7.40477e-13 -1.65169e-31)
(851.84 -8.75744e-13 -3.71447e-17)
(851.84 -5.90683e-13 0)
(851.84 -5.1739e-13 5.54432e-32)
(851.84 -5.73455e-13 0)
(851.84 -1.29796e-13 2.90999e-17)
(851.84 -1.82474e-13 -3.52181e-17)
(851.84 -4.28359e-13 -7.11166e-17)
(851.84 -3.51126e-13 3.01519e-17)
(851.84 -5.69076e-13 0)
(851.84 -4.79672e-13 -3.49796e-17)
(851.84 -4.92224e-13 -3.23701e-17)
(851.84 -1.83828e-13 2.74819e-32)
(851.84 -2.53465e-13 -3.36722e-17)
(851.84 5.49224e-13 3.49365e-17)
(851.84 3.76183e-12 -1.99963e-30)
(851.84 7.10893e-11 -3.12135e-17)
(851.84 8.01344e-10 0)
(851.84 2.01489e-08 -3.1547e-17)
(851.84 2.37338e-07 3.1696e-17)
(851.84 5.28237e-06 0)
(851.84 7.43507e-05 -3.1952e-17)
(851.839 0.00132521 3.20858e-17)
(851.818 0.0348304 -3.241e-17)
(851.576 0.288521 3.26954e-17)
(847.206 9.16982 0)
(829.401 36.67 -5.14722e-17)
(756.854 187.223 5.30266e-17)
(728.311 112.443 -5.93621e-17)
(710.107 186.53 0)
(851.84 3.86007e-13 2.57039e-17)
(851.84 4.20895e-13 2.40907e-17)
(851.84 3.54652e-13 2.45585e-17)
(851.84 9.93989e-14 -2.42831e-17)
(851.84 -7.34973e-14 0)
(851.84 -1.57577e-13 0)
(851.84 4.88391e-14 0)
(851.84 2.50453e-13 0)
(851.84 3.5733e-13 0)
(851.84 1.99092e-13 -2.50552e-17)
(851.84 5.33504e-14 0)
(851.84 -1.67594e-13 0)
(851.84 -2.99561e-13 0)
(851.84 -1.89553e-13 -3.15215e-17)
(851.84 5.35372e-15 0)
(851.84 3.32628e-14 -2.57128e-17)
(851.84 -1.32058e-13 -2.66609e-17)
(851.84 2.16202e-13 0)
(851.84 4.97356e-14 2.73795e-17)
(851.84 2.78342e-13 0)
(851.84 -1.92082e-13 -2.94896e-17)
(851.84 1.98483e-13 0)
(851.84 2.07326e-13 -2.60592e-17)
(851.84 -6.73106e-14 -2.66265e-17)
(851.84 6.36311e-14 0)
(851.84 8.36455e-14 -2.67431e-17)
(851.84 3.83957e-13 -3.07147e-17)
(851.84 1.08974e-14 0)
(851.84 -1.75221e-13 0)
(851.84 -3.17845e-14 -2.72671e-17)
(851.84 6.40106e-14 -2.69094e-17)
(851.84 -2.25953e-13 0)
(851.84 -5.44909e-14 -3.22288e-17)
(851.84 -3.94061e-13 3.21881e-17)
(851.84 -4.3934e-13 -5.5292e-17)
(851.84 -5.53229e-13 0)
(851.84 -9.23617e-13 1.41081e-31)
(851.84 -9.00554e-13 -2.8779e-17)
(851.84 -6.40756e-13 0)
(851.84 -7.62294e-13 -3.52201e-17)
(851.84 -6.29879e-13 3.38399e-17)
(851.84 -7.94815e-13 2.89803e-17)
(851.84 -8.43324e-13 2.84569e-17)
(851.84 -1.04381e-12 2.03651e-32)
(851.84 -1.17576e-12 0)
(851.84 -1.2596e-12 1.64968e-32)
(851.84 -1.03205e-12 2.89864e-17)
(851.84 -8.0095e-13 0)
(851.84 -1.0354e-12 6.53715e-17)
(851.84 -7.85739e-13 0)
(851.84 -5.60561e-13 -5.93325e-17)
(851.84 -6.04942e-13 0)
(851.84 -7.62475e-13 5.87487e-17)
(851.84 -7.62403e-13 -3.45517e-17)
(851.84 -6.50922e-13 0)
(851.84 -1.54949e-13 6.9742e-17)
(851.84 -1.71345e-13 0)
(851.84 -4.20342e-13 -3.27717e-17)
(851.84 9.9419e-14 0)
(851.84 3.57749e-13 3.19007e-17)
(851.84 1.8913e-13 -3.04211e-17)
(851.84 1.20067e-12 3.08738e-17)
(851.84 4.21377e-11 0)
(851.84 4.49611e-10 3.15553e-17)
(851.84 1.16946e-08 3.16972e-17)
(851.84 1.48012e-07 -3.18314e-17)
(851.84 3.23408e-06 0)
(851.84 5.55369e-05 3.21497e-17)
(851.839 0.00086582 3.23016e-17)
(851.827 0.0178103 3.23908e-17)
(851.581 0.310026 3.27449e-17)
(849.153 6.15192 0)
(822.177 31.8915 3.24314e-17)
(779.64 132.818 0)
(726.615 186.18 4.3577e-17)
(851.84 1.12885e-13 0)
(851.84 5.53462e-14 -2.41065e-17)
(851.84 6.96444e-14 -2.78761e-17)
(851.84 1.45521e-13 2.74938e-17)
(851.84 1.82115e-13 -2.94605e-17)
(851.84 2.24013e-13 0)
(851.84 2.04995e-13 0)
(851.84 2.15895e-13 0)
(851.84 3.95329e-13 0)
(851.84 1.58325e-13 0)
(851.84 -2.07491e-14 0)
(851.84 -1.2143e-13 0)
(851.84 -1.02362e-13 0)
(851.84 2.10739e-13 0)
(851.84 3.26058e-13 0)
(851.84 3.38252e-13 2.60496e-17)
(851.84 5.48705e-14 2.59582e-17)
(851.84 -1.1675e-13 0)
(851.84 -3.79861e-14 -2.56637e-17)
(851.84 2.22362e-14 0)
(851.84 9.4683e-14 3.12748e-17)
(851.84 -1.60512e-13 0)
(851.84 -2.58308e-14 2.99906e-17)
(851.84 1.59559e-13 2.83844e-17)
(851.84 1.72746e-14 -2.76668e-17)
(851.84 -1.34483e-14 3.13866e-17)
(851.84 -1.18122e-13 0)
(851.84 -6.98071e-14 0)
(851.84 -9.0175e-14 3.07818e-17)
(851.84 -3.4074e-13 2.82242e-17)
(851.84 -5.46851e-13 2.94144e-17)
(851.84 -7.19818e-13 2.97509e-17)
(851.84 -8.65338e-13 2.72854e-17)
(851.84 -7.51717e-13 0)
(851.84 -5.56315e-13 3.05373e-17)
(851.84 -8.44633e-13 0)
(851.84 -5.7751e-13 -3.58599e-17)
(851.84 -7.03736e-13 0)
(851.84 -6.05947e-13 0)
(851.84 -4.36963e-13 0)
(851.84 -3.22047e-13 0)
(851.84 -6.73263e-13 -3.23064e-17)
(851.84 -9.93052e-13 -2.84366e-17)
(851.84 -1.34305e-12 -2.83022e-17)
(851.84 -1.23738e-12 2.86626e-17)
(851.84 -1.30803e-12 -2.86737e-17)
(851.84 -1.1035e-12 -6.47639e-17)
(851.84 -1.05196e-12 3.40838e-17)
(851.84 -7.84839e-13 -3.03554e-17)
(851.84 -8.68138e-13 3.50348e-17)
(851.84 -7.85681e-13 3.54285e-17)
(851.84 -5.35139e-13 0)
(851.84 -6.20419e-13 -3.00198e-17)
(851.84 -5.37143e-13 -3.50736e-17)
(851.84 2.07835e-13 0)
(851.84 3.93461e-13 -6.5788e-17)
(851.84 2.96868e-13 0)
(851.84 7.78404e-14 0)
(851.84 -2.60182e-13 0)
(851.84 8.2772e-14 -3.08835e-17)
(851.84 1.52648e-13 0)
(851.84 3.18978e-13 -3.14951e-17)
(851.84 1.68011e-12 0)
(851.84 2.01552e-11 -3.14231e-17)
(851.84 3.29864e-10 -3.16959e-17)
(851.84 6.02104e-09 3.18573e-17)
(851.84 1.1623e-07 0)
(851.84 1.66096e-06 -3.21693e-17)
(851.84 3.8508e-05 -6.45563e-17)
(851.84 0.00043452 -3.24117e-17)
(851.831 0.0164115 -6.51822e-17)
(851.679 0.149365 0)
(848.765 6.28114 -3.50258e-17)
(834.952 35.4599 -3.27176e-17)
(766.623 124.204 -4.95101e-17)
(851.84 2.14656e-14 0)
(851.84 2.92206e-13 4.76127e-32)
(851.84 -2.31797e-13 2.6952e-17)
(851.84 -2.02401e-13 -2.48694e-17)
(851.84 -4.98238e-14 2.5749e-17)
(851.84 1.24569e-13 0)
(851.84 1.18729e-13 0)
(851.84 4.24455e-13 3.31385e-17)
(851.84 -8.60566e-14 0)
(851.84 -9.91909e-14 -2.48243e-17)
(851.84 1.49995e-14 2.72217e-17)
(851.84 2.60546e-13 0)
(851.84 3.17441e-13 0)
(851.84 4.27918e-13 3.1552e-17)
(851.84 4.87297e-13 0)
(851.84 4.02617e-13 0)
(851.84 4.45277e-13 0)
(851.84 9.46038e-14 0)
(851.84 9.16324e-14 4.44624e-33)
(851.84 -4.98232e-14 0)
(851.84 -1.85326e-14 0)
(851.84 -4.19689e-13 0)
(851.84 -2.18924e-13 0)
(851.84 -3.49479e-14 0)
(851.84 -1.74117e-13 3.12933e-17)
(851.84 -5.74273e-13 0)
(851.84 -4.43817e-13 0)
(851.84 -5.19992e-13 0)
(851.84 -4.94029e-13 -2.68713e-17)
(851.84 -7.54336e-13 0)
(851.84 -9.00757e-13 -5.85016e-17)
(851.84 -9.02235e-13 -3.41265e-32)
(851.84 -1.01724e-12 -2.73064e-17)
(851.84 -9.39858e-13 0)
(851.84 -5.63915e-13 0)
(851.84 -4.6832e-13 2.76344e-17)
(851.84 -5.05143e-13 -3.15845e-17)
(851.84 -2.2571e-13 0)
(851.84 -4.84077e-13 0)
(851.84 -3.07685e-13 0)
(851.84 -5.23083e-13 0)
(851.84 -5.72284e-13 2.85388e-17)
(851.84 -4.52977e-13 0)
(851.84 -5.00018e-13 0)
(851.84 -5.07511e-13 -3.55028e-17)
(851.84 -2.13848e-13 -3.54245e-17)
(851.84 -3.21686e-13 5.83876e-17)
(851.84 -3.6682e-13 1.1128e-31)
(851.84 -8.115e-13 -3.96873e-17)
(851.84 -5.8155e-13 -3.44191e-17)
(851.84 -9.75218e-13 0)
(851.84 -1.75594e-13 0)
(851.84 -2.25321e-13 0)
(851.84 3.66614e-13 2.95503e-17)
(851.84 5.71146e-13 0)
(851.84 6.11704e-13 3.44883e-17)
(851.84 7.98339e-13 0)
(851.84 9.85313e-13 0)
(851.84 1.24993e-12 3.52658e-17)
(851.84 7.39062e-13 0)
(851.84 6.74492e-13 0)
(851.84 9.82075e-13 3.10564e-17)
(851.84 6.48499e-13 0)
(851.84 1.04213e-12 3.16277e-17)
(851.84 1.21813e-11 -3.20565e-17)
(851.84 1.9418e-10 -3.18693e-17)
(851.84 3.61626e-09 -3.20433e-17)
(851.84 5.8854e-08 3.21607e-17)
(851.84 1.14465e-06 3.22906e-17)
(851.84 2.04625e-05 3.2422e-17)
(851.84 0.000439834 2.15589e-22)
(851.834 0.00722653 0)
(851.696 0.228429 3.29836e-17)
(849.969 3.021 6.71209e-17)
(817.246 59.715 0)
(851.84 -1.02931e-13 2.78957e-17)
(851.84 1.14148e-13 5.30696e-17)
(851.84 8.21002e-14 2.62445e-17)
(851.84 1.78127e-13 2.67899e-17)
(851.84 1.5328e-13 0)
(851.84 4.86026e-13 0)
(851.84 2.90202e-13 -3.04848e-17)
(851.84 2.03622e-13 -3.06993e-17)
(851.84 -1.94726e-13 0)
(851.84 -2.06191e-13 2.51385e-17)
(851.84 -2.67332e-13 -2.52413e-17)
(851.84 -2.25077e-13 0)
(851.84 -1.96981e-13 0)
(851.84 4.45099e-14 -3.3225e-17)
(851.84 7.65032e-14 0)
(851.84 1.53161e-13 0)
(851.84 -2.59263e-14 0)
(851.84 4.32139e-14 0)
(851.84 3.94397e-13 2.75385e-17)
(851.84 2.99214e-13 2.57794e-17)
(851.84 -2.74484e-14 0)
(851.84 -5.09789e-13 0)
(851.84 -5.44543e-13 0)
(851.84 -7.6837e-13 0)
(851.84 -8.07384e-13 0)
(851.84 -8.57489e-13 0)
(851.84 -7.95527e-13 0)
(851.84 -1.00553e-12 0)
(851.84 -1.37531e-12 0)
(851.84 -1.36939e-12 0)
(851.84 -1.16774e-12 3.33304e-17)
(851.84 -1.15122e-12 -7.065e-17)
(851.84 -8.89781e-13 2.98058e-17)
(851.84 -6.33454e-13 -3.33947e-17)
(851.84 -7.97869e-13 0)
(851.84 -4.3217e-13 -5.78389e-17)
(851.84 -3.84058e-13 2.96724e-17)
(851.84 -3.14841e-13 0)
(851.84 -3.77351e-13 -3.11675e-17)
(851.84 -4.78604e-13 0)
(851.84 -6.16863e-13 -3.42101e-17)
(851.84 -3.93527e-13 -3.48691e-17)
(851.84 6.11136e-14 -3.56223e-17)
(851.84 2.07637e-13 0)
(851.84 4.67088e-13 2.85271e-17)
(851.84 5.08102e-13 3.09298e-17)
(851.84 6.34225e-13 -3.16502e-17)
(851.84 6.29418e-13 -5.87931e-17)
(851.84 6.60359e-13 3.47624e-17)
(851.84 -1.63387e-14 -4.3828e-17)
(851.84 2.67414e-13 0)
(851.84 1.4497e-13 -3.27273e-17)
(851.84 -2.50372e-14 0)
(851.84 6.72733e-13 0)
(851.84 8.4284e-13 -3.19321e-17)
(851.84 8.58335e-13 0)
(851.84 1.1506e-12 -3.23211e-17)
(851.84 1.36586e-12 3.26017e-17)
(851.84 1.68768e-12 -6.55433e-17)
(851.84 1.83085e-12 0)
(851.84 1.34348e-12 0)
(851.84 1.3924e-12 -3.0724e-17)
(851.84 1.05523e-12 -3.53057e-17)
(851.84 3.61024e-13 -3.75217e-17)
(851.84 1.66943e-12 3.33876e-17)
(851.84 5.74775e-12 3.24007e-17)
(851.84 1.36328e-10 5.64449e-29)
(851.84 1.38396e-09 -3.21587e-17)
(851.84 5.07839e-08 0)
(851.84 4.6419e-07 -3.24234e-17)
(851.84 2.1994e-05 6.511e-17)
(851.84 0.000161819 -3.26708e-17)
(851.833 0.0126043 -3.93653e-21)
(851.668 0.0591084 -3.29647e-17)
(844.7 14.173 0)
(851.84 -1.68098e-13 -3.24592e-17)
(851.84 -1.07699e-13 1.86978e-32)
(851.84 1.27321e-13 -2.44283e-17)
(851.84 4.71574e-13 -3.493e-33)
(851.84 6.09652e-13 0)
(851.84 7.79984e-13 0)
(851.84 1.24578e-13 2.86904e-17)
(851.84 1.1836e-13 0)
(851.84 -3.19084e-13 3.05755e-17)
(851.84 3.25238e-13 0)
(851.84 -6.89443e-13 0)
(851.84 -7.86976e-13 0)
(851.84 -1.06753e-12 0)
(851.84 -5.01138e-13 3.09537e-17)
(851.84 -3.60126e-13 0)
(851.84 -4.36636e-13 0)
(851.84 -4.09657e-13 0)
(851.84 1.13727e-13 3.02803e-17)
(851.84 -2.29918e-14 2.60701e-17)
(851.84 -1.12408e-13 -2.57981e-17)
(851.84 -3.07529e-13 0)
(851.84 -2.51438e-13 0)
(851.84 -1.01738e-12 0)
(851.84 -1.29793e-12 0)
(851.84 -1.22341e-12 2.99248e-17)
(851.84 -1.09958e-12 3.12672e-17)
(851.84 -1.2441e-12 0)
(851.84 -1.09462e-12 0)
(851.84 -1.05969e-12 0)
(851.84 -9.3052e-13 0)
(851.84 -9.96733e-13 0)
(851.84 -7.07289e-13 3.08469e-17)
(851.84 -5.89915e-13 -3.21049e-17)
(851.84 -5.33142e-13 3.46171e-17)
(851.84 -4.22735e-13 2.89622e-17)
(851.84 -2.55176e-13 2.7973e-17)
(851.84 -3.00142e-14 0)
(851.84 -6.7686e-14 0)
(851.84 -2.32464e-14 5.87843e-32)
(851.84 -2.00228e-14 0)
(851.84 1.45288e-13 5.67996e-17)
(851.84 -9.0109e-14 2.81363e-17)
(851.84 2.8337e-13 0)
(851.84 3.74996e-13 0)
(851.84 2.55169e-13 -5.96944e-17)
(851.84 2.61691e-13 3.36544e-17)
(851.84 3.89735e-13 0)
(851.84 4.1852e-13 3.25994e-17)
(851.84 5.16055e-13 0)
(851.84 4.37738e-13 3.01867e-17)
(851.84 4.32903e-13 0)
(851.84 1.62993e-13 6.5204e-17)
(851.84 1.69602e-13 3.00813e-17)
(851.84 3.12416e-13 0)
(851.84 4.46409e-13 2.22815e-32)
(851.84 1.41549e-12 0)
(851.84 1.5576e-12 7.14218e-17)
(851.84 1.67877e-12 -3.59888e-17)
(851.84 1.68186e-12 3.11431e-17)
(851.84 1.60008e-12 0)
(851.84 1.62925e-12 0)
(851.84 8.50724e-13 0)
(851.84 6.9482e-13 3.19434e-17)
(851.84 5.02281e-13 0)
(851.84 2.12318e-13 0)
(851.84 -1.32684e-13 0)
(851.84 3.83583e-12 3.18167e-17)
(851.84 5.43187e-11 0)
(851.84 1.62222e-09 3.22813e-17)
(851.84 2.08091e-08 0)
(851.84 9.10528e-07 -3.24795e-17)
(851.84 9.26998e-06 8.88647e-24)
(851.839 0.000961574 -3.26968e-17)
(851.819 0.00128623 0)
(850.765 2.26037 0)
(851.84 -2.51524e-14 0)
(851.84 -1.86141e-13 -2.42937e-17)
(851.84 1.51224e-14 2.44451e-17)
(851.84 2.70375e-13 -1.7477e-32)
(851.84 2.59385e-13 0)
(851.84 3.00645e-13 0)
(851.84 2.35982e-13 0)
(851.84 3.36503e-13 0)
(851.84 1.78565e-13 -2.49911e-17)
(851.84 -1.90546e-13 0)
(851.84 -4.18978e-13 0)
(851.84 -7.17031e-13 0)
(851.84 -5.51092e-13 0)
(851.84 -2.25904e-13 -3.16833e-17)
(851.84 -5.98508e-13 0)
(851.84 -9.1936e-13 0)
(851.84 -6.45954e-13 0)
(851.84 -6.28312e-13 -3.04425e-17)
(851.84 -1.05582e-12 -3.09306e-17)
(851.84 -7.98676e-13 0)
(851.84 -7.58214e-13 0)
(851.84 -6.61145e-13 0)
(851.84 -4.92202e-13 0)
(851.84 -6.48531e-13 0)
(851.84 -8.53848e-13 -3.08821e-17)
(851.84 -1.13343e-12 -3.30009e-17)
(851.84 -1.3208e-12 0)
(851.84 -1.06255e-12 0)
(851.84 -1.12062e-12 0)
(851.84 -1.05686e-12 3.12337e-17)
(851.84 -8.05498e-13 2.75871e-17)
(851.84 -6.71828e-13 0)
(851.84 -2.68936e-13 3.34726e-17)
(851.84 -4.42161e-13 3.41664e-17)
(851.84 -4.26856e-13 -2.70107e-32)
(851.84 -2.13827e-13 0)
(851.84 -2.5843e-13 0)
(851.84 9.54002e-14 0)
(851.84 -1.1383e-13 3.23789e-17)
(851.84 3.50869e-14 0)
(851.84 3.17658e-13 -2.8043e-17)
(851.84 4.08913e-13 -2.82875e-17)
(851.84 5.41671e-13 2.85222e-17)
(851.84 6.50449e-13 0)
(851.84 5.08131e-13 2.891e-17)
(851.84 4.74132e-13 -2.89213e-17)
(851.84 1.96657e-13 0)
(851.84 6.14934e-14 0)
(851.84 2.34047e-13 0)
(851.84 3.97293e-13 0)
(851.84 1.70243e-13 0)
(851.84 5.58599e-13 -3.71877e-17)
(851.84 4.65661e-13 -3.00068e-17)
(851.84 2.95883e-13 0)
(851.84 6.06778e-13 3.16308e-17)
(851.84 1.01109e-12 0)
(851.84 7.44959e-13 -3.59519e-17)
(851.84 1.10753e-12 0)
(851.84 9.12118e-13 0)
(851.84 1.81011e-12 0)
(851.84 1.7054e-12 0)
(851.84 1.4684e-12 0)
(851.84 1.04481e-12 0)
(851.84 1.0004e-12 0)
(851.84 -1.07212e-13 0)
(851.84 -2.68861e-13 3.14452e-17)
(851.84 -7.13424e-13 3.17738e-17)
(851.84 -2.15363e-14 3.22869e-17)
(851.84 6.87627e-11 -3.23312e-17)
(851.84 9.9368e-10 0)
(851.84 6.275e-08 0)
(851.84 7.5742e-07 3.25469e-17)
(851.84 0.000115183 0)
(851.837 0.000582036 0)
(851.718 0.262844 0)
(851.84 1.5167e-13 0)
(851.84 1.64714e-13 0)
(851.84 1.40326e-13 -2.57026e-17)
(851.84 2.99017e-14 -5.22026e-17)
(851.84 7.10018e-14 -2.46565e-17)
(851.84 2.16094e-13 2.45554e-17)
(851.84 3.48453e-13 0)
(851.84 2.50946e-13 0)
(851.84 1.2891e-13 0)
(851.84 1.2605e-13 0)
(851.84 -1.93293e-14 0)
(851.84 3.47774e-13 0)
(851.84 2.48016e-13 2.8894e-17)
(851.84 -6.28776e-13 -3.69379e-17)
(851.84 -9.12318e-13 0)
(851.84 -8.29751e-13 0)
(851.84 -7.39191e-13 0)
(851.84 -9.91357e-13 -3.09382e-17)
(851.84 -1.15228e-12 0)
(851.84 -1.18319e-12 2.70852e-17)
(851.84 -1.04507e-12 0)
(851.84 -9.43349e-13 0)
(851.84 -1.15129e-12 2.62905e-17)
(851.84 -1.06459e-12 0)
(851.84 -1.55726e-12 0)
(851.84 -1.11058e-12 0)
(851.84 -1.15767e-12 0)
(851.84 -1.53407e-12 0)
(851.84 -1.0317e-12 0)
(851.84 -1.23531e-12 3.8629e-32)
(851.84 -1.04949e-12 -6.54726e-17)
(851.84 -7.09236e-13 0)
(851.84 -7.51855e-13 -3.19622e-17)
(851.84 -5.37315e-13 -3.25797e-17)
(851.84 -5.8635e-13 -2.73898e-17)
(851.84 -5.74385e-13 -2.92109e-17)
(851.84 -5.22784e-13 2.95245e-17)
(851.84 -2.25407e-13 0)
(851.84 -2.79775e-14 0)
(851.84 -1.60917e-13 0)
(851.84 -1.49139e-13 2.80651e-17)
(851.84 3.98375e-13 3.09666e-17)
(851.84 1.23588e-13 0)
(851.84 9.45659e-14 2.85759e-17)
(851.84 4.42139e-13 0)
(851.84 6.07575e-13 0)
(851.84 5.5774e-13 2.92459e-17)
(851.84 5.4877e-13 2.98367e-17)
(851.84 3.97279e-13 -3.36416e-17)
(851.84 6.4128e-13 0)
(851.84 4.96896e-13 3.47928e-17)
(851.84 5.72033e-13 0)
(851.84 6.56278e-13 0)
(851.84 5.46662e-13 -3.14824e-17)
(851.84 7.10533e-13 3.77267e-17)
(851.84 6.16961e-13 0)
(851.84 7.32066e-13 0)
(851.84 6.73861e-13 3.48649e-17)
(851.84 5.31422e-13 0)
(851.84 5.88535e-13 3.24636e-17)
(851.84 8.0391e-13 0)
(851.84 8.0248e-13 3.98047e-17)
(851.84 5.78619e-13 0)
(851.84 1.9304e-13 0)
(851.84 6.97304e-13 0)
(851.84 1.69554e-14 -3.44842e-17)
(851.84 -3.08378e-13 -7.74306e-17)
(851.84 -6.57823e-13 4.79055e-32)
(851.84 3.20906e-12 3.21184e-17)
(851.84 7.92108e-11 3.23063e-17)
(851.84 6.31078e-09 0)
(851.84 9.84671e-08 0)
(851.84 1.3727e-05 0)
(851.84 9.31161e-05 3.28927e-17)
(851.83 0.0234559 3.28513e-17)
(851.84 1.89091e-13 -2.41196e-17)
(851.84 3.26921e-13 -2.42051e-17)
(851.84 3.22053e-13 0)
(851.84 -1.36395e-13 2.5576e-17)
(851.84 -1.85357e-13 2.67542e-17)
(851.84 -3.00352e-13 -5.33895e-17)
(851.84 -2.84409e-13 0)
(851.84 -5.24972e-13 -3.14609e-17)
(851.84 -3.58157e-13 -3.25924e-17)
(851.84 1.32785e-13 -2.74861e-17)
(851.84 3.38914e-13 -2.59022e-17)
(851.84 2.14472e-13 -2.9996e-17)
(851.84 -5.94661e-14 -5.80824e-17)
(851.84 -1.7055e-13 7.82372e-32)
(851.84 -7.67546e-13 -2.86549e-17)
(851.84 -8.2261e-13 -2.83705e-17)
(851.84 -1.03266e-12 -2.86257e-17)
(851.84 -1.04334e-12 0)
(851.84 -1.05494e-12 -2.6136e-17)
(851.84 -1.15966e-12 -5.60488e-17)
(851.84 -1.50085e-12 -3.37681e-17)
(851.84 -1.78913e-12 -3.11258e-17)
(851.84 -1.82595e-12 -5.71532e-17)
(851.84 -1.99935e-12 3.11861e-17)
(851.84 -2.06459e-12 -2.81987e-17)
(851.84 -2.0287e-12 -2.64554e-17)
(851.84 -1.91423e-12 -3.05025e-17)
(851.84 -1.69478e-12 -3.88388e-17)
(851.84 -1.33875e-12 -3.30428e-17)
(851.84 -1.21659e-12 -5.45435e-17)
(851.84 -1.11695e-12 2.79534e-17)
(851.84 -8.51878e-13 0)
(851.84 -7.15273e-13 -2.74452e-17)
(851.84 -5.898e-13 0)
(851.84 -6.22421e-13 -3.00804e-17)
(851.84 -4.06435e-13 2.77259e-17)
(851.84 -3.41458e-13 -5.54102e-17)
(851.84 -2.48898e-13 -2.7745e-17)
(851.84 9.7521e-14 0)
(851.84 2.69747e-13 -2.80219e-17)
(851.84 1.03648e-13 -2.80874e-17)
(851.84 2.52386e-13 -2.95128e-17)
(851.84 3.14797e-13 3.49844e-17)
(851.84 4.02282e-13 -7.83486e-17)
(851.84 3.79271e-13 0)
(851.84 6.57787e-13 -3.33554e-17)
(851.84 5.47655e-13 -3.27172e-17)
(851.84 6.91049e-13 -3.29387e-17)
(851.84 7.17864e-13 8.42909e-32)
(851.84 4.58407e-13 0)
(851.84 1.07374e-12 -6.08506e-17)
(851.84 1.15259e-12 0)
(851.84 1.4299e-12 -2.9558e-17)
(851.84 1.48955e-12 0)
(851.84 1.47844e-12 6.81258e-32)
(851.84 1.34566e-12 -3.81536e-17)
(851.84 1.06464e-12 0)
(851.84 4.69195e-13 -7.38151e-17)
(851.84 4.30781e-13 0)
(851.84 5.38026e-13 -3.77906e-17)
(851.84 5.70018e-14 -3.80896e-17)
(851.84 1.94866e-13 -3.27708e-17)
(851.84 4.59896e-13 0)
(851.84 3.02965e-13 0)
(851.84 -6.41722e-14 0)
(851.84 -9.56597e-14 0)
(851.84 -1.07123e-13 3.42491e-17)
(851.84 -2.90356e-13 -3.43673e-17)
(851.84 6.15852e-13 -3.21102e-17)
(851.84 8.67745e-12 -3.21214e-17)
(851.84 7.19332e-10 0)
(851.84 1.09323e-08 3.25932e-17)
(851.84 1.26416e-06 0)
(851.84 8.77967e-06 -3.29507e-17)
(851.839 0.00158611 -3.28822e-17)
(851.84 4.23618e-13 2.41692e-17)
(851.84 5.58033e-13 2.286e-32)
(851.84 4.5161e-13 0)
(851.84 2.19533e-13 0)
(851.84 -3.24061e-13 0)
(851.84 -3.72747e-13 2.45701e-17)
(851.84 -4.81784e-13 0)
(851.84 -3.319e-13 7.05085e-32)
(851.84 6.93817e-14 2.91705e-17)
(851.84 -2.03576e-13 -7.5446e-32)
(851.84 -1.78283e-13 2.50202e-17)
(851.84 -4.72855e-13 -8.32484e-32)
(851.84 -5.94055e-13 2.52049e-17)
(851.84 -7.61106e-13 -9.60248e-32)
(851.84 -6.89431e-13 5.37133e-17)
(851.84 -9.34618e-13 2.63732e-17)
(851.84 -1.25074e-12 -2.34676e-32)
(851.84 -1.52813e-12 3.1262e-17)
(851.84 -1.44402e-12 2.60023e-17)
(851.84 -1.78089e-12 -2.49905e-32)
(851.84 -2.03447e-12 2.94503e-17)
(851.84 -2.15797e-12 -5.77698e-32)
(851.84 -2.05483e-12 5.36571e-17)
(851.84 -2.10765e-12 -3.27084e-17)
(851.84 -1.97425e-12 6.16111e-33)
(851.84 -1.84327e-12 3.64969e-17)
(851.84 -1.83812e-12 3.08975e-17)
(851.84 -1.5437e-12 6.5683e-32)
(851.84 -1.42021e-12 2.69495e-17)
(851.84 -1.16182e-12 1.16172e-32)
(851.84 -1.12807e-12 0)
(851.84 -9.6742e-13 0)
(851.84 -8.31216e-13 2.74028e-17)
(851.84 -6.28051e-13 0)
(851.84 -5.99908e-13 2.97009e-17)
(851.84 -3.85064e-13 0)
(851.84 -1.35543e-13 1.27544e-31)
(851.84 -2.05339e-13 3.0236e-17)
(851.84 -4.154e-13 0)
(851.84 -1.99492e-13 2.8316e-17)
(851.84 -1.26068e-13 0)
(851.84 -3.09406e-13 0)
(851.84 -1.20475e-13 -3.16476e-17)
(851.84 4.91277e-13 3.66348e-17)
(851.84 5.94227e-13 0)
(851.84 9.16118e-13 3.45915e-17)
(851.84 1.06355e-12 0)
(851.84 1.0186e-12 0)
(851.84 9.56289e-13 2.92356e-17)
(851.84 1.08034e-12 0)
(851.84 1.12375e-12 3.73032e-17)
(851.84 1.11016e-12 0)
(851.84 1.48102e-12 3.24286e-17)
(851.84 1.7534e-12 7.87643e-32)
(851.84 1.51294e-12 -3.25989e-17)
(851.84 1.04847e-12 3.29984e-17)
(851.84 9.94208e-13 0)
(851.84 7.34741e-13 3.03393e-17)
(851.84 6.43013e-13 0)
(851.84 3.58833e-13 -3.06475e-17)
(851.84 1.99245e-13 3.2891e-17)
(851.84 5.37961e-14 0)
(851.84 1.15105e-13 0)
(851.84 1.92275e-13 -4.17146e-17)
(851.84 2.69536e-13 0)
(851.84 9.59369e-14 3.4851e-17)
(851.84 2.30238e-13 0)
(851.84 3.4045e-13 -3.62574e-17)
(851.84 -3.68027e-14 3.21469e-17)
(851.84 8.56106e-13 0)
(851.84 6.83616e-11 0)
(851.84 8.71906e-10 -3.26455e-17)
(851.84 9.13857e-08 3.2849e-17)
(851.84 5.74883e-07 0)
(851.84 9.17258e-05 3.29138e-17)
(851.84 3.92027e-13 0)
(851.84 3.1892e-13 2.42381e-17)
(851.84 3.57535e-13 2.81658e-17)
(851.84 4.59547e-13 0)
(851.84 -6.09374e-14 -2.72747e-17)
(851.84 -1.14776e-13 0)
(851.84 -4.28749e-13 -2.88226e-17)
(851.84 -2.38303e-13 3.39579e-17)
(851.84 -6.88024e-14 0)
(851.84 -1.36071e-13 2.64713e-17)
(851.84 -3.75216e-13 2.65743e-17)
(851.84 -2.6254e-13 2.7171e-17)
(851.84 -7.39188e-13 0)
(851.84 -8.45923e-13 2.53163e-17)
(851.84 -9.55517e-13 7.29703e-32)
(851.84 -8.85928e-13 0)
(851.84 -1.23412e-12 5.14126e-17)
(851.84 -1.593e-12 0)
(851.84 -1.82831e-12 0)
(851.84 -2.46632e-12 3.24723e-17)
(851.84 -2.02756e-12 0)
(851.84 -2.06673e-12 2.72995e-17)
(851.84 -2.13824e-12 -2.76376e-17)
(851.84 -1.86769e-12 0)
(851.84 -1.56034e-12 2.63925e-17)
(851.84 -1.45456e-12 0)
(851.84 -1.29124e-12 0)
(851.84 -1.50462e-12 5.84339e-17)
(851.84 -1.28862e-12 2.92047e-17)
(851.84 -1.15389e-12 2.69125e-17)
(851.84 -9.45966e-13 0)
(851.84 -9.56836e-13 0)
(851.84 -7.5196e-13 0)
(851.84 -8.59207e-13 0)
(851.84 -7.06024e-13 0)
(851.84 -6.23259e-13 0)
(851.84 -4.5679e-13 2.84934e-17)
(851.84 -4.67948e-13 -2.87317e-17)
(851.84 -1.30934e-13 2.81608e-17)
(851.84 -1.3754e-13 -2.83386e-17)
(851.84 -2.13863e-13 2.83229e-17)
(851.84 -2.17886e-13 0)
(851.84 4.97138e-14 2.87792e-17)
(851.84 4.29221e-13 -2.8901e-17)
(851.84 6.04088e-13 0)
(851.84 1.26425e-12 0)
(851.84 1.27788e-12 -3.06663e-17)
(851.84 1.25367e-12 0)
(851.84 1.00049e-12 0)
(851.84 9.33125e-13 0)
(851.84 1.11768e-12 0)
(851.84 1.01473e-12 0)
(851.84 9.60704e-13 0)
(851.84 1.36834e-12 3.69547e-17)
(851.84 1.07588e-12 0)
(851.84 7.68884e-13 0)
(851.84 8.27293e-13 0)
(851.84 8.14057e-13 0)
(851.84 5.04274e-13 0)
(851.84 -3.62298e-13 3.32449e-17)
(851.84 -7.69181e-13 3.53567e-17)
(851.84 -4.5985e-13 0)
(851.84 -5.82774e-13 0)
(851.84 -2.60303e-13 3.15732e-17)
(851.84 -8.3758e-14 3.20742e-17)
(851.84 1.61979e-13 -7.55871e-17)
(851.84 4.0703e-13 0)
(851.84 6.76654e-13 4.00586e-17)
(851.84 -9.79835e-14 -3.83517e-17)
(851.84 -1.88901e-13 0)
(851.84 5.36874e-12 0)
(851.84 5.59207e-11 0)
(851.84 5.88921e-09 -3.28891e-17)
(851.84 3.14881e-08 0)
(851.84 5.53045e-06 -3.2939e-17)
(851.84 4.89772e-13 -1.636e-17)
(851.84 2.05715e-13 0)
(851.84 2.12432e-13 -2.47135e-17)
(851.84 4.53077e-13 0)
(851.84 6.35007e-13 1.28067e-17)
(851.84 2.68217e-13 0)
(851.84 2.73521e-13 2.80451e-17)
(851.84 -2.39112e-13 0)
(851.84 -3.98657e-13 -1.25459e-17)
(851.84 -5.95232e-13 1.2482e-17)
(851.84 -7.07058e-13 -2.65602e-17)
(851.84 -8.04152e-13 -1.32787e-17)
(851.84 -1.10159e-12 0)
(851.84 -1.10567e-12 1.39915e-17)
(851.84 -1.34147e-12 -2.92744e-17)
(851.84 -1.37598e-12 1.64932e-17)
(851.84 -1.31306e-12 -1.60994e-17)
(851.84 -1.54849e-12 0)
(851.84 -1.55637e-12 0)
(851.84 -1.40354e-12 0)
(851.84 -1.50241e-12 1.30049e-17)
(851.84 -1.35023e-12 1.30546e-17)
(851.84 -9.96361e-13 0)
(851.84 -1.10638e-12 1.72406e-17)
(851.84 -9.70742e-13 1.58476e-17)
(851.84 -1.21228e-12 0)
(851.84 -1.21549e-12 0)
(851.84 -1.04878e-12 -1.57653e-17)
(851.84 -1.03051e-12 -3.13008e-17)
(851.84 -6.05913e-13 1.34664e-17)
(851.84 -1.00267e-12 0)
(851.84 -8.55808e-13 0)
(851.84 -9.1606e-13 0)
(851.84 -8.19184e-13 0)
(851.84 -6.6069e-13 0)
(851.84 -6.03602e-13 0)
(851.84 -5.24148e-13 0)
(851.84 -5.29007e-13 3.12206e-17)
(851.84 -1.83362e-13 -3.55736e-17)
(851.84 7.82419e-14 3.15412e-17)
(851.84 3.1849e-13 -2.85047e-17)
(851.84 2.21354e-13 0)
(851.84 2.73635e-13 -2.97086e-17)
(851.84 3.50236e-13 3.39205e-17)
(851.84 5.66412e-13 0)
(851.84 9.55411e-13 0)
(851.84 1.17035e-12 3.01634e-17)
(851.84 1.44593e-12 0)
(851.84 1.28605e-12 0)
(851.84 1.20611e-12 0)
(851.84 1.06014e-12 0)
(851.84 1.25565e-12 -1.50202e-17)
(851.84 1.28554e-12 0)
(851.84 9.89762e-13 0)
(851.84 1.11575e-12 0)
(851.84 5.27464e-13 0)
(851.84 6.60682e-13 0)
(851.84 5.65277e-13 -1.64407e-17)
(851.84 4.45035e-13 0)
(851.84 5.73116e-13 -1.63824e-17)
(851.84 1.67565e-13 -3.29227e-17)
(851.84 1.9774e-14 -1.65831e-17)
(851.84 -4.85579e-14 0)
(851.84 -3.1468e-13 0)
(851.84 -3.01214e-13 -5.84317e-17)
(851.84 -2.15995e-13 1.5893e-17)
(851.84 -2.09289e-13 0)
(851.84 -1.14818e-13 -1.72825e-17)
(851.84 3.70217e-13 -1.73028e-17)
(851.84 -7.10275e-14 -1.69355e-17)
(851.84 4.35523e-13 -1.74528e-17)
(851.84 4.57906e-12 0)
(851.84 3.68088e-10 -1.64424e-17)
(851.84 1.75216e-09 -1.65289e-17)
(851.84 3.65091e-07 -1.64798e-17)
(851.84 1.13212e-13 0)
(851.84 1.00124e-13 -1.21674e-17)
(851.84 1.35152e-13 -1.27057e-17)
(851.84 8.05027e-14 0)
(851.84 7.15109e-13 2.89871e-17)
(851.84 5.7842e-13 1.23106e-17)
(851.84 2.95482e-13 1.2886e-17)
(851.84 -4.95805e-14 1.29727e-17)
(851.84 -3.64608e-13 2.72042e-17)
(851.84 -3.69884e-13 -1.35294e-17)
(851.84 -6.40149e-13 1.42741e-17)
(851.84 -7.12897e-13 2.85448e-17)
(851.84 -8.78899e-13 1.26615e-17)
(851.84 -9.07995e-13 4.4562e-32)
(851.84 -9.65269e-13 0)
(851.84 -1.26253e-12 -1.28173e-17)
(851.84 -1.3494e-12 -1.29863e-17)
(851.84 -1.37334e-12 0)
(851.84 -1.53964e-12 -1.35912e-17)
(851.84 -1.46953e-12 0)
(851.84 -1.17398e-12 -1.80186e-32)
(851.84 -1.15362e-12 -1.40937e-17)
(851.84 -1.05611e-12 0)
(851.84 -9.6004e-13 -1.46799e-17)
(851.84 -8.00291e-13 -1.39546e-17)
(851.84 -9.65627e-13 0)
(851.84 -7.83511e-13 0)
(851.84 -5.33176e-13 -1.47775e-17)
(851.84 -7.94725e-13 0)
(851.84 -9.82324e-13 -1.72946e-17)
(851.84 -1.08888e-12 0)
(851.84 -8.30247e-13 1.48531e-17)
(851.84 -6.53409e-13 0)
(851.84 -6.16454e-13 1.36928e-17)
(851.84 -7.39753e-13 0)
(851.84 -7.33374e-13 1.4483e-17)
(851.84 -8.10195e-13 0)
(851.84 -4.24197e-13 0)
(851.84 -2.91473e-13 1.40007e-17)
(851.84 -1.40467e-13 0)
(851.84 3.28105e-13 1.52793e-17)
(851.84 6.47839e-13 0)
(851.84 1.10636e-13 1.55799e-17)
(851.84 2.37256e-13 0)
(851.84 4.18025e-13 1.7676e-17)
(851.84 5.33493e-13 0)
(851.84 1.05575e-12 -1.4641e-17)
(851.84 1.06458e-12 1.56955e-17)
(851.84 8.36618e-13 0)
(851.84 1.05005e-12 1.46315e-17)
(851.84 9.3777e-13 0)
(851.84 7.66705e-13 2.9516e-17)
(851.84 7.93628e-13 0)
(851.84 5.9592e-13 0)
(851.84 5.45129e-13 1.59725e-17)
(851.84 5.14978e-13 0)
(851.84 3.15031e-13 1.52638e-17)
(851.84 1.1449e-13 1.66247e-17)
(851.84 1.80565e-13 1.72944e-17)
(851.84 2.12975e-13 1.57721e-17)
(851.84 5.44757e-13 0)
(851.84 3.55856e-13 3.21029e-32)
(851.84 3.09479e-13 1.72363e-17)
(851.84 6.44632e-14 -1.75588e-17)
(851.84 -1.00254e-13 1.576e-17)
(851.84 -7.09146e-14 -1.6004e-32)
(851.84 -1.07775e-13 1.74942e-17)
(851.84 -3.31616e-13 1.78197e-17)
(851.84 1.36912e-13 -2.30632e-33)
(851.84 1.64119e-13 1.61497e-17)
(851.84 4.76461e-14 -6.92558e-33)
(851.84 -3.17794e-13 1.642e-17)
(851.84 2.20661e-11 1.65975e-17)
(851.84 1.09228e-10 8.3137e-29)
(851.84 2.3234e-08 1.64911e-17)
(851.84 -6.74774e-14 1.31419e-17)
(851.84 4.81902e-14 1.66272e-17)
(851.84 -1.97677e-13 1.575e-17)
(851.84 -2.36522e-13 1.40455e-17)
(851.84 1.48314e-14 -1.36557e-17)
(851.84 2.80034e-13 -2.50301e-32)
(851.84 -4.75775e-14 -2.91788e-17)
(851.84 -1.60293e-13 8.56457e-33)
(851.84 -5.56335e-13 8.26756e-32)
(851.84 -6.6414e-13 1.46137e-17)
(851.84 -9.24285e-13 3.57299e-32)
(851.84 -1.20914e-12 -1.26546e-17)
(851.84 -9.68171e-13 -1.26774e-17)
(851.84 -1.20222e-12 -1.43395e-17)
(851.84 -1.05631e-12 0)
(851.84 -1.41423e-12 1.6433e-17)
(851.84 -1.38654e-12 0)
(851.84 -1.42461e-12 0)
(851.84 -1.52014e-12 1.32332e-17)
(851.84 -1.36897e-12 0)
(851.84 -1.19355e-12 -1.54837e-17)
(851.84 -1.66344e-12 1.64665e-17)
(851.84 -1.57223e-12 0)
(851.84 -1.29739e-12 0)
(851.84 -1.40496e-12 1.33558e-17)
(851.84 -1.19235e-12 0)
(851.84 -9.62859e-13 0)
(851.84 -7.56223e-13 0)
(851.84 -6.79769e-13 0)
(851.84 -8.19296e-13 1.56978e-17)
(851.84 -8.22375e-13 1.58056e-17)
(851.84 -8.36009e-13 -1.60078e-17)
(851.84 -8.66779e-13 0)
(851.84 -7.12949e-13 -1.53323e-17)
(851.84 -6.51945e-13 1.61765e-17)
(851.84 -4.24417e-13 -3.50561e-17)
(851.84 -3.36813e-13 1.7612e-17)
(851.84 3.26306e-14 1.66936e-17)
(851.84 1.84813e-13 -3.5879e-17)
(851.84 1.67416e-13 1.76218e-17)
(851.84 3.85872e-13 -1.7678e-17)
(851.84 5.80623e-13 0)
(851.84 6.16256e-13 -1.72617e-17)
(851.84 6.87971e-13 1.73497e-17)
(851.84 3.36268e-13 -2.89342e-17)
(851.84 4.25897e-13 1.43967e-17)
(851.84 5.2933e-13 1.4587e-17)
(851.84 4.99612e-13 -3.05551e-17)
(851.84 9.72886e-13 1.53683e-17)
(851.84 1.00566e-12 -1.64326e-17)
(851.84 7.65495e-13 0)
(851.84 7.77363e-13 -1.48463e-17)
(851.84 4.7225e-13 1.55647e-17)
(851.84 7.01845e-13 0)
(851.84 1.29487e-13 -1.75461e-17)
(851.84 2.04061e-13 0)
(851.84 1.82965e-14 -1.52338e-17)
(851.84 2.58583e-13 1.53083e-17)
(851.84 2.67061e-14 -3.22288e-17)
(851.84 2.13217e-13 0)
(851.84 5.31905e-13 1.53686e-17)
(851.84 5.75743e-13 1.55931e-17)
(851.84 4.58552e-13 -1.81188e-17)
(851.84 2.53613e-13 1.82155e-17)
(851.84 1.81536e-13 0)
(851.84 -9.40876e-14 1.91176e-17)
(851.84 5.248e-15 -1.90703e-17)
(851.84 -1.32909e-13 0)
(851.84 -8.57116e-15 1.79374e-17)
(851.84 3.45127e-13 0)
(851.84 -4.88146e-13 2.03583e-17)
(851.84 -6.14751e-13 -1.66992e-17)
(851.84 9.16529e-14 0)
(851.84 6.20097e-12 1.65589e-17)
(851.84 1.31835e-09 0)
(851.84 -2.32338e-13 1.61514e-17)
(851.84 -3.82109e-13 0)
(851.84 -2.98982e-13 0)
(851.84 -3.23272e-13 -1.22394e-17)
(851.84 -2.65895e-13 1.41246e-17)
(851.84 -4.75965e-13 -1.41832e-17)
(851.84 -3.29054e-13 2.47448e-17)
(851.84 -3.12936e-13 -1.43436e-17)
(851.84 -2.02618e-13 -1.56172e-17)
(851.84 -8.80792e-13 -2.69171e-17)
(851.84 -9.61228e-13 -1.34599e-17)
(851.84 -1.04402e-12 0)
(851.84 -1.18386e-12 0)
(851.84 -1.12537e-12 -1.27199e-17)
(851.84 -1.01319e-12 1.58352e-17)
(851.84 -1.0413e-12 -1.58507e-17)
(851.84 -1.12326e-12 0)
(851.84 -1.0584e-12 1.38956e-17)
(851.84 -9.32624e-13 0)
(851.84 -9.57095e-13 0)
(851.84 -9.91084e-13 0)
(851.84 -7.62072e-13 -3.80158e-32)
(851.84 -1.15326e-12 0)
(851.84 -6.75324e-13 0)
(851.84 -8.15945e-13 -4.08036e-32)
(851.84 -8.71267e-13 0)
(851.84 -6.82413e-13 0)
(851.84 -8.0137e-13 0)
(851.84 -6.77534e-13 1.51831e-17)
(851.84 -6.07707e-13 -1.52624e-17)
(851.84 -7.52044e-13 -1.51446e-17)
(851.84 -1.02535e-12 -1.51697e-17)
(851.84 -1.06065e-12 0)
(851.84 -1.04794e-12 -1.4853e-17)
(851.84 -8.55364e-13 -1.6752e-17)
(851.84 -3.62853e-13 -2.20917e-32)
(851.84 2.55307e-13 -1.38812e-17)
(851.84 1.53155e-13 -1.47043e-17)
(851.84 1.89415e-13 1.49418e-17)
(851.84 4.12568e-13 -1.40526e-17)
(851.84 3.80799e-13 -1.74194e-17)
(851.84 9.60214e-13 0)
(851.84 7.85353e-13 -1.61856e-17)
(851.84 7.29162e-13 -1.7761e-17)
(851.84 7.2314e-13 5.24447e-33)
(851.84 5.54659e-13 -1.4737e-17)
(851.84 2.62194e-13 0)
(851.84 5.37245e-13 3.16405e-32)
(851.84 7.12109e-13 -1.54717e-17)
(851.84 1.09116e-12 -1.71928e-17)
(851.84 8.37277e-13 0)
(851.84 9.6285e-13 -1.62906e-17)
(851.84 5.71167e-13 -1.64352e-17)
(851.84 3.8909e-13 0)
(851.84 2.57828e-13 1.52012e-17)
(851.84 1.34324e-13 0)
(851.84 -2.97736e-13 -1.53001e-17)
(851.84 -2.08415e-13 -1.53464e-17)
(851.84 -2.10394e-13 -1.55579e-32)
(851.84 -4.13779e-13 0)
(851.84 5.2534e-13 -1.85e-17)
(851.84 1.59926e-13 0)
(851.84 2.66717e-14 0)
(851.84 8.1561e-14 0)
(851.84 1.81986e-13 0)
(851.84 1.75274e-13 0)
(851.84 2.2784e-13 -1.79705e-17)
(851.84 3.83734e-13 0)
(851.84 3.3854e-13 0)
(851.84 1.89233e-13 0)
(851.84 1.78186e-13 0)
(851.84 -4.23352e-13 0)
(851.84 -4.28017e-13 0)
(851.84 1.36374e-13 0)
(851.84 7.86633e-11 0)
(851.84 -5.21366e-14 -1.58732e-17)
(851.84 -4.22401e-13 0)
(851.84 -4.24332e-13 -1.42568e-17)
(851.84 -4.96534e-13 0)
(851.84 -5.82467e-13 -1.37856e-17)
(851.84 -6.90865e-13 -1.29354e-17)
(851.84 -5.67374e-13 -1.29983e-17)
(851.84 -4.0952e-13 -1.24261e-17)
(851.84 -5.16927e-13 0)
(851.84 -4.6137e-13 1.32103e-17)
(851.84 -6.45952e-13 -1.32616e-17)
(851.84 -7.81572e-13 -1.33922e-17)
(851.84 -7.18326e-13 -1.54742e-17)
(851.84 -5.7477e-13 1.85241e-17)
(851.84 -9.06243e-13 -1.58014e-17)
(851.84 -8.69825e-13 0)
(851.84 -8.42668e-13 -1.73895e-17)
(851.84 -7.35426e-13 -2.94431e-17)
(851.84 -6.76993e-13 0)
(851.84 -4.47604e-13 -1.65092e-17)
(851.84 -7.0308e-13 0)
(851.84 -7.73555e-13 -3.23388e-17)
(851.84 -5.9253e-13 -1.62463e-17)
(851.84 -6.93568e-13 0)
(851.84 -6.24216e-13 -2.64909e-17)
(851.84 -4.04766e-13 -1.3297e-17)
(851.84 -2.83776e-13 -1.38734e-17)
(851.84 -4.35262e-13 -1.40262e-17)
(851.84 -4.26474e-13 -2.69084e-17)
(851.84 -4.19467e-13 -1.5451e-17)
(851.84 -3.46867e-13 0)
(851.84 -7.47515e-13 2.99958e-17)
(851.84 -7.98856e-13 -1.50641e-17)
(851.84 -6.13805e-13 1.50711e-17)
(851.84 -9.87338e-14 0)
(851.84 -5.3288e-14 1.43593e-17)
(851.84 3.77119e-14 0)
(851.84 1.29049e-13 -1.63747e-17)
(851.84 4.63239e-14 2.01181e-17)
(851.84 -1.71488e-14 0)
(851.84 1.11447e-13 1.5937e-17)
(851.84 1.17393e-13 1.62757e-17)
(851.84 8.16745e-13 1.45638e-17)
(851.84 4.01292e-13 -1.62642e-17)
(851.84 1.53256e-12 1.96111e-17)
(851.84 2.0953e-13 0)
(851.84 -5.91309e-14 1.59144e-17)
(851.84 1.29176e-13 1.45429e-17)
(851.84 7.20798e-13 0)
(851.84 6.11443e-13 1.64241e-17)
(851.84 6.94387e-13 0)
(851.84 5.28091e-13 1.63683e-17)
(851.84 5.822e-13 0)
(851.84 6.48716e-13 0)
(851.84 8.97024e-13 -1.50834e-17)
(851.84 4.99643e-13 -1.51318e-17)
(851.84 1.29695e-13 1.53353e-17)
(851.84 -1.96515e-13 0)
(851.84 -1.29946e-13 1.543e-17)
(851.84 -1.48063e-13 1.67915e-17)
(851.84 -1.78378e-13 0)
(851.84 2.01418e-14 0)
(851.84 -1.26716e-13 0)
(851.84 -2.67144e-14 1.82304e-17)
(851.84 1.95621e-13 1.91178e-17)
(851.84 5.15334e-13 1.87608e-17)
(851.84 3.46496e-13 2.15885e-17)
(851.84 7.57131e-13 0)
(851.84 2.68493e-15 0)
(851.84 -1.74703e-13 1.62168e-17)
(851.84 -4.06855e-14 1.61221e-17)
(851.84 -3.49652e-14 0)
(851.84 -3.35226e-13 1.76828e-17)
(851.84 -1.73413e-13 0)
(851.84 6.03073e-12 1.68073e-17)
(851.84 1.32589e-14 0)
(851.84 1.25645e-13 0)
(851.84 -4.63986e-14 1.32576e-17)
(851.84 -1.49597e-13 -1.22563e-17)
(851.84 -3.93557e-13 -1.32868e-17)
(851.84 -8.98465e-13 1.34498e-17)
(851.84 -5.60406e-13 0)
(851.84 -7.1127e-13 1.24426e-17)
(851.84 -6.78675e-13 0)
(851.84 -6.83424e-13 0)
(851.84 -7.97758e-13 1.25721e-17)
(851.84 -8.7872e-13 1.26186e-17)
(851.84 -7.58123e-13 1.27932e-17)
(851.84 -5.93605e-13 -1.29443e-17)
(851.84 -5.16404e-13 0)
(851.84 -6.21568e-13 1.3578e-17)
(851.84 -7.37882e-13 1.30173e-17)
(851.84 -6.9963e-13 1.29266e-17)
(851.84 -7.00619e-13 0)
(851.84 -8.68499e-13 1.50267e-17)
(851.84 -4.80613e-13 1.35771e-17)
(851.84 -4.26652e-13 3.26805e-17)
(851.84 -2.3545e-13 1.7035e-17)
(851.84 -4.06607e-13 1.4224e-17)
(851.84 -1.6193e-13 2.74768e-17)
(851.84 -1.17499e-13 1.37407e-17)
(851.84 -2.41158e-13 1.33638e-17)
(851.84 -4.0434e-13 2.69715e-17)
(851.84 -8.62961e-13 1.35021e-17)
(851.84 -7.52714e-13 2.73983e-17)
(851.84 -2.70129e-13 0)
(851.84 2.92826e-13 -2.81966e-17)
(851.84 3.6048e-13 1.37131e-17)
(851.84 2.52735e-13 -1.37507e-17)
(851.84 3.01945e-13 0)
(851.84 2.41971e-13 -1.38466e-17)
(851.84 -1.40746e-14 0)
(851.84 1.35411e-14 1.60509e-17)
(851.84 3.00278e-13 -3.2166e-17)
(851.84 1.96416e-13 0)
(851.84 1.29353e-13 -1.41331e-17)
(851.84 2.7672e-13 -1.41919e-17)
(851.84 5.10132e-14 -1.69073e-17)
(851.84 3.67853e-13 1.68341e-17)
(851.84 1.449e-13 -1.4371e-17)
(851.84 -6.5346e-15 0)
(851.84 -1.21027e-13 -1.72909e-17)
(851.84 -1.54449e-14 -1.50157e-17)
(851.84 -1.0555e-12 0)
(851.84 -1.15989e-12 -1.72294e-17)
(851.84 -6.19752e-13 0)
(851.84 -2.04741e-13 -1.48072e-17)
(851.84 -5.44676e-14 0)
(851.84 -3.37642e-13 0)
(851.84 -1.77671e-13 -1.60948e-17)
(851.84 -2.44067e-13 1.87746e-17)
(851.84 -1.58263e-13 -1.7478e-17)
(851.84 -4.52478e-13 0)
(851.84 -4.88723e-13 -1.53192e-17)
(851.84 -3.88041e-13 2.85555e-32)
(851.84 2.36871e-13 0)
(851.84 1.60787e-13 1.56721e-17)
(851.84 4.30638e-13 -1.57418e-17)
(851.84 3.68398e-13 -1.73936e-32)
(851.84 4.75906e-13 2.98304e-32)
(851.84 6.11164e-13 -1.60361e-17)
(851.84 5.8741e-13 0)
(851.84 2.75906e-13 0)
(851.84 2.87468e-13 1.69436e-17)
(851.84 -1.1062e-13 -4.60407e-32)
(851.84 8.51493e-14 -1.995e-17)
(851.84 -4.08421e-13 0)
(851.84 -6.3008e-13 3.74245e-32)
(851.84 -9.14887e-13 0)
(851.84 3.06142e-13 -9.25069e-32)
(851.84 -2.89051e-13 0)
(851.84 -2.31653e-13 0)
(851.84 9.26564e-14 -1.61479e-17)
(851.84 -2.08232e-13 1.46526e-17)
(851.84 -6.33606e-13 1.23089e-17)
(851.84 -5.42956e-13 0)
(851.84 -7.86955e-13 0)
(851.84 -8.05341e-13 0)
(851.84 -7.23831e-13 1.52726e-17)
(851.84 -9.51361e-13 -1.5158e-17)
(851.84 -1.14288e-12 0)
(851.84 -1.20088e-12 1.26276e-17)
(851.84 -1.24852e-12 0)
(851.84 -9.99934e-13 3.20032e-17)
(851.84 -9.63706e-13 0)
(851.84 -8.5138e-13 -1.4351e-17)
(851.84 -4.75226e-13 1.44188e-17)
(851.84 -3.75084e-13 0)
(851.84 -4.67661e-14 1.46883e-17)
(851.84 2.71511e-13 0)
(851.84 3.28419e-13 -1.33765e-17)
(851.84 5.54149e-13 -2.31378e-32)
(851.84 3.61586e-13 0)
(851.84 4.20211e-13 -1.38153e-17)
(851.84 4.77938e-13 3.20499e-32)
(851.84 -1.28358e-13 0)
(851.84 -3.93809e-13 1.52186e-17)
(851.84 -7.35974e-13 -1.79779e-17)
(851.84 -6.81537e-13 0)
(851.84 -2.37297e-13 -1.49271e-17)
(851.84 -1.26933e-13 0)
(851.84 1.05415e-12 1.65642e-17)
(851.84 1.03281e-12 1.38169e-17)
(851.84 1.22745e-12 1.47714e-17)
(851.84 7.54751e-13 1.49128e-17)
(851.84 2.05138e-13 1.59437e-17)
(851.84 8.69284e-14 0)
(851.84 -8.26365e-14 1.43504e-17)
(851.84 4.7648e-14 1.41185e-17)
(851.84 3.34112e-13 1.41798e-17)
(851.84 2.11985e-13 1.43179e-17)
(851.84 2.71055e-13 1.43222e-17)
(851.84 1.68002e-13 2.85381e-17)
(851.84 -1.59539e-14 0)
(851.84 6.36757e-14 2.88912e-17)
(851.84 4.86041e-14 0)
(851.84 7.2207e-14 0)
(851.84 -2.79354e-13 3.06522e-17)
(851.84 -5.39141e-13 0)
(851.84 -3.00733e-13 2.97481e-17)
(851.84 -3.34777e-13 0)
(851.84 -3.23192e-13 1.56234e-17)
(851.84 -1.10799e-13 1.81434e-17)
(851.84 -5.03764e-13 0)
(851.84 -6.16637e-13 1.87282e-17)
(851.84 -2.99008e-13 0)
(851.84 -3.4195e-14 1.51483e-17)
(851.84 1.1302e-13 1.80441e-17)
(851.84 5.04764e-13 1.82346e-17)
(851.84 9.58557e-14 -2.67138e-32)
(851.84 -1.1796e-13 1.66256e-17)
(851.84 -3.21354e-13 1.34563e-32)
(851.84 2.55194e-13 -2.50243e-33)
(851.84 2.0596e-13 -4.52303e-33)
(851.84 -1.10817e-14 -9.04957e-33)
(851.84 -2.46942e-13 0)
(851.84 -2.81923e-13 0)
(851.84 -1.9664e-13 1.67682e-17)
(851.84 -2.45677e-13 -1.71589e-17)
(851.84 -1.16673e-13 3.19325e-32)
(851.84 -9.13094e-14 1.61514e-17)
(851.84 4.32581e-14 0)
(851.84 -7.75564e-15 -5.43158e-32)
(851.84 -3.92306e-13 1.89441e-17)
(851.84 -1.04448e-12 -1.90498e-17)
(851.84 -8.05356e-13 0)
(851.84 -1.18428e-12 1.49373e-17)
(851.84 -1.34271e-12 1.51125e-17)
(851.84 -1.23044e-12 1.59768e-17)
(851.84 -1.11977e-12 0)
(851.84 -9.02964e-13 -1.28624e-17)
(851.84 -9.23093e-13 0)
(851.84 -9.52007e-13 0)
(851.84 -9.52046e-13 -2.62452e-17)
(851.84 -9.93951e-13 3.10007e-17)
(851.84 -1.15358e-12 -1.58908e-17)
(851.84 -9.90542e-13 -3.50453e-32)
(851.84 -1.06355e-12 -1.26835e-17)
(851.84 -9.42143e-13 -1.27308e-17)
(851.84 -1.01024e-12 0)
(851.84 -9.896e-13 0)
(851.84 -6.57049e-14 -1.2957e-17)
(851.84 2.70464e-13 0)
(851.84 4.07004e-13 -4.37284e-32)
(851.84 3.20355e-13 0)
(851.84 8.86605e-13 0)
(851.84 9.36447e-13 -1.34638e-17)
(851.84 6.87172e-13 0)
(851.84 7.94689e-13 0)
(851.84 5.35684e-13 -1.47265e-17)
(851.84 3.11315e-13 0)
(851.84 1.07291e-13 3.56023e-32)
(851.84 -2.07439e-13 0)
(851.84 5.53416e-14 0)
(851.84 -2.5141e-13 0)
(851.84 2.87355e-13 1.36839e-17)
(851.84 3.89868e-13 0)
(851.84 5.89259e-13 -1.18035e-32)
(851.84 5.8583e-13 0)
(851.84 3.82624e-13 -1.47837e-17)
(851.84 3.67922e-13 0)
(851.84 2.35551e-13 1.70483e-17)
(851.84 1.96817e-13 -1.85279e-32)
(851.84 -3.02394e-13 0)
(851.84 -4.8188e-13 7.45485e-32)
(851.84 -4.02487e-13 0)
(851.84 -7.53061e-13 -3.50638e-17)
(851.84 -5.75441e-13 -1.48085e-17)
(851.84 -5.99803e-13 1.50553e-17)
(851.84 -5.17337e-13 -1.51436e-17)
(851.84 -5.20258e-13 1.45129e-17)
(851.84 -5.85665e-13 0)
(851.84 -6.28112e-13 -3.2051e-17)
(851.84 -8.25322e-14 1.51239e-17)
(851.84 -1.86956e-13 -1.63204e-17)
(851.84 -6.10628e-14 1.92541e-17)
(851.84 -1.93129e-13 0)
(851.84 -1.92415e-13 -1.12932e-31)
(851.84 -2.99839e-13 1.9231e-17)
(851.84 -7.19537e-13 -1.67892e-17)
(851.84 -7.36927e-13 1.5136e-17)
(851.84 -3.02666e-13 0)
(851.84 9.30253e-14 2.16277e-32)
(851.84 2.34786e-13 0)
(851.84 2.90297e-13 -1.69477e-17)
(851.84 8.23926e-15 -3.90293e-32)
(851.84 -2.72059e-13 -3.39834e-17)
(851.84 -1.25961e-13 1.70548e-17)
(851.84 1.78736e-13 -1.57325e-17)
(851.84 -1.69892e-13 -1.58051e-17)
(851.84 -2.37598e-13 0)
(851.84 -3.73702e-13 0)
(851.84 -4.57607e-13 -1.75585e-17)
(851.84 -6.76983e-13 -2.16241e-17)
(851.84 -3.80085e-13 -1.9968e-17)
(851.84 -4.97547e-13 -1.78437e-17)
(851.84 4.63768e-14 0)
(851.84 -1.11171e-13 -1.65089e-17)
(851.84 -2.26472e-13 -1.66715e-17)
(851.84 -4.74566e-13 -1.67253e-17)
(851.84 -1.16966e-12 -7.33365e-18)
(851.84 -1.19336e-12 -1.54304e-17)
(851.84 -1.3664e-12 0)
(851.84 -1.31832e-12 -1.23904e-17)
(851.84 -1.15029e-12 0)
(851.84 -1.20757e-12 1.60581e-17)
(851.84 -9.06698e-13 -7.79408e-18)
(851.84 -1.06733e-12 0)
(851.84 -1.13349e-12 1.45583e-17)
(851.84 -1.25644e-12 -6.54791e-18)
(851.84 -1.0553e-12 1.49213e-17)
(851.84 -7.34457e-13 -1.52724e-17)
(851.84 -7.63581e-13 1.93336e-17)
(851.84 -6.96e-13 -6.83131e-18)
(851.84 -5.51099e-13 6.85987e-18)
(851.84 -2.81363e-13 6.60532e-18)
(851.84 -5.56956e-13 8.23736e-18)
(851.84 2.50488e-13 8.12042e-18)
(851.84 2.39246e-13 -1.31419e-17)
(851.84 4.14261e-13 7.67604e-18)
(851.84 4.53101e-13 7.71071e-18)
(851.84 4.64563e-13 6.56592e-18)
(851.84 6.00604e-13 0)
(851.84 5.14229e-13 6.61681e-18)
(851.84 4.75517e-13 6.64256e-18)
(851.84 7.04694e-13 6.68415e-18)
(851.84 4.627e-13 -1.33893e-17)
(851.84 2.84019e-13 6.80849e-18)
(851.84 4.31073e-14 6.87335e-18)
(851.84 -6.73048e-14 6.78588e-18)
(851.84 8.34134e-14 -1.48819e-17)
(851.84 3.32034e-15 0)
(851.84 9.67331e-14 -1.37629e-17)
(851.84 1.07232e-13 0)
(851.84 3.17899e-13 0)
(851.84 2.25686e-13 0)
(851.84 2.4467e-13 -1.39748e-17)
(851.84 -1.15192e-13 -1.40546e-17)
(851.84 -3.96477e-13 0)
(851.84 -6.58645e-13 -1.60316e-17)
(851.84 -4.67485e-13 0)
(851.84 -2.10218e-13 8.29661e-18)
(851.84 -4.08422e-13 0)
(851.84 -4.37245e-13 -1.72183e-17)
(851.84 -1.99805e-13 0)
(851.84 -2.32656e-13 -1.44986e-17)
(851.84 -2.67749e-13 -8.02044e-18)
(851.84 -3.67923e-13 1.69417e-17)
(851.84 -2.00122e-13 -1.5349e-17)
(851.84 -1.95825e-13 0)
(851.84 -2.57856e-13 -1.47801e-17)
(851.84 -3.20899e-13 0)
(851.84 -5.0489e-13 -1.72193e-17)
(851.84 -3.3042e-13 -1.78375e-17)
(851.84 -2.19236e-13 1.60934e-17)
(851.84 -1.81384e-13 -1.58723e-17)
(851.84 -3.1226e-13 -8.87464e-18)
(851.84 6.06787e-14 -1.68486e-17)
(851.84 -1.20496e-13 0)
(851.84 -6.21851e-13 -9.51018e-18)
(851.84 -6.73152e-13 -1.55425e-17)
(851.84 -2.86012e-13 7.80502e-18)
(851.84 -1.35317e-13 0)
(851.84 -9.74921e-14 -7.87322e-18)
(851.84 8.65377e-14 -9.1114e-18)
(851.84 1.05633e-13 0)
(851.84 -3.17394e-13 0)
(851.84 -4.30947e-13 0)
(851.84 -3.14349e-13 9.49489e-18)
(851.84 -3.88255e-13 -9.77436e-18)
(851.84 -3.63562e-13 -1.15957e-17)
(851.84 -6.8244e-13 0)
(851.84 -9.1305e-13 -8.92101e-18)
(851.84 -5.16201e-14 -8.26399e-18)
(851.84 -2.42751e-13 1.65808e-17)
(851.84 -1.2916e-12 6.0795e-18)
(851.84 -1.3426e-12 6.11101e-18)
(851.84 -1.01741e-12 0)
(851.84 -1.27472e-12 0)
(851.84 -1.14408e-12 7.08046e-18)
(851.84 -1.32756e-12 -6.55146e-18)
(851.84 -1.43381e-12 1.54515e-17)
(851.84 -1.23101e-12 -7.92536e-18)
(851.84 -1.32485e-12 -6.40383e-18)
(851.84 -1.38345e-12 -7.09724e-18)
(851.84 -6.27899e-13 0)
(851.84 -5.10478e-13 -6.33695e-18)
(851.84 -4.90131e-13 -6.35086e-18)
(851.84 -2.72008e-13 7.38364e-18)
(851.84 1.56682e-13 -7.41701e-18)
(851.84 4.54736e-13 -1.43648e-17)
(851.84 7.62294e-14 -7.21249e-18)
(851.84 3.14757e-13 -6.47781e-18)
(851.84 4.1667e-13 0)
(851.84 7.87646e-13 -1.33985e-17)
(851.84 6.23721e-13 -7.25595e-18)
(851.84 5.41911e-13 -1.41655e-17)
(851.84 1.05843e-12 0)
(851.84 5.79799e-13 -7.84465e-18)
(851.84 6.3154e-13 -6.67567e-18)
(851.84 4.64018e-13 -1.39201e-17)
(851.84 5.24081e-13 0)
(851.84 3.39116e-13 -7.8792e-18)
(851.84 2.27043e-13 -1.59324e-17)
(851.84 4.33483e-13 -7.14755e-18)
(851.84 3.42891e-13 0)
(851.84 -8.32754e-14 0)
(851.84 -1.60354e-13 0)
(851.84 2.92112e-14 0)
(851.84 1.35032e-13 0)
(851.84 1.49822e-13 0)
(851.84 5.68219e-14 6.99289e-18)
(851.84 2.0634e-14 0)
(851.84 -3.81219e-14 0)
(851.84 1.33739e-13 0)
(851.84 2.30954e-13 0)
(851.84 3.53785e-14 7.22931e-18)
(851.84 1.36036e-13 0)
(851.84 7.75819e-14 0)
(851.84 2.60078e-13 0)
(851.84 6.78246e-13 0)
(851.84 2.00318e-13 1.71829e-17)
(851.84 1.25141e-13 0)
(851.84 -1.5822e-13 0)
(851.84 -5.89918e-14 0)
(851.84 -8.8268e-14 0)
(851.84 -1.71038e-13 0)
(851.84 -5.1848e-13 0)
(851.84 -4.19169e-13 0)
(851.84 -6.06368e-13 0)
(851.84 -4.51548e-13 0)
(851.84 -4.23871e-13 8.24673e-18)
(851.84 -4.3816e-13 0)
(851.84 -3.83926e-13 0)
(851.84 -5.37616e-13 7.74326e-18)
(851.84 -6.35445e-13 0)
(851.84 -2.85523e-13 1.95277e-17)
(851.84 -3.36581e-13 -9.49625e-18)
(851.84 -2.82195e-13 8.9323e-18)
(851.84 2.90558e-13 1.6986e-17)
(851.84 1.78551e-13 0)
(851.84 -1.83456e-13 -8.45714e-18)
(851.84 -1.95444e-13 8.03132e-18)
(851.84 -3.54841e-13 8.06668e-18)
(851.84 -4.79723e-13 8.47473e-18)
(851.84 -5.13149e-13 8.4951e-18)
(851.84 -5.72033e-13 0)
(851.84 -5.18934e-13 8.6027e-18)
(851.84 -5.24038e-13 1.6465e-17)
(851.84 -4.26898e-13 0)
(851.84 -1.32465e-12 0)
(851.84 -1.13576e-12 -6.32879e-18)
(851.84 -1.0905e-12 0)
(851.84 -1.45413e-12 0)
(851.84 -1.44768e-12 3.8337e-32)
(851.84 -1.43875e-12 7.54105e-18)
(851.84 -1.50893e-12 -6.75717e-18)
(851.84 -1.39194e-12 2.68751e-33)
(851.84 -1.1547e-12 6.27321e-18)
(851.84 -9.05472e-13 0)
(851.84 -9.0237e-13 0)
(851.84 -2.85412e-13 6.36387e-33)
(851.84 -1.071e-13 0)
(851.84 2.32208e-13 0)
(851.84 3.53699e-13 -6.40303e-18)
(851.84 2.39117e-13 1.33237e-17)
(851.84 2.43428e-13 -8.11033e-18)
(851.84 3.32916e-13 0)
(851.84 3.41703e-13 6.78244e-18)
(851.84 4.74325e-13 6.55237e-18)
(851.84 6.81714e-13 6.57182e-18)
(851.84 7.84313e-13 5.83593e-33)
(851.84 7.18865e-13 8.28904e-18)
(851.84 5.91384e-13 -6.72166e-18)
(851.84 5.84809e-13 0)
(851.84 5.41345e-13 1.38584e-17)
(851.84 6.03276e-13 0)
(851.84 8.95835e-13 7.11347e-18)
(851.84 7.9673e-13 8.08045e-18)
(851.84 4.51155e-13 -8.2653e-18)
(851.84 3.04217e-13 7.96058e-18)
(851.84 -4.31017e-13 0)
(851.84 -1.62154e-13 8.16217e-18)
(851.84 -2.26421e-13 0)
(851.84 -2.37377e-13 6.92222e-18)
(851.84 -7.25944e-14 0)
(851.84 -2.12116e-13 -7.97606e-18)
(851.84 1.65806e-13 8.55707e-18)
(851.84 2.06083e-13 0)
(851.84 6.89828e-14 7.90538e-18)
(851.84 1.40413e-14 0)
(851.84 -1.9027e-13 0)
(851.84 -6.80865e-14 -8.24997e-18)
(851.84 2.0859e-13 0)
(851.84 2.49169e-13 -8.23354e-18)
(851.84 2.60095e-13 0)
(851.84 2.24649e-13 -7.27622e-18)
(851.84 -3.1796e-15 -8.04558e-18)
(851.84 7.58008e-15 0)
(851.84 4.35773e-14 -7.62111e-18)
(851.84 -5.01634e-13 0)
(851.84 -2.03022e-13 -9.79594e-18)
(851.84 9.87457e-14 0)
(851.84 -8.14732e-14 0)
(851.84 -1.65547e-13 -8.40561e-18)
(851.84 -1.02228e-12 0)
(851.84 -8.90468e-13 -8.80753e-18)
(851.84 -9.08461e-13 0)
(851.84 -5.9787e-13 0)
(851.84 -2.63972e-13 8.19717e-18)
(851.84 -3.49022e-13 0)
(851.84 -9.10546e-14 -8.42665e-33)
(851.84 -7.65256e-14 1.94914e-17)
(851.84 -5.96791e-13 9.04754e-18)
(851.84 -4.79431e-13 -8.22699e-18)
(851.84 -3.13373e-13 -8.28167e-18)
(851.84 -1.2587e-13 1.03052e-32)
(851.84 -3.0557e-13 -8.03859e-18)
(851.84 -3.59893e-13 8.99194e-18)
(851.84 -4.74982e-13 0)
(851.84 -7.36621e-13 -9.74933e-18)
(851.84 -8.3996e-13 -9.08932e-18)
(851.84 -8.46594e-13 -8.51595e-18)
(851.84 -9.86631e-13 -8.55281e-18)
(851.84 -5.71237e-13 0)
(851.84 -1.4196e-12 0)
(851.84 -1.38209e-12 -6.12164e-18)
(851.84 -1.17973e-12 -7.06027e-18)
(851.84 -9.08676e-13 -8.07605e-18)
(851.84 -1.18125e-12 -6.89875e-18)
(851.84 -9.28048e-13 0)
(851.84 -9.61039e-13 0)
(851.84 -9.17093e-13 6.24363e-18)
(851.84 -9.53437e-13 0)
(851.84 -2.35446e-13 -6.29544e-18)
(851.84 5.90303e-14 0)
(851.84 2.05871e-13 1.82797e-17)
(851.84 2.18756e-13 0)
(851.84 3.33248e-13 -8.02693e-18)
(851.84 7.95154e-13 1.58935e-17)
(851.84 6.8058e-13 -6.44988e-18)
(851.84 7.26157e-13 1.57365e-17)
(851.84 8.40116e-13 7.90467e-18)
(851.84 8.84054e-13 -8.07786e-18)
(851.84 2.26349e-13 0)
(851.84 8.62569e-13 -1.75066e-32)
(851.84 7.6472e-13 7.38964e-18)
(851.84 9.048e-13 -7.5933e-33)
(851.84 8.95292e-13 1.43049e-17)
(851.84 7.76453e-13 0)
(851.84 7.06661e-13 -7.52955e-18)
(851.84 9.16985e-13 0)
(851.84 1.13216e-12 6.72863e-33)
(851.84 8.36479e-13 0)
(851.84 8.87338e-13 1.56852e-17)
(851.84 1.93411e-13 -7.55646e-18)
(851.84 1.98352e-13 0)
(851.84 -1.68984e-13 -1.55216e-17)
(851.84 -2.04381e-13 0)
(851.84 -4.22765e-13 -6.95228e-18)
(851.84 -4.27366e-13 6.95585e-18)
(851.84 -9.60837e-14 0)
(851.84 -1.78667e-13 2.0732e-32)
(851.84 1.06459e-13 8.53615e-18)
(851.84 -9.18587e-14 -7.07108e-18)
(851.84 -1.61401e-13 0)
(851.84 2.18513e-13 0)
(851.84 -2.25387e-14 8.26361e-18)
(851.84 1.43177e-13 0)
(851.84 -3.29117e-14 7.22059e-18)
(851.84 -3.06969e-13 0)
(851.84 -2.41898e-13 0)
(851.84 -1.87761e-13 1.59529e-17)
(851.84 -2.4998e-13 0)
(851.84 1.78515e-13 8.29006e-18)
(851.84 2.74282e-13 0)
(851.84 1.25789e-13 1.55156e-17)
(851.84 2.68392e-13 0)
(851.84 -3.39911e-13 8.29911e-18)
(851.84 -2.92819e-13 1.50789e-17)
(851.84 -6.24528e-13 0)
(851.84 -4.91407e-13 8.34671e-18)
(851.84 -6.18972e-13 0)
(851.84 -9.42032e-13 8.93034e-18)
(851.84 -7.47566e-13 -8.118e-18)
(851.84 -1.72652e-13 0)
(851.84 -1.53229e-13 -8.85273e-18)
(851.84 5.60872e-15 -1.01595e-17)
(851.84 -3.09196e-13 -1.7703e-17)
(851.84 -3.89289e-13 0)
(851.84 -6.26759e-13 8.82515e-18)
(851.84 -6.80457e-13 8.86032e-18)
(851.84 -3.4158e-13 0)
(851.84 1.19821e-13 -4.79322e-32)
(851.84 -2.58766e-13 0)
(851.84 -5.09521e-14 1.59058e-33)
(851.84 -2.80283e-13 1.03097e-17)
(851.84 -1.41884e-13 8.31858e-18)
(851.84 -2.3366e-13 -8.26628e-18)
(851.84 4.29488e-14 0)
(851.84 -1.6537e-12 0)
(851.84 -1.71414e-12 6.12586e-18)
(851.84 -1.50569e-12 7.07473e-18)
(851.84 -8.18335e-13 7.10416e-18)
(851.84 -6.42581e-13 -3.09009e-18)
(851.84 -6.12586e-13 0)
(851.84 -3.61455e-13 -3.11444e-18)
(851.84 -1.87954e-13 0)
(851.84 2.87263e-13 3.13549e-18)
(851.84 2.30414e-13 9.44986e-18)
(851.84 6.87826e-13 0)
(851.84 6.84206e-13 -6.88595e-18)
(851.84 7.10896e-13 0)
(851.84 8.16801e-13 1.13916e-17)
(851.84 8.35831e-13 -3.89029e-18)
(851.84 1.00119e-12 3.27559e-18)
(851.84 9.58474e-13 -3.23041e-18)
(851.84 8.37991e-13 -3.24796e-18)
(851.84 1.06945e-12 3.25894e-18)
(851.84 1.03647e-12 3.27554e-18)
(851.84 8.74263e-13 -3.4581e-18)
(851.84 8.83859e-13 -3.47543e-18)
(851.84 8.87171e-13 -3.30779e-18)
(851.84 1.15202e-12 -3.32394e-18)
(851.84 1.19738e-12 3.71686e-18)
(851.84 1.11393e-12 3.72724e-18)
(851.84 1.58436e-12 0)
(851.84 1.12231e-12 -3.86851e-18)
(851.84 1.23494e-12 3.3904e-18)
(851.84 8.84305e-13 -3.40241e-18)
(851.84 3.80819e-13 3.41949e-18)
(851.84 2.34977e-13 3.42481e-18)
(851.84 1.10204e-13 1.03158e-17)
(851.84 -2.97774e-13 3.4525e-18)
(851.84 -2.72896e-13 3.46652e-18)
(851.84 -3.21418e-13 -3.69511e-18)
(851.84 -2.0911e-13 4.16254e-18)
(851.84 -2.27009e-13 -3.91175e-18)
(851.84 -1.80911e-13 -3.83639e-18)
(851.84 -2.09129e-13 3.86117e-18)
(851.84 -6.91199e-16 3.75843e-18)
(851.84 1.55815e-13 0)
(851.84 2.94025e-13 5.51889e-18)
(851.84 -1.67226e-13 0)
(851.84 3.12365e-14 3.62375e-18)
(851.84 -1.71378e-13 4.20709e-18)
(851.84 2.07784e-13 0)
(851.84 3.75364e-13 -4.44816e-18)
(851.84 7.71938e-13 3.67546e-18)
(851.84 7.6631e-13 3.86869e-18)
(851.84 3.63639e-13 3.88533e-18)
(851.84 3.37198e-13 -4.31739e-18)
(851.84 9.02618e-14 4.92834e-18)
(851.84 -2.34035e-13 -4.20772e-18)
(851.84 -3.44037e-13 -3.81265e-18)
(851.84 -3.19137e-13 3.83874e-18)
(851.84 -5.01741e-13 3.82134e-18)
(851.84 -1.11485e-13 4.06741e-18)
(851.84 -3.63413e-13 -4.83955e-18)
(851.84 -4.27958e-13 0)
(851.84 -4.5699e-13 3.88231e-18)
(851.84 -2.00495e-13 0)
(851.84 2.08486e-14 0)
(851.84 -1.87053e-13 8.42826e-18)
(851.84 -2.80368e-13 3.96071e-18)
(851.84 -5.47542e-13 0)
(851.84 -2.96849e-13 0)
(851.84 -4.52745e-13 0)
(851.84 -1.4619e-13 -9.00702e-18)
(851.84 -1.45876e-13 0)
(851.84 -3.6462e-13 8.91503e-18)
(851.84 2.86124e-13 0)
(851.84 7.56637e-13 0)
(851.84 8.1546e-13 8.27398e-18)
(851.84 9.29696e-13 0)
(851.84 -1.00591e-12 -3.14673e-18)
(851.84 -1.04509e-12 0)
(851.84 -1.1837e-12 0)
(851.84 -1.13737e-12 -3.5845e-18)
(851.84 -1.11342e-12 7.20419e-18)
(851.84 -8.61656e-13 0)
(851.84 -6.22218e-13 7.56004e-18)
(851.84 -4.20073e-14 0)
(851.84 -7.43685e-14 -3.30038e-18)
(851.84 1.88845e-13 -9.32528e-33)
(851.84 4.03865e-13 3.62354e-18)
(851.84 6.44782e-13 0)
(851.84 1.11042e-12 0)
(851.84 1.05379e-12 3.67283e-33)
(851.84 9.30923e-13 -3.20949e-18)
(851.84 1.06213e-12 -3.29729e-18)
(851.84 9.49324e-13 -3.92059e-18)
(851.84 1.04884e-12 -3.85195e-18)
(851.84 1.07404e-12 -6.88065e-18)
(851.84 1.07561e-12 -3.45374e-18)
(851.84 8.91471e-13 -3.28248e-18)
(851.84 6.83941e-13 3.30182e-18)
(851.84 6.85372e-13 -3.30792e-18)
(851.84 6.17195e-13 -3.3246e-18)
(851.84 9.26614e-13 -3.33401e-18)
(851.84 8.3087e-13 -3.35116e-18)
(851.84 8.53146e-13 0)
(851.84 9.48676e-13 -3.97232e-18)
(851.84 1.24822e-12 -3.98911e-18)
(851.84 1.18923e-12 -3.4096e-18)
(851.84 1.0839e-12 -3.42268e-18)
(851.84 5.62085e-13 -4.07219e-33)
(851.84 3.92238e-13 -7.11995e-18)
(851.84 -8.43402e-14 -3.45519e-18)
(851.84 -2.70415e-13 -3.97922e-18)
(851.84 -5.23128e-13 -7.9957e-18)
(851.84 -8.49779e-13 -3.49766e-18)
(851.84 -7.3024e-13 -3.52104e-18)
(851.84 -4.05659e-13 -3.52655e-18)
(851.84 -2.12385e-13 -7.69171e-18)
(851.84 -1.16323e-13 -3.86413e-18)
(851.84 -7.23193e-16 0)
(851.84 2.42698e-13 -8.27099e-18)
(851.84 1.14773e-13 0)
(851.84 -3.29598e-13 -4.93705e-18)
(851.84 3.64948e-14 -4.13334e-18)
(851.84 3.45001e-13 0)
(851.84 5.88693e-13 -3.66272e-18)
(851.84 7.81141e-13 -3.92203e-18)
(851.84 4.84413e-13 -7.88026e-18)
(851.84 3.7248e-13 -4.49978e-18)
(851.84 2.25423e-13 -5.6077e-18)
(851.84 -2.88844e-13 -4.65471e-18)
(851.84 1.65839e-13 -7.81206e-18)
(851.84 -9.05595e-14 -4.06811e-18)
(851.84 1.95757e-13 -4.09037e-18)
(851.84 1.70063e-13 -8.33875e-18)
(851.84 2.39766e-13 -4.17966e-18)
(851.84 2.47671e-13 -3.85432e-18)
(851.84 4.84661e-13 -3.86418e-18)
(851.84 -2.80952e-13 -4.48554e-18)
(851.84 -9.28513e-14 -4.93492e-18)
(851.84 -5.22931e-14 0)
(851.84 2.26095e-14 0)
(851.84 -3.59521e-13 -9.79708e-18)
(851.84 -4.51978e-13 0)
(851.84 -5.02438e-13 0)
(851.84 -5.57785e-13 0)
(851.84 -3.08732e-13 -4.63038e-18)
(851.84 -1.10711e-13 0)
(851.84 -9.60126e-14 -4.09586e-18)
(851.84 -2.30793e-14 0)
(851.84 1.07785e-13 -4.10279e-18)
(851.84 5.19938e-13 -4.46711e-18)
(851.84 6.59487e-13 0)
(851.84 -5.80292e-13 3.05119e-18)
(851.84 -5.14532e-13 1.72494e-18)
(851.84 -8.3478e-13 0)
(851.84 -6.46989e-13 3.08323e-18)
(851.84 -6.87978e-13 -3.68599e-18)
(851.84 -6.50351e-13 1.91793e-18)
(851.84 -5.67315e-13 -4.0079e-18)
(851.84 -2.13072e-13 2.00181e-18)
(851.84 -1.24172e-14 0)
(851.84 2.32511e-13 -3.15152e-18)
(851.84 6.44624e-13 -3.16319e-18)
(851.84 9.43034e-13 1.58748e-18)
(851.84 1.08894e-12 0)
(851.84 8.54152e-13 -3.514e-18)
(851.84 5.75044e-13 1.76435e-18)
(851.84 4.5002e-13 0)
(851.84 7.95194e-13 1.85464e-18)
(851.84 7.80986e-13 1.89923e-18)
(851.84 4.2203e-13 1.9869e-18)
(851.84 6.06217e-13 2.07954e-18)
(851.84 5.74495e-13 0)
(851.84 6.67498e-13 1.73059e-18)
(851.84 5.92442e-13 0)
(851.84 7.85055e-13 1.75571e-18)
(851.84 4.65792e-13 0)
(851.84 8.37795e-13 1.76713e-18)
(851.84 6.51894e-13 -1.77481e-18)
(851.84 1.00975e-12 1.88875e-18)
(851.84 9.63199e-13 0)
(851.84 1.04322e-12 2.21658e-18)
(851.84 9.83724e-13 -1.86591e-18)
(851.84 9.8023e-13 -3.85563e-18)
(851.84 3.59404e-13 1.93668e-18)
(851.84 8.9989e-14 0)
(851.84 -4.68338e-13 -1.73631e-18)
(851.84 -8.43235e-13 3.48625e-18)
(851.84 -6.61494e-13 0)
(851.84 -6.27785e-13 -1.76329e-18)
(851.84 -5.70103e-13 0)
(851.84 -3.09134e-13 1.77563e-18)
(851.84 -3.21729e-13 0)
(851.84 -2.45665e-13 -1.89283e-18)
(851.84 -2.57002e-13 4.5144e-18)
(851.84 -1.0557e-13 -2.43158e-18)
(851.84 3.91022e-13 0)
(851.84 2.99861e-13 -2.05124e-18)
(851.84 8.71108e-13 0)
(851.84 9.2309e-13 -2.14401e-18)
(851.84 4.36294e-13 0)
(851.84 4.4082e-13 2.13143e-18)
(851.84 4.19157e-15 0)
(851.84 1.87613e-13 -1.9432e-18)
(851.84 2.01201e-13 0)
(851.84 1.43462e-13 2.04397e-18)
(851.84 5.71897e-13 0)
(851.84 5.11855e-13 -2.01017e-18)
(851.84 5.14049e-13 3.98368e-18)
(851.84 1.43931e-13 0)
(851.84 7.39691e-14 -2.32469e-18)
(851.84 8.76379e-14 4.292e-18)
(851.84 -2.37609e-13 -1.94407e-18)
(851.84 -3.16126e-13 4.83334e-18)
(851.84 -7.03861e-13 -2.46746e-18)
(851.84 -8.67392e-13 0)
(851.84 -9.17011e-13 2.15805e-18)
(851.84 -8.12593e-13 0)
(851.84 -8.55672e-13 -2.20933e-18)
(851.84 -2.62542e-13 0)
(851.84 8.18327e-14 2.02258e-18)
(851.84 1.72353e-13 0)
(851.84 2.44238e-14 2.16761e-18)
(851.84 -3.00283e-13 0)
(851.84 -4.83095e-13 2.08467e-18)
(851.84 -1.28646e-13 4.20223e-18)
(851.84 -5.53967e-15 -2.07654e-18)
(851.84 -9.18507e-13 0)
(851.84 -5.00195e-13 -2.42907e-18)
(851.84 -1.27554e-13 0)
(851.84 3.50345e-14 0)
(851.84 2.19032e-13 0)
(851.84 2.64415e-14 -9.84934e-19)
(851.84 1.47278e-13 -7.95767e-19)
(851.84 2.09325e-13 -2.56272e-18)
(851.84 5.74256e-13 -8.57674e-19)
(851.84 9.49929e-13 9.11685e-19)
(851.84 1.00629e-12 0)
(851.84 9.81826e-13 -2.71062e-18)
(851.84 8.93648e-13 -7.97275e-19)
(851.84 2.8382e-13 9.35403e-19)
(851.84 1.71515e-13 -9.39603e-19)
(851.84 -3.81485e-14 0)
(851.84 2.03663e-13 -1.8489e-18)
(851.84 5.22612e-13 -1.71001e-18)
(851.84 2.32948e-13 1.87158e-18)
(851.84 5.65915e-13 -2.12128e-18)
(851.84 1.21568e-12 0)
(851.84 1.22125e-12 -1.90708e-18)
(851.84 6.6741e-13 9.57795e-19)
(851.84 5.74464e-13 -1.73073e-18)
(851.84 6.12364e-13 0)
(851.84 4.74946e-13 -1.6775e-18)
(851.84 2.02469e-13 1.68522e-18)
(851.84 5.44014e-13 -1.95565e-18)
(851.84 7.95181e-13 0)
(851.84 8.97958e-13 -1.70268e-18)
(851.84 6.58401e-13 1.70953e-18)
(851.84 5.02452e-13 0)
(851.84 3.04869e-13 1.86373e-18)
(851.84 -5.09128e-13 0)
(851.84 -3.21842e-13 1.77755e-18)
(851.84 -8.62438e-13 0)
(851.84 -1.80756e-13 0)
(851.84 6.51107e-13 2.05908e-18)
(851.84 2.8988e-13 0)
(851.84 2.19836e-13 1.77604e-18)
(851.84 1.91948e-13 0)
(851.84 -3.33973e-14 2.13906e-18)
(851.84 -1.3352e-13 0)
(851.84 8.56444e-14 2.06921e-18)
(851.84 3.67896e-13 0)
(851.84 7.01586e-13 1.8188e-18)
(851.84 1.04753e-12 0)
(851.84 7.70169e-13 2.09528e-18)
(851.84 2.28864e-13 0)
(851.84 -1.38755e-14 1.93491e-18)
(851.84 1.68135e-13 0)
(851.84 1.87271e-13 1.89281e-18)
(851.84 3.89372e-13 0)
(851.84 3.24409e-13 2.13044e-18)
(851.84 4.09778e-13 0)
(851.84 2.12204e-13 2.03582e-18)
(851.84 7.46223e-14 0)
(851.84 -1.78721e-13 0)
(851.84 -4.91876e-13 1.92541e-18)
(851.84 -3.60923e-13 0)
(851.84 -3.25016e-13 2.11627e-18)
(851.84 -2.89841e-13 0)
(851.84 -3.487e-14 9.81685e-19)
(851.84 -3.71957e-13 0)
(851.84 -5.83426e-13 1.09112e-18)
(851.84 -2.4407e-13 0)
(851.84 3.46647e-13 1.10304e-18)
(851.84 3.56789e-13 0)
(851.84 7.6127e-14 1.1742e-18)
(851.84 2.35101e-13 0)
(851.84 4.17916e-13 2.33748e-18)
(851.84 4.83053e-13 0)
(851.84 2.8826e-13 1.12377e-18)
(851.84 2.63874e-13 0)
(851.84 3.55459e-13 2.39302e-18)
(851.84 -1.03569e-12 0)
(851.84 -9.06158e-13 7.75355e-19)
(851.84 -5.97352e-13 0)
(851.84 -1.82124e-13 0)
(851.84 -1.29798e-13 0)
(851.84 3.1267e-14 -8.0389e-19)
(851.84 1.34379e-13 1.00679e-18)
(851.84 3.62632e-13 9.86769e-19)
(851.84 5.77463e-13 8.65478e-19)
(851.84 9.60726e-13 -9.32066e-19)
(851.84 7.4307e-13 0)
(851.84 6.83391e-13 8.21588e-19)
(851.84 3.76031e-13 8.24763e-19)
(851.84 3.01347e-13 -8.00842e-19)
(851.84 1.00544e-13 -8.03868e-19)
(851.84 -1.2291e-14 0)
(851.84 3.606e-13 0)
(851.84 3.69384e-13 0)
(851.84 2.93173e-13 0)
(851.84 3.44386e-13 0)
(851.84 3.41943e-13 0)
(851.84 5.68611e-13 0)
(851.84 5.19381e-13 -8.6612e-19)
(851.84 2.48173e-13 0)
(851.84 4.52834e-13 0)
(851.84 3.12817e-13 0)
(851.84 2.66708e-13 0)
(851.84 4.76723e-13 0)
(851.84 5.77157e-13 0)
(851.84 6.74786e-13 0)
(851.84 7.18354e-13 0)
(851.84 5.46023e-13 0)
(851.84 3.11058e-13 0)
(851.84 -1.87636e-13 0)
(851.84 -3.65948e-13 0)
(851.84 -5.21475e-13 0)
(851.84 -3.12097e-13 0)
(851.84 -2.22161e-13 0)
(851.84 -1.63333e-13 0)
(851.84 7.70461e-14 0)
(851.84 1.5718e-13 0)
(851.84 -1.39028e-14 0)
(851.84 -7.62394e-14 0)
(851.84 1.6274e-13 0)
(851.84 7.58943e-14 0)
(851.84 3.51648e-13 0)
(851.84 8.46229e-13 0)
(851.84 8.58665e-13 0)
(851.84 3.42335e-13 0)
(851.84 3.3235e-14 0)
(851.84 4.03625e-14 0)
(851.84 3.22346e-13 0)
(851.84 2.14196e-13 0)
(851.84 1.56828e-13 0)
(851.84 2.50128e-13 0)
(851.84 1.6044e-13 0)
(851.84 -7.1354e-14 0)
(851.84 -2.16819e-13 0)
(851.84 -4.15001e-13 0)
(851.84 -4.06077e-13 0)
(851.84 -1.57096e-13 0)
(851.84 -1.44324e-13 0)
(851.84 3.12625e-14 1.03188e-18)
(851.84 -1.74052e-13 0)
(851.84 -3.40238e-13 1.07521e-18)
(851.84 -1.03427e-13 0)
(851.84 -1.30329e-15 9.99647e-19)
(851.84 6.60743e-14 0)
(851.84 -7.10975e-14 1.13622e-18)
(851.84 1.24812e-14 0)
(851.84 1.01566e-13 0)
(851.84 2.82804e-13 0)
(851.84 2.16158e-13 1.127e-18)
(851.84 3.33712e-13 0)
(851.84 3.68715e-13 0)
)
;
boundaryField
{
inlet
{
type fixedValue;
value uniform (851.84 0 0);
}
outlet
{
type zeroGradient;
}
bottom
{
type symmetryPlane;
}
top
{
type symmetryPlane;
}
obstacle
{
type slip;
}
defaultFaces
{
type empty;
}
}
// ************************************************************************* //
| [
"alexandershevkin@gmail.com"
] | alexandershevkin@gmail.com | |
d6ba2ead790cdd31d4bfe6327440435c3986f455 | 75c8a1e71ebe38685e2252ff505ab8e7c359e856 | /vs/main.cpp | 660b7d0d6e7eec878d8e1e85178de38875d0f38c | [] | no_license | g-su-hudiono/Vulkan | a449c3aa504d497c801e5b8bd4dd63bfd3c11008 | c1479471f48a4a8262a340ce3f92303ed9a2a5a5 | refs/heads/master | 2023-07-12T17:32:20.299571 | 2021-08-30T08:37:20 | 2021-08-30T08:37:20 | 393,077,342 | 0 | 0 | null | 2021-08-30T08:37:21 | 2021-08-05T14:43:00 | C++ | UTF-8 | C++ | false | false | 242 | cpp | #include "app.h"
#include <iostream>
int main() {
App app;
try {
app.run();
} catch (const std::exception& e) {
std::cerr << e.what() << std::endl;
return EXIT_SUCCESS;
}
return EXIT_SUCCESS;
}
| [
"g-su-hudiono@gametools.jp"
] | g-su-hudiono@gametools.jp |
50c245fd10b00a213ab5b230888a505f43d7d194 | 00ef8d964caf4abef549bbeff81a744c282c8c16 | /chrome/browser/extensions/active_tab_unittest.cc | cc9472ea37bcbd4771041fffef52e51034b65e2d | [
"BSD-3-Clause"
] | permissive | czhang03/browser-android-tabs | 8295f466465e89d89109659cff74d6bb9adb8633 | 0277ceb50f9a90a2195c02e0d96da7b157f3b192 | refs/heads/master | 2023-02-16T23:55:29.149602 | 2018-09-14T07:46:16 | 2018-09-14T07:46:16 | 149,174,398 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 25,507 | cc | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <memory>
#include <string>
#include <utility>
#include "base/compiler_specific.h"
#include "base/macros.h"
#include "base/values.h"
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/extensions/active_tab_permission_granter.h"
#include "chrome/browser/extensions/chrome_test_extension_loader.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/extension_service_test_base.h"
#include "chrome/browser/extensions/extension_util.h"
#include "chrome/browser/extensions/tab_helper.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/sessions/session_tab_helper.h"
#include "chrome/test/base/chrome_render_view_host_test_harness.h"
#include "components/version_info/version_info.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/navigation_details.h"
#include "content/public/browser/navigation_entry.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/notification_types.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/frame_navigate_params.h"
#include "content/public/test/browser_side_navigation_test_utils.h"
#include "content/public/test/navigation_simulator.h"
#include "content/public/test/test_browser_thread.h"
#include "content/public/test/web_contents_tester.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/browser/test_extension_registry_observer.h"
#include "extensions/common/constants.h"
#include "extensions/common/extension.h"
#include "extensions/common/extension_builder.h"
#include "extensions/common/features/feature.h"
#include "extensions/common/features/feature_channel.h"
#include "extensions/common/permissions/permissions_data.h"
#include "extensions/common/value_builder.h"
#include "extensions/test/test_extension_dir.h"
#if defined(OS_CHROMEOS)
#include "base/run_loop.h"
#include "chrome/browser/chromeos/extensions/active_tab_permission_granter_delegate_chromeos.h"
#include "chrome/browser/chromeos/login/users/fake_chrome_user_manager.h"
#include "chrome/browser/chromeos/profiles/profile_helper.h"
#include "chrome/browser/ui/ash/test_wallpaper_controller.h"
#include "chrome/browser/ui/ash/wallpaper_controller_client.h"
#include "chrome/test/base/scoped_testing_local_state.h"
#include "chrome/test/base/testing_browser_process.h"
#include "chromeos/chromeos_switches.h"
#include "chromeos/login/scoped_test_public_session_login_state.h"
#include "components/account_id/account_id.h"
#include "components/browser_sync/browser_sync_switches.h"
#include "extensions/browser/extension_dialog_auto_confirm.h"
#endif
using base::DictionaryValue;
using base::ListValue;
using content::BrowserThread;
using content::NavigationController;
namespace extensions {
namespace {
scoped_refptr<const Extension> CreateTestExtension(
const std::string& id,
bool has_active_tab_permission,
bool has_tab_capture_permission) {
ListBuilder permissions;
if (has_active_tab_permission)
permissions.Append("activeTab");
if (has_tab_capture_permission)
permissions.Append("tabCapture");
return ExtensionBuilder()
.SetManifest(DictionaryBuilder()
.Set("name", "Extension with ID " + id)
.Set("version", "1.0")
.Set("manifest_version", 2)
.Set("permissions", permissions.Build())
.Build())
.SetID(id)
.Build();
}
enum PermittedFeature {
PERMITTED_NONE,
PERMITTED_SCRIPT_ONLY,
PERMITTED_CAPTURE_ONLY,
PERMITTED_BOTH
};
class ActiveTabPermissionGranterTestDelegate
: public ActiveTabPermissionGranter::Delegate {
public:
ActiveTabPermissionGranterTestDelegate() {}
~ActiveTabPermissionGranterTestDelegate() override {}
// ActiveTabPermissionGranterTestDelegate::Delegate
bool ShouldGrantActiveTab(const Extension* extension,
content::WebContents* contents) override {
return should_grant_;
}
void SetShouldGrant(bool should_grant) {
should_grant_ = should_grant;
}
private:
bool should_grant_ = false;
DISALLOW_COPY_AND_ASSIGN(ActiveTabPermissionGranterTestDelegate);
};
class ActiveTabTest : public ChromeRenderViewHostTestHarness {
protected:
ActiveTabTest()
: current_channel(version_info::Channel::DEV),
extension(CreateTestExtension("deadbeef", true, false)),
another_extension(CreateTestExtension("feedbeef", true, false)),
extension_without_active_tab(CreateTestExtension("badbeef",
false,
false)),
extension_with_tab_capture(CreateTestExtension("cafebeef",
true,
true)) {}
void SetUp() override {
ChromeRenderViewHostTestHarness::SetUp();
TabHelper::CreateForWebContents(web_contents());
}
int tab_id() { return SessionTabHelper::IdForTab(web_contents()).id(); }
ActiveTabPermissionGranter* active_tab_permission_granter() {
return extensions::TabHelper::FromWebContents(web_contents())->
active_tab_permission_granter();
}
bool IsAllowed(const scoped_refptr<const Extension>& extension,
const GURL& url) {
return IsAllowed(extension, url, PERMITTED_BOTH, tab_id());
}
bool IsAllowed(const scoped_refptr<const Extension>& extension,
const GURL& url,
PermittedFeature feature) {
return IsAllowed(extension, url, feature, tab_id());
}
bool IsAllowed(const scoped_refptr<const Extension>& extension,
const GURL& url,
PermittedFeature feature,
int tab_id) {
const PermissionsData* permissions_data = extension->permissions_data();
bool script =
permissions_data->CanAccessPage(url, tab_id, nullptr) &&
permissions_data->CanRunContentScriptOnPage(url, tab_id, nullptr);
bool capture = permissions_data->CanCaptureVisiblePage(url, tab_id, NULL);
switch (feature) {
case PERMITTED_SCRIPT_ONLY:
return script && !capture;
case PERMITTED_CAPTURE_ONLY:
return capture && !script;
case PERMITTED_BOTH:
return script && capture;
case PERMITTED_NONE:
return !script && !capture;
}
NOTREACHED();
return false;
}
bool IsBlocked(const scoped_refptr<const Extension>& extension,
const GURL& url) {
return IsBlocked(extension, url, tab_id());
}
bool IsBlocked(const scoped_refptr<const Extension>& extension,
const GURL& url,
int tab_id) {
return IsAllowed(extension, url, PERMITTED_NONE, tab_id);
}
bool HasTabsPermission(const scoped_refptr<const Extension>& extension) {
return HasTabsPermission(extension, tab_id());
}
bool HasTabsPermission(const scoped_refptr<const Extension>& extension,
int tab_id) {
return extension->permissions_data()->HasAPIPermissionForTab(
tab_id, APIPermission::kTab);
}
bool IsGrantedForTab(const Extension* extension,
const content::WebContents* web_contents) {
return extension->permissions_data()->HasAPIPermissionForTab(
SessionTabHelper::IdForTab(web_contents).id(), APIPermission::kTab);
}
// TODO(justinlin): Remove when tabCapture is moved to stable.
ScopedCurrentChannel current_channel;
// An extension with the activeTab permission.
scoped_refptr<const Extension> extension;
// Another extension with activeTab (for good measure).
scoped_refptr<const Extension> another_extension;
// An extension without the activeTab permission.
scoped_refptr<const Extension> extension_without_active_tab;
// An extension with both the activeTab and tabCapture permission.
scoped_refptr<const Extension> extension_with_tab_capture;
};
TEST_F(ActiveTabTest, GrantToSinglePage) {
GURL google("http://www.google.com");
NavigateAndCommit(google);
// No access unless it's been granted.
EXPECT_TRUE(IsBlocked(extension, google));
EXPECT_TRUE(IsBlocked(another_extension, google));
EXPECT_TRUE(IsBlocked(extension_without_active_tab, google));
EXPECT_FALSE(HasTabsPermission(extension));
EXPECT_FALSE(HasTabsPermission(another_extension));
EXPECT_FALSE(HasTabsPermission(extension_without_active_tab));
active_tab_permission_granter()->GrantIfRequested(extension.get());
active_tab_permission_granter()->GrantIfRequested(
extension_without_active_tab.get());
// Granted to extension and extension_without_active_tab, but the latter
// doesn't have the activeTab permission so not granted.
EXPECT_TRUE(IsAllowed(extension, google));
EXPECT_TRUE(IsBlocked(another_extension, google));
EXPECT_TRUE(IsBlocked(extension_without_active_tab, google));
// Other subdomains shouldn't be given access.
GURL mail_google("http://mail.google.com");
EXPECT_TRUE(IsBlocked(extension, mail_google));
EXPECT_TRUE(IsBlocked(another_extension, mail_google));
EXPECT_TRUE(IsBlocked(extension_without_active_tab, mail_google));
// Reloading the page should clear the active permissions.
content::NavigationSimulator::Reload(web_contents());
EXPECT_TRUE(IsBlocked(extension, google));
EXPECT_TRUE(IsBlocked(another_extension, google));
EXPECT_TRUE(IsBlocked(extension_without_active_tab, google));
EXPECT_FALSE(HasTabsPermission(extension));
EXPECT_FALSE(HasTabsPermission(another_extension));
EXPECT_FALSE(HasTabsPermission(extension_without_active_tab));
// But they should still be able to be granted again.
active_tab_permission_granter()->GrantIfRequested(extension.get());
EXPECT_TRUE(IsAllowed(extension, google));
EXPECT_TRUE(IsBlocked(another_extension, google));
EXPECT_TRUE(IsBlocked(extension_without_active_tab, google));
// And grant a few more times redundantly for good measure.
active_tab_permission_granter()->GrantIfRequested(extension.get());
active_tab_permission_granter()->GrantIfRequested(extension.get());
active_tab_permission_granter()->GrantIfRequested(another_extension.get());
active_tab_permission_granter()->GrantIfRequested(another_extension.get());
active_tab_permission_granter()->GrantIfRequested(another_extension.get());
active_tab_permission_granter()->GrantIfRequested(extension.get());
active_tab_permission_granter()->GrantIfRequested(extension.get());
active_tab_permission_granter()->GrantIfRequested(another_extension.get());
active_tab_permission_granter()->GrantIfRequested(another_extension.get());
EXPECT_TRUE(IsAllowed(extension, google));
EXPECT_TRUE(IsAllowed(another_extension, google));
EXPECT_TRUE(IsBlocked(extension_without_active_tab, google));
// Navigating to a new URL should clear the active permissions.
GURL chromium("http://www.chromium.org");
NavigateAndCommit(chromium);
EXPECT_TRUE(IsBlocked(extension, google));
EXPECT_TRUE(IsBlocked(another_extension, google));
EXPECT_TRUE(IsBlocked(extension_without_active_tab, google));
EXPECT_TRUE(IsBlocked(extension, chromium));
EXPECT_TRUE(IsBlocked(another_extension, chromium));
EXPECT_TRUE(IsBlocked(extension_without_active_tab, chromium));
EXPECT_FALSE(HasTabsPermission(extension));
EXPECT_FALSE(HasTabsPermission(another_extension));
EXPECT_FALSE(HasTabsPermission(extension_without_active_tab));
// Should be able to grant to multiple extensions at the same time (if they
// have the activeTab permission, of course).
active_tab_permission_granter()->GrantIfRequested(extension.get());
active_tab_permission_granter()->GrantIfRequested(another_extension.get());
active_tab_permission_granter()->GrantIfRequested(
extension_without_active_tab.get());
EXPECT_TRUE(IsBlocked(extension, google));
EXPECT_TRUE(IsBlocked(another_extension, google));
EXPECT_TRUE(IsBlocked(extension_without_active_tab, google));
EXPECT_TRUE(IsAllowed(extension, chromium));
EXPECT_TRUE(IsAllowed(another_extension, chromium));
EXPECT_TRUE(IsBlocked(extension_without_active_tab, chromium));
// Should be able to go back to URLs that were previously cleared.
NavigateAndCommit(google);
active_tab_permission_granter()->GrantIfRequested(extension.get());
active_tab_permission_granter()->GrantIfRequested(another_extension.get());
active_tab_permission_granter()->GrantIfRequested(
extension_without_active_tab.get());
EXPECT_TRUE(IsAllowed(extension, google));
EXPECT_TRUE(IsAllowed(another_extension, google));
EXPECT_TRUE(IsBlocked(extension_without_active_tab, google));
EXPECT_TRUE(IsBlocked(extension, chromium));
EXPECT_TRUE(IsBlocked(another_extension, chromium));
EXPECT_TRUE(IsBlocked(extension_without_active_tab, chromium));
}
TEST_F(ActiveTabTest, CapturingPagesWithActiveTab) {
std::vector<GURL> test_urls = {
GURL("https://example.com"), GURL("chrome://version"),
GURL("chrome://newtab"),
// IPv6 addresses don't work with activeTab: https://crbug.com/853064.
// {"http://[2607:f8b0:4005:805::200e]"},
extension->GetResourceURL("test.html"),
another_extension->GetResourceURL("test.html"),
};
const GURL kAboutBlank("about:blank");
for (const GURL& url : test_urls) {
SCOPED_TRACE(url);
NavigateAndCommit(url);
// By default, there should be no access.
EXPECT_FALSE(extension->permissions_data()->CanCaptureVisiblePage(
url, tab_id(), nullptr /*error*/));
// Granting permission should allow page capture.
active_tab_permission_granter()->GrantIfRequested(extension.get());
EXPECT_TRUE(extension->permissions_data()->CanCaptureVisiblePage(
url, tab_id(), nullptr /*error*/));
// Navigating away should revoke access.
NavigateAndCommit(kAboutBlank);
EXPECT_FALSE(extension->permissions_data()->CanCaptureVisiblePage(
url, tab_id(), nullptr /*error*/));
}
}
TEST_F(ActiveTabTest, Uninstalling) {
// Some semi-arbitrary setup.
GURL google("http://www.google.com");
NavigateAndCommit(google);
active_tab_permission_granter()->GrantIfRequested(extension.get());
EXPECT_TRUE(IsGrantedForTab(extension.get(), web_contents()));
EXPECT_TRUE(IsAllowed(extension, google));
// Uninstalling the extension should clear its tab permissions.
ExtensionRegistry* registry =
ExtensionRegistry::Get(web_contents()->GetBrowserContext());
registry->TriggerOnUnloaded(extension.get(),
UnloadedExtensionReason::DISABLE);
// Note: can't EXPECT_FALSE(IsAllowed) here because uninstalled extensions
// are just that... considered to be uninstalled, and the manager might
// just ignore them from here on.
// Granting the extension again should give them back.
active_tab_permission_granter()->GrantIfRequested(extension.get());
EXPECT_TRUE(IsGrantedForTab(extension.get(), web_contents()));
EXPECT_TRUE(IsAllowed(extension, google));
}
TEST_F(ActiveTabTest, OnlyActiveTab) {
GURL google("http://www.google.com");
NavigateAndCommit(google);
active_tab_permission_granter()->GrantIfRequested(extension.get());
EXPECT_TRUE(IsAllowed(extension, google, PERMITTED_BOTH, tab_id()));
EXPECT_TRUE(IsBlocked(extension, google, tab_id() + 1));
EXPECT_FALSE(HasTabsPermission(extension, tab_id() + 1));
}
TEST_F(ActiveTabTest, SameDocumentNavigations) {
GURL google("http://www.google.com");
NavigateAndCommit(google);
active_tab_permission_granter()->GrantIfRequested(extension.get());
// Perform a same-document navigation. The extension should not lose the
// temporary permission.
GURL google_h1("http://www.google.com#h1");
NavigateAndCommit(google_h1);
EXPECT_TRUE(IsAllowed(extension, google));
EXPECT_TRUE(IsAllowed(extension, google_h1));
GURL chromium("http://www.chromium.org");
NavigateAndCommit(chromium);
EXPECT_FALSE(IsAllowed(extension, google));
EXPECT_FALSE(IsAllowed(extension, google_h1));
EXPECT_FALSE(IsAllowed(extension, chromium));
active_tab_permission_granter()->GrantIfRequested(extension.get());
EXPECT_FALSE(IsAllowed(extension, google));
EXPECT_FALSE(IsAllowed(extension, google_h1));
EXPECT_TRUE(IsAllowed(extension, chromium));
GURL chromium_h1("http://www.chromium.org#h1");
NavigateAndCommit(chromium_h1);
EXPECT_FALSE(IsAllowed(extension, google));
EXPECT_FALSE(IsAllowed(extension, google_h1));
EXPECT_TRUE(IsAllowed(extension, chromium));
EXPECT_TRUE(IsAllowed(extension, chromium_h1));
content::NavigationSimulator::Reload(web_contents());
EXPECT_FALSE(IsAllowed(extension, google));
EXPECT_FALSE(IsAllowed(extension, google_h1));
EXPECT_FALSE(IsAllowed(extension, chromium));
EXPECT_FALSE(IsAllowed(extension, chromium_h1));
}
TEST_F(ActiveTabTest, ChromeUrlGrants) {
GURL internal("chrome://version");
NavigateAndCommit(internal);
active_tab_permission_granter()->GrantIfRequested(
extension_with_tab_capture.get());
// Do not grant tabs/hosts permissions for tab.
EXPECT_TRUE(IsAllowed(extension_with_tab_capture, internal,
PERMITTED_CAPTURE_ONLY));
const PermissionsData* permissions_data =
extension_with_tab_capture->permissions_data();
EXPECT_TRUE(permissions_data->HasAPIPermissionForTab(
tab_id(), APIPermission::kTabCaptureForTab));
EXPECT_TRUE(IsBlocked(extension_with_tab_capture, internal, tab_id() + 1));
EXPECT_FALSE(permissions_data->HasAPIPermissionForTab(
tab_id() + 1, APIPermission::kTabCaptureForTab));
}
// Test that the custom platform delegate works as expected.
TEST_F(ActiveTabTest, Delegate) {
auto test_delegate =
std::make_unique<ActiveTabPermissionGranterTestDelegate>();
ActiveTabPermissionGranter::SetPlatformDelegate(test_delegate.get());
GURL google("http://www.google.com");
NavigateAndCommit(google);
// Not granted because the delegate denies grant.
active_tab_permission_granter()->GrantIfRequested(extension.get());
EXPECT_TRUE(IsBlocked(extension, google));
// This time it's granted because the delegate allows it.
test_delegate->SetShouldGrant(true);
active_tab_permission_granter()->GrantIfRequested(extension.get());
EXPECT_TRUE(IsAllowed(extension, google));
// Cleanup :).
ActiveTabPermissionGranter::SetPlatformDelegate(nullptr);
}
#if defined(OS_CHROMEOS)
// Keep the unique_ptr around until callback has been run.
std::unique_ptr<permission_helper::RequestResolvedCallback>
QuitRunLoopOnRequestResolved(base::RunLoop* run_loop) {
auto callback = std::make_unique<permission_helper::RequestResolvedCallback>(
base::BindRepeating([](base::RunLoop* run_loop, const PermissionIDSet&) {
run_loop->Quit();
}, run_loop));
ActiveTabPermissionGranterDelegateChromeOS::
SetRequestResolvedCallbackForTesting(callback.get());
return callback;
}
// Test that the platform delegate is being set and the permission is prompted
// for.
TEST_F(ActiveTabTest, DelegateIsSet) {
// Necessary to prevent instantiation of ProfileSyncService, which messes with
// our signin state below.
base::CommandLine::ForCurrentProcess()->AppendSwitch(switches::kDisableSync);
// Necessary because no ProfileManager instance exists in this test.
base::CommandLine::ForCurrentProcess()->AppendSwitch(
chromeos::switches::kIgnoreUserProfileMappingForTests);
// Setup, login a public account user.
chromeos::ScopedTestPublicSessionLoginState login_state;
std::string user_id = "public@account.user";
std::string user_email = user_id;
AccountId account_id = AccountId::FromUserEmailGaiaId(user_email, user_id);
std::string user_id_hash = chromeos::ProfileHelper::Get()->
GetUserIdHashByUserIdForTesting(user_id);
ScopedTestingLocalState local_state(TestingBrowserProcess::GetGlobal());
std::unique_ptr<WallpaperControllerClient> wallpaper_controller_client_ =
std::make_unique<WallpaperControllerClient>();
TestWallpaperController test_wallpaper_controller_;
wallpaper_controller_client_->InitForTesting(
test_wallpaper_controller_.CreateInterfacePtr());
g_browser_process->local_state()->SetString(
"PublicAccountPendingDataRemoval", user_email);
user_manager::UserManager::Get()->UserLoggedIn(account_id, user_id_hash,
true /* browser_restart */,
false /* is_child */);
GURL google("http://www.google.com");
NavigateAndCommit(google);
// Grant and verify.
{
ScopedTestDialogAutoConfirm auto_confirm(
ScopedTestDialogAutoConfirm::ACCEPT);
base::RunLoop run_loop;
auto cb = QuitRunLoopOnRequestResolved(&run_loop);
active_tab_permission_granter()->GrantIfRequested(extension.get());
run_loop.Run();
EXPECT_TRUE(IsBlocked(extension, google));
base::RunLoop run_loop2;
cb = QuitRunLoopOnRequestResolved(&run_loop2);
active_tab_permission_granter()->GrantIfRequested(extension.get());
run_loop2.Run();
EXPECT_TRUE(IsAllowed(extension, google));
}
// Deny and verify. Use a different extension so it doesn't trigger the cache.
{
ScopedTestDialogAutoConfirm auto_confirm(
ScopedTestDialogAutoConfirm::CANCEL);
base::RunLoop run_loop;
auto cb = QuitRunLoopOnRequestResolved(&run_loop);
active_tab_permission_granter()->GrantIfRequested(another_extension.get());
run_loop.Run();
EXPECT_TRUE(IsBlocked(another_extension, google));
base::RunLoop run_loop2;
cb = QuitRunLoopOnRequestResolved(&run_loop2);
active_tab_permission_granter()->GrantIfRequested(another_extension.get());
run_loop2.Run();
EXPECT_TRUE(IsBlocked(another_extension, google));
}
// Cleanup.
ActiveTabPermissionGranterDelegateChromeOS::
SetRequestResolvedCallbackForTesting(nullptr);
delete ActiveTabPermissionGranter::SetPlatformDelegate(nullptr);
chromeos::ChromeUserManager::Get()->Shutdown();
}
#endif // defined(OS_CHROMEOS)
// An active tab test that includes an ExtensionService.
class ActiveTabWithServiceTest : public ExtensionServiceTestBase {
public:
ActiveTabWithServiceTest() {}
void SetUp() override;
void TearDown() override;
private:
DISALLOW_COPY_AND_ASSIGN(ActiveTabWithServiceTest);
};
void ActiveTabWithServiceTest::SetUp() {
ExtensionServiceTestBase::SetUp();
content::BrowserSideNavigationSetUp();
}
void ActiveTabWithServiceTest::TearDown() {
content::BrowserSideNavigationTearDown();
ExtensionServiceTestBase::TearDown();
}
// Tests that an extension can only capture file:// URLs with the active tab
// permission when it has file access granted.
// Regression test for https://crbug.com/810220.
TEST_F(ActiveTabWithServiceTest, FileURLs) {
InitializeEmptyExtensionService();
TestExtensionDir test_dir;
test_dir.WriteManifest(R"(
{
"name": "Active Tab Capture With File Urls",
"description": "Testing activeTab on file urls",
"version": "0.1",
"manifest_version": 2,
"permissions": ["activeTab"]
})");
ChromeTestExtensionLoader loader(profile());
loader.set_allow_file_access(false);
scoped_refptr<const Extension> extension =
loader.LoadExtension(test_dir.UnpackedPath());
ASSERT_TRUE(extension);
const std::string id = extension->id();
ASSERT_TRUE(registry()->enabled_extensions().Contains(id));
EXPECT_FALSE(util::AllowFileAccess(id, profile()));
std::unique_ptr<content::WebContents> web_contents(
content::WebContentsTester::CreateTestWebContents(profile(), nullptr));
ASSERT_TRUE(web_contents);
const GURL file_url("file:///foo");
ASSERT_TRUE(content::WebContentsTester::For(web_contents.get()));
content::WebContentsTester::For(web_contents.get())
->NavigateAndCommit(file_url);
EXPECT_EQ(file_url, web_contents->GetLastCommittedURL());
TabHelper::CreateForWebContents(web_contents.get());
ActiveTabPermissionGranter* permission_granter =
TabHelper::FromWebContents(web_contents.get())
->active_tab_permission_granter();
ASSERT_TRUE(permission_granter);
const int tab_id = SessionTabHelper::IdForTab(web_contents.get()).id();
EXPECT_NE(extension_misc::kUnknownTabId, tab_id);
EXPECT_FALSE(extension->permissions_data()->CanCaptureVisiblePage(
web_contents->GetLastCommittedURL(), tab_id, nullptr));
permission_granter->GrantIfRequested(extension.get());
EXPECT_FALSE(extension->permissions_data()->CanCaptureVisiblePage(
web_contents->GetLastCommittedURL(), tab_id, nullptr));
permission_granter->RevokeForTesting();
TestExtensionRegistryObserver observer(registry(), id);
// This will reload the extension, so we need to reset the extension pointer.
util::SetAllowFileAccess(id, profile(), true);
extension = observer.WaitForExtensionLoaded();
ASSERT_TRUE(extension);
EXPECT_FALSE(extension->permissions_data()->CanCaptureVisiblePage(
web_contents->GetLastCommittedURL(), tab_id, nullptr));
permission_granter->GrantIfRequested(extension.get());
EXPECT_TRUE(extension->permissions_data()->CanCaptureVisiblePage(
web_contents->GetLastCommittedURL(), tab_id, nullptr));
}
} // namespace
} // namespace extensions
| [
"artem@brave.com"
] | artem@brave.com |
1b8043f5e0aac0a9ca5e3c218562d9bef3cb3f25 | 29f2549998b45a046930f3b1c5e3024791b1be16 | /lib/Transforms/Scalar/MemCpyOptimizer.cpp | 5182b4b4bcd8b0f2971c5cdcbb448e00e5746b3e | [
"NCSA"
] | permissive | fanfuqiang/iec-61131_new | eda210bd30a6a32e3d14c3d3e87f51b179124c72 | fde56fdefd60e33facaa07661e388ed6c916c763 | refs/heads/master | 2016-09-05T14:59:12.678870 | 2015-02-06T23:55:09 | 2015-02-06T23:55:09 | 30,048,552 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 27,857 | cpp | //===- MemCpyOptimizer.cpp - Optimize use of memcpy and friends -----------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This pass performs various transformations related to eliminating memcpy
// calls, or transforming sets of stores into memset's.
//
//===----------------------------------------------------------------------===//
#define DEBUG_TYPE "memcpyopt"
#include "llvm/Transforms/Scalar.h"
#include "llvm/IntrinsicInst.h"
#include "llvm/Instructions.h"
#include "llvm/LLVMContext.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/Dominators.h"
#include "llvm/Analysis/AliasAnalysis.h"
#include "llvm/Analysis/MemoryDependenceAnalysis.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/GetElementPtrTypeIterator.h"
#include "llvm/Target/TargetData.h"
#include <list>
using namespace llvm;
STATISTIC(NumMemCpyInstr, "Number of memcpy instructions deleted");
STATISTIC(NumMemSetInfer, "Number of memsets inferred");
/// isBytewiseValue - If the specified value can be set by repeating the same
/// byte in memory, return the i8 value that it is represented with. This is
/// true for all i8 values obviously, but is also true for i32 0, i32 -1,
/// i16 0xF0F0, double 0.0 etc. If the value can't be handled with a repeated
/// byte store (e.g. i16 0x1234), return null.
static Value *isBytewiseValue(Value *V, LLVMContext& Context) {
// All byte-wide stores are splatable, even of arbitrary variables.
if (V->getType() == Type::getInt8Ty(Context)) return V;
// Constant float and double values can be handled as integer values if the
// corresponding integer value is "byteable". An important case is 0.0.
if (ConstantFP *CFP = dyn_cast<ConstantFP>(V)) {
if (CFP->getType() == Type::getFloatTy(Context))
V = ConstantExpr::getBitCast(CFP, Type::getInt32Ty(Context));
if (CFP->getType() == Type::getDoubleTy(Context))
V = ConstantExpr::getBitCast(CFP, Type::getInt64Ty(Context));
// Don't handle long double formats, which have strange constraints.
}
// We can handle constant integers that are power of two in size and a
// multiple of 8 bits.
if (ConstantInt *CI = dyn_cast<ConstantInt>(V)) {
unsigned Width = CI->getBitWidth();
if (isPowerOf2_32(Width) && Width > 8) {
// We can handle this value if the recursive binary decomposition is the
// same at all levels.
APInt Val = CI->getValue();
APInt Val2;
while (Val.getBitWidth() != 8) {
unsigned NextWidth = Val.getBitWidth()/2;
Val2 = Val.lshr(NextWidth);
Val2.trunc(Val.getBitWidth()/2);
Val.trunc(Val.getBitWidth()/2);
// If the top/bottom halves aren't the same, reject it.
if (Val != Val2)
return 0;
}
return ConstantInt::get(Context, Val);
}
}
// Conceptually, we could handle things like:
// %a = zext i8 %X to i16
// %b = shl i16 %a, 8
// %c = or i16 %a, %b
// but until there is an example that actually needs this, it doesn't seem
// worth worrying about.
return 0;
}
static int64_t GetOffsetFromIndex(const GetElementPtrInst *GEP, unsigned Idx,
bool &VariableIdxFound, TargetData &TD) {
// Skip over the first indices.
gep_type_iterator GTI = gep_type_begin(GEP);
for (unsigned i = 1; i != Idx; ++i, ++GTI)
/*skip along*/;
// Compute the offset implied by the rest of the indices.
int64_t Offset = 0;
for (unsigned i = Idx, e = GEP->getNumOperands(); i != e; ++i, ++GTI) {
ConstantInt *OpC = dyn_cast<ConstantInt>(GEP->getOperand(i));
if (OpC == 0)
return VariableIdxFound = true;
if (OpC->isZero()) continue; // No offset.
// Handle struct indices, which add their field offset to the pointer.
if (const StructType *STy = dyn_cast<StructType>(*GTI)) {
Offset += TD.getStructLayout(STy)->getElementOffset(OpC->getZExtValue());
continue;
}
// Otherwise, we have a sequential type like an array or vector. Multiply
// the index by the ElementSize.
uint64_t Size = TD.getTypeAllocSize(GTI.getIndexedType());
Offset += Size*OpC->getSExtValue();
}
return Offset;
}
/// IsPointerOffset - Return true if Ptr1 is provably equal to Ptr2 plus a
/// constant offset, and return that constant offset. For example, Ptr1 might
/// be &A[42], and Ptr2 might be &A[40]. In this case offset would be -8.
static bool IsPointerOffset(Value *Ptr1, Value *Ptr2, int64_t &Offset,
TargetData &TD) {
// Right now we handle the case when Ptr1/Ptr2 are both GEPs with an identical
// base. After that base, they may have some number of common (and
// potentially variable) indices. After that they handle some constant
// offset, which determines their offset from each other. At this point, we
// handle no other case.
GetElementPtrInst *GEP1 = dyn_cast<GetElementPtrInst>(Ptr1);
GetElementPtrInst *GEP2 = dyn_cast<GetElementPtrInst>(Ptr2);
if (!GEP1 || !GEP2 || GEP1->getOperand(0) != GEP2->getOperand(0))
return false;
// Skip any common indices and track the GEP types.
unsigned Idx = 1;
for (; Idx != GEP1->getNumOperands() && Idx != GEP2->getNumOperands(); ++Idx)
if (GEP1->getOperand(Idx) != GEP2->getOperand(Idx))
break;
bool VariableIdxFound = false;
int64_t Offset1 = GetOffsetFromIndex(GEP1, Idx, VariableIdxFound, TD);
int64_t Offset2 = GetOffsetFromIndex(GEP2, Idx, VariableIdxFound, TD);
if (VariableIdxFound) return false;
Offset = Offset2-Offset1;
return true;
}
/// MemsetRange - Represents a range of memset'd bytes with the ByteVal value.
/// This allows us to analyze stores like:
/// store 0 -> P+1
/// store 0 -> P+0
/// store 0 -> P+3
/// store 0 -> P+2
/// which sometimes happens with stores to arrays of structs etc. When we see
/// the first store, we make a range [1, 2). The second store extends the range
/// to [0, 2). The third makes a new range [2, 3). The fourth store joins the
/// two ranges into [0, 3) which is memset'able.
namespace {
struct MemsetRange {
// Start/End - A semi range that describes the span that this range covers.
// The range is closed at the start and open at the end: [Start, End).
int64_t Start, End;
/// StartPtr - The getelementptr instruction that points to the start of the
/// range.
Value *StartPtr;
/// Alignment - The known alignment of the first store.
unsigned Alignment;
/// TheStores - The actual stores that make up this range.
SmallVector<StoreInst*, 16> TheStores;
bool isProfitableToUseMemset(const TargetData &TD) const;
};
} // end anon namespace
bool MemsetRange::isProfitableToUseMemset(const TargetData &TD) const {
// If we found more than 8 stores to merge or 64 bytes, use memset.
if (TheStores.size() >= 8 || End-Start >= 64) return true;
// Assume that the code generator is capable of merging pairs of stores
// together if it wants to.
if (TheStores.size() <= 2) return false;
// If we have fewer than 8 stores, it can still be worthwhile to do this.
// For example, merging 4 i8 stores into an i32 store is useful almost always.
// However, merging 2 32-bit stores isn't useful on a 32-bit architecture (the
// memset will be split into 2 32-bit stores anyway) and doing so can
// pessimize the llvm optimizer.
//
// Since we don't have perfect knowledge here, make some assumptions: assume
// the maximum GPR width is the same size as the pointer size and assume that
// this width can be stored. If so, check to see whether we will end up
// actually reducing the number of stores used.
unsigned Bytes = unsigned(End-Start);
unsigned NumPointerStores = Bytes/TD.getPointerSize();
// Assume the remaining bytes if any are done a byte at a time.
unsigned NumByteStores = Bytes - NumPointerStores*TD.getPointerSize();
// If we will reduce the # stores (according to this heuristic), do the
// transformation. This encourages merging 4 x i8 -> i32 and 2 x i16 -> i32
// etc.
return TheStores.size() > NumPointerStores+NumByteStores;
}
namespace {
class MemsetRanges {
/// Ranges - A sorted list of the memset ranges. We use std::list here
/// because each element is relatively large and expensive to copy.
std::list<MemsetRange> Ranges;
typedef std::list<MemsetRange>::iterator range_iterator;
TargetData &TD;
public:
MemsetRanges(TargetData &td) : TD(td) {}
typedef std::list<MemsetRange>::const_iterator const_iterator;
const_iterator begin() const { return Ranges.begin(); }
const_iterator end() const { return Ranges.end(); }
bool empty() const { return Ranges.empty(); }
void addStore(int64_t OffsetFromFirst, StoreInst *SI);
};
} // end anon namespace
/// addStore - Add a new store to the MemsetRanges data structure. This adds a
/// new range for the specified store at the specified offset, merging into
/// existing ranges as appropriate.
void MemsetRanges::addStore(int64_t Start, StoreInst *SI) {
int64_t End = Start+TD.getTypeStoreSize(SI->getOperand(0)->getType());
// Do a linear search of the ranges to see if this can be joined and/or to
// find the insertion point in the list. We keep the ranges sorted for
// simplicity here. This is a linear search of a linked list, which is ugly,
// however the number of ranges is limited, so this won't get crazy slow.
range_iterator I = Ranges.begin(), E = Ranges.end();
while (I != E && Start > I->End)
++I;
// We now know that I == E, in which case we didn't find anything to merge
// with, or that Start <= I->End. If End < I->Start or I == E, then we need
// to insert a new range. Handle this now.
if (I == E || End < I->Start) {
MemsetRange &R = *Ranges.insert(I, MemsetRange());
R.Start = Start;
R.End = End;
R.StartPtr = SI->getPointerOperand();
R.Alignment = SI->getAlignment();
R.TheStores.push_back(SI);
return;
}
// This store overlaps with I, add it.
I->TheStores.push_back(SI);
// At this point, we may have an interval that completely contains our store.
// If so, just add it to the interval and return.
if (I->Start <= Start && I->End >= End)
return;
// Now we know that Start <= I->End and End >= I->Start so the range overlaps
// but is not entirely contained within the range.
// See if the range extends the start of the range. In this case, it couldn't
// possibly cause it to join the prior range, because otherwise we would have
// stopped on *it*.
if (Start < I->Start) {
I->Start = Start;
I->StartPtr = SI->getPointerOperand();
I->Alignment = SI->getAlignment();
}
// Now we know that Start <= I->End and Start >= I->Start (so the startpoint
// is in or right at the end of I), and that End >= I->Start. Extend I out to
// End.
if (End > I->End) {
I->End = End;
range_iterator NextI = I;
while (++NextI != E && End >= NextI->Start) {
// Merge the range in.
I->TheStores.append(NextI->TheStores.begin(), NextI->TheStores.end());
if (NextI->End > I->End)
I->End = NextI->End;
Ranges.erase(NextI);
NextI = I;
}
}
}
//===----------------------------------------------------------------------===//
// MemCpyOpt Pass
//===----------------------------------------------------------------------===//
namespace {
class VISIBILITY_HIDDEN MemCpyOpt : public FunctionPass {
bool runOnFunction(Function &F);
public:
static char ID; // Pass identification, replacement for typeid
MemCpyOpt() : FunctionPass(&ID) {}
private:
// This transformation requires dominator postdominator info
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.setPreservesCFG();
AU.addRequired<DominatorTree>();
AU.addRequired<MemoryDependenceAnalysis>();
AU.addRequired<AliasAnalysis>();
AU.addPreserved<AliasAnalysis>();
AU.addPreserved<MemoryDependenceAnalysis>();
}
// Helper fuctions
bool processStore(StoreInst *SI, BasicBlock::iterator& BBI);
bool processMemCpy(MemCpyInst* M);
bool performCallSlotOptzn(MemCpyInst* cpy, CallInst* C);
bool iterateOnFunction(Function &F);
};
char MemCpyOpt::ID = 0;
}
// createMemCpyOptPass - The public interface to this file...
FunctionPass *llvm::createMemCpyOptPass() { return new MemCpyOpt(); }
static RegisterPass<MemCpyOpt> X("memcpyopt",
"MemCpy Optimization");
/// processStore - When GVN is scanning forward over instructions, we look for
/// some other patterns to fold away. In particular, this looks for stores to
/// neighboring locations of memory. If it sees enough consequtive ones
/// (currently 4) it attempts to merge them together into a memcpy/memset.
bool MemCpyOpt::processStore(StoreInst *SI, BasicBlock::iterator& BBI) {
if (SI->isVolatile()) return false;
LLVMContext &Context = SI->getContext();
// There are two cases that are interesting for this code to handle: memcpy
// and memset. Right now we only handle memset.
// Ensure that the value being stored is something that can be memset'able a
// byte at a time like "0" or "-1" or any width, as well as things like
// 0xA0A0A0A0 and 0.0.
Value *ByteVal = isBytewiseValue(SI->getOperand(0), Context);
if (!ByteVal)
return false;
TargetData *TD = getAnalysisIfAvailable<TargetData>();
if (!TD) return false;
AliasAnalysis &AA = getAnalysis<AliasAnalysis>();
Module *M = SI->getParent()->getParent()->getParent();
// Okay, so we now have a single store that can be splatable. Scan to find
// all subsequent stores of the same value to offset from the same pointer.
// Join these together into ranges, so we can decide whether contiguous blocks
// are stored.
MemsetRanges Ranges(*TD);
Value *StartPtr = SI->getPointerOperand();
BasicBlock::iterator BI = SI;
for (++BI; !isa<TerminatorInst>(BI); ++BI) {
if (isa<CallInst>(BI) || isa<InvokeInst>(BI)) {
// If the call is readnone, ignore it, otherwise bail out. We don't even
// allow readonly here because we don't want something like:
// A[1] = 2; strlen(A); A[2] = 2; -> memcpy(A, ...); strlen(A).
if (AA.getModRefBehavior(CallSite::get(BI)) ==
AliasAnalysis::DoesNotAccessMemory)
continue;
// TODO: If this is a memset, try to join it in.
break;
} else if (isa<VAArgInst>(BI) || isa<LoadInst>(BI))
break;
// If this is a non-store instruction it is fine, ignore it.
StoreInst *NextStore = dyn_cast<StoreInst>(BI);
if (NextStore == 0) continue;
// If this is a store, see if we can merge it in.
if (NextStore->isVolatile()) break;
// Check to see if this stored value is of the same byte-splattable value.
if (ByteVal != isBytewiseValue(NextStore->getOperand(0), Context))
break;
// Check to see if this store is to a constant offset from the start ptr.
int64_t Offset;
if (!IsPointerOffset(StartPtr, NextStore->getPointerOperand(), Offset, *TD))
break;
Ranges.addStore(Offset, NextStore);
}
// If we have no ranges, then we just had a single store with nothing that
// could be merged in. This is a very common case of course.
if (Ranges.empty())
return false;
// If we had at least one store that could be merged in, add the starting
// store as well. We try to avoid this unless there is at least something
// interesting as a small compile-time optimization.
Ranges.addStore(0, SI);
Function *MemSetF = 0;
// Now that we have full information about ranges, loop over the ranges and
// emit memset's for anything big enough to be worthwhile.
bool MadeChange = false;
for (MemsetRanges::const_iterator I = Ranges.begin(), E = Ranges.end();
I != E; ++I) {
const MemsetRange &Range = *I;
if (Range.TheStores.size() == 1) continue;
// If it is profitable to lower this range to memset, do so now.
if (!Range.isProfitableToUseMemset(*TD))
continue;
// Otherwise, we do want to transform this! Create a new memset. We put
// the memset right before the first instruction that isn't part of this
// memset block. This ensure that the memset is dominated by any addressing
// instruction needed by the start of the block.
BasicBlock::iterator InsertPt = BI;
if (MemSetF == 0) {
const Type *Ty = Type::getInt64Ty(Context);
MemSetF = Intrinsic::getDeclaration(M, Intrinsic::memset, &Ty, 1);
}
// Get the starting pointer of the block.
StartPtr = Range.StartPtr;
// Cast the start ptr to be i8* as memset requires.
const Type *i8Ptr = PointerType::getUnqual(Type::getInt8Ty(Context));
if (StartPtr->getType() != i8Ptr)
StartPtr = new BitCastInst(StartPtr, i8Ptr, StartPtr->getName(),
InsertPt);
Value *Ops[] = {
StartPtr, ByteVal, // Start, value
// size
ConstantInt::get(Type::getInt64Ty(Context), Range.End-Range.Start),
// align
ConstantInt::get(Type::getInt32Ty(Context), Range.Alignment)
};
Value *C = CallInst::Create(MemSetF, Ops, Ops+4, "", InsertPt);
DEBUG(cerr << "Replace stores:\n";
for (unsigned i = 0, e = Range.TheStores.size(); i != e; ++i)
cerr << *Range.TheStores[i];
cerr << "With: " << *C); C=C;
// Don't invalidate the iterator
BBI = BI;
// Zap all the stores.
for (SmallVector<StoreInst*, 16>::const_iterator
SI = Range.TheStores.begin(),
SE = Range.TheStores.end(); SI != SE; ++SI)
(*SI)->eraseFromParent();
++NumMemSetInfer;
MadeChange = true;
}
return MadeChange;
}
/// performCallSlotOptzn - takes a memcpy and a call that it depends on,
/// and checks for the possibility of a call slot optimization by having
/// the call write its result directly into the destination of the memcpy.
bool MemCpyOpt::performCallSlotOptzn(MemCpyInst *cpy, CallInst *C) {
// The general transformation to keep in mind is
//
// call @func(..., src, ...)
// memcpy(dest, src, ...)
//
// ->
//
// memcpy(dest, src, ...)
// call @func(..., dest, ...)
//
// Since moving the memcpy is technically awkward, we additionally check that
// src only holds uninitialized values at the moment of the call, meaning that
// the memcpy can be discarded rather than moved.
// Deliberately get the source and destination with bitcasts stripped away,
// because we'll need to do type comparisons based on the underlying type.
Value* cpyDest = cpy->getDest();
Value* cpySrc = cpy->getSource();
CallSite CS = CallSite::get(C);
// We need to be able to reason about the size of the memcpy, so we require
// that it be a constant.
ConstantInt* cpyLength = dyn_cast<ConstantInt>(cpy->getLength());
if (!cpyLength)
return false;
// Require that src be an alloca. This simplifies the reasoning considerably.
AllocaInst* srcAlloca = dyn_cast<AllocaInst>(cpySrc);
if (!srcAlloca)
return false;
// Check that all of src is copied to dest.
TargetData* TD = getAnalysisIfAvailable<TargetData>();
if (!TD) return false;
ConstantInt* srcArraySize = dyn_cast<ConstantInt>(srcAlloca->getArraySize());
if (!srcArraySize)
return false;
uint64_t srcSize = TD->getTypeAllocSize(srcAlloca->getAllocatedType()) *
srcArraySize->getZExtValue();
if (cpyLength->getZExtValue() < srcSize)
return false;
// Check that accessing the first srcSize bytes of dest will not cause a
// trap. Otherwise the transform is invalid since it might cause a trap
// to occur earlier than it otherwise would.
if (AllocaInst* A = dyn_cast<AllocaInst>(cpyDest)) {
// The destination is an alloca. Check it is larger than srcSize.
ConstantInt* destArraySize = dyn_cast<ConstantInt>(A->getArraySize());
if (!destArraySize)
return false;
uint64_t destSize = TD->getTypeAllocSize(A->getAllocatedType()) *
destArraySize->getZExtValue();
if (destSize < srcSize)
return false;
} else if (Argument* A = dyn_cast<Argument>(cpyDest)) {
// If the destination is an sret parameter then only accesses that are
// outside of the returned struct type can trap.
if (!A->hasStructRetAttr())
return false;
const Type* StructTy = cast<PointerType>(A->getType())->getElementType();
uint64_t destSize = TD->getTypeAllocSize(StructTy);
if (destSize < srcSize)
return false;
} else {
return false;
}
// Check that src is not accessed except via the call and the memcpy. This
// guarantees that it holds only undefined values when passed in (so the final
// memcpy can be dropped), that it is not read or written between the call and
// the memcpy, and that writing beyond the end of it is undefined.
SmallVector<User*, 8> srcUseList(srcAlloca->use_begin(),
srcAlloca->use_end());
while (!srcUseList.empty()) {
User* UI = srcUseList.back();
srcUseList.pop_back();
if (isa<BitCastInst>(UI)) {
for (User::use_iterator I = UI->use_begin(), E = UI->use_end();
I != E; ++I)
srcUseList.push_back(*I);
} else if (GetElementPtrInst* G = dyn_cast<GetElementPtrInst>(UI)) {
if (G->hasAllZeroIndices())
for (User::use_iterator I = UI->use_begin(), E = UI->use_end();
I != E; ++I)
srcUseList.push_back(*I);
else
return false;
} else if (UI != C && UI != cpy) {
return false;
}
}
// Since we're changing the parameter to the callsite, we need to make sure
// that what would be the new parameter dominates the callsite.
DominatorTree& DT = getAnalysis<DominatorTree>();
if (Instruction* cpyDestInst = dyn_cast<Instruction>(cpyDest))
if (!DT.dominates(cpyDestInst, C))
return false;
// In addition to knowing that the call does not access src in some
// unexpected manner, for example via a global, which we deduce from
// the use analysis, we also need to know that it does not sneakily
// access dest. We rely on AA to figure this out for us.
AliasAnalysis& AA = getAnalysis<AliasAnalysis>();
if (AA.getModRefInfo(C, cpy->getRawDest(), srcSize) !=
AliasAnalysis::NoModRef)
return false;
// All the checks have passed, so do the transformation.
bool changedArgument = false;
for (unsigned i = 0; i < CS.arg_size(); ++i)
if (CS.getArgument(i)->stripPointerCasts() == cpySrc) {
if (cpySrc->getType() != cpyDest->getType())
cpyDest = CastInst::CreatePointerCast(cpyDest, cpySrc->getType(),
cpyDest->getName(), C);
changedArgument = true;
if (CS.getArgument(i)->getType() != cpyDest->getType())
CS.setArgument(i, CastInst::CreatePointerCast(cpyDest,
CS.getArgument(i)->getType(), cpyDest->getName(), C));
else
CS.setArgument(i, cpyDest);
}
if (!changedArgument)
return false;
// Drop any cached information about the call, because we may have changed
// its dependence information by changing its parameter.
MemoryDependenceAnalysis& MD = getAnalysis<MemoryDependenceAnalysis>();
MD.removeInstruction(C);
// Remove the memcpy
MD.removeInstruction(cpy);
cpy->eraseFromParent();
NumMemCpyInstr++;
return true;
}
/// processMemCpy - perform simplication of memcpy's. If we have memcpy A which
/// copies X to Y, and memcpy B which copies Y to Z, then we can rewrite B to be
/// a memcpy from X to Z (or potentially a memmove, depending on circumstances).
/// This allows later passes to remove the first memcpy altogether.
bool MemCpyOpt::processMemCpy(MemCpyInst* M) {
MemoryDependenceAnalysis& MD = getAnalysis<MemoryDependenceAnalysis>();
// The are two possible optimizations we can do for memcpy:
// a) memcpy-memcpy xform which exposes redundance for DSE
// b) call-memcpy xform for return slot optimization
MemDepResult dep = MD.getDependency(M);
if (!dep.isClobber())
return false;
if (!isa<MemCpyInst>(dep.getInst())) {
if (CallInst* C = dyn_cast<CallInst>(dep.getInst()))
return performCallSlotOptzn(M, C);
return false;
}
MemCpyInst* MDep = cast<MemCpyInst>(dep.getInst());
// We can only transforms memcpy's where the dest of one is the source of the
// other
if (M->getSource() != MDep->getDest())
return false;
// Second, the length of the memcpy's must be the same, or the preceeding one
// must be larger than the following one.
ConstantInt* C1 = dyn_cast<ConstantInt>(MDep->getLength());
ConstantInt* C2 = dyn_cast<ConstantInt>(M->getLength());
if (!C1 || !C2)
return false;
uint64_t DepSize = C1->getValue().getZExtValue();
uint64_t CpySize = C2->getValue().getZExtValue();
if (DepSize < CpySize)
return false;
// Finally, we have to make sure that the dest of the second does not
// alias the source of the first
AliasAnalysis& AA = getAnalysis<AliasAnalysis>();
if (AA.alias(M->getRawDest(), CpySize, MDep->getRawSource(), DepSize) !=
AliasAnalysis::NoAlias)
return false;
else if (AA.alias(M->getRawDest(), CpySize, M->getRawSource(), CpySize) !=
AliasAnalysis::NoAlias)
return false;
else if (AA.alias(MDep->getRawDest(), DepSize, MDep->getRawSource(), DepSize)
!= AliasAnalysis::NoAlias)
return false;
// If all checks passed, then we can transform these memcpy's
const Type *Tys[1];
Tys[0] = M->getLength()->getType();
Function* MemCpyFun = Intrinsic::getDeclaration(
M->getParent()->getParent()->getParent(),
M->getIntrinsicID(), Tys, 1);
Value *Args[4] = {
M->getRawDest(), MDep->getRawSource(), M->getLength(), M->getAlignmentCst()
};
CallInst* C = CallInst::Create(MemCpyFun, Args, Args+4, "", M);
// If C and M don't interfere, then this is a valid transformation. If they
// did, this would mean that the two sources overlap, which would be bad.
if (MD.getDependency(C) == dep) {
MD.removeInstruction(M);
M->eraseFromParent();
NumMemCpyInstr++;
return true;
}
// Otherwise, there was no point in doing this, so we remove the call we
// inserted and act like nothing happened.
MD.removeInstruction(C);
C->eraseFromParent();
return false;
}
// MemCpyOpt::runOnFunction - This is the main transformation entry point for a
// function.
//
bool MemCpyOpt::runOnFunction(Function& F) {
bool changed = false;
bool shouldContinue = true;
while (shouldContinue) {
shouldContinue = iterateOnFunction(F);
changed |= shouldContinue;
}
return changed;
}
// MemCpyOpt::iterateOnFunction - Executes one iteration of GVN
bool MemCpyOpt::iterateOnFunction(Function &F) {
bool changed_function = false;
// Walk all instruction in the function
for (Function::iterator BB = F.begin(), BBE = F.end(); BB != BBE; ++BB) {
for (BasicBlock::iterator BI = BB->begin(), BE = BB->end();
BI != BE;) {
// Avoid invalidating the iterator
Instruction* I = BI++;
if (StoreInst *SI = dyn_cast<StoreInst>(I))
changed_function |= processStore(SI, BI);
else if (MemCpyInst* M = dyn_cast<MemCpyInst>(I)) {
changed_function |= processMemCpy(M);
}
}
}
return changed_function;
}
| [
"feqin1023@gmail.com"
] | feqin1023@gmail.com |
3cf58510f302be4cdbca39d381926d80732de312 | 068d662c808fca5c69edd07c517da485bed8d16f | /Phone_Keypad.cpp | c446d7f783a48f17a9d3fcaf43edcd1acf583ac4 | [] | no_license | jai13598/Mobile-Phone_keypad | 37e8760ab1829476bdd8315411d9fade27ee43f2 | a10c9eb6d16a3cfcde7872a5e8d60f66a5647a2a | refs/heads/master | 2022-10-05T07:30:10.009943 | 2020-06-08T07:09:52 | 2020-06-08T07:09:52 | 270,567,061 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 497 | cpp | #include<iostream>
using namespace std;
char key[][10]={"","","ABC","DEF","GHI","JKL","MNO","PQRS","TUV","WXYZ"};
void Phone_keypad(char* in,char* opt,int i,int j){
if(in[i]=='\0'){//base case
opt[j]='\0';
cout<<opt<<endl;
return;
}
//recursive case
int digit=in[i]-'0';
for(int k=0;key[digit][k]!='\0';k++){
opt[j]=key[digit][k];
Phone_keypad(in,opt,i+1,j+1);
}
}
int main(){
char in[100];
char opt[100];
cin>>in;
Phone_keypad(in,opt,0,0);
return 0;
}
| [
"noreply@github.com"
] | noreply@github.com |
e7f018faeaf4eab7c4f4db45e9ab9c861bc20a1c | 30ef17f79b134a83b6e5e440937c886cce5afa7b | /src/dram.cpp | 5ed812e336d3c51902a248a9a5ee16f83a9e46f6 | [] | no_license | amitsunildhamne/Chip-Multi-Processor-System | af2a234fe7fbe18373a3885312af52542906fce3 | ed6c18499eebda48ce185926871d60ba686cc8f3 | refs/heads/master | 2021-01-22T23:20:34.164902 | 2017-03-20T20:44:50 | 2017-03-20T20:44:50 | 85,624,870 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,643 | cpp | #include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include "dram.h"
#define DRAM_Banks 16
#define ROW_BUFF_SZ 1024
#define ACT 45
#define CAS 45
#define PRE 45
#define BUS 10
extern MODE SIM_MODE;
extern uns64 CACHE_LINESIZE;
extern Flag DRAM_PAGE_POLICY;
////////////////////////////////////////////////////////////////////
// ------------- TRY NOT TO MODIFY THE PRINT STATS FUNCTION -------
///////////////////////////////////////////////////////////////////
DRAM* dram_new()
{
DRAM* dramMem = (DRAM* )calloc(1, sizeof(DRAM));
for(int ii =0; ii<256;ii++)
{
dramMem->Row_Buffer_Entry[ii].Row_Id=ii;
}
return dramMem;
}
uns64 dram_access(DRAM *dram,Addr lineaddr, Flag is_dram_write)
{
uns64 delay = 100;
if(SIM_MODE != SIM_MODE_B)
delay = dram_access_mode_CDE(dram, lineaddr, is_dram_write);
if(is_dram_write)
{
dram->stat_write_access++;
dram->stat_write_delay = dram->stat_write_delay+delay;
}
else
{
dram->stat_read_access++;
dram->stat_read_delay = dram->stat_read_delay+delay;
}
return delay;
}
uns64 dram_access_mode_CDE(DRAM *dram, Addr lineaddr, Flag is_dram_write)
{
uns64 delay_cp = ACT + CAS + BUS;
uns64 delay_op;
uns64 offset = ROW_BUFF_SZ / CACHE_LINESIZE;
uns64 Bank_ID = (lineaddr / offset) % DRAM_Banks;
uns64 Row_Buf_ID = (lineaddr / offset) / DRAM_Banks;
//close page policy
//open page policy
if(DRAM_PAGE_POLICY == 0)
{
if(dram->Row_Buffer_Entry[Bank_ID].valid)
{
if(dram->Row_Buffer_Entry[Bank_ID].Row_Id != Row_Buf_ID)
{
dram->Row_Buffer_Entry[Bank_ID].Row_Id = Row_Buf_ID;
delay_op = PRE + ACT + CAS + BUS;
}
else
delay_op = CAS + BUS;
}
else
{
dram->Row_Buffer_Entry[Bank_ID].valid = true;
dram->Row_Buffer_Entry[Bank_ID].Row_Id = Row_Buf_ID;
delay_op = ACT + CAS + BUS;
}
return delay_op;
}
if(DRAM_PAGE_POLICY == 1)
{
return delay_cp;
}
}
void dram_print_stats(DRAM *dram)
{
double rddelay_avg=0;
double wrdelay_avg=0;
char header[256];
sprintf(header, "DRAM");
if(dram->stat_read_access){
rddelay_avg=(double)(dram->stat_read_delay)/(double)(dram->stat_read_access);
}
if(dram->stat_write_access){
wrdelay_avg=(double)(dram->stat_write_delay)/(double)(dram->stat_write_access);
}
printf("\n%s_READ_ACCESS\t\t : %10llu", header, dram->stat_read_access);
printf("\n%s_WRITE_ACCESS\t\t : %10llu", header, dram->stat_write_access);
printf("\n%s_READ_DELAY_AVG\t\t : %10.3f", header, rddelay_avg);
printf("\n%s_WRITE_DELAY_AVG\t\t : %10.3f", header, wrdelay_avg);
}
| [
"vidyalankar@Amitdhamne.local"
] | vidyalankar@Amitdhamne.local |
075f2d45147435da5aed171515976b5ad68f1305 | 2e4b3664cb689c606463abbb4fe569afa3bdfd6f | /PewPew/Subject.cpp | b5ae402707a01a05405429680ff9be89930d5867 | [] | no_license | PigeonZombie/PewPew | f1a584900c3385579aa67bd49167a832000308cf | 940679616c1eaec52d353425d6a52ecbe7b76b69 | refs/heads/master | 2021-06-06T13:06:26.025787 | 2016-10-30T15:15:31 | 2016-10-30T15:15:31 | 72,356,362 | 0 | 0 | null | null | null | null | ISO-8859-1 | C++ | false | false | 1,545 | cpp | #include "Subject.h"
#include <exception>
#include <iostream>
#include "Joueur.h"
vector<IObserver*> Subject::observers;
vector<IObserver*> Subject::armeObservers;
void Subject::Add_Observer(IObserver* _observer)
{
//Si l'observateur n'est pas déjà dans la liste...
if (!(std::find(observers.begin(), observers.end(), _observer) != observers.end()))
{
observers.push_back(_observer);
}
}
void Subject::Remove_Observer(IObserver* _observer)
{
//Pour retirer un observateur de la liste.
//Deux pointeurs qui pointent à la même adresse sont égaux.
for (int i = 0; i < observers.size(); i++)
{
if (observers[i] == _observer)
{
observers.erase(observers.begin() + i);
return;
}
}
}
//Suite à une action on fait toujours ça.
void Subject::Notify_Observers(bool _isArme, bool _isFromShot, std::type_index* _typeIdJoueur)
{
if (!_isArme)
{
for (int i = 0; i < this->observers.size(); i++)
{
if (observers[i] != nullptr)
{
this->observers[i]->Notify(this);
}
else
{
Remove_Observer(this->observers[i]);
}
}
}
else
{
for (int i = 0; i < this->armeObservers.size(); i++)
{
if (armeObservers[i] != nullptr)
{
if (_isFromShot)
{
if (!(std::type_index(typeid(*armeObservers[i])) == *_typeIdJoueur))
{
this->armeObservers[i]->Notify(this);
}
}
else
this->armeObservers[i]->Notify(this);
}
}
}
}
void Subject::CreerArmeObservers(IObserver* _ob1, IObserver* _ob2)
{
armeObservers.push_back(_ob1);
armeObservers.push_back(_ob2);
} | [
"alicia.orchidee@gmail.com"
] | alicia.orchidee@gmail.com |
243a061aa7c4466f7a2bf9972646f83af6b2f98e | e112299d9dd49af971a95b65f84d3684c1b76beb | /4.1 Tree/9) Convert Sorted Array to Binary Search Tree.cpp | c142838bff2e3b76cfaa60d0bea91b50d1f169e1 | [] | no_license | kaili302/Leetcode-CPP-exercises | 3c47be20bfc982ece07632b64e64d5e67e355a4c | 4de5c5b5265fd1fdad2dfdad7120472cfcc0d269 | refs/heads/master | 2021-08-27T16:15:03.089910 | 2016-11-20T15:58:29 | 2016-11-20T15:58:29 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 707 | cpp | /*
Given an array where elements are sorted in ascending order, convert it to a height balanced BST.
*/
class Solution{
private:
deque<TreeNode*> toDelete;
TreeNode* newNode(int val){
toDelete.push_back(new TreeNode(val));
return toDelete.back();
}
TreeNode* generateBST(vector<int>& nums, int lo, int hi){
if (lo > hi) return nullptr;
int mid = (lo + hi) / 2;
TreeNode* pNode = newNode(nums[mid]);
pNode->left = generateBST(nums, lo, mid - 1);
pNode->right = generateBST(nums, mid + 1, hi);
return pNode;
}
public:
~Solution(){ for (auto& pNode : toDelete) delete pNode; }
TreeNode* sortedArrayToBST(vector<int>& nums){
return generateBST(nums, 0, nums.size() - 1);
}
};
| [
"kai_li@outlook.com"
] | kai_li@outlook.com |
f713f50f3fa0f563e84439513472770afd36de53 | a66657cb39f14ea23dd102ab1ee1cb968cd369eb | /Maternodes/ChainX-MN/rpcwallet.cpp | 443c1a8a5ac68de6c795c6627803d78b3046bf98 | [
"MIT"
] | permissive | pochingchen/ChainBlockchain | de7180707f6b309096cfb3ada97d1ea55f580b65 | 0fb3bb5677109ff75de746e5bfd63a4e7a99ce75 | refs/heads/master | 2023-08-08T11:16:18.811141 | 2017-07-10T21:36:38 | 2017-07-10T21:36:38 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,185 | cpp | #include "amount.h"
#include "base58.h"
#include "chain.h"
#include "core_io.h"
#include "init.h"
#include "main.h"
#include "net.h"
#include "netbase.h"
#include "policy/rbf.h"
#include "rpcserver.h"
#include "timedata.h"
#include "util.h"
#include "utilmoneystr.h"
#include "wallet.h"
#include "walletdb.h"
#include "keepass.h"
#include <stdint.h>
#include <boost/assign/list_of.hpp>
#include <univalue.h>
using namespace std;
int64_t nWalletUnlockTime;
static CCriticalSection cs_nWalletUnlockTime;
std::string HelpRequiringPassphrase()
{
return pwalletMain && pwalletMain->IsCrypted()
? "\nRequires wallet passphrase to be set with walletpassphrase call."
: "";
}
bool EnsureWalletIsAvailable(bool avoidException)
{
if (!pwalletMain)
{
if (!avoidException)
throw JSONRPCError(RPC_METHOD_NOT_FOUND, "Method not found (disabled)");
else
return false;
}
return true;
}
void EnsureWalletIsUnlocked()
{
if (pwalletMain->IsLocked())
throw JSONRPCError(RPC_WALLET_UNLOCK_NEEDED, "Error: Please enter the wallet passphrase with walletpassphrase first.");
}
void WalletTxToJSON(const CWalletTx& wtx, UniValue& entry)
{
int confirms = wtx.GetDepthInMainChain(false);
int confirmsTotal = GetIXConfirmations(wtx.GetHash()) + confirms;
entry.push_back(Pair("confirmations", confirmsTotal));
entry.push_back(Pair("bcconfirmations", confirms));
if (wtx.IsCoinBase())
entry.push_back(Pair("generated", true));
if (confirms > 0)
{
entry.push_back(Pair("blockhash", wtx.hashBlock.GetHex()));
entry.push_back(Pair("blockindex", wtx.nIndex));
entry.push_back(Pair("blocktime", mapBlockIndex[wtx.hashBlock]->GetBlockTime()));
} else {
entry.push_back(Pair("trusted", wtx.IsTrusted()));
}
uint256 hash = wtx.GetHash();
entry.push_back(Pair("txid", hash.GetHex()));
UniValue conflicts(UniValue::VARR);
BOOST_FOREACH(const uint256& conflict, wtx.GetConflicts())
conflicts.push_back(conflict.GetHex());
entry.push_back(Pair("walletconflicts", conflicts));
entry.push_back(Pair("time", wtx.GetTxTime()));
entry.push_back(Pair("timereceived", (int64_t)wtx.nTimeReceived));
// Add opt-in RBF status
std::string rbfStatus = "no";
if (confirms <= 0) {
LOCK(mempool.cs);
if (!mempool.exists(hash)) {
if (SignalsOptInRBF(wtx)) {
rbfStatus = "yes";
} else {
rbfStatus = "unknown";
}
} else if (IsRBFOptIn(*mempool.mapTx.find(hash), mempool)) {
rbfStatus = "yes";
}
}
entry.push_back(Pair("bip125-replaceable", rbfStatus));
BOOST_FOREACH(const PAIRTYPE(string,string)& item, wtx.mapValue)
entry.push_back(Pair(item.first, item.second));
}
string AccountFromValue(const UniValue& value)
{
string strAccount = value.get_str();
if (strAccount == "*")
throw JSONRPCError(RPC_WALLET_INVALID_ACCOUNT_NAME, "Invalid account name");
return strAccount;
}
UniValue getnewaddress(const UniValue& params, bool fHelp)
{
if (!EnsureWalletIsAvailable(fHelp))
return NullUniValue;
if (fHelp || params.size() > 1)
throw runtime_error(
"getnewaddress ( \"account\" )\n"
"\nReturns a new chainx address for receiving payments.\n"
"If 'account' is specified (DEPRECATED), it is added to the address book \n"
"so payments received with the address will be credited to 'account'.\n"
"\nArguments:\n"
"1. \"account\" (string, optional) DEPRECATED. The account name for the address to be linked to. If not provided, the default account \"\" is used. It can also be set to the empty string \"\" to represent the default account. The account does not need to exist, it will be created if there is no account by the given name.\n"
"\nResult:\n"
"\"chainxaddress\" (string) The new chainx address\n"
"\nExamples:\n"
+ HelpExampleCli("getnewaddress", "")
+ HelpExampleRpc("getnewaddress", "")
);
| [
"noreply@github.com"
] | noreply@github.com |
3c68bdead9037f07e734fd56b14d7c1727ba74bc | 94564668a6f472b5f73fc77a7356bc9dac0accb7 | /LabelInspection/LabelInspection.cpp | 19a4b0cb3f072f2a98ffe66717b74daf543daffa | [] | no_license | rkyoung3/LabelInspection | 717b37e83cf8a79e84d2e0380516d684a42e02f9 | 0feffe0b0256671b2b7a982a79d1949fae3eed7e | refs/heads/master | 2020-06-19T10:32:56.693124 | 2016-11-27T19:10:21 | 2016-11-27T19:10:21 | 74,908,427 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 62,726 | cpp | /* *************************************************************************************************
* LabelInspection - Created: 08/23/2016 3:25:59 PM
* Creator Robert K Young - rkyoung@sonic.net
* ChangeLog:
* 0.0.1 - 08/23/2016 03:32:33 PM - Initial Version
* 0.0.2 - 08/24/2016 04:22:15 PM - Added capture file name based on date/time
* 0.1.0 - 08/15/2016 03:38:58 PM - First beta version with basic functionality
* 0.2.0 - 08/25/2016 01:36:01 PM - Incorporated OpenCV
* 0.3.0 - 09/01/2016 05:21:43 PM - Began implementing MediaFoundation calls to control camera.
* 0.4.0 - 09/13/2016 09:11:15 AM - Implementation of MediaFoundation failed, moving on to processing image
* 0.5.0 - 10/15/2016 11:06:10 AM - Successfully locate all ref marks on simulated data
* 0.6.0 - 11/04/2016 12:51:16 AM - Successfully create Golden Image from all ref marks found
* 0.7.0 - 11/24/2016 11:18:32 AM - Final Registration Mark version (Changing to border detection).
* 0.8.0 - 11/27/2016 11:06:18 AM - Begin implementing BorderDetection
//*************************************************************************************************
*/
#include "stdafx.h"
// #define POINT_GREY_CAMERA 1
#define CANERA_WIDTH 1288
#define CANERA_HEIGHT 964
using namespace cv;
using namespace std;
namespace std {
#include <cstdlib>
};
// Contributing Source Used: http://www.dreamincode.net/forums/topic/193519-win32-webcam-program/
HWND mil_hWindow;
PBITMAPINFO CreateBitmapInfoStruct(HWND hwnd, HBITMAP hBmp);
bool CreateBMPFile(HWND hwnd, LPTSTR pszFile, PBITMAPINFO pbi, HBITMAP hBMP, HDC hDC);
LPCTSTR szAppName = L"FrameGrab";
void drawImage(HDC screen, HDC *imageDC);
void Get_DeviceInfo();
int enum_devices();
void process_filter(IBaseFilter *pBaseFilter, int iIndex);
HRESULT CamCaps(IBaseFilter *pBaseFilter, int iIndex);
void _FreeMediaType(AM_MEDIA_TYPE& mt);
static void setcolor(unsigned int color);
void loadImage(const char* pathname, HDC *imageDC, HBITMAP *imageBmp);
void cleanUpImage(HDC *imageDC, HBITMAP *imageBmp);
BOOL LoadBitmapFromBMPFile(LPTSTR szFileName, HBITMAP *phBitmap, HPALETTE *phPalette);
DWORD WINAPI SetupThreadProc(_In_ LPVOID lpParameter);
BOOL bPointIsInRect(POINT Candidate, RECT Area);
BOOL GetClientScreenCoordinates(HWND hWindowParent, HWND hWindowChild, RECT *pRect);
void Screen2Client(POINT *MousePosition);
UINT LocateRefMarks(RECT *CaptureRect, HDC RMarkHandel);
BOOL isMatchToRefColumn(RGBTRIPLE *RefValues, RGBTRIPLE *CandidatePixel, UINT Increment, UINT NumberOfValues, BYTE rgbTolerance);
BOOL isMatchToRefRow(RGBTRIPLE *RefValues, RGBTRIPLE *CandidatePixel, UINT NumberOfValues, BYTE rgbTolerance);
BOOL rectIsDuplicate(RECT *RefMarkRects, RECT Candidate, UINT MarksFound);
bool CreateReferenceImage(RGBTRIPLE *FullImage, UINT FullZoneWidth, UINT FullZoneHeight);
HWND mil_hButtonChangeCam;
HWND mil_hButtonRefImage;
HWND mli_CameraHwnd;
int mil_CameraCount;
int mli_WindowX_Dim;
int mli_WindowY_Dim;
int mli_CamWindowX_Dim;
int mli_CamWindowY_Dim;
float mil_Dim_Multiplier;
float mil_Dim_Conversion;
bool mil_bCameraConnected = false;
PBITMAPINFO mil_pImageBitMapInfo;
LPBYTE mil_pImageBits;
RGBTRIPLE *mil_RefImage;
wchar_t* mil_CameraNames[MAX_CAMERAS];
RECT mil_RectsDefined[MAX_RECTANGLES];
RECT *mil_RefMarkRects = NULL;
RECT *mil_ZoneRects = NULL;
UINT mil_ToDraw = 0;
ProcessImage *mil_ProcessImage;
// The Inspection area is defined as the opposite
// corner from the down point that defined the Rectangle
// of the RefMark.
UINT mil_RectsToDraw = 0;
bool bBeginDefiningRefMark = false;
bool bDefiningRefMark = false;
bool bRefMarkSearched = false;
bool bDrawFoundRefMark = false;
bool mil_bRefMarksDrawn = false;
bool mil_bDefiningInspectionZone = false;
bool bDefiningInspectionZone = false;
POINT mil_DownPointRefMark;
POINT mil_UpPointRefMark;
POINT mil_InspectionArea;
wchar_t mil_DbgMesg[MAX_PATH];
HWND hUserMsg;
HDC mil_hdcMem;
RECT mil_MainClientRect;
RECT mil_CamClientRect;
HDC WorkimageDC; // the DC to hold our image
HBITMAP hbmp_image0Bmp; // the bitmap which contains the image we are working on
HPALETTE hPalette;
HBITMAP imageBmpOld; // the DC's old bitmap (for cleanup)
HBITMAP OriginalimageBmp;
RGBTRIPLE *mil_SubImage;
// Global Variables:
HINSTANCE hInst; // current instance
WCHAR szTitle[MAX_LOADSTRING]; // The title bar text
WCHAR szWindowClass[MAX_LOADSTRING]; // the main window class name
// Forward declarations of functions included in this code module:
ATOM li_RegisterClass(HINSTANCE hInstance);
BOOL InitInstance(HINSTANCE, int);
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
INT_PTR CALLBACK About(HWND, UINT, WPARAM, LPARAM);
int APIENTRY wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, _In_ LPWSTR lpCmdLine, _In_ int nCmdShow)
{
UNREFERENCED_PARAMETER(hPrevInstance);
UNREFERENCED_PARAMETER(lpCmdLine);
// TODO: Place code here.
// int result;
// Get_DeviceInfo();
mil_CameraCount = enum_devices();
if(mil_CameraCount == 0)
return FALSE;
// Initialize global strings
LoadStringW(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
LoadStringW(hInstance, IDC_LABELINSPECTION, szWindowClass, MAX_LOADSTRING);
li_RegisterClass(hInstance);
// Perform application initialization:
if (!InitInstance (hInstance, nCmdShow))
{
return FALSE;
}
HACCEL hAccelTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDC_LABELINSPECTION));
MSG msg;
// Main message loop:
while (GetMessage(&msg, 0, 0, 0))
{
if (!IsDialogMessage(mil_hWindow, &msg))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
return (int) msg.wParam;
}
//
// FUNCTION: MyRegisterClass()
//
// PURPOSE: Registers the window class.
//
ATOM li_RegisterClass(HINSTANCE hInstance)
{
WNDCLASSEXW wcex;
wcex.cbSize = sizeof(WNDCLASSEX);
wcex.style = CS_HREDRAW | CS_VREDRAW;
wcex.lpfnWndProc = WndProc;
wcex.cbClsExtra = 0;
wcex.cbWndExtra = 0;
wcex.hInstance = hInstance;
wcex.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_LABELINSPECTION));
wcex.hCursor = NULL; // LoadCursor(nullptr, IDC_ARROW);
wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
wcex.lpszMenuName = MAKEINTRESOURCEW(IDC_LABELINSPECTION);
wcex.lpszClassName = szWindowClass;
wcex.hIconSm = LoadIcon(wcex.hInstance, MAKEINTRESOURCE(IDI_SMALL));
return RegisterClassExW(&wcex);
}
//
// FUNCTION: InitInstance(HINSTANCE, int)
//
// PURPOSE: Saves instance handle and creates main window
//
// COMMENTS:
//
// In this function, we save the instance handle in a global variable and
// create and display the main program window.
//
BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
{
hInst = hInstance; // Store instance handle in our global variable
// Get the desktop dims and take a little off all four sides
mli_WindowX_Dim = GetSystemMetrics(SM_CXSCREEN); // -(GetSystemMetrics(SM_CXSCREEN) >> 4));
mli_WindowY_Dim = GetSystemMetrics(SM_CYSCREEN); // -(GetSystemMetrics(SM_CYSCREEN) >> 4));
DWORD dwStyle = WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX;
if ((swprintf_s(mil_DbgMesg, (size_t)MAX_PATH, L"Creating MainWindow: %04d x %04d Style: 0x%08X\n", mli_WindowX_Dim, mli_WindowY_Dim, dwStyle) > 0))
OutputDebugString(mil_DbgMesg);
mil_hWindow = CreateWindowW(szWindowClass, szTitle, dwStyle, CW_USEDEFAULT, CW_USEDEFAULT, mli_WindowX_Dim, mli_WindowY_Dim, nullptr, nullptr, hInstance, nullptr);
if (!mil_hWindow)
{
return FALSE;
}
ShowWindow(mil_hWindow, nCmdShow);
UpdateWindow(mil_hWindow);
return TRUE;
}
// FUNCTION: WndProc(HWND, UINT, WPARAM, LPARAM)
//
// PURPOSE: Processes messages for the main window.
//
// WM_COMMAND - process the application menu
// WM_PAINT - Paint the main window
// WM_DESTROY - post a quit message and return
LRESULT CALLBACK WndProc(HWND hWindow, UINT WndMessage, WPARAM wParam, LPARAM lParam)
{
HINSTANCE hInstance = GetModuleHandle(NULL);
switch (WndMessage)
{
case WM_CTLCOLORSTATIC:
SetBkMode(mil_hdcMem, TRANSPARENT);
return (LRESULT)CreateSolidBrush(0xFFFFFF);
case WM_CREATE:
{
// If we have more than one camera
// add a change camera button
if (mil_CameraCount > 1)
{
mil_hButtonChangeCam = CreateWindowEx(0, L"BUTTON", L"Change Camera", WS_CHILD | WS_VISIBLE, 0, 0, WIDTH_CAMERA_EXCLUDE, 60, hWindow, (HMENU) MENU_BUTTON_CHANGECAM, hInstance, 0);
mil_hButtonRefImage = CreateWindowEx(0, L"BUTTON", L"Create Ref Image", WS_CHILD | WS_VISIBLE, 0, 75, WIDTH_CAMERA_EXCLUDE, 60, hWindow, (HMENU) MENU_BUTTON_REF_IMAGE, hInstance, 0);
hUserMsg = CreateWindowEx(WS_EX_CLIENTEDGE, L"EDIT", L"Status Messages", WS_CHILD | WS_VISIBLE | ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | WS_BORDER, 0, 150, WIDTH_CAMERA_EXCLUDE, 200, hWindow, (HMENU)MENU_STAT_WINDOW, hInstance, NULL);
}else{
mil_hButtonRefImage = CreateWindowEx(0, L"BUTTON", L"Create Ref Image", WS_CHILD | WS_VISIBLE, 0, 0, WIDTH_CAMERA_EXCLUDE, 60, hWindow, (HMENU)MENU_BUTTON_REF_IMAGE, hInstance, 0);
hUserMsg = CreateWindowEx(WS_EX_CLIENTEDGE, L"EDIT", L"Status Messages", WS_CHILD | WS_VISIBLE | ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | WS_BORDER, 0, 150, WIDTH_CAMERA_EXCLUDE, 200, hWindow, (HMENU)MENU_STAT_WINDOW, hInstance, NULL);
}
HGDIOBJ hfDefault = GetStockObject(DEFAULT_GUI_FONT);
SendMessage(hUserMsg, WM_SETFONT, (WPARAM)hfDefault, MAKELPARAM(FALSE, 0));
SendMessage(hUserMsg, WM_SETTEXT, NULL, (LPARAM)L"Status Messages:");
DWORD dwStyle = WS_CHILD | WS_VISIBLE | WS_BORDER; // | WS_HSCROLL | WS_VSCROLL;
// Calc how much we need to shrink the width to fit the screen
float XDim_Multiplier = 1.0;
if ( (mli_WindowX_Dim - WIDTH_CAMERA_EXCLUDE) < CANERA_WIDTH )
{
float FullWidth = (float) CANERA_WIDTH;
float MaxWidth = (float) (mli_WindowX_Dim - WIDTH_CAMERA_EXCLUDE);
XDim_Multiplier = (MaxWidth / FullWidth);
}
// Calc how much we need to shrink the height to fit the screen
float YDim_Multiplier = 1.0;
if ( (mli_WindowY_Dim - HEIGHT_CAMERA_EXCLUDE) < CANERA_HEIGHT )
{
float FullHeight = (float) CANERA_HEIGHT;
float MaxHeight = (float) (mli_WindowY_Dim - HEIGHT_CAMERA_EXCLUDE);
YDim_Multiplier = (MaxHeight / FullHeight);
}
// Choose the smallest of the two multipliers and use it on
// both dimensions so that we maintain a correct aspect ratio
mil_Dim_Multiplier = min(XDim_Multiplier, YDim_Multiplier);
mli_CamWindowX_Dim = (int)(((float)(CANERA_WIDTH)) * mil_Dim_Multiplier);
mli_CamWindowY_Dim = (int)(((float)(CANERA_HEIGHT)) * mil_Dim_Multiplier);
// Calc the exact inverse so that screen/image
// conversions are correct in both directions
mil_Dim_Conversion = ((float) 1.0) + ( 1.0 - mil_Dim_Multiplier);
if ((swprintf_s(mil_DbgMesg, (size_t)MAX_PATH, L"Window Translate - Mult: %1.6f Cnvt: %1.6f\n", mil_Dim_Multiplier, mil_Dim_Conversion) > 0))
OutputDebugString(mil_DbgMesg);
mli_CameraHwnd = capCreateCaptureWindow(L"camera window", dwStyle, 301, 0, mli_CamWindowX_Dim, mli_CamWindowY_Dim, hWindow, 0);
if ((swprintf_s(mil_DbgMesg, (size_t)MAX_PATH, L"Creating Camera Window: %04d x %04d\n", mli_CamWindowX_Dim, mli_CamWindowY_Dim) > 0))
OutputDebugString(mil_DbgMesg);
// Put the hardware into a known state
SendMessage(mli_CameraHwnd, WM_CAP_DRIVER_DISCONNECT, 0, 0);
// In multiple camera environments: Windows insists
// on handeling camera selection it will use whatever
// camera the user selects as camera 0
SendMessage(mli_CameraHwnd, WM_CAP_DRIVER_CONNECT, 0, 0);
SendMessage(mli_CameraHwnd, WM_CAP_SET_SCALE, true, 0);
SendMessage(mli_CameraHwnd, WM_CAP_SET_PREVIEWRATE, 66, 0);
SendMessage(mli_CameraHwnd, WM_CAP_SET_PREVIEW, true, 0);
ShowWindow(hWindow, SW_SHOW);
break;
} // End case WM_CREATE:
case WM_LBUTTONDOWN:
{
POINT MousePosition;
MousePosition.x = GET_X_LPARAM(lParam);
MousePosition.y = GET_Y_LPARAM(lParam);
if ((swprintf_s(mil_DbgMesg, (size_t)MAX_PATH, L"Reported Mouse Button Down Position - X: %04d Y: %04d\n", MousePosition.x, MousePosition.y) > 0))
OutputDebugString(mil_DbgMesg);
if (bPointIsInRect(MousePosition, mil_CamClientRect))
{
// ScreenToClient(mli_CameraHwnd, &MousePosition);
Screen2Client(&MousePosition);
if ((swprintf_s(mil_DbgMesg, (size_t)MAX_PATH, L"After Left Button Down Position - X: %04d Y: %04d\n", MousePosition.x, MousePosition.y) > 0))
OutputDebugString(mil_DbgMesg);
if (mil_bDefiningInspectionZone)
{
mil_bDefiningInspectionZone = false;
bBeginDefiningRefMark = false;
bDefiningRefMark = true;
mil_InspectionArea = MousePosition;
SetRect(&mil_RectsDefined[ZONE_RECTANGLE], mil_DownPointRefMark.x, mil_DownPointRefMark.y, mil_InspectionArea.x, mil_InspectionArea.y);
ReleaseCapture();
mil_RectsToDraw = 2;
bDrawFoundRefMark = true;
RedrawWindow(hWindow, NULL, NULL, RDW_INVALIDATE);
}
if (bBeginDefiningRefMark)
{
bBeginDefiningRefMark = false;
bDefiningRefMark = true;
mil_DownPointRefMark = MousePosition;
if ((swprintf_s(mil_DbgMesg, (size_t)MAX_PATH, L"Left Button Down Position - X: %04d Y: %04d\n", mil_DownPointRefMark.x, mil_DownPointRefMark.y) > 0))
OutputDebugString(mil_DbgMesg);
HCURSOR hCursor = LoadCursor(NULL, IDC_CROSS);
SetCursor(hCursor);
} // End if (bBeginDefiningRefMark)
}else{ // Button down outside camera window cancel any definitions in progress
if (bBeginDefiningRefMark || bDefiningRefMark || mil_bDefiningInspectionZone)
{
bDefiningRefMark = FALSE;
Button_Enable(mil_hButtonRefImage, TRUE);
ReleaseCapture();
if ((swprintf_s(mil_DbgMesg, (size_t)MAX_PATH, L"Left Button Down Outside Camera Window - X: %04d Y: %04d\n", MousePosition.x, MousePosition.y) > 0))
OutputDebugString(mil_DbgMesg);
if (mil_hdcMem != NULL)
DeleteDC(mil_hdcMem);
if (hbmp_image0Bmp != NULL)
DeleteObject(hbmp_image0Bmp);
mil_hdcMem = NULL;
hbmp_image0Bmp = NULL;
// Put the hardware into a known state
SendMessage(mli_CameraHwnd, WM_CAP_DRIVER_DISCONNECT, 0, 0);
SendMessage(mli_CameraHwnd, WM_CAP_DRIVER_CONNECT, 0, 0);
SendMessage(mli_CameraHwnd, WM_CAP_SET_SCALE, true, 0);
SendMessage(mli_CameraHwnd, WM_CAP_SET_PREVIEWRATE, 66, 0);
SendMessage(mli_CameraHwnd, WM_CAP_SET_PREVIEW, true, 0);
}
}
break;
}
case WM_SIZE:
{
return 0;
}
case WM_MOUSEMOVE:
{
POINT MousePosition;
MousePosition.x = GET_X_LPARAM(lParam);
MousePosition.y = GET_Y_LPARAM(lParam);
if (bPointIsInRect(MousePosition, mil_CamClientRect))
{
// ScreenToClient(mli_CameraHwnd, &MousePosition);
Screen2Client(&MousePosition);
if (bDefiningRefMark)
{
mil_UpPointRefMark = MousePosition;
if ((swprintf_s(mil_DbgMesg, (size_t)MAX_PATH, L"Ref Mark Mouse Move Position - X: %04d Y: %04d\n", MousePosition.x, MousePosition.y) > 0))
OutputDebugString(mil_DbgMesg);
SetRect(&mil_RectsDefined[REF_RECTANGLE], mil_DownPointRefMark.x, mil_DownPointRefMark.y, mil_UpPointRefMark.x, mil_UpPointRefMark.y);
mil_RectsToDraw = 1;
RedrawWindow(hWindow, NULL, NULL, RDW_INVALIDATE);
}
if (mil_bDefiningInspectionZone)
{
mil_InspectionArea = MousePosition;
if ((swprintf_s(mil_DbgMesg, (size_t)MAX_PATH, L"Inspection Area - Mouse Move Position - X: %04d Y: %04d\n", MousePosition.x, MousePosition.y) > 0))
OutputDebugString(mil_DbgMesg);
SetRect(&mil_RectsDefined[ZONE_RECTANGLE], mil_DownPointRefMark.x, mil_DownPointRefMark.y, mil_InspectionArea.x, mil_InspectionArea.y);
mil_RectsToDraw = 2;
RedrawWindow(hWindow, NULL, NULL, RDW_INVALIDATE);
}
}
break;
}
case WM_LBUTTONUP:
{
POINT MousePosition;
MousePosition.x = GET_X_LPARAM(lParam);
MousePosition.y = GET_Y_LPARAM(lParam);
if (bPointIsInRect(MousePosition, mil_CamClientRect))
{
// ScreenToClient(mli_CameraHwnd, &MousePosition);
Screen2Client( &MousePosition);
if (bDefiningRefMark)
{
bDefiningRefMark = FALSE;
mil_bDefiningInspectionZone = true;
mil_UpPointRefMark = MousePosition;
if ((swprintf_s(mil_DbgMesg, (size_t)MAX_PATH, L"Ref Mark - Left Button Up Position - X: %04d Y: %04d\n", mil_UpPointRefMark.x, mil_UpPointRefMark.y) > 0))
OutputDebugString(mil_DbgMesg);
HCURSOR hCursor = LoadCursor(NULL, IDC_CROSS);
SetCursor(hCursor);
SendMessage(hUserMsg, WM_SETTEXT, NULL, (LPARAM)L"Click on opposite corner from RefMark to define the Inspection Area.");
SetRect(&mil_RectsDefined[REF_RECTANGLE], mil_DownPointRefMark.x, mil_DownPointRefMark.y, mil_UpPointRefMark.x, mil_UpPointRefMark.y);
} // End if (bDefiningRefMark)
}else{ // Button up outside camera window cancel DefiningRefMark
Button_Enable(mil_hButtonRefImage, TRUE);
ReleaseCapture();
if ((swprintf_s(mil_DbgMesg, (size_t)MAX_PATH, L"Ref Mark - Left Button Up Outside Camera Window - X: %04d Y: %04d\n", MousePosition.x, MousePosition.y) > 0))
OutputDebugString(mil_DbgMesg);
if (mil_hdcMem != NULL)
DeleteDC(mil_hdcMem);
if (hbmp_image0Bmp != NULL)
DeleteObject(hbmp_image0Bmp);
mil_hdcMem = NULL;
hbmp_image0Bmp = NULL;
HCURSOR hCursor = LoadCursor(NULL, IDC_ARROW);
SetCursor(hCursor);
// Put the hardware into a known state
SendMessage(mli_CameraHwnd, WM_CAP_DRIVER_DISCONNECT, 0, 0);
SendMessage(mli_CameraHwnd, WM_CAP_DRIVER_CONNECT, 0, 0);
SendMessage(mli_CameraHwnd, WM_CAP_SET_SCALE, true, 0);
SendMessage(mli_CameraHwnd, WM_CAP_SET_PREVIEWRATE, 66, 0);
SendMessage(mli_CameraHwnd, WM_CAP_SET_PREVIEW, true, 0);
}
break;
} // End case WM_LBUTTONUP:
case WM_COMMAND:
{
int wmId = LOWORD(wParam);
// Parse the menu selections:
switch (wmId)
{
case IDM_ABOUT:
DialogBox(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWindow, About);
break;
case IDM_EXIT:
DestroyWindow(hWindow);
break;
case MENU_BUTTON_CHANGECAM:
{
SendMessage(mli_CameraHwnd, WM_CAP_DLG_VIDEOSOURCE, 0, 0);
// Put the hardware into a known state
SendMessage(mli_CameraHwnd, WM_CAP_DRIVER_DISCONNECT, 0, 0);
SendMessage(mli_CameraHwnd, WM_CAP_DRIVER_CONNECT, 0, 0);
SendMessage(mli_CameraHwnd, WM_CAP_SET_SCALE, true, 0);
SendMessage(mli_CameraHwnd, WM_CAP_SET_PREVIEWRATE, 66, 0);
SendMessage(mli_CameraHwnd, WM_CAP_SET_PREVIEW, true, 0);
ShowWindow(mli_CameraHwnd, SW_SHOW);
break;
}
case MENU_BUTTON_REF_IMAGE:
{
PAINTSTRUCT ps;
//Grab a Frame
SendMessage(mli_CameraHwnd, WM_CAP_GRAB_FRAME, 0, 0);
//Copy the frame we have just grabbed to the clipboard
SendMessage(mli_CameraHwnd, WM_CAP_EDIT_COPY, 0, 0);
//Copy the clipboard image data to a HBITMAP object called hbm
HDC hdc = BeginPaint(mli_CameraHwnd, &ps);
if (hdc != NULL)
{
mil_hdcMem = CreateCompatibleDC(hdc);
if (mil_hdcMem != NULL)
{
#ifdef POINT_GREY_CAMERA
if (OpenClipboard(mli_CameraHwnd))
{
hbmp_image0Bmp = (HBITMAP)GetClipboardData(CF_BITMAP);
SelectObject(mil_hdcMem, hbmp_image0Bmp);
CloseClipboard();
}else{
DeleteDC(mil_hdcMem);
mil_hdcMem = NULL;
hbmp_image0Bmp = NULL;
}
if ((swprintf_s(mil_DbgMesg, (size_t)MAX_PATH, L"Result from OpenClipboard: %s\n", ((hbmp_image0Bmp != NULL) ? L"Success" : L"Failure")) > 0))
OutputDebugString(mil_DbgMesg);
#else
if (LoadBitmapFromBMPFile(L"Sample4.bmp", &hbmp_image0Bmp, &hPalette))
{
SelectObject(mil_hdcMem, hbmp_image0Bmp);
}else{
DeleteDC(mil_hdcMem);
mil_hdcMem = NULL;
hbmp_image0Bmp = NULL;
}
if ((swprintf_s(mil_DbgMesg, (size_t)MAX_PATH, L"Result from LoadBitmapFromBMPFile: %s\n", ((hbmp_image0Bmp != NULL) ? L"Success" : L"Failure")) > 0))
OutputDebugString(mil_DbgMesg);
#endif
if (hbmp_image0Bmp != NULL)
{
//Save hbm to a .bmp file with date/time based name
mil_pImageBitMapInfo = CreateBitmapInfoStruct(mli_CameraHwnd, hbmp_image0Bmp);
__time64_t long_time;
struct tm newtime;
wchar_t buffer[80];
_time64(&long_time);
_localtime64_s(&newtime, &long_time); // Convert to local time.
// int len = swprintf_s(buffer, 80, L"LI_%04d-%02d-%02d_%02d%02d.bmp", (newtime.tm_year + 1900), (newtime.tm_mon + 1), newtime.tm_mday, newtime.tm_hour, newtime.tm_min);
int len = swprintf_s(buffer, 80, L"Image.bmp");
// if ((swprintf_s(mil_DbgMesg, (size_t)MAX_PATH, L"Creating File: LI_%04d-%02d-%02d_%02d%02d.bmp\n", (newtime.tm_year + 1900), (newtime.tm_mon + 1), newtime.tm_mday, newtime.tm_hour, newtime.tm_min) > 0))
if ((swprintf_s(mil_DbgMesg, (size_t)MAX_PATH, L"Creating File: %s\n", buffer) > 0))
OutputDebugString(mil_DbgMesg);
// if(CreateBMPFile(hWnd, buffer, pbi, hbm, hdcMem))
CreateBMPFile(mli_CameraHwnd, buffer, mil_pImageBitMapInfo, hbmp_image0Bmp, mil_hdcMem);
Button_Enable(mil_hButtonRefImage, FALSE);
if ((swprintf_s(mil_DbgMesg, (size_t)MAX_PATH, L"Disabled Create Ref Image Button\n") >= 1))
OutputDebugString(mil_DbgMesg);
GetClientScreenCoordinates(mil_hWindow, mli_CameraHwnd, &mil_CamClientRect);
bBeginDefiningRefMark = TRUE;
SendMessage(hUserMsg, WM_SETTEXT, NULL, (LPARAM)L"Click and drag to define rectangle around the registration mark.");
RedrawWindow(hWindow, NULL, NULL, RDW_INVALIDATE);
SetCapture(hWindow);
}
}else{ // Else (mil_hdcMem == NULL)
if ((swprintf_s(mil_DbgMesg, (size_t)MAX_PATH, L"CreateCompatibleDC() Failed!\n") > 0))
OutputDebugString(mil_DbgMesg);
}
EndPaint(mli_CameraHwnd, &ps);
} // End if (hdc != NULL)
break;
} // End case 3:
} // End switch (wmId)
break;
} // End case WM_COMMAND:
break;
case WM_PAINT:
{
PRECT prect;
HDC hdc;
HDC hdc_cam;
PAINTSTRUCT ps;
PAINTSTRUCT ps2;
hdc = BeginPaint(hWindow, &ps);
if (hbmp_image0Bmp != NULL)
{
hdc_cam = BeginPaint(mli_CameraHwnd, &ps2);
BITMAP bm;
// Find out what size the input image is
GetObject(hbmp_image0Bmp, sizeof(BITMAP), &bm);
// Set stretch mode as COLORONCOLOR and then
// copy from the source bitmap into the display window
SetStretchBltMode(hdc_cam, COLORONCOLOR);
StretchBlt(hdc_cam, 0, 0, mli_CamWindowX_Dim, mli_CamWindowY_Dim, mil_hdcMem, 0, 0, bm.bmWidth, bm.bmHeight, SRCCOPY);
// Were're done
// Use mil_hdcMem as the Src to restore the current displayed image with,
// * Don't: DeleteDC(mil_hdcMem) and and DeleteObject(hbmp_image0Bmp);
// ... until later ...
// mil_hdcMem = NULL;
// hbmp_image0Bmp = NULL;
HBRUSH hbr = NULL;
if (!bDrawFoundRefMark)
{
hbr = CreateSolidBrush(RGB(0, 200, 0));
for (int iIndex = 0; iIndex < mil_RectsToDraw; iIndex++)
FrameRect(hdc_cam, &mil_RectsDefined[iIndex], hbr);
}else{
if (!mil_bRefMarksDrawn)
{
hbr = CreateSolidBrush(RGB(200, 0, 0));
if ((mil_RectsToDraw > 1) && (mil_ToDraw == 0))
{
mil_ToDraw = LocateRefMarks(&mil_RectsDefined[REF_RECTANGLE], hdc_cam);
bRefMarkSearched = (mil_ToDraw > 0);
}
int ZoneWidth = (mil_RectsDefined[ZONE_RECTANGLE].right - mil_RectsDefined[ZONE_RECTANGLE].left);
int ZoneHeight = (mil_RectsDefined[ZONE_RECTANGLE].bottom - mil_RectsDefined[ZONE_RECTANGLE].top);
for (int RectIndex = 0; RectIndex < mil_ToDraw; RectIndex++)
{
// Draw a frame around the ref mark
FrameRect(hdc_cam, &mil_RefMarkRects[RectIndex], hbr);
if ((swprintf_s(mil_DbgMesg, (size_t)MAX_PATH, L"RefMark Rect[%02d] - Left: %04d Top: %04d Right: %04d Bottom: %04d\n", RectIndex, mil_RefMarkRects[RectIndex].left, mil_RefMarkRects[RectIndex].top, mil_RefMarkRects[RectIndex].right, mil_RefMarkRects[RectIndex].bottom) > 0))
OutputDebugString(mil_DbgMesg);
// Convert the rectangle to the inspection zone
// ( Clamp the values to screen image dimensions )
mil_RefMarkRects[RectIndex].right = min((int)(mil_RefMarkRects[RectIndex].left + ZoneWidth), (int)(CANERA_WIDTH * mil_Dim_Multiplier));
mil_RefMarkRects[RectIndex].bottom = min((int)(mil_RefMarkRects[RectIndex].top + ZoneHeight), (int)(CANERA_HEIGHT * mil_Dim_Multiplier));
// Draw a frame around the inspection zone
FrameRect(hdc_cam, &mil_RefMarkRects[RectIndex], hbr);
if ((swprintf_s(mil_DbgMesg, (size_t)MAX_PATH, L"Inspect zone (draw) Rect[%02d] - Left: %04d Top: %04d Right: %04d Bottom: %04d\n", RectIndex, mil_RefMarkRects[RectIndex].left, mil_RefMarkRects[RectIndex].top, mil_RefMarkRects[RectIndex].right, mil_RefMarkRects[RectIndex].bottom) > 0))
OutputDebugString(mil_DbgMesg);
// Convert the rect to full size image dimensions
mil_RefMarkRects[RectIndex].left = (mil_RefMarkRects[RectIndex].left * mil_Dim_Conversion);
mil_RefMarkRects[RectIndex].right = (mil_RefMarkRects[RectIndex].right * mil_Dim_Conversion);
mil_RefMarkRects[RectIndex].top = (mil_RefMarkRects[RectIndex].top * mil_Dim_Conversion);
mil_RefMarkRects[RectIndex].bottom = (mil_RefMarkRects[RectIndex].bottom * mil_Dim_Conversion);
if ((swprintf_s(mil_DbgMesg, (size_t)MAX_PATH, L"Inspect zone (full) Rect[%02d] - Left: %04d Top: %04d Right: %04d Bottom: %04d\n", RectIndex, mil_RefMarkRects[RectIndex].left, mil_RefMarkRects[RectIndex].top, mil_RefMarkRects[RectIndex].right, mil_RefMarkRects[RectIndex].bottom) > 0))
OutputDebugString(mil_DbgMesg);
}
int FullZoneWidth;
int FullZoneHeight;
if ((swprintf_s(mil_DbgMesg, (size_t)MAX_PATH, L"Found %02d RefMarks\n", mil_ToDraw) > 0))
SendMessage(hUserMsg, WM_SETTEXT, NULL, (LPARAM)mil_DbgMesg);
// Copy Zone Zero Rect to the "Golden Image"
FullZoneWidth = (mil_RefMarkRects[0].right - mil_RefMarkRects[0].left);
FullZoneHeight = (mil_RefMarkRects[0].bottom - mil_RefMarkRects[0].top);
mil_RefImage = (RGBTRIPLE *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, ((sizeof(RGBTRIPLE) * (FullZoneWidth * FullZoneHeight))));
InitializeGoldenImage(mil_RefImage, (RGBTRIPLE *) mil_pImageBits, FullZoneWidth, FullZoneHeight);
CreateReferenceImage((RGBTRIPLE *) mil_pImageBits, FullZoneWidth, FullZoneHeight);
mil_ProcessImage = new ProcessImage((byte *)mil_RefImage, FullZoneWidth, FullZoneHeight, (size_t)FullZoneWidth);
mil_bRefMarksDrawn = true;
}
}
if ((swprintf_s(mil_DbgMesg, (size_t)MAX_PATH, L"WM_PAINT %d Rects drawn\n", mil_RectsToDraw) > 0))
OutputDebugString(mil_DbgMesg);
if(hbr != NULL)
DeleteObject(hbr);
EndPaint(mli_CameraHwnd, &ps2);
// Spin Off thread to do Setup
/* HANDLE WINAPI CreateThread(
_In_opt_ LPSECURITY_ATTRIBUTES lpThreadAttributes,
_In_ SIZE_T dwStackSize,
_In_ LPTHREAD_START_ROUTINE lpStartAddress,
_In_opt_ LPVOID lpParameter,
_In_ DWORD dwCreationFlags,
_Out_opt_ LPDWORD lpThreadId
);*/
// mil_hSetupThread = CreateThread(NULL,(SIZE_T) SETUPTHREAD_STACK_SIZE,SetupThreadProc,(LPVOID) hbmp_image0Bmp,0, (LPDWORD) &mil_lpThreadId);
}
EndPaint(hWindow, &ps);
break;
}
case WM_DESTROY:
if (mil_hdcMem != NULL)
DeleteDC(mil_hdcMem);
if (hbmp_image0Bmp != NULL)
DeleteObject(hbmp_image0Bmp);
if(mil_pImageBits != NULL)
GlobalFree((HGLOBAL)mil_pImageBits);
if(mil_RefMarkRects != NULL)
HeapFree(GetProcessHeap(), 0, mil_RefMarkRects);
ReleaseCapture();
PostQuitMessage(0);
return 0;
}
return DefWindowProc(hWindow, WndMessage, wParam, lParam);
}
// Message handler for about box.
INT_PTR CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
UNREFERENCED_PARAMETER(lParam);
switch (message)
{
case WM_INITDIALOG:
return (INT_PTR)TRUE;
case WM_COMMAND:
if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL)
{
EndDialog(hDlg, LOWORD(wParam));
return (INT_PTR)TRUE;
}
break;
}
return (INT_PTR)FALSE;
}
bool InitializeGoldenImage(RGBTRIPLE *GoldImage, RGBTRIPLE *FirstImage, UINT FullZoneWidth, UINT FullZoneHeight )
{
if (mil_RefImage != NULL)
{
if ((swprintf_s(mil_DbgMesg, (size_t)MAX_PATH, L"GoldImg - ImageStart: 0x%08X ImageEnd: 0x%08X\n", (UINT)(&mil_RefImage[0]), (UINT)(&mil_RefImage[(FullZoneWidth * FullZoneHeight)])) > 0))
OutputDebugString(mil_DbgMesg);
// Copy the image Row x Row
for (int rowIndex = 0; rowIndex < FullZoneHeight; rowIndex++)
{
// Note that the full size image is flipped around the X axis in memory meaning that Row zero,
// Column zero is located at: (RGBTRIPLE *)mil_pImageBits[(CANERA_WIDTH * CANERA_HEIGHT)].
// The "Golden Image" is not flipped so Row zero, Column zero is: mil_RefImage[0]
// This means the Row addresses (Y values), decrement for the "next" line of the SubImage, while Row
// addresses for the Golden Image increment. Column addresses (X values) increment for both images.
// Point to the beginning of the current row
mil_SubImage = (RGBTRIPLE *)mil_pImageBits;
// SubImage += (CANERA_WIDTH * CANERA_HEIGHT);
mil_SubImage += (CANERA_WIDTH * (CANERA_HEIGHT - 1));
mil_SubImage -= (mil_RefMarkRects[0].top * CANERA_WIDTH);
mil_SubImage += mil_RefMarkRects[0].left;
mil_SubImage -= (rowIndex * CANERA_WIDTH);
if (rowIndex == 0)
{
RGBTRIPLE * EndAddress = (RGBTRIPLE *)mil_pImageBits;
if ((swprintf_s(mil_DbgMesg, (size_t)MAX_PATH, L"SubImage - ImageStart: 0x%08X ImageEnd: 0x%08X\n", (UINT)(&EndAddress[((mil_RefMarkRects[0].top * CANERA_WIDTH) + mil_RefMarkRects[0].left)]), (UINT)(&EndAddress[((mil_RefMarkRects[0].bottom * CANERA_WIDTH) + mil_RefMarkRects[0].right)])) > 0))
OutputDebugString(mil_DbgMesg);
if ((swprintf_s(mil_DbgMesg, (size_t)MAX_PATH, L"Inspect zone Zero Rect - Left: %4d Top: %04d Right: %04d Bottom: %04d\n", mil_RefMarkRects[0].left, mil_RefMarkRects[0].top, mil_RefMarkRects[0].right, mil_RefMarkRects[0].bottom) > 0))
OutputDebugString(mil_DbgMesg);
}
for (int columnIndex = 0; columnIndex < FullZoneWidth; columnIndex++)
*GoldImage++ = *mil_SubImage++;
}
}
}
// }
bool CreateReferenceImage(RGBTRIPLE *GoldImage, RGBTRIPLE *FullImage, RECT SubImageRect, UINT FullZoneWidth, UINT FullZoneHeight)
{
// Loop through all the inspection zones we've found and write back the average of
// the individula Red Green and Blue values of the two images to the "Golden Image."
RGBTRIPLE * EndAddress;
RGBTRIPLE *FullEndAddress;
RGBTRIPLE *FullStartAddress;
RGBTRIPLE *SubEndAddress;
RGBTRIPLE *SubStartAddress;
RGBTRIPLE *GoldEndAddress = &mil_RefImage[FullZoneWidth * FullZoneHeight];
RGBTRIPLE *GoldStartAddress = mil_RefImage;
// Loop through all the full and partial inspection zones we've found
for (int RectIndex = 1; RectIndex < mil_ToDraw; RectIndex++)
{
RGBTRIPLE *GoldImage;
// RGBTRIPLE *FullImage = (RGBTRIPLE *)mil_pImageBits;
UINT SubImageHeight = (mil_RefMarkRects[RectIndex].bottom - mil_RefMarkRects[RectIndex].top);
UINT SubImageWidth = (mil_RefMarkRects[RectIndex].right - mil_RefMarkRects[RectIndex].left);
// Deal with the image row x row first
for (int rowIndex = 0; rowIndex < (SubImageHeight - 1); rowIndex++)
{
RGBTRIPLE *Dest = GoldImage;
// Init pointer to Ref Image
Dest = GoldImage; // Point to beginning
Dest += (rowIndex * FullZoneWidth); // Increment to current row
RGBTRIPLE *SubImage;
SubImage = (RGBTRIPLE *)FullImage;
// The image is flipped around the X axis in memory (but Not the Y axis).
// so the "last line" in the negative domain is camera height - 1
SubImage += (CANERA_WIDTH * (CANERA_HEIGHT - 1)); // Point to last line
SubImage -= (mil_RefMarkRects[RectIndex].top * CANERA_WIDTH); // Decrement to the top of the sub-image
SubImage += mil_RefMarkRects[RectIndex].left; // Move pointer to column zero
SubImage -= (rowIndex * CANERA_WIDTH); // Decrement to the current line
RGBTRIPLE *EndAddress = (RGBTRIPLE *)mil_pImageBits;
RGBTRIPLE *FullEndAddress = &EndAddress[(CANERA_WIDTH * CANERA_HEIGHT)]; // Note We're pointing to the first address _after_ the last valid pixel
// The above is is the first addresss past the last valid pixel in the image
// [-*- You can't increment this address in the X direction and write to it ! -*-]
RGBTRIPLE *FullStartAddress = (RGBTRIPLE *)mil_pImageBits;
int RectIndex = 0;
// These are just diagnostic variables for diagnosing boundry conditions and access violations [Delete From Release ver]
RGBTRIPLE *SubEndAddress = &EndAddress[((mil_RefMarkRects[RectIndex].bottom * CANERA_WIDTH) + mil_RefMarkRects[RectIndex].right)]; // WRT - Top and bottom start and end are somewhat "subjective" but the
RGBTRIPLE *SubStartAddress = &EndAddress[((mil_RefMarkRects[RectIndex].top * CANERA_WIDTH) + mil_RefMarkRects[RectIndex].left)]; // important thing is we are noting the correct addresses involved
for(int columnIndex = 0; columnIndex < (SubImageWidth); columnIndex++)
{
// Print diagnostic message if we're at the beginning of a line
if ((rowIndex == 0) && (columnIndex == 0))
{
if ((swprintf_s(mil_DbgMesg, (size_t)MAX_PATH, L"FullImage - ImageStart: 0x%08X ImageEnd: 0x%08X\n", (UINT)(FullStartAddress), (UINT)(FullEndAddress)) > 0))
OutputDebugString(mil_DbgMesg);
if ((swprintf_s(mil_DbgMesg, (size_t)MAX_PATH, L"SubImage - ImageStart: 0x%08X ImageEnd: 0x%08X\n", (UINT)(SubStartAddress), (UINT)(SubEndAddress)) > 0))
OutputDebugString(mil_DbgMesg);
if ((swprintf_s(mil_DbgMesg, (size_t)MAX_PATH, L"SubImagCalc - ImageStart: 0x%08X ImageEnd: 0x%08X\n", (UINT)(SubImage), (UINT)(&SubImage[SubImageWidth])) > 0))
OutputDebugString(mil_DbgMesg);
if ((swprintf_s(mil_DbgMesg, (size_t)MAX_PATH, L"Inspect zone[%02d] Rect - Left: %04d Top: %04d Right: %04d Bottom: %04d\n", RectIndex, mil_RefMarkRects[RectIndex].left, mil_RefMarkRects[RectIndex].top, mil_RefMarkRects[RectIndex].right, mil_RefMarkRects[RectIndex].bottom) > 0))
OutputDebugString(mil_DbgMesg);
}
Dest->rgbtRed = ((GoldImage->rgbtRed + SubImage->rgbtRed) >> 1);
Dest->rgbtGreen = ((GoldImage->rgbtGreen + SubImage->rgbtGreen) >> 1);
Dest->rgbtBlue = ((GoldImage->rgbtBlue + SubImage->rgbtBlue) >> 1);
Dest++;
SubImage++;
// if( (SubImage < FullStartAddress) || (SubImage < SubStartAddress) || (SubImage > FullEndAddress) || (SubImage > SubEndAddress) )
if (SubImage < FullStartAddress)
SubImage++;
if (SubImage > FullEndAddress)
SubImage--;
if (GoldImage < GoldStartAddress)
GoldImage++;
if (GoldImage > GoldEndAddress)
GoldImage--;
}
}
}
}
bool CreateBMPFile(HWND hwnd, LPTSTR pszFile, PBITMAPINFO pbi, HBITMAP hBMP, HDC hDC)
{
HANDLE hf; // file handle
BITMAPFILEHEADER hdr; // bitmap file-header
PBITMAPINFOHEADER pbih; // bitmap info-header
DWORD dwTotal; // total count of bytes
DWORD cb; // incremental count of bytes
BYTE *hp; // byte pointer
DWORD dwTmp;
bool bErrorOccured = false;
pbih = (PBITMAPINFOHEADER)pbi;
mil_pImageBits = (LPBYTE)GlobalAlloc(GMEM_FIXED, pbih->biSizeImage);
if (!mil_pImageBits)
{
MessageBox(hwnd, L"GlobalAlloc", L"Error", MB_OK);
bErrorOccured = true;
}
// Retrieve the color table (RGBTRIPLE array) and the bits
// (array of palette indices) from the DIB.
if (!GetDIBits(hDC, hBMP, 0, (WORD)pbih->biHeight, mil_pImageBits, pbi, DIB_RGB_COLORS))
{
MessageBox(hwnd, L"GetDIBits", L"Error", MB_OK);
bErrorOccured = true;
}
// Create the .BMP file.
hf = CreateFile(pszFile, GENERIC_READ | GENERIC_WRITE, (DWORD)0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, (HANDLE)NULL);
if (hf == INVALID_HANDLE_VALUE)
{
MessageBox(hwnd, L"CreateFile", L"Error", MB_OK);
bErrorOccured = true;
}
hdr.bfType = 0x4d42; // File type designator "BM" 0x42 = "B" 0x4d = "M"
// Compute the size of the entire file.
hdr.bfSize = (DWORD)(sizeof(BITMAPFILEHEADER) + pbih->biSize + pbih->biClrUsed * sizeof(RGBQUAD) + pbih->biSizeImage);
hdr.bfReserved1 = 0;
hdr.bfReserved2 = 0;
// Compute the offset to the array of color indices.
hdr.bfOffBits = (DWORD) sizeof(BITMAPFILEHEADER) + pbih->biSize + pbih->biClrUsed * sizeof(RGBQUAD);
// Copy the BITMAPFILEHEADER into the .BMP file.
if (!WriteFile(hf, (LPVOID)&hdr, sizeof(BITMAPFILEHEADER), (LPDWORD)&dwTmp, NULL))
{
MessageBox(hwnd, L"WriteFileHeader", L"Error", MB_OK);
bErrorOccured = true;
}
// Copy the BITMAPINFOHEADER and RGBQUAD array into the file.
if (!WriteFile(hf, (LPVOID)pbih, sizeof(BITMAPINFOHEADER) + pbih->biClrUsed * sizeof(RGBQUAD), (LPDWORD)&dwTmp, NULL))
{
MessageBox(hwnd, L"WriteInfoHeader", L"Error", MB_OK);
bErrorOccured = true;
}
// Copy the array of color indices into the .BMP file.
dwTotal = cb = pbih->biSizeImage;
hp = mil_pImageBits;
if (!WriteFile(hf, (LPSTR)hp, (int)cb, (LPDWORD)&dwTmp, NULL))
{
MessageBox(hwnd, L"WriteFile", L"Error", MB_OK);
bErrorOccured = true;
}
// Close the .BMP file.
if (!CloseHandle(hf))
{
MessageBox(hwnd, L"CloseHandle", L"Error", MB_OK);
bErrorOccured = true;
}
// Free memory.
// mil_ProcessImage = new ProcessImage(pszFile);
return bErrorOccured;
}
PBITMAPINFO CreateBitmapInfoStruct(HWND hwnd, HBITMAP hBmp)
{
BITMAP bmp;
PBITMAPINFO pbmi;
WORD cClrBits;
// Retrieve the bitmap color format, width, and height.
if (!GetObject(hBmp, sizeof(BITMAP), (LPSTR)&bmp))
{
MessageBox(hwnd, L"GetObject", L"Error", MB_OK);
}
// Convert the color format to a count of bits.
cClrBits = (WORD)(bmp.bmPlanes * bmp.bmBitsPixel);
if (cClrBits == 1)
cClrBits = 1;
else if (cClrBits <= 4)
cClrBits = 4;
else if (cClrBits <= 8)
cClrBits = 8;
else if (cClrBits <= 16)
cClrBits = 16;
else if (cClrBits <= 24)
cClrBits = 24;
else cClrBits = 32;
// Allocate memory for the BITMAPINFO structure. (This structure
// contains a BITMAPINFOHEADER structure and an array of RGBQUAD
// data structures.)
if (cClrBits != 24)
{
pbmi = (PBITMAPINFO)LocalAlloc(LPTR, sizeof(BITMAPINFOHEADER) + sizeof(RGBQUAD) * ((int)(1 << cClrBits)));
}
else // There is no RGBQUAD array for the 24-bit-per-pixel format.
pbmi = (PBITMAPINFO)LocalAlloc(LPTR, sizeof(BITMAPINFOHEADER));
// Initialize the fields in the BITMAPINFO structure.
pbmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
pbmi->bmiHeader.biWidth = bmp.bmWidth;
pbmi->bmiHeader.biHeight = bmp.bmHeight;
pbmi->bmiHeader.biPlanes = bmp.bmPlanes;
pbmi->bmiHeader.biBitCount = bmp.bmBitsPixel;
if (cClrBits < 24)
{
pbmi->bmiHeader.biClrUsed = (1 << cClrBits);
}
// If the bitmap is not compressed, set the BI_RGB flag.
pbmi->bmiHeader.biCompression = BI_RGB;
// Compute the number of bytes in the array of color
// indices and store the result in biSizeImage.
// For Windows NT, the width must be DWORD aligned unless
// the bitmap is RLE compressed. This example shows this.
// For Windows 95/98/Me, the width must be WORD aligned unless the
// bitmap is RLE compressed.
pbmi->bmiHeader.biSizeImage = ((pbmi->bmiHeader.biWidth * cClrBits + 31) & ~31) / 8 * pbmi->bmiHeader.biHeight;
// Set biClrImportant to 0, indicating that all of the
// device colors are important.
pbmi->bmiHeader.biClrImportant = 0;
return pbmi; //return BITMAPINFO
}
HRESULT EnumerateDevices(REFGUID category, IEnumMoniker **ppEnum)
{
// Create the System Device Enumerator.
ICreateDevEnum *pDevEnum;
HRESULT hr = CoCreateInstance(CLSID_SystemDeviceEnum, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&pDevEnum));
if (SUCCEEDED(hr))
{
// Create an enumerator for the category.
hr = pDevEnum->CreateClassEnumerator(category, ppEnum, 0);
if (hr == S_FALSE)
{
hr = VFW_E_NOT_FOUND; // The category is empty. Treat as an error.
}
pDevEnum->Release();
}
return hr;
}
void Get_DeviceInfo()
{
HRESULT hr = CoInitializeEx(NULL, COINIT_MULTITHREADED);
if (SUCCEEDED(hr))
{
IEnumMoniker *pEnum;
hr = EnumerateDevices(CLSID_VideoInputDeviceCategory, &pEnum);
if (SUCCEEDED(hr))
{
// DisplayDeviceInformation(pEnum);
pEnum->Release();
}
hr = EnumerateDevices(CLSID_AudioInputDeviceCategory, &pEnum);
if (SUCCEEDED(hr))
{
// DisplayDeviceInformation(pEnum);
pEnum->Release();
}
CoUninitialize();
}
}
// **************************************************************************************
static void setcolor(unsigned int color)
{
HANDLE hCon = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleTextAttribute(hCon, color | FOREGROUND_INTENSITY);
}
void _FreeMediaType(AM_MEDIA_TYPE& mt)
{
if (mt.cbFormat != 0)
{
CoTaskMemFree((PVOID)mt.pbFormat);
mt.cbFormat = 0;
mt.pbFormat = NULL;
}
if (mt.pUnk != NULL)
{
// pUnk should not be used.
mt.pUnk->Release();
mt.pUnk = NULL;
}
}
/*
* Do something with the filter. In this sample we just test the pan/tilt properties.
*/
void process_filter(IBaseFilter *pBaseFilter, int iIndex)
{
CamCaps(pBaseFilter, iIndex);
}
HRESULT CamCaps(IBaseFilter *pBaseFilter, int iIndex)
{
HRESULT hr = 0;
vector <IPin*> pins;
IEnumPins *EnumPins;
IEnumMediaTypes *emt = NULL;
AM_MEDIA_TYPE *pmt;
vector<SIZE> modes;
pBaseFilter->EnumPins(&EnumPins);
pins.clear();
for (;;)
{
IPin *pin;
hr = EnumPins->Next(1, &pin, NULL);
if (hr != S_OK) { break; }
pins.push_back(pin);
pin->Release();
}
EnumPins->Release();
if ((swprintf_s(mil_DbgMesg, (size_t)MAX_PATH, L"Number of Device pins: %zd\n", pins.size()) > 0))
OutputDebugString(mil_DbgMesg);
PIN_INFO pInfo;
for (int i = 0; i<pins.size(); i++)
{
pins[i]->QueryPinInfo(&pInfo);
if ((swprintf_s(mil_DbgMesg, (size_t)MAX_PATH, L"Pin name: %s \n", pInfo.achName) > 0))
OutputDebugString(mil_DbgMesg);
pins[i]->EnumMediaTypes(&emt);
if ((swprintf_s(mil_DbgMesg, (size_t)MAX_PATH, L"Avialable resolutions for: %ls \n", mil_CameraNames[iIndex]) >= 1))
OutputDebugString(mil_DbgMesg);
for (;;)
{
hr = emt->Next(1, &pmt, NULL);
if (hr != S_OK) { break; }
if ((pmt->formattype == FORMAT_VideoInfo) && (pmt->cbFormat >= sizeof(VIDEOINFOHEADER)) && (pmt->pbFormat != NULL))
{
VIDEOINFOHEADER *pVIH = (VIDEOINFOHEADER*)pmt->pbFormat;
SIZE s;
// Get frame size
s.cy = pVIH->bmiHeader.biHeight;
s.cx = pVIH->bmiHeader.biWidth;
unsigned int bitrate = pVIH->dwBitRate;
modes.push_back(s);
// Bits per pixel
unsigned int bitcount = pVIH->bmiHeader.biBitCount;
REFERENCE_TIME t = pVIH->AvgTimePerFrame; // blocks (100ns) per frame
int FPS = (int)(floor(10000000.0 / static_cast<double>(t)));
if ((swprintf_s(mil_DbgMesg, (size_t)MAX_PATH, L"Size: x=%d\ty=%d\tFPS: %d\t bitrate: %ld\tbit/pixel:%ld\n", s.cx, s.cy, FPS, bitrate, bitcount) >= 1))
OutputDebugString(mil_DbgMesg);
}
_FreeMediaType(*pmt);
}
modes.clear();
emt->Release();
}
pins.clear();
return S_OK;
}// End CamCaps()
///////////////////////////////
///////////////////////////////
// Function to load the image into our DC so we can draw it to the screen
void loadImage(const char* pathname, HDC *imageDC, HBITMAP *imageBmp)
{
*imageDC = CreateCompatibleDC(NULL); // create an offscreen DC
*imageBmp = (HBITMAP)LoadImageA( // load the bitmap from a file
NULL, // not loading from a module, so this is NULL
pathname, // the path we're loading from
IMAGE_BITMAP, // we are loading a bitmap
0, 0, // don't need to specify width/height
LR_DEFAULTSIZE | LR_LOADFROMFILE// use the default bitmap size (whatever the file is), and load it from a file
);
imageBmpOld = (HBITMAP)SelectObject(*imageDC, *imageBmp); // put the loaded image into our DC
}
///////////////////////////////
// Function to clean up
void cleanUpImage(HDC *imageDC, HBITMAP *imageBmp)
{
SelectObject(*imageDC, imageBmpOld); // put the old bmp back in our DC
DeleteObject(*imageBmp); // delete the bmp we loaded
DeleteDC(*imageDC); // delete the DC we created
}
///////////////////////////////
///////////////////////////////
// The function to draw our image to the display (the given DC is the screen DC)
void drawImage(HDC screen, HDC *imageDC)
{
BitBlt(
screen, // tell it we want to draw to the screen
0, 0, // as position 0,0 (upper-left corner)
CANERA_WIDTH, // width of the rect to draw
CANERA_HEIGHT, // height of the rect
*imageDC, // the DC to get the rect from (our image DC)
0, 0, // take it from position 0,0 in the image DC
SRCCOPY // tell it to do a pixel-by-pixel copy
);
}
/*
* Enumerate all video devices
*
* See also:
*
* Using the System Device Enumerator:
* http://msdn2.microsoft.com/en-us/library/ms787871.aspx
*/
int enum_devices()
{
HRESULT hr;
int NumCamerasFound = 0;
OutputDebugString(L"Enumeraring videoinput devices ...\n");
CoInitialize(NULL);
// Create the System Device Enumerator.
ICreateDevEnum *pSysDevEnum = NULL;
hr = CoCreateInstance(CLSID_SystemDeviceEnum, NULL, CLSCTX_INPROC_SERVER, IID_ICreateDevEnum, (void **)&pSysDevEnum);
if (FAILED(hr))
{
OutputDebugString(L"Error. Can't create enumerator.\n");
return hr;
}
// Obtain a class enumerator for the video input device category.
IEnumMoniker *pEnumCat = NULL;
hr = pSysDevEnum->CreateClassEnumerator(CLSID_VideoInputDeviceCategory, &pEnumCat, 0);
if (hr == S_OK)
{
// Enumerate the monikers.
IMoniker *pMoniker = NULL;
ULONG cFetched;
while (pEnumCat->Next(1, &pMoniker, &cFetched) == S_OK)
{
NumCamerasFound++; // We found a camera
IPropertyBag *pPropBag;
hr = pMoniker->BindToStorage(0, 0, IID_IPropertyBag, (void **)&pPropBag);
if (SUCCEEDED(hr))
{
// Retrieve the device's friendly name
VARIANT varName;
VariantInit(&varName);
hr = pPropBag->Read(L"FriendlyName", &varName, 0); // Read the device's name
if (SUCCEEDED(hr))
{
if (NumCamerasFound < MAX_CAMERAS)
{
// Record the name, indexed by order found
mil_CameraNames[NumCamerasFound - 1] = new wchar_t[MAX_LOADSTRING];
wcsncpy_s(mil_CameraNames[NumCamerasFound - 1], MAX_LOADSTRING, varName.bstrVal, _TRUNCATE);
if ((swprintf_s(mil_DbgMesg, (size_t)MAX_PATH, L"Found Camera: %ls\n", mil_CameraNames[NumCamerasFound - 1]) >= 1))
OutputDebugString(mil_DbgMesg);
}
}
VariantClear(&varName);
// To create an instance of the filter, do the following:
IBaseFilter *pFilter;
hr = pMoniker->BindToObject(NULL, NULL, IID_IBaseFilter, (void**)&pFilter);
process_filter(pFilter, (NumCamerasFound - 1));
//Remember to release pFilter later.
pPropBag->Release();
}
pMoniker->Release();
}
pEnumCat->Release();
}
pSysDevEnum->Release();
OleUninitialize();
return NumCamerasFound;
}
BOOL LoadBitmapFromBMPFile(LPTSTR szFileName, HBITMAP *phBitmap, HPALETTE *phPalette)
{
BITMAP bm;
*phBitmap = NULL;
*phPalette = NULL;
// Use LoadImage() to get the image loaded into a DIBSection
*phBitmap = (HBITMAP)LoadImage(NULL, szFileName, IMAGE_BITMAP, 0, 0,LR_CREATEDIBSECTION | LR_DEFAULTSIZE | LR_LOADFROMFILE);
if (*phBitmap == NULL)
return FALSE;
// Get the color depth of the DIBSection
GetObject(*phBitmap, sizeof(BITMAP), &bm);
// If the DIBSection is 256 color or less, it has a color table
if ((bm.bmBitsPixel * bm.bmPlanes) <= 8)
{
HDC hMemDC;
HBITMAP hOldBitmap;
RGBQUAD rgb[256];
LPLOGPALETTE pLogPal;
WORD i;
// Create a memory DC and select the DIBSection into it
hMemDC = CreateCompatibleDC(NULL);
hOldBitmap = (HBITMAP)SelectObject(hMemDC, *phBitmap);
// Get the DIBSection's color table
GetDIBColorTable(hMemDC, 0, 256, rgb);
// Create a palette from the color tabl
pLogPal = (LOGPALETTE *)malloc(sizeof(LOGPALETTE) + (256 * sizeof(PALETTEENTRY)));
pLogPal->palVersion = 0x300;
pLogPal->palNumEntries = 256;
for (i = 0; i<256; i++)
{
pLogPal->palPalEntry[i].peRed = rgb[i].rgbRed;
pLogPal->palPalEntry[i].peGreen = rgb[i].rgbGreen;
pLogPal->palPalEntry[i].peBlue = rgb[i].rgbBlue;
pLogPal->palPalEntry[i].peFlags = 0;
}
*phPalette = CreatePalette(pLogPal);
// Clean up
free(pLogPal);
SelectObject(hMemDC, hOldBitmap);
DeleteDC(hMemDC);
}
else // It has no color table, so use a halftone palette
{
HDC hRefDC;
hRefDC = GetDC(NULL);
*phPalette = CreateHalftonePalette(hRefDC);
ReleaseDC(NULL, hRefDC);
}
return TRUE;
}
// There is a new image to process, we're creating/adding to our initialization info
// run:
DWORD WINAPI SetupThreadProc(_In_ LPVOID lpParameter)
{
DWORD dwResult = 0;
HBITMAP hbmp_image = (HBITMAP)lpParameter;
if (hbmp_image == NULL)
return 1;
Button_Enable(mil_hButtonRefImage,FALSE);
if ((swprintf_s(mil_DbgMesg, (size_t)MAX_PATH, L"Disabled Creat Ref Image Button\n") >= 1))
OutputDebugString(mil_DbgMesg);
return dwResult;
}
BOOL bPointIsInRect(POINT Candidate, RECT Area)
{
if ((Candidate.x < Area.left) || (Candidate.x > Area.right))
return false;
if ((Candidate.y < Area.top) || (Candidate.y > Area.bottom))
return false;
return true;
}
BOOL GetClientScreenCoordinates(HWND hWindowParent, HWND hWindowChild, RECT *pRect)
{
POINT ptClientChildUL; // client area upper left corner
POINT ptClientChildLR; // client area lower right corner
POINT ptClientParentUL; // client area upper left corner
POINT ptClientParentLR; // client area lower right corner
RECT rcClientParent; // client area rectangle of parent
RECT rcClientChild; // client area rectangle of parent
if ((hWindowParent == NULL) || (hWindowChild == NULL) || (pRect == NULL))
return FALSE;
// Convert the client coordinates of the client area
// rectangle to screen coordinates and save them in a
// rectangle. The rectangle is passed to the ClipCursor
// function during WM_LBUTTONDOWN processing.
GetClientRect(hWindowParent, &rcClientParent);
GetClientRect(hWindowChild, &rcClientChild);
ptClientParentUL.x = rcClientParent.left;
ptClientParentUL.y = rcClientParent.top;
ptClientParentLR.x = rcClientParent.right;
ptClientParentLR.y = rcClientParent.bottom;
ptClientChildUL.x = rcClientChild.left;
ptClientChildUL.y = rcClientChild.top;
ptClientChildLR.x = rcClientChild.right;
ptClientChildLR.y = rcClientChild.bottom;
if ((swprintf_s(mil_DbgMesg, (size_t)MAX_PATH, L"GCSC Client Rect Parent - Left: %04d Top: %04d Right: %04d Buttom: %04d\n", ptClientParentUL.x, ptClientParentUL.y, ptClientParentLR.x, ptClientParentLR.y) > 0))
OutputDebugString(mil_DbgMesg);
if ((swprintf_s(mil_DbgMesg, (size_t)MAX_PATH, L"GCSC Client Rect Child - Left: %04d Top: %04d Right: %04d Buttom: %04d\n", ptClientChildUL.x, ptClientChildUL.y, ptClientChildLR.x, ptClientChildLR.y) > 0))
OutputDebugString(mil_DbgMesg);
ClientToScreen(hWindowParent, &ptClientParentUL);
ClientToScreen(hWindowParent, &ptClientParentLR);
ClientToScreen(hWindowChild, &ptClientChildUL);
ClientToScreen(hWindowChild, &ptClientChildLR);
if ((swprintf_s(mil_DbgMesg, (size_t)MAX_PATH, L"GCSC Screen Rect Parent - Left: %04d Top: %04d Right: %04d Buttom: %04d\n", ptClientParentUL.x, ptClientParentUL.y, ptClientParentLR.x, ptClientParentLR.y) > 0))
OutputDebugString(mil_DbgMesg);
if ((swprintf_s(mil_DbgMesg, (size_t)MAX_PATH, L"GCSC Screen Rect Child - Left: %04d Top: %04d Right: %04d Buttom: %04d\n", ptClientChildUL.x, ptClientChildUL.y, ptClientChildLR.x, ptClientChildLR.y) > 0))
OutputDebugString(mil_DbgMesg);
if ((swprintf_s(mil_DbgMesg, (size_t)MAX_PATH, L"GCSC Parrent Rel Child Rect - Left: %04d Top: %04d Right: %04d Buttom: %04d\n", (ptClientChildUL.x - ptClientParentUL.x), (ptClientChildUL.y - ptClientParentUL.y), (ptClientChildLR.x - ptClientParentUL.x), (ptClientChildLR.y - ptClientParentUL.y)) > 0))
OutputDebugString(mil_DbgMesg);
// return(SetRect(pRect, ptClientChildUL.x, ptClientChildUL.y, ptClientChildLR.x, ptClientChildLR.y));
return(SetRect(pRect, (ptClientChildUL.x - ptClientParentUL.x), (ptClientChildUL.y - ptClientParentUL.y), (ptClientChildLR.x - ptClientParentUL.x), (ptClientChildLR.y - ptClientParentUL.y)));
}
void Screen2Client(POINT *MousePosition)
{
if ((swprintf_s(mil_DbgMesg, (size_t)MAX_PATH, L"S2C Point IN - x: %04d y: %04d \n", MousePosition->x, MousePosition->y) > 0))
OutputDebugString(mil_DbgMesg);
MousePosition->x -= mil_CamClientRect.left;
MousePosition->x += mil_MainClientRect.left;
MousePosition->y -= mil_CamClientRect.top;
MousePosition->y += mil_MainClientRect.top;
if ((swprintf_s(mil_DbgMesg, (size_t)MAX_PATH, L"S2C Point OUT - x: %04d y: %04d \n", MousePosition->x, MousePosition->y) > 0))
OutputDebugString(mil_DbgMesg);
}
UINT LocateRefMarks(RECT *CaptureRect, HDC RMarkHandel)
{
UINT RefMarksFound = 0;
UINT ColumIndex = 0;
UINT RowIndex = 0;
RGBTRIPLE *rgbColumnValues = NULL;
RGBTRIPLE *rgbRowValues = NULL;
UINT NumberOfColumnValues;
UINT NumberOfRowValues;
RGBTRIPLE *rgbColumnStart;
RGBTRIPLE *rgbRowStart;
RGBTRIPLE *rgbCurrentColumPixel;
RGBTRIPLE *rgbCurrentRowPixel;
UINT ImageWidth;
UINT ImageHeight;
UINT RefMarkColumnCount = 0;
UINT RefMarkRowCount = 0;
UINT *BeginningEndingRows = NULL;
UINT *BeginningEndingColumns = NULL;
UINT *RowsFound = NULL;
UINT *ColumnsFound = NULL;
if(CaptureRect == NULL)
return RefMarksFound;
// The image on screen may be smaller than the full size
// image map the screen cordinates to the full size dimensions
UINT refMarkTop = (CaptureRect->top * mil_Dim_Conversion);
UINT refMarkLeft = (CaptureRect->left * mil_Dim_Conversion);
UINT refMarkBottom = (CaptureRect->bottom * mil_Dim_Conversion);
UINT refMarkRight = (CaptureRect->right * mil_Dim_Conversion);
NumberOfColumnValues = ((refMarkBottom) - (refMarkTop));
NumberOfRowValues = ((refMarkRight) - (refMarkLeft));
ImageWidth = mil_pImageBitMapInfo->bmiHeader.biWidth;
ImageHeight = mil_pImageBitMapInfo->bmiHeader.biHeight;
if ((NumberOfColumnValues == 0) || (NumberOfRowValues == 0))
return 0;
rgbColumnValues = (RGBTRIPLE *) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (sizeof(RGBTRIPLE) * NumberOfColumnValues) );
rgbRowValues = (RGBTRIPLE *) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (sizeof(RGBTRIPLE) * NumberOfRowValues));
RowsFound = BeginningEndingRows = (UINT *) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, ((sizeof(UINT) * (ImageHeight / NumberOfColumnValues)) + 1) );
ColumnsFound = BeginningEndingColumns = (UINT *) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, ((sizeof(UINT) * (ImageWidth / NumberOfColumnValues)) + 1));
rgbColumnStart = rgbRowStart = (RGBTRIPLE *) mil_pImageBits;
if ((swprintf_s(mil_DbgMesg, (size_t)MAX_PATH, L"LocRef Column - ImageStart: 0x%08X ImageEnd: 0x%08X\n", (UINT)(mil_pImageBits), (UINT) (&rgbColumnStart[(ImageWidth * ImageHeight)])) > 0))
OutputDebugString(mil_DbgMesg);
rgbColumnStart += ((ImageWidth) * (refMarkTop)) + (refMarkLeft) + (NumberOfRowValues >> 1);
rgbRowStart += (((ImageWidth) * ((refMarkTop) + (NumberOfColumnValues >> 1))) + (refMarkLeft) );
// Read the center column from the refmark rectangle
for (int iIndex = 0; iIndex < NumberOfColumnValues; iIndex++)
rgbColumnValues[iIndex] = rgbColumnStart[iIndex * ImageWidth];
// Read the center row from the refmark rectangle
for (int iIndex = 0; iIndex < NumberOfRowValues; iIndex++)
rgbRowValues[iIndex] = rgbRowStart[iIndex];
// Itterate over each column of pixels that could possibly contain a matching sequence to the reference pixels
for (int CurrentColumnIndex = 0; CurrentColumnIndex < (ImageWidth - (NumberOfRowValues >> 1)); CurrentColumnIndex++)
{
// Point to the beginning pixel of the current column
rgbCurrentColumPixel = (RGBTRIPLE *) mil_pImageBits;
rgbCurrentColumPixel += CurrentColumnIndex;
// Beging checking each pixel in the current column
for (int CurrentColumnRow = 0; CurrentColumnRow < (ImageHeight - NumberOfColumnValues); CurrentColumnRow++)
{
// If the value of all the current sequence of pixels matches the refpixels within the tolerance value
if (isMatchToRefColumn(rgbColumnValues, rgbCurrentColumPixel, ImageWidth, NumberOfColumnValues, (BYTE) 3) )
{
RefMarkColumnCount++;
if ((swprintf_s(mil_DbgMesg, (size_t)MAX_PATH, L"LocRef Column Found ! - Column Index: %04d Colum Row: %04d Address: 0x%08X\n", CurrentColumnIndex, CurrentColumnRow, rgbCurrentColumPixel) > 0))
OutputDebugString(mil_DbgMesg);
// Record this as the center column of a ref mark
*BeginningEndingRows = (CurrentColumnRow * mil_Dim_Multiplier);
BeginningEndingRows++;
*BeginningEndingRows = ((CurrentColumnRow + NumberOfColumnValues) * mil_Dim_Multiplier);
BeginningEndingRows++;
// Jump forward a refmark height in pixels
CurrentColumnRow += NumberOfColumnValues;
rgbCurrentColumPixel += (ImageWidth * NumberOfColumnValues);
}else{ // Else no match inc to next pixel
rgbCurrentColumPixel += ImageWidth;
}
}
}
// Itterate over each row of pixels that may possibly contain a matching sequence to the reference pixels
for (int CurrentRowIndex = 0; CurrentRowIndex < (ImageHeight - (NumberOfColumnValues >> 1)); CurrentRowIndex++)
{
// Point to the beginning pixel of the current row
rgbCurrentRowPixel = (RGBTRIPLE *) mil_pImageBits;
rgbCurrentRowPixel += (CurrentRowIndex * ImageWidth);
// Itterate over the columns in the current row looking for a matching sequence of pixels
for (int CurrentRowColumn = 0; CurrentRowColumn < (ImageWidth - NumberOfRowValues); CurrentRowColumn++)
{
// If all the pixels in rgbRowValues match the current pixels in the image
if (isMatchToRefRow(rgbRowValues, rgbCurrentRowPixel, NumberOfRowValues, (BYTE) 3))
{
RefMarkRowCount++;
if ((swprintf_s(mil_DbgMesg, (size_t)MAX_PATH, L"LocRef Row Found ! - Column Index: %04d Colum Row: %04d Address: 0x%08X\n", CurrentRowColumn, CurrentRowIndex, rgbCurrentRowPixel) > 0))
OutputDebugString(mil_DbgMesg);
// Record this as the left and right side of a reference rectangle
*BeginningEndingColumns = (CurrentRowColumn * mil_Dim_Multiplier);
BeginningEndingColumns++;
*BeginningEndingColumns = ((CurrentRowColumn + NumberOfRowValues) * mil_Dim_Multiplier);
BeginningEndingColumns++;
// Jump forward a refmark width
CurrentRowColumn += NumberOfRowValues;
rgbCurrentRowPixel += NumberOfRowValues;
}else{ // Else no match inc to next pixel
rgbCurrentRowPixel++;
}
}
}
// If we found at least one refmark
if ((RefMarkRowCount > 0) && (RefMarkColumnCount > 0))
{
// Reset the pointers to the beginning
BeginningEndingColumns -= (RefMarkRowCount << 1);
BeginningEndingRows -= (RefMarkColumnCount << 1);
// Allocate space to store the rects
mil_RefMarkRects = (RECT *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, ((sizeof(RECT) * (RefMarkRowCount * RefMarkColumnCount))));
RECT CandidateRect;
if(mil_RefMarkRects != NULL)
{
for (int iColumnIndex = 0; iColumnIndex < RefMarkColumnCount; iColumnIndex += 2)
{
for (int iRowIndex = 0; iRowIndex < RefMarkRowCount; iRowIndex += 2)
{
CandidateRect.left = BeginningEndingColumns[iColumnIndex];
CandidateRect.right = BeginningEndingColumns[iColumnIndex + 1];
CandidateRect.top = BeginningEndingRows[iRowIndex];
CandidateRect.bottom = BeginningEndingRows[iRowIndex + 1];
if (!rectIsDuplicate(mil_RefMarkRects, CandidateRect, RefMarksFound))
{
mil_RefMarkRects[RefMarksFound].left = CandidateRect.left;
mil_RefMarkRects[RefMarksFound].right = CandidateRect.right;
mil_RefMarkRects[RefMarksFound].top = CandidateRect.top;
mil_RefMarkRects[RefMarksFound].bottom = CandidateRect.bottom;
RefMarksFound++;
if ((swprintf_s(mil_DbgMesg, (size_t)MAX_PATH, L"RefMark[%02d] - Left: %04d Top: %04d Right: %04d Buttom: %04d\n", RefMarksFound, CandidateRect.left, CandidateRect.top, CandidateRect.right, CandidateRect.bottom) > 0))
OutputDebugString(mil_DbgMesg);
}
}
}
}
}
if (rgbColumnValues != NULL)
HeapFree(GetProcessHeap(), 0, rgbColumnValues);
if (rgbRowValues != NULL)
HeapFree(GetProcessHeap(), 0, rgbRowValues);
if (BeginningEndingRows != NULL)
HeapFree(GetProcessHeap(), 0, BeginningEndingRows);
if (BeginningEndingColumns != NULL)
HeapFree(GetProcessHeap(), 0, BeginningEndingColumns);
return RefMarksFound;
}
BOOL isMatchToRefColumn(RGBTRIPLE *RefValues, RGBTRIPLE *CandidatePixel, UINT Increment, UINT NumberOfValues, BYTE rgbTolerance)
{
RGBTRIPLE RefPixel;
RGBTRIPLE ImagePixel;
for (UINT PixelIndex = 0; PixelIndex < NumberOfValues; PixelIndex++)
{
RefPixel = RefValues[PixelIndex];
ImagePixel = CandidatePixel[(PixelIndex * Increment)];
if ((abs(RefPixel.rgbtRed - ImagePixel.rgbtRed)) > rgbTolerance)
return false;
if ((abs(RefPixel.rgbtGreen - ImagePixel.rgbtGreen)) > rgbTolerance)
return false;
if ((abs(RefPixel.rgbtBlue - ImagePixel.rgbtBlue)) > rgbTolerance)
return false;
}
return true;
}
BOOL isMatchToRefRow(RGBTRIPLE *RefValues, RGBTRIPLE *CandidatePixel, UINT NumberOfValues, BYTE rgbTolerance)
{
RGBTRIPLE RefPixel;
RGBTRIPLE ImagePixel;
for (UINT PixelIndex = 0; PixelIndex < NumberOfValues; PixelIndex++)
{
RefPixel = RefValues[PixelIndex];
ImagePixel = CandidatePixel[PixelIndex];
if ((abs(RefPixel.rgbtRed - ImagePixel.rgbtRed)) > rgbTolerance)
return false;
if ((abs(RefPixel.rgbtGreen - ImagePixel.rgbtGreen)) > rgbTolerance)
return false;
if ((abs(RefPixel.rgbtBlue - ImagePixel.rgbtBlue)) > rgbTolerance)
return false;
}
return true;
}
BOOL rectIsDuplicate(RECT *RefMarkRects, RECT Candidate, UINT MarksFound)
{
if( (RefMarkRects == NULL) || (MarksFound == 0) )
return false;
for (int index = 0; index < MarksFound ; index++)
if((RefMarkRects[index].left == Candidate.left) && (RefMarkRects[index].right == Candidate.right) && (RefMarkRects[index].top == Candidate.top) && (RefMarkRects[index].bottom == Candidate.bottom) )
return TRUE;
return false;
}
| [
"rkyoung@sonic.net"
] | rkyoung@sonic.net |
5107193ea71f0f4044414f5267ecd7b76a38fd26 | 536523bda8c19578305732b31db4de619e04ef6d | /local_laplacian/opencv_utils.cpp | c0f468f91f3baf77ed3173e5991dab13f4fb9aae | [] | no_license | t-kuha/sdsoc | f4a0fb1e576f5962eb6f3c298bac246c7e06d696 | 040020c81f9e39528026a3676ed2dc152ef1c90c | refs/heads/master | 2021-06-25T23:35:05.706471 | 2021-03-13T02:43:04 | 2021-03-13T02:43:04 | 75,615,131 | 12 | 5 | null | null | null | null | UTF-8 | C++ | false | false | 4,514 | cpp | // File Description
// Author: Philip Salvaggio
#include "opencv_utils.h"
#include <iostream>
cv::Mat ByteScale(const cv::Mat& input,
bool verbose) {
cv::Mat output;
ByteScale(input, output, (double*)NULL, (double*)NULL, verbose);
return output;
}
void ByteScale(const cv::Mat& input,
cv::Mat& output,
bool verbose) {
ByteScale(input, output, (double*)NULL, (double*)NULL, verbose);
}
cv::Mat ByteScale(const cv::Mat& input,
double* min,
double* max,
bool verbose) {
cv::Mat output;
ByteScale(input, output, min, max, verbose);
return output;
}
void ByteScale(const cv::Mat& input,
cv::Mat& output,
double* min,
double* max,
bool verbose) {
double local_min;
double local_max;
cv::minMaxIdx(input, &local_min, &local_max);
if (min != NULL) *min = local_min;
if (max != NULL) *max = local_max;
ByteScale(input, output, local_min, local_max, verbose);
}
cv::Mat ByteScale(const cv::Mat& input,
double min,
double max,
bool verbose) {
cv::Mat output;
ByteScale(input, output, min, max, verbose);
return output;
}
void ByteScale(const cv::Mat& input,
cv::Mat& output,
double min,
double max,
bool verbose) {
cv::convertScaleAbs(input - min, output, 255 / (max - min));
if (verbose) {
std::cout << "ByteScale: min = " << min << ", max = " << max << std::endl;
}
}
void LogScale(const cv::Mat& input,
cv::Mat& output) {
log(input + 1, output);
ByteScale(output, output);
}
cv::Mat LogScale(const cv::Mat& input) {
cv::Mat output;
LogScale(input, output);
return output;
}
cv::Mat GammaScale(const cv::Mat& input, double gamma) {
double min;
double max;
cv::minMaxIdx(input, &min, &max);
cv::Mat scaled;
input.convertTo(scaled, CV_64F);
scaled = (scaled - min) / (max - min);
cv::pow(scaled, gamma, scaled);
scaled *= 255;
scaled.convertTo(scaled, CV_8U);
return scaled;
}
cv::Mat magnitude(const cv::Mat& input) {
cv::Mat output;
magnitude(input, output);
return output;
}
void magnitude(const cv::Mat& input, cv::Mat& output) {
std::vector<cv::Mat> input_planes;
cv::split(input, input_planes);
cv::magnitude(input_planes.at(0), input_planes.at(1), output);
}
std::string GetMatDataType(const cv::Mat& mat) {
int number = mat.type();
// find type
int imgTypeInt = number%8;
std::string imgTypeString;
switch (imgTypeInt) {
case 0:
imgTypeString = "8U";
break;
case 1:
imgTypeString = "8S";
break;
case 2:
imgTypeString = "16U";
break;
case 3:
imgTypeString = "16S";
break;
case 4:
imgTypeString = "32S";
break;
case 5:
imgTypeString = "32F";
break;
case 6:
imgTypeString = "64F";
break;
default:
break;
}
// find channel
int channel = (number/8) + 1;
std::stringstream type;
type << "CV_" << imgTypeString << "C" << channel;
return type.str();
}
void GetRadialProfile(const cv::Mat& input, double theta,
std::vector<double>* output) {
if (!output) return;
output->clear();
const int rows = input.rows;
const int cols = input.cols;
int profile_size = std::min(rows, cols) / 2;
int center_x = cols / 2;
int center_y = rows / 2;
double dx = cos(theta);
double dy = sin(theta);
output->reserve(profile_size);
for (int i = 0; i < profile_size; i++) {
double x = center_x + i * dx;
double y = center_y + i * dy;
int x_lt = static_cast<int>(x);
int x_gt = x_lt + 1;
int y_lt = static_cast<int>(y);
int y_gt = y_lt + 1;
if (x_lt > 0 && y_lt > 0 && x_gt < cols && y_gt < rows) {
double alpha_x = x - x_lt;
double alpha_y = y - y_lt;
double inter_y_lt = (1-alpha_y) * input.at<double>(y_lt, x_lt) +
alpha_y * input.at<double>(y_gt, x_lt);
double inter_y_gt = (1-alpha_y) * input.at<double>(y_lt, x_gt) +
alpha_y * input.at<double>(y_gt, x_gt);
output->push_back((1-alpha_x) * inter_y_lt + alpha_x * inter_y_gt);
} else {
int x_rnd = std::max(std::min((int)round(x), cols - 1), 0);
int y_rnd = std::max(std::min((int)round(y), rows - 1), 0);
output->push_back(input.at<double>(y_rnd, x_rnd));
}
}
}
| [
"imagingtechnerd@gmail.com"
] | imagingtechnerd@gmail.com |
e9d5e680129153342134987d5f98471b1de127a8 | 674bcb4bf88b5359ea9710c864481af61f5867d3 | /src/external/bgfx/3rdparty/spirv-tools/source/opt/loop_unroller.cpp | 6cdced4640c76c340975b902ea2c114ba6581440 | [
"BSD-2-Clause",
"MIT",
"LicenseRef-scancode-free-unknown",
"Apache-2.0",
"LicenseRef-scancode-generic-cla",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | HippoPlayer/HippoPlayer | a1da46743507c866c5e614f36122348794229b05 | a3145f9797a5ef7dd1b79ee8ccd3476c8c5310a6 | refs/heads/master | 2023-04-19T13:05:36.210552 | 2021-05-08T06:48:18 | 2021-05-08T06:48:18 | 2,195,999 | 44 | 5 | Apache-2.0 | 2022-10-19T15:45:21 | 2011-08-12T08:12:25 | C | UTF-8 | C++ | false | false | 41,952 | cpp | // Copyright (c) 2018 Google LLC.
//
// 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 "source/opt/loop_unroller.h"
#include <limits>
#include <map>
#include <memory>
#include <unordered_map>
#include <utility>
#include <vector>
#include "source/opt/ir_builder.h"
#include "source/opt/loop_utils.h"
// Implements loop util unrolling functionality for fully and partially
// unrolling loops. Given a factor it will duplicate the loop that many times,
// appending each one to the end of the old loop and removing backedges, to
// create a new unrolled loop.
//
// 1 - User calls LoopUtils::FullyUnroll or LoopUtils::PartiallyUnroll with a
// loop they wish to unroll. LoopUtils::CanPerformUnroll is used to
// validate that a given loop can be unrolled. That method (along with the
// constructor of loop) checks that the IR is in the expected canonicalised
// format.
//
// 2 - The LoopUtils methods create a LoopUnrollerUtilsImpl object to actually
// perform the unrolling. This implements helper methods to copy the loop basic
// blocks and remap the ids of instructions used inside them.
//
// 3 - The core of LoopUnrollerUtilsImpl is the Unroll method, this method
// actually performs the loop duplication. It does this by creating a
// LoopUnrollState object and then copying the loop as given by the factor
// parameter. The LoopUnrollState object retains the state of the unroller
// between the loop body copies as each iteration needs information on the last
// to adjust the phi induction variable, adjust the OpLoopMerge instruction in
// the main loop header, and change the previous continue block to point to the
// new header and the new continue block to the main loop header.
//
// 4 - If the loop is to be fully unrolled then it is simply closed after step
// 3, with the OpLoopMerge being deleted, the backedge removed, and the
// condition blocks folded.
//
// 5 - If it is being partially unrolled: if the unrolling factor leaves the
// loop with an even number of bodies with respect to the number of loop
// iterations then step 3 is all that is needed. If it is uneven then we need to
// duplicate the loop completely and unroll the duplicated loop to cover the
// residual part and adjust the first loop to cover only the "even" part. For
// instance if you request an unroll factor of 3 on a loop with 10 iterations
// then copying the body three times would leave you with three bodies in the
// loop
// where the loop still iterates over each 4 times. So we make two loops one
// iterating once then a second loop of three iterating 3 times.
namespace spvtools {
namespace opt {
namespace {
// Loop control constant value for DontUnroll flag.
static const uint32_t kLoopControlDontUnrollIndex = 2;
// Operand index of the loop control parameter of the OpLoopMerge.
static const uint32_t kLoopControlIndex = 2;
// This utility class encapsulates some of the state we need to maintain between
// loop unrolls. Specifically it maintains key blocks and the induction variable
// in the current loop duplication step and the blocks from the previous one.
// This is because each step of the unroll needs to use data from both the
// preceding step and the original loop.
struct LoopUnrollState {
LoopUnrollState()
: previous_phi_(nullptr),
previous_latch_block_(nullptr),
previous_condition_block_(nullptr),
new_phi(nullptr),
new_continue_block(nullptr),
new_condition_block(nullptr),
new_header_block(nullptr) {}
// Initialize from the loop descriptor class.
LoopUnrollState(Instruction* induction, BasicBlock* latch_block,
BasicBlock* condition, std::vector<Instruction*>&& phis)
: previous_phi_(induction),
previous_latch_block_(latch_block),
previous_condition_block_(condition),
new_phi(nullptr),
new_continue_block(nullptr),
new_condition_block(nullptr),
new_header_block(nullptr) {
previous_phis_ = std::move(phis);
}
// Swap the state so that the new nodes are now the previous nodes.
void NextIterationState() {
previous_phi_ = new_phi;
previous_latch_block_ = new_latch_block;
previous_condition_block_ = new_condition_block;
previous_phis_ = std::move(new_phis_);
// Clear new nodes.
new_phi = nullptr;
new_continue_block = nullptr;
new_condition_block = nullptr;
new_header_block = nullptr;
new_latch_block = nullptr;
// Clear new block/instruction maps.
new_blocks.clear();
new_inst.clear();
ids_to_new_inst.clear();
}
// The induction variable from the immediately preceding loop body.
Instruction* previous_phi_;
// All the phi nodes from the previous loop iteration.
std::vector<Instruction*> previous_phis_;
std::vector<Instruction*> new_phis_;
// The previous latch block. The backedge will be removed from this and
// added to the new latch block.
BasicBlock* previous_latch_block_;
// The previous condition block. This may be folded to flatten the loop.
BasicBlock* previous_condition_block_;
// The new induction variable.
Instruction* new_phi;
// The new continue block.
BasicBlock* new_continue_block;
// The new condition block.
BasicBlock* new_condition_block;
// The new header block.
BasicBlock* new_header_block;
// The new latch block.
BasicBlock* new_latch_block;
// A mapping of new block ids to the original blocks which they were copied
// from.
std::unordered_map<uint32_t, BasicBlock*> new_blocks;
// A mapping of the original instruction ids to the instruction ids to their
// copies.
std::unordered_map<uint32_t, uint32_t> new_inst;
std::unordered_map<uint32_t, Instruction*> ids_to_new_inst;
};
// This class implements the actual unrolling. It uses a LoopUnrollState to
// maintain the state of the unrolling inbetween steps.
class LoopUnrollerUtilsImpl {
public:
using BasicBlockListTy = std::vector<std::unique_ptr<BasicBlock>>;
LoopUnrollerUtilsImpl(IRContext* c, Function* function)
: context_(c),
function_(*function),
loop_condition_block_(nullptr),
loop_induction_variable_(nullptr),
number_of_loop_iterations_(0),
loop_step_value_(0),
loop_init_value_(0) {}
// Unroll the |loop| by given |factor| by copying the whole body |factor|
// times. The resulting basicblock structure will remain a loop.
void PartiallyUnroll(Loop*, size_t factor);
// If partially unrolling the |loop| would leave the loop with too many bodies
// for its number of iterations then this method should be used. This method
// will duplicate the |loop| completely, making the duplicated loop the
// successor of the original's merge block. The original loop will have its
// condition changed to loop over the residual part and the duplicate will be
// partially unrolled. The resulting structure will be two loops.
void PartiallyUnrollResidualFactor(Loop* loop, size_t factor);
// Fully unroll the |loop| by copying the full body by the total number of
// loop iterations, folding all conditions, and removing the backedge from the
// continue block to the header.
void FullyUnroll(Loop* loop);
// Get the ID of the variable in the |phi| paired with |label|.
uint32_t GetPhiDefID(const Instruction* phi, uint32_t label) const;
// Close the loop by removing the OpLoopMerge from the |loop| header block and
// making the backedge point to the merge block.
void CloseUnrolledLoop(Loop* loop);
// Remove the OpConditionalBranch instruction inside |conditional_block| used
// to branch to either exit or continue the loop and replace it with an
// unconditional OpBranch to block |new_target|.
void FoldConditionBlock(BasicBlock* condtion_block, uint32_t new_target);
// Add all blocks_to_add_ to function_ at the |insert_point|.
void AddBlocksToFunction(const BasicBlock* insert_point);
// Duplicates the |old_loop|, cloning each body and remaping the ids without
// removing instructions or changing relative structure. Result will be stored
// in |new_loop|.
void DuplicateLoop(Loop* old_loop, Loop* new_loop);
inline size_t GetLoopIterationCount() const {
return number_of_loop_iterations_;
}
// Extracts the initial state information from the |loop|.
void Init(Loop* loop);
// Replace the uses of each induction variable outside the loop with the final
// value of the induction variable before the loop exit. To reflect the proper
// state of a fully unrolled loop.
void ReplaceInductionUseWithFinalValue(Loop* loop);
// Remove all the instructions in the invalidated_instructions_ vector.
void RemoveDeadInstructions();
// Replace any use of induction variables outwith the loop with the final
// value of the induction variable in the unrolled loop.
void ReplaceOutsideLoopUseWithFinalValue(Loop* loop);
// Set the LoopControl operand of the OpLoopMerge instruction to be
// DontUnroll.
void MarkLoopControlAsDontUnroll(Loop* loop) const;
private:
// Remap all the in |basic_block| to new IDs and keep the mapping of new ids
// to old
// ids. |loop| is used to identify special loop blocks (header, continue,
// ect).
void AssignNewResultIds(BasicBlock* basic_block);
// Using the map built by AssignNewResultIds, replace the uses in |inst|
// by the id that the use maps to.
void RemapOperands(Instruction* inst);
// Using the map built by AssignNewResultIds, for each instruction in
// |basic_block| use
// that map to substitute the IDs used by instructions (in the operands) with
// the new ids.
void RemapOperands(BasicBlock* basic_block);
// Copy the whole body of the loop, all blocks dominated by the |loop| header
// and not dominated by the |loop| merge. The copied body will be linked to by
// the old |loop| continue block and the new body will link to the |loop|
// header via the new continue block. |eliminate_conditions| is used to decide
// whether or not to fold all the condition blocks other than the last one.
void CopyBody(Loop* loop, bool eliminate_conditions);
// Copy a given |block_to_copy| in the |loop| and record the mapping of the
// old/new ids. |preserve_instructions| determines whether or not the method
// will modify (other than result_id) instructions which are copied.
void CopyBasicBlock(Loop* loop, const BasicBlock* block_to_copy,
bool preserve_instructions);
// The actual implementation of the unroll step. Unrolls |loop| by given
// |factor| by copying the body by |factor| times. Also propagates the
// induction variable value throughout the copies.
void Unroll(Loop* loop, size_t factor);
// Fills the loop_blocks_inorder_ field with the ordered list of basic blocks
// as computed by the method ComputeLoopOrderedBlocks.
void ComputeLoopOrderedBlocks(Loop* loop);
// Adds the blocks_to_add_ to both the |loop| and to the parent of |loop| if
// the parent exists.
void AddBlocksToLoop(Loop* loop) const;
// After the partially unroll step the phi instructions in the header block
// will be in an illegal format. This function makes the phis legal by making
// the edge from the latch block come from the new latch block and the value
// to be the actual value of the phi at that point.
void LinkLastPhisToStart(Loop* loop) const;
// Kill all debug declaration instructions from |bb|.
void KillDebugDeclares(BasicBlock* bb);
// A pointer to the IRContext. Used to add/remove instructions and for usedef
// chains.
IRContext* context_;
// A reference the function the loop is within.
Function& function_;
// A list of basic blocks to be added to the loop at the end of an unroll
// step.
BasicBlockListTy blocks_to_add_;
// List of instructions which are now dead and can be removed.
std::vector<Instruction*> invalidated_instructions_;
// Maintains the current state of the transform between calls to unroll.
LoopUnrollState state_;
// An ordered list containing the loop basic blocks.
std::vector<BasicBlock*> loop_blocks_inorder_;
// The block containing the condition check which contains a conditional
// branch to the merge and continue block.
BasicBlock* loop_condition_block_;
// The induction variable of the loop.
Instruction* loop_induction_variable_;
// Phis used in the loop need to be remapped to use the actual result values
// and then be remapped at the end.
std::vector<Instruction*> loop_phi_instructions_;
// The number of loop iterations that the loop would preform pre-unroll.
size_t number_of_loop_iterations_;
// The amount that the loop steps each iteration.
int64_t loop_step_value_;
// The value the loop starts stepping from.
int64_t loop_init_value_;
};
/*
* Static helper functions.
*/
// Retrieve the index of the OpPhi instruction |phi| which corresponds to the
// incoming |block| id.
static uint32_t GetPhiIndexFromLabel(const BasicBlock* block,
const Instruction* phi) {
for (uint32_t i = 1; i < phi->NumInOperands(); i += 2) {
if (block->id() == phi->GetSingleWordInOperand(i)) {
return i;
}
}
assert(false && "Could not find operand in instruction.");
return 0;
}
void LoopUnrollerUtilsImpl::Init(Loop* loop) {
loop_condition_block_ = loop->FindConditionBlock();
// When we reinit the second loop during PartiallyUnrollResidualFactor we need
// to use the cached value from the duplicate step as the dominator tree
// basded solution, loop->FindConditionBlock, requires all the nodes to be
// connected up with the correct branches. They won't be at this point.
if (!loop_condition_block_) {
loop_condition_block_ = state_.new_condition_block;
}
assert(loop_condition_block_);
loop_induction_variable_ = loop->FindConditionVariable(loop_condition_block_);
assert(loop_induction_variable_);
bool found = loop->FindNumberOfIterations(
loop_induction_variable_, &*loop_condition_block_->ctail(),
&number_of_loop_iterations_, &loop_step_value_, &loop_init_value_);
(void)found; // To silence unused variable warning on release builds.
assert(found);
// Blocks are stored in an unordered set of ids in the loop class, we need to
// create the dominator ordered list.
ComputeLoopOrderedBlocks(loop);
}
// This function is used to partially unroll the loop when the factor provided
// would normally lead to an illegal optimization. Instead of just unrolling the
// loop it creates two loops and unrolls one and adjusts the condition on the
// other. The end result being that the new loop pair iterates over the correct
// number of bodies.
void LoopUnrollerUtilsImpl::PartiallyUnrollResidualFactor(Loop* loop,
size_t factor) {
// TODO(1841): Handle id overflow.
std::unique_ptr<Instruction> new_label{new Instruction(
context_, SpvOp::SpvOpLabel, 0, context_->TakeNextId(), {})};
std::unique_ptr<BasicBlock> new_exit_bb{new BasicBlock(std::move(new_label))};
// Save the id of the block before we move it.
uint32_t new_merge_id = new_exit_bb->id();
// Add the block the list of blocks to add, we want this merge block to be
// right at the start of the new blocks.
blocks_to_add_.push_back(std::move(new_exit_bb));
BasicBlock* new_exit_bb_raw = blocks_to_add_[0].get();
Instruction& original_conditional_branch = *loop_condition_block_->tail();
// Duplicate the loop, providing access to the blocks of both loops.
// This is a naked new due to the VS2013 requirement of not having unique
// pointers in vectors, as it will be inserted into a vector with
// loop_descriptor.AddLoop.
std::unique_ptr<Loop> new_loop = MakeUnique<Loop>(*loop);
// Clear the basic blocks of the new loop.
new_loop->ClearBlocks();
DuplicateLoop(loop, new_loop.get());
// Add the blocks to the function.
AddBlocksToFunction(loop->GetMergeBlock());
blocks_to_add_.clear();
// Create a new merge block for the first loop.
InstructionBuilder builder{context_, new_exit_bb_raw};
// Make the first loop branch to the second.
builder.AddBranch(new_loop->GetHeaderBlock()->id());
loop_condition_block_ = state_.new_condition_block;
loop_induction_variable_ = state_.new_phi;
// Unroll the new loop by the factor with the usual -1 to account for the
// existing block iteration.
Unroll(new_loop.get(), factor);
LinkLastPhisToStart(new_loop.get());
AddBlocksToLoop(new_loop.get());
// Add the new merge block to the back of the list of blocks to be added. It
// needs to be the last block added to maintain dominator order in the binary.
blocks_to_add_.push_back(
std::unique_ptr<BasicBlock>(new_loop->GetMergeBlock()));
// Add the blocks to the function.
AddBlocksToFunction(loop->GetMergeBlock());
// Reset the usedef analysis.
context_->InvalidateAnalysesExceptFor(
IRContext::Analysis::kAnalysisLoopAnalysis);
analysis::DefUseManager* def_use_manager = context_->get_def_use_mgr();
// The loop condition.
Instruction* condition_check = def_use_manager->GetDef(
original_conditional_branch.GetSingleWordOperand(0));
// This should have been checked by the LoopUtils::CanPerformUnroll function
// before entering this.
assert(loop->IsSupportedCondition(condition_check->opcode()));
// We need to account for the initial body when calculating the remainder.
int64_t remainder = Loop::GetResidualConditionValue(
condition_check->opcode(), loop_init_value_, loop_step_value_,
number_of_loop_iterations_, factor);
assert(remainder > std::numeric_limits<int32_t>::min() &&
remainder < std::numeric_limits<int32_t>::max());
Instruction* new_constant = nullptr;
// If the remainder is negative then we add a signed constant, otherwise just
// add an unsigned constant.
if (remainder < 0) {
new_constant = builder.GetSintConstant(static_cast<int32_t>(remainder));
} else {
new_constant = builder.GetUintConstant(static_cast<int32_t>(remainder));
}
uint32_t constant_id = new_constant->result_id();
// Update the condition check.
condition_check->SetInOperand(1, {constant_id});
// Update the next phi node. The phi will have a constant value coming in from
// the preheader block. For the duplicated loop we need to update the constant
// to be the amount of iterations covered by the first loop and the incoming
// block to be the first loops new merge block.
std::vector<Instruction*> new_inductions;
new_loop->GetInductionVariables(new_inductions);
std::vector<Instruction*> old_inductions;
loop->GetInductionVariables(old_inductions);
for (size_t index = 0; index < new_inductions.size(); ++index) {
Instruction* new_induction = new_inductions[index];
Instruction* old_induction = old_inductions[index];
// Get the index of the loop initalizer, the value coming in from the
// preheader.
uint32_t initalizer_index =
GetPhiIndexFromLabel(new_loop->GetPreHeaderBlock(), old_induction);
// Replace the second loop initalizer with the phi from the first
new_induction->SetInOperand(initalizer_index - 1,
{old_induction->result_id()});
new_induction->SetInOperand(initalizer_index, {new_merge_id});
// If the use of the first loop induction variable is outside of the loop
// then replace that use with the second loop induction variable.
uint32_t second_loop_induction = new_induction->result_id();
auto replace_use_outside_of_loop = [loop, second_loop_induction](
Instruction* user,
uint32_t operand_index) {
if (!loop->IsInsideLoop(user)) {
user->SetOperand(operand_index, {second_loop_induction});
}
};
context_->get_def_use_mgr()->ForEachUse(old_induction,
replace_use_outside_of_loop);
}
context_->InvalidateAnalysesExceptFor(
IRContext::Analysis::kAnalysisLoopAnalysis);
context_->ReplaceAllUsesWith(loop->GetMergeBlock()->id(), new_merge_id);
LoopDescriptor& loop_descriptor = *context_->GetLoopDescriptor(&function_);
loop_descriptor.AddLoop(std::move(new_loop), loop->GetParent());
RemoveDeadInstructions();
}
// Mark this loop as DontUnroll as it will already be unrolled and it may not
// be safe to unroll a previously partially unrolled loop.
void LoopUnrollerUtilsImpl::MarkLoopControlAsDontUnroll(Loop* loop) const {
Instruction* loop_merge_inst = loop->GetHeaderBlock()->GetLoopMergeInst();
assert(loop_merge_inst &&
"Loop merge instruction could not be found after entering unroller "
"(should have exited before this)");
loop_merge_inst->SetInOperand(kLoopControlIndex,
{kLoopControlDontUnrollIndex});
}
// Duplicate the |loop| body |factor| - 1 number of times while keeping the loop
// backedge intact. This will leave the loop with |factor| number of bodies
// after accounting for the initial body.
void LoopUnrollerUtilsImpl::Unroll(Loop* loop, size_t factor) {
// If we unroll a loop partially it will not be safe to unroll it further.
// This is due to the current method of calculating the number of loop
// iterations.
MarkLoopControlAsDontUnroll(loop);
std::vector<Instruction*> inductions;
loop->GetInductionVariables(inductions);
state_ = LoopUnrollState{loop_induction_variable_, loop->GetLatchBlock(),
loop_condition_block_, std::move(inductions)};
for (size_t i = 0; i < factor - 1; ++i) {
CopyBody(loop, true);
}
}
void LoopUnrollerUtilsImpl::RemoveDeadInstructions() {
// Remove the dead instructions.
for (Instruction* inst : invalidated_instructions_) {
context_->KillInst(inst);
}
}
void LoopUnrollerUtilsImpl::ReplaceInductionUseWithFinalValue(Loop* loop) {
context_->InvalidateAnalysesExceptFor(
IRContext::Analysis::kAnalysisLoopAnalysis |
IRContext::Analysis::kAnalysisDefUse |
IRContext::Analysis::kAnalysisInstrToBlockMapping);
std::vector<Instruction*> inductions;
loop->GetInductionVariables(inductions);
for (size_t index = 0; index < inductions.size(); ++index) {
uint32_t trip_step_id = GetPhiDefID(state_.previous_phis_[index],
state_.previous_latch_block_->id());
context_->ReplaceAllUsesWith(inductions[index]->result_id(), trip_step_id);
invalidated_instructions_.push_back(inductions[index]);
}
}
// Fully unroll the loop by partially unrolling it by the number of loop
// iterations minus one for the body already accounted for.
void LoopUnrollerUtilsImpl::FullyUnroll(Loop* loop) {
// We unroll the loop by number of iterations in the loop.
Unroll(loop, number_of_loop_iterations_);
// The first condition block is preserved until now so it can be copied.
FoldConditionBlock(loop_condition_block_, 1);
// Delete the OpLoopMerge and remove the backedge to the header.
CloseUnrolledLoop(loop);
// Mark the loop for later deletion. This allows us to preserve the loop
// iterators but still disregard dead loops.
loop->MarkLoopForRemoval();
// If the loop has a parent add the new blocks to the parent.
if (loop->GetParent()) {
AddBlocksToLoop(loop->GetParent());
}
// Add the blocks to the function.
AddBlocksToFunction(loop->GetMergeBlock());
ReplaceInductionUseWithFinalValue(loop);
RemoveDeadInstructions();
// Invalidate all analyses.
context_->InvalidateAnalysesExceptFor(
IRContext::Analysis::kAnalysisLoopAnalysis |
IRContext::Analysis::kAnalysisDefUse);
}
void LoopUnrollerUtilsImpl::KillDebugDeclares(BasicBlock* bb) {
// We cannot kill an instruction inside BasicBlock::ForEachInst()
// because it will generate dangling pointers. We use |to_be_killed|
// to kill them after the loop.
std::vector<Instruction*> to_be_killed;
bb->ForEachInst([&to_be_killed, this](Instruction* inst) {
if (context_->get_debug_info_mgr()->IsDebugDeclare(inst)) {
to_be_killed.push_back(inst);
}
});
for (auto* inst : to_be_killed) context_->KillInst(inst);
}
// Copy a given basic block, give it a new result_id, and store the new block
// and the id mapping in the state. |preserve_instructions| is used to determine
// whether or not this function should edit instructions other than the
// |result_id|.
void LoopUnrollerUtilsImpl::CopyBasicBlock(Loop* loop, const BasicBlock* itr,
bool preserve_instructions) {
// Clone the block exactly, including the IDs.
BasicBlock* basic_block = itr->Clone(context_);
basic_block->SetParent(itr->GetParent());
// We do not want to duplicate DebugDeclare.
KillDebugDeclares(basic_block);
// Assign each result a new unique ID and keep a mapping of the old ids to
// the new ones.
AssignNewResultIds(basic_block);
// If this is the continue block we are copying.
if (itr == loop->GetContinueBlock()) {
// Make the OpLoopMerge point to this block for the continue.
if (!preserve_instructions) {
Instruction* merge_inst = loop->GetHeaderBlock()->GetLoopMergeInst();
merge_inst->SetInOperand(1, {basic_block->id()});
context_->UpdateDefUse(merge_inst);
}
state_.new_continue_block = basic_block;
}
// If this is the header block we are copying.
if (itr == loop->GetHeaderBlock()) {
state_.new_header_block = basic_block;
if (!preserve_instructions) {
// Remove the loop merge instruction if it exists.
Instruction* merge_inst = basic_block->GetLoopMergeInst();
if (merge_inst) invalidated_instructions_.push_back(merge_inst);
}
}
// If this is the latch block being copied, record it in the state.
if (itr == loop->GetLatchBlock()) state_.new_latch_block = basic_block;
// If this is the condition block we are copying.
if (itr == loop_condition_block_) {
state_.new_condition_block = basic_block;
}
// Add this block to the list of blocks to add to the function at the end of
// the unrolling process.
blocks_to_add_.push_back(std::unique_ptr<BasicBlock>(basic_block));
// Keep tracking the old block via a map.
state_.new_blocks[itr->id()] = basic_block;
}
void LoopUnrollerUtilsImpl::CopyBody(Loop* loop, bool eliminate_conditions) {
// Copy each basic block in the loop, give them new ids, and save state
// information.
for (const BasicBlock* itr : loop_blocks_inorder_) {
CopyBasicBlock(loop, itr, false);
}
// Set the previous latch block to point to the new header.
Instruction* latch_branch = state_.previous_latch_block_->terminator();
latch_branch->SetInOperand(0, {state_.new_header_block->id()});
context_->UpdateDefUse(latch_branch);
// As the algorithm copies the original loop blocks exactly, the tail of the
// latch block on iterations after the first one will be a branch to the new
// header and not the actual loop header. The last continue block in the loop
// should always be a backedge to the global header.
Instruction* new_latch_branch = state_.new_latch_block->terminator();
new_latch_branch->SetInOperand(0, {loop->GetHeaderBlock()->id()});
context_->AnalyzeUses(new_latch_branch);
std::vector<Instruction*> inductions;
loop->GetInductionVariables(inductions);
for (size_t index = 0; index < inductions.size(); ++index) {
Instruction* primary_copy = inductions[index];
assert(primary_copy->result_id() != 0);
Instruction* induction_clone =
state_.ids_to_new_inst[state_.new_inst[primary_copy->result_id()]];
state_.new_phis_.push_back(induction_clone);
assert(induction_clone->result_id() != 0);
if (!state_.previous_phis_.empty()) {
state_.new_inst[primary_copy->result_id()] = GetPhiDefID(
state_.previous_phis_[index], state_.previous_latch_block_->id());
} else {
// Do not replace the first phi block ids.
state_.new_inst[primary_copy->result_id()] = primary_copy->result_id();
}
}
if (eliminate_conditions &&
state_.new_condition_block != loop_condition_block_) {
FoldConditionBlock(state_.new_condition_block, 1);
}
// Only reference to the header block is the backedge in the latch block,
// don't change this.
state_.new_inst[loop->GetHeaderBlock()->id()] = loop->GetHeaderBlock()->id();
for (auto& pair : state_.new_blocks) {
RemapOperands(pair.second);
}
for (Instruction* dead_phi : state_.new_phis_)
invalidated_instructions_.push_back(dead_phi);
// Swap the state so the new is now the previous.
state_.NextIterationState();
}
uint32_t LoopUnrollerUtilsImpl::GetPhiDefID(const Instruction* phi,
uint32_t label) const {
for (uint32_t operand = 3; operand < phi->NumOperands(); operand += 2) {
if (phi->GetSingleWordOperand(operand) == label) {
return phi->GetSingleWordOperand(operand - 1);
}
}
assert(false && "Could not find a phi index matching the provided label");
return 0;
}
void LoopUnrollerUtilsImpl::FoldConditionBlock(BasicBlock* condition_block,
uint32_t operand_label) {
// Remove the old conditional branch to the merge and continue blocks.
Instruction& old_branch = *condition_block->tail();
uint32_t new_target = old_branch.GetSingleWordOperand(operand_label);
DebugScope scope = old_branch.GetDebugScope();
const std::vector<Instruction> lines = old_branch.dbg_line_insts();
context_->KillInst(&old_branch);
// Add the new unconditional branch to the merge block.
InstructionBuilder builder(
context_, condition_block,
IRContext::Analysis::kAnalysisDefUse |
IRContext::Analysis::kAnalysisInstrToBlockMapping);
Instruction* new_branch = builder.AddBranch(new_target);
new_branch->set_dbg_line_insts(lines);
new_branch->SetDebugScope(scope);
}
void LoopUnrollerUtilsImpl::CloseUnrolledLoop(Loop* loop) {
// Remove the OpLoopMerge instruction from the function.
Instruction* merge_inst = loop->GetHeaderBlock()->GetLoopMergeInst();
invalidated_instructions_.push_back(merge_inst);
// Remove the final backedge to the header and make it point instead to the
// merge block.
Instruction* latch_instruction = state_.previous_latch_block_->terminator();
latch_instruction->SetInOperand(0, {loop->GetMergeBlock()->id()});
context_->UpdateDefUse(latch_instruction);
// Remove all induction variables as the phis will now be invalid. Replace all
// uses with the constant initializer value (all uses of phis will be in
// the first iteration with the subsequent phis already having been removed).
std::vector<Instruction*> inductions;
loop->GetInductionVariables(inductions);
// We can use the state instruction mechanism to replace all internal loop
// values within the first loop trip (as the subsequent ones will be updated
// by the copy function) with the value coming in from the preheader and then
// use context ReplaceAllUsesWith for the uses outside the loop with the final
// trip phi value.
state_.new_inst.clear();
for (Instruction* induction : inductions) {
uint32_t initalizer_id =
GetPhiDefID(induction, loop->GetPreHeaderBlock()->id());
state_.new_inst[induction->result_id()] = initalizer_id;
}
for (BasicBlock* block : loop_blocks_inorder_) {
RemapOperands(block);
}
// Rewrite the last phis, since they may still reference the original phi.
for (Instruction* last_phi : state_.previous_phis_) {
RemapOperands(last_phi);
}
}
// Uses the first loop to create a copy of the loop with new IDs.
void LoopUnrollerUtilsImpl::DuplicateLoop(Loop* old_loop, Loop* new_loop) {
std::vector<BasicBlock*> new_block_order;
// Copy every block in the old loop.
for (const BasicBlock* itr : loop_blocks_inorder_) {
CopyBasicBlock(old_loop, itr, true);
new_block_order.push_back(blocks_to_add_.back().get());
}
// Clone the merge block, give it a new id and record it in the state.
BasicBlock* new_merge = old_loop->GetMergeBlock()->Clone(context_);
new_merge->SetParent(old_loop->GetMergeBlock()->GetParent());
AssignNewResultIds(new_merge);
state_.new_blocks[old_loop->GetMergeBlock()->id()] = new_merge;
// Remap the operands of every instruction in the loop to point to the new
// copies.
for (auto& pair : state_.new_blocks) {
RemapOperands(pair.second);
}
loop_blocks_inorder_ = std::move(new_block_order);
AddBlocksToLoop(new_loop);
new_loop->SetHeaderBlock(state_.new_header_block);
new_loop->SetContinueBlock(state_.new_continue_block);
new_loop->SetLatchBlock(state_.new_latch_block);
new_loop->SetMergeBlock(new_merge);
}
// Whenever the utility copies a block it stores it in a tempory buffer, this
// function adds the buffer into the Function. The blocks will be inserted
// after the block |insert_point|.
void LoopUnrollerUtilsImpl::AddBlocksToFunction(
const BasicBlock* insert_point) {
for (auto basic_block_iterator = function_.begin();
basic_block_iterator != function_.end(); ++basic_block_iterator) {
if (basic_block_iterator->id() == insert_point->id()) {
basic_block_iterator.InsertBefore(&blocks_to_add_);
return;
}
}
assert(
false &&
"Could not add basic blocks to function as insert point was not found.");
}
// Assign all result_ids in |basic_block| instructions to new IDs and preserve
// the mapping of new ids to old ones.
void LoopUnrollerUtilsImpl::AssignNewResultIds(BasicBlock* basic_block) {
analysis::DefUseManager* def_use_mgr = context_->get_def_use_mgr();
// Label instructions aren't covered by normal traversal of the
// instructions.
// TODO(1841): Handle id overflow.
uint32_t new_label_id = context_->TakeNextId();
// Assign a new id to the label.
state_.new_inst[basic_block->GetLabelInst()->result_id()] = new_label_id;
basic_block->GetLabelInst()->SetResultId(new_label_id);
def_use_mgr->AnalyzeInstDefUse(basic_block->GetLabelInst());
for (Instruction& inst : *basic_block) {
uint32_t old_id = inst.result_id();
// Ignore stores etc.
if (old_id == 0) {
continue;
}
// Give the instruction a new id.
// TODO(1841): Handle id overflow.
inst.SetResultId(context_->TakeNextId());
def_use_mgr->AnalyzeInstDef(&inst);
// Save the mapping of old_id -> new_id.
state_.new_inst[old_id] = inst.result_id();
// Check if this instruction is the induction variable.
if (loop_induction_variable_->result_id() == old_id) {
// Save a pointer to the new copy of it.
state_.new_phi = &inst;
}
state_.ids_to_new_inst[inst.result_id()] = &inst;
}
}
void LoopUnrollerUtilsImpl::RemapOperands(Instruction* inst) {
auto remap_operands_to_new_ids = [this](uint32_t* id) {
auto itr = state_.new_inst.find(*id);
if (itr != state_.new_inst.end()) {
*id = itr->second;
}
};
inst->ForEachInId(remap_operands_to_new_ids);
context_->AnalyzeUses(inst);
}
void LoopUnrollerUtilsImpl::RemapOperands(BasicBlock* basic_block) {
for (Instruction& inst : *basic_block) {
RemapOperands(&inst);
}
}
// Generate the ordered list of basic blocks in the |loop| and cache it for
// later use.
void LoopUnrollerUtilsImpl::ComputeLoopOrderedBlocks(Loop* loop) {
loop_blocks_inorder_.clear();
loop->ComputeLoopStructuredOrder(&loop_blocks_inorder_);
}
// Adds the blocks_to_add_ to both the loop and to the parent.
void LoopUnrollerUtilsImpl::AddBlocksToLoop(Loop* loop) const {
// Add the blocks to this loop.
for (auto& block_itr : blocks_to_add_) {
loop->AddBasicBlock(block_itr.get());
}
// Add the blocks to the parent as well.
if (loop->GetParent()) AddBlocksToLoop(loop->GetParent());
}
void LoopUnrollerUtilsImpl::LinkLastPhisToStart(Loop* loop) const {
std::vector<Instruction*> inductions;
loop->GetInductionVariables(inductions);
for (size_t i = 0; i < inductions.size(); ++i) {
Instruction* last_phi_in_block = state_.previous_phis_[i];
uint32_t phi_index =
GetPhiIndexFromLabel(state_.previous_latch_block_, last_phi_in_block);
uint32_t phi_variable =
last_phi_in_block->GetSingleWordInOperand(phi_index - 1);
uint32_t phi_label = last_phi_in_block->GetSingleWordInOperand(phi_index);
Instruction* phi = inductions[i];
phi->SetInOperand(phi_index - 1, {phi_variable});
phi->SetInOperand(phi_index, {phi_label});
}
}
// Duplicate the |loop| body |factor| number of times while keeping the loop
// backedge intact.
void LoopUnrollerUtilsImpl::PartiallyUnroll(Loop* loop, size_t factor) {
Unroll(loop, factor);
LinkLastPhisToStart(loop);
AddBlocksToLoop(loop);
AddBlocksToFunction(loop->GetMergeBlock());
RemoveDeadInstructions();
}
/*
* End LoopUtilsImpl.
*/
} // namespace
/*
*
* Begin Utils.
*
* */
bool LoopUtils::CanPerformUnroll() {
// The loop is expected to be in structured order.
if (!loop_->GetHeaderBlock()->GetMergeInst()) {
return false;
}
// Find check the loop has a condition we can find and evaluate.
const BasicBlock* condition = loop_->FindConditionBlock();
if (!condition) return false;
// Check that we can find and process the induction variable.
const Instruction* induction = loop_->FindConditionVariable(condition);
if (!induction || induction->opcode() != SpvOpPhi) return false;
// Check that we can find the number of loop iterations.
if (!loop_->FindNumberOfIterations(induction, &*condition->ctail(), nullptr))
return false;
// Make sure the latch block is a unconditional branch to the header
// block.
const Instruction& branch = *loop_->GetLatchBlock()->ctail();
bool branching_assumption =
branch.opcode() == SpvOpBranch &&
branch.GetSingleWordInOperand(0) == loop_->GetHeaderBlock()->id();
if (!branching_assumption) {
return false;
}
std::vector<Instruction*> inductions;
loop_->GetInductionVariables(inductions);
// Ban breaks within the loop.
const std::vector<uint32_t>& merge_block_preds =
context_->cfg()->preds(loop_->GetMergeBlock()->id());
if (merge_block_preds.size() != 1) {
return false;
}
// Ban continues within the loop.
const std::vector<uint32_t>& continue_block_preds =
context_->cfg()->preds(loop_->GetContinueBlock()->id());
if (continue_block_preds.size() != 1) {
return false;
}
// Ban returns in the loop.
// Iterate over all the blocks within the loop and check that none of them
// exit the loop.
for (uint32_t label_id : loop_->GetBlocks()) {
const BasicBlock* block = context_->cfg()->block(label_id);
if (block->ctail()->opcode() == SpvOp::SpvOpKill ||
block->ctail()->opcode() == SpvOp::SpvOpReturn ||
block->ctail()->opcode() == SpvOp::SpvOpReturnValue ||
block->ctail()->opcode() == SpvOp::SpvOpTerminateInvocation) {
return false;
}
}
// Can only unroll inner loops.
if (!loop_->AreAllChildrenMarkedForRemoval()) {
return false;
}
return true;
}
bool LoopUtils::PartiallyUnroll(size_t factor) {
if (factor == 1 || !CanPerformUnroll()) return false;
// Create the unroller utility.
LoopUnrollerUtilsImpl unroller{context_,
loop_->GetHeaderBlock()->GetParent()};
unroller.Init(loop_);
// If the unrolling factor is larger than or the same size as the loop just
// fully unroll the loop.
if (factor >= unroller.GetLoopIterationCount()) {
unroller.FullyUnroll(loop_);
return true;
}
// If the loop unrolling factor is an residual number of iterations we need to
// let run the loop for the residual part then let it branch into the unrolled
// remaining part. We add one when calucating the remainder to take into
// account the one iteration already in the loop.
if (unroller.GetLoopIterationCount() % factor != 0) {
unroller.PartiallyUnrollResidualFactor(loop_, factor);
} else {
unroller.PartiallyUnroll(loop_, factor);
}
return true;
}
bool LoopUtils::FullyUnroll() {
if (!CanPerformUnroll()) return false;
std::vector<Instruction*> inductions;
loop_->GetInductionVariables(inductions);
LoopUnrollerUtilsImpl unroller{context_,
loop_->GetHeaderBlock()->GetParent()};
unroller.Init(loop_);
unroller.FullyUnroll(loop_);
return true;
}
void LoopUtils::Finalize() {
// Clean up the loop descriptor to preserve the analysis.
LoopDescriptor* LD = context_->GetLoopDescriptor(&function_);
LD->PostModificationCleanup();
}
/*
*
* Begin Pass.
*
*/
Pass::Status LoopUnroller::Process() {
bool changed = false;
for (Function& f : *context()->module()) {
LoopDescriptor* LD = context()->GetLoopDescriptor(&f);
for (Loop& loop : *LD) {
LoopUtils loop_utils{context(), &loop};
if (!loop.HasUnrollLoopControl() || !loop_utils.CanPerformUnroll()) {
continue;
}
if (fully_unroll_) {
loop_utils.FullyUnroll();
} else {
loop_utils.PartiallyUnroll(unroll_factor_);
}
changed = true;
}
LD->PostModificationCleanup();
}
return changed ? Status::SuccessWithChange : Status::SuccessWithoutChange;
}
} // namespace opt
} // namespace spvtools
| [
"Collin"
] | Collin |
31c496d789756c0ea5fbab0bced6f97d9ab2a540 | ae7caa892571146c2747e74d19f52fb98cdb791c | /airec/include/alibabacloud/airec/model/PushInterventionResult.h | 7ae5e24e7033baf6cbc2176c577a47ccc7e2d610 | [
"Apache-2.0"
] | permissive | hitlqh/aliyun-openapi-cpp-sdk | f01460a23d0370301b99a84b4c3b1563d74a763b | 65f76cc2c832833341cd18118abba666037edaa9 | refs/heads/master | 2023-03-14T04:03:37.128843 | 2021-03-08T03:22:15 | 2021-03-08T03:22:15 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,493 | h | /*
* Copyright 2009-2017 Alibaba Cloud All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef ALIBABACLOUD_AIREC_MODEL_PUSHINTERVENTIONRESULT_H_
#define ALIBABACLOUD_AIREC_MODEL_PUSHINTERVENTIONRESULT_H_
#include <string>
#include <vector>
#include <utility>
#include <alibabacloud/core/ServiceResult.h>
#include <alibabacloud/airec/AirecExport.h>
namespace AlibabaCloud
{
namespace Airec
{
namespace Model
{
class ALIBABACLOUD_AIREC_EXPORT PushInterventionResult : public ServiceResult
{
public:
PushInterventionResult();
explicit PushInterventionResult(const std::string &payload);
~PushInterventionResult();
std::string getMessage()const;
std::string getCode()const;
bool getResult()const;
protected:
void parse(const std::string &payload);
private:
std::string message_;
std::string code_;
bool result_;
};
}
}
}
#endif // !ALIBABACLOUD_AIREC_MODEL_PUSHINTERVENTIONRESULT_H_ | [
"sdk-team@alibabacloud.com"
] | sdk-team@alibabacloud.com |
864f74ee7c2f85b54335b6f4b212c819428a4f99 | 0f663ef38ee88f31787e5f64d9e832d2e9d1c5da | /trie.h | c2ec9431f5b9a30d0e720df5e4af92a1eae82c79 | [] | no_license | BrandonOdiwuor/SpellCheckerAndCorrector | d40912b6e0b2783ccb606d5ebcd0d94945c15ec9 | 7f7f98e5547864110be13059edbd5bf92cf6b970 | refs/heads/master | 2020-03-28T17:05:46.694420 | 2018-09-14T08:16:48 | 2018-09-14T08:16:48 | 148,757,697 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,030 | h | /*
* File: trie.h
* Author: Brandon Wayne Odiwuor
* Date: Septermber 11th, 2018
* -----------------------------
* This file exports implementation of Trie data structure
*/
#ifndef _trie_h
#define _trie_h
#include <iostream>
#include <string>
/*
* Type: TrieNode
* --------------
* This structure stores properties of nodes of the trie(radix tree)
*/
struct TrieNode {
char character;
TrieNode *children[26] = {NULL};
bool isEndOfWord = false;
};
/*
* Function: createNode
* Usage: TrieNode *node = createNode(char c);
* -------------------------------------------
* Creates a Node and initializes its character property to c,
* Returns a pointer to the node created
*/
TrieNode *createNode(char character);
/*
* Function: insert
* Usage: insert(root, word);
* --------------------------
* Inserts word into trie whose root has been specified
*/
void insert(TrieNode *root, std::string word);
/*
* Function: search
* Usage: search(root, word);
* --------------------------
* Returns true if word is in the trie whose root is previded and false otherwise
*/
bool search(TrieNode *root, std::string word);
/* Function Implementations */
TrieNode *createNode(char character) {
TrieNode *newNode = new TrieNode;
newNode->character = character;
return newNode;
}
void insert(TrieNode *root, std::string word) {
TrieNode *currentNode = root;
for(int i = 0; i < word.length(); i++) {
int index = word[i] - 'a';
if(!currentNode->children[index]) {
TrieNode *newNode = createNode(word[i]);
currentNode->children[index] = newNode;
}
currentNode = currentNode->children[index];
}
currentNode->isEndOfWord = true;
}
bool search(TrieNode *root, std::string word) {
TrieNode *currentNode = root;
for(int i = 0; i < word.length(); i++) {
int charIndex = word[i] - 'a';
if(!currentNode->children[charIndex]) {
return false;
}
currentNode = currentNode->children[charIndex];
}
return currentNode->isEndOfWord;
}
#endif
| [
"brandon.odiwuor@gmail.com"
] | brandon.odiwuor@gmail.com |
1820652cc22496dc72b0567cb0d8f1ee9c2b2908 | 03df8063d74c07015526260faf1efaeb78289a0c | /src/click/elements/netproxy/networkproxyserver.hh | c056f1241e67259c8416dc8baf3c17d733f7a58c | [] | no_license | ianrose14/argos | 6ed5bf94a97d4b48fdcdde66108df8c97ca051bd | b540fb93062cd566a2f148c5d429f66fbff74444 | refs/heads/master | 2016-09-05T22:18:57.988099 | 2012-06-28T14:30:36 | 2012-06-28T14:30:36 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 992 | hh | #ifndef CLICK_NETWORKPROXYSERVER_HH
#define CLICK_NETWORKPROXYSERVER_HH
#include <click/element.hh>
#include <click/hashmap.hh>
#include "proxyreceiver.hh"
#include "proxyserver.hh"
#include "../loghandler.hh"
CLICK_DECLS
/*
=c
NetworkProxyserver()
*/
class NetworkProxyServer : public Element {
public:
NetworkProxyServer();
~NetworkProxyServer();
const char *class_name() const { return "NetworkProxyServer"; }
const char *port_count() const { return PORTS_0_1; }
const char *processing() const { return PUSH; }
// Element methods
void add_handlers();
int configure(Vector<String>&, ErrorHandler*);
int initialize(ErrorHandler*);
void selected(int);
private:
int stop_accepting_handler(const String&, ErrorHandler*);
static String read_handler(Element*, void*);
static int write_handler(const String&, Element*, void*, ErrorHandler*);
ProxyServer _server;
uint16_t _port;
Logger *_log;
};
CLICK_ENDDECLS
#endif
| [
"ianrose14@gmail.com"
] | ianrose14@gmail.com |
b5ff03deefd8e714ac0ea3132cb8bc7c261345ca | d4cbb38cdffbaab3314be5f63c813afa0c689ffd | /Lab-02 (BarChart-Rectangle-setColor-setFillStyle-FloodFill)/GraphicsLab_02/GraphicsLab_02/Test.cpp | 930f903234897a2ee82ec4c5cc2e83f8554596a6 | [] | no_license | mdtanvirhossain/Computer_Graphics_Lab_CSE422_DIU_Summer_2019 | 21480c2a49b6a5a8f66e121e85b5f689e7a64114 | d849e5c106ad8637f82156f2df3299e377b267c9 | refs/heads/master | 2020-05-27T09:02:50.426986 | 2019-08-03T12:14:34 | 2019-08-03T12:14:34 | 188,559,078 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 464 | cpp | #include<graphics.h>
#include<conio.h>
main(){
int driver,mode;
driver=DETECT;
mode=0;
initgraph(&driver,&mode,"c:\\tc\\bgi");
setbkcolor(WHITE);
setcolor(WHITE);
rectangle(150,40,450,180);
setfillstyle(1,GREEN);
floodfill(160,50,WHITE);
setcolor(WHITE);
rectangle(138,35,150,450);
setfillstyle(1,BLUE);
floodfill(140,40,WHITE);
setcolor(WHITE);
bar(130,450,160,460);
setcolor(WHITE);
circle(300,110,55);
setfillstyle(1,RED);
floodfill(320,120,WHITE);
getch();}
| [
"tanvir15-7157@diu.edu.bd"
] | tanvir15-7157@diu.edu.bd |
01112cb94fbf7657d0e59aaebf1086a2670e8f48 | f540f6e63fd9efa69a38d88ab1f435f589d15d3b | /inexlib/ourex/dcmtk/dcmimgle/include/dcmtk/dcmimgle/displint.h | 9affc035321a4698a54b6d76639d30ba8cc2b9c6 | [
"LicenseRef-scancode-warranty-disclaimer",
"Apache-2.0",
"BSD-3-Clause",
"BSD-4.3TAHOE",
"xlock",
"IJG",
"LicenseRef-scancode-other-permissive"
] | permissive | gbarrand/ioda | a43aab4548d36074dc49c3924b6826aff8446ad8 | bf569f61703cf25e60145d0a28b947937cf40fe4 | refs/heads/master | 2021-07-09T02:51:58.267796 | 2018-12-20T13:56:04 | 2018-12-20T13:56:04 | 135,979,262 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 10,290 | h | /*
*
* Copyright (C) 1996-2010, OFFIS e.V.
* All rights reserved. See COPYRIGHT file for details.
*
* This software and supporting documentation were developed by
*
* OFFIS e.V.
* R&D Division Health
* Escherweg 2
* D-26121 Oldenburg, Germany
*
*
* Module: dcmimgle
*
* Author: Joerg Riesmeier
*
* Purpose: DiCubicSpline Function/Interpolation (Header/Implementation)
*
* Last Update: $Author: barrand $
* Update Date: $Date: 2013/07/02 07:15:11 $
* CVS/RCS Revision: $Revision: 1.2 $
* Status: $State: Exp $
*
* CVS/RCS Log at end of file
*
*/
#ifndef DISPLINT_H
#define DISPLINT_H
#include "dcmtk/config/osconfig.h"
#include "dcmtk/ofstd/ofcast.h"
#define INCLUDE_CSTDDEF /* For NULL */
#include "dcmtk/ofstd/ofstdinc.h"
/*--------------------*
* macro definition *
*--------------------*/
// SunCC 4.x does not support default values for template types :-/
#define T3_ double
/*------------------*
* template class *
*------------------*/
/** Template class for cubic spline interpolation
*/
template <class T1, class T2 /*, class T3 = double*/>
class DiCubicSpline
{
public:
/** calculate spline function for given points.
* T1 = type of x coordinates
* T2 = type of y coordinates
* T3_ = type of y coordinates of the spline function
*
** @param x array with x coordinates of given points
* @param y array with y coordinates of given points
* @param n number of entries in array (= points)
* @param y2 array used to store the resulting spline function (used for CubicSplineInterpolation)
* @param yp1 first derivative of the interpolating function at point 1
* @param ypn first derivative of the interpolating function at point n
*
** @return true if successful, false otherwise
*/
static int Function(const T1 *x,
const T2 *y,
const unsigned int n,
T3_ *y2,
const T3_ yp1 = 1.0e30,
const T3_ ypn = 1.0e30)
{
if ((x != NULL) && (y != NULL) && (n > 0) && (y2 != NULL))
{
T3_ *u = new T3_[n]; // temporary vector
if (u != NULL)
{
register unsigned int i;
T3_ p, qn, sig, un;
if (yp1 > 0.99e30) // ignore value for first derivative at point 1
y2[0] = u[0] = 0.0;
else
{
y2[0] = -0.5;
u[0] = (3.0 / (OFstatic_cast(T3_, x[1]) - OFstatic_cast(T3_, x[0]))) *
((OFstatic_cast(T3_, y[1]) - OFstatic_cast(T3_, y[0])) /
(OFstatic_cast(T3_, x[1]) - OFstatic_cast(T3_, x[0])) - yp1);
}
for (i = 1; i < n - 1; ++i)
{
sig = (OFstatic_cast(T3_, x[i]) - OFstatic_cast(T3_, x[i - 1])) /
(OFstatic_cast(T3_, x[i + 1]) - OFstatic_cast(T3_, x[i - 1]));
p = sig * y2[i - 1] + 2.0;
y2[i] = (sig - 1.0) / p;
u[i] = (OFstatic_cast(T3_, y[i + 1]) - OFstatic_cast(T3_, y[i])) /
(OFstatic_cast(T3_, x[i + 1]) - OFstatic_cast(T3_, x[i])) -
(OFstatic_cast(T3_, y[i]) - OFstatic_cast(T3_, y[i - 1])) /
(OFstatic_cast(T3_, x[i]) - OFstatic_cast(T3_, x[i - 1]));
u[i] = (6.0 * u[i] / (OFstatic_cast(T3_, x[i + 1]) -
OFstatic_cast(T3_, x[i - 1])) - sig * u[i - 1]) / p;
}
if (ypn > 0.99e30) // ignore value for first derivative at point 1
qn = un = 0.0;
else
{
qn = 0.5;
un = (3.0 / (OFstatic_cast(T3_, x[n - 1]) - OFstatic_cast(T3_, x[n - 2]))) *
(ypn - (OFstatic_cast(T3_, y[n - 1]) - OFstatic_cast(T3_, y[n - 2])) /
(OFstatic_cast(T3_, x[n - 1]) - OFstatic_cast(T3_, x[n - 2])));
}
y2[n - 1] = (un - qn * u[n - 2]) / (qn * y2[n - 2] + 1.0);
for (i = n - 1; i > 0; --i)
y2[i - 1] = y2[i - 1] * y2[i] + u[i - 1];
delete[] u;
return 1;
}
}
return 0;
}
/** perform cubic spline interpolation for given points.
* T1 = type of x coordinates
* T2 = type of y coordinates
* T3_ = type of y coordinates of the spline function
*
** @param xa array with x coordinates of given points
* @param ya array with y coordinates of given points
* @param y2a array used to store the resulting spline function (calculated by CubicSplineFunction)
* @param na number of entries in above arrays (xa, ya and y2a)
* @param x array with x coordinates of points to be interpolated
* @param y array used to store interpolated values
* @param n number of entries in above array (x and y)
*
** @return true if successful, false otherwise
*/
static int Interpolation(const T1 *xa,
const T2 *ya,
const T3_ *y2a,
const unsigned int na,
const T1 *x,
T2 *y,
const unsigned int n)
{
if ((xa != NULL) && (ya != NULL) && (y2a != NULL) && (na > 0) && (x != NULL) && (y != NULL) && (n > 0))
{
register unsigned int k, i;
register unsigned int klo = 0;
register unsigned int khi = na - 1;
T3_ h, b, a;
for (i = 0; i < n; ++i)
{
if ((xa[klo] > x[i]) || (xa[khi] < x[i])) // optimization
{
klo = 0;
khi = na - 1;
}
while (khi - klo > 1) // search right place in the table, if necessary
{
k = (khi + klo) >> 1;
if (xa[k] > x[i])
khi = k;
else
klo = k;
}
if (xa[khi] == x[i]) // optimization: use known values
y[i] = ya[khi];
else
{
h = OFstatic_cast(T3_, xa[khi]) - OFstatic_cast(T3_, xa[klo]);
if (h == 0.0) // bad xa input, values must be distinct !
return 0;
a = (OFstatic_cast(T3_, xa[khi]) - OFstatic_cast(T3_, x[i])) / h;
b = (OFstatic_cast(T3_, x[i]) - OFstatic_cast(T3_, xa[klo])) / h;
y[i] = OFstatic_cast(T2, a * OFstatic_cast(T3_, ya[klo]) + b * OFstatic_cast(T3_, ya[khi]) +
((a * a * a - a) * y2a[klo] + (b * b * b - b) * y2a[khi]) * (h * h) / 6.0);
}
}
return 1;
}
return 0;
}
};
#endif
/*
*
* CVS/RCS Log:
* $Log: displint.h,v $
* Revision 1.2 2013/07/02 07:15:11 barrand
* *** empty log message ***
*
* Revision 1.21 2010-10-14 13:16:27 joergr
* Updated copyright header. Added reference to COPYRIGHT file.
*
* Revision 1.20 2010-03-01 09:08:47 uli
* Removed some unnecessary include directives in the headers.
*
* Revision 1.19 2005-12-08 16:48:10 meichel
* Changed include path schema for all DCMTK header files
*
* Revision 1.18 2003/12/23 15:53:22 joergr
* Replaced post-increment/decrement operators by pre-increment/decrement
* operators where appropriate (e.g. 'i++' by '++i').
*
* Revision 1.17 2003/12/08 19:20:47 joergr
* Adapted type casts to new-style typecast operators defined in ofcast.h.
* Removed leading underscore characters from preprocessor symbols (reserved
* symbols). Updated copyright header.
*
* Revision 1.16 2002/07/18 12:30:59 joergr
* Removed unused code.
*
* Revision 1.15 2001/06/01 15:49:51 meichel
* Updated copyright header
*
* Revision 1.14 2000/03/08 16:24:24 meichel
* Updated copyright header.
*
* Revision 1.13 2000/02/02 14:33:54 joergr
* Replaced 'delete' statements by 'delete[]' for objects created with 'new[]'.
*
* Revision 1.12 1999/10/21 08:29:42 joergr
* Renamed template type definition from 'T3' to 'T3_' to avoid naming
* conflicts.
*
* Revision 1.11 1999/10/20 18:38:50 joergr
* Eliminated default values for template types since this features is not
* supported by SunCC 4.x (temporarily introduced '#define' instead).
*
* Revision 1.10 1999/10/15 09:38:31 joergr
* Fixed typos.
*
* Revision 1.9 1999/10/14 19:05:17 joergr
* Fixed typo.
*
* Revision 1.8 1999/10/01 13:25:35 joergr
* Enhanced template class for cubic spline interpolation to support
* non-floating point classes/types as y-coordinates.
*
* Revision 1.7 1999/07/23 14:11:25 joergr
* Added preliminary support for 2D bi-cubic spline interpolation (currently
* not used).
*
* Revision 1.6 1999/05/03 11:09:31 joergr
* Minor code purifications to keep Sun CC 2.0.1 quiet.
*
* Revision 1.5 1999/04/29 13:49:08 joergr
* Renamed class CubicSpline to DiCubicSpline.
*
* Revision 1.4 1999/03/24 17:20:26 joergr
* Added/Modified comments and formatting.
*
* Revision 1.3 1999/03/22 08:52:43 joergr
* Added/Changed comments.
*
* Revision 1.2 1999/02/25 16:17:16 joergr
* Initialize local variables to avoid compiler warnings (reported by gcc
* 2.7.2.1 on Linux).
*
* Revision 1.1 1999/02/11 16:36:29 joergr
* Renamed file to indicate the use of templates.
*
* Revision 1.2 1999/02/09 14:21:54 meichel
* Removed default parameters from template functions, required for Sun CC 4.2
*
* Revision 1.1 1999/02/04 17:59:23 joergr
* Added support for calibration according to Barten transformation (incl.
* a DISPLAY file describing the monitor characteristic).
*
*
*/
| [
"guy.barrand@gmail.com"
] | guy.barrand@gmail.com |
92bee91be78c05befacba665d1d2d11e025820b7 | ded208ac8c9ff885f3e07eb5b74fe2b550dc533d | /cpp/src/gandiva/precompiled/date.h | 3c6f874b58d715e235eba688f009d9191d503abf | [
"Apache-2.0",
"CC0-1.0",
"MIT",
"BSD-3-Clause",
"BSL-1.0",
"LicenseRef-scancode-public-domain",
"BSD-2-Clause"
] | permissive | pdxtrader/arrow | d9b1d0d62b91337e95649e793fe309de0b3ebb57 | 4fbbffa3fab81fb4b4c483f01090a7740cf4f448 | refs/heads/master | 2020-04-04T04:58:52.088927 | 2018-11-01T14:19:10 | 2018-11-01T14:19:10 | 155,731,798 | 1 | 1 | Apache-2.0 | 2018-11-01T14:58:50 | 2018-11-01T14:58:49 | null | UTF-8 | C++ | false | false | 217,768 | h | #ifndef DATE_H
#define DATE_H
// The MIT License (MIT)
//
// Copyright (c) 2015, 2016, 2017 Howard Hinnant
// Copyright (c) 2016 Adrian Colomitchi
// Copyright (c) 2017 Florian Dang
// Copyright (c) 2017 Paul Thompson
// Copyright (c) 2018 Tomasz Kamiński
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
//
// Our apologies. When the previous paragraph was written, lowercase had not yet
// been invented (that would involve another several millennia of evolution).
// We did not mean to shout.
#ifndef HAS_STRING_VIEW
#if __cplusplus >= 201703
#define HAS_STRING_VIEW 1
#else
#define HAS_STRING_VIEW 0
#endif
#endif // HAS_STRING_VIEW
#include <algorithm>
#include <cassert>
#include <cctype>
#include <chrono>
#include <climits>
#if !(__cplusplus >= 201402)
#include <cmath>
#endif
#include <cstddef>
#include <cstdint>
#include <cstdlib>
#include <ctime>
#include <ios>
#include <istream>
#include <iterator>
#include <limits>
#include <locale>
#include <memory>
#include <ostream>
#include <ratio>
#include <sstream>
#include <stdexcept>
#include <string>
#if HAS_STRING_VIEW
#include <string_view>
#endif
#include <type_traits>
#include <utility>
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wpedantic"
#if __GNUC__ < 5
// GCC 4.9 Bug 61489 Wrong warning with -Wmissing-field-initializers
#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
#endif
#endif
namespace date {
//---------------+
// Configuration |
//---------------+
#ifndef ONLY_C_LOCALE
#define ONLY_C_LOCALE 0
#endif
#if defined(_MSC_VER) && (!defined(__clang__) || (_MSC_VER < 1910))
// MSVC
#define _SILENCE_CXX17_UNCAUGHT_EXCEPTION_DEPRECATION_WARNING
#if _MSC_VER < 1910
// before VS2017
#define CONSTDATA const
#define CONSTCD11
#define CONSTCD14
#define NOEXCEPT _NOEXCEPT
#else
// VS2017 and later
#define CONSTDATA constexpr const
#define CONSTCD11 constexpr
#define CONSTCD14 constexpr
#define NOEXCEPT noexcept
#endif
#elif defined(__SUNPRO_CC) && __SUNPRO_CC <= 0x5150
// Oracle Developer Studio 12.6 and earlier
#define CONSTDATA constexpr const
#define CONSTCD11 constexpr
#define CONSTCD14
#define NOEXCEPT noexcept
#elif __cplusplus >= 201402
// C++14
#define CONSTDATA constexpr const
#define CONSTCD11 constexpr
#define CONSTCD14 constexpr
#define NOEXCEPT noexcept
#else
// C++11
#define CONSTDATA constexpr const
#define CONSTCD11 constexpr
#define CONSTCD14
#define NOEXCEPT noexcept
#endif
#ifndef HAS_VOID_T
#if __cplusplus >= 201703
#define HAS_VOID_T 1
#else
#define HAS_VOID_T 0
#endif
#endif // HAS_VOID_T
// Protect from Oracle sun macro
#ifdef sun
#undef sun
#endif
//-----------+
// Interface |
//-----------+
// durations
using days = std::chrono::duration<
int, std::ratio_multiply<std::ratio<24>, std::chrono::hours::period>>;
using weeks =
std::chrono::duration<int, std::ratio_multiply<std::ratio<7>, days::period>>;
using years =
std::chrono::duration<int,
std::ratio_multiply<std::ratio<146097, 400>, days::period>>;
using months =
std::chrono::duration<int, std::ratio_divide<years::period, std::ratio<12>>>;
// time_point
template <class Duration>
using sys_time = std::chrono::time_point<std::chrono::system_clock, Duration>;
using sys_days = sys_time<days>;
using sys_seconds = sys_time<std::chrono::seconds>;
struct local_t {};
template <class Duration>
using local_time = std::chrono::time_point<local_t, Duration>;
using local_seconds = local_time<std::chrono::seconds>;
using local_days = local_time<days>;
// types
struct last_spec {
last_spec() = default;
};
class day;
class month;
class year;
class weekday;
class weekday_indexed;
class weekday_last;
class month_day;
class month_day_last;
class month_weekday;
class month_weekday_last;
class year_month;
class year_month_day;
class year_month_day_last;
class year_month_weekday;
class year_month_weekday_last;
// date composition operators
CONSTCD11 year_month operator/(const year& y, const month& m) NOEXCEPT;
CONSTCD11 year_month operator/(const year& y, int m) NOEXCEPT;
CONSTCD11 month_day operator/(const day& d, const month& m) NOEXCEPT;
CONSTCD11 month_day operator/(const day& d, int m) NOEXCEPT;
CONSTCD11 month_day operator/(const month& m, const day& d) NOEXCEPT;
CONSTCD11 month_day operator/(const month& m, int d) NOEXCEPT;
CONSTCD11 month_day operator/(int m, const day& d) NOEXCEPT;
CONSTCD11 month_day_last operator/(const month& m, last_spec) NOEXCEPT;
CONSTCD11 month_day_last operator/(int m, last_spec) NOEXCEPT;
CONSTCD11 month_day_last operator/(last_spec, const month& m) NOEXCEPT;
CONSTCD11 month_day_last operator/(last_spec, int m) NOEXCEPT;
CONSTCD11 month_weekday operator/(const month& m, const weekday_indexed& wdi) NOEXCEPT;
CONSTCD11 month_weekday operator/(int m, const weekday_indexed& wdi) NOEXCEPT;
CONSTCD11 month_weekday operator/(const weekday_indexed& wdi, const month& m) NOEXCEPT;
CONSTCD11 month_weekday operator/(const weekday_indexed& wdi, int m) NOEXCEPT;
CONSTCD11 month_weekday_last operator/(const month& m, const weekday_last& wdl) NOEXCEPT;
CONSTCD11 month_weekday_last operator/(int m, const weekday_last& wdl) NOEXCEPT;
CONSTCD11 month_weekday_last operator/(const weekday_last& wdl, const month& m) NOEXCEPT;
CONSTCD11 month_weekday_last operator/(const weekday_last& wdl, int m) NOEXCEPT;
CONSTCD11 year_month_day operator/(const year_month& ym, const day& d) NOEXCEPT;
CONSTCD11 year_month_day operator/(const year_month& ym, int d) NOEXCEPT;
CONSTCD11 year_month_day operator/(const year& y, const month_day& md) NOEXCEPT;
CONSTCD11 year_month_day operator/(int y, const month_day& md) NOEXCEPT;
CONSTCD11 year_month_day operator/(const month_day& md, const year& y) NOEXCEPT;
CONSTCD11 year_month_day operator/(const month_day& md, int y) NOEXCEPT;
CONSTCD11
year_month_day_last operator/(const year_month& ym, last_spec) NOEXCEPT;
CONSTCD11
year_month_day_last operator/(const year& y, const month_day_last& mdl) NOEXCEPT;
CONSTCD11
year_month_day_last operator/(int y, const month_day_last& mdl) NOEXCEPT;
CONSTCD11
year_month_day_last operator/(const month_day_last& mdl, const year& y) NOEXCEPT;
CONSTCD11
year_month_day_last operator/(const month_day_last& mdl, int y) NOEXCEPT;
CONSTCD11
year_month_weekday operator/(const year_month& ym, const weekday_indexed& wdi) NOEXCEPT;
CONSTCD11
year_month_weekday operator/(const year& y, const month_weekday& mwd) NOEXCEPT;
CONSTCD11
year_month_weekday operator/(int y, const month_weekday& mwd) NOEXCEPT;
CONSTCD11
year_month_weekday operator/(const month_weekday& mwd, const year& y) NOEXCEPT;
CONSTCD11
year_month_weekday operator/(const month_weekday& mwd, int y) NOEXCEPT;
CONSTCD11
year_month_weekday_last operator/(const year_month& ym, const weekday_last& wdl) NOEXCEPT;
CONSTCD11
year_month_weekday_last operator/(const year& y, const month_weekday_last& mwdl) NOEXCEPT;
CONSTCD11
year_month_weekday_last operator/(int y, const month_weekday_last& mwdl) NOEXCEPT;
CONSTCD11
year_month_weekday_last operator/(const month_weekday_last& mwdl, const year& y) NOEXCEPT;
CONSTCD11
year_month_weekday_last operator/(const month_weekday_last& mwdl, int y) NOEXCEPT;
// Detailed interface
// day
class day {
unsigned char d_;
public:
day() = default;
explicit CONSTCD11 day(unsigned d) NOEXCEPT;
CONSTCD14 day& operator++() NOEXCEPT;
CONSTCD14 day operator++(int) NOEXCEPT;
CONSTCD14 day& operator--() NOEXCEPT;
CONSTCD14 day operator--(int) NOEXCEPT;
CONSTCD14 day& operator+=(const days& d) NOEXCEPT;
CONSTCD14 day& operator-=(const days& d) NOEXCEPT;
CONSTCD11 explicit operator unsigned() const NOEXCEPT;
CONSTCD11 bool ok() const NOEXCEPT;
};
CONSTCD11 bool operator==(const day& x, const day& y) NOEXCEPT;
CONSTCD11 bool operator!=(const day& x, const day& y) NOEXCEPT;
CONSTCD11 bool operator<(const day& x, const day& y) NOEXCEPT;
CONSTCD11 bool operator>(const day& x, const day& y) NOEXCEPT;
CONSTCD11 bool operator<=(const day& x, const day& y) NOEXCEPT;
CONSTCD11 bool operator>=(const day& x, const day& y) NOEXCEPT;
CONSTCD11 day operator+(const day& x, const days& y) NOEXCEPT;
CONSTCD11 day operator+(const days& x, const day& y) NOEXCEPT;
CONSTCD11 day operator-(const day& x, const days& y) NOEXCEPT;
CONSTCD11 days operator-(const day& x, const day& y) NOEXCEPT;
template <class CharT, class Traits>
std::basic_ostream<CharT, Traits>& operator<<(std::basic_ostream<CharT, Traits>& os,
const day& d);
// month
class month {
unsigned char m_;
public:
month() = default;
explicit CONSTCD11 month(unsigned m) NOEXCEPT;
CONSTCD14 month& operator++() NOEXCEPT;
CONSTCD14 month operator++(int) NOEXCEPT;
CONSTCD14 month& operator--() NOEXCEPT;
CONSTCD14 month operator--(int) NOEXCEPT;
CONSTCD14 month& operator+=(const months& m) NOEXCEPT;
CONSTCD14 month& operator-=(const months& m) NOEXCEPT;
CONSTCD11 explicit operator unsigned() const NOEXCEPT;
CONSTCD11 bool ok() const NOEXCEPT;
};
CONSTCD11 bool operator==(const month& x, const month& y) NOEXCEPT;
CONSTCD11 bool operator!=(const month& x, const month& y) NOEXCEPT;
CONSTCD11 bool operator<(const month& x, const month& y) NOEXCEPT;
CONSTCD11 bool operator>(const month& x, const month& y) NOEXCEPT;
CONSTCD11 bool operator<=(const month& x, const month& y) NOEXCEPT;
CONSTCD11 bool operator>=(const month& x, const month& y) NOEXCEPT;
CONSTCD14 month operator+(const month& x, const months& y) NOEXCEPT;
CONSTCD14 month operator+(const months& x, const month& y) NOEXCEPT;
CONSTCD14 month operator-(const month& x, const months& y) NOEXCEPT;
CONSTCD14 months operator-(const month& x, const month& y) NOEXCEPT;
template <class CharT, class Traits>
std::basic_ostream<CharT, Traits>& operator<<(std::basic_ostream<CharT, Traits>& os,
const month& m);
// year
class year {
int16_t y_;
public:
year() = default;
explicit CONSTCD11 year(int y) NOEXCEPT;
CONSTCD14 year& operator++() NOEXCEPT;
CONSTCD14 year operator++(int) NOEXCEPT;
CONSTCD14 year& operator--() NOEXCEPT;
CONSTCD14 year operator--(int) NOEXCEPT;
CONSTCD14 year& operator+=(const years& y) NOEXCEPT;
CONSTCD14 year& operator-=(const years& y) NOEXCEPT;
CONSTCD11 year operator-() const NOEXCEPT;
CONSTCD11 year operator+() const NOEXCEPT;
CONSTCD11 bool is_leap() const NOEXCEPT;
CONSTCD11 explicit operator int() const NOEXCEPT;
CONSTCD11 bool ok() const NOEXCEPT;
static CONSTCD11 year min() NOEXCEPT;
static CONSTCD11 year max() NOEXCEPT;
};
CONSTCD11 bool operator==(const year& x, const year& y) NOEXCEPT;
CONSTCD11 bool operator!=(const year& x, const year& y) NOEXCEPT;
CONSTCD11 bool operator<(const year& x, const year& y) NOEXCEPT;
CONSTCD11 bool operator>(const year& x, const year& y) NOEXCEPT;
CONSTCD11 bool operator<=(const year& x, const year& y) NOEXCEPT;
CONSTCD11 bool operator>=(const year& x, const year& y) NOEXCEPT;
CONSTCD11 year operator+(const year& x, const years& y) NOEXCEPT;
CONSTCD11 year operator+(const years& x, const year& y) NOEXCEPT;
CONSTCD11 year operator-(const year& x, const years& y) NOEXCEPT;
CONSTCD11 years operator-(const year& x, const year& y) NOEXCEPT;
template <class CharT, class Traits>
std::basic_ostream<CharT, Traits>& operator<<(std::basic_ostream<CharT, Traits>& os,
const year& y);
// weekday
class weekday {
unsigned char wd_;
public:
weekday() = default;
explicit CONSTCD11 weekday(unsigned wd) NOEXCEPT;
CONSTCD11 weekday(const sys_days& dp) NOEXCEPT;
CONSTCD11 explicit weekday(const local_days& dp) NOEXCEPT;
CONSTCD14 weekday& operator++() NOEXCEPT;
CONSTCD14 weekday operator++(int) NOEXCEPT;
CONSTCD14 weekday& operator--() NOEXCEPT;
CONSTCD14 weekday operator--(int) NOEXCEPT;
CONSTCD14 weekday& operator+=(const days& d) NOEXCEPT;
CONSTCD14 weekday& operator-=(const days& d) NOEXCEPT;
CONSTCD11 bool ok() const NOEXCEPT;
CONSTCD11 weekday_indexed operator[](unsigned index) const NOEXCEPT;
CONSTCD11 weekday_last operator[](last_spec) const NOEXCEPT;
private:
static CONSTCD11 unsigned char weekday_from_days(int z) NOEXCEPT;
friend CONSTCD11 bool operator==(const weekday& x, const weekday& y) NOEXCEPT;
friend CONSTCD14 days operator-(const weekday& x, const weekday& y) NOEXCEPT;
friend CONSTCD14 weekday operator+(const weekday& x, const days& y) NOEXCEPT;
template <class CharT, class Traits>
friend std::basic_ostream<CharT, Traits>& operator<<(
std::basic_ostream<CharT, Traits>& os, const weekday& wd);
friend class weekday_indexed;
};
CONSTCD11 bool operator==(const weekday& x, const weekday& y) NOEXCEPT;
CONSTCD11 bool operator!=(const weekday& x, const weekday& y) NOEXCEPT;
CONSTCD14 weekday operator+(const weekday& x, const days& y) NOEXCEPT;
CONSTCD14 weekday operator+(const days& x, const weekday& y) NOEXCEPT;
CONSTCD14 weekday operator-(const weekday& x, const days& y) NOEXCEPT;
CONSTCD14 days operator-(const weekday& x, const weekday& y) NOEXCEPT;
template <class CharT, class Traits>
std::basic_ostream<CharT, Traits>& operator<<(std::basic_ostream<CharT, Traits>& os,
const weekday& wd);
// weekday_indexed
class weekday_indexed {
unsigned char wd_ : 4;
unsigned char index_ : 4;
public:
weekday_indexed() = default;
CONSTCD11 weekday_indexed(const date::weekday& wd, unsigned index) NOEXCEPT;
CONSTCD11 date::weekday weekday() const NOEXCEPT;
CONSTCD11 unsigned index() const NOEXCEPT;
CONSTCD11 bool ok() const NOEXCEPT;
};
CONSTCD11 bool operator==(const weekday_indexed& x, const weekday_indexed& y) NOEXCEPT;
CONSTCD11 bool operator!=(const weekday_indexed& x, const weekday_indexed& y) NOEXCEPT;
template <class CharT, class Traits>
std::basic_ostream<CharT, Traits>& operator<<(std::basic_ostream<CharT, Traits>& os,
const weekday_indexed& wdi);
// weekday_last
class weekday_last {
date::weekday wd_;
public:
explicit CONSTCD11 weekday_last(const date::weekday& wd) NOEXCEPT;
CONSTCD11 date::weekday weekday() const NOEXCEPT;
CONSTCD11 bool ok() const NOEXCEPT;
};
CONSTCD11 bool operator==(const weekday_last& x, const weekday_last& y) NOEXCEPT;
CONSTCD11 bool operator!=(const weekday_last& x, const weekday_last& y) NOEXCEPT;
template <class CharT, class Traits>
std::basic_ostream<CharT, Traits>& operator<<(std::basic_ostream<CharT, Traits>& os,
const weekday_last& wdl);
namespace detail {
struct unspecified_month_disambiguator {};
} // namespace detail
// year_month
class year_month {
date::year y_;
date::month m_;
public:
year_month() = default;
CONSTCD11 year_month(const date::year& y, const date::month& m) NOEXCEPT;
CONSTCD11 date::year year() const NOEXCEPT;
CONSTCD11 date::month month() const NOEXCEPT;
template <class = detail::unspecified_month_disambiguator>
CONSTCD14 year_month& operator+=(const months& dm) NOEXCEPT;
template <class = detail::unspecified_month_disambiguator>
CONSTCD14 year_month& operator-=(const months& dm) NOEXCEPT;
CONSTCD14 year_month& operator+=(const years& dy) NOEXCEPT;
CONSTCD14 year_month& operator-=(const years& dy) NOEXCEPT;
CONSTCD11 bool ok() const NOEXCEPT;
};
CONSTCD11 bool operator==(const year_month& x, const year_month& y) NOEXCEPT;
CONSTCD11 bool operator!=(const year_month& x, const year_month& y) NOEXCEPT;
CONSTCD11 bool operator<(const year_month& x, const year_month& y) NOEXCEPT;
CONSTCD11 bool operator>(const year_month& x, const year_month& y) NOEXCEPT;
CONSTCD11 bool operator<=(const year_month& x, const year_month& y) NOEXCEPT;
CONSTCD11 bool operator>=(const year_month& x, const year_month& y) NOEXCEPT;
template <class = detail::unspecified_month_disambiguator>
CONSTCD14 year_month operator+(const year_month& ym, const months& dm) NOEXCEPT;
template <class = detail::unspecified_month_disambiguator>
CONSTCD14 year_month operator+(const months& dm, const year_month& ym) NOEXCEPT;
template <class = detail::unspecified_month_disambiguator>
CONSTCD14 year_month operator-(const year_month& ym, const months& dm) NOEXCEPT;
CONSTCD11 months operator-(const year_month& x, const year_month& y) NOEXCEPT;
CONSTCD11 year_month operator+(const year_month& ym, const years& dy) NOEXCEPT;
CONSTCD11 year_month operator+(const years& dy, const year_month& ym) NOEXCEPT;
CONSTCD11 year_month operator-(const year_month& ym, const years& dy) NOEXCEPT;
template <class CharT, class Traits>
std::basic_ostream<CharT, Traits>& operator<<(std::basic_ostream<CharT, Traits>& os,
const year_month& ym);
// month_day
class month_day {
date::month m_;
date::day d_;
public:
month_day() = default;
CONSTCD11 month_day(const date::month& m, const date::day& d) NOEXCEPT;
CONSTCD11 date::month month() const NOEXCEPT;
CONSTCD11 date::day day() const NOEXCEPT;
CONSTCD14 bool ok() const NOEXCEPT;
};
CONSTCD11 bool operator==(const month_day& x, const month_day& y) NOEXCEPT;
CONSTCD11 bool operator!=(const month_day& x, const month_day& y) NOEXCEPT;
CONSTCD11 bool operator<(const month_day& x, const month_day& y) NOEXCEPT;
CONSTCD11 bool operator>(const month_day& x, const month_day& y) NOEXCEPT;
CONSTCD11 bool operator<=(const month_day& x, const month_day& y) NOEXCEPT;
CONSTCD11 bool operator>=(const month_day& x, const month_day& y) NOEXCEPT;
template <class CharT, class Traits>
std::basic_ostream<CharT, Traits>& operator<<(std::basic_ostream<CharT, Traits>& os,
const month_day& md);
// month_day_last
class month_day_last {
date::month m_;
public:
CONSTCD11 explicit month_day_last(const date::month& m) NOEXCEPT;
CONSTCD11 date::month month() const NOEXCEPT;
CONSTCD11 bool ok() const NOEXCEPT;
};
CONSTCD11 bool operator==(const month_day_last& x, const month_day_last& y) NOEXCEPT;
CONSTCD11 bool operator!=(const month_day_last& x, const month_day_last& y) NOEXCEPT;
CONSTCD11 bool operator<(const month_day_last& x, const month_day_last& y) NOEXCEPT;
CONSTCD11 bool operator>(const month_day_last& x, const month_day_last& y) NOEXCEPT;
CONSTCD11 bool operator<=(const month_day_last& x, const month_day_last& y) NOEXCEPT;
CONSTCD11 bool operator>=(const month_day_last& x, const month_day_last& y) NOEXCEPT;
template <class CharT, class Traits>
std::basic_ostream<CharT, Traits>& operator<<(std::basic_ostream<CharT, Traits>& os,
const month_day_last& mdl);
// month_weekday
class month_weekday {
date::month m_;
date::weekday_indexed wdi_;
public:
CONSTCD11 month_weekday(const date::month& m,
const date::weekday_indexed& wdi) NOEXCEPT;
CONSTCD11 date::month month() const NOEXCEPT;
CONSTCD11 date::weekday_indexed weekday_indexed() const NOEXCEPT;
CONSTCD11 bool ok() const NOEXCEPT;
};
CONSTCD11 bool operator==(const month_weekday& x, const month_weekday& y) NOEXCEPT;
CONSTCD11 bool operator!=(const month_weekday& x, const month_weekday& y) NOEXCEPT;
template <class CharT, class Traits>
std::basic_ostream<CharT, Traits>& operator<<(std::basic_ostream<CharT, Traits>& os,
const month_weekday& mwd);
// month_weekday_last
class month_weekday_last {
date::month m_;
date::weekday_last wdl_;
public:
CONSTCD11 month_weekday_last(const date::month& m,
const date::weekday_last& wd) NOEXCEPT;
CONSTCD11 date::month month() const NOEXCEPT;
CONSTCD11 date::weekday_last weekday_last() const NOEXCEPT;
CONSTCD11 bool ok() const NOEXCEPT;
};
CONSTCD11
bool operator==(const month_weekday_last& x, const month_weekday_last& y) NOEXCEPT;
CONSTCD11
bool operator!=(const month_weekday_last& x, const month_weekday_last& y) NOEXCEPT;
template <class CharT, class Traits>
std::basic_ostream<CharT, Traits>& operator<<(std::basic_ostream<CharT, Traits>& os,
const month_weekday_last& mwdl);
// class year_month_day
class year_month_day {
date::year y_;
date::month m_;
date::day d_;
public:
year_month_day() = default;
CONSTCD11 year_month_day(const date::year& y, const date::month& m,
const date::day& d) NOEXCEPT;
CONSTCD14 year_month_day(const year_month_day_last& ymdl) NOEXCEPT;
CONSTCD14 year_month_day(sys_days dp) NOEXCEPT;
CONSTCD14 explicit year_month_day(local_days dp) NOEXCEPT;
template <class = detail::unspecified_month_disambiguator>
CONSTCD14 year_month_day& operator+=(const months& m) NOEXCEPT;
template <class = detail::unspecified_month_disambiguator>
CONSTCD14 year_month_day& operator-=(const months& m) NOEXCEPT;
CONSTCD14 year_month_day& operator+=(const years& y) NOEXCEPT;
CONSTCD14 year_month_day& operator-=(const years& y) NOEXCEPT;
CONSTCD11 date::year year() const NOEXCEPT;
CONSTCD11 date::month month() const NOEXCEPT;
CONSTCD11 date::day day() const NOEXCEPT;
CONSTCD14 operator sys_days() const NOEXCEPT;
CONSTCD14 explicit operator local_days() const NOEXCEPT;
CONSTCD14 bool ok() const NOEXCEPT;
private:
static CONSTCD14 year_month_day from_days(days dp) NOEXCEPT;
CONSTCD14 days to_days() const NOEXCEPT;
};
CONSTCD11 bool operator==(const year_month_day& x, const year_month_day& y) NOEXCEPT;
CONSTCD11 bool operator!=(const year_month_day& x, const year_month_day& y) NOEXCEPT;
CONSTCD11 bool operator<(const year_month_day& x, const year_month_day& y) NOEXCEPT;
CONSTCD11 bool operator>(const year_month_day& x, const year_month_day& y) NOEXCEPT;
CONSTCD11 bool operator<=(const year_month_day& x, const year_month_day& y) NOEXCEPT;
CONSTCD11 bool operator>=(const year_month_day& x, const year_month_day& y) NOEXCEPT;
template <class = detail::unspecified_month_disambiguator>
CONSTCD14 year_month_day operator+(const year_month_day& ymd, const months& dm) NOEXCEPT;
template <class = detail::unspecified_month_disambiguator>
CONSTCD14 year_month_day operator+(const months& dm, const year_month_day& ymd) NOEXCEPT;
template <class = detail::unspecified_month_disambiguator>
CONSTCD14 year_month_day operator-(const year_month_day& ymd, const months& dm) NOEXCEPT;
CONSTCD11 year_month_day operator+(const year_month_day& ymd, const years& dy) NOEXCEPT;
CONSTCD11 year_month_day operator+(const years& dy, const year_month_day& ymd) NOEXCEPT;
CONSTCD11 year_month_day operator-(const year_month_day& ymd, const years& dy) NOEXCEPT;
template <class CharT, class Traits>
std::basic_ostream<CharT, Traits>& operator<<(std::basic_ostream<CharT, Traits>& os,
const year_month_day& ymd);
// year_month_day_last
class year_month_day_last {
date::year y_;
date::month_day_last mdl_;
public:
CONSTCD11 year_month_day_last(const date::year& y,
const date::month_day_last& mdl) NOEXCEPT;
template <class = detail::unspecified_month_disambiguator>
CONSTCD14 year_month_day_last& operator+=(const months& m) NOEXCEPT;
template <class = detail::unspecified_month_disambiguator>
CONSTCD14 year_month_day_last& operator-=(const months& m) NOEXCEPT;
CONSTCD14 year_month_day_last& operator+=(const years& y) NOEXCEPT;
CONSTCD14 year_month_day_last& operator-=(const years& y) NOEXCEPT;
CONSTCD11 date::year year() const NOEXCEPT;
CONSTCD11 date::month month() const NOEXCEPT;
CONSTCD11 date::month_day_last month_day_last() const NOEXCEPT;
CONSTCD14 date::day day() const NOEXCEPT;
CONSTCD14 operator sys_days() const NOEXCEPT;
CONSTCD14 explicit operator local_days() const NOEXCEPT;
CONSTCD11 bool ok() const NOEXCEPT;
};
CONSTCD11
bool operator==(const year_month_day_last& x, const year_month_day_last& y) NOEXCEPT;
CONSTCD11
bool operator!=(const year_month_day_last& x, const year_month_day_last& y) NOEXCEPT;
CONSTCD11
bool operator<(const year_month_day_last& x, const year_month_day_last& y) NOEXCEPT;
CONSTCD11
bool operator>(const year_month_day_last& x, const year_month_day_last& y) NOEXCEPT;
CONSTCD11
bool operator<=(const year_month_day_last& x, const year_month_day_last& y) NOEXCEPT;
CONSTCD11
bool operator>=(const year_month_day_last& x, const year_month_day_last& y) NOEXCEPT;
template <class = detail::unspecified_month_disambiguator>
CONSTCD14 year_month_day_last operator+(const year_month_day_last& ymdl,
const months& dm) NOEXCEPT;
template <class = detail::unspecified_month_disambiguator>
CONSTCD14 year_month_day_last operator+(const months& dm,
const year_month_day_last& ymdl) NOEXCEPT;
CONSTCD11
year_month_day_last operator+(const year_month_day_last& ymdl, const years& dy) NOEXCEPT;
CONSTCD11
year_month_day_last operator+(const years& dy, const year_month_day_last& ymdl) NOEXCEPT;
template <class = detail::unspecified_month_disambiguator>
CONSTCD14 year_month_day_last operator-(const year_month_day_last& ymdl,
const months& dm) NOEXCEPT;
CONSTCD11
year_month_day_last operator-(const year_month_day_last& ymdl, const years& dy) NOEXCEPT;
template <class CharT, class Traits>
std::basic_ostream<CharT, Traits>& operator<<(std::basic_ostream<CharT, Traits>& os,
const year_month_day_last& ymdl);
// year_month_weekday
class year_month_weekday {
date::year y_;
date::month m_;
date::weekday_indexed wdi_;
public:
year_month_weekday() = default;
CONSTCD11 year_month_weekday(const date::year& y, const date::month& m,
const date::weekday_indexed& wdi) NOEXCEPT;
CONSTCD14 year_month_weekday(const sys_days& dp) NOEXCEPT;
CONSTCD14 explicit year_month_weekday(const local_days& dp) NOEXCEPT;
template <class = detail::unspecified_month_disambiguator>
CONSTCD14 year_month_weekday& operator+=(const months& m) NOEXCEPT;
template <class = detail::unspecified_month_disambiguator>
CONSTCD14 year_month_weekday& operator-=(const months& m) NOEXCEPT;
CONSTCD14 year_month_weekday& operator+=(const years& y) NOEXCEPT;
CONSTCD14 year_month_weekday& operator-=(const years& y) NOEXCEPT;
CONSTCD11 date::year year() const NOEXCEPT;
CONSTCD11 date::month month() const NOEXCEPT;
CONSTCD11 date::weekday weekday() const NOEXCEPT;
CONSTCD11 unsigned index() const NOEXCEPT;
CONSTCD11 date::weekday_indexed weekday_indexed() const NOEXCEPT;
CONSTCD14 operator sys_days() const NOEXCEPT;
CONSTCD14 explicit operator local_days() const NOEXCEPT;
CONSTCD14 bool ok() const NOEXCEPT;
private:
static CONSTCD14 year_month_weekday from_days(days dp) NOEXCEPT;
CONSTCD14 days to_days() const NOEXCEPT;
};
CONSTCD11
bool operator==(const year_month_weekday& x, const year_month_weekday& y) NOEXCEPT;
CONSTCD11
bool operator!=(const year_month_weekday& x, const year_month_weekday& y) NOEXCEPT;
template <class = detail::unspecified_month_disambiguator>
CONSTCD14 year_month_weekday operator+(const year_month_weekday& ymwd,
const months& dm) NOEXCEPT;
template <class = detail::unspecified_month_disambiguator>
CONSTCD14 year_month_weekday operator+(const months& dm,
const year_month_weekday& ymwd) NOEXCEPT;
CONSTCD11
year_month_weekday operator+(const year_month_weekday& ymwd, const years& dy) NOEXCEPT;
CONSTCD11
year_month_weekday operator+(const years& dy, const year_month_weekday& ymwd) NOEXCEPT;
template <class = detail::unspecified_month_disambiguator>
CONSTCD14 year_month_weekday operator-(const year_month_weekday& ymwd,
const months& dm) NOEXCEPT;
CONSTCD11
year_month_weekday operator-(const year_month_weekday& ymwd, const years& dy) NOEXCEPT;
template <class CharT, class Traits>
std::basic_ostream<CharT, Traits>& operator<<(std::basic_ostream<CharT, Traits>& os,
const year_month_weekday& ymwdi);
// year_month_weekday_last
class year_month_weekday_last {
date::year y_;
date::month m_;
date::weekday_last wdl_;
public:
CONSTCD11 year_month_weekday_last(const date::year& y, const date::month& m,
const date::weekday_last& wdl) NOEXCEPT;
template <class = detail::unspecified_month_disambiguator>
CONSTCD14 year_month_weekday_last& operator+=(const months& m) NOEXCEPT;
template <class = detail::unspecified_month_disambiguator>
CONSTCD14 year_month_weekday_last& operator-=(const months& m) NOEXCEPT;
CONSTCD14 year_month_weekday_last& operator+=(const years& y) NOEXCEPT;
CONSTCD14 year_month_weekday_last& operator-=(const years& y) NOEXCEPT;
CONSTCD11 date::year year() const NOEXCEPT;
CONSTCD11 date::month month() const NOEXCEPT;
CONSTCD11 date::weekday weekday() const NOEXCEPT;
CONSTCD11 date::weekday_last weekday_last() const NOEXCEPT;
CONSTCD14 operator sys_days() const NOEXCEPT;
CONSTCD14 explicit operator local_days() const NOEXCEPT;
CONSTCD11 bool ok() const NOEXCEPT;
private:
CONSTCD14 days to_days() const NOEXCEPT;
};
CONSTCD11
bool operator==(const year_month_weekday_last& x,
const year_month_weekday_last& y) NOEXCEPT;
CONSTCD11
bool operator!=(const year_month_weekday_last& x,
const year_month_weekday_last& y) NOEXCEPT;
template <class = detail::unspecified_month_disambiguator>
CONSTCD14 year_month_weekday_last operator+(const year_month_weekday_last& ymwdl,
const months& dm) NOEXCEPT;
template <class = detail::unspecified_month_disambiguator>
CONSTCD14 year_month_weekday_last
operator+(const months& dm, const year_month_weekday_last& ymwdl) NOEXCEPT;
CONSTCD11
year_month_weekday_last operator+(const year_month_weekday_last& ymwdl,
const years& dy) NOEXCEPT;
CONSTCD11
year_month_weekday_last operator+(const years& dy,
const year_month_weekday_last& ymwdl) NOEXCEPT;
template <class = detail::unspecified_month_disambiguator>
CONSTCD14 year_month_weekday_last operator-(const year_month_weekday_last& ymwdl,
const months& dm) NOEXCEPT;
CONSTCD11
year_month_weekday_last operator-(const year_month_weekday_last& ymwdl,
const years& dy) NOEXCEPT;
template <class CharT, class Traits>
std::basic_ostream<CharT, Traits>& operator<<(std::basic_ostream<CharT, Traits>& os,
const year_month_weekday_last& ymwdl);
#if !defined(_MSC_VER) || (_MSC_VER >= 1900)
inline namespace literals {
CONSTCD11 date::day operator"" _d(unsigned long long d) NOEXCEPT;
CONSTCD11 date::year operator"" _y(unsigned long long y) NOEXCEPT;
} // namespace literals
#endif // !defined(_MSC_VER) || (_MSC_VER >= 1900)
// CONSTDATA date::month January{1};
// CONSTDATA date::month February{2};
// CONSTDATA date::month March{3};
// CONSTDATA date::month April{4};
// CONSTDATA date::month May{5};
// CONSTDATA date::month June{6};
// CONSTDATA date::month July{7};
// CONSTDATA date::month August{8};
// CONSTDATA date::month September{9};
// CONSTDATA date::month October{10};
// CONSTDATA date::month November{11};
// CONSTDATA date::month December{12};
//
// CONSTDATA date::weekday Sunday{0u};
// CONSTDATA date::weekday Monday{1u};
// CONSTDATA date::weekday Tuesday{2u};
// CONSTDATA date::weekday Wednesday{3u};
// CONSTDATA date::weekday Thursday{4u};
// CONSTDATA date::weekday Friday{5u};
// CONSTDATA date::weekday Saturday{6u};
#if HAS_VOID_T
template <class T, class = std::void_t<>>
struct is_clock : std::false_type {};
template <class T>
struct is_clock<
T, std::void_t<decltype(T::now()), typename T::rep, typename T::period,
typename T::duration, typename T::time_point, decltype(T::is_steady)>>
: std::true_type {};
#endif // HAS_VOID_T
//----------------+
// Implementation |
//----------------+
// utilities
namespace detail {
template <class CharT, class Traits = std::char_traits<CharT>>
class save_istream {
protected:
std::basic_ios<CharT, Traits>& is_;
CharT fill_;
std::ios::fmtflags flags_;
std::streamsize width_;
std::basic_ostream<CharT, Traits>* tie_;
std::locale loc_;
public:
~save_istream() {
is_.fill(fill_);
is_.flags(flags_);
is_.width(width_);
is_.imbue(loc_);
is_.tie(tie_);
}
save_istream(const save_istream&) = delete;
save_istream& operator=(const save_istream&) = delete;
explicit save_istream(std::basic_ios<CharT, Traits>& is)
: is_(is),
fill_(is.fill()),
flags_(is.flags()),
width_(is.width(0)),
tie_(is.tie(nullptr)),
loc_(is.getloc()) {
if (tie_ != nullptr) tie_->flush();
}
};
template <class CharT, class Traits = std::char_traits<CharT>>
class save_ostream : private save_istream<CharT, Traits> {
public:
~save_ostream() {
if ((this->flags_ & std::ios::unitbuf) &&
#if __cplusplus >= 201703
std::uncaught_exceptions() == 0 &&
#else
!std::uncaught_exception() &&
#endif
this->is_.good())
this->is_.rdbuf()->pubsync();
}
save_ostream(const save_ostream&) = delete;
save_ostream& operator=(const save_ostream&) = delete;
explicit save_ostream(std::basic_ios<CharT, Traits>& os)
: save_istream<CharT, Traits>(os) {}
};
template <class T>
struct choose_trunc_type {
static const int digits = std::numeric_limits<T>::digits;
using type = typename std::conditional < digits < 32, std::int32_t,
typename std::conditional<digits<64, std::int64_t,
#ifdef __SIZEOF_INT128__
__int128
#else
std::int64_t
#endif
>::type>::type;
};
template <class T>
CONSTCD11 inline
typename std::enable_if<!std::chrono::treat_as_floating_point<T>::value, T>::type
trunc(T t) NOEXCEPT {
return t;
}
template <class T>
CONSTCD14 inline
typename std::enable_if<std::chrono::treat_as_floating_point<T>::value, T>::type
trunc(T t) NOEXCEPT {
using std::numeric_limits;
using I = typename choose_trunc_type<T>::type;
CONSTDATA auto digits = numeric_limits<T>::digits;
static_assert(digits < numeric_limits<I>::digits, "");
CONSTDATA auto max = I{1} << (digits - 1);
CONSTDATA auto min = -max;
const auto negative = t < T{0};
if (min <= t && t <= max && t != 0 && t == t) {
t = static_cast<T>(static_cast<I>(t));
if (t == 0 && negative) t = -t;
}
return t;
}
template <std::intmax_t Xp, std::intmax_t Yp>
struct static_gcd {
static const std::intmax_t value = static_gcd<Yp, Xp % Yp>::value;
};
template <std::intmax_t Xp>
struct static_gcd<Xp, 0> {
static const std::intmax_t value = Xp;
};
template <>
struct static_gcd<0, 0> {
static const std::intmax_t value = 1;
};
template <class R1, class R2>
struct no_overflow {
private:
static const std::intmax_t gcd_n1_n2 = static_gcd<R1::num, R2::num>::value;
static const std::intmax_t gcd_d1_d2 = static_gcd<R1::den, R2::den>::value;
static const std::intmax_t n1 = R1::num / gcd_n1_n2;
static const std::intmax_t d1 = R1::den / gcd_d1_d2;
static const std::intmax_t n2 = R2::num / gcd_n1_n2;
static const std::intmax_t d2 = R2::den / gcd_d1_d2;
static const std::intmax_t max =
-((std::intmax_t(1) << (sizeof(std::intmax_t) * CHAR_BIT - 1)) + 1);
template <std::intmax_t Xp, std::intmax_t Yp, bool overflow>
struct mul { // overflow == false
static const std::intmax_t value = Xp * Yp;
};
template <std::intmax_t Xp, std::intmax_t Yp>
struct mul<Xp, Yp, true> {
static const std::intmax_t value = 1;
};
public:
static const bool value = (n1 <= max / d2) && (n2 <= max / d1);
typedef std::ratio<mul<n1, d2, !value>::value, mul<n2, d1, !value>::value> type;
};
} // namespace detail
// trunc towards zero
template <class To, class Rep, class Period>
CONSTCD11 inline
typename std::enable_if<detail::no_overflow<Period, typename To::period>::value,
To>::type
trunc(const std::chrono::duration<Rep, Period>& d) {
return To{detail::trunc(std::chrono::duration_cast<To>(d).count())};
}
template <class To, class Rep, class Period>
CONSTCD11 inline
typename std::enable_if<!detail::no_overflow<Period, typename To::period>::value,
To>::type
trunc(const std::chrono::duration<Rep, Period>& d) {
using std::chrono::duration;
using std::chrono::duration_cast;
using rep = typename std::common_type<Rep, typename To::rep>::type;
return To{detail::trunc(duration_cast<To>(duration_cast<duration<rep>>(d)).count())};
}
#ifndef HAS_CHRONO_ROUNDING
#if defined(_MSC_FULL_VER) && \
(_MSC_FULL_VER >= 190023918 || (_MSC_FULL_VER >= 190000000 && defined(__clang__)))
#define HAS_CHRONO_ROUNDING 1
#elif defined(__cpp_lib_chrono) && __cplusplus > 201402 && __cpp_lib_chrono >= 201510
#define HAS_CHRONO_ROUNDING 1
#elif defined(_LIBCPP_VERSION) && __cplusplus > 201402 && _LIBCPP_VERSION >= 3800
#define HAS_CHRONO_ROUNDING 1
#else
#define HAS_CHRONO_ROUNDING 0
#endif
#endif // HAS_CHRONO_ROUNDING
#if HAS_CHRONO_ROUNDING == 0
// round down
template <class To, class Rep, class Period>
CONSTCD14 inline
typename std::enable_if<detail::no_overflow<Period, typename To::period>::value,
To>::type
floor(const std::chrono::duration<Rep, Period>& d) {
auto t = trunc<To>(d);
if (t > d) return t - To{1};
return t;
}
template <class To, class Rep, class Period>
CONSTCD14 inline
typename std::enable_if<!detail::no_overflow<Period, typename To::period>::value,
To>::type
floor(const std::chrono::duration<Rep, Period>& d) {
using std::chrono::duration;
using rep = typename std::common_type<Rep, typename To::rep>::type;
return floor<To>(floor<duration<rep>>(d));
}
// round to nearest, to even on tie
template <class To, class Rep, class Period>
CONSTCD14 inline To round(const std::chrono::duration<Rep, Period>& d) {
auto t0 = floor<To>(d);
auto t1 = t0 + To{1};
if (t1 == To{0} && t0 < To{0}) t1 = -t1;
auto diff0 = d - t0;
auto diff1 = t1 - d;
if (diff0 == diff1) {
if (t0 - trunc<To>(t0 / 2) * 2 == To{0}) return t0;
return t1;
}
if (diff0 < diff1) return t0;
return t1;
}
// round up
template <class To, class Rep, class Period>
CONSTCD14 inline To ceil(const std::chrono::duration<Rep, Period>& d) {
auto t = trunc<To>(d);
if (t < d) return t + To{1};
return t;
}
template <class Rep, class Period,
class = typename std::enable_if<std::numeric_limits<Rep>::is_signed>::type>
CONSTCD11 std::chrono::duration<Rep, Period> abs(std::chrono::duration<Rep, Period> d) {
return d >= d.zero() ? d : -d;
}
// round down
template <class To, class Clock, class FromDuration>
CONSTCD11 inline std::chrono::time_point<Clock, To> floor(
const std::chrono::time_point<Clock, FromDuration>& tp) {
using std::chrono::time_point;
return time_point<Clock, To>{date::floor<To>(tp.time_since_epoch())};
}
// round to nearest, to even on tie
template <class To, class Clock, class FromDuration>
CONSTCD11 inline std::chrono::time_point<Clock, To> round(
const std::chrono::time_point<Clock, FromDuration>& tp) {
using std::chrono::time_point;
return time_point<Clock, To>{round<To>(tp.time_since_epoch())};
}
// round up
template <class To, class Clock, class FromDuration>
CONSTCD11 inline std::chrono::time_point<Clock, To> ceil(
const std::chrono::time_point<Clock, FromDuration>& tp) {
using std::chrono::time_point;
return time_point<Clock, To>{ceil<To>(tp.time_since_epoch())};
}
#else // HAS_CHRONO_ROUNDING == 1
using std::chrono::abs;
using std::chrono::ceil;
using std::chrono::floor;
using std::chrono::round;
#endif // HAS_CHRONO_ROUNDING
// trunc towards zero
template <class To, class Clock, class FromDuration>
CONSTCD11 inline std::chrono::time_point<Clock, To> trunc(
const std::chrono::time_point<Clock, FromDuration>& tp) {
using std::chrono::time_point;
return time_point<Clock, To>{trunc<To>(tp.time_since_epoch())};
}
// day
CONSTCD11 inline day::day(unsigned d) NOEXCEPT : d_(static_cast<unsigned char>(d)) {}
CONSTCD14 inline day& day::operator++() NOEXCEPT {
++d_;
return *this;
}
CONSTCD14 inline day day:: operator++(int) NOEXCEPT {
auto tmp(*this);
++(*this);
return tmp;
}
CONSTCD14 inline day& day::operator--() NOEXCEPT {
--d_;
return *this;
}
CONSTCD14 inline day day:: operator--(int) NOEXCEPT {
auto tmp(*this);
--(*this);
return tmp;
}
CONSTCD14 inline day& day::operator+=(const days& d) NOEXCEPT {
*this = *this + d;
return *this;
}
CONSTCD14 inline day& day::operator-=(const days& d) NOEXCEPT {
*this = *this - d;
return *this;
}
CONSTCD11 inline day::operator unsigned() const NOEXCEPT { return d_; }
CONSTCD11 inline bool day::ok() const NOEXCEPT { return 1 <= d_ && d_ <= 31; }
CONSTCD11
inline bool operator==(const day& x, const day& y) NOEXCEPT {
return static_cast<unsigned>(x) == static_cast<unsigned>(y);
}
CONSTCD11
inline bool operator!=(const day& x, const day& y) NOEXCEPT { return !(x == y); }
CONSTCD11
inline bool operator<(const day& x, const day& y) NOEXCEPT {
return static_cast<unsigned>(x) < static_cast<unsigned>(y);
}
CONSTCD11
inline bool operator>(const day& x, const day& y) NOEXCEPT { return y < x; }
CONSTCD11
inline bool operator<=(const day& x, const day& y) NOEXCEPT { return !(y < x); }
CONSTCD11
inline bool operator>=(const day& x, const day& y) NOEXCEPT { return !(x < y); }
CONSTCD11
inline days operator-(const day& x, const day& y) NOEXCEPT {
return days{
static_cast<days::rep>(static_cast<unsigned>(x) - static_cast<unsigned>(y))};
}
CONSTCD11
inline day operator+(const day& x, const days& y) NOEXCEPT {
return day{static_cast<unsigned>(x) + static_cast<unsigned>(y.count())};
}
CONSTCD11
inline day operator+(const days& x, const day& y) NOEXCEPT { return y + x; }
CONSTCD11
inline day operator-(const day& x, const days& y) NOEXCEPT { return x + -y; }
template <class CharT, class Traits>
inline std::basic_ostream<CharT, Traits>& operator<<(
std::basic_ostream<CharT, Traits>& os, const day& d) {
detail::save_ostream<CharT, Traits> _(os);
os.fill('0');
os.flags(std::ios::dec | std::ios::right);
os.width(2);
os << static_cast<unsigned>(d);
if (!d.ok()) os << " is not a valid day";
return os;
}
// month
CONSTCD11 inline month::month(unsigned m) NOEXCEPT : m_(static_cast<decltype(m_)>(m)) {}
CONSTCD14 inline month& month::operator++() NOEXCEPT {
*this += months{1};
return *this;
}
CONSTCD14 inline month month:: operator++(int) NOEXCEPT {
auto tmp(*this);
++(*this);
return tmp;
}
CONSTCD14 inline month& month::operator--() NOEXCEPT {
*this -= months{1};
return *this;
}
CONSTCD14 inline month month:: operator--(int) NOEXCEPT {
auto tmp(*this);
--(*this);
return tmp;
}
CONSTCD14
inline month& month::operator+=(const months& m) NOEXCEPT {
*this = *this + m;
return *this;
}
CONSTCD14
inline month& month::operator-=(const months& m) NOEXCEPT {
*this = *this - m;
return *this;
}
CONSTCD11 inline month::operator unsigned() const NOEXCEPT { return m_; }
CONSTCD11 inline bool month::ok() const NOEXCEPT { return 1 <= m_ && m_ <= 12; }
CONSTCD11
inline bool operator==(const month& x, const month& y) NOEXCEPT {
return static_cast<unsigned>(x) == static_cast<unsigned>(y);
}
CONSTCD11
inline bool operator!=(const month& x, const month& y) NOEXCEPT { return !(x == y); }
CONSTCD11
inline bool operator<(const month& x, const month& y) NOEXCEPT {
return static_cast<unsigned>(x) < static_cast<unsigned>(y);
}
CONSTCD11
inline bool operator>(const month& x, const month& y) NOEXCEPT { return y < x; }
CONSTCD11
inline bool operator<=(const month& x, const month& y) NOEXCEPT { return !(y < x); }
CONSTCD11
inline bool operator>=(const month& x, const month& y) NOEXCEPT { return !(x < y); }
CONSTCD14
inline months operator-(const month& x, const month& y) NOEXCEPT {
auto const d = static_cast<unsigned>(x) - static_cast<unsigned>(y);
return months(d <= 11 ? d : d + 12);
}
CONSTCD14
inline month operator+(const month& x, const months& y) NOEXCEPT {
auto const mu = static_cast<int64_t>(static_cast<unsigned>(x)) + (y.count() - 1);
auto const yr = (mu >= 0 ? mu : mu - 11) / 12;
return month{static_cast<unsigned>(mu - yr * 12 + 1)};
}
CONSTCD14
inline month operator+(const months& x, const month& y) NOEXCEPT { return y + x; }
CONSTCD14
inline month operator-(const month& x, const months& y) NOEXCEPT { return x + -y; }
template <class CharT, class Traits>
inline std::basic_ostream<CharT, Traits>& operator<<(
std::basic_ostream<CharT, Traits>& os, const month& m) {
if (m.ok()) {
CharT fmt[] = {'%', 'b', 0};
os << format(os.getloc(), fmt, m);
} else {
os << static_cast<unsigned>(m) << " is not a valid month";
}
return os;
}
// year
CONSTCD11 inline year::year(int y) NOEXCEPT : y_(static_cast<decltype(y_)>(y)) {}
CONSTCD14 inline year& year::operator++() NOEXCEPT {
++y_;
return *this;
}
CONSTCD14 inline year year:: operator++(int) NOEXCEPT {
auto tmp(*this);
++(*this);
return tmp;
}
CONSTCD14 inline year& year::operator--() NOEXCEPT {
--y_;
return *this;
}
CONSTCD14 inline year year:: operator--(int) NOEXCEPT {
auto tmp(*this);
--(*this);
return tmp;
}
CONSTCD14 inline year& year::operator+=(const years& y) NOEXCEPT {
*this = *this + y;
return *this;
}
CONSTCD14 inline year& year::operator-=(const years& y) NOEXCEPT {
*this = *this - y;
return *this;
}
CONSTCD11 inline year year::operator-() const NOEXCEPT { return year{-y_}; }
CONSTCD11 inline year year::operator+() const NOEXCEPT { return *this; }
CONSTCD11
inline bool year::is_leap() const NOEXCEPT {
return y_ % 4 == 0 && (y_ % 100 != 0 || y_ % 400 == 0);
}
CONSTCD11 inline year::operator int() const NOEXCEPT { return y_; }
CONSTCD11
inline bool year::ok() const NOEXCEPT {
return y_ != std::numeric_limits<int16_t>::min();
}
CONSTCD11
inline year year::min() NOEXCEPT { return year{-32767}; }
CONSTCD11
inline year year::max() NOEXCEPT { return year{32767}; }
CONSTCD11
inline bool operator==(const year& x, const year& y) NOEXCEPT {
return static_cast<int>(x) == static_cast<int>(y);
}
CONSTCD11
inline bool operator!=(const year& x, const year& y) NOEXCEPT { return !(x == y); }
CONSTCD11
inline bool operator<(const year& x, const year& y) NOEXCEPT {
return static_cast<int>(x) < static_cast<int>(y);
}
CONSTCD11
inline bool operator>(const year& x, const year& y) NOEXCEPT { return y < x; }
CONSTCD11
inline bool operator<=(const year& x, const year& y) NOEXCEPT { return !(y < x); }
CONSTCD11
inline bool operator>=(const year& x, const year& y) NOEXCEPT { return !(x < y); }
CONSTCD11
inline years operator-(const year& x, const year& y) NOEXCEPT {
return years{static_cast<int>(x) - static_cast<int>(y)};
}
CONSTCD11
inline year operator+(const year& x, const years& y) NOEXCEPT {
return year{static_cast<int>(x) + y.count()};
}
CONSTCD11
inline year operator+(const years& x, const year& y) NOEXCEPT { return y + x; }
CONSTCD11
inline year operator-(const year& x, const years& y) NOEXCEPT {
return year{static_cast<int>(x) - y.count()};
}
template <class CharT, class Traits>
inline std::basic_ostream<CharT, Traits>& operator<<(
std::basic_ostream<CharT, Traits>& os, const year& y) {
detail::save_ostream<CharT, Traits> _(os);
os.fill('0');
os.flags(std::ios::dec | std::ios::internal);
os.width(4 + (y < year{0}));
os << static_cast<int>(y);
if (!y.ok()) os << " is not a valid year";
return os;
}
// weekday
CONSTCD11
inline unsigned char weekday::weekday_from_days(int z) NOEXCEPT {
return static_cast<unsigned char>(
static_cast<unsigned>(z >= -4 ? (z + 4) % 7 : (z + 5) % 7 + 6));
}
CONSTCD11
inline weekday::weekday(unsigned wd) NOEXCEPT
: wd_(static_cast<decltype(wd_)>(wd != 7 ? wd : 0)) {}
CONSTCD11
inline weekday::weekday(const sys_days& dp) NOEXCEPT
: wd_(weekday_from_days(dp.time_since_epoch().count())) {}
CONSTCD11
inline weekday::weekday(const local_days& dp) NOEXCEPT
: wd_(weekday_from_days(dp.time_since_epoch().count())) {}
CONSTCD14 inline weekday& weekday::operator++() NOEXCEPT {
*this += days{1};
return *this;
}
CONSTCD14 inline weekday weekday:: operator++(int) NOEXCEPT {
auto tmp(*this);
++(*this);
return tmp;
}
CONSTCD14 inline weekday& weekday::operator--() NOEXCEPT {
*this -= days{1};
return *this;
}
CONSTCD14 inline weekday weekday:: operator--(int) NOEXCEPT {
auto tmp(*this);
--(*this);
return tmp;
}
CONSTCD14
inline weekday& weekday::operator+=(const days& d) NOEXCEPT {
*this = *this + d;
return *this;
}
CONSTCD14
inline weekday& weekday::operator-=(const days& d) NOEXCEPT {
*this = *this - d;
return *this;
}
CONSTCD11 inline bool weekday::ok() const NOEXCEPT { return wd_ <= 6; }
CONSTCD11
inline bool operator==(const weekday& x, const weekday& y) NOEXCEPT {
return x.wd_ == y.wd_;
}
CONSTCD11
inline bool operator!=(const weekday& x, const weekday& y) NOEXCEPT { return !(x == y); }
CONSTCD14
inline days operator-(const weekday& x, const weekday& y) NOEXCEPT {
auto const wdu = x.wd_ - y.wd_;
auto const wk = (wdu >= 0 ? wdu : wdu - 6) / 7;
return days{wdu - wk * 7};
}
CONSTCD14
inline weekday operator+(const weekday& x, const days& y) NOEXCEPT {
auto const wdu = static_cast<int64_t>(static_cast<unsigned>(x.wd_)) + y.count();
auto const wk = (wdu >= 0 ? wdu : wdu - 6) / 7;
return weekday{static_cast<unsigned>(wdu - wk * 7)};
}
CONSTCD14
inline weekday operator+(const days& x, const weekday& y) NOEXCEPT { return y + x; }
CONSTCD14
inline weekday operator-(const weekday& x, const days& y) NOEXCEPT { return x + -y; }
template <class CharT, class Traits>
inline std::basic_ostream<CharT, Traits>& operator<<(
std::basic_ostream<CharT, Traits>& os, const weekday& wd) {
if (wd.ok()) {
CharT fmt[] = {'%', 'a', 0};
os << format(fmt, wd);
} else {
os << static_cast<unsigned>(wd.wd_) << " is not a valid weekday";
}
return os;
}
#if !defined(_MSC_VER) || (_MSC_VER >= 1900)
inline namespace literals {
CONSTCD11
inline date::day operator"" _d(unsigned long long d) NOEXCEPT {
return date::day{static_cast<unsigned>(d)};
}
CONSTCD11
inline date::year operator"" _y(unsigned long long y) NOEXCEPT {
return date::year(static_cast<int>(y));
}
#endif // !defined(_MSC_VER) || (_MSC_VER >= 1900)
CONSTDATA date::last_spec last{};
CONSTDATA date::month jan{1};
CONSTDATA date::month feb{2};
CONSTDATA date::month mar{3};
CONSTDATA date::month apr{4};
CONSTDATA date::month may{5};
CONSTDATA date::month jun{6};
CONSTDATA date::month jul{7};
CONSTDATA date::month aug{8};
CONSTDATA date::month sep{9};
CONSTDATA date::month oct{10};
CONSTDATA date::month nov{11};
CONSTDATA date::month dec{12};
CONSTDATA date::weekday sun{0u};
CONSTDATA date::weekday mon{1u};
CONSTDATA date::weekday tue{2u};
CONSTDATA date::weekday wed{3u};
CONSTDATA date::weekday thu{4u};
CONSTDATA date::weekday fri{5u};
CONSTDATA date::weekday sat{6u};
#if !defined(_MSC_VER) || (_MSC_VER >= 1900)
} // inline namespace literals
#endif
CONSTDATA date::month January{1};
CONSTDATA date::month February{2};
CONSTDATA date::month March{3};
CONSTDATA date::month April{4};
CONSTDATA date::month May{5};
CONSTDATA date::month June{6};
CONSTDATA date::month July{7};
CONSTDATA date::month August{8};
CONSTDATA date::month September{9};
CONSTDATA date::month October{10};
CONSTDATA date::month November{11};
CONSTDATA date::month December{12};
CONSTDATA date::weekday Monday{1};
CONSTDATA date::weekday Tuesday{2};
CONSTDATA date::weekday Wednesday{3};
CONSTDATA date::weekday Thursday{4};
CONSTDATA date::weekday Friday{5};
CONSTDATA date::weekday Saturday{6};
CONSTDATA date::weekday Sunday{7};
// weekday_indexed
CONSTCD11
inline weekday weekday_indexed::weekday() const NOEXCEPT {
return date::weekday{static_cast<unsigned>(wd_)};
}
CONSTCD11 inline unsigned weekday_indexed::index() const NOEXCEPT { return index_; }
CONSTCD11
inline bool weekday_indexed::ok() const NOEXCEPT {
return weekday().ok() && 1 <= index_ && index_ <= 5;
}
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif // __GNUC__
CONSTCD11
inline weekday_indexed::weekday_indexed(const date::weekday& wd, unsigned index) NOEXCEPT
: wd_(static_cast<decltype(wd_)>(static_cast<unsigned>(wd.wd_))),
index_(static_cast<decltype(index_)>(index)) {}
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif // __GNUC__
template <class CharT, class Traits>
inline std::basic_ostream<CharT, Traits>& operator<<(
std::basic_ostream<CharT, Traits>& os, const weekday_indexed& wdi) {
os << wdi.weekday() << '[' << wdi.index();
if (!(1 <= wdi.index() && wdi.index() <= 5)) os << " is not a valid index";
os << ']';
return os;
}
CONSTCD11
inline weekday_indexed weekday::operator[](unsigned index) const NOEXCEPT {
return {*this, index};
}
CONSTCD11
inline bool operator==(const weekday_indexed& x, const weekday_indexed& y) NOEXCEPT {
return x.weekday() == y.weekday() && x.index() == y.index();
}
CONSTCD11
inline bool operator!=(const weekday_indexed& x, const weekday_indexed& y) NOEXCEPT {
return !(x == y);
}
// weekday_last
CONSTCD11 inline date::weekday weekday_last::weekday() const NOEXCEPT { return wd_; }
CONSTCD11 inline bool weekday_last::ok() const NOEXCEPT { return wd_.ok(); }
CONSTCD11 inline weekday_last::weekday_last(const date::weekday& wd) NOEXCEPT : wd_(wd) {}
CONSTCD11
inline bool operator==(const weekday_last& x, const weekday_last& y) NOEXCEPT {
return x.weekday() == y.weekday();
}
CONSTCD11
inline bool operator!=(const weekday_last& x, const weekday_last& y) NOEXCEPT {
return !(x == y);
}
template <class CharT, class Traits>
inline std::basic_ostream<CharT, Traits>& operator<<(
std::basic_ostream<CharT, Traits>& os, const weekday_last& wdl) {
return os << wdl.weekday() << "[last]";
}
CONSTCD11
inline weekday_last weekday::operator[](last_spec) const NOEXCEPT {
return weekday_last{*this};
}
// year_month
CONSTCD11
inline year_month::year_month(const date::year& y, const date::month& m) NOEXCEPT
: y_(y),
m_(m) {}
CONSTCD11 inline year year_month::year() const NOEXCEPT { return y_; }
CONSTCD11 inline month year_month::month() const NOEXCEPT { return m_; }
CONSTCD11 inline bool year_month::ok() const NOEXCEPT { return y_.ok() && m_.ok(); }
template <class>
CONSTCD14 inline year_month& year_month::operator+=(const months& dm) NOEXCEPT {
*this = *this + dm;
return *this;
}
template <class>
CONSTCD14 inline year_month& year_month::operator-=(const months& dm) NOEXCEPT {
*this = *this - dm;
return *this;
}
CONSTCD14
inline year_month& year_month::operator+=(const years& dy) NOEXCEPT {
*this = *this + dy;
return *this;
}
CONSTCD14
inline year_month& year_month::operator-=(const years& dy) NOEXCEPT {
*this = *this - dy;
return *this;
}
CONSTCD11
inline bool operator==(const year_month& x, const year_month& y) NOEXCEPT {
return x.year() == y.year() && x.month() == y.month();
}
CONSTCD11
inline bool operator!=(const year_month& x, const year_month& y) NOEXCEPT {
return !(x == y);
}
CONSTCD11
inline bool operator<(const year_month& x, const year_month& y) NOEXCEPT {
return x.year() < y.year() ? true
: (x.year() > y.year() ? false : (x.month() < y.month()));
}
CONSTCD11
inline bool operator>(const year_month& x, const year_month& y) NOEXCEPT { return y < x; }
CONSTCD11
inline bool operator<=(const year_month& x, const year_month& y) NOEXCEPT {
return !(y < x);
}
CONSTCD11
inline bool operator>=(const year_month& x, const year_month& y) NOEXCEPT {
return !(x < y);
}
template <class>
CONSTCD14 inline year_month operator+(const year_month& ym, const months& dm) NOEXCEPT {
auto dmi = static_cast<int>(static_cast<unsigned>(ym.month())) - 1 + dm.count();
auto dy = (dmi >= 0 ? dmi : dmi - 11) / 12;
dmi = dmi - dy * 12 + 1;
return (ym.year() + years(dy)) / month(static_cast<unsigned>(dmi));
}
template <class>
CONSTCD14 inline year_month operator+(const months& dm, const year_month& ym) NOEXCEPT {
return ym + dm;
}
template <class>
CONSTCD14 inline year_month operator-(const year_month& ym, const months& dm) NOEXCEPT {
return ym + -dm;
}
CONSTCD11
inline months operator-(const year_month& x, const year_month& y) NOEXCEPT {
return (x.year() - y.year()) +
months(static_cast<unsigned>(x.month()) - static_cast<unsigned>(y.month()));
}
CONSTCD11
inline year_month operator+(const year_month& ym, const years& dy) NOEXCEPT {
return (ym.year() + dy) / ym.month();
}
CONSTCD11
inline year_month operator+(const years& dy, const year_month& ym) NOEXCEPT {
return ym + dy;
}
CONSTCD11
inline year_month operator-(const year_month& ym, const years& dy) NOEXCEPT {
return ym + -dy;
}
template <class CharT, class Traits>
inline std::basic_ostream<CharT, Traits>& operator<<(
std::basic_ostream<CharT, Traits>& os, const year_month& ym) {
return os << ym.year() << '/' << ym.month();
}
// month_day
CONSTCD11
inline month_day::month_day(const date::month& m, const date::day& d) NOEXCEPT : m_(m),
d_(d) {}
CONSTCD11 inline date::month month_day::month() const NOEXCEPT { return m_; }
CONSTCD11 inline date::day month_day::day() const NOEXCEPT { return d_; }
CONSTCD14
inline bool month_day::ok() const NOEXCEPT {
CONSTDATA date::day d[] = {date::day(31), date::day(29), date::day(31), date::day(30),
date::day(31), date::day(30), date::day(31), date::day(31),
date::day(30), date::day(31), date::day(30), date::day(31)};
return m_.ok() && date::day{1} <= d_ && d_ <= d[static_cast<unsigned>(m_) - 1];
}
CONSTCD11
inline bool operator==(const month_day& x, const month_day& y) NOEXCEPT {
return x.month() == y.month() && x.day() == y.day();
}
CONSTCD11
inline bool operator!=(const month_day& x, const month_day& y) NOEXCEPT {
return !(x == y);
}
CONSTCD11
inline bool operator<(const month_day& x, const month_day& y) NOEXCEPT {
return x.month() < y.month() ? true
: (x.month() > y.month() ? false : (x.day() < y.day()));
}
CONSTCD11
inline bool operator>(const month_day& x, const month_day& y) NOEXCEPT { return y < x; }
CONSTCD11
inline bool operator<=(const month_day& x, const month_day& y) NOEXCEPT {
return !(y < x);
}
CONSTCD11
inline bool operator>=(const month_day& x, const month_day& y) NOEXCEPT {
return !(x < y);
}
template <class CharT, class Traits>
inline std::basic_ostream<CharT, Traits>& operator<<(
std::basic_ostream<CharT, Traits>& os, const month_day& md) {
return os << md.month() << '/' << md.day();
}
// month_day_last
CONSTCD11 inline month month_day_last::month() const NOEXCEPT { return m_; }
CONSTCD11 inline bool month_day_last::ok() const NOEXCEPT { return m_.ok(); }
CONSTCD11 inline month_day_last::month_day_last(const date::month& m) NOEXCEPT : m_(m) {}
CONSTCD11
inline bool operator==(const month_day_last& x, const month_day_last& y) NOEXCEPT {
return x.month() == y.month();
}
CONSTCD11
inline bool operator!=(const month_day_last& x, const month_day_last& y) NOEXCEPT {
return !(x == y);
}
CONSTCD11
inline bool operator<(const month_day_last& x, const month_day_last& y) NOEXCEPT {
return x.month() < y.month();
}
CONSTCD11
inline bool operator>(const month_day_last& x, const month_day_last& y) NOEXCEPT {
return y < x;
}
CONSTCD11
inline bool operator<=(const month_day_last& x, const month_day_last& y) NOEXCEPT {
return !(y < x);
}
CONSTCD11
inline bool operator>=(const month_day_last& x, const month_day_last& y) NOEXCEPT {
return !(x < y);
}
template <class CharT, class Traits>
inline std::basic_ostream<CharT, Traits>& operator<<(
std::basic_ostream<CharT, Traits>& os, const month_day_last& mdl) {
return os << mdl.month() << "/last";
}
// month_weekday
CONSTCD11
inline month_weekday::month_weekday(const date::month& m,
const date::weekday_indexed& wdi) NOEXCEPT
: m_(m),
wdi_(wdi) {}
CONSTCD11 inline month month_weekday::month() const NOEXCEPT { return m_; }
CONSTCD11
inline weekday_indexed month_weekday::weekday_indexed() const NOEXCEPT { return wdi_; }
CONSTCD11
inline bool month_weekday::ok() const NOEXCEPT { return m_.ok() && wdi_.ok(); }
CONSTCD11
inline bool operator==(const month_weekday& x, const month_weekday& y) NOEXCEPT {
return x.month() == y.month() && x.weekday_indexed() == y.weekday_indexed();
}
CONSTCD11
inline bool operator!=(const month_weekday& x, const month_weekday& y) NOEXCEPT {
return !(x == y);
}
template <class CharT, class Traits>
inline std::basic_ostream<CharT, Traits>& operator<<(
std::basic_ostream<CharT, Traits>& os, const month_weekday& mwd) {
return os << mwd.month() << '/' << mwd.weekday_indexed();
}
// month_weekday_last
CONSTCD11
inline month_weekday_last::month_weekday_last(const date::month& m,
const date::weekday_last& wdl) NOEXCEPT
: m_(m),
wdl_(wdl) {}
CONSTCD11 inline month month_weekday_last::month() const NOEXCEPT { return m_; }
CONSTCD11
inline weekday_last month_weekday_last::weekday_last() const NOEXCEPT { return wdl_; }
CONSTCD11
inline bool month_weekday_last::ok() const NOEXCEPT { return m_.ok() && wdl_.ok(); }
CONSTCD11
inline bool operator==(const month_weekday_last& x,
const month_weekday_last& y) NOEXCEPT {
return x.month() == y.month() && x.weekday_last() == y.weekday_last();
}
CONSTCD11
inline bool operator!=(const month_weekday_last& x,
const month_weekday_last& y) NOEXCEPT {
return !(x == y);
}
template <class CharT, class Traits>
inline std::basic_ostream<CharT, Traits>& operator<<(
std::basic_ostream<CharT, Traits>& os, const month_weekday_last& mwdl) {
return os << mwdl.month() << '/' << mwdl.weekday_last();
}
// year_month_day_last
CONSTCD11
inline year_month_day_last::year_month_day_last(const date::year& y,
const date::month_day_last& mdl) NOEXCEPT
: y_(y),
mdl_(mdl) {}
template <class>
CONSTCD14 inline year_month_day_last& year_month_day_last::operator+=(
const months& m) NOEXCEPT {
*this = *this + m;
return *this;
}
template <class>
CONSTCD14 inline year_month_day_last& year_month_day_last::operator-=(
const months& m) NOEXCEPT {
*this = *this - m;
return *this;
}
CONSTCD14
inline year_month_day_last& year_month_day_last::operator+=(const years& y) NOEXCEPT {
*this = *this + y;
return *this;
}
CONSTCD14
inline year_month_day_last& year_month_day_last::operator-=(const years& y) NOEXCEPT {
*this = *this - y;
return *this;
}
CONSTCD11 inline year year_month_day_last::year() const NOEXCEPT { return y_; }
CONSTCD11 inline month year_month_day_last::month() const NOEXCEPT {
return mdl_.month();
}
CONSTCD11
inline month_day_last year_month_day_last::month_day_last() const NOEXCEPT {
return mdl_;
}
CONSTCD14
inline day year_month_day_last::day() const NOEXCEPT {
CONSTDATA date::day d[] = {date::day(31), date::day(28), date::day(31), date::day(30),
date::day(31), date::day(30), date::day(31), date::day(31),
date::day(30), date::day(31), date::day(30), date::day(31)};
return month() != February || !y_.is_leap() ? d[static_cast<unsigned>(month()) - 1]
: date::day{29};
}
CONSTCD14
inline year_month_day_last::operator sys_days() const NOEXCEPT {
return sys_days(year() / month() / day());
}
CONSTCD14
inline year_month_day_last::operator local_days() const NOEXCEPT {
return local_days(year() / month() / day());
}
CONSTCD11
inline bool year_month_day_last::ok() const NOEXCEPT { return y_.ok() && mdl_.ok(); }
CONSTCD11
inline bool operator==(const year_month_day_last& x,
const year_month_day_last& y) NOEXCEPT {
return x.year() == y.year() && x.month_day_last() == y.month_day_last();
}
CONSTCD11
inline bool operator!=(const year_month_day_last& x,
const year_month_day_last& y) NOEXCEPT {
return !(x == y);
}
CONSTCD11
inline bool operator<(const year_month_day_last& x,
const year_month_day_last& y) NOEXCEPT {
return x.year() < y.year()
? true
: (x.year() > y.year() ? false : (x.month_day_last() < y.month_day_last()));
}
CONSTCD11
inline bool operator>(const year_month_day_last& x,
const year_month_day_last& y) NOEXCEPT {
return y < x;
}
CONSTCD11
inline bool operator<=(const year_month_day_last& x,
const year_month_day_last& y) NOEXCEPT {
return !(y < x);
}
CONSTCD11
inline bool operator>=(const year_month_day_last& x,
const year_month_day_last& y) NOEXCEPT {
return !(x < y);
}
template <class CharT, class Traits>
inline std::basic_ostream<CharT, Traits>& operator<<(
std::basic_ostream<CharT, Traits>& os, const year_month_day_last& ymdl) {
return os << ymdl.year() << '/' << ymdl.month_day_last();
}
template <class>
CONSTCD14 inline year_month_day_last operator+(const year_month_day_last& ymdl,
const months& dm) NOEXCEPT {
return (ymdl.year() / ymdl.month() + dm) / last;
}
template <class>
CONSTCD14 inline year_month_day_last operator+(const months& dm,
const year_month_day_last& ymdl) NOEXCEPT {
return ymdl + dm;
}
template <class>
CONSTCD14 inline year_month_day_last operator-(const year_month_day_last& ymdl,
const months& dm) NOEXCEPT {
return ymdl + (-dm);
}
CONSTCD11
inline year_month_day_last operator+(const year_month_day_last& ymdl,
const years& dy) NOEXCEPT {
return {ymdl.year() + dy, ymdl.month_day_last()};
}
CONSTCD11
inline year_month_day_last operator+(const years& dy,
const year_month_day_last& ymdl) NOEXCEPT {
return ymdl + dy;
}
CONSTCD11
inline year_month_day_last operator-(const year_month_day_last& ymdl,
const years& dy) NOEXCEPT {
return ymdl + (-dy);
}
// year_month_day
CONSTCD11
inline year_month_day::year_month_day(const date::year& y, const date::month& m,
const date::day& d) NOEXCEPT : y_(y),
m_(m),
d_(d) {}
CONSTCD14
inline year_month_day::year_month_day(const year_month_day_last& ymdl) NOEXCEPT
: y_(ymdl.year()),
m_(ymdl.month()),
d_(ymdl.day()) {}
CONSTCD14
inline year_month_day::year_month_day(sys_days dp) NOEXCEPT
: year_month_day(from_days(dp.time_since_epoch())) {}
CONSTCD14
inline year_month_day::year_month_day(local_days dp) NOEXCEPT
: year_month_day(from_days(dp.time_since_epoch())) {}
CONSTCD11 inline year year_month_day::year() const NOEXCEPT { return y_; }
CONSTCD11 inline month year_month_day::month() const NOEXCEPT { return m_; }
CONSTCD11 inline day year_month_day::day() const NOEXCEPT { return d_; }
template <class>
CONSTCD14 inline year_month_day& year_month_day::operator+=(const months& m) NOEXCEPT {
*this = *this + m;
return *this;
}
template <class>
CONSTCD14 inline year_month_day& year_month_day::operator-=(const months& m) NOEXCEPT {
*this = *this - m;
return *this;
}
CONSTCD14
inline year_month_day& year_month_day::operator+=(const years& y) NOEXCEPT {
*this = *this + y;
return *this;
}
CONSTCD14
inline year_month_day& year_month_day::operator-=(const years& y) NOEXCEPT {
*this = *this - y;
return *this;
}
CONSTCD14
inline days year_month_day::to_days() const NOEXCEPT {
static_assert(std::numeric_limits<unsigned>::digits >= 18,
"This algorithm has not been ported to a 16 bit unsigned integer");
static_assert(std::numeric_limits<int>::digits >= 20,
"This algorithm has not been ported to a 16 bit signed integer");
auto const y = static_cast<int>(y_) - (m_ <= February);
auto const m = static_cast<unsigned>(m_);
auto const d = static_cast<unsigned>(d_);
auto const era = (y >= 0 ? y : y - 399) / 400;
auto const yoe = static_cast<unsigned>(y - era * 400); // [0, 399]
auto const doy = (153 * (m > 2 ? m - 3 : m + 9) + 2) / 5 + d - 1; // [0, 365]
auto const doe = yoe * 365 + yoe / 4 - yoe / 100 + doy; // [0, 146096]
return days{era * 146097 + static_cast<int>(doe) - 719468};
}
CONSTCD14
inline year_month_day::operator sys_days() const NOEXCEPT { return sys_days{to_days()}; }
CONSTCD14
inline year_month_day::operator local_days() const NOEXCEPT {
return local_days{to_days()};
}
CONSTCD14
inline bool year_month_day::ok() const NOEXCEPT {
if (!(y_.ok() && m_.ok())) return false;
return date::day{1} <= d_ && d_ <= (y_ / m_ / last).day();
}
CONSTCD11
inline bool operator==(const year_month_day& x, const year_month_day& y) NOEXCEPT {
return x.year() == y.year() && x.month() == y.month() && x.day() == y.day();
}
CONSTCD11
inline bool operator!=(const year_month_day& x, const year_month_day& y) NOEXCEPT {
return !(x == y);
}
CONSTCD11
inline bool operator<(const year_month_day& x, const year_month_day& y) NOEXCEPT {
return x.year() < y.year()
? true
: (x.year() > y.year()
? false
: (x.month() < y.month()
? true
: (x.month() > y.month() ? false : (x.day() < y.day()))));
}
CONSTCD11
inline bool operator>(const year_month_day& x, const year_month_day& y) NOEXCEPT {
return y < x;
}
CONSTCD11
inline bool operator<=(const year_month_day& x, const year_month_day& y) NOEXCEPT {
return !(y < x);
}
CONSTCD11
inline bool operator>=(const year_month_day& x, const year_month_day& y) NOEXCEPT {
return !(x < y);
}
template <class CharT, class Traits>
inline std::basic_ostream<CharT, Traits>& operator<<(
std::basic_ostream<CharT, Traits>& os, const year_month_day& ymd) {
detail::save_ostream<CharT, Traits> _(os);
os.fill('0');
os.flags(std::ios::dec | std::ios::right);
os << ymd.year() << '-';
os.width(2);
os << static_cast<unsigned>(ymd.month()) << '-';
os << ymd.day();
if (!ymd.ok()) os << " is not a valid date";
return os;
}
CONSTCD14
inline year_month_day year_month_day::from_days(days dp) NOEXCEPT {
static_assert(std::numeric_limits<unsigned>::digits >= 18,
"This algorithm has not been ported to a 16 bit unsigned integer");
static_assert(std::numeric_limits<int>::digits >= 20,
"This algorithm has not been ported to a 16 bit signed integer");
auto const z = dp.count() + 719468;
auto const era = (z >= 0 ? z : z - 146096) / 146097;
auto const doe = static_cast<unsigned>(z - era * 146097); // [0, 146096]
auto const yoe = (doe - doe / 1460 + doe / 36524 - doe / 146096) / 365; // [0, 399]
auto const y = static_cast<days::rep>(yoe) + era * 400;
auto const doy = doe - (365 * yoe + yoe / 4 - yoe / 100); // [0, 365]
auto const mp = (5 * doy + 2) / 153; // [0, 11]
auto const d = doy - (153 * mp + 2) / 5 + 1; // [1, 31]
auto const m = mp < 10 ? mp + 3 : mp - 9; // [1, 12]
return year_month_day{date::year{y + (m <= 2)}, date::month(m), date::day(d)};
}
template <class>
CONSTCD14 inline year_month_day operator+(const year_month_day& ymd,
const months& dm) NOEXCEPT {
return (ymd.year() / ymd.month() + dm) / ymd.day();
}
template <class>
CONSTCD14 inline year_month_day operator+(const months& dm,
const year_month_day& ymd) NOEXCEPT {
return ymd + dm;
}
template <class>
CONSTCD14 inline year_month_day operator-(const year_month_day& ymd,
const months& dm) NOEXCEPT {
return ymd + (-dm);
}
CONSTCD11
inline year_month_day operator+(const year_month_day& ymd, const years& dy) NOEXCEPT {
return (ymd.year() + dy) / ymd.month() / ymd.day();
}
CONSTCD11
inline year_month_day operator+(const years& dy, const year_month_day& ymd) NOEXCEPT {
return ymd + dy;
}
CONSTCD11
inline year_month_day operator-(const year_month_day& ymd, const years& dy) NOEXCEPT {
return ymd + (-dy);
}
// year_month_weekday
CONSTCD11
inline year_month_weekday::year_month_weekday(const date::year& y, const date::month& m,
const date::weekday_indexed& wdi) NOEXCEPT
: y_(y),
m_(m),
wdi_(wdi) {}
CONSTCD14
inline year_month_weekday::year_month_weekday(const sys_days& dp) NOEXCEPT
: year_month_weekday(from_days(dp.time_since_epoch())) {}
CONSTCD14
inline year_month_weekday::year_month_weekday(const local_days& dp) NOEXCEPT
: year_month_weekday(from_days(dp.time_since_epoch())) {}
template <class>
CONSTCD14 inline year_month_weekday& year_month_weekday::operator+=(
const months& m) NOEXCEPT {
*this = *this + m;
return *this;
}
template <class>
CONSTCD14 inline year_month_weekday& year_month_weekday::operator-=(
const months& m) NOEXCEPT {
*this = *this - m;
return *this;
}
CONSTCD14
inline year_month_weekday& year_month_weekday::operator+=(const years& y) NOEXCEPT {
*this = *this + y;
return *this;
}
CONSTCD14
inline year_month_weekday& year_month_weekday::operator-=(const years& y) NOEXCEPT {
*this = *this - y;
return *this;
}
CONSTCD11 inline year year_month_weekday::year() const NOEXCEPT { return y_; }
CONSTCD11 inline month year_month_weekday::month() const NOEXCEPT { return m_; }
CONSTCD11
inline weekday year_month_weekday::weekday() const NOEXCEPT { return wdi_.weekday(); }
CONSTCD11
inline unsigned year_month_weekday::index() const NOEXCEPT { return wdi_.index(); }
CONSTCD11
inline weekday_indexed year_month_weekday::weekday_indexed() const NOEXCEPT {
return wdi_;
}
CONSTCD14
inline year_month_weekday::operator sys_days() const NOEXCEPT {
return sys_days{to_days()};
}
CONSTCD14
inline year_month_weekday::operator local_days() const NOEXCEPT {
return local_days{to_days()};
}
CONSTCD14
inline bool year_month_weekday::ok() const NOEXCEPT {
if (!y_.ok() || !m_.ok() || !wdi_.weekday().ok() || wdi_.index() < 1) return false;
if (wdi_.index() <= 4) return true;
auto d2 = wdi_.weekday() - date::weekday(static_cast<sys_days>(y_ / m_ / 1)) +
days((wdi_.index() - 1) * 7 + 1);
return static_cast<unsigned>(d2.count()) <=
static_cast<unsigned>((y_ / m_ / last).day());
}
CONSTCD14
inline year_month_weekday year_month_weekday::from_days(days d) NOEXCEPT {
sys_days dp{d};
auto const wd = date::weekday(dp);
auto const ymd = year_month_day(dp);
return {ymd.year(), ymd.month(), wd[(static_cast<unsigned>(ymd.day()) - 1) / 7 + 1]};
}
CONSTCD14
inline days year_month_weekday::to_days() const NOEXCEPT {
auto d = sys_days(y_ / m_ / 1);
return (d + (wdi_.weekday() - date::weekday(d) + days{(wdi_.index() - 1) * 7}))
.time_since_epoch();
}
CONSTCD11
inline bool operator==(const year_month_weekday& x,
const year_month_weekday& y) NOEXCEPT {
return x.year() == y.year() && x.month() == y.month() &&
x.weekday_indexed() == y.weekday_indexed();
}
CONSTCD11
inline bool operator!=(const year_month_weekday& x,
const year_month_weekday& y) NOEXCEPT {
return !(x == y);
}
template <class CharT, class Traits>
inline std::basic_ostream<CharT, Traits>& operator<<(
std::basic_ostream<CharT, Traits>& os, const year_month_weekday& ymwdi) {
return os << ymwdi.year() << '/' << ymwdi.month() << '/' << ymwdi.weekday_indexed();
}
template <class>
CONSTCD14 inline year_month_weekday operator+(const year_month_weekday& ymwd,
const months& dm) NOEXCEPT {
return (ymwd.year() / ymwd.month() + dm) / ymwd.weekday_indexed();
}
template <class>
CONSTCD14 inline year_month_weekday operator+(const months& dm,
const year_month_weekday& ymwd) NOEXCEPT {
return ymwd + dm;
}
template <class>
CONSTCD14 inline year_month_weekday operator-(const year_month_weekday& ymwd,
const months& dm) NOEXCEPT {
return ymwd + (-dm);
}
CONSTCD11
inline year_month_weekday operator+(const year_month_weekday& ymwd,
const years& dy) NOEXCEPT {
return {ymwd.year() + dy, ymwd.month(), ymwd.weekday_indexed()};
}
CONSTCD11
inline year_month_weekday operator+(const years& dy,
const year_month_weekday& ymwd) NOEXCEPT {
return ymwd + dy;
}
CONSTCD11
inline year_month_weekday operator-(const year_month_weekday& ymwd,
const years& dy) NOEXCEPT {
return ymwd + (-dy);
}
// year_month_weekday_last
CONSTCD11
inline year_month_weekday_last::year_month_weekday_last(
const date::year& y, const date::month& m, const date::weekday_last& wdl) NOEXCEPT
: y_(y),
m_(m),
wdl_(wdl) {}
template <class>
CONSTCD14 inline year_month_weekday_last& year_month_weekday_last::operator+=(
const months& m) NOEXCEPT {
*this = *this + m;
return *this;
}
template <class>
CONSTCD14 inline year_month_weekday_last& year_month_weekday_last::operator-=(
const months& m) NOEXCEPT {
*this = *this - m;
return *this;
}
CONSTCD14
inline year_month_weekday_last& year_month_weekday_last::operator+=(
const years& y) NOEXCEPT {
*this = *this + y;
return *this;
}
CONSTCD14
inline year_month_weekday_last& year_month_weekday_last::operator-=(
const years& y) NOEXCEPT {
*this = *this - y;
return *this;
}
CONSTCD11 inline year year_month_weekday_last::year() const NOEXCEPT { return y_; }
CONSTCD11 inline month year_month_weekday_last::month() const NOEXCEPT { return m_; }
CONSTCD11
inline weekday year_month_weekday_last::weekday() const NOEXCEPT {
return wdl_.weekday();
}
CONSTCD11
inline weekday_last year_month_weekday_last::weekday_last() const NOEXCEPT {
return wdl_;
}
CONSTCD14
inline year_month_weekday_last::operator sys_days() const NOEXCEPT {
return sys_days{to_days()};
}
CONSTCD14
inline year_month_weekday_last::operator local_days() const NOEXCEPT {
return local_days{to_days()};
}
CONSTCD11
inline bool year_month_weekday_last::ok() const NOEXCEPT {
return y_.ok() && m_.ok() && wdl_.ok();
}
CONSTCD14
inline days year_month_weekday_last::to_days() const NOEXCEPT {
auto const d = sys_days(y_ / m_ / last);
return (d - (date::weekday {d} - wdl_.weekday())).time_since_epoch();
}
CONSTCD11
inline bool operator==(const year_month_weekday_last& x,
const year_month_weekday_last& y) NOEXCEPT {
return x.year() == y.year() && x.month() == y.month() &&
x.weekday_last() == y.weekday_last();
}
CONSTCD11
inline bool operator!=(const year_month_weekday_last& x,
const year_month_weekday_last& y) NOEXCEPT {
return !(x == y);
}
template <class CharT, class Traits>
inline std::basic_ostream<CharT, Traits>& operator<<(
std::basic_ostream<CharT, Traits>& os, const year_month_weekday_last& ymwdl) {
return os << ymwdl.year() << '/' << ymwdl.month() << '/' << ymwdl.weekday_last();
}
template <class>
CONSTCD14 inline year_month_weekday_last operator+(const year_month_weekday_last& ymwdl,
const months& dm) NOEXCEPT {
return (ymwdl.year() / ymwdl.month() + dm) / ymwdl.weekday_last();
}
template <class>
CONSTCD14 inline year_month_weekday_last operator+(
const months& dm, const year_month_weekday_last& ymwdl) NOEXCEPT {
return ymwdl + dm;
}
template <class>
CONSTCD14 inline year_month_weekday_last operator-(const year_month_weekday_last& ymwdl,
const months& dm) NOEXCEPT {
return ymwdl + (-dm);
}
CONSTCD11
inline year_month_weekday_last operator+(const year_month_weekday_last& ymwdl,
const years& dy) NOEXCEPT {
return {ymwdl.year() + dy, ymwdl.month(), ymwdl.weekday_last()};
}
CONSTCD11
inline year_month_weekday_last operator+(const years& dy,
const year_month_weekday_last& ymwdl) NOEXCEPT {
return ymwdl + dy;
}
CONSTCD11
inline year_month_weekday_last operator-(const year_month_weekday_last& ymwdl,
const years& dy) NOEXCEPT {
return ymwdl + (-dy);
}
// year_month from operator/()
CONSTCD11
inline year_month operator/(const year& y, const month& m) NOEXCEPT { return {y, m}; }
CONSTCD11
inline year_month operator/(const year& y, int m) NOEXCEPT {
return y / month(static_cast<unsigned>(m));
}
// month_day from operator/()
CONSTCD11
inline month_day operator/(const month& m, const day& d) NOEXCEPT { return {m, d}; }
CONSTCD11
inline month_day operator/(const day& d, const month& m) NOEXCEPT { return m / d; }
CONSTCD11
inline month_day operator/(const month& m, int d) NOEXCEPT {
return m / day(static_cast<unsigned>(d));
}
CONSTCD11
inline month_day operator/(int m, const day& d) NOEXCEPT {
return month(static_cast<unsigned>(m)) / d;
}
CONSTCD11 inline month_day operator/(const day& d, int m) NOEXCEPT { return m / d; }
// month_day_last from operator/()
CONSTCD11
inline month_day_last operator/(const month& m, last_spec) NOEXCEPT {
return month_day_last{m};
}
CONSTCD11
inline month_day_last operator/(last_spec, const month& m) NOEXCEPT { return m / last; }
CONSTCD11
inline month_day_last operator/(int m, last_spec) NOEXCEPT {
return month(static_cast<unsigned>(m)) / last;
}
CONSTCD11
inline month_day_last operator/(last_spec, int m) NOEXCEPT { return m / last; }
// month_weekday from operator/()
CONSTCD11
inline month_weekday operator/(const month& m, const weekday_indexed& wdi) NOEXCEPT {
return {m, wdi};
}
CONSTCD11
inline month_weekday operator/(const weekday_indexed& wdi, const month& m) NOEXCEPT {
return m / wdi;
}
CONSTCD11
inline month_weekday operator/(int m, const weekday_indexed& wdi) NOEXCEPT {
return month(static_cast<unsigned>(m)) / wdi;
}
CONSTCD11
inline month_weekday operator/(const weekday_indexed& wdi, int m) NOEXCEPT {
return m / wdi;
}
// month_weekday_last from operator/()
CONSTCD11
inline month_weekday_last operator/(const month& m, const weekday_last& wdl) NOEXCEPT {
return {m, wdl};
}
CONSTCD11
inline month_weekday_last operator/(const weekday_last& wdl, const month& m) NOEXCEPT {
return m / wdl;
}
CONSTCD11
inline month_weekday_last operator/(int m, const weekday_last& wdl) NOEXCEPT {
return month(static_cast<unsigned>(m)) / wdl;
}
CONSTCD11
inline month_weekday_last operator/(const weekday_last& wdl, int m) NOEXCEPT {
return m / wdl;
}
// year_month_day from operator/()
CONSTCD11
inline year_month_day operator/(const year_month& ym, const day& d) NOEXCEPT {
return {ym.year(), ym.month(), d};
}
CONSTCD11
inline year_month_day operator/(const year_month& ym, int d) NOEXCEPT {
return ym / day(static_cast<unsigned>(d));
}
CONSTCD11
inline year_month_day operator/(const year& y, const month_day& md) NOEXCEPT {
return y / md.month() / md.day();
}
CONSTCD11
inline year_month_day operator/(int y, const month_day& md) NOEXCEPT {
return year(y) / md;
}
CONSTCD11
inline year_month_day operator/(const month_day& md, const year& y) NOEXCEPT {
return y / md;
}
CONSTCD11
inline year_month_day operator/(const month_day& md, int y) NOEXCEPT {
return year(y) / md;
}
// year_month_day_last from operator/()
CONSTCD11
inline year_month_day_last operator/(const year_month& ym, last_spec) NOEXCEPT {
return {ym.year(), month_day_last{ym.month()}};
}
CONSTCD11
inline year_month_day_last operator/(const year& y, const month_day_last& mdl) NOEXCEPT {
return {y, mdl};
}
CONSTCD11
inline year_month_day_last operator/(int y, const month_day_last& mdl) NOEXCEPT {
return year(y) / mdl;
}
CONSTCD11
inline year_month_day_last operator/(const month_day_last& mdl, const year& y) NOEXCEPT {
return y / mdl;
}
CONSTCD11
inline year_month_day_last operator/(const month_day_last& mdl, int y) NOEXCEPT {
return year(y) / mdl;
}
// year_month_weekday from operator/()
CONSTCD11
inline year_month_weekday operator/(const year_month& ym,
const weekday_indexed& wdi) NOEXCEPT {
return {ym.year(), ym.month(), wdi};
}
CONSTCD11
inline year_month_weekday operator/(const year& y, const month_weekday& mwd) NOEXCEPT {
return {y, mwd.month(), mwd.weekday_indexed()};
}
CONSTCD11
inline year_month_weekday operator/(int y, const month_weekday& mwd) NOEXCEPT {
return year(y) / mwd;
}
CONSTCD11
inline year_month_weekday operator/(const month_weekday& mwd, const year& y) NOEXCEPT {
return y / mwd;
}
CONSTCD11
inline year_month_weekday operator/(const month_weekday& mwd, int y) NOEXCEPT {
return year(y) / mwd;
}
// year_month_weekday_last from operator/()
CONSTCD11
inline year_month_weekday_last operator/(const year_month& ym,
const weekday_last& wdl) NOEXCEPT {
return {ym.year(), ym.month(), wdl};
}
CONSTCD11
inline year_month_weekday_last operator/(const year& y,
const month_weekday_last& mwdl) NOEXCEPT {
return {y, mwdl.month(), mwdl.weekday_last()};
}
CONSTCD11
inline year_month_weekday_last operator/(int y, const month_weekday_last& mwdl) NOEXCEPT {
return year(y) / mwdl;
}
CONSTCD11
inline year_month_weekday_last operator/(const month_weekday_last& mwdl,
const year& y) NOEXCEPT {
return y / mwdl;
}
CONSTCD11
inline year_month_weekday_last operator/(const month_weekday_last& mwdl, int y) NOEXCEPT {
return year(y) / mwdl;
}
template <class Duration>
struct fields;
template <class CharT, class Traits, class Duration>
std::basic_ostream<CharT, Traits>& to_stream(
std::basic_ostream<CharT, Traits>& os, const CharT* fmt, const fields<Duration>& fds,
const std::string* abbrev = nullptr,
const std::chrono::seconds* offset_sec = nullptr);
template <class CharT, class Traits, class Duration, class Alloc>
std::basic_istream<CharT, Traits>& from_stream(
std::basic_istream<CharT, Traits>& is, const CharT* fmt, fields<Duration>& fds,
std::basic_string<CharT, Traits, Alloc>* abbrev = nullptr,
std::chrono::minutes* offset = nullptr);
// time_of_day
enum { am = 1, pm };
namespace detail {
// width<n>::value is the number of fractional decimal digits in 1/n
// width<0>::value and width<1>::value are defined to be 0
// If 1/n takes more than 18 fractional decimal digits,
// the result is truncated to 19.
// Example: width<2>::value == 1
// Example: width<3>::value == 19
// Example: width<4>::value == 2
// Example: width<10>::value == 1
// Example: width<1000>::value == 3
template <std::uint64_t n, std::uint64_t d = 10, unsigned w = 0,
bool should_continue = !(n < 2) && d != 0 && (w < 19)>
struct width {
static CONSTDATA unsigned value = 1 + width<n, d % n * 10, w + 1>::value;
};
template <std::uint64_t n, std::uint64_t d, unsigned w>
struct width<n, d, w, false> {
static CONSTDATA unsigned value = 0;
};
template <unsigned exp>
struct static_pow10 {
private:
static CONSTDATA std::uint64_t h = static_pow10<exp / 2>::value;
public:
static CONSTDATA std::uint64_t value = h * h * (exp % 2 ? 10 : 1);
};
template <>
struct static_pow10<0> {
static CONSTDATA std::uint64_t value = 1;
};
template <class Rep, unsigned w, bool in_range = (w < 19)>
struct make_precision {
using type = std::chrono::duration<Rep, std::ratio<1, static_pow10<w>::value>>;
static CONSTDATA unsigned width = w;
};
template <class Rep, unsigned w>
struct make_precision<Rep, w, false> {
using type = std::chrono::duration<Rep, std::micro>;
static CONSTDATA unsigned width = 6;
};
template <class Duration, unsigned w = width<std::common_type<
Duration, std::chrono::seconds>::type::period::den>::value>
class decimal_format_seconds {
public:
using rep = typename std::common_type<Duration, std::chrono::seconds>::type::rep;
using precision = typename make_precision<rep, w>::type;
static auto CONSTDATA width = make_precision<rep, w>::width;
private:
std::chrono::seconds s_;
precision sub_s_;
public:
CONSTCD11 decimal_format_seconds() : s_(), sub_s_() {}
CONSTCD11 explicit decimal_format_seconds(const Duration& d) NOEXCEPT
: s_(std::chrono::duration_cast<std::chrono::seconds>(d)),
sub_s_(std::chrono::duration_cast<precision>(d - s_)) {}
CONSTCD14 std::chrono::seconds& seconds() NOEXCEPT { return s_; }
CONSTCD11 std::chrono::seconds seconds() const NOEXCEPT { return s_; }
CONSTCD11 precision subseconds() const NOEXCEPT { return sub_s_; }
CONSTCD14 precision to_duration() const NOEXCEPT { return s_ + sub_s_; }
CONSTCD11 bool in_conventional_range() const NOEXCEPT {
return sub_s_ < std::chrono::seconds{1} && s_ < std::chrono::minutes{1};
}
template <class CharT, class Traits>
friend std::basic_ostream<CharT, Traits>& operator<<(
std::basic_ostream<CharT, Traits>& os, const decimal_format_seconds& x) {
date::detail::save_ostream<CharT, Traits> _(os);
os.fill('0');
os.flags(std::ios::dec | std::ios::right);
os.width(2);
os << x.s_.count()
<< std::use_facet<std::numpunct<char>>(os.getloc()).decimal_point();
os.width(width);
os << static_cast<std::int64_t>(x.sub_s_.count());
return os;
}
};
template <class Duration>
class decimal_format_seconds<Duration, 0> {
static CONSTDATA unsigned w = 0;
public:
using rep = typename std::common_type<Duration, std::chrono::seconds>::type::rep;
using precision = std::chrono::duration<rep>;
static auto CONSTDATA width = make_precision<rep, w>::width;
private:
std::chrono::seconds s_;
public:
CONSTCD11 decimal_format_seconds() : s_() {}
CONSTCD11 explicit decimal_format_seconds(const precision& s) NOEXCEPT : s_(s) {}
CONSTCD14 std::chrono::seconds& seconds() NOEXCEPT { return s_; }
CONSTCD11 std::chrono::seconds seconds() const NOEXCEPT { return s_; }
CONSTCD14 precision to_duration() const NOEXCEPT { return s_; }
CONSTCD11 bool in_conventional_range() const NOEXCEPT {
return s_ < std::chrono::minutes{1};
}
template <class CharT, class Traits>
friend std::basic_ostream<CharT, Traits>& operator<<(
std::basic_ostream<CharT, Traits>& os, const decimal_format_seconds& x) {
date::detail::save_ostream<CharT, Traits> _(os);
os.fill('0');
os.flags(std::ios::dec | std::ios::right);
os.width(2);
os << x.s_.count();
return os;
}
};
enum class classify { not_valid, hour, minute, second, subsecond };
template <class Duration>
struct classify_duration {
static CONSTDATA classify value =
std::is_convertible<Duration, std::chrono::hours>::value
? classify::hour
: std::is_convertible<Duration, std::chrono::minutes>::value
? classify::minute
: std::is_convertible<Duration, std::chrono::seconds>::value
? classify::second
: std::chrono::treat_as_floating_point<
typename Duration::rep>::value
? classify::not_valid
: classify::subsecond;
};
template <class Rep, class Period>
inline CONSTCD11 typename std::enable_if<std::numeric_limits<Rep>::is_signed,
std::chrono::duration<Rep, Period>>::type
abs(std::chrono::duration<Rep, Period> d) {
return d >= d.zero() ? +d : -d;
}
template <class Rep, class Period>
inline CONSTCD11 typename std::enable_if<!std::numeric_limits<Rep>::is_signed,
std::chrono::duration<Rep, Period>>::type
abs(std::chrono::duration<Rep, Period> d) {
return d;
}
class time_of_day_base {
protected:
std::chrono::hours h_;
unsigned char mode_;
bool neg_;
enum { is24hr };
CONSTCD11 time_of_day_base() NOEXCEPT : h_(0),
mode_(static_cast<decltype(mode_)>(is24hr)),
neg_(false) {}
CONSTCD11 time_of_day_base(std::chrono::hours h, bool neg, unsigned m) NOEXCEPT
: h_(detail::abs(h)),
mode_(static_cast<decltype(mode_)>(m)),
neg_(neg) {}
CONSTCD14 void make24() NOEXCEPT;
CONSTCD14 void make12() NOEXCEPT;
CONSTCD14 std::chrono::hours to24hr() const;
CONSTCD11 bool in_conventional_range() const NOEXCEPT { return !neg_ && h_ < days{1}; }
};
CONSTCD14
inline std::chrono::hours time_of_day_base::to24hr() const {
auto h = h_;
if (mode_ == am || mode_ == pm) {
CONSTDATA auto h12 = std::chrono::hours(12);
if (mode_ == pm) {
if (h != h12) h = h + h12;
} else if (h == h12) {
h = std::chrono::hours(0);
}
}
return h;
}
CONSTCD14
inline void time_of_day_base::make24() NOEXCEPT {
h_ = to24hr();
mode_ = is24hr;
}
CONSTCD14
inline void time_of_day_base::make12() NOEXCEPT {
if (mode_ == is24hr) {
CONSTDATA auto h12 = std::chrono::hours(12);
if (h_ >= h12) {
if (h_ > h12) h_ = h_ - h12;
mode_ = pm;
} else {
if (h_ == std::chrono::hours(0)) h_ = h12;
mode_ = am;
}
}
}
template <class Duration, detail::classify = detail::classify_duration<Duration>::value>
class time_of_day_storage;
template <class Rep, class Period>
class time_of_day_storage<std::chrono::duration<Rep, Period>, detail::classify::hour>
: private detail::time_of_day_base {
using base = detail::time_of_day_base;
public:
using precision = std::chrono::hours;
#if !defined(_MSC_VER) || _MSC_VER >= 1900
CONSTCD11 time_of_day_storage() NOEXCEPT = default;
#else
CONSTCD11 time_of_day_storage() = default;
#endif /* !defined(_MSC_VER) || _MSC_VER >= 1900 */
CONSTCD11 explicit time_of_day_storage(std::chrono::hours since_midnight) NOEXCEPT
: base(since_midnight, since_midnight < std::chrono::hours{0}, is24hr) {}
CONSTCD11 explicit time_of_day_storage(std::chrono::hours h, unsigned md) NOEXCEPT
: base(h, h < std::chrono::hours{0}, md) {}
CONSTCD11 std::chrono::hours hours() const NOEXCEPT { return h_; }
CONSTCD11 unsigned mode() const NOEXCEPT { return mode_; }
CONSTCD14 explicit operator precision() const NOEXCEPT {
auto p = to24hr();
if (neg_) p = -p;
return p;
}
CONSTCD14 precision to_duration() const NOEXCEPT {
return static_cast<precision>(*this);
}
CONSTCD14 time_of_day_storage& make24() NOEXCEPT {
base::make24();
return *this;
}
CONSTCD14 time_of_day_storage& make12() NOEXCEPT {
base::make12();
return *this;
}
CONSTCD11 bool in_conventional_range() const NOEXCEPT {
return base::in_conventional_range();
}
template <class CharT, class Traits>
friend std::basic_ostream<CharT, Traits>& operator<<(
std::basic_ostream<CharT, Traits>& os, const time_of_day_storage& t) {
detail::save_ostream<CharT, Traits> _(os);
if (t.neg_) os << '-';
os.fill('0');
os.flags(std::ios::dec | std::ios::right);
if (t.mode_ != am && t.mode_ != pm) os.width(2);
os << t.h_.count();
switch (t.mode_) {
case time_of_day_storage::is24hr:
os << "00";
break;
case am:
os << "am";
break;
case pm:
os << "pm";
break;
}
return os;
}
};
template <class Rep, class Period>
class time_of_day_storage<std::chrono::duration<Rep, Period>, detail::classify::minute>
: private detail::time_of_day_base {
using base = detail::time_of_day_base;
std::chrono::minutes m_;
public:
using precision = std::chrono::minutes;
CONSTCD11 time_of_day_storage() NOEXCEPT : base(), m_(0) {}
CONSTCD11 explicit time_of_day_storage(std::chrono::minutes since_midnight) NOEXCEPT
: base(std::chrono::duration_cast<std::chrono::hours>(since_midnight),
since_midnight < std::chrono::minutes{0}, is24hr),
m_(detail::abs(since_midnight) - h_) {}
CONSTCD11 explicit time_of_day_storage(std::chrono::hours h, std::chrono::minutes m,
unsigned md) NOEXCEPT : base(h, false, md),
m_(m) {}
CONSTCD11 std::chrono::hours hours() const NOEXCEPT { return h_; }
CONSTCD11 std::chrono::minutes minutes() const NOEXCEPT { return m_; }
CONSTCD11 unsigned mode() const NOEXCEPT { return mode_; }
CONSTCD14 explicit operator precision() const NOEXCEPT {
auto p = to24hr() + m_;
if (neg_) p = -p;
return p;
}
CONSTCD14 precision to_duration() const NOEXCEPT {
return static_cast<precision>(*this);
}
CONSTCD14 time_of_day_storage& make24() NOEXCEPT {
base::make24();
return *this;
}
CONSTCD14 time_of_day_storage& make12() NOEXCEPT {
base::make12();
return *this;
}
CONSTCD11 bool in_conventional_range() const NOEXCEPT {
return base::in_conventional_range() && m_ < std::chrono::hours {1};
}
template <class CharT, class Traits>
friend std::basic_ostream<CharT, Traits>& operator<<(
std::basic_ostream<CharT, Traits>& os, const time_of_day_storage& t) {
detail::save_ostream<CharT, Traits> _(os);
if (t.neg_) os << '-';
os.fill('0');
os.flags(std::ios::dec | std::ios::right);
if (t.mode_ != am && t.mode_ != pm) os.width(2);
os << t.h_.count() << ':';
os.width(2);
os << t.m_.count();
switch (t.mode_) {
case am:
os << "am";
break;
case pm:
os << "pm";
break;
}
return os;
}
};
template <class Rep, class Period>
class time_of_day_storage<std::chrono::duration<Rep, Period>, detail::classify::second>
: private detail::time_of_day_base {
using base = detail::time_of_day_base;
using dfs = decimal_format_seconds<std::chrono::seconds>;
std::chrono::minutes m_;
dfs s_;
public:
using precision = std::chrono::seconds;
CONSTCD11 time_of_day_storage() NOEXCEPT : base(), m_(0), s_() {}
CONSTCD11 explicit time_of_day_storage(std::chrono::seconds since_midnight) NOEXCEPT
: base(std::chrono::duration_cast<std::chrono::hours>(since_midnight),
since_midnight < std::chrono::seconds{0}, is24hr),
m_(std::chrono::duration_cast<std::chrono::minutes>(detail::abs(since_midnight) -
h_)),
s_(detail::abs(since_midnight) - h_ - m_) {}
CONSTCD11 explicit time_of_day_storage(std::chrono::hours h, std::chrono::minutes m,
std::chrono::seconds s, unsigned md) NOEXCEPT
: base(h, false, md),
m_(m),
s_(s) {}
CONSTCD11 std::chrono::hours hours() const NOEXCEPT { return h_; }
CONSTCD11 std::chrono::minutes minutes() const NOEXCEPT { return m_; }
CONSTCD14 std::chrono::seconds& seconds() NOEXCEPT { return s_.seconds(); }
CONSTCD11 std::chrono::seconds seconds() const NOEXCEPT { return s_.seconds(); }
CONSTCD11 unsigned mode() const NOEXCEPT { return mode_; }
CONSTCD14 explicit operator precision() const NOEXCEPT {
auto p = to24hr() + s_.to_duration() + m_;
if (neg_) p = -p;
return p;
}
CONSTCD14 precision to_duration() const NOEXCEPT {
return static_cast<precision>(*this);
}
CONSTCD14 time_of_day_storage& make24() NOEXCEPT {
base::make24();
return *this;
}
CONSTCD14 time_of_day_storage& make12() NOEXCEPT {
base::make12();
return *this;
}
CONSTCD11 bool in_conventional_range() const NOEXCEPT {
return base::in_conventional_range() && m_ < std::chrono::hours {1} &&
s_.in_conventional_range();
}
template <class CharT, class Traits>
friend std::basic_ostream<CharT, Traits>& operator<<(
std::basic_ostream<CharT, Traits>& os, const time_of_day_storage& t) {
detail::save_ostream<CharT, Traits> _(os);
if (t.neg_) os << '-';
os.fill('0');
os.flags(std::ios::dec | std::ios::right);
if (t.mode_ != am && t.mode_ != pm) os.width(2);
os << t.h_.count() << ':';
os.width(2);
os << t.m_.count() << ':' << t.s_;
switch (t.mode_) {
case am:
os << "am";
break;
case pm:
os << "pm";
break;
}
return os;
}
template <class CharT, class Traits, class Duration>
friend std::basic_ostream<CharT, Traits>& date::to_stream(
std::basic_ostream<CharT, Traits>& os, const CharT* fmt,
const fields<Duration>& fds, const std::string* abbrev,
const std::chrono::seconds* offset_sec);
template <class CharT, class Traits, class Duration, class Alloc>
friend std::basic_istream<CharT, Traits>& date::from_stream(
std::basic_istream<CharT, Traits>& is, const CharT* fmt, fields<Duration>& fds,
std::basic_string<CharT, Traits, Alloc>* abbrev, std::chrono::minutes* offset);
};
template <class Rep, class Period>
class time_of_day_storage<std::chrono::duration<Rep, Period>, detail::classify::subsecond>
: private detail::time_of_day_base {
public:
using Duration = std::chrono::duration<Rep, Period>;
using dfs = decimal_format_seconds<
typename std::common_type<Duration, std::chrono::seconds>::type>;
using precision = typename dfs::precision;
private:
using base = detail::time_of_day_base;
std::chrono::minutes m_;
dfs s_;
public:
CONSTCD11 time_of_day_storage() NOEXCEPT : base(), m_(0), s_() {}
CONSTCD11 explicit time_of_day_storage(Duration since_midnight) NOEXCEPT
: base(date::trunc<std::chrono::hours>(since_midnight),
since_midnight < Duration{0}, is24hr),
m_(date::trunc<std::chrono::minutes>(detail::abs(since_midnight) - h_)),
s_(detail::abs(since_midnight) - h_ - m_) {}
CONSTCD11 explicit time_of_day_storage(std::chrono::hours h, std::chrono::minutes m,
std::chrono::seconds s, precision sub_s,
unsigned md) NOEXCEPT : base(h, false, md),
m_(m),
s_(s + sub_s) {}
CONSTCD11 std::chrono::hours hours() const NOEXCEPT { return h_; }
CONSTCD11 std::chrono::minutes minutes() const NOEXCEPT { return m_; }
CONSTCD14 std::chrono::seconds& seconds() NOEXCEPT { return s_.seconds(); }
CONSTCD11 std::chrono::seconds seconds() const NOEXCEPT { return s_.seconds(); }
CONSTCD11 precision subseconds() const NOEXCEPT { return s_.subseconds(); }
CONSTCD11 unsigned mode() const NOEXCEPT { return mode_; }
CONSTCD14 explicit operator precision() const NOEXCEPT {
auto p = to24hr() + s_.to_duration() + m_;
if (neg_) p = -p;
return p;
}
CONSTCD14 precision to_duration() const NOEXCEPT {
return static_cast<precision>(*this);
}
CONSTCD14 time_of_day_storage& make24() NOEXCEPT {
base::make24();
return *this;
}
CONSTCD14 time_of_day_storage& make12() NOEXCEPT {
base::make12();
return *this;
}
CONSTCD11 bool in_conventional_range() const NOEXCEPT {
return base::in_conventional_range() && m_ < std::chrono::hours {1} &&
s_.in_conventional_range();
}
template <class CharT, class Traits>
friend std::basic_ostream<CharT, Traits>& operator<<(
std::basic_ostream<CharT, Traits>& os, const time_of_day_storage& t) {
detail::save_ostream<CharT, Traits> _(os);
if (t.neg_) os << '-';
os.fill('0');
os.flags(std::ios::dec | std::ios::right);
if (t.mode_ != am && t.mode_ != pm) os.width(2);
os << t.h_.count() << ':';
os.width(2);
os << t.m_.count() << ':' << t.s_;
switch (t.mode_) {
case am:
os << "am";
break;
case pm:
os << "pm";
break;
}
return os;
}
template <class CharT, class Traits, class Duration>
friend std::basic_ostream<CharT, Traits>& date::to_stream(
std::basic_ostream<CharT, Traits>& os, const CharT* fmt,
const fields<Duration>& fds, const std::string* abbrev,
const std::chrono::seconds* offset_sec);
template <class CharT, class Traits, class Duration, class Alloc>
friend std::basic_istream<CharT, Traits>& date::from_stream(
std::basic_istream<CharT, Traits>& is, const CharT* fmt, fields<Duration>& fds,
std::basic_string<CharT, Traits, Alloc>* abbrev, std::chrono::minutes* offset);
};
} // namespace detail
template <class Duration>
class time_of_day : public detail::time_of_day_storage<Duration> {
using base = detail::time_of_day_storage<Duration>;
public:
#if !defined(_MSC_VER) || _MSC_VER >= 1900
CONSTCD11 time_of_day() NOEXCEPT = default;
#else
CONSTCD11 time_of_day() = default;
#endif /* !defined(_MSC_VER) || _MSC_VER >= 1900 */
CONSTCD11 explicit time_of_day(Duration since_midnight) NOEXCEPT
: base(since_midnight) {}
template <class Arg0, class Arg1, class... Args>
CONSTCD11 explicit time_of_day(Arg0&& arg0, Arg1&& arg1, Args&&... args) NOEXCEPT
: base(std::forward<Arg0>(arg0), std::forward<Arg1>(arg1),
std::forward<Args>(args)...) {}
};
template <class Rep, class Period,
class = typename std::enable_if<
!std::chrono::treat_as_floating_point<Rep>::value>::type>
CONSTCD11 inline time_of_day<std::chrono::duration<Rep, Period>> make_time(
const std::chrono::duration<Rep, Period>& d) {
return time_of_day<std::chrono::duration<Rep, Period>>(d);
}
CONSTCD11
inline time_of_day<std::chrono::hours> make_time(const std::chrono::hours& h,
unsigned md) {
return time_of_day<std::chrono::hours>(h, md);
}
CONSTCD11
inline time_of_day<std::chrono::minutes> make_time(const std::chrono::hours& h,
const std::chrono::minutes& m,
unsigned md) {
return time_of_day<std::chrono::minutes>(h, m, md);
}
CONSTCD11
inline time_of_day<std::chrono::seconds> make_time(const std::chrono::hours& h,
const std::chrono::minutes& m,
const std::chrono::seconds& s,
unsigned md) {
return time_of_day<std::chrono::seconds>(h, m, s, md);
}
template <
class Rep, class Period,
class = typename std::enable_if<std::ratio_less<Period, std::ratio<1>>::value>::type>
CONSTCD11 inline time_of_day<std::chrono::duration<Rep, Period>> make_time(
const std::chrono::hours& h, const std::chrono::minutes& m,
const std::chrono::seconds& s, const std::chrono::duration<Rep, Period>& sub_s,
unsigned md) {
return time_of_day<std::chrono::duration<Rep, Period>>(h, m, s, sub_s, md);
}
template <class CharT, class Traits, class Duration>
inline typename std::enable_if<
!std::chrono::treat_as_floating_point<typename Duration::rep>::value &&
std::ratio_less<typename Duration::period, days::period>::value,
std::basic_ostream<CharT, Traits>&>::type
operator<<(std::basic_ostream<CharT, Traits>& os, const sys_time<Duration>& tp) {
auto const dp = date::floor<days>(tp);
return os << year_month_day(dp) << ' ' << make_time(tp - dp);
}
template <class CharT, class Traits>
inline std::basic_ostream<CharT, Traits>& operator<<(
std::basic_ostream<CharT, Traits>& os, const sys_days& dp) {
return os << year_month_day(dp);
}
template <class CharT, class Traits, class Duration>
inline std::basic_ostream<CharT, Traits>& operator<<(
std::basic_ostream<CharT, Traits>& os, const local_time<Duration>& ut) {
return (os << sys_time<Duration>{ut.time_since_epoch()});
}
// to_stream
CONSTDATA year nanyear{-32768};
template <class Duration>
struct fields {
year_month_day ymd{nanyear / 0 / 0};
weekday wd{8u};
time_of_day<Duration> tod{};
bool has_tod = false;
fields() = default;
explicit fields(year_month_day ymd_) : ymd(ymd_) {}
explicit fields(weekday wd_) : wd(wd_) {}
explicit fields(time_of_day<Duration> tod_) : tod(tod_), has_tod(true) {}
fields(year_month_day ymd_, weekday wd_) : ymd(ymd_), wd(wd_) {}
fields(year_month_day ymd_, time_of_day<Duration> tod_)
: ymd(ymd_), tod(tod_), has_tod(true) {}
fields(weekday wd_, time_of_day<Duration> tod_) : wd(wd_), tod(tod_), has_tod(true) {}
fields(year_month_day ymd_, weekday wd_, time_of_day<Duration> tod_)
: ymd(ymd_), wd(wd_), tod(tod_), has_tod(true) {}
};
namespace detail {
template <class CharT, class Traits, class Duration>
unsigned extract_weekday(std::basic_ostream<CharT, Traits>& os,
const fields<Duration>& fds) {
if (!fds.ymd.ok() && !fds.wd.ok()) {
// fds does not contain a valid weekday
os.setstate(std::ios::failbit);
return 8;
}
weekday wd;
if (fds.ymd.ok()) {
wd = weekday{sys_days(fds.ymd)};
if (fds.wd.ok() && wd != fds.wd) {
// fds.ymd and fds.wd are inconsistent
os.setstate(std::ios::failbit);
return 8;
}
} else {
wd = fds.wd;
}
return static_cast<unsigned>((wd - Sunday).count());
}
template <class CharT, class Traits, class Duration>
unsigned extract_month(std::basic_ostream<CharT, Traits>& os,
const fields<Duration>& fds) {
if (!fds.ymd.month().ok()) {
// fds does not contain a valid month
os.setstate(std::ios::failbit);
return 0;
}
return static_cast<unsigned>(fds.ymd.month());
}
} // namespace detail
#if ONLY_C_LOCALE
namespace detail {
inline std::pair<const std::string*, const std::string*> weekday_names() {
static const string nm[] = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday",
"Friday", "Saturday", "Sun", "Mon", "Tue",
"Wed", "Thu", "Fri", "Sat"};
return make_pair(nm, nm + sizeof(nm) / sizeof(nm[0]));
}
inline std::pair<const std::string*, const std::string*> month_names() {
static const string nm[] = {
"January", "February", "March", "April", "May", "June", "July", "August",
"September", "October", "November", "December", "Jan", "Feb", "Mar", "Apr",
"May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
return make_pair(nm, nm + sizeof(nm) / sizeof(nm[0]));
}
inline std::pair<const std::string*, const std::string*> ampm_names() {
static const string nm[] = {"AM", "PM"};
return make_pair(nm, nm + sizeof(nm) / sizeof(nm[0]));
}
template <class CharT, class Traits, class FwdIter>
FwdIter scan_keyword(std::basic_istream<CharT, Traits>& is, FwdIter kb, FwdIter ke) {
size_t nkw = static_cast<size_t>(std::distance(kb, ke));
const unsigned char doesnt_match = '\0';
const unsigned char might_match = '\1';
const unsigned char does_match = '\2';
unsigned char statbuf[100];
unsigned char* status = statbuf;
unique_ptr<unsigned char, void (*)(void*)> stat_hold(0, free);
if (nkw > sizeof(statbuf)) {
status = (unsigned char*)malloc(nkw);
if (status == nullptr) throw bad_alloc();
stat_hold.reset(status);
}
size_t n_might_match = nkw; // At this point, any keyword might match
size_t n_does_match = 0; // but none of them definitely do
// Initialize all statuses to might_match, except for "" keywords are does_match
unsigned char* st = status;
for (auto ky = kb; ky != ke; ++ky, ++st) {
if (!ky->empty()) {
*st = might_match;
} else {
*st = does_match;
--n_might_match;
++n_does_match;
}
}
// While there might be a match, test keywords against the next CharT
for (size_t indx = 0; is && n_might_match > 0; ++indx) {
// Peek at the next CharT but don't consume it
auto ic = is.peek();
if (ic == EOF) {
is.setstate(ios::eofbit);
break;
}
auto c = static_cast<char>(toupper(ic));
bool consume = false;
// For each keyword which might match, see if the indx character is c
// If a match if found, consume c
// If a match is found, and that is the last character in the keyword,
// then that keyword matches.
// If the keyword doesn't match this character, then change the keyword
// to doesn't match
st = status;
for (auto ky = kb; ky != ke; ++ky, ++st) {
if (*st == might_match) {
if (c == static_cast<char>(toupper((*ky)[indx]))) {
consume = true;
if (ky->size() == indx + 1) {
*st = does_match;
--n_might_match;
++n_does_match;
}
} else {
*st = doesnt_match;
--n_might_match;
}
}
}
// consume if we matched a character
if (consume) {
(void)is.get();
// If we consumed a character and there might be a matched keyword that
// was marked matched on a previous iteration, then such keywords
// are now marked as not matching.
if (n_might_match + n_does_match > 1) {
st = status;
for (auto ky = kb; ky != ke; ++ky, ++st) {
if (*st == does_match && ky->size() != indx + 1) {
*st = doesnt_match;
--n_does_match;
}
}
}
}
}
// We've exited the loop because we hit eof and/or we have no more "might matches".
// Return the first matching result
for (st = status; kb != ke; ++kb, ++st)
if (*st == does_match) break;
if (kb == ke) is.setstate(ios_base::failbit);
return kb;
}
} // namespace detail
#endif // ONLY_C_LOCALE
template <class CharT, class Traits, class Duration>
std::basic_ostream<CharT, Traits>& to_stream(std::basic_ostream<CharT, Traits>& os,
const CharT* fmt,
const fields<Duration>& fds,
const std::string* abbrev,
const std::chrono::seconds* offset_sec) {
using std::chrono::duration_cast;
using std::chrono::duration;
using std::use_facet;
using std::chrono::hours;
using std::chrono::minutes;
using detail::save_ostream;
using std::ios;
using std::time_put;
date::detail::save_ostream<CharT, Traits> ss(os);
os.fill(' ');
os.flags(std::ios::skipws | std::ios::dec);
os.width(0);
tm tm{};
bool insert_negative = fds.has_tod && fds.tod.to_duration() < Duration::zero();
#if !ONLY_C_LOCALE
auto& facet = use_facet<time_put<CharT>>(os.getloc());
#endif
const CharT* command = nullptr;
CharT modified = CharT{};
for (; *fmt; ++fmt) {
switch (*fmt) {
case 'a':
case 'A':
if (command) {
if (modified == CharT{}) {
tm.tm_wday = static_cast<int>(extract_weekday(os, fds));
if (os.fail()) return os;
#if !ONLY_C_LOCALE
const CharT f[] = {'%', *fmt};
facet.put(os, os, os.fill(), &tm, begin(f), end(f));
#else // ONLY_C_LOCALE
os << weekday_names().first[tm.tm_wday + 7 * (*fmt == 'a')];
#endif // ONLY_C_LOCALE
} else {
os << CharT{'%'} << modified << *fmt;
modified = CharT{};
}
command = nullptr;
} else {
os << *fmt;
}
break;
case 'b':
case 'B':
case 'h':
if (command) {
if (modified == CharT{}) {
tm.tm_mon = static_cast<int>(extract_month(os, fds)) - 1;
#if !ONLY_C_LOCALE
const CharT f[] = {'%', *fmt};
facet.put(os, os, os.fill(), &tm, begin(f), end(f));
#else // ONLY_C_LOCALE
os << month_names().first[tm.tm_mon + 12 * (*fmt != 'B')];
#endif // ONLY_C_LOCALE
} else {
os << CharT{'%'} << modified << *fmt;
modified = CharT{};
}
command = nullptr;
} else {
os << *fmt;
}
break;
case 'c':
case 'x':
if (command) {
if (modified == CharT{'O'}) {
os << CharT{'%'} << modified << *fmt;
} else {
if (!fds.ymd.ok()) os.setstate(std::ios::failbit);
if (*fmt == 'c' && !fds.has_tod) os.setstate(std::ios::failbit);
#if !ONLY_C_LOCALE
tm = std::tm{};
auto const& ymd = fds.ymd;
auto ld = local_days(ymd);
if (*fmt == 'c') {
tm.tm_sec = static_cast<int>(fds.tod.seconds().count());
tm.tm_min = static_cast<int>(fds.tod.minutes().count());
tm.tm_hour = static_cast<int>(fds.tod.hours().count());
}
tm.tm_mday = static_cast<int>(static_cast<unsigned>(ymd.day()));
tm.tm_mon = static_cast<int>(extract_month(os, fds) - 1);
tm.tm_year = static_cast<int>(ymd.year()) - 1900;
tm.tm_wday = static_cast<int>(extract_weekday(os, fds));
if (os.fail()) return os;
tm.tm_yday = static_cast<int>((ld - local_days(ymd.year() / 1 / 1)).count());
CharT f[3] = {'%'};
auto fe = begin(f) + 1;
if (modified == CharT{'E'}) *fe++ = modified;
*fe++ = *fmt;
facet.put(os, os, os.fill(), &tm, begin(f), fe);
#else // ONLY_C_LOCALE
if (*fmt == 'c') {
auto wd = static_cast<int>(extract_weekday(os, fds));
os << weekday_names().first[static_cast<unsigned>(wd) + 7] << ' ';
os << month_names().first[extract_month(os, fds) - 1 + 12] << ' ';
auto d = static_cast<int>(static_cast<unsigned>(fds.ymd.day()));
if (d < 10) {
os << ' ';
}
os << d << ' ' << make_time(duration_cast<seconds>(fds.tod.to_duration()))
<< ' ' << fds.ymd.year();
} else { // *fmt == 'x'
auto const& ymd = fds.ymd;
save_ostream<CharT, Traits> _(os);
os.fill('0');
os.flags(std::ios::dec | std::ios::right);
os.width(2);
os << static_cast<unsigned>(ymd.month()) << CharT{'/'};
os.width(2);
os << static_cast<unsigned>(ymd.day()) << CharT{'/'};
os.width(2);
os << static_cast<int>(ymd.year()) % 100;
}
#endif // ONLY_C_LOCALE
}
command = nullptr;
modified = CharT{};
} else {
os << *fmt;
}
break;
case 'C':
if (command) {
if (modified == CharT{'O'}) {
os << CharT{'%'} << modified << *fmt;
} else {
if (!fds.ymd.year().ok()) os.setstate(std::ios::failbit);
auto y = static_cast<int>(fds.ymd.year());
#if !ONLY_C_LOCALE
if (modified == CharT{})
#endif
{
save_ostream<CharT, Traits> _(os);
os.fill('0');
os.flags(std::ios::dec | std::ios::right);
if (y >= 0) {
os.width(2);
os << y / 100;
} else {
os << CharT{'-'};
os.width(2);
os << -(y - 99) / 100;
}
}
#if !ONLY_C_LOCALE
else if (modified == CharT{'E'}) {
tm.tm_year = y - 1900;
CharT f[3] = {'%', 'E', 'C'};
facet.put(os, os, os.fill(), &tm, begin(f), end(f));
}
#endif
}
command = nullptr;
modified = CharT{};
} else {
os << *fmt;
}
break;
case 'd':
case 'e':
if (command) {
if (modified == CharT{'E'}) {
os << CharT{'%'} << modified << *fmt;
} else {
if (!fds.ymd.day().ok()) os.setstate(std::ios::failbit);
auto d = static_cast<int>(static_cast<unsigned>(fds.ymd.day()));
#if !ONLY_C_LOCALE
if (modified == CharT{})
#endif
{
save_ostream<CharT, Traits> _(os);
if (*fmt == CharT{'d'}) {
os.fill('0');
} else {
os.fill(' ');
}
os.flags(std::ios::dec | std::ios::right);
os.width(2);
os << d;
}
#if !ONLY_C_LOCALE
else if (modified == CharT{'O'}) {
tm.tm_mday = d;
CharT f[3] = {'%', 'O', *fmt};
facet.put(os, os, os.fill(), &tm, begin(f), end(f));
}
#endif
}
command = nullptr;
modified = CharT{};
} else {
os << *fmt;
}
break;
case 'D':
if (command) {
if (modified == CharT{}) {
if (!fds.ymd.ok()) {
os.setstate(std::ios::failbit);
}
auto const& ymd = fds.ymd;
save_ostream<CharT, Traits> _(os);
os.fill('0');
os.flags(std::ios::dec | std::ios::right);
os.width(2);
os << static_cast<unsigned>(ymd.month()) << CharT{'/'};
os.width(2);
os << static_cast<unsigned>(ymd.day()) << CharT{'/'};
os.width(2);
os << static_cast<int>(ymd.year()) % 100;
} else {
os << CharT{'%'} << modified << *fmt;
modified = CharT{};
}
command = nullptr;
} else {
os << *fmt;
}
break;
case 'F':
if (command) {
if (modified == CharT{}) {
if (!fds.ymd.ok()) {
os.setstate(std::ios::failbit);
}
auto const& ymd = fds.ymd;
save_ostream<CharT, Traits> _(os);
os.fill('0');
os.flags(std::ios::dec | std::ios::right);
os.width(4);
os << static_cast<int>(ymd.year()) << CharT{'-'};
os.width(2);
os << static_cast<unsigned>(ymd.month()) << CharT{'-'};
os.width(2);
os << static_cast<unsigned>(ymd.day());
} else {
os << CharT{'%'} << modified << *fmt;
modified = CharT{};
}
command = nullptr;
} else {
os << *fmt;
}
break;
case 'g':
case 'G':
if (command) {
if (modified == CharT{}) {
if (!fds.ymd.ok()) os.setstate(std::ios::failbit);
auto ld = local_days(fds.ymd);
auto y = year_month_day{ld + days{3}}.year();
auto start = local_days((y - years{1}) / December / Thursday[last]) +
(Monday - Thursday);
if (ld < start) {
--y;
}
if (*fmt == CharT{'G'}) {
os << y;
} else {
save_ostream<CharT, Traits> _(os);
os.fill('0');
os.flags(std::ios::dec | std::ios::right);
os.width(2);
os << std::abs(static_cast<int>(y)) % 100;
}
} else {
os << CharT{'%'} << modified << *fmt;
modified = CharT{};
}
command = nullptr;
} else {
os << *fmt;
}
break;
case 'H':
case 'I':
if (command) {
if (modified == CharT{'E'}) {
os << CharT{'%'} << modified << *fmt;
} else {
if (!fds.has_tod) {
os.setstate(std::ios::failbit);
}
if (insert_negative) {
os << '-';
insert_negative = false;
}
auto hms = fds.tod;
#if !ONLY_C_LOCALE
if (modified == CharT{})
#endif
{
if (*fmt == CharT{'I'}) hms.make12();
if (hms.hours() < hours{10}) os << CharT{'0'};
os << hms.hours().count();
}
#if !ONLY_C_LOCALE
else if (modified == CharT{'O'}) {
const CharT f[] = {'%', modified, *fmt};
tm.tm_hour = static_cast<int>(hms.hours().count());
facet.put(os, os, os.fill(), &tm, begin(f), end(f));
}
#endif
}
modified = CharT{};
command = nullptr;
} else {
os << *fmt;
}
break;
case 'j':
if (command) {
if (modified == CharT{}) {
if (!fds.ymd.ok()) {
os.setstate(std::ios::failbit);
}
auto ld = local_days(fds.ymd);
auto y = fds.ymd.year();
auto doy = ld - local_days(y / January / 1) + days{1};
save_ostream<CharT, Traits> _(os);
os.fill('0');
os.flags(std::ios::dec | std::ios::right);
os.width(3);
os << doy.count();
} else {
os << CharT{'%'} << modified << *fmt;
modified = CharT{};
}
command = nullptr;
} else {
os << *fmt;
}
break;
case 'm':
if (command) {
if (modified == CharT{'E'}) {
os << CharT{'%'} << modified << *fmt;
} else {
if (!fds.ymd.month().ok()) os.setstate(std::ios::failbit);
auto m = static_cast<unsigned>(fds.ymd.month());
#if !ONLY_C_LOCALE
if (modified == CharT{})
#endif
{
if (m < 10) os << CharT{'0'};
os << m;
}
#if !ONLY_C_LOCALE
else if (modified == CharT{'O'}) {
const CharT f[] = {'%', modified, *fmt};
tm.tm_mon = static_cast<int>(m - 1);
facet.put(os, os, os.fill(), &tm, begin(f), end(f));
}
#endif
}
modified = CharT{};
command = nullptr;
} else {
os << *fmt;
}
break;
case 'M':
if (command) {
if (modified == CharT{'E'}) {
os << CharT{'%'} << modified << *fmt;
} else {
if (!fds.has_tod) os.setstate(std::ios::failbit);
if (insert_negative) {
os << '-';
insert_negative = false;
}
#if !ONLY_C_LOCALE
if (modified == CharT{})
#endif
{
if (fds.tod.minutes() < minutes{10}) os << CharT{'0'};
os << fds.tod.minutes().count();
}
#if !ONLY_C_LOCALE
else if (modified == CharT{'O'}) {
const CharT f[] = {'%', modified, *fmt};
tm.tm_min = static_cast<int>(fds.tod.minutes().count());
facet.put(os, os, os.fill(), &tm, begin(f), end(f));
}
#endif
}
modified = CharT{};
command = nullptr;
} else {
os << *fmt;
}
break;
case 'n':
if (command) {
if (modified == CharT{})
os << CharT{'\n'};
else {
os << CharT{'%'} << modified << *fmt;
modified = CharT{};
}
command = nullptr;
} else {
os << *fmt;
}
break;
case 'p':
if (command) {
if (modified == CharT{}) {
if (!fds.has_tod) os.setstate(std::ios::failbit);
#if !ONLY_C_LOCALE
const CharT f[] = {'%', *fmt};
tm.tm_hour = static_cast<int>(fds.tod.hours().count());
facet.put(os, os, os.fill(), &tm, begin(f), end(f));
#else
if (fds.tod.hours() < hours {12}) {
os << ampm_names().first[0];
} else {
os << ampm_names().first[1];
}
#endif
} else {
os << CharT{'%'} << modified << *fmt;
}
modified = CharT{};
command = nullptr;
} else {
os << *fmt;
}
break;
case 'r':
if (command) {
if (modified == CharT{}) {
if (!fds.has_tod) os.setstate(std::ios::failbit);
#if !ONLY_C_LOCALE
const CharT f[] = {'%', *fmt};
tm.tm_hour = static_cast<int>(fds.tod.hours().count());
tm.tm_min = static_cast<int>(fds.tod.minutes().count());
tm.tm_sec = static_cast<int>(fds.tod.seconds().count());
facet.put(os, os, os.fill(), &tm, begin(f), end(f));
#else
time_of_day<seconds> tod(duration_cast<seconds>(fds.tod.to_duration()));
tod.make12();
save_ostream<CharT, Traits> _(os);
os.fill('0');
os.width(2);
os << tod.hours().count() << CharT{':'};
os.width(2);
os << tod.minutes().count() << CharT{':'};
os.width(2);
os << tod.seconds().count() << CharT{' '};
tod.make24();
if (tod.hours() < hours {12}) {
os << ampm_names().first[0];
} else {
os << ampm_names().first[1];
}
#endif
} else {
os << CharT{'%'} << modified << *fmt;
}
modified = CharT{};
command = nullptr;
} else {
os << *fmt;
}
break;
case 'R':
if (command) {
if (modified == CharT{}) {
if (!fds.has_tod) { os.setstate(std::ios::failbit); }
if (fds.tod.hours() < hours{10}) { os << CharT{'0'}; }
os << fds.tod.hours().count() << CharT{':'};
if (fds.tod.minutes() < minutes{10}) { os << CharT{'0'}; }
os << fds.tod.minutes().count();
} else {
os << CharT{'%'} << modified << *fmt;
modified = CharT{};
}
command = nullptr;
} else {
os << *fmt;
}
break;
case 'S':
if (command) {
if (modified == CharT{'E'}) {
os << CharT{'%'} << modified << *fmt;
} else {
if (!fds.has_tod) os.setstate(std::ios::failbit);
if (insert_negative) {
os << '-';
insert_negative = false;
}
#if !ONLY_C_LOCALE
if (modified == CharT{})
#endif
{
os << fds.tod.s_;
}
#if !ONLY_C_LOCALE
else if (modified == CharT{'O'}) {
const CharT f[] = {'%', modified, *fmt};
tm.tm_sec = static_cast<int>(fds.tod.s_.seconds().count());
facet.put(os, os, os.fill(), &tm, begin(f), end(f));
}
#endif
}
modified = CharT{};
command = nullptr;
} else {
os << *fmt;
}
break;
case 't':
if (command) {
if (modified == CharT{}) {
os << CharT{'\t'};
} else {
os << CharT{'%'} << modified << *fmt;
modified = CharT{};
}
command = nullptr;
} else {
os << *fmt;
}
break;
case 'T':
if (command) {
if (modified == CharT{}) {
if (!fds.has_tod) os.setstate(std::ios::failbit);
os << fds.tod;
} else {
os << CharT{'%'} << modified << *fmt;
modified = CharT{};
}
command = nullptr;
} else {
os << *fmt;
}
break;
case 'u':
if (command) {
if (modified == CharT{'E'}) {
os << CharT{'%'} << modified << *fmt;
}
else {
auto wd = extract_weekday(os, fds);
#if !ONLY_C_LOCALE
if (modified == CharT{})
#endif
{
os << (wd != 0 ? wd : 7u);
}
#if !ONLY_C_LOCALE
else if (modified == CharT{'O'}) {
const CharT f[] = {'%', modified, *fmt};
tm.tm_wday = static_cast<int>(wd);
facet.put(os, os, os.fill(), &tm, begin(f), end(f));
}
#endif
}
modified = CharT{};
command = nullptr;
} else {
os << *fmt;
}
break;
case 'U':
if (command) {
if (modified == CharT{'E'}) {
os << CharT{'%'} << modified << *fmt;
} else {
auto const& ymd = fds.ymd;
if (!ymd.ok()) os.setstate(std::ios::failbit);
auto ld = local_days(ymd);
#if !ONLY_C_LOCALE
if (modified == CharT{})
#endif
{
auto st = local_days(Sunday[1] / January / ymd.year());
if (ld < st)
os << CharT{'0'} << CharT{'0'};
else {
auto wn = duration_cast<weeks>(ld - st).count() + 1;
if (wn < 10) os << CharT{'0'};
os << wn;
}
}
#if !ONLY_C_LOCALE
else if (modified == CharT{'O'}) {
const CharT f[] = {'%', modified, *fmt};
tm.tm_year = static_cast<int>(ymd.year()) - 1900;
tm.tm_wday = static_cast<int>(extract_weekday(os, fds));
if (os.fail()) return os;
tm.tm_yday =
static_cast<int>((ld - local_days(ymd.year() / 1 / 1)).count());
facet.put(os, os, os.fill(), &tm, begin(f), end(f));
}
#endif
}
modified = CharT{};
command = nullptr;
} else {
os << *fmt;
}
break;
case 'V':
if (command) {
if (modified == CharT{'E'}) {
os << CharT{'%'} << modified << *fmt;
} else {
if (!fds.ymd.ok()) os.setstate(std::ios::failbit);
auto ld = local_days(fds.ymd);
#if !ONLY_C_LOCALE
if (modified == CharT{})
#endif
{
auto y = year_month_day{ld + days{3}}.year();
auto st =
local_days((y - years{1}) / 12 / Thursday[last]) + (Monday - Thursday);
if (ld < st) {
--y;
st = local_days((y - years{1}) / 12 / Thursday[last]) +
(Monday - Thursday);
}
auto wn = duration_cast<weeks>(ld - st).count() + 1;
if (wn < 10) os << CharT{'0'};
os << wn;
}
#if !ONLY_C_LOCALE
else if (modified == CharT{'O'}) {
const CharT f[] = {'%', modified, *fmt};
auto const& ymd = fds.ymd;
tm.tm_year = static_cast<int>(ymd.year()) - 1900;
tm.tm_wday = static_cast<int>(extract_weekday(os, fds));
if (os.fail()) return os;
tm.tm_yday =
static_cast<int>((ld - local_days(ymd.year() / 1 / 1)).count());
facet.put(os, os, os.fill(), &tm, begin(f), end(f));
}
#endif
}
modified = CharT{};
command = nullptr;
} else {
os << *fmt;
}
break;
case 'w':
if (command) {
auto wd = extract_weekday(os, fds);
if (os.fail()) return os;
#if !ONLY_C_LOCALE
if (modified == CharT{})
#else
if (modified != CharT{'E'})
#endif
{
os << wd;
}
#if !ONLY_C_LOCALE
else if (modified == CharT{'O'}) {
const CharT f[] = {'%', modified, *fmt};
tm.tm_wday = static_cast<int>(wd);
facet.put(os, os, os.fill(), &tm, begin(f), end(f));
}
#endif
else {
os << CharT{'%'} << modified << *fmt;
}
modified = CharT{};
command = nullptr;
} else {
os << *fmt;
}
break;
case 'W':
if (command) {
if (modified == CharT{'E'}) {
os << CharT{'%'} << modified << *fmt;
} else {
auto const& ymd = fds.ymd;
if (!ymd.ok()) os.setstate(std::ios::failbit);
auto ld = local_days(ymd);
#if !ONLY_C_LOCALE
if (modified == CharT{})
#endif
{
auto st = local_days(Monday[1] / January / ymd.year());
if (ld < st)
os << CharT{'0'} << CharT{'0'};
else {
auto wn = duration_cast<weeks>(ld - st).count() + 1;
if (wn < 10) os << CharT{'0'};
os << wn;
}
}
#if !ONLY_C_LOCALE
else if (modified == CharT{'O'}) {
const CharT f[] = {'%', modified, *fmt};
tm.tm_year = static_cast<int>(ymd.year()) - 1900;
tm.tm_wday = static_cast<int>(extract_weekday(os, fds));
if (os.fail()) return os;
tm.tm_yday =
static_cast<int>((ld - local_days(ymd.year() / 1 / 1)).count());
facet.put(os, os, os.fill(), &tm, begin(f), end(f));
}
#endif
}
modified = CharT{};
command = nullptr;
} else
os << *fmt;
break;
case 'X':
if (command) {
if (modified == CharT{'O'})
os << CharT{'%'} << modified << *fmt;
else {
if (!fds.has_tod) os.setstate(std::ios::failbit);
#if !ONLY_C_LOCALE
tm = std::tm{};
tm.tm_sec = static_cast<int>(fds.tod.seconds().count());
tm.tm_min = static_cast<int>(fds.tod.minutes().count());
tm.tm_hour = static_cast<int>(fds.tod.hours().count());
CharT f[3] = {'%'};
auto fe = begin(f) + 1;
if (modified == CharT{'E'}) *fe++ = modified;
*fe++ = *fmt;
facet.put(os, os, os.fill(), &tm, begin(f), fe);
#else
os << fds.tod;
#endif
}
command = nullptr;
modified = CharT{};
} else
os << *fmt;
break;
case 'y':
if (command) {
if (!fds.ymd.year().ok()) os.setstate(std::ios::failbit);
auto y = static_cast<int>(fds.ymd.year());
#if !ONLY_C_LOCALE
if (modified == CharT{}) {
#endif
y = std::abs(y) % 100;
if (y < 10) os << CharT{'0'};
os << y;
#if !ONLY_C_LOCALE
} else {
const CharT f[] = {'%', modified, *fmt};
tm.tm_year = y - 1900;
facet.put(os, os, os.fill(), &tm, begin(f), end(f));
}
#endif
modified = CharT{};
command = nullptr;
} else
os << *fmt;
break;
case 'Y':
if (command) {
if (modified == CharT{'O'})
os << CharT{'%'} << modified << *fmt;
else {
if (!fds.ymd.year().ok()) os.setstate(std::ios::failbit);
auto y = fds.ymd.year();
#if !ONLY_C_LOCALE
if (modified == CharT{})
#endif
{
os << y;
}
#if !ONLY_C_LOCALE
else if (modified == CharT{'E'}) {
const CharT f[] = {'%', modified, *fmt};
tm.tm_year = static_cast<int>(y) - 1900;
facet.put(os, os, os.fill(), &tm, begin(f), end(f));
}
#endif
}
modified = CharT{};
command = nullptr;
} else
os << *fmt;
break;
case 'z':
if (command) {
if (offset_sec == nullptr) {
// Can not format %z with unknown offset
os.setstate(ios::failbit);
return os;
}
auto m = duration_cast<minutes>(*offset_sec);
auto neg = m < minutes{0};
m = date::abs(m);
auto h = duration_cast<hours>(m);
m -= h;
if (neg)
os << CharT{'-'};
else
os << CharT{'+'};
if (h < hours{10}) os << CharT{'0'};
os << h.count();
if (modified != CharT{}) os << CharT{':'};
if (m < minutes{10}) os << CharT{'0'};
os << m.count();
command = nullptr;
modified = CharT{};
} else
os << *fmt;
break;
case 'Z':
if (command) {
if (modified == CharT{}) {
if (abbrev == nullptr) {
// Can not format %Z with unknown time_zone
os.setstate(ios::failbit);
return os;
}
for (auto c : *abbrev) os << CharT(c);
} else {
os << CharT{'%'} << modified << *fmt;
modified = CharT{};
}
command = nullptr;
} else
os << *fmt;
break;
case 'E':
case 'O':
if (command) {
if (modified == CharT{}) {
modified = *fmt;
} else {
os << CharT{'%'} << modified << *fmt;
command = nullptr;
modified = CharT{};
}
} else
os << *fmt;
break;
case '%':
if (command) {
if (modified == CharT{}) {
os << CharT{'%'};
command = nullptr;
} else {
os << CharT{'%'} << modified << CharT{'%'};
command = nullptr;
modified = CharT{};
}
} else
command = fmt;
break;
default:
if (command) {
os << CharT{'%'};
command = nullptr;
}
if (modified != CharT{}) {
os << modified;
modified = CharT{};
}
os << *fmt;
break;
}
}
if (command) os << CharT{'%'};
if (modified != CharT{}) os << modified;
return os;
}
template <class CharT, class Traits>
inline std::basic_ostream<CharT, Traits>& to_stream(std::basic_ostream<CharT, Traits>& os,
const CharT* fmt, const year& y) {
using CT = std::chrono::seconds;
fields<CT> fds{y / 0 / 0};
return to_stream(os, fmt, fds);
}
template <class CharT, class Traits>
inline std::basic_ostream<CharT, Traits>& to_stream(std::basic_ostream<CharT, Traits>& os,
const CharT* fmt, const month& m) {
using CT = std::chrono::seconds;
fields<CT> fds{m / 0 / nanyear};
return to_stream(os, fmt, fds);
}
template <class CharT, class Traits>
inline std::basic_ostream<CharT, Traits>& to_stream(std::basic_ostream<CharT, Traits>& os,
const CharT* fmt, const day& d) {
using CT = std::chrono::seconds;
fields<CT> fds{d / 0 / nanyear};
return to_stream(os, fmt, fds);
}
template <class CharT, class Traits>
inline std::basic_ostream<CharT, Traits>& to_stream(std::basic_ostream<CharT, Traits>& os,
const CharT* fmt, const weekday& wd) {
using CT = std::chrono::seconds;
fields<CT> fds{wd};
return to_stream(os, fmt, fds);
}
template <class CharT, class Traits>
inline std::basic_ostream<CharT, Traits>& to_stream(std::basic_ostream<CharT, Traits>& os,
const CharT* fmt,
const year_month& ym) {
using CT = std::chrono::seconds;
fields<CT> fds{ym / 0};
return to_stream(os, fmt, fds);
}
template <class CharT, class Traits>
inline std::basic_ostream<CharT, Traits>& to_stream(std::basic_ostream<CharT, Traits>& os,
const CharT* fmt,
const month_day& md) {
using CT = std::chrono::seconds;
fields<CT> fds{md / nanyear};
return to_stream(os, fmt, fds);
}
template <class CharT, class Traits>
inline std::basic_ostream<CharT, Traits>& to_stream(std::basic_ostream<CharT, Traits>& os,
const CharT* fmt,
const year_month_day& ymd) {
using CT = std::chrono::seconds;
fields<CT> fds{ymd};
return to_stream(os, fmt, fds);
}
template <class CharT, class Traits, class Rep, class Period>
inline std::basic_ostream<CharT, Traits>& to_stream(
std::basic_ostream<CharT, Traits>& os, const CharT* fmt,
const std::chrono::duration<Rep, Period>& d) {
using Duration = std::chrono::duration<Rep, Period>;
using CT = typename std::common_type<Duration, std::chrono::seconds>::type;
fields<CT> fds{time_of_day<CT>{d}};
return to_stream(os, fmt, fds);
}
template <class CharT, class Traits, class Duration>
std::basic_ostream<CharT, Traits>& to_stream(
std::basic_ostream<CharT, Traits>& os, const CharT* fmt,
const local_time<Duration>& tp, const std::string* abbrev = nullptr,
const std::chrono::seconds* offset_sec = nullptr) {
using CT = typename std::common_type<Duration, std::chrono::seconds>::type;
auto ld = floor<days>(tp);
fields<CT> fds{year_month_day{ld}, time_of_day<CT>{tp - local_seconds{ld}}};
return to_stream(os, fmt, fds, abbrev, offset_sec);
}
template <class CharT, class Traits, class Duration>
std::basic_ostream<CharT, Traits>& to_stream(std::basic_ostream<CharT, Traits>& os,
const CharT* fmt,
const sys_time<Duration>& tp) {
using namespace std::chrono;
using CT = typename std::common_type<Duration, seconds>::type;
const std::string abbrev("UTC");
CONSTDATA seconds offset{0};
auto sd = floor<days>(tp);
fields<CT> fds{year_month_day{sd}, time_of_day<CT>{tp - sys_seconds{sd}}};
return to_stream(os, fmt, fds, &abbrev, &offset);
}
// format
template <class CharT, class Streamable>
auto format(const std::locale& loc, const CharT* fmt, const Streamable& tp)
-> decltype(to_stream(std::declval<std::basic_ostream<CharT>&>(), fmt, tp),
std::basic_string<CharT>{}) {
std::basic_ostringstream<CharT> os;
os.exceptions(std::ios::failbit | std::ios::badbit);
os.imbue(loc);
to_stream(os, fmt, tp);
return os.str();
}
template <class CharT, class Streamable>
auto format(const CharT* fmt, const Streamable& tp)
-> decltype(to_stream(std::declval<std::basic_ostream<CharT>&>(), fmt, tp),
std::basic_string<CharT>{}) {
std::basic_ostringstream<CharT> os;
os.exceptions(std::ios::failbit | std::ios::badbit);
to_stream(os, fmt, tp);
return os.str();
}
template <class CharT, class Traits, class Alloc, class Streamable>
auto format(const std::locale& loc, const std::basic_string<CharT, Traits, Alloc>& fmt,
const Streamable& tp)
-> decltype(to_stream(std::declval<std::basic_ostream<CharT, Traits>&>(), fmt.c_str(),
tp),
std::basic_string<CharT, Traits, Alloc>{}) {
std::basic_ostringstream<CharT, Traits, Alloc> os;
os.exceptions(std::ios::failbit | std::ios::badbit);
os.imbue(loc);
to_stream(os, fmt.c_str(), tp);
return os.str();
}
template <class CharT, class Traits, class Alloc, class Streamable>
auto format(const std::basic_string<CharT, Traits, Alloc>& fmt, const Streamable& tp)
-> decltype(to_stream(std::declval<std::basic_ostream<CharT, Traits>&>(), fmt.c_str(),
tp),
std::basic_string<CharT, Traits, Alloc>{}) {
std::basic_ostringstream<CharT, Traits, Alloc> os;
os.exceptions(std::ios::failbit | std::ios::badbit);
to_stream(os, fmt.c_str(), tp);
return os.str();
}
// parse
namespace detail {
template <class CharT, class Traits>
bool read_char(std::basic_istream<CharT, Traits>& is, CharT fmt, std::ios::iostate& err) {
auto ic = is.get();
if (Traits::eq_int_type(ic, Traits::eof()) ||
!Traits::eq(Traits::to_char_type(ic), fmt)) {
err |= std::ios::failbit;
is.setstate(std::ios::failbit);
return false;
}
return true;
}
template <class CharT, class Traits>
unsigned read_unsigned(std::basic_istream<CharT, Traits>& is, unsigned m = 1,
unsigned M = 10) {
unsigned x = 0;
unsigned count = 0;
while (true) {
auto ic = is.peek();
if (Traits::eq_int_type(ic, Traits::eof())) break;
auto c = static_cast<char>(Traits::to_char_type(ic));
if (!('0' <= c && c <= '9')) break;
(void)is.get();
++count;
x = 10 * x + static_cast<unsigned>(c - '0');
if (count == M) break;
}
if (count < m) is.setstate(std::ios::failbit);
return x;
}
template <class CharT, class Traits>
int read_signed(std::basic_istream<CharT, Traits>& is, unsigned m = 1, unsigned M = 10) {
auto ic = is.peek();
if (!Traits::eq_int_type(ic, Traits::eof())) {
auto c = static_cast<char>(Traits::to_char_type(ic));
if (('0' <= c && c <= '9') || c == '-' || c == '+') {
if (c == '-' || c == '+') (void)is.get();
auto x = static_cast<int>(read_unsigned(is, std::max(m, 1u), M));
if (!is.fail()) {
if (c == '-') x = -x;
return x;
}
}
}
if (m > 0) is.setstate(std::ios::failbit);
return 0;
}
template <class CharT, class Traits>
long double read_long_double(std::basic_istream<CharT, Traits>& is, unsigned m = 1,
unsigned M = 10) {
using namespace std;
unsigned count = 0;
auto decimal_point =
Traits::to_int_type(use_facet<numpunct<CharT>>(is.getloc()).decimal_point());
std::string buf;
while (true) {
auto ic = is.peek();
if (Traits::eq_int_type(ic, Traits::eof())) break;
if (Traits::eq_int_type(ic, decimal_point)) {
buf += '.';
decimal_point = Traits::eof();
is.get();
} else {
auto c = static_cast<char>(Traits::to_char_type(ic));
if (!('0' <= c && c <= '9')) break;
buf += c;
(void)is.get();
}
if (++count == M) break;
}
if (count < m) {
is.setstate(std::ios::failbit);
return 0;
}
return std::stold(buf);
}
struct rs {
int& i;
unsigned m;
unsigned M;
};
struct ru {
int& i;
unsigned m;
unsigned M;
};
struct rld {
long double& i;
unsigned m;
unsigned M;
};
template <class CharT, class Traits>
void read(std::basic_istream<CharT, Traits>&) {}
template <class CharT, class Traits, class... Args>
void read(std::basic_istream<CharT, Traits>& is, CharT a0, Args&&... args);
template <class CharT, class Traits, class... Args>
void read(std::basic_istream<CharT, Traits>& is, rs a0, Args&&... args);
template <class CharT, class Traits, class... Args>
void read(std::basic_istream<CharT, Traits>& is, ru a0, Args&&... args);
template <class CharT, class Traits, class... Args>
void read(std::basic_istream<CharT, Traits>& is, int a0, Args&&... args);
template <class CharT, class Traits, class... Args>
void read(std::basic_istream<CharT, Traits>& is, rld a0, Args&&... args);
template <class CharT, class Traits, class... Args>
void read(std::basic_istream<CharT, Traits>& is, CharT a0, Args&&... args) {
// No-op if a0 == CharT{}
if (a0 != CharT{}) {
auto ic = is.peek();
if (Traits::eq_int_type(ic, Traits::eof())) {
is.setstate(std::ios::failbit | std::ios::eofbit);
return;
}
if (!Traits::eq(Traits::to_char_type(ic), a0)) {
is.setstate(std::ios::failbit);
return;
}
(void)is.get();
}
read(is, std::forward<Args>(args)...);
}
template <class CharT, class Traits, class... Args>
void read(std::basic_istream<CharT, Traits>& is, rs a0, Args&&... args) {
auto x = read_signed(is, a0.m, a0.M);
if (is.fail()) return;
a0.i = x;
read(is, std::forward<Args>(args)...);
}
template <class CharT, class Traits, class... Args>
void read(std::basic_istream<CharT, Traits>& is, ru a0, Args&&... args) {
auto x = read_unsigned(is, a0.m, a0.M);
if (is.fail()) return;
a0.i = static_cast<int>(x);
read(is, std::forward<Args>(args)...);
}
template <class CharT, class Traits, class... Args>
void read(std::basic_istream<CharT, Traits>& is, int a0, Args&&... args) {
if (a0 != -1) {
auto u = static_cast<unsigned>(a0);
CharT buf[std::numeric_limits<unsigned>::digits10 + 2] = {};
auto e = buf;
do {
*e++ = CharT(u % 10) + CharT{'0'};
u /= 10;
} while (u > 0);
std::reverse(buf, e);
for (auto p = buf; p != e && is.rdstate() == std::ios::goodbit; ++p) read(is, *p);
}
if (is.rdstate() == std::ios::goodbit) read(is, std::forward<Args>(args)...);
}
template <class CharT, class Traits, class... Args>
void read(std::basic_istream<CharT, Traits>& is, rld a0, Args&&... args) {
auto x = read_long_double(is, a0.m, a0.M);
if (is.fail()) return;
a0.i = x;
read(is, std::forward<Args>(args)...);
}
template <class T, class CharT, class Traits>
inline void checked_set(T& value, T from, T not_a_value,
std::basic_ios<CharT, Traits>& is) {
if (!is.fail()) {
if (value == not_a_value)
value = std::move(from);
else if (value != from)
is.setstate(std::ios::failbit);
}
}
} // namespace detail
template <class CharT, class Traits, class Duration, class Alloc = std::allocator<CharT>>
std::basic_istream<CharT, Traits>& from_stream(
std::basic_istream<CharT, Traits>& is, const CharT* fmt, fields<Duration>& fds,
std::basic_string<CharT, Traits, Alloc>* abbrev, std::chrono::minutes* offset) {
using namespace std;
using namespace std::chrono;
typename basic_istream<CharT, Traits>::sentry ok{is, true};
if (ok) {
date::detail::save_istream<CharT, Traits> ss(is);
is.fill(' ');
is.flags(std::ios::skipws | std::ios::dec);
is.width(0);
#if !ONLY_C_LOCALE
auto& f = use_facet<time_get<CharT>>(is.getloc());
std::tm tm{};
#endif
const CharT* command = nullptr;
auto modified = CharT{};
auto width = -1;
CONSTDATA int not_a_year = numeric_limits<int>::min();
CONSTDATA int not_a_2digit_year = 100;
CONSTDATA int not_a_century = not_a_year / 100;
CONSTDATA int not_a_month = 0;
CONSTDATA int not_a_day = 0;
CONSTDATA int not_a_hour = numeric_limits<int>::min();
CONSTDATA int not_a_hour_12_value = 0;
CONSTDATA int not_a_minute = not_a_hour;
CONSTDATA Duration not_a_second = Duration::min();
CONSTDATA int not_a_doy = 0;
CONSTDATA int not_a_weekday = 8;
CONSTDATA int not_a_week_num = 100;
CONSTDATA int not_a_ampm = -1;
CONSTDATA minutes not_a_offset = minutes::min();
int Y = not_a_year; // c, F, Y *
int y = not_a_2digit_year; // D, x, y *
int g = not_a_2digit_year; // g *
int G = not_a_year; // G *
int C = not_a_century; // C *
int m = not_a_month; // b, B, h, m, c, D, F, x *
int d = not_a_day; // c, d, D, e, F, x *
int j = not_a_doy; // j *
int wd = not_a_weekday; // a, A, u, w *
int H = not_a_hour; // c, H, R, T, X *
int I = not_a_hour_12_value; // I, r *
int p = not_a_ampm; // p, r *
int M = not_a_minute; // c, M, r, R, T, X *
Duration s = not_a_second; // c, r, S, T, X *
int U = not_a_week_num; // U *
int V = not_a_week_num; // V *
int W = not_a_week_num; // W *
std::basic_string<CharT, Traits, Alloc> temp_abbrev; // Z *
minutes temp_offset = not_a_offset; // z *
using detail::checked_set;
using detail::read;
using detail::rld;
using detail::rs;
using detail::ru;
for (; *fmt && is.rdstate() == std::ios::goodbit; ++fmt) {
switch (*fmt) {
case 'a':
case 'A':
case 'u':
case 'w': // wd: a, A, u, w
if (command) {
int trial_wd = not_a_weekday;
if (*fmt == 'a' || *fmt == 'A') {
if (modified == CharT{}) {
#if !ONLY_C_LOCALE
ios_base::iostate err = ios_base::goodbit;
f.get(is, nullptr, is, err, &tm, command, fmt + 1);
is.setstate(err);
if (!is.fail()) trial_wd = tm.tm_wday;
#else
auto nm = detail::weekday_names();
auto i = detail::scan_keyword(is, nm.first, nm.second) - nm.first;
if (!is.fail()) trial_wd = i % 7;
#endif
} else
read(is, CharT{'%'}, width, modified, *fmt);
} else // *fmt == 'u' || *fmt == 'w'
{
#if !ONLY_C_LOCALE
if (modified == CharT{})
#else
if (modified != CharT{'E'})
#endif
{
read(is,
ru{trial_wd, 1, width == -1 ? 1u : static_cast<unsigned>(width)});
if (!is.fail()) {
if (*fmt == 'u') {
if (!(1 <= trial_wd && trial_wd <= 7)) {
trial_wd = not_a_weekday;
is.setstate(ios_base::failbit);
} else if (trial_wd == 7)
trial_wd = 0;
} else // *fmt == 'w'
{
if (!(0 <= trial_wd && trial_wd <= 6)) {
trial_wd = not_a_weekday;
is.setstate(ios_base::failbit);
}
}
}
}
#if !ONLY_C_LOCALE
else if (modified == CharT{'O'}) {
ios_base::iostate err = ios_base::goodbit;
f.get(is, nullptr, is, err, &tm, command, fmt + 1);
is.setstate(err);
if (!is.fail()) trial_wd = tm.tm_wday;
}
#endif
else
read(is, CharT{'%'}, width, modified, *fmt);
}
if (trial_wd != not_a_weekday) checked_set(wd, trial_wd, not_a_weekday, is);
} else // !command
read(is, *fmt);
command = nullptr;
width = -1;
modified = CharT{};
break;
case 'b':
case 'B':
case 'h':
if (command) {
if (modified == CharT{}) {
int ttm = not_a_month;
#if !ONLY_C_LOCALE
ios_base::iostate err = ios_base::goodbit;
f.get(is, nullptr, is, err, &tm, command, fmt + 1);
if ((err & ios::failbit) == 0) ttm = tm.tm_mon + 1;
is.setstate(err);
#else
auto nm = detail::month_names();
auto i = detail::scan_keyword(is, nm.first, nm.second) - nm.first;
if (!is.fail()) ttm = i % 12 + 1;
#endif
checked_set(m, ttm, not_a_month, is);
} else
read(is, CharT{'%'}, width, modified, *fmt);
command = nullptr;
width = -1;
modified = CharT{};
} else
read(is, *fmt);
break;
case 'c':
if (command) {
if (modified != CharT{'O'}) {
#if !ONLY_C_LOCALE
ios_base::iostate err = ios_base::goodbit;
f.get(is, nullptr, is, err, &tm, command, fmt + 1);
if ((err & ios::failbit) == 0) {
checked_set(Y, tm.tm_year + 1900, not_a_year, is);
checked_set(m, tm.tm_mon + 1, not_a_month, is);
checked_set(d, tm.tm_mday, not_a_day, is);
checked_set(H, tm.tm_hour, not_a_hour, is);
checked_set(M, tm.tm_min, not_a_minute, is);
checked_set(s, duration_cast<Duration>(seconds{tm.tm_sec}), not_a_second,
is);
}
is.setstate(err);
#else
// "%a %b %e %T %Y"
auto nm = detail::weekday_names();
auto i = detail::scan_keyword(is, nm.first, nm.second) - nm.first;
checked_set(wd, static_cast<int>(i % 7), not_a_weekday, is);
ws(is);
nm = detail::month_names();
i = detail::scan_keyword(is, nm.first, nm.second) - nm.first;
checked_set(m, static_cast<int>(i % 12 + 1), not_a_month, is);
ws(is);
int td = not_a_day;
read(is, rs{td, 1, 2});
checked_set(d, td, not_a_day, is);
ws(is);
using dfs = detail::decimal_format_seconds<Duration>;
CONSTDATA auto w = Duration::period::den == 1 ? 2 : 3 + dfs::width;
int tH;
int tM;
long double S;
read(is, ru{tH, 1, 2}, CharT{':'}, ru{tM, 1, 2}, CharT{':'}, rld{S, 1, w});
checked_set(H, tH, not_a_hour, is);
checked_set(M, tM, not_a_minute, is);
checked_set(s, round<Duration>(duration<long double>{S}), not_a_second, is);
ws(is);
int tY = not_a_year;
read(is, rs{tY, 1, 4u});
checked_set(Y, tY, not_a_year, is);
#endif
} else
read(is, CharT{'%'}, width, modified, *fmt);
command = nullptr;
width = -1;
modified = CharT{};
} else
read(is, *fmt);
break;
case 'x':
if (command) {
if (modified != CharT{'O'}) {
#if !ONLY_C_LOCALE
ios_base::iostate err = ios_base::goodbit;
f.get(is, nullptr, is, err, &tm, command, fmt + 1);
if ((err & ios::failbit) == 0) {
checked_set(Y, tm.tm_year + 1900, not_a_year, is);
checked_set(m, tm.tm_mon + 1, not_a_month, is);
checked_set(d, tm.tm_mday, not_a_day, is);
}
is.setstate(err);
#else
// "%m/%d/%y"
int ty = not_a_2digit_year;
int tm = not_a_month;
int td = not_a_day;
read(is, ru{tm, 1, 2}, CharT{'/'}, ru{td, 1, 2}, CharT{'/'}, rs{ty, 1, 2});
checked_set(y, ty, not_a_2digit_year, is);
checked_set(m, tm, not_a_month, is);
checked_set(d, td, not_a_day, is);
#endif
} else
read(is, CharT{'%'}, width, modified, *fmt);
command = nullptr;
width = -1;
modified = CharT{};
} else
read(is, *fmt);
break;
case 'X':
if (command) {
if (modified != CharT{'O'}) {
#if !ONLY_C_LOCALE
ios_base::iostate err = ios_base::goodbit;
f.get(is, nullptr, is, err, &tm, command, fmt + 1);
if ((err & ios::failbit) == 0) {
checked_set(H, tm.tm_hour, not_a_hour, is);
checked_set(M, tm.tm_min, not_a_minute, is);
checked_set(s, duration_cast<Duration>(seconds{tm.tm_sec}), not_a_second,
is);
}
is.setstate(err);
#else
// "%T"
using dfs = detail::decimal_format_seconds<Duration>;
CONSTDATA auto w = Duration::period::den == 1 ? 2 : 3 + dfs::width;
int tH = not_a_hour;
int tM = not_a_minute;
long double S;
read(is, ru{tH, 1, 2}, CharT{':'}, ru{tM, 1, 2}, CharT{':'}, rld{S, 1, w});
checked_set(H, tH, not_a_hour, is);
checked_set(M, tM, not_a_minute, is);
checked_set(s, round<Duration>(duration<long double>{S}), not_a_second, is);
#endif
} else
read(is, CharT{'%'}, width, modified, *fmt);
command = nullptr;
width = -1;
modified = CharT{};
} else
read(is, *fmt);
break;
case 'C':
if (command) {
int tC = not_a_century;
#if !ONLY_C_LOCALE
if (modified == CharT{}) {
#endif
read(is, rs{tC, 1, width == -1 ? 2u : static_cast<unsigned>(width)});
#if !ONLY_C_LOCALE
} else {
ios_base::iostate err = ios_base::goodbit;
f.get(is, nullptr, is, err, &tm, command, fmt + 1);
if ((err & ios::failbit) == 0) {
auto tY = tm.tm_year + 1900;
tC = (tY >= 0 ? tY : tY - 99) / 100;
}
is.setstate(err);
}
#endif
checked_set(C, tC, not_a_century, is);
command = nullptr;
width = -1;
modified = CharT{};
} else
read(is, *fmt);
break;
case 'D':
if (command) {
if (modified == CharT{}) {
int tn = not_a_month;
int td = not_a_day;
int ty = not_a_2digit_year;
read(is, ru{tn, 1, 2}, CharT{'\0'}, CharT{'/'}, CharT{'\0'}, ru{td, 1, 2},
CharT{'\0'}, CharT{'/'}, CharT{'\0'}, rs{ty, 1, 2});
checked_set(y, ty, not_a_2digit_year, is);
checked_set(m, tn, not_a_month, is);
checked_set(d, td, not_a_day, is);
} else
read(is, CharT{'%'}, width, modified, *fmt);
command = nullptr;
width = -1;
modified = CharT{};
} else
read(is, *fmt);
break;
case 'F':
if (command) {
if (modified == CharT{}) {
int tY = not_a_year;
int tn = not_a_month;
int td = not_a_day;
read(is, rs{tY, 1, width == -1 ? 4u : static_cast<unsigned>(width)},
CharT{'-'}, ru{tn, 1, 2}, CharT{'-'}, ru{td, 1, 2});
checked_set(Y, tY, not_a_year, is);
checked_set(m, tn, not_a_month, is);
checked_set(d, td, not_a_day, is);
} else
read(is, CharT{'%'}, width, modified, *fmt);
command = nullptr;
width = -1;
modified = CharT{};
} else
read(is, *fmt);
break;
case 'd':
case 'e':
if (command) {
#if !ONLY_C_LOCALE
if (modified == CharT{})
#else
if (modified != CharT{'E'})
#endif
{
int td = not_a_day;
read(is, rs{td, 1, width == -1 ? 2u : static_cast<unsigned>(width)});
checked_set(d, td, not_a_day, is);
}
#if !ONLY_C_LOCALE
else if (modified == CharT{'O'}) {
ios_base::iostate err = ios_base::goodbit;
f.get(is, nullptr, is, err, &tm, command, fmt + 1);
command = nullptr;
width = -1;
modified = CharT{};
if ((err & ios::failbit) == 0) checked_set(d, tm.tm_mday, not_a_day, is);
is.setstate(err);
}
#endif
else
read(is, CharT{'%'}, width, modified, *fmt);
command = nullptr;
width = -1;
modified = CharT{};
} else
read(is, *fmt);
break;
case 'H':
if (command) {
#if !ONLY_C_LOCALE
if (modified == CharT{})
#else
if (modified != CharT{'E'})
#endif
{
int tH = not_a_hour;
read(is, ru{tH, 1, width == -1 ? 2u : static_cast<unsigned>(width)});
checked_set(H, tH, not_a_hour, is);
}
#if !ONLY_C_LOCALE
else if (modified == CharT{'O'}) {
ios_base::iostate err = ios_base::goodbit;
f.get(is, nullptr, is, err, &tm, command, fmt + 1);
if ((err & ios::failbit) == 0) checked_set(H, tm.tm_hour, not_a_hour, is);
is.setstate(err);
}
#endif
else
read(is, CharT{'%'}, width, modified, *fmt);
command = nullptr;
width = -1;
modified = CharT{};
} else
read(is, *fmt);
break;
case 'I':
if (command) {
if (modified == CharT{}) {
int tI = not_a_hour_12_value;
// reads in an hour into I, but most be in [1, 12]
read(is, rs{tI, 1, width == -1 ? 2u : static_cast<unsigned>(width)});
if (!(1 <= tI && tI <= 12)) is.setstate(ios::failbit);
checked_set(I, tI, not_a_hour_12_value, is);
} else
read(is, CharT{'%'}, width, modified, *fmt);
command = nullptr;
width = -1;
modified = CharT{};
} else
read(is, *fmt);
break;
case 'j':
if (command) {
if (modified == CharT{}) {
int tj = not_a_doy;
read(is, ru{tj, 1, width == -1 ? 3u : static_cast<unsigned>(width)});
checked_set(j, tj, not_a_doy, is);
} else
read(is, CharT{'%'}, width, modified, *fmt);
command = nullptr;
width = -1;
modified = CharT{};
} else
read(is, *fmt);
break;
case 'M':
if (command) {
#if !ONLY_C_LOCALE
if (modified == CharT{})
#else
if (modified != CharT{'E'})
#endif
{
int tM = not_a_minute;
read(is, ru{tM, 1, width == -1 ? 2u : static_cast<unsigned>(width)});
checked_set(M, tM, not_a_minute, is);
}
#if !ONLY_C_LOCALE
else if (modified == CharT{'O'}) {
ios_base::iostate err = ios_base::goodbit;
f.get(is, nullptr, is, err, &tm, command, fmt + 1);
if ((err & ios::failbit) == 0) checked_set(M, tm.tm_min, not_a_minute, is);
is.setstate(err);
}
#endif
else
read(is, CharT{'%'}, width, modified, *fmt);
command = nullptr;
width = -1;
modified = CharT{};
} else
read(is, *fmt);
break;
case 'm':
if (command) {
#if !ONLY_C_LOCALE
if (modified == CharT{})
#else
if (modified != CharT{'E'})
#endif
{
int tn = not_a_month;
read(is, rs{tn, 1, width == -1 ? 2u : static_cast<unsigned>(width)});
checked_set(m, tn, not_a_month, is);
}
#if !ONLY_C_LOCALE
else if (modified == CharT{'O'}) {
ios_base::iostate err = ios_base::goodbit;
f.get(is, nullptr, is, err, &tm, command, fmt + 1);
if ((err & ios::failbit) == 0)
checked_set(m, tm.tm_mon + 1, not_a_month, is);
is.setstate(err);
}
#endif
else
read(is, CharT{'%'}, width, modified, *fmt);
command = nullptr;
width = -1;
modified = CharT{};
} else
read(is, *fmt);
break;
case 'n':
case 't':
if (command) {
if (modified == CharT{}) {
// %n matches a single white space character
// %t matches 0 or 1 white space characters
auto ic = is.peek();
if (Traits::eq_int_type(ic, Traits::eof())) {
ios_base::iostate err = ios_base::eofbit;
if (*fmt == 'n') err |= ios_base::failbit;
is.setstate(err);
break;
}
if (isspace(ic)) {
(void)is.get();
} else if (*fmt == 'n')
is.setstate(ios_base::failbit);
} else
read(is, CharT{'%'}, width, modified, *fmt);
command = nullptr;
width = -1;
modified = CharT{};
} else
read(is, *fmt);
break;
case 'p':
if (command) {
if (modified == CharT{}) {
int tp = not_a_ampm;
#if !ONLY_C_LOCALE
tm = std::tm{};
tm.tm_hour = 1;
ios_base::iostate err = ios_base::goodbit;
f.get(is, nullptr, is, err, &tm, command, fmt + 1);
is.setstate(err);
if (tm.tm_hour == 1)
tp = 0;
else if (tm.tm_hour == 13)
tp = 1;
else
is.setstate(err);
#else
auto nm = detail::ampm_names();
auto i = detail::scan_keyword(is, nm.first, nm.second) - nm.first;
tp = i;
#endif
checked_set(p, tp, not_a_ampm, is);
} else
read(is, CharT{'%'}, width, modified, *fmt);
command = nullptr;
width = -1;
modified = CharT{};
} else
read(is, *fmt);
break;
case 'r':
if (command) {
if (modified == CharT{}) {
#if !ONLY_C_LOCALE
ios_base::iostate err = ios_base::goodbit;
f.get(is, nullptr, is, err, &tm, command, fmt + 1);
if ((err & ios::failbit) == 0) {
checked_set(H, tm.tm_hour, not_a_hour, is);
checked_set(M, tm.tm_min, not_a_hour, is);
checked_set(s, duration_cast<Duration>(seconds{tm.tm_sec}), not_a_second,
is);
}
is.setstate(err);
#else
// "%I:%M:%S %p"
using dfs = detail::decimal_format_seconds<Duration>;
CONSTDATA auto w = Duration::period::den == 1 ? 2 : 3 + dfs::width;
long double S;
int tI = not_a_hour_12_value;
int tM = not_a_minute;
read(is, ru{tI, 1, 2}, CharT{':'}, ru{tM, 1, 2}, CharT{':'}, rld{S, 1, w});
checked_set(I, tI, not_a_hour_12_value, is);
checked_set(M, tM, not_a_minute, is);
checked_set(s, round<Duration>(duration<long double>{S}), not_a_second, is);
ws(is);
auto nm = detail::ampm_names();
auto i = detail::scan_keyword(is, nm.first, nm.second) - nm.first;
checked_set(p, static_cast<int>(i), not_a_ampm, is);
#endif
} else
read(is, CharT{'%'}, width, modified, *fmt);
command = nullptr;
width = -1;
modified = CharT{};
} else
read(is, *fmt);
break;
case 'R':
if (command) {
if (modified == CharT{}) {
int tH = not_a_hour;
int tM = not_a_minute;
read(is, ru{tH, 1, 2}, CharT{'\0'}, CharT{':'}, CharT{'\0'}, ru{tM, 1, 2},
CharT{'\0'});
checked_set(H, tH, not_a_hour, is);
checked_set(M, tM, not_a_minute, is);
} else
read(is, CharT{'%'}, width, modified, *fmt);
command = nullptr;
width = -1;
modified = CharT{};
} else
read(is, *fmt);
break;
case 'S':
if (command) {
#if !ONLY_C_LOCALE
if (modified == CharT{})
#else
if (modified != CharT{'E'})
#endif
{
using dfs = detail::decimal_format_seconds<Duration>;
CONSTDATA auto w = Duration::period::den == 1 ? 2 : 3 + dfs::width;
long double S;
read(is, rld{S, 1, width == -1 ? w : static_cast<unsigned>(width)});
checked_set(s, round<Duration>(duration<long double>{S}), not_a_second, is);
}
#if !ONLY_C_LOCALE
else if (modified == CharT{'O'}) {
ios_base::iostate err = ios_base::goodbit;
f.get(is, nullptr, is, err, &tm, command, fmt + 1);
if ((err & ios::failbit) == 0)
checked_set(s, duration_cast<Duration>(seconds{tm.tm_sec}), not_a_second,
is);
is.setstate(err);
}
#endif
else
read(is, CharT{'%'}, width, modified, *fmt);
command = nullptr;
width = -1;
modified = CharT{};
} else
read(is, *fmt);
break;
case 'T':
if (command) {
if (modified == CharT{}) {
using dfs = detail::decimal_format_seconds<Duration>;
CONSTDATA auto w = Duration::period::den == 1 ? 2 : 3 + dfs::width;
int tH = not_a_hour;
int tM = not_a_minute;
long double S;
read(is, ru{tH, 1, 2}, CharT{':'}, ru{tM, 1, 2}, CharT{':'}, rld{S, 1, w});
checked_set(H, tH, not_a_hour, is);
checked_set(M, tM, not_a_minute, is);
checked_set(s, round<Duration>(duration<long double>{S}), not_a_second, is);
} else
read(is, CharT{'%'}, width, modified, *fmt);
command = nullptr;
width = -1;
modified = CharT{};
} else
read(is, *fmt);
break;
case 'Y':
if (command) {
#if !ONLY_C_LOCALE
if (modified == CharT{})
#else
if (modified != CharT{'O'})
#endif
{
int tY = not_a_year;
read(is, rs{tY, 1, width == -1 ? 4u : static_cast<unsigned>(width)});
checked_set(Y, tY, not_a_year, is);
}
#if !ONLY_C_LOCALE
else if (modified == CharT{'E'}) {
ios_base::iostate err = ios_base::goodbit;
f.get(is, nullptr, is, err, &tm, command, fmt + 1);
if ((err & ios::failbit) == 0)
checked_set(Y, tm.tm_year + 1900, not_a_year, is);
is.setstate(err);
}
#endif
else
read(is, CharT{'%'}, width, modified, *fmt);
command = nullptr;
width = -1;
modified = CharT{};
} else
read(is, *fmt);
break;
case 'y':
if (command) {
#if !ONLY_C_LOCALE
if (modified == CharT{})
#endif
{
int ty = not_a_2digit_year;
read(is, ru{ty, 1, width == -1 ? 2u : static_cast<unsigned>(width)});
checked_set(y, ty, not_a_2digit_year, is);
}
#if !ONLY_C_LOCALE
else {
ios_base::iostate err = ios_base::goodbit;
f.get(is, nullptr, is, err, &tm, command, fmt + 1);
if ((err & ios::failbit) == 0)
checked_set(Y, tm.tm_year + 1900, not_a_year, is);
is.setstate(err);
}
#endif
command = nullptr;
width = -1;
modified = CharT{};
} else
read(is, *fmt);
break;
case 'g':
if (command) {
if (modified == CharT{}) {
int tg = not_a_2digit_year;
read(is, ru{tg, 1, width == -1 ? 2u : static_cast<unsigned>(width)});
checked_set(g, tg, not_a_2digit_year, is);
} else
read(is, CharT{'%'}, width, modified, *fmt);
command = nullptr;
width = -1;
modified = CharT{};
} else
read(is, *fmt);
break;
case 'G':
if (command) {
if (modified == CharT{}) {
int tG = not_a_year;
read(is, rs{tG, 1, width == -1 ? 4u : static_cast<unsigned>(width)});
checked_set(G, tG, not_a_year, is);
} else
read(is, CharT{'%'}, width, modified, *fmt);
command = nullptr;
width = -1;
modified = CharT{};
} else
read(is, *fmt);
break;
case 'U':
if (command) {
if (modified == CharT{}) {
int tU = not_a_week_num;
read(is, ru{tU, 1, width == -1 ? 2u : static_cast<unsigned>(width)});
checked_set(U, tU, not_a_week_num, is);
} else
read(is, CharT{'%'}, width, modified, *fmt);
command = nullptr;
width = -1;
modified = CharT{};
} else
read(is, *fmt);
break;
case 'V':
if (command) {
if (modified == CharT{}) {
int tV = not_a_week_num;
read(is, ru{tV, 1, width == -1 ? 2u : static_cast<unsigned>(width)});
checked_set(V, tV, not_a_week_num, is);
} else
read(is, CharT{'%'}, width, modified, *fmt);
command = nullptr;
width = -1;
modified = CharT{};
} else
read(is, *fmt);
break;
case 'W':
if (command) {
if (modified == CharT{}) {
int tW = not_a_week_num;
read(is, ru{tW, 1, width == -1 ? 2u : static_cast<unsigned>(width)});
checked_set(W, tW, not_a_week_num, is);
} else
read(is, CharT{'%'}, width, modified, *fmt);
command = nullptr;
width = -1;
modified = CharT{};
} else
read(is, *fmt);
break;
case 'E':
case 'O':
if (command) {
if (modified == CharT{}) {
modified = *fmt;
} else {
read(is, CharT{'%'}, width, modified, *fmt);
command = nullptr;
width = -1;
modified = CharT{};
}
} else
read(is, *fmt);
break;
case '%':
if (command) {
if (modified == CharT{})
read(is, *fmt);
else
read(is, CharT{'%'}, width, modified, *fmt);
command = nullptr;
width = -1;
modified = CharT{};
} else
command = fmt;
break;
case 'z':
if (command) {
int tH, tM;
minutes toff = not_a_offset;
bool neg = false;
auto ic = is.peek();
if (!Traits::eq_int_type(ic, Traits::eof())) {
auto c = static_cast<char>(Traits::to_char_type(ic));
if (c == '-') neg = true;
}
if (modified == CharT{}) {
read(is, rs{tH, 2, 2});
if (!is.fail()) toff = hours{std::abs(tH)};
if (is.good()) {
ic = is.peek();
if (!Traits::eq_int_type(ic, Traits::eof())) {
auto c = static_cast<char>(Traits::to_char_type(ic));
if ('0' <= c && c <= '9') {
read(is, ru{tM, 2, 2});
if (!is.fail()) toff += minutes{tM};
}
}
}
} else {
read(is, rs{tH, 1, 2});
if (!is.fail()) toff = hours{std::abs(tH)};
if (is.good()) {
ic = is.peek();
if (!Traits::eq_int_type(ic, Traits::eof())) {
auto c = static_cast<char>(Traits::to_char_type(ic));
if (c == ':') {
(void)is.get();
read(is, ru{tM, 2, 2});
if (!is.fail()) toff += minutes{tM};
}
}
}
}
if (neg) toff = -toff;
checked_set(temp_offset, toff, not_a_offset, is);
command = nullptr;
width = -1;
modified = CharT{};
} else
read(is, *fmt);
break;
case 'Z':
if (command) {
if (modified == CharT{}) {
std::basic_string<CharT, Traits, Alloc> buf;
while (is.rdstate() == std::ios::goodbit) {
auto i = is.rdbuf()->sgetc();
if (Traits::eq_int_type(i, Traits::eof())) {
is.setstate(ios::eofbit);
break;
}
auto wc = Traits::to_char_type(i);
auto c = static_cast<char>(wc);
// is c a valid time zone name or abbreviation character?
if (!(CharT{1} < wc && wc < CharT{127}) ||
!(isalnum(c) || c == '_' || c == '/' || c == '-' || c == '+'))
break;
buf.push_back(c);
is.rdbuf()->sbumpc();
}
if (buf.empty()) is.setstate(ios::failbit);
checked_set(temp_abbrev, buf, {}, is);
} else
read(is, CharT{'%'}, width, modified, *fmt);
command = nullptr;
width = -1;
modified = CharT{};
} else
read(is, *fmt);
break;
default:
if (command) {
if (width == -1 && modified == CharT{} && '0' <= *fmt && *fmt <= '9') {
width = static_cast<char>(*fmt) - '0';
while ('0' <= fmt[1] && fmt[1] <= '9')
width = 10 * width + static_cast<char>(*++fmt) - '0';
} else {
if (modified == CharT{})
read(is, CharT{'%'}, width, *fmt);
else
read(is, CharT{'%'}, width, modified, *fmt);
command = nullptr;
width = -1;
modified = CharT{};
}
} else // !command
{
if (isspace(static_cast<unsigned char>(*fmt)))
ws(is); // space matches 0 or more white space characters
else
read(is, *fmt);
}
break;
}
}
// is.rdstate() != ios::goodbit || *fmt == CharT{}
if (is.rdstate() == ios::goodbit && command) {
if (modified == CharT{})
read(is, CharT{'%'}, width);
else
read(is, CharT{'%'}, width, modified);
}
if (is.rdstate() != ios::goodbit && *fmt != CharT{} && !is.fail())
is.setstate(ios::failbit);
if (!is.fail()) {
if (y != not_a_2digit_year) {
// Convert y and an optional C to Y
if (!(0 <= y && y <= 99)) goto broken;
if (C == not_a_century) {
if (Y == not_a_year) {
if (y >= 69)
C = 19;
else
C = 20;
} else {
C = (Y >= 0 ? Y : Y - 100) / 100;
}
}
int tY;
if (C >= 0)
tY = 100 * C + y;
else
tY = 100 * (C + 1) - (y == 0 ? 100 : y);
if (Y != not_a_year && Y != tY) goto broken;
Y = tY;
}
if (g != not_a_2digit_year) {
// Convert g and an optional C to G
if (!(0 <= g && g <= 99)) goto broken;
if (C == not_a_century) {
if (G == not_a_year) {
if (g >= 69)
C = 19;
else
C = 20;
} else {
C = (G >= 0 ? G : G - 100) / 100;
}
}
int tG;
if (C >= 0)
tG = 100 * C + g;
else
tG = 100 * (C + 1) - (g == 0 ? 100 : g);
if (G != not_a_year && G != tG) goto broken;
G = tG;
}
if (Y < static_cast<int>(year::min()) || Y > static_cast<int>(year::max()))
Y = not_a_year;
bool computed = false;
if (G != not_a_year && V != not_a_week_num && wd != not_a_weekday) {
year_month_day ymd_trial = sys_days(year{G - 1} / December / Thursday[last]) +
(Monday - Thursday) + weeks{V - 1} +
(weekday{static_cast<unsigned>(wd)} - Monday);
if (Y == not_a_year)
Y = static_cast<int>(ymd_trial.year());
else if (year{Y} != ymd_trial.year())
goto broken;
if (m == not_a_month)
m = static_cast<int>(static_cast<unsigned>(ymd_trial.month()));
else if (month(static_cast<unsigned>(m)) != ymd_trial.month())
goto broken;
if (d == not_a_day)
d = static_cast<int>(static_cast<unsigned>(ymd_trial.day()));
else if (day(static_cast<unsigned>(d)) != ymd_trial.day())
goto broken;
computed = true;
}
if (Y != not_a_year && U != not_a_week_num && wd != not_a_weekday) {
year_month_day ymd_trial = sys_days(year{Y} / January / Sunday[1]) +
weeks{U - 1} +
(weekday{static_cast<unsigned>(wd)} - Sunday);
if (Y == not_a_year)
Y = static_cast<int>(ymd_trial.year());
else if (year{Y} != ymd_trial.year())
goto broken;
if (m == not_a_month)
m = static_cast<int>(static_cast<unsigned>(ymd_trial.month()));
else if (month(static_cast<unsigned>(m)) != ymd_trial.month())
goto broken;
if (d == not_a_day)
d = static_cast<int>(static_cast<unsigned>(ymd_trial.day()));
else if (day(static_cast<unsigned>(d)) != ymd_trial.day())
goto broken;
computed = true;
}
if (Y != not_a_year && W != not_a_week_num && wd != not_a_weekday) {
year_month_day ymd_trial = sys_days(year{Y} / January / Monday[1]) +
weeks{W - 1} +
(weekday{static_cast<unsigned>(wd)} - Monday);
if (Y == not_a_year)
Y = static_cast<int>(ymd_trial.year());
else if (year{Y} != ymd_trial.year())
goto broken;
if (m == not_a_month)
m = static_cast<int>(static_cast<unsigned>(ymd_trial.month()));
else if (month(static_cast<unsigned>(m)) != ymd_trial.month())
goto broken;
if (d == not_a_day)
d = static_cast<int>(static_cast<unsigned>(ymd_trial.day()));
else if (day(static_cast<unsigned>(d)) != ymd_trial.day())
goto broken;
computed = true;
}
if (j != 0 && Y != not_a_year) {
auto ymd_trial = year_month_day{local_days(year{Y} / 1 / 1) + days{j - 1}};
if (m == 0)
m = static_cast<int>(static_cast<unsigned>(ymd_trial.month()));
else if (month(static_cast<unsigned>(m)) != ymd_trial.month())
goto broken;
if (d == 0)
d = static_cast<int>(static_cast<unsigned>(ymd_trial.day()));
else if (day(static_cast<unsigned>(d)) != ymd_trial.day())
goto broken;
}
auto ymd = year{Y} / m / d;
if (ymd.ok()) {
if (wd == not_a_weekday)
wd = static_cast<int>((weekday(sys_days(ymd)) - Sunday).count());
else if (wd != static_cast<int>((weekday(sys_days(ymd)) - Sunday).count()))
goto broken;
if (!computed) {
if (G != not_a_year || V != not_a_week_num) {
sys_days sd = ymd;
auto G_trial = year_month_day{sd + days{3}}.year();
auto start = sys_days((G_trial - years{1}) / December / Thursday[last]) +
(Monday - Thursday);
if (sd < start) {
--G_trial;
if (V != not_a_week_num)
start = sys_days((G_trial - years{1}) / December / Thursday[last]) +
(Monday - Thursday);
}
if (G != not_a_year && G != static_cast<int>(G_trial)) goto broken;
if (V != not_a_week_num) {
auto V_trial = duration_cast<weeks>(sd - start).count() + 1;
if (V != V_trial) goto broken;
}
}
if (U != not_a_week_num) {
auto start = sys_days(Sunday[1] / January / ymd.year());
auto U_trial = floor<weeks>(sys_days(ymd) - start).count() + 1;
if (U != U_trial) goto broken;
}
if (W != not_a_week_num) {
auto start = sys_days(Monday[1] / January / ymd.year());
auto W_trial = floor<weeks>(sys_days(ymd) - start).count() + 1;
if (W != W_trial) goto broken;
}
}
}
fds.ymd = ymd;
if (I != not_a_hour_12_value) {
if (!(1 <= I && I <= 12)) goto broken;
if (p != not_a_ampm) {
// p is in [0, 1] == [AM, PM]
// Store trial H in I
if (I == 12) --p;
I += p * 12;
// Either set H from I or make sure H and I are consistent
if (H == not_a_hour)
H = I;
else if (I != H)
goto broken;
} else // p == not_a_ampm
{
// if H, make sure H and I could be consistent
if (H != not_a_hour) {
if (I == 12) {
if (H != 0 && H != 12) goto broken;
} else if (!(I == H || I == H + 12)) {
goto broken;
}
}
}
}
if (H != not_a_hour) {
fds.has_tod = true;
fds.tod = time_of_day<Duration>{hours{H}};
}
if (M != not_a_minute) {
fds.has_tod = true;
fds.tod.m_ = minutes{M};
}
if (s != not_a_second) {
fds.has_tod = true;
fds.tod.s_ = detail::decimal_format_seconds<Duration>{s};
}
if (wd != not_a_weekday) fds.wd = weekday{static_cast<unsigned>(wd)};
if (abbrev != nullptr) *abbrev = std::move(temp_abbrev);
if (offset != nullptr && temp_offset != not_a_offset) *offset = temp_offset;
}
return is;
}
broken:
is.setstate(ios_base::failbit);
return is;
}
template <class CharT, class Traits, class Alloc = std::allocator<CharT>>
std::basic_istream<CharT, Traits>& from_stream(
std::basic_istream<CharT, Traits>& is, const CharT* fmt, year& y,
std::basic_string<CharT, Traits, Alloc>* abbrev = nullptr,
std::chrono::minutes* offset = nullptr) {
using namespace std;
using namespace std::chrono;
using CT = seconds;
fields<CT> fds{};
from_stream(is, fmt, fds, abbrev, offset);
if (!fds.ymd.year().ok()) is.setstate(ios::failbit);
if (!is.fail()) y = fds.ymd.year();
return is;
}
template <class CharT, class Traits, class Alloc = std::allocator<CharT>>
std::basic_istream<CharT, Traits>& from_stream(
std::basic_istream<CharT, Traits>& is, const CharT* fmt, month& m,
std::basic_string<CharT, Traits, Alloc>* abbrev = nullptr,
std::chrono::minutes* offset = nullptr) {
using namespace std;
using namespace std::chrono;
using CT = seconds;
fields<CT> fds{};
from_stream(is, fmt, fds, abbrev, offset);
if (!fds.ymd.month().ok()) is.setstate(ios::failbit);
if (!is.fail()) m = fds.ymd.month();
return is;
}
template <class CharT, class Traits, class Alloc = std::allocator<CharT>>
std::basic_istream<CharT, Traits>& from_stream(
std::basic_istream<CharT, Traits>& is, const CharT* fmt, day& d,
std::basic_string<CharT, Traits, Alloc>* abbrev = nullptr,
std::chrono::minutes* offset = nullptr) {
using namespace std;
using namespace std::chrono;
using CT = seconds;
fields<CT> fds{};
from_stream(is, fmt, fds, abbrev, offset);
if (!fds.ymd.day().ok()) is.setstate(ios::failbit);
if (!is.fail()) d = fds.ymd.day();
return is;
}
template <class CharT, class Traits, class Alloc = std::allocator<CharT>>
std::basic_istream<CharT, Traits>& from_stream(
std::basic_istream<CharT, Traits>& is, const CharT* fmt, weekday& wd,
std::basic_string<CharT, Traits, Alloc>* abbrev = nullptr,
std::chrono::minutes* offset = nullptr) {
using namespace std;
using namespace std::chrono;
using CT = seconds;
fields<CT> fds{};
from_stream(is, fmt, fds, abbrev, offset);
if (!fds.wd.ok()) is.setstate(ios::failbit);
if (!is.fail()) wd = fds.wd;
return is;
}
template <class CharT, class Traits, class Alloc = std::allocator<CharT>>
std::basic_istream<CharT, Traits>& from_stream(
std::basic_istream<CharT, Traits>& is, const CharT* fmt, year_month& ym,
std::basic_string<CharT, Traits, Alloc>* abbrev = nullptr,
std::chrono::minutes* offset = nullptr) {
using namespace std;
using namespace std::chrono;
using CT = seconds;
fields<CT> fds{};
from_stream(is, fmt, fds, abbrev, offset);
if (!fds.ymd.month().ok()) is.setstate(ios::failbit);
if (!is.fail()) ym = fds.ymd.year() / fds.ymd.month();
return is;
}
template <class CharT, class Traits, class Alloc = std::allocator<CharT>>
std::basic_istream<CharT, Traits>& from_stream(
std::basic_istream<CharT, Traits>& is, const CharT* fmt, month_day& md,
std::basic_string<CharT, Traits, Alloc>* abbrev = nullptr,
std::chrono::minutes* offset = nullptr) {
using namespace std;
using namespace std::chrono;
using CT = seconds;
fields<CT> fds{};
from_stream(is, fmt, fds, abbrev, offset);
if (!fds.ymd.month().ok() || !fds.ymd.day().ok()) is.setstate(ios::failbit);
if (!is.fail()) md = fds.ymd.month() / fds.ymd.day();
return is;
}
template <class CharT, class Traits, class Alloc = std::allocator<CharT>>
std::basic_istream<CharT, Traits>& from_stream(
std::basic_istream<CharT, Traits>& is, const CharT* fmt, year_month_day& ymd,
std::basic_string<CharT, Traits, Alloc>* abbrev = nullptr,
std::chrono::minutes* offset = nullptr) {
using namespace std;
using namespace std::chrono;
using CT = seconds;
fields<CT> fds{};
from_stream(is, fmt, fds, abbrev, offset);
if (!fds.ymd.ok()) is.setstate(ios::failbit);
if (!is.fail()) ymd = fds.ymd;
return is;
}
template <class Duration, class CharT, class Traits, class Alloc = std::allocator<CharT>>
std::basic_istream<CharT, Traits>& from_stream(
std::basic_istream<CharT, Traits>& is, const CharT* fmt, sys_time<Duration>& tp,
std::basic_string<CharT, Traits, Alloc>* abbrev = nullptr,
std::chrono::minutes* offset = nullptr) {
using namespace std;
using namespace std::chrono;
using CT = typename common_type<Duration, seconds>::type;
minutes offset_local{};
auto offptr = offset ? offset : &offset_local;
fields<CT> fds{};
fds.has_tod = true;
from_stream(is, fmt, fds, abbrev, offptr);
if (!fds.ymd.ok() || !fds.tod.in_conventional_range()) is.setstate(ios::failbit);
if (!is.fail())
tp = round<Duration>(sys_days(fds.ymd) - *offptr + fds.tod.to_duration());
return is;
}
template <class Duration, class CharT, class Traits, class Alloc = std::allocator<CharT>>
std::basic_istream<CharT, Traits>& from_stream(
std::basic_istream<CharT, Traits>& is, const CharT* fmt, local_time<Duration>& tp,
std::basic_string<CharT, Traits, Alloc>* abbrev = nullptr,
std::chrono::minutes* offset = nullptr) {
using namespace std;
using namespace std::chrono;
using CT = typename common_type<Duration, seconds>::type;
fields<CT> fds{};
fds.has_tod = true;
from_stream(is, fmt, fds, abbrev, offset);
if (!fds.ymd.ok() || !fds.tod.in_conventional_range()) is.setstate(ios::failbit);
if (!is.fail())
tp = round<Duration>(local_seconds{local_days(fds.ymd)} + fds.tod.to_duration());
return is;
}
template <class Rep, class Period, class CharT, class Traits,
class Alloc = std::allocator<CharT>>
std::basic_istream<CharT, Traits>& from_stream(
std::basic_istream<CharT, Traits>& is, const CharT* fmt,
std::chrono::duration<Rep, Period>& d,
std::basic_string<CharT, Traits, Alloc>* abbrev = nullptr,
std::chrono::minutes* offset = nullptr) {
using namespace std;
using namespace std::chrono;
using Duration = std::chrono::duration<Rep, Period>;
using CT = typename common_type<Duration, seconds>::type;
fields<CT> fds{};
from_stream(is, fmt, fds, abbrev, offset);
if (!fds.has_tod) is.setstate(ios::failbit);
if (!is.fail()) d = duration_cast<Duration>(fds.tod.to_duration());
return is;
}
template <class Parsable, class CharT, class Traits = std::char_traits<CharT>,
class Alloc = std::allocator<CharT>>
struct parse_manip {
const std::basic_string<CharT, Traits, Alloc> format_;
Parsable& tp_;
std::basic_string<CharT, Traits, Alloc>* abbrev_;
std::chrono::minutes* offset_;
public:
parse_manip(std::basic_string<CharT, Traits, Alloc> format, Parsable& tp,
std::basic_string<CharT, Traits, Alloc>* abbrev = nullptr,
std::chrono::minutes* offset = nullptr)
: format_(std::move(format)), tp_(tp), abbrev_(abbrev), offset_(offset) {}
};
template <class Parsable, class CharT, class Traits, class Alloc>
std::basic_istream<CharT, Traits>& operator>>(
std::basic_istream<CharT, Traits>& is,
const parse_manip<Parsable, CharT, Traits, Alloc>& x) {
return from_stream(is, x.format_.c_str(), x.tp_, x.abbrev_, x.offset_);
}
template <class Parsable, class CharT, class Traits, class Alloc>
inline auto parse(const std::basic_string<CharT, Traits, Alloc>& format, Parsable& tp)
-> decltype(from_stream(std::declval<std::basic_istream<CharT, Traits>&>(),
format.c_str(), tp),
parse_manip<Parsable, CharT, Traits, Alloc>{format, tp}) {
return {format, tp};
}
template <class Parsable, class CharT, class Traits, class Alloc>
inline auto parse(const std::basic_string<CharT, Traits, Alloc>& format, Parsable& tp,
std::basic_string<CharT, Traits, Alloc>& abbrev)
-> decltype(from_stream(std::declval<std::basic_istream<CharT, Traits>&>(),
format.c_str(), tp, &abbrev),
parse_manip<Parsable, CharT, Traits, Alloc>{format, tp, &abbrev}) {
return {format, tp, &abbrev};
}
template <class Parsable, class CharT, class Traits, class Alloc>
inline auto parse(const std::basic_string<CharT, Traits, Alloc>& format, Parsable& tp,
std::chrono::minutes& offset)
-> decltype(from_stream(std::declval<std::basic_istream<CharT, Traits>&>(),
format.c_str(), tp,
std::declval<std::basic_string<CharT, Traits, Alloc>*>(),
&offset),
parse_manip<Parsable, CharT, Traits, Alloc>{format, tp, nullptr,
&offset}) {
return {format, tp, nullptr, &offset};
}
template <class Parsable, class CharT, class Traits, class Alloc>
inline auto parse(const std::basic_string<CharT, Traits, Alloc>& format, Parsable& tp,
std::basic_string<CharT, Traits, Alloc>& abbrev,
std::chrono::minutes& offset)
-> decltype(from_stream(std::declval<std::basic_istream<CharT, Traits>&>(),
format.c_str(), tp, &abbrev, &offset),
parse_manip<Parsable, CharT, Traits, Alloc>{format, tp, &abbrev,
&offset}) {
return {format, tp, &abbrev, &offset};
}
// const CharT* formats
template <class Parsable, class CharT>
inline auto parse(const CharT* format, Parsable& tp)
-> decltype(from_stream(std::declval<std::basic_istream<CharT>&>(), format, tp),
parse_manip<Parsable, CharT>{format, tp}) {
return {format, tp};
}
template <class Parsable, class CharT, class Traits, class Alloc>
inline auto parse(const CharT* format, Parsable& tp,
std::basic_string<CharT, Traits, Alloc>& abbrev)
-> decltype(from_stream(std::declval<std::basic_istream<CharT, Traits>&>(), format,
tp, &abbrev),
parse_manip<Parsable, CharT, Traits, Alloc>{format, tp, &abbrev}) {
return {format, tp, &abbrev};
}
template <class Parsable, class CharT>
inline auto parse(const CharT* format, Parsable& tp, std::chrono::minutes& offset)
-> decltype(from_stream(std::declval<std::basic_istream<CharT>&>(), format, tp,
std::declval<std::basic_string<CharT>*>(), &offset),
parse_manip<Parsable, CharT>{format, tp, nullptr, &offset}) {
return {format, tp, nullptr, &offset};
}
template <class Parsable, class CharT, class Traits, class Alloc>
inline auto parse(const CharT* format, Parsable& tp,
std::basic_string<CharT, Traits, Alloc>& abbrev,
std::chrono::minutes& offset)
-> decltype(from_stream(std::declval<std::basic_istream<CharT, Traits>&>(), format,
tp, &abbrev, &offset),
parse_manip<Parsable, CharT, Traits, Alloc>{format, tp, &abbrev,
&offset}) {
return {format, tp, &abbrev, &offset};
}
// duration streaming
namespace detail {
template <class CharT, std::size_t N>
class string_literal;
template <class CharT1, class CharT2, std::size_t N1, std::size_t N2>
inline CONSTCD14 string_literal<
typename std::conditional<sizeof(CharT2) <= sizeof(CharT1), CharT1, CharT2>::type,
N1 + N2 - 1>
operator+(const string_literal<CharT1, N1>& x,
const string_literal<CharT2, N2>& y) NOEXCEPT;
template <class CharT, std::size_t N>
class string_literal {
CharT p_[N];
CONSTCD11 string_literal() NOEXCEPT : p_{} {}
public:
using const_iterator = const CharT*;
string_literal(string_literal const&) = default;
string_literal& operator=(string_literal const&) = delete;
template <std::size_t N1 = 2, class = typename std::enable_if<N1 == N>::type>
CONSTCD11 string_literal(CharT c) NOEXCEPT : p_{c} {}
template <std::size_t N1 = 3, class = typename std::enable_if<N1 == N>::type>
CONSTCD11 string_literal(CharT c1, CharT c2) NOEXCEPT : p_{c1, c2} {}
template <std::size_t N1 = 4, class = typename std::enable_if<N1 == N>::type>
CONSTCD11 string_literal(CharT c1, CharT c2, CharT c3) NOEXCEPT : p_{c1, c2, c3} {}
CONSTCD14 string_literal(const CharT (&a)[N]) NOEXCEPT : p_{} {
for (std::size_t i = 0; i < N; ++i) p_[i] = a[i];
}
template <class U = CharT, class = typename std::enable_if<(1 < sizeof(U))>::type>
CONSTCD14 string_literal(const char (&a)[N]) NOEXCEPT : p_{} {
for (std::size_t i = 0; i < N; ++i) p_[i] = a[i];
}
template <class CharT2,
class = typename std::enable_if<!std::is_same<CharT2, CharT>::value>::type>
CONSTCD14 string_literal(string_literal<CharT2, N> const& a) NOEXCEPT : p_{} {
for (std::size_t i = 0; i < N; ++i) p_[i] = a[i];
}
CONSTCD11 const CharT* data() const NOEXCEPT { return p_; }
CONSTCD11 std::size_t size() const NOEXCEPT { return N - 1; }
CONSTCD11 const_iterator begin() const NOEXCEPT { return p_; }
CONSTCD11 const_iterator end() const NOEXCEPT { return p_ + N - 1; }
CONSTCD11 CharT const& operator[](std::size_t n) const NOEXCEPT { return p_[n]; }
template <class Traits>
friend std::basic_ostream<CharT, Traits>& operator<<(
std::basic_ostream<CharT, Traits>& os, const string_literal& s) {
return os << s.p_;
}
template <class CharT1, class CharT2, std::size_t N1, std::size_t N2>
friend CONSTCD14 string_literal<
typename std::conditional<sizeof(CharT2) <= sizeof(CharT1), CharT1, CharT2>::type,
N1 + N2 - 1>
operator+(const string_literal<CharT1, N1>& x,
const string_literal<CharT2, N2>& y) NOEXCEPT;
};
template <class CharT>
CONSTCD11 inline string_literal<CharT, 3> operator+(
const string_literal<CharT, 2>& x, const string_literal<CharT, 2>& y) NOEXCEPT {
return string_literal<CharT, 3>(x[0], y[0]);
}
template <class CharT>
CONSTCD11 inline string_literal<CharT, 4> operator+(
const string_literal<CharT, 3>& x, const string_literal<CharT, 2>& y) NOEXCEPT {
return string_literal<CharT, 4>(x[0], x[1], y[0]);
}
template <class CharT1, class CharT2, std::size_t N1, std::size_t N2>
CONSTCD14 inline string_literal<
typename std::conditional<sizeof(CharT2) <= sizeof(CharT1), CharT1, CharT2>::type,
N1 + N2 - 1>
operator+(const string_literal<CharT1, N1>& x,
const string_literal<CharT2, N2>& y) NOEXCEPT {
using CT =
typename std::conditional<sizeof(CharT2) <= sizeof(CharT1), CharT1, CharT2>::type;
string_literal<CT, N1 + N2 - 1> r;
std::size_t i = 0;
for (; i < N1 - 1; ++i) r.p_[i] = CT(x.p_[i]);
for (std::size_t j = 0; j < N2; ++j, ++i) r.p_[i] = CT(y.p_[j]);
return r;
}
template <class CharT, class Traits, class Alloc, std::size_t N>
inline std::basic_string<CharT, Traits, Alloc> operator+(
std::basic_string<CharT, Traits, Alloc> x, const string_literal<CharT, N>& y) {
x.append(y.data(), y.size());
return x;
}
#if __cplusplus >= 201402 && (!defined(__EDG_VERSION__) || __EDG_VERSION__ > 411) && \
(!defined(__SUNPRO_CC) || __SUNPRO_CC > 0x5150)
template <class CharT,
class = std::enable_if_t<
std::is_same<CharT, char>{} || std::is_same<CharT, wchar_t>{} ||
std::is_same<CharT, char16_t>{} || std::is_same<CharT, char32_t>{}>>
CONSTCD14 inline string_literal<CharT, 2> msl(CharT c) NOEXCEPT {
return string_literal<CharT, 2>{c};
}
CONSTCD14
inline std::size_t to_string_len(std::intmax_t i) {
std::size_t r = 0;
do {
i /= 10;
++r;
} while (i > 0);
return r;
}
template <std::intmax_t N>
CONSTCD14 inline std::enable_if_t <
N<10, string_literal<char, to_string_len(N) + 1>> msl() NOEXCEPT {
return msl(char(N % 10 + '0'));
}
template <std::intmax_t N>
CONSTCD14 inline std::enable_if_t<10 <= N, string_literal<char, to_string_len(N) + 1>>
msl() NOEXCEPT {
return msl<N / 10>() + msl(char(N % 10 + '0'));
}
template <class CharT, std::intmax_t N, std::intmax_t D>
CONSTCD14 inline std::enable_if_t<
std::ratio<N, D>::type::den != 1,
string_literal<CharT, to_string_len(std::ratio<N, D>::type::num) +
to_string_len(std::ratio<N, D>::type::den) + 4>>
msl(std::ratio<N, D>) NOEXCEPT {
using R = typename std::ratio<N, D>::type;
return msl(CharT{'['}) + msl<R::num>() + msl(CharT{'/'}) + msl<R::den>() +
msl(CharT{']'});
}
template <class CharT, std::intmax_t N, std::intmax_t D>
CONSTCD14 inline std::enable_if_t<
std::ratio<N, D>::type::den == 1,
string_literal<CharT, to_string_len(std::ratio<N, D>::type::num) + 3>>
msl(std::ratio<N, D>) NOEXCEPT {
using R = typename std::ratio<N, D>::type;
return msl(CharT{'['}) + msl<R::num>() + msl(CharT{']'});
}
#else // __cplusplus < 201402 || (defined(__EDG_VERSION__) && __EDG_VERSION__ <= 411)
inline std::string to_string(std::uint64_t x) { return std::to_string(x); }
template <class CharT>
inline std::basic_string<CharT> to_string(std::uint64_t x) {
auto y = std::to_string(x);
return std::basic_string<CharT>(y.begin(), y.end());
}
template <class CharT, std::intmax_t N, std::intmax_t D>
inline typename std::enable_if<std::ratio<N, D>::type::den != 1,
std::basic_string<CharT>>::type
msl(std::ratio<N, D>) {
using R = typename std::ratio<N, D>::type;
return std::basic_string<CharT>(1, '[') + to_string<CharT>(R::num) + CharT{'/'} +
to_string<CharT>(R::den) + CharT{']'};
}
template <class CharT, std::intmax_t N, std::intmax_t D>
inline typename std::enable_if<std::ratio<N, D>::type::den == 1,
std::basic_string<CharT>>::type
msl(std::ratio<N, D>) {
using R = typename std::ratio<N, D>::type;
return std::basic_string<CharT>(1, '[') + to_string<CharT>(R::num) + CharT{']'};
}
#endif // __cplusplus < 201402 || (defined(__EDG_VERSION__) && __EDG_VERSION__ <= 411)
template <class CharT>
CONSTCD11 inline string_literal<CharT, 2> msl(std::atto) NOEXCEPT {
return string_literal<CharT, 2> {'a'};
}
template <class CharT>
CONSTCD11 inline string_literal<CharT, 2> msl(std::femto) NOEXCEPT {
return string_literal<CharT, 2> {'f'};
}
template <class CharT>
CONSTCD11 inline string_literal<CharT, 2> msl(std::pico) NOEXCEPT {
return string_literal<CharT, 2> {'p'};
}
template <class CharT>
CONSTCD11 inline string_literal<CharT, 2> msl(std::nano) NOEXCEPT {
return string_literal<CharT, 2> {'n'};
}
template <class CharT>
CONSTCD11 inline typename std::enable_if<std::is_same<CharT, char>::value,
string_literal<char, 3>>::type
msl(std::micro) NOEXCEPT {
return string_literal<char, 3> {'\xC2', '\xB5'};
}
template <class CharT>
CONSTCD11 inline typename std::enable_if<!std::is_same<CharT, char>::value,
string_literal<CharT, 2>>::type
msl(std::micro) NOEXCEPT {
return string_literal<CharT, 2>{CharT{static_cast<unsigned char>('\xB5')}};
}
template <class CharT>
CONSTCD11 inline string_literal<CharT, 2> msl(std::milli) NOEXCEPT {
return string_literal<CharT, 2> {'m'};
}
template <class CharT>
CONSTCD11 inline string_literal<CharT, 2> msl(std::centi) NOEXCEPT {
return string_literal<CharT, 2> {'c'};
}
template <class CharT>
CONSTCD11 inline string_literal<CharT, 3> msl(std::deca) NOEXCEPT {
return string_literal<CharT, 3>{'d', 'a'};
}
template <class CharT>
CONSTCD11 inline string_literal<CharT, 2> msl(std::deci) NOEXCEPT {
return string_literal<CharT, 2>{'d'};
}
template <class CharT>
CONSTCD11 inline string_literal<CharT, 2> msl(std::hecto) NOEXCEPT {
return string_literal<CharT, 2>{'h'};
}
template <class CharT>
CONSTCD11 inline string_literal<CharT, 2> msl(std::kilo) NOEXCEPT {
return string_literal<CharT, 2>{'k'};
}
template <class CharT>
CONSTCD11 inline string_literal<CharT, 2> msl(std::mega) NOEXCEPT {
return string_literal<CharT, 2>{'M'};
}
template <class CharT>
CONSTCD11 inline string_literal<CharT, 2> msl(std::giga) NOEXCEPT {
return string_literal<CharT, 2>{'G'};
}
template <class CharT>
CONSTCD11 inline string_literal<CharT, 2> msl(std::tera) NOEXCEPT {
return string_literal<CharT, 2>{'T'};
}
template <class CharT>
CONSTCD11 inline string_literal<CharT, 2> msl(std::peta) NOEXCEPT {
return string_literal<CharT, 2>{'P'};
}
template <class CharT>
CONSTCD11 inline string_literal<CharT, 2> msl(std::exa) NOEXCEPT {
return string_literal<CharT, 2>{'E'};
}
template <class CharT, class Period>
CONSTCD11 inline auto get_units(Period p)
-> decltype(msl<CharT>(p) + string_literal<CharT, 2>{'s'}) {
return msl<CharT>(p) + string_literal<CharT, 2>{'s'};
}
template <class CharT>
CONSTCD11 inline string_literal<CharT, 2> get_units(std::ratio<1>) {
return string_literal<CharT, 2>{'s'};
}
template <class CharT>
CONSTCD11 inline string_literal<CharT, 2> get_units(std::ratio<3600>) {
return string_literal<CharT, 2>{'h'};
}
template <class CharT>
CONSTCD11 inline string_literal<CharT, 4> get_units(std::ratio<60>) {
return string_literal<CharT, 4>{'m', 'i', 'n'};
}
template <class CharT>
CONSTCD11 inline string_literal<CharT, 2> get_units(std::ratio<86400>) {
return string_literal<CharT, 2>{'d'};
}
template <class CharT, class Traits = std::char_traits<CharT>>
struct make_string;
template <>
struct make_string<char> {
template <class Rep>
static std::string from(Rep n) {
return std::to_string(n);
}
};
template <class Traits>
struct make_string<char, Traits> {
template <class Rep>
static std::basic_string<char, Traits> from(Rep n) {
auto s = std::to_string(n);
return std::basic_string<char, Traits>(s.begin(), s.end());
}
};
template <>
struct make_string<wchar_t> {
template <class Rep>
static std::wstring from(Rep n) {
return std::to_wstring(n);
}
};
template <class Traits>
struct make_string<wchar_t, Traits> {
template <class Rep>
static std::basic_string<wchar_t, Traits> from(Rep n) {
auto s = std::to_wstring(n);
return std::basic_string<wchar_t, Traits>(s.begin(), s.end());
}
};
} // namespace detail
template <class CharT, class Traits, class Rep, class Period>
inline std::basic_ostream<CharT, Traits>& operator<<(
std::basic_ostream<CharT, Traits>& os, const std::chrono::duration<Rep, Period>& d) {
using namespace detail;
return os << make_string<CharT, Traits>::from(d.count()) +
get_units<CharT>(typename Period::type{});
}
} // namespace date
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
#endif // DATE_H
| [
"wesm+git@apache.org"
] | wesm+git@apache.org |
f95b9ef26dc831d403b0fc6079e0c2437250fb3d | 0ec9df3bb8b86216e18fe4cb66b6612297245aea | /Sources/CXXBoost/include/boost/smart_ptr/detail/local_sp_deleter.hpp | 2aaeda4de80394757c463b9886076a7a6aa649bf | [] | no_license | jprescott/BoostTestWithLib | 78ae59d1ee801201883cf07ab76b8267fadf7daa | 8650523cab467c41be60f3a1c144f556e9a7f25c | refs/heads/master | 2022-11-18T14:49:00.664753 | 2020-07-18T21:45:17 | 2020-07-18T21:45:17 | 280,749,418 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 1,744 | hpp | #ifndef BOOST_SMART_PTR_DETAIL_LOCAL_SP_DELETER_HPP_INCLUDED
#define BOOST_SMART_PTR_DETAIL_LOCAL_SP_DELETER_HPP_INCLUDED
// MS compatible compilers support #pragma once
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
# pragma once
#endif
// detail/local_sp_deleter.hpp
//
// Copyright 2017 Peter Dimov
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/smart_ptr/ for documentation.
#include <boost/smart_ptr/detail/local_counted_base.hpp>
#include <boost/config.hpp>
namespace boost
{
namespace detail
{
template<class D> class local_sp_deleter: public local_counted_impl_em
{
private:
D d_;
public:
local_sp_deleter(): d_()
{
}
explicit local_sp_deleter( D const& d ) BOOST_SP_NOEXCEPT:
d_( d )
{
}
#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
explicit local_sp_deleter( D&& d ) BOOST_SP_NOEXCEPT:
d_( std::move(d) )
{
}
#endif
D& deleter() BOOST_SP_NOEXCEPT {
return d_;
}
template<class Y> void operator()( Y * p ) BOOST_SP_NOEXCEPT {
d_( p );
}
#if !defined( BOOST_NO_CXX11_NULLPTR )
void operator()( boost::detail::sp_nullptr_t p ) BOOST_SP_NOEXCEPT {
d_( p );
}
#endif
};
template<> class local_sp_deleter<void>
{
};
template<class D> D * get_local_deleter( local_sp_deleter<D> * p ) BOOST_SP_NOEXCEPT {
return &p->deleter();
}
inline void * get_local_deleter( local_sp_deleter<void> * /*p*/ ) BOOST_SP_NOEXCEPT {
return 0;
}
} // namespace detail
} // namespace boost
#endif // #ifndef BOOST_SMART_PTR_DETAIL_LOCAL_SP_DELETER_HPP_INCLUDED
| [
"jprescott12@icloud.com"
] | jprescott12@icloud.com |
2b653eb033166504d31d616ee46b5d4a0dbec6fa | 29dec11a2447cc9e8e301bbfa9db28491eb76f1e | /src/io/stream/StreamBuffer.hxx | 60e741f6582fd3ec688aab1e4200dd1be43694c2 | [] | no_license | kvr000/drt | 897a706523132b2a92273144da993a300947b555 | 28d859693046ecf96cdc70052bb4e2629833c740 | refs/heads/master | 2022-05-01T10:42:10.695069 | 2022-03-27T02:34:05 | 2022-03-27T02:34:05 | 222,618,569 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,176 | hxx | /**
* drt library
*
* drt multiplatform development toolkit
*
* ----------------------------------------------------------------------------------
*
* Copyright (C) 2004-2008 Zbyněk Vyškovský
*
* ----------------------------------------------------------------------------------
*
* LICENSE:
*
* This file is part of drt
*
* drt is free software; you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 3 of the License, or (at your option)
* any later version.
*
* drt 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 drt; if not, write to the Free Software Foundation, Inc., 51
* Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
* @copyright 2004-2008 Zbyněk Vyškovský
* @link mailto:kvr@matfyz.cz
* @link http://kvr.matfyz.cz/drt/
* @license http://www.gnu.org/licenses/lgpl.txt GNU Lesser General Public License v3
**/
#ifndef dr__io__StreamBuffer__hxx__
# define dr__io__StreamBuffer__hxx__
#include <dr/Ref.hxx>
#include <dr/Time.hxx>
#include <dr/io/Handle.hxx>
DR_IO_NS_BEGIN
class DR_IO_PUB StreamBuffer: public Object
{
DR_OBJECT_DECL(Stream, Object);
public:
/* constructor */ StreamBuffer(Handle *handle);
public:
virtual ~StreamBuffer();
public:
virtual void reinit(Handle *handle);
public:
DR_RINLINE Handle * accHandle() { return *handle; }
DR_RINLINE Blob * ptrCache() { return &cache; }
DR_RINLINE void shrinkCache(size_t size) { cache.removeLeft(size); }
public:
virtual void setTimeLimit(SysTime abs_time) { time_limit = abs_time; }
public:
virtual Blob readLine();
/**
* reads until specified character is found
*
* @param search
* character to be found
* @return position before the character
* @throw EndOfDataException if the character is not found
*/
virtual ssize_t readUntilChar(char search);
virtual ssize_t read(Blob *data, size_t maxsize);
/**
* extends the data by reading up to add_size characters
*
* @param data
* the buffer to store the data
* @param add_size
* recommended number of characters to add
* @return
* number of characters added/read (always positive)
*/
virtual ssize_t readExtendAdd(Blob *data, size_t add_size);
virtual ssize_t readFull(Blob *data, size_t fullsize);
virtual ssize_t write(const Blob &data);
virtual ssize_t writeFull(const Blob &data);
/**
* extend cache to to_size
*
* @param to_size requested new size of cache
* @return pointer to cache
*/
virtual Blob * extendCache(size_t to_size);
/**
* extend cache by add_size characters
*
* @param add_size number of characters to extend the cache
* @return pointer to cache
*/
virtual Blob * extendCacheAdd(size_t add_size);
/**
* extend cache by add_size
*
* @param add_size
* recommended number of characters to extend
* @return new size of the cache
*/
virtual size_t tryExtendCache(size_t add_size);
/**
* extend cache to to_size
*
* @param to_size requested new size of cache
* @return added characters to the cache
*/
virtual size_t tryExtendCacheAdd(size_t to_size);
/**
* extend cache until certain character is read
*
* @param search
* the character to be found
* @return
* -1 if the character is not found
* otherwise position of the character
*/
virtual ssize_t tryReadUntilChar(char search);
/**
* reads one line from the source
*
* @return the line
* @return Blob(null) if there is no more lines
*/
virtual Blob tryReadLine();
/**
* set cache suggested size
*
* @param suggested_size
* number of characters to read at once
*/
virtual void setCacheSize(size_t suggested_size);
protected:
Ref<Handle> handle;
Blob cache;
size_t cache_suggest;
SysTime time_limit;
};
DR_IO_NS_END
#endif
| [
"kvr000@gmail.com"
] | kvr000@gmail.com |
619a390c6e9a18af113f015acc3b125ce33d74d0 | 5d83739af703fb400857cecc69aadaf02e07f8d1 | /Archive2/c0/017094895cf3ba/main.cpp | 100e8418610ce6fc8f1ba55084d488c6cd25397c | [] | no_license | WhiZTiM/coliru | 3a6c4c0bdac566d1aa1c21818118ba70479b0f40 | 2c72c048846c082f943e6c7f9fa8d94aee76979f | refs/heads/master | 2021-01-01T05:10:33.812560 | 2015-08-24T19:09:22 | 2015-08-24T19:09:22 | 56,789,706 | 3 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,427 | cpp | #include <chrono>
#include <iostream>
#include <type_traits>
#include <utility>
// Executes fn with arguments args and returns the time needed
// and the result of f if it is not void
template <class Fn, class... Args>
auto timer(Fn fn, Args... args)
-> std::pair<double, decltype(fn(args...))> {
static_assert(!std::is_void<decltype(fn(args...))>::value,
"Call timer_void if return type is void!");
auto start = std::chrono::high_resolution_clock::now();
auto ret = fn(args...);
auto end = std::chrono::high_resolution_clock::now();
std::chrono::duration<double> elapsed_seconds = end - start;
return { elapsed_seconds.count(), ret };
}
// If fn returns void, only the time is returned
template <class Fn, class... Args>
double timer_void(Fn fn, Args... args) {
static_assert(std::is_void<decltype(fn(args...))>::value,
"Call timer for non void return type");
auto start = std::chrono::high_resolution_clock::now();
fn(args...);
auto end = std::chrono::high_resolution_clock::now();
std::chrono::duration<double> elapsed_seconds = end - start;
return elapsed_seconds.count();
}
void fun (std::size_t max) {
int a,b,c;
for (int i = 0; i < max; i++) {
a = 1234 + 5678 + i;
b = 1234 * 5678 + i;
c=1234/2+i;
}
}
int main () {
std::cout << timer_void(fun,2e6) << "\n"
<< timer_void(fun,2e8);
} | [
"francis.rammeloo@36614edc-3e3a-acb8-9062-c8ae0e4185df"
] | francis.rammeloo@36614edc-3e3a-acb8-9062-c8ae0e4185df |
49d74ab7da5fe4ec6e0e7b2a9959b4625720e52d | 0eff74b05b60098333ad66cf801bdd93becc9ea4 | /second/download/httpd/gumtree/httpd_old_log_6759.cpp | 95b7c52a5a29cf87bbbc098ecf4bb6bfb6036855 | [] | no_license | niuxu18/logTracker-old | 97543445ea7e414ed40bdc681239365d33418975 | f2b060f13a0295387fe02187543db124916eb446 | refs/heads/master | 2021-09-13T21:39:37.686481 | 2017-12-11T03:36:34 | 2017-12-11T03:36:34 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 177 | cpp | ap_log_cerror(APLOG_MARK, APLOG_DEBUG, status, io->c, APLOGNO(03387)
"h2_conn_io(%ld): FILE_to_scratch(%ld)",
io->c->id, (long)len); | [
"993273596@qq.com"
] | 993273596@qq.com |
8186f91c55eb59a181ea6718b6ed1becb212a1fc | 5c0895ef7a5295ec2614e0b50b30dc55d7d9ae12 | /osamazik.cpp | 749924d9f22b8736afc801a78d20c58eb211c6fd | [] | no_license | joydip10/Contest-problems | 48145353631ddccd40dc4e22069503c09676658e | dfe668089059a7dd30dd4b6ab436892bac7be207 | refs/heads/main | 2023-06-13T23:44:18.184129 | 2021-07-12T04:41:59 | 2021-07-12T04:41:59 | 385,126,396 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 333 | cpp | #include<iostream>
#include<stdio.h>
using namespace std;
int main()
{
int a,b;
for(int i=1;;i++)
{
scanf("%d %d",&a,&b);
if(a==0 && b==0) return 0;
else
{
double p=((double)a*(double)b)/(2*3.1416);
printf("Case %d: %.1lf\n",i,p);
}
}
return 0;
}
| [
"joydipdasNSTU@gmail.com"
] | joydipdasNSTU@gmail.com |
4e0b32640e509e862be0537d89f74ca0862548da | ee5d47e1b6d68ad1a0bb1b9d4d643ae8d576c668 | /programs/alpha/src/main.cpp | 44162dab7e40c2a1f47aefb84ca0a2ad891d7b22 | [
"MIT"
] | permissive | wichtounet/thor-os | c7008b69cbec11dac2daac60e588bf588cc65836 | 4fae8bb77cf4b3b34241c7004a32e8bca22a51e9 | refs/heads/develop | 2023-05-30T15:19:47.312478 | 2021-05-24T09:15:10 | 2021-05-24T09:15:10 | 13,440,471 | 1,743 | 217 | MIT | 2021-05-24T09:15:10 | 2013-10-09T11:28:24 | C++ | UTF-8 | C++ | false | false | 416 | cpp | //=======================================================================
// Copyright Baptiste Wicht 2013-2018.
// Distributed under the terms of the MIT License.
// (See accompanying file LICENSE or copy at
// http://www.opensource.org/licenses/MIT)
//=======================================================================
#include <tlib/system.hpp>
int main(int, char*[]){
tlib::alpha();
return 0;
}
| [
"baptiste.wicht@gmail.com"
] | baptiste.wicht@gmail.com |
9643a2579b02fa4632dbbb20c87464498519b6a7 | d38681cfcef7e817467358754dc9a50cc4e4b779 | /task_four_server/server.cpp | e6141407b41da7e23bd40ae9d28eaf1dba975ff9 | [] | no_license | emcvhkr/train_task | 7c6720e6ec06eff1456fc4f27f85f346cb4153e5 | c91eced21892fea0eb030b852ab8f5ae6d688162 | refs/heads/master | 2020-03-24T00:17:24.676009 | 2018-08-17T07:03:33 | 2018-08-17T07:03:33 | 142,283,890 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,442 | cpp | #include "server.h"
//
//PUBLIC
//
Server::Server(QObject *parent):QTcpServer(parent)
{
}
Server::~Server()
{}
void Server::incomingConnection(qintptr socketdescriptor)
{
qDebug()<<"New Connection!";
SocketThread *thread = new SocketThread(0,socketdescriptor);
connect(thread,SIGNAL(check_is_duplicate(QString)),this,SLOT(get_client_name(QString)));
connect(this,SIGNAL(send_check_result(bool)),thread,SLOT(get_duplicate_result(bool)));
connect(this,SIGNAL(let_thread_send(QJsonObject)),thread,SLOT(let_socket_send(QJsonObject)));
connect(thread,SIGNAL(append_client(one_client)),this,SLOT(get_append_client(one_client)));
connect(thread,SIGNAL(remove_client(QString)),this,SLOT(get_remove_client(QString)));
connect(thread,SIGNAL(logMsg(QString)),this,SIGNAL(send_log(QString)));
connect(thread,SIGNAL(send_talk(QJsonObject)),SLOT(send_to_all(QJsonObject)));
connect(thread,SIGNAL(finished()),this,SLOT(deleteLater()));
thread->start();
}
//
//PRIVATE
//
//向所有用户通知新用户加入
void Server::send_join_info(one_client client)
{
QJsonArray client_array;
for(int i=0;i<client_list.count();i++)
{
client_array.push_back(client_list.at(i).client_info);
}
QJsonObject reply_data,info_data;
QJsonValue name_value = client.client_info.value("name");
QString text = QString::fromLocal8Bit("用户[")+
name_value.toString()+
QString::fromLocal8Bit("]加入聊天");
info_data.insert("emoji","");
info_data.insert("pic","");
info_data.insert("text",text);
reply_data.insert("info",info_data);
reply_data.insert("id","server");
reply_data.insert("type","notice");
reply_data.insert("cmd","join");
reply_data.insert("result","");
reply_data.insert("reason","");
reply_data.insert("name",QString::fromLocal8Bit("系统"));
reply_data.insert("users",client_array);
//向所有用户发送
// for(int i=0;i<client_list.count();i++)
// {
// client_list.at(i).client_socket->sendMsg(reply_data);
// }
emit let_thread_send(reply_data);
}
//向所有用户通知用户退出
void Server::send_quit_info(QString client_name)
{
QJsonArray client_array;
for(int i=0;i<client_list.count();i++)
{
client_array.push_back(client_list.at(i).client_info);
}
QJsonObject reply_data,info_data;
QString text = QString::fromLocal8Bit("用户[")+
client_name+
QString::fromLocal8Bit("]退出聊天");
info_data.insert("emoji","");
info_data.insert("pic","");
info_data.insert("text",text);
reply_data.insert("info",info_data);
reply_data.insert("id","server");
reply_data.insert("type","notice");
reply_data.insert("cmd","quit");
reply_data.insert("result","");
reply_data.insert("reason","");
reply_data.insert("name",QString::fromLocal8Bit("系统"));
reply_data.insert("users",client_array);
emit let_thread_send(reply_data);
}
//
//PRIVATE SLOTS
//
//得到需要检查的用户名进行检查
void Server::get_client_name(QString client_name)
{
for(int i=0;i<client_list.count();i++)
{
QJsonObject client_info = client_list.at(i).client_info;
QJsonValue name_value = client_info.value("name");
if(client_name == name_value.toString())
{
qDebug()<<"duplicate";
emit send_check_result(true);
return;
}
}
qDebug()<<"not duplicate";
emit send_check_result(false);
}
//得到待入组的用户信息入组
void Server::get_append_client(one_client client)
{
mutex.lock();
client_list.append(client);
mutex.unlock();
qDebug()<<"Append list";
send_join_info(client);
}
//得到退出用户将其移出组
void Server::get_remove_client(QString client_name)
{
int pos = 0;
for(int i=0;i<client_list.count();i++)
{
QJsonObject client_info = client_list.at(i).client_info;
QJsonValue name_value = client_info.value("name");
if(client_name == name_value.toString())
{
//client_list.at(i).client_socket->close();
pos = i;
}
}
mutex.lock();
client_list.removeAt(pos);
mutex.unlock();
send_quit_info(client_name);
}
//服务器向所有客户端发送消息
void Server::send_to_all(QJsonObject jobj_data)
{
emit let_thread_send(jobj_data);
}
| [
"mali-2657216@163.com"
] | mali-2657216@163.com |
b36e184d0a7281909c6e485f7f0c70066a1e69cf | ce2a8c78f4e1bc8c2e06a4c5c0df533589eb4eb6 | /CS162/wk1/Determinant/main.cpp | 8653d959a58c48a0e64a9b66dfa5bd03af8dbb94 | [] | no_license | grykah/Coursework | f16f73a28883d8160746f1e50ec9f525b81bd190 | 35640f88d7f2086945e925e2ef0e18e67dbe14fd | refs/heads/master | 2023-01-09T12:29:03.256708 | 2020-11-05T00:58:07 | 2020-11-05T00:58:07 | 285,410,312 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,887 | cpp | /************************************************************************
** Program: main.cpp
** Author: Hailey Wilder
** Description: main using the readMatrix and determinant as specified
** in programming requirements
************************************************************************/
#include <iostream>
#include "readMatrix.h" //calls readMatrix
#include "determinant.h" //calls determinant
int main()
{
int selection; //later used to select the 2 or 3 matrix
int rows = 0;
int cols = 0;
int determinantValue = 0;
std::cout << "\n**Determinant Calculator** \n";
std::cout << "Matrix type:\n 1. \"2x2\"\n 2. \"3x3\"\n" << std::endl;
std::cin >> selection; //takes user selection
if (selection == 1)
{
rows = 2;
cols = 2;
}
else if (selection == 2)
{
rows = 3;
cols = 3;
}
else
{
std::cout << "Not recognized, please try later." << std::endl;
return 0; //exits the program
}
int **arr; //to pointers
arr = new int *[rows]; //create rows array
for (int i = 0; i < rows; i++) //create columns
arr[i] = new int [cols]; //points to a single array of colunms
readMatrix (arr, rows); //calls the readmatrix function
std::cout << "\nRESULTS\nYou Entered: \n";
int detArr [3][3];//create another array + copy original array + avoid unwanted modification
for(int x = 0; x < rows; x++) // loop 3 times for three rows
{
std::cout << "Row " << x << ": ";
for(int y=0; y < rows; y++) // loop for the three columns
{
std::cout << arr[x][y] << " "; // display the current element out of the array
detArr [x][y] = arr[x][y];
}
std::cout << std::endl; //when the inner loop is done, go to a new line
}
determinantValue = determinant (detArr, rows);//calculates the determinant
std::cout << "\nDeterminant = " << determinantValue << "\n";
return 0;
} | [
"grykah@gmail.com"
] | grykah@gmail.com |
43feeb41dd861d19123f9a81c6b62f3902efab88 | ccfe4094847ca44b9cd3e2b747964b1063132355 | /C++/micerun.cpp | e288a7de795a0f575833dcdcee12eef49c25e806 | [] | no_license | dils12001/C_Practice | 53fdee47a17e0c0e69ff01318cdd727fa2dab291 | c80d6698c048eb03dfef0bf52b5f1faaaaf26272 | refs/heads/master | 2023-08-01T00:13:16.521740 | 2021-09-04T11:23:14 | 2021-09-04T11:23:14 | 403,036,972 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 235 | cpp | #include <iostream>
void Three(void);
void See(void);
using namespace std;
int main()
{
Three();
Three();
See();
See();
}
void Three()
{
cout << "Three blind mice" << endl;
}
void See()
{
cout << "See how they run" << endl;
} | [
"dils210293@gmail.com"
] | dils210293@gmail.com |
a4556fd9a49106f70f97c4a84334d415f4775c41 | 9a11be058cf3a1ef7984c3a861e406b7fa959db6 | /bullet.h | 979826f9d85f6eb3abdcee619fcc168dd8d6dd4a | [] | no_license | Weh18095982632/2019202417-bh | 521a000ad3d462cdf9b9e32e9172d2a7c18cd4cb | d38dcf46c29fa7d55d56ecdbe107f0ec021ed7e3 | refs/heads/master | 2022-11-05T20:32:48.020789 | 2020-06-28T10:16:57 | 2020-06-28T10:16:57 | 269,961,295 | 0 | 0 | null | 2020-06-18T05:30:20 | 2020-06-06T11:32:11 | C++ | UTF-8 | C++ | false | false | 830 | h | #ifndef BULLET_H
#define BULLET_H
#include <QPoint>
#include <QSize>
#include <QPixmap>
#include <QObject>
class QPainter;
class MyWidget;
class FearfulEnemy;
class Bullet : QObject
{
Q_OBJECT
Q_PROPERTY(QPoint m_currentPos READ currentPos WRITE setCurrentPos)
public:
Bullet(QPoint startPos, QPoint targetPoint, int damage, FearfulEnemy *target,
MyWidget *game, const QPixmap &sprite = QPixmap(":/image/bullet.png"));
void draw(QPainter *painter) const;
void move();
void setCurrentPos(QPoint pos);
QPoint currentPos() const;
private slots:
void hitTarget();
private:
const QPoint m_startPos;
const QPoint m_targetPos;
const QPixmap m_sprite;
QPoint m_currentPos;
FearfulEnemy * m_target;
MyWidget * m_game;
int m_damage;
static const QSize ms_fixedSize;
};
#endif // BULLET_H
| [
"noreply@github.com"
] | noreply@github.com |
a051697d9aef25025f18d51e44c6555517e467d8 | f7756475221d7f78cd07bf084e0b916410b5a04a | /junk/lib/util/geometry.cpp | fd05839d63935b7af39544603701bdd6cdd7fe31 | [] | no_license | olegsidorkin/war-balls | 294309900a62108cf10bba2ce0876e0da30e6925 | e20823ad95b5ccb112e770a73192c30439ae4073 | refs/heads/master | 2020-05-20T19:24:15.763734 | 2015-05-19T17:08:37 | 2015-05-19T17:08:37 | 36,093,833 | 0 | 0 | null | 2015-05-22T20:29:32 | 2015-05-22T20:29:32 | null | UTF-8 | C++ | false | false | 711 | cpp | #include "util/geometry.h"
#include <cassert>
#include <cmath>
double ab::Length(const ab::Point point)
{
return sqrt(point.x * point.x + point.y * point.y);
}
double ab::Distance(const ab::Point lhs, const ab::Point rhs)
{
return sqrt((lhs.x - rhs.x) * (lhs.x - rhs.x) + (lhs.y - rhs.y) * (lhs.y - rhs.y));
}
void ab::Normalize(ab::Point * const point)
{
assert(nullptr != point);
const double length = Length(*point);
point->x /= length;
point->y /= length;
}
bool ab::Intersect(const ab::Point lhs_center, const double lhs_radius,
const ab::Point rhs_center, const double rhs_radius)
{
return Distance(lhs_center, rhs_center) <= lhs_radius + rhs_radius;
}
| [
"yellowduck@yandex-team.ru"
] | yellowduck@yandex-team.ru |
820e709dba01edb8812dfeeb69fa8fcacff82408 | 007f223ef91db87322d4983079bd3f32b675410a | /include/Employee.h | 8bc2f483e915feb9e42e961146de761ab8ffd858 | [] | no_license | RedBoxer/tp-lab-6 | 8c6f8b51b3e22a732d8639d7a60d2665c2fdbcfb | 9e9b2bbac0b183950055323c48eb58aa154b0119 | refs/heads/master | 2021-01-07T02:18:41.164995 | 2020-03-07T18:46:16 | 2020-03-07T18:46:16 | 241,551,084 | 0 | 0 | null | 2020-02-19T06:39:03 | 2020-02-19T06:39:02 | null | UTF-8 | C++ | false | false | 911 | h | #ifndef EMPLOYEE_H
#define EMPLOYEE_H
#include <string>
class Employee
{
public:
Employee();
Employee(std::string name){this->name = name;};
void setName(std::string name){this->name = name;};
void setSal(int payment){this->payment = payment;};
void setId(int id){this->id = id;};
void setPosition(std::string position){this->position = position;};
void setWorktime(int worktime){this->worktime = worktime;};
std::string getName(){return this->name;};
int getSal(){return this->payment;};
int getWorktime(){return this->worktime;};
int getId(){return this->id;};
std::string getPosition(){return this->position;};
std::string toString();
private:
std::string name;
int payment = 0;
int id;
int worktime = 0;
std::string position;
};
#endif // EMPLOYEE_H
| [
"52marba@mail.ru"
] | 52marba@mail.ru |
1da4350ec8938cf3118bee41450b706b91d754a1 | 21ede326b6cfcf5347ca6772d392d3acca80cfa0 | /content/renderer/media/webrtc/mock_peer_connection_impl.h | 6905b976b4cf34eac76cb5f8be088dfe8ea73a50 | [
"BSD-3-Clause"
] | permissive | csagan5/kiwi | 6eaab0ab4db60468358291956506ad6f889401f8 | eb2015c28925be91b4a3130b3c2bee2f5edc91de | refs/heads/master | 2020-04-04T17:06:54.003121 | 2018-10-24T08:20:01 | 2018-10-24T08:20:01 | 156,107,399 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 9,650 | h | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CONTENT_RENDERER_MEDIA_WEBRTC_MOCK_PEER_CONNECTION_IMPL_H_
#define CONTENT_RENDERER_MEDIA_WEBRTC_MOCK_PEER_CONNECTION_IMPL_H_
#include <memory>
#include <string>
#include "base/compiler_specific.h"
#include "base/logging.h"
#include "base/macros.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "third_party/webrtc/api/peerconnectioninterface.h"
#include "third_party/webrtc/api/stats/rtcstatsreport.h"
namespace content {
class MockPeerConnectionDependencyFactory;
class MockStreamCollection;
class FakeRtpSender : public webrtc::RtpSenderInterface {
public:
FakeRtpSender(rtc::scoped_refptr<webrtc::MediaStreamTrackInterface> track);
~FakeRtpSender() override;
bool SetTrack(webrtc::MediaStreamTrackInterface* track) override;
rtc::scoped_refptr<webrtc::MediaStreamTrackInterface> track() const override;
uint32_t ssrc() const override;
cricket::MediaType media_type() const override;
std::string id() const override;
std::vector<std::string> stream_ids() const override;
webrtc::RtpParameters GetParameters() override;
webrtc::RTCError SetParameters(
const webrtc::RtpParameters& parameters) override;
rtc::scoped_refptr<webrtc::DtmfSenderInterface> GetDtmfSender()
const override;
private:
rtc::scoped_refptr<webrtc::MediaStreamTrackInterface> track_;
};
class FakeRtpReceiver : public webrtc::RtpReceiverInterface {
public:
FakeRtpReceiver(rtc::scoped_refptr<webrtc::MediaStreamTrackInterface> track,
std::vector<rtc::scoped_refptr<webrtc::MediaStreamInterface>>
streams = {});
~FakeRtpReceiver() override;
rtc::scoped_refptr<webrtc::MediaStreamTrackInterface> track() const override;
std::vector<rtc::scoped_refptr<webrtc::MediaStreamInterface>> streams()
const override;
cricket::MediaType media_type() const override;
std::string id() const override;
webrtc::RtpParameters GetParameters() const override;
bool SetParameters(const webrtc::RtpParameters& parameters) override;
void SetObserver(webrtc::RtpReceiverObserverInterface* observer) override;
std::vector<webrtc::RtpSource> GetSources() const override;
private:
rtc::scoped_refptr<webrtc::MediaStreamTrackInterface> track_;
std::vector<rtc::scoped_refptr<webrtc::MediaStreamInterface>> streams_;
};
// TODO(hbos): The use of fakes and mocks is the wrong approach for testing of
// this. It introduces complexity, is error prone (not testing the right thing
// and bugs in the mocks). This class is a maintenance burden and should be
// removed. https://crbug.com/788659
class MockPeerConnectionImpl : public webrtc::PeerConnectionInterface {
public:
explicit MockPeerConnectionImpl(MockPeerConnectionDependencyFactory* factory,
webrtc::PeerConnectionObserver* observer);
// PeerConnectionInterface implementation.
rtc::scoped_refptr<webrtc::StreamCollectionInterface>
local_streams() override;
rtc::scoped_refptr<webrtc::StreamCollectionInterface>
remote_streams() override;
bool AddStream(webrtc::MediaStreamInterface* local_stream) override {
NOTIMPLEMENTED();
return false;
}
void RemoveStream(webrtc::MediaStreamInterface* local_stream) override {
NOTIMPLEMENTED();
}
// TODO(hbos): Use AddTrack() taking stream labels instead of stream pointers.
// https://crbug.com/810708
rtc::scoped_refptr<webrtc::RtpSenderInterface> AddTrack(
webrtc::MediaStreamTrackInterface* track,
std::vector<webrtc::MediaStreamInterface*> streams) override;
bool RemoveTrack(webrtc::RtpSenderInterface* sender) override;
std::vector<rtc::scoped_refptr<webrtc::RtpSenderInterface>> GetSenders()
const override;
std::vector<rtc::scoped_refptr<webrtc::RtpReceiverInterface>> GetReceivers()
const override;
rtc::scoped_refptr<webrtc::DataChannelInterface>
CreateDataChannel(const std::string& label,
const webrtc::DataChannelInit* config) override;
bool GetStats(webrtc::StatsObserver* observer,
webrtc::MediaStreamTrackInterface* track,
StatsOutputLevel level) override;
void GetStats(webrtc::RTCStatsCollectorCallback* callback) override;
void GetStats(
rtc::scoped_refptr<webrtc::RtpSenderInterface> selector,
rtc::scoped_refptr<webrtc::RTCStatsCollectorCallback> callback) override;
void GetStats(
rtc::scoped_refptr<webrtc::RtpReceiverInterface> selector,
rtc::scoped_refptr<webrtc::RTCStatsCollectorCallback> callback) override;
// Call this function to make sure next call to legacy GetStats fail.
void SetGetStatsResult(bool result) { getstats_result_ = result; }
// Set the report that |GetStats(RTCStatsCollectorCallback*)| returns.
void SetGetStatsReport(webrtc::RTCStatsReport* report);
SignalingState signaling_state() override {
NOTIMPLEMENTED();
return PeerConnectionInterface::kStable;
}
IceConnectionState ice_connection_state() override {
NOTIMPLEMENTED();
return PeerConnectionInterface::kIceConnectionNew;
}
IceGatheringState ice_gathering_state() override {
NOTIMPLEMENTED();
return PeerConnectionInterface::kIceGatheringNew;
}
bool StartRtcEventLog(rtc::PlatformFile file,
int64_t max_size_bytes) override {
NOTIMPLEMENTED();
return false;
}
void StopRtcEventLog() override { NOTIMPLEMENTED(); }
MOCK_METHOD0(Close, void());
const webrtc::SessionDescriptionInterface* local_description() const override;
const webrtc::SessionDescriptionInterface* remote_description()
const override;
// JSEP01 APIs
void CreateOffer(webrtc::CreateSessionDescriptionObserver* observer,
const RTCOfferAnswerOptions& options) override;
void CreateAnswer(webrtc::CreateSessionDescriptionObserver* observer,
const RTCOfferAnswerOptions& options) override;
MOCK_METHOD2(SetLocalDescription,
void(webrtc::SetSessionDescriptionObserver* observer,
webrtc::SessionDescriptionInterface* desc));
void SetLocalDescriptionWorker(
webrtc::SetSessionDescriptionObserver* observer,
webrtc::SessionDescriptionInterface* desc);
// TODO(hbos): Remove once no longer mandatory to implement.
MOCK_METHOD2(SetRemoteDescription,
void(webrtc::SetSessionDescriptionObserver* observer,
webrtc::SessionDescriptionInterface* desc));
void SetRemoteDescription(
std::unique_ptr<webrtc::SessionDescriptionInterface> desc,
rtc::scoped_refptr<webrtc::SetRemoteDescriptionObserverInterface>
observer) override {
SetRemoteDescriptionForMock(&desc, &observer);
}
// Work-around due to MOCK_METHOD being unable to handle move-only arguments.
MOCK_METHOD2(
SetRemoteDescriptionForMock,
void(std::unique_ptr<webrtc::SessionDescriptionInterface>* desc,
rtc::scoped_refptr<webrtc::SetRemoteDescriptionObserverInterface>*
observer));
void SetRemoteDescriptionWorker(
webrtc::SetSessionDescriptionObserver* observer,
webrtc::SessionDescriptionInterface* desc);
bool SetConfiguration(const RTCConfiguration& configuration,
webrtc::RTCError* error) override;
bool AddIceCandidate(const webrtc::IceCandidateInterface* candidate) override;
void RegisterUMAObserver(webrtc::UMAObserver* observer) override;
webrtc::RTCError SetBitrate(const webrtc::BitrateSettings& bitrate) override;
void AddRemoteStream(webrtc::MediaStreamInterface* stream);
const std::string& stream_label() const { return stream_label_; }
bool hint_audio() const { return hint_audio_; }
bool hint_video() const { return hint_video_; }
const std::string& description_sdp() const { return description_sdp_; }
const std::string& sdp_mid() const { return sdp_mid_; }
int sdp_mline_index() const { return sdp_mline_index_; }
const std::string& ice_sdp() const { return ice_sdp_; }
webrtc::SessionDescriptionInterface* created_session_description() const {
return created_sessiondescription_.get();
}
webrtc::PeerConnectionObserver* observer() {
return observer_;
}
void set_setconfiguration_error_type(webrtc::RTCErrorType error_type) {
setconfiguration_error_type_ = error_type;
}
static const char kDummyOffer[];
static const char kDummyAnswer[];
protected:
~MockPeerConnectionImpl() override;
private:
// Used for creating MockSessionDescription.
MockPeerConnectionDependencyFactory* dependency_factory_;
std::string stream_label_;
rtc::scoped_refptr<MockStreamCollection> local_streams_;
rtc::scoped_refptr<MockStreamCollection> remote_streams_;
std::vector<rtc::scoped_refptr<FakeRtpSender>> senders_;
std::unique_ptr<webrtc::SessionDescriptionInterface> local_desc_;
std::unique_ptr<webrtc::SessionDescriptionInterface> remote_desc_;
std::unique_ptr<webrtc::SessionDescriptionInterface>
created_sessiondescription_;
bool hint_audio_;
bool hint_video_;
bool getstats_result_;
std::string description_sdp_;
std::string sdp_mid_;
int sdp_mline_index_;
std::string ice_sdp_;
webrtc::PeerConnectionObserver* observer_;
webrtc::RTCErrorType setconfiguration_error_type_ =
webrtc::RTCErrorType::NONE;
rtc::scoped_refptr<webrtc::RTCStatsReport> stats_report_;
DISALLOW_COPY_AND_ASSIGN(MockPeerConnectionImpl);
};
} // namespace content
#endif // CONTENT_RENDERER_MEDIA_WEBRTC_MOCK_PEER_CONNECTION_IMPL_H_
| [
"team@geometry.ee"
] | team@geometry.ee |
168cb22b48643977d35e57bf76851d58784dbcc2 | 859dfbfd556b64258b1027a7e1612d0989282287 | /shindig/sound_system.cpp | b9bfda19861200e602b50d88e8be1958b98cd4e8 | [] | no_license | mrdooz/shindig | cd8bfa1d499696fcc7d581b81d3838c3464dd2dc | c1493612e325af3153e4e075f099aaa21d8db04f | refs/heads/master | 2021-01-21T12:06:23.694256 | 2011-04-20T19:15:57 | 2011-04-20T19:15:57 | 538,542 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 47 | cpp | #include "stdafx.h"
#include "sound_system.hpp" | [
"dooz@spotify.com"
] | dooz@spotify.com |
ac11eaca5adf8a3609206c215dc74f129c10259e | fe91ffa11707887e4cdddde8f386a8c8e724aa58 | /chrome/browser/flags/android/chrome_feature_list.h | 39f3cdce84b6139c10c19686fb692457e0fdeb4f | [
"BSD-3-Clause"
] | permissive | akshaymarch7/chromium | 78baac2b45526031846ccbaeca96c639d1d60ace | d273c844a313b1e527dec0d59ce70c95fd2bd458 | refs/heads/master | 2023-02-26T23:48:03.686055 | 2020-04-15T01:20:07 | 2020-04-15T01:20:07 | 255,778,651 | 2 | 1 | BSD-3-Clause | 2020-04-15T02:04:56 | 2020-04-15T02:04:55 | null | UTF-8 | C++ | false | false | 6,545 | h | // Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_FLAGS_ANDROID_CHROME_FEATURE_LIST_H_
#define CHROME_BROWSER_FLAGS_ANDROID_CHROME_FEATURE_LIST_H_
#include <base/feature_list.h>
#include <jni.h>
namespace chrome {
namespace android {
// Alphabetical:
extern const base::Feature kAdjustWebApkInstallationSpace;
extern const base::Feature kAllowNewIncognitoTabIntents;
extern const base::Feature kAllowRemoteContextForNotifications;
extern const base::Feature kAndroidBlockIntentNonSafelistedHeaders;
extern const base::Feature kAndroidNightModeTabReparenting;
extern const base::Feature kAndroidPartnerCustomizationPhenotype;
extern const base::Feature kAndroidPayIntegrationV1;
extern const base::Feature kAndroidPayIntegrationV2;
extern const base::Feature kAndroidPaymentApps;
extern const base::Feature kAndroidSearchEngineChoiceNotification;
extern const base::Feature kBackgroundTaskComponentUpdate;
extern const base::Feature kBookmarksShowInFolder;
extern const base::Feature kCloseTabSuggestions;
extern const base::Feature kCastDeviceFilter;
extern const base::Feature kCCTBackgroundTab;
extern const base::Feature kCCTClientDataHeader;
extern const base::Feature kCCTExternalLinkHandling;
extern const base::Feature kCCTIncognito;
extern const base::Feature kCCTPostMessageAPI;
extern const base::Feature kCCTRedirectPreconnect;
extern const base::Feature kCCTReportParallelRequestStatus;
extern const base::Feature kCCTResourcePrefetch;
extern const base::Feature kCCTTargetTranslateLanguage;
extern const base::Feature kChromeDuetFeature;
extern const base::Feature kChromeDuetAdaptive;
extern const base::Feature kDontAutoHideBrowserControls;
extern const base::Feature kChromeDuetLabeled;
extern const base::Feature kChromeShareScreenshot;
extern const base::Feature kChromeSharingHub;
extern const base::Feature kChromeSmartSelection;
extern const base::Feature kCommandLineOnNonRooted;
extern const base::Feature kContactsPickerSelectAll;
extern const base::Feature kContentIndexingDownloadHome;
extern const base::Feature kContentIndexingNTP;
extern const base::Feature kContextMenuCopyImage;
extern const base::Feature kContextMenuPerformanceInfo;
extern const base::Feature kContextMenuSearchWithGoogleLens;
extern const base::Feature kContentSuggestionsScrollToLoad;
extern const base::Feature kContextualSearchDebug;
extern const base::Feature kContextualSearchDefinitions;
extern const base::Feature kContextualSearchLongpressResolve;
extern const base::Feature kContextualSearchMlTapSuppression;
extern const base::Feature kContextualSearchSecondTap;
extern const base::Feature kContextualSearchTapDisableOverride;
extern const base::Feature kContextualSearchTranslations;
extern const base::Feature kDarkenWebsitesCheckboxInThemesSetting;
extern const base::Feature kDirectActions;
extern const base::Feature kDontPrefetchLibraries;
extern const base::Feature kDownloadAutoResumptionThrottling;
extern const base::Feature kDownloadFileProvider;
extern const base::Feature kDownloadNotificationBadge;
extern const base::Feature kDownloadProgressInfoBar;
extern const base::Feature kDownloadRename;
extern const base::Feature kDrawVerticallyEdgeToEdge;
extern const base::Feature kDuetTabStripIntegrationAndroid;
extern const base::Feature kEphemeralTabUsingBottomSheet;
extern const base::Feature kExploreSites;
extern const base::Feature kFocusOmniboxInIncognitoTabIntents;
extern const base::Feature kHandleMediaIntents;
extern const base::Feature kHomepageLocation;
extern const base::Feature kHomepageSettingsUIConversion;
extern const base::Feature kHorizontalTabSwitcherAndroid;
extern const base::Feature kImmersiveUiMode;
extern const base::Feature kImprovedA2HS;
extern const base::Feature kInlineUpdateFlow;
extern const base::Feature kInstantStart;
extern const base::Feature kKitKatSupported;
extern const base::Feature kLanguagesPreference;
extern const base::Feature kNewPhotoPicker;
extern const base::Feature kNotificationSuspender;
extern const base::Feature kOfflineIndicatorV2;
extern const base::Feature kOmniboxSpareRenderer;
extern const base::Feature kOverlayNewLayout;
extern const base::Feature kPayWithGoogleV1;
extern const base::Feature kPhotoPickerVideoSupport;
extern const base::Feature kPhotoPickerZoom;
extern const base::Feature kQueryTiles;
extern const base::Feature kReachedCodeProfiler;
extern const base::Feature kReorderBookmarks;
extern const base::Feature kReaderModeInCCT;
extern const base::Feature kRelatedSearches;
extern const base::Feature kRevampedContextMenu;
extern const base::Feature kScrollToExpandPaymentHandler;
extern const base::Feature kSearchEnginePromoExistingDevice;
extern const base::Feature kSearchEnginePromoNewDevice;
extern const base::Feature kServiceManagerForBackgroundPrefetch;
extern const base::Feature kServiceManagerForDownload;
extern const base::Feature kShareButtonInTopToolbar;
extern const base::Feature kShoppingAssist;
extern const base::Feature kSpannableInlineAutocomplete;
extern const base::Feature kSpecialLocaleWrapper;
extern const base::Feature kSpecialUserDecision;
extern const base::Feature kSwapPixelFormatToFixConvertFromTranslucent;
extern const base::Feature kTabEngagementReportingAndroid;
extern const base::Feature kTabGroupsAndroid;
extern const base::Feature kTabGroupsContinuationAndroid;
extern const base::Feature kTabGroupsUiImprovementsAndroid;
extern const base::Feature kTabGridLayoutAndroid;
extern const base::Feature kTabReparenting;
extern const base::Feature kTabSwitcherOnReturn;
extern const base::Feature kTabToGTSAnimation;
extern const base::Feature kTestDefaultDisabled;
extern const base::Feature kTestDefaultEnabled;
extern const base::Feature kTrustedWebActivityPostMessage;
extern const base::Feature kStartSurfaceAndroid;
extern const base::Feature kUmaBackgroundSessions;
extern const base::Feature kUpdateNotificationSchedulingIntegration;
extern const base::Feature
kUpdateNotificationScheduleServiceImmediateShowOption;
extern const base::Feature kUsageStatsFeature;
extern const base::Feature kUserMediaScreenCapturing;
extern const base::Feature kVideoPersistence;
extern const base::Feature kVrBrowsingFeedback;
extern const base::Feature kWebApkAdaptiveIcon;
extern const base::Feature kPrefetchNotificationSchedulingIntegration;
} // namespace android
} // namespace chrome
#endif // CHROME_BROWSER_FLAGS_ANDROID_CHROME_FEATURE_LIST_H_
| [
"commit-bot@chromium.org"
] | commit-bot@chromium.org |
1093393e6bfd563841a363c986820126cbfffc11 | 522ffc7b7c2f729e238ad75223115a07540b9b17 | /Classes/CheckScene.h | 8f9997aecf36f4ccd5bf8fe37dcfbfc5681ce5f3 | [] | no_license | riverreal/MillionCode | 4644c840c862874dfbfaf50adcdab3570a0a3c66 | aea8d0dc5c6de1b59fba7f3472de39ede366e73f | refs/heads/master | 2021-01-10T18:44:04.746597 | 2015-10-09T13:12:25 | 2015-10-09T13:12:25 | 42,501,345 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 2,056 | h | #ifndef __MillionCode__CheckScene__
#define __MillionCode__CheckScene__
#include <cocos2d.h>
#include <string>
#include "DataKey.h"
#include "MonsterEqData.h"
#include "Generic.h"
#include "Live2DSprite.h"
#include "tinyxml2/tinyxml2.h"
#include "platform/CCFileUtils.h"
class CheckScene : public cocos2d::Layer
{
private:
enum
{
CHANGE_OPTION,
STATUS_OPTION,
RESET_OPTION
};
enum
{
FIRST_MONSTER,
SECOND_MONSTER,
THIRD_MONSTER
};
cocos2d::Size m_VisibleSize;
cocos2d::Point origin;
ST st;
float m_Mag;
bool m_selectedMon[3];
bool m_onSubmenu;
cocos2d::Sprite* m_changeBtn;
cocos2d::Sprite* m_statusBtn;
cocos2d::Sprite* m_resetBtn;
cocos2d::Label* m_monsterName;
//change sub menu
cocos2d::Menu* m_changeMenu;
cocos2d::Label* m_changeIntruction;
cocos2d::Label* m_denyalMsg;
cocos2d::MenuItemImage* monsterItem[2];
//stats sub menu
Live2DSprite* m_live2dMonster;
cocos2d::Label* m_name;
cocos2d::Label* m_HP;
cocos2d::Label* m_Special;
cocos2d::Label* m_wins;
float buttonWidth;
cocos2d::Sprite* monsterSlot[3];
tinyxml2::XMLDocument doc;
bool m_isPressed[3];
bool m_isMonPressed[3];
bool m_btnIsReady;
public:
static cocos2d::Scene* createScene();
virtual bool init();
//initialization
void setUi();
void displayBG();
void setMonster();
void eventHandler();
//animation related
void resetMenu();
void animateButtons(int option);
void animateMonsters(int option);
//sub menu processes
void statsView(int selectedMonster);
void changeOrder(int selectedMonster);
void resetStats(int selectedMonster);
//callback related
void enableButtons();
void changeOrderCallback(cocos2d::Ref* pSender, int option, int slot, int current);
void menuReturnCallback(cocos2d::Ref* pSender);
void exitScene();
//event handling
bool onTouchBegan(cocos2d::Touch* touch, cocos2d::Event* eventt);
void onTouchEnded(cocos2d::Touch* touch, cocos2d::Event* eventt);
CREATE_FUNC(CheckScene);
};
#endif /* defined(__MillionCode__CheckScene__) */
| [
"riverreal@hotmail.com"
] | riverreal@hotmail.com |
1ab40a4cc45b8cac6b5b1591e2be55ca56e05f94 | 13ee38271259e1ad931ab707af569947c6560604 | /cvt_colour/solution1/syn/systemc/image_filter_mul_bkb.h | 18e7134a61970072cc6bdc9355ffe7d6d02d5e64 | [] | no_license | baymuhend1s/Hackster | 6d205667abd7edb98eaedb23a8df2c734c872a48 | 430230fc0cfca0c2108baed7470be8551cf9165c | refs/heads/master | 2023-03-16T13:33:03.106238 | 2020-08-03T08:43:22 | 2020-08-03T08:43:22 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,127 | h | // ==============================================================
// File generated on Tue Apr 09 13:10:00 +0100 2019
// Vivado(TM) HLS - High-Level Synthesis from C, C++ and SystemC v2018.3 (64-bit)
// SW Build 2405991 on Thu Dec 6 23:38:27 MST 2018
// IP Build 2404404 on Fri Dec 7 01:43:56 MST 2018
// Copyright 1986-2018 Xilinx, Inc. All Rights Reserved.
// ==============================================================
#ifndef __image_filter_mul_bkb__HH__
#define __image_filter_mul_bkb__HH__
#include "ACMP_smul_uu.h"
#include <systemc>
template<
int ID,
int NUM_STAGE,
int din0_WIDTH,
int din1_WIDTH,
int dout_WIDTH>
SC_MODULE(image_filter_mul_bkb) {
sc_core::sc_in< sc_dt::sc_lv<din0_WIDTH> > din0;
sc_core::sc_in< sc_dt::sc_lv<din1_WIDTH> > din1;
sc_core::sc_out< sc_dt::sc_lv<dout_WIDTH> > dout;
ACMP_smul_uu<ID, 1, din0_WIDTH, din1_WIDTH, dout_WIDTH> ACMP_smul_uu_U;
SC_CTOR(image_filter_mul_bkb): ACMP_smul_uu_U ("ACMP_smul_uu_U") {
ACMP_smul_uu_U.din0(din0);
ACMP_smul_uu_U.din1(din1);
ACMP_smul_uu_U.dout(dout);
}
};
#endif //
| [
"aptaylor@theiet.org"
] | aptaylor@theiet.org |
05a909cfaf03afb60946542804946e919da80836 | 2029051667398cfa3a125ca6c0bf6fd087a3c741 | /dev/so_5/disp/adv_thread_pool/h/pub.hpp | dc422c50584f22bf12391d76cec12ee18c8d3741 | [
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | nk0leg/so-5-5 | 865c5a775facc27fcdf6766fe635344a7257c432 | ee35a8c8a7e1080faca9b5760e9deece94481ef3 | refs/heads/master | 2021-01-11T21:06:05.865721 | 2016-09-29T07:53:43 | 2016-09-29T07:53:43 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 12,970 | hpp | /*
* SObjectizer-5
*/
/*!
* \since
* v.5.4.0
*
* \file
* \brief Public interface of advanced thread pool dispatcher.
*/
#pragma once
#include <so_5/h/declspec.hpp>
#include <so_5/rt/h/disp_binder.hpp>
#include <so_5/disp/mpmc_queue_traits/h/pub.hpp>
#include <so_5/disp/reuse/h/work_thread_activity_tracking.hpp>
#include <utility>
namespace so_5
{
namespace disp
{
namespace adv_thread_pool
{
/*!
* \brief Alias for namespace with traits of event queue.
*
* \since
* v.5.5.11
*/
namespace queue_traits = so_5::disp::mpmc_queue_traits;
//
// disp_params_t
//
/*!
* \brief Parameters for %adv_thread_pool dispatcher.
*
* \since
* v.5.5.11
*/
class disp_params_t
: public so_5::disp::reuse::work_thread_activity_tracking_flag_mixin_t< disp_params_t >
{
using activity_tracking_mixin_t = so_5::disp::reuse::
work_thread_activity_tracking_flag_mixin_t< disp_params_t >;
public :
//! Default constructor.
disp_params_t() {}
//! Copy constructor.
disp_params_t( const disp_params_t & o )
: activity_tracking_mixin_t( o )
, m_thread_count{ o.m_thread_count }
, m_queue_params{ o.m_queue_params }
{}
//! Move constructor.
disp_params_t( disp_params_t && o )
: activity_tracking_mixin_t( std::move(o) )
, m_thread_count{ std::move(o.m_thread_count) }
, m_queue_params{ std::move(o.m_queue_params) }
{}
friend inline void swap( disp_params_t & a, disp_params_t & b )
{
swap(
static_cast< activity_tracking_mixin_t & >(a),
static_cast< activity_tracking_mixin_t & >(b) );
std::swap( a.m_thread_count, b.m_thread_count );
swap( a.m_queue_params, b.m_queue_params );
}
//! Copy operator.
disp_params_t & operator=( const disp_params_t & o )
{
disp_params_t tmp{ o };
swap( *this, tmp );
return *this;
}
//! Move operator.
disp_params_t & operator=( disp_params_t && o )
{
disp_params_t tmp{ std::move(o) };
swap( *this, tmp );
return *this;
}
//! Setter for thread count.
disp_params_t &
thread_count( std::size_t count )
{
m_thread_count = count;
return *this;
}
//! Getter for thread count.
std::size_t
thread_count() const
{
return m_thread_count;
}
//! Setter for queue parameters.
disp_params_t &
set_queue_params( queue_traits::queue_params_t p )
{
m_queue_params = std::move(p);
return *this;
}
//! Tuner for queue parameters.
/*!
* Accepts lambda-function or functional object which tunes
* queue parameters.
\code
using namespace so_5::disp::thread_pool;
create_private_disp( env,
"workers_disp",
disp_params_t{}
.thread_count( 10 )
.tune_queue_params(
[]( queue_traits::queue_params_t & p ) {
p.lock_factory( queue_traits::simple_lock_factory() );
} ) );
\endcode
*/
template< typename L >
disp_params_t &
tune_queue_params( L tunner )
{
tunner( m_queue_params );
return *this;
}
//! Getter for queue parameters.
const queue_traits::queue_params_t &
queue_params() const
{
return m_queue_params;
}
private :
//! Count of working threads.
/*!
* Value 0 means that actual thread will be detected automatically.
*/
std::size_t m_thread_count = { 0 };
//! Queue parameters.
queue_traits::queue_params_t m_queue_params;
};
//
// fifo_t
//
/*!
* \brief Type of FIFO mechanism for agent's demands.
*
* \since
* v.5.4.0
*/
enum class fifo_t
{
//! A FIFO for demands for all agents from the same cooperation.
/*!
* It means that agents from the same cooperation for which this
* FIFO mechanism is used will be worked on the same thread.
*/
cooperation,
//! A FIFO for demands only for one agent.
/*!
* It means that FIFO is only supported for the concrete agent.
* If several agents from a cooperation have this FIFO type they
* will process demands independently and on different threads.
*/
individual
};
//
// bind_params_t
//
/*!
* \brief Parameters for binding agents to %adv_thread_pool dispatcher.
*
* \since
* v.5.5.11
*/
class bind_params_t
{
public :
//! Set FIFO type.
bind_params_t &
fifo( fifo_t v )
{
m_fifo = v;
return *this;
}
//! Get FIFO type.
fifo_t
query_fifo() const
{
return m_fifo;
}
private :
//! FIFO type.
fifo_t m_fifo = { fifo_t::cooperation };
};
//
// params_t
//
/*!
* \brief Alias for bind_params.
*
* \since
* v.5.4.0
*
* \deprecated Since v.5.5.11 bind_params_t must be used instead.
*/
using params_t = bind_params_t;
//
// default_thread_pool_size
//
/*!
* \brief A helper function for detecting default thread count for
* thread pool.
*
* \since
* v.5.4.0
*/
inline std::size_t
default_thread_pool_size()
{
auto c = std::thread::hardware_concurrency();
if( !c )
c = 2;
return c;
}
//
// private_dispatcher_t
//
/*!
* \brief An interface for %adv_thread_pool private dispatcher.
*
* \since
* v.5.5.4
*/
class SO_5_TYPE private_dispatcher_t : public so_5::atomic_refcounted_t
{
public :
virtual ~private_dispatcher_t();
//! Create a binder for that private dispatcher.
virtual disp_binder_unique_ptr_t
binder(
//! Binding parameters for the agent.
const bind_params_t & params ) = 0;
//! Create a binder for that private dispatcher.
/*!
* This method allows parameters tuning via lambda-function
* or other functional objects.
*/
template< typename SETTER >
inline disp_binder_unique_ptr_t
binder(
//! Function for the parameters tuning.
SETTER params_setter )
{
bind_params_t p;
params_setter( p );
return this->binder( p );
}
};
/*!
* \brief A handle for the %adv_thread_pool private dispatcher.
*
* \since
* v.5.5.4
*/
using private_dispatcher_handle_t =
so_5::intrusive_ptr_t< private_dispatcher_t >;
//
// create_disp
//
/*!
* \brief Create %adv_thread_pool dispatcher instance to be used as
* named dispatcher.
*
* \since
* v.5.5.11
*
* \par Usage sample
\code
so_5::launch( []( so_5::environment_t & env ) {...},
[]( so_5::environment_params_t & env_params ) {
using namespace so_5::disp::adv_thread_pool;
env_params.add_named_dispatcher( create_disp(
disp_params_t{}
.thread_count( 16 )
.tune_queue_params( queue_traits::queue_params_t & params ) {
params.lock_factory( queue_traits::simple_lock_factory() );
} ) );
} );
\endcode
*/
SO_5_FUNC dispatcher_unique_ptr_t
create_disp(
//! Parameters for the dispatcher.
disp_params_t params );
//
// create_disp
//
/*!
* \brief Create thread pool dispatcher.
*
* \since
* v.5.4.0
*/
inline dispatcher_unique_ptr_t
create_disp(
//! Count of working threads.
std::size_t thread_count )
{
return create_disp( disp_params_t{}.thread_count( thread_count ) );
}
//
// create_disp
//
/*!
* \brief Create thread pool dispatcher.
*
* Size of pool is detected automatically.
*
* \since
* v.5.4.0
*/
inline dispatcher_unique_ptr_t
create_disp()
{
return create_disp( default_thread_pool_size() );
}
//
// create_private_disp
//
/*!
* \brief Create a private %adv_thread_pool dispatcher.
*
* \since
* v.5.5.11
*
* \par Usage sample
\code
using namespace so_5::disp::adv_thread_pool;
auto private_disp = create_private_disp(
env,
disp_params_t{}
.thread_count( 16 )
.tune_queue_params( []( queue_traits::queue_params_t & params ) {
params.lock_factory( queue_traits::simple_lock_factory() );
} ),
"db_workers_pool" );
auto coop = env.create_coop( so_5::autoname,
// The main dispatcher for that coop will be
// private thread_pool dispatcher.
private_disp->binder( bind_params_t{} ) );
\endcode
*/
SO_5_FUNC private_dispatcher_handle_t
create_private_disp(
//! SObjectizer Environment to work in.
environment_t & env,
//! Parameters for the dispatcher.
disp_params_t disp_params,
//! Value for creating names of data sources for
//! run-time monitoring.
const std::string & data_sources_name_base );
//
// create_private_disp
//
/*!
* \since
* v.5.5.15.1
*
* \brief Create a private %adv_thread_pool dispatcher.
*
* \par Usage sample
\code
using namespace so_5::disp::adv_thread_pool;
auto private_disp = create_private_disp(
env,
"db_workers_pool",
disp_params_t{}
.thread_count( 16 )
.tune_queue_params( []( queue_traits::queue_params_t & params ) {
params.lock_factory( queue_traits::simple_lock_factory() );
} ) );
auto coop = env.create_coop( so_5::autoname,
// The main dispatcher for that coop will be
// private thread_pool dispatcher.
private_disp->binder( bind_params_t{} ) );
\endcode
*
* This function is added to fix order of parameters and make it similar
* to create_private_disp from other dispatchers.
*/
inline private_dispatcher_handle_t
create_private_disp(
//! SObjectizer Environment to work in.
environment_t & env,
//! Value for creating names of data sources for
//! run-time monitoring.
const std::string & data_sources_name_base,
//! Parameters for the dispatcher.
disp_params_t disp_params )
{
return create_private_disp(
env,
std::move(disp_params),
data_sources_name_base );
}
//
// create_private_disp
//
/*!
* \brief Create a private %adv_thread_pool dispatcher.
*
* \since
* v.5.5.4
*
* \par Usage sample
\code
auto private_disp = so_5::disp::adv_thread_pool::create_private_disp(
env,
16,
"req_processors" );
auto coop = env.create_coop( so_5::autoname,
// The main dispatcher for that coop will be
// private adv_thread_pool dispatcher.
private_disp->binder( so_5::disp::adv_thread_pool::bind_params_t{} ) );
\endcode
*/
inline private_dispatcher_handle_t
create_private_disp(
//! SObjectizer Environment to work in.
environment_t & env,
//! Count of working threads.
std::size_t thread_count,
//! Value for creating names of data sources for
//! run-time monitoring.
const std::string & data_sources_name_base )
{
return create_private_disp(
env,
disp_params_t{}.thread_count( thread_count ),
data_sources_name_base );
}
/*!
* \brief Create a private %adv_thread_pool dispatcher.
*
* \since
* v.5.5.4
*
* \par Usage sample
\code
auto private_disp = so_5::disp::adv_thread_pool::create_private_disp( env, 16 );
auto coop = env.create_coop( so_5::autoname,
// The main dispatcher for that coop will be
// private adv_thread_pool dispatcher.
private_disp->binder( so_5::disp::adv_thread_pool::bind_params_t{} ) );
\endcode
*/
inline private_dispatcher_handle_t
create_private_disp(
//! SObjectizer Environment to work in.
environment_t & env,
//! Count of working threads.
std::size_t thread_count )
{
return create_private_disp( env, thread_count, std::string() );
}
//
// create_private_disp
//
/*!
* \brief Create a private %adv_thread_pool dispatcher with the default
* count of working threads.
*
* \since
* v.5.5.4
*
* \par Usage sample
\code
auto private_disp = so_5::disp::adv_thread_pool::create_private_disp( env );
auto coop = env.create_coop( so_5::autoname,
// The main dispatcher for that coop will be
// private adv_thread_pool dispatcher.
private_disp->binder( so_5::disp::adv_thread_pool::bind_params_t{} ) );
\endcode
*/
inline private_dispatcher_handle_t
create_private_disp(
//! SObjectizer Environment to work in.
environment_t & env )
{
return create_private_disp(
env,
default_thread_pool_size(),
std::string() );
}
//
// create_disp_binder
//
/*!
* \brief Create dispatcher binder for thread pool dispatcher.
*
* \since
* v.5.4.0
*/
SO_5_FUNC disp_binder_unique_ptr_t
create_disp_binder(
//! Name of the dispatcher.
std::string disp_name,
//! Parameters for binding.
const bind_params_t & params );
/*!
* \brief Create dispatcher binder for thread pool dispatcher.
*
* \since
* v.5.4.0
*
* Usage example:
\code
create_disp_binder( "tpool",
[]( so_5::disp::adv_thread_pool::bind_params_t & p ) {
p.fifo( so_5::disp::thread_pool::fifo_t::individual );
} );
\endcode
*/
template< typename SETTER >
inline disp_binder_unique_ptr_t
create_disp_binder(
//! Name of the dispatcher.
std::string disp_name,
//! Function for setting the binding's params.
SETTER params_setter )
{
bind_params_t params;
params_setter( params );
return create_disp_binder( std::move(disp_name), params );
}
} /* namespace adv_thread_pool */
} /* namespace disp */
} /* namespace so_5 */
| [
"eao197@1d1731ae-3f85-447d-88f8-c72b288064d1"
] | eao197@1d1731ae-3f85-447d-88f8-c72b288064d1 |
50420c05bb459aad07dd23df00b3820c589116cc | d486e382b75aea4cb176751f5549b8e45cca1ff8 | /MOrse/MOrse.ino | a2940e6487c70a271fee83a8381f553b679489f1 | [] | no_license | ddlogesh/arduino | e42a3165d3bd7252ae98e03c4a7fe50b253be13f | 6036428778eb5db1054c2422ddc6d2c9e39bd71e | refs/heads/master | 2020-07-31T20:36:50.387920 | 2019-09-25T03:18:57 | 2019-09-25T03:18:57 | 210,746,246 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 561 | ino | void setup() {
pinMode(13,OUTPUT);
}
void dot(){
digitalWrite(13,HIGH);
delay(100);
digitalWrite(13,LOW);
delay(1000);
}
void dash(){
digitalWrite(13,HIGH);
delay(500);
digitalWrite(13,LOW);
delay(1000);
}
void loop() {
//Message in Morse: 'Hi guys'
dot();
dot();
dot();
dot();
delay(2000);
dot();
dot();
delay(2000);
dash();
dash();
dot();
delay(2000);
dot();
dot();
dash();
delay(2000);
dash();
dot();
dash();
dash();
delay(2000);
dot();
dot();
dot();
while(1)
digitalWrite(13,LOW);
}
| [
"ddlogesh@gmail.com"
] | ddlogesh@gmail.com |
a25f495a3b5b66318b5124282fc9e1c9deea8001 | ae5abdc7b0d221efb376295ecba745f3b6cdd942 | /States/DungeonState.h | 4712723b58dc3c833f96d79113ed3b8b02241903 | [] | no_license | Fro116/ZRLogger | 957a55ff9d38821c7827da33b0f17ce8d2e0df10 | db682117b1ea414859b77563364ee4efbb7925b5 | refs/heads/master | 2021-01-19T00:49:02.053472 | 2017-01-01T01:52:31 | 2017-01-01T01:52:31 | 62,965,775 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,223 | h | #ifndef DungeonState_1468541790679911
#define DungeonState_1468541790679911
#include <iostream>
#include <string>
#include <fstream>
#include <vector>
#include <algorithm>
#include <sstream>
#include <memory>
#include <cassert>
#include <limits>
#include <chrono>
#include <set>
#include <cstdlib>
#include <tuple>
#include <map>
#include <thread>
#include <mutex>
#include <GL/glew.h>
#include <GLFW/glfw3.h>
#include "GameState.h"
#include "Drawable.h"
#include "Updatable.h"
#include "Bindable.h"
#include "GameDriver.h"
class DungeonState : public GameState {
public:
DungeonState(std::shared_ptr<GameDriver> gameDriver, std::string vertexShaderPath, std::string fragmentShaderPath);
void BindObject(std::shared_ptr<Bindable> object);
void UnbindObject(std::shared_ptr<Bindable> object);
void EnterFocus() override;
void LeaveFocus() override;
void Update() override;
void Draw(double time) override;
private:
GLFWwindow* window;
GLuint shaders;
GLuint transformID;
std::vector<std::shared_ptr<Bindable>> bindables;
std::vector<std::shared_ptr<Drawable>> drawables;
std::vector<std::shared_ptr<Updatable>> updatables;
std::shared_ptr<GameDriver> driver;
private:
};
#endif
| [
"omnik116@gmail.com"
] | omnik116@gmail.com |
bf85f364620921b26de67a92f0b02aac77cd75da | 4c61ef35fa05af6393b86968c2de1d52e51e9dd3 | /SpellCheck.cpp | 12e5bd89948a130096bb68b005dd1a2cd8ef885e | [] | no_license | MohdAAyyad/Necromancer | 222d23dd5391f5b2b419c5d25b1c7e92944c1b6b | 8dcee0e577328b128ea49c130b1c2b22e3d58216 | refs/heads/master | 2020-12-18T19:43:18.975329 | 2020-06-21T03:55:53 | 2020-06-21T03:55:53 | 235,501,435 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,307 | cpp | // Fill out your copyright notice in the Description page of Project Settings.
#include "SpellCheck.h"
TUniquePtr<SpellCheck, TDefaultDelete<SpellCheck>>SpellCheck::instance = nullptr;
SpellCheck::SpellCheck()
{
bSpellIncreasesHealth = false;
bSpellIsASummon = false;
}
SpellCheck::~SpellCheck()
{
}
#pragma region Aim
bool SpellCheck::CheckForAimSpell(const EAimSpells spell_, float& currentBP_, bool& increaseHP_, float& spellBaseDamage_, EStatusEffects& status_)
{
int cost = GetAimSpellCost(spell_, spellBaseDamage_); //Also updates bSpellIncreasesHealth
if (currentBP_ >= cost) //Do we have enough BP?
{
currentBP_ -= cost;
increaseHP_ = bSpellIncreasesHealth;
bSpellIncreasesHealth = false; //Reset variable
return true;
}
return false;
}
float SpellCheck::GetAimSpellCost(const EAimSpells spell_, float& spellBaseDamage_)
{
//Check for cost and add the spell's damage to the player's basic magic damage stat
switch (spell_)
{
case EAimSpells::BLOODSHOT:
spellBaseDamage_ += 90.0f;
return 20.0f;
case EAimSpells::BLOODROCKET:
spellBaseDamage_ += 50.0f;
return 40.0f;
case EAimSpells::BLOODTIMEBOMB:
spellBaseDamage_ += 50.0f;
return 35.0f;
case EAimSpells::ISEEDEATH:
spellBaseDamage_ = 0.0f;
return 10.0f;
case EAimSpells::EYESOFBLOOD:
spellBaseDamage_ = 0.0f;
return 10.0f;
case EAimSpells::SWARM:
spellBaseDamage_ = 0.0f;
bSpellIncreasesHealth = true;
return 10.0f;
default:
return 0.0f;
}
}
#pragma endregion
#pragma region Blood
bool SpellCheck::CheckForBloodSpell(const EBloodSpells spell_, float& currentBP_, bool& isASummon_, float& spellBaseDamage_, EStatusEffects& status_)
{
int cost = GetBloodSpellCost(spell_, spellBaseDamage_); //Also updates bSpellIsASummon
if (currentBP_ >= cost) //Do we have enough BP?
{
currentBP_ -= cost;
isASummon_ = bSpellIsASummon;
bSpellIsASummon = false; //Reset variable
return true;
}
return false;
}
float SpellCheck::GetBloodSpellCost(const EBloodSpells spell_, float& spellBaseDamage_)
{
switch (spell_)
{
case EBloodSpells::BLOODMIASMA:
spellBaseDamage_ = 0; //Miasma doesn't do any direct damage, only poison damage
return 10.0f;
case EBloodSpells::SERVEINDEATH:
spellBaseDamage_ = 0;
return 25.0f;
case EBloodSpells::BLOODEXPLOSION:
spellBaseDamage_ += 70.0f;
return 35.0f;
case EBloodSpells::BLOODTORNADO:
spellBaseDamage_ += 150.0f;
return 120.0f;
case EBloodSpells::SUMMONSKELETON:
bSpellIsASummon = true;
return 40.0f;
break;
default:
return 0.0f;
}
}
#pragma endregion
#pragma region Innate
bool SpellCheck::CheckForInnateSpell(const EInnateSpells spell_, float& currentBP_, bool& damagesPlayer_, float& currentHP_, bool& increaseHP_, float& spellBaseDamage_, EStatusEffects& status_)
{
int cost = GetInnateSpellCost(spell_, damagesPlayer_, increaseHP_);
if (damagesPlayer_) //If damagesPlayer_ is set true, NecroCharacter should play a takeDamage effect on the player
{
if (currentHP_ - cost >= 10.0f) //Don't die
{
currentHP_ -= cost;
currentBP_ += cost * 2.0f;
return false; //False is returned if the spell failed, or if you are affecting HP and not BP. i.e. no need to call conjuror
}
else
{
damagesPlayer_ = false; //Failed at damaging the player
return false;
}
}
else if (increaseHP_)
{
if (currentBP_>= cost)
{
currentBP_ -= cost;
currentHP_ += cost * 2.0f;
return false;
}
else
{
increaseHP_ = false; // Failed at healing the player
return false;
}
}
else
{
if (currentBP_ >= cost)
{
currentBP_ -= cost;
return true; //Necro Character will call conjuror
}
}
return false;
}
float SpellCheck::GetInnateSpellCost(const EInnateSpells spell_, bool& damagesPlayer_, bool& increaseHP_)
{
switch (spell_)
{
case EInnateSpells::FLESHISASERVANT:
damagesPlayer_ = true;
increaseHP_ = false;
return 10.0f;
default:
return 0.0f;
}
}
#pragma endregion
#pragma region Instance
SpellCheck* SpellCheck::GetInstance()
{
if (!instance)
{
instance.Reset(new SpellCheck);
}
return instance.Get();
}
#pragma endregion | [
"noreply@github.com"
] | noreply@github.com |
392e8bc8f1fc96b03c4fc060f695d3c269cbc55e | 7d5538864d38167b2cb66764b4ea5c85bee0c918 | /atcoder/abc/230/b.cpp | 8926fdaa1bbbf009b69eef3773cafac7ac38e956 | [] | no_license | iPolyomino/contest | ec63acef925bf4a9b562aab46fc247d0fe7a71b9 | 96bea95174cc320f0620da322a25668ac5c500cd | refs/heads/master | 2023-07-09T01:19:33.026494 | 2023-06-24T01:06:13 | 2023-06-24T01:06:13 | 163,596,349 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 419 | cpp | #include <bits/stdc++.h>
using namespace std;
int main()
{
string S;
cin >> S;
string base = "oxx";
int diff = 0;
int i = 0;
while (diff < S.size() && S[diff] != 'o') {
diff++;
}
if (diff > 2) {
cout << "No" << endl;
return 0;
}
while (i + diff < S.size()) {
if (S[i + diff] != base[i % base.size()]) {
cout << "No" << endl;
return 0;
}
i++;
}
cout << "Yes" << endl;
return 0;
}
| [
"macbookpromacbookpromacbookpro@gmail.com"
] | macbookpromacbookpromacbookpro@gmail.com |
eca331d9067565d64db8876acf17fe5bf091ad3f | 930a0841e000445e9239e94fb7db17a785beb7c9 | /flappy-bird/game.h | b45af598aef485cae9c8011a6c2783a38cb744ca | [] | no_license | zerephe/flappy-bird | 117da66ba8b5c49f6ddaaccbc65f2e414896f8eb | 924ff32bd3dc31f56a0e5c9ae3d4d3c43a87c778 | refs/heads/master | 2022-07-22T02:52:32.269075 | 2022-07-12T16:56:10 | 2022-07-12T16:56:10 | 112,420,185 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 861 | h | #ifndef GAME_H
#define GAME_H
#include <QApplication>
#include <QWidget>
#include <QGraphicsScene>
#include <QGraphicsView>
#include <QTimer>
#include <QObject>
#include <QGraphicsPixmapItem>
#include "bird.h"
#include "score.h"
#include "soundeffects.h"
#include "gameover.h"
#include "barriers.h"
class Game: public QGraphicsView{
Q_OBJECT
public:
Game(QWidget *parent = 0);
QGraphicsScene *scene;
Score *score;
Bird *bird;
Sounds *effects;
Gameover *pop;
Barriers *topBar;
Barriers *bottomBar;
//'bird's' timer events
QTimer *timer;
QTimer *timer2;
bool collision = false;
int count = 0;
QList<Barriers*> *columns = new QList<Barriers*>();
QList<Score*> *scores = new QList<Score*>();
void gameOver();
public slots:
void restartGame();
void barriers();
};
#endif // GAME_H
| [
"zerephe97@gmail.com"
] | zerephe97@gmail.com |
f620e9c9ddfc76c326c307f0afb66f72a4bf43c7 | 3b66c775b1884af2e2c4535c244e90f39077da8f | /headers/Buildables/FGBuildableRailroadSwitchControl.h | 5b4cac45eeea86c571b9c53a539eaf27e0d1b6ff | [
"Apache-2.0"
] | permissive | ficsit/source-data | e1f04a2c4a3951d06cb8ef22ffbe8b76f41a1756 | d79699a359575cff266f2eae8d36577e3f9870d1 | refs/heads/master | 2021-03-10T14:25:54.439342 | 2020-10-27T17:48:53 | 2020-10-27T17:48:53 | 246,460,239 | 0 | 0 | Apache-2.0 | 2023-09-01T21:00:12 | 2020-03-11T02:54:42 | C++ | UTF-8 | C++ | false | false | 2,889 | h | // Copyright 2016 Coffee Stain Studios. All Rights Reserved.
#pragma once
#include "FGBuildableFactory.h"
#include "FGUseableInterface.h"
#include "FGBuildableRailroadSwitchControl.generated.h"
/**
* A component for controlling a switch's position.
*/
UCLASS( Blueprintable )
class FACTORYGAME_API AFGBuildableRailroadSwitchControl : public AFGBuildableFactory
{
GENERATED_BODY()
public:
AFGBuildableRailroadSwitchControl();
// Begin AActor interface
virtual void GetLifetimeReplicatedProps( TArray<FLifetimeProperty>& OutLifetimeProps ) const override;
virtual void BeginPlay() override;
// End AActor interface
// Begin IFGDismantleInterface
virtual bool CanDismantle_Implementation() const override;
// End IFGDismantleInterface
//~ Begin AFGBuildable interface
virtual bool CanBeSampled_Implementation() const{ return false; }
//~ End AFGBuildable interface
// Begin IFGUseableInterface
virtual void UpdateUseState_Implementation( class AFGCharacterPlayer* byCharacter, const FVector& atLocation, class UPrimitiveComponent* componentHit, FUseState& out_useState ) const override;
virtual void OnUse_Implementation( class AFGCharacterPlayer* byCharacter, const FUseState& state ) override;
virtual void OnUseStop_Implementation( class AFGCharacterPlayer* byCharacter, const FUseState& state ) override;
virtual bool IsUseable_Implementation() const override;
virtual void StartIsLookedAt_Implementation( class AFGCharacterPlayer* byCharacter, const FUseState& state ) override;
virtual FText GetLookAtDecription_Implementation( class AFGCharacterPlayer* byCharacter, const FUseState& state ) const override;
virtual void StopIsLookedAt_Implementation( class AFGCharacterPlayer* byCharacter, const FUseState& state ) override;
// End IFGUseableInterface
/** Get the current switch location. */
UFUNCTION( BlueprintCallable, Category = "FactoryGame|Railroad|Switch" )
FORCEINLINE int32 GetSwitchPosition() const { return mSwitchPosition; }
/** Toggle the switch position to the next track. */
void ToggleSwitchPosition();
/** Called when switch changes position, server only */
UFUNCTION()
void OnSwitchPositionChanged( int32 newPosition );
/** Let blueprint get a chance to update the visuals after the switch */
UFUNCTION( BlueprintImplementableEvent, BlueprintCosmetic, Category = "FactoryGame|Railroad|Switch" )
void UpdateSwitchPositionVisuals();
protected:
UFUNCTION()
void OnRep_SwitchPosition();
private:
friend class AFGRailroadTrackHologram;
/** Connection we control. */
UPROPERTY( SaveGame )
class UFGRailroadTrackConnectionComponent* mControlledConnection;
/** Current switch position read from the controlled connection, polled each tick. */
UPROPERTY( ReplicatedUsing = OnRep_SwitchPosition, Meta = (NoAutoJson = true) )
int32 mSwitchPosition;
};
| [
"ian@nevir.net"
] | ian@nevir.net |
13ca454b843677c98901a3fc32762e3b82710871 | 6f80009a51a1626b1c5bb4e2feb004f8383cfccb | /cc/sieve.cpp | 96934222935ab83fa57e367f70a9cdeb4bcbd729 | [] | no_license | Shreyansh252001/just-codes | c384072160232e154e97eb1e92fbd157e63aff7a | 5a1e3a38be605b811e585493a1f72a6c921f61e6 | refs/heads/master | 2023-01-11T05:28:56.985133 | 2020-11-07T10:00:28 | 2020-11-07T10:00:28 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 505 | cpp | #include <bits/stdc++.h>
using namespace std;
vector<int> findPrimes(int n){
vector<int> v(n+1,1);
v[0] = 0;
v[1] = 0;
int sq = sqrt(n);
for(int i=2; i<=sq; i++){
if (v[i] == 1){
for(int k=i*i; k<=n; k+=i){
v[k] = 0;
}
}
}
for(int i=0; i<v.size(); i++){
if(v[i]==1){
cout << i << " ";
}
}
return;
}
void findNumbers(vector<int> r, int n){
int i=1;
int j=r.size()-1;
}
int main(){
int n;
cin >> n;
vector<int> res = findPrimes(n);
findNumbers(res, n);
return 0;
} | [
"sriharshashm@gmail.com"
] | sriharshashm@gmail.com |
84837c1a7c18c340ed7a95f6b1530553798639f2 | 3d193be5bcbc0823c91fdb2504beef631d6da709 | /mojo/public/cpp/bindings/lib/native_struct_serialization.h | 964bbdb13fc33ad72c2dfb5fce929b0aa12c7ecc | [
"BSD-3-Clause"
] | permissive | a402539/highweb-webcl-html5spec | 7a4285a729fdf98b5eea7c19a288d26d4759d7cc | 644216ea0c2db67af15471b42753d76e35082759 | refs/heads/master | 2020-03-22T14:01:34.091922 | 2016-04-26T05:06:00 | 2016-05-03T12:58:17 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,713 | h | // Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef MOJO_PUBLIC_CPP_BINDINGS_LIB_NATIVE_STRUCT_SERIALIZATION_H_
#define MOJO_PUBLIC_CPP_BINDINGS_LIB_NATIVE_STRUCT_SERIALIZATION_H_
#include <stddef.h>
#include <stdint.h>
#include <limits>
#include "base/logging.h"
#include "base/pickle.h"
#include "ipc/ipc_param_traits.h"
#include "mojo/public/cpp/bindings/lib/array_internal.h"
#include "mojo/public/cpp/bindings/lib/bindings_internal.h"
#include "mojo/public/cpp/bindings/lib/bindings_serialization.h"
#include "mojo/public/cpp/bindings/lib/native_struct_data.h"
#include "mojo/public/cpp/bindings/lib/pickle_buffer.h"
#include "mojo/public/cpp/bindings/lib/serialization_forward.h"
namespace mojo {
namespace internal {
// Generated bindings for native-only types will specialize this to |true|.
// It can be used as a signal (by e.g. the Array serializer) for when to use
// SerializeNative_ with a type.
template <typename E>
struct ShouldUseNativeSerializer {
static const bool value = false;
};
template <typename T>
size_t GetSerializedSizeNative_(const T& value, SerializationContext* context) {
base::PickleSizer sizer;
IPC::ParamTraits<T>::GetSize(&sizer, value);
return Align(sizer.payload_size() + sizeof(ArrayHeader));
}
template <typename T>
void SerializeNative_(const T& value,
Buffer* buffer,
NativeStruct_Data** out,
SerializationContext* context) {
PickleBuffer* pickler = buffer->AsPickleBuffer();
DCHECK(pickler) << "Native types can only be used with PickleBuffers.";
ArrayHeader* header =
reinterpret_cast<ArrayHeader*>(buffer->Allocate(sizeof(ArrayHeader)));
// Remember where the Pickle started before writing.
base::Pickle* pickle = pickler->pickle();
const char* data_start = pickle->end_of_payload();
#if !defined(NDEBUG) || defined(DCHECK_ALWAYS_ON)
const char* payload_base = pickle->payload();
size_t size_before_write = pickle->payload_size();
#endif
IPC::ParamTraits<T>::Write(pickle, value);
#if !defined(NDEBUG) || defined(DCHECK_ALWAYS_ON)
// Ensure the pickle buffer hasn't moved.
DCHECK_EQ(payload_base, pickle->payload());
// Explicitly validate that the value returned by GetSize() always equals the
// number of bytes actually written by Write().
DCHECK_GE(pickle->payload_size(), size_before_write);
size_t bytes_written = pickle->payload_size() - size_before_write;
DCHECK_EQ(Align(bytes_written + sizeof(ArrayHeader)),
GetSerializedSizeNative_(value, context));
#endif
// Fix up the ArrayHeader so that num_elements contains the length of the
// pickled data.
size_t pickled_size = pickle->end_of_payload() - data_start;
size_t total_size = pickled_size + sizeof(ArrayHeader);
DCHECK_LT(total_size, std::numeric_limits<uint32_t>::max());
header->num_bytes = static_cast<uint32_t>(total_size);
header->num_elements = static_cast<uint32_t>(pickled_size);
*out = reinterpret_cast<NativeStruct_Data*>(header);
}
template <typename T>
bool DeserializeNative_(NativeStruct_Data* data,
T* out,
SerializationContext* context) {
if (!data)
return true;
// Construct a temporary base::Pickle view over the array data. Note that
// the Array_Data is laid out like this:
//
// [num_bytes (4 bytes)] [num_elements (4 bytes)] [elements...]
//
// and base::Pickle expects to view data like this:
//
// [payload_size (4 bytes)] [header bytes ...] [payload...]
//
// Because ArrayHeader's num_bytes includes the length of the header and
// Pickle's payload_size does not, we need to adjust the stored value
// momentarily so Pickle can view the data.
ArrayHeader* header = reinterpret_cast<ArrayHeader*>(data);
DCHECK_GE(header->num_bytes, sizeof(ArrayHeader));
header->num_bytes -= sizeof(ArrayHeader);
{
// Construct a view over the full Array_Data, including our hacked up
// header. Pickle will infer from this that the header is 8 bytes long,
// and the payload will contain all of the pickled bytes.
base::Pickle pickle_view(reinterpret_cast<const char*>(header),
header->num_bytes + sizeof(ArrayHeader));
base::PickleIterator iter(pickle_view);
if (!IPC::ParamTraits<T>::Read(&pickle_view, &iter, out))
return false;
}
// Return the header to its original state.
header->num_bytes += sizeof(ArrayHeader);
return true;
}
} // namespace internal
} // namespace mojo
#endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_NATIVE_STRUCT_SERIALIZATION_H_
| [
"kimdh@infrawareglobal.com"
] | kimdh@infrawareglobal.com |
5dbef3681e7a09ef86ef96f33d514768c1bd76e7 | 40842166572b79c8b448ca9ba9a6276ab02a27cc | /Unix/reverse/label.cc | e4ef9e8b713e64f014b770b82f9e6968a903c733 | [
"LicenseRef-scancode-warranty-disclaimer",
"BSD-3-Clause"
] | permissive | calmh/pre-git | 8fc775c9d569724c413a0b4291e9f138d2509bae | 4941fad3e5e38802cf96acfec9bfae8aebe7bc09 | refs/heads/master | 2021-03-22T04:26:13.529348 | 2009-12-21T07:59:14 | 2009-12-21T07:59:14 | 65,546,686 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,270 | cc | /*
Copyright (c) 2000 Jakob Borg
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
*/
/** @author Jakob Borg <jborg@df.lth.se>
** @version $Revision: 1.1.1.1 $
**/
#include <iostream>
#include <fstream>
#include <string>
#include <ctime>
#include <cstdlib>
#include "stddefs.h"
#define DEBUG(x) x
typedef struct {
unsigned id;
char label[128];
char reserved[1024 - 128 - sizeof(unsigned)];
} tapelabel;
class Label {
public:
tapelabel thelabel;
Label();
Label(char *label);
void setLabel(char *label) { strcpy(thelabel.label, label); };
const char *getLabel() const { return thelabel.label; };
int get(char *device);
int set(char *device);
};
Label::Label() {
thelabel.id = time(0);
};
Label::Label(char *label) {
thelabel.id = time(0);
strcpy(thelabel.label, label);
};
int Label::get(char *device) {
std::ifstream tape(device);
tape.read(&thelabel, 1024);
if (tape.good())
return 1;
else
return 0;
}
int Label::set(char *device) {
std::ofstream tape(device);
tape.write(&thelabel, 1024);
if (tape.good())
return 1;
else
return 0;
}
int main (int argc, char *argv[]) {
Label *label = new Label();
if (argc < 2) {
cout << "usage: label <device> [-v label]" << endl;
return 0;
}
if (argc > 2 && !strcmp(argv[2], "-v")) {
label->setLabel(argv[3]);
if (argc == 5)
label->thelabel.id = atoi(argv[4]);
if (label->set(argv[1])) {
cout << "OK\n";
}
else
cout << "FAIL\n";
} else {
if (label->get(argv[1])){
cout << "ID=" << label->thelabel.id << " LABEL=\"" << label->thelabel.label << "\"\n";
} else
cout << "FAIL\n";
}
}
| [
"jb@2a83244e-8797-45b3-a2fb-03eebcce663c"
] | jb@2a83244e-8797-45b3-a2fb-03eebcce663c |
cb44ab6aad243f230f4ed7b01bec8556f8189996 | 5996d5f645a9298ba51412d1ae2df8db9a228707 | /control/xylophoneController.ino | 49b5171b3d41462d905ada8827d4e2745123800b | [] | no_license | hkstm/xylobot | bf862a775f643491c3bdde6312f342539e827741 | 58f587711cbc8b033521c520b39f40e5fdd70c2e | refs/heads/master | 2021-06-23T18:32:32.317922 | 2021-03-23T09:08:10 | 2021-03-23T09:08:10 | 209,025,011 | 0 | 0 | null | 2020-01-24T09:34:20 | 2019-09-17T10:28:49 | Python | UTF-8 | C++ | false | false | 4,398 | ino | //Kinematics: Task01 FK
//Specification of PWM limits (for servo: TGY 50090M Servo):
//Please enter the servo min and max limits for servo 1 and 2 here
//You can find the corresponding limits on a note in your EDMO-box
int SERVOMIN[] {98, 130, 45}; //{min Servo1, min Servo2, min Servo3} ->this is the 'minimum' pulse length count (out of 4096) for each servo
int SERVOMAX[] {516, 532, 488}; //{max Servo1, max Servo2, min Servo3} ->this is the 'maximum' pulse length count (out of 4096) for each servo
#define NUM_MOTORS 3 // for now we only use two joints simultaneously
#define LEFTEND -90 // Lower limit of servo angular range -> corresponds to SERVOMIN value
#define RIGHTEND 90 // Upper limit of servo angular range -> corresponds to SERVOMAX value
#include <string.h>
#include <stdlib.h>
#include <Servo.h>
#include <Wire.h>
#include <Adafruit_PWMServoDriver.h>
float incoming[NUM_MOTORS]; //buffer
float pwmvalue[NUM_MOTORS]; //buffer
float calib[NUM_MOTORS]; // used to calibrate servo offsets
byte i = 0;
char record[100];
char recvchar;
byte indx = 0;
int KEY0[] {-33,-25,-20,-13,-7,0,6,12};
int KEY1[] {-80,-80,-80,-75,-75,-75,-80,-90};
int KEY2[] {30,30,32,40,40,40,32,14};
Adafruit_PWMServoDriver pwm = Adafruit_PWMServoDriver();
void setup()
{
Serial.begin(9600);
pwm.begin();
pwm.setPWMFreq(6nmnmnbvcxz00);
zeroCalib();
// offsets of angular positions to be determined by students for each motor
setCalib(0,3); // offset for motor 0
setCalib(1,0); // offset for motor 1
setCalib(2,0); // offset for motor 2
while(!Serial);
}
// main function
// receives bytes from Serial communication
// If full data packages is received, values are extracted
// If data package is correct, motor positions are being updated
void loop()
{
if (Serial.available())
{
recvchar = Serial.read();
if (recvchar != '\n')
{
record[indx++] = recvchar;
}
else if (recvchar == '\n')
{
record[indx] = '\0';
indx = 0;
Serial.println(record);
getData(record); // extract motor positions from data package
writeToMotor(); // write pwm values to motor
printData(pwmvalue); // for bebugging send pwm values to monitor
}
}
}
// extract data from data packages
// expected format: VALUE KOMMA VALUE \n
void getData(char record[])
{
i = 0;
char *index = strtok(record, ",");
while(index != NULL)
{
incoming[i++] = atof(index);
index = strtok(NULL, ",");
}
}
void hit(int x)
{
Serial.println("runs");
int keys_init[] = {KEY0[x], KEY1[x]+30, KEY2[x]};
int keys[] = {KEY0[x], KEY1[x], KEY2[x]};
writeToMotorManual(keys_init);
writeToMotorManual(keys);
}
void writeToMotorManual(int pos[3])
{
Serial.print(pos[0]);
Serial.print(pos[1]);
Serial.print(pos[2]);
for(byte j = 0; j< NUM_MOTORS ; j++)
{
pos[j] += calib[j];
pwmvalue[j] = map(pos[j],LEFTEND,RIGHTEND,SERVOMIN[j],SERVOMAX[j]);
// do not remove this safety function to avoid hardware damages
pwmvalue[j] = constrain(pwmvalue[j],SERVOMIN[j],SERVOMAX[j]);
pwm.setPWM(j, 0, pwmvalue[j]); // function by Adafruit library
}
}
// update servo motor positions
void writeToMotor()
{
if(i == NUM_MOTORS)
{
for (byte j = 0 ; j < NUM_MOTORS ; j++)
{
incoming[j] += calib[j];
pwmvalue[j] = map(incoming[j],LEFTEND,RIGHTEND,SERVOMIN[j],SERVOMAX[j]);
// do not remove this safety function to avoid hardware damages
pwmvalue[j] = constrain(pwmvalue[j],SERVOMIN[j],SERVOMAX[j]);
pwm.setPWM(j, 0, pwmvalue[j]); // function by Adafruit library
}
}
else
{
Serial.println("Enter correct number of values separated by commas!");
}
}
// Print data
void printData(float data[])
{
for (byte j = 0 ; j < NUM_MOTORS ; j++)
{
Serial.print(data[j]);
Serial.print('\t');
}
Serial.println();
}
// Initialize all calibration values to zero
void zeroCalib()
{
for (byte j = 0 ; j < NUM_MOTORS ; j++)
calib[j] = 0;
}
// Update calibration value
void setCalib(int motor,int val)
{
if(motor < NUM_MOTORS)
calib[motor] = val;
else
Serial.println("Enter a valid motor number");
}
| [
"rik.dijkstra@hotmail.com"
] | rik.dijkstra@hotmail.com |
4596b04945cfbe9333d9e6a4c81d47ccdeced949 | 9b8217bc2ac1a0b003d02776c237517458cdb055 | /libs/filecoin/include/nil/filecoin/proofs/types/bytes_amount.hpp | 8d79981c89ef1b4860431fc87571e23ff4fd8b32 | [
"MIT"
] | permissive | NilFoundation/crypto3-fil-proofs | 9e705e9c2b26db4f6f813a407a1887b210ce7bcf | 1fd78ad608278a1ed62fb29b0a077347b74a55f1 | refs/heads/master | 2023-08-18T09:23:18.875060 | 2021-10-15T10:00:11 | 2021-10-15T10:00:11 | 274,958,696 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,790 | hpp | //---------------------------------------------------------------------------//
// MIT License
//
// Copyright (c) 2020-2021 Mikhail Komarov <nemo@nil.foundation>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
//---------------------------------------------------------------------------//
#ifndef FILECOIN_PROOFS_TYPES_HPP
#define FILECOIN_PROOFS_TYPES_HPP
#include <cstdint>
namespace nil {
namespace filecoin {
typedef std::size_t post_proof_bytes_amount;
typedef std::size_t porep_proof_bytes_amount;
typedef std::uint64_t unpadded_byte_index;
typedef std::uint64_t unpadded_bytes_amount;
typedef std::uint64_t padded_bytes_amount;
} // namespace filecoin
} // namespace nil
#endif
| [
"nemo@nil.foundation"
] | nemo@nil.foundation |
f7323a14260a8a1989c2740c46559f3b1f68cae3 | b7311525d769b380afc61589992867ab5209276c | /Parity/src/QwCombinedBPM.cc | fd9a5d00a997881d14b0a65e3b84747e9d9ec0cc | [] | no_license | tianye8001/japan | 1c1cf3a3467d7f931018514c216884a405b885a9 | 9764b1620e4338f7b5e85c54d0846904d6fcd6fa | refs/heads/master | 2020-04-21T09:43:02.742297 | 2018-11-14T16:37:28 | 2018-11-14T16:37:28 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 41,967 | cc | /**********************************************************\
* File: QwCombinedBPM.cc *
* *
* Author: B. Waidyawansa *
* Time-stamp: *
\**********************************************************/
#include "QwCombinedBPM.h"
// System headers
#include <stdexcept>
// Qweak headers
#ifdef __USE_DATABASE__
#include "QwDBInterface.h"
#endif // __USE_DATABASE__
#include "QwVQWK_Channel.h"
#include "QwScaler_Channel.h"
#include "QwParameterFile.h"
template<typename T>
void QwCombinedBPM<T>::InitializeChannel(TString name)
{
VQwBPM::InitializeChannel(name);
fEffectiveCharge.InitializeChannel(name+"_EffectiveCharge","derived");
for( Short_t axis=kXAxis;axis<kNumAxes;axis++){
fAbsPos[axis].InitializeChannel(name+kAxisLabel[axis],"derived");
fSlope[axis].InitializeChannel(name+kAxisLabel[axis]+"Slope","derived");
fIntercept[axis].InitializeChannel(name+kAxisLabel[axis]+"Intercept","derived");
fMinimumChiSquare[axis].InitializeChannel(name+kAxisLabel[axis]+"MinChiSquare","derived");
}
fixedParamCalculated = false;
fElement.clear();
fQWeights.clear();
fXWeights.clear();
fYWeights.clear();
fSumQweights = 0.0;
for(Short_t axis=kXAxis;axis<kNumAxes;axis++){
erra[axis] = 0.0;
errb[axis] = 0.0;
covab[axis] = 0.0;
A[axis] = 0.0;
B[axis] = 0.0;
D[axis] = 0.0;
m[axis] = 0.0;
}
return;
}
template<typename T>
void QwCombinedBPM<T>::InitializeChannel(TString subsystem, TString name)
{
VQwBPM::InitializeChannel(name);
fEffectiveCharge.InitializeChannel(subsystem, "QwCombinedBPM", name+"_EffectiveCharge","derived");
for( Short_t axis=kXAxis;axis<kNumAxes;axis++){
fAbsPos[axis].InitializeChannel(subsystem, "QwCombinedBPM", name+kAxisLabel[axis],"derived");
fSlope[axis].InitializeChannel(subsystem, "QwCombinedBPM", name+kAxisLabel[axis]+"Slope","derived");
fIntercept[axis].InitializeChannel(subsystem, "QwCombinedBPM", name+kAxisLabel[axis]+"Intercept","derived");
fMinimumChiSquare[axis].InitializeChannel(subsystem, "QwCombinedBPM",name+kAxisLabel[axis]+"MinChiSquare","derived");
}
fixedParamCalculated = false;
fElement.clear();
fQWeights.clear();
fXWeights.clear();
fYWeights.clear();
fSumQweights = 0.0;
for(Short_t axis=kXAxis;axis<kNumAxes;axis++){
erra[axis] = 0.0;
errb[axis] = 0.0;
covab[axis] = 0.0;
A[axis] = 0.0;
B[axis] = 0.0;
D[axis] = 0.0;
m[axis] = 0.0;
}
return;
}
template<typename T>
void QwCombinedBPM<T>::ClearEventData()
{
fEffectiveCharge.ClearEventData();
for(Short_t axis=kXAxis;axis<kNumAxes;axis++){
fAbsPos[axis].ClearEventData();
fSlope[axis].ClearEventData();
fIntercept[axis].ClearEventData();
}
return;
}
template<typename T>
void QwCombinedBPM<T>::SetBPMForCombo(const VQwBPM* bpm, Double_t charge_weight, Double_t x_weight, Double_t y_weight,
Double_t sumqw)
{
fElement.push_back(bpm);
fQWeights.push_back(charge_weight);
fXWeights.push_back(x_weight);
fYWeights.push_back(y_weight);
fSumQweights=sumqw;
size_t i = fElement.size();
if (i>=1){
i--;
// std::cout << "+++++++++++++++++++++++++++\n+++++++++++++++++++++++++++\n" << std::endl;
// std::cout << "fElement.size()==" << fElement.size() << " " << i << " "
// << fElement.at(i)->GetElementName() << " "
// << fQWeights.at(i) << " "
// << fXWeights.at(i) << " "
// << fYWeights.at(i) << " "
// << "fElement.at(i)->GetEffectiveCharge()==" << fElement.at(i)->GetEffectiveCharge() << " "
// << std::endl;
// fElement.at(i)->GetEffectiveCharge()->PrintInfo();
// fElement.at(i)->PrintInfo();
}
return;
}
template<typename T>
Bool_t QwCombinedBPM<T>::ApplyHWChecks()
{
Bool_t eventokay=kTRUE;
return eventokay;
}
template<typename T>
void QwCombinedBPM<T>::IncrementErrorCounters()
{
for(Short_t axis=kXAxis;axis<kNumAxes;axis++){
fAbsPos[axis].IncrementErrorCounters();
fSlope[axis].IncrementErrorCounters();
fIntercept[axis].IncrementErrorCounters();
fMinimumChiSquare[axis].IncrementErrorCounters();
}
fEffectiveCharge.IncrementErrorCounters();
}
template<typename T>
void QwCombinedBPM<T>::PrintErrorCounters() const
{
for(Short_t axis=kXAxis;axis<kNumAxes;axis++){
fAbsPos[axis].PrintErrorCounters();
fSlope[axis].PrintErrorCounters();
fIntercept[axis].PrintErrorCounters();
fMinimumChiSquare[axis].PrintErrorCounters();
}
fEffectiveCharge.PrintErrorCounters();
}
template<typename T>
UInt_t QwCombinedBPM<T>::GetEventcutErrorFlag()
{
UInt_t error=0;
for(Short_t axis=kXAxis;axis<kNumAxes;axis++){
error|=fAbsPos[axis].GetEventcutErrorFlag();
error|=fSlope[axis].GetEventcutErrorFlag();
error|=fIntercept[axis].GetEventcutErrorFlag();
error|=fMinimumChiSquare[axis].GetEventcutErrorFlag();
}
error|=fEffectiveCharge.GetEventcutErrorFlag();
return error;
}
template<typename T>
Bool_t QwCombinedBPM<T>::ApplySingleEventCuts()
{
Bool_t status=kTRUE;
Int_t axis=0;
UInt_t charge_error;
UInt_t pos_error[2];
charge_error = 0;
pos_error[kXAxis]=0;
pos_error[kYAxis]=0;
for(size_t i=0;i<fElement.size();i++){
/// TODO: The returned base class should be changed so
/// these casts aren't needed, but "GetErrorCode"
/// is not meaningful for every VQwDataElement.
/// Maybe the return should be a VQwHardwareChannel?
//To update the event cut faliures in individual BPM devices
charge_error |= fElement[i]->GetEffectiveCharge()->GetErrorCode();
pos_error[kXAxis] |= fElement[i]->GetPosition(kXAxis)->GetErrorCode();
pos_error[kYAxis] |= fElement[i]->GetPosition(kYAxis)->GetErrorCode();
}
//Event cuts for X & Y slopes
for(axis=kXAxis;axis<kNumAxes;axis++){
fSlope[axis].UpdateErrorFlag(pos_error[axis]);
if (fSlope[axis].ApplySingleEventCuts()){ //for X slope
status&=kTRUE;
}
else{
status&=kFALSE;
if (bDEBUG) std::cout<<" X Slope event cut failed ";
}
}
//Event cuts for X & Y intercepts
for(axis=kXAxis;axis<kNumAxes;axis++){
fIntercept[axis].UpdateErrorFlag(pos_error[axis]);
if (fIntercept[axis].ApplySingleEventCuts()){ //for X slope
status&=kTRUE;
}
else{
status&=kFALSE;
if (bDEBUG) std::cout<<" X Intercept event cut failed ";
}
}
//Event cuts for X & Y minimum chi square
for(axis=kXAxis;axis<kNumAxes;axis++){
fMinimumChiSquare[axis].UpdateErrorFlag(pos_error[axis]);
if (fMinimumChiSquare[axis].ApplySingleEventCuts()){ //for X slope
status&=kTRUE;
}
else{
status&=kFALSE;
if (bDEBUG) std::cout<<" X Intercept event cut failed ";
}
}
//Event cuts for X & Y positions
for(axis=kXAxis;axis<kNumAxes;axis++){
fAbsPos[axis].UpdateErrorFlag(pos_error[axis]);
if (fAbsPos[axis].ApplySingleEventCuts()){
status&=kTRUE;
}
else{
status&=kFALSE;
if (bDEBUG) std::cout<<" Abs X event cut failed ";
}
}
//Event cuts for four wire sum (EffectiveCharge)
fEffectiveCharge.UpdateErrorFlag(charge_error);
if (fEffectiveCharge.ApplySingleEventCuts()){
status&=kTRUE;
}
else{
status&=kFALSE;
if (bDEBUG) std::cout<<"EffectiveCharge event cut failed ";
}
return status;
}
template<typename T>
UInt_t QwCombinedBPM<T>::UpdateErrorFlag()
{
Int_t axis=0;
UInt_t charge_error;
UInt_t pos_error[2];
charge_error = 0;
pos_error[kXAxis]=0;
pos_error[kYAxis]=0;
UInt_t error = 0;
for(size_t i=0;i<fElement.size();i++){
//To update the event cut faliures in individual BPM devices
charge_error |= fElement[i]->GetEffectiveCharge()->GetErrorCode();
pos_error[kXAxis] |= fElement[i]->GetPosition(kXAxis)->GetErrorCode();
pos_error[kYAxis] |= fElement[i]->GetPosition(kYAxis)->GetErrorCode();
}
//Event cuts for X & Y slopes
for(axis=kXAxis;axis<kNumAxes;axis++){
fIntercept[axis].UpdateErrorFlag(pos_error[axis]);
fSlope[axis].UpdateErrorFlag(pos_error[axis]);
fMinimumChiSquare[axis].UpdateErrorFlag(pos_error[axis]);
fAbsPos[axis].UpdateErrorFlag(pos_error[axis]);
//Get the Event cut error flag for SlopeX/Y
error|=fSlope[axis].GetEventcutErrorFlag();
error|=fIntercept[axis].GetEventcutErrorFlag();
error|=fMinimumChiSquare[axis].GetEventcutErrorFlag();
error|=fAbsPos[axis].GetEventcutErrorFlag();
}
//Event cuts for four wire sum (EffectiveCharge)
fEffectiveCharge.UpdateErrorFlag(charge_error);
//Get the Event cut error flag for EffectiveCharge
error|=fEffectiveCharge.GetEventcutErrorFlag();
return error;
}
template<typename T>
VQwHardwareChannel* QwCombinedBPM<T>::GetSubelementByName(TString ch_name)
{
VQwHardwareChannel* tmpptr = NULL;
ch_name.ToLower();
if (ch_name=="xslope"){
tmpptr = &fSlope[kXAxis];
}else if (ch_name=="yslope"){
tmpptr = &fSlope[kYAxis];
}else if (ch_name=="xintercept"){
tmpptr = &fIntercept[kXAxis];
}else if (ch_name=="yintercept"){
tmpptr = &fIntercept[kYAxis];
}else if (ch_name=="xminchisquare"){
tmpptr = &fMinimumChiSquare[kXAxis];
}else if (ch_name=="yminchisquare"){
tmpptr = &fMinimumChiSquare[kYAxis];
}else if (ch_name=="absx" || ch_name=="x" ){
tmpptr = &fAbsPos[kXAxis];
}else if (ch_name=="absy" || ch_name=="y"){
tmpptr = &fAbsPos[kYAxis];
}else if (ch_name=="effectivecharge" || ch_name=="charge"){
tmpptr = &fEffectiveCharge;
} else {
TString loc="QwCombinedBPM::GetSubelementByName for"
+ this->GetElementName() + " was passed "
+ ch_name + ", which is an unrecognized subelement name.";
throw std::invalid_argument(loc.Data());
}
return tmpptr;
}
/*
template<typename T>
void QwCombinedBPM<T>::SetSingleEventCuts(TString ch_name, Double_t minX, Double_t maxX)
{
if (ch_name=="xslope"){//cuts for the x slope
QwMessage<<"XSlope LL " << minX <<" UL " << maxX <<QwLog::endl;
fSlope[kXAxis].SetSingleEventCuts(minX,maxX);
}else if (ch_name=="yslope"){//cuts for the y slope
QwMessage<<"YSlope LL " << minX <<" UL " << maxX <<QwLog::endl;
fSlope[kYAxis].SetSingleEventCuts(minX,maxX);
}else if (ch_name=="xintercept"){//cuts for the x intercept
QwMessage<<"XIntercept LL " << minX <<" UL " << maxX <<QwLog::endl;
fIntercept[kXAxis].SetSingleEventCuts(minX,maxX);
}else if (ch_name=="yintercept"){//cuts for the y intercept
QwMessage<<"YIntercept LL " << minX <<" UL " << maxX <<QwLog::endl;
fIntercept[kYAxis].SetSingleEventCuts(minX,maxX);
} else if (ch_name=="absx"){
//cuts for the absolute x and y
QwMessage<<"AbsX LL " << minX <<" UL " << maxX <<QwLog::endl;
fAbsPos[kXAxis].SetSingleEventCuts(minX,maxX);
}else if (ch_name=="absy"){
QwMessage<<"AbsY LL " << minX <<" UL " << maxX <<QwLog::endl;
fAbsPos[kYAxis].SetSingleEventCuts(minX,maxX);
}else if (ch_name=="effectivecharge"){ //cuts for the effective charge
QwMessage<<"EffectveQ LL " << minX <<" UL " << maxX <<QwLog::endl;
fEffectiveCharge.SetSingleEventCuts(minX,maxX);
}
}
template<typename T>
void QwCombinedBPM<T>::SetSingleEventCuts(TString ch_name, UInt_t errorflag,Double_t minX, Double_t maxX, Double_t stability){
errorflag|=kBPMErrorFlag;//update the device flag
if (ch_name=="xslope"){//cuts for the x slope
QwMessage<<"XSlope LL " << minX <<" UL " << maxX << " kGlobalCut "<< (errorflag&kGlobalCut)<< QwLog::endl;
fSlope[kXAxis].SetSingleEventCuts(errorflag, minX,maxX, stability);
}else if (ch_name=="yslope"){//cuts for the y slope
QwMessage<<"YSlope LL " << minX <<" UL " << maxX <<" kGlobalCut "<< (errorflag&kGlobalCut)<< QwLog::endl;
fSlope[kYAxis].SetSingleEventCuts(errorflag, minX,maxX, stability);
}else if (ch_name=="xintercept"){//cuts for the x intercept
QwMessage<<"XIntercept LL " << minX <<" UL " << maxX <<" kGlobalCut "<< (errorflag&kGlobalCut)<< QwLog::endl;
fIntercept[kXAxis].SetSingleEventCuts(errorflag, minX,maxX, stability);
}else if (ch_name=="yintercept"){//cuts for the y intercept
QwMessage<<"YIntercept LL " << minX <<" UL " << maxX <<" kGlobalCut "<< (errorflag&kGlobalCut)<< QwLog::endl;
fIntercept[kYAxis].SetSingleEventCuts(errorflag, minX,maxX, stability);
} else if (ch_name=="absx"){
//cuts for the absolute x and y
QwMessage<<"AbsX LL " << minX <<" UL " << maxX <<" kGlobalCut "<< (errorflag&kGlobalCut)<< QwLog::endl;
fIntercept[kXAxis].SetSingleEventCuts(errorflag, 0,0,0);
fAbsPos[kXAxis].SetSingleEventCuts(errorflag, minX,maxX, stability);
}else if (ch_name=="absy"){
QwMessage<<"AbsY LL " << minX <<" UL " << maxX <<" kGlobalCut "<< (errorflag&kGlobalCut)<< QwLog::endl;
fIntercept[kYAxis].SetSingleEventCuts(errorflag, 0,0,0);
fAbsPos[kYAxis].SetSingleEventCuts(errorflag, minX,maxX, stability);
}else if (ch_name=="effectivecharge"){ //cuts for the effective charge
QwMessage<<"EffectveQ LL " << minX <<" UL " << maxX <<" kGlobalCut "<< (errorflag&kGlobalCut)<< QwLog::endl;
fEffectiveCharge.SetSingleEventCuts(errorflag, minX,maxX, stability);
}
}
*/
template<typename T>
void QwCombinedBPM<T>::UpdateErrorFlag(const VQwBPM *ev_error){
Short_t i=0;
try {
if(typeid(*ev_error)==typeid(*this)) {
// std::cout<<" Here in QwBPMStripline::UpdateErrorFlag \n";
if (this->GetElementName()!="") {
const QwCombinedBPM<T>* value_bpm = dynamic_cast<const QwCombinedBPM<T>* >(ev_error);
for(i=kXAxis;i<kNumAxes;i++) {
fAbsPos[i].UpdateErrorFlag(value_bpm->fAbsPos[i]);
fSlope[i].UpdateErrorFlag(value_bpm->fSlope[i]);
fIntercept[i].UpdateErrorFlag(value_bpm->fIntercept[i]);
fMinimumChiSquare[i].UpdateErrorFlag(value_bpm->fMinimumChiSquare[i]);
}
fEffectiveCharge.UpdateErrorFlag(value_bpm->fEffectiveCharge);
}
} else {
TString loc="Standard exception from QwCombinedBPM::UpdateErrorFlag :"+
ev_error->GetElementName()+" "+this->GetElementName()+" are not of the "
+"same type";
throw std::invalid_argument(loc.Data());
}
} catch (std::exception& e) {
std::cerr<< e.what()<<std::endl;
}
};
template<typename T>
void QwCombinedBPM<T>::ProcessEvent()
{
Bool_t ldebug = kFALSE;
static T tmpQADC("tmpQADC"), tmpADC("tmpADC");
//PrintInfo();
this->ClearEventData();
//PrintInfo();
//check to see if the fixed parameters are calculated
if(!fixedParamCalculated){
if(ldebug) std::cout<<"QwCombinedBPM:Calculating fixed parameters..\n";
CalculateFixedParameter(fXWeights,kXAxis); //for X
CalculateFixedParameter(fYWeights,kYAxis); //for Y
fixedParamCalculated = kTRUE;
}
for(size_t i=0;i<fElement.size();i++){
if(ldebug){
std::cout<<"*******************************\n";
std::cout<<" QwCombinedBPM: Reading "<<fElement[i]->GetElementName()<<" with charge weight ="<<fQWeights[i]
<<" and x weight ="<<fXWeights[i]
<<" and y weight ="<<fYWeights[i]<<"\n"<<std::flush;
}
tmpQADC.AssignValueFrom(fElement[i]->GetEffectiveCharge());
tmpQADC.Scale(fQWeights[i]);
fEffectiveCharge+=tmpQADC;
if(ldebug) {
std::cout<<"fElement[" << i << "]->GetEffectiveCharge()=="
<< fElement[i]->GetEffectiveCharge()
<< std::endl << std::flush;
fElement[i]->GetEffectiveCharge()->PrintInfo();
std::cout<<"fElement[" << i << "]->GetPosition(kXAxis)=="
<< fElement[i]->GetPosition(kXAxis)
<< std::endl << std::flush;
std::cout<<"fElement[" << i << "]->GetPosition(kYAxis)=="
<< fElement[i]->GetPosition(kYAxis)
<< std::endl << std::flush;
if (fElement[i]->GetEffectiveCharge()==NULL){
std::cout<<"fElement[" << i << "]->GetEffectiveCharge returns NULL"
<< std::endl;
} else
std::cout<<"got 4-wire.hw_sum = "<<fEffectiveCharge.GetValue()
<<" vs actual "
<< fElement[i]->GetEffectiveCharge()->GetValue()
<< std::endl << std::flush;
std::cout<<"copied absolute X position hw_sum from device "
<< fElement[i]->GetPosition(kXAxis)->GetValue() <<std::endl;
std::cout<<"copied absolute Y position hw_sum from device "
<< fElement[i]->GetPosition(kYAxis)->GetValue() <<std::endl;
}
}
fEffectiveCharge.Scale(1.0/fSumQweights);
//fAbsPos[0].ResetErrorFlag(0x4000000);
//Least squares fit for X
LeastSquareFit(kXAxis, fXWeights );
//Least squares fit for Y
LeastSquareFit(kYAxis, fYWeights );
if(ldebug){
std::cout<<" QwCombinedBPM:: Projected target X position = "<<fAbsPos[kXAxis].GetValue()
<<" and target X slope = "<<fSlope[kXAxis].GetValue()
<<" and target X intercept = "<<fIntercept[kXAxis].GetValue()
<<" with mimimum chi square = "<< fMinimumChiSquare[kXAxis].GetValue()
<<" \nProjected target Y position = "<<fAbsPos[kYAxis].GetValue()
<<" and target Y slope = "<<fSlope[kYAxis].GetValue()
<<" and target Y intercept = "<<fIntercept[kYAxis].GetValue()
<<" with mimimum chi square = "<< fMinimumChiSquare[kYAxis].GetValue()<<std::endl;
}
if (ldebug) {
fEffectiveCharge.PrintInfo();
for(Short_t axis=kXAxis;axis<kNumAxes;axis++) {
fAbsPos[axis].PrintInfo();
fSlope[axis].PrintInfo();
fIntercept[axis].PrintInfo();
fMinimumChiSquare[axis].PrintInfo();
}
}
//PrintInfo();
return;
}
template<typename T>
void QwCombinedBPM<T>::CalculateFixedParameter(std::vector<Double_t> fWeights, Int_t pos)
{
Bool_t ldebug = kFALSE;
static Double_t zpos = 0.0;
for(size_t i=0;i<fElement.size();i++){
zpos = fElement[i]->GetPositionInZ();
A[pos] += zpos*fWeights[i]; //zw
B[pos] += fWeights[i]; //w
D[pos] += zpos*zpos*fWeights[i]; //z^2w
}
m[pos] = D[pos]*B[pos]-A[pos]*A[pos];
erra[pos] = B[pos]/m[pos];
errb[pos] = D[pos]/m[pos];
covab[pos] = -A[pos]/m[pos];
// Divvy
if (m[pos] == 0)
QwWarning << "Angry Divvy: Division by zero in " << this->GetElementName() << QwLog::endl;
if(ldebug){
std::cout<<" A = "<<A[pos]<<", B = "<<B[pos]<<", D = "<<D[pos]<<", m = "<<m[pos]<<std::endl;
std::cout<<"For least square fit, errors are "<<erra[pos]
<<"\ncovariance = "<<covab[pos]<<"\n\n";
}
return;
}
template<typename T>
Double_t QwCombinedBPM<T>::SumOver(std::vector<Double_t> weight,std::vector <T> val)
{
Double_t sum = 0.0;
if(weight.size()!=fElement.size()){
std::cout
<<"QwCombinedBPM:: Number of devices doesnt match the number of weights."
<<" Exiting calculating parameters for the least squares fit"
<<std::endl;
}
else{
for(size_t i=0;i<weight.size();i++){
val[i].Scale(weight[i]);
sum+=val[i].GetValue();
}
}
return sum;
}
template<typename T>
void QwCombinedBPM<T>::LeastSquareFit(VQwBPM::EBeamPositionMonitorAxis axis, std::vector<Double_t> fWeights)
{
/**
REF : W.R Leo
For Y = aX +b
A = sigma(X * Wy) B = sigma(Wy) C = sigma(Y*Wy) D = sigma(X *X * Wy) E = sigma(X*Y*Wy) F = sigma(Y * Y *Wy)
then
a = (EB-CA)/(DB-AA) b =(DC-EA)/(DB-AA)
**/
Bool_t ldebug = kFALSE;
static Double_t zpos = 0;
static T tmp1("tmp1","derived");
static T tmp2("tmp2","derived");
static T tmp3("tmp3","derived");
static T C[kNumAxes];
static T E[kNumAxes];
// initialize the VQWK_Channel arrays
C[kXAxis].InitializeChannel("cx","derived");
C[kYAxis].InitializeChannel("cy","derived");
E[kXAxis].InitializeChannel("ex","derived");
E[kYAxis].InitializeChannel("ey","derived");
C[axis].ClearEventData();
E[axis].ClearEventData();
for(size_t i=0;i<fElement.size();i++){
zpos = fElement[i]->GetPositionInZ();
tmp1.ClearEventData();
tmp1.AssignValueFrom(fElement[i]->GetPosition(axis));
tmp1.Scale(fWeights[i]);
C[axis] += tmp1; //xw or yw
tmp1.Scale(zpos);//xzw or yzw
E[axis] += tmp1;
}
if(ldebug) std::cout<<"\n A ="<<A[axis]
<<" -- B ="<<B[axis]
<<" --C ="<<C[axis].GetValue()
<<" --D ="<<D[axis]
<<" --E ="<<E[axis].GetValue()<<"\n";
// calculate the slope a = E*erra + C*covab
fSlope[axis].AssignScaledValue(E[axis], erra[axis]);
tmp2.AssignScaledValue(C[axis], covab[axis]);
fSlope[axis] += tmp2;
// calculate the intercept b = C*errb + E*covab
fIntercept[axis].AssignScaledValue(C[axis], errb[axis]);
tmp2.AssignScaledValue(E[axis], covab[axis]);
fIntercept[axis] += tmp2;
if(ldebug) std::cout<<" Least Squares Fit Parameters for "<< axis
<<" are: \n slope = "<< fSlope[axis].GetValue()
<<" \n intercept = " << fIntercept[axis].GetValue()<<"\n\n";
// absolute positions at target using X = Za + b
tmp1.ClearEventData();
// Absolute position of the combined bpm is not a physical position but a derived one.
zpos = this->GetPositionInZ();
//UInt_t err_flag=fAbsPos[axis].GetEventcutErrorFlag();
fAbsPos[axis] = fIntercept[axis]; // X = b
//fAbsPos[axis].ResetErrorFlag(err_flag);
tmp1.AssignScaledValue(fSlope[axis],zpos); //az
fAbsPos[axis] += tmp1; //X = az+b
// to perform the minimul chi-square test
// We want to calculte (X-az-b)^2 for each bpm in the combination and sum over the values
tmp3.ClearEventData();
fMinimumChiSquare[axis].ClearEventData();
for(size_t i=0;i<fElement.size();i++){
tmp1.ClearEventData();
tmp2.ClearEventData();
//std::cout<<"\nName -------- ="<<(fElement[i]->GetElementName())<<std::endl;
//std::cout<<"\nRead value ="<<(fElement[i]->GetPosition(axis))->GetValue()<<std::endl;
tmp1.AssignValueFrom(fElement[i]->GetPosition(axis)); // = X
//std::cout<<"Read value ="<<tmp1.GetValue()<<std::endl;
tmp2.AssignScaledValue(fSlope[axis],fElement[i]->GetPositionInZ());
tmp2+=fIntercept[axis];
//std::cout<<"Calculated abs value ="<<tmp2.GetValue()<<std::endl;
tmp1 -= tmp2; // = X-Za-b
//std::cout<<"Read-calculated ="<<tmp1.GetValue()<<std::endl;
tmp1.Product(tmp1,tmp1); // = (X-Za-b)^2
//std::cout<<"(Read-calculated)^2 ="<<tmp1.GetValue()<<std::endl;
tmp1.Scale(fWeights[i]*fWeights[i]); // = [(X-Za-b)^2]W
//std::cout<<"(Read-calculated)^2/weight ="<<tmp1.GetValue()<<std::endl;
tmp3+=tmp1; //sum over
//std::cout<<"Sum (Read-calculated)^2/weight +="<<tmp3.GetValue()<<std::endl;
}
if (fElement.size()>2){
fMinimumChiSquare[axis].AssignScaledValue(tmp3,1.0/(fElement.size()-2)); //minimul chi-square
} else {
fMinimumChiSquare[axis].AssignScaledValue(tmp3,0.0);
}
//std::cout << "1.0/fElement.size() = " << 1.0/fElement.size() << std::endl;
return;
}
template<typename T>
Int_t QwCombinedBPM<T>::ProcessEvBuffer(UInt_t* buffer, UInt_t word_position_in_buffer,UInt_t index)
{
return word_position_in_buffer;
}
//-----------------------------------------------------------------------------------------------------------
template<typename T>
void QwCombinedBPM<T>::GetProjectedPosition(VQwBPM *device)
{
// For now, go ahead and do the projection for any BPM, not just for ones which are used by this
// CombinedBPM object.
EBeamPositionMonitorAxis axis;
for(Short_t iaxis=kXAxis; iaxis<kNumAxes; iaxis++) {
//std::cout << "iaxis= " << iaxis << std::endl;
//std::cout << "kNumAxes= " << kNumAxes << std::endl;
if (iaxis==kXAxis) {
axis=kXAxis;
//std::cout << "kXAxis= " << kXAxis << std::endl;
//std::cout << "axis= " << axis << std::endl;
}
else if (iaxis==kYAxis) {
axis=kYAxis;
//std::cout << "kYAxis= " << kYAxis << std::endl;
//std::cout << "axis= " << axis << std::endl;
}
else continue;
(device->GetPosition(axis))->ClearEventData();
(device->GetPosition(axis))->AssignScaledValue(fSlope[axis],device->GetPositionInZ());
(device->GetPosition(axis))->operator+=(&fIntercept[axis]);
}
// Maybe we should apply resolution smearing to the stripline BPMs?
// device->PrintInfo();
device->ApplyResolutionSmearing();
// device->PrintInfo();
device->FillRawEventData();
// std::cout << "Device " << device->GetElementName() << " X = " << std::setprecision(15) << device->GetPosition(kXAxis)->GetValue()
// << "\t Y = " << std::setprecision(15) << device->GetPosition(kYAxis)->GetValue() << std::endl;
}
//-----------------------------------------------------------------------------------------------------------
template<typename T>
void QwCombinedBPM<T>::PrintValue() const
{
Short_t axis;
for(axis = kXAxis; axis < kNumAxes; axis++){
fAbsPos[axis].PrintValue();
}
/// TODO: To print the Z position, we need to use GetPositionInZ()
for(axis = kXAxis; axis < kNumAxes; axis++) {
fSlope[axis].PrintValue();
fIntercept[axis].PrintValue();
fMinimumChiSquare[axis].PrintValue();
}
fEffectiveCharge.PrintValue();
return;
}
template<typename T>
void QwCombinedBPM<T>::PrintInfo() const
{
Short_t axis;
for(axis = kXAxis; axis < kNumAxes; axis++){
fAbsPos[axis].PrintInfo();
}
/// TODO: To print the Z position, we need to use GetPositionInZ()
for(axis = kXAxis; axis < kNumAxes; axis++) {
fSlope[axis].PrintInfo();
fIntercept[axis].PrintInfo();
fMinimumChiSquare[axis].PrintInfo();
}
fEffectiveCharge.PrintInfo();
return;
}
template<typename T>
VQwBPM& QwCombinedBPM<T>::operator= (const VQwBPM &value)
{
*(dynamic_cast<QwCombinedBPM<T>*>(this))=
*(dynamic_cast<const QwCombinedBPM<T>*>(&value));
return *this;
}
template<typename T>
QwCombinedBPM<T>& QwCombinedBPM<T>::operator= (const QwCombinedBPM<T> &value)
{
VQwBPM::operator= (value);
if (this->GetElementName()!=""){
this->fEffectiveCharge=value.fEffectiveCharge;
for(Short_t axis=kXAxis;axis<kNumAxes;axis++){
this->fSlope[axis]=value.fSlope[axis];
this->fIntercept[axis] = value.fIntercept[axis];
this->fAbsPos[axis]=value.fAbsPos[axis];
this->fMinimumChiSquare[axis]=value.fMinimumChiSquare[axis];
}
}
return *this;
}
template<typename T>
VQwBPM& QwCombinedBPM<T>::operator+= (const VQwBPM &value)
{
*(dynamic_cast<QwCombinedBPM<T>*>(this))+=
*(dynamic_cast<const QwCombinedBPM<T>*>(&value));
return *this;
}
template<typename T>
QwCombinedBPM<T>& QwCombinedBPM<T>::operator+= (const QwCombinedBPM<T> &value)
{
if (this->GetElementName()!=""){
this->fEffectiveCharge+=value.fEffectiveCharge;
for(Short_t axis=kXAxis;axis<kNumAxes;axis++) {
this->fSlope[axis]+=value.fSlope[axis];
this->fIntercept[axis]+=value.fIntercept[axis];
this->fAbsPos[axis]+=value.fAbsPos[axis];
this->fMinimumChiSquare[axis]+=value.fMinimumChiSquare[axis];
}
}
return *this;
}
template<typename T>
VQwBPM& QwCombinedBPM<T>::operator-= (const VQwBPM &value)
{
*(dynamic_cast<QwCombinedBPM<T>*>(this))-=
*(dynamic_cast<const QwCombinedBPM<T>*>(&value));
return *this;
}
template<typename T>
QwCombinedBPM<T>& QwCombinedBPM<T>::operator-= (const QwCombinedBPM<T> &value)
{
if (this->GetElementName()!=""){
this->fEffectiveCharge-=value.fEffectiveCharge;
for(Short_t axis=kXAxis;axis<kNumAxes;axis++){
this->fSlope[axis]-=value.fSlope[axis];
this->fIntercept[axis]-=value.fIntercept[axis];
this->fAbsPos[axis]-=value.fAbsPos[axis];
this->fMinimumChiSquare[axis]-=value.fMinimumChiSquare[axis];
}
}
return *this;
}
template<typename T>
void QwCombinedBPM<T>::Ratio(VQwBPM &numer, VQwBPM &denom)
{
Ratio(*dynamic_cast<QwCombinedBPM<T>*>(&numer),
*dynamic_cast<QwCombinedBPM<T>*>(&denom));
}
template<typename T>
void QwCombinedBPM<T>::Ratio(QwCombinedBPM<T> &numer,
QwCombinedBPM<T> &denom)
{
// this function is called when forming asymmetries. In this case waht we actually want for the
// combined bpm is the difference only not the asymmetries
*this=numer;
this->fEffectiveCharge.Ratio(numer.fEffectiveCharge,denom.fEffectiveCharge);
if (this->GetElementName()!=""){
// The slope, intercept and absolute positions should all be differences, not asymmetries.
for(Short_t axis=kXAxis;axis<kNumAxes;axis++) {
this->fSlope[axis] = numer.fSlope[axis];
this->fIntercept[axis] = numer.fIntercept[axis];
this->fAbsPos[axis] = numer.fAbsPos[axis];
this->fMinimumChiSquare[axis] = numer.fMinimumChiSquare[axis];
}
}
return;
}
template<typename T>
void QwCombinedBPM<T>::Scale(Double_t factor)
{
fEffectiveCharge.Scale(factor);
for(Short_t axis=kXAxis;axis<kNumAxes;axis++){
fSlope[axis].Scale(factor);
fIntercept[axis].Scale(factor);
fAbsPos[axis].Scale(factor);
fMinimumChiSquare[axis].Scale(factor);
}
return;
}
template<typename T>
void QwCombinedBPM<T>::CalculateRunningAverage()
{
fEffectiveCharge.CalculateRunningAverage();
for (Short_t axis = kXAxis; axis < kNumAxes; axis++) {
fSlope[axis].CalculateRunningAverage();
fIntercept[axis].CalculateRunningAverage();
fAbsPos[axis].CalculateRunningAverage();
fMinimumChiSquare[axis].CalculateRunningAverage();
}
}
template<typename T>
void QwCombinedBPM<T>::AccumulateRunningSum(const VQwBPM& value)
{
AccumulateRunningSum(*dynamic_cast<const QwCombinedBPM<T>* >(&value));
}
template<typename T>
void QwCombinedBPM<T>::AccumulateRunningSum(const QwCombinedBPM<T>& value)
{
for (Short_t axis = kXAxis; axis < kNumAxes; axis++){
fSlope[axis].AccumulateRunningSum(value.fSlope[axis]);
fIntercept[axis].AccumulateRunningSum(value.fIntercept[axis]);
fAbsPos[axis].AccumulateRunningSum(value.fAbsPos[axis]);
fMinimumChiSquare[axis].AccumulateRunningSum(value.fMinimumChiSquare[axis]);
}
fEffectiveCharge.AccumulateRunningSum(value.fEffectiveCharge);
}
template<typename T>
void QwCombinedBPM<T>::DeaccumulateRunningSum(VQwBPM& value)
{
DeaccumulateRunningSum(*dynamic_cast<QwCombinedBPM<T>* >(&value));
}
template<typename T>
void QwCombinedBPM<T>::DeaccumulateRunningSum(QwCombinedBPM<T>& value)
{
for (Short_t axis = kXAxis; axis < kNumAxes; axis++){
fSlope[axis].DeaccumulateRunningSum(value.fSlope[axis]);
fIntercept[axis].DeaccumulateRunningSum(value.fIntercept[axis]);
fAbsPos[axis].DeaccumulateRunningSum(value.fAbsPos[axis]);
fMinimumChiSquare[axis].DeaccumulateRunningSum(value.fMinimumChiSquare[axis]);
}
fEffectiveCharge.DeaccumulateRunningSum(value.fEffectiveCharge);
}
template<typename T>
void QwCombinedBPM<T>::ConstructHistograms(TDirectory *folder, TString &prefix)
{
if (this->GetElementName()==""){
// This channel is not used, so skip filling the histograms.
}
else{
//we calculate the asym_ for the fEffectiveCharge becasue its an asymmetry and not a difference.
fEffectiveCharge.ConstructHistograms(folder, prefix);
TString thisprefix=prefix;
if(prefix=="asym_")
thisprefix="diff_";
this->SetRootSaveStatus(prefix);
for(Short_t axis=kXAxis;axis<kNumAxes;axis++) {
fSlope[axis].ConstructHistograms(folder, thisprefix);
fIntercept[axis].ConstructHistograms(folder, thisprefix);
fAbsPos[axis].ConstructHistograms(folder, thisprefix);
fMinimumChiSquare[axis].ConstructHistograms(folder, thisprefix);
}
}
return;
}
template<typename T>
void QwCombinedBPM<T>::FillHistograms()
{
if (this->GetElementName()==""){
// This channel is not used, so skip filling the histograms.
}
else{
fEffectiveCharge.FillHistograms();
for(Short_t axis=kXAxis;axis<kNumAxes;axis++) {
fSlope[axis].FillHistograms();
fIntercept[axis].FillHistograms();
fAbsPos[axis].FillHistograms();
fMinimumChiSquare[axis].FillHistograms();
}
}
return;
}
template<typename T>
void QwCombinedBPM<T>::ConstructBranchAndVector(TTree *tree, TString &prefix, std::vector<Double_t> &values)
{
if (this->GetElementName()==""){
// This channel is not used, so skip constructing trees.
} else
{
TString thisprefix=prefix;
if(prefix=="asym_")
thisprefix="diff_";
this->SetRootSaveStatus(prefix);
fEffectiveCharge.ConstructBranchAndVector(tree,prefix,values);
for(Short_t axis=kXAxis;axis<kNumAxes;axis++){
fSlope[axis].ConstructBranchAndVector(tree,thisprefix,values);
fIntercept[axis].ConstructBranchAndVector(tree,thisprefix,values);
fAbsPos[axis].ConstructBranchAndVector(tree,thisprefix,values);
fMinimumChiSquare[axis].ConstructBranchAndVector(tree,thisprefix,values);
}
}
return;
}
template<typename T>
void QwCombinedBPM<T>::ConstructBranch(TTree *tree, TString &prefix)
{
if (this->GetElementName()==""){
// This channel is not used, so skip constructing trees.
} else
{
TString thisprefix=prefix;
if(prefix=="asym_")
thisprefix="diff_";
fEffectiveCharge.ConstructBranch(tree,prefix);
for(Short_t axis=kXAxis;axis<kNumAxes;axis++){
fSlope[axis].ConstructBranch(tree,thisprefix);
fIntercept[axis].ConstructBranch(tree,thisprefix);
fAbsPos[axis].ConstructBranch(tree,thisprefix);
fMinimumChiSquare[axis].ConstructBranch(tree,thisprefix);
}
}
return;
}
template<typename T>
void QwCombinedBPM<T>::ConstructBranch(TTree *tree, TString &prefix, QwParameterFile& modulelist)
{
TString devicename;
devicename=this->GetElementName();
devicename.ToLower();
if (this->GetElementName()==""){
// This channel is not used, so skip constructing trees.
} else
{
if (modulelist.HasValue(devicename)){
TString thisprefix=prefix;
if(prefix=="asym_")
thisprefix="diff_";
fEffectiveCharge.ConstructBranch(tree,prefix);
for(Short_t axis=kXAxis;axis<kNumAxes;axis++){
fSlope[axis].ConstructBranch(tree,thisprefix);
fIntercept[axis].ConstructBranch(tree,thisprefix);
fAbsPos[axis].ConstructBranch(tree,thisprefix);
fMinimumChiSquare[axis].ConstructBranch(tree,thisprefix);
}
QwMessage <<" Tree leave added to "<<devicename<<QwLog::endl;
}
}
return;
}
template<typename T>
void QwCombinedBPM<T>::FillTreeVector(std::vector<Double_t> &values) const
{
if (this->GetElementName()==""){
// This channel is not used, so skip filling the tree.
}
else{
fEffectiveCharge.FillTreeVector(values);
for(Short_t axis=kXAxis;axis<kNumAxes;axis++){
fSlope[axis].FillTreeVector(values);
fIntercept[axis].FillTreeVector(values);
fAbsPos[axis].FillTreeVector(values);
fMinimumChiSquare[axis].FillTreeVector(values);
}
}
return;
}
template<typename T>
void QwCombinedBPM<T>::SetEventCutMode(Int_t bcuts)
{
// bEVENTCUTMODE=bcuts;
for (Short_t axis=kXAxis;axis<kNumAxes;axis++){
fSlope[axis].SetEventCutMode(bcuts);
fIntercept[axis].SetEventCutMode(bcuts);
fAbsPos[axis].SetEventCutMode(bcuts);
fMinimumChiSquare[axis].SetEventCutMode(bcuts);
}
fEffectiveCharge.SetEventCutMode(bcuts);
return;
}
template<typename T>
void QwCombinedBPM<T>::MakeBPMComboList()
{
for (size_t axis = kXAxis; axis < kNumAxes; axis++) {
T abspos(fAbsPos[axis]);
abspos = fAbsPos[axis];
fBPMComboElementList.push_back(abspos);
T slope(fSlope[axis]);
slope = fSlope[axis];
fBPMComboElementList.push_back(slope);
T intercept(fIntercept[axis]);
intercept = fIntercept[axis];
fBPMComboElementList.push_back(intercept);
T minimumchisquare(fMinimumChiSquare[axis]);
minimumchisquare = fMinimumChiSquare[axis];
fBPMComboElementList.push_back(minimumchisquare);
}
T effectivecharge(fEffectiveCharge);
effectivecharge = fEffectiveCharge;
fBPMComboElementList.push_back(effectivecharge);
}
//-----------------------------------------------------------------------
template<typename T>
void QwCombinedBPM<T>::RandomizeEventData(int helicity, double time)
{
static Double_t zpos = 0;
static T tmp1("tmp1","derived");
// Randomize the abs position and angle.
for (size_t axis=kXAxis; axis<kNumAxes; axis++)
{
fAbsPos[axis].RandomizeEventData(helicity, time);
fSlope[axis].RandomizeEventData(helicity, time);
zpos = this->GetPositionInZ();
//std::cout << "In QwCombinedBPM: zpos= " << zpos << std::endl;
//UInt_t err_flag=fAbsPos[axis].GetEventcutErrorFlag();
fIntercept[axis] = fAbsPos[axis]; // b = X
//fAbsPos[axis].ResetErrorFlag(err_flag);
tmp1.AssignScaledValue(fSlope[axis],zpos); //az
fIntercept[axis] -= tmp1; //b = X - az
// std::cout << axis << " " << fAbsPos[axis].GetValue() << "-" << fSlope[axis].GetValue() <<"*"<<zpos <<"=?" << fIntercept[axis].GetValue() << std::endl;
}
return;
}
template<typename T>
void QwCombinedBPM<T>::SetMockDataAsDiff() {
this->SetMockDataAsDiff();
}
template<typename T>
void QwCombinedBPM<T>::LoadMockDataParameters(QwParameterFile ¶mfile){
/*
Bool_t ldebug=kFALSE;
Double_t meanX=0.0, sigmaX=0.0, meanY=0.0, sigmaY=0.0;
Double_t meanXslope=0.0, sigmaXslope=0.0, meanYslope=0.0, sigmaYslope=0.0;
*/
Double_t xres=0.0, yres=0.0; // Temporary variables for the resoluton.
if (paramfile.GetLine().find("resolution")!=std::string::npos){
paramfile.GetNextToken();
xres = paramfile.GetTypedNextToken<Double_t>();
yres = paramfile.GetTypedNextToken<Double_t>();
this->SetResolution(xres, yres);
} else {
// If we have asym, mean, sigma for each coorindate, then we can do:
TString value = paramfile.GetNextToken();
if (value=="xpos") {
fAbsPos[kXAxis].SetMockDataAsDiff();
fAbsPos[kXAxis].LoadMockDataParameters(paramfile);
}
else if (value=="ypos") {
fAbsPos[kYAxis].SetMockDataAsDiff();
fAbsPos[kYAxis].LoadMockDataParameters(paramfile);
}
else if (value=="xslope") {
fSlope[kXAxis].SetMockDataAsDiff();
fSlope[kXAxis].LoadMockDataParameters(paramfile);
}
else if (value=="yslope") {
fSlope[kYAxis].SetMockDataAsDiff();
fSlope[kYAxis].LoadMockDataParameters(paramfile);
}
/*
for(size_t i=kXAxis;i<kNumAxes;i++){
//std::cout << "In QwCombinedBPM: ChannelName = " << GetElementName() << std::endl;
fAbsPos[i].SetMockDataAsDiff();
fAbsPos[i].LoadMockDataParameters(paramfile);
}
for(size_t i=kXAxis;i<kNumAxes;i++){
//std::cout << "In QwCombinedBPM: ChannelName = " << GetElementName() << std::endl;
fSlope[i].SetMockDataAsDiff();
fSlope[i].LoadMockDataParameters(paramfile);
}
*/
// and so on....
/*
meanX = paramfile.GetTypedNextToken<Double_t>();
sigmaX = paramfile.GetTypedNextToken<Double_t>();
meanY = paramfile.GetTypedNextToken<Double_t>();
sigmaY = paramfile.GetTypedNextToken<Double_t>();
meanXslope = paramfile.GetTypedNextToken<Double_t>();
sigmaXslope = paramfile.GetTypedNextToken<Double_t>();
meanYslope = paramfile.GetTypedNextToken<Double_t>();
sigmaYslope = paramfile.GetTypedNextToken<Double_t>();
if (ldebug==1) {
std::cout << "#################### \n";
std::cout << "meanX, sigmaX, meanY, sigmaY, meanXslope, sigmaXslope, meanYslope, sigmaYslope \n" << std::endl;
std::cout << meanX << " / "
<< sigmaX << " / "
<< meanY << " / "
<< sigmaY << " / "
<< meanXslope << " / "
<< sigmaXslope << " / "
<< meanYslope << " / "
<< sigmaYslope << " / "
<< std::endl;
}
this->SetRandomEventParameters(meanX, sigmaX, meanY, sigmaY, meanXslope, sigmaXslope, meanYslope, sigmaYslope);
*/
}
}
template<typename T>
void QwCombinedBPM<T>::SetRandomEventParameters(Double_t meanX, Double_t sigmaX, Double_t meanY, Double_t sigmaY,
Double_t meanXslope, Double_t sigmaXslope, Double_t meanYslope, Double_t sigmaYslope)
{
/*
fAbsPos[kXAxis].SetMockDataAsDiff();
fAbsPos[kYAxis].SetMockDataAsDiff();
fSlope[kXAxis].SetMockDataAsDiff();
fSlope[kYAxis].SetMockDataAsDiff();
*/
fAbsPos[kXAxis].SetRandomEventParameters(meanX, sigmaX);
fAbsPos[kYAxis].SetRandomEventParameters(meanY, sigmaY);
fSlope[kXAxis].SetRandomEventParameters(meanXslope, sigmaXslope);
fSlope[kYAxis].SetRandomEventParameters(meanYslope, sigmaYslope);
return;
}
//-----------------------------------------------------------------------
#ifdef __USE_DATABASE__
template<typename T>
std::vector<QwDBInterface> QwCombinedBPM<T>::GetDBEntry()
{
std::vector <QwDBInterface> row_list;
row_list.clear();
for(size_t axis=kXAxis;axis<kNumAxes;axis++) {
fAbsPos[axis].AddEntriesToList(row_list);
fSlope[axis].AddEntriesToList(row_list);
fIntercept[axis].AddEntriesToList(row_list);
fMinimumChiSquare[axis].AddEntriesToList(row_list);
}
fEffectiveCharge.AddEntriesToList(row_list);
return row_list;
}
template<typename T>
std::vector<QwErrDBInterface> QwCombinedBPM<T>::GetErrDBEntry()
{
std::vector <QwErrDBInterface> row_list;
row_list.clear();
for(size_t axis=kXAxis;axis<kNumAxes;axis++) {
fAbsPos[axis].AddErrEntriesToList(row_list);
fSlope[axis].AddErrEntriesToList(row_list);
fIntercept[axis].AddErrEntriesToList(row_list);
fMinimumChiSquare[axis].AddErrEntriesToList(row_list);
}
// fEffectiveCharge.AddErrEntriesToList(row_list);
return row_list;
}
#endif // __USE_DATABASE__
template class QwCombinedBPM<QwVQWK_Channel>;
template class QwCombinedBPM<QwSIS3801_Channel>;
template class QwCombinedBPM<QwSIS3801D24_Channel>;
| [
"ciprian@jlab.org"
] | ciprian@jlab.org |
4c27f8afe4f41dfc5f9525fff72afb766d9c2f3f | 01d61a4f248c22d7778b8d15bd45a034db49a34f | /graphics_framework/include/actor/src/baseComponent.cpp | fb3c41fc1c9b43e19b56fc3ff3c8df92e8d71fae | [] | no_license | y1z/Directx_Framework_Project | 5a55cf02c374574b7777d94d64977d8f40ea48c5 | 15d89d27ae432a2323513621dc62bfbf14e411b8 | refs/heads/master | 2020-07-26T13:52:27.281518 | 2019-12-06T09:46:52 | 2019-12-06T09:46:52 | 208,665,870 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 385 | cpp | #include "../baseComponent.h"
baseComponent::baseComponent()
: m_Ready(false),
m_componentType(enComponentTypes::NONE)
{}
void
baseComponent::setReady(bool Readyness)
{
m_Ready = Readyness;
}
void
baseComponent::setComponentType(enComponentTypes type)
{
m_componentType = type;
}
enComponentTypes
baseComponent::getComponentType() const
{
return this->m_componentType;
}
| [
"whyis2cool@gmail.com"
] | whyis2cool@gmail.com |
8acbed43e4f4cf018793821a493cd1409d7966fa | 97963f5bbd2b4a0918b6c4f66e355f1cadc0a2dd | /Makefile 001/main.cpp | ea46c6612ab920e5d5b8b6595be4ea55d634b501 | [
"MIT"
] | permissive | jack17529/Makefile-GNU | a23c9277295b314f1db67ac31698e7821e0c4732 | 88e2589227268d4824da333178e3e629fb0de291 | refs/heads/master | 2021-03-13T01:08:50.295068 | 2017-05-16T15:41:08 | 2017-05-16T15:41:08 | 91,475,395 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 175 | cpp | #include<iostream>
#include "function.h"
int main(){
print_hello();
std::cout << std::endl;
std::cout << "the factorial of 5 is" << factorial(5) << std::endl;
return 0;
}
| [
"noreply@github.com"
] | noreply@github.com |
51e0da1093b07fc677b00b8b70798861ea84e654 | ad74f7a42e8dec14ec7576252fcbc3fc46679f27 | /PioletDC/ProjectStatus.cpp | a8120323714504f72567525420cbde1fa7c0bc17 | [] | no_license | radtek/TrapperKeeper | 56fed7afa259aee20d6d81e71e19786f2f0d9418 | 63f87606ae02e7c29608fedfdf8b7e65339b8e9a | refs/heads/master | 2020-05-29T16:49:29.708375 | 2013-05-15T08:33:23 | 2013-05-15T08:33:23 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,915 | cpp | // ProjectStatus.cpp
#include "stdafx.h"
#include "ProjectStatus.h"
//
//
//
ProjectStatus::ProjectStatus()
{
p_project_name=NULL;
Clear();
}
//
// Copy constructor
//
ProjectStatus::ProjectStatus(const ProjectStatus &status)
{
p_project_name=NULL;
p_project_name=new char[strlen(status.p_project_name)+1];
strcpy(p_project_name,status.p_project_name);
m_total_query_count=status.m_total_query_count;
m_total_query_hit_count=status.m_total_query_hit_count;
v_query_counts=status.v_query_counts;
v_query_hit_counts=status.v_query_hit_counts;
v_query_hits=status.v_query_hits;
v_queries=status.v_queries;
// m_spoof_count=status.m_spoof_count;
// m_dist_count=status.m_dist_count;
// m_poison_count=status.m_poison_count;
}
//
//
//
ProjectStatus::~ProjectStatus()
{
if(p_project_name!=NULL)
{
delete [] p_project_name;
p_project_name=NULL;
}
}
//
//
//
void ProjectStatus::Clear()
{
if(p_project_name!=NULL)
{
delete [] p_project_name;
p_project_name=NULL;
}
ClearCounters();
}
//
// Assignment operator
//
ProjectStatus& ProjectStatus::operator=(const ProjectStatus &status)
{
if(p_project_name!=NULL)
{
delete [] p_project_name;
p_project_name=NULL;
}
p_project_name=new char[strlen(status.p_project_name)+1];
strcpy(p_project_name,status.p_project_name);
m_total_query_count=status.m_total_query_count;
m_total_query_hit_count=status.m_total_query_hit_count;
v_query_counts=status.v_query_counts;
v_query_hit_counts=status.v_query_hit_counts;
v_query_hits=status.v_query_hits;
v_queries=status.v_queries;
// m_spoof_count=status.m_spoof_count;
// m_dist_count=status.m_dist_count;
// m_poison_count=status.m_poison_count;
return *this;
}
//
//
//
void ProjectStatus::ClearCounters()
{
m_total_query_count=0;
m_total_query_hit_count=0;
v_query_counts.clear();
v_query_hit_counts.clear();
v_query_hits.clear();
v_queries.clear();
// m_spoof_count=0;
// m_dist_count=0;
// m_poison_count=0;
}
//
//
//
void ProjectStatus::IncrementTrackQueryCount(int track)
{
m_total_query_count++;
// See if we need to create entries to store this track's count
while(v_query_counts.size()<(UINT)track+1)
{
v_query_counts.push_back(0);
}
// Increment the counter for this track
v_query_counts[track]++;
}
//
//
//
void ProjectStatus::IncrementTrackQueryHitCount(int track)
{
m_total_query_hit_count++;
// See if we need to create entries to store this track's count
while(v_query_hit_counts.size()<(UINT)track+1)
{
v_query_hit_counts.push_back(0);
}
// Increment the counter for this track
v_query_hit_counts[track]++;
}
//
//
//
void ProjectStatus::ProjectName(char *project_name)
{
if(p_project_name!=NULL)
{
delete [] p_project_name;
p_project_name=NULL;
}
p_project_name=new char[strlen(project_name)+1];
strcpy(p_project_name,project_name);
}
//
//
//
char *ProjectStatus::ProjectName()
{
return p_project_name;
} | [
"occupymyday@gmail.com"
] | occupymyday@gmail.com |
3d5d7df4ab2df946d55706275269153337867558 | 116c90f349a8957ba4ad0559c7fcc2be78f0f101 | /Koryakin_Mikhail_lr2/main.cpp | e42f146e4ba2e4502f9fa87ee264a2b8d3b0ad31 | [] | no_license | Abdulrahman-gooba/ADS_7383 | bd9cddd961d2fdf132f8852f15e1f2e5684f3bc5 | d70d0b5a0c4dcb2ebfbc72c8e7c0f619ebe72281 | refs/heads/master | 2020-07-29T02:00:17.162169 | 2018-12-27T13:01:31 | 2018-12-27T13:01:31 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,326 | cpp | #include "func.hpp"
int main ( )
{
filebuf file;
string file_name;
stringbuf exp;
string temp_str;
int run = 1;
string k;
int m;
while(run){
cout<<"Введите 1, если хотите ввести выражение из консоли, введите 2, если хотите ввести выражение из файла, 3 - выход из программы."<<endl;
getline(cin, k);
try{
m=stoi(k);
}
catch(exception& a){
cout<<"Fewfwe"<<endl;
}
try{
switch(m){
case 1:{
cout << "Введите список:" << endl;
getline(cin, temp_str);
istream is(&exp);
exp.str(temp_str);
starter(is);
break;
}
case 2:{
ifstream infile("a.txt");
getline(infile, temp_str);
istream is(&exp);
exp.str(temp_str);
starter(is);
break;
}
case 3:
cout<<"End!"<<endl;
return 0;
default:
break;
}
}
catch(exception& a){
cout << a.what() << endl;
}
}
return 0;
}
| [
"mihakoryakin@yandex.ru"
] | mihakoryakin@yandex.ru |
0a1665770adfe1510055bcc141c6c5c19a09ade3 | bbff50d94efc9bc27a449fd5adcfde0a2ee3b5bf | /codechef/JUNE20B/CHFICRM.cpp | f27e7e6a407730c9aee4792948cfd0a5c399fbfe | [] | no_license | ameybhavsar24/competitive-programming | 389b1ffb9f3d11e18bb90b0bb03127086af2b1f0 | c9f74f4b9dba34b9d98d9e6c433d3d7890eaa63b | refs/heads/main | 2023-07-04T17:03:39.699518 | 2021-08-09T14:27:08 | 2021-08-09T14:27:08 | 379,605,431 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,623 | cpp | // Author: Amey Bhavsar
// IDE: Geany/Ubuntu
// Platform: JUNE20B
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,a,b) for(auto i=a;i<b;i++)
#define repD(i,a,b) for(auto i=a;i>=b;i--)
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
// to be used with algorithms that processes a container Eg: find(all(c),42)
#define all(x) (x).begin(), (x).end() //Forward traversal
#define rall(x) (x).rbegin, (x).rend() //reverse traversal
// traversal function to avoid long template definition
#define tr(c,i) for(__typeof__((c)).begin() i = (c).begin(); i != (c).end(); i++)
//find version works for all containers. This is present in std namespace.
#define cpresent(c,x) (find(all(c),x) != (c).end())
#define MOD 1000000007
//make sure to change MAXN according to constraints
#define MAXN 100001
ll fe (ll x, ll y) {
ll ans = 1;
while (y>0) {
if (y&1) {
ans = (x*ans) % MOD;
}
y /= 2;
x = (x*x) % MOD;
}
return (ans % MOD);
}
int n;
vector<int> a;
void solution() {
cin >> n;
a.assign(n, 0);
for (auto& e : a)
cin >> e;
map<int,int> c;
for (auto& e : a) {
if (e == 5) {
c[e]++;
}
else if (e == 10) {
if (c[5] > 0) {
c[5]--;
c[e]++;
}
else {
cout << "NO\n";
return;
}
}
else if (e == 15) {
if (c[10] > 0) {
c[10]--;
c[e]++;
}
else if (c[5] > 1) {
c[5]-=2;
c[e]++;
}
else {
cout << "NO\n";
return;
}
}
}
cout << "YES\n";
}
int main() {
ios_base::sync_with_stdio(false);cin.tie(NULL);
int t;
cin >> t;
while(t--) {
solution();
}
return 0;
}
| [
"28699912+ameybhavsar24@users.noreply.github.com"
] | 28699912+ameybhavsar24@users.noreply.github.com |
c7b337d9455f28ef9b21d255b717fba57e43fa32 | 6aacf79ae930655c348bd0346d4bc2bc61b69a7e | /ItemType.h | 85a1d6bfe36ec91d06a59b9f9be683b36eee95cc | [] | no_license | nahid226/Data-Structure-in-C-Plus-Plus | bf26cb74df781c9301c5c0dd1669f5942bd9ff33 | 75e8f576d68a3066434a3596a68035e8c2ea8d88 | refs/heads/master | 2020-08-28T02:48:35.699916 | 2019-11-23T18:03:52 | 2019-11-23T18:03:52 | 217,566,264 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 390 | h | #ifndef ITEMTYPE_H
#define ITEMTYPE_H
//const int MAX_ITEMS = 5;
enum RelationType{LESS, GREATER, EQUAL};
class ItemType
{
public:
ItemType();
//~ItemType();
RelationType comparedTo(ItemType) const;
void initialize(int number);
void printItem();
protected:
private:
int value;
};
#endif // ITEMTYPE_H
| [
"noreply@github.com"
] | noreply@github.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.