hexsha
stringlengths
40
40
size
int64
7
1.05M
ext
stringclasses
13 values
lang
stringclasses
1 value
max_stars_repo_path
stringlengths
4
269
max_stars_repo_name
stringlengths
5
108
max_stars_repo_head_hexsha
stringlengths
40
40
max_stars_repo_licenses
listlengths
1
9
max_stars_count
int64
1
191k
max_stars_repo_stars_event_min_datetime
stringlengths
24
24
max_stars_repo_stars_event_max_datetime
stringlengths
24
24
max_issues_repo_path
stringlengths
4
269
max_issues_repo_name
stringlengths
5
116
max_issues_repo_head_hexsha
stringlengths
40
40
max_issues_repo_licenses
listlengths
1
9
max_issues_count
int64
1
67k
max_issues_repo_issues_event_min_datetime
stringlengths
24
24
max_issues_repo_issues_event_max_datetime
stringlengths
24
24
max_forks_repo_path
stringlengths
4
269
max_forks_repo_name
stringlengths
5
116
max_forks_repo_head_hexsha
stringlengths
40
40
max_forks_repo_licenses
listlengths
1
9
max_forks_count
int64
1
105k
max_forks_repo_forks_event_min_datetime
stringlengths
24
24
max_forks_repo_forks_event_max_datetime
stringlengths
24
24
content
stringlengths
7
1.05M
avg_line_length
float64
1.21
330k
max_line_length
int64
6
990k
alphanum_fraction
float64
0.01
0.99
author_id
stringlengths
2
40
7bc20553db5798d3a40b8b3e586070525f7dc4f7
3,451
cpp
C++
Examples/IocTest/main.cpp
mrcao20/McQuickBoot
187a16ea9459fa5e2b3477b5280302a9090e8ccf
[ "MIT" ]
3
2020-03-29T18:41:42.000Z
2020-09-23T01:46:25.000Z
Examples/IocTest/main.cpp
mrcao20/McQuickBoot
187a16ea9459fa5e2b3477b5280302a9090e8ccf
[ "MIT" ]
3
2020-11-26T03:37:31.000Z
2020-12-21T02:17:17.000Z
Examples/IocTest/main.cpp
mrcao20/McQuickBoot
187a16ea9459fa5e2b3477b5280302a9090e8ccf
[ "MIT" ]
null
null
null
#include <QBuffer> #include <QCoreApplication> #include <QDebug> #include <QFile> #include <QTextStream> #include <QThread> #include <McIoc/ApplicationContext/impl/McLocalPathApplicationContext.h> #include <McIoc/ApplicationContext/impl/McAnnotationApplicationContext.h> #include <McIoc/ApplicationContext/impl/McXmlApplicationContext.h> #include "C.h" #include <McIoc/Utils/XmlBuilder/impl/McBean.h> #include <McIoc/Utils/XmlBuilder/impl/McBeanCollection.h> #include <McIoc/Utils/XmlBuilder/impl/McConnect.h> #include <McIoc/Utils/XmlBuilder/impl/McEnum.h> #include <McIoc/Utils/XmlBuilder/impl/McList.h> #include <McIoc/Utils/XmlBuilder/impl/McMap.h> #include <McIoc/Utils/XmlBuilder/impl/McPlaceholder.h> #include <McIoc/Utils/XmlBuilder/impl/McProperty.h> #include <McIoc/Utils/XmlBuilder/impl/McRef.h> #include <McIoc/Utils/XmlBuilder/impl/McValue.h> #include <QDomDocument> int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); using namespace McXmlBuilder; McBeanCollection bc; McBeanPtr b1 = McBeanPtr::create(); bc.addBean(b1); b1->setBeanName("r"); b1->setClassName("R"); b1->setSingleton(true); b1->setPointer(false); McBeanPtr b = McBeanPtr::create(); bc.addBean(b); b->setBeanName("c"); b->setClassName("C"); McPropertyPtr p = McPropertyPtr::create(); b->addContent(p); p->setContent("text", "test c"); McConnectPtr c = McConnectPtr::create(); b->addContent(c); c->setSender("this"); c->setSignal("signal_send()"); c->setReceiver("r"); c->setSlot("slot_recv()"); c->setConnectionType("DirectConnection | UniqueConnection"); McEnumPtr en = McEnumPtr::create(); en->setScope("Qt"); en->setType("AlignmentFlag"); en->setValue("AlignLeft"); McPropertyPtr pp1 = McPropertyPtr::create(); pp1->setContent("align", en); b->addContent(pp1); McRefPtr ref = McRefPtr::create(); ref->setBeanName("r"); McPropertyPtr p3 = McPropertyPtr::create(); b->addContent(p3); p3->setContent("r", ref); McMapPtr m = McMapPtr::create(); m->addContent("jack", ref); McPropertyPtr p1 = McPropertyPtr::create(); b->addContent(p1); p1->setContent("hrs", m); McPlaceholderPtr plh = McPlaceholderPtr::create(); plh->setPlaceholder("objectName"); m->addContent(plh, ref); McListPtr ll = McListPtr::create(); ll->addContent("停封"); McPropertyPtr pp2 = McPropertyPtr::create(); pp2->setContent("texts", ll); b->addContent(pp2); auto doc = bc.toDomDocument(); qDebug() << doc.toString(4); QFile file(Mc::applicationDirPath() + "/test.xml"); file.open(QIODevice::WriteOnly); QTextStream stream(&file); doc.save(stream, 4); QSharedPointer<QBuffer> buf = QSharedPointer<QBuffer>::create(); buf->open(QIODevice::ReadWrite); bc.writeToDevice(buf.data()); auto appContext = McLocalPathApplicationContextPtr::create( R"(../../Examples/IocTest/myspring.xml)"); // auto appContext = McAnnotationApplicationContextPtr::create(); // auto appContext = McXmlApplicationContextPtr::create(buf.objectCast<QIODevice>()); QThread *t = new QThread(&a); t->start(); qDebug() << "t:" << t; auto ia = appContext->getBean<IA>("c", t); auto gadget = appContext->getBean<GadgetTest>("gadgetTest"); qDebug() << gadget->aaa << gadget->bbb; ia->a(); return a.exec(); }
32.252336
92
0.671689
mrcao20
7bc2289c2f00a37905ef4e3a1be95dcd6e18a1c3
1,929
cpp
C++
Code/Runtime/Asset/CacheStream.cpp
NathanSaidas/LiteForgeMirror
84068b62bff6e443b53c46107a3946e2645e4447
[ "MIT" ]
null
null
null
Code/Runtime/Asset/CacheStream.cpp
NathanSaidas/LiteForgeMirror
84068b62bff6e443b53c46107a3946e2645e4447
[ "MIT" ]
null
null
null
Code/Runtime/Asset/CacheStream.cpp
NathanSaidas/LiteForgeMirror
84068b62bff6e443b53c46107a3946e2645e4447
[ "MIT" ]
null
null
null
// ******************************************************************** // Copyright (c) 2019 Nathan Hanlan // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files(the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and / or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions : // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // ******************************************************************** #include "CacheStream.h" #if defined(LF_OS_WINDOWS) #define WIN32_LEAN_AND_MEAN #define NOMINMAX #include <Windows.h> #endif namespace lf { struct CacheFile { HANDLE mCacheFile; HANDLE mManifestFile; }; void CacheStream::Open(StreamMode mode, const String& cacheFilename, const String& manifestFilename, SizeT fileSize) { mMode = mode; mCacheFilename = cacheFilename; mManifestFilename = manifestFilename; mFileSize = fileSize; // ManifestFile: // Object ID: (2 bytes) // Object Location (4 bytes) // Object Size (4 bytes) // Object Capacity (4 bytes) } void CacheStream::Close() { } } // namespace lf
34.446429
116
0.67859
NathanSaidas
7bc4194e25196b4cc5d934b22032c7f2a2d5ac11
6,520
cpp
C++
src/overlay_params.cpp
DasCapschen/DiRT-Rally-2.0-Telemetry-HUD
7eaa754d7791239753b9d9209d574b654d120eb6
[ "MIT" ]
4
2020-02-21T18:16:42.000Z
2021-08-23T16:46:48.000Z
src/overlay_params.cpp
DasCapschen/DiRT-Rally-2.0-Telemetry-HUD
7eaa754d7791239753b9d9209d574b654d120eb6
[ "MIT" ]
null
null
null
src/overlay_params.cpp
DasCapschen/DiRT-Rally-2.0-Telemetry-HUD
7eaa754d7791239753b9d9209d574b654d120eb6
[ "MIT" ]
1
2020-06-09T10:57:22.000Z
2020-06-09T10:57:22.000Z
/* * Copyright © 2019 Intel Corporation * * 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 (including the next * paragraph) shall be included in all copies or substantial portions of the * Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS * IN THE SOFTWARE. */ #include <stdio.h> #include <string.h> #include <stdlib.h> #include <fstream> #include <errno.h> #include <sys/sysinfo.h> #include "overlay_params.h" #include "config.h" #include "mesa/util/os_socket.h" static enum overlay_param_position parse_position(const char *str) { if (!str || !strcmp(str, "top-left")) return LAYER_POSITION_TOP_LEFT; if (!strcmp(str, "top-right")) return LAYER_POSITION_TOP_RIGHT; if (!strcmp(str, "bottom-left")) return LAYER_POSITION_BOTTOM_LEFT; if (!strcmp(str, "bottom-right")) return LAYER_POSITION_BOTTOM_RIGHT; return LAYER_POSITION_TOP_LEFT; } static float parse_font_size_small(const char *str) { return strtof(str, NULL); } static float parse_font_size_medium(const char *str) { return strtof(str, NULL); } static float parse_font_size_big(const char *str) { return strtof(str, NULL); } static float parse_background_alpha(const char *str) { return strtof(str, NULL); } static uint32_t parse_fps_limit(const char *str) { return strtol(str, NULL, 0); } static unsigned parse_unsigned(const char *str) { return strtol(str, NULL, 0); } #define parse_width(s) parse_unsigned(s) #define parse_height(s) parse_unsigned(s) #define parse_vsync(s) parse_unsigned(s) #define parse_offset_x(s) parse_unsigned(s) #define parse_offset_y(s) parse_unsigned(s) static bool is_delimiter(char c) { return c == 0 || c == ',' || c == ':' || c == ';' || c == '='; } static int parse_string(const char *s, char *out_param, char *out_value) { int i = 0; for (; !is_delimiter(*s); s++, out_param++, i++) *out_param = *s; *out_param = 0; if (*s == '=') { s++; i++; for (; !is_delimiter(*s); s++, out_value++, i++) *out_value = *s; } else *(out_value++) = '1'; *out_value = 0; if (*s && is_delimiter(*s)) { s++; i++; } if (*s && !i) { fprintf(stderr, "mesa-overlay: syntax error: unexpected '%c' (%i) while " "parsing a string\n", *s, *s); fflush(stderr); } return i; } const char *overlay_param_names[] = { #define OVERLAY_PARAM_BOOL(name) #name, #define OVERLAY_PARAM_CUSTOM(name) OVERLAY_PARAMS #undef OVERLAY_PARAM_BOOL #undef OVERLAY_PARAM_CUSTOM }; void parse_overlay_env(struct overlay_params *params, const char *env) { uint32_t num; char key[256], value[256]; while ((num = parse_string(env, key, value)) != 0) { env += num; #define OVERLAY_PARAM_BOOL(name) \ if (!strcmp(#name, key)) { \ params->enabled[OVERLAY_PARAM_ENABLED_##name] = \ strtol(value, NULL, 0); \ continue; \ } #define OVERLAY_PARAM_CUSTOM(name) \ if (!strcmp(#name, key)) { \ params->name = parse_##name(value); \ continue; \ } OVERLAY_PARAMS #undef OVERLAY_PARAM_BOOL #undef OVERLAY_PARAM_CUSTOM fprintf(stderr, "Unknown option '%s'\n", key); } } void parse_overlay_config(struct overlay_params *params, const char *env) { memset(params, 0, sizeof(*params)); /* Visible by default */ params->enabled[OVERLAY_PARAM_ENABLED_show_debug] = false; params->enabled[OVERLAY_PARAM_ENABLED_show_time] = true; params->enabled[OVERLAY_PARAM_ENABLED_show_progress] = true; params->enabled[OVERLAY_PARAM_ENABLED_show_gauge] = true; params->enabled[OVERLAY_PARAM_ENABLED_show_inputs] = true; params->enabled[OVERLAY_PARAM_ENABLED_show_springs] = false; params->width = 300; params->height = 300; params->fps_limit = 0; params->vsync = -1; params->offset_x = 0; params->offset_y = 0; params->background_alpha = 0.5; // first pass with env var if (env) { parse_overlay_env(params, env); } else { // Get config options parseConfigFile(); for (auto& it : options) { #define OVERLAY_PARAM_BOOL(name) \ if (it.first == #name) { \ params->enabled[OVERLAY_PARAM_ENABLED_##name] = \ strtol(it.second.c_str(), NULL, 0); \ continue; \ } #define OVERLAY_PARAM_CUSTOM(name) \ if (it.first == #name) { \ params->name = parse_##name(it.second.c_str()); \ continue; \ } OVERLAY_PARAMS #undef OVERLAY_PARAM_BOOL #undef OVERLAY_PARAM_CUSTOM fprintf(stderr, "Unknown option '%s'\n", it.first.c_str()); } } // second pass, override config file settings with MANGOHUD_CONFIG if (env) parse_overlay_env(params, env); if (!params->font_size_small) params->font_size_small = 16.0f; if (!params->font_size_medium) params->font_size_medium = 32.0f; if (!params->font_size_big) params->font_size_big = 48.0f; }
29.369369
79
0.596166
DasCapschen
7bc509aa911f1dba9daf558ccc7ed516521b31a3
789
hpp
C++
src/unpack_command.hpp
tzvetkoff/giffler
87133592e064f66a611ce9e00b670c20ec99dd82
[ "Beerware" ]
null
null
null
src/unpack_command.hpp
tzvetkoff/giffler
87133592e064f66a611ce9e00b670c20ec99dd82
[ "Beerware" ]
null
null
null
src/unpack_command.hpp
tzvetkoff/giffler
87133592e064f66a611ce9e00b670c20ec99dd82
[ "Beerware" ]
null
null
null
/* * ---------------------------------------------------------------------------- * "THE BEER-WARE LICENSE" (Revision 42): * <Latchezar Tzvetkoff> wrote this file. As long as you retain this notice you * can do whatever you want with this stuff. If we meet some day, and you think * this stuff is worth it, you can buy me a beer in return. Latchezar Tzvetkoff * ---------------------------------------------------------------------------- */ /* unpack_command.hpp */ #ifndef __giffler_unpack_command__ #define __giffler_unpack_command__ #include <iostream> namespace giffler { class UnpackCommand { private: std::string _in; std::string _out; public: UnpackCommand(int, char *const *); int execute(); }; } #endif /* !defined(__giffler_unpack_command__) */
21.916667
79
0.569075
tzvetkoff
7bc53ae94b3ca39bd14c3e0a7b5f30eb6c68be27
1,095
cpp
C++
test/math/convolution/fast_zeta_transform.test.cpp
emthrm/library
0876ba7ec64e23b5ec476a7a0b4880d497a36be1
[ "Unlicense" ]
1
2021-12-26T14:17:29.000Z
2021-12-26T14:17:29.000Z
test/math/convolution/fast_zeta_transform.test.cpp
emthrm/library
0876ba7ec64e23b5ec476a7a0b4880d497a36be1
[ "Unlicense" ]
3
2020-07-13T06:23:02.000Z
2022-02-16T08:54:26.000Z
test/math/convolution/fast_zeta_transform.test.cpp
emthrm/library
0876ba7ec64e23b5ec476a7a0b4880d497a36be1
[ "Unlicense" ]
null
null
null
/* * @brief 数学/畳み込み/高速ゼータ変換 */ #define PROBLEM "https://atcoder.jp/contests/arc100/tasks/arc100_e" // #define PROBLEM "https://atcoder.jp/contests/arc100/tasks/arc100_c" #include <algorithm> #include <functional> #include <iostream> #include <utility> #include <vector> #include "../../../math/convolution/fast_zeta_transform.hpp" int main() { using Pii = std::pair<int, int>; int n; std::cin >> n; std::vector<Pii> a(1 << n, {0, 0}); for (int i = 0; i < (1 << n); ++i) { std::cin >> a[i].first; } const std::function<Pii(Pii, Pii)> max = [](const Pii &a, const Pii &b) -> Pii { int tmp[]{a.first, a.second, b.first, b.second}; std::sort(tmp, tmp + 4, std::greater<int>()); return {tmp[0], tmp[1]}; }; a = fast_zeta_transform(a, false, {0, 0}, max); std::vector<int> ans(1 << n); for (int i = 0; i < (1 << n); ++i) { ans[i] = a[i].first + a[i].second; } for (int i = 1; i < (1 << n); ++i) { if (ans[i - 1] > ans[i]) { ans[i] = ans[i - 1]; } std::cout << ans[i] << '\n'; } return 0; }
27.375
83
0.527854
emthrm
7bc5b45449fe670815fcb8e5f14e42101ef1723c
3,168
cc
C++
Archive/Stroika_FINAL_for_STERL_1992/Tools/Portable/Emily/Sources/GroupInfo.cc
SophistSolutions/Stroika
f4e5d84767903a054fba0a6b9c7c4bd1aaefd105
[ "MIT" ]
28
2015-09-22T21:43:32.000Z
2022-02-28T01:35:01.000Z
Archive/Stroika_FINAL_for_STERL_1992/Tools/Portable/Emily/Sources/GroupInfo.cc
SophistSolutions/Stroika
f4e5d84767903a054fba0a6b9c7c4bd1aaefd105
[ "MIT" ]
98
2015-01-22T03:21:27.000Z
2022-03-02T01:47:00.000Z
Archive/Stroika_FINAL_for_STERL_1992/Tools/Portable/Emily/Sources/GroupInfo.cc
SophistSolutions/Stroika
f4e5d84767903a054fba0a6b9c7c4bd1aaefd105
[ "MIT" ]
4
2019-02-21T16:45:25.000Z
2022-02-18T13:40:04.000Z
/* Copyright(c) Sophist Solutions Inc. 1991-1992. All rights reserved */ /* * $Header: /fuji/lewis/RCS/GroupInfo.cc,v 1.4 1992/07/21 18:28:39 sterling Exp $ * * Description: * * TODO: * * Changes: * $Log: GroupInfo.cc,v $ * Revision 1.4 1992/07/21 18:28:39 sterling * hi * * Revision 1.3 1992/07/16 15:24:40 sterling * hi * * Revision 1.2 1992/06/25 10:15:58 sterling * *** empty log message *** * * Revision 1.17 1992/05/19 11:35:49 sterling * hi * * Revision 1.16 92/05/13 18:47:06 18:47:06 lewis (Lewis Pringle) * STERL. * * Revision 1.15 92/04/08 17:22:53 17:22:53 sterling (Sterling Wight) * Cleaned up dialogs for motif * * * * */ // text before here will be retained: Do not remove or modify this line!!! #include "Language.hh" #include "Shape.hh" #include "GroupInfo.hh" GroupInfoX::GroupInfoX () : fTitle (), fViewInfo () { #if qMacUI BuildForMacUI (); #elif qMotifUI BuildForMotifUI (); #else BuildForUnknownGUI (); #endif /* GUI */ } GroupInfoX::~GroupInfoX () { RemoveFocus (&fViewInfo); RemoveSubView (&fTitle); RemoveSubView (&fViewInfo); } #if qMacUI void GroupInfoX::BuildForMacUI () { SetSize (Point (220, 323), eNoUpdate); fTitle.SetExtent (5, 5, 16, 305, eNoUpdate); fTitle.SetFont (&kSystemFont); fTitle.SetText (" Set Group Info"); fTitle.SetJustification (AbstractTextView::eJustCenter); AddSubView (&fTitle); fViewInfo.SetExtent (29, 4, 188, 316, eNoUpdate); AddSubView (&fViewInfo); AddFocus (&fViewInfo); } #elif qMotifUI void GroupInfoX::BuildForMotifUI () { SetSize (Point (234, 323), eNoUpdate); fTitle.SetExtent (5, 5, 20, 313, eNoUpdate); fTitle.SetFont (&kSystemFont); fTitle.SetText (" Set Group Info"); fTitle.SetJustification (AbstractTextView::eJustCenter); AddSubView (&fTitle); fViewInfo.SetExtent (29, 4, 188, 316, eNoUpdate); AddSubView (&fViewInfo); AddFocus (&fViewInfo); } #else void GroupInfoX::BuildForUnknownGUI (); { SetSize (Point (220, 323), eNoUpdate); fTitle.SetExtent (5, 5, 16, 305, eNoUpdate); fTitle.SetFont (&kSystemFont); fTitle.SetText (" Set Group Info"); fTitle.SetJustification (AbstractTextView::eJustCenter); AddSubView (&fTitle); fViewInfo.SetExtent (29, 4, 188, 316, eNoUpdate); AddSubView (&fViewInfo); AddFocus (&fViewInfo); } #endif /* GUI */ Point GroupInfoX::CalcDefaultSize_ (const Point& /*defaultSize*/) const { #if qMacUI return (Point (220, 323)); #elif qMotifUI return (Point (234, 323)); #else return (Point (220, 323)); #endif /* GUI */ } void GroupInfoX::Layout () { const Point kSizeDelta = CalcDefaultSize () - GetSize (); static const Point kOriginalfTitleSize = fTitle.GetSize (); fTitle.SetSize (kOriginalfTitleSize - Point (0, kSizeDelta.GetH ())); static const Point kOriginalfViewInfoSize = fViewInfo.GetSize (); fViewInfo.SetSize (kOriginalfViewInfoSize - Point (kSizeDelta.GetV (), kSizeDelta.GetH ())); View::Layout (); } // text past here will be retained: Do not remove or modify this line!!! #include "GroupItem.hh" #include "Dialog.hh" GroupInfo::GroupInfo (GroupItem& view) { GetViewItemInfo ().SetUpFromView (view); }
20.842105
94
0.681503
SophistSolutions
dcf015aed94e44bff8b41f5101a846925c909be4
5,823
cc
C++
test/gtest/active_set/test_active_set.cc
edgargabriel/ucc
106e418e08b8a02dea3f20e0f6f530f9816246c2
[ "BSD-3-Clause" ]
null
null
null
test/gtest/active_set/test_active_set.cc
edgargabriel/ucc
106e418e08b8a02dea3f20e0f6f530f9816246c2
[ "BSD-3-Clause" ]
null
null
null
test/gtest/active_set/test_active_set.cc
edgargabriel/ucc
106e418e08b8a02dea3f20e0f6f530f9816246c2
[ "BSD-3-Clause" ]
null
null
null
/** * Copyright (C) Mellanox Technologies Ltd. 2022. ALL RIGHTS RESERVED. * See file LICENSE for terms. */ #include "common/test_ucc.h" typedef std::tuple<std::pair<int, int>, size_t, ucc_memory_type_t> op_t; using param = std::vector<op_t>; #define OP_T(_src, _dst, _size, _mt) ({ \ op_t _op(std::pair<int, int>(_src, _dst), _size, UCC_MEMORY_TYPE_ ## _mt); \ _op; \ }) class test_active_set : public ucc::test {}; class test_active_set_2 : public test_active_set, public ::testing::WithParamInterface<param> { public: std::vector<UccCollCtxVec> ctxs; void data_init(std::vector<op_t> &ops, UccTeam_h team) { ucc_rank_t tsize = team->procs.size(); ctxs.resize(ops.size()); for (int i = 0; i < ops.size(); i++) { ucc_rank_t src = std::get<0>(ops[i]).first; ucc_rank_t dst = std::get<0>(ops[i]).second; size_t msglen = std::get<1>(ops[i]); ucc_memory_type_t mt = std::get<2>(ops[i]); ctxs[i].resize(tsize); for (int j = 0; j < tsize; j++) { if (j != src && j != dst) { ctxs[i][j] = NULL; continue; } ctxs[i][j] = (gtest_ucc_coll_ctx_t*)calloc(1, sizeof(gtest_ucc_coll_ctx_t)); ucc_coll_args_t *coll = (ucc_coll_args_t*) calloc(1, sizeof(ucc_coll_args_t)); ctxs[i][j]->args = coll; coll->mask = UCC_COLL_ARGS_FIELD_ACTIVE_SET; coll->coll_type = UCC_COLL_TYPE_BCAST; coll->src.info.mem_type = mt; coll->src.info.count = (ucc_count_t)msglen; coll->src.info.datatype = UCC_DT_INT8; coll->root = src; coll->active_set.size = 2; coll->active_set.start = src; coll->active_set.stride = (int)dst - (int)src; ctxs[i][j]->rbuf_size = msglen; UCC_CHECK(ucc_mc_alloc(&ctxs[i][j]->src_mc_header, ctxs[i][j]->rbuf_size, mt)); coll->src.info.buffer = ctxs[i][j]->src_mc_header->addr; if (j == src) { ctxs[i][j]->init_buf = ucc_malloc(ctxs[i][j]->rbuf_size, "init buf"); EXPECT_NE(ctxs[i][j]->init_buf, nullptr); uint8_t *sbuf = (uint8_t*)ctxs[i][j]->init_buf; for (int k = 0; k < ctxs[i][j]->rbuf_size; k++) { sbuf[k] = (uint8_t)(src + k * dst); } UCC_CHECK(ucc_mc_memcpy(coll->src.info.buffer, ctxs[i][j]->init_buf, ctxs[i][j]->rbuf_size, mt, UCC_MEMORY_TYPE_HOST)); } } } } ~test_active_set_2() { for (int i = 0; i < ctxs.size(); i++) { for (int j = 0; j < ctxs[i].size(); j++ ) { gtest_ucc_coll_ctx_t *ctx = ctxs[i][j]; if (!ctx) { continue; } ucc_coll_args_t* coll = ctx->args; UCC_CHECK(ucc_mc_free(ctx->src_mc_header)); if (j == coll->root) { ucc_free(ctx->init_buf); } free(coll); free(ctx); } ctxs[i].clear(); } ctxs.clear(); } bool data_validate_one(UccCollCtxVec ctxs) { bool ret = true; int root = 0; ucc_rank_t src = 0, dst = 0; ucc_memory_type_t mem_type; uint8_t *rst; for (int i = 0; i < ctxs.size(); i++) { if (!ctxs[i]) { continue; } root = ctxs[i]->args->root; mem_type = ctxs[i]->args->src.info.mem_type; if (root == i) { src = i; } else { dst = i; } } rst = (uint8_t*) ucc_malloc(ctxs[root]->rbuf_size, "dsts buf"); EXPECT_NE(rst, nullptr); UCC_CHECK(ucc_mc_memcpy(rst, ctxs[dst]->args->src.info.buffer, ctxs[root]->rbuf_size, UCC_MEMORY_TYPE_HOST, mem_type)); for (int i = 0; i < ctxs[root]->rbuf_size; i++) { if ((uint8_t)(src + i * dst) != rst[i]) { ret = false; break; } } ucc_free(rst); return ret; } bool data_validate() { for (auto &c : ctxs) { if (true != data_validate_one(c)) { return false; } } return true; } }; UCC_TEST_P(test_active_set_2, single) { auto ops = GetParam(); UccTeam_h team = UccJob::getStaticTeams().back(); data_init(ops, team); for (auto &c : ctxs) { UccReq req(team, c); req.start(); req.wait(); } EXPECT_EQ(true, data_validate()); } UCC_TEST_P(test_active_set_2, multiple) { auto ops = GetParam(); UccTeam_h team = UccJob::getStaticTeams().back(); std::vector<UccReq> reqs; data_init(ops, team); for (auto &c : ctxs) { reqs.push_back(UccReq(team, c)); } UccReq::startall(reqs); UccReq::waitall(reqs); EXPECT_EQ(true, data_validate()); } INSTANTIATE_TEST_CASE_P( , test_active_set_2, ::testing::Values( std::vector<op_t>({ OP_T(0, 1, 8, HOST), OP_T(3, 7, 1024, HOST), OP_T(11, 3, 65530, HOST), OP_T(7, 5, 123456, HOST) })));
32.171271
92
0.458355
edgargabriel
dcf5536bb29ae71b60c5178414f51678e576aa3d
1,479
cpp
C++
src/lib/Checksum/Checksum.cpp
Flowm/move-on-helium-sensors
3794d38671e1976c9801bcb8a9639465cdddb731
[ "Apache-2.0" ]
1
2021-11-11T01:49:28.000Z
2021-11-11T01:49:28.000Z
src/lib/Checksum/Checksum.cpp
Flowm/move-on-helium-sensors
3794d38671e1976c9801bcb8a9639465cdddb731
[ "Apache-2.0" ]
null
null
null
src/lib/Checksum/Checksum.cpp
Flowm/move-on-helium-sensors
3794d38671e1976c9801bcb8a9639465cdddb731
[ "Apache-2.0" ]
null
null
null
/* * Checksum.cpp * * Created on: Jan 31, 2018 * Author: tkale */ #include "Checksum.hpp" /** * Calculate CRC-16-CCITT in hardware * * @param [in] data A pointer to the data * @param [in] len The length of the data * * WARNING: Doesnt seem to work! * * @return The CRC16 checksum of data * */ uint16_t Checksum::crc16hw(const uint8_t* data, uint16_t len) { uint32_t checksum = 0x00; __HAL_RCC_CRC_CLK_ENABLE(); CRC_HandleTypeDef crc; crc.InputDataFormat = CRC_INPUTDATA_FORMAT_HALFWORDS; crc.Init = { DEFAULT_POLYNOMIAL_DISABLE, DEFAULT_INIT_VALUE_DISABLE, 0x1021, CRC_POLYLENGTH_16B, checksum, CRC_OUTPUTDATA_INVERSION_DISABLE }; if(HAL_CRC_Init(&crc) == HAL_OK){ checksum = HAL_CRC_Calculate(&crc, (uint32_t*)data, len); }else { printf("CRC INIT ERROR!"); } HAL_CRC_DeInit(&crc); __HAL_RCC_CRC_CLK_DISABLE(); // printf("%lu\r\n",checksum); return checksum; } /** * Calculate CRC-16-CCITT * * @param [in] data A pointer to the data * @param [in] len The length of the data * * @return The CRC16 checksum of data * */ uint16_t Checksum::crc16sw(const uint8_t* data, uint16_t len, uint16_t init) { uint16_t crc = init; uint16_t x; while(len > 0) { x = crc >> 8 ^ *data++; x ^= x >> 4; crc = (crc << 8) ^ (x << 12) ^ (x << 5) ^ x; len--; } return crc; }
21.434783
76
0.592292
Flowm
dcf725601d6ec0b4e56d5e8ba920f99c73732588
4,631
cc
C++
src/worker/physical_data_instance.cc
schinmayee/nimbus
170cd15e24a7a88243a6ea80aabadc0fc0e6e177
[ "BSD-3-Clause" ]
20
2017-07-03T19:09:09.000Z
2021-09-10T02:53:56.000Z
src/worker/physical_data_instance.cc
schinmayee/nimbus
170cd15e24a7a88243a6ea80aabadc0fc0e6e177
[ "BSD-3-Clause" ]
null
null
null
src/worker/physical_data_instance.cc
schinmayee/nimbus
170cd15e24a7a88243a6ea80aabadc0fc0e6e177
[ "BSD-3-Clause" ]
9
2017-09-17T02:05:06.000Z
2020-01-31T00:12:01.000Z
/* * Copyright 2013 Stanford University. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * - Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * - Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the * distribution. * * - Neither the name of the copyright holders nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. */ /*********************************************************************** * AUTHOR: Philip Levis <pal> * FILE: .//physical_data_object.cc * DATE: Tue Dec 10 10:12:56 2013 * DESCR: ***********************************************************************/ #include "src/worker/physical_data_instance.h" namespace nimbus { /** * \fn nimbus::PhysicalDataInstance::PhysicalDataInstance() * \brief Brief description. * \return */ PhysicalDataInstance::PhysicalDataInstance() { } /** * \fn PhysicalDataInstance::PhysicalDataInstance(physical_data_id_t id, LogicalDataObject *lobj, Data *data, data_version_t version) * \brief Brief description. * \param id * \param lobj * \param data * \param version * \return */ PhysicalDataInstance::PhysicalDataInstance(physical_data_id_t i, const LogicalDataObject *lobj, Data *d, data_version_t v) { id_ = i; logical_object_ = lobj; data_ = d; version_ = v; } /** * \fn PhysicalDataInstance::~PhysicalDataInstance() * \brief Brief description. * \return */ PhysicalDataInstance::~PhysicalDataInstance() { } /** * \fn physical_data_id_t PhysicalDataInstance::id() * \brief Brief description. * \return */ physical_data_id_t PhysicalDataInstance::id() const { return id_; } /** * \fn std::string PhysicalDataInstance::variable() * \brief Brief description. * \return */ std::string PhysicalDataInstance::variable() const { return logical_object()->variable(); } /** * \fn GeometricRegion * PhysicalDataInstance::region() * \brief Brief description. * \return */ GeometricRegion * PhysicalDataInstance::region() const { return logical_object()->region(); } /** * \fn partition_id_t PhysicalDataInstance::partition() * \brief Brief description. * \return */ partition_id_t PhysicalDataInstance::partition() const { return logical_object()->partition(); } /** * \fn LogicalDataObject * PhysicalDataInstance::logical_object() * \brief Brief description. * \return */ const LogicalDataObject * PhysicalDataInstance::logical_object() const { return logical_object_; } /** * \fn data_version_t PhysicalDataInstance::version() * \brief Brief description. * \return */ data_version_t PhysicalDataInstance::version() const { return version_; } /** * \fn void PhysicalDataInstance::set_version(data_version_t version) * \brief Brief description. * \param version * \return */ void PhysicalDataInstance::set_version(data_version_t v) { version_ = v; } /** * \fn data_version_t PhysicalDataInstance::IncrementVersion() * \brief Brief description. * \return */ data_version_t PhysicalDataInstance::IncrementVersion() { version_++; return version_; } /** * \fn Data * PhysicalDataInstance::data() * \brief Brief description. * \return */ Data * PhysicalDataInstance::data() const { return data_; } } // namespace nimbus
25.727778
73
0.680415
schinmayee
dcfe1816ca31345c30fd5e8b9a7e1fb311340be3
1,707
cc
C++
lib/src/compiler/evaluation/operators/binary/match.cc
puppetlabs/puppetcpp
45c86f43414d5f6f76f49fc3a4c7e237e4fa2b04
[ "Apache-2.0" ]
22
2015-12-08T08:54:32.000Z
2019-04-28T11:31:04.000Z
lib/src/compiler/evaluation/operators/binary/match.cc
puppetlabs/puppetcpp
45c86f43414d5f6f76f49fc3a4c7e237e4fa2b04
[ "Apache-2.0" ]
37
2015-12-04T20:31:38.000Z
2017-04-17T05:00:25.000Z
lib/src/compiler/evaluation/operators/binary/match.cc
puppetlabs/puppetcpp
45c86f43414d5f6f76f49fc3a4c7e237e4fa2b04
[ "Apache-2.0" ]
6
2015-12-04T19:54:57.000Z
2021-03-24T12:16:46.000Z
#include <puppet/compiler/evaluation/operators/binary/match.hpp> #include <puppet/compiler/evaluation/operators/binary/call_context.hpp> #include <puppet/compiler/exceptions.hpp> #include <boost/format.hpp> using namespace std; using namespace puppet::runtime; namespace puppet { namespace compiler { namespace evaluation { namespace operators { namespace binary { bool is_match(call_context& context, string const& left, string const& right) { try { return values::regex{ right }.match(context.context(), left); } catch (utility::regex_exception const& ex) { throw evaluation_exception( (boost::format("invalid regular expression: %1%") % ex.what() ).str(), context.right_context(), context.context().backtrace() ); } } descriptor match::create_descriptor() { binary::descriptor descriptor{ ast::binary_operator::match }; descriptor.add("String", "String", [](call_context& context) { return is_match(context, context.left().require<string>(), context.right().require<string>()); }); descriptor.add("String", "Regexp", [](call_context& context) { return context.right().require<values::regex>().match(context.context(), context.left().require<string>()); }); descriptor.add("Any", "Type", [](call_context& context) { types::recursion_guard guard; return context.right().require<values::type>().is_instance(context.left(), guard); }); return descriptor; } }}}}} // namespace puppet::compiler::evaluation::operators::binary
38.795455
119
0.62273
puppetlabs
0d05be0a539ab2709befd17f4c1dd7575dcfc3fc
538
cpp
C++
791. Custom Sort String.cpp
ttang235/leetcode
ae2d6f61c80178f09de816210f53b00a838b0508
[ "MIT" ]
null
null
null
791. Custom Sort String.cpp
ttang235/leetcode
ae2d6f61c80178f09de816210f53b00a838b0508
[ "MIT" ]
null
null
null
791. Custom Sort String.cpp
ttang235/leetcode
ae2d6f61c80178f09de816210f53b00a838b0508
[ "MIT" ]
null
null
null
// https://leetcode.com/problems/custom-sort-string/description/ class Solution { public: string customSortString(string S, string T) { vector<int> cnt(26, 0); for(auto c : T) { cnt[c - 'a']++; } string res; for(auto c : S) { res += string(cnt[c-'a'], c); cnt[c-'a'] = 0; } for(int i = 0; i < 26; i++) { if(cnt[i] != 0) { res += string(cnt[i], char('a' + i)); } } return res; } };
23.391304
64
0.410781
ttang235
0d064ed4f1da137c1c12b430b7e50b792315d0d5
592
cpp
C++
src/ActiveBSP/src/ActorRegistry.cpp
fbaude/activebsp
d867d74e58bde38cc0f816bcb23c6c41a5bb4f81
[ "BSD-3-Clause" ]
null
null
null
src/ActiveBSP/src/ActorRegistry.cpp
fbaude/activebsp
d867d74e58bde38cc0f816bcb23c6c41a5bb4f81
[ "BSD-3-Clause" ]
null
null
null
src/ActiveBSP/src/ActorRegistry.cpp
fbaude/activebsp
d867d74e58bde38cc0f816bcb23c6c41a5bb4f81
[ "BSD-3-Clause" ]
null
null
null
#include "ActorRegistry.h" namespace activebsp { ActorRegistry * ActorRegistry::_instance = NULL; actor_registry_t & ActorRegistry::getActorRegistry() { static actor_registry_t * actor_handlers = new actor_registry_t(); return *actor_handlers; } ActorRegistry * ActorRegistry::getInstance() { if (_instance == NULL) { _instance = new ActorRegistry(); } return _instance; } ActorMaker::ActorMaker(const std::string name, const actor_handler_t & handler) { ActorRegistry::getInstance()->getActorRegistry()[name] = handler; } } // namespace activebsp
19.096774
79
0.716216
fbaude
0d07091ade61e54ebdde5051b8bcb2f3fb80e92b
1,376
cpp
C++
CepsyGLFramework/CepsyGLFramework/src/Graphics/AnimationData.cpp
cepsylon/CepsyGLFramework
72cf710c892ff34aeac5ed47b0b7799756a04032
[ "MIT" ]
null
null
null
CepsyGLFramework/CepsyGLFramework/src/Graphics/AnimationData.cpp
cepsylon/CepsyGLFramework
72cf710c892ff34aeac5ed47b0b7799756a04032
[ "MIT" ]
null
null
null
CepsyGLFramework/CepsyGLFramework/src/Graphics/AnimationData.cpp
cepsylon/CepsyGLFramework
72cf710c892ff34aeac5ed47b0b7799756a04032
[ "MIT" ]
null
null
null
#include "AnimationData.h" #include "Animation.h" #include "Application/Application.h" void AnimationData::update(float dt) { if (mAnimation) { mTime += dt; while (mAnimation->duration() < mTime) { mTime -= mAnimation->duration(); mPrevIndex = mIndex; mIndex = 0; } // TODO: fix this, we are assuming we rotate the root, it may not be the case while (mTime > (*mAnimation)[0].mRotation[mIndex].mTime) { mPrevIndex = mIndex; mIndex++; } } } void AnimationData::to_gui() { if (mAnimation.to_gui()) { mTime = 0.0f; mPrevIndex = 0u; mIndex = 1u; } } void AnimationData::upload_to_gpu() const { if (mAnimation) { std::vector<glm::mat4> matrices = get_matrices(); application.graphics().skeleton_buffer().update(matrices.data(), matrices.size() * sizeof(glm::mat4)); } } void AnimationData::set_animation(const std::string & name) { mAnimation = application.resources().get<Animation>(name); } std::vector<glm::mat4> AnimationData::get_matrices() const { // TODO: fix this, we are assuming we rotate the root, it may not be the case float t = mIndex == 0u ? mTime / (*mAnimation)[0].mRotation[mIndex].mTime : (mTime - (*mAnimation)[0].mRotation[mPrevIndex].mTime) / ((*mAnimation)[0].mRotation[mIndex].mTime - (*mAnimation)[0].mRotation[mPrevIndex].mTime); return mAnimation->get_matrices_at(t, mPrevIndex, mIndex); }
23.322034
149
0.682413
cepsylon
0d0ee44997b63c40eb884118f1e26ef043878730
13,769
hpp
C++
src/alia/flow/for_each.hpp
tmadden/alia
4abda686975e6b3ec52d7ef2bae8bed1cd810225
[ "MIT" ]
13
2019-10-03T09:05:18.000Z
2021-02-03T18:05:10.000Z
src/alia/flow/for_each.hpp
tmadden/alia
4abda686975e6b3ec52d7ef2bae8bed1cd810225
[ "MIT" ]
7
2018-07-06T16:30:58.000Z
2021-03-03T17:54:39.000Z
src/alia/flow/for_each.hpp
tmadden/alia
4abda686975e6b3ec52d7ef2bae8bed1cd810225
[ "MIT" ]
4
2019-10-03T09:06:03.000Z
2020-07-21T20:23:32.000Z
#ifndef ALIA_FLOW_FOR_EACH_HPP #define ALIA_FLOW_FOR_EACH_HPP #include <alia/flow/macros.hpp> #include <alia/signals/adaptors.hpp> #include <alia/signals/basic.hpp> #include <alia/signals/operators.hpp> namespace alia { // is_map_like<Container>::value yields a compile-time boolean indicating // whether or not Container behaves like a map for the purposes of alia // iteration and indexing. (This is determined by checking whether or not // Container has both a key_type and a mapped_type member.) template<class T, class = std::void_t<>> struct is_map_like : std::false_type { }; template<class T> struct is_map_like< T, std::void_t<typename T::key_type, typename T::mapped_type>> : std::true_type { }; // is_vector_like<Container>::value yields a compile-time boolean indicating // whether or not Container behaves like a vector for the purposes of alia // iteration and indexing. (This is determined by checking whether or not // Container can be subscripted with a size_t. This is sufficient because the // main purpose is to distinguish vector-like containers from list-like ones.) template<class Container, class = std::void_t<>> struct is_vector_like : std::false_type { }; template<class Container> struct is_vector_like< Container, std::void_t< typename Container::value_type, typename Container::size_type, decltype(std::declval<Container>().at(size_t(0)))>> : std::true_type { }; template<class Item> auto get_alia_item_id(Item const&) { return null_id; } // invoke_map_iteration_body selects the appropriate way to invoke the // iteration body function provided to for_each (for map-like containers). template< class IterationBody, class NamedBlockBegin, class Key, class Value, std::enable_if_t< std::is_invocable<IterationBody&&, naming_context&, Key&&, Value&&>:: value, int> = 0> void invoke_map_iteration_body( IterationBody&& body, naming_context& nc, NamedBlockBegin&&, Key&& key, Value&& value) { body(nc, key, value); } template< class IterationBody, class NamedBlockBegin, class Key, class Value, std::enable_if_t< std::is_invocable<IterationBody&&, Key&&, Value&&>::value, int> = 0> void invoke_map_iteration_body( IterationBody&& body, naming_context&, NamedBlockBegin&& nb_begin, Key&& key, Value&& value) { named_block nb; nb_begin(nb); body(key, value); } // for_each for map-like containers template< class Context, class ContainerSignal, class Fn, std::enable_if_t< is_signal_type<ContainerSignal>::value && is_map_like<typename ContainerSignal::value_type>::value, int> = 0> void for_each(Context ctx, ContainerSignal const& container_signal, Fn&& fn) { ALIA_IF(has_value(container_signal)) { naming_context nc(ctx); auto const& container = read_signal(container_signal); for (auto const& item : container) { auto key = direct(item.first); auto value = container_signal[key]; invoke_map_iteration_body( fn, nc, [&](named_block& nb) { nb.begin(nc, make_id(item.first)); }, key, value); } } ALIA_END } // invoke_sequence_iteration_body selects the appropriate way to invoke the // iteration body function provided to for_each (for sequence containers). template< class IterationBody, class NamedBlockBegin, class Item, std::enable_if_t< std::is_invocable<IterationBody&&, naming_context&, size_t, Item&&>:: value, int> = 0> void invoke_sequence_iteration_body( IterationBody&& body, naming_context& nc, NamedBlockBegin&&, size_t index, Item&& item) { body(nc, index, item); } template< class IterationBody, class NamedBlockBegin, class Item, std::enable_if_t< std::is_invocable<IterationBody&&, size_t, Item&&>::value, int> = 0> void invoke_sequence_iteration_body( IterationBody&& body, naming_context&, NamedBlockBegin&& nb_begin, size_t index, Item&& item) { named_block nb; nb_begin(nb); body(index, item); } template< class IterationBody, class NamedBlockBegin, class Item, std::enable_if_t< std::is_invocable<IterationBody&&, naming_context&, Item&&>::value, int> = 0> void invoke_sequence_iteration_body( IterationBody&& body, naming_context& nc, NamedBlockBegin&&, size_t, Item&& item) { body(nc, item); } template< class IterationBody, class NamedBlockBegin, class Item, std::enable_if_t< std::is_invocable<IterationBody&&, Item&&>::value, int> = 0> void invoke_sequence_iteration_body( IterationBody&& body, naming_context&, NamedBlockBegin&& nb_begin, size_t, Item&& item) { named_block nb; nb_begin(nb); body(item); } // for_each for signals carrying vector-like containers template< class Context, class ContainerSignal, class Fn, std::enable_if_t< is_signal_type<ContainerSignal>::value && !is_map_like<typename ContainerSignal::value_type>::value && is_vector_like<typename ContainerSignal::value_type>::value, int> = 0> void for_each(Context ctx, ContainerSignal const& container_signal, Fn&& fn) { ALIA_IF(has_value(container_signal)) { naming_context nc(ctx); auto const& container = read_signal(container_signal); size_t const item_count = container.size(); for (size_t index = 0; index != item_count; ++index) { invoke_sequence_iteration_body( fn, nc, [&](named_block& nb) { auto iteration_id = get_alia_item_id(container[index]); if (iteration_id != null_id) nb.begin(nc, iteration_id); else nb.begin(nc, make_id(index)); }, index, container_signal[value(index)]); } } ALIA_END } // for_each for vector-like containers of signals template< class Context, class Container, class Fn, std::enable_if_t< !is_signal_type< std::remove_cv_t<std::remove_reference_t<Container>>>::value && !is_map_like< std::remove_cv_t<std::remove_reference_t<Container>>>::value && is_vector_like< std::remove_cv_t<std::remove_reference_t<Container>>>::value && is_signal_type<typename std::remove_cv_t< std::remove_reference_t<Container>>::value_type>::value, int> = 0> void for_each(Context ctx, Container&& container, Fn&& fn) { naming_context nc(ctx); size_t index = 0; for (auto&& item : container) { invoke_sequence_iteration_body( fn, nc, [&](named_block& nb) { // We don't try to use get_alia_item_id() here because we want // to support the use case where the UI is present even when // the item isn't available, and we want to keep the block ID // stable in that scenario. nb.begin(nc, make_id(index)); }, index, item); ++index; } } // for_each for vector-like containers of raw values template< class Context, class Container, class Fn, std::enable_if_t< !is_signal_type< std::remove_cv_t<std::remove_reference_t<Container>>>::value && !is_map_like< std::remove_cv_t<std::remove_reference_t<Container>>>::value && is_vector_like< std::remove_cv_t<std::remove_reference_t<Container>>>::value && !is_signal_type<typename std::remove_cv_t< std::remove_reference_t<Container>>::value_type>::value, int> = 0> void for_each(Context ctx, Container&& container, Fn&& fn) { naming_context nc(ctx); size_t index = 0; for (auto&& item : container) { invoke_sequence_iteration_body( fn, nc, [&](named_block& nb) { auto iteration_id = get_alia_item_id(item); if (iteration_id != null_id) nb.begin(nc, iteration_id); else nb.begin(nc, make_id(index)); }, index, item); ++index; } } // signal type for accessing items within a list template<class ListSignal, class Item> struct list_item_signal : signal< list_item_signal<ListSignal, Item>, Item, typename ListSignal::capabilities> { list_item_signal(ListSignal const& list_signal, size_t index, Item* item) : list_signal_(list_signal), index_(index), item_(item) { } id_interface const& value_id() const { id_ = combine_ids(ref(list_signal_.value_id()), make_id(index_)); return id_; } bool has_value() const { return list_signal_.has_value(); } Item const& read() const { return *item_; } Item move_out() const { return *item_; } Item& destructive_ref() const { return *item_; } bool ready_to_write() const { return list_signal_.ready_to_write(); } id_interface const& write(Item value) const { *item_ = std::move(value); return null_id; } private: ListSignal list_signal_; size_t index_; Item* item_; mutable id_pair<id_ref, simple_id<size_t>> id_; }; template<class ListSignal, class Item> list_item_signal<ListSignal, Item> make_list_item_signal(ListSignal const& signal, size_t index, Item const* item) { return list_item_signal<ListSignal, Item>( signal, index, const_cast<Item*>(item)); } // for_each for list-like signal containers template< class Context, class ContainerSignal, class Fn, std::enable_if_t< is_signal_type<ContainerSignal>::value && !is_map_like<typename ContainerSignal::value_type>::value && !is_vector_like<typename ContainerSignal::value_type>::value, int> = 0> void for_each(Context ctx, ContainerSignal const& container_signal, Fn&& fn) { ALIA_IF(has_value(container_signal)) { naming_context nc(ctx); auto const& container = read_signal(container_signal); size_t index = 0; for (auto const& item : container) { invoke_sequence_iteration_body( fn, nc, [&](named_block& nb) { auto iteration_id = get_alia_item_id(item); if (iteration_id != null_id) nb.begin(nc, iteration_id); else nb.begin(nc, make_id(&item)); }, index, make_list_item_signal(container_signal, index, &item)); ++index; } } ALIA_END } // for_each for list-like containers of signals template< class Context, class Container, class Fn, std::enable_if_t< !is_signal_type< std::remove_cv_t<std::remove_reference_t<Container>>>::value && !is_map_like< std::remove_cv_t<std::remove_reference_t<Container>>>::value && !is_vector_like< std::remove_cv_t<std::remove_reference_t<Container>>>::value && is_signal_type<typename std::remove_cv_t< std::remove_reference_t<Container>>::value_type>::value, int> = 0> void for_each(Context ctx, Container&& container, Fn&& fn) { naming_context nc(ctx); size_t index = 0; for (auto&& item : container) { invoke_sequence_iteration_body( fn, nc, [&](named_block& nb) { // We don't try to use get_alia_item_id() here because we want // to support the use case where the UI is present even when // the item isn't available, and we want to keep the block ID // stable in that scenario. nb.begin(nc, make_id(&item)); }, index, item); ++index; } } // for_each for list-like containers of raw values template< class Context, class Container, class Fn, std::enable_if_t< !is_signal_type< std::remove_cv_t<std::remove_reference_t<Container>>>::value && !is_map_like< std::remove_cv_t<std::remove_reference_t<Container>>>::value && !is_vector_like< std::remove_cv_t<std::remove_reference_t<Container>>>::value && !is_signal_type<typename std::remove_cv_t< std::remove_reference_t<Container>>::value_type>::value, int> = 0> void for_each(Context ctx, Container&& container, Fn&& fn) { naming_context nc(ctx); size_t index = 0; for (auto&& item : container) { invoke_sequence_iteration_body( fn, nc, [&](named_block& nb) { auto iteration_id = get_alia_item_id(item); if (iteration_id != null_id) nb.begin(nc, iteration_id); else nb.begin(nc, make_id(&item)); }, index, item); ++index; } } } // namespace alia #endif
27.816162
79
0.597792
tmadden
0d1b8a5ee0a0e3d963a4a9c2dc913b838395b83e
15,548
cpp
C++
sunvox_engine/psynth/psynths_filter.cpp
Sound-Linux-More/sunvox
7376fbe9f9bca92be1e17aefaac2e68b558d8357
[ "BSD-3-Clause" ]
100
2016-01-15T02:43:07.000Z
2022-03-16T14:02:38.000Z
sunvox_engine/psynth/psynths_filter.cpp
Sound-Linux-More/sunvox
7376fbe9f9bca92be1e17aefaac2e68b558d8357
[ "BSD-3-Clause" ]
2
2018-01-10T18:21:37.000Z
2021-12-05T01:48:08.000Z
sunvox_engine/psynth/psynths_filter.cpp
Sound-Linux-More/sunvox
7376fbe9f9bca92be1e17aefaac2e68b558d8357
[ "BSD-3-Clause" ]
17
2016-05-16T19:48:19.000Z
2022-03-23T10:59:42.000Z
/* psynths_filter.cpp. This file is part of the SunVox engine. Copyright (C) 2002 - 2008 Alex Zolotov <nightradio@gmail.com> */ #include "psynth.h" //Unique names for objects in your synth: #define SYNTH_DATA filter_data #define SYNTH_HANDLER psynth_filter //And unique parameters: #define SYNTH_INPUTS 2 #define SYNTH_OUTPUTS 2 struct filter_channel { STYPE_CALC d1, d2, d3; }; /* uint16 g_exp_table[ 256 ] = { 256, 256, 257, 258, 258, 259, 260, 260, 261, 262, 263, 263, 264, 265, 265, 266, 267, 268, 268, 269, 270, 270, 271, 272, 273, 273, 274, 275, 276, 276, 277, 278, 279, 279, 280, 281, 282, 282, 283, 284, 285, 286, 286, 287, 288, 289, 289, 290, 291, 292, 293, 293, 294, 295, 296, 297, 297, 298, 299, 300, 301, 301, 302, 303, 304, 305, 306, 306, 307, 308, 309, 310, 311, 311, 312, 313, 314, 315, 316, 317, 317, 318, 319, 320, 321, 322, 323, 323, 324, 325, 326, 327, 328, 329, 330, 331, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 410, 411, 412, 413, 414, 415, 416, 417, 419, 420, 421, 422, 423, 424, 425, 427, 428, 429, 430, 431, 432, 434, 435, 436, 437, 438, 439, 441, 442, 443, 444, 445, 447, 448, 449, 450, 452, 453, 454, 455, 456, 458, 459, 460, 461, 463, 464, 465, 466, 468, 469, 470, 472, 473, 474, 475, 477, 478, 479, 481, 482, 483, 485, 486, 487, 488, 490, 491, 492, 494, 495, 496, 498, 499, 501, 502, 503, 505, 506, 507, 509, 510, }; */ enum { MODE_HQ = 0, MODE_HQ_MONO, MODE_LQ, MODE_LQ_MONO, MODES }; struct SYNTH_DATA { //Controls: ############################################################ CTYPE ctl_volume; CTYPE ctl_cutoff_freq; CTYPE ctl_resonance; CTYPE ctl_type; CTYPE ctl_response; CTYPE ctl_mode; CTYPE ctl_impulse; CTYPE ctl_mix; //Synth data: ########################################################## filter_channel fchan[ SYNTH_OUTPUTS ]; uint16 *exp_table; int tick_counter; //From 0 to tick_size CTYPE floating_volume; CTYPE floating_cutoff; CTYPE floating_resonance; }; int SYNTH_HANDLER( PSYTEXX_SYNTH_PARAMETERS ) { psynth_net *pnet = (psynth_net*)net; SYNTH_DATA *data = (SYNTH_DATA*)data_ptr; int retval = 0; switch( command ) { case COMMAND_GET_DATA_SIZE: retval = sizeof( SYNTH_DATA ); break; case COMMAND_GET_SYNTH_NAME: retval = (int)"Filter"; break; case COMMAND_GET_SYNTH_INFO: retval = (int)"State Variable Filter\n(Chamberlin version)\nDouble Sampled\n\n\ References: \n\ http://musicdsp.org/archive.php?classid=3 \n\ Hal Chamberlin, \"Musical Applications of Microprocessors\"\n\ 2nd Ed, Hayden Book Company 1985. pp 490-492.\n\n\ Use low \"response\" values\nfor smooth frequency, resonance\nor volume change"; break; case COMMAND_GET_INPUTS_NUM: retval = SYNTH_INPUTS; break; case COMMAND_GET_OUTPUTS_NUM: retval = SYNTH_OUTPUTS; break; case COMMAND_GET_FLAGS: retval = PSYNTH_FLAG_EFFECT; break; case COMMAND_INIT: psynth_register_ctl( synth_id, "Volume", "", 0, 256, 256, 0, &data->ctl_volume, net ); psynth_register_ctl( synth_id, "Freq", "Hz", 0, 14000, 14000, 0, &data->ctl_cutoff_freq, net ); psynth_register_ctl( synth_id, "Resonance", "", 0, 1530, 0, 0, &data->ctl_resonance, net ); psynth_register_ctl( synth_id, "Type", "l/h/b/n", 0, 3, 0, 1, &data->ctl_type, net ); psynth_register_ctl( synth_id, "Response", "", 0, 256, 256, 0, &data->ctl_response, net ); psynth_register_ctl( synth_id, "Mode", "HQ/HQmono/LQ/LQmono", 0, MODE_LQ_MONO, MODE_HQ, 1, &data->ctl_mode, net ); psynth_register_ctl( synth_id, "Impulse", "Hz", 0, 14000, 0, 0, &data->ctl_impulse, net ); psynth_register_ctl( synth_id, "Mix", "", 0, 256, 256, 0, &data->ctl_mix, net ); data->floating_volume = 256 * 256; data->floating_cutoff = 14000 * 256; data->floating_resonance = 0 * 256; for( int i = 0; i < SYNTH_OUTPUTS; i++ ) { data->fchan[ i ].d1 = 0; data->fchan[ i ].d2 = 0; data->fchan[ i ].d3 = 0; } data->tick_counter = 0; //data->exp_table = g_exp_table; retval = 1; break; case COMMAND_CLEAN: case COMMAND_ALL_NOTES_OFF: for( int i = 0; i < SYNTH_OUTPUTS; i++ ) { data->fchan[ i ].d1 = 0; data->fchan[ i ].d2 = 0; data->fchan[ i ].d3 = 0; } data->tick_counter = 0; retval = 1; break; case COMMAND_RENDER_REPLACE: if( !inputs[ 0 ] || !outputs[ 0 ] ) break; { if( data->ctl_mode == MODE_HQ_MONO || data->ctl_mode == MODE_LQ_MONO ) psynth_set_number_of_outputs( 1, synth_id, pnet ); else psynth_set_number_of_outputs( SYNTH_OUTPUTS, synth_id, pnet ); int tick_size = pnet->sampling_freq / 200; int ptr = 0; if( data->ctl_impulse ) { data->floating_cutoff = data->ctl_impulse * 256; data->ctl_impulse = 0; } while( 1 ) { int buf_size = tick_size - data->tick_counter; if( ptr + buf_size > sample_frames ) buf_size = sample_frames - ptr; int outputs_num = psynth_get_number_of_outputs( synth_id, pnet ); for( int ch = 0; ch < outputs_num; ch++ ) { STYPE *in = inputs[ ch ]; STYPE *out = outputs[ ch ]; //References: // http://musicdsp.org/archive.php?classid=3 // Hal Chamberlin, "Musical Applications of Microprocessors," 2nd Ed, Hayden Book Company 1985. pp 490-492. int fs, c, f, q, scale; fs = pnet->sampling_freq; if( data->ctl_mode == MODE_HQ || data->ctl_mode == MODE_HQ_MONO ) { //HQ: c = ( ( data->floating_cutoff / 256 ) * 32768 ) / ( fs * 2 ); f = ( 6433 * c ) / 32768; if( f >= 1024 ) f = 1023; q = 1536 - ( data->floating_resonance / 256 ); scale = q; } if( data->ctl_mode == MODE_LQ || data->ctl_mode == MODE_LQ_MONO ) { //LQ: c = ( ( ( data->floating_cutoff / 256 ) / 2 ) * 32768 ) / fs; f = ( 6433 * c ) / 32768; if( f >= 1024 ) f = 1023; q = 1536 - ( data->floating_resonance / 256 ); scale = q; } filter_channel *fchan = &data->fchan[ ch ]; STYPE_CALC d1 = fchan->d1; STYPE_CALC d2 = fchan->d2; STYPE_CALC d3 = fchan->d3; int vol = ( data->floating_volume /256 ); if( data->ctl_mix == 0 ) { //Filter disabled: if( vol == 256 ) { for( int i = ptr; i < ptr + buf_size; i++ ) out[ i ] = in[ i ]; } else { for( int i = ptr; i < ptr + buf_size; i++ ) { STYPE_CALC inp = in[ i ]; inp *= vol; inp /= 256; out[ i ] = (STYPE)inp; } } } else { //Filter enabled start: vol *= data->ctl_mix; vol /= 256; if( data->ctl_mode == MODE_HQ || data->ctl_mode == MODE_HQ_MONO ) switch( data->ctl_type ) { case 0: for( int i = ptr; i < ptr + buf_size; i++ ) { STYPE_CALC inp = in[ i ]; denorm_add_white_noise( inp ); #ifndef STYPE_FLOATINGPOINT inp *= 32; #endif STYPE_CALC low = d2 + ( f * d1 ) / 1024; STYPE_CALC high = inp - low - ( q * d1 ) / 1024; STYPE_CALC band = ( f * high ) / 1024 + d1; STYPE_CALC slow = low; low = low + ( f * band ) / 1024; high = inp - low - ( q * band ) / 1024; band = ( f * high ) / 1024 + band; STYPE_CALC outp; #ifndef STYPE_FLOATINGPOINT outp = ( ( d2 + slow ) / 2 ) / 32; #else outp = ( d2 + slow ) / 2; #endif outp *= vol; outp /= 256; d1 = band; d2 = low; out[ i ] = (STYPE)outp; } break; case 1: for( int i = ptr; i < ptr + buf_size; i++ ) { STYPE_CALC inp = in[ i ]; denorm_add_white_noise( inp ); #ifndef STYPE_FLOATINGPOINT inp *= 32; #endif STYPE_CALC low = d2 + ( f * d1 ) / 1024; STYPE_CALC high = inp - low - ( q * d1 ) / 1024; STYPE_CALC band = ( f * high ) / 1024 + d1; STYPE_CALC shigh = high; low = low + ( f * band ) / 1024; high = inp - low - ( q * band ) / 1024; band = ( f * high ) / 1024 + band; STYPE_CALC outp; #ifndef STYPE_FLOATINGPOINT outp = ( ( d3 + shigh ) / 2 ) / 32; #else outp = ( d3 + shigh ) / 2; #endif outp *= vol; outp /= 256; d1 = band; d2 = low; d3 = high; out[ i ] = (STYPE)outp; } break; case 2: for( int i = ptr; i < ptr + buf_size; i++ ) { STYPE_CALC inp = in[ i ]; denorm_add_white_noise( inp ); #ifndef STYPE_FLOATINGPOINT inp *= 32; #endif STYPE_CALC low = d2 + ( f * d1 ) / 1024; STYPE_CALC high = inp - low - ( q * d1 ) / 1024; STYPE_CALC band = ( f * high ) / 1024 + d1; STYPE_CALC sband = band; low = low + ( f * band ) / 1024; high = inp - low - ( q * band ) / 1024; band = ( f * high ) / 1024 + band; STYPE_CALC outp; #ifndef STYPE_FLOATINGPOINT outp = ( ( d1 + sband ) / 2 ) / 32; #else outp = ( d1 + sband ) / 2; #endif outp *= vol; outp /= 256; d1 = band; d2 = low; out[ i ] = (STYPE)outp; } break; case 3: for( int i = ptr; i < ptr + buf_size; i++ ) { STYPE_CALC inp = in[ i ]; denorm_add_white_noise( inp ); #ifndef STYPE_FLOATINGPOINT inp *= 32; #endif STYPE_CALC low = d2 + ( f * d1 ) / 1024; STYPE_CALC high = inp - low - ( q * d1 ) / 1024; STYPE_CALC band = ( f * high ) / 1024 + d1; STYPE_CALC snotch = high + low; low = low + ( f * band ) / 1024; high = inp - low - ( q * band ) / 1024; band = ( f * high ) / 1024 + band; STYPE_CALC outp; #ifndef STYPE_FLOATINGPOINT outp = ( ( d3 + snotch ) / 2 ) / 32; #else outp = ( d3 + snotch ) / 2; #endif outp *= vol; outp /= 256; d1 = band; d2 = low; d3 = high + low; out[ i ] = (STYPE)outp; } break; } if( data->ctl_mode == MODE_LQ || data->ctl_mode == MODE_LQ_MONO ) switch( data->ctl_type ) { case 0: for( int i = ptr; i < ptr + buf_size; i++ ) { STYPE_CALC inp = in[ i ]; denorm_add_white_noise( inp ); #ifndef STYPE_FLOATINGPOINT inp *= 32; #endif STYPE_CALC low = d2 + ( f * d1 ) / 1024; STYPE_CALC high = inp - low - ( q * d1 ) / 1024; STYPE_CALC band = ( f * high ) / 1024 + d1; STYPE_CALC outp; #ifndef STYPE_FLOATINGPOINT outp = low / 32; #else outp = low; #endif outp *= vol; outp /= 256; d1 = band; d2 = low; out[ i ] = (STYPE)outp; } break; case 1: for( int i = ptr; i < ptr + buf_size; i++ ) { STYPE_CALC inp = in[ i ]; denorm_add_white_noise( inp ); #ifndef STYPE_FLOATINGPOINT inp *= 32; #endif STYPE_CALC low = d2 + ( f * d1 ) / 1024; STYPE_CALC high = inp - low - ( q * d1 ) / 1024; STYPE_CALC band = ( f * high ) / 1024 + d1; STYPE_CALC outp; #ifndef STYPE_FLOATINGPOINT outp = high / 32; #else outp = high; #endif outp *= vol; outp /= 256; d1 = band; d2 = low; out[ i ] = (STYPE)outp; } break; case 2: for( int i = ptr; i < ptr + buf_size; i++ ) { STYPE_CALC inp = in[ i ]; denorm_add_white_noise( inp ); #ifndef STYPE_FLOATINGPOINT inp *= 32; #endif STYPE_CALC low = d2 + ( f * d1 ) / 1024; STYPE_CALC high = inp - low - ( q * d1 ) / 1024; STYPE_CALC band = ( f * high ) / 1024 + d1; STYPE_CALC outp; #ifndef STYPE_FLOATINGPOINT outp = band / 32; #else outp = band; #endif outp *= vol; outp /= 256; d1 = band; d2 = low; out[ i ] = (STYPE)outp; } break; case 3: for( int i = ptr; i < ptr + buf_size; i++ ) { STYPE_CALC inp = in[ i ]; denorm_add_white_noise( inp ); #ifndef STYPE_FLOATINGPOINT inp *= 32; #endif STYPE_CALC low = d2 + ( f * d1 ) / 1024; STYPE_CALC high = inp - low - ( q * d1 ) / 1024; STYPE_CALC band = ( f * high ) / 1024 + d1; STYPE_CALC outp; #ifndef STYPE_FLOATINGPOINT outp = ( high + low ) / 32; #else outp = high + low; #endif outp *= vol; outp /= 256; d1 = band; d2 = low; out[ i ] = (STYPE)outp; } break; } if( data->ctl_mix < 256 ) { //Mix result with source: int vol2 = ( data->floating_volume / 256 ); vol2 *= ( 256 - data->ctl_mix ); vol2 /= 256; for( int i = ptr; i < ptr + buf_size; i++ ) { STYPE_CALC inp = in[ i ]; inp *= vol2; inp /= 256; inp += out[ i ]; out[ i ] = (STYPE)inp; } } //...filter enabled end. } fchan->d1 = d1; fchan->d2 = d2; fchan->d3 = d3; } ptr += buf_size; data->tick_counter += buf_size; if( data->tick_counter >= tick_size ) { //Handle filter's tick: if( data->floating_cutoff / 256 > data->ctl_cutoff_freq ) { data->floating_cutoff -= data->ctl_response * 14000; if( data->floating_cutoff / 256 < data->ctl_cutoff_freq ) data->floating_cutoff = data->ctl_cutoff_freq * 256; } else if( data->floating_cutoff / 256 < data->ctl_cutoff_freq ) { data->floating_cutoff += data->ctl_response * 14000; if( data->floating_cutoff / 256 > data->ctl_cutoff_freq ) data->floating_cutoff = data->ctl_cutoff_freq * 256; } if( data->floating_resonance / 256 > data->ctl_resonance ) { data->floating_resonance -= data->ctl_response * 1530; if( data->floating_resonance / 256 < data->ctl_resonance ) data->floating_resonance = data->ctl_resonance * 256; } else if( data->floating_resonance / 256 < data->ctl_resonance ) { data->floating_resonance += data->ctl_response * 1530; if( data->floating_resonance / 256 > data->ctl_resonance ) data->floating_resonance = data->ctl_resonance * 256; } if( data->floating_volume / 256 > data->ctl_volume ) { data->floating_volume -= data->ctl_response * 256; if( data->floating_volume / 256 < data->ctl_volume ) data->floating_volume = data->ctl_volume * 256; } else if( data->floating_volume / 256 < data->ctl_volume ) { data->floating_volume += data->ctl_volume * 256; if( data->floating_volume / 256 > data->ctl_volume ) data->floating_volume = data->ctl_volume * 256; } data->tick_counter = 0; } if( ptr >= sample_frames ) break; } } retval = 1; break; case COMMAND_CLOSE: retval = 1; break; } return retval; }
27.087108
120
0.532223
Sound-Linux-More
0d1e04e5a4921062282dee077c13d3c21d9bf460
449
hpp
C++
include/Inputs.hpp
fu7mu4/entonetics
d0b2643f039a890b25d5036cc94bfe3b4d840480
[ "MIT" ]
null
null
null
include/Inputs.hpp
fu7mu4/entonetics
d0b2643f039a890b25d5036cc94bfe3b4d840480
[ "MIT" ]
null
null
null
include/Inputs.hpp
fu7mu4/entonetics
d0b2643f039a890b25d5036cc94bfe3b4d840480
[ "MIT" ]
null
null
null
#ifndef ENTO_INPUTS_HPP_INCLUDED #define ENTO_INPUTS_HPP_INCLUDED #include "Inputer.hpp" namespace ento { class Entomon_inputer : public Inputer { public: Entomon_inputer( void ); float lateral( void ) const { return m_lateral; } bool jumping( void ) const { return m_jumping; } protected: virtual void update( float dt, const sf::Input& current ); private: float m_lateral; bool m_jumping; }; } #endif // ENTO_INPUTS_HPP_INCLUDED
14.483871
59
0.743875
fu7mu4
0d2058ee7b206d3ca75aaa0e944ca25408010533
20,840
cpp
C++
src/engine/visibility/quadtree.cpp
dream-overflow/o3d
087ab870cc0fd9091974bb826e25c23903a1dde0
[ "FSFAP" ]
2
2019-06-22T23:29:44.000Z
2019-07-07T18:34:04.000Z
src/engine/visibility/quadtree.cpp
dream-overflow/o3d
087ab870cc0fd9091974bb826e25c23903a1dde0
[ "FSFAP" ]
null
null
null
src/engine/visibility/quadtree.cpp
dream-overflow/o3d
087ab870cc0fd9091974bb826e25c23903a1dde0
[ "FSFAP" ]
null
null
null
/** * @file quadtree.cpp * @brief * @author Emmanuel RUFFIO (emmanuel.ruffio@gmail.com) * @author Frederic SCHERMA (frederic.scherma@dreamoverflow.org) * @date 2001-12-25 * @copyright Copyright (c) 2001-2017 Dream Overflow. All rights reserved. * @details */ #include "o3d/engine/precompiled.h" #include "o3d/engine/visibility/quadtree.h" #include "o3d/engine/visibility/visibilitymanager.h" #include "o3d/engine/scene/scene.h" #include "o3d/engine/object/camera.h" #include "o3d/engine/object/light.h" #include "o3d/geom/frustum.h" #include "o3d/core/vector2.h" #include "o3d/core/vector3.h" #include "o3d/geom/plane.h" #include "o3d/engine/context.h" #include "o3d/engine/matrix.h" #include "o3d/engine/primitive/primitivemanager.h" #include <algorithm> using namespace o3d; //--------------------------------------------------------------------------------------- // class QuadObject //--------------------------------------------------------------------------------------- QuadObject::QuadObject(Quadtree * _pQuadTree, SceneObject * _object): m_pObject(_object), m_pQuadTree(_pQuadTree) { } QuadObject::~QuadObject() { onDestroyed(); } void QuadObject::addZoneContainer(QuadZone * _zone) { O3D_ASSERT(std::find(m_zoneList.begin(), m_zoneList.end(), _zone) == m_zoneList.end()); m_zoneList.push_back(_zone); } void QuadObject::removeZoneContainer(QuadZone * _zone) { IT_QuadZoneList it = std::find(m_zoneList.begin(), m_zoneList.end(), _zone); O3D_ASSERT(it != m_zoneList.end()); m_zoneList.erase(it); if (m_zoneList.size() == 0) { onUnused(); } } //--------------------------------------------------------------------------------------- // class QuadZone //--------------------------------------------------------------------------------------- QuadZone::QuadZone(Quadtree * _quad, Vector2i _position, Float _size): m_pQuadTree(_quad), m_pParent(nullptr), m_position(_position), m_size(_size), m_subPosition(), m_objectList() { memset((void*)m_pChildren, 0, 4*sizeof(QuadZone*)); } QuadZone::~QuadZone() { for (Int32 k = 0; k < 4; ++k) { deletePtr(m_pChildren[k]); } m_subPosition.clear(); m_size = 0.0f; m_position.zero(); m_pQuadTree = nullptr; if (m_pParent != nullptr) { for (Int32 k = 0; k < 4 ; ++k) { if (m_pParent->m_pChildren[k] == this) { m_pParent->m_pChildren[k] = nullptr; break; } else if (k == 3) { O3D_ASSERT(0); } } } removeAllObjects(); } void QuadZone::draw(Scene *scene) { Vector3 absPosition = getAbsolutePosition(); PrimitiveManager *primitive = scene->getPrimitiveManager(); primitive->modelView().push(); primitive->modelView().translate(absPosition); primitive->setModelviewProjection(); // yellow primitive->setColor(1.0f, 1.0f, 0.0f); // We draw the edges of this zone // primitive->drawYAxisAlignedQuad(P_LINE_LOOP, Vector3(m_size, 1, m_size)); // Daw corners of this zone primitive->beginDraw(P_LINES); // top left primitive->addVertex(Vector3(-m_size, 0, -m_size)); primitive->addVertex(Vector3(-m_size*0.8, 0, -m_size)); primitive->addVertex(Vector3(-m_size, 0, -m_size)); primitive->addVertex(Vector3(-m_size, 0, -m_size*0.8)); // top right primitive->addVertex(Vector3(m_size, 0, -m_size)); primitive->addVertex(Vector3(m_size*0.8, 0, -m_size)); primitive->addVertex(Vector3(m_size, 0, -m_size)); primitive->addVertex(Vector3(m_size, 0, -m_size*0.8)); // bottom left primitive->addVertex(Vector3(-m_size, 0, m_size)); primitive->addVertex(Vector3(-m_size*0.8, 0, m_size)); primitive->addVertex(Vector3(-m_size, 0, m_size)); primitive->addVertex(Vector3(-m_size, 0, m_size*0.8)); // bottom right primitive->addVertex(Vector3(m_size, 0, m_size)); primitive->addVertex(Vector3(m_size*0.8, 0, m_size)); primitive->addVertex(Vector3(m_size, 0, m_size)); primitive->addVertex(Vector3(m_size, 0, m_size*0.8)); primitive->endDraw(); // // Now we draw connections // Vector3 absCenter = absPosition + Vector3(0.5f * m_size, 0.0f, 0.5f * m_size); // // primitive->beginDraw(P_LINES); // for (IT_ZoneObjectList it = m_objectList.begin(); it != m_objectList.end() ; it++) // { // primitive->addVertex(absCenter.getData()); // primitive->addVertex((*it)->getSceneObject()->getAbsoluteMatrix().getTranslationPtr()); // } // primitive->endDraw(); primitive->setColor(1.0f, 0.0f, 0.0f); primitive->modelView().pop(); for (Int32 k = 0; k < 4 ; ++k) { if (m_pChildren[k] != nullptr) { m_pChildren[k]->draw(scene); } } } Vector3 QuadZone::getAbsolutePosition() const { return (m_pQuadTree->getQuadCenterOrigin() + Vector3(Float(m_position[QUAD_X]), 0.0f, Float(m_position[QUAD_Z])) * m_size); } Vector3 QuadZone::getAbsoluteCenter() const { return (m_pQuadTree->getQuadCenter() + Vector3(m_position[QUAD_X] * m_size, 0.0f, m_position[QUAD_Z] * m_size)); } Bool QuadZone::hasChildren(QuadZone * _zone) const { if ((m_pChildren[0] != _zone) && (m_pChildren[1] != _zone) && (m_pChildren[2] != _zone) && (m_pChildren[3] != _zone)) { return False; } else { return True; } } Bool QuadZone::findZone(QuadZone * _zone) const { if ((m_pChildren[0] != _zone) && (m_pChildren[1] != _zone) && (m_pChildren[2] != _zone) && (m_pChildren[3] != _zone)) { for (Int32 k = 0; k < 4; ++k) { if ((m_pChildren[k] != nullptr) && m_pChildren[k]->findZone(_zone)) { return True; } } return False; } else { return True; } } // Add/Remove an object from the zone void QuadZone::addObject(QuadObject * _object) { O3D_ASSERT(_object != nullptr); // We add this zone in the _object _object->addZoneContainer(this); m_objectList.push_back(_object); _object->onDestroyed.connect(this, &QuadZone::onObjectDeletion); } void QuadZone::removeObject(QuadObject * _object) { O3D_ASSERT(_object != nullptr); IT_ZoneObjectList it = std::find(m_objectList.begin(), m_objectList.end(), _object); O3D_ASSERT(it != m_objectList.end()); m_objectList.erase(it); _object->removeZoneContainer(this); disconnect(_object); } void QuadZone::removeAllObjects() { for (IT_ZoneObjectList it = m_objectList.begin() ; it != m_objectList.end() ; it++) { (*it)->removeZoneContainer(this); disconnect(*it); } m_objectList.clear(); } QuadObject * QuadZone::findObject(SceneObject * _object) { for(IT_ZoneObjectList it = m_objectList.begin() ; it != m_objectList.end() ; it++) { if ((*it)->getSceneObject() == _object) { return *it; } } QuadObject * pObject; for (Int32 k = 0; k < 4 ; ++k) { if ((m_pChildren[k] != nullptr) && ((pObject = m_pChildren[k]->findObject(_object)) != nullptr)) { return pObject; } } return nullptr; } const QuadObject * QuadZone::findObject(SceneObject * _object) const { for(CIT_ZoneObjectList it = m_objectList.begin() ; it != m_objectList.end() ; it++) { if ((*it)->getSceneObject() == _object) { return *it; } } QuadObject * pObject; for (Int32 k = 0; k < 4 ; ++k) { if ((m_pChildren[k] != nullptr) && ((pObject = m_pChildren[k]->findObject(_object)) != nullptr)) { return pObject; } } return nullptr; } void QuadZone::setParent(QuadZone * _parent) { O3D_ASSERT(m_pParent == nullptr); m_pParent = _parent; } void QuadZone::onObjectDeletion() { EvtHandler * lSenderObject = getSender(); IT_ZoneObjectList it = std::find(m_objectList.begin(), m_objectList.end(), lSenderObject); O3D_ASSERT(it != m_objectList.end()); m_objectList.erase(it); } //--------------------------------------------------------------------------------------- // class QuadTree //--------------------------------------------------------------------------------------- O3D_IMPLEMENT_DYNAMIC_CLASS1(Quadtree, ENGINE_VISIBILITY_QUADTREE, VisibilityABC) Quadtree::Quadtree( BaseObject *parent, Int32 halfSize, Float zoneSize) : VisibilityABC(parent, Vector3(), Vector3(zoneSize*halfSize, 0.f, zoneSize*halfSize)), m_topZone(2*halfSize+1, 2*halfSize+1), m_objectMap(), m_zoneSize(zoneSize), m_center(0.0f, 0.0f, 0.0f), m_hysteresis(0.2f * zoneSize), m_currentPosition(0.0f, 0.0f, 0.0f) { for (Int32 j = 0 ; j < m_topZone.height() ; ++j) { for (Int32 i = 0 ; i < m_topZone.width() ; ++i) { m_topZone(i,j) = new QuadZone(this, Vector2i(i - halfSize, j - halfSize), m_zoneSize); } } } Quadtree::~Quadtree() { clear(); } void Quadtree::translate(const Vector2i & _move) { // TODO // Optimize with memcpy m_center += Vector3(_move[QUAD_X] * m_zoneSize, 0.0f, _move[QUAD_Z] * m_zoneSize); m_bbox.setCenter(m_center); if (Int32(_move.normInf()) >= m_topZone.width()) { Int32 halfSize = m_topZone.width() / 2; Int32 i,j; // We must destroy all the array for (Int32 k = 0; k < m_topZone.elt() ; ++k) { m_topZone[k]->removeAllObjects(); m_topZone[k]->setSize(m_zoneSize); i = Int32(k % m_topZone.width()) - halfSize; j = Int32(k / m_topZone.width()) - halfSize; m_topZone[k]->setPosition(Vector2i(i,j)); } return; } if ((_move[QUAD_Z] > 0) && (_move[QUAD_Z] < m_topZone.width())) { Int32 halfSize = m_topZone.width() / 2; for (Int32 j = 0; j < m_topZone.height(); ++j) { for (Int32 i = 0 ; i < _move[QUAD_Z]; ++i) { deletePtr(m_topZone(i,j)); } } for (Int32 j = 0; j < m_topZone.height(); ++j) { for (Int32 i = 0 ; i < m_topZone.width() - _move[QUAD_Z]; ++i) { m_topZone(i,j) = m_topZone(i + _move[QUAD_Z], j); m_topZone(i,j)->setPosition(Vector2i(i - halfSize, j - halfSize)); } } for (Int32 j = 0; j < m_topZone.height(); ++j) { for (Int32 i = m_topZone.width() - _move[QUAD_Z]; i < m_topZone.width() ; ++i) { m_topZone(i,j) = new QuadZone(this, Vector2i(i - halfSize, j - halfSize), m_zoneSize); } } } else if ((_move[QUAD_Z] < 0) && (_move[QUAD_Z] > -m_topZone.width())) { Int32 halfSize = m_topZone.width() / 2; for (Int32 j = 0; j < m_topZone.height(); ++j) { for (Int32 i = m_topZone.width() + _move[QUAD_Z] ; i < m_topZone.width() ; ++i) { deletePtr(m_topZone(i,j)); } } for (Int32 j = 0; j < m_topZone.height(); ++j) { for (Int32 i = m_topZone.width() - 1 ; i >= -_move[QUAD_Z]; --i) { m_topZone(i,j) = m_topZone(i + _move[QUAD_Z], j); m_topZone(i,j)->setPosition(Vector2i(i - halfSize, j - halfSize)); } } for (Int32 j = 0; j < m_topZone.height(); ++j) { for (Int32 i = 0; i < -_move[QUAD_Z]; ++i) { m_topZone(i,j) = new QuadZone(this, Vector2i(i - halfSize, j - halfSize), m_zoneSize); } } } if ((_move[QUAD_X] > 0) && (_move[QUAD_X] < Int32(m_topZone.height()))) { Int32 halfSize = m_topZone.height() / 2; for (Int32 i = 0; i < m_topZone.width(); ++i) { for (Int32 j = 0 ; j < _move[QUAD_X]; ++j) { deletePtr(m_topZone(i,j)); } } for (Int32 i = 0; i < m_topZone.width(); ++i) { for (Int32 j = 0 ; j < m_topZone.height() - _move[QUAD_X]; ++j) { m_topZone(i,j) = m_topZone(i, j + _move[QUAD_X]); m_topZone(i,j)->setPosition(Vector2i(i - halfSize, j - halfSize)); } } for (Int32 i = 0; i < m_topZone.width(); ++i) { for (Int32 j = m_topZone.height() - _move[QUAD_X]; j < m_topZone.height() ; ++j) { m_topZone(i,j) = new QuadZone(this, Vector2i(i - halfSize, j - halfSize), m_zoneSize); } } } else if ((_move[QUAD_X] < 0) && (_move[QUAD_X] > -m_topZone.height())) { Int32 halfSize = m_topZone.height() / 2; for (Int32 i = 0; i < m_topZone.width(); ++i) { for (Int32 j = m_topZone.height() + _move[QUAD_X] ; j < m_topZone.height() ; ++j) { deletePtr(m_topZone(i,j)); } } for (Int32 i = 0; i < m_topZone.width(); ++i) { for (Int32 j = m_topZone.height() - 1 ; j >= -_move[QUAD_X]; --j) { m_topZone(i,j) = m_topZone(i, j + _move[QUAD_X]); m_topZone(i,j)->setPosition(Vector2i(i - halfSize, j - halfSize)); } } for (Int32 i = 0; i < m_topZone.width(); ++i) { for (Int32 j = 0; j < -_move[QUAD_X]; ++j) { m_topZone(i,j) = new QuadZone(this, Vector2i(i - halfSize, j - halfSize), m_zoneSize); } } } } void Quadtree::onObjectUnused() { QuadObject * lObject = static_cast<QuadObject*>(getSender()); IT_ObjectMap it = m_objectMap.find(lObject->getSceneObject()); O3D_ASSERT(it != m_objectMap.end()); if (it != m_objectMap.end()) { m_objectMap.erase(it); } deletePtr(lObject); } // Clear all objects contained in the quadTree void Quadtree::clear() { for (Int32 k = 0 ; k < m_topZone.elt() ; ++k) { deletePtr(m_topZone[k]); } m_topZone.free(); EvtManager::instance()->processEvent(this); } inline Int32 Quadtree::getNumObjects()const { return Int32(m_objectMap.size()); } // Return the neighbor of a zone QuadZone * Quadtree::getNeighbor(const QuadZone & _zone, QuadDirection _direction) { O3D_ASSERT(!_zone.hasParent()); Int32 halfSize = m_topZone.width() / 2; Vector2i zoneRequested(_zone.getPosition()); switch (_direction) { case NORTH: zoneRequested[QUAD_X]++; break; case SOUTH: zoneRequested[QUAD_X]--; break; case EAST: zoneRequested[QUAD_Z]++; break; case WEST: zoneRequested[QUAD_Z]--; break; default: O3D_ASSERT(0); break; } // If the requested neighbor is outside the quadtree range, we return nullptr if (zoneRequested.normInf() > halfSize) { return nullptr; } else { return m_topZone(zoneRequested[QUAD_Z], zoneRequested[QUAD_X]); } } // Add an object (we suppose that it doesn't exist) void Quadtree::addObject(SceneObject *object) { Vector3 zoneOrigin(getQuadCenterOrigin()); Vector3 diff = object->getAbsoluteMatrix().getTranslation() - zoneOrigin; diff /= m_zoneSize; Vector2i relativPos(Int32(floorf(diff[Z])), Int32(floorf(diff[X]))); Int32 halfSize = m_topZone.width() / 2; // The quadtree is a square so ... if (relativPos.normInf() > halfSize) { // The object is outside the range of the quadtree // O3D_ERROR(E_InvalidParameter("Attempt to add an object outside the quadtree range")); O3D_WARNING("Attempt to add an object outside the quadtree range"); return; } QuadObject * newQuadObject = new QuadObject(this, object); m_topZone(halfSize + relativPos[QUAD_Z], halfSize + relativPos[QUAD_X])->addObject(newQuadObject); newQuadObject->onUnused.connect(this, &Quadtree::onObjectUnused, CONNECTION_ASYNCH); // Finally we add the object in the map m_objectMap[object] = newQuadObject; } // Remove an object. Function called by the user Bool Quadtree::removeObject(SceneObject *object) { if (object) { IT_ObjectMap it = m_objectMap.find(object); //O3D_ASSERT(it != m_objectMap.end()); if (it != m_objectMap.end()) { deletePtr(it->second); m_objectMap.erase(it); return True; } return False; } else { O3D_ERROR(E_InvalidParameter("object must be non null")); return False; } } // Update an object void Quadtree::updateObject(SceneObject *object) { if (object) { IT_ObjectMap it = m_objectMap.find(object); O3D_ASSERT(it != m_objectMap.end()); // What must be done ? QuadObject * pQuadObject = it->second; O3D_ASSERT(pQuadObject->getZoneNumber() > 0); // Only one owner for each object is supported yet //O3DVector3 relative = object->getAbsoluteMatrix().GetTranslation() - pQuadObject->getZoneList()[0]->getAbsoluteCenter(); Vector3 center = pQuadObject->getZoneList()[0]->getAbsoluteCenter(); // left plane Plane leftPlane(Vector3(-1.f, 0.f, 0.f), Vector3(center.x() - m_zoneSize * 0.5f, 0.f, 0.f)); Geometry::Clipping left = object->checkBounding(leftPlane); if (left != Geometry::CLIP_OUTSIDE) { //O3DApps::Message(O3DString("Change zone ") << object->getName(), ""); // Outside the previous zone removeObject(object); // Can be optimized a lot addObject(object); // Same here return; } // right plane Plane rightPlane(Vector3(1.f, 0.f, 0.f), Vector3(center.x() + m_zoneSize * 0.5f, 0.f, 0.f)); Geometry::Clipping right = object->checkBounding(rightPlane); if (right != Geometry::CLIP_OUTSIDE) { //O3DApps::Message(O3DString("Change zone ") << object->getName(), ""); // Outside the previous zone removeObject(object); // Can be optimized a lot addObject(object); // Same here return; } // bottom plane Plane bottomPlane(Vector3(0.f, 0.f, -1.f), Vector3(0.f, 0.f, center.z() - m_zoneSize * 0.5f)); Geometry::Clipping bottom = object->checkBounding(bottomPlane); if (bottom != Geometry::CLIP_OUTSIDE) { //O3DApps::Message(O3DString("Change zone ") << object->getName(), ""); // Outside the previous zone removeObject(object); // Can be optimized a lot addObject(object); // Same here return; } // top plane Plane topPlane(Vector3(0.f, 0.f, 1.f), Vector3(0.f, 0.f, center.z() + m_zoneSize * 0.5f)); Geometry::Clipping top = object->checkBounding(topPlane); if (top != Geometry::CLIP_OUTSIDE) { //System::print(String("Change zone ") << object->getName(), ""); // Outside the previous zone removeObject(object); // Can be optimized a lot addObject(object); // Same here return; } /*if (((left != Geometry::CLIP_OUTSIDE) || (right != Geometry::CLIP_OUTSIDE) || (top != Geometry::CLIP_OUTSIDE) || (bottom != Geometry::CLIP_OUTSIDE))) { // Outside the previous zone removeObject(object); // Can be optimized a lot //System::print(String("Change zone ") << object->getName(), ""); addObject(object); // Same here }*/ /*if (relative.normInf() > m_zoneSize) { // Outside the previous zone removeObject(object); // Can be optimized a lot printf("change zone %s\n", object->getName().toUtf8().getData()); addObject(object); // Same here }*/ } } // Check for visible object and add it to visibility manager void Quadtree::checkVisibleObject(const VisibilityInfos & _infos) { m_currentPosition = _infos.cameraPosition; Vector2f relativPos(m_currentPosition[Z] - m_center[Z], m_currentPosition[X] - m_center[X]); if (relativPos.normInf() > 0.5f*m_zoneSize + m_hysteresis) { // We need to change the quadtree // Which parts of the quadtree need to be changed relativPos /= m_zoneSize; relativPos[QUAD_Z] = floorf(relativPos[QUAD_Z] + 0.5f); relativPos[QUAD_X] = floorf(relativPos[QUAD_X] + 0.5f); Vector2i translation((Int32)relativPos[QUAD_Z], (Int32)relativPos[QUAD_X]); //if (translation.norm1() > 0) translate(translation); } SceneObject * object = nullptr; for (Int32 k = 0; k < m_topZone.elt() ; ++k) { // Visibility checks ... for (CIT_ZoneObjectList it = m_topZone[k]->getObjectList().begin() ; it != m_topZone[k]->getObjectList().end() ; it++) { object = (*it)->getSceneObject(); if (_infos.viewUseMaxDistance) { Float length = (object->getAbsoluteMatrix().getTranslation() - m_currentPosition).length(); if (length > _infos.viewMaxDistance) { continue; } } // depending if it is light or something else if (object->isLight()) { getScene()->getVisibilityManager()->addEffectiveLight(static_cast<Light*>(object)); } // even if it is as light it can be drawable for symbolics if (object->hasDrawable()) { getScene()->getVisibilityManager()->addObjectToDraw(object); } } } } void Quadtree::draw(const DrawInfo &drawInfo) { if (getScene()->getDrawObject(Scene::DRAW_QUADTREE)) { PrimitiveAccess primitive = getScene()->getPrimitiveManager()->access(drawInfo); // setup modelview primitive->modelView().set(getScene()->getActiveCamera()->getModelviewMatrix()); primitive->setColor(1.f, 1.f, 1.f); getScene()->getContext()->setLineWidth(2.0f); for (Int32 j = 0 ; j < m_topZone.height() ; ++j) { for (Int32 i = 0 ; i < m_topZone.width() ; ++i) { m_topZone(i,j)->draw(getScene()); } } getScene()->getContext()->setDefaultLineWidth(); primitive->setColor(0.0f, 1.0f, 0.0f); //primitive->modelView().push(); // Vector3 absPos(GetQuadOrigin()); // primitive->modelView().translate(absPos); // primitive->wireSphere1(Vector3(20.f,20.f,20.f)); //primitive->modelView().pop() } }
29.393512
128
0.614971
dream-overflow
0d2135f75b673ec30128d049d0250fe48880bce2
2,181
cpp
C++
core/test/test_interface_state.cpp
FabianSchuetze/moveit_task_constructor
685fec6070fa3fa95a8abe7ae47c4047556aeb4a
[ "BSD-3-Clause" ]
1
2021-12-02T17:55:07.000Z
2021-12-02T17:55:07.000Z
core/test/test_interface_state.cpp
wangcongrobot/moveit_task_constructor
f99d03386ad8751fb0ade71c09a9810019a950ad
[ "BSD-3-Clause" ]
null
null
null
core/test/test_interface_state.cpp
wangcongrobot/moveit_task_constructor
f99d03386ad8751fb0ade71c09a9810019a950ad
[ "BSD-3-Clause" ]
2
2021-05-09T06:09:47.000Z
2021-05-09T06:28:30.000Z
#include <moveit/task_constructor/storage.h> #include <moveit/task_constructor/stage_p.h> #include <moveit/planning_scene/planning_scene.h> #include "models.h" #include <memory> #include <algorithm> #include <iterator> #include <vector> #include <gtest/gtest.h> #include <gmock/gmock-matchers.h> using namespace moveit::task_constructor; TEST(InterfaceStatePriority, compare) { using Prio = InterfaceState::Priority; constexpr double inf = std::numeric_limits<double>::infinity(); EXPECT_TRUE(Prio(0, 0) == Prio(0, 0)); EXPECT_TRUE(Prio(0, inf) == Prio(0, inf)); EXPECT_TRUE(Prio(1, 0) < Prio(0, 0)); // higher depth is smaller EXPECT_TRUE(Prio(1, 42) < Prio(0, 0)); EXPECT_TRUE(Prio(1, inf) > Prio(0, 0)); // infinite costs are always largest EXPECT_TRUE(Prio(1, inf) < Prio(0, inf)); EXPECT_TRUE(Prio(0, 0) < Prio(0, 42)); // higher cost is larger EXPECT_TRUE(Prio(0, 0) < Prio(0, inf)); EXPECT_TRUE(Prio(0, 42) > Prio(0, 0)); EXPECT_TRUE(Prio(0, inf) > Prio(0, 0)); } using Prio = InterfaceState::Priority; // Interface that also stores passed states class StoringInterface : public Interface { std::vector<std::unique_ptr<InterfaceState>> storage_; public: using Interface::Interface; void add(InterfaceState&& state) { storage_.emplace_back(std::make_unique<InterfaceState>(std::move(state))); Interface::add(*storage_.back()); } std::vector<unsigned int> depths() const { std::vector<unsigned int> result; std::transform(cbegin(), cend(), std::back_inserter(result), [](const InterfaceState* state) { return state->priority().depth(); }); return result; } }; TEST(Interface, update) { auto ps = std::make_shared<planning_scene::PlanningScene>(getModel()); StoringInterface i; i.add(InterfaceState(ps, Prio(1, 0.0))); i.add(InterfaceState(ps, Prio(3, 0.0))); EXPECT_THAT(i.depths(), ::testing::ElementsAreArray({ 3, 1 })); i.updatePriority(*i.rbegin(), Prio(5, 0.0)); EXPECT_THAT(i.depths(), ::testing::ElementsAreArray({ 5, 3 })); i.updatePriority(*i.begin(), Prio(6, std::numeric_limits<double>::infinity())); EXPECT_THAT(i.depths(), ::testing::ElementsAreArray({ 5, 3 })); // larger priority is ignored }
33.553846
95
0.698304
FabianSchuetze
0d251186cca5970cbdcc2327dd32d62023d31798
1,358
cpp
C++
tools/CustomUI/customUI.cpp
RuanauR/BetterEdit
9e4c031b8dec0c80f901f79d9f4a40173a52725b
[ "MIT" ]
30
2021-01-25T22:25:05.000Z
2022-01-22T13:18:19.000Z
tools/CustomUI/customUI.cpp
RuanauR/BetterEdit
9e4c031b8dec0c80f901f79d9f4a40173a52725b
[ "MIT" ]
9
2021-07-03T11:41:47.000Z
2022-03-30T15:14:46.000Z
tools/CustomUI/customUI.cpp
RuanauR/BetterEdit
9e4c031b8dec0c80f901f79d9f4a40173a52725b
[ "MIT" ]
3
2021-07-01T20:52:24.000Z
2022-01-13T16:16:58.000Z
#include "customUI.hpp" #include "../../hooks/EditorPauseLayer.hpp" void EditorPauseLayer_CB::onCustomizeUI(CCObject*) { UIManager::get()->startCustomizing(); this->onResume(nullptr); } void loadEditorCustomizations(EditorUI* self) { self->m_pCopyBtn->removeFromParent(); self->m_pPasteBtn->removeFromParent(); self->m_pCopyPasteBtn->removeFromParent(); self->m_pEditSpecialBtn->removeFromParent(); self->m_pEditGroupBtn->removeFromParent(); self->m_pEditObjectBtn->removeFromParent(); self->m_pCopyValuesBtn->removeFromParent(); self->m_pPasteStateBtn->removeFromParent(); self->m_pPasteColorBtn->removeFromParent(); self->m_pEditHSVBtn->removeFromParent(); self->m_pGoToLayerBtn->removeFromParent(); self->m_pDeselectBtn->removeFromParent(); } void loadUICustomizeBtn(EditorPauseLayer* self) { auto menu = as<CCMenu*>(self->m_pButton0->getParent()); auto winSize = cocos2d::CCDirector::sharedDirector()->getWinSize(); // auto spr = ButtonSprite::create( // "Customize UI", 0, 0, "goldFont.fnt", "GJ_button_01.png", 0, .8f // ); // spr->setScale(.7f); // auto btn = CCMenuItemSpriteExtra::create( // spr, self, menu_selector(EditorPauseLayer_CB::onCustomizeUI) // ); // btn->setPosition(0.0f, winSize.height - 60.0f); // menu->addChild(btn); }
34.820513
75
0.693667
RuanauR
0d2859253f6d4463f3e6be5b72a87d4de46e12f0
527
cpp
C++
solutions/228.summary-ranges.318085037.ac.cpp
satu0king/Leetcode-Solutions
2edff60d76c2898d912197044f6284efeeb34119
[ "MIT" ]
78
2020-10-22T11:31:53.000Z
2022-02-22T13:27:49.000Z
solutions/228.summary-ranges.318085037.ac.cpp
satu0king/Leetcode-Solutions
2edff60d76c2898d912197044f6284efeeb34119
[ "MIT" ]
null
null
null
solutions/228.summary-ranges.318085037.ac.cpp
satu0king/Leetcode-Solutions
2edff60d76c2898d912197044f6284efeeb34119
[ "MIT" ]
26
2020-10-23T15:10:44.000Z
2021-11-07T16:13:50.000Z
class Solution { public: vector<string> summaryRanges(vector<int> &nums) { vector<pair<int, int>> ranges; for (int n : nums) { if (ranges.empty() || ranges.back().second + 1 != n) ranges.emplace_back(n, n); else ranges.back().second++; } vector<string> result; for (auto &p : ranges) if (p.first == p.second) result.push_back(to_string(p.first)); else result.push_back(to_string(p.first) + "->" + to_string(p.second)); return result; } };
21.958333
74
0.56926
satu0king
0d293d4448c4883356ecfdab4bca391a47f039a1
234
cpp
C++
gds/vadd.cpp
TheGPU/amdgpu-code
bb249b33b8b9ad15c195b591959f5cedfb552044
[ "MIT" ]
4
2018-02-11T13:00:57.000Z
2018-06-02T13:15:47.000Z
gds/vadd.cpp
IceNarwhal/amdgpu-code
bb249b33b8b9ad15c195b591959f5cedfb552044
[ "MIT" ]
2
2017-04-04T19:53:04.000Z
2017-05-10T16:15:12.000Z
gds/vadd.cpp
TheGPU/amdgpu-code
bb249b33b8b9ad15c195b591959f5cedfb552044
[ "MIT" ]
1
2021-05-21T08:08:43.000Z
2021-05-21T08:08:43.000Z
#include<iostream> #include<hip/hip_runtime.h> #include<hip/hip_runtime_api.h> #define LEN 16 __global__ void vAdd(hipLaunchParm lp, float *A, float *B, float *C){ int tx = hipThreadIdx_x; C[tx] = A[tx] + B[tx]; } int main(){}
18
69
0.683761
TheGPU
0d300a3aaa94ad42feb187f211b34dc921b16a82
3,810
cpp
C++
C Plus Plus/Graph/Floyd_Warshall_Shortest_Path.cpp
Amisha328/DS-Algo
34576fbe95717b1d3e2f75b0a04c631ca1833091
[ "MIT" ]
8
2021-06-19T12:49:46.000Z
2021-08-01T05:32:54.000Z
C Plus Plus/Graph/Floyd_Warshall_Shortest_Path.cpp
Amisha328/DS-Algo
34576fbe95717b1d3e2f75b0a04c631ca1833091
[ "MIT" ]
61
2021-06-10T08:22:51.000Z
2021-07-29T05:47:52.000Z
C Plus Plus/Graph/Floyd_Warshall_Shortest_Path.cpp
Amisha328/DS-Algo
34576fbe95717b1d3e2f75b0a04c631ca1833091
[ "MIT" ]
6
2021-06-10T08:28:26.000Z
2021-07-23T03:36:46.000Z
/* Floyd Warshall Shortest Path Algorithm is applied to find the shortest distance between two vertices in a graph. It is based on a formula given by floyd-warshall i.e. distance(k)[i][j] = minimum of (distance(k-1)[i][j] , distance(k-1)[i][k] + distance(k-1)[k][j]) where, i and j are the source and destination vertex respectively and, k is the order of path matrix formed. */ // Implementation #include<bits/stdc++.h> using namespace std; // Structure of Graph class Graph{ // Number of vetices in a graph int vertices; // Path matrix for graph. vector< vector<int> > path; // Matrix to store the minimum distance between the two vertices. vector< vector<int> > min_distance; public: // Constructor Graph(int vertices){ this->vertices = vertices; // Initailize the path matrix with the size of number of vertices, // with the inital value to be infinite i.e. INT_MAX path.assign(vertices, vector<int>(vertices, INT_MAX)); min_distance.assign(vertices, vector<int>(vertices, INT_MAX)); // The shortes distance of a vertex to itself will always be zero. for(int i = 0; i<vertices; i++){ path[i][i] = 0; min_distance[i][i] = 0; } } void floyd_warshall(); void addEdge(int, int, int); void printGraph(); void printMinimumDistance(); }; // Method to add edge between two vertices with specific weight void Graph::addEdge(int source, int destination, int weight){ path[source][destination] = weight; } // Mehtod to find the shortet distance matrix using floyd-warshall algorithm void Graph::floyd_warshall(){ // Copying the path matrix to the min_distance matrix min_distance = path; // k - to determine the order of matrix for(int k=0; k<vertices; k++){ // i - to determine to source vertex for(int i=0; i<vertices; i++){ // j- to determine the destination vertex for(int j=0; j<vertices; j++){ // Condition for implementation of formula if (min_distance[i][j] > (min_distance[i][k] + min_distance[k][j]) && (min_distance[k][j] != INT_MAX && min_distance[i][k] != INT_MAX)) min_distance[i][j] = min_distance[i][k] + min_distance[k][j]; } } } } // Method to print the min_distance matrix void Graph::printGraph(){ for(int i=0; i<vertices; i++){ for(int j=0; j<vertices; j++){ if(path[i][j] == INT_MAX) cout<<"INF "; else cout<<path[i][j]<<" "; } cout<<endl; } } // Method to print the min_distance matrix void Graph::printMinimumDistance(){ for(int i=0; i<vertices; i++){ for(int j=0; j<vertices; j++){ if(min_distance[i][j] == INT_MAX) cout<<"INF "; else cout<<min_distance[i][j]<<" "; } cout<<endl; } } int main(){ // Object of graph with 5 vertices. Graph graph(5); // Adding edges to the graph. graph.addEdge(0, 1, 2); graph.addEdge(0, 2, 4); graph.addEdge(1, 2, 5); graph.addEdge(1, 4, 1); graph.addEdge(1, 3, 3); graph.addEdge(2, 4, 6); graph.addEdge(3, 4, 10); cout<<"\nDistance from each vertex : "<<endl; graph.printGraph(); graph.floyd_warshall(); cout<<"\nShortest distance by Floyd Wrashall Algorithm is : "<<endl; graph.printMinimumDistance(); return 0; } /* Time Complexity of Floyd Warshall is O(|V|^3). Space Complexity of Floyd Warshall is O(|V|^2), where V is number of vertices. */
28.222222
104
0.572441
Amisha328
0d32560e00e5547f2db480bd8405d8c557e31cea
1,381
cpp
C++
dev/Code/Framework/AzCore/Platform/Mac/AzCore/Module/Internal/ModuleManagerSearchPathTool_Mac.cpp
BadDevCode/lumberyard
3d688932f919dbf5821f0cb8a210ce24abe39e9e
[ "AML" ]
1,738
2017-09-21T10:59:12.000Z
2022-03-31T21:05:46.000Z
dev/Code/Framework/AzCore/Platform/Mac/AzCore/Module/Internal/ModuleManagerSearchPathTool_Mac.cpp
olivier-be/lumberyard
3d688932f919dbf5821f0cb8a210ce24abe39e9e
[ "AML" ]
427
2017-09-29T22:54:36.000Z
2022-02-15T19:26:50.000Z
dev/Code/Framework/AzCore/Platform/Mac/AzCore/Module/Internal/ModuleManagerSearchPathTool_Mac.cpp
olivier-be/lumberyard
3d688932f919dbf5821f0cb8a210ce24abe39e9e
[ "AML" ]
671
2017-09-21T08:04:01.000Z
2022-03-29T14:30:07.000Z
/* * All or portions of this file Copyright (c) Amazon.com, Inc. or its affiliates or * its licensors. * * For complete copyright and license terms please see the LICENSE at the root of this * distribution (the "License"). All use of this software is governed by the License, * or, if provided, by the license below or the license accompanying this file. Do not * remove or modify any license notices. This file is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * */ #include <AzCore/Module/Internal/ModuleManagerSearchPathTool.h> #include <AzCore/IO/SystemFile.h> #include <unistd.h> namespace AZ { namespace Internal { ModuleManagerSearchPathTool::ModuleManagerSearchPathTool() { char cwdBuffer[AZ_MAX_PATH_LEN]; cwdBuffer[0] = '\0'; getcwd(cwdBuffer, AZ_ARRAY_SIZE(cwdBuffer)); m_restorePath = cwdBuffer; } ModuleManagerSearchPathTool::~ModuleManagerSearchPathTool() { chdir(m_restorePath.c_str()); } void ModuleManagerSearchPathTool::SetModuleSearchPath(const AZ::DynamicModuleDescriptor& moduleDesc) { AZ::OSString modulePath = GetModuleDirectory(moduleDesc); chdir(modulePath.c_str()); } } // namespace Internal } // namespace AZ
32.116279
108
0.67777
BadDevCode
0d36f6d5205dcebed842075a6aaef7dc389eea5b
1,720
hxx
C++
include/usagi/json/picojson/to_bool.hxx
usagi/usagi
2d57d21eeb92eadfdf4154a3e470aebfc3e388e5
[ "MIT" ]
2
2016-11-20T04:59:17.000Z
2017-02-13T01:44:37.000Z
include/usagi/json/picojson/to_bool.hxx
usagi/usagi
2d57d21eeb92eadfdf4154a3e470aebfc3e388e5
[ "MIT" ]
3
2015-09-28T12:00:02.000Z
2015-09-28T12:03:21.000Z
include/usagi/json/picojson/to_bool.hxx
usagi/usagi
2d57d21eeb92eadfdf4154a3e470aebfc3e388e5
[ "MIT" ]
3
2017-07-02T06:09:47.000Z
2018-07-09T01:00:57.000Z
#pragma once #include "type.hxx" namespace usagi::json::picojson { static inline auto to_bool( const boolean_type in ) { return in; } /// @note ECMA-262 NaN: Boolean( 0/0 ) -> false /// @note ECMA-262 +Inf: Boolean( +1/0 ) -> true /// @note ECMA-262 -Inf: Boolean( -1/0 ) -> true static inline auto to_bool( const number_type in ) { return not std::isnan( in ) and in != 0; } /// @note ECMA-262 empty-string: Boolean( "" ) -> false static inline auto to_bool( const string_type& in ) { return not in.empty(); } /// @note: ECMA-262 array: Boolean( [] ) -> true static inline auto to_bool( const array_type& ) { return true; } /// @note: ECMA-262 object: Boolean( {} ) -> true static inline auto to_bool( const object_type& ) { return true; } /// @note: ECMA-262 null: Boolean( null ) -> false static inline auto to_bool( const null_type& = null_type() ) { return false; } /// @brief ECMA-262 Boolean( in ) 互換変換 static inline auto to_bool( const value_type& in ) { if ( in.is< boolean_type >() ) return to_bool( in.get< boolean_type >() ); if ( in.is< number_type >() ) return to_bool( in.get< number_type >() ); if ( in.is< string_type >() ) return to_bool( in.get< string_type >() ); if ( in.is< array_type >() ) return to_bool( in.get< array_type >() ); if ( in.is< object_type >() ) return to_bool( in.get< object_type >() ); if ( in.is< null_type >() ) return to_bool(); return false; } /// @brief to_bool した結果を value_type で得る syntax sugar static inline auto to_bool_value( const value_type& in ) { return value_type( to_bool( in ) ); } }
27.741935
68
0.59593
usagi
0d379fa4ba8a49230f96d1116eb76ef27edaeec0
5,126
cc
C++
src/Hmm/HiddenMarkovModel.cc
alexanderrichard/squirrel
12614a9eb429500c8f341654043f33a1b6bd1d31
[ "AFL-3.0" ]
63
2016-07-08T13:35:27.000Z
2021-01-13T18:37:13.000Z
src/Hmm/HiddenMarkovModel.cc
alexanderrichard/squirrel
12614a9eb429500c8f341654043f33a1b6bd1d31
[ "AFL-3.0" ]
4
2017-08-04T09:25:10.000Z
2022-02-24T15:38:52.000Z
src/Hmm/HiddenMarkovModel.cc
alexanderrichard/squirrel
12614a9eb429500c8f341654043f33a1b6bd1d31
[ "AFL-3.0" ]
30
2016-05-11T02:24:46.000Z
2021-11-12T14:06:20.000Z
/* * Copyright 2016 Alexander Richard * * This file is part of Squirrel. * * Licensed under the Academic Free License 3.0 (the "License"). * You may not use this file except in compliance with the License. * You should have received a copy of the License along with Squirrel. * If not, see <https://opensource.org/licenses/AFL-3.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. */ /* * HiddenMarkovModel.cc * * Created on: Mar 4, 2015 * Author: richard */ #include "HiddenMarkovModel.hh" using namespace Hmm; /* * HiddenMarkovModel */ const Core::ParameterEnum HiddenMarkovModel::paramHmmType_("type", "standard-hmm, single-state-hmm", "standard-hmm", "hidden-markov-model"); const Core::ParameterString HiddenMarkovModel::paramHmmFile_("model-file", "", "hidden-markov-model"); const Core::ParameterString HiddenMarkovModel::paramTransitionProbabilityFile_("transition-probability-file", "", "hidden-markov-model"); HiddenMarkovModel::HiddenMarkovModel() : hmmFile_(Core::Configuration::config(paramHmmFile_)), transitionProbabilityFile_(Core::Configuration::config(paramTransitionProbabilityFile_)), nClasses_(0), nStates_(0), isInitialized_(false) {} void HiddenMarkovModel::initialize() { require(!isInitialized_); // load hmm definition if (hmmFile_.empty()) Core::Error::msg("HiddenMarkovModel::initialize: hmm-file not specified.") << Core::Error::abort; statesPerClass_.read(hmmFile_); // determine start states nClasses_ = statesPerClass_.size(); startStates_.resize(nClasses_); startStates_.at(0) = 0; for (u32 c = 1; c < nClasses_; c++) startStates_.at(c) = startStates_.at(c-1) + statesPerClass_.at(c-1); // compute mapping from state to class stateToClass_.resize(statesPerClass_.sum()); u32 state = 0; for (u32 c = 0; c < statesPerClass_.size(); c++) { for (u32 s = 0; s < statesPerClass_.at(c); s++) { stateToClass_.at(state) = c; state++; } } nStates_ = stateToClass_.size(); // load transition probabilities if (transitionProbabilityFile_.empty()) Core::Error::msg("HiddenMarkovModel::initialize: transition-probability-file not specified.") << Core::Error::abort; loopScores_.read(transitionProbabilityFile_); forwardScores_.resize(loopScores_.size()); forwardScores_.fill(1.0); forwardScores_.add(loopScores_, (Float)-1.0); loopScores_.log(); forwardScores_.log(); isInitialized_ = true; } u32 HiddenMarkovModel::nClasses() const { require(isInitialized_); return nClasses_; } u32 HiddenMarkovModel::nStates() const { require(isInitialized_); return nStates_; } u32 HiddenMarkovModel::nStates(u32 c) const { require(isInitialized_); require_lt(c, nClasses_); return statesPerClass_.at(c); } u32 HiddenMarkovModel::getClass(u32 state) const { require(isInitialized_); require_lt(state, nStates_); return stateToClass_.at(state); } u32 HiddenMarkovModel::startState(u32 c) const { require(isInitialized_); require_lt(c, nClasses_); return startStates_.at(c); } bool HiddenMarkovModel::isEndState(u32 state) const { require(isInitialized_); require_lt(state, nStates_); return ( (state == nStates_ - 1) || (stateToClass_.at(state) != stateToClass_.at(state+1)) ); } u32 HiddenMarkovModel::successor(u32 state) const { require(isInitialized_); require_lt(state, nStates_); require(!isEndState(state)); return state + 1; } Float HiddenMarkovModel::transitionScore(u32 stateFrom, u32 stateTo) const { require(isInitialized_); require_le(stateFrom, nStates_); if (stateFrom == stateTo) // loop transition return loopScores_.at(stateFrom); else if ((isEndState(stateFrom)) || (stateFrom + 1 == stateTo)) // forward transition return forwardScores_.at(stateFrom); else // invalid transition return -Types::inf<Float>(); } HiddenMarkovModel* HiddenMarkovModel::create() { switch ((HmmType) Core::Configuration::config(paramHmmType_)) { case standardHmm: Core::Log::os("Create standard-hmm."); return new HiddenMarkovModel(); break; case singleStateHmm: Core::Log::os("Create single-state-hmm."); return new SingleStateHiddenMarkovModel(); break; default: return 0; // this can not happen } } /* * SingleStateHiddenMarkovModel */ const Core::ParameterInt SingleStateHiddenMarkovModel::paramNumberOfClasses_("number-of-classes", 0, "hidden-markov-model"); SingleStateHiddenMarkovModel::SingleStateHiddenMarkovModel() : Precursor() { nClasses_ = Core::Configuration::config(paramNumberOfClasses_); nStates_ = nClasses_; require_gt(nClasses_, 0); } void SingleStateHiddenMarkovModel::initialize() { stateToClass_.resize(nStates_); for (u32 c = 0; c < nStates_; c++) stateToClass_.at(c) = c; statesPerClass_.resize(nClasses_); statesPerClass_.fill(1); startStates_.resize(nClasses_); for (u32 c = 0; c < nStates_; c++) startStates_.at(c) = c; loopScores_.resize(nStates_); loopScores_.fill(0.0); forwardScores_.resize(nStates_); forwardScores_.fill(0.0); isInitialized_ = true; }
28.960452
140
0.738978
alexanderrichard
0d3822f67c8867bd02497940e7c7d798801b842a
9,982
cpp
C++
plugins/WinVST/Ditherbox/Ditherbox.cpp
PanieriLorenzo/airwindows
03fe0bddb4689eddd5444116ba4862942d069b76
[ "MIT" ]
446
2018-01-22T18:03:39.000Z
2022-03-31T18:57:27.000Z
plugins/WinVST/Ditherbox/Ditherbox.cpp
PanieriLorenzo/airwindows
03fe0bddb4689eddd5444116ba4862942d069b76
[ "MIT" ]
33
2018-01-24T20:36:48.000Z
2022-03-23T21:27:37.000Z
plugins/WinVST/Ditherbox/Ditherbox.cpp
PanieriLorenzo/airwindows
03fe0bddb4689eddd5444116ba4862942d069b76
[ "MIT" ]
71
2018-02-16T18:17:21.000Z
2022-03-24T21:31:46.000Z
/* ======================================== * Ditherbox - Ditherbox.h * Copyright (c) 2016 airwindows, All rights reserved * ======================================== */ #ifndef __Ditherbox_H #include "Ditherbox.h" #endif AudioEffect* createEffectInstance(audioMasterCallback audioMaster) {return new Ditherbox(audioMaster);} Ditherbox::Ditherbox(audioMasterCallback audioMaster) : AudioEffectX(audioMaster, kNumPrograms, kNumParameters) { A = 0.86; Position = 99999999; contingentErrL = 0.0; contingentErrR = 0.0; currentDitherL = 0.0; currentDitherR = 0.0; bynL[0] = 1000; bynL[1] = 301; bynL[2] = 176; bynL[3] = 125; bynL[4] = 97; bynL[5] = 79; bynL[6] = 67; bynL[7] = 58; bynL[8] = 51; bynL[9] = 46; bynL[10] = 1000; noiseShapingL = 0.0; bynR[0] = 1000; bynR[1] = 301; bynR[2] = 176; bynR[3] = 125; bynR[4] = 97; bynR[5] = 79; bynR[6] = 67; bynR[7] = 58; bynR[8] = 51; bynR[9] = 46; bynR[10] = 1000; noiseShapingR = 0.0; NSOddL = 0.0; prevL = 0.0; nsL[0] = 0; nsL[1] = 0; nsL[2] = 0; nsL[3] = 0; nsL[4] = 0; nsL[5] = 0; nsL[6] = 0; nsL[7] = 0; nsL[8] = 0; nsL[9] = 0; nsL[10] = 0; nsL[11] = 0; nsL[12] = 0; nsL[13] = 0; nsL[14] = 0; nsL[15] = 0; NSOddR = 0.0; prevR = 0.0; nsR[0] = 0; nsR[1] = 0; nsR[2] = 0; nsR[3] = 0; nsR[4] = 0; nsR[5] = 0; nsR[6] = 0; nsR[7] = 0; nsR[8] = 0; nsR[9] = 0; nsR[10] = 0; nsR[11] = 0; nsR[12] = 0; nsR[13] = 0; nsR[14] = 0; nsR[15] = 0; lastSampleL = 0.0; outSampleL = 0.0; lastSampleR = 0.0; outSampleR = 0.0; iirSampleAL = 0.0; iirSampleBL = 0.0; iirSampleCL = 0.0; iirSampleDL = 0.0; iirSampleEL = 0.0; iirSampleFL = 0.0; iirSampleGL = 0.0; iirSampleHL = 0.0; iirSampleIL = 0.0; iirSampleJL = 0.0; iirSampleKL = 0.0; iirSampleLL = 0.0; iirSampleML = 0.0; iirSampleNL = 0.0; iirSampleOL = 0.0; iirSamplePL = 0.0; iirSampleQL = 0.0; iirSampleRL = 0.0; iirSampleSL = 0.0; iirSampleTL = 0.0; iirSampleUL = 0.0; iirSampleVL = 0.0; iirSampleWL = 0.0; iirSampleXL = 0.0; iirSampleYL = 0.0; iirSampleZL = 0.0; iirSampleAR = 0.0; iirSampleBR = 0.0; iirSampleCR = 0.0; iirSampleDR = 0.0; iirSampleER = 0.0; iirSampleFR = 0.0; iirSampleGR = 0.0; iirSampleHR = 0.0; iirSampleIR = 0.0; iirSampleJR = 0.0; iirSampleKR = 0.0; iirSampleLR = 0.0; iirSampleMR = 0.0; iirSampleNR = 0.0; iirSampleOR = 0.0; iirSamplePR = 0.0; iirSampleQR = 0.0; iirSampleRR = 0.0; iirSampleSR = 0.0; iirSampleTR = 0.0; iirSampleUR = 0.0; iirSampleVR = 0.0; iirSampleWR = 0.0; iirSampleXR = 0.0; iirSampleYR = 0.0; iirSampleZR = 0.0; //this is reset: values being initialized only once. Startup values, whatever they are. _canDo.insert("plugAsChannelInsert"); // plug-in can be used as a channel insert effect. _canDo.insert("plugAsSend"); // plug-in can be used as a send effect. _canDo.insert("x2in2out"); setNumInputs(kNumInputs); setNumOutputs(kNumOutputs); setUniqueID(kUniqueId); canProcessReplacing(); // supports output replacing canDoubleReplacing(); // supports double precision processing programsAreChunks(true); vst_strncpy (_programName, "Default", kVstMaxProgNameLen); // default program name } Ditherbox::~Ditherbox() {} VstInt32 Ditherbox::getVendorVersion () {return 1000;} void Ditherbox::setProgramName(char *name) {vst_strncpy (_programName, name, kVstMaxProgNameLen);} void Ditherbox::getProgramName(char *name) {vst_strncpy (name, _programName, kVstMaxProgNameLen);} //airwindows likes to ignore this stuff. Make your own programs, and make a different plugin rather than //trying to do versioning and preventing people from using older versions. Maybe they like the old one! static float pinParameter(float data) { if (data < 0.0f) return 0.0f; if (data > 1.0f) return 1.0f; return data; } VstInt32 Ditherbox::getChunk (void** data, bool isPreset) { float *chunkData = (float *)calloc(kNumParameters, sizeof(float)); chunkData[0] = A; /* Note: The way this is set up, it will break if you manage to save settings on an Intel machine and load them on a PPC Mac. However, it's fine if you stick to the machine you started with. */ *data = chunkData; return kNumParameters * sizeof(float); } VstInt32 Ditherbox::setChunk (void* data, VstInt32 byteSize, bool isPreset) { float *chunkData = (float *)data; A = pinParameter(chunkData[0]); /* We're ignoring byteSize as we found it to be a filthy liar */ /* calculate any other fields you need here - you could copy in code from setParameter() here. */ return 0; } void Ditherbox::setParameter(VstInt32 index, float value) { switch (index) { case kParamA: A = value; break; default: throw; // unknown parameter, shouldn't happen! } } float Ditherbox::getParameter(VstInt32 index) { switch (index) { case kParamA: return A; break; default: break; // unknown parameter, shouldn't happen! } return 0.0; //we only need to update the relevant name, this is simple to manage } void Ditherbox::getParameterName(VstInt32 index, char *text) { switch (index) { case kParamA: vst_strncpy (text, "Type", kVstMaxParamStrLen); break; default: break; // unknown parameter, shouldn't happen! } //this is our labels for displaying in the VST host } void Ditherbox::getParameterDisplay(VstInt32 index, char *text) { switch (index) { case kParamA: switch((VstInt32)( A * 24.999 )) //0 to almost edge of # of params { case 0: vst_strncpy (text, "Trunc", kVstMaxParamStrLen); break; case 1: vst_strncpy (text, "Flat", kVstMaxParamStrLen); break; case 2: vst_strncpy (text, "TPDF", kVstMaxParamStrLen); break; case 3: vst_strncpy (text, "Paul", kVstMaxParamStrLen); break; case 4: vst_strncpy (text, "DbPaul", kVstMaxParamStrLen); break; case 5: vst_strncpy (text, "Tape", kVstMaxParamStrLen); break; case 6: vst_strncpy (text, "HiGloss", kVstMaxParamStrLen); break; case 7: vst_strncpy (text, "Vinyl", kVstMaxParamStrLen); break; case 8: vst_strncpy (text, "Spatial", kVstMaxParamStrLen); break; case 9: vst_strncpy (text, "Natural", kVstMaxParamStrLen); break; case 10: vst_strncpy (text, "NJAD", kVstMaxParamStrLen); break; case 11: vst_strncpy (text, "Trunc", kVstMaxParamStrLen); break; case 12: vst_strncpy (text, "Flat", kVstMaxParamStrLen); break; case 13: vst_strncpy (text, "TPDF", kVstMaxParamStrLen); break; case 14: vst_strncpy (text, "Paul", kVstMaxParamStrLen); break; case 15: vst_strncpy (text, "DbPaul", kVstMaxParamStrLen); break; case 16: vst_strncpy (text, "Tape", kVstMaxParamStrLen); break; case 17: vst_strncpy (text, "HiGloss", kVstMaxParamStrLen); break; case 18: vst_strncpy (text, "Vinyl", kVstMaxParamStrLen); break; case 19: vst_strncpy (text, "Spatial", kVstMaxParamStrLen); break; case 20: vst_strncpy (text, "Natural", kVstMaxParamStrLen); break; case 21: vst_strncpy (text, "NJAD", kVstMaxParamStrLen); break; case 22: vst_strncpy (text, "SlewOnl", kVstMaxParamStrLen); break; case 23: vst_strncpy (text, "SubsOnl", kVstMaxParamStrLen); break; case 24: vst_strncpy (text, "Silhoue", kVstMaxParamStrLen); break; default: break; // unknown parameter, shouldn't happen! } break; default: break; // unknown parameter, shouldn't happen! } //this displays the values and handles 'popups' where it's discrete choices } void Ditherbox::getParameterLabel(VstInt32 index, char *text) { switch (index) { case kParamA: switch((VstInt32)( A * 24.999 )) //0 to almost edge of # of params { case 0: vst_strncpy (text, "16", kVstMaxParamStrLen); break; case 1: vst_strncpy (text, "16", kVstMaxParamStrLen); break; case 2: vst_strncpy (text, "16", kVstMaxParamStrLen); break; case 3: vst_strncpy (text, "16", kVstMaxParamStrLen); break; case 4: vst_strncpy (text, "16", kVstMaxParamStrLen); break; case 5: vst_strncpy (text, "16", kVstMaxParamStrLen); break; case 6: vst_strncpy (text, "16", kVstMaxParamStrLen); break; case 7: vst_strncpy (text, "16", kVstMaxParamStrLen); break; case 8: vst_strncpy (text, "16", kVstMaxParamStrLen); break; case 9: vst_strncpy (text, "16", kVstMaxParamStrLen); break; case 10: vst_strncpy (text, "16", kVstMaxParamStrLen); break; case 11: vst_strncpy (text, "24", kVstMaxParamStrLen); break; case 12: vst_strncpy (text, "24", kVstMaxParamStrLen); break; case 13: vst_strncpy (text, "24", kVstMaxParamStrLen); break; case 14: vst_strncpy (text, "24", kVstMaxParamStrLen); break; case 15: vst_strncpy (text, "24", kVstMaxParamStrLen); break; case 16: vst_strncpy (text, "24", kVstMaxParamStrLen); break; case 17: vst_strncpy (text, "24", kVstMaxParamStrLen); break; case 18: vst_strncpy (text, "24", kVstMaxParamStrLen); break; case 19: vst_strncpy (text, "24", kVstMaxParamStrLen); break; case 20: vst_strncpy (text, "24", kVstMaxParamStrLen); break; case 21: vst_strncpy (text, "24", kVstMaxParamStrLen); break; case 22: vst_strncpy (text, "y", kVstMaxParamStrLen); break; case 23: vst_strncpy (text, "y", kVstMaxParamStrLen); break; case 24: vst_strncpy (text, "tte", kVstMaxParamStrLen); break; default: break; // unknown parameter, shouldn't happen! } break; default: break; // unknown parameter, shouldn't happen! } //this displays the values and handles 'popups' where it's discrete choices } VstInt32 Ditherbox::canDo(char *text) { return (_canDo.find(text) == _canDo.end()) ? -1: 1; } // 1 = yes, -1 = no, 0 = don't know bool Ditherbox::getEffectName(char* name) { vst_strncpy(name, "Ditherbox", kVstMaxProductStrLen); return true; } VstPlugCategory Ditherbox::getPlugCategory() {return kPlugCategEffect;} bool Ditherbox::getProductString(char* text) { vst_strncpy (text, "airwindows Ditherbox", kVstMaxProductStrLen); return true; } bool Ditherbox::getVendorString(char* text) { vst_strncpy (text, "airwindows", kVstMaxVendorStrLen); return true; }
33.273333
104
0.676418
PanieriLorenzo
0d3f6b8cfd3a4a6999441ceb0071d9275d3534b3
4,071
cpp
C++
ds2/lib_demonsaw/component/chat_idle_component.cpp
demonsaw/Code
b036d455e9e034d7fd178e63d5e992242d62989a
[ "MIT" ]
132
2017-03-22T03:46:38.000Z
2022-03-08T15:08:16.000Z
ds2/lib_demonsaw/component/chat_idle_component.cpp
demonsaw/Code
b036d455e9e034d7fd178e63d5e992242d62989a
[ "MIT" ]
4
2017-04-06T17:46:10.000Z
2018-08-08T18:27:59.000Z
ds2/lib_demonsaw/component/chat_idle_component.cpp
demonsaw/Code
b036d455e9e034d7fd178e63d5e992242d62989a
[ "MIT" ]
30
2017-03-26T22:38:17.000Z
2021-11-21T20:50:17.000Z
// // The MIT License(MIT) // // Copyright(c) 2014 Demonsaw LLC // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in all // copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. \ #include "chat_idle_component.h" #include "client/client_option_component.h" #include "command/client/request/client_chat_request_command.h" #include "http/http_code.h" #include "router/router_component.h" namespace eja { // Interface void chat_idle_component::init() { idle_component::init(); start(); } void chat_idle_component::shutdown() { idle_component::shutdown(); close(); } // Utility void chat_idle_component::open() { try { close(); // Open const auto owner = get_entity(); if (!owner) { log("Invalid entity (chat)"); return; } const auto router = owner->get<router_component>(); if (!router) { log("Invalid router (chat)"); return; } const auto option = owner->get<client_option_component>(); if (!option) { log("Invalid option (chat)"); return; } // Socket //m_socket->set_keep_alive(true); m_socket->set_timeout(option->get_socket_timeout()); m_socket->open(router->get_address(), router->get_port()); } catch (std::exception& /*ex*/) { //log(ex); } catch (...) { //log("Unknown Error (chat)"); } } void chat_idle_component::close() { try { // Close m_socket->close(); } catch (std::exception& /*ex*/) { //log(ex); } catch (...) { //log("Unknown Error (chat)"); } } void chat_idle_component::add(const std::string& message, const entity::ptr entity /*= nullptr*/) { const auto data = std::shared_ptr<chat_data>(new chat_data { entity, message, (entity ? chat_type::client : chat_type::group) }); m_queue.add(data); } void chat_idle_component::add(const entity::ptr entity, const std::string& message, const chat_type type) { const auto data = std::shared_ptr<chat_data>(new chat_data { entity, message, type } ); m_queue.add(data); } bool chat_idle_component::on_run() { const auto owner = get_entity(); if (!owner) return idle_component::on_run(); const auto data = m_queue.pop(); if (!data) return idle_component::on_run(); try { // Socket if (m_socket->invalid()) open(); // Command const auto request_command = client_chat_request_command::create(owner, m_socket); const auto request_status = request_command->execute(data->entity, data->message, data->type); if (request_status.is_error()) { // Try again? if (request_status.is_none()) m_queue.push_front(data); //log(request_status); open(); } } catch (std::exception& /*ex*/) { //log(e); m_queue.push_front(data); open(); } catch (...) { //log("Unknown Error (chat)"); m_queue.push_front(data); open(); } // Delay const auto delay = m_queue.empty() ? default_timeout::client::chat : default_timeout::error; set_delay(delay); return idle_component::on_run(); } bool chat_idle_component::on_stop() { close(); return idle_component::on_stop(); } }
23
131
0.669369
demonsaw
0d40d197c7216f170dbb37c2233e9211f1c296e8
4,009
cc
C++
crunchy/internal/keyset/macer_factory.cc
google/crunchy
9d241ffd619889ed9855e2cf41dc0c5485a7148c
[ "Apache-2.0" ]
125
2017-11-21T14:23:02.000Z
2021-06-15T10:13:54.000Z
crunchy/internal/keyset/macer_factory.cc
Jason-Cooke/crunchy
9d241ffd619889ed9855e2cf41dc0c5485a7148c
[ "Apache-2.0" ]
2
2018-01-11T14:07:18.000Z
2018-07-12T16:20:30.000Z
crunchy/internal/keyset/macer_factory.cc
google/crunchy
9d241ffd619889ed9855e2cf41dc0c5485a7148c
[ "Apache-2.0" ]
19
2017-12-08T16:49:06.000Z
2022-01-22T12:34:19.000Z
// Copyright 2017 The CrunchyCrypt Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #include "crunchy/internal/keyset/macer_factory.h" #include <stddef.h> #include <string> #include <utility> #include <vector> #include "absl/memory/memory.h" #include "absl/strings/str_cat.h" #include "absl/strings/strip.h" #include "crunchy/internal/keys/macing_key.h" #include "crunchy/internal/keyset/keyset_util.h" #include "crunchy/internal/port/port.h" #include "crunchy/key_management/keyset_handle.h" #include "crunchy/key_management/keyset_manager.h" namespace crunchy { namespace { class MacerImpl : public CrunchyMacer { public: MacerImpl(std::vector<std::unique_ptr<MacingKey>> keys, std::vector<std::string> prefices, MacingKey* primary_key, absl::string_view primary_prefix) : keys_(std::move(keys)), prefices_(std::move(prefices)), primary_key_(CRUNCHY_CHECK_NOTNULL(primary_key)), primary_prefix_(primary_prefix) { CRUNCHY_CHECK_EQ(keys_.size(), prefices_.size()); } StatusOr<std::string> Sign(absl::string_view message) const override { auto status_or_signature = primary_key_->Sign(message); if (!status_or_signature.ok()) { return status_or_signature.status(); } return absl::StrCat(primary_prefix_, status_or_signature.ValueOrDie()); } Status Verify(absl::string_view message, absl::string_view signature) const override { bool key_found = false; Status error_status; for (size_t i = 0; i < keys_.size(); i++) { absl::string_view crypto_signature = signature; if (!absl::ConsumePrefix(&crypto_signature, prefices_[i])) { continue; } key_found = true; error_status = keys_[i]->Verify(message, crypto_signature); if (error_status.ok()) { return OkStatus(); } } if (key_found) { return error_status; } return FailedPreconditionErrorBuilder(CRUNCHY_LOC).LogInfo() << "Key not found"; } private: const std::vector<std::unique_ptr<MacingKey>> keys_; const std::vector<std::string> prefices_; const MacingKey* primary_key_; const absl::string_view primary_prefix_; }; } // namespace StatusOr<std::unique_ptr<CrunchyMacer>> MakeCrunchyMacer( const MacingKeyRegistry& registry, const Keyset& keyset) { std::vector<std::unique_ptr<MacingKey>> keys; std::vector<std::string> prefices; for (const Key& key : keyset.key()) { auto status_or_key = registry.MakeKey(key.metadata().type().crunchy_label(), key.data()); if (!status_or_key.ok()) { return status_or_key.status(); } keys.push_back(std::move(status_or_key.ValueOrDie())); prefices.push_back(key.metadata().prefix()); } if (keyset.primary_key_id() < 0) { return InvalidArgumentErrorBuilder(CRUNCHY_LOC).LogInfo() << "Invalid primary key id: " << keyset.primary_key_id(); } if (keys.size() <= static_cast<size_t>(keyset.primary_key_id())) { return InvalidArgumentErrorBuilder(CRUNCHY_LOC).LogInfo() << "primary_key_id is " << keyset.primary_key_id() << " but there are only " << keys.size() << " keys"; } MacingKey* primary_key = keys[keyset.primary_key_id()].get(); absl::string_view primary_prefix = prefices[keyset.primary_key_id()]; return {absl::make_unique<MacerImpl>(std::move(keys), std::move(prefices), primary_key, primary_prefix)}; } } // namespace crunchy
34.86087
76
0.688451
google
0d44f4292eb3dbad76d97d0ceb887f16194a6eb9
1,533
cpp
C++
test/bench/cpp/rbtree-ck.cpp
lovebaihezi/koka
b1670308f88dd1fc6c22cad28385fcb185d5b27d
[ "Apache-2.0" ]
2,057
2016-12-21T18:14:47.000Z
2022-03-30T13:51:43.000Z
test/bench/cpp/rbtree-ck.cpp
lovebaihezi/koka
b1670308f88dd1fc6c22cad28385fcb185d5b27d
[ "Apache-2.0" ]
207
2017-01-15T03:17:34.000Z
2022-03-23T06:39:40.000Z
test/bench/cpp/rbtree-ck.cpp
lovebaihezi/koka
b1670308f88dd1fc6c22cad28385fcb185d5b27d
[ "Apache-2.0" ]
116
2017-01-25T19:17:49.000Z
2022-03-11T01:25:57.000Z
// Try persisting std:map through copying; is too slow... // We should try to make a persistent RB tree in C++ but this is not trivial to do... #include <iostream> #include <map> #include <list> #include <algorithm> #include <memory> // #include "util/nat.h" // #include "util/list.h" // using namespace lean; using std::for_each; using std::list; typedef int nat; struct nat_lt_fn { bool operator()(nat const & n1, nat const & n2) const { return n1 < n2; } }; typedef std::map<nat, bool, nat_lt_fn> map_t; typedef std::shared_ptr<map_t> map; list<map>& cons(map m, list<map>& stack) { stack.push_front(m); return stack; } map head(list<map>& stack) { return stack.front(); } list<map> mk_map(unsigned n, unsigned freq) { list<map> stack; auto m = std::make_shared<map_t>(); while (n > 0) { --n; m->insert(std::make_pair(nat(n), n%10 == 0)); if (n % freq == 0) { stack = cons(std::make_shared<map_t>(*m) /* copy constructor */, stack); } } stack = cons(m, stack); return stack; } nat fold(map const & m) { nat r(0); for_each(m->begin(), m->end(), [&](std::pair<nat, bool> const & p) { if (p.second) r = r + nat(1); }); return r; } int main(int argc, char ** argv) { unsigned n = 4200; // 4200000; unsigned freq = 5; if (argc == 3) { n = atoi(argv[1]); freq = atoi(argv[2]); } list<map> m = mk_map(n, freq); std::cout << fold(head(m)) << "\n"; return 1; // signal that this test is not working }
24.333333
106
0.585127
lovebaihezi
0d4c744a76f95c97a248ba7f551d359e7406e9c4
4,225
hpp
C++
include/exec.hpp
geraldc-unm/Comb
790d054f9722e6752a27a1c2e08c135f9d5b8e75
[ "MIT" ]
21
2018-10-03T18:15:04.000Z
2022-02-16T08:07:50.000Z
include/exec.hpp
geraldc-unm/Comb
790d054f9722e6752a27a1c2e08c135f9d5b8e75
[ "MIT" ]
5
2019-10-07T23:06:57.000Z
2021-08-16T16:10:58.000Z
include/exec.hpp
geraldc-unm/Comb
790d054f9722e6752a27a1c2e08c135f9d5b8e75
[ "MIT" ]
6
2019-09-13T16:47:33.000Z
2022-03-03T16:17:32.000Z
////////////////////////////////////////////////////////////////////////////// // Copyright (c) 2018-2021, Lawrence Livermore National Security, LLC. // // Produced at the Lawrence Livermore National Laboratory // // LLNL-CODE-758885 // // All rights reserved. // // This file is part of Comb. // // For details, see https://github.com/LLNL/Comb // Please also see the LICENSE file for MIT license. ////////////////////////////////////////////////////////////////////////////// #ifndef _EXEC_HPP #define _EXEC_HPP #include "config.hpp" #include <cstdio> #include <cstdlib> #include <cassert> #include <type_traits> #include "exec_utils.hpp" #include "memory.hpp" #include "ExecContext.hpp" #include "exec_fused.hpp" #include "exec_pol_seq.hpp" #include "exec_pol_omp.hpp" #include "exec_pol_cuda.hpp" #include "exec_pol_cuda_graph.hpp" #include "exec_pol_mpi_type.hpp" #include "exec_pol_raja.hpp" namespace COMB { template < typename my_context_type > struct ContextHolder { using context_type = my_context_type; bool m_available = false; bool available() const { return m_available; } template < typename ... Ts > void create(Ts&&... args) { destroy(); m_context = new context_type(std::forward<Ts>(args)...); } context_type& get() { assert(m_context != nullptr); return *m_context; } void destroy() { if (m_context) { delete m_context; m_context = nullptr; } } ~ContextHolder() { destroy(); } private: context_type* m_context = nullptr; }; struct Executors { Executors() { } Executors(Executors const&) = delete; Executors(Executors &&) = delete; Executors& operator=(Executors const&) = delete; Executors& operator=(Executors &&) = delete; void create_executors(Allocators& alocs) { base_cpu.create(); #ifdef COMB_ENABLE_MPI base_mpi.create(); #endif #ifdef COMB_ENABLE_CUDA base_cuda.create(); #endif #ifdef COMB_ENABLE_RAJA base_raja_cpu.create(); #ifdef COMB_ENABLE_CUDA base_raja_cuda.create(); #endif #endif seq.create(base_cpu.get(), alocs.host.allocator()); #ifdef COMB_ENABLE_OPENMP omp.create(base_cpu.get(), alocs.host.allocator()); #endif #ifdef COMB_ENABLE_CUDA cuda.create(base_cuda.get(), (alocs.access.use_device_preferred_for_cuda_util_aloc) ? alocs.cuda_managed_device_preferred_host_accessed.allocator() : alocs.cuda_hostpinned.allocator()); #endif #ifdef COMB_ENABLE_CUDA_GRAPH cuda_graph.create(base_cuda.get(), (alocs.access.use_device_preferred_for_cuda_util_aloc) ? alocs.cuda_managed_device_preferred_host_accessed.allocator() : alocs.cuda_hostpinned.allocator()); #endif #ifdef COMB_ENABLE_MPI mpi_type.create(base_mpi.get(), alocs.host.allocator()); #endif #ifdef COMB_ENABLE_RAJA raja_seq.create(base_raja_cpu.get(), alocs.host.allocator()); #ifdef COMB_ENABLE_OPENMP raja_omp.create(base_raja_cpu.get(), alocs.host.allocator()); #endif #ifdef COMB_ENABLE_CUDA raja_cuda.create(base_raja_cuda.get(), (alocs.access.use_device_preferred_for_cuda_util_aloc) ? alocs.cuda_managed_device_preferred_host_accessed.allocator() : alocs.cuda_hostpinned.allocator()); #endif #endif } ContextHolder<CPUContext> base_cpu; #ifdef COMB_ENABLE_MPI ContextHolder<MPIContext> base_mpi; #endif #ifdef COMB_ENABLE_CUDA ContextHolder<CudaContext> base_cuda; #endif #ifdef COMB_ENABLE_RAJA ContextHolder<RAJAContext<RAJA::resources::Host>> base_raja_cpu; #ifdef COMB_ENABLE_CUDA ContextHolder<RAJAContext<RAJA::resources::Cuda>> base_raja_cuda; #endif #endif ContextHolder<ExecContext<seq_pol>> seq; #ifdef COMB_ENABLE_OPENMP ContextHolder<ExecContext<omp_pol>> omp; #endif #ifdef COMB_ENABLE_CUDA ContextHolder<ExecContext<cuda_pol>> cuda; #ifdef COMB_ENABLE_CUDA_GRAPH ContextHolder<ExecContext<cuda_graph_pol>> cuda_graph; #endif #endif #ifdef COMB_ENABLE_MPI ContextHolder<ExecContext<mpi_type_pol>> mpi_type; #endif #ifdef COMB_ENABLE_RAJA ContextHolder<ExecContext<raja_seq_pol>> raja_seq; #ifdef COMB_ENABLE_OPENMP ContextHolder<ExecContext<raja_omp_pol>> raja_omp; #endif #ifdef COMB_ENABLE_CUDA ContextHolder<ExecContext<raja_cuda_pol>> raja_cuda; #endif #endif }; } // namespace COMB #endif // _EXEC_HPP
24.142857
199
0.725207
geraldc-unm
0d505c9bb221def9f896b1ac514935a8c9feb8ae
403
cpp
C++
Treads!/ScoreRecord.cpp
JoeKooler/Treads
5412d4a94a7b331aa37d04ff85e6f9e53da1150b
[ "MIT" ]
null
null
null
Treads!/ScoreRecord.cpp
JoeKooler/Treads
5412d4a94a7b331aa37d04ff85e6f9e53da1150b
[ "MIT" ]
null
null
null
Treads!/ScoreRecord.cpp
JoeKooler/Treads
5412d4a94a7b331aa37d04ff85e6f9e53da1150b
[ "MIT" ]
null
null
null
#include "ScoreRecord.hpp" using namespace std; ScoreRecord::ScoreRecord(std::string nameStr, int scoreVal, float timeVal) : name(nameStr), score(scoreVal), time(timeVal) { } void ScoreRecord::write(std::ostream & strm) const { strm << name << " "; strm << score << " "; strm << time << endl; } void ScoreRecord::read(std::istream & strm) { strm >> name >> score >> time; }
19.190476
123
0.62531
JoeKooler
0d55e3d06c3d011f9c37c453b15ebbd14e0e909e
126
cpp
C++
contrib/UnitTest++/src/tests/Main.cpp
Alexander-Ignatyev/optimer
fc0fb8ffd35e6326f60d77c144cfe7635a6edaa7
[ "BSD-3-Clause" ]
null
null
null
contrib/UnitTest++/src/tests/Main.cpp
Alexander-Ignatyev/optimer
fc0fb8ffd35e6326f60d77c144cfe7635a6edaa7
[ "BSD-3-Clause" ]
null
null
null
contrib/UnitTest++/src/tests/Main.cpp
Alexander-Ignatyev/optimer
fc0fb8ffd35e6326f60d77c144cfe7635a6edaa7
[ "BSD-3-Clause" ]
null
null
null
#include "../TestRunnerTeamCity.h" int main(int, char const *[]) { return UnitTest::RunAllTestsWithTeamCity(); }
15.75
48
0.650794
Alexander-Ignatyev
0d562cab15d064ea2ea82648da228fecb4314811
6,517
cpp
C++
src/PhantomEngine/PhantomUITextBox.cpp
DexianZhao/PhantomEngineV2
cc3bf02ca1d442713d471ca8835ca026bb32e841
[ "MIT" ]
1
2021-10-30T07:38:25.000Z
2021-10-30T07:38:25.000Z
src/PhantomEngine/PhantomUITextBox.cpp
DexianZhao/PhantomEngineV2
cc3bf02ca1d442713d471ca8835ca026bb32e841
[ "MIT" ]
null
null
null
src/PhantomEngine/PhantomUITextBox.cpp
DexianZhao/PhantomEngineV2
cc3bf02ca1d442713d471ca8835ca026bb32e841
[ "MIT" ]
null
null
null
////////////////////////////////////////////////////////////////////////////////////////////////////// /* 幻影游戏引擎, 2009-2016, Phantom Game Engine, http://www.aixspace.com Design Writer : 赵德贤 Dexian Zhao Email: yuzhou_995@hotmail.com */ ////////////////////////////////////////////////////////////////////////////////////////////////////// #include "PhantomUITextBox.h" #include "PhantomManager.h" #include "PhantomUIDialog.h" extern "C"{ void openEdit(const char* szDefault, int x, int y, int w, int h, int id); int closeEdit(char* ret, int buflen); }; namespace Phantom{ UITextBox::UITextBox( BOOL bInit, UIDialog *dialogPtr ) : UIControl(bInit, dialogPtr) { m_controlType = UIControlType_EDITBOX; m_dialogPtr = dialogPtr; m_bLButtonDown = false; // m_bPassword = false; if(bInit) { m_bgElement.SetSourceRect(Rect(83, 0, 83 + 30, 30)); m_bgElement.SetRenderScale(false, false, Pixel(5, 5)); // m_bgElement.m_name = ("背景"); } // ClearElement(); AddElement(&m_bgElement); // m_borderWidth = 0; } char UITextBox::onMouseMessage( unsigned int uMsg, Pixel pt, unsigned int touchIndex ) {CPUTime(UITextBox); if( !m_bVisible || this->m_bIsBackground ) return false; if(!this->IsEnabledCtrl() && this->canHaveFocus()) { switch(uMsg) { case InputEventID_ButtonDown: case InputEventID_ButtonDblClk: case InputEventID_MouseMove: return isPtIn( pt ); default: return false; } } switch(uMsg) { case InputEventID_MouseMove: { char bMouseMove = isPtIn(pt); if(bMouseMove) { if(!m_bMouseEnter) this->onMouseEnter(); } } break; case InputEventID_ButtonDown: { if(isPtIn(pt) && canHaveFocus()) { m_bLButtonDown = (touchIndex + 1); for(int i=0;i<m_drawMgrs.size();i++) if(m_drawMgrs[i]->OnDownClick(pt, EventID_Click)) break; return true; } //if(m_bLButtonDown && isPtIn(pt)) //OnButtonClick(EventID_Click); //m_bLButtonDown = false; } break; case InputEventID_ButtonUp: { for(int i=0;i<m_drawMgrs.size();i++) m_drawMgrs[i]->OnUpClick(pt, EventID_Click); if(m_bLButtonDown == (touchIndex + 1) && isPtIn(pt) && !this->m_bReadOnly) { OnButtonClick(pt, EventID_Click); m_bLButtonDown = false; int x=0,y=0; this->m_dialogPtr->GetLocation(x,y); openEdit(this->m_text.str(), m_windowRect.left+x,m_windowRect.top+y, m_windowRect.GetWidth(), m_windowRect.GetHeight(), this->GetID()); return true; } } break; case InputEventID_ButtonDblClk: { if(isPtIn(pt) && canHaveFocus()) m_bLButtonDown = true; if(m_bLButtonDown && isPtIn(pt)) { OnButtonClick(pt, EventID_DoubleClick); return true; } m_bLButtonDown = false; } break; } return UIControl::onMouseMessage( uMsg, pt, touchIndex ); } VOID UITextBox::OnEditClose(BOOL bIsCancel, const char* text) { if(!bIsCancel) this->SetText(text); } void UITextBox::Render( float fElapsedTime ) {CPUTime(UITextBox); if( m_bVisible == false ) return; //if(this->m_bMouseEnter && m_bMouseEnterEffect) //{ // g_manager->SetBlendMode((BlendMode)m_mouseEnterSrc,(BlendMode)m_mouseEnterDesc); //} //else //{ g_manager->SetBlendMode((BlendMode)m_bgElement.m_nSrcBlend,(BlendMode)m_bgElement.m_nDestBlend); //} if(m_bgElement.GetTextureNewID() >= 0) { //if(m_bMouseEnter && m_bMouseEnterEffect) //m_dialogPtr->DrawElement(GetEnabled(), GetDisableColor(), &m_bgElement, &m_bgElement.rcTexture, &m_currentAnim.rc, this->m_mouseEnterColor * m_currentAnim.textureColor, true, &m_currentAnim); //else if(!this->m_bEnableUseImageText) m_dialogPtr->DrawElement(GetEnabled(), &m_bgElement, &m_bgElement.rcTexture, &m_currentAnim.rc, m_bgElement.textureColor * m_currentAnim.textureColor, &m_currentAnim, this); } Rect rc = m_currentAnim.rc; Pixel center(m_rotCenter.x + rc.left, m_rotCenter.y + rc.top); rc.left = (int)((float)(rc.left - center.x) * m_scale.x) + center.x; rc.right = (int)((float)(rc.right - center.x) * m_scale.x) + center.x; rc.top = (int)((float)(rc.top - center.y) * m_scale.y) + center.y; rc.bottom = (int)((float)(rc.bottom - center.y) * m_scale.y) + center.y; if(m_text.size() > 0) { m_bgElement.dwTextFormat = m_textFormat; //Rect rc = m_currentAnim.rc; //rc.inflate(-m_borderWidth, -m_borderWidth); if(m_bEnableUseImageText) RenderImgText(m_bgElement); } if(m_textPtr&&!m_bEnableUseImageText) { m_dialogPtr->DrawElement(m_textPtr, GetEnabled(), &m_bgElement, 0, &rc, m_textColor * m_currentAnim.textColor, &m_currentAnim, this, 0); } if(m_text.size() > 0) { //m_bgElement.dwTextFormat = m_textFormat; //Rect rc = m_currentAnim.rc; //rc.inflate(-m_borderWidth, -m_borderWidth); //if(m_bEnableUseImageText) // RenderImgText(m_bgElement); //else // m_dialogPtr->DrawElementText(GetEnabled(), m_currentAnim.rc, m_text.str(), &m_bgElement, &rc, m_textColor * m_currentAnim.textColor, m_nShadowWidth, m_shadowColor, true, &m_currentAnim); } this->RenderDrawMgrs(); } char UITextBox::LoadControl(CSafeFileHelperR& r) {CPUTime(UITextBox); UIControl::LoadControl( r ); skip_r sr; if(m_loadVersion>=0x000000A4) sr.begin(r.pStream); r >> m_borderWidth >> m_nSpacing >> m_rcText >> m_dfBlink >> m_dfLastBlink >> m_bCaretOn >> m_nCaret >> m_bInsertMode >> m_nSelStart >> m_nFirstVisible >> m_TextColor >> m_SelTextColor >> m_SelBkColor >> m_CaretColor >> m_bRenderBorder >> m_bPassword; r.pStream->read(m_rcRender, sizeof(m_rcRender)); if(this->m_loadVersion >= 0x00000066) { if(this->m_loadVersion<0x000000A2){ TypeArray<short_t> text; r >> text; } else { std::string str; r >> str; SetText(str.c_str()); } //SetText(text.c_str()); } if(m_loadVersion >= 0x00000068) { int sb = 0; r >> sb; m_scrollBarWidth = sb; } sr.end(); return true; } char UITextBox::SaveControl(CSafeFileHelperW& w) {CPUTime(UITextBox); UIControl::SaveControl( w ); skip_w sw(w.pStream); w << m_borderWidth << m_nSpacing << m_rcText << m_dfBlink << m_dfLastBlink << m_bCaretOn << m_nCaret << m_bInsertMode << m_nSelStart << m_nFirstVisible << m_TextColor << m_SelTextColor << m_SelBkColor << m_CaretColor << m_bRenderBorder << m_bPassword; w.pStream->write(m_rcRender, sizeof(m_rcRender)); w << m_text.str(); int sb = m_scrollBarWidth; w << sb; sw.end(); return true; } };
29.622727
197
0.651834
DexianZhao
0d5671dac35b53c631368e274aa0088e66566096
2,011
cpp
C++
Source/PLT/POSIX/Rtc.cpp
sandsmark/Platform
067ce90b3600ad2ab19e216b90c1618605c43ae9
[ "MIT" ]
3
2018-01-30T06:27:47.000Z
2020-11-28T16:32:39.000Z
Source/PLT/POSIX/Rtc.cpp
sandsmark/Platform
067ce90b3600ad2ab19e216b90c1618605c43ae9
[ "MIT" ]
1
2021-02-07T21:15:36.000Z
2021-02-07T21:15:36.000Z
Source/PLT/POSIX/Rtc.cpp
sandsmark/Platform
067ce90b3600ad2ab19e216b90c1618605c43ae9
[ "MIT" ]
1
2019-09-05T18:22:44.000Z
2019-09-05T18:22:44.000Z
//------------------------------------------------------------------------------ // Copyright (c) 2019 John D. Haughton // // 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. //------------------------------------------------------------------------------ // Stub RTC implementation #include <ctime> #include <sys/time.h> #include "PLT/Rtc.h" namespace PLT { namespace Rtc { bool getDateAndTime(DateAndTime& value) { time_t now = time(nullptr); if (now == -1) return false; struct tm* info = localtime(&now); value.year = 1900 + info->tm_year; value.month = info->tm_mon; value.day = info->tm_mday; value.hour = info->tm_hour; value.minute = info->tm_min; value.second = info->tm_sec; return true; } bool getEpocTime(Time& value) { struct timeval now; if (gettimeofday(&now, nullptr) == -1) return false; value.second = now.tv_sec; value.micro_second = now.tv_usec; return true; } } // namespace Rtc } // namespace PLT
31.421875
80
0.659373
sandsmark
0d579fffbca8a36f51ddfe773a5f0d234528cc0a
372
cpp
C++
IT-OOPs-A2/IT_OOP_L2Q2.cpp
umgbhalla/OOPsAssign
34cee8907fea4ee659b1e0cf146a2b1b09a96c3b
[ "MIT" ]
5
2021-09-03T18:33:40.000Z
2021-09-13T11:51:38.000Z
IT-OOPs-A2/IT_OOP_L2Q2.cpp
umgbhalla/OOPsAssign
34cee8907fea4ee659b1e0cf146a2b1b09a96c3b
[ "MIT" ]
1
2021-07-28T05:36:15.000Z
2021-07-28T05:36:15.000Z
IT-OOPs-A2/IT_OOP_L2Q2.cpp
umgbhalla/OOPsAssign
34cee8907fea4ee659b1e0cf146a2b1b09a96c3b
[ "MIT" ]
4
2021-07-28T05:26:52.000Z
2021-07-28T16:19:03.000Z
#include <iostream> using namespace std; int reversDigits(int n) { int rev_n = 0; while (n > 0) { rev_n = rev_n * 10 + n % 10; n = n / 10; } return rev_n; } int main() { int n = 0; cout << "Enter Integer value :: "; cin >> n; cout << "\nReverse of Integer value is :: " << reversDigits(n) << endl; return 0; }
14.88
75
0.5
umgbhalla
0d594964b80acaba29852914d098dd286b38795b
80
cpp
C++
Firefly/vendor/stb/stb_sprintf.cpp
Latias94/Firefly
ad6671df0b16ed9481b013936ba06ffc3be80e60
[ "Apache-2.0" ]
null
null
null
Firefly/vendor/stb/stb_sprintf.cpp
Latias94/Firefly
ad6671df0b16ed9481b013936ba06ffc3be80e60
[ "Apache-2.0" ]
null
null
null
Firefly/vendor/stb/stb_sprintf.cpp
Latias94/Firefly
ad6671df0b16ed9481b013936ba06ffc3be80e60
[ "Apache-2.0" ]
null
null
null
#include "ffpch.h" #define STB_SPRINTF_IMPLEMENTATION #include "stb_sprintf.h"
16
34
0.8
Latias94
0d5e451ba86c4fc06c9ee90cf820a4e0e7910b2e
41,787
cpp
C++
src/network/postgres_protocol_handler.cpp
phisiart/peloton
c2becb9d6f2e2c8f48696a371b0d7c0ff79d56fc
[ "Apache-2.0" ]
1
2017-04-17T15:19:36.000Z
2017-04-17T15:19:36.000Z
src/network/postgres_protocol_handler.cpp
phisiart/peloton
c2becb9d6f2e2c8f48696a371b0d7c0ff79d56fc
[ "Apache-2.0" ]
5
2017-04-23T17:16:14.000Z
2017-04-25T03:14:16.000Z
src/network/postgres_protocol_handler.cpp
phisiart/peloton-p3
c2becb9d6f2e2c8f48696a371b0d7c0ff79d56fc
[ "Apache-2.0" ]
null
null
null
//===----------------------------------------------------------------------===// // // Peloton // // postgres_protocol_handler.cpp // // Identification: src/network/postgres_protocol_handler.cpp // // Copyright (c) 2015-17, Carnegie Mellon University Database Group // //===----------------------------------------------------------------------===// #include "network/postgres_protocol_handler.h" #include <boost/algorithm/string.hpp> #include <cstdio> #include <unordered_map> #include "common/cache.h" #include "common/macros.h" #include "common/portal.h" #include "planner/abstract_plan.h" #include "planner/delete_plan.h" #include "planner/insert_plan.h" #include "planner/update_plan.h" #include "include/traffic_cop/traffic_cop.h" #include "type/types.h" #include "type/value.h" #include "type/value_factory.h" #include "network/marshal.h" #include "settings/settings_manager.h" namespace peloton { namespace network { // TODO: Remove hardcoded auth strings // Hardcoded authentication strings used during session startup. To be removed const std::unordered_map<std::string, std::string> // clang-format off PostgresProtocolHandler::parameter_status_map_ = boost::assign::map_list_of("application_name", "psql") ("client_encoding", "UTF8") ("DateStyle", "ISO, MDY") ("integer_datetimes", "on") ("IntervalStyle", "postgres") ("is_superuser", "on") ("server_encoding", "UTF8") ("server_version", "9.5devel") ("session_authorization", "postgres") ("standard_conforming_strings", "on") ("TimeZone", "US/Eastern"); // clang-format on PostgresProtocolHandler::PostgresProtocolHandler(tcop::TrafficCop *traffic_cop) : ProtocolHandler(traffic_cop), txn_state_(NetworkTransactionStateType::IDLE) { } PostgresProtocolHandler::~PostgresProtocolHandler() {} // TODO: This function is used when txn cache is done void PostgresProtocolHandler::ReplanPreparedStatement(Statement *statement) { std::string error_message; auto new_statement = traffic_cop_->PrepareStatement( statement->GetStatementName(), statement->GetQueryString(), error_message); // But then rip out its query plan and stick it in our old statement if (new_statement.get() == nullptr) { LOG_ERROR( "Failed to generate a new query plan for PreparedStatement '%s'\n%s", statement->GetStatementName().c_str(), error_message.c_str()); } else { LOG_DEBUG("Generating new plan for PreparedStatement '%s'", statement->GetStatementName().c_str()); auto old_plan = statement->GetPlanTree(); auto new_plan = new_statement->GetPlanTree(); statement->SetPlanTree(new_plan); new_statement->SetPlanTree(old_plan); statement->SetNeedsPlan(false); // TODO: We may need to delete the old plan and new statement here } } void PostgresProtocolHandler::SendInitialResponse() { std::unique_ptr<OutputPacket> response(new OutputPacket()); // send auth-ok ('R') response->msg_type = NetworkMessageType::AUTHENTICATION_REQUEST; PacketPutInt(response.get(), 0, 4); responses.push_back(std::move(response)); // Send the parameterStatus map ('S') for (auto it = parameter_status_map_.begin(); it != parameter_status_map_.end(); it++) { MakeHardcodedParameterStatus(*it); } // ready-for-query packet -> 'Z' SendReadyForQuery(NetworkTransactionStateType::IDLE); // we need to send the response right away SetFlushFlag(true); } void PostgresProtocolHandler::MakeHardcodedParameterStatus( const std::pair<std::string, std::string> &kv) { std::unique_ptr<OutputPacket> response(new OutputPacket()); response->msg_type = NetworkMessageType::PARAMETER_STATUS; PacketPutString(response.get(), kv.first); PacketPutString(response.get(), kv.second); responses.push_back(std::move(response)); } void PostgresProtocolHandler::PutTupleDescriptor( const std::vector<FieldInfo> &tuple_descriptor) { if (tuple_descriptor.empty()) return; std::unique_ptr<OutputPacket> pkt(new OutputPacket()); pkt->msg_type = NetworkMessageType::ROW_DESCRIPTION; PacketPutInt(pkt.get(), tuple_descriptor.size(), 2); for (auto col : tuple_descriptor) { PacketPutString(pkt.get(), std::get<0>(col)); // TODO: Table Oid (int32) PacketPutInt(pkt.get(), 0, 4); // TODO: Attr id of column (int16) PacketPutInt(pkt.get(), 0, 2); // Field data type (int32) PacketPutInt(pkt.get(), std::get<1>(col), 4); // Data type size (int16) PacketPutInt(pkt.get(), std::get<2>(col), 2); // Type modifier (int32) PacketPutInt(pkt.get(), -1, 4); // Format code for text PacketPutInt(pkt.get(), 0, 2); } responses.push_back(std::move(pkt)); } void PostgresProtocolHandler::SendDataRows(std::vector<StatementResult> &results, int colcount, int &rows_affected) { if (results.empty() || colcount == 0) return; size_t numrows = results.size() / colcount; // 1 packet per row for (size_t i = 0; i < numrows; i++) { std::unique_ptr<OutputPacket> pkt(new OutputPacket()); pkt->msg_type = NetworkMessageType::DATA_ROW; PacketPutInt(pkt.get(), colcount, 2); for (int j = 0; j < colcount; j++) { auto content = results[i * colcount + j].second; if (content.size() == 0) { // content is NULL PacketPutInt(pkt.get(), NULL_CONTENT_SIZE, 4); // no value bytes follow } else { // length of the row attribute PacketPutInt(pkt.get(), content.size(), 4); // contents of the row attribute PacketPutBytes(pkt.get(), content); } } responses.push_back(std::move(pkt)); } rows_affected = numrows; } void PostgresProtocolHandler::CompleteCommand(const std::string &query, const QueryType& query_type, int rows) { std::unique_ptr<OutputPacket> pkt(new OutputPacket()); pkt->msg_type = NetworkMessageType::COMMAND_COMPLETE; std::string query_type_string; Statement::ParseQueryTypeString(query, query_type_string); std::string tag = query_type_string ; switch (query_type) { /* After Begin, we enter a txn block */ case QueryType::QUERY_BEGIN: txn_state_ = NetworkTransactionStateType::BLOCK; break; /* After commit, we end the txn block */ case QueryType::QUERY_COMMIT: /* After rollback, the txn block is ended */ case QueryType::QUERY_ROLLBACK: txn_state_ = NetworkTransactionStateType::IDLE; break; case QueryType::QUERY_INSERT: tag += " 0 " + std::to_string(rows); break; case QueryType::QUERY_CREATE: { std::string create_type_string; Statement::ParseCreateTypeString(query, create_type_string); tag += " " + create_type_string; break; } case QueryType::QUERY_PREPARE: break; default: tag += " " + std::to_string(rows); } PacketPutString(pkt.get(), tag); responses.push_back(std::move(pkt)); } /* * put_empty_query_response - Informs the client that an empty query was sent */ void PostgresProtocolHandler::SendEmptyQueryResponse() { std::unique_ptr<OutputPacket> response(new OutputPacket()); response->msg_type = NetworkMessageType::EMPTY_QUERY_RESPONSE; responses.push_back(std::move(response)); } bool PostgresProtocolHandler::HardcodedExecuteFilter(QueryType query_type) { switch (query_type) { // Skip SET case QueryType::QUERY_SET: case QueryType::QUERY_SHOW: return false; // Skip duplicate BEGIN case QueryType::QUERY_BEGIN: if (txn_state_ == NetworkTransactionStateType::BLOCK) { return false; } break; // Skip duuplicate Commits and Rollbacks case QueryType::QUERY_COMMIT: case QueryType::QUERY_ROLLBACK: if (txn_state_ == NetworkTransactionStateType::IDLE) { return false; } default: break; } return true; } // The Simple Query Protocol // Fix mis-split bug: Previously, this function assumes there are multiple // queries in the string and split it by ';', which would cause one containing // ';' being split into multiple queries. // However, the multi-statement queries has been split by the psql client and // there is no need to split the query again. ProcessResult PostgresProtocolHandler::ExecQueryMessage(InputPacket *pkt, const size_t thread_id) { std::string query; PacketGetString(pkt, pkt->len, query); // pop out the last character if it is ';' if (query.back() == ';') { query.pop_back(); } boost::trim(query); protocol_type_ = NetworkProtocolType::POSTGRES_PSQL; if (!query.empty()) { std::vector<StatementResult> result; std::vector<FieldInfo> tuple_descriptor; std::string error_message; int rows_affected = 0; std::string query_type_string_; Statement::ParseQueryTypeString(query, query_type_string_); QueryType query_type; Statement::MapToQueryType(query_type_string_, query_type); query_ = query; query_type_ = query_type; switch (query_type) { case QueryType::QUERY_PREPARE: { std::string statement_name; std::vector<std::string> tokens; boost::split(tokens, query_, boost::is_any_of("(), ")); statement_name = tokens.at(1); std::size_t pos = boost::to_upper_copy(query_).find("AS"); std::string statement_query = query_.substr(pos + 3); boost::trim(statement_query); // Prepare statement std::shared_ptr<Statement> statement(nullptr); LOG_DEBUG("PrepareStatement[%s] => %s", statement_name.c_str(), statement_query.c_str()); statement = traffic_cop_->PrepareStatement(statement_name, statement_query, error_message); if (statement.get() == nullptr) { skipped_stmt_ = true; SendErrorResponse( {{NetworkMessageType::HUMAN_READABLE_ERROR, error_message}}); LOG_TRACE("ExecQuery Error"); SendReadyForQuery(NetworkTransactionStateType::IDLE); return ProcessResult::COMPLETE; } auto entry = std::make_pair(statement_name, statement); statement_cache_.insert(entry); for (auto table_id : statement->GetReferencedTables()) { table_statement_cache_[table_id].push_back(statement.get()); } break; } case QueryType::QUERY_EXECUTE: { std::string statement_name; std::vector<type::Value> param_values; bool unnamed = false; std::vector<std::string> tokens; boost::split(tokens, query, boost::is_any_of("(), ")); statement_name = tokens.at(1); auto statement_cache_itr = statement_cache_.find(statement_name); if (statement_cache_itr != statement_cache_.end()) { statement_ = *statement_cache_itr; } // Did not find statement with same name else { error_message_ = "The prepared statement does not exist"; LOG_ERROR("%s", error_message_.c_str()); SendErrorResponse( {{NetworkMessageType::HUMAN_READABLE_ERROR, error_message_}}); SendReadyForQuery(NetworkTransactionStateType::IDLE); return ProcessResult::COMPLETE; } query_type_ = statement_->GetQueryType(); query_ = statement_->GetQueryString(); std::vector<int> result_format(statement_->GetTupleDescriptor().size(), 0); result_format_ = result_format; for (std::size_t idx = 2; idx < tokens.size(); idx++) { std::string param_str = tokens.at(idx); boost::trim(param_str); if (param_str.empty()) { continue; } param_values.push_back(type::ValueFactory::GetVarcharValue(param_str)); } if (param_values.size() > 0) { statement_->GetPlanTree()->SetParameterValues(&param_values); } param_values_ = param_values; auto status = traffic_cop_->ExecuteStatement(statement_, param_values_, unnamed, nullptr, result_format_, results_, rows_affected_, error_message_, thread_id); if (traffic_cop_->is_queuing_) { return ProcessResult::PROCESSING; } ExecQueryMessageGetResult(status); return ProcessResult::COMPLETE; } default: { // prepareStatement std::string unnamed_statement = "unnamed"; statement_ = traffic_cop_->PrepareStatement(unnamed_statement, query_, error_message); if (statement_.get() == nullptr) { rows_affected = 0; SendErrorResponse( {{NetworkMessageType::HUMAN_READABLE_ERROR, error_message}}); SendReadyForQuery(NetworkTransactionStateType::IDLE); return ProcessResult::COMPLETE; } // ExecuteStatment std::vector<type::Value> param_values; param_values_ = param_values; bool unnamed = false; std::vector<int> result_format(statement_->GetTupleDescriptor().size(), 0); result_format_ = result_format; // should param_values and result_format be local variable? // should results_ be reset when PakcetManager.reset(), why results_ cannot be read? auto status = traffic_cop_->ExecuteStatement(statement_, param_values_, unnamed, nullptr, result_format_, results_, rows_affected_, error_message_, thread_id); if (traffic_cop_->is_queuing_) { return ProcessResult::PROCESSING; } ExecQueryMessageGetResult(status); return ProcessResult::COMPLETE; } } // send the attribute names PutTupleDescriptor(tuple_descriptor); // send the result rows SendDataRows(result, tuple_descriptor.size(), rows_affected); // The response to the SimpleQueryCommand is the query string. CompleteCommand(query_, query_type_, rows_affected); } else { SendEmptyQueryResponse(); } // PAVLO: 2017-01-15 // There used to be code here that would invoke this method passing // in NetworkMessageType::READY_FOR_QUERY as the argument. But when // I switched to strong types, this obviously doesn't work. So I // switched it to be NetworkTransactionStateType::IDLE. I don't know // we just don't always send back the internal txn state? SendReadyForQuery(NetworkTransactionStateType::IDLE); return ProcessResult::COMPLETE; } void PostgresProtocolHandler::ExecQueryMessageGetResult(ResultType status) { std::vector<FieldInfo> tuple_descriptor; if (status == ResultType::SUCCESS) { tuple_descriptor = statement_->GetTupleDescriptor(); } else if (status == ResultType::FAILURE) { // check status SendErrorResponse( {{NetworkMessageType::HUMAN_READABLE_ERROR, error_message_}}); SendReadyForQuery(NetworkTransactionStateType::IDLE); return; } // send the attribute names PutTupleDescriptor(tuple_descriptor); // send the result rows SendDataRows(results_, tuple_descriptor.size(), rows_affected_); // The response to the SimpleQueryCommand is the query string. CompleteCommand(query_, query_type_, rows_affected_); SendReadyForQuery(NetworkTransactionStateType::IDLE); } /* * exec_parse_message - handle PARSE message */ void PostgresProtocolHandler::ExecParseMessage(InputPacket *pkt) { std::string error_message, statement_name, query_string, query_type_string; GetStringToken(pkt, statement_name); QueryType query_type; // Read prepare statement name // Read query string GetStringToken(pkt, query_string); skipped_stmt_ = false; Statement::ParseQueryTypeString(query_string, query_type_string); Statement::MapToQueryType(query_type_string, query_type); // For an empty query or a query to be filtered, just send parse complete // response and don't execute if (query_string == "" || HardcodedExecuteFilter(query_type) == false) { skipped_stmt_ = true; skipped_query_string_ = std::move(query_string); skipped_query_type_ = std::move(query_type); // Send Parse complete response std::unique_ptr<OutputPacket> response(new OutputPacket()); response->msg_type = NetworkMessageType::PARSE_COMPLETE; responses.push_back(std::move(response)); return; } // Prepare statement std::shared_ptr<Statement> statement(nullptr); LOG_DEBUG("PrepareStatement[%s] => %s", statement_name.c_str(), query_string.c_str()); statement = traffic_cop_->PrepareStatement(statement_name, query_string, error_message); if (statement.get() == nullptr) { skipped_stmt_ = true; SendErrorResponse( {{NetworkMessageType::HUMAN_READABLE_ERROR, error_message}}); LOG_TRACE("ExecParse Error"); return; } // Read number of params int num_params = PacketGetInt(pkt, 2); // Read param types std::vector<int32_t> param_types(num_params); auto type_buf_begin = pkt->Begin() + pkt->ptr; auto type_buf_len = ReadParamType(pkt, num_params, param_types); // Cache the received query bool unnamed_query = statement_name.empty(); statement->SetParamTypes(param_types); // Stat if (settings::SettingsManager::GetInt(settings::SettingId::stats_mode) != STATS_TYPE_INVALID) { // Make a copy of param types for stat collection stats::QueryMetric::QueryParamBuf query_type_buf; query_type_buf.len = type_buf_len; query_type_buf.buf = PacketCopyBytes(type_buf_begin, type_buf_len); // Unnamed statement if (unnamed_query) { unnamed_stmt_param_types_ = query_type_buf; } else { statement_param_types_[statement_name] = query_type_buf; } } // Unnamed statement if (unnamed_query) { unnamed_statement_ = statement; } else { auto entry = std::make_pair(statement_name, statement); statement_cache_.insert(entry); for (auto table_id : statement->GetReferencedTables()) { table_statement_cache_[table_id].push_back(statement.get()); } } // Send Parse complete response std::unique_ptr<OutputPacket> response(new OutputPacket()); response->msg_type = NetworkMessageType::PARSE_COMPLETE; responses.push_back(std::move(response)); } void PostgresProtocolHandler::ExecBindMessage(InputPacket *pkt) { std::string portal_name, statement_name; // BIND message GetStringToken(pkt, portal_name); GetStringToken(pkt, statement_name); if (skipped_stmt_) { // send bind complete std::unique_ptr<OutputPacket> response(new OutputPacket()); response->msg_type = NetworkMessageType::BIND_COMPLETE; responses.push_back(std::move(response)); return; } // Read parameter format int num_params_format = PacketGetInt(pkt, 2); std::vector<int16_t> formats(num_params_format); auto format_buf_begin = pkt->Begin() + pkt->ptr; auto format_buf_len = ReadParamFormat(pkt, num_params_format, formats); int num_params = PacketGetInt(pkt, 2); // error handling if (num_params_format != num_params) { std::string error_message = "Malformed request: num_params_format is not equal to num_params"; SendErrorResponse( {{NetworkMessageType::HUMAN_READABLE_ERROR, error_message}}); return; } // Get statement info generated in PARSE message std::shared_ptr<Statement> statement; stats::QueryMetric::QueryParamBuf param_type_buf; // UNNAMED STATEMENT if (statement_name.empty()) { statement = unnamed_statement_; param_type_buf = unnamed_stmt_param_types_; // Check unnamed statement if (statement.get() == nullptr) { std::string error_message = "Invalid unnamed statement"; LOG_ERROR("%s", error_message.c_str()); SendErrorResponse( {{NetworkMessageType::HUMAN_READABLE_ERROR, error_message}}); return; } // NAMED STATEMENT } else { auto statement_cache_itr = statement_cache_.find(statement_name); if (statement_cache_itr != statement_cache_.end()) { statement = *statement_cache_itr; param_type_buf = statement_param_types_[statement_name]; } // Did not find statement with same name else { std::string error_message = "The prepared statement does not exist"; LOG_ERROR("%s", error_message.c_str()); SendErrorResponse( {{NetworkMessageType::HUMAN_READABLE_ERROR, error_message}}); return; } } const auto &query_string = statement->GetQueryString(); const auto &query_type = statement->GetQueryType(); // check if the loaded statement needs to be skipped skipped_stmt_ = false; if (HardcodedExecuteFilter(query_type) == false) { skipped_stmt_ = true; skipped_query_string_ = query_string; std::unique_ptr<OutputPacket> response(new OutputPacket()); // Send Bind complete response response->msg_type = NetworkMessageType::BIND_COMPLETE; responses.push_back(std::move(response)); return; } // Check whether somebody wants us to generate a new query plan // for this prepared statement if (statement->GetNeedsPlan()) { ReplanPreparedStatement(statement.get()); } // Group the parameter types and the parameters in this vector std::vector<std::pair<type::TypeId, std::string>> bind_parameters(num_params); std::vector<type::Value> param_values(num_params); auto param_types = statement->GetParamTypes(); auto val_buf_begin = pkt->Begin() + pkt->ptr; auto val_buf_len = ReadParamValue(pkt, num_params, param_types, bind_parameters, param_values, formats); int format_codes_number = PacketGetInt(pkt, 2); LOG_TRACE("format_codes_number: %d", format_codes_number); // Set the result-column format code if (format_codes_number == 0) { // using the default text format result_format_ = std::vector<int>(statement->GetTupleDescriptor().size(), 0); } else if (format_codes_number == 1) { // get the format code from packet auto result_format = PacketGetInt(pkt, 2); result_format_ = std::vector<int>( statement->GetTupleDescriptor().size(), result_format); } else { // get the format code for each column result_format_.clear(); for (int format_code_idx = 0; format_code_idx < format_codes_number; ++format_code_idx) { result_format_.push_back(PacketGetInt(pkt, 2)); LOG_TRACE("format code: %d", *result_format_.rbegin()); } } if (param_values.size() > 0) { statement->GetPlanTree()->SetParameterValues(&param_values); // Instead of tree traversal, we should put param values in the // executor context. } std::shared_ptr<stats::QueryMetric::QueryParams> param_stat(nullptr); if (settings::SettingsManager::GetInt(settings::SettingId::stats_mode) != STATS_TYPE_INVALID && num_params > 0) { // Make a copy of format for stat collection stats::QueryMetric::QueryParamBuf param_format_buf; param_format_buf.len = format_buf_len; param_format_buf.buf = PacketCopyBytes(format_buf_begin, format_buf_len); PL_ASSERT(format_buf_len > 0); // Make a copy of value for stat collection stats::QueryMetric::QueryParamBuf param_val_buf; param_val_buf.len = val_buf_len; param_val_buf.buf = PacketCopyBytes(val_buf_begin, val_buf_len); PL_ASSERT(val_buf_len > 0); param_stat.reset(new stats::QueryMetric::QueryParams( param_format_buf, param_type_buf, param_val_buf, num_params)); } // Construct a portal. // Notice that this will move param_values so no value will be left there. auto portal = new Portal(portal_name, statement, std::move(param_values), param_stat); std::shared_ptr<Portal> portal_reference(portal); auto itr = portals_.find(portal_name); // Found portal name in portal map if (itr != portals_.end()) { itr->second = portal_reference; } // Create a new entry in portal map else { portals_.insert(std::make_pair(portal_name, portal_reference)); } // send bind complete std::unique_ptr<OutputPacket> response(new OutputPacket()); response->msg_type = NetworkMessageType::BIND_COMPLETE; responses.push_back(std::move(response)); } size_t PostgresProtocolHandler::ReadParamType(InputPacket *pkt, int num_params, std::vector<int32_t> &param_types) { auto begin = pkt->ptr; // get the type of each parameter for (int i = 0; i < num_params; i++) { int param_type = PacketGetInt(pkt, 4); param_types[i] = param_type; } auto end = pkt->ptr; return end - begin; } size_t PostgresProtocolHandler::ReadParamFormat(InputPacket *pkt, int num_params_format, std::vector<int16_t> &formats) { auto begin = pkt->ptr; // get the format of each parameter for (int i = 0; i < num_params_format; i++) { formats[i] = PacketGetInt(pkt, 2); } auto end = pkt->ptr; return end - begin; } // For consistency, this function assumes the input vectors has the correct size size_t PostgresProtocolHandler::ReadParamValue( InputPacket *pkt, int num_params, std::vector<int32_t> &param_types, std::vector<std::pair<type::TypeId, std::string>> &bind_parameters, std::vector<type::Value> &param_values, std::vector<int16_t> &formats) { auto begin = pkt->ptr; ByteBuf param; for (int param_idx = 0; param_idx < num_params; param_idx++) { int param_len = PacketGetInt(pkt, 4); // BIND packet NULL parameter case if (param_len == -1) { // NULL mode auto peloton_type = PostgresValueTypeToPelotonValueType( static_cast<PostgresValueType>(param_types[param_idx])); bind_parameters[param_idx] = std::make_pair(peloton_type, std::string("")); param_values[param_idx] = type::ValueFactory::GetNullValueByType(peloton_type); } else { PacketGetBytes(pkt, param_len, param); if (formats[param_idx] == 0) { // TEXT mode std::string param_str = std::string(std::begin(param), std::end(param)); bind_parameters[param_idx] = std::make_pair(type::TypeId::VARCHAR, param_str); if ((unsigned int)param_idx >= param_types.size() || PostgresValueTypeToPelotonValueType( (PostgresValueType)param_types[param_idx]) == type::TypeId::VARCHAR) { param_values[param_idx] = type::ValueFactory::GetVarcharValue(param_str); } else { param_values[param_idx] = (type::ValueFactory::GetVarcharValue(param_str)) .CastAs(PostgresValueTypeToPelotonValueType( (PostgresValueType)param_types[param_idx])); } PL_ASSERT(param_values[param_idx].GetTypeId() != type::TypeId::INVALID); } else { // BINARY mode switch (static_cast<PostgresValueType>(param_types[param_idx])) { case PostgresValueType::INTEGER: { int int_val = 0; for (size_t i = 0; i < sizeof(int); ++i) { int_val = (int_val << 8) | param[i]; } bind_parameters[param_idx] = std::make_pair(type::TypeId::INTEGER, std::to_string(int_val)); param_values[param_idx] = type::ValueFactory::GetIntegerValue(int_val).Copy(); break; } case PostgresValueType::BIGINT: { int64_t int_val = 0; for (size_t i = 0; i < sizeof(int64_t); ++i) { int_val = (int_val << 8) | param[i]; } bind_parameters[param_idx] = std::make_pair(type::TypeId::BIGINT, std::to_string(int_val)); param_values[param_idx] = type::ValueFactory::GetBigIntValue(int_val).Copy(); break; } case PostgresValueType::DOUBLE: { double float_val = 0; unsigned long buf = 0; for (size_t i = 0; i < sizeof(double); ++i) { buf = (buf << 8) | param[i]; } PL_MEMCPY(&float_val, &buf, sizeof(double)); bind_parameters[param_idx] = std::make_pair(type::TypeId::DECIMAL, std::to_string(float_val)); param_values[param_idx] = type::ValueFactory::GetDecimalValue(float_val).Copy(); break; } case PostgresValueType::VARBINARY: { bind_parameters[param_idx] = std::make_pair(type::TypeId::VARBINARY, std::string(reinterpret_cast<char *>(&param[0]), param_len)); param_values[param_idx] = type::ValueFactory::GetVarbinaryValue( &param[0], param_len, true); break; } default: { LOG_ERROR("Do not support data type: %d", param_types[param_idx]); break; } } PL_ASSERT(param_values[param_idx].GetTypeId() != type::TypeId::INVALID); } } } auto end = pkt->ptr; return end - begin; } ProcessResult PostgresProtocolHandler::ExecDescribeMessage(InputPacket *pkt) { if (skipped_stmt_) { // send 'no-data' message std::unique_ptr<OutputPacket> response(new OutputPacket()); response->msg_type = NetworkMessageType::NO_DATA_RESPONSE; responses.push_back(std::move(response)); return ProcessResult::COMPLETE; } ByteBuf mode; std::string portal_name; PacketGetBytes(pkt, 1, mode); GetStringToken(pkt, portal_name); if (mode[0] == 'P') { LOG_TRACE("Describe a portal"); auto portal_itr = portals_.find(portal_name); // TODO: error handling here // Ahmed: This is causing the continuously running thread // Changed the function signature to return boolean // when false is returned, the connection is closed if (portal_itr == portals_.end()) { LOG_ERROR("Did not find portal : %s", portal_name.c_str()); std::vector<FieldInfo> tuple_descriptor; PutTupleDescriptor(tuple_descriptor); return ProcessResult::COMPLETE; } auto portal = portal_itr->second; if (portal == nullptr) { LOG_ERROR("Portal does not exist : %s", portal_name.c_str()); std::vector<FieldInfo> tuple_descriptor; PutTupleDescriptor(tuple_descriptor); return ProcessResult::TERMINATE; } auto statement = portal->GetStatement(); PutTupleDescriptor(statement->GetTupleDescriptor()); } else { LOG_TRACE("Describe a prepared statement"); } return ProcessResult::COMPLETE; } ProcessResult PostgresProtocolHandler::ExecExecuteMessage(InputPacket *pkt, const size_t thread_id) { // EXECUTE message protocol_type_ = NetworkProtocolType::POSTGRES_JDBC; std::string error_message, portal_name; GetStringToken(pkt, portal_name); // covers weird JDBC edge case of sending double BEGIN statements. Don't // execute them if (skipped_stmt_) { if (skipped_query_string_ == "") { SendEmptyQueryResponse(); } else { std::string skipped_query_type_string; Statement::ParseQueryTypeString(skipped_query_string_, skipped_query_type_string); // The response to ExecuteCommand is the query_type string token. CompleteCommand(skipped_query_type_string, skipped_query_type_, rows_affected_); } skipped_stmt_ = false; return ProcessResult::COMPLETE; } auto portal = portals_[portal_name]; if (portal.get() == nullptr) { LOG_ERROR("Did not find portal : %s", portal_name.c_str()); SendErrorResponse( {{NetworkMessageType::HUMAN_READABLE_ERROR, error_message_}}); SendReadyForQuery(txn_state_); return ProcessResult::TERMINATE; } statement_ = portal->GetStatement(); auto param_stat = portal->GetParamStat(); if (statement_.get() == nullptr) { LOG_ERROR("Did not find statement in portal : %s", portal_name.c_str()); SendErrorResponse( {{NetworkMessageType::HUMAN_READABLE_ERROR, error_message}}); SendReadyForQuery(txn_state_); return ProcessResult::TERMINATE; } auto statement_name = statement_->GetStatementName(); bool unnamed = statement_name.empty(); param_values_ = portal->GetParameters(); auto status = traffic_cop_->ExecuteStatement( statement_, param_values_, unnamed, param_stat, result_format_, results_, rows_affected_, error_message_, thread_id); if (traffic_cop_->is_queuing_) { return ProcessResult::PROCESSING; } ExecExecuteMessageGetResult(status); return ProcessResult::COMPLETE; } void PostgresProtocolHandler::ExecExecuteMessageGetResult(ResultType status) { const auto &query_type = statement_->GetQueryType(); switch (status) { case ResultType::FAILURE: LOG_ERROR("Failed to execute: %s", error_message_.c_str()); SendErrorResponse( {{NetworkMessageType::HUMAN_READABLE_ERROR, error_message_}}); return; case ResultType::ABORTED: if (query_type != QueryType::QUERY_ROLLBACK) { LOG_DEBUG("Failed to execute: Conflicting txn aborted"); // Send an error response if the abort is not due to ROLLBACK query SendErrorResponse({{NetworkMessageType::SQLSTATE_CODE_ERROR, SqlStateErrorCodeToString( SqlStateErrorCode::SERIALIZATION_ERROR)}}); } return; default: { auto tuple_descriptor = statement_->GetTupleDescriptor(); SendDataRows(results_, tuple_descriptor.size(), rows_affected_); // The reponse to ExecuteCommand is the query_type string token. CompleteCommand(statement_->GetQueryTypeString(), query_type, rows_affected_); return; } } } void PostgresProtocolHandler::GetResult() { traffic_cop_->ExecuteStatementPlanGetResult(); auto status = traffic_cop_->ExecuteStatementGetResult(rows_affected_); switch (protocol_type_) { case NetworkProtocolType::POSTGRES_JDBC: LOG_TRACE("JDBC result"); ExecExecuteMessageGetResult(status); break; case NetworkProtocolType::POSTGRES_PSQL: LOG_TRACE("PSQL result"); ExecQueryMessageGetResult(status); } } void PostgresProtocolHandler::ExecCloseMessage(InputPacket *pkt) { uchar close_type = 0; std::string name; PacketGetByte(pkt, close_type); PacketGetString(pkt, 0, name); bool is_unnamed = (name.size() == 0) ? true : false; switch (close_type) { case 'S': LOG_TRACE("Deleting statement %s from cache", name.c_str()); if (is_unnamed) { unnamed_statement_.reset(); } else { // TODO: Invalidate table_statement_cache! statement_cache_.delete_key(name); } break; case 'P': { LOG_TRACE("Deleting portal %s from cache", name.c_str()); auto portal_itr = portals_.find(name); if (portal_itr != portals_.end()) { // delete portal if it exists portals_.erase(portal_itr); } break; } default: // do nothing, simply send close complete break; } // Send close complete response std::unique_ptr<OutputPacket> response(new OutputPacket()); response->msg_type = NetworkMessageType::CLOSE_COMPLETE; responses.push_back(std::move(response)); } // The function tries to do a preliminary read to fetch the size value and // then reads the rest of the packet. // Assume: Packet length field is always 32-bit int bool PostgresProtocolHandler::ReadPacketHeader(Buffer& rbuf, InputPacket& rpkt) { // All packets other than the startup packet have a 5 bytes header size_t initial_read_size = sizeof(int32_t); // check if header bytes are available if (!rbuf.IsReadDataAvailable(initial_read_size + 1)) { // nothing more to read return false; } // get packet size from the header // Header also contains msg type rpkt.msg_type = static_cast<NetworkMessageType>(rbuf.GetByte(rbuf.buf_ptr)); // Skip the message type byte rbuf.buf_ptr++; // extract packet contents size //content lengths should exclude the length bytes rpkt.len = rbuf.GetUInt32BigEndian() - sizeof(uint32_t); // do we need to use the extended buffer for this packet? rpkt.is_extended = (rpkt.len > rbuf.GetMaxSize()); if (rpkt.is_extended) { LOG_TRACE("Using extended buffer for pkt size:%ld", rpkt.len); // reserve space for the extended buffer rpkt.ReserveExtendedBuffer(); } // we have processed the data, move buffer pointer rbuf.buf_ptr += initial_read_size; rpkt.header_parsed = true; return true; } // Tries to read the contents of a single packet, returns true on success, false // on failure. bool PostgresProtocolHandler::ReadPacket(Buffer &rbuf, InputPacket &rpkt) { if (rpkt.is_extended) { // extended packet mode auto bytes_available = rbuf.buf_size - rbuf.buf_ptr; auto bytes_required = rpkt.ExtendedBytesRequired(); // read minimum of the two ranges auto read_size = std::min(bytes_available, bytes_required); rpkt.AppendToExtendedBuffer(rbuf.Begin() + rbuf.buf_ptr, rbuf.Begin() + rbuf.buf_ptr + read_size); // data has been copied, move ptr rbuf.buf_ptr += read_size; if (bytes_required > bytes_available) { // more data needs to be read return false; } // all the data has been read rpkt.InitializePacket(); return true; } else { if (rbuf.IsReadDataAvailable(rpkt.len) == false) { // data not available yet, return return false; } // Initialize the packet's "contents" rpkt.InitializePacket(rbuf.buf_ptr, rbuf.Begin()); // We have processed the data, move buffer pointer rbuf.buf_ptr += rpkt.len; } return true; } ProcessResult PostgresProtocolHandler::Process(Buffer &rbuf, const size_t thread_id) { if (request.header_parsed == false) { // parse out the header first if (ReadPacketHeader(rbuf, request) == false) { // need more data return ProcessResult::MORE_DATA_REQUIRED; } } PL_ASSERT(request.header_parsed == true); if (request.is_initialized == false) { // packet needs to be initialized with rest of the contents if (PostgresProtocolHandler::ReadPacket(rbuf, request) == false) { // need more data return ProcessResult::MORE_DATA_REQUIRED; } } auto process_status = ProcessPacket(&request, thread_id); request.Reset(); return process_status; } /* * process_packet - Main switch block; process incoming packets, * Returns false if the session needs to be closed. */ ProcessResult PostgresProtocolHandler::ProcessPacket(InputPacket *pkt, const size_t thread_id) { LOG_TRACE("Message type: %c", static_cast<unsigned char>(pkt->msg_type)); // We don't set force_flush to true for `PBDE` messages because they're // part of the extended protocol. Buffer responses and don't flush until // we see a SYNC switch (pkt->msg_type) { case NetworkMessageType::SIMPLE_QUERY_COMMAND: { LOG_TRACE("SIMPLE_QUERY_COMMAND"); SetFlushFlag(true); return ExecQueryMessage(pkt, thread_id); } case NetworkMessageType::PARSE_COMMAND: { LOG_TRACE("PARSE_COMMAND"); ExecParseMessage(pkt); } break; case NetworkMessageType::BIND_COMMAND: { LOG_TRACE("BIND_COMMAND"); ExecBindMessage(pkt); } break; case NetworkMessageType::DESCRIBE_COMMAND: { LOG_TRACE("DESCRIBE_COMMAND"); return ExecDescribeMessage(pkt); } case NetworkMessageType::EXECUTE_COMMAND: { LOG_TRACE("EXECUTE_COMMAND"); return ExecExecuteMessage(pkt, thread_id); } case NetworkMessageType::SYNC_COMMAND: { LOG_TRACE("SYNC_COMMAND"); SendReadyForQuery(txn_state_); SetFlushFlag(true); } break; case NetworkMessageType::CLOSE_COMMAND: { LOG_TRACE("CLOSE_COMMAND"); ExecCloseMessage(pkt); } break; case NetworkMessageType::TERMINATE_COMMAND: { LOG_TRACE("TERMINATE_COMMAND"); SetFlushFlag(true); return ProcessResult::TERMINATE; } case NetworkMessageType::NULL_COMMAND: { LOG_TRACE("NULL"); SetFlushFlag(true); return ProcessResult::TERMINATE; } default: { LOG_ERROR("Packet type not supported yet: %d (%c)", static_cast<int>(pkt->msg_type), static_cast<unsigned char>(pkt->msg_type)); } } return ProcessResult::COMPLETE; } /* * send_error_response - Sends the passed string as an error response. * For now, it only supports the human readable 'M' message body */ void PostgresProtocolHandler::SendErrorResponse( std::vector<std::pair<NetworkMessageType, std::string>> error_status) { std::unique_ptr<OutputPacket> pkt(new OutputPacket()); pkt->msg_type = NetworkMessageType::ERROR_RESPONSE; for (auto entry : error_status) { PacketPutByte(pkt.get(), static_cast<unsigned char>(entry.first)); PacketPutString(pkt.get(), entry.second); } // put null terminator PacketPutByte(pkt.get(), 0); // don't care if write finished or not, we are closing anyway responses.push_back(std::move(pkt)); } void PostgresProtocolHandler::SendReadyForQuery(NetworkTransactionStateType txn_status) { std::unique_ptr<OutputPacket> pkt(new OutputPacket()); pkt->msg_type = NetworkMessageType::READY_FOR_QUERY; PacketPutByte(pkt.get(), static_cast<unsigned char>(txn_status)); responses.push_back(std::move(pkt)); } void PostgresProtocolHandler::Reset() { ProtocolHandler::Reset(); unnamed_statement_.reset(); result_format_.clear(); results_.clear(); param_values_.clear(); txn_state_ = NetworkTransactionStateType::IDLE; skipped_stmt_ = false; skipped_query_string_.clear(); statement_cache_.clear(); table_statement_cache_.clear(); portals_.clear(); } } // namespace network } // namespace peloton
35.056208
112
0.675042
phisiart
0d609507770c42304e822774cfce78e26207ce2f
1,580
cpp
C++
code/client/citicore/GameMode.Win32.cpp
MyNameIsYesgo/fivem
6def381fa0a992261a4414fae700c1c077e59327
[ "MIT" ]
5
2020-07-26T16:06:24.000Z
2021-05-01T14:29:40.000Z
code/client/citicore/GameMode.Win32.cpp
MyNameIsYesgo/fivem
6def381fa0a992261a4414fae700c1c077e59327
[ "MIT" ]
6
2021-05-11T09:09:11.000Z
2022-03-23T18:34:23.000Z
code/client/citicore/GameMode.Win32.cpp
MyNameIsYesgo/fivem
6def381fa0a992261a4414fae700c1c077e59327
[ "MIT" ]
3
2020-11-09T12:41:05.000Z
2022-01-24T23:16:15.000Z
#include "StdInc.h" #include "ComponentLoader.h" #include "ToolComponent.h" #include <ResumeComponent.h> #include <Error.h> extern "C" DLL_EXPORT void GameMode_Init() { ComponentLoader* loader = ComponentLoader::GetInstance(); loader->Initialize(); // TODO: init dep tree fwRefContainer<ComponentData> cliComponent = loader->LoadComponent("http-client"); cliComponent->GetInstances()[0]->Initialize(); fwRefContainer<ComponentData> gameComponent = loader->LoadComponent("citizen:game:main"); fwRefContainer<ComponentData> nuiComponent = loader->LoadComponent("nui:core"); nuiComponent->GetInstances()[0]->Initialize(); (dynamic_cast<LifeCycleComponent*>(nuiComponent->GetInstances()[0].GetRef()))->PreInitGame(); fwRefContainer<ComponentData> conComponent = loader->LoadComponent("conhost:v2"); conComponent->GetInstances()[0]->Initialize(); /*ComponentLoader::GetInstance()->ForAllComponents([&](fwRefContainer<ComponentData> componentData) { for (auto& instance : componentData->GetInstances()) { instance->Initialize(); } });*/ if (!gameComponent.GetRef()) { FatalError("Could not obtain citizen:game:main component, which is required for the game to start.\n"); return; } gameComponent->GetInstances()[0]->Initialize(); fwRefContainer<RunnableComponent> runnableGame = dynamic_component_cast<RunnableComponent*>(gameComponent->GetInstances()[0].GetRef()); if (runnableGame.GetRef() != nullptr) { runnableGame->Run(); } else { FatalError("citizen:game:main component does not implement RunnableComponent. Exiting.\n"); } }
29.259259
136
0.744304
MyNameIsYesgo
0d60e9f614496667146802167c8e9ef9105a60af
35,069
cc
C++
src/xwrouter_xid_handler.cc
telosprotocol/xwrouter
20ef56c4ec2eaf0b7fd8baab1e06dfbcfbfe22c7
[ "MIT" ]
13
2019-09-17T08:49:46.000Z
2020-01-13T08:06:14.000Z
src/xwrouter_xid_handler.cc
telosprotocol/xwrouter
20ef56c4ec2eaf0b7fd8baab1e06dfbcfbfe22c7
[ "MIT" ]
null
null
null
src/xwrouter_xid_handler.cc
telosprotocol/xwrouter
20ef56c4ec2eaf0b7fd8baab1e06dfbcfbfe22c7
[ "MIT" ]
null
null
null
// Copyright (c) 2017-2019 Telos Foundation & contributors // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "xwrouter/message_handler/xwrouter_xid_handler.h" #include <algorithm> #include "xpbase/base/kad_key/get_kadmlia_key.h" #include "xpbase/base/xip_parser.h" #include "xpbase/base/kad_key/platform_kadmlia_key.h" #include "xpbase/base/top_utils.h" #include "xkad/routing_table/routing_table.h" #include "xkad/routing_table/routing_utils.h" #include "xwrouter/register_routing_table.h" #include "xwrouter/message_handler/wrouter_message_handler.h" #include "xpbase/base/xip_parser.h" #include "xkad/routing_table/client_node_manager.h" #include "xkad/routing_table/dynamic_xip_manager.h" #include "xtransport/utils/transport_utils.h" #include "xpbase/base/kad_key/get_kadmlia_key.h" #include "xpbase/base/uint64_bloomfilter.h" #include "xpbase/base/redis_client.h" #include "xkad/gossip/rumor_filter.h" #include "xgossip/include/broadcast_layered.h" #include "xgossip/include/gossip_bloomfilter.h" #include "xgossip/include/gossip_bloomfilter_layer.h" #include "xgossip/include/gossip_utils.h" #include "xbase/xutl.h" #include "xtransport/message_manager/message_manager_intf.h" #include "xpbase/base/redis_utils.h" #include "xgossip/include/gossip_filter.h" namespace top { using namespace kadmlia; using namespace gossip; namespace wrouter { WrouterXidHandler::WrouterXidHandler( transport::TransportPtr transport_ptr, std::shared_ptr<gossip::GossipInterface> bloom_gossip_ptr, std::shared_ptr<gossip::GossipInterface> layered_gossip_ptr, std::shared_ptr<gossip::GossipInterface> bloom_layer_gossip_ptr, std::shared_ptr<gossip::GossipInterface> set_layer_gossip_ptr) : WrouterHandler( transport_ptr, bloom_gossip_ptr, layered_gossip_ptr, bloom_layer_gossip_ptr, set_layer_gossip_ptr) {} WrouterXidHandler::~WrouterXidHandler() {} int32_t WrouterXidHandler::SendPacket(transport::protobuf::RoutingMessage& message) { if (message.des_node_id().empty()) { TOP_WARN2("send illegal"); return enum_xerror_code_fail; } if (message.hop_num() >= kadmlia::kHopToLive) { TOP_WARN2("stop SendPacket hop_num(%d) beyond max_hop_num(%d)", message.hop_num(), kadmlia::kHopToLive); return enum_xerror_code_fail; } int ret = RandomlyCommunicate(message); if(enum_xerror_code_no_resource != ret) { TOP_WARN2("enum_xerror_code_no_resource"); return ret; } if (message.src_node_id().empty()) { // choose one random(right) id for this message uint64_t service_type = ParserServiceType(message.des_node_id()); RoutingTablePtr routing_table = nullptr; if (message.has_is_root() && message.is_root()) { routing_table = FindRoutingTable(true, static_cast<uint64_t>(kRoot), true, message.des_node_id()); } else { // attention: the last parameter set false is necessary routing_table = FindRoutingTable(false, service_type, false); } if (!routing_table) { TOP_WARN2("FindRoutingTable failed"); return enum_xerror_code_fail; } message.set_src_node_id(routing_table->get_local_node_info()->id()); } if (GossipPacketCheck(message)) { return SendGossip(message); } if (MulticastPacketCheck(message)) { return SendMulticast(message); } TOP_NETWORK_DEBUG_FOR_PROTOMESSAGE("SendPacket base xid", message); return SendGeneral(message); } int32_t WrouterXidHandler::SendToLocal(transport::protobuf::RoutingMessage& message) { std::string data; if (!message.SerializeToString(&data)) { TOP_WARN2("wrouter message SerializeToString failed"); return enum_xerror_code_fail; } uint8_t local_buf[kUdpPacketBufferSize]; base::xpacket_t packet(base::xcontext_t::instance(), local_buf, sizeof(local_buf), 0, false); Xip2Header header; memset(&header, 0, sizeof(header)); packet.get_body().push_back((uint8_t*)&header, enum_xip2_header_len); packet.get_body().push_back((uint8_t*)data.data(), data.size()); return transport_ptr_->SendToLocal(packet); } int32_t WrouterXidHandler::SendDirect( transport::protobuf::RoutingMessage& message, const std::string& ip, uint16_t port) { std::string data; if (!message.SerializeToString(&data)) { TOP_WARN2("wrouter message SerializeToString failed"); return enum_xerror_code_fail; } uint8_t local_buf[kUdpPacketBufferSize]; base::xpacket_t packet(base::xcontext_t::instance(), local_buf, sizeof(local_buf), 0, false); Xip2Header header; memset(&header, 0, sizeof(header)); packet.get_body().push_back((uint8_t*)&header, enum_xip2_header_len); packet.get_body().push_back((uint8_t*)data.data(), data.size()); packet.set_to_ip_addr(ip); packet.set_to_ip_port(port); return transport_ptr_->SendData(packet); } int32_t WrouterXidHandler::RecvPacket( transport::protobuf::RoutingMessage& message, base::xpacket_t& packet) { int32_t judgeown_code = JudgeOwnPacket(message, packet); switch (judgeown_code) { case kJudgeOwnError: { TOP_WARN2("RecvBaseXid failed"); return kRecvError; } case kJudgeOwnYes: { return kRecvOwn; } case kJudgeOwnNoAndContinue: { SendPacket(message); return kRecvOk; } case kJudgeOwnYesAndContinue: { SendPacket(message); return kRecvOwn; } default: break; } return kRecvOk; } uint64_t WrouterXidHandler::ParserServiceType(const std::string& kad_key) { auto kad_key_ptr = base::GetKadmliaKey(kad_key); return kad_key_ptr->GetServiceType(); } bool WrouterXidHandler::BroadcastByMultiRandomKadKey( const transport::protobuf::RoutingMessage& message, kadmlia::ResponseFunctor call_back, int64_t recursive_count) { auto main_call_back = [this,recursive_count,call_back](int status,transport::protobuf::RoutingMessage& message,base::xpacket_t& packet) { if(kKadTimeout == status) { if(0 == recursive_count) { return; } int64_t next_recursive_count = recursive_count - 1; BroadcastByMultiRandomKadKey(message,call_back,next_recursive_count); return; } call_back(status,message,packet); }; uint32_t channel_size = kMaxChannelSize; uint32_t message_id = CallbackManager::MessageId(); CallbackManager::Instance()->Add(message_id, kEnoughSuccessAckTimeout, main_call_back, 1); while(channel_size--) { auto des_service_type = ParserServiceType(message.des_node_id()); auto kad_key = std::make_shared<base::PlatformKadmliaKey>(des_service_type); transport::protobuf::RoutingMessage mutil_channel_message; mutil_channel_message.set_id(message_id); mutil_channel_message.set_des_node_id(kad_key->Get()); std::string data; if (!message.SerializeToString(&data)) { TOP_WARN2("wrouter message SerializeToString failed"); continue; } mutil_channel_message.set_is_root(message.is_root()); mutil_channel_message.set_broadcast(true); mutil_channel_message.set_data(data); mutil_channel_message.set_xid(global_xid->Get()); mutil_channel_message.set_type(kKadBroadcastFromMultiChannelRequest); mutil_channel_message.set_enable_ack(true); if(enum_xerror_code_fail == SendPacket(mutil_channel_message)) { TOP_WARN2("SendAfterAchiveMultiChannel failed"); continue; } } return true; } bool WrouterXidHandler::SendToByRandomNeighbors( const transport::protobuf::RoutingMessage& message) { std::string src_node_id = message.src_node_id(); if(src_node_id.empty()) { TOP_WARN2("src node id invalid."); return false; } uint64_t service_type = ParserServiceType(message.des_node_id()); RoutingTablePtr routing_table = nullptr; if (message.has_is_root() && message.is_root()) { routing_table = FindRoutingTable(true, static_cast<uint64_t>(kRoot), true, message.des_node_id()); } else { routing_table = FindRoutingTable(false, service_type, true, message.des_node_id()); } if (!routing_table) { TOP_WARN2("FindRoutingTable failed"); return false; } std::string des_xid = message.des_node_id(); std::vector<kadmlia::NodeInfoPtr> nodes = GetClosestNodes( routing_table, des_xid, kP2pRandomNumGeneral, false); std::string data; if (!message.SerializeToString(&data)) { TOP_WARN2("wrouter message SerializeToString failed"); return false; } auto it_find = std::find_if( nodes.begin(), nodes.end(), [des_xid](const kadmlia::NodeInfoPtr& node_info_ptr) { return node_info_ptr->node_id == des_xid; }); if(it_find != nodes.end()) { nodes = { *it_find }; } for(auto& node_ptr : nodes) { if(!node_ptr) { continue; } transport::protobuf::RoutingMessage send_to_message; send_to_message.set_is_root(message.is_root()); send_to_message.set_broadcast(false); send_to_message.set_data(data); send_to_message.set_xid(global_xid->Get()); send_to_message.set_type(kKadSendToFromRandomNeighborsRequest); send_to_message.set_enable_ack(false); send_to_message.set_des_node_id(node_ptr->node_id); if(enum_xerror_code_fail == SendPacket(send_to_message)) { TOP_WARN2("SendToByRandomNeighbors failed"); continue; } } return true; } void WrouterXidHandler::SendLinksAckToPeer( uint64_t src_message_id, const std::string& src_node_id, const std::string& peer_ip, uint16_t peer_port, uint64_t ack_type) { transport::protobuf::RoutingMessage message; message.set_des_node_id(src_node_id); message.set_data(base::xstring_utl::tostring(src_message_id)); message.set_type(ack_type); message.set_id(CallbackManager::MessageId()); message.set_xid(global_xid->Get()); message.set_broadcast(false); std::string msg; if (!message.SerializeToString(&msg)) { TOP_INFO("RoutingMessage SerializeToString failed!"); return ; } xbyte_buffer_t xdata{msg.begin(), msg.end()}; transport_ptr_->SendData(xdata, peer_ip, peer_port); } int32_t WrouterXidHandler::RandomlyCommunicate( transport::protobuf::RoutingMessage& message) { if(support_random_pattern_) { bool ret = true; if(message.has_broadcast() && message.broadcast()) { auto response_functor = [](int,transport::protobuf::RoutingMessage&,base::xpacket_t&) {}; ret = BroadcastByMultiRandomKadKey(message,response_functor); } else { ret = SendToByRandomNeighbors(message); } return (true == ret ? enum_xcode_successful : enum_xerror_code_fail); } return enum_xerror_code_no_resource; } void WrouterXidHandler::SupportRandomPattern() { support_random_pattern_ = true; } int32_t WrouterXidHandler::SendGeneral(transport::protobuf::RoutingMessage& message) { if (message.des_node_id().empty()) { assert(false); } uint64_t service_type = ParserServiceType(message.des_node_id()); RoutingTablePtr routing_table = nullptr; if (message.has_is_root() && message.is_root()) { routing_table = FindRoutingTable(true, static_cast<uint64_t>(kRoot), true, message.des_node_id()); } else { routing_table = FindRoutingTable(false, service_type, true, message.des_node_id()); } if (!routing_table) { TOP_WARN2("FindRoutingTable failed"); return enum_xerror_code_fail; } std::string des_xid = message.des_node_id(); std::vector<kadmlia::NodeInfoPtr> nodes = GetClosestNodes( routing_table, des_xid, 8, // choose 8 nodes then use bloomfilter choose kBroadcastGeneral nodes false); if (nodes.empty()) { TOP_WARN2("GetClosestNodes failed[%d][%d]", routing_table->nodes_size(), routing_table->get_local_node_info()->kadmlia_key()->xnetwork_id()); return enum_xerror_code_fail; } TOP_NETWORK_DEBUG_FOR_PROTOMESSAGE("SendData", message); return SendData(message, nodes, kBroadcastGeneral, false); } int32_t WrouterXidHandler::SendMulticast(transport::protobuf::RoutingMessage& message) { if (message.is_root()) { TOP_WARN2("wsend: send multicast base xid invalid, must not root message"); return enum_xerror_code_fail; } if (message.src_node_id().empty() || message.des_node_id().empty()) { assert(false); } auto gossip = message.mutable_gossip(); if (!gossip->has_msg_hash()) { std::string bin_data = message.data(); if (gossip->has_block()) { bin_data = gossip->block(); } if (!gossip->has_block() && gossip->has_header_hash()) { bin_data = gossip->header_hash(); } uint32_t msg_hash = base::xhash32_t::digest(message.xid() + std::to_string(message.id()) + bin_data); gossip->set_msg_hash(msg_hash); } uint64_t des_service_type = ParserServiceType(message.des_node_id()); RoutingTablePtr routing_table = FindRoutingTable(false, des_service_type, false); if (!routing_table || routing_table->nodes_size() == 0) { // attention: using the right root-routing (not exactlly kRoot) routing_table = FindRoutingTable(true, des_service_type, true, message.des_node_id()); if (!routing_table) { TOP_WARN2("FindRoutingTable failed"); return enum_xerror_code_fail; } // when packet arrive des network, than,multi_flag = default_value,that is kBroadcastGossip std::vector<kadmlia::NodeInfoPtr> nodes = GetClosestNodes( routing_table, message.des_node_id(), 8, false); if (nodes.empty()) { TOP_WARN2("GetClosestNodes failed"); return enum_xerror_code_fail; } #ifdef TOP_TESTING_PERFORMANCE TOP_NETWORK_DEBUG_FOR_PROTOMESSAGE( std::string("SendData with root unicast to other net: ") + std::to_string(message.hop_nodes_size()), message); #endif //return SendData(message, nodes, 3, true); return SendData(message, nodes, 1, true); } #ifdef TOP_TESTING_PERFORMANCE TOP_NETWORK_DEBUG_FOR_PROTOMESSAGE( std::string("SendData with root broadcast to other net: ") + std::to_string(message.hop_nodes_size()), message); #endif return GossipBroadcast( message, routing_table); } int32_t WrouterXidHandler::SendGossip(transport::protobuf::RoutingMessage& message) { if (!message.has_is_root() || !message.is_root()) { TOP_WARN2("SendGossip must be root_msg"); return enum_xerror_code_fail; } auto gossip = message.mutable_gossip(); if (!gossip->has_msg_hash()) { std::string bin_data = message.data(); if (gossip->has_block()) { bin_data = gossip->block(); } if (!gossip->has_block() && gossip->has_header_hash()) { bin_data = gossip->header_hash(); } uint32_t msg_hash = base::xhash32_t::digest(message.xid() + std::to_string(message.id()) + bin_data); gossip->set_msg_hash(msg_hash); } RoutingTablePtr routing_table = FindRoutingTable(true, static_cast<uint64_t>(kRoot), true, message.des_node_id()); if (!routing_table) { TOP_WARN2("FindRoutingTable failed"); return enum_xerror_code_fail; } return GossipBroadcast( message, routing_table); } int32_t WrouterXidHandler::GossipBroadcast( transport::protobuf::RoutingMessage& message, kadmlia::RoutingTablePtr& routing_table) { uint32_t gossip_type = message.gossip().gossip_type(); if (gossip_type == 0) { gossip_type = kGossipBloomfilter; } auto neighbors = routing_table->GetUnLockNodes(); if (!neighbors) { TOP_WARN2("GetUnLockNodes empty"); return enum_xerror_code_fail; } switch (gossip_type) { case kGossipBloomfilter: bloom_gossip_ptr_->Broadcast( routing_table->get_local_node_info()->hash64(), message, neighbors); break; case kGossipLayeredBroadcast: layered_gossip_ptr_->Broadcast( message, routing_table); break; case kGossipBloomfilterAndLayered: /* bloom_layer_gossip_ptr_->Broadcast( routing_table->get_local_node_info()->hash64(), message, neighbors); */ bloom_layer_gossip_ptr_->Broadcast(message, routing_table); break; case kGossipSetFilterAndLayered: set_layer_gossip_ptr_->Broadcast( routing_table->get_local_node_info()->hash64(), message, neighbors); break; default: TOP_WARN2("invalid gossip_type:%d", gossip_type); assert(false); break; } return enum_xcode_successful; } int32_t WrouterXidHandler::SendData( transport::protobuf::RoutingMessage& message, const std::vector<kadmlia::NodeInfoPtr>& neighbors, uint32_t next_size, bool broadcast_stride) { if (neighbors.empty()) { TOP_WARN2("invliad neighbors"); return enum_xerror_code_fail; } std::vector<NodeInfoPtr> rest_neighbors; if (message.broadcast()) { auto gossip_info = message.mutable_gossip(); gossip_info->set_diff_net(broadcast_stride); std::vector<uint64_t> new_bloomfilter_vec; for (auto i = 0; i < message.bloomfilter_size(); ++i) { new_bloomfilter_vec.push_back(message.bloomfilter(i)); } std::shared_ptr<base::Uint64BloomFilter> new_bloomfilter; if (new_bloomfilter_vec.empty()) { new_bloomfilter = std::make_shared<base::Uint64BloomFilter>( gossip::kGossipBloomfilterSize, gossip::kGossipBloomfilterHashNum); auto tmp_routing_table = FindRoutingTable(true, static_cast<uint64_t>(kRoot), true, message.des_node_id()); new_bloomfilter->Add(tmp_routing_table->get_local_node_info()->hash64()); } else { new_bloomfilter = std::make_shared<base::Uint64BloomFilter>( new_bloomfilter_vec, gossip::kGossipBloomfilterHashNum); } for (uint32_t i = 0; i < neighbors.size(); ++i) { NodeInfoPtr node_ptr = neighbors[i]; if ((node_ptr->xid).empty()) { TOP_WARN2("xid empty"); continue; } if (new_bloomfilter->Contain(node_ptr->hash64) && node_ptr->node_id != message.des_node_id()) { #ifdef TOP_TESTING_PERFORMANCE TOP_NETWORK_DEBUG_FOR_PROTOMESSAGE( std::string("already sended to this node: ") + HexEncode(node_ptr->xid) + node_ptr->public_ip + ":" + check_cast<std::string>(node_ptr->public_port) + " : " + std::to_string(neighbors.size()), message); #endif continue; } rest_neighbors.push_back(node_ptr); new_bloomfilter->Add(node_ptr->hash64); if (rest_neighbors.size() >= next_size) { break; } } const std::vector<uint64_t>& bloomfilter_vec = new_bloomfilter->Uint64Vector(); message.clear_bloomfilter(); for (uint32_t i = 0; i < bloomfilter_vec.size(); ++i) { message.add_bloomfilter(bloomfilter_vec[i]); } } base::xpacket_t packet(base::xcontext_t::instance()); _xip2_header xip2_header; memset(&xip2_header, 0, sizeof(xip2_header)); std::string header((const char*)&xip2_header, sizeof(xip2_header)); std::string xbody; if (!message.SerializeToString(&xbody)) { TOP_WARN2("wrouter message SerializeToString failed"); return enum_xerror_code_fail; } std::string xdata = header + xbody; auto each_call = [this, &packet, &message, neighbors, &xdata] (kadmlia::NodeInfoPtr node_info_ptr) { if (!node_info_ptr) { TOP_WARN2("kadmlia::NodeInfoPtr null"); return false; } packet.reset(); packet.get_body().push_back((uint8_t*)xdata.data(), xdata.size()); packet.set_to_ip_addr(node_info_ptr->public_ip); packet.set_to_ip_port(node_info_ptr->public_port); // if (kadmlia::kKadSuccess != transport_ptr_->SendData(packet)) { if (kadmlia::kKadSuccess != transport_ptr_->SendDataWithProp(packet, node_info_ptr->udp_property)) { TOP_WARN2("SendData to endpoint(%s:%d) failed", node_info_ptr->public_ip.c_str(), node_info_ptr->public_port); return false; } #ifdef TOP_TESTING_PERFORMANCE TOP_NETWORK_DEBUG_FOR_PROTOMESSAGE( std::string("send to: ") + node_info_ptr->public_ip + ":" + check_cast<std::string>(node_info_ptr->public_port) + ":" + std::to_string(neighbors.size()), message); #endif return true; }; if (message.broadcast()) { std::for_each(rest_neighbors.begin(), rest_neighbors.end(), each_call); } else { std::for_each(neighbors.begin(), neighbors.begin()+1, each_call); } return enum_xcode_successful; } bool WrouterXidHandler::HandleSystemMessage( transport::protobuf::RoutingMessage& message, kadmlia::RoutingTablePtr& routing_table) { static std::vector<int32_t> direct_vec = { kKadBootstrapJoinRequest, kKadBootstrapJoinResponse, kKadFindNodesRequest, kKadFindNodesResponse, kKadHeartbeatRequest, kKadHeartbeatResponse, kKadHandshake, kKadConnectRequest, kNatDetectRequest, kNatDetectResponse, kNatDetectHandshake2Node, kNatDetectHandshake2Boot, kNatDetectFinish, kUdpNatDetectRequest, kUdpNatDetectResponse, kUdpNatHeartbeat, kKadBroadcastFromMultiChannelRequest, kKadBroadcastFromMultiChannelAck, kKadSendToFromRandomNeighborsRequest, kGossipBlockSyncAsk, kGossipBlockSyncAck, kGossipBlockSyncRequest, kGossipBlockSyncResponse, }; auto it = std::find(direct_vec.begin(), direct_vec.end(), message.type()); if (it != direct_vec.end()) { return true; } /* // special for kconnect msg if (message.type() == kKadConnectRequest || message.type() == kKadConnectResponse) { if ((message.des_node_id()).compare(routing_table->get_local_node_info()->id()) == 0) { return true; } } */ return false; } int32_t WrouterXidHandler::HandleClientMessage( transport::protobuf::RoutingMessage& message, kadmlia::RoutingTablePtr routing_table) { if (!message.has_client_id()) { return kContinueReturn; } if (!routing_table) { return kErrorReturn; } kadmlia::LocalNodeInfoPtr local_node = routing_table->get_local_node_info(); if (!local_node) { return kErrorReturn; } if (!message.relay_flag()) { if (message.client_id() == local_node->id()) { return kContinueReturn; } // this is first relay node return kFirstRelayRetrun; } return kContinueReturn; } int32_t WrouterXidHandler::JudgeOwnPacket( transport::protobuf::RoutingMessage& message, base::xpacket_t& packet) { #ifndef NDEBUG // for test static uint64_t recv_start_time = 0; static std::atomic<uint32_t> recv_count(0); if (message.type() == kTestChainTrade || message.type() == kTestWpingRequest) { if (recv_start_time == 0) { recv_start_time = GetCurrentTimeMsec(); } ++recv_count; if (recv_count % 10000 == 0) { auto use_time_ms = double(GetCurrentTimeMsec() - recv_start_time) / 1000.0; uint32_t qps = (uint32_t)((double)recv_count / use_time_ms); std::cout << "recv " << recv_count << " use time:" << double(GetCurrentTimeMsec() - recv_start_time) << " ms. QPS:" << qps << std::endl; TOP_NETWORK_DEBUG_FOR_REDIS(message, "netqps", qps); } } #endif TOP_NETWORK_DEBUG_FOR_PROTOMESSAGE( std::string("wrouter recv from: ") + packet.get_from_ip_addr() + std::string(":") + std::to_string(packet.get_from_ip_port()) + std::string(" to: ") + packet.get_to_ip_addr() + std::string(":") + std::to_string(packet.get_to_ip_port()), message); // usually only bootstrap message will come here if (message.des_node_id().empty()) { TOP_DEBUG("message type(%d) id(%d) des_node_id empty", message.type(), message.id()); TOP_NETWORK_DEBUG_FOR_PROTOMESSAGE("wrouter kJudgeOwnYes", message); return kJudgeOwnYes; } if(message.has_enable_ack() && message.enable_ack() && kKadBroadcastFromMultiChannelRequest == message.type()) { kadmlia::RoutingTablePtr routing_table = GetRoutingTable(kRoot, true); auto local_node_info = routing_table->get_local_node_info(); std::string local_ip = local_node_info->local_ip(); uint16_t local_port = local_node_info->local_port(); std::string packet_from_ip = packet.get_from_ip_addr(); uint16_t packet_from_port = packet.get_from_ip_port(); if(local_ip != packet_from_ip || local_port != packet_from_port) { SendLinksAckToPeer( message.id(), message.src_node_id(), packet_from_ip, packet_from_port, static_cast<uint64_t>(kKadBroadcastFromMultiChannelAck)); message.set_enable_ack(false); std::string body; if (!message.SerializeToString(&body)) { TOP_WARN2("wrouter message SerializeToString failed"); TOP_NETWORK_DEBUG_FOR_PROTOMESSAGE("wrouter kJudgeOwnError", message); return kJudgeOwnError; } std::string header((const char*)packet.get_body().data(), enum_xip2_header_len); std::string xdata = header + body; packet.reset(); packet.get_body().push_back((uint8_t*)xdata.data(), xdata.size()); } } if(kKadSendToFromRandomNeighborsRequest == message.type()) { uint64_t service_type = ParserServiceType(message.des_node_id()); auto routing_table = FindRoutingTable(message.is_root(), service_type, true, message.des_node_id()); if (!routing_table) { TOP_NETWORK_DEBUG_FOR_PROTOMESSAGE("wrouter kJudgeOwnError", message); return kJudgeOwnError; } auto local_node_info = routing_table->get_local_node_info(); if(local_node_info && message.des_node_id() != local_node_info->id()) { if(!SendToByRandomNeighbors(message)) { TOP_WARN2("SendToByRandomNeighbors failed"); TOP_NETWORK_DEBUG_FOR_PROTOMESSAGE("wrouter kJudgeOwnError", message); return kJudgeOwnError; } } } if (message.has_broadcast() && message.broadcast()) { auto gossip = message.mutable_gossip(); // TODO(smaug) get_from_ip_addr decrease performance gossip->set_pre_ip(packet.get_from_ip_addr()); gossip->set_pre_port(packet.get_from_ip_port()); #ifdef TOP_TESTING_PERFORMANCE static std::atomic<uint32_t> brt_rcv_count(0); static std::atomic<uint32_t> brt_filtered_rcv_count(0); static std::atomic<uint32_t> pre_all(0); static std::atomic<uint32_t> pre_filtered(0); static int64_t b_time = GetCurrentTimeMsec(); if (message.type() == kBroadcastPerformaceTest) { ++brt_rcv_count; } if (message.type() == kBroadcastPerformaceTestReset || (message.type() == kBroadcastPerformaceTest && brt_rcv_count % 50000 == 0)) { auto use_sec_time = (float)(GetCurrentTimeMsec() - b_time) / (float)1000.0; b_time = GetCurrentTimeMsec(); if (use_sec_time > 0.0 && brt_rcv_count > 0) { uint32_t tmp_all = brt_rcv_count - pre_all; uint32_t tmp_filter = brt_filtered_rcv_count - pre_filtered; std::string debug_info = base::StringUtil::str_fmt("brt receive all pkg: %u, qps: %f, filtered: %u, qps: %f", (uint32_t)brt_rcv_count, (float)tmp_all / (float)use_sec_time, (uint32_t)brt_filtered_rcv_count, (float)tmp_filter / (float)use_sec_time); std::cout << debug_info << std::endl; TOP_ERROR(debug_info.c_str()); } pre_all = (uint32_t)brt_rcv_count; pre_filtered = (uint32_t)brt_filtered_rcv_count; if (message.type() == kBroadcastPerformaceTestReset) { brt_rcv_count = 0; brt_filtered_rcv_count = 0; } } #endif if (gossip::GossipFilter::Instance()->FilterMessage(message)) { TOP_NETWORK_DEBUG_FOR_PROTOMESSAGE("wrouter kJudgeOwnNoAndContinue", message); return kJudgeOwnNoAndContinue; } #ifndef NDEBUG if (message.type() == kBroadcastPerformaceTest) { ++brt_filtered_rcv_count; } if (message.type() == kTestChainTrade) { TOP_NETWORK_DEBUG_FOR_REDIS(message, "stability_af"); } static uint64_t af_recv_start_time = 0; static std::atomic<uint32_t> af_recv_count(0); if (message.type() == kTestChainTrade || message.type() == kTestWpingRequest) { if (af_recv_start_time == 0) { af_recv_start_time = GetCurrentTimeMsec(); } ++af_recv_count; if (af_recv_count % 10000 == 0) { auto use_time_ms = double(GetCurrentTimeMsec() - af_recv_start_time) / 1000.0; uint32_t qps = (uint32_t)((double)af_recv_count / use_time_ms); std::cout << "$$$$$$$$$after filter recv " << af_recv_count << " use time:" << double(GetCurrentTimeMsec() - af_recv_start_time) << " ms. QPS:" << qps << std::endl; } } #endif if (message.is_root()) { TOP_NETWORK_DEBUG_FOR_PROTOMESSAGE("wrouter kJudgeOwnYesAndContinue", message); return kJudgeOwnYesAndContinue; } if (message.src_node_id().empty() || message.des_node_id().empty()) { assert(false); } uint64_t src_service_type = ParserServiceType(message.src_node_id()); uint64_t des_service_type = ParserServiceType(message.des_node_id()); if (src_service_type == des_service_type) { TOP_NETWORK_DEBUG_FOR_PROTOMESSAGE("wrouter kJudgeOwnYesAndContinue", message); return kJudgeOwnYesAndContinue; } RoutingTablePtr routing_table = FindRoutingTable(false, des_service_type, false); if (routing_table) { TOP_NETWORK_DEBUG_FOR_PROTOMESSAGE("wrouter kJudgeOwnYesAndContinue", message); return kJudgeOwnYesAndContinue; } TOP_NETWORK_DEBUG_FOR_PROTOMESSAGE("wrouter kJudgeOwnNoAndContinue", message); return kJudgeOwnNoAndContinue; } if (message.has_is_root() && message.is_root()) { TOP_NETWORK_DEBUG_FOR_PROTOMESSAGE("wrouter kJudgeOwnYes", message); return kJudgeOwnYes; } uint64_t service_type = ParserServiceType(message.des_node_id()); RoutingTablePtr routing_table = FindRoutingTable(false, service_type, false); if (!routing_table) { TOP_WARN2("FindRoutingTable failed, judge own packet: type(%d) failed", message.type()); TOP_NETWORK_DEBUG_FOR_PROTOMESSAGE("wrouter kJudgeOwnNoAndContinue", message); return kJudgeOwnNoAndContinue; } if (HandleSystemMessage(message, routing_table)) { TOP_NETWORK_DEBUG_FOR_PROTOMESSAGE("wrouter kJudgeOwnYes", message); return kJudgeOwnYes; } int32_t client_ret = HandleClientMessage(message, routing_table); if (client_ret == kErrorReturn) { TOP_WARN2("HandleClientMessageBaseXid failed"); TOP_NETWORK_DEBUG_FOR_PROTOMESSAGE("wrouter kJudgeOwnError", message); return kJudgeOwnError; } if (client_ret == kFirstRelayRetrun) { TOP_NETWORK_DEBUG_FOR_PROTOMESSAGE("wrouter kJudgeOwnYes", message); return kJudgeOwnYes; } std::string match_kad_xid = routing_table->get_local_node_info()->id(); if (message.des_node_id().compare(match_kad_xid) == 0) { TOP_NETWORK_DEBUG_FOR_PROTOMESSAGE("wrouter kJudgeOwnYes", message); return kJudgeOwnYes; } bool closest = false; if (routing_table->ClosestToTarget(message.des_node_id(), closest) != kadmlia::kKadSuccess) { TOP_WARN2("ClosestToTarget goes wrong"); TOP_NETWORK_DEBUG_FOR_PROTOMESSAGE("wrouter kJudgeOwnError", message); return kJudgeOwnError; } if (closest) { TOP_NETWORK_DEBUG_FOR_PROTOMESSAGE("wrouter kJudgeOwnYes", message); return kJudgeOwnYes; } TOP_NETWORK_DEBUG_FOR_PROTOMESSAGE("wrouter kJudgeOwnNoAndContinue", message); return kJudgeOwnNoAndContinue; } bool WrouterXidHandler::MulticastPacketCheck(transport::protobuf::RoutingMessage& message) { if (!message.has_broadcast() || !message.broadcast()) { return false; } if (message.has_is_root() && message.is_root()) { return false; } // broadcast to same network or different network return true; } bool WrouterXidHandler::GossipPacketCheck(transport::protobuf::RoutingMessage& message) { if (!message.has_broadcast() || !message.broadcast()) { return false; } if (!message.has_is_root() || !message.is_root()) { return false; } // broadcast to root network(all nodes) return true; } } // namespace wrouter } // namespace top
37.708602
144
0.645214
telosprotocol
0d62ee389e81f5fd426b9d852f144701b4e73d4f
312
hpp
C++
exercicios/lista_1/exercicio_1/stack.hpp
M3nin0/estrutura-de-dados-espaciais
b3864bfd358f1a6c78001f92565bb02dd26e566c
[ "BSD-2-Clause" ]
null
null
null
exercicios/lista_1/exercicio_1/stack.hpp
M3nin0/estrutura-de-dados-espaciais
b3864bfd358f1a6c78001f92565bb02dd26e566c
[ "BSD-2-Clause" ]
null
null
null
exercicios/lista_1/exercicio_1/stack.hpp
M3nin0/estrutura-de-dados-espaciais
b3864bfd358f1a6c78001f92565bb02dd26e566c
[ "BSD-2-Clause" ]
null
null
null
#ifndef _STACK_HEADER #define _STACK_HEADER #include <cstddef> class Stack { public: Stack(); Stack(std::size_t size); ~Stack(); int top(); void pop(); bool empty(); void push(int v); private: int *p_elements; std::size_t p_idx = 0; std::size_t p_size = 10; }; #endif
13
28
0.599359
M3nin0
0d638a65e38bcdbcae82f465615f70ed64c5b2ed
356
cpp
C++
QtOpenCV/main.cpp
ayaromenok/utils
d3bfd1f8b842def00d32834100ac893f2ae4638b
[ "MIT" ]
null
null
null
QtOpenCV/main.cpp
ayaromenok/utils
d3bfd1f8b842def00d32834100ac893f2ae4638b
[ "MIT" ]
7
2018-04-04T11:46:21.000Z
2020-06-12T14:44:31.000Z
QtOpenCV/main.cpp
ayaromenok/utils
d3bfd1f8b842def00d32834100ac893f2ae4638b
[ "MIT" ]
null
null
null
#include <QApplication> #include <QDebug> #include "cvwidget.h" int main(int argc, char *argv[]) { QApplication a(argc, argv); qDebug() << "++++++++++++++++++++++++++++++++++++++++++"; qDebug() << "|\tQt OpenCV stub app \t|"; qDebug() << "------------------------------------------"; CvWidget w; w.show(); return a.exec(); }
22.25
61
0.424157
ayaromenok
0d696df9b3a15ee705e6ef3f9a4082dc99a64dd0
5,721
cpp
C++
src/dlg_progress.cpp
jheddings/ml_org
3e1d58c49ea17db84628d97539c4a2aafc00343b
[ "MIT" ]
1
2016-10-09T01:34:57.000Z
2016-10-09T01:34:57.000Z
src/dlg_progress.cpp
jheddings/ml_org
3e1d58c49ea17db84628d97539c4a2aafc00343b
[ "MIT" ]
null
null
null
src/dlg_progress.cpp
jheddings/ml_org
3e1d58c49ea17db84628d97539c4a2aafc00343b
[ "MIT" ]
null
null
null
/* Written by Jason Heddings - http://www.heddway.com/ ** ** This software is provided 'as-is', without any express or implied warranty. ** In no event will the authors be held liable for any damages arising from ** the use of this software. ** ** This code is modified from the ml_ipod plugin: http://mlipod.sf.net/ ** ** License: http://creativecommons.org/licenses/by-nc-sa/2.0/ ** Copyright (c) 2005, Heddway */ #include "ml_org.h" /////////////////////////////////////////////////////////////////////////////// enum { kMLOrgStatusStart = 0, kMLOrgStatusOrganizing, kMLOrgStatusRemoveEmptyDirs, kMLOrgStatusCancelled, kMLOrgStatusComplete, kMLOrgStatusERROR, kProgDlgTimer = 0x6a6168 }; /////////////////////////////////////////////////////////////////////////////// itemRecordList* m_records; int m_orgStatus; int m_recordIdx; bool m_cancel; /////////////////////////////////////////////////////////////////////////////// INT_PTR CALLBACK organize_dlgproc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) { itemRecord* record; switch (uMsg) { case WM_INITDIALOG: logger.Info("organize_dlgproc()", "WM_INITDIALOG"); m_orgStatus = kMLOrgStatusStart; SetTimer(hwndDlg, kProgDlgTimer, 25, NULL); break; case WM_COMMAND: logger.Message("organize_dlgproc()", "WM_COMMAND"); switch (LOWORD(wParam)) { case IDCANCEL: logger.Info("organize_dlgproc()", "CANCELLED BY USER"); m_cancel = true; break; } break; case WM_TIMER: if (wParam == kProgDlgTimer) { switch (m_orgStatus) { case kMLOrgStatusStart: logger.Debug("organize_dlgproc()", "WM_TIMER: kMLOrgStatusStart"); m_cancel = false; m_recordIdx = 0; SetDlgItemText(hwndDlg, IDC_STATUS, "Loading records..."); m_records = ml_org.GetItemRecordList(); SendDlgItemMessage(hwndDlg, IDC_PROGBAR, PBM_SETRANGE, 0, MAKELPARAM(0, m_records->Size)); sprintf(tmp, "organizing %d records", m_records->Size); logger.Info("organize_dlgproc()", tmp); m_orgStatus = kMLOrgStatusOrganizing; break; case kMLOrgStatusOrganizing: logger.Debug("organize_dlgproc()", "WM_TIMER: kMLOrgStatusOrganizing"); if (m_recordIdx == m_records->Size) { if (mlOrgConfig.m_removeEmptyDirs) { m_orgStatus = kMLOrgStatusRemoveEmptyDirs; } else { m_orgStatus = kMLOrgStatusComplete; } } else { record = &(m_records->Items[m_recordIdx]); sprintf(tmp, "%d / %d records", m_recordIdx, m_records->Size); SetDlgItemText(hwndDlg, IDC_STATUS, tmp); SetDlgItemText(hwndDlg, IDC_TITLE, record->title); if (ml_org.Organize(record) == MLOrgConfig::kOrganizeERROR) { m_orgStatus = kMLOrgStatusERROR; } else if (m_cancel) { m_orgStatus = kMLOrgStatusCancelled; } else { m_recordIdx++; } SendDlgItemMessage(hwndDlg, IDC_PROGBAR, PBM_SETPOS, m_recordIdx, 0); } break; case kMLOrgStatusRemoveEmptyDirs: logger.Debug("organize_dlgproc()", "WM_TIMER: kMLOrgStatusRemoveEmptyDirs"); SetDlgItemText(hwndDlg, IDC_STATUS, "Removing empty directories..."); ml_org.RemoveEmptyDirectories(); m_orgStatus = kMLOrgStatusComplete; break; case kMLOrgStatusCancelled: logger.Debug("organize_dlgproc()", "WM_TIMER: kMLOrgStatusCancelled"); KillTimer(hwndDlg, kProgDlgTimer); EndDialog(hwndDlg, IDCANCEL); MessageBox(hwndDlg, "Operation cancelled by user", "Organizing Files", MB_OK | MB_ICONEXCLAMATION); freeRecordList(m_records); break; case kMLOrgStatusERROR: logger.Debug("organize_dlgproc()", "WM_TIMER: kMLOrgStatusERROR"); KillTimer(hwndDlg, kProgDlgTimer); EndDialog(hwndDlg, IDCANCEL); record = &(m_records->Items[m_recordIdx]); sprintf(tmp, "There was an error while processing the following file:\n%s\n\nERROR: %s", record->filename, error); MessageBox(hwndDlg, tmp, "Organizing Files", MB_OK | MB_ICONERROR); freeRecordList(m_records); break; case kMLOrgStatusComplete: logger.Debug("organize_dlgproc()", "WM_TIMER: kMLOrgStatusComplete"); KillTimer(hwndDlg, kProgDlgTimer); EndDialog(hwndDlg, IDOK); sprintf(tmp, "Operation completed succesfully.\n\n%d files processed", m_records->Size); MessageBox(hwndDlg, tmp, "Organizing Files", MB_OK | MB_ICONINFORMATION); freeRecordList(m_records); break; default: logger.Error("organize_dlgproc()", "WM_TIMER: <UNKNOWN STATUS>"); break; } } break; default: sprintf(tmp, "<UNHANDLED MESSAGE> 0x%x", uMsg); logger.Debug("organize_dlgproc()", tmp); break; } return 0; }
38.14
113
0.53627
jheddings
0d69d6f6c5a0a3325f38a4b5e43ef89e3e256170
1,293
cpp
C++
pillar2c/src/summarize.cpp
IntelLabs/IFLC-LIB
4317e191081cd48ad373ea41874d90830594ca4b
[ "Apache-2.0", "BSD-2-Clause" ]
21
2017-04-12T21:31:52.000Z
2017-10-14T16:11:19.000Z
pillar2c/src/summarize.cpp
csabahruska/flrc-lib
c2bccdbeecf6a0128988ac93e80f599ff2bfd5a8
[ "Apache-2.0", "BSD-2-Clause" ]
2
2017-04-16T21:21:38.000Z
2020-02-03T15:31:24.000Z
pillar2c/src/summarize.cpp
csabahruska/flrc-lib
c2bccdbeecf6a0128988ac93e80f599ff2bfd5a8
[ "Apache-2.0", "BSD-2-Clause" ]
6
2017-04-13T13:26:12.000Z
2019-11-09T19:44:28.000Z
#include <iostream> #include <fstream> #include <map> #include <string> using namespace std; int main(int argc, char *argv[]) { if(argc != 2) { cout << "Bad command line.\n"; return -1; } ifstream inputfile(argv[1]); if(!inputfile) { cout << "Could not open file " << argv[1] << endl; return -1; } map<string,unsigned> func_map; unsigned total = 0; while(inputfile) { string func_name; inputfile >> func_name; if(inputfile.eof()) break; ++total; pair<map<string,unsigned>::iterator, bool> res = func_map.insert(pair<string,unsigned>(func_name,1)); if(!res.second) { res.first->second++; } } multimap<unsigned,string> order; map<string,unsigned>::iterator iter; for(iter = func_map.begin(); iter != func_map.end(); ++iter) { order.insert(pair<unsigned,string>(iter->second,iter->first)); } cout << "Total " << total << " 1.0" << endl; multimap<unsigned,string>::reverse_iterator reviter; for(reviter = order.rbegin(); reviter != order.rend(); ++reviter) { cout << reviter->second << " " << reviter->first << " " << (float)reviter->first / total << endl; } return 0; }
24.865385
109
0.556845
IntelLabs
0d6eecec20affe9494c0a8fdcc96b95db8d1a440
30,077
inl
C++
Lumos/External/imgui/plugins/ImGuiAl/fonts/ProggyCleanSZ.inl
perefm/Lumos
2f0ae4d0bad1447b5318043500751be1753666a2
[ "MIT" ]
672
2019-01-29T18:14:40.000Z
2022-03-31T20:38:40.000Z
Lumos/External/imgui/plugins/ImGuiAl/fonts/ProggyCleanSZ.inl
gameconstructer/Lumos
92f6e812fdfc9404bf557e131679ae9071f25c80
[ "MIT" ]
25
2019-10-05T17:16:13.000Z
2021-12-29T01:40:04.000Z
Lumos/External/imgui/plugins/ImGuiAl/fonts/ProggyCleanSZ.inl
gameconstructer/Lumos
92f6e812fdfc9404bf557e131679ae9071f25c80
[ "MIT" ]
83
2019-03-13T14:11:12.000Z
2022-03-30T02:52:49.000Z
// File: 'ProggyCleanSZ.ttf' (41228 bytes) // Exported using binary_to_compressed_c.cpp static const unsigned int ProggyCleanSZ_compressed_size = 9614; static const unsigned int ProggyCleanSZ_compressed_data[9616/4] = { 0x0000bc57, 0x00000000, 0x0ca10000, 0x00000400, 0x00010037, 0x000c0000, 0x00030080, 0x2f534f40, 0x74eb8832, 0x01000090, 0x2c158248, 0x616d634e, 0x23120270, 0x03000075, 0x241382a0, 0x74766352, 0x82178220, 0xfc042102, 0x02380482, 0x66796c67, 0x556ff4f2, 0x04070000, 0x90920000, 0x64616568, 0xd16791d7, 0xcc201b82, 0x36210382, 0x27108268, 0xc3014208, 0x04010000, 0x243b0f82, 0x78746d68, 0x807e008a, 0x98010000, 0x06020000, 0x61636f6c, 0x18b4b38f, 0x82050000, 0x0402291e, 0x7078616d, 0xda00ae01, 0x28201f82, 0x202c1082, 0x656d616e, 0x1f61d7d3, 0x94990000, 0xa42c1382, 0x74736f70, 0xef83aca6, 0x389b0000, 0xd22c3382, 0x70657270, 0x12010269, 0xf4040000, 0x08202f82, 0x012ecb84, 0x50180000, 0x0f5f0fca, 0x0300f53c, 0x00830008, 0x7767b723, 0x29078384, 0xd0a792bd, 0x80fe0000, 0x6f838003, 0x00080024, 0x00850002, 0x0000012a, 0x40fec004, 0x80030000, 0x05821083, 0x07830120, 0x0221038a, 0x25118200, 0x90000101, 0x15842400, 0x3d820220, 0x0a004022, 0x76200b82, 0x06820982, 0x3b820020, 0x83900121, 0xbc0223c8, 0x10828a02, 0x07858f20, 0x00c50123, 0x22668532, 0x94000904, 0x6c412b00, 0x40007374, 0xac200000, 0x00830008, 0x01000523, 0x834d8380, 0x80032103, 0x012101bf, 0x23b88280, 0x00800000, 0x0b830382, 0x07820120, 0x83800021, 0x88012001, 0x84002009, 0x2005870f, 0x870d8301, 0x2023901b, 0x83199501, 0x82002015, 0x84802000, 0x84238267, 0x88002027, 0x8561882d, 0x21058211, 0x13880000, 0x01800022, 0x05850d85, 0x0f828020, 0x03208384, 0x03200582, 0x47901b84, 0x1b850020, 0x1f821d82, 0x3f831d88, 0x3f410383, 0x84058405, 0x210982cd, 0x09830000, 0x03207789, 0xf38a1384, 0x01203782, 0x13872384, 0x0b88c983, 0x0d898f84, 0x00202982, 0x23900383, 0x87008021, 0x83df8301, 0x86118d03, 0x863f880d, 0x8f35880f, 0x2160820f, 0x04830300, 0x1c220382, 0x05820100, 0x4c000022, 0x09831182, 0x04001c24, 0x11823000, 0x0800082e, 0x00000200, 0xff007f00, 0xffffac20, 0x00220982, 0x09848100, 0xdf216682, 0x843586d5, 0x06012116, 0x04400684, 0xa58120d7, 0x00b127d8, 0x01b88d01, 0x2d8685ff, 0xc100c621, 0xf4be0801, 0x9e011c01, 0x88021402, 0x1403fc02, 0x9c035803, 0x1404de03, 0x50043204, 0xa2046204, 0x6e051e05, 0x1a06c405, 0xde067c06, 0x86074007, 0x5608f407, 0x9e087408, 0x1809d808, 0x90095209, 0x880a1e0a, 0x5e0b0c0b, 0x360cd00b, 0xf20c8a0c, 0xac0d660d, 0x580ef20d, 0x300f9e0e, 0x1a10b80f, 0xe8107c10, 0xbe115a11, 0x76120c12, 0x5413cc12, 0xfe13b413, 0xb6146014, 0x4815f214, 0xae158815, 0x1a16c015, 0xce168616, 0x96173c17, 0x5e18e817, 0xf618c218, 0x9e193e19, 0x501adc19, 0xf81aa41a, 0xd01b641b, 0x541c0c1c, 0xf21c9e1c, 0x9a1d321d, 0x481eda1d, 0xe81e961e, 0x7e1f2c1f, 0xae1fae1f, 0x01821820, 0x92203634, 0xd020ba20, 0x7c211c21, 0xf621a021, 0x8e226a22, 0x01821423, 0x83238821, 0x23a03601, 0x24e023b8, 0x24522408, 0x24982470, 0x250e25b6, 0x268a2568, 0x22018200, 0x82b22660, 0xe0be0801, 0xa2274827, 0x70281228, 0x1629b028, 0xc0292829, 0x3e2a002a, 0x682a682a, 0x322b0a2b, 0xb42b662b, 0x282cee2b, 0xa22c3c2c, 0x642d302d, 0xb22d802d, 0x2e2ef02d, 0x2e2fae2e, 0xfc2fbe2f, 0xd0306630, 0xbc314631, 0xa6322632, 0x8a332633, 0x6434f633, 0x4235d634, 0xdc358e35, 0x7a362e36, 0x7e37ee36, 0x4238e037, 0x1a39ae38, 0xb6397c39, 0xa23a363a, 0x843b0e3b, 0x423cf03b, 0x2a3d9e3c, 0xf43d8e3d, 0xce3e5e3e, 0xa23f323f, 0x72401a40, 0x3e41d840, 0x1042aa41, 0x82424842, 0xf842c042, 0xd4436a43, 0x92443244, 0x6045f644, 0xea45be45, 0xbc465c46, 0x82471c47, 0x5c48e247, 0x4849ce48, 0x15462400, 0x034d0808, 0x0b000700, 0x13000f00, 0x1b001700, 0x23001f00, 0x2b002700, 0x33002f00, 0x3b003700, 0x43003f00, 0x4b004700, 0x53004f00, 0x5b005700, 0x63005f00, 0x6b006700, 0x73006f00, 0x7b007700, 0x83007f00, 0x8b008700, 0x00008f00, 0x15333511, 0x20039631, 0x20178205, 0xd3038221, 0x20739707, 0x25008580, 0x028080fc, 0x05be8080, 0x04204a85, 0x05ce0685, 0x0107002a, 0x02000080, 0x00000400, 0x250d8b41, 0x33350100, 0x03920715, 0x13820320, 0x858d0120, 0x0e8d0320, 0xff260d83, 0x00808000, 0x54820106, 0x04800223, 0x845b8c80, 0x41332059, 0x078b068f, 0x82000121, 0x82fe2039, 0x84802003, 0x83042004, 0x23598a0e, 0x00180000, 0x03210082, 0x42ab9080, 0x73942137, 0x2013bb41, 0x8f978205, 0x2027a39b, 0x20b68801, 0x84b286fd, 0x91c88407, 0x41032011, 0x11a51130, 0x15000027, 0x80ff8000, 0x11af4103, 0x841b0341, 0x8bd983fd, 0x9be99bc9, 0x8343831b, 0x21f1821f, 0xb58300ff, 0x0f84e889, 0xf78a0484, 0x8000ff22, 0x0020eeb3, 0x14200082, 0x2130ef41, 0xeb431300, 0x4133200a, 0xd7410ecb, 0x9a07200b, 0x2027871b, 0x21238221, 0xe7828080, 0xe784fd20, 0xe8848020, 0xfe808022, 0x08880d85, 0xba41fd20, 0x82248205, 0x85eab02a, 0x008022e7, 0x2cd74200, 0x44010021, 0xd34406eb, 0x44312013, 0xcf8b0eef, 0x0d422f8b, 0x82332007, 0x0001212f, 0x8023cf82, 0x83000180, 0x820583de, 0x830682d4, 0x820020d4, 0x82dc850a, 0x20e282e9, 0xb2ff85fe, 0x010327e9, 0x02000380, 0x0f440400, 0x0c634407, 0x68825982, 0x85048021, 0x260a825d, 0x010b0000, 0x4400ff00, 0x2746103f, 0x08d74209, 0x4d440720, 0x0eaf4406, 0xc3441d20, 0x23078406, 0xff800002, 0x04845b83, 0x8d05b241, 0x1781436f, 0x6b8c87a5, 0x1521878e, 0x06474505, 0x01210783, 0x84688c00, 0x8904828e, 0x441e8cf7, 0x0b270cff, 0x80008000, 0x45030003, 0xfb430fab, 0x080f4107, 0x410bf942, 0xd34307e5, 0x070d4207, 0x80800123, 0x205d85fe, 0x849183fe, 0x20128404, 0x82809702, 0x00002217, 0x41839a09, 0x6b4408cf, 0x0733440f, 0x3b460720, 0x82798707, 0x97802052, 0x0000296f, 0xff800004, 0x01800100, 0x0021ef89, 0x0a914625, 0x410a4d41, 0x00250ed4, 0x00050000, 0x056d4280, 0x210a7b46, 0x21481300, 0x46ed8512, 0x00210bd1, 0x89718202, 0x21738877, 0x2b850001, 0x00220582, 0x87450a00, 0x0ddb4606, 0x41079b42, 0x9d420c09, 0x0b09420b, 0x8d820720, 0x9742fc84, 0x42098909, 0x00241e0f, 0x00800016, 0x0b47da82, 0x0837442e, 0x49079141, 0x13870b17, 0x44173745, 0xe5410f57, 0x4201200b, 0x01270643, 0x80fd8080, 0x84000180, 0x081d4606, 0x01210d85, 0x201b8400, 0x05414580, 0x66420320, 0x221a981a, 0xa40e0000, 0x0cf146f7, 0x4307f942, 0xdb471395, 0x21bf820f, 0x194300ff, 0x20878508, 0xa40685fe, 0x0f0021b0, 0x3b219fa4, 0x14894100, 0x20072942, 0x06cf4405, 0x90072d42, 0x096d41a5, 0xff808023, 0xaa028900, 0x808021a9, 0x9b82abc5, 0x2007fb44, 0x135d4615, 0x410a1942, 0x48460857, 0x2455410a, 0x1121ab82, 0x29234700, 0x4714fd41, 0x5b411729, 0x0773410f, 0x80800222, 0x22080942, 0x428000fe, 0xfd2008bc, 0x84056341, 0x2bd9481c, 0x00000023, 0x261b4212, 0x4405f74c, 0x9d8714ad, 0xc9440720, 0x1c81410d, 0xb787b085, 0x80410d84, 0x22368431, 0x41000080, 0x7f4a0587, 0x0ca54825, 0x4113cb42, 0x91441393, 0x07974107, 0x144c0120, 0x00ff2105, 0xfe228185, 0x63448000, 0x44802006, 0x0022364d, 0x87410c00, 0x147b4120, 0x851bc745, 0x0532429c, 0x420a6748, 0x002120dd, 0x4f8ba013, 0x37440d0b, 0x13774314, 0x45245b41, 0x80200db5, 0x41059945, 0x80204162, 0x00200082, 0x46362b42, 0xdf931399, 0x2f452783, 0x460f830b, 0x21420e85, 0x2392820c, 0xfe8000ff, 0x94410682, 0x097e4620, 0x04000022, 0x49051f4f, 0xdb470a73, 0x48032008, 0x3b48068b, 0x46022008, 0x00220c2f, 0xbf480600, 0x0eaf4905, 0xc5873f90, 0x4285bd84, 0x4900ff21, 0xfe200716, 0x05851085, 0x00000023, 0x4a03820a, 0x71431903, 0x0749410c, 0x8a07a145, 0x02152207, 0x05ec4100, 0x0782fe20, 0x211b8449, 0x6f828080, 0x80000c27, 0x80030001, 0x15eb4802, 0x2f002b23, 0x142f4300, 0x15216f82, 0x0da74401, 0x8508a351, 0x4d8020cf, 0x80200659, 0xe8898e83, 0x224bff20, 0x25f3830c, 0x03800080, 0xf74a0380, 0x207b8715, 0x876b861d, 0x48152007, 0x0787079f, 0xf2836086, 0x774a0383, 0x21f28417, 0x97430a00, 0x1485431c, 0x830b8d42, 0x4d03200b, 0x80200657, 0x21055043, 0xd7828080, 0x8242da86, 0x221f8318, 0x82001a00, 0x2c0f4e00, 0x940b1f53, 0x0741439b, 0xf74e3120, 0x0b174f12, 0x200bfb49, 0x0abb4121, 0x57413f82, 0x08994508, 0x240a3d44, 0x00018000, 0x20008280, 0x066441fc, 0x088b8020, 0x82000121, 0x48fd2015, 0x014a2c9b, 0x08434715, 0x43270352, 0x0b54140f, 0x0b01480f, 0x20173545, 0x053e4401, 0x80fe8022, 0x830a234f, 0x828020d6, 0x000225d7, 0x8000fd80, 0xdc410588, 0x82d49318, 0x180021d2, 0x552adb48, 0x77430d0f, 0x48bf9310, 0x034113e1, 0x0f75470f, 0xb2843387, 0x4b0e1046, 0xf58e06d6, 0x8400fd21, 0x44fcac2b, 0xdb4b0edb, 0x1fdb4105, 0x4b18df42, 0x1d210adf, 0x0a035101, 0x8308af42, 0x85cb866e, 0x201082ac, 0x2b8e4c01, 0x00000023, 0x30ab4114, 0x4124a341, 0x9741178f, 0x0d934113, 0x85118641, 0x43d88211, 0x91410572, 0x31934830, 0x4a13574f, 0x0b5116a9, 0x07ad4108, 0x4a0f9d42, 0xfe200fad, 0x4708aa41, 0x83482dba, 0x288f4d06, 0xb398c3bb, 0x44267b41, 0x2d4939d7, 0x0755410f, 0x200ebb45, 0x0f5f4215, 0x20191343, 0x06ef5301, 0xad4f0220, 0x43ce8239, 0xa78f3727, 0x5213ff42, 0x2f970bd1, 0x4305bb55, 0x8020111b, 0xac450083, 0x38b8450b, 0x21065f42, 0xed82010c, 0xb3440220, 0x10af441b, 0x480f8750, 0x57470737, 0x0c03490c, 0x4b420c84, 0x05d74c20, 0x87938ba9, 0xea838b94, 0xfe210387, 0x23864300, 0x4107fb4b, 0xd74c1b17, 0x0cb55709, 0x480fd141, 0xf541079d, 0x4780201f, 0x81520680, 0x20a98408, 0x47ad82fe, 0x80200ab4, 0x4106ae47, 0xf289204b, 0x2f4e0020, 0x174f4128, 0x200eab4f, 0x48c98315, 0x94a0130a, 0x1b4a8a82, 0x07275d3f, 0x4b071f44, 0x0f8b071b, 0x4a07034a, 0xa5411b17, 0x0fb1410b, 0x20057b43, 0x060d4a01, 0xf1840787, 0x220e154a, 0x82800001, 0x85058211, 0x082a5d08, 0x41200941, 0x1387133e, 0x4f490020, 0x0b774443, 0x33200b87, 0x8b0e5b5a, 0x072b41f7, 0x0b8b1383, 0x410b9f45, 0x012406f7, 0x00fd8080, 0x8209575a, 0x200e83fa, 0x0e6d5980, 0x82068545, 0x832d832c, 0x38144106, 0x48100021, 0x2f4b28b3, 0x13d7410c, 0x41135f4a, 0xa8830b2b, 0x4b05234b, 0x6a451117, 0x05414b06, 0x41234544, 0x4b5009d1, 0x0fcb472e, 0x5b44b59f, 0x07c5430b, 0x440d6549, 0x80210655, 0x82d68280, 0x4afe2019, 0x002030ec, 0x2105e347, 0xd74d80ff, 0x408b4128, 0x9f503320, 0x2793410a, 0xd454db82, 0x05e7512b, 0x4a5e134b, 0xc9410b21, 0x1fad4117, 0x4f000121, 0x96420685, 0x304b4305, 0x4606bb55, 0x472025cf, 0x490ddd57, 0xa7500ea3, 0x520f840f, 0xb78217e1, 0x4b43da82, 0x0bbe4808, 0x20316e4d, 0x20008200, 0x5e03820e, 0x4f63216b, 0x17eb4620, 0x450a6351, 0x6e410aa3, 0x41002024, 0xeb5f2f63, 0x33ab440b, 0x4a09e34e, 0x11951127, 0x41327241, 0xc39f2a6f, 0x230f9762, 0x15333507, 0x5f095e64, 0xfe2010a2, 0x43078763, 0x002125d0, 0x3b5f6300, 0x73601120, 0x131f480e, 0x521f5748, 0x2f43079b, 0x8315200e, 0x48e7864b, 0x0888082a, 0x8020e483, 0x21096d52, 0x108400fd, 0x5f47fd20, 0x42058405, 0x5048247c, 0x2b374713, 0x551b8b42, 0x215b0a87, 0x0b23410c, 0x2007bd4a, 0x05754d02, 0xfe800022, 0x440c7052, 0x1f820800, 0x0021cfa8, 0x20eb430c, 0xb7410020, 0x0b87440f, 0x43076f42, 0x6f420beb, 0x61fe200f, 0x9aa00c52, 0x5034e343, 0xf9570f21, 0x1f2d5d0f, 0x5d0c6f4b, 0x634d0b2d, 0x52b8a009, 0x0f200ca9, 0x681e9762, 0xf94d07bf, 0x0f494524, 0x200c054e, 0x139742fe, 0x04808022, 0x950c2057, 0x60158523, 0x13201fa7, 0x62052348, 0x0f8f0fbd, 0x638f1520, 0x0021819e, 0x34234100, 0x930f0b41, 0x1075600f, 0x80229a8f, 0xd863fe80, 0x085e4a25, 0x80000a26, 0x00038001, 0x610ea768, 0x834514cb, 0x0bc3430f, 0x70450120, 0x21808408, 0xa95c00fe, 0x1a2e4109, 0x0000002a, 0xff000007, 0x00800380, 0x210fdf58, 0x3d591500, 0x0cd14216, 0x0025ff8c, 0x03000102, 0x08636580, 0x35010024, 0x03821d33, 0x00011522, 0x20083542, 0x06d74400, 0x6b194764, 0xc142097f, 0x08a7480b, 0x490b8f43, 0x1f8b138f, 0x83000121, 0x84fe209e, 0x80fd2105, 0x85091041, 0x19825911, 0x0021d48d, 0x08935400, 0x5d19835a, 0xd9420e27, 0x08c36a06, 0x7d47b59f, 0x8a2f8b0f, 0x0e0b578d, 0x410e174c, 0xd18c1ae7, 0x51087a42, 0xd36505b3, 0x4a2f201a, 0x6f410d4b, 0x0beb530b, 0x88101543, 0x826a83a7, 0x200f82a5, 0x186a6580, 0x00208e86, 0x6c336741, 0xf7650b27, 0x131d420f, 0x421b6741, 0x2e42060f, 0x113a4211, 0x42316941, 0xb34737f7, 0x0f8b460c, 0x5407e556, 0x01200fa7, 0x200c595f, 0x82008280, 0x808021c2, 0x42268841, 0xef64091e, 0x1df74208, 0x41146946, 0x5145138d, 0x2190820f, 0xc4478080, 0x0a70460a, 0x20256141, 0x23008200, 0xfe800015, 0x6f19935e, 0xb18c15cf, 0x4213f149, 0x7d41133b, 0x42c9870b, 0x802010f9, 0x420b2c42, 0x8f441138, 0x267c4408, 0x500cb743, 0x8f410987, 0x05bb701d, 0x83440020, 0x3521223f, 0x0b794733, 0xfb62fe20, 0x4afd2010, 0xaf410ae7, 0x25ce8525, 0x01080000, 0x8b6b0000, 0x0983710b, 0x82010021, 0x064b5f75, 0x67140170, 0x436b0623, 0x14a9480d, 0x0c226282, 0xc36b8000, 0x06df441c, 0x93566f9b, 0x8302200f, 0x0c964152, 0x2005c142, 0x0fb86704, 0xb057238d, 0x050b5305, 0x4217eb47, 0xbd410bab, 0x0fb94410, 0x871f9956, 0x1e91567e, 0x2029b741, 0x20008200, 0x18b7410a, 0x27002322, 0x43092b46, 0x0f8f0fe7, 0x41000121, 0x889d111c, 0x14207b82, 0x00200382, 0x43188761, 0x475013e7, 0x6e33200c, 0x234e0eb3, 0x9b138313, 0x22b58517, 0x4e8000fd, 0x11971109, 0x202ee743, 0x08636a00, 0x87166f62, 0x38d75de7, 0xcb43c384, 0xa9b3a21d, 0x0b8363a7, 0x42135545, 0x814c0fd7, 0x1673440d, 0x43234f48, 0x00220571, 0x1f461300, 0x3459412e, 0x5e0b1b46, 0x6d410b7b, 0x09cd551f, 0x43227441, 0xd7b10c34, 0x410f0d65, 0xf54e2b8d, 0x07c94307, 0x2005594b, 0x0a0046fd, 0x4915eb46, 0xd38c20f5, 0x00250c83, 0x0080000a, 0x18934a00, 0x64130021, 0xd7500643, 0x0743420b, 0x470c2b50, 0xaa82076a, 0x67859b82, 0x211a6441, 0x779c0d00, 0x48057743, 0x51551337, 0x14a54c0b, 0x49082b41, 0x0a4b0888, 0x8080261f, 0x0d000000, 0x20048201, 0x1deb6a03, 0x420cc372, 0x07201783, 0x4306854d, 0x8b830c59, 0x59094c74, 0x9b44250f, 0x0fd7432c, 0xe94c0f97, 0x0e5d6b0d, 0x41115442, 0xb74a1ac1, 0x2243420a, 0x5b4f8f8f, 0x7507200f, 0x384b087f, 0x09d45409, 0x0020869a, 0x12200082, 0xab460382, 0x10075329, 0x54138346, 0xaf540fbf, 0x1ea75413, 0x9a0c9e54, 0x0f9343c1, 0x93430020, 0x0ba75c23, 0x760b6772, 0xef4b10cf, 0x4cff2009, 0x8d9a09a6, 0x00820020, 0x4134c345, 0x0f970fe1, 0x441fd74b, 0x9b4216e4, 0x43cd8405, 0xc79a094c, 0x840f5541, 0x2947470f, 0x540f555c, 0x234e1787, 0x0a1b6e0f, 0x6b087d54, 0xa8881d73, 0x0e000026, 0x00ff8000, 0x48189b52, 0x0f78088b, 0x0b83450b, 0x70061d4d, 0x1b86081f, 0x2008cb69, 0x0b334b02, 0x4a0cc34b, 0x1f611d0d, 0x010b210c, 0x7352a382, 0x11cf7d08, 0x4a0c2345, 0x0f8f0f89, 0xa5410120, 0x22f25414, 0x41282b41, 0x134106c7, 0x0b3d4818, 0x630b7b4c, 0x0f630c06, 0x41088208, 0x00282a2a, 0x01000008, 0x02800380, 0x48113f4e, 0x97750cf5, 0x07f1530f, 0x31610120, 0x6d802007, 0x8f840e33, 0x8208bf51, 0x0c737d61, 0x7f093379, 0x4f470f5b, 0x17855c0c, 0x46076157, 0xf5500fdf, 0x0f616910, 0x8080fe24, 0x148400ff, 0x2009c245, 0x127a4c03, 0x8315f341, 0x27d28215, 0x00010400, 0x000200ff, 0x851c0778, 0x886c8541, 0x203c824d, 0x243f4310, 0x3f003b22, 0x45093b4d, 0xf18f0b3b, 0x420fad42, 0x4b430b1f, 0x88f28808, 0xfe802188, 0x842a2642, 0x010625f6, 0x0280ff00, 0x250bfb78, 0x00170013, 0xbf6d2500, 0x07db760e, 0x410e3b7f, 0x00230e4f, 0x49030000, 0x0582055b, 0x07000326, 0x00000b00, 0x580bcd46, 0x00200cdd, 0x57078749, 0x8749160f, 0x0f994f0a, 0x41134761, 0x01200b31, 0x8a060a42, 0x437a8506, 0x7b512341, 0x5801202e, 0x057005d9, 0x0fc94108, 0x7a0f1d53, 0x634b0ba3, 0x7aaf8d08, 0x62580bb5, 0x8080222d, 0x23008200, 0x03800005, 0x7b0fcb45, 0x7f430cb3, 0x43012007, 0xfe220636, 0x0a828000, 0x460d1c41, 0x802008af, 0x881efb79, 0x0b174859, 0x6f0bc374, 0x27480feb, 0x00022207, 0x05f07680, 0x43065947, 0x0d7e0854, 0x4203200a, 0x0e940e61, 0x0022aa82, 0xfa820015, 0x05800322, 0x180fdb58, 0x8720af40, 0x0fa7418d, 0x610aa344, 0xff223149, 0x40188000, 0xe25f08b4, 0x10516105, 0x34674318, 0x05000022, 0x8021e782, 0x0d535902, 0x71088141, 0xaf84063d, 0x8405db41, 0x41022085, 0x00200e35, 0x463d835f, 0x152106d7, 0x0a355a33, 0x6917614e, 0x75411f4d, 0x184b8b07, 0x1809d344, 0x21092640, 0x0b828000, 0x42808021, 0x35420519, 0x20138208, 0x422d86fe, 0x07412428, 0x210e840e, 0x3b420000, 0x7bf58751, 0x9f781367, 0x0caf4d13, 0x8000ff22, 0x747bd487, 0x00ff210d, 0x0482b084, 0x27363b42, 0x03800103, 0x04800200, 0x0f174118, 0x46072f42, 0x00250c3b, 0x01030000, 0x47411800, 0x20c38315, 0x06855c01, 0x95880420, 0x83060021, 0x10434a2f, 0x14134518, 0x070b4218, 0xd984ea85, 0xe6854889, 0x06000023, 0x56af8d00, 0x4fa2053b, 0x9383fe20, 0x0d204f91, 0x1a534018, 0x070f4818, 0x500cd37b, 0xd7450b79, 0x0bd9420f, 0x830a4745, 0x777e84bb, 0x7542095a, 0x20138413, 0x3f401800, 0x0007213e, 0x4405e349, 0x0d550ff3, 0x16254c0c, 0x820ffe4a, 0x0400218a, 0x89066f41, 0x106b414f, 0xc84d0120, 0x80802206, 0x0c9a4b03, 0x00100024, 0xef650200, 0x003b2221, 0x4349183f, 0x1343440d, 0x6a0f3344, 0x78860ff3, 0x440a2546, 0x988c0a1b, 0x20187941, 0x079b5e80, 0x18080b43, 0x41191b4a, 0x59530c03, 0x25155212, 0x1146ff20, 0x091d520a, 0x7d000421, 0xae990be5, 0x2008d747, 0x10fb4500, 0xf3511320, 0x088f5205, 0x59350521, 0x708505cb, 0x2110fa45, 0x00820015, 0x03800322, 0x470f3342, 0xf1451c27, 0x07ed450f, 0x5b133d4c, 0xbf4b1363, 0x07f1410b, 0x6d146157, 0xf64505cb, 0x50088208, 0xc78f06c9, 0x431b2a41, 0x437e085b, 0x11034d07, 0x11ff4b18, 0x4f1ce541, 0x01202781, 0x2006a564, 0x178a4ffe, 0x2529ef41, 0x00008080, 0x0082000d, 0xaf450320, 0x13a34209, 0x8976b788, 0x0fff500b, 0x55074143, 0xfd200cd3, 0x0a334c18, 0x5105d467, 0xc46109af, 0x4dff2007, 0x9d821c43, 0x1dd74b18, 0x4c07b97c, 0x7c440fcd, 0x6603200e, 0xd4410683, 0x1200280e, 0x80ff8000, 0x41030003, 0x0b6b23bf, 0x0bc54906, 0x0f894618, 0x180ff753, 0x4517bd46, 0xfd200ecd, 0x18089c4b, 0x210bc746, 0x998200ff, 0x0e9bb08e, 0x00820020, 0x18001021, 0x6d274b45, 0xfd4c0c93, 0xdf451813, 0x0fe5450f, 0x5a47c382, 0x820a8b0a, 0x9b0320a4, 0x0ea34da8, 0x83421420, 0x26834105, 0x4f004b22, 0x4f05df45, 0xd3450fb1, 0x132f4a0f, 0x2387c38f, 0x80028023, 0x0cd05480, 0x830e8c58, 0x821f82b1, 0x42032025, 0xf5911cae, 0x1020db82, 0x0420df85, 0x55210f45, 0xc36810bb, 0x0f454c13, 0x680bed4d, 0x564217d3, 0x419f8307, 0x00212b9a, 0x1c0f530a, 0x43140d53, 0x8d431391, 0x15294f0e, 0x560f0944, 0xcf4205fb, 0x2a9f4305, 0x7f120742, 0xeb5e0c47, 0x18af6e0a, 0x840ff362, 0x1804849a, 0x200a6e44, 0x2c0a4204, 0x02000025, 0x4b040001, 0x5545091b, 0x09494a09, 0x1c000022, 0x18282b42, 0x53174f52, 0x0b410c7b, 0x75152012, 0xab44071f, 0x1317740b, 0x6f43278f, 0x08654717, 0x80800224, 0x3c7f80fc, 0x8401200b, 0x8d128210, 0x096b4318, 0x2f430320, 0x2611ad11, 0x80000b00, 0x50028001, 0x0020193f, 0x0b494118, 0x8f0fb945, 0x0a7952d1, 0x234d5682, 0x58a39b06, 0x2f6405cb, 0x0cf14719, 0x52131b46, 0xf68308f3, 0x09bc4c18, 0x20096e42, 0x180f4102, 0x07000029, 0x00008000, 0x44028002, 0x01420f57, 0x10c95c10, 0x11284c18, 0x80221185, 0x7f421e00, 0x00732240, 0x43431877, 0x0fcb4415, 0x0b834b18, 0x830f8f5a, 0x411f9b0f, 0xff700fb9, 0x09a94509, 0xd384fc20, 0x6f000121, 0x11940951, 0x834a8d42, 0x00002a70, 0x00000700, 0x80038004, 0x10974105, 0x1bd95518, 0x8021ac84, 0x0f764f80, 0x00244e82, 0x02800008, 0x04200182, 0x47110345, 0x91490cc3, 0x1831200f, 0x20160b51, 0x13b64404, 0x0e206783, 0x20053b48, 0x4a679103, 0x4e180bcb, 0x4f470c0f, 0x65072013, 0x3f6b0a73, 0x0d81540c, 0x31488020, 0x48802005, 0x0e4618e3, 0x0a00240b, 0x45028000, 0x9759093b, 0x0bf1420f, 0x470ca54c, 0x82830f2b, 0x0c624c18, 0x84140c41, 0xb3002025, 0x5fef8273, 0x4d8410b5, 0xe043fe20, 0x22719b08, 0x59020000, 0xeb410551, 0x08295006, 0x83000221, 0x203a86b5, 0x23008200, 0xff000011, 0x7c27135e, 0x1d7a1c93, 0x5d451817, 0x05ef4d0b, 0x20174d5f, 0x0a136180, 0xa784fd20, 0x4419b444, 0x077c10cd, 0x78802005, 0x59182a4b, 0xf5590f43, 0x0bef460c, 0x0b135418, 0x470b0742, 0x15200aff, 0x181b9345, 0x210f3956, 0xbd840001, 0x13415518, 0x4b05dd41, 0x13840dc4, 0xf0900320, 0x002a10ab, 0x01090000, 0x02000100, 0x93430280, 0x8bf98c13, 0x10476ae1, 0x02209f89, 0x2613fc43, 0x04000080, 0x83fe8001, 0x09b34465, 0x45870020, 0x08d34918, 0xa449ba84, 0x0800240d, 0x69028000, 0x438b1a7b, 0x220f634c, 0x87800001, 0x2007844c, 0x439a9604, 0x56181f87, 0xcf7b1b3f, 0x1756180c, 0x08e3470f, 0x3f647995, 0x1adf4708, 0xc35a1320, 0x0f3b4216, 0x5906c854, 0xa96c090b, 0x19294306, 0x00000024, 0x6f580016, 0x00572131, 0x46102b59, 0x4b7b0f17, 0x138f4707, 0x8954b787, 0x8243830f, 0x05fc4aab, 0x57590583, 0x84012011, 0x18e88212, 0x5908235a, 0xf04205f1, 0x0def532b, 0x1b4bffde, 0x0f374e17, 0xff9b2787, 0xfe808022, 0x1a41ed84, 0x20058505, 0x201182fe, 0x37495700, 0x00808022, 0x071f4118, 0x47480520, 0x1b47530f, 0x095b5e18, 0x630c6556, 0xdd450f4f, 0x0b81560b, 0x0f5f5918, 0x55180f83, 0x17420b4b, 0x20e78217, 0x724f1801, 0x20f48209, 0x820383fe, 0x80802415, 0x428000ff, 0x99654d1a, 0xd74c1808, 0x078b4e22, 0x2007f55f, 0x4b491807, 0xd14c1817, 0x45491809, 0x0dec440b, 0x20099d42, 0x07df7b80, 0x74269b41, 0x376c09bb, 0x1ba5600e, 0x830fb743, 0xbb4b180f, 0x6004202b, 0x8e431447, 0xb2002018, 0x831520d3, 0xbe0320bf, 0x08036fd3, 0x23904c18, 0x1420d4af, 0x4b304345, 0x5f461053, 0x130f431b, 0x180f3f44, 0x82094742, 0x754d18e0, 0x0a044c24, 0x41188142, 0x48180ec7, 0x93420aa7, 0x004b2226, 0x052b464f, 0x0cb76018, 0x733ecb41, 0xd0410d83, 0x0820472a, 0x0e93d78e, 0x1220eb83, 0x2005d741, 0x13174904, 0x11776318, 0xb9560020, 0x40cb4107, 0xa4083348, 0x070045db, 0x1390c593, 0x593bef47, 0x52181311, 0x4b440b33, 0x2eb7420f, 0xd990f5ad, 0x002210a4, 0x7b501700, 0x0c074b36, 0x490bad46, 0x48180b85, 0xfd470f25, 0x554c181f, 0x5780200c, 0x00200aa0, 0x0a125c18, 0x200e2556, 0x2c5e5501, 0x820d1541, 0x001123fb, 0x4518fe80, 0xf38c2753, 0x6d134979, 0x295107a7, 0xbf5f180f, 0x0fe3660c, 0x180b6079, 0x2007cd5f, 0x9ea78d03, 0x0987440d, 0x48050021, 0x1f4729b7, 0x0f9f4210, 0x13614f18, 0x17954f18, 0x830af750, 0x88fd20ac, 0x00fe21b1, 0x46460a88, 0x2437832e, 0x00140000, 0xaed28380, 0x831520d7, 0x0fd35da7, 0xa30fa165, 0x472383ef, 0x245a052b, 0x62d9c906, 0xb341079f, 0x4c53202b, 0x33200969, 0x4116f151, 0x179717a1, 0x195be183, 0x0f5e7013, 0x47081f47, 0xbf41271d, 0x4604200c, 0x1f472533, 0x47bf410c, 0xdb600120, 0x55601808, 0x209b8208, 0x591583fe, 0xd7ad0b13, 0x00010d25, 0x54020000, 0x274c116f, 0x1461430b, 0x4f0f1d6c, 0x681810a1, 0x8f8a07c4, 0x3e430a84, 0x05737224, 0x214397a2, 0x43979f10, 0x65180505, 0x99aa0f02, 0x0e000022, 0x20223341, 0x19e14237, 0xc542a19f, 0x0ed74808, 0x8020a38b, 0x4508fe50, 0x3f411553, 0x1caf4207, 0x6a0c9b5f, 0x13521bb3, 0x10d84115, 0x2022b148, 0x07df6100, 0x20294743, 0x11115853, 0x550f254b, 0xb1480fa9, 0x0fc7460f, 0x08374218, 0x784ffe20, 0x57022007, 0x012007e9, 0x0ac35818, 0x093a5618, 0x41145d52, 0x15851579, 0x4a190021, 0x05200563, 0x1829c746, 0x5909bb5a, 0x414410f9, 0x13695b07, 0x0b8d4f18, 0x0f754f18, 0x1b814f18, 0x20096d4b, 0x854f18fe, 0x32664c33, 0x600ca051, 0x7744056b, 0x0037221d, 0x068f6e3b, 0x8b7d1d20, 0x13fd410b, 0x4e1bf141, 0x4f180df7, 0x8025128f, 0x80000180, 0x096d51fe, 0x61234145, 0xc3a7092f, 0x9b20ef4e, 0x0ee74ec3, 0x0b4dc4c9, 0x26a74206, 0x9b2cdf4e, 0x13d74ecf, 0x1145d4a2, 0x1881430e, 0x4e348f50, 0xd79f27cb, 0x65fe8021, 0xaf4f0666, 0x43d7cc06, 0x04200637, 0x4e213f45, 0xcb9c24b7, 0x9c0eb94d, 0x22fb45c7, 0x08bb6118, 0xe76a0920, 0x0c6f5a1a, 0x770bfb6e, 0xbb7718bd, 0x090f5722, 0x8f450420, 0x08ef422d, 0x450fdb54, 0x8d451769, 0x0f99450b, 0x210b1f57, 0x5e4c8001, 0x00012406, 0x6e80fd80, 0x80230b3c, 0x1800fd80, 0x8408746e, 0x181f8519, 0x4a36c45c, 0x0f4305bd, 0x08734533, 0x97172342, 0x0fb75d17, 0x8000fe22, 0x15465018, 0xa783178b, 0x4507c05e, 0xd7b9237f, 0x9708314a, 0x8b1797bf, 0x058f45d7, 0xd880fe21, 0x467b54d9, 0x1797cb97, 0x4210bb41, 0xc1410781, 0x27a7452d, 0x4605c541, 0xd3440683, 0x00432322, 0xd7440047, 0x97c7970c, 0x20df8c17, 0x067d5e00, 0xe344dba7, 0x6bd68528, 0x0520071f, 0x591b7344, 0x1f6b0869, 0x067d422b, 0xb1670020, 0x4d7f8317, 0x676e2566, 0x49a39b08, 0x13200687, 0x0a737018, 0x490b4741, 0x1f8f138f, 0x1805c37e, 0x18091555, 0x200e2f4c, 0x4d5d18fe, 0x08bc5924, 0x0000002a, 0xff000019, 0x04800380, 0x66210747, 0xff5211eb, 0x13274c18, 0x5d42dd93, 0x13c9620f, 0x4c0d0568, 0x714c084a, 0x7f5f180b, 0x82de830e, 0x4c042012, 0x5b5a306c, 0x41002011, 0xd94f2617, 0x10836213, 0x181b1f56, 0x500e9d6c, 0x4118088f, 0xd686112e, 0x5a26db45, 0xc7ab064f, 0xb40f0950, 0x055943c7, 0x4d18a485, 0x1185117e, 0x4f18c9ae, 0x012032b3, 0x0a157a18, 0xb40a3d52, 0x0c4d50d1, 0x18059a4a, 0x8c0c194c, 0x1f5650d3, 0x54086942, 0x674207cf, 0x0c0f5326, 0x7708b768, 0xd9b7099f, 0x8407365e, 0x1eaf4197, 0x182a9346, 0x2031a370, 0x06cb6101, 0x2040ad41, 0x07365300, 0x2018aa41, 0x124a6303, 0x5619084d, 0x77183a77, 0xa7410821, 0x4dff2041, 0x58430611, 0x44c68a1e, 0x16212727, 0x74008200, 0x57202e2f, 0x18095152, 0x520f8b4b, 0xe9590f49, 0x13294617, 0x4d085552, 0xc84507f7, 0x05d76c06, 0x8000fe23, 0x20028401, 0x631685fd, 0xcc4119bd, 0x00002319, 0x4a180f00, 0xe3462643, 0x2d531818, 0x0cdb5917, 0x10b55118, 0x69430120, 0x41ff2006, 0xbda706c8, 0x5132c745, 0x7b460ceb, 0x1369470f, 0x20149761, 0x0c3a7e00, 0x5341fd20, 0x7b521805, 0x30c6450c, 0xf351cbb2, 0x45cbb80c, 0xfe220895, 0x48488000, 0xbd802008, 0x001325cc, 0x03000080, 0x20275f47, 0x1dcd564b, 0x18170d43, 0x86181554, 0x5cfe20d1, 0xa1410a43, 0x29944619, 0x1844b745, 0x9d3ae754, 0x2db845ce, 0x0920cb82, 0x1ae35018, 0x7610b949, 0x0f830fc3, 0x05430120, 0x08524407, 0x201bf442, 0x426f9f00, 0x6f940ccd, 0x9c11aa41, 0xc7511870, 0x17c74b08, 0x0c154218, 0x1b1b5318, 0x7e0de548, 0xbe7a0887, 0x95ef861c, 0x101b597b, 0x5f83ef94, 0xaf45fe20, 0x8def850c, 0x49208613, 0x6f673733, 0xc37b180b, 0x0fab460b, 0x7f1ba94c, 0x73180cc1, 0x33490a80, 0x38a37411, 0x440bcb4f, 0xe9582757, 0x17774718, 0x0120e397, 0x41081b5d, 0x664d057a, 0x14786e08, 0x200a624d, 0x216d4dff, 0x4e08234f, 0x9543216b, 0x0ff34510, 0x450f394e, 0xb1430f39, 0x82c09708, 0x07fc7a17, 0x201e025c, 0xae008380, 0x0f434dbb, 0x9f0c0b45, 0x0a3b4dbb, 0x4618bdc7, 0x5d4c32eb, 0x44c5ac12, 0xc7a30c49, 0x4411f344, 0x0c850c10, 0x58333b48, 0x4f42138f, 0x827e8330, 0x808021c5, 0x430d6b47, 0x55420e16, 0x26274d0b, 0x61312f7c, 0xcb430fe9, 0x13d76a17, 0x200d5d77, 0x0cc14e80, 0x200ab144, 0x271b4d03, 0x58070021, 0x59181683, 0x2d540cf5, 0x3335230c, 0x46410115, 0x20068406, 0x446b8202, 0x0b830b3d, 0x14000022, 0x4f2c137e, 0x81710817, 0x876e180f, 0x0f2f7e13, 0x450be376, 0x98820b2f, 0x0e45fe20, 0x18012006, 0x87178082, 0x44032020, 0xcd4221fe, 0x09f75c0d, 0x4523e345, 0x3f440c0f, 0x41178f17, 0x9f820c75, 0x5018fe20, 0x664822f6, 0x18c0901b, 0x512afb5a, 0x9d550789, 0x20bf9c1b, 0x066c4780, 0x530e7043, 0x80183b1f, 0x8f46087b, 0x4b432021, 0xad8f11b7, 0x85410f97, 0x21c5840c, 0x0e458080, 0x80fd2117, 0x08d15f18, 0x42188020, 0x7f562d42, 0x0b63512b, 0x178fb597, 0xd54ec58c, 0x1490410c, 0x44050c53, 0x00222945, 0x8f4f1500, 0x2a075305, 0x420afb66, 0x5f183755, 0x915a13f3, 0x41d89408, 0x4d780ba1, 0x2202490f, 0x240c4243, 0x80001400, 0x738718ff, 0x435e182d, 0x0b93410c, 0x182b0346, 0x180cab40, 0x18087752, 0x8216975b, 0x202282f0, 0x2c5758fe, 0xd741e589, 0x21175909, 0x4c095f58, 0x89420c33, 0x180f970f, 0x581ff355, 0xe2411347, 0x0902680e, 0xd541ef8a, 0x82002030, 0x01152300, 0x00870002, 0x58002422, 0x01240a86, 0x84001e00, 0x02220b86, 0x09860e00, 0x03000022, 0x0420178a, 0x05220b8a, 0x25881400, 0x17840620, 0x33860120, 0x22001223, 0x240b8500, 0x000f0001, 0x240b863f, 0x00070002, 0x240b8634, 0x00130003, 0x200b863b, 0x24238a04, 0x000a0005, 0x2017864e, 0x24178406, 0x04010003, 0x83578209, 0x850b85a7, 0x850b85a7, 0x240b85a7, 0x00260003, 0x83ad827c, 0x85a7852f, 0x85a78517, 0x30a7850b, 0x00650052, 0x00750067, 0x0061006c, 0x00320072, 0x22018230, 0x862f0034, 0x31330805, 0x79623500, 0x69725420, 0x6e617473, 0x69724720, 0x72656d6d, 0x75676552, 0x5472616c, 0x50205854, 0x67676f72, 0x656c4379, 0x54546e61, 0x30325a53, 0x822f3430, 0x35312902, 0x79006200, 0x54002000, 0x69245382, 0x74007300, 0x6e205d82, 0x47200f82, 0x6d220f84, 0x75826d00, 0x1d827220, 0x58005422, 0x50201582, 0x6f201582, 0x67208582, 0x43203382, 0x65208982, 0x54202d84, 0x53231f82, 0x41005a00, 0x1422099f, 0x0f410000, 0x87088206, 0x01012102, 0x78080982, 0x01020101, 0x01040103, 0x01060105, 0x01080107, 0x010a0109, 0x010c010b, 0x010e010d, 0x0110010f, 0x01120111, 0x01140113, 0x01160115, 0x01180117, 0x011a0119, 0x011c011b, 0x011e011d, 0x0020011f, 0x00040003, 0x00060005, 0x00080007, 0x000a0009, 0x000c000b, 0x000e000d, 0x0010000f, 0x00120011, 0x00140013, 0x00160015, 0x00180017, 0x001a0019, 0x001c001b, 0x001e001d, 0x09bd821f, 0x22002191, 0x24002300, 0x26002500, 0x28002700, 0x2a002900, 0x2c002b00, 0x2e002d00, 0x30002f00, 0x32003100, 0x34003300, 0x36003500, 0x38003700, 0x3a003900, 0x3c003b00, 0x3e003d00, 0x40003f00, 0x42004100, 0x44004300, 0x46004500, 0x48004700, 0x4a004900, 0x4c004b00, 0x4e004d00, 0x50004f00, 0x52005100, 0x54005300, 0x56005500, 0x58005700, 0x5a005900, 0x5c005b00, 0x5e005d00, 0x60005f00, 0x21016100, 0x23012201, 0x25012401, 0x27012601, 0x29012801, 0x2b012a01, 0x2d012c01, 0x2f012e01, 0x31013001, 0x33013201, 0x35013401, 0x37013601, 0x39013801, 0x3b013a01, 0x3d013c01, 0x3f013e01, 0x41014001, 0xa300ac00, 0x85008400, 0x9600bd00, 0x8600e800, 0x8b008e00, 0xa9009d00, 0xef00a400, 0xda008a00, 0x93008300, 0xf300f200, 0x97008d00, 0xc3008800, 0xf100de00, 0xaa009e00, 0xf400f500, 0xa200f600, 0xc900ad00, 0xae00c700, 0x63006200, 0x64009000, 0x6500cb00, 0xca00c800, 0xcc00cf00, 0xce00cd00, 0x6600e900, 0xd000d300, 0xaf00d100, 0xf0006700, 0xd6009100, 0xd500d400, 0xeb006800, 0x8900ed00, 0x69006a00, 0x6d006b00, 0x6e006c00, 0x6f00a000, 0x70007100, 0x73007200, 0x74007500, 0x77007600, 0x7800ea00, 0x79007a00, 0x7d007b00, 0xb8007c00, 0x7f00a100, 0x80007e00, 0xec008100, 0xba00ee00, 0x696e750e, 0x65646f63, 0x30783023, 0x8d313030, 0x8d32200e, 0x8d33200e, 0x8d34200e, 0x8d35200e, 0x8d36200e, 0x8d37200e, 0x8d38200e, 0x8d39200e, 0x8d61200e, 0x8d62200e, 0x8d63200e, 0x8d64200e, 0x8d65200e, 0x8c66200e, 0x3031210e, 0xef8d0e8d, 0xef8d3120, 0xef8d3120, 0xef8d3120, 0xef8d3120, 0xef8d3120, 0xef8d3120, 0xef8d3120, 0xef8d3120, 0xef8d3120, 0xef8d3120, 0xef8d3120, 0xef8d3120, 0xef8d3120, 0x0666312d, 0x656c6564, 0x45046574, 0x8c6f7275, 0x8d3820ec, 0x8d3820ec, 0x8d3820ec, 0x8d3820ec, 0x8d3820ec, 0x8d3820ec, 0x8d3820ec, 0x8d3820ec, 0x8d3820ec, 0x8d3820ec, 0x8d3820ec, 0x8d3820ec, 0x8d3820ec, 0x8d3820ec, 0x413820ec, 0x39200ddc, 0x200ddc41, 0x20ef8d39, 0x20ef8d39, 0x20ef8d39, 0x20ef8d39, 0x20ef8d39, 0x20ef8d39, 0x20ef8d39, 0x20ef8d39, 0x20ef8d39, 0x20ef8d39, 0x20ef8d39, 0x20ef8d39, 0x20ef8d39, 0x23ef8d39, 0x00006639, 0xa947fa05, 0x0000f26b, };
143.909091
148
0.805233
perefm
0d6fbe13958ea917914dd9f36a99095bedced173
25,912
cpp
C++
QTDialogs/ResultsAnalyzerTab/ResultsAnalyzerTab.cpp
msolids/musen
67d9a70d03d771ccda649c21b78d165684e31171
[ "BSD-3-Clause" ]
19
2020-09-28T07:22:50.000Z
2022-03-07T09:52:20.000Z
QTDialogs/ResultsAnalyzerTab/ResultsAnalyzerTab.cpp
LasCondes/musen
18961807928285ff802e050050f4c627dd7bec1e
[ "BSD-3-Clause" ]
5
2020-12-26T18:18:27.000Z
2022-02-23T22:56:43.000Z
QTDialogs/ResultsAnalyzerTab/ResultsAnalyzerTab.cpp
LasCondes/musen
18961807928285ff802e050050f4c627dd7bec1e
[ "BSD-3-Clause" ]
11
2020-11-02T11:32:03.000Z
2022-01-27T08:22:04.000Z
/* Copyright (c) 2013-2020, MUSEN Development Team. All rights reserved. This file is part of MUSEN framework http://msolids.net/musen. See LICENSE file for license and warranty information. */ #include "ResultsAnalyzerTab.h" #include "qtOperations.h" #include <QMessageBox> #include <QFileDialog> CAnalyzerThread::CAnalyzerThread(CResultsAnalyzer *_pAnalyzer, QObject *parent /*= 0*/) : QObject(parent) { m_pAnalyzer = _pAnalyzer; connect(&m_Thread, SIGNAL(started()), this, SLOT(StartAnalyzing())); } CAnalyzerThread::~CAnalyzerThread() { m_Thread.quit(); m_Thread.wait(); } void CAnalyzerThread::Run(const QString& _sFileName) { m_sFileName = _sFileName; this->moveToThread(&m_Thread); m_Thread.start(); } void CAnalyzerThread::Stop() { m_Thread.exit(); } void CAnalyzerThread::StopAnalyzing() { m_pAnalyzer->SetCurrentStatus(CResultsAnalyzer::EStatus::ShouldBeStopped); } void CAnalyzerThread::StartAnalyzing() { m_pAnalyzer->StartExport(m_sFileName.toStdString()); emit Finished(); } CResultsAnalyzerTab::CResultsAnalyzerTab(QWidget *parent) : CMusenDialog(parent) { ui.setupUi(this); m_pAnalyzer = nullptr; m_bAvoidSignal = false; m_pConstraintsEditorTab = new CConstraintsEditorTab(ui.tabWidget); m_pAnalyzerThread = nullptr; m_vTypesForTypeActive = { CResultsAnalyzer::EPropertyType::BondForce, CResultsAnalyzer::EPropertyType::BondNumber, CResultsAnalyzer::EPropertyType::Coordinate, CResultsAnalyzer::EPropertyType::CoordinationNumber, CResultsAnalyzer::EPropertyType::Deformation, CResultsAnalyzer::EPropertyType::Diameter, CResultsAnalyzer::EPropertyType::Distance, CResultsAnalyzer::EPropertyType::Duration, CResultsAnalyzer::EPropertyType::Energy, CResultsAnalyzer::EPropertyType::ForceNormal, CResultsAnalyzer::EPropertyType::ForceTangential, CResultsAnalyzer::EPropertyType::ForceTotal, CResultsAnalyzer::EPropertyType::KineticEnergy, CResultsAnalyzer::EPropertyType::Length, CResultsAnalyzer::EPropertyType::MaxOverlap, CResultsAnalyzer::EPropertyType::Orientation, CResultsAnalyzer::EPropertyType::PartNumber, CResultsAnalyzer::EPropertyType::PotentialEnergy, CResultsAnalyzer::EPropertyType::ResidenceTime, CResultsAnalyzer::EPropertyType::Strain, CResultsAnalyzer::EPropertyType::VelocityNormal, CResultsAnalyzer::EPropertyType::VelocityRotational, CResultsAnalyzer::EPropertyType::VelocityTangential, CResultsAnalyzer::EPropertyType::VelocityTotal, CResultsAnalyzer::EPropertyType::Stress, CResultsAnalyzer::EPropertyType::Temperature }; m_vTypesForDistanceActive = { CResultsAnalyzer::EPropertyType::Distance }; m_vTypesForComponentActive = { CResultsAnalyzer::EPropertyType::Coordinate, CResultsAnalyzer::EPropertyType::Distance, CResultsAnalyzer::EPropertyType::ForceNormal, CResultsAnalyzer::EPropertyType::ForceTangential, CResultsAnalyzer::EPropertyType::ForceTotal, CResultsAnalyzer::EPropertyType::VelocityNormal, CResultsAnalyzer::EPropertyType::VelocityRotational, CResultsAnalyzer::EPropertyType::VelocityTangential, CResultsAnalyzer::EPropertyType::VelocityTotal, CResultsAnalyzer::EPropertyType::Orientation, CResultsAnalyzer::EPropertyType::Stress }; m_vTypesForDistrParamsActive = { CResultsAnalyzer::EPropertyType::ResidenceTime }; resize(minimumSizeHint()); InitializeConnections(); } void CResultsAnalyzerTab::Initialize() { SetResultsTypeVisible(false); SetDistanceVisible(false); SetComponentVisible(false); SetCollisionsVisible(false); SetGeometryVisible(false); SetConstraintsVisible(false); SetConstraintMaterialsVisible(false); SetConstraintMaterials2Visible(false); SetConstraintVolumesVisible(false); SetConstraintGeometriesVisible(false); SetConstraintDiametersVisible(false); SetConstraintDiameters2Visible(false); InitializeAnalyzerTab(); } CResultsAnalyzerTab::~CResultsAnalyzerTab() { } void CResultsAnalyzerTab::SetPointers(CSystemStructure* _pSystemStructure, CUnitConvertor* _pUnitConvertor, CMaterialsDatabase* _pMaterialsDB, CGeometriesDatabase* _pGeometriesDB, CAgglomeratesDatabase* _pAgglomDB) { CMusenDialog::SetPointers(_pSystemStructure, _pUnitConvertor, _pMaterialsDB, _pGeometriesDB, _pAgglomDB); m_pAnalyzer->SetSystemStructure(_pSystemStructure); m_pAnalyzer->GetConstraintsPtr()->SetPointers(_pSystemStructure, _pMaterialsDB); m_pConstraintsEditorTab->SetPointers(_pSystemStructure, _pUnitConvertor, _pMaterialsDB, _pGeometriesDB, _pAgglomDB); m_pConstraintsEditorTab->SetConstraintsPtr(m_pAnalyzer->GetConstraintsPtr()); } void CResultsAnalyzerTab::UpdateSettings() { m_pAnalyzer->UpdateSettings(); m_pConstraintsEditorTab->UpdateSettings(); } void CResultsAnalyzerTab::InitializeConnections() const { // connect ComboBoxProperty connect(ui.listProperty, &QListWidget::currentRowChanged, this, &CResultsAnalyzerTab::NewPropertySelected); // buttons connect(ui.pushButtonCancel, SIGNAL(clicked()), this, SLOT(reject())); connect(ui.pushButtonExport, SIGNAL(clicked()), this, SLOT(ExportDataPressed())); // results type connect(ui.radioButtonDistribution, &QRadioButton::clicked, this, &CResultsAnalyzerTab::NewResultsTypeSelected); connect(ui.radioButtonAverage, &QRadioButton::clicked, this, &CResultsAnalyzerTab::NewResultsTypeSelected); connect(ui.radioButtonMaximum, &QRadioButton::clicked, this, &CResultsAnalyzerTab::NewResultsTypeSelected); connect(ui.radioButtonMinimum, &QRadioButton::clicked, this, &CResultsAnalyzerTab::NewResultsTypeSelected); connect(ui.lineEditDistrMin, &QLineEdit::editingFinished, this, &CResultsAnalyzerTab::NewDistrParamSet); connect(ui.lineEditDistrMax, &QLineEdit::editingFinished, this, &CResultsAnalyzerTab::NewDistrParamSet); connect(ui.lineEditDistrNClasses, &QLineEdit::editingFinished, this, &CResultsAnalyzerTab::NewDistrParamSet); // distance connect(ui.radioButtonToPoint, SIGNAL(clicked(bool)), this, SLOT(NewDistanceTypeSelected(bool))); connect(ui.radioButtonToLine, SIGNAL(clicked(bool)), this, SLOT(NewDistanceTypeSelected(bool))); connect(ui.lineEditX1, &QLineEdit::editingFinished, this, &CResultsAnalyzerTab::NewDataPointsSet); connect(ui.lineEditY1, &QLineEdit::editingFinished, this, &CResultsAnalyzerTab::NewDataPointsSet); connect(ui.lineEditZ1, &QLineEdit::editingFinished, this, &CResultsAnalyzerTab::NewDataPointsSet); connect(ui.lineEditX2, &QLineEdit::editingFinished, this, &CResultsAnalyzerTab::NewDataPointsSet); connect(ui.lineEditY2, &QLineEdit::editingFinished, this, &CResultsAnalyzerTab::NewDataPointsSet); connect(ui.lineEditZ2, &QLineEdit::editingFinished, this, &CResultsAnalyzerTab::NewDataPointsSet); // components connect(ui.radioButtonTotal, SIGNAL(clicked(bool)), this, SLOT(NewComponentSelected(bool))); connect(ui.radioButtonX, SIGNAL(clicked(bool)), this, SLOT(NewComponentSelected(bool))); connect(ui.radioButtonY, SIGNAL(clicked(bool)), this, SLOT(NewComponentSelected(bool))); connect(ui.radioButtonZ, SIGNAL(clicked(bool)), this, SLOT(NewComponentSelected(bool))); // relation connect(ui.radioButtonNumberRelated, SIGNAL(clicked(bool)), this, SLOT(NewRelationSelected(bool))); connect(ui.radioButtonFrequencyRelated, SIGNAL(clicked(bool)), this, SLOT(NewRelationSelected(bool))); // collisions type connect(ui.radioButtonPP, SIGNAL(clicked(bool)), this, SLOT(NewCollisionsTypeSelected(bool))); connect(ui.radioButtonPW, SIGNAL(clicked(bool)), this, SLOT(NewCollisionsTypeSelected(bool))); // geometry connect(ui.comboBoxGeometry, SIGNAL(currentIndexChanged(int)), this, SLOT(NewGeometrySelected(int))); // time data connect(ui.lineEditTimeFrom, &QLineEdit::editingFinished, this, &CResultsAnalyzerTab::NewTimeSet); connect(ui.lineEditTimeTo, &QLineEdit::editingFinished, this, &CResultsAnalyzerTab::NewTimeSet); connect(ui.lineEditTimeStep, &QLineEdit::editingFinished, this, &CResultsAnalyzerTab::NewTimeSet); connect(ui.radioButtonTimeSaved, &QRadioButton::clicked, this, &CResultsAnalyzerTab::NewTimeSet); connect(ui.radioButtonTimeStep, &QRadioButton::clicked, this, &CResultsAnalyzerTab::NewTimeSet); // constraints dialog connect(m_pConstraintsEditorTab, SIGNAL(finished(int)), this, SLOT(CloseDialog(int))); // timers connect(&m_UpdateTimer, SIGNAL(timeout()), this, SLOT(UpdateExportStatistics())); } void CResultsAnalyzerTab::SetResultsTypeVisible(bool _bVisible) { ui.groupBoxResultsType->setVisible(_bVisible); } void CResultsAnalyzerTab::SetDistanceVisible(bool _bVisible) { ui.groupBoxDistance->setVisible(_bVisible); } void CResultsAnalyzerTab::SetComponentVisible(bool _bVisible) { ui.frameComponent->setVisible(_bVisible); } void CResultsAnalyzerTab::SetCollisionsVisible(bool _bVisible) { ui.frameCollisions->setVisible(_bVisible); } void CResultsAnalyzerTab::SetGeometryVisible(bool _bVisible) { ui.frameGeometries->setVisible(_bVisible); } void CResultsAnalyzerTab::SetPoint2Visible(bool _bVisible) { ui.labelP2->setVisible(_bVisible); ui.lineEditX2->setVisible(_bVisible); ui.lineEditY2->setVisible(_bVisible); ui.lineEditZ2->setVisible(_bVisible); } void CResultsAnalyzerTab::SetConstraintsVisible(bool _bVisible) { if (!_bVisible) ui.tabWidget->removeTab(1); else { ui.tabWidget->addTab(m_pConstraintsEditorTab, "Constraints"); m_pConstraintsEditorTab->resize(m_pConstraintsEditorTab->minimumSizeHint()); } } void CResultsAnalyzerTab::SetConstraintMaterialsVisible(bool _bVisible) { m_pConstraintsEditorTab->SetMaterialsVisible(_bVisible); } void CResultsAnalyzerTab::SetConstraintMaterials2Visible(bool _bVisible) { m_pConstraintsEditorTab->SetMaterials2Visible(_bVisible); } void CResultsAnalyzerTab::SetConstraintVolumesVisible(bool _bVisible) { m_pConstraintsEditorTab->SetVolumesVisible(_bVisible); } void CResultsAnalyzerTab::SetConstraintGeometriesVisible(bool _bVisible) { m_pConstraintsEditorTab->SetGeometriesVisible(_bVisible); } void CResultsAnalyzerTab::SetConstraintDiametersVisible(bool _bVisible) { m_pConstraintsEditorTab->SetDiametersVisible(_bVisible); } void CResultsAnalyzerTab::SetConstraintDiameters2Visible(bool _bVisible) { m_pConstraintsEditorTab->SetDiameters2Visible(_bVisible); } void CResultsAnalyzerTab::UpdateSelectedProperty() { if (ui.groupBoxProperty->isHidden()) return; m_bAvoidSignal = true; UpdateSelectedResultsType(); UpdateResultsTypeActivity(); UpdateDistance(); UpdateDistanceVisibility(); UpdateComponentActivity(); UpdateTime(); UpdateDistrParams(); UpdateDistrParamsActivity(); m_bAvoidSignal = false; } void CResultsAnalyzerTab::UpdateSelectedResultsType() { if (ui.groupBoxResultsType->isHidden()) return; m_bAvoidSignal = true; switch (m_pAnalyzer->m_nResultsType) { case CResultsAnalyzer::EResultType::Distribution: ui.radioButtonDistribution->setChecked(true); break; case CResultsAnalyzer::EResultType::Average: ui.radioButtonAverage->setChecked(true); break; case CResultsAnalyzer::EResultType::Maximum: ui.radioButtonMaximum->setChecked(true); break; case CResultsAnalyzer::EResultType::Minimum: ui.radioButtonMinimum->setChecked(true); break; default: break; } UpdateDistrParamsActivity(); m_bAvoidSignal = false; } void CResultsAnalyzerTab::UpdateSelectedDistance() { if (ui.groupBoxDistance->isHidden()) return; m_bAvoidSignal = true; if (m_pAnalyzer->m_nDistance == CResultsAnalyzer::EDistanceType::ToPoint) ui.radioButtonToPoint->setChecked(true); else ui.radioButtonToLine->setChecked(true); SetPoint2Visible(m_pAnalyzer->m_nDistance == CResultsAnalyzer::EDistanceType::ToLine); m_bAvoidSignal = false; } void CResultsAnalyzerTab::UpdateSelectedComponent() { if (ui.frameComponent->isHidden()) return; m_bAvoidSignal = true; if (m_pAnalyzer->m_nComponent== CResultsAnalyzer::EVectorComponent::Total) ui.radioButtonTotal->setChecked(true); else if (m_pAnalyzer->m_nComponent == CResultsAnalyzer::EVectorComponent::X) ui.radioButtonX->setChecked(true); else if (m_pAnalyzer->m_nComponent == CResultsAnalyzer::EVectorComponent::Y) ui.radioButtonY->setChecked(true); else if (m_pAnalyzer->m_nComponent == CResultsAnalyzer::EVectorComponent::Z) ui.radioButtonZ->setChecked(true); m_bAvoidSignal = false; } void CResultsAnalyzerTab::UpdateSelectedRelation() { if (ui.frameCollisions->isHidden()) return; m_bAvoidSignal = true; if (m_pAnalyzer->m_nRelation== CResultsAnalyzer::ERelationType::Existing) ui.radioButtonNumberRelated->setChecked(true); else if (m_pAnalyzer->m_nRelation == CResultsAnalyzer::ERelationType::Appeared) ui.radioButtonFrequencyRelated->setChecked(true); m_bAvoidSignal = false; } void CResultsAnalyzerTab::UpdateSelectedCollisionsType() { if (ui.frameCollisions->isHidden()) return; m_bAvoidSignal = true; if (m_pAnalyzer->m_nCollisionType == CResultsAnalyzer::ECollisionType::ParticleParticle) { ui.radioButtonPP->setChecked(true); SetConstraintGeometriesVisible(false); SetConstraintMaterials2Visible(true); SetConstraintDiameters2Visible(true); } else if (m_pAnalyzer->m_nCollisionType == CResultsAnalyzer::ECollisionType::ParticleWall) { ui.radioButtonPW->setChecked(true); SetConstraintGeometriesVisible(true); SetConstraintMaterials2Visible(false); SetConstraintDiameters2Visible(false); } m_bAvoidSignal = false; } void CResultsAnalyzerTab::UpdateSelectedGeometry() { if (ui.frameGeometries->isHidden()) return; m_bAvoidSignal = true; ui.comboBoxGeometry->setCurrentIndex(static_cast<int>(m_pAnalyzer->m_nGeometryIndex)); m_bAvoidSignal = false; } void CResultsAnalyzerTab::UpdateDistance() { if (ui.groupBoxDistance->isHidden()) return; m_bAvoidSignal = true; ui.lineEditX1->setText(QString::number(m_pAnalyzer->m_Point1.x)); ui.lineEditY1->setText(QString::number(m_pAnalyzer->m_Point1.y)); ui.lineEditZ1->setText(QString::number(m_pAnalyzer->m_Point1.z)); ui.lineEditX2->setText(QString::number(m_pAnalyzer->m_Point2.x)); ui.lineEditY2->setText(QString::number(m_pAnalyzer->m_Point2.y)); ui.lineEditZ2->setText(QString::number(m_pAnalyzer->m_Point2.z)); SetPoint2Visible(m_pAnalyzer->m_nDistance == CResultsAnalyzer::EDistanceType::ToLine); m_bAvoidSignal = false; } void CResultsAnalyzerTab::UpdateTime() { m_bAvoidSignal = true; ui.lineEditTimeFrom->setText(QString::number(m_pAnalyzer->m_dTimeMin)); ui.lineEditTimeTo->setText(QString::number(m_pAnalyzer->m_dTimeMax)); if (m_pAnalyzer->m_bOnlySavedTP) ui.radioButtonTimeSaved->setChecked(true); else { ui.radioButtonTimeStep->setChecked(true); ui.lineEditTimeStep->setText(QString::number(m_pAnalyzer->m_dTimeStep)); } UpdateTimeParams(); m_bAvoidSignal = false; } void CResultsAnalyzerTab::UpdateDistrParams() { m_bAvoidSignal = true; ui.lineEditDistrMin->setText(QString::number(m_pAnalyzer->m_dPropMin)); ui.lineEditDistrMax->setText(QString::number(m_pAnalyzer->m_dPropMax)); ui.lineEditDistrNClasses->setText(QString::number(m_pAnalyzer->m_nPropSteps)); m_bAvoidSignal = false; } void CResultsAnalyzerTab::UpdateConstraints() { m_bAvoidSignal = true; if (ui.tabWidget->count() == 2) m_pConstraintsEditorTab->UpdateWholeView(); m_bAvoidSignal = false; } void CResultsAnalyzerTab::UpdateResultsTypeActivity() { if (ui.groupBoxResultsType->isHidden()) return; bool bActiveAll = std::find(m_vTypesForTypeActive.begin(), m_vTypesForTypeActive.end(), m_pAnalyzer->GetProperty()) != m_vTypesForTypeActive.end(); bool bActiveParam = std::find(m_vTypesForDistrParamsActive.begin(), m_vTypesForDistrParamsActive.end(), m_pAnalyzer->GetProperty()) != m_vTypesForDistrParamsActive.end(); ui.groupBoxResultsType->setEnabled(bActiveParam || bActiveAll); ui.radioButtonAverage->setEnabled(!bActiveParam); ui.radioButtonMaximum->setEnabled(!bActiveParam); ui.radioButtonMinimum->setEnabled(!bActiveParam); if (bActiveParam) ui.radioButtonDistribution->setChecked(true); else UpdateSelectedResultsType(); } void CResultsAnalyzerTab::UpdateDistanceVisibility() { bool bVisible = std::find(m_vTypesForDistanceActive.begin(), m_vTypesForDistanceActive.end(), m_pAnalyzer->GetProperty()) != m_vTypesForDistanceActive.end(); ui.groupBoxDistance->setVisible(bVisible); } void CResultsAnalyzerTab::UpdateComponentActivity() { if (ui.frameComponent->isHidden()) return; CResultsAnalyzer::EPropertyType p = m_pAnalyzer->GetProperty(); bool bActive = std::find(m_vTypesForComponentActive.begin(), m_vTypesForComponentActive.end(), p) != m_vTypesForComponentActive.end(); bool bNotActive = (ui.groupBoxDistance->isVisible() && p == CResultsAnalyzer::EPropertyType::Distance && m_pAnalyzer->m_nDistance == CResultsAnalyzer::EDistanceType::ToLine); ui.frameComponent->setEnabled(bActive && !bNotActive); } void CResultsAnalyzerTab::UpdateDistrParamsActivity() { CResultsAnalyzer::EPropertyType p = m_pAnalyzer->GetProperty(); bool bActive = std::find(m_vTypesForDistrParamsActive.begin(), m_vTypesForDistrParamsActive.end(), p) != m_vTypesForDistrParamsActive.end(); SetDistrParamsActive(bActive || (m_pAnalyzer->m_nResultsType == CResultsAnalyzer::EResultType::Distribution)); } void CResultsAnalyzerTab::UpdateTimeParams() { m_bAvoidSignal = true; if (m_pAnalyzer->m_nRelation == CResultsAnalyzer::ERelationType::Existing) // time points are analyzed ui.lineEditTimePoints->setText(QString::number(m_pAnalyzer->m_vTimePoints.size())); else // intervals are analyzed ui.lineEditTimePoints->setText(QString::number(m_pAnalyzer->m_vTimePoints.size() - 1)); ui.lineEditTimeStep->setEnabled(!m_pAnalyzer->m_bOnlySavedTP); m_bAvoidSignal = false; } void CResultsAnalyzerTab::SetWindowTitle(const QString& _sTitle) { this->setWindowTitle(_sTitle); } void CResultsAnalyzerTab::SetupGeometryCombo() { m_bAvoidSignal = true; ui.comboBoxGeometry->clear(); for (unsigned i = 0; i < m_pSystemStructure->GeometriesNumber(); ++i) ui.comboBoxGeometry->insertItem(i, QString::fromStdString(m_pSystemStructure->Geometry(i)->Name())); if (m_pSystemStructure->GeometriesNumber() > 0) ui.comboBoxGeometry->setCurrentIndex(0); m_bAvoidSignal = false; } void CResultsAnalyzerTab::SetStatusText(const QString& _sText) { ui.statusLabel->setText(_sText); } void CResultsAnalyzerTab::SetComponentActive(bool _bActive) { ui.frameComponent->setEnabled(_bActive); } void CResultsAnalyzerTab::SetDistrParamsActive(bool _bActive) { ui.frameDistrParams->setEnabled(_bActive); } void CResultsAnalyzerTab::UpdateWholeView() { UpdateSelectedProperty(); UpdateSelectedDistance(); UpdateSelectedComponent(); UpdateSelectedRelation(); UpdateSelectedGeometry(); UpdateDistance(); UpdateTime(); UpdateDistrParams(); UpdateDistanceVisibility(); UpdateComponentActivity(); UpdateConstraints(); } void CResultsAnalyzerTab::ExportDataPressed() { if (m_pAnalyzer->GetCurrentStatus() == CResultsAnalyzer::EStatus::Idle) { if (ui.listProperty->selectedItems().size() > 1) { CResultsAnalyzer::VPropertyType propertyTypes; for (const auto& iProperty : ui.listProperty->selectedItems()) propertyTypes.push_back(static_cast<CResultsAnalyzer::EPropertyType>(iProperty->data(Qt::UserRole).toUInt())); m_pAnalyzer->SetPropertyType(propertyTypes); } ExportData(); } else if (m_pAnalyzer->GetCurrentStatus() == CResultsAnalyzer::EStatus::Runned) if (m_pAnalyzerThread) m_pAnalyzerThread->StopAnalyzing(); } void CResultsAnalyzerTab::ExportData() { QString sFileName = QFileDialog::getSaveFileName(this, tr("Export data"), QString::fromStdString(m_pSystemStructure->GetFileName()) + ".csv", tr("Text files (*.csv);;All files (*.*);; Dat files(*.dat);;")); if (sFileName.isEmpty()) { SetStatusText(""); return; } if (!IsFileWritable(sFileName)) { QMessageBox::warning(this, "Writing error", "Unable to write - selected file is not writable"); SetStatusText(""); return; } SetStatusText("Exporting started. Please wait..."); ui.progressBarExporting->setValue(0); m_pConstraintsEditorTab->SetWidgetsEnabled(false); ui.framePropertiesTab->setEnabled(false); ui.pushButtonCancel->setEnabled(false); ui.pushButtonExport->setText("Stop"); emit DisableOpenGLView(); m_pAnalyzerThread = new CAnalyzerThread(m_pAnalyzer); connect(m_pAnalyzerThread, SIGNAL(Finished()), this, SLOT(ExportFinished())); m_pAnalyzerThread->Run(sFileName); m_UpdateTimer.start(100); } void CResultsAnalyzerTab::NewPropertySelected(int n_Row) { if (m_bAvoidSignal) return; unsigned propertyId = ui.listProperty->item(n_Row)->data(Qt::UserRole).toUInt(); m_pAnalyzer->SetPropertyType(static_cast<CResultsAnalyzer::EPropertyType>(propertyId)); UpdateResultsTypeActivity(); UpdateDistrParamsActivity(); UpdateDistanceVisibility(); UpdateComponentActivity(); } void CResultsAnalyzerTab::SetMultiplePropertySelection(bool _allow) const { ui.listProperty->setMaximumHeight(ui.listProperty->sizeHintForRow(0) * 6 + 2 * ui.listProperty->frameWidth()); if (!_allow) ui.listProperty->setSelectionMode(QAbstractItemView::SingleSelection); } void CResultsAnalyzerTab::AddAnalysisProperty(CResultsAnalyzer::EPropertyType _property, const QString& _rowNameComboBox, const QString& _sToolTip) { ui.listProperty->addItem(_rowNameComboBox); ui.listProperty->item(ui.listProperty->count() - 1)->setData(Qt::UserRole, E2I(_property)); ui.listProperty->item(ui.listProperty->count() - 1)->setToolTip(_sToolTip); } void CResultsAnalyzerTab::NewResultsTypeSelected(bool _bChecked) { if (!_bChecked) return; if (m_bAvoidSignal) return; if (ui.radioButtonDistribution->isChecked()) m_pAnalyzer->SetResultsType(CResultsAnalyzer::EResultType::Distribution); else if (ui.radioButtonAverage->isChecked()) m_pAnalyzer->SetResultsType(CResultsAnalyzer::EResultType::Average); else if (ui.radioButtonMaximum->isChecked()) m_pAnalyzer->SetResultsType(CResultsAnalyzer::EResultType::Maximum); else if (ui.radioButtonMinimum->isChecked()) m_pAnalyzer->SetResultsType(CResultsAnalyzer::EResultType::Minimum); UpdateDistrParamsActivity(); } void CResultsAnalyzerTab::NewDistanceTypeSelected(bool _bChecked) { if (!_bChecked) return; if (m_bAvoidSignal) return; if (ui.radioButtonToPoint->isChecked()) m_pAnalyzer->SetDistanceType(CResultsAnalyzer::EDistanceType::ToPoint); else m_pAnalyzer->SetDistanceType(CResultsAnalyzer::EDistanceType::ToLine); SetPoint2Visible(ui.radioButtonToLine->isChecked()); UpdateComponentActivity(); } void CResultsAnalyzerTab::NewComponentSelected(bool _bChecked) { if (!_bChecked) return; if (m_bAvoidSignal) return; if (ui.radioButtonTotal->isChecked()) m_pAnalyzer->SetVectorComponent(CResultsAnalyzer::EVectorComponent::Total); else if (ui.radioButtonX->isChecked()) m_pAnalyzer->SetVectorComponent(CResultsAnalyzer::EVectorComponent::X); else if (ui.radioButtonY->isChecked()) m_pAnalyzer->SetVectorComponent(CResultsAnalyzer::EVectorComponent::Y); else if (ui.radioButtonZ->isChecked()) m_pAnalyzer->SetVectorComponent(CResultsAnalyzer::EVectorComponent::Z); } void CResultsAnalyzerTab::NewRelationSelected(bool _bChecked) { if (!_bChecked) return; if (m_bAvoidSignal) return; if (ui.radioButtonNumberRelated->isChecked()) m_pAnalyzer->SetRelatonType(CResultsAnalyzer::ERelationType::Existing); else if (ui.radioButtonFrequencyRelated->isChecked()) m_pAnalyzer->SetRelatonType(CResultsAnalyzer::ERelationType::Appeared); UpdateTimeParams(); } void CResultsAnalyzerTab::NewCollisionsTypeSelected(bool _bChecked) { if (!_bChecked) return; if (m_bAvoidSignal) return; if (ui.radioButtonPP->isChecked()) m_pAnalyzer->SetCollisionType(CResultsAnalyzer::ECollisionType::ParticleParticle); else if (ui.radioButtonPW->isChecked()) m_pAnalyzer->SetCollisionType(CResultsAnalyzer::ECollisionType::ParticleWall); UpdateSelectedCollisionsType(); } void CResultsAnalyzerTab::NewGeometrySelected(int _nIndex) { if (_nIndex < 0) return; if (m_bAvoidSignal) return; m_pAnalyzer->SetGeometryIndex(_nIndex); } void CResultsAnalyzerTab::NewDataPointsSet() { if (m_bAvoidSignal) return; m_pAnalyzer->SetPoint1(CVector3(ui.lineEditX1->text().toDouble(), ui.lineEditY1->text().toDouble(), ui.lineEditZ1->text().toDouble())); m_pAnalyzer->SetPoint2(CVector3(ui.lineEditX2->text().toDouble(), ui.lineEditY2->text().toDouble(), ui.lineEditZ2->text().toDouble())); } void CResultsAnalyzerTab::NewTimeSet() { if (m_bAvoidSignal) return; m_bAvoidSignal = true; double dMin = ui.lineEditTimeFrom->text().toDouble(); double dMax = ui.lineEditTimeTo->text().toDouble(); double dStep = ui.lineEditTimeStep->text().toDouble(); bool bSaved = ui.radioButtonTimeSaved->isChecked(); m_pAnalyzer->SetTime(dMin, dMax, dStep, bSaved); UpdateTimeParams(); m_bAvoidSignal = false; } void CResultsAnalyzerTab::NewDistrParamSet() { if (m_bAvoidSignal) return; double dMin = ui.lineEditDistrMin->text().toDouble(); double dMax = ui.lineEditDistrMax->text().toDouble(); unsigned nSteps = ui.lineEditDistrNClasses->text().toUInt(); m_pAnalyzer->SetProperty(dMin, dMax, nSteps); } void CResultsAnalyzerTab::setVisible(bool _bVisible) { QDialog::setVisible(_bVisible); if (_bVisible) { UpdateWholeView(); if (m_size.isEmpty()) { adjustSize(); m_size = size(); } } } void CResultsAnalyzerTab::CloseDialog(int _nResult) { QDialog::done(_nResult); } void CResultsAnalyzerTab::UpdateExportStatistics() { int nProgress = (int)m_pAnalyzer->GetExportProgress(); ui.progressBarExporting->setValue(nProgress); SetStatusText(ss2qs(m_pAnalyzer->GetStatusDescription())); } void CResultsAnalyzerTab::ExportFinished() { m_UpdateTimer.stop(); m_pAnalyzerThread->Stop(); delete m_pAnalyzerThread; m_pAnalyzerThread = nullptr; ui.progressBarExporting->setValue(100); if (!m_pAnalyzer->IsError()) SetStatusText("Export finished."); else SetStatusText("Export failed: " + ss2qs(m_pAnalyzer->GetStatusDescription())); m_pConstraintsEditorTab->SetWidgetsEnabled(true); ui.framePropertiesTab->setEnabled(true); ui.pushButtonCancel->setEnabled(true); ui.pushButtonExport->setText("Export"); emit EnableOpenGLView(); }
35.790055
214
0.793339
msolids
0d710ac67539bcd4976b0e80fbb224a418b64377
10,383
hpp
C++
MyBot/discord_profile_filesystem.hpp
Sijumah/Sijdiscbot
c58433b1bcaacc17ee17637c2daa6ce07d6d4120
[ "Apache-2.0" ]
null
null
null
MyBot/discord_profile_filesystem.hpp
Sijumah/Sijdiscbot
c58433b1bcaacc17ee17637c2daa6ce07d6d4120
[ "Apache-2.0" ]
null
null
null
MyBot/discord_profile_filesystem.hpp
Sijumah/Sijdiscbot
c58433b1bcaacc17ee17637c2daa6ce07d6d4120
[ "Apache-2.0" ]
null
null
null
#pragma once #include "Sijf.hpp" #include <string.h> #include <string> #include <deque> #include <tuple> #include <array> #include<vector> #include <optional> namespace Sijdisc { struct gameprofile { std::string game_name; std::deque<std::pair<std::string,double>> game_stats; //A deque of for instance, "Total Soldiers Placed","300.0". This is retrieved by reading and saving to files. std::deque<std::pair<std::string,std::string>> achievements; //Achievements on a game-per-game basis ie... "Aggressive!","Place 500 soldiers". gameprofile(const std::string& supgame_name, const std::deque<std::pair<std::string, double>>& supgame_stats = {}, const std::deque<std::pair<std::string, std::string>>& supachievments = {}) : game_name(supgame_name), game_stats(supgame_stats), achievements(supachievments) {} bool has_achievement_by_name(const std::string& searched_achievment) { for (auto&& it : achievements) { if (it.first == searched_achievment) { return true; } }return false; } std::optional<std::pair<std::string, double>*> find_stat_by_name(const std::string& supname) { for (auto&& it : game_stats) { if (it.first == supname) { return &it; } }return std::nullopt; } }; struct profile { std::string discord_id; std::string personal_nickname; //prompt for a nickname when creating the profile std::deque<gameprofile> game_ledger; profile(const std::string& supid = {}, const std::string& supnickname = {}, const std::deque<gameprofile>& supprofile = {}) : discord_id(supid), personal_nickname(supnickname), game_ledger(supprofile) {}; std::optional<gameprofile*> find_game_in_ledger(const std::string& game_name) { for (auto&& it : this->game_ledger) { if (it.game_name == game_name) { return &it; } }return std::nullopt; } void add_game_to_ledger(const std::string& game_name, const std::deque<std::pair<std::string, double>>& supgame_stats = {}, const std::deque<std::pair<std::string, std::string>>& supachievments = {}) { if (find_game_in_ledger(game_name)) { return; } //If game already exists, return. game_ledger.emplace_back(game_name,supgame_stats,supachievments); } //Otherwise add it to the list of games with the given achievements and stats. void add_modify_achievement_by_names(const std::string& gamename,const std::pair<std::string,std::string>& supachiev) { auto game = find_game_in_ledger(gamename); if (game) { //If the game was found if (!(* game)->has_achievement_by_name(supachiev.first)) { //If it doesnt already have the achievment, (*game)->achievements.push_back(supachiev); } //Add it. } } void add_modify_stat_by_names(const std::string& gamename,const std::pair<std::string ,double>& supstat) { auto game= find_game_in_ledger(gamename); //Find the game std::optional<std::pair<std::string, double>*> stat; if (game) {stat = (*game)->find_stat_by_name(supstat.first); //IF a game was found, find the stat by name. if (stat) { *stat.value() = supstat; } //If the stat was found, modify it, else { game.value()->game_stats.push_back(supstat); } //else, make a new entry for the stat. } }; }; //End of profile //╣├ struct profile_collection { std::deque<profile> collection; std::string path; //path to the folder where all of the people are stored void add_new_profile(const std::string& discord_id, const std::string& nickname) { this->collection.push_back(profile(discord_id, nickname, std::deque<gameprofile>{})); }; std::optional<profile*> get_profile_by_name(const std::string& supname) { for (auto&& it : this->collection) { if (it.personal_nickname == supname) return &it; } return std::nullopt; }; void add_games_to_profiles_by_name(const std::string& game_name, const Sijc::stl_ish auto& profile_names) { std::optional<profile*> helper; for (auto&& it : profile_names) { helper = get_profile_by_name(it); if (helper) { (*(helper))->add_game_to_ledger(game_name); } } } /* profile and gameprofile text file: personalnickname.txt: name >personal_nick< 12345 >discordid< dune#poker >gamelist< //list of game names separated by #'s soldiers placed#15%spice gained#20>dunestats< //The stats for a specific game in the form of thing#number%nextthing#nextnumber; the title being gamename+stats Agressive!#Play 500 Soldiers%Winner#Win 10 games >duneachievs< //the above except for achievements If I can these >< delimiters will be ╣ ├ */ void write_to_files() { //Oh god this was painful. I should have made it into a class system and so on. I was like "oh, it wont take too long to do manually". Ugh. for (auto&& it : collection) { //For each player, std::vector<std::string> to_write{}; //Less efficient than it could be, but it won't matter for this program. to_write.emplace_back(it.personal_nickname+">personal_nick<\n"+it.discord_id+">discordid<\n"); //Add their personal nickname and discord ids with identifiers to be found later std::string game_list_string{}; for (auto&& gameit : it.game_ledger) { //For each game, of each player: game_list_string += gameit.game_name+"#"; //add the name of the game to the string containing all games ie dune#poker std::string individual_game_stats{}; for (auto&& statsit : gameit.game_stats) { individual_game_stats += statsit.first + "#" + std::to_string(statsit.second) + "%"; } //for the gamestats, which is a container, make a string of the concactenation of the statname and its value ie soldiers placed#10; separate them with % for each new stat if (individual_game_stats.size() != 0) { if (individual_game_stats.back() == '%') { individual_game_stats.pop_back(); } } //remove an erroneous trailing % to_write.emplace_back(individual_game_stats+">" + gameit.game_name + "stats<\n"); //add that thing to the writing table, along with its identifier ie ">dunestats<" std::string individual_game_achievs{}; for (auto&& achievsit : gameit.achievements) { individual_game_achievs += achievsit.first + "#" + achievsit.second + "%"; } //Repeat that process with achievements which are two strings instead of a string and float if (individual_game_achievs.size() != 0) { if (individual_game_achievs.back() == '%') { individual_game_achievs.pop_back(); } } //remove an erroneous trailing % to_write.emplace_back(individual_game_achievs + ">" + gameit.game_name + "achievs<\n"); //Add THAT to the writing table with ">duneachievs<" } if (game_list_string.size() != 0) { if (game_list_string.back() == '#') { game_list_string.pop_back(); } } //remove an erroneous trailing # to_write.emplace_back(game_list_string + ">gamelist<\n"); //add the games list string to the doc such that its dune#poker>gamelist< Sijf::printtofile(to_write,path+"/"+it.personal_nickname+".txt",1); } }; ~profile_collection() { this->write_to_files(); }; profile_collection(const std::string& folder_path, const std::vector<std::string>& names_without_txt) { //it is only folder PATH, that way the constructor can just open the individual text files for the individual players. this->path = folder_path; std::fstream stream; //std::array<std::string, 3> std::vector<std::string> templat{"personal_nick","discordid","gamelist"}; for (auto&& it : names_without_txt) { ///One loop is one name-- one profile, one person, one body in christ everlasting, amen. stream.open(folder_path + "/"+it + ".txt"); std::deque<gameprofile> sup_gameprofiles; auto helper = Sijf::ret_many_file_lines<std::vector<std::string>>(stream, '>', '<',/*'╣', '├',*/ templat,false); //spits out personalnickname discordid gamelist auto gamelistseparated = Sijf::breakstring(helper.at(2), '#'); //separate the gamelist into for instance 'dune','poker' // soldiers placed#15 % spice gained#20 > dunestats< //The stats for a specific game in the form of thing#number%nextthing#nextnumber; the title being gamename+stats // Agressive!#Play 500 Soldiers % Winner#Win 10 games >duneachiev< //the above except for achievements for (auto gameit : gamelistseparated) { //Each of these is a game within each name's txt file auto gamestats = Sijf::retfileline(stream, '>', '<', (gameit + "stats")); ///*'╣', '├',*/ auto broken_game_stats = Sijf::breakstring(*gamestats, '%'); //Breaks into the category: "soldiers placed#15" std::deque<std::pair < std::string, double >> individual_game_stats{}; std::deque<std::pair<std::string, std::string>> individual_game_achievements{}; for (auto&& lesserit : broken_game_stats) { auto fully_broken_stat = Sijf::breakstring(lesserit, '#'); //Breaks into {"soldiers placed", "15"} individual_game_stats.emplace_back(fully_broken_stat.at(0), std::stod(fully_broken_stat.at(1))); }; //creates the pair and the "15" to a double auto gameachievs = Sijf::retfileline(stream, '>', '<',/*'╣', '├',*/ (gameit + "achievs")); auto broken_game_achievs = Sijf::breakstring(*gameachievs, '%'); for (auto&& lesserit : broken_game_achievs) { auto fully_broken_achiev = Sijf::breakstring(lesserit, '#'); //Breaks into {"barbaric!" "win 10 games"} individual_game_achievements.emplace_back(fully_broken_achiev.at(0), fully_broken_achiev.at(1)); } sup_gameprofiles.emplace_back(std::string{ gameit }, individual_game_stats, individual_game_achievements); } // gameprofile(const std::string & supgame_game, const std::deque<std::pair<std::string, double>>&supgame_stats, // const std::deque<std::pair<std::string, std::string>>&supachievments) : collection.emplace_back(helper.at(1),helper.at(0),sup_gameprofiles); stream.close(); } }; }; //End of profile_collection. }; //End of export sijdisc namespace
47.410959
313
0.663103
Sijumah
0d7355c704fe48cf0184084e52e3c1dc37d7c412
1,710
hpp
C++
Sources/NodeUIEngine/NUIE_ClipboardHandler.hpp
GerHobbelt/VisualScriptEngine
f76564d795b08d413a8625edba87dff21837039f
[ "MIT" ]
19
2020-08-01T14:52:21.000Z
2022-03-27T01:09:59.000Z
Sources/NodeUIEngine/NUIE_ClipboardHandler.hpp
GerHobbelt/VisualScriptEngine
f76564d795b08d413a8625edba87dff21837039f
[ "MIT" ]
17
2020-08-14T15:03:07.000Z
2020-09-24T17:08:52.000Z
Sources/NodeUIEngine/NUIE_ClipboardHandler.hpp
GerHobbelt/VisualScriptEngine
f76564d795b08d413a8625edba87dff21837039f
[ "MIT" ]
null
null
null
#ifndef NUIE_CLIPBOARDHANDLER_HPP #define NUIE_CLIPBOARDHANDLER_HPP #include "NUIE_Version.hpp" #include <vector> #include <memory> namespace NUIE { class ClipboardHandler { public: ClipboardHandler (); virtual ~ClipboardHandler (); virtual Version GetCurrentVersion () const = 0; virtual bool IsCompatibleVersion (const Version& version) const = 0; virtual bool HasClipboardContent () const = 0; virtual bool GetClipboardContent (std::vector<char>& content) const = 0; virtual bool SetClipboardContent (const std::vector<char>& content) = 0; }; using ClipboardHandlerPtr = std::shared_ptr<ClipboardHandler>; using ClipboardHandlerConstPtr = std::shared_ptr<const ClipboardHandler>; class NullClipboardHandler : public ClipboardHandler { public: NullClipboardHandler (); virtual ~NullClipboardHandler (); virtual Version GetCurrentVersion () const override; virtual bool IsCompatibleVersion (const Version& version) const override; virtual bool HasClipboardContent () const override; virtual bool GetClipboardContent (std::vector<char>& content) const override; virtual bool SetClipboardContent (const std::vector<char>& content) override; }; class MemoryClipboardHandler : public ClipboardHandler { public: MemoryClipboardHandler (); virtual ~MemoryClipboardHandler (); virtual Version GetCurrentVersion () const override; virtual bool IsCompatibleVersion (const Version& version) const override; virtual bool HasClipboardContent () const override; virtual bool GetClipboardContent (std::vector<char>& content) const override; virtual bool SetClipboardContent (const std::vector<char>& content) override; private: std::vector<char> clipboard; }; } #endif
27.142857
79
0.780702
GerHobbelt
0d740f2ac7506d22caffb7fe306b683ddcb0402b
21,367
hpp
C++
src/vm/internal/ref_stream_tcp.hpp
BastianBlokland/novus
3b984c36855aa84d6746c14ff7e294ab7d9c1575
[ "MIT" ]
14
2020-04-14T17:00:56.000Z
2021-08-30T08:29:26.000Z
src/vm/internal/ref_stream_tcp.hpp
BastianBlokland/novus
3b984c36855aa84d6746c14ff7e294ab7d9c1575
[ "MIT" ]
27
2020-12-27T16:00:44.000Z
2021-08-01T13:12:14.000Z
src/vm/internal/ref_stream_tcp.hpp
BastianBlokland/novus
3b984c36855aa84d6746c14ff7e294ab7d9c1575
[ "MIT" ]
1
2020-05-29T18:33:37.000Z
2020-05-29T18:33:37.000Z
#pragma once #include "internal/os_include.hpp" #include "internal/platform_utilities.hpp" #include "internal/ref.hpp" #include "internal/ref_allocator.hpp" #include "internal/ref_string.hpp" #include "internal/settings.hpp" #include "internal/stream_opts.hpp" #include "internal/thread.hpp" #include "intrinsics.hpp" #include <atomic> #include <cstring> namespace vm::internal { #if defined(_WIN32) using SocketHandle = SOCKET; inline auto isSocketValid(SocketHandle s) noexcept { return s != INVALID_SOCKET; } inline auto getInvalidSocket() noexcept -> SocketHandle { return INVALID_SOCKET; } #else // !_WIN32 using SocketHandle = int; inline auto isSocketValid(SocketHandle s) noexcept { return s >= 0; } inline auto getInvalidSocket() noexcept -> SocketHandle { return -1; } #endif // !_WIN32 constexpr int32_t defaultConnectionBacklog = 64; constexpr int32_t receiveTimeoutSeconds = 15; enum class TcpStreamType : uint8_t { Server = 0, // Server cannot be used for sending or receiving but can accept new connections. Connection = 1, // Connections are be used for sending and receiving. }; enum class TcpStreamState : uint8_t { Valid = 0, Failed = 1, Closed = 2, }; enum class IpAddressFamily : uint8_t { IpV4 = 0, IpV6 = 1, }; inline auto isIpFamilyValid(IpAddressFamily family) noexcept { switch (family) { case IpAddressFamily::IpV4: case IpAddressFamily::IpV6: return true; } return false; } inline auto getIpFamilyCode(IpAddressFamily family) noexcept { switch (family) { case IpAddressFamily::IpV4: return AF_INET; case IpAddressFamily::IpV6: return AF_INET6; } return AF_UNSPEC; } inline auto getIpAddressSize(IpAddressFamily family) noexcept -> size_t { switch (family) { case IpAddressFamily::IpV4: return 4u; case IpAddressFamily::IpV6: return 16u; } return 0u; } auto configureSocket(SocketHandle sock) noexcept -> void; auto getTcpPlatformError() noexcept -> PlatformError; // Tcp implementation of the 'stream' interface. // Note: To avoid needing a vtable there is no abstract 'Stream' class but instead there are wrapper // functions that dispatch based on the 'RefKind' (see stream_utilities.hpp). class TcpStreamRef final : public Ref { friend class RefAllocator; public: TcpStreamRef(const TcpStreamRef& rhs) = delete; TcpStreamRef(TcpStreamRef&& rhs) = delete; ~TcpStreamRef() noexcept { // Close the socket if its still open. const bool isClosed = m_state.load(std::memory_order_acquire) == TcpStreamState::Closed; if (isSocketValid(m_socket) && !isClosed) { #if defined(_WIN32) ::closesocket(m_socket); #else // !_WIN32 ::close(m_socket); #endif // !_WIN32 } } auto operator=(const TcpStreamRef& rhs) -> TcpStreamRef& = delete; auto operator=(TcpStreamRef&& rhs) -> TcpStreamRef& = delete; [[nodiscard]] constexpr static auto getKind() { return RefKind::StreamTcp; } [[nodiscard]] auto isValid() noexcept -> bool { return isSocketValid(m_socket) && m_state.load(std::memory_order_acquire) == TcpStreamState::Valid; } auto shutdown() noexcept -> bool { if (m_type == TcpStreamType::Connection) { // Connection sockets we shutdown. #if defined(__APPLE__) return ::shutdown(m_socket, SHUT_RDWR) == 0; #elif defined(_WIN32) // !__APPLE__ return ::shutdown(m_socket, SD_BOTH) == 0; #else // !_WIN32 && !__APPLE__ return ::shutdown(m_socket, SHUT_RDWR) == 0; #endif // !_WIN32 && !__APPLE__ } // For server sockets there is no such thing so we already close the socket. const auto prevState = m_state.exchange(TcpStreamState::Closed, std::memory_order_acq_rel); if (isSocketValid(m_socket) && prevState != TcpStreamState::Closed) { #if defined(_WIN32) return ::closesocket(m_socket) == 0; #else // !_WIN32 return ::close(m_socket) == 0; #endif // !_WIN32 } return false; // Already closed before. } auto readString(ExecutorHandle* execHandle, PlatformError* pErr, StringRef* str) noexcept -> bool { if (unlikely(m_type != TcpStreamType::Connection)) { *pErr = PlatformError::StreamReadNotSupported; str->updateSize(0); return false; } if (unlikely(str->getSize() == 0)) { return true; } execHandle->setState(ExecState::Paused); int bytesRead = -1; while (m_state.load(std::memory_order_acquire) == TcpStreamState::Valid) { bytesRead = ::recv(m_socket, str->getCharDataPtr(), str->getSize(), 0); if (bytesRead >= 0) { break; // No error while reading. } // Retry the send for certain errors. #if defined(_WIN32) const bool shouldRetry = WSAGetLastError() == WSAEINTR; #else // !_WIN32 const bool shouldRetry = errno == EINTR; #endif // !_WIN32 if (!shouldRetry) { break; } threadYield(); // Yield between retries. } execHandle->setState(ExecState::Running); if (execHandle->trap()) { return false; // Aborted. } if (bytesRead < 0) { if (errno == EAGAIN) { *pErr = PlatformError::TcpTimeout; } else { *pErr = getTcpPlatformError(); } str->updateSize(0); m_state.store(TcpStreamState::Failed, std::memory_order_release); return false; } if (bytesRead == 0) { *pErr = PlatformError::StreamNoDataAvailable; str->updateSize(0); return false; } str->updateSize(bytesRead); return true; } auto writeString(ExecutorHandle* execHandle, PlatformError* pErr, StringRef* str) noexcept -> bool { if (unlikely(m_type != TcpStreamType::Connection)) { *pErr = PlatformError::StreamWriteNotSupported; return false; } if (str->getSize() == 0) { return true; } execHandle->setState(ExecState::Paused); int bytesWritten = -1; while (m_state.load(std::memory_order_acquire) == TcpStreamState::Valid) { bytesWritten = ::send(m_socket, str->getCharDataPtr(), str->getSize(), 0); if (bytesWritten >= 0) { break; // No error while writing. } // Retry the send for certain errors. #if defined(_WIN32) const bool shouldRetry = WSAGetLastError() == WSAEINTR; #else // !_WIN32 const bool shouldRetry = errno == EINTR; #endif // !_WIN32 if (!shouldRetry) { break; } threadYield(); // Yield between retries. } execHandle->setState(ExecState::Running); if (execHandle->trap()) { return false; // Aborted. } if (bytesWritten < 0) { *pErr = getTcpPlatformError(); m_state.store(TcpStreamState::Failed, std::memory_order_release); return false; } if (bytesWritten != static_cast<int>(str->getSize())) { *pErr = PlatformError::TcpUnknownError; return false; } return true; } auto setOpts(PlatformError* pErr, StreamOpts /*unused*/) noexcept -> bool { // TODO(bastian): Support non-blocking sockets. *pErr = PlatformError::StreamOptionsNotSupported; return false; } auto unsetOpts(PlatformError* pErr, StreamOpts /*unused*/) noexcept -> bool { // TODO(bastian): Support non-blocking sockets. *pErr = PlatformError::StreamOptionsNotSupported; return false; } auto acceptConnection(ExecutorHandle* execHandle, RefAllocator* alloc, PlatformError* pErr) -> TcpStreamRef* { if (unlikely(m_type != TcpStreamType::Server)) { *pErr = PlatformError::TcpInvalidServerSocket; return alloc->allocPlain<TcpStreamRef>(TcpStreamType::Connection, getInvalidSocket()); } // 'accept' call blocks so we mark ourselves as paused so the gc can trigger in the mean time. execHandle->setState(ExecState::Paused); SocketHandle sock = getInvalidSocket(); while (m_state.load(std::memory_order_acquire) == TcpStreamState::Valid) { // Accept a new connection from the socket. sock = ::accept(m_socket, nullptr, nullptr); if (isSocketValid(sock)) { break; // Valid connection accepted. } // Retry the accept for certain errors. bool shouldRetry = false; #if defined(_WIN32) switch (WSAGetLastError()) { case WSAEINTR: case WSAEWOULDBLOCK: case WSAECONNRESET: shouldRetry = true; break; } #else // !_WIN32 switch (errno) { case EINTR: case EAGAIN: case ECONNABORTED: shouldRetry = true; break; } #endif // !_WIN32 if (!shouldRetry) { break; } threadYield(); // Yield between retries. } // After resuming check if we should wait for gc (or if we are aborted). execHandle->setState(ExecState::Running); if (execHandle->trap()) { return nullptr; // Aborted. } if (!isSocketValid(sock)) { *pErr = getTcpPlatformError(); return alloc->allocPlain<TcpStreamRef>( TcpStreamType::Connection, sock, TcpStreamState::Failed); } configureSocket(sock); return alloc->allocPlain<TcpStreamRef>(TcpStreamType::Connection, sock); } private: TcpStreamType m_type; std::atomic<TcpStreamState> m_state; SocketHandle m_socket; inline explicit TcpStreamRef(TcpStreamType type, SocketHandle sock) noexcept : Ref{getKind()}, m_type{type}, m_state{TcpStreamState::Valid}, m_socket{sock} {} inline TcpStreamRef(TcpStreamType type, SocketHandle sock, TcpStreamState state) noexcept : Ref{getKind()}, m_type{type}, m_state{state}, m_socket{sock} {} }; inline auto configureSocket(SocketHandle sock) noexcept -> void { // Allow reusing the address, allows stopping and restarting the server without waiting for the // socket's wait-time to expire. int optVal = 1; ::setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, reinterpret_cast<char*>(&optVal), sizeof(int)); // Configure the receive timeout; #if defined(_WIN32) int timeout = receiveTimeoutSeconds * 1'000; ::setsockopt(sock, SOL_SOCKET, SO_RCVTIMEO, reinterpret_cast<char*>(&timeout), sizeof(timeout)); #else // !_WIN32 auto timeout = timeval{}; timeout.tv_sec = receiveTimeoutSeconds; timeout.tv_usec = 0; ::setsockopt(sock, SOL_SOCKET, SO_RCVTIMEO, reinterpret_cast<char*>(&timeout), sizeof(timeout)); #endif // !_WIN32 } inline auto tcpOpenConnection( const Settings* settings, ExecutorHandle* execHandle, RefAllocator* alloc, PlatformError* pErr, StringRef* address, IpAddressFamily family, int32_t port) noexcept -> TcpStreamRef* { if (!settings->socketsEnabled) { *pErr = PlatformError::FeatureNetworkNotEnabled; return alloc->allocPlain<TcpStreamRef>(TcpStreamType::Connection, getInvalidSocket()); } if (port < 0 || port > std::numeric_limits<uint16_t>::max()) { *pErr = PlatformError::TcpInvalidPort; return alloc->allocPlain<TcpStreamRef>(TcpStreamType::Connection, getInvalidSocket()); } if (!isIpFamilyValid(family)) { *pErr = PlatformError::TcpInvalidAddressFamily; return alloc->allocPlain<TcpStreamRef>(TcpStreamType::Connection, getInvalidSocket()); } if (address->getSize() != getIpAddressSize(family)) { *pErr = PlatformError::TcpInvalidAddress; return alloc->allocPlain<TcpStreamRef>(TcpStreamType::Connection, getInvalidSocket()); } // Open a socket. const auto sock = socket(getIpFamilyCode(family), SOCK_STREAM, 0); if (!isSocketValid(sock)) { *pErr = getTcpPlatformError(); return alloc->allocPlain<TcpStreamRef>(TcpStreamType::Connection, sock, TcpStreamState::Failed); } configureSocket(sock); // 'connect' call blocks so we mark ourselves as paused so the gc can trigger in the mean time. execHandle->setState(ExecState::Paused); int res = -1; while (true) { switch (family) { case IpAddressFamily::IpV4: { sockaddr_in addr = {}; addr.sin_family = AF_INET; addr.sin_port = htons(static_cast<uint16_t>(port)); std::memcpy(&addr.sin_addr, address->getCharDataPtr(), 4u); res = ::connect(sock, reinterpret_cast<sockaddr*>(&addr), sizeof(sockaddr_in)); } break; case IpAddressFamily::IpV6: { sockaddr_in6 addr = {}; addr.sin6_family = AF_INET6; addr.sin6_port = htons(static_cast<uint16_t>(port)); std::memcpy(&addr.sin6_addr, address->getCharDataPtr(), 16u); res = ::connect(sock, reinterpret_cast<sockaddr*>(&addr), sizeof(sockaddr_in6)); } break; } if (res == 0) { break; // Success. } bool shouldRetry = false; #if defined(_WIN32) switch (WSAGetLastError()) { case WSAEINTR: shouldRetry = true; break; } #else // !_WIN32 switch (errno) { case EINTR: case EAGAIN: shouldRetry = true; break; } #endif // !_WIN32 if (!shouldRetry) { break; // Not an error we should retry. } threadYield(); // Yield between retries. } // After resuming check if we should wait for gc (or if we are aborted). execHandle->setState(ExecState::Running); if (execHandle->trap()) { return nullptr; } if (res < 0) { *pErr = getTcpPlatformError(); return alloc->allocPlain<TcpStreamRef>(TcpStreamType::Connection, sock, TcpStreamState::Failed); } // Socket has successfully connected to the remote. return alloc->allocPlain<TcpStreamRef>(TcpStreamType::Connection, sock); } inline auto tcpStartServer( const Settings* settings, RefAllocator* alloc, PlatformError* pErr, IpAddressFamily family, int32_t port, int32_t backlog) noexcept -> TcpStreamRef* { if (!settings->socketsEnabled) { *pErr = PlatformError::FeatureNetworkNotEnabled; return alloc->allocPlain<TcpStreamRef>(TcpStreamType::Server, getInvalidSocket()); } if (port < 0 || port > std::numeric_limits<uint16_t>::max()) { *pErr = PlatformError::TcpInvalidPort; return alloc->allocPlain<TcpStreamRef>(TcpStreamType::Server, getInvalidSocket()); } if (backlog > std::numeric_limits<int16_t>::max()) { *pErr = PlatformError::TcpInvalidBacklog; return alloc->allocPlain<TcpStreamRef>(TcpStreamType::Server, getInvalidSocket()); } if (!isIpFamilyValid(family)) { *pErr = PlatformError::TcpInvalidAddressFamily; return alloc->allocPlain<TcpStreamRef>(TcpStreamType::Connection, getInvalidSocket()); } // Open a socket. const auto sock = ::socket(getIpFamilyCode(family), SOCK_STREAM, 0); if (!isSocketValid(sock)) { *pErr = PlatformError::TcpSocketCouldNotBeAllocated; return alloc->allocPlain<TcpStreamRef>(TcpStreamType::Server, sock, TcpStreamState::Failed); } configureSocket(sock); // Bind the socket to any ip address at the given port. int res = -1; switch (family) { case IpAddressFamily::IpV4: { sockaddr_in addr = {}; addr.sin_family = AF_INET; addr.sin_port = htons(static_cast<uint16_t>(port)); addr.sin_addr.s_addr = INADDR_ANY; res = ::bind(sock, reinterpret_cast<sockaddr*>(&addr), sizeof(sockaddr_in)); } break; case IpAddressFamily::IpV6: { sockaddr_in6 addr = {}; addr.sin6_family = AF_INET6; addr.sin6_port = htons(static_cast<uint16_t>(port)); addr.sin6_addr = in6addr_any; res = ::bind(sock, reinterpret_cast<sockaddr*>(&addr), sizeof(sockaddr_in6)); } break; } if (res < 0) { *pErr = getTcpPlatformError(); return alloc->allocPlain<TcpStreamRef>(TcpStreamType::Server, sock, TcpStreamState::Failed); } // Start listening for new connections. if (listen(sock, backlog < 0 ? defaultConnectionBacklog : backlog) < 0) { *pErr = getTcpPlatformError(); return alloc->allocPlain<TcpStreamRef>(TcpStreamType::Server, sock, TcpStreamState::Failed); } // Socket is now ready to accept connections. return alloc->allocPlain<TcpStreamRef>(TcpStreamType::Server, sock); } inline auto tcpAcceptConnection( ExecutorHandle* execHandle, RefAllocator* alloc, PlatformError* pErr, Value stream) noexcept -> TcpStreamRef* { auto* streamRef = stream.getRef(); if (streamRef->getKind() != RefKind::StreamTcp) { *pErr = PlatformError::TcpInvalidSocket; return alloc->allocPlain<TcpStreamRef>(TcpStreamType::Connection, getInvalidSocket()); } auto* tcpStreamRef = static_cast<TcpStreamRef*>(streamRef); if (!tcpStreamRef->isValid()) { *pErr = PlatformError::TcpInvalidSocket; return alloc->allocPlain<TcpStreamRef>(TcpStreamType::Connection, getInvalidSocket()); } return tcpStreamRef->acceptConnection(execHandle, alloc, pErr); } inline auto tcpShutdown(PlatformError* pErr, Value stream) noexcept -> bool { auto* streamRef = stream.getRef(); if (streamRef->getKind() != RefKind::StreamTcp) { *pErr = PlatformError::TcpInvalidSocket; return false; } auto* tcpStreamRef = static_cast<TcpStreamRef*>(streamRef); if (!tcpStreamRef->isValid()) { *pErr = PlatformError::TcpInvalidSocket; return false; } return tcpStreamRef->shutdown(); } inline auto ipLookupAddress( const Settings* settings, ExecutorHandle* execHandle, RefAllocator* alloc, PlatformError* pErr, StringRef* hostName, IpAddressFamily family) noexcept -> StringRef* { if (!settings->socketsEnabled) { *pErr = PlatformError::FeatureNetworkNotEnabled; return alloc->allocStr(0); } if (!isIpFamilyValid(family)) { *pErr = PlatformError::TcpInvalidAddressFamily; return alloc->allocStr(0); } addrinfo hints = {}; hints.ai_family = getIpFamilyCode(family); hints.ai_socktype = SOCK_STREAM; // 'getaddrinfo' call blocks so mark ourselves as paused so the gc can trigger in the mean time. execHandle->setState(ExecState::Paused); addrinfo* res = nullptr; auto resCode = ::getaddrinfo(hostName->getCharDataPtr(), nullptr, &hints, &res); // After resuming check if we should wait for gc (or if we are aborted). execHandle->setState(ExecState::Running); if (execHandle->trap()) { // Cleanup the addinfo's incase any where allocated. if (res) { ::freeaddrinfo(res); } return nullptr; // Aborted. } if (resCode != 0 || !res) { switch (resCode) { case EAI_FAMILY: case EAI_FAIL: case EAI_NONAME: *pErr = PlatformError::TcpAddressNotFound; break; default: *pErr = PlatformError::TcpUnknownError; break; } return alloc->allocStr(0); } // Note: 'getaddrinfo' returns a linked list of addresses sorted by priority, we return the // first from the requested family. do { if (res->ai_family == hints.ai_family) { void* addrData = nullptr; switch (family) { case IpAddressFamily::IpV4: addrData = &reinterpret_cast<sockaddr_in*>(res->ai_addr)->sin_addr; break; case IpAddressFamily::IpV6: addrData = &reinterpret_cast<sockaddr_in6*>(res->ai_addr)->sin6_addr; break; } auto* str = alloc->allocStr(getIpAddressSize(family)); std::memcpy(str->getCharDataPtr(), addrData, str->getSize()); ::freeaddrinfo(res); // Free the list of addresses received from 'getaddrinfo'. return str; } } while ((res = res->ai_next)); *pErr = PlatformError::TcpAddressNotFound; ::freeaddrinfo(res); // Free the list of addresses received from 'getaddrinfo'. return alloc->allocStr(0); } inline auto getTcpPlatformError() noexcept -> PlatformError { #if defined(_WIN32) switch (WSAGetLastError()) { case WSAEINPROGRESS: return PlatformError::TcpAlreadyInProcess; case WSAENETDOWN: return PlatformError::TcpNetworkDown; case WSAEMFILE: case WSAENOBUFS: return PlatformError::TcpSocketCouldNotBeAllocated; case WSAEACCES: return PlatformError::TcpNoAccess; case WSAEADDRINUSE: return PlatformError::TcpAddressInUse; case WSAEAFNOSUPPORT: return PlatformError::TcpAddressFamilyNotSupported; case WSAECONNREFUSED: return PlatformError::TcpConnectionRefused; case WSAETIMEDOUT: return PlatformError::TcpTimeout; case WSAEHOSTUNREACH: return PlatformError::TcpNetworkUnreachable; case WSAHOST_NOT_FOUND: return PlatformError::TcpAddressNotFound; case WSAENETRESET: case WSAECONNRESET: return PlatformError::TcpRemoteResetConnection; case WSAESHUTDOWN: case WSAENOTSOCK: return PlatformError::TcpSocketIsDead; } #else // !_WIN32 switch (errno) { case EALREADY: return PlatformError::TcpAlreadyInProcess; case ENETDOWN: case EPROTO: case EHOSTDOWN: return PlatformError::TcpNetworkDown; case ENETUNREACH: return PlatformError::TcpNetworkUnreachable; case EMFILE: case ENFILE: case ENOBUFS: case ENOMEM: return PlatformError::TcpSocketCouldNotBeAllocated; case EACCES: return PlatformError::TcpNoAccess; case EADDRINUSE: return PlatformError::TcpAddressInUse; case EADDRNOTAVAIL: return PlatformError::TcpAddressUnavailable; case EAFNOSUPPORT: return PlatformError::TcpAddressFamilyNotSupported; case ECONNREFUSED: return PlatformError::TcpConnectionRefused; case ETIMEDOUT: return PlatformError::TcpTimeout; case ECONNRESET: return PlatformError::TcpRemoteResetConnection; case EPIPE: case EPROTOTYPE: case EBADF: case EINVAL: return PlatformError::TcpSocketIsDead; } #endif // !_WIN32 return PlatformError::TcpUnknownError; } } // namespace vm::internal
30.877168
100
0.683671
BastianBlokland
0d74112cb0319a50464a9fbb6aa9e7569a8a3a27
4,950
inl
C++
unit_tests/api/cl_create_user_event_tests.inl
cmey/compute-runtime
118bad16dfe523724dfaf8016bfa6fbe6896348b
[ "MIT" ]
null
null
null
unit_tests/api/cl_create_user_event_tests.inl
cmey/compute-runtime
118bad16dfe523724dfaf8016bfa6fbe6896348b
[ "MIT" ]
null
null
null
unit_tests/api/cl_create_user_event_tests.inl
cmey/compute-runtime
118bad16dfe523724dfaf8016bfa6fbe6896348b
[ "MIT" ]
null
null
null
/* * Copyright (c) 2017 - 2018, Intel Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. */ #include "cl_api_tests.h" #include "runtime/context/context.h" using namespace OCLRT; typedef api_tests clCreateUserEventTests; namespace ULT { TEST_F(clCreateUserEventTests, createUserEventReturnsSuccess) { auto userEvent = clCreateUserEvent( pContext, &retVal); EXPECT_EQ(CL_SUCCESS, retVal); EXPECT_NE(nullptr, userEvent); retVal = clReleaseEvent(userEvent); EXPECT_EQ(CL_SUCCESS, retVal); } TEST_F(clCreateUserEventTests, nullContext) { auto userEvent = clCreateUserEvent( nullptr, &retVal); EXPECT_EQ(CL_INVALID_CONTEXT, retVal); EXPECT_EQ(nullptr, userEvent); } TEST_F(clCreateUserEventTests, getEventInfoForUserEventsCmdQueue) { auto userEvent = clCreateUserEvent( pContext, &retVal); size_t retSize; retVal = clGetEventInfo(userEvent, CL_EVENT_COMMAND_QUEUE, 0, nullptr, &retSize); ASSERT_EQ(CL_SUCCESS, retVal); EXPECT_EQ(sizeof(cl_command_queue), retSize); auto cmdQueue = reinterpret_cast<cl_command_queue>(static_cast<uintptr_t>(0xdeadbeaf)); retVal = clGetEventInfo(userEvent, CL_EVENT_COMMAND_QUEUE, retSize, &cmdQueue, 0); ASSERT_EQ(CL_SUCCESS, retVal); EXPECT_EQ(nullptr, cmdQueue); retVal = clGetEventInfo(userEvent, CL_EVENT_COMMAND_TYPE, 0, nullptr, &retSize); ASSERT_EQ(CL_SUCCESS, retVal); EXPECT_EQ(sizeof(cl_event_info), retSize); auto cmd_type = CL_COMMAND_SVM_UNMAP; retVal = clGetEventInfo(userEvent, CL_EVENT_COMMAND_TYPE, retSize, &cmd_type, 0); EXPECT_EQ(CL_COMMAND_USER, cmd_type); retVal = clReleaseEvent(userEvent); EXPECT_EQ(CL_SUCCESS, retVal); } TEST_F(clCreateUserEventTests, checkSetUserEventStatusReturnSuccessAndUpdatesStatus) { auto userEvent = clCreateUserEvent( pContext, &retVal); retVal = clSetUserEventStatus(userEvent, CL_COMPLETE); ASSERT_EQ(CL_SUCCESS, retVal); size_t retSize; retVal = clGetEventInfo(userEvent, CL_EVENT_COMMAND_EXECUTION_STATUS, 0, nullptr, &retSize); ASSERT_EQ(CL_SUCCESS, retVal); EXPECT_EQ(sizeof(cl_int), retSize); auto status = CL_SUBMITTED; retVal = clGetEventInfo(userEvent, CL_EVENT_COMMAND_EXECUTION_STATUS, retSize, &status, 0); ASSERT_EQ(CL_SUCCESS, retVal); ASSERT_EQ(CL_COMPLETE, status); retVal = clReleaseEvent(userEvent); EXPECT_EQ(CL_SUCCESS, retVal); } TEST_F(clCreateUserEventTests, userEventHasValidContext) { auto userEvent = clCreateUserEvent( pContext, &retVal); size_t retSize; retVal = clGetEventInfo(userEvent, CL_EVENT_CONTEXT, 0, nullptr, &retSize); ASSERT_EQ(CL_SUCCESS, retVal); EXPECT_EQ(sizeof(cl_context), retSize); cl_context oclContext; retVal = clGetEventInfo(userEvent, CL_EVENT_CONTEXT, retSize, &oclContext, 0); ASSERT_EQ(CL_SUCCESS, retVal); ASSERT_EQ(oclContext, pContext); retVal = clReleaseEvent(userEvent); EXPECT_EQ(CL_SUCCESS, retVal); } TEST_F(clCreateUserEventTests, WaitForUserEventThatIsCLCompleteReturnsImmidietaly) { auto userEvent = clCreateUserEvent( pContext, &retVal); retVal = clSetUserEventStatus(userEvent, CL_COMPLETE); ASSERT_EQ(CL_SUCCESS, retVal); retVal = clWaitForEvents(1, &userEvent); ASSERT_EQ(CL_SUCCESS, retVal); retVal = clReleaseEvent(userEvent); EXPECT_EQ(CL_SUCCESS, retVal); } TEST_F(clCreateUserEventTests, WaitForUserEventThatIsTerminatedReturnsImmidietaly) { auto userEvent = clCreateUserEvent( pContext, &retVal); retVal = clSetUserEventStatus(userEvent, -1); ASSERT_EQ(CL_SUCCESS, retVal); retVal = clWaitForEvents(1, &userEvent); ASSERT_EQ(CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST, retVal); retVal = clReleaseEvent(userEvent); EXPECT_EQ(CL_SUCCESS, retVal); } } // namespace ULT
34.375
96
0.740808
cmey
0d752d0c5abd888642015934a7ef73606782e71c
6,650
cpp
C++
SharingFaces/src/main.cpp
jjzhang166/SharingFaces
d890fca21cc766c8838d79410366bab8298ea941
[ "MIT" ]
null
null
null
SharingFaces/src/main.cpp
jjzhang166/SharingFaces
d890fca21cc766c8838d79410366bab8298ea941
[ "MIT" ]
null
null
null
SharingFaces/src/main.cpp
jjzhang166/SharingFaces
d890fca21cc766c8838d79410366bab8298ea941
[ "MIT" ]
null
null
null
#define INSTALL //#define USE_WHITE_POINT #include "ofMain.h" #include "SharingFacesUtils.h" const int installWidth = 1080, installHeight = 1920; class ofApp : public ofBaseApp { public: #ifdef INSTALL static const int camWidth = 1920, camHeight = 1080; ofxBlackMagic cam; #else static const int camWidth = 1280, camHeight = 720; ofVideoGrabber cam; #endif ofShader shader; FaceOverlay overlay; ofxFaceTrackerThreaded tracker; BinnedData<FaceTrackerData> data; FaceCompare faceCompare; MultiThreadedImageSaver imageSaver; bool useBlackMagic; bool rotate; int binSize; float neighborRadius; int neighborCount; ofImage rotated; FaceTrackerData nearestData; string lastLabel; ofImage similar; ofVec3f whitePoint; Hysteresis presence; FadeTimer presenceFade, faceFade; vector< pair<ofVec2f, FaceTrackerData> > currentData; void setup() { useSharedData(); #ifdef INSTALL ofLogToFile("../local/log.txt"); #endif loadSettings(); tracker.setup(); tracker.setHaarMinSize(175); tracker.setRescale(.25); tracker.setIterations(3); tracker.setTolerance(2); tracker.setClamp(3); tracker.setAttempts(4); #ifdef INSTALL cam.setup(camWidth, camHeight, 30); #else cam.setup(camWidth, camHeight, false); #endif if(rotate) { data.setup(camHeight, camWidth, binSize); } else { data.setup(camWidth, camHeight, binSize); } loadMetadata(data); presence.setDelay(0, 4); presenceFade.setLength(4, .1); presenceFade.start(); faceFade.setLength(0, 30); faceFade.start(); shader.load("shaders/colorbalance.vs", "shaders/colorbalance.fs"); ofDisableAntiAliasing(); glPointSize(2); ofSetLineWidth(3); ofSetLogLevel(OF_LOG_VERBOSE); } void exit() { imageSaver.exit(); tracker.stopThread(); #ifdef INSTALL cam.close(); #endif } void loadSettings() { #ifdef INSTALL rotate = true; #else rotate = false; #endif binSize = 10; neighborRadius = 20; neighborCount = 100; } void checkScreenSize() { if(ofGetWindowHeight() != installHeight || ofGetWindowWidth() != installWidth) { ofSetFullscreen(false); ofSetFullscreen(true); } } void update() { #ifdef INSTALL checkScreenSize(); if(cam.update()) { ofPixels& pixels = cam.getColorPixels(); pixels.setImageType(OF_IMAGE_COLOR); // drop alpha #else cam.update(); if(cam.isFrameNew()) { ofPixels& pixels = cam.getPixels(); #endif if(rotate) { ofxCv::transpose(pixels, rotated); } else { ofxCv::copy(pixels, rotated); } Mat rotatedMat = toCv(rotated); if(tracker.update(rotatedMat)) { ofVec2f position = tracker.getPosition(); vector<FaceTrackerData*> neighbors = data.getNeighborsCount(position, neighborCount); FaceTrackerData curData; curData.load(tracker); if(!neighbors.empty()) { nearestData = *faceCompare.nearest(curData, neighbors); if(nearestData.label != lastLabel) { similar.load(nearestData.getImageFilename()); #ifdef USE_WHITE_POINT whitePoint = getWhitePoint(similar); #endif } lastLabel = nearestData.label; } if(faceCompare.different(curData, currentData) && faceCompare.different(curData, neighbors)) { saveFace(curData, rotated); currentData.push_back(pair<ofVec2f, FaceTrackerData>(position, curData)); } } presence.update(tracker.getFound()); if(presence.wasTriggered()) { presenceFade.stop(); faceFade.stop(); } if(presence.wasUntriggered()) { for(int i = 0; i < currentData.size(); i++) { data.add(currentData[i].first, currentData[i].second); } currentData.clear(); presenceFade.start(); faceFade.start(); } } } void draw() { ofBackground(255); CGDisplayHideCursor(NULL); ofSetColor(255); if(similar.isAllocated()) { #ifdef USE_WHITE_POINT shader.begin(); shader.setUniformTexture("tex", similar, 0); shader.setUniform3fv("whitePoint", (float*) &whitePoint); similar.draw(0, 0); shader.end(); #else similar.draw(0, 0); #endif } ofPushStyle(); if(presenceFade.getActive()) { ofSetColor(0, ofMap(presenceFade.get(), 0, 1, 0, 128)); ofFill(); ofDrawRectangle(0, 0, ofGetWidth(), ofGetHeight()); ofSetColor(255, ofMap(presenceFade.get(), 0, 1, 0, 32)); data.drawBins(); ofSetColor(255, ofMap(presenceFade.get(), 0, 1, 0, 64)); data.drawData(); } ofSetColor(255, 64); ofNoFill(); if(!tracker.getFound()) { ofDrawCircle(tracker.getPosition(), 10); } ofSetColor(255, 96 * faceFade.get()); overlay.draw(tracker); ofPopStyle(); #ifndef INSTALL drawFramerate(); #endif } void keyPressed(int key) { if(key == 'f') { ofToggleFullscreen(); } } void saveFace(FaceTrackerData& data, ofImage& img) { string basePath = ofGetTimestampString("%Y.%m.%d/%H.%M.%S.%i"); data.save("metadata/" + basePath + ".face"); imageSaver.saveImage(img.getPixels(), data.getImageFilename()); } }; #include "ofAppGlutWindow.h" int main() { #ifdef INSTALL ofSetupOpenGL(installWidth, installHeight, OF_FULLSCREEN); #else ofSetupOpenGL(1280, 720, OF_WINDOW); #endif ofRunApp(new ofApp()); }
30.930233
114
0.528571
jjzhang166
0d75976d5a721eda0c4153e5b1a0170f2675a3f5
926
cpp
C++
examples/CustomDemo/CustomServer/CustomServantImp.cpp
cSingleboy/TarsCpp
17b228b660d540baa1a93215fc007c5131a2fc68
[ "BSD-3-Clause" ]
386
2018-09-11T06:17:10.000Z
2022-03-31T05:59:41.000Z
examples/CustomDemo/CustomServer/CustomServantImp.cpp
cSingleboy/TarsCpp
17b228b660d540baa1a93215fc007c5131a2fc68
[ "BSD-3-Clause" ]
128
2018-09-12T03:43:33.000Z
2022-03-24T10:03:54.000Z
examples/CustomDemo/CustomServer/CustomServantImp.cpp
cSingleboy/TarsCpp
17b228b660d540baa1a93215fc007c5131a2fc68
[ "BSD-3-Clause" ]
259
2018-09-19T08:50:37.000Z
2022-03-11T07:17:56.000Z
#include "CustomServantImp.h" #include "servant/Application.h" using namespace std; ////////////////////////////////////////////////////// void CustomServantImp::initialize() { //initialize servant here: //... } ////////////////////////////////////////////////////// void CustomServantImp::destroy() { //destroy servant here: //... } int CustomServantImp::doRequest(tars::TarsCurrentPtr current, vector<char>& response) { //Return to the data package requested by the client itself, that is, the original package return (4-byte length + 4-byte request + buffer) const vector<char>& request = current->getRequestBuffer(); response = request; // cout << "doRequest: requestId:" << current->getRequestId() << ", funcName:" << current->getFuncName() << endl; return 0; } int CustomServantImp::doClose(TarsCurrentPtr current) { LOG->debug() << "close ip: " << current->getIp() << endl; return 0; }
23.74359
140
0.609071
cSingleboy
0d7d9e197253862c736a2348f2acca71e4567600
261
hpp
C++
tests/memory_resource_headers.hpp
olegpublicprofile/stdeasy
9f4ab01219f49ebab1983b4263d4dd6d3dc94bf0
[ "MIT" ]
5
2021-09-27T09:24:39.000Z
2021-10-14T12:34:46.000Z
tests/memory_resource_headers.hpp
olegpublicprofile/stdeasy
9f4ab01219f49ebab1983b4263d4dd6d3dc94bf0
[ "MIT" ]
null
null
null
tests/memory_resource_headers.hpp
olegpublicprofile/stdeasy
9f4ab01219f49ebab1983b4263d4dd6d3dc94bf0
[ "MIT" ]
null
null
null
#pragma once #include <stdeasy/memory_resource> #include <stdeasy/monotonic_buffer_resource> #include <stdeasy/polymorphic_allocator> #include <stdeasy/pool_options> #include <stdeasy/synchronized_pool_resource> #include <stdeasy/unsynchronized_pool_resource>
29
47
0.846743
olegpublicprofile
0d7f9a98ace57bdb849fc980f98d39ec061c849e
2,911
hpp
C++
external/swak/libraries/swakParsers/helpers/DebugOStream.hpp
MrAwesomeRocks/caelus-cml
55b6dc5ba47d0e95c07412d9446ac72ac11d7fd7
[ "mpich2" ]
null
null
null
external/swak/libraries/swakParsers/helpers/DebugOStream.hpp
MrAwesomeRocks/caelus-cml
55b6dc5ba47d0e95c07412d9446ac72ac11d7fd7
[ "mpich2" ]
null
null
null
external/swak/libraries/swakParsers/helpers/DebugOStream.hpp
MrAwesomeRocks/caelus-cml
55b6dc5ba47d0e95c07412d9446ac72ac11d7fd7
[ "mpich2" ]
null
null
null
/*---------------------------------------------------------------------------*\ Copyright: ICE Stroemungsfoschungs GmbH Copyright (C) 1991-2008 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is based on CAELUS. CAELUS 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 3 of the License, or (at your option) any later version. CAELUS is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with CAELUS. If not, see <http://www.gnu.org/licenses/>. Class CML::DebugOStream Description Stream that prefixes a class name and an adress to the output to make distinguishing output from different objects easier. Usually used through two preprocessor macros: Dbug : for parallel runs only outputs on the master processor Pbug : for parallel runs outputs on all processors and prefixes the processor number SourceFiles DebugOStream.cpp Contributors/Copyright: 2013-2014 Bernhard F.W. Gschaider <bgschaid@ice-sf.at> \*---------------------------------------------------------------------------*/ #ifndef DebugOStream_H #define DebugOStream_H #include "Pstream.hpp" #include "prefixOSstream.hpp" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace CML { /*---------------------------------------------------------------------------*\ Class DebugOStream Declaration \*---------------------------------------------------------------------------*/ class DebugOStream : public prefixOSstream { public: //- Constructor DebugOStream( ostream &o, const word &typeName, const void *object, const bool parallel=false ); DebugOStream &operator()() { return *this; } }; // to be used as "streams" #define Dbug if(debug && Pstream::master()) DebugOStream(cout,typeName,this)() #define Pbug if(debug) DebugOStream(cout,typeName,this,true)() // for static methods #define Sbug if(debug) DebugOStream(cout,typeName,reinterpret_cast<const void *>(NULL),true)() //- get the value of the pointer as a word word getHex(const void *ptr); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace CML // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #endif // ************************************************************************* //
31.301075
94
0.518722
MrAwesomeRocks
0d809854cbe613370439ebdcefa59e805b3642c0
11,783
cc
C++
tests/multi-test.cc
maxk-org/vdds
015473498661cb8f06868cce2dc4519a6452b861
[ "BSD-3-Clause" ]
null
null
null
tests/multi-test.cc
maxk-org/vdds
015473498661cb8f06868cce2dc4519a6452b861
[ "BSD-3-Clause" ]
null
null
null
tests/multi-test.cc
maxk-org/vdds
015473498661cb8f06868cce2dc4519a6452b861
[ "BSD-3-Clause" ]
null
null
null
// Copyright (c) 2021, Qualcomm Innovation Center, Inc. All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // // 1. Redistributions of source code must retain the above copyright notice, // this list of conditions and the following disclaimer. // // 2. Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // // 3. Neither the name of the copyright holder nor the names of its contributors // may be used to endorse or promote products derived from this software // without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. // // SPDX-License-Identifier: BSD-3-Clause #include "vdds/domain.hpp" #include "vdds/pub.hpp" #include "vdds/sub.hpp" #include "vdds/query.hpp" #include "vdds/utils.hpp" #include "test-skell.hpp" #include <hogl/fmt/format.h> #include <fstream> // Multi Pub/Sub test // Data types struct timesync_msg : vdds::data { static const char* data_type; struct payload_t { uint64_t ptp_timestamp; uint64_t gps_timestamp; }; payload_t* payload() { return reinterpret_cast<payload_t*>(&this->plain); } const payload_t* payload() const { return reinterpret_cast<const payload_t*>(&this->plain); } uint64_t ptp_timestamp() const { return payload()->ptp_timestamp; } uint64_t gps_timestamp() const { return payload()->gps_timestamp; } }; struct sensor_msg : vdds::data { static const char* data_type; struct payload_t { uint64_t sample[4]; }; payload_t* payload() { return reinterpret_cast<payload_t*>(&this->plain); } }; struct detector_msg : vdds::data { static const char* data_type; struct payload_t { uint64_t avg[4]; }; payload_t* payload() { return reinterpret_cast<payload_t*>(&this->plain); } }; // Data type names const char* timesync_msg::data_type = "vdds.test.data.timesync"; const char* sensor_msg::data_type = "vdds.test.data.sensor"; const char* detector_msg::data_type = "vdds.test.data.detector"; // Simple thread + loop class engine { public: std::thread _thread; std::atomic_bool _killed; virtual void loop() = 0; void start() { _killed = false; _thread = std::thread([&](){ loop(); }); } void kill() { _killed = true; _thread.join(); } }; // Timer class timesync : public engine { private: std::string _name; // timer instance name (used for threads, tls, etc) hogl::area* _area; vdds::pub<timesync_msg> _pub; void loop() { hogl::tls tls(_name.c_str()); hogl::post(_area, _area->INFO, "timer %s started", _name); // Publish timesync every 20msec while (!_killed) { timesync_msg m; m.timestamp = tls.ring()->timestamp().to_nsec(); auto p = m.payload(); p->ptp_timestamp = m.timestamp - 123456; p->gps_timestamp = m.timestamp - 999999; hogl::post(_area, _area->INFO, hogl::arg_gstr("%s timesync: timestamp %llu: ptp %llu gps %llu"), _name, m.timestamp, m.ptp_timestamp(), m.gps_timestamp()); // Publish timesync data _pub.push(m); std::this_thread::sleep_for(std::chrono::milliseconds(10)); } hogl::post(_area, _area->INFO, "timer %s stoped", _name); } public: timesync(vdds::domain& vd, const std::string& name) : _name(name), _area(hogl::add_area("TIMESYNC")), _pub(vd, _name, "/test/timesync") // publish {} }; // Driver class sensor_drv : public engine { private: std::string _sensor_name; // sensor name (used for topics, etc) std::string _name; // driver instance name (used for threads, tls, etc) hogl::area* _area; vdds::pub<sensor_msg> _pub; void loop() { hogl::tls tls(_name.c_str()); hogl::post(_area, _area->INFO, "driver %s started", _name); // Publish new data every 10msec while (!_killed) { sensor_msg m; m.timestamp = tls.ring()->timestamp().to_nsec(); auto p = m.payload(); p->sample[0] = 1; p->sample[1] = 2; p->sample[2] = 3; p->sample[3] = 4; hogl::post(_area, _area->INFO, hogl::arg_gstr("%s new-data: timestamp %llu: %u %u %u %u"), _name, m.timestamp, p->sample[0], p->sample[1], p->sample[2], p->sample[3]); // Publish sensor data _pub.push(m); std::this_thread::sleep_for(std::chrono::milliseconds(10)); } hogl::post(_area, _area->INFO, "driver %s stoped", _name); } public: sensor_drv(vdds::domain& vd, const std::string& sensor_name) : _sensor_name(sensor_name), _name(fmt::format("DRV-{}", sensor_name)), _area(hogl::add_area("SENSOR-DRV")), _pub(vd, _name, fmt::format("/test/sensor/data/{}", sensor_name)) // publish {} }; // Detector class detector : public engine { private: std::string _name; // instance name (thread, tls, etc) hogl::area* _area; vdds::pub<detector_msg> _pub_det; using sensor_sub = vdds::sub<sensor_msg>; using unique_sub = std::unique_ptr<sensor_sub>; vdds::notifier_cv _nf; std::vector<unique_sub> _sub_sens; void process(sensor_msg& sm) { detector_msg dm; auto sp = sm.payload(); auto dp = dm.payload(); hogl::post(_area, _area->INFO, hogl::arg_gstr("%s new-data: timestamp %llu: %u %u %u %u"), _name, sm.timestamp, sp->sample[0], sp->sample[1], sp->sample[2], sp->sample[3]); // Generate new detection dm.timestamp = sm.timestamp; dp->avg[0] = (sp->sample[0] + sp->sample[1] + sp->sample[2] + sp->sample[3]) / 4; hogl::post(_area, _area->INFO, "%s detection seqno %llu timestamp %llu: avg %llu", _name, sm.seqno, sm.timestamp, dp->avg[0]); _pub_det.push(dm); } void loop() { hogl::tls tls(_name.c_str()); hogl::post(_area, _area->INFO, "detector %s started", _name); while (!_killed) { // Wait for data _nf.wait_for(std::chrono::milliseconds(100)); // Process sensor_msg sm; for (auto &ss : _sub_sens) { while (ss->pop(sm)) process(sm); } } hogl::post(_area, _area->INFO, "detector %s stoped", _name); } public: detector(vdds::domain& vd, const std::string& name, std::vector<std::string> sensor_names) : _name(name), _area(hogl::add_area("DETECTOR")), _pub_det(vd, name, fmt::format("/test/detector/data/{}", name)) { // Subscribe to sensors for (auto& s : sensor_names) _sub_sens.push_back( std::make_unique<sensor_sub>(vd, name, fmt::format("/test/sensor/data/{}", s), 16, &_nf) ); } }; // Controller class controller : public engine { private: std::string _name; // instance name (thread, tls, etc) hogl::area* _area; using detector_sub = vdds::sub<detector_msg>; using unique_detsub = std::unique_ptr<detector_sub>; using sensor_sub = vdds::sub<sensor_msg>; using unique_sensub = std::unique_ptr<sensor_sub>; std::vector<unique_detsub> _sub_dets; // detector subscriptions std::vector<unique_sensub> _sub_sens; // sensor subscriptions vdds::notifier_cv _nf_ts; vdds::sub<timesync_msg> _sub_ts; void process(unique_detsub& ds, detector_msg& dm) { auto dp = dm.payload(); hogl::post(_area, _area->INFO, hogl::arg_gstr("%s new detector %s data: timestamp %llu: %u"), _name, ds->topic()->name(), dm.timestamp, dp->avg[0]); } void process(unique_sensub& ss, sensor_msg& sm) { auto sp = sm.payload(); hogl::post(_area, _area->INFO, hogl::arg_gstr("%s new sensor data: timestamp %llu: %u %u %u %u"), _name, ss->topic()->name(), sm.timestamp, sp->sample[0], sp->sample[1], sp->sample[2], sp->sample[3]); } void process(timesync_msg& tm) { auto tp = tm.payload(); hogl::post(_area, _area->INFO, hogl::arg_gstr("%s timesync: timestamp %llu: ptp %llu gps %llu"), _name, tm.timestamp, tp->ptp_timestamp, tp->gps_timestamp); } void loop() { hogl::tls tls(_name.c_str()); hogl::post(_area, _area->INFO, "controller %s started", _name); while (!_killed) { // Wait for timesync _nf_ts.wait_for(std::chrono::milliseconds(100)); hogl::post(_area, _area->TRACE, "control loop %s # ph:B", _name); // Process timesync data timesync_msg tm; while (_sub_ts.pop(tm)) process(tm); // Process sensor data sensor_msg sm; for (auto &ss : _sub_sens) { while (ss->pop(sm)) process(ss, sm); } // Process detector data detector_msg dm; for (auto &ds : _sub_dets) { while (ds->pop(dm)) process(ds, dm); } hogl::post(_area, _area->TRACE, "control loop %s # ph:E", _name); } hogl::post(_area, _area->INFO, "controller %s stoped", _name); } public: controller(vdds::domain& vd, const std::string& name, std::vector<std::string> sensor_names, std::vector<std::string> detector_names) : _name(name), _area(hogl::add_area("CONTROL")), _sub_ts(vd, name, "/test/timesync", 2, &_nf_ts) // timesync sub uses CV notifier { // Subscribe to sensors for (auto& s : sensor_names) _sub_sens.push_back( std::make_unique<sensor_sub>(vd, name, fmt::format("/test/sensor/data/{}", s), 32) ); // Subscribe to detectors for (auto& s : detector_names) _sub_dets.push_back( std::make_unique<detector_sub>(vd, name, fmt::format("/test/detector/data/{}", s), 32) ); // No notifier for sensor and detector subs, but deeper queues, // we're going to process them when we get timesync. } }; bool run_test() { hogl::post(area, area->INFO, "Starting test"); // Create default domain vdds::domain vd("MAIN"); // Vector of drivers using unique_drv = std::unique_ptr<sensor_drv>; std::vector<unique_drv> drivers; // Create drivers std::vector<std::string> sensor_names = { "CAM0", "CAM1", "CAM2", "CAM3", "CAM4" }; for (auto& s: sensor_names) drivers.push_back( std::make_unique<sensor_drv>(vd, s) ); vd.dump(); // Create detectors detector det0(vd, "DET0", { "CAM0", "CAM1", "CAM4" }); detector det1(vd, "DET1", { "CAM0", "CAM2", "CAM3", "CAM4" }); // Create controllers controller ctrl0(vd, "CTRL0", { "CAM0" }, { "DET0", "DET1" }); controller ctrl1(vd, "CTRL1", { "CAM0", "CAM2" }, { "DET1" }); // Create timesyncs. // We don't even start the second one it's created simply to register second publisher. timesync sync0(vd, "SYNC0"); timesync sync1(vd, "SYNC1"); vd.dump(); // Start everything up ctrl0.start(); ctrl1.start(); det0.start(); det1.start(); for (auto& drv: drivers) drv->start(); sync0.start(); // Let things run for 2 seconds std::this_thread::sleep_for(std::chrono::seconds( optmap["duration"].as<unsigned int>() )); // Stop everything sync0.kill(); for (auto& drv: drivers) drv->kill(); det0.kill(); det1.kill(); ctrl0.kill(); ctrl1.kill(); vd.dump(); // Save domain as .dot for graphviz auto ss = std::ofstream("multi-test.dot", std::ofstream::trunc); vdds::utils::to_dot(vd, ss); // Simple query for one sensor vdds::query::domain_info di; vd.query(di, { "/test/sensor/data/CAM0", "any" }); hogl::post(area, area->INFO, "topic %s push_count %llu", di.topics[0].name, di.topics[0].push_count); // Dump all topics that carry sensor data vd.dump({ "any", sensor_msg::data_type }); return true; }
28.324519
115
0.671985
maxk-org
0d82900198357ad2693a24a411ddb415aad4b6a4
584
hpp
C++
src/JImage.hpp
jildertviet/ofxJVisuals
878c5b0e7a7dda49ddb71b3f5d19c13987706a73
[ "MIT" ]
null
null
null
src/JImage.hpp
jildertviet/ofxJVisuals
878c5b0e7a7dda49ddb71b3f5d19c13987706a73
[ "MIT" ]
6
2021-10-16T07:10:04.000Z
2021-12-26T13:23:54.000Z
src/JImage.hpp
jildertviet/ofxJVisuals
878c5b0e7a7dda49ddb71b3f5d19c13987706a73
[ "MIT" ]
null
null
null
// // Image.hpp // Bas // // Created by Jildert Viet on 18-03-16. // // #ifndef Image_hpp #define Image_hpp #include <stdio.h> #include "ofMain.h" #include "Event.hpp" class JImage: public Event{ enum DrawMode{ DEFAULT }; public: JImage(string filename, ofVec2f loc = ofVec2f(0,0)); JImage(){}; ofImage image; void display(); void specificFunction(); DrawMode drawMode = JImage::DrawMode::DEFAULT; bool loadImage(string path); bool bLoadSucces = false; }; #endif /* JImage_hpp */
16.685714
57
0.583904
jildertviet
0d83dd1b064eb844e078bc048689083496879434
618
cpp
C++
src/PhysXPlugin/PhysXPlugin.cpp
roto5296/choreonoid
ffe12df8db71e32aea18833afb80dffc42c373d0
[ "MIT" ]
91
2015-01-29T11:03:42.000Z
2022-02-13T07:34:04.000Z
src/PhysXPlugin/PhysXPlugin.cpp
roto5296/choreonoid
ffe12df8db71e32aea18833afb80dffc42c373d0
[ "MIT" ]
213
2015-01-26T06:21:15.000Z
2020-07-23T05:51:30.000Z
src/PhysXPlugin/PhysXPlugin.cpp
roto5296/choreonoid
ffe12df8db71e32aea18833afb80dffc42c373d0
[ "MIT" ]
71
2015-01-06T02:32:05.000Z
2020-12-01T03:42:25.000Z
/*! @file @author Shizuko Hattori */ #include "PhysXSimulatorItem.h" #include <cnoid/Plugin> using namespace std; using namespace cnoid; namespace { class PhysXPlugin : public Plugin { public: PhysXPlugin() : Plugin("PhysX") { require("Body"); } virtual ~PhysXPlugin() { } virtual bool initialize() { PhysXSimulatorItem::initialize(this); return true; } virtual bool finalize() { return true; } }; } CNOID_IMPLEMENT_PLUGIN_ENTRY(PhysXPlugin);
14.714286
49
0.532362
roto5296
0d8e396b45379595ebf886d4f0e618d0f74e0e4f
283
cpp
C++
src/ham/libham/dbus-dispatcher.cpp
project-arlo/sonic-mgmt-framework
562cd84ff3fec9ca705c7df621742f2daa61ce71
[ "Apache-2.0" ]
7
2019-10-17T06:12:02.000Z
2021-09-08T11:16:19.000Z
src/ham/libham/dbus-dispatcher.cpp
noolex/sonic-mgmt-framework
5493889adc47fc584b04dca1a0cc0a2007211df4
[ "Apache-2.0" ]
207
2019-06-24T04:48:11.000Z
2020-05-06T05:51:37.000Z
src/ham/libham/dbus-dispatcher.cpp
noolex/sonic-mgmt-framework
5493889adc47fc584b04dca1a0cc0a2007211df4
[ "Apache-2.0" ]
20
2019-06-27T19:24:45.000Z
2021-07-15T21:12:30.000Z
#include "dbus-proxy.h" // get_dispatcher() prototype // The dispatcher is a "main loop" construct that handles // DBus messages. This should be defined as a singleton. DBus::BusDispatcher * get_dispatcher() { static DBus::BusDispatcher dispatcher; return &dispatcher; }
23.583333
57
0.731449
project-arlo
0d8fe835f3d09c533a1b982dd950ec697e9208eb
188
cpp
C++
test.cpp
fobes/sfmath_tests
bc6b2f2a42b3392b421f042380b673d1da8b72f8
[ "Apache-2.0" ]
null
null
null
test.cpp
fobes/sfmath_tests
bc6b2f2a42b3392b421f042380b673d1da8b72f8
[ "Apache-2.0" ]
null
null
null
test.cpp
fobes/sfmath_tests
bc6b2f2a42b3392b421f042380b673d1da8b72f8
[ "Apache-2.0" ]
null
null
null
#include "pch.h" #include "../sfmath/CSfmathMatrix.h" TEST(TestCaseName, TestName) { CSfmathMatrix mtx; for (unsigned n = 0; n < 1000000; n++) { //CSfmathMatrix::Multiplication } }
17.090909
39
0.675532
fobes
0d92cd8e21f307d777b4560c55606afa00122de9
1,288
cpp
C++
TypeTraits/TypeTraits.cpp
jbcoe/CppSandbox
574dc31bbd3640a8cf1b7642c4a449bee687cce5
[ "MIT" ]
7
2015-01-18T13:30:09.000Z
2021-08-21T19:50:26.000Z
TypeTraits/TypeTraits.cpp
jbcoe/CppSandbox
574dc31bbd3640a8cf1b7642c4a449bee687cce5
[ "MIT" ]
1
2016-03-13T21:26:37.000Z
2016-03-13T21:26:37.000Z
TypeTraits/TypeTraits.cpp
jbcoe/CppSandbox
574dc31bbd3640a8cf1b7642c4a449bee687cce5
[ "MIT" ]
1
2016-02-16T04:56:25.000Z
2016-02-16T04:56:25.000Z
#include <iostream> #include <sstream> #include <type_traits> class CEmptyClass { public: static constexpr const char* name = "CEmptyClass"; }; class CDerivedClass : public CEmptyClass { public: static constexpr const char* name = "CDerivedClass"; }; template <typename T> std::string TypeName() { std::stringstream ss; if (std::is_const<typename std::remove_reference< typename std::remove_pointer<T>::type>::type>::value) { ss << "const "; } ss << std::remove_pointer< typename std::remove_reference<T>::type>::type::name; if (std::is_pointer<T>::value) { ss << '*'; } if (std::is_reference<T>::value) { ss << '&'; } return std::move(ss.str()); } template <typename A_t, typename B_t> void IsSame() { std::cout << "Is '" << TypeName<A_t>() << "' the same type as '" << TypeName<B_t>() << "' : " << std::is_same<A_t, B_t>::value << std::endl; } template <typename A_t> void IsConst() { std::cout << "Is '" << TypeName<A_t>() << "' constant : " << std::is_const<A_t>::value << std::endl; } int main(int argc, char* argv[]) { IsSame<CEmptyClass, CDerivedClass>(); IsSame<const CEmptyClass&, CEmptyClass>(); IsSame<CEmptyClass, CEmptyClass>(); IsConst<const CEmptyClass&>(); }
20.125
73
0.608696
jbcoe
0d93267b7bc8a0ddf9174959f3e000ddd43d3427
26,514
cpp
C++
test/data/sample.cpp
viridia/coda
40671b655c2d2368bdc5f3a9ae1a45b57305f7a3
[ "Apache-2.0" ]
1
2017-09-06T16:50:13.000Z
2017-09-06T16:50:13.000Z
test/data/sample.cpp
viridia/coda
40671b655c2d2368bdc5f3a9ae1a45b57305f7a3
[ "Apache-2.0" ]
null
null
null
test/data/sample.cpp
viridia/coda
40671b655c2d2368bdc5f3a9ae1a45b57305f7a3
[ "Apache-2.0" ]
null
null
null
// ============================================================================ // Generated by codagen from sample.coda.coda. DO NOT EDIT! // ============================================================================ #include "coda/types.h" #include "coda/io/codec.h" #include "sample.h" #include "coda/runtime/descriptors_static.h" namespace sample { coda::descriptors::FieldOptions _options0 = coda::descriptors::freeze(coda::descriptors::FieldOptions().setFixed(true)); coda::descriptors::FileOptions _options1 = coda::descriptors::freeze(coda::descriptors::FileOptions().putPackage("python", "sample").putPackage("java", "sample").putPackage("cpp", "sample").putOuterClass("java", "Sample")); // ============================================================================ // E // ============================================================================ static coda::descriptors::EnumDescriptor::Value E_Value_E0("E0", E_E0); static coda::descriptors::EnumDescriptor::Value E_Value_E1("E1", E_E1); static coda::descriptors::EnumDescriptor::Value E_Value_E2("E2", E_E2); static coda::descriptors::EnumDescriptor::Value* E_Values[] = { &E_Value_E0, &E_Value_E1, &E_Value_E2, }; coda::descriptors::EnumDescriptor E_DESCRIPTOR( "E", coda::descriptors::EnumOptions::DEFAULT_INSTANCE, E_Values ); // ============================================================================ // S1 // ============================================================================ coda::descriptors::FieldDescriptor S1::Field_scalarBoolean( "scalarBoolean", 1, coda::types::Boolean::DESCRIPTOR, coda::descriptors::FieldOptions::DEFAULT_INSTANCE, CODA_OFFSET_OF(S1, _scalarBoolean), S1::HAS_SCALAR_BOOLEAN); coda::descriptors::FieldDescriptor S1::Field_scalarI16( "scalarI16", 2, coda::types::Integer16::DESCRIPTOR, coda::descriptors::FieldOptions::DEFAULT_INSTANCE, CODA_OFFSET_OF(S1, _scalarI16), S1::HAS_SCALAR_I16); coda::descriptors::FieldDescriptor S1::Field_scalarI32( "scalarI32", 3, coda::types::Integer32::DESCRIPTOR, coda::descriptors::FieldOptions::DEFAULT_INSTANCE, CODA_OFFSET_OF(S1, _scalarI32), S1::HAS_SCALAR_I32); coda::descriptors::FieldDescriptor S1::Field_scalarI64( "scalarI64", 4, coda::types::Integer32::DESCRIPTOR, coda::descriptors::FieldOptions::DEFAULT_INSTANCE, CODA_OFFSET_OF(S1, _scalarI64), S1::HAS_SCALAR_I64); coda::descriptors::FieldDescriptor S1::Field_scalarFixedI16( "scalarFixedI16", 5, coda::types::Integer16::DESCRIPTOR, _options0, CODA_OFFSET_OF(S1, _scalarFixedI16), S1::HAS_SCALAR_FIXED_I16); coda::descriptors::FieldDescriptor S1::Field_scalarFixedI32( "scalarFixedI32", 6, coda::types::Integer32::DESCRIPTOR, _options0, CODA_OFFSET_OF(S1, _scalarFixedI32), S1::HAS_SCALAR_FIXED_I32); coda::descriptors::FieldDescriptor S1::Field_scalarFixedI64( "scalarFixedI64", 7, coda::types::Integer32::DESCRIPTOR, _options0, CODA_OFFSET_OF(S1, _scalarFixedI64), S1::HAS_SCALAR_FIXED_I64); coda::descriptors::FieldDescriptor S1::Field_scalarFloat( "scalarFloat", 8, coda::types::Float::DESCRIPTOR, coda::descriptors::FieldOptions::DEFAULT_INSTANCE, CODA_OFFSET_OF(S1, _scalarFloat), S1::HAS_SCALAR_FLOAT); coda::descriptors::FieldDescriptor S1::Field_scalarDouble( "scalarDouble", 9, coda::types::Double::DESCRIPTOR, coda::descriptors::FieldOptions::DEFAULT_INSTANCE, CODA_OFFSET_OF(S1, _scalarDouble), S1::HAS_SCALAR_DOUBLE); coda::descriptors::FieldDescriptor S1::Field_scalarString( "scalarString", 10, coda::types::String::DESCRIPTOR, coda::descriptors::FieldOptions::DEFAULT_INSTANCE, CODA_OFFSET_OF(S1, _scalarString), S1::HAS_SCALAR_STRING); coda::descriptors::FieldDescriptor S1::Field_scalarBytes( "scalarBytes", 11, coda::types::Bytes::DESCRIPTOR, coda::descriptors::FieldOptions::DEFAULT_INSTANCE, CODA_OFFSET_OF(S1, _scalarBytes), S1::HAS_SCALAR_BYTES); coda::descriptors::FieldDescriptor S1::Field_scalarEnum( "scalarEnum", 12, E_DESCRIPTOR, coda::descriptors::FieldOptions::DEFAULT_INSTANCE, CODA_OFFSET_OF(S1, _scalarEnum), S1::HAS_SCALAR_ENUM); coda::descriptors::FieldDescriptor S1::Field_listBoolean( "listBoolean", 20, coda::types::List<coda::types::Boolean>::DESCRIPTOR, coda::descriptors::FieldOptions::DEFAULT_INSTANCE, CODA_OFFSET_OF(S1, _listBoolean), (size_t)-1); coda::descriptors::FieldDescriptor S1::Field_listInt( "listInt", 21, coda::types::List<coda::types::Integer32>::DESCRIPTOR, coda::descriptors::FieldOptions::DEFAULT_INSTANCE, CODA_OFFSET_OF(S1, _listInt), (size_t)-1); coda::descriptors::FieldDescriptor S1::Field_listFloat( "listFloat", 22, coda::types::List<coda::types::Float>::DESCRIPTOR, coda::descriptors::FieldOptions::DEFAULT_INSTANCE, CODA_OFFSET_OF(S1, _listFloat), (size_t)-1); coda::descriptors::FieldDescriptor S1::Field_listString( "listString", 23, coda::types::List<coda::types::String >::DESCRIPTOR, coda::descriptors::FieldOptions::DEFAULT_INSTANCE, CODA_OFFSET_OF(S1, _listString), (size_t)-1); coda::descriptors::FieldDescriptor S1::Field_listEnum( "listEnum", 24, coda::types::List<coda::types::Enum<E_DESCRIPTOR>>::DESCRIPTOR, coda::descriptors::FieldOptions::DEFAULT_INSTANCE, CODA_OFFSET_OF(S1, _listEnum), (size_t)-1); coda::descriptors::FieldDescriptor S1::Field_setInt( "setInt", 41, coda::types::Set<coda::types::Integer32>::DESCRIPTOR, coda::descriptors::FieldOptions::DEFAULT_INSTANCE, CODA_OFFSET_OF(S1, _setInt), (size_t)-1); coda::descriptors::FieldDescriptor S1::Field_setString( "setString", 43, coda::types::Set<coda::types::String >::DESCRIPTOR, coda::descriptors::FieldOptions::DEFAULT_INSTANCE, CODA_OFFSET_OF(S1, _setString), (size_t)-1); coda::descriptors::FieldDescriptor S1::Field_setEnum( "setEnum", 44, coda::types::Set<coda::types::Enum<E_DESCRIPTOR>>::DESCRIPTOR, coda::descriptors::FieldOptions::DEFAULT_INSTANCE, CODA_OFFSET_OF(S1, _setEnum), (size_t)-1); coda::descriptors::FieldDescriptor S1::Field_mapIntString( "mapIntString", 51, coda::types::Map<coda::types::Integer32, coda::types::String >::DESCRIPTOR, coda::descriptors::FieldOptions::DEFAULT_INSTANCE, CODA_OFFSET_OF(S1, _mapIntString), (size_t)-1); coda::descriptors::FieldDescriptor S1::Field_mapStringInt( "mapStringInt", 52, coda::types::Map<coda::types::String, coda::types::Integer32>::DESCRIPTOR, coda::descriptors::FieldOptions::DEFAULT_INSTANCE, CODA_OFFSET_OF(S1, _mapStringInt), (size_t)-1); coda::descriptors::FieldDescriptor S1::Field_mapEnumStruct( "mapEnumStruct", 53, coda::types::Map<coda::types::Enum<E_DESCRIPTOR>, S1>::DESCRIPTOR, coda::descriptors::FieldOptions::DEFAULT_INSTANCE, CODA_OFFSET_OF(S1, _mapEnumStruct), (size_t)-1); coda::descriptors::FieldDescriptor S1::Field_unused( "unused", 100, coda::types::Integer32::DESCRIPTOR, coda::descriptors::FieldOptions::DEFAULT_INSTANCE, CODA_OFFSET_OF(S1, _unused), S1::HAS_UNUSED); coda::descriptors::FieldDescriptor* S1::Fields[] = { &S1::Field_scalarBoolean, &S1::Field_scalarI16, &S1::Field_scalarI32, &S1::Field_scalarI64, &S1::Field_scalarFixedI16, &S1::Field_scalarFixedI32, &S1::Field_scalarFixedI64, &S1::Field_scalarFloat, &S1::Field_scalarDouble, &S1::Field_scalarString, &S1::Field_scalarBytes, &S1::Field_scalarEnum, &S1::Field_listBoolean, &S1::Field_listInt, &S1::Field_listFloat, &S1::Field_listString, &S1::Field_listEnum, &S1::Field_setInt, &S1::Field_setString, &S1::Field_setEnum, &S1::Field_mapIntString, &S1::Field_mapStringInt, &S1::Field_mapEnumStruct, &S1::Field_unused, }; const uint32_t S1::TYPE_ID = 0; coda::descriptors::StructDescriptor S1::DESCRIPTOR( "S1", 0, &S1::DEFAULT_INSTANCE, FILE, NULL, NULL, coda::descriptors::StructOptions::DEFAULT_INSTANCE, coda::descriptors::StaticArrayRef<coda::descriptors::StructDescriptor*>(), coda::descriptors::StaticArrayRef<coda::descriptors::EnumDescriptor*>(), S1::Fields, &coda::descriptors::StaticObjectBuilder<S1>::create, (coda::descriptors::PresenceGetter) &S1::isFieldPresent, (coda::descriptors::PresenceSetter) &S1::setFieldPresent ); S1 S1::DEFAULT_INSTANCE; bool S1::equals(const coda::runtime::Object* other) const { return other != NULL && descriptor() == other->descriptor() && _scalarBoolean == ((S1*) other)->_scalarBoolean && _scalarI16 == ((S1*) other)->_scalarI16 && _scalarI32 == ((S1*) other)->_scalarI32 && _scalarI64 == ((S1*) other)->_scalarI64 && _scalarFixedI16 == ((S1*) other)->_scalarFixedI16 && _scalarFixedI32 == ((S1*) other)->_scalarFixedI32 && _scalarFixedI64 == ((S1*) other)->_scalarFixedI64 && _scalarFloat == ((S1*) other)->_scalarFloat && _scalarDouble == ((S1*) other)->_scalarDouble && _scalarString == ((S1*) other)->_scalarString && _scalarBytes == ((S1*) other)->_scalarBytes && _scalarEnum == ((S1*) other)->_scalarEnum && _listBoolean == ((S1*) other)->_listBoolean && _listInt == ((S1*) other)->_listInt && _listFloat == ((S1*) other)->_listFloat && _listString == ((S1*) other)->_listString && _listEnum == ((S1*) other)->_listEnum && _setInt == ((S1*) other)->_setInt && _setString == ((S1*) other)->_setString && _setEnum == ((S1*) other)->_setEnum && _mapIntString == ((S1*) other)->_mapIntString && _mapStringInt == ((S1*) other)->_mapStringInt && _mapEnumStruct == ((S1*) other)->_mapEnumStruct && _unused == ((S1*) other)->_unused; } size_t S1::hashValue() const { size_t hash = coda::runtime::Object::hashValue(); coda::runtime::hash_combine(hash, coda::runtime::hash(_scalarBoolean)); coda::runtime::hash_combine(hash, coda::runtime::hash(_scalarI16)); coda::runtime::hash_combine(hash, coda::runtime::hash(_scalarI32)); coda::runtime::hash_combine(hash, coda::runtime::hash(_scalarI64)); coda::runtime::hash_combine(hash, coda::runtime::hash(_scalarFixedI16)); coda::runtime::hash_combine(hash, coda::runtime::hash(_scalarFixedI32)); coda::runtime::hash_combine(hash, coda::runtime::hash(_scalarFixedI64)); coda::runtime::hash_combine(hash, coda::runtime::hash(_scalarFloat)); coda::runtime::hash_combine(hash, coda::runtime::hash(_scalarDouble)); coda::runtime::hash_combine(hash, coda::runtime::hash(_scalarString)); coda::runtime::hash_combine(hash, coda::runtime::hash(_scalarBytes)); coda::runtime::hash_combine(hash, coda::runtime::EnumHash<E>()(_scalarEnum)); coda::runtime::hash_combine(hash, coda::runtime::hash(_listBoolean)); coda::runtime::hash_combine(hash, coda::runtime::hash(_listInt)); coda::runtime::hash_combine(hash, coda::runtime::hash(_listFloat)); coda::runtime::hash_combine(hash, coda::runtime::hash(_listString)); coda::runtime::hash_combine(hash, coda::runtime::hash(_listEnum)); coda::runtime::hash_combine(hash, coda::runtime::hash(_setInt)); coda::runtime::hash_combine(hash, coda::runtime::hash(_setString)); coda::runtime::hash_combine(hash, coda::runtime::hash(_setEnum)); coda::runtime::hash_combine(hash, coda::runtime::hash(_mapIntString)); coda::runtime::hash_combine(hash, coda::runtime::hash(_mapStringInt)); coda::runtime::hash_combine(hash, coda::runtime::hash(_mapEnumStruct)); coda::runtime::hash_combine(hash, coda::runtime::hash(_unused)); return hash; } void S1::freezeImpl() { for (std::unordered_map<E, S1*, coda::runtime::EnumHash<E> >::const_iterator it = _mapEnumStruct.begin(), itEnd = _mapEnumStruct.end(); it != itEnd; ++it) { if (it->second->isMutable()) { it->second->freeze(); } } } void S1::clear() { _scalarBoolean = false; _scalarI16 = 0; _scalarI32 = 0; _scalarI64 = 0; _scalarFixedI16 = 0; _scalarFixedI32 = 0; _scalarFixedI64 = 0; _scalarFloat = 0; _scalarDouble = 0; _scalarEnum = E_E0; _listBoolean.clear(); _listInt.clear(); _listFloat.clear(); _listString.clear(); _listEnum.clear(); _setInt.clear(); _setString.clear(); _setEnum.clear(); _mapIntString.clear(); _mapStringInt.clear(); _mapEnumStruct.clear(); _unused = 0; } void S1::deleteRecursiveImpl(Object** queue) { for (std::unordered_map<E, S1*, coda::runtime::EnumHash<E> >::const_iterator it = _mapEnumStruct.begin(), itEnd = _mapEnumStruct.end(); it != itEnd; ++it) { if (it->second != &S1::DEFAULT_INSTANCE) { it->second->queueForDelete(queue); } } } void S1::endWrite(coda::io::Encoder* encoder) const { if (hasScalarBoolean()) { encoder->writeFieldHeader("scalarBoolean", 1); encoder->writeBoolean(_scalarBoolean); } if (hasScalarI16()) { encoder->writeFieldHeader("scalarI16", 2); encoder->writeInteger(_scalarI16); } if (hasScalarI32()) { encoder->writeFieldHeader("scalarI32", 3); encoder->writeInteger(_scalarI32); } if (hasScalarI64()) { encoder->writeFieldHeader("scalarI64", 4); encoder->writeInteger(_scalarI64); } if (hasScalarFixedI16()) { encoder->writeFieldHeader("scalarFixedI16", 5); encoder->writeFixed16(_scalarFixedI16); } if (hasScalarFixedI32()) { encoder->writeFieldHeader("scalarFixedI32", 6); encoder->writeFixed32(_scalarFixedI32); } if (hasScalarFixedI64()) { encoder->writeFieldHeader("scalarFixedI64", 7); encoder->writeFixed32(_scalarFixedI64); } if (hasScalarFloat()) { encoder->writeFieldHeader("scalarFloat", 8); encoder->writeFloat(_scalarFloat); } if (hasScalarDouble()) { encoder->writeFieldHeader("scalarDouble", 9); encoder->writeDouble(_scalarDouble); } if (hasScalarString()) { encoder->writeFieldHeader("scalarString", 10); encoder->writeString(_scalarString); } if (hasScalarBytes()) { encoder->writeFieldHeader("scalarBytes", 11); encoder->writeBytes(_scalarBytes); } if (hasScalarEnum()) { encoder->writeFieldHeader("scalarEnum", 12); encoder->writeInteger((int32_t) _scalarEnum); } if (!_listBoolean.empty()) { encoder->writeFieldHeader("listBoolean", 20); encoder->writeBeginList(coda::descriptors::TYPE_KIND_BOOL, _listBoolean.size()); for (std::vector<bool>::const_iterator it = _listBoolean.begin(), itEnd = _listBoolean.end(); it != itEnd; ++it) { encoder->writeBoolean(*it); } encoder->writeEndList(); } if (!_listInt.empty()) { encoder->writeFieldHeader("listInt", 21); encoder->writeBeginList(coda::descriptors::TYPE_KIND_INTEGER, _listInt.size()); for (std::vector<int32_t>::const_iterator it = _listInt.begin(), itEnd = _listInt.end(); it != itEnd; ++it) { encoder->writeInteger(*it); } encoder->writeEndList(); } if (!_listFloat.empty()) { encoder->writeFieldHeader("listFloat", 22); encoder->writeBeginList(coda::descriptors::TYPE_KIND_FLOAT, _listFloat.size()); for (std::vector<float>::const_iterator it = _listFloat.begin(), itEnd = _listFloat.end(); it != itEnd; ++it) { encoder->writeFloat(*it); } encoder->writeEndList(); } if (!_listString.empty()) { encoder->writeFieldHeader("listString", 23); encoder->writeBeginList(coda::descriptors::TYPE_KIND_STRING, _listString.size()); for (std::vector<std::string>::const_iterator it = _listString.begin(), itEnd = _listString.end(); it != itEnd; ++it) { encoder->writeString(*it); } encoder->writeEndList(); } if (!_listEnum.empty()) { encoder->writeFieldHeader("listEnum", 24); encoder->writeBeginList(coda::descriptors::TYPE_KIND_ENUM, _listEnum.size()); for (std::vector<E>::const_iterator it = _listEnum.begin(), itEnd = _listEnum.end(); it != itEnd; ++it) { encoder->writeInteger((int32_t) *it); } encoder->writeEndList(); } if (!_setInt.empty()) { encoder->writeFieldHeader("setInt", 41); encoder->writeBeginSet(coda::descriptors::TYPE_KIND_INTEGER, _setInt.size()); for (std::unordered_set<int32_t>::const_iterator it = _setInt.begin(), itEnd = _setInt.end(); it != itEnd; ++it) { encoder->writeInteger(*it); } encoder->writeEndSet(); } if (!_setString.empty()) { encoder->writeFieldHeader("setString", 43); encoder->writeBeginSet(coda::descriptors::TYPE_KIND_STRING, _setString.size()); for (std::unordered_set<std::string>::const_iterator it = _setString.begin(), itEnd = _setString.end(); it != itEnd; ++it) { encoder->writeString(*it); } encoder->writeEndSet(); } if (!_setEnum.empty()) { encoder->writeFieldHeader("setEnum", 44); encoder->writeBeginSet(coda::descriptors::TYPE_KIND_ENUM, _setEnum.size()); for (std::unordered_set<E, coda::runtime::EnumHash<E> >::const_iterator it = _setEnum.begin(), itEnd = _setEnum.end(); it != itEnd; ++it) { encoder->writeInteger((int32_t) *it); } encoder->writeEndSet(); } if (!_mapIntString.empty()) { encoder->writeFieldHeader("mapIntString", 51); encoder->writeBeginMap(coda::descriptors::TYPE_KIND_INTEGER, coda::descriptors::TYPE_KIND_STRING, _mapIntString.size()); for (std::unordered_map<int32_t, std::string>::const_iterator it = _mapIntString.begin(), itEnd = _mapIntString.end(); it != itEnd; ++it) { encoder->writeInteger(it->first); encoder->writeString(it->second); } encoder->writeEndMap(); } if (!_mapStringInt.empty()) { encoder->writeFieldHeader("mapStringInt", 52); encoder->writeBeginMap(coda::descriptors::TYPE_KIND_STRING, coda::descriptors::TYPE_KIND_INTEGER, _mapStringInt.size()); for (std::unordered_map<std::string, int32_t>::const_iterator it = _mapStringInt.begin(), itEnd = _mapStringInt.end(); it != itEnd; ++it) { encoder->writeString(it->first); encoder->writeInteger(it->second); } encoder->writeEndMap(); } if (!_mapEnumStruct.empty()) { encoder->writeFieldHeader("mapEnumStruct", 53); encoder->writeBeginMap(coda::descriptors::TYPE_KIND_ENUM, coda::descriptors::TYPE_KIND_STRUCT, _mapEnumStruct.size()); for (std::unordered_map<E, S1*, coda::runtime::EnumHash<E> >::const_iterator it = _mapEnumStruct.begin(), itEnd = _mapEnumStruct.end(); it != itEnd; ++it) { encoder->writeInteger((int32_t) it->first); encoder->writeStruct(it->second, true); } encoder->writeEndMap(); } if (hasUnused()) { encoder->writeFieldHeader("unused", 100); encoder->writeInteger(_unused); } } // ============================================================================ // S2 // ============================================================================ coda::descriptors::FieldDescriptor S2::Field_left( "left", 1, S1::DESCRIPTOR, coda::descriptors::FieldOptions::DEFAULT_INSTANCE, CODA_OFFSET_OF(S2, _left), S2::HAS_LEFT); coda::descriptors::FieldDescriptor S2::Field_right( "right", 2, S1::DESCRIPTOR, coda::descriptors::FieldOptions::DEFAULT_INSTANCE, CODA_OFFSET_OF(S2, _right), S2::HAS_RIGHT); coda::descriptors::FieldDescriptor* S2::Fields[] = { &S2::Field_left, &S2::Field_right, }; const uint32_t S2::TYPE_ID = 1; coda::descriptors::StructDescriptor S2::DESCRIPTOR( "S2", 1, &S2::DEFAULT_INSTANCE, FILE, NULL, &S1::DESCRIPTOR, coda::descriptors::StructOptions::DEFAULT_INSTANCE, coda::descriptors::StaticArrayRef<coda::descriptors::StructDescriptor*>(), coda::descriptors::StaticArrayRef<coda::descriptors::EnumDescriptor*>(), S2::Fields, &coda::descriptors::StaticObjectBuilder<S2>::create, (coda::descriptors::PresenceGetter) &S2::isFieldPresent, (coda::descriptors::PresenceSetter) &S2::setFieldPresent ); S2 S2::DEFAULT_INSTANCE; S2::S2() : _left(&S1::DEFAULT_INSTANCE) , _right(&S1::DEFAULT_INSTANCE) { } bool S2::equals(const coda::runtime::Object* other) const { return S1::equals(other) && _left == ((S2*) other)->_left && _right == ((S2*) other)->_right; } size_t S2::hashValue() const { size_t hash = S1::hashValue(); coda::runtime::hash_combine(hash, coda::runtime::hash(_left)); coda::runtime::hash_combine(hash, coda::runtime::hash(_right)); return hash; } void S2::freezeImpl() { S1::freezeImpl(); if (_left->isMutable()) { _left->freeze(); } if (_right->isMutable()) { _right->freeze(); } } void S2::clear() { S1::clear(); _left = &S1::DEFAULT_INSTANCE; _right = &S1::DEFAULT_INSTANCE; } void S2::deleteRecursiveImpl(Object** queue) { S1::deleteRecursiveImpl(queue); if (_left != &S1::DEFAULT_INSTANCE) { _left->queueForDelete(queue); } if (_right != &S1::DEFAULT_INSTANCE) { _right->queueForDelete(queue); } } void S2::beginWrite(coda::io::Encoder* encoder) const { S1::beginWrite(encoder); encoder->writeSubtypeHeader("S2", coda::descriptors::TYPE_KIND_BOOL); } void S2::endWrite(coda::io::Encoder* encoder) const { if (hasLeft()) { encoder->writeFieldHeader("left", 1); encoder->writeStruct(_left, true); } if (hasRight()) { encoder->writeFieldHeader("right", 2); encoder->writeStruct(_right, true); } encoder->writeEndSubtype(); S1::endWrite(encoder); } // ============================================================================ // S3 // ============================================================================ coda::descriptors::FieldDescriptor S3::Field_sList( "sList", 1, coda::types::List<S1>::DESCRIPTOR, coda::descriptors::FieldOptions::DEFAULT_INSTANCE, CODA_OFFSET_OF(S3, _sList), (size_t)-1); coda::descriptors::FieldDescriptor S3::Field_sSet( "sSet", 2, coda::types::Set<S1>::DESCRIPTOR, coda::descriptors::FieldOptions::DEFAULT_INSTANCE, CODA_OFFSET_OF(S3, _sSet), (size_t)-1); coda::descriptors::FieldDescriptor S3::Field_sMap( "sMap", 3, coda::types::Map<coda::types::String, S1>::DESCRIPTOR, coda::descriptors::FieldOptions::DEFAULT_INSTANCE, CODA_OFFSET_OF(S3, _sMap), (size_t)-1); coda::descriptors::FieldDescriptor* S3::Fields[] = { &S3::Field_sList, &S3::Field_sSet, &S3::Field_sMap, }; const uint32_t S3::TYPE_ID = 2; coda::descriptors::StructDescriptor S3::DESCRIPTOR( "S3", 2, &S3::DEFAULT_INSTANCE, FILE, NULL, &S1::DESCRIPTOR, coda::descriptors::StructOptions::DEFAULT_INSTANCE, coda::descriptors::StaticArrayRef<coda::descriptors::StructDescriptor*>(), coda::descriptors::StaticArrayRef<coda::descriptors::EnumDescriptor*>(), S3::Fields, &coda::descriptors::StaticObjectBuilder<S3>::create, NULL, NULL ); S3 S3::DEFAULT_INSTANCE; bool S3::equals(const coda::runtime::Object* other) const { return S1::equals(other) && _sList == ((S3*) other)->_sList && _sSet == ((S3*) other)->_sSet && _sMap == ((S3*) other)->_sMap; } size_t S3::hashValue() const { size_t hash = S1::hashValue(); coda::runtime::hash_combine(hash, coda::runtime::hash(_sList)); coda::runtime::hash_combine(hash, coda::runtime::hash(_sSet)); coda::runtime::hash_combine(hash, coda::runtime::hash(_sMap)); return hash; } void S3::freezeImpl() { S1::freezeImpl(); for (std::vector<S1*>::const_iterator it = _sList.begin(), itEnd = _sList.end(); it != itEnd; ++it) { if ((*it)->isMutable()) { (*it)->freeze(); } } for (std::unordered_set<S1*>::const_iterator it = _sSet.begin(), itEnd = _sSet.end(); it != itEnd; ++it) { if ((*it)->isMutable()) { (*it)->freeze(); } } for (std::unordered_map<std::string, S1*>::const_iterator it = _sMap.begin(), itEnd = _sMap.end(); it != itEnd; ++it) { if (it->second->isMutable()) { it->second->freeze(); } } } void S3::clear() { S1::clear(); _sList.clear(); _sSet.clear(); _sMap.clear(); } void S3::deleteRecursiveImpl(Object** queue) { S1::deleteRecursiveImpl(queue); for (std::vector<S1*>::const_iterator it = _sList.begin(), itEnd = _sList.end(); it != itEnd; ++it) { if ((*it) != &S1::DEFAULT_INSTANCE) { (*it)->queueForDelete(queue); } } for (std::unordered_set<S1*>::const_iterator it = _sSet.begin(), itEnd = _sSet.end(); it != itEnd; ++it) { if ((*it) != &S1::DEFAULT_INSTANCE) { (*it)->queueForDelete(queue); } } for (std::unordered_map<std::string, S1*>::const_iterator it = _sMap.begin(), itEnd = _sMap.end(); it != itEnd; ++it) { if (it->second != &S1::DEFAULT_INSTANCE) { it->second->queueForDelete(queue); } } } void S3::beginWrite(coda::io::Encoder* encoder) const { S1::beginWrite(encoder); encoder->writeSubtypeHeader("S3", coda::descriptors::TYPE_KIND_INTEGER); } void S3::endWrite(coda::io::Encoder* encoder) const { if (!_sList.empty()) { encoder->writeFieldHeader("sList", 1); encoder->writeBeginList(coda::descriptors::TYPE_KIND_STRUCT, _sList.size()); for (std::vector<S1*>::const_iterator it = _sList.begin(), itEnd = _sList.end(); it != itEnd; ++it) { encoder->writeStruct(*it, true); } encoder->writeEndList(); } if (!_sSet.empty()) { encoder->writeFieldHeader("sSet", 2); encoder->writeBeginSet(coda::descriptors::TYPE_KIND_STRUCT, _sSet.size()); for (std::unordered_set<S1*>::const_iterator it = _sSet.begin(), itEnd = _sSet.end(); it != itEnd; ++it) { encoder->writeStruct(*it, true); } encoder->writeEndSet(); } if (!_sMap.empty()) { encoder->writeFieldHeader("sMap", 3); encoder->writeBeginMap(coda::descriptors::TYPE_KIND_STRING, coda::descriptors::TYPE_KIND_STRUCT, _sMap.size()); for (std::unordered_map<std::string, S1*>::const_iterator it = _sMap.begin(), itEnd = _sMap.end(); it != itEnd; ++it) { encoder->writeString(it->first); encoder->writeStruct(it->second, true); } encoder->writeEndMap(); } encoder->writeEndSubtype(); S1::endWrite(encoder); } // ============================================================================ // FILE // ============================================================================ static coda::descriptors::StructDescriptor* FILE_Structs[] = { &S1::DESCRIPTOR, &S2::DESCRIPTOR, &S3::DESCRIPTOR, }; static coda::descriptors::EnumDescriptor* FILE_Enums[] = { &E_DESCRIPTOR, }; coda::descriptors::StaticFileDescriptor FILE( "sample.coda", "sample", _options1, FILE_Structs, FILE_Enums ); } // namespace sample
35.541555
223
0.657841
viridia
0d957dd3a5434ce5e1c677cde6f7b212e1880753
368
cpp
C++
Day 3/A - Theatre Square.cpp
shtanriverdi/CS487-Introduction-to-Competitive-Programming-Progress
0d7a4fa4346ee08d9b2b2f628c3ffab7f3f81166
[ "MIT" ]
4
2019-12-12T19:59:50.000Z
2020-01-20T15:44:44.000Z
Day 3/A - Theatre Square.cpp
shtanriverdi/CS487-Introduction-to-Competitive-Programming-Progress
0d7a4fa4346ee08d9b2b2f628c3ffab7f3f81166
[ "MIT" ]
null
null
null
Day 3/A - Theatre Square.cpp
shtanriverdi/CS487-Introduction-to-Competitive-Programming-Progress
0d7a4fa4346ee08d9b2b2f628c3ffab7f3f81166
[ "MIT" ]
null
null
null
// Question Link ---> https://codeforces.com/problemset/problem/1/A // Day #3 #include <iostream> using namespace std; int main(void) { int m, n, a; long long width=0, height=0; cin >> m >> n >> a; if (m % a == 0) width = m/a; else width=(m/a+1); if (n %a == 0) height = n/a; else height=(n/a+1); cout << width*height << endl; return 0; }
23
68
0.557065
shtanriverdi
0d959fe632aca31aeb1f9e005ddebf88a16f9e3a
454
hpp
C++
cpp/include/models/linear_gradient_builder.hpp
rive-app/rive-android
bb1ececb0b0b0412fb9d2669e79d9410e041d0a2
[ "MIT" ]
133
2020-10-05T21:33:00.000Z
2022-03-30T11:17:31.000Z
cpp/include/models/linear_gradient_builder.hpp
rive-app/rive-android
bb1ececb0b0b0412fb9d2669e79d9410e041d0a2
[ "MIT" ]
113
2020-10-06T12:36:32.000Z
2022-03-21T10:58:35.000Z
cpp/include/models/linear_gradient_builder.hpp
rive-app/rive-android
bb1ececb0b0b0412fb9d2669e79d9410e041d0a2
[ "MIT" ]
17
2020-10-21T06:10:51.000Z
2022-01-06T06:42:42.000Z
#ifndef _RIVE_ANDROID_LINEAR_GRADIENT_BUILDER_HPP_ #define _RIVE_ANDROID_LINEAR_GRADIENT_BUILDER_HPP_ #include "jni_refs.hpp" #include "models/gradient_builder.hpp" namespace rive_android { class JNILinearGradientBuilder : public JNIGradientBuilder { public: JNILinearGradientBuilder(float sx, float sy, float ex, float ey) : JNIGradientBuilder(sx, sy, ex, ey) { } void apply(jobject paint) override; }; } // namespace rive_android #endif
22.7
103
0.790749
rive-app
0d9842cbceb2432c92e9e688bdfda737b392739e
4,286
cpp
C++
src/pose_estimation/Kabsch.cpp
LiliMeng/btrf
c13da164b11c5ada522fa40deeaffc32192c4bf9
[ "BSD-2-Clause" ]
9
2017-10-28T15:24:04.000Z
2021-12-28T13:51:05.000Z
src/pose_estimation/Kabsch.cpp
LiliMeng/btrf
c13da164b11c5ada522fa40deeaffc32192c4bf9
[ "BSD-2-Clause" ]
null
null
null
src/pose_estimation/Kabsch.cpp
LiliMeng/btrf
c13da164b11c5ada522fa40deeaffc32192c4bf9
[ "BSD-2-Clause" ]
3
2017-11-08T16:10:39.000Z
2019-05-21T03:40:02.000Z
#include <Eigen/Geometry> #include "Kabsch.hpp" // Given two sets of 3D points, find the rotation + translation + scale // which best maps the first set to the second. // Source: http://en.wikipedia.org/wiki/Kabsch_algorithm // The input 3D points are stored as columns. Eigen::Affine3d Find3DAffineTransform(Eigen::Matrix3Xd in, Eigen::Matrix3Xd out) { // Default output Eigen::Affine3d A; A.linear() = Eigen::Matrix3d::Identity(3, 3); A.translation() = Eigen::Vector3d::Zero(); if (in.cols() != out.cols()) throw "Find3DAffineTransform(): input data mis-match"; // First find the scale, by finding the ratio of sums of some distances, // then bring the datasets to the same scale. double dist_in = 0, dist_out = 0; for (int col = 0; col < in.cols()-1; col++) { dist_in += (in.col(col+1) - in.col(col)).norm(); dist_out += (out.col(col+1) - out.col(col)).norm(); } if (dist_in <= 0 || dist_out <= 0) return A; double scale = dist_out/dist_in; out /= scale; // printf("scale %lf\n", scale); // Find the centroids then shift to the origin Eigen::Vector3d in_ctr = Eigen::Vector3d::Zero(); Eigen::Vector3d out_ctr = Eigen::Vector3d::Zero(); for (int col = 0; col < in.cols(); col++) { in_ctr += in.col(col); out_ctr += out.col(col); } in_ctr /= in.cols(); out_ctr /= out.cols(); for (int col = 0; col < in.cols(); col++) { in.col(col) -= in_ctr; out.col(col) -= out_ctr; } // SVD Eigen::MatrixXd Cov = in * out.transpose(); Eigen::JacobiSVD<Eigen::MatrixXd> svd(Cov, Eigen::ComputeThinU | Eigen::ComputeThinV); // Find the rotation double d = (svd.matrixV() * svd.matrixU().transpose()).determinant(); if (d > 0) d = 1.0; else d = -1.0; Eigen::Matrix3d I = Eigen::Matrix3d::Identity(3, 3); I(2, 2) = d; Eigen::Matrix3d R = svd.matrixV() * I * svd.matrixU().transpose(); // The final transform A.linear() = scale * R; A.translation() = scale*(out_ctr - R*in_ctr); return A; } Eigen::Affine3d Find3DAffineTransformSameScale(Eigen::Matrix3Xd in, Eigen::Matrix3Xd out) { // Default output Eigen::Affine3d A; A.linear() = Eigen::Matrix3d::Identity(3, 3); A.translation() = Eigen::Vector3d::Zero(); if (in.cols() != out.cols()) throw "Find3DAffineTransform(): input data mis-match"; // Find the centroids then shift to the origin Eigen::Vector3d in_ctr = Eigen::Vector3d::Zero(); Eigen::Vector3d out_ctr = Eigen::Vector3d::Zero(); for (int col = 0; col < in.cols(); col++) { in_ctr += in.col(col); out_ctr += out.col(col); } in_ctr /= in.cols(); out_ctr /= out.cols(); for (int col = 0; col < in.cols(); col++) { in.col(col) -= in_ctr; out.col(col) -= out_ctr; } // SVD Eigen::MatrixXd Cov = in * out.transpose(); Eigen::JacobiSVD<Eigen::MatrixXd> svd(Cov, Eigen::ComputeThinU | Eigen::ComputeThinV); // Find the rotation double d = (svd.matrixV() * svd.matrixU().transpose()).determinant(); if (d > 0) d = 1.0; else d = -1.0; Eigen::Matrix3d I = Eigen::Matrix3d::Identity(3, 3); I(2, 2) = d; Eigen::Matrix3d R = svd.matrixV() * I * svd.matrixU().transpose(); // The final transform A.linear() = R; A.translation() = (out_ctr - R*in_ctr); return A; } // A function to test Find3DAffineTransform() void TestFind3DAffineTransform(){ // Create datasets with known transform Eigen::Matrix3Xd in(3, 100), out(3, 100); Eigen::Quaternion<double> Q(1, 3, 5, 2); Q.normalize(); Eigen::Matrix3d R = Q.toRotationMatrix(); double scale = 2.0; for (int row = 0; row < in.rows(); row++) { for (int col = 0; col < in.cols(); col++) { in(row, col) = log(2*row + 10.0)/sqrt(1.0*col + 4.0) + sqrt(col*1.0)/(row + 1.0); } } Eigen::Vector3d S; S << -5, 6, -27; for (int col = 0; col < in.cols(); col++) out.col(col) = scale*R*in.col(col) + S; Eigen::Affine3d A = Find3DAffineTransform(in, out); // See if we got the transform we expected if ( (scale*R-A.linear()).cwiseAbs().maxCoeff() > 1e-13 || (S-A.translation()).cwiseAbs().maxCoeff() > 1e-13) throw "Could not determine the affine transform accurately enough"; }
30.614286
90
0.602893
LiliMeng
0d98b716a60bd98f70382e2841346a5778e44157
1,580
cc
C++
simplest/src/NXSensitiveDetector.cc
maxwell-herrmann/geant4-simple-examples
0052d40fdc05baef05b4a6873c03d0d54885ad40
[ "BSD-2-Clause" ]
null
null
null
simplest/src/NXSensitiveDetector.cc
maxwell-herrmann/geant4-simple-examples
0052d40fdc05baef05b4a6873c03d0d54885ad40
[ "BSD-2-Clause" ]
null
null
null
simplest/src/NXSensitiveDetector.cc
maxwell-herrmann/geant4-simple-examples
0052d40fdc05baef05b4a6873c03d0d54885ad40
[ "BSD-2-Clause" ]
null
null
null
#include "NXSensitiveDetector.hh" #include "G4HCofThisEvent.hh" #include "G4Step.hh" #include "G4ThreeVector.hh" #include "G4SDManager.hh" #include "G4ios.hh" #include "G4RunManager.hh" //#include "NXRunAction.hh" #include "G4SystemOfUnits.hh" NXSensitiveDetector::NXSensitiveDetector(G4String name) : G4VSensitiveDetector(name) { } NXSensitiveDetector::~NXSensitiveDetector(){ } void NXSensitiveDetector::Initialize(G4HCofThisEvent* HCE) { } G4bool NXSensitiveDetector::ProcessHits(G4Step* aStep,G4TouchableHistory*) { G4StepPoint* pointPre=aStep->GetPreStepPoint(); G4StepPoint* pointPost=aStep->GetPostStepPoint(); G4TouchableHandle touchCur=pointPre->GetTouchableHandle(); G4VPhysicalVolume* volumeCur=touchCur->GetVolume(); G4String volumeCurName=volumeCur->GetName(); G4int copyNumofChamber=touchCur->GetCopyNumber(); G4Track* trackCur=aStep->GetTrack(); G4ParticleDefinition* particleCur = trackCur->GetDefinition(); G4String particleCurName = particleCur->GetParticleName(); G4double kineticEnergyCur = trackCur->GetKineticEnergy(); G4RunManager* runManager= G4RunManager::GetRunManager(); //NXRunAction* runActionCur=(NXRunAction *)runManager->GetUserRunAction(); G4cout << "Detector hit! " << pointPre->GetPosition() << " --> " << pointPost->GetPosition() << " by " << particleCurName << " with E=" << kineticEnergyCur / keV << "keV inside " << volumeCurName << G4endl; return true; } void NXSensitiveDetector::EndOfEvent(G4HCofThisEvent*) { G4cout << "Event end!" << G4endl; }
30.384615
100
0.731646
maxwell-herrmann
0d99dab65f7f7c4d0ce3127843baa892aa0eb166
1,183
cpp
C++
Data_Structures/Hashing/uni_number_of_occur.cpp
abhishekjha786/ds_algo
38355ca12e8ac20c4baa8baccf8ad189effaa6ae
[ "MIT" ]
11
2020-03-20T17:24:28.000Z
2022-01-08T02:43:24.000Z
Data_Structures/Hashing/uni_number_of_occur.cpp
abhishekjha786/ds_algo
38355ca12e8ac20c4baa8baccf8ad189effaa6ae
[ "MIT" ]
1
2021-07-25T11:24:46.000Z
2021-07-25T12:09:25.000Z
Data_Structures/Hashing/uni_number_of_occur.cpp
abhishekjha786/ds_algo
38355ca12e8ac20c4baa8baccf8ad189effaa6ae
[ "MIT" ]
4
2020-03-20T17:24:36.000Z
2021-12-07T19:22:59.000Z
// Unique Number of Occurrences // Given an array of integers arr, write a function that // returns true if and only if the number of occurrences of each value in the array is unique. // Input: arr = [1,2,2,1,1,3] // Output: true // Explanation: The value 1 has 3 occurrences, 2 has 2 and 3 has 1. No two values have the same number of occurrences. // Example 2: // Input: arr = [1,2] // Output: false // Example 3: // Input: arr = [-3,0,1,-3,1,1,1,-3,10,0] // Output: true // Solution: - // Create a map1 to store how many times the element occured. // Create a map2 to store how many times did the elements in map1 occured. // If any count > 1 in second map, return false. // Else return true. #include <bits/stdc++.h> using namespace std; bool uniqueOccurrences(vector<int> &arr) { unordered_map<int, int> mp; for (int ele : arr) { mp[ele]++; } unordered_map<int, int> mp2; for (auto itr = mp.begin(); itr != mp.end(); itr++) { mp2[itr->second]++; } for (auto itr2 = mp2.begin(); itr2 != mp2.end(); itr2++) { if (itr2->second > 1) { return false; } } return true; }
21.509091
118
0.60186
abhishekjha786
0d9e764e29695356fe651a9baabe3a8b74526157
1,736
cpp
C++
src/lp/escf.cpp
qaskai/MLCMST
0fa0529347eb6a44f45cf52dff477291c6fad433
[ "MIT" ]
null
null
null
src/lp/escf.cpp
qaskai/MLCMST
0fa0529347eb6a44f45cf52dff477291c6fad433
[ "MIT" ]
null
null
null
src/lp/escf.cpp
qaskai/MLCMST
0fa0529347eb6a44f45cf52dff477291c6fad433
[ "MIT" ]
null
null
null
#include <lp/escf.hpp> namespace MLCMST::lp { std::string ESCF::id() { static std::string id = "MP_ESCF"; return id; } ESCF::ESCF(bool exact_solution) : SCF(exact_solution) { } ESCF::ESCF(MLCMST::lp::LPSolverFactory mp_solver_factory) : SCF(mp_solver_factory) { } ESCF::~ESCF() = default; void ESCF::createConstraints() { createDemandConstraints(); createEnhancedCapacityConstraints(); createOneOutgoingConstraints(); createOneBetweenConstraints(); } void ESCF::createEnhancedCapacityConstraints() { for (auto [i,j] : _arc_set) { LinearExpr lhs = _flow_vars[i][j]; LinearExpr rhs; rhs += _arc_vars[i][j][0]; for (int l=1; l < _levels_number; l++) { rhs += (_mlcc_network->edgeCapacity(l-1) + 1) * _arc_vars[i][j][l]; } _mp_solver.MakeRowConstraint(lhs >= rhs); } for (int i : _vertex_set) { if (i == _mlcc_network->center()) continue; LinearExpr lhs = _flow_vars[i][_mlcc_network->center()]; LinearExpr rhs; for (int l=0; l < _levels_number; l++) { rhs += _mlcc_network->edgeCapacity(l) * _arc_vars[i][_mlcc_network->center()][l]; } _mp_solver.MakeRowConstraint(lhs <= rhs); } for (auto [i,j] : _arc_set) { if (j == _mlcc_network->center()) continue; LinearExpr lhs = _flow_vars[i][j]; LinearExpr rhs = (_mlcc_network->edgeCapacity(_levels_number-1) - _supply[j]) * _arc_vars[i][j][_levels_number-1]; for (int l=0; l < _levels_number-1; l++) { rhs += _mlcc_network->edgeCapacity(l) * _arc_vars[i][j][l]; } _mp_solver.MakeRowConstraint(lhs <= rhs); } } }
24.8
113
0.593894
qaskai
0d9eba0cd114e6380923e7b3393a2384d953ce4a
21,092
cpp
C++
ffscriptUT/ExpressionUT.cpp
VincentPT/xscript
cea6ee9e8c5af87af75188695ffa89080dce49b8
[ "MIT" ]
null
null
null
ffscriptUT/ExpressionUT.cpp
VincentPT/xscript
cea6ee9e8c5af87af75188695ffa89080dce49b8
[ "MIT" ]
null
null
null
ffscriptUT/ExpressionUT.cpp
VincentPT/xscript
cea6ee9e8c5af87af75188695ffa89080dce49b8
[ "MIT" ]
1
2019-12-24T22:24:01.000Z
2019-12-24T22:24:01.000Z
/****************************************************************** * File: ExpressionUT.cpp * Description: Test cases for checking compiling process, compiling * linking a single expression of C Lambda scripting * language. * Author: Vincent Pham * * Copyright (c) 2018 VincentPT. ** Distributed under the MIT License (http://opensource.org/licenses/MIT) ** * **********************************************************************/ #include "fftest.hpp" #include "ExpresionParser.h" #include <functional> #include "TemplateForTest.hpp" #include "Variable.h" #include "FunctionRegisterHelper.h" #include "BasicFunction.h" #include "BasicType.h" #include "FunctionFactory.h" using namespace std; using namespace ffscript; #include "ExpresionParser.h" #include "ScriptCompiler.h" #include "ScriptScope.h" #include "expressionunit.h" #include "Expression.h" namespace ffscriptUT { namespace ExpressionUT { FF_TEST_FUNCTION(ExpressionTest, testParseFunction1) { ScriptCompiler scriptCompiler; ExpressionParser parser(&scriptCompiler); FunctionRegisterHelper funcLibHelper(&scriptCompiler); const BasicTypes& basicType = scriptCompiler.getTypeManager()->getBasicTypes(); scriptCompiler.getTypeManager()->registerBasicTypes(&scriptCompiler); importBasicfunction(funcLibHelper); list<ExpUnitRef> units; EExpressionResult eResult = parser.tokenize(L"1 + 2", units); FF_EXPECT_TRUE(eResult == EE_SUCCESS, L"parse string to units failed"); FF_EXPECT_TRUE(units.size() == 3, L"the units is not 1 + 2"); } FF_TEST_FUNCTION(ExpressionTest, testParseFunction2) { ScriptCompiler scriptCompiler; ExpressionParser parser(&scriptCompiler); FunctionRegisterHelper funcLibHelper(&scriptCompiler); const BasicTypes& basicType = scriptCompiler.getTypeManager()->getBasicTypes(); scriptCompiler.getTypeManager()->registerBasicTypes(&scriptCompiler); importBasicfunction(funcLibHelper); list<ExpUnitRef> units; EExpressionResult eResult = parser.tokenize(L"1 + 2 - (3 - 4)", units); FF_EXPECT_TRUE(eResult == EE_SUCCESS, L"parse string to units failed"); FF_EXPECT_TRUE(units.size() == 9, L"the units is not '1 + 2 - (3 - 4)'"); } FF_TEST_FUNCTION(ExpressionTest, testParseFunction3) { ScriptCompiler scriptCompiler; ExpressionParser parser(&scriptCompiler); FunctionRegisterHelper funcLibHelper(&scriptCompiler); const BasicTypes& basicType = scriptCompiler.getTypeManager()->getBasicTypes(); scriptCompiler.getTypeManager()->registerBasicTypes(&scriptCompiler); importBasicfunction(funcLibHelper); list<ExpUnitRef> units; EExpressionResult eResult = parser.tokenize(L"1 + \"hello\"", units); FF_EXPECT_TRUE(eResult == EE_SUCCESS, L"parse string to units failed"); FF_EXPECT_TRUE(units.size() == 3, L"the units is not '1 + \"hello\"'"); } FF_TEST_FUNCTION(ExpressionTest, testParseFunction4) { ScriptCompiler scriptCompiler; ExpressionParser parser(&scriptCompiler); FunctionRegisterHelper funcLibHelper(&scriptCompiler); const BasicTypes& basicType = scriptCompiler.getTypeManager()->getBasicTypes(); scriptCompiler.getTypeManager()->registerBasicTypes(&scriptCompiler); importBasicfunction(funcLibHelper); list<ExpUnitRef> units; EExpressionResult eResult = parser.tokenize(L"1 + L\"hello\" + 2", units); FF_EXPECT_TRUE(eResult == EE_SUCCESS, L"parse string to units failed"); FF_EXPECT_TRUE(units.size() == 5, L"the units is not '1 + L\"hello\" + 2'"); } FF_TEST_FUNCTION(ExpressionTest, testCompile1) { ScriptCompiler scriptCompiler; ExpressionParser parser(&scriptCompiler); FunctionRegisterHelper funcLibHelper(&scriptCompiler); const BasicTypes& basicType = scriptCompiler.getTypeManager()->getBasicTypes(); scriptCompiler.getTypeManager()->registerBasicTypes(&scriptCompiler); importBasicfunction(funcLibHelper); list<ExpUnitRef> units; EExpressionResult eResult = parser.tokenize(L"1 + 2", units); FF_EXPECT_TRUE(eResult == EE_SUCCESS, L"parse string to units failed"); list<ExpressionRef> expList; bool res = parser.compile(units, expList); FF_EXPECT_TRUE(res, L"compile '1 + 2' failed!"); FF_EXPECT_TRUE(expList.size() == 1, L"compile '1 + 2' and retured more than one expression"); } FF_TEST_FUNCTION(ExpressionTest, testCompile2) { ScriptCompiler scriptCompiler; ExpressionParser parser(&scriptCompiler); FunctionRegisterHelper funcLibHelper(&scriptCompiler); const BasicTypes& basicType = scriptCompiler.getTypeManager()->getBasicTypes(); scriptCompiler.getTypeManager()->registerBasicTypes(&scriptCompiler); importBasicfunction(funcLibHelper); list<ExpUnitRef> units; EExpressionResult eResult = parser.tokenize(L"1 + 2 + (3 - 4)", units); FF_EXPECT_TRUE(eResult == EE_SUCCESS, L"parse string to units failed"); list<ExpressionRef> expList; bool res = parser.compile(units, expList); FF_EXPECT_TRUE(res, L"compile '1 + 2 + (3 - 4)' failed!"); FF_EXPECT_TRUE(expList.size() == 1, L"compile '1 + 2 + (3 - 4)' and retured more than one expression"); } FF_TEST_FUNCTION(ExpressionTest, testCompile2_checkfail1) { ScriptCompiler scriptCompiler; ExpressionParser parser(&scriptCompiler); FunctionRegisterHelper funcLibHelper(&scriptCompiler); const BasicTypes& basicType = scriptCompiler.getTypeManager()->getBasicTypes(); scriptCompiler.getTypeManager()->registerBasicTypes(&scriptCompiler); importBasicfunction(funcLibHelper); list<ExpUnitRef> units; EExpressionResult eResult = parser.tokenize(L"1 + 2 + (3 - 4", units); FF_EXPECT_TRUE(eResult == EE_SUCCESS, L"parse string to units failed"); list<ExpressionRef> expList; bool res = parser.compile(units, expList); FF_EXPECT_FALSE(res, L"compile '1 + 2 + (3 - 4' must be failed!"); } FF_TEST_FUNCTION(ExpressionTest, testCompile2_checkfail2) { ScriptCompiler scriptCompiler; ExpressionParser parser(&scriptCompiler); FunctionRegisterHelper funcLibHelper(&scriptCompiler); const BasicTypes& basicType = scriptCompiler.getTypeManager()->getBasicTypes(); scriptCompiler.getTypeManager()->registerBasicTypes(&scriptCompiler); importBasicfunction(funcLibHelper); list<ExpUnitRef> units; EExpressionResult eResult = parser.tokenize(L"1 + 2 + 3 - 4)", units); FF_EXPECT_TRUE(eResult == EE_SUCCESS, L"parse string to units failed"); list<ExpressionRef> expList; bool res = parser.compile(units, expList); FF_EXPECT_FALSE(res, L"compile '1 + 2 + 3 - 4)' must be failed!"); } FF_TEST_FUNCTION(ExpressionTest, testCompile2_checkfail3) { ScriptCompiler scriptCompiler; ExpressionParser parser(&scriptCompiler); FunctionRegisterHelper funcLibHelper(&scriptCompiler); const BasicTypes& basicType = scriptCompiler.getTypeManager()->getBasicTypes(); scriptCompiler.getTypeManager()->registerBasicTypes(&scriptCompiler); importBasicfunction(funcLibHelper); list<ExpUnitRef> units; EExpressionResult eResult = parser.tokenize(L"1 + 2 + )3 - 4)", units); FF_EXPECT_TRUE(eResult == EE_SUCCESS, L"parse string to units failed"); list<ExpressionRef> expList; bool res = parser.compile(units, expList); FF_EXPECT_FALSE(res, L"compile '1 + 2 + )3 - 4)' must be failed!"); } FF_TEST_FUNCTION(ExpressionTest, testCompile2_checkfail4) { ScriptCompiler scriptCompiler; ExpressionParser parser(&scriptCompiler); FunctionRegisterHelper funcLibHelper(&scriptCompiler); const BasicTypes& basicType = scriptCompiler.getTypeManager()->getBasicTypes(); scriptCompiler.getTypeManager()->registerBasicTypes(&scriptCompiler); importBasicfunction(funcLibHelper); list<ExpUnitRef> units; EExpressionResult eResult = parser.tokenize(L"1 + 2 + (3 - 4(", units); FF_EXPECT_TRUE(eResult == EE_SUCCESS, L"parse string to units failed"); list<ExpressionRef> expList; bool res = parser.compile(units, expList); FF_EXPECT_FALSE(res, L"compile '1 + 2 + (3 - 4(' must be failed!"); } FF_TEST_FUNCTION(ExpressionTest, testCompile3) { ScriptCompiler scriptCompiler; ExpressionParser parser(&scriptCompiler); FunctionRegisterHelper funcLibHelper(&scriptCompiler); const BasicTypes& basicType = scriptCompiler.getTypeManager()->getBasicTypes(); scriptCompiler.getTypeManager()->registerBasicTypes(&scriptCompiler); importBasicfunction(funcLibHelper); list<ExpUnitRef> units; EExpressionResult eResult = parser.tokenize(L"1+2,3", units); FF_EXPECT_TRUE(eResult == EE_SUCCESS, L"parse string to units failed"); list<ExpressionRef> expList; bool res = parser.compile(units, expList); FF_EXPECT_TRUE(res, L"compile '1+2,3' failed!"); FF_EXPECT_TRUE(expList.size() == 2, L"compile '1+2,3' must return two expressions"); } FF_TEST_FUNCTION(ExpressionTest, testCompile4) { ScriptCompiler scriptCompiler; ExpressionParser parser(&scriptCompiler); FunctionRegisterHelper funcLibHelper(&scriptCompiler); const BasicTypes& basicType = scriptCompiler.getTypeManager()->getBasicTypes(); scriptCompiler.getTypeManager()->registerBasicTypes(&scriptCompiler); importBasicfunction(funcLibHelper); list<ExpUnitRef> units; EExpressionResult eResult = parser.tokenize(L"1 + 2, 3", units); FF_EXPECT_TRUE(eResult == EE_SUCCESS, L"parse string to units failed"); list<ExpressionRef> expList; bool res = parser.compile(units, expList); FF_EXPECT_TRUE(res, L"compile '1 + 2 , 3' failed!"); FF_EXPECT_TRUE(expList.size() == 2, L"compile '1 + 2, 3' must return two expressions"); } FF_TEST_FUNCTION(ExpressionTest, testCompile4_checkfail1) { ScriptCompiler scriptCompiler; ExpressionParser parser(&scriptCompiler); FunctionRegisterHelper funcLibHelper(&scriptCompiler); const BasicTypes& basicType = scriptCompiler.getTypeManager()->getBasicTypes(); scriptCompiler.getTypeManager()->registerBasicTypes(&scriptCompiler); importBasicfunction(funcLibHelper); list<ExpUnitRef> units; EExpressionResult eResult = parser.tokenize(L",1 + 2, 3", units); FF_EXPECT_TRUE(eResult == EE_SUCCESS, L"parse string to units failed"); list<ExpressionRef> expList; bool res = parser.compile(units, expList); FF_EXPECT_FALSE(res, L"compile ',1 + 2, 3' must be failed!"); } FF_TEST_FUNCTION(ExpressionTest, testCompile4_checkfail2) { ScriptCompiler scriptCompiler; ExpressionParser parser(&scriptCompiler); FunctionRegisterHelper funcLibHelper(&scriptCompiler); const BasicTypes& basicType = scriptCompiler.getTypeManager()->getBasicTypes(); scriptCompiler.getTypeManager()->registerBasicTypes(&scriptCompiler); importBasicfunction(funcLibHelper); list<ExpUnitRef> units; EExpressionResult eResult = parser.tokenize(L"1 + 2, 3,", units); FF_EXPECT_TRUE(eResult == EE_SUCCESS, L"parse string to units failed"); list<ExpressionRef> expList; bool res = parser.compile(units, expList); FF_EXPECT_FALSE(res, L"compile '1 + 2, 3,' must be failed!"); } FF_TEST_FUNCTION(ExpressionTest, testCompile4_checkfail3) { ScriptCompiler scriptCompiler; ExpressionParser parser(&scriptCompiler); FunctionRegisterHelper funcLibHelper(&scriptCompiler); const BasicTypes& basicType = scriptCompiler.getTypeManager()->getBasicTypes(); scriptCompiler.getTypeManager()->registerBasicTypes(&scriptCompiler); importBasicfunction(funcLibHelper); list<ExpUnitRef> units; EExpressionResult eResult = parser.tokenize(L",1 + 2, 3,", units); FF_EXPECT_TRUE(eResult == EE_SUCCESS, L"parse string to units failed"); list<ExpressionRef> expList; bool res = parser.compile(units, expList); FF_EXPECT_FALSE(res, L"compile ',1 + 2, 3,' must be failed!"); } FF_TEST_FUNCTION(ExpressionTest, testCompile5) { ScriptCompiler scriptCompiler; ExpressionParser parser(&scriptCompiler); FunctionRegisterHelper funcLibHelper(&scriptCompiler); const BasicTypes& basicType = scriptCompiler.getTypeManager()->getBasicTypes(); scriptCompiler.getTypeManager()->registerBasicTypes(&scriptCompiler); importBasicfunction(funcLibHelper); list<ExpUnitRef> units; EExpressionResult eResult = parser.tokenize(L"1 + 2, 3 - 4", units); FF_EXPECT_TRUE(eResult == EE_SUCCESS, L"parse string to units failed"); list<ExpressionRef> expList; bool res = parser.compile(units, expList); FF_EXPECT_TRUE(res, L"compile '1 + 2 + (3 - 4)' failed!"); FF_EXPECT_TRUE(expList.size() == 2, L"compile '1 + 2, 3 - 4' must return two expressions"); } FF_TEST_FUNCTION(ExpressionTest, testCompile6) { ScriptCompiler scriptCompiler; ExpressionParser parser(&scriptCompiler); FunctionRegisterHelper funcLibHelper(&scriptCompiler); const BasicTypes& basicType = scriptCompiler.getTypeManager()->getBasicTypes(); scriptCompiler.getTypeManager()->registerBasicTypes(&scriptCompiler); importBasicfunction(funcLibHelper); list<ExpUnitRef> units; EExpressionResult eResult = parser.tokenize(L"1 + 2 * 3 - 4", units); FF_EXPECT_TRUE(eResult == EE_SUCCESS, L"parse string to units failed"); list<ExpressionRef> expList; bool res = parser.compile(units, expList); FF_EXPECT_TRUE(res, L"compile '1 + 2 * 3 - 4' failed!"); FF_EXPECT_TRUE(expList.size() == 1, L"compile '1 + 2 * 3 - 4' must return one expression"); } FF_TEST_FUNCTION(ExpressionTest, testCompile6_checkfail1) { ScriptCompiler scriptCompiler; ExpressionParser parser(&scriptCompiler); FunctionRegisterHelper funcLibHelper(&scriptCompiler); const BasicTypes& basicType = scriptCompiler.getTypeManager()->getBasicTypes(); scriptCompiler.getTypeManager()->registerBasicTypes(&scriptCompiler); importBasicfunction(funcLibHelper); list<ExpUnitRef> units; EExpressionResult eResult = parser.tokenize(L"1 + 2 3 * - 4", units); FF_EXPECT_TRUE(eResult == EE_SUCCESS, L"parse string to units failed"); list<ExpressionRef> expList; bool res = parser.compile(units, expList); FF_EXPECT_FALSE(res, L"compile '1 + 2 3 * - 4' must failed!"); } FF_TEST_FUNCTION(ExpressionTest, testCompile6_1) { ScriptCompiler scriptCompiler; ExpressionParser parser(&scriptCompiler); FunctionRegisterHelper funcLibHelper(&scriptCompiler); const BasicTypes& basicType = scriptCompiler.getTypeManager()->getBasicTypes(); scriptCompiler.getTypeManager()->registerBasicTypes(&scriptCompiler); importBasicfunction(funcLibHelper); list<ExpUnitRef> units; EExpressionResult eResult = parser.tokenize(L"1 + 2 * - 4", units); FF_EXPECT_TRUE(eResult == EE_SUCCESS, L"parse string to units failed"); list<ExpressionRef> expList; bool res = parser.compile(units, expList); //because 1 + 2 * - 4 equal to 1 + 2 * (-4) //so the expression is valid FF_EXPECT_TRUE(res, L"compile '1 + 2 * - 4' must success!"); eResult = parser.link(expList.front().get()); FF_EXPECT_TRUE(eResult == EE_SUCCESS, L"link expression '1 + 2 * - 4' failed."); FF_EXPECT_TRUE(((Function*)expList.front()->getRoot().get())->getChild(0)->toString() == "1", L"first param of root function of '1 + 2 * (- 4)' must be '1'"); FF_EXPECT_TRUE(((Function*)expList.front()->getRoot().get())->getChild(1)->toString() == "*", L"second param of root function of '1 + 2 * (- 4)' must be '*'"); } FF_TEST_FUNCTION(ExpressionTest, testCompile6_2) { ScriptCompiler scriptCompiler; ExpressionParser parser(&scriptCompiler); FunctionRegisterHelper funcLibHelper(&scriptCompiler); const BasicTypes& basicType = scriptCompiler.getTypeManager()->getBasicTypes(); scriptCompiler.getTypeManager()->registerBasicTypes(&scriptCompiler); importBasicfunction(funcLibHelper); list<ExpUnitRef> units; EExpressionResult eResult = parser.tokenize(L"1 + 2 * (- 4)", units); FF_EXPECT_TRUE(eResult == EE_SUCCESS, L"parse string to units failed"); list<ExpressionRef> expList; bool res = parser.compile(units, expList); FF_EXPECT_TRUE(res, L"compile '1 + 2 * (- 4)' must success!"); eResult = parser.link(expList.front().get()); FF_EXPECT_TRUE(eResult == EE_SUCCESS, L"link expression '1 + 2 * (- 4)' failed."); FF_EXPECT_TRUE(expList.front()->getRoot()->toString() == "+", L"root unit of '1 + 2 * (- 4)' must be '+'"); FF_EXPECT_TRUE(((Function*)expList.front()->getRoot().get())->getChild(0)->toString() == "1", L"first param of root function of '1 + 2 * (- 4)' must be '1'"); FF_EXPECT_TRUE(((Function*)expList.front()->getRoot().get())->getChild(1)->toString() == "*", L"second param of root function of '1 + 2 * (- 4)' must be '*'"); } FF_TEST_FUNCTION(ExpressionTest, testCompile7) { ScriptCompiler scriptCompiler; ExpressionParser parser(&scriptCompiler); FunctionRegisterHelper funcLibHelper(&scriptCompiler); const BasicTypes& basicType = scriptCompiler.getTypeManager()->getBasicTypes(); scriptCompiler.getTypeManager()->registerBasicTypes(&scriptCompiler); importBasicfunction(funcLibHelper); list<ExpUnitRef> units; EExpressionResult eResult = parser.tokenize(L"1 * 2 + 3", units); FF_EXPECT_TRUE(eResult == EE_SUCCESS, L"parse string to units failed"); list<ExpressionRef> expList; bool res = parser.compile(units, expList); FF_EXPECT_TRUE(res, L"compile '1 * 2 + 3' failed!"); FF_EXPECT_TRUE(expList.size() == 1, L"compile '1 * 2 + 3' must return one expression"); FF_EXPECT_TRUE(expList.front()->getRoot()->toString() == "+", L"root unit of '1 * 2 + 3' must be '+'"); } FF_TEST_FUNCTION(ExpressionTest, testCompile8) { ScriptCompiler scriptCompiler; ExpressionParser parser(&scriptCompiler); FunctionRegisterHelper funcLibHelper(&scriptCompiler); const BasicTypes& basicType = scriptCompiler.getTypeManager()->getBasicTypes(); scriptCompiler.getTypeManager()->registerBasicTypes(&scriptCompiler); importBasicfunction(funcLibHelper); list<ExpUnitRef> units; EExpressionResult eResult = parser.tokenize(L"1 * (2 + 3)", units); FF_EXPECT_TRUE(eResult == EE_SUCCESS, L"parse string to units failed"); list<ExpressionRef> expList; bool res = parser.compile(units, expList); FF_EXPECT_TRUE(res, L"compile '1 * 2 + 3' failed!"); FF_EXPECT_TRUE(expList.size() == 1, L"compile '1 * (2 + 3)' must return one expression"); FF_EXPECT_TRUE(expList.front()->getRoot()->toString() == "*", L"root unit of '1 * (2 + 3)' must be '*'"); } FF_TEST_FUNCTION(ExpressionTest, testCompile9) { ScriptCompiler scriptCompiler; ExpressionParser parser(&scriptCompiler); FunctionRegisterHelper funcLibHelper(&scriptCompiler); const BasicTypes& basicType = scriptCompiler.getTypeManager()->getBasicTypes(); scriptCompiler.getTypeManager()->registerBasicTypes(&scriptCompiler); importBasicfunction(funcLibHelper); list<ExpUnitRef> units; EExpressionResult eResult = parser.tokenize(L"1 + 2", units); FF_EXPECT_TRUE(eResult == EE_SUCCESS, L"parse string to units failed"); list<ExpressionRef> expList; bool res = parser.compile(units, expList); FF_EXPECT_TRUE(res, L"compile '1 + 2' failed!"); eResult = parser.link(expList.front().get()); FF_EXPECT_TRUE(eResult == EE_SUCCESS, L"link expression '1 + 2' failed."); FF_EXPECT_TRUE(expList.front()->getRoot()->toString() == "+", L"root unit of '1 + 2' must be '+'"); FF_EXPECT_TRUE( ((Function*)expList.front()->getRoot().get())->getChild(0)->toString() == "1", L"first param of '1 + 2' must be '1'"); } static Function* createSumFunction(const string& name, int id) { return new FixParamFunction<2>(name, EXP_UNIT_ID_USER_FUNC, FUNCTION_PRIORITY_USER_FUNCTION, "int"); } FF_TEST_FUNCTION(ExpressionTest, testCompile11) { ScriptCompiler scriptCompiler; ExpressionParser parser(&scriptCompiler); FunctionRegisterHelper funcLibHelper(&scriptCompiler); const BasicTypes& basicType = scriptCompiler.getTypeManager()->getBasicTypes(); scriptCompiler.getTypeManager()->registerBasicTypes(&scriptCompiler); importBasicfunction(funcLibHelper); //register a custom function FunctionFactoryCdecl sumFactor(createSumFunction, ScriptType(basicType.TYPE_INT, "int")); scriptCompiler.registFunction("sum", "int,int", &sumFactor); list<ExpUnitRef> units; EExpressionResult eResult = parser.tokenize(L"sum(1,2)", units); FF_EXPECT_TRUE(eResult == EE_SUCCESS, L"parse string to units failed"); list<ExpressionRef> expList; bool res = parser.compile(units, expList); Expression* expressionPtr = expList.front().get(); parser.link(expressionPtr); FF_EXPECT_TRUE(res, L"compile 'sum(1,2)' failed!"); FF_EXPECT_TRUE(expList.front()->getRoot()->toString() == "sum", L"root unit of 'sum(1,2)' must be '+'"); FF_EXPECT_TRUE(((Function*)expList.front()->getRoot().get())->getChild(0)->toString() == "1", L"first param of 'sum(1,2)' must be '1'"); FF_EXPECT_TRUE(((Function*)expList.front()->getRoot().get())->getChild(1)->toString() == "2", L"second param of 'sum(1,2)' must be '2'"); } }; }
38.630037
162
0.725062
VincentPT
0d9f7963efa15408fd1a55f3f467edb554f6eab8
2,008
cpp
C++
src/framework/shared/object/fxuserobject.cpp
IT-Enthusiast-Nepal/Windows-Driver-Frameworks
bfee6134f30f92a90dbf96e98d54582ecb993996
[ "MIT" ]
994
2015-03-18T21:37:07.000Z
2019-04-26T04:04:14.000Z
src/framework/shared/object/fxuserobject.cpp
IT-Enthusiast-Nepal/Windows-Driver-Frameworks
bfee6134f30f92a90dbf96e98d54582ecb993996
[ "MIT" ]
13
2019-06-13T15:58:03.000Z
2022-02-18T22:53:35.000Z
src/framework/shared/object/fxuserobject.cpp
IT-Enthusiast-Nepal/Windows-Driver-Frameworks
bfee6134f30f92a90dbf96e98d54582ecb993996
[ "MIT" ]
350
2015-03-19T04:29:46.000Z
2019-05-05T23:26:50.000Z
/*++ Copyright (c) Microsoft Corporation Module Name: FxUserObject.cpp Abstract: This module implements the user object that device driver writers can use to take advantage of the driver frameworks infrastructure. Author: Environment: Both kernel and user mode Revision History: --*/ #include "fxobjectpch.hpp" #include "FxUserObject.hpp" // Tracing support extern "C" { #if defined(EVENT_TRACING) #include "FxUserObject.tmh" #endif } _Must_inspect_result_ NTSTATUS FxUserObject::_Create( __in PFX_DRIVER_GLOBALS FxDriverGlobals, __in_opt PWDF_OBJECT_ATTRIBUTES Attributes, __out FxUserObject** pUserObject ) { FxUserObject* pObject = NULL; NTSTATUS status; USHORT wrapperSize = 0; WDFOBJECT handle; #ifdef INLINE_WRAPPER_ALLOCATION #if FX_CORE_MODE==FX_CORE_USER_MODE wrapperSize = FxUserObject::GetWrapperSize(); #endif #endif pObject = new(FxDriverGlobals, Attributes, wrapperSize) FxUserObject(FxDriverGlobals); if (pObject == NULL) { DoTraceLevelMessage(FxDriverGlobals, TRACE_LEVEL_ERROR, TRACINGOBJECT, "Memory allocation failed"); return STATUS_INSUFFICIENT_RESOURCES; } status = pObject->Commit(Attributes, &handle); if (!NT_SUCCESS(status)) { DoTraceLevelMessage(FxDriverGlobals, TRACE_LEVEL_ERROR, TRACINGOBJECT, "FxObject::Commit failed %!STATUS!", status); } if (NT_SUCCESS(status)) { *pUserObject = pObject; } else { pObject->DeleteFromFailedCreate(); } return status; } // // Public constructors // FxUserObject::FxUserObject( __in PFX_DRIVER_GLOBALS FxDriverGlobals ) : #ifdef INLINE_WRAPPER_ALLOCATION FxNonPagedObject(FX_TYPE_USEROBJECT, sizeof(FxUserObject) + GetWrapperSize(), FxDriverGlobals) #else FxNonPagedObject(FX_TYPE_USEROBJECT, sizeof(FxUserObject), FxDriverGlobals) #endif { return; }
18.766355
98
0.687749
IT-Enthusiast-Nepal
0da135a935b15babcdd69091c7c57cb34ae5e7a0
1,635
cpp
C++
mitsuba-af602c6fd98a/src/libhw/gpuprogram.cpp
NTForked-ML/pbrs
0b405d92c12d257e2581366542762c9f0c3facce
[ "MIT" ]
139
2017-04-21T00:22:34.000Z
2022-02-16T20:33:10.000Z
mitsuba-af602c6fd98a/src/libhw/gpuprogram.cpp
NTForked-ML/pbrs
0b405d92c12d257e2581366542762c9f0c3facce
[ "MIT" ]
11
2017-08-15T18:22:59.000Z
2019-07-01T05:44:41.000Z
mitsuba-af602c6fd98a/src/libhw/gpuprogram.cpp
NTForked-ML/pbrs
0b405d92c12d257e2581366542762c9f0c3facce
[ "MIT" ]
30
2017-07-21T03:56:45.000Z
2022-03-11T06:55:34.000Z
/* This file is part of Mitsuba, a physically based rendering system. Copyright (c) 2007-2014 by Wenzel Jakob and others. Mitsuba is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License Version 3 as published by the Free Software Foundation. Mitsuba is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include <mitsuba/hw/gpuprogram.h> #include <boost/filesystem/fstream.hpp> MTS_NAMESPACE_BEGIN GPUProgram::GPUProgram(const std::string &name) : m_name(name), m_inputGeometryType(ETriangles), m_outputGeometryType(ETriangleStrips), m_maxVertices(0), m_bound(false) { } GPUProgram::~GPUProgram() { } void GPUProgram::setSourceFile(EType type, const fs::path &path) { fs::ifstream ifs(path); if (ifs.fail() || ifs.bad()) Log(EError, "Unable to load GPU program \"%s\"", path.string().c_str()); std::string code, line; while (getline(ifs, line)) { code += line; code += "\n"; } ifs.close(); setSource(type, code); } std::string GPUProgram::toString() const { std::ostringstream oss; oss << "GPUProgram[name = '" << m_name<< "'"; if (m_maxVertices != 0) oss << ", maxVertices=" << m_maxVertices; oss << "]"; return oss.str(); } MTS_IMPLEMENT_CLASS(GPUProgram, true, Object) MTS_NAMESPACE_END
27.25
72
0.705199
NTForked-ML
d3fa83a87005e29c17820aa49ef4fb3593d3e581
2,032
cpp
C++
LeetCode/146_LRU_cache.cpp
tanishq1g/cp_codes
80b8ccc9e195a66d6d317076fdd54a02cd21275b
[ "MIT" ]
null
null
null
LeetCode/146_LRU_cache.cpp
tanishq1g/cp_codes
80b8ccc9e195a66d6d317076fdd54a02cd21275b
[ "MIT" ]
null
null
null
LeetCode/146_LRU_cache.cpp
tanishq1g/cp_codes
80b8ccc9e195a66d6d317076fdd54a02cd21275b
[ "MIT" ]
null
null
null
#include <iostream> #include <vector> #include <map> #include <algorithm> #include <cstdlib> #include <string> #include <list> using namespace std; struct Cache { int _key; int _value; Cache(int key = 0, int value = 0) { _key = key; _value = value; } }; class LRUCache{ list<Cache> cache; unordered_map<int, list<Cache>::iterator> posMap; int _capacity; public: LRUCache(int capacity) { _capacity = capacity; } int get(int key) { if (posMap.find(key) == posMap.end()) return -1; //find the position of key auto it = posMap[key]; //move the founded cache value to the front cache.push_front(*it); //delete the duplicate copy at the original position cache.erase(it); //update the posMap of key to new position: begin() posMap[key] = cache.begin(); return posMap[key]->_value; } void put(int key, int value) { //if cannot find the new key in the cache, need to insert it //only in this case delete is needed, when cache size is larger than capacity //else just update the value and update the cache key position to the front if (posMap.find(key) == posMap.end()) { //insert the new cache value to the front cache.push_front(Cache(key, value)); posMap[key] = cache.begin(); //if size larger than capacity, delete the last value if (cache.size() > _capacity) { //delete the last elements' iterator in map, and delete the last element Cache lastNode = cache.back(); posMap.erase(lastNode._key); cache.pop_back(); } } else { //find the position of the key, update value and update pos to begin() auto it = posMap[key]; it->_value = value; cache.push_front(*it); cache.erase(it); posMap[key] = cache.begin(); } } };
31.261538
88
0.56939
tanishq1g
d3fb059b7c3cb5f46273014a45feddabc1170806
273,722
cpp
C++
CodeGenere/photogram/cEqCorLI_Multi_5_DRPts1.cpp
kikislater/micmac
3009dbdad62b3ad906ec882b74b85a3db86ca755
[ "CECILL-B" ]
451
2016-11-25T09:40:28.000Z
2022-03-30T04:20:42.000Z
CodeGenere/photogram/cEqCorLI_Multi_5_DRPts1.cpp
kikislater/micmac
3009dbdad62b3ad906ec882b74b85a3db86ca755
[ "CECILL-B" ]
143
2016-11-25T20:35:57.000Z
2022-03-01T11:58:02.000Z
CodeGenere/photogram/cEqCorLI_Multi_5_DRPts1.cpp
kikislater/micmac
3009dbdad62b3ad906ec882b74b85a3db86ca755
[ "CECILL-B" ]
139
2016-12-02T10:26:21.000Z
2022-03-10T19:40:29.000Z
/*Header-MicMac-eLiSe-25/06/2007 MicMac : Multi Image Correspondances par Methodes Automatiques de Correlation eLiSe : ELements of an Image Software Environnement www.micmac.ign.fr Copyright : Institut Geographique National Author : Marc Pierrot Deseilligny Contributors : Gregoire Maillet, Didier Boldo. [1] M. Pierrot-Deseilligny, N. Paparoditis. "A multiresolution and optimization-based image matching approach: An application to surface reconstruction from SPOT5-HRS stereo imagery." In IAPRS vol XXXVI-1/W41 in ISPRS Workshop On Topographic Mapping From Space (With Special Emphasis on Small Satellites), Ankara, Turquie, 02-2006. [2] M. Pierrot-Deseilligny, "MicMac, un lociel de mise en correspondance d'images, adapte au contexte geograhique" to appears in Bulletin d'information de l'Institut Geographique National, 2007. Francais : MicMac est un logiciel de mise en correspondance d'image adapte au contexte de recherche en information geographique. Il s'appuie sur la bibliotheque de manipulation d'image eLiSe. Il est distibue sous la licences Cecill-B. Voir en bas de fichier et http://www.cecill.info. English : MicMac is an open source software specialized in image matching for research in geographic information. MicMac is built on the eLiSe image library. MicMac is governed by the "Cecill-B licence". See below and http://www.cecill.info. Header-MicMac-eLiSe-25/06/2007*/ // File Automatically generated by eLiSe #include "general/all.h" #include "private/all.h" #include "cEqCorLI_Multi_5_DRPts1.h" cEqCorLI_Multi_5_DRPts1::cEqCorLI_Multi_5_DRPts1(): cElCompiledFonc(5) { AddIntRef (cIncIntervale("OrA",0,6)); AddIntRef (cIncIntervale("OrB",6,12)); AddIntRef (cIncIntervale("OrPts",12,24)); Close(false); } void cEqCorLI_Multi_5_DRPts1::ComputeVal() { double tmp0_ = mCompCoord[12]; double tmp1_ = mCompCoord[13]; double tmp2_ = tmp1_*mLocTimeRot; double tmp3_ = tmp0_+tmp2_; double tmp4_ = cos(tmp3_); double tmp5_ = mCompCoord[14]; double tmp6_ = mCompCoord[15]; double tmp7_ = tmp6_*mLocTimeRot; double tmp8_ = tmp5_+tmp7_; double tmp9_ = mCompCoord[16]; double tmp10_ = mCompCoord[17]; double tmp11_ = tmp10_*mLocTimeRot; double tmp12_ = tmp9_+tmp11_; double tmp13_ = sin(tmp3_); double tmp14_ = -(tmp13_); double tmp15_ = sin(tmp12_); double tmp16_ = sin(tmp8_); double tmp17_ = -(tmp16_); double tmp18_ = tmp4_*tmp17_; double tmp19_ = cos(tmp12_); double tmp20_ = mCompCoord[0]; double tmp21_ = mCompCoord[1]; double tmp22_ = cos(tmp21_); double tmp23_ = cos(tmp8_); double tmp24_ = -(tmp15_); double tmp25_ = tmp13_*tmp17_; double tmp26_ = sin(tmp20_); double tmp27_ = cos(tmp20_); double tmp28_ = sin(tmp21_); double tmp29_ = mCompCoord[2]; double tmp30_ = tmp4_*tmp23_; double tmp31_ = tmp30_*mLocP3X_A_0; double tmp32_ = tmp14_*tmp19_; double tmp33_ = tmp18_*tmp15_; double tmp34_ = tmp32_+tmp33_; double tmp35_ = (tmp34_)*mLocP3Y_A_0; double tmp36_ = tmp31_+tmp35_; double tmp37_ = tmp14_*tmp24_; double tmp38_ = tmp18_*tmp19_; double tmp39_ = tmp37_+tmp38_; double tmp40_ = (tmp39_)*mLocP3Z_A_0; double tmp41_ = tmp36_+tmp40_; double tmp42_ = mCompCoord[18]; double tmp43_ = mCompCoord[19]; double tmp44_ = tmp43_*mLocTimeRot; double tmp45_ = tmp42_+tmp44_; double tmp46_ = tmp41_+tmp45_; double tmp47_ = mCompCoord[3]; double tmp48_ = (tmp46_)-tmp47_; double tmp49_ = sin(tmp29_); double tmp50_ = -(tmp49_); double tmp51_ = -(tmp28_); double tmp52_ = cos(tmp29_); double tmp53_ = tmp13_*tmp23_; double tmp54_ = tmp53_*mLocP3X_A_0; double tmp55_ = tmp4_*tmp19_; double tmp56_ = tmp25_*tmp15_; double tmp57_ = tmp55_+tmp56_; double tmp58_ = (tmp57_)*mLocP3Y_A_0; double tmp59_ = tmp54_+tmp58_; double tmp60_ = tmp4_*tmp24_; double tmp61_ = tmp25_*tmp19_; double tmp62_ = tmp60_+tmp61_; double tmp63_ = (tmp62_)*mLocP3Z_A_0; double tmp64_ = tmp59_+tmp63_; double tmp65_ = mCompCoord[20]; double tmp66_ = mCompCoord[21]; double tmp67_ = tmp66_*mLocTimeRot; double tmp68_ = tmp65_+tmp67_; double tmp69_ = tmp64_+tmp68_; double tmp70_ = mCompCoord[4]; double tmp71_ = (tmp69_)-tmp70_; double tmp72_ = tmp16_*mLocP3X_A_0; double tmp73_ = tmp23_*tmp15_; double tmp74_ = tmp73_*mLocP3Y_A_0; double tmp75_ = tmp72_+tmp74_; double tmp76_ = tmp23_*tmp19_; double tmp77_ = tmp76_*mLocP3Z_A_0; double tmp78_ = tmp75_+tmp77_; double tmp79_ = mCompCoord[22]; double tmp80_ = mCompCoord[23]; double tmp81_ = tmp80_*mLocTimeRot; double tmp82_ = tmp79_+tmp81_; double tmp83_ = tmp78_+tmp82_; double tmp84_ = mCompCoord[5]; double tmp85_ = (tmp83_)-tmp84_; double tmp86_ = -(tmp26_); double tmp87_ = tmp27_*tmp51_; double tmp88_ = tmp26_*tmp51_; double tmp89_ = tmp86_*tmp50_; double tmp90_ = tmp87_*tmp52_; double tmp91_ = tmp89_+tmp90_; double tmp92_ = (tmp91_)*(tmp48_); double tmp93_ = tmp27_*tmp50_; double tmp94_ = tmp88_*tmp52_; double tmp95_ = tmp93_+tmp94_; double tmp96_ = (tmp95_)*(tmp71_); double tmp97_ = tmp92_+tmp96_; double tmp98_ = tmp22_*tmp52_; double tmp99_ = tmp98_*(tmp85_); double tmp100_ = tmp97_+tmp99_; double tmp101_ = tmp27_*tmp22_; double tmp102_ = tmp101_*(tmp48_); double tmp103_ = tmp26_*tmp22_; double tmp104_ = tmp103_*(tmp71_); double tmp105_ = tmp102_+tmp104_; double tmp106_ = tmp28_*(tmp85_); double tmp107_ = tmp105_+tmp106_; double tmp108_ = (tmp107_)/(tmp100_); double tmp109_ = mLocCoeffU_A_0*(tmp108_); double tmp110_ = mLocCste_A_0+tmp109_; double tmp111_ = tmp86_*tmp52_; double tmp112_ = tmp87_*tmp49_; double tmp113_ = tmp111_+tmp112_; double tmp114_ = (tmp113_)*(tmp48_); double tmp115_ = tmp27_*tmp52_; double tmp116_ = tmp88_*tmp49_; double tmp117_ = tmp115_+tmp116_; double tmp118_ = (tmp117_)*(tmp71_); double tmp119_ = tmp114_+tmp118_; double tmp120_ = tmp22_*tmp49_; double tmp121_ = tmp120_*(tmp85_); double tmp122_ = tmp119_+tmp121_; double tmp123_ = (tmp122_)/(tmp100_); double tmp124_ = mLocCoeffV_A_0*(tmp123_); double tmp125_ = tmp110_+tmp124_; double tmp126_ = tmp30_*mLocP3X_A_1; double tmp127_ = (tmp34_)*mLocP3Y_A_1; double tmp128_ = tmp126_+tmp127_; double tmp129_ = (tmp39_)*mLocP3Z_A_1; double tmp130_ = tmp128_+tmp129_; double tmp131_ = tmp130_+tmp45_; double tmp132_ = (tmp131_)-tmp47_; double tmp133_ = tmp53_*mLocP3X_A_1; double tmp134_ = (tmp57_)*mLocP3Y_A_1; double tmp135_ = tmp133_+tmp134_; double tmp136_ = (tmp62_)*mLocP3Z_A_1; double tmp137_ = tmp135_+tmp136_; double tmp138_ = tmp137_+tmp68_; double tmp139_ = (tmp138_)-tmp70_; double tmp140_ = tmp16_*mLocP3X_A_1; double tmp141_ = tmp73_*mLocP3Y_A_1; double tmp142_ = tmp140_+tmp141_; double tmp143_ = tmp76_*mLocP3Z_A_1; double tmp144_ = tmp142_+tmp143_; double tmp145_ = tmp144_+tmp82_; double tmp146_ = (tmp145_)-tmp84_; double tmp147_ = (tmp91_)*(tmp132_); double tmp148_ = (tmp95_)*(tmp139_); double tmp149_ = tmp147_+tmp148_; double tmp150_ = tmp98_*(tmp146_); double tmp151_ = tmp149_+tmp150_; double tmp152_ = tmp30_*mLocP3X_A_2; double tmp153_ = (tmp34_)*mLocP3Y_A_2; double tmp154_ = tmp152_+tmp153_; double tmp155_ = (tmp39_)*mLocP3Z_A_2; double tmp156_ = tmp154_+tmp155_; double tmp157_ = tmp156_+tmp45_; double tmp158_ = (tmp157_)-tmp47_; double tmp159_ = tmp53_*mLocP3X_A_2; double tmp160_ = (tmp57_)*mLocP3Y_A_2; double tmp161_ = tmp159_+tmp160_; double tmp162_ = (tmp62_)*mLocP3Z_A_2; double tmp163_ = tmp161_+tmp162_; double tmp164_ = tmp163_+tmp68_; double tmp165_ = (tmp164_)-tmp70_; double tmp166_ = tmp16_*mLocP3X_A_2; double tmp167_ = tmp73_*mLocP3Y_A_2; double tmp168_ = tmp166_+tmp167_; double tmp169_ = tmp76_*mLocP3Z_A_2; double tmp170_ = tmp168_+tmp169_; double tmp171_ = tmp170_+tmp82_; double tmp172_ = (tmp171_)-tmp84_; double tmp173_ = (tmp91_)*(tmp158_); double tmp174_ = (tmp95_)*(tmp165_); double tmp175_ = tmp173_+tmp174_; double tmp176_ = tmp98_*(tmp172_); double tmp177_ = tmp175_+tmp176_; double tmp178_ = tmp30_*mLocP3X_A_3; double tmp179_ = (tmp34_)*mLocP3Y_A_3; double tmp180_ = tmp178_+tmp179_; double tmp181_ = (tmp39_)*mLocP3Z_A_3; double tmp182_ = tmp180_+tmp181_; double tmp183_ = tmp182_+tmp45_; double tmp184_ = (tmp183_)-tmp47_; double tmp185_ = tmp53_*mLocP3X_A_3; double tmp186_ = (tmp57_)*mLocP3Y_A_3; double tmp187_ = tmp185_+tmp186_; double tmp188_ = (tmp62_)*mLocP3Z_A_3; double tmp189_ = tmp187_+tmp188_; double tmp190_ = tmp189_+tmp68_; double tmp191_ = (tmp190_)-tmp70_; double tmp192_ = tmp16_*mLocP3X_A_3; double tmp193_ = tmp73_*mLocP3Y_A_3; double tmp194_ = tmp192_+tmp193_; double tmp195_ = tmp76_*mLocP3Z_A_3; double tmp196_ = tmp194_+tmp195_; double tmp197_ = tmp196_+tmp82_; double tmp198_ = (tmp197_)-tmp84_; double tmp199_ = (tmp91_)*(tmp184_); double tmp200_ = (tmp95_)*(tmp191_); double tmp201_ = tmp199_+tmp200_; double tmp202_ = tmp98_*(tmp198_); double tmp203_ = tmp201_+tmp202_; double tmp204_ = tmp30_*mLocP3X_A_4; double tmp205_ = (tmp34_)*mLocP3Y_A_4; double tmp206_ = tmp204_+tmp205_; double tmp207_ = (tmp39_)*mLocP3Z_A_4; double tmp208_ = tmp206_+tmp207_; double tmp209_ = tmp208_+tmp45_; double tmp210_ = (tmp209_)-tmp47_; double tmp211_ = tmp53_*mLocP3X_A_4; double tmp212_ = (tmp57_)*mLocP3Y_A_4; double tmp213_ = tmp211_+tmp212_; double tmp214_ = (tmp62_)*mLocP3Z_A_4; double tmp215_ = tmp213_+tmp214_; double tmp216_ = tmp215_+tmp68_; double tmp217_ = (tmp216_)-tmp70_; double tmp218_ = tmp16_*mLocP3X_A_4; double tmp219_ = tmp73_*mLocP3Y_A_4; double tmp220_ = tmp218_+tmp219_; double tmp221_ = tmp76_*mLocP3Z_A_4; double tmp222_ = tmp220_+tmp221_; double tmp223_ = tmp222_+tmp82_; double tmp224_ = (tmp223_)-tmp84_; double tmp225_ = (tmp91_)*(tmp210_); double tmp226_ = (tmp95_)*(tmp217_); double tmp227_ = tmp225_+tmp226_; double tmp228_ = tmp98_*(tmp224_); double tmp229_ = tmp227_+tmp228_; double tmp230_ = tmp101_*(tmp132_); double tmp231_ = tmp103_*(tmp139_); double tmp232_ = tmp230_+tmp231_; double tmp233_ = tmp28_*(tmp146_); double tmp234_ = tmp232_+tmp233_; double tmp235_ = (tmp234_)/(tmp151_); double tmp236_ = mLocCoeffU_A_1*(tmp235_); double tmp237_ = mLocCste_A_1+tmp236_; double tmp238_ = (tmp113_)*(tmp132_); double tmp239_ = (tmp117_)*(tmp139_); double tmp240_ = tmp238_+tmp239_; double tmp241_ = tmp120_*(tmp146_); double tmp242_ = tmp240_+tmp241_; double tmp243_ = (tmp242_)/(tmp151_); double tmp244_ = mLocCoeffV_A_1*(tmp243_); double tmp245_ = tmp237_+tmp244_; double tmp246_ = tmp101_*(tmp158_); double tmp247_ = tmp103_*(tmp165_); double tmp248_ = tmp246_+tmp247_; double tmp249_ = tmp28_*(tmp172_); double tmp250_ = tmp248_+tmp249_; double tmp251_ = (tmp250_)/(tmp177_); double tmp252_ = mLocCoeffU_A_2*(tmp251_); double tmp253_ = mLocCste_A_2+tmp252_; double tmp254_ = (tmp113_)*(tmp158_); double tmp255_ = (tmp117_)*(tmp165_); double tmp256_ = tmp254_+tmp255_; double tmp257_ = tmp120_*(tmp172_); double tmp258_ = tmp256_+tmp257_; double tmp259_ = (tmp258_)/(tmp177_); double tmp260_ = mLocCoeffV_A_2*(tmp259_); double tmp261_ = tmp253_+tmp260_; double tmp262_ = tmp101_*(tmp184_); double tmp263_ = tmp103_*(tmp191_); double tmp264_ = tmp262_+tmp263_; double tmp265_ = tmp28_*(tmp198_); double tmp266_ = tmp264_+tmp265_; double tmp267_ = (tmp266_)/(tmp203_); double tmp268_ = mLocCoeffU_A_3*(tmp267_); double tmp269_ = mLocCste_A_3+tmp268_; double tmp270_ = (tmp113_)*(tmp184_); double tmp271_ = (tmp117_)*(tmp191_); double tmp272_ = tmp270_+tmp271_; double tmp273_ = tmp120_*(tmp198_); double tmp274_ = tmp272_+tmp273_; double tmp275_ = (tmp274_)/(tmp203_); double tmp276_ = mLocCoeffV_A_3*(tmp275_); double tmp277_ = tmp269_+tmp276_; double tmp278_ = tmp101_*(tmp210_); double tmp279_ = tmp103_*(tmp217_); double tmp280_ = tmp278_+tmp279_; double tmp281_ = tmp28_*(tmp224_); double tmp282_ = tmp280_+tmp281_; double tmp283_ = (tmp282_)/(tmp229_); double tmp284_ = mLocCoeffU_A_4*(tmp283_); double tmp285_ = mLocCste_A_4+tmp284_; double tmp286_ = (tmp113_)*(tmp210_); double tmp287_ = (tmp117_)*(tmp217_); double tmp288_ = tmp286_+tmp287_; double tmp289_ = tmp120_*(tmp224_); double tmp290_ = tmp288_+tmp289_; double tmp291_ = (tmp290_)/(tmp229_); double tmp292_ = mLocCoeffV_A_4*(tmp291_); double tmp293_ = tmp285_+tmp292_; double tmp294_ = tmp125_+tmp245_; double tmp295_ = tmp294_+tmp261_; double tmp296_ = tmp295_+tmp277_; double tmp297_ = tmp296_+tmp293_; double tmp298_ = (tmp297_)/5; double tmp299_ = mCompCoord[6]; double tmp300_ = mCompCoord[7]; double tmp301_ = cos(tmp300_); double tmp302_ = sin(tmp299_); double tmp303_ = cos(tmp299_); double tmp304_ = sin(tmp300_); double tmp305_ = mCompCoord[8]; double tmp306_ = tmp30_*mLocP3X_B_0; double tmp307_ = (tmp34_)*mLocP3Y_B_0; double tmp308_ = tmp306_+tmp307_; double tmp309_ = (tmp39_)*mLocP3Z_B_0; double tmp310_ = tmp308_+tmp309_; double tmp311_ = tmp310_+tmp45_; double tmp312_ = mCompCoord[9]; double tmp313_ = (tmp311_)-tmp312_; double tmp314_ = sin(tmp305_); double tmp315_ = -(tmp314_); double tmp316_ = -(tmp304_); double tmp317_ = cos(tmp305_); double tmp318_ = tmp53_*mLocP3X_B_0; double tmp319_ = (tmp57_)*mLocP3Y_B_0; double tmp320_ = tmp318_+tmp319_; double tmp321_ = (tmp62_)*mLocP3Z_B_0; double tmp322_ = tmp320_+tmp321_; double tmp323_ = tmp322_+tmp68_; double tmp324_ = mCompCoord[10]; double tmp325_ = (tmp323_)-tmp324_; double tmp326_ = tmp16_*mLocP3X_B_0; double tmp327_ = tmp73_*mLocP3Y_B_0; double tmp328_ = tmp326_+tmp327_; double tmp329_ = tmp76_*mLocP3Z_B_0; double tmp330_ = tmp328_+tmp329_; double tmp331_ = tmp330_+tmp82_; double tmp332_ = mCompCoord[11]; double tmp333_ = (tmp331_)-tmp332_; double tmp334_ = -(tmp302_); double tmp335_ = tmp303_*tmp316_; double tmp336_ = tmp302_*tmp316_; double tmp337_ = tmp334_*tmp315_; double tmp338_ = tmp335_*tmp317_; double tmp339_ = tmp337_+tmp338_; double tmp340_ = (tmp339_)*(tmp313_); double tmp341_ = tmp303_*tmp315_; double tmp342_ = tmp336_*tmp317_; double tmp343_ = tmp341_+tmp342_; double tmp344_ = (tmp343_)*(tmp325_); double tmp345_ = tmp340_+tmp344_; double tmp346_ = tmp301_*tmp317_; double tmp347_ = tmp346_*(tmp333_); double tmp348_ = tmp345_+tmp347_; double tmp349_ = tmp303_*tmp301_; double tmp350_ = tmp349_*(tmp313_); double tmp351_ = tmp302_*tmp301_; double tmp352_ = tmp351_*(tmp325_); double tmp353_ = tmp350_+tmp352_; double tmp354_ = tmp304_*(tmp333_); double tmp355_ = tmp353_+tmp354_; double tmp356_ = (tmp355_)/(tmp348_); double tmp357_ = mLocCoeffU_B_0*(tmp356_); double tmp358_ = mLocCste_B_0+tmp357_; double tmp359_ = tmp334_*tmp317_; double tmp360_ = tmp335_*tmp314_; double tmp361_ = tmp359_+tmp360_; double tmp362_ = (tmp361_)*(tmp313_); double tmp363_ = tmp303_*tmp317_; double tmp364_ = tmp336_*tmp314_; double tmp365_ = tmp363_+tmp364_; double tmp366_ = (tmp365_)*(tmp325_); double tmp367_ = tmp362_+tmp366_; double tmp368_ = tmp301_*tmp314_; double tmp369_ = tmp368_*(tmp333_); double tmp370_ = tmp367_+tmp369_; double tmp371_ = (tmp370_)/(tmp348_); double tmp372_ = mLocCoeffV_B_0*(tmp371_); double tmp373_ = tmp358_+tmp372_; double tmp374_ = tmp30_*mLocP3X_B_1; double tmp375_ = (tmp34_)*mLocP3Y_B_1; double tmp376_ = tmp374_+tmp375_; double tmp377_ = (tmp39_)*mLocP3Z_B_1; double tmp378_ = tmp376_+tmp377_; double tmp379_ = tmp378_+tmp45_; double tmp380_ = (tmp379_)-tmp312_; double tmp381_ = tmp53_*mLocP3X_B_1; double tmp382_ = (tmp57_)*mLocP3Y_B_1; double tmp383_ = tmp381_+tmp382_; double tmp384_ = (tmp62_)*mLocP3Z_B_1; double tmp385_ = tmp383_+tmp384_; double tmp386_ = tmp385_+tmp68_; double tmp387_ = (tmp386_)-tmp324_; double tmp388_ = tmp16_*mLocP3X_B_1; double tmp389_ = tmp73_*mLocP3Y_B_1; double tmp390_ = tmp388_+tmp389_; double tmp391_ = tmp76_*mLocP3Z_B_1; double tmp392_ = tmp390_+tmp391_; double tmp393_ = tmp392_+tmp82_; double tmp394_ = (tmp393_)-tmp332_; double tmp395_ = (tmp339_)*(tmp380_); double tmp396_ = (tmp343_)*(tmp387_); double tmp397_ = tmp395_+tmp396_; double tmp398_ = tmp346_*(tmp394_); double tmp399_ = tmp397_+tmp398_; double tmp400_ = tmp30_*mLocP3X_B_2; double tmp401_ = (tmp34_)*mLocP3Y_B_2; double tmp402_ = tmp400_+tmp401_; double tmp403_ = (tmp39_)*mLocP3Z_B_2; double tmp404_ = tmp402_+tmp403_; double tmp405_ = tmp404_+tmp45_; double tmp406_ = (tmp405_)-tmp312_; double tmp407_ = tmp53_*mLocP3X_B_2; double tmp408_ = (tmp57_)*mLocP3Y_B_2; double tmp409_ = tmp407_+tmp408_; double tmp410_ = (tmp62_)*mLocP3Z_B_2; double tmp411_ = tmp409_+tmp410_; double tmp412_ = tmp411_+tmp68_; double tmp413_ = (tmp412_)-tmp324_; double tmp414_ = tmp16_*mLocP3X_B_2; double tmp415_ = tmp73_*mLocP3Y_B_2; double tmp416_ = tmp414_+tmp415_; double tmp417_ = tmp76_*mLocP3Z_B_2; double tmp418_ = tmp416_+tmp417_; double tmp419_ = tmp418_+tmp82_; double tmp420_ = (tmp419_)-tmp332_; double tmp421_ = (tmp339_)*(tmp406_); double tmp422_ = (tmp343_)*(tmp413_); double tmp423_ = tmp421_+tmp422_; double tmp424_ = tmp346_*(tmp420_); double tmp425_ = tmp423_+tmp424_; double tmp426_ = tmp30_*mLocP3X_B_3; double tmp427_ = (tmp34_)*mLocP3Y_B_3; double tmp428_ = tmp426_+tmp427_; double tmp429_ = (tmp39_)*mLocP3Z_B_3; double tmp430_ = tmp428_+tmp429_; double tmp431_ = tmp430_+tmp45_; double tmp432_ = (tmp431_)-tmp312_; double tmp433_ = tmp53_*mLocP3X_B_3; double tmp434_ = (tmp57_)*mLocP3Y_B_3; double tmp435_ = tmp433_+tmp434_; double tmp436_ = (tmp62_)*mLocP3Z_B_3; double tmp437_ = tmp435_+tmp436_; double tmp438_ = tmp437_+tmp68_; double tmp439_ = (tmp438_)-tmp324_; double tmp440_ = tmp16_*mLocP3X_B_3; double tmp441_ = tmp73_*mLocP3Y_B_3; double tmp442_ = tmp440_+tmp441_; double tmp443_ = tmp76_*mLocP3Z_B_3; double tmp444_ = tmp442_+tmp443_; double tmp445_ = tmp444_+tmp82_; double tmp446_ = (tmp445_)-tmp332_; double tmp447_ = (tmp339_)*(tmp432_); double tmp448_ = (tmp343_)*(tmp439_); double tmp449_ = tmp447_+tmp448_; double tmp450_ = tmp346_*(tmp446_); double tmp451_ = tmp449_+tmp450_; double tmp452_ = tmp30_*mLocP3X_B_4; double tmp453_ = (tmp34_)*mLocP3Y_B_4; double tmp454_ = tmp452_+tmp453_; double tmp455_ = (tmp39_)*mLocP3Z_B_4; double tmp456_ = tmp454_+tmp455_; double tmp457_ = tmp456_+tmp45_; double tmp458_ = (tmp457_)-tmp312_; double tmp459_ = tmp53_*mLocP3X_B_4; double tmp460_ = (tmp57_)*mLocP3Y_B_4; double tmp461_ = tmp459_+tmp460_; double tmp462_ = (tmp62_)*mLocP3Z_B_4; double tmp463_ = tmp461_+tmp462_; double tmp464_ = tmp463_+tmp68_; double tmp465_ = (tmp464_)-tmp324_; double tmp466_ = tmp16_*mLocP3X_B_4; double tmp467_ = tmp73_*mLocP3Y_B_4; double tmp468_ = tmp466_+tmp467_; double tmp469_ = tmp76_*mLocP3Z_B_4; double tmp470_ = tmp468_+tmp469_; double tmp471_ = tmp470_+tmp82_; double tmp472_ = (tmp471_)-tmp332_; double tmp473_ = (tmp339_)*(tmp458_); double tmp474_ = (tmp343_)*(tmp465_); double tmp475_ = tmp473_+tmp474_; double tmp476_ = tmp346_*(tmp472_); double tmp477_ = tmp475_+tmp476_; double tmp478_ = tmp349_*(tmp380_); double tmp479_ = tmp351_*(tmp387_); double tmp480_ = tmp478_+tmp479_; double tmp481_ = tmp304_*(tmp394_); double tmp482_ = tmp480_+tmp481_; double tmp483_ = (tmp482_)/(tmp399_); double tmp484_ = mLocCoeffU_B_1*(tmp483_); double tmp485_ = mLocCste_B_1+tmp484_; double tmp486_ = (tmp361_)*(tmp380_); double tmp487_ = (tmp365_)*(tmp387_); double tmp488_ = tmp486_+tmp487_; double tmp489_ = tmp368_*(tmp394_); double tmp490_ = tmp488_+tmp489_; double tmp491_ = (tmp490_)/(tmp399_); double tmp492_ = mLocCoeffV_B_1*(tmp491_); double tmp493_ = tmp485_+tmp492_; double tmp494_ = tmp349_*(tmp406_); double tmp495_ = tmp351_*(tmp413_); double tmp496_ = tmp494_+tmp495_; double tmp497_ = tmp304_*(tmp420_); double tmp498_ = tmp496_+tmp497_; double tmp499_ = (tmp498_)/(tmp425_); double tmp500_ = mLocCoeffU_B_2*(tmp499_); double tmp501_ = mLocCste_B_2+tmp500_; double tmp502_ = (tmp361_)*(tmp406_); double tmp503_ = (tmp365_)*(tmp413_); double tmp504_ = tmp502_+tmp503_; double tmp505_ = tmp368_*(tmp420_); double tmp506_ = tmp504_+tmp505_; double tmp507_ = (tmp506_)/(tmp425_); double tmp508_ = mLocCoeffV_B_2*(tmp507_); double tmp509_ = tmp501_+tmp508_; double tmp510_ = tmp349_*(tmp432_); double tmp511_ = tmp351_*(tmp439_); double tmp512_ = tmp510_+tmp511_; double tmp513_ = tmp304_*(tmp446_); double tmp514_ = tmp512_+tmp513_; double tmp515_ = (tmp514_)/(tmp451_); double tmp516_ = mLocCoeffU_B_3*(tmp515_); double tmp517_ = mLocCste_B_3+tmp516_; double tmp518_ = (tmp361_)*(tmp432_); double tmp519_ = (tmp365_)*(tmp439_); double tmp520_ = tmp518_+tmp519_; double tmp521_ = tmp368_*(tmp446_); double tmp522_ = tmp520_+tmp521_; double tmp523_ = (tmp522_)/(tmp451_); double tmp524_ = mLocCoeffV_B_3*(tmp523_); double tmp525_ = tmp517_+tmp524_; double tmp526_ = tmp349_*(tmp458_); double tmp527_ = tmp351_*(tmp465_); double tmp528_ = tmp526_+tmp527_; double tmp529_ = tmp304_*(tmp472_); double tmp530_ = tmp528_+tmp529_; double tmp531_ = (tmp530_)/(tmp477_); double tmp532_ = mLocCoeffU_B_4*(tmp531_); double tmp533_ = mLocCste_B_4+tmp532_; double tmp534_ = (tmp361_)*(tmp458_); double tmp535_ = (tmp365_)*(tmp465_); double tmp536_ = tmp534_+tmp535_; double tmp537_ = tmp368_*(tmp472_); double tmp538_ = tmp536_+tmp537_; double tmp539_ = (tmp538_)/(tmp477_); double tmp540_ = mLocCoeffV_B_4*(tmp539_); double tmp541_ = tmp533_+tmp540_; double tmp542_ = tmp373_+tmp493_; double tmp543_ = tmp542_+tmp509_; double tmp544_ = tmp543_+tmp525_; double tmp545_ = tmp544_+tmp541_; double tmp546_ = (tmp545_)/5; double tmp547_ = ElSquare(tmp125_); double tmp548_ = ElSquare(tmp245_); double tmp549_ = tmp547_+tmp548_; double tmp550_ = ElSquare(tmp261_); double tmp551_ = tmp549_+tmp550_; double tmp552_ = ElSquare(tmp277_); double tmp553_ = tmp551_+tmp552_; double tmp554_ = ElSquare(tmp293_); double tmp555_ = tmp553_+tmp554_; double tmp556_ = (tmp555_)/5; double tmp557_ = ElSquare(tmp298_); double tmp558_ = tmp556_-tmp557_; double tmp559_ = sqrt(tmp558_); double tmp560_ = ElSquare(tmp373_); double tmp561_ = ElSquare(tmp493_); double tmp562_ = tmp560_+tmp561_; double tmp563_ = ElSquare(tmp509_); double tmp564_ = tmp562_+tmp563_; double tmp565_ = ElSquare(tmp525_); double tmp566_ = tmp564_+tmp565_; double tmp567_ = ElSquare(tmp541_); double tmp568_ = tmp566_+tmp567_; double tmp569_ = (tmp568_)/5; double tmp570_ = ElSquare(tmp546_); double tmp571_ = tmp569_-tmp570_; double tmp572_ = sqrt(tmp571_); mVal[0] = ((tmp125_)-tmp298_)/tmp559_-((tmp373_)-tmp546_)/tmp572_; mVal[1] = ((tmp245_)-tmp298_)/tmp559_-((tmp493_)-tmp546_)/tmp572_; mVal[2] = ((tmp261_)-tmp298_)/tmp559_-((tmp509_)-tmp546_)/tmp572_; mVal[3] = ((tmp277_)-tmp298_)/tmp559_-((tmp525_)-tmp546_)/tmp572_; mVal[4] = ((tmp293_)-tmp298_)/tmp559_-((tmp541_)-tmp546_)/tmp572_; } void cEqCorLI_Multi_5_DRPts1::ComputeValDeriv() { double tmp0_ = mCompCoord[12]; double tmp1_ = mCompCoord[13]; double tmp2_ = tmp1_*mLocTimeRot; double tmp3_ = tmp0_+tmp2_; double tmp4_ = cos(tmp3_); double tmp5_ = mCompCoord[14]; double tmp6_ = mCompCoord[15]; double tmp7_ = tmp6_*mLocTimeRot; double tmp8_ = tmp5_+tmp7_; double tmp9_ = mCompCoord[16]; double tmp10_ = mCompCoord[17]; double tmp11_ = tmp10_*mLocTimeRot; double tmp12_ = tmp9_+tmp11_; double tmp13_ = sin(tmp3_); double tmp14_ = -(tmp13_); double tmp15_ = sin(tmp12_); double tmp16_ = sin(tmp8_); double tmp17_ = -(tmp16_); double tmp18_ = tmp4_*tmp17_; double tmp19_ = cos(tmp12_); double tmp20_ = mCompCoord[0]; double tmp21_ = mCompCoord[1]; double tmp22_ = cos(tmp21_); double tmp23_ = cos(tmp8_); double tmp24_ = -(tmp15_); double tmp25_ = tmp13_*tmp17_; double tmp26_ = sin(tmp20_); double tmp27_ = cos(tmp20_); double tmp28_ = sin(tmp21_); double tmp29_ = mCompCoord[2]; double tmp30_ = tmp4_*tmp23_; double tmp31_ = tmp30_*mLocP3X_A_0; double tmp32_ = tmp14_*tmp19_; double tmp33_ = tmp18_*tmp15_; double tmp34_ = tmp32_+tmp33_; double tmp35_ = (tmp34_)*mLocP3Y_A_0; double tmp36_ = tmp31_+tmp35_; double tmp37_ = tmp14_*tmp24_; double tmp38_ = tmp18_*tmp19_; double tmp39_ = tmp37_+tmp38_; double tmp40_ = (tmp39_)*mLocP3Z_A_0; double tmp41_ = tmp36_+tmp40_; double tmp42_ = mCompCoord[18]; double tmp43_ = mCompCoord[19]; double tmp44_ = tmp43_*mLocTimeRot; double tmp45_ = tmp42_+tmp44_; double tmp46_ = tmp41_+tmp45_; double tmp47_ = mCompCoord[3]; double tmp48_ = (tmp46_)-tmp47_; double tmp49_ = sin(tmp29_); double tmp50_ = -(tmp49_); double tmp51_ = -(tmp28_); double tmp52_ = cos(tmp29_); double tmp53_ = tmp13_*tmp23_; double tmp54_ = tmp53_*mLocP3X_A_0; double tmp55_ = tmp4_*tmp19_; double tmp56_ = tmp25_*tmp15_; double tmp57_ = tmp55_+tmp56_; double tmp58_ = (tmp57_)*mLocP3Y_A_0; double tmp59_ = tmp54_+tmp58_; double tmp60_ = tmp4_*tmp24_; double tmp61_ = tmp25_*tmp19_; double tmp62_ = tmp60_+tmp61_; double tmp63_ = (tmp62_)*mLocP3Z_A_0; double tmp64_ = tmp59_+tmp63_; double tmp65_ = mCompCoord[20]; double tmp66_ = mCompCoord[21]; double tmp67_ = tmp66_*mLocTimeRot; double tmp68_ = tmp65_+tmp67_; double tmp69_ = tmp64_+tmp68_; double tmp70_ = mCompCoord[4]; double tmp71_ = (tmp69_)-tmp70_; double tmp72_ = tmp16_*mLocP3X_A_0; double tmp73_ = tmp23_*tmp15_; double tmp74_ = tmp73_*mLocP3Y_A_0; double tmp75_ = tmp72_+tmp74_; double tmp76_ = tmp23_*tmp19_; double tmp77_ = tmp76_*mLocP3Z_A_0; double tmp78_ = tmp75_+tmp77_; double tmp79_ = mCompCoord[22]; double tmp80_ = mCompCoord[23]; double tmp81_ = tmp80_*mLocTimeRot; double tmp82_ = tmp79_+tmp81_; double tmp83_ = tmp78_+tmp82_; double tmp84_ = mCompCoord[5]; double tmp85_ = (tmp83_)-tmp84_; double tmp86_ = -(tmp26_); double tmp87_ = tmp27_*tmp51_; double tmp88_ = tmp26_*tmp51_; double tmp89_ = tmp86_*tmp50_; double tmp90_ = tmp87_*tmp52_; double tmp91_ = tmp89_+tmp90_; double tmp92_ = (tmp91_)*(tmp48_); double tmp93_ = tmp27_*tmp50_; double tmp94_ = tmp88_*tmp52_; double tmp95_ = tmp93_+tmp94_; double tmp96_ = (tmp95_)*(tmp71_); double tmp97_ = tmp92_+tmp96_; double tmp98_ = tmp22_*tmp52_; double tmp99_ = tmp98_*(tmp85_); double tmp100_ = tmp97_+tmp99_; double tmp101_ = tmp27_*tmp22_; double tmp102_ = tmp101_*(tmp48_); double tmp103_ = tmp26_*tmp22_; double tmp104_ = tmp103_*(tmp71_); double tmp105_ = tmp102_+tmp104_; double tmp106_ = tmp28_*(tmp85_); double tmp107_ = tmp105_+tmp106_; double tmp108_ = (tmp107_)/(tmp100_); double tmp109_ = mLocCoeffU_A_0*(tmp108_); double tmp110_ = mLocCste_A_0+tmp109_; double tmp111_ = tmp86_*tmp52_; double tmp112_ = tmp87_*tmp49_; double tmp113_ = tmp111_+tmp112_; double tmp114_ = (tmp113_)*(tmp48_); double tmp115_ = tmp27_*tmp52_; double tmp116_ = tmp88_*tmp49_; double tmp117_ = tmp115_+tmp116_; double tmp118_ = (tmp117_)*(tmp71_); double tmp119_ = tmp114_+tmp118_; double tmp120_ = tmp22_*tmp49_; double tmp121_ = tmp120_*(tmp85_); double tmp122_ = tmp119_+tmp121_; double tmp123_ = (tmp122_)/(tmp100_); double tmp124_ = mLocCoeffV_A_0*(tmp123_); double tmp125_ = tmp110_+tmp124_; double tmp126_ = tmp30_*mLocP3X_A_1; double tmp127_ = (tmp34_)*mLocP3Y_A_1; double tmp128_ = tmp126_+tmp127_; double tmp129_ = (tmp39_)*mLocP3Z_A_1; double tmp130_ = tmp128_+tmp129_; double tmp131_ = tmp130_+tmp45_; double tmp132_ = (tmp131_)-tmp47_; double tmp133_ = tmp53_*mLocP3X_A_1; double tmp134_ = (tmp57_)*mLocP3Y_A_1; double tmp135_ = tmp133_+tmp134_; double tmp136_ = (tmp62_)*mLocP3Z_A_1; double tmp137_ = tmp135_+tmp136_; double tmp138_ = tmp137_+tmp68_; double tmp139_ = (tmp138_)-tmp70_; double tmp140_ = tmp16_*mLocP3X_A_1; double tmp141_ = tmp73_*mLocP3Y_A_1; double tmp142_ = tmp140_+tmp141_; double tmp143_ = tmp76_*mLocP3Z_A_1; double tmp144_ = tmp142_+tmp143_; double tmp145_ = tmp144_+tmp82_; double tmp146_ = (tmp145_)-tmp84_; double tmp147_ = (tmp91_)*(tmp132_); double tmp148_ = (tmp95_)*(tmp139_); double tmp149_ = tmp147_+tmp148_; double tmp150_ = tmp98_*(tmp146_); double tmp151_ = tmp149_+tmp150_; double tmp152_ = tmp30_*mLocP3X_A_2; double tmp153_ = (tmp34_)*mLocP3Y_A_2; double tmp154_ = tmp152_+tmp153_; double tmp155_ = (tmp39_)*mLocP3Z_A_2; double tmp156_ = tmp154_+tmp155_; double tmp157_ = tmp156_+tmp45_; double tmp158_ = (tmp157_)-tmp47_; double tmp159_ = tmp53_*mLocP3X_A_2; double tmp160_ = (tmp57_)*mLocP3Y_A_2; double tmp161_ = tmp159_+tmp160_; double tmp162_ = (tmp62_)*mLocP3Z_A_2; double tmp163_ = tmp161_+tmp162_; double tmp164_ = tmp163_+tmp68_; double tmp165_ = (tmp164_)-tmp70_; double tmp166_ = tmp16_*mLocP3X_A_2; double tmp167_ = tmp73_*mLocP3Y_A_2; double tmp168_ = tmp166_+tmp167_; double tmp169_ = tmp76_*mLocP3Z_A_2; double tmp170_ = tmp168_+tmp169_; double tmp171_ = tmp170_+tmp82_; double tmp172_ = (tmp171_)-tmp84_; double tmp173_ = (tmp91_)*(tmp158_); double tmp174_ = (tmp95_)*(tmp165_); double tmp175_ = tmp173_+tmp174_; double tmp176_ = tmp98_*(tmp172_); double tmp177_ = tmp175_+tmp176_; double tmp178_ = tmp30_*mLocP3X_A_3; double tmp179_ = (tmp34_)*mLocP3Y_A_3; double tmp180_ = tmp178_+tmp179_; double tmp181_ = (tmp39_)*mLocP3Z_A_3; double tmp182_ = tmp180_+tmp181_; double tmp183_ = tmp182_+tmp45_; double tmp184_ = (tmp183_)-tmp47_; double tmp185_ = tmp53_*mLocP3X_A_3; double tmp186_ = (tmp57_)*mLocP3Y_A_3; double tmp187_ = tmp185_+tmp186_; double tmp188_ = (tmp62_)*mLocP3Z_A_3; double tmp189_ = tmp187_+tmp188_; double tmp190_ = tmp189_+tmp68_; double tmp191_ = (tmp190_)-tmp70_; double tmp192_ = tmp16_*mLocP3X_A_3; double tmp193_ = tmp73_*mLocP3Y_A_3; double tmp194_ = tmp192_+tmp193_; double tmp195_ = tmp76_*mLocP3Z_A_3; double tmp196_ = tmp194_+tmp195_; double tmp197_ = tmp196_+tmp82_; double tmp198_ = (tmp197_)-tmp84_; double tmp199_ = (tmp91_)*(tmp184_); double tmp200_ = (tmp95_)*(tmp191_); double tmp201_ = tmp199_+tmp200_; double tmp202_ = tmp98_*(tmp198_); double tmp203_ = tmp201_+tmp202_; double tmp204_ = tmp30_*mLocP3X_A_4; double tmp205_ = (tmp34_)*mLocP3Y_A_4; double tmp206_ = tmp204_+tmp205_; double tmp207_ = (tmp39_)*mLocP3Z_A_4; double tmp208_ = tmp206_+tmp207_; double tmp209_ = tmp208_+tmp45_; double tmp210_ = (tmp209_)-tmp47_; double tmp211_ = tmp53_*mLocP3X_A_4; double tmp212_ = (tmp57_)*mLocP3Y_A_4; double tmp213_ = tmp211_+tmp212_; double tmp214_ = (tmp62_)*mLocP3Z_A_4; double tmp215_ = tmp213_+tmp214_; double tmp216_ = tmp215_+tmp68_; double tmp217_ = (tmp216_)-tmp70_; double tmp218_ = tmp16_*mLocP3X_A_4; double tmp219_ = tmp73_*mLocP3Y_A_4; double tmp220_ = tmp218_+tmp219_; double tmp221_ = tmp76_*mLocP3Z_A_4; double tmp222_ = tmp220_+tmp221_; double tmp223_ = tmp222_+tmp82_; double tmp224_ = (tmp223_)-tmp84_; double tmp225_ = (tmp91_)*(tmp210_); double tmp226_ = (tmp95_)*(tmp217_); double tmp227_ = tmp225_+tmp226_; double tmp228_ = tmp98_*(tmp224_); double tmp229_ = tmp227_+tmp228_; double tmp230_ = tmp101_*(tmp132_); double tmp231_ = tmp103_*(tmp139_); double tmp232_ = tmp230_+tmp231_; double tmp233_ = tmp28_*(tmp146_); double tmp234_ = tmp232_+tmp233_; double tmp235_ = (tmp234_)/(tmp151_); double tmp236_ = mLocCoeffU_A_1*(tmp235_); double tmp237_ = mLocCste_A_1+tmp236_; double tmp238_ = (tmp113_)*(tmp132_); double tmp239_ = (tmp117_)*(tmp139_); double tmp240_ = tmp238_+tmp239_; double tmp241_ = tmp120_*(tmp146_); double tmp242_ = tmp240_+tmp241_; double tmp243_ = (tmp242_)/(tmp151_); double tmp244_ = mLocCoeffV_A_1*(tmp243_); double tmp245_ = tmp237_+tmp244_; double tmp246_ = tmp101_*(tmp158_); double tmp247_ = tmp103_*(tmp165_); double tmp248_ = tmp246_+tmp247_; double tmp249_ = tmp28_*(tmp172_); double tmp250_ = tmp248_+tmp249_; double tmp251_ = (tmp250_)/(tmp177_); double tmp252_ = mLocCoeffU_A_2*(tmp251_); double tmp253_ = mLocCste_A_2+tmp252_; double tmp254_ = (tmp113_)*(tmp158_); double tmp255_ = (tmp117_)*(tmp165_); double tmp256_ = tmp254_+tmp255_; double tmp257_ = tmp120_*(tmp172_); double tmp258_ = tmp256_+tmp257_; double tmp259_ = (tmp258_)/(tmp177_); double tmp260_ = mLocCoeffV_A_2*(tmp259_); double tmp261_ = tmp253_+tmp260_; double tmp262_ = tmp101_*(tmp184_); double tmp263_ = tmp103_*(tmp191_); double tmp264_ = tmp262_+tmp263_; double tmp265_ = tmp28_*(tmp198_); double tmp266_ = tmp264_+tmp265_; double tmp267_ = (tmp266_)/(tmp203_); double tmp268_ = mLocCoeffU_A_3*(tmp267_); double tmp269_ = mLocCste_A_3+tmp268_; double tmp270_ = (tmp113_)*(tmp184_); double tmp271_ = (tmp117_)*(tmp191_); double tmp272_ = tmp270_+tmp271_; double tmp273_ = tmp120_*(tmp198_); double tmp274_ = tmp272_+tmp273_; double tmp275_ = (tmp274_)/(tmp203_); double tmp276_ = mLocCoeffV_A_3*(tmp275_); double tmp277_ = tmp269_+tmp276_; double tmp278_ = tmp101_*(tmp210_); double tmp279_ = tmp103_*(tmp217_); double tmp280_ = tmp278_+tmp279_; double tmp281_ = tmp28_*(tmp224_); double tmp282_ = tmp280_+tmp281_; double tmp283_ = (tmp282_)/(tmp229_); double tmp284_ = mLocCoeffU_A_4*(tmp283_); double tmp285_ = mLocCste_A_4+tmp284_; double tmp286_ = (tmp113_)*(tmp210_); double tmp287_ = (tmp117_)*(tmp217_); double tmp288_ = tmp286_+tmp287_; double tmp289_ = tmp120_*(tmp224_); double tmp290_ = tmp288_+tmp289_; double tmp291_ = (tmp290_)/(tmp229_); double tmp292_ = mLocCoeffV_A_4*(tmp291_); double tmp293_ = tmp285_+tmp292_; double tmp294_ = tmp125_+tmp245_; double tmp295_ = tmp294_+tmp261_; double tmp296_ = tmp295_+tmp277_; double tmp297_ = tmp296_+tmp293_; double tmp298_ = (tmp297_)/5; double tmp299_ = mCompCoord[6]; double tmp300_ = mCompCoord[7]; double tmp301_ = cos(tmp300_); double tmp302_ = sin(tmp299_); double tmp303_ = cos(tmp299_); double tmp304_ = sin(tmp300_); double tmp305_ = mCompCoord[8]; double tmp306_ = tmp30_*mLocP3X_B_0; double tmp307_ = (tmp34_)*mLocP3Y_B_0; double tmp308_ = tmp306_+tmp307_; double tmp309_ = (tmp39_)*mLocP3Z_B_0; double tmp310_ = tmp308_+tmp309_; double tmp311_ = tmp310_+tmp45_; double tmp312_ = mCompCoord[9]; double tmp313_ = (tmp311_)-tmp312_; double tmp314_ = sin(tmp305_); double tmp315_ = -(tmp314_); double tmp316_ = -(tmp304_); double tmp317_ = cos(tmp305_); double tmp318_ = tmp53_*mLocP3X_B_0; double tmp319_ = (tmp57_)*mLocP3Y_B_0; double tmp320_ = tmp318_+tmp319_; double tmp321_ = (tmp62_)*mLocP3Z_B_0; double tmp322_ = tmp320_+tmp321_; double tmp323_ = tmp322_+tmp68_; double tmp324_ = mCompCoord[10]; double tmp325_ = (tmp323_)-tmp324_; double tmp326_ = tmp16_*mLocP3X_B_0; double tmp327_ = tmp73_*mLocP3Y_B_0; double tmp328_ = tmp326_+tmp327_; double tmp329_ = tmp76_*mLocP3Z_B_0; double tmp330_ = tmp328_+tmp329_; double tmp331_ = tmp330_+tmp82_; double tmp332_ = mCompCoord[11]; double tmp333_ = (tmp331_)-tmp332_; double tmp334_ = -(tmp302_); double tmp335_ = tmp303_*tmp316_; double tmp336_ = tmp302_*tmp316_; double tmp337_ = tmp334_*tmp315_; double tmp338_ = tmp335_*tmp317_; double tmp339_ = tmp337_+tmp338_; double tmp340_ = (tmp339_)*(tmp313_); double tmp341_ = tmp303_*tmp315_; double tmp342_ = tmp336_*tmp317_; double tmp343_ = tmp341_+tmp342_; double tmp344_ = (tmp343_)*(tmp325_); double tmp345_ = tmp340_+tmp344_; double tmp346_ = tmp301_*tmp317_; double tmp347_ = tmp346_*(tmp333_); double tmp348_ = tmp345_+tmp347_; double tmp349_ = tmp303_*tmp301_; double tmp350_ = tmp349_*(tmp313_); double tmp351_ = tmp302_*tmp301_; double tmp352_ = tmp351_*(tmp325_); double tmp353_ = tmp350_+tmp352_; double tmp354_ = tmp304_*(tmp333_); double tmp355_ = tmp353_+tmp354_; double tmp356_ = (tmp355_)/(tmp348_); double tmp357_ = mLocCoeffU_B_0*(tmp356_); double tmp358_ = mLocCste_B_0+tmp357_; double tmp359_ = tmp334_*tmp317_; double tmp360_ = tmp335_*tmp314_; double tmp361_ = tmp359_+tmp360_; double tmp362_ = (tmp361_)*(tmp313_); double tmp363_ = tmp303_*tmp317_; double tmp364_ = tmp336_*tmp314_; double tmp365_ = tmp363_+tmp364_; double tmp366_ = (tmp365_)*(tmp325_); double tmp367_ = tmp362_+tmp366_; double tmp368_ = tmp301_*tmp314_; double tmp369_ = tmp368_*(tmp333_); double tmp370_ = tmp367_+tmp369_; double tmp371_ = (tmp370_)/(tmp348_); double tmp372_ = mLocCoeffV_B_0*(tmp371_); double tmp373_ = tmp358_+tmp372_; double tmp374_ = tmp30_*mLocP3X_B_1; double tmp375_ = (tmp34_)*mLocP3Y_B_1; double tmp376_ = tmp374_+tmp375_; double tmp377_ = (tmp39_)*mLocP3Z_B_1; double tmp378_ = tmp376_+tmp377_; double tmp379_ = tmp378_+tmp45_; double tmp380_ = (tmp379_)-tmp312_; double tmp381_ = tmp53_*mLocP3X_B_1; double tmp382_ = (tmp57_)*mLocP3Y_B_1; double tmp383_ = tmp381_+tmp382_; double tmp384_ = (tmp62_)*mLocP3Z_B_1; double tmp385_ = tmp383_+tmp384_; double tmp386_ = tmp385_+tmp68_; double tmp387_ = (tmp386_)-tmp324_; double tmp388_ = tmp16_*mLocP3X_B_1; double tmp389_ = tmp73_*mLocP3Y_B_1; double tmp390_ = tmp388_+tmp389_; double tmp391_ = tmp76_*mLocP3Z_B_1; double tmp392_ = tmp390_+tmp391_; double tmp393_ = tmp392_+tmp82_; double tmp394_ = (tmp393_)-tmp332_; double tmp395_ = (tmp339_)*(tmp380_); double tmp396_ = (tmp343_)*(tmp387_); double tmp397_ = tmp395_+tmp396_; double tmp398_ = tmp346_*(tmp394_); double tmp399_ = tmp397_+tmp398_; double tmp400_ = tmp30_*mLocP3X_B_2; double tmp401_ = (tmp34_)*mLocP3Y_B_2; double tmp402_ = tmp400_+tmp401_; double tmp403_ = (tmp39_)*mLocP3Z_B_2; double tmp404_ = tmp402_+tmp403_; double tmp405_ = tmp404_+tmp45_; double tmp406_ = (tmp405_)-tmp312_; double tmp407_ = tmp53_*mLocP3X_B_2; double tmp408_ = (tmp57_)*mLocP3Y_B_2; double tmp409_ = tmp407_+tmp408_; double tmp410_ = (tmp62_)*mLocP3Z_B_2; double tmp411_ = tmp409_+tmp410_; double tmp412_ = tmp411_+tmp68_; double tmp413_ = (tmp412_)-tmp324_; double tmp414_ = tmp16_*mLocP3X_B_2; double tmp415_ = tmp73_*mLocP3Y_B_2; double tmp416_ = tmp414_+tmp415_; double tmp417_ = tmp76_*mLocP3Z_B_2; double tmp418_ = tmp416_+tmp417_; double tmp419_ = tmp418_+tmp82_; double tmp420_ = (tmp419_)-tmp332_; double tmp421_ = (tmp339_)*(tmp406_); double tmp422_ = (tmp343_)*(tmp413_); double tmp423_ = tmp421_+tmp422_; double tmp424_ = tmp346_*(tmp420_); double tmp425_ = tmp423_+tmp424_; double tmp426_ = tmp30_*mLocP3X_B_3; double tmp427_ = (tmp34_)*mLocP3Y_B_3; double tmp428_ = tmp426_+tmp427_; double tmp429_ = (tmp39_)*mLocP3Z_B_3; double tmp430_ = tmp428_+tmp429_; double tmp431_ = tmp430_+tmp45_; double tmp432_ = (tmp431_)-tmp312_; double tmp433_ = tmp53_*mLocP3X_B_3; double tmp434_ = (tmp57_)*mLocP3Y_B_3; double tmp435_ = tmp433_+tmp434_; double tmp436_ = (tmp62_)*mLocP3Z_B_3; double tmp437_ = tmp435_+tmp436_; double tmp438_ = tmp437_+tmp68_; double tmp439_ = (tmp438_)-tmp324_; double tmp440_ = tmp16_*mLocP3X_B_3; double tmp441_ = tmp73_*mLocP3Y_B_3; double tmp442_ = tmp440_+tmp441_; double tmp443_ = tmp76_*mLocP3Z_B_3; double tmp444_ = tmp442_+tmp443_; double tmp445_ = tmp444_+tmp82_; double tmp446_ = (tmp445_)-tmp332_; double tmp447_ = (tmp339_)*(tmp432_); double tmp448_ = (tmp343_)*(tmp439_); double tmp449_ = tmp447_+tmp448_; double tmp450_ = tmp346_*(tmp446_); double tmp451_ = tmp449_+tmp450_; double tmp452_ = tmp30_*mLocP3X_B_4; double tmp453_ = (tmp34_)*mLocP3Y_B_4; double tmp454_ = tmp452_+tmp453_; double tmp455_ = (tmp39_)*mLocP3Z_B_4; double tmp456_ = tmp454_+tmp455_; double tmp457_ = tmp456_+tmp45_; double tmp458_ = (tmp457_)-tmp312_; double tmp459_ = tmp53_*mLocP3X_B_4; double tmp460_ = (tmp57_)*mLocP3Y_B_4; double tmp461_ = tmp459_+tmp460_; double tmp462_ = (tmp62_)*mLocP3Z_B_4; double tmp463_ = tmp461_+tmp462_; double tmp464_ = tmp463_+tmp68_; double tmp465_ = (tmp464_)-tmp324_; double tmp466_ = tmp16_*mLocP3X_B_4; double tmp467_ = tmp73_*mLocP3Y_B_4; double tmp468_ = tmp466_+tmp467_; double tmp469_ = tmp76_*mLocP3Z_B_4; double tmp470_ = tmp468_+tmp469_; double tmp471_ = tmp470_+tmp82_; double tmp472_ = (tmp471_)-tmp332_; double tmp473_ = (tmp339_)*(tmp458_); double tmp474_ = (tmp343_)*(tmp465_); double tmp475_ = tmp473_+tmp474_; double tmp476_ = tmp346_*(tmp472_); double tmp477_ = tmp475_+tmp476_; double tmp478_ = tmp349_*(tmp380_); double tmp479_ = tmp351_*(tmp387_); double tmp480_ = tmp478_+tmp479_; double tmp481_ = tmp304_*(tmp394_); double tmp482_ = tmp480_+tmp481_; double tmp483_ = (tmp482_)/(tmp399_); double tmp484_ = mLocCoeffU_B_1*(tmp483_); double tmp485_ = mLocCste_B_1+tmp484_; double tmp486_ = (tmp361_)*(tmp380_); double tmp487_ = (tmp365_)*(tmp387_); double tmp488_ = tmp486_+tmp487_; double tmp489_ = tmp368_*(tmp394_); double tmp490_ = tmp488_+tmp489_; double tmp491_ = (tmp490_)/(tmp399_); double tmp492_ = mLocCoeffV_B_1*(tmp491_); double tmp493_ = tmp485_+tmp492_; double tmp494_ = tmp349_*(tmp406_); double tmp495_ = tmp351_*(tmp413_); double tmp496_ = tmp494_+tmp495_; double tmp497_ = tmp304_*(tmp420_); double tmp498_ = tmp496_+tmp497_; double tmp499_ = (tmp498_)/(tmp425_); double tmp500_ = mLocCoeffU_B_2*(tmp499_); double tmp501_ = mLocCste_B_2+tmp500_; double tmp502_ = (tmp361_)*(tmp406_); double tmp503_ = (tmp365_)*(tmp413_); double tmp504_ = tmp502_+tmp503_; double tmp505_ = tmp368_*(tmp420_); double tmp506_ = tmp504_+tmp505_; double tmp507_ = (tmp506_)/(tmp425_); double tmp508_ = mLocCoeffV_B_2*(tmp507_); double tmp509_ = tmp501_+tmp508_; double tmp510_ = tmp349_*(tmp432_); double tmp511_ = tmp351_*(tmp439_); double tmp512_ = tmp510_+tmp511_; double tmp513_ = tmp304_*(tmp446_); double tmp514_ = tmp512_+tmp513_; double tmp515_ = (tmp514_)/(tmp451_); double tmp516_ = mLocCoeffU_B_3*(tmp515_); double tmp517_ = mLocCste_B_3+tmp516_; double tmp518_ = (tmp361_)*(tmp432_); double tmp519_ = (tmp365_)*(tmp439_); double tmp520_ = tmp518_+tmp519_; double tmp521_ = tmp368_*(tmp446_); double tmp522_ = tmp520_+tmp521_; double tmp523_ = (tmp522_)/(tmp451_); double tmp524_ = mLocCoeffV_B_3*(tmp523_); double tmp525_ = tmp517_+tmp524_; double tmp526_ = tmp349_*(tmp458_); double tmp527_ = tmp351_*(tmp465_); double tmp528_ = tmp526_+tmp527_; double tmp529_ = tmp304_*(tmp472_); double tmp530_ = tmp528_+tmp529_; double tmp531_ = (tmp530_)/(tmp477_); double tmp532_ = mLocCoeffU_B_4*(tmp531_); double tmp533_ = mLocCste_B_4+tmp532_; double tmp534_ = (tmp361_)*(tmp458_); double tmp535_ = (tmp365_)*(tmp465_); double tmp536_ = tmp534_+tmp535_; double tmp537_ = tmp368_*(tmp472_); double tmp538_ = tmp536_+tmp537_; double tmp539_ = (tmp538_)/(tmp477_); double tmp540_ = mLocCoeffV_B_4*(tmp539_); double tmp541_ = tmp533_+tmp540_; double tmp542_ = tmp373_+tmp493_; double tmp543_ = tmp542_+tmp509_; double tmp544_ = tmp543_+tmp525_; double tmp545_ = tmp544_+tmp541_; double tmp546_ = (tmp545_)/5; double tmp547_ = -(1); double tmp548_ = tmp547_*tmp26_; double tmp549_ = -(tmp27_); double tmp550_ = tmp548_*tmp51_; double tmp551_ = tmp549_*tmp50_; double tmp552_ = tmp550_*tmp52_; double tmp553_ = tmp551_+tmp552_; double tmp554_ = (tmp553_)*(tmp48_); double tmp555_ = tmp548_*tmp50_; double tmp556_ = tmp555_+tmp90_; double tmp557_ = (tmp556_)*(tmp71_); double tmp558_ = tmp554_+tmp557_; double tmp559_ = ElSquare(tmp100_); double tmp560_ = tmp548_*tmp22_; double tmp561_ = tmp560_*(tmp48_); double tmp562_ = tmp101_*(tmp71_); double tmp563_ = tmp561_+tmp562_; double tmp564_ = (tmp563_)*(tmp100_); double tmp565_ = (tmp107_)*(tmp558_); double tmp566_ = tmp564_-tmp565_; double tmp567_ = (tmp566_)/tmp559_; double tmp568_ = (tmp567_)*mLocCoeffU_A_0; double tmp569_ = tmp549_*tmp52_; double tmp570_ = tmp550_*tmp49_; double tmp571_ = tmp569_+tmp570_; double tmp572_ = (tmp571_)*(tmp48_); double tmp573_ = tmp548_*tmp52_; double tmp574_ = tmp573_+tmp112_; double tmp575_ = (tmp574_)*(tmp71_); double tmp576_ = tmp572_+tmp575_; double tmp577_ = (tmp576_)*(tmp100_); double tmp578_ = (tmp122_)*(tmp558_); double tmp579_ = tmp577_-tmp578_; double tmp580_ = (tmp579_)/tmp559_; double tmp581_ = (tmp580_)*mLocCoeffV_A_0; double tmp582_ = tmp568_+tmp581_; double tmp583_ = (tmp553_)*(tmp132_); double tmp584_ = (tmp556_)*(tmp139_); double tmp585_ = tmp583_+tmp584_; double tmp586_ = ElSquare(tmp151_); double tmp587_ = (tmp553_)*(tmp158_); double tmp588_ = (tmp556_)*(tmp165_); double tmp589_ = tmp587_+tmp588_; double tmp590_ = ElSquare(tmp177_); double tmp591_ = (tmp553_)*(tmp184_); double tmp592_ = (tmp556_)*(tmp191_); double tmp593_ = tmp591_+tmp592_; double tmp594_ = ElSquare(tmp203_); double tmp595_ = (tmp553_)*(tmp210_); double tmp596_ = (tmp556_)*(tmp217_); double tmp597_ = tmp595_+tmp596_; double tmp598_ = ElSquare(tmp229_); double tmp599_ = ElSquare(tmp125_); double tmp600_ = ElSquare(tmp245_); double tmp601_ = tmp599_+tmp600_; double tmp602_ = ElSquare(tmp261_); double tmp603_ = tmp601_+tmp602_; double tmp604_ = ElSquare(tmp277_); double tmp605_ = tmp603_+tmp604_; double tmp606_ = ElSquare(tmp293_); double tmp607_ = tmp605_+tmp606_; double tmp608_ = (tmp607_)/5; double tmp609_ = ElSquare(tmp298_); double tmp610_ = tmp608_-tmp609_; double tmp611_ = sqrt(tmp610_); double tmp612_ = (tmp125_)-tmp298_; double tmp613_ = tmp560_*(tmp132_); double tmp614_ = tmp101_*(tmp139_); double tmp615_ = tmp613_+tmp614_; double tmp616_ = (tmp615_)*(tmp151_); double tmp617_ = (tmp234_)*(tmp585_); double tmp618_ = tmp616_-tmp617_; double tmp619_ = (tmp618_)/tmp586_; double tmp620_ = (tmp619_)*mLocCoeffU_A_1; double tmp621_ = (tmp571_)*(tmp132_); double tmp622_ = (tmp574_)*(tmp139_); double tmp623_ = tmp621_+tmp622_; double tmp624_ = (tmp623_)*(tmp151_); double tmp625_ = (tmp242_)*(tmp585_); double tmp626_ = tmp624_-tmp625_; double tmp627_ = (tmp626_)/tmp586_; double tmp628_ = (tmp627_)*mLocCoeffV_A_1; double tmp629_ = tmp620_+tmp628_; double tmp630_ = tmp560_*(tmp158_); double tmp631_ = tmp101_*(tmp165_); double tmp632_ = tmp630_+tmp631_; double tmp633_ = (tmp632_)*(tmp177_); double tmp634_ = (tmp250_)*(tmp589_); double tmp635_ = tmp633_-tmp634_; double tmp636_ = (tmp635_)/tmp590_; double tmp637_ = (tmp636_)*mLocCoeffU_A_2; double tmp638_ = (tmp571_)*(tmp158_); double tmp639_ = (tmp574_)*(tmp165_); double tmp640_ = tmp638_+tmp639_; double tmp641_ = (tmp640_)*(tmp177_); double tmp642_ = (tmp258_)*(tmp589_); double tmp643_ = tmp641_-tmp642_; double tmp644_ = (tmp643_)/tmp590_; double tmp645_ = (tmp644_)*mLocCoeffV_A_2; double tmp646_ = tmp637_+tmp645_; double tmp647_ = tmp560_*(tmp184_); double tmp648_ = tmp101_*(tmp191_); double tmp649_ = tmp647_+tmp648_; double tmp650_ = (tmp649_)*(tmp203_); double tmp651_ = (tmp266_)*(tmp593_); double tmp652_ = tmp650_-tmp651_; double tmp653_ = (tmp652_)/tmp594_; double tmp654_ = (tmp653_)*mLocCoeffU_A_3; double tmp655_ = (tmp571_)*(tmp184_); double tmp656_ = (tmp574_)*(tmp191_); double tmp657_ = tmp655_+tmp656_; double tmp658_ = (tmp657_)*(tmp203_); double tmp659_ = (tmp274_)*(tmp593_); double tmp660_ = tmp658_-tmp659_; double tmp661_ = (tmp660_)/tmp594_; double tmp662_ = (tmp661_)*mLocCoeffV_A_3; double tmp663_ = tmp654_+tmp662_; double tmp664_ = tmp560_*(tmp210_); double tmp665_ = tmp101_*(tmp217_); double tmp666_ = tmp664_+tmp665_; double tmp667_ = (tmp666_)*(tmp229_); double tmp668_ = (tmp282_)*(tmp597_); double tmp669_ = tmp667_-tmp668_; double tmp670_ = (tmp669_)/tmp598_; double tmp671_ = (tmp670_)*mLocCoeffU_A_4; double tmp672_ = (tmp571_)*(tmp210_); double tmp673_ = (tmp574_)*(tmp217_); double tmp674_ = tmp672_+tmp673_; double tmp675_ = (tmp674_)*(tmp229_); double tmp676_ = (tmp290_)*(tmp597_); double tmp677_ = tmp675_-tmp676_; double tmp678_ = (tmp677_)/tmp598_; double tmp679_ = (tmp678_)*mLocCoeffV_A_4; double tmp680_ = tmp671_+tmp679_; double tmp681_ = ElSquare(5); double tmp682_ = tmp582_+tmp629_; double tmp683_ = tmp682_+tmp646_; double tmp684_ = tmp683_+tmp663_; double tmp685_ = tmp684_+tmp680_; double tmp686_ = (tmp685_)*5; double tmp687_ = (tmp686_)/tmp681_; double tmp688_ = tmp547_*tmp28_; double tmp689_ = -(tmp22_); double tmp690_ = tmp689_*tmp27_; double tmp691_ = tmp689_*tmp26_; double tmp692_ = tmp690_*tmp52_; double tmp693_ = tmp692_*(tmp48_); double tmp694_ = tmp691_*tmp52_; double tmp695_ = tmp694_*(tmp71_); double tmp696_ = tmp693_+tmp695_; double tmp697_ = tmp688_*tmp52_; double tmp698_ = tmp697_*(tmp85_); double tmp699_ = tmp696_+tmp698_; double tmp700_ = tmp688_*tmp27_; double tmp701_ = tmp700_*(tmp48_); double tmp702_ = tmp688_*tmp26_; double tmp703_ = tmp702_*(tmp71_); double tmp704_ = tmp701_+tmp703_; double tmp705_ = tmp22_*(tmp85_); double tmp706_ = tmp704_+tmp705_; double tmp707_ = (tmp706_)*(tmp100_); double tmp708_ = (tmp107_)*(tmp699_); double tmp709_ = tmp707_-tmp708_; double tmp710_ = (tmp709_)/tmp559_; double tmp711_ = (tmp710_)*mLocCoeffU_A_0; double tmp712_ = tmp690_*tmp49_; double tmp713_ = tmp712_*(tmp48_); double tmp714_ = tmp691_*tmp49_; double tmp715_ = tmp714_*(tmp71_); double tmp716_ = tmp713_+tmp715_; double tmp717_ = tmp688_*tmp49_; double tmp718_ = tmp717_*(tmp85_); double tmp719_ = tmp716_+tmp718_; double tmp720_ = (tmp719_)*(tmp100_); double tmp721_ = (tmp122_)*(tmp699_); double tmp722_ = tmp720_-tmp721_; double tmp723_ = (tmp722_)/tmp559_; double tmp724_ = (tmp723_)*mLocCoeffV_A_0; double tmp725_ = tmp711_+tmp724_; double tmp726_ = tmp692_*(tmp132_); double tmp727_ = tmp694_*(tmp139_); double tmp728_ = tmp726_+tmp727_; double tmp729_ = tmp697_*(tmp146_); double tmp730_ = tmp728_+tmp729_; double tmp731_ = tmp692_*(tmp158_); double tmp732_ = tmp694_*(tmp165_); double tmp733_ = tmp731_+tmp732_; double tmp734_ = tmp697_*(tmp172_); double tmp735_ = tmp733_+tmp734_; double tmp736_ = tmp692_*(tmp184_); double tmp737_ = tmp694_*(tmp191_); double tmp738_ = tmp736_+tmp737_; double tmp739_ = tmp697_*(tmp198_); double tmp740_ = tmp738_+tmp739_; double tmp741_ = tmp692_*(tmp210_); double tmp742_ = tmp694_*(tmp217_); double tmp743_ = tmp741_+tmp742_; double tmp744_ = tmp697_*(tmp224_); double tmp745_ = tmp743_+tmp744_; double tmp746_ = tmp700_*(tmp132_); double tmp747_ = tmp702_*(tmp139_); double tmp748_ = tmp746_+tmp747_; double tmp749_ = tmp22_*(tmp146_); double tmp750_ = tmp748_+tmp749_; double tmp751_ = (tmp750_)*(tmp151_); double tmp752_ = (tmp234_)*(tmp730_); double tmp753_ = tmp751_-tmp752_; double tmp754_ = (tmp753_)/tmp586_; double tmp755_ = (tmp754_)*mLocCoeffU_A_1; double tmp756_ = tmp712_*(tmp132_); double tmp757_ = tmp714_*(tmp139_); double tmp758_ = tmp756_+tmp757_; double tmp759_ = tmp717_*(tmp146_); double tmp760_ = tmp758_+tmp759_; double tmp761_ = (tmp760_)*(tmp151_); double tmp762_ = (tmp242_)*(tmp730_); double tmp763_ = tmp761_-tmp762_; double tmp764_ = (tmp763_)/tmp586_; double tmp765_ = (tmp764_)*mLocCoeffV_A_1; double tmp766_ = tmp755_+tmp765_; double tmp767_ = tmp700_*(tmp158_); double tmp768_ = tmp702_*(tmp165_); double tmp769_ = tmp767_+tmp768_; double tmp770_ = tmp22_*(tmp172_); double tmp771_ = tmp769_+tmp770_; double tmp772_ = (tmp771_)*(tmp177_); double tmp773_ = (tmp250_)*(tmp735_); double tmp774_ = tmp772_-tmp773_; double tmp775_ = (tmp774_)/tmp590_; double tmp776_ = (tmp775_)*mLocCoeffU_A_2; double tmp777_ = tmp712_*(tmp158_); double tmp778_ = tmp714_*(tmp165_); double tmp779_ = tmp777_+tmp778_; double tmp780_ = tmp717_*(tmp172_); double tmp781_ = tmp779_+tmp780_; double tmp782_ = (tmp781_)*(tmp177_); double tmp783_ = (tmp258_)*(tmp735_); double tmp784_ = tmp782_-tmp783_; double tmp785_ = (tmp784_)/tmp590_; double tmp786_ = (tmp785_)*mLocCoeffV_A_2; double tmp787_ = tmp776_+tmp786_; double tmp788_ = tmp700_*(tmp184_); double tmp789_ = tmp702_*(tmp191_); double tmp790_ = tmp788_+tmp789_; double tmp791_ = tmp22_*(tmp198_); double tmp792_ = tmp790_+tmp791_; double tmp793_ = (tmp792_)*(tmp203_); double tmp794_ = (tmp266_)*(tmp740_); double tmp795_ = tmp793_-tmp794_; double tmp796_ = (tmp795_)/tmp594_; double tmp797_ = (tmp796_)*mLocCoeffU_A_3; double tmp798_ = tmp712_*(tmp184_); double tmp799_ = tmp714_*(tmp191_); double tmp800_ = tmp798_+tmp799_; double tmp801_ = tmp717_*(tmp198_); double tmp802_ = tmp800_+tmp801_; double tmp803_ = (tmp802_)*(tmp203_); double tmp804_ = (tmp274_)*(tmp740_); double tmp805_ = tmp803_-tmp804_; double tmp806_ = (tmp805_)/tmp594_; double tmp807_ = (tmp806_)*mLocCoeffV_A_3; double tmp808_ = tmp797_+tmp807_; double tmp809_ = tmp700_*(tmp210_); double tmp810_ = tmp702_*(tmp217_); double tmp811_ = tmp809_+tmp810_; double tmp812_ = tmp22_*(tmp224_); double tmp813_ = tmp811_+tmp812_; double tmp814_ = (tmp813_)*(tmp229_); double tmp815_ = (tmp282_)*(tmp745_); double tmp816_ = tmp814_-tmp815_; double tmp817_ = (tmp816_)/tmp598_; double tmp818_ = (tmp817_)*mLocCoeffU_A_4; double tmp819_ = tmp712_*(tmp210_); double tmp820_ = tmp714_*(tmp217_); double tmp821_ = tmp819_+tmp820_; double tmp822_ = tmp717_*(tmp224_); double tmp823_ = tmp821_+tmp822_; double tmp824_ = (tmp823_)*(tmp229_); double tmp825_ = (tmp290_)*(tmp745_); double tmp826_ = tmp824_-tmp825_; double tmp827_ = (tmp826_)/tmp598_; double tmp828_ = (tmp827_)*mLocCoeffV_A_4; double tmp829_ = tmp818_+tmp828_; double tmp830_ = tmp725_+tmp766_; double tmp831_ = tmp830_+tmp787_; double tmp832_ = tmp831_+tmp808_; double tmp833_ = tmp832_+tmp829_; double tmp834_ = (tmp833_)*5; double tmp835_ = (tmp834_)/tmp681_; double tmp836_ = ElSquare(tmp611_); double tmp837_ = -(tmp52_); double tmp838_ = tmp547_*tmp49_; double tmp839_ = tmp837_*tmp86_; double tmp840_ = tmp838_*tmp87_; double tmp841_ = tmp839_+tmp840_; double tmp842_ = (tmp841_)*(tmp48_); double tmp843_ = tmp837_*tmp27_; double tmp844_ = tmp838_*tmp88_; double tmp845_ = tmp843_+tmp844_; double tmp846_ = (tmp845_)*(tmp71_); double tmp847_ = tmp842_+tmp846_; double tmp848_ = tmp838_*tmp22_; double tmp849_ = tmp848_*(tmp85_); double tmp850_ = tmp847_+tmp849_; double tmp851_ = (tmp107_)*(tmp850_); double tmp852_ = -(tmp851_); double tmp853_ = tmp852_/tmp559_; double tmp854_ = (tmp853_)*mLocCoeffU_A_0; double tmp855_ = tmp838_*tmp86_; double tmp856_ = tmp52_*tmp87_; double tmp857_ = tmp855_+tmp856_; double tmp858_ = (tmp857_)*(tmp48_); double tmp859_ = tmp838_*tmp27_; double tmp860_ = tmp52_*tmp88_; double tmp861_ = tmp859_+tmp860_; double tmp862_ = (tmp861_)*(tmp71_); double tmp863_ = tmp858_+tmp862_; double tmp864_ = tmp52_*tmp22_; double tmp865_ = tmp864_*(tmp85_); double tmp866_ = tmp863_+tmp865_; double tmp867_ = (tmp866_)*(tmp100_); double tmp868_ = (tmp122_)*(tmp850_); double tmp869_ = tmp867_-tmp868_; double tmp870_ = (tmp869_)/tmp559_; double tmp871_ = (tmp870_)*mLocCoeffV_A_0; double tmp872_ = tmp854_+tmp871_; double tmp873_ = (tmp841_)*(tmp132_); double tmp874_ = (tmp845_)*(tmp139_); double tmp875_ = tmp873_+tmp874_; double tmp876_ = tmp848_*(tmp146_); double tmp877_ = tmp875_+tmp876_; double tmp878_ = (tmp841_)*(tmp158_); double tmp879_ = (tmp845_)*(tmp165_); double tmp880_ = tmp878_+tmp879_; double tmp881_ = tmp848_*(tmp172_); double tmp882_ = tmp880_+tmp881_; double tmp883_ = (tmp841_)*(tmp184_); double tmp884_ = (tmp845_)*(tmp191_); double tmp885_ = tmp883_+tmp884_; double tmp886_ = tmp848_*(tmp198_); double tmp887_ = tmp885_+tmp886_; double tmp888_ = (tmp841_)*(tmp210_); double tmp889_ = (tmp845_)*(tmp217_); double tmp890_ = tmp888_+tmp889_; double tmp891_ = tmp848_*(tmp224_); double tmp892_ = tmp890_+tmp891_; double tmp893_ = (tmp234_)*(tmp877_); double tmp894_ = -(tmp893_); double tmp895_ = tmp894_/tmp586_; double tmp896_ = (tmp895_)*mLocCoeffU_A_1; double tmp897_ = (tmp857_)*(tmp132_); double tmp898_ = (tmp861_)*(tmp139_); double tmp899_ = tmp897_+tmp898_; double tmp900_ = tmp864_*(tmp146_); double tmp901_ = tmp899_+tmp900_; double tmp902_ = (tmp901_)*(tmp151_); double tmp903_ = (tmp242_)*(tmp877_); double tmp904_ = tmp902_-tmp903_; double tmp905_ = (tmp904_)/tmp586_; double tmp906_ = (tmp905_)*mLocCoeffV_A_1; double tmp907_ = tmp896_+tmp906_; double tmp908_ = (tmp250_)*(tmp882_); double tmp909_ = -(tmp908_); double tmp910_ = tmp909_/tmp590_; double tmp911_ = (tmp910_)*mLocCoeffU_A_2; double tmp912_ = (tmp857_)*(tmp158_); double tmp913_ = (tmp861_)*(tmp165_); double tmp914_ = tmp912_+tmp913_; double tmp915_ = tmp864_*(tmp172_); double tmp916_ = tmp914_+tmp915_; double tmp917_ = (tmp916_)*(tmp177_); double tmp918_ = (tmp258_)*(tmp882_); double tmp919_ = tmp917_-tmp918_; double tmp920_ = (tmp919_)/tmp590_; double tmp921_ = (tmp920_)*mLocCoeffV_A_2; double tmp922_ = tmp911_+tmp921_; double tmp923_ = (tmp266_)*(tmp887_); double tmp924_ = -(tmp923_); double tmp925_ = tmp924_/tmp594_; double tmp926_ = (tmp925_)*mLocCoeffU_A_3; double tmp927_ = (tmp857_)*(tmp184_); double tmp928_ = (tmp861_)*(tmp191_); double tmp929_ = tmp927_+tmp928_; double tmp930_ = tmp864_*(tmp198_); double tmp931_ = tmp929_+tmp930_; double tmp932_ = (tmp931_)*(tmp203_); double tmp933_ = (tmp274_)*(tmp887_); double tmp934_ = tmp932_-tmp933_; double tmp935_ = (tmp934_)/tmp594_; double tmp936_ = (tmp935_)*mLocCoeffV_A_3; double tmp937_ = tmp926_+tmp936_; double tmp938_ = (tmp282_)*(tmp892_); double tmp939_ = -(tmp938_); double tmp940_ = tmp939_/tmp598_; double tmp941_ = (tmp940_)*mLocCoeffU_A_4; double tmp942_ = (tmp857_)*(tmp210_); double tmp943_ = (tmp861_)*(tmp217_); double tmp944_ = tmp942_+tmp943_; double tmp945_ = tmp864_*(tmp224_); double tmp946_ = tmp944_+tmp945_; double tmp947_ = (tmp946_)*(tmp229_); double tmp948_ = (tmp290_)*(tmp892_); double tmp949_ = tmp947_-tmp948_; double tmp950_ = (tmp949_)/tmp598_; double tmp951_ = (tmp950_)*mLocCoeffV_A_4; double tmp952_ = tmp941_+tmp951_; double tmp953_ = tmp872_+tmp907_; double tmp954_ = tmp953_+tmp922_; double tmp955_ = tmp954_+tmp937_; double tmp956_ = tmp955_+tmp952_; double tmp957_ = (tmp956_)*5; double tmp958_ = (tmp957_)/tmp681_; double tmp959_ = tmp547_*(tmp91_); double tmp960_ = tmp547_*tmp101_; double tmp961_ = tmp960_*(tmp100_); double tmp962_ = (tmp107_)*tmp959_; double tmp963_ = tmp961_-tmp962_; double tmp964_ = (tmp963_)/tmp559_; double tmp965_ = (tmp964_)*mLocCoeffU_A_0; double tmp966_ = tmp547_*(tmp113_); double tmp967_ = tmp966_*(tmp100_); double tmp968_ = (tmp122_)*tmp959_; double tmp969_ = tmp967_-tmp968_; double tmp970_ = (tmp969_)/tmp559_; double tmp971_ = (tmp970_)*mLocCoeffV_A_0; double tmp972_ = tmp965_+tmp971_; double tmp973_ = tmp960_*(tmp151_); double tmp974_ = (tmp234_)*tmp959_; double tmp975_ = tmp973_-tmp974_; double tmp976_ = (tmp975_)/tmp586_; double tmp977_ = (tmp976_)*mLocCoeffU_A_1; double tmp978_ = tmp966_*(tmp151_); double tmp979_ = (tmp242_)*tmp959_; double tmp980_ = tmp978_-tmp979_; double tmp981_ = (tmp980_)/tmp586_; double tmp982_ = (tmp981_)*mLocCoeffV_A_1; double tmp983_ = tmp977_+tmp982_; double tmp984_ = tmp960_*(tmp177_); double tmp985_ = (tmp250_)*tmp959_; double tmp986_ = tmp984_-tmp985_; double tmp987_ = (tmp986_)/tmp590_; double tmp988_ = (tmp987_)*mLocCoeffU_A_2; double tmp989_ = tmp966_*(tmp177_); double tmp990_ = (tmp258_)*tmp959_; double tmp991_ = tmp989_-tmp990_; double tmp992_ = (tmp991_)/tmp590_; double tmp993_ = (tmp992_)*mLocCoeffV_A_2; double tmp994_ = tmp988_+tmp993_; double tmp995_ = tmp960_*(tmp203_); double tmp996_ = (tmp266_)*tmp959_; double tmp997_ = tmp995_-tmp996_; double tmp998_ = (tmp997_)/tmp594_; double tmp999_ = (tmp998_)*mLocCoeffU_A_3; double tmp1000_ = tmp966_*(tmp203_); double tmp1001_ = (tmp274_)*tmp959_; double tmp1002_ = tmp1000_-tmp1001_; double tmp1003_ = (tmp1002_)/tmp594_; double tmp1004_ = (tmp1003_)*mLocCoeffV_A_3; double tmp1005_ = tmp999_+tmp1004_; double tmp1006_ = tmp960_*(tmp229_); double tmp1007_ = (tmp282_)*tmp959_; double tmp1008_ = tmp1006_-tmp1007_; double tmp1009_ = (tmp1008_)/tmp598_; double tmp1010_ = (tmp1009_)*mLocCoeffU_A_4; double tmp1011_ = tmp966_*(tmp229_); double tmp1012_ = (tmp290_)*tmp959_; double tmp1013_ = tmp1011_-tmp1012_; double tmp1014_ = (tmp1013_)/tmp598_; double tmp1015_ = (tmp1014_)*mLocCoeffV_A_4; double tmp1016_ = tmp1010_+tmp1015_; double tmp1017_ = tmp972_+tmp983_; double tmp1018_ = tmp1017_+tmp994_; double tmp1019_ = tmp1018_+tmp1005_; double tmp1020_ = tmp1019_+tmp1016_; double tmp1021_ = (tmp1020_)*5; double tmp1022_ = (tmp1021_)/tmp681_; double tmp1023_ = tmp547_*(tmp95_); double tmp1024_ = tmp547_*tmp103_; double tmp1025_ = tmp1024_*(tmp100_); double tmp1026_ = (tmp107_)*tmp1023_; double tmp1027_ = tmp1025_-tmp1026_; double tmp1028_ = (tmp1027_)/tmp559_; double tmp1029_ = (tmp1028_)*mLocCoeffU_A_0; double tmp1030_ = tmp547_*(tmp117_); double tmp1031_ = tmp1030_*(tmp100_); double tmp1032_ = (tmp122_)*tmp1023_; double tmp1033_ = tmp1031_-tmp1032_; double tmp1034_ = (tmp1033_)/tmp559_; double tmp1035_ = (tmp1034_)*mLocCoeffV_A_0; double tmp1036_ = tmp1029_+tmp1035_; double tmp1037_ = tmp1024_*(tmp151_); double tmp1038_ = (tmp234_)*tmp1023_; double tmp1039_ = tmp1037_-tmp1038_; double tmp1040_ = (tmp1039_)/tmp586_; double tmp1041_ = (tmp1040_)*mLocCoeffU_A_1; double tmp1042_ = tmp1030_*(tmp151_); double tmp1043_ = (tmp242_)*tmp1023_; double tmp1044_ = tmp1042_-tmp1043_; double tmp1045_ = (tmp1044_)/tmp586_; double tmp1046_ = (tmp1045_)*mLocCoeffV_A_1; double tmp1047_ = tmp1041_+tmp1046_; double tmp1048_ = tmp1024_*(tmp177_); double tmp1049_ = (tmp250_)*tmp1023_; double tmp1050_ = tmp1048_-tmp1049_; double tmp1051_ = (tmp1050_)/tmp590_; double tmp1052_ = (tmp1051_)*mLocCoeffU_A_2; double tmp1053_ = tmp1030_*(tmp177_); double tmp1054_ = (tmp258_)*tmp1023_; double tmp1055_ = tmp1053_-tmp1054_; double tmp1056_ = (tmp1055_)/tmp590_; double tmp1057_ = (tmp1056_)*mLocCoeffV_A_2; double tmp1058_ = tmp1052_+tmp1057_; double tmp1059_ = tmp1024_*(tmp203_); double tmp1060_ = (tmp266_)*tmp1023_; double tmp1061_ = tmp1059_-tmp1060_; double tmp1062_ = (tmp1061_)/tmp594_; double tmp1063_ = (tmp1062_)*mLocCoeffU_A_3; double tmp1064_ = tmp1030_*(tmp203_); double tmp1065_ = (tmp274_)*tmp1023_; double tmp1066_ = tmp1064_-tmp1065_; double tmp1067_ = (tmp1066_)/tmp594_; double tmp1068_ = (tmp1067_)*mLocCoeffV_A_3; double tmp1069_ = tmp1063_+tmp1068_; double tmp1070_ = tmp1024_*(tmp229_); double tmp1071_ = (tmp282_)*tmp1023_; double tmp1072_ = tmp1070_-tmp1071_; double tmp1073_ = (tmp1072_)/tmp598_; double tmp1074_ = (tmp1073_)*mLocCoeffU_A_4; double tmp1075_ = tmp1030_*(tmp229_); double tmp1076_ = (tmp290_)*tmp1023_; double tmp1077_ = tmp1075_-tmp1076_; double tmp1078_ = (tmp1077_)/tmp598_; double tmp1079_ = (tmp1078_)*mLocCoeffV_A_4; double tmp1080_ = tmp1074_+tmp1079_; double tmp1081_ = tmp1036_+tmp1047_; double tmp1082_ = tmp1081_+tmp1058_; double tmp1083_ = tmp1082_+tmp1069_; double tmp1084_ = tmp1083_+tmp1080_; double tmp1085_ = (tmp1084_)*5; double tmp1086_ = (tmp1085_)/tmp681_; double tmp1087_ = tmp547_*tmp98_; double tmp1088_ = tmp688_*(tmp100_); double tmp1089_ = (tmp107_)*tmp1087_; double tmp1090_ = tmp1088_-tmp1089_; double tmp1091_ = (tmp1090_)/tmp559_; double tmp1092_ = (tmp1091_)*mLocCoeffU_A_0; double tmp1093_ = tmp547_*tmp120_; double tmp1094_ = tmp1093_*(tmp100_); double tmp1095_ = (tmp122_)*tmp1087_; double tmp1096_ = tmp1094_-tmp1095_; double tmp1097_ = (tmp1096_)/tmp559_; double tmp1098_ = (tmp1097_)*mLocCoeffV_A_0; double tmp1099_ = tmp1092_+tmp1098_; double tmp1100_ = tmp688_*(tmp151_); double tmp1101_ = (tmp234_)*tmp1087_; double tmp1102_ = tmp1100_-tmp1101_; double tmp1103_ = (tmp1102_)/tmp586_; double tmp1104_ = (tmp1103_)*mLocCoeffU_A_1; double tmp1105_ = tmp1093_*(tmp151_); double tmp1106_ = (tmp242_)*tmp1087_; double tmp1107_ = tmp1105_-tmp1106_; double tmp1108_ = (tmp1107_)/tmp586_; double tmp1109_ = (tmp1108_)*mLocCoeffV_A_1; double tmp1110_ = tmp1104_+tmp1109_; double tmp1111_ = tmp688_*(tmp177_); double tmp1112_ = (tmp250_)*tmp1087_; double tmp1113_ = tmp1111_-tmp1112_; double tmp1114_ = (tmp1113_)/tmp590_; double tmp1115_ = (tmp1114_)*mLocCoeffU_A_2; double tmp1116_ = tmp1093_*(tmp177_); double tmp1117_ = (tmp258_)*tmp1087_; double tmp1118_ = tmp1116_-tmp1117_; double tmp1119_ = (tmp1118_)/tmp590_; double tmp1120_ = (tmp1119_)*mLocCoeffV_A_2; double tmp1121_ = tmp1115_+tmp1120_; double tmp1122_ = tmp688_*(tmp203_); double tmp1123_ = (tmp266_)*tmp1087_; double tmp1124_ = tmp1122_-tmp1123_; double tmp1125_ = (tmp1124_)/tmp594_; double tmp1126_ = (tmp1125_)*mLocCoeffU_A_3; double tmp1127_ = tmp1093_*(tmp203_); double tmp1128_ = (tmp274_)*tmp1087_; double tmp1129_ = tmp1127_-tmp1128_; double tmp1130_ = (tmp1129_)/tmp594_; double tmp1131_ = (tmp1130_)*mLocCoeffV_A_3; double tmp1132_ = tmp1126_+tmp1131_; double tmp1133_ = tmp688_*(tmp229_); double tmp1134_ = (tmp282_)*tmp1087_; double tmp1135_ = tmp1133_-tmp1134_; double tmp1136_ = (tmp1135_)/tmp598_; double tmp1137_ = (tmp1136_)*mLocCoeffU_A_4; double tmp1138_ = tmp1093_*(tmp229_); double tmp1139_ = (tmp290_)*tmp1087_; double tmp1140_ = tmp1138_-tmp1139_; double tmp1141_ = (tmp1140_)/tmp598_; double tmp1142_ = (tmp1141_)*mLocCoeffV_A_4; double tmp1143_ = tmp1137_+tmp1142_; double tmp1144_ = tmp1099_+tmp1110_; double tmp1145_ = tmp1144_+tmp1121_; double tmp1146_ = tmp1145_+tmp1132_; double tmp1147_ = tmp1146_+tmp1143_; double tmp1148_ = (tmp1147_)*5; double tmp1149_ = (tmp1148_)/tmp681_; double tmp1150_ = tmp547_*tmp302_; double tmp1151_ = -(tmp303_); double tmp1152_ = tmp1150_*tmp316_; double tmp1153_ = tmp1151_*tmp315_; double tmp1154_ = tmp1152_*tmp317_; double tmp1155_ = tmp1153_+tmp1154_; double tmp1156_ = (tmp1155_)*(tmp313_); double tmp1157_ = tmp1150_*tmp315_; double tmp1158_ = tmp1157_+tmp338_; double tmp1159_ = (tmp1158_)*(tmp325_); double tmp1160_ = tmp1156_+tmp1159_; double tmp1161_ = ElSquare(tmp348_); double tmp1162_ = tmp1150_*tmp301_; double tmp1163_ = tmp1162_*(tmp313_); double tmp1164_ = tmp349_*(tmp325_); double tmp1165_ = tmp1163_+tmp1164_; double tmp1166_ = (tmp1165_)*(tmp348_); double tmp1167_ = (tmp355_)*(tmp1160_); double tmp1168_ = tmp1166_-tmp1167_; double tmp1169_ = (tmp1168_)/tmp1161_; double tmp1170_ = (tmp1169_)*mLocCoeffU_B_0; double tmp1171_ = tmp1151_*tmp317_; double tmp1172_ = tmp1152_*tmp314_; double tmp1173_ = tmp1171_+tmp1172_; double tmp1174_ = (tmp1173_)*(tmp313_); double tmp1175_ = tmp1150_*tmp317_; double tmp1176_ = tmp1175_+tmp360_; double tmp1177_ = (tmp1176_)*(tmp325_); double tmp1178_ = tmp1174_+tmp1177_; double tmp1179_ = (tmp1178_)*(tmp348_); double tmp1180_ = (tmp370_)*(tmp1160_); double tmp1181_ = tmp1179_-tmp1180_; double tmp1182_ = (tmp1181_)/tmp1161_; double tmp1183_ = (tmp1182_)*mLocCoeffV_B_0; double tmp1184_ = tmp1170_+tmp1183_; double tmp1185_ = (tmp1155_)*(tmp380_); double tmp1186_ = (tmp1158_)*(tmp387_); double tmp1187_ = tmp1185_+tmp1186_; double tmp1188_ = ElSquare(tmp399_); double tmp1189_ = (tmp1155_)*(tmp406_); double tmp1190_ = (tmp1158_)*(tmp413_); double tmp1191_ = tmp1189_+tmp1190_; double tmp1192_ = ElSquare(tmp425_); double tmp1193_ = (tmp1155_)*(tmp432_); double tmp1194_ = (tmp1158_)*(tmp439_); double tmp1195_ = tmp1193_+tmp1194_; double tmp1196_ = ElSquare(tmp451_); double tmp1197_ = (tmp1155_)*(tmp458_); double tmp1198_ = (tmp1158_)*(tmp465_); double tmp1199_ = tmp1197_+tmp1198_; double tmp1200_ = ElSquare(tmp477_); double tmp1201_ = ElSquare(tmp373_); double tmp1202_ = ElSquare(tmp493_); double tmp1203_ = tmp1201_+tmp1202_; double tmp1204_ = ElSquare(tmp509_); double tmp1205_ = tmp1203_+tmp1204_; double tmp1206_ = ElSquare(tmp525_); double tmp1207_ = tmp1205_+tmp1206_; double tmp1208_ = ElSquare(tmp541_); double tmp1209_ = tmp1207_+tmp1208_; double tmp1210_ = (tmp1209_)/5; double tmp1211_ = ElSquare(tmp546_); double tmp1212_ = tmp1210_-tmp1211_; double tmp1213_ = sqrt(tmp1212_); double tmp1214_ = (tmp373_)-tmp546_; double tmp1215_ = tmp1162_*(tmp380_); double tmp1216_ = tmp349_*(tmp387_); double tmp1217_ = tmp1215_+tmp1216_; double tmp1218_ = (tmp1217_)*(tmp399_); double tmp1219_ = (tmp482_)*(tmp1187_); double tmp1220_ = tmp1218_-tmp1219_; double tmp1221_ = (tmp1220_)/tmp1188_; double tmp1222_ = (tmp1221_)*mLocCoeffU_B_1; double tmp1223_ = (tmp1173_)*(tmp380_); double tmp1224_ = (tmp1176_)*(tmp387_); double tmp1225_ = tmp1223_+tmp1224_; double tmp1226_ = (tmp1225_)*(tmp399_); double tmp1227_ = (tmp490_)*(tmp1187_); double tmp1228_ = tmp1226_-tmp1227_; double tmp1229_ = (tmp1228_)/tmp1188_; double tmp1230_ = (tmp1229_)*mLocCoeffV_B_1; double tmp1231_ = tmp1222_+tmp1230_; double tmp1232_ = tmp1162_*(tmp406_); double tmp1233_ = tmp349_*(tmp413_); double tmp1234_ = tmp1232_+tmp1233_; double tmp1235_ = (tmp1234_)*(tmp425_); double tmp1236_ = (tmp498_)*(tmp1191_); double tmp1237_ = tmp1235_-tmp1236_; double tmp1238_ = (tmp1237_)/tmp1192_; double tmp1239_ = (tmp1238_)*mLocCoeffU_B_2; double tmp1240_ = (tmp1173_)*(tmp406_); double tmp1241_ = (tmp1176_)*(tmp413_); double tmp1242_ = tmp1240_+tmp1241_; double tmp1243_ = (tmp1242_)*(tmp425_); double tmp1244_ = (tmp506_)*(tmp1191_); double tmp1245_ = tmp1243_-tmp1244_; double tmp1246_ = (tmp1245_)/tmp1192_; double tmp1247_ = (tmp1246_)*mLocCoeffV_B_2; double tmp1248_ = tmp1239_+tmp1247_; double tmp1249_ = tmp1162_*(tmp432_); double tmp1250_ = tmp349_*(tmp439_); double tmp1251_ = tmp1249_+tmp1250_; double tmp1252_ = (tmp1251_)*(tmp451_); double tmp1253_ = (tmp514_)*(tmp1195_); double tmp1254_ = tmp1252_-tmp1253_; double tmp1255_ = (tmp1254_)/tmp1196_; double tmp1256_ = (tmp1255_)*mLocCoeffU_B_3; double tmp1257_ = (tmp1173_)*(tmp432_); double tmp1258_ = (tmp1176_)*(tmp439_); double tmp1259_ = tmp1257_+tmp1258_; double tmp1260_ = (tmp1259_)*(tmp451_); double tmp1261_ = (tmp522_)*(tmp1195_); double tmp1262_ = tmp1260_-tmp1261_; double tmp1263_ = (tmp1262_)/tmp1196_; double tmp1264_ = (tmp1263_)*mLocCoeffV_B_3; double tmp1265_ = tmp1256_+tmp1264_; double tmp1266_ = tmp1162_*(tmp458_); double tmp1267_ = tmp349_*(tmp465_); double tmp1268_ = tmp1266_+tmp1267_; double tmp1269_ = (tmp1268_)*(tmp477_); double tmp1270_ = (tmp530_)*(tmp1199_); double tmp1271_ = tmp1269_-tmp1270_; double tmp1272_ = (tmp1271_)/tmp1200_; double tmp1273_ = (tmp1272_)*mLocCoeffU_B_4; double tmp1274_ = (tmp1173_)*(tmp458_); double tmp1275_ = (tmp1176_)*(tmp465_); double tmp1276_ = tmp1274_+tmp1275_; double tmp1277_ = (tmp1276_)*(tmp477_); double tmp1278_ = (tmp538_)*(tmp1199_); double tmp1279_ = tmp1277_-tmp1278_; double tmp1280_ = (tmp1279_)/tmp1200_; double tmp1281_ = (tmp1280_)*mLocCoeffV_B_4; double tmp1282_ = tmp1273_+tmp1281_; double tmp1283_ = tmp1184_+tmp1231_; double tmp1284_ = tmp1283_+tmp1248_; double tmp1285_ = tmp1284_+tmp1265_; double tmp1286_ = tmp1285_+tmp1282_; double tmp1287_ = (tmp1286_)*5; double tmp1288_ = (tmp1287_)/tmp681_; double tmp1289_ = tmp547_*tmp304_; double tmp1290_ = -(tmp301_); double tmp1291_ = tmp1290_*tmp303_; double tmp1292_ = tmp1290_*tmp302_; double tmp1293_ = tmp1291_*tmp317_; double tmp1294_ = tmp1293_*(tmp313_); double tmp1295_ = tmp1292_*tmp317_; double tmp1296_ = tmp1295_*(tmp325_); double tmp1297_ = tmp1294_+tmp1296_; double tmp1298_ = tmp1289_*tmp317_; double tmp1299_ = tmp1298_*(tmp333_); double tmp1300_ = tmp1297_+tmp1299_; double tmp1301_ = tmp1289_*tmp303_; double tmp1302_ = tmp1301_*(tmp313_); double tmp1303_ = tmp1289_*tmp302_; double tmp1304_ = tmp1303_*(tmp325_); double tmp1305_ = tmp1302_+tmp1304_; double tmp1306_ = tmp301_*(tmp333_); double tmp1307_ = tmp1305_+tmp1306_; double tmp1308_ = (tmp1307_)*(tmp348_); double tmp1309_ = (tmp355_)*(tmp1300_); double tmp1310_ = tmp1308_-tmp1309_; double tmp1311_ = (tmp1310_)/tmp1161_; double tmp1312_ = (tmp1311_)*mLocCoeffU_B_0; double tmp1313_ = tmp1291_*tmp314_; double tmp1314_ = tmp1313_*(tmp313_); double tmp1315_ = tmp1292_*tmp314_; double tmp1316_ = tmp1315_*(tmp325_); double tmp1317_ = tmp1314_+tmp1316_; double tmp1318_ = tmp1289_*tmp314_; double tmp1319_ = tmp1318_*(tmp333_); double tmp1320_ = tmp1317_+tmp1319_; double tmp1321_ = (tmp1320_)*(tmp348_); double tmp1322_ = (tmp370_)*(tmp1300_); double tmp1323_ = tmp1321_-tmp1322_; double tmp1324_ = (tmp1323_)/tmp1161_; double tmp1325_ = (tmp1324_)*mLocCoeffV_B_0; double tmp1326_ = tmp1312_+tmp1325_; double tmp1327_ = tmp1293_*(tmp380_); double tmp1328_ = tmp1295_*(tmp387_); double tmp1329_ = tmp1327_+tmp1328_; double tmp1330_ = tmp1298_*(tmp394_); double tmp1331_ = tmp1329_+tmp1330_; double tmp1332_ = tmp1293_*(tmp406_); double tmp1333_ = tmp1295_*(tmp413_); double tmp1334_ = tmp1332_+tmp1333_; double tmp1335_ = tmp1298_*(tmp420_); double tmp1336_ = tmp1334_+tmp1335_; double tmp1337_ = tmp1293_*(tmp432_); double tmp1338_ = tmp1295_*(tmp439_); double tmp1339_ = tmp1337_+tmp1338_; double tmp1340_ = tmp1298_*(tmp446_); double tmp1341_ = tmp1339_+tmp1340_; double tmp1342_ = tmp1293_*(tmp458_); double tmp1343_ = tmp1295_*(tmp465_); double tmp1344_ = tmp1342_+tmp1343_; double tmp1345_ = tmp1298_*(tmp472_); double tmp1346_ = tmp1344_+tmp1345_; double tmp1347_ = tmp1301_*(tmp380_); double tmp1348_ = tmp1303_*(tmp387_); double tmp1349_ = tmp1347_+tmp1348_; double tmp1350_ = tmp301_*(tmp394_); double tmp1351_ = tmp1349_+tmp1350_; double tmp1352_ = (tmp1351_)*(tmp399_); double tmp1353_ = (tmp482_)*(tmp1331_); double tmp1354_ = tmp1352_-tmp1353_; double tmp1355_ = (tmp1354_)/tmp1188_; double tmp1356_ = (tmp1355_)*mLocCoeffU_B_1; double tmp1357_ = tmp1313_*(tmp380_); double tmp1358_ = tmp1315_*(tmp387_); double tmp1359_ = tmp1357_+tmp1358_; double tmp1360_ = tmp1318_*(tmp394_); double tmp1361_ = tmp1359_+tmp1360_; double tmp1362_ = (tmp1361_)*(tmp399_); double tmp1363_ = (tmp490_)*(tmp1331_); double tmp1364_ = tmp1362_-tmp1363_; double tmp1365_ = (tmp1364_)/tmp1188_; double tmp1366_ = (tmp1365_)*mLocCoeffV_B_1; double tmp1367_ = tmp1356_+tmp1366_; double tmp1368_ = tmp1301_*(tmp406_); double tmp1369_ = tmp1303_*(tmp413_); double tmp1370_ = tmp1368_+tmp1369_; double tmp1371_ = tmp301_*(tmp420_); double tmp1372_ = tmp1370_+tmp1371_; double tmp1373_ = (tmp1372_)*(tmp425_); double tmp1374_ = (tmp498_)*(tmp1336_); double tmp1375_ = tmp1373_-tmp1374_; double tmp1376_ = (tmp1375_)/tmp1192_; double tmp1377_ = (tmp1376_)*mLocCoeffU_B_2; double tmp1378_ = tmp1313_*(tmp406_); double tmp1379_ = tmp1315_*(tmp413_); double tmp1380_ = tmp1378_+tmp1379_; double tmp1381_ = tmp1318_*(tmp420_); double tmp1382_ = tmp1380_+tmp1381_; double tmp1383_ = (tmp1382_)*(tmp425_); double tmp1384_ = (tmp506_)*(tmp1336_); double tmp1385_ = tmp1383_-tmp1384_; double tmp1386_ = (tmp1385_)/tmp1192_; double tmp1387_ = (tmp1386_)*mLocCoeffV_B_2; double tmp1388_ = tmp1377_+tmp1387_; double tmp1389_ = tmp1301_*(tmp432_); double tmp1390_ = tmp1303_*(tmp439_); double tmp1391_ = tmp1389_+tmp1390_; double tmp1392_ = tmp301_*(tmp446_); double tmp1393_ = tmp1391_+tmp1392_; double tmp1394_ = (tmp1393_)*(tmp451_); double tmp1395_ = (tmp514_)*(tmp1341_); double tmp1396_ = tmp1394_-tmp1395_; double tmp1397_ = (tmp1396_)/tmp1196_; double tmp1398_ = (tmp1397_)*mLocCoeffU_B_3; double tmp1399_ = tmp1313_*(tmp432_); double tmp1400_ = tmp1315_*(tmp439_); double tmp1401_ = tmp1399_+tmp1400_; double tmp1402_ = tmp1318_*(tmp446_); double tmp1403_ = tmp1401_+tmp1402_; double tmp1404_ = (tmp1403_)*(tmp451_); double tmp1405_ = (tmp522_)*(tmp1341_); double tmp1406_ = tmp1404_-tmp1405_; double tmp1407_ = (tmp1406_)/tmp1196_; double tmp1408_ = (tmp1407_)*mLocCoeffV_B_3; double tmp1409_ = tmp1398_+tmp1408_; double tmp1410_ = tmp1301_*(tmp458_); double tmp1411_ = tmp1303_*(tmp465_); double tmp1412_ = tmp1410_+tmp1411_; double tmp1413_ = tmp301_*(tmp472_); double tmp1414_ = tmp1412_+tmp1413_; double tmp1415_ = (tmp1414_)*(tmp477_); double tmp1416_ = (tmp530_)*(tmp1346_); double tmp1417_ = tmp1415_-tmp1416_; double tmp1418_ = (tmp1417_)/tmp1200_; double tmp1419_ = (tmp1418_)*mLocCoeffU_B_4; double tmp1420_ = tmp1313_*(tmp458_); double tmp1421_ = tmp1315_*(tmp465_); double tmp1422_ = tmp1420_+tmp1421_; double tmp1423_ = tmp1318_*(tmp472_); double tmp1424_ = tmp1422_+tmp1423_; double tmp1425_ = (tmp1424_)*(tmp477_); double tmp1426_ = (tmp538_)*(tmp1346_); double tmp1427_ = tmp1425_-tmp1426_; double tmp1428_ = (tmp1427_)/tmp1200_; double tmp1429_ = (tmp1428_)*mLocCoeffV_B_4; double tmp1430_ = tmp1419_+tmp1429_; double tmp1431_ = tmp1326_+tmp1367_; double tmp1432_ = tmp1431_+tmp1388_; double tmp1433_ = tmp1432_+tmp1409_; double tmp1434_ = tmp1433_+tmp1430_; double tmp1435_ = (tmp1434_)*5; double tmp1436_ = (tmp1435_)/tmp681_; double tmp1437_ = ElSquare(tmp1213_); double tmp1438_ = -(tmp317_); double tmp1439_ = tmp547_*tmp314_; double tmp1440_ = tmp1438_*tmp334_; double tmp1441_ = tmp1439_*tmp335_; double tmp1442_ = tmp1440_+tmp1441_; double tmp1443_ = (tmp1442_)*(tmp313_); double tmp1444_ = tmp1438_*tmp303_; double tmp1445_ = tmp1439_*tmp336_; double tmp1446_ = tmp1444_+tmp1445_; double tmp1447_ = (tmp1446_)*(tmp325_); double tmp1448_ = tmp1443_+tmp1447_; double tmp1449_ = tmp1439_*tmp301_; double tmp1450_ = tmp1449_*(tmp333_); double tmp1451_ = tmp1448_+tmp1450_; double tmp1452_ = (tmp355_)*(tmp1451_); double tmp1453_ = -(tmp1452_); double tmp1454_ = tmp1453_/tmp1161_; double tmp1455_ = (tmp1454_)*mLocCoeffU_B_0; double tmp1456_ = tmp1439_*tmp334_; double tmp1457_ = tmp317_*tmp335_; double tmp1458_ = tmp1456_+tmp1457_; double tmp1459_ = (tmp1458_)*(tmp313_); double tmp1460_ = tmp1439_*tmp303_; double tmp1461_ = tmp317_*tmp336_; double tmp1462_ = tmp1460_+tmp1461_; double tmp1463_ = (tmp1462_)*(tmp325_); double tmp1464_ = tmp1459_+tmp1463_; double tmp1465_ = tmp317_*tmp301_; double tmp1466_ = tmp1465_*(tmp333_); double tmp1467_ = tmp1464_+tmp1466_; double tmp1468_ = (tmp1467_)*(tmp348_); double tmp1469_ = (tmp370_)*(tmp1451_); double tmp1470_ = tmp1468_-tmp1469_; double tmp1471_ = (tmp1470_)/tmp1161_; double tmp1472_ = (tmp1471_)*mLocCoeffV_B_0; double tmp1473_ = tmp1455_+tmp1472_; double tmp1474_ = (tmp1442_)*(tmp380_); double tmp1475_ = (tmp1446_)*(tmp387_); double tmp1476_ = tmp1474_+tmp1475_; double tmp1477_ = tmp1449_*(tmp394_); double tmp1478_ = tmp1476_+tmp1477_; double tmp1479_ = (tmp1442_)*(tmp406_); double tmp1480_ = (tmp1446_)*(tmp413_); double tmp1481_ = tmp1479_+tmp1480_; double tmp1482_ = tmp1449_*(tmp420_); double tmp1483_ = tmp1481_+tmp1482_; double tmp1484_ = (tmp1442_)*(tmp432_); double tmp1485_ = (tmp1446_)*(tmp439_); double tmp1486_ = tmp1484_+tmp1485_; double tmp1487_ = tmp1449_*(tmp446_); double tmp1488_ = tmp1486_+tmp1487_; double tmp1489_ = (tmp1442_)*(tmp458_); double tmp1490_ = (tmp1446_)*(tmp465_); double tmp1491_ = tmp1489_+tmp1490_; double tmp1492_ = tmp1449_*(tmp472_); double tmp1493_ = tmp1491_+tmp1492_; double tmp1494_ = (tmp482_)*(tmp1478_); double tmp1495_ = -(tmp1494_); double tmp1496_ = tmp1495_/tmp1188_; double tmp1497_ = (tmp1496_)*mLocCoeffU_B_1; double tmp1498_ = (tmp1458_)*(tmp380_); double tmp1499_ = (tmp1462_)*(tmp387_); double tmp1500_ = tmp1498_+tmp1499_; double tmp1501_ = tmp1465_*(tmp394_); double tmp1502_ = tmp1500_+tmp1501_; double tmp1503_ = (tmp1502_)*(tmp399_); double tmp1504_ = (tmp490_)*(tmp1478_); double tmp1505_ = tmp1503_-tmp1504_; double tmp1506_ = (tmp1505_)/tmp1188_; double tmp1507_ = (tmp1506_)*mLocCoeffV_B_1; double tmp1508_ = tmp1497_+tmp1507_; double tmp1509_ = (tmp498_)*(tmp1483_); double tmp1510_ = -(tmp1509_); double tmp1511_ = tmp1510_/tmp1192_; double tmp1512_ = (tmp1511_)*mLocCoeffU_B_2; double tmp1513_ = (tmp1458_)*(tmp406_); double tmp1514_ = (tmp1462_)*(tmp413_); double tmp1515_ = tmp1513_+tmp1514_; double tmp1516_ = tmp1465_*(tmp420_); double tmp1517_ = tmp1515_+tmp1516_; double tmp1518_ = (tmp1517_)*(tmp425_); double tmp1519_ = (tmp506_)*(tmp1483_); double tmp1520_ = tmp1518_-tmp1519_; double tmp1521_ = (tmp1520_)/tmp1192_; double tmp1522_ = (tmp1521_)*mLocCoeffV_B_2; double tmp1523_ = tmp1512_+tmp1522_; double tmp1524_ = (tmp514_)*(tmp1488_); double tmp1525_ = -(tmp1524_); double tmp1526_ = tmp1525_/tmp1196_; double tmp1527_ = (tmp1526_)*mLocCoeffU_B_3; double tmp1528_ = (tmp1458_)*(tmp432_); double tmp1529_ = (tmp1462_)*(tmp439_); double tmp1530_ = tmp1528_+tmp1529_; double tmp1531_ = tmp1465_*(tmp446_); double tmp1532_ = tmp1530_+tmp1531_; double tmp1533_ = (tmp1532_)*(tmp451_); double tmp1534_ = (tmp522_)*(tmp1488_); double tmp1535_ = tmp1533_-tmp1534_; double tmp1536_ = (tmp1535_)/tmp1196_; double tmp1537_ = (tmp1536_)*mLocCoeffV_B_3; double tmp1538_ = tmp1527_+tmp1537_; double tmp1539_ = (tmp530_)*(tmp1493_); double tmp1540_ = -(tmp1539_); double tmp1541_ = tmp1540_/tmp1200_; double tmp1542_ = (tmp1541_)*mLocCoeffU_B_4; double tmp1543_ = (tmp1458_)*(tmp458_); double tmp1544_ = (tmp1462_)*(tmp465_); double tmp1545_ = tmp1543_+tmp1544_; double tmp1546_ = tmp1465_*(tmp472_); double tmp1547_ = tmp1545_+tmp1546_; double tmp1548_ = (tmp1547_)*(tmp477_); double tmp1549_ = (tmp538_)*(tmp1493_); double tmp1550_ = tmp1548_-tmp1549_; double tmp1551_ = (tmp1550_)/tmp1200_; double tmp1552_ = (tmp1551_)*mLocCoeffV_B_4; double tmp1553_ = tmp1542_+tmp1552_; double tmp1554_ = tmp1473_+tmp1508_; double tmp1555_ = tmp1554_+tmp1523_; double tmp1556_ = tmp1555_+tmp1538_; double tmp1557_ = tmp1556_+tmp1553_; double tmp1558_ = (tmp1557_)*5; double tmp1559_ = (tmp1558_)/tmp681_; double tmp1560_ = tmp547_*(tmp339_); double tmp1561_ = tmp547_*tmp349_; double tmp1562_ = tmp1561_*(tmp348_); double tmp1563_ = (tmp355_)*tmp1560_; double tmp1564_ = tmp1562_-tmp1563_; double tmp1565_ = (tmp1564_)/tmp1161_; double tmp1566_ = (tmp1565_)*mLocCoeffU_B_0; double tmp1567_ = tmp547_*(tmp361_); double tmp1568_ = tmp1567_*(tmp348_); double tmp1569_ = (tmp370_)*tmp1560_; double tmp1570_ = tmp1568_-tmp1569_; double tmp1571_ = (tmp1570_)/tmp1161_; double tmp1572_ = (tmp1571_)*mLocCoeffV_B_0; double tmp1573_ = tmp1566_+tmp1572_; double tmp1574_ = tmp1561_*(tmp399_); double tmp1575_ = (tmp482_)*tmp1560_; double tmp1576_ = tmp1574_-tmp1575_; double tmp1577_ = (tmp1576_)/tmp1188_; double tmp1578_ = (tmp1577_)*mLocCoeffU_B_1; double tmp1579_ = tmp1567_*(tmp399_); double tmp1580_ = (tmp490_)*tmp1560_; double tmp1581_ = tmp1579_-tmp1580_; double tmp1582_ = (tmp1581_)/tmp1188_; double tmp1583_ = (tmp1582_)*mLocCoeffV_B_1; double tmp1584_ = tmp1578_+tmp1583_; double tmp1585_ = tmp1561_*(tmp425_); double tmp1586_ = (tmp498_)*tmp1560_; double tmp1587_ = tmp1585_-tmp1586_; double tmp1588_ = (tmp1587_)/tmp1192_; double tmp1589_ = (tmp1588_)*mLocCoeffU_B_2; double tmp1590_ = tmp1567_*(tmp425_); double tmp1591_ = (tmp506_)*tmp1560_; double tmp1592_ = tmp1590_-tmp1591_; double tmp1593_ = (tmp1592_)/tmp1192_; double tmp1594_ = (tmp1593_)*mLocCoeffV_B_2; double tmp1595_ = tmp1589_+tmp1594_; double tmp1596_ = tmp1561_*(tmp451_); double tmp1597_ = (tmp514_)*tmp1560_; double tmp1598_ = tmp1596_-tmp1597_; double tmp1599_ = (tmp1598_)/tmp1196_; double tmp1600_ = (tmp1599_)*mLocCoeffU_B_3; double tmp1601_ = tmp1567_*(tmp451_); double tmp1602_ = (tmp522_)*tmp1560_; double tmp1603_ = tmp1601_-tmp1602_; double tmp1604_ = (tmp1603_)/tmp1196_; double tmp1605_ = (tmp1604_)*mLocCoeffV_B_3; double tmp1606_ = tmp1600_+tmp1605_; double tmp1607_ = tmp1561_*(tmp477_); double tmp1608_ = (tmp530_)*tmp1560_; double tmp1609_ = tmp1607_-tmp1608_; double tmp1610_ = (tmp1609_)/tmp1200_; double tmp1611_ = (tmp1610_)*mLocCoeffU_B_4; double tmp1612_ = tmp1567_*(tmp477_); double tmp1613_ = (tmp538_)*tmp1560_; double tmp1614_ = tmp1612_-tmp1613_; double tmp1615_ = (tmp1614_)/tmp1200_; double tmp1616_ = (tmp1615_)*mLocCoeffV_B_4; double tmp1617_ = tmp1611_+tmp1616_; double tmp1618_ = tmp1573_+tmp1584_; double tmp1619_ = tmp1618_+tmp1595_; double tmp1620_ = tmp1619_+tmp1606_; double tmp1621_ = tmp1620_+tmp1617_; double tmp1622_ = (tmp1621_)*5; double tmp1623_ = (tmp1622_)/tmp681_; double tmp1624_ = tmp547_*(tmp343_); double tmp1625_ = tmp547_*tmp351_; double tmp1626_ = tmp1625_*(tmp348_); double tmp1627_ = (tmp355_)*tmp1624_; double tmp1628_ = tmp1626_-tmp1627_; double tmp1629_ = (tmp1628_)/tmp1161_; double tmp1630_ = (tmp1629_)*mLocCoeffU_B_0; double tmp1631_ = tmp547_*(tmp365_); double tmp1632_ = tmp1631_*(tmp348_); double tmp1633_ = (tmp370_)*tmp1624_; double tmp1634_ = tmp1632_-tmp1633_; double tmp1635_ = (tmp1634_)/tmp1161_; double tmp1636_ = (tmp1635_)*mLocCoeffV_B_0; double tmp1637_ = tmp1630_+tmp1636_; double tmp1638_ = tmp1625_*(tmp399_); double tmp1639_ = (tmp482_)*tmp1624_; double tmp1640_ = tmp1638_-tmp1639_; double tmp1641_ = (tmp1640_)/tmp1188_; double tmp1642_ = (tmp1641_)*mLocCoeffU_B_1; double tmp1643_ = tmp1631_*(tmp399_); double tmp1644_ = (tmp490_)*tmp1624_; double tmp1645_ = tmp1643_-tmp1644_; double tmp1646_ = (tmp1645_)/tmp1188_; double tmp1647_ = (tmp1646_)*mLocCoeffV_B_1; double tmp1648_ = tmp1642_+tmp1647_; double tmp1649_ = tmp1625_*(tmp425_); double tmp1650_ = (tmp498_)*tmp1624_; double tmp1651_ = tmp1649_-tmp1650_; double tmp1652_ = (tmp1651_)/tmp1192_; double tmp1653_ = (tmp1652_)*mLocCoeffU_B_2; double tmp1654_ = tmp1631_*(tmp425_); double tmp1655_ = (tmp506_)*tmp1624_; double tmp1656_ = tmp1654_-tmp1655_; double tmp1657_ = (tmp1656_)/tmp1192_; double tmp1658_ = (tmp1657_)*mLocCoeffV_B_2; double tmp1659_ = tmp1653_+tmp1658_; double tmp1660_ = tmp1625_*(tmp451_); double tmp1661_ = (tmp514_)*tmp1624_; double tmp1662_ = tmp1660_-tmp1661_; double tmp1663_ = (tmp1662_)/tmp1196_; double tmp1664_ = (tmp1663_)*mLocCoeffU_B_3; double tmp1665_ = tmp1631_*(tmp451_); double tmp1666_ = (tmp522_)*tmp1624_; double tmp1667_ = tmp1665_-tmp1666_; double tmp1668_ = (tmp1667_)/tmp1196_; double tmp1669_ = (tmp1668_)*mLocCoeffV_B_3; double tmp1670_ = tmp1664_+tmp1669_; double tmp1671_ = tmp1625_*(tmp477_); double tmp1672_ = (tmp530_)*tmp1624_; double tmp1673_ = tmp1671_-tmp1672_; double tmp1674_ = (tmp1673_)/tmp1200_; double tmp1675_ = (tmp1674_)*mLocCoeffU_B_4; double tmp1676_ = tmp1631_*(tmp477_); double tmp1677_ = (tmp538_)*tmp1624_; double tmp1678_ = tmp1676_-tmp1677_; double tmp1679_ = (tmp1678_)/tmp1200_; double tmp1680_ = (tmp1679_)*mLocCoeffV_B_4; double tmp1681_ = tmp1675_+tmp1680_; double tmp1682_ = tmp1637_+tmp1648_; double tmp1683_ = tmp1682_+tmp1659_; double tmp1684_ = tmp1683_+tmp1670_; double tmp1685_ = tmp1684_+tmp1681_; double tmp1686_ = (tmp1685_)*5; double tmp1687_ = (tmp1686_)/tmp681_; double tmp1688_ = tmp547_*tmp346_; double tmp1689_ = tmp1289_*(tmp348_); double tmp1690_ = (tmp355_)*tmp1688_; double tmp1691_ = tmp1689_-tmp1690_; double tmp1692_ = (tmp1691_)/tmp1161_; double tmp1693_ = (tmp1692_)*mLocCoeffU_B_0; double tmp1694_ = tmp547_*tmp368_; double tmp1695_ = tmp1694_*(tmp348_); double tmp1696_ = (tmp370_)*tmp1688_; double tmp1697_ = tmp1695_-tmp1696_; double tmp1698_ = (tmp1697_)/tmp1161_; double tmp1699_ = (tmp1698_)*mLocCoeffV_B_0; double tmp1700_ = tmp1693_+tmp1699_; double tmp1701_ = tmp1289_*(tmp399_); double tmp1702_ = (tmp482_)*tmp1688_; double tmp1703_ = tmp1701_-tmp1702_; double tmp1704_ = (tmp1703_)/tmp1188_; double tmp1705_ = (tmp1704_)*mLocCoeffU_B_1; double tmp1706_ = tmp1694_*(tmp399_); double tmp1707_ = (tmp490_)*tmp1688_; double tmp1708_ = tmp1706_-tmp1707_; double tmp1709_ = (tmp1708_)/tmp1188_; double tmp1710_ = (tmp1709_)*mLocCoeffV_B_1; double tmp1711_ = tmp1705_+tmp1710_; double tmp1712_ = tmp1289_*(tmp425_); double tmp1713_ = (tmp498_)*tmp1688_; double tmp1714_ = tmp1712_-tmp1713_; double tmp1715_ = (tmp1714_)/tmp1192_; double tmp1716_ = (tmp1715_)*mLocCoeffU_B_2; double tmp1717_ = tmp1694_*(tmp425_); double tmp1718_ = (tmp506_)*tmp1688_; double tmp1719_ = tmp1717_-tmp1718_; double tmp1720_ = (tmp1719_)/tmp1192_; double tmp1721_ = (tmp1720_)*mLocCoeffV_B_2; double tmp1722_ = tmp1716_+tmp1721_; double tmp1723_ = tmp1289_*(tmp451_); double tmp1724_ = (tmp514_)*tmp1688_; double tmp1725_ = tmp1723_-tmp1724_; double tmp1726_ = (tmp1725_)/tmp1196_; double tmp1727_ = (tmp1726_)*mLocCoeffU_B_3; double tmp1728_ = tmp1694_*(tmp451_); double tmp1729_ = (tmp522_)*tmp1688_; double tmp1730_ = tmp1728_-tmp1729_; double tmp1731_ = (tmp1730_)/tmp1196_; double tmp1732_ = (tmp1731_)*mLocCoeffV_B_3; double tmp1733_ = tmp1727_+tmp1732_; double tmp1734_ = tmp1289_*(tmp477_); double tmp1735_ = (tmp530_)*tmp1688_; double tmp1736_ = tmp1734_-tmp1735_; double tmp1737_ = (tmp1736_)/tmp1200_; double tmp1738_ = (tmp1737_)*mLocCoeffU_B_4; double tmp1739_ = tmp1694_*(tmp477_); double tmp1740_ = (tmp538_)*tmp1688_; double tmp1741_ = tmp1739_-tmp1740_; double tmp1742_ = (tmp1741_)/tmp1200_; double tmp1743_ = (tmp1742_)*mLocCoeffV_B_4; double tmp1744_ = tmp1738_+tmp1743_; double tmp1745_ = tmp1700_+tmp1711_; double tmp1746_ = tmp1745_+tmp1722_; double tmp1747_ = tmp1746_+tmp1733_; double tmp1748_ = tmp1747_+tmp1744_; double tmp1749_ = (tmp1748_)*5; double tmp1750_ = (tmp1749_)/tmp681_; double tmp1751_ = tmp547_*tmp13_; double tmp1752_ = -(tmp4_); double tmp1753_ = tmp1751_*tmp17_; double tmp1754_ = tmp1751_*tmp23_; double tmp1755_ = tmp1754_*mLocP3X_A_0; double tmp1756_ = tmp1752_*tmp19_; double tmp1757_ = tmp1753_*tmp15_; double tmp1758_ = tmp1756_+tmp1757_; double tmp1759_ = (tmp1758_)*mLocP3Y_A_0; double tmp1760_ = tmp1755_+tmp1759_; double tmp1761_ = tmp1752_*tmp24_; double tmp1762_ = tmp1753_*tmp19_; double tmp1763_ = tmp1761_+tmp1762_; double tmp1764_ = (tmp1763_)*mLocP3Z_A_0; double tmp1765_ = tmp1760_+tmp1764_; double tmp1766_ = tmp1751_*tmp19_; double tmp1767_ = tmp1766_+tmp33_; double tmp1768_ = (tmp1767_)*mLocP3Y_A_0; double tmp1769_ = tmp31_+tmp1768_; double tmp1770_ = tmp1751_*tmp24_; double tmp1771_ = tmp1770_+tmp38_; double tmp1772_ = (tmp1771_)*mLocP3Z_A_0; double tmp1773_ = tmp1769_+tmp1772_; double tmp1774_ = (tmp1765_)*(tmp91_); double tmp1775_ = (tmp1773_)*(tmp95_); double tmp1776_ = tmp1774_+tmp1775_; double tmp1777_ = (tmp1765_)*tmp101_; double tmp1778_ = (tmp1773_)*tmp103_; double tmp1779_ = tmp1777_+tmp1778_; double tmp1780_ = (tmp1779_)*(tmp100_); double tmp1781_ = (tmp107_)*(tmp1776_); double tmp1782_ = tmp1780_-tmp1781_; double tmp1783_ = (tmp1782_)/tmp559_; double tmp1784_ = (tmp1783_)*mLocCoeffU_A_0; double tmp1785_ = (tmp1765_)*(tmp113_); double tmp1786_ = (tmp1773_)*(tmp117_); double tmp1787_ = tmp1785_+tmp1786_; double tmp1788_ = (tmp1787_)*(tmp100_); double tmp1789_ = (tmp122_)*(tmp1776_); double tmp1790_ = tmp1788_-tmp1789_; double tmp1791_ = (tmp1790_)/tmp559_; double tmp1792_ = (tmp1791_)*mLocCoeffV_A_0; double tmp1793_ = tmp1784_+tmp1792_; double tmp1794_ = tmp1754_*mLocP3X_A_1; double tmp1795_ = (tmp1758_)*mLocP3Y_A_1; double tmp1796_ = tmp1794_+tmp1795_; double tmp1797_ = (tmp1763_)*mLocP3Z_A_1; double tmp1798_ = tmp1796_+tmp1797_; double tmp1799_ = (tmp1767_)*mLocP3Y_A_1; double tmp1800_ = tmp126_+tmp1799_; double tmp1801_ = (tmp1771_)*mLocP3Z_A_1; double tmp1802_ = tmp1800_+tmp1801_; double tmp1803_ = (tmp1798_)*(tmp91_); double tmp1804_ = (tmp1802_)*(tmp95_); double tmp1805_ = tmp1803_+tmp1804_; double tmp1806_ = tmp1754_*mLocP3X_A_2; double tmp1807_ = (tmp1758_)*mLocP3Y_A_2; double tmp1808_ = tmp1806_+tmp1807_; double tmp1809_ = (tmp1763_)*mLocP3Z_A_2; double tmp1810_ = tmp1808_+tmp1809_; double tmp1811_ = (tmp1767_)*mLocP3Y_A_2; double tmp1812_ = tmp152_+tmp1811_; double tmp1813_ = (tmp1771_)*mLocP3Z_A_2; double tmp1814_ = tmp1812_+tmp1813_; double tmp1815_ = (tmp1810_)*(tmp91_); double tmp1816_ = (tmp1814_)*(tmp95_); double tmp1817_ = tmp1815_+tmp1816_; double tmp1818_ = tmp1754_*mLocP3X_A_3; double tmp1819_ = (tmp1758_)*mLocP3Y_A_3; double tmp1820_ = tmp1818_+tmp1819_; double tmp1821_ = (tmp1763_)*mLocP3Z_A_3; double tmp1822_ = tmp1820_+tmp1821_; double tmp1823_ = (tmp1767_)*mLocP3Y_A_3; double tmp1824_ = tmp178_+tmp1823_; double tmp1825_ = (tmp1771_)*mLocP3Z_A_3; double tmp1826_ = tmp1824_+tmp1825_; double tmp1827_ = (tmp1822_)*(tmp91_); double tmp1828_ = (tmp1826_)*(tmp95_); double tmp1829_ = tmp1827_+tmp1828_; double tmp1830_ = tmp1754_*mLocP3X_A_4; double tmp1831_ = (tmp1758_)*mLocP3Y_A_4; double tmp1832_ = tmp1830_+tmp1831_; double tmp1833_ = (tmp1763_)*mLocP3Z_A_4; double tmp1834_ = tmp1832_+tmp1833_; double tmp1835_ = (tmp1767_)*mLocP3Y_A_4; double tmp1836_ = tmp204_+tmp1835_; double tmp1837_ = (tmp1771_)*mLocP3Z_A_4; double tmp1838_ = tmp1836_+tmp1837_; double tmp1839_ = (tmp1834_)*(tmp91_); double tmp1840_ = (tmp1838_)*(tmp95_); double tmp1841_ = tmp1839_+tmp1840_; double tmp1842_ = (tmp1798_)*tmp101_; double tmp1843_ = (tmp1802_)*tmp103_; double tmp1844_ = tmp1842_+tmp1843_; double tmp1845_ = (tmp1844_)*(tmp151_); double tmp1846_ = (tmp234_)*(tmp1805_); double tmp1847_ = tmp1845_-tmp1846_; double tmp1848_ = (tmp1847_)/tmp586_; double tmp1849_ = (tmp1848_)*mLocCoeffU_A_1; double tmp1850_ = (tmp1798_)*(tmp113_); double tmp1851_ = (tmp1802_)*(tmp117_); double tmp1852_ = tmp1850_+tmp1851_; double tmp1853_ = (tmp1852_)*(tmp151_); double tmp1854_ = (tmp242_)*(tmp1805_); double tmp1855_ = tmp1853_-tmp1854_; double tmp1856_ = (tmp1855_)/tmp586_; double tmp1857_ = (tmp1856_)*mLocCoeffV_A_1; double tmp1858_ = tmp1849_+tmp1857_; double tmp1859_ = (tmp1810_)*tmp101_; double tmp1860_ = (tmp1814_)*tmp103_; double tmp1861_ = tmp1859_+tmp1860_; double tmp1862_ = (tmp1861_)*(tmp177_); double tmp1863_ = (tmp250_)*(tmp1817_); double tmp1864_ = tmp1862_-tmp1863_; double tmp1865_ = (tmp1864_)/tmp590_; double tmp1866_ = (tmp1865_)*mLocCoeffU_A_2; double tmp1867_ = (tmp1810_)*(tmp113_); double tmp1868_ = (tmp1814_)*(tmp117_); double tmp1869_ = tmp1867_+tmp1868_; double tmp1870_ = (tmp1869_)*(tmp177_); double tmp1871_ = (tmp258_)*(tmp1817_); double tmp1872_ = tmp1870_-tmp1871_; double tmp1873_ = (tmp1872_)/tmp590_; double tmp1874_ = (tmp1873_)*mLocCoeffV_A_2; double tmp1875_ = tmp1866_+tmp1874_; double tmp1876_ = (tmp1822_)*tmp101_; double tmp1877_ = (tmp1826_)*tmp103_; double tmp1878_ = tmp1876_+tmp1877_; double tmp1879_ = (tmp1878_)*(tmp203_); double tmp1880_ = (tmp266_)*(tmp1829_); double tmp1881_ = tmp1879_-tmp1880_; double tmp1882_ = (tmp1881_)/tmp594_; double tmp1883_ = (tmp1882_)*mLocCoeffU_A_3; double tmp1884_ = (tmp1822_)*(tmp113_); double tmp1885_ = (tmp1826_)*(tmp117_); double tmp1886_ = tmp1884_+tmp1885_; double tmp1887_ = (tmp1886_)*(tmp203_); double tmp1888_ = (tmp274_)*(tmp1829_); double tmp1889_ = tmp1887_-tmp1888_; double tmp1890_ = (tmp1889_)/tmp594_; double tmp1891_ = (tmp1890_)*mLocCoeffV_A_3; double tmp1892_ = tmp1883_+tmp1891_; double tmp1893_ = (tmp1834_)*tmp101_; double tmp1894_ = (tmp1838_)*tmp103_; double tmp1895_ = tmp1893_+tmp1894_; double tmp1896_ = (tmp1895_)*(tmp229_); double tmp1897_ = (tmp282_)*(tmp1841_); double tmp1898_ = tmp1896_-tmp1897_; double tmp1899_ = (tmp1898_)/tmp598_; double tmp1900_ = (tmp1899_)*mLocCoeffU_A_4; double tmp1901_ = (tmp1834_)*(tmp113_); double tmp1902_ = (tmp1838_)*(tmp117_); double tmp1903_ = tmp1901_+tmp1902_; double tmp1904_ = (tmp1903_)*(tmp229_); double tmp1905_ = (tmp290_)*(tmp1841_); double tmp1906_ = tmp1904_-tmp1905_; double tmp1907_ = (tmp1906_)/tmp598_; double tmp1908_ = (tmp1907_)*mLocCoeffV_A_4; double tmp1909_ = tmp1900_+tmp1908_; double tmp1910_ = tmp1793_+tmp1858_; double tmp1911_ = tmp1910_+tmp1875_; double tmp1912_ = tmp1911_+tmp1892_; double tmp1913_ = tmp1912_+tmp1909_; double tmp1914_ = (tmp1913_)*5; double tmp1915_ = (tmp1914_)/tmp681_; double tmp1916_ = tmp1754_*mLocP3X_B_0; double tmp1917_ = (tmp1758_)*mLocP3Y_B_0; double tmp1918_ = tmp1916_+tmp1917_; double tmp1919_ = (tmp1763_)*mLocP3Z_B_0; double tmp1920_ = tmp1918_+tmp1919_; double tmp1921_ = (tmp1767_)*mLocP3Y_B_0; double tmp1922_ = tmp306_+tmp1921_; double tmp1923_ = (tmp1771_)*mLocP3Z_B_0; double tmp1924_ = tmp1922_+tmp1923_; double tmp1925_ = (tmp1920_)*(tmp339_); double tmp1926_ = (tmp1924_)*(tmp343_); double tmp1927_ = tmp1925_+tmp1926_; double tmp1928_ = (tmp1920_)*tmp349_; double tmp1929_ = (tmp1924_)*tmp351_; double tmp1930_ = tmp1928_+tmp1929_; double tmp1931_ = (tmp1930_)*(tmp348_); double tmp1932_ = (tmp355_)*(tmp1927_); double tmp1933_ = tmp1931_-tmp1932_; double tmp1934_ = (tmp1933_)/tmp1161_; double tmp1935_ = (tmp1934_)*mLocCoeffU_B_0; double tmp1936_ = (tmp1920_)*(tmp361_); double tmp1937_ = (tmp1924_)*(tmp365_); double tmp1938_ = tmp1936_+tmp1937_; double tmp1939_ = (tmp1938_)*(tmp348_); double tmp1940_ = (tmp370_)*(tmp1927_); double tmp1941_ = tmp1939_-tmp1940_; double tmp1942_ = (tmp1941_)/tmp1161_; double tmp1943_ = (tmp1942_)*mLocCoeffV_B_0; double tmp1944_ = tmp1935_+tmp1943_; double tmp1945_ = tmp1754_*mLocP3X_B_1; double tmp1946_ = (tmp1758_)*mLocP3Y_B_1; double tmp1947_ = tmp1945_+tmp1946_; double tmp1948_ = (tmp1763_)*mLocP3Z_B_1; double tmp1949_ = tmp1947_+tmp1948_; double tmp1950_ = (tmp1767_)*mLocP3Y_B_1; double tmp1951_ = tmp374_+tmp1950_; double tmp1952_ = (tmp1771_)*mLocP3Z_B_1; double tmp1953_ = tmp1951_+tmp1952_; double tmp1954_ = (tmp1949_)*(tmp339_); double tmp1955_ = (tmp1953_)*(tmp343_); double tmp1956_ = tmp1954_+tmp1955_; double tmp1957_ = tmp1754_*mLocP3X_B_2; double tmp1958_ = (tmp1758_)*mLocP3Y_B_2; double tmp1959_ = tmp1957_+tmp1958_; double tmp1960_ = (tmp1763_)*mLocP3Z_B_2; double tmp1961_ = tmp1959_+tmp1960_; double tmp1962_ = (tmp1767_)*mLocP3Y_B_2; double tmp1963_ = tmp400_+tmp1962_; double tmp1964_ = (tmp1771_)*mLocP3Z_B_2; double tmp1965_ = tmp1963_+tmp1964_; double tmp1966_ = (tmp1961_)*(tmp339_); double tmp1967_ = (tmp1965_)*(tmp343_); double tmp1968_ = tmp1966_+tmp1967_; double tmp1969_ = tmp1754_*mLocP3X_B_3; double tmp1970_ = (tmp1758_)*mLocP3Y_B_3; double tmp1971_ = tmp1969_+tmp1970_; double tmp1972_ = (tmp1763_)*mLocP3Z_B_3; double tmp1973_ = tmp1971_+tmp1972_; double tmp1974_ = (tmp1767_)*mLocP3Y_B_3; double tmp1975_ = tmp426_+tmp1974_; double tmp1976_ = (tmp1771_)*mLocP3Z_B_3; double tmp1977_ = tmp1975_+tmp1976_; double tmp1978_ = (tmp1973_)*(tmp339_); double tmp1979_ = (tmp1977_)*(tmp343_); double tmp1980_ = tmp1978_+tmp1979_; double tmp1981_ = tmp1754_*mLocP3X_B_4; double tmp1982_ = (tmp1758_)*mLocP3Y_B_4; double tmp1983_ = tmp1981_+tmp1982_; double tmp1984_ = (tmp1763_)*mLocP3Z_B_4; double tmp1985_ = tmp1983_+tmp1984_; double tmp1986_ = (tmp1767_)*mLocP3Y_B_4; double tmp1987_ = tmp452_+tmp1986_; double tmp1988_ = (tmp1771_)*mLocP3Z_B_4; double tmp1989_ = tmp1987_+tmp1988_; double tmp1990_ = (tmp1985_)*(tmp339_); double tmp1991_ = (tmp1989_)*(tmp343_); double tmp1992_ = tmp1990_+tmp1991_; double tmp1993_ = (tmp1949_)*tmp349_; double tmp1994_ = (tmp1953_)*tmp351_; double tmp1995_ = tmp1993_+tmp1994_; double tmp1996_ = (tmp1995_)*(tmp399_); double tmp1997_ = (tmp482_)*(tmp1956_); double tmp1998_ = tmp1996_-tmp1997_; double tmp1999_ = (tmp1998_)/tmp1188_; double tmp2000_ = (tmp1999_)*mLocCoeffU_B_1; double tmp2001_ = (tmp1949_)*(tmp361_); double tmp2002_ = (tmp1953_)*(tmp365_); double tmp2003_ = tmp2001_+tmp2002_; double tmp2004_ = (tmp2003_)*(tmp399_); double tmp2005_ = (tmp490_)*(tmp1956_); double tmp2006_ = tmp2004_-tmp2005_; double tmp2007_ = (tmp2006_)/tmp1188_; double tmp2008_ = (tmp2007_)*mLocCoeffV_B_1; double tmp2009_ = tmp2000_+tmp2008_; double tmp2010_ = (tmp1961_)*tmp349_; double tmp2011_ = (tmp1965_)*tmp351_; double tmp2012_ = tmp2010_+tmp2011_; double tmp2013_ = (tmp2012_)*(tmp425_); double tmp2014_ = (tmp498_)*(tmp1968_); double tmp2015_ = tmp2013_-tmp2014_; double tmp2016_ = (tmp2015_)/tmp1192_; double tmp2017_ = (tmp2016_)*mLocCoeffU_B_2; double tmp2018_ = (tmp1961_)*(tmp361_); double tmp2019_ = (tmp1965_)*(tmp365_); double tmp2020_ = tmp2018_+tmp2019_; double tmp2021_ = (tmp2020_)*(tmp425_); double tmp2022_ = (tmp506_)*(tmp1968_); double tmp2023_ = tmp2021_-tmp2022_; double tmp2024_ = (tmp2023_)/tmp1192_; double tmp2025_ = (tmp2024_)*mLocCoeffV_B_2; double tmp2026_ = tmp2017_+tmp2025_; double tmp2027_ = (tmp1973_)*tmp349_; double tmp2028_ = (tmp1977_)*tmp351_; double tmp2029_ = tmp2027_+tmp2028_; double tmp2030_ = (tmp2029_)*(tmp451_); double tmp2031_ = (tmp514_)*(tmp1980_); double tmp2032_ = tmp2030_-tmp2031_; double tmp2033_ = (tmp2032_)/tmp1196_; double tmp2034_ = (tmp2033_)*mLocCoeffU_B_3; double tmp2035_ = (tmp1973_)*(tmp361_); double tmp2036_ = (tmp1977_)*(tmp365_); double tmp2037_ = tmp2035_+tmp2036_; double tmp2038_ = (tmp2037_)*(tmp451_); double tmp2039_ = (tmp522_)*(tmp1980_); double tmp2040_ = tmp2038_-tmp2039_; double tmp2041_ = (tmp2040_)/tmp1196_; double tmp2042_ = (tmp2041_)*mLocCoeffV_B_3; double tmp2043_ = tmp2034_+tmp2042_; double tmp2044_ = (tmp1985_)*tmp349_; double tmp2045_ = (tmp1989_)*tmp351_; double tmp2046_ = tmp2044_+tmp2045_; double tmp2047_ = (tmp2046_)*(tmp477_); double tmp2048_ = (tmp530_)*(tmp1992_); double tmp2049_ = tmp2047_-tmp2048_; double tmp2050_ = (tmp2049_)/tmp1200_; double tmp2051_ = (tmp2050_)*mLocCoeffU_B_4; double tmp2052_ = (tmp1985_)*(tmp361_); double tmp2053_ = (tmp1989_)*(tmp365_); double tmp2054_ = tmp2052_+tmp2053_; double tmp2055_ = (tmp2054_)*(tmp477_); double tmp2056_ = (tmp538_)*(tmp1992_); double tmp2057_ = tmp2055_-tmp2056_; double tmp2058_ = (tmp2057_)/tmp1200_; double tmp2059_ = (tmp2058_)*mLocCoeffV_B_4; double tmp2060_ = tmp2051_+tmp2059_; double tmp2061_ = tmp1944_+tmp2009_; double tmp2062_ = tmp2061_+tmp2026_; double tmp2063_ = tmp2062_+tmp2043_; double tmp2064_ = tmp2063_+tmp2060_; double tmp2065_ = (tmp2064_)*5; double tmp2066_ = (tmp2065_)/tmp681_; double tmp2067_ = -(mLocTimeRot); double tmp2068_ = tmp2067_*tmp13_; double tmp2069_ = mLocTimeRot*tmp4_; double tmp2070_ = -(tmp2069_); double tmp2071_ = tmp2068_*tmp17_; double tmp2072_ = tmp2069_*tmp17_; double tmp2073_ = tmp2068_*tmp23_; double tmp2074_ = tmp2073_*mLocP3X_A_0; double tmp2075_ = tmp2070_*tmp19_; double tmp2076_ = tmp2071_*tmp15_; double tmp2077_ = tmp2075_+tmp2076_; double tmp2078_ = (tmp2077_)*mLocP3Y_A_0; double tmp2079_ = tmp2074_+tmp2078_; double tmp2080_ = tmp2070_*tmp24_; double tmp2081_ = tmp2071_*tmp19_; double tmp2082_ = tmp2080_+tmp2081_; double tmp2083_ = (tmp2082_)*mLocP3Z_A_0; double tmp2084_ = tmp2079_+tmp2083_; double tmp2085_ = tmp2069_*tmp23_; double tmp2086_ = tmp2085_*mLocP3X_A_0; double tmp2087_ = tmp2068_*tmp19_; double tmp2088_ = tmp2072_*tmp15_; double tmp2089_ = tmp2087_+tmp2088_; double tmp2090_ = (tmp2089_)*mLocP3Y_A_0; double tmp2091_ = tmp2086_+tmp2090_; double tmp2092_ = tmp2068_*tmp24_; double tmp2093_ = tmp2072_*tmp19_; double tmp2094_ = tmp2092_+tmp2093_; double tmp2095_ = (tmp2094_)*mLocP3Z_A_0; double tmp2096_ = tmp2091_+tmp2095_; double tmp2097_ = (tmp2084_)*(tmp91_); double tmp2098_ = (tmp2096_)*(tmp95_); double tmp2099_ = tmp2097_+tmp2098_; double tmp2100_ = (tmp2084_)*tmp101_; double tmp2101_ = (tmp2096_)*tmp103_; double tmp2102_ = tmp2100_+tmp2101_; double tmp2103_ = (tmp2102_)*(tmp100_); double tmp2104_ = (tmp107_)*(tmp2099_); double tmp2105_ = tmp2103_-tmp2104_; double tmp2106_ = (tmp2105_)/tmp559_; double tmp2107_ = (tmp2106_)*mLocCoeffU_A_0; double tmp2108_ = (tmp2084_)*(tmp113_); double tmp2109_ = (tmp2096_)*(tmp117_); double tmp2110_ = tmp2108_+tmp2109_; double tmp2111_ = (tmp2110_)*(tmp100_); double tmp2112_ = (tmp122_)*(tmp2099_); double tmp2113_ = tmp2111_-tmp2112_; double tmp2114_ = (tmp2113_)/tmp559_; double tmp2115_ = (tmp2114_)*mLocCoeffV_A_0; double tmp2116_ = tmp2107_+tmp2115_; double tmp2117_ = tmp2073_*mLocP3X_A_1; double tmp2118_ = (tmp2077_)*mLocP3Y_A_1; double tmp2119_ = tmp2117_+tmp2118_; double tmp2120_ = (tmp2082_)*mLocP3Z_A_1; double tmp2121_ = tmp2119_+tmp2120_; double tmp2122_ = tmp2085_*mLocP3X_A_1; double tmp2123_ = (tmp2089_)*mLocP3Y_A_1; double tmp2124_ = tmp2122_+tmp2123_; double tmp2125_ = (tmp2094_)*mLocP3Z_A_1; double tmp2126_ = tmp2124_+tmp2125_; double tmp2127_ = (tmp2121_)*(tmp91_); double tmp2128_ = (tmp2126_)*(tmp95_); double tmp2129_ = tmp2127_+tmp2128_; double tmp2130_ = tmp2073_*mLocP3X_A_2; double tmp2131_ = (tmp2077_)*mLocP3Y_A_2; double tmp2132_ = tmp2130_+tmp2131_; double tmp2133_ = (tmp2082_)*mLocP3Z_A_2; double tmp2134_ = tmp2132_+tmp2133_; double tmp2135_ = tmp2085_*mLocP3X_A_2; double tmp2136_ = (tmp2089_)*mLocP3Y_A_2; double tmp2137_ = tmp2135_+tmp2136_; double tmp2138_ = (tmp2094_)*mLocP3Z_A_2; double tmp2139_ = tmp2137_+tmp2138_; double tmp2140_ = (tmp2134_)*(tmp91_); double tmp2141_ = (tmp2139_)*(tmp95_); double tmp2142_ = tmp2140_+tmp2141_; double tmp2143_ = tmp2073_*mLocP3X_A_3; double tmp2144_ = (tmp2077_)*mLocP3Y_A_3; double tmp2145_ = tmp2143_+tmp2144_; double tmp2146_ = (tmp2082_)*mLocP3Z_A_3; double tmp2147_ = tmp2145_+tmp2146_; double tmp2148_ = tmp2085_*mLocP3X_A_3; double tmp2149_ = (tmp2089_)*mLocP3Y_A_3; double tmp2150_ = tmp2148_+tmp2149_; double tmp2151_ = (tmp2094_)*mLocP3Z_A_3; double tmp2152_ = tmp2150_+tmp2151_; double tmp2153_ = (tmp2147_)*(tmp91_); double tmp2154_ = (tmp2152_)*(tmp95_); double tmp2155_ = tmp2153_+tmp2154_; double tmp2156_ = tmp2073_*mLocP3X_A_4; double tmp2157_ = (tmp2077_)*mLocP3Y_A_4; double tmp2158_ = tmp2156_+tmp2157_; double tmp2159_ = (tmp2082_)*mLocP3Z_A_4; double tmp2160_ = tmp2158_+tmp2159_; double tmp2161_ = tmp2085_*mLocP3X_A_4; double tmp2162_ = (tmp2089_)*mLocP3Y_A_4; double tmp2163_ = tmp2161_+tmp2162_; double tmp2164_ = (tmp2094_)*mLocP3Z_A_4; double tmp2165_ = tmp2163_+tmp2164_; double tmp2166_ = (tmp2160_)*(tmp91_); double tmp2167_ = (tmp2165_)*(tmp95_); double tmp2168_ = tmp2166_+tmp2167_; double tmp2169_ = (tmp2121_)*tmp101_; double tmp2170_ = (tmp2126_)*tmp103_; double tmp2171_ = tmp2169_+tmp2170_; double tmp2172_ = (tmp2171_)*(tmp151_); double tmp2173_ = (tmp234_)*(tmp2129_); double tmp2174_ = tmp2172_-tmp2173_; double tmp2175_ = (tmp2174_)/tmp586_; double tmp2176_ = (tmp2175_)*mLocCoeffU_A_1; double tmp2177_ = (tmp2121_)*(tmp113_); double tmp2178_ = (tmp2126_)*(tmp117_); double tmp2179_ = tmp2177_+tmp2178_; double tmp2180_ = (tmp2179_)*(tmp151_); double tmp2181_ = (tmp242_)*(tmp2129_); double tmp2182_ = tmp2180_-tmp2181_; double tmp2183_ = (tmp2182_)/tmp586_; double tmp2184_ = (tmp2183_)*mLocCoeffV_A_1; double tmp2185_ = tmp2176_+tmp2184_; double tmp2186_ = (tmp2134_)*tmp101_; double tmp2187_ = (tmp2139_)*tmp103_; double tmp2188_ = tmp2186_+tmp2187_; double tmp2189_ = (tmp2188_)*(tmp177_); double tmp2190_ = (tmp250_)*(tmp2142_); double tmp2191_ = tmp2189_-tmp2190_; double tmp2192_ = (tmp2191_)/tmp590_; double tmp2193_ = (tmp2192_)*mLocCoeffU_A_2; double tmp2194_ = (tmp2134_)*(tmp113_); double tmp2195_ = (tmp2139_)*(tmp117_); double tmp2196_ = tmp2194_+tmp2195_; double tmp2197_ = (tmp2196_)*(tmp177_); double tmp2198_ = (tmp258_)*(tmp2142_); double tmp2199_ = tmp2197_-tmp2198_; double tmp2200_ = (tmp2199_)/tmp590_; double tmp2201_ = (tmp2200_)*mLocCoeffV_A_2; double tmp2202_ = tmp2193_+tmp2201_; double tmp2203_ = (tmp2147_)*tmp101_; double tmp2204_ = (tmp2152_)*tmp103_; double tmp2205_ = tmp2203_+tmp2204_; double tmp2206_ = (tmp2205_)*(tmp203_); double tmp2207_ = (tmp266_)*(tmp2155_); double tmp2208_ = tmp2206_-tmp2207_; double tmp2209_ = (tmp2208_)/tmp594_; double tmp2210_ = (tmp2209_)*mLocCoeffU_A_3; double tmp2211_ = (tmp2147_)*(tmp113_); double tmp2212_ = (tmp2152_)*(tmp117_); double tmp2213_ = tmp2211_+tmp2212_; double tmp2214_ = (tmp2213_)*(tmp203_); double tmp2215_ = (tmp274_)*(tmp2155_); double tmp2216_ = tmp2214_-tmp2215_; double tmp2217_ = (tmp2216_)/tmp594_; double tmp2218_ = (tmp2217_)*mLocCoeffV_A_3; double tmp2219_ = tmp2210_+tmp2218_; double tmp2220_ = (tmp2160_)*tmp101_; double tmp2221_ = (tmp2165_)*tmp103_; double tmp2222_ = tmp2220_+tmp2221_; double tmp2223_ = (tmp2222_)*(tmp229_); double tmp2224_ = (tmp282_)*(tmp2168_); double tmp2225_ = tmp2223_-tmp2224_; double tmp2226_ = (tmp2225_)/tmp598_; double tmp2227_ = (tmp2226_)*mLocCoeffU_A_4; double tmp2228_ = (tmp2160_)*(tmp113_); double tmp2229_ = (tmp2165_)*(tmp117_); double tmp2230_ = tmp2228_+tmp2229_; double tmp2231_ = (tmp2230_)*(tmp229_); double tmp2232_ = (tmp290_)*(tmp2168_); double tmp2233_ = tmp2231_-tmp2232_; double tmp2234_ = (tmp2233_)/tmp598_; double tmp2235_ = (tmp2234_)*mLocCoeffV_A_4; double tmp2236_ = tmp2227_+tmp2235_; double tmp2237_ = tmp2116_+tmp2185_; double tmp2238_ = tmp2237_+tmp2202_; double tmp2239_ = tmp2238_+tmp2219_; double tmp2240_ = tmp2239_+tmp2236_; double tmp2241_ = (tmp2240_)*5; double tmp2242_ = (tmp2241_)/tmp681_; double tmp2243_ = tmp2073_*mLocP3X_B_0; double tmp2244_ = (tmp2077_)*mLocP3Y_B_0; double tmp2245_ = tmp2243_+tmp2244_; double tmp2246_ = (tmp2082_)*mLocP3Z_B_0; double tmp2247_ = tmp2245_+tmp2246_; double tmp2248_ = tmp2085_*mLocP3X_B_0; double tmp2249_ = (tmp2089_)*mLocP3Y_B_0; double tmp2250_ = tmp2248_+tmp2249_; double tmp2251_ = (tmp2094_)*mLocP3Z_B_0; double tmp2252_ = tmp2250_+tmp2251_; double tmp2253_ = (tmp2247_)*(tmp339_); double tmp2254_ = (tmp2252_)*(tmp343_); double tmp2255_ = tmp2253_+tmp2254_; double tmp2256_ = (tmp2247_)*tmp349_; double tmp2257_ = (tmp2252_)*tmp351_; double tmp2258_ = tmp2256_+tmp2257_; double tmp2259_ = (tmp2258_)*(tmp348_); double tmp2260_ = (tmp355_)*(tmp2255_); double tmp2261_ = tmp2259_-tmp2260_; double tmp2262_ = (tmp2261_)/tmp1161_; double tmp2263_ = (tmp2262_)*mLocCoeffU_B_0; double tmp2264_ = (tmp2247_)*(tmp361_); double tmp2265_ = (tmp2252_)*(tmp365_); double tmp2266_ = tmp2264_+tmp2265_; double tmp2267_ = (tmp2266_)*(tmp348_); double tmp2268_ = (tmp370_)*(tmp2255_); double tmp2269_ = tmp2267_-tmp2268_; double tmp2270_ = (tmp2269_)/tmp1161_; double tmp2271_ = (tmp2270_)*mLocCoeffV_B_0; double tmp2272_ = tmp2263_+tmp2271_; double tmp2273_ = tmp2073_*mLocP3X_B_1; double tmp2274_ = (tmp2077_)*mLocP3Y_B_1; double tmp2275_ = tmp2273_+tmp2274_; double tmp2276_ = (tmp2082_)*mLocP3Z_B_1; double tmp2277_ = tmp2275_+tmp2276_; double tmp2278_ = tmp2085_*mLocP3X_B_1; double tmp2279_ = (tmp2089_)*mLocP3Y_B_1; double tmp2280_ = tmp2278_+tmp2279_; double tmp2281_ = (tmp2094_)*mLocP3Z_B_1; double tmp2282_ = tmp2280_+tmp2281_; double tmp2283_ = (tmp2277_)*(tmp339_); double tmp2284_ = (tmp2282_)*(tmp343_); double tmp2285_ = tmp2283_+tmp2284_; double tmp2286_ = tmp2073_*mLocP3X_B_2; double tmp2287_ = (tmp2077_)*mLocP3Y_B_2; double tmp2288_ = tmp2286_+tmp2287_; double tmp2289_ = (tmp2082_)*mLocP3Z_B_2; double tmp2290_ = tmp2288_+tmp2289_; double tmp2291_ = tmp2085_*mLocP3X_B_2; double tmp2292_ = (tmp2089_)*mLocP3Y_B_2; double tmp2293_ = tmp2291_+tmp2292_; double tmp2294_ = (tmp2094_)*mLocP3Z_B_2; double tmp2295_ = tmp2293_+tmp2294_; double tmp2296_ = (tmp2290_)*(tmp339_); double tmp2297_ = (tmp2295_)*(tmp343_); double tmp2298_ = tmp2296_+tmp2297_; double tmp2299_ = tmp2073_*mLocP3X_B_3; double tmp2300_ = (tmp2077_)*mLocP3Y_B_3; double tmp2301_ = tmp2299_+tmp2300_; double tmp2302_ = (tmp2082_)*mLocP3Z_B_3; double tmp2303_ = tmp2301_+tmp2302_; double tmp2304_ = tmp2085_*mLocP3X_B_3; double tmp2305_ = (tmp2089_)*mLocP3Y_B_3; double tmp2306_ = tmp2304_+tmp2305_; double tmp2307_ = (tmp2094_)*mLocP3Z_B_3; double tmp2308_ = tmp2306_+tmp2307_; double tmp2309_ = (tmp2303_)*(tmp339_); double tmp2310_ = (tmp2308_)*(tmp343_); double tmp2311_ = tmp2309_+tmp2310_; double tmp2312_ = tmp2073_*mLocP3X_B_4; double tmp2313_ = (tmp2077_)*mLocP3Y_B_4; double tmp2314_ = tmp2312_+tmp2313_; double tmp2315_ = (tmp2082_)*mLocP3Z_B_4; double tmp2316_ = tmp2314_+tmp2315_; double tmp2317_ = tmp2085_*mLocP3X_B_4; double tmp2318_ = (tmp2089_)*mLocP3Y_B_4; double tmp2319_ = tmp2317_+tmp2318_; double tmp2320_ = (tmp2094_)*mLocP3Z_B_4; double tmp2321_ = tmp2319_+tmp2320_; double tmp2322_ = (tmp2316_)*(tmp339_); double tmp2323_ = (tmp2321_)*(tmp343_); double tmp2324_ = tmp2322_+tmp2323_; double tmp2325_ = (tmp2277_)*tmp349_; double tmp2326_ = (tmp2282_)*tmp351_; double tmp2327_ = tmp2325_+tmp2326_; double tmp2328_ = (tmp2327_)*(tmp399_); double tmp2329_ = (tmp482_)*(tmp2285_); double tmp2330_ = tmp2328_-tmp2329_; double tmp2331_ = (tmp2330_)/tmp1188_; double tmp2332_ = (tmp2331_)*mLocCoeffU_B_1; double tmp2333_ = (tmp2277_)*(tmp361_); double tmp2334_ = (tmp2282_)*(tmp365_); double tmp2335_ = tmp2333_+tmp2334_; double tmp2336_ = (tmp2335_)*(tmp399_); double tmp2337_ = (tmp490_)*(tmp2285_); double tmp2338_ = tmp2336_-tmp2337_; double tmp2339_ = (tmp2338_)/tmp1188_; double tmp2340_ = (tmp2339_)*mLocCoeffV_B_1; double tmp2341_ = tmp2332_+tmp2340_; double tmp2342_ = (tmp2290_)*tmp349_; double tmp2343_ = (tmp2295_)*tmp351_; double tmp2344_ = tmp2342_+tmp2343_; double tmp2345_ = (tmp2344_)*(tmp425_); double tmp2346_ = (tmp498_)*(tmp2298_); double tmp2347_ = tmp2345_-tmp2346_; double tmp2348_ = (tmp2347_)/tmp1192_; double tmp2349_ = (tmp2348_)*mLocCoeffU_B_2; double tmp2350_ = (tmp2290_)*(tmp361_); double tmp2351_ = (tmp2295_)*(tmp365_); double tmp2352_ = tmp2350_+tmp2351_; double tmp2353_ = (tmp2352_)*(tmp425_); double tmp2354_ = (tmp506_)*(tmp2298_); double tmp2355_ = tmp2353_-tmp2354_; double tmp2356_ = (tmp2355_)/tmp1192_; double tmp2357_ = (tmp2356_)*mLocCoeffV_B_2; double tmp2358_ = tmp2349_+tmp2357_; double tmp2359_ = (tmp2303_)*tmp349_; double tmp2360_ = (tmp2308_)*tmp351_; double tmp2361_ = tmp2359_+tmp2360_; double tmp2362_ = (tmp2361_)*(tmp451_); double tmp2363_ = (tmp514_)*(tmp2311_); double tmp2364_ = tmp2362_-tmp2363_; double tmp2365_ = (tmp2364_)/tmp1196_; double tmp2366_ = (tmp2365_)*mLocCoeffU_B_3; double tmp2367_ = (tmp2303_)*(tmp361_); double tmp2368_ = (tmp2308_)*(tmp365_); double tmp2369_ = tmp2367_+tmp2368_; double tmp2370_ = (tmp2369_)*(tmp451_); double tmp2371_ = (tmp522_)*(tmp2311_); double tmp2372_ = tmp2370_-tmp2371_; double tmp2373_ = (tmp2372_)/tmp1196_; double tmp2374_ = (tmp2373_)*mLocCoeffV_B_3; double tmp2375_ = tmp2366_+tmp2374_; double tmp2376_ = (tmp2316_)*tmp349_; double tmp2377_ = (tmp2321_)*tmp351_; double tmp2378_ = tmp2376_+tmp2377_; double tmp2379_ = (tmp2378_)*(tmp477_); double tmp2380_ = (tmp530_)*(tmp2324_); double tmp2381_ = tmp2379_-tmp2380_; double tmp2382_ = (tmp2381_)/tmp1200_; double tmp2383_ = (tmp2382_)*mLocCoeffU_B_4; double tmp2384_ = (tmp2316_)*(tmp361_); double tmp2385_ = (tmp2321_)*(tmp365_); double tmp2386_ = tmp2384_+tmp2385_; double tmp2387_ = (tmp2386_)*(tmp477_); double tmp2388_ = (tmp538_)*(tmp2324_); double tmp2389_ = tmp2387_-tmp2388_; double tmp2390_ = (tmp2389_)/tmp1200_; double tmp2391_ = (tmp2390_)*mLocCoeffV_B_4; double tmp2392_ = tmp2383_+tmp2391_; double tmp2393_ = tmp2272_+tmp2341_; double tmp2394_ = tmp2393_+tmp2358_; double tmp2395_ = tmp2394_+tmp2375_; double tmp2396_ = tmp2395_+tmp2392_; double tmp2397_ = (tmp2396_)*5; double tmp2398_ = (tmp2397_)/tmp681_; double tmp2399_ = -(tmp23_); double tmp2400_ = tmp2399_*tmp4_; double tmp2401_ = tmp547_*tmp16_; double tmp2402_ = tmp2399_*tmp13_; double tmp2403_ = tmp2401_*tmp4_; double tmp2404_ = tmp2403_*mLocP3X_A_0; double tmp2405_ = tmp2400_*tmp15_; double tmp2406_ = tmp2405_*mLocP3Y_A_0; double tmp2407_ = tmp2404_+tmp2406_; double tmp2408_ = tmp2400_*tmp19_; double tmp2409_ = tmp2408_*mLocP3Z_A_0; double tmp2410_ = tmp2407_+tmp2409_; double tmp2411_ = tmp2401_*tmp13_; double tmp2412_ = tmp2411_*mLocP3X_A_0; double tmp2413_ = tmp2402_*tmp15_; double tmp2414_ = tmp2413_*mLocP3Y_A_0; double tmp2415_ = tmp2412_+tmp2414_; double tmp2416_ = tmp2402_*tmp19_; double tmp2417_ = tmp2416_*mLocP3Z_A_0; double tmp2418_ = tmp2415_+tmp2417_; double tmp2419_ = tmp23_*mLocP3X_A_0; double tmp2420_ = tmp2401_*tmp15_; double tmp2421_ = tmp2420_*mLocP3Y_A_0; double tmp2422_ = tmp2419_+tmp2421_; double tmp2423_ = tmp2401_*tmp19_; double tmp2424_ = tmp2423_*mLocP3Z_A_0; double tmp2425_ = tmp2422_+tmp2424_; double tmp2426_ = (tmp2410_)*(tmp91_); double tmp2427_ = (tmp2418_)*(tmp95_); double tmp2428_ = tmp2426_+tmp2427_; double tmp2429_ = (tmp2425_)*tmp98_; double tmp2430_ = tmp2428_+tmp2429_; double tmp2431_ = (tmp2410_)*tmp101_; double tmp2432_ = (tmp2418_)*tmp103_; double tmp2433_ = tmp2431_+tmp2432_; double tmp2434_ = (tmp2425_)*tmp28_; double tmp2435_ = tmp2433_+tmp2434_; double tmp2436_ = (tmp2435_)*(tmp100_); double tmp2437_ = (tmp107_)*(tmp2430_); double tmp2438_ = tmp2436_-tmp2437_; double tmp2439_ = (tmp2438_)/tmp559_; double tmp2440_ = (tmp2439_)*mLocCoeffU_A_0; double tmp2441_ = (tmp2410_)*(tmp113_); double tmp2442_ = (tmp2418_)*(tmp117_); double tmp2443_ = tmp2441_+tmp2442_; double tmp2444_ = (tmp2425_)*tmp120_; double tmp2445_ = tmp2443_+tmp2444_; double tmp2446_ = (tmp2445_)*(tmp100_); double tmp2447_ = (tmp122_)*(tmp2430_); double tmp2448_ = tmp2446_-tmp2447_; double tmp2449_ = (tmp2448_)/tmp559_; double tmp2450_ = (tmp2449_)*mLocCoeffV_A_0; double tmp2451_ = tmp2440_+tmp2450_; double tmp2452_ = tmp2403_*mLocP3X_A_1; double tmp2453_ = tmp2405_*mLocP3Y_A_1; double tmp2454_ = tmp2452_+tmp2453_; double tmp2455_ = tmp2408_*mLocP3Z_A_1; double tmp2456_ = tmp2454_+tmp2455_; double tmp2457_ = tmp2411_*mLocP3X_A_1; double tmp2458_ = tmp2413_*mLocP3Y_A_1; double tmp2459_ = tmp2457_+tmp2458_; double tmp2460_ = tmp2416_*mLocP3Z_A_1; double tmp2461_ = tmp2459_+tmp2460_; double tmp2462_ = tmp23_*mLocP3X_A_1; double tmp2463_ = tmp2420_*mLocP3Y_A_1; double tmp2464_ = tmp2462_+tmp2463_; double tmp2465_ = tmp2423_*mLocP3Z_A_1; double tmp2466_ = tmp2464_+tmp2465_; double tmp2467_ = (tmp2456_)*(tmp91_); double tmp2468_ = (tmp2461_)*(tmp95_); double tmp2469_ = tmp2467_+tmp2468_; double tmp2470_ = (tmp2466_)*tmp98_; double tmp2471_ = tmp2469_+tmp2470_; double tmp2472_ = tmp2403_*mLocP3X_A_2; double tmp2473_ = tmp2405_*mLocP3Y_A_2; double tmp2474_ = tmp2472_+tmp2473_; double tmp2475_ = tmp2408_*mLocP3Z_A_2; double tmp2476_ = tmp2474_+tmp2475_; double tmp2477_ = tmp2411_*mLocP3X_A_2; double tmp2478_ = tmp2413_*mLocP3Y_A_2; double tmp2479_ = tmp2477_+tmp2478_; double tmp2480_ = tmp2416_*mLocP3Z_A_2; double tmp2481_ = tmp2479_+tmp2480_; double tmp2482_ = tmp23_*mLocP3X_A_2; double tmp2483_ = tmp2420_*mLocP3Y_A_2; double tmp2484_ = tmp2482_+tmp2483_; double tmp2485_ = tmp2423_*mLocP3Z_A_2; double tmp2486_ = tmp2484_+tmp2485_; double tmp2487_ = (tmp2476_)*(tmp91_); double tmp2488_ = (tmp2481_)*(tmp95_); double tmp2489_ = tmp2487_+tmp2488_; double tmp2490_ = (tmp2486_)*tmp98_; double tmp2491_ = tmp2489_+tmp2490_; double tmp2492_ = tmp2403_*mLocP3X_A_3; double tmp2493_ = tmp2405_*mLocP3Y_A_3; double tmp2494_ = tmp2492_+tmp2493_; double tmp2495_ = tmp2408_*mLocP3Z_A_3; double tmp2496_ = tmp2494_+tmp2495_; double tmp2497_ = tmp2411_*mLocP3X_A_3; double tmp2498_ = tmp2413_*mLocP3Y_A_3; double tmp2499_ = tmp2497_+tmp2498_; double tmp2500_ = tmp2416_*mLocP3Z_A_3; double tmp2501_ = tmp2499_+tmp2500_; double tmp2502_ = tmp23_*mLocP3X_A_3; double tmp2503_ = tmp2420_*mLocP3Y_A_3; double tmp2504_ = tmp2502_+tmp2503_; double tmp2505_ = tmp2423_*mLocP3Z_A_3; double tmp2506_ = tmp2504_+tmp2505_; double tmp2507_ = (tmp2496_)*(tmp91_); double tmp2508_ = (tmp2501_)*(tmp95_); double tmp2509_ = tmp2507_+tmp2508_; double tmp2510_ = (tmp2506_)*tmp98_; double tmp2511_ = tmp2509_+tmp2510_; double tmp2512_ = tmp2403_*mLocP3X_A_4; double tmp2513_ = tmp2405_*mLocP3Y_A_4; double tmp2514_ = tmp2512_+tmp2513_; double tmp2515_ = tmp2408_*mLocP3Z_A_4; double tmp2516_ = tmp2514_+tmp2515_; double tmp2517_ = tmp2411_*mLocP3X_A_4; double tmp2518_ = tmp2413_*mLocP3Y_A_4; double tmp2519_ = tmp2517_+tmp2518_; double tmp2520_ = tmp2416_*mLocP3Z_A_4; double tmp2521_ = tmp2519_+tmp2520_; double tmp2522_ = tmp23_*mLocP3X_A_4; double tmp2523_ = tmp2420_*mLocP3Y_A_4; double tmp2524_ = tmp2522_+tmp2523_; double tmp2525_ = tmp2423_*mLocP3Z_A_4; double tmp2526_ = tmp2524_+tmp2525_; double tmp2527_ = (tmp2516_)*(tmp91_); double tmp2528_ = (tmp2521_)*(tmp95_); double tmp2529_ = tmp2527_+tmp2528_; double tmp2530_ = (tmp2526_)*tmp98_; double tmp2531_ = tmp2529_+tmp2530_; double tmp2532_ = (tmp2456_)*tmp101_; double tmp2533_ = (tmp2461_)*tmp103_; double tmp2534_ = tmp2532_+tmp2533_; double tmp2535_ = (tmp2466_)*tmp28_; double tmp2536_ = tmp2534_+tmp2535_; double tmp2537_ = (tmp2536_)*(tmp151_); double tmp2538_ = (tmp234_)*(tmp2471_); double tmp2539_ = tmp2537_-tmp2538_; double tmp2540_ = (tmp2539_)/tmp586_; double tmp2541_ = (tmp2540_)*mLocCoeffU_A_1; double tmp2542_ = (tmp2456_)*(tmp113_); double tmp2543_ = (tmp2461_)*(tmp117_); double tmp2544_ = tmp2542_+tmp2543_; double tmp2545_ = (tmp2466_)*tmp120_; double tmp2546_ = tmp2544_+tmp2545_; double tmp2547_ = (tmp2546_)*(tmp151_); double tmp2548_ = (tmp242_)*(tmp2471_); double tmp2549_ = tmp2547_-tmp2548_; double tmp2550_ = (tmp2549_)/tmp586_; double tmp2551_ = (tmp2550_)*mLocCoeffV_A_1; double tmp2552_ = tmp2541_+tmp2551_; double tmp2553_ = (tmp2476_)*tmp101_; double tmp2554_ = (tmp2481_)*tmp103_; double tmp2555_ = tmp2553_+tmp2554_; double tmp2556_ = (tmp2486_)*tmp28_; double tmp2557_ = tmp2555_+tmp2556_; double tmp2558_ = (tmp2557_)*(tmp177_); double tmp2559_ = (tmp250_)*(tmp2491_); double tmp2560_ = tmp2558_-tmp2559_; double tmp2561_ = (tmp2560_)/tmp590_; double tmp2562_ = (tmp2561_)*mLocCoeffU_A_2; double tmp2563_ = (tmp2476_)*(tmp113_); double tmp2564_ = (tmp2481_)*(tmp117_); double tmp2565_ = tmp2563_+tmp2564_; double tmp2566_ = (tmp2486_)*tmp120_; double tmp2567_ = tmp2565_+tmp2566_; double tmp2568_ = (tmp2567_)*(tmp177_); double tmp2569_ = (tmp258_)*(tmp2491_); double tmp2570_ = tmp2568_-tmp2569_; double tmp2571_ = (tmp2570_)/tmp590_; double tmp2572_ = (tmp2571_)*mLocCoeffV_A_2; double tmp2573_ = tmp2562_+tmp2572_; double tmp2574_ = (tmp2496_)*tmp101_; double tmp2575_ = (tmp2501_)*tmp103_; double tmp2576_ = tmp2574_+tmp2575_; double tmp2577_ = (tmp2506_)*tmp28_; double tmp2578_ = tmp2576_+tmp2577_; double tmp2579_ = (tmp2578_)*(tmp203_); double tmp2580_ = (tmp266_)*(tmp2511_); double tmp2581_ = tmp2579_-tmp2580_; double tmp2582_ = (tmp2581_)/tmp594_; double tmp2583_ = (tmp2582_)*mLocCoeffU_A_3; double tmp2584_ = (tmp2496_)*(tmp113_); double tmp2585_ = (tmp2501_)*(tmp117_); double tmp2586_ = tmp2584_+tmp2585_; double tmp2587_ = (tmp2506_)*tmp120_; double tmp2588_ = tmp2586_+tmp2587_; double tmp2589_ = (tmp2588_)*(tmp203_); double tmp2590_ = (tmp274_)*(tmp2511_); double tmp2591_ = tmp2589_-tmp2590_; double tmp2592_ = (tmp2591_)/tmp594_; double tmp2593_ = (tmp2592_)*mLocCoeffV_A_3; double tmp2594_ = tmp2583_+tmp2593_; double tmp2595_ = (tmp2516_)*tmp101_; double tmp2596_ = (tmp2521_)*tmp103_; double tmp2597_ = tmp2595_+tmp2596_; double tmp2598_ = (tmp2526_)*tmp28_; double tmp2599_ = tmp2597_+tmp2598_; double tmp2600_ = (tmp2599_)*(tmp229_); double tmp2601_ = (tmp282_)*(tmp2531_); double tmp2602_ = tmp2600_-tmp2601_; double tmp2603_ = (tmp2602_)/tmp598_; double tmp2604_ = (tmp2603_)*mLocCoeffU_A_4; double tmp2605_ = (tmp2516_)*(tmp113_); double tmp2606_ = (tmp2521_)*(tmp117_); double tmp2607_ = tmp2605_+tmp2606_; double tmp2608_ = (tmp2526_)*tmp120_; double tmp2609_ = tmp2607_+tmp2608_; double tmp2610_ = (tmp2609_)*(tmp229_); double tmp2611_ = (tmp290_)*(tmp2531_); double tmp2612_ = tmp2610_-tmp2611_; double tmp2613_ = (tmp2612_)/tmp598_; double tmp2614_ = (tmp2613_)*mLocCoeffV_A_4; double tmp2615_ = tmp2604_+tmp2614_; double tmp2616_ = tmp2451_+tmp2552_; double tmp2617_ = tmp2616_+tmp2573_; double tmp2618_ = tmp2617_+tmp2594_; double tmp2619_ = tmp2618_+tmp2615_; double tmp2620_ = (tmp2619_)*5; double tmp2621_ = (tmp2620_)/tmp681_; double tmp2622_ = tmp2403_*mLocP3X_B_0; double tmp2623_ = tmp2405_*mLocP3Y_B_0; double tmp2624_ = tmp2622_+tmp2623_; double tmp2625_ = tmp2408_*mLocP3Z_B_0; double tmp2626_ = tmp2624_+tmp2625_; double tmp2627_ = tmp2411_*mLocP3X_B_0; double tmp2628_ = tmp2413_*mLocP3Y_B_0; double tmp2629_ = tmp2627_+tmp2628_; double tmp2630_ = tmp2416_*mLocP3Z_B_0; double tmp2631_ = tmp2629_+tmp2630_; double tmp2632_ = tmp23_*mLocP3X_B_0; double tmp2633_ = tmp2420_*mLocP3Y_B_0; double tmp2634_ = tmp2632_+tmp2633_; double tmp2635_ = tmp2423_*mLocP3Z_B_0; double tmp2636_ = tmp2634_+tmp2635_; double tmp2637_ = (tmp2626_)*(tmp339_); double tmp2638_ = (tmp2631_)*(tmp343_); double tmp2639_ = tmp2637_+tmp2638_; double tmp2640_ = (tmp2636_)*tmp346_; double tmp2641_ = tmp2639_+tmp2640_; double tmp2642_ = (tmp2626_)*tmp349_; double tmp2643_ = (tmp2631_)*tmp351_; double tmp2644_ = tmp2642_+tmp2643_; double tmp2645_ = (tmp2636_)*tmp304_; double tmp2646_ = tmp2644_+tmp2645_; double tmp2647_ = (tmp2646_)*(tmp348_); double tmp2648_ = (tmp355_)*(tmp2641_); double tmp2649_ = tmp2647_-tmp2648_; double tmp2650_ = (tmp2649_)/tmp1161_; double tmp2651_ = (tmp2650_)*mLocCoeffU_B_0; double tmp2652_ = (tmp2626_)*(tmp361_); double tmp2653_ = (tmp2631_)*(tmp365_); double tmp2654_ = tmp2652_+tmp2653_; double tmp2655_ = (tmp2636_)*tmp368_; double tmp2656_ = tmp2654_+tmp2655_; double tmp2657_ = (tmp2656_)*(tmp348_); double tmp2658_ = (tmp370_)*(tmp2641_); double tmp2659_ = tmp2657_-tmp2658_; double tmp2660_ = (tmp2659_)/tmp1161_; double tmp2661_ = (tmp2660_)*mLocCoeffV_B_0; double tmp2662_ = tmp2651_+tmp2661_; double tmp2663_ = tmp2403_*mLocP3X_B_1; double tmp2664_ = tmp2405_*mLocP3Y_B_1; double tmp2665_ = tmp2663_+tmp2664_; double tmp2666_ = tmp2408_*mLocP3Z_B_1; double tmp2667_ = tmp2665_+tmp2666_; double tmp2668_ = tmp2411_*mLocP3X_B_1; double tmp2669_ = tmp2413_*mLocP3Y_B_1; double tmp2670_ = tmp2668_+tmp2669_; double tmp2671_ = tmp2416_*mLocP3Z_B_1; double tmp2672_ = tmp2670_+tmp2671_; double tmp2673_ = tmp23_*mLocP3X_B_1; double tmp2674_ = tmp2420_*mLocP3Y_B_1; double tmp2675_ = tmp2673_+tmp2674_; double tmp2676_ = tmp2423_*mLocP3Z_B_1; double tmp2677_ = tmp2675_+tmp2676_; double tmp2678_ = (tmp2667_)*(tmp339_); double tmp2679_ = (tmp2672_)*(tmp343_); double tmp2680_ = tmp2678_+tmp2679_; double tmp2681_ = (tmp2677_)*tmp346_; double tmp2682_ = tmp2680_+tmp2681_; double tmp2683_ = tmp2403_*mLocP3X_B_2; double tmp2684_ = tmp2405_*mLocP3Y_B_2; double tmp2685_ = tmp2683_+tmp2684_; double tmp2686_ = tmp2408_*mLocP3Z_B_2; double tmp2687_ = tmp2685_+tmp2686_; double tmp2688_ = tmp2411_*mLocP3X_B_2; double tmp2689_ = tmp2413_*mLocP3Y_B_2; double tmp2690_ = tmp2688_+tmp2689_; double tmp2691_ = tmp2416_*mLocP3Z_B_2; double tmp2692_ = tmp2690_+tmp2691_; double tmp2693_ = tmp23_*mLocP3X_B_2; double tmp2694_ = tmp2420_*mLocP3Y_B_2; double tmp2695_ = tmp2693_+tmp2694_; double tmp2696_ = tmp2423_*mLocP3Z_B_2; double tmp2697_ = tmp2695_+tmp2696_; double tmp2698_ = (tmp2687_)*(tmp339_); double tmp2699_ = (tmp2692_)*(tmp343_); double tmp2700_ = tmp2698_+tmp2699_; double tmp2701_ = (tmp2697_)*tmp346_; double tmp2702_ = tmp2700_+tmp2701_; double tmp2703_ = tmp2403_*mLocP3X_B_3; double tmp2704_ = tmp2405_*mLocP3Y_B_3; double tmp2705_ = tmp2703_+tmp2704_; double tmp2706_ = tmp2408_*mLocP3Z_B_3; double tmp2707_ = tmp2705_+tmp2706_; double tmp2708_ = tmp2411_*mLocP3X_B_3; double tmp2709_ = tmp2413_*mLocP3Y_B_3; double tmp2710_ = tmp2708_+tmp2709_; double tmp2711_ = tmp2416_*mLocP3Z_B_3; double tmp2712_ = tmp2710_+tmp2711_; double tmp2713_ = tmp23_*mLocP3X_B_3; double tmp2714_ = tmp2420_*mLocP3Y_B_3; double tmp2715_ = tmp2713_+tmp2714_; double tmp2716_ = tmp2423_*mLocP3Z_B_3; double tmp2717_ = tmp2715_+tmp2716_; double tmp2718_ = (tmp2707_)*(tmp339_); double tmp2719_ = (tmp2712_)*(tmp343_); double tmp2720_ = tmp2718_+tmp2719_; double tmp2721_ = (tmp2717_)*tmp346_; double tmp2722_ = tmp2720_+tmp2721_; double tmp2723_ = tmp2403_*mLocP3X_B_4; double tmp2724_ = tmp2405_*mLocP3Y_B_4; double tmp2725_ = tmp2723_+tmp2724_; double tmp2726_ = tmp2408_*mLocP3Z_B_4; double tmp2727_ = tmp2725_+tmp2726_; double tmp2728_ = tmp2411_*mLocP3X_B_4; double tmp2729_ = tmp2413_*mLocP3Y_B_4; double tmp2730_ = tmp2728_+tmp2729_; double tmp2731_ = tmp2416_*mLocP3Z_B_4; double tmp2732_ = tmp2730_+tmp2731_; double tmp2733_ = tmp23_*mLocP3X_B_4; double tmp2734_ = tmp2420_*mLocP3Y_B_4; double tmp2735_ = tmp2733_+tmp2734_; double tmp2736_ = tmp2423_*mLocP3Z_B_4; double tmp2737_ = tmp2735_+tmp2736_; double tmp2738_ = (tmp2727_)*(tmp339_); double tmp2739_ = (tmp2732_)*(tmp343_); double tmp2740_ = tmp2738_+tmp2739_; double tmp2741_ = (tmp2737_)*tmp346_; double tmp2742_ = tmp2740_+tmp2741_; double tmp2743_ = (tmp2667_)*tmp349_; double tmp2744_ = (tmp2672_)*tmp351_; double tmp2745_ = tmp2743_+tmp2744_; double tmp2746_ = (tmp2677_)*tmp304_; double tmp2747_ = tmp2745_+tmp2746_; double tmp2748_ = (tmp2747_)*(tmp399_); double tmp2749_ = (tmp482_)*(tmp2682_); double tmp2750_ = tmp2748_-tmp2749_; double tmp2751_ = (tmp2750_)/tmp1188_; double tmp2752_ = (tmp2751_)*mLocCoeffU_B_1; double tmp2753_ = (tmp2667_)*(tmp361_); double tmp2754_ = (tmp2672_)*(tmp365_); double tmp2755_ = tmp2753_+tmp2754_; double tmp2756_ = (tmp2677_)*tmp368_; double tmp2757_ = tmp2755_+tmp2756_; double tmp2758_ = (tmp2757_)*(tmp399_); double tmp2759_ = (tmp490_)*(tmp2682_); double tmp2760_ = tmp2758_-tmp2759_; double tmp2761_ = (tmp2760_)/tmp1188_; double tmp2762_ = (tmp2761_)*mLocCoeffV_B_1; double tmp2763_ = tmp2752_+tmp2762_; double tmp2764_ = (tmp2687_)*tmp349_; double tmp2765_ = (tmp2692_)*tmp351_; double tmp2766_ = tmp2764_+tmp2765_; double tmp2767_ = (tmp2697_)*tmp304_; double tmp2768_ = tmp2766_+tmp2767_; double tmp2769_ = (tmp2768_)*(tmp425_); double tmp2770_ = (tmp498_)*(tmp2702_); double tmp2771_ = tmp2769_-tmp2770_; double tmp2772_ = (tmp2771_)/tmp1192_; double tmp2773_ = (tmp2772_)*mLocCoeffU_B_2; double tmp2774_ = (tmp2687_)*(tmp361_); double tmp2775_ = (tmp2692_)*(tmp365_); double tmp2776_ = tmp2774_+tmp2775_; double tmp2777_ = (tmp2697_)*tmp368_; double tmp2778_ = tmp2776_+tmp2777_; double tmp2779_ = (tmp2778_)*(tmp425_); double tmp2780_ = (tmp506_)*(tmp2702_); double tmp2781_ = tmp2779_-tmp2780_; double tmp2782_ = (tmp2781_)/tmp1192_; double tmp2783_ = (tmp2782_)*mLocCoeffV_B_2; double tmp2784_ = tmp2773_+tmp2783_; double tmp2785_ = (tmp2707_)*tmp349_; double tmp2786_ = (tmp2712_)*tmp351_; double tmp2787_ = tmp2785_+tmp2786_; double tmp2788_ = (tmp2717_)*tmp304_; double tmp2789_ = tmp2787_+tmp2788_; double tmp2790_ = (tmp2789_)*(tmp451_); double tmp2791_ = (tmp514_)*(tmp2722_); double tmp2792_ = tmp2790_-tmp2791_; double tmp2793_ = (tmp2792_)/tmp1196_; double tmp2794_ = (tmp2793_)*mLocCoeffU_B_3; double tmp2795_ = (tmp2707_)*(tmp361_); double tmp2796_ = (tmp2712_)*(tmp365_); double tmp2797_ = tmp2795_+tmp2796_; double tmp2798_ = (tmp2717_)*tmp368_; double tmp2799_ = tmp2797_+tmp2798_; double tmp2800_ = (tmp2799_)*(tmp451_); double tmp2801_ = (tmp522_)*(tmp2722_); double tmp2802_ = tmp2800_-tmp2801_; double tmp2803_ = (tmp2802_)/tmp1196_; double tmp2804_ = (tmp2803_)*mLocCoeffV_B_3; double tmp2805_ = tmp2794_+tmp2804_; double tmp2806_ = (tmp2727_)*tmp349_; double tmp2807_ = (tmp2732_)*tmp351_; double tmp2808_ = tmp2806_+tmp2807_; double tmp2809_ = (tmp2737_)*tmp304_; double tmp2810_ = tmp2808_+tmp2809_; double tmp2811_ = (tmp2810_)*(tmp477_); double tmp2812_ = (tmp530_)*(tmp2742_); double tmp2813_ = tmp2811_-tmp2812_; double tmp2814_ = (tmp2813_)/tmp1200_; double tmp2815_ = (tmp2814_)*mLocCoeffU_B_4; double tmp2816_ = (tmp2727_)*(tmp361_); double tmp2817_ = (tmp2732_)*(tmp365_); double tmp2818_ = tmp2816_+tmp2817_; double tmp2819_ = (tmp2737_)*tmp368_; double tmp2820_ = tmp2818_+tmp2819_; double tmp2821_ = (tmp2820_)*(tmp477_); double tmp2822_ = (tmp538_)*(tmp2742_); double tmp2823_ = tmp2821_-tmp2822_; double tmp2824_ = (tmp2823_)/tmp1200_; double tmp2825_ = (tmp2824_)*mLocCoeffV_B_4; double tmp2826_ = tmp2815_+tmp2825_; double tmp2827_ = tmp2662_+tmp2763_; double tmp2828_ = tmp2827_+tmp2784_; double tmp2829_ = tmp2828_+tmp2805_; double tmp2830_ = tmp2829_+tmp2826_; double tmp2831_ = (tmp2830_)*5; double tmp2832_ = (tmp2831_)/tmp681_; double tmp2833_ = mLocTimeRot*tmp23_; double tmp2834_ = -(tmp2833_); double tmp2835_ = tmp2834_*tmp4_; double tmp2836_ = tmp2067_*tmp16_; double tmp2837_ = tmp2834_*tmp13_; double tmp2838_ = tmp2836_*tmp4_; double tmp2839_ = tmp2838_*mLocP3X_A_0; double tmp2840_ = tmp2835_*tmp15_; double tmp2841_ = tmp2840_*mLocP3Y_A_0; double tmp2842_ = tmp2839_+tmp2841_; double tmp2843_ = tmp2835_*tmp19_; double tmp2844_ = tmp2843_*mLocP3Z_A_0; double tmp2845_ = tmp2842_+tmp2844_; double tmp2846_ = tmp2836_*tmp13_; double tmp2847_ = tmp2846_*mLocP3X_A_0; double tmp2848_ = tmp2837_*tmp15_; double tmp2849_ = tmp2848_*mLocP3Y_A_0; double tmp2850_ = tmp2847_+tmp2849_; double tmp2851_ = tmp2837_*tmp19_; double tmp2852_ = tmp2851_*mLocP3Z_A_0; double tmp2853_ = tmp2850_+tmp2852_; double tmp2854_ = tmp2833_*mLocP3X_A_0; double tmp2855_ = tmp2836_*tmp15_; double tmp2856_ = tmp2855_*mLocP3Y_A_0; double tmp2857_ = tmp2854_+tmp2856_; double tmp2858_ = tmp2836_*tmp19_; double tmp2859_ = tmp2858_*mLocP3Z_A_0; double tmp2860_ = tmp2857_+tmp2859_; double tmp2861_ = (tmp2845_)*(tmp91_); double tmp2862_ = (tmp2853_)*(tmp95_); double tmp2863_ = tmp2861_+tmp2862_; double tmp2864_ = (tmp2860_)*tmp98_; double tmp2865_ = tmp2863_+tmp2864_; double tmp2866_ = (tmp2845_)*tmp101_; double tmp2867_ = (tmp2853_)*tmp103_; double tmp2868_ = tmp2866_+tmp2867_; double tmp2869_ = (tmp2860_)*tmp28_; double tmp2870_ = tmp2868_+tmp2869_; double tmp2871_ = (tmp2870_)*(tmp100_); double tmp2872_ = (tmp107_)*(tmp2865_); double tmp2873_ = tmp2871_-tmp2872_; double tmp2874_ = (tmp2873_)/tmp559_; double tmp2875_ = (tmp2874_)*mLocCoeffU_A_0; double tmp2876_ = (tmp2845_)*(tmp113_); double tmp2877_ = (tmp2853_)*(tmp117_); double tmp2878_ = tmp2876_+tmp2877_; double tmp2879_ = (tmp2860_)*tmp120_; double tmp2880_ = tmp2878_+tmp2879_; double tmp2881_ = (tmp2880_)*(tmp100_); double tmp2882_ = (tmp122_)*(tmp2865_); double tmp2883_ = tmp2881_-tmp2882_; double tmp2884_ = (tmp2883_)/tmp559_; double tmp2885_ = (tmp2884_)*mLocCoeffV_A_0; double tmp2886_ = tmp2875_+tmp2885_; double tmp2887_ = tmp2838_*mLocP3X_A_1; double tmp2888_ = tmp2840_*mLocP3Y_A_1; double tmp2889_ = tmp2887_+tmp2888_; double tmp2890_ = tmp2843_*mLocP3Z_A_1; double tmp2891_ = tmp2889_+tmp2890_; double tmp2892_ = tmp2846_*mLocP3X_A_1; double tmp2893_ = tmp2848_*mLocP3Y_A_1; double tmp2894_ = tmp2892_+tmp2893_; double tmp2895_ = tmp2851_*mLocP3Z_A_1; double tmp2896_ = tmp2894_+tmp2895_; double tmp2897_ = tmp2833_*mLocP3X_A_1; double tmp2898_ = tmp2855_*mLocP3Y_A_1; double tmp2899_ = tmp2897_+tmp2898_; double tmp2900_ = tmp2858_*mLocP3Z_A_1; double tmp2901_ = tmp2899_+tmp2900_; double tmp2902_ = (tmp2891_)*(tmp91_); double tmp2903_ = (tmp2896_)*(tmp95_); double tmp2904_ = tmp2902_+tmp2903_; double tmp2905_ = (tmp2901_)*tmp98_; double tmp2906_ = tmp2904_+tmp2905_; double tmp2907_ = tmp2838_*mLocP3X_A_2; double tmp2908_ = tmp2840_*mLocP3Y_A_2; double tmp2909_ = tmp2907_+tmp2908_; double tmp2910_ = tmp2843_*mLocP3Z_A_2; double tmp2911_ = tmp2909_+tmp2910_; double tmp2912_ = tmp2846_*mLocP3X_A_2; double tmp2913_ = tmp2848_*mLocP3Y_A_2; double tmp2914_ = tmp2912_+tmp2913_; double tmp2915_ = tmp2851_*mLocP3Z_A_2; double tmp2916_ = tmp2914_+tmp2915_; double tmp2917_ = tmp2833_*mLocP3X_A_2; double tmp2918_ = tmp2855_*mLocP3Y_A_2; double tmp2919_ = tmp2917_+tmp2918_; double tmp2920_ = tmp2858_*mLocP3Z_A_2; double tmp2921_ = tmp2919_+tmp2920_; double tmp2922_ = (tmp2911_)*(tmp91_); double tmp2923_ = (tmp2916_)*(tmp95_); double tmp2924_ = tmp2922_+tmp2923_; double tmp2925_ = (tmp2921_)*tmp98_; double tmp2926_ = tmp2924_+tmp2925_; double tmp2927_ = tmp2838_*mLocP3X_A_3; double tmp2928_ = tmp2840_*mLocP3Y_A_3; double tmp2929_ = tmp2927_+tmp2928_; double tmp2930_ = tmp2843_*mLocP3Z_A_3; double tmp2931_ = tmp2929_+tmp2930_; double tmp2932_ = tmp2846_*mLocP3X_A_3; double tmp2933_ = tmp2848_*mLocP3Y_A_3; double tmp2934_ = tmp2932_+tmp2933_; double tmp2935_ = tmp2851_*mLocP3Z_A_3; double tmp2936_ = tmp2934_+tmp2935_; double tmp2937_ = tmp2833_*mLocP3X_A_3; double tmp2938_ = tmp2855_*mLocP3Y_A_3; double tmp2939_ = tmp2937_+tmp2938_; double tmp2940_ = tmp2858_*mLocP3Z_A_3; double tmp2941_ = tmp2939_+tmp2940_; double tmp2942_ = (tmp2931_)*(tmp91_); double tmp2943_ = (tmp2936_)*(tmp95_); double tmp2944_ = tmp2942_+tmp2943_; double tmp2945_ = (tmp2941_)*tmp98_; double tmp2946_ = tmp2944_+tmp2945_; double tmp2947_ = tmp2838_*mLocP3X_A_4; double tmp2948_ = tmp2840_*mLocP3Y_A_4; double tmp2949_ = tmp2947_+tmp2948_; double tmp2950_ = tmp2843_*mLocP3Z_A_4; double tmp2951_ = tmp2949_+tmp2950_; double tmp2952_ = tmp2846_*mLocP3X_A_4; double tmp2953_ = tmp2848_*mLocP3Y_A_4; double tmp2954_ = tmp2952_+tmp2953_; double tmp2955_ = tmp2851_*mLocP3Z_A_4; double tmp2956_ = tmp2954_+tmp2955_; double tmp2957_ = tmp2833_*mLocP3X_A_4; double tmp2958_ = tmp2855_*mLocP3Y_A_4; double tmp2959_ = tmp2957_+tmp2958_; double tmp2960_ = tmp2858_*mLocP3Z_A_4; double tmp2961_ = tmp2959_+tmp2960_; double tmp2962_ = (tmp2951_)*(tmp91_); double tmp2963_ = (tmp2956_)*(tmp95_); double tmp2964_ = tmp2962_+tmp2963_; double tmp2965_ = (tmp2961_)*tmp98_; double tmp2966_ = tmp2964_+tmp2965_; double tmp2967_ = (tmp2891_)*tmp101_; double tmp2968_ = (tmp2896_)*tmp103_; double tmp2969_ = tmp2967_+tmp2968_; double tmp2970_ = (tmp2901_)*tmp28_; double tmp2971_ = tmp2969_+tmp2970_; double tmp2972_ = (tmp2971_)*(tmp151_); double tmp2973_ = (tmp234_)*(tmp2906_); double tmp2974_ = tmp2972_-tmp2973_; double tmp2975_ = (tmp2974_)/tmp586_; double tmp2976_ = (tmp2975_)*mLocCoeffU_A_1; double tmp2977_ = (tmp2891_)*(tmp113_); double tmp2978_ = (tmp2896_)*(tmp117_); double tmp2979_ = tmp2977_+tmp2978_; double tmp2980_ = (tmp2901_)*tmp120_; double tmp2981_ = tmp2979_+tmp2980_; double tmp2982_ = (tmp2981_)*(tmp151_); double tmp2983_ = (tmp242_)*(tmp2906_); double tmp2984_ = tmp2982_-tmp2983_; double tmp2985_ = (tmp2984_)/tmp586_; double tmp2986_ = (tmp2985_)*mLocCoeffV_A_1; double tmp2987_ = tmp2976_+tmp2986_; double tmp2988_ = (tmp2911_)*tmp101_; double tmp2989_ = (tmp2916_)*tmp103_; double tmp2990_ = tmp2988_+tmp2989_; double tmp2991_ = (tmp2921_)*tmp28_; double tmp2992_ = tmp2990_+tmp2991_; double tmp2993_ = (tmp2992_)*(tmp177_); double tmp2994_ = (tmp250_)*(tmp2926_); double tmp2995_ = tmp2993_-tmp2994_; double tmp2996_ = (tmp2995_)/tmp590_; double tmp2997_ = (tmp2996_)*mLocCoeffU_A_2; double tmp2998_ = (tmp2911_)*(tmp113_); double tmp2999_ = (tmp2916_)*(tmp117_); double tmp3000_ = tmp2998_+tmp2999_; double tmp3001_ = (tmp2921_)*tmp120_; double tmp3002_ = tmp3000_+tmp3001_; double tmp3003_ = (tmp3002_)*(tmp177_); double tmp3004_ = (tmp258_)*(tmp2926_); double tmp3005_ = tmp3003_-tmp3004_; double tmp3006_ = (tmp3005_)/tmp590_; double tmp3007_ = (tmp3006_)*mLocCoeffV_A_2; double tmp3008_ = tmp2997_+tmp3007_; double tmp3009_ = (tmp2931_)*tmp101_; double tmp3010_ = (tmp2936_)*tmp103_; double tmp3011_ = tmp3009_+tmp3010_; double tmp3012_ = (tmp2941_)*tmp28_; double tmp3013_ = tmp3011_+tmp3012_; double tmp3014_ = (tmp3013_)*(tmp203_); double tmp3015_ = (tmp266_)*(tmp2946_); double tmp3016_ = tmp3014_-tmp3015_; double tmp3017_ = (tmp3016_)/tmp594_; double tmp3018_ = (tmp3017_)*mLocCoeffU_A_3; double tmp3019_ = (tmp2931_)*(tmp113_); double tmp3020_ = (tmp2936_)*(tmp117_); double tmp3021_ = tmp3019_+tmp3020_; double tmp3022_ = (tmp2941_)*tmp120_; double tmp3023_ = tmp3021_+tmp3022_; double tmp3024_ = (tmp3023_)*(tmp203_); double tmp3025_ = (tmp274_)*(tmp2946_); double tmp3026_ = tmp3024_-tmp3025_; double tmp3027_ = (tmp3026_)/tmp594_; double tmp3028_ = (tmp3027_)*mLocCoeffV_A_3; double tmp3029_ = tmp3018_+tmp3028_; double tmp3030_ = (tmp2951_)*tmp101_; double tmp3031_ = (tmp2956_)*tmp103_; double tmp3032_ = tmp3030_+tmp3031_; double tmp3033_ = (tmp2961_)*tmp28_; double tmp3034_ = tmp3032_+tmp3033_; double tmp3035_ = (tmp3034_)*(tmp229_); double tmp3036_ = (tmp282_)*(tmp2966_); double tmp3037_ = tmp3035_-tmp3036_; double tmp3038_ = (tmp3037_)/tmp598_; double tmp3039_ = (tmp3038_)*mLocCoeffU_A_4; double tmp3040_ = (tmp2951_)*(tmp113_); double tmp3041_ = (tmp2956_)*(tmp117_); double tmp3042_ = tmp3040_+tmp3041_; double tmp3043_ = (tmp2961_)*tmp120_; double tmp3044_ = tmp3042_+tmp3043_; double tmp3045_ = (tmp3044_)*(tmp229_); double tmp3046_ = (tmp290_)*(tmp2966_); double tmp3047_ = tmp3045_-tmp3046_; double tmp3048_ = (tmp3047_)/tmp598_; double tmp3049_ = (tmp3048_)*mLocCoeffV_A_4; double tmp3050_ = tmp3039_+tmp3049_; double tmp3051_ = tmp2886_+tmp2987_; double tmp3052_ = tmp3051_+tmp3008_; double tmp3053_ = tmp3052_+tmp3029_; double tmp3054_ = tmp3053_+tmp3050_; double tmp3055_ = (tmp3054_)*5; double tmp3056_ = (tmp3055_)/tmp681_; double tmp3057_ = tmp2838_*mLocP3X_B_0; double tmp3058_ = tmp2840_*mLocP3Y_B_0; double tmp3059_ = tmp3057_+tmp3058_; double tmp3060_ = tmp2843_*mLocP3Z_B_0; double tmp3061_ = tmp3059_+tmp3060_; double tmp3062_ = tmp2846_*mLocP3X_B_0; double tmp3063_ = tmp2848_*mLocP3Y_B_0; double tmp3064_ = tmp3062_+tmp3063_; double tmp3065_ = tmp2851_*mLocP3Z_B_0; double tmp3066_ = tmp3064_+tmp3065_; double tmp3067_ = tmp2833_*mLocP3X_B_0; double tmp3068_ = tmp2855_*mLocP3Y_B_0; double tmp3069_ = tmp3067_+tmp3068_; double tmp3070_ = tmp2858_*mLocP3Z_B_0; double tmp3071_ = tmp3069_+tmp3070_; double tmp3072_ = (tmp3061_)*(tmp339_); double tmp3073_ = (tmp3066_)*(tmp343_); double tmp3074_ = tmp3072_+tmp3073_; double tmp3075_ = (tmp3071_)*tmp346_; double tmp3076_ = tmp3074_+tmp3075_; double tmp3077_ = (tmp3061_)*tmp349_; double tmp3078_ = (tmp3066_)*tmp351_; double tmp3079_ = tmp3077_+tmp3078_; double tmp3080_ = (tmp3071_)*tmp304_; double tmp3081_ = tmp3079_+tmp3080_; double tmp3082_ = (tmp3081_)*(tmp348_); double tmp3083_ = (tmp355_)*(tmp3076_); double tmp3084_ = tmp3082_-tmp3083_; double tmp3085_ = (tmp3084_)/tmp1161_; double tmp3086_ = (tmp3085_)*mLocCoeffU_B_0; double tmp3087_ = (tmp3061_)*(tmp361_); double tmp3088_ = (tmp3066_)*(tmp365_); double tmp3089_ = tmp3087_+tmp3088_; double tmp3090_ = (tmp3071_)*tmp368_; double tmp3091_ = tmp3089_+tmp3090_; double tmp3092_ = (tmp3091_)*(tmp348_); double tmp3093_ = (tmp370_)*(tmp3076_); double tmp3094_ = tmp3092_-tmp3093_; double tmp3095_ = (tmp3094_)/tmp1161_; double tmp3096_ = (tmp3095_)*mLocCoeffV_B_0; double tmp3097_ = tmp3086_+tmp3096_; double tmp3098_ = tmp2838_*mLocP3X_B_1; double tmp3099_ = tmp2840_*mLocP3Y_B_1; double tmp3100_ = tmp3098_+tmp3099_; double tmp3101_ = tmp2843_*mLocP3Z_B_1; double tmp3102_ = tmp3100_+tmp3101_; double tmp3103_ = tmp2846_*mLocP3X_B_1; double tmp3104_ = tmp2848_*mLocP3Y_B_1; double tmp3105_ = tmp3103_+tmp3104_; double tmp3106_ = tmp2851_*mLocP3Z_B_1; double tmp3107_ = tmp3105_+tmp3106_; double tmp3108_ = tmp2833_*mLocP3X_B_1; double tmp3109_ = tmp2855_*mLocP3Y_B_1; double tmp3110_ = tmp3108_+tmp3109_; double tmp3111_ = tmp2858_*mLocP3Z_B_1; double tmp3112_ = tmp3110_+tmp3111_; double tmp3113_ = (tmp3102_)*(tmp339_); double tmp3114_ = (tmp3107_)*(tmp343_); double tmp3115_ = tmp3113_+tmp3114_; double tmp3116_ = (tmp3112_)*tmp346_; double tmp3117_ = tmp3115_+tmp3116_; double tmp3118_ = tmp2838_*mLocP3X_B_2; double tmp3119_ = tmp2840_*mLocP3Y_B_2; double tmp3120_ = tmp3118_+tmp3119_; double tmp3121_ = tmp2843_*mLocP3Z_B_2; double tmp3122_ = tmp3120_+tmp3121_; double tmp3123_ = tmp2846_*mLocP3X_B_2; double tmp3124_ = tmp2848_*mLocP3Y_B_2; double tmp3125_ = tmp3123_+tmp3124_; double tmp3126_ = tmp2851_*mLocP3Z_B_2; double tmp3127_ = tmp3125_+tmp3126_; double tmp3128_ = tmp2833_*mLocP3X_B_2; double tmp3129_ = tmp2855_*mLocP3Y_B_2; double tmp3130_ = tmp3128_+tmp3129_; double tmp3131_ = tmp2858_*mLocP3Z_B_2; double tmp3132_ = tmp3130_+tmp3131_; double tmp3133_ = (tmp3122_)*(tmp339_); double tmp3134_ = (tmp3127_)*(tmp343_); double tmp3135_ = tmp3133_+tmp3134_; double tmp3136_ = (tmp3132_)*tmp346_; double tmp3137_ = tmp3135_+tmp3136_; double tmp3138_ = tmp2838_*mLocP3X_B_3; double tmp3139_ = tmp2840_*mLocP3Y_B_3; double tmp3140_ = tmp3138_+tmp3139_; double tmp3141_ = tmp2843_*mLocP3Z_B_3; double tmp3142_ = tmp3140_+tmp3141_; double tmp3143_ = tmp2846_*mLocP3X_B_3; double tmp3144_ = tmp2848_*mLocP3Y_B_3; double tmp3145_ = tmp3143_+tmp3144_; double tmp3146_ = tmp2851_*mLocP3Z_B_3; double tmp3147_ = tmp3145_+tmp3146_; double tmp3148_ = tmp2833_*mLocP3X_B_3; double tmp3149_ = tmp2855_*mLocP3Y_B_3; double tmp3150_ = tmp3148_+tmp3149_; double tmp3151_ = tmp2858_*mLocP3Z_B_3; double tmp3152_ = tmp3150_+tmp3151_; double tmp3153_ = (tmp3142_)*(tmp339_); double tmp3154_ = (tmp3147_)*(tmp343_); double tmp3155_ = tmp3153_+tmp3154_; double tmp3156_ = (tmp3152_)*tmp346_; double tmp3157_ = tmp3155_+tmp3156_; double tmp3158_ = tmp2838_*mLocP3X_B_4; double tmp3159_ = tmp2840_*mLocP3Y_B_4; double tmp3160_ = tmp3158_+tmp3159_; double tmp3161_ = tmp2843_*mLocP3Z_B_4; double tmp3162_ = tmp3160_+tmp3161_; double tmp3163_ = tmp2846_*mLocP3X_B_4; double tmp3164_ = tmp2848_*mLocP3Y_B_4; double tmp3165_ = tmp3163_+tmp3164_; double tmp3166_ = tmp2851_*mLocP3Z_B_4; double tmp3167_ = tmp3165_+tmp3166_; double tmp3168_ = tmp2833_*mLocP3X_B_4; double tmp3169_ = tmp2855_*mLocP3Y_B_4; double tmp3170_ = tmp3168_+tmp3169_; double tmp3171_ = tmp2858_*mLocP3Z_B_4; double tmp3172_ = tmp3170_+tmp3171_; double tmp3173_ = (tmp3162_)*(tmp339_); double tmp3174_ = (tmp3167_)*(tmp343_); double tmp3175_ = tmp3173_+tmp3174_; double tmp3176_ = (tmp3172_)*tmp346_; double tmp3177_ = tmp3175_+tmp3176_; double tmp3178_ = (tmp3102_)*tmp349_; double tmp3179_ = (tmp3107_)*tmp351_; double tmp3180_ = tmp3178_+tmp3179_; double tmp3181_ = (tmp3112_)*tmp304_; double tmp3182_ = tmp3180_+tmp3181_; double tmp3183_ = (tmp3182_)*(tmp399_); double tmp3184_ = (tmp482_)*(tmp3117_); double tmp3185_ = tmp3183_-tmp3184_; double tmp3186_ = (tmp3185_)/tmp1188_; double tmp3187_ = (tmp3186_)*mLocCoeffU_B_1; double tmp3188_ = (tmp3102_)*(tmp361_); double tmp3189_ = (tmp3107_)*(tmp365_); double tmp3190_ = tmp3188_+tmp3189_; double tmp3191_ = (tmp3112_)*tmp368_; double tmp3192_ = tmp3190_+tmp3191_; double tmp3193_ = (tmp3192_)*(tmp399_); double tmp3194_ = (tmp490_)*(tmp3117_); double tmp3195_ = tmp3193_-tmp3194_; double tmp3196_ = (tmp3195_)/tmp1188_; double tmp3197_ = (tmp3196_)*mLocCoeffV_B_1; double tmp3198_ = tmp3187_+tmp3197_; double tmp3199_ = (tmp3122_)*tmp349_; double tmp3200_ = (tmp3127_)*tmp351_; double tmp3201_ = tmp3199_+tmp3200_; double tmp3202_ = (tmp3132_)*tmp304_; double tmp3203_ = tmp3201_+tmp3202_; double tmp3204_ = (tmp3203_)*(tmp425_); double tmp3205_ = (tmp498_)*(tmp3137_); double tmp3206_ = tmp3204_-tmp3205_; double tmp3207_ = (tmp3206_)/tmp1192_; double tmp3208_ = (tmp3207_)*mLocCoeffU_B_2; double tmp3209_ = (tmp3122_)*(tmp361_); double tmp3210_ = (tmp3127_)*(tmp365_); double tmp3211_ = tmp3209_+tmp3210_; double tmp3212_ = (tmp3132_)*tmp368_; double tmp3213_ = tmp3211_+tmp3212_; double tmp3214_ = (tmp3213_)*(tmp425_); double tmp3215_ = (tmp506_)*(tmp3137_); double tmp3216_ = tmp3214_-tmp3215_; double tmp3217_ = (tmp3216_)/tmp1192_; double tmp3218_ = (tmp3217_)*mLocCoeffV_B_2; double tmp3219_ = tmp3208_+tmp3218_; double tmp3220_ = (tmp3142_)*tmp349_; double tmp3221_ = (tmp3147_)*tmp351_; double tmp3222_ = tmp3220_+tmp3221_; double tmp3223_ = (tmp3152_)*tmp304_; double tmp3224_ = tmp3222_+tmp3223_; double tmp3225_ = (tmp3224_)*(tmp451_); double tmp3226_ = (tmp514_)*(tmp3157_); double tmp3227_ = tmp3225_-tmp3226_; double tmp3228_ = (tmp3227_)/tmp1196_; double tmp3229_ = (tmp3228_)*mLocCoeffU_B_3; double tmp3230_ = (tmp3142_)*(tmp361_); double tmp3231_ = (tmp3147_)*(tmp365_); double tmp3232_ = tmp3230_+tmp3231_; double tmp3233_ = (tmp3152_)*tmp368_; double tmp3234_ = tmp3232_+tmp3233_; double tmp3235_ = (tmp3234_)*(tmp451_); double tmp3236_ = (tmp522_)*(tmp3157_); double tmp3237_ = tmp3235_-tmp3236_; double tmp3238_ = (tmp3237_)/tmp1196_; double tmp3239_ = (tmp3238_)*mLocCoeffV_B_3; double tmp3240_ = tmp3229_+tmp3239_; double tmp3241_ = (tmp3162_)*tmp349_; double tmp3242_ = (tmp3167_)*tmp351_; double tmp3243_ = tmp3241_+tmp3242_; double tmp3244_ = (tmp3172_)*tmp304_; double tmp3245_ = tmp3243_+tmp3244_; double tmp3246_ = (tmp3245_)*(tmp477_); double tmp3247_ = (tmp530_)*(tmp3177_); double tmp3248_ = tmp3246_-tmp3247_; double tmp3249_ = (tmp3248_)/tmp1200_; double tmp3250_ = (tmp3249_)*mLocCoeffU_B_4; double tmp3251_ = (tmp3162_)*(tmp361_); double tmp3252_ = (tmp3167_)*(tmp365_); double tmp3253_ = tmp3251_+tmp3252_; double tmp3254_ = (tmp3172_)*tmp368_; double tmp3255_ = tmp3253_+tmp3254_; double tmp3256_ = (tmp3255_)*(tmp477_); double tmp3257_ = (tmp538_)*(tmp3177_); double tmp3258_ = tmp3256_-tmp3257_; double tmp3259_ = (tmp3258_)/tmp1200_; double tmp3260_ = (tmp3259_)*mLocCoeffV_B_4; double tmp3261_ = tmp3250_+tmp3260_; double tmp3262_ = tmp3097_+tmp3198_; double tmp3263_ = tmp3262_+tmp3219_; double tmp3264_ = tmp3263_+tmp3240_; double tmp3265_ = tmp3264_+tmp3261_; double tmp3266_ = (tmp3265_)*5; double tmp3267_ = (tmp3266_)/tmp681_; double tmp3268_ = tmp547_*tmp15_; double tmp3269_ = -(tmp19_); double tmp3270_ = tmp3268_*tmp14_; double tmp3271_ = tmp19_*tmp18_; double tmp3272_ = tmp3270_+tmp3271_; double tmp3273_ = (tmp3272_)*mLocP3Y_A_0; double tmp3274_ = tmp3269_*tmp14_; double tmp3275_ = tmp3268_*tmp18_; double tmp3276_ = tmp3274_+tmp3275_; double tmp3277_ = (tmp3276_)*mLocP3Z_A_0; double tmp3278_ = tmp3273_+tmp3277_; double tmp3279_ = tmp3268_*tmp4_; double tmp3280_ = tmp19_*tmp25_; double tmp3281_ = tmp3279_+tmp3280_; double tmp3282_ = (tmp3281_)*mLocP3Y_A_0; double tmp3283_ = tmp3269_*tmp4_; double tmp3284_ = tmp3268_*tmp25_; double tmp3285_ = tmp3283_+tmp3284_; double tmp3286_ = (tmp3285_)*mLocP3Z_A_0; double tmp3287_ = tmp3282_+tmp3286_; double tmp3288_ = tmp19_*tmp23_; double tmp3289_ = tmp3288_*mLocP3Y_A_0; double tmp3290_ = tmp3268_*tmp23_; double tmp3291_ = tmp3290_*mLocP3Z_A_0; double tmp3292_ = tmp3289_+tmp3291_; double tmp3293_ = (tmp3278_)*(tmp91_); double tmp3294_ = (tmp3287_)*(tmp95_); double tmp3295_ = tmp3293_+tmp3294_; double tmp3296_ = (tmp3292_)*tmp98_; double tmp3297_ = tmp3295_+tmp3296_; double tmp3298_ = (tmp3278_)*tmp101_; double tmp3299_ = (tmp3287_)*tmp103_; double tmp3300_ = tmp3298_+tmp3299_; double tmp3301_ = (tmp3292_)*tmp28_; double tmp3302_ = tmp3300_+tmp3301_; double tmp3303_ = (tmp3302_)*(tmp100_); double tmp3304_ = (tmp107_)*(tmp3297_); double tmp3305_ = tmp3303_-tmp3304_; double tmp3306_ = (tmp3305_)/tmp559_; double tmp3307_ = (tmp3306_)*mLocCoeffU_A_0; double tmp3308_ = (tmp3278_)*(tmp113_); double tmp3309_ = (tmp3287_)*(tmp117_); double tmp3310_ = tmp3308_+tmp3309_; double tmp3311_ = (tmp3292_)*tmp120_; double tmp3312_ = tmp3310_+tmp3311_; double tmp3313_ = (tmp3312_)*(tmp100_); double tmp3314_ = (tmp122_)*(tmp3297_); double tmp3315_ = tmp3313_-tmp3314_; double tmp3316_ = (tmp3315_)/tmp559_; double tmp3317_ = (tmp3316_)*mLocCoeffV_A_0; double tmp3318_ = tmp3307_+tmp3317_; double tmp3319_ = (tmp3272_)*mLocP3Y_A_1; double tmp3320_ = (tmp3276_)*mLocP3Z_A_1; double tmp3321_ = tmp3319_+tmp3320_; double tmp3322_ = (tmp3281_)*mLocP3Y_A_1; double tmp3323_ = (tmp3285_)*mLocP3Z_A_1; double tmp3324_ = tmp3322_+tmp3323_; double tmp3325_ = tmp3288_*mLocP3Y_A_1; double tmp3326_ = tmp3290_*mLocP3Z_A_1; double tmp3327_ = tmp3325_+tmp3326_; double tmp3328_ = (tmp3321_)*(tmp91_); double tmp3329_ = (tmp3324_)*(tmp95_); double tmp3330_ = tmp3328_+tmp3329_; double tmp3331_ = (tmp3327_)*tmp98_; double tmp3332_ = tmp3330_+tmp3331_; double tmp3333_ = (tmp3272_)*mLocP3Y_A_2; double tmp3334_ = (tmp3276_)*mLocP3Z_A_2; double tmp3335_ = tmp3333_+tmp3334_; double tmp3336_ = (tmp3281_)*mLocP3Y_A_2; double tmp3337_ = (tmp3285_)*mLocP3Z_A_2; double tmp3338_ = tmp3336_+tmp3337_; double tmp3339_ = tmp3288_*mLocP3Y_A_2; double tmp3340_ = tmp3290_*mLocP3Z_A_2; double tmp3341_ = tmp3339_+tmp3340_; double tmp3342_ = (tmp3335_)*(tmp91_); double tmp3343_ = (tmp3338_)*(tmp95_); double tmp3344_ = tmp3342_+tmp3343_; double tmp3345_ = (tmp3341_)*tmp98_; double tmp3346_ = tmp3344_+tmp3345_; double tmp3347_ = (tmp3272_)*mLocP3Y_A_3; double tmp3348_ = (tmp3276_)*mLocP3Z_A_3; double tmp3349_ = tmp3347_+tmp3348_; double tmp3350_ = (tmp3281_)*mLocP3Y_A_3; double tmp3351_ = (tmp3285_)*mLocP3Z_A_3; double tmp3352_ = tmp3350_+tmp3351_; double tmp3353_ = tmp3288_*mLocP3Y_A_3; double tmp3354_ = tmp3290_*mLocP3Z_A_3; double tmp3355_ = tmp3353_+tmp3354_; double tmp3356_ = (tmp3349_)*(tmp91_); double tmp3357_ = (tmp3352_)*(tmp95_); double tmp3358_ = tmp3356_+tmp3357_; double tmp3359_ = (tmp3355_)*tmp98_; double tmp3360_ = tmp3358_+tmp3359_; double tmp3361_ = (tmp3272_)*mLocP3Y_A_4; double tmp3362_ = (tmp3276_)*mLocP3Z_A_4; double tmp3363_ = tmp3361_+tmp3362_; double tmp3364_ = (tmp3281_)*mLocP3Y_A_4; double tmp3365_ = (tmp3285_)*mLocP3Z_A_4; double tmp3366_ = tmp3364_+tmp3365_; double tmp3367_ = tmp3288_*mLocP3Y_A_4; double tmp3368_ = tmp3290_*mLocP3Z_A_4; double tmp3369_ = tmp3367_+tmp3368_; double tmp3370_ = (tmp3363_)*(tmp91_); double tmp3371_ = (tmp3366_)*(tmp95_); double tmp3372_ = tmp3370_+tmp3371_; double tmp3373_ = (tmp3369_)*tmp98_; double tmp3374_ = tmp3372_+tmp3373_; double tmp3375_ = (tmp3321_)*tmp101_; double tmp3376_ = (tmp3324_)*tmp103_; double tmp3377_ = tmp3375_+tmp3376_; double tmp3378_ = (tmp3327_)*tmp28_; double tmp3379_ = tmp3377_+tmp3378_; double tmp3380_ = (tmp3379_)*(tmp151_); double tmp3381_ = (tmp234_)*(tmp3332_); double tmp3382_ = tmp3380_-tmp3381_; double tmp3383_ = (tmp3382_)/tmp586_; double tmp3384_ = (tmp3383_)*mLocCoeffU_A_1; double tmp3385_ = (tmp3321_)*(tmp113_); double tmp3386_ = (tmp3324_)*(tmp117_); double tmp3387_ = tmp3385_+tmp3386_; double tmp3388_ = (tmp3327_)*tmp120_; double tmp3389_ = tmp3387_+tmp3388_; double tmp3390_ = (tmp3389_)*(tmp151_); double tmp3391_ = (tmp242_)*(tmp3332_); double tmp3392_ = tmp3390_-tmp3391_; double tmp3393_ = (tmp3392_)/tmp586_; double tmp3394_ = (tmp3393_)*mLocCoeffV_A_1; double tmp3395_ = tmp3384_+tmp3394_; double tmp3396_ = (tmp3335_)*tmp101_; double tmp3397_ = (tmp3338_)*tmp103_; double tmp3398_ = tmp3396_+tmp3397_; double tmp3399_ = (tmp3341_)*tmp28_; double tmp3400_ = tmp3398_+tmp3399_; double tmp3401_ = (tmp3400_)*(tmp177_); double tmp3402_ = (tmp250_)*(tmp3346_); double tmp3403_ = tmp3401_-tmp3402_; double tmp3404_ = (tmp3403_)/tmp590_; double tmp3405_ = (tmp3404_)*mLocCoeffU_A_2; double tmp3406_ = (tmp3335_)*(tmp113_); double tmp3407_ = (tmp3338_)*(tmp117_); double tmp3408_ = tmp3406_+tmp3407_; double tmp3409_ = (tmp3341_)*tmp120_; double tmp3410_ = tmp3408_+tmp3409_; double tmp3411_ = (tmp3410_)*(tmp177_); double tmp3412_ = (tmp258_)*(tmp3346_); double tmp3413_ = tmp3411_-tmp3412_; double tmp3414_ = (tmp3413_)/tmp590_; double tmp3415_ = (tmp3414_)*mLocCoeffV_A_2; double tmp3416_ = tmp3405_+tmp3415_; double tmp3417_ = (tmp3349_)*tmp101_; double tmp3418_ = (tmp3352_)*tmp103_; double tmp3419_ = tmp3417_+tmp3418_; double tmp3420_ = (tmp3355_)*tmp28_; double tmp3421_ = tmp3419_+tmp3420_; double tmp3422_ = (tmp3421_)*(tmp203_); double tmp3423_ = (tmp266_)*(tmp3360_); double tmp3424_ = tmp3422_-tmp3423_; double tmp3425_ = (tmp3424_)/tmp594_; double tmp3426_ = (tmp3425_)*mLocCoeffU_A_3; double tmp3427_ = (tmp3349_)*(tmp113_); double tmp3428_ = (tmp3352_)*(tmp117_); double tmp3429_ = tmp3427_+tmp3428_; double tmp3430_ = (tmp3355_)*tmp120_; double tmp3431_ = tmp3429_+tmp3430_; double tmp3432_ = (tmp3431_)*(tmp203_); double tmp3433_ = (tmp274_)*(tmp3360_); double tmp3434_ = tmp3432_-tmp3433_; double tmp3435_ = (tmp3434_)/tmp594_; double tmp3436_ = (tmp3435_)*mLocCoeffV_A_3; double tmp3437_ = tmp3426_+tmp3436_; double tmp3438_ = (tmp3363_)*tmp101_; double tmp3439_ = (tmp3366_)*tmp103_; double tmp3440_ = tmp3438_+tmp3439_; double tmp3441_ = (tmp3369_)*tmp28_; double tmp3442_ = tmp3440_+tmp3441_; double tmp3443_ = (tmp3442_)*(tmp229_); double tmp3444_ = (tmp282_)*(tmp3374_); double tmp3445_ = tmp3443_-tmp3444_; double tmp3446_ = (tmp3445_)/tmp598_; double tmp3447_ = (tmp3446_)*mLocCoeffU_A_4; double tmp3448_ = (tmp3363_)*(tmp113_); double tmp3449_ = (tmp3366_)*(tmp117_); double tmp3450_ = tmp3448_+tmp3449_; double tmp3451_ = (tmp3369_)*tmp120_; double tmp3452_ = tmp3450_+tmp3451_; double tmp3453_ = (tmp3452_)*(tmp229_); double tmp3454_ = (tmp290_)*(tmp3374_); double tmp3455_ = tmp3453_-tmp3454_; double tmp3456_ = (tmp3455_)/tmp598_; double tmp3457_ = (tmp3456_)*mLocCoeffV_A_4; double tmp3458_ = tmp3447_+tmp3457_; double tmp3459_ = tmp3318_+tmp3395_; double tmp3460_ = tmp3459_+tmp3416_; double tmp3461_ = tmp3460_+tmp3437_; double tmp3462_ = tmp3461_+tmp3458_; double tmp3463_ = (tmp3462_)*5; double tmp3464_ = (tmp3463_)/tmp681_; double tmp3465_ = (tmp3272_)*mLocP3Y_B_0; double tmp3466_ = (tmp3276_)*mLocP3Z_B_0; double tmp3467_ = tmp3465_+tmp3466_; double tmp3468_ = (tmp3281_)*mLocP3Y_B_0; double tmp3469_ = (tmp3285_)*mLocP3Z_B_0; double tmp3470_ = tmp3468_+tmp3469_; double tmp3471_ = tmp3288_*mLocP3Y_B_0; double tmp3472_ = tmp3290_*mLocP3Z_B_0; double tmp3473_ = tmp3471_+tmp3472_; double tmp3474_ = (tmp3467_)*(tmp339_); double tmp3475_ = (tmp3470_)*(tmp343_); double tmp3476_ = tmp3474_+tmp3475_; double tmp3477_ = (tmp3473_)*tmp346_; double tmp3478_ = tmp3476_+tmp3477_; double tmp3479_ = (tmp3467_)*tmp349_; double tmp3480_ = (tmp3470_)*tmp351_; double tmp3481_ = tmp3479_+tmp3480_; double tmp3482_ = (tmp3473_)*tmp304_; double tmp3483_ = tmp3481_+tmp3482_; double tmp3484_ = (tmp3483_)*(tmp348_); double tmp3485_ = (tmp355_)*(tmp3478_); double tmp3486_ = tmp3484_-tmp3485_; double tmp3487_ = (tmp3486_)/tmp1161_; double tmp3488_ = (tmp3487_)*mLocCoeffU_B_0; double tmp3489_ = (tmp3467_)*(tmp361_); double tmp3490_ = (tmp3470_)*(tmp365_); double tmp3491_ = tmp3489_+tmp3490_; double tmp3492_ = (tmp3473_)*tmp368_; double tmp3493_ = tmp3491_+tmp3492_; double tmp3494_ = (tmp3493_)*(tmp348_); double tmp3495_ = (tmp370_)*(tmp3478_); double tmp3496_ = tmp3494_-tmp3495_; double tmp3497_ = (tmp3496_)/tmp1161_; double tmp3498_ = (tmp3497_)*mLocCoeffV_B_0; double tmp3499_ = tmp3488_+tmp3498_; double tmp3500_ = (tmp3272_)*mLocP3Y_B_1; double tmp3501_ = (tmp3276_)*mLocP3Z_B_1; double tmp3502_ = tmp3500_+tmp3501_; double tmp3503_ = (tmp3281_)*mLocP3Y_B_1; double tmp3504_ = (tmp3285_)*mLocP3Z_B_1; double tmp3505_ = tmp3503_+tmp3504_; double tmp3506_ = tmp3288_*mLocP3Y_B_1; double tmp3507_ = tmp3290_*mLocP3Z_B_1; double tmp3508_ = tmp3506_+tmp3507_; double tmp3509_ = (tmp3502_)*(tmp339_); double tmp3510_ = (tmp3505_)*(tmp343_); double tmp3511_ = tmp3509_+tmp3510_; double tmp3512_ = (tmp3508_)*tmp346_; double tmp3513_ = tmp3511_+tmp3512_; double tmp3514_ = (tmp3272_)*mLocP3Y_B_2; double tmp3515_ = (tmp3276_)*mLocP3Z_B_2; double tmp3516_ = tmp3514_+tmp3515_; double tmp3517_ = (tmp3281_)*mLocP3Y_B_2; double tmp3518_ = (tmp3285_)*mLocP3Z_B_2; double tmp3519_ = tmp3517_+tmp3518_; double tmp3520_ = tmp3288_*mLocP3Y_B_2; double tmp3521_ = tmp3290_*mLocP3Z_B_2; double tmp3522_ = tmp3520_+tmp3521_; double tmp3523_ = (tmp3516_)*(tmp339_); double tmp3524_ = (tmp3519_)*(tmp343_); double tmp3525_ = tmp3523_+tmp3524_; double tmp3526_ = (tmp3522_)*tmp346_; double tmp3527_ = tmp3525_+tmp3526_; double tmp3528_ = (tmp3272_)*mLocP3Y_B_3; double tmp3529_ = (tmp3276_)*mLocP3Z_B_3; double tmp3530_ = tmp3528_+tmp3529_; double tmp3531_ = (tmp3281_)*mLocP3Y_B_3; double tmp3532_ = (tmp3285_)*mLocP3Z_B_3; double tmp3533_ = tmp3531_+tmp3532_; double tmp3534_ = tmp3288_*mLocP3Y_B_3; double tmp3535_ = tmp3290_*mLocP3Z_B_3; double tmp3536_ = tmp3534_+tmp3535_; double tmp3537_ = (tmp3530_)*(tmp339_); double tmp3538_ = (tmp3533_)*(tmp343_); double tmp3539_ = tmp3537_+tmp3538_; double tmp3540_ = (tmp3536_)*tmp346_; double tmp3541_ = tmp3539_+tmp3540_; double tmp3542_ = (tmp3272_)*mLocP3Y_B_4; double tmp3543_ = (tmp3276_)*mLocP3Z_B_4; double tmp3544_ = tmp3542_+tmp3543_; double tmp3545_ = (tmp3281_)*mLocP3Y_B_4; double tmp3546_ = (tmp3285_)*mLocP3Z_B_4; double tmp3547_ = tmp3545_+tmp3546_; double tmp3548_ = tmp3288_*mLocP3Y_B_4; double tmp3549_ = tmp3290_*mLocP3Z_B_4; double tmp3550_ = tmp3548_+tmp3549_; double tmp3551_ = (tmp3544_)*(tmp339_); double tmp3552_ = (tmp3547_)*(tmp343_); double tmp3553_ = tmp3551_+tmp3552_; double tmp3554_ = (tmp3550_)*tmp346_; double tmp3555_ = tmp3553_+tmp3554_; double tmp3556_ = (tmp3502_)*tmp349_; double tmp3557_ = (tmp3505_)*tmp351_; double tmp3558_ = tmp3556_+tmp3557_; double tmp3559_ = (tmp3508_)*tmp304_; double tmp3560_ = tmp3558_+tmp3559_; double tmp3561_ = (tmp3560_)*(tmp399_); double tmp3562_ = (tmp482_)*(tmp3513_); double tmp3563_ = tmp3561_-tmp3562_; double tmp3564_ = (tmp3563_)/tmp1188_; double tmp3565_ = (tmp3564_)*mLocCoeffU_B_1; double tmp3566_ = (tmp3502_)*(tmp361_); double tmp3567_ = (tmp3505_)*(tmp365_); double tmp3568_ = tmp3566_+tmp3567_; double tmp3569_ = (tmp3508_)*tmp368_; double tmp3570_ = tmp3568_+tmp3569_; double tmp3571_ = (tmp3570_)*(tmp399_); double tmp3572_ = (tmp490_)*(tmp3513_); double tmp3573_ = tmp3571_-tmp3572_; double tmp3574_ = (tmp3573_)/tmp1188_; double tmp3575_ = (tmp3574_)*mLocCoeffV_B_1; double tmp3576_ = tmp3565_+tmp3575_; double tmp3577_ = (tmp3516_)*tmp349_; double tmp3578_ = (tmp3519_)*tmp351_; double tmp3579_ = tmp3577_+tmp3578_; double tmp3580_ = (tmp3522_)*tmp304_; double tmp3581_ = tmp3579_+tmp3580_; double tmp3582_ = (tmp3581_)*(tmp425_); double tmp3583_ = (tmp498_)*(tmp3527_); double tmp3584_ = tmp3582_-tmp3583_; double tmp3585_ = (tmp3584_)/tmp1192_; double tmp3586_ = (tmp3585_)*mLocCoeffU_B_2; double tmp3587_ = (tmp3516_)*(tmp361_); double tmp3588_ = (tmp3519_)*(tmp365_); double tmp3589_ = tmp3587_+tmp3588_; double tmp3590_ = (tmp3522_)*tmp368_; double tmp3591_ = tmp3589_+tmp3590_; double tmp3592_ = (tmp3591_)*(tmp425_); double tmp3593_ = (tmp506_)*(tmp3527_); double tmp3594_ = tmp3592_-tmp3593_; double tmp3595_ = (tmp3594_)/tmp1192_; double tmp3596_ = (tmp3595_)*mLocCoeffV_B_2; double tmp3597_ = tmp3586_+tmp3596_; double tmp3598_ = (tmp3530_)*tmp349_; double tmp3599_ = (tmp3533_)*tmp351_; double tmp3600_ = tmp3598_+tmp3599_; double tmp3601_ = (tmp3536_)*tmp304_; double tmp3602_ = tmp3600_+tmp3601_; double tmp3603_ = (tmp3602_)*(tmp451_); double tmp3604_ = (tmp514_)*(tmp3541_); double tmp3605_ = tmp3603_-tmp3604_; double tmp3606_ = (tmp3605_)/tmp1196_; double tmp3607_ = (tmp3606_)*mLocCoeffU_B_3; double tmp3608_ = (tmp3530_)*(tmp361_); double tmp3609_ = (tmp3533_)*(tmp365_); double tmp3610_ = tmp3608_+tmp3609_; double tmp3611_ = (tmp3536_)*tmp368_; double tmp3612_ = tmp3610_+tmp3611_; double tmp3613_ = (tmp3612_)*(tmp451_); double tmp3614_ = (tmp522_)*(tmp3541_); double tmp3615_ = tmp3613_-tmp3614_; double tmp3616_ = (tmp3615_)/tmp1196_; double tmp3617_ = (tmp3616_)*mLocCoeffV_B_3; double tmp3618_ = tmp3607_+tmp3617_; double tmp3619_ = (tmp3544_)*tmp349_; double tmp3620_ = (tmp3547_)*tmp351_; double tmp3621_ = tmp3619_+tmp3620_; double tmp3622_ = (tmp3550_)*tmp304_; double tmp3623_ = tmp3621_+tmp3622_; double tmp3624_ = (tmp3623_)*(tmp477_); double tmp3625_ = (tmp530_)*(tmp3555_); double tmp3626_ = tmp3624_-tmp3625_; double tmp3627_ = (tmp3626_)/tmp1200_; double tmp3628_ = (tmp3627_)*mLocCoeffU_B_4; double tmp3629_ = (tmp3544_)*(tmp361_); double tmp3630_ = (tmp3547_)*(tmp365_); double tmp3631_ = tmp3629_+tmp3630_; double tmp3632_ = (tmp3550_)*tmp368_; double tmp3633_ = tmp3631_+tmp3632_; double tmp3634_ = (tmp3633_)*(tmp477_); double tmp3635_ = (tmp538_)*(tmp3555_); double tmp3636_ = tmp3634_-tmp3635_; double tmp3637_ = (tmp3636_)/tmp1200_; double tmp3638_ = (tmp3637_)*mLocCoeffV_B_4; double tmp3639_ = tmp3628_+tmp3638_; double tmp3640_ = tmp3499_+tmp3576_; double tmp3641_ = tmp3640_+tmp3597_; double tmp3642_ = tmp3641_+tmp3618_; double tmp3643_ = tmp3642_+tmp3639_; double tmp3644_ = (tmp3643_)*5; double tmp3645_ = (tmp3644_)/tmp681_; double tmp3646_ = mLocTimeRot*tmp19_; double tmp3647_ = tmp2067_*tmp15_; double tmp3648_ = -(tmp3646_); double tmp3649_ = tmp3647_*tmp14_; double tmp3650_ = tmp3646_*tmp18_; double tmp3651_ = tmp3649_+tmp3650_; double tmp3652_ = (tmp3651_)*mLocP3Y_A_0; double tmp3653_ = tmp3648_*tmp14_; double tmp3654_ = tmp3647_*tmp18_; double tmp3655_ = tmp3653_+tmp3654_; double tmp3656_ = (tmp3655_)*mLocP3Z_A_0; double tmp3657_ = tmp3652_+tmp3656_; double tmp3658_ = tmp3647_*tmp4_; double tmp3659_ = tmp3646_*tmp25_; double tmp3660_ = tmp3658_+tmp3659_; double tmp3661_ = (tmp3660_)*mLocP3Y_A_0; double tmp3662_ = tmp3648_*tmp4_; double tmp3663_ = tmp3647_*tmp25_; double tmp3664_ = tmp3662_+tmp3663_; double tmp3665_ = (tmp3664_)*mLocP3Z_A_0; double tmp3666_ = tmp3661_+tmp3665_; double tmp3667_ = tmp3646_*tmp23_; double tmp3668_ = tmp3667_*mLocP3Y_A_0; double tmp3669_ = tmp3647_*tmp23_; double tmp3670_ = tmp3669_*mLocP3Z_A_0; double tmp3671_ = tmp3668_+tmp3670_; double tmp3672_ = (tmp3657_)*(tmp91_); double tmp3673_ = (tmp3666_)*(tmp95_); double tmp3674_ = tmp3672_+tmp3673_; double tmp3675_ = (tmp3671_)*tmp98_; double tmp3676_ = tmp3674_+tmp3675_; double tmp3677_ = (tmp3657_)*tmp101_; double tmp3678_ = (tmp3666_)*tmp103_; double tmp3679_ = tmp3677_+tmp3678_; double tmp3680_ = (tmp3671_)*tmp28_; double tmp3681_ = tmp3679_+tmp3680_; double tmp3682_ = (tmp3681_)*(tmp100_); double tmp3683_ = (tmp107_)*(tmp3676_); double tmp3684_ = tmp3682_-tmp3683_; double tmp3685_ = (tmp3684_)/tmp559_; double tmp3686_ = (tmp3685_)*mLocCoeffU_A_0; double tmp3687_ = (tmp3657_)*(tmp113_); double tmp3688_ = (tmp3666_)*(tmp117_); double tmp3689_ = tmp3687_+tmp3688_; double tmp3690_ = (tmp3671_)*tmp120_; double tmp3691_ = tmp3689_+tmp3690_; double tmp3692_ = (tmp3691_)*(tmp100_); double tmp3693_ = (tmp122_)*(tmp3676_); double tmp3694_ = tmp3692_-tmp3693_; double tmp3695_ = (tmp3694_)/tmp559_; double tmp3696_ = (tmp3695_)*mLocCoeffV_A_0; double tmp3697_ = tmp3686_+tmp3696_; double tmp3698_ = (tmp3651_)*mLocP3Y_A_1; double tmp3699_ = (tmp3655_)*mLocP3Z_A_1; double tmp3700_ = tmp3698_+tmp3699_; double tmp3701_ = (tmp3660_)*mLocP3Y_A_1; double tmp3702_ = (tmp3664_)*mLocP3Z_A_1; double tmp3703_ = tmp3701_+tmp3702_; double tmp3704_ = tmp3667_*mLocP3Y_A_1; double tmp3705_ = tmp3669_*mLocP3Z_A_1; double tmp3706_ = tmp3704_+tmp3705_; double tmp3707_ = (tmp3700_)*(tmp91_); double tmp3708_ = (tmp3703_)*(tmp95_); double tmp3709_ = tmp3707_+tmp3708_; double tmp3710_ = (tmp3706_)*tmp98_; double tmp3711_ = tmp3709_+tmp3710_; double tmp3712_ = (tmp3651_)*mLocP3Y_A_2; double tmp3713_ = (tmp3655_)*mLocP3Z_A_2; double tmp3714_ = tmp3712_+tmp3713_; double tmp3715_ = (tmp3660_)*mLocP3Y_A_2; double tmp3716_ = (tmp3664_)*mLocP3Z_A_2; double tmp3717_ = tmp3715_+tmp3716_; double tmp3718_ = tmp3667_*mLocP3Y_A_2; double tmp3719_ = tmp3669_*mLocP3Z_A_2; double tmp3720_ = tmp3718_+tmp3719_; double tmp3721_ = (tmp3714_)*(tmp91_); double tmp3722_ = (tmp3717_)*(tmp95_); double tmp3723_ = tmp3721_+tmp3722_; double tmp3724_ = (tmp3720_)*tmp98_; double tmp3725_ = tmp3723_+tmp3724_; double tmp3726_ = (tmp3651_)*mLocP3Y_A_3; double tmp3727_ = (tmp3655_)*mLocP3Z_A_3; double tmp3728_ = tmp3726_+tmp3727_; double tmp3729_ = (tmp3660_)*mLocP3Y_A_3; double tmp3730_ = (tmp3664_)*mLocP3Z_A_3; double tmp3731_ = tmp3729_+tmp3730_; double tmp3732_ = tmp3667_*mLocP3Y_A_3; double tmp3733_ = tmp3669_*mLocP3Z_A_3; double tmp3734_ = tmp3732_+tmp3733_; double tmp3735_ = (tmp3728_)*(tmp91_); double tmp3736_ = (tmp3731_)*(tmp95_); double tmp3737_ = tmp3735_+tmp3736_; double tmp3738_ = (tmp3734_)*tmp98_; double tmp3739_ = tmp3737_+tmp3738_; double tmp3740_ = (tmp3651_)*mLocP3Y_A_4; double tmp3741_ = (tmp3655_)*mLocP3Z_A_4; double tmp3742_ = tmp3740_+tmp3741_; double tmp3743_ = (tmp3660_)*mLocP3Y_A_4; double tmp3744_ = (tmp3664_)*mLocP3Z_A_4; double tmp3745_ = tmp3743_+tmp3744_; double tmp3746_ = tmp3667_*mLocP3Y_A_4; double tmp3747_ = tmp3669_*mLocP3Z_A_4; double tmp3748_ = tmp3746_+tmp3747_; double tmp3749_ = (tmp3742_)*(tmp91_); double tmp3750_ = (tmp3745_)*(tmp95_); double tmp3751_ = tmp3749_+tmp3750_; double tmp3752_ = (tmp3748_)*tmp98_; double tmp3753_ = tmp3751_+tmp3752_; double tmp3754_ = (tmp3700_)*tmp101_; double tmp3755_ = (tmp3703_)*tmp103_; double tmp3756_ = tmp3754_+tmp3755_; double tmp3757_ = (tmp3706_)*tmp28_; double tmp3758_ = tmp3756_+tmp3757_; double tmp3759_ = (tmp3758_)*(tmp151_); double tmp3760_ = (tmp234_)*(tmp3711_); double tmp3761_ = tmp3759_-tmp3760_; double tmp3762_ = (tmp3761_)/tmp586_; double tmp3763_ = (tmp3762_)*mLocCoeffU_A_1; double tmp3764_ = (tmp3700_)*(tmp113_); double tmp3765_ = (tmp3703_)*(tmp117_); double tmp3766_ = tmp3764_+tmp3765_; double tmp3767_ = (tmp3706_)*tmp120_; double tmp3768_ = tmp3766_+tmp3767_; double tmp3769_ = (tmp3768_)*(tmp151_); double tmp3770_ = (tmp242_)*(tmp3711_); double tmp3771_ = tmp3769_-tmp3770_; double tmp3772_ = (tmp3771_)/tmp586_; double tmp3773_ = (tmp3772_)*mLocCoeffV_A_1; double tmp3774_ = tmp3763_+tmp3773_; double tmp3775_ = (tmp3714_)*tmp101_; double tmp3776_ = (tmp3717_)*tmp103_; double tmp3777_ = tmp3775_+tmp3776_; double tmp3778_ = (tmp3720_)*tmp28_; double tmp3779_ = tmp3777_+tmp3778_; double tmp3780_ = (tmp3779_)*(tmp177_); double tmp3781_ = (tmp250_)*(tmp3725_); double tmp3782_ = tmp3780_-tmp3781_; double tmp3783_ = (tmp3782_)/tmp590_; double tmp3784_ = (tmp3783_)*mLocCoeffU_A_2; double tmp3785_ = (tmp3714_)*(tmp113_); double tmp3786_ = (tmp3717_)*(tmp117_); double tmp3787_ = tmp3785_+tmp3786_; double tmp3788_ = (tmp3720_)*tmp120_; double tmp3789_ = tmp3787_+tmp3788_; double tmp3790_ = (tmp3789_)*(tmp177_); double tmp3791_ = (tmp258_)*(tmp3725_); double tmp3792_ = tmp3790_-tmp3791_; double tmp3793_ = (tmp3792_)/tmp590_; double tmp3794_ = (tmp3793_)*mLocCoeffV_A_2; double tmp3795_ = tmp3784_+tmp3794_; double tmp3796_ = (tmp3728_)*tmp101_; double tmp3797_ = (tmp3731_)*tmp103_; double tmp3798_ = tmp3796_+tmp3797_; double tmp3799_ = (tmp3734_)*tmp28_; double tmp3800_ = tmp3798_+tmp3799_; double tmp3801_ = (tmp3800_)*(tmp203_); double tmp3802_ = (tmp266_)*(tmp3739_); double tmp3803_ = tmp3801_-tmp3802_; double tmp3804_ = (tmp3803_)/tmp594_; double tmp3805_ = (tmp3804_)*mLocCoeffU_A_3; double tmp3806_ = (tmp3728_)*(tmp113_); double tmp3807_ = (tmp3731_)*(tmp117_); double tmp3808_ = tmp3806_+tmp3807_; double tmp3809_ = (tmp3734_)*tmp120_; double tmp3810_ = tmp3808_+tmp3809_; double tmp3811_ = (tmp3810_)*(tmp203_); double tmp3812_ = (tmp274_)*(tmp3739_); double tmp3813_ = tmp3811_-tmp3812_; double tmp3814_ = (tmp3813_)/tmp594_; double tmp3815_ = (tmp3814_)*mLocCoeffV_A_3; double tmp3816_ = tmp3805_+tmp3815_; double tmp3817_ = (tmp3742_)*tmp101_; double tmp3818_ = (tmp3745_)*tmp103_; double tmp3819_ = tmp3817_+tmp3818_; double tmp3820_ = (tmp3748_)*tmp28_; double tmp3821_ = tmp3819_+tmp3820_; double tmp3822_ = (tmp3821_)*(tmp229_); double tmp3823_ = (tmp282_)*(tmp3753_); double tmp3824_ = tmp3822_-tmp3823_; double tmp3825_ = (tmp3824_)/tmp598_; double tmp3826_ = (tmp3825_)*mLocCoeffU_A_4; double tmp3827_ = (tmp3742_)*(tmp113_); double tmp3828_ = (tmp3745_)*(tmp117_); double tmp3829_ = tmp3827_+tmp3828_; double tmp3830_ = (tmp3748_)*tmp120_; double tmp3831_ = tmp3829_+tmp3830_; double tmp3832_ = (tmp3831_)*(tmp229_); double tmp3833_ = (tmp290_)*(tmp3753_); double tmp3834_ = tmp3832_-tmp3833_; double tmp3835_ = (tmp3834_)/tmp598_; double tmp3836_ = (tmp3835_)*mLocCoeffV_A_4; double tmp3837_ = tmp3826_+tmp3836_; double tmp3838_ = tmp3697_+tmp3774_; double tmp3839_ = tmp3838_+tmp3795_; double tmp3840_ = tmp3839_+tmp3816_; double tmp3841_ = tmp3840_+tmp3837_; double tmp3842_ = (tmp3841_)*5; double tmp3843_ = (tmp3842_)/tmp681_; double tmp3844_ = (tmp3651_)*mLocP3Y_B_0; double tmp3845_ = (tmp3655_)*mLocP3Z_B_0; double tmp3846_ = tmp3844_+tmp3845_; double tmp3847_ = (tmp3660_)*mLocP3Y_B_0; double tmp3848_ = (tmp3664_)*mLocP3Z_B_0; double tmp3849_ = tmp3847_+tmp3848_; double tmp3850_ = tmp3667_*mLocP3Y_B_0; double tmp3851_ = tmp3669_*mLocP3Z_B_0; double tmp3852_ = tmp3850_+tmp3851_; double tmp3853_ = (tmp3846_)*(tmp339_); double tmp3854_ = (tmp3849_)*(tmp343_); double tmp3855_ = tmp3853_+tmp3854_; double tmp3856_ = (tmp3852_)*tmp346_; double tmp3857_ = tmp3855_+tmp3856_; double tmp3858_ = (tmp3846_)*tmp349_; double tmp3859_ = (tmp3849_)*tmp351_; double tmp3860_ = tmp3858_+tmp3859_; double tmp3861_ = (tmp3852_)*tmp304_; double tmp3862_ = tmp3860_+tmp3861_; double tmp3863_ = (tmp3862_)*(tmp348_); double tmp3864_ = (tmp355_)*(tmp3857_); double tmp3865_ = tmp3863_-tmp3864_; double tmp3866_ = (tmp3865_)/tmp1161_; double tmp3867_ = (tmp3866_)*mLocCoeffU_B_0; double tmp3868_ = (tmp3846_)*(tmp361_); double tmp3869_ = (tmp3849_)*(tmp365_); double tmp3870_ = tmp3868_+tmp3869_; double tmp3871_ = (tmp3852_)*tmp368_; double tmp3872_ = tmp3870_+tmp3871_; double tmp3873_ = (tmp3872_)*(tmp348_); double tmp3874_ = (tmp370_)*(tmp3857_); double tmp3875_ = tmp3873_-tmp3874_; double tmp3876_ = (tmp3875_)/tmp1161_; double tmp3877_ = (tmp3876_)*mLocCoeffV_B_0; double tmp3878_ = tmp3867_+tmp3877_; double tmp3879_ = (tmp3651_)*mLocP3Y_B_1; double tmp3880_ = (tmp3655_)*mLocP3Z_B_1; double tmp3881_ = tmp3879_+tmp3880_; double tmp3882_ = (tmp3660_)*mLocP3Y_B_1; double tmp3883_ = (tmp3664_)*mLocP3Z_B_1; double tmp3884_ = tmp3882_+tmp3883_; double tmp3885_ = tmp3667_*mLocP3Y_B_1; double tmp3886_ = tmp3669_*mLocP3Z_B_1; double tmp3887_ = tmp3885_+tmp3886_; double tmp3888_ = (tmp3881_)*(tmp339_); double tmp3889_ = (tmp3884_)*(tmp343_); double tmp3890_ = tmp3888_+tmp3889_; double tmp3891_ = (tmp3887_)*tmp346_; double tmp3892_ = tmp3890_+tmp3891_; double tmp3893_ = (tmp3651_)*mLocP3Y_B_2; double tmp3894_ = (tmp3655_)*mLocP3Z_B_2; double tmp3895_ = tmp3893_+tmp3894_; double tmp3896_ = (tmp3660_)*mLocP3Y_B_2; double tmp3897_ = (tmp3664_)*mLocP3Z_B_2; double tmp3898_ = tmp3896_+tmp3897_; double tmp3899_ = tmp3667_*mLocP3Y_B_2; double tmp3900_ = tmp3669_*mLocP3Z_B_2; double tmp3901_ = tmp3899_+tmp3900_; double tmp3902_ = (tmp3895_)*(tmp339_); double tmp3903_ = (tmp3898_)*(tmp343_); double tmp3904_ = tmp3902_+tmp3903_; double tmp3905_ = (tmp3901_)*tmp346_; double tmp3906_ = tmp3904_+tmp3905_; double tmp3907_ = (tmp3651_)*mLocP3Y_B_3; double tmp3908_ = (tmp3655_)*mLocP3Z_B_3; double tmp3909_ = tmp3907_+tmp3908_; double tmp3910_ = (tmp3660_)*mLocP3Y_B_3; double tmp3911_ = (tmp3664_)*mLocP3Z_B_3; double tmp3912_ = tmp3910_+tmp3911_; double tmp3913_ = tmp3667_*mLocP3Y_B_3; double tmp3914_ = tmp3669_*mLocP3Z_B_3; double tmp3915_ = tmp3913_+tmp3914_; double tmp3916_ = (tmp3909_)*(tmp339_); double tmp3917_ = (tmp3912_)*(tmp343_); double tmp3918_ = tmp3916_+tmp3917_; double tmp3919_ = (tmp3915_)*tmp346_; double tmp3920_ = tmp3918_+tmp3919_; double tmp3921_ = (tmp3651_)*mLocP3Y_B_4; double tmp3922_ = (tmp3655_)*mLocP3Z_B_4; double tmp3923_ = tmp3921_+tmp3922_; double tmp3924_ = (tmp3660_)*mLocP3Y_B_4; double tmp3925_ = (tmp3664_)*mLocP3Z_B_4; double tmp3926_ = tmp3924_+tmp3925_; double tmp3927_ = tmp3667_*mLocP3Y_B_4; double tmp3928_ = tmp3669_*mLocP3Z_B_4; double tmp3929_ = tmp3927_+tmp3928_; double tmp3930_ = (tmp3923_)*(tmp339_); double tmp3931_ = (tmp3926_)*(tmp343_); double tmp3932_ = tmp3930_+tmp3931_; double tmp3933_ = (tmp3929_)*tmp346_; double tmp3934_ = tmp3932_+tmp3933_; double tmp3935_ = (tmp3881_)*tmp349_; double tmp3936_ = (tmp3884_)*tmp351_; double tmp3937_ = tmp3935_+tmp3936_; double tmp3938_ = (tmp3887_)*tmp304_; double tmp3939_ = tmp3937_+tmp3938_; double tmp3940_ = (tmp3939_)*(tmp399_); double tmp3941_ = (tmp482_)*(tmp3892_); double tmp3942_ = tmp3940_-tmp3941_; double tmp3943_ = (tmp3942_)/tmp1188_; double tmp3944_ = (tmp3943_)*mLocCoeffU_B_1; double tmp3945_ = (tmp3881_)*(tmp361_); double tmp3946_ = (tmp3884_)*(tmp365_); double tmp3947_ = tmp3945_+tmp3946_; double tmp3948_ = (tmp3887_)*tmp368_; double tmp3949_ = tmp3947_+tmp3948_; double tmp3950_ = (tmp3949_)*(tmp399_); double tmp3951_ = (tmp490_)*(tmp3892_); double tmp3952_ = tmp3950_-tmp3951_; double tmp3953_ = (tmp3952_)/tmp1188_; double tmp3954_ = (tmp3953_)*mLocCoeffV_B_1; double tmp3955_ = tmp3944_+tmp3954_; double tmp3956_ = (tmp3895_)*tmp349_; double tmp3957_ = (tmp3898_)*tmp351_; double tmp3958_ = tmp3956_+tmp3957_; double tmp3959_ = (tmp3901_)*tmp304_; double tmp3960_ = tmp3958_+tmp3959_; double tmp3961_ = (tmp3960_)*(tmp425_); double tmp3962_ = (tmp498_)*(tmp3906_); double tmp3963_ = tmp3961_-tmp3962_; double tmp3964_ = (tmp3963_)/tmp1192_; double tmp3965_ = (tmp3964_)*mLocCoeffU_B_2; double tmp3966_ = (tmp3895_)*(tmp361_); double tmp3967_ = (tmp3898_)*(tmp365_); double tmp3968_ = tmp3966_+tmp3967_; double tmp3969_ = (tmp3901_)*tmp368_; double tmp3970_ = tmp3968_+tmp3969_; double tmp3971_ = (tmp3970_)*(tmp425_); double tmp3972_ = (tmp506_)*(tmp3906_); double tmp3973_ = tmp3971_-tmp3972_; double tmp3974_ = (tmp3973_)/tmp1192_; double tmp3975_ = (tmp3974_)*mLocCoeffV_B_2; double tmp3976_ = tmp3965_+tmp3975_; double tmp3977_ = (tmp3909_)*tmp349_; double tmp3978_ = (tmp3912_)*tmp351_; double tmp3979_ = tmp3977_+tmp3978_; double tmp3980_ = (tmp3915_)*tmp304_; double tmp3981_ = tmp3979_+tmp3980_; double tmp3982_ = (tmp3981_)*(tmp451_); double tmp3983_ = (tmp514_)*(tmp3920_); double tmp3984_ = tmp3982_-tmp3983_; double tmp3985_ = (tmp3984_)/tmp1196_; double tmp3986_ = (tmp3985_)*mLocCoeffU_B_3; double tmp3987_ = (tmp3909_)*(tmp361_); double tmp3988_ = (tmp3912_)*(tmp365_); double tmp3989_ = tmp3987_+tmp3988_; double tmp3990_ = (tmp3915_)*tmp368_; double tmp3991_ = tmp3989_+tmp3990_; double tmp3992_ = (tmp3991_)*(tmp451_); double tmp3993_ = (tmp522_)*(tmp3920_); double tmp3994_ = tmp3992_-tmp3993_; double tmp3995_ = (tmp3994_)/tmp1196_; double tmp3996_ = (tmp3995_)*mLocCoeffV_B_3; double tmp3997_ = tmp3986_+tmp3996_; double tmp3998_ = (tmp3923_)*tmp349_; double tmp3999_ = (tmp3926_)*tmp351_; double tmp4000_ = tmp3998_+tmp3999_; double tmp4001_ = (tmp3929_)*tmp304_; double tmp4002_ = tmp4000_+tmp4001_; double tmp4003_ = (tmp4002_)*(tmp477_); double tmp4004_ = (tmp530_)*(tmp3934_); double tmp4005_ = tmp4003_-tmp4004_; double tmp4006_ = (tmp4005_)/tmp1200_; double tmp4007_ = (tmp4006_)*mLocCoeffU_B_4; double tmp4008_ = (tmp3923_)*(tmp361_); double tmp4009_ = (tmp3926_)*(tmp365_); double tmp4010_ = tmp4008_+tmp4009_; double tmp4011_ = (tmp3929_)*tmp368_; double tmp4012_ = tmp4010_+tmp4011_; double tmp4013_ = (tmp4012_)*(tmp477_); double tmp4014_ = (tmp538_)*(tmp3934_); double tmp4015_ = tmp4013_-tmp4014_; double tmp4016_ = (tmp4015_)/tmp1200_; double tmp4017_ = (tmp4016_)*mLocCoeffV_B_4; double tmp4018_ = tmp4007_+tmp4017_; double tmp4019_ = tmp3878_+tmp3955_; double tmp4020_ = tmp4019_+tmp3976_; double tmp4021_ = tmp4020_+tmp3997_; double tmp4022_ = tmp4021_+tmp4018_; double tmp4023_ = (tmp4022_)*5; double tmp4024_ = (tmp4023_)/tmp681_; double tmp4025_ = tmp101_*(tmp100_); double tmp4026_ = (tmp107_)*(tmp91_); double tmp4027_ = tmp4025_-tmp4026_; double tmp4028_ = (tmp4027_)/tmp559_; double tmp4029_ = (tmp4028_)*mLocCoeffU_A_0; double tmp4030_ = (tmp113_)*(tmp100_); double tmp4031_ = (tmp122_)*(tmp91_); double tmp4032_ = tmp4030_-tmp4031_; double tmp4033_ = (tmp4032_)/tmp559_; double tmp4034_ = (tmp4033_)*mLocCoeffV_A_0; double tmp4035_ = tmp4029_+tmp4034_; double tmp4036_ = tmp101_*(tmp151_); double tmp4037_ = (tmp234_)*(tmp91_); double tmp4038_ = tmp4036_-tmp4037_; double tmp4039_ = (tmp4038_)/tmp586_; double tmp4040_ = (tmp4039_)*mLocCoeffU_A_1; double tmp4041_ = (tmp113_)*(tmp151_); double tmp4042_ = (tmp242_)*(tmp91_); double tmp4043_ = tmp4041_-tmp4042_; double tmp4044_ = (tmp4043_)/tmp586_; double tmp4045_ = (tmp4044_)*mLocCoeffV_A_1; double tmp4046_ = tmp4040_+tmp4045_; double tmp4047_ = tmp101_*(tmp177_); double tmp4048_ = (tmp250_)*(tmp91_); double tmp4049_ = tmp4047_-tmp4048_; double tmp4050_ = (tmp4049_)/tmp590_; double tmp4051_ = (tmp4050_)*mLocCoeffU_A_2; double tmp4052_ = (tmp113_)*(tmp177_); double tmp4053_ = (tmp258_)*(tmp91_); double tmp4054_ = tmp4052_-tmp4053_; double tmp4055_ = (tmp4054_)/tmp590_; double tmp4056_ = (tmp4055_)*mLocCoeffV_A_2; double tmp4057_ = tmp4051_+tmp4056_; double tmp4058_ = tmp101_*(tmp203_); double tmp4059_ = (tmp266_)*(tmp91_); double tmp4060_ = tmp4058_-tmp4059_; double tmp4061_ = (tmp4060_)/tmp594_; double tmp4062_ = (tmp4061_)*mLocCoeffU_A_3; double tmp4063_ = (tmp113_)*(tmp203_); double tmp4064_ = (tmp274_)*(tmp91_); double tmp4065_ = tmp4063_-tmp4064_; double tmp4066_ = (tmp4065_)/tmp594_; double tmp4067_ = (tmp4066_)*mLocCoeffV_A_3; double tmp4068_ = tmp4062_+tmp4067_; double tmp4069_ = tmp101_*(tmp229_); double tmp4070_ = (tmp282_)*(tmp91_); double tmp4071_ = tmp4069_-tmp4070_; double tmp4072_ = (tmp4071_)/tmp598_; double tmp4073_ = (tmp4072_)*mLocCoeffU_A_4; double tmp4074_ = (tmp113_)*(tmp229_); double tmp4075_ = (tmp290_)*(tmp91_); double tmp4076_ = tmp4074_-tmp4075_; double tmp4077_ = (tmp4076_)/tmp598_; double tmp4078_ = (tmp4077_)*mLocCoeffV_A_4; double tmp4079_ = tmp4073_+tmp4078_; double tmp4080_ = tmp4035_+tmp4046_; double tmp4081_ = tmp4080_+tmp4057_; double tmp4082_ = tmp4081_+tmp4068_; double tmp4083_ = tmp4082_+tmp4079_; double tmp4084_ = (tmp4083_)*5; double tmp4085_ = (tmp4084_)/tmp681_; double tmp4086_ = tmp349_*(tmp348_); double tmp4087_ = (tmp355_)*(tmp339_); double tmp4088_ = tmp4086_-tmp4087_; double tmp4089_ = (tmp4088_)/tmp1161_; double tmp4090_ = (tmp4089_)*mLocCoeffU_B_0; double tmp4091_ = (tmp361_)*(tmp348_); double tmp4092_ = (tmp370_)*(tmp339_); double tmp4093_ = tmp4091_-tmp4092_; double tmp4094_ = (tmp4093_)/tmp1161_; double tmp4095_ = (tmp4094_)*mLocCoeffV_B_0; double tmp4096_ = tmp4090_+tmp4095_; double tmp4097_ = tmp349_*(tmp399_); double tmp4098_ = (tmp482_)*(tmp339_); double tmp4099_ = tmp4097_-tmp4098_; double tmp4100_ = (tmp4099_)/tmp1188_; double tmp4101_ = (tmp4100_)*mLocCoeffU_B_1; double tmp4102_ = (tmp361_)*(tmp399_); double tmp4103_ = (tmp490_)*(tmp339_); double tmp4104_ = tmp4102_-tmp4103_; double tmp4105_ = (tmp4104_)/tmp1188_; double tmp4106_ = (tmp4105_)*mLocCoeffV_B_1; double tmp4107_ = tmp4101_+tmp4106_; double tmp4108_ = tmp349_*(tmp425_); double tmp4109_ = (tmp498_)*(tmp339_); double tmp4110_ = tmp4108_-tmp4109_; double tmp4111_ = (tmp4110_)/tmp1192_; double tmp4112_ = (tmp4111_)*mLocCoeffU_B_2; double tmp4113_ = (tmp361_)*(tmp425_); double tmp4114_ = (tmp506_)*(tmp339_); double tmp4115_ = tmp4113_-tmp4114_; double tmp4116_ = (tmp4115_)/tmp1192_; double tmp4117_ = (tmp4116_)*mLocCoeffV_B_2; double tmp4118_ = tmp4112_+tmp4117_; double tmp4119_ = tmp349_*(tmp451_); double tmp4120_ = (tmp514_)*(tmp339_); double tmp4121_ = tmp4119_-tmp4120_; double tmp4122_ = (tmp4121_)/tmp1196_; double tmp4123_ = (tmp4122_)*mLocCoeffU_B_3; double tmp4124_ = (tmp361_)*(tmp451_); double tmp4125_ = (tmp522_)*(tmp339_); double tmp4126_ = tmp4124_-tmp4125_; double tmp4127_ = (tmp4126_)/tmp1196_; double tmp4128_ = (tmp4127_)*mLocCoeffV_B_3; double tmp4129_ = tmp4123_+tmp4128_; double tmp4130_ = tmp349_*(tmp477_); double tmp4131_ = (tmp530_)*(tmp339_); double tmp4132_ = tmp4130_-tmp4131_; double tmp4133_ = (tmp4132_)/tmp1200_; double tmp4134_ = (tmp4133_)*mLocCoeffU_B_4; double tmp4135_ = (tmp361_)*(tmp477_); double tmp4136_ = (tmp538_)*(tmp339_); double tmp4137_ = tmp4135_-tmp4136_; double tmp4138_ = (tmp4137_)/tmp1200_; double tmp4139_ = (tmp4138_)*mLocCoeffV_B_4; double tmp4140_ = tmp4134_+tmp4139_; double tmp4141_ = tmp4096_+tmp4107_; double tmp4142_ = tmp4141_+tmp4118_; double tmp4143_ = tmp4142_+tmp4129_; double tmp4144_ = tmp4143_+tmp4140_; double tmp4145_ = (tmp4144_)*5; double tmp4146_ = (tmp4145_)/tmp681_; double tmp4147_ = mLocTimeRot*(tmp91_); double tmp4148_ = mLocTimeRot*tmp101_; double tmp4149_ = tmp4148_*(tmp100_); double tmp4150_ = (tmp107_)*tmp4147_; double tmp4151_ = tmp4149_-tmp4150_; double tmp4152_ = (tmp4151_)/tmp559_; double tmp4153_ = (tmp4152_)*mLocCoeffU_A_0; double tmp4154_ = mLocTimeRot*(tmp113_); double tmp4155_ = tmp4154_*(tmp100_); double tmp4156_ = (tmp122_)*tmp4147_; double tmp4157_ = tmp4155_-tmp4156_; double tmp4158_ = (tmp4157_)/tmp559_; double tmp4159_ = (tmp4158_)*mLocCoeffV_A_0; double tmp4160_ = tmp4153_+tmp4159_; double tmp4161_ = tmp4148_*(tmp151_); double tmp4162_ = (tmp234_)*tmp4147_; double tmp4163_ = tmp4161_-tmp4162_; double tmp4164_ = (tmp4163_)/tmp586_; double tmp4165_ = (tmp4164_)*mLocCoeffU_A_1; double tmp4166_ = tmp4154_*(tmp151_); double tmp4167_ = (tmp242_)*tmp4147_; double tmp4168_ = tmp4166_-tmp4167_; double tmp4169_ = (tmp4168_)/tmp586_; double tmp4170_ = (tmp4169_)*mLocCoeffV_A_1; double tmp4171_ = tmp4165_+tmp4170_; double tmp4172_ = tmp4148_*(tmp177_); double tmp4173_ = (tmp250_)*tmp4147_; double tmp4174_ = tmp4172_-tmp4173_; double tmp4175_ = (tmp4174_)/tmp590_; double tmp4176_ = (tmp4175_)*mLocCoeffU_A_2; double tmp4177_ = tmp4154_*(tmp177_); double tmp4178_ = (tmp258_)*tmp4147_; double tmp4179_ = tmp4177_-tmp4178_; double tmp4180_ = (tmp4179_)/tmp590_; double tmp4181_ = (tmp4180_)*mLocCoeffV_A_2; double tmp4182_ = tmp4176_+tmp4181_; double tmp4183_ = tmp4148_*(tmp203_); double tmp4184_ = (tmp266_)*tmp4147_; double tmp4185_ = tmp4183_-tmp4184_; double tmp4186_ = (tmp4185_)/tmp594_; double tmp4187_ = (tmp4186_)*mLocCoeffU_A_3; double tmp4188_ = tmp4154_*(tmp203_); double tmp4189_ = (tmp274_)*tmp4147_; double tmp4190_ = tmp4188_-tmp4189_; double tmp4191_ = (tmp4190_)/tmp594_; double tmp4192_ = (tmp4191_)*mLocCoeffV_A_3; double tmp4193_ = tmp4187_+tmp4192_; double tmp4194_ = tmp4148_*(tmp229_); double tmp4195_ = (tmp282_)*tmp4147_; double tmp4196_ = tmp4194_-tmp4195_; double tmp4197_ = (tmp4196_)/tmp598_; double tmp4198_ = (tmp4197_)*mLocCoeffU_A_4; double tmp4199_ = tmp4154_*(tmp229_); double tmp4200_ = (tmp290_)*tmp4147_; double tmp4201_ = tmp4199_-tmp4200_; double tmp4202_ = (tmp4201_)/tmp598_; double tmp4203_ = (tmp4202_)*mLocCoeffV_A_4; double tmp4204_ = tmp4198_+tmp4203_; double tmp4205_ = tmp4160_+tmp4171_; double tmp4206_ = tmp4205_+tmp4182_; double tmp4207_ = tmp4206_+tmp4193_; double tmp4208_ = tmp4207_+tmp4204_; double tmp4209_ = (tmp4208_)*5; double tmp4210_ = (tmp4209_)/tmp681_; double tmp4211_ = mLocTimeRot*(tmp339_); double tmp4212_ = mLocTimeRot*tmp349_; double tmp4213_ = tmp4212_*(tmp348_); double tmp4214_ = (tmp355_)*tmp4211_; double tmp4215_ = tmp4213_-tmp4214_; double tmp4216_ = (tmp4215_)/tmp1161_; double tmp4217_ = (tmp4216_)*mLocCoeffU_B_0; double tmp4218_ = mLocTimeRot*(tmp361_); double tmp4219_ = tmp4218_*(tmp348_); double tmp4220_ = (tmp370_)*tmp4211_; double tmp4221_ = tmp4219_-tmp4220_; double tmp4222_ = (tmp4221_)/tmp1161_; double tmp4223_ = (tmp4222_)*mLocCoeffV_B_0; double tmp4224_ = tmp4217_+tmp4223_; double tmp4225_ = tmp4212_*(tmp399_); double tmp4226_ = (tmp482_)*tmp4211_; double tmp4227_ = tmp4225_-tmp4226_; double tmp4228_ = (tmp4227_)/tmp1188_; double tmp4229_ = (tmp4228_)*mLocCoeffU_B_1; double tmp4230_ = tmp4218_*(tmp399_); double tmp4231_ = (tmp490_)*tmp4211_; double tmp4232_ = tmp4230_-tmp4231_; double tmp4233_ = (tmp4232_)/tmp1188_; double tmp4234_ = (tmp4233_)*mLocCoeffV_B_1; double tmp4235_ = tmp4229_+tmp4234_; double tmp4236_ = tmp4212_*(tmp425_); double tmp4237_ = (tmp498_)*tmp4211_; double tmp4238_ = tmp4236_-tmp4237_; double tmp4239_ = (tmp4238_)/tmp1192_; double tmp4240_ = (tmp4239_)*mLocCoeffU_B_2; double tmp4241_ = tmp4218_*(tmp425_); double tmp4242_ = (tmp506_)*tmp4211_; double tmp4243_ = tmp4241_-tmp4242_; double tmp4244_ = (tmp4243_)/tmp1192_; double tmp4245_ = (tmp4244_)*mLocCoeffV_B_2; double tmp4246_ = tmp4240_+tmp4245_; double tmp4247_ = tmp4212_*(tmp451_); double tmp4248_ = (tmp514_)*tmp4211_; double tmp4249_ = tmp4247_-tmp4248_; double tmp4250_ = (tmp4249_)/tmp1196_; double tmp4251_ = (tmp4250_)*mLocCoeffU_B_3; double tmp4252_ = tmp4218_*(tmp451_); double tmp4253_ = (tmp522_)*tmp4211_; double tmp4254_ = tmp4252_-tmp4253_; double tmp4255_ = (tmp4254_)/tmp1196_; double tmp4256_ = (tmp4255_)*mLocCoeffV_B_3; double tmp4257_ = tmp4251_+tmp4256_; double tmp4258_ = tmp4212_*(tmp477_); double tmp4259_ = (tmp530_)*tmp4211_; double tmp4260_ = tmp4258_-tmp4259_; double tmp4261_ = (tmp4260_)/tmp1200_; double tmp4262_ = (tmp4261_)*mLocCoeffU_B_4; double tmp4263_ = tmp4218_*(tmp477_); double tmp4264_ = (tmp538_)*tmp4211_; double tmp4265_ = tmp4263_-tmp4264_; double tmp4266_ = (tmp4265_)/tmp1200_; double tmp4267_ = (tmp4266_)*mLocCoeffV_B_4; double tmp4268_ = tmp4262_+tmp4267_; double tmp4269_ = tmp4224_+tmp4235_; double tmp4270_ = tmp4269_+tmp4246_; double tmp4271_ = tmp4270_+tmp4257_; double tmp4272_ = tmp4271_+tmp4268_; double tmp4273_ = (tmp4272_)*5; double tmp4274_ = (tmp4273_)/tmp681_; double tmp4275_ = tmp103_*(tmp100_); double tmp4276_ = (tmp107_)*(tmp95_); double tmp4277_ = tmp4275_-tmp4276_; double tmp4278_ = (tmp4277_)/tmp559_; double tmp4279_ = (tmp4278_)*mLocCoeffU_A_0; double tmp4280_ = (tmp117_)*(tmp100_); double tmp4281_ = (tmp122_)*(tmp95_); double tmp4282_ = tmp4280_-tmp4281_; double tmp4283_ = (tmp4282_)/tmp559_; double tmp4284_ = (tmp4283_)*mLocCoeffV_A_0; double tmp4285_ = tmp4279_+tmp4284_; double tmp4286_ = tmp103_*(tmp151_); double tmp4287_ = (tmp234_)*(tmp95_); double tmp4288_ = tmp4286_-tmp4287_; double tmp4289_ = (tmp4288_)/tmp586_; double tmp4290_ = (tmp4289_)*mLocCoeffU_A_1; double tmp4291_ = (tmp117_)*(tmp151_); double tmp4292_ = (tmp242_)*(tmp95_); double tmp4293_ = tmp4291_-tmp4292_; double tmp4294_ = (tmp4293_)/tmp586_; double tmp4295_ = (tmp4294_)*mLocCoeffV_A_1; double tmp4296_ = tmp4290_+tmp4295_; double tmp4297_ = tmp103_*(tmp177_); double tmp4298_ = (tmp250_)*(tmp95_); double tmp4299_ = tmp4297_-tmp4298_; double tmp4300_ = (tmp4299_)/tmp590_; double tmp4301_ = (tmp4300_)*mLocCoeffU_A_2; double tmp4302_ = (tmp117_)*(tmp177_); double tmp4303_ = (tmp258_)*(tmp95_); double tmp4304_ = tmp4302_-tmp4303_; double tmp4305_ = (tmp4304_)/tmp590_; double tmp4306_ = (tmp4305_)*mLocCoeffV_A_2; double tmp4307_ = tmp4301_+tmp4306_; double tmp4308_ = tmp103_*(tmp203_); double tmp4309_ = (tmp266_)*(tmp95_); double tmp4310_ = tmp4308_-tmp4309_; double tmp4311_ = (tmp4310_)/tmp594_; double tmp4312_ = (tmp4311_)*mLocCoeffU_A_3; double tmp4313_ = (tmp117_)*(tmp203_); double tmp4314_ = (tmp274_)*(tmp95_); double tmp4315_ = tmp4313_-tmp4314_; double tmp4316_ = (tmp4315_)/tmp594_; double tmp4317_ = (tmp4316_)*mLocCoeffV_A_3; double tmp4318_ = tmp4312_+tmp4317_; double tmp4319_ = tmp103_*(tmp229_); double tmp4320_ = (tmp282_)*(tmp95_); double tmp4321_ = tmp4319_-tmp4320_; double tmp4322_ = (tmp4321_)/tmp598_; double tmp4323_ = (tmp4322_)*mLocCoeffU_A_4; double tmp4324_ = (tmp117_)*(tmp229_); double tmp4325_ = (tmp290_)*(tmp95_); double tmp4326_ = tmp4324_-tmp4325_; double tmp4327_ = (tmp4326_)/tmp598_; double tmp4328_ = (tmp4327_)*mLocCoeffV_A_4; double tmp4329_ = tmp4323_+tmp4328_; double tmp4330_ = tmp4285_+tmp4296_; double tmp4331_ = tmp4330_+tmp4307_; double tmp4332_ = tmp4331_+tmp4318_; double tmp4333_ = tmp4332_+tmp4329_; double tmp4334_ = (tmp4333_)*5; double tmp4335_ = (tmp4334_)/tmp681_; double tmp4336_ = tmp351_*(tmp348_); double tmp4337_ = (tmp355_)*(tmp343_); double tmp4338_ = tmp4336_-tmp4337_; double tmp4339_ = (tmp4338_)/tmp1161_; double tmp4340_ = (tmp4339_)*mLocCoeffU_B_0; double tmp4341_ = (tmp365_)*(tmp348_); double tmp4342_ = (tmp370_)*(tmp343_); double tmp4343_ = tmp4341_-tmp4342_; double tmp4344_ = (tmp4343_)/tmp1161_; double tmp4345_ = (tmp4344_)*mLocCoeffV_B_0; double tmp4346_ = tmp4340_+tmp4345_; double tmp4347_ = tmp351_*(tmp399_); double tmp4348_ = (tmp482_)*(tmp343_); double tmp4349_ = tmp4347_-tmp4348_; double tmp4350_ = (tmp4349_)/tmp1188_; double tmp4351_ = (tmp4350_)*mLocCoeffU_B_1; double tmp4352_ = (tmp365_)*(tmp399_); double tmp4353_ = (tmp490_)*(tmp343_); double tmp4354_ = tmp4352_-tmp4353_; double tmp4355_ = (tmp4354_)/tmp1188_; double tmp4356_ = (tmp4355_)*mLocCoeffV_B_1; double tmp4357_ = tmp4351_+tmp4356_; double tmp4358_ = tmp351_*(tmp425_); double tmp4359_ = (tmp498_)*(tmp343_); double tmp4360_ = tmp4358_-tmp4359_; double tmp4361_ = (tmp4360_)/tmp1192_; double tmp4362_ = (tmp4361_)*mLocCoeffU_B_2; double tmp4363_ = (tmp365_)*(tmp425_); double tmp4364_ = (tmp506_)*(tmp343_); double tmp4365_ = tmp4363_-tmp4364_; double tmp4366_ = (tmp4365_)/tmp1192_; double tmp4367_ = (tmp4366_)*mLocCoeffV_B_2; double tmp4368_ = tmp4362_+tmp4367_; double tmp4369_ = tmp351_*(tmp451_); double tmp4370_ = (tmp514_)*(tmp343_); double tmp4371_ = tmp4369_-tmp4370_; double tmp4372_ = (tmp4371_)/tmp1196_; double tmp4373_ = (tmp4372_)*mLocCoeffU_B_3; double tmp4374_ = (tmp365_)*(tmp451_); double tmp4375_ = (tmp522_)*(tmp343_); double tmp4376_ = tmp4374_-tmp4375_; double tmp4377_ = (tmp4376_)/tmp1196_; double tmp4378_ = (tmp4377_)*mLocCoeffV_B_3; double tmp4379_ = tmp4373_+tmp4378_; double tmp4380_ = tmp351_*(tmp477_); double tmp4381_ = (tmp530_)*(tmp343_); double tmp4382_ = tmp4380_-tmp4381_; double tmp4383_ = (tmp4382_)/tmp1200_; double tmp4384_ = (tmp4383_)*mLocCoeffU_B_4; double tmp4385_ = (tmp365_)*(tmp477_); double tmp4386_ = (tmp538_)*(tmp343_); double tmp4387_ = tmp4385_-tmp4386_; double tmp4388_ = (tmp4387_)/tmp1200_; double tmp4389_ = (tmp4388_)*mLocCoeffV_B_4; double tmp4390_ = tmp4384_+tmp4389_; double tmp4391_ = tmp4346_+tmp4357_; double tmp4392_ = tmp4391_+tmp4368_; double tmp4393_ = tmp4392_+tmp4379_; double tmp4394_ = tmp4393_+tmp4390_; double tmp4395_ = (tmp4394_)*5; double tmp4396_ = (tmp4395_)/tmp681_; double tmp4397_ = mLocTimeRot*(tmp95_); double tmp4398_ = mLocTimeRot*tmp103_; double tmp4399_ = tmp4398_*(tmp100_); double tmp4400_ = (tmp107_)*tmp4397_; double tmp4401_ = tmp4399_-tmp4400_; double tmp4402_ = (tmp4401_)/tmp559_; double tmp4403_ = (tmp4402_)*mLocCoeffU_A_0; double tmp4404_ = mLocTimeRot*(tmp117_); double tmp4405_ = tmp4404_*(tmp100_); double tmp4406_ = (tmp122_)*tmp4397_; double tmp4407_ = tmp4405_-tmp4406_; double tmp4408_ = (tmp4407_)/tmp559_; double tmp4409_ = (tmp4408_)*mLocCoeffV_A_0; double tmp4410_ = tmp4403_+tmp4409_; double tmp4411_ = tmp4398_*(tmp151_); double tmp4412_ = (tmp234_)*tmp4397_; double tmp4413_ = tmp4411_-tmp4412_; double tmp4414_ = (tmp4413_)/tmp586_; double tmp4415_ = (tmp4414_)*mLocCoeffU_A_1; double tmp4416_ = tmp4404_*(tmp151_); double tmp4417_ = (tmp242_)*tmp4397_; double tmp4418_ = tmp4416_-tmp4417_; double tmp4419_ = (tmp4418_)/tmp586_; double tmp4420_ = (tmp4419_)*mLocCoeffV_A_1; double tmp4421_ = tmp4415_+tmp4420_; double tmp4422_ = tmp4398_*(tmp177_); double tmp4423_ = (tmp250_)*tmp4397_; double tmp4424_ = tmp4422_-tmp4423_; double tmp4425_ = (tmp4424_)/tmp590_; double tmp4426_ = (tmp4425_)*mLocCoeffU_A_2; double tmp4427_ = tmp4404_*(tmp177_); double tmp4428_ = (tmp258_)*tmp4397_; double tmp4429_ = tmp4427_-tmp4428_; double tmp4430_ = (tmp4429_)/tmp590_; double tmp4431_ = (tmp4430_)*mLocCoeffV_A_2; double tmp4432_ = tmp4426_+tmp4431_; double tmp4433_ = tmp4398_*(tmp203_); double tmp4434_ = (tmp266_)*tmp4397_; double tmp4435_ = tmp4433_-tmp4434_; double tmp4436_ = (tmp4435_)/tmp594_; double tmp4437_ = (tmp4436_)*mLocCoeffU_A_3; double tmp4438_ = tmp4404_*(tmp203_); double tmp4439_ = (tmp274_)*tmp4397_; double tmp4440_ = tmp4438_-tmp4439_; double tmp4441_ = (tmp4440_)/tmp594_; double tmp4442_ = (tmp4441_)*mLocCoeffV_A_3; double tmp4443_ = tmp4437_+tmp4442_; double tmp4444_ = tmp4398_*(tmp229_); double tmp4445_ = (tmp282_)*tmp4397_; double tmp4446_ = tmp4444_-tmp4445_; double tmp4447_ = (tmp4446_)/tmp598_; double tmp4448_ = (tmp4447_)*mLocCoeffU_A_4; double tmp4449_ = tmp4404_*(tmp229_); double tmp4450_ = (tmp290_)*tmp4397_; double tmp4451_ = tmp4449_-tmp4450_; double tmp4452_ = (tmp4451_)/tmp598_; double tmp4453_ = (tmp4452_)*mLocCoeffV_A_4; double tmp4454_ = tmp4448_+tmp4453_; double tmp4455_ = tmp4410_+tmp4421_; double tmp4456_ = tmp4455_+tmp4432_; double tmp4457_ = tmp4456_+tmp4443_; double tmp4458_ = tmp4457_+tmp4454_; double tmp4459_ = (tmp4458_)*5; double tmp4460_ = (tmp4459_)/tmp681_; double tmp4461_ = mLocTimeRot*(tmp343_); double tmp4462_ = mLocTimeRot*tmp351_; double tmp4463_ = tmp4462_*(tmp348_); double tmp4464_ = (tmp355_)*tmp4461_; double tmp4465_ = tmp4463_-tmp4464_; double tmp4466_ = (tmp4465_)/tmp1161_; double tmp4467_ = (tmp4466_)*mLocCoeffU_B_0; double tmp4468_ = mLocTimeRot*(tmp365_); double tmp4469_ = tmp4468_*(tmp348_); double tmp4470_ = (tmp370_)*tmp4461_; double tmp4471_ = tmp4469_-tmp4470_; double tmp4472_ = (tmp4471_)/tmp1161_; double tmp4473_ = (tmp4472_)*mLocCoeffV_B_0; double tmp4474_ = tmp4467_+tmp4473_; double tmp4475_ = tmp4462_*(tmp399_); double tmp4476_ = (tmp482_)*tmp4461_; double tmp4477_ = tmp4475_-tmp4476_; double tmp4478_ = (tmp4477_)/tmp1188_; double tmp4479_ = (tmp4478_)*mLocCoeffU_B_1; double tmp4480_ = tmp4468_*(tmp399_); double tmp4481_ = (tmp490_)*tmp4461_; double tmp4482_ = tmp4480_-tmp4481_; double tmp4483_ = (tmp4482_)/tmp1188_; double tmp4484_ = (tmp4483_)*mLocCoeffV_B_1; double tmp4485_ = tmp4479_+tmp4484_; double tmp4486_ = tmp4462_*(tmp425_); double tmp4487_ = (tmp498_)*tmp4461_; double tmp4488_ = tmp4486_-tmp4487_; double tmp4489_ = (tmp4488_)/tmp1192_; double tmp4490_ = (tmp4489_)*mLocCoeffU_B_2; double tmp4491_ = tmp4468_*(tmp425_); double tmp4492_ = (tmp506_)*tmp4461_; double tmp4493_ = tmp4491_-tmp4492_; double tmp4494_ = (tmp4493_)/tmp1192_; double tmp4495_ = (tmp4494_)*mLocCoeffV_B_2; double tmp4496_ = tmp4490_+tmp4495_; double tmp4497_ = tmp4462_*(tmp451_); double tmp4498_ = (tmp514_)*tmp4461_; double tmp4499_ = tmp4497_-tmp4498_; double tmp4500_ = (tmp4499_)/tmp1196_; double tmp4501_ = (tmp4500_)*mLocCoeffU_B_3; double tmp4502_ = tmp4468_*(tmp451_); double tmp4503_ = (tmp522_)*tmp4461_; double tmp4504_ = tmp4502_-tmp4503_; double tmp4505_ = (tmp4504_)/tmp1196_; double tmp4506_ = (tmp4505_)*mLocCoeffV_B_3; double tmp4507_ = tmp4501_+tmp4506_; double tmp4508_ = tmp4462_*(tmp477_); double tmp4509_ = (tmp530_)*tmp4461_; double tmp4510_ = tmp4508_-tmp4509_; double tmp4511_ = (tmp4510_)/tmp1200_; double tmp4512_ = (tmp4511_)*mLocCoeffU_B_4; double tmp4513_ = tmp4468_*(tmp477_); double tmp4514_ = (tmp538_)*tmp4461_; double tmp4515_ = tmp4513_-tmp4514_; double tmp4516_ = (tmp4515_)/tmp1200_; double tmp4517_ = (tmp4516_)*mLocCoeffV_B_4; double tmp4518_ = tmp4512_+tmp4517_; double tmp4519_ = tmp4474_+tmp4485_; double tmp4520_ = tmp4519_+tmp4496_; double tmp4521_ = tmp4520_+tmp4507_; double tmp4522_ = tmp4521_+tmp4518_; double tmp4523_ = (tmp4522_)*5; double tmp4524_ = (tmp4523_)/tmp681_; double tmp4525_ = tmp28_*(tmp100_); double tmp4526_ = (tmp107_)*tmp98_; double tmp4527_ = tmp4525_-tmp4526_; double tmp4528_ = (tmp4527_)/tmp559_; double tmp4529_ = (tmp4528_)*mLocCoeffU_A_0; double tmp4530_ = tmp120_*(tmp100_); double tmp4531_ = (tmp122_)*tmp98_; double tmp4532_ = tmp4530_-tmp4531_; double tmp4533_ = (tmp4532_)/tmp559_; double tmp4534_ = (tmp4533_)*mLocCoeffV_A_0; double tmp4535_ = tmp4529_+tmp4534_; double tmp4536_ = tmp28_*(tmp151_); double tmp4537_ = (tmp234_)*tmp98_; double tmp4538_ = tmp4536_-tmp4537_; double tmp4539_ = (tmp4538_)/tmp586_; double tmp4540_ = (tmp4539_)*mLocCoeffU_A_1; double tmp4541_ = tmp120_*(tmp151_); double tmp4542_ = (tmp242_)*tmp98_; double tmp4543_ = tmp4541_-tmp4542_; double tmp4544_ = (tmp4543_)/tmp586_; double tmp4545_ = (tmp4544_)*mLocCoeffV_A_1; double tmp4546_ = tmp4540_+tmp4545_; double tmp4547_ = tmp28_*(tmp177_); double tmp4548_ = (tmp250_)*tmp98_; double tmp4549_ = tmp4547_-tmp4548_; double tmp4550_ = (tmp4549_)/tmp590_; double tmp4551_ = (tmp4550_)*mLocCoeffU_A_2; double tmp4552_ = tmp120_*(tmp177_); double tmp4553_ = (tmp258_)*tmp98_; double tmp4554_ = tmp4552_-tmp4553_; double tmp4555_ = (tmp4554_)/tmp590_; double tmp4556_ = (tmp4555_)*mLocCoeffV_A_2; double tmp4557_ = tmp4551_+tmp4556_; double tmp4558_ = tmp28_*(tmp203_); double tmp4559_ = (tmp266_)*tmp98_; double tmp4560_ = tmp4558_-tmp4559_; double tmp4561_ = (tmp4560_)/tmp594_; double tmp4562_ = (tmp4561_)*mLocCoeffU_A_3; double tmp4563_ = tmp120_*(tmp203_); double tmp4564_ = (tmp274_)*tmp98_; double tmp4565_ = tmp4563_-tmp4564_; double tmp4566_ = (tmp4565_)/tmp594_; double tmp4567_ = (tmp4566_)*mLocCoeffV_A_3; double tmp4568_ = tmp4562_+tmp4567_; double tmp4569_ = tmp28_*(tmp229_); double tmp4570_ = (tmp282_)*tmp98_; double tmp4571_ = tmp4569_-tmp4570_; double tmp4572_ = (tmp4571_)/tmp598_; double tmp4573_ = (tmp4572_)*mLocCoeffU_A_4; double tmp4574_ = tmp120_*(tmp229_); double tmp4575_ = (tmp290_)*tmp98_; double tmp4576_ = tmp4574_-tmp4575_; double tmp4577_ = (tmp4576_)/tmp598_; double tmp4578_ = (tmp4577_)*mLocCoeffV_A_4; double tmp4579_ = tmp4573_+tmp4578_; double tmp4580_ = tmp4535_+tmp4546_; double tmp4581_ = tmp4580_+tmp4557_; double tmp4582_ = tmp4581_+tmp4568_; double tmp4583_ = tmp4582_+tmp4579_; double tmp4584_ = (tmp4583_)*5; double tmp4585_ = (tmp4584_)/tmp681_; double tmp4586_ = tmp304_*(tmp348_); double tmp4587_ = (tmp355_)*tmp346_; double tmp4588_ = tmp4586_-tmp4587_; double tmp4589_ = (tmp4588_)/tmp1161_; double tmp4590_ = (tmp4589_)*mLocCoeffU_B_0; double tmp4591_ = tmp368_*(tmp348_); double tmp4592_ = (tmp370_)*tmp346_; double tmp4593_ = tmp4591_-tmp4592_; double tmp4594_ = (tmp4593_)/tmp1161_; double tmp4595_ = (tmp4594_)*mLocCoeffV_B_0; double tmp4596_ = tmp4590_+tmp4595_; double tmp4597_ = tmp304_*(tmp399_); double tmp4598_ = (tmp482_)*tmp346_; double tmp4599_ = tmp4597_-tmp4598_; double tmp4600_ = (tmp4599_)/tmp1188_; double tmp4601_ = (tmp4600_)*mLocCoeffU_B_1; double tmp4602_ = tmp368_*(tmp399_); double tmp4603_ = (tmp490_)*tmp346_; double tmp4604_ = tmp4602_-tmp4603_; double tmp4605_ = (tmp4604_)/tmp1188_; double tmp4606_ = (tmp4605_)*mLocCoeffV_B_1; double tmp4607_ = tmp4601_+tmp4606_; double tmp4608_ = tmp304_*(tmp425_); double tmp4609_ = (tmp498_)*tmp346_; double tmp4610_ = tmp4608_-tmp4609_; double tmp4611_ = (tmp4610_)/tmp1192_; double tmp4612_ = (tmp4611_)*mLocCoeffU_B_2; double tmp4613_ = tmp368_*(tmp425_); double tmp4614_ = (tmp506_)*tmp346_; double tmp4615_ = tmp4613_-tmp4614_; double tmp4616_ = (tmp4615_)/tmp1192_; double tmp4617_ = (tmp4616_)*mLocCoeffV_B_2; double tmp4618_ = tmp4612_+tmp4617_; double tmp4619_ = tmp304_*(tmp451_); double tmp4620_ = (tmp514_)*tmp346_; double tmp4621_ = tmp4619_-tmp4620_; double tmp4622_ = (tmp4621_)/tmp1196_; double tmp4623_ = (tmp4622_)*mLocCoeffU_B_3; double tmp4624_ = tmp368_*(tmp451_); double tmp4625_ = (tmp522_)*tmp346_; double tmp4626_ = tmp4624_-tmp4625_; double tmp4627_ = (tmp4626_)/tmp1196_; double tmp4628_ = (tmp4627_)*mLocCoeffV_B_3; double tmp4629_ = tmp4623_+tmp4628_; double tmp4630_ = tmp304_*(tmp477_); double tmp4631_ = (tmp530_)*tmp346_; double tmp4632_ = tmp4630_-tmp4631_; double tmp4633_ = (tmp4632_)/tmp1200_; double tmp4634_ = (tmp4633_)*mLocCoeffU_B_4; double tmp4635_ = tmp368_*(tmp477_); double tmp4636_ = (tmp538_)*tmp346_; double tmp4637_ = tmp4635_-tmp4636_; double tmp4638_ = (tmp4637_)/tmp1200_; double tmp4639_ = (tmp4638_)*mLocCoeffV_B_4; double tmp4640_ = tmp4634_+tmp4639_; double tmp4641_ = tmp4596_+tmp4607_; double tmp4642_ = tmp4641_+tmp4618_; double tmp4643_ = tmp4642_+tmp4629_; double tmp4644_ = tmp4643_+tmp4640_; double tmp4645_ = (tmp4644_)*5; double tmp4646_ = (tmp4645_)/tmp681_; double tmp4647_ = mLocTimeRot*tmp98_; double tmp4648_ = mLocTimeRot*tmp28_; double tmp4649_ = tmp4648_*(tmp100_); double tmp4650_ = (tmp107_)*tmp4647_; double tmp4651_ = tmp4649_-tmp4650_; double tmp4652_ = (tmp4651_)/tmp559_; double tmp4653_ = (tmp4652_)*mLocCoeffU_A_0; double tmp4654_ = mLocTimeRot*tmp120_; double tmp4655_ = tmp4654_*(tmp100_); double tmp4656_ = (tmp122_)*tmp4647_; double tmp4657_ = tmp4655_-tmp4656_; double tmp4658_ = (tmp4657_)/tmp559_; double tmp4659_ = (tmp4658_)*mLocCoeffV_A_0; double tmp4660_ = tmp4653_+tmp4659_; double tmp4661_ = tmp4648_*(tmp151_); double tmp4662_ = (tmp234_)*tmp4647_; double tmp4663_ = tmp4661_-tmp4662_; double tmp4664_ = (tmp4663_)/tmp586_; double tmp4665_ = (tmp4664_)*mLocCoeffU_A_1; double tmp4666_ = tmp4654_*(tmp151_); double tmp4667_ = (tmp242_)*tmp4647_; double tmp4668_ = tmp4666_-tmp4667_; double tmp4669_ = (tmp4668_)/tmp586_; double tmp4670_ = (tmp4669_)*mLocCoeffV_A_1; double tmp4671_ = tmp4665_+tmp4670_; double tmp4672_ = tmp4648_*(tmp177_); double tmp4673_ = (tmp250_)*tmp4647_; double tmp4674_ = tmp4672_-tmp4673_; double tmp4675_ = (tmp4674_)/tmp590_; double tmp4676_ = (tmp4675_)*mLocCoeffU_A_2; double tmp4677_ = tmp4654_*(tmp177_); double tmp4678_ = (tmp258_)*tmp4647_; double tmp4679_ = tmp4677_-tmp4678_; double tmp4680_ = (tmp4679_)/tmp590_; double tmp4681_ = (tmp4680_)*mLocCoeffV_A_2; double tmp4682_ = tmp4676_+tmp4681_; double tmp4683_ = tmp4648_*(tmp203_); double tmp4684_ = (tmp266_)*tmp4647_; double tmp4685_ = tmp4683_-tmp4684_; double tmp4686_ = (tmp4685_)/tmp594_; double tmp4687_ = (tmp4686_)*mLocCoeffU_A_3; double tmp4688_ = tmp4654_*(tmp203_); double tmp4689_ = (tmp274_)*tmp4647_; double tmp4690_ = tmp4688_-tmp4689_; double tmp4691_ = (tmp4690_)/tmp594_; double tmp4692_ = (tmp4691_)*mLocCoeffV_A_3; double tmp4693_ = tmp4687_+tmp4692_; double tmp4694_ = tmp4648_*(tmp229_); double tmp4695_ = (tmp282_)*tmp4647_; double tmp4696_ = tmp4694_-tmp4695_; double tmp4697_ = (tmp4696_)/tmp598_; double tmp4698_ = (tmp4697_)*mLocCoeffU_A_4; double tmp4699_ = tmp4654_*(tmp229_); double tmp4700_ = (tmp290_)*tmp4647_; double tmp4701_ = tmp4699_-tmp4700_; double tmp4702_ = (tmp4701_)/tmp598_; double tmp4703_ = (tmp4702_)*mLocCoeffV_A_4; double tmp4704_ = tmp4698_+tmp4703_; double tmp4705_ = tmp4660_+tmp4671_; double tmp4706_ = tmp4705_+tmp4682_; double tmp4707_ = tmp4706_+tmp4693_; double tmp4708_ = tmp4707_+tmp4704_; double tmp4709_ = (tmp4708_)*5; double tmp4710_ = (tmp4709_)/tmp681_; double tmp4711_ = mLocTimeRot*tmp346_; double tmp4712_ = mLocTimeRot*tmp304_; double tmp4713_ = tmp4712_*(tmp348_); double tmp4714_ = (tmp355_)*tmp4711_; double tmp4715_ = tmp4713_-tmp4714_; double tmp4716_ = (tmp4715_)/tmp1161_; double tmp4717_ = (tmp4716_)*mLocCoeffU_B_0; double tmp4718_ = mLocTimeRot*tmp368_; double tmp4719_ = tmp4718_*(tmp348_); double tmp4720_ = (tmp370_)*tmp4711_; double tmp4721_ = tmp4719_-tmp4720_; double tmp4722_ = (tmp4721_)/tmp1161_; double tmp4723_ = (tmp4722_)*mLocCoeffV_B_0; double tmp4724_ = tmp4717_+tmp4723_; double tmp4725_ = tmp4712_*(tmp399_); double tmp4726_ = (tmp482_)*tmp4711_; double tmp4727_ = tmp4725_-tmp4726_; double tmp4728_ = (tmp4727_)/tmp1188_; double tmp4729_ = (tmp4728_)*mLocCoeffU_B_1; double tmp4730_ = tmp4718_*(tmp399_); double tmp4731_ = (tmp490_)*tmp4711_; double tmp4732_ = tmp4730_-tmp4731_; double tmp4733_ = (tmp4732_)/tmp1188_; double tmp4734_ = (tmp4733_)*mLocCoeffV_B_1; double tmp4735_ = tmp4729_+tmp4734_; double tmp4736_ = tmp4712_*(tmp425_); double tmp4737_ = (tmp498_)*tmp4711_; double tmp4738_ = tmp4736_-tmp4737_; double tmp4739_ = (tmp4738_)/tmp1192_; double tmp4740_ = (tmp4739_)*mLocCoeffU_B_2; double tmp4741_ = tmp4718_*(tmp425_); double tmp4742_ = (tmp506_)*tmp4711_; double tmp4743_ = tmp4741_-tmp4742_; double tmp4744_ = (tmp4743_)/tmp1192_; double tmp4745_ = (tmp4744_)*mLocCoeffV_B_2; double tmp4746_ = tmp4740_+tmp4745_; double tmp4747_ = tmp4712_*(tmp451_); double tmp4748_ = (tmp514_)*tmp4711_; double tmp4749_ = tmp4747_-tmp4748_; double tmp4750_ = (tmp4749_)/tmp1196_; double tmp4751_ = (tmp4750_)*mLocCoeffU_B_3; double tmp4752_ = tmp4718_*(tmp451_); double tmp4753_ = (tmp522_)*tmp4711_; double tmp4754_ = tmp4752_-tmp4753_; double tmp4755_ = (tmp4754_)/tmp1196_; double tmp4756_ = (tmp4755_)*mLocCoeffV_B_3; double tmp4757_ = tmp4751_+tmp4756_; double tmp4758_ = tmp4712_*(tmp477_); double tmp4759_ = (tmp530_)*tmp4711_; double tmp4760_ = tmp4758_-tmp4759_; double tmp4761_ = (tmp4760_)/tmp1200_; double tmp4762_ = (tmp4761_)*mLocCoeffU_B_4; double tmp4763_ = tmp4718_*(tmp477_); double tmp4764_ = (tmp538_)*tmp4711_; double tmp4765_ = tmp4763_-tmp4764_; double tmp4766_ = (tmp4765_)/tmp1200_; double tmp4767_ = (tmp4766_)*mLocCoeffV_B_4; double tmp4768_ = tmp4762_+tmp4767_; double tmp4769_ = tmp4724_+tmp4735_; double tmp4770_ = tmp4769_+tmp4746_; double tmp4771_ = tmp4770_+tmp4757_; double tmp4772_ = tmp4771_+tmp4768_; double tmp4773_ = (tmp4772_)*5; double tmp4774_ = (tmp4773_)/tmp681_; double tmp4775_ = (tmp245_)-tmp298_; double tmp4776_ = 2*(tmp582_); double tmp4777_ = tmp4776_*(tmp125_); double tmp4778_ = 2*(tmp629_); double tmp4779_ = tmp4778_*(tmp245_); double tmp4780_ = tmp4777_+tmp4779_; double tmp4781_ = 2*(tmp646_); double tmp4782_ = tmp4781_*(tmp261_); double tmp4783_ = tmp4780_+tmp4782_; double tmp4784_ = 2*(tmp663_); double tmp4785_ = tmp4784_*(tmp277_); double tmp4786_ = tmp4783_+tmp4785_; double tmp4787_ = 2*(tmp680_); double tmp4788_ = tmp4787_*(tmp293_); double tmp4789_ = tmp4786_+tmp4788_; double tmp4790_ = (tmp4789_)*5; double tmp4791_ = (tmp4790_)/tmp681_; double tmp4792_ = 2*(tmp687_); double tmp4793_ = tmp4792_*(tmp298_); double tmp4794_ = tmp4791_-tmp4793_; double tmp4795_ = 0.500000*(tmp4794_); double tmp4796_ = (tmp4795_)/tmp611_; double tmp4797_ = 2*(tmp725_); double tmp4798_ = tmp4797_*(tmp125_); double tmp4799_ = 2*(tmp766_); double tmp4800_ = tmp4799_*(tmp245_); double tmp4801_ = tmp4798_+tmp4800_; double tmp4802_ = 2*(tmp787_); double tmp4803_ = tmp4802_*(tmp261_); double tmp4804_ = tmp4801_+tmp4803_; double tmp4805_ = 2*(tmp808_); double tmp4806_ = tmp4805_*(tmp277_); double tmp4807_ = tmp4804_+tmp4806_; double tmp4808_ = 2*(tmp829_); double tmp4809_ = tmp4808_*(tmp293_); double tmp4810_ = tmp4807_+tmp4809_; double tmp4811_ = (tmp4810_)*5; double tmp4812_ = (tmp4811_)/tmp681_; double tmp4813_ = 2*(tmp835_); double tmp4814_ = tmp4813_*(tmp298_); double tmp4815_ = tmp4812_-tmp4814_; double tmp4816_ = 0.500000*(tmp4815_); double tmp4817_ = (tmp4816_)/tmp611_; double tmp4818_ = 2*(tmp872_); double tmp4819_ = tmp4818_*(tmp125_); double tmp4820_ = 2*(tmp907_); double tmp4821_ = tmp4820_*(tmp245_); double tmp4822_ = tmp4819_+tmp4821_; double tmp4823_ = 2*(tmp922_); double tmp4824_ = tmp4823_*(tmp261_); double tmp4825_ = tmp4822_+tmp4824_; double tmp4826_ = 2*(tmp937_); double tmp4827_ = tmp4826_*(tmp277_); double tmp4828_ = tmp4825_+tmp4827_; double tmp4829_ = 2*(tmp952_); double tmp4830_ = tmp4829_*(tmp293_); double tmp4831_ = tmp4828_+tmp4830_; double tmp4832_ = (tmp4831_)*5; double tmp4833_ = (tmp4832_)/tmp681_; double tmp4834_ = 2*(tmp958_); double tmp4835_ = tmp4834_*(tmp298_); double tmp4836_ = tmp4833_-tmp4835_; double tmp4837_ = 0.500000*(tmp4836_); double tmp4838_ = (tmp4837_)/tmp611_; double tmp4839_ = 2*(tmp972_); double tmp4840_ = tmp4839_*(tmp125_); double tmp4841_ = 2*(tmp983_); double tmp4842_ = tmp4841_*(tmp245_); double tmp4843_ = tmp4840_+tmp4842_; double tmp4844_ = 2*(tmp994_); double tmp4845_ = tmp4844_*(tmp261_); double tmp4846_ = tmp4843_+tmp4845_; double tmp4847_ = 2*(tmp1005_); double tmp4848_ = tmp4847_*(tmp277_); double tmp4849_ = tmp4846_+tmp4848_; double tmp4850_ = 2*(tmp1016_); double tmp4851_ = tmp4850_*(tmp293_); double tmp4852_ = tmp4849_+tmp4851_; double tmp4853_ = (tmp4852_)*5; double tmp4854_ = (tmp4853_)/tmp681_; double tmp4855_ = 2*(tmp1022_); double tmp4856_ = tmp4855_*(tmp298_); double tmp4857_ = tmp4854_-tmp4856_; double tmp4858_ = 0.500000*(tmp4857_); double tmp4859_ = (tmp4858_)/tmp611_; double tmp4860_ = 2*(tmp1036_); double tmp4861_ = tmp4860_*(tmp125_); double tmp4862_ = 2*(tmp1047_); double tmp4863_ = tmp4862_*(tmp245_); double tmp4864_ = tmp4861_+tmp4863_; double tmp4865_ = 2*(tmp1058_); double tmp4866_ = tmp4865_*(tmp261_); double tmp4867_ = tmp4864_+tmp4866_; double tmp4868_ = 2*(tmp1069_); double tmp4869_ = tmp4868_*(tmp277_); double tmp4870_ = tmp4867_+tmp4869_; double tmp4871_ = 2*(tmp1080_); double tmp4872_ = tmp4871_*(tmp293_); double tmp4873_ = tmp4870_+tmp4872_; double tmp4874_ = (tmp4873_)*5; double tmp4875_ = (tmp4874_)/tmp681_; double tmp4876_ = 2*(tmp1086_); double tmp4877_ = tmp4876_*(tmp298_); double tmp4878_ = tmp4875_-tmp4877_; double tmp4879_ = 0.500000*(tmp4878_); double tmp4880_ = (tmp4879_)/tmp611_; double tmp4881_ = 2*(tmp1099_); double tmp4882_ = tmp4881_*(tmp125_); double tmp4883_ = 2*(tmp1110_); double tmp4884_ = tmp4883_*(tmp245_); double tmp4885_ = tmp4882_+tmp4884_; double tmp4886_ = 2*(tmp1121_); double tmp4887_ = tmp4886_*(tmp261_); double tmp4888_ = tmp4885_+tmp4887_; double tmp4889_ = 2*(tmp1132_); double tmp4890_ = tmp4889_*(tmp277_); double tmp4891_ = tmp4888_+tmp4890_; double tmp4892_ = 2*(tmp1143_); double tmp4893_ = tmp4892_*(tmp293_); double tmp4894_ = tmp4891_+tmp4893_; double tmp4895_ = (tmp4894_)*5; double tmp4896_ = (tmp4895_)/tmp681_; double tmp4897_ = 2*(tmp1149_); double tmp4898_ = tmp4897_*(tmp298_); double tmp4899_ = tmp4896_-tmp4898_; double tmp4900_ = 0.500000*(tmp4899_); double tmp4901_ = (tmp4900_)/tmp611_; double tmp4902_ = (tmp493_)-tmp546_; double tmp4903_ = 2*(tmp1184_); double tmp4904_ = tmp4903_*(tmp373_); double tmp4905_ = 2*(tmp1231_); double tmp4906_ = tmp4905_*(tmp493_); double tmp4907_ = tmp4904_+tmp4906_; double tmp4908_ = 2*(tmp1248_); double tmp4909_ = tmp4908_*(tmp509_); double tmp4910_ = tmp4907_+tmp4909_; double tmp4911_ = 2*(tmp1265_); double tmp4912_ = tmp4911_*(tmp525_); double tmp4913_ = tmp4910_+tmp4912_; double tmp4914_ = 2*(tmp1282_); double tmp4915_ = tmp4914_*(tmp541_); double tmp4916_ = tmp4913_+tmp4915_; double tmp4917_ = (tmp4916_)*5; double tmp4918_ = (tmp4917_)/tmp681_; double tmp4919_ = 2*(tmp1288_); double tmp4920_ = tmp4919_*(tmp546_); double tmp4921_ = tmp4918_-tmp4920_; double tmp4922_ = 0.500000*(tmp4921_); double tmp4923_ = (tmp4922_)/tmp1213_; double tmp4924_ = 2*(tmp1326_); double tmp4925_ = tmp4924_*(tmp373_); double tmp4926_ = 2*(tmp1367_); double tmp4927_ = tmp4926_*(tmp493_); double tmp4928_ = tmp4925_+tmp4927_; double tmp4929_ = 2*(tmp1388_); double tmp4930_ = tmp4929_*(tmp509_); double tmp4931_ = tmp4928_+tmp4930_; double tmp4932_ = 2*(tmp1409_); double tmp4933_ = tmp4932_*(tmp525_); double tmp4934_ = tmp4931_+tmp4933_; double tmp4935_ = 2*(tmp1430_); double tmp4936_ = tmp4935_*(tmp541_); double tmp4937_ = tmp4934_+tmp4936_; double tmp4938_ = (tmp4937_)*5; double tmp4939_ = (tmp4938_)/tmp681_; double tmp4940_ = 2*(tmp1436_); double tmp4941_ = tmp4940_*(tmp546_); double tmp4942_ = tmp4939_-tmp4941_; double tmp4943_ = 0.500000*(tmp4942_); double tmp4944_ = (tmp4943_)/tmp1213_; double tmp4945_ = 2*(tmp1473_); double tmp4946_ = tmp4945_*(tmp373_); double tmp4947_ = 2*(tmp1508_); double tmp4948_ = tmp4947_*(tmp493_); double tmp4949_ = tmp4946_+tmp4948_; double tmp4950_ = 2*(tmp1523_); double tmp4951_ = tmp4950_*(tmp509_); double tmp4952_ = tmp4949_+tmp4951_; double tmp4953_ = 2*(tmp1538_); double tmp4954_ = tmp4953_*(tmp525_); double tmp4955_ = tmp4952_+tmp4954_; double tmp4956_ = 2*(tmp1553_); double tmp4957_ = tmp4956_*(tmp541_); double tmp4958_ = tmp4955_+tmp4957_; double tmp4959_ = (tmp4958_)*5; double tmp4960_ = (tmp4959_)/tmp681_; double tmp4961_ = 2*(tmp1559_); double tmp4962_ = tmp4961_*(tmp546_); double tmp4963_ = tmp4960_-tmp4962_; double tmp4964_ = 0.500000*(tmp4963_); double tmp4965_ = (tmp4964_)/tmp1213_; double tmp4966_ = 2*(tmp1573_); double tmp4967_ = tmp4966_*(tmp373_); double tmp4968_ = 2*(tmp1584_); double tmp4969_ = tmp4968_*(tmp493_); double tmp4970_ = tmp4967_+tmp4969_; double tmp4971_ = 2*(tmp1595_); double tmp4972_ = tmp4971_*(tmp509_); double tmp4973_ = tmp4970_+tmp4972_; double tmp4974_ = 2*(tmp1606_); double tmp4975_ = tmp4974_*(tmp525_); double tmp4976_ = tmp4973_+tmp4975_; double tmp4977_ = 2*(tmp1617_); double tmp4978_ = tmp4977_*(tmp541_); double tmp4979_ = tmp4976_+tmp4978_; double tmp4980_ = (tmp4979_)*5; double tmp4981_ = (tmp4980_)/tmp681_; double tmp4982_ = 2*(tmp1623_); double tmp4983_ = tmp4982_*(tmp546_); double tmp4984_ = tmp4981_-tmp4983_; double tmp4985_ = 0.500000*(tmp4984_); double tmp4986_ = (tmp4985_)/tmp1213_; double tmp4987_ = 2*(tmp1637_); double tmp4988_ = tmp4987_*(tmp373_); double tmp4989_ = 2*(tmp1648_); double tmp4990_ = tmp4989_*(tmp493_); double tmp4991_ = tmp4988_+tmp4990_; double tmp4992_ = 2*(tmp1659_); double tmp4993_ = tmp4992_*(tmp509_); double tmp4994_ = tmp4991_+tmp4993_; double tmp4995_ = 2*(tmp1670_); double tmp4996_ = tmp4995_*(tmp525_); double tmp4997_ = tmp4994_+tmp4996_; double tmp4998_ = 2*(tmp1681_); double tmp4999_ = tmp4998_*(tmp541_); double tmp5000_ = tmp4997_+tmp4999_; double tmp5001_ = (tmp5000_)*5; double tmp5002_ = (tmp5001_)/tmp681_; double tmp5003_ = 2*(tmp1687_); double tmp5004_ = tmp5003_*(tmp546_); double tmp5005_ = tmp5002_-tmp5004_; double tmp5006_ = 0.500000*(tmp5005_); double tmp5007_ = (tmp5006_)/tmp1213_; double tmp5008_ = 2*(tmp1700_); double tmp5009_ = tmp5008_*(tmp373_); double tmp5010_ = 2*(tmp1711_); double tmp5011_ = tmp5010_*(tmp493_); double tmp5012_ = tmp5009_+tmp5011_; double tmp5013_ = 2*(tmp1722_); double tmp5014_ = tmp5013_*(tmp509_); double tmp5015_ = tmp5012_+tmp5014_; double tmp5016_ = 2*(tmp1733_); double tmp5017_ = tmp5016_*(tmp525_); double tmp5018_ = tmp5015_+tmp5017_; double tmp5019_ = 2*(tmp1744_); double tmp5020_ = tmp5019_*(tmp541_); double tmp5021_ = tmp5018_+tmp5020_; double tmp5022_ = (tmp5021_)*5; double tmp5023_ = (tmp5022_)/tmp681_; double tmp5024_ = 2*(tmp1750_); double tmp5025_ = tmp5024_*(tmp546_); double tmp5026_ = tmp5023_-tmp5025_; double tmp5027_ = 0.500000*(tmp5026_); double tmp5028_ = (tmp5027_)/tmp1213_; double tmp5029_ = 2*(tmp1793_); double tmp5030_ = tmp5029_*(tmp125_); double tmp5031_ = 2*(tmp1858_); double tmp5032_ = tmp5031_*(tmp245_); double tmp5033_ = tmp5030_+tmp5032_; double tmp5034_ = 2*(tmp1875_); double tmp5035_ = tmp5034_*(tmp261_); double tmp5036_ = tmp5033_+tmp5035_; double tmp5037_ = 2*(tmp1892_); double tmp5038_ = tmp5037_*(tmp277_); double tmp5039_ = tmp5036_+tmp5038_; double tmp5040_ = 2*(tmp1909_); double tmp5041_ = tmp5040_*(tmp293_); double tmp5042_ = tmp5039_+tmp5041_; double tmp5043_ = (tmp5042_)*5; double tmp5044_ = (tmp5043_)/tmp681_; double tmp5045_ = 2*(tmp1915_); double tmp5046_ = tmp5045_*(tmp298_); double tmp5047_ = tmp5044_-tmp5046_; double tmp5048_ = 0.500000*(tmp5047_); double tmp5049_ = (tmp5048_)/tmp611_; double tmp5050_ = 2*(tmp1944_); double tmp5051_ = tmp5050_*(tmp373_); double tmp5052_ = 2*(tmp2009_); double tmp5053_ = tmp5052_*(tmp493_); double tmp5054_ = tmp5051_+tmp5053_; double tmp5055_ = 2*(tmp2026_); double tmp5056_ = tmp5055_*(tmp509_); double tmp5057_ = tmp5054_+tmp5056_; double tmp5058_ = 2*(tmp2043_); double tmp5059_ = tmp5058_*(tmp525_); double tmp5060_ = tmp5057_+tmp5059_; double tmp5061_ = 2*(tmp2060_); double tmp5062_ = tmp5061_*(tmp541_); double tmp5063_ = tmp5060_+tmp5062_; double tmp5064_ = (tmp5063_)*5; double tmp5065_ = (tmp5064_)/tmp681_; double tmp5066_ = 2*(tmp2066_); double tmp5067_ = tmp5066_*(tmp546_); double tmp5068_ = tmp5065_-tmp5067_; double tmp5069_ = 0.500000*(tmp5068_); double tmp5070_ = (tmp5069_)/tmp1213_; double tmp5071_ = 2*(tmp2116_); double tmp5072_ = tmp5071_*(tmp125_); double tmp5073_ = 2*(tmp2185_); double tmp5074_ = tmp5073_*(tmp245_); double tmp5075_ = tmp5072_+tmp5074_; double tmp5076_ = 2*(tmp2202_); double tmp5077_ = tmp5076_*(tmp261_); double tmp5078_ = tmp5075_+tmp5077_; double tmp5079_ = 2*(tmp2219_); double tmp5080_ = tmp5079_*(tmp277_); double tmp5081_ = tmp5078_+tmp5080_; double tmp5082_ = 2*(tmp2236_); double tmp5083_ = tmp5082_*(tmp293_); double tmp5084_ = tmp5081_+tmp5083_; double tmp5085_ = (tmp5084_)*5; double tmp5086_ = (tmp5085_)/tmp681_; double tmp5087_ = 2*(tmp2242_); double tmp5088_ = tmp5087_*(tmp298_); double tmp5089_ = tmp5086_-tmp5088_; double tmp5090_ = 0.500000*(tmp5089_); double tmp5091_ = (tmp5090_)/tmp611_; double tmp5092_ = 2*(tmp2272_); double tmp5093_ = tmp5092_*(tmp373_); double tmp5094_ = 2*(tmp2341_); double tmp5095_ = tmp5094_*(tmp493_); double tmp5096_ = tmp5093_+tmp5095_; double tmp5097_ = 2*(tmp2358_); double tmp5098_ = tmp5097_*(tmp509_); double tmp5099_ = tmp5096_+tmp5098_; double tmp5100_ = 2*(tmp2375_); double tmp5101_ = tmp5100_*(tmp525_); double tmp5102_ = tmp5099_+tmp5101_; double tmp5103_ = 2*(tmp2392_); double tmp5104_ = tmp5103_*(tmp541_); double tmp5105_ = tmp5102_+tmp5104_; double tmp5106_ = (tmp5105_)*5; double tmp5107_ = (tmp5106_)/tmp681_; double tmp5108_ = 2*(tmp2398_); double tmp5109_ = tmp5108_*(tmp546_); double tmp5110_ = tmp5107_-tmp5109_; double tmp5111_ = 0.500000*(tmp5110_); double tmp5112_ = (tmp5111_)/tmp1213_; double tmp5113_ = 2*(tmp2451_); double tmp5114_ = tmp5113_*(tmp125_); double tmp5115_ = 2*(tmp2552_); double tmp5116_ = tmp5115_*(tmp245_); double tmp5117_ = tmp5114_+tmp5116_; double tmp5118_ = 2*(tmp2573_); double tmp5119_ = tmp5118_*(tmp261_); double tmp5120_ = tmp5117_+tmp5119_; double tmp5121_ = 2*(tmp2594_); double tmp5122_ = tmp5121_*(tmp277_); double tmp5123_ = tmp5120_+tmp5122_; double tmp5124_ = 2*(tmp2615_); double tmp5125_ = tmp5124_*(tmp293_); double tmp5126_ = tmp5123_+tmp5125_; double tmp5127_ = (tmp5126_)*5; double tmp5128_ = (tmp5127_)/tmp681_; double tmp5129_ = 2*(tmp2621_); double tmp5130_ = tmp5129_*(tmp298_); double tmp5131_ = tmp5128_-tmp5130_; double tmp5132_ = 0.500000*(tmp5131_); double tmp5133_ = (tmp5132_)/tmp611_; double tmp5134_ = 2*(tmp2662_); double tmp5135_ = tmp5134_*(tmp373_); double tmp5136_ = 2*(tmp2763_); double tmp5137_ = tmp5136_*(tmp493_); double tmp5138_ = tmp5135_+tmp5137_; double tmp5139_ = 2*(tmp2784_); double tmp5140_ = tmp5139_*(tmp509_); double tmp5141_ = tmp5138_+tmp5140_; double tmp5142_ = 2*(tmp2805_); double tmp5143_ = tmp5142_*(tmp525_); double tmp5144_ = tmp5141_+tmp5143_; double tmp5145_ = 2*(tmp2826_); double tmp5146_ = tmp5145_*(tmp541_); double tmp5147_ = tmp5144_+tmp5146_; double tmp5148_ = (tmp5147_)*5; double tmp5149_ = (tmp5148_)/tmp681_; double tmp5150_ = 2*(tmp2832_); double tmp5151_ = tmp5150_*(tmp546_); double tmp5152_ = tmp5149_-tmp5151_; double tmp5153_ = 0.500000*(tmp5152_); double tmp5154_ = (tmp5153_)/tmp1213_; double tmp5155_ = 2*(tmp2886_); double tmp5156_ = tmp5155_*(tmp125_); double tmp5157_ = 2*(tmp2987_); double tmp5158_ = tmp5157_*(tmp245_); double tmp5159_ = tmp5156_+tmp5158_; double tmp5160_ = 2*(tmp3008_); double tmp5161_ = tmp5160_*(tmp261_); double tmp5162_ = tmp5159_+tmp5161_; double tmp5163_ = 2*(tmp3029_); double tmp5164_ = tmp5163_*(tmp277_); double tmp5165_ = tmp5162_+tmp5164_; double tmp5166_ = 2*(tmp3050_); double tmp5167_ = tmp5166_*(tmp293_); double tmp5168_ = tmp5165_+tmp5167_; double tmp5169_ = (tmp5168_)*5; double tmp5170_ = (tmp5169_)/tmp681_; double tmp5171_ = 2*(tmp3056_); double tmp5172_ = tmp5171_*(tmp298_); double tmp5173_ = tmp5170_-tmp5172_; double tmp5174_ = 0.500000*(tmp5173_); double tmp5175_ = (tmp5174_)/tmp611_; double tmp5176_ = 2*(tmp3097_); double tmp5177_ = tmp5176_*(tmp373_); double tmp5178_ = 2*(tmp3198_); double tmp5179_ = tmp5178_*(tmp493_); double tmp5180_ = tmp5177_+tmp5179_; double tmp5181_ = 2*(tmp3219_); double tmp5182_ = tmp5181_*(tmp509_); double tmp5183_ = tmp5180_+tmp5182_; double tmp5184_ = 2*(tmp3240_); double tmp5185_ = tmp5184_*(tmp525_); double tmp5186_ = tmp5183_+tmp5185_; double tmp5187_ = 2*(tmp3261_); double tmp5188_ = tmp5187_*(tmp541_); double tmp5189_ = tmp5186_+tmp5188_; double tmp5190_ = (tmp5189_)*5; double tmp5191_ = (tmp5190_)/tmp681_; double tmp5192_ = 2*(tmp3267_); double tmp5193_ = tmp5192_*(tmp546_); double tmp5194_ = tmp5191_-tmp5193_; double tmp5195_ = 0.500000*(tmp5194_); double tmp5196_ = (tmp5195_)/tmp1213_; double tmp5197_ = 2*(tmp3318_); double tmp5198_ = tmp5197_*(tmp125_); double tmp5199_ = 2*(tmp3395_); double tmp5200_ = tmp5199_*(tmp245_); double tmp5201_ = tmp5198_+tmp5200_; double tmp5202_ = 2*(tmp3416_); double tmp5203_ = tmp5202_*(tmp261_); double tmp5204_ = tmp5201_+tmp5203_; double tmp5205_ = 2*(tmp3437_); double tmp5206_ = tmp5205_*(tmp277_); double tmp5207_ = tmp5204_+tmp5206_; double tmp5208_ = 2*(tmp3458_); double tmp5209_ = tmp5208_*(tmp293_); double tmp5210_ = tmp5207_+tmp5209_; double tmp5211_ = (tmp5210_)*5; double tmp5212_ = (tmp5211_)/tmp681_; double tmp5213_ = 2*(tmp3464_); double tmp5214_ = tmp5213_*(tmp298_); double tmp5215_ = tmp5212_-tmp5214_; double tmp5216_ = 0.500000*(tmp5215_); double tmp5217_ = (tmp5216_)/tmp611_; double tmp5218_ = 2*(tmp3499_); double tmp5219_ = tmp5218_*(tmp373_); double tmp5220_ = 2*(tmp3576_); double tmp5221_ = tmp5220_*(tmp493_); double tmp5222_ = tmp5219_+tmp5221_; double tmp5223_ = 2*(tmp3597_); double tmp5224_ = tmp5223_*(tmp509_); double tmp5225_ = tmp5222_+tmp5224_; double tmp5226_ = 2*(tmp3618_); double tmp5227_ = tmp5226_*(tmp525_); double tmp5228_ = tmp5225_+tmp5227_; double tmp5229_ = 2*(tmp3639_); double tmp5230_ = tmp5229_*(tmp541_); double tmp5231_ = tmp5228_+tmp5230_; double tmp5232_ = (tmp5231_)*5; double tmp5233_ = (tmp5232_)/tmp681_; double tmp5234_ = 2*(tmp3645_); double tmp5235_ = tmp5234_*(tmp546_); double tmp5236_ = tmp5233_-tmp5235_; double tmp5237_ = 0.500000*(tmp5236_); double tmp5238_ = (tmp5237_)/tmp1213_; double tmp5239_ = 2*(tmp3697_); double tmp5240_ = tmp5239_*(tmp125_); double tmp5241_ = 2*(tmp3774_); double tmp5242_ = tmp5241_*(tmp245_); double tmp5243_ = tmp5240_+tmp5242_; double tmp5244_ = 2*(tmp3795_); double tmp5245_ = tmp5244_*(tmp261_); double tmp5246_ = tmp5243_+tmp5245_; double tmp5247_ = 2*(tmp3816_); double tmp5248_ = tmp5247_*(tmp277_); double tmp5249_ = tmp5246_+tmp5248_; double tmp5250_ = 2*(tmp3837_); double tmp5251_ = tmp5250_*(tmp293_); double tmp5252_ = tmp5249_+tmp5251_; double tmp5253_ = (tmp5252_)*5; double tmp5254_ = (tmp5253_)/tmp681_; double tmp5255_ = 2*(tmp3843_); double tmp5256_ = tmp5255_*(tmp298_); double tmp5257_ = tmp5254_-tmp5256_; double tmp5258_ = 0.500000*(tmp5257_); double tmp5259_ = (tmp5258_)/tmp611_; double tmp5260_ = 2*(tmp3878_); double tmp5261_ = tmp5260_*(tmp373_); double tmp5262_ = 2*(tmp3955_); double tmp5263_ = tmp5262_*(tmp493_); double tmp5264_ = tmp5261_+tmp5263_; double tmp5265_ = 2*(tmp3976_); double tmp5266_ = tmp5265_*(tmp509_); double tmp5267_ = tmp5264_+tmp5266_; double tmp5268_ = 2*(tmp3997_); double tmp5269_ = tmp5268_*(tmp525_); double tmp5270_ = tmp5267_+tmp5269_; double tmp5271_ = 2*(tmp4018_); double tmp5272_ = tmp5271_*(tmp541_); double tmp5273_ = tmp5270_+tmp5272_; double tmp5274_ = (tmp5273_)*5; double tmp5275_ = (tmp5274_)/tmp681_; double tmp5276_ = 2*(tmp4024_); double tmp5277_ = tmp5276_*(tmp546_); double tmp5278_ = tmp5275_-tmp5277_; double tmp5279_ = 0.500000*(tmp5278_); double tmp5280_ = (tmp5279_)/tmp1213_; double tmp5281_ = 2*(tmp4035_); double tmp5282_ = tmp5281_*(tmp125_); double tmp5283_ = 2*(tmp4046_); double tmp5284_ = tmp5283_*(tmp245_); double tmp5285_ = tmp5282_+tmp5284_; double tmp5286_ = 2*(tmp4057_); double tmp5287_ = tmp5286_*(tmp261_); double tmp5288_ = tmp5285_+tmp5287_; double tmp5289_ = 2*(tmp4068_); double tmp5290_ = tmp5289_*(tmp277_); double tmp5291_ = tmp5288_+tmp5290_; double tmp5292_ = 2*(tmp4079_); double tmp5293_ = tmp5292_*(tmp293_); double tmp5294_ = tmp5291_+tmp5293_; double tmp5295_ = (tmp5294_)*5; double tmp5296_ = (tmp5295_)/tmp681_; double tmp5297_ = 2*(tmp4085_); double tmp5298_ = tmp5297_*(tmp298_); double tmp5299_ = tmp5296_-tmp5298_; double tmp5300_ = 0.500000*(tmp5299_); double tmp5301_ = (tmp5300_)/tmp611_; double tmp5302_ = 2*(tmp4096_); double tmp5303_ = tmp5302_*(tmp373_); double tmp5304_ = 2*(tmp4107_); double tmp5305_ = tmp5304_*(tmp493_); double tmp5306_ = tmp5303_+tmp5305_; double tmp5307_ = 2*(tmp4118_); double tmp5308_ = tmp5307_*(tmp509_); double tmp5309_ = tmp5306_+tmp5308_; double tmp5310_ = 2*(tmp4129_); double tmp5311_ = tmp5310_*(tmp525_); double tmp5312_ = tmp5309_+tmp5311_; double tmp5313_ = 2*(tmp4140_); double tmp5314_ = tmp5313_*(tmp541_); double tmp5315_ = tmp5312_+tmp5314_; double tmp5316_ = (tmp5315_)*5; double tmp5317_ = (tmp5316_)/tmp681_; double tmp5318_ = 2*(tmp4146_); double tmp5319_ = tmp5318_*(tmp546_); double tmp5320_ = tmp5317_-tmp5319_; double tmp5321_ = 0.500000*(tmp5320_); double tmp5322_ = (tmp5321_)/tmp1213_; double tmp5323_ = 2*(tmp4160_); double tmp5324_ = tmp5323_*(tmp125_); double tmp5325_ = 2*(tmp4171_); double tmp5326_ = tmp5325_*(tmp245_); double tmp5327_ = tmp5324_+tmp5326_; double tmp5328_ = 2*(tmp4182_); double tmp5329_ = tmp5328_*(tmp261_); double tmp5330_ = tmp5327_+tmp5329_; double tmp5331_ = 2*(tmp4193_); double tmp5332_ = tmp5331_*(tmp277_); double tmp5333_ = tmp5330_+tmp5332_; double tmp5334_ = 2*(tmp4204_); double tmp5335_ = tmp5334_*(tmp293_); double tmp5336_ = tmp5333_+tmp5335_; double tmp5337_ = (tmp5336_)*5; double tmp5338_ = (tmp5337_)/tmp681_; double tmp5339_ = 2*(tmp4210_); double tmp5340_ = tmp5339_*(tmp298_); double tmp5341_ = tmp5338_-tmp5340_; double tmp5342_ = 0.500000*(tmp5341_); double tmp5343_ = (tmp5342_)/tmp611_; double tmp5344_ = 2*(tmp4224_); double tmp5345_ = tmp5344_*(tmp373_); double tmp5346_ = 2*(tmp4235_); double tmp5347_ = tmp5346_*(tmp493_); double tmp5348_ = tmp5345_+tmp5347_; double tmp5349_ = 2*(tmp4246_); double tmp5350_ = tmp5349_*(tmp509_); double tmp5351_ = tmp5348_+tmp5350_; double tmp5352_ = 2*(tmp4257_); double tmp5353_ = tmp5352_*(tmp525_); double tmp5354_ = tmp5351_+tmp5353_; double tmp5355_ = 2*(tmp4268_); double tmp5356_ = tmp5355_*(tmp541_); double tmp5357_ = tmp5354_+tmp5356_; double tmp5358_ = (tmp5357_)*5; double tmp5359_ = (tmp5358_)/tmp681_; double tmp5360_ = 2*(tmp4274_); double tmp5361_ = tmp5360_*(tmp546_); double tmp5362_ = tmp5359_-tmp5361_; double tmp5363_ = 0.500000*(tmp5362_); double tmp5364_ = (tmp5363_)/tmp1213_; double tmp5365_ = 2*(tmp4285_); double tmp5366_ = tmp5365_*(tmp125_); double tmp5367_ = 2*(tmp4296_); double tmp5368_ = tmp5367_*(tmp245_); double tmp5369_ = tmp5366_+tmp5368_; double tmp5370_ = 2*(tmp4307_); double tmp5371_ = tmp5370_*(tmp261_); double tmp5372_ = tmp5369_+tmp5371_; double tmp5373_ = 2*(tmp4318_); double tmp5374_ = tmp5373_*(tmp277_); double tmp5375_ = tmp5372_+tmp5374_; double tmp5376_ = 2*(tmp4329_); double tmp5377_ = tmp5376_*(tmp293_); double tmp5378_ = tmp5375_+tmp5377_; double tmp5379_ = (tmp5378_)*5; double tmp5380_ = (tmp5379_)/tmp681_; double tmp5381_ = 2*(tmp4335_); double tmp5382_ = tmp5381_*(tmp298_); double tmp5383_ = tmp5380_-tmp5382_; double tmp5384_ = 0.500000*(tmp5383_); double tmp5385_ = (tmp5384_)/tmp611_; double tmp5386_ = 2*(tmp4346_); double tmp5387_ = tmp5386_*(tmp373_); double tmp5388_ = 2*(tmp4357_); double tmp5389_ = tmp5388_*(tmp493_); double tmp5390_ = tmp5387_+tmp5389_; double tmp5391_ = 2*(tmp4368_); double tmp5392_ = tmp5391_*(tmp509_); double tmp5393_ = tmp5390_+tmp5392_; double tmp5394_ = 2*(tmp4379_); double tmp5395_ = tmp5394_*(tmp525_); double tmp5396_ = tmp5393_+tmp5395_; double tmp5397_ = 2*(tmp4390_); double tmp5398_ = tmp5397_*(tmp541_); double tmp5399_ = tmp5396_+tmp5398_; double tmp5400_ = (tmp5399_)*5; double tmp5401_ = (tmp5400_)/tmp681_; double tmp5402_ = 2*(tmp4396_); double tmp5403_ = tmp5402_*(tmp546_); double tmp5404_ = tmp5401_-tmp5403_; double tmp5405_ = 0.500000*(tmp5404_); double tmp5406_ = (tmp5405_)/tmp1213_; double tmp5407_ = 2*(tmp4410_); double tmp5408_ = tmp5407_*(tmp125_); double tmp5409_ = 2*(tmp4421_); double tmp5410_ = tmp5409_*(tmp245_); double tmp5411_ = tmp5408_+tmp5410_; double tmp5412_ = 2*(tmp4432_); double tmp5413_ = tmp5412_*(tmp261_); double tmp5414_ = tmp5411_+tmp5413_; double tmp5415_ = 2*(tmp4443_); double tmp5416_ = tmp5415_*(tmp277_); double tmp5417_ = tmp5414_+tmp5416_; double tmp5418_ = 2*(tmp4454_); double tmp5419_ = tmp5418_*(tmp293_); double tmp5420_ = tmp5417_+tmp5419_; double tmp5421_ = (tmp5420_)*5; double tmp5422_ = (tmp5421_)/tmp681_; double tmp5423_ = 2*(tmp4460_); double tmp5424_ = tmp5423_*(tmp298_); double tmp5425_ = tmp5422_-tmp5424_; double tmp5426_ = 0.500000*(tmp5425_); double tmp5427_ = (tmp5426_)/tmp611_; double tmp5428_ = 2*(tmp4474_); double tmp5429_ = tmp5428_*(tmp373_); double tmp5430_ = 2*(tmp4485_); double tmp5431_ = tmp5430_*(tmp493_); double tmp5432_ = tmp5429_+tmp5431_; double tmp5433_ = 2*(tmp4496_); double tmp5434_ = tmp5433_*(tmp509_); double tmp5435_ = tmp5432_+tmp5434_; double tmp5436_ = 2*(tmp4507_); double tmp5437_ = tmp5436_*(tmp525_); double tmp5438_ = tmp5435_+tmp5437_; double tmp5439_ = 2*(tmp4518_); double tmp5440_ = tmp5439_*(tmp541_); double tmp5441_ = tmp5438_+tmp5440_; double tmp5442_ = (tmp5441_)*5; double tmp5443_ = (tmp5442_)/tmp681_; double tmp5444_ = 2*(tmp4524_); double tmp5445_ = tmp5444_*(tmp546_); double tmp5446_ = tmp5443_-tmp5445_; double tmp5447_ = 0.500000*(tmp5446_); double tmp5448_ = (tmp5447_)/tmp1213_; double tmp5449_ = 2*(tmp4535_); double tmp5450_ = tmp5449_*(tmp125_); double tmp5451_ = 2*(tmp4546_); double tmp5452_ = tmp5451_*(tmp245_); double tmp5453_ = tmp5450_+tmp5452_; double tmp5454_ = 2*(tmp4557_); double tmp5455_ = tmp5454_*(tmp261_); double tmp5456_ = tmp5453_+tmp5455_; double tmp5457_ = 2*(tmp4568_); double tmp5458_ = tmp5457_*(tmp277_); double tmp5459_ = tmp5456_+tmp5458_; double tmp5460_ = 2*(tmp4579_); double tmp5461_ = tmp5460_*(tmp293_); double tmp5462_ = tmp5459_+tmp5461_; double tmp5463_ = (tmp5462_)*5; double tmp5464_ = (tmp5463_)/tmp681_; double tmp5465_ = 2*(tmp4585_); double tmp5466_ = tmp5465_*(tmp298_); double tmp5467_ = tmp5464_-tmp5466_; double tmp5468_ = 0.500000*(tmp5467_); double tmp5469_ = (tmp5468_)/tmp611_; double tmp5470_ = 2*(tmp4596_); double tmp5471_ = tmp5470_*(tmp373_); double tmp5472_ = 2*(tmp4607_); double tmp5473_ = tmp5472_*(tmp493_); double tmp5474_ = tmp5471_+tmp5473_; double tmp5475_ = 2*(tmp4618_); double tmp5476_ = tmp5475_*(tmp509_); double tmp5477_ = tmp5474_+tmp5476_; double tmp5478_ = 2*(tmp4629_); double tmp5479_ = tmp5478_*(tmp525_); double tmp5480_ = tmp5477_+tmp5479_; double tmp5481_ = 2*(tmp4640_); double tmp5482_ = tmp5481_*(tmp541_); double tmp5483_ = tmp5480_+tmp5482_; double tmp5484_ = (tmp5483_)*5; double tmp5485_ = (tmp5484_)/tmp681_; double tmp5486_ = 2*(tmp4646_); double tmp5487_ = tmp5486_*(tmp546_); double tmp5488_ = tmp5485_-tmp5487_; double tmp5489_ = 0.500000*(tmp5488_); double tmp5490_ = (tmp5489_)/tmp1213_; double tmp5491_ = 2*(tmp4660_); double tmp5492_ = tmp5491_*(tmp125_); double tmp5493_ = 2*(tmp4671_); double tmp5494_ = tmp5493_*(tmp245_); double tmp5495_ = tmp5492_+tmp5494_; double tmp5496_ = 2*(tmp4682_); double tmp5497_ = tmp5496_*(tmp261_); double tmp5498_ = tmp5495_+tmp5497_; double tmp5499_ = 2*(tmp4693_); double tmp5500_ = tmp5499_*(tmp277_); double tmp5501_ = tmp5498_+tmp5500_; double tmp5502_ = 2*(tmp4704_); double tmp5503_ = tmp5502_*(tmp293_); double tmp5504_ = tmp5501_+tmp5503_; double tmp5505_ = (tmp5504_)*5; double tmp5506_ = (tmp5505_)/tmp681_; double tmp5507_ = 2*(tmp4710_); double tmp5508_ = tmp5507_*(tmp298_); double tmp5509_ = tmp5506_-tmp5508_; double tmp5510_ = 0.500000*(tmp5509_); double tmp5511_ = (tmp5510_)/tmp611_; double tmp5512_ = 2*(tmp4724_); double tmp5513_ = tmp5512_*(tmp373_); double tmp5514_ = 2*(tmp4735_); double tmp5515_ = tmp5514_*(tmp493_); double tmp5516_ = tmp5513_+tmp5515_; double tmp5517_ = 2*(tmp4746_); double tmp5518_ = tmp5517_*(tmp509_); double tmp5519_ = tmp5516_+tmp5518_; double tmp5520_ = 2*(tmp4757_); double tmp5521_ = tmp5520_*(tmp525_); double tmp5522_ = tmp5519_+tmp5521_; double tmp5523_ = 2*(tmp4768_); double tmp5524_ = tmp5523_*(tmp541_); double tmp5525_ = tmp5522_+tmp5524_; double tmp5526_ = (tmp5525_)*5; double tmp5527_ = (tmp5526_)/tmp681_; double tmp5528_ = 2*(tmp4774_); double tmp5529_ = tmp5528_*(tmp546_); double tmp5530_ = tmp5527_-tmp5529_; double tmp5531_ = 0.500000*(tmp5530_); double tmp5532_ = (tmp5531_)/tmp1213_; double tmp5533_ = (tmp261_)-tmp298_; double tmp5534_ = (tmp509_)-tmp546_; double tmp5535_ = (tmp277_)-tmp298_; double tmp5536_ = (tmp525_)-tmp546_; double tmp5537_ = (tmp293_)-tmp298_; double tmp5538_ = (tmp541_)-tmp546_; mVal[0] = (tmp612_)/tmp611_-(tmp1214_)/tmp1213_; mCompDer[0][0] = (((tmp582_)-tmp687_)*tmp611_-(tmp612_)*(tmp4796_))/tmp836_; mCompDer[0][1] = (((tmp725_)-tmp835_)*tmp611_-(tmp612_)*(tmp4817_))/tmp836_; mCompDer[0][2] = (((tmp872_)-tmp958_)*tmp611_-(tmp612_)*(tmp4838_))/tmp836_; mCompDer[0][3] = (((tmp972_)-tmp1022_)*tmp611_-(tmp612_)*(tmp4859_))/tmp836_; mCompDer[0][4] = (((tmp1036_)-tmp1086_)*tmp611_-(tmp612_)*(tmp4880_))/tmp836_; mCompDer[0][5] = (((tmp1099_)-tmp1149_)*tmp611_-(tmp612_)*(tmp4901_))/tmp836_; mCompDer[0][6] = -((((tmp1184_)-tmp1288_)*tmp1213_-(tmp1214_)*(tmp4923_))/tmp1437_); mCompDer[0][7] = -((((tmp1326_)-tmp1436_)*tmp1213_-(tmp1214_)*(tmp4944_))/tmp1437_); mCompDer[0][8] = -((((tmp1473_)-tmp1559_)*tmp1213_-(tmp1214_)*(tmp4965_))/tmp1437_); mCompDer[0][9] = -((((tmp1573_)-tmp1623_)*tmp1213_-(tmp1214_)*(tmp4986_))/tmp1437_); mCompDer[0][10] = -((((tmp1637_)-tmp1687_)*tmp1213_-(tmp1214_)*(tmp5007_))/tmp1437_); mCompDer[0][11] = -((((tmp1700_)-tmp1750_)*tmp1213_-(tmp1214_)*(tmp5028_))/tmp1437_); mCompDer[0][12] = (((tmp1793_)-tmp1915_)*tmp611_-(tmp612_)*(tmp5049_))/tmp836_-(((tmp1944_)-tmp2066_)*tmp1213_-(tmp1214_)*(tmp5070_))/tmp1437_; mCompDer[0][13] = (((tmp2116_)-tmp2242_)*tmp611_-(tmp612_)*(tmp5091_))/tmp836_-(((tmp2272_)-tmp2398_)*tmp1213_-(tmp1214_)*(tmp5112_))/tmp1437_; mCompDer[0][14] = (((tmp2451_)-tmp2621_)*tmp611_-(tmp612_)*(tmp5133_))/tmp836_-(((tmp2662_)-tmp2832_)*tmp1213_-(tmp1214_)*(tmp5154_))/tmp1437_; mCompDer[0][15] = (((tmp2886_)-tmp3056_)*tmp611_-(tmp612_)*(tmp5175_))/tmp836_-(((tmp3097_)-tmp3267_)*tmp1213_-(tmp1214_)*(tmp5196_))/tmp1437_; mCompDer[0][16] = (((tmp3318_)-tmp3464_)*tmp611_-(tmp612_)*(tmp5217_))/tmp836_-(((tmp3499_)-tmp3645_)*tmp1213_-(tmp1214_)*(tmp5238_))/tmp1437_; mCompDer[0][17] = (((tmp3697_)-tmp3843_)*tmp611_-(tmp612_)*(tmp5259_))/tmp836_-(((tmp3878_)-tmp4024_)*tmp1213_-(tmp1214_)*(tmp5280_))/tmp1437_; mCompDer[0][18] = (((tmp4035_)-tmp4085_)*tmp611_-(tmp612_)*(tmp5301_))/tmp836_-(((tmp4096_)-tmp4146_)*tmp1213_-(tmp1214_)*(tmp5322_))/tmp1437_; mCompDer[0][19] = (((tmp4160_)-tmp4210_)*tmp611_-(tmp612_)*(tmp5343_))/tmp836_-(((tmp4224_)-tmp4274_)*tmp1213_-(tmp1214_)*(tmp5364_))/tmp1437_; mCompDer[0][20] = (((tmp4285_)-tmp4335_)*tmp611_-(tmp612_)*(tmp5385_))/tmp836_-(((tmp4346_)-tmp4396_)*tmp1213_-(tmp1214_)*(tmp5406_))/tmp1437_; mCompDer[0][21] = (((tmp4410_)-tmp4460_)*tmp611_-(tmp612_)*(tmp5427_))/tmp836_-(((tmp4474_)-tmp4524_)*tmp1213_-(tmp1214_)*(tmp5448_))/tmp1437_; mCompDer[0][22] = (((tmp4535_)-tmp4585_)*tmp611_-(tmp612_)*(tmp5469_))/tmp836_-(((tmp4596_)-tmp4646_)*tmp1213_-(tmp1214_)*(tmp5490_))/tmp1437_; mCompDer[0][23] = (((tmp4660_)-tmp4710_)*tmp611_-(tmp612_)*(tmp5511_))/tmp836_-(((tmp4724_)-tmp4774_)*tmp1213_-(tmp1214_)*(tmp5532_))/tmp1437_; mVal[1] = (tmp4775_)/tmp611_-(tmp4902_)/tmp1213_; mCompDer[1][0] = (((tmp629_)-tmp687_)*tmp611_-(tmp4775_)*(tmp4796_))/tmp836_; mCompDer[1][1] = (((tmp766_)-tmp835_)*tmp611_-(tmp4775_)*(tmp4817_))/tmp836_; mCompDer[1][2] = (((tmp907_)-tmp958_)*tmp611_-(tmp4775_)*(tmp4838_))/tmp836_; mCompDer[1][3] = (((tmp983_)-tmp1022_)*tmp611_-(tmp4775_)*(tmp4859_))/tmp836_; mCompDer[1][4] = (((tmp1047_)-tmp1086_)*tmp611_-(tmp4775_)*(tmp4880_))/tmp836_; mCompDer[1][5] = (((tmp1110_)-tmp1149_)*tmp611_-(tmp4775_)*(tmp4901_))/tmp836_; mCompDer[1][6] = -((((tmp1231_)-tmp1288_)*tmp1213_-(tmp4902_)*(tmp4923_))/tmp1437_); mCompDer[1][7] = -((((tmp1367_)-tmp1436_)*tmp1213_-(tmp4902_)*(tmp4944_))/tmp1437_); mCompDer[1][8] = -((((tmp1508_)-tmp1559_)*tmp1213_-(tmp4902_)*(tmp4965_))/tmp1437_); mCompDer[1][9] = -((((tmp1584_)-tmp1623_)*tmp1213_-(tmp4902_)*(tmp4986_))/tmp1437_); mCompDer[1][10] = -((((tmp1648_)-tmp1687_)*tmp1213_-(tmp4902_)*(tmp5007_))/tmp1437_); mCompDer[1][11] = -((((tmp1711_)-tmp1750_)*tmp1213_-(tmp4902_)*(tmp5028_))/tmp1437_); mCompDer[1][12] = (((tmp1858_)-tmp1915_)*tmp611_-(tmp4775_)*(tmp5049_))/tmp836_-(((tmp2009_)-tmp2066_)*tmp1213_-(tmp4902_)*(tmp5070_))/tmp1437_; mCompDer[1][13] = (((tmp2185_)-tmp2242_)*tmp611_-(tmp4775_)*(tmp5091_))/tmp836_-(((tmp2341_)-tmp2398_)*tmp1213_-(tmp4902_)*(tmp5112_))/tmp1437_; mCompDer[1][14] = (((tmp2552_)-tmp2621_)*tmp611_-(tmp4775_)*(tmp5133_))/tmp836_-(((tmp2763_)-tmp2832_)*tmp1213_-(tmp4902_)*(tmp5154_))/tmp1437_; mCompDer[1][15] = (((tmp2987_)-tmp3056_)*tmp611_-(tmp4775_)*(tmp5175_))/tmp836_-(((tmp3198_)-tmp3267_)*tmp1213_-(tmp4902_)*(tmp5196_))/tmp1437_; mCompDer[1][16] = (((tmp3395_)-tmp3464_)*tmp611_-(tmp4775_)*(tmp5217_))/tmp836_-(((tmp3576_)-tmp3645_)*tmp1213_-(tmp4902_)*(tmp5238_))/tmp1437_; mCompDer[1][17] = (((tmp3774_)-tmp3843_)*tmp611_-(tmp4775_)*(tmp5259_))/tmp836_-(((tmp3955_)-tmp4024_)*tmp1213_-(tmp4902_)*(tmp5280_))/tmp1437_; mCompDer[1][18] = (((tmp4046_)-tmp4085_)*tmp611_-(tmp4775_)*(tmp5301_))/tmp836_-(((tmp4107_)-tmp4146_)*tmp1213_-(tmp4902_)*(tmp5322_))/tmp1437_; mCompDer[1][19] = (((tmp4171_)-tmp4210_)*tmp611_-(tmp4775_)*(tmp5343_))/tmp836_-(((tmp4235_)-tmp4274_)*tmp1213_-(tmp4902_)*(tmp5364_))/tmp1437_; mCompDer[1][20] = (((tmp4296_)-tmp4335_)*tmp611_-(tmp4775_)*(tmp5385_))/tmp836_-(((tmp4357_)-tmp4396_)*tmp1213_-(tmp4902_)*(tmp5406_))/tmp1437_; mCompDer[1][21] = (((tmp4421_)-tmp4460_)*tmp611_-(tmp4775_)*(tmp5427_))/tmp836_-(((tmp4485_)-tmp4524_)*tmp1213_-(tmp4902_)*(tmp5448_))/tmp1437_; mCompDer[1][22] = (((tmp4546_)-tmp4585_)*tmp611_-(tmp4775_)*(tmp5469_))/tmp836_-(((tmp4607_)-tmp4646_)*tmp1213_-(tmp4902_)*(tmp5490_))/tmp1437_; mCompDer[1][23] = (((tmp4671_)-tmp4710_)*tmp611_-(tmp4775_)*(tmp5511_))/tmp836_-(((tmp4735_)-tmp4774_)*tmp1213_-(tmp4902_)*(tmp5532_))/tmp1437_; mVal[2] = (tmp5533_)/tmp611_-(tmp5534_)/tmp1213_; mCompDer[2][0] = (((tmp646_)-tmp687_)*tmp611_-(tmp5533_)*(tmp4796_))/tmp836_; mCompDer[2][1] = (((tmp787_)-tmp835_)*tmp611_-(tmp5533_)*(tmp4817_))/tmp836_; mCompDer[2][2] = (((tmp922_)-tmp958_)*tmp611_-(tmp5533_)*(tmp4838_))/tmp836_; mCompDer[2][3] = (((tmp994_)-tmp1022_)*tmp611_-(tmp5533_)*(tmp4859_))/tmp836_; mCompDer[2][4] = (((tmp1058_)-tmp1086_)*tmp611_-(tmp5533_)*(tmp4880_))/tmp836_; mCompDer[2][5] = (((tmp1121_)-tmp1149_)*tmp611_-(tmp5533_)*(tmp4901_))/tmp836_; mCompDer[2][6] = -((((tmp1248_)-tmp1288_)*tmp1213_-(tmp5534_)*(tmp4923_))/tmp1437_); mCompDer[2][7] = -((((tmp1388_)-tmp1436_)*tmp1213_-(tmp5534_)*(tmp4944_))/tmp1437_); mCompDer[2][8] = -((((tmp1523_)-tmp1559_)*tmp1213_-(tmp5534_)*(tmp4965_))/tmp1437_); mCompDer[2][9] = -((((tmp1595_)-tmp1623_)*tmp1213_-(tmp5534_)*(tmp4986_))/tmp1437_); mCompDer[2][10] = -((((tmp1659_)-tmp1687_)*tmp1213_-(tmp5534_)*(tmp5007_))/tmp1437_); mCompDer[2][11] = -((((tmp1722_)-tmp1750_)*tmp1213_-(tmp5534_)*(tmp5028_))/tmp1437_); mCompDer[2][12] = (((tmp1875_)-tmp1915_)*tmp611_-(tmp5533_)*(tmp5049_))/tmp836_-(((tmp2026_)-tmp2066_)*tmp1213_-(tmp5534_)*(tmp5070_))/tmp1437_; mCompDer[2][13] = (((tmp2202_)-tmp2242_)*tmp611_-(tmp5533_)*(tmp5091_))/tmp836_-(((tmp2358_)-tmp2398_)*tmp1213_-(tmp5534_)*(tmp5112_))/tmp1437_; mCompDer[2][14] = (((tmp2573_)-tmp2621_)*tmp611_-(tmp5533_)*(tmp5133_))/tmp836_-(((tmp2784_)-tmp2832_)*tmp1213_-(tmp5534_)*(tmp5154_))/tmp1437_; mCompDer[2][15] = (((tmp3008_)-tmp3056_)*tmp611_-(tmp5533_)*(tmp5175_))/tmp836_-(((tmp3219_)-tmp3267_)*tmp1213_-(tmp5534_)*(tmp5196_))/tmp1437_; mCompDer[2][16] = (((tmp3416_)-tmp3464_)*tmp611_-(tmp5533_)*(tmp5217_))/tmp836_-(((tmp3597_)-tmp3645_)*tmp1213_-(tmp5534_)*(tmp5238_))/tmp1437_; mCompDer[2][17] = (((tmp3795_)-tmp3843_)*tmp611_-(tmp5533_)*(tmp5259_))/tmp836_-(((tmp3976_)-tmp4024_)*tmp1213_-(tmp5534_)*(tmp5280_))/tmp1437_; mCompDer[2][18] = (((tmp4057_)-tmp4085_)*tmp611_-(tmp5533_)*(tmp5301_))/tmp836_-(((tmp4118_)-tmp4146_)*tmp1213_-(tmp5534_)*(tmp5322_))/tmp1437_; mCompDer[2][19] = (((tmp4182_)-tmp4210_)*tmp611_-(tmp5533_)*(tmp5343_))/tmp836_-(((tmp4246_)-tmp4274_)*tmp1213_-(tmp5534_)*(tmp5364_))/tmp1437_; mCompDer[2][20] = (((tmp4307_)-tmp4335_)*tmp611_-(tmp5533_)*(tmp5385_))/tmp836_-(((tmp4368_)-tmp4396_)*tmp1213_-(tmp5534_)*(tmp5406_))/tmp1437_; mCompDer[2][21] = (((tmp4432_)-tmp4460_)*tmp611_-(tmp5533_)*(tmp5427_))/tmp836_-(((tmp4496_)-tmp4524_)*tmp1213_-(tmp5534_)*(tmp5448_))/tmp1437_; mCompDer[2][22] = (((tmp4557_)-tmp4585_)*tmp611_-(tmp5533_)*(tmp5469_))/tmp836_-(((tmp4618_)-tmp4646_)*tmp1213_-(tmp5534_)*(tmp5490_))/tmp1437_; mCompDer[2][23] = (((tmp4682_)-tmp4710_)*tmp611_-(tmp5533_)*(tmp5511_))/tmp836_-(((tmp4746_)-tmp4774_)*tmp1213_-(tmp5534_)*(tmp5532_))/tmp1437_; mVal[3] = (tmp5535_)/tmp611_-(tmp5536_)/tmp1213_; mCompDer[3][0] = (((tmp663_)-tmp687_)*tmp611_-(tmp5535_)*(tmp4796_))/tmp836_; mCompDer[3][1] = (((tmp808_)-tmp835_)*tmp611_-(tmp5535_)*(tmp4817_))/tmp836_; mCompDer[3][2] = (((tmp937_)-tmp958_)*tmp611_-(tmp5535_)*(tmp4838_))/tmp836_; mCompDer[3][3] = (((tmp1005_)-tmp1022_)*tmp611_-(tmp5535_)*(tmp4859_))/tmp836_; mCompDer[3][4] = (((tmp1069_)-tmp1086_)*tmp611_-(tmp5535_)*(tmp4880_))/tmp836_; mCompDer[3][5] = (((tmp1132_)-tmp1149_)*tmp611_-(tmp5535_)*(tmp4901_))/tmp836_; mCompDer[3][6] = -((((tmp1265_)-tmp1288_)*tmp1213_-(tmp5536_)*(tmp4923_))/tmp1437_); mCompDer[3][7] = -((((tmp1409_)-tmp1436_)*tmp1213_-(tmp5536_)*(tmp4944_))/tmp1437_); mCompDer[3][8] = -((((tmp1538_)-tmp1559_)*tmp1213_-(tmp5536_)*(tmp4965_))/tmp1437_); mCompDer[3][9] = -((((tmp1606_)-tmp1623_)*tmp1213_-(tmp5536_)*(tmp4986_))/tmp1437_); mCompDer[3][10] = -((((tmp1670_)-tmp1687_)*tmp1213_-(tmp5536_)*(tmp5007_))/tmp1437_); mCompDer[3][11] = -((((tmp1733_)-tmp1750_)*tmp1213_-(tmp5536_)*(tmp5028_))/tmp1437_); mCompDer[3][12] = (((tmp1892_)-tmp1915_)*tmp611_-(tmp5535_)*(tmp5049_))/tmp836_-(((tmp2043_)-tmp2066_)*tmp1213_-(tmp5536_)*(tmp5070_))/tmp1437_; mCompDer[3][13] = (((tmp2219_)-tmp2242_)*tmp611_-(tmp5535_)*(tmp5091_))/tmp836_-(((tmp2375_)-tmp2398_)*tmp1213_-(tmp5536_)*(tmp5112_))/tmp1437_; mCompDer[3][14] = (((tmp2594_)-tmp2621_)*tmp611_-(tmp5535_)*(tmp5133_))/tmp836_-(((tmp2805_)-tmp2832_)*tmp1213_-(tmp5536_)*(tmp5154_))/tmp1437_; mCompDer[3][15] = (((tmp3029_)-tmp3056_)*tmp611_-(tmp5535_)*(tmp5175_))/tmp836_-(((tmp3240_)-tmp3267_)*tmp1213_-(tmp5536_)*(tmp5196_))/tmp1437_; mCompDer[3][16] = (((tmp3437_)-tmp3464_)*tmp611_-(tmp5535_)*(tmp5217_))/tmp836_-(((tmp3618_)-tmp3645_)*tmp1213_-(tmp5536_)*(tmp5238_))/tmp1437_; mCompDer[3][17] = (((tmp3816_)-tmp3843_)*tmp611_-(tmp5535_)*(tmp5259_))/tmp836_-(((tmp3997_)-tmp4024_)*tmp1213_-(tmp5536_)*(tmp5280_))/tmp1437_; mCompDer[3][18] = (((tmp4068_)-tmp4085_)*tmp611_-(tmp5535_)*(tmp5301_))/tmp836_-(((tmp4129_)-tmp4146_)*tmp1213_-(tmp5536_)*(tmp5322_))/tmp1437_; mCompDer[3][19] = (((tmp4193_)-tmp4210_)*tmp611_-(tmp5535_)*(tmp5343_))/tmp836_-(((tmp4257_)-tmp4274_)*tmp1213_-(tmp5536_)*(tmp5364_))/tmp1437_; mCompDer[3][20] = (((tmp4318_)-tmp4335_)*tmp611_-(tmp5535_)*(tmp5385_))/tmp836_-(((tmp4379_)-tmp4396_)*tmp1213_-(tmp5536_)*(tmp5406_))/tmp1437_; mCompDer[3][21] = (((tmp4443_)-tmp4460_)*tmp611_-(tmp5535_)*(tmp5427_))/tmp836_-(((tmp4507_)-tmp4524_)*tmp1213_-(tmp5536_)*(tmp5448_))/tmp1437_; mCompDer[3][22] = (((tmp4568_)-tmp4585_)*tmp611_-(tmp5535_)*(tmp5469_))/tmp836_-(((tmp4629_)-tmp4646_)*tmp1213_-(tmp5536_)*(tmp5490_))/tmp1437_; mCompDer[3][23] = (((tmp4693_)-tmp4710_)*tmp611_-(tmp5535_)*(tmp5511_))/tmp836_-(((tmp4757_)-tmp4774_)*tmp1213_-(tmp5536_)*(tmp5532_))/tmp1437_; mVal[4] = (tmp5537_)/tmp611_-(tmp5538_)/tmp1213_; mCompDer[4][0] = (((tmp680_)-tmp687_)*tmp611_-(tmp5537_)*(tmp4796_))/tmp836_; mCompDer[4][1] = (((tmp829_)-tmp835_)*tmp611_-(tmp5537_)*(tmp4817_))/tmp836_; mCompDer[4][2] = (((tmp952_)-tmp958_)*tmp611_-(tmp5537_)*(tmp4838_))/tmp836_; mCompDer[4][3] = (((tmp1016_)-tmp1022_)*tmp611_-(tmp5537_)*(tmp4859_))/tmp836_; mCompDer[4][4] = (((tmp1080_)-tmp1086_)*tmp611_-(tmp5537_)*(tmp4880_))/tmp836_; mCompDer[4][5] = (((tmp1143_)-tmp1149_)*tmp611_-(tmp5537_)*(tmp4901_))/tmp836_; mCompDer[4][6] = -((((tmp1282_)-tmp1288_)*tmp1213_-(tmp5538_)*(tmp4923_))/tmp1437_); mCompDer[4][7] = -((((tmp1430_)-tmp1436_)*tmp1213_-(tmp5538_)*(tmp4944_))/tmp1437_); mCompDer[4][8] = -((((tmp1553_)-tmp1559_)*tmp1213_-(tmp5538_)*(tmp4965_))/tmp1437_); mCompDer[4][9] = -((((tmp1617_)-tmp1623_)*tmp1213_-(tmp5538_)*(tmp4986_))/tmp1437_); mCompDer[4][10] = -((((tmp1681_)-tmp1687_)*tmp1213_-(tmp5538_)*(tmp5007_))/tmp1437_); mCompDer[4][11] = -((((tmp1744_)-tmp1750_)*tmp1213_-(tmp5538_)*(tmp5028_))/tmp1437_); mCompDer[4][12] = (((tmp1909_)-tmp1915_)*tmp611_-(tmp5537_)*(tmp5049_))/tmp836_-(((tmp2060_)-tmp2066_)*tmp1213_-(tmp5538_)*(tmp5070_))/tmp1437_; mCompDer[4][13] = (((tmp2236_)-tmp2242_)*tmp611_-(tmp5537_)*(tmp5091_))/tmp836_-(((tmp2392_)-tmp2398_)*tmp1213_-(tmp5538_)*(tmp5112_))/tmp1437_; mCompDer[4][14] = (((tmp2615_)-tmp2621_)*tmp611_-(tmp5537_)*(tmp5133_))/tmp836_-(((tmp2826_)-tmp2832_)*tmp1213_-(tmp5538_)*(tmp5154_))/tmp1437_; mCompDer[4][15] = (((tmp3050_)-tmp3056_)*tmp611_-(tmp5537_)*(tmp5175_))/tmp836_-(((tmp3261_)-tmp3267_)*tmp1213_-(tmp5538_)*(tmp5196_))/tmp1437_; mCompDer[4][16] = (((tmp3458_)-tmp3464_)*tmp611_-(tmp5537_)*(tmp5217_))/tmp836_-(((tmp3639_)-tmp3645_)*tmp1213_-(tmp5538_)*(tmp5238_))/tmp1437_; mCompDer[4][17] = (((tmp3837_)-tmp3843_)*tmp611_-(tmp5537_)*(tmp5259_))/tmp836_-(((tmp4018_)-tmp4024_)*tmp1213_-(tmp5538_)*(tmp5280_))/tmp1437_; mCompDer[4][18] = (((tmp4079_)-tmp4085_)*tmp611_-(tmp5537_)*(tmp5301_))/tmp836_-(((tmp4140_)-tmp4146_)*tmp1213_-(tmp5538_)*(tmp5322_))/tmp1437_; mCompDer[4][19] = (((tmp4204_)-tmp4210_)*tmp611_-(tmp5537_)*(tmp5343_))/tmp836_-(((tmp4268_)-tmp4274_)*tmp1213_-(tmp5538_)*(tmp5364_))/tmp1437_; mCompDer[4][20] = (((tmp4329_)-tmp4335_)*tmp611_-(tmp5537_)*(tmp5385_))/tmp836_-(((tmp4390_)-tmp4396_)*tmp1213_-(tmp5538_)*(tmp5406_))/tmp1437_; mCompDer[4][21] = (((tmp4454_)-tmp4460_)*tmp611_-(tmp5537_)*(tmp5427_))/tmp836_-(((tmp4518_)-tmp4524_)*tmp1213_-(tmp5538_)*(tmp5448_))/tmp1437_; mCompDer[4][22] = (((tmp4579_)-tmp4585_)*tmp611_-(tmp5537_)*(tmp5469_))/tmp836_-(((tmp4640_)-tmp4646_)*tmp1213_-(tmp5538_)*(tmp5490_))/tmp1437_; mCompDer[4][23] = (((tmp4704_)-tmp4710_)*tmp611_-(tmp5537_)*(tmp5511_))/tmp836_-(((tmp4768_)-tmp4774_)*tmp1213_-(tmp5538_)*(tmp5532_))/tmp1437_; } void cEqCorLI_Multi_5_DRPts1::ComputeValDerivHessian() { ELISE_ASSERT(false,"Foncteur cEqCorLI_Multi_5_DRPts1 Has no Der Sec"); } void cEqCorLI_Multi_5_DRPts1::SetCoeffU_A_0(double aVal){ mLocCoeffU_A_0 = aVal;} void cEqCorLI_Multi_5_DRPts1::SetCoeffU_A_1(double aVal){ mLocCoeffU_A_1 = aVal;} void cEqCorLI_Multi_5_DRPts1::SetCoeffU_A_2(double aVal){ mLocCoeffU_A_2 = aVal;} void cEqCorLI_Multi_5_DRPts1::SetCoeffU_A_3(double aVal){ mLocCoeffU_A_3 = aVal;} void cEqCorLI_Multi_5_DRPts1::SetCoeffU_A_4(double aVal){ mLocCoeffU_A_4 = aVal;} void cEqCorLI_Multi_5_DRPts1::SetCoeffU_B_0(double aVal){ mLocCoeffU_B_0 = aVal;} void cEqCorLI_Multi_5_DRPts1::SetCoeffU_B_1(double aVal){ mLocCoeffU_B_1 = aVal;} void cEqCorLI_Multi_5_DRPts1::SetCoeffU_B_2(double aVal){ mLocCoeffU_B_2 = aVal;} void cEqCorLI_Multi_5_DRPts1::SetCoeffU_B_3(double aVal){ mLocCoeffU_B_3 = aVal;} void cEqCorLI_Multi_5_DRPts1::SetCoeffU_B_4(double aVal){ mLocCoeffU_B_4 = aVal;} void cEqCorLI_Multi_5_DRPts1::SetCoeffV_A_0(double aVal){ mLocCoeffV_A_0 = aVal;} void cEqCorLI_Multi_5_DRPts1::SetCoeffV_A_1(double aVal){ mLocCoeffV_A_1 = aVal;} void cEqCorLI_Multi_5_DRPts1::SetCoeffV_A_2(double aVal){ mLocCoeffV_A_2 = aVal;} void cEqCorLI_Multi_5_DRPts1::SetCoeffV_A_3(double aVal){ mLocCoeffV_A_3 = aVal;} void cEqCorLI_Multi_5_DRPts1::SetCoeffV_A_4(double aVal){ mLocCoeffV_A_4 = aVal;} void cEqCorLI_Multi_5_DRPts1::SetCoeffV_B_0(double aVal){ mLocCoeffV_B_0 = aVal;} void cEqCorLI_Multi_5_DRPts1::SetCoeffV_B_1(double aVal){ mLocCoeffV_B_1 = aVal;} void cEqCorLI_Multi_5_DRPts1::SetCoeffV_B_2(double aVal){ mLocCoeffV_B_2 = aVal;} void cEqCorLI_Multi_5_DRPts1::SetCoeffV_B_3(double aVal){ mLocCoeffV_B_3 = aVal;} void cEqCorLI_Multi_5_DRPts1::SetCoeffV_B_4(double aVal){ mLocCoeffV_B_4 = aVal;} void cEqCorLI_Multi_5_DRPts1::SetCste_A_0(double aVal){ mLocCste_A_0 = aVal;} void cEqCorLI_Multi_5_DRPts1::SetCste_A_1(double aVal){ mLocCste_A_1 = aVal;} void cEqCorLI_Multi_5_DRPts1::SetCste_A_2(double aVal){ mLocCste_A_2 = aVal;} void cEqCorLI_Multi_5_DRPts1::SetCste_A_3(double aVal){ mLocCste_A_3 = aVal;} void cEqCorLI_Multi_5_DRPts1::SetCste_A_4(double aVal){ mLocCste_A_4 = aVal;} void cEqCorLI_Multi_5_DRPts1::SetCste_B_0(double aVal){ mLocCste_B_0 = aVal;} void cEqCorLI_Multi_5_DRPts1::SetCste_B_1(double aVal){ mLocCste_B_1 = aVal;} void cEqCorLI_Multi_5_DRPts1::SetCste_B_2(double aVal){ mLocCste_B_2 = aVal;} void cEqCorLI_Multi_5_DRPts1::SetCste_B_3(double aVal){ mLocCste_B_3 = aVal;} void cEqCorLI_Multi_5_DRPts1::SetCste_B_4(double aVal){ mLocCste_B_4 = aVal;} void cEqCorLI_Multi_5_DRPts1::SetP3X_A_0(double aVal){ mLocP3X_A_0 = aVal;} void cEqCorLI_Multi_5_DRPts1::SetP3X_A_1(double aVal){ mLocP3X_A_1 = aVal;} void cEqCorLI_Multi_5_DRPts1::SetP3X_A_2(double aVal){ mLocP3X_A_2 = aVal;} void cEqCorLI_Multi_5_DRPts1::SetP3X_A_3(double aVal){ mLocP3X_A_3 = aVal;} void cEqCorLI_Multi_5_DRPts1::SetP3X_A_4(double aVal){ mLocP3X_A_4 = aVal;} void cEqCorLI_Multi_5_DRPts1::SetP3X_B_0(double aVal){ mLocP3X_B_0 = aVal;} void cEqCorLI_Multi_5_DRPts1::SetP3X_B_1(double aVal){ mLocP3X_B_1 = aVal;} void cEqCorLI_Multi_5_DRPts1::SetP3X_B_2(double aVal){ mLocP3X_B_2 = aVal;} void cEqCorLI_Multi_5_DRPts1::SetP3X_B_3(double aVal){ mLocP3X_B_3 = aVal;} void cEqCorLI_Multi_5_DRPts1::SetP3X_B_4(double aVal){ mLocP3X_B_4 = aVal;} void cEqCorLI_Multi_5_DRPts1::SetP3Y_A_0(double aVal){ mLocP3Y_A_0 = aVal;} void cEqCorLI_Multi_5_DRPts1::SetP3Y_A_1(double aVal){ mLocP3Y_A_1 = aVal;} void cEqCorLI_Multi_5_DRPts1::SetP3Y_A_2(double aVal){ mLocP3Y_A_2 = aVal;} void cEqCorLI_Multi_5_DRPts1::SetP3Y_A_3(double aVal){ mLocP3Y_A_3 = aVal;} void cEqCorLI_Multi_5_DRPts1::SetP3Y_A_4(double aVal){ mLocP3Y_A_4 = aVal;} void cEqCorLI_Multi_5_DRPts1::SetP3Y_B_0(double aVal){ mLocP3Y_B_0 = aVal;} void cEqCorLI_Multi_5_DRPts1::SetP3Y_B_1(double aVal){ mLocP3Y_B_1 = aVal;} void cEqCorLI_Multi_5_DRPts1::SetP3Y_B_2(double aVal){ mLocP3Y_B_2 = aVal;} void cEqCorLI_Multi_5_DRPts1::SetP3Y_B_3(double aVal){ mLocP3Y_B_3 = aVal;} void cEqCorLI_Multi_5_DRPts1::SetP3Y_B_4(double aVal){ mLocP3Y_B_4 = aVal;} void cEqCorLI_Multi_5_DRPts1::SetP3Z_A_0(double aVal){ mLocP3Z_A_0 = aVal;} void cEqCorLI_Multi_5_DRPts1::SetP3Z_A_1(double aVal){ mLocP3Z_A_1 = aVal;} void cEqCorLI_Multi_5_DRPts1::SetP3Z_A_2(double aVal){ mLocP3Z_A_2 = aVal;} void cEqCorLI_Multi_5_DRPts1::SetP3Z_A_3(double aVal){ mLocP3Z_A_3 = aVal;} void cEqCorLI_Multi_5_DRPts1::SetP3Z_A_4(double aVal){ mLocP3Z_A_4 = aVal;} void cEqCorLI_Multi_5_DRPts1::SetP3Z_B_0(double aVal){ mLocP3Z_B_0 = aVal;} void cEqCorLI_Multi_5_DRPts1::SetP3Z_B_1(double aVal){ mLocP3Z_B_1 = aVal;} void cEqCorLI_Multi_5_DRPts1::SetP3Z_B_2(double aVal){ mLocP3Z_B_2 = aVal;} void cEqCorLI_Multi_5_DRPts1::SetP3Z_B_3(double aVal){ mLocP3Z_B_3 = aVal;} void cEqCorLI_Multi_5_DRPts1::SetP3Z_B_4(double aVal){ mLocP3Z_B_4 = aVal;} void cEqCorLI_Multi_5_DRPts1::SetTimeRot(double aVal){ mLocTimeRot = aVal;} double * cEqCorLI_Multi_5_DRPts1::AdrVarLocFromString(const std::string & aName) { if (aName == "CoeffU_A_0") return & mLocCoeffU_A_0; if (aName == "CoeffU_A_1") return & mLocCoeffU_A_1; if (aName == "CoeffU_A_2") return & mLocCoeffU_A_2; if (aName == "CoeffU_A_3") return & mLocCoeffU_A_3; if (aName == "CoeffU_A_4") return & mLocCoeffU_A_4; if (aName == "CoeffU_B_0") return & mLocCoeffU_B_0; if (aName == "CoeffU_B_1") return & mLocCoeffU_B_1; if (aName == "CoeffU_B_2") return & mLocCoeffU_B_2; if (aName == "CoeffU_B_3") return & mLocCoeffU_B_3; if (aName == "CoeffU_B_4") return & mLocCoeffU_B_4; if (aName == "CoeffV_A_0") return & mLocCoeffV_A_0; if (aName == "CoeffV_A_1") return & mLocCoeffV_A_1; if (aName == "CoeffV_A_2") return & mLocCoeffV_A_2; if (aName == "CoeffV_A_3") return & mLocCoeffV_A_3; if (aName == "CoeffV_A_4") return & mLocCoeffV_A_4; if (aName == "CoeffV_B_0") return & mLocCoeffV_B_0; if (aName == "CoeffV_B_1") return & mLocCoeffV_B_1; if (aName == "CoeffV_B_2") return & mLocCoeffV_B_2; if (aName == "CoeffV_B_3") return & mLocCoeffV_B_3; if (aName == "CoeffV_B_4") return & mLocCoeffV_B_4; if (aName == "Cste_A_0") return & mLocCste_A_0; if (aName == "Cste_A_1") return & mLocCste_A_1; if (aName == "Cste_A_2") return & mLocCste_A_2; if (aName == "Cste_A_3") return & mLocCste_A_3; if (aName == "Cste_A_4") return & mLocCste_A_4; if (aName == "Cste_B_0") return & mLocCste_B_0; if (aName == "Cste_B_1") return & mLocCste_B_1; if (aName == "Cste_B_2") return & mLocCste_B_2; if (aName == "Cste_B_3") return & mLocCste_B_3; if (aName == "Cste_B_4") return & mLocCste_B_4; if (aName == "P3X_A_0") return & mLocP3X_A_0; if (aName == "P3X_A_1") return & mLocP3X_A_1; if (aName == "P3X_A_2") return & mLocP3X_A_2; if (aName == "P3X_A_3") return & mLocP3X_A_3; if (aName == "P3X_A_4") return & mLocP3X_A_4; if (aName == "P3X_B_0") return & mLocP3X_B_0; if (aName == "P3X_B_1") return & mLocP3X_B_1; if (aName == "P3X_B_2") return & mLocP3X_B_2; if (aName == "P3X_B_3") return & mLocP3X_B_3; if (aName == "P3X_B_4") return & mLocP3X_B_4; if (aName == "P3Y_A_0") return & mLocP3Y_A_0; if (aName == "P3Y_A_1") return & mLocP3Y_A_1; if (aName == "P3Y_A_2") return & mLocP3Y_A_2; if (aName == "P3Y_A_3") return & mLocP3Y_A_3; if (aName == "P3Y_A_4") return & mLocP3Y_A_4; if (aName == "P3Y_B_0") return & mLocP3Y_B_0; if (aName == "P3Y_B_1") return & mLocP3Y_B_1; if (aName == "P3Y_B_2") return & mLocP3Y_B_2; if (aName == "P3Y_B_3") return & mLocP3Y_B_3; if (aName == "P3Y_B_4") return & mLocP3Y_B_4; if (aName == "P3Z_A_0") return & mLocP3Z_A_0; if (aName == "P3Z_A_1") return & mLocP3Z_A_1; if (aName == "P3Z_A_2") return & mLocP3Z_A_2; if (aName == "P3Z_A_3") return & mLocP3Z_A_3; if (aName == "P3Z_A_4") return & mLocP3Z_A_4; if (aName == "P3Z_B_0") return & mLocP3Z_B_0; if (aName == "P3Z_B_1") return & mLocP3Z_B_1; if (aName == "P3Z_B_2") return & mLocP3Z_B_2; if (aName == "P3Z_B_3") return & mLocP3Z_B_3; if (aName == "P3Z_B_4") return & mLocP3Z_B_4; if (aName == "TimeRot") return & mLocTimeRot; return 0; } cElCompiledFonc::cAutoAddEntry cEqCorLI_Multi_5_DRPts1::mTheAuto("cEqCorLI_Multi_5_DRPts1",cEqCorLI_Multi_5_DRPts1::Alloc); cElCompiledFonc * cEqCorLI_Multi_5_DRPts1::Alloc() { return new cEqCorLI_Multi_5_DRPts1(); } /*Footer-MicMac-eLiSe-25/06/2007 Ce logiciel est un programme informatique servant à la mise en correspondances d'images pour la reconstruction du relief. Ce logiciel est régi par la licence CeCILL-B soumise au droit français et respectant les principes de diffusion des logiciels libres. Vous pouvez utiliser, modifier et/ou redistribuer ce programme sous les conditions de la licence CeCILL-B telle que diffusée par le CEA, le CNRS et l'INRIA sur le site "http://www.cecill.info". En contrepartie de l'accessibilité au code source et des droits de copie, de modification et de redistribution accordés par cette licence, il n'est offert aux utilisateurs qu'une garantie limitée. Pour les mêmes raisons, seule une responsabilité restreinte pèse sur l'auteur du programme, le titulaire des droits patrimoniaux et les concédants successifs. A cet égard l'attention de l'utilisateur est attirée sur les risques associés au chargement, à l'utilisation, à la modification et/ou au développement et à la reproduction du logiciel par l'utilisateur étant donné sa spécificité de logiciel libre, qui peut le rendre complexe à manipuler et qui le réserve donc à des développeurs et des professionnels avertis possédant des connaissances informatiques approfondies. Les utilisateurs sont donc invités à charger et tester l'adéquation du logiciel à leurs besoins dans des conditions permettant d'assurer la sécurité de leurs systèmes et ou de leurs données et, plus généralement, à l'utiliser et l'exploiter dans les mêmes conditions de sécurité. Le fait que vous puissiez accéder à cet en-tête signifie que vous avez pris connaissance de la licence CeCILL-B, et que vous en avez accepté les termes. Footer-MicMac-eLiSe-25/06/2007*/
42.124038
146
0.718645
kikislater
d3fbf002b267c042748459b159b2aab8fad1264f
1,469
hpp
C++
freeflow/sys/epoll.hpp
flowgrammable/freeflow-legacy
c5cd77495d44fe3a9e48a2e06fbb44f7418d388e
[ "Apache-2.0" ]
1
2017-07-30T04:18:29.000Z
2017-07-30T04:18:29.000Z
freeflow/sys/epoll.hpp
flowgrammable/freeflow-legacy
c5cd77495d44fe3a9e48a2e06fbb44f7418d388e
[ "Apache-2.0" ]
null
null
null
freeflow/sys/epoll.hpp
flowgrammable/freeflow-legacy
c5cd77495d44fe3a9e48a2e06fbb44f7418d388e
[ "Apache-2.0" ]
null
null
null
// Copyright (c) 2013-2014 Flowgrammable.org // // 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 FREEFLOW_EPOLL_HPP #define FREEFLOW_EPOLL_HPP #include <unistd.h> #include <sys/epoll.h> #include <map> #include <vector> #include "freeflow/sys/error.hpp" #include "freeflow/sys/time.hpp" namespace freeflow { struct EPevent : epoll_event { enum Type : uint32_t { READ = EPOLLIN, WRITE = EPOLLOUT, CLOSED = EPOLLRDHUP, EDGE = EPOLLET, ONESHOT = EPOLLONESHOT, }; EPevent() = default; EPevent(const EPevent&) = default; EPevent(Type t, int fd); }; struct Epoll { Epoll(); ~Epoll(); int fd; std::map<int,EPevent> watched; }; Error add_reader(Epoll& e, int fd); Error add_writer(Epoll& e, int fd); Error del_reader(Epoll& e, int fd); Error del_writer(Epoll& e, int fd); using EPevents = std::vector<EPevent>; EPevents poll(Epoll& ep, const MicroTime& mt); } // namespace freeflow #include "epoll.ipp" #endif
21.925373
70
0.707965
flowgrammable
d3ff9946b91f77b916fb13f4d75fe6d4ba923dc0
3,102
cpp
C++
src/scams/impl/predefined_moc/eln/sca_eln_vcr.cpp
sivertism/mirror-sysc-ams
ae6a41555bbe32771799111b2a120fede6cb790f
[ "Apache-2.0" ]
null
null
null
src/scams/impl/predefined_moc/eln/sca_eln_vcr.cpp
sivertism/mirror-sysc-ams
ae6a41555bbe32771799111b2a120fede6cb790f
[ "Apache-2.0" ]
null
null
null
src/scams/impl/predefined_moc/eln/sca_eln_vcr.cpp
sivertism/mirror-sysc-ams
ae6a41555bbe32771799111b2a120fede6cb790f
[ "Apache-2.0" ]
null
null
null
/***************************************************************************** Copyright 2010-2014 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V. Copyright 2015-2020 COSEDA Technologies GmbH *****************************************************************************/ /***************************************************************************** sca_eln_vcr.cpp - description Original Author: Karsten Einwich Fraunhofer IIS/EAS Dresden Created on: 13.05.2014 SVN Version : $Revision: 1703 $ SVN last checkin : $Date: 2014-04-23 12:10:42 +0200 (Wed, 23 Apr 2014) $ SVN checkin by : $Author: karsten $ SVN Id : $Id: sca_eln_r.cpp 1703 2014-04-23 10:10:42Z karsten $ *****************************************************************************/ /*****************************************************************************/ #include "scams/predefined_moc/eln/sca_eln_vcr.h" namespace sca_eln { sca_vcr::sca_vcr(sc_core::sc_module_name, const sca_util::sca_vector<std::pair<double,double> >& pwc_value_) : p("p"), n("n"), pwc_vector("pwc_value", pwc_value_) { nadd1=-1; nadd2=-1; unit="A"; domain="I"; } const char* sca_vcr::kind() const { return "sca_eln::sca_vcr"; } void sca_vcr::trace( sc_core::sc_trace_file* tf ) const { std::ostringstream str; str << "sc_trace of sca_vcr module not supported for module: " << this->name(); SC_REPORT_WARNING("SystemC-AMS",str.str().c_str()); } void sca_vcr::matrix_stamps() { nadd1 = add_equation(2); nadd2 = nadd1 + 1; B_wr(nadd1, p) = -1.0; B_wr(nadd1, n) = 1.0; B_wr(nadd1, nadd1) = 1.0; // 0 = nadd1 * 1.0 - v(p) + v(n) // nadd1 = ( v(p) - v(n) ) / 1.0 B_wr(p, nadd1) = 1.0; B_wr(n, nadd1) = -1.0; B_wr(nadd2,nadd2) = -1.0; // nadd2 = v(cp) - v(cn) B_wr(nadd2,cp) = 1.0; B_wr(nadd2,cn) = -1.0; add_pwl_b_stamp_to_B(nadd1,nadd1,nadd2,pwc_vector.get()); } bool sca_vcr::trace_init(sca_util::sca_implementation::sca_trace_object_data& data) { //trace will be activated after every complete cluster calculation //by teh synchronization layer return this->add_solver_trace(data); } void sca_vcr::trace(long id,sca_util::sca_implementation::sca_trace_buffer& buffer) { sca_core::sca_time ctime = sca_eln::sca_module::get_time(); buffer.store_time_stamp(id,ctime,x(nadd1)); } sca_util::sca_complex sca_vcr::calculate_ac_result(sca_util::sca_complex* res_vec) { return res_vec[nadd1]; } /** * experimental physical domain interface */ void sca_vcr::set_unit(const std::string& unit_) { unit=unit_; } const std::string& sca_vcr::get_unit() const { return unit; } void sca_vcr::set_unit_prefix(const std::string& prefix_) { unit_prefix=prefix_; } const std::string& sca_vcr::get_unit_prefix() const { return unit_prefix; } void sca_vcr::set_domain(const std::string& domain_) { domain=domain_; } const std::string& sca_vcr::get_domain() const { return domain; } } //namespace sca_eln
22.808824
83
0.574468
sivertism
3101e12474308f4b9da16dea553539633d24e8fb
1,492
cpp
C++
torch/csrc/jit/passes/decompose_addmm.cpp
DavidKo3/mctorch
53ffe61763059677978b4592c8b2153b0c15428f
[ "BSD-3-Clause" ]
1
2019-07-21T02:13:22.000Z
2019-07-21T02:13:22.000Z
torch/csrc/jit/passes/decompose_addmm.cpp
DavidKo3/mctorch
53ffe61763059677978b4592c8b2153b0c15428f
[ "BSD-3-Clause" ]
null
null
null
torch/csrc/jit/passes/decompose_addmm.cpp
DavidKo3/mctorch
53ffe61763059677978b4592c8b2153b0c15428f
[ "BSD-3-Clause" ]
null
null
null
#include "torch/csrc/jit/passes/dead_code_elimination.h" #include "torch/csrc/jit/passes/decompose_addmm.h" #include "torch/csrc/jit/symbolic_variable.h" namespace torch { namespace jit { static void DecomposeAddmm(Block* block) { for (auto it = block->nodes().begin(), end = block->nodes().end(); it != end; ++it) { for (auto sub : it->blocks()) DecomposeAddmm(sub); // For the case where we have an addmm where alpha and beta are Attributes // and both of those scalars are equal to 1.0, decompose this into an mm // followed by an add so that it can go through the existing optimization, // shape analysis and differentiation passes for those two individual ops. // Later, we will fuse together those two ops into a single addmm. if (it->kind() == aten::addmm && it->inputs().size() == 3) { auto alpha = it->get<at::Scalar>(attr::alpha); auto beta = it->get<at::Scalar>(attr::beta); if (!alpha || !beta) continue; if (alpha->toDouble() != 1.0 || beta->toDouble() != 1.0) continue; WithInsertPoint guard(*it); SymbolicVariable mat(it->inputs()[0]); SymbolicVariable mat1(it->inputs()[1]); SymbolicVariable mat2(it->inputs()[2]); auto mm_result = mat1.mm(mat2); auto result = mat + mm_result; it->output()->replaceAllUsesWith(result); it.destroyCurrent(); } } } void DecomposeAddmm(const std::shared_ptr<Graph>& graph) { DecomposeAddmm(graph->block()); } }}
33.155556
79
0.648123
DavidKo3
31038acb562f5488eb00972ee8b3075b7079cd0b
17,446
cpp
C++
Tests/src/Collection/HashMap.cpp
BlockProject3D/Framework
1c27ef19d9a12d158a2b53f6bd28dd2d8e678912
[ "BSD-3-Clause" ]
2
2019-02-02T20:48:17.000Z
2019-02-22T09:59:40.000Z
Tests/src/Collection/HashMap.cpp
BlockProject3D/Framework
1c27ef19d9a12d158a2b53f6bd28dd2d8e678912
[ "BSD-3-Clause" ]
125
2020-01-14T18:26:38.000Z
2021-02-23T15:33:55.000Z
Tests/src/Collection/HashMap.cpp
BlockProject3D/Framework
1c27ef19d9a12d158a2b53f6bd28dd2d8e678912
[ "BSD-3-Clause" ]
1
2020-05-26T08:55:10.000Z
2020-05-26T08:55:10.000Z
// Copyright (c) 2020, BlockProject 3D // // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that the following conditions are met: // // * Redistributions of source code must retain the above copyright notice, // this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // * Neither the name of BlockProject 3D nor the names of its contributors // may be used to endorse or promote products derived from this software // without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include <cassert> #include <iostream> #include <gtest/gtest.h> #include <Framework/Name.hpp> #include <Framework/Memory/Utility.hpp> #include <Framework/Collection/HashMap.hpp> #include <Framework/Collection/Stringifier.HashMap.hpp> using namespace bpf::memory; using namespace bpf::collection; using namespace bpf; TEST(HashMap, Creation_1) { HashMap<String, int> map; map["test1"] = 0; map["test2"] = 3; map["test3"] = 7; } TEST(HashMap, Creation_2) { HashMap<int, int> lst; lst.Add(0, 0); lst.Add(1, 3); lst.Add(2, 7); EXPECT_EQ(lst[0], 0); EXPECT_EQ(lst[1], 3); EXPECT_EQ(lst[2], 7); } TEST(HashMap, PreHash) { EXPECT_NE(Hash<String>::ValueOf("B"), Hash<String>::ValueOf("C")); EXPECT_NE(Hash<String>::ValueOf("a"), Hash<String>::ValueOf("b")); EXPECT_NE(Hash<String>::ValueOf("a"), Hash<String>::ValueOf("aa")); EXPECT_NE(Hash<String>::ValueOf("a"), Hash<String>::ValueOf("a\a")); } TEST(HashMap, Creation_List) { HashMap<int, int> lst = { { 0, 0 }, { 1, 3 }, { 2, 7 } }; EXPECT_EQ(lst[0], 0); EXPECT_EQ(lst[1], 3); EXPECT_EQ(lst[2], 7); } TEST(HashMap, Add) { const int i = 12; HashMap<int, int> lst = { { 0, i }, { 1, 2 } }; EXPECT_EQ(lst.Size(), 2U); lst.Add(2, 3); EXPECT_EQ(lst.Size(), 3U); lst.Add(3, i); EXPECT_EQ(lst.Size(), 4U); EXPECT_STREQ(*String::ValueOf(lst), "{'0': 12, '1': 2, '2': 3, '3': 12}"); } TEST(HashMap, Indexer) { HashMap<int, int> lst = { { 0, 0 }, { 1, 3 }, { 2, 7 } }; EXPECT_EQ(lst[0], 0); EXPECT_EQ(lst[1], 3); EXPECT_EQ(lst[2], 7); const auto &lst1 = lst; EXPECT_THROW(lst1[-1], IndexException); lst[-1] = 42; EXPECT_EQ(lst1[-1], 42); } TEST(HashMap, FindByKey) { HashMap<int, int> lst = { { 0, 0 }, { 1, 3 }, { 2, 7 } }; EXPECT_EQ(lst.begin(), lst.FindByKey(0)); EXPECT_EQ(--lst.end(), lst.FindByKey(2)); EXPECT_EQ(lst.end(), lst.FindByKey(3)); } TEST(HashMap, FindByValue) { HashMap<int, int> lst = { { 0, 0 }, { 1, 3 }, { 2, 7 } }; EXPECT_EQ(lst.begin(), lst.FindByValue(0)); EXPECT_EQ(--lst.end(), lst.FindByValue(7)); EXPECT_EQ(--lst.end(), lst.FindByValue<ops::Greater>(3)); EXPECT_EQ(lst.end(), lst.FindByValue(42)); } TEST(HashMap, Find) { HashMap<int, int> lst = { { 0, 0 }, { 1, 3 }, { 2, 7 } }; EXPECT_EQ(++lst.begin(), lst.Find([](HashMap<int, int>::Iterator it) { return (it->Value == 3); })); EXPECT_EQ(lst.end(), lst.Find([](HashMap<int, int>::Iterator it) { return (it->Value == 42); })); } TEST(HashMap, Equal) { HashMap<int, int> lst = { { 0, 0 }, { 1, 3 }, { 2, 7 } }; HashMap<int, int> lst1 = { { 0, 0 }, { 1, 3 }, { 2, 7 } }; HashMap<int, int> lst2 = { { 0, 0 }, { 1, 3 } }; HashMap<int, int> lst3 = { { 0, 0 }, { 1, 3 }, { 2, 4 } }; EXPECT_TRUE(lst == lst1); EXPECT_FALSE(lst != lst1); EXPECT_FALSE(lst == lst2); EXPECT_TRUE(lst != lst2); EXPECT_FALSE(lst == lst3); EXPECT_TRUE(lst != lst3); } TEST(HashMap, Concatenate) { HashMap<int, int> lst = { { 0, 0 }, { 1, 3 }, { 2, 7 } }; HashMap<int, int> lst1 = { { 3, 0 }, { 1, 5 }, { 4, 7 } }; auto concatenated = lst + lst1; EXPECT_STREQ(*String::ValueOf(concatenated), "{'0': 0, '1': 5, '2': 7, '3': 0, '4': 7}"); lst1 += lst; EXPECT_STREQ(*String::ValueOf(lst1), "{'0': 0, '1': 3, '2': 7, '3': 0, '4': 7}"); EXPECT_STREQ(*String::ValueOf(lst), "{'0': 0, '1': 3, '2': 7}"); } TEST(HashMap, HasKey) { HashMap<int, int> lst = { { 0, 0 }, { 1, 3 }, { 2, 7 } }; EXPECT_EQ(lst[0], 0); EXPECT_EQ(lst[1], 3); EXPECT_EQ(lst[2], 7); EXPECT_TRUE(lst.HasKey(0)); EXPECT_TRUE(lst.HasKey(1)); EXPECT_TRUE(lst.HasKey(2)); } TEST(HashMap, Copy) { HashMap<int, int> lst; lst.Add(0, 0); lst.Add(1, 3); lst.Add(2, 7); auto copy = lst; EXPECT_EQ(lst[0], 0); EXPECT_EQ(lst[1], 3); EXPECT_EQ(lst[2], 7); auto cc = &copy; copy = *cc; EXPECT_EQ(copy[0], 0); EXPECT_EQ(copy[1], 3); EXPECT_EQ(copy[2], 7); } TEST(HashMap, Move) { HashMap<int, int> lst; lst.Add(0, 0); lst.Add(1, 3); lst.Add(2, 7); auto mv = std::move(lst); EXPECT_EQ(mv[0], 0); EXPECT_EQ(mv[1], 3); EXPECT_EQ(mv[2], 7); EXPECT_EQ(lst.Size(), 0U); EXPECT_EQ(lst.begin(), lst.end()); } TEST(HashMap, Remove) { HashMap<int, int> lst = { { 0, 0 }, { 1, 3 }, { 2, 7 }, { 3, 0 } }; lst.Remove(0, false); EXPECT_STREQ(*String::ValueOf(lst), "{'1': 3, '2': 7, '3': 0}"); lst.Add(0, 0); EXPECT_STREQ(*String::ValueOf(lst), "{'0': 0, '1': 3, '2': 7, '3': 0}"); lst.Remove(0); EXPECT_STREQ(*String::ValueOf(lst), "{'1': 3, '2': 7}"); lst.Remove<ops::Less>(7); EXPECT_STREQ(*String::ValueOf(lst), "{'2': 7}"); } TEST(HashMap, RemoveAt_1) { HashMap<int, int> lst = { { 0, 0 }, { 1, 3 }, { 2, 7 }, { 3, 0 } }; lst.RemoveAt(2); EXPECT_STREQ(*String::ValueOf(lst), "{'0': 0, '1': 3, '3': 0}"); lst.RemoveAt(++lst.begin()); EXPECT_STREQ(*String::ValueOf(lst), "{'0': 0, '3': 0}"); auto it = lst.begin(); lst.RemoveAt(it); EXPECT_STREQ(*String::ValueOf(lst), "{'3': 0}"); EXPECT_NE(it, lst.end()); lst.RemoveAt(--lst.end()); EXPECT_STREQ(*String::ValueOf(lst), "{}"); lst = { { 0, 0 }, { 1, 3 }, { 2, 7 }, { 3, 0 } }; lst.RemoveAt(--(--lst.end())); EXPECT_STREQ(*String::ValueOf(lst), "{'0': 0, '1': 3, '3': 0}"); lst.RemoveAt(lst.end()); EXPECT_STREQ(*String::ValueOf(lst), "{'0': 0, '1': 3, '3': 0}"); } TEST(HashMap, RemoveAt_2) { HashMap<int, int> lst = { { 0, 0 }, { 1, 3 }, { 2, 7 }, { 3, 0 } }; lst.RemoveAt(2); EXPECT_STREQ(*String::ValueOf(lst), "{'0': 0, '1': 3, '3': 0}"); lst.RemoveAt(++lst.begin()); EXPECT_STREQ(*String::ValueOf(lst), "{'0': 0, '3': 0}"); lst.RemoveAt(lst.begin()); EXPECT_STREQ(*String::ValueOf(lst), "{'3': 0}"); EXPECT_NE(lst.begin(), lst.end()); lst.RemoveAt(--lst.end()); EXPECT_STREQ(*String::ValueOf(lst), "{}"); lst = { { 0, 0 }, { 1, 3 }, { 2, 7 }, { 3, 0 } }; lst.RemoveAt(--(--lst.end())); EXPECT_STREQ(*String::ValueOf(lst), "{'0': 0, '1': 3, '3': 0}"); lst.RemoveAt(lst.end()); EXPECT_STREQ(*String::ValueOf(lst), "{'0': 0, '1': 3, '3': 0}"); } TEST(HashMap, Iterator_1) { HashMap<int, int> lst = { { 0, 0 }, { 1, 3 }, { 2, 7 }, { 3, 0 } }; auto it = lst.begin(); ++it; --it; EXPECT_EQ(it, lst.begin()); --it; ++it; EXPECT_EQ(it, ++lst.begin()); it = lst.end(); --it; ++it; EXPECT_EQ(it, lst.end()); ++it; --it; EXPECT_EQ(it, --lst.end()); } TEST(HashMap, Iterator_2) { HashMap<int, int> lst = { { 1, 3 }, { 2, 7 }, { 3, 0 } }; auto it = lst.begin(); ++it; --it; EXPECT_EQ(it, lst.begin()); --it; ++it; EXPECT_EQ(it, ++lst.begin()); it = lst.end(); --it; ++it; EXPECT_EQ(it, lst.end()); ++it; --it; EXPECT_EQ(it, --lst.end()); } TEST(HashMap, Iterator_3) { HashMap<int, int> lst = { { 1, 3 }, { 2, 7 }, { 3, 0 } }; auto it = lst.begin(); it += 2; EXPECT_EQ(it->Value, 0); it -= 2; EXPECT_EQ(it->Value, 3); it = lst.begin(); it += 42; EXPECT_EQ(it, lst.end()); it = lst.end(); it -= 42; EXPECT_EQ(it->Value, 3); } TEST(HashMap, Iterator_4) { HashMap<int, int> lst = { { 1, 3 }, { 2, 7 }, { 3, 0 } }; auto it1 = lst.begin(); const auto &it = it1; EXPECT_EQ((*it).Value, 3); EXPECT_EQ(it->Value, 3); EXPECT_EQ(it->Key, 1); ++it1; EXPECT_EQ((*it).Value, 7); EXPECT_EQ(it->Value, 7); EXPECT_EQ(it->Key, 2); } TEST(HashMap, ReverseIterator_1) { HashMap<int, int> lst = { { 0, 0 }, { 1, 3 }, { 2, 7 }, { 3, 0 } }; auto it = lst.rbegin(); ++it; --it; EXPECT_EQ(it, lst.rbegin()); --it; ++it; EXPECT_EQ(it, ++lst.rbegin()); it = lst.rend(); --it; ++it; EXPECT_EQ(it, lst.rend()); ++it; --it; EXPECT_EQ(it, --lst.rend()); } TEST(HashMap, ReverseIterator_2) { HashMap<int, int> lst = { { 1, 3 }, { 2, 7 }, { 3, 0 } }; auto it = lst.rbegin(); ++it; --it; EXPECT_EQ(it, lst.rbegin()); --it; ++it; EXPECT_EQ(it, ++lst.rbegin()); it = lst.rend(); --it; ++it; EXPECT_EQ(it, lst.rend()); ++it; --it; EXPECT_EQ(it, --lst.rend()); } TEST(HashMap, ReverseIterator_3) { HashMap<int, int> lst = { { 1, 3 }, { 2, 7 }, { 3, 0 } }; auto it = lst.rbegin(); it += 2; EXPECT_EQ(it->Value, 3); it -= 2; EXPECT_EQ(it->Value, 0); it = lst.rbegin(); it += 42; EXPECT_EQ(it, lst.rend()); it -= 42; EXPECT_EQ(it->Value, 0); } TEST(HashMap, ReverseIterator_4) { HashMap<int, int> lst = { { 1, 3 }, { 2, 7 }, { 3, 0 } }; auto it1 = lst.rbegin(); const auto &it = it1; EXPECT_EQ((*it).Value, 0); EXPECT_EQ(it->Value, 0); EXPECT_EQ(it->Key, 3); ++it1; EXPECT_EQ((*it).Value, 7); EXPECT_EQ(it->Value, 7); EXPECT_EQ(it->Key, 2); } TEST(HashMap, CIterator_1) { HashMap<int, int> lst1 = { { 0, 0 }, { 1, 3 }, { 2, 7 }, { 3, 0 } }; const auto &lst = lst1; auto it = lst.begin(); ++it; --it; EXPECT_EQ(it, lst.begin()); --it; ++it; EXPECT_EQ(it, ++lst.begin()); it = lst.end(); --it; ++it; EXPECT_EQ(it, lst.end()); ++it; --it; EXPECT_EQ(it, --lst.end()); } TEST(HashMap, CIterator_2) { HashMap<int, int> lst1 = { { 1, 3 }, { 2, 7 }, { 3, 0 } }; const auto &lst = lst1; auto it = lst.begin(); ++it; --it; EXPECT_EQ(it, lst.begin()); --it; ++it; EXPECT_EQ(it, ++lst.begin()); it = lst.end(); --it; ++it; EXPECT_EQ(it, lst.end()); ++it; --it; EXPECT_EQ(it, --lst.end()); } TEST(HashMap, CIterator_3) { HashMap<int, int> lst1 = { { 1, 3 }, { 2, 7 }, { 3, 0 } }; const auto &lst = lst1; auto it = lst.begin(); it += 2; EXPECT_EQ(it->Value, 0); it -= 2; EXPECT_EQ(it->Value, 3); it = lst.begin(); it += 42; EXPECT_EQ(it, lst.end()); it = lst.end(); it -= 42; EXPECT_EQ(it->Value, 3); } TEST(HashMap, CReverseIterator_1) { HashMap<int, int> lst1 = { { 0, 0 }, { 1, 3 }, { 2, 7 }, { 3, 0 } }; const auto &lst = lst1; auto it = lst.rbegin(); ++it; --it; EXPECT_EQ(it, lst.rbegin()); --it; ++it; EXPECT_EQ(it, ++lst.rbegin()); it = lst.rend(); --it; ++it; EXPECT_EQ(it, lst.rend()); ++it; --it; EXPECT_EQ(it, --lst.rend()); } TEST(HashMap, CReverseIterator_2) { HashMap<int, int> lst1 = { { 1, 3 }, { 2, 7 }, { 3, 0 } }; const auto &lst = lst1; auto it = lst.rbegin(); ++it; --it; EXPECT_EQ(it, lst.rbegin()); --it; ++it; EXPECT_EQ(it, ++lst.rbegin()); it = lst.rend(); --it; ++it; EXPECT_EQ(it, lst.rend()); ++it; --it; EXPECT_EQ(it, --lst.rend()); } TEST(HashMap, CReverseIterator_3) { HashMap<int, int> lst1 = { { 1, 3 }, { 2, 7 }, { 3, 0 } }; const auto &lst = lst1; auto it = lst.rbegin(); it += 2; EXPECT_EQ(it->Value, 3); it -= 2; EXPECT_EQ(it->Value, 0); it = lst.rbegin(); it += 42; EXPECT_EQ(it, lst.rend()); it -= 42; EXPECT_EQ(it->Value, 0); } TEST(HashMap, Clear) { HashMap<int, int> lst = { { 0, 0 }, { 1, 3 }, { 2, 7 }, { 3, 0 } }; EXPECT_EQ(lst.Size(), 4U); lst.Clear(); EXPECT_EQ(lst.Size(), 0U); EXPECT_EQ(lst.begin(), lst.end()); } TEST(HashMap, IterateForward_Test1) { int res = 0; HashMap<int, int> lst; lst.Add(0, 0); lst.Add(1, 3); lst.Add(2, 7); for (auto &i : lst) res += i.Key + i.Value; EXPECT_EQ(res, 13); } TEST(HashMap, IterateForward_Test2) { String res = ""; HashMap<String, int> map; map["test1"] = 0; map["test2"] = 3; map["test3"] = 7; for (auto &i : map) res += i.Key + String::ValueOf(i.Value) + ";"; EXPECT_STREQ(*res, "test37;test10;test23;"); } TEST(HashMap, IterateBackward_Test1) { int res = 0; HashMap<int, int> lst; lst.Add(0, 0); lst.Add(1, 3); lst.Add(2, 7); for (auto &i : Reverse(lst)) res += i.Key + i.Value; EXPECT_EQ(res, 13); } TEST(HashMap, IterateBackward_Test2) { String res = ""; HashMap<String, int> map; map["test1"] = 0; map["test2"] = 3; map["test3"] = 7; for (auto &i : Reverse(map)) res += i.Key + String::ValueOf(i.Value) + ";"; EXPECT_STREQ(*res, "test23;test10;test37;"); } TEST(HashMap, ReadWrite) { HashMap<String, int> map; map["test1"] = 0; map["test2"] = 3; map["test3"] = 7; EXPECT_EQ(map["test1"], 0); EXPECT_EQ(map["test2"], 3); EXPECT_EQ(map["test3"], 7); } TEST(HashMap, ReadWrite_NonCopy) { HashMap<String, UniquePtr<int>> map; map["test1"] = nullptr; map["test2"] = nullptr; map["test3"] = nullptr; EXPECT_EQ(map["test1"], nullptr); EXPECT_EQ(map["test2"], nullptr); EXPECT_EQ(map["test3"], nullptr); map["test1"] = MakeUnique<int>(0); map["test2"] = MakeUnique<int>(5); map["test3"] = MakeUnique<int>(9); EXPECT_EQ(*map["test1"], 0); EXPECT_EQ(*map["test2"], 5); EXPECT_EQ(*map["test3"], 9); } TEST(HashMap, ReadWrite_NonCopy_1) { HashMap<Name, UniquePtr<int>> map; map[bpf::Name("test1")] = nullptr; map[bpf::Name("test2")] = nullptr; map[bpf::Name("test3")] = nullptr; EXPECT_EQ(map[bpf::Name("test1")], nullptr); EXPECT_EQ(map[bpf::Name("test2")], nullptr); EXPECT_EQ(map[bpf::Name("test3")], nullptr); map[bpf::Name("test1")] = MakeUnique<int>(0); map[bpf::Name("test2")] = MakeUnique<int>(5); map[bpf::Name("test3")] = MakeUnique<int>(9); EXPECT_EQ(*map[bpf::Name("test1")], 0); EXPECT_EQ(*map[bpf::Name("test2")], 5); EXPECT_EQ(*map[bpf::Name("test3")], 9); } #ifdef BUILD_DEBUG static void RunLeakCheckBody() { HashMap<String, UniquePtr<int>> map; map["test1"] = nullptr; map["test2"] = nullptr; map["test3"] = nullptr; EXPECT_EQ(map["test1"], nullptr); EXPECT_EQ(map["test2"], nullptr); EXPECT_EQ(map["test3"], nullptr); map["test1"] = MakeUnique<int>(0); map["test2"] = MakeUnique<int>(5); map["test3"] = MakeUnique<int>(9); EXPECT_EQ(*map["test1"], 0); EXPECT_EQ(*map["test2"], 5); EXPECT_EQ(*map["test3"], 9); map["test3"] = nullptr; } TEST(HashMap, ReadWrite_LeakCheck) { fsize count = Memory::GetAllocCount(); RunLeakCheckBody(); EXPECT_EQ(count, Memory::GetAllocCount()); } #endif TEST(HashMap, Swap_1) { HashMap<int, int> lst; lst.Add(0, 0); lst.Add(1, 3); lst.Add(2, 7); lst.Swap(lst.begin(), --(--lst.end())); EXPECT_STREQ(*String::ValueOf(lst), "{'0': 3, '1': 0, '2': 7}"); } TEST(HashMap, Swap_2) { HashMap<int, int> lst; lst.Add(0, 0); lst.Add(1, 3); lst.Add(2, 7); lst.Swap(++lst.begin(), --lst.end()); EXPECT_STREQ(*String::ValueOf(lst), "{'0': 0, '1': 7, '2': 3}"); } TEST(HashMap, Swap_3) { HashMap<int, int> lst; lst.Add(0, 0); lst.Add(1, 7); lst.Swap(lst.begin(), --lst.end()); EXPECT_STREQ(*String::ValueOf(lst), "{'0': 7, '1': 0}"); } TEST(HashMap, Swap_4) { HashMap<int, UniquePtr<int>> lst; lst.Add(0, MakeUnique<int>(0)); lst.Add(1, MakeUnique<int>(7)); lst.Swap(lst.begin(), --lst.end()); } TEST(HashMap, Swap_Err_1) { HashMap<int, UniquePtr<int>> lst; lst.Swap(lst.begin(), --lst.end()); } TEST(HashMap, Swap_Err_2) { HashMap<int, int> lst; lst.Add(0, 0); lst.Add(1, 7); lst.Swap(lst.begin(), lst.begin()); lst.Swap(lst.end(), lst.end()); lst.Swap(--lst.end(), --lst.end()); EXPECT_STREQ(*String::ValueOf(lst), "{'0': 0, '1': 7}"); }
24.29805
104
0.542474
BlockProject3D
310556383e9eebb7e959b03dc4a53ec0198b9849
935
hpp
C++
include/pcltools/pipeline/producer.hpp
leaveitout/pcltools
02659bfbcd6aa737f9a1aadb77c60a9db15513c3
[ "MIT" ]
null
null
null
include/pcltools/pipeline/producer.hpp
leaveitout/pcltools
02659bfbcd6aa737f9a1aadb77c60a9db15513c3
[ "MIT" ]
null
null
null
include/pcltools/pipeline/producer.hpp
leaveitout/pcltools
02659bfbcd6aa737f9a1aadb77c60a9db15513c3
[ "MIT" ]
null
null
null
// // Created by sean on 06/12/15. // #ifndef PCL_CLOUD_REGISTRATION_PRODUCER_HPP #define PCL_CLOUD_REGISTRATION_PRODUCER_HPP #include "node.hpp" #include "buffer.hpp" namespace pcltools { namespace pipeline { template <typename Type> class Producer: public virtual Node { public: Producer (size_t id, std::string const & description, size_t buffer_size = Buffer <Type>::BUFF_SIZE_DEFAULT, size_t time_out_millis = Buffer <Type>::TIME_OUT_MS_DEFAULT, bool overwrite = Buffer <Type>::OVERWRITE_DEFAULT): Node {id, description} { buffer_ = std::make_shared <Buffer <Type>> (buffer_size, time_out_millis, overwrite); } virtual ~Producer () {}; auto virtual getBuffer () const -> std::shared_ptr <Buffer <Type>> final { return buffer_; } protected: mutable std::shared_ptr <Buffer <Type>> buffer_; }; } } #endif //PCL_CLOUD_REGISTRATION_PRODUCER_HPP
21.25
89
0.693048
leaveitout
3109ae70bd42dca4f57abbda909aff86f6236ed1
8,269
cpp
C++
7_Queens/7_Queens.cpp
eduherminio/Academic_ArtificialIntelligence
f0ec4d35cef64a1bf6841ea7ecf1d33017b3745f
[ "MIT" ]
3
2017-05-16T22:25:16.000Z
2019-05-07T16:12:21.000Z
7_Queens/7_Queens.cpp
eduherminio/Academic_ArtificialIntelligence
f0ec4d35cef64a1bf6841ea7ecf1d33017b3745f
[ "MIT" ]
null
null
null
7_Queens/7_Queens.cpp
eduherminio/Academic_ArtificialIntelligence
f0ec4d35cef64a1bf6841ea7ecf1d33017b3745f
[ "MIT" ]
null
null
null
#include "header/nodo_reinas.h" #include "header/problema_csp.h" #include <iostream> #include <iomanip> const unsigned dimension = 15; const size_t iteraciones_max = 1000; const size_t n_problemas = 1000; typedef problema_csp::Problema_csp<nodo_reinas::Nodo_reinas> type_queens_noset; typedef problema_csp::Problema_csp<nodo_reinas::Nodo_reinas_set> type_queens_set; void single_sample(type_queens_noset problema, type_queens_set problema_set); void multiple_sample(type_queens_noset problema, type_queens_set problema_set); int main() { nodo_reinas::Nodo_reinas nodo_inicial(dimension, {}); // Nodo sin set, vector vacio inicial nodo_reinas::Nodo_reinas_set nodo_inicial_set(dimension, {}); //Nodo con set, vector vacio inicial problema_csp::Problema_csp<nodo_reinas::Nodo_reinas> problema(nodo_inicial); problema_csp::Problema_csp<nodo_reinas::Nodo_reinas_set> problema_set(nodo_inicial_set); single_sample(problema, problema_set); // Showing the position of the queens std::cout << "\n\n*************************************************************************" << std::endl; std::cout << "*************************************************************************\n\n" << std::endl; multiple_sample(problema, problema_set); // Showing stats after solving n_problemas return 0; } void single_sample(type_queens_noset problema, type_queens_set problema_set) { size_t iteraciones; std::cout << std::endl << "\t\t\t\tComplete example: " << std::endl << std::endl; // PROFUNDIDAD SIN SET if (problema.profundidad()) { std::cout << "\nPROFUNDIDAD SIN SET\n"; nodo_reinas::imprime_posicion(problema.get_solucion(), problema.get_nodos_expandidos()); } // PROFUNDIDAD CON SET if (problema_set.profundidad()) { std::cout << "\nPROFUNDIDAD CON SET\n"; nodo_reinas::imprime_posicion(problema_set.get_solucion(), problema.get_nodos_expandidos()); } // LAS_VEGAS_EXPANDIR SIN SET iteraciones = iteraciones_max; if (problema.las_vegas_expandir(iteraciones)) { std::cout << "\nLAS_VEGAS_EXPANDIR SIN SET\n"; nodo_reinas::imprime_posicion(problema.get_solucion(), problema.get_nodos_expandidos()); } std::cout << "Numero de iteraciones: " << iteraciones << std::endl; // LAS_VEGAS_EXPANDIR CON SET iteraciones = iteraciones_max; if (problema_set.las_vegas_expandir(iteraciones)) { std::cout << "\nLAS_VEGAS_EXPANDIR CON SET\n"; nodo_reinas::imprime_posicion(problema_set.get_solucion(), problema.get_nodos_expandidos()); } std::cout << "Numero de iteraciones: " << iteraciones << std::endl; // LAS_VEGAS_SUCESOR_ALEATORIO SIN SET iteraciones = iteraciones_max; if (problema.las_vegas_sucesor_aleatorio(iteraciones)) { std::cout << "\nLAS VEGAS SUCESOR ALEATORIO SIN SET\n"; nodo_reinas::imprime_posicion(problema.get_solucion(), problema.get_nodos_expandidos()); } std::cout << "Numero de iteraciones: " << iteraciones << std::endl; // LAS_VEGAS_SUCESOR_ALEATORIO CON SET iteraciones = iteraciones_max; if (problema_set.las_vegas_sucesor_aleatorio(iteraciones)) { std::cout << "\nLAS VEGAS SUCESOR ALEATORIO CON SET\n"; nodo_reinas::imprime_posicion(problema_set.get_solucion(), problema.get_nodos_expandidos()); } std::cout << "Numero de iteraciones: " << iteraciones << std::endl; } void multiple_sample(type_queens_noset problema, type_queens_set problema_set) { auto t = std::time(nullptr); tm tm; #if _MSC_VER && !__INTEL_COMPILER ::localtime_s(&tm, &t); #else tm = *std::localtime(&t); #endif double nodos_promedio_profundidad_no_set; double nodos_promedio_profundidad_set; double nodos_promedio_lasvegas_expandir_no_set; double nodos_promedio_lasvegas_expandir_set; double nodos_promedio_lasvegas_sucesor_no_set; double nodos_promedio_lasvegas_sucesor_set; double iteraciones_promedio_expandir_no_set; double iteraciones_promedio_expandir_set; double iteraciones_promedio_sucesor_no_set; double iteraciones_promedio_sucesor_set; size_t counter = 0; std::cout << "\t\t\t" << std::put_time(&tm, "%d-%m-%Y %H:%M:%S") << std::endl; std::cout << "\t\t\tNumber of Queens: " << dimension << std::endl; std::cout << "\t\t\tMax. iterations: " << iteraciones_max << std::endl; std::cout << "\tProcessing " << n_problemas << " samples to get statistical results" << std::endl; std::cout << "\t\t\t\t(...)" << std::endl << std::endl; while (true) { size_t iteraciones; static size_t nodos_expandidos_profundidad_set = 0; static size_t nodos_expandidos_profundidad_no_set = 0; static size_t nodos_expandidos_lasvegas_expandir_set = 0; static size_t nodos_expandidos_lasvegas_expandir_no_set = 0; static size_t nodos_expandidos_lasvegas_sucesor_set = 0; static size_t nodos_expandidos_lasvegas_sucesor_no_set = 0; static size_t iteraciones_expandir_no_set = 0; static size_t iteraciones_expandir_set = 0; static size_t iteraciones_sucesor_no_set = 0; static size_t iteraciones_sucesor_set = 0; // PROFUNDIDAD SIN SET problema.profundidad(); nodos_expandidos_profundidad_no_set += problema.get_nodos_expandidos(); // PROFUNDIDAD CON SET problema_set.profundidad(); nodos_expandidos_profundidad_set += problema.get_nodos_expandidos(); // LAS_VEGAS_EXPANDIR SIN SET iteraciones = iteraciones_max; problema.las_vegas_expandir(iteraciones); nodos_expandidos_lasvegas_expandir_no_set += problema.get_nodos_expandidos(); iteraciones_expandir_no_set += iteraciones; // LAS_VEGAS_EXPANDIR CON SET iteraciones = iteraciones_max; problema_set.las_vegas_expandir(iteraciones); nodos_expandidos_lasvegas_expandir_set += problema.get_nodos_expandidos(); iteraciones_expandir_set += iteraciones; // LAS_VEGAS_SUCESOR_ALEATORIO SIN SET iteraciones = iteraciones_max; problema.las_vegas_sucesor_aleatorio(iteraciones); nodos_expandidos_lasvegas_sucesor_no_set += problema.get_nodos_expandidos(); iteraciones_sucesor_no_set += iteraciones; // LAS_VEGAS_SUCESOR_ALEATORIO CON SET iteraciones = iteraciones_max; problema_set.las_vegas_sucesor_aleatorio(iteraciones); nodos_expandidos_lasvegas_sucesor_set += problema.get_nodos_expandidos(); iteraciones_sucesor_set += iteraciones; ++counter; if (counter == n_problemas) { nodos_promedio_profundidad_no_set = (double)nodos_expandidos_profundidad_no_set / counter; nodos_promedio_profundidad_set = (double)nodos_expandidos_profundidad_set / counter; nodos_promedio_lasvegas_expandir_no_set = (double)nodos_expandidos_lasvegas_expandir_no_set / counter; nodos_promedio_lasvegas_expandir_set = (double)nodos_expandidos_lasvegas_expandir_set / counter; nodos_promedio_lasvegas_sucesor_no_set = (double)nodos_expandidos_lasvegas_sucesor_no_set / counter; nodos_promedio_lasvegas_sucesor_set = (double)nodos_expandidos_lasvegas_sucesor_set / counter; iteraciones_promedio_expandir_no_set = (double)iteraciones_expandir_no_set / counter; iteraciones_promedio_expandir_set = (double)iteraciones_expandir_set / counter; iteraciones_promedio_sucesor_no_set = (double)iteraciones_sucesor_no_set / counter; iteraciones_promedio_sucesor_set = (double)iteraciones_sucesor_set / counter; break; } } std::cout << std::endl; std::cout << "-----------------------------------------------------------------------" << std::endl; std::cout << "\tAlgoritmo\t Nodos promedio\tIteraciones promedio\n" << std::endl; std::cout << "\tProf_no_set\t\t" << nodos_promedio_profundidad_no_set << std::endl; std::cout << "\tProf_set\t\t" << nodos_promedio_profundidad_set << std::endl; std::cout << "\tVegas_exp_no_set\t" << nodos_promedio_lasvegas_expandir_no_set << "\t\t\t"; std::cout << iteraciones_promedio_expandir_no_set << std::endl; std::cout << "\tVegas_exp_set\t\t" << nodos_promedio_lasvegas_expandir_set << "\t\t\t"; std::cout << iteraciones_promedio_expandir_set << std::endl; std::cout << "\tVegas_suc_no_set\t" << nodos_promedio_lasvegas_sucesor_no_set << "\t\t\t"; std::cout << iteraciones_promedio_sucesor_no_set << std::endl; std::cout << "\tVegas_suc_set\t\t" << nodos_promedio_lasvegas_sucesor_set << "\t\t\t"; std::cout << iteraciones_promedio_sucesor_set << std::endl; std::cout << "-----------------------------------------------------------------------" << std::endl; std::cout << std::endl; }
40.336585
107
0.743137
eduherminio
310a6af77546f452b24668251032f5f2d291a158
3,557
cpp
C++
unranged/32.cpp
Taowyoo/LeetCodeLog
cb05798538dd10675bf81011a419d0e33d85e4e0
[ "MIT" ]
null
null
null
unranged/32.cpp
Taowyoo/LeetCodeLog
cb05798538dd10675bf81011a419d0e33d85e4e0
[ "MIT" ]
null
null
null
unranged/32.cpp
Taowyoo/LeetCodeLog
cb05798538dd10675bf81011a419d0e33d85e4e0
[ "MIT" ]
null
null
null
// my solution: store vaild parentheses state in a vector then get the max length by check the vector // Time complexity: O(n) // Space complexity: O(n) class Solution { public: int longestValidParentheses(string s) { if(s.size() <= 1) return 0; stack<int> store; vector<int> count(s.size(),0); for(int i = 0; i< s.size(); ++i){ if(s[i] == ')' && !store.empty() && store.top() > 0){ count[store.top() - 1] = 1; count[i] = 1; store.pop(); } else{ if(s[i] == ')') store.push(-(i+1)); else store.push(i+1); } } int max = 0; int cur = 0; for(int& i : count){ if(i){ ++cur; max = cur>max?cur:max; } else{ cur = 0; } } return max; } }; // stack solution: use only one stack to check each vaild parenthese swquence and count the max length // Time complexity: O(n) // Space complexity: O(n) class Solution { public: int longestValidParentheses(string s) { int maxans = 0; stack<int> store; store.push(-1); for (int i = 0; i < s.size(); i++) { if (s.[i] == '(') { store.push(i); } else { store.pop(); if (store.empty()) { store.push(i); } else { maxans = std::max(maxans, i - store.top()); } } } return maxans; } }; // DP: // if s[i] = ')' and s[i−1] = '(', i.e. string looks like ".......()" then: // dp[i] = dp[i − 2] + 2 // if s[i] = ')' and s[i − 1] = ')', i.e. string looks like ".......))" and if s[i - dp[i - 1] - 1] = '(' then: // dp[i] = dp[i − 1] + dp[i − dp[i − 1] − 2] + 2 // Time complexity: O(n) // Space complexity: O(n) class Solution { public: int longestValidParentheses(string s) { int maxans = 0; vector<int> dp(s.size()); for (int i = 1; i < s.size(); i++) { if (s[i] == ')') { if (s[i - 1] == '(') { dp[i] = (i >= 2 ? dp[i - 2] : 0) + 2; } else if (i - dp[i - 1] > 0 && s[i - dp[i - 1] - 1] == '(') { dp[i] = dp[i - 1] + ((i - dp[i - 1]) >= 2 ? dp[i - dp[i - 1] - 2] : 0) + 2; } maxans = std::max(maxans, dp[i]); } } return maxans; } }; // Without extra space // Time complexity: O(n) // Space complexity: O(1) class Solution { public: int longestValidParentheses(string s) { int left = 0, right = 0, maxlength = 0; for (int i = 0; i < s.size(); i++) { if (s.at(i) == '(') { left++; } else { right++; } if (left == right) { maxlength = std::max(maxlength, 2 * right); } else if (right >= left) { left = right = 0; } } left = right = 0; for (int i = s.size() - 1; i >= 0; i--) { if (s.at(i) == '(') { left++; } else { right++; } if (left == right) { maxlength = std::max(maxlength, 2 * left); } else if (left >= right) { left = right = 0; } } return maxlength; } };
28.918699
111
0.381501
Taowyoo
310c914eacea5d740c7c0b8b0d24c9615f52d05a
1,367
cpp
C++
all/native/geometry/WKTGeometryReader.cpp
JianYT/mobile-sdk
1835603e6cb7994222fea681928dc90055816628
[ "BSD-3-Clause" ]
155
2016-10-20T08:39:13.000Z
2022-02-27T14:08:32.000Z
all/native/geometry/WKTGeometryReader.cpp
JianYT/mobile-sdk
1835603e6cb7994222fea681928dc90055816628
[ "BSD-3-Clause" ]
448
2016-10-20T12:33:06.000Z
2022-03-22T14:42:58.000Z
all/native/geometry/WKTGeometryReader.cpp
JianYT/mobile-sdk
1835603e6cb7994222fea681928dc90055816628
[ "BSD-3-Clause" ]
64
2016-12-05T16:04:31.000Z
2022-02-07T09:36:22.000Z
#ifdef _CARTO_WKBT_SUPPORT #include "WKTGeometryReader.h" #include "components/Exceptions.h" #include "geometry/Geometry.h" #include "geometry/PointGeometry.h" #include "geometry/LineGeometry.h" #include "geometry/PolygonGeometry.h" #include "geometry/MultiGeometry.h" #include "geometry/MultiPointGeometry.h" #include "geometry/MultiLineGeometry.h" #include "geometry/MultiPolygonGeometry.h" #include "geometry/WKTGeometryParser.h" #include "utils/Log.h" #include <memory> #include <cstddef> #include <vector> #include <stack> #include <stdexcept> namespace carto { WKTGeometryReader::WKTGeometryReader() { } std::shared_ptr<Geometry> WKTGeometryReader::readGeometry(const std::string& wkt) const { std::string::const_iterator it = wkt.begin(); std::string::const_iterator end = wkt.end(); WKTGeometryParserImpl::encoding::space_type space; std::shared_ptr<Geometry> geometry; bool result = boost::spirit::qi::phrase_parse(it, end, WKTGeometryParser<std::string::const_iterator>(), space, geometry); if (!result) { throw ParseException("Failed to parse WKT geometry", wkt); } else if (it != wkt.end()) { throw ParseException("Could not parse to the end of WKT geometry", wkt, static_cast<int>(it - wkt.begin())); } return geometry; } } #endif
31.068182
130
0.699342
JianYT
3112f1173918bf0caabba1a67bd9bddc197d155b
7,235
cpp
C++
src-cpp/src/AST/ASTDumper.cpp
allen880117/NCTU-compiler-f19-hw4
0e2f9ed1d5870ae9909222b10cc0c9757bc6d51d
[ "MIT" ]
1
2020-12-10T18:25:48.000Z
2020-12-10T18:25:48.000Z
src/src/AST/ASTDumper.cpp
allen880117/NCTU-compiler-f19-hw4
0e2f9ed1d5870ae9909222b10cc0c9757bc6d51d
[ "MIT" ]
null
null
null
src/src/AST/ASTDumper.cpp
allen880117/NCTU-compiler-f19-hw4
0e2f9ed1d5870ae9909222b10cc0c9757bc6d51d
[ "MIT" ]
1
2020-12-21T11:49:22.000Z
2020-12-21T11:49:22.000Z
#include "AST/ASTDumper.hpp" #include "AST/program.hpp" #include "AST/declaration.hpp" #include "AST/variable.hpp" #include "AST/constant_value.hpp" #include "AST/function.hpp" #include "AST/compound_statement.hpp" #include "AST/assignment.hpp" #include "AST/print.hpp" #include "AST/read.hpp" #include "AST/variable_reference.hpp" #include "AST/binary_operator.hpp" #include "AST/unary_operator.hpp" #include "AST/if.hpp" #include "AST/while.hpp" #include "AST/for.hpp" #include "AST/return.hpp" #include "AST/function_call.hpp" #include <iostream> void ASTDumper::visit(ProgramNode *m) { this->print_space(); m->print(); this->space_counter_increase(); if (m->declaration_node_list != nullptr) for(uint i=0; i< m->declaration_node_list->size(); i++){ (*(m->declaration_node_list))[i]->accept(*this); } if (m->function_node_list != nullptr) for(uint i=0; i< m->function_node_list->size(); i++){ (*(m->function_node_list))[i]->accept(*this); } if (m->compound_statement_node != nullptr) m->compound_statement_node->accept(*this); this->space_counter_decrease(); } void ASTDumper::visit(DeclarationNode *m) { this->print_space(); m->print(); this->space_counter_increase(); if (m->variables_node_list != nullptr) for(uint i=0; i< m->variables_node_list->size(); i++){ (*(m->variables_node_list))[i]->accept(*this); } this->space_counter_decrease(); } void ASTDumper::visit(VariableNode *m) { this->print_space(); m->print(); this->space_counter_increase(); if (m->constant_value_node != nullptr) m->constant_value_node->accept(*this); this->space_counter_decrease(); } void ASTDumper::visit(ConstantValueNode *m) { this->print_space(); m->print(); // this->space_counter_increase(); // this->space_counter_decrease(); } void ASTDumper::visit(FunctionNode *m) { this->print_space(); m->print(); this->space_counter_increase(); if (m->parameters != nullptr) for(uint i=0; i< m->parameters->size(); i++){ (*(m->parameters))[i]->node->accept(*this); } if (m->body != nullptr) m->body->accept(*this); this->space_counter_decrease(); } void ASTDumper::visit(CompoundStatementNode *m) { this->print_space(); m->print(); this->space_counter_increase(); if (m->declaration_node_list != nullptr) for(uint i=0; i< m->declaration_node_list->size(); i++){ (*(m->declaration_node_list))[i]->accept(*this); } if (m->statement_node_list != nullptr) for(uint i=0; i< m->statement_node_list->size(); i++){ (*(m->statement_node_list))[i]->accept(*this); } this->space_counter_decrease(); } void ASTDumper::visit(AssignmentNode *m) { this->print_space(); m->print(); this->space_counter_increase(); if (m->variable_reference_node != nullptr) m->variable_reference_node->accept(*this); if (m->expression_node != nullptr) m->expression_node->accept(*this); this->space_counter_decrease(); } void ASTDumper::visit(PrintNode *m) { this->print_space(); m->print(); this->space_counter_increase(); if (m->expression_node != nullptr) m->expression_node->accept(*this); this->space_counter_decrease(); } void ASTDumper::visit(ReadNode *m) { this->print_space(); m->print(); this->space_counter_increase(); if (m->variable_reference_node != nullptr) m->variable_reference_node->accept(*this); this->space_counter_decrease(); } void ASTDumper::visit(VariableReferenceNode *m) { this->print_space(); m->print(); if (m->expression_node_list != nullptr) for(uint i=0; i< m->expression_node_list->size(); i++){ this->print_space(); std::cout<<"["<<std::endl; this->space_counter_increase(); (*(m->expression_node_list))[i]->accept(*this); this->space_counter_decrease(); this->print_space(); std::cout<<"]"<<std::endl; } } void ASTDumper::visit(BinaryOperatorNode *m) { this->print_space(); m->print(); this->space_counter_increase(); if (m->left_operand != nullptr) m->left_operand->accept(*this); if (m->right_operand != nullptr) m->right_operand->accept(*this); this->space_counter_decrease(); } void ASTDumper::visit(UnaryOperatorNode *m) { this->print_space(); m->print(); this->space_counter_increase(); if (m->operand != nullptr) m->operand->accept(*this); this->space_counter_decrease(); } void ASTDumper::visit(IfNode *m) { this->print_space(); m->print(); this->space_counter_increase(); if (m->condition != nullptr) m->condition->accept(*this); if (m->body != nullptr) for(uint i=0; i< m->body->size(); i++) (*(m->body))[i]->accept(*this); this->space_counter_decrease(); if (m->body_of_else != nullptr){ this->print_space(); std::cout<<"else"<<std::endl; this->space_counter_increase(); for(uint i=0; i< m->body_of_else->size(); i++) (*(m->body_of_else))[i]->accept(*this); this->space_counter_decrease(); } } void ASTDumper::visit(WhileNode *m) { this->print_space(); m->print(); this->space_counter_increase(); if (m->condition != nullptr) m->condition->accept(*this); if (m->body != nullptr) for(uint i=0; i< m->body->size(); i++) (*(m->body))[i]->accept(*this); this->space_counter_decrease(); } void ASTDumper::visit(ForNode *m) { this->print_space(); m->print(); this->space_counter_increase(); if (m->loop_variable_declaration != nullptr) m->loop_variable_declaration->accept(*this); if (m->initial_statement != nullptr) m->initial_statement->accept(*this); if (m->condition != nullptr) m->condition->accept(*this); if (m->body != nullptr) for(uint i=0; i< m->body->size(); i++) (*(m->body))[i]->accept(*this); this->space_counter_decrease(); } void ASTDumper::visit(ReturnNode *m) { this->print_space(); m->print(); this->space_counter_increase(); if (m->return_value != nullptr) m->return_value->accept(*this); this->space_counter_decrease(); } void ASTDumper::visit(FunctionCallNode *m) { this->print_space(); m->print(); this->space_counter_increase(); if (m->arguments != nullptr) for(uint i=0; i< m->arguments->size(); i++) (*(m->arguments))[i]->accept(*this); this->space_counter_decrease(); }
28.372549
68
0.566413
allen880117
311438a5c563372afc3e663c16bcee5b69593c16
1,823
cpp
C++
qt-mvvm/source/libmvvm_viewmodel/mvvm/viewmodel/standardviewitems.cpp
seaCheng/animation-
89a0cb0efbcfea202965a5851979ae6f1b67f8f0
[ "BSD-3-Clause" ]
6
2021-12-08T03:09:47.000Z
2022-02-24T03:51:14.000Z
qt-mvvm/source/libmvvm_viewmodel/mvvm/viewmodel/standardviewitems.cpp
seaCheng/animation-
89a0cb0efbcfea202965a5851979ae6f1b67f8f0
[ "BSD-3-Clause" ]
null
null
null
qt-mvvm/source/libmvvm_viewmodel/mvvm/viewmodel/standardviewitems.cpp
seaCheng/animation-
89a0cb0efbcfea202965a5851979ae6f1b67f8f0
[ "BSD-3-Clause" ]
null
null
null
// ************************************************************************** // // // Model-view-view-model framework for large GUI applications // //! @license GNU General Public License v3 or higher (see COPYING) //! @authors see AUTHORS // // ************************************************************************** // #include "mvvm/viewmodel/standardviewitems.h" #include "mvvm/model/sessionitem.h" #include "mvvm/viewmodel/viewmodelutils.h" using namespace ModelView; RootViewItem::RootViewItem(SessionItem* item) : ViewItem(item, ItemDataRole::DATA) {} //! --------------------------------------------------------------------------- ViewLabelItem::ViewLabelItem(SessionItem* item) : ViewItem(item, ItemDataRole::DISPLAY) {} QVariant ViewLabelItem::data(int role) const { if (!item()) return QVariant(); // use item's display role if (role == Qt::DisplayRole || role == Qt::EditRole) return QString::fromStdString(item()->displayName()); return ViewItem::data(role); } //! --------------------------------------------------------------------------- ViewDataItem::ViewDataItem(SessionItem* item) : ViewItem(item, ItemDataRole::DATA) {} Qt::ItemFlags ViewDataItem::flags() const { Qt::ItemFlags result = ViewItem::flags(); if (item() && item()->isEditable() && item()->isEnabled() && item()->data<QVariant>().isValid()) result |= Qt::ItemIsEditable; return result; } QVariant ViewDataItem::data(int role) const { if (role == Qt::DecorationRole) return Utils::DecorationRole(*item()); else if (role == Qt::CheckStateRole) return Utils::CheckStateRole(*item()); return ViewItem::data(role); } ViewEmptyItem::ViewEmptyItem() : ViewItem(nullptr, 0) {} QVariant ViewEmptyItem::data(int) const { return QVariant(); }
28.936508
100
0.56226
seaCheng
31145378480841bc41815445bf90027f49882f58
2,639
hpp
C++
Light/include/light/rendering/framebuffer.hpp
R-Bread/Light
151308c0159c4fe0d795b3c16f205e4af68710d7
[ "MIT" ]
1
2021-06-15T09:53:47.000Z
2021-06-15T09:53:47.000Z
Light/include/light/rendering/framebuffer.hpp
R-Bread/Light
151308c0159c4fe0d795b3c16f205e4af68710d7
[ "MIT" ]
21
2021-06-10T09:07:19.000Z
2022-01-30T21:52:24.000Z
Light/include/light/rendering/framebuffer.hpp
R-Bread/Light
151308c0159c4fe0d795b3c16f205e4af68710d7
[ "MIT" ]
9
2021-04-10T19:32:11.000Z
2021-05-19T16:29:25.000Z
#ifndef __FRAMEBUFFER_H__ #define __FRAMEBUFFER_H__ #include "core/base.hpp" namespace Light { enum class FramebufferTextureFormat { None, // Color Buffers RGBA8, RED_INTEGER, // Depth Buffers DEPTH24_STENCIL8, // Default depth Depth = DEPTH24_STENCIL8, /** * @brief First index of Depth Type attachment * @example Use like if(fmt < FramebufferAttachmentFormat::DepthType) { // Code for color buffers } */ DepthTypes = DEPTH24_STENCIL8 }; enum class TextureWrap { None, REPEAT, MIRRORED_REPEAT, CLAMP_TO_BORDER, CLAMP_TO_EDGE }; struct FramebufferTextureSpec { FramebufferTextureFormat textureFormat = FramebufferTextureFormat::None; TextureWrap wrapFormat = TextureWrap::None; FramebufferTextureSpec() = default; FramebufferTextureSpec( FramebufferTextureFormat format, TextureWrap wrap) : textureFormat(format), wrapFormat(wrap) {} }; struct FramebufferAttachmentsSpec { std::vector<FramebufferTextureSpec> attachments; FramebufferAttachmentsSpec() = default; FramebufferAttachmentsSpec( std::initializer_list<FramebufferTextureSpec> attachmentList) : attachments(attachmentList) {} std::vector<FramebufferTextureSpec>::iterator begin() { return attachments.begin(); } std::vector<FramebufferTextureSpec>::iterator end() { return attachments.end(); } std::vector<FramebufferTextureSpec>::const_iterator begin() const { return attachments.begin(); } std::vector<FramebufferTextureSpec>::const_iterator end() const { return attachments.end(); } }; struct FramebufferSpec { uint32_t width, height; uint32_t samples = 1; FramebufferAttachmentsSpec attachments; bool swapChainTarget = false; }; class Framebuffer { public: Framebuffer() = default; virtual ~Framebuffer() = default; virtual const FramebufferSpec& getSpec() const = 0; virtual uint32_t getColorAttachmentRendererId(uint32_t attachmentIndex = 0) const = 0; virtual void resize(uint32_t width, uint32_t height) = 0; virtual int readPixelInt(uint32_t attachmentIndex, uint32_t x, uint32_t y) = 0; virtual glm::vec4 readPixelVec4(uint32_t attachmentIndex, uint32_t x, uint32_t y) = 0; virtual void clearAttachment(uint32_t attachmentIndex, int clearValue) = 0; virtual void clearAttachment(uint32_t attachmentIndex, glm::vec4 clearValue) = 0; virtual void clearDepthAttachment() = 0; virtual void bind() = 0; virtual void unbind() = 0; virtual void bindAttachmentTexture(uint32_t attachmentIndex, uint32_t slot) = 0; static std::shared_ptr<Framebuffer> create(const FramebufferSpec& spec); }; } #endif // __FRAMEBUFFER_H__
25.375
101
0.750663
R-Bread
311ab21746a058d062ea864e75831f091f8667de
6,083
cpp
C++
test/class.cpp
16tons/camp
3edae6d6a06036bac5faf4e7b9e7b5dd8e463af8
[ "MIT" ]
1
2018-08-07T22:32:55.000Z
2018-08-07T22:32:55.000Z
test/class.cpp
16tons/camp
3edae6d6a06036bac5faf4e7b9e7b5dd8e463af8
[ "MIT" ]
null
null
null
test/class.cpp
16tons/camp
3edae6d6a06036bac5faf4e7b9e7b5dd8e463af8
[ "MIT" ]
null
null
null
/**************************************************************************** ** ** This file is part of the CAMP library. ** ** The MIT License (MIT) ** ** Copyright (C) 2009-2014 TEGESO/TEGESOFT and/or its subsidiary(-ies) and mother company. ** Contact: Tegesoft Information (contact@tegesoft.com) ** ** Permission is hereby granted, free of charge, to any person obtaining a copy ** of this software and associated documentation files (the "Software"), to deal ** in the Software without restriction, including without limitation the rights ** to use, copy, modify, merge, publish, distribute, sublicense, and/or sell ** copies of the Software, and to permit persons to whom the Software is ** furnished to do so, subject to the following conditions: ** ** The above copyright notice and this permission notice shall be included in ** all copies or substantial portions of the Software. ** ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ** AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, ** OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN ** THE SOFTWARE. ** ****************************************************************************/ #include "class.hpp" #include <camp/classget.hpp> #include <boost/test/unit_test.hpp> using namespace ClassTest; //----------------------------------------------------------------------------- // Tests for camp::Class //----------------------------------------------------------------------------- BOOST_AUTO_TEST_SUITE(CLASS) //----------------------------------------------------------------------------- BOOST_AUTO_TEST_CASE(declare) { std::size_t count = camp::classCount(); camp::Class::declare<MyTempClass>(); BOOST_CHECK_EQUAL(camp::classCount(), count + 1); } //----------------------------------------------------------------------------- BOOST_AUTO_TEST_CASE(declareExceptions) { // to make sure it is declared camp::classByType<MyClass>(); BOOST_CHECK_THROW(camp::Class::declare<MyClass>(), camp::ClassAlreadyCreated); BOOST_CHECK_THROW(camp::Class::declare<MyUndeclaredClass>(), camp::ClassAlreadyCreated); } //----------------------------------------------------------------------------- BOOST_AUTO_TEST_CASE(get) { MyClass object; MyUndeclaredClass object2; BOOST_CHECK_EQUAL(camp::classById("ClassTest::MyClass").name(), "ClassTest::MyClass"); BOOST_CHECK_EQUAL(camp::classByType<MyClass>().name(), "ClassTest::MyClass"); BOOST_CHECK_EQUAL(camp::classByObject(object).name(), "ClassTest::MyClass"); BOOST_CHECK_EQUAL(camp::classByObject(&object).name(), "ClassTest::MyClass"); BOOST_CHECK_EQUAL(camp::classByTypeSafe<MyUndeclaredClass>(), static_cast<camp::Class*>(0)); BOOST_CHECK_THROW(camp::classById("ClassTest::MyUndeclaredClass"), camp::ClassNotFound); BOOST_CHECK_THROW(camp::classByType<MyUndeclaredClass>(), camp::ClassNotFound); BOOST_CHECK_THROW(camp::classByObject(object2), camp::ClassNotFound); BOOST_CHECK_THROW(camp::classByObject(&object2), camp::ClassNotFound); } //----------------------------------------------------------------------------- BOOST_AUTO_TEST_CASE(comparisons) { const camp::Class& class1 = camp::classByType<MyClass>(); const camp::Class& class2 = camp::classByType<MyClass2>(); BOOST_CHECK(class1 == class1); BOOST_CHECK(class1 != class2); BOOST_CHECK(class2 != class1); } //----------------------------------------------------------------------------- BOOST_AUTO_TEST_CASE(properties) { const camp::Class& metaclass = camp::classByType<MyClass>(); BOOST_CHECK_EQUAL(metaclass.propertyCount(), 1U); BOOST_CHECK_EQUAL(metaclass.hasProperty("prop"), true); BOOST_CHECK_EQUAL(metaclass.hasProperty("xxxx"), false); } //----------------------------------------------------------------------------- BOOST_AUTO_TEST_CASE(functions) { const camp::Class& metaclass = camp::classByType<MyClass>(); BOOST_CHECK_EQUAL(metaclass.functionCount(), 1U); BOOST_CHECK_EQUAL(metaclass.hasFunction("func"), true); BOOST_CHECK_EQUAL(metaclass.hasFunction("xxxx"), false); } //----------------------------------------------------------------------------- BOOST_AUTO_TEST_CASE(inheritance) { const camp::Class& derived = camp::classByType<Derived>(); BOOST_CHECK_EQUAL(derived.baseCount(), 1U); BOOST_CHECK_EQUAL(derived.base(0).name(), "ClassTest::Base"); BOOST_CHECK_THROW(derived.base(1), camp::OutOfRange); } //----------------------------------------------------------------------------- BOOST_AUTO_TEST_CASE(rtti) { Base* base = new Base; Base* derived = new Derived; Base* nortti = new DerivedNoRtti; Base* nortti2 = new Derived2NoRtti; BOOST_CHECK_EQUAL(camp::classByObject(base).name(), "ClassTest::Base"); // base is really a base BOOST_CHECK_EQUAL(camp::classByObject(*base).name(), "ClassTest::Base"); BOOST_CHECK_EQUAL(camp::classByObject(derived).name(), "ClassTest::Derived"); // CAMP finds its real type thanks to CAMP_RTTI BOOST_CHECK_EQUAL(camp::classByObject(*derived).name(), "ClassTest::Derived"); BOOST_CHECK_EQUAL(camp::classByObject(nortti).name(), "ClassTest::Base"); // CAMP fails to find its derived type without CAMP_RTTI BOOST_CHECK_EQUAL(camp::classByObject(*nortti).name(), "ClassTest::Base"); BOOST_CHECK_EQUAL(camp::classByObject(nortti2).name(), "ClassTest::Derived"); // CAMP finds the closest derived type which has CAMP_RTTI BOOST_CHECK_EQUAL(camp::classByObject(*nortti2).name(), "ClassTest::Derived"); delete nortti2; delete nortti; delete derived; delete base; } BOOST_AUTO_TEST_SUITE_END()
42.243056
141
0.605458
16tons
311b9b6de9cf2b8939ff1f533a5e465e28ae1f03
274
cpp
C++
GameFramework/Base/RenderSystem/RsIndexBuffer.cpp
GavWood/tutorials
d5140129b6acd6d61f6feedcd352c12e4ebabd40
[ "BSD-2-Clause" ]
8
2017-10-26T14:26:55.000Z
2022-01-07T07:35:39.000Z
GameFramework/Base/RenderSystem/RsIndexBuffer.cpp
GavWood/tutorials
d5140129b6acd6d61f6feedcd352c12e4ebabd40
[ "BSD-2-Clause" ]
1
2017-09-28T08:21:04.000Z
2017-10-04T09:17:57.000Z
GameFramework/Base/RenderSystem/RsIndexBuffer.cpp
GavWood/Game-Framework
d5140129b6acd6d61f6feedcd352c12e4ebabd40
[ "BSD-2-Clause" ]
1
2021-07-21T17:37:33.000Z
2021-07-21T17:37:33.000Z
//////////////////////////////////////////////////////////////////////////////// /// RsIndexBuffer.cpp #include "RsIndexBuffer.h" BtU32 RsIndexBuffer::IndType_Short = 1 << 0; BtU32 RsIndexBuffer::IndType_Long = 1 << 2; BtU32 RsIndexBuffer::IndType_Dynamic = 1 << 3;
27.4
80
0.5
GavWood
311c58e18d836b054abc76bc20511168ec8e9453
456
cpp
C++
cpp/infinite.cpp
simnalamburt/snippets
8ba4cfcb1305d2b82ea892e3305613eeb7ba382b
[ "ECL-2.0", "Apache-2.0", "MIT-0", "MIT" ]
31
2016-01-27T07:03:25.000Z
2022-02-25T07:59:11.000Z
cpp/infinite.cpp
simnalamburt/snippets
8ba4cfcb1305d2b82ea892e3305613eeb7ba382b
[ "ECL-2.0", "Apache-2.0", "MIT-0", "MIT" ]
1
2015-01-26T01:27:21.000Z
2015-01-30T16:16:30.000Z
cpp/infinite.cpp
simnalamburt/snippets
8ba4cfcb1305d2b82ea892e3305613eeb7ba382b
[ "ECL-2.0", "Apache-2.0", "MIT-0", "MIT" ]
3
2017-02-07T04:17:56.000Z
2020-06-12T05:01:31.000Z
// // 무한루프를 끝내기 // // // $ clang++ -O1 infinite.cpp // boom! // // $ clang++ -O3 infinite.cpp // boom! // // // Tested with: // LLVM 3.0 // LLVM 3.5.0 // Apple LLVM 7.0.0 // // Reference: // http://rosaec.snu.ac.kr/publish/2014/techmemo/ROSAEC-2014-002.pdf // #include <iostream> void foo() { while (1) { } } void bar() { foo(); for (int i = 0; i < 100; ++i) { } } int main() { using namespace std; bar(); cout << "boom!" << endl; }
12.666667
70
0.52193
simnalamburt
31259d261d4adfffd84bc8e11c6e76537527de79
7,003
cpp
C++
src/lib/import_export/csv_parser.cpp
IanJamesMcKay/InMemoryDB
a267d9522926eca9add2ad4512f8ce352daac879
[ "MIT" ]
1
2021-04-14T11:16:52.000Z
2021-04-14T11:16:52.000Z
src/lib/import_export/csv_parser.cpp
IanJamesMcKay/InMemoryDB
a267d9522926eca9add2ad4512f8ce352daac879
[ "MIT" ]
null
null
null
src/lib/import_export/csv_parser.cpp
IanJamesMcKay/InMemoryDB
a267d9522926eca9add2ad4512f8ce352daac879
[ "MIT" ]
1
2020-11-30T13:11:04.000Z
2020-11-30T13:11:04.000Z
#include "csv_parser.hpp" #include <fstream> #include <functional> #include <list> #include <memory> #include <optional> #include <string> #include <string_view> #include <utility> #include <vector> #include "constant_mappings.hpp" #include "import_export/csv_converter.hpp" #include "import_export/csv_meta.hpp" #include "resolve_type.hpp" #include "scheduler/job_task.hpp" #include "storage/chunk_encoder.hpp" #include "storage/column_encoding_utils.hpp" #include "storage/table.hpp" #include "utils/assert.hpp" #include "utils/load_table.hpp" namespace opossum { std::shared_ptr<Table> CsvParser::parse(const std::string& filename, const std::optional<CsvMeta>& csv_meta) { // If no meta info is given as a parameter, look for a json file if (csv_meta == std::nullopt) { _meta = process_csv_meta_file(filename + CsvMeta::META_FILE_EXTENSION); } else { _meta = *csv_meta; } auto table = _create_table_from_meta(); std::ifstream csvfile{filename}; std::string content{std::istreambuf_iterator<char>(csvfile), {}}; // return empty table if input file is empty if (!csvfile) return table; // make sure content ends with a delimiter for better row processing later if (content.back() != _meta.config.delimiter) content.push_back(_meta.config.delimiter); std::string_view content_view{content.c_str(), content.size()}; // Save chunks in list to avoid memory relocation std::list<ChunkColumns> columns_by_chunks; std::vector<std::shared_ptr<JobTask>> tasks; std::vector<size_t> field_ends; while (_find_fields_in_chunk(content_view, *table, field_ends)) { // create empty chunk columns_by_chunks.emplace_back(); auto& columns = columns_by_chunks.back(); // Only pass the part of the string that is actually needed to the parsing task std::string_view relevant_content = content_view.substr(0, field_ends.back()); // Remove processed part of the csv content content_view = content_view.substr(field_ends.back() + 1); // create and start parsing task to fill chunk tasks.emplace_back(std::make_shared<JobTask>([this, relevant_content, field_ends, &table, &columns]() { _parse_into_chunk(relevant_content, field_ends, *table, columns); })); tasks.back()->schedule(); } for (auto& task : tasks) { task->join(); } for (auto& chunk_columns : columns_by_chunks) { table->append_chunk(chunk_columns); } if (_meta.auto_compress) ChunkEncoder::encode_all_chunks(table); return table; } std::shared_ptr<Table> CsvParser::_create_table_from_meta() { TableColumnDefinitions colum_definitions; for (const auto& column_meta : _meta.columns) { auto column_name = column_meta.name; BaseCsvConverter::unescape(column_name); auto column_type = column_meta.type; BaseCsvConverter::unescape(column_type); const auto data_type = data_type_to_string.right.at(column_type); colum_definitions.emplace_back(column_name, data_type, column_meta.nullable); } return std::make_shared<Table>(colum_definitions, TableType::Data, _meta.chunk_size, UseMvcc::Yes); } bool CsvParser::_find_fields_in_chunk(std::string_view csv_content, const Table& table, std::vector<size_t>& field_ends) { field_ends.clear(); if (csv_content.empty()) { return false; } std::string search_for{_meta.config.separator, _meta.config.delimiter, _meta.config.quote}; size_t pos, from = 0; unsigned int rows = 0, field_count = 1; bool in_quotes = false; while (rows < table.max_chunk_size() || 0 == table.max_chunk_size()) { // Find either of row separator, column delimiter, quote identifier pos = csv_content.find_first_of(search_for, from); if (std::string::npos == pos) { break; } from = pos + 1; const char elem = csv_content.at(pos); // Make sure to "toggle" in_quotes ONLY if the quotes are not part of the string (i.e. escaped) if (elem == _meta.config.quote) { bool quote_is_escaped = false; if (_meta.config.quote != _meta.config.escape) { quote_is_escaped = pos != 0 && csv_content.at(pos - 1) == _meta.config.escape; } if (!quote_is_escaped) { in_quotes = !in_quotes; } } // Determine if delimiter marks end of row or is part of the (string) value if (elem == _meta.config.delimiter && !in_quotes) { Assert(field_count == table.column_count(), "Number of CSV fields does not match number of columns."); ++rows; field_count = 0; } // Determine if separator marks end of field or is part of the (string) value if (in_quotes || elem == _meta.config.quote) { continue; } ++field_count; field_ends.push_back(pos); } return true; } size_t CsvParser::_parse_into_chunk(std::string_view csv_chunk, const std::vector<size_t>& field_ends, const Table& table, ChunkColumns& columns) { // For each csv column create a CsvConverter which builds up a ValueColumn const auto column_count = table.column_count(); const auto row_count = field_ends.size() / column_count; std::vector<std::unique_ptr<BaseCsvConverter>> converters; for (ColumnID column_id{0}; column_id < column_count; ++column_id) { const auto is_nullable = table.column_is_nullable(column_id); const auto column_type = table.column_data_type(column_id); converters.emplace_back( make_unique_by_data_type<BaseCsvConverter, CsvConverter>(column_type, row_count, _meta.config, is_nullable)); } size_t start = 0; for (size_t row_id = 0; row_id < row_count; ++row_id) { for (ColumnID column_id{0}; column_id < column_count; ++column_id) { const auto end = field_ends.at(row_id * column_count + column_id); auto field = std::string{csv_chunk.substr(start, end - start)}; start = end + 1; if (!_meta.config.rfc_mode) { // CSV fields not following RFC 4810 might need some preprocessing _sanitize_field(field); } try { converters[column_id]->insert(field, row_id); } catch (const std::exception& exception) { throw std::logic_error("Exception while parsing CSV, row " + std::to_string(row_id) + ", column " + std::to_string(column_id) + ":\n" + exception.what()); } } } // Transform the field_offsets to columns and add columns to chunk. for (auto& converter : converters) { columns.push_back(converter->finish()); } return row_count; } void CsvParser::_sanitize_field(std::string& field) { const std::string linebreak(1, _meta.config.delimiter); const std::string escaped_linebreak = std::string(1, _meta.config.delimiter_escape) + std::string(1, _meta.config.delimiter); std::string::size_type pos = 0; while ((pos = field.find(escaped_linebreak, pos)) != std::string::npos) { field.replace(pos, escaped_linebreak.size(), linebreak); pos += linebreak.size(); } } } // namespace opossum
33.830918
117
0.691561
IanJamesMcKay
3125c3eb4a4fe5903cc398256cf9a7279f6a2c26
1,263
cpp
C++
labs/lab8/lab8.cpp
jschmidtnj/CPE390
610dd11c51431f2d02b919c0c32f626a3e625b04
[ "MIT" ]
null
null
null
labs/lab8/lab8.cpp
jschmidtnj/CPE390
610dd11c51431f2d02b919c0c32f626a3e625b04
[ "MIT" ]
null
null
null
labs/lab8/lab8.cpp
jschmidtnj/CPE390
610dd11c51431f2d02b919c0c32f626a3e625b04
[ "MIT" ]
null
null
null
#include <iostream> #include <limits> using namespace std; double maximum(double array[], int len) { if (len < 1) return -1 * numeric_limits<double>::infinity(); double res = array[0]; for (int i = 0; i < len; i++) if (array[i] > res) res = array[i]; return res; } double minimum(double array[], int len) { if (len < 1) return numeric_limits<double>::infinity(); double res = array[0]; for (int i = 0; i < len; i++) if (array[i] < res) res = array[i]; return res; } double average(double array[], int len) { double res = 0.0; for (int i = 0; i < len; i++) res += array[i]; return res / len; } int dot_product(int array1[], int array2[], int len) { int res = 0; for (int i = 0; i < len; i++) { res += array1[i] * array2[i]; } return res; } int main() { int len_array = 8; double array[] = {3.1, 5.6, 6.0, 7.8, 0.2, 9.5, 4.0, 8.0}; cout.precision(4); cout << "max: " << maximum(array, len_array) << endl; cout << "min: " << minimum(array, len_array) << endl; cout << "avg: " << average(array, len_array) << endl; int len_array_2 = 4; int array1[] = {3, 4, 8, 2}; int array2[] = {1, 3, 2, 4}; cout << "dot product: " << dot_product(array1, array2, len_array_2) << endl; }
21.40678
78
0.561362
jschmidtnj
312d41d25311b474d2ed730983e75152652e32a4
7,304
cpp
C++
SmartRally/SCBW/api.cpp
idmontie/gptp
14d68e5eac84c2f3085ac25a7fff31a07ea387f6
[ "0BSD" ]
8
2015-04-03T16:50:59.000Z
2021-01-06T17:12:29.000Z
SmartRally/SCBW/api.cpp
idmontie/gptp
14d68e5eac84c2f3085ac25a7fff31a07ea387f6
[ "0BSD" ]
6
2015-04-03T18:10:56.000Z
2016-02-18T05:04:21.000Z
SmartRally/SCBW/api.cpp
idmontie/gptp
14d68e5eac84c2f3085ac25a7fff31a07ea387f6
[ "0BSD" ]
6
2015-04-04T04:37:33.000Z
2018-04-09T09:03:50.000Z
#include "api.h" #include "scbwdata.h" #include <SCBW/UnitFinder.h> #include <algorithm> #include <cassert> #define NOMINMAX #define WIN32_LEAN_AND_MEAN #include <windows.h> namespace scbw { const u32 Func_PrintText = 0x0048CD30; void printText(const char* text, u32 color) { if (!text) return; DWORD gtc = GetTickCount() + 7000; __asm { PUSHAD PUSH 0 ;//unknown MOV eax, text PUSH gtc PUSH color CALL Func_PrintText POPAD } } const u32 Func_PlaySound = 0x0048ED50; void playSound(u32 sfxId, const CUnit *sourceUnit) { __asm { PUSHAD PUSH 0 PUSH 1 MOV ESI, sourceUnit MOV EBX, sfxId CALL Func_PlaySound POPAD } } const u32 Func_ShowErrorMessageWithSfx = 0x0048EE30; void showErrorMessageWithSfx(u32 playerId, u32 statTxtId, u32 sfxId) { __asm { PUSHAD MOV ESI, sfxId MOV EDI, statTxtId MOV EBX, playerId CALL Func_ShowErrorMessageWithSfx POPAD } } // Logically equivalent to function @ 0x004C36F0 const char* getStatTxtTblString(u16 index) { if (index == 0) return NULL; else if (index <= **statTxtTbl) return (char*)(*statTxtTbl) + (*statTxtTbl)[index]; else return ""; } u32 getUnitOverlayAdjustment(const CUnit* const unit) { if (Unit::BaseProperty[unit->id] & UnitProperty::MediumOverlay) return 1; else if (Unit::BaseProperty[unit->id] & UnitProperty::LargeOverlay) return 2; else return 0; } //-------- Weapon related --------// //Identical to function @ 0x00475CE0 bool canWeaponTargetUnit(u8 weaponId, const CUnit *target, const CUnit *attacker) { if (weaponId >= WEAPON_TYPE_COUNT) return false; if (target == NULL) return Weapon::TargetFlags[weaponId].terrain; if (target->status & UnitStatus::Invincible) return false; const TargetFlag tf = Weapon::TargetFlags[weaponId]; const u32 targetProps = Unit::BaseProperty[target->id]; if ((target->status & UnitStatus::InAir) ? !tf.air : !tf.ground) return false; if (tf.mechanical && !(targetProps & UnitProperty::Mechanical)) return false; if (tf.organic && !(targetProps & UnitProperty::Organic)) return false; if (tf.nonBuilding && (targetProps & UnitProperty::Building)) return false; if (tf.nonRobotic && (targetProps & UnitProperty::RoboticUnit)) return false; if (tf.orgOrMech && !(targetProps & (UnitProperty::Organic | UnitProperty::Mechanical))) return false; if (tf.playerOwned && target->playerId != attacker->playerId) return false; return true; } const u32 Func_FireUnitWeapon = 0x00479C90; void fireUnitWeapon(CUnit* unit, u8 weaponId) { if (weaponId >= WEAPON_TYPE_COUNT) return; u32 _weaponId = weaponId; __asm { PUSHAD PUSH _weaponId MOV ESI, unit CALL Func_FireUnitWeapon POPAD } } const u32 Func_CreateUnitAtPos = 0x004CD360; //AKA createUnitXY() CUnit* createUnitAtPos(u16 unitType, u16 playerId, u32 x, u32 y) { if (unitType >= UNIT_TYPE_COUNT) return NULL; CUnit* unit; __asm { PUSHAD MOV CX, unitType MOV AX, playerId PUSH y PUSH x CALL Func_CreateUnitAtPos MOV unit, EAX POPAD } return unit; } const u32 Func_CanBeEnteredBy = 0x004E6E00; //AKA CanEnterTransport() bool canBeEnteredBy(const CUnit* transport, const CUnit* unit) { u32 result; __asm { PUSHAD MOV EAX, transport PUSH unit CALL Func_CanBeEnteredBy MOV result, EAX POPAD } return result != 0; } //-------- isUnderDarkSwarm() --------// class DarkSwarmFinderProc: public UnitFinderCallbackMatchInterface { public: bool match(const CUnit *unit) { return unit->id == UnitId::Spell_DarkSwarm; } }; bool isUnderDarkSwarm(const CUnit *unit) { static UnitFinder darkSwarmFinder; static DarkSwarmFinderProc dsFinder; darkSwarmFinder.search(unit->getLeft(), unit->getTop(), unit->getRight(), unit->getBottom()); return darkSwarmFinder.getFirst(dsFinder) != NULL; } // Improved code from BWAPI's include/BWAPI/Position.h: getApproxDistance() // Logically same as function @ 0x0040C360 u32 getDistanceFast(s32 x1, s32 y1, s32 x2, s32 y2) { int dMax = abs(x1 - x2), dMin = abs(y1 - y2); if (dMax < dMin) std::swap(dMax, dMin); if (dMin <= (dMax >> 2)) return dMax; return (dMin * 3 >> 3) + (dMin * 3 >> 8) + dMax - (dMax >> 4) - (dMax >> 6); } u8 getUpgradeLevel(const u8 playerId, const u8 upgradeId) { assert(playerId < PLAYER_COUNT); assert(upgradeId < 61); if (upgradeId < 46) return Upgrade::CurrentUpgSc->level[playerId][upgradeId]; else return Upgrade::CurrentUpgBw->level[playerId][upgradeId - 46]; } u32 getSupplyAvailable(u8 playerId, u8 raceId) { assert(raceId <= 2); assert(playerId < 12); u32 supplyProvided; if (isCheatEnabled(CheatFlags::FoodForThought)) supplyProvided = raceSupply[raceId].max[playerId]; else supplyProvided = raceSupply[raceId].provided[playerId]; return supplyProvided - raceSupply[raceId].used[playerId]; } u8 getRaceId(u16 unitId) { assert(unitId < UNIT_TYPE_COUNT); GroupFlag ugf = Unit::GroupFlags[unitId]; if (ugf.isZerg) return 0; else if (ugf.isTerran) return 1; else if (ugf.isProtoss) return 2; else return 4; } const u32 Func_GetGroundHeightAtPos = 0x004BD0F0; u32 getGroundHeightAtPos(s32 x, s32 y) { u32 height; __asm { PUSHAD MOV EAX, y MOV ECX, x CALL Func_GetGroundHeightAtPos MOV height, EAX POPAD } return height; } void refreshScreen(int left, int top, int right, int bottom) { left >>= 4; right = (right + 15) >> 4; top >>= 4; bottom = (bottom + 15) >> 4; if (left > right) std::swap(left, right); if (top > bottom) std::swap(top, bottom); //Rect out of bounds if (left >= 40 || right < 0 || top >= 30 || bottom < 0) return; left = std::max(left, 0); right = std::min(right, 40 - 1); top = std::max(top, 0); bottom = std::min(bottom, 30 - 1); for (int y = top; y <= bottom; ++y) memset(&refreshRegions[40 * y + left], 1, right - left + 1); } void refreshScreen() { memset(refreshRegions, 1, 1200); } //Logically equivalent to function @ 0x004C36C0 void refreshConsole() { u32* const bCanUpdateCurrentButtonSet = (u32*) 0x0068C1B0; u8* const bCanUpdateSelectedUnitPortrait = (u8*) 0x0068AC74; u8* const bCanUpdateStatDataDialog = (u8*) 0x0068C1F8; u32* const someDialogUnknown = (u32*) 0x0068C1E8; u32* const unknown2 = (u32*) 0x0068C1EC; *bCanUpdateCurrentButtonSet = 1; *bCanUpdateSelectedUnitPortrait = 1; *bCanUpdateStatDataDialog = 1; *someDialogUnknown = 0; *unknown2 = 0; } u16 random() { if (*IS_IN_GAME_LOOP) { *lastRandomNumber = 22695477 * (*lastRandomNumber) + 1; return (*lastRandomNumber >> 16) % 32768; //Make a number between 0 and 32767 } else return 0; } u32 randBetween(u32 min, u32 max) { assert(min <= max); return min + ((max - min + 1) * random() >> 15); } } //scbw
24.928328
96
0.638828
idmontie
312dac6c9463b0fbf8db138b6b3babc03dda13dd
3,467
cpp
C++
Kyrie/Hotkeys.cpp
wangxh1007/ddmk
a6ff276d96b663e71b3ccadabc2d92c50c18ebac
[ "Zlib" ]
null
null
null
Kyrie/Hotkeys.cpp
wangxh1007/ddmk
a6ff276d96b663e71b3ccadabc2d92c50c18ebac
[ "Zlib" ]
null
null
null
Kyrie/Hotkeys.cpp
wangxh1007/ddmk
a6ff276d96b663e71b3ccadabc2d92c50c18ebac
[ "Zlib" ]
null
null
null
#include "Hotkeys.h" void Hotkeys_TogglePause(BYTE * state) { static bool execute = true; BYTE keys[] = { DIK_LCONTROL, DIK_D, }; uint8 keysDown = 0; for (uint8 i = 0; i < countof(keys); i++) { if (state[keys[i]] & 0x80) { keysDown++; } } if (keysDown == countof(keys)) { if (execute) { pause = !pause; PostMessageA(mainWindow, DM_PAUSE, 0, 0); execute = false; } } else { execute = true; } } // // // // // // // // // // // // // // // // // //// add save check! // //void Hotkeys::Exit(BYTE * buffer) //{ // static bool execute = true; // BYTE keys[] = // { // DIK_LALT, // DIK_F4, // }; // uint8 keysDown = 0; // for (uint8 i = 0; i < countof(keys); i++) // { // if (buffer[keys[i]] & 0x80) // { // keysDown++; // } // } // if (keysDown == countof(keys)) // { // if (execute) // { // PostMessageA(mainWindow, WM_QUIT, 0, 0); // execute = false; // } // } // else // { // execute = true; // } //} // // // // // // // // // // // //void Hotkeys::MenuController(BYTE * state) //{ // using namespace System::Input; // using namespace Game::Actor; // BYTE * gamepadAddr = *(BYTE **)(me32.modBaseAddr + 0xF2432C); // if (!gamepadAddr) // { // return; // } // if (InControl()) // { // return; // } // DWORD off[MAX_ACTOR] = // { // 0x3C, // 0x308, // 0x5D4, // 0x8A0 // }; // DWORD map[][2] = // { // { MTF_GAMEPAD_START, DIK_ESCAPE }, // { MTF_GAMEPAD_DPAD_UP, DIK_UP }, // { MTF_GAMEPAD_DPAD_RIGHT, DIK_RIGHT }, // { MTF_GAMEPAD_DPAD_DOWN, DIK_DOWN }, // { MTF_GAMEPAD_DPAD_LEFT, DIK_LEFT }, // { MTF_GAMEPAD_LEFT_SHOULDER, DIK_N }, // { MTF_GAMEPAD_RIGHT_SHOULDER, DIK_SPACE }, // { MTF_GAMEPAD_Y, DIK_Y }, // { MTF_GAMEPAD_B, DIK_B }, // { MTF_GAMEPAD_A, DIK_A }, // { MTF_GAMEPAD_X, DIK_X }, // { MTF_GAMEPAD_LEFT_STICK_UP, DIK_UP }, // { MTF_GAMEPAD_LEFT_STICK_RIGHT, DIK_RIGHT }, // { MTF_GAMEPAD_LEFT_STICK_DOWN, DIK_DOWN }, // { MTF_GAMEPAD_LEFT_STICK_LEFT, DIK_LEFT } // }; // for (uint8 device = ACTOR_TWO; device < MAX_ACTOR; device++) // { // DWORD & buttons = *(DWORD *)(gamepadAddr + off[device] + 0x15C); // for (uint8 index = 0; index < countof(map); index++) // { // uint32 button = map[index][0]; // uint32 key = map[index][1]; // if (buttons & button) // { // state[key] = 0x80; // } // } // } //} // //void Hotkeys::StartCameraController(BYTE * state) //{ // using namespace System::Input; // using namespace Game::Actor; // BYTE * gamepadAddr = *(BYTE **)(me32.modBaseAddr + 0xF2432C); // if (!gamepadAddr) // { // return; // } // if (!InControl()) // { // return; // } // DWORD off[MAX_ACTOR] = // { // 0x3C, // 0x308, // 0x5D4, // 0x8A0 // }; // DWORD map[][2] = // { // { MTF_GAMEPAD_START, DIK_ESCAPE }, // { MTF_GAMEPAD_RIGHT_STICK_UP, DIK_UP }, // { MTF_GAMEPAD_RIGHT_STICK_RIGHT, DIK_RIGHT }, // { MTF_GAMEPAD_RIGHT_STICK_DOWN, DIK_DOWN }, // { MTF_GAMEPAD_RIGHT_STICK_LEFT, DIK_LEFT } // }; // for (uint8 device = ACTOR_TWO; device < MAX_ACTOR; device++) // { // DWORD & buttons = *(DWORD *)(gamepadAddr + off[device] + 0x15C); // for (uint8 index = 0; index < countof(map); index++) // { // uint32 button = map[index][0]; // uint32 key = map[index][1]; // if (buttons & button) // { // state[key] = 0x80; // } // } // } //}
18.343915
68
0.535622
wangxh1007
312ed779f25cce3d3684e847302c60a64ef779b9
462
cpp
C++
src/5/BreakTest.cpp
jhxie/CPlusPlusHowToProgram
a622902a9e5e9766d9ddb83a38070d57dba786c3
[ "BSD-2-Clause" ]
1
2018-01-10T03:32:46.000Z
2018-01-10T03:32:46.000Z
src/5/BreakTest.cpp
jhxie/CPlusPlusHowToProgram
a622902a9e5e9766d9ddb83a38070d57dba786c3
[ "BSD-2-Clause" ]
null
null
null
src/5/BreakTest.cpp
jhxie/CPlusPlusHowToProgram
a622902a9e5e9766d9ddb83a38070d57dba786c3
[ "BSD-2-Clause" ]
null
null
null
/** * 5.13 * 'break' statement exiting a 'for' statement. */ #include <iostream> using namespace std; int main(void) { unsigned int counter; // control variable also used after loop for (counter = 1; counter <= 10; ++counter) { if (counter == 5) { break; // terminates loop if 'counter' is 5 } cout << counter << " "; } cout << "\nBroke out of loop at 'counter' = " << counter << endl; return 0; }
19.25
69
0.551948
jhxie
3132822d3478431b013a3f615bbf4900a00282c5
866
cpp
C++
test/testUtil/testText/testJsonReader/TestJsonRemove.cpp
wangsun1983/Obotcha
2464e53599305703f5150df72bf73579a39d8ef4
[ "MIT" ]
27
2019-04-27T00:51:22.000Z
2022-03-30T04:05:44.000Z
test/testUtil/testText/testJsonReader/TestJsonRemove.cpp
wangsun1983/Obotcha
2464e53599305703f5150df72bf73579a39d8ef4
[ "MIT" ]
9
2020-05-03T12:17:50.000Z
2021-10-15T02:18:47.000Z
test/testUtil/testText/testJsonReader/TestJsonRemove.cpp
wangsun1983/Obotcha
2464e53599305703f5150df72bf73579a39d8ef4
[ "MIT" ]
1
2019-04-16T01:45:36.000Z
2019-04-16T01:45:36.000Z
#include <stdio.h> #include <unistd.h> #include "JsonWriter.hpp" #include "JsonReader.hpp" #include "JsonValue.hpp" #include "File.hpp" #include "Log.hpp" using namespace obotcha; int testremove() { JsonReader mReader = createJsonReader(createFile("abc.json")); JsonValue root = mReader->get(); JsonValue arr = root->getValue("arr"); arr->removeAt(1); if(arr->size() != 2) { printf("---[JsonReader testRemove case1...,size is %d ] [FAIL]--- \n",arr->size()); } String attr1 = arr->getStringAt(0); if(!attr1->equals("abc1")) { printf("---[JsonReader testRemove case2...] [FAIL]--- \n"); } String attr2 = arr->getStringAt(1); if(!attr2->equals("abc3")) { printf("---[JsonReader testRemove case3...] [FAIL]--- \n"); } printf("---[JsonReader testRemove case...] [OK]--- \n"); return 0; }
24.055556
89
0.596998
wangsun1983
3138d4f99c8879d5211428906f83da19686e91d5
11,753
cc
C++
pdb/src/executionServer/sources/physicalAlgorithms/PDBShuffleForJoinAlgorithm.cc
SeraphL/plinycompute
7788bc2b01d83f4ff579c13441d0ba90734b54a2
[ "Apache-2.0" ]
3
2019-05-04T05:17:30.000Z
2020-02-21T05:01:59.000Z
pdb/src/executionServer/sources/physicalAlgorithms/PDBShuffleForJoinAlgorithm.cc
dcbdan/plinycompute
a6f1c8ac8f75c09615f08752c82179f33cfc6d89
[ "Apache-2.0" ]
3
2020-02-20T19:50:46.000Z
2020-06-25T14:31:51.000Z
pdb/src/executionServer/sources/physicalAlgorithms/PDBShuffleForJoinAlgorithm.cc
dcbdan/plinycompute
a6f1c8ac8f75c09615f08752c82179f33cfc6d89
[ "Apache-2.0" ]
5
2019-02-19T23:17:24.000Z
2020-08-03T01:08:04.000Z
// // Created by dimitrije on 5/7/19. // #include <ComputePlan.h> #include <PDBCatalogClient.h> #include <physicalAlgorithms/PDBShuffleForJoinAlgorithm.h> #include <ExJob.h> #include <PDBStorageManagerBackend.h> #include <PDBPageNetworkSender.h> #include <ShuffleJoinProcessor.h> #include <PDBPageSelfReceiver.h> #include <GenericWork.h> #include <memory> pdb::PDBShuffleForJoinAlgorithm::PDBShuffleForJoinAlgorithm(const std::vector<PDBPrimarySource> &primarySource, const AtomicComputationPtr &finalAtomicComputation, const pdb::Handle<pdb::PDBSinkPageSetSpec> &intermediate, const pdb::Handle<pdb::PDBSinkPageSetSpec> &sink, const std::vector<pdb::Handle<PDBSourcePageSetSpec>> &secondarySources, const pdb::Handle<pdb::Vector<PDBSetObject>> &setsToMaterialize) : PDBPhysicalAlgorithm(primarySource, finalAtomicComputation, sink, secondarySources, setsToMaterialize), intermediate(intermediate) { } pdb::PDBPhysicalAlgorithmType pdb::PDBShuffleForJoinAlgorithm::getAlgorithmType() { return ShuffleForJoin; } bool pdb::PDBShuffleForJoinAlgorithm::setup(std::shared_ptr<pdb::PDBStorageManagerBackend> &storage, Handle<pdb::ExJob> &job, const std::string &error) { // init the plan ComputePlan plan(std::make_shared<LogicalPlan>(job->tcap, *job->computations)); logicalPlan = plan.getPlan(); // init the logger logger = make_shared<PDBLogger>("ShuffleJoinPipeAlgorithm" + std::to_string(job->computationID)); /// 0. Make the intermediate page set // get the sink page set auto intermediatePageSet = storage->createAnonymousPageSet(intermediate->pageSetIdentifier); // did we manage to get a sink page set? if not the setup failed if (intermediatePageSet == nullptr) { return false; } /// 1. Init the shuffle queues pageQueues = std::make_shared<std::vector<PDBPageQueuePtr>>(); for(int i = 0; i < job->numberOfNodes; ++i) { pageQueues->emplace_back(std::make_shared<PDBPageQueue>()); } /// 2. Create the page set that contains the shuffled join side pages for this node // get the receive page set auto recvPageSet = storage->createFeedingAnonymousPageSet(std::make_pair(sink->pageSetIdentifier.first, sink->pageSetIdentifier.second), job->numberOfProcessingThreads, job->numberOfNodes); // make sure we can use them all at the same time recvPageSet->setUsagePolicy(PDBFeedingPageSetUsagePolicy::KEEP_AFTER_USED); // did we manage to get a page set where we receive this? if not the setup failed if(recvPageSet == nullptr) { return false; } /// 3. Create the self receiver to forward pages that are created on this node and the network senders to forward pages for the other nodes auto myMgr = storage->getFunctionalityPtr<PDBBufferManagerInterface>(); senders = std::make_shared<std::vector<PDBPageNetworkSenderPtr>>(); for(unsigned i = 0; i < job->nodes.size(); ++i) { // check if it is this node or another node if(job->nodes[i]->port == job->thisNode->port && job->nodes[i]->address == job->thisNode->address) { // make the self receiver selfReceiver = std::make_shared<pdb::PDBPageSelfReceiver>(pageQueues->at(i), recvPageSet, myMgr); } else { // make the sender auto sender = std::make_shared<PDBPageNetworkSender>(job->nodes[i]->address, job->nodes[i]->port, job->numberOfProcessingThreads, job->numberOfNodes, storage->getConfiguration()->maxRetries, logger, std::make_pair(sink->pageSetIdentifier.first, sink->pageSetIdentifier.second), pageQueues->at(i)); // setup the sender, if we fail return false if(!sender->setup()) { return false; } // make the sender senders->emplace_back(sender); } } /// 4. Initialize the sources // we put them here std::vector<PDBAbstractPageSetPtr> sourcePageSets; sourcePageSets.reserve(sources.size()); // initialize them for(int i = 0; i < sources.size(); i++) { sourcePageSets.emplace_back(getSourcePageSet(storage, i)); } /// 5. Initialize all the pipelines // get the number of worker threads from this server's config int32_t numWorkers = storage->getConfiguration()->numThreads; // check that we have at least one worker per primary source if(numWorkers < sources.size()) { return false; } /// 6. Figure out the source page set joinShufflePipelines = std::make_shared<std::vector<PipelinePtr>>(); for (uint64_t pipelineIndex = 0; pipelineIndex < job->numberOfProcessingThreads; ++pipelineIndex) { /// 6.1. Figure out what source to use // figure out what pipeline auto pipelineSource = pipelineIndex % sources.size(); // grab these thins from the source we need them bool swapLHSandRHS = sources[pipelineSource].swapLHSandRHS; const pdb::String &firstTupleSet = sources[pipelineSource].firstTupleSet; // get the source computation auto srcNode = logicalPlan->getComputations().getProducingAtomicComputation(firstTupleSet); // go grab the source page set PDBAbstractPageSetPtr sourcePageSet = sourcePageSets[pipelineSource]; // did we manage to get a source page set? if not the setup failed if(sourcePageSet == nullptr) { return false; } /// 6.2. Figure out the parameters of the pipeline // figure out the join arguments auto joinArguments = getJoinArguments (storage); // if we could not create them we are out of here if(joinArguments == nullptr) { return false; } // get catalog client auto catalogClient = storage->getFunctionalityPtr<PDBCatalogClient>(); // empty computations parameters std::map<ComputeInfoType, ComputeInfoPtr> params = {{ComputeInfoType::PAGE_PROCESSOR, plan.getProcessorForJoin(finalTupleSet, job->numberOfNodes, job->numberOfProcessingThreads, *pageQueues, myMgr)}, {ComputeInfoType::JOIN_ARGS, joinArguments}, {ComputeInfoType::SHUFFLE_JOIN_ARG, std::make_shared<ShuffleJoinArg>(swapLHSandRHS)}, {ComputeInfoType::SOURCE_SET_INFO, getSourceSetArg(catalogClient, pipelineSource)}}; /// 6.3. Build the pipeline // build the join pipeline auto pipeline = plan.buildPipeline(firstTupleSet, /* this is the TupleSet the pipeline starts with */ finalTupleSet, /* this is the TupleSet the pipeline ends with */ sourcePageSet, intermediatePageSet, params, job->numberOfNodes, job->numberOfProcessingThreads, 20, pipelineIndex); // store the join pipeline joinShufflePipelines->push_back(pipeline); } return true; } bool pdb::PDBShuffleForJoinAlgorithm::run(std::shared_ptr<pdb::PDBStorageManagerBackend> &storage) { // success indicator atomic_bool success; success = true; /// 1. Run the self receiver, // create the buzzer atomic_int selfRecDone; selfRecDone = 0; PDBBuzzerPtr selfRefBuzzer = make_shared<PDBBuzzer>([&](PDBAlarm myAlarm, atomic_int &cnt) { // did we fail? if (myAlarm == PDBAlarm::GenericError) { success = false; } // we are done here cnt = 1; }); // run the work { // make the work PDBWorkPtr myWork = std::make_shared<pdb::GenericWork>([&selfRecDone, this](PDBBuzzerPtr callerBuzzer) { // run the receiver if(selfReceiver->run()) { // signal that the run was successful callerBuzzer->buzz(PDBAlarm::WorkAllDone, selfRecDone); } else { // signal that the run was unsuccessful callerBuzzer->buzz(PDBAlarm::GenericError, selfRecDone); } }); // run the work storage->getWorker()->execute(myWork, selfRefBuzzer); } /// 2. Run the senders // create the buzzer atomic_int sendersDone; sendersDone = 0; PDBBuzzerPtr sendersBuzzer = make_shared<PDBBuzzer>([&](PDBAlarm myAlarm, atomic_int &cnt) { // did we fail? if (myAlarm == PDBAlarm::GenericError) { success = false; } // we are done here cnt++; }); // go through each sender and run them for(auto &sender : *senders) { // make the work PDBWorkPtr myWork = std::make_shared<pdb::GenericWork>([&sendersDone, sender, this](PDBBuzzerPtr callerBuzzer) { // run the sender if(sender->run()) { // signal that the run was successful callerBuzzer->buzz(PDBAlarm::WorkAllDone, sendersDone); } else { // signal that the run was unsuccessful callerBuzzer->buzz(PDBAlarm::GenericError, sendersDone); } }); // run the work storage->getWorker()->execute(myWork, sendersBuzzer); } /// 3. Run the join pipelines // create the buzzer atomic_int joinCounter; joinCounter = 0; PDBBuzzerPtr joinBuzzer = make_shared<PDBBuzzer>([&](PDBAlarm myAlarm, atomic_int &cnt) { // did we fail? if (myAlarm == PDBAlarm::GenericError) { success = false; } // increment the count cnt++; }); // here we get a worker per pipeline and run all the shuffle join side pipelines. for (int workerID = 0; workerID < joinShufflePipelines->size(); ++workerID) { // get a worker from the server PDBWorkerPtr worker = storage->getWorker(); // make the work PDBWorkPtr myWork = std::make_shared<pdb::GenericWork>([&joinCounter, &success, workerID, this](const PDBBuzzerPtr& callerBuzzer) { try { // run the pipeline (*joinShufflePipelines)[workerID]->run(); } catch (std::exception &e) { // log the error this->logger->error(e.what()); // we failed mark that we have success = false; } // signal that the run was successful callerBuzzer->buzz(PDBAlarm::WorkAllDone, joinCounter); }); // run the work worker->execute(myWork, joinBuzzer); } // wait until all the shuffle join side pipelines have completed while (joinCounter < joinShufflePipelines->size()) { joinBuzzer->wait(); } // ok they have finished now push a null page to each of the preagg queues for(auto &queue : *pageQueues) { queue->enqueue(nullptr); } // wait while we are running the receiver while(selfRecDone == 0) { selfRefBuzzer->wait(); } // wait while we are running the senders while(sendersDone < senders->size()) { sendersBuzzer->wait(); } return true; } void pdb::PDBShuffleForJoinAlgorithm::cleanup() { // invalidate everything pageQueues = nullptr; joinShufflePipelines = nullptr; logger = nullptr; selfReceiver = nullptr; senders = nullptr; intermediate = nullptr; logicalPlan = nullptr; }
33.389205
204
0.619246
SeraphL
31390bcffbdf28b9d44ba490470b8574a59720ab
1,801
hpp
C++
Sources/inc/Chest.hpp
Tifox/Grog-Knight
377a661286cda7ee3b2b2d0099641897938c2f8f
[ "Apache-2.0" ]
null
null
null
Sources/inc/Chest.hpp
Tifox/Grog-Knight
377a661286cda7ee3b2b2d0099641897938c2f8f
[ "Apache-2.0" ]
null
null
null
Sources/inc/Chest.hpp
Tifox/Grog-Knight
377a661286cda7ee3b2b2d0099641897938c2f8f
[ "Apache-2.0" ]
null
null
null
/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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: Chest.cpp * Creation: 2015-08-27 04:44 * Vincent Rey <vrey@student.42.fr> */ #ifndef __Chest__ # define __Chest__ # include "Elements.hpp" # include "../../Tools/jsoncpp/include/json/json.h" class Chest: public Elements { public: Chest(void); ~Chest(void); void spawn(void); void displayInterface(void); void removeInterface(void); void displayChestContent(void); void ReceiveMessage(Message *m); void makeChoices(void); void updateItems(void); int isUsed(void); void reset(void); std::map<int, std::string> getItems(void); int getGold(void); void applySave(std::map<std::string, Json::Value> save); int isSpawn; private: void _makeItUsed(void); std::list<HUDActor *> _interfaceElem; std::map<int, std::string> _chestItems; std::map<int, HUDActor*> _img; std::list<HUDActor *> _choices; HUDActor * _choicePointer; HUDActor* _target; int _isUsed; int _gold; }; # endif
27.287879
63
0.696835
Tifox
3139228b1dcdfdcb70c36df002aceff8611d5b4b
3,521
hpp
C++
hydra/vulkan/rect2D.hpp
tim42/hydra
dfffd50a2863695742c0c6122a505824db8be7c3
[ "MIT" ]
2
2016-09-15T22:29:46.000Z
2017-11-30T11:16:12.000Z
hydra/vulkan/rect2D.hpp
tim42/hydra
dfffd50a2863695742c0c6122a505824db8be7c3
[ "MIT" ]
null
null
null
hydra/vulkan/rect2D.hpp
tim42/hydra
dfffd50a2863695742c0c6122a505824db8be7c3
[ "MIT" ]
null
null
null
// // file : rect2D.hpp // in : file:///home/tim/projects/hydra/hydra/vulkan/rect2D.hpp // // created by : Timothée Feuillet // date: Sat Aug 13 2016 11:12:20 GMT+0200 (CEST) // // // Copyright (c) 2016 Timothée Feuillet // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in all // copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // #ifndef __N_934928149373630529_3118821077_RECT2D_HPP__ #define __N_934928149373630529_3118821077_RECT2D_HPP__ #include <vulkan/vulkan.h> #include <glm/glm.hpp> namespace neam { namespace hydra { namespace vk { /// \brief Wraps a vulkan rect2D class rect2D { public: /// \brief Create a rect2D rect2D(const glm::ivec2 &offset, const glm::uvec2 &size) : rect { {offset.x, offset.y}, {size.x, size.y} } {} /// \brief Copy constructor rect2D(const rect2D &o) : rect(o.rect) {} /// \brief Copy operator rect2D &operator = (const rect2D &o) { rect = o.rect; return *this;} /// \brief Copy constructor rect2D(const VkRect2D &o) : rect(o) {} /// \brief Copy operator rect2D &operator = (const VkRect2D &o) { rect = o; return *this;} /// \brief Return the offset glm::ivec2 get_offset() const { return glm::ivec2(rect.offset.x, rect.offset.y); } /// \brief Set the offset void set_offset(const glm::ivec2 &offset) { rect.offset.x = offset.x; rect.offset.y = offset.y; } /// \brief Return the end offset glm::ivec2 get_end_offset() const { return glm::ivec2(rect.offset.x + rect.extent.width, rect.offset.y + rect.extent.height); } /// \brief Translate the offset by displ void translate_offset(const glm::ivec2 &displ) { set_offset(get_offset() + displ); } /// \brief Return the size glm::uvec2 get_size() const { return glm::uvec2(rect.extent.width, rect.extent.height); } /// \brief Set the size void set_size(const glm::uvec2 &size) { rect.extent.width = size.x; rect.extent.height = size.y; } /// \brief Grow / shrink the size of the rect by dt void grow_size(const glm::ivec2 &dt) { set_size(static_cast<glm::ivec2>(get_size()) + dt); } public: // advanced /// \brief Yield a VkRect2D operator const VkRect2D &() const { return rect; } private: VkRect2D rect; }; } // namespace vk } // namespace hydra } // namespace neam #endif // __N_934928149373630529_3118821077_RECT2D_HPP__
40.011364
137
0.6572
tim42
313c85c28adbc9d82c68913999e52c73170665cb
2,289
cpp
C++
cpp-htp/standard/ch03solutions/Ex03_16/ex03_16.cpp
yanshengjia/cplusplus-practice-range
6767a0ac50de8b532255511cd450dc84c66d1517
[ "Apache-2.0" ]
75
2020-03-23T11:00:31.000Z
2022-02-20T05:22:53.000Z
cpp-htp/standard/ch03solutions/Ex03_16/ex03_16.cpp
yanshengjia/cplusplus-practice-range
6767a0ac50de8b532255511cd450dc84c66d1517
[ "Apache-2.0" ]
null
null
null
cpp-htp/standard/ch03solutions/Ex03_16/ex03_16.cpp
yanshengjia/cplusplus-practice-range
6767a0ac50de8b532255511cd450dc84c66d1517
[ "Apache-2.0" ]
39
2020-04-03T23:47:24.000Z
2022-01-19T05:06:39.000Z
// Exercise 3.16 Solution: ex03_16.cpp // Driver program for HeartRates class #include <iostream> #include <string> #include "HeartRates.h" using namespace std; int main() { string first, last; // first name, last name int month, day, year; // birth month, day, year // get user input cout << "Please enter first and last name:" << endl; cin >> first >> last; cout << "Please enter month, day, and year of birth:" << endl; cin >> month >> day >> year; // create a HeartRates object HeartRates heartRates( first, last, month, day, year ); // display user information cout << "First Name: " << heartRates.getFirstName() << "\n"; cout << "Last Name: " << heartRates.getLastName() << "\n"; cout << "Date of Birth: " << heartRates.getBirthMonth() << "/" << heartRates.getBirthDay() << "/" << heartRates.getBirthYear() << "\n"; cout << "Age: " << heartRates.getAge() << "\n"; cout << "Maximum Heart Rate: " << heartRates.getMaximumHeartRate() << "\n"; cout << "Target Heart Rate: " << heartRates.getMinimumTargetHeartRate() << "-" << heartRates.getMaximumTargetHeartRate() << "\n"; } // end main /************************************************************************** * (C) Copyright 1992-2010 by Deitel & Associates, Inc. and * * Pearson Education, Inc. All Rights Reserved. * * * * DISCLAIMER: The authors and publisher of this book have used their * * best efforts in preparing the book. These efforts include the * * development, research, and testing of the theories and programs * * to determine their effectiveness. The authors and publisher make * * no warranty of any kind, expressed or implied, with regard to these * * programs or to the documentation contained in these books. The authors * * and publisher shall not be liable in any event for incidental or * * consequential damages in connection with, or arising out of, the * * furnishing, performance, or use of these programs. * **************************************************************************/
44.882353
77
0.554827
yanshengjia
3140b75af71b7541ee489e9658b9bfe426340af6
6,905
cpp
C++
test/system2/station/wxglade_out.cpp
khantkyawkhaung/robot-monitor
3614dc0cf804138c81f6800fb5ec443bff709dbd
[ "MIT" ]
1
2021-04-06T04:11:58.000Z
2021-04-06T04:11:58.000Z
test/system2/station/wxglade_out.cpp
khantkyawkhaung/robot-monitor
3614dc0cf804138c81f6800fb5ec443bff709dbd
[ "MIT" ]
null
null
null
test/system2/station/wxglade_out.cpp
khantkyawkhaung/robot-monitor
3614dc0cf804138c81f6800fb5ec443bff709dbd
[ "MIT" ]
1
2019-12-26T09:01:16.000Z
2019-12-26T09:01:16.000Z
// -*- C++ -*- // // generated by wxGlade 0.9.4 on Tue Jun 15 15:13:10 2021 // // Example for compiling a single file project under Linux using g++: // g++ MyApp.cpp $(wx-config --libs) $(wx-config --cxxflags) -o MyApp // // Example for compiling a multi file project under Linux using g++: // g++ main.cpp $(wx-config --libs) $(wx-config --cxxflags) -o MyApp Dialog1.cpp Frame1.cpp // #include "wxglade_out.h" // begin wxGlade: ::extracode // end wxGlade MyFrame::MyFrame(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style): wxFrame(parent, id, title, pos, size, wxDEFAULT_FRAME_STYLE) { // begin wxGlade: MyFrame::MyFrame SetSize(wxSize(380, 430)); construct_user(); frame_menubar = new wxMenuBar(); wxMenu *wxglade_tmp_menu; wxMenuItem *wxglade_tmp_item; wxglade_tmp_menu = new wxMenu(); wxglade_tmp_item = wxglade_tmp_menu->Append(wxID_ANY, wxT("Exit"), wxEmptyString); Bind(wxEVT_MENU, &MyFrame::onMenuExit, this, wxglade_tmp_item->GetId()); frame_menubar->Append(wxglade_tmp_menu, wxT("File")); wxglade_tmp_menu = new wxMenu(); /*wxMenu* menuPort = new wxMenu(); wxglade_tmp_item = menuPort->Append(wxID_ANY, wxT("/dev/ttyACM0"), wxEmptyString, wxITEM_RADIO); Bind(wxEVT_MENU, &MyFrame::onMenuPort, this, wxglade_tmp_item->GetId());*/ wxglade_tmp_menu->Append(ID_MENU_PORT, wxT("Port"), menuPort, wxEmptyString); wxMenu* menuBaudrate = new wxMenu(); menuBaudrate->Append(ID_B9600, wxT("9600"), wxEmptyString, wxITEM_RADIO); Bind(wxEVT_MENU, &MyFrame::onMenuBaudrate, this, ID_B9600); menuBaudrate->Append(ID_B19200, wxT("19200"), wxEmptyString, wxITEM_RADIO); Bind(wxEVT_MENU, &MyFrame::onMenuBaudrate, this, ID_B19200); menuBaudrate->Append(ID_B38400, wxT("38400"), wxEmptyString, wxITEM_RADIO); Bind(wxEVT_MENU, &MyFrame::onMenuBaudrate, this, ID_B38400); menuBaudrate->Append(ID_B57600, wxT("57600"), wxEmptyString, wxITEM_RADIO); Bind(wxEVT_MENU, &MyFrame::onMenuBaudrate, this, ID_B57600); menuBaudrate->Append(ID_B74880, wxT("74880"), wxEmptyString, wxITEM_RADIO); Bind(wxEVT_MENU, &MyFrame::onMenuBaudrate, this, ID_B74880); menuBaudrate->Append(ID_B115200, wxT("115200"), wxEmptyString, wxITEM_RADIO); Bind(wxEVT_MENU, &MyFrame::onMenuBaudrate, this, ID_B115200); wxglade_tmp_menu->Append(ID_MENU_BAUDRATE, wxT("Baudrate"), menuBaudrate, wxEmptyString); wxglade_tmp_menu->Append(ID_MENU_CONNECT, wxT("Connect"), wxEmptyString); Bind(wxEVT_MENU, &MyFrame::onMenuConnect, this, ID_MENU_CONNECT); wxglade_tmp_menu->Append(ID_MENU_DISCONNECT, wxT("Disconnect"), wxEmptyString); Bind(wxEVT_MENU, &MyFrame::onMenuDisconnect, this, ID_MENU_DISCONNECT); frame_menubar->Append(wxglade_tmp_menu, wxT("Tools")); wxglade_tmp_menu = new wxMenu(); wxglade_tmp_item = wxglade_tmp_menu->Append(wxID_ANY, wxT("About"), wxEmptyString); Bind(wxEVT_MENU, &MyFrame::onMenuAbout, this, wxglade_tmp_item->GetId()); frame_menubar->Append(wxglade_tmp_menu, wxT("Help")); SetMenuBar(frame_menubar); /*lblAccelX = new wxStaticText(this, wxID_ANY, wxT("Accel-X")); lblAccelY = new wxStaticText(this, wxID_ANY, wxT("Accel-Y")); lblAccelZ = new wxStaticText(this, wxID_ANY, wxT("Accel-Z")); lblGyroX = new wxStaticText(this, wxID_ANY, wxT("Gyro-X")); lblGyroY = new wxStaticText(this, wxID_ANY, wxT("Gyro-Y")); lblGyroZ = new wxStaticText(this, wxID_ANY, wxT("Gyro-Z")); lblMagX = new wxStaticText(this, wxID_ANY, wxT("Mag-X")); lblMagY = new wxStaticText(this, wxID_ANY, wxT("Mag-Y")); lblMagZ = new wxStaticText(this, wxID_ANY, wxT("Mag-Z")); btnCaliAccel = new wxButton(this, wxID_ANY, wxT("Calibrate Accel")); btnCaliGyro = new wxButton(this, wxID_ANY, wxT("Calibrate Gyro")); btnCaliMag = new wxButton(this, wxID_ANY, wxT("Calirate Mag")); txtEcho = new wxTextCtrl(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE); lblPortStatus = new wxStaticText(this, wxID_ANY, wxT("Not connected"), wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT); lblPortAddress = new wxStaticText(this, wxID_ANY, wxT("n/a"));*/ wxglade_tmp_menu = menuPort->GetParent(); wxglade_tmp_menu->Enable(ID_MENU_PORT, false); wxglade_tmp_menu->Enable(ID_MENU_CONNECT, false); wxglade_tmp_menu->Enable(ID_MENU_DISCONNECT, false); set_properties(); do_layout(); // end wxGlade } void MyFrame::set_properties() { // begin wxGlade: MyFrame::set_properties SetTitle(wxT("frame")); wxIcon _icon; _icon.CopyFromBitmap(rmGetIcon()); SetIcon(_icon); // end wxGlade } void MyFrame::do_layout() { // begin wxGlade: MyFrame::do_layout wxBoxSizer* sizer_1 = new wxBoxSizer(wxVERTICAL); wxBoxSizer* sizer_8 = new wxBoxSizer(wxHORIZONTAL); wxStaticBoxSizer* sizer_7 = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, wxT("Messages")), wxHORIZONTAL); wxBoxSizer* sizer_2 = new wxBoxSizer(wxHORIZONTAL); wxBoxSizer* sizer_4 = new wxBoxSizer(wxVERTICAL); wxBoxSizer* sizer_10 = new wxBoxSizer(wxVERTICAL); wxBoxSizer* sizer_9 = new wxBoxSizer(wxVERTICAL); wxBoxSizer* sizer_3 = new wxBoxSizer(wxVERTICAL); wxBoxSizer* sizer_6 = new wxBoxSizer(wxVERTICAL); wxBoxSizer* sizer_5 = new wxBoxSizer(wxVERTICAL); sizer_5->Add(lblAccelX, 0, 0, 0); sizer_5->Add(lblAccelY, 0, 0, 0); sizer_5->Add(lblAccelZ, 0, wxALL, 0); sizer_3->Add(sizer_5, 2, wxEXPAND, 0); sizer_6->Add(lblGyroX, 0, 0, 0); sizer_6->Add(lblGyroY, 0, 0, 0); sizer_6->Add(lblGyroZ, 0, 0, 0); sizer_3->Add(sizer_6, 3, wxEXPAND, 0); sizer_2->Add(sizer_3, 1, wxALL|wxEXPAND, 5); sizer_9->Add(lblMagX, 0, 0, 0); sizer_9->Add(lblMagY, 0, 0, 0); sizer_9->Add(lblMagZ, 0, 0, 0); sizer_4->Add(sizer_9, 2, wxEXPAND, 0); sizer_10->Add(btnCaliAccel, 0, wxALL, 1); sizer_10->Add(btnCaliGyro, 0, wxALL, 1); sizer_10->Add(btnCaliMag, 0, wxALL, 1); sizer_4->Add(sizer_10, 3, wxEXPAND, 0); sizer_2->Add(sizer_4, 1, wxALL|wxEXPAND, 5); sizer_1->Add(sizer_2, 3, wxALL|wxEXPAND, 0); sizer_7->Add(txtEcho, 1, wxEXPAND, 0); sizer_1->Add(sizer_7, 2, wxEXPAND|wxTOP, 5); sizer_8->Add(lblPortStatus, 0, 0, 0); sizer_8->Add(20, 16, 1, 0, 0); sizer_8->Add(lblPortAddress, 0, 0, 0); sizer_1->Add(sizer_8, 0, wxEXPAND|wxTOP, 5); SetSizer(sizer_1); Layout(); // end wxGlade } BEGIN_EVENT_TABLE(MyFrame, wxFrame) // begin wxGlade: MyFrame::event_table // end wxGlade END_EVENT_TABLE(); // wxGlade: add MyFrame event handlers class MyApp: public wxApp { public: bool OnInit(); }; IMPLEMENT_APP(MyApp) bool MyApp::OnInit() { wxInitAllImageHandlers(); MyFrame* frame = new MyFrame(NULL, wxID_ANY, wxEmptyString); SetTopWindow(frame); frame->Show(); return true; }
41.347305
125
0.69819
khantkyawkhaung
31422e8e1306029da7d025f3fc986c23310322a8
628
cpp
C++
pat/basic/1008.cpp
phiysng/leetcode
280e8b1a0b45233deb2262ceec85b8174e9b2ced
[ "BSD-3-Clause" ]
3
2019-04-12T19:12:55.000Z
2020-05-29T07:55:16.000Z
pat/basic/1008.cpp
phiysng/leetcode
280e8b1a0b45233deb2262ceec85b8174e9b2ced
[ "BSD-3-Clause" ]
null
null
null
pat/basic/1008.cpp
phiysng/leetcode
280e8b1a0b45233deb2262ceec85b8174e9b2ced
[ "BSD-3-Clause" ]
null
null
null
#include <algorithm> #include <climits> #include <cmath> #include <cstdio> #include <functional> #include <iostream> #include <queue> #include <stack> #include <unordered_map> #include <unordered_set> #include <vector> using namespace std; int main() { int n, shift; cin >> n >> shift; vector<int> a(n); for (int i = 0; i < n; ++i) scanf("%d", &a[i]); vector<int> cp(a.begin(), a.end()); shift %= n; for (int i = 0; i < n; ++i) { a[(i + shift) % n] = cp[i]; } for (int i = 0; i < n - 1; ++i) { printf("%d ", a[i]); } printf("%d\n", a[n - 1]); return 0; }
19.625
39
0.515924
phiysng
3143216dc67187d043e04da952cf88e2c867b403
7,252
cc
C++
test/objectreference.cc
blagoev/node-addon-api
89e62a9154b6057ed086a227db25caf26ac8c92a
[ "MIT" ]
13
2019-06-18T14:30:56.000Z
2021-04-25T06:06:52.000Z
test/objectreference.cc
shudingbo/node-addon-api
4d816183daadd1fec9411f9a3c566b098059e02b
[ "MIT" ]
12
2020-09-04T20:01:51.000Z
2020-12-07T20:43:29.000Z
test/objectreference.cc
shudingbo/node-addon-api
4d816183daadd1fec9411f9a3c566b098059e02b
[ "MIT" ]
1
2020-05-26T15:14:43.000Z
2020-05-26T15:14:43.000Z
/* ObjectReference can be used to create references to Values that are not Objects by creating a blank Object and setting Values to it. Subclasses of Objects can only be set using an ObjectReference by first casting it as an Object. */ #include "napi.h" using namespace Napi; ObjectReference weak; ObjectReference persistent; ObjectReference reference; ObjectReference casted_weak; ObjectReference casted_persistent; ObjectReference casted_reference; // info[0] is the key, which can be either a string or a number. // info[1] is the value. // info[2] is a flag that differentiates whether the key is a // C string or a JavaScript string. void SetObjects(const CallbackInfo& info) { Env env = info.Env(); HandleScope scope(env); weak = Weak(Object::New(env)); weak.SuppressDestruct(); persistent = Persistent(Object::New(env)); persistent.SuppressDestruct(); reference = Reference<Object>::New(Object::New(env), 2); reference.SuppressDestruct(); if (info[0].IsString()) { if (info[2].As<String>() == String::New(env, "javascript")) { weak.Set(info[0].As<String>(), info[1]); persistent.Set(info[0].As<String>(), info[1]); reference.Set(info[0].As<String>(), info[1]); } else { weak.Set(info[0].As<String>().Utf8Value(), info[1]); persistent.Set(info[0].As<String>().Utf8Value(), info[1]); reference.Set(info[0].As<String>().Utf8Value(), info[1]); } } else if (info[0].IsNumber()) { weak.Set(info[0].As<Number>(), info[1]); persistent.Set(info[0].As<Number>(), info[1]); reference.Set(info[0].As<Number>(), info[1]); } } void SetCastedObjects(const CallbackInfo& info) { Env env = info.Env(); HandleScope scope(env); Array ex = Array::New(env); ex.Set((uint32_t)0, String::New(env, "hello")); ex.Set(1, String::New(env, "world")); ex.Set(2, String::New(env, "!")); casted_weak = Weak(ex.As<Object>()); casted_weak.SuppressDestruct(); casted_persistent = Persistent(ex.As<Object>()); casted_persistent.SuppressDestruct(); casted_reference = Reference<Object>::New(ex.As<Object>(), 2); casted_reference.SuppressDestruct(); } // info[0] is a flag to determine if the weak, persistent, or // multiple reference ObjectReference is being requested. Value GetFromValue(const CallbackInfo& info) { Env env = info.Env(); if (info[0].As<String>() == String::New(env, "weak")) { if (weak.IsEmpty()) { return String::New(env, "No Referenced Value"); } else { return weak.Value(); } } else if (info[0].As<String>() == String::New(env, "persistent")) { return persistent.Value(); } else { return reference.Value(); } } // info[0] is a flag to determine if the weak, persistent, or // multiple reference ObjectReference is being requested. // info[1] is the key, and it be either a String or a Number. Value GetFromGetter(const CallbackInfo& info) { Env env = info.Env(); if (info[0].As<String>() == String::New(env, "weak")) { if (weak.IsEmpty()) { return String::New(env, "No Referenced Value"); } else { if (info[1].IsString()) { return weak.Get(info[1].As<String>().Utf8Value()); } else if (info[1].IsNumber()) { return weak.Get(info[1].As<Number>().Uint32Value()); } } } else if (info[0].As<String>() == String::New(env, "persistent")) { if (info[1].IsString()) { return persistent.Get(info[1].As<String>().Utf8Value()); } else if (info[1].IsNumber()) { return persistent.Get(info[1].As<Number>().Uint32Value()); } } else { if (info[0].IsString()) { return reference.Get(info[0].As<String>().Utf8Value()); } else if (info[0].IsNumber()) { return reference.Get(info[0].As<Number>().Uint32Value()); } } return String::New(env, "Error: Reached end of getter"); } // info[0] is a flag to determine if the weak, persistent, or // multiple reference ObjectReference is being requested. Value GetCastedFromValue(const CallbackInfo& info) { Env env = info.Env(); if (info[0].As<String>() == String::New(env, "weak")) { if (casted_weak.IsEmpty()) { return String::New(env, "No Referenced Value"); } else { return casted_weak.Value(); } } else if (info[0].As<String>() == String::New(env, "persistent")) { return casted_persistent.Value(); } else { return casted_reference.Value(); } } // info[0] is a flag to determine if the weak, persistent, or // multiple reference ObjectReference is being requested. // info[1] is the key and it must be a Number. Value GetCastedFromGetter(const CallbackInfo& info) { Env env = info.Env(); if (info[0].As<String>() == String::New(env, "weak")) { if (casted_weak.IsEmpty()) { return String::New(env, "No Referenced Value"); } else { return casted_weak.Get(info[1].As<Number>()); } } else if (info[0].As<String>() == String::New(env, "persistent")) { return casted_persistent.Get(info[1].As<Number>()); } else { return casted_reference.Get(info[1].As<Number>()); } } // info[0] is a flag to determine if the weak, persistent, or // multiple reference ObjectReference is being requested. Number UnrefObjects(const CallbackInfo& info) { Env env = info.Env(); uint32_t num; if (info[0].As<String>() == String::New(env, "weak")) { num = weak.Unref(); } else if (info[0].As<String>() == String::New(env, "persistent")) { num = persistent.Unref(); } else if (info[0].As<String>() == String::New(env, "references")) { num = reference.Unref(); } else if (info[0].As<String>() == String::New(env, "casted weak")) { num = casted_weak.Unref(); } else if (info[0].As<String>() == String::New(env, "casted persistent")) { num = casted_persistent.Unref(); } else { num = casted_reference.Unref(); } return Number::New(env, num); } // info[0] is a flag to determine if the weak, persistent, or // multiple reference ObjectReference is being requested. Number RefObjects(const CallbackInfo& info) { Env env = info.Env(); uint32_t num; if (info[0].As<String>() == String::New(env, "weak")) { num = weak.Ref(); } else if (info[0].As<String>() == String::New(env, "persistent")) { num = persistent.Ref(); } else if (info[0].As<String>() == String::New(env, "references")) { num = reference.Ref(); } else if (info[0].As<String>() == String::New(env, "casted weak")) { num = casted_weak.Ref(); } else if (info[0].As<String>() == String::New(env, "casted persistent")) { num = casted_persistent.Ref(); } else { num = casted_reference.Ref(); } return Number::New(env, num); } Object InitObjectReference(Env env) { Object exports = Object::New(env); exports["setCastedObjects"] = Function::New(env, SetCastedObjects); exports["setObjects"] = Function::New(env, SetObjects); exports["getCastedFromValue"] = Function::New(env, GetCastedFromValue); exports["getFromGetter"] = Function::New(env, GetFromGetter); exports["getCastedFromGetter"] = Function::New(env, GetCastedFromGetter); exports["getFromValue"] = Function::New(env, GetFromValue); exports["unrefObjects"] = Function::New(env, UnrefObjects); exports["refObjects"] = Function::New(env, RefObjects); return exports; }
33.114155
77
0.648511
blagoev
3154988c80a50a8739680023a5d31eee4336c4c5
3,061
hxx
C++
main/drawinglayer/inc/drawinglayer/processor2d/processor2dtools.hxx
Grosskopf/openoffice
93df6e8a695d5e3eac16f3ad5e9ade1b963ab8d7
[ "Apache-2.0" ]
679
2015-01-06T06:34:58.000Z
2022-03-30T01:06:03.000Z
main/drawinglayer/inc/drawinglayer/processor2d/processor2dtools.hxx
Grosskopf/openoffice
93df6e8a695d5e3eac16f3ad5e9ade1b963ab8d7
[ "Apache-2.0" ]
102
2017-11-07T08:51:31.000Z
2022-03-17T12:13:49.000Z
main/drawinglayer/inc/drawinglayer/processor2d/processor2dtools.hxx
Grosskopf/openoffice
93df6e8a695d5e3eac16f3ad5e9ade1b963ab8d7
[ "Apache-2.0" ]
331
2015-01-06T11:40:55.000Z
2022-03-14T04:07:51.000Z
/************************************************************** * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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 INCLUDED_DRAWINGLAYER_PROCESSOR2D_PROCESSOR2DTOOLS_HXX #define INCLUDED_DRAWINGLAYER_PROCESSOR2D_PROCESSOR2DTOOLS_HXX #include <drawinglayer/drawinglayerdllapi.h> #include <drawinglayer/processor2d/baseprocessor2d.hxx> #include <drawinglayer/geometry/viewinformation2d.hxx> ////////////////////////////////////////////////////////////////////////////// // predefines class OutputDevice; ////////////////////////////////////////////////////////////////////////////// namespace drawinglayer { namespace processor2d { /** create the best available pixel based BaseProcessor2D (which may be system-dependent) @param rTargetOutDev The target OutputDevice @param rViewInformation2D The ViewInformation to use @return the created BaseProcessor2D (ownership change) or null if something went wrong */ DRAWINGLAYER_DLLPUBLIC BaseProcessor2D* createPixelProcessor2DFromOutputDevice( OutputDevice& rTargetOutDev, const drawinglayer::geometry::ViewInformation2D& rViewInformation2D); /** create a BaseProcessor2D dependent on some states of the given OutputDevice. If metafile is recorded, the needed VclMetafileProcessor2D will be created. If a pixel renderer is requested, the best one is incarnated @param rTargetOutDev The target OutputDevice @param rViewInformation2D The ViewInformation to use @return the created BaseProcessor2D (ownership change) or null if something went wrong */ DRAWINGLAYER_DLLPUBLIC BaseProcessor2D* createProcessor2DFromOutputDevice( OutputDevice& rTargetOutDev, const drawinglayer::geometry::ViewInformation2D& rViewInformation2D); } // end of namespace processor2d } // end of namespace drawinglayer ////////////////////////////////////////////////////////////////////////////// #endif //INCLUDED_DRAWINGLAYER_PROCESSOR2D_PROCESSOR2DTOOLS_HXX // eof
36.440476
87
0.627246
Grosskopf
3155bb2ed2b8ac5eb3a124bc203f890c61631e2f
3,176
cpp
C++
src/prod/src/ServiceModel/management/FaultAnalysisService/Chaos/ChaosTargetFilter.cpp
AnthonyM/service-fabric
c396ea918714ea52eab9c94fd62e018cc2e09a68
[ "MIT" ]
1
2018-03-15T02:09:21.000Z
2018-03-15T02:09:21.000Z
src/prod/src/ServiceModel/management/FaultAnalysisService/Chaos/ChaosTargetFilter.cpp
AnthonyM/service-fabric
c396ea918714ea52eab9c94fd62e018cc2e09a68
[ "MIT" ]
null
null
null
src/prod/src/ServiceModel/management/FaultAnalysisService/Chaos/ChaosTargetFilter.cpp
AnthonyM/service-fabric
c396ea918714ea52eab9c94fd62e018cc2e09a68
[ "MIT" ]
null
null
null
// ------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License (MIT). See License.txt in the repo root for license information. // ------------------------------------------------------------ #include "stdafx.h" using namespace Common; using namespace Naming; using namespace ServiceModel; using namespace std; using namespace Management::FaultAnalysisService; StringLiteral const TraceComponent("ChaosTargetFilter"); ChaosTargetFilter::ChaosTargetFilter() : nodeTypeInclusionList_() , applicationInclusionList_() { } ChaosTargetFilter::ChaosTargetFilter(ChaosTargetFilter && other) : nodeTypeInclusionList_(move(other.nodeTypeInclusionList_)) , applicationInclusionList_(move(other.applicationInclusionList_)) { } ErrorCode ChaosTargetFilter::FromPublicApi( FABRIC_CHAOS_TARGET_FILTER const & publicFilter) { if(publicFilter.NodeTypeInclusionList != nullptr) { // NodeTypeInclusionList StringList::FromPublicApi(*publicFilter.NodeTypeInclusionList, nodeTypeInclusionList_); } if(publicFilter.ApplicationInclusionList != nullptr) { // ApplicationInclusionList StringList::FromPublicApi(*publicFilter.ApplicationInclusionList, applicationInclusionList_); } return ErrorCode::Success(); } ErrorCode ChaosTargetFilter::ToPublicApi( __in Common::ScopedHeap & heap, __out FABRIC_CHAOS_TARGET_FILTER & result) const { auto publicNodeTypeInclusionList = heap.AddItem<FABRIC_STRING_LIST>(); StringList::ToPublicAPI(heap, nodeTypeInclusionList_, publicNodeTypeInclusionList); result.NodeTypeInclusionList = publicNodeTypeInclusionList.GetRawPointer(); auto publicApplicationInclusionList = heap.AddItem<FABRIC_STRING_LIST>(); StringList::ToPublicAPI(heap, applicationInclusionList_, publicApplicationInclusionList); result.ApplicationInclusionList = publicApplicationInclusionList.GetRawPointer(); return ErrorCode::Success(); } ErrorCode ChaosTargetFilter::Validate() const { if (nodeTypeInclusionList_.empty() && applicationInclusionList_.empty()) { return ErrorCode(ErrorCodeValue::InvalidArgument, wformatString("{0}", FASResource::GetResources().ChaosTargetFilterSpecificationNotFound)); } int maximumNumberOfNodeTypesInChaosTargetFilter = ServiceModelConfig::GetConfig().MaxNumberOfNodeTypesInChaosTargetFilter; if (!nodeTypeInclusionList_.empty() && nodeTypeInclusionList_.size() > maximumNumberOfNodeTypesInChaosTargetFilter) { return ErrorCode(ErrorCodeValue::EntryTooLarge, wformatString("{0}", FASResource::GetResources().ChaosNodeTypeInclusionListTooLong)); } int maximumNumberOfApplicationsInChaosTargetFilter = ServiceModelConfig::GetConfig().MaxNumberOfApplicationsInChaosTargetFilter; if (!applicationInclusionList_.empty() && applicationInclusionList_.size() > maximumNumberOfApplicationsInChaosTargetFilter) { return ErrorCode(ErrorCodeValue::EntryTooLarge, wformatString("{0}", FASResource::GetResources().ChaosApplicationInclusionListTooLong)); } return ErrorCode::Success(); }
37.364706
148
0.756612
AnthonyM