blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
2
247
content_id
stringlengths
40
40
detected_licenses
listlengths
0
57
license_type
stringclasses
2 values
repo_name
stringlengths
4
111
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
58
visit_date
timestamp[ns]date
2015-07-25 18:16:41
2023-09-06 10:45:08
revision_date
timestamp[ns]date
1970-01-14 14:03:36
2023-09-06 06:22:19
committer_date
timestamp[ns]date
1970-01-14 14:03:36
2023-09-06 06:22:19
github_id
int64
3.89k
689M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
25 values
gha_event_created_at
timestamp[ns]date
2012-06-07 00:51:45
2023-09-14 21:58:52
gha_created_at
timestamp[ns]date
2008-03-27 23:40:48
2023-08-24 19:49:39
gha_language
stringclasses
159 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
7
10.5M
extension
stringclasses
111 values
filename
stringlengths
1
195
text
stringlengths
7
10.5M
94df7b956cadba88322150021f28e1d1229043d6
a87fb23711e1a8a0e38ecee6df823d269fda4b52
/main1.cpp
d57ea2bd5c6f2375ff7c723068f30bc987a12d87
[]
no_license
aenik97/database
4a5dc4640452721568f8326ad972f10afdd9aefe
2eabccd0bff0c7c7592c8aace69f028e7fb3c198
refs/heads/master
2020-03-17T21:49:33.785630
2018-05-18T16:08:37
2018-05-18T16:08:37
133,946,537
0
0
null
null
null
null
UTF-8
C++
false
false
5,153
cpp
main1.cpp
#include <stdarg.h> #include <errno.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <netdb.h> #include <cctype> #include <time.h> #include "headers.h" #define PORT 5555 int read_from_socket(int, char *, int); int write_to_socket(int, const char *); int my_printf(int fd, const char *format, ...) { char buf[LEN]; int len; va_list ap; va_start(ap, format); len = vsnprintf(buf, LEN, format, ap); if (len <= 0) return len; len = write_to_socket(fd, buf); va_end(ap); return len; } int read_from_socket(int fd, char *buf, int maxlen) { int len, i, nbytes; if (read(fd, &len, sizeof(int)) != (int)sizeof(int)) return -1; if (len > maxlen) return -2; for (i = 0; len > 0; i += nbytes, len -= nbytes) { nbytes = read(fd, buf + i, len); if (nbytes < 0) return -3; else if (nbytes == 0) return -4; } return i; } int write_to_socket(int fd, const char *buf) { int len, i, nbytes; len = strlen(buf) + 1; if (write(fd, &len, sizeof(int)) != (int)sizeof(int)) return -1; for (i = 0; len > 0; i += nbytes, len -= nbytes) { nbytes = write(fd, buf + i, len); if (nbytes < 0) return -2; else if (nbytes == 0) return -3; } return i; } int main(int argc, char **argv) { if (argc < 1) printf("Use: %s filename.txt\n", argv[0]); char buf[LEN]; double time = clock(), cclock = 0; int sock, opt = 1, i, count = 0, n = 0; struct sockaddr_in addr; struct sockaddr_in client; FILE *fp = fopen(argv[1], "r"); if (!fp) { fprintf(stderr, "Cannot open DB!\n"); return -1; } command * currentCommand = new command; dataBase *db = new dataBase(100); printf("Loading...\n"); printf("READ AND CONSTRUCTION OF STRUCTURES \n"); if (db -> build(fp) == -3) { delete db; delete currentCommand; fclose(fp); return -1; } else printf("SERVER IS READY!\n"); time = clock() - time; cclock += time; sock = socket(PF_INET, SOCK_STREAM, 0); if (sock < 0) { fprintf(stderr, "Can't open socket!\n"); return -2; } setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (char *)&opt, sizeof(opt)); addr.sin_family = AF_INET; addr.sin_port = htons(PORT); addr.sin_addr.s_addr = htonl(INADDR_ANY); if (bind(sock, (struct sockaddr *)&addr, sizeof(addr)) < 0) { fprintf(stderr, "Can't bind socket!\n"); return -3; } if (listen(sock, 3)) return 3; fd_set active_set, read_set; FD_ZERO(&active_set); FD_SET(sock, &active_set); for (;;) { read_set = active_set; if (select(FD_SETSIZE, &read_set, 0, 0, 0) < 0) return 4; for (i = 0; i < FD_SETSIZE; i++) { if (FD_ISSET(i, &read_set)) { if (i == sock) { unsigned size = sizeof(client); int new_sock = accept(sock, (struct sockaddr *)&client, &size); if (new_sock < 0) { fprintf(stderr, "Can't accept!\n"); fclose(fp); delete db; delete currentCommand; time = clock() - time; cclock += time; printf ("||WORK TIME: %fs||\n", cclock / CLOCKS_PER_SEC); close(sock); return -1; } fprintf(stderr, "Client %d connected\n", count++); inet_ntoa(client.sin_addr); FD_SET(new_sock, &active_set); } else { int len = read_from_socket(i, buf, LEN); for (int j = 0; buf[j]; j++) { if (buf[j] == '\n') { buf[j] = 0; break; } } printf("%s\n", buf); currentCommand->init(buf); if (len < 0) { close(i); currentCommand->~command(); FD_CLR(i, &active_set); } else { if ((buf[0] == 's')&&(buf[1] == 't')) { close(sock); close(i); FD_CLR(i, &active_set); write_to_socket(i, "END"); fclose(fp); currentCommand->~command(); delete db; delete currentCommand; time = clock() - time; cclock += time; printf ("||WORK TIME: %fs||\n", cclock / CLOCKS_PER_SEC); return 0; } else if (buf[0] == 'q') { currentCommand->~command(); close(i); FD_CLR(i, &active_set); write_to_socket(i, "END"); } else { my_printf(i, "---------------------------------------------------------\n"); my_printf(i, "%s\n", buf); currentCommand->init(buf); if (db -> apply(stdout, currentCommand) == -2) { my_printf(i, "Unknown command\n"); write_to_socket(i, "ERROR"); close(i); close(sock); FD_CLR(i, &active_set); fclose(fp); currentCommand->~command(); delete db; delete currentCommand; time = clock() - time; cclock += time; printf ("||WORK TIME: %fs||\n", cclock / CLOCKS_PER_SEC); return 0; } else { write_to_socket(i, "DONE"); currentCommand->~command(); my_printf(i, "\n"); } } } } } } i = FD_SETSIZE; } fclose(fp); delete db; delete currentCommand; close(sock); time = clock() - time; cclock += time; printf ("||WORK TIME: %fs||\n", cclock / CLOCKS_PER_SEC); return 0; }
282dd594aa895594bc340c72d82af72a60048797
8d27f9921397a2ef3d895ebae65d3745263c0754
/KattisProblemSolved/softpasswords.cpp
ba523aa754fd522e935932aa57de7d060dd214cb
[]
no_license
EhtQuyet/OpenKattis
39f1fb9ed56dff527f3bb09e722bf8137113dd23
5ce0a39a6283e5f3966e6bc8bf40cd9877d98bd6
refs/heads/main
2023-06-18T17:06:24.913797
2021-07-20T05:01:50
2021-07-20T05:01:50
387,170,668
0
0
null
null
null
null
UTF-8
C++
false
false
742
cpp
softpasswords.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { string P, S; cin >> P >> S; swap(P,S); set<string> alls; alls.insert(P); // Prepend for(int i = 0; i < 10; i++) { char c = '0' + i; string t = ""; t += c; t += P; alls.insert(t); } // Append for(int i = 0; i < 10; i++) { char c = '0' + i; string t = P; t.push_back(c); alls.insert(t); } // Switch case string g = P; for(auto& i : g) { if(islower(i)) i = toupper(i); else if(isupper(i)) i = tolower(i); } alls.insert(g); if(alls.count(S) > 0) cout << "Yes" << endl; else cout << "No" << endl; }
16756dc54a79db2377be1dfc40fd80fee2e28bad
10c0a8cb0899692014417ef60093ace05e5e1763
/libsrc/rmsg/RMsg_JoinedParty.i
cc886756bc17f25979508d7955af1e7094565ed5
[ "BSD-3-Clause" ]
permissive
openunderlight/ULServer
56cb96360c57598be6f72f2a20c41f69b41b56bd
42e12e245506e6a76c3905d64378eff79c908fc5
refs/heads/dev
2023-03-10T22:50:51.591229
2023-01-31T20:27:44
2023-01-31T20:27:44
145,008,033
7
5
NOASSERTION
2019-12-24T19:08:59
2018-08-16T15:40:15
TSQL
UTF-8
C++
false
false
515
i
RMsg_JoinedParty.i
// RMsg_JoinedParty.i -*- C++ -*- // $Id: RMsg_JoinedParty.i,v 1.4 1997-07-18 17:26:00-07 jason Exp $ // Copyright 1996-1997 Lyra LLC, All rights reserved. // // conditionally inlined methods/functions #ifndef USE_DEBUG INLINE void RMsg_JoinedParty::Dump(FILE*, int) const { // empty } #endif /* !USE_DEBUG */ INLINE const RmRemotePlayer& RMsg_JoinedParty::PartyMember() const { return data_.member; } INLINE void RMsg_JoinedParty::SetPartyMember(const RmRemotePlayer& member) { data_.member = member; }
0fc67866cfcc898d974ffdc45bb32920be69dda4
204a11b2169109924d40ce89c42539ceef767929
/interface/AnalysisUtils.h
b9ad3b0eb40f67438b5fa0f6712c4d3b8533b98d
[]
no_license
abeschi/TTHAnalysis
ed8ccffe41d803016ef4b477970ad3463c29d7aa
956a163b855a476b8bbe671e33a40473d6abf265
refs/heads/master
2021-04-06T20:39:12.983100
2018-03-06T13:43:09
2018-03-06T13:43:09
null
0
0
null
null
null
null
UTF-8
C++
false
false
2,284
h
AnalysisUtils.h
#ifndef ANALYSIS_UTILS_H #define ANALYSIS_UTILS_H #include "interface/CMS_lumi.h" #include "interface/TreeUtils.h" #include <iostream> #include <iomanip> #include <map> #include "TLorentzVector.h" #include "TH1F.h" #include "TCanvas.h" #include "TLegend.h" #define MZ 91.187 #define PI 3.14159265359 #define bDiscriminantThresholdLoose 0.5426 #define bDiscriminantThresholdMedium 0.8484 #define bDiscriminantThresholdTight 0.9535 enum DiLeptonCategories { None, DiMuon, DiElectron, Mixed }; float DeltaEta(const float& eta1, const float& eta2); float DeltaPhi(const float& phi1, const float& phi2); float DeltaR(const float& eta1, const float& phi1, const float& eta2, const float& phi2); bool DiMuonSelections(TLorentzVector mu1, TLorentzVector mu2, float charge1, float charge2, TLorentzVector ph1, TLorentzVector ph2, float Iso1, float Iso2); bool DiEleSelections(TLorentzVector ele1, TLorentzVector ele2, float charge1, float charge2, TLorentzVector ph1, TLorentzVector ph2, float miniIso1, float miniIso2, float dTrk1, float dTrk2); bool MixedSelections(TLorentzVector mu, TLorentzVector ele, float charge1, float charge2, TLorentzVector ph1, TLorentzVector ph2); bool SingleMuSelections(TLorentzVector mu1, TLorentzVector ph1, TLorentzVector ph2, float miniIso); bool SingleEleSelections(TLorentzVector ele1, TLorentzVector ph1, TLorentzVector ph2, float miniIso, float drTrk); bool SingleMuSelectionsStandard(TLorentzVector mu1, TLorentzVector ph1, TLorentzVector ph2, float miniIso); bool SingleEleSelectionsStandard(TLorentzVector ele1, TLorentzVector ph1, TLorentzVector ph2, float miniIso, float drTrk); bool OneCategorySelection(const TreeVars& treeVars, const int& type); bool DiLeptonSelection(const TreeVars& treeVars, const int& type, DiLeptonCategories& cat); bool SingleLeptonSelection(const TreeVars& treeVars, const int& type); bool CutBasedSelection(const TreeVars& treeVars, const float& min_lead_ptoM, const float& min_sublead_ptoM, const float& min_leadIDMVA, const float& min_subleadIDMVA, const float& max_deltaphi, const float& max_deltaeta); void MakePlot(TH1F**, TString title); void MakePlot2(std::map<std::string,TH1F*>& histos, TString title); #endif
472fd0ee64992a9b113568cd3a0fc4cd307d6e8c
79cd409b4b12f8ab76a31130750753e147c5dd4e
/wiselib.testing/external_interface/feuerwhere/feuerwhere_timer.h
9a8b60d69cc2c29e4312b7f31b1bb32bcfef55e9
[]
no_license
bjoerke/wiselib
d28eb39e9095c9bfcec6b4c635b773f5fcaf87fa
183726cbf744be9d65f12dd01bece0f7fd842541
refs/heads/master
2020-12-28T20:30:40.829538
2014-08-18T14:10:42
2014-08-18T14:10:42
19,933,324
1
0
null
null
null
null
UTF-8
C++
false
false
4,532
h
feuerwhere_timer.h
/*************************************************************************** ** This file is part of the generic algorithm library Wiselib. ** ** Copyright (C) 2008,2009 by the Wisebed (www.wisebed.eu) project. ** ** ** ** The Wiselib 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. ** ** ** ** The Wiselib 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 the Wiselib. ** ** If not, see <http://www.gnu.org/licenses/>. ** ***************************************************************************/ #ifndef CONNECTOR_FEUERWHERE_TIMER_H #define CONNECTOR_FEUERWHERE_TIMER_H //#include "external_interface/contiki/contiki_types.h" #include "external_interface/feuerwhere/feuerwhere_types.h" #include "util/delegates/delegate.hpp" #include <stdio.h> #include <stdlib.h> extern "C" { //TODO: // #include "sys/ctimer.h" #include "ktimer.h" //#include "timerdef.h" //#include "kernel.h" #include "utimer.h" #include "timelib.h" #include "flags.h" #include "msg.h" #include "thread.h" #include "clock.h" #include "callback-demon.h" #include "cfg-feuerware.h" //#include "powermon.h" #include "mutex.h" //#include "kernel.h" //#include "clock.h" //static mutex_t list_mutex; #define UTIMER_STACK_SIZE 400 #define PRIORITY_UTIMER 22 // drivers //#include "hal-board.h" } namespace wiselib { typedef delegate1<void, void*> feuerwhere_timer_delegate_t; // ----------------------------------------------------------------------- struct FeuerwhereTimerItem { feuerwhere_timer_delegate_t cb; void *ptr; struct utimer ut; // bool used; }; // ----------------------------------------------------------------------- void init_timer( void ); FeuerwhereTimerItem* get_feuerwhere_timer_item( void ); void feuerwhere_timer_thread(void); // ----------------------------------------------------------------------- /** \brief Feuerwhere Implementation of \ref timer_concept "Timer Concept" * \ingroup timer_concept * * Feuerwhere implementation of the \ref timer_concept "Timer Concept" ... */ template<typename OsModel_P> class FeuerwhereTimerModel { public: typedef OsModel_P OsModel; typedef FeuerwhereTimerModel<OsModel> self_type; typedef self_type* self_pointer_t; typedef struct utimer *ut; typedef uint32_t millis_t; // -------------------------------------------------------------------- enum ErrorCodes { SUCCESS = OsModel::SUCCESS, ERR_UNSPEC = OsModel::ERR_UNSPEC, ERR_NOTIMPL = OsModel::ERR_NOTIMPL }; // ----------------------------------------------------------------- template<typename T, void (T::*TMethod)(void*)> int set_timer( millis_t millis, T *obj_pnt, void *userdata ) { FeuerwhereTimerItem *fti = get_feuerwhere_timer_item(); // no free timer item left int secs= ((int)millis/1000) + 1; if ( !fti ){ printf ("ERORR configuring fti.....RETURNING.....\n"); return ERR_UNSPEC; } fti->cb = feuerwhere_timer_delegate_t::from_method<T, TMethod>( obj_pnt ); utimer_set_wpid(&(fti->ut), (time_t)secs, pid , (void*)fti); printf ("Setting up a timer for %d\n", (int)userdata); return SUCCESS; }; FeuerwhereTimerModel(void) { pid=0; printf("FeuerwhereTimerModel constructor\n"); pid = thread_create(4000, 10, CREATE_STACKTEST, feuerwhere_timer_thread, "fw_timer_thread"); }; private: int pid; }; // ----------------------------------------------------------------------- } #endif
b673083a04fd0c2712613e76c02b7c4f220bf481
a967aa2edbcf89e682cd9af22470b42371beb5e5
/src/RenderLab/render/RdrInstancedObjectDataBuffer.h
5b28dd9d0fb0f702ce42aeddef2f811cc059ee28
[]
no_license
belzen/RenderLab
0410c6329a0ec6ffc536f37244c4fd8dfc93f927
fa4f6b6a394c806880198114b96a5ddb5c9996b5
refs/heads/master
2020-04-06T05:54:50.780909
2020-01-26T01:52:09
2020-01-26T01:52:09
51,707,479
2
0
null
null
null
null
UTF-8
C++
false
false
418
h
RdrInstancedObjectDataBuffer.h
#pragma once #include "RdrResource.h" #include "RdrShaderConstants.h" class Renderer; typedef uint16 RdrInstancedObjectDataId; namespace RdrInstancedObjectDataBuffer { RdrInstancedObjectDataId AllocEntry(); void ReleaseEntry(RdrInstancedObjectDataId id); VsPerObject* GetEntry(RdrInstancedObjectDataId id); RdrResourceHandle GetResourceHandle(); void UpdateBuffer(Renderer& rRenderer); void FlipState(); }
2365c688551272480eaaece35537c5f7c93f2bb5
d4cbd4cc0d30cd2439fa363a9f88f095167fcc20
/Proyect Radio SI4463Pro/Lab-01/RF4463PRO.cp
13fd3d7a224ba4bd10645bda3f3769c5995845b1
[]
no_license
eleyvaKlever/Testing_Ed
90494b6d456c576f97da847749fde00d9ac72d8d
8b5a30e91da8953df28f1c2b912adf85ba2225b2
refs/heads/master
2021-04-09T10:22:54.575135
2021-03-25T01:36:30
2021-03-25T01:36:30
125,521,796
0
0
null
null
null
null
UTF-8
C++
false
false
34,792
cp
RF4463PRO.cp
#line 1 "C:/Users/Crow/Desktop/Lab-01/RF4463PRO.c" #line 1 "c:/users/public/documents/mikroelektronika/mikroc pro for arm/include/built_in.h" #line 1 "c:/users/public/documents/mikroelektronika/mikroc pro for arm/include/stdint.h" typedef signed char int8_t; typedef signed int int16_t; typedef signed long int int32_t; typedef signed long long int64_t; typedef unsigned char uint8_t; typedef unsigned int uint16_t; typedef unsigned long int uint32_t; typedef unsigned long long uint64_t; typedef signed char int_least8_t; typedef signed int int_least16_t; typedef signed long int int_least32_t; typedef signed long long int_least64_t; typedef unsigned char uint_least8_t; typedef unsigned int uint_least16_t; typedef unsigned long int uint_least32_t; typedef unsigned long long uint_least64_t; typedef signed long int int_fast8_t; typedef signed long int int_fast16_t; typedef signed long int int_fast32_t; typedef signed long long int_fast64_t; typedef unsigned long int uint_fast8_t; typedef unsigned long int uint_fast16_t; typedef unsigned long int uint_fast32_t; typedef unsigned long long uint_fast64_t; typedef signed long int intptr_t; typedef unsigned long int uintptr_t; typedef signed long long intmax_t; typedef unsigned long long uintmax_t; #line 1 "c:/users/public/documents/mikroelektronika/mikroc pro for arm/include/string.h" void * memchr(void *p, char n, unsigned int v); int memcmp(void *s1, void *s2, int n); void * memcpy(void * d1, void * s1, int n); void * memmove(void * to, void * from, int n); void * memset(void * p1, char character, int n); char * strcat(char * to, char * from); char * strchr(char * ptr, char chr); int strcmp(char * s1, char * s2); char * strcpy(char * to, char * from); int strlen(char * s); char * strncat(char * to, char * from, int size); char * strncpy(char * to, char * from, int size); int strspn(char * str1, char * str2); char strcspn(char * s1, char * s2); int strncmp(char * s1, char * s2, char len); char * strpbrk(char * s1, char * s2); char * strrchr(char *ptr, char chr); char * strstr(char * s1, char * s2); char * strtok(char * s1, char * s2); #line 1 "c:/users/public/documents/mikroelektronika/mikroc pro for arm/include/stdlib.h" typedef struct divstruct { int quot; int rem; } div_t; typedef struct ldivstruct { long quot; long rem; } ldiv_t; typedef struct uldivstruct { unsigned long quot; unsigned long rem; } uldiv_t; int abs(int a); float atof(char * s); int atoi(char * s); long atol(char * s); div_t div(int number, int denom); ldiv_t ldiv(long number, long denom); uldiv_t uldiv(unsigned long number, unsigned long denom); long labs(long x); long int max(long int a, long int b); long int min(long int a, long int b); void srand(unsigned x); int rand(); int xtoi(char * s); #line 1 "c:/users/public/documents/mikroelektronika/mikroc pro for arm/include/stdio.h" #line 1 "c:/users/public/documents/mikroelektronika/mikroc pro for arm/include/stdbool.h" typedef char _Bool; #line 1 "c:/users/crow/desktop/lab-01/radio_config_si4463.h" #line 12 "C:/Users/Crow/Desktop/Lab-01/RF4463PRO.c" typedef unsigned char U8; typedef unsigned int U16; typedef unsigned long U32; typedef char S8; typedef int S16; typedef long S32; #line 122 "C:/Users/Crow/Desktop/Lab-01/RF4463PRO.c" float vMin [7][6] = { 3.00, 3.00, 3.00, 0.00, 0.00, 0.00, 3.50, 3.00, 11.00, 0.00, 0.00, 0.00, 3.00, 3.00, 4.00, 0.00, 0.00, 0.00, 3.40, 3.10, 17.00, 4.80, 0.00, 0.00, 3.00, 3.00, 4.00, 0.00, 0.00, 0.00, 3.40, 9.00, 3.00, 0.00, 0.00, 0.00, 4.00, 3.00, 3.00, 3.00, 3.00, 3.00 }; const unsigned char RF_MODEM_MOD_TYPE_12[11][12] = { 0x03, 0x00, 0x07, 0x00, 0x12, 0xC0, 0x04, 0x2D, 0xC6, 0xC0, 0x00, 0x00, 0x03, 0x00, 0x07, 0x00, 0x25, 0x80, 0x04, 0x2D, 0xC6, 0xC0, 0x00, 0x00, 0x03, 0x00, 0x07, 0x00, 0x4B, 0x00, 0x04, 0x2D, 0xC6, 0xC0, 0x00, 0x00, 0x03, 0x00, 0x07, 0x00, 0x96, 0x00, 0x04, 0x2D, 0xC6, 0xC0, 0x00, 0x00, 0x03, 0x00, 0x07, 0x01, 0x2C, 0x00, 0x04, 0x2D, 0xC6, 0xC0, 0x00, 0x01, 0x03, 0x00, 0x07, 0x01, 0x2C, 0x00, 0x08, 0x2D, 0xC6, 0xC0, 0x00, 0x01, 0x03, 0x00, 0x07, 0x02, 0x58, 0x00, 0x08, 0x2D, 0xC6, 0xC0, 0x00, 0x01, 0x03, 0x00, 0x07, 0x03, 0x84, 0x00, 0x08, 0x2D, 0xC6, 0xC0, 0x00, 0x01, 0x03, 0x00, 0x07, 0x27, 0x10, 0x00, 0x01, 0xC9, 0xC3, 0x80, 0x00, 0x01, 0x03, 0x00, 0x07, 0x4C, 0x4B, 0x40, 0x01, 0xC9, 0xC3, 0x80, 0x00, 0x1b, 0x03, 0x00, 0x07, 0x00, 0x07, 0xD0, 0x04, 0x2D, 0xC6, 0xC0, 0x00, 0x00 }; const unsigned char RF_MODEM_TX_RAMP_DELAY_8_433[11][8]= { 0x01, 0x80, 0x08, 0x03, 0x80, 0x00, 0x70, 0x20, 0x01, 0x80, 0x08, 0x03, 0x80, 0x00, 0x70, 0x20, 0x01, 0x00, 0x08, 0x03, 0x80, 0x00, 0x70, 0x20, 0x01, 0x00, 0x08, 0x03, 0x80, 0x00, 0x70, 0x20, 0x01, 0x00, 0x08, 0x03, 0x80, 0x00, 0x30, 0x10, 0x01, 0x00, 0x08, 0x03, 0x80, 0x00, 0x20, 0x10, 0x01, 0x00, 0x08, 0x03, 0x80, 0x00, 0x10, 0x10, 0x01, 0x00, 0x08, 0x03, 0x80, 0x00, 0x10, 0x20, 0x01, 0x00, 0x08, 0x03, 0x80, 0x00, 0x00, 0x30, 0x01, 0x00, 0x08, 0x03, 0x80, 0x00, 0x00, 0x30, 0x01, 0x80, 0x08, 0x03, 0x80, 0x00, 0x72, 0x21 }; const unsigned char RF_MODEM_TX_RAMP_DELAY_8_850[11][8]= { 0x01, 0x80, 0x08, 0x03, 0xC0, 0x00, 0x32, 0x20, 0x01, 0x80, 0x08, 0x03, 0xC0, 0x00, 0x30, 0x20, 0x01, 0x80, 0x08, 0x03, 0xC0, 0x00, 0x30, 0x20, 0x01, 0x00, 0x08, 0x03, 0xC0, 0x00, 0x30, 0x20, 0x01, 0x00, 0x08, 0x03, 0xC0, 0x00, 0x30, 0x20, 0x01, 0x00, 0x08, 0x03, 0xC0, 0x00, 0x20, 0x10, 0x01, 0x00, 0x08, 0x03, 0xC0, 0x00, 0x10, 0x10, 0x01, 0x00, 0x08, 0x03, 0xC0, 0x00, 0x10, 0x20, 0x01, 0x00, 0x08, 0x03, 0x80, 0x00, 0x00, 0x30, 0x01, 0x00, 0x08, 0x03, 0x80, 0x00, 0x00, 0x30, 0x01, 0x80, 0x08, 0x03, 0x80, 0x00, 0x72, 0x21 }; const unsigned char RF_MODEM_BCR_OSR_1_9_433[11][9]= { 0x03, 0x0D, 0x00, 0xA7, 0xC6, 0x00, 0x54, 0x02, 0xC2, 0x01, 0x87, 0x01, 0x4F, 0x8B, 0x00, 0xA8, 0x02, 0xC2, 0x00, 0xC3, 0x02, 0x9F, 0x17, 0x02, 0x1A, 0x02, 0x00, 0x00, 0x62, 0x05, 0x3E, 0x2D, 0x07, 0xFF, 0x02, 0x00, 0x00, 0x41, 0x07, 0xDD, 0x44, 0x07, 0xFF, 0x02, 0x00, 0x00, 0x41, 0x07, 0xDD, 0x44, 0x07, 0xFF, 0x02, 0x00, 0x00, 0x41, 0x07, 0xDD, 0x44, 0x07, 0xFF, 0x02, 0x00, 0x00, 0x41, 0x07, 0xDD, 0x44, 0x07, 0xFF, 0x02, 0x00, 0x00, 0x75, 0x04, 0x5E, 0x7B, 0x05, 0x9a, 0x02, 0x00, 0x00, 0x3C, 0x08, 0x88, 0x89, 0x07, 0xFF, 0x02, 0x00, 0x03, 0xAA, 0x00, 0x8B, 0xCF, 0x00, 0x46, 0x02, 0xC2 }; const unsigned char RF_MODEM_BCR_OSR_1_9_850[11][9]= { 0x03, 0x0D, 0x00, 0xA7, 0xC6, 0x00, 0x54, 0x02, 0xC2, 0x03, 0x0D, 0x00, 0xA7, 0xC6, 0x00, 0x54, 0x02, 0xC2, 0x01, 0x87, 0x01, 0x4F, 0x8B, 0x00, 0xA8, 0x02, 0xC2, 0x00, 0xC3, 0x02, 0x9F, 0x17, 0x01, 0x93, 0x02, 0x00, 0x00, 0x62, 0x05, 0x3E, 0x2D, 0x05, 0x04, 0x02, 0x00, 0x00, 0x41, 0x07, 0xDD, 0x44, 0x07, 0xFF, 0x02, 0x00, 0x00, 0x41, 0x07, 0xDD, 0x44, 0x07, 0xFF, 0x02, 0x00, 0x00, 0x41, 0x07, 0xDD, 0x44, 0x07, 0xFF, 0x02, 0x00, 0x00, 0x75, 0x04, 0x5E, 0x7B, 0x05, 0x9a, 0x02, 0x00, 0x00, 0x3C, 0x08, 0x88, 0x89, 0x07, 0xFF, 0x02, 0x00, 0x03, 0xAA, 0x00, 0x8B, 0xCF, 0x00, 0x46, 0x02, 0xC2 }; const unsigned char RF_MODEM_AFC_GEAR_7_433[11][7]= { 0x04, 0x36, 0x80, 0x03, 0x30, 0xAF, 0x80, 0x04, 0x36, 0x80, 0x07, 0x14, 0xDD, 0x80, 0x00, 0x12, 0x80, 0x2A, 0x04, 0x3A, 0xA0, 0x00, 0x12, 0x80, 0x54, 0x02, 0x5A, 0xA0, 0x00, 0x12, 0x80, 0xA8, 0x01, 0x68, 0xE0, 0x00, 0x12, 0x81, 0x50, 0x01, 0x20, 0xE0, 0x00, 0x12, 0x82, 0x9F, 0x01, 0x03, 0xE0, 0x00, 0x23, 0x87, 0xDD, 0x00, 0x77, 0xE0, 0x00, 0x23, 0x8F, 0xFF, 0x00, 0xc9, 0xE0, 0x00, 0x23, 0x8F, 0xFF, 0x01, 0x23, 0xE0, 0x04, 0x36, 0x80, 0x01, 0x50, 0x69, 0x80 }; const unsigned char RF_MODEM_AFC_GEAR_7_850[11][7]= { 0x04, 0x36, 0x80, 0x01, 0x52, 0x30, 0x80, 0x04, 0x36, 0x80, 0x03, 0x30, 0x7F, 0x80, 0x04, 0x36, 0x80, 0x07, 0x17, 0x10, 0x80, 0x00, 0x12, 0x80, 0x2A, 0x04, 0xB1, 0xA0, 0x00, 0x12, 0x80, 0x54, 0x02, 0x9A, 0xA0, 0x00, 0x12, 0x80, 0xA8, 0x01, 0x8F, 0xA0, 0x00, 0x12, 0x81, 0x50, 0x01, 0x1F, 0xA0, 0x00, 0x23, 0x83, 0xEF, 0x00, 0x84, 0xA0, 0x00, 0x23, 0x8F, 0xFF, 0x00, 0xc9, 0xE0, 0x00, 0x23, 0x8F, 0xFF, 0x01, 0x23, 0xE0, 0x04, 0x36, 0x80, 0x01, 0x50, 0x69, 0x80 }; const unsigned char RF_MODEM_AGC_WINDOW_SIZE_9_433[11][9]= { 0x11, 0xAB, 0xAB, 0x00, 0x1A, 0x14, 0x00, 0x00, 0x2B, 0x11, 0x56, 0x56, 0x00, 0x1A, 0xA0, 0x00, 0x00, 0x2A, 0x11, 0x2B, 0x2B, 0x00, 0x1A, 0x50, 0x00, 0x00, 0x29, 0x11, 0x15, 0x15, 0x00, 0x1A, 0x28, 0x00, 0x00, 0x28, 0x11, 0x0E, 0x0E, 0x00, 0x1A, 0x21, 0x55, 0x00, 0x28, 0x11, 0x0E, 0x0E, 0x00, 0x1A, 0x10, 0xAB, 0x00, 0x28, 0x11, 0x0E, 0x0E, 0x00, 0x1A, 0x08, 0x55, 0x00, 0x28, 0x11, 0x0E, 0x0E, 0x00, 0x1A, 0x05, 0x8E, 0x00, 0x28, 0x22, 0x0D, 0x0D, 0x00, 0x1A, 0x32, 0x00, 0x00, 0x28, 0x22, 0x07, 0x07, 0x00, 0x1A, 0x19, 0x9a, 0x00, 0x27, 0x11, 0xCD, 0xCD, 0x00, 0x1A, 0x30, 0x00, 0x00, 0x2B }; const unsigned char RF_MODEM_AGC_WINDOW_SIZE_9_850[11][9]= { 0x11, 0xAB, 0xAB, 0x00, 0x02, 0xFF, 0xFF, 0x00, 0x2B, 0x11, 0xAB, 0xAB, 0x00, 0x02, 0xFF, 0xFF, 0x00, 0x2B, 0x11, 0x56, 0x56, 0x00, 0x02, 0xD5, 0x55, 0x00, 0x2A, 0x11, 0x2B, 0x2B, 0x00, 0x02, 0x6A, 0xAB, 0x00, 0x29, 0x11, 0x15, 0x15, 0x00, 0x02, 0x42, 0xAB, 0x00, 0x28, 0x11, 0x0E, 0x0E, 0x00, 0x02, 0x21, 0x55, 0x00, 0x28, 0x11, 0x0E, 0x0E, 0x00, 0x02, 0x10, 0xAB, 0x00, 0x28, 0x11, 0x0E, 0x0E, 0x00, 0x02, 0x10, 0xAB, 0x00, 0x28, 0x22, 0x0D, 0x0D, 0x00, 0x1A, 0x32, 0x00, 0x00, 0x28, 0x22, 0x07, 0x07, 0x00, 0x1A, 0x19, 0x9a, 0x00, 0x27, 0x11, 0xCD, 0xCD, 0x00, 0x1A, 0x30, 0x00, 0x00, 0x2B }; const unsigned char RF_MODEM_OOK_CNT1_11_433[11][11]= { 0xA4, 0x02, 0xD6, 0x83, 0x00, 0xAD, 0x01, 0x80, 0xFF, 0x0C, 0x00, 0xA4, 0x02, 0xD6, 0x83, 0x00, 0xAD, 0x01, 0x80, 0xFF, 0x0C, 0x00, 0xA4, 0x03, 0xD6, 0x03, 0x00, 0xCC, 0x01, 0x80, 0xFF, 0x0C, 0x00, 0xA4, 0x03, 0xD6, 0x03, 0x00, 0xCC, 0x01, 0x80, 0xFF, 0x0C, 0x00, 0xA4, 0x03, 0xD6, 0x03, 0x01, 0x00, 0x01, 0x80, 0xFF, 0x0C, 0x00, 0xA4, 0x03, 0xD6, 0x03, 0x00, 0x80, 0x01, 0x80, 0xFF, 0x0C, 0x00, 0xA4, 0x03, 0xD6, 0x03, 0x00, 0x40, 0x01, 0x80, 0xFF, 0x0C, 0x00, 0xA4, 0x03, 0xD6, 0x03, 0x00, 0x2B, 0x01, 0x80, 0xFF, 0x0C, 0x00, 0xA4, 0x03, 0xD6, 0x03, 0x00, 0xd5, 0x01, 0x80, 0xFF, 0x0C, 0x00, 0xA4, 0x03, 0xD6, 0x03, 0x00, 0xd5, 0x01, 0x80, 0xFF, 0x0C, 0x00, 0xA4, 0x02, 0xD6, 0x81, 0x02, 0xB4, 0x01, 0x80, 0xFF, 0x0C, 0x00 }; const unsigned char RF_MODEM_OOK_CNT1_11_850[11][11]= { 0xA4, 0x02, 0xD6, 0x81, 0x03, 0x9B, 0x01, 0x80, 0xFF, 0x0C, 0x02, 0xA4, 0x02, 0xD6, 0x83, 0x00, 0xE7, 0x01, 0x80, 0xFF, 0x0C, 0x02, 0xA4, 0x02, 0xD6, 0x83, 0x00, 0xE7, 0x01, 0x80, 0xFF, 0x0C, 0x02, 0xA4, 0x03, 0xD6, 0x03, 0x01, 0x11, 0x01, 0x80, 0xFF, 0x0C, 0x02, 0xA4, 0x03, 0xD6, 0x03, 0x01, 0x55, 0x01, 0x80, 0xFF, 0x0C, 0x02, 0xA4, 0x03, 0xD6, 0x03, 0x01, 0x00, 0x01, 0x80, 0xFF, 0x0C, 0x02, 0xA4, 0x03, 0xD6, 0x03, 0x00, 0x80, 0x01, 0x80, 0xFF, 0x0C, 0x02, 0xA4, 0x03, 0xD6, 0x03, 0x00, 0x80, 0x01, 0x80, 0xFF, 0x0C, 0x02, 0xA4, 0x03, 0xD6, 0x03, 0x00, 0xd5, 0x01, 0x80, 0xFF, 0x0C, 0x02, 0xA4, 0x03, 0xD6, 0x03, 0x00, 0xd5, 0x01, 0x80, 0xFF, 0x0C, 0x02, 0xA4, 0x02, 0xD6, 0x81, 0x02, 0xB4, 0x01, 0x80, 0xFF, 0x0C, 0x02 }; const unsigned char RF_MODEM_CHFLT_RX1_CHFLT_COE13_7_0_12_433[11][12]= { 0xFF, 0xC4, 0x30, 0x7F, 0xF5, 0xB5, 0xB8, 0xDE, 0x05, 0x17, 0x16, 0x0C, 0xFF, 0xC4, 0x30, 0x7F, 0xF5, 0xB5, 0xB8, 0xDE, 0x05, 0x17, 0x16, 0x0C, 0xCC, 0xA1, 0x30, 0xA0, 0x21, 0xD1, 0xB9, 0xC9, 0xEA, 0x05, 0x12, 0x11, 0xFF, 0xC4, 0x30, 0x7F, 0xF5, 0xB5, 0xB8, 0xDE, 0x05, 0x17, 0x16, 0x0C, 0xCC, 0xA1, 0x30, 0xA0, 0x21, 0xD1, 0xB9, 0xC9, 0xEA, 0x05, 0x12, 0x11, 0x7E, 0x64, 0x1B, 0xBA, 0x58, 0x0B, 0xDD, 0xCE, 0xD6, 0xE6, 0xF6, 0x00, 0x5B, 0x47, 0x0F, 0xC0, 0x6D, 0x25, 0xF4, 0xDB, 0xD6, 0xDF, 0xEC, 0xF7, 0x5B, 0x47, 0x0F, 0xC0, 0x6D, 0x25, 0xF4, 0xDB, 0xD6, 0xDF, 0xEC, 0xF7, 0x39, 0x2B, 0x00, 0xC3, 0x7F, 0x3F, 0x0C, 0xEC, 0xDC, 0xDC, 0xE3, 0xED, 0xA2, 0x81, 0x26, 0xAF, 0x3F, 0xEE, 0xC8, 0xC7, 0xDB, 0xF2, 0x02, 0x08, 0xCC, 0xA1, 0x30, 0xA0, 0x21, 0xD1, 0xB9, 0xC9, 0xEA, 0x05, 0x12, 0x11 }; const unsigned char RF_MODEM_CHFLT_RX1_CHFLT_COE13_7_0_12_850[11][12]= { 0xFF, 0xC4, 0x30, 0x7F, 0xF5, 0xB5, 0xB8, 0xDE, 0x05, 0x17, 0x16, 0x0C, 0xFF, 0xC4, 0x30, 0x7F, 0xF5, 0xB5, 0xB8, 0xDE, 0x05, 0x17, 0x16, 0x0C, 0xFF, 0xBA, 0x0F, 0x51, 0xCF, 0xA9, 0xC9, 0xFC, 0x1B, 0x1E, 0x0F, 0x01, 0xFF, 0xC4, 0x30, 0x7F, 0xF5, 0xB5, 0xB8, 0xDE, 0x05, 0x17, 0x16, 0x0C, 0xFF, 0xBA, 0x0F, 0x51, 0xCF, 0xA9, 0xC9, 0xFC, 0x1B, 0x1E, 0x0F, 0x01, 0xFF, 0xC4, 0x30, 0x7F, 0xF5, 0xB5, 0xB8, 0xDE, 0x05, 0x17, 0x16, 0x0C, 0x7E, 0x64, 0x1B, 0xBA, 0x58, 0x0B, 0xDD, 0xCE, 0xD6, 0xE6, 0xF6, 0x00, 0x7E, 0x64, 0x1B, 0xBA, 0x58, 0x0B, 0xDD, 0xCE, 0xD6, 0xE6, 0xF6, 0x00, 0x39, 0x2B, 0x00, 0xC3, 0x7F, 0x3F, 0x0C, 0xEC, 0xDC, 0xDC, 0xE3, 0xED, 0xA2, 0x81, 0x26, 0xAF, 0x3F, 0xEE, 0xC8, 0xC7, 0xDB, 0xF2, 0x02, 0x08, 0xCC, 0xA1, 0x30, 0xA0, 0x21, 0xD1, 0xB9, 0xC9, 0xEA, 0x05, 0x12, 0x11 }; const unsigned char RF_MODEM_CHFLT_RX1_CHFLT_COE1_7_0_12_433[11][12]= { 0x03, 0x00, 0x15, 0xFF, 0x00, 0x00, 0xFF, 0xC4, 0x30, 0x7F, 0xF5, 0xB5, 0x03, 0x00, 0x15, 0xFF, 0x00, 0x00, 0xFF, 0xC4, 0x30, 0x7F, 0xF5, 0xB5, 0x0A, 0x04, 0x15, 0xFC, 0x03, 0x00, 0xCC, 0xA1, 0x30, 0xA0, 0x21, 0xD1, 0x03, 0x00, 0x15, 0xFF, 0x00, 0x00, 0xFF, 0xC4, 0x30, 0x7F, 0xF5, 0xB5, 0x0A, 0x04, 0x15, 0xFC, 0x03, 0x00, 0xCC, 0xA1, 0x30, 0xA0, 0x21, 0xD1, 0x03, 0x03, 0x15, 0xF0, 0x3F, 0x00, 0x7E, 0x64, 0x1B, 0xBA, 0x58, 0x0B, 0xFE, 0x01, 0x15, 0xF0, 0xFF, 0x03, 0x5B, 0x47, 0x0F, 0xC0, 0x6D, 0x25, 0xFE, 0x01, 0x15, 0xF0, 0xFF, 0x03, 0x5B, 0x47, 0x0F, 0xC0, 0x6D, 0x25, 0xF6, 0xFD, 0x15, 0xC0, 0xFF, 0x0F, 0x39, 0x2B, 0x00, 0xC3, 0x7F, 0x3F, 0x07, 0x03, 0x15, 0xFC, 0x0F, 0x00, 0xA2, 0x81, 0x26, 0xAF, 0x3F, 0xEE, 0x0A, 0x04, 0x15, 0xFC, 0x03, 0x00, 0xCC, 0xA1, 0x30, 0xA0, 0x21, 0xD1 }; const unsigned char RF_MODEM_CHFLT_RX1_CHFLT_COE1_7_0_12_850[11][12]= { 0x03, 0x00, 0x15, 0xFF, 0x00, 0x00, 0xFF, 0xC4, 0x30, 0x7F, 0xF5, 0xB5, 0x03, 0x00, 0x15, 0xFF, 0x00, 0x00, 0xFF, 0xC4, 0x30, 0x7F, 0xF5, 0xB5, 0xFC, 0xFD, 0x15, 0xFF, 0x00, 0x0F, 0xFF, 0xBA, 0x0F, 0x51, 0xCF, 0xA9, 0x03, 0x00, 0x15, 0xFF, 0x00, 0x00, 0xFF, 0xC4, 0x30, 0x7F, 0xF5, 0xB5, 0xFC, 0xFD, 0x15, 0xFF, 0x00, 0x0F, 0xFF, 0xBA, 0x0F, 0x51, 0xCF, 0xA9, 0x03, 0x00, 0x15, 0xFF, 0x00, 0x00, 0xFF, 0xC4, 0x30, 0x7F, 0xF5, 0xB5, 0x03, 0x03, 0x15, 0xF0, 0x3F, 0x00, 0x7E, 0x64, 0x1B, 0xBA, 0x58, 0x0B, 0xF6, 0xFD, 0x15, 0xC0, 0xFF, 0x0F, 0x39, 0x2B, 0x00, 0xC3, 0x7F, 0x3F, 0x07, 0x03, 0x15, 0xFC, 0x0F, 0x00, 0xA2, 0x81, 0x26, 0xAF, 0x3F, 0xEE, 0x0A, 0x04, 0x15, 0xFC, 0x03, 0x00, 0xCC, 0xA1, 0x30, 0xA0, 0x21, 0xD1 }; const unsigned char RF_MODEM_CHFLT_RX2_CHFLT_COE7_7_0_12_433[11][12]= { 0xB8, 0xDE, 0x05, 0x17, 0x16, 0x0C, 0x03, 0x00, 0x15, 0xFF, 0x00, 0x00, 0xB8, 0xDE, 0x05, 0x17, 0x16, 0x0C, 0x03, 0x00, 0x15, 0xFF, 0x00, 0x00, 0xB9, 0xC9, 0xEA, 0x05, 0x12, 0x11, 0x0A, 0x04, 0x15, 0xFC, 0x03, 0x00, 0xB8, 0xDE, 0x05, 0x17, 0x16, 0x0C, 0x03, 0x00, 0x15, 0xFF, 0x00, 0x00, 0xB9, 0xC9, 0xEA, 0x05, 0x12, 0x11, 0x0A, 0x04, 0x15, 0xFC, 0x03, 0x00, 0xDD, 0xCE, 0xD6, 0xE6, 0xF6, 0x00, 0x03, 0x03, 0x15, 0xF0, 0x3F, 0x00, 0xF4, 0xDB, 0xD6, 0xDF, 0xEC, 0xF7, 0xFE, 0x01, 0x15, 0xF0, 0xFF, 0x03, 0xF4, 0xDB, 0xD6, 0xDF, 0xEC, 0xF7, 0xFE, 0x01, 0x15, 0xF0, 0xFF, 0x03, 0x0C, 0xEC, 0xDC, 0xDC, 0xE3, 0xED, 0xF6, 0xFD, 0x15, 0xC0, 0xFF, 0x0F, 0xC8, 0xC7, 0xDB, 0xF2, 0x02, 0x08, 0x07, 0x03, 0x15, 0xFC, 0x0F, 0x00, 0xB9, 0xC9, 0xEA, 0x05, 0x12, 0x11, 0x0A, 0x04, 0x15, 0xFC, 0x03, 0x00 }; const unsigned char RF_MODEM_CHFLT_RX2_CHFLT_COE7_7_0_12_850[11][12]= { 0xB8, 0xDE, 0x05, 0x17, 0x16, 0x0C, 0x03, 0x00, 0x15, 0xFF, 0x00, 0x00, 0xB8, 0xDE, 0x05, 0x17, 0x16, 0x0C, 0x03, 0x00, 0x15, 0xFF, 0x00, 0x00, 0xC9, 0xFC, 0x1B, 0x1E, 0x0F, 0x01, 0xFC, 0xFD, 0x15, 0xFF, 0x00, 0x0F, 0xB8, 0xDE, 0x05, 0x17, 0x16, 0x0C, 0x03, 0x00, 0x15, 0xFF, 0x00, 0x00, 0xC9, 0xFC, 0x1B, 0x1E, 0x0F, 0x01, 0xFC, 0xFD, 0x15, 0xFF, 0x00, 0x0F, 0xB8, 0xDE, 0x05, 0x17, 0x16, 0x0C, 0x03, 0x00, 0x15, 0xFF, 0x00, 0x00, 0xDD, 0xCE, 0xD6, 0xE6, 0xF6, 0x00, 0x03, 0x03, 0x15, 0xF0, 0x3F, 0x00, 0x03, 0x03, 0x15, 0xF0, 0x3F, 0x00, 0x7E, 0x64, 0x1B, 0xBA, 0x58, 0x0B, 0x0C, 0xEC, 0xDC, 0xDC, 0xE3, 0xED, 0xF6, 0xFD, 0x15, 0xC0, 0xFF, 0x0F, 0xC8, 0xC7, 0xDB, 0xF2, 0x02, 0x08, 0x07, 0x03, 0x15, 0xFC, 0x0F, 0x00, 0xB9, 0xC9, 0xEA, 0x05, 0x12, 0x11, 0x0A, 0x04, 0x15, 0xFC, 0x03, 0x00 }; const unsigned char RF_SYNTH_PFDCP_CPFF_7[11][7]= { 0x2C, 0x0E, 0x0B, 0x04, 0x0C, 0x73, 0x03, 0x2C, 0x0E, 0x0B, 0x04, 0x0C, 0x73, 0x03, 0x2C, 0x0E, 0x0B, 0x04, 0x0C, 0x73, 0x03, 0x2C, 0x0E, 0x0B, 0x04, 0x0C, 0x73, 0x03, 0x2C, 0x0E, 0x0B, 0x04, 0x0C, 0x73, 0x03, 0x2C, 0x0E, 0x0B, 0x04, 0x0C, 0x73, 0x03, 0x34, 0x04, 0x0B, 0x04, 0x07, 0x70, 0x03, 0x34, 0x04, 0x0B, 0x04, 0x07, 0x70, 0x03, 0x01, 0x05, 0x0B, 0x05, 0x02, 0x00, 0x03, 0x01, 0x05, 0x0B, 0x05, 0x02, 0x00, 0x03, 0x2C, 0x0E, 0x0B, 0x04, 0x0C, 0x73, 0x03 }; const unsigned char RF_POWER_UP_data[] = { 0x02, 0x01, 0x00, 0x01, 0xC9, 0xC3, 0x80 }; const unsigned char RF_FRR_CTL_A_MODE_4_data[] = { 0x11, 0x02, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00 }; const unsigned char RF_MODEM_AGC_CONTROL_1_data[] = { 0x11, 0x20, 0x01, 0x35, 0xE2 }; unsigned char RF_MODEM_MOD_TYPE_12_data[16]={0x11, 0x20, 0x0C, 0x00}; unsigned char RF_MODEM_TX_RAMP_DELAY_8_data[12]={0x11, 0x20, 0x08, 0x18}; unsigned char RF_MODEM_BCR_OSR_1_9_data[13]={0x11, 0x20, 0x09, 0x22}; unsigned char RF_MODEM_AFC_GEAR_7_data[13]={0x11, 0x20, 0x07, 0x2C}; unsigned char RF_MODEM_AGC_WINDOW_SIZE_9_data[13]={0x11, 0x20, 0x09, 0x38}; unsigned char RF_MODEM_OOK_CNT1_11_data[15]={0x11, 0x20, 0x0B, 0x42}; unsigned char RF_MODEM_CHFLT_RX1_CHFLT_COE13_7_0_12_data[16]={0x11, 0x21, 0x0C, 0x00}; unsigned char RF_MODEM_CHFLT_RX1_CHFLT_COE1_7_0_12_data[16]={0x11, 0x21, 0x0C, 0x0C}; unsigned char RF_MODEM_CHFLT_RX2_CHFLT_COE7_7_0_12_data[16]={0x11, 0x21, 0x0C, 0x18}; unsigned char RF_SYNTH_PFDCP_CPFF_7_data[11]={0x11, 0x23, 0x07, 0x00}; const unsigned char tx_test_aa_data[14] = {0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa,0xaa}; const unsigned char tx_ph_data[14] = {'s','w','w','x',0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x6d}; const unsigned char Tab_DispCode[17]={0x77,0x24,0x6b,0x6d,0x3c,0x5d,0x5f,0x64,0x7f,0x7d,0x7e,0x1f,0x53,0x2f,0x5b,0x5a,0x00}; typedef struct { unsigned char reach_1s : 1; unsigned char is_tx : 1; unsigned char rf_reach_timeout : 1; unsigned char flash : 1; unsigned char key_valid : 1; }FlagType; FlagType Flag; U16 count_1hz, rf_timeout; U8 spi_read_buf[20]; U8 rx_buf[25]; unsigned char key_value; unsigned char have_set; unsigned char set; unsigned char old_mode; unsigned char mode; unsigned char freq3; unsigned char freq2; unsigned char freq1; unsigned char power; unsigned char rssi; unsigned char rate; unsigned char cnt_10s; unsigned long tx_cnt = 0,rx_cnt = 0; unsigned char reset_mode; unsigned char reach_15hz = 0,reach_flash = 0,reach_1s = 0; unsigned char count_15hz,count_flash = 0,count_1s = 0,nirq_cnt = 0; void sdn_reset(void); void SI4463_init(void); void rf_init_freq(void); void vRf4463SPIWriteBuffer( uint16_t usWriteLength, uint8_t * pcWriteBuffer ); void vRf4463SPIReadBuffer( uint16_t usReadLength, uint8_t * pcReadBuffer ); uint8_t ucRf4463SPIByte( uint8_t pcWriteData ); uint8_t ucRf4463CheckCTS(); unsigned long hex2int(char *a, unsigned int len); void vRf4463SPIWriteBuffer( uint16_t usWriteLength, uint8_t * pcWriteBuffer ); uint8_t ucRf4463GetProperty( uint16_t usStartProperty, uint8_t ucLength, uint8_t * pcParametersBuffer ); uint8_t ucRf4463SetCommand( uint8_t ucLength, uint8_t ucCommand, uint8_t * pcParametersBuffer ); uint8_t ucRf4463GetCommand( uint8_t ucLength, uint8_t ucCommand, uint8_t * pcParametersBuffer ); unsigned char SPIReadByte(unsigned long WrPara); void SPIWriteByte(unsigned int WrPara); void vBufferSetToZero( uint8_t * pcBufferToClean, uint16_t uslength ); void GPIO_SET(unsigned char mydata); void main() { SPI2_Init_Advanced( _SPI_FPCLK_DIV8, _SPI_MASTER | _SPI_8_BIT | _SPI_CLK_IDLE_LOW | _SPI_FIRST_CLK_EDGE_TRANSITION | _SPI_MSB_FIRST | _SPI_SS_DISABLE | _SPI_SSM_ENABLE | _SPI_SSI_1, &_GPIO_MODULE_SPI2_PB13_14_15 ); UART1_Init_Advanced( 115200, _UART_8_BIT_DATA, _UART_NOPARITY, _UART_ONE_STOPBIT, &_GPIO_MODULE_USART1_PA9_10 ); #line 552 "C:/Users/Crow/Desktop/Lab-01/RF4463PRO.c" GPIO_Digital_Output( &GPIOB_BASE, _GPIO_PINMASK_12 ); GPIO_Digital_Input( &GPIOC_BASE, _GPIO_PINMASK_12 ); GPIO_Digital_Output( &GPIOB_BASE, _GPIO_PINMASK_11 ); GPIO_Digital_Input( &GPIOC_BASE, _GPIO_PINMASK_11 ); GPIO_Digital_Output( &GPIOC_BASE, _GPIO_PINMASK_10 ); GPIO_Digital_Output( &GPIOB_BASE, _GPIO_PINMASK_7 ); GPIO_Digital_Input( &GPIOB_BASE, _GPIO_PINMASK_8 ); GPIO_Digital_Output( &GPIOC_BASE, _GPIO_PINMASK_6 ); GPIO_Digital_Output( &GPIOC_BASE, _GPIO_PINMASK_7 ); GPIO_Digital_Output( &GPIOC_BASE, _GPIO_PINMASK_8 ); #line 569 "C:/Users/Crow/Desktop/Lab-01/RF4463PRO.c" mode = 0 ; Sound_Init(&GPIOB_ODR, 7); GPIOC_ODR._GPIO_PIN_7 = 1; Sound_Play(3000, 100); Delay_ms(100); Sound_Play(4000, 100); GPIOC_ODR._GPIO_PIN_7 =0; sdn_reset(); SI4463_init(); } void sdn_reset(void) { #line 620 "C:/Users/Crow/Desktop/Lab-01/RF4463PRO.c" uint8_t pcBuffer[ 7 ] = { 0x02, 0x01, 0x00, 0x01, 0xC9, 0xC3, 0x80 }; uint8_t *charBuffer; #line 634 "C:/Users/Crow/Desktop/Lab-01/RF4463PRO.c" GPIOB_ODR._GPIO_PIN_11 = 0x01; Delay_us( 16 ); GPIOB_ODR._GPIO_PIN_11 = 0x00 ; Delay_ms( 6 ); GPIOB_ODR._GPIO_PIN_12 = 0x00 ; vRf4463SPIWriteBuffer( sizeof( pcBuffer ), pcBuffer ); GPIOB_ODR._GPIO_PIN_12 = 0x01 ; } void SI4463_init(void) { U8 app_command_buf[20]; U8 i; for(i=4;i<16;i++) RF_MODEM_MOD_TYPE_12_data[i] = RF_MODEM_MOD_TYPE_12[rate][i-4]; if(freq3<8) { for(i=4;i<12;i++) RF_MODEM_TX_RAMP_DELAY_8_data[i] = RF_MODEM_TX_RAMP_DELAY_8_433[rate][i-4]; for(i=4;i<11;i++) RF_MODEM_AFC_GEAR_7_data[i] = RF_MODEM_AFC_GEAR_7_433[rate][i-4]; for(i=4;i<15;i++) RF_MODEM_OOK_CNT1_11_data[i] =RF_MODEM_OOK_CNT1_11_433[rate][i-4]; for(i=4;i<16;i++) RF_MODEM_CHFLT_RX1_CHFLT_COE13_7_0_12_data[i] =RF_MODEM_CHFLT_RX1_CHFLT_COE13_7_0_12_433[rate][i-4]; for(i=4;i<16;i++) RF_MODEM_CHFLT_RX1_CHFLT_COE1_7_0_12_data[i] = RF_MODEM_CHFLT_RX1_CHFLT_COE1_7_0_12_433[rate][i-4]; for(i=4;i<16;i++) RF_MODEM_CHFLT_RX2_CHFLT_COE7_7_0_12_data[i] = RF_MODEM_CHFLT_RX2_CHFLT_COE7_7_0_12_433[rate][i-4]; for(i=4;i<13;i++) RF_MODEM_AGC_WINDOW_SIZE_9_data[i] = RF_MODEM_AGC_WINDOW_SIZE_9_433[rate][i-4]; for(i=4;i<13;i++) RF_MODEM_BCR_OSR_1_9_data[i] = RF_MODEM_BCR_OSR_1_9_433[rate][i-4]; } else { for(i=4;i<12;i++) RF_MODEM_TX_RAMP_DELAY_8_data[i] = RF_MODEM_TX_RAMP_DELAY_8_850[rate][i-4]; for(i=4;i<11;i++) RF_MODEM_AFC_GEAR_7_data[i] = RF_MODEM_AFC_GEAR_7_850[rate][i-4]; for(i=4;i<15;i++) RF_MODEM_OOK_CNT1_11_data[i] =RF_MODEM_OOK_CNT1_11_850[rate][i-4]; for(i=4;i<16;i++) RF_MODEM_CHFLT_RX1_CHFLT_COE13_7_0_12_data[i] =RF_MODEM_CHFLT_RX1_CHFLT_COE13_7_0_12_850[rate][i-4]; for(i=4;i<16;i++) RF_MODEM_CHFLT_RX1_CHFLT_COE1_7_0_12_data[i] = RF_MODEM_CHFLT_RX1_CHFLT_COE1_7_0_12_850[rate][i-4]; for(i=4;i<16;i++) RF_MODEM_CHFLT_RX2_CHFLT_COE7_7_0_12_data[i] = RF_MODEM_CHFLT_RX2_CHFLT_COE7_7_0_12_850[rate][i-4]; for(i=4;i<13;i++) RF_MODEM_AGC_WINDOW_SIZE_9_data[i] = RF_MODEM_AGC_WINDOW_SIZE_9_850[rate][i-4]; for(i=4;i<13;i++) RF_MODEM_BCR_OSR_1_9_data[i] = RF_MODEM_BCR_OSR_1_9_850[rate][i-4]; } for(i=4;i<11;i++) RF_SYNTH_PFDCP_CPFF_7_data[i] = RF_SYNTH_PFDCP_CPFF_7[rate][i-4]; GPIO_SET(mode); app_command_buf[0] = 0x11; app_command_buf[1] = 0x00; app_command_buf[2] = 0x01; app_command_buf[3] = 0x00; app_command_buf[4] = 98; vRf4463SPIWriteBuffer(5, app_command_buf); vBufferSetToZero( app_command_buf, 20 ); UART1_Write_Text("Paret Info : "); ucRf4463GetCommand( 8, 0x01, app_command_buf ); UART1_Write_Text("\n\r"); app_command_buf[0] = 0x11; app_command_buf[1] = 0x00; app_command_buf[2] = 0x01; app_command_buf[3] = 0x03; app_command_buf[4] = 0x40; vRf4463SPIWriteBuffer(5, app_command_buf); vBufferSetToZero( app_command_buf, 20 ); vRf4463SPIWriteBuffer(0x08, RF_FRR_CTL_A_MODE_4_data); app_command_buf[0] = 0x11; app_command_buf[1] = 0x10; app_command_buf[2] = 0x09; app_command_buf[3] = 0x00; if(mode == 2 ) { app_command_buf[4] = 0xff; } else { app_command_buf[4] = 0x08; } app_command_buf[5] = 0x14; app_command_buf[6] = 0x00; app_command_buf[7] = 0x0f; app_command_buf[8] = 0x31; app_command_buf[9] = 0x0; app_command_buf[10] = 0x00; app_command_buf[11] = 0x00; app_command_buf[12] = 0x00; vRf4463SPIWriteBuffer(13, app_command_buf); vBufferSetToZero( app_command_buf, 20 ); app_command_buf[0] = 0x11; app_command_buf[1] = 0x11; app_command_buf[2] = 0x05; app_command_buf[3] = 0x00; app_command_buf[4] = 0x01; if(mode == 2 ) { app_command_buf[5] = 0x55; app_command_buf[6] = 0x55; } else { app_command_buf[5] = 0x2d; app_command_buf[6] = 0xd4; } app_command_buf[7] = 0x00; app_command_buf[8] = 0x00; vRf4463SPIWriteBuffer(9, app_command_buf); vBufferSetToZero( app_command_buf, 20 ); app_command_buf[0] = 0x11; app_command_buf[1] = 0x12; app_command_buf[2] = 0x01; app_command_buf[3] = 0x00; app_command_buf[4] = 0x81; vRf4463SPIWriteBuffer(5, app_command_buf); vBufferSetToZero( app_command_buf, 20 ); app_command_buf[0] = 0x11; app_command_buf[1] = 0x12; app_command_buf[2] = 0x01; app_command_buf[3] = 0x06; app_command_buf[4] = 0x02; vRf4463SPIWriteBuffer(5, app_command_buf); vBufferSetToZero( app_command_buf, 20 ); app_command_buf[0] = 0x11; app_command_buf[1] = 0x12; app_command_buf[2] = 0x03; app_command_buf[3] = 0x08; app_command_buf[4] = 0x00; app_command_buf[5] = 0x00; app_command_buf[6] = 0x00; vRf4463SPIWriteBuffer(7, app_command_buf); vBufferSetToZero( app_command_buf, 20 ); app_command_buf[0] = 0x11; app_command_buf[1] = 0x12; app_command_buf[2] = 0x0c; app_command_buf[3] = 0x0d; app_command_buf[4] = 0x00; app_command_buf[5] = 14 ; app_command_buf[6] = 0x04; app_command_buf[7] = 0xaa; app_command_buf[8] = 0x00; app_command_buf[9] = 0x00; app_command_buf[10] = 0x00; app_command_buf[11] = 0x00; app_command_buf[12] = 0x00; app_command_buf[13] = 0x00; app_command_buf[14] = 0x00; app_command_buf[15] = 0x00; vRf4463SPIWriteBuffer(16, app_command_buf); vBufferSetToZero( app_command_buf, 20 ); app_command_buf[0] = 0x11; app_command_buf[1] = 0x12; app_command_buf[2] = 0x08; app_command_buf[3] = 0x19; app_command_buf[4] = 0x00; app_command_buf[5] = 0x00; app_command_buf[6] = 0x00; app_command_buf[7] = 0x00; app_command_buf[8] = 0x00; app_command_buf[9] = 0x00; app_command_buf[10] = 0x00; app_command_buf[11] = 0x00; vRf4463SPIWriteBuffer(12, app_command_buf); vBufferSetToZero( app_command_buf, 20 ); vRf4463SPIWriteBuffer(0x10, RF_MODEM_MOD_TYPE_12_data); app_command_buf[0] = 0x11; app_command_buf[1] = 0x20; app_command_buf[2] = 0x01; app_command_buf[3] = 0x0c; if(freq3<8) { if(rate>= 8 ) app_command_buf[4] = 0x4f; else if(rate>= 4 ) app_command_buf[4] = 0x5e; else app_command_buf[4] = 0xd2; } else { if(rate>= 7 ) app_command_buf[4] = 0x69; else if(rate>= 4 ) app_command_buf[4] = 0x5e; else app_command_buf[4] = 0x18; } vRf4463SPIWriteBuffer(5, app_command_buf); vBufferSetToZero( app_command_buf, 20 ); vRf4463SPIWriteBuffer(0x0C, RF_MODEM_TX_RAMP_DELAY_8_data); vRf4463SPIWriteBuffer(0x0D, RF_MODEM_BCR_OSR_1_9_data); vRf4463SPIWriteBuffer(0x0B, RF_MODEM_AFC_GEAR_7_data); vRf4463SPIWriteBuffer(0x05, RF_MODEM_AGC_CONTROL_1_data); vRf4463SPIWriteBuffer(0x0D, RF_MODEM_AGC_WINDOW_SIZE_9_data); vRf4463SPIWriteBuffer(0x0F, RF_MODEM_OOK_CNT1_11_data); app_command_buf[0] = 0x11; app_command_buf[1] = 0x20; app_command_buf[2] = 0x01; app_command_buf[3] = 0x4e; if(rate== 10 ) app_command_buf[4] = 0x3a; else app_command_buf[4] = 0x40; vRf4463SPIWriteBuffer(5, app_command_buf); vBufferSetToZero( app_command_buf, 20 ); vRf4463SPIWriteBuffer(0x10, RF_MODEM_CHFLT_RX1_CHFLT_COE13_7_0_12_data); vRf4463SPIWriteBuffer(0x10, RF_MODEM_CHFLT_RX1_CHFLT_COE1_7_0_12_data); vRf4463SPIWriteBuffer(0x10, RF_MODEM_CHFLT_RX2_CHFLT_COE7_7_0_12_data); app_command_buf[0] = 0x11; app_command_buf[1] = 0x22; app_command_buf[2] = 0x04; app_command_buf[3] = 0x00; app_command_buf[4] = 0x08; if(power==7) app_command_buf[5] = 127; else if(power==6) app_command_buf[5] = 50; else if(power==5) app_command_buf[5] = 30; else if(power==4) app_command_buf[5] = 20; else if(power==3) app_command_buf[5] = 15; else if(power==2) app_command_buf[5] = 10; else if(power==1) app_command_buf[5] = 7; else app_command_buf[5] = 4; app_command_buf[6] =0x00; if((rate<= 7 )||(rate== 10 )) app_command_buf[7] = 0x3d; else app_command_buf[7] = 0x5d; vRf4463SPIWriteBuffer(8, app_command_buf); vBufferSetToZero( app_command_buf, 20 ); vRf4463SPIWriteBuffer(0x0B, RF_SYNTH_PFDCP_CPFF_7_data); app_command_buf[0] = 0x11; app_command_buf[1] = 0x30; app_command_buf[2] = 0x0c; app_command_buf[3] = 0x00; app_command_buf[4] = 's'; app_command_buf[5] = 0xff; app_command_buf[6] = 0x40; app_command_buf[7] = 'w'; app_command_buf[8] = 0xff; app_command_buf[9] = 0x01; app_command_buf[10] = 'w'; app_command_buf[11] = 0xff; app_command_buf[12] = 0x02; app_command_buf[13] = 'x'; app_command_buf[14] = 0xff; app_command_buf[15] = 0x03; vRf4463SPIWriteBuffer(16, app_command_buf); vBufferSetToZero( app_command_buf, 20 ); rf_init_freq(); } void rf_init_freq(void) { unsigned char OUTDIV,DIV,VCO,INTE,BAND; unsigned char FD_2,FD_1,FD_0,FRAC_2,FRAC_1,FRAC_0; unsigned long FRAC,mydata,frequency; U8 app_command_buf[20]; frequency = (freq3 * 100) + (freq2 * 10) + freq1; frequency = (frequency * 10000) + 5000; if(frequency>=7600000) { OUTDIV = 4; BAND = 0; VCO = 0xff; } else if(frequency>=5460000) { OUTDIV = 6; BAND = 1; VCO = 0xfe; } else if(frequency>=3850000) { OUTDIV = 8; BAND = 2; VCO = 0xfe; } else if(frequency>=2730000) { OUTDIV = 12; BAND = 3; VCO = 0xfd; } else if(frequency>=1940000) { OUTDIV = 16; BAND = 4; VCO = 0xfc; } else { OUTDIV = 24; BAND = 5; VCO = 0xfa; } DIV = OUTDIV/2; mydata = (frequency*DIV)/3; INTE = (mydata/100000)-1; FRAC = (mydata-(INTE+1)*100000)*16384/3125; FRAC = FRAC+0x80000; FRAC_0 = FRAC; FRAC>>=8; FRAC_1 = FRAC; FRAC>>=8; FRAC_2 = FRAC; app_command_buf[0] = 0x11; app_command_buf[1] = 0x20; app_command_buf[2] = 0x01; app_command_buf[3] = 0x51; app_command_buf[4] = 0x08|BAND; vRf4463SPIWriteBuffer(5, app_command_buf); vBufferSetToZero( app_command_buf, 20 ); app_command_buf[0] = 0x11; app_command_buf[1] = 0x40; app_command_buf[2] = 0x08; app_command_buf[3] = 0x00; app_command_buf[4] = INTE; app_command_buf[5] = FRAC_2; app_command_buf[6] = FRAC_1; app_command_buf[7] = FRAC_0; app_command_buf[8] = 0x88 ; app_command_buf[9] = 0x89 ; app_command_buf[10] = 0x20; app_command_buf[11] = VCO; vRf4463SPIWriteBuffer(12, app_command_buf); vBufferSetToZero( app_command_buf, 20 ); } void vRf4463SPIWriteBuffer( uint16_t usWriteLength, uint8_t * pcWriteBuffer ){ #line 1053 "C:/Users/Crow/Desktop/Lab-01/RF4463PRO.c" while( usWriteLength-- ){ SPIWriteByte( *pcWriteBuffer++ ); } } #line 1064 "C:/Users/Crow/Desktop/Lab-01/RF4463PRO.c" void vRf4463SPIReadBuffer( uint16_t usReadLength, uint8_t * pcReadBuffer ){ uint8_t ucRxCounter = 0; uint8_t display = 0; while( usReadLength-- ){ pcReadBuffer[ ucRxCounter++ ] = SPIReadByte( 0 ); } } #line 1078 "C:/Users/Crow/Desktop/Lab-01/RF4463PRO.c" unsigned char SPIReadByte(unsigned long WrPara) { unsigned int wAddr, wData; unsigned char temp; wAddr = WrPara >> 8 & 0xff; wData = WrPara & 0xff; GPIOB_ODR._GPIO_PIN_12 = 0; SPI2_Write(wAddr); temp = SPI2_Read(0); GPIOB_ODR._GPIO_PIN_12 = 1; return temp; } #line 1097 "C:/Users/Crow/Desktop/Lab-01/RF4463PRO.c" void SPIWriteByte(unsigned int WrPara) { unsigned int wAddr, wData; WrPara |= 0x8000; wAddr = WrPara >> 8 & 0xff; wData = WrPara & 0xff; GPIOB_ODR._GPIO_PIN_12 = 0; SPI2_Write(wAddr); SPI2_Write(wData); GPIOB_ODR._GPIO_PIN_12 = 1; } #line 1122 "C:/Users/Crow/Desktop/Lab-01/RF4463PRO.c" uint8_t ucRf4463CheckCTS(){ uint16_t usTimeoutCounter = 0; usTimeoutCounter = 2500 ; while( usTimeoutCounter-- ){ GPIOB_ODR._GPIO_PIN_12 = 0x00; SPIWriteByte( 0x44 ); if( SPIReadByte( 0x44 ) == 0xff ) { GPIOB_ODR._GPIO_PIN_12 = 0x01; return 1; } GPIOB_ODR._GPIO_PIN_12 =0x01; } UART1_Write_Text( "[ RF4463 ] CTS failed\r\n" ); return 0; } unsigned long hex2int(char *a, unsigned int len) { int i; unsigned long val = 0; for(i=0;i<len;i++) if(a[i] <= 57) val += (a[i]-48)*(1<<(4*(len-1-i))); else val += (a[i]-55)*(1<<(4*(len-1-i))); return val; } uint8_t ucRf4463GetProperty( uint16_t usStartProperty, uint8_t ucLength, uint8_t * pcParametersBuffer ){ uint8_t pcBuffer[ 4 ]; if( ucRf4463CheckCTS() == 0 ){ return 0; } pcBuffer[ 0 ] = 0x12 ; pcBuffer[ 1 ] = ( usStartProperty >> 8 ); pcBuffer[ 2 ] = ucLength; pcBuffer[ 3 ] = ( usStartProperty & 0xFF ); GPIOB_ODR._GPIO_PIN_12 = 0; vRf4463SPIWriteBuffer( 4, pcBuffer ); if( ucRf4463CheckCTS() == 0 ){ return 0; } GPIOB_ODR._GPIO_PIN_12 = 0; SPIReadByte( 0x44 ); vRf4463SPIReadBuffer( ucLength, pcParametersBuffer ); GPIOB_ODR._GPIO_PIN_12 = 1; return 1; } uint8_t ucRf4463GetCommand( uint8_t ucLength, uint8_t ucCommand, uint8_t * pcParametersBuffer ){ if( ucRf4463CheckCTS() == 0 ){ return 0; } GPIOB_ODR._GPIO_PIN_12 = 0; SPIWriteByte( ucCommand ); GPIOB_ODR._GPIO_PIN_12 = 1; if( ucRf4463CheckCTS() == 0 ){ return 0; } GPIOB_ODR._GPIO_PIN_12 = 0; SPIWriteByte( 0x44 ); vRf4463SPIReadBuffer( ucLength, pcParametersBuffer ); GPIOB_ODR._GPIO_PIN_12 = 1; UART1_Write_Text(pcParametersBuffer); return 1; } uint8_t ucRf4463SetCommand( uint8_t ucLength, uint8_t ucCommand, uint8_t * pcParametersBuffer ){ if( ucRf4463CheckCTS() == 0 ){ return 1; } GPIOB_ODR._GPIO_PIN_12 = 0; SPIWriteByte( ucCommand ); vRf4463SPIWriteBuffer( ucLength, pcParametersBuffer ); GPIOB_ODR._GPIO_PIN_12 = 1; return 1; } void vBufferSetToZero( uint8_t * pcBufferToClean, uint16_t uslength ){ uint16_t usPosition = 0; for( usPosition = 0; usPosition < uslength; usPosition++ ){ pcBufferToClean[ usPosition ] = 0x00; } } void GPIO_SET(unsigned char mydata) { U8 app_command_buf[7]; app_command_buf[0] = 0x13; switch(mydata) { case 0 : case 1 : app_command_buf[1] = 3; app_command_buf[2] = 2; break; case 2 : app_command_buf[1] = 3; app_command_buf[2] = 3; break; case 3 : app_command_buf[1] = 2; app_command_buf[2] = 20; break; case 4 : app_command_buf[1] = 2; app_command_buf[2] = 2; break; } app_command_buf[3] = 0x21; app_command_buf[4] = 0x20; app_command_buf[5] = 0x27; app_command_buf[6] = 0x0b; vRf4463SPIWriteBuffer(7, app_command_buf); }
aee20d5847b8d389ceffd8e652f370b71506e7e7
d06219268be4aecbaf44fc3b5c41ed40f7862bc4
/training/accepted/C++/P268A.cpp
131632f40e9301b240d94fb8a80bfe2cb367c288
[]
no_license
arceus6666/coding-practice
1c66d25c446af283e9cfca560d21a9425d12b607
a9b1ba91ff7f5effeccfed926c454af02621a4e7
refs/heads/master
2021-01-26T11:23:12.543489
2020-06-15T15:56:01
2020-06-15T15:56:01
243,420,440
0
0
null
null
null
null
UTF-8
C++
false
false
476
cpp
P268A.cpp
// Games - CodeForces // Status: Accepted #include <iostream> using namespace std; int main() { int n; cin >> n; int home[n] = {}; int guest[n] = {}; for (int i = 0; i < n; i++) { cin >> home[i]; cin >> guest[i]; } int r = 0; for (int i = 0; i < n - 1; i++) { for (int j = i + 1; j < n; j++) { if (home[i] == guest[j]) { r++; } if (guest[i] == home[j]) { r++; } } } cout << r; }
b528c918ad8975a5f5eab11a9d9454f42817f666
ba403400f7b87f88d347fdb32ce5ec024abbe914
/external/vulkancts/framework/vulkan/vkVirtualInstanceInterface.inl
964d76b6e6c80fe93a0e0c9cc312ff512a9aa271
[ "Apache-2.0" ]
permissive
tobine/Vulkan-CTS
1e40c9ded95c2d355eced46b8ee228736b2eba3d
1106b0194f7571aebfdf76766760d91be772d8e7
refs/heads/vulkan-cts-1.0
2021-10-03T21:33:41.647552
2016-08-11T12:34:37
2016-08-11T18:32:18
66,392,145
0
0
null
2016-08-23T18:21:28
2016-08-23T18:21:27
null
UTF-8
C++
false
false
2,639
inl
vkVirtualInstanceInterface.inl
/* WARNING: This is auto-generated file. Do not modify, since changes will * be lost! Modify the generating script instead. */ virtual void destroyInstance (VkInstance instance, const VkAllocationCallbacks* pAllocator) const = 0; virtual VkResult enumeratePhysicalDevices (VkInstance instance, deUint32* pPhysicalDeviceCount, VkPhysicalDevice* pPhysicalDevices) const = 0; virtual void getPhysicalDeviceFeatures (VkPhysicalDevice physicalDevice, VkPhysicalDeviceFeatures* pFeatures) const = 0; virtual void getPhysicalDeviceFormatProperties (VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties* pFormatProperties) const = 0; virtual VkResult getPhysicalDeviceImageFormatProperties (VkPhysicalDevice physicalDevice, VkFormat format, VkImageType type, VkImageTiling tiling, VkImageUsageFlags usage, VkImageCreateFlags flags, VkImageFormatProperties* pImageFormatProperties) const = 0; virtual void getPhysicalDeviceProperties (VkPhysicalDevice physicalDevice, VkPhysicalDeviceProperties* pProperties) const = 0; virtual void getPhysicalDeviceQueueFamilyProperties (VkPhysicalDevice physicalDevice, deUint32* pQueueFamilyPropertyCount, VkQueueFamilyProperties* pQueueFamilyProperties) const = 0; virtual void getPhysicalDeviceMemoryProperties (VkPhysicalDevice physicalDevice, VkPhysicalDeviceMemoryProperties* pMemoryProperties) const = 0; virtual PFN_vkVoidFunction getDeviceProcAddr (VkDevice device, const char* pName) const = 0; virtual VkResult createDevice (VkPhysicalDevice physicalDevice, const VkDeviceCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDevice* pDevice) const = 0; virtual VkResult enumerateDeviceExtensionProperties (VkPhysicalDevice physicalDevice, const char* pLayerName, deUint32* pPropertyCount, VkExtensionProperties* pProperties) const = 0; virtual VkResult enumerateDeviceLayerProperties (VkPhysicalDevice physicalDevice, deUint32* pPropertyCount, VkLayerProperties* pProperties) const = 0; virtual VkResult createDebugReportCallbackEXT (VkInstance instance, const VkDebugReportCallbackCreateInfoEXT* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkDebugReportCallbackEXT* pCallback) const = 0; virtual void destroyDebugReportCallbackEXT (VkInstance instance, VkDebugReportCallbackEXT callback, const VkAllocationCallbacks* pAllocator) const = 0; virtual void debugReportMessageEXT (VkInstance instance, VkDebugReportFlagsEXT flags, VkDebugReportObjectTypeEXT objectType, deUint64 object, deUintptr location, deInt32 messageCode, const char* pLayerPrefix, const char* pMessage) const = 0;
1e359e1549f19c8d2b0f0020cd89e8016c2807b0
f74af91c1cb9e25d061bae1ce6713d0b6abd058a
/MGE_mainbuild/src/mge/collision/WallCollider.hpp
fa05d0ff07462bd375b962712397f44ff11d695f
[]
no_license
alextalvan/ProjectThirdPerson
39b0a9134b4cd8b1f275ae7b14d165a9fb691bfe
98f8cda131079e0b3cf69d20407408719465ccf3
refs/heads/master
2016-08-12T06:20:14.344975
2016-03-19T00:40:17
2016-03-19T00:40:17
51,291,655
0
0
null
null
null
null
UTF-8
C++
false
false
391
hpp
WallCollider.hpp
#ifndef WALLCOLLIDER_H #define WALLCOLLIDER_H #include "mge/collision/BoxCollider.hpp" class WallCollider : public BoxCollider { public: WallCollider(); bool ignoreXaxis = false; bool ignoreYaxis = false; bool ignoreZaxis = false; protected: virtual ~WallCollider(); private: void CollisionCallback(Collider* other, CollisionMTV& mtv); }; #endif // WALLCOLLIDER_H
623ef3abcc6f676fdf14579f45349cc06e82068f
6608ebc7aba0b4575cca02bd90002933a46b0f37
/HitPoint.h
0501117019e8ec77f93b0980d0a85eb47ebafbd0
[ "Apache-2.0" ]
permissive
cefoot/magicPresenter
4019031636f6db328af6c2762a25a60550e3cd1b
aa6adbe9d77c466e56282a8f33c4321e37d8aa80
refs/heads/master
2021-01-17T18:51:52.891798
2016-07-20T04:16:45
2016-07-20T04:16:45
61,011,731
0
1
null
2016-07-20T04:16:45
2016-06-13T06:16:02
C++
UTF-8
C++
false
false
1,034
h
HitPoint.h
/* Copyright 2016 Chris Papenfuß Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #define KINECT2_GRABBER #define NOMINMAX #include <Windows.h> #include <pcl/io/boost.h> #include <pcl/io/grabber.h> #include <pcl/point_cloud.h> #include <pcl/point_types.h> namespace cefoot { class HitPoint { public: virtual bool isObsolete(time_t curTime); Eigen::Vector3f point; time_t creationTime; protected: }; bool cefoot::HitPoint::isObsolete(time_t curTime) { return curTime - creationTime > 2; } }
5908b8e2c71d77c5f494452562d5da07f0746317
1572de76809bb23247b17e63ba923eeb68bbc19d
/src/plugins/java/java_plugin.cc
97723ec3da949a284ff82218cfaaa259dbd52e40
[]
no_license
paride/seiscomp-2.1-phenix
9edfcd9ce37dca6acbb8855f5414997f80d32497
501da5fcaf71d8db7c297c7a15902e63ef1b951b
refs/heads/master
2021-07-06T07:24:29.972365
2017-10-01T18:18:11
2017-10-01T18:18:11
104,362,155
0
1
null
null
null
null
UTF-8
C++
false
false
4,101
cc
java_plugin.cc
/***************************************************************************** * java_plugin.cc * * Java->SeedLink interface for bud_plugin * * (c) 2004 Andres Heinloo, GFZ Potsdam * * 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, or (at your option) any later * version. For more information, see http://www.gnu.org/ *****************************************************************************/ #include <cstdio> #include "qtime.h" #include "qdefines.h" #include "qutils.h" #include "sdr_utils.h" #include "ms_unpack.h" #include "plugin.h" #include <gcj/cni.h> namespace { using namespace std; const int MAX_SAMPLES = (4096 - 64) * 2; const int WRITE_ERROR = -1; const int SEED_ERROR = -2; //***************************************************************************** // do_send_packet() // Sends a Mini-SEED record to SeedLink. // // If recsize == 512, the record goes to SeedLink untouched, otherwise // it is decoded and sent as raw data // // Return values: // recsize: success // 0: non-data record ignored // WRITE_ERROR (-1): error sending data to SeedLink (fatal) // SEED_ERROR (-2): error decoding Mini-SEED //***************************************************************************** int do_send_packet(void *pseed, int recsize) { DATA_HDR *hdr; if((hdr = decode_hdr_sdr((SDR_HDR *)pseed, recsize)) == NULL) return SEED_ERROR; trim(hdr->station_id); trim(hdr->channel_id); trim(hdr->location_id); trim(hdr->network_id); // Station ID // Make sure you have "station NET.STA" in seedlink.ini! char station[PLUGIN_SIDLEN + 1]; snprintf(station, PLUGIN_SIDLEN + 1, "%s.%s", hdr->network_id, hdr->station_id); if(recsize == 512) { free_data_hdr(hdr); if(send_mseed(station, pseed, 512) <= 0) return WRITE_ERROR; return recsize; } BLOCKETTE_HDR *bh; BS *bs; int timing_quality = -1; bool data_record = false; for(bs = hdr->pblockettes; bs != (BS *)NULL; bs = bs->next) { if(bs->wordorder != my_wordorder && swab_blockette(bs->type, bs->pb, bs->len) == 0) bs->wordorder = my_wordorder; bh = (BLOCKETTE_HDR *) bs->pb; if(bh->type == 1000 && ((BLOCKETTE_1000 *)bh)->format != 0) data_record = true; if(bh->type == 1001) timing_quality = ((BLOCKETTE_1001 *)bh)->clock_quality; } if(!data_record) { free_data_hdr(hdr); return 0; } int nsamples; int32_t data[MAX_SAMPLES]; nsamples = ms_unpack(hdr, MAX_SAMPLES, (char *)pseed, data); if(nsamples < 0) { free_data_hdr(hdr); return SEED_ERROR; } EXT_TIME et = int_to_ext(hdr->hdrtime); struct ptime pt; pt.year = et.year; pt.yday = et.doy; pt.hour = et.hour; pt.minute = et.minute; pt.second = et.second; pt.usec = et.usec; // Channel ID // Make sure you have "station NET.STA proc = ..." in seedlink.ini // and respective proc element in streams.xml! char channel[PLUGIN_CIDLEN + 1]; snprintf(channel, PLUGIN_CIDLEN + 1, "%s.%s", hdr->location_id, hdr->channel_id); if(send_raw3(station, channel, &pt, hdr->num_ticks_correction, timing_quality, data, nsamples) <= 0) { free_data_hdr(hdr); return WRITE_ERROR; } free_data_hdr(hdr); return recsize; } } // end unnamed namespace //***************************************************************************** // Java interface //***************************************************************************** namespace edu { namespace iris { namespace dmc { namespace LISService { namespace BudNetSocket { jint send_packet(jbyteArray data) { return do_send_packet((void *)elements(data), data->length); } } } } } } // end namespace edu::iris::dmc::LISService::BudNetSocket
d24e16e1b307a55a1633b8d9d795663ae8661306
8cf3e5d08f822173cf43299da0ef2e03d32f71e1
/interview_cake/cpp/product_of_other_numbers.cpp
d53ed39b69d2dff7cfc6d08858e429f51cea33bb
[]
no_license
aistein/playground
c98941d628ff21eea14d5e66b3190235d3d240d3
69681d0b795e232d63886e412d50186fc97fc43b
refs/heads/master
2021-03-30T23:24:21.136258
2019-07-26T19:10:21
2019-07-26T19:10:21
124,792,708
0
0
null
null
null
null
UTF-8
C++
false
false
2,809
cpp
product_of_other_numbers.cpp
#include <iostream> #include <vector> // C++11 lest unit testing framework #include "lest.hpp" using namespace std; vector<int> getProductsOfAllIntsExceptAtIndex(const vector<int>& intVector) { vector<int> M(intVector); vector<int> O(intVector); int n = intVector.size(); int pivot = 1; // corner cases if (n <= 1){ throw std::length_error("input is too small."); } if (n == 2){ O[0] = intVector[1]; O[1] = intVector[0]; return O; } if (n == 3){ O[0] = intVector[1]*intVector[2]; O[1] = intVector[0]*intVector[2]; O[2] = intVector[0]*intVector[1]; return O; } // first iteration fills M backwards for (int i = n - 2; i >= pivot; i--){ M[i] = intVector[i] * M[i+1]; } O[0] = M[pivot]; // now dynamically fill the output and update M // left of pivot - product from A[0] upto A[pivot-1] // right of pivot - product from A[n-1] downto A[pivot+1] for (int i = pivot; i < n-1; i++){ M[pivot] = M[pivot-1] * intVector[i]; O[i] = M[pivot-1] * M[pivot+1]; pivot++; } O[n-1] = M[pivot-1]; return O; } // tests const lest::test tests[] = { CASE("small vector") { const auto actual = getProductsOfAllIntsExceptAtIndex({1, 2, 3}); const auto expected = vector<int> {6, 3, 2}; EXPECT(actual == expected); }, CASE("longer vector") { const auto actual = getProductsOfAllIntsExceptAtIndex({8, 2, 4, 3, 1, 5}); const auto expected = vector<int> {120, 480, 240, 320, 960, 192}; EXPECT(actual == expected); }, CASE("vector has one zero") { const auto actual = getProductsOfAllIntsExceptAtIndex({6, 2, 0, 3}); const auto expected = vector<int> {0, 0, 36, 0}; EXPECT(actual == expected); }, CASE("vector has two zeros") { const auto actual = getProductsOfAllIntsExceptAtIndex({4, 0, 9, 1, 0}); const auto expected = vector<int> {0, 0, 0, 0, 0}; EXPECT(actual == expected); }, CASE("one negative number") { const auto actual = getProductsOfAllIntsExceptAtIndex({-3, 8, 4}); const auto expected = vector<int> {32, -12, -24}; EXPECT(actual == expected); }, CASE("all negative numbers") { const auto actual = getProductsOfAllIntsExceptAtIndex({-7, -1, -4, -2}); const auto expected = vector<int> {-8, -56, -14, -28}; EXPECT(actual == expected); }, CASE("error with empty vector") { EXPECT_THROWS(getProductsOfAllIntsExceptAtIndex({})); }, CASE("error with one number") { EXPECT_THROWS(getProductsOfAllIntsExceptAtIndex({1})); }, }; int main(int argc, char** argv) { return lest::run(tests, argc, argv); }
4c81037ed910c04e0764847f9a5c8c0ed0ca6576
6025de2bca878ee44b090d9b3f2b5a0041409ee3
/Shooter/Shooter/Graphic.h
4fdf848cb72483108aefe807f6a31d7bb0fcd5db
[]
no_license
Christopher-Vouis/Shooter-Game
4b08b9763707aaa0c1be142e64502bdc0c83345e
7d3d38899d87535ff43bb41b4468fa288c48e309
refs/heads/main
2023-07-14T00:34:07.816597
2021-08-18T17:24:13
2021-08-18T17:24:13
382,861,476
0
0
null
null
null
null
UTF-8
C++
false
false
2,336
h
Graphic.h
#pragma once #include<SDL.h> #include <iostream> #include <SDL_image.h> class Graphic { protected: SDL_Rect _rect; SDL_Surface _surface; SDL_Point _origin; int _rotation, _width, _height; SDL_RendererFlip _flipMode; public: virtual SDL_Surface Surface() { return _surface; } virtual SDL_Rect Rect() { return _rect; } virtual SDL_Point Origin() { return _origin; } virtual int Rotation() { return _rotation; } virtual SDL_Point Pos() {return { _rect.x, _rect.y }; } virtual SDL_RendererFlip FlipMode() { return _flipMode; } virtual void Move(int xDist, int yDist) { _rect.x += xDist; _rect.y += yDist; } virtual void Rotate(int degrees) { _rotation = degrees; } virtual void SetPosition(int x, int y) { _rect.x = x; _rect.y = y; } virtual void SetSurface(SDL_Surface surf) { _surface = surf; } void FlipHorizontal() { if (_flipMode & SDL_FLIP_HORIZONTAL) { _flipMode = static_cast<SDL_RendererFlip>(~SDL_FLIP_HORIZONTAL & _flipMode); } else { _flipMode = static_cast<SDL_RendererFlip>(SDL_FLIP_HORIZONTAL | _flipMode); } } void SetFlipH(bool isFlip) { if (isFlip) { _flipMode = static_cast<SDL_RendererFlip>(SDL_FLIP_HORIZONTAL | _flipMode); } else { _flipMode = static_cast<SDL_RendererFlip>(~SDL_FLIP_HORIZONTAL & _flipMode); } } void FlipVertical() { if (_flipMode & SDL_FLIP_VERTICAL) { _flipMode = static_cast<SDL_RendererFlip>(~SDL_FLIP_VERTICAL & _flipMode); } else { _flipMode = static_cast<SDL_RendererFlip>(SDL_FLIP_VERTICAL | _flipMode); } } void SetFlipV(bool isFlip) { if (isFlip) { _flipMode = static_cast<SDL_RendererFlip>(SDL_FLIP_VERTICAL | _flipMode); } else { _flipMode = static_cast<SDL_RendererFlip>(~SDL_FLIP_VERTICAL & _flipMode); } } void SetFlicker(bool shouldFlicker) { if (shouldFlicker) { _rect.w = 0; _rect.h = 0; } else { _rect.w = _width; _rect.h = _height; } } Graphic() { } Graphic(SDL_Surface surf, int xCoord, int yCoord, int width, int height, int degrees = 0, SDL_Point origin = { 0, 0 }, SDL_RendererFlip flipMode = SDL_FLIP_NONE) { _rect = SDL_Rect{xCoord, yCoord, width, height}; _width = width; _height = height; _surface = surf; _rotation = degrees; _origin = origin; _flipMode = flipMode; } ~Graphic() { } };
070f7cba76c06bb290ab1263f3ad3fe25c72582d
a37c0ccadb02af2877c4be9bad863d7ba8a1a390
/client/Game2/HoverScript/HudPeer.cpp
dc60e70b3fd43f5263e5f10e2b576bfd48339a94
[]
no_license
johnsie/HoverNet
9dec639cdb6471f98ffc357d5f9d1b089eba1336
05ac3afbd8edfc6301eff352f1ae467c7e930f43
refs/heads/master
2022-02-23T15:37:50.754976
2020-03-03T16:13:31
2020-03-03T16:13:31
145,713,174
1
0
null
null
null
null
UTF-8
C++
false
false
5,728
cpp
HudPeer.cpp
// HudPeer.cpp // // Copyright (c) 2013-2016 Michael Imamura. // // Licensed under GrokkSoft HoverRace SourceCode License v1.0(the "License"); // you may not use this file except in compliance with the License. // // A copy of the license should have been attached to the package from which // you have taken this file. If you can not find the license you can not use // this file. // // // The author makes no representations about the suitability of // this software for any purpose. It is provided "as is" "AS IS", // 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 "../../../engine/Script/Core.h" #include "../../../engine/Display/Chronometer.h" #include "../../../engine/Display/Counter.h" #include "../../../engine/Display/FuelGauge.h" #include "../../../engine/Display/Hud.h" #include "../../../engine/Display/HudDecor.h" #include "../../../engine/Display/HudText.h" #include "../../../engine/Display/Minimap.h" #include "../../../engine/Display/Speedometer.h" #include "HudPeer.h" using namespace HoverRace::Util; typedef HoverRace::Display::Hud::HudAlignment HudAlignment; namespace HoverRace { namespace Client { namespace HoverScript { HudPeer::HudPeer(Script::Core &scripting, Display::Display &display, std::weak_ptr<Display::Hud> hud) : SUPER(scripting, "Hud"), display(display), hud(std::move(hud)) { } /** * Register this peer in an environment. * @param scripting The target environment. */ void HudPeer::Register(Script::Core &scripting) { using namespace luabind; lua_State *L = scripting.GetState(); // Register base classes. module(L) [ class_<HudPeer, SUPER, std::shared_ptr<HudPeer>>("Hud") .enum_("HudAlignment") [ value("ABOVE", HudAlignment::ABOVE), value("BELOW", HudAlignment::BELOW), value("N", HudAlignment::N), value("NNE", HudAlignment::NNE), value("NE", HudAlignment::NE), value("ENE", HudAlignment::ENE), value("E", HudAlignment::E), value("ESE", HudAlignment::ESE), value("SE", HudAlignment::SE), value("SSE", HudAlignment::SSE), value("S", HudAlignment::S), value("SSW", HudAlignment::SSW), value("SW", HudAlignment::SW), value("WSW", HudAlignment::WSW), value("W", HudAlignment::W), value("WNW", HudAlignment::WNW), value("NW", HudAlignment::NW), value("NNW", HudAlignment::NNW) ] .def("add_chronometer", &HudPeer::LAddChronometer) .def("add_counter", &HudPeer::LAddCounter_V) .def("add_counter", &HudPeer::LAddCounter_VT) .def("add_fuel_gauge", &HudPeer::LAddDecor<Display::FuelGauge>) .def("add_minimap", &HudPeer::LAddDecor<Display::Minimap>) .def("add_speedometer", &HudPeer::LAddDecor<Display::Speedometer>) .def("add_text", &HudPeer::LAddText) .def("clear", &HudPeer::LClear) .def("use_race_default", &HudPeer::LUseRaceDefault), class_<Display::HudDecor, std::shared_ptr<Display::HudDecor>>("HudDecor") ]; // Register HUD elements. module(L, "hud") [ class_<Display::Chronometer, Display::HudDecor, std::shared_ptr<Display::HudDecor>>("Chronometer"), class_<Display::Counter, Display::HudDecor, std::shared_ptr<Display::HudDecor>>("Counter") .property("value", &Display::Counter::GetValue, &Display::Counter::SetValue) .property("total", &Display::Counter::GetTotal, &Display::Counter::SetTotal), class_<Display::FuelGauge, Display::HudDecor, std::shared_ptr<Display::HudDecor>>("FuelGauge"), class_<Display::HudText, Display::HudDecor, std::shared_ptr<Display::HudDecor>>("Text") .property("text", &Display::HudText::GetText, &Display::HudText::SetText), class_<Display::Minimap, Display::HudDecor, std::shared_ptr<Display::HudDecor>>("Minimap"), class_<Display::Speedometer, Display::HudDecor, std::shared_ptr<Display::HudDecor>>("Speedometer") ]; } std::shared_ptr<Display::Chronometer> HudPeer::LAddChronometer(int align, const std::string &title, std::shared_ptr<Util::Clock> clock) { HudAlignment::type ha = ValidateAlignment(align); if (auto sp = hud.lock()) { return sp->At(ha).NewChild<Display::Chronometer>(display, title, clock); } else { return std::shared_ptr<Display::Chronometer>(); } } std::shared_ptr<Display::Counter> HudPeer::LAddCounter_V(int align, const std::string &title, double initValue) { HudAlignment::type ha = ValidateAlignment(align); if (auto sp = hud.lock()) { return sp->At(ha).NewChild<Display::Counter>( display, title, initValue); } else { return std::shared_ptr<Display::Counter>(); } } std::shared_ptr<Display::Counter> HudPeer::LAddCounter_VT(int align, const std::string &title, double initValue, double total) { HudAlignment::type ha = ValidateAlignment(align); if (auto sp = hud.lock()) { return sp->At(ha).NewChild<Display::Counter>( display, title, initValue, total); } else { return std::shared_ptr<Display::Counter>(); } } std::shared_ptr<Display::HudText> HudPeer::LAddText(int align, const std::string &text) { HudAlignment::type ha = ValidateAlignment(align); if (auto sp = hud.lock()) { return sp->At(ha).NewChild<Display::HudText>(display, text); } else { return std::shared_ptr<Display::HudText>(); } } void HudPeer::LClear() { if (auto sp = hud.lock()) { sp->Clear(); } } void HudPeer::LUseRaceDefault() { if (auto sp = hud.lock()) { using namespace Display; using HudAlignment = Hud::HudAlignment; sp->Clear(); sp->At(HudAlignment::NE).NewChild<FuelGauge>(display); sp->At(HudAlignment::NW).NewChild<Speedometer>(display); sp->At(HudAlignment::WNW).NewChild<Minimap>(display); } } } // namespace HoverScript } // namespace Client } // namespace HoverRace
1adca88a55210c779b57ce13fe883e40d7e61ff9
845c0bc4e42ecf99f1afdd077c05c79a72ebad1e
/lib/robovision/Stopwatch.cpp
5f7c20fe157466504be9844f8a0577833b79c6ef
[]
no_license
RioWong/Segment-based-classification
77ed99fc8137bbcd5e04440c4a94d7bf9b015ff3
886327e32175fc96e76b6210c3f5a9c27f7f6183
refs/heads/master
2021-05-30T20:11:08.759006
2016-02-21T20:52:42
2016-02-21T20:52:42
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,078
cpp
Stopwatch.cpp
// This file is part of the robovision library, (c) Jens Behley, 2015. // // The code is provided for educational purposes in the lecture // "Knowledge-based Image Understanding", summer term 2015, // and shall not be redistributed or used in commercial products. #include "rv/Stopwatch.h" #include <cassert> #include <stdexcept> #include <sys/time.h> namespace rv { std::vector<struct timeval> Stopwatch::stimes = std::vector<struct timeval>(); void Stopwatch::tic() { struct timeval tv; gettimeofday(&tv, 0); stimes.push_back(tv); } /** \brief stops the last timer started and outputs \a msg, if given. * * \return elapsed time in seconds. **/ double Stopwatch::toc() { assert(stimes.begin() != stimes.end()); if (stimes.begin() == stimes.end()) throw std::logic_error("No Stopwatch to stop."); struct timeval end; gettimeofday(&end, 0); struct timeval start = stimes.back(); stimes.pop_back(); return (end.tv_sec - start.tv_sec + 1e-6 * (end.tv_usec - start.tv_usec)); } uint32_t Stopwatch::numRunning() { return stimes.size(); } }
3e99945d1c394ef5744cb7937b9f8f024d2ef18e
a666ac40ad2c33d130d9d6b06925a5948b25cc6a
/Qt_Cpp/Cpp10/RectangleDialog/rectangledialog.h
b9be14d81a73ad7096a2aecbbab3bcbb78fc7659
[]
no_license
hotenglish/StudyInAction
e8a46ef963be6a9c506cc4606c96a7433a974c7d
941d7a254dbbd22976d8110ff5cf0d18166c0462
refs/heads/master
2022-12-22T16:04:32.592927
2020-06-23T23:30:40
2020-06-23T23:30:40
137,567,024
0
0
null
2022-12-16T07:16:06
2018-06-16T08:51:49
HTML
UTF-8
C++
false
false
614
h
rectangledialog.h
#ifndef RECTANGLEDIALOG #define RECTANGLEDIALOG #include <QDialog> #include "ui_rectangledialog.h" class RectangleDialog : public QDialog,public Ui::RectangleDialog { Q_OBJECT public: RectangleDialog(QWidget *parent = 0); signals: void rectangleLengthWidth(const QString &lengthString,const QString widthString); private slots: void on_lengthEdit_textChanged(const QString &); void on_widthEdit_textChanged(const QString &); void calculateClicked(); void rectangleAreaCalculate(const QString &lengthStr,const QString &widthStr); private: bool isContentFinished(); }; #endif
3c240c65954aa9b936f8d18053ede3acb5c580a9
ce6c1c4b81dd00816569369a9151650506c9da11
/app/src/main/cpp/native-lib.cpp
01f17567f37c7ee4a30f355dc19ce8fd0352a35c
[]
no_license
Hero2000/RTMP_Pusher
49697dc162390b1627386553e63f0564213f49fd
efcc7d8e13c30865cd0d2aeb545e1afe5b90e505
refs/heads/master
2022-11-06T04:11:47.639576
2020-06-25T05:21:06
2020-06-25T05:21:06
null
0
0
null
null
null
null
UTF-8
C++
false
false
11,680
cpp
native-lib.cpp
#include <jni.h> #include <android/log.h> #include <string> #include "librtmp/rtmp.h" #include "SafeQueue.h" #include "VedioChannel.h" #include "AudioChannel.h" /** * RTMPPacket 结构体是打包好的 RTMP 数据包 * 将该数据包发送到 RTMP 服务器中 */ SafeQueue<RTMPPacket *> packets; /** * 视频处理对象 */ VedioChannel* mVedioChannel; /** * 音频处理对象 */ AudioChannel* mAudioChannel; /** * 是否已经开始推流, 推流的重要标志位 * 只要该标志位是 TRUE * 就一直不停的推流 * 如果该标志位变成 FALSE * 停止推流 */ int isStartRtmpPush = FALSE; /** * 开始推流工作线程的线程 ID */ pthread_t startRtmpPushPid; /** * 当前是否准备完毕, 进行推流 */ int readyForPush = FALSE; /** * 开始推流的时间 */ uint32_t pushStartTime; /** * 线程安全队列 SafeQueue<RTMPPacket *> packets 释放元素的方法 * 函数的类型是 typedef void (*ReleaseHandle)(T &); * 返回值 void * 传入参数 T 元素类型的引用, 元素类型是 RTMPPacket * 的 * @param rtmpPacket */ void releaseRTMPPackets(RTMPPacket * & rtmpPacket){ if(rtmpPacket){ delete rtmpPacket; rtmpPacket = 0; } } /** * 函数指针实现, 当 RTMPPacket 数据包封装完毕后调用该回调函数 * 将该封装好的 RTMPPacket 数据包放入线程安全队列中 * typedef void (*RTMPPacketPackUpCallBack)(RTMPPacket* packet); */ void RTMPPacketPackUpCallBack(RTMPPacket* rtmpPacket){ if (rtmpPacket) { rtmpPacket->m_nTimeStamp = RTMP_GetTime() - pushStartTime; packets.push(rtmpPacket); } } extern "C" JNIEXPORT void JNICALL Java_kim_hsl_rtmp_LivePusher_native_1init(JNIEnv *env, jobject thiz) { // 0. 将 x264 编码的过程, RTMPDump 的编码过程, 封装到单独的工具类中 // 使用该工具类, 对数据进行编码 mVedioChannel = new VedioChannel; // 2. 设置 封装 RTMPPacket 包完成回调函数 // 通过该回调函数, 将封装好的 RTMP 包放入 SafeQueue<RTMPPacket *> packets 队列中 mVedioChannel->setRTMPPacketPackUpCallBack(RTMPPacketPackUpCallBack); // 初始化音频处理器 mAudioChannel = new AudioChannel; // 2. 设置 封装 RTMPPacket 包完成回调函数 // 通过该回调函数, 将封装好的 RTMP 包放入 SafeQueue<RTMPPacket *> packets 队列中 mAudioChannel->setRTMPPacketPackUpCallBack(RTMPPacketPackUpCallBack); // 3. 数据队列, 用于存储打包好的数据 // 在单独的线程中将该队列中的数据发送给服务器 packets.setReleaseHandle(releaseRTMPPackets); } /** * 设置视频编码参数 */ extern "C" JNIEXPORT void JNICALL Java_kim_hsl_rtmp_LivePusher_native_1setVideoEncoderParameters(JNIEnv *env, jobject thiz, jint width, jint height, jint fps, jint bitrate) { mVedioChannel->setVideoEncoderParameters(width, height, fps, bitrate); } /** * 开始推流任务线程 * 主要是调用 RTMPDump 进行推流 * @param args * @return */ void* startRtmpPush (void* args){ // 0. 获取 Rtmp 推流地址 char* pushPath = static_cast<char *>(args); // rtmp 推流器 RTMP* rtmp = 0; // rtmp 推流数据包 RTMPPacket *packet = 0; /* 将推流核心执行内容放在 do while 循环中 在出错后, 随时 break 退出循环, 执行后面的释放资源的代码 可以保证, 在最后将资源释放掉, 避免内存泄漏 避免执行失败, 直接 return, 导致资源没有释放 */ do { // 1. 创建 RTMP 对象, 申请内存 rtmp = RTMP_Alloc(); if (!rtmp) { __android_log_print(ANDROID_LOG_INFO, "RTMP", "申请 RTMP 内存失败"); break; } // 2. 初始化 RTMP RTMP_Init(rtmp); // 设置超时时间 5 秒 rtmp->Link.timeout = 5; // 3. 设置 RTMP 推流服务器地址 int ret = RTMP_SetupURL(rtmp, pushPath); if (!ret) { __android_log_print(ANDROID_LOG_INFO, "RTMP", "设置 RTMP 推流服务器地址 %s 失败", pushPath); break; } // 4. 启用 RTMP 写出功能 RTMP_EnableWrite(rtmp); // 5. 连接 RTMP 服务器 ret = RTMP_Connect(rtmp, 0); if (!ret) { __android_log_print(ANDROID_LOG_INFO, "RTMP", "连接 RTMP 服务器 %s 失败", pushPath); break; } // 6. 连接 RTMP 流 ret = RTMP_ConnectStream(rtmp, 0); if (!ret) { __android_log_print(ANDROID_LOG_INFO, "RTMP", "连接 RTMP 流 %s 失败", pushPath); break; } // 准备推流相关的数据, 如线程安全队列 readyForPush = TRUE; // 记录推流开始时间 pushStartTime = RTMP_GetTime(); // 线程安全队列开始工作 packets.setWork(1); // 将 AAC 音频解码信息先放到 RTMP 数据包线程安全队列中 if(mAudioChannel) { RTMPPacketPackUpCallBack(mAudioChannel->getAudioDecodeInfo()); } __android_log_print(ANDROID_LOG_INFO, "RTMP", "开始直播, 推流地址 %s", pushPath); while (isStartRtmpPush) { // 从线程安全队列中 // 取出一包已经打包好的 RTMP 数据包 __android_log_print(ANDROID_LOG_INFO, "RTMP", "从 packets 取出数据 开始 %d", packets.size()); packets.pop(packet); __android_log_print(ANDROID_LOG_INFO, "RTMP", "从 packets 取出数据 结束 %d", packets.size()); // 确保当前处于推流状态 if (!isStartRtmpPush) { break; } // 确保不会取出空的 RTMP 数据包 if (!packet) { continue; } // 设置直播的流 ID packet->m_nInfoField2 = rtmp->m_stream_id; // 7. 将 RTMP 数据包发送到服务器中 ret = RTMP_SendPacket(rtmp, packet, 1); // RTMP 数据包使用完毕后, 释放该数据包 if (packet) { RTMPPacket_Free(packet); delete packet; packet = 0; } if (!ret) { __android_log_print(ANDROID_LOG_INFO, "RTMP", "RTMP 数据包推流失败"); break; } } }while (0); // 面的部分是收尾部分, 释放资源 // 8. 推流结束, 关闭与 RTMP 服务器连接, 释放资源 if(rtmp){ RTMP_Close(rtmp); RTMP_Free(rtmp); } // 推流数据包 线程安全队列释放 // 防止中途退出导致没有释放资源, 造成内存泄漏 if (packet) { RTMPPacket_Free(packet); delete packet; packet = 0; } // 释放推流地址 if(pushPath){ delete pushPath; pushPath = 0; } return 0; } /** * 开始向远程 RTMP 服务器推送数据 */ extern "C" JNIEXPORT void JNICALL Java_kim_hsl_rtmp_LivePusher_native_1startRtmpPush(JNIEnv *env, jobject thiz, jstring path) { if(isStartRtmpPush){ // 防止该方法多次调用, 如果之前调用过, 那么屏蔽本次调用 return; } // 执行过一次后, 马上标记已执行状态, 下一次就不再执行该方法了 isStartRtmpPush = TRUE; // 获取 Rtmp 推流地址 // 该 pushPathFromJava 引用是局部引用, 超过作用域就无效了 // 局部引用不能跨方法 , 跨线程调用 const char* pushPathFromJava = env->GetStringUTFChars(path, 0); // 获取地址的长度, 加上 '\0' 长度 char * pushPathNative = new char[strlen(pushPathFromJava) + 1]; // 拷贝 pushPathFromJava 到堆内存 pushPathNative 中 // 局部引用不能跨方法 , 跨线程调用, 这里需要在线程中使用该地址 // 因此需要将该局部引用拷贝到堆内存中, 然后传递到对应线程中 strcpy(pushPathNative, pushPathFromJava); // 创建线程 pthread_create(&startRtmpPushPid, 0, startRtmpPush, pushPathNative); // 释放从 Java 层获取的字符串 // 释放局部引用 env->ReleaseStringUTFChars(path, pushPathFromJava); } extern "C" JNIEXPORT void JNICALL Java_kim_hsl_rtmp_LivePusher_native_1encodeCameraData(JNIEnv *env, jobject thiz, jbyteArray data) { if(!mVedioChannel || !readyForPush){ // 如果 vedioChannel 还没有进行初始化, 推流没有准备好了, 直接 return __android_log_print(ANDROID_LOG_INFO, "RTMP", "还没有准备完毕, 稍后再尝试调用该方法 %d, %d", mVedioChannel, readyForPush); return; } // 将 Java 层的 byte 数组类型 jbyteArray 转为 jbyte* 指针类型 // 注意这是局部引用变量, 不能跨线程, 跨方法调用, 需要将其存放在堆内存中 jbyte* dataFromJava = env->GetByteArrayElements(data, NULL); // jbyte 是 int8_t 类型的, 因此这里我们将 encodeCameraData 的参数设置成 int8_t* 类型 // typedef int8_t jbyte; /* signed 8 bits */ mVedioChannel->encodeCameraData(dataFromJava); // 释放局部引用变量 env->ReleaseByteArrayElements(data, dataFromJava, 0); } extern "C" JNIEXPORT void JNICALL Java_kim_hsl_rtmp_LivePusher_native_1stopPush(JNIEnv *env, jobject thiz) { // TODO: implement native_stopPush() } extern "C" JNIEXPORT void JNICALL Java_kim_hsl_rtmp_LivePusher_native_1release(JNIEnv *env, jobject thiz) { if(mVedioChannel){ delete mVedioChannel; mVedioChannel = 0; } if(mAudioChannel){ delete mAudioChannel; mAudioChannel = 0; } } extern "C" JNIEXPORT void JNICALL Java_kim_hsl_rtmp_LivePusher_native_1setAudioEncoderParameters(JNIEnv *env, jobject thiz, jint sample_rate_in_hz, jint channel_config) { // 设置音频参数 if(mAudioChannel){ mAudioChannel->setAudioEncoderParameters(sample_rate_in_hz, channel_config); } } extern "C" JNIEXPORT jint JNICALL Java_kim_hsl_rtmp_LivePusher_native_1getInputSamples(JNIEnv *env, jobject thiz) { // 获取 FAAC 音频编码器输入个数, 用于指导 Java 层 AudioRecord 每次读取多少字节数据 if(mAudioChannel){ return mAudioChannel->getInputSamples(); } return -1; } extern "C" JNIEXPORT void JNICALL Java_kim_hsl_rtmp_LivePusher_native_1encodeAudioData(JNIEnv *env, jobject thiz, jbyteArray data) { if(!mAudioChannel || !readyForPush){ // 如果 mAudioChannel 还没有进行初始化, 推流没有准备好了, 直接 return __android_log_print(ANDROID_LOG_INFO, "RTMP", "还没有准备完毕, 稍后再尝试调用该方法 %d, %d", mAudioChannel, readyForPush); return; } // 将 Java 层的 byte 数组类型 jbyteArray 转为 jbyte* 指针类型 // 注意这是局部引用变量, 不能跨线程, 跨方法调用, 需要将其存放在堆内存中 jbyte* dataFromJava = env->GetByteArrayElements(data, NULL); // jbyte 是 int8_t 类型的, 因此这里我们将 encodeCameraData 的参数设置成 int8_t* 类型 // typedef int8_t jbyte; /* signed 8 bits */ mAudioChannel->encodeAudioData(dataFromJava); // 释放局部引用变量 env->ReleaseByteArrayElements(data, dataFromJava, 0); }
89d0923675b69c9a533aceb75ff59f69a6ca429c
0be3d1d908a2824688c4658a774ecb7dea8fea57
/MathLibrary/vector2.hpp
f45a76bc68b23f7e0fab7a1b2153b23bac1163c3
[]
no_license
jjj404001/CS230_Final
c4ceaa956ad87f581142705ce64528414d00a058
80c513101ddca141d800ee263a41112d70ec9d41
refs/heads/master
2020-03-19T06:51:26.449818
2018-06-19T06:21:35
2018-06-19T06:21:35
136,060,783
0
0
null
null
null
null
UTF-8
C++
false
false
6,816
hpp
vector2.hpp
/******************************************************************************/ /*! file name : vector2.hpp author : Jaejun Jang email : jjj404001@gmail.com DigiPen login : jaejun.jang Course name : CS230 Assignment number :#1 term :Spring 2018 brief : This file contains the function prototype and struct vector2 for calculating with veector2. Functions include: in vector2 struct : + vector2 operator+(vector2 InputVector) const; //addition with + + vector2& operator+=(vector2 InputVector); //addition with += + vector2 operator-(vector2 InputVector) const; //subtraction with - + vector2& operator-=(vector2 InputVector); //subtraction with -= + vector2 operator-(void); //-(unary prefix) + vector2 operator*(float InputFloat) const; // * for vector to float scaling with vector2 + vector2 operator*(int InputInt) const; // * for vector to int scaling with vector2 + vector2& operator*=(float InputFloat); // *= vector to float scaling with vector2 + vector2& operator*=(int InputInt); // *= vector to int scaling with vector2 + vector2 operator/(float InputFloat) const; // * for vector to float dividing with vector2 + vector2 operator/(int InputInt) const; // * for vector to int dividing with vector2 + vector2& operator/=(float InputFloat); // *= vector to float dividing with vector2 + vector2& operator/=(int InputInt); // *= vector to int dividing with vector2 + float operator*(vector2 InputVector) const; non-member normal function : + vector2 operator*(float InputFloat,vector2 InputVector); // * for float to vector scaling with vector2 + vector2 operator*(int InputInt,vector2 InputVector); // * for int to vector scaling with vector2 + vector2 operator*=(float InputFloat,vector2 InputVector); // *= float to vector scaling with vector2 + vector2 operator*=(int InputInt,vector2 InputVector); // *= int to scaling with vector2 + bool operator==(const vector2 FirstInputVector, const vector2 SecondInputVector); //Determine if two vectors are equal or not. + bool operator!=(const vector2 FirstInputVector, const vector2 SecondInputVector); //Determine if two vectors are NOT equal or not. + float dot(const vector2 FirstInputVector,const vector2 SecondInputVector); //Function for testing dot product + vector2 perpendicular_to(const vector2 InputVector);//Calculate vector which is perpendicular //from given vector. + vector2 normalize(vector2 InputVector); //Normalize given vector + float magnitude_of(const vector2 InputVector); //Calculate magnitude of given vector. + float squared_magnitude_of(const vector2 InputVector); //Calculate squared magnitude of given vector. + float distance_between(vector2 FirstInputVector, vector2 SecondInputVector); //distance between two vectors.!!TREAT VECTORS AS POINT!! + float distance_between_squared(vector2 FirstInputVector, vector2 SecondInputVector); //squared distance between two vectors.!!TREAT VECTORS AS POINT!! + float angle_between(vector2 firstInputVector, vector2 secondInputVector); //Angle between two vectors. */ /******************************************************************************/ #pragma once struct vector2 { //represent x-y vector componenet float x =0; float y =0; //constructor for vector2 initialization vector2() = default; vector2(const float init_x) { x = init_x; y = init_x; } vector2(const float init_x, const float init_y) { x = init_x; y = init_y; } //addition vector2 operator+(vector2 input_vector) const; //addition with + vector2& operator+=(vector2 input_vector); //addition with += //subtraction vector2 operator-(const vector2 input_vector) const; //subtraction with - vector2& operator-=(vector2 input_vector); //subtraction with -= //unary prefix vector2 operator-(void) const; //-(unary prefix) //Scaling vector2 operator*(float input_float) const; // * for vector to float scaling with vector2 vector2 operator*(int input_int) const; // * for vector to int scaling with vector2 vector2& operator*=(float input_float); // *= vector to float scaling with vector2 vector2& operator*=(int input_int); // *= vector to int scaling with vector2 //Dividing vector2 operator/(float input_float) const; // * for vector to float dividing with vector2 vector2 operator/(int input_int) const; // * for vector to int dividing with vector2 vector2& operator/=(float input_float); // *= vector to float dividing with vector2 vector2& operator/=(int input_int); // *= vector to int dividing with vector2 //Dot product. !!not scaling!! float operator*(vector2 input_vector) const; //Comparison operator bool operator==(const vector2 input_vector) const; //Determine if two vectors are equal or not. bool operator!=(const vector2 input_vector) const; //Determine if two vectors are NOT equal or not. }; /////////////////////////////////////////////////////////////////////////////// /////////////////////////non-member normal function./////////////////////////// /////////////////////////////////////////////////////////////////////////////// //using non-member operator overloading for non-vector left operand //Scaling vector2 operator*(const float input_float, const vector2 input_vector); // * for float to vector scaling with vector2 vector2 operator*(const int input_int, const vector2 input_vector); // * for int to vector scaling with vector2 float dot(const vector2 FirstInputVector,const vector2 SecondInputVector); //Function for testing dot product vector2 perpendicular_to(const vector2 input_vector);//Calculate vector which is perpendicular //from given vector. vector2 normalize(vector2 input_vector); //Normalize given vector float magnitude_of(const vector2 input_vector); //Calculate magnitude of given vector. float squared_magnitude_of(const vector2 input_vector); //Calculate squared magnitude of given vector. float distance_between(const vector2 firstinput_vector, const vector2 secondinput_vector); //distance between two vectors.!!TREAT VECTORS AS POINT!! float distance_between_squared(const vector2 firstinput_vector, const vector2 secondinput_vector); //squared distance between two vectors.!!TREAT VECTORS AS POINT!! float angle_between(const vector2 firstinput_vector, const vector2 secondinput_vector); //Angle between two vectors.
54fa7a262a820cf80a0aa8b195473391f83ea416
aa1d126ca93bdc075f5d82690392dd6a631040f9
/source/Ch03/orai_anyag/float.cpp
4a90b7e1472b03072c45bf09f11bb8f517016b39
[ "CC0-1.0" ]
permissive
Vada200/UDProg-Introduction
9f0aca694c3a5adf3bd25c85311dd3c5273b699a
c424b2676d6e5bfc4d53d61c5d0deded566c1c84
refs/heads/master
2023-01-20T20:02:14.829387
2020-11-30T18:35:52
2020-11-30T18:35:52
295,183,551
0
0
CC0-1.0
2020-09-13T15:46:24
2020-09-13T15:46:23
null
UTF-8
C++
false
false
378
cpp
float.cpp
#include "std_lib_facilities.h" int main () { cout << "Please enter a real number: "; double n; // . és nem , cin >> n; cout << "The number is: "<< n << endl; cout << "+1=" << n+1<< endl; cout << "*3=" << n*3<< endl; cout << "*önmaga (^2)=" << n*n<< endl; cout << "/2=" << n/2<< endl; cout << "négyzetgyök: " << sqrt(n)<< endl; return 0; }
d0b5862235d46e15fdcbc67e45db5166afc2131f
7024e065b74745c39d1255a8c2cd6070b4a40a22
/src/transform/rectlin.h
1ca2d0bd08b0ef5c415fcddf71354df6bffb4d2d
[]
no_license
ABadCandy/blitz
3f8db069efbd3d4a23591b7cc981c7d39fbe8d1e
0cad76e3a8d470b48e80edd8ff11d6f0b095cb73
refs/heads/master
2021-01-14T11:20:37.553062
2016-08-13T08:30:31
2016-08-13T08:30:31
null
0
0
null
null
null
null
UTF-8
C++
false
false
676
h
rectlin.h
#ifndef SRC_TRANSFORM_RECTLIN_H_ #define SRC_TRANSFORM_RECTLIN_H_ #include "transform/activation.h" namespace blitz { template<template <typename> class TensorType, typename DType> class Rectlin : public Activation<TensorType, DType> { public: explicit Rectlin(const float slope = 0.0f) : slope_(slope) {} // indicate pure virtual ~Rectlin() {} virtual void Apply(const shared_ptr<TensorType<DType> > input, shared_ptr<TensorType<DType> > output); virtual void Derivative(const shared_ptr<TensorType<DType> > input, shared_ptr<TensorType<DType> > output); private: const float slope_; }; } // namespace blitz #endif // SRC_TRANSFORM_RECTLIN_H_
a47e902ce8908d02e672e1cb39bee1e4110ea0d2
ab237f4987ba78cd403481306785111bb2fb6b95
/EnumDeclarations.cpp
1540b78c528f1a87976b03f2615412dc0a3177a3
[]
no_license
steveiaco/COMP442-CompilerDesign
5a039a55cd67f9a4c2c818e4ab90b5045e190e3a
29fc33bf8d28630a91ef31eaa1bec9f54b434d2c
refs/heads/master
2023-08-21T19:28:35.280870
2021-09-27T21:10:21
2021-09-27T21:10:21
336,203,081
1
0
null
null
null
null
UTF-8
C++
false
false
6,422
cpp
EnumDeclarations.cpp
#include "EnumDeclarations.h" #include <string> using std::string; std::string EnumDeclarations::nonTerminalToString(NonTerminal t) { std::string s; switch (t) { case NonTerminal::ADDOP: s = "ADDOP"; break; case NonTerminal::APARAMSTAIL: s = "APARAMSTAIL"; break; case NonTerminal::ARITHEXPRTAIL: s = "ARITHEXPRTAIL"; break; case NonTerminal::ASSIGNOP: s = "ASSIGNOP"; break; case NonTerminal::CLASSDECLBODY: s = "CLASSDECLBODY"; break; case NonTerminal::EXPRTAIL: s = "EXPRTAIL"; break; case NonTerminal::ARITHEXPR: s = "ARITHEXPR"; break; case NonTerminal::FPARAMSTAIL: s = "FPARAMSTAIL"; break; case NonTerminal::CLASSMETHOD: s = "CLASSMETHOD"; break; case NonTerminal::FPARAMS: s = "FPARAMS"; break; case NonTerminal::FUNCDECLTAIL: s = "FUNCDECLTAIL"; break; case NonTerminal::FUNCORASSIGNSTATIDNESTFUNCTAIL: s = "FUNCORASSIGNSTATIDNESTFUNCTAIL"; break; case NonTerminal::FUNCORASSIGNSTATIDNESTVARTAIL: s = "FUNCORASSIGNSTATIDNESTVARTAIL"; break; case NonTerminal::FUNCORASSIGNSTATIDNEST: s = "FUNCORASSIGNSTATIDNEST"; break; case NonTerminal::ASSIGNSTATTAIL: s = "ASSIGNSTATTAIL"; break; case NonTerminal::FUNCORVAR: s = "FUNCORVAR"; break; case NonTerminal::FUNCORVARIDNESTTAIL: s = "FUNCORVARIDNESTTAIL"; break; case NonTerminal::FUNCORVARIDNEST: s = "FUNCORVARIDNEST"; break; case NonTerminal::APARAMS: s = "APARAMS"; break; case NonTerminal::FUNCSTATTAILIDNEST: s = "FUNCSTATTAILIDNEST"; break; case NonTerminal::FUNCSTATTAIL: s = "FUNCSTATTAIL"; break; case NonTerminal::FUNCTION: s = "FUNCTION"; break; case NonTerminal::FUNCHEAD: s = "FUNCHEAD"; break; case NonTerminal::INHERIT: s = "INHERIT"; break; case NonTerminal::INTNUM: s = "INTNUM"; break; case NonTerminal::MEMBERDECL: s = "MEMBERDECL"; break; case NonTerminal::FUNCDECL: s = "FUNCDECL"; break; case NonTerminal::METHODBODYVAR: s = "METHODBODYVAR"; break; case NonTerminal::NESTEDID: s = "NESTEDID"; break; case NonTerminal::CLASSDECL: s = "CLASSDECL"; break; case NonTerminal::FUNCDEF: s = "FUNCDEF"; break; case NonTerminal::FUNCBODY: s = "FUNCBODY"; break; case NonTerminal::RELOP: s = "RELOP"; break; case NonTerminal::SIGN: s = "SIGN"; break; case NonTerminal::START: s = "START"; break; case NonTerminal::PROG: s = "PROG"; break; case NonTerminal::FUNCORASSIGNSTAT: s = "FUNCORASSIGNSTAT"; break; case NonTerminal::STATBLOCK: s = "STATBLOCK"; break; case NonTerminal::EXPR: s = "EXPR"; break; case NonTerminal::STATEMENT: s = "STATEMENT"; break; case NonTerminal::STATEMENTLIST: s = "STATEMENTLIST"; break; case NonTerminal::TERM: s = "TERM"; break; case NonTerminal::MULTOP: s = "MULTOP"; break; case NonTerminal::FACTOR: s = "FACTOR"; break; case NonTerminal::TERMTAIL: s = "TERMTAIL"; break; case NonTerminal::TYPE: s = "TYPE"; break; case NonTerminal::ARRAYSIZEREPT: s = "ARRAYSIZEREPT"; break; case NonTerminal::VARDECL: s = "VARDECL"; break; case NonTerminal::VARDECLREP: s = "VARDECLREP"; break; case NonTerminal::VARIABLE: s = "VARIABLE"; break; case NonTerminal::INDICEREP: s = "INDICEREP"; break; case NonTerminal::VARIABLEIDNESTTAIL: s = "VARIABLEIDNESTTAIL"; break; case NonTerminal::VARIABLEIDNEST: s = "VARIABLEIDNEST"; break; case NonTerminal::VISIBILITY: s = "VISIBILITY"; break; } return s; } std::string EnumDeclarations::compositeConceptToString(CompositeConcept c) { string cctext; switch (c) { // Not part of the grammar case CompositeConcept::APARAMSLIST: cctext = "APARAMSLIST"; break; case CompositeConcept::ARRAYDIMENSION: cctext = "ARRAYDIMENSION"; break; case CompositeConcept::ARRAYSIZEREPTLIST: cctext = "ARRAYSIZEREPTLIST"; break; case CompositeConcept::ASSIGNSTAT: cctext = "ASSIGNSTAT"; break; case CompositeConcept::CLASSDECLBODYLIST: cctext = "CLASSDECLBODYLIST"; break; case CompositeConcept::CLASSLIST: cctext = "CLASSLIST"; break; case CompositeConcept::FPARAMSLIST: cctext = "FPARAMSLIST"; break; case CompositeConcept::FUNCCALLSTAT: cctext = "FUNCCALLSTAT"; break; case CompositeConcept::FUNCLIST: cctext = "FUNCLIST"; break; case CompositeConcept::FUNCORVARLIST: cctext = "FUNCORVARLIST"; break; case CompositeConcept::INDICEREPLIST: cctext = "INDICELIST"; break; case CompositeConcept::INHERITLIST: cctext = "INHERITLIST"; break; case CompositeConcept::TERNARY: cctext = "TERNARY"; break; case CompositeConcept::VARCALLSTAT: cctext = "VARCALLSTAT"; break; case CompositeConcept::VARDECLLIST: cctext = "VARDECLLIST"; break; // Part of the grammar case CompositeConcept::ARITHEXPR: cctext = "ARITHEXPR"; break; case CompositeConcept::CLASSDECL: cctext = "CLASSDECL"; break; case CompositeConcept::CLASSDECLBODY: cctext = "CLASSDECLBODY"; break; case CompositeConcept::CLASSMETHOD: cctext = "CLASSMETHOD"; break; case CompositeConcept::EXPR: cctext = "EXPR"; break; case CompositeConcept::FPARAMS: cctext = "FPARAM"; break; case CompositeConcept::FUNCBODY: cctext = "FUNCBODY"; break; case CompositeConcept::FUNCDECL: cctext = "FUNCDECL"; break; case CompositeConcept::FUNCDEF: cctext = "FUNCDEF"; break; case CompositeConcept::FUNCHEAD: cctext = "FUNCHEAD"; break; case CompositeConcept::FUNCSTAT: cctext = "FUNCSTAT"; break; case CompositeConcept::FUNCTION: cctext = "FUNCTION"; break; case CompositeConcept::IF: cctext = "IF"; break; case CompositeConcept::INDICEREP: cctext = "INDICEREP"; break; case CompositeConcept::INHERIT: cctext = "INHERIT"; break; case CompositeConcept::PROG: cctext = "PROG"; break; case CompositeConcept::READ: cctext = "READ"; break; case CompositeConcept::RETURN: cctext = "RETURN"; break; case CompositeConcept::START: cctext = "START"; break; case CompositeConcept::STATEMENT: cctext = "STATEMENT"; break; case CompositeConcept::STATEMENTLIST: cctext = "STATEMENTLIST"; break; case CompositeConcept::VARDECL: cctext = "VARDECL"; break; case CompositeConcept::VARIABLE: cctext = "VARIABLE"; break; case CompositeConcept::WHILE: cctext = "WHILE"; break; case CompositeConcept::WRITE: cctext = "WRITE"; break; default: cctext = "MISSING TYPE SPECIFIER"; break; } return cctext; }
24400e49499d5eaf12c11ec678d983b56cf25e17
a5aa16c1c8404e86f4df76f23559f42b01808cf1
/test/UARTsetting.cpp
78a7a55c8fbd94541db9e65ecd34fed384c49907
[]
no_license
Akinzou-Enterprises/AS_Watch
d5382fb9167a987ad16603b40c5cd24a926ac88d
c35ee8588ca80b6b0dee0e74f142e45e3e23928c
refs/heads/master
2023-09-05T20:31:16.175498
2021-11-12T21:26:15
2021-11-12T21:26:15
314,085,582
3
0
null
2021-09-17T19:08:50
2020-11-18T23:40:08
C
UTF-8
C++
false
false
1,230
cpp
UARTsetting.cpp
#include <Arduino.h> #include <Wire.h> #include <SPI.h> #include <Adafruit_GFX.h> #include <Adafruit_ILI9341.h> #include "AS_WatchV1.h" //Include pins file! #include <stdint.h> #include "Icons.c" #include <Adafruit_BME280.h> #include <Arduino-MAX17055_Driver.h> #include <TouchScreen.h> #include <IRremote.h> #include <SdFat.h> #include <cstdio> #include <cmath> #include <MAX31341.h> String Command = ""; MAX31341 rtc; int x = 0; void setup() { Serial.begin(115200); rtc.begin(0b00000001); rtc.RTCsettings(0); rtc.SetSeconds(50); delay(700); rtc.SetMinutes(24); Serial.println(rtc.GetSeconds()); rtc.SetDay(6); } String ReadSerial() { Command = ""; while (Serial.available() > 0) { char read = char(Serial.read()); if (read == ' ') { break; } Command += read; } return Command; } void loop() { ReadSerial(); if (Command == "A") { Serial.print("Connected!"); } if (Command == "A0") { ReadSerial(); rtc.SetSeconds(atoi(Command.c_str())); ReadSerial(); rtc.SetMinutes(atoi(Command.c_str())); rtc.SetRTCData(); } if (Command == "A3") { Serial.println(rtc.GetSeconds()); Serial.println(rtc.GetMinutes()); } }
68d2716f5016b5706dd474a653e67a27c7ecdc32
47dbe359a17f1c4dca2693fb88b4f597c10306bf
/src/q0240.h
98717e99d90dce94a809481916bf355615a13ea0
[ "MIT" ]
permissive
SeanWuLearner/leetcode
e253959b3d24d2ea9bb5e148f591ce99c83721a2
bafa93906fd586b6b6af929de1197d4f7347199d
refs/heads/master
2022-05-08T02:09:21.883279
2022-04-18T06:35:27
2022-04-18T06:35:27
192,561,135
1
0
null
null
null
null
UTF-8
C++
false
false
2,053
h
q0240.h
/* Solution: Search space reduction */ class Solution_spatial_search { public: bool searchMatrix(vector<vector<int>>& matrix, int target) { int m = matrix.size(), n = matrix[0].size(); int i = m-1, j = 0; // printf("m=%d, n=%d, i=%d, j=%d\n", m, n, i, j); while(i>=0 && j<n){ if(matrix[i][j] == target) return true; else if(matrix[i][j] < target) j++; else i--; } return false; } }; /* divide and conquer solution: Divide whole matrix by half each time. Remove rectangular that: 1. its top-left cell is greater than target. 2. its bottom-right cell is less than target. Then, recursive the other two possible rectangulars. */ class Solution { private: struct Rec{ int x1; //top-left int y1; int x2; //bottom-right int y2; }; bool findInRec(vector<vector<int>>& matrix, Rec& rec, int target){ if(rec.y1 > rec.y2) return false; int mid_y = (rec.y1 + rec.y2) / 2; int i; // handle rec1 for(i = rec.x1 ; i <= rec.x2 ; i++){ if(matrix[i][mid_y] == target) return true; if(matrix[i][mid_y] > target) break; } Rec rec1{rec.x1, mid_y+1, i-1, rec.y2}; if(findInRec(matrix, rec1, target) == true) return true; Rec rec2{i, rec.y1, rec.x2, mid_y-1}; return findInRec(matrix, rec2, target); } public: bool searchMatrix(vector<vector<int>>& matrix, int target) { int m = matrix.size(), n = matrix[0].size(); Rec rec{0, 0, m-1, n-1}; return findInRec(matrix, rec, target); } }; TEST(Solution, Test1){ Solution s; vector<vector<int>> q; q = {{1,4,7,11,15},{2,5,8,12,19},{3,6,9,16,22},{10,13,14,17,24},{18,21,23,26,30}}; EXPECT_EQ(s.searchMatrix(q, 5), true); q = {{1,4,7,11,15},{2,5,8,12,19},{3,6,9,16,22},{10,13,14,17,24},{18,21,23,26,30}}; EXPECT_EQ(s.searchMatrix(q, 20), false); }
1ba58f029b894b175f6464adae22d6822b55b9b8
cc07873a60566ea76f513f98af201e276dfad8e6
/XHSI_plugin/datarefs_jar_a320neo.c
6d12cefd8fe86deea75bc5424d89b4bec6ce7745
[]
no_license
annerajb/XHSI
d2e0e14445f66b8cbfbf0be2710f83be83501979
41f3e898cfb652d3ced8ed846595b4b8bc66ef84
refs/heads/master
2020-09-04T00:30:01.210316
2019-09-18T16:20:08
2019-09-18T16:20:08
219,616,977
3
0
null
2019-11-10T21:04:12
2019-11-04T23:35:40
Java
UTF-8
C++
false
false
45,831
c
datarefs_jar_a320neo.c
/* * datarefs_jar_a320neo.c * * Created on: 9 june 2014 * Author: Nicolas Carel */ #include <stdio.h> #include <string.h> #include <stdlib.h> #include <stdint.h> #define XPLM200 1 //#include "XPLMProcessing.h" #include "XPLMDataAccess.h" #include "XPLMUtilities.h" //#include "XPLMNavigation.h" //#include "XPLMDisplay.h" //#include "XPLMMenus.h" //#include "XPWidgets.h" //#include "XPStandardWidgets.h" #include "jar_a320neo_msg.h" #include "datarefs_jar_a320neo.h" #include "ids.h" // DataRefs for JAR Design Airbus A320 Neo XPLMDataRef jar_a320_neo_plugin_status; // FCU XPLMDataRef jar_a320_neo_baro_hpa; XPLMDataRef jar_a320_neo_fcu_hdg_trk; XPLMDataRef jar_a320_neo_fcu_metric_alt; XPLMDataRef jar_a320_neo_vs_dashed; XPLMDataRef jar_a320_neo_hdg_dashed; XPLMDataRef jar_a320_neo_hdg_managed; XPLMDataRef jar_a320_neo_lvlch_dot; XPLMDataRef jar_a320_neo_spd_managed; XPLMDataRef jar_a320_neo_alt_managed; XPLMDataRef jar_a320_neo_fcu_alt100x; // Baro XPLMDataRef jar_a320_neo_baro_flash; // Autopilot and FD XPLMDataRef jar_a320_neo_ap_phase; XPLMDataRef jar_a320_neo_ap1; XPLMDataRef jar_a320_neo_ap2; XPLMDataRef jar_a320_neo_ils; XPLMDataRef jar_a320_neo_fd; // FD Bars XPLMDataRef jar_a320_neo_fd_h_show; // globalPropertyi("sim/custom/xap/pfd/myfd_h_show")) XPLMDataRef jar_a320_neo_fd_pitch; // globalPropertyf("sim/cockpit2/autopilot/flight_director_pitch_deg")) XPLMDataRef jar_a320_neo_fd_v_show; // globalPropertyi("sim/custom/xap/pfd/myfd_v_show")) XPLMDataRef jar_a320_neo_fd_roll; // globalPropertyf("sim/cockpit2/autopilot/flight_director_roll_deg")) XPLMDataRef jar_a320_neo_fd_y_show; // globalPropertyi("sim/custom/xap/pfd/myfd_y_show")) XPLMDataRef jar_a320_neo_fd_yaw_dot; // globalPropertyf("sim/cockpit2/radios/indicators/nav1_hdef_dots_pilot")) // Vertical and horizontal modes XPLMDataRef jar_a320_neo_com_mode; XPLMDataRef jar_a320_neo_vert_mode; XPLMDataRef jar_a320_neo_vert_wait; XPLMDataRef jar_a320_neo_lat_mode; XPLMDataRef jar_a320_neo_lat_wait; // Landing capabilities XPLMDataRef jar_a320_neo_fma_cat_mode; XPLMDataRef jar_a320_neo_fma_dual_mode; XPLMDataRef jar_a320_neo_fma_dh_mode; XPLMDataRef jar_a320_neo_fma_mda_alt; XPLMDataRef jar_a320_neo_fma_dh_alt; // Approach XPLMDataRef jar_a320_neo_ap_appr_type; XPLMDataRef jar_a320_neo_ap_appr_illuminated; XPLMDataRef jar_a320_neo_ap_loc_illuminated; // A/THR XPLMDataRef jar_a320_neo_athr_mode; XPLMDataRef jar_a320_neo_thr_mode; XPLMDataRef jar_a320_neo_flex_t; // ADIRS XPLMDataRef jar_a320_neo_adirs_adr1; XPLMDataRef jar_a320_neo_adirs_adr2; XPLMDataRef jar_a320_neo_adirs_adr3; XPLMDataRef jar_a320_neo_adirs_disp; XPLMDataRef jar_a320_neo_adirs_ir1; XPLMDataRef jar_a320_neo_adirs_ir2; XPLMDataRef jar_a320_neo_adirs_ir3; XPLMDataRef jar_a320_neo_adirs_on_bat; // APU XPLMDataRef jar_a320_neo_apu_flap; XPLMDataRef jar_a320_neo_apu_start_pb; // Bleed Air XPLMDataRef jar_a320_neo_bleed_apu_bleed_valve; XPLMDataRef jar_a320_neo_bleed_eng1_bleed_knob; XPLMDataRef jar_a320_neo_bleed_eng1_bleed_valve; XPLMDataRef jar_a320_neo_bleed_eng1_bleed_temp; XPLMDataRef jar_a320_neo_bleed_eng1_bleed_hp_valve; XPLMDataRef jar_a320_neo_bleed_eng1_bleed_psi; XPLMDataRef jar_a320_neo_bleed_eng2_bleed_knob; XPLMDataRef jar_a320_neo_bleed_eng2_bleed_valve; XPLMDataRef jar_a320_neo_bleed_eng2_bleed_temp; XPLMDataRef jar_a320_neo_bleed_eng2_bleed_hp_valve; XPLMDataRef jar_a320_neo_bleed_eng2_bleed_psi; XPLMDataRef jar_a320_neo_bleed_cross_valve; // Brakes XPLMDataRef jar_a320_neo_autobrake_low; XPLMDataRef jar_a320_neo_autobrake_med; XPLMDataRef jar_a320_neo_autobrake_max; XPLMDataRef jar_a320_neo_autobrake_on; XPLMDataRef jar_a320_neo_brakes_accu_press; XPLMDataRef jar_a320_neo_brakes_left_press; XPLMDataRef jar_a320_neo_brakes_right_press; XPLMDataRef jar_a320_neo_brakes_mode_na; // ATA 21 Conditioning XPLMDataRef jar_a320_neo_cond_aft_duct; XPLMDataRef jar_a320_neo_cond_aft_temp; XPLMDataRef jar_a320_neo_cond_aft_trm_valve; XPLMDataRef jar_a320_neo_cond_cargo_aft_duct; XPLMDataRef jar_a320_neo_cond_cargo_aft_temp; XPLMDataRef jar_a320_neo_cond_cargo_aft_trm_valve; XPLMDataRef jar_a320_neo_cond_cargo_aft_valve; XPLMDataRef jar_a320_neo_cond_cargo_fwd_duct; XPLMDataRef jar_a320_neo_cond_cargo_fwd_temp; XPLMDataRef jar_a320_neo_cond_cargo_fwd_trm_valve; XPLMDataRef jar_a320_neo_cond_cargo_fwd_valve; XPLMDataRef jar_a320_neo_cond_cockpit_duct; XPLMDataRef jar_a320_neo_cond_cockpit_temp; XPLMDataRef jar_a320_neo_cond_cockpit_trm_valve; XPLMDataRef jar_a320_neo_cond_econ_flow; XPLMDataRef jar_a320_neo_cond_fwd_duct; XPLMDataRef jar_a320_neo_cond_fwd_temp; XPLMDataRef jar_a320_neo_cond_fwd_trm_valve; XPLMDataRef jar_a320_neo_cond_hot_air; XPLMDataRef jar_a320_neo_cond_cargo_hot_air; XPLMDataRef jar_a320_neo_cond_pack1; XPLMDataRef jar_a320_neo_cond_pack12_line; XPLMDataRef jar_a320_neo_cond_pack1_comp_deg; XPLMDataRef jar_a320_neo_cond_pack1_f; XPLMDataRef jar_a320_neo_cond_pack1_flow; XPLMDataRef jar_a320_neo_cond_pack1_line; XPLMDataRef jar_a320_neo_cond_pack1_ndl; XPLMDataRef jar_a320_neo_cond_pack1_out_deg; XPLMDataRef jar_a320_neo_cond_pack2; XPLMDataRef jar_a320_neo_cond_pack2_comp_deg; XPLMDataRef jar_a320_neo_cond_pack2_f; XPLMDataRef jar_a320_neo_cond_pack2_flow; XPLMDataRef jar_a320_neo_cond_pack2_line; XPLMDataRef jar_a320_neo_cond_pack2_ndl; XPLMDataRef jar_a320_neo_cond_pack2_out_deg; XPLMDataRef jar_a320_neo_cond_ram_air; // Doors XPLMDataRef jar_a320_neo_doors_c_b_kn; XPLMDataRef jar_a320_neo_doors_c_b_now; XPLMDataRef jar_a320_neo_doors_c_f_kn; XPLMDataRef jar_a320_neo_doors_c_f_now; XPLMDataRef jar_a320_neo_doors_p_b_l_kn; XPLMDataRef jar_a320_neo_doors_p_b_l_now; XPLMDataRef jar_a320_neo_doors_p_b_r_kn; XPLMDataRef jar_a320_neo_doors_p_b_r_now; XPLMDataRef jar_a320_neo_doors_p_f_l_kn; XPLMDataRef jar_a320_neo_doors_p_f_l_now; XPLMDataRef jar_a320_neo_doors_p_f_r_kn; XPLMDataRef jar_a320_neo_doors_p_f_r_now; // Electrics XPLMDataRef jar_a320_neo_elec_ac1_source; XPLMDataRef jar_a320_neo_elec_ac2_source; XPLMDataRef jar_a320_neo_elec_ac_ess; XPLMDataRef jar_a320_neo_elec_ac_ess_alt; XPLMDataRef jar_a320_neo_elec_ac_ess_shed; XPLMDataRef jar_a320_neo_elec_apu_gen_on; XPLMDataRef jar_a320_neo_elec_bat1_amp; XPLMDataRef jar_a320_neo_elec_bat1_volt; XPLMDataRef jar_a320_neo_elec_bat1_on; XPLMDataRef jar_a320_neo_elec_bat2_amp; XPLMDataRef jar_a320_neo_elec_bat2_volt; XPLMDataRef jar_a320_neo_elec_bat2_on; XPLMDataRef jar_a320_neo_elec_bus_tie; XPLMDataRef jar_a320_neo_elec_commrc; XPLMDataRef jar_a320_neo_elec_dc1; XPLMDataRef jar_a320_neo_elec_dc2; XPLMDataRef jar_a320_neo_elec_dcbus; XPLMDataRef jar_a320_neo_elec_dc_ess; XPLMDataRef jar_a320_neo_elec_dc_ess_shed; XPLMDataRef jar_a320_neo_elec_dc_some_on; XPLMDataRef jar_a320_neo_elec_emer; XPLMDataRef jar_a320_neo_elec_ext_hz; XPLMDataRef jar_a320_neo_elec_ext_volt; XPLMDataRef jar_a320_neo_elec_galley; XPLMDataRef jar_a320_neo_elec_gen1_hz; XPLMDataRef jar_a320_neo_elec_gen1_line_on; XPLMDataRef jar_a320_neo_elec_gen1_per; XPLMDataRef jar_a320_neo_elec_gen1_volt; XPLMDataRef jar_a320_neo_elec_gen2_hz; XPLMDataRef jar_a320_neo_elec_gen2_per; XPLMDataRef jar_a320_neo_elec_gen2_volt; XPLMDataRef jar_a320_neo_elec_apu_hz; XPLMDataRef jar_a320_neo_elec_apu_per; XPLMDataRef jar_a320_neo_elec_apu_volt; XPLMDataRef jar_a320_neo_elec_gen_emer_hz; XPLMDataRef jar_a320_neo_elec_gen_emer_volt; XPLMDataRef jar_a320_neo_elec_gpu_av; XPLMDataRef jar_a320_neo_elec_gpu_on; XPLMDataRef jar_a320_neo_elec_lft_gen_on; XPLMDataRef jar_a320_neo_elec_man_rat_cover; XPLMDataRef jar_a320_neo_elec_man_rat_on; XPLMDataRef jar_a320_neo_elec_rat_av; XPLMDataRef jar_a320_neo_elec_rat_on; XPLMDataRef jar_a320_neo_elec_rgh_gen_on; XPLMDataRef jar_a320_neo_elec_tr1_amp; XPLMDataRef jar_a320_neo_elec_tr1_volt; XPLMDataRef jar_a320_neo_elec_tr2_amp; XPLMDataRef jar_a320_neo_elec_tr2_volt; XPLMDataRef jar_a320_neo_elec_tr_em_amp; XPLMDataRef jar_a320_neo_elec_tr_em_volt; // Engines XPLMDataRef jar_a320_neo_eng_1_nac_temp; XPLMDataRef jar_a320_neo_eng_2_nac_temp; XPLMDataRef jar_a320_neo_eng_1_oil_press; XPLMDataRef jar_a320_neo_eng_2_oil_press; XPLMDataRef jar_a320_neo_eng_1_oil_qt; XPLMDataRef jar_a320_neo_eng_2_oil_qt; XPLMDataRef jar_a320_neo_eng_1_oil_temp; XPLMDataRef jar_a320_neo_eng_2_oil_temp; XPLMDataRef jar_a320_neo_eng_1_fire_pb; XPLMDataRef jar_a320_neo_eng_1_fuel_valve; XPLMDataRef jar_a320_neo_eng_2_fire_pb; XPLMDataRef jar_a320_neo_eng_2_fuel_valve; // FMS XPLMDataRef jar_a320_neo_fms_tr_alt; XPLMDataRef jar_a320_neo_yoyo_on; XPLMDataRef jar_a320_neo_vdev; // FUEL XPLMDataRef jar_a320_neo_fuel_all_flow; XPLMDataRef jar_a320_neo_fuel_bus_left; XPLMDataRef jar_a320_neo_fuel_bus_right; XPLMDataRef jar_a320_neo_fuel_bus_t1; XPLMDataRef jar_a320_neo_fuel_bus_t3; XPLMDataRef jar_a320_neo_fuel_cent_mode; XPLMDataRef jar_a320_neo_fuel_inn_out_left; XPLMDataRef jar_a320_neo_fuel_inn_out_right; XPLMDataRef jar_a320_neo_fuel_t0; XPLMDataRef jar_a320_neo_fuel_t1; XPLMDataRef jar_a320_neo_fuel_t1_pump1; XPLMDataRef jar_a320_neo_fuel_t1_pump2; XPLMDataRef jar_a320_neo_fuel_t2; XPLMDataRef jar_a320_neo_fuel_t2_pump1; XPLMDataRef jar_a320_neo_fuel_t2_pump2; XPLMDataRef jar_a320_neo_fuel_t3; XPLMDataRef jar_a320_neo_fuel_t3_pump1; XPLMDataRef jar_a320_neo_fuel_t3_pump2; XPLMDataRef jar_a320_neo_fuel_t4; XPLMDataRef jar_a320_neo_fuel_used1; XPLMDataRef jar_a320_neo_fuel_used12; XPLMDataRef jar_a320_neo_fuel_used2; XPLMDataRef jar_a320_neo_fuel_xfeed; // GPWS XPLMDataRef jar_a320_neo_gpws_flap; XPLMDataRef jar_a320_neo_gpws_flap3; XPLMDataRef jar_a320_neo_gpws_fr; XPLMDataRef jar_a320_neo_gpws_gs; XPLMDataRef jar_a320_neo_gpws_sys; XPLMDataRef jar_a320_neo_gpws_terr; // Hydraulics XPLMDataRef jar_a320_neo_hydr_b_elec_pump_fault_light; XPLMDataRef jar_a320_neo_hydr_b_elec_pump_mode; XPLMDataRef jar_a320_neo_hydr_b_press_aft_acc_old; XPLMDataRef jar_a320_neo_hydr_g_eng_pump_fault_light; XPLMDataRef jar_a320_neo_hydr_g_eng_pump_mode; XPLMDataRef jar_a320_neo_hydr_g_press_aft_acc_old; XPLMDataRef jar_a320_neo_hydr_ptu_delta; XPLMDataRef jar_a320_neo_hydr_ptu_mode; XPLMDataRef jar_a320_neo_hydr_y_elec_pump_fault_light; XPLMDataRef jar_a320_neo_hydr_y_elec_pump_mode; XPLMDataRef jar_a320_neo_hydr_y_eng_pump_fault_light; XPLMDataRef jar_a320_neo_hydr_y_eng_pump_mode; XPLMDataRef jar_a320_neo_hydr_y_press_aft_acc_old; // Ice and Rain XPLMDataRef jar_a320_neo_icerain_eng1; XPLMDataRef jar_a320_neo_icerain_eng2; XPLMDataRef jar_a320_neo_icerain_window; XPLMDataRef jar_a320_neo_icerain_wing; XPLMDataRef jar_a320_neo_icerain_wing_flt; // OXY XPLMDataRef jar_a320_neo_oxy_crewsupp; XPLMDataRef jar_a320_neo_oxy_manon; XPLMDataRef jar_a320_neo_oxy_sys_on; XPLMDataRef jar_a320_neo_oxy_textoxy; // PRESSURE XPLMDataRef jar_a320_neo_press_alt_rot; XPLMDataRef jar_a320_neo_press_mode; XPLMDataRef jar_a320_neo_press_cab_alt; XPLMDataRef jar_a320_neo_press_cab_des; XPLMDataRef jar_a320_neo_press_cab_vs; XPLMDataRef jar_a320_neo_press_delta_p; XPLMDataRef jar_a320_neo_press_outflow_valve; XPLMDataRef jar_a320_neo_press_safety_valve; XPLMDataRef jar_a320_neo_press_sys1; XPLMDataRef jar_a320_neo_press_sys2; // VENTILATION XPLMDataRef jar_a320_neo_vent_blover; XPLMDataRef jar_a320_neo_vent_cab_fans; XPLMDataRef jar_a320_neo_vent_extract; XPLMDataRef jar_a320_neo_vent_gnd_cool; XPLMDataRef jar_a320_neo_vent_inlet_valve; XPLMDataRef jar_a320_neo_vent_outlet_valve; // WHEELS XPLMDataRef jar_a320_neo_wheels_brake_fan; XPLMDataRef jar_a320_neo_wheels_brake_hot; XPLMDataRef jar_a320_neo_wheels_temp_l_1; XPLMDataRef jar_a320_neo_wheels_temp_l_2; XPLMDataRef jar_a320_neo_wheels_temp_r_1; XPLMDataRef jar_a320_neo_wheels_temp_r_2; XPLMDataRef jar_a320_neo_wheels_ped_disc; XPLMDataRef jar_a320_neo_wheels_anti_skid; // V-Speeds XPLMDataRef jar_a320_neo_vls; XPLMDataRef jar_a320_neo_vamax; XPLMDataRef jar_a320_neo_vaprot; XPLMDataRef jar_a320_neo_vmax; XPLMDataRef jar_a320_neo_v1; XPLMDataRef jar_a320_neo_vr; XPLMDataRef jar_a320_neo_vgrdot; // EFIS XPLMDataRef jar_a320_neo_nd_mode; // MCDU XPLMDataRef jar_a320_mcdu_click[JAR_A320_MAX_MCDU_KEYS]; // SD_PAGE Display XPLMDataRef jar_a320_disp_sys_mode; int jar_a320_neo_ready = 0; /* * JarDesign a320neo dataref todo list * sim/custom/rev[0] sim/custom/terr_on_nd * * Autopilot * sim/custom/xap/ap/athr_mode[0] sim/custom/xap/ap/spdmanaged[0] * * sim/custom/xap/debug[0] sim/custom/xap/disp/sys/emer_canc[0] * * CHRONO * sim/custom/xap/et_timer/all[0] sim/custom/xap/et_timer/hr[0] sim/custom/xap/et_timer/min[0] * * ECAM E/WD * sim/custom/xap/ewd_allkn[0] sim/custom/xap/ewd_clr[0] * * LIGHTS * sim/custom/xap/extlight/cockp_left_br sim/custom/xap/extlight/cockp_main_br[0] sim/custom/xap/extlight/cockp_main_br_target sim/custom/xap/extlight/cockp_rght_br sim/custom/xap/fctr/mode[0] * * FIRE * sim/custom/xap/firetest/apu[0] sim/custom/xap/firetest/e1[0] sim/custom/xap/firetest/e2[0] * * Ice and Rain * sim/custom/xap/icerain/eng1_knob[0] sim/custom/xap/icerain/eng2_knob[0] sim/custom/xap/icerain/window[0] sim/custom/xap/icerain/wing_knob[0] sim/custom/xap/icerain/wing_knob_flt[0] * * Indicators * sim/custom/xap/ind_baro_hpa[0] sim/custom/xap/ind_baro_inhg[0] sim/custom/xap/indicators/autoland[0] sim/custom/xap/indicators/mastcaut[0] sim/custom/xap/indicators/mastwarn[0] sim/custom/xap/is_cap_pf[0] sim/custom/xap/isis_lt_dn[0] sim/custom/xap/isis_lt_up[0] sim/custom/xap/lght_dnd[0] sim/custom/xap/lght_oh_cent[0] sim/custom/xap/lght_oh_left[0] sim/custom/xap/lght_oh_rght[0] sim/custom/xap/lght_upd[0] * * RADIO * sim/custom/xap/radio/nav_but[0] sim/custom/xap/radio/on[0] sim/custom/xap/shtora/fl_on[0] sim/custom/xap/to_conf_knob[0] * * WingTip * sim/custom/xap/wingtip sim/custom/xap/wingtip_rev * */ void findJarA320NeoDataRefs(void) { // For datarefs checks, remove for release // char msg[200]; // XPLMDataTypeID reftype; jar_a320_neo_plugin_status = XPLMFindDataRef("sim/custom/xap/elec/acess"); if ( ( jar_a320_neo_plugin_status == NULL ) || ( XPLMGetDatai(jar_a320_neo_plugin_status) < 0 ) ) { jar_a320_neo_ready = 0; } else { if ( jar_a320_neo_ready == 0 ) { jar_a320_neo_ready = 1; XPLMDebugString("XHSI: using JarDesign A320 Neo DataRefs\n"); // Autopilot and FD jar_a320_neo_ap_phase = XPLMFindDataRef("sim/custom/xap/fly_phase"); jar_a320_neo_ap1 = XPLMFindDataRef("sim/custom/xap/fcu/ap1"); jar_a320_neo_ap2 = XPLMFindDataRef("sim/custom/xap/fcu/ap2"); jar_a320_neo_ils = XPLMFindDataRef("sim/custom/xap/fcu/ils"); jar_a320_neo_fd = XPLMFindDataRef("sim/custom/xap/fcu/fd"); // FD Bars jar_a320_neo_fd_h_show = XPLMFindDataRef("sim/custom/xap/pfd/myfd_h_show"); jar_a320_neo_fd_pitch = XPLMFindDataRef("sim/cockpit2/autopilot/flight_director_pitch_deg"); jar_a320_neo_fd_v_show = XPLMFindDataRef("sim/custom/xap/pfd/myfd_v_show"); jar_a320_neo_fd_roll = XPLMFindDataRef("sim/cockpit2/autopilot/flight_director_roll_deg"); jar_a320_neo_fd_y_show = XPLMFindDataRef("sim/custom/xap/pfd/myfd_y_show"); jar_a320_neo_fd_yaw_dot = XPLMFindDataRef("sim/cockpit2/radios/indicators/nav1_hdef_dots_pilot"); // Vertical and horizontal modes jar_a320_neo_com_mode = XPLMFindDataRef("sim/custom/xap/ap/common_mode"); jar_a320_neo_vert_mode = XPLMFindDataRef("sim/custom/xap/ap/vert_mode"); jar_a320_neo_vert_wait = XPLMFindDataRef("sim/custom/xap/ap/vert_wait"); jar_a320_neo_lat_mode = XPLMFindDataRef("sim/custom/xap/ap/lat_mode"); jar_a320_neo_lat_wait = XPLMFindDataRef("sim/custom/xap/ap/lat_wait"); // FCU jar_a320_neo_baro_hpa = XPLMFindDataRef("sim/custom/xap/fcu/baro_ishpa"); jar_a320_neo_fcu_hdg_trk = XPLMFindDataRef("sim/custom/xap/fcu/hdgtrk"); jar_a320_neo_fcu_metric_alt = XPLMFindDataRef("sim/custom/xap/fcu/metric_alt"); jar_a320_neo_vs_dashed = XPLMFindDataRef("sim/custom/xap/fcu/vvi_dash_view"); jar_a320_neo_hdg_dashed = XPLMFindDataRef("sim/custom/xap/fcu/hdgtrk/hdg_dash"); jar_a320_neo_hdg_managed = XPLMFindDataRef("sim/custom/xap/fcu/hdgtrk/hdg_ballon"); jar_a320_neo_lvlch_dot = XPLMFindDataRef("sim/custom/xap/fcu/lvlch_dot"); jar_a320_neo_spd_managed = XPLMFindDataRef("sim/custom/xap/ap/spdmanaged"); jar_a320_neo_fcu_alt100x = XPLMFindDataRef("sim/custom/xap/fcu/alt100x"); // jar_a320_neo_alt_managed = XPLMFindDataRef("sim/custom/xap/"); // Baro jar_a320_neo_baro_flash = XPLMFindDataRef("sim/custom/xap/pfd/baro_flash"); // Landing capabilities jar_a320_neo_fma_cat_mode = XPLMFindDataRef("sim/custom/xap/fma/cat_mode"); jar_a320_neo_fma_dual_mode = XPLMFindDataRef("sim/custom/xap/fma/dual_mode"); jar_a320_neo_fma_dh_mode = XPLMFindDataRef("sim/custom/xap/fma/dh_mode"); jar_a320_neo_fma_mda_alt = XPLMFindDataRef("sim/custom/xap/alt/mda_alt"); jar_a320_neo_fma_dh_alt = XPLMFindDataRef("sim/custom/xap/alt/dh_alt"); // Approach jar_a320_neo_ap_appr_type = XPLMFindDataRef("sim/custom/xap/ap/appr_type"); jar_a320_neo_ap_appr_illuminated = XPLMFindDataRef("sim/custom/xap/fcu/appr_bat"); jar_a320_neo_ap_loc_illuminated = XPLMFindDataRef("sim/custom/xap/fcu/loc_bat"); // A/THR jar_a320_neo_athr_mode = XPLMFindDataRef("sim/custom/xap/ap/athr_mode"); jar_a320_neo_thr_mode = XPLMFindDataRef("sim/custom/xap/ap/thr_mode"); jar_a320_neo_flex_t = XPLMFindDataRef("sim/custom/xap/engines/flex_t"); // ADIRS jar_a320_neo_adirs_adr1 = XPLMFindDataRef("sim/custom/xap/adirs/adr1"); jar_a320_neo_adirs_adr2 = XPLMFindDataRef("sim/custom/xap/adirs/adr2"); jar_a320_neo_adirs_adr3 = XPLMFindDataRef("sim/custom/xap/adirs/adr3"); jar_a320_neo_adirs_disp = XPLMFindDataRef("sim/custom/xap/adirs/disp"); jar_a320_neo_adirs_ir1 = XPLMFindDataRef("sim/custom/xap/adirs/ir1"); jar_a320_neo_adirs_ir2 = XPLMFindDataRef("sim/custom/xap/adirs/ir2"); jar_a320_neo_adirs_ir3 = XPLMFindDataRef("sim/custom/xap/adirs/ir3"); jar_a320_neo_adirs_on_bat = XPLMFindDataRef("sim/custom/xap/adirs/on_bat"); // APU jar_a320_neo_apu_flap = XPLMFindDataRef("sim/custom/xap/apu/flap"); jar_a320_neo_apu_start_pb = XPLMFindDataRef("sim/custom/xap/apu/start_pb"); // Bleed Air jar_a320_neo_bleed_apu_bleed_valve = XPLMFindDataRef("sim/custom/xap/bleed/apu_blvlv"); jar_a320_neo_bleed_eng1_bleed_knob = XPLMFindDataRef("sim/custom/xap/bleed/eng1_bl_knob"); jar_a320_neo_bleed_eng1_bleed_valve = XPLMFindDataRef("sim/custom/xap/bleed/eng1_blvlv"); jar_a320_neo_bleed_eng1_bleed_temp = XPLMFindDataRef("sim/custom/xap/bleed/eng1_deg"); jar_a320_neo_bleed_eng1_bleed_hp_valve = XPLMFindDataRef("sim/custom/xap/bleed/eng1_hpvlv"); jar_a320_neo_bleed_eng1_bleed_psi = XPLMFindDataRef("sim/custom/xap/bleed/eng1_psi"); jar_a320_neo_bleed_eng2_bleed_knob = XPLMFindDataRef("sim/custom/xap/bleed/eng2_bl_knob"); jar_a320_neo_bleed_eng2_bleed_valve = XPLMFindDataRef("sim/custom/xap/bleed/eng2_blvlv"); jar_a320_neo_bleed_eng2_bleed_temp = XPLMFindDataRef("sim/custom/xap/bleed/eng2_deg"); jar_a320_neo_bleed_eng2_bleed_hp_valve = XPLMFindDataRef("sim/custom/xap/bleed/eng2_hpvlv"); jar_a320_neo_bleed_eng2_bleed_psi = XPLMFindDataRef("sim/custom/xap/bleed/eng2_psi"); jar_a320_neo_bleed_cross_valve = XPLMFindDataRef("sim/custom/xap/bleed/xbl_vlv"); // Brakes jar_a320_neo_autobrake_low = XPLMFindDataRef("sim/custom/xap/brakes/auto_lo"); jar_a320_neo_autobrake_med = XPLMFindDataRef("sim/custom/xap/brakes/auto_med"); jar_a320_neo_autobrake_max = XPLMFindDataRef("sim/custom/xap/brakes/auto_max"); jar_a320_neo_autobrake_on = XPLMFindDataRef("sim/custom/xap/brakes/auto_on"); jar_a320_neo_brakes_accu_press = XPLMFindDataRef("sim/custom/xap/brakes/accu_press"); jar_a320_neo_brakes_left_press = XPLMFindDataRef("sim/custom/xap/brakes/left_br_press"); jar_a320_neo_brakes_right_press = XPLMFindDataRef("sim/custom/xap/brakes/right_br_press"); jar_a320_neo_brakes_mode_na = XPLMFindDataRef("sim/custom/xap/brakes/mode_na"); // Conditionning jar_a320_neo_cond_aft_duct = XPLMFindDataRef("sim/custom/xap/cond/aft_duct"); jar_a320_neo_cond_aft_temp = XPLMFindDataRef("sim/custom/xap/cond/aft_temp"); jar_a320_neo_cond_aft_trm_valve = XPLMFindDataRef("sim/custom/xap/cond/aft_trmvlv"); jar_a320_neo_cond_cargo_aft_duct = XPLMFindDataRef("sim/custom/xap/cond/c_aft_duct"); jar_a320_neo_cond_cargo_aft_temp = XPLMFindDataRef("sim/custom/xap/cond/c_aft_temp"); jar_a320_neo_cond_cargo_aft_trm_valve = XPLMFindDataRef("sim/custom/xap/cond/c_aft_trmvlv"); jar_a320_neo_cond_cargo_aft_valve = XPLMFindDataRef("sim/custom/xap/cond/c_aft_vlv"); jar_a320_neo_cond_cargo_fwd_duct = XPLMFindDataRef("sim/custom/xap/cond/c_fwd_duct"); jar_a320_neo_cond_cargo_fwd_temp = XPLMFindDataRef("sim/custom/xap/cond/c_fwd_temp"); jar_a320_neo_cond_cargo_fwd_trm_valve = XPLMFindDataRef("sim/custom/xap/cond/c_fwd_trmvlv"); jar_a320_neo_cond_cargo_fwd_valve = XPLMFindDataRef("sim/custom/xap/cond/c_fwd_vlv"); jar_a320_neo_cond_cockpit_duct = XPLMFindDataRef("sim/custom/xap/cond/ckpt_duct"); jar_a320_neo_cond_cockpit_temp = XPLMFindDataRef("sim/custom/xap/cond/ckpt_temp"); jar_a320_neo_cond_cockpit_trm_valve = XPLMFindDataRef("sim/custom/xap/cond/ckpt_trmvlv"); jar_a320_neo_cond_econ_flow = XPLMFindDataRef("sim/custom/xap/cond/econ_flow"); jar_a320_neo_cond_fwd_duct = XPLMFindDataRef("sim/custom/xap/cond/fwd_duct"); jar_a320_neo_cond_fwd_temp = XPLMFindDataRef("sim/custom/xap/cond/fwd_temp"); jar_a320_neo_cond_fwd_trm_valve = XPLMFindDataRef("sim/custom/xap/cond/fwd_trmvlv"); jar_a320_neo_cond_hot_air = XPLMFindDataRef("sim/custom/xap/cond/hot_air"); jar_a320_neo_cond_cargo_hot_air = XPLMFindDataRef("sim/custom/xap/cond/hot_air_c"); jar_a320_neo_cond_pack1 = XPLMFindDataRef("sim/custom/xap/cond/pack1"); jar_a320_neo_cond_pack12_line = XPLMFindDataRef("sim/custom/xap/cond/pack12_line"); jar_a320_neo_cond_pack1_comp_deg = XPLMFindDataRef("sim/custom/xap/cond/pack1_comp_deg"); jar_a320_neo_cond_pack1_f = XPLMFindDataRef("sim/custom/xap/cond/pack1_f"); jar_a320_neo_cond_pack1_flow = XPLMFindDataRef("sim/custom/xap/cond/pack1_flow"); jar_a320_neo_cond_pack1_line = XPLMFindDataRef("sim/custom/xap/cond/pack1_line"); jar_a320_neo_cond_pack1_ndl = XPLMFindDataRef("sim/custom/xap/cond/pack1_ndl"); jar_a320_neo_cond_pack1_out_deg = XPLMFindDataRef("sim/custom/xap/cond/pack1_out_deg"); jar_a320_neo_cond_pack2 = XPLMFindDataRef("sim/custom/xap/cond/pack2"); jar_a320_neo_cond_pack2_comp_deg = XPLMFindDataRef("sim/custom/xap/cond/pack2_comp_deg"); jar_a320_neo_cond_pack2_f = XPLMFindDataRef("sim/custom/xap/cond/pack2_f"); jar_a320_neo_cond_pack2_flow = XPLMFindDataRef("sim/custom/xap/cond/pack2_flow"); jar_a320_neo_cond_pack2_line = XPLMFindDataRef("sim/custom/xap/cond/pack2_line"); jar_a320_neo_cond_pack2_ndl = XPLMFindDataRef("sim/custom/xap/cond/pack2_ndl"); jar_a320_neo_cond_pack2_out_deg = XPLMFindDataRef("sim/custom/xap/cond/pack2_out_deg"); jar_a320_neo_cond_ram_air = XPLMFindDataRef("sim/custom/xap/cond/ram_air"); // Doors jar_a320_neo_doors_c_b_kn = XPLMFindDataRef("sim/custom/xap/doors/c_b_kn"); jar_a320_neo_doors_c_b_now = XPLMFindDataRef("sim/custom/xap/doors/c_b_now"); jar_a320_neo_doors_c_f_kn = XPLMFindDataRef("sim/custom/xap/doors/c_f_kn"); jar_a320_neo_doors_c_f_now = XPLMFindDataRef("sim/custom/xap/doors/c_f_now"); jar_a320_neo_doors_p_b_l_kn = XPLMFindDataRef("sim/custom/xap/doors/p_b_l_kn"); jar_a320_neo_doors_p_b_l_now = XPLMFindDataRef("sim/custom/xap/doors/p_b_l_now"); jar_a320_neo_doors_p_b_r_kn = XPLMFindDataRef("sim/custom/xap/doors/p_b_r_kn"); jar_a320_neo_doors_p_b_r_now = XPLMFindDataRef("sim/custom/xap/doors/p_b_r_now"); jar_a320_neo_doors_p_f_l_kn = XPLMFindDataRef("sim/custom/xap/doors/p_f_l_kn"); jar_a320_neo_doors_p_f_l_now = XPLMFindDataRef("sim/custom/xap/doors/p_f_l_now"); jar_a320_neo_doors_p_f_r_kn = XPLMFindDataRef("sim/custom/xap/doors/p_f_r_kn"); jar_a320_neo_doors_p_f_r_now = XPLMFindDataRef("sim/custom/xap/doors/p_f_r_now"); // Electrics jar_a320_neo_elec_ac1_source = XPLMFindDataRef("sim/custom/xap/elec/ac1_source"); jar_a320_neo_elec_ac2_source = XPLMFindDataRef("sim/custom/xap/elec/ac2_source"); jar_a320_neo_elec_ac_ess = XPLMFindDataRef("sim/custom/xap/elec/acess"); jar_a320_neo_elec_ac_ess_alt = XPLMFindDataRef("sim/custom/xap/elec/acess_alt"); jar_a320_neo_elec_ac_ess_shed = XPLMFindDataRef("sim/custom/xap/elec/acess_shed"); jar_a320_neo_elec_apu_gen_on = XPLMFindDataRef("sim/custom/xap/elec/apu_gen_on"); jar_a320_neo_elec_bat1_amp = XPLMFindDataRef("sim/custom/xap/elec/bat1_amp"); jar_a320_neo_elec_bat1_volt = XPLMFindDataRef("sim/custom/xap/elec/bat1_ind_volt"); jar_a320_neo_elec_bat1_on = XPLMFindDataRef("sim/custom/xap/elec/bat1_on"); jar_a320_neo_elec_bat2_amp = XPLMFindDataRef("sim/custom/xap/elec/bat2_amp"); jar_a320_neo_elec_bat2_volt = XPLMFindDataRef("sim/custom/xap/elec/bat2_ind_volt"); jar_a320_neo_elec_bat2_on = XPLMFindDataRef("sim/custom/xap/elec/bat2_on"); jar_a320_neo_elec_bus_tie = XPLMFindDataRef("sim/custom/xap/elec/bus_tie"); jar_a320_neo_elec_commrc = XPLMFindDataRef("sim/custom/xap/elec/commrc"); jar_a320_neo_elec_dc1 = XPLMFindDataRef("sim/custom/xap/elec/dc1"); jar_a320_neo_elec_dc2 = XPLMFindDataRef("sim/custom/xap/elec/dc2"); jar_a320_neo_elec_dcbus = XPLMFindDataRef("sim/custom/xap/elec/dcbus"); jar_a320_neo_elec_dc_ess = XPLMFindDataRef("sim/custom/xap/elec/dcess"); jar_a320_neo_elec_dc_ess_shed = XPLMFindDataRef("sim/custom/xap/elec/dcess_shed"); jar_a320_neo_elec_dc_some_on = XPLMFindDataRef("sim/custom/xap/elec/dc_some_on"); jar_a320_neo_elec_emer = XPLMFindDataRef("sim/custom/xap/elec/emer"); jar_a320_neo_elec_ext_hz = XPLMFindDataRef("sim/custom/xap/elec/ext_hz"); jar_a320_neo_elec_ext_volt = XPLMFindDataRef("sim/custom/xap/elec/ext_volt"); jar_a320_neo_elec_galley = XPLMFindDataRef("sim/custom/xap/elec/galley"); jar_a320_neo_elec_gen1_hz = XPLMFindDataRef("sim/custom/xap/elec/gen1_hz"); jar_a320_neo_elec_gen1_line_on = XPLMFindDataRef("sim/custom/xap/elec/gen1line_on"); jar_a320_neo_elec_gen1_per = XPLMFindDataRef("sim/custom/xap/elec/gen1_per"); jar_a320_neo_elec_gen1_volt = XPLMFindDataRef("sim/custom/xap/elec/gen1_volt"); jar_a320_neo_elec_gen2_hz = XPLMFindDataRef("sim/custom/xap/elec/gen2_hz"); jar_a320_neo_elec_gen2_per = XPLMFindDataRef("sim/custom/xap/elec/gen2_per"); jar_a320_neo_elec_gen2_volt = XPLMFindDataRef("sim/custom/xap/elec/gen2_volt"); jar_a320_neo_elec_apu_hz = XPLMFindDataRef("sim/custom/xap/elec/genAPU_hz"); jar_a320_neo_elec_apu_per = XPLMFindDataRef("sim/custom/xap/elec/genAPU_per"); jar_a320_neo_elec_apu_volt = XPLMFindDataRef("sim/custom/xap/elec/genAPU_volt"); jar_a320_neo_elec_gen_emer_hz = XPLMFindDataRef("sim/custom/xap/elec/genEM_hz"); jar_a320_neo_elec_gen_emer_volt = XPLMFindDataRef("sim/custom/xap/elec/genEM_volt"); jar_a320_neo_elec_gpu_av = XPLMFindDataRef("sim/custom/xap/elec/gpu_av"); jar_a320_neo_elec_gpu_on = XPLMFindDataRef("sim/custom/xap/elec/gpu_on"); jar_a320_neo_elec_lft_gen_on = XPLMFindDataRef("sim/custom/xap/elec/lft_gen_on"); jar_a320_neo_elec_man_rat_cover = XPLMFindDataRef("sim/custom/xap/elec/manRAT_cover"); jar_a320_neo_elec_man_rat_on = XPLMFindDataRef("sim/custom/xap/elec/manRAT_on"); jar_a320_neo_elec_rat_av = XPLMFindDataRef("sim/custom/xap/elec/RAT_av"); jar_a320_neo_elec_rat_on = XPLMFindDataRef("sim/custom/xap/elec/RAT_on"); jar_a320_neo_elec_rgh_gen_on = XPLMFindDataRef("sim/custom/xap/elec/rgh_gen_on"); jar_a320_neo_elec_tr1_amp = XPLMFindDataRef("sim/custom/xap/elec/tr1_amp"); jar_a320_neo_elec_tr1_volt = XPLMFindDataRef("sim/custom/xap/elec/tr1_volt"); jar_a320_neo_elec_tr2_amp = XPLMFindDataRef("sim/custom/xap/elec/tr2_amp"); jar_a320_neo_elec_tr2_volt = XPLMFindDataRef("sim/custom/xap/elec/tr2_volt"); jar_a320_neo_elec_tr_em_amp = XPLMFindDataRef("sim/custom/xap/elec/trEM_amp"); jar_a320_neo_elec_tr_em_volt = XPLMFindDataRef("sim/custom/xap/elec/trEM_volt"); // Engines jar_a320_neo_eng_1_nac_temp = XPLMFindDataRef("sim/custom/xap/engines/nactemp_eng1"); jar_a320_neo_eng_2_nac_temp = XPLMFindDataRef("sim/custom/xap/engines/nactemp_eng2"); jar_a320_neo_eng_1_oil_press = XPLMFindDataRef("sim/custom/xap/engines/oilpres_eng1"); jar_a320_neo_eng_2_oil_press = XPLMFindDataRef("sim/custom/xap/engines/oilpres_eng2"); jar_a320_neo_eng_1_oil_qt = XPLMFindDataRef("sim/custom/xap/engines/oilquan_eng1"); jar_a320_neo_eng_2_oil_qt = XPLMFindDataRef("sim/custom/xap/engines/oilquan_eng2"); jar_a320_neo_eng_1_oil_temp = XPLMFindDataRef("sim/custom/xap/engines/oiltemp_eng1"); jar_a320_neo_eng_2_oil_temp = XPLMFindDataRef("sim/custom/xap/engines/oiltemp_eng2"); jar_a320_neo_eng_1_fire_pb = XPLMFindDataRef("sim/custom/xap/eng/left/firepb"); jar_a320_neo_eng_1_fuel_valve = XPLMFindDataRef("sim/custom/xap/eng/left/fuelvalve"); jar_a320_neo_eng_2_fire_pb = XPLMFindDataRef("sim/custom/xap/eng/rght/firepb"); jar_a320_neo_eng_2_fuel_valve = XPLMFindDataRef("sim/custom/xap/eng/rght/fuelvalve"); // EFIS jar_a320_neo_nd_mode = XPLMFindDataRef("sim/custom/xap/fcu/nd_mode"); // FMS jar_a320_neo_fms_tr_alt = XPLMFindDataRef("sim/custom/xap/ap/trans_alt"); jar_a320_neo_yoyo_on = XPLMFindDataRef("sim/custom/yoyo_on"); jar_a320_neo_vdev = XPLMFindDataRef("sim/custom/vdev"); // FUEL jar_a320_neo_fuel_all_flow = XPLMFindDataRef("sim/custom/xap/fuel/all_flow"); jar_a320_neo_fuel_bus_left = XPLMFindDataRef("sim/custom/xap/fuel/bus_left"); jar_a320_neo_fuel_bus_right = XPLMFindDataRef("sim/custom/xap/fuel/bus_rght"); jar_a320_neo_fuel_bus_t1 = XPLMFindDataRef("sim/custom/xap/fuel/bus_t1"); jar_a320_neo_fuel_bus_t3 = XPLMFindDataRef("sim/custom/xap/fuel/bus_t3"); jar_a320_neo_fuel_cent_mode = XPLMFindDataRef("sim/custom/xap/fuel/cent_mode"); jar_a320_neo_fuel_inn_out_left = XPLMFindDataRef("sim/custom/xap/fuel/inn_out_left"); jar_a320_neo_fuel_inn_out_right = XPLMFindDataRef("sim/custom/xap/fuel/inn_out_rght"); jar_a320_neo_fuel_t0 = XPLMFindDataRef("sim/custom/xap/fuel/t0"); jar_a320_neo_fuel_t1 = XPLMFindDataRef("sim/custom/xap/fuel/t1"); jar_a320_neo_fuel_t1_pump1 = XPLMFindDataRef("sim/custom/xap/fuel/t1_pump1"); jar_a320_neo_fuel_t1_pump2 = XPLMFindDataRef("sim/custom/xap/fuel/t1_pump2"); jar_a320_neo_fuel_t2 = XPLMFindDataRef("sim/custom/xap/fuel/t2"); jar_a320_neo_fuel_t2_pump1 = XPLMFindDataRef("sim/custom/xap/fuel/t2_pump1"); jar_a320_neo_fuel_t2_pump2 = XPLMFindDataRef("sim/custom/xap/fuel/t2_pump2"); jar_a320_neo_fuel_t3 = XPLMFindDataRef("sim/custom/xap/fuel/t3"); jar_a320_neo_fuel_t3_pump1 = XPLMFindDataRef("sim/custom/xap/fuel/t3_pump1"); jar_a320_neo_fuel_t3_pump2 = XPLMFindDataRef("sim/custom/xap/fuel/t3_pump2"); jar_a320_neo_fuel_t4 = XPLMFindDataRef("sim/custom/xap/fuel/t4"); jar_a320_neo_fuel_used1 = XPLMFindDataRef("sim/custom/xap/fuel/used1"); jar_a320_neo_fuel_used12 = XPLMFindDataRef("sim/custom/xap/fuel/used12"); jar_a320_neo_fuel_used2 = XPLMFindDataRef("sim/custom/xap/fuel/used2"); jar_a320_neo_fuel_xfeed = XPLMFindDataRef("sim/custom/xap/fuel/xfeed"); // GPWS jar_a320_neo_gpws_flap = XPLMFindDataRef("sim/custom/xap/gpws_flap"); jar_a320_neo_gpws_flap3 = XPLMFindDataRef("sim/custom/xap/gpws_flap3"); jar_a320_neo_gpws_fr = XPLMFindDataRef("sim/custom/xap/gpws_fr"); jar_a320_neo_gpws_gs = XPLMFindDataRef("sim/custom/xap/gpws_gs"); jar_a320_neo_gpws_sys = XPLMFindDataRef("sim/custom/xap/gpws_sys"); jar_a320_neo_gpws_terr = XPLMFindDataRef("sim/custom/xap/gpws_terr"); // Hydraulics jar_a320_neo_hydr_b_elec_pump_fault_light = XPLMFindDataRef("sim/custom/xap/hydr/b/elpump/faultlight"); jar_a320_neo_hydr_b_elec_pump_mode = XPLMFindDataRef("sim/custom/xap/hydr/b/elpump/mode"); jar_a320_neo_hydr_b_press_aft_acc_old = XPLMFindDataRef("sim/custom/xap/hydr/b/press_aft_acc_old"); jar_a320_neo_hydr_g_eng_pump_fault_light = XPLMFindDataRef("sim/custom/xap/hydr/g/engpump/faultlight"); jar_a320_neo_hydr_g_eng_pump_mode = XPLMFindDataRef("sim/custom/xap/hydr/g/engpump/mode"); jar_a320_neo_hydr_g_press_aft_acc_old = XPLMFindDataRef("sim/custom/xap/hydr/g/press_aft_acc_old"); jar_a320_neo_hydr_ptu_delta = XPLMFindDataRef("sim/custom/xap/hydr/ptu/delta"); jar_a320_neo_hydr_ptu_mode = XPLMFindDataRef("sim/custom/xap/hydr/ptu/mode"); jar_a320_neo_hydr_y_elec_pump_fault_light = XPLMFindDataRef("sim/custom/xap/hydr/y/elpump/faultlight_el"); jar_a320_neo_hydr_y_elec_pump_mode = XPLMFindDataRef("sim/custom/xap/hydr/y/elpump/mode"); jar_a320_neo_hydr_y_eng_pump_fault_light = XPLMFindDataRef("sim/custom/xap/hydr/y/engpump/faultlight"); jar_a320_neo_hydr_y_eng_pump_mode = XPLMFindDataRef("sim/custom/xap/hydr/y/engpump/mode"); jar_a320_neo_hydr_y_press_aft_acc_old = XPLMFindDataRef("sim/custom/xap/hydr/y/press_aft_acc_old"); // Ice and Rain jar_a320_neo_icerain_eng1 = XPLMFindDataRef("sim/custom/xap/icerain/eng1_knob"); jar_a320_neo_icerain_eng2 = XPLMFindDataRef("sim/custom/xap/icerain/eng2_knob"); jar_a320_neo_icerain_window = XPLMFindDataRef("sim/custom/xap/icerain/window"); jar_a320_neo_icerain_wing = XPLMFindDataRef("sim/custom/xap/icerain/wing_knob"); jar_a320_neo_icerain_wing_flt = XPLMFindDataRef("sim/custom/xap/icerain/wing_knob_flt"); // OXY jar_a320_neo_oxy_crewsupp = XPLMFindDataRef("sim/custom/xap/oxy/crewsupp"); jar_a320_neo_oxy_manon = XPLMFindDataRef("sim/custom/xap/oxy/manon"); jar_a320_neo_oxy_sys_on = XPLMFindDataRef("sim/custom/xap/oxy/sys_on"); jar_a320_neo_oxy_textoxy = XPLMFindDataRef("sim/custom/xap/oxy/testoxy"); // PRESSURE jar_a320_neo_press_alt_rot = XPLMFindDataRef("sim/custom/xap/press/alt_rot"); jar_a320_neo_press_mode = XPLMFindDataRef("sim/custom/xap/press/automode"); jar_a320_neo_press_cab_alt = XPLMFindDataRef("sim/custom/xap/press/cab_alt"); jar_a320_neo_press_cab_des = XPLMFindDataRef("sim/custom/xap/press/cab_des"); jar_a320_neo_press_cab_vs = XPLMFindDataRef("sim/custom/xap/press/cab_vs"); jar_a320_neo_press_delta_p = XPLMFindDataRef("sim/custom/xap/press/dif_psi"); jar_a320_neo_press_outflow_valve = XPLMFindDataRef("sim/custom/xap/press/out_vlv"); jar_a320_neo_press_safety_valve = XPLMFindDataRef("sim/custom/xap/press/saf_vlv"); jar_a320_neo_press_sys1 = XPLMFindDataRef("sim/custom/xap/press/sys1"); jar_a320_neo_press_sys2 = XPLMFindDataRef("sim/custom/xap/press/sys2"); // VENTILATION jar_a320_neo_vent_blover = XPLMFindDataRef("sim/custom/xap/vent/blover"); jar_a320_neo_vent_cab_fans = XPLMFindDataRef("sim/custom/xap/vent/cab_fans"); jar_a320_neo_vent_extract = XPLMFindDataRef("sim/custom/xap/vent/extract"); jar_a320_neo_vent_gnd_cool = XPLMFindDataRef("sim/custom/xap/vent/gnd_cool"); jar_a320_neo_vent_inlet_valve = XPLMFindDataRef("sim/custom/xap/vent/in_vlv"); jar_a320_neo_vent_outlet_valve = XPLMFindDataRef("sim/custom/xap/vent/out_vlv"); // WHEELS jar_a320_neo_wheels_brake_fan = XPLMFindDataRef("sim/custom/xap/wheels/br_fun"); jar_a320_neo_wheels_brake_hot = XPLMFindDataRef("sim/custom/xap/wheels/br_hot"); jar_a320_neo_wheels_temp_l_1 = XPLMFindDataRef("sim/custom/xap/wheels/deg_l_1"); jar_a320_neo_wheels_temp_l_2 = XPLMFindDataRef("sim/custom/xap/wheels/deg_l_2"); jar_a320_neo_wheels_temp_r_1 = XPLMFindDataRef("sim/custom/xap/wheels/deg_r_1"); jar_a320_neo_wheels_temp_r_2 = XPLMFindDataRef("sim/custom/xap/wheels/deg_r_2"); jar_a320_neo_wheels_ped_disc = XPLMFindDataRef("sim/custom/xap/wheels/ped_disc"); jar_a320_neo_wheels_anti_skid = XPLMFindDataRef("sim/custom/xap/wheels/ant_skeed"); // V-Speeds jar_a320_neo_vls = XPLMFindDataRef("sim/custom/xap/pfd/vls_knots"); jar_a320_neo_vamax = XPLMFindDataRef("sim/custom/xap/pfd/vamax_knots"); jar_a320_neo_vaprot = XPLMFindDataRef("sim/custom/xap/pfd/vaprot_knots"); jar_a320_neo_vmax = XPLMFindDataRef("sim/custom/xap/pfd/vmax_knots"); jar_a320_neo_v1 = XPLMFindDataRef("sim/custom/xap/pfd/v1_knots"); jar_a320_neo_vr = XPLMFindDataRef("sim/custom/xap/pfd/vr_knots"); jar_a320_neo_vgrdot = XPLMFindDataRef("sim/custom/xap/pfd/vgrdot_knots"); // MCDU click jar_a320_mcdu_click[0] = XPLMFindDataRef("sim/custom/xap/mcdu/click_mcdumenu"); jar_a320_mcdu_click[1] = XPLMFindDataRef("sim/custom/xap/mcdu/click_data"); jar_a320_mcdu_click[2] = XPLMFindDataRef("sim/custom/xap/mcdu/click_blank"); jar_a320_mcdu_click[3] = XPLMFindDataRef("sim/custom/xap/mcdu/click_fpln"); jar_a320_mcdu_click[4] = XPLMFindDataRef("sim/custom/xap/mcdu/click_airp"); jar_a320_mcdu_click[5] = XPLMFindDataRef("sim/custom/xap/mcdu/click_fuel"); jar_a320_mcdu_click[6] = XPLMFindDataRef("sim/custom/xap/mcdu/click_left"); jar_a320_mcdu_click[7] = XPLMFindDataRef("sim/custom/xap/mcdu/click_down"); jar_a320_mcdu_click[8] = XPLMFindDataRef("sim/custom/xap/mcdu/click_right"); jar_a320_mcdu_click[9] = XPLMFindDataRef("sim/custom/xap/mcdu/click_up"); jar_a320_mcdu_click[10] = XPLMFindDataRef("sim/custom/xap/mcdu/click_int"); jar_a320_mcdu_click[11] = XPLMFindDataRef("sim/custom/xap/mcdu/click_prog"); jar_a320_mcdu_click[12] = XPLMFindDataRef("sim/custom/xap/mcdu/click_dir"); jar_a320_mcdu_click[13] = XPLMFindDataRef("sim/custom/xap/mcdu/click_radnav"); jar_a320_mcdu_click[14] = XPLMFindDataRef("sim/custom/xap/mcdu/click_perf"); jar_a320_mcdu_click[15] = XPLMFindDataRef("sim/custom/xap/mcdu/click_dot"); jar_a320_mcdu_click[16] = XPLMFindDataRef("sim/custom/xap/mcdu/click_slash"); jar_a320_mcdu_click[17] = XPLMFindDataRef("sim/custom/xap/mcdu/click_plusmin"); jar_a320_mcdu_click[18] = XPLMFindDataRef("sim/custom/xap/mcdu/click_sp"); jar_a320_mcdu_click[19] = XPLMFindDataRef("sim/custom/xap/mcdu/click_ovfy"); jar_a320_mcdu_click[20] = XPLMFindDataRef("sim/custom/xap/mcdu/click_clr"); jar_a320_mcdu_click[21] = XPLMFindDataRef("sim/custom/xap/mcdu/click_l1"); jar_a320_mcdu_click[22] = XPLMFindDataRef("sim/custom/xap/mcdu/click_l2"); jar_a320_mcdu_click[23] = XPLMFindDataRef("sim/custom/xap/mcdu/click_l3"); jar_a320_mcdu_click[24] = XPLMFindDataRef("sim/custom/xap/mcdu/click_l4"); jar_a320_mcdu_click[25] = XPLMFindDataRef("sim/custom/xap/mcdu/click_l5"); jar_a320_mcdu_click[26] = XPLMFindDataRef("sim/custom/xap/mcdu/click_l6"); jar_a320_mcdu_click[27] = XPLMFindDataRef("sim/custom/xap/mcdu/click_r1"); jar_a320_mcdu_click[28] = XPLMFindDataRef("sim/custom/xap/mcdu/click_r2"); jar_a320_mcdu_click[29] = XPLMFindDataRef("sim/custom/xap/mcdu/click_r3"); jar_a320_mcdu_click[30] = XPLMFindDataRef("sim/custom/xap/mcdu/click_r4"); jar_a320_mcdu_click[31] = XPLMFindDataRef("sim/custom/xap/mcdu/click_r5"); jar_a320_mcdu_click[32] = XPLMFindDataRef("sim/custom/xap/mcdu/click_r6"); jar_a320_mcdu_click[33] = XPLMFindDataRef("sim/custom/xap/mcdu/click_0"); jar_a320_mcdu_click[34] = XPLMFindDataRef("sim/custom/xap/mcdu/click_1"); jar_a320_mcdu_click[35] = XPLMFindDataRef("sim/custom/xap/mcdu/click_2"); jar_a320_mcdu_click[36] = XPLMFindDataRef("sim/custom/xap/mcdu/click_3"); jar_a320_mcdu_click[37] = XPLMFindDataRef("sim/custom/xap/mcdu/click_4"); jar_a320_mcdu_click[38] = XPLMFindDataRef("sim/custom/xap/mcdu/click_5"); jar_a320_mcdu_click[39] = XPLMFindDataRef("sim/custom/xap/mcdu/click_6"); jar_a320_mcdu_click[40] = XPLMFindDataRef("sim/custom/xap/mcdu/click_7"); jar_a320_mcdu_click[41] = XPLMFindDataRef("sim/custom/xap/mcdu/click_8"); jar_a320_mcdu_click[42] = XPLMFindDataRef("sim/custom/xap/mcdu/click_9"); jar_a320_mcdu_click[43] = XPLMFindDataRef("sim/custom/xap/mcdu/click_a"); jar_a320_mcdu_click[44] = XPLMFindDataRef("sim/custom/xap/mcdu/click_b"); jar_a320_mcdu_click[45] = XPLMFindDataRef("sim/custom/xap/mcdu/click_c"); jar_a320_mcdu_click[46] = XPLMFindDataRef("sim/custom/xap/mcdu/click_d"); jar_a320_mcdu_click[47] = XPLMFindDataRef("sim/custom/xap/mcdu/click_e"); jar_a320_mcdu_click[48] = XPLMFindDataRef("sim/custom/xap/mcdu/click_f"); jar_a320_mcdu_click[49] = XPLMFindDataRef("sim/custom/xap/mcdu/click_g"); jar_a320_mcdu_click[50] = XPLMFindDataRef("sim/custom/xap/mcdu/click_h"); jar_a320_mcdu_click[51] = XPLMFindDataRef("sim/custom/xap/mcdu/click_i"); jar_a320_mcdu_click[52] = XPLMFindDataRef("sim/custom/xap/mcdu/click_j"); jar_a320_mcdu_click[53] = XPLMFindDataRef("sim/custom/xap/mcdu/click_k"); jar_a320_mcdu_click[54] = XPLMFindDataRef("sim/custom/xap/mcdu/click_l"); jar_a320_mcdu_click[55] = XPLMFindDataRef("sim/custom/xap/mcdu/click_m"); jar_a320_mcdu_click[56] = XPLMFindDataRef("sim/custom/xap/mcdu/click_n"); jar_a320_mcdu_click[57] = XPLMFindDataRef("sim/custom/xap/mcdu/click_o"); jar_a320_mcdu_click[58] = XPLMFindDataRef("sim/custom/xap/mcdu/click_p"); jar_a320_mcdu_click[59] = XPLMFindDataRef("sim/custom/xap/mcdu/click_q"); jar_a320_mcdu_click[60] = XPLMFindDataRef("sim/custom/xap/mcdu/click_r"); jar_a320_mcdu_click[61] = XPLMFindDataRef("sim/custom/xap/mcdu/click_s"); jar_a320_mcdu_click[62] = XPLMFindDataRef("sim/custom/xap/mcdu/click_t"); jar_a320_mcdu_click[63] = XPLMFindDataRef("sim/custom/xap/mcdu/click_u"); jar_a320_mcdu_click[64] = XPLMFindDataRef("sim/custom/xap/mcdu/click_v"); jar_a320_mcdu_click[65] = XPLMFindDataRef("sim/custom/xap/mcdu/click_w"); jar_a320_mcdu_click[66] = XPLMFindDataRef("sim/custom/xap/mcdu/click_x"); jar_a320_mcdu_click[67] = XPLMFindDataRef("sim/custom/xap/mcdu/click_y"); jar_a320_mcdu_click[68] = XPLMFindDataRef("sim/custom/xap/mcdu/click_z"); // SD_PAGE Display jar_a320_disp_sys_mode = XPLMFindDataRef("sim/custom/xap/disp/sys/mode"); findJar_a320MsgDataRefs(); } } } float checkJarA320NeoCallback( float inElapsedSinceLastCall, float inElapsedTimeSinceLastFlightLoop, int inCounter, void * inRefcon) { findJarA320NeoDataRefs(); // come back in 5sec return 5.0; } void writeJarA320neoDataRef(int id, float value) { char info_string[80]; sprintf(info_string, "XHSI: received JarDesign A320 data: ID=%d VALUE=%f\n", id, value); XPLMDebugString(info_string); switch (id) { case JAR_A320NEO_MCDU_CLICK : if ((value >= 0) && (value <= 68)) XPLMSetDatai(jar_a320_mcdu_click[(int)value], 1); break; case JAR_A320NEO_SD_PAGE : if ((value >= 0) && (value <= 11)) XPLMSetDatai(jar_a320_disp_sys_mode,(int)value); break; } }
dcf321d01a580f39cf2dec564f35bda2d0202f23
1b2c0284370ebef255a1fbe8027f059022946f56
/source/Hllc.cpp
1d75036bf1254383134dd8e8eef4df7f7179cd2a
[]
no_license
eladtan/Eulerian1D
dbe5172e198d08276dac5f37fceb0d0c0f17b2b6
d17829429640cf887339f2c141dafd85a9a5ed7d
refs/heads/master
2020-04-17T05:25:15.428769
2020-04-12T19:44:08
2020-04-12T19:44:08
166,277,961
0
0
null
null
null
null
UTF-8
C++
false
false
5,913
cpp
Hllc.cpp
#include "Hllc.hpp" #include <algorithm> #include <cmath> namespace { void PrimitiveToConserved(Primitive const& cell, Extensive &res) { res.mass = cell.density; res.momentum = cell.velocity; res.momentum *= res.mass; res.energy = res.mass*0.5*cell.velocity*cell.velocity + cell.energy*res.mass; } void starred_state(Primitive const& state, double sk, double ss, Extensive &res) { const double dk = state.density; const double pk = state.pressure; const double uk = state.velocity; const double ds = dk * (sk - uk) / (sk - ss); const double ek = state.density*(0.5*state.velocity*state.velocity + state.energy); res.mass = ds; res.momentum = ds * ss; res.energy = ek * ds / dk + ds * (ss - uk)*(ss + pk / dk / (sk - uk)); } class WaveSpeeds { public: WaveSpeeds(double left_i, double center_i, double right_i, double ps_i) : left(left_i), center(center_i), right(right_i), ps(ps_i) {} WaveSpeeds& operator=(WaveSpeeds const& ws) { left = ws.left; center = ws.center; right = ws.right; ps = ws.ps; return *this; } double left; double center; double right; double ps; }; double Hll_pstar(Primitive const& left, Primitive const& right, IdealGas const& eos) { double cl = eos.dp2c(left.density, left.pressure); double cr = eos.dp2c(right.density, right.pressure); double sl = std::min(left.velocity - cl, right.velocity - cr); double sr = std::max(left.velocity + cl, right.velocity + cr); Extensive Fl; Fl.mass = left.velocity*left.density; Fl.momentum = left.velocity*Fl.mass + left.pressure; Fl.energy = left.velocity*(left.pressure + left.energy*left.density + 0.5*Fl.mass*left.velocity); Extensive Fr; Fr.mass = right.velocity*right.density; Fr.momentum = right.velocity*Fr.mass + right.pressure; Fr.energy = right.velocity*(right.pressure + right.energy*right.density + 0.5*Fr.mass*right.velocity); Extensive Ull; double denom = 1.0 / (sr - sl); Ull.mass = (sr*right.density - sl * left.density + Fl.mass - Fr.mass)*denom; Ull.momentum = (sr*right.density*right.velocity - sl * left.density*left.velocity + Fl.momentum - Fr.momentum)*denom; Ull.energy = (sr*right.density*(right.energy + 0.5*right.velocity*right.velocity) - sl * left.density*(0.5*left.velocity*left.velocity + left.energy) + Fl.energy - Fr.energy)*denom; double pstar = eos.de2p(Ull.mass, std::max(0.0,(Ull.energy - Ull.momentum*Ull.momentum*0.5) / Ull.mass)); return pstar; } WaveSpeeds estimate_wave_speeds(Primitive const& left, Primitive const& right, IdealGas const &eos, double pstar) { double cl = 0, cr = 0; const double dl = left.density; const double pl = left.pressure; const double vl = left.velocity; cl = eos.dp2c(dl, pl); const double dr = right.density; const double pr = right.pressure; const double vr = right.velocity; cr = eos.dp2c(dr, pr); const double sl = vl - cl * (pstar > pl ? std::sqrt(0.8*(pstar / pl - 1) + 1) : 1); const double sr = vr + cr * (pstar > pr ? std::sqrt(0.8*(pstar / pr - 1) + 1) : 1); const double denom = 1.0 / (dl*(sl - vl) - dr * (sr - vr)); const double ss = (pr - pl + dl * vl*(sl - vl) - dr * vr*(sr - vr)) *denom; const double ps = std::max(0.0, dl * (sl - vl)*(pr - dr * (vr - vl)*(sr - vr)) *denom - pl * dr*(sr - vr) *denom); return WaveSpeeds(sl, ss, sr, ps); } } Hllc::Hllc(bool iter) :iter_(iter) {} Extensive Hllc::SolveRS(Primitive const& left, Primitive const& right, IdealGas const& eos,double vface) const { double pstar = Hll_pstar(left, right, eos); pstar = std::max(pstar, 0.0); pstar = 0; WaveSpeeds ws2 = estimate_wave_speeds(left, right, eos, pstar); /*double old_ps = ws2.ps; ws2 = estimate_wave_speeds(left, right, eos, ws2.ps); size_t counter = 0; while (ws2.ps > 1.01 * old_ps || old_ps > 1.01 * ws2.ps) { old_ps = ws2.ps; ws2 = estimate_wave_speeds(left, right, eos, ws2.ps); ++counter; }*/ Extensive Fl; Fl.mass = left.velocity*left.density; Fl.momentum = left.velocity*Fl.mass + left.pressure; Fl.energy = left.velocity*(left.pressure + left.energy*left.density + 0.5*Fl.mass*left.velocity); Fl.entropy = left.entropy*Fl.mass; Extensive Fr; Fr.mass = right.velocity*right.density; Fr.momentum = right.velocity*Fr.mass + right.pressure; Fr.energy = right.velocity*(right.pressure + right.energy*right.density + 0.5*Fr.mass*right.velocity); Fr.entropy = right.entropy*Fr.mass; Extensive ul, ur, usl, usr; PrimitiveToConserved(left, ul); PrimitiveToConserved(right, ur); starred_state(left, ws2.left, ws2.center, usl); starred_state(right, ws2.right, ws2.center, usr); if (ws2.left > vface) { Fl.mass -= vface * left.density; Fl.momentum -= vface * left.density*left.velocity; Fl.energy -= vface* (left.pressure + left.energy*left.density + 0.5*left.density*left.velocity*left.velocity); Fl.entropy = Fl.mass*left.entropy; return Fl; } else if (ws2.left <= vface && ws2.center >= vface) { Fl.mass += ws2.left*(usl.mass - ul.mass) -usl.mass*vface; Fl.momentum += ws2.left*(usl.momentum - ul.momentum)-usl.momentum*vface; Fl.energy += ws2.left*(usl.energy - ul.energy)-usl.energy*vface; Fl.entropy = Fl.mass*left.entropy; return Fl; } else if (ws2.center < vface && ws2.right >= vface) { Fr.mass += ws2.right*(usr.mass - ur.mass) -usr.mass*vface; Fr.momentum += ws2.right*(usr.momentum - ur.momentum)-usr.momentum*vface; Fr.energy += ws2.right*(usr.energy - ur.energy)-usr.energy*vface; Fr.entropy = Fr.mass*right.entropy; return Fr; } else if (ws2.right < vface) { Fr.mass -= vface * right.density; Fr.momentum -= vface * right.density*right.velocity; Fr.energy -= vface * (right.pressure + right.energy*right.density + 0.5*right.density*right.velocity*right.velocity); Fr.entropy = Fl.mass*right.entropy; return Fr; } else throw; } Hllc::~Hllc() { }
9d5637ed9a92c1286669f934eb2b5b0bb45edbeb
3a74dcda7094cd8b0dc18dcebc913be1f4be0900
/ndim/buffer.h
c89d84f974464169e366a0e5bc73c33e52bd163c
[]
no_license
dejfh/nicos-livewidget-ng
05cbeae01494d61bd00bac817a525317dc0e674a
6b095aafb51bb7a849dd85371421edbceea4b1ae
refs/heads/master
2021-01-10T11:56:44.485059
2016-12-20T22:18:41
2016-12-20T22:18:41
54,557,472
0
0
null
null
null
null
UTF-8
C++
false
false
2,238
h
buffer.h
#ifndef NDIM_VECTOR_H #define NDIM_VECTOR_H #include <vector> #include <numeric> #include <ndim/pointer.h> #include <ndim/layout.h> #include <ndim/algorithm.h> namespace ndim { template <typename _T, size_t _D> class Buffer { ndim::sizes<_D> m_sizes; std::vector<_T> m_data; public: size_t size() const { return m_data.size(); } const ndim::sizes<_D> &sizes() const { return m_sizes; } const _T *data() const { return m_data.data(); } _T *data() { return m_data.data(); } ndim::pointer<_T, _D> pointer() { return ndim::pointer<_T, _D>(m_data.data(), m_sizes); } ndim::pointer<const _T, _D> cpointer() const { return ndim::pointer<const _T, _D>(m_data.data(), m_sizes); } ndim::layout<_D> layout() const { return ndim::layout<_D>(m_sizes); } operator ndim::pointer<_T, _D>() { return pointer(); } operator ndim::pointer<const _T, _D>() { return pointer(); } operator const ndim::layout<_D>() { return layout(); } Buffer() { m_sizes.fill(0); } explicit Buffer(std::vector<_T> &&data, std::array<size_t, _D> sizes) : m_sizes(sizes) , m_data(std::move(data)) { } explicit Buffer(ndim::sizes<_D> sizes) : m_sizes(sizes) , m_data(sizes.size()) { } explicit Buffer(ndim::pointer<_T, _D> data) : m_sizes(data.sizes) { m_data.resize(data.size()); ndim::copy(data, *this); } void resize(ndim::sizes<_D> sizes) { m_data.resize(sizes.size()); m_sizes = sizes; } Buffer<_T, _D> &operator=(ndim::pointer<_T, _D> data) { m_data.resize(data.size()); m_sizes = data.sizes; ndim::copy(data, *this); return *this; } template <typename _T_other, typename = typename std::enable_if<std::is_same<typename std::remove_cv<_T>::type, _T_other>::value>::type> explicit Buffer(ndim::pointer<_T_other, _D> data) : m_sizes(data.sizes) { m_data.resize(data.size()); ndim::copy(data, *this); } template <typename _T_other, typename = typename std::enable_if<std::is_same<typename std::remove_cv<_T>::type, _T_other>::value>::type> Buffer<_T, _D> &operator=(ndim::pointer<_T_other, _D> data) { m_data.resize(data.size()); m_sizes = data.sizes; ndim::copy(data, *this); return *this; } }; } // namespace ndim #endif // NDIM_VECTOR_H
7783d5be680b83574bf9f6aed74d5baab14baeb8
1b924352b9d2735d42db41c0745dea1306332f32
/src/LNG/LNGclock.cpp
61d9ea3315556503d38846678d27ed50580a9167
[]
no_license
umika/LNG
370b8400c3db0fc8d202a5c424fa1df25707f9ef
9f1e50e6e7a66c4791d9547e2c5ec0335ca94ab9
refs/heads/master
2020-06-06T11:46:27.218844
2012-10-15T20:20:53
2012-10-15T20:20:53
5,910,701
1
1
null
null
null
null
UTF-8
C++
false
false
1,151
cpp
LNGclock.cpp
/* LNGclock.cpp */ #include <LNG/LNGclock.h> using namespace std; LNGcoord3f const LNGclock::default_pos(0.0, 0.0, 0.0); LNGcolor4f const LNGclock::default_col(1.0, 1.0, 1.0, 1.0); LNGclock::LNGclock(GLuint a_fps_desired) : fps_pos(default_pos), fps_col(default_col), fps_desired(a_fps_desired), fps_visible(true), fps(0), fps_clk(0), fps_pclk(0), fps_nclk(0), frames(0) { } LNGclock::~LNGclock() { } void LNGclock::FPS(void) { ++frames; fps_clk = glutGet(GLUT_ELAPSED_TIME); // has limited resolution if(fps_clk < fps_nclk) return; fps = frames; fps_pclk = fps_clk; fps_nclk = fps_clk + 1000; frames = 0; } void LNGclock::FPSdisplay(void) { if(!FPSvisible()) return; ostringstream oss; oss << fps << " FPS"; string &s = oss.str(); glDisable(GL_TEXTURE_2D); glColor4f(fps_col.r, fps_col.g, fps_col.b, fps_col.a); // glWindowPos2f(0.0, 0.0); // glRasterPos2f(0.0, 0.0); glRasterPos3f(fps_pos.x, fps_pos.y, fps_pos.z); for(string::iterator it = s.begin(); it != s.end(); ++it) glutBitmapCharacter(GLUT_BITMAP_HELVETICA_10, *it); glEnable(GL_TEXTURE_2D); #ifdef _DEBUG cout << s << endl; #endif }
81cd13c77306e24b9a3a72f5f580ff9c4b5282ec
9b12e4ecf154aca14991eb27320906ff46c50a88
/src/Utility/Utility.h
d5c2f9ac99b6c782e7f1cfd43fa47062bbeed04f
[ "MIT" ]
permissive
MavrClassic/mkxai
ef2d2017f384fb68eaf565b1353c48d0ac13c725
a49979a57ce08bfe60b2fefa7e37d9292379f246
refs/heads/master
2023-04-24T02:32:23.200241
2018-08-19T17:11:58
2018-08-19T17:11:58
null
0
0
null
null
null
null
UTF-8
C++
false
false
585
h
Utility.h
#ifndef UTILITY_H #define UTILITY_H #include <vector> namespace Utility { double SigmoidFunction( double value ); double MSE( const std::vector<double>& outputs, const std::vector<double>& values ); template<typename T, typename U = std::allocator<T>> double Distance( const std::vector<T,U>& outputs, const std::vector<T,U>& values ) { double total = 0.0; for( size_t i = 0; i < outputs.size(); ++i ) { total += std::pow( outputs[i] - values[i], 2 ); } return std::pow( total, 0.5 ); } } #endif // !UTILITY_H
2afddbf94eb26b7e3d0ab27c3bd22402edc1b111
7850cecd7a1476ca48f082faa5acd30c08eef1b1
/mcu/src/xmlrpcmediagateway.cpp
72f428b7578afd97aa9c51d00516232413e45192
[]
no_license
InteractiviteVideoEtSystemes/mediaserver
abc68705cf0a4e228deff2107fd8ebc6990cd5f6
b6c965d9a8d62957d8636b3f5fc65391460cd55e
refs/heads/master
2023-07-06T01:53:45.862522
2023-03-28T06:41:05
2023-03-28T06:41:05
48,166,471
5
3
null
2022-06-10T13:00:55
2015-12-17T09:56:12
C++
UTF-8
C++
false
false
22,981
cpp
xmlrpcmediagateway.cpp
#include <stdio.h> #include <stdlib.h> #include "xmlhandler.h" #include "mediagateway.h" #include "codecs.h" xmlrpc_value* MediaGatewayCreateMediaBridge(xmlrpc_env *env, xmlrpc_value *param_array, void *user_data) { UTF8Parser nameParser; MediaGateway *mediaGateway = (MediaGateway *)user_data; MediaBridgeSession *session = NULL; //Parseamos char *str; xmlrpc_parse_value(env, param_array, "(s)", &str); //Parse string nameParser.Parse((BYTE*)str,strlen(str)); //Creamos la sessionerencia int sessionId = mediaGateway->CreateMediaBridge(nameParser.GetWString()); //Obtenemos la referencia if(!mediaGateway->GetMediaBridgeRef(sessionId,&session)) return xmlerror(env,"Session deleted before inited\n"); //Si error if (!sessionId>0) return xmlerror(env,"Could not create session"); //La iniciamos bool res = session->Init(mediaGateway->getEventMngr() ); Log(">xmlrpcmediagateway queueId=%i\n",mediaGateway->getQueueId()); session->setQueueId(mediaGateway->getQueueId()); //Liberamos la referencia mediaGateway->ReleaseMediaBridgeRef(sessionId); //Salimos if(!res) return xmlerror(env,"Could not start bridge\n"); //Devolvemos el resultado return xmlok(env,xmlrpc_build_value(env,"(i)",sessionId)); } xmlrpc_value* MediaGatewayDeleteMediaBridge(xmlrpc_env *env, xmlrpc_value *param_array, void *user_data) { MediaGateway *mediaGateway = (MediaGateway *)user_data; //Parseamos int sessionId; xmlrpc_parse_value(env, param_array, "(i)", &sessionId); //Comprobamos si ha habido error if(env->fault_occurred) return 0; //Delete sessionerence if (!mediaGateway->DeleteMediaBridge(sessionId)) return xmlerror(env,"Session does not exist"); //Devolvemos el resultado return xmlok(env); } xmlrpc_value* MediaGatewaySetMediaBridgeInputToken(xmlrpc_env *env, xmlrpc_value *param_array, void *user_data) { UTF8Parser parser; MediaGateway *mediaGateway = (MediaGateway *)user_data; //Parseamos int sessionId; char *str; xmlrpc_parse_value(env, param_array, "(is)", &sessionId, &str); //Comprobamos si ha habido error if(env->fault_occurred) return 0; //Parse string parser.Parse((BYTE*)str,strlen(str)); //La borramos bool res = mediaGateway->SetMediaBridgeInputToken(sessionId,parser.GetWString()); //Salimos if(!res) return xmlerror(env,"Could not set input token for media bridge\n"); //Devolvemos el resultado return xmlok(env); } xmlrpc_value* MediaGatewaySetMediaBridgeOutputToken(xmlrpc_env *env, xmlrpc_value *param_array, void *user_data) { UTF8Parser parser; MediaGateway *mediaGateway = (MediaGateway *)user_data; //Parseamos int sessionId; char *str; xmlrpc_parse_value(env, param_array, "(is)", &sessionId, &str); //Comprobamos si ha habido error if(env->fault_occurred) return 0; //Parse string parser.Parse((BYTE*)str,strlen(str)); //La borramos bool res = mediaGateway->SetMediaBridgeOutputToken(sessionId,parser.GetWString()); //Salimos if(!res) return xmlerror(env,"Could not set output token to bridge session\n"); //Devolvemos el resultado return xmlok(env); } xmlrpc_value* MediaGatewayStartSendingVideo(xmlrpc_env *env, xmlrpc_value *param_array, void *user_data) { MediaGateway *mediaGateway = (MediaGateway *)user_data; MediaBridgeSession *session = NULL; //Parseamos int sessionId; char *sendVideoIp; int sendVideoPort; xmlrpc_value *rtpMap; xmlrpc_parse_value(env, param_array, "(isiS)", &sessionId,&sendVideoIp,&sendVideoPort,&rtpMap); //Comprobamos si ha habido error if(env->fault_occurred) return 0; //Get the rtp map RTPMap map; //Get map size int j = xmlrpc_struct_size(env,rtpMap); //Parse rtp map for (int i=0;i<j;i++) { xmlrpc_value *key, *val; const char *type; int codec; //Read member xmlrpc_struct_read_member(env,rtpMap,i,&key,&val); //Read name xmlrpc_parse_value(env,key,"s",&type); //Read value xmlrpc_parse_value(env,val,"i",&codec); //Add to map map[atoi(type)] = codec; //Decrement ref counter xmlrpc_DECREF(key); xmlrpc_DECREF(val); } //Obtenemos la referencia if(!mediaGateway->GetMediaBridgeRef(sessionId,&session)) return xmlerror(env,"La sessionerencia no existe\n"); //La borramos int res = session->StartSendingVideo(sendVideoIp,sendVideoPort,map); //Liberamos la referencia mediaGateway->ReleaseMediaBridgeRef(sessionId); //Salimos if(!res) return xmlerror(env,"Error\n"); //Devolvemos el resultado return xmlok(env); } xmlrpc_value* MediaGatewayStopSendingVideo(xmlrpc_env *env, xmlrpc_value *param_array, void *user_data) { MediaGateway *mediaGateway = (MediaGateway *)user_data; MediaBridgeSession *session = NULL; //Parseamos int sessionId; xmlrpc_parse_value(env, param_array, "(i)", &sessionId); //Comprobamos si ha habido error if(env->fault_occurred) return 0; //Obtenemos la referencia if(!mediaGateway->GetMediaBridgeRef(sessionId,&session)) return xmlerror(env,"La sessionerencia no existe\n"); //La borramos int res = session->StopSendingVideo(); //Liberamos la referencia mediaGateway->ReleaseMediaBridgeRef(sessionId); //Salimos if(!res) return xmlerror(env,"No se ha podido terminar la sessionerencia\n"); //Devolvemos el resultado return xmlok(env); } xmlrpc_value* MediaGatewayStartReceivingVideo(xmlrpc_env *env, xmlrpc_value *param_array, void *user_data) { MediaGateway *mediaGateway = (MediaGateway *)user_data; MediaBridgeSession *session = NULL; //Parseamos int sessionId; xmlrpc_value *rtpMap; xmlrpc_parse_value(env, param_array, "(iS)", &sessionId,&rtpMap); //Comprobamos si ha habido error if(env->fault_occurred) return 0; //Get the rtp map RTPMap map; //Get map size int j = xmlrpc_struct_size(env,rtpMap); //Parse rtp map for (int i=0;i<j;i++) { xmlrpc_value *key, *val; const char *type; int codec; //Read member xmlrpc_struct_read_member(env,rtpMap,i,&key,&val); //Read name xmlrpc_parse_value(env,key,"s",&type); //Read value xmlrpc_parse_value(env,val,"i",&codec); //Add to map map[atoi(type)] = codec; //Decrement ref counter xmlrpc_DECREF(key); xmlrpc_DECREF(val); } //Obtenemos la referencia if(!mediaGateway->GetMediaBridgeRef(sessionId,&session)) return xmlerror(env,"La sessionerencia no existe\n"); //La borramos int recVideoPort = session->StartReceivingVideo(map); //Liberamos la referencia mediaGateway->ReleaseMediaBridgeRef(sessionId); //Salimos if(!recVideoPort) return xmlerror(env,"No se ha podido terminar la sessionerencia\n"); //Devolvemos el resultado return xmlok(env,xmlrpc_build_value(env,"(i)",recVideoPort)); } xmlrpc_value* MediaGatewayStopReceivingVideo(xmlrpc_env *env, xmlrpc_value *param_array, void *user_data) { MediaGateway *mediaGateway = (MediaGateway *)user_data; MediaBridgeSession *session = NULL; //Parseamos int sessionId; xmlrpc_parse_value(env, param_array, "(i)", &sessionId); //Comprobamos si ha habido error if(env->fault_occurred) return 0; //Obtenemos la referencia if(!mediaGateway->GetMediaBridgeRef(sessionId,&session)) return xmlerror(env,"La sessionerencia no existe\n"); //La borramos int res = session->StopReceivingVideo(); //Liberamos la referencia mediaGateway->ReleaseMediaBridgeRef(sessionId); //Salimos if(!res) return xmlerror(env,"Error\n"); //Devolvemos el resultado return xmlok(env); } xmlrpc_value* MediaGatewayStartSendingAudio(xmlrpc_env *env, xmlrpc_value *param_array, void *user_data) { MediaGateway *mediaGateway = (MediaGateway *)user_data; MediaBridgeSession *session = NULL; //Parseamos int sessionId; char *sendAudioIp; int sendAudioPort; xmlrpc_value *rtpMap; xmlrpc_parse_value(env, param_array, "(isiS)", &sessionId,&sendAudioIp,&sendAudioPort,&rtpMap); //Comprobamos si ha habido error if(env->fault_occurred) return 0; //Get the rtp map RTPMap map; int j = xmlrpc_struct_size(env,rtpMap); //Parse rtp map for (int i=0;i<j;i++) { xmlrpc_value *key, *val; const char *type; int codec; //Read member xmlrpc_struct_read_member(env,rtpMap,i,&key,&val); //Read name xmlrpc_parse_value(env,key,"s",&type); //Read value xmlrpc_parse_value(env,val,"i",&codec); //Add to map map[atoi(type)] = codec; //Decrement ref counter xmlrpc_DECREF(key); xmlrpc_DECREF(val); } //Obtenemos la referencia if(!mediaGateway->GetMediaBridgeRef(sessionId,&session)) return xmlerror(env,"La sessionerencia no existe\n"); //La borramos int res = session->StartSendingAudio(sendAudioIp,sendAudioPort,map); //Liberamos la referencia mediaGateway->ReleaseMediaBridgeRef(sessionId); //Salimos if(!res) return xmlerror(env,"Error\n"); //Devolvemos el resultado return xmlok(env); } xmlrpc_value* MediaGatewayStopSendingAudio(xmlrpc_env *env, xmlrpc_value *param_array, void *user_data) { MediaGateway *mediaGateway = (MediaGateway *)user_data; MediaBridgeSession *session = NULL; //Parseamos int sessionId; xmlrpc_parse_value(env, param_array, "(i)", &sessionId); //Comprobamos si ha habido error if(env->fault_occurred) return 0; //Obtenemos la referencia if(!mediaGateway->GetMediaBridgeRef(sessionId,&session)) return xmlerror(env,"La sessionerencia no existe\n"); //La borramos int res = session->StopSendingAudio(); //Liberamos la referencia mediaGateway->ReleaseMediaBridgeRef(sessionId); //Salimos if(!res) return xmlerror(env,"No se ha podido terminar la sessionerencia\n"); //Devolvemos el resultado return xmlok(env); } xmlrpc_value* MediaGatewayStartReceivingAudio(xmlrpc_env *env, xmlrpc_value *param_array, void *user_data) { MediaGateway *mediaGateway = (MediaGateway *)user_data; MediaBridgeSession *session = NULL; //Parseamos int sessionId; xmlrpc_value *rtpMap; xmlrpc_parse_value(env, param_array, "(iS)", &sessionId,&rtpMap); //Get the rtp map RTPMap map; int j = xmlrpc_struct_size(env,rtpMap); //Parse rtp map for (int i=0;i<j;i++) { xmlrpc_value *key, *val; const char *type; int codec; //Read member xmlrpc_struct_read_member(env,rtpMap,i,&key,&val); //Read name xmlrpc_parse_value(env,key,"s",&type); //Read value xmlrpc_parse_value(env,val,"i",&codec); //Add to map map[atoi(type)] = codec; //Decrement ref counter xmlrpc_DECREF(key); xmlrpc_DECREF(val); } //Comprobamos si ha habido error if(env->fault_occurred) return 0; //Obtenemos la referencia if(!mediaGateway->GetMediaBridgeRef(sessionId,&session)) return xmlerror(env,"La sessionerencia no existe\n"); //La borramos int recAudioPort = session->StartReceivingAudio(map); //Liberamos la referencia mediaGateway->ReleaseMediaBridgeRef(sessionId); //Salimos if(!recAudioPort) return xmlerror(env,"No se ha podido terminar la sessionerencia\n"); //Devolvemos el resultado return xmlok(env,xmlrpc_build_value(env,"(i)",recAudioPort,recAudioPort)); } xmlrpc_value* MediaGatewayStopReceivingAudio(xmlrpc_env *env, xmlrpc_value *param_array, void *user_data) { MediaGateway *mediaGateway = (MediaGateway *)user_data; MediaBridgeSession *session = NULL; //Parseamos int sessionId; xmlrpc_parse_value(env, param_array, "(i)", &sessionId); //Comprobamos si ha habido error if(env->fault_occurred) return 0; //Obtenemos la referencia if(!mediaGateway->GetMediaBridgeRef(sessionId,&session)) return xmlerror(env,"La sessionerencia no existe\n"); //La borramos int res = session->StopReceivingAudio(); //Liberamos la referencia mediaGateway->ReleaseMediaBridgeRef(sessionId); //Salimos if(!res) return xmlerror(env,"Error\n"); //Devolvemos el resultado return xmlok(env); } xmlrpc_value* MediaGatewayStartSendingText(xmlrpc_env *env, xmlrpc_value *param_array, void *user_data) { MediaGateway *mediaGateway = (MediaGateway *)user_data; MediaBridgeSession *session = NULL; //Parseamos int sessionId; char *sendTextIp; int sendTextPort; xmlrpc_value *rtpMap; xmlrpc_parse_value(env, param_array, "(isiS)", &sessionId,&sendTextIp,&sendTextPort,&rtpMap); //Comprobamos si ha habido error if(env->fault_occurred) return 0; //Get the rtp map RTPMap map; //Get map size int j = xmlrpc_struct_size(env,rtpMap); //Parse rtp map for (int i=0;i<j;i++) { xmlrpc_value *key, *val; const char *type; int codec; //Read member xmlrpc_struct_read_member(env,rtpMap,i,&key,&val); //Read name xmlrpc_parse_value(env,key,"s",&type); //Read value xmlrpc_parse_value(env,val,"i",&codec); //Add to map map[atoi(type)] = codec; //Decrement ref counter xmlrpc_DECREF(key); xmlrpc_DECREF(val); } //Obtenemos la referencia if(!mediaGateway->GetMediaBridgeRef(sessionId,&session)) return xmlerror(env,"La sessionerencia no existe\n"); //La borramos int res = session->StartSendingText(sendTextIp,sendTextPort,map); //Liberamos la referencia mediaGateway->ReleaseMediaBridgeRef(sessionId); //Salimos if(!res) return xmlerror(env,"Error\n"); //Devolvemos el resultado return xmlok(env); } xmlrpc_value* MediaGatewayStopSendingText(xmlrpc_env *env, xmlrpc_value *param_array, void *user_data) { MediaGateway *mediaGateway = (MediaGateway *)user_data; MediaBridgeSession *session = NULL; //Parseamos int sessionId; xmlrpc_parse_value(env, param_array, "(i)", &sessionId); //Comprobamos si ha habido error if(env->fault_occurred) return 0; //Obtenemos la referencia if(!mediaGateway->GetMediaBridgeRef(sessionId,&session)) return xmlerror(env,"La sessionerencia no existe\n"); //La borramos int res = session->StopSendingText(); //Liberamos la referencia mediaGateway->ReleaseMediaBridgeRef(sessionId); //Salimos if(!res) return xmlerror(env,"No se ha podido terminar la sessionerencia\n"); //Devolvemos el resultado return xmlok(env); } xmlrpc_value* MediaGatewayStartReceivingText(xmlrpc_env *env, xmlrpc_value *param_array, void *user_data) { MediaGateway *mediaGateway = (MediaGateway *)user_data; MediaBridgeSession *session = NULL; //Parseamos int sessionId; xmlrpc_value *rtpMap; xmlrpc_parse_value(env, param_array, "(iS)", &sessionId,&rtpMap); //Comprobamos si ha habido error if(env->fault_occurred) return 0; //Get the rtp map RTPMap map; //Get map size int j = xmlrpc_struct_size(env,rtpMap); //Parse rtp map for (int i=0;i<j;i++) { xmlrpc_value *key, *val; const char *type; int codec; //Read member xmlrpc_struct_read_member(env,rtpMap,i,&key,&val); //Read name xmlrpc_parse_value(env,key,"s",&type); //Read value xmlrpc_parse_value(env,val,"i",&codec); //Add to map map[atoi(type)] = codec; //Decrement ref counter xmlrpc_DECREF(key); xmlrpc_DECREF(val); } //Obtenemos la referencia if(!mediaGateway->GetMediaBridgeRef(sessionId,&session)) return xmlerror(env,"La sessionerencia no existe\n"); //La borramos int recTextPort = session->StartReceivingText(map); //Liberamos la referencia mediaGateway->ReleaseMediaBridgeRef(sessionId); //Salimos if(!recTextPort) return xmlerror(env,"No se ha podido terminar la sessionerencia\n"); //Devolvemos el resultado return xmlok(env,xmlrpc_build_value(env,"(i)",recTextPort)); } xmlrpc_value* MediaGatewayStopReceivingText(xmlrpc_env *env, xmlrpc_value *param_array, void *user_data) { MediaGateway *mediaGateway = (MediaGateway *)user_data; MediaBridgeSession *session = NULL; //Parseamos int sessionId; xmlrpc_parse_value(env, param_array, "(i)", &sessionId); //Comprobamos si ha habido error if(env->fault_occurred) return 0; //Obtenemos la referencia if(!mediaGateway->GetMediaBridgeRef(sessionId,&session)) return xmlerror(env,"La sessionerencia no existe\n"); //La borramos int res = session->StopReceivingText(); //Liberamos la referencia mediaGateway->ReleaseMediaBridgeRef(sessionId); //Salimos if(!res) return xmlerror(env,"Error\n"); //Devolvemos el resultado return xmlok(env); } xmlrpc_value* MediaGatewaySetSendingAudioCodec(xmlrpc_env *env, xmlrpc_value *param_array, void *user_data) { MediaGateway *mediaGateway = (MediaGateway *)user_data; MediaBridgeSession *session = NULL; //Parseamos int sessionId; int codec; xmlrpc_parse_value(env, param_array, "(ii)", &sessionId,&codec); //Comprobamos si ha habido error if(env->fault_occurred) return 0; //Obtenemos la referencia if(!mediaGateway->GetMediaBridgeRef(sessionId,&session)) return xmlerror(env,"La sessionerencia no existe\n"); //La borramos int res = session->SetSendingAudioCodec( ( AudioCodec::Type) codec); //Liberamos la referencia mediaGateway->ReleaseMediaBridgeRef(sessionId); //Salimos if(!res) return xmlerror(env,"Error\n"); //Devolvemos el resultado return xmlok(env); } xmlrpc_value* MediaGatewaySetSendingVideoCodec(xmlrpc_env *env, xmlrpc_value *param_array, void *user_data) { MediaGateway *mediaGateway = (MediaGateway *)user_data; MediaBridgeSession *session = NULL; //Parseamos int sessionId; int codec; xmlrpc_parse_value(env, param_array, "(ii)", &sessionId,&codec); //Comprobamos si ha habido error if(env->fault_occurred) return 0; //Obtenemos la referencia if(!mediaGateway->GetMediaBridgeRef(sessionId,&session)) return xmlerror(env,"La sessionerencia no existe\n"); //La borramos int res = session->SetSendingVideoCodec( (VideoCodec::Type ) codec); //Liberamos la referencia mediaGateway->ReleaseMediaBridgeRef(sessionId); //Salimos if(!res) return xmlerror(env,"Error\n"); //Devolvemos el resultado return xmlok(env); } xmlrpc_value* MediaGatewaySetSendingTextCodec(xmlrpc_env *env, xmlrpc_value *param_array, void *user_data) { MediaGateway *mediaGateway = (MediaGateway *)user_data; MediaBridgeSession *session = NULL; //Parseamos int sessionId; int codec; xmlrpc_parse_value(env, param_array, "(ii)", &sessionId,&codec); //Comprobamos si ha habido error if(env->fault_occurred) return 0; //Obtenemos la referencia if(!mediaGateway->GetMediaBridgeRef(sessionId,&session)) return xmlerror(env,"La sessionerencia no existe\n"); //La borramos int res = session->SetSendingTextCodec( (TextCodec::Type) codec); //Liberamos la referencia mediaGateway->ReleaseMediaBridgeRef(sessionId); //Salimos if(!res) return xmlerror(env,"Error\n"); //Devolvemos el resultado return xmlok(env); } xmlrpc_value* MediaGatewaySendFPU(xmlrpc_env *env, xmlrpc_value *param_array, void *user_data) { MediaGateway *mediaGateway = (MediaGateway *)user_data; MediaBridgeSession *session = NULL; //Parseamos int sessionId; xmlrpc_parse_value(env, param_array, "(i)", &sessionId); //Comprobamos si ha habido error if(env->fault_occurred) return 0; //Obtenemos la referencia if(!mediaGateway->GetMediaBridgeRef(sessionId,&session)) return xmlerror(env,"La sessionerencia no existe\n"); //La borramos int res = session->SendFPU(); //Liberamos la referencia mediaGateway->ReleaseMediaBridgeRef(sessionId); //Salimos if(!res) return xmlerror(env,"Error\n"); //Devolvemos el resultado return xmlok(env); } xmlrpc_value* MediaGatewaySendText(xmlrpc_env *env, xmlrpc_value *param_array, void *user_data) { MediaGateway *mediaGateway = (MediaGateway *)user_data; MediaBridgeSession *session = NULL; UTF8Parser Parser; //Parseamos int sessionId; char* text; xmlrpc_parse_value(env, param_array, "(is)", &sessionId, &text); //Comprobamos si ha habido error if(env->fault_occurred) return 0; //Obtenemos la referencia if(!mediaGateway->GetMediaBridgeRef(sessionId,&session)) return xmlerror(env,"La sessionerencia no existe\n"); //La borramos session->SendTextInput(text); //Liberamos la referencia mediaGateway->ReleaseMediaBridgeRef(sessionId); //Devolvemos el resultado return xmlok(env); } xmlrpc_value* MediaGatewaySendSpecial(xmlrpc_env *env, xmlrpc_value *param_array, void *user_data) { MediaGateway *mediaGateway = (MediaGateway *)user_data; MediaBridgeSession *session = NULL; //Parseamos int sessionId; char* cmd; int nbCmd; xmlrpc_parse_value(env, param_array, "(isi)", &sessionId, &cmd,&nbCmd); if (env->fault_occurred) { // Try without role argument xmlrpc_env_clean(env); xmlrpc_env_init(env); nbCmd=1; xmlrpc_parse_value(env, param_array, "(is)", &sessionId, &cmd); } //Comprobamos si ha habido error if(env->fault_occurred) return 0; //Obtenemos la referencia if(!mediaGateway->GetMediaBridgeRef(sessionId,&session)) return xmlerror(env,"La sessionerencia no existe\n"); //La borramos session->SendSpecial(cmd,nbCmd); //Liberamos la referencia mediaGateway->ReleaseMediaBridgeRef(sessionId); //Devolvemos el resultado return xmlok(env); } xmlrpc_value* MediaGatewayEventQueueCreate(xmlrpc_env *env, xmlrpc_value *param_array, void *user_data) { MediaGateway *mediaGateway = (MediaGateway *)user_data; //Create the event queue int queueId = mediaGateway->CreateEventQueue(); //Si error if (!queueId>0) return xmlerror(env,"Could not create event queue"); //Devolvemos el resultado return xmlok(env,xmlrpc_build_value(env,"(i)",queueId)); } xmlrpc_value* MediaGatewayEventQueueDelete(xmlrpc_env *env, xmlrpc_value *param_array, void *user_data) { MediaGateway *mediaGateway = (MediaGateway *)user_data; //Parseamos int queueId; xmlrpc_parse_value(env, param_array, "(i)", &queueId); //Comprobamos si ha habido error if(env->fault_occurred) xmlerror(env,"Fault occurred"); //Delete event queue if (!mediaGateway->DeleteEventQueue(queueId)) return xmlerror(env,"Event queue does not exist"); //Devolvemos el resultado return xmlok(env); } XmlHandlerCmd mediagatewayCmdList[] = { {"EventQueueCreate", MediaGatewayEventQueueCreate}, {"EventQueueDelete", MediaGatewayEventQueueDelete}, {"CreateMediaBridge", MediaGatewayCreateMediaBridge}, {"SetMediaBridgeInputToken", MediaGatewaySetMediaBridgeInputToken}, {"SetMediaBridgeOutputToken", MediaGatewaySetMediaBridgeOutputToken}, {"StartSendingVideo", MediaGatewayStartSendingVideo}, {"StopSendingVideo", MediaGatewayStopSendingVideo}, {"StartReceivingVideo", MediaGatewayStartReceivingVideo}, {"StopReceivingVideo", MediaGatewayStopReceivingVideo}, {"StartSendingAudio", MediaGatewayStartSendingAudio}, {"StopSendingAudio", MediaGatewayStopSendingAudio}, {"StartReceivingAudio", MediaGatewayStartReceivingAudio}, {"StopReceivingAudio", MediaGatewayStopReceivingAudio}, {"StartSendingText", MediaGatewayStartSendingText}, {"StopSendingText", MediaGatewayStopSendingText}, {"StartReceivingText", MediaGatewayStartReceivingText}, {"StopReceivingText", MediaGatewayStopReceivingText}, {"SetSendingAudioCodec", MediaGatewaySetSendingAudioCodec}, {"SetSendingVideoCodec", MediaGatewaySetSendingVideoCodec}, {"SetSendingTextCodec", MediaGatewaySetSendingTextCodec}, {"DeleteMediaBridge", MediaGatewayDeleteMediaBridge}, {"SendFPU", MediaGatewaySendFPU}, {"SendText", MediaGatewaySendText}, {"SendSpecial", MediaGatewaySendSpecial}, {NULL,NULL} };
24a2a45a7b576fcd639fa695971c1692c2dd53f0
d7bb62fada3069726209bfaa45d7f509924f1f8a
/exercise/src/IMSRGInf.cpp
0a97463b9aa66c9e185c9f460816bcf40d930d21
[]
no_license
Rody50/Geant4
833929cf50e248ef85720f6e05b7cbe805ed32b2
22c67e725d497318cd3e6731c867614043522c4c
refs/heads/master
2020-03-23T04:42:31.325668
2018-08-13T10:13:39
2018-08-13T10:13:39
141,100,481
1
1
null
null
null
null
UTF-8
C++
false
false
3,377
cpp
IMSRGInf.cpp
#include "IMSRGInf.h" #include <fstream> #include <iostream> #include <string> using std::cout; using std::endl; using std::ofstream; using std::to_string; using std::flush; IMSRGInf::IMSRGInf(P_group_t *p, InfiniteMatterSP *infSP, double deltaS) : fA(p->nhh), fNu(p->npp), fP(p), fDeltaS(deltaS), fHamil0(p->np, p->np, fill::zeros), fHamilS(p->np, p->np, fill::zeros), fF(p->np, p->np, fill::zeros), fV(p->np, p->np, fill::zeros), fEta(p->np, p->np, fill::zeros), fOmega(p->np, p->np, fill::zeros), fInfSP(infSP) { cout << "npp: " << p->npp << "\tnhh: " << p->nhh << "\tnph: " << p->nph << "\tnp: " << p->np << endl; FillMatrix::FillV(fV, p, fInfSP); FillMatrix::FillEta(fEta, fV, p, this); FillMatrix::FillF(fF, p, this); //cout << "The eta matrix: " << endl; //fEta.print(); fHamil0 = fF + fV; fHamilS = fHamil0; //cout << "The omega matrix:" << endl; //fOmega.print(); } inline int r2(int *p){ return p[0]*p[0]+p[1]*p[1]+p[2]*p[2]; } inline double fact(int n) { int s = 1; for (int i = 1; i <= n; i++) { s *= i; } return s; } double IMSRGInf::F(qState *s) { vector<qState> &states = fInfSP->GetfStates(); int n[3] = {s->nx, s->ny, s->nz}; const double u = fInfSP->GetfEnUn(); double v = 0.; for(auto &t : states){ if(t.isHole){ v += fInfSP->Minnesota(*s, t, *s, t); } } return r2(n) * u + v; } double IMSRGInf::FSum(pair_t *tpp, pair_t *shh) { vector<qState> &states = fInfSP->GetfStates(); qState *a = &states[tpp->i]; qState *b = &states[tpp->j]; qState *i = &states[shh->i]; qState *j = &states[shh->j]; int na[3] = {a->nx, a->ny, a->nz}; int nb[3] = {b->nx, b->ny, b->nz}; int ni[3] = {i->nx, i->ny, i->nz}; int nj[3] = {j->nx, j->ny, j->nz}; const double u = fInfSP->GetfEnUn(); double va = 0., vb = 0., vi = 0., vj = 0.; for(auto &t : states){ if(t.isHole){ va += fInfSP->Minnesota(*a, t, *a, t); vb += fInfSP->Minnesota(*b, t, *b, t); vi += fInfSP->Minnesota(*i, t, *i, t); vj += fInfSP->Minnesota(*j, t, *j, t); } } double fa = r2(na) * u + va; double fb = r2(nb) * u + vb; double fi = r2(ni) * u + vi; double fj = r2(nj) * u + vj; return fa + fb - fi - fj; } mat IMSRGInf::Commute(const mat &a, const mat &b) { return a * b - b * a; } void IMSRGInf::UpdateOm() { fOmega += fEta + fEta * fDeltaS + 1 / 2 * Commute(fEta * fDeltaS, fOmega) + 1 / 12 * (Commute(fEta * fDeltaS, Commute(fEta * fDeltaS, fOmega)) + Commute( fOmega, Commute(fOmega, fEta * fDeltaS))) - 1 / 24 * Commute(fOmega, Commute( fEta * fDeltaS, Commute(fEta * fDeltaS, fOmega))); } void IMSRGInf::UpdateEta() { int nhh = fP->nhh, npp = fP->npp, nph = fP->nph; fEta(span(0, nhh-1), span(nhh+nph, nhh+nph+npp-1)) = fHamilS(span(0, nhh-1), span(nhh+nph, nhh+nph+npp-1)); fEta(span(nhh+nph, nhh+nph+npp-1), span(0, nhh-1)) = fHamilS(span(nhh+nph, nhh+nph+npp-1), span(0, nhh-1)); } double IMSRGInf::Iterate() { double corr_en; while (norm(fEta, "fro") > 1E-5) { mat temp = fHamilS; int n = 0; UpdateOm(); while (norm(temp, "fro") > 0.5) { temp = Commute(fOmega, temp); fHamilS += 1 / fact(n) * temp; n++; } UpdateEta(); } fHamilS.print(); // int n0 = 0; // mat temp0 = fHamil0; // while (norm(temp0, "fro") > 0.5) // { // temp = Commute(fOmega, temp0); // fHamil0 += 1 / fact(n0) * temp0; // n0++; // } // Sum(fHamil0); return 0.; }
23ba6921486ff984b57aa1d9f9da3d5ddc1c3cd2
0b11331f287fd46024fae3e44ece7fd5256ad093
/excel/compoundfile/compoundfile_stream.cpp
707b1ac3ffb759dde767e51592234b74f7fff282
[ "MIT" ]
permissive
hulaishun/read-excel
46827d75536d891da3106fe8088c59133374d9ca
c731e4fda2bbd9cbba75b81bc7668033065aa5b3
refs/heads/master
2021-05-08T20:50:47.660393
2017-12-03T13:47:38
2017-12-03T13:47:38
null
0
0
null
null
null
null
UTF-8
C++
false
false
6,045
cpp
compoundfile_stream.cpp
/*! \file \brief Stream in the compound file. \author Igor Mironchik (igor.mironchik at gmail dot com). Copyright (c) 2011-2017 Igor Mironchik 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. */ // CompoundFile include. #include "compoundfile_stream.hpp" #include "sat.hpp" #include "directory.hpp" #include "utils.hpp" namespace CompoundFile { // // Stream // Stream::Stream( const Header & header, const SAT & sat, const SecID & secID, std::istream & stream ) : Excel::Stream( header.byteOrder() ) , m_header( header ) , m_stream( stream ) , m_mode( LargeStream ) , m_bytesReaded( 0 ) , m_sectorSize( m_header.sectorSize() ) , m_sectorBytesReaded( 0 ) , m_shortSecIDIdx( 0 ) , m_largeSecIDIdx( 0 ) , m_streamSize( 0 ) { m_largeStreamChain = sat.sectors( secID ); m_stream.seekg( calcFileOffset( m_largeStreamChain.front(), m_sectorSize ) ); m_streamSize = m_largeStreamChain.size() * m_sectorSize; } Stream::Stream( const Header & header, const SAT & sat, const SAT & ssat, const Directory & dir, const SecID & shortStreamFirstSector, std::istream & cstream ) : Excel::Stream( header.byteOrder() ) , m_header( header ) , m_stream( cstream ) , m_mode( ( static_cast< size_t > ( dir.streamSize() ) < m_header.streamMinSize() ? ShortStream : LargeStream ) ) , m_bytesReaded( 0 ) , m_sectorSize( ( static_cast< size_t > ( dir.streamSize() ) < m_header.streamMinSize() ? m_header.shortSectorSize() : m_header.sectorSize() ) ) , m_sectorBytesReaded( 0 ) , m_shortSecIDIdx( 0 ) , m_largeSecIDIdx( 0 ) , m_streamSize( dir.streamSize() ) { if( m_mode == LargeStream ) { m_largeStreamChain = sat.sectors( dir.streamSecID() ); m_stream.seekg( calcFileOffset( m_largeStreamChain.front(), m_header.sectorSize() ) ); } else { m_largeStreamChain = sat.sectors( shortStreamFirstSector ); m_shortStreamChain = ssat.sectors( dir.streamSecID() ); SecID largeSector; const int32_t offset = whereIsShortSector( dir.streamSecID(), largeSector ); std::streampos pos = calcFileOffset( largeSector, m_header.sectorSize() ); pos += offset * m_header.shortSectorSize(); m_stream.seekg( pos ); } } bool Stream::eof() const { return ( m_bytesReaded == m_streamSize ); } void Stream::seek( int32_t pos, SeekType type ) { if( type == FromCurrent ) { pos += m_bytesReaded; if( pos < 0 ) pos += m_streamSize; } else if( type == FromEnd && pos > 0 ) pos = m_streamSize - pos; else if( type == FromEnd && pos < 0 ) pos = std::abs( pos ); else if( type == FromBeginning && pos < 0 ) pos = m_streamSize - pos; if( pos >= m_streamSize ) { m_bytesReaded = m_streamSize; return; } const int32_t offset = pos % m_sectorSize; const int32_t sectorIdx = pos / m_sectorSize; m_bytesReaded = pos; m_sectorBytesReaded = offset; if( m_mode == LargeStream ) { m_largeSecIDIdx = sectorIdx; m_stream.seekg( calcFileOffset( m_largeStreamChain.at( m_largeSecIDIdx ), m_sectorSize ) + offset, std::ios::beg ); } else { const SecID shortSector = m_shortStreamChain.at( sectorIdx ); SecID largeSector; const int32_t offsetInLargeSector = whereIsShortSector( shortSector, largeSector ); m_shortSecIDIdx = sectorIdx; std::streampos pos = calcFileOffset( largeSector, m_header.sectorSize() ); pos += offsetInLargeSector * m_header.shortSectorSize(); pos += offset; m_stream.seekg( pos, std::ios::beg ); } } int32_t Stream::pos() { if( eof() ) return -1; else return m_bytesReaded; } int32_t Stream::whereIsShortSector( const SecID & shortSector, SecID & largeSector ) { const int32_t shortSectorsInLarge = m_header.sectorSize() / m_header.shortSectorSize(); const int32_t idxOfTheShortSector = SAT::indexOfTheSecID( shortSector, m_shortStreamChain ); const int32_t offset = idxOfTheShortSector % shortSectorsInLarge; const int32_t largeSectorIdx = idxOfTheShortSector / shortSectorsInLarge; largeSector = m_largeStreamChain.at( largeSectorIdx ); return offset; } void Stream::seekToNextSector() { if( m_mode == LargeStream ) { ++m_largeSecIDIdx; m_stream.seekg( calcFileOffset( m_largeStreamChain.at( m_largeSecIDIdx ), m_sectorSize ), std::ios::beg ); } else { ++m_shortSecIDIdx; SecID largeSector; const int32_t offset = whereIsShortSector( m_shortStreamChain.at( m_shortSecIDIdx ), largeSector ); std::streampos pos = calcFileOffset( largeSector, m_header.sectorSize() ); pos += offset * m_header.shortSectorSize(); m_stream.seekg( pos, std::ios::beg ); } } char Stream::getByte() { if( eof() ) return 0xFFu; if( m_sectorBytesReaded == m_sectorSize ) { m_sectorBytesReaded = 0; seekToNextSector(); } char ch; m_stream.get( ch ); ++m_sectorBytesReaded; ++m_bytesReaded; return ch; } } /* namespace CompoundFile */
0f021aecde2b0ba6bac5e7259ded926416122336
7d9e50d1e5b0748180440d70fe16fc3b447f2e8d
/Implementations/Creational/AbstractFactory/AbstractFactory/factory1/factory1.cpp
a5d8b356293fbc4e0e9eb0c673525402d9f64006
[]
no_license
cjlcarvalho/patterns
b880c5e04e57d82b081e863b09e3deb54698b086
4f9cf15df161bb82ecd52d3524ae7d44ada8b991
refs/heads/master
2021-09-13T02:23:48.068664
2018-04-23T23:17:34
2018-04-23T23:17:34
111,008,981
1
1
null
null
null
null
UTF-8
C++
false
false
305
cpp
factory1.cpp
#include "factory1.h" #include "../interfaces/iproduct1.h" #include "../interfaces/iproduct2.h" #include "product11.h" #include "product21.h" Factory1::Factory1() { } IProduct1* Factory1::createProduct1(){ return new Product11; } IProduct2* Factory1::createProduct2(){ return new Product21; }
b0f38903cd69458749de79190adf8ed05b6df906
b45a7e10dd10364ec8ee7c01b97e711a3cf72473
/firstProject1415/UI/CommandHandlers.cpp
03b6b88c0e77f8d7f840b4350fcb3212ea90dc77
[]
no_license
lhalam/firstProject1415
7bae414c0458a1a17a01ab99217fc2eefbd2e28d
b266c9e62fe0f5cbad86a13d23acf265eed86579
refs/heads/master
2021-01-20T11:16:36.455224
2015-07-07T13:57:04
2015-07-07T13:57:04
32,865,749
10
15
null
2015-04-22T14:11:17
2015-03-25T13:19:48
C++
UTF-8
C++
false
false
15,382
cpp
CommandHandlers.cpp
#include "CommandHandlers.h" #include "../DataManager/DataManager.h" #include "Globals.h" #include "../Products/Products.h" #include <Windows.h> using namespace std; /*Command executors listed alphabetically*/ Result addNewProduct() { Product* prod = nullptr; try { string command; cout << Message("[help] - shows all the possible product types, that can be created", LOG_MSG) << Message("[continue] - goes to creating a new product", LOG_MSG) << Message("[exit] - exits product creating mode", LOG_MSG); getline(cin, command); toLowercase(command); while (command != "exit") { if (command == "help") { cout << Message("Products:", LOG_MSG); cout << Message("Appliance", LOG_MSG); cout << Message("Audio&TV", LOG_MSG); cout << Message("Laptop&computer", LOG_MSG); cout << Message("Phone&tablet", LOG_MSG); cout << Message("Photo&videocamera", LOG_MSG); cout << Message("Drink", LOG_MSG); cout << Message("Food", LOG_MSG); cout << Message("Accessory", LOG_MSG); cout << Message("Clothing", LOG_MSG); cout << Message("Footwear", LOG_MSG); cout << Message("Cosmetics", LOG_MSG); cout << Message("Detergent", LOG_MSG); cout << Message("Personal hygiene", LOG_MSG) << Message("\nInput command", INPUT_MSG); getline(cin, command); } if (command == "continue") { string type; int quantity; cout << Message("Type", CONTEXT_MSG); getline(cin, type); toLowercase(type); if (identifyType(type) != nullptr) { Product* prod = identifyType(type); prod->input(); DataManager manager; manager.saveProduct(*prod); cout << Message("Quantity", CONTEXT_MSG); cin >> quantity; cin.get(); manager.setQuantity(prod->getId(), quantity); break; } else { return Result("Unknown type.", NOT_SUCCESSFUL); } } } } catch (exception& exp) { delete[] prod; return Result(exp.what(), NOT_SUCCESSFUL); } delete[] prod; cout << Message("New product is added to the assortment.", LOG_MSG); return Result(); } Result addNewProductsFromXML() { try { DataManager manager; List<Product*> list = manager.readFromXML(); manager.saveAllProducts(list); } catch (exception& exp) { return Result(exp.what(), NOT_SUCCESSFUL); } cout << Message("New products are added.", LOG_MSG); return Result(); } Result addProductToCart() { try { cout << Message("Enter id of product you want to add to cart : ", LOG_MSG); int id; cin >> id; cin.get(); DataManager manager; Product* product = manager.getProductById(id); if (product == nullptr) { return Result("There is no product with such id", NOT_SUCCESSFUL); } cart.pushBack(product); cout << Message("You have added to cart : ", LOG_MSG); (*product).output(); } catch (exception& exp) { return Result(exp.what(), NOT_SUCCESSFUL); } return Result(); } Result buyAllProductFromCart() { if (cart.size() == 0) { cout << Message("Your cart is empty", LOG_MSG); return Result(); } try { cout << Message("You've bought: ", LOG_MSG) << endl; auto it = cart.begin(); while (cart.size() != 0) { DataManager manager; manager.changeQuantity((**it).getId(), -1); manager.saveToUserHistory(**it, 1); it++; cart.popFront()->output(); cout << endl; } } catch (exception& exp) { return Result(exp.what(), NOT_SUCCESSFUL); } cout << Message("You bought all products.", LOG_MSG); return Result(); } Result buyOneElementById() { Product* product = nullptr; try { cout << Message("Enter product id", CONTEXT_MSG); int id; cin >> id; cin.get(); DataManager manager; product = manager.getProductById(id); if (product == nullptr) { return Result("There is no product with such id", NOT_SUCCESSFUL); } manager.changeQuantity(product->getId(), -1); manager.saveToUserHistory(*product, 1); cout << Message("You bought: ", LOG_MSG); product->output(); delete product; } catch (exception& exp) { delete product; return Result(exp.what(), NOT_SUCCESSFUL); } return Result(); } Result changeAmount() { try { int id; cout << Message("Id ", CONTEXT_MSG); cin >> id; int quantity; DataManager manager; string message = string("Current quantity of product with id ") + to_string(id) + string(": ") + to_string(manager.getQuantity(id)); cout << Message(message, LOG_MSG); cout << Message("Enter new quantity", CONTEXT_MSG); cin >> quantity; cin.get(); manager.setQuantity(id, quantity); } catch (exception& exp) { return Result(exp.what(), NOT_SUCCESSFUL); } cout << Message("New quantity is added to the assortment.", LOG_MSG); return Result(); } Result changeProduct() { Product *prod = nullptr; try { int id = 0; cout << Message("Enter id", CONTEXT_MSG); cin >> id; cin.get(); DataManager manager; prod = manager.getProductById(id); if (prod == nullptr) { return Result("Invalid id.", NOT_SUCCESSFUL); } prod->input(); string message = string("Current quantity of product with id ") + to_string(id) + string(": ") + to_string(manager.getQuantity(id)); cout << Message(message, LOG_MSG); cout << Message("Enter new quantity", CONTEXT_MSG); int quantity = 0; cin >> quantity; cin.get(); manager.removeProductById(id); manager.saveProduct(*prod); manager.setQuantity(id, quantity); delete prod; } catch (exception& exp) { delete prod; return Result(exp.what(), NOT_SUCCESSFUL); } cout << Message("Product is changed.", LOG_MSG); return Result(); } Result clear() { system("cls"); cout << "Welcome to our shop!" << endl; cout << "Type 'help' for list of available commands" << endl; cout << "________________________________________________________________________________" << endl; return Result(); } Result createAdmin() { User *user = nullptr; try { int id; cout << Message("Enter id of the account", CONTEXT_MSG); cin >> id; cin.get(); DataManager manager; user = manager.getUserById(id); if (user == nullptr) { return Result("The id is invalid. Please try again.", NOT_SUCCESSFUL); } if (user->getRole() == Access::ADMIN) { cout << Message("The account already has administrator rights.", LOG_MSG); return Result(); } user->setRole(Access::ADMIN); manager.removeUserById(id); manager.saveUser(*user); } catch (exception& exp) { delete user; return Result(exp.what(), NOT_SUCCESSFUL); } cout << Message("The account was granted administrator rights.", LOG_MSG); return Result(); } Result createUser() { try { User newUser; newUser.input(); DataManager manager; manager.saveUser(newUser); cin.get(); } catch (exception& exp) { return Result(exp.what(), NOT_SUCCESSFUL); } cout << Message("The account was created successfully", LOG_MSG); return Result(); } Result exit() { return Result(EXIT); } Result exportProdXML() { try { DataManager().exportXML(); } catch (exception& exp) { return Result(exp.what(), NOT_SUCCESSFUL); } cout << Message("Done.", LOG_MSG); return Result(); } Result exportHistoryToHTML() { try { DataManager().writeInHTML(currentUser.getId(), Date(1, 1, 1), Date(1000, 1000, 1000)); } catch (exception& exp) { return Result(exp.what(), NOT_SUCCESSFUL); } cout << Message("Written history to HTML", LOG_MSG); return Result(); } Result help() { for (int i = 0; i < numOfCommands; i++) { if (currentUser.getRole() & commands[i].getAccessLevel()) cout << Message("[" + commands[i].getName() + "] - " + commands[i].getDescription(), LOG_MSG); } return Result(); } Result logIn() { cout << Message("Name", CONTEXT_MSG); string name; getline(cin, name, '\n'); cout << Message("Password", CONTEXT_MSG); string password; getline(cin, password, '\n'); /* Checking the database */ DataManager dataManager; User* existingUser = nullptr; try { existingUser = dataManager.getUserByLogin(name, password); } catch (exception& exp) { return Result(exp.what(), NOT_SUCCESSFUL); } if (existingUser == nullptr) //User with this login exists { return Result("Authentication failed\nPlease, check your name, password and try again.", NOT_SUCCESSFUL); } else { currentUser = *existingUser; cout << Message("Authentication successful\nWelcome, " + name + "!", LOG_MSG); } delete existingUser; return Result(); } Result logOut() { currentUser = User(); cout << Message("You logged out successfully.", LOG_MSG); return Result(); } Result removeProductFromAssortment() { try { int id; cout << Message("Enter id of product you want to remove:", CONTEXT_MSG); cin >> id; cin.get(); DataManager manager; manager.removeProductById(id); } catch (exception& exp) { return Result(exp.what(), NOT_SUCCESSFUL); } cout << Message("The product is removed from the assortment.", LOG_MSG); return Result(); } Result removeProductFromCart() { int ID; bool option; if(cart.size() == 0) { cout << Message("Your cart is empty.", LOG_MSG); return Result(); } else if(cart.size() == 1) { option = true; cout << Message("You currently have one product in your cart.", CONTEXT_MSG); } else { option = false; cout << Message("You currently have " + to_string(cart.size()) + " products in your cart.", CONTEXT_MSG) << Message("Which product would you like to remove from your cart?", CONTEXT_MSG) << Message("Input ID:", CONTEXT_MSG); cin >> ID; } cout << Message("Are you sure you want to remove this product? (y/n)", CONTEXT_MSG); char answer; cin >> answer; int stupidityCount = 0; while(answer != 'y' && answer != 'n') { stupidityCount++; if(stupidityCount >= 3) { cout << Message("You aren't smart, are you?..", ALERT_MSG); } else { cout << Message("You may have misunderstood me.", LOG_MSG); } cout << Message("Are you sure you want to remove this product? (y/n)", CONTEXT_MSG); cin >> answer; } try { switch(answer) { case 'y': DataManager manager; cart.erase(option ? cart.begin() : cart.find(manager.getProductById(ID), cart.begin(), cart.end())); cout << Message("Operation successful.", LOG_MSG); return Result(); break; case 'n': cout << Message("Operation cancelled.", LOG_MSG); return Result(); break; } } catch(exception& exp) { return Result(exp.what(), NOT_SUCCESSFUL); } return Result(); } Result removeUser() { int id = 0; cout << Message("Enter id of the account", CONTEXT_MSG); cin >> id; if (id == currentUser.getId()) { return Result("You cannot delete yourself.", SUCCESSFUL); } DataManager manager; try { manager.removeUserById(id); } catch (exception& exp) { cin.get(); return Result(exp.what(), NOT_SUCCESSFUL); } cout << Message("The user was deleted successfully.", LOG_MSG); return Result(); } Result showCart() { if(cart.begin() == cart.end()) { cout << Message("Your cart is empty.", LOG_MSG); return Result(SUCCESSFUL); } auto end = cart.end(); for (auto iterator = cart.begin(); iterator != end; iterator++) { (**iterator).output(); cout << endl; } return Result(); } Result showProducts() { try { auto allProducts = DataManager().readAllProducts(); if (allProducts.size() == 0) { cout << Message("There are no products in our shop, we are so poor.", LOG_MSG); return Result(); } auto end = allProducts.end(); for (auto it = allProducts.begin(); it != end; it++) { cout << Message(string(typeid(**it).name()).substr(6), LOG_MSG); (*it)->output(); cout << endl; } for (auto it = allProducts.begin(); it != end; it++) { delete *it; } } catch (exception& exp) { return Result(exp.what(), NOT_SUCCESSFUL); } cout << Message("Listing completed.", LOG_MSG); return Result(); } Result showPurchaseHistory() { try { DataManager manager; auto list = manager.getAllFromUserHistory(currentUser.getId()); if (list.isEmpty()) { cout << Message("You haven't bought anything.", LOG_MSG); return Result(); } auto end = list.end(); for (auto iter = list.begin(); iter != end; iter++) { cout << Message(string(typeid(*(*iter).first).name()).substr(6), LOG_MSG); (*iter).first->output(); cout << Message("Quantity: " + to_string((*iter).second), LOG_MSG); cout << endl; } for (auto iter = list.begin(); iter != end; iter++) { delete (*iter).first; } } catch (exception& exp) { return Result(exp.what(), NOT_SUCCESSFUL); } return Result(); } Result showStats() { try { DataManager manager; map<Product*, int> map = manager.readStatistics(); for (auto it = map.begin(); it != map.end(); ++it) { it->first->output(); cout << Message("Quantity: " + to_string(it->second), LOG_MSG); cout << endl; } for (auto it = map.begin(); it != map.end(); ++it) { delete it->first; } } catch (exception& exp) { return Result(exp.what(), NOT_SUCCESSFUL); } cout << Message("Listing completed.", LOG_MSG); return Result(); } Result showUsers() { try { DataManager manager; List<User*> list = manager.readAllUsers(); auto iter = list.begin(); while (iter != list.end()) { int temp = 0; (*iter)->print(); temp++; iter++; if ((temp % 5) == 0) { cout << Message("Press Enter to continue.", LOG_MSG); cin.get(); } cout << endl; } } catch (exception& exp) { return Result(exp.what(), NOT_SUCCESSFUL); } cout << Message("Listing completed.", LOG_MSG); return Result(); } void delay(string a, unsigned sleepDelay = 100) { for (unsigned i = 0; i < a.length(); i++) { Sleep(sleepDelay); cout << a[i]; } } Result enterMatrix() { system("cls"); Sleep(100); SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 10); for (int i = 0; i < 3000; i++) { cout << rand(); } Sleep(100); system("cls"); Sleep(3000); delay("Hello, Mr. Anderson."); cout << endl; Sleep(3000); system("cls"); delay("U must save the matrix bcs U are a programmer!"); cout << endl; Sleep(3000); system("cls"); delay("So solve the next:\n8 1\nx 0\nEnter x such that determinant is not equal to zero."); Sleep(2000); int x = 0; while (x != 69) { if(x == 1337 || x == 228) { delay("Mama ama criminaaaaal..."); Sleep(2000); break; } if(x == 1488) { SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), RED); delay("Die Fahne hoch! Die Reihen fest geschlossen!\n" "SA marschiert mit ruhig festem Schritt.\n" "Kam'raden, die Rotfront und Reaktion erschossen,\n" "Marschier'n im Geist in unser'n Reihen mit.\n" "Kam'raden, die Rotfront und Reaktion erschossen,\n" "Marschier'n im Geist in unser'n Reihen mit. \n"); Sleep(1000); delay("Nazi power!"); Sleep(2000); SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 10); break; } delay("\nYour answer: "); cin >> x; } Sleep(1000); cout << "My congratulations, Mr.Anderson."; Sleep(2000); system("cls"); delay("....", 1000); system("cls"); delay("But you hear that Mr. Anderson?...\n"); Sleep(1000); delay("That is the sound of inevitability...\n"); Sleep(1000); delay("It is the sound of your death...\n"); Sleep(1000); delay("Goodbye, Mr. Anderson...\n"); Sleep(2000); cin.get(); SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), WHITE); clear(); return Result(); }
53feba2664bd2d1e2a442c0d725092bcc06fce92
efe79a0c8a5a48220bce63e7c35be993b5e6c3a8
/src/communication/mpi.cpp
d1073f6928a20a3a14cb9212292dcb062867bd0e
[ "BSD-3-Clause" ]
permissive
kabicm/arbor
4d4a4b731f64c80b9d181bae830d572637490f04
cfab5fd6a2e6a211c097659c96dcc098ee806e68
refs/heads/master
2021-09-05T10:04:34.454500
2018-01-16T10:47:32
2018-01-16T10:47:32
94,232,576
0
0
null
null
null
null
UTF-8
C++
false
false
1,429
cpp
mpi.cpp
#include <mpi.h> #include <communication/mpi.hpp> namespace arb { namespace mpi { // global state namespace state { // TODO: in case MPI_Init is never called, this will mimic one rank with rank 0. // This is not ideal: calls to MPI-dependent features such as reductions will // still fail, however this allows us to run all the unit tests until the // run-time executors are implemented. int size = 1; int rank = 0; } // namespace state void init(int *argc, char ***argv) { int provided; // initialize with thread serialized level of thread safety PE("MPI", "Init"); MPI_Init_thread(argc, argv, MPI_THREAD_SERIALIZED, &provided); assert(provided>=MPI_THREAD_SERIALIZED); PL(2); PE("rank-size"); MPI_Comm_rank(MPI_COMM_WORLD, &state::rank); MPI_Comm_size(MPI_COMM_WORLD, &state::size); PL(); } void finalize() { PE("MPI", "Finalize"); MPI_Finalize(); PL(2); } bool is_root() { return state::rank == 0; } int rank() { return state::rank; } int size() { return state::size; } void barrier() { MPI_Barrier(MPI_COMM_WORLD); } bool ballot(bool vote) { using traits = mpi_traits<char>; char result; char value = vote ? 1 : 0; PE("MPI", "Allreduce-ballot"); MPI_Allreduce(&value, &result, 1, traits::mpi_type(), MPI_LAND, MPI_COMM_WORLD); PL(2); return result; } } // namespace mpi } // namespace arb
f821de83a2e91d41aa3f85c896cd46f3d8b978ce
2aa5d1de812b5830f6964fb7b2f9c726cf645f2b
/test2.cpp
3213751dc7c8e88f67c41b3cc04624da762623cd
[]
no_license
mzogin/GuitarHero
a67691c3ef00a317d346bada4aecba5fce3bbcf3
b3e32d4911f42713d63f9333ed619491c9503695
refs/heads/main
2023-03-26T05:02:50.471243
2021-03-28T18:58:21
2021-03-28T18:58:21
352,413,186
0
0
null
null
null
null
UTF-8
C++
false
false
1,650
cpp
test2.cpp
#define BOOST_TEST_DYN_LINK #define BOOST_TEST_MODULE Main #include <boost/test/unit_test.hpp> #include <exception> #include <stdexcept> #include <vector> #include "StringSound.h" BOOST_AUTO_TEST_CASE(SS) { std::vector<sf::Int16> v; v.push_back(0); v.push_back(1000); v.push_back(2000); v.push_back(-5000); BOOST_REQUIRE_NO_THROW(StringSound ss = StringSound(v)); StringSound ss = StringSound(v); // SS is 0 1000 2000 -5000 std::cout << "Sample is: " << ss.sample() << "\n"; BOOST_REQUIRE(ss.sample() == 0); ss.tic(); // now 1000 2000 -5000 498 std::cout << "Sample is: " << ss.sample() << "\n"; BOOST_REQUIRE(ss.sample() == 1000); ss.tic(); // now 2000 -5000 498 1494 std::cout << "Sample is: " << ss.sample() << "\n"; BOOST_REQUIRE(ss.sample() == 2000); ss.tic(); // now -5000 498 1494 -1494 std::cout << "Sample is: " << ss.sample() << "\n"; BOOST_REQUIRE(ss.sample() == -5000); ss.tic(); // now 498 1494 -1494 -2241 std::cout << "Sample is: " << ss.sample() << "\n"; BOOST_REQUIRE(ss.sample() == 498); ss.tic(); // now 1494 -1494 -2241 992 std::cout << "Sample is: " << ss.sample() << "\n"; BOOST_REQUIRE(ss.sample() == 1494); ss.tic(); // now -1494 -2241 992 0 std::cout << "Sample is: " << ss.sample() << "\n"; BOOST_REQUIRE(ss.sample() == -1494); ss.tic(); std::cout << "Sample is: " << ss.sample() << "\n"; BOOST_REQUIRE(ss.sample() == -2241); ss.tic(); std::cout << "Sample is: " << ss.sample() << "\n"; BOOST_REQUIRE(ss.sample() == 992); ss.tic(); std::cout << "Sample is: " << ss.sample() << "\n"; BOOST_REQUIRE(ss.sample() == 0); }
87a78ed568f9699e2503e11fb028f365ed623786
3fa2caad2ad51280b23249320264e8ceb6eac2a1
/Maze/widget.cpp
eac322834f8824472bcd0e7aaa78971021f238b4
[]
no_license
lyingCS/Qt-Huffman-Maze
4c1315ee065a6fbead8579f3d8e4806da9bb4a0f
b566ea20b7041fd380a807e131656eac487af5b7
refs/heads/master
2022-12-27T08:57:44.473644
2020-10-08T09:49:59
2020-10-08T09:49:59
294,739,854
1
0
null
null
null
null
UTF-8
C++
false
false
5,981
cpp
widget.cpp
#include "widget.h" #include "maze.h" #include "ui_widget.h" #include<QMessageBox> #include<QPen> #include<QPainter> #include<QRect> #include<string> #include<QDebug> extern Maze maze; Widget::Widget(QWidget *parent) : QWidget(parent) , ui(new Ui::Widget) { ui->setupUi(this); setPalette(QPalette(Qt::green)); setAutoFillBackground(true); paintArea=new PaintArea(this); paintArea->move(70,70); } Widget::~Widget() { delete ui; } void Widget::on_makeButton_clicked() { QString heightStr=ui->heightLineEdit->text(); QString widthStr=ui->widthLineEdit->text(); if(heightStr.isEmpty()) { QMessageBox::critical(this,"Error","Please input the height!"); return; } if(heightStr.toInt()<2||heightStr.toInt()>181) { QMessageBox::critical(this,"Error","1<height<182!"); return; } if(widthStr.isEmpty()) { QMessageBox::critical(this,"Error","Please input the width!"); return; } if(widthStr.toInt()<2||widthStr.toInt()>181) { QMessageBox::critical(this,"Error","1<width<182!"); return; } ui->label->setText("click \"find\" to find a path"); ui->lineEdit->setEnabled(true); ui->lineEdit_2->setEnabled(true); ui->lineEdit_3->setEnabled(true); ui->lineEdit_4->setEnabled(true); ui->lineEdit_5->setEnabled(true); ui->findButton->setEnabled(true); ui->pushButton->setEnabled(true); ui->pushButton_2->setEnabled(true); ui->findAcoButton->setEnabled(true); ui->antsLineEdit->setEnabled(true); ui->deltaLineEdit->setEnabled(true); ui->alphaLineEdit->setEnabled(true); ui->iterLineEdit->setEnabled(true); ui->minLineEdit->setEnabled(true); ui->maxLineEdit->setEnabled(true); paintArea->initMaze(heightStr.toInt(),widthStr.toInt()); ui->antsLineEdit->setText(QString::number(paintArea->maze->height*paintArea->maze->width*(paintArea->maze->height+paintArea->maze->width)/2)); ui->minLineEdit->setText(QString::number(0.5/(paintArea->maze->height+paintArea->maze->width))); ui->maxLineEdit->setText(QString::number(3*ui->minLineEdit->text().toDouble())); } void Widget::on_findButton_clicked() { paintArea->findPath(); } void Widget::on_pushButton_clicked() { paintArea->findPath_2(); } void Widget::on_pushButton_2_clicked() { QString times=ui->lineEdit->text(); QString nums=ui->lineEdit_2->text(); QString rate=ui->lineEdit_3->text(); QString rate_2=ui->lineEdit_4->text(); QString length=ui->lineEdit_5->text(); if(times.isEmpty()) { QMessageBox::critical(this,"Error","Please input the evolution times!"); return; } else if(times.toInt()<=0) { QMessageBox::critical(this,"Error","evolution times should>0"); return; } if(nums.isEmpty()) { QMessageBox::critical(this,"Error","Please input the parent number!"); return; } else if(nums.toInt()<=20) { QMessageBox::critical(this,"Error","parent number should>20!"); return; } if(rate.isEmpty()) { QMessageBox::critical(this,"Error","Please input the mutation rate!"); return; } else if(rate.toInt()<=0||rate.toInt()>20) { QMessageBox::critical(this,"Error","0<mutation rate<=20!"); return; } if(rate_2.isEmpty()) { QMessageBox::critical(this,"Error","Please input the survival rate!"); return; } else if(rate_2.toInt()<=0||rate_2.toInt()>40) { QMessageBox::critical(this,"Error","0<survival rate<=40!"); return; } if(length.isEmpty()) { QMessageBox::critical(this,"Error","Please input the length!"); return; } else if(length.toInt()<=5) { QMessageBox::critical(this,"Error","length>5!"); return; } paintArea->findPath_3(times.toInt(),nums.toInt(),rate.toInt(),rate_2.toInt(),length.toInt()); } void Widget::on_findAcoButton_clicked() { QString ants=ui->antsLineEdit->text(); QString delta=ui->deltaLineEdit->text(); QString alpha=ui->alphaLineEdit->text(); QString iter=ui->iterLineEdit->text(); QString minP=ui->minLineEdit->text(); QString maxP=ui->maxLineEdit->text(); if(ants.isEmpty()) { QMessageBox::critical(this,"Error","Please input the ants number!"); return; } else if(ants.toInt()<=10) { QMessageBox::critical(this,"Error","ants number>10!"); return; } if(delta.isEmpty()) { QMessageBox::critical(this,"Error","Please input the delta!"); return; } else if(delta.toInt()<=0) { QMessageBox::critical(this,"Error","delta>0!"); return; } if(alpha.isEmpty()) { QMessageBox::critical(this,"Error","Please input the alpha!"); return; } else if(alpha.toDouble()<=0||alpha.toDouble()>=1) { QMessageBox::critical(this,"Error","0<alpha<1!"); return; } if(iter.isEmpty()) { QMessageBox::critical(this,"Error","Please input the iteration times!"); return; } else if(iter.toInt()<=0) { QMessageBox::critical(this,"Error","iteration times>=0!"); return; } if(minP.isEmpty()) { QMessageBox::critical(this,"Error","Please input the min of peromone!"); return; } else if(minP.toDouble()<=0||minP.toDouble()>=0.5) { QMessageBox::critical(this,"Error","0<min of peromone<0.5!"); return; } if(maxP.isEmpty()) { QMessageBox::critical(this,"Error","Please input the max if peromone!"); return; } else if(maxP.toDouble()<=minP.toDouble()) { QMessageBox::critical(this,"Error","maxP>minP!"); return; } paintArea->findPath_4(ants.toInt(),delta.toInt(),alpha.toDouble(),iter.toInt(),minP.toDouble(),maxP.toDouble()); }
c5b796920fb4eeead0bb552201ae2797ecc1fc54
4851e39d896dbce426b7ef3a67f24f5a38248e22
/A_D_Qs/Jan_04_number_of_island_dfs.cc
8324ba4c7620336d0e015b8d18989dddec510cf0
[]
no_license
breadream/random_cpp
973064db273319cd1a472dc4fbb460e36225d3ca
ad6b5e31196b198064cd83b1baba2527b9c9c033
refs/heads/master
2020-04-10T01:17:13.314910
2019-05-04T05:07:53
2019-05-04T05:07:53
160,711,337
2
0
null
null
null
null
UTF-8
C++
false
false
1,174
cc
Jan_04_number_of_island_dfs.cc
class Solution { public: int numIslands(vector<vector<char>>& grid) { int nR = grid.size(); if (nR == 0) return 0; int nC = grid[0].size(); int nI = 0; for (int i = 0; i < nR; i++) { for (int j = 0; j < nC; j++) { if (grid[i][j] == '1') { nI++; dfs(grid, i, j); } } } return nI; } // linear scan of 2D grid map, if a node contains '1', the node triggers DFS // during consequent dfs, every visited node is set as '0' // the number of nodes that trigger DFS is the number of islands void dfs (vector<vector<char>>& grid, int r, int c) { int nR = grid.size(); int nC = grid[0].size(); grid[r][c] = '0'; if (r-1 >= 0 && grid[r-1][c] == '1') dfs(grid, r-1, c); if (r+1 < nR && grid[r+1][c] == '1') dfs(grid, r+1, c); if (c-1 >= 0 && grid[r][c-1] == '1') dfs(grid, r, c-1); if (c+1 < nC && grid[r][c+1] == '1') dfs(grid, r, c+1); } };
1d5329f8b90ee3a6cb61106e4aee85056467e099
f26c339df4516ac76f465aaaeb87d01cad6a857c
/ledMatrix/ledMatrix.ino
75e059df9bb4bec938d24147eb042a67d7b7a721
[]
no_license
antrikshsrivastava/arduino-projects
d1a0d269c447071bd4e52080669753e0298cddfb
6dac011d74e82b474f4e805d2e408af41674084d
refs/heads/master
2021-01-21T11:07:59.194360
2015-02-18T14:12:34
2015-02-18T14:12:34
30,866,250
1
0
null
null
null
null
UTF-8
C++
false
false
1,983
ino
ledMatrix.ino
#include <SPI.h> #include <avr/pgmspace.h> #include "font.h" //const byte SS = 10; // omit this line for Arduino 1.0 onwards // define max7219 registers const byte MAX7219_REG_NOOP = 0x0; const byte MAX7219_REG_DIGIT0 = 0x1; const byte MAX7219_REG_DIGIT1 = 0x2; const byte MAX7219_REG_DIGIT2 = 0x3; const byte MAX7219_REG_DIGIT3 = 0x4; const byte MAX7219_REG_DIGIT4 = 0x5; const byte MAX7219_REG_DIGIT5 = 0x6; const byte MAX7219_REG_DIGIT6 = 0x7; const byte MAX7219_REG_DIGIT7 = 0x8; const byte MAX7219_REG_DECODEMODE = 0x9; const byte MAX7219_REG_INTENSITY = 0xA; const byte MAX7219_REG_SCANLIMIT = 0xB; const byte MAX7219_REG_SHUTDOWN = 0xC; const byte MAX7219_REG_DISPLAYTEST = 0xF; void sendByte (const byte reg, const byte data) { digitalWrite (SS, LOW); SPI.transfer (reg); SPI.transfer (data); digitalWrite (SS, HIGH); } // end of sendByte void letter (const byte c) { for (byte col = 0; col < 8; col++) sendByte (col + 1, pgm_read_byte (&cp437_font [c] [col])); } // end of letter void showString (const char * s, const unsigned long time) { char c; while (c = *s++) { letter (c); delay (time); letter (' '); // brief gap between letters delay (10); } } // end of showString void setup () { SPI.begin (); sendByte (MAX7219_REG_SCANLIMIT, 7); // show all 8 digits sendByte (MAX7219_REG_DECODEMODE, 0); // using an led matrix (not digits) sendByte (MAX7219_REG_DISPLAYTEST, 0); // no display test // clear display for (byte col = 0; col < 8; col++) sendByte (col + 1, 0); sendByte (MAX7219_REG_INTENSITY, 13); // character intensity: range: 0 to 15 sendByte (MAX7219_REG_SHUTDOWN, 1); // not in shutdown mode (ie. start it up) } // end of setup void loop () { showString ("***AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz..*", 100); } // end of loop
7a426d8dcd991ccfffef61e2c9b51d0ed3b9718f
bc1218c64e76f704c5a864ee1f6e32b6f265042e
/src/Syslog.cpp
840f9adb6a762467991994b5ab4e77e51e4ca0d5
[]
no_license
k1-801/os
facb27c0c16c4b1c997fbbcfcd95edf3aa96e5a8
224f161411f8dbfe18e2381d71d0259810cb5bb4
refs/heads/master
2021-01-16T22:11:31.050873
2015-11-01T12:42:18
2015-11-01T12:42:18
44,913,965
0
0
null
2015-10-25T14:42:04
2015-10-25T14:42:03
null
UTF-8
C++
false
false
121
cpp
Syslog.cpp
#include "../include/Syslog.hpp" const char* logs[MAX_LOG]; int lnum=0; void log(const char *str) { logs[lnum++]=str; }
37ea3f7040639af3996c76c44e88b0494db1fda9
d62d179f9ad43ed22cee561a97c589c90c178cec
/modules/boost/dispatch/include/boost/dispatch/functor/details/preprocessed/dispatch.hpp
67b3b75ce184125f63670ec35d15e705388e6093
[ "BSL-1.0" ]
permissive
timblechmann/nt2
89385373c14add7e2df48c9114a93e37a8e6e0cf
6c71f7063ca4e5975c9c019877e6b2fe07c9e4ce
refs/heads/master
2021-01-16T23:49:00.220699
2013-03-11T09:31:23
2013-03-11T09:31:23
8,702,183
2
0
null
null
null
null
UTF-8
C++
false
false
8,890
hpp
dispatch.hpp
//============================================================================== // Local macro to generate the fall-through dispatch overload // What the fuck with adl_helper ? Well, as pointed out by Johannes Schaub // it is mandated by the standard so ADL kicks in on resolving calls to // dispatching without having to order them BEFORE the actual dispatch_call // class definitions. Without it, the whole system brittles. //============================================================================== //============================================================================== // Actual dispatching mechanism implementation //============================================================================== namespace boost { namespace dispatch { namespace meta { struct adl_helper {}; //============================================================================ // Default dispatch overload set for catching calls to unsupported functor // overload or unregistered types. //============================================================================ template< class Tag, class Site > BOOST_FORCEINLINE boost::dispatch::meta:: implement<tag::unknown_, Site, Tag()> dispatching ( meta::unknown_<Tag>, meta::unknown_<Site> , adl_helper = adl_helper() ) { boost::dispatch::meta::implement<tag::unknown_, Site , Tag() > that; return that; } template< class Tag, class Site , class A0> BOOST_FORCEINLINE boost::dispatch::meta:: implement<tag::unknown_, Site, Tag(typename meta::hierarchy_of<A0>::type)> dispatching ( meta::unknown_<Tag>, meta::unknown_<Site> , meta::unknown_<A0> , adl_helper = adl_helper() ) { boost::dispatch::meta::implement<tag::unknown_, Site , Tag(typename meta::hierarchy_of<A0>::type) > that; return that; } template< class Tag, class Site , class A0 , class A1> BOOST_FORCEINLINE boost::dispatch::meta:: implement<tag::unknown_, Site, Tag(typename meta::hierarchy_of<A0>::type , typename meta::hierarchy_of<A1>::type)> dispatching ( meta::unknown_<Tag>, meta::unknown_<Site> , meta::unknown_<A0> , meta::unknown_<A1> , adl_helper = adl_helper() ) { boost::dispatch::meta::implement<tag::unknown_, Site , Tag(typename meta::hierarchy_of<A0>::type , typename meta::hierarchy_of<A1>::type) > that; return that; } template< class Tag, class Site , class A0 , class A1 , class A2> BOOST_FORCEINLINE boost::dispatch::meta:: implement<tag::unknown_, Site, Tag(typename meta::hierarchy_of<A0>::type , typename meta::hierarchy_of<A1>::type , typename meta::hierarchy_of<A2>::type)> dispatching ( meta::unknown_<Tag>, meta::unknown_<Site> , meta::unknown_<A0> , meta::unknown_<A1> , meta::unknown_<A2> , adl_helper = adl_helper() ) { boost::dispatch::meta::implement<tag::unknown_, Site , Tag(typename meta::hierarchy_of<A0>::type , typename meta::hierarchy_of<A1>::type , typename meta::hierarchy_of<A2>::type) > that; return that; } template< class Tag, class Site , class A0 , class A1 , class A2 , class A3> BOOST_FORCEINLINE boost::dispatch::meta:: implement<tag::unknown_, Site, Tag(typename meta::hierarchy_of<A0>::type , typename meta::hierarchy_of<A1>::type , typename meta::hierarchy_of<A2>::type , typename meta::hierarchy_of<A3>::type)> dispatching ( meta::unknown_<Tag>, meta::unknown_<Site> , meta::unknown_<A0> , meta::unknown_<A1> , meta::unknown_<A2> , meta::unknown_<A3> , adl_helper = adl_helper() ) { boost::dispatch::meta::implement<tag::unknown_, Site , Tag(typename meta::hierarchy_of<A0>::type , typename meta::hierarchy_of<A1>::type , typename meta::hierarchy_of<A2>::type , typename meta::hierarchy_of<A3>::type) > that; return that; } template< class Tag, class Site , class A0 , class A1 , class A2 , class A3 , class A4> BOOST_FORCEINLINE boost::dispatch::meta:: implement<tag::unknown_, Site, Tag(typename meta::hierarchy_of<A0>::type , typename meta::hierarchy_of<A1>::type , typename meta::hierarchy_of<A2>::type , typename meta::hierarchy_of<A3>::type , typename meta::hierarchy_of<A4>::type)> dispatching ( meta::unknown_<Tag>, meta::unknown_<Site> , meta::unknown_<A0> , meta::unknown_<A1> , meta::unknown_<A2> , meta::unknown_<A3> , meta::unknown_<A4> , adl_helper = adl_helper() ) { boost::dispatch::meta::implement<tag::unknown_, Site , Tag(typename meta::hierarchy_of<A0>::type , typename meta::hierarchy_of<A1>::type , typename meta::hierarchy_of<A2>::type , typename meta::hierarchy_of<A3>::type , typename meta::hierarchy_of<A4>::type) > that; return that; } template< class Tag, class Site , class A0 , class A1 , class A2 , class A3 , class A4 , class A5> BOOST_FORCEINLINE boost::dispatch::meta:: implement<tag::unknown_, Site, Tag(typename meta::hierarchy_of<A0>::type , typename meta::hierarchy_of<A1>::type , typename meta::hierarchy_of<A2>::type , typename meta::hierarchy_of<A3>::type , typename meta::hierarchy_of<A4>::type , typename meta::hierarchy_of<A5>::type)> dispatching ( meta::unknown_<Tag>, meta::unknown_<Site> , meta::unknown_<A0> , meta::unknown_<A1> , meta::unknown_<A2> , meta::unknown_<A3> , meta::unknown_<A4> , meta::unknown_<A5> , adl_helper = adl_helper() ) { boost::dispatch::meta::implement<tag::unknown_, Site , Tag(typename meta::hierarchy_of<A0>::type , typename meta::hierarchy_of<A1>::type , typename meta::hierarchy_of<A2>::type , typename meta::hierarchy_of<A3>::type , typename meta::hierarchy_of<A4>::type , typename meta::hierarchy_of<A5>::type) > that; return that; } } } } //============================================================================== // Local macro to generate the dispatch selector //============================================================================== /**/ namespace boost { namespace dispatch { namespace meta { //============================================================================== // dispatch_call finds the proper call overload for evaluating a given // functor over a set of types on a given site //============================================================================== template<class Sig, class Site> struct dispatch_call; template< class Tag, class Site > struct dispatch_call<Tag(), Site> { typedef BOOST_DISPATCH_TYPEOF ( dispatching ( (typename meta::hierarchy_of<Tag>::type()) , (typename meta::hierarchy_of<Site>::type()) , adl_helper() ) ) type; }; template< class Tag, class Site , class A0 > struct dispatch_call<Tag(A0), Site> { typedef BOOST_DISPATCH_TYPEOF ( dispatching ( (typename meta::hierarchy_of<Tag>::type()) , (typename meta::hierarchy_of<Site>::type()) , (typename meta::hierarchy_of<A0>::type()) , adl_helper() ) ) type; }; template< class Tag, class Site , class A0 , class A1 > struct dispatch_call<Tag(A0 , A1), Site> { typedef BOOST_DISPATCH_TYPEOF ( dispatching ( (typename meta::hierarchy_of<Tag>::type()) , (typename meta::hierarchy_of<Site>::type()) , (typename meta::hierarchy_of<A0>::type()) , (typename meta::hierarchy_of<A1>::type()) , adl_helper() ) ) type; }; template< class Tag, class Site , class A0 , class A1 , class A2 > struct dispatch_call<Tag(A0 , A1 , A2), Site> { typedef BOOST_DISPATCH_TYPEOF ( dispatching ( (typename meta::hierarchy_of<Tag>::type()) , (typename meta::hierarchy_of<Site>::type()) , (typename meta::hierarchy_of<A0>::type()) , (typename meta::hierarchy_of<A1>::type()) , (typename meta::hierarchy_of<A2>::type()) , adl_helper() ) ) type; }; template< class Tag, class Site , class A0 , class A1 , class A2 , class A3 > struct dispatch_call<Tag(A0 , A1 , A2 , A3), Site> { typedef BOOST_DISPATCH_TYPEOF ( dispatching ( (typename meta::hierarchy_of<Tag>::type()) , (typename meta::hierarchy_of<Site>::type()) , (typename meta::hierarchy_of<A0>::type()) , (typename meta::hierarchy_of<A1>::type()) , (typename meta::hierarchy_of<A2>::type()) , (typename meta::hierarchy_of<A3>::type()) , adl_helper() ) ) type; }; template< class Tag, class Site , class A0 , class A1 , class A2 , class A3 , class A4 > struct dispatch_call<Tag(A0 , A1 , A2 , A3 , A4), Site> { typedef BOOST_DISPATCH_TYPEOF ( dispatching ( (typename meta::hierarchy_of<Tag>::type()) , (typename meta::hierarchy_of<Site>::type()) , (typename meta::hierarchy_of<A0>::type()) , (typename meta::hierarchy_of<A1>::type()) , (typename meta::hierarchy_of<A2>::type()) , (typename meta::hierarchy_of<A3>::type()) , (typename meta::hierarchy_of<A4>::type()) , adl_helper() ) ) type; }; template< class Tag, class Site , class A0 , class A1 , class A2 , class A3 , class A4 , class A5 > struct dispatch_call<Tag(A0 , A1 , A2 , A3 , A4 , A5), Site> { typedef BOOST_DISPATCH_TYPEOF ( dispatching ( (typename meta::hierarchy_of<Tag>::type()) , (typename meta::hierarchy_of<Site>::type()) , (typename meta::hierarchy_of<A0>::type()) , (typename meta::hierarchy_of<A1>::type()) , (typename meta::hierarchy_of<A2>::type()) , (typename meta::hierarchy_of<A3>::type()) , (typename meta::hierarchy_of<A4>::type()) , (typename meta::hierarchy_of<A5>::type()) , adl_helper() ) ) type; }; } } }
93f2e0422bd9dbb0a7eb9c3521c43218fd2e08a9
8184cba46a3e468faac1ff6c792e92c2720405f3
/src/main/cpp/Balau/Container/ArrayBlockingQueue.hpp
db186dbdb60e7003145cfba872fc351b1ab8e284
[ "Apache-2.0" ]
permissive
borasoftware/balau
32a08cd5e68df768805cde906fb15a86d957c1b9
8bb82e9cbf7aa8193880eda1de5cbca4db1e1c14
refs/heads/master
2021-06-07T23:27:32.126536
2021-06-01T08:22:39
2021-06-01T08:22:39
143,303,458
16
3
BSL-1.0
2019-06-16T17:21:00
2018-08-02T14:10:12
C++
UTF-8
C++
false
false
7,447
hpp
ArrayBlockingQueue.hpp
// @formatter:off // // Balau core C++ library // // Copyright (C) 2008 Bora Software (contact@borasoftware.com) // // 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. // /// /// @file ArrayBlockingQueue.hpp /// /// A blocking queue that uses wait/notify and an array to hold the elements. /// #ifndef COM_BORA_SOFTWARE__BALAU_CONTAINER__ARRAY_BLOCKING_QUEUE #define COM_BORA_SOFTWARE__BALAU_CONTAINER__ARRAY_BLOCKING_QUEUE #include <Balau/Container/BlockingQueue.hpp> #include <Balau/Type/StdTypes.hpp> #include <condition_variable> namespace Balau::Container { /// /// A blocking queue that uses wait/notify and an array to hold the elements. /// /// This queue is concurrent but not lock free. /// /// @tparam T the element type (must be default constructable in /// addition being move constructable and assignable) /// template <typename T> class ArrayBlockingQueue : public BlockingQueue<T> { public: using Callback = std::function<void (const T &)>; /// /// Create an array blocking queue with the specified capacity. /// public: explicit ArrayBlockingQueue(unsigned int capacity) : elements(capacity) , count(0) , head(0) , tail(0) , defaultQueueIsFull([] (const T &) {}) , defaultSpaceNowAvailable([] (const T &) {}) {} /// /// Create an array blocking queue with the specified capacity and default callbacks. /// public: explicit ArrayBlockingQueue(unsigned int capacity, Callback defaultQueueIsFull_, Callback defaultSpaceNowAvailable_) : elements(capacity) , count(0) , head(0) , tail(0) , defaultQueueIsFull(defaultQueueIsFull_) , defaultSpaceNowAvailable(defaultSpaceNowAvailable_) {} public: void enqueue(T object) override { enqueue(std::move(object), defaultQueueIsFull, defaultSpaceNowAvailable); } /// /// Enqueue an object, waiting for space to be available if the queue is full. /// /// The supplied full queue callbacks will be used instead of the default ones. /// /// @param object the object to move into the queue /// @param queueIsFull the callback that is called if the queue is full /// @param spaceNowAvailable the callback that is called if the queue was full and subsequently became no longer full /// public: void enqueue(T object, const Callback & queueIsFull, const Callback & spaceNowAvailable) { std::unique_lock<std::mutex> lock(mutex); if (full()) { queueIsFull(object); while (full()) { enqueueCondition.wait(lock); } spaceNowAvailable(object); } elements[head] = std::move(object); increment(head); ++count; // When two threads are dequeueing, the second thread could // miss the notify call if it is outside of the lock. dequeueCondition.notify_one(); } public: bool tryEnqueue(T object) override { return tryEnqueue( std::move(object), std::chrono::milliseconds(0), defaultQueueIsFull, defaultSpaceNowAvailable ); } public: bool tryEnqueue(T object, std::chrono::milliseconds waitTime) override { return tryEnqueue(std::move(object), waitTime, defaultQueueIsFull, defaultSpaceNowAvailable); } /// /// Enqueue an object, waiting a limited amount of time for space to be available if the queue is full. /// /// The supplied full queue callbacks will be used instead of the default ones. /// /// @param object the object to move into the queue /// @param waitTime the number of milliseconds to wait if the queue is full /// @param queueIsFull the callback that is called if the queue is full /// @param spaceNowAvailable the callback that is called if the queue was full and subsequently became no longer full /// @return true if the object was enqueued, false otherwise /// public: bool tryEnqueue(T object, std::chrono::milliseconds waitTime, const Callback & queueIsFull, const Callback & spaceNowAvailable) { std::unique_lock<std::mutex> lock(mutex); if (full()) { queueIsFull(object); auto startTime = std::chrono::system_clock::now(); auto waitTimeRemaining = std::chrono::duration_cast<std::chrono::nanoseconds>(waitTime); while (full() && waitTimeRemaining > std::chrono::nanoseconds(0)) { enqueueCondition.wait_for(lock, waitTimeRemaining); waitTimeRemaining = waitTime - (std::chrono::system_clock::now() - startTime); } if (full()) { return false; } spaceNowAvailable(object); } elements[head] = std::move(object); increment(head); ++count; // When two threads are dequeueing, the second thread could // miss the notify call if it is outside of the lock. dequeueCondition.notify_one(); return true; } public: T dequeue() override { std::unique_lock<std::mutex> lock(mutex); while (empty()) { dequeueCondition.wait(lock); } T element = std::move(elements[tail]); increment(tail); --count; // When two threads are enqueueing, the second thread could // miss the notify call if it is outside of the lock. enqueueCondition.notify_one(); return element; } public: T tryDequeue() override { return tryDequeue(std::chrono::milliseconds(0)); } public: T tryDequeue(bool & success) override { return tryDequeue(std::chrono::milliseconds(0), success); } public: T tryDequeue(std::chrono::milliseconds waitTime) override { bool success; return tryDequeue(waitTime, success); } public: T tryDequeue(std::chrono::milliseconds waitTime, bool & success) override { std::unique_lock<std::mutex> lock(mutex); if (empty()) { auto startTime = std::chrono::system_clock::now(); auto waitTimeRemaining = std::chrono::duration_cast<std::chrono::nanoseconds>(waitTime); while (empty() && waitTimeRemaining > std::chrono::nanoseconds(0)) { dequeueCondition.wait_for(lock, waitTimeRemaining); waitTimeRemaining = waitTime - (std::chrono::system_clock::now() - startTime); } } if (empty()) { success = false; return T(); } T element = std::move(elements[tail]); increment(tail); --count; // When two threads are enqueueing, the second thread could // miss the notify call if it is outside of the lock. enqueueCondition.notify_one(); success = true; return element; } public: bool full() const override { return count == elements.size(); } public: bool empty() const override { return count == 0; } ////////////////////////// Private implementation ///////////////////////// private: void increment(size_t & ptr) { ++ptr; ptr = ptr - (ptr == elements.size()) * elements.size(); } private: std::vector<T> elements; private: size_t count; private: size_t head; private: size_t tail; private: std::mutex mutex; private: std::condition_variable enqueueCondition; private: std::condition_variable dequeueCondition; private: const Callback defaultQueueIsFull; private: const Callback defaultSpaceNowAvailable; }; } // namespace Balau::Container #endif // COM_BORA_SOFTWARE__BALAU_CONTAINER__ARRAY_BLOCKING_QUEUE
84aa85b99f737c88248549c0fd139af5aa79fd9f
699a44ed02a4c70b19c5649a9b4c0cd6050e4098
/48_xTotalShapes.cpp
06d229d0b78ec84ab52c9b8790fe2acc2809a3dd
[]
no_license
blackwut/CompetitiveProgramming
0cca503f70ba39bad17b2dc9f54763859af4de2a
941ec8a0c0075153741fb7e4171bfd0068753fdf
refs/heads/master
2021-06-15T12:52:16.476817
2021-02-20T18:17:01
2021-02-20T18:17:01
151,231,227
0
0
null
null
null
null
UTF-8
C++
false
false
2,430
cpp
48_xTotalShapes.cpp
/** Author: Alberto Ottimo Problem: https://practice.geeksforgeeks.org/problems/x-total-shapes/0 Solution Description The provided matrix can be seen as a graph, in which each cell is a node with value 'O' or 'X', and it is connected with the upper, bottom, left and right node. For each node with value 'X', if it is not visited yet, compute BFS from it marking all connected node as visited. The number of computed BFS is the number of shapes in the provided matrix. Time Complexity: O(N * M) Space Complexity: O(N * M) */ #include <iostream> #include <vector> #include <algorithm> #include <queue> using namespace std; inline bool inside(const int x, const int y, const int n, const int m) { return (0 <= x and x < n and 0 <= y and y < m); } int xTotalShapes(const vector< vector<char> > & v) { const int n = v.size(); const int m = v[0].size(); const vector< pair<int, int> > dir = {{-1, 0}, {0, -1}, {0, 1}, {1, 0}}; vector< vector<bool> > visited(n, vector<bool>(m, false)); int ans = 0; for (int i = 0; i < n; ++i) { for (int j = 0; j < m; ++j) { if (!visited[i][j] and v[i][j] == 'X') { ans++; // BFS queue< pair<int, int> > q; q.push({i, j}); visited[i][j] = true; while (!q.empty()) { const pair<int, int> p = q.front(); q.pop(); for (const auto & d : dir) { const int x = p.first + d.first; const int y = p.second + d.second; if (!inside(x, y, n, m)) continue; if (!visited[x][y] and v[x][y] == 'X') { q.push({x, y}); visited[x][y] = true; } } } } } } return ans; } int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int T; cin >> T; for (int t = 0; t < T; ++t) { int N; int M; cin >> N; cin >> M; vector< vector<char> > v(N, vector<char>(M)); for (int n = 0; n < N; ++n) { for (int m = 0; m < M; ++m) { cin >> v[n][m]; } } cout << xTotalShapes(v) << '\n'; } return 0; }
52c85909b0bea682f9e0a016db98028655206c0c
188fb8ded33ad7a2f52f69975006bb38917437ef
/Fluid/processor2/0.2/Uf
365a84755c2670db86774f36b1888c50420dc8da
[]
no_license
abarcaortega/Tuto_2
34a4721f14725c20471ff2dc8d22b52638b8a2b3
4a84c22efbb9cd2eaeda92883343b6910e0941e2
refs/heads/master
2020-08-05T16:11:57.674940
2019-10-04T09:56:09
2019-10-04T09:56:09
212,573,883
0
0
null
null
null
null
UTF-8
C++
false
false
31,872
Uf
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: dev | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class surfaceVectorField; location "0.2"; object Uf; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 -1 0 0 0 0]; internalField nonuniform List<vector> 881 ( (11.1012 -1.07918e-19 1.11243) (11.8207 -4.61547e-20 1.64424) (12.4478 -2.87731e-20 0.0685342) (13.2264 3.61853e-20 0.552527) (14.1655 -9.68291e-20 1.08987) (13.7843 1.1883e-19 -1.06223) (14.7218 8.5306e-20 -0.428233) (14.1983 3.53152e-20 -2.76168) (15.141 -3.71988e-21 -2.07057) (15.3622 -1.22179e-20 -3.68755) (15.7071 -5.03009e-20 0.120071) (16.5903 1.50173e-19 0.659051) (16.0874 -3.80873e-20 -1.40233) (16.9491 -1.21231e-20 -0.780701) (16.302 -5.20649e-20 -2.94924) (17.1446 -6.29218e-20 -2.26788) (16.3023 4.12149e-20 -4.39748) (17.1413 2.74147e-20 -3.69654) (16.9208 1.24352e-20 -4.97256) (17.8599 1.88923e-19 -0.165556) (18.4315 1.12422e-19 0.392913) (18.0118 -3.80941e-20 -1.56815) (18.5866 -9.35554e-20 -0.930359) (17.9869 1.41969e-20 -2.94581) (18.5704 6.07832e-20 -2.25445) (17.7587 -5.62115e-22 -4.21259) (18.3656 9.9007e-21 -3.50531) (17.3305 -4.3117e-20 -5.29897) (17.966 -4.37098e-20 -4.61533) (16.7287 -6.15782e-20 -6.15553) (17.388 -7.9188e-21 -5.53106) (16.668 -3.41612e-20 -6.2185) (19.1682 -1.67235e-19 -0.297555) (19.3839 -2.12852e-20 0.266472) (19.148 1.37349e-21 -1.5515) (19.4001 -7.01957e-21 -0.917319) (18.9522 5.57915e-20 -2.75912) (19.2493 2.57544e-20 -2.08056) (18.572 -3.20456e-20 -3.8617) (18.9254 -2.3799e-20 -3.17097) (18.0198 -8.67222e-21 -4.80856) (18.4314 -7.96158e-21 -4.13914) (17.3241 2.03382e-20 -5.56214) (17.7876 -5.64806e-20 -4.94452) (16.5252 5.35084e-20 -6.10228) (17.0284 -1.4079e-20 -5.56062) (15.669 2.49697e-20 -6.42715) (16.1962 -8.1825e-21 -5.97723) (15.3347 -4.62439e-21 -6.19978) (19.615 1.40389e-19 -0.307158) (19.561 -4.94813e-20 0.231782) (19.5002 1.53251e-20 -1.40751) (19.506 7.58658e-20 -0.808303) (19.2221 -5.45011e-20 -2.45882) (19.2966 -5.26301e-20 -1.82159) (18.7817 2.71312e-22 -3.41892) (18.9331 5.56589e-20 -2.77049) (18.1945 -5.58892e-20 -4.24947) (18.4237 -1.67831e-21 -3.61801) (17.4881 -9.26995e-20 -4.92111) (17.7886 -7.5718e-21 -4.33268) (16.6983 -7.73584e-20 -5.41722) (17.0579 -1.64815e-21 -4.89297) (15.8643 -3.86372e-20 -5.73486) (16.2674 -2.5392e-20 -5.28929) (15.0245 -8.05961e-21 -5.88339) (15.4538 2.33627e-20 -5.5238) (14.651 -6.87838e-21 -5.60874) (19.4463 -1.17581e-19 -0.247487) (19.2381 -2.35833e-20 0.244424) (19.2971 9.18449e-21 -1.20367) (19.1584 -4.57713e-20 -0.659667) (19.0034 5.73431e-20 -2.11632) (18.9423 1.03255e-19 -1.53886) (18.57 5.49206e-20 -2.95382) (18.5927 2.20875e-21 -2.36489) (18.0122 4.7837e-20 -3.68652) (18.1192 1.03081e-21 -3.10944) (17.3538 8.54875e-20 -4.29092) (17.5394 4.7768e-20 -3.74752) (16.6249 5.20803e-20 -4.75258) (16.8782 3.94964e-20 -4.26105) (15.8578 3.67493e-20 -5.06712) (16.1646 4.49781e-20 -4.64063) (15.0843 2.52368e-20 -5.2396) (15.4286 3.74427e-21 -4.88568) (14.3325 -3.55593e-21 -5.28281) (14.698 -6.61513e-21 -5.00355) (13.6247 1.70788e-20 -5.21491) (13.9966 -1.8439e-20 -5.00775) (13.3426 -1.4783e-20 -4.91578) (18.9431 5.06481e-20 -0.16095) (18.6728 5.49281e-20 0.273457) (18.7961 4.74059e-20 -0.988321) (18.5945 -5.30241e-21 -0.508219) (18.525 4.92412e-20 -1.78061) (18.399 5.58805e-20 -1.27037) (18.1355 -5.33276e-20 -2.51311) (18.0899 -4.83656e-20 -1.9905) (17.6403 -1.59364e-22 -3.16238) (17.6757 -8.80263e-22 -2.64632) (17.0589 8.98605e-22 -3.7091) (17.1709 8.62967e-22 -3.21768) (16.4152 3.22798e-20 -4.14035) (16.5949 -4.15352e-21 -3.68912) (15.7352 1.21758e-20 -4.45061) (15.9706 3.41159e-20 -4.05142) (15.0448 -2.87548e-20 -4.64163) (15.3221 -2.25919e-20 -4.30205) (14.3671 -2.15709e-20 -4.72142) (14.6721 -3.13144e-21 -4.4447) (13.7215 -5.1086e-20 -4.70275) (14.0406 -2.74104e-21 -4.48827) (13.1222 -3.29713e-20 -4.60124) (13.4437 -1.41312e-20 -4.44533) (12.8928 -2.71591e-22 -4.33048) (18.3172 -9.17477e-22 -0.0740888) (18.0385 -4.30861e-20 0.301778) (18.1895 2.00522e-21 -0.78932) (17.9724 4.31764e-20 -0.3727) (17.9566 -4.21857e-20 -1.47801) (17.8076 -2.78344e-20 -1.03358) (17.6235 4.17824e-21 -2.12013) (17.5465 -1.86461e-21 -1.66226) (17.2004 1.39934e-22 -2.69674) (17.1961 6.10021e-21 -2.24071) (16.7022 -4.18872e-21 -3.1917) (16.7675 -4.18766e-21 -2.75245) (16.1474 -3.11244e-21 -3.59342) (16.2758 -2.02321e-20 -3.18418) (15.5567 -8.23825e-23 -3.89575) (15.7386 1.50307e-20 -3.52712) (14.9509 3.13003e-21 -4.09812) (15.175 2.20911e-20 -3.7775) (14.3491 1.61156e-20 -4.20505) (14.6036 -1.67281e-20 -3.93646) (13.7682 3.53162e-20 -4.22517) (14.0414 1.82808e-20 -4.00946) (13.2209 1.8964e-20 -4.1699) (13.5022 1.74917e-20 -4.00527) (12.7167 -1.17282e-20 -4.05213) (12.9971 1.01562e-20 -3.93476) (12.2608 -4.13556e-21 -3.88503) (12.5331 -3.10474e-21 -3.80977) (12.1144 7.2686e-21 -3.64212) (17.6874 -1.52008e-23 0.000623995) (17.4235 -1.51926e-23 0.322702) (17.5833 1.43245e-20 -0.617882) (17.3721 -8.15307e-22 -0.259256) (17.3905 1.28063e-20 -1.21714) (17.238 1.64879e-21 -0.832588) (17.1128 -7.00382e-23 -1.78065) (17.0224 -1.90786e-21 -1.38181) (16.7578 1.86638e-21 -2.29282) (16.7306 1.86578e-21 -1.8921) (16.3368 -2.02271e-20 -2.74011) (16.3709 2.77639e-21 -2.34979) (15.8641 -2.53785e-21 -3.11216) (15.9548 -2.31154e-20 -2.7435) (15.3557 3.7606e-20 -3.40264) (15.4959 1.86435e-20 -3.06504) (14.8285 2.68317e-21 -3.60952) (15.0093 1.7259e-20 -3.31001) (14.2983 -1.53401e-20 -3.73484) (14.5101 -7.32003e-22 -3.47786) (13.7795 5.30525e-23 -3.78412) (14.0125 -1.0964e-20 -3.57155) (13.2837 8.63948e-21 -3.76549) (13.5287 -1.28268e-20 -3.59693) (12.8198 1.92986e-20 -3.68867) (13.0687 4.16537e-22 -3.56191) (12.3937 8.36967e-21 -3.56409) (12.6398 3.37991e-22 -3.47557) (12.0086 -1.09209e-21 -3.40203) (12.2466 -1.71104e-21 -3.34737) (11.8916 -4.96617e-22 -3.18655) (17.1026 -8.14852e-22 0.06015) (16.8609 0 0.335311) (17.0205 -1.41347e-20 -0.47515) (16.8228 1.0134e-20 -0.167295) (16.8635 -1.36236e-20 -0.996907) (16.7154 -1.49215e-20 -0.66493) (16.6345 0 -1.4915) (16.5391 0 -1.14483) (16.3388 2.7755e-21 -1.94601) (16.2976 0 -1.59473) (15.985 6.49641e-22 -2.349) (15.997 4.97384e-22 -2.00325) (15.5839 -2.34755e-21 -2.69134) (15.646 2.56716e-21 -2.36063) (15.1482 -2.41894e-21 -2.96684) (15.2551 -3.74541e-22 -2.65943) (14.6912 1.41329e-20 -3.1726) (14.8362 -2.0267e-20 -2.89502) (14.226 4.03478e-21 -3.30896) (14.4014 4.15604e-21 -3.06577) (13.7648 -2.41242e-20 -3.37917) (13.9626 -5.52234e-22 -3.1729) (13.318 -2.15237e-20 -3.3888) (13.5304 -4.60428e-22 -3.22005) (12.8939 -1.89162e-20 -3.34501) (13.1137 -1.88116e-20 -3.2128) (12.4985 -9.85185e-21 -3.25588) (12.7197 -7.80333e-21 -3.15796) (12.1358 -1.09124e-21 -3.12974) (12.3531 -7.65286e-21 -3.06297) (11.8075 7.21443e-22 -2.97465) (12.0172 -1.05561e-21 -2.93535) (11.5138 7.47125e-22 -2.79808) (11.7131 4.73173e-21 -2.78233) (11.4408 -2.53391e-21 -2.61054) (16.5761 1.09626e-20 0.105691) (16.3573 -7.47697e-21 0.340703) (16.5123 9.92336e-21 -0.358026) (16.3297 2.00072e-21 -0.0938932) (16.3854 -1.33439e-21 -0.812469) (16.2446 -1.33387e-21 -0.526038) (16.1971 0 -1.24645) (16.1009 0 -0.945364) (15.9514 -2.34312e-21 -1.64923) (15.9014 9.76635e-21 -1.34168) (15.6546 2.62588e-21 -2.01116) (15.6505 -1.18386e-20 -1.7055) (15.3147 4.76296e-21 -2.32422) (15.3547 2.13322e-20 -2.02847) (14.9418 -1.84521e-20 -2.5826) (15.022 -2.85497e-20 -2.30394) (14.5464 -3.1156e-20 -2.78296) (14.6618 -6.41433e-21 -2.52734) (14.1392 -4.15149e-22 -2.92453) (14.2838 1.03497e-20 -2.69642) (13.7305 2.36699e-20 -3.0089) (13.8978 1.28493e-20 -2.81117) (13.3295 2.73864e-21 -3.03967) (13.5129 1.10767e-20 -2.87364) (12.9437 -7.69573e-21 -3.02199) (13.1371 -3.44509e-22 -2.88758) (12.5791 -5.52356e-21 -2.96198) (12.7768 8.60181e-22 -2.85795) (12.2398 -7.73903e-21 -2.86623) (12.4372 -1.11051e-20 -2.79048) (11.9283 2.90401e-21 -2.74139) (12.1216 -6.04837e-21 -2.69121) (11.6457 1.54467e-21 -2.59379) (11.8319 -2.62076e-21 -2.56613) (11.3917 -2.76037e-21 -2.42926) (11.569 2.51503e-21 -2.42093) (11.3322 -3.61576e-21 -2.26074) (16.1064 -1.71077e-20 0.139553) (15.9092 -5.10902e-22 0.340412) (16.0573 -9.68187e-21 -0.262555) (15.89 -1.59039e-20 -0.0359133) (15.9552 0 -0.658491) (15.8229 -7.27088e-21 -0.411466) (15.8007 9.76286e-21 -1.03909) (15.7061 -1.26169e-23 -0.777755) (15.5966 5.44025e-22 -1.39546) (15.5414 3.43067e-21 -1.12648) (15.3476 6.74283e-21 -1.71948) (15.332 -8.64745e-21 -1.44972) (15.0597 -1.15195e-20 -2.00417) (15.0826 2.26829e-20 -1.74038) (14.7407 -1.69252e-20 -2.24419) (14.7996 -1.62296e-20 -1.99256) (14.3989 3.57228e-20 -2.43607) (14.49 -9.67981e-21 -2.20195) (14.0431 2.39197e-20 -2.57831) (14.1617 1.32423e-20 -2.36593) (13.6819 0 -2.67136) (13.8228 1.06461e-21 -2.48374) (13.3231 8.17191e-21 -2.71737) (13.4809 -1.04441e-21 -2.55626) (12.9736 8.36598e-21 -2.71986) (13.143 7.56639e-21 -2.58584) (12.639 -4.57414e-21 -2.68336) (12.8151 1.45868e-21 -2.57598) (12.3235 -9.4965e-21 -2.61299) (12.502 -2.36182e-22 -2.53098) (12.03 -1.17632e-20 -2.51411) (12.2072 2.9973e-21 -2.45558) (11.7602 -1.74384e-21 -2.39202) (11.9333 -3.74709e-21 -2.35468) (11.5146 1.76497e-21 -2.25173) (11.6813 2.93453e-21 -2.23306) (11.2928 -3.70187e-21 -2.09769) (11.4518 -3.52948e-22 -2.09517) (11.2458 8.28835e-23 -1.94492) (15.6888 1.28947e-21 0.163857) (15.5112 1.21329e-20 0.335524) (15.6515 -1.3642e-20 -0.185154) (15.4989 -4.27445e-22 0.00931232) (15.5695 -7.45276e-21 -0.530171) (15.4462 -1.32403e-21 -0.317172) (15.4428 -6.70467e-21 -0.86371) (15.3514 -5.20477e-21 -0.637017) (15.2733 -5.7337e-21 -1.17847) (15.2155 -5.44418e-21 -0.943455) (15.0643 7.03709e-21 -1.46763) (15.0406 4.34795e-21 -1.22994) (14.8204 1.89146e-20 -1.72519) (14.8304 1.66413e-21 -1.49047) (14.5476 -8.92453e-21 -1.9463) (14.5895 1.78421e-20 -1.71987) (14.2523 -3.33754e-20 -2.12755) (14.3235 -1.15186e-20 -1.91414) (13.9418 -9.91642e-21 -2.26704) (14.0386 -1.10588e-20 -2.07058) (13.6231 3.16878e-23 -2.36442) (13.7413 8.13765e-23 -2.1879) (13.3029 -1.86883e-21 -2.42079) (13.4382 -1.06916e-21 -2.26621) (12.9873 6.48852e-22 -2.43842) (13.1352 -6.48504e-21 -2.30681) (12.6815 5.90858e-21 -2.42054) (12.8378 1.49339e-21 -2.31206) (12.3896 1.24244e-20 -2.37105) (12.5503 4.03078e-21 -2.28508) (12.1147 1.13146e-20 -2.29418) (12.2765 4.84905e-21 -2.22952) (11.8588 8.80022e-22 -2.19429) (12.0189 3.07224e-22 -2.14929) (11.6231 8.36229e-22 -2.07561) (11.7792 -2.17785e-21 -2.04837) (11.4078 3.48343e-21 -1.942) (11.5583 3.39831e-21 -1.93052) (11.2126 1.01706e-21 -1.7971) (11.3579 8.48849e-23 -1.79915) (11.1294 -8.33934e-22 -1.65771) (15.3178 1.08345e-20 0.180232) (15.1581 2.79685e-22 0.326763) (15.2901 1.25108e-20 -0.122813) (15.1514 2.92862e-21 0.0438877) (15.2244 1.22326e-21 -0.423383) (15.1104 6.41123e-21 -0.239847) (15.1206 -3.90354e-21 -0.7154) (15.0336 8.26791e-22 -0.518916) (14.9798 4.72782e-21 -0.992877) (14.9215 3.34575e-21 -0.787779) (14.8044 -1.05431e-21 -1.25011) (14.7754 8.64696e-21 -1.04104) (14.5977 1.03136e-22 -1.48197) (14.5981 -5.03702e-22 -1.27361) (14.3642 1.59661e-20 -1.68413) (14.393 -7.74124e-22 -1.48102) (14.1092 1.13832e-20 -1.85334) (14.1643 1.15235e-20 -1.65964) (13.8384 -1.1028e-21 -1.98752) (13.9171 7.62807e-21 -1.8068) (13.5575 -1.03237e-21 -2.08582) (13.6566 -1.03228e-21 -1.92096) (13.2723 -5.66618e-21 -2.14856) (13.3882 5.56117e-21 -2.00166) (12.988 -5.8011e-21 -2.1771) (13.1171 -8.62901e-22 -2.04948) (12.7095 -4.95682e-22 -2.17363) (12.8479 -3.65757e-21 -2.06588) (12.4406 -3.71854e-21 -2.14104) (12.585 3.54666e-21 -2.05305) (12.1843 -6.29081e-21 -2.0826) (12.3316 -7.31152e-22 -2.01372) (11.9431 -2.76445e-21 -2.00183) (12.0906 1.97254e-21 -1.95097) (11.7185 3.12855e-22 -1.90222) (11.8639 2.04602e-21 -1.86802) (11.5111 0 -1.78707) (11.6528 3.12934e-23 -1.76801) (11.3211 -1.77754e-21 -1.65958) (11.4591 4.89851e-23 -1.65385) (11.2366 -1.74297e-21 -1.5286) (14.9884 -8.01179e-21 0.189957) (14.8449 -2.06553e-21 0.314727) (14.9685 -3.39738e-21 -0.0730931) (14.8428 -6.10557e-22 0.0695367) (14.9163 6.24997e-21 -0.334728) (14.8114 3.97651e-21 -0.176835) (14.8314 8.29484e-21 -0.590036) (14.7495 2.19648e-21 -0.419994) (14.7144 7.22824e-21 -0.834095) (14.6571 -3.58634e-21 -0.655403) (14.567 9.44006e-21 -1.06215) (14.5351 4.76911e-21 -0.878596) (14.3917 -1.44773e-21 -1.26983) (14.3854 -1.56116e-21 -1.08532) (14.1919 -5.65643e-21 -1.45334) (14.2106 -4.84009e-21 -1.27171) (13.9716 7.76955e-21 -1.60967) (14.0139 -7.52517e-22 -1.43454) (13.7354 7.89243e-21 -1.7367) (13.7993 2.08974e-21 -1.57127) (13.488 5.56067e-21 -1.83327) (13.5711 6.75999e-22 -1.68026) (13.2343 1.06291e-20 -1.89918) (13.3336 -4.02451e-22 -1.7607) (12.9789 1.40376e-21 -1.9351) (13.0913 5.05316e-21 -1.81262) (12.7258 3.09629e-22 -1.94245) (12.8483 -2.80365e-21 -1.83685) (12.4788 6.7069e-21 -1.92327) (12.6083 3.69469e-21 -1.83484) (12.241 7.64746e-21 -1.88005) (12.3747 1.61657e-21 -1.80857) (12.0147 6.87841e-21 -1.81555) (12.1501 9.75299e-22 -1.76041) (11.8018 1.80568e-21 -1.73264) (11.9367 -3.52832e-23 -1.69292) (11.6032 8.4292e-23 -1.63404) (11.736 -1.08331e-21 -1.60864) (11.4197 4.79449e-23 -1.52252) (11.5501 1.5109e-21 -1.51004) (11.3349 1.08455e-22 -1.39978) (14.6964 5.5813e-21 0.194035) (14.5677 1.13762e-21 0.299822) (14.6829 6.93619e-21 -0.0340526) (14.5694 2.96149e-21 0.0875869) (14.6418 -1.29895e-22 -0.261453) (14.546 3.46036e-21 -0.125977) (14.5725 -9.91168e-21 -0.484201) (14.4963 -1.90071e-21 -0.337375) (14.4754 -6.45766e-21 -0.698249) (14.4203 -1.82349e-21 -0.542897) (14.3516 -6.48046e-21 -0.899646) (14.3184 -6.62395e-21 -0.738859) (14.2028 -5.00828e-21 -1.08469) (14.1919 -5.89014e-21 -0.921702) (14.0316 9.36772e-23 -1.25007) (14.0428 8.9596e-22 -1.08814) (13.8411 -6.66144e-21 -1.39308) (13.8735 -8.21572e-22 -1.23532) (13.635 -5.31335e-21 -1.51165) (13.6871 -4.24089e-21 -1.36092) (13.4172 -5.42584e-21 -1.60448) (13.487 1.30318e-21 -1.46326) (13.1917 -6.25488e-21 -1.67101) (13.2769 -6.77102e-21 -1.54136) (12.9623 9.34402e-22 -1.71142) (13.0604 -3.10684e-21 -1.59488) (12.7328 5.06397e-22 -1.72653) (12.8412 9.97691e-22 -1.62418) (12.5066 -1.45023e-21 -1.71775) (12.6226 -3.16271e-21 -1.63014) (12.2865 -5.16647e-21 -1.6869) (12.4077 -3.32096e-21 -1.61417) (12.0751 -6.05056e-21 -1.63612) (12.1991 -4.30315e-21 -1.57802) (11.8741 -2.95446e-21 -1.56766) (11.999 -3.28519e-21 -1.52367) (11.685 3.15796e-22 -1.48378) (11.809 -3.67952e-23 -1.45317) (11.5088 1.59146e-21 -1.38682) (11.6314 6.7216e-23 -1.36855) (11.4245 1.42236e-21 -1.2721) (14.4381 -1.67845e-21 0.193219) (14.3231 -2.75905e-21 0.282314) (14.43 -6.95012e-22 -0.00413515) (14.3279 -8.85516e-22 0.0990826) (14.398 1.7672e-21 -0.201281) (14.3111 -2.49725e-21 -0.0855036) (14.3418 6.5352e-21 -0.395018) (14.2717 4.45068e-21 -0.268658) (14.2612 -1.87423e-21 -0.58203) (14.2092 3.5041e-21 -0.447365) (14.157 -6.10764e-21 -0.759043) (14.1241 -2.96378e-21 -0.618595) (14.0306 0 -0.922937) (14.0171 -2.12836e-21 -0.779386) (13.8837 0 -1.07088) (13.8897 -2.6844e-21 -0.926957) (13.7189 1.74718e-21 -1.20043) (13.7437 5.63386e-22 -1.05882) (13.5389 2.40802e-21 -1.30967) (13.5816 7.88321e-24 -1.17288) (13.347 1.0912e-22 -1.39723) (13.406 1.16595e-22 -1.26753) (13.1465 -3.62828e-21 -1.46236) (13.2199 -9.1104e-23 -1.34169) (12.9406 -3.14255e-21 -1.5049) (13.0265 2.98348e-21 -1.39481) (12.7327 -2.65485e-21 -1.52524) (12.8289 5.8677e-21 -1.4269) (12.5258 -5.05962e-21 -1.52427) (12.6299 -4.0801e-22 -1.43844) (12.3227 -2.41467e-21 -1.50329) (12.4325 -2.59215e-21 -1.43037) (12.1256 -1.50852e-21 -1.4639) (12.2391 1.81328e-21 -1.40393) (11.9366 -3.85013e-22 -1.40786) (12.0519 5.88687e-23 -1.36064) (11.7573 -2.90148e-22 -1.33698) (11.8726 2.12043e-21 -1.30212) (11.5889 -6.56341e-23 -1.25323) (11.7037 -1.44876e-21 -1.23) (11.5056 4.55429e-22 -1.14622) (14.2106 -2.02795e-21 0.188089) (14.1083 -5.68737e-22 0.262386) (14.2069 -2.76417e-21 0.0179361) (14.1158 -4.14022e-22 0.104879) (14.1826 1.07714e-23 -0.152305) (14.1045 -1.51568e-21 -0.0539223) (14.1371 1.37377e-21 -0.320058) (14.0735 -2.36097e-22 -0.211806) (14.0704 2.5994e-21 -0.48262) (14.0224 -5.98284e-22 -0.366336) (13.9827 1.14389e-21 -0.637286) (13.9512 2.80576e-21 -0.515023) (13.8751 -4.86282e-21 -0.781445) (13.8606 3.21655e-22 -0.655416) (13.7489 -2.17934e-21 -0.912675) (13.7515 -7.15314e-22 -0.785173) (13.6059 -1.22542e-21 -1.02884) (13.6253 5.76692e-22 -0.902156) (13.4485 -2.36098e-21 -1.12818) (13.4839 -2.27422e-21 -1.00451) (13.2792 -8.34182e-23 -1.20936) (13.3295 -5.02018e-22 -1.09074) (13.1007 6.61325e-21 -1.27152) (13.1645 8.41162e-22 -1.15975) (12.9158 1.21474e-20 -1.31427) (12.9915 4.61931e-21 -1.21088) (12.7275 8.32388e-21 -1.33772) (12.8131 3.31133e-21 -1.24391) (12.5384 2.17048e-21 -1.34235) (12.632 -1.45979e-22 -1.25902) (12.351 1.62201e-21 -1.32907) (12.4507 -1.72783e-24 -1.25678) (12.1677 3.44348e-21 -1.29902) (12.2715 3.31964e-21 -1.23807) (11.9904 2.56635e-21 -1.25355) (12.0967 2.67443e-21 -1.20399) (11.8208 1.02256e-21 -1.19412) (11.9279 1.54538e-22 -1.15581) (11.6604 -9.53926e-22 -1.12231) (11.7676 -3.05594e-23 -1.09484) (11.5787 -6.91818e-22 -1.02264) (14.0114 1.11215e-21 0.179134) (13.921 6.19748e-22 0.24018) (14.0114 8.88948e-22 0.0332512) (13.9308 3.22603e-22 0.105701) (13.9935 -1.85457e-21 -0.112896) (13.924 -2.60159e-22 -0.029982) (13.957 -2.30294e-21 -0.257239) (13.9 -2.04185e-21 -0.165107) (13.9017 -4.64997e-22 -0.397578) (13.8583 0 -0.297696) (13.8278 2.06572e-21 -0.531693) (13.7989 -1.69203e-21 -0.425731) (13.736 4.66465e-21 -0.657411) (13.7219 2.59932e-21 -0.547194) (13.6272 2.11439e-21 -0.772685) (13.6282 7.92409e-22 -0.660132) (13.5029 -4.28962e-22 -0.875665) (13.5188 1.32432e-21 -0.762725) (13.3648 -4.14754e-22 -0.964774) (13.3951 -1.73704e-21 -0.853357) (13.2151 4.18021e-22 -1.03876) (13.2588 1.95379e-23 -0.930676) (13.0559 -1.30606e-21 -1.09673) (13.112 4.02289e-22 -0.993634) (12.8896 -4.40784e-21 -1.13818) (12.9568 -1.92684e-21 -1.04152) (12.7188 -5.2779e-21 -1.16298) (12.7955 -2.72199e-21 -1.07398) (12.5458 -2.36658e-21 -1.17137) (12.6304 -9.02713e-22 -1.09098) (12.373 1.66098e-21 -1.16391) (12.4637 -1.03595e-21 -1.09284) (12.2025 2.55063e-21 -1.14141) (12.2977 -1.33265e-21 -1.08013) (12.0364 2.72903e-22 -1.10489) (12.1345 4.5594e-23 -1.05365) (11.8764 -9.15287e-22 -1.05546) (11.9757 -8.82024e-22 -1.01436) (11.724 3.03719e-22 -0.994402) (11.8239 -5.02483e-22 -0.963276) (11.6439 2.88942e-22 -0.901651) (13.8385 -2.06452e-22 0.166692) (13.7594 2.7829e-23 0.215814) (13.8416 -8.6542e-22 0.0426551) (13.7711 -2.99675e-22 0.102141) (13.829 -4.0961e-22 -0.0817413) (13.7681 -4.2425e-22 -0.0126237) (13.7999 2.66643e-22 -0.204834) (13.75 5.71623e-22 -0.127069) (13.7542 -1.21561e-21 -0.324844) (13.7161 2.43738e-22 -0.239604) (13.6918 -1.24492e-21 -0.439962) (13.6662 -3.25476e-22 -0.348602) (13.6132 -1.32119e-21 -0.548398) (13.6007 -2.83421e-22 -0.452417) (13.5191 -2.89675e-23 -0.648438) (13.5198 1.93559e-22 -0.549437) (13.4105 5.82815e-23 -0.738503) (13.4244 -9.64858e-22 -0.638136) (13.2889 -1.32878e-21 -0.81721) (13.3157 -7.46662e-23 -0.717129) (13.156 0 -0.883416) (13.1949 1.01383e-21 -0.785224) (13.0135 -1.82859e-22 -0.936259) (13.0637 2.55013e-22 -0.841455) (12.8635 -1.87243e-22 -0.975173) (12.924 -1.48768e-21 -0.88512) (12.7081 1.71401e-21 -0.999905) (12.7776 2.09392e-22 -0.915789) (12.5496 4.67274e-22 -1.0105) (12.6266 -8.51783e-22 -0.933312) (12.39 -4.09243e-21 -1.00727) (12.473 2.73696e-22 -0.937808) (12.2314 -3.91935e-21 -0.99078) (12.3189 -1.79594e-21 -0.929634) (12.0757 -1.1088e-21 -0.96176) (12.1663 -1.06022e-21 -0.909347) (11.9247 -4.71243e-22 -0.921063) (12.0169 -8.21704e-23 -0.877653) (11.78 -4.8254e-22 -0.869677) (11.873 -3.89675e-22 -0.835325) (11.7016 -1.03069e-23 -0.783348) (13.6903 -7.90339e-23 0.15122) (13.622 -1.2556e-23 0.18939) (13.6961 1.54841e-22 0.0470366) (13.6354 -1.93741e-22 0.0947073) (13.6878 5.76588e-22 -0.0575399) (13.6356 1.65182e-22 -0.000928351) (13.6649 5.55993e-22 -0.161182) (13.6223 3.01456e-23 -0.0963956) (13.627 1.19937e-21 -0.262463) (13.5948 2.4947e-22 -0.190438) (13.5742 6.9071e-22 -0.359924) (13.5529 9.73778e-22 -0.281752) (13.5065 1.28263e-21 -0.452105) (13.4967 -2.90096e-22 -0.369014) (13.4247 -7.32035e-22 -0.537588) (13.4264 1.6078e-21 -0.450909) (13.3293 -1.12682e-21 -0.615049) (13.3428 -1.39184e-21 -0.52618) (13.2216 2.31393e-21 -0.683298) (13.2465 2.12942e-21 -0.593664) (13.1029 1.29298e-21 -0.741327) (13.1387 5.70716e-23 -0.652336) (12.9747 -1.04862e-21 -0.788334) (13.0208 -5.31639e-22 -0.701339) (12.8388 -1.12753e-21 -0.823751) (12.8942 -1.33675e-21 -0.740015) (12.6969 -2.3973e-21 -0.847257) (12.7606 2.14376e-22 -0.767922) (12.5511 -1.07984e-21 -0.858772) (12.6218 -2.57598e-21 -0.784836) (12.4033 2.66185e-21 -0.858449) (12.4797 1.62842e-21 -0.790755) (12.2553 1.11037e-21 -0.846644) (12.3362 1.4574e-21 -0.785879) (12.1091 -3.37808e-23 -0.823876) (12.193 1.03022e-22 -0.770579) (11.9665 7.58916e-24 -0.790771) (12.0521 -8.41492e-23 -0.74536) (11.829 1.26819e-22 -0.748087) (11.9155 5.00652e-22 -0.71079) (11.7521 -1.05565e-23 -0.667644) (13.5657 -1.59622e-22 0.132747) (13.5081 -5.96785e-23 0.161012) (13.5736 -2.07966e-22 0.046815) (13.5228 -4.99427e-23 0.0838761) (13.569 -4.07237e-22 -0.0394956) (13.5257 -5.37375e-23 0.00593826) (13.5511 -3.05554e-22 -0.125139) (13.5162 -2.52296e-22 -0.0719242) (13.5197 0 -0.20899) (13.4939 0 -0.148737) (13.4746 0 -0.289887) (13.4584 1.35271e-22 -0.223474) (13.416 0 -0.366658) (13.4099 -3.859e-23 -0.295087) (13.3442 1.02196e-21 -0.438153) (13.3483 -1.3568e-22 -0.362527) (13.2598 1.87578e-21 -0.503283) (13.2742 7.31066e-22 -0.42478) (13.1636 -1.42446e-22 -0.561053) (13.1882 4.99291e-23 -0.480894) (13.0568 -1.80803e-21 -0.610598) (13.0911 -8.34277e-22 -0.530015) (12.9407 -8.11619e-22 -0.651208) (12.9841 -8.73215e-22 -0.571412) (12.8167 0 -0.68235) (12.8685 0 -0.604501) (12.6864 9.48402e-23 -0.703682) (12.7457 0 -0.628862) (12.5515 9.71163e-23 -0.715057) (12.6173 8.29368e-22 -0.644248) (12.4139 3.95652e-22 -0.716519) (12.485 -1.29494e-22 -0.650588) (12.2753 4.5992e-22 -0.708278) (12.3505 -3.49912e-23 -0.647974) (12.1375 5.44929e-23 -0.690688) (12.2156 -2.60312e-22 -0.636643) (12.0023 4.06003e-22 -0.664195) (12.082 2.3868e-22 -0.616944) (11.8714 4.15772e-22 -0.629375) (11.9518 4.15773e-22 -0.589291) (11.7956 0 -0.554285) (13.464 3.98622e-23 0.112074) (13.4169 0 0.130786) (13.4737 1.08371e-22 0.0431152) (13.4327 2.26162e-22 0.0700888) (13.472 1.22317e-22 -0.026185) (13.4377 -8.25696e-23 0.00874292) (13.4581 5.44225e-23 -0.0950224) (13.4313 3.38791e-23 -0.0525845) (13.4319 1.35228e-22 -0.162527) (13.4131 -5.09318e-23 -0.113156) (13.3931 9.87568e-23 -0.227792) (13.3828 1.67136e-22 -0.172183) (13.3417 -1.73563e-22 -0.289897) (13.3403 -4.74537e-22 -0.228858) (13.278 -4.54085e-22 -0.347931) (13.2856 2.47811e-22 -0.282372) (13.2025 -1.13385e-21 -0.401023) (13.2191 8.29398e-23 -0.331933) (13.1157 -6.4966e-22 -0.448366) (13.1413 -6.91912e-22 -0.376793) (13.0187 1.27965e-22 -0.489245) (13.0528 4.57309e-22 -0.416268) (12.9124 -5.56538e-23 -0.523057) (12.9547 5.78133e-22 -0.449762) (12.7982 0 -0.549333) (12.8479 0 -0.476786) (12.6775 7.33958e-22 -0.567751) (12.7339 4.94317e-22 -0.496974) (12.5518 6.18822e-22 -0.578138) (12.6139 7.51527e-22 -0.510091) (12.4227 -5.72451e-22 -0.580473) (12.4897 -1.32588e-22 -0.516034) (12.292 -7.65225e-22 -0.574872) (12.3626 -4.50405e-22 -0.514833) (12.1615 -8.36795e-23 -0.561566) (12.2346 -4.4287e-23 -0.506633) (12.0327 2.44421e-22 -0.540869) (12.1072 -1.72009e-22 -0.491671) (11.9074 0 -0.513209) (11.9825 0 -0.470241) (11.8323 8.29768e-23 -0.442794) (13.3847 1.8528e-22 0.0885308) (13.3484 0 0.0988478) (13.3959 3.75658e-23 0.0356357) (13.3651 1.27165e-22 0.0537834) (13.3963 -1.86609e-22 -0.0175422) (13.3717 -5.42727e-23 0.00821994) (13.3857 -8.32378e-23 -0.0704013) (13.3677 -6.94017e-23 -0.037356) (13.3635 -2.34638e-23 -0.122289) (13.3527 -3.08168e-23 -0.0824071) (13.3295 -4.12708e-22 -0.172523) (13.3262 -8.29498e-24 -0.126355) (13.2838 -5.89198e-23 -0.220412) (13.2883 -2.60694e-22 -0.168608) (13.2265 8.14119e-22 -0.26527) (13.2388 4.02836e-22 -0.208575) (13.1579 5.61614e-22 -0.306434) (13.1781 1.88174e-22 -0.245674) (13.0785 4.13787e-22 -0.343283) (13.1064 1.41782e-22 -0.279347) (12.9891 9.16384e-22 -0.375257) (13.0245 1.75006e-23 -0.309082) (12.8907 6.53223e-22 -0.401877) (12.9331 6.53095e-22 -0.334424) (12.7842 4.94249e-22 -0.422758) (12.8331 0 -0.354995) (12.6711 5.06141e-22 -0.437622) (12.7257 -1.86848e-22 -0.370503) (12.5528 0 -0.446306) (12.6123 2.48438e-22 -0.38075) (12.4306 0 -0.44876) (12.4941 -1.82575e-22 -0.38564) (12.3063 2.75333e-22 -0.445039) (12.3729 -4.23848e-23 -0.385171) (12.1816 -1.30364e-22 -0.435294) (12.2501 1.57048e-22 -0.379431) (12.058 -4.23721e-22 -0.419742) (12.1275 -1.56628e-23 -0.368581) (11.9375 8.29764e-23 -0.398699) (12.0071 -1.47618e-22 -0.352834) (11.8617 9.09312e-24 -0.33254) (13.3281 -5.95043e-23 0.0640118) (13.302 1.61733e-23 0.065312) (13.3404 3.6576e-23 0.0264228) (13.3193 8.97811e-23 0.0353489) (13.3426 6.3033e-23 -0.0113962) (13.327 -1.27091e-23 0.00504271) (13.3343 -9.65295e-24 -0.0490239) (13.3245 -2.03056e-24 -0.0252749) (13.3151 -1.55329e-23 -0.0859961) (13.3114 3.29814e-23 -0.0552376) (13.2847 1.53576e-22 -0.121826) (13.2873 -7.55477e-23 -0.0844632) (13.2431 2.04578e-22 -0.156023) (13.2522 1.7616e-22 -0.11257) (13.1904 -2.38935e-22 -0.1881) (13.2059 -2.85854e-23 -0.139171) (13.1268 -2.44701e-22 -0.217586) (13.1486 -2.44626e-22 -0.163882) (13.0527 -2.6593e-22 -0.244034) (13.0807 -9.29253e-23 -0.186334) (12.9689 -2.72343e-22 -0.267042) (13.0027 -2.72276e-22 -0.206184) (12.876 0 -0.28626) (12.9153 0 -0.223128) (12.7752 -6.98981e-22 -0.301404) (12.8194 1.02123e-22 -0.236908) (12.6676 -4.6741e-22 -0.312264) (12.7161 -4.50783e-22 -0.247326) (12.5545 7.03857e-23 -0.318712) (12.6067 1.47293e-22 -0.254241) (12.4374 -2.30783e-22 -0.320699) (12.4924 -3.28663e-23 -0.257584) (12.3178 -1.683e-22 -0.318255) (12.3748 -6.25235e-23 -0.257347) (12.1972 2.8223e-22 -0.311481) (12.2555 -1.89168e-24 -0.253585) (12.0775 2.7145e-22 -0.300532) (12.1361 2.2541e-22 -0.246411) (11.9604 -2.46753e-22 -0.285653) (12.0185 -1.51513e-23 -0.235979) (11.8767 -7.95957e-23 -0.222571) (13.2926 1.67522e-22 0.0362512) (13.1678 -6.29146e-23 0.0306059) (13.3055 4.40988e-23 0.0138034) (13.1839 1.312e-22 0.0155926) (13.3086 -7.8629e-23 -0.00873442) (13.1905 -1.01707e-22 0.000483504) (13.3014 3.79677e-23 -0.0311046) (13.1873 -5.11244e-24 -0.0145379) (13.2835 -2.68218e-23 -0.0530522) (13.1737 2.07789e-24 -0.0293355) (13.2547 -5.86424e-23 -0.0743107) (13.1496 -2.96387e-23 -0.0437608) (13.2149 -5.769e-23 -0.0946001) (13.1146 -3.45317e-23 -0.0576322) (13.1641 -2.92656e-23 -0.113635) (13.0689 -2.34671e-23 -0.0707589) (13.1027 -9.28977e-23 -0.131137) (13.0125 0 -0.0829522) (13.0309 -9.51405e-23 -0.14684) (12.9458 -1.92984e-23 -0.094031) (12.9495 0 -0.160503) (12.8693 1.12128e-23 -0.103826) (12.8592 1.02103e-22 -0.171917) (12.7836 0 -0.112187) (12.7609 3.64601e-22 -0.180909) (12.6896 2.07806e-23 -0.118986) (12.6558 1.65427e-22 -0.187354) (12.5884 1.51498e-22 -0.124122) (12.5453 4.33302e-23 -0.191171) (12.4812 -9.35241e-23 -0.127526) (12.4306 1.33169e-22 -0.192329) (12.3691 1.52976e-22 -0.129158) (12.3134 1.02486e-22 -0.190847) (12.2539 -2.73732e-23 -0.129016) (12.1953 -6.28104e-23 -0.186789) (12.1368 1.38888e-22 -0.127126) (12.0778 -6.15961e-23 -0.180272) (12.0197 -1.9847e-22 -0.123555) (11.9629 1.33921e-22 -0.171521) (11.9042 1.33155e-22 -0.11842) (11.7648 7.40865e-25 -0.112085) (13.0563 -1.05336e-22 0.0100078) (13.0662 -1.26831e-23 0.00242943) (13.0665 -2.85758e-23 -0.00510823) (13.057 -4.17002e-23 -0.0125184) (13.0372 -8.92279e-26 -0.0197378) (13.0069 -4.84214e-24 -0.0267005) (12.9661 -1.49855e-25 -0.0333275) (12.9148 5.92993e-24 -0.0395334) (12.8532 7.9532e-23 -0.045232) (12.7818 9.28938e-23 -0.0503405) (12.7011 1.14814e-23 -0.054782) (12.6119 -8.79513e-23 -0.0584883) (12.515 -2.09373e-22 -0.0614021) (12.4116 -1.10384e-22 -0.0634788) (12.303 1.14165e-23 -0.0646882) (12.1904 -7.79043e-24 -0.0650155) (12.0753 6.24129e-24 -0.0644621) (11.9593 7.75756e-24 -0.0630481) (11.844 -7.02491e-24 -0.0608154) (11.7309 -4.16787e-24 -0.057902) ) ; boundaryField { inlet { type calculated; value nonuniform 0(); } outlet { type calculated; value nonuniform List<vector> 15 ( (11.0363 1.88654e-21 -1.72138) (11.1481 -3.59743e-21 -1.59235) (11.2513 1.35255e-22 -1.46317) (11.3459 6.20109e-23 -1.33474) (11.4321 2.7991e-21 -1.20784) (11.5102 -1.93073e-21 -1.08303) (11.5804 5.71054e-22 -0.960719) (11.643 0 -0.84109) (11.6982 -2.08633e-23 -0.724155) (11.7463 0 -0.609717) (11.7874 0 -0.4975) (11.8216 1.67962e-22 -0.386699) (11.8476 -1.57312e-22 -0.277159) (11.8524 0 -0.166564) (11.6214 1.49965e-24 -0.0562831) ) ; } flap { type calculated; value nonuniform 0(); } upperWall { type calculated; value uniform (0 0 0); } lowerWall { type calculated; value nonuniform 0(); } frontAndBack { type empty; value nonuniform 0(); } procBoundary2to1 { type processor; value nonuniform List<vector> 17 ( (16.5776 0 0.567762) (16.1035 -1.49241e-20 0.539067) (15.6824 1.44166e-20 0.509787) (15.3086 4.62123e-21 0.48004) (14.9771 -4.09254e-21 0.449841) (14.6833 2.62533e-21 0.419142) (14.4235 -8.55417e-22 0.387838) (14.1946 -1.4172e-21 0.355785) (13.9943 3.49806e-22 0.322851) (13.8203 0 0.28885) (13.6712 2.78202e-23 0.253803) (13.5458 -1.49714e-22 0.217348) (13.4434 0 0.17996) (13.3635 0 0.140599) (13.3064 2.7901e-22 0.100999) (13.2707 3.76054e-23 0.0583625) (13.0374 -1.19234e-22 0.0175228) ) ; } procBoundary2to4 { type processor; value nonuniform List<vector> 11 ( (10.4565 0 2.55322) (12.6208 1.06663e-19 1.93557) (15.2546 -7.20113e-20 1.4904) (17.5908 9.6067e-20 1.16553) (19.0441 -6.92474e-21 0.937409) (19.5807 -8.44887e-21 0.797968) (19.4557 -1.16767e-19 0.72014) (18.9665 9.26932e-20 0.676566) (18.3391 -4.32246e-20 0.647443) (17.7022 1.40289e-20 0.621768) (17.1102 -1.36486e-20 0.595443) ) ; } procBoundary2to5 { type processor; value nonuniform List<vector> 34 ( (9.90271 3.96216e-20 2.21381) (10.4912 -6.72613e-20 0.551714) (11.6623 -7.95987e-20 -0.601946) (12.9843 6.43883e-20 -1.70984) (13.3389 6.90922e-20 -3.50384) (14.4103 -2.51039e-20 -4.39193) (15.357 2.77054e-20 -5.15124) (16.0776 5.65218e-20 -5.64853) (16.4919 1.10742e-21 -6.02398) (15.8896 -8.67633e-20 -6.80548) (15.9964 -4.52258e-20 -6.75645) (15.8538 4.2919e-20 -6.66566) (14.9962 5.14381e-21 -6.88132) (14.8008 0 -6.55111) (14.4845 -3.32582e-21 -6.24657) (14.2124 -6.656e-21 -5.88176) (13.8872 -3.35856e-21 -5.56367) (13.183 1.93347e-20 -5.41233) (12.9768 1.74816e-20 -5.05688) (12.748 0 -4.74689) (12.5787 -2.12301e-20 -4.43367) (12.3949 -3.32342e-20 -4.15887) (11.953 6.62355e-21 -3.945) (11.8554 7.4256e-21 -3.68112) (11.7424 -9.75442e-22 -3.44289) (11.6655 -1.5117e-21 -3.21214) (11.575 -3.01859e-22 -3.00162) (11.2956 3.96458e-22 -2.80016) (11.2536 3.2363e-22 -2.60664) (11.1988 1.59505e-22 -2.42578) (11.1652 -2.38775e-21 -2.25283) (11.1224 -2.44463e-21 -2.08995) (11.0937 -9.93974e-22 -1.93396) (11.013 -8.58198e-23 -1.78612) ) ; } } // ************************************************************************* //
e437a3a56bf67aa9b439f313afc30aa87e48ff6b
1225ff620f3a826dff1bd48908e896bd3fcebd1d
/Labyrinthe3D/glcolor.cpp
a63f24227a3dbcb1786cffad025233d6ee9b7674
[]
no_license
Richard-Drogo/Labyrinthe3D
044b0ec60ee1475933c2ebb2ab0e829404589df3
06e00b5e2eed2c747c675124048df86067011864
refs/heads/master
2023-05-23T11:59:07.293125
2020-04-12T14:19:43
2020-04-12T14:19:43
243,475,811
1
0
null
2020-04-11T23:08:34
2020-02-27T09:04:58
null
UTF-8
C++
false
false
517
cpp
glcolor.cpp
#include "glcolor.h" #include "rgbcolor.h" GLColor::GLColor(GLclampf red, GLclampf green, GLclampf blue) { // nouvelle couleur avec 3 paramètres this->red_ = red; this->green_ = green; this->blue_ = blue; } GLColor::GLColor(RGBColor color) { // nouvelle coueleur avec une couleur this->red_ = color.getRed(); this->green_ = color.getGreen(); this->blue_ = color.getBlue(); } GLColor::GLColor() { // couleur noir this->red_ = 0; this->green_ = 0; this->blue_ = 0; }
cc4c282af0c7dd45ba80fbab268c4c36f12284b7
d160bb839227b14bb25e6b1b70c8dffb8d270274
/MCMS/Main/Processes/MplApi/MplApiLib/MplApiMonitor.cpp
e7cb7d83c41781c00d3c57fa3270007e4ba95a46
[]
no_license
somesh-ballia/mcms
62a58baffee123a2af427b21fa7979beb1e39dd3
41aaa87d5f3b38bc186749861140fef464ddadd4
refs/heads/master
2020-12-02T22:04:46.442309
2017-07-03T06:02:21
2017-07-03T06:02:21
96,075,113
1
0
null
null
null
null
UTF-8
C++
false
false
1,495
cpp
MplApiMonitor.cpp
// MplApiMonitor.cpp: implementation of the MplApiMonitor class. // ////////////////////////////////////////////////////////////////////// #include "MplApiMonitor.h" #include "TaskApi.h" #include "OpcodesMcmsCommon.h" #include "Macros.h" //////////////////////////////////////////////////////////////////////////// // Message Map //////////////////////////////////////////////////////////////////////////// PBEGIN_MESSAGE_MAP(CMplApiMonitor) ONEVENT(XML_REQUEST ,IDLE , CMplApiMonitor::HandlePostRequest) PEND_MESSAGE_MAP(CMplApiMonitor,CAlarmableTask); //////////////////////////////////////////////////////////////////////////// // Transaction Map //////////////////////////////////////////////////////////////////////////// BEGIN_GET_TRANSACTION_FACTORY(CMplApiMonitor) //ON_TRANS("TRANS_MCU","LOGIN",COperCfg,CMplApiMonitor::HandleOperLogin) END_TRANSACTION_FACTORY //////////////////////////////////////////////////////////////////////////// // Entry point //////////////////////////////////////////////////////////////////////////// void MplApiMonitorEntryPoint(void* appParam) { CMplApiMonitor *monitorTask = new CMplApiMonitor; monitorTask->Create(*(CSegment*)appParam); } ////////////////////////////////////////////////////////////////////// // Construction/Destruction ////////////////////////////////////////////////////////////////////// CMplApiMonitor::CMplApiMonitor() { } CMplApiMonitor::~CMplApiMonitor() { }
5bf672fb693a67c9b2f5d1cb461631debba0817b
843c051bffb7631307a402f263ecbee4a4a91fc1
/chap5/p4.cc
92305106b6e54d5760e3d7ac6dafea45682ccad7
[]
no_license
baolidakai/cppLab
869e3f4d253718e3beec8cd2dfef712ce0dc5293
6786bf0d0a8d2c073957b2e07e6a8f23329b943c
refs/heads/master
2021-01-10T14:04:15.808945
2016-04-12T07:08:03
2016-04-12T07:08:03
55,671,392
0
0
null
null
null
null
UTF-8
C++
false
false
623
cc
p4.cc
/** * 4. How do you remove the first element from a vector? From a deque? * Answer: erase and pop_front */ #include <iostream> #include <vector> #include <deque> using namespace std; int main() { vector<int> myVector; for (int i = 0; i < 10; i++) { myVector.push_back(i); } myVector.erase(myVector.begin()); for (size_t i = 0; i < myVector.size(); i++) { cout << myVector[i] << " "; } cout << endl; deque<int> myDeque; for (int i = 0; i < 10; i++) { myDeque.push_back(i); } myDeque.pop_front(); for (size_t i = 0; i < myDeque.size(); i++) { cout << myDeque[i] << " "; } cout << endl; return 0; }
0346c32d51bcb851229fc6d93dadd7264b0ebcdb
753b19f19343aa93b8fb45a1c9ca743fd1a3bdd5
/9 Project Code/Project/Project/ReadFile.cpp
69101e7f4e8a35c8593220db92b0f86ee70ba74a
[]
no_license
amritakohli/DatabaseHandler
ce07fd83ce8313c795def2b54a3f4ec34eb87879
389320127c1509590b4509aa25c357e7c75eb2f2
refs/heads/master
2022-10-28T05:06:24.858779
2020-06-19T07:10:24
2020-06-19T07:10:24
273,428,621
0
0
null
null
null
null
UTF-8
C++
false
false
534
cpp
ReadFile.cpp
//File Input/Output //Created by Charu Shekhar #include <iostream> #include <fstream> #include <string> using namespace std; #include "HashADT.h" //#define DEBUG //If DEBUG is defined, then some debug cout's are printed //Below is the real readShootings functions, using class Shootings in templated HashTable //void readShootings(string filename, HashTable <Shootings> &hashTable) //Just for testing - Using string in templated HashTable, just for testing //Replace this with the correct templated class as above
91a89e50a856353a240849166f5319dc8e940ed9
4e9e492e752e43400f0b728f854f842d13ba4bad
/CodeForces/ER42/D.cpp
03e39bc9720ab3c8f5a710ba906dd52e12900966
[]
no_license
jocagos/competitive
0ac497b7e6c30e548e0d7e298df0f2892e7e03b1
89c8467b56d4be10c80189b154e2edadfb6a9f3f
refs/heads/master
2021-07-05T23:53:23.607682
2021-05-27T22:17:13
2021-05-27T22:17:13
84,216,647
0
0
null
null
null
null
UTF-8
C++
false
false
753
cpp
D.cpp
#include <iostream> #include <algorithm> #include <vector> #include <cstdio> #include <utility> using namespace std; pair<auto, auto> minSame; int main(){ int n; scanf("%d ", &n); vector<int> nums(n); for( int i = 0; i < n; ++i ) scanf("%d", &nums[i]); auto minLIdx = min_element(nums.begin(), nums.end()); auto minRIdx = min_element(minLIdx+1, nums.end()); while( *minLIdx == *minRIdx ){ nums.erase(minLIdx); *minRIdx *= 2; n = nums.size(); minLIdx = min_element(nums.begin(), nums.end()); minRIdx = min_element(minLIdx+1, nums.end()); } printf("%d\n", nums.size()); for( int i = 0; i < nums.size(); ++i ) printf("%d%s", nums[i], (i+1 == nums.size() ? "\n" : " ") ); return 0; }
6987b1271aa344fe61f7aa0d019afa25757fc9bd
309a6ae22925b27f01bc3e5bcd1a2545115c43c2
/source/TextureManager/TextureManager.cpp
b57cd607be2886bcbba2849a6c5d09109dca0287
[]
no_license
skyser2003/FG_DX_Engine
9d532ee14096b34e284e994626267c775387f06b
98473e60ff23321eebf3480cd4630fdf9b4c3f3f
refs/heads/master
2021-03-12T19:23:16.472276
2014-10-04T14:25:50
2014-10-04T14:25:50
null
0
0
null
null
null
null
UTF-8
C++
false
false
745
cpp
TextureManager.cpp
#include "dxstdafx.h" #include "TextureManager.h" #include "Texture/textureclass.h" namespace FG { TextureManager::TextureManager() : mDevice(nullptr), nextTextureID(0) { } std::shared_ptr<TextureClass> TextureManager::CreateTexture(const std::string& fileName) { if (mDevice == nullptr) { return nullptr; } std::shared_ptr<TextureClass> texture(new TextureClass); bool ret = texture->Initialize(mDevice, fileName.c_str()); if (ret == false) { return nullptr; } auto it = mTextures.find(fileName); if (it != mTextures.end()) { return it->second; } mTextures.insert(std::make_pair(fileName, texture)); return texture; } void TextureManager::SetDevice(ID3D11Device* device) { mDevice = device; } }
5cb52563683d5b663b468e694d5f726243e603f6
bf4af562b69de5b99e7df4acfdecb8614148fbc9
/Problem 3.cpp
0b767dffcdaa963309d6d728ca37ec58a0029697
[]
no_license
kyleanisco/Experiments
117c21f0e92db50c837ac303d505d532ee9b255d
21977016d6980d1e4acba4efc68037bece92d6ad
refs/heads/master
2020-05-02T05:42:02.815641
2019-03-26T14:55:08
2019-03-26T14:55:08
177,778,148
0
0
null
null
null
null
UTF-8
C++
false
false
1,056
cpp
Problem 3.cpp
#include <iostream> #include <conio.h> #include<iomanip> #include <math.h> using namespace std; int main() { double AvgDailyBalance; double Interest; double day1; double day2; double netbalance; float payment; float interest; cout << "How much is the bill to be paid? \n"; cin >> netbalance; cout << "How many days are in the billing cycle? \n"; cin >> day1; cout << "How much is the payment of the customer? \n"; cin >> payment; cout << "How many days are there before the cycle ends? \n"; cin >> day2; cout<< "============================================= \n"; AvgDailyBalance=(netbalance*day1-payment*day2)/day1; cout<< setprecision(2)<<fixed; cout << "Balance:"<<AvgDailyBalance<<"pesos"<<endl; cout<< "============================================= \n"; interest=AvgDailyBalance*0.0152; cout<< "Interest:"<<interest<<endl; cout<< "============================================= \n"; getch(); return 0; }
4583c76b3be6a3c14818c01519efbb8a5601a7e7
7a0aad14b58128183847a9f1e7713b075a99adb3
/src/OpenSimCreator/Model/VirtualConstModelStatePair.hpp
11190890d825f06cb70546779399ab49d14fee51
[ "Apache-2.0" ]
permissive
ComputationalBiomechanicsLab/opensim-creator
506f542e69be6f2df0aaf933bb636a5c13352a2f
f1559723b4dd6f995f6c26714ab206fd1c5e25d9
refs/heads/main
2023-09-04T00:55:42.904588
2023-09-03T19:03:51
2023-09-03T19:03:51
362,721,375
96
9
Apache-2.0
2023-01-12T15:05:18
2021-04-29T07:02:50
C++
UTF-8
C++
false
false
2,762
hpp
VirtualConstModelStatePair.hpp
#pragma once #include <oscar/Utils/UID.hpp> #include <optional> namespace OpenSim { class Component; } namespace OpenSim { class Model; } namespace SimTK { class State; } namespace osc { // virtual readonly accessor to a `OpenSim::Model` + `SimTK::State` pair, with // additional opt-in overrides to aid rendering/UX etc. class VirtualConstModelStatePair { protected: VirtualConstModelStatePair() = default; VirtualConstModelStatePair(VirtualConstModelStatePair const&) = default; VirtualConstModelStatePair(VirtualConstModelStatePair&&) noexcept = default; VirtualConstModelStatePair& operator=(VirtualConstModelStatePair const&) = default; VirtualConstModelStatePair& operator=(VirtualConstModelStatePair&&) noexcept = default; public: virtual ~VirtualConstModelStatePair() noexcept = default; OpenSim::Model const& getModel() const { return implGetModel(); } UID getModelVersion() const { return implGetModelVersion(); } SimTK::State const& getState() const { return implGetState(); } UID getStateVersion() const { return implGetStateVersion(); } OpenSim::Component const* getSelected() const { return implGetSelected(); } template<typename T> T const* getSelectedAs() const { return dynamic_cast<T const*>(getSelected()); } OpenSim::Component const* getHovered() const { return implGetHovered(); } // used to scale weird models (e.g. fly leg) in the UI float getFixupScaleFactor() const { return implGetFixupScaleFactor(); } private: virtual OpenSim::Model const& implGetModel() const = 0; virtual UID implGetModelVersion() const { // assume the version always changes, unless the concrete implementation // provides a way of knowing when it doesn't return UID{}; } virtual SimTK::State const& implGetState() const = 0; virtual UID implGetStateVersion() const { // assume the version always changes, unless the concrete implementation // provides a way of knowing when it doesn't return UID{}; } virtual OpenSim::Component const* implGetSelected() const { return nullptr; } virtual OpenSim::Component const* implGetHovered() const { return nullptr; } virtual float implGetFixupScaleFactor() const { return 1.0f; } }; }
813ba500e3caedc8be7d2d0cde3f632857d0aadf
d05de0ebfab6f9b537745e01b13ead62b8b97dfd
/Level 1/Section 1.2/Exercise 2/Exercise 2/main.cpp
f9216424a376632cfce18cc32348ac602b657ab4
[]
no_license
ssw1991/C-Projects
7aadbe58a0fdff0afa28508a9f5a5897cb5a9b03
59b3fccdb9ab9f6666bc2a188d6ee1405d036675
refs/heads/master
2020-03-26T23:00:52.726534
2018-08-21T03:49:52
2018-08-21T03:49:52
145,503,378
0
0
null
null
null
null
UTF-8
C++
false
false
3,694
cpp
main.cpp
#include <iostream> #include <string> #include <vector> #include <chrono> class Test { /* Class to test copyswap and move swap functions and count the constructor calls Class is not complete, only has the functions required too count constructor calls and test the move */ public: std::string m_data; static int count; // To count constructor calls Test() : m_data("String") { std::cout << "C0" << std::endl; Test::count++; }; Test(std::string s) : m_data(s) { std::cout << "C1" << std::endl; Test::count++; }; Test(Test& source) : m_data(source.m_data) { std::cout << "C3" << std::endl; Test::count++; } Test(Test&& source) { m_data = std::move(source.m_data); }; Test& operator = (Test&& source) { m_data = std::move(source.m_data); return *this; }; Test& operator = (const Test& source) { if (this == &source) return *this; // Exit if same object. // Delete old data, allocate new and copy data. m_data=source.m_data; return *this; } }; int Test::count = 0; template < typename T > void SwapCopyStyle(T& a, T& b) { // Swap a and b in copying way; temporary object needed T tmp(a); // Copy constructor a = b; // Copy all elements from b to a Had to create an explicit = overload b = tmp; // Copy all elements from tmp to b } template < typename T > void SwapMoveStyle(T& a, T& b) { // Swap a and b in copying way; temporary object needed T tmp = std::move(a); // moves a = std::move(b); // Move elements from b to a b = std::move(tmp); //move elements from tmp to b } int main() { std::string target = "I am a the target"; std::string source = "I am the source"; std::cout << "Before Move:\nTarget: " << target << "\nSource: " << source << std::endl; source = std::move(target); std::cout << "After Move:\nTarget: " << target << "\nSource: " << source << std::endl; std::vector<double> v1; std::vector<double> v2; std::vector<double> v3; std::vector<double> v4; // Fill vectors 1 and 4 for (int i = 0; i < 1000000; i++) { v1.push_back(i / 10.0); v4.push_back(i / 20.0); } // Time the copy swap auto start = std::chrono::high_resolution_clock::now(); v2 = v1; auto end = std::chrono::high_resolution_clock::now(); auto duration = end - start; std::cout << "Duration for copy is: " << duration.count() << std::endl; // Time the move swap start = std::chrono::high_resolution_clock::now(); v3 = std::move(v1); end = std::chrono::high_resolution_clock::now(); duration = end - start; std::cout << "Duration for move is: " << duration.count() << std::endl; Test a("hi"); // Calls c1 Test b("by"); // Calls c1 std::cout << "Current Constructor Call: " << Test::count << std::endl; Test::count = 0; SwapCopyStyle(a, b); //Calls C3, copy constructor std::cout << "New calls to constructor because of swap: " << Test::count << std::endl; Test::count = 0; SwapMoveStyle(a, b); std::cout << "New calls to constructor because of swap using move: " << Test::count << std::endl; start = std::chrono::high_resolution_clock::now(); SwapCopyStyle(v3, v4); end = std::chrono::high_resolution_clock::now(); auto duration1 = end - start; std::cout << "Duration for Vector Swap copystyle is: " << duration1.count() << std::endl; start = std::chrono::high_resolution_clock::now(); SwapMoveStyle(v3, v4); end = std::chrono::high_resolution_clock::now(); auto duration2 = end - start; std::cout << "Duration for Vector Swap move style is: " << duration2.count() << "\nperformance increase is: " << static_cast<double>((duration1.count() - duration2.count())) / duration1.count() << std::endl; }
e01673f7db330ef2f48b80125dbcce646945ec7c
67c856a66973b16ae8472b9f32223ed082f7c612
/boj/1307.cpp
7a6d686a245751b78c86b05d0e5603ed0568b912
[]
no_license
jin60641/acm
9d5739f6cb4e745766daa9a1a589482c2a546b61
b07c578f998816d60890d049da322e66f40f5928
refs/heads/master
2021-01-23T06:15:16.831142
2019-09-20T03:00:56
2019-09-20T03:00:56
86,347,575
0
0
null
null
null
null
UTF-8
C++
false
false
2,520
cpp
1307.cpp
#include <stdio.h> const int N = 310; int main(){ int nMagicSqr[N][N]; int nN; void makeMagicSquare(int nMagicSqr[][N], int nN); void showMagicSquare(int nMagicSqr[][N], int nN); scanf("%d", &nN); makeMagicSquare(nMagicSqr, nN); showMagicSquare(nMagicSqr, nN); return 0; } void makeMagicSquare(int nMagicSqr[][N], int nN){ void OddMagicSquare(int nMagicSqr[][N], int nN, int nOrgRow, int nOrgcol, int nBgn); void DblyEvenMagicSquare(int nMagicSqr[][N], int nN); void SnglyEvenMagicSquare(int nMagicSqr[][N], int nN); if( nN%2 ){ OddMagicSquare(nMagicSqr, nN, 0, 0, 1 ); } else if( nN % 4 == 0 ){ DblyEvenMagicSquare(nMagicSqr, nN ); } else { SnglyEvenMagicSquare(nMagicSqr, nN ); } } void OddMagicSquare(int nMagicSqr[][N], int nN, int nOrgRow, int nOrgCol, int nBgn){ int nRow = nOrgRow, nCol = nOrgCol + nN/2, nNmbr = nBgn, nCell = nN * nN + nBgn-1; nMagicSqr[nRow][nCol] = nBgn; while (++nNmbr <= nCell) { int nPrvRow = nRow, nPrvCol = nCol; nRow = (nRow - 1)<nOrgRow?nOrgRow+nN-1:nRow-1; nCol = (nCol + 1)>=(nN+nOrgCol)?nOrgCol:nCol+1; if (nMagicSqr[nRow][nCol]) { nRow = (nPrvRow + 1)>=(nN+nOrgRow)?nPrvRow:nPrvRow+1; nCol = nPrvCol; } nMagicSqr[nRow][nCol] = nNmbr; } } void DblyEvenMagicSquare(int nMagicSqr[][N], int nN){ for(int i = 0; i < nN; i++) for(int j = 0; j < nN; j++) nMagicSqr[i][j] = ( ( (i>=j && (i-j) % 4 == 0 ) || ( j>=i && (j-i) % 4 == 0 ) ) || ((i+j+1) % 4 == 0) )?i*nN+j+1:nN*nN-(i*nN+j); } void SnglyEvenMagicSquare(int nMagicSqr[][N], int nN){ int nH = nN / 2, nSqr = nH * nH; for (int i = 0; i < 2; i++) for (int j = 0; j < 2; j++) OddMagicSquare(nMagicSqr, nH, j * nH, (i ^ j) * nH, ((i * 2) + j) * nSqr + 1); int nQ = nH / 2; void SwitchHalf(int nMagicSqr[][N], int nCol, int nHalf); for (int nCol = 0; nCol < nQ; nCol++) SwitchHalf(nMagicSqr, nCol, nH); for (int nCol = nH + nQ + 2; nCol < nN; nCol++) SwitchHalf(nMagicSqr, nCol, nH); void Swap(int& x, int& y);; Swap(nMagicSqr[nQ][0], nMagicSqr[nQ + nH][0]); Swap(nMagicSqr[nQ][nQ], nMagicSqr[nQ + nH][nQ]); } void SwitchHalf(int nMagicSqr[][N], int nCol, int nHalf){ void Swap(int& x, int& y); for (int nRow = 0; nRow < nHalf; nRow++) Swap(nMagicSqr[nRow][nCol], nMagicSqr[nRow + nHalf][nCol]); } void Swap(int& x, int& y){ int t = x; x = y; y = t; } void showMagicSquare(int nMagicSqr[][N], int nN){ for (int nRow = 0; nRow < nN; nRow++) { for (int nCol = 0; nCol < nN; nCol++) printf("%d ", nMagicSqr[nRow][nCol]); printf("\n"); } }
6def314a3461214fa7f2f5a97d7dc0ddab4ee559
e1133df32b245dabaa09664cc29d720b395445e3
/include/config.h
37d45159cba57cedd752563683967afeccfee55f
[]
no_license
guozanhua218/gameserver
6ed8f90ab97ad0eb13e73833bc7605c3888447ae
0ee9937cb076a98adac13c39ee30e96608b01568
refs/heads/master
2022-07-14T21:43:25.257906
2020-05-19T02:11:58
2020-05-19T02:11:58
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,173
h
config.h
#ifndef _CONFIG_H_ #define _CONFIG_H_ #include<vector> #include<string> #include "ngx_funs.h" using std::string; class CConfig { private: CConfig(); //隐藏构造函数 public: ~CConfig(); private: std::vector<SConfInfoPtr> m_info; static CConfig* m_instance; public: static CConfig* getInstance(){ if(!m_instance) { m_instance = new CConfig; } return m_instance; } private: class CConfigDelete { ~CConfigDelete(){ if(CConfig::m_instance){ delete CConfig::m_instance; CConfig::m_instance = NULL; } } }; public: bool loadConfig(const string& filename); //这里没有接收返回值的引用 是因为有可能没有查找到对应配置 没有有效的数据的引用返回 const string getStrContent(const string& name) const; const int getIntContent(const string& name) const; void showInfo() const; const string operator[](const string& name) const; }; #endif
d4024eec04005ef041de7bd3ae16c13a25de60b6
6782ad738a872d79a01144e3461cba4d26136462
/ncbi-blast-2.2.27+-src/c++/src/build-system/project_tree_builder/msvc_prj_utils.hpp
8b045ddeddd0b8339a43d922ce8f4cc738b58f79
[ "MIT" ]
permissive
kenongit/sequencing
0ecc5a7d0fb9ef87294feb7cf37e695ef9849b4d
7eb738cab66c4afda678f3d07b2c0756f4d26183
refs/heads/master
2020-12-25T09:38:04.815956
2013-05-14T23:06:43
2013-05-14T23:06:43
null
0
0
null
null
null
null
UTF-8
C++
false
false
17,739
hpp
msvc_prj_utils.hpp
#ifndef PROJECT_TREE_BUILDER__MSVC_PRJ_UTILS__HPP #define PROJECT_TREE_BUILDER__MSVC_PRJ_UTILS__HPP /* $Id: msvc_prj_utils.hpp 366536 2012-06-14 20:27:27Z rafanovi $ * =========================================================================== * * PUBLIC DOMAIN NOTICE * National Center for Biotechnology Information * * This software/database is a "United States Government Work" under the * terms of the United States Copyright Act. It was written as part of * the author's official duties as a United States Government employee and * thus cannot be copyrighted. This software/database is freely available * to the public for use. The National Library of Medicine and the U.S. * Government have not placed any restriction on its use or reproduction. * * Although all reasonable efforts have been taken to ensure the accuracy * and reliability of the software and data, the NLM and the U.S. * Government do not and cannot warrant the performance or results that * may be obtained by using this software or data. The NLM and the U.S. * Government disclaim all warranties, express or implied, including * warranties of performance, merchantability or fitness for any particular * purpose. * * Please cite the author in any work or product based on this material. * * =========================================================================== * * Author: Viatcheslav Gorelenkov * */ #include "ptb_registry.hpp" #include <corelib/ncbienv.hpp> #if NCBI_COMPILER_MSVC # include <build-system/project_tree_builder/msvc71_project__.hpp> #endif //NCBI_COMPILER_MSVC #include <set> BEGIN_NCBI_SCOPE ///////////////////////////////////////////////////////////////////////////// /// /// CProjKey -- /// /// Project key abstraction. /// /// Project key (type + project_id). class CProjKey { public: typedef enum { eNoProj, eLib, eApp, eDll, eMsvc, eDataSpec, eUtility, eLast } TProjType; CProjKey(void); CProjKey(TProjType type, const string& project_id); CProjKey(const CProjKey& key); CProjKey& operator= (const CProjKey& key); ~CProjKey(void); bool operator< (const CProjKey& key) const; bool operator== (const CProjKey& key) const; bool operator!= (const CProjKey& key) const; TProjType Type(void) const; const string& Id (void) const; private: TProjType m_Type; string m_Id; }; #if NCBI_COMPILER_MSVC USING_SCOPE(objects); /// Creates CVisualStudioProject class instance from file. /// /// @param file_path /// Path to file load from. /// @return /// Created on heap CVisualStudioProject instance or NULL /// if failed. CVisualStudioProject * LoadFromXmlFile(const string& file_path); /// Save CVisualStudioProject class instance to file. /// /// @param file_path /// Path to file project will be saved to. /// @param project /// Project to save. void SaveToXmlFile (const string& file_path, const CSerialObject& project); /// Save CVisualStudioProject class instance to file only if no such file /// or contents of this file will be different from already present file. /// /// @param file_path /// Path to file project will be saved to. /// @param project /// Project to save. void SaveIfNewer (const string& file_path, const CSerialObject& project); /// Save object, ignoring certain tags void SaveIfNewer (const string& file_path, const CSerialObject& project, const string& ignore); #endif //NCBI_COMPILER_MSVC bool PromoteIfDifferent(const string& present_path, const string& candidate_path, const string& ignore); /// Consider promotion candidate to present bool PromoteIfDifferent(const string& present_path, const string& candidate_path); /// Generate pseudo-GUID. string GenerateSlnGUID(void); string IdentifySlnGUID(const string& source_dir, const CProjKey& proj); /// Get extension for source file without extension. /// /// @param file_path /// Source file full path withour extension. /// @return /// Extension of source file (".cpp" or ".c") /// if such file exist. Empty string string if there is no /// such file. string SourceFileExt(const string& file_path); ///////////////////////////////////////////////////////////////////////////// /// /// SConfigInfo -- /// /// Abstraction of configuration informaion. /// /// Configuration name, debug/release flag, runtime library /// struct SConfigInfo { SConfigInfo(void); SConfigInfo(const string& name, bool debug, const string& runtime_library); void DefineRtType(); void SetRuntimeLibrary(const string& lib); string GetConfigFullName(void) const; bool operator== (const SConfigInfo& cfg) const; string m_Name; string m_RuntimeLibrary; bool m_Debug; bool m_VTuneAddon; bool m_Unicode; enum { rtMultiThreaded = 0, rtMultiThreadedDebug = 1, rtMultiThreadedDLL = 2, rtMultiThreadedDebugDLL = 3, rtSingleThreaded = 4, rtSingleThreadedDebug = 5, rtUnknown = 6 } m_rtType; }; // Helper to load configs from ini files void LoadConfigInfoByNames(const CNcbiRegistry& registry, const list<string>& config_names, list<SConfigInfo>* configs); ///////////////////////////////////////////////////////////////////////////// /// /// SCustomBuildInfo -- /// /// Abstraction of custom build source file. /// /// Information for custom buil source file /// (not *.c, *.cpp, *.midl, *.rc, etc.) /// MSVC does not know how to buil this file and /// we provide information how to do it. /// struct SCustomBuildInfo { string m_SourceFile; // absolute path! string m_CommandLine; string m_Description; string m_Outputs; string m_AdditionalDependencies; bool IsEmpty(void) const { return m_SourceFile.empty() || m_CommandLine.empty(); } void Clear(void) { m_SourceFile.erase(); m_CommandLine.erase(); m_Description.erase(); m_Outputs.erase(); m_AdditionalDependencies.erase(); } }; struct SCustomScriptInfo { string m_Input; string m_Output; string m_Shell; string m_Script; }; ///////////////////////////////////////////////////////////////////////////// /// /// CMsvc7RegSettings -- /// /// Abstraction of [msvc7] section in app registry. /// /// Settings for generation of msvc 7.10 projects /// class CMsvc7RegSettings { public: enum EMsvcVersion { eMsvc710 = 0, eMsvc800, eMsvc900, eMsvc1000, eXCode30, eMsvcNone }; enum EMsvcPlatform { eMsvcWin32 = 0, eMsvcX64, eUnix, eXCode }; CMsvc7RegSettings(void); string m_Version; list<SConfigInfo> m_ConfigInfo; string m_CompilersSubdir; string m_ProjectsSubdir; string m_MakefilesExt; string m_MetaMakefile; string m_DllInfo; static void IdentifyPlatform(void); static EMsvcVersion GetMsvcVersion(void) { return sm_MsvcVersion; } static const string& GetMsvcVersionName(void) { return sm_MsvcVersionName; } static EMsvcPlatform GetMsvcPlatform(void) { return sm_MsvcPlatform; } static const string& GetMsvcPlatformName(void) { return sm_MsvcPlatformName; } static const string& GetRequestedArchs(void) { return sm_RequestedArchs; } static string GetMsvcRegSection(void); static string GetMsvcSection(void); static string GetProjectFileFormatVersion(void); static string GetSolutionFileFormatVersion(void); static string GetConfigNameKeyword(void); static string GetVcprojExt(void); static string GetTopBuilddir(void); private: static EMsvcVersion sm_MsvcVersion; static EMsvcPlatform sm_MsvcPlatform; static string sm_MsvcVersionName; static string sm_MsvcPlatformName; static string sm_RequestedArchs; CMsvc7RegSettings(const CMsvc7RegSettings&); CMsvc7RegSettings& operator= (const CMsvc7RegSettings&); }; /// Is abs_dir a parent of abs_parent_dir. bool IsSubdir(const string& abs_parent_dir, const string& abs_dir); /// Erase if predicate is true template <class C, class P> void EraseIf(C& cont, const P& pred) { for (typename C::iterator p = cont.begin(); p != cont.end(); ) { if ( pred(*p) ) { typename C::iterator p_next = p; ++p_next; cont.erase(p); p = p_next; } else ++p; } } /// Get option fron registry from /// [<section>.debug.<ConfigName>] section for debug configuratios /// or [<section>.release.<ConfigName>] for release configurations /// /// if no such option then try /// [<section>.debug] /// or [<section>.release] /// /// if no such option then finally try /// [<section>] /// string GetOpt(const CPtbRegistry& registry, const string& section, const string& opt, const SConfigInfo& config); /// return <config>|Win32 as needed by MSVC compiler string ConfigName(const string& config); //----------------------------------------------------------------------------- // Base interface class for all insertors class IFilesToProjectInserter { public: virtual ~IFilesToProjectInserter(void) { } virtual void AddSourceFile (const string& rel_file_path, const string& pch_default) = 0; virtual void AddHeaderFile (const string& rel_file_path) = 0; virtual void AddInlineFile (const string& rel_file_path) = 0; virtual void Finalize (void) = 0; }; #if NCBI_COMPILER_MSVC // Insert .cpp and .c files to filter and set PCH usage if necessary class CSrcToFilterInserterWithPch { public: CSrcToFilterInserterWithPch(const string& project_id, const list<SConfigInfo>& configs, const string& project_dir); ~CSrcToFilterInserterWithPch(void); void operator() (CRef<CFilter>& filter, const string& rel_source_file, const string& pch_default); private: string m_ProjectId; const list<SConfigInfo>& m_Configs; const list<SConfigInfo>& m_AllConfigs; string m_ProjectDir; typedef set<string> TPchHeaders; TPchHeaders m_PchHeaders; enum EUsePch { eNotUse = 0, eCreate = 1, eUse = 3 }; typedef pair<EUsePch, string> TPch; TPch DefinePchUsage(const string& project_dir, const string& rel_source_file, const string& pch_default); void InsertFile (CRef<CFilter>& filter, const string& rel_source_file, const string& pch_default, const string& enable_cfg = kEmptyStr); // Prohibited to: CSrcToFilterInserterWithPch(void); CSrcToFilterInserterWithPch(const CSrcToFilterInserterWithPch&); CSrcToFilterInserterWithPch& operator=(const CSrcToFilterInserterWithPch&); }; class CBasicProjectsFilesInserter : public IFilesToProjectInserter { public: CBasicProjectsFilesInserter(CVisualStudioProject* vcproj, const string& project_id, const list<SConfigInfo>& configs, const string& project_dir); virtual ~CBasicProjectsFilesInserter(void); // IFilesToProjectInserter implementation virtual void AddSourceFile (const string& rel_file_path, const string& pch_default); virtual void AddHeaderFile (const string& rel_file_path); virtual void AddInlineFile (const string& rel_file_path); virtual void Finalize (void); struct SFiltersItem { SFiltersItem(void); SFiltersItem(const string& project_dir); CRef<CFilter> m_SourceFiles; CRef<CFilter> m_HeaderFiles; CRef<CFilter> m_HeaderFilesPrivate; CRef<CFilter> m_HeaderFilesImpl; CRef<CFilter> m_InlineFiles; string m_ProjectDir; void Initilize(void); void AddSourceFile (CSrcToFilterInserterWithPch& inserter_w_pch, const string& rel_file_path, const string& pch_default); void AddHeaderFile (const string& rel_file_path); void AddInlineFile (const string& rel_file_path); }; private: CVisualStudioProject* m_Vcproj; CSrcToFilterInserterWithPch m_SrcInserter; SFiltersItem m_Filters; // Prohibited to: CBasicProjectsFilesInserter(void); CBasicProjectsFilesInserter(const CBasicProjectsFilesInserter&); CBasicProjectsFilesInserter& operator=(const CBasicProjectsFilesInserter&); }; class CDllProjectFilesInserter : public IFilesToProjectInserter { public: CDllProjectFilesInserter(CVisualStudioProject* vcproj, const CProjKey dll_project_key, const list<SConfigInfo>& configs, const string& project_dir); virtual ~CDllProjectFilesInserter(void); // IFilesToProjectInserter implementation virtual void AddSourceFile (const string& rel_file_path, const string& pch_default); virtual void AddHeaderFile (const string& rel_file_path); virtual void AddInlineFile (const string& rel_file_path); virtual void Finalize (void); private: CVisualStudioProject* m_Vcproj; CProjKey m_DllProjectKey; CSrcToFilterInserterWithPch m_SrcInserter; string m_ProjectDir; typedef CBasicProjectsFilesInserter::SFiltersItem TFiltersItem; TFiltersItem m_PrivateFilters; CRef<CFilter> m_HostedLibrariesRootFilter; typedef map<CProjKey, TFiltersItem> THostedLibs; THostedLibs m_HostedLibs; // Prohibited to: CDllProjectFilesInserter(void); CDllProjectFilesInserter(const CDllProjectFilesInserter&); CDllProjectFilesInserter& operator=(const CDllProjectFilesInserter&); }; /// Common function shared by /// CMsvcMasterProjectGenerator and CMsvcProjectGenerator void AddCustomBuildFileToFilter(CRef<CFilter>& filter, const list<SConfigInfo> configs, const string& project_dir, const SCustomBuildInfo& build_info); #endif //NCBI_COMPILER_MSVC /// Checks if 2 dirs has the same root bool SameRootDirs(const string& dir1, const string& dir2); /// Project naming schema string CreateProjectName(const CProjKey& project_id); CProjKey CreateProjKey(const string& project_name); /// Utility class for distinguish between static and dll builds class CBuildType { public: CBuildType(bool dll_flag); enum EBuildType { eStatic, eDll }; EBuildType GetType (void) const; string GetTypeStr(void) const; private: EBuildType m_Type; //prohibited to: CBuildType(void); CBuildType(const CBuildType&); CBuildType& operator= (const CBuildType&); }; /// Distribution if source files by lib projects /// Uses in dll project to separate source files to groups by libs class CDllSrcFilesDistr { public: CDllSrcFilesDistr(void); // Register .cpp .c files during DLL creation void RegisterSource (const string& src_file_path, const CProjKey& dll_project_id, const CProjKey& lib_project_id); // Register .hpp .h files during DLL creation void RegisterHeader (const string& hrd_file_path, const CProjKey& dll_project_id, const CProjKey& lib_project_id); // Register .inl files during DLL creation void RegisterInline (const string& inl_file_path, const CProjKey& dll_project_id, const CProjKey& lib_project_id); // Retrive original lib_id for .cpp .c file CProjKey GetSourceLib(const string& src_file_path, const CProjKey& dll_project_id) const; // Retrive original lib_id for .cpp .c file CProjKey GetHeaderLib(const string& hdr_file_path, const CProjKey& dll_project_id) const; // Retrive original lib_id for .inl file CProjKey GetInlineLib(const string& inl_file_path, const CProjKey& dll_project_id) const; CProjKey GetFileLib(const string& file_path, const CProjKey& dll_project_id) const; private: typedef pair<string, CProjKey> TDllSrcKey; typedef map<TDllSrcKey, CProjKey> TDistrMap; TDistrMap m_SourcesMap; TDistrMap m_HeadersMap; TDistrMap m_InlinesMap; //prohibited to CDllSrcFilesDistr(const CDllSrcFilesDistr&); CDllSrcFilesDistr& operator= (const CDllSrcFilesDistr&); }; END_NCBI_SCOPE #endif //PROJECT_TREE_BUILDER__MSVC_PRJ_UTILS__HPP
651ed61b1eaab20d5e1f5ce37ed01c25f2003c01
52a92ef78f39ca1b295c6bf757c6dafb538bad69
/codeforces/1360/G.cpp
1995f995be6a1c1e3256000dba14bee80e2ea73a
[]
no_license
manujgrover71/cp_codes
244201f65692ccd0f43b1b73fd76d9ca3a90886e
c801b421be0eca04b19ab01597aabfe73444e84b
refs/heads/master
2023-02-08T11:15:26.960166
2020-12-23T05:30:00
2020-12-24T11:14:38
323,294,247
0
0
null
null
null
null
UTF-8
C++
false
false
1,471
cpp
G.cpp
#include <iostream> #include <string> #include <cstring> #include <cmath> #include <vector> #include <map> #include <algorithm> using namespace std; #define ll long long bool sortinrev(pair<int, int> &a, pair<int, int> &b){ return (a.first > b.first); } void solve(){ int n, m, a, b; cin >> n >> m >> a >> b; if((a*n) != (b*m)){ cout << "NO\n"; return; }else{ cout << "YES\n"; vector< pair< int, int> > freq; for(int i = 0; i < m; i++) { freq.push_back({ b, i }); } char arr[n][m]; for(int i = 0; i < n; i++){ int count = 0; for(int j = 0; j < m; j++){ if(freq[j].first && count < a){ arr[i][freq[j].second] = '1'; freq[j].first -= 1; count++; } else { arr[i][freq[j].second] = '0'; } } sort(freq.begin(), freq.end(), sortinrev); } for(int i = 0; i < n; i++){ for(int j = 0; j < m; j++){ cout << arr[i][j]; } cout << '\n'; } } } int main(){ #ifndef ONLINE_JUDGE freopen("/ATOMCODES/input.txt", "r", stdin); freopen("/ATOMCODES/output.txt", "w", stdout); #endif ios_base::sync_with_stdio(false); cin.tie(NULL); int t; cin >> t; while(t--){ solve(); } }
1530e941ceafcd8a4ae74e82f79190e2f193cc8e
d193e5df876ae20df59cb7fc996eacba2781a199
/HW5/SDLProject/main.cpp
ae70d1504c77bfca72d9db480780e187ca53f9b2
[]
no_license
jonnysassoon/CS3113
c6a238484519736f08bf80bcc27c86e4606f605c
3630713162d763080b75b899b057b16d888ef51d
refs/heads/master
2021-01-05T10:06:53.665266
2020-05-11T05:03:06
2020-05-11T05:03:06
240,985,661
0
0
null
null
null
null
UTF-8
C++
false
false
6,821
cpp
main.cpp
#define GL_SILENCE_DEPRECATION #ifdef _WINDOWS #include <GL/glew.h> #endif #define GL_GLEXT_PROTOTYPES 1 #include <SDL.h> #include <SDL_opengl.h> #include <SDL_mixer.h> #include "glm/mat4x4.hpp" #include "glm/gtc/matrix_transform.hpp" #include "ShaderProgram.h" #include "Entity.h" #include "Map.h" #include "Scene.h" #include "MainMenu.h" #include "Level1.h" #include "Level2.h" #include "Level3.h" #include "Util.h" #include <vector> #include<unistd.h> #define FIXED_TIMESTEP 0.0166666f #define PLAYER_LIVES 3 #define NUM_SCENES 4 const char *arenaTilePath = "platformPack_tile016.png"; Scene *scenes[NUM_SCENES]; Scene *currentScene; int currSceneNum; int livesLeft; SDL_Window* displayWindow; Mix_Music* music; Mix_Chunk* success; bool gameIsRunning = true; ShaderProgram program; glm::mat4 viewMatrix, modelMatrix, projectionMatrix; GLuint fontTextureID, enemyTextureID, bulletTextureID; float lastTicks = 0; float accumulator = 0.0f; class GameOver : public Scene { void Initialize() override { fontTextureID = Util::LoadTexture("font1.png"); state.nextScene = 1; } int ProcessInput() override { int report = 0; SDL_Event event; while (SDL_PollEvent(&event)) { switch (event.type) { case SDL_QUIT: case SDL_WINDOWEVENT_CLOSE: report = 1; break; case SDL_KEYUP: break; case SDL_KEYDOWN: if (event.key.keysym.sym == SDLK_RETURN) { livesLeft = PLAYER_LIVES; report = 2; } break; } } return report; } int Update(float deltaTime) override { return 0; } void Render(ShaderProgram *program) override { viewMatrix = glm::mat4(1.0f); if (livesLeft == 0) Util::DrawText(program, fontTextureID, "YOU LOSE", 0.5f, -0.25f, glm::vec3(-1.25, 0, 0)); else Util::DrawText(program, fontTextureID, "YOU WIN", 0.5f, -0.25f, glm::vec3(-1.25, 0, 0)); Util::DrawText(program, fontTextureID, "PRESS ENTER TO PLAY AGAIN", 0.5f, -0.25f, glm::vec3(-3, -1, 0)); } }; void SwitchToScene(Scene *scene) { if (currSceneNum == -1) { currSceneNum = 0; } else { currSceneNum = currentScene->state.nextScene; } currentScene = scene; currentScene->Initialize(); } void Initialize() { SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO); displayWindow = SDL_CreateWindow("Platformer With AIs!", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, 640, 480, SDL_WINDOW_OPENGL); SDL_GLContext context = SDL_GL_CreateContext(displayWindow); SDL_GL_MakeCurrent(displayWindow, context); Mix_OpenAudio(44100, MIX_DEFAULT_FORMAT, 2, 4096); music = Mix_LoadMUS("crypto.mp3"); Mix_PlayMusic(music, -1); success = Mix_LoadWAV("success.wav"); #ifdef _WINDOWS glewInit(); #endif glViewport(0, 0, 640, 480); program.Load("shaders/vertex_textured.glsl", "shaders/fragment_textured.glsl"); viewMatrix = glm::mat4(1.0f); modelMatrix = glm::mat4(1.0f); projectionMatrix = glm::ortho(-5.0f, 5.0f, -3.75f, 3.75f, -1.0f, 1.0f); program.SetProjectionMatrix(projectionMatrix); program.SetViewMatrix(viewMatrix); glUseProgram(program.programID); glClearColor(0.2f, 0.2f, 0.2f, 1.0f); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); scenes[0] = new MainMenu(); scenes[1] = new Level1(); scenes[2] = new Level2(); scenes[3] = new Level3(); currSceneNum = -1; SwitchToScene(scenes[0]); livesLeft = PLAYER_LIVES; fontTextureID = Util::LoadTexture("font1.png"); } void ProcessInput() { switch (currentScene->ProcessInput()) { case 0: break; case 1: gameIsRunning = false; break; case 2: SwitchToScene(scenes[currentScene->state.nextScene]); break; } } void Update() { float ticks = (float)SDL_GetTicks() / 1000.0f; float deltaTime = ticks - lastTicks; lastTicks = ticks; deltaTime += accumulator; if (deltaTime < FIXED_TIMESTEP) { accumulator = deltaTime; return; } while (deltaTime >= FIXED_TIMESTEP) { if (currSceneNum != 0) { switch (currentScene->Update(FIXED_TIMESTEP)) { case 0: // do nothing case break; case 1: // enemy dies currentScene->state.player->lastCollision->isActive = false; break; case 2: // player dies livesLeft -= 1; if (livesLeft > 0) currentScene->Initialize(); else { currSceneNum = -1; SwitchToScene(new GameOver()); } break; case 3: Mix_PlayChannel(-1, success, 0); sleep(1); if (currSceneNum != NUM_SCENES - 1) SwitchToScene(scenes[currentScene->state.nextScene]); else { currSceneNum = -1; SwitchToScene(new GameOver()); } break; } } deltaTime -= FIXED_TIMESTEP; } accumulator = deltaTime; if (currSceneNum == 0) return; viewMatrix = glm::mat4(1.0f); if (currentScene->state.player->position.x > 5 && currentScene->state.player->position.x < 21) { viewMatrix = glm::translate(viewMatrix, glm::vec3(-currentScene->state.player->position.x, 3.75, 0)); } else if (currentScene->state.player->position.x <= 5) { viewMatrix = glm::translate(viewMatrix, glm::vec3(-5, 3.75, 0)); } else { viewMatrix = glm::translate(viewMatrix, glm::vec3(-21, 3.75, 0)); } } void Render() { glClear(GL_COLOR_BUFFER_BIT); currentScene->Render(&program); program.SetViewMatrix((viewMatrix)); SDL_GL_SwapWindow(displayWindow); } void Shutdown() { SDL_Quit(); } void freeze(Entity *object) { object->movement = glm::vec3(0); object->velocity = glm::vec3(0); object->acceleration = glm::vec3(0); } void freezeGamestate() { freeze(currentScene->state.player); } int main(int argc, char* argv[]) { Initialize(); while (gameIsRunning) { ProcessInput(); Update(); Render(); } return 0; }
1c98ffb1af8cd050d11f62fb56cc8c23c6983179
e9b00bf79e4d9161955bb3d63f3d5c51fbde6b89
/framework/Geometry.cpp
518cccb63c4e2481eaf7264372cb50dbcb6d53a1
[]
no_license
jakeHaasBlog/Topographic-Maps
346f967a816fc8d6b9473808722e26886dbee1dd
b45802039a73926c83394e61c8365147d0db1d93
refs/heads/main
2023-03-07T00:05:05.904917
2021-02-16T05:08:10
2021-02-16T05:08:10
339,197,572
1
0
null
null
null
null
UTF-8
C++
false
false
21,509
cpp
Geometry.cpp
#include "Geometry.h" #include <stdio.h> namespace { bool getRectRectIntersection(const Geo::Rectangle& rect1, const Geo::Rectangle& rect2, std::vector<std::array<float, 2>>* poi = nullptr) { if (!poi) { if (rect1.x < rect2.x + rect2.width && rect1.x + rect1.width > rect2.x && rect1.y < rect2.y + rect2.height && rect1.y + rect1.height > rect2.y) { return true; } return false; } else { bool intersecting = false; if (rect2.x <= rect1.x && rect1.x <= rect2.x + rect2.width) { if (rect1.y - rect1.height <= rect2.y && rect2.y <= rect1.y) { intersecting = true; poi->push_back({ rect1.x, rect2.y }); } if (rect1.y - rect1.height <= rect2.y - rect2.height && rect2.y - rect2.height <= rect1.y) { intersecting = true; poi->push_back({ rect1.x, rect2.y - rect2.height}); } } if (rect2.x <= rect1.x + rect1.width && rect1.x + rect1.width <= rect2.x + rect2.width) { if (rect1.y - rect1.height <= rect2.y && rect2.y <= rect1.y) { intersecting = true; poi->push_back({ rect1.x + rect1.width, rect2.y }); } if (rect1.y - rect1.height <= rect2.y - rect2.height && rect2.y - rect2.height <= rect1.y) { intersecting = true; poi->push_back({ rect1.x + rect1.width, rect2.y - rect2.height }); } } if (rect2.y - rect2.height <= rect1.y && rect1.y <= rect2.y) { if (rect1.x <= rect2.x && rect2.x <= rect1.x + rect1.width) { intersecting = true; poi->push_back({ rect2.x, rect1.y }); } if (rect1.x <= rect2.x + rect2.width && rect2.x + rect2.width <= rect1.x + rect1.width) { intersecting = true; poi->push_back({ rect2.x + rect2.width, rect1.y }); } } if (rect2.y - rect2.height <= rect1.y - rect1.height && rect1.y - rect1.height <= rect2.y) { if (rect1.x <= rect2.x && rect2.x <= rect1.x + rect1.width) { intersecting = true; poi->push_back({ rect2.x, rect1.y - rect1.height }); } if (rect1.x <= rect2.x + rect2.width && rect2.x + rect2.width <= rect1.x + rect1.width) { intersecting = true; poi->push_back({ rect2.x + rect2.width, rect1.y - rect1.height }); } } if (rect1.containsPoint(rect2.x, rect2.y)) intersecting = true; if (rect1.containsPoint(rect2.x + rect2.width, rect2.y)) intersecting = true; if (rect1.containsPoint(rect2.x + rect2.width, rect2.y - rect2.height)) intersecting = true; if (rect1.containsPoint(rect2.x, rect2.y - rect2.height)) intersecting = true; if (rect2.containsPoint(rect1.x, rect1.y)) intersecting = true; if (rect2.containsPoint(rect1.x + rect1.width, rect1.y)) intersecting = true; if (rect2.containsPoint(rect1.x + rect1.width, rect1.y - rect1.height)) intersecting = true; if (rect2.containsPoint(rect1.x, rect1.y - rect1.height)) intersecting = true; return intersecting; } } bool getLineCircleIntersection(const Geo::LineSeg& line, const Geo::Circle& circle, std::vector<std::array<float, 2>>* poi) { float r = circle.radius; float a = -(line.y2 - line.y1); float b = line.x2 - line.x1; float c = -a * (line.x1 - circle.x) - b * (line.y1 - circle.y); float epsilon = 0.000001f; bool intersecting = false; float x0 = -a * c / (a*a + b * b), y0 = -b * c / (a*a + b * b); if (c*c > r*r*(a*a + b * b) + epsilon) return false; else if (abs(c*c - r * r*(a*a + b * b)) < epsilon) { if ((fmin(line.x1, line.x2) - epsilon <= x0 + circle.x && x0 + circle.x <= fmax(line.x1, line.x2) + epsilon)) if ((fmin(line.y1, line.y2) - epsilon <= y0 + circle.y && y0 + circle.y <= fmax(line.y1, line.y2) + epsilon)) { if (poi) poi->push_back({ x0 + circle.x, y0 + circle.y }); intersecting = true; } } else { float d = r * r - c * c / (a*a + b * b); float mult = sqrt(d / (a*a + b * b)); float ax, ay, bx, by; ax = x0 + b * mult; bx = x0 - b * mult; ay = y0 - a * mult; by = y0 + a * mult; if ((fmin(line.x1, line.x2) - epsilon <= ax + circle.x && ax + circle.x <= fmax(line.x1, line.x2) + epsilon)) if ((fmin(line.y1, line.y2) - epsilon <= ay + circle.y && ay + circle.y <= fmax(line.y1, line.y2) + epsilon)) { if (poi) poi->push_back({ ax + circle.x, ay + circle.y }); intersecting = true; } if ((fmin(line.x1, line.x2) - epsilon <= bx + circle.x && bx + circle.x <= fmax(line.x1, line.x2) + epsilon)) if ((fmin(line.y1, line.y2) - epsilon <= by + circle.y && by + circle.y <= fmax(line.y1, line.y2) + epsilon)) { if (poi) poi->push_back({ bx + circle.x, by + circle.y }); intersecting = true; } } if (circle.containsPoint(line.x1, line.y1) || circle.containsPoint(line.x2, line.y2)) intersecting = true; return intersecting; } bool getRectCircleIntersection(const Geo::Rectangle& rect, const Geo::Circle& circle, std::vector<std::array<float, 2>>* poi) { if (!poi) { float deltaX = circle.x - fmax(rect.x, fmin(circle.x, rect.x + rect.width)); float deltaY = circle.y - fmin(rect.y, fmax(circle.y, rect.y - rect.height)); return (deltaX * deltaX + deltaY * deltaY) < (circle.radius * circle.radius) || rect.containsPoint(circle.x, circle.y); } else { bool intersected = false; Geo::LineSeg line2 = { rect.x, rect.y, rect.x + rect.width, rect.y }; if (getLineCircleIntersection(line2, circle, poi)) { intersected = true; } line2 = { rect.x, rect.y - rect.height, rect.x + rect.width, rect.y - rect.height }; if (getLineCircleIntersection(line2, circle, poi)) { intersected = true; } line2 = { rect.x, rect.y, rect.x, rect.y - rect.height }; if (getLineCircleIntersection(line2, circle, poi)) { intersected = true; } line2 = { rect.x + rect.width, rect.y, rect.x + rect.width, rect.y - rect.height }; if (getLineCircleIntersection(line2, circle, poi)) { intersected = true; } if (rect.containsPoint(circle.x, circle.y)) intersected = true; return intersected; } } bool getLineLineIntersection(const Geo::LineSeg& line1, const Geo::LineSeg& line2, std::vector<std::array<float, 2>>* poi) { float p[2] = { line1.x1, line1.y1 }; float t; float r[2] = { line1.x2 - line1.x1, line1.y2 - line1.y1 }; // p + tr float q[2] = { line2.x1, line2.y1 }; float u; float s[2] = { line2.x2 - line2.x1, line2.y2 - line2.y1 }; // q + us float rXs = r[0] * s[1] - r[1] * s[0]; float qMinusP[2] = { q[0] - p[0], q[1] - p[1] }; float qMinisPCrossS = qMinusP[0] * s[1] - qMinusP[1] * s[0]; float qMinusPCrossR = qMinusP[0] * r[1] - qMinusP[1] * r[0]; t = qMinisPCrossS / (r[0] * s[1] - s[0] * r[1]); u = qMinusPCrossR / rXs; if (rXs != 0.0f && 0.0f <= t && t <= 1.0f && 0 <= u && u <= 1.0f) { if (poi) { poi->push_back({ p[0] + t * r[0], p[1] + t * r[1] }); } return true; } else { return false; } } bool getLineRectIntersection(const Geo::Rectangle& rect, const Geo::LineSeg& line, std::vector<std::array<float, 2>>* poi) { if (!poi) { if (rect.containsPoint(line.x1, line.y1)) return true; if (rect.containsPoint(line.x1, line.y1)) return true; Geo::LineSeg line2 = { rect.x, rect.y, rect.x + rect.width, rect.y }; if (getLineLineIntersection(line, line2, poi)) { return true; } line2.x2 = rect.x; line2.y2 = rect.y - rect.height; if (getLineLineIntersection(line, line2, poi)) { return true; } line2.x1 = rect.x + rect.width; line2.y1 = rect.y - rect.height; if (getLineLineIntersection(line, line2, poi)) { return true; } line2.x1 = rect.x + rect.width; line2.y1 = rect.y; if (getLineLineIntersection(line, line2, poi)) { return true; } return false; } else { bool intersection = false; if (rect.containsPoint(line.x1, line.y1)) intersection = true; if (rect.containsPoint(line.x1, line.y1)) intersection = true; Geo::LineSeg line2 = { rect.x, rect.y, rect.x + rect.width, rect.y }; if (getLineLineIntersection(line, line2, poi)) { intersection = true; } line2.x2 = rect.x; line2.y2 = rect.y - rect.height; if (getLineLineIntersection(line, line2, poi)) { intersection = true; } line2.x1 = rect.x + rect.width; line2.y1 = rect.y - rect.height; if (getLineLineIntersection(line, line2, poi)) { intersection = true; } line2.x1 = rect.x + rect.width; line2.y1 = rect.y; line2.x2 = rect.x + rect.width; line2.y2 = rect.y - rect.height; if (getLineLineIntersection(line, line2, poi)) { intersection = true; } return intersection; } } } void Geo::GeoObject::render(const Shader & shader, const VertexBuffer & vb, const IndexBuffer & ib, const VertexArray & va, int inputType) { shader.bind(); va.bind(); vb.bind(); ib.bind(); glDisable(GL_CULL_FACE); glDrawElements(inputType, ib.getCount(), GL_UNSIGNED_INT, nullptr); glEnable(GL_CULL_FACE); } void Geo::GeoObject::render(const Shader& shader) { render(shader, getVB(), getIB(), getVA(), GL_TRIANGLES); } Geo::Rectangle::Rectangle(float _x, float _y, float _width, float _height) { x = _x; y = _y; width = _width; height = _height; } Geo::Rectangle::Rectangle() { x = 0.0f; y = 0.0f; width = 1.0f; height = 1.0f; } VertexBuffer & Geo::Rectangle::getVB() { static float vertices[8] = { 0.0f, 0.0f, 1.0f, 0.0f, 1.0f, -1.0f, 0.0f, -1.0f }; static VertexBuffer vb = VertexBuffer(vertices, 8 * sizeof(float)); return vb; } IndexBuffer & Geo::Rectangle::getIB() { static unsigned int indices[6] = { 2, 0, 1, 0, 2, 3 }; static IndexBuffer ib = IndexBuffer(indices, 6 * sizeof(unsigned int)); return ib; } VertexArray & Geo::Rectangle::getVA() { static VertexArray va = VertexArray(getVB(), "ff"); return va; } Geo::Rectangle& Geo::Rectangle::getStencyl() { static Rectangle rect; return rect; } void Geo::Rectangle::renderFilled(float r, float g, float b, const glm::mat4 & viewMatrix, const glm::mat4 & projMatrix) { static Shader fillShader("../assets/rectangle.sh"); glm::mat4 modelMatrix = glm::translate(glm::mat4(1.0f), { x, y, -5 }) * glm::scale(glm::mat4(1.0f), { width, height, 1 });; fillShader.setUniform3f("u_color", r, g, b); glm::mat4 mvp = projMatrix * viewMatrix * modelMatrix; fillShader.setUniformMat4f("u_mvp", mvp); render(fillShader); } void Geo::Rectangle::renderOutline(float r, float g, float b, const glm::mat4 & viewMatrix, const glm::mat4 & projMatrix) { static Shader lineShader("../assets/rectangle-wireframe.sh"); glm::mat4 modelMatrix = glm::translate(glm::mat4(1.0f), { x, y, -5 }) * glm::scale(glm::mat4(1.0f), { width, height, 1 });; lineShader.setUniform3f("u_color", r, g, b); glm::mat4 mvp = projMatrix * viewMatrix * modelMatrix; lineShader.setUniformMat4f("u_mvp", mvp); render(lineShader); } void Geo::Rectangle::fillRect(float x, float y, float width, float height, float r, float g, float b, const glm::mat4 & viewMatrix, const glm::mat4 & projMatrix) { Rectangle& rect = getStencyl(); rect.x = x; rect.y = y; rect.width = width; rect.height = height; rect.renderFilled(r, g, b, viewMatrix, projMatrix); } void Geo::Rectangle::outlineRect(float x, float y, float width, float height, float r, float g, float b, const glm::mat4 & viewMatrix, const glm::mat4 & projMatrix) { Rectangle& rect = getStencyl(); rect.x = x; rect.y = y; rect.width = width; rect.height = height; rect.renderOutline(r, g, b, viewMatrix, projMatrix); } bool Geo::Rectangle::getIntersection(const Geo::LineSeg & line, std::vector<std::array<float, 2>>* poi) const { return getLineRectIntersection(*this, line, poi); } bool Geo::Rectangle::getIntersection(const Geo::Rectangle & rect, std::vector<std::array<float, 2>>* poi) const { return getRectRectIntersection(*this, rect, poi); } bool Geo::Rectangle::getIntersection(const Geo::Circle & circle, std::vector<std::array<float, 2>>* poi) const { return getRectCircleIntersection(*this, circle, poi); } bool Geo::Rectangle::containsPoint(float _x, float _y) const { if (x <= _x && _x <= x + width) { if (y - height <= _y && _y <= y) { return true; } } return false; } const unsigned int Geo::Circle::lowResCircleVertexCount = 20; const unsigned int Geo::Circle::medResCircleVertexCount = 50; const unsigned int Geo::Circle::highResCircleVertexCount = 120; Geo::Circle::Circle(float _x, float _y, float _radius) { x = _x; y = _y; radius = _radius; } Geo::Circle::Circle() { x = 0.0f; y = 0.0f; radius = 0.5f; } VertexBuffer & Geo::Circle::getVB() { static float vertices[8] = { -0.5f, 0.5f, 0.5f, 0.5f, 0.5f, -0.5f, -0.5f, -0.5f }; static VertexBuffer vb = VertexBuffer(vertices, 8 * sizeof(float)); return vb; } IndexBuffer & Geo::Circle::getIB() { static unsigned int indices[6] = { 0, 1, 2, 0, 2, 3 }; static IndexBuffer ib = IndexBuffer(indices, 6 * sizeof(unsigned int)); return ib; } VertexArray & Geo::Circle::getVA() { static VertexArray va = VertexArray(getVB(), "ff"); return va; } Geo::Circle& Geo::Circle::getStencyl() { static Circle circle; return circle; } VertexBuffer& Geo::Circle::getLowResCircleVB() { static float vertices[lowResCircleVertexCount * 2]; static bool calculated = false; if (!calculated) { for (int i = 0; i < lowResCircleVertexCount; i++) { vertices[i * 2 + 0] = cos(((float)i / lowResCircleVertexCount) * 3.14159f * 2.0f) / 2; vertices[i * 2 + 1] = sin(((float)i / lowResCircleVertexCount) * 3.14159f * 2.0f) / 2; } calculated = true; } static VertexBuffer vb = VertexBuffer(vertices, 2 * lowResCircleVertexCount * sizeof(float)); return vb; } IndexBuffer& Geo::Circle::getLowResCircleIB() { static unsigned int indices[lowResCircleVertexCount * 2]; static bool calculated = false; if (!calculated) { for (unsigned int i = 0; i < lowResCircleVertexCount; i++) { indices[i * 2 + 0] = i; indices[i * 2 + 1] = i + 1; } indices[lowResCircleVertexCount * 2 - 1] = 0; calculated = true; } static IndexBuffer ib = IndexBuffer(indices, lowResCircleVertexCount * 2 * sizeof(unsigned int)); return ib; } VertexArray& Geo::Circle::getLowResCircleVA() { static VertexArray va = VertexArray(getLowResCircleVB(), "ff"); return va; } VertexBuffer& Geo::Circle::getMedResCircleVB() { static float vertices[medResCircleVertexCount * 2]; static bool calculated = false; if (!calculated) { for (int i = 0; i < medResCircleVertexCount; i++) { vertices[i * 2 + 0] = cos(((float)i / medResCircleVertexCount) * 3.14159f * 2.0f) / 2; vertices[i * 2 + 1] = sin(((float)i / medResCircleVertexCount) * 3.14159f * 2.0f) / 2; } calculated = true; } static VertexBuffer vb = VertexBuffer(vertices, 2 * medResCircleVertexCount * sizeof(float)); return vb; } IndexBuffer& Geo::Circle::getMedResCircleIB() { static unsigned int indices[medResCircleVertexCount * 2]; static bool calculated = false; if (!calculated) { for (unsigned int i = 0; i < medResCircleVertexCount; i++) { indices[i * 2 + 0] = i; indices[i * 2 + 1] = i + 1; } indices[medResCircleVertexCount * 2 - 1] = 0; calculated = true; } static IndexBuffer ib = IndexBuffer(indices, medResCircleVertexCount * 2 * sizeof(unsigned int)); return ib; } VertexArray& Geo::Circle::getMedResCircleVA() { static VertexArray va = VertexArray(getMedResCircleVB(), "ff"); return va; } VertexBuffer& Geo::Circle::getHighResCircleVB() { static float vertices[highResCircleVertexCount * 2]; static bool calculated = false; if (!calculated) { for (int i = 0; i < highResCircleVertexCount; i++) { vertices[i * 2 + 0] = cos(((float)i / highResCircleVertexCount) * 3.14159f * 2.0f) / 2; vertices[i * 2 + 1] = sin(((float)i / highResCircleVertexCount) * 3.14159f * 2.0f) / 2; } calculated = true; } static VertexBuffer vb = VertexBuffer(vertices, 2 * highResCircleVertexCount * sizeof(float)); return vb; } IndexBuffer& Geo::Circle::getHighResCircleIB() { static unsigned int indices[highResCircleVertexCount * 2]; static bool calculated = false; if (!calculated) { for (unsigned int i = 0; i < highResCircleVertexCount; i++) { indices[i * 2 + 0] = i; indices[i * 2 + 1] = i + 1; } indices[highResCircleVertexCount * 2 - 1] = 0; calculated = true; } static IndexBuffer ib = IndexBuffer(indices, highResCircleVertexCount * 2 * sizeof(unsigned int)); return ib; } VertexArray& Geo::Circle::getHighResCircleVA() { static VertexArray va = VertexArray(getHighResCircleVB(), "ff"); return va; } void Geo::Circle::renderFilled(float r, float g, float b, const glm::mat4 & viewMatrix, const glm::mat4 & projMatrix) { static Shader fillShader("../assets/circle.sh"); glm::mat4 modelMatrix = glm::translate(glm::mat4(1.0f), { x, y, -5 }) * glm::scale(glm::mat4(1.0f), { radius * 2, radius * 2, 1 });; fillShader.setUniform3f("u_color", r, g, b); glm::mat4 mvp = projMatrix * viewMatrix * modelMatrix; fillShader.setUniformMat4f("u_mvp", mvp); render(fillShader); } void Geo::Circle::renderOutline(float r, float g, float b, const glm::mat4 & viewMatrix, const glm::mat4 & projMatrix) { static Shader lineShader("../assets/circle-wireframe.sh"); glm::mat4 modelMatrix = glm::translate(glm::mat4(1.0f), { x, y, 0 }) * glm::scale(glm::mat4(1.0f), { radius * 2, radius * 2, 0 }); glm::mat4 mvp = projMatrix * viewMatrix * modelMatrix; lineShader.setUniformMat4f("u_mvp", mvp); lineShader.setUniform3f("u_color", r, g, b); if (radius > 0.42) render(lineShader, getHighResCircleVB(), getHighResCircleIB(), getHighResCircleVA(), GL_LINES); else if (radius > 0.05f) render(lineShader, getMedResCircleVB(), getMedResCircleIB(), getMedResCircleVA(), GL_LINES); else render(lineShader, getLowResCircleVB(), getLowResCircleIB(), getLowResCircleVA(), GL_LINES); } void Geo::Circle::fillCircle(float x, float y, float radius, float r, float g, float b, const glm::mat4 & viewMatrix, const glm::mat4 & projMatrix) { Circle& circle = getStencyl(); circle.x = x; circle.y = y; circle.radius = radius; circle.renderFilled(r, g, b, viewMatrix, projMatrix); } void Geo::Circle::outlineCircle(float x, float y, float radius, float r, float g, float b, const glm::mat4 & viewMatrix, const glm::mat4 & projMatrix) { Circle& circle = getStencyl(); circle.x = x; circle.y = y; circle.radius = radius; circle.renderOutline(r, g, b, viewMatrix, projMatrix); } bool Geo::Circle::getIntersection(const Geo::Circle & circle, std::vector<std::array<float, 2>>* poi) { float dSquared = pow(circle.x - x, 2) + pow(circle.y - y, 2); bool intersecting = dSquared <= pow(radius + circle.radius, 2); if (!poi || !intersecting) { return intersecting; } else { float d = sqrt(dSquared); float b = (-pow(circle.radius, 2) + pow(radius, 2) - dSquared) / (-2 * d); float c = sqrt(pow(circle.radius, 2) - pow(b, 2)); float EBunit[2] = { ((x - circle.x) / d), ((y - circle.y) / d) }; float EB[2] = { EBunit[0] * b, EBunit[1] * b }; float B[2] = { circle.x + EB[0], circle.y + EB[1] }; float BD[2] = { -EBunit[1] * c, EBunit[0] * c }; poi->push_back({ B[0] + BD[0], B[1] + BD[1] }); poi->push_back({ B[0] - BD[0], B[1] - BD[1] }); return true; } return false; } bool Geo::Circle::getIntersection(const Geo::Rectangle & rect, std::vector<std::array<float, 2>>* poi) { return getRectCircleIntersection(rect, *this, poi); } bool Geo::Circle::getIntersection(const Geo::LineSeg & line, std::vector<std::array<float, 2>>* poi) { return getLineCircleIntersection(line, *this, poi); } bool Geo::Circle::containsPoint(float _x, float _y) const { return pow(_x - x, 2) + pow(_y - y, 2) <= radius * radius; } Geo::LineSeg::LineSeg(float _x1, float _y1, float _x2, float _y2) { x1 = _x1; y1 = _y1; x2 = _x2; y2 = _y2; } Geo::LineSeg::LineSeg() { } VertexBuffer & Geo::LineSeg::getVB() { static float vertices[4] = { 0.0f, 0.0f, 1.0f, 1.0f }; static VertexBuffer vb = VertexBuffer(vertices, 4 * sizeof(float)); return vb; } IndexBuffer & Geo::LineSeg::getIB() { static unsigned int indices[2] = { 0, 1 }; static IndexBuffer ib = IndexBuffer(indices, 2 * sizeof(unsigned int)); return ib; } VertexArray & Geo::LineSeg::getVA() { static VertexArray va = VertexArray(getVB(), "ff"); return va; } void Geo::LineSeg::render(float r, float g, float b, const glm::mat4 & viewMatrix, const glm::mat4 & projMatrix) { glm::mat4 modelMatrix = glm::translate(glm::mat4(1.0f), { x1, y1, 0 }) * glm::scale(glm::mat4(1.0f), { x2 - x1, y2 - y1, 1.0f }); glm::mat4 mvp = projMatrix * viewMatrix * modelMatrix; static Shader shader("../assets/circle-wireframe.sh"); shader.setUniform3f("u_color", r, g, b); shader.setUniformMat4f("u_mvp", mvp); Geo::GeoObject::render(shader, getVB(), getIB(), getVA(), GL_LINES); } void Geo::LineSeg::renderLine(float x1, float y1, float x2, float y2, float r, float g, float b, const glm::mat4 & viewMatrix, const glm::mat4 & projMatrix) { static LineSeg line; line.x1 = x1; line.x2 = x2; line.y1 = y1; line.y2 = y2; line.render(r, g, b, viewMatrix, projMatrix); } bool Geo::LineSeg::getIntersection(const Geo::Circle & circle, std::vector<std::array<float, 2>>* poi) { return getLineCircleIntersection(*this, circle, poi); } bool Geo::LineSeg::getIntersection(const Geo::LineSeg & line, std::vector<std::array<float, 2>>* poi) { return getLineLineIntersection(*this, line, poi); } bool Geo::LineSeg::getIntersection(const Geo::Rectangle & rect, std::vector<std::array<float, 2>>* poi) { return getLineRectIntersection(rect, *this, poi); }
2ac25005ba63dfe03803dbd196a8abb573d255e9
59138b1b34e2a9356ad7154a9705007349209e9a
/platform/OSP/src/ServiceRef.cpp
df31518c3b0845bb7ceb9a9517dd9e48b48e7f49
[ "Apache-2.0" ]
permissive
gboyraz/macchina.io
6b879fca2329e7060122adfc691b4870d4dc06ac
de79c4d2eace01e24d685ac7f7c2e8aadf6b2668
refs/heads/master
2020-06-29T13:18:05.975243
2019-08-04T22:43:08
2019-08-04T22:43:08
200,547,738
2
0
Apache-2.0
2019-08-04T22:29:19
2019-08-04T22:29:19
null
UTF-8
C++
false
false
766
cpp
ServiceRef.cpp
// // ServiceRef.cpp // // Library: OSP // Package: Service // Module: ServiceRef // // Copyright (c) 2007-2014, Applied Informatics Software Engineering GmbH. // All rights reserved. // // SPDX-License-Identifier: Apache-2.0 // #include "Poco/OSP/ServiceRef.h" #include "Poco/OSP/ServiceFactory.h" namespace Poco { namespace OSP { ServiceRef::ServiceRef(const std::string& name, const Properties& props, Service::Ptr pService): _name(name), _props(props), _pService(pService) { } ServiceRef::~ServiceRef() { } Service::Ptr ServiceRef::instance() const { Poco::AutoPtr<ServiceFactory> pFactory = _pService.cast<ServiceFactory>(); if (pFactory) { return pFactory->createService(); } else { return _pService; } } } } // namespace Poco::OSP
350b7eeef766a674233fc3df1a8706fb4c97e0f9
aab071918419c2372a2203eb94879f82351675f6
/test/networking/tcp_messaging.cpp
e0a44a3e9d81e53cda551260be96728731fedd4a
[]
no_license
alialavia/UserIdentification
ad0f697bbc92aa9e69304863faf8a8faa66936af
dbdb77244cbe93c7403bf13f9265ce4b8ab70454
refs/heads/master
2020-03-25T00:24:43.828325
2017-07-05T10:45:37
2017-07-05T10:45:37
143,184,426
1
0
null
null
null
null
UTF-8
C++
false
false
2,557
cpp
tcp_messaging.cpp
#include <io/Networking.h> #include <gflags/gflags.h> #include <iostream> #include <opencv2/core/cvdef.h> #include "io/KinectInterface.h" #include <iomanip> DEFINE_int32(port, 8080, "Server port"); DEFINE_string(message_type, "primitive", "message types: image, primitive"); int main(int argc, char** argv) { gflags::ParseCommandLineFlags(&argc, &argv, true); // connect to server io::TCPClient c; if (!c.Connect("127.0.0.1", FLAGS_port)) { std::cout << "=== Could not connect to server" << std::endl; return -1; } while(1) { if(FLAGS_message_type == "primitive") { // send request id c.SendChar(2); // ----- send // string c.SendString("Hi there! I'm a Client."); // char c.SendChar(100); // unsigned char c.SendUChar(255); // short c.SendShort(32767); // unsigned short c.SendUShort(65535); // integer c.SendInt(234234); // unsigned integer c.SendUInt(4294967001); // bool c.SendBool(true); // float c.SendFloat(10.1f); // double c.SendDouble((double)10.0000000001); // ----- receive std::cout << "int8: " << (int)c.Receive8bit<int8_t>() << std::endl; std::cout << "uint8: " << (int)c.Receive8bit<uint8_t>() << std::endl; std::cout << "short: " << c.Receive16bit<short>() << std::endl; std::cout << "ushort: " << c.Receive16bit<unsigned short>() << std::endl; std::cout << "int: " << c.Receive32bit<int>() << std::endl; std::cout << "uint: " << c.Receive32bit<unsigned int>() << std::endl; std::cout << "bool: " << c.Receive8bit<int>() << std::endl; std::cout << std::setprecision(20) << "float: " << c.Receive32bit<float>() << std::endl; std::cout << std::setprecision(20) << "double: " << c.Receive64bit<double>() << std::endl; std::cout << "string: " << c.ReceiveStringWithVarLength() << std::endl; // close connection c.Close(); break; }else if(FLAGS_message_type == "image") { // send request ID c.SendUChar(1); // send image size c.SendUInt(100); // send image c.SendRGBTestImage(100); std::cout << "--- image sent, now waiting to receive\n"; std::cout << c.Receive32bit<int>() << std::endl; std::cout << c.Receive32bit<float>() << std::endl; // receive image //cv::Mat server_img = cv::Mat::zeros(100, 100, CV_8UC3); //c.ReceiveImage(server_img, 100); //// display image //cv::imshow("Received from server", server_img); //cv::waitKey(0); // reconnect to server c.Close(); break; } // connection is terminated by server } return 0; }
93162197008e0c5983c4c2d12e45f7dd159380a5
a4c9f1113f976097618c58a7a7e164df9db5b1e0
/P68836.cc
55022dbf33291779c801b431502ea19b3174ace6
[]
no_license
ferranromero/PRO1
399b90280fac10e519a2807caea575d8ea1b06b1
e45c83beb1436bdba7294a9e63181a7999b0fda8
refs/heads/master
2020-03-24T05:45:21.274178
2018-07-26T22:36:20
2018-07-26T22:36:20
null
0
0
null
null
null
null
UTF-8
C++
false
false
885
cc
P68836.cc
#include <iostream> using namespace std; struct Date{ int day, month, year; }; void get_date (Date& d){ char c; cin >> d.day >> c >> d.month >> c >> d.year; } bool less_than (const Date& d1, const Date& d2){ if(d1.year > d2.year) return false; if(d1.year == d2.year and d1.month > d2.month) return false; if(d1.year == d2.year and d1.month == d2.month and d1.day > d2.day) return false; if(d1.year == d2.year and d1.month == d2.month and d1.day == d2.day) return false; return true; } int main(){3 int n; Date d1, d2, d3; bool found = false; cin >> n; get_date(d1); get_date(d2); int i = 2; while(not found and i < n){ get_date(d3); if(less_than(d1,d2) and less_than(d2,d3)){ found = true; } else{ d1 = d2; d2 = d3; } ++i; } if(found) cout << d2.day << "/" << d2.month << "/" << d2.year << endl; else cout << "cap data trobada" << endl; }
188ea7ab13a3440460f18fc83a9b6c99b0d40858
d7b4718bdf5be3ebfb6fc5ddbb0358ac2de471ba
/app/src/main/jni/effects/Pixelize.cpp
966b880c6283a9f676c5dacf21eddbef05fd0590
[]
no_license
togrulseyid/prizmatagram
45dd5923ae21f2732717142da91479575b4e89dc
ed133b7cb0b72f8bf6ad7c52aa57cac742502014
refs/heads/master
2020-12-21T13:02:59.071280
2020-01-27T19:43:20
2020-01-27T19:43:20
236,438,142
0
0
null
null
null
null
UTF-8
C++
false
false
1,088
cpp
Pixelize.cpp
// // Created by toghrul on 02.07.2016. // #include "effects/Pixelize.h" #ifdef __cplusplus extern "C" { #endif /* Pixelize::Pixelize(cv::Mat *_mat) { mat = _mat; } */ Pixelize::~Pixelize() { //matObj.release(); } void Pixelize::process() { cv::Mat imgOut = mat->clone(); IplImage* img; img = cvCreateImage(cvSize(imgOut.cols,imgOut.rows),8,3); IplImage ipltemp=imgOut; cvCopy(&ipltemp,img); *mat = pixelate(img, cols); imgOut.release(); } cv::Mat Pixelize::pixelate(IplImage* &img, int size) { if(size > 0) { LOGD("Geldi getdix %d", size); for( int y=0; y<img->height; y++ ) { for( int x=0; x<img->width; x++ ) { //traverse each pixel for(int c=0; c<3; c++) { //access color channel int xPixel = x-(x%size); int yPixel = y-(y%size); img->imageData[(y*img->width+x)*3+c] = img->imageData[(yPixel*img->width+xPixel)*3+c]; //replace with pixel img at adjustment value. } } } } cv::Mat m = cv::cvarrToMat(img); // default additional arguments: don't copy data. return m; } #ifdef __cplusplus } #endif
509dac434062b7072de0b5d19670b6a0e668b167
e89a104ed7632b4955e6d0b314e864e54b183717
/usd-rs/thirdparty/docs/include/pxr/usd/ar/defaultResolver.h
d5f8cb504b64b6c7ef745940082b3256588aad92
[]
no_license
HackerFoo/usd-rs
5532a774f7c1b1c7a1826dccac28062d2f2ae420
af5f737e005177eb1e86c36cc57f66db4e2e5f88
refs/heads/develop
2023-07-13T00:49:12.986540
2021-05-04T22:39:53
2021-05-04T22:40:03
400,973,049
0
0
null
2021-08-29T06:54:55
2021-08-29T06:54:55
null
UTF-8
C++
false
false
7,167
h
defaultResolver.h
#line 1 "/Volumes/src/usd-rs/usd-cpp/thirdparty/USD/pxr/usd/ar/defaultResolver.h" // // Copyright 2016 Pixar // // Licensed under the Apache License, Version 2.0 (the "Apache License") // with the following modification; you may not use this file except in // compliance with the Apache License and the following modification to it: // Section 6. Trademarks. is deleted and replaced with: // // 6. Trademarks. This License does not grant permission to use the trade // names, trademarks, service marks, or product names of the Licensor // and its affiliates, except as required to comply with Section 4(c) of // the License and to reproduce the content of the NOTICE file. // // You may obtain a copy of the Apache License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the Apache License with the above modification is // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY // KIND, either express or implied. See the Apache License for the specific // language governing permissions and limitations under the Apache License. // #ifndef PXR_USD_AR_DEFAULT_RESOLVER_H #define PXR_USD_AR_DEFAULT_RESOLVER_H /// \file ar/defaultResolver.h #include "pxr/pxr.h" #include "pxr/usd/ar/api.h" #include "pxr/usd/ar/defaultResolverContext.h" #include "pxr/usd/ar/resolver.h" #include "pxr/usd/ar/threadLocalScopedCache.h" #include <tbb/enumerable_thread_specific.h> #include <memory> #include <string> #include <vector> PXR_NAMESPACE_OPEN_SCOPE /// \class ArDefaultResolver /// /// Default asset resolution implementation used when no plugin /// implementation is provided. /// /// In order to resolve assets specified by relative paths, this resolver /// implements a simple "search path" scheme. The resolver will anchor the /// relative path to a series of directories and return the first absolute /// path where the asset exists. /// /// The first directory will always be the current working directory. The /// resolver will then examine the directories specified via the following /// mechanisms (in order): /// /// - The currently-bound ArDefaultResolverContext for the calling thread /// - ArDefaultResolver::SetDefaultSearchPath /// - The environment variable PXR_AR_DEFAULT_SEARCH_PATH. This is /// expected to be a list of directories delimited by the platform's /// standard path separator. /// class ArDefaultResolver : public ArResolver { public: AR_API ArDefaultResolver(); AR_API virtual ~ArDefaultResolver(); /// Set the default search path that will be used during asset /// resolution. This must be called before the first call /// to \ref ArGetResolver. /// The specified paths will be searched *in addition to, and before* /// paths specified via the environment variable PXR_AR_DEFAULT_SEARCH_PATH AR_API static void SetDefaultSearchPath( const std::vector<std::string>& searchPath); // ArResolver overrides /// Sets the resolver's default context (returned by CreateDefaultContext()) /// to the same context you would get by calling /// CreateDefaultContextForAsset(). Has no other effect on the resolver's /// configuration. AR_API virtual void ConfigureResolverForAsset(const std::string& path) override; AR_API virtual std::string AnchorRelativePath( const std::string& anchorPath, const std::string& path) override; AR_API virtual bool IsRelativePath(const std::string& path) override; AR_API virtual bool IsRepositoryPath(const std::string& path) override; AR_API virtual bool IsSearchPath(const std::string& path) override; AR_API virtual std::string GetExtension(const std::string& path) override; AR_API virtual std::string ComputeNormalizedPath(const std::string& path) override; AR_API virtual std::string ComputeRepositoryPath(const std::string& path) override; AR_API virtual std::string ComputeLocalPath(const std::string& path) override; AR_API virtual std::string Resolve(const std::string& path) override; AR_API virtual std::string ResolveWithAssetInfo( const std::string& path, ArAssetInfo* assetInfo) override; AR_API virtual void UpdateAssetInfo( const std::string& identifier, const std::string& filePath, const std::string& fileVersion, ArAssetInfo* assetInfo) override; AR_API virtual VtValue GetModificationTimestamp( const std::string& path, const std::string& resolvedPath) override; AR_API virtual bool FetchToLocalResolvedPath( const std::string& path, const std::string& resolvedPath) override; AR_API virtual std::shared_ptr<ArAsset> OpenAsset( const std::string& resolvedPath) override; AR_API virtual bool CreatePathForLayer( const std::string& path) override; AR_API virtual bool CanWriteLayerToPath( const std::string& path, std::string* whyNot) override; AR_API virtual bool CanCreateNewLayerWithIdentifier( const std::string& identifier, std::string* whyNot) override; AR_API virtual ArResolverContext CreateDefaultContext() override; /// Creates a context that adds the directory containing \p filePath /// as a first directory to be searched, when the resulting context is /// bound (\see ArResolverContextBinder). /// /// If \p filePath is empty, returns an empty context; otherwise, if /// \p filePath is not an absolute filesystem path, it will first be /// anchored to the process's current working directory. AR_API virtual ArResolverContext CreateDefaultContextForAsset( const std::string& filePath) override; AR_API virtual void RefreshContext(const ArResolverContext& context) override; AR_API virtual ArResolverContext GetCurrentContext() override; AR_API virtual void BeginCacheScope( VtValue* cacheScopeData) override; AR_API virtual void EndCacheScope( VtValue* cacheScopeData) override; AR_API virtual void BindContext( const ArResolverContext& context, VtValue* bindingData) override; AR_API virtual void UnbindContext( const ArResolverContext& context, VtValue* bindingData) override; private: struct _Cache; using _PerThreadCache = ArThreadLocalScopedCache<_Cache>; using _CachePtr = _PerThreadCache::CachePtr; _CachePtr _GetCurrentCache(); const ArDefaultResolverContext* _GetCurrentContext(); std::string _ResolveNoCache(const std::string& path); private: ArDefaultResolverContext _fallbackContext; ArResolverContext _defaultContext; _PerThreadCache _threadCache; using _ContextStack = std::vector<const ArDefaultResolverContext*>; using _PerThreadContextStack = tbb::enumerable_thread_specific<_ContextStack>; _PerThreadContextStack _threadContextStack; }; PXR_NAMESPACE_CLOSE_SCOPE #endif // PXR_USD_AR_DEFAULT_RESOLVER_H
72fac89b8075d83217095538ad449192e859dd57
877fff5bb313ccd23d1d01bf23b1e1f2b13bb85a
/app/src/main/cpp/dir521/dir3871/dir5864/dir6199/file6214.cpp
0a6f5e6a652bdce1a6188c561fb14e3aa4efdfcc
[]
no_license
tgeng/HugeProject
829c3bdfb7cbaf57727c41263212d4a67e3eb93d
4488d3b765e8827636ce5e878baacdf388710ef2
refs/heads/master
2022-08-21T16:58:54.161627
2020-05-28T01:54:03
2020-05-28T01:54:03
267,468,475
0
0
null
null
null
null
UTF-8
C++
false
false
111
cpp
file6214.cpp
#ifndef file6214 #error "macro file6214 must be defined" #endif static const char* file6214String = "file6214";
54d5fb536ca4378ae553a9a200bc4460c062b11f
26cc428b3d87f0cd0f1a2e6a51e9da25cd0b651a
/upperPosition/Blasius_10/Upper_outlet/linear/0.1/U
5a16c763de5b7f917931f115b9b20bcf5b041de1
[]
no_license
CagriMetin/BlasiusProblem
8f4fe708df8f3332d054b233d99a33fbb3c15c2a
32c4aafd6ddd6ba4c39aef04d01b77a9106125b2
refs/heads/master
2020-12-24T19:37:14.665700
2016-12-27T19:13:04
2016-12-27T19:13:04
57,833,097
0
0
null
null
null
null
UTF-8
C++
false
false
84,383
U
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2.3.0 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volVectorField; location "0.1"; object U; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 -1 0 0 0 0]; internalField nonuniform List<vector> 3375 ( (0.176159 0.00432822 0) (0.155721 0.00596968 0) (0.137134 0.00611772 0) (0.119039 0.00550414 0) (0.101596 0.00470263 0) (0.0856461 0.00382067 0) (0.0722155 0.00285652 0) (0.0616973 0.00184024 0) (0.0539038 0.000956827 0) (0.0483085 0.00035648 0) (0.0443523 3.3809e-05 0) (0.0415636 -0.00010046 0) (0.0395629 -0.000128523 0) (0.0380674 -0.000105944 0) (0.0368801 -6.46284e-05 0) (0.0358765 -2.37883e-05 0) (0.0349883 6.3207e-06 0) (0.034184 2.35761e-05 0) (0.0334532 3.07303e-05 0) (0.032794 3.19252e-05 0) (0.0322073 3.03682e-05 0) (0.0316957 2.73491e-05 0) (0.0312612 2.37999e-05 0) (0.0309036 2.00637e-05 0) (0.0306208 1.6238e-05 0) (0.0304104 1.2303e-05 0) (0.0302699 7.84873e-06 0) (0.0301972 3.20678e-06 0) (0.0301869 -5.38808e-06 0) (0.0302285 -1.18221e-05 0) (0.0303083 -1.54915e-05 0) (0.0304118 -1.69689e-05 0) (0.0305254 -1.68616e-05 0) (0.0306384 -1.56375e-05 0) (0.0307438 -1.3842e-05 0) (0.0308378 -1.19484e-05 0) (0.0309193 -1.02154e-05 0) (0.0309889 -8.7279e-06 0) (0.0310477 -7.47953e-06 0) (0.0310973 -6.42827e-06 0) (0.0311391 -5.53125e-06 0) (0.0311745 -4.75982e-06 0) (0.0312044 -4.09821e-06 0) (0.0312298 -3.53626e-06 0) (0.0312515 -3.06501e-06 0) (0.0312702 -2.67556e-06 0) (0.0312865 -2.35664e-06 0) (0.0313009 -2.0953e-06 0) (0.0313137 -1.88017e-06 0) (0.0313252 -1.70044e-06 0) (0.0313357 -1.54702e-06 0) (0.0313452 -1.41422e-06 0) (0.031354 -1.29737e-06 0) (0.0313622 -1.1922e-06 0) (0.0313697 -1.09593e-06 0) (0.0313766 -1.00824e-06 0) (0.031383 -9.27861e-07 0) (0.031389 -8.5359e-07 0) (0.0313945 -7.85021e-07 0) (0.0313996 -7.21751e-07 0) (0.0314043 -6.63262e-07 0) (0.0314087 -6.09115e-07 0) (0.0314127 -5.59198e-07 0) (0.0314165 -5.13231e-07 0) (0.0314199 -4.70711e-07 0) (0.0314231 -4.31434e-07 0) (0.0314261 -3.95202e-07 0) (0.0314288 -3.61838e-07 0) (0.0314313 -3.31037e-07 0) (0.0314336 -3.02727e-07 0) (0.0314357 -2.76568e-07 0) (0.0314377 -2.5264e-07 0) (0.0314395 -2.30397e-07 0) (0.0314412 -2.10174e-07 0) (0.0314427 -1.9126e-07 0) (0.0314441 -1.74249e-07 0) (0.0314454 -1.58221e-07 0) (0.0314465 -1.4393e-07 0) (0.0314476 -1.30388e-07 0) (0.0314486 -1.18324e-07 0) (0.0314495 -1.06961e-07 0) (0.0314503 -9.67084e-08 0) (0.0314511 -8.72374e-08 0) (0.0314517 -7.84601e-08 0) (0.0314523 -7.06152e-08 0) (0.0314529 -6.30437e-08 0) (0.0314534 -5.65633e-08 0) (0.0314538 -4.99877e-08 0) (0.0314543 -4.46219e-08 0) (0.0314546 -3.88762e-08 0) (0.0314549 -3.44248e-08 0) (0.0314552 -2.93067e-08 0) (0.0314555 -2.56481e-08 0) (0.0314556 -2.09811e-08 0) (0.0314558 -1.79603e-08 0) (0.031456 -1.37656e-08 0) (0.0314561 -1.1552e-08 0) (0.0314562 -7.04518e-09 0) (0.0314562 -8.32966e-09 0) (0.0314563 -5.71782e-09 0) (0.191315 0.00766392 0) (0.189653 0.0108245 0) (0.187237 0.0118965 0) (0.183419 0.0116855 0) (0.177992 0.0110117 0) (0.171244 0.0101082 0) (0.163768 0.00896142 0) (0.155998 0.00755005 0) (0.148323 0.0060182 0) (0.141007 0.00459666 0) (0.134197 0.00343447 0) (0.127984 0.00255387 0) (0.122412 0.00191522 0) (0.117479 0.00147181 0) (0.113143 0.00117182 0) (0.109344 0.000967956 0) (0.106016 0.00082329 0) (0.103093 0.000710352 0) (0.100525 0.000613073 0) (0.0982758 0.000525751 0) (0.0963168 0.000445872 0) (0.0946222 0.000370653 0) (0.0931746 0.000299633 0) (0.0919609 0.000233569 0) (0.0909679 0.000172444 0) (0.0901824 0.000116275 0) (0.0895921 6.60583e-05 0) (0.0891806 2.2057e-05 0) (0.088932 -1.92353e-05 0) (0.0888243 -5.44247e-05 0) (0.0888268 -7.74758e-05 0) (0.0889071 -8.69934e-05 0) (0.0890365 -8.69247e-05 0) (0.0891901 -8.06534e-05 0) (0.0893497 -7.10931e-05 0) (0.0895031 -6.06293e-05 0) (0.0896436 -5.07762e-05 0) (0.0897681 -4.22147e-05 0) (0.089876 -3.50747e-05 0) (0.0899681 -2.92269e-05 0) (0.0900456 -2.44539e-05 0) (0.0901103 -2.05445e-05 0) (0.0901639 -1.73397e-05 0) (0.0902083 -1.47209e-05 0) (0.0902451 -1.25924e-05 0) (0.0902758 -1.08737e-05 0) (0.0903017 -9.49239e-06 0) (0.0903239 -8.38352e-06 0) (0.0903432 -7.48161e-06 0) (0.0903602 -6.7367e-06 0) (0.0903754 -6.10884e-06 0) (0.0903892 -5.56845e-06 0) (0.0904017 -5.09558e-06 0) (0.0904132 -4.67532e-06 0) (0.0904237 -4.29386e-06 0) (0.0904334 -3.94668e-06 0) (0.0904424 -3.62943e-06 0) (0.0904507 -3.33792e-06 0) (0.0904583 -3.06962e-06 0) (0.0904654 -2.82242e-06 0) (0.090472 -2.59483e-06 0) (0.0904781 -2.38449e-06 0) (0.0904837 -2.19031e-06 0) (0.0904889 -2.01119e-06 0) (0.0904937 -1.84594e-06 0) (0.0904982 -1.69362e-06 0) (0.0905023 -1.553e-06 0) (0.0905061 -1.4233e-06 0) (0.0905096 -1.30352e-06 0) (0.0905129 -1.19326e-06 0) (0.0905159 -1.09131e-06 0) (0.0905186 -9.9783e-07 0) (0.0905212 -9.1112e-07 0) (0.0905235 -8.32112e-07 0) (0.0905257 -7.58368e-07 0) (0.0905277 -6.91634e-07 0) (0.0905295 -6.28921e-07 0) (0.0905312 -5.72664e-07 0) (0.0905327 -5.19515e-07 0) (0.0905342 -4.71978e-07 0) (0.0905354 -4.27083e-07 0) (0.0905366 -3.86786e-07 0) (0.0905377 -3.49042e-07 0) (0.0905387 -3.14733e-07 0) (0.0905396 -2.83019e-07 0) (0.0905404 -2.53678e-07 0) (0.0905411 -2.27001e-07 0) (0.0905417 -2.01764e-07 0) (0.0905424 -1.79269e-07 0) (0.0905428 -1.5733e-07 0) (0.0905433 -1.38382e-07 0) (0.0905437 -1.18851e-07 0) (0.0905441 -1.03119e-07 0) (0.0905443 -8.51258e-08 0) (0.0905446 -7.2181e-08 0) (0.0905447 -5.53514e-08 0) (0.090545 -4.57433e-08 0) (0.090545 -2.36611e-08 0) (0.0905451 -2.69732e-08 0) (0.0905451 -1.67227e-08 0) (0.192353 0.00732172 0) (0.192843 0.0100399 0) (0.194004 0.0116529 0) (0.195094 0.0121144 0) (0.195495 0.011939 0) (0.195015 0.0114379 0) (0.193699 0.0106899 0) (0.191608 0.00970082 0) (0.18884 0.00851888 0) (0.185569 0.00730099 0) (0.182006 0.00621274 0) (0.178327 0.00531812 0) (0.174638 0.00459554 0) (0.17101 0.00401052 0) (0.167496 0.00352796 0) (0.164135 0.0031184 0) (0.160956 0.00276381 0) (0.157966 0.00245005 0) (0.155163 0.0021645 0) (0.152551 0.00190012 0) (0.150143 0.00165338 0) (0.147943 0.00142134 0) (0.145958 0.00120138 0) (0.144191 0.000992804 0) (0.142645 0.000797035 0) (0.141315 0.000614122 0) (0.140201 0.000443677 0) (0.139292 0.000287165 0) (0.138576 0.000151956 0) (0.138037 3.97484e-05 0) (0.137657 -4.3837e-05 0) (0.13741 -9.98318e-05 0) (0.137271 -0.000131034 0) (0.137213 -0.000142429 0) (0.137214 -0.000140272 0) (0.137255 -0.000130024 0) (0.137321 -0.000115797 0) (0.137401 -0.000100324 0) (0.137486 -8.52211e-05 0) (0.13757 -7.13475e-05 0) (0.137649 -5.91027e-05 0) (0.137718 -4.86145e-05 0) (0.137778 -3.98628e-05 0) (0.137828 -3.2734e-05 0) (0.137868 -2.70436e-05 0) (0.1379 -2.25805e-05 0) (0.137926 -1.91135e-05 0) (0.137946 -1.64334e-05 0) (0.137962 -1.43509e-05 0) (0.137974 -1.27021e-05 0) (0.137985 -1.13681e-05 0) (0.137994 -1.0262e-05 0) (0.138002 -9.32196e-06 0) (0.138008 -8.50569e-06 0) (0.138014 -7.78113e-06 0) (0.13802 -7.13274e-06 0) (0.138025 -6.54628e-06 0) (0.138029 -6.01156e-06 0) (0.138033 -5.52337e-06 0) (0.138037 -5.07591e-06 0) (0.138041 -4.66561e-06 0) (0.138044 -4.2883e-06 0) (0.138047 -3.94132e-06 0) (0.13805 -3.62171e-06 0) (0.138052 -3.32673e-06 0) (0.138055 -3.05498e-06 0) (0.138057 -2.80445e-06 0) (0.138059 -2.57343e-06 0) (0.138061 -2.36008e-06 0) (0.138063 -2.16359e-06 0) (0.138065 -1.98181e-06 0) (0.138066 -1.81485e-06 0) (0.138068 -1.65973e-06 0) (0.138069 -1.51812e-06 0) (0.13807 -1.38577e-06 0) (0.138071 -1.26596e-06 0) (0.138072 -1.15293e-06 0) (0.138073 -1.05171e-06 0) (0.138074 -9.5523e-07 0) (0.138075 -8.69681e-07 0) (0.138076 -7.87415e-07 0) (0.138077 -7.14971e-07 0) (0.138077 -6.44946e-07 0) (0.138078 -5.83473e-07 0) (0.138078 -5.23786e-07 0) (0.138079 -4.71357e-07 0) (0.138079 -4.2045e-07 0) (0.13808 -3.75293e-07 0) (0.13808 -3.31939e-07 0) (0.13808 -2.9231e-07 0) (0.138081 -2.5561e-07 0) (0.138081 -2.19695e-07 0) (0.138081 -1.89224e-07 0) (0.138081 -1.55263e-07 0) (0.138081 -1.30589e-07 0) (0.138081 -9.72936e-08 0) (0.138082 -7.98089e-08 0) (0.138081 -3.54309e-08 0) (0.138082 -3.68548e-08 0) (0.138081 -1.2695e-08 0) (0.193367 0.00688427 0) (0.193756 0.00884649 0) (0.194931 0.0103892 0) (0.196578 0.0111237 0) (0.198157 0.0112042 0) (0.199384 0.0108936 0) (0.200198 0.0103712 0) (0.200558 0.00970094 0) (0.200404 0.00888457 0) (0.199744 0.00797877 0) (0.198688 0.0070982 0) (0.197381 0.00633209 0) (0.195923 0.0057068 0) (0.194356 0.00519663 0) (0.1927 0.00475658 0) (0.190992 0.00435386 0) (0.18928 0.00398014 0) (0.18759 0.00363631 0) (0.185922 0.00331591 0) (0.184278 0.00300722 0) (0.182672 0.00270365 0) (0.181124 0.00240494 0) (0.179648 0.00211161 0) (0.178258 0.00182401 0) (0.176965 0.00154392 0) (0.175779 0.0012738 0) (0.174707 0.00101607 0) (0.17375 0.000773827 0) (0.172909 0.000552017 0) (0.172185 0.000360054 0) (0.171576 0.000205068 0) (0.171075 8.52074e-05 0) (0.170676 -8.82775e-07 0) (0.170368 -5.74604e-05 0) (0.170138 -9.12805e-05 0) (0.169972 -0.000108853 0) (0.16986 -0.00011536 0) (0.169792 -0.000114402 0) (0.16976 -0.000108389 0) (0.169755 -9.90261e-05 0) (0.169769 -8.76377e-05 0) (0.169795 -7.53814e-05 0) (0.169826 -6.32734e-05 0) (0.169856 -5.20961e-05 0) (0.169884 -4.23459e-05 0) (0.169905 -3.42336e-05 0) (0.169922 -2.77486e-05 0) (0.169933 -2.27059e-05 0) (0.169939 -1.88679e-05 0) (0.169943 -1.59628e-05 0) (0.169944 -1.37522e-05 0) (0.169943 -1.20419e-05 0) (0.169942 -1.06892e-05 0) (0.169939 -9.58845e-06 0) (0.169937 -8.66276e-06 0) (0.169934 -7.87116e-06 0) (0.169931 -7.18055e-06 0) (0.169928 -6.56721e-06 0) (0.169926 -6.01736e-06 0) (0.169924 -5.52158e-06 0) (0.169921 -5.07152e-06 0) (0.169919 -4.66085e-06 0) (0.169917 -4.28611e-06 0) (0.169916 -3.94325e-06 0) (0.169914 -3.62797e-06 0) (0.169913 -3.33797e-06 0) (0.169911 -3.07079e-06 0) (0.16991 -2.82459e-06 0) (0.169909 -2.59691e-06 0) (0.169908 -2.38716e-06 0) (0.169907 -2.19264e-06 0) (0.169906 -2.01408e-06 0) (0.169906 -1.84711e-06 0) (0.169905 -1.69509e-06 0) (0.169905 -1.55121e-06 0) (0.169904 -1.42214e-06 0) (0.169904 -1.29773e-06 0) (0.169903 -1.18852e-06 0) (0.169903 -1.08072e-06 0) (0.169903 -9.88239e-07 0) (0.169903 -8.94799e-07 0) (0.169902 -8.16249e-07 0) (0.169902 -7.35303e-07 0) (0.169902 -6.68288e-07 0) (0.169902 -5.98108e-07 0) (0.169902 -5.40405e-07 0) (0.169902 -4.79633e-07 0) (0.169901 -4.29007e-07 0) (0.169901 -3.76742e-07 0) (0.169901 -3.31005e-07 0) (0.169901 -2.86434e-07 0) (0.169901 -2.43511e-07 0) (0.169901 -2.0625e-07 0) (0.169901 -1.63911e-07 0) (0.169901 -1.33806e-07 0) (0.1699 -9.03351e-08 0) (0.1699 -6.79847e-08 0) (0.1699 -1.81289e-08 0) (0.1699 -1.10159e-08 0) (0.1699 3.40993e-08 0) (0.194229 0.00658388 0) (0.194557 0.00806731 0) (0.195478 0.00939472 0) (0.196897 0.0101975 0) (0.198442 0.0104202 0) (0.199833 0.0102121 0) (0.200987 0.0097746 0) (0.201891 0.00924295 0) (0.202501 0.00863639 0) (0.202779 0.00794599 0) (0.202757 0.00721906 0) (0.202521 0.00654294 0) (0.20216 0.00598138 0) (0.201713 0.00553418 0) (0.201181 0.00515468 0) (0.200574 0.00479616 0) (0.199926 0.00444545 0) (0.199264 0.00411428 0) (0.198587 0.00380716 0) (0.197882 0.00351114 0) (0.197154 0.00321284 0) (0.196411 0.00291043 0) (0.195665 0.00260708 0) (0.194924 0.00230437 0) (0.194195 0.00200403 0) (0.193484 0.00170948 0) (0.1928 0.00142372 0) (0.192145 0.00115058 0) (0.191526 0.000897032 0) (0.190945 0.000671124 0) (0.190409 0.000477242 0) (0.189926 0.000319204 0) (0.1895 0.000196459 0) (0.189133 0.000105454 0) (0.188822 4.06265e-05 0) (0.188561 -4.46302e-06 0) (0.188346 -3.54675e-05 0) (0.188172 -5.63387e-05 0) (0.188037 -6.94006e-05 0) (0.187936 -7.595e-05 0) (0.187866 -7.68999e-05 0) (0.187821 -7.32336e-05 0) (0.187794 -6.62316e-05 0) (0.18778 -5.7293e-05 0) (0.187772 -4.77385e-05 0) (0.187767 -3.85914e-05 0) (0.187762 -3.05228e-05 0) (0.187756 -2.38347e-05 0) (0.187748 -1.85501e-05 0) (0.187738 -1.4528e-05 0) (0.187727 -1.15431e-05 0) (0.187715 -9.36424e-06 0) (0.187703 -7.77544e-06 0) (0.18769 -6.59418e-06 0) (0.187678 -5.70841e-06 0) (0.187667 -5.02494e-06 0) (0.187655 -4.47943e-06 0) (0.187645 -4.03478e-06 0) (0.187635 -3.66151e-06 0) (0.187626 -3.34238e-06 0) (0.187618 -3.0644e-06 0) (0.18761 -2.81876e-06 0) (0.187603 -2.59995e-06 0) (0.187596 -2.40365e-06 0) (0.18759 -2.22559e-06 0) (0.187585 -2.06302e-06 0) (0.18758 -1.91352e-06 0) (0.187575 -1.77601e-06 0) (0.187571 -1.64798e-06 0) (0.187567 -1.53e-06 0) (0.187563 -1.41881e-06 0) (0.18756 -1.31721e-06 0) (0.187557 -1.219e-06 0) (0.187555 -1.13135e-06 0) (0.187552 -1.0433e-06 0) (0.18755 -9.68105e-07 0) (0.187548 -8.88296e-07 0) (0.187546 -8.24081e-07 0) (0.187545 -7.51424e-07 0) (0.187543 -6.96257e-07 0) (0.187542 -6.30275e-07 0) (0.187541 -5.82302e-07 0) (0.187539 -5.22578e-07 0) (0.187538 -4.80323e-07 0) (0.187538 -4.26262e-07 0) (0.187537 -3.88261e-07 0) (0.187536 -3.39624e-07 0) (0.187535 -3.04022e-07 0) (0.187535 -2.60936e-07 0) (0.187534 -2.26129e-07 0) (0.187534 -1.88128e-07 0) (0.187533 -1.52704e-07 0) (0.187533 -1.19827e-07 0) (0.187532 -8.19175e-08 0) (0.187532 -5.50432e-08 0) (0.187531 -1.31923e-08 0) (0.187531 8.98525e-09 0) (0.187531 4.75824e-08 0) (0.187531 6.5482e-08 0) (0.18753 1.29515e-07 0) (0.194956 0.00635181 0) (0.195268 0.00754317 0) (0.196013 0.00864414 0) (0.197171 0.0094113 0) (0.198507 0.00972504 0) (0.199782 0.00962191 0) (0.200883 0.00926058 0) (0.201789 0.00880603 0) (0.202495 0.00831381 0) (0.202991 0.00775978 0) (0.203281 0.00714484 0) (0.203394 0.00653352 0) (0.203393 0.00600557 0) (0.203337 0.00558812 0) (0.203239 0.00524262 0) (0.203095 0.00491338 0) (0.20292 0.00457991 0) (0.202736 0.00425784 0) (0.20254 0.00396066 0) (0.202321 0.00367875 0) (0.202077 0.0033948 0) (0.20181 0.00310314 0) (0.201521 0.00280753 0) (0.201213 0.00251159 0) (0.200888 0.00221725 0) (0.200549 0.00192661 0) (0.200196 0.00164231 0) (0.199833 0.00136885 0) (0.199464 0.00111298 0) (0.199091 0.00088145 0) (0.198723 0.000678842 0) (0.198367 0.000507867 0) (0.198033 0.000368371 0) (0.197726 0.000258759 0) (0.197449 0.000175348 0) (0.197203 0.000112669 0) (0.196984 6.51659e-05 0) (0.196792 2.85666e-05 0) (0.196626 3.46788e-07 0) (0.196486 -2.061e-05 0) (0.19637 -3.46968e-05 0) (0.196277 -4.23019e-05 0) (0.196204 -4.42307e-05 0) (0.196147 -4.17682e-05 0) (0.196103 -3.64378e-05 0) (0.196067 -2.97169e-05 0) (0.196037 -2.27986e-05 0) (0.196009 -1.64943e-05 0) (0.195984 -1.1217e-05 0) (0.19596 -7.09617e-06 0) (0.195936 -4.05754e-06 0) (0.195913 -1.93429e-06 0) (0.195891 -5.17851e-07 0) (0.19587 3.87971e-07 0) (0.19585 9.23099e-07 0) (0.195831 1.21287e-06 0) (0.195814 1.34403e-06 0) (0.195797 1.371e-06 0) (0.195782 1.33412e-06 0) (0.195767 1.25946e-06 0) (0.195754 1.16349e-06 0) (0.195742 1.05655e-06 0) (0.195731 9.46333e-07 0) (0.19572 8.37084e-07 0) (0.195711 7.31785e-07 0) (0.195702 6.3238e-07 0) (0.195694 5.40464e-07 0) (0.195687 4.55553e-07 0) (0.19568 3.79521e-07 0) (0.195674 3.09525e-07 0) (0.195668 2.49716e-07 0) (0.195663 1.93374e-07 0) (0.195658 1.49458e-07 0) (0.195654 1.04522e-07 0) (0.19565 7.5563e-08 0) (0.195647 3.95109e-08 0) (0.195644 2.37913e-08 0) (0.195641 -4.93e-09 0) (0.195638 -9.89124e-09 0) (0.195636 -3.17744e-08 0) (0.195633 -2.87717e-08 0) (0.195631 -4.41208e-08 0) (0.19563 -3.52108e-08 0) (0.195628 -4.4773e-08 0) (0.195627 -3.1285e-08 0) (0.195625 -3.53768e-08 0) (0.195624 -1.89947e-08 0) (0.195623 -1.7037e-08 0) (0.195622 6.57652e-10 0) (0.195621 8.78019e-09 0) (0.19562 2.73751e-08 0) (0.195619 4.17892e-08 0) (0.195619 6.0242e-08 0) (0.195618 8.21022e-08 0) (0.195618 9.86551e-08 0) (0.195617 1.28112e-07 0) (0.195617 1.44095e-07 0) (0.195616 1.67287e-07 0) (0.195616 1.92259e-07 0) (0.195615 2.59763e-07 0) (0.195579 0.00614139 0) (0.195884 0.00712507 0) (0.196513 0.00803302 0) (0.197463 0.00871635 0) (0.198582 0.0090677 0) (0.199703 0.00905856 0) (0.200709 0.00878656 0) (0.201545 0.00840327 0) (0.202207 0.00798579 0) (0.202721 0.0075231 0) (0.203094 0.0069997 0) (0.203313 0.00645468 0) (0.203413 0.00596245 0) (0.203459 0.00556433 0) (0.203487 0.00523466 0) (0.203493 0.00492084 0) (0.203479 0.00459982 0) (0.203456 0.00428541 0) (0.203423 0.00399376 0) (0.203378 0.00371934 0) (0.203318 0.00344536 0) (0.203243 0.00316398 0) (0.203147 0.00287834 0) (0.203031 0.00259295 0) (0.202894 0.00230984 0) (0.202737 0.0020302 0) (0.202557 0.00175606 0) (0.202356 0.00149172 0) (0.202135 0.0012437 0) (0.201899 0.00101809 0) (0.201652 0.00081805 0) (0.201401 0.000644991 0) (0.201153 0.000499425 0) (0.200916 0.00038101 0) (0.200694 0.000287444 0) (0.200488 0.000214467 0) (0.2003 0.000157086 0) (0.200127 0.000111007 0) (0.199971 7.34394e-05 0) (0.199829 4.30982e-05 0) (0.199704 1.96899e-05 0) (0.199594 3.15428e-06 0) (0.1995 -6.86006e-06 0) (0.19942 -1.12798e-05 0) (0.199352 -1.14531e-05 0) (0.199295 -8.88767e-06 0) (0.199245 -4.96352e-06 0) (0.199201 -7.49326e-07 0) (0.199162 3.05585e-06 0) (0.199126 6.09313e-06 0) (0.199093 8.26553e-06 0) (0.199062 9.64077e-06 0) (0.199033 1.03551e-05 0) (0.199006 1.05598e-05 0) (0.198981 1.04114e-05 0) (0.198957 1.00304e-05 0) (0.198935 9.50587e-06 0) (0.198915 8.90431e-06 0) (0.198896 8.26942e-06 0) (0.198878 7.63063e-06 0) (0.198862 7.00556e-06 0) (0.198847 6.40561e-06 0) (0.198834 5.83804e-06 0) (0.198821 5.30546e-06 0) (0.19881 4.80912e-06 0) (0.198799 4.34896e-06 0) (0.198789 3.92528e-06 0) (0.19878 3.535e-06 0) (0.198772 3.17915e-06 0) (0.198764 2.85175e-06 0) (0.198758 2.55779e-06 0) (0.198751 2.28517e-06 0) (0.198746 2.04639e-06 0) (0.19874 1.81983e-06 0) (0.198736 1.6299e-06 0) (0.198731 1.44165e-06 0) (0.198727 1.29381e-06 0) (0.198724 1.13809e-06 0) (0.198721 1.0249e-06 0) (0.198718 8.97853e-07 0) (0.198715 8.1229e-07 0) (0.198712 7.10474e-07 0) (0.19871 6.4733e-07 0) (0.198708 5.66791e-07 0) (0.198707 5.22267e-07 0) (0.198705 4.60102e-07 0) (0.198703 4.30051e-07 0) (0.198702 3.84981e-07 0) (0.198701 3.65981e-07 0) (0.198699 3.36029e-07 0) (0.198699 3.26391e-07 0) (0.198698 3.09978e-07 0) (0.198697 3.0725e-07 0) (0.198696 3.04726e-07 0) (0.198695 3.06444e-07 0) (0.198694 3.16348e-07 0) (0.198694 3.229e-07 0) (0.198693 3.30861e-07 0) (0.198693 3.5422e-07 0) (0.198692 4.09783e-07 0) (0.196121 0.00593566 0) (0.196415 0.0067603 0) (0.196961 0.00751468 0) (0.197752 0.00810217 0) (0.198682 0.00845078 0) (0.199645 0.00851096 0) (0.200554 0.00832651 0) (0.201326 0.00801727 0) (0.201936 0.00766217 0) (0.202427 0.00726469 0) (0.202816 0.00681525 0) (0.203074 0.0063397 0) (0.203211 0.00589309 0) (0.203291 0.00551513 0) (0.203357 0.00519488 0) (0.203408 0.0048912 0) (0.203443 0.00458195 0) (0.203466 0.00427779 0) (0.203478 0.00399293 0) (0.203479 0.00372316 0) (0.203473 0.00345508 0) (0.203456 0.00318226 0) (0.203422 0.00290648 0) (0.203368 0.00263105 0) (0.203296 0.00235819 0) (0.203206 0.00208949 0) (0.203094 0.00182671 0) (0.20296 0.00157344 0) (0.202806 0.00133531 0) (0.202634 0.00111746 0) (0.202449 0.000922398 0) (0.202255 0.000751124 0) (0.202058 0.000604257 0) (0.201866 0.000481855 0) (0.20168 0.000382479 0) (0.201505 0.000302865 0) (0.201342 0.000238775 0) (0.20119 0.000186237 0) (0.201048 0.000142429 0) (0.200917 0.000105901 0) (0.200797 7.62144e-05 0) (0.200687 5.33503e-05 0) (0.200588 3.71238e-05 0) (0.200499 2.68679e-05 0) (0.200421 2.1456e-05 0) (0.200353 1.95278e-05 0) (0.200293 1.97412e-05 0) (0.200239 2.09658e-05 0) (0.200192 2.23885e-05 0) (0.200149 2.35193e-05 0) (0.20011 2.41326e-05 0) (0.200074 2.4187e-05 0) (0.200042 2.37401e-05 0) (0.200011 2.29007e-05 0) (0.199983 2.17938e-05 0) (0.199957 2.05207e-05 0) (0.199933 1.91627e-05 0) (0.199911 1.77816e-05 0) (0.19989 1.64192e-05 0) (0.199871 1.51026e-05 0) (0.199854 1.38483e-05 0) (0.199838 1.26656e-05 0) (0.199823 1.15589e-05 0) (0.199809 1.05284e-05 0) (0.199796 9.57343e-06 0) (0.199785 8.69101e-06 0) (0.199774 7.87945e-06 0) (0.199765 7.13251e-06 0) (0.199756 6.45033e-06 0) (0.199748 5.82287e-06 0) (0.19974 5.25574e-06 0) (0.199733 4.73098e-06 0) (0.199727 4.26488e-06 0) (0.199722 3.82678e-06 0) (0.199716 3.44892e-06 0) (0.199712 3.08357e-06 0) (0.199707 2.78109e-06 0) (0.199704 2.47772e-06 0) (0.1997 2.23752e-06 0) (0.199697 1.98831e-06 0) (0.199694 1.79853e-06 0) (0.199691 1.5962e-06 0) (0.199689 1.44809e-06 0) (0.199687 1.28488e-06 0) (0.199685 1.17184e-06 0) (0.199683 1.04181e-06 0) (0.199681 9.56967e-07 0) (0.19968 8.56589e-07 0) (0.199679 7.94275e-07 0) (0.199677 7.19196e-07 0) (0.199676 6.76303e-07 0) (0.199675 6.23017e-07 0) (0.199674 5.95494e-07 0) (0.199673 5.63138e-07 0) (0.199673 5.4723e-07 0) (0.199672 5.33138e-07 0) (0.199671 5.2794e-07 0) (0.19967 5.20359e-07 0) (0.19967 5.3597e-07 0) (0.199669 5.72305e-07 0) (0.196596 0.00573391 0) (0.196874 0.00643001 0) (0.19735 0.00706231 0) (0.198023 0.00756201 0) (0.198802 0.00788959 0) (0.199618 0.00799613 0) (0.200425 0.00788455 0) (0.201137 0.00764436 0) (0.201704 0.00734957 0) (0.202166 0.00700683 0) (0.20255 0.00661658 0) (0.202823 0.0062057 0) (0.202982 0.00580886 0) (0.203085 0.00545371 0) (0.203171 0.00514272 0) (0.20324 0.00484919 0) (0.203291 0.00455223 0) (0.203329 0.00425957 0) (0.203354 0.00398334 0) (0.203367 0.00371858 0) (0.203374 0.00345479 0) (0.203372 0.00318911 0) (0.203354 0.00292288 0) (0.203317 0.00265698 0) (0.203265 0.00239335 0) (0.203196 0.00213489 0) (0.203108 0.00188343 0) (0.202999 0.00164107 0) (0.202871 0.00141227 0) (0.202727 0.00120184 0) (0.202571 0.00101214 0) (0.202406 0.000843766 0) (0.202237 0.000697122 0) (0.202068 0.000572512 0) (0.201904 0.000469096 0) (0.201747 0.000384345 0) (0.201598 0.000314738 0) (0.201459 0.000256801 0) (0.201328 0.000207909 0) (0.201206 0.000166552 0) (0.201092 0.00013212 0) (0.200986 0.000104457 0) (0.200889 8.33502e-05 0) (0.2008 6.82353e-05 0) (0.200719 5.81516e-05 0) (0.200647 5.19061e-05 0) (0.200583 4.82747e-05 0) (0.200525 4.61784e-05 0) (0.200474 4.47938e-05 0) (0.200428 4.35747e-05 0) (0.200386 4.22146e-05 0) (0.200348 4.05903e-05 0) (0.200314 3.86945e-05 0) (0.200282 3.65819e-05 0) (0.200253 3.4332e-05 0) (0.200226 3.20206e-05 0) (0.200201 2.97117e-05 0) (0.200178 2.74546e-05 0) (0.200156 2.52834e-05 0) (0.200137 2.32194e-05 0) (0.200119 2.12748e-05 0) (0.200102 1.94547e-05 0) (0.200087 1.776e-05 0) (0.200073 1.61879e-05 0) (0.20006 1.47348e-05 0) (0.200048 1.33941e-05 0) (0.200037 1.21619e-05 0) (0.200027 1.10286e-05 0) (0.200018 9.99293e-06 0) (0.20001 9.04047e-06 0) (0.200002 8.17749e-06 0) (0.199995 7.37991e-06 0) (0.199989 6.66769e-06 0) (0.199983 6.00088e-06 0) (0.199978 5.41942e-06 0) (0.199973 4.86268e-06 0) (0.199969 4.3925e-06 0) (0.199965 3.92971e-06 0) (0.199961 3.55162e-06 0) (0.199958 3.17052e-06 0) (0.199955 2.86753e-06 0) (0.199952 2.55662e-06 0) (0.19995 2.31619e-06 0) (0.199947 2.06356e-06 0) (0.199945 1.87613e-06 0) (0.199943 1.67254e-06 0) (0.199942 1.52827e-06 0) (0.19994 1.3677e-06 0) (0.199939 1.2585e-06 0) (0.199938 1.13416e-06 0) (0.199937 1.05525e-06 0) (0.199935 9.61617e-07 0) (0.199935 9.07145e-07 0) (0.199933 8.42062e-07 0) (0.199933 8.06953e-07 0) (0.199932 7.66465e-07 0) (0.199932 7.48515e-07 0) (0.199931 7.23745e-07 0) (0.19993 7.29343e-07 0) (0.199929 7.44626e-07 0) (0.197012 0.00553572 0) (0.197272 0.0061264 0) (0.197687 0.00666409 0) (0.198268 0.00709046 0) (0.198932 0.00738786 0) (0.199618 0.0075215 0) (0.200323 0.00746721 0) (0.200977 0.00728632 0) (0.201506 0.00704886 0) (0.201936 0.00675814 0) (0.202307 0.00641679 0) (0.202585 0.00606019 0) (0.202758 0.00571207 0) (0.202879 0.00538309 0) (0.202982 0.00508302 0) (0.203062 0.00480099 0) (0.203119 0.00451749 0) (0.203165 0.00423611 0) (0.203198 0.00396904 0) (0.203217 0.00371112 0) (0.203227 0.00345217 0) (0.20323 0.00319278 0) (0.203216 0.00293601 0) (0.203184 0.00268041 0) (0.203138 0.00242623 0) (0.203079 0.00217735 0) (0.203 0.00193627 0) (0.202902 0.00170401 0) (0.202787 0.00148375 0) (0.202659 0.00127995 0) (0.202519 0.00109501 0) (0.202371 0.00092937 0) (0.202217 0.000783356 0) (0.202064 0.000657427 0) (0.201913 0.00055106 0) (0.201767 0.000462196 0) (0.201629 0.00038788 0) (0.201498 0.000325157 0) (0.201375 0.000271692 0) (0.20126 0.000226025 0) (0.201151 0.000187443 0) (0.201049 0.000155634 0) (0.200955 0.000130297 0) (0.200867 0.000110885 0) (0.200788 9.65427e-05 0) (0.200715 8.62141e-05 0) (0.20065 7.88041e-05 0) (0.200592 7.33219e-05 0) (0.200539 6.89772e-05 0) (0.200492 6.52091e-05 0) (0.200449 6.16675e-05 0) (0.200411 5.81724e-05 0) (0.200375 5.46588e-05 0) (0.200343 5.11285e-05 0) (0.200313 4.76179e-05 0) (0.200286 4.41729e-05 0) (0.200261 4.08352e-05 0) (0.200237 3.76381e-05 0) (0.200216 3.46041e-05 0) (0.200196 3.17467e-05 0) (0.200178 2.90717e-05 0) (0.200161 2.6579e-05 0) (0.200146 2.42651e-05 0) (0.200132 2.21235e-05 0) (0.200119 2.01468e-05 0) (0.200107 1.83249e-05 0) (0.200096 1.66512e-05 0) (0.200086 1.51125e-05 0) (0.200077 1.37061e-05 0) (0.200069 1.24128e-05 0) (0.200061 1.12397e-05 0) (0.200054 1.01563e-05 0) (0.200048 9.18597e-06 0) (0.200042 8.27964e-06 0) (0.200037 7.4846e-06 0) (0.200032 6.72755e-06 0) (0.200027 6.08138e-06 0) (0.200023 5.45179e-06 0) (0.20002 4.92897e-06 0) (0.200016 4.40987e-06 0) (0.200013 3.98806e-06 0) (0.200011 3.56347e-06 0) (0.200008 3.22622e-06 0) (0.200006 2.87987e-06 0) (0.200004 2.6145e-06 0) (0.200002 2.33367e-06 0) (0.2 2.12723e-06 0) (0.199999 1.90334e-06 0) (0.199997 1.74514e-06 0) (0.199996 1.56893e-06 0) (0.199995 1.45233e-06 0) (0.199994 1.31624e-06 0) (0.199993 1.23352e-06 0) (0.199992 1.13403e-06 0) (0.199992 1.07873e-06 0) (0.19999 1.01054e-06 0) (0.19999 9.79289e-07 0) (0.199989 9.35359e-07 0) (0.199989 9.30893e-07 0) (0.199988 9.25342e-07 0) (0.197379 0.00534359 0) (0.197622 0.00584781 0) (0.197982 0.00631031 0) (0.198486 0.00667771 0) (0.199061 0.00694127 0) (0.199642 0.00708731 0) (0.200247 0.00707913 0) (0.200843 0.00694641 0) (0.201335 0.00675679 0) (0.201731 0.00651669 0) (0.202084 0.00622046 0) (0.202365 0.00590746 0) (0.202545 0.00560337 0) (0.202677 0.00530369 0) (0.202796 0.00501612 0) (0.202884 0.004746 0) (0.202944 0.00447809 0) (0.202996 0.00420878 0) (0.203037 0.00395027 0) (0.203059 0.00370051 0) (0.203071 0.00344843 0) (0.203077 0.00319563 0) (0.203067 0.00294814 0) (0.203037 0.00270348 0) (0.202994 0.00245878 0) (0.202941 0.00221804 0) (0.20287 0.00198569 0) (0.202778 0.00176263 0) (0.202673 0.00155042 0) (0.202556 0.00135282 0) (0.202429 0.00117252 0) (0.202293 0.00101003 0) (0.202152 0.000865413 0) (0.20201 0.000738997 0) (0.20187 0.00063046 0) (0.201734 0.000538166 0) (0.201603 0.000459672 0) (0.20148 0.000392512 0) (0.201363 0.000334703 0) (0.201252 0.00028492 0) (0.201149 0.000242408 0) (0.201051 0.000206729 0) (0.20096 0.000177477 0) (0.200875 0.000154084 0) (0.200797 0.000135757 0) (0.200726 0.000121545 0) (0.200661 0.00011047 0) (0.200603 0.000101634 0) (0.20055 9.42932e-05 0) (0.200503 8.7897e-05 0) (0.20046 8.2073e-05 0) (0.200421 7.65995e-05 0) (0.200385 7.13635e-05 0) (0.200353 6.63211e-05 0) (0.200323 6.1469e-05 0) (0.200296 5.68218e-05 0) (0.200271 5.23977e-05 0) (0.200247 4.82119e-05 0) (0.200226 4.4274e-05 0) (0.200206 4.05878e-05 0) (0.200188 3.71516e-05 0) (0.200172 3.39592e-05 0) (0.200156 3.10022e-05 0) (0.200142 2.82693e-05 0) (0.20013 2.57496e-05 0) (0.200118 2.34289e-05 0) (0.200107 2.12978e-05 0) (0.200097 1.93392e-05 0) (0.200088 1.75487e-05 0) (0.200079 1.59027e-05 0) (0.200072 1.44084e-05 0) (0.200065 1.30292e-05 0) (0.200059 1.17917e-05 0) (0.200053 1.06376e-05 0) (0.200047 9.62139e-06 0) (0.200043 8.65724e-06 0) (0.200038 7.82879e-06 0) (0.200034 7.02678e-06 0) (0.200031 6.35407e-06 0) (0.200027 5.69229e-06 0) (0.200024 5.14748e-06 0) (0.200022 4.60528e-06 0) (0.200019 4.16788e-06 0) (0.200017 3.72448e-06 0) (0.200015 3.37856e-06 0) (0.200013 3.01765e-06 0) (0.200011 2.74705e-06 0) (0.20001 2.45746e-06 0) (0.200009 2.24869e-06 0) (0.200007 2.01867e-06 0) (0.200006 1.86312e-06 0) (0.200005 1.68307e-06 0) (0.200004 1.57108e-06 0) (0.200003 1.436e-06 0) (0.200003 1.35975e-06 0) (0.200002 1.26296e-06 0) (0.200001 1.21798e-06 0) (0.2 1.15322e-06 0) (0.2 1.13928e-06 0) (0.199999 1.1135e-06 0) (0.197703 0.00515908 0) (0.19793 0.00559106 0) (0.198242 0.00599242 0) (0.198679 0.00631482 0) (0.199184 0.00654521 0) (0.199681 0.00669114 0) (0.200196 0.00671952 0) (0.200731 0.00662627 0) (0.201189 0.00647292 0) (0.201551 0.00628013 0) (0.201881 0.00602943 0) (0.202161 0.00575177 0) (0.202347 0.00548377 0) (0.202483 0.00521509 0) (0.202611 0.00494308 0) (0.202709 0.00468492 0) (0.202771 0.00443412 0) (0.202827 0.00417835 0) (0.202875 0.00392727 0) (0.202901 0.00368591 0) (0.202913 0.00344358 0) (0.202922 0.0031986 0) (0.202916 0.00295898 0) (0.202888 0.00272399 0) (0.202848 0.00248839 0) (0.202799 0.00225523 0) (0.202735 0.00203106 0) (0.20265 0.00181737 0) (0.202553 0.0016138 0) (0.202446 0.00142275 0) (0.20233 0.00124715 0) (0.202205 0.00108784 0) (0.202075 0.000944671 0) (0.201944 0.000817895 0) (0.201814 0.000707451 0) (0.201687 0.000612139 0) (0.201564 0.000529932 0) (0.201446 0.000458759 0) (0.201335 0.000396945 0) (0.20123 0.000343307 0) (0.20113 0.000297074 0) (0.201037 0.000257714 0) (0.200949 0.000224743 0) (0.200867 0.000197571 0) (0.200791 0.000175448 0) (0.200722 0.000157514 0) (0.200658 0.000142889 0) (0.200601 0.000130759 0) (0.200549 0.000120437 0) (0.200502 0.000111388 0) (0.200459 0.00010323 0) (0.20042 9.57131e-05 0) (0.200385 8.86848e-05 0) (0.200352 8.20625e-05 0) (0.200322 7.58069e-05 0) (0.200295 6.99026e-05 0) (0.20027 6.4344e-05 0) (0.200247 5.91281e-05 0) (0.200226 5.42508e-05 0) (0.200206 4.97048e-05 0) (0.200189 4.54802e-05 0) (0.200172 4.15643e-05 0) (0.200157 3.79428e-05 0) (0.200143 3.45996e-05 0) (0.20013 3.15197e-05 0) (0.200118 2.86847e-05 0) (0.200108 2.60822e-05 0) (0.200098 2.36908e-05 0) (0.200089 2.15046e-05 0) (0.200081 1.94954e-05 0) (0.200073 1.76703e-05 0) (0.200066 1.59866e-05 0) (0.20006 1.44738e-05 0) (0.200054 1.30648e-05 0) (0.200049 1.18207e-05 0) (0.200044 1.06435e-05 0) (0.20004 9.62728e-06 0) (0.200036 8.64793e-06 0) (0.200032 7.82082e-06 0) (0.200029 7.01223e-06 0) (0.200026 6.34082e-06 0) (0.200023 5.67752e-06 0) (0.200021 5.1371e-06 0) (0.200018 4.5937e-06 0) (0.200017 4.165e-06 0) (0.200015 3.72154e-06 0) (0.200013 3.38503e-06 0) (0.200011 3.02768e-06 0) (0.20001 2.76695e-06 0) (0.200009 2.4815e-06 0) (0.200008 2.28584e-06 0) (0.200007 2.06055e-06 0) (0.200006 1.91841e-06 0) (0.200005 1.74675e-06 0) (0.200004 1.6489e-06 0) (0.200003 1.5227e-06 0) (0.200003 1.46366e-06 0) (0.200002 1.37675e-06 0) (0.200002 1.3539e-06 0) (0.200001 1.30833e-06 0) (0.197988 0.00498274 0) (0.198201 0.0053552 0) (0.198475 0.00570533 0) (0.19885 0.00599171 0) (0.199295 0.00619385 0) (0.19973 0.00633136 0) (0.200166 0.00638526 0) (0.200636 0.00632646 0) (0.201063 0.00620154 0) (0.201396 0.00604848 0) (0.201696 0.00584247 0) (0.20197 0.00559604 0) (0.202162 0.00535612 0) (0.202297 0.00511851 0) (0.202428 0.00486653 0) (0.202536 0.00461968 0) (0.202602 0.00438451 0) (0.202657 0.00414398 0) (0.202711 0.00390118 0) (0.202743 0.00366802 0) (0.202755 0.00343675 0) (0.202766 0.00320018 0) (0.202764 0.00296664 0) (0.202739 0.00274028 0) (0.2027 0.00251525 0) (0.202657 0.00229142 0) (0.2026 0.00207567 0) (0.202523 0.00187082 0) (0.202433 0.00167535 0) (0.202335 0.00149016 0) (0.202229 0.00131841 0) (0.202115 0.00116173 0) (0.201995 0.00102003 0) (0.201873 0.000893312 0) (0.201753 0.000781558 0) (0.201634 0.000683885 0) (0.201518 0.000598595 0) (0.201408 0.000523929 0) (0.201302 0.000458481 0) (0.201202 0.000401227 0) (0.201106 0.00035143 0) (0.201017 0.000308521 0) (0.200932 0.000271969 0) (0.200853 0.00024117 0) (0.20078 0.000215408 0) (0.200713 0.000193897 0) (0.200651 0.000175839 0) (0.200595 0.000160495 0) (0.200543 0.00014723 0) (0.200497 0.000135533 0) (0.200454 0.00012502 0) (0.200416 0.000115419 0) (0.200381 0.000106549 0) (0.200349 9.82949e-05 0) (0.200319 9.05855e-05 0) (0.200292 8.33775e-05 0) (0.200267 7.66427e-05 0) (0.200245 7.03599e-05 0) (0.200224 6.45106e-05 0) (0.200204 5.90765e-05 0) (0.200187 5.40386e-05 0) (0.20017 4.93769e-05 0) (0.200155 4.50712e-05 0) (0.200142 4.11001e-05 0) (0.200129 3.7444e-05 0) (0.200117 3.40804e-05 0) (0.200107 3.09933e-05 0) (0.200097 2.81575e-05 0) (0.200088 2.55649e-05 0) (0.20008 2.31826e-05 0) (0.200072 2.10178e-05 0) (0.200066 1.90214e-05 0) (0.200059 1.72261e-05 0) (0.200054 1.55555e-05 0) (0.200048 1.40774e-05 0) (0.200044 1.26817e-05 0) (0.200039 1.14726e-05 0) (0.200036 1.03114e-05 0) (0.200032 9.32577e-06 0) (0.200029 8.36654e-06 0) (0.200026 7.56524e-06 0) (0.200023 6.77761e-06 0) (0.200021 6.13157e-06 0) (0.200019 5.48547e-06 0) (0.200017 4.97194e-06 0) (0.200015 4.44367e-06 0) (0.200013 4.03961e-06 0) (0.200012 3.61268e-06 0) (0.20001 3.29865e-06 0) (0.200009 2.95631e-06 0) (0.200008 2.71949e-06 0) (0.200007 2.44781e-06 0) (0.200006 2.27471e-06 0) (0.200005 2.06553e-06 0) (0.200005 1.94551e-06 0) (0.200004 1.78915e-06 0) (0.200003 1.71574e-06 0) (0.200002 1.60563e-06 0) (0.200002 1.57428e-06 0) (0.200001 1.50914e-06 0) (0.198241 0.0048162 0) (0.198442 0.00513893 0) (0.198684 0.00544367 0) (0.199004 0.00570022 0) (0.199394 0.00588257 0) (0.199781 0.0060067 0) (0.200152 0.00607344 0) (0.200558 0.00604699 0) (0.200953 0.00594747 0) (0.201261 0.00582237 0) (0.201529 0.00565677 0) (0.201791 0.00544314 0) (0.201989 0.00522615 0) (0.202123 0.00501534 0) (0.20225 0.00478611 0) (0.202365 0.00455125 0) (0.202436 0.00432953 0) (0.20249 0.00410575 0) (0.202548 0.00387327 0) (0.202585 0.00364681 0) (0.202598 0.00342566 0) (0.202608 0.00319936 0) (0.202611 0.00297342 0) (0.202591 0.00275605 0) (0.202555 0.00254231 0) (0.202515 0.002328 0) (0.202464 0.0021191 0) (0.202395 0.00192089 0) (0.202312 0.00173236 0) (0.202222 0.00155289 0) (0.202126 0.00138522 0) (0.202021 0.00123154 0) (0.201911 0.00109187 0) (0.201799 0.000965792 0) (0.201688 0.000853227 0) (0.201577 0.000753618 0) (0.201469 0.000665653 0) (0.201365 0.000587866 0) (0.201265 0.000519086 0) (0.20117 0.000458446 0) (0.201079 0.000405269 0) (0.200993 0.000358971 0) (0.200912 0.000318991 0) (0.200836 0.000284719 0) (0.200766 0.000255474 0) (0.200701 0.000230528 0) (0.200641 0.000209158 0) (0.200586 0.00019069 0) (0.200536 0.000174537 0) (0.20049 0.000160215 0) (0.200448 0.000147342 0) (0.20041 0.000135635 0) (0.200376 0.000124891 0) (0.200344 0.000114966 0) (0.200315 0.000105762 0) (0.200288 9.72107e-05 0) (0.200264 8.92634e-05 0) (0.200241 8.1881e-05 0) (0.20022 7.50306e-05 0) (0.200201 6.86824e-05 0) (0.200184 6.28082e-05 0) (0.200168 5.73804e-05 0) (0.200153 5.23723e-05 0) (0.200139 4.77568e-05 0) (0.200127 4.35099e-05 0) (0.200116 3.96043e-05 0) (0.200105 3.60207e-05 0) (0.200095 3.27294e-05 0) (0.200087 2.97205e-05 0) (0.200079 2.69562e-05 0) (0.200071 2.44436e-05 0) (0.200065 2.21272e-05 0) (0.200058 2.00425e-05 0) (0.200053 1.81041e-05 0) (0.200048 1.63866e-05 0) (0.200043 1.47672e-05 0) (0.200039 1.33608e-05 0) (0.200035 1.20134e-05 0) (0.200032 1.08656e-05 0) (0.200028 9.75217e-06 0) (0.200026 8.818e-06 0) (0.200023 7.90308e-06 0) (0.200021 7.14906e-06 0) (0.200018 6.39778e-06 0) (0.200016 5.79753e-06 0) (0.200015 5.18242e-06 0) (0.200013 4.70929e-06 0) (0.200011 4.21114e-06 0) (0.20001 3.84256e-06 0) (0.200009 3.44206e-06 0) (0.200008 3.16307e-06 0) (0.200007 2.84395e-06 0) (0.200006 2.63917e-06 0) (0.200005 2.3916e-06 0) (0.200005 2.24892e-06 0) (0.200004 2.0617e-06 0) (0.200003 1.97364e-06 0) (0.200002 1.83949e-06 0) (0.200002 1.79991e-06 0) (0.200001 1.71525e-06 0) (0.198464 0.00465935 0) (0.198653 0.00493954 0) (0.19887 0.00520537 0) (0.199144 0.00543639 0) (0.199483 0.00560411 0) (0.199829 0.00571457 0) (0.200151 0.00578541 0) (0.200497 0.00578667 0) (0.200854 0.0057104 0) (0.201143 0.00560426 0) (0.201383 0.00547367 0) (0.201625 0.0052948 0) (0.201826 0.00509661 0) (0.201958 0.00490584 0) (0.202079 0.00470169 0) (0.202197 0.00448245 0) (0.202275 0.00427131 0) (0.202327 0.00406237 0) (0.202383 0.00384223 0) (0.202426 0.00362317 0) (0.202442 0.00341238 0) (0.202452 0.00319888 0) (0.202458 0.0029819 0) (0.202444 0.00277129 0) (0.202411 0.00256613 0) (0.202373 0.00236056 0) (0.202328 0.00215841 0) (0.202266 0.00196663 0) (0.202191 0.00178533 0) (0.202108 0.00161238 0) (0.202021 0.00144924 0) (0.201926 0.00129852 0) (0.201825 0.00116071 0) (0.201722 0.0010353 0) (0.201619 0.000922127 0) (0.201517 0.0008209 0) (0.201416 0.000730664 0) (0.201318 0.000650185 0) (0.201224 0.000578455 0) (0.201134 0.000514732 0) (0.201048 0.000458406 0) (0.200966 0.000408904 0) (0.200889 0.000365657 0) (0.200817 0.000328068 0) (0.200749 0.000295491 0) (0.200686 0.000267253 0) (0.200628 0.000242694 0) (0.200575 0.0002212 0) (0.200526 0.000202227 0) (0.200482 0.000185317 0) (0.200441 0.000170098 0) (0.200404 0.000156279 0) (0.200369 0.00014364 0) (0.200338 0.000132016 0) (0.20031 0.000121286 0) (0.200283 0.000111361 0) (0.200259 0.000102171 0) (0.200237 9.36603e-05 0) (0.200217 8.57832e-05 0) (0.200198 7.8498e-05 0) (0.200181 7.1767e-05 0) (0.200165 6.55547e-05 0) (0.20015 5.98277e-05 0) (0.200137 5.45532e-05 0) (0.200125 4.97022e-05 0) (0.200113 4.52426e-05 0) (0.200103 4.11517e-05 0) (0.200094 3.73953e-05 0) (0.200085 3.39612e-05 0) (0.200077 3.08069e-05 0) (0.20007 2.7939e-05 0) (0.200063 2.5296e-05 0) (0.200057 2.29158e-05 0) (0.200052 2.07043e-05 0) (0.200047 1.87422e-05 0) (0.200042 1.68947e-05 0) (0.200038 1.52868e-05 0) (0.200034 1.37496e-05 0) (0.200031 1.24363e-05 0) (0.200028 1.11655e-05 0) (0.200025 1.00959e-05 0) (0.200022 9.05102e-06 0) (0.20002 8.18691e-06 0) (0.200018 7.32828e-06 0) (0.200016 6.6396e-06 0) (0.200014 5.93589e-06 0) (0.200013 5.39229e-06 0) (0.200011 4.82153e-06 0) (0.20001 4.39726e-06 0) (0.200009 3.93746e-06 0) (0.200008 3.61543e-06 0) (0.200007 3.24794e-06 0) (0.200006 3.01085e-06 0) (0.200005 2.7241e-06 0) (0.200005 2.55835e-06 0) (0.200004 2.33963e-06 0) (0.200003 2.23668e-06 0) (0.200002 2.07782e-06 0) (0.200002 2.03017e-06 0) (0.200001 1.92591e-06 0) (0.198661 0.00451147 0) (0.198839 0.00475616 0) (0.199035 0.00498919 0) (0.199272 0.00519586 0) (0.199563 0.00535186 0) (0.199872 0.00545381 0) (0.200158 0.0055225 0) (0.20045 0.0055417 0) (0.200765 0.00548912 0) (0.201038 0.00540007 0) (0.201256 0.00529523 0) (0.201472 0.00514767 0) (0.201668 0.00496896 0) (0.201804 0.00479533 0) (0.201917 0.00461505 0) (0.202032 0.00441252 0) (0.202116 0.00420968 0) (0.202167 0.00401424 0) (0.202221 0.00381024 0) (0.202269 0.0036011 0) (0.20229 0.00339859 0) (0.202298 0.00319579 0) (0.202305 0.00298715 0) (0.202296 0.00278212 0) (0.202266 0.00258493 0) (0.202231 0.00238959 0) (0.202192 0.00219604 0) (0.202138 0.00201087 0) (0.20207 0.001836 0) (0.201994 0.00166898 0) (0.201915 0.00151004 0) (0.201829 0.00136193 0) (0.201737 0.00122586 0) (0.201642 0.00110137 0) (0.201547 0.000988032 0) (0.201453 0.00088566 0) (0.201359 0.000793589 0) (0.201268 0.000710815 0) (0.20118 0.000636469 0) (0.201095 0.000569927 0) (0.201014 0.000510657 0) (0.200936 0.000458125 0) (0.200863 0.000411777 0) (0.200794 0.000371031 0) (0.200729 0.000335279 0) (0.200669 0.000303898 0) (0.200613 0.000276283 0) (0.200562 0.00025187 0) (0.200515 0.000230159 0) (0.200471 0.000210715 0) (0.200432 0.000193178 0) (0.200395 0.000177255 0) (0.200362 0.000162715 0) (0.200331 0.000149376 0) (0.200303 0.0001371 0) (0.200277 0.000125777 0) (0.200254 0.00011532 0) (0.200232 0.00010566 0) (0.200212 9.67346e-05 0) (0.200194 8.8493e-05 0) (0.200177 8.08877e-05 0) (0.200161 7.38751e-05 0) (0.200147 6.74152e-05 0) (0.200134 6.1469e-05 0) (0.200122 5.60024e-05 0) (0.200111 5.09786e-05 0) (0.200101 4.6371e-05 0) (0.200092 4.2141e-05 0) (0.200083 3.82741e-05 0) (0.200076 3.47228e-05 0) (0.200069 3.14935e-05 0) (0.200062 2.85182e-05 0) (0.200056 2.58374e-05 0) (0.200051 2.3348e-05 0) (0.200046 2.11372e-05 0) (0.200041 1.90578e-05 0) (0.200037 1.72449e-05 0) (0.200034 1.55146e-05 0) (0.20003 1.4033e-05 0) (0.200027 1.26023e-05 0) (0.200025 1.13949e-05 0) (0.200022 1.02179e-05 0) (0.20002 9.24189e-06 0) (0.200018 8.27409e-06 0) (0.200016 7.49553e-06 0) (0.200014 6.70175e-06 0) (0.200013 6.08649e-06 0) (0.200011 5.44192e-06 0) (0.20001 4.96102e-06 0) (0.200009 4.44096e-06 0) (0.200008 4.07516e-06 0) (0.200007 3.65848e-06 0) (0.200006 3.3886e-06 0) (0.200005 3.06199e-06 0) (0.200004 2.87282e-06 0) (0.200003 2.62207e-06 0) (0.200003 2.50402e-06 0) (0.200002 2.31993e-06 0) (0.200002 2.26434e-06 0) (0.200001 2.14031e-06 0) (0.198836 0.0043723 0) (0.199002 0.00458746 0) (0.199181 0.00479209 0) (0.199387 0.00497657 0) (0.199636 0.00512291 0) (0.199909 0.0052198 0) (0.200165 0.00528296 0) (0.200415 0.00531279 0) (0.200689 0.00528405 0) (0.200942 0.00521048 0) (0.201142 0.0051213 0) (0.201333 0.00500202 0) (0.20152 0.00484736 0) (0.201658 0.0046875 0) (0.201763 0.00452422 0) (0.20187 0.00433984 0) (0.201958 0.00414908 0) (0.202014 0.00396663 0) (0.202064 0.00377771 0) (0.202112 0.00357743 0) (0.202136 0.00338017 0) (0.202144 0.00318673 0) (0.202151 0.00298906 0) (0.202148 0.0027922 0) (0.202124 0.00260305 0) (0.202091 0.00241735 0) (0.202056 0.002232 0) (0.202009 0.00205239 0) (0.201948 0.00188261 0) (0.201879 0.00172102 0) (0.201807 0.00156659 0) (0.20173 0.0014215 0) (0.201646 0.00128744 0) (0.20156 0.00116416 0) (0.201473 0.00105104 0) (0.201386 0.000947891 0) (0.201299 0.000854318 0) (0.201214 0.000769575 0) (0.201132 0.000692923 0) (0.201052 0.000623829 0) (0.200976 0.000561841 0) (0.200903 0.000506473 0) (0.200834 0.000457198 0) (0.200768 0.00041346 0) (0.200707 0.00037469 0) (0.200649 0.000340313 0) (0.200596 0.000309773 0) (0.200547 0.000282554 0) (0.200501 0.000258191 0) (0.200459 0.000236277 0) (0.200421 0.000216463 0) (0.200385 0.000198458 0) (0.200353 0.000182023 0) (0.200323 0.000166967 0) (0.200296 0.000153134 0) (0.20027 0.000140398 0) (0.200247 0.000128659 0) (0.200226 0.000117832 0) (0.200207 0.000107843 0) (0.200189 9.863e-05 0) (0.200172 9.01368e-05 0) (0.200157 8.23115e-05 0) (0.200143 7.51073e-05 0) (0.200131 6.84792e-05 0) (0.200119 6.23879e-05 0) (0.200108 5.67916e-05 0) (0.200098 5.16599e-05 0) (0.200089 4.69496e-05 0) (0.200081 4.26437e-05 0) (0.200074 3.869e-05 0) (0.200067 3.50942e-05 0) (0.20006 3.17822e-05 0) (0.200055 2.87967e-05 0) (0.200049 2.60258e-05 0) (0.200045 2.35628e-05 0) (0.20004 2.12484e-05 0) (0.200036 1.9228e-05 0) (0.200033 1.7302e-05 0) (0.20003 1.56499e-05 0) (0.200027 1.40571e-05 0) (0.200024 1.27102e-05 0) (0.200021 1.13994e-05 0) (0.200019 1.03101e-05 0) (0.200017 9.23173e-06 0) (0.200015 8.36214e-06 0) (0.200014 7.47717e-06 0) (0.200012 6.7893e-06 0) (0.200011 6.07003e-06 0) (0.20001 5.53175e-06 0) (0.200008 4.95067e-06 0) (0.200008 4.54058e-06 0) (0.200006 4.07406e-06 0) (0.200006 3.771e-06 0) (0.200005 3.40401e-06 0) (0.200004 3.19117e-06 0) (0.200003 2.90797e-06 0) (0.200003 2.77467e-06 0) (0.200002 2.56495e-06 0) (0.200002 2.50151e-06 0) (0.200001 2.35755e-06 0) (0.198993 0.00424096 0) (0.199146 0.00443173 0) (0.199309 0.00461245 0) (0.199491 0.0047775 0) (0.199704 0.00491354 0) (0.199941 0.00500715 0) (0.200172 0.00506686 0) (0.20039 0.00510176 0) (0.200623 0.00509128 0) (0.200852 0.00503316 0) (0.20104 0.00495686 0) (0.201209 0.00486107 0) (0.20138 0.0047292 0) (0.201516 0.00458094 0) (0.201616 0.00443237 0) (0.201716 0.00426921 0) (0.201806 0.00409228 0) (0.201864 0.00391733 0) (0.201908 0.00373902 0) (0.201954 0.00354966 0) (0.201983 0.0033607 0) (0.201994 0.00317768 0) (0.202001 0.00299189 0) (0.202001 0.00280319 0) (0.201983 0.00261975 0) (0.201952 0.00244135 0) (0.20192 0.00226384 0) (0.201879 0.00209025 0) (0.201826 0.00192553 0) (0.201764 0.00176924 0) (0.201698 0.00161953 0) (0.201629 0.00147761 0) (0.201554 0.00134549 0) (0.201475 0.00122341 0) (0.201395 0.00111071 0) (0.201315 0.0010071 0) (0.201236 0.000912382 0) (0.201157 0.00082603 0) (0.201081 0.000747423 0) (0.201006 0.000676094 0) (0.200935 0.000611657 0) (0.200866 0.000553686 0) (0.200801 0.000501691 0) (0.200739 0.000455153 0) (0.200681 0.000413542 0) (0.200627 0.00037633 0) (0.200576 0.000343009 0) (0.200529 0.000313104 0) (0.200485 0.000286188 0) (0.200445 0.000261876 0) (0.200408 0.000239836 0) (0.200374 0.000219782 0) (0.200342 0.000201471 0) (0.200313 0.000184704 0) (0.200287 0.000169312 0) (0.200262 0.000155158 0) (0.20024 0.000142128 0) (0.200219 0.000130123 0) (0.200201 0.00011906 0) (0.200183 0.000108866 0) (0.200167 9.94748e-05 0) (0.200153 9.08281e-05 0) (0.200139 8.28717e-05 0) (0.200127 7.55544e-05 0) (0.200115 6.88319e-05 0) (0.200105 6.26573e-05 0) (0.200095 5.69961e-05 0) (0.200087 5.18008e-05 0) (0.200079 4.70517e-05 0) (0.200071 4.26916e-05 0) (0.200065 3.87259e-05 0) (0.200059 3.5074e-05 0) (0.200053 3.1781e-05 0) (0.200048 2.8726e-05 0) (0.200043 2.60088e-05 0) (0.200039 2.34572e-05 0) (0.200035 2.12273e-05 0) (0.200032 1.9104e-05 0) (0.200029 1.72801e-05 0) (0.200026 1.55238e-05 0) (0.200023 1.40363e-05 0) (0.200021 1.25904e-05 0) (0.200019 1.13869e-05 0) (0.200017 1.01971e-05 0) (0.200015 9.23568e-06 0) (0.200013 8.25878e-06 0) (0.200012 7.49769e-06 0) (0.20001 6.70311e-06 0) (0.200009 6.10699e-06 0) (0.200008 5.46437e-06 0) (0.200007 5.00966e-06 0) (0.200006 4.49286e-06 0) (0.200006 4.15641e-06 0) (0.200005 3.74868e-06 0) (0.200004 3.51201e-06 0) (0.200003 3.19607e-06 0) (0.200003 3.04746e-06 0) (0.200002 2.81182e-06 0) (0.200002 2.74063e-06 0) (0.200001 2.57661e-06 0) (0.199133 0.00411728 0) (0.199271 0.00428851 0) (0.199421 0.00444926 0) (0.199582 0.00459675 0) (0.199765 0.00472208 0) (0.19997 0.00481372 0) (0.200176 0.00487202 0) (0.200369 0.00490699 0) (0.200567 0.00490913 0) (0.200771 0.00486851 0) (0.200946 0.00480381 0) (0.201097 0.00472304 0) (0.201248 0.00461179 0) (0.20138 0.00447918 0) (0.20148 0.00434428 0) (0.20157 0.0041979 0) (0.201654 0.00403283 0) (0.201714 0.00386467 0) (0.201757 0.00369805 0) (0.201801 0.0035235 0) (0.201834 0.00334459 0) (0.201846 0.00316908 0) (0.201852 0.00299229 0) (0.201853 0.00281146 0) (0.20184 0.00263382 0) (0.201814 0.0024624 0) (0.201784 0.0022932 0) (0.201749 0.00212638 0) (0.201703 0.00196651 0) (0.201648 0.00181471 0) (0.201588 0.00166925 0) (0.201526 0.00153042 0) (0.201458 0.0014002 0) (0.201387 0.0012793 0) (0.201315 0.00116716 0) (0.201242 0.00106336 0) (0.201169 0.000967772 0) (0.201097 0.000880067 0) (0.201026 0.000799758 0) (0.200957 0.000726439 0) (0.200891 0.000659784 0) (0.200827 0.000599424 0) (0.200766 0.000544916 0) (0.200708 0.000495777 0) (0.200653 0.000451518 0) (0.200602 0.000411653 0) (0.200553 0.000375716 0) (0.200509 0.000343271 0) (0.200467 0.000313923 0) (0.200429 0.000287313 0) (0.200393 0.000263123 0) (0.20036 0.000241074 0) (0.20033 0.000220924 0) (0.200302 0.000202469 0) (0.200277 0.000185533 0) (0.200253 0.000169968 0) (0.200232 0.000155647 0) (0.200212 0.000142464 0) (0.200194 0.000130324 0) (0.200177 0.000119145 0) (0.200161 0.000108853 0) (0.200147 9.93804e-05 0) (0.200134 9.06679e-05 0) (0.200122 8.2658e-05 0) (0.200111 7.53011e-05 0) (0.200101 6.85452e-05 0) (0.200092 6.2352e-05 0) (0.200084 5.66694e-05 0) (0.200076 5.1475e-05 0) (0.200069 4.67069e-05 0) (0.200062 4.23697e-05 0) (0.200057 3.83765e-05 0) (0.200051 3.47747e-05 0) (0.200046 3.14347e-05 0) (0.200042 2.84621e-05 0) (0.200038 2.56726e-05 0) (0.200034 2.32325e-05 0) (0.200031 2.09112e-05 0) (0.200028 1.89148e-05 0) (0.200025 1.69945e-05 0) (0.200022 1.53659e-05 0) (0.20002 1.37846e-05 0) (0.200018 1.24666e-05 0) (0.200016 1.11649e-05 0) (0.200014 1.01114e-05 0) (0.200013 9.04235e-06 0) (0.200011 8.20783e-06 0) (0.20001 7.33771e-06 0) (0.200009 6.68363e-06 0) (0.200008 5.97926e-06 0) (0.200007 5.47987e-06 0) (0.200006 4.91259e-06 0) (0.200005 4.54273e-06 0) (0.200004 4.0941e-06 0) (0.200004 3.83361e-06 0) (0.200003 3.48481e-06 0) (0.200003 3.32091e-06 0) (0.200002 3.05925e-06 0) (0.200002 2.98036e-06 0) (0.200001 2.79629e-06 0) (0.199259 0.00400289 0) (0.199382 0.00415823 0) (0.199518 0.00430239 0) (0.199662 0.00443483 0) (0.19982 0.00454974 0) (0.199996 0.00463797 0) (0.200177 0.00469556 0) (0.200349 0.00473007 0) (0.20052 0.0047401 0) (0.200697 0.00471392 0) (0.200857 0.00465928 0) (0.200994 0.00458973 0) (0.201127 0.00449789 0) (0.201252 0.00438164 0) (0.201348 0.00425548 0) (0.201428 0.00412054 0) (0.201506 0.00397047 0) (0.201568 0.00381443 0) (0.201612 0.00365899 0) (0.201652 0.00349624 0) (0.201684 0.00332558 0) (0.201699 0.00315602 0) (0.201704 0.00298786 0) (0.201707 0.00281691 0) (0.201699 0.00264682 0) (0.201677 0.00248192 0) (0.20165 0.00232002 0) (0.201619 0.00215981 0) (0.201579 0.00200471 0) (0.20153 0.00185698 0) (0.201477 0.00171557 0) (0.201421 0.00158008 0) (0.201361 0.00145203 0) (0.201297 0.00133241 0) (0.201231 0.00122095 0) (0.201165 0.00111717 0) (0.201099 0.00102093 0) (0.201033 0.00093208 0) (0.200968 0.000850262 0) (0.200904 0.000775142 0) (0.200843 0.000706443 0) (0.200784 0.000643853 0) (0.200727 0.00058698 0) (0.200673 0.000535385 0) (0.200622 0.000488617 0) (0.200574 0.000446233 0) (0.200528 0.000407807 0) (0.200486 0.000372939 0) (0.200447 0.000341262 0) (0.20041 0.000312441 0) (0.200376 0.000286172 0) (0.200345 0.000262186 0) (0.200316 0.000240242 0) (0.20029 0.000220132 0) (0.200265 0.000201675 0) (0.200243 0.000184716 0) (0.200222 0.000169119 0) (0.200203 0.000154766 0) (0.200186 0.000141556 0) (0.200169 0.000129396 0) (0.200155 0.000118205 0) (0.200141 0.00010791 0) (0.200129 9.84438e-05 0) (0.200117 8.97429e-05 0) (0.200107 8.1753e-05 0) (0.200097 7.44172e-05 0) (0.200088 6.76932e-05 0) (0.20008 6.15243e-05 0) (0.200073 5.58857e-05 0) (0.200066 5.07104e-05 0) (0.20006 4.60025e-05 0) (0.200054 4.16688e-05 0) (0.200049 3.77591e-05 0) (0.200044 3.41346e-05 0) (0.20004 3.09073e-05 0) (0.200036 2.78806e-05 0) (0.200033 2.52309e-05 0) (0.200029 2.27122e-05 0) (0.200026 2.05438e-05 0) (0.200024 1.846e-05 0) (0.200021 1.66908e-05 0) (0.200019 1.49745e-05 0) (0.200017 1.35422e-05 0) (0.200015 1.21291e-05 0) (0.200014 1.09839e-05 0) (0.200012 9.82291e-06 0) (0.200011 8.91521e-06 0) (0.20001 7.96981e-06 0) (0.200009 7.25798e-06 0) (0.200007 6.49205e-06 0) (0.200007 5.94818e-06 0) (0.200006 5.33057e-06 0) (0.200005 4.92744e-06 0) (0.200004 4.43805e-06 0) (0.200004 4.15385e-06 0) (0.200003 3.77228e-06 0) (0.200003 3.5932e-06 0) (0.200002 3.30558e-06 0) (0.200002 3.21911e-06 0) (0.200001 3.01501e-06 0) (0.199394 0.00388128 0) (0.199498 0.00402106 0) (0.199617 0.00414994 0) (0.199742 0.00426793 0) (0.199876 0.00437129 0) (0.200022 0.0044539 0) (0.200176 0.0045113 0) (0.200325 0.00454604 0) (0.200469 0.00455952 0) (0.200616 0.00454487 0) (0.200757 0.00450302 0) (0.200881 0.00444417 0) (0.200995 0.00436695 0) (0.201103 0.00426659 0) (0.201193 0.0041522 0) (0.201269 0.00403083 0) (0.20134 0.00389808 0) (0.2014 0.00375507 0) (0.201442 0.00360814 0) (0.201476 0.00345594 0) (0.201507 0.00329708 0) (0.201525 0.00313727 0) (0.201533 0.00297894 0) (0.201536 0.00281882 0) (0.201531 0.00265765 0) (0.201515 0.00249961 0) (0.201491 0.0023451 0) (0.201464 0.0021927 0) (0.201431 0.00204398 0) (0.20139 0.00190124 0) (0.201344 0.00176447 0) (0.201294 0.00163313 0) (0.201242 0.00150806 0) (0.201187 0.0013903 0) (0.201129 0.00127995 0) (0.20107 0.00117663 0) (0.201012 0.00108014 0) (0.200953 0.0009904 0) (0.200895 0.00090723 0) (0.200838 0.000830385 0) (0.200782 0.000759639 0) (0.200729 0.000694742 0) (0.200677 0.000635367 0) (0.200628 0.000581131 0) (0.200581 0.000531633 0) (0.200537 0.000486478 0) (0.200495 0.000445289 0) (0.200456 0.000407706 0) (0.20042 0.000373398 0) (0.200386 0.000342058 0) (0.200354 0.000313403 0) (0.200325 0.000287176 0) (0.200298 0.000263143 0) (0.200273 0.000241097 0) (0.20025 0.000220852 0) (0.200229 0.000202247 0) (0.200209 0.000185138 0) (0.200191 0.000169397 0) (0.200175 0.000154914 0) (0.20016 0.000141588 0) (0.200146 0.000129329 0) (0.200133 0.000118054 0) (0.200121 0.000107689 0) (0.20011 9.81657e-05 0) (0.2001 8.94222e-05 0) (0.200091 8.13961e-05 0) (0.200083 7.40404e-05 0) (0.200075 6.72929e-05 0) (0.200069 6.11259e-05 0) (0.200062 5.54665e-05 0) (0.200056 5.03179e-05 0) (0.200051 4.55795e-05 0) (0.200046 4.13037e-05 0) (0.200042 3.73413e-05 0) (0.200038 3.38114e-05 0) (0.200034 3.05029e-05 0) (0.200031 2.76041e-05 0) (0.200028 2.4851e-05 0) (0.200025 2.24783e-05 0) (0.200022 2.02004e-05 0) (0.20002 1.8264e-05 0) (0.200018 1.63875e-05 0) (0.200016 1.48195e-05 0) (0.200014 1.32742e-05 0) (0.200013 1.20198e-05 0) (0.200011 1.07499e-05 0) (0.20001 9.75511e-06 0) (0.200009 8.72044e-06 0) (0.200008 7.93985e-06 0) (0.200007 7.10089e-06 0) (0.200006 6.504e-06 0) (0.200005 5.8267e-06 0) (0.200005 5.38384e-06 0) (0.200004 4.84608e-06 0) (0.200004 4.53352e-06 0) (0.200003 4.11298e-06 0) (0.200003 3.91575e-06 0) (0.200002 3.5971e-06 0) (0.200002 3.5017e-06 0) (0.200001 3.27343e-06 0) (0.199529 0.0037488 0) (0.199614 0.00387266 0) (0.199713 0.00398723 0) (0.199817 0.00409172 0) (0.199927 0.00418418 0) (0.200045 0.00426085 0) (0.200169 0.00431762 0) (0.200292 0.0043535 0) (0.200411 0.00437021 0) (0.20053 0.00436547 0) (0.200647 0.00433668 0) (0.200752 0.00428831 0) (0.200848 0.0042237 0) (0.20094 0.00414092 0) (0.201022 0.00404277 0) (0.201091 0.00393475 0) (0.201151 0.00381597 0) (0.201203 0.00368595 0) (0.201244 0.00354998 0) (0.201276 0.0034105 0) (0.201304 0.00326577 0) (0.201323 0.00311744 0) (0.201332 0.00296864 0) (0.201335 0.00281886 0) (0.201333 0.00266774 0) (0.201322 0.00251802 0) (0.201304 0.00237149 0) (0.201281 0.00222745 0) (0.201254 0.00208605 0) (0.201221 0.00194896 0) (0.201183 0.00181702 0) (0.201142 0.00169005 0) (0.201098 0.00156839 0) (0.201051 0.00145286 0) (0.201003 0.00134384 0) (0.200953 0.00124115 0) (0.200902 0.00114458 0) (0.200852 0.00105409 0) (0.200802 0.000969621 0) (0.200752 0.000891051 0) (0.200704 0.00081822 0) (0.200657 0.000750938 0) (0.200612 0.000688946 0) (0.200568 0.000631926 0) (0.200527 0.000579537 0) (0.200488 0.000531437 0) (0.20045 0.000487295 0) (0.200415 0.000446798 0) (0.200383 0.000409652 0) (0.200352 0.000375578 0) (0.200324 0.000344317 0) (0.200297 0.000315626 0) (0.200273 0.000289281 0) (0.20025 0.000265077 0) (0.200229 0.000242828 0) (0.20021 0.000222368 0) (0.200192 0.000203545 0) (0.200175 0.000186227 0) (0.20016 0.000170292 0) (0.200146 0.000155631 0) (0.200134 0.000142145 0) (0.200122 0.000129744 0) (0.200111 0.000118347 0) (0.200101 0.000107876 0) (0.200092 9.82641e-05 0) (0.200084 8.94419e-05 0) (0.200076 8.13576e-05 0) (0.200069 7.39426e-05 0) (0.200063 6.71658e-05 0) (0.200057 6.09477e-05 0) (0.200052 5.52905e-05 0) (0.200047 5.00852e-05 0) (0.200042 4.5387e-05 0) (0.200038 4.10348e-05 0) (0.200034 3.71558e-05 0) (0.200031 3.35223e-05 0) (0.200028 3.03364e-05 0) (0.200025 2.73131e-05 0) (0.200023 2.47048e-05 0) (0.20002 2.22033e-05 0) (0.200018 2.00744e-05 0) (0.200016 1.80134e-05 0) (0.200015 1.6289e-05 0) (0.200013 1.45915e-05 0) (0.200012 1.32113e-05 0) (0.20001 1.18161e-05 0) (0.200009 1.0721e-05 0) (0.200008 9.58359e-06 0) (0.200007 8.72385e-06 0) (0.200006 7.80093e-06 0) (0.200006 7.14302e-06 0) (0.200005 6.39712e-06 0) (0.200004 5.90854e-06 0) (0.200004 5.31523e-06 0) (0.200003 4.97007e-06 0) (0.200003 4.5048e-06 0) (0.200002 4.28674e-06 0) (0.200002 3.93253e-06 0) (0.200002 3.82695e-06 0) (0.200001 3.57103e-06 0) (0.199647 0.00362334 0) (0.199716 0.00373283 0) (0.199794 0.00383537 0) (0.199878 0.00392939 0) (0.199966 0.00401343 0) (0.200059 0.00408482 0) (0.200156 0.00414033 0) (0.200254 0.00417812 0) (0.20035 0.0041984 0) (0.200444 0.00420024 0) (0.200536 0.00418166 0) (0.200624 0.00414446 0) (0.200704 0.0040919 0) (0.20078 0.00402328 0) (0.200848 0.00393848 0) (0.200906 0.00384147 0) (0.200957 0.00373484 0) (0.201003 0.00361878 0) (0.20104 0.0034955 0) (0.20107 0.00336724 0) (0.201093 0.0032338 0) (0.201111 0.00309601 0) (0.201121 0.0029566 0) (0.201125 0.00281646 0) (0.201124 0.00267517 0) (0.201117 0.00253403 0) (0.201104 0.00239495 0) (0.201086 0.00225818 0) (0.201065 0.0021236 0) (0.201039 0.00199213 0) (0.201009 0.00186481 0) (0.200975 0.00174192 0) (0.20094 0.00162364 0) (0.200902 0.00151055 0) (0.200862 0.00140308 0) (0.200821 0.00130125 0) (0.200779 0.00120494 0) (0.200737 0.00111409 0) (0.200695 0.00102874 0) (0.200654 0.000948848 0) (0.200613 0.000874334 0) (0.200574 0.000805055 0) (0.200535 0.000740811 0) (0.200498 0.000681348 0) (0.200463 0.000626376 0) (0.200429 0.000575607 0) (0.200397 0.000528757 0) (0.200367 0.000485555 0) (0.200338 0.000445743 0) (0.200311 0.000409075 0) (0.200286 0.000375315 0) (0.200263 0.00034424 0) (0.200242 0.000315636 0) (0.200222 0.000289309 0) (0.200203 0.000265073 0) (0.200186 0.000242763 0) (0.20017 0.000222224 0) (0.200156 0.000203317 0) (0.200142 0.000185916 0) (0.20013 0.000169903 0) (0.200119 0.000155174 0) (0.200108 0.000141629 0) (0.200098 0.000129182 0) (0.20009 0.000117746 0) (0.200082 0.00010725 0) (0.200074 9.76177e-05 0) (0.200067 8.87914e-05 0) (0.200061 8.06969e-05 0) (0.200056 7.32994e-05 0) (0.20005 6.65126e-05 0) (0.200046 6.0338e-05 0) (0.200041 5.46578e-05 0) (0.200037 4.95301e-05 0) (0.200034 4.47817e-05 0) (0.200031 4.05479e-05 0) (0.200028 3.65843e-05 0) (0.200025 3.31066e-05 0) (0.200022 2.98091e-05 0) (0.20002 2.69617e-05 0) (0.200018 2.42332e-05 0) (0.200016 2.19088e-05 0) (0.200015 1.96607e-05 0) (0.200013 1.77776e-05 0) (0.200012 1.59258e-05 0) (0.20001 1.44182e-05 0) (0.200009 1.28958e-05 0) (0.200008 1.16991e-05 0) (0.200007 1.04576e-05 0) (0.200007 9.51769e-06 0) (0.200006 8.50961e-06 0) (0.200005 7.78994e-06 0) (0.200004 6.97447e-06 0) (0.200004 6.43966e-06 0) (0.200003 5.78998e-06 0) (0.200003 5.4119e-06 0) (0.200002 4.90122e-06 0) (0.200002 4.66215e-06 0) (0.200001 4.27184e-06 0) (0.200001 4.15604e-06 0) (0.200001 3.87203e-06 0) (0.199748 0.00351027 0) (0.199801 0.00360778 0) (0.19986 0.00370053 0) (0.199925 0.00378658 0) (0.199993 0.00386426 0) (0.200063 0.00393145 0) (0.200136 0.00398571 0) (0.20021 0.00402505 0) (0.200284 0.00404851 0) (0.200356 0.00405554 0) (0.200427 0.00404525 0) (0.200496 0.00401769 0) (0.200559 0.00397422 0) (0.200617 0.00391542 0) (0.200671 0.00384191 0) (0.200719 0.00375628 0) (0.200761 0.00366094 0) (0.200798 0.00355641 0) (0.200829 0.00344363 0) (0.200854 0.00332472 0) (0.200874 0.00320101 0) (0.200889 0.00307334 0) (0.200899 0.00294318 0) (0.200904 0.00281159 0) (0.200904 0.00267877 0) (0.2009 0.00254551 0) (0.200891 0.00241333 0) (0.200878 0.002283 0) (0.200862 0.00215461 0) (0.200843 0.00202863 0) (0.20082 0.00190587 0) (0.200794 0.00178687 0) (0.200767 0.00167195 0) (0.200737 0.00156149 0) (0.200706 0.00145587 0) (0.200674 0.00135522 0) (0.200641 0.00125952 0) (0.200608 0.00116873 0) (0.200575 0.00108293 0) (0.200542 0.00100215 0) (0.200509 0.00092636 0) (0.200477 0.000855485 0) (0.200446 0.000789375 0) (0.200416 0.000727829 0) (0.200387 0.000670615 0) (0.200359 0.000617495 0) (0.200333 0.000568229 0) (0.200308 0.00052259 0) (0.200284 0.000480355 0) (0.200262 0.000441307 0) (0.200242 0.000405236 0) (0.200222 0.000371937 0) (0.200204 0.000341214 0) (0.200187 0.000312878 0) (0.200172 0.000286751 0) (0.200157 0.00026267 0) (0.200144 0.000240479 0) (0.200132 0.000220037 0) (0.20012 0.000201212 0) (0.20011 0.000183883 0) (0.2001 0.000167939 0) (0.200091 0.000153276 0) (0.200083 0.000139799 0) (0.200076 0.000127418 0) (0.200069 0.000116054 0) (0.200063 0.000105625 0) (0.200057 9.60704e-05 0) (0.200052 8.73083e-05 0) (0.200047 7.93012e-05 0) (0.200042 7.19562e-05 0) (0.200038 6.52737e-05 0) (0.200035 5.91275e-05 0) (0.200031 5.35786e-05 0) (0.200028 4.84418e-05 0) (0.200026 4.38604e-05 0) (0.200023 3.95735e-05 0) (0.200021 3.58102e-05 0) (0.200019 3.22444e-05 0) (0.200017 2.91631e-05 0) (0.200015 2.62128e-05 0) (0.200014 2.36975e-05 0) (0.200012 2.12666e-05 0) (0.200011 1.92286e-05 0) (0.20001 1.72261e-05 0) (0.200009 1.5594e-05 0) (0.200008 1.39476e-05 0) (0.200007 1.26518e-05 0) (0.200006 1.13087e-05 0) (0.200006 1.02907e-05 0) (0.200005 9.19954e-06 0) (0.200004 8.41968e-06 0) (0.200004 7.53635e-06 0) (0.200003 6.95651e-06 0) (0.200003 6.25183e-06 0) (0.200003 5.8417e-06 0) (0.200002 5.28667e-06 0) (0.200002 5.0272e-06 0) (0.200001 4.60156e-06 0) (0.200001 4.47589e-06 0) (0.200001 4.16428e-06 0) (0.199832 0.00341521 0) (0.19987 0.00350348 0) (0.199912 0.00358852 0) (0.199958 0.00366843 0) (0.200006 0.00374138 0) (0.200056 0.00380542 0) (0.200107 0.00385854 0) (0.20016 0.00389883 0) (0.200212 0.00392489 0) (0.200264 0.00393582 0) (0.200314 0.0039309 0) (0.200363 0.00390987 0) (0.200408 0.00387353 0) (0.200451 0.00382288 0) (0.200491 0.00375866 0) (0.200527 0.00368218 0) (0.200558 0.0035953 0) (0.200585 0.00349935 0) (0.200609 0.00339544 0) (0.200629 0.00328516 0) (0.200644 0.00316996 0) (0.200656 0.00305074 0) (0.200665 0.00292849 0) (0.200669 0.00280425 0) (0.20067 0.00267868 0) (0.200669 0.00255247 0) (0.200663 0.00242668 0) (0.200655 0.00230216 0) (0.200644 0.00217928 0) (0.200631 0.00205833 0) (0.200615 0.00193987 0) (0.200597 0.0018245 0) (0.200577 0.00171268 0) (0.200556 0.00160473 0) (0.200534 0.00150097 0) (0.200511 0.00140157 0) (0.200487 0.00130657 0) (0.200463 0.00121601 0) (0.200439 0.00112998 0) (0.200414 0.00104856 0) (0.20039 0.000971799 0) (0.200366 0.000899655 0) (0.200343 0.000832031 0) (0.200321 0.000768775 0) (0.200299 0.000709705 0) (0.200278 0.000654622 0) (0.200258 0.000603329 0) (0.200239 0.00055563 0) (0.200221 0.000511334 0) (0.200204 0.00047025 0) (0.200188 0.000432188 0) (0.200173 0.000396962 0) (0.200159 0.000364388 0) (0.200146 0.000334287 0) (0.200134 0.000306489 0) (0.200123 0.000280832 0) (0.200112 0.000257164 0) (0.200102 0.000235342 0) (0.200094 0.000215232 0) (0.200085 0.000196711 0) (0.200078 0.000179663 0) (0.200071 0.00016398 0) (0.200065 0.000149563 0) (0.200059 0.000136316 0) (0.200053 0.000124156 0) (0.200049 0.000112996 0) (0.200044 0.000102771 0) (0.20004 9.33949e-05 0) (0.200036 8.48264e-05 0) (0.200033 7.69671e-05 0) (0.20003 6.98165e-05 0) (0.200027 6.32409e-05 0) (0.200024 5.73037e-05 0) (0.200022 5.1809e-05 0) (0.20002 4.69072e-05 0) (0.200018 4.23225e-05 0) (0.200016 3.8296e-05 0) (0.200015 3.44831e-05 0) (0.200013 3.11863e-05 0) (0.200012 2.80318e-05 0) (0.200011 2.53406e-05 0) (0.200009 2.27416e-05 0) (0.200009 2.05609e-05 0) (0.200008 1.842e-05 0) (0.200007 1.66734e-05 0) (0.200006 1.4913e-05 0) (0.200005 1.3526e-05 0) (0.200005 1.20896e-05 0) (0.200004 1.09997e-05 0) (0.200004 9.8323e-06 0) (0.200003 8.99704e-06 0) (0.200003 8.05142e-06 0) (0.200003 7.43008e-06 0) (0.200002 6.67494e-06 0) (0.200002 6.23522e-06 0) (0.200001 5.6395e-06 0) (0.200001 5.36106e-06 0) (0.200001 4.90302e-06 0) (0.200001 4.76793e-06 0) (0.200001 4.43116e-06 0) (0.199902 0.00334472 0) (0.199925 0.00342655 0) (0.19995 0.00350602 0) (0.199978 0.00358148 0) (0.200007 0.00365107 0) (0.200037 0.00371285 0) (0.200068 0.0037649 0) (0.2001 0.00380538 0) (0.200132 0.0038327 0) (0.200163 0.00384575 0) (0.200194 0.00384397 0) (0.200223 0.0038273 0) (0.200252 0.00379607 0) (0.200278 0.0037509 0) (0.200303 0.00369251 0) (0.200325 0.00362217 0) (0.200345 0.00354159 0) (0.200363 0.00345222 0) (0.200378 0.00335509 0) (0.200391 0.0032514 0) (0.200402 0.00314251 0) (0.20041 0.00302959 0) (0.200416 0.00291358 0) (0.20042 0.00279531 0) (0.200422 0.00267553 0) (0.200421 0.00255494 0) (0.200419 0.00243438 0) (0.200415 0.00231463 0) (0.200409 0.00219617 0) (0.200401 0.0020793 0) (0.200392 0.00196445 0) (0.200382 0.00185217 0) (0.20037 0.00174297 0) (0.200357 0.00163722 0) (0.200344 0.0015352 0) (0.20033 0.00143706 0) (0.200315 0.00134291 0) (0.2003 0.00125283 0) (0.200285 0.00116693 0) (0.20027 0.00108531 0) (0.200255 0.00100805 0) (0.20024 0.000935154 0) (0.200225 0.000866548 0) (0.200211 0.000802119 0) (0.200197 0.000741719 0) (0.200183 0.000685186 0) (0.200171 0.000632354 0) (0.200158 0.000583058 0) (0.200146 0.000537135 0) (0.200135 0.000494417 0) (0.200125 0.000454736 0) (0.200115 0.000417924 0) (0.200106 0.000383812 0) (0.200097 0.000352232 0) (0.200089 0.000323025 0) (0.200081 0.000296033 0) (0.200075 0.000271108 0) (0.200068 0.000248109 0) (0.200062 0.000226903 0) (0.200057 0.000207364 0) (0.200052 0.000189374 0) (0.200047 0.000172822 0) (0.200043 0.000157605 0) (0.200039 0.000143625 0) (0.200035 0.000130792 0) (0.200032 0.000119017 0) (0.200029 0.00010823 0) (0.200026 9.8341e-05 0) (0.200024 8.93053e-05 0) (0.200022 8.10198e-05 0) (0.20002 7.34826e-05 0) (0.200018 6.65537e-05 0) (0.200016 6.0298e-05 0) (0.200014 5.45108e-05 0) (0.200013 4.93478e-05 0) (0.200012 4.45213e-05 0) (0.200011 4.02814e-05 0) (0.20001 3.62688e-05 0) (0.200009 3.27982e-05 0) (0.200008 2.94795e-05 0) (0.200007 2.6647e-05 0) (0.200006 2.39131e-05 0) (0.200006 2.16184e-05 0) (0.200005 1.93667e-05 0) (0.200004 1.75287e-05 0) (0.200004 1.56775e-05 0) (0.200004 1.42179e-05 0) (0.200003 1.27072e-05 0) (0.200003 1.15604e-05 0) (0.200002 1.03323e-05 0) (0.200002 9.45329e-06 0) (0.200002 8.45814e-06 0) (0.200002 7.8042e-06 0) (0.200001 7.00891e-06 0) (0.200001 6.5461e-06 0) (0.200001 5.91798e-06 0) (0.200001 5.62494e-06 0) (0.200001 5.14104e-06 0) (0.200001 4.99894e-06 0) (0.2 4.64175e-06 0) (0.199962 0.00330581 0) (0.199969 0.00338415 0) (0.199978 0.00346057 0) (0.199987 0.00353356 0) (0.199997 0.00360126 0) (0.200007 0.00366168 0) (0.200018 0.00371291 0) (0.200028 0.00375319 0) (0.200039 0.00378091 0) (0.20005 0.00379489 0) (0.200061 0.00379452 0) (0.200071 0.00377972 0) (0.200081 0.00375071 0) (0.200091 0.003708 0) (0.200099 0.00365248 0) (0.200108 0.0035854 0) (0.200115 0.0035082 0) (0.200122 0.00342222 0) (0.200128 0.00332855 0) (0.200134 0.00322832 0) (0.200138 0.00312286 0) (0.200142 0.00301338 0) (0.200145 0.00290079 0) (0.200148 0.00278579 0) (0.200149 0.00266912 0) (0.20015 0.00255154 0) (0.200151 0.00243384 0) (0.20015 0.00231675 0) (0.200149 0.00220075 0) (0.200148 0.0020862 0) (0.200145 0.00197348 0) (0.200143 0.0018631 0) (0.20014 0.00175559 0) (0.200136 0.00165133 0) (0.200132 0.00155058 0) (0.200128 0.00145351 0) (0.200124 0.0013602 0) (0.200119 0.00127078 0) (0.200114 0.00118534 0) (0.200109 0.00110402 0) (0.200104 0.00102688 0) (0.200099 0.000953955 0) (0.200094 0.000885184 0) (0.200089 0.000820469 0) (0.200084 0.000759674 0) (0.200079 0.000702655 0) (0.200075 0.000649259 0) (0.20007 0.000599335 0) (0.200065 0.000552732 0) (0.200061 0.000509295 0) (0.200057 0.000468867 0) (0.200053 0.00043129 0) (0.200049 0.000396405 0) (0.200045 0.000364054 0) (0.200042 0.000334083 0) (0.200039 0.000306344 0) (0.200036 0.000280694 0) (0.200033 0.000256995 0) (0.20003 0.000235118 0) (0.200028 0.000214941 0) (0.200025 0.000196347 0) (0.200023 0.000179226 0) (0.200021 0.000163475 0) (0.200019 0.000148995 0) (0.200018 0.000135699 0) (0.200016 0.000123493 0) (0.200015 0.000112308 0) (0.200013 0.000102051 0) (0.200012 9.26777e-05 0) (0.200011 8.40813e-05 0) (0.20001 7.62601e-05 0) (0.200009 6.90701e-05 0) (0.200008 6.25774e-05 0) (0.200007 5.6572e-05 0) (0.200007 5.12128e-05 0) (0.200006 4.62045e-05 0) (0.200005 4.18031e-05 0) (0.200005 3.76398e-05 0) (0.200004 3.40367e-05 0) (0.200004 3.05936e-05 0) (0.200004 2.76529e-05 0) (0.200003 2.48166e-05 0) (0.200003 2.2434e-05 0) (0.200003 2.0098e-05 0) (0.200002 1.81893e-05 0) (0.200002 1.62687e-05 0) (0.200002 1.47526e-05 0) (0.200002 1.3185e-05 0) (0.200001 1.19934e-05 0) (0.200001 1.07187e-05 0) (0.200001 9.805e-06 0) (0.200001 8.77149e-06 0) (0.200001 8.09136e-06 0) (0.200001 7.26455e-06 0) (0.200001 6.78288e-06 0) (0.200001 6.12871e-06 0) (0.200001 5.8234e-06 0) (0.2 5.31785e-06 0) (0.2 5.16963e-06 0) (0.2 4.79439e-06 0) (0.20457 -0.000473565 0) (0.195021 0.000507728 0) (0.204385 0.000746373 0) (0.195581 -0.000626118 0) (0.203906 0.000298046 0) (0.195066 0.000338016 0) (0.20454 -0.000436715 0) (0.194167 -0.000290296 0) (0.204746 0.000465481 0) (0.193839 -7.57413e-05 0) (0.204595 -0.000250009 0) (0.193146 -1.31962e-05 0) (0.204795 0.000397449 0) (0.19207 0.000125264 0) (0.205021 9.55436e-06 0) (0.191004 1.66328e-06 0) (0.204995 0.000368489 0) (0.189509 0.000408649 0) (0.205141 0.000305703 0) (0.187486 0.00019865 0) (0.205116 0.000344868 0) (0.184749 0.000684431 0) (0.204521 0.000839019 0) (0.180257 0.00124403 0) (0.203207 0.00183983 0) (0.20376 -0.000452231 0) (0.195884 0.000558437 0) (0.203573 0.000730605 0) (0.196631 -0.000615961 0) (0.20287 0.000338056 0) (0.196325 0.000308934 0) (0.203331 -0.000392846 0) (0.195568 -0.000248371 0) (0.203223 0.000474206 0) (0.195592 -4.2479e-05 0) (0.202749 -0.000169674 0) (0.195204 4.02039e-05 0) (0.202496 0.00045246 0) (0.194716 0.000214184 0) (0.202133 0.000104038 0) (0.194282 0.000139282 0) (0.201267 0.000472842 0) (0.193805 0.000595865 0) (0.20035 0.00044542 0) (0.193096 0.000510492 0) (0.198725 0.000557152 0) (0.192255 0.0012117 0) (0.196075 0.0013107 0) (0.190961 0.00256128 0) (0.192185 0.00351416 0) (0.202518 -0.000420065 0) (0.197172 0.00057358 0) (0.202434 0.000685579 0) (0.198121 -0.000559552 0) (0.201461 0.000342081 0) (0.19802 0.000301978 0) (0.201792 -0.000339509 0) (0.197314 -0.000185188 0) (0.201424 0.000449789 0) (0.1976 3.76672e-05 0) (0.200746 -0.000123533 0) (0.197309 0.000131572 0) (0.200283 0.000466994 0) (0.197092 0.000327056 0) (0.199735 0.000146868 0) (0.19677 0.000299713 0) (0.198694 0.000549874 0) (0.196452 0.000774727 0) (0.1978 0.00058103 0) (0.195711 0.000749798 0) (0.196288 0.000853884 0) (0.19468 0.00156754 0) (0.194387 0.00197791 0) (0.193175 0.00317244 0) (0.192514 0.00466361 0) (0.201384 -0.000396405 0) (0.198292 0.000565886 0) (0.201487 0.000620563 0) (0.199324 -0.00046891 0) (0.200387 0.000321407 0) (0.19929 0.000312753 0) (0.200711 -0.000292964 0) (0.198505 -8.91146e-05 0) (0.200274 0.000403444 0) (0.198823 0.000119251 0) (0.199612 -6.91323e-05 0) (0.198422 0.000223833 0) (0.199191 0.000464677 0) (0.198187 0.000424052 0) (0.198745 0.000233747 0) (0.19771 0.000435542 0) (0.197827 0.000644267 0) (0.197274 0.000885455 0) (0.197188 0.000768692 0) (0.196357 0.00095753 0) (0.195927 0.00119326 0) (0.195211 0.00185126 0) (0.194558 0.00251191 0) (0.193919 0.00355903 0) (0.193483 0.00507408 0) (0.200647 -0.000370534 0) (0.198988 0.000542044 0) (0.200912 0.000549054 0) (0.199989 -0.000367848 0) (0.199843 0.000302108 0) (0.199925 0.000313007 0) (0.200199 -0.0002249 0) (0.199067 5.62898e-06 0) (0.199789 0.000362931 0) (0.199315 0.000186974 0) (0.199201 2.1673e-05 0) (0.198816 0.000293928 0) (0.198854 0.000483533 0) (0.19852 0.000499846 0) (0.198493 0.000351804 0) (0.197955 0.000546673 0) (0.19767 0.000758364 0) (0.197469 0.000981478 0) (0.197147 0.000969 0) (0.196534 0.00117124 0) (0.196021 0.00149998 0) (0.195488 0.00212953 0) (0.194946 0.00287436 0) (0.19451 0.00384761 0) (0.194249 0.00515144 0) (0.200285 -0.000335119 0) (0.19933 0.000497981 0) (0.200613 0.000484423 0) (0.200249 -0.000274587 0) (0.199661 0.00029091 0) (0.200135 0.000304338 0) (0.200014 -0.000139939 0) (0.199283 8.76026e-05 0) (0.199646 0.000343225 0) (0.199449 0.000241359 0) (0.199105 0.000128662 0) (0.198939 0.000352954 0) (0.198794 0.000520505 0) (0.198595 0.000562157 0) (0.198462 0.000481953 0) (0.198036 0.000655704 0) (0.197694 0.000878357 0) (0.197541 0.00107774 0) (0.197209 0.00116068 0) (0.196664 0.00138779 0) (0.196202 0.00177643 0) (0.195769 0.00237732 0) (0.195339 0.00312907 0) (0.195033 0.0040243 0) (0.194894 0.00514807 0) (0.200146 -0.000293759 0) (0.199487 0.00044039 0) (0.200445 0.000435616 0) (0.200309 -0.000198486 0) (0.199637 0.000289735 0) (0.200153 0.000293999 0) (0.199949 -5.40607e-05 0) (0.19937 0.000161064 0) (0.199617 0.000341723 0) (0.199464 0.00028943 0) (0.199099 0.000236916 0) (0.198995 0.000410062 0) (0.198806 0.000566147 0) (0.198613 0.000625904 0) (0.198477 0.000609492 0) (0.198099 0.000766072 0) (0.197756 0.000993088 0) (0.197605 0.00118476 0) (0.197292 0.00133995 0) (0.196805 0.00159849 0) (0.196412 0.00201371 0) (0.196063 0.00258648 0) (0.19572 0.00330934 0) (0.195508 0.00413259 0) (0.195461 0.00511735 0) (0.200101 -0.000250668 0) (0.199573 0.000378493 0) (0.200326 0.000402879 0) (0.200297 -0.000138606 0) (0.199661 0.000295334 0) (0.200109 0.000288987 0) (0.199916 2.44112e-05 0) (0.199417 0.000229305 0) (0.199613 0.000352188 0) (0.199455 0.000336828 0) (0.199111 0.000339446 0) (0.199038 0.00046769 0) (0.198834 0.000618402 0) (0.198625 0.000696215 0) (0.198503 0.000725032 0) (0.198165 0.000877321 0) (0.197831 0.00110623 0) (0.197679 0.00130066 0) (0.197391 0.0015037 0) (0.19696 0.00179275 0) (0.196634 0.00221421 0) (0.196358 0.00275996 0) (0.196085 0.00343847 0) (0.195943 0.00419439 0) (0.195964 0.00506279 0) (0.200087 -0.000207539 0) (0.199637 0.000316683 0) (0.200228 0.000382818 0) (0.200266 -8.93891e-05 0) (0.199693 0.000302108 0) (0.200052 0.000293764 0) (0.199894 9.16865e-05 0) (0.199449 0.000293727 0) (0.199612 0.000373042 0) (0.199449 0.000383396 0) (0.199125 0.000433853 0) (0.199075 0.000526862 0) (0.198869 0.000674434 0) (0.198642 0.000772556 0) (0.198536 0.00083039 0) (0.198236 0.000988179 0) (0.197913 0.0012189 0) (0.197763 0.00141819 0) (0.197505 0.00165331 0) (0.197125 0.00196748 0) (0.196859 0.00238263 0) (0.196647 0.00289912 0) (0.196433 0.00353012 0) (0.196345 0.00422061 0) (0.196415 0.00498753 0) (0.200079 -0.000165207 0) (0.199692 0.000257491 0) (0.200144 0.000371415 0) (0.20023 -4.60507e-05 0) (0.199724 0.000306556 0) (0.199997 0.00030881 0) (0.199877 0.000147043 0) (0.199476 0.000353503 0) (0.199609 0.000404 0) (0.199451 0.000427542 0) (0.19914 0.000521107 0) (0.199107 0.000589405 0) (0.198908 0.000731318 0) (0.198667 0.00085416 0) (0.198573 0.000929694 0) (0.198311 0.00109392 0) (0.197999 0.0013304 0) (0.197856 0.00153487 0) (0.197632 0.00178873 0) (0.197297 0.00212057 0) (0.197081 0.0025229 0) (0.196927 0.00300751 0) (0.196762 0.00359248 0) (0.196715 0.0042198 0) (0.196818 0.0048954 0) (0.20007 -0.000124614 0) (0.199744 0.00020353 0) (0.200074 0.000363825 0) (0.200194 -3.35568e-06 0) (0.199753 0.000306887 0) (0.199947 0.000332761 0) (0.199866 0.000193976 0) (0.199499 0.000406169 0) (0.199601 0.000444839 0) (0.199461 0.000469996 0) (0.199159 0.00060157 0) (0.199134 0.000656889 0) (0.198952 0.000787603 0) (0.198699 0.000937913 0) (0.198614 0.00102605 0) (0.19839 0.0011922 0) (0.19809 0.00143919 0) (0.197955 0.00164909 0) (0.197769 0.00190854 0) (0.197474 0.0022517 0) (0.197298 0.00264014 0) (0.197195 0.00308921 0) (0.197073 0.00362921 0) (0.197054 0.00419777 0) (0.197179 0.0047915 0) (0.200061 -8.69257e-05 0) (0.199791 0.000157706 0) (0.200017 0.000355831 0) (0.200157 4.11756e-05 0) (0.199781 0.00030302 0) (0.199903 0.000362917 0) (0.199857 0.000237987 0) (0.199523 0.000450411 0) (0.199592 0.000494794 0) (0.199476 0.000512601 0) (0.199183 0.000673238 0) (0.199156 0.000729333 0) (0.198999 0.000843345 0) (0.198741 0.0010191 0) (0.198658 0.00112178 0) (0.198473 0.00128351 0) (0.198188 0.00154152 0) (0.198059 0.00175946 0) (0.197911 0.00201418 0) (0.197654 0.00236116 0) (0.197507 0.00273746 0) (0.197449 0.00314855 0) (0.197366 0.00364338 0) (0.197365 0.00415956 0) (0.197501 0.00468148 0) (0.200051 -5.32604e-05 0) (0.199835 0.000122213 0) (0.199975 0.000344609 0) (0.20012 8.84689e-05 0) (0.199809 0.000297743 0) (0.199867 0.000394487 0) (0.199849 0.000283232 0) (0.19955 0.000485987 0) (0.199582 0.00055007 0) (0.199494 0.000557519 0) (0.199214 0.000734839 0) (0.199175 0.000805454 0) (0.199048 0.000900646 0) (0.198792 0.00109423 0) (0.198704 0.00121721 0) (0.198559 0.00137004 0) (0.198293 0.00163401 0) (0.198164 0.00186431 0) (0.198055 0.00210848 0) (0.197837 0.00244926 0) (0.197709 0.00281604 0) (0.197686 0.00319066 0) (0.197639 0.00363876 0) (0.19765 0.00410841 0) (0.197789 0.00456871 0) (0.20004 -2.45639e-05 0) (0.199873 9.80619e-05 0) (0.199946 0.000329455 0) (0.200084 0.000138013 0) (0.199835 0.000294772 0) (0.19984 0.000423297 0) (0.19984 0.000331701 0) (0.199578 0.000514538 0) (0.199574 0.000606101 0) (0.199512 0.000607476 0) (0.199252 0.00078738 0) (0.199193 0.000882167 0) (0.199096 0.000961857 0) (0.198852 0.0011618 0) (0.198753 0.00130995 0) (0.198643 0.0014543 0) (0.198404 0.00171533 0) (0.198273 0.0019606 0) (0.198196 0.00219398 0) (0.19802 0.00251812 0) (0.197905 0.002876 0) (0.197906 0.00321948 0) (0.197893 0.00361971 0) (0.197913 0.0040465 0) (0.198047 0.0044556 0) (0.200031 -1.54938e-06 0) (0.199906 8.52175e-05 0) (0.19993 0.000311589 0) (0.200051 0.000185967 0) (0.199858 0.000296894 0) (0.199823 0.000446993 0) (0.199831 0.00038316 0) (0.199609 0.000539627 0) (0.19957 0.000658919 0) (0.199527 0.000663346 0) (0.199295 0.000833365 0) (0.199215 0.000955388 0) (0.199142 0.00102797 0) (0.19892 0.00122262 0) (0.198808 0.00139641 0) (0.198725 0.00153768 0) (0.198519 0.00178662 0) (0.198386 0.00204505 0) (0.198332 0.00227195 0) (0.198198 0.0025717 0) (0.198095 0.00291749 0) (0.198109 0.00323695 0) (0.198126 0.00359101 0) (0.198155 0.0039764 0) (0.19828 0.0043435 0) (0.200023 1.62624e-05 0) (0.199932 8.22883e-05 0) (0.199923 0.000293026 0) (0.20002 0.000229562 0) (0.199878 0.000306128 0) (0.199815 0.000465466 0) (0.199822 0.000435739 0) (0.19964 0.000565058 0) (0.199574 0.000705846 0) (0.199541 0.0007237 0) (0.199341 0.000876352 0) (0.199242 0.00102189 0) (0.199184 0.001098 0) (0.198993 0.0012793 0) (0.198869 0.0014736 0) (0.198804 0.0016195 0) (0.198636 0.00185071 0) (0.198503 0.0021157 0) (0.198462 0.00234172 0) (0.198369 0.00261441 0) (0.19828 0.00294208 0) (0.198298 0.00324354 0) (0.198338 0.00355665 0) (0.198377 0.00390109 0) (0.19849 0.0042324 0) (0.200016 2.93595e-05 0) (0.199953 8.68895e-05 0) (0.199924 0.000276257 0) (0.199994 0.000266917 0) (0.199893 0.000322599 0) (0.199815 0.00048011 0) (0.199814 0.000486694 0) (0.199669 0.000593515 0) (0.199584 0.000746295 0) (0.199554 0.000785595 0) (0.199388 0.000919708 0) (0.199276 0.00108042 0) (0.199225 0.0011691 0) (0.199066 0.00133463 0) (0.198938 0.00154049 0) (0.198881 0.00169728 0) (0.198751 0.00191027 0) (0.198624 0.00217293 0) (0.198588 0.00240152 0) (0.19853 0.00264954 0) (0.198458 0.00295308 0) (0.198474 0.00323937 0) (0.198529 0.00351887 0) (0.198579 0.00382358 0) (0.198681 0.00412272 0) (0.200011 3.8239e-05 0) (0.199968 9.63456e-05 0) (0.199929 0.000263325 0) (0.199974 0.000297244 0) (0.199904 0.000344872 0) (0.199821 0.000493223 0) (0.199809 0.000533619 0) (0.199695 0.000625952 0) (0.199602 0.000781623 0) (0.199567 0.000845702 0) (0.199434 0.000965227 0) (0.199317 0.00113184 0) (0.199265 0.00123775 0) (0.199139 0.00139007 0) (0.199013 0.00159819 0) (0.198958 0.00176827 0) (0.19886 0.00196659 0) (0.198747 0.00221902 0) (0.19871 0.00245008 0) (0.198679 0.0026787 0) (0.198627 0.00295451 0) (0.198639 0.0032253 0) (0.198701 0.00347861 0) (0.198762 0.00374673 0) (0.198855 0.0040157 0) (0.200007 4.41216e-05 0) (0.199978 0.000108278 0) (0.199938 0.000255192 0) (0.19996 0.000321077 0) (0.199911 0.000370663 0) (0.199831 0.000506811 0) (0.199807 0.000575378 0) (0.199718 0.000661641 0) (0.199624 0.000813758 0) (0.199583 0.000901651 0) (0.199477 0.00101285 0) (0.199363 0.00117781 0) (0.199308 0.00130132 0) (0.199208 0.00144554 0) (0.199093 0.00164855 0) (0.199035 0.00183062 0) (0.198963 0.00201962 0) (0.198869 0.00225677 0) (0.19883 0.00248728 0) (0.198816 0.00270234 0) (0.198785 0.0029502 0) (0.198795 0.00320331 0) (0.198856 0.00343643 0) (0.198925 0.00367295 0) (0.199012 0.00391314 0) (0.200004 4.79469e-05 0) (0.199984 0.000121033 0) (0.199946 0.00025176 0) (0.199951 0.000339345 0) (0.199915 0.000397819 0) (0.199843 0.0005218 0) (0.19981 0.000611567 0) (0.199739 0.000699215 0) (0.19965 0.000844078 0) (0.199602 0.000951818 0) (0.199517 0.00106154 0) (0.199413 0.00121981 0) (0.199353 0.0013578 0) (0.199274 0.00149992 0) (0.199174 0.0016933 0) (0.199115 0.00188307 0) (0.199061 0.00206836 0) (0.198987 0.00228867 0) (0.198949 0.00251383 0) (0.198943 0.00272016 0) (0.19893 0.00294328 0) (0.198941 0.00317627 0) (0.198998 0.00339298 0) (0.19907 0.00360414 0) (0.199153 0.00381787 0) (0.200002 5.07451e-05 0) (0.199989 0.000135365 0) (0.199956 0.000253457 0) (0.199947 0.000355594 0) (0.199919 0.000428879 0) (0.199859 0.000542242 0) (0.199818 0.0006475 0) (0.199762 0.000743435 0) (0.199684 0.000879641 0) (0.19963 0.00100285 0) (0.199563 0.00111784 0) (0.199474 0.00126686 0) (0.199412 0.00141459 0) (0.19935 0.00156007 0) (0.199269 0.00174173 0) (0.199212 0.00193305 0) (0.199172 0.00211811 0) (0.19912 0.00232155 0) (0.199086 0.00253461 0) (0.199085 0.00273286 0) (0.199088 0.0029336 0) (0.199103 0.00314205 0) (0.199153 0.00334087 0) (0.199223 0.00352951 0) (0.199302 0.00371684 0) (0.200001 5.32297e-05 0) (0.199991 0.00014946 0) (0.199965 0.000261347 0) (0.199948 0.000372198 0) (0.199924 0.000461704 0) (0.199877 0.000570013 0) (0.199834 0.000684658 0) (0.199787 0.000792005 0) (0.199724 0.00092297 0) (0.19967 0.00105568 0) (0.199615 0.0011791 0) (0.199545 0.00132112 0) (0.199487 0.00147254 0) (0.199437 0.00162283 0) (0.199377 0.00179476 0) (0.199329 0.00198161 0) (0.199297 0.00216527 0) (0.199264 0.00235409 0) (0.199241 0.00255032 0) (0.199242 0.00273688 0) (0.199254 0.00291719 0) (0.199274 0.00309937 0) (0.199317 0.00327681 0) (0.199379 0.00344366 0) (0.199451 0.00360567 0) (0.2 5.55563e-05 0) (0.199992 0.000161395 0) (0.199973 0.000273377 0) (0.199953 0.000388565 0) (0.199932 0.000491328 0) (0.199895 0.000600669 0) (0.199856 0.000719781 0) (0.199816 0.000837575 0) (0.199766 0.000968177 0) (0.199718 0.00110479 0) (0.199673 0.00123589 0) (0.199619 0.00137514 0) (0.19957 0.00152527 0) (0.199529 0.00167844 0) (0.199487 0.00184445 0) (0.199449 0.00202347 0) (0.199425 0.00220256 0) (0.199405 0.00238027 0) (0.199392 0.00255956 0) (0.199394 0.00273148 0) (0.199409 0.00289452 0) (0.199432 0.00305396 0) (0.199469 0.0032099 0) (0.199521 0.00335722 0) (0.199583 0.00349853 0) (0.2 5.79447e-05 0) (0.199994 0.000171378 0) (0.199979 0.000286693 0) (0.199962 0.000404959 0) (0.199942 0.000517285 0) (0.199914 0.000630806 0) (0.199882 0.000752865 0) (0.199849 0.000878462 0) (0.199811 0.00101147 0) (0.199772 0.00114987 0) (0.199735 0.00128612 0) (0.199696 0.00142496 0) (0.199658 0.00157227 0) (0.199627 0.00172557 0) (0.199597 0.00188744 0) (0.199571 0.00205828 0) (0.199553 0.00223041 0) (0.199542 0.00239851 0) (0.199536 0.00256286 0) (0.199539 0.00271968 0) (0.199554 0.00286742 0) (0.199576 0.00300825 0) (0.199606 0.00314504 0) (0.199647 0.00327531 0) (0.199697 0.00340009 0) (0.2 6.02623e-05 0) (0.199995 0.000179458 0) (0.199985 0.00029909 0) (0.199971 0.000420443 0) (0.199955 0.000539121 0) (0.199935 0.000657505 0) (0.199912 0.000782376 0) (0.199887 0.000913092 0) (0.19986 0.00104934 0) (0.199831 0.00118914 0) (0.199804 0.00132806 0) (0.199776 0.00146726 0) (0.19975 0.00161207 0) (0.199727 0.00176351 0) (0.199708 0.00192173 0) (0.199691 0.00208571 0) (0.19968 0.00225027 0) (0.199673 0.00240967 0) (0.199672 0.00256211 0) (0.199676 0.0027057 0) (0.199688 0.00284016 0) (0.199705 0.00296643 0) (0.199729 0.00308796 0) (0.199759 0.00320421 0) (0.199795 0.00331608 0) (0.2 6.21692e-05 0) (0.199997 0.000185466 0) (0.199991 0.000308872 0) (0.199982 0.000433062 0) (0.199972 0.000555758 0) (0.199959 0.000678094 0) (0.199944 0.000805499 0) (0.199929 0.00093941 0) (0.199912 0.00107839 0) (0.199894 0.00121944 0) (0.199877 0.00135957 0) (0.199861 0.00149906 0) (0.199845 0.00164209 0) (0.199832 0.00179122 0) (0.199821 0.00194631 0) (0.199811 0.00210522 0) (0.199805 0.0022635 0) (0.199801 0.00241598 0) (0.199801 0.00255985 0) (0.199805 0.00269361 0) (0.199812 0.00281799 0) (0.199823 0.00293388 0) (0.199838 0.00304461 0) (0.199857 0.00315068 0) (0.199879 0.00325329 0) (0.2 6.32857e-05 0) (0.199999 0.000188833 0) (0.199997 0.000314455 0) (0.199994 0.000440447 0) (0.19999 0.000565216 0) (0.199986 0.000689762 0) (0.19998 0.00081877 0) (0.199975 0.000954343 0) (0.199969 0.00109487 0) (0.199963 0.00123677 0) (0.199957 0.00137739 0) (0.199951 0.00151696 0) (0.199945 0.00165904 0) (0.19994 0.00180666 0) (0.199936 0.00195984 0) (0.199933 0.00211599 0) (0.19993 0.00227074 0) (0.199929 0.00241927 0) (0.199929 0.00255848 0) (0.19993 0.00268686 0) (0.199932 0.00280559 0) (0.199936 0.00291575 0) (0.199941 0.00302063 0) (0.199947 0.00312107 0) (0.199954 0.00321858 0) ) ; boundaryField { top { type zeroGradient; } inlet { type fixedValue; value uniform (0.2 0 0); } outlet { type zeroGradient; } plate { type fixedValue; value uniform (0 0 0); } symmBound { type zeroGradient; } frontAndBack { type empty; } } // ************************************************************************* //
a387b2929c25bacfd97e18eb57e72eb65a153af5
a341ba115d70e2e4bf483129098f729d263636ec
/codeforces/408a.cpp
7324853f33d1dd6395a83743bdacad4db407c0d7
[]
no_license
mrfinch/competitive_programming
e2d29258ade2e9bf5cf52f9dbda22085f7942b37
ee6ba76792bd06a9b6bf58f72f0fbac5c6ee9ee2
refs/heads/master
2021-01-16T20:42:21.697361
2020-03-31T09:10:20
2020-03-31T09:10:20
23,836,977
0
0
null
null
null
null
UTF-8
C++
false
false
497
cpp
408a.cpp
#include <iostream> #include <vector> using namespace std; int main(){ int n; cin >> n; vector<int> v(n); int m=0; while(m<n){ cin >> v[m]; m++; } int min=99999; for(int i=0;i<v.size();i++){ int x=0; int j=0; while(j<v[i]){ int inp; cin >> inp; x+=(inp*5); j++; } x+=(v[i]*15); if(x<min){ min=x; } } cout << min << endl; }
368eb228ce63f2817e0ff7a717841972f86c65d4
42a27c4eb1a673101a85458243f9f4e7dd5df339
/Searching/Peak-Element.cpp
aa7d4041968bfd317805bfab9dd06435064a30ae
[]
no_license
arnavkundalia/Algorithms-and-Data-Structres_Extra
d5234e4e3537af2479a35b98f73d40d1a29f5668
bf85d18283798605f32b8fed040a9a0a0a96e2cf
refs/heads/master
2023-03-21T22:08:54.557840
2020-07-07T01:07:39
2020-07-07T01:07:39
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,062
cpp
Peak-Element.cpp
// Problem URL :- https://practice.geeksforgeeks.org/problems/peak-element/1 #include<bits/stdc++.h> using namespace std; /*This is a function problem.You only need to complete the function given below*/ /* The function should return the index of any peak element present in the array */ // arr: input array // n: size of array int peakElement(int arr[], int n) { // Your code here int mid, low=0, high = n-1; while(high >= low) { mid = high - (high - low)/2; if( ( mid==0 || (arr[mid] > arr[mid-1]) ) && ( mid==(n-1) || (arr[mid]>arr[mid+1]) ) ) return mid; else if (arr[mid-1] > arr[mid]) high = mid - 1; else low = mid + 1; } return -1; } int main() { int t; cin>>t; while(t--) { int n; cin>>n; int a[n]; for(int i=0;i<n;i++) { cin>>a[i]; } bool f=0; int A = peakElement(a,n); if(n==1) f=1; else if(A==0 and a[0]>=a[1]) f=1; else if(A==n-1 and a[n-1]>=a[n-2]) f=1; else if(a[A] >=a[A+1] and a[A]>= a[A-1]) f=1; else f=0; cout<<f<<endl; } return 0; }
25f534ad1976ba74e78da6e1d6f1f6eb33a047f7
06c38be26960807797a3250e2c95cbd5a458751b
/Lecture 2/src/41_pvector_traits/main.cc
565b5dfc0fe4e1ab312c2bf9b50d906c54e3c7b9
[]
no_license
NachoCasta/PrograAvanzadaUZH
2a8a1d1706b1bde14921f7d8f747cd487aae94d7
ce73ac84779ab16b224e8829c381b5cea762e685
refs/heads/master
2020-03-29T16:27:33.854139
2019-01-18T08:15:24
2019-01-18T08:15:24
150,114,768
0
0
null
null
null
null
UTF-8
C++
false
false
402
cc
main.cc
#include <iostream> using namespace std; #include "pvector.h" #include "pset.h" int main(int argc, char *argv[]) { pvector<int> pvi("tmp/test.txt"); foo(pvi); pvector<string> pvs("tmp/string.txt"); pvs.push_back("hello"); pvs.push_back("world"); pvs.push_back("my name is Ignacio"); pvs.push_back("------------------"); pset<int> ps("tmp/set_int.txt"); ps.erase(4); return 0; }
448014483dd39918b16642c56c545b70fe562ec8
394595f8875964d45e1a03ca54d73939b56b5f9a
/lc98_2.cpp
2488b2ac9b866a4322596ba4534e5637a8505d57
[]
no_license
zkEloHub/LC-SourceCode
e9887dd759c4ccf9d0dc7450b89608a629911309
2a8c47214d5269779ee0d321223e9f98dcc1b1c6
refs/heads/master
2020-09-08T13:00:14.916226
2019-12-19T08:11:04
2019-12-19T08:11:04
221,141,320
0
0
null
null
null
null
UTF-8
C++
false
false
790
cpp
lc98_2.cpp
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ class Solution { // 直接中序遍历, 比较结果是否从小到大增加 public: // 98.52% bool isValidBST(TreeNode* root) { vector<int> vec; stack<TreeNode*> stk; while (root != NULL || !stk.empty()) { while (root != NULL) { stk.push(root); root = root->left; } root = stk.top(); vec.push_back(root->val); stk.pop(); root = root->right; } for(int i = 1; i < vec.size(); i++) { if(vec[i] <= vec[i-1]) return false; } return true; } };
313e76d12d7e3b778157485783171b0a664eb31c
ff4c45c8403987718817db07ef84ebc51d0e73f2
/ConvertMoneyLV/Money.h
90a81a359e5835c86af75ee189b36e194b320586
[]
no_license
vlychagin/MoneyAppsLV
7f09bd2473feed831f36ecd98909148b1bc27ed8
0c67a0f65743c328f66c083c4cdb5c8153fe650a
refs/heads/master
2021-01-13T05:38:07.518532
2017-06-22T13:30:41
2017-06-22T13:30:41
95,118,180
0
0
null
null
null
null
UTF-8
C++
false
false
3,745
h
Money.h
// ► Разработать класс Money для представления сумм (в рублях и копейках) // с набором конструкторов, геттеров и сеттеров, методом toString() // ► При помощи методов класса перегрузите операции: // + для сложения двух сумм // - для вычитания двух сумм // * для умножения суммы на вещественное число – перевод в другую валюту // ► При помощи дружественных функций перегрузите операции // ввода и вывода, // сравнения(== , != ) и отношения(<, <= , >= , >). // Для реализации сравнений и отношений переведите сумму в копейки и сравнивайте // полученные числа #pragma once #include "stdafx.h" class Money { long _rubles; // рубли int _copecs; // копейки char strBuf[80]; // буфер для строкового представления суммы public: // ансамбль конструкторов, начальное значение полей - нули Money() : _rubles(), _copecs() {} Money(long rubles, int copecs): _rubles(), _copecs() { setRubles(rubles); setCopecs(copecs); } // Money Money(const Money &money): _rubles(money._rubles), _copecs(money._copecs) {} ~Money() {} // деструктор, не используется в данном проекте // геттеры и сеттеры long rubles() const { return _rubles; } void setRubles(long rubles) { // рубли могут быть отрицательными - по результатам // выполнения операций, знак суммы будем хранить именно // в поле рублей _rubles = rubles; } // setRubles int copecs() const { return _copecs; } void setCopecs(int copecs) { // копейки будут только положительными и принадлежать // интервалу от 0 до 99 (включительно) if (copecs >= 0 && copecs <= 99) _copecs = copecs; } // setCopecs // в этот буфер выводим сумму, преобразованную в строковый формат char *toString(); // операторы, перегруженные для этого класса Money operator+(Money &money) const; Money operator-(Money &money) const; Money operator*(double Rate) const; Money &operator += (Money &money); // операторы ввода и вывода friend istream& operator >> (istream &stream, Money &money); friend ostream& operator << (ostream &stream, const Money &money); // вспомогательный метод - типичная реализация сравнения int compareTo(const Money &money) const; // операторы сравнения и отношения friend bool operator==(const Money& money1, const Money& money2); friend bool operator!=(const Money& money1, const Money& money2); friend bool operator>=(const Money& money1, const Money& money2); friend bool operator >(const Money& money1, const Money& money2); friend bool operator<=(const Money& money1, const Money& money2); friend bool operator <(const Money& money1, const Money& money2); // для удобства кодирования вычислений реализуем операцию // Rate * money при помощи дружественной функции friend Money operator*(double Rate, const Money& money); };
6174e56fb42cd6011037fe7bea124ef28e751c9d
654904ee2ee5291f42ef7c539428741d028a09ea
/WormholeAdventure_v2/Particle.h
805bc2874f27313f8aecafaaa99e4995b8e0d68a
[]
no_license
scottyfulton/WormholeAdventure2
9c155d4c24e87aad13918da49ffdef0fa399adc7
1039b5086f7d973c0974cb51ff49db19998076e6
refs/heads/master
2020-05-14T14:19:39.720074
2019-06-04T14:47:26
2019-06-04T14:47:26
181,829,507
0
0
null
2019-04-18T04:07:58
2019-04-17T06:21:08
C++
UTF-8
C++
false
false
1,468
h
Particle.h
#pragma once #include <list> #include <random> #include <iostream> #include "Term.h" #include "GObject.h" class Particle : GObject { public: bool living; Particle(GLuint shaderID, GLuint textureID, GLuint vaoID, GLsizei numVertices, glm::vec3 pos, std::list<term>* baseShape); ~Particle(); void update(float dTheta, float phi, double time, double dt); //manipulates position data (particles follow wormhole, ship moves in xy-plane, asteroids follow path inside wormhole) void render(float dTheta, float phi, double alpha); float calc(float val, std::list<term>* function); bool isAlive(); //for Wormhole to check if the particle should be rendered void setFunc(std::list<term>* shapingFunc); //sets the new shaping function for an individual particle, called once particle "resets" back to 0 position void reset(float particleCount); // inherits projectionMatrix, transformationMatrix, pos, // vel, & acc(not used) // every particle will also be a light private: //wormhole will create a list of terms (function) to pass to each new particle std::list<term>* baseShape; std::list<term> shapeFunc; float theta, thetaI, radius; //the angle that an individual particle will be rotated after being translated (drawing the circumference of the wormhole) void setLiving(); //sets "living" boolean to true void setTheta(float newTheta); //void updateTheta(float dTheta, double alpha); //interpolates theta value, called in render() glm::vec3 posI; };
0187cc6131e81905578ffec412d37632d0c416c3
112021b2aab61cd24847b72aeb856e887c028d25
/Assignments/Solutions/Jasmine Kaur/Assignment 10/Question 1.cpp
d69f6769eea13ced5bc73a0483026e2e09f7837f
[]
no_license
amanraj-iit/DSA_Uplift_Project
0ad8b82da3ebfe7ebd6ab245e3c9fa0179bfbef1
11cf887fdbad4b98b0dfe317f625eedd15460c57
refs/heads/master
2023-07-28T06:37:36.313839
2021-09-15T11:29:34
2021-09-15T11:29:34
406,765,764
10
0
null
null
null
null
UTF-8
C++
false
false
404
cpp
Question 1.cpp
#include<bits/stdc++.h> using namespace std; class Solution { public: long long int factorial(int N) { if(N==1 || N==0) { return 1; } else { return N*factorial(N-1); } } }; int main() { int t; cin>>t; while(t--) { int N; cin>>N; Solution ob; cout << ob.factorial(N) << endl; } return 0; }
76f894be8242b66164e81119b3b8904eda740d37
caf184c0f6144fe245c81cf42ecf12c80ddfa45c
/0048.Наихудший делитель/main.cpp
1a2219a20af25d71662031489ecedca95d23ffb3
[]
no_license
frogsrop/acmpSolutions
ef3501ac7f09d02844753c5f8c1d0330b2810660
79a5a2cb9b1d5842c5a4c0338b45bd3bbcaa0cf3
refs/heads/master
2020-04-08T05:00:31.344486
2018-11-25T21:53:29
2018-11-25T21:53:29
159,041,959
0
0
null
null
null
null
UTF-8
C++
false
false
556
cpp
main.cpp
#include<iostream> #include<cstdio> #include<fstream> #include<cstdlib> #include<vector> #include<map> #include<set> #include<string> #include<queue> #include<cmath> #include<algorithm> #define ll long long #define pb push_back #define f first #define s second #define all(c) c.begin(),c.end() using namespace std; string s; int i; int main() { freopen("input.txt","r",stdin); freopen("output.txt","w",stdout); cin>>s; i=s.size()-1; cout<<1; while(s[i]=='0') { cout<<0; i--; } return 0; }
8b39206cdec122e3f5e64b7a8c0252d972992f9b
603d5408d2bb266e5917d6c78bb8a313a3f9fdcb
/test/utests/mocks/MockAampConfig.h
6050d0efa333025114c5f4e1aeda6e996366dde4
[ "Apache-2.0", "LGPL-2.0-or-later", "MIT", "curl", "LGPL-2.1-only" ]
permissive
rdkcmf/rdk-aamp
8450a8feac36b238ff89324eaa4af22aabeaf221
3e572144bdce84e518f484a53b88e6ea866f04c2
refs/heads/stable2
2023-01-30T14:24:42.301329
2023-01-12T14:01:01
2023-01-23T04:22:19
149,111,450
6
8
Apache-2.0
2023-01-25T17:11:29
2018-09-17T10:55:57
C++
UTF-8
C++
false
false
1,317
h
MockAampConfig.h
/* * If not stated otherwise in this file or this component's license file the * following copyright and licenses apply: * * Copyright 2022 RDK Management * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef AAMP_MOCK_AAMP_CONFIG_H #define AAMP_MOCK_AAMP_CONFIG_H #include <gmock/gmock.h> #include "AampConfig.h" class MockAampConfig { public: MOCK_METHOD(bool, IsConfigSet, (AAMPConfigSettings cfg)); MOCK_METHOD(bool, GetConfigValue, (AAMPConfigSettings cfg, std::string &value)); MOCK_METHOD(bool, GetConfigValue, (AAMPConfigSettings cfg, long &value)); MOCK_METHOD(bool, GetConfigValue, (AAMPConfigSettings cfg, double &value)); MOCK_METHOD(bool, GetConfigValue, (AAMPConfigSettings cfg, int &value)); }; extern MockAampConfig *g_mockAampConfig; #endif /* AAMP_MOCK_AAMP_CONFIG_H */
198a3c9a0de8e64dbcdaf477b0ac215126901e84
3a3ed2c22e418467b9a54863e810116d8f3e5f0a
/src/SGIEngine/AudioEngine.h
90481f91eb41d6e8ef60d57ebbc43c1f923d25d1
[]
no_license
ArnauBigas/SGI-Engine
dbb96d99075fb481e12a64eef4efd7e7752fc808
882ed9647d9be104b5706fdeeed44946f9d16587
refs/heads/master
2021-05-31T13:04:32.336605
2016-05-06T20:22:19
2016-05-06T20:22:19
null
0
0
null
null
null
null
UTF-8
C++
false
false
868
h
AudioEngine.h
/* * File: AudioEngine.h * Author: arnau * * Created on 7 / de setembre / 2015, 13:44 */ #ifndef AUDIOENGINE_H #define AUDIOENGINE_H #include <string> #include <SDL2/SDL_audio.h> #include <glm/vec3.hpp> #include "AudioObject.h" namespace AudioEngine { bool init(); void kill(); void playAudio(AudioObject& audio); void pauseAudio(AudioObject& audio); void stopAudio(AudioObject& audio); void playAudio(std::string audio); void playAudio(std::string audio, glm::vec3 position); void setListenerPosition(glm::vec3 position); glm::vec3 getListenerPosition(); void setListenerOrientation(glm::vec3 orientation); glm::vec3 getListenerOrientation(); void generateSamples(void*, Uint8* stream, int streamLength); SDL_AudioSpec& getAudioSpec(); }; #endif /* AUDIOENGINE_H */
73bae0dc25391f2cdd384ca1b393b43ccf824053
5d83739af703fb400857cecc69aadaf02e07f8d1
/Archive2/5f/f31a26a40346d7/main.cpp
5ac846b5eb8ae4c994fed9b347227d00371bbbd1
[]
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
434
cpp
main.cpp
#include <iostream> #include <string> #include <vector> #include <functional> template<typename T> std::ostream& operator<<(std::ostream& os, const std::vector<T>& vec) { for (auto& el : vec) { os << el << ' '; } return os; } void run(std::string& s) { s = "zhopa"; } int main() { std::string s = "world"; auto b = std::bind(&run, std::ref(s)); b(); std::cout << s << std::endl; }
dc32997b5818f8023aed7e34003fbd1657ddd671
ac95586cc66e3b686929a9dadb4805048efd1b3d
/Klondike.cpp
b0fcfca890348dfd109fc2f399dd33f9ce47fb14
[]
no_license
abadillo999/KlondikeOldVersion
dd52c450980a3dbd920b2ce168c8eef088a4b4c5
3c0b2ef03b94d4fd32c776e453824b434706cca6
refs/heads/master
2021-05-12T16:01:13.277760
2018-01-10T19:18:02
2018-01-10T19:18:02
117,000,099
0
0
null
null
null
null
UTF-8
C++
false
false
493
cpp
Klondike.cpp
/* * Klondike.cpp * * Created on: 12 Nov 2017 * Author: alejandrobadillo */ #include "Klondike.h" #include "View.h" #include "Logic.h" Klondike::Klondike(Views::View* view, Controllers::Logic* logic){ this->logic = logic; this->view = view; } void Klondike::start() { Controllers::OperationController* controller; do { controller = logic->gameControllers(); if (controller != nullptr){ view->interact(controller); } } while (controller != nullptr); }
405ff80dbb2178ceddc3b6088021e0d9a50993c0
785df77400157c058a934069298568e47950e40b
/TnbHydrostatic/TnbLib/Hydrostatic/Entities/CrsCurvesGraph/HydStatic_CrsCurvesGraph.hxx
a073ba762a09b660b949aed6486a54867503f157
[]
no_license
amir5200fx/Tonb
cb108de09bf59c5c7e139435e0be008a888d99d5
ed679923dc4b2e69b12ffe621fc5a6c8e3652465
refs/heads/master
2023-08-31T08:59:00.366903
2023-08-31T07:42:24
2023-08-31T07:42:24
230,028,961
9
3
null
2023-07-20T16:53:31
2019-12-25T02:29:32
C++
UTF-8
C++
false
false
1,695
hxx
HydStatic_CrsCurvesGraph.hxx
#pragma once #ifndef _HydStatic_CrsCurvesGraph_Header #define _HydStatic_CrsCurvesGraph_Header #include <Global_Done.hxx> #include <HydStatic_Entity.hxx> #include <HydStatic_CurveMakerType.hxx> namespace tnbLib { // Forward Declarations class HydStatic_CrsCurve; class HydStatic_CrsCurvesGraph : public HydStatic_Entity , public Global_Done { public: struct Heel { Standard_Real value; }; struct LeverArm { Standard_Real value; }; private: /*Private Data*/ Standard_Real theMinDispv_; Standard_Real theMaxDispv_; TNB_SERIALIZATION(TnbHydStatic_EXPORT); protected: //- default constructor HydStatic_CrsCurvesGraph() {} //- constructors HydStatic_CrsCurvesGraph ( const Standard_Integer theIndex, const word& theName ) : HydStatic_Entity(theIndex, theName) {} //- protected functions and operators TnbHydStatic_EXPORT void SetMinDispv(const Standard_Real); TnbHydStatic_EXPORT void SetMaxDispv(const Standard_Real); TnbHydStatic_EXPORT void CheckIsDone() const; public: //- public functions and operators virtual Standard_Integer NbCurves() const = 0; virtual hydStcLib::CurveMakerType CurveType() const = 0; TnbHydStatic_EXPORT Standard_Boolean IsInside(const Standard_Real x) const; TnbHydStatic_EXPORT Standard_Real MinDispv() const; TnbHydStatic_EXPORT Standard_Real MaxDispv() const; virtual std::vector<std::pair<LeverArm, Heel>> RetrieveLeverArms(const Standard_Real x) const = 0; TnbHydStatic_EXPORT void CheckVolume(const Standard_Real x) const; }; } BOOST_SERIALIZATION_ASSUME_ABSTRACT(tnbLib::HydStatic_CrsCurvesGraph); #endif // !_HydStatic_CrsCurvesGraph_Header
5ba41563bebf860d043a85c85c28221f19cfc5d4
742351fbcfeaf8f4343aa375ddac9104f69e5c38
/moderate/minimum_coins.cpp
c6edbe1e0eb2231730f8176cfccd158a9f76477d
[]
no_license
leogargu/CodeEval
a0125edf0f1b4b88a4935f7e011145c485aa6223
016a26b2ca6cec8c37cdde8c1a7d9babc6d49a52
refs/heads/master
2016-09-05T14:30:59.736108
2015-04-01T09:56:31
2015-04-01T09:56:31
30,794,313
0
0
null
null
null
null
UTF-8
C++
false
false
692
cpp
minimum_coins.cpp
#include <iostream> #include <fstream> #include <string> #include<assert.h> /*Challenge description: https://www.codeeval.com/open_challenges/74/ */ /* Format of input file is not checked */ int main(int argc, char ** argv){ std::ifstream ifs; ifs.open(argv[1]); if(!ifs.is_open()){ return 1; } std::string line; int num; int five,three,one; //number of each type of coin needed while( std::getline(ifs,line) ){ num = std::stoi(line); five = num/5; //integer division three = (num - 5*five)/3; //integer division one = num - five *5 - three*3; assert(5*five+3*three+one==num); std::cout << five + three + one << std::endl; } ifs.close(); return 0; }
829d64628e271ed7a1092264d979deb8db0a342a
f3f2ba52c2ba8d7a93a8c5a436db8adda143dd99
/Arduino/i2c_base/i2c_base.ino
fd0edf4e9c00c12b7c27724026383e022b6540b4
[]
no_license
ghaed/Bluetooth-Chip-Control
696f33d05f3b0114ae6f83960155ddf761270eeb
83c0299cf7cf9f9c27c6591073f5b1161314a1f2
refs/heads/master
2021-06-06T18:51:40.060256
2016-10-11T01:08:23
2016-10-11T01:08:23
66,211,997
0
0
null
null
null
null
UTF-8
C++
false
false
1,871
ino
i2c_base.ino
// Arduino Bluetooth LE Servo Controlled by iOS #define i2c_wr_addr 0x64 // 0xC8 write, 0xC9 read, 0x64 address #define i2c_rd_addr 0x64 //#define regaddr_chipid [0x0,0x8] // Should read 0x03FC #include <SoftwareSerial.h> #include <Wire.h> int LED = 13; // Most Arduino boards have an onboard LED on pin 13 //SoftwareSerial BLE_Shield(4,5); void setup() // Called only once per startup { Serial.begin(9600); pinMode(LED, OUTPUT); // Set pin as an output digitalWrite(LED, HIGH); // Turn on LED (ie set to HIGH voltage) // BLE_Shield.begin(9600); // Setup the serial port at 9600 bps. This is the BLE Shield default baud rate. Wire.begin(); // join i2c bus (address optional for master) } void loop() // Continuous loop { int ntx, nrx; char regaddr_chipid[2] = {0x8, 0x0}; // See if new position data is available // if (BLE_Shield.available()) { // myservo.write(BLE_Shield.read()); // Write position to servo // } Serial.println("*Beginning Loop"); /* Write register address */ Wire.beginTransmission(i2c_wr_addr); // transmit to device #8 ntx = Wire.write(regaddr_chipid, 2); // sends five bytes Wire.endTransmission(); Serial.print("Number of Bytes written:"); Serial.println(ntx); /* Receive Register Contents */ Wire.requestFrom(i2c_rd_addr, 2); // request 1 bytes from slave device #8 // char c = Wire.read(); // receive a byte as character // Serial.println(c, HEX); // print the character nrx = 0; while (Wire.available()) { // slave may send less than requested Serial.print("Receiving byte number:"); Serial.println(nrx); nrx = nrx + 1; int c = Wire.read(); // receive a byte as character Serial.println(c, HEX); // print the character } Serial.print("Total Number of bytes received: "); Serial.println(nrx); delay(20000); }
e0e08a42fd8712568ef2b37efd4304c93bb71c00
38bf3927fd7454f290b08e33b8317a09a3901d2e
/Weather_Station/dialog.h
194e2db6d10ce5524a3e2ccb985d1dfc65c8ec55
[]
no_license
GPiter/hello-world
d736e87a4747f1bdf3b26fef040eaf8b9cf9d8c3
d6407c236e11101b58594d0020502a65a7705b64
refs/heads/master
2022-05-06T21:26:52.229527
2022-03-19T14:22:59
2022-03-19T14:22:59
183,016,769
0
0
null
2019-04-23T13:21:27
2019-04-23T13:05:06
null
UTF-8
C++
false
false
644
h
dialog.h
#ifndef DIALOG_H #define DIALOG_H #include <QDialog> #include <QSerialPort> #include <QByteArray> #include <QFile> namespace Ui { class Dialog; } class Dialog : public QDialog { Q_OBJECT public: explicit Dialog(QWidget *parent = 0); ~Dialog(); private slots: void readSerial(); void updateTemperature(QString); void updateHumidity(QString); private: Ui::Dialog *ui; QSerialPort *arduino; static const quint16 arduino_vendor_id = 6790; static const quint16 arduino_product_id = 29987; QByteArray serialData; QString parsed_temperature; QString parsed_humidity; }; #endif // DIALOG_H
9ce4e08f83ca2168524f43be70e7395533a43c18
3194c789afb2624404b12e4ba9b7bf727ce0f23e
/exception/main.cpp
0ba6073ae84a27d83790bf6dacfbf4feebb83171
[]
no_license
XzoRit/boost_playground
2de9e3494e2c5e7ade0e1f0c906ec11ad4aea063
7a96d7bb6ef033a4de05b6abba7479640f5bd256
refs/heads/master
2021-12-03T17:54:21.335070
2021-11-21T12:33:13
2021-11-21T12:33:13
56,172,870
0
1
null
2020-12-31T16:24:27
2016-04-13T17:35:32
JavaScript
UTF-8
C++
false
false
87
cpp
main.cpp
#define BOOST_TEST_MODULE test_exceptions #include <boost/test/included/unit_test.hpp>
ea4103b19b21cafb6e2322aad5dec1cf8d688f90
bdd6218202aed4cb73ecbcb0aa38da5a98710d9f
/FlameTest/FlameTest.cpp
5fd736f27b29dac5c6843f9d95c2f0f57bd8cd3f
[]
no_license
inficity/Flame
0be3e1f519c8ab4dba31e7e469d9ea2d49bda2fa
5ed67ae0a8580dc35f00e76ba8e67b46b776436a
refs/heads/master
2021-01-10T21:20:58.824014
2015-05-20T11:21:06
2015-05-20T11:21:06
35,937,827
0
0
null
null
null
null
UHC
C++
false
false
4,523
cpp
FlameTest.cpp
// FlameTest.cpp : Defines the entry point for the console application. // #include "stdafx.h" using namespace boost; using namespace coroutines; using namespace std; typedef symmetric_coroutine<void>::call_type CoCall; typedef symmetric_coroutine<void>::yield_type CoYield; class Component { public: virtual const char* GetComponentName() = 0; virtual ~Component() {} }; class Message { }; class OnEnterStage : public Message { }; typedef list<function<void(Component*, Message*)>> HandlerList; hash_map<const char*, HandlerList*> GMessageHandlers; class Actor { public: }; class Entity { public: vector<Component*> _Components; template<typename T> T& Get() { return nullptr; } void Post(Message* msg) { for each(auto& com in _Components) { auto it = GMessageHandlers.find(com->GetComponentName()); if (it != GMessageHandlers.end()) { for each (auto& msgHandler in *it->second) { msgHandler(com, msg); } } } } }; template<typename ComTy, typename MsgTy> void MessageHandlerCallProxy(void (ComTy::*handler)(MsgTy*), Component *pCom, Message *pMsg) { (static_cast<ComTy*>(pCom)->*handler)(static_cast<MsgTy*>(pMsg)); } template<typename ComTy> class BaseComponent : public Component { protected: static const char* ComponentName() { return typeid(ComTy).raw_name(); } template<typename MsgTy> static void RegisterHandler(void (ComTy::*handler)(MsgTy*)) { HandlerList* handlerList = nullptr; auto it = GMessageHandlers.find(ComponentName()); if (it == GMessageHandlers.end()) { handlerList = new HandlerList; GMessageHandlers[ComponentName()] = handlerList; } else handlerList = it->second; handlerList->push_back(bind(MessageHandlerCallProxy<ComTy, MsgTy>, handler, placeholders::_1, placeholders::_2)); } public: virtual const char* GetComponentName() override { return ComponentName(); } }; class CharacterCom : public BaseComponent<CharacterCom> { public: void OnMessage(OnEnterStage *msg) { cout << "테스트" << endl; } static void RegisterHandlers() { RegisterHandler(&OnMessage); } }; Entity* CreateCharacterEntity() { auto obj = new Entity; //obj->_Components = new Component*[1]; obj->_Components.push_back(new CharacterCom); return obj; } int _tmain(int argc, _TCHAR* argv[]) { auto e = CreateCharacterEntity(); CharacterCom::RegisterHandlers(); //cout << typeid(CharacterCom).raw_name() << endl; //cout << typeid(CharacterCom).name() << endl; e->Post(new Message); return 0; } /* C++/CLI Lib 버전 using namespace boost; using namespace coroutines; using namespace std; typedef symmetric_coroutine<void>::call_type CoCall; typedef symmetric_coroutine<void>::yield_type CoYield; ref class CoContext; __declspec(thread) gcroot<CoContext^>* CurrentContext = nullptr; __declspec(thread) CoYield* CurrentYield = nullptr; static void ProcessCoroutine(gcroot<System::Action^>* ptrAction, CoYield& yield) { System::Action^ action = *ptrAction; CurrentYield = &yield; action(); delete ptrAction; } public ref class CoContext { CoCall* CallContext = nullptr; public: CoContext(System::Action^ action, int stackSize, bool protectedStack, bool preserveFpu, bool stackUnwind) { attributes attr(stackSize == 0 ? stack_allocator::traits_type::default_size() : stackSize); attr.preserve_fpu = preserveFpu ? fpu_preserved : fpu_not_preserved; attr.do_unwind = stackUnwind ? stack_unwind : no_stack_unwind; if (protectedStack) CallContext = new CoCall(bind(ProcessCoroutine, new gcroot<System::Action^>(action), placeholders::_1), attr, protected_stack_allocator()); else CallContext = new CoCall(bind(ProcessCoroutine, new gcroot<System::Action^>(action), placeholders::_1), attr, stack_allocator()); } CoContext(System::Action^ action) { CallContext = new CoCall(bind(ProcessCoroutine, new gcroot<System::Action^>(action), placeholders::_1)); } ~CoContext() { delete CallContext; } bool Next() { if (!*CallContext) return false; auto oldContext = CurrentContext; auto context = new gcroot<CoContext^>(this); CurrentContext = context; (*CallContext)(); delete context; CurrentContext = oldContext; if (*CallContext) return true; return false; } static bool Yield_() { if (CurrentYield) { auto yield = CurrentYield; (*yield)(); CurrentYield = yield; return true; } return false; } static CoContext^ GetCurrent() { if (CurrentContext) return *CurrentContext; return nullptr; } }; */
54ce906bb3bd2e1019a4a5a5be10575e8a23539b
e7c45d18fa1e4285e5227e5984e07c47f8867d1d
/Common/Scd/XYLib/TRINET.H
7a96930540f9428b366829d766d15b8a1b40bff0
[]
no_license
abcweizhuo/Test3
0f3379e528a543c0d43aad09489b2444a2e0f86d
128a4edcf9a93d36a45e5585b70dee75e4502db4
refs/heads/master
2021-01-17T01:59:39.357645
2008-08-20T00:00:29
2008-08-20T00:00:29
null
0
0
null
null
null
null
UTF-8
C++
false
false
3,859
h
TRINET.H
//================== SysCAD - Copyright Kenwalt (Pty) Ltd =================== // $Nokeywords: $ //=========================================================================== // SysCAD Copyright Kenwalt (Pty) Ltd 1992 #ifndef __TRINET_H #define __TRINET_H //#include <stdlib.h> //#include <assert.h> operator #ifndef __SC_DEFS_H #include "sc_defs.h" #endif #undef DllImportExport /* already defined */ #ifdef __TRINET_CPP #define DllImportExport DllExport #elif !defined(XYLIB) #define DllImportExport DllImport #else #define DllImportExport #endif class pnt { public: double x; double y; double z; pnt *nxt; }; class tri { public: pnt *p0; pnt *p1; pnt *p2; double x; double y; double r; double r2; }; class edg { public: pnt *p0; pnt *p1; }; #undef DllImportExport #ifdef __TRINET_CPP #define DllImportExport DllExport #elif !defined(XYLIB) #define DllImportExport DllImport #else #define DllImportExport #endif #define DET(a11,a12,a21,a22) (((a11) * (a22)) - ((a21) * (a12))) //============================================================================ #define TRI_DELTA 20 #define EDG_DELTA 20 //#define PNT_DELTA 4 class DllImportExport TriNet { protected: tri *t_l; // The triangle list int n_tri; int m_tri; int c_tri; pnt *p_l; // The point list //int n_pnt; //int m_pnt; edg *e_l; // The edge list int n_edg; int m_edg; int n_delete; double xmin,xmax,ymin,ymax; void add_edg(tri *t); pnt * add_pnt(double x,double y,double z); int calc_circ(tri *t); int delete_tri(int i); int add_tri(pnt *p0,pnt *p1,pnt *p2); tri * FindTriangle(double x,double y); int mk_new_tri(double x,double y,double z); //int TriNet::flush_tri(int i); //int TriNet::flush_delnet(); public: TriNet(double x1 = -10000.0,double y1 = -10000.0,double x2 = 10000.0,double y2 = 10000.0); ~TriNet(); void Clear(); // Not appropriate since the pnt list is referenced by the tri list and // a pure copy is no good. //TriNet& operator=(const TriNet &v); int Valid(); int AddVertex(double x,double y,double z,int fast); void InitTriNet(double x1 = -10000.0,double y1 = -10000.0,double x2 = 10000.0,double y2 = 10000.0); int TriangleCount(); int GetZ(int TriNo,double x,double y,double &z);//bga int Getr(int TriNo,double &r);//bga int XYZonplane(double x,double y,double &z); int first_triangle(double &x1,double &y1,double &z1,// never tested double &x2,double &y2,double &z2, double &x3,double &y3,double &z3); int next_triangle(double &x1,double &y1,double &z1, // never tested double &x2,double &y2,double &z2, double &x3,double &y3,double &z3); }; #endif
dade3fc64cbacd9a972b5901f1b8a2e496306a1e
91a4a1a6a28dfe462e7ce57d462b606fe0f71e27
/Source/TMDCenterPanel.cpp
6f07ceb2abd94b80e369022aa35f8c8387d76ee3
[]
no_license
mcfredrick/TimeMachineDelay
f116e7dea3482424f1134c6d12bf8658e910e7de
5c6fc0f721afee4456a17f93df0cac177d4201ab
refs/heads/master
2020-06-18T08:29:44.506227
2019-08-23T16:41:04
2019-08-23T16:41:04
196,233,012
2
0
null
null
null
null
UTF-8
C++
false
false
847
cpp
TMDCenterPanel.cpp
/* ============================================================================== TMDCenterPanel.cpp Created: 4 Jul 2019 3:39:58pm Author: Matt ============================================================================== */ #include "TMDCenterPanel.h" TMDCenterPanel::TMDCenterPanel(TimeMachineDelayAudioProcessor* inProcessor) : TMDPanelBase(inProcessor) { setSize(CENTER_PANEL_WIDTH, CENTER_PANEL_HEIGHT); mMenuBar = new TMDCenterPanelMenuBar(inProcessor); mMenuBar->setTopLeftPosition(0, 0); addAndMakeVisible(mMenuBar); mFxPanel = new TMDEffectsPanel(inProcessor); mFxPanel->setTopLeftPosition(0, CENTER_PANEL_MENU_BAR_HEIGHT); addAndMakeVisible(mFxPanel); mMenuBar->addEffectsTypeComboBoxListener(mFxPanel); } TMDCenterPanel::~TMDCenterPanel() { mMenuBar->removeEffectsTypeComboBoxListener(mFxPanel); }
18461cb9e569c3498b96158e79b9437e662cb623
9f81d77e028503dcbb6d7d4c0c302391b8fdd50c
/google/cloud/bigquery/biglake/v1/internal/metastore_logging_decorator.cc
c9cef2db147424a277b2095e4974cdbe5d155e84
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
googleapis/google-cloud-cpp
b96a6ee50c972371daa8b8067ddd803de95f54ba
178d6581b499242c52f9150817d91e6c95b773a5
refs/heads/main
2023-08-31T09:30:11.624568
2023-08-31T03:29:11
2023-08-31T03:29:11
111,860,063
450
351
Apache-2.0
2023-09-14T21:52:02
2017-11-24T00:19:31
C++
UTF-8
C++
false
false
9,268
cc
metastore_logging_decorator.cc
// Copyright 2023 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 // // https://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. // Generated by the Codegen C++ plugin. // If you make any local changes, they will be lost. // source: google/cloud/bigquery/biglake/v1/metastore.proto #include "google/cloud/bigquery/biglake/v1/internal/metastore_logging_decorator.h" #include "google/cloud/internal/log_wrapper.h" #include "google/cloud/status_or.h" #include <google/cloud/bigquery/biglake/v1/metastore.grpc.pb.h> #include <memory> namespace google { namespace cloud { namespace bigquery_biglake_v1_internal { GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_BEGIN MetastoreServiceLogging::MetastoreServiceLogging( std::shared_ptr<MetastoreServiceStub> child, TracingOptions tracing_options, std::set<std::string> const& components) : child_(std::move(child)), tracing_options_(std::move(tracing_options)), stream_logging_(components.find("rpc-streams") != components.end()) {} StatusOr<google::cloud::bigquery::biglake::v1::Catalog> MetastoreServiceLogging::CreateCatalog( grpc::ClientContext& context, google::cloud::bigquery::biglake::v1::CreateCatalogRequest const& request) { return google::cloud::internal::LogWrapper( [this](grpc::ClientContext& context, google::cloud::bigquery::biglake::v1::CreateCatalogRequest const& request) { return child_->CreateCatalog(context, request); }, context, request, __func__, tracing_options_); } StatusOr<google::cloud::bigquery::biglake::v1::Catalog> MetastoreServiceLogging::DeleteCatalog( grpc::ClientContext& context, google::cloud::bigquery::biglake::v1::DeleteCatalogRequest const& request) { return google::cloud::internal::LogWrapper( [this](grpc::ClientContext& context, google::cloud::bigquery::biglake::v1::DeleteCatalogRequest const& request) { return child_->DeleteCatalog(context, request); }, context, request, __func__, tracing_options_); } StatusOr<google::cloud::bigquery::biglake::v1::Catalog> MetastoreServiceLogging::GetCatalog( grpc::ClientContext& context, google::cloud::bigquery::biglake::v1::GetCatalogRequest const& request) { return google::cloud::internal::LogWrapper( [this](grpc::ClientContext& context, google::cloud::bigquery::biglake::v1::GetCatalogRequest const& request) { return child_->GetCatalog(context, request); }, context, request, __func__, tracing_options_); } StatusOr<google::cloud::bigquery::biglake::v1::ListCatalogsResponse> MetastoreServiceLogging::ListCatalogs( grpc::ClientContext& context, google::cloud::bigquery::biglake::v1::ListCatalogsRequest const& request) { return google::cloud::internal::LogWrapper( [this](grpc::ClientContext& context, google::cloud::bigquery::biglake::v1::ListCatalogsRequest const& request) { return child_->ListCatalogs(context, request); }, context, request, __func__, tracing_options_); } StatusOr<google::cloud::bigquery::biglake::v1::Database> MetastoreServiceLogging::CreateDatabase( grpc::ClientContext& context, google::cloud::bigquery::biglake::v1::CreateDatabaseRequest const& request) { return google::cloud::internal::LogWrapper( [this](grpc::ClientContext& context, google::cloud::bigquery::biglake::v1::CreateDatabaseRequest const& request) { return child_->CreateDatabase(context, request); }, context, request, __func__, tracing_options_); } StatusOr<google::cloud::bigquery::biglake::v1::Database> MetastoreServiceLogging::DeleteDatabase( grpc::ClientContext& context, google::cloud::bigquery::biglake::v1::DeleteDatabaseRequest const& request) { return google::cloud::internal::LogWrapper( [this](grpc::ClientContext& context, google::cloud::bigquery::biglake::v1::DeleteDatabaseRequest const& request) { return child_->DeleteDatabase(context, request); }, context, request, __func__, tracing_options_); } StatusOr<google::cloud::bigquery::biglake::v1::Database> MetastoreServiceLogging::UpdateDatabase( grpc::ClientContext& context, google::cloud::bigquery::biglake::v1::UpdateDatabaseRequest const& request) { return google::cloud::internal::LogWrapper( [this](grpc::ClientContext& context, google::cloud::bigquery::biglake::v1::UpdateDatabaseRequest const& request) { return child_->UpdateDatabase(context, request); }, context, request, __func__, tracing_options_); } StatusOr<google::cloud::bigquery::biglake::v1::Database> MetastoreServiceLogging::GetDatabase( grpc::ClientContext& context, google::cloud::bigquery::biglake::v1::GetDatabaseRequest const& request) { return google::cloud::internal::LogWrapper( [this](grpc::ClientContext& context, google::cloud::bigquery::biglake::v1::GetDatabaseRequest const& request) { return child_->GetDatabase(context, request); }, context, request, __func__, tracing_options_); } StatusOr<google::cloud::bigquery::biglake::v1::ListDatabasesResponse> MetastoreServiceLogging::ListDatabases( grpc::ClientContext& context, google::cloud::bigquery::biglake::v1::ListDatabasesRequest const& request) { return google::cloud::internal::LogWrapper( [this](grpc::ClientContext& context, google::cloud::bigquery::biglake::v1::ListDatabasesRequest const& request) { return child_->ListDatabases(context, request); }, context, request, __func__, tracing_options_); } StatusOr<google::cloud::bigquery::biglake::v1::Table> MetastoreServiceLogging::CreateTable( grpc::ClientContext& context, google::cloud::bigquery::biglake::v1::CreateTableRequest const& request) { return google::cloud::internal::LogWrapper( [this](grpc::ClientContext& context, google::cloud::bigquery::biglake::v1::CreateTableRequest const& request) { return child_->CreateTable(context, request); }, context, request, __func__, tracing_options_); } StatusOr<google::cloud::bigquery::biglake::v1::Table> MetastoreServiceLogging::DeleteTable( grpc::ClientContext& context, google::cloud::bigquery::biglake::v1::DeleteTableRequest const& request) { return google::cloud::internal::LogWrapper( [this](grpc::ClientContext& context, google::cloud::bigquery::biglake::v1::DeleteTableRequest const& request) { return child_->DeleteTable(context, request); }, context, request, __func__, tracing_options_); } StatusOr<google::cloud::bigquery::biglake::v1::Table> MetastoreServiceLogging::UpdateTable( grpc::ClientContext& context, google::cloud::bigquery::biglake::v1::UpdateTableRequest const& request) { return google::cloud::internal::LogWrapper( [this](grpc::ClientContext& context, google::cloud::bigquery::biglake::v1::UpdateTableRequest const& request) { return child_->UpdateTable(context, request); }, context, request, __func__, tracing_options_); } StatusOr<google::cloud::bigquery::biglake::v1::Table> MetastoreServiceLogging::RenameTable( grpc::ClientContext& context, google::cloud::bigquery::biglake::v1::RenameTableRequest const& request) { return google::cloud::internal::LogWrapper( [this](grpc::ClientContext& context, google::cloud::bigquery::biglake::v1::RenameTableRequest const& request) { return child_->RenameTable(context, request); }, context, request, __func__, tracing_options_); } StatusOr<google::cloud::bigquery::biglake::v1::Table> MetastoreServiceLogging::GetTable( grpc::ClientContext& context, google::cloud::bigquery::biglake::v1::GetTableRequest const& request) { return google::cloud::internal::LogWrapper( [this](grpc::ClientContext& context, google::cloud::bigquery::biglake::v1::GetTableRequest const& request) { return child_->GetTable(context, request); }, context, request, __func__, tracing_options_); } StatusOr<google::cloud::bigquery::biglake::v1::ListTablesResponse> MetastoreServiceLogging::ListTables( grpc::ClientContext& context, google::cloud::bigquery::biglake::v1::ListTablesRequest const& request) { return google::cloud::internal::LogWrapper( [this](grpc::ClientContext& context, google::cloud::bigquery::biglake::v1::ListTablesRequest const& request) { return child_->ListTables(context, request); }, context, request, __func__, tracing_options_); } GOOGLE_CLOUD_CPP_INLINE_NAMESPACE_END } // namespace bigquery_biglake_v1_internal } // namespace cloud } // namespace google
587f797fc2993246261279a57844ca1edadd28e8
3ee66221b91f44f1b07168fa7b42e1c8b87df6ad
/graph/bfs.cpp
e232aa8628ec237e5f14f8348cd8c7c504796f5f
[]
no_license
mukultarania/CP
c24e3484488b7779475d06be5082b3928ab5258c
c3bc0c3575310962c0c8887299b883150f87c03a
refs/heads/master
2023-06-05T06:35:22.711199
2021-06-22T12:26:51
2021-06-22T12:26:51
296,132,547
0
0
null
null
null
null
UTF-8
C++
false
false
1,232
cpp
bfs.cpp
//GRAPH // 7 7 // 1 2 // 1 3 // 2 4 // 2 5 // 2 6 // 2 7 // 7 3 #include<bits/stdc++.h> using namespace std; void c_p_c() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); #ifndef ONLINE_JUDGE freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); #endif } const int N = 1e5 + 2; bool vis[N]; vector<int> adj[N]; int main() { c_p_c(); for (int i = 0; i < N; i++) vis[i] = 0; int n, m; cin >> n >> m; int x, y; for (int i = 0; i < m; i++) { cin >> x >> y; adj[x].push_back(y); adj[y].push_back(x); } for (int i = 0; i <= n ; i++) { cout << i << " -> "; vector<int> :: iterator it; for (it = adj[i].begin(); it != adj[i].end(); it++) cout << *it << " "; cout << endl; } //BFS cout << "\nBFS" << endl; queue<int> q; q.push(1); vis[1] = true; while (!q.empty()) { int node = q.front(); q.pop(); cout << node << endl; vector<int> :: iterator it; for (it = adj[node].begin(); it != adj[node].end(); it++) { if (!vis[*it]) { vis[*it] = 1; q.push(*it); } } } return 0; }
1ef3cd09c857983b94811a6ae9df592ff8720f70
2d362cece0f22772838a925a66785c67182a0127
/gameinfodialog.cpp
6e6edc382da4d4929f02614294821f604590b33f
[ "MIT" ]
permissive
FusionLauncher/FusionClient
4086715078bd4f19de24a0b0f936f5d2db3a7ef2
c651e2c868d81bc810ad26493a4b9a143ddccee7
refs/heads/master
2021-01-18T22:41:30.477756
2016-05-27T17:39:11
2016-05-27T17:39:11
34,925,198
6
16
null
2016-05-27T17:38:28
2015-05-01T21:36:56
C++
UTF-8
C++
false
false
7,870
cpp
gameinfodialog.cpp
#include "gameinfodialog.h" #include "ui_gameinfodialog.h" #include "gamedbartselectordialog.h" #include <fartmanager.h> #include <QMessageBox> #include <QFileDialog> #include <QDesktopServices> #include <QFileInfo> #include <fdb.h> GameInfoDialog::GameInfoDialog(FGame *g, FDB *database, QWidget *parent) : QDialog(parent), ui(new Ui::GameInfoDialog) { ui->setupUi(this); game = g; this->db = database; ui->le_Title->setText(game->getName()); ui->le_Exec->setText(game->getExe()); ui->le_Directory->setText(game->getPath()); ui->le_Type->setText(FGame::FGameTypeToStr(game->getType())); QString args; for(int i=0;i<game->getArgs().length();++i) args += " " + game->getArgs()[i]; ui->le_Params->setText(args); runningDownloads = 0; totalDownloads = 0; lastDir = "/"; ui->aw_la_Cover->setStyleSheet("#aw_la_Cover{border-image:url("+ game->getArt(FArtBox) +") 0 0 0 0 stretch stretch}"); ui->aw_la_Banner->setStyleSheet("#aw_la_Banner{border-image:url("+ game->getArt(FArtBanner) +") 0 0 0 0 repeat stretch}"); ui->aw_la_Clearart->setStyleSheet("#aw_la_Clearart{border-image:url("+ game->getArt(FArtClearart) +") 0 0 0 0 stretch stretch}"); ui->aw_la_Fanart->setStyleSheet("#aw_la_Fanart{border-image:url("+ game->getArt(FArtFanart) +") 0 0 0 0 stretch stretch}"); QList<FLauncher> launchers = db->getLaunchers(); for(int i = 0; i < launchers.length(); i++) { FLauncher launcher = launchers.at(i); ui->launcherComboBox->addItem(launcher.getName(), QVariant(launcher.getDbId())); } if(game->doesUseLauncher()) { qDebug() << "Current launcher:" << game->getLauncher().getName() << ", id:" << game->getLauncher().getDbId(); qDebug() << "Game is using launcher."; ui->launcherCheckBox->setChecked(true); ui->launcherComboBox->setEnabled(true); ui->launcherComboBox->setCurrentIndex(game->getLauncher().getDbId()-1); } //Savegame-Sync /* if(game->savegameSyncEndabled()) { ui->cb_useSavegameSync->setChecked(true); ui->le_savegameDir->setEnabled(true); ui->le_savegameDir->setText(game->getSavegameDir().absolutePath()); ui->pb_setSavegameDir->setEnabled(true); } else { ui->cb_useSavegameSync->setChecked(false); ui->le_savegameDir->setEnabled(false); ui->pb_setSavegameDir->setEnabled(false); } */ } void GameInfoDialog::on_chooseGameDirButton_clicked() { QDir gameDir = QFileDialog::getExistingDirectory(this, tr("Choose the game directory"), ui->le_Directory->text()); if(gameDir.dirName()!=".") ui->le_Directory->setText(gameDir.absolutePath()); } void GameInfoDialog::on_pb_deleteGame_clicked() { QMessageBox::StandardButton btn = QMessageBox::warning(this, tr("Really delete game?"), tr("Are you sure you want to delete") + "\"" + game->getName() + "\"?", QMessageBox::Yes|QMessageBox::No); if(btn == QMessageBox::Yes) { db->removeGameById(game->dbId); emit reloadRequired(); this->close(); } } void GameInfoDialog::on_chooseGameExecutableButton_clicked() { QString file; QDir gameDir = QDir(ui->le_Directory->text()); file = QFileDialog::getOpenFileName(this, tr("Choose executable"), gameDir.absolutePath()); if(file.isEmpty()) return; file = gameDir.relativeFilePath(file); ui->le_Exec->setText(file); } GameInfoDialog::~GameInfoDialog() { delete ui; } void GameInfoDialog::on_downloadArtButton_clicked() { FArtManager *artmanager = new FArtManager(); connect(artmanager, SIGNAL(startedDownload()), this, SLOT(downloadStarted())); connect(artmanager, SIGNAL(finishedDownload()), this, SLOT(downloadFinished())); connect(artmanager, SIGNAL(foundMultipleGames(QList<TheGameDBStorage*>)), this, SLOT(on_foundMultipleGames(QList<TheGameDBStorage*>))); artmanager->getGameData(game, "PC"); ui->label_2->setText(tr("Searching for artwork...")); } void GameInfoDialog::on_ShowArtworkFolder_clicked() { QDesktopServices::openUrl(game->getArtworkDir()); } void GameInfoDialog::openFile(QString destFileName) { QFileInfo fi; QString file = QFileDialog::getOpenFileName(this, tr("Choose artwork"), lastDir, "Images (*.png *.jpg)"); if(file.isEmpty()) return; else { fi = QFileInfo(file); lastDir = fi.absoluteFilePath(); if(fi.exists()) { FArtManager fa(game); fa.importArtwork(fi, destFileName); } } } void GameInfoDialog::on_importBannerButton_clicked() { openFile(FGame::FGameArtToStr(FArtBanner)); } void GameInfoDialog::on_importClearartButton_clicked() { openFile(FGame::FGameArtToStr(FArtClearart)); } void GameInfoDialog::on_importCoverButton_clicked() { openFile(FGame::FGameArtToStr(FArtBox)); } void GameInfoDialog::on_importFanartButton_clicked() { openFile(FGame::FGameArtToStr(FArtFanart)); } void GameInfoDialog::on_foundMultipleGames(QList<TheGameDBStorage*> Games) { GameDBArtSelectorDialog *dialog = new GameDBArtSelectorDialog(Games, this); connect(dialog, SIGNAL(gameSelected(TheGameDBStorage*)), this, SLOT(on_gameSelected(TheGameDBStorage*))); dialog->exec(); } void GameInfoDialog::on_gameSelected(TheGameDBStorage* selectedGame) { FArtManager *artmanager = new FArtManager(); connect(artmanager, SIGNAL(startedDownload()), this, SLOT(downloadStarted())); connect(artmanager, SIGNAL(finishedDownload()), this, SLOT(downloadFinished())); connect(artmanager, SIGNAL(foundMultipleGames(QList<TheGameDBStorage*>)), this, SLOT(on_foundMultipleGames(QList<TheGameDBStorage*>))); artmanager->getGameData(game, selectedGame); } void GameInfoDialog::on_buttonBox_accepted() { game->setName(ui->le_Title->text()); game->setExe(ui->le_Exec->text()); game->setPath(ui->le_Directory->text()); qDebug() << "Updating game."; if(ui->launcherCheckBox->isChecked()) { game->setLauncher(db->getLauncher(ui->launcherComboBox->itemData(ui->launcherComboBox->currentIndex()).toInt())); qDebug() << "Launcher set, id:" << game->getLauncher().getDbId() << ", name:" << game->getLauncher().getName() << ", boxId:" << ui->launcherComboBox->itemData(ui->launcherComboBox->currentIndex()).toInt(); } else { game->disableLauncher(); } game->setArgs(QStringList(ui->le_Params->text())); if(ui->cb_useSavegameSync->checkState()) { game->setSavegameDir(ui->le_savegameDir->text()); } else { game->setSavegameDir(""); } db->updateGame(game); emit reloadRequired(); } void GameInfoDialog::downloadFinished() { --runningDownloads; ui->label_2->setText(tr("Running downloads:") + QString::number(runningDownloads)); if(runningDownloads<=0) QMessageBox::information(this, tr("Downloads finished"), tr("Finished %n download(s)", 0, totalDownloads)); } void GameInfoDialog::downloadStarted() { ++runningDownloads; ++totalDownloads; ui->label_2->setText(tr("Running downloads:") + QString::number(runningDownloads)); } void GameInfoDialog::on_launcherCheckBox_clicked() { ui->launcherComboBox->setEnabled(ui->launcherCheckBox->isChecked()); } void GameInfoDialog::on_pb_setSavegameDir_clicked() { QDir gameDir = QFileDialog::getExistingDirectory(this, tr("Choose the Savegame-Directory"), ui->le_Directory->text()); if(gameDir.dirName()!=".") ui->le_savegameDir->setText(gameDir.absolutePath()); } void GameInfoDialog::on_cb_useSavegameSync_clicked() { ui->cb_useSavegameSync->setChecked(ui->cb_useSavegameSync->checkState()); ui->le_savegameDir->setEnabled(ui->cb_useSavegameSync->checkState()); // ui->pb_setSavegameDir->setEnabled(ui->cb_useSavegameSync->checkState()); }
aa30f1917b6ed926bbdd44d2d97bec60b3670026
9a1e18c88790eb05dfcf4a8f6ef50ade8ff4f731
/objcLib/test/testMany/tmp/byYear1.h
2238ebf2488316940cfe6d89d78bbc0321d861e3
[]
no_license
CodeFarmsInc/QSP
25d6af4d5bfc064f115ade014a39290f7cc02149
031c9fe2ee4008fce3837ed08bff1f6511c26b15
refs/heads/master
2021-01-25T14:58:32.496669
2018-03-04T01:13:45
2018-03-04T01:13:45
123,725,986
0
0
null
null
null
null
UTF-8
C++
false
false
2,530
h
byYear1.h
// -------- data structure DOUBLY LINKED LIST --------------- // EQUIVALENT OF: // template <class Parent,class Child> class byYear_LinkedList // ---------------------------------------------------------- #ifndef ZZ_byYear_LINKED_LIST2_INCLUDED #define ZZ_byYear_LINKED_LIST2_INCLUDED class Student; class Took; // ---------------------------------------------------------- // description of the cooperating classes // ---------------------------------------------------------- class byYear_LinkedList2Parent { public: Took* tail; byYear_LinkedList2Parent(){ tail=NULL; } }; class byYear_LinkedList2Child : public byYear_Ring2Element { public: byYear_LinkedList2Child() : byYear_Ring2Element(){ } }; // the following class is used when Parent==Child class byYear_LinkedList2ParentLinkedList2Child : public byYear_Ring2Element { public: Took* tail; byYear_LinkedList2ParentLinkedList2Child() : byYear_Ring2Element(){ tail=NULL; } }; // ---------------------------------------------------------- class byYear_LinkedList2 : byYear_Ring2 { public: static Took* const tail(Student *p); static Took* const head(Student *p); static void addHead(Student *p, Took *c); static void addTail(Student *p, Took *c); static void append(Student *p,Took *c1, Took *c2); static void insert(Took *c1, Took *c2); static void remove(Student *p, Took *c); static Took* const next(Student *p, Took *c); static Took* const prev(Student *p, Took *c); static Took* const nextRing(Took *c); static Took* const prevRing(Took *c); static void sort(ZZsortFun cmpFun, Student *p); static void merge(Took *s,Took *t,Student *p); static void setTail(Student* p,Took* c,int check); // historical DOL compatible interface static void del(Student *p, Took *c) { remove(p,c); } static void add(Student *p, Took *c) { addHead(p,c);} static void ins(Took *c1, Took *c2) { insert(c1,c2); } static Took* child(Student* p); static void set(Student* p,Took* c){ setTail(p,c,0);} static Took* const fwd(Took *c){return nextRing(c);} static Took* const bwd(Took *c){return prevRing(c);} }; class byYear_LinkedList2Iterator : public byYear_Ring2Iterator { public: byYear_LinkedList2Iterator() : byYear_Ring2Iterator(){} byYear_LinkedList2Iterator(const Student *p) : byYear_Ring2Iterator(){ start(p); } void start(const Student *p); Took* fromHead(Student *p); Took* fromTail(Student *p); }; #endif // ZZ_byYear_LINKED_LIST2_INCLUDED
b93e1860d13319878e686379d94583bcc49c2d37
4e38faaa2dc1d03375010fd90ad1d24322ed60a7
/include/RED4ext/Scripting/Natives/Generated/quest/SetDebugView_NodeType.hpp
691381e062485abef982309adbb22cf29efed647
[ "MIT" ]
permissive
WopsS/RED4ext.SDK
0a1caef8a4f957417ce8fb2fdbd821d24b3b9255
3a41c61f6d6f050545ab62681fb72f1efd276536
refs/heads/master
2023-08-31T08:21:07.310498
2023-08-18T20:51:18
2023-08-18T20:51:18
324,193,986
68
25
MIT
2023-08-18T20:51:20
2020-12-24T16:17:20
C++
UTF-8
C++
false
false
777
hpp
SetDebugView_NodeType.hpp
#pragma once // clang-format off // This file is generated from the Game's Reflection data #include <cstdint> #include <RED4ext/Common.hpp> #include <RED4ext/Scripting/Natives/Generated/quest/EDebugViewMode.hpp> #include <RED4ext/Scripting/Natives/Generated/quest/IRenderFxManagerNodeType.hpp> namespace RED4ext { namespace quest { struct SetDebugView_NodeType : quest::IRenderFxManagerNodeType { static constexpr const char* NAME = "questSetDebugView_NodeType"; static constexpr const char* ALIAS = NAME; quest::EDebugViewMode mode; // 38 uint8_t unk3C[0x40 - 0x3C]; // 3C }; RED4EXT_ASSERT_SIZE(SetDebugView_NodeType, 0x40); } // namespace quest using questSetDebugView_NodeType = quest::SetDebugView_NodeType; } // namespace RED4ext // clang-format on
51e4f1a314652de0545dd720069817088a156411
93e140097e4ac807dbe79b0eadf8ffb79d6cc67a
/client/cpp_spider/sendData.cpp
04b27350c942d82f807a3163ee1a7f22ca9f56f8
[]
no_license
davidmunoz-dev/cpp_spider
b142a886dd086b7b154769bd67eb173d59de7df3
4d202d6d8c09b00faff4ce2c5f55971b71f9dabe
refs/heads/master
2021-09-07T17:35:28.627288
2018-02-26T23:34:09
2018-02-26T23:34:09
116,412,459
0
0
null
null
null
null
UTF-8
C++
false
false
3,094
cpp
sendData.cpp
#include "sendData.h" #include "spider.h" #include <string.h> sendData::sendData() { } sendData::~sendData() { } int sendData::sendKey() { std::string line; std::fstream ofs; int i; int y; i = 0; y = 0; std::lock_guard <std::mutex> lock(myMutex); std::ifstream infile("keylogs.txt"); if (std::getline(infile, line)) { keyboard = new t_paquet; keyboard->opcode = 0x04; TCHAR infoBuf[SHRT_MAX]; DWORD bufcharCount = SHRT_MAX; GetUserName(infoBuf, &bufcharCount); while (infoBuf[i] != 0 && i < 49) keyboard->name[y++] = infoBuf[i++]; keyboard->name[y++] = '@'; GetComputerName(infoBuf, &bufcharCount); i = 0; while (infoBuf[i] != 0 && i < 49) keyboard->name[y++] = infoBuf[i++]; keyboard->name[y++] = 0; fillStruct(line); } else return(SPIDER_ERR); infile.close(); ofs.open("keylogs.txt", std::ios::out | std::ios::trunc); ofs.close(); return (SPIDER_OK); } int sendData::sendMouse() { std::string line; std::fstream ofs; int i; int y; i = 0; y = 0; std::lock_guard <std::mutex> lock(myMutex); std::ifstream infile("mouselogs.txt"); if (std::getline(infile, line)) { this->mouse = new t_paquet; this->mouse->opcode = 0x05; TCHAR infoBuf[SHRT_MAX]; DWORD bufcharCount = SHRT_MAX; GetUserName(infoBuf, &bufcharCount); while (infoBuf[i] != 0 && i < 49) mouse->name[y++] = infoBuf[i++]; mouse->name[y++] = '@'; GetComputerName(infoBuf, &bufcharCount); i = 0; while (infoBuf[i] != 0 && i < 49) mouse->name[y++] = infoBuf[i++]; mouse->name[y++] = 0; fillStruct(line); } else return (SPIDER_ERR); infile.close(); ofs.open("mouselogs.txt", std::ios::out | std::ios::trunc); ofs.close(); return (SPIDER_OK); } int sendData::fillStruct(std::string line) { std::istringstream token1(line); int type = 0; std::cout << "line -> " << line << std::endl; token1 >> type; if (type == KEYBOARD_DATA) { token1 >> this->keyboard->timestamp; std::string delimiter = " "; size_t pos = 0; std::string token; while ((pos = line.find(delimiter)) != std::string::npos) { token = line.substr(0, pos); line.erase(0, pos + delimiter.length()); } int i; int y; i = 0; y = 0; while (line[i] != '\0') this->keyboard->k[y++] = line[i++]; this->keyboard->k[y] = '\0'; this->keyboard->key_code = line.at(0); } else if (type == MOUSE_DATA) { std::cout << "line = " << line << std::endl; token1 >> this->mouse->timestamp; token1 >> this->mouse->key_code; token1 >> this->mouse->x; token1 >> this->mouse->y; } return (SPIDER_OK); } void sendData::printData(int type) { if (type == KEYBOARD_DATA) std::cout << keyboard->timestamp << " [KEYBOARD] opcode :" << keyboard->opcode << " | k :" << keyboard->k << std::endl; else if (type == MOUSE_DATA) std::cout << mouse->timestamp << " [MOUSE] opcode :" << mouse->opcode << " | keycode :" << mouse->key_code << " | x:" << mouse->x << " y:" << mouse->y << std::endl; } t_paquet* sendData::getKeyData() const { return (this->keyboard); } t_paquet* sendData::getMouseData() const { return (this->mouse); }
f2d54ebb6912aaa34c10961c6436ffbaedc7ae01
9b5aedf30bacc03b6b7a6d5d2d46e3076427d107
/ZhilinHW5/ZhlinCheng Level 5 HW submission/3.6/3.6.1/3.6.1/Array.hpp
c8ccd733e2dd919675be69c52eefc3b58265f2c5
[]
no_license
ZhilinCheng/ZhiliChengBarcuch
702646827be17a69749399daeec04daff0e88fee
14458970f99e8ad3aabd863d2476c0c852eac34e
refs/heads/master
2020-08-19T09:33:18.346559
2019-10-18T02:07:35
2019-10-18T02:07:35
215,905,151
1
0
null
2019-10-18T01:24:48
2019-10-17T23:47:50
null
UTF-8
C++
false
false
631
hpp
Array.hpp
#ifndef Array_HPP #define Array_HPP #include "Point.hpp" using namespace std; class Array { private: Point* m_data; // Dynamic C array of Point objects int m_size; // Size of the array public: // Con structors Array(); Array(int size); Array(const Array& pp); virtual ~Array(); // Member operator overloading Array& operator = (const Array& source); Point& operator [] (int index); const Point& operator [] (int index) const; // Accessing functions int Size() const; Point& GetElement(int index) const; // Modifiers void SetElement(int index, const Point& newPoint); }; #endif
0e560b773461180d1235d6550530c5da354520b8
05bfb1626df055475a18d28bc99bb9c34064157f
/Lib/include/TBTK/PropertyExtractor/PropertyExtractor.h
b2161e0c3fbed0fee3a3373aef63a036ed2cbdb3
[ "Apache-2.0", "MIT", "BSL-1.0" ]
permissive
undisputed-seraphim/TBTK
8366351c2cae1f0c07647785afa0c64a72292740
45a0875a11da951f900b6fd5e0773ccdf8462915
refs/heads/master
2022-01-25T11:17:13.581537
2021-06-19T10:32:49
2021-06-19T10:32:49
126,213,024
0
0
null
2018-03-21T17:01:57
2018-03-21T17:01:57
null
UTF-8
C++
false
false
35,515
h
PropertyExtractor.h
/* Copyright 2016 Kristofer Björnson * * 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. */ /** @package TBTKcalc * @file PropertyExtractor.h * @brief Base class for PropertyExtractors. * * @author Kristofer Björnson */ #ifndef COM_DAFER45_TBTK_PROPERTY_EXTRACTOR_PROPERTY_EXTRACTOR #define COM_DAFER45_TBTK_PROPERTY_EXTRACTOR_PROPERTY_EXTRACTOR #include "TBTK/Functions.h" #include "TBTK/HoppingAmplitudeSet.h" #include "TBTK/Index.h" #include "TBTK/PersistentObjectReference.h" #include "TBTK/Property/AbstractProperty.h" #include "TBTK/Property/Density.h" #include "TBTK/Property/DOS.h" #include "TBTK/Property/LDOS.h" #include "TBTK/Property/Magnetization.h" #include "TBTK/Property/SpinPolarizedLDOS.h" #include "TBTK/PropertyExtractor/IndexTreeGenerator.h" #include "TBTK/Range.h" #include "TBTK/Solver/Solver.h" #include <complex> //#include <initializer_list> namespace TBTK{ namespace PropertyExtractor{ /** @brief Base class for PropertyExtractors. * * A PropertyExtractor can be used to extract @link Property::AbstractProperty * Properties@endlink from a @link Solver::Solver Solver@endlink. The * PropertyExtractor::PropertyExtractor is a base class for such * @link PropertyExtractor PropertyExtractors@endlink, which each corresponds * to a particular @link Solver::Solver Solver@endlink. See the documentation * for Diagonalizer, BlockDiagonalizer, ArnoldiIterator, and ChebyshevExpander * for examples of specific production ready @link PropertyExtractor * PropertyExtractors@endlink. * * The @link PropertyExtractor::PropertyExtractor PropertyExtractors@endlink * provide a uniform interface to @link Solver::Solver Solvers@endlink and * allow for @link Property::AbstractProperty Properties@endlink to be * extracted with limited knowledge about @link Solver::Solver Solver@endlink * specific details. The use of @link * PropertyExtractor::AbstractPropertyExtractor PropertyExtractors@endlink * also makes it possible to switch between different @link Solver::Solver * Solvers@endlink with minimal changes to the code. * * # Example * \snippet PropertyExtractor/PropertyExtractor.cpp PropertyExtractor */ class PropertyExtractor{ public: /** Constructs a PropertyExtractor::PropertyExtractor. */ PropertyExtractor(); /** Destructor. */ virtual ~PropertyExtractor(); /** Set the energy window used for energy dependent quantities. The * energy window is set to be real. * * @param lowerBound The lower bound for the energy window. * @param upperBound The upper bound for the energy window. * @param energyResolution The number of energy points used to resolve * the energy window. */ virtual void setEnergyWindow( double lowerBound, double upperBound, int energyResolution ); /** Set the energy window used for energy dependent quantities. The * energy window is set to be real. * * @param energyWindow Range specifiying the energy window. */ virtual void setEnergyWindow(const Range &energyWindow); /** Set the energy window used for energy dependent quantities. The * energy window is set to consist of Matsubara energies. * * @param lowerFermionicMatsubaraEnergyIndex The lower Fermionic * Matsubara energy index. * * @param upperFermionicMatsubaraEnergyIndex The upper Fermionic * Matsubara energy index. * * @param lowerBosonicMatsubaraEnergyIndex The lower Bosonic * Matsubara energy index. * * @param upperBosonicMatsubaraEnergyIndex The upper Bosonic * Matsubara energy index. */ virtual void setEnergyWindow( int lowerFermionicMatsubaraEnergyIndex, int upperFermionicMatsubaraEnergyIndex, int lowerBosonicMatsubaraEnergyIndex, int upperBosonicMatsubaraEnergyIndex ); /** Set the size of the energy infinitesimal that can be used to add * for example an \f$i\delta\f$ term to the denominator of the Green's * function. * * @param energyInfinitesimal The energy infinitesimal \f$\delta\f$. */ virtual void setEnergyInfinitesimal(double energyInfinitesimal); /** Calculate the density. This function should be overriden by those * deriving classes that provide support for calculating the density. * By default the PropertyExtractor prints an error message that the * given property is not supported. * * @param pattern Specifies the index pattern for which to calculate * the density. For example, assume that the index scheme is * {x, y, z, spin}. {ID_X, 5, 10, IDX_SUM_ALL} will calculate the * density for each x along (y,z)=(5,10) by summing over spin. * Similarly {ID_X, 5, IDX_Y, IDX_SUM_ALL} will return a two * dimensional density for all x and z and y = 5. Note that IDX_X * IDX_Y, and IDX_Z refers to the first, second, and third index used * by the routine to create a one-, two-, or three-dimensional output, * rather than being tied to the x, y, and z used as physical * subindices. * * @param ranges Speifies the number of elements for each subindex. Is * ignored for indices specified with positive integers in the * pattern, but is used to loop from 0 to the value in ranges for * IDX_X, IDX_Y, IDX_Z, and IDX_SUM_ALL. Appropriate ranges * corresponding to the two pattern examples above are * {SIZE_X, 1, 1, NUM_SPINS} and {SIZE_X, 1, SIZE_Z, NUM_SPINS}, * respectively. * * @return A density array with size equal to the number of points * included by specified patter-range combination. */ virtual Property::Density calculateDensity( Index pattern, Index ranges ); /** Calculate the density. This function should be overriden by those * deriving classes that provide support for calculating the density. * By default the PropertyExtractor prints an error message that the * given property is not supported. * * @param patterns A list of patterns that will be matched against the * @link Index Indices @endlink in the Model to determine which @link * Index Indices @endlink for which to calculate the Density. * * @return A Property::Density for the @link Index Indices @endlink * that match the patterns. */ virtual Property::Density calculateDensity( std::vector<Index> patterns ); /** Calculate the magnetization. This function should be overriden by * those deriving classes that provide support for calculating the * magnetization. By default the PropertyExtractor prints an error * message that the given property is not supported. * * @param pattern Specifies the index pattern for which to calculate * the magnetization. For example, assume that the index scheme is * {x, y, z, spin}. {ID_X, 5, 10, IDX_SPIN} will calculate the * magnetization for each x along (y,z)=(5,10). Similarly * {ID_X, 5, IDX_Y, IDX_SPIN} will return a two dimensional * magnetiation for all x and z and y = 5. Note that IDX_X, IDX_Y, and * IDX_Z refers to the first, second, and third index used by the * routine to create a one-, two-, or three-dimensional output, rather * than being tied to the x, y, and z used as physical subindices. * * @param ranges Speifies the number of elements for each subindex. Is * ignored for indices specified with positive integers in the * pattern, but is used to loop from 0 to the value in ranges for * IDX_X, IDX_Y, IDX_Z, and IDX_SUM_ALL. Appropriate ranges * corresponding to the two pattern examples above are * {SIZE_X, 1, 1, NUM_SPINS} and {SIZE_X, 1, SIZE_Z, NUM_SPINS}, * respectively. * * @return A magnetization array with size equal to four times the * number of points included by specified patter-range combination. * The four entries are * \f[ * \left[\begin{array}{cc} * 0 & 1\\ * 2 & 3 * \end{array}\right] = * \left[\begin{array}{cc} * \langle c_{i\uparrow}^{\dagger}c_{i\uparrow}\rangle & \langle c_{i\uparrow}^{\dagger}c_{i\downarrow}\rangle\\ * \langle c_{i\downarrow}^{\dagger}c_{u\uparrow}\rangle & \langle c_{i\downarrow}^{\dagger}c_{i\downarrow}\rangle * \end{array}\right]. * \f] */ virtual Property::Magnetization calculateMagnetization( Index pattern, Index ranges ); /** Calculate the Magnetization. This function should be overriden by * those deriving classes that provide support for calculating the * magnetization. By default the PropertyExtractor prints an error * message that the given property is not supported. * * @param patterns A list of patterns that will be matched against the * @link Index Indices @endlink in the Model to determine which @link * Index Indices @endlink for which to calculate the Magnetization. * * @return A Property::Magnetization for the @link Index Indices * @endlink that match the patterns. */ virtual Property::Magnetization calculateMagnetization( std::vector<Index> patterns ); /** Calculate the local density of states. This function should be * overriden by those deriving classes that provide support for * calculating the local density of states. By default the * PropertyExtractor prints an error message that the given property * is not supported. * * @param pattern Specifies the index pattern for which to calculate * the LDOS. For example, assume that the index scheme is * {x, y, z, spin}. {ID_X, 5, 10, IDX_SUM_ALL} will calculate the * LDOS for each x along (y,z)=(5,10) by summing over spin. Similarly * {ID_X, 5, IDX_Y, IDX_SUM_ALL} will return a two dimensional LDOS * for all x and z and y = 5. Note that IDX_X, IDX_Y, and IDX_Z refers * to the first, second, and third index used by the routine to create * a one-, two-, or three-dimensional output, rather than being tied * to the x, y, and z used as physical subindices. * * @param ranges Speifies the number of elements for each subindex. Is * ignored for indices specified with positive integers in the * pattern, but is used to loop from 0 to the value in ranges for * IDX_X, IDX_Y, IDX_Z, and IDX_SUM_ALL. Appropriate ranges * corresponding to the two pattern examples above are * {SIZE_X, 1, 1, NUM_SPINS} and {SIZE_X, 1, SIZE_Z, NUM_SPINS}, * respectively. * * @return A density array with size equal to the number of points * included by specified patter-range combination. */ virtual Property::LDOS calculateLDOS(Index pattern, Index ranges); /** Calculate the local density of states. This function should be * overriden by those deriving classes that provide support for * calculating the local density of states. By default the * PropertyExtractor prints an error message that the given property * is not supported. * * @param patterns A list of patterns that will be matched against the * @link Index Indices @endlink in the Model to determine which @link * Index Indices @endlink for which to calculate the local density of * states. * * @return A Property::LDOS for the @link Index Indices @endlink that * match the patterns. */ virtual Property::LDOS calculateLDOS( std::vector<Index> patterns ); /** Calculate the spin-polarized local density of states. This function * should be overriden by those deriving classes that provide support * for calculating the spin-polarized local density of states. By * default the PropertyExtractor prints an error message that the * given property is not supported. * * @param pattern Specifies the index pattern for which to calculate * the spin-polarized LDOS. For example, assume that the index scheme * is {x, y, z, spin}. {ID_X, 5, 10, IDX_SPIN} will calculate the * spin-polarized LDOS for each x along (y,z)=(5,10). Similarly * {ID_X, 5, IDX_Y, IDX_SPIN} will return a two dimensional * spin-polarized LDOS for all x and z and y = 5. Note that IDX_X, * IDX_Y, and IDX_Z refers to the first, second, and third index used * by the routine to create a one-, two-, or three-dimensional output, * rather than being tied to the x, y, and z used as physical * subindices. * * @param ranges Speifies the number of elements for each subindex. Is * ignored for indices specified with positive integers in the * pattern, but is used to loop from 0 to the value in ranges for * IDX_X, IDX_Y, IDX_Z, and IDX_SUM_ALL. Appropriate ranges * corresponding to the two pattern examples above are * {SIZE_X, 1, 1, NUM_SPINS} and {SIZE_X, 1, SIZE_Z, NUM_SPINS}, * respectively. * * @return A spin-polarized LDOS array with size equal to four times * the number of points included by specified patter-range * combination. * The four entries are * \f[ * \left[\begin{array}{cc} * 0 & 1\\ * 2 & 3 * \end{array}\right] = * \left[\begin{array}{cc} * \rho_{i\uparrow i\uparrow}(E) & \rho_{i\uparrow i\downarrow}(E)\\ * \rho_{i\downarrow i\uparrow}(E) & \rho_{i\downarrow i\downarrow}(E)\\ * \end{array}\right], * \f] * where * \f[ * \rho_{i\sigma i\sigma'}(E) = \sum_{E_n}\langle\Psi_n|c_{i\sigma}^{\dagger}c_{i\sigma'}|\Psi_n\rangle\delta(E - E_n) . * \f] */ virtual Property::SpinPolarizedLDOS calculateSpinPolarizedLDOS( Index pattern, Index ranges ); /** Calculate the spin-polarized local density of states. This function * should be overriden by those deriving classes that provide support * for calculating the spin-polarized local density of states. By * default the PropertyExtractor prints an error message that the * given property is not supported. * * @param patterns A list of patterns that will be matched against the * @link Index Indices @endlink in the Model to determine which @link * Index Indices @endlink for which to calculate the spin-polarized * local density of states. * * @return A Property::SpinPolarizedLDOS for the @link Index Indices * @endlink that match the patterns. */ virtual Property::SpinPolarizedLDOS calculateSpinPolarizedLDOS( std::vector<Index> patterns ); /** Calculate the expectation value \f$\langle * c_{to}^{\dagger}c_{from}\f$. This function should be overriden by * those deriving classes that provide support for calculating the * expecation value. By default the PropertyExtractor prints an error * message that the given property is not supported. * * @param to The Index on the left operator. * @param from The index on the right operator. * * @return The expectation value \f$\langle * c_{to}^{\dagger}c_{from}\f$. */ virtual std::complex<double> calculateExpectationValue( Index to, Index from ); /** Calculate the density of states. This function should be overriden * by those deriving classes that provide support for calculating the * density of states. By default the PropertyExtractor prints an error * message that the given property is not supported. * * @return A Property::DOS containing the density of states. */ virtual Property::DOS calculateDOS(); /** Sample the DOS by averaging over the LDOS for multiple random @link * Index Indices@endlink. The resulting DOS is normalized to integrate * to the total number of states in the sample space covered by the * patterns @link Index Indices@endlink. * * @param numSamples The number of samples to use. * @param patterns A list of patterns to randomize over. If the list * is empty (default value), all @link Index Indices@endlink are * randomized over. * * @param seed Seed to use for randomization. * * @return A Property::DOS containing the sampled DOS. */ virtual Property::DOS sampleDOS( unsigned int numSamples, const std::vector<Index> &patterns = {}, unsigned int seed = time(nullptr) ); /** Calculate the entropy. This function should be overriden by those * deriving classes that provide support for calculating the entropy. * By default the PropertyExtractor prints an error message that the * given property is not supported. * * @return The entropy. */ virtual double calculateEntropy(); /** Set the Solver. * * @param solver The @link Solver::Solver Solver@endlink the * PropertyExtractor uses. */ void setSolver(Solver::Solver &solver); protected: /** Energy type. */ enum class EnergyType{Real, Matsubara}; /** Get the energy type. * * @return The EnergyType for the energy window. */ EnergyType getEnergyType() const; /** Get the energy window. Only works for EnergyType::Real. * * @return The energy window. */ const Range& getEnergyWindow() const; /** Get the lower Fermionic Matsubara energy index. * * @return The lower Fermionic Matsubara energy index. */ int getLowerFermionicMatsubaraEnergyIndex() const; /** Get the upper Fermionic Matsubara energy index. * * @return The upper Fermionic Matsubara energy index. */ int getUpperFermionicMatsubaraEnergyIndex() const; /** Get the lower Bosonic Matsubara energy index. * * @return The lower Bosonic Matsubara energy index. */ int getLowerBosonicMatsubaraEnergyIndex() const; /** Get the upper Bosonic Matsubara energy index. * * @return The upper Bosonic Matsubara energy index. */ int getUpperBosonicMatsubaraEnergyIndex() const; /** Info class that is able to pass the most common parameters between * calculate-functions and the corresponding callbacks. Calculations * requiring more advanced features should override this class and * perform a type cast in the callbacks. */ class Information{ public: /** Constructs a * PropertyExtractor::PropertyExtractor::Information. */ Information(); /** Set the subindex for the spin index. * * @param spinIndex The subindex that is the spin index. */ void setSpinIndex(int spinIndex); /** Get the subindex for the spin index. * * @return The spin index. Returns -1 if no spin-index has * been set. */ int getSpinIndex() const; private: /** Spin index. */ int spinIndex; }; /*** Get the nergy infinitesimal. * * @return The energy infinitesimal. */ double getEnergyInfinitesimal() const; /** Loops over range indices and calls the given callback function to * calculate the correct quantity. The function recursively calls * itself replacing any IDX_SUM_ALL, IDX_X, IDX_Y, and IDX_Z * specifiers by actual subindices in the range [0, ranges[s]), where * s is the subindex at which the specifier appears. For example, the * pattern ranges pair {IDX_SUM_ALL, 2, IDX_X} and {2, 1, 3} will * result in the callback being called for {0, 2, 0}, {0, 2, 1}, {0, * 2, 2}, {1, 2, 0}, {1, 2, 1}, and {1, 2, 2}. The first and fourth, * second and fifth, and third and sixth Index will further be passed * to the callback with the same memory offset since their result * should be summed. * * The memory offset is further calculated by traversing the * subindices of the apttern from right to left and multiplying the * current offset multiplier by the number of indices in the range * size for the given subindex. This results in an offset that places * the elements in consequtive order in increasing order of the Index * order. Where an Index is considered to come before another Index if * the first subindex to differ between two @link Index Indices * @endlink from the left is smaller than the other Index. * * @param callback A callback function that is called to perform the * actual calculation for a given Index. * * @param property Reference to Property where the result is to be * stored. * * @param pattern An Index specifying the pattern for which to perform * the calculation. * * @param ranges The upper limit (exclusive) for which subindices with * wildcard specifiers will be replaced. The lower limit is 0. * * @param currentOffset The memory offset calculated for the given * pattern Index. Should be zero for the initial call to the function. * * @param offsetMultiplier Number indicating the block size associated * with increasing the current subindex by one. Should be equal to the * number of data elements per Index for the initial call to the * function. * * @param information Allows for custom information to be passed * between the calculate-functions and the correpsonding callbacks. */ template<typename DataType> void calculate( void (*callback)( PropertyExtractor *cb_this, Property::Property &property, const Index &index, int offset, Information &information ), Property::AbstractProperty<DataType> &property, Index pattern, const Index &ranges, int currentOffset, int offsetMultiplier, Information &information ); /** Loops over the indices satisfying the specified patterns and calls * the appropriate callback function to calculate the correct * quantity. * * @param callback A callback function that is called to perform the * actual calculation for a given Index. * * @param allIndices An IndexTree containing all the Indices for which * the callback should be called. * * @param memoryLayout The memory layout used for the Property. * @param abstractProperty The Property that is being calculated. * @param information Allows for custom information to be passed * between the calculate-functions and the correpsonding callbacks. */ template<typename DataType> void calculate( void (*callback)( PropertyExtractor *cb_this, Property::Property &property, const Index &index, int offset, Information &information ), const IndexTree &allIndices, const IndexTree &memoryLayout, Property::AbstractProperty<DataType> &abstractProperty, Information &information ); /** Ensure that range indices are on compliant format. I.e., sets the * range to one for indices with non-negative pattern value. * * @param pattern The pattern. * @param ranges The ranges that will have its subindices set to one * for every pattern subindex that is non negative. */ void ensureCompliantRanges(const Index &pattern, Index &ranges); /** Extract ranges for loop indices. The subindices with IDX_X, IDX_Y * and IDX_Z are identified and counted and an array of the same size * as the number of loop indices is created and filled with the ranges * for the corrsponding loop subindices. * * @param pattern A pattern. * @param ranges The ranges for the given pattern. * @param loopDimensions Pointer to int that will hold the number of * loop dimensions after the call has completed. * * @return A vector that contains the ranges for the loop subindices. */ std::vector<int> getLoopRanges( const Index &pattern, const Index &ranges ); /** Generate an IndexTree containing all the @link Index Indices * @endlink in the HoppingAmplitudeSet that matches the given * patterns. Before being added to the IndexTree, the @link Index * Indices @endlink may be modified to replace subindices by their * corresponding pattern value. I.e. A summation or spin subindex may * still be labeld such in the IndexTree depending on the flags that * are passed to the function. * * The pattern can also be a compund Index consisting of two Indices, * in which case the pattern matching is applied to each component * Index separately. * * @param patterns List of patterns to match against. * @param The HoppingAmplitudeSet cntaining all the @link Index * Indices @endlink that will be matched against the patterns. * * @param keepSummationWildcards If true, summation wildcards in the * pattern will be preserved in the IndexTree. * * @param keepSpinWildcards If true, spin wildcards in the pattern * will be preserved in the IndexTree. */ IndexTree generateIndexTree( std::vector<Index> patterns, const HoppingAmplitudeSet &hoppingAmplitudeSet, bool keepSummationWildcards, bool keepSpinWildcards ); /** Get the Solver. The Solver is dynamically cast to the type * specified by the template parameter SolverType. * * @return The Solver cast to SolverType. */ template<typename SolverType> SolverType& getSolver(); /** Get the Solver. The Solver is dynamically cast to the type * specified by the template parameter SolverType. * * @return The Solver cast to SolverType. */ template<typename SolverType> const SolverType& getSolver() const; /** Get the occupation number for a given eigenstate. Returns the * occupation number according to the Fermi-Dirac or Bose-Einstein * distribution depending on the statistics of the Model. * * @param energy The energy to get the occupation for. * @param model The Model that determines the statistics. */ static double getThermodynamicEquilibriumOccupation( double energy, const Model &model ); /** Get all Indices in the Model that are compatible with the given * patterns. * * @param patterns The patterns to match agains. * * @return An IndexTree containing all the mathing indices. */ IndexTree generateAllIndices(const std::vector<Index> &patterns) const; /** Get an IndexTree containing the memory layout for a Property that * is compatible with the Model and the given patterns. Similar to * getAllIndices(), but IDX_SUM_ALL are kept in place. * * @param patterns The patterns to match agains. * * @return An IndexTree containing the memory layout. */ IndexTree generateMemoryLayout( const std::vector<Index> &patterns ) const; private: /** Energy type used for energy dependent quantities. */ EnergyType energyType; /** Default energy resolution. */ static constexpr int ENERGY_RESOLUTION = 1000; /** Energy range used for energy dependent quantities when the energy * type is EnergyType::Real. */ Range energyWindow; /** Default lower bound. */ static constexpr double LOWER_BOUND = -1.; /** Default upper bound. */ static constexpr double UPPER_BOUND = 1.; /** Default lower Fermionic Matsubara energy index. */ static constexpr int LOWER_FERMIONIC_MATSUBARA_ENERGY_INDEX = -1; /** Lower Fermionic Matsubara energy index used for Fermionic energies * when the energy type is EnergyType::Matsubara. */ int lowerFermionicMatsubaraEnergyIndex; /** Default upper Fermionic Matsubara energy index. */ static constexpr int UPPER_FERMIONIC_MATSUBARA_ENERGY_INDEX = 1; /** Upper Fermionic Matsubara energy index used for Fermionic energies * when the energy type is EnergyType::Matsubara. */ int upperFermionicMatsubaraEnergyIndex; /** Default lower Bosonic Matsubara energy index. */ static constexpr int LOWER_BOSONIC_MATSUBARA_ENERGY_INDEX = 0; /** Lower Bosonic Matsubara energy index used for Bosonic energies when * the energy type is EnergyType::Matsubara. */ int lowerBosonicMatsubaraEnergyIndex; /** Default upper Bosonic Matsubara energy index. */ static constexpr int UPPER_BOSONIC_MATSUBARA_ENERGY_INDEX = 0; /** Upper Bosonic Matsubara energy index used for Bosonic energies * when the energy type is EnergyType::Matsubara. */ int upperBosonicMatsubaraEnergyIndex; /** Default energy infinitesimal. */ static constexpr double ENERGY_INFINITESIMAL = 1e-3; /** The nergy infinitesimal \f$\delta\f$ that for example can be used * in the denominator of the Green's function as \f$i\delta\f$. */ double energyInfinitesimal; /** Reference to solver. */ PersistentObjectReference<Solver::Solver> solver; }; inline void PropertyExtractor::setEnergyWindow(const Range &energyWindow){ energyType = EnergyType::Real; this->energyWindow = energyWindow; } inline PropertyExtractor::EnergyType PropertyExtractor::getEnergyType() const{ return energyType; } inline const Range& PropertyExtractor::getEnergyWindow() const{ TBTKAssert( energyType == EnergyType::Real, "PropertyExtractor::PropertyExtractor::getEnergyWindow()", "The energy window cannot be accessed when the energy type" << " is Matsubara.", "Use PropertyExtractor::PropertyExtractor::setEnergyWindow()" << " with three arguments if real energies are wanted for the" << " PropertyExtractor." ); return energyWindow; } inline int PropertyExtractor::getLowerFermionicMatsubaraEnergyIndex() const{ TBTKAssert( energyType == EnergyType::Matsubara, "PropertyExtractor::PropertyExtractor::getLowerFermionicMatsubaraEnergyIndex()", "The lower Fermionic Matsubara energy index cannot be accessed" << " when the energy type is real.", "Use PropertyExtractor::PropertyExtractor::setEnergyWindow()" << " with four arguments if Matsubara energies are wanted for" << " the PropertyExtractor." ); return lowerFermionicMatsubaraEnergyIndex; } inline int PropertyExtractor::getUpperFermionicMatsubaraEnergyIndex() const{ TBTKAssert( energyType == EnergyType::Matsubara, "PropertyExtractor::PropertyExtractor::getUpperFermionicMatsubaraEnergyIndex()", "The upper Fermionic Matsubara energy index cannot be accessed" << " when the energy type is real.", "Use PropertyExtractor::PropertyExtractor::setEnergyWindow()" << " with four arguments if Matsubara energies are wanted for" << " the PropertyExtractor." ); return upperFermionicMatsubaraEnergyIndex; } inline int PropertyExtractor::getLowerBosonicMatsubaraEnergyIndex() const{ TBTKAssert( energyType == EnergyType::Matsubara, "PropertyExtractor::PropertyExtractor::getLowerBosonicMatsubaraEnergyIndex()", "The lower Bosonic Matsubara energy index cannot be accessed" << " when the energy type is real.", "Use PropertyExtractor::PropertyExtractor::setEnergyWindow()" << " with four arguments if Matsubara energies are wanted for" << " the PropertyExtractor." ); return lowerBosonicMatsubaraEnergyIndex; } inline int PropertyExtractor::getUpperBosonicMatsubaraEnergyIndex() const{ TBTKAssert( energyType == EnergyType::Matsubara, "PropertyExtractor::PropertyExtractor::getUpperBosonicMatsubaraEnergyIndex()", "The upper Bosonic Matsubara energy index cannot be accessed" << " when the energy type is real.", "Use PropertyExtractor::PropertyExtractor::setEnergyWindow()" << " with four arguments if Matsubara energies are wanted for" << " the PropertyExtractor." ); return upperBosonicMatsubaraEnergyIndex; } inline double PropertyExtractor::getEnergyInfinitesimal() const{ return energyInfinitesimal; } template<typename DataType> void PropertyExtractor::calculate( void (*callback)( PropertyExtractor *cb_this, Property::Property &property, const Index &index, int offset, Information &information ), Property::AbstractProperty<DataType> &property, Index pattern, const Index &ranges, int currentOffset, int offsetMultiplier, Information &information ){ //Find the next specifier index. int currentSubindex = pattern.getSize()-1; for(; currentSubindex >= 0; currentSubindex--){ if(pattern.at(currentSubindex) < 0) break; } if(currentSubindex == -1){ //No further specifier index found. Call the callback. callback(this, property, pattern, currentOffset, information); } else{ //Ensure that the specifier is valid for the Ranges format. TBTKAssert( pattern.at(currentSubindex).isSummationIndex() || pattern.at(currentSubindex).isRangeIndex(), "PropertyExtractor::calculate()", "Invalid specifier found at subindex " << currentSubindex << ".", "Did you mean IDX_SUM_ALL, IDX_X, IDX_Y, or IDX_Z?" ); //Multiply the memory offset for non summation indices. int nextOffsetMultiplier = offsetMultiplier; if(!pattern.at(currentSubindex).isSummationIndex()) nextOffsetMultiplier *= ranges.at(currentSubindex); //Set flag indicating whether the current subindex is a //summation index. bool isSumIndex = false; if(pattern.at(currentSubindex).isSummationIndex()) isSumIndex = true; //Recurively call the calculate function with the specifier at //the current subindex replaced by each subindex value in the //corresponding range. for(int n = 0; n < ranges.at(currentSubindex); n++){ pattern.at(currentSubindex) = n; calculate( callback, property, pattern, ranges, currentOffset, nextOffsetMultiplier, information ); if(!isSumIndex) currentOffset += offsetMultiplier; } } } template<typename DataType> void PropertyExtractor::calculate( void (*callback)( PropertyExtractor *cb_this, Property::Property &property, const Index &index, int offset, Information &information ), const IndexTree &allIndices, const IndexTree &memoryLayout, Property::AbstractProperty<DataType> &abstractProperty, Information &information ){ for( IndexTree::ConstIterator iterator = allIndices.cbegin(); iterator != allIndices.end(); ++iterator ){ const Index &index = *iterator; std::vector<unsigned int> spinIndices = memoryLayout.getSubindicesMatching( IDX_SPIN, index, IndexTree::SearchMode::MatchWildcards ); if(spinIndices.size() != 0){ TBTKAssert( spinIndices.size() == 1, "PropertyExtractor::calculate()", "Several spin indeces found.", "Use IDX_SPIN at most once per pattern to" << " indicate spin index." ); information.setSpinIndex(spinIndices[0]); } callback( this, abstractProperty, index, abstractProperty.getOffset(index), information ); } } inline void PropertyExtractor::setSolver(Solver::Solver &solver){ this->solver.set(solver); } template<typename SolverType> SolverType& PropertyExtractor::getSolver(){ return solver.get<SolverType>(); } template<typename SolverType> const SolverType& PropertyExtractor::getSolver() const{ return solver.get<SolverType>(); } inline double PropertyExtractor::getThermodynamicEquilibriumOccupation( double energy, const Model &model ){ switch(model.getStatistics()){ case Statistics::FermiDirac: return Functions::fermiDiracDistribution( energy, model.getChemicalPotential(), model.getTemperature() ); case Statistics::BoseEinstein: return Functions::boseEinsteinDistribution( energy, model.getChemicalPotential(), model.getTemperature() ); default: TBTKExit( "PropertyExtractor::PropertyExtractor::getThermodynamicEquilibriumOccupation()", "Unkown statistics.", "This should never happen, contact the developer." ); } } inline IndexTree PropertyExtractor::generateAllIndices( const std::vector<Index> &patterns ) const{ IndexTreeGenerator generator(getSolver<Solver::Solver>().getModel()); return generator.generateAllIndices(patterns); } inline IndexTree PropertyExtractor::generateMemoryLayout( const std::vector<Index> &patterns ) const{ IndexTreeGenerator generator(getSolver<Solver::Solver>().getModel()); return generator.generateMemoryLayout(patterns); } inline void PropertyExtractor::Information::setSpinIndex(int spinIndex){ this->spinIndex = spinIndex; } inline int PropertyExtractor::Information::getSpinIndex() const{ return spinIndex; } }; //End of namespace PropertyExtractor }; //End of namespace TBTK #endif
be31683352c2399721810a4fa2f199d9c281d5fc
133494d4b2b2b4face9b0dc20b434930aa4d11fe
/src/trackcontainer.hpp
87f6899a00115937ed215c2eb13a2716dd853b8c
[ "BSD-2-Clause" ]
permissive
heelong/pmot
37f4cd744a9af8339e9914c6edb462974ce9b86d
6f5d262d3a38a7afb516cbe1218de951995b08b2
refs/heads/master
2020-03-19T04:22:50.241845
2015-05-18T15:50:28
2015-05-18T15:50:28
null
0
0
null
null
null
null
UTF-8
C++
false
false
3,998
hpp
trackcontainer.hpp
#include "trackcontainer.h" #include <time.h> #include <stdio.h> template<class Object> TrackContainer<Object>::TrackContainer(int _maxFrame, int _maxID) :maxFrame(_maxFrame), maxID(_maxID) { oldCnt = 0; oldCnt_gaussians = 0; srand(time(NULL)); r = new int[maxID]; g = new int[maxID]; b = new int[maxID]; for(int i=0;i<maxID;i++){ r[i] = rand() % 256; g[i] = rand() % 256; b[i] = rand() % 256; } } template<class Object> TrackContainer<Object>::~TrackContainer() { for(int i=0;i<tracks.size();i++) delete tracks.at(i); tracks.clear(); if(r != 0) delete[] r; if(g != 0) delete[] g; if(r != 0) delete[] b; } template<class Object> bool TrackContainer<Object>::createTrack(Object &object, int initT) { int id = newId(); if(id == -1) return 0; TrackT *track = new TrackT(id, maxFrame); track->insert(object, initT); tracks.push_back(track); } template<class Object> bool TrackContainer<Object>::createTrack(Object &object, int initT, int id) { for(int i=0;i<tracks.size();i++) if(tracks.at(i)->id == id) return 0; TrackT *track = new TrackT(id, maxFrame); track->insert(object, initT); tracks.push_back(track); } template<class Object> bool TrackContainer<Object>::push_back_track(int id, Object &object, int time) { // find track of id TrackT *track = 0; for(int i=0;i<tracks.size();i++){ if(tracks.at(i)->id == id){ track = tracks.at(i); break; } } if(track == 0) return 0; track->insert(object, time); } template<class Object> bool TrackContainer<Object>::isNewlyUpdated(int at) { if(currentT == tracks.at(at)->lastFrame().time) return 1; else return 0; } template<class Object> bool TrackContainer<Object>::updateObject(int id, int time, Object &object) { TrackT *track = 0; for(int i=0;i<tracks.size();i++){ if(tracks.at(i)->id == id){ track = tracks.at(i); break; } } if(track == 0) return 0; track->updateObjectAtFrame(time, object); } template<class Object> int TrackContainer<Object>::newId() { if(tracks.size() == maxID) return -1; int *cand; int nCand = maxID-tracks.size(); int n = 0; cand = new int[nCand]; for(int i=1;i<maxID;i++){ bool isExist = 0; for(int j=0;j<tracks.size();j++){ if(tracks.at(j)->id == i){ isExist = 1; break; } } if(!isExist){ cand[n] = i; n++; } } int nRand = cand[rand()%nCand]; delete[] cand; return nRand; // if(tracks.size() == 0) // return 1; // for(int i=1;i<maxID;i++){ // for(int j=0;j<tracks.size();j++){ // if(tracks.at(j)->id == i) // break; // if(j == tracks.size()-1){ // // there's no id like i // return i; // } // } // } // return -1; } template<class Object> bool TrackContainer<Object>::merge(TrackContainer<Object> container) { } template<class Object> void TrackContainer<Object>::deleteNoUpdatedTracks(int size) { deletedTrackIDs.clear(); if(tracks.size() == 0) return; TrackT *track = 0; // typename VecTrackPtr::iterator it = tracks.begin(); for(typename VecTrackPtr::iterator it = tracks.begin(); it!=tracks.end();){ track = *it; // printf("track id : %d\n", track->id); // printf("track size : %d\n", track->frames.size()); if(track->lastFrame().time <= currentT-size){ // printf("Delete Track : %d\n", track->id); deletedTrackIDs.push_back(track->id); track->terminate(); delete track; it = tracks.erase(it); }else{ ++it; } } }
1f99ffdf15fbaf24f1f6be01721f90efcf86081d
d407d686117e7cb3299780fe56ba92e7a469468d
/ABC/150/a.cpp
ffdc677a1d6aee0a47a56e30888db15b85afa350
[]
no_license
taiki-contact/atcoder
2feb07dcd18608986a56461f1ad613fbeecce37f
79e7933f98cb9f3df7a051ebc90ae51ea5a8c3d0
refs/heads/master
2021-07-07T10:07:13.527197
2020-09-19T11:56:47
2020-09-19T11:56:47
188,584,808
0
0
null
null
null
null
UTF-8
C++
false
false
174
cpp
a.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main(){ int k,x; cin >> k >> x; if(k*500 >= x)cout << "Yes\n"; else cout << "No\n"; return 0; }
5902f3bbb58b3970a500dde686f1904e87e925d2
742c7a43347456ba292a71d544f0d1d49a95803a
/vector_3d_/vector.3d.hpp
526e32e469d6d9d6b83188d0e9c2dbeb202eb2ec
[]
no_license
IvanSkvortsov/pseudo_integral
d6866e7ae596a676b584761d46b5d564e2855479
bb466de42645c51dc4eb17e4a755864bb801aa86
refs/heads/master
2020-08-04T04:18:15.956910
2016-12-18T12:29:50
2016-12-18T12:29:50
73,522,379
0
0
null
null
null
null
UTF-8
C++
false
false
12,865
hpp
vector.3d.hpp
#ifndef __VECTOR_3D_HPP__ #define __VECTOR_3D_HPP__ #include"vector.3d.h" #include<cmath>// sqrt #ifdef __VECTOR_3D_LOG #include<iostream>// clog, endl #include"type.name.str.h" #define __VEC3D_LOG1( source, method ) (source)->log( (method) ) #define __VEC3D_LOG2( typeU, source, method ) (source)->log<typeU>( (method) ) #else #define __VEC3D_LOG1( source, method ) #define __VEC3D_LOG2( typeU, source, method ) #endif template<typename T> __VECTOR_3D__INLINE void vector_3d<T>::log(const char * _method)const { #ifdef __VECTOR_3D_LOG std::clog << "LOG : [" << this << "] vector_3d<T>::" << _method << #ifdef __TYPE_NAME_STR_H__ " [with " << __STRINGIFY(T) << " = " << type_name_str<T>() << "]" << #endif std::endl; #endif } template<typename T> template<typename U> __VECTOR_3D__INLINE void vector_3d<T>::log(const char * _method)const { #ifdef __VECTOR_3D_LOG std::clog << "LOG : [" << this << "] template<typename U> vector_3d<T>::" << _method << #ifdef __TYPE_NAME_STR_H__ " [with " << __STRINGIFY(T) << " = " << type_name_str<T>() << ", " << __STRINGIFY(U) << " = " << type_name_str<U>() << "]" << #endif std::endl; #endif } // vector_3d() template<typename T> __VECTOR_3D__INLINE vector_3d<T>::vector_3d(): _data{0, 0, 0} { __VEC3D_LOG1( this, "vector_3d()"); } // ~vector_3d() template<typename T> __VECTOR_3D__INLINE vector_3d<T>::~vector_3d() { __VEC3D_LOG1( this, "~vector_3d()"); } // vector_3d( Type const & , Type const & , Type const & ) template<typename T> template<typename U> __VECTOR_3D__INLINE vector_3d<T>::vector_3d( U const & _x, U const & _y, U const & _z ): _data{ T(_x), T(_y), T(_z) } { __VEC3D_LOG2( U, this, "vector_3d(U const & , U const & , U const & )"); } template<typename T> __VECTOR_3D__INLINE vector_3d<T>::vector_3d( T const & _x, T const & _y, T const & _z ): _data{ _x, _y, _z } { __VEC3D_LOG1( this, "vector_3d(T const & , T const & , T const & )"); } // vector_3d( Type const * ) template<typename T> template<typename U> __VECTOR_3D__INLINE vector_3d<T>::vector_3d( U const * v ) : _data{ T(v[0]), T(v[1]), T(v[2]) } { __VEC3D_LOG2( U, this, "vector_3d(U const * )"); } template<typename T> __VECTOR_3D__INLINE vector_3d<T>::vector_3d( T const * v ) : _data{ v[0], v[1], v[2] } { __VEC3D_LOG1( this, "vector_3d(T const * )"); } // vector_3d( vector_3d<Type> const & ) template<typename T> template<typename U> __VECTOR_3D__INLINE vector_3d<T>::vector_3d( vector_3d<U> const & v ) : _data{ T(v[0]), T(v[1]), T(v[2]) } { __VEC3D_LOG2( U, this, "vector_3d( vector_3d<U> const & )"); } template<typename T> __VECTOR_3D__INLINE vector_3d<T>::vector_3d( vector_3d<T> const & v ) : _data{ v[0], v[1], v[2] } { __VEC3D_LOG1( this, "vector_3d( vector_3d<T> const & )"); } // operator=( vector_3d<Type> const & ) template<typename T> template<typename U> __VECTOR_3D__INLINE vector_3d<T> & vector_3d<T>::operator=( vector_3d<U> const & v ) { __VEC3D_LOG2( U, this, "operator=( vector_3d<U> const & )"); return this->operator=( v.data() ); } template<typename T> __VECTOR_3D__INLINE vector_3d<T> & vector_3d<T>::operator=( vector_3d<T> const & v ) { __VEC3D_LOG1( this, "operator=( vector_3d<T> const & )"); if( this == &v ) return *this; return this->operator=( v.data() ); } // operator=( Type const * ) template<typename T> template<typename U> __VECTOR_3D__INLINE vector_3d<T> & vector_3d<T>::operator=( U const * v ) { for(int i = 0; i < 3; ++i) this->_data[i] = v[i]; return *this; } template<typename T> __VECTOR_3D__INLINE vector_3d<T> & vector_3d<T>::operator=( T const * v ) { for(int i = 0; i < 3; ++i) this->_data[i] = v[i]; return *this; } template<typename T> __VECTOR_3D__INLINE vector_3d<T>::operator T*(){ return this->_data;} template<typename T> __VECTOR_3D__INLINE vector_3d<T>::operator T const *()const{ return this->_data;} template<typename T> __VECTOR_3D__INLINE typename vector_3d<T>::const_pointer vector_3d<T>::data()const{ return this->_data;} template<typename T> __VECTOR_3D__INLINE typename vector_3d<T>::pointer vector_3d<T>::data(){ return this->_data;} template<typename T> __VECTOR_3D__INLINE typename vector_3d<T>::const_reference vector_3d<T>::operator[](int i)const{ return this->_data[i];} template<typename T> __VECTOR_3D__INLINE typename vector_3d<T>::reference vector_3d<T>::operator[](int i){ return this->_data[i];} // x, y, z template<typename T> __VECTOR_3D__INLINE typename vector_3d<T>::const_reference vector_3d<T>::x()const{ return this->_data[0];} template<typename T> __VECTOR_3D__INLINE typename vector_3d<T>::const_reference vector_3d<T>::y()const{ return this->_data[1];} template<typename T> __VECTOR_3D__INLINE typename vector_3d<T>::const_reference vector_3d<T>::z()const{ return this->_data[2];} template<typename T> __VECTOR_3D__INLINE typename vector_3d<T>::reference vector_3d<T>::x(){ return this->_data[0];} template<typename T> __VECTOR_3D__INLINE typename vector_3d<T>::reference vector_3d<T>::y(){ return this->_data[1];} template<typename T> __VECTOR_3D__INLINE typename vector_3d<T>::reference vector_3d<T>::z(){ return this->_data[2];} // sqr template<typename T> __VECTOR_3D__INLINE typename vector_3d<T>::value_type vector_3d<T>::sqr()const { value_type __sqr; this->sqr( __sqr ); return __sqr; } template<typename T> __VECTOR_3D__INLINE void vector_3d<T>::sqr(reference __sqr)const { __sqr = 0; const_pointer ptr = this->data(); for(int i = 0; i < 3; ++i, ++ptr) __sqr += (*ptr * *ptr); } // len template<typename T> __VECTOR_3D__INLINE typename vector_3d<T>::value_type vector_3d<T>::len()const { value_type __len; this->len( __len ); return __len; } template<typename T> __VECTOR_3D__INLINE void vector_3d<T>::len(reference __len)const { this->sqr( __len ); __len = sqrt( __len ); } // neg template<typename T> __VECTOR_3D__INLINE vector_3d<T> & vector_3d<T>::neg() { pointer ptr = this->data(); for(int i = 0; i < 3; ++i, ++ptr) *ptr = -*ptr; return *this; } template<typename T> __VECTOR_3D__INLINE void vector_3d<T>::neg( vector_3d<T> & v)const { v = *this; v.neg(); } // norm template<typename T> __VECTOR_3D__INLINE vector_3d<T> & vector_3d<T>::norm() { value_type __len; this->len( __len ); for(int i = 0; i < 3; ++i) this->_data[i] /= __len; return *this; } template<typename T> __VECTOR_3D__INLINE void vector_3d<T>::norm( vector_3d<T> & v )const { v = *this; v.norm(); } // operator+= template<typename T> template<typename U> __VECTOR_3D__INLINE vector_3d<T> & vector_3d<T>::operator+=( vector_3d<U> const & v ) { pointer ptr = this->data(); for(int i = 0; i < 3; ++i, ++ptr) *ptr += v[i]; return *this; } template<typename T> __VECTOR_3D__INLINE vector_3d<T> & vector_3d<T>::operator+=( vector_3d<T> const & v ) { pointer ptr = this->data(); for(int i = 0; i < 3; ++i, ++ptr) *ptr += v[i]; return *this; } // operator-= template<typename T> template<typename U> __VECTOR_3D__INLINE vector_3d<T> & vector_3d<T>::operator-=( vector_3d<U> const & v ) { pointer ptr = this->data(); for(int i = 0; i < 3; ++i, ++ptr) *ptr -= v[i]; return *this; } template<typename T> __VECTOR_3D__INLINE vector_3d<T> & vector_3d<T>::operator-=( vector_3d<T> const & v ) { pointer ptr = this->data(); for(int i = 0; i < 3; ++i, ++ptr) *ptr -= v[i]; return *this; } // operator-() template<typename T> __VECTOR_3D__INLINE vector_3d<T> vector_3d<T>::operator-()const { vector_3d<T> tmp( *this ); tmp.neg(); return tmp; } // operator*= template<typename T> template<typename U> __VECTOR_3D__INLINE vector_3d<T> & vector_3d<T>::operator*=( U const & v ) { pointer ptr = this->data(); for(int i = 0; i < 3; ++i, ++ptr) *ptr *= v; return *this; } template<typename T> __VECTOR_3D__INLINE vector_3d<T> & vector_3d<T>::operator*=( T const & v ) { pointer ptr = this->data(); for(int i = 0; i < 3; ++i, ++ptr) *ptr *= v; return *this; } // operator/= template<typename T> template<typename U> __VECTOR_3D__INLINE vector_3d<T> & vector_3d<T>::operator/=( U const & v ) { pointer ptr = this->data(); for(int i = 0; i < 3; ++i, ++ptr) *ptr /= v; return *this; } template<typename T> __VECTOR_3D__INLINE vector_3d<T> & vector_3d<T>::operator/=( T const & v ) { pointer ptr = this->data(); for(int i = 0; i < 3; ++i, ++ptr) *ptr /= v; return *this; } // scalar template<typename T> __VECTOR_3D__INLINE typename vector_3d<T>::value_type vector_3d<T>::scalar( vector_3d<T> const & v)const { value_type __result; this->scalar( __result, v ); return __result; } template<typename T> __VECTOR_3D__INLINE void vector_3d<T>::scalar( T & __result, vector_3d<T> const & v)const { if( this == &v ) { this->sqr( __result ); return; } const_pointer ptr = this->data(); __result = 0; for(int i = 0; i < 3; ++i, ++ptr) __result += *ptr * v[i]; } template<typename T> __VECTOR_3D__INLINE void vector_3d<T>::scalar(T & __result, vector_3d<T> const & lhs, vector_3d<T> const & rhs) { lhs.scalar( __result, rhs ); } template<typename T> __VECTOR_3D__INLINE typename vector_3d<T>::value_type vector_3d<T>::scalar(vector_3d<T> const & lhs, vector_3d<T> const & rhs) { return lhs.scalar( rhs ); } // operator+ template<typename T, typename U> __VECTOR_3D__INLINE vector_3d<T> operator+( vector_3d<T> const & lhs, vector_3d<U> const & rhs) { vector_3d<T> tmp( lhs ); tmp += rhs; return tmp; } template<typename T> __VECTOR_3D__INLINE vector_3d<T> operator+( vector_3d<T> const & lhs, vector_3d<T> const & rhs) { vector_3d<T> tmp( lhs ); tmp += rhs; return tmp; } // operator- template<typename T, typename U> __VECTOR_3D__INLINE vector_3d<T> operator-( vector_3d<T> const & lhs, vector_3d<U> const & rhs) { vector_3d<T> tmp( lhs ); tmp -= rhs; return tmp; } template<typename T> __VECTOR_3D__INLINE vector_3d<T> operator-( vector_3d<T> const & lhs, vector_3d<T> const & rhs) { vector_3d<T> tmp( lhs ); tmp -= rhs; return tmp; } // operator* template<typename T, typename U> __VECTOR_3D__INLINE vector_3d<T> operator*( vector_3d<T> const & lhs, U const & rhs) { vector_3d<T> tmp( lhs ); tmp *= rhs; return tmp; } template<typename T> __VECTOR_3D__INLINE vector_3d<T> operator*( vector_3d<T> const & lhs, T const & rhs) { vector_3d<T> tmp( lhs ); tmp *= rhs; return tmp; } // operator/ template<typename T, typename U> __VECTOR_3D__INLINE vector_3d<T> operator/( vector_3d<T> const & lhs, U const & rhs) { vector_3d<T> tmp( lhs ); tmp /= rhs; return tmp; } template<typename T> __VECTOR_3D__INLINE vector_3d<T> operator/( vector_3d<T> const & lhs, T const & rhs) { vector_3d<T> tmp( lhs ); tmp /= rhs; return tmp; } #define VECTOR_3D_SPEC2( T, U )\ template vector_3d<T>::vector_3d( U const * );\ template vector_3d<T>::vector_3d( U const & , U const & , U const & );\ template vector_3d<T>::vector_3d( vector_3d<U> const & );\ template vector_3d<T> & vector_3d<T>::operator=( vector_3d<U> const & );\ template vector_3d<T> & vector_3d<T>::operator=( U const * );\ template vector_3d<T> & vector_3d<T>::operator+=( vector_3d<U> const & );\ template vector_3d<T> & vector_3d<T>::operator-=( vector_3d<U> const & );\ template vector_3d<T> & vector_3d<T>::operator*=( U const & );\ template vector_3d<T> & vector_3d<T>::operator/=( U const & );\ template vector_3d<T> operator+( vector_3d<T> const & lhs, vector_3d<U> const & rhs);\ template vector_3d<T> operator-( vector_3d<T> const & lhs, vector_3d<U> const & rhs);\ template vector_3d<T> operator*( vector_3d<T> const & lhs, U const & rhs);\ template vector_3d<T> operator/( vector_3d<T> const & lhs, U const & rhs); #define VECTOR_3D_SPEC_REAL_INT( float_type )\ VECTOR_3D_SPEC2( float_type, int );\ VECTOR_3D_SPEC2( float_type, long int );\ VECTOR_3D_SPEC2( float_type, long long int );\ VECTOR_3D_SPEC2( float_type, unsigned int );\ VECTOR_3D_SPEC2( float_type, unsigned long int );\ VECTOR_3D_SPEC2( float_type, unsigned long long int ); #define VECTOR_3D_SPEC_REAL( T )\ template class vector_3d<T>;\ VECTOR_3D_SPEC_REAL_INT( T )\ template vector_3d<T> operator+( vector_3d<T> const & lhs, vector_3d<T> const & rhs);\ template vector_3d<T> operator-( vector_3d<T> const & lhs, vector_3d<T> const & rhs);\ template vector_3d<T> operator*( vector_3d<T> const & lhs, T const & rhs);\ template vector_3d<T> operator/( vector_3d<T> const & lhs, T const & rhs); #define VECTOR_3D_SPEC_INT_REAL( int_type )\ VECTOR_3D_SPEC2( int_type, float );\ VECTOR_3D_SPEC2( int_type, double );\ VECTOR_3D_SPEC2( int_type, long double ); #define VECTOR_3D_SPEC_INT( T )\ template class vector_3d<T>;\ VECTOR_3D_SPEC_INT_REAL( T )\ template vector_3d<T> operator+( vector_3d<T> const & lhs, vector_3d<T> const & rhs);\ template vector_3d<T> operator-( vector_3d<T> const & lhs, vector_3d<T> const & rhs);\ template vector_3d<T> operator*( vector_3d<T> const & lhs, T const & rhs);\ template vector_3d<T> operator/( vector_3d<T> const & lhs, T const & rhs); #endif//__VECTOR_3D_HPP__
c0b31a674e79e6b9c185b062711a9e082fe04e21
f6bef9036f4532dc9b309c73efec0d957502b1fb
/lib/zip_extractor.cpp
6990eca6c34e14356184bf7590f7f79a2d725ecc
[ "MIT" ]
permissive
minecraft-linux/mcpelauncher-extract
b886a906eef7004f68dd8a7ab519863736a7deea
586011d9d78cc9a9fdfb03fa9453a3d9ae0dddde
refs/heads/master
2022-10-26T07:51:12.036722
2018-12-18T20:05:48
2018-12-18T20:05:48
137,522,541
3
6
MIT
2021-04-09T20:19:18
2018-06-15T19:01:14
C++
UTF-8
C++
false
false
4,044
cpp
zip_extractor.cpp
#include <mcpelauncher/zip_extractor.h> #include <cstring> #include <sys/stat.h> #include <errno.h> ZipExtractor::ZipExtractor(std::string const& path) { int err = 0; archive = zip_open(path.c_str(), 0, &err); if (archive == nullptr) throw ZipExtractionError("Failed to open zip " + std::to_string(err)); } void ZipExtractor::mkdirRecursive(char* path, size_t len, bool createThisDir) { char* a = NULL; for (ssize_t i = len - 1; i >= 0; i--) { if (path[i] == '/') { a = (char*) &path[i]; break; } } if (createThisDir && (mkdir(path, 0755) == 0 || errno == EEXIST)) return; if (a != nullptr) { *a = '\0'; mkdirRecursive(path, len, true); *a = '/'; } if (createThisDir) mkdir(path, 0755); } void ZipExtractor::extractFile(zip_file* entry, std::string const& to, size_t fileSize, std::function<void(size_t current, size_t max)> progress, char* buf, size_t bufSize) { mkdirRecursive(to); FILE* out = fopen(to.c_str(), "wb"); if (!out) throw ZipExtractionError("Failed to open output file"); progress(0, fileSize); zip_int64_t r; size_t total = 0; while ((r = zip_fread(entry, buf, bufSize)) > 0) { fwrite(buf, sizeof(char), (size_t) r, out); total += r; progress(total, fileSize); } progress(total, fileSize); fclose(out); } void ZipExtractor::extractTo(std::vector<std::pair<zip_uint64_t, std::string>> const& files, size_t totalSize, std::function<void (size_t current, size_t max, FileHandle const& entry, size_t entryCurrent, size_t entryMax)> const& progress) { char* buf = new char[DEFAULT_BUF_SIZE]; struct zip_stat zs; size_t current = 0; for (auto const& file : files) { if (zip_stat_index(archive, file.first, 0, &zs) != 0) throw ZipExtractionError("zip_stat_index failed"); FileHandle handle (archive, file.first); if (handle.get() == nullptr) throw ZipExtractionError("Failed to open file in the zip"); extractFile(handle, file.second, zs.size, [current, &handle, &progress, totalSize] (size_t fileCurrent, size_t fileMax) { progress(current + fileCurrent, totalSize, handle, fileCurrent, fileMax); }, buf, DEFAULT_BUF_SIZE); current += zs.size; } delete[] buf; } void ZipExtractor::extractTo(std::function<bool (const char* filename, std::string& outName)> const& filter, std::function<void (size_t current, size_t max, FileHandle const& entry, size_t entryCurrent, size_t entryMax)> const& progress) { std::vector<std::pair<zip_uint64_t, std::string>> files; zip_int64_t n = zip_get_num_entries(archive, 0); size_t size = 0; std::string filename; struct zip_stat zs; for (zip_int64_t i = 0; i < n; i++) { if (zip_stat_index(archive, (zip_uint64_t) i, 0, &zs) != 0) throw ZipExtractionError("zip_stat_index failed"); if (filter(zs.name, filename)) { size += zs.size; files.emplace_back((zip_uint64_t) i, filename); } } return extractTo(files, size, progress); } std::vector<char> ZipExtractor::readFile(std::string const& filename) { struct zip_stat s; if (zip_stat(archive, filename.c_str(), 0, &s) != 0) throw ZipExtractionError("Failed to stat the specified file"); FileHandle handle (zip_fopen(archive, filename.c_str(), 0)); if (!handle) throw ZipExtractionError("Failed to open the specified file"); std::vector<char> ret (s.size); for (size_t o = 0; o < s.size; ) { ssize_t r = zip_fread(handle, &ret.data()[o], s.size - o); if (r < 0) throw ZipExtractionError("Read failed"); o += r; } return ret; }
6d3c6005239b2c0bb3e3e09496cd2694720aa1a5
a55dbb283a037fbbaade11f63f3b80836ea63d3a
/ThermaKin2D App/ThrmaKin2Dm Code - Original/Mixtures.cpp
58741ce8f4e15e3a975e4ca5d24d0b7153a4c1ad
[]
no_license
xiaominglihua/GUI-Thermakin2D
85c2d16d23e12c9a00ed66396638b0d1bfdfe8f5
489e1ee7edf89c8c53b1eccce9095c3baa54783e
refs/heads/master
2021-12-11T06:57:58.650354
2016-11-01T01:10:23
2016-11-01T01:10:23
null
0
0
null
null
null
null
UTF-8
C++
false
false
980
cpp
Mixtures.cpp
#include "Mixtures.h" Mixrules::Mixrules(double Sswell,double Lswell,double Gswell_lmt, double par_cond,double par_trns) { Sswl=Sswell; Lswl=Lswell; Gswl_lm=Gswell_lmt; swl_den=1.0; swl=1.0; p_cond=par_cond; s_cond=1.0-p_cond; p_trns=par_trns; s_trns=1.0-p_trns; } bool Mixrules::load(std::istringstream& mixprops) { std::string buf; if((mixprops>>buf)&&(buf=="S")&&(mixprops>>buf)&&(buf=="SWELLING:")&& (mixprops>>Sswl)&& (mixprops>>buf)&&(buf=="L")&&(mixprops>>buf)&&(buf=="SWELLING:")&& (mixprops>>Lswl)&& (mixprops>>buf)&&(buf=="G")&&(mixprops>>buf)&&(buf=="SWELLING")&& (mixprops>>buf)&&(buf=="LIMIT:")&& (mixprops>>Gswl_lm)&& (mixprops>>buf)&&(buf=="PARALL")&&(mixprops>>buf)&&(buf=="CONDUCTIVITY:")&& (mixprops>>p_cond)&& (mixprops>>buf)&&(buf=="PARALL")&&(mixprops>>buf)&&(buf=="TRANSPORT:")&& (mixprops>>p_trns)) { s_cond=1.0-p_cond; s_trns=1.0-p_trns; return true; } else { s_cond=1.0-p_cond; return false; } }
9c2856ac5fc507958d59b974f532a268249941c8
eb6b8deb0a73c567d91ca77fb8ac6fba0513c67e
/other/1A.cpp
5c92c61f580c0079e64857684a70c9c7d01ad5d6
[]
no_license
mysticAxolotl/ACM
49e0927a5d16cf84958ae11bf160d1d5871216a0
c1988150d1ae8ccd1654e0655262fd8389678f7d
refs/heads/master
2021-06-22T03:27:35.555079
2021-06-14T21:37:28
2021-06-14T21:37:28
216,106,605
0
0
null
null
null
null
UTF-8
C++
false
false
354
cpp
1A.cpp
using namespace::std; #include <iostream> int main() { int b, g, n; cin >> b >> g >> n; if( b >= n && g >= n) { cout << n + 1; return 1; } switch( b < g ) { case 1: cout << b + 1; break; default: cout << g + 1; } return 0; }