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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
20fa088bd169f276c6708742b9af76c4daab95f7 | 425 | cc | C++ | leetcode/101-200/190-reverse-bits/190.cc | punkieL/proCon | 7e994d67e5efdf7ac0b1bee5e0b19b317f07e8af | [
"MIT"
] | 1 | 2015-10-06T16:27:42.000Z | 2015-10-06T16:27:42.000Z | leetcode/101-200/190-reverse-bits/190.cc | punkieL/proCon | 7e994d67e5efdf7ac0b1bee5e0b19b317f07e8af | [
"MIT"
] | 1 | 2016-03-02T16:18:11.000Z | 2016-03-02T16:18:11.000Z | leetcode/101-200/190-reverse-bits/190.cc | punkieL/proCon | 7e994d67e5efdf7ac0b1bee5e0b19b317f07e8af | [
"MIT"
] | null | null | null | #include "iostream"
#include "bitset"
using namespace std;
class Solution {
public:
uint32_t reverseBits(uint32_t n) {
bitset<32> t(n);
for(int i = 0, j = 31; i < j; i++, j--){
bool flg = t[i];
t[i] = t[j];
t[j] = flg;
}
return (uint32_t)t.to_ulong();
}
};
int main(int argc, char const *argv[]) {
/* code */
Solution a ;
cout << a.reverseBits(43261596) << endl;
return 0;
}
| 16.346154 | 44 | 0.548235 | punkieL |
1f0673980661dc03149b8068f6a0f77ed2da78ec | 2,234 | cpp | C++ | test/doc/math/inv_e.cpp | clayne/eve | dc268b5db474376e1c53f5a474f5bb42b7c4cb59 | [
"MIT"
] | null | null | null | test/doc/math/inv_e.cpp | clayne/eve | dc268b5db474376e1c53f5a474f5bb42b7c4cb59 | [
"MIT"
] | null | null | null | test/doc/math/inv_e.cpp | clayne/eve | dc268b5db474376e1c53f5a474f5bb42b7c4cb59 | [
"MIT"
] | null | null | null | #include <eve/module/math.hpp>
#include <eve/wide.hpp>
#include <iostream>
#include <iomanip>
using wide_ft = eve::wide<float>;
using wide_dt = eve::wide<double>;
int main()
{
wide_ft wxf;
wide_dt wxd;
std::cout << "---- simd" << std::setprecision(9) << std::endl
<< "-> inv_e(as<wide_ft>()) = " << eve::inv_e(eve::as<wide_ft>()) << std::endl
<< "-> inv_e(as(wxf)) = " << eve::inv_e(eve::as(wxf)) << std::endl
<< "-> upward(inv_e)(as<wide_ft>()) = " << eve::upward(eve::inv_e)(eve::as<wide_ft>()) << std::endl
<< "-> upward(inv_e)(as(wxf)) = " << eve::upward(eve::inv_e)(eve::as(wxf)) << std::endl
<< "-> downward(inv_e)(as<wide_ft>()) = " << eve::downward(eve::inv_e)(eve::as<wide_ft>()) << std::endl
<< "-> downward(inv_e)(as(wxf)) = " << eve::downward(eve::inv_e)(eve::as(wxf)) << std::endl
<< std::setprecision(17)
<< "-> inv_e(as<wide_dt>()) = " << eve::inv_e(eve::as<wide_dt>()) << std::endl
<< "-> inv_e(as(wxd)) = " << eve::inv_e(eve::as(wxd)) << std::endl
<< "-> upward(inv_e)(as<wide_dt>()) = " << eve::upward(eve::inv_e)(eve::as<wide_dt>()) << std::endl
<< "-> upward(inv_e)(as(wxd)) = " << eve::upward(eve::inv_e)(eve::as(wxd)) << std::endl
<< "-> downward(inv_e)(as<wide_dt>()) = " << eve::downward(eve::inv_e)(eve::as<wide_dt>()) << std::endl
<< "-> downward(inv_e)(as(wxd)) = " << eve::downward(eve::inv_e)(eve::as(wxd)) << std::endl;
float xf;
double xd;
std::cout << "---- scalar" << std::endl
<< "-> inv_e(as<float>()) = " << eve::inv_e(eve::as(float())) << std::endl
<< "-> inv_e(as<xf)) = " << eve::inv_e(eve::as(xf)) << std::endl
<< "-> inv_e(as<double>()) = " << eve::inv_e(eve::as(double()))<< std::endl
<< "-> inv_e(as<xd)) = " << eve::inv_e(eve::as(xd)) << std::endl;
return 0;
}
| 55.85 | 121 | 0.427932 | clayne |
1f06a020d40f05b994aeb2e1f98587c8d3a3b5dc | 1,692 | hpp | C++ | janela_principal.hpp | marcio-mutti/msscellparse | 2b9ff0a5a59a5ba090eaf6c7e6614b6bd278b5f5 | [
"Apache-2.0"
] | null | null | null | janela_principal.hpp | marcio-mutti/msscellparse | 2b9ff0a5a59a5ba090eaf6c7e6614b6bd278b5f5 | [
"Apache-2.0"
] | null | null | null | janela_principal.hpp | marcio-mutti/msscellparse | 2b9ff0a5a59a5ba090eaf6c7e6614b6bd278b5f5 | [
"Apache-2.0"
] | null | null | null | #ifndef JANELA_PRINCIPAL
#define JANELA_PRINCIPAL
#include <memory>
#include <gtkmm-3.0/gtkmm.h>
#include <boost/thread.hpp>
# include "loader_thread.hpp"
class janela_principal : public Gtk::ApplicationWindow {
public:
janela_principal();
~janela_principal();
protected:
Glib::RefPtr<Gtk::Builder> janelator;
//Widgets
Gtk::Box * box_principal;
Gtk::Label * lbl_n_23g, * lbl_n_4g, *lbl_n_central, * lbl_n_bsc, * lbl_n_rnc,
* lbl_n_mme, *lbl_n_central_up, *lbl_n_bsc_up, *lbl_n_rnc_up, *lbl_n_mme_up,
* lbl_n_ss7arq, * lbl_n_ss7;
Gtk::Button * btn_load_23g, * btn_load_4g, * btn_carregar, * btn_subir_banco;
Gtk::Button * btn_db_clean, * btn_load_ss7;
Gtk::Statusbar * sts_bar;
Gtk::Spinner * sts_spin;
// Signals
sigc::signal<void, const std::string&, const logparser::logtype&> signal_new_file;
// Slots
void slot_btn_load_23g();
void slot_btn_load_4g();
void slot_btn_load_ss7();
void slot_btn_carregar();
void slot_btn_subir_banco();
void slot_ready_for_new_work();
void slot_readied_switches(const std::string&, const std::string&, const std::string&);
void slot_readied_mmes(const std::string&);
void slot_readied_ss7_nodes(const std::string&);
void slot_db_working_node(std::string);
void slot_db_cleaner();
void slot_change_n_file(const std::string&, const logparser::logtype&);
std::string slot_open_connect_string_file();
// Variables
logparser::parser runner;
//std::shared_ptr<boost::thread> work_thread;
boost::thread work_thread;
//Methods
void log_loader(const std::string&,const logparser::logtype&);
};
#endif
| 31.924528 | 91 | 0.699764 | marcio-mutti |
1f06c9929d44e6ba4a5a4beac65f793444f3c500 | 1,509 | hpp | C++ | src/Platform.Cocoa/GameHostMetal.hpp | ValtoForks/pomdog | 73798ae5f4a4c3b9b1e1e96239187c4b842c93b2 | [
"MIT"
] | null | null | null | src/Platform.Cocoa/GameHostMetal.hpp | ValtoForks/pomdog | 73798ae5f4a4c3b9b1e1e96239187c4b842c93b2 | [
"MIT"
] | null | null | null | src/Platform.Cocoa/GameHostMetal.hpp | ValtoForks/pomdog | 73798ae5f4a4c3b9b1e1e96239187c4b842c93b2 | [
"MIT"
] | null | null | null | // Copyright (c) 2013-2018 mogemimi. Distributed under the MIT license.
#pragma once
#include "Pomdog/Application/GameHost.hpp"
#include "Pomdog/Signals/EventQueue.hpp"
#include <memory>
#import <MetalKit/MTKView.h>
namespace Pomdog {
class Game;
struct PresentationParameters;
namespace Detail {
namespace Cocoa {
class GameWindowCocoa;
class GameHostMetal final : public GameHost {
public:
GameHostMetal(
MTKView* metalView,
const std::shared_ptr<GameWindowCocoa>& window,
const std::shared_ptr<EventQueue>& eventQueue,
const PresentationParameters& presentationParameters);
~GameHostMetal();
void InitializeGame(
const std::weak_ptr<Game>& game,
const std::function<void()>& onCompleted);
void GameLoop();
bool IsMetalSupported() const;
void Exit() override;
std::shared_ptr<GameWindow> GetWindow() override;
std::shared_ptr<GameClock> GetClock() override;
std::shared_ptr<GraphicsDevice> GetGraphicsDevice() override;
std::shared_ptr<GraphicsCommandQueue> GetGraphicsCommandQueue() override;
std::shared_ptr<AudioEngine> GetAudioEngine() override;
std::shared_ptr<AssetManager> GetAssetManager() override;
std::shared_ptr<Keyboard> GetKeyboard() override;
std::shared_ptr<Mouse> GetMouse() override;
std::shared_ptr<Gamepad> GetGamepad() override;
private:
class Impl;
std::unique_ptr<Impl> impl;
};
} // namespace Cocoa
} // namespace Detail
} // namespace Pomdog
| 22.522388 | 77 | 0.720345 | ValtoForks |
1f07805d8b09bf1ed4c9c66c11902695dcbf7eb8 | 5,637 | cpp | C++ | embedded_deformables/Embedded_Deformables_Driver.cpp | yanshil/Nova_Examples | 0807c5a3bc24e4f3efc399f424e2e4fb0da2d4fe | [
"Apache-2.0"
] | 1 | 2022-02-01T18:04:45.000Z | 2022-02-01T18:04:45.000Z | embedded_deformables/Embedded_Deformables_Driver.cpp | yanshil/Nova_Examples | 0807c5a3bc24e4f3efc399f424e2e4fb0da2d4fe | [
"Apache-2.0"
] | null | null | null | embedded_deformables/Embedded_Deformables_Driver.cpp | yanshil/Nova_Examples | 0807c5a3bc24e4f3efc399f424e2e4fb0da2d4fe | [
"Apache-2.0"
] | 1 | 2018-12-30T00:49:36.000Z | 2018-12-30T00:49:36.000Z | //!#####################################################################
//! \file Embedded_Deformables_Driver.cpp
//!#####################################################################
#include <nova/Tools/Krylov_Solvers/Conjugate_Gradient.h>
#include "CG_System.h"
#include "Embedded_Deformables_Driver.h"
using namespace Nova;
//######################################################################
// Constructor
//######################################################################
template<class T,int d> Embedded_Deformables_Driver<T,d>::
Embedded_Deformables_Driver(Embedded_Deformables_Example<T,d>& example_input)
:Base(example_input),example(example_input)
{}
//######################################################################
// Initialize
//######################################################################
template<class T,int d> void Embedded_Deformables_Driver<T,d>::
Initialize()
{
Base::Initialize();
if(!example.restart) example.Initialize();
else{example.Initialize_Position_Based_State();
example.Read_Output_Files(example.restart_frame);}
example.Initialize_Auxiliary_Structures();
}
//######################################################################
// Advance_One_Newton_Iteration
//######################################################################
template<class T,int d> void Embedded_Deformables_Driver<T,d>::
Advance_One_Newton_Iteration(const T target_time,const T dt)
{
example.Set_Kinematic_Positions(time+dt,example.simulation_mesh->points);
example.Interpolate_Embedded_Values(example.embedded_surface->points,example.simulation_mesh->points);
example.Set_Kinematic_Velocities(time+dt,example.volume_velocities);
example.Interpolate_Embedded_Values(example.surface_velocities,example.volume_velocities);
const size_t number_of_particles=example.simulation_mesh->points.size();
Array<TV> rhs(number_of_particles);
example.position_based_state->Update_Position_Based_State(example.simulation_mesh->points);
example.Add_Elastic_Forces(example.simulation_mesh->points,rhs);
example.Add_Damping_Forces(example.volume_velocities,rhs);
example.Add_External_Forces(rhs);
for(size_t i=0;i<number_of_particles;++i) rhs(i)+=(example.mass(i)*(Vp(i)-example.volume_velocities(i)))/dt;
example.Clear_Values_Of_Kinematic_Particles(rhs);
Array<TV> delta_X(number_of_particles);
Array<TV> temp_q(number_of_particles),temp_s(number_of_particles),temp_r(number_of_particles),temp_k(number_of_particles),temp_z(number_of_particles);
CG_Vector<T,d> cg_x(delta_X),cg_b(rhs),cg_q(temp_q),cg_s(temp_s),cg_r(temp_r),cg_k(temp_k),cg_z(temp_z);
CG_System<T,d> cg_system(example,dt);
Conjugate_Gradient<T> cg;
T b_norm=cg_system.Convergence_Norm(cg_b);
Log::cout<<"Norm: "<<b_norm<<std::endl;
cg.print_residuals=true;
cg.print_diagnostics=true;
cg.restart_iterations=example.cg_restart_iterations;
// solve
cg.Solve(cg_system,cg_x,cg_b,cg_q,cg_s,cg_r,cg_k,cg_z,example.cg_tolerance,0,example.cg_iterations);
// update position and velocity
example.Clear_Values_Of_Kinematic_Particles(delta_X);
example.simulation_mesh->points+=delta_X;example.volume_velocities+=delta_X/dt;
example.Interpolate_Embedded_Values(example.embedded_surface->points,example.simulation_mesh->points);
example.Interpolate_Embedded_Values(example.surface_velocities,example.volume_velocities);
}
//######################################################################
// Advance_To_Target_Time
//######################################################################
template<class T,int d> void Embedded_Deformables_Driver<T,d>::
Advance_To_Target_Time(const T target_time)
{
bool done=false;
for(int substep=1;!done;substep++){
Log::Scope scope("SUBSTEP","substep "+std::to_string(substep));
T dt=Compute_Dt(time,target_time);
Example<T,d>::Clamp_Time_Step_With_Target_Time(time,target_time,dt,done);
Vp=example.volume_velocities;
for(size_t i=0;i<example.simulation_mesh->points.size();++i) example.simulation_mesh->points(i)+=dt*Vp(i);
for(int iteration=0;iteration<example.newton_iterations;++iteration){
Log::cout<<"Newton Iteration: "<<iteration+1<<"/"<<example.newton_iterations<<std::endl;
Advance_One_Newton_Iteration(time,dt);}
if(!done) example.Write_Substep("END Substep",substep,0);
time+=dt;}
}
//######################################################################
// Simulate_To_Frame
//######################################################################
template<class T,int d> void Embedded_Deformables_Driver<T,d>::
Simulate_To_Frame(const int target_frame)
{
example.frame_title="Frame "+std::to_string(example.current_frame);
if(!example.restart) Write_Output_Files(example.current_frame);
while(example.current_frame<target_frame){
Log::Scope scope("FRAME","Frame "+std::to_string(++example.current_frame));
Advance_To_Target_Time(example.Time_At_Frame(example.current_frame));
example.frame_title="Frame "+std::to_string(example.current_frame);
Write_Output_Files(++example.output_number);
*(example.output)<<"TIME = "<<time<<std::endl;}
}
//######################################################################
template class Nova::Embedded_Deformables_Driver<float,2>;
template class Nova::Embedded_Deformables_Driver<float,3>;
#ifdef COMPILE_WITH_DOUBLE_SUPPORT
template class Nova::Embedded_Deformables_Driver<double,2>;
template class Nova::Embedded_Deformables_Driver<double,3>;
#endif
| 47.369748 | 154 | 0.63846 | yanshil |
1f0884fed054fd22bbb9a3b00ef6ad91cd187a88 | 15,194 | cpp | C++ | firmware/L476_board_asserv/src/Board.cpp | romainreignier/robot2017 | 8d36689573a35d3f58184fecc5c3b17d8718f71a | [
"Apache-2.0"
] | 1 | 2019-04-01T12:17:26.000Z | 2019-04-01T12:17:26.000Z | firmware/L476_board_asserv/src/Board.cpp | romainreignier/robot2017 | 8d36689573a35d3f58184fecc5c3b17d8718f71a | [
"Apache-2.0"
] | null | null | null | firmware/L476_board_asserv/src/Board.cpp | romainreignier/robot2017 | 8d36689573a35d3f58184fecc5c3b17d8718f71a | [
"Apache-2.0"
] | null | null | null | #include "Board.h"
#include <cmath>
#include <cstdlib>
#define M_PI 3.14159265358979323846 /* pi */
BaseSequentialStream* dbg = (BaseSequentialStream*)&DEBUG_DRIVER;
#if defined(USE_ROS_LOG)
char logBuffer[LOG_BUFFER_SIZE];
#endif
static void gpt7cb(GPTDriver* _gptd)
{
(void)_gptd;
// Compute PID for motors
gBoard.PIDTimerCb();
}
// Drivers configs
// Timer to trigger PID computation
static const GPTConfig gpt7cfg = {10000, gpt7cb, 0, 0};
// Servos i2c
static const I2CConfig i2c2cfg = {
// 0x00702991, // Computed with CubeMX, but also equals to:
STM32_TIMINGR_PRESC(0U) | STM32_TIMINGR_SCLDEL(7U) |
STM32_TIMINGR_SDADEL(0U) | STM32_TIMINGR_SCLH(41U) |
STM32_TIMINGR_SCLL(91U),
0,
0};
Board::Board()
: // Components
leftMotor{&PWMD3, kPwmTimerFrequency, kPwmTimerPeriod, 3, false, GPIOB, 4, GPIOB, 5, NULL, 0},
rightMotor{&PWMD3, kPwmTimerFrequency, kPwmTimerPeriod, 4, false, GPIOD, 2, GPIOC, 12, NULL, 0},
motors(leftMotor, rightMotor), qei{&QEID1, true, &QEID2, false},
starter{GPIOC, 13}, startingSide{GPIOC, 1}, selector{GPIOB, 12},
eStop{GPIOC, 5, PAL_MODE_INPUT_PULLUP},
frontProximitySensor{GPIOB, 1, PAL_MODE_INPUT_PULLUP},
rearLeftProximitySensor{GPIOC, 7, PAL_MODE_INPUT_PULLUP},
rearRightProximitySensor{GPIOC, 0, PAL_MODE_INPUT_PULLUP}, pump{GPIOB, 0},
greenLed{GPIOA, 11}, servos{&I2CD2, &i2c2cfg}, tcsLed{GPIOA, 15},
maxPwm{6000}, cptRestOnPosition(0),cptRestOnAngle(0), compensationDist(0),compensationAng(0), kpDist{60.0},
kpAng{2800.0f}, kiDist{0.15f}, kiAng{1.0f}, kdDist{650.0f}, kdAng{4000.0f},
iMinDist(-maxPwm), iMaxDist(maxPwm), iMinAng(-maxPwm), iMaxAng(maxPwm),
finish(true), vLinMax{4}, // 200 mm/s -> 4 mm / periode (20ms)
vAngMax{0.087964594f}, // 0.7 tr/s -> rad/periode
smoothRotation(1.0),
linear_speed(0.0),
G_X_mm(0.0),G_Y_mm(0.0),G_Theta_rad(0.0),
tickr(0),tickg(0)
{
}
void Board::begin()
{
// Pin muxing of each peripheral
// see p.73, chap 4, table 16 of STM32L476 datasheet
// UART1: PB6 (TX), PB7 (RX)
palSetPadMode(GPIOB, 6, PAL_MODE_ALTERNATE(7));
palSetPadMode(GPIOB, 7, PAL_MODE_ALTERNATE(7));
// UART2: PA2 (TX), PA3 (RX)
palSetPadMode(GPIOA, 2, PAL_MODE_ALTERNATE(7));
palSetPadMode(GPIOA, 3, PAL_MODE_ALTERNATE(7));
// PWM Motor left: PC8 = TIM3_CH3
palSetPadMode(GPIOC, 8, PAL_MODE_ALTERNATE(2));
// PWM Motor right: PC9 = TIM3_CH4
palSetPadMode(GPIOC, 9, PAL_MODE_ALTERNATE(2));
// QEI Left: PA8, A9 = TIM1
palSetPadMode(GPIOA, 8, PAL_MODE_ALTERNATE(1) | PAL_MODE_INPUT_PULLUP);
palSetPadMode(GPIOA, 9, PAL_MODE_ALTERNATE(1) | PAL_MODE_INPUT_PULLUP);
// QEI Right: PA0, PA1 = TIM2
palSetPadMode(GPIOA, 0, PAL_MODE_ALTERNATE(1) | PAL_MODE_INPUT_PULLUP);
palSetPadMode(GPIOA, 1, PAL_MODE_ALTERNATE(1) | PAL_MODE_INPUT_PULLUP);
// I2C2: PB11 = SDA | PB10 = SCL
palSetPadMode(GPIOB,
10,
PAL_MODE_ALTERNATE(4) | PAL_STM32_OSPEED_HIGH |
PAL_STM32_OTYPE_OPENDRAIN);
palSetPadMode(GPIOB,
11,
PAL_MODE_ALTERNATE(4) | PAL_STM32_OSPEED_HIGH |
PAL_STM32_OTYPE_OPENDRAIN);
// Activate Serial Driver for debug
sdStart(&SD1, NULL);
sdStart(&SERIAL_DRIVER, NULL);
// Start GPT Peripheral for PID Timer
gptStart(&PID_TIMER, &gpt7cfg);
// Actually start the Timer
gptStartContinuous(&PID_TIMER, kPidTimerPeriodMs * 10);
// Start each component
qei.begin();
motors.begin();
starter.begin();
eStop.begin();
startingSide.begin();
selector.begin();
frontProximitySensor.begin();
rearLeftProximitySensor.begin();
rearRightProximitySensor.begin();
pump.begin();
greenLed.begin();
servos.begin();
tcsLed.begin();
tcsLed.clear();
}
void Board::main()
{
}
void Board::startPIDTimer()
{
// Start Timer at 10 kHz so the period = ms * 10
gptStartContinuous(&PID_TIMER, kPidTimerPeriodMs * 10);
}
void Board::stopPIDTimer()
{
// Stop the timer
gptStopTimer(&PID_TIMER);
}
void Board::PIDTimerCb()
{
lectureCodeur();
// Appele a 20Hz
if(mustComputeTraj)
{
computeTraj();
}
if(!finish)
{
asserv();
}
}
void
Board::SetInitPosition(const float & pX, const float & pY, const float & pTheta){
G_X_mm = pX;
G_Y_mm = pY;
G_Theta_rad = pTheta * DTOR;
}
void
Board::DisplayInfo()
{
SetInitPosition(0.0,0.0,0.0);
for(int i = 0 ; i < 550 ; ++i)
{
chprintf(dbg, "G_X_mm : %f\r\n", G_X_mm);
chprintf(dbg, "G_Y_mm: %f\r\n", G_Y_mm);
chprintf(dbg, "G_Theta_deg: %f\r\n", G_Theta_rad * RTOD);
chprintf(dbg, "drg:%f drr: %f\r\n\r\n", drr,drg);
chprintf(dbg, "tickg:%f tickr: %f\r\n\r\n", tickg,tickr);
chThdSleepMilliseconds(100);
}
}
void Board::move(float pDistance, float pTheta){
// Lock system before modifying data used in interrupt
chSysLock();
cibleAngle = normalize_angle(pTheta);
cibleDistance = pDistance;
consigneDistance = pDistance;
consigneAngle = cibleAngle;
mustComputeTraj = false;
compensationDist = 0;
if(finish == false){
mesureDistance = 0;
mesureAngle = 0;
finAsservIterations = 0;
iTermDist=0.0;
iTermAng=0.0;
erreurDistance = 0;
lastErreurDistance = 0;
cptRestOnPosition = 0;
cptRestOnAngle = 0;
}
chSysUnlock();
}
void Board::moveLinear(float _distance)
{
// Lock system before modifying data used in interrupt
chSysLock();
cibleAngle = 0;
cibleDistance = _distance;
consigneDistance = _distance;
consigneAngle = 0;
mesureDistance = 0;
mesureAngle = 0;
finAsservIterations = 0;
iTermDist=0.0;
iTermAng=0.0;
finish = false;
mustComputeTraj = false;
compensationDist = 0;
cptRestOnPosition = 0;
cptRestOnAngle = 0;
erreurDistance = 0;
lastErreurDistance = 0;
chSysUnlock();
while(!finish)
{
printErrors();
chThdSleepMilliseconds(100);
}
chprintf(dbg, "Asserv fini\r\n");
printErrors();
}
void Board::moveAngular(float _angle)
{
// Lock system before modifying data used in interrupt
chSysLock();
cibleDistance = 0;
cibleAngle = normalize_angle(_angle);
consigneDistance = 0;
consigneAngle = cibleAngle; // 0 si mustComputeTraj True
mesureDistance = 0;
mesureAngle = 0;
iTermAng = 0.0;
iTermDist = 0.0;
cptRestOnPosition = 0;
cptRestOnAngle = 0;
finAsservIterations = 0;
finish = false;
mustComputeTraj = false; // On desactive la rampe avec false
chSysUnlock();
while(!finish)
{
printErrors();
chThdSleepMilliseconds(100);
}
chprintf(dbg, "Asserv fini\r\n");
printErrors();
}
void Board::moveLinearEchelon(float _distance)
{
// Lock system before modifying data used in interrupt
chSysLock();
cibleAngle = 0;
cibleDistance = _distance;
consigneDistance = _distance;
consigneAngle = 0;
mesureDistance = 0;
mesureAngle = 0;
finAsservIterations = 0;
finish = false;
mustComputeTraj = false;
chSysUnlock();
while(!finish)
{
printErrors();
chThdSleepMilliseconds(100);
}
chprintf(dbg, "Asserv fini\r\n");
printErrors();
}
void Board::moveAngularEchelon(float _angle)
{
// Lock system before modifying data used in interrupt
chSysLock();
cibleDistance = 0;
cibleAngle = _angle;
consigneDistance = 0;
consigneAngle = _angle;
mesureDistance = 0;
mesureAngle = 0;
finAsservIterations = 0;
finish = false;
mustComputeTraj = false;
chSysUnlock();
while(!finish)
{
printErrors();
chThdSleepMilliseconds(100);
}
chprintf(dbg, "Asserv fini\r\n");
printErrors();
}
void Board::computeTraj()
{
// Increment distance
if(cibleDistance >= 0)
{
if(consigneDistance < cibleDistance)
{
consigneDistance += vLinMax;
}
else
{
consigneDistance = cibleDistance;
}
}
else
{
if(consigneDistance > cibleDistance)
{
consigneDistance -= vLinMax;
}
else
{
consigneDistance = cibleDistance;
}
}
// Increment Angle
if(cibleAngle >= 0)
{
if(consigneAngle < cibleAngle)
{
consigneAngle += vAngMax;
}
else
{
consigneAngle = cibleAngle;
}
}
else
{
if(consigneAngle > cibleAngle)
{
consigneAngle -= vAngMax;
}
else
{
consigneAngle = cibleAngle;
}
}
}
void Board::asserv()
{
float correctionDistance = 0.0;
float correctionAngle = 0.0;
// Incrementation des mesures
//linear_speed = ((dD / kPidTimerPeriodMs) * 1000 );
mesureDistance += dD;
mesureAngle += dA;
mesureAngle = normalize_angle(mesureAngle);
// Calcul des erreurs
erreurDistance = consigneDistance - mesureDistance;
erreurAngle = normalize_angle(consigneAngle - mesureAngle);
iTermAng += kiAng * erreurAngle;
iTermAng = bound(iTermAng, iMinAng, iMaxAng);
//############## Gestion PID ##############
//############## Distance ##############
if(erreurDistance >= 0.0f)
correctionDistance = (kpDist * erreurDistance +
( kdDist * (erreurDistance
- lastErreurDistance)) )
+ 700.0f + compensationDist;
else
correctionDistance = ( kpDist * erreurDistance +
( kdDist * (erreurDistance - lastErreurDistance ))) -
700.0f + compensationDist;
//############## Gestion PID ##############
//############## Angle ##############
if(erreurAngle >= 0.0f)
correctionAngle = ( kpAng * erreurAngle +
( kdAng * (erreurAngle - lastErreurAngle))) +
650.0f + compensationAng;
else
correctionAngle = ( kpAng * erreurAngle +
(kdAng * (erreurAngle - lastErreurAngle))) -
650.0f + compensationAng;
//############## Compensation ##############
//############## Distance ##############
if(erreurDistance == lastErreurDistance)
{
++cptRestOnPosition;
iTermDist += kiDist * erreurDistance;
iTermDist = bound(iTermDist, iMinDist, iMaxDist);
}
else
compensationDist=0;
if(cptRestOnPosition > 3)
compensationDist = iTermDist;
//############## Compensation ##############
//############## Angle ##############
if(erreurAngle == lastErreurAngle)
{
++cptRestOnAngle;
iTermAng += kiAng * erreurAngle;
iTermAng = bound(iTermAng, iMinAng, iMaxAng);
}
else
compensationAng=0;
if(cptRestOnPosition > 3)
compensationAng = iTermAng;
lastErreurDistance = erreurDistance;
lastErreurAngle = erreurAngle;
leftPwm =
boundPwm(static_cast<int16_t>(correctionDistance - smoothRotation * correctionAngle));
rightPwm =
boundPwm(static_cast<int16_t>(correctionDistance + smoothRotation * correctionAngle));
chSysLockFromISR();
motors.pwmI(leftPwm, rightPwm);
chSysUnlockFromISR();
if(fabs(erreurDistance) < 2.0 && fabs(erreurAngle) < 0.0087) //0.5 degres
{
finAsservIterations++;
if(finAsservIterations > 50)
{
finish = true;
motors.pwmI(0, 0);
}
}
}
void Board::lectureCodeur()
{
int32_t _dLeft,_dRight;
// Retrieve the values from a locked system
chSysLockFromISR();
{
_dLeft = qeiUpdateI(qei.getLeftDriver());
_dRight = qeiUpdateI(qei.getRightDriver());
}
chSysUnlockFromISR();
// Increment the internal counters
leftQeiCnt += _dLeft;
rightQeiCnt += _dRight;
tickg +=_dLeft;
tickr +=_dRight;
// Compute the average
leftQeiAvg.add(_dLeft);
rightQeiAvg.add(_dRight);
smoothRotation = bound(( -(0.6/20.0) * fabs(lastErreurDistance) + 1.0), 0.05, 1.0);
// Estimation deplacement
const float dl = static_cast<float>(_dLeft) *
LEFT_TICKS_TO_MM; // calcul du déplacement de la roue droite
const float dr = static_cast<float>(_dRight) *
RIGHT_TICKS_TO_MM; // calcul du déplacement de la roue gauche
// calcul du déplacement du robot
dD = (dr + dl) / 2;
// calcul de la variation de l'angle alpha du robot
dA = (dr - dl) / wheelSeparationMM;
// Speeds in m/s
leftSpeed = dl / kPidTimerPeriodMs;
rightSpeed = dr / kPidTimerPeriodMs;
linear_speed = dD / kPidTimerPeriodMs;
drr+=dr;
drg+=dl;
G_X_mm+= dD * cos(G_Theta_rad);
G_Y_mm+= dD * sin(G_Theta_rad);
/*G_X_mm+= dD * cos(G_Theta_rad + dA/2.0);
G_Y_mm+= dD * sin(G_Theta_rad + dA/2.0);
*/
G_Theta_rad += dA;
G_Theta_rad = normalize_angle(G_Theta_rad);
}
void Board::printErrors()
{
chprintf(dbg, "\ncible dist: %f\r\n", cibleDistance);
chprintf(dbg, "cible ang: %f\r\n", cibleAngle);
chprintf(dbg, "consigne dist: %f\r\n", consigneDistance);
chprintf(dbg, "consigne ang: %f\r\n", consigneAngle);
chprintf(dbg, "mesure dist: %f\r\n", mesureDistance);
chprintf(dbg, "mesure ang: %f\r\n", mesureAngle);
chprintf(dbg, "erreur dist: %f\r\n", lastErreurDistance);
chprintf(dbg, "erreur ang: %f\r\n", lastErreurAngle);
chprintf(dbg, "left pwm: %d\r\n", leftPwm);
chprintf(dbg, "right pwm: %d\r\n", rightPwm);
chprintf(dbg, "finish: %d\r\n", finish);
chprintf(dbg, "finIterations: %d\r\n", finAsservIterations);
chprintf(dbg, "G_X_mm : %f\r\n", G_X_mm);
chprintf(dbg, "G_Y_mm: %f\r\n", G_Y_mm);
chprintf(dbg, "G_Theta_rad: %f\r\n", G_Theta_rad);
}
int16_t Board::boundPwm(int16_t _pwm)
{
if(_pwm > maxPwm) return maxPwm;
if(_pwm < -maxPwm) return -maxPwm;
return _pwm;
}
/*!
* \brief normalize_angle_positive
*
* Normalizes the angle to be 0 to 2*M_PI
* It takes and returns radians.
*/
float Board::normalize_angle_positive(float angle)
{
return fmod(fmod(angle, 2.0 * M_PI) + 2.0 * M_PI, 2.0 * M_PI);
}
/*!
* \brief normalize
*
* Normalizes the angle to be -M_PI circle to +M_PI circle
* It takes and returns radians.
*
*/
float Board::normalize_angle(float angle)
{
float a = normalize_angle_positive(angle);
if(a > M_PI) a -= 2.0 * M_PI;
return a;
}
void
Board::needMotorGraph(){
leftPwm=0;
rightPwm=0;
while (leftPwm < 850) {
leftPwm++;
rightPwm=leftPwm;
//chSysLockFromISR();
motors.pwmI(leftPwm, rightPwm);
//chSysUnlockFromISR();
chThdSleepMilliseconds(2);
}
chThdSleepMilliseconds(200);
while (leftPwm < 2600) {
leftPwm+=50;
rightPwm=leftPwm;
//chSysLockFromISR();
motors.pwmI(leftPwm, rightPwm);
//chSysUnlockFromISR();
chThdSleepMilliseconds(300);
}
while (leftPwm > 0) {
leftPwm-=50;
rightPwm=leftPwm;
//chSysLockFromISR();
motors.pwmI(leftPwm, rightPwm);
//chSysUnlockFromISR();
chThdSleepMilliseconds(500);
}
}
void
Board::FoundPWM(){
int mPWM=0;
G_X_mm = 0.0;
while(G_X_mm < 2.0)
{
++mPWM;
motors.pwmI(mPWM, mPWM);
chThdSleepMilliseconds(20);
}
motors.pwmI(0, 0);
chprintf(dbg, "PWM found in linear: %d\r\n", mPWM);
G_Theta_rad = 0.0;
mPWM = 0;
chThdSleepMilliseconds(1000);
while(G_Theta_rad * RTOD < 0.5)
{
++mPWM;
motors.pwmI(-mPWM, mPWM);
chThdSleepMilliseconds(20);
}
motors.pwmI(0, 0);
chprintf(dbg, "PWM found in rotate: %d\r\n", mPWM);
}
Board gBoard;
| 24.427653 | 111 | 0.638344 | romainreignier |
1f095b0008f38943fe66c5df9cf7359ddf136787 | 5,096 | cpp | C++ | driver/response.cpp | symmetryinvestments/ldc | cac8eddfc68cfe5c972df0ede31d8975fb1c5fb2 | [
"Apache-2.0"
] | 858 | 2015-01-02T10:06:15.000Z | 2022-03-30T18:26:49.000Z | driver/response.cpp | symmetryinvestments/ldc | cac8eddfc68cfe5c972df0ede31d8975fb1c5fb2 | [
"Apache-2.0"
] | 2,533 | 2015-01-04T14:31:13.000Z | 2022-03-31T22:12:24.000Z | driver/response.cpp | symmetryinvestments/ldc | cac8eddfc68cfe5c972df0ede31d8975fb1c5fb2 | [
"Apache-2.0"
] | 220 | 2015-01-06T05:24:36.000Z | 2022-03-13T10:47:32.000Z | //===-- response.cpp ------------------------------------------------------===//
//
// LDC – the LLVM D compiler
//
// This file is distributed under the BSD-style LDC license. See the LICENSE
// file for details.
//
//===----------------------------------------------------------------------===//
//
// This is an open-source reimplementation of the DMD response_expand function
// (Safety0ff/response_expand on GitHub, see LDC issue #267).
//
//===----------------------------------------------------------------------===//
#include "driver/args.h"
#include <fstream>
#include <iterator>
#include <list>
#include <map>
#include <set>
#include <sstream>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <vector>
#include <cctype>
// returns true if the quote is unescaped
bool applyBackslashRule(std::string &arg) {
std::string::reverse_iterator it;
for (it = arg.rbegin(); it != arg.rend() && *it == '\\'; ++it) {
}
size_t numbs = std::distance(arg.rbegin(), it);
bool escapedquote = numbs % 2;
size_t numescaped = numbs / 2 + escapedquote;
arg.resize(arg.size() - numescaped);
if (escapedquote) {
arg += '"';
}
return !escapedquote;
}
// returns true if the end of the quote is the end of the argument
bool dealWithQuote(std::istream &is, std::string &arg) {
// first go back and deal with backslashes
if (!applyBackslashRule(arg)) {
return false;
}
// keep appending until we find a quote terminator
while (is.good()) {
auto c = is.get();
switch (c) {
case '"':
if (applyBackslashRule(arg)) {
return false;
}
break;
case EOF: // new line or EOF ends quote and argument
case '\n':
return true;
case '\r': // ignore carriage returns in quotes
break;
default:
arg += c;
}
}
return true; // EOF
}
void dealWithComment(std::istream &is) {
while (is.good()) {
char c = is.get();
if (c == '\n' || c == '\r') {
return; // newline, carriage return and EOF end comment
}
}
}
std::vector<std::string> expand(std::istream &is) {
std::vector<std::string> expanded;
std::string arg;
is >> std::ws;
while (is.good()) {
auto c = is.get();
if (c == EOF) {
break;
} else if (std::isspace(c)) {
is >> std::ws;
if (!arg.empty()) {
expanded.push_back(arg);
arg.clear();
}
} else if (c == '"') {
if (dealWithQuote(is, arg) && !arg.empty()) {
expanded.push_back(arg);
arg.clear();
}
} else if (c == '#') {
dealWithComment(is);
} else {
arg += c;
while (is.good()) {
c = is.peek();
if (std::isspace(c) || c == '"' || c == EOF) {
break; // N.B. comments can't be placed in the middle of an arg
} else {
arg += is.get();
}
}
}
}
if (!arg.empty()) {
expanded.push_back(arg);
}
return expanded;
}
int response_expand(size_t *pargc, char ***ppargv) {
// N.B. It is possible to create an infinite loop with response arguments
// in the original implementation, we artificially limmit re-parsing responses
const unsigned reexpand_limit = 32;
std::map<std::string, unsigned> response_args;
// Compile a list of arguments, at the end convert them to the proper C string
// form
std::vector<std::string> processed_args;
std::list<std::string> unprocessed_args;
// fill unprocessed with initial arguments
for (size_t i = 0; i < *pargc; ++i) {
unprocessed_args.push_back((*ppargv)[i]);
}
processed_args.reserve(*pargc);
while (!unprocessed_args.empty()) {
std::string arg = unprocessed_args.front();
unprocessed_args.pop_front();
if (!arg.empty() && arg[0] == '@') {
arg.erase(arg.begin()); // remove leading '@'
if (arg.empty()) {
return 1;
}
if (response_args.find(arg) == response_args.end()) {
response_args[arg] = 1;
} else if (++response_args[arg] > reexpand_limit) {
return 2; // We might be in an infinite loop
}
std::vector<std::string> expanded_args;
std::string env = env::get(arg.c_str());
if (!env.empty()) {
std::istringstream ss(env);
expanded_args = expand(ss);
} else {
std::ifstream ifs(arg.c_str());
if (ifs.good()) {
expanded_args = expand(ifs);
} else {
return 3; // response not found between environment and files
}
}
unprocessed_args.insert(unprocessed_args.begin(), expanded_args.begin(),
expanded_args.end());
} else if (!arg.empty()) {
processed_args.push_back(arg);
}
}
char **pargv =
reinterpret_cast<char **>(malloc(sizeof(char *) * processed_args.size()));
for (size_t i = 0; i < processed_args.size(); ++i) {
pargv[i] = reinterpret_cast<char *>(
malloc(sizeof(pargv[i]) * (1 + processed_args[i].length())));
strcpy(pargv[i], processed_args[i].c_str());
}
*pargc = processed_args.size();
*ppargv = pargv;
return 0;
}
| 26.962963 | 80 | 0.557104 | symmetryinvestments |
1f110276ddaf6ecd5bc30d78aafc2915730ca827 | 16,858 | cpp | C++ | plugins/hgl_parser/src/hgl_parser.cpp | The6P4C/hal | 09ce5ba7012e293ce004b1ca5c94f553c9cbddae | [
"MIT"
] | null | null | null | plugins/hgl_parser/src/hgl_parser.cpp | The6P4C/hal | 09ce5ba7012e293ce004b1ca5c94f553c9cbddae | [
"MIT"
] | null | null | null | plugins/hgl_parser/src/hgl_parser.cpp | The6P4C/hal | 09ce5ba7012e293ce004b1ca5c94f553c9cbddae | [
"MIT"
] | null | null | null | #include "hgl_parser/hgl_parser.h"
#include "hal_core/netlist/boolean_function.h"
#include "hal_core/utilities/log.h"
#include "rapidjson/filereadstream.h"
#include "rapidjson/stringbuffer.h"
namespace hal
{
std::unique_ptr<GateLibrary> HGLParser::parse(const std::filesystem::path& file_path)
{
m_path = file_path;
FILE* fp = fopen(file_path.string().c_str(), "r");
if (fp == NULL)
{
log_error("hgl_parser", "unable to open '{}' for reading.", file_path.string());
return nullptr;
}
char buffer[65536];
rapidjson::FileReadStream is(fp, buffer, sizeof(buffer));
rapidjson::Document document;
document.ParseStream<0, rapidjson::UTF8<>, rapidjson::FileReadStream>(is);
fclose(fp);
if (document.HasParseError())
{
log_error("hgl_parser", "encountered parsing error while reading '{}'.", file_path.string());
return nullptr;
}
if (!parse_gate_library(document))
{
return nullptr;
}
return std::move(m_gate_lib);
}
bool HGLParser::parse_gate_library(const rapidjson::Document& document)
{
if (!document.HasMember("library"))
{
log_error("hgl_parser", "file does not include 'library' node.");
return false;
}
m_gate_lib = std::make_unique<GateLibrary>(m_path, document["library"].GetString());
if (!document.HasMember("cells"))
{
log_error("hgl_parser", "file does not include 'cells' node.");
return false;
}
for (const auto& gate_type : document["cells"].GetArray())
{
if (!parse_gate_type(gate_type))
{
return false;
}
}
return true;
}
bool HGLParser::parse_gate_type(const rapidjson::Value& gate_type)
{
std::string name;
std::set<GateTypeProperty> properties;
PinCtx pin_ctx;
if (!gate_type.HasMember("name") || !gate_type["name"].IsString())
{
log_error("hgl_parser", "invalid name for at least one gate type.");
return false;
}
name = gate_type["name"].GetString();
if (gate_type.HasMember("types") && gate_type["types"].IsArray())
{
for (const auto& base_type : gate_type["types"].GetArray())
{
try
{
GateTypeProperty property = enum_from_string<GateTypeProperty>(base_type.GetString());
properties.insert(property);
}
catch (const std::runtime_error&)
{
log_error("hgl_parser", "invalid base type '{}' given for gate type '{}'.", base_type.GetString(), name);
return false;
}
}
}
else
{
properties = {GateTypeProperty::combinational};
}
GateType* gt = m_gate_lib->create_gate_type(name, properties);
if (gate_type.HasMember("pins") && gate_type["pins"].IsArray())
{
for (const auto& pin : gate_type["pins"].GetArray())
{
if (!parse_pin(pin_ctx, pin, name))
{
return false;
}
}
}
for (const auto& pin : pin_ctx.pins)
{
gt->add_pin(pin, pin_ctx.pin_to_direction.at(pin), pin_ctx.pin_to_type.at(pin));
}
if (gate_type.HasMember("groups") && gate_type["groups"].IsArray())
{
for (const auto& group_val : gate_type["groups"].GetArray())
{
if (!parse_group(gt, group_val, name))
{
return false;
}
}
}
if (properties.find(GateTypeProperty::lut) != properties.end())
{
GateType* gt_lut = gt;
if (!gate_type.HasMember("lut_config") || !gate_type["lut_config"].IsObject())
{
log_error("hgl_parser", "invalid or missing LUT config for gate type '{}'.", name);
return false;
}
if (!parse_lut_config(gt_lut, gate_type["lut_config"]))
{
return false;
}
}
else if (properties.find(GateTypeProperty::ff) != properties.end())
{
GateType* gt_ff = gt;
if (!gate_type.HasMember("ff_config") || !gate_type["ff_config"].IsObject())
{
log_error("hgl_parser", "invalid or missing flip-flop config for gate type '{}'.", name);
return false;
}
if (!parse_ff_config(gt_ff, gate_type["ff_config"]))
{
return false;
}
}
else if (properties.find(GateTypeProperty::latch) != properties.end())
{
GateType* gt_latch = gt;
if (!gate_type.HasMember("latch_config") || !gate_type["latch_config"].IsObject())
{
log_error("hgl_parser", "invalid or missing latch config for gate type '{}'.", name);
return false;
}
if (!parse_latch_config(gt_latch, gate_type["latch_config"]))
{
return false;
}
}
for (const auto& [f_name, func] : pin_ctx.boolean_functions)
{
gt->add_boolean_function(f_name, BooleanFunction::from_string(func, pin_ctx.pins));
}
return true;
}
bool HGLParser::parse_pin(PinCtx& pin_ctx, const rapidjson::Value& pin, const std::string& gt_name)
{
if (!pin.HasMember("name") || !pin["name"].IsString())
{
log_error("hgl_parser", "invalid name for at least one pin of gate type '{}'.", gt_name);
return false;
}
std::string name = pin["name"].GetString();
if (!pin.HasMember("direction") || !pin["direction"].IsString())
{
log_error("hgl_parser", "invalid direction for pin '{}' of gate type '{}'.", name, gt_name);
return false;
}
std::string direction = pin["direction"].GetString();
try
{
pin_ctx.pin_to_direction[name] = enum_from_string<PinDirection>(direction);
pin_ctx.pins.push_back(name);
}
catch (const std::runtime_error&)
{
log_warning("hgl_parser", "invalid direction '{}' given for pin '{}' of gate type '{}'.", direction, name, gt_name);
return false;
}
if (pin.HasMember("function") && pin["function"].IsString())
{
pin_ctx.boolean_functions[name] = pin["function"].GetString();
}
if (pin.HasMember("x_function") && pin["x_function"].IsString())
{
pin_ctx.boolean_functions[name + "_undefined"] = pin["x_function"].GetString();
}
if (pin.HasMember("z_function") && pin["z_function"].IsString())
{
pin_ctx.boolean_functions[name + "_tristate"] = pin["z_function"].GetString();
}
if (pin.HasMember("type") && pin["type"].IsString())
{
std::string type_str = pin["type"].GetString();
try
{
pin_ctx.pin_to_type[name] = enum_from_string<PinType>(type_str);
}
catch (const std::runtime_error&)
{
log_warning("hgl_parser", "invalid type '{}' given for pin '{}' of gate type '{}'.", type_str, name, gt_name);
return false;
}
}
else
{
pin_ctx.pin_to_type[name] = PinType::none;
}
return true;
}
bool HGLParser::parse_group(GateType* gt, const rapidjson::Value& group, const std::string& gt_name)
{
// read name
std::string name;
if (!group.HasMember("name") || !group["name"].IsString())
{
log_error("hgl_parser", "invalid name for at least one pin of gate type '{}'.", gt_name);
return false;
}
name = group["name"].GetString();
// read index to pin mapping
if (!group.HasMember("pins") || !group["pins"].IsArray())
{
log_error("hgl_parser", "no valid pins given for group '{}' of gate type '{}'.", name, gt_name);
return false;
}
std::vector<std::pair<u32, std::string>> pins;
for (const auto& pin_obj : group["pins"].GetArray())
{
if(!pin_obj.IsObject())
{
log_error("hgl_parser", "invalid pin group assignment given for group '{}' of gate type '{}'.", name, gt_name);
return false;
}
const auto pin_val = pin_obj.GetObject().MemberBegin();
u32 pin_index = std::stoul(pin_val->name.GetString());
std::string pin_name = pin_val->value.GetString();
pins.push_back(std::make_pair(pin_index, pin_name));
}
return gt->assign_pin_group(name, pins);
}
bool HGLParser::parse_lut_config(GateType* gt_lut, const rapidjson::Value& lut_config)
{
if (!lut_config.HasMember("bit_order") || !lut_config["bit_order"].IsString())
{
log_error("hgl_parser", "invalid bit order for LUT gate type '{}'.", gt_lut->get_name());
return false;
}
if (std::string(lut_config["bit_order"].GetString()) == "ascending")
{
gt_lut->set_lut_init_ascending(true);
}
else
{
gt_lut->set_lut_init_ascending(false);
}
if (!lut_config.HasMember("data_category") || !lut_config["data_category"].IsString())
{
log_error("hgl_parser", "invalid data category for LUT gate type '{}'.", gt_lut->get_name());
return false;
}
gt_lut->set_config_data_category(lut_config["data_category"].GetString());
if (!lut_config.HasMember("data_identifier") || !lut_config["data_identifier"].IsString())
{
log_error("hgl_parser", "invalid data identifier for LUT gate type '{}'.", gt_lut->get_name());
return false;
}
gt_lut->set_config_data_identifier(lut_config["data_identifier"].GetString());
return true;
}
bool HGLParser::parse_ff_config(GateType* gt_ff, const rapidjson::Value& ff_config)
{
if (ff_config.HasMember("next_state") && ff_config["next_state"].IsString())
{
gt_ff->add_boolean_function("next_state", BooleanFunction::from_string(ff_config["next_state"].GetString(), gt_ff->get_input_pins()));
}
if (ff_config.HasMember("clocked_on") && ff_config["clocked_on"].IsString())
{
gt_ff->add_boolean_function("clock", BooleanFunction::from_string(ff_config["clocked_on"].GetString(), gt_ff->get_input_pins()));
}
if (ff_config.HasMember("clear_on") && ff_config["clear_on"].IsString())
{
gt_ff->add_boolean_function("clear", BooleanFunction::from_string(ff_config["clear_on"].GetString(), gt_ff->get_input_pins()));
}
if (ff_config.HasMember("preset_on") && ff_config["preset_on"].IsString())
{
gt_ff->add_boolean_function("preset", BooleanFunction::from_string(ff_config["preset_on"].GetString(), gt_ff->get_input_pins()));
}
bool has_state = ff_config.HasMember("state_clear_preset") && ff_config["state_clear_preset"].IsString();
bool has_neg_state = ff_config.HasMember("neg_state_clear_preset") && ff_config["neg_state_clear_preset"].IsString();
if (has_state && has_neg_state)
{
GateType::ClearPresetBehavior cp1, cp2;
if (const auto behav = enum_from_string<GateType::ClearPresetBehavior>(ff_config["state_clear_preset"].GetString(), GateType::ClearPresetBehavior::undef);
behav != GateType::ClearPresetBehavior::undef)
{
cp1 = behav;
}
else
{
log_error("hgl_parser", "invalid clear-preset behavior '{}' for state of flip-flop gate type '{}'.", ff_config["state_clear_preset"].GetString(), gt_ff->get_name());
return false;
}
if (const auto behav = enum_from_string<GateType::ClearPresetBehavior>(ff_config["neg_state_clear_preset"].GetString(), GateType::ClearPresetBehavior::undef);
behav != GateType::ClearPresetBehavior::undef)
{
cp2 = behav;
}
else
{
log_error("hgl_parser", "invalid clear-preset behavior '{}' for negated state of flip-flop gate type '{}'.", ff_config["neg_state_clear_preset"].GetString(), gt_ff->get_name());
return false;
}
gt_ff->set_clear_preset_behavior(cp1, cp2);
}
else if ((has_state && !has_neg_state) || (!has_state && has_neg_state))
{
log_error("hgl_parser", "requires specification of the clear-preset behavior for the state as well as the negated state for flip-flop gate type '{}'.", gt_ff->get_name());
return false;
}
if (ff_config.HasMember("data_category") && ff_config["data_category"].IsString())
{
gt_ff->set_config_data_category(ff_config["data_category"].GetString());
}
if (ff_config.HasMember("data_identifier") && ff_config["data_identifier"].IsString())
{
gt_ff->set_config_data_identifier(ff_config["data_identifier"].GetString());
}
return true;
}
bool HGLParser::parse_latch_config(GateType* gt_latch, const rapidjson::Value& latch_config)
{
if (latch_config.HasMember("data_in") && latch_config["data_in"].IsString())
{
gt_latch->add_boolean_function("data", BooleanFunction::from_string(latch_config["data_in"].GetString(), gt_latch->get_input_pins()));
}
if (latch_config.HasMember("enable_on") && latch_config["enable_on"].IsString())
{
gt_latch->add_boolean_function("enable", BooleanFunction::from_string(latch_config["enable_on"].GetString(), gt_latch->get_input_pins()));
}
if (latch_config.HasMember("clear_on") && latch_config["clear_on"].IsString())
{
gt_latch->add_boolean_function("clear", BooleanFunction::from_string(latch_config["clear_on"].GetString(), gt_latch->get_input_pins()));
}
if (latch_config.HasMember("preset_on") && latch_config["preset_on"].IsString())
{
gt_latch->add_boolean_function("preset", BooleanFunction::from_string(latch_config["preset_on"].GetString(), gt_latch->get_input_pins()));
}
bool has_state = latch_config.HasMember("state_clear_preset") && latch_config["state_clear_preset"].IsString();
bool has_neg_state = latch_config.HasMember("neg_state_clear_preset") && latch_config["neg_state_clear_preset"].IsString();
if (has_state && has_neg_state)
{
GateType::ClearPresetBehavior cp1, cp2;
if (const auto behav = enum_from_string<GateType::ClearPresetBehavior>(latch_config["state_clear_preset"].GetString(), GateType::ClearPresetBehavior::undef);
behav != GateType::ClearPresetBehavior::undef)
{
cp1 = behav;
}
else
{
log_error("hgl_parser", "invalid clear-preset behavior '{}' for state of flip-flop gate type '{}'.", latch_config["state_clear_preset"].GetString(), gt_latch->get_name());
return false;
}
if (const auto behav = enum_from_string<GateType::ClearPresetBehavior>(latch_config["neg_state_clear_preset"].GetString(), GateType::ClearPresetBehavior::undef);
behav != GateType::ClearPresetBehavior::undef)
{
cp2 = behav;
}
else
{
log_error("hgl_parser", "invalid clear-preset behavior '{}' for negated state of flip-flop gate type '{}'.", latch_config["neg_state_clear_preset"].GetString(), gt_latch->get_name());
return false;
}
gt_latch->set_clear_preset_behavior(cp1, cp2);
}
else if ((has_state && !has_neg_state) || (!has_state && has_neg_state))
{
log_error("hgl_parser", "requires specification of the clear-preset behavior for the state as well as the negated state for flip-flop gate type '{}'.", gt_latch->get_name());
return false;
}
return true;
}
} // namespace hal
| 37.132159 | 199 | 0.564836 | The6P4C |
1f110ce53d275d326de91005b7c5dfce8ed7417f | 669 | cpp | C++ | sdk/boost_1_30_0/libs/python/test/bienstman5.cpp | acidicMercury8/xray-1.0 | 65e85c0e31e82d612c793d980dc4b73fa186c76c | [
"Linux-OpenIB"
] | 2 | 2020-01-30T12:51:49.000Z | 2020-08-31T08:36:49.000Z | sdk/boost_1_30_0/libs/python/test/bienstman5.cpp | acidicMercury8/xray-1.0 | 65e85c0e31e82d612c793d980dc4b73fa186c76c | [
"Linux-OpenIB"
] | null | null | null | sdk/boost_1_30_0/libs/python/test/bienstman5.cpp | acidicMercury8/xray-1.0 | 65e85c0e31e82d612c793d980dc4b73fa186c76c | [
"Linux-OpenIB"
] | null | null | null | // Copyright David Abrahams 2002. Permission to copy, use,
// modify, sell and distribute this software is granted provided this
// copyright notice appears in all copies. This software is provided
// "as is" without express or implied warranty, and with no claim as
// to its suitability for any purpose.
#include <boost/python/module.hpp>
#include <boost/python/def.hpp>
#include <boost/python/class.hpp>
#include <boost/mpl/list.hpp>
#include <complex>
struct M {M(const std::complex<double>&) {} };
BOOST_PYTHON_MODULE(bienstman5_ext)
{
using namespace boost::python;
class_<M>("M", init<std::complex<double> const&>())
;
}
| 26.76 | 70 | 0.701046 | acidicMercury8 |
1f1132570a7d148410512482329930a8f00b6828 | 502 | cpp | C++ | codeforces/667.3/B.cpp | swwind/code | 25c4c5ca2f8578ba792b44cbdf44286d39dfb7e0 | [
"WTFPL"
] | 3 | 2017-09-17T09:12:50.000Z | 2018-04-06T01:18:17.000Z | codeforces/667.3/B.cpp | swwind/code | 25c4c5ca2f8578ba792b44cbdf44286d39dfb7e0 | [
"WTFPL"
] | null | null | null | codeforces/667.3/B.cpp | swwind/code | 25c4c5ca2f8578ba792b44cbdf44286d39dfb7e0 | [
"WTFPL"
] | null | null | null | #include <bits/stdc++.h>
using namespace std;
int main() {
int t, x, y, a, b, n;
scanf("%d", &t);
while (t --) {
scanf("%d%d%d%d%d", &a, &b, &x, &y, &n);
if (n >= a - x + b - y) {
printf("%lld\n", (long long) x * y);
continue;
}
long long res1 = n >= (a - x) ? (long long) x * (b - (n - (a - x))) : (long long) (a - n) * b;
long long res2 = n >= (b - y) ? (long long) y * (a - (n - (b - y))) : (long long) (b - n) * a;
printf("%lld\n", min(res1, res2));
}
} | 29.529412 | 98 | 0.420319 | swwind |
1f11f7ff0ee57eacd12da2befda877353db09b60 | 2,065 | hpp | C++ | app/include/shared/util/ResourceUtil.hpp | paulo-coutinho/cef-sample | ed6f400c1ecf5ec86454c963578ba27c5194afe0 | [
"MIT"
] | 5 | 2021-07-09T15:16:13.000Z | 2022-01-27T13:47:16.000Z | app/include/shared/util/ResourceUtil.hpp | paulo-coutinho/cef-sample | ed6f400c1ecf5ec86454c963578ba27c5194afe0 | [
"MIT"
] | null | null | null | app/include/shared/util/ResourceUtil.hpp | paulo-coutinho/cef-sample | ed6f400c1ecf5ec86454c963578ba27c5194afe0 | [
"MIT"
] | null | null | null | #pragma once
#include "include/cef_parser.h"
#include "include/wrapper/cef_stream_resource_handler.h"
#if defined(OS_WIN)
#include "include/wrapper/cef_resource_manager.h"
#endif
namespace shared
{
namespace util
{
class ResourceUtil
{
public:
// returns URL without the query or fragment components, if any
static std::string getUrlWithoutQueryOrFragment(const std::string &url);
// return the path where resources are stored
static std::string getResourcePath(const std::string &url);
// determine the mime type based on the file path file extension
static std::string getMimeType(const std::string &resourcePath);
// return the resource handler by mime type
static CefRefPtr<CefResourceHandler> getResourceHandler(const std::string &resourcePath);
// return resource path
static bool getResourceDir(std::string &dir);
// retrieve resource path contents as a std::string or false if the resource is not found
static bool getResourceString(const std::string &resourcePath, std::string &outData);
// retrieve resource path contents as a CefStreamReader or returns NULL if the resource is not found
static CefRefPtr<CefStreamReader> getResourceReader(const std::string &resourcePath);
#if defined(OS_MAC)
static bool uncachedAmIBundled();
static bool amIBundled();
#endif
#if defined(OS_POSIX)
// determine if file exists
static bool fileExists(const char *path);
// read content of file as string
static bool readFileToString(const char *path, std::string &data);
#endif
#if defined(OS_WIN)
// returns the BINARY id value associated with resource path on Windows
static int getResourceId(const std::string &resourcePath);
// create a new provider for loading BINARY resources on Windows
static CefResourceManager::Provider *createBinaryResourceProvider(const std::string &rootURL);
// load resource by binary ID
static bool loadBinaryResource(int binaryId, DWORD &dwSize, LPBYTE &pBytes);
#endif
};
} // namespace util
} // namespace shared
| 29.927536 | 104 | 0.7477 | paulo-coutinho |
1f17c691b218143baff7673c402e90ac5b212d50 | 12,607 | hpp | C++ | Engine/Includes/Lua/Modules/wxLua/bindings/wxwidgets/wxadv_override.hpp | GCourtney27/Retina-Engine | 5358b9c499f4163a209024dc303c3efe6c520c01 | [
"MIT"
] | null | null | null | Engine/Includes/Lua/Modules/wxLua/bindings/wxwidgets/wxadv_override.hpp | GCourtney27/Retina-Engine | 5358b9c499f4163a209024dc303c3efe6c520c01 | [
"MIT"
] | null | null | null | Engine/Includes/Lua/Modules/wxLua/bindings/wxwidgets/wxadv_override.hpp | GCourtney27/Retina-Engine | 5358b9c499f4163a209024dc303c3efe6c520c01 | [
"MIT"
] | null | null | null | // ----------------------------------------------------------------------------
// Overridden functions for the wxWidgets binding for wxLua
//
// Please keep these functions in the same order as the .i file and in the
// same order as the listing of the functions in that file.
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// Overrides for wxadv_adv.i
// ----------------------------------------------------------------------------
%override wxLua_wxCalendarCtrl_HitTest
// wxCalendarHitTestResult HitTest(const wxPoint& pos) //, wxDateTime* date = NULL, wxDateTime::WeekDay* wd = NULL)
static int LUACALL wxLua_wxCalendarCtrl_HitTest(lua_State *L)
{
// const wxPoint pos
const wxPoint * pos = (const wxPoint *)wxluaT_getuserdatatype(L, 2, wxluatype_wxPoint);
// get this
wxCalendarCtrl * self = (wxCalendarCtrl *)wxluaT_getuserdatatype(L, 1, wxluatype_wxCalendarCtrl);
// call HitTest
wxDateTime* date = new wxDateTime();
wxDateTime::WeekDay wd = wxDateTime::Inv_WeekDay;
wxCalendarHitTestResult returns = self->HitTest(*pos, date, &wd);
// push the result number
lua_pushnumber(L, returns);
wxluaT_pushuserdatatype(L, date, wxluatype_wxDateTime);
lua_pushnumber(L, wd);
return 3;
}
%end
// ----------------------------------------------------------------------------
// Overrides for wxadv_grid.i
// ----------------------------------------------------------------------------
%override wxLua_wxGridCellAttr_GetAlignment
// void GetAlignment(int *horz, int *vert) const
static int LUACALL wxLua_wxGridCellAttr_GetAlignment(lua_State *L)
{
int horz;
int vert;
// get this
wxGridCellAttr *self = (wxGridCellAttr *)wxluaT_getuserdatatype(L, 1, wxluatype_wxGridCellAttr);
// call GetAlignment
self->GetAlignment(&horz, &vert);
lua_pushnumber(L, horz);
lua_pushnumber(L, vert);
// return the number of parameters
return 2;
}
%end
%override wxLua_wxGridCellAttr_GetSize
// void GetSize(int *num_rows, int *num_cols) const
static int LUACALL wxLua_wxGridCellAttr_GetSize(lua_State *L)
{
int num_rows;
int num_cols;
// get this
wxGridCellAttr *self = (wxGridCellAttr *)wxluaT_getuserdatatype(L, 1, wxluatype_wxGridCellAttr);
// call GetSize
self->GetSize(&num_rows, &num_cols);
lua_pushnumber(L, num_rows);
lua_pushnumber(L, num_cols);
// return the number of parameters
return 2;
}
%end
%override wxLua_wxGrid_GetRowLabelAlignment
// void GetRowLabelAlignment( int *horz, int *vert )
static int LUACALL wxLua_wxGrid_GetRowLabelAlignment(lua_State *L)
{
int vert;
int horz;
// get this
wxGrid *self = (wxGrid *)wxluaT_getuserdatatype(L, 1, wxluatype_wxGrid);
// call GetRowLabelAlignment
self->GetRowLabelAlignment(&horz, &vert);
// push results
lua_pushnumber(L, horz);
lua_pushnumber(L, vert);
// return the number of parameters
return 2;
}
%end
%override wxLua_wxGrid_GetColLabelAlignment
// void GetColLabelAlignment( int *horz, int *vert )
static int LUACALL wxLua_wxGrid_GetColLabelAlignment(lua_State *L)
{
int vert;
int horz;
// get this
wxGrid *self = (wxGrid *)wxluaT_getuserdatatype(L, 1, wxluatype_wxGrid);
// call GetColLabelAlignment
self->GetColLabelAlignment(&horz, &vert);
// push results
lua_pushnumber(L, horz);
lua_pushnumber(L, vert);
// return the number of parameters
return 2;
}
%end
%override wxLua_wxGrid_GetDefaultCellAlignment
// void GetDefaultCellAlignment( int *horiz, int *vert )
static int LUACALL wxLua_wxGrid_GetDefaultCellAlignment(lua_State *L)
{
int vert;
int horiz;
// get this
wxGrid *self = (wxGrid *)wxluaT_getuserdatatype(L, 1, wxluatype_wxGrid);
// call GetDefaultCellAlignment
self->GetDefaultCellAlignment(&horiz, &vert);
// push results
lua_pushnumber(L, horiz);
lua_pushnumber(L, vert);
// return the number of parameters
return 2;
}
%end
%override wxLua_wxGrid_GetCellAlignment
// void GetCellAlignment( int row, int col, int *horiz, int *vert )
static int LUACALL wxLua_wxGrid_GetCellAlignment(lua_State *L)
{
int vert;
int horiz;
// int col
int col = (int)lua_tonumber(L, 3);
// int row
int row = (int)lua_tonumber(L, 2);
// get this
wxGrid *self = (wxGrid *)wxluaT_getuserdatatype(L, 1, wxluatype_wxGrid);
// call GetCellAlignment
self->GetCellAlignment(row, col, &horiz, &vert);
// push results
lua_pushnumber(L, horiz);
lua_pushnumber(L, vert);
// return the number of parameters
return 2;
}
%end
%override wxLua_wxGrid_GetCellSize
// void GetCellSize( int row, int col, int *num_rows, int *num_cols )
static int LUACALL wxLua_wxGrid_GetCellSize(lua_State *L)
{
int num_rows;
int num_cols;
// int col
int col = (int)lua_tonumber(L, 3);
// int row
int row = (int)lua_tonumber(L, 2);
// get this
wxGrid *self = (wxGrid *)wxluaT_getuserdatatype(L, 1, wxluatype_wxGrid);
// call GetCellSize
self->GetCellSize(row, col, &num_rows, &num_cols);
// push results
lua_pushnumber(L, num_rows);
lua_pushnumber(L, num_cols);
// return the number of parameters
return 2;
}
%end
%override wxLua_wxGrid_GetTextBoxSize
// void GetTextBoxSize(wxDC& dc, wxArrayString& lines, long * width, long * height)
static int LUACALL wxLua_wxGrid_GetTextBoxSize(lua_State *L)
{
long height;
long width;
// wxArrayString& lines
wxArrayString *lines = (wxArrayString *)wxluaT_getuserdatatype(L, 3, wxluatype_wxArrayString);
// wxDC& dc
wxDC *dc = (wxDC *)wxluaT_getuserdatatype(L, 2, wxluatype_wxDC);
// get this
wxGrid *self = (wxGrid *)wxluaT_getuserdatatype(L, 1, wxluatype_wxGrid);
// call GetTextBoxSize
self->GetTextBoxSize(*dc, *lines, &width, &height);
lua_pushnumber(L, width);
lua_pushnumber(L, height);
// return the number of parameters
return 2;
}
%end
%override wxLua_wxGrid_SetTable
// bool SetTable(wxGridTableBase *table, bool takeOwnership = false,
// wxGrid::wxGridSelectionModes selmode =
// wxGrid::wxGridSelectCells)
static int LUACALL wxLua_wxGrid_SetTable(lua_State *L)
{
// get number of arguments
int argCount = lua_gettop(L);
// wxGrid::wxGridSelectionModes selmode = wxGrid::wxGridSelectCells
wxGrid::wxGridSelectionModes selmode = (argCount >= 4 ? (wxGrid::wxGridSelectionModes)wxlua_getenumtype(L, 4) : wxGrid::wxGridSelectCells);
// bool takeOwnership = false
bool takeOwnership = (argCount >= 3 ? wxlua_getbooleantype(L, 3) : false);
// wxGridTableBase table
wxGridTableBase * table = (wxGridTableBase *)wxluaT_getuserdatatype(L, 2, wxluatype_wxGridTableBase);
// get this
wxGrid * self = (wxGrid *)wxluaT_getuserdatatype(L, 1, wxluatype_wxGrid);
// call SetTable
bool returns = (self->SetTable(table, takeOwnership, selmode));
if (returns && takeOwnership)
{
// The wxGrid is now responsible for deleting it
if (wxluaO_isgcobject(L, table)) wxluaO_undeletegcobject(L, table);
}
// push the result flag
lua_pushboolean(L, returns);
return 1;
}
%end
%override wxLua_wxLuaGridTableBase_constructor
// wxLuaGridTableBase()
static int LUACALL wxLua_wxLuaGridTableBase_constructor(lua_State *L)
{
wxLuaState wxlState(L);
// call constructor
wxLuaGridTableBase *returns = new wxLuaGridTableBase(wxlState);
// add to tracked memory list
wxluaO_addgcobject(L, returns, wxluatype_wxLuaGridTableBase);
// push the constructed class pointer
wxluaT_pushuserdatatype(L, returns, wxluatype_wxLuaGridTableBase);
return 1;
}
%end
%override wxLua_wxGridCellWorker_delete_function
// delete is private in wxGridCellWorker, DecRef() it in derived classes
void wxLua_wxGridCellWorker_delete_function(void** p)
{
wxLua_wxGrid_DecRef_delete_function<wxGridCellWorker>(p);
}
%end
%override wxLua_wxGridCellRenderer_delete_function
// delete is private in wxGridCellWorker, DecRef() it in derived classes
void wxLua_wxGridCellRenderer_delete_function(void** p)
{
wxLua_wxGrid_DecRef_delete_function<wxGridCellRenderer>(p);
}
%end
%override wxLua_wxGridCellStringRenderer_delete_function
// delete is private in wxGridCellWorker, DecRef() it in derived classes
void wxLua_wxGridCellStringRenderer_delete_function(void** p)
{
wxLua_wxGrid_DecRef_delete_function<wxGridCellStringRenderer>(p);
}
%end
%override wxLua_wxGridCellNumberRenderer_delete_function
// delete is private in wxGridCellWorker, DecRef() it in derived classes
void wxLua_wxGridCellNumberRenderer_delete_function(void** p)
{
wxLua_wxGrid_DecRef_delete_function<wxGridCellNumberRenderer>(p);
}
%end
%override wxLua_wxGridCellFloatRenderer_delete_function
// delete is private in wxGridCellWorker, DecRef() it in derived classes
void wxLua_wxGridCellFloatRenderer_delete_function(void** p)
{
wxLua_wxGrid_DecRef_delete_function<wxGridCellFloatRenderer>(p);
}
%end
%override wxLua_wxGridCellBoolRenderer_delete_function
// delete is private in wxGridCellWorker, DecRef() it in derived classes
void wxLua_wxGridCellBoolRenderer_delete_function(void** p)
{
wxLua_wxGrid_DecRef_delete_function<wxGridCellBoolRenderer>(p);
}
%end
%override wxLua_wxGridCellDateTimeRenderer_delete_function
// delete is private in wxGridCellWorker, DecRef() it in derived classes
void wxLua_wxGridCellDateTimeRenderer_delete_function(void** p)
{
wxLua_wxGrid_DecRef_delete_function<wxGridCellDateTimeRenderer>(p);
}
%end
%override wxLua_wxGridCellEnumRenderer_delete_function
// delete is private in wxGridCellWorker, DecRef() it in derived classes
void wxLua_wxGridCellEnumRenderer_delete_function(void** p)
{
wxLua_wxGrid_DecRef_delete_function<wxGridCellEnumRenderer>(p);
}
%end
%override wxLua_wxGridCellAutoWrapStringRenderer_delete_function
// delete is private in wxGridCellWorker, DecRef() it in derived classes
void wxLua_wxGridCellAutoWrapStringRenderer_delete_function(void** p)
{
wxLua_wxGrid_DecRef_delete_function<wxGridCellAutoWrapStringRenderer>(p);
}
%end
%override wxLua_wxGridCellEditor_delete_function
// delete is private in wxGridCellWorker, DecRef() it in derived classes
void wxLua_wxGridCellEditor_delete_function(void** p)
{
wxLua_wxGrid_DecRef_delete_function<wxGridCellEditor>(p);
}
%end
%override wxLua_wxGridCellTextEditor_delete_function
// delete is private in wxGridCellWorker, DecRef() it in derived classes
void wxLua_wxGridCellTextEditor_delete_function(void** p)
{
wxLua_wxGrid_DecRef_delete_function<wxGridCellTextEditor>(p);
}
%end
%override wxLua_wxGridCellNumberEditor_delete_function
// delete is private in wxGridCellWorker, DecRef() it in derived classes
void wxLua_wxGridCellNumberEditor_delete_function(void** p)
{
wxLua_wxGrid_DecRef_delete_function<wxGridCellNumberEditor>(p);
}
%end
%override wxLua_wxGridCellFloatEditor_delete_function
// delete is private in wxGridCellWorker, DecRef() it in derived classes
void wxLua_wxGridCellFloatEditor_delete_function(void** p)
{
wxLua_wxGrid_DecRef_delete_function<wxGridCellFloatEditor>(p);
}
%end
%override wxLua_wxGridCellBoolEditor_delete_function
// delete is private in wxGridCellWorker, DecRef() it in derived classes
void wxLua_wxGridCellBoolEditor_delete_function(void** p)
{
wxLua_wxGrid_DecRef_delete_function<wxGridCellBoolEditor>(p);
}
%end
%override wxLua_wxGridCellChoiceEditor_delete_function
// delete is private in wxGridCellWorker, DecRef() it in derived classes
void wxLua_wxGridCellChoiceEditor_delete_function(void** p)
{
wxLua_wxGrid_DecRef_delete_function<wxGridCellChoiceEditor>(p);
}
%end
%override wxLua_wxGridCellEnumEditor_delete_function
// delete is private in wxGridCellWorker, DecRef() it in derived classes
void wxLua_wxGridCellEnumEditor_delete_function(void** p)
{
wxLua_wxGrid_DecRef_delete_function<wxGridCellEnumEditor>(p);
}
%end
%override wxLua_wxGridCellAutoWrapStringEditor_delete_function
// delete is private in wxGridCellWorker, DecRef() it in derived classes
void wxLua_wxGridCellAutoWrapStringEditor_delete_function(void** p)
{
wxLua_wxGrid_DecRef_delete_function<wxGridCellAutoWrapStringEditor>(p);
}
%end
%override wxLua_wxGridCellAttr_delete_function
// delete is private in wxGridCellWorker, DecRef() it in derived classes
void wxLua_wxGridCellAttr_delete_function(void** p)
{
wxLua_wxGrid_DecRef_delete_function<wxGridCellAttr>(p);
}
%end
| 32.160714 | 143 | 0.728405 | GCourtney27 |
1f19e3f75f05d2012443307520d50a3a1c4cd878 | 50,130 | cpp | C++ | admin/wmi/wbem/providers/ping/dll/pingquery.cpp | npocmaka/Windows-Server-2003 | 5c6fe3db626b63a384230a1aa6b92ac416b0765f | [
"Unlicense"
] | 17 | 2020-11-13T13:42:52.000Z | 2021-09-16T09:13:13.000Z | admin/wmi/wbem/providers/ping/dll/pingquery.cpp | sancho1952007/Windows-Server-2003 | 5c6fe3db626b63a384230a1aa6b92ac416b0765f | [
"Unlicense"
] | 2 | 2020-10-19T08:02:06.000Z | 2020-10-19T08:23:18.000Z | admin/wmi/wbem/providers/ping/dll/pingquery.cpp | sancho1952007/Windows-Server-2003 | 5c6fe3db626b63a384230a1aa6b92ac416b0765f | [
"Unlicense"
] | 14 | 2020-11-14T09:43:20.000Z | 2021-08-28T08:59:57.000Z | /******************************************************************
pingquery.CPP
Copyright (c) 2000-2001 Microsoft Corporation, All Rights Reserved
Description:
******************************************************************/
#include <stdafx.h>
#include <ntddtcp.h>
#include <ipinfo.h>
#include <tdiinfo.h>
#include <winsock2.h>
#include <provimex.h>
#include <provexpt.h>
#include <provtempl.h>
#include <provmt.h>
#include <typeinfo.h>
#include <provcont.h>
#include <provevt.h>
#include <provthrd.h>
#include <provlog.h>
#include <provval.h>
#include <provtype.h>
#include <provtree.h>
#include <provdnf.h>
#include <winsock.h>
#include "ipexport.h"
#include "icmpapi.h"
#include ".\res_str.h"
#include <Allocator.h>
#include <Thread.h>
#include <HashTable.h>
#include <PingProv.h>
#include <Pingtask.h>
#include <Pingfac.h>
CPingQueryAsync::CPingQueryAsync (CPingProvider *a_Provider ,
BSTR a_QueryFormat ,
BSTR a_Query ,
ULONG a_Flag ,
IWbemObjectSink *a_NotificationHandler ,
IWbemContext *a_Ctx
) : m_QueryFormat(NULL),
m_Query(NULL),
CPingTaskObject (a_Provider, a_NotificationHandler, a_Ctx)
{
if (a_QueryFormat != NULL)
{
int t_len = wcslen(a_QueryFormat);
if (t_len > 0)
{
m_QueryFormat = new WCHAR[t_len+1];
m_QueryFormat[t_len] = L'\0';
wcsncpy(m_QueryFormat, a_QueryFormat, t_len);
}
}
if (a_Query != NULL)
{
int t_len = wcslen(a_Query);
if (t_len > 0)
{
m_Query = new WCHAR[t_len+1];
m_Query[t_len] = L'\0';
wcsncpy(m_Query, a_Query, t_len);
}
}
}
CPingQueryAsync::~CPingQueryAsync ()
{
if (m_Query != NULL)
{
delete [] m_Query ;
}
if (m_QueryFormat != NULL)
{
delete [] m_QueryFormat ;
}
}
QueryPreprocessor :: QuadState CPingQueryAsync :: Compare (
LONG a_Operand1 ,
LONG a_Operand2 ,
ULONG a_Operand1Func ,
ULONG a_Operand2Func ,
WmiTreeNode &a_OperatorType
)
{
QueryPreprocessor :: QuadState t_Status = QueryPreprocessor :: QuadState :: State_True ;
switch ( a_Operand1Func )
{
case WmiValueNode :: WmiValueFunction :: Function_None:
{
}
break ;
default:
{
}
break ;
}
switch ( a_Operand2Func )
{
case WmiValueNode :: WmiValueFunction :: Function_None:
{
}
break ;
default:
{
}
break ;
}
if ( typeid ( a_OperatorType ) == typeid ( WmiOperatorEqualNode ) )
{
t_Status = a_Operand1 == a_Operand2
? QueryPreprocessor :: QuadState :: State_True
: QueryPreprocessor :: QuadState :: State_False ;
}
else if ( typeid ( a_OperatorType ) == typeid ( WmiOperatorNotEqualNode ) )
{
t_Status = a_Operand1 != a_Operand2
? QueryPreprocessor :: QuadState :: State_True
: QueryPreprocessor :: QuadState :: State_False ;
}
else if ( typeid ( a_OperatorType ) == typeid ( WmiOperatorEqualOrGreaterNode ) )
{
t_Status = a_Operand1 >= a_Operand2
? QueryPreprocessor :: QuadState :: State_True
: QueryPreprocessor :: QuadState :: State_False ;
}
else if ( typeid ( a_OperatorType ) == typeid ( WmiOperatorEqualOrLessNode ) )
{
t_Status = a_Operand1 <= a_Operand2
? QueryPreprocessor :: QuadState :: State_True
: QueryPreprocessor :: QuadState :: State_False ;
}
else if ( typeid ( a_OperatorType ) == typeid ( WmiOperatorLessNode ) )
{
t_Status = a_Operand1 < a_Operand2
? QueryPreprocessor :: QuadState :: State_True
: QueryPreprocessor :: QuadState :: State_False ;
}
else if ( typeid ( a_OperatorType ) == typeid ( WmiOperatorGreaterNode ) )
{
t_Status = a_Operand1 > a_Operand2
? QueryPreprocessor :: QuadState :: State_True
: QueryPreprocessor :: QuadState :: State_False ;
}
else if ( typeid ( a_OperatorType ) == typeid ( WmiOperatorLikeNode ) )
{
}
else if ( typeid ( a_OperatorType ) == typeid ( WmiOperatorNotLikeNode ) )
{
}
return t_Status ;
}
QueryPreprocessor :: QuadState CPingQueryAsync :: Compare (
wchar_t *a_Operand1 ,
wchar_t *a_Operand2 ,
ULONG a_Operand1Func ,
ULONG a_Operand2Func ,
WmiTreeNode &a_OperatorType
)
{
QueryPreprocessor :: QuadState t_Status = QueryPreprocessor :: QuadState :: State_True ;
wchar_t *a_Operand1AfterFunc = NULL ;
wchar_t *a_Operand2AfterFunc = NULL ;
switch ( a_Operand1Func )
{
case WmiValueNode :: WmiValueFunction :: Function_None:
{
}
break ;
case WmiValueNode :: WmiValueFunction :: Function_Upper:
{
ULONG length = wcslen ( a_Operand1 ) ;
wchar_t *a_Operand1AfterFunc = new wchar_t [ length + 1 ] ;
for ( ULONG index = 0 ; index < length ; index ++ )
{
a_Operand1AfterFunc [ index ] = towupper ( a_Operand1 [ index ] ) ;
}
}
break ;
case WmiValueNode :: WmiValueFunction :: Function_Lower:
{
ULONG length = wcslen ( a_Operand1 ) ;
wchar_t *a_Operand1AfterFunc = new wchar_t [ length + 1 ] ;
for ( ULONG index = 0 ; index < length ; index ++ )
{
a_Operand1AfterFunc [ index ] = towlower ( a_Operand1 [ index ] ) ;
}
}
break ;
default:
{
}
break ;
}
switch ( a_Operand2Func )
{
case WmiValueNode :: WmiValueFunction :: Function_None:
{
}
break ;
case WmiValueNode :: WmiValueFunction :: Function_Upper:
{
ULONG length = wcslen ( a_Operand2 ) ;
wchar_t *a_Operand2AfterFunc = new wchar_t [ length + 1 ] ;
for ( ULONG index = 0 ; index < length ; index ++ )
{
a_Operand2AfterFunc [ index ] = towupper ( a_Operand2 [ index ] ) ;
}
}
break ;
case WmiValueNode :: WmiValueFunction :: Function_Lower:
{
ULONG length = wcslen ( a_Operand2 ) ;
wchar_t *a_Operand2AfterFunc = new wchar_t [ length + 1 ] ;
for ( ULONG index = 0 ; index < length ; index ++ )
{
a_Operand2AfterFunc [ index ] = towlower ( a_Operand2 [ index ] ) ;
}
}
break ;
default:
{
}
break ;
}
const wchar_t *t_Arg1 = a_Operand1AfterFunc ? a_Operand1AfterFunc : a_Operand1 ;
const wchar_t *t_Arg2 = a_Operand2AfterFunc ? a_Operand2AfterFunc : a_Operand2 ;
if ( typeid ( a_OperatorType ) == typeid ( WmiOperatorEqualNode ) )
{
if ( ( t_Arg1 ) && ( t_Arg2 ) )
{
t_Status = wcscmp ( t_Arg1 , t_Arg2 ) == 0
? QueryPreprocessor :: QuadState :: State_True
: QueryPreprocessor :: QuadState :: State_False ;
}
else
{
if ( ( t_Arg1 ) || ( t_Arg2 ) )
{
t_Status = QueryPreprocessor :: QuadState :: State_False ;
}
else
{
t_Status = QueryPreprocessor :: QuadState :: State_True ;
}
}
}
else if ( typeid ( a_OperatorType ) == typeid ( WmiOperatorNotEqualNode ) )
{
if ( ( t_Arg1 ) && ( t_Arg2 ) )
{
t_Status = wcscmp ( t_Arg1 , t_Arg2 ) != 0
? QueryPreprocessor :: QuadState :: State_True
: QueryPreprocessor :: QuadState :: State_False ;
}
else
{
if ( ( t_Arg1 ) || ( t_Arg2 ) )
{
t_Status = QueryPreprocessor :: QuadState :: State_True ;
}
else
{
t_Status = QueryPreprocessor :: QuadState :: State_False ;
}
}
}
else if ( typeid ( a_OperatorType ) == typeid ( WmiOperatorEqualOrGreaterNode ) )
{
if ( ( t_Arg1 ) && ( t_Arg2 ) )
{
t_Status = wcscmp ( t_Arg1 , t_Arg2 ) >= 0
? QueryPreprocessor :: QuadState :: State_True
: QueryPreprocessor :: QuadState :: State_False ;
}
else
{
if ( t_Arg1 )
{
t_Status = QueryPreprocessor :: QuadState :: State_True ;
}
else
{
if ( t_Arg2 )
{
t_Status = QueryPreprocessor :: QuadState :: State_False ;
}
else
{
t_Status = QueryPreprocessor :: QuadState :: State_True ;
}
}
}
}
else if ( typeid ( a_OperatorType ) == typeid ( WmiOperatorEqualOrLessNode ) )
{
if ( ( t_Arg1 ) && ( t_Arg2 ) )
{
t_Status = wcscmp ( t_Arg1 , t_Arg2 ) <= 0
? QueryPreprocessor :: QuadState :: State_True
: QueryPreprocessor :: QuadState :: State_False ;
}
else
{
if ( ( t_Arg1 ) )
{
t_Status = QueryPreprocessor :: QuadState :: State_False ;
}
else
{
if ( t_Arg2 )
{
t_Status = QueryPreprocessor :: QuadState :: State_True ;
}
else
{
t_Status = QueryPreprocessor :: QuadState :: State_True ;
}
}
}
}
else if ( typeid ( a_OperatorType ) == typeid ( WmiOperatorLessNode ) )
{
if ( ( t_Arg1 ) && ( t_Arg2 ) )
{
t_Status = wcscmp ( t_Arg1 , t_Arg2 ) < 0
? QueryPreprocessor :: QuadState :: State_True
: QueryPreprocessor :: QuadState :: State_False ;
}
else
{
if ( ( ! t_Arg1 ) && ( ! t_Arg2 ) )
{
t_Status = QueryPreprocessor :: QuadState :: State_False ;
}
else if ( t_Arg1 )
{
t_Status = QueryPreprocessor :: QuadState :: State_False ;
}
else
{
t_Status = QueryPreprocessor :: QuadState :: State_True ;
}
}
}
else if ( typeid ( a_OperatorType ) == typeid ( WmiOperatorGreaterNode ) )
{
if ( ( t_Arg1 ) && ( t_Arg2 ) )
{
t_Status = wcscmp ( t_Arg1 , t_Arg2 ) > 0
? QueryPreprocessor :: QuadState :: State_True
: QueryPreprocessor :: QuadState :: State_False ;
}
else
{
if ( ( ! t_Arg1 ) && ( ! t_Arg2 ) )
{
t_Status = QueryPreprocessor :: QuadState :: State_False ;
}
else if ( t_Arg1 )
{
t_Status = QueryPreprocessor :: QuadState :: State_True ;
}
else
{
t_Status = QueryPreprocessor :: QuadState :: State_False ;
}
}
}
else if ( typeid ( a_OperatorType ) == typeid ( WmiOperatorLikeNode ) )
{
}
else if ( typeid ( a_OperatorType ) == typeid ( WmiOperatorNotLikeNode ) )
{
}
delete [] a_Operand1AfterFunc ;
delete [] a_Operand2AfterFunc ;
return t_Status ;
}
QueryPreprocessor :: QuadState CPingQueryAsync :: CompareString (
IWbemClassObject *a_ClassObject ,
BSTR a_PropertyName ,
WmiTreeNode *a_Operator ,
WmiTreeNode *a_Operand
)
{
QueryPreprocessor :: QuadState t_Status = QueryPreprocessor :: QuadState :: State_True ;
WmiStringNode *t_StringNode = ( WmiStringNode * ) a_Operand ;
VARIANT t_Variant ;
VariantInit ( & t_Variant ) ;
HRESULT t_Result = a_ClassObject->Get ( a_PropertyName , 0 , &t_Variant , NULL , NULL ) ;
if ( SUCCEEDED ( t_Result ) )
{
t_Status = Compare (
t_StringNode->GetValue () ,
t_Variant.bstrVal ,
t_StringNode->GetPropertyFunction () ,
t_StringNode->GetConstantFunction () ,
*a_Operator
) ;
}
VariantClear ( & t_Variant ) ;
return t_Status ;
}
QueryPreprocessor :: QuadState CPingQueryAsync :: CompareInteger (
IWbemClassObject *a_ClassObject ,
BSTR a_PropertyName ,
WmiTreeNode *a_Operator ,
WmiTreeNode *a_Operand
)
{
QueryPreprocessor :: QuadState t_Status = QueryPreprocessor :: QuadState :: State_True ;
WmiSignedIntegerNode *t_IntegerNode = ( WmiSignedIntegerNode * ) a_Operand ;
VARIANT t_Variant ;
VariantInit ( & t_Variant ) ;
HRESULT t_Result = a_ClassObject->Get ( a_PropertyName , 0 , &t_Variant , NULL , NULL ) ;
if ( SUCCEEDED ( t_Result ) )
{
t_Status = Compare (
t_IntegerNode->GetValue () ,
t_Variant.lVal ,
t_IntegerNode->GetPropertyFunction () ,
t_IntegerNode->GetConstantFunction () ,
*a_Operator
) ;
}
VariantClear ( & t_Variant ) ;
return t_Status ;
}
WmiTreeNode *CPingQueryAsync :: AllocTypeNode (
void *a_Context ,
BSTR a_PropertyName ,
VARIANT &a_Variant ,
WmiValueNode :: WmiValueFunction a_PropertyFunction ,
WmiValueNode :: WmiValueFunction a_ConstantFunction ,
WmiTreeNode *a_Parent
)
{
WmiTreeNode *t_Node = NULL ;
VARTYPE t_VarType = VT_NULL ;
if ( *a_PropertyName == L'_' )
{
// System property
if ( _wcsicmp ( a_PropertyName , SYSTEM_PROPERTY_CLASS ) == 0 &&
(V_VT(&a_Variant) == VT_BSTR))
{
t_Node = new WmiStringNode (
a_PropertyName ,
a_Variant.bstrVal ,
a_PropertyFunction ,
a_ConstantFunction ,
0xFFFFFFFF ,
a_Parent
) ;
}
else if ( _wcsicmp ( a_PropertyName , SYSTEM_PROPERTY_SUPERCLASS ) == 0 &&
(V_VT(&a_Variant) == VT_BSTR))
{
t_Node = new WmiStringNode (
a_PropertyName ,
a_Variant.bstrVal ,
a_PropertyFunction ,
a_ConstantFunction ,
0xFFFFFFFF ,
a_Parent
) ;
}
else if ( _wcsicmp ( a_PropertyName , SYSTEM_PROPERTY_GENUS ) == 0 &&
(V_VT(&a_Variant) == VT_I4))
{
t_Node = new WmiSignedIntegerNode (
a_PropertyName ,
a_Variant.lVal ,
0xFFFFFFFF ,
a_Parent
) ;
}
else if ( _wcsicmp ( a_PropertyName , SYSTEM_PROPERTY_SERVER ) == 0 &&
(V_VT(&a_Variant) == VT_BSTR))
{
t_Node = new WmiStringNode (
a_PropertyName ,
a_Variant.bstrVal ,
a_PropertyFunction ,
a_ConstantFunction ,
0xFFFFFFFF ,
a_Parent
) ;
}
else if ( _wcsicmp ( a_PropertyName , SYSTEM_PROPERTY_NAMESPACE ) == 0 &&
(V_VT(&a_Variant) == VT_BSTR))
{
t_Node = new WmiStringNode (
a_PropertyName ,
a_Variant.bstrVal ,
a_PropertyFunction ,
a_ConstantFunction ,
0xFFFFFFFF ,
a_Parent
) ;
}
else if ( _wcsicmp ( a_PropertyName , SYSTEM_PROPERTY_PROPERTY_COUNT ) == 0 &&
(V_VT(&a_Variant) == VT_I4))
{
t_Node = new WmiSignedIntegerNode (
a_PropertyName ,
a_Variant.lVal ,
0xFFFFFFFF ,
a_Parent
) ;
}
else if ( _wcsicmp ( a_PropertyName , SYSTEM_PROPERTY_DYNASTY ) == 0 &&
(V_VT(&a_Variant) == VT_BSTR))
{
t_Node = new WmiStringNode (
a_PropertyName ,
a_Variant.bstrVal ,
a_PropertyFunction ,
a_ConstantFunction ,
0xFFFFFFFF ,
a_Parent
) ;
}
else if ( _wcsicmp ( a_PropertyName , SYSTEM_PROPERTY_RELPATH ) == 0 &&
(V_VT(&a_Variant) == VT_BSTR))
{
t_Node = new WmiStringNode (
a_PropertyName ,
a_Variant.bstrVal ,
a_PropertyFunction ,
a_ConstantFunction ,
0xFFFFFFFF ,
a_Parent
) ;
}
else if ( _wcsicmp ( a_PropertyName , SYSTEM_PROPERTY_PATH ) == 0 &&
(V_VT(&a_Variant) == VT_BSTR))
{
t_Node = new WmiStringNode (
a_PropertyName ,
a_Variant.bstrVal ,
a_PropertyFunction ,
a_ConstantFunction ,
0xFFFFFFFF ,
a_Parent
) ;
}
else if ( _wcsicmp ( a_PropertyName , SYSTEM_PROPERTY_DERIVATION ) == 0 )
{
}
}
else
{
IWbemClassObject *t_Object = NULL ;
HRESULT t_Result = GetClassObject ( &t_Object ) ? WBEM_S_NO_ERROR : WBEM_E_FAILED ;
if ( SUCCEEDED ( t_Result ) )
{
CIMTYPE t_VarType ;
long t_Flavour ;
VARIANT t_Variant ;
VariantInit ( & t_Variant ) ;
t_Result = t_Object->Get (
a_PropertyName ,
0 ,
& t_Variant ,
& t_VarType ,
& t_Flavour
);
if ( SUCCEEDED ( t_Result ) )
{
if ( t_VarType & CIM_FLAG_ARRAY )
{
}
else
{
switch ( t_VarType & ( ~ CIM_FLAG_ARRAY ) )
{
case CIM_BOOLEAN:
{
if(V_VT(&a_Variant) == VT_I4)
{
t_Node = new WmiSignedIntegerNode (
a_PropertyName ,
a_Variant.lVal ,
GetPriority ( a_PropertyName ) ,
a_Parent
) ;
}
else if (V_VT(&a_Variant) == VT_BOOL)
{
t_Node = new WmiSignedIntegerNode (
a_PropertyName ,
(a_Variant.lVal == VARIANT_FALSE) ? 0 : 1,
GetPriority ( a_PropertyName ) ,
a_Parent
) ;
}
else if (V_VT(&a_Variant) == VT_NULL)
{
t_Node = new WmiNullNode (
a_PropertyName ,
GetPriority ( a_PropertyName ) ,
a_Parent
);
}
}
break ;
case CIM_SINT8:
case CIM_SINT16:
case CIM_CHAR16:
case CIM_SINT32:
{
if(V_VT(&a_Variant) == VT_I4)
{
t_Node = new WmiSignedIntegerNode (
a_PropertyName ,
a_Variant.lVal ,
GetPriority ( a_PropertyName ) ,
a_Parent
) ;
}
else if (V_VT(&a_Variant) == VT_NULL)
{
t_Node = new WmiNullNode (
a_PropertyName ,
GetPriority ( a_PropertyName ) ,
a_Parent
);
}
}
break ;
case CIM_UINT8:
case CIM_UINT16:
case CIM_UINT32:
{
if(V_VT(&a_Variant) == VT_I4)
{
t_Node = new WmiUnsignedIntegerNode (
a_PropertyName ,
a_Variant.lVal ,
GetPriority ( a_PropertyName ) ,
a_Parent
) ;
}
else if (V_VT(&a_Variant) == VT_NULL)
{
t_Node = new WmiNullNode (
a_PropertyName ,
GetPriority ( a_PropertyName ) ,
a_Parent
);
}
}
break ;
case CIM_SINT64:
case CIM_UINT64:
{
if(V_VT(&a_Variant) == VT_BSTR)
{
t_Node = new WmiStringNode (
a_PropertyName ,
a_Variant.bstrVal ,
a_PropertyFunction ,
a_ConstantFunction ,
GetPriority ( a_PropertyName ) ,
a_Parent
) ;
}
else if(V_VT(&a_Variant) == VT_I4)
{
_variant_t t_uintBuff (&a_Variant);
t_Node = new WmiStringNode (
a_PropertyName ,
(BSTR)((_bstr_t) t_uintBuff),
a_PropertyFunction ,
a_ConstantFunction ,
GetPriority ( a_PropertyName ) ,
a_Parent
) ;
}
else if (V_VT(&a_Variant) == VT_NULL)
{
t_Node = new WmiNullNode (
a_PropertyName ,
GetPriority ( a_PropertyName ) ,
a_Parent
);
}
}
break ;
case CIM_STRING:
case CIM_DATETIME:
case CIM_REFERENCE:
{
if(V_VT(&a_Variant) == VT_BSTR)
{
t_Node = new WmiStringNode (
a_PropertyName ,
a_Variant.bstrVal ,
a_PropertyFunction ,
a_ConstantFunction ,
GetPriority ( a_PropertyName ) ,
a_Parent
) ;
}
else if (V_VT(&a_Variant) == VT_NULL)
{
t_Node = new WmiNullNode (
a_PropertyName ,
GetPriority ( a_PropertyName ) ,
a_Parent
);
}
}
break ;
case CIM_REAL32:
case CIM_REAL64:
{
}
break ;
case CIM_OBJECT:
case CIM_EMPTY:
{
}
break ;
default:
{
}
break ;
}
}
}
t_Object->Release () ;
VariantClear ( & t_Variant ) ;
}
}
return t_Node ;
}
QueryPreprocessor :: QuadState CPingQueryAsync :: InvariantEvaluate (
void *a_Context ,
WmiTreeNode *a_Operator ,
WmiTreeNode *a_Operand
)
{
/*
* If property and value are invariant i.e. will never change for all instances then return State_True.
* If property is not indexable or keyed then return State_True to define an unknown number of possible values which we cannot optimise against.
* If property and value can never occur then return State_False to imply empty set
* If property and value do not infer anything then return State_Undefined.
* If property and value are in error then return State_Error
* Never return State_ReEvaluate.
*/
QueryPreprocessor :: QuadState t_State = QueryPreprocessor :: QuadState :: State_Error ;
IWbemClassObject *t_Object = NULL ;
HRESULT t_Result = GetClassObject ( &t_Object ) ? WBEM_S_NO_ERROR : WBEM_E_FAILED ;
if ( SUCCEEDED ( t_Result ) )
{
WmiValueNode *t_Node = ( WmiValueNode * ) a_Operand ;
BSTR t_PropertyName = t_Node->GetPropertyName () ;
if ( t_PropertyName != NULL )
{
if ( *t_PropertyName == L'_' )
{
// System property, must check values
if ( _wcsicmp ( t_PropertyName , SYSTEM_PROPERTY_CLASS ) == 0 )
{
t_State = CompareString (
t_Object ,
SYSTEM_PROPERTY_CLASS ,
a_Operator ,
a_Operand
) ;
}
else if ( _wcsicmp ( t_PropertyName , SYSTEM_PROPERTY_SUPERCLASS ) == 0 )
{
t_State = CompareString (
t_Object ,
SYSTEM_PROPERTY_SUPERCLASS ,
a_Operator ,
a_Operand
) ;
}
else if ( _wcsicmp ( t_PropertyName , SYSTEM_PROPERTY_GENUS ) == 0 )
{
t_State = CompareInteger (
t_Object ,
SYSTEM_PROPERTY_GENUS ,
a_Operator ,
a_Operand
) ;
}
else if ( _wcsicmp ( t_PropertyName , SYSTEM_PROPERTY_SERVER ) == 0 )
{
t_State = CompareString (
t_Object ,
SYSTEM_PROPERTY_SERVER ,
a_Operator ,
a_Operand
) ;
}
else if ( _wcsicmp ( t_PropertyName , SYSTEM_PROPERTY_NAMESPACE ) == 0 )
{
t_State = CompareString (
t_Object ,
SYSTEM_PROPERTY_NAMESPACE ,
a_Operator ,
a_Operand
) ;
}
else if ( _wcsicmp ( t_PropertyName , SYSTEM_PROPERTY_PROPERTY_COUNT ) == 0 )
{
t_State = CompareInteger (
t_Object ,
SYSTEM_PROPERTY_PROPERTY_COUNT ,
a_Operator ,
a_Operand
) ;
}
else if ( _wcsicmp ( t_PropertyName , SYSTEM_PROPERTY_DYNASTY ) == 0 )
{
t_State = CompareString (
t_Object ,
SYSTEM_PROPERTY_DYNASTY ,
a_Operator ,
a_Operand
) ;
}
else if ( _wcsicmp ( t_PropertyName , SYSTEM_PROPERTY_RELPATH ) == 0 )
{
t_State = CompareString (
t_Object ,
SYSTEM_PROPERTY_RELPATH ,
a_Operator ,
a_Operand
) ;
}
else if ( _wcsicmp ( t_PropertyName , SYSTEM_PROPERTY_PATH ) == 0 )
{
t_State = CompareString (
t_Object ,
SYSTEM_PROPERTY_PATH ,
a_Operator ,
a_Operand
) ;
}
else if ( _wcsicmp ( t_PropertyName , SYSTEM_PROPERTY_DERIVATION ) == 0 )
{
t_State = QueryPreprocessor :: QuadState :: State_Undefined ;
}
else
{
t_State = QueryPreprocessor :: QuadState :: State_Undefined ;
}
}
else
{
if ( typeid ( *a_Operand ) == typeid ( WmiNullNode ) )
{
t_State = QueryPreprocessor :: QuadState :: State_True ;
}
else
{
t_State = QueryPreprocessor :: QuadState :: State_Undefined ;
}
#if 0
else if ( typeid ( *a_Operand ) == typeid ( WmiStringNode ) )
{
t_State = QueryPreprocessor :: QuadState :: State_Undefined ;
}
else if ( typeid ( *a_Operand ) == typeid ( WmiUnsignedIntegerNode ) )
{
t_State = QueryPreprocessor :: QuadState :: State_Undefined ;
}
else if ( typeid ( *a_Operand ) == typeid ( WmiSignedIntegerNode ) )
{
t_State = QueryPreprocessor :: QuadState :: State_Undefined ;
}
if ( typeid ( *a_Operator ) == typeid ( WmiOperatorEqualNode ) )
{
t_State = QueryPreprocessor :: QuadState :: State_Undefined ;
}
else if ( typeid ( *a_Operator ) == typeid ( WmiOperatorNotEqualNode ) )
{
t_State = QueryPreprocessor :: QuadState :: State_Undefined ;
}
else if ( typeid ( *a_Operator ) == typeid ( WmiOperatorEqualOrGreaterNode ) )
{
t_State = QueryPreprocessor :: QuadState :: State_Undefined ;
}
else if ( typeid ( *a_Operator ) == typeid ( WmiOperatorEqualOrLessNode ) )
{
t_State = QueryPreprocessor :: QuadState :: State_Undefined ;
}
else if ( typeid ( *a_Operator ) == typeid ( WmiOperatorLessNode ) )
{
t_State = QueryPreprocessor :: QuadState :: State_Undefined ;
}
else if ( typeid ( *a_Operator ) == typeid ( WmiOperatorGreaterNode ) )
{
t_State = QueryPreprocessor :: QuadState :: State_Undefined ;
}
else if ( typeid ( *a_Operator ) == typeid ( WmiOperatorLikeNode ) )
{
t_State = QueryPreprocessor :: QuadState :: State_Undefined ;
}
else if ( typeid ( *a_Operator ) == typeid ( WmiOperatorNotLikeNode ) )
{
t_State = QueryPreprocessor :: QuadState :: State_Undefined ;
}
#endif
}
}
else
{
t_State = QueryPreprocessor :: QuadState :: State_Undefined;
}
t_Object->Release () ;
}
return t_State ;
}
WmiRangeNode *CPingQueryAsync :: AllocInfiniteRangeNode (
void *a_Context ,
BSTR a_PropertyName
)
{
WmiRangeNode *t_RangeNode = NULL ;
IWbemClassObject *t_Object = NULL ;
HRESULT t_Result = GetClassObject ( &t_Object ) ? WBEM_S_NO_ERROR : WBEM_E_FAILED ;
if ( SUCCEEDED ( t_Result ) )
{
CIMTYPE t_VarType ;
long t_Flavour ;
VARIANT t_Variant ;
VariantInit ( & t_Variant ) ;
HRESULT t_Result = t_Object->Get (
a_PropertyName ,
0 ,
& t_Variant ,
& t_VarType ,
& t_Flavour
);
if ( SUCCEEDED ( t_Result ) )
{
if ( t_VarType & CIM_FLAG_ARRAY )
{
}
else
{
switch ( t_VarType & ( ~ CIM_FLAG_ARRAY ) )
{
case CIM_BOOLEAN:
case CIM_SINT8:
case CIM_SINT16:
case CIM_CHAR16:
case CIM_SINT32:
{
t_RangeNode = new WmiSignedIntegerRangeNode (
a_PropertyName ,
0xFFFFFFFF ,
TRUE ,
TRUE ,
FALSE ,
FALSE ,
0 ,
0 ,
NULL ,
NULL
) ;
}
break ;
case CIM_UINT8:
case CIM_UINT16:
case CIM_UINT32:
{
t_RangeNode = new WmiUnsignedIntegerRangeNode (
a_PropertyName ,
0xFFFFFFFF ,
TRUE ,
TRUE ,
FALSE ,
FALSE ,
0 ,
0 ,
NULL ,
NULL
) ;
}
break ;
case CIM_SINT64:
case CIM_UINT64:
case CIM_STRING:
case CIM_DATETIME:
case CIM_REFERENCE:
{
t_RangeNode = new WmiStringRangeNode (
a_PropertyName ,
0x0 ,
TRUE ,
TRUE ,
FALSE ,
FALSE ,
NULL ,
NULL ,
NULL ,
NULL
) ;
}
break ;
case CIM_REAL32:
case CIM_REAL64:
{
}
break ;
case CIM_OBJECT:
case CIM_EMPTY:
{
}
break ;
default:
{
}
break ;
}
}
}
t_Object->Release () ;
VariantClear ( & t_Variant ) ;
}
return t_RangeNode ;
}
ULONG CPingQueryAsync :: GetPriority ( BSTR a_PropertyName )
{
if ( _wcsicmp ( a_PropertyName , Ping_Address ) == 0 )
{
return 0 ;
}
if ( _wcsicmp ( a_PropertyName , Ping_Timeout ) == 0 )
{
return 1 ;
}
if ( _wcsicmp ( a_PropertyName , Ping_TimeToLive ) == 0 )
{
return 2 ;
}
if ( _wcsicmp ( a_PropertyName , Ping_BufferSize ) == 0 )
{
return 3 ;
}
if ( _wcsicmp ( a_PropertyName , Ping_NoFragmentation ) == 0 )
{
return 4 ;
}
if ( _wcsicmp ( a_PropertyName , Ping_TypeofService ) == 0 )
{
return 5 ;
}
if ( _wcsicmp ( a_PropertyName , Ping_RecordRoute ) == 0 )
{
return 6 ;
}
if ( _wcsicmp ( a_PropertyName , Ping_TimestampRoute ) == 0 )
{
return 7 ;
}
if ( _wcsicmp ( a_PropertyName , Ping_SourceRouteType ) == 0 )
{
return 8 ;
}
if ( _wcsicmp ( a_PropertyName , Ping_SourceRoute ) == 0 )
{
return 9 ;
}
if ( _wcsicmp ( a_PropertyName , Ping_ResolveAddressNames ) == 0 )
{
return 10 ;
}
return 0xFFFFFFFF ;
}
HRESULT CPingQueryAsync :: RecurseAddress (
void *pMethodContext,
PartitionSet *a_PartitionSet
)
{
HRESULT t_Result = WBEM_E_FAILED ;
ULONG t_PartitionCount = a_PartitionSet->GetPartitionCount () ;
if (t_PartitionCount == 0)
{
t_Result = S_OK ;
}
for ( ulong t_Partition = 0 ; t_Partition < t_PartitionCount ; t_Partition ++ )
{
PartitionSet *t_PropertyPartition = a_PartitionSet->GetPartition ( t_Partition ) ;
WmiStringRangeNode *t_Node = ( WmiStringRangeNode * ) t_PropertyPartition->GetRange () ;
BOOL t_Unique = ! t_Node->InfiniteLowerBound () &&
! t_Node->InfiniteUpperBound () &&
t_Node->ClosedLowerBound () &&
t_Node->ClosedUpperBound () &&
( wcscmp ( t_Node->LowerBound () , t_Node->UpperBound () ) == 0 ) ;
if ( ! t_Unique )
{
SetErrorInfo(IDS_QUERY_ADDR,
WBEM_E_PROVIDER_NOT_CAPABLE ) ;
break ;
}
else
{
ULONG t_Address = 0 ;
ULONG t_ResolveErr = 0 ;
if ( FAILED ( Icmp_ResolveAddress ( t_Node->LowerBound () , t_Address , &t_ResolveErr ) ) && (t_ResolveErr == 0))
{
t_ResolveErr = WSAHOST_NOT_FOUND;
}
//if even one call succeeds return success
if (SUCCEEDED( RecurseTimeOut (pMethodContext ,
t_Node->LowerBound () ,
t_Address,
t_PropertyPartition,
t_ResolveErr)
&& FAILED (t_Result) ) )
{
t_Result = S_OK;
}
}
}
return t_Result ;
}
HRESULT CPingQueryAsync :: RecurseTimeOut (
void *pMethodContext,
wchar_t *a_AddressString ,
ULONG a_Address ,
PartitionSet *a_PartitionSet ,
ULONG a_ResolveError
)
{
HRESULT t_Result = WBEM_E_FAILED ;
ULONG t_PartitionCount = a_PartitionSet->GetPartitionCount () ;
for ( ulong t_Partition = 0 ; t_Partition < t_PartitionCount ; t_Partition ++ )
{
PartitionSet *t_PropertyPartition = a_PartitionSet->GetPartition ( t_Partition ) ;
WmiUnsignedIntegerRangeNode *t_Node = ( WmiUnsignedIntegerRangeNode * ) t_PropertyPartition->GetRange () ;
BOOL t_Unique = ! t_Node->InfiniteLowerBound () &&
! t_Node->InfiniteUpperBound () &&
t_Node->ClosedLowerBound () &&
t_Node->ClosedUpperBound () &&
( t_Node->LowerBound () == t_Node->UpperBound () ) ;
BOOL t_UnSpecified = t_Node->InfiniteLowerBound () && t_Node->InfiniteUpperBound () ;
if ( ! t_Unique && ! t_UnSpecified )
{
SetErrorInfo(IDS_QUERY_TO,
WBEM_E_PROVIDER_NOT_CAPABLE ) ;
break ;
}
else
{
t_Result = RecurseTimeToLive (
pMethodContext,
a_AddressString ,
a_Address ,
t_UnSpecified ? DEFAULT_TIMEOUT : t_Node->LowerBound () ,
t_PropertyPartition ,
a_ResolveError
) ;
}
}
return t_Result ;
}
HRESULT CPingQueryAsync :: RecurseTimeToLive (
void *pMethodContext,
wchar_t *a_AddressString ,
ULONG a_Address ,
ULONG a_TimeOut ,
PartitionSet *a_PartitionSet,
ULONG a_ResolveError
)
{
HRESULT t_Result = WBEM_E_FAILED ;
ULONG t_PartitionCount = a_PartitionSet->GetPartitionCount () ;
for ( ulong t_Partition = 0 ; t_Partition < t_PartitionCount ; t_Partition ++ )
{
PartitionSet *t_PropertyPartition = a_PartitionSet->GetPartition ( t_Partition ) ;
WmiUnsignedIntegerRangeNode *t_Node = ( WmiUnsignedIntegerRangeNode * ) t_PropertyPartition->GetRange () ;
BOOL t_Unique = ! t_Node->InfiniteLowerBound () &&
! t_Node->InfiniteUpperBound () &&
t_Node->ClosedLowerBound () &&
t_Node->ClosedUpperBound () &&
( t_Node->LowerBound () == t_Node->UpperBound () ) ;
BOOL t_UnSpecified = t_Node->InfiniteLowerBound () && t_Node->InfiniteUpperBound () ;
if ( ! t_Unique && ! t_UnSpecified )
{
SetErrorInfo(IDS_QUERY_TTL,
WBEM_E_PROVIDER_NOT_CAPABLE ) ;
break ;
}
else
{
t_Result = RecurseBufferSize (
pMethodContext,
a_AddressString ,
a_Address ,
a_TimeOut ,
t_UnSpecified ? DEFAULT_TTL : t_Node->LowerBound () ,
t_PropertyPartition ,
a_ResolveError
) ;
}
}
return t_Result ;
}
HRESULT CPingQueryAsync :: RecurseBufferSize (
void *pMethodContext,
wchar_t *a_AddressString ,
ULONG a_Address ,
ULONG a_TimeOut ,
ULONG a_TimeToLive ,
PartitionSet *a_PartitionSet,
ULONG a_ResolveError
)
{
HRESULT t_Result = WBEM_E_FAILED ;
ULONG t_PartitionCount = a_PartitionSet->GetPartitionCount () ;
for ( ulong t_Partition = 0 ; t_Partition < t_PartitionCount ; t_Partition ++ )
{
PartitionSet *t_PropertyPartition = a_PartitionSet->GetPartition ( t_Partition ) ;
WmiUnsignedIntegerRangeNode *t_Node = ( WmiUnsignedIntegerRangeNode * ) t_PropertyPartition->GetRange () ;
BOOL t_Unique = ! t_Node->InfiniteLowerBound () &&
! t_Node->InfiniteUpperBound () &&
t_Node->ClosedLowerBound () &&
t_Node->ClosedUpperBound () &&
( t_Node->LowerBound () == t_Node->UpperBound () ) ;
BOOL t_UnSpecified = t_Node->InfiniteLowerBound () && t_Node->InfiniteUpperBound () ;
if ( ! t_Unique && ! t_UnSpecified )
{
SetErrorInfo(IDS_QUERY_BUF,
WBEM_E_PROVIDER_NOT_CAPABLE ) ;
break ;
}
else
{
if ( t_UnSpecified == FALSE && ( t_Node->LowerBound () > 65500 ) )
{
SetErrorInfo(IDS_BUFFSIZE_VALUE,WBEM_E_PROVIDER_NOT_CAPABLE ) ;
break ;
}
t_Result = RecurseNoFragmentation (
pMethodContext,
a_AddressString ,
a_Address ,
a_TimeOut ,
a_TimeToLive,
t_UnSpecified ? DEFAULT_SEND_SIZE : t_Node->LowerBound () ,
t_PropertyPartition,
a_ResolveError
) ;
}
}
return t_Result ;
}
HRESULT CPingQueryAsync :: RecurseNoFragmentation (
void *pMethodContext,
wchar_t *a_AddressString ,
ULONG a_Address ,
ULONG a_TimeOut ,
ULONG a_TimeToLive,
ULONG a_SendSize,
PartitionSet *a_PartitionSet,
ULONG a_ResolveError
)
{
HRESULT t_Result = WBEM_E_FAILED ;
ULONG t_PartitionCount = a_PartitionSet->GetPartitionCount () ;
for ( ulong t_Partition = 0 ; t_Partition < t_PartitionCount ; t_Partition ++ )
{
PartitionSet *t_PropertyPartition = a_PartitionSet->GetPartition ( t_Partition ) ;
WmiSignedIntegerRangeNode *t_Node = ( WmiSignedIntegerRangeNode * ) t_PropertyPartition->GetRange () ;
BOOL t_Unique = ! t_Node->InfiniteLowerBound () &&
! t_Node->InfiniteUpperBound () &&
t_Node->ClosedLowerBound () &&
t_Node->ClosedUpperBound () &&
( t_Node->LowerBound () == t_Node->UpperBound () ) ;
BOOL t_UnSpecified = t_Node->InfiniteLowerBound () && t_Node->InfiniteUpperBound () ;
if ( ! t_Unique && ! t_UnSpecified )
{
SetErrorInfo(IDS_QUERY_NOFRAG,
WBEM_E_PROVIDER_NOT_CAPABLE ) ;
break ;
}
else
{
t_Result = RecurseTypeOfService (
pMethodContext,
a_AddressString ,
a_Address ,
a_TimeOut ,
a_TimeToLive,
a_SendSize,
t_UnSpecified ? FALSE : t_Node->LowerBound () ,
t_PropertyPartition,
a_ResolveError
) ;
}
}
return t_Result ;
}
HRESULT CPingQueryAsync :: RecurseTypeOfService (
void *pMethodContext,
wchar_t *a_AddressString ,
ULONG a_Address ,
ULONG a_TimeOut ,
ULONG a_TimeToLive,
ULONG a_SendSize,
BOOL a_NoFragmentation ,
PartitionSet *a_PartitionSet,
ULONG a_ResolveError
)
{
HRESULT t_Result = WBEM_E_FAILED ;
ULONG t_PartitionCount = a_PartitionSet->GetPartitionCount () ;
for ( ulong t_Partition = 0 ; t_Partition < t_PartitionCount ; t_Partition ++ )
{
PartitionSet *t_PropertyPartition = a_PartitionSet->GetPartition ( t_Partition ) ;
WmiUnsignedIntegerRangeNode *t_Node = ( WmiUnsignedIntegerRangeNode * ) t_PropertyPartition->GetRange () ;
BOOL t_Unique = ! t_Node->InfiniteLowerBound () &&
! t_Node->InfiniteUpperBound () &&
t_Node->ClosedLowerBound () &&
t_Node->ClosedUpperBound () &&
( t_Node->LowerBound () == t_Node->UpperBound () ) ;
BOOL t_UnSpecified = t_Node->InfiniteLowerBound () && t_Node->InfiniteUpperBound () ;
if ( ! t_Unique && ! t_UnSpecified )
{
SetErrorInfo(IDS_QUERY_TOS,
WBEM_E_PROVIDER_NOT_CAPABLE ) ;
break ;
}
else
{
t_Result = RecurseRecordRoute (
pMethodContext,
a_AddressString ,
a_Address ,
a_TimeOut ,
a_TimeToLive,
a_SendSize,
a_NoFragmentation ,
t_UnSpecified ? 0 : t_Node->LowerBound () ,
t_PropertyPartition,
a_ResolveError
) ;
}
}
return t_Result ;
}
HRESULT CPingQueryAsync :: RecurseRecordRoute (
void *pMethodContext,
wchar_t *a_AddressString ,
ULONG a_Address ,
ULONG a_TimeOut ,
ULONG a_TimeToLive,
ULONG a_SendSize,
BOOL a_NoFragmentation ,
ULONG a_TypeOfService,
PartitionSet *a_PartitionSet,
ULONG a_ResolveError
)
{
HRESULT t_Result = WBEM_E_FAILED ;
ULONG t_PartitionCount = a_PartitionSet->GetPartitionCount () ;
for ( ulong t_Partition = 0 ; t_Partition < t_PartitionCount ; t_Partition ++ )
{
PartitionSet *t_PropertyPartition = a_PartitionSet->GetPartition ( t_Partition ) ;
WmiUnsignedIntegerRangeNode *t_Node = ( WmiUnsignedIntegerRangeNode * ) t_PropertyPartition->GetRange () ;
BOOL t_Unique = ! t_Node->InfiniteLowerBound () &&
! t_Node->InfiniteUpperBound () &&
t_Node->ClosedLowerBound () &&
t_Node->ClosedUpperBound () &&
( t_Node->LowerBound () == t_Node->UpperBound () ) ;
BOOL t_UnSpecified = t_Node->InfiniteLowerBound () && t_Node->InfiniteUpperBound () ;
if ( ! t_Unique && ! t_UnSpecified )
{
SetErrorInfo(IDS_QUERY_RR,
WBEM_E_PROVIDER_NOT_CAPABLE ) ;
break ;
}
else
{
t_Result = RecurseTimestampRoute (
pMethodContext,
a_AddressString ,
a_Address ,
a_TimeOut ,
a_TimeToLive,
a_SendSize,
a_NoFragmentation ,
a_TypeOfService ,
t_UnSpecified ? 0 : t_Node->LowerBound () ,
t_PropertyPartition,
a_ResolveError
) ;
}
}
return t_Result ;
}
HRESULT CPingQueryAsync :: RecurseTimestampRoute (
void *pMethodContext,
wchar_t *a_AddressString ,
ULONG a_Address ,
ULONG a_TimeOut ,
ULONG a_TimeToLive,
ULONG a_SendSize,
BOOL a_NoFragmentation ,
ULONG a_TypeOfService,
ULONG a_RecordRoute,
PartitionSet *a_PartitionSet,
ULONG a_ResolveError
)
{
HRESULT t_Result = WBEM_E_FAILED ;
ULONG t_PartitionCount = a_PartitionSet->GetPartitionCount () ;
for ( ulong t_Partition = 0 ; t_Partition < t_PartitionCount ; t_Partition ++ )
{
PartitionSet *t_PropertyPartition = a_PartitionSet->GetPartition ( t_Partition ) ;
WmiUnsignedIntegerRangeNode *t_Node = ( WmiUnsignedIntegerRangeNode * ) t_PropertyPartition->GetRange () ;
BOOL t_Unique = ! t_Node->InfiniteLowerBound () &&
! t_Node->InfiniteUpperBound () &&
t_Node->ClosedLowerBound () &&
t_Node->ClosedUpperBound () &&
( t_Node->LowerBound () == t_Node->UpperBound () ) ;
BOOL t_UnSpecified = t_Node->InfiniteLowerBound () && t_Node->InfiniteUpperBound () ;
if ( ! t_Unique && ! t_UnSpecified )
{
SetErrorInfo(IDS_QUERY_TS,
WBEM_E_PROVIDER_NOT_CAPABLE ) ;
break ;
}
else
{
t_Result = RecurseSourceRouteType (
pMethodContext,
a_AddressString ,
a_Address ,
a_TimeOut ,
a_TimeToLive,
a_SendSize,
a_NoFragmentation ,
a_TypeOfService,
a_RecordRoute,
t_UnSpecified ? 0 : t_Node->LowerBound () ,
t_PropertyPartition,
a_ResolveError
) ;
}
}
return t_Result ;
}
HRESULT CPingQueryAsync :: RecurseSourceRouteType (
void *pMethodContext,
wchar_t *a_AddressString ,
ULONG a_Address ,
ULONG a_TimeOut ,
ULONG a_TimeToLive,
ULONG a_SendSize,
BOOL a_NoFragmentation ,
ULONG a_TypeOfService,
ULONG a_RecordRoute,
ULONG a_TimestampRoute,
PartitionSet *a_PartitionSet,
ULONG a_ResolveError
)
{
HRESULT t_Result = WBEM_E_FAILED ;
ULONG t_PartitionCount = a_PartitionSet->GetPartitionCount () ;
for ( ulong t_Partition = 0 ; t_Partition < t_PartitionCount ; t_Partition ++ )
{
PartitionSet *t_PropertyPartition = a_PartitionSet->GetPartition ( t_Partition ) ;
WmiUnsignedIntegerRangeNode *t_Node = ( WmiUnsignedIntegerRangeNode * ) t_PropertyPartition->GetRange () ;
BOOL t_Unique = ! t_Node->InfiniteLowerBound () &&
! t_Node->InfiniteUpperBound () &&
t_Node->ClosedLowerBound () &&
t_Node->ClosedUpperBound () &&
( t_Node->LowerBound () == t_Node->UpperBound () ) ;
BOOL t_UnSpecified = t_Node->InfiniteLowerBound () && t_Node->InfiniteUpperBound () ;
if ( ! t_Unique && ! t_UnSpecified )
{
SetErrorInfo(IDS_QUERY_SRT,
WBEM_E_PROVIDER_NOT_CAPABLE ) ;
break ;
}
else
{
t_Result = RecurseSourceRoute (
pMethodContext,
a_AddressString ,
a_Address ,
a_TimeOut ,
a_TimeToLive,
a_SendSize,
a_NoFragmentation ,
a_TypeOfService,
a_RecordRoute,
a_TimestampRoute,
t_UnSpecified ? 0 : t_Node->LowerBound () ,
t_PropertyPartition,
a_ResolveError
) ;
}
}
return t_Result ;
}
HRESULT CPingQueryAsync :: RecurseSourceRoute (
void *pMethodContext,
wchar_t *a_AddressString ,
ULONG a_Address ,
ULONG a_TimeOut ,
ULONG a_TimeToLive,
ULONG a_SendSize,
BOOL a_NoFragmentation ,
ULONG a_TypeOfService,
ULONG a_RecordRoute,
ULONG a_TimestampRoute,
ULONG a_SourceRouteType,
PartitionSet *a_PartitionSet,
ULONG a_ResolveError
)
{
HRESULT t_Result = WBEM_E_FAILED ;
ULONG t_PartitionCount = a_PartitionSet->GetPartitionCount () ;
for ( ulong t_Partition = 0 ; t_Partition < t_PartitionCount ; t_Partition ++ )
{
PartitionSet *t_PropertyPartition = a_PartitionSet->GetPartition ( t_Partition ) ;
WmiStringRangeNode *t_Node = ( WmiStringRangeNode * ) t_PropertyPartition->GetRange () ;
BOOL t_Unique = ! t_Node->InfiniteLowerBound () &&
! t_Node->InfiniteUpperBound () &&
t_Node->ClosedLowerBound () &&
t_Node->ClosedUpperBound () &&
( wcscmp ( t_Node->LowerBound () , t_Node->UpperBound () ) == 0 ) ;
BOOL t_UnSpecified = t_Node->InfiniteLowerBound () && t_Node->InfiniteUpperBound () ;
if ( ! t_Unique && ! t_UnSpecified )
{
SetErrorInfo(IDS_QUERY_SR,
WBEM_E_PROVIDER_NOT_CAPABLE ) ;
break ;
}
else
{
t_Result = RecurseResolveAddressNames (
pMethodContext,
a_AddressString ,
a_Address ,
a_TimeOut ,
a_TimeToLive,
a_SendSize,
a_NoFragmentation ,
a_TypeOfService,
a_RecordRoute,
a_TimestampRoute,
a_SourceRouteType,
t_UnSpecified ? NULL : t_Node->LowerBound () ,
t_PropertyPartition,
a_ResolveError
) ;
}
}
return t_Result ;
}
HRESULT CPingQueryAsync :: RecurseResolveAddressNames (
void *pMethodContext,
wchar_t *a_AddressString ,
ULONG a_Address ,
ULONG a_TimeOut ,
ULONG a_TimeToLive,
ULONG a_SendSize,
BOOL a_NoFragmentation ,
ULONG a_TypeOfService,
ULONG a_RecordRoute,
ULONG a_TimestampRoute,
ULONG a_SourceRouteType,
LPCWSTR a_SourceRoute,
PartitionSet *a_PartitionSet,
ULONG a_ResolveError
)
{
HRESULT t_Result = WBEM_E_FAILED ;
ULONG t_PartitionCount = a_PartitionSet->GetPartitionCount () ;
for ( ulong t_Partition = 0 ; t_Partition < t_PartitionCount ; t_Partition ++ )
{
PartitionSet *t_PropertyPartition = a_PartitionSet->GetPartition ( t_Partition ) ;
WmiSignedIntegerRangeNode *t_Node = ( WmiSignedIntegerRangeNode * ) t_PropertyPartition->GetRange () ;
BOOL t_Unique = ! t_Node->InfiniteLowerBound () &&
! t_Node->InfiniteUpperBound () &&
t_Node->ClosedLowerBound () &&
t_Node->ClosedUpperBound () &&
( t_Node->LowerBound () == t_Node->UpperBound () ) ;
BOOL t_UnSpecified = t_Node->InfiniteLowerBound () && t_Node->InfiniteUpperBound () ;
if ( ! t_Unique && ! t_UnSpecified )
{
SetErrorInfo(IDS_QUERY_RA,
WBEM_E_PROVIDER_NOT_CAPABLE ) ;
break ;
}
else
{
for ( ulong t_Partition = 0 ; t_Partition < t_PartitionCount ; t_Partition ++ )
{
PartitionSet *t_PropertyPartition = a_PartitionSet->GetPartition ( t_Partition ) ;
WmiSignedIntegerRangeNode *t_Node = ( WmiSignedIntegerRangeNode * ) t_PropertyPartition->GetRange () ;
InterlockedIncrement(&m_PingCount);
t_Result = Icmp_RequestResponse (
a_AddressString ,
a_Address ,
a_TimeToLive,
a_TimeOut ,
a_SendSize,
a_NoFragmentation ,
a_TypeOfService,
a_RecordRoute,
a_TimestampRoute,
a_SourceRouteType,
a_SourceRoute ,
t_UnSpecified ? FALSE : t_Node->LowerBound (),
a_ResolveError
) ;
if ( FAILED ( t_Result ) )
{
DecrementPingCount();
}
}
}
}
return t_Result ;
}
BOOL CPingQueryAsync::ExecQuery ()
{
BOOL t_Result = FALSE ;
InterlockedIncrement(&m_PingCount);
SQL_LEVEL_1_RPN_EXPRESSION *t_RpnExpression = NULL ;
QueryPreprocessor :: QuadState t_State = Query (
m_Query ,
t_RpnExpression
) ;
if ( t_State == QueryPreprocessor :: QuadState :: State_True )
{
WmiTreeNode *t_Root = NULL ;
t_State = PreProcess (
NULL ,
t_RpnExpression ,
t_Root
) ;
PartitionSet *t_PartitionSet = NULL ;
try
{
switch ( t_State )
{
case QueryPreprocessor :: QuadState :: State_True:
{
BSTR t_PropertyContainer [ PING_KEY_PROPERTY_COUNT ] ;
memset (t_PropertyContainer , 0 , sizeof(BSTR) * PING_KEY_PROPERTY_COUNT );
try
{
t_PropertyContainer [ 0 ] = SysAllocString ( Ping_Address ) ;
t_PropertyContainer [ 1 ] = SysAllocString ( Ping_Timeout ) ;
t_PropertyContainer [ 2 ] = SysAllocString ( Ping_TimeToLive ) ;
t_PropertyContainer [ 3 ] = SysAllocString ( Ping_BufferSize ) ;
t_PropertyContainer [ 4 ] = SysAllocString ( Ping_NoFragmentation ) ;
t_PropertyContainer [ 5 ] = SysAllocString ( Ping_TypeofService ) ;
t_PropertyContainer [ 6 ] = SysAllocString ( Ping_RecordRoute ) ;
t_PropertyContainer [ 7 ] = SysAllocString ( Ping_TimestampRoute ) ;
t_PropertyContainer [ 8 ] = SysAllocString ( Ping_SourceRouteType ) ;
t_PropertyContainer [ 9 ] = SysAllocString ( Ping_SourceRoute ) ;
t_PropertyContainer [ 10 ] = SysAllocString ( Ping_ResolveAddressNames ) ;
if ( !t_PropertyContainer [ 0 ] ||
!t_PropertyContainer [ 1 ] ||
!t_PropertyContainer [ 2 ] ||
!t_PropertyContainer [ 3 ] ||
!t_PropertyContainer [ 4 ] ||
!t_PropertyContainer [ 5 ] ||
!t_PropertyContainer [ 6 ] ||
!t_PropertyContainer [ 7 ] ||
!t_PropertyContainer [ 8 ] ||
!t_PropertyContainer [ 9 ] ||
!t_PropertyContainer [ 10 ]
)
{
throw CHeap_Exception ( CHeap_Exception :: E_ALLOCATION_ERROR );
}
t_State = PreProcess (
NULL ,
t_RpnExpression ,
t_Root ,
PING_KEY_PROPERTY_COUNT ,
t_PropertyContainer ,
t_PartitionSet
) ;
for ( ULONG index = 0; index < PING_KEY_PROPERTY_COUNT; index++ )
{
if ( t_PropertyContainer [ index ] )
{
SysFreeString ( t_PropertyContainer [ index ] ) ;
t_PropertyContainer [ index ] = NULL;
}
}
}
catch ( ... )
{
for ( ULONG index = 0; index < PING_KEY_PROPERTY_COUNT; index++ )
{
if ( t_PropertyContainer [ index ] )
{
SysFreeString ( t_PropertyContainer [ index ] ) ;
t_PropertyContainer [ index ] = NULL;
}
}
throw;
}
switch ( t_State )
{
case QueryPreprocessor :: QuadState :: State_True :
{
SetErrorInfo(IDS_QUERY_BROAD,
WBEM_E_PROVIDER_NOT_CAPABLE ) ;
}
break ;
case QueryPreprocessor :: QuadState :: State_False :
{
/*
* Empty set
*/
SetErrorInfo(IDS_QUERY_NARROW,
WBEM_E_PROVIDER_NOT_CAPABLE ) ;
}
break ;
case QueryPreprocessor :: QuadState :: State_Undefined :
{
t_Result = SUCCEEDED(RecurseAddress ( NULL , t_PartitionSet ) );
delete t_PartitionSet ;
t_PartitionSet = NULL;
}
break ;
default:
{
SetErrorInfo(IDS_QUERY_UNUSABLE,
WBEM_E_PROVIDER_NOT_CAPABLE ) ;
}
break ;
}
delete t_Root ;
t_Root = NULL ;
}
break ;
default:
{
SetErrorInfo(IDS_QUERY_ANALYZE,
WBEM_E_FAILED ) ;
}
break ;
}
delete t_RpnExpression ;
t_RpnExpression = NULL ;
}
catch (...)
{
if ( t_PartitionSet )
{
delete t_PartitionSet;
t_PartitionSet = NULL;
}
if ( t_Root )
{
delete t_Root;
t_Root = NULL;
}
if ( t_RpnExpression )
{
delete t_RpnExpression ;
t_RpnExpression = NULL ;
}
DecrementPingCount();
throw;
}
}
else
{
SetErrorInfo(IDS_QUERY_PARSE,
WBEM_E_FAILED ) ;
}
DecrementPingCount();
return t_Result ;
}
void CPingQueryAsync::HandleResponse (CPingCallBackObject *a_reply)
{
try
{
if (FAILED(Icmp_DecodeAndIndicate (a_reply)) )
{
SetErrorInfo(IDS_DECODE_QUERY,
WBEM_E_FAILED ) ;
}
}
catch (...)
{
DecrementPingCount();
}
DecrementPingCount();
}
void CPingQueryAsync::HandleErrorResponse (DWORD a_ErrMsgID, HRESULT a_HRes)
{
try
{
SetErrorInfo(a_ErrMsgID , a_HRes) ;
}
catch (...)
{
DecrementPingCount();
}
DecrementPingCount();
}
| 23.814727 | 145 | 0.598624 | npocmaka |
1f1be8b11c7298824f6c8b9d5f71bdde39eb9afa | 1,609 | cpp | C++ | src/main.cpp | JimmyZhang12/SLIC_CUDA | 7a2bd5830d3447ae79eef7d824a7b0999ea6a3b7 | [
"MIT"
] | null | null | null | src/main.cpp | JimmyZhang12/SLIC_CUDA | 7a2bd5830d3447ae79eef7d824a7b0999ea6a3b7 | [
"MIT"
] | null | null | null | src/main.cpp | JimmyZhang12/SLIC_CUDA | 7a2bd5830d3447ae79eef7d824a7b0999ea6a3b7 | [
"MIT"
] | null | null | null | #include <iostream>
#include <opencv2/opencv.hpp>
#include <chrono>
#include<string>
#include "SlicCudaHost.h"
using namespace std;
using namespace cv;
int main() {
// VideoCapture cap("/home/jimmy/ece508/data/waterfall.avi");
// Parameters
int diamSpx = 32;
int wc = 35;
int nIteration = 10;
SlicCuda::InitType initType = SlicCuda::SLIC_SIZE;
//start segmentation
Mat frame;
frame = imread("/home/jimmy/ece508/data/ocean_coast.jpg", IMREAD_COLOR);
// cap >> frame;
SlicCuda oSlicCuda;
oSlicCuda.initialize(frame, diamSpx, initType, wc, nIteration);
// int frame_width = cap.get(cv::CAP_PROP_FRAME_WIDTH);
// int frame_height = cap.get(cv::CAP_PROP_FRAME_HEIGHT);
// int endFrame = cap.get(CAP_PROP_FRAME_COUNT);
// double fps = cap.get(CAP_PROP_FPS);
// VideoWriter video("/home/jimmy/ece508/segs/waterfall.avi",
// VideoWriter::fourcc('M','J','P','G'), fps, Size(frame_width,frame_height));
int i = 0;
int endFrame = 1;
for (i=0; i<endFrame; i++){
auto t0 = std::chrono::high_resolution_clock::now();
oSlicCuda.segment(frame);
auto t1 = std::chrono::high_resolution_clock::now();
double time = std::chrono::duration<double>(t1-t0).count() ;
cout << "Frame " << frame.size() <<" "<< i+1 << "/" << endFrame << ", Time: "<< time <<"s"<<endl;
}
oSlicCuda.enforceConnectivity();
// std::cout << labels << endl;
Mat labels = oSlicCuda.getLabels();
SlicCuda::displayBound(frame, (float*)labels.data, Scalar(255, 255, 255));
imwrite("/home/jimmy/ece508/segs/ocean_coast.jpg", frame);
// video.write(frame);
// cap >> frame;
return 0;
} | 24.378788 | 99 | 0.668738 | JimmyZhang12 |
1f1c4c97ab8919946e69cd923d2a814799cf37d8 | 874 | cpp | C++ | Matrix Multiplication.cpp | sayanroy058/C-Programs | 2bb591d5a322d1bf10e8a1627d92db05cb0ece75 | [
"CC0-1.0"
] | 2 | 2019-09-11T16:22:30.000Z | 2019-09-19T18:29:42.000Z | Matrix Multiplication.cpp | sayanroy058/C-Programs | 2bb591d5a322d1bf10e8a1627d92db05cb0ece75 | [
"CC0-1.0"
] | null | null | null | Matrix Multiplication.cpp | sayanroy058/C-Programs | 2bb591d5a322d1bf10e8a1627d92db05cb0ece75 | [
"CC0-1.0"
] | null | null | null | #include<stdio.h>
int main()
{
int i,j,k,r1,r2,c1,c2,sum=0,a[10][10],b[10][10],p[10][10];
printf("Enter the row and column of the 1st matrics:");
scanf("%d%d",&r1,&c1);
printf("Enter the row and column of the 2nd matrics:");
scanf("%d%d",&r2,&c2);
printf("Enter elements of first matrix:\n");
for(i=0;i<r1;i++)
{
for(j=0;j<c1;j++)
{
scanf("%d",&a[i][j]);
}
}
printf("Enter elements of 2nd matrix:\n");
for (i=0;i<r2;i++)
{
for(j=0;j<c2;j++)
{
scanf("%d",&b[i][j]);
}
}
for(i=0;i<r1;i++)
{
for(j=0;j<c2;j++)
{
for(k=0;k<r2;k++)
{
sum=sum+a[i][k]*b[k][j];
}
p[i][j]=sum;
sum=0;
}
}
printf("Product of the matrices:\n");
for(i=0;i<r1;i++)
{
for (j=0;j<c2;j++)
{
printf("%d\t",p[i][j]);
}
printf("\n");
}
}
| 18.595745 | 60 | 0.442792 | sayanroy058 |
1f1d72c14c8761610c791ecea8fa1f858adfe114 | 247 | cpp | C++ | pub/1104.cpp | BashuMiddleSchool/Bashu_OnlineJudge_Code | 4707a271e6658158a1910b0e6e27c75f96841aca | [
"MIT"
] | 2 | 2021-05-01T15:51:58.000Z | 2021-05-02T15:19:49.000Z | pub/1104.cpp | BashuMiddleSchool/Bashu_OnlineJudge_Code | 4707a271e6658158a1910b0e6e27c75f96841aca | [
"MIT"
] | 1 | 2021-05-16T15:04:38.000Z | 2021-09-19T09:49:00.000Z | pub/1104.cpp | BashuMiddleSchool/Bashu_OnlineJudge_Code | 4707a271e6658158a1910b0e6e27c75f96841aca | [
"MIT"
] | null | null | null | #include<iostream>
using namespace std;
int main()
{
int a[100001]={0};
int n,i,b=-1000000,m;
cin>>n;
for(i=1;i<=n;i++)
{
cin>>a[i];
}
for(i=1;i<=n;i++)
{
if(a[i]>=b) {
b=a[i];m=i;
}
}
cout<<b<<endl;
cout<<m;
return 0;
} | 11.761905 | 22 | 0.48583 | BashuMiddleSchool |
1f212f1f35be9cb4fa950adaaaf9c31200466c69 | 1,043 | cpp | C++ | cplus/BacterialExperimentGroup.cpp | chtld/Programming-and-Algorithm-Course | 669f266fc97db9050013ffbb388517667de33433 | [
"MIT"
] | 2 | 2019-06-10T11:50:06.000Z | 2019-10-14T08:00:41.000Z | cplus/BacterialExperimentGroup.cpp | chtld/Programming-and-Algorithm-Course | 669f266fc97db9050013ffbb388517667de33433 | [
"MIT"
] | null | null | null | cplus/BacterialExperimentGroup.cpp | chtld/Programming-and-Algorithm-Course | 669f266fc97db9050013ffbb388517667de33433 | [
"MIT"
] | null | null | null | #include <iostream>
int main(){
int n = 0, initial = 0, final = 0;
std::cin >> n;
int id[100] = {0};
double rate[100] = {0.0};
for (int i = 0; i < n; i++) {
std::cin >> id[i] >> initial >> final;
rate [i] = (double) final/initial;
}
for (int i = 0; i < n; i++) {
for (int j = 0; j < n - i - 1; j++) {
if (rate[j] > rate[j + 1]) {
double temp = rate[j];
rate[j] = rate[j + 1];
rate[j + 1] = temp;
int temp2 = id[j];
id[j] = id[j + 1];
id[j + 1] = temp2;
}
}
}
double maxDiff = 0.0;
int maxDiffIndex = 0;
for (int i = 0; i < n - 1; i++) {
double diff = rate[i + 1] - rate[i];
if (diff > maxDiff) {
maxDiff = diff;
maxDiffIndex = i;
}
}
std::cout << n - maxDiffIndex - 1 << std::endl;
for (int i = maxDiffIndex + 1; i < n; i++){
std::cout << id[i] <<std::endl;
}
std::cout << maxDiffIndex + 1 << std::endl;
for (int i = 0; i <= maxDiffIndex; i++) {
std::cout << id[i] <<std::endl;
}
return 0;
}
| 22.673913 | 49 | 0.449664 | chtld |
1f22e36b74d418861823dcefdd65edd90cb639ae | 5,152 | cpp | C++ | qt-creator-opensource-src-4.6.1/src/libs/qmldebug/qmltoolsclient.cpp | kevinlq/Qt-Creator-Opensource-Study | b8cadff1f33f25a5d4ef33ed93f661b788b1ba0f | [
"MIT"
] | 5 | 2018-12-22T14:49:13.000Z | 2022-01-13T07:21:46.000Z | qt-creator-opensource-src-4.6.1/src/libs/qmldebug/qmltoolsclient.cpp | kevinlq/Qt-Creator-Opensource-Study | b8cadff1f33f25a5d4ef33ed93f661b788b1ba0f | [
"MIT"
] | null | null | null | qt-creator-opensource-src-4.6.1/src/libs/qmldebug/qmltoolsclient.cpp | kevinlq/Qt-Creator-Opensource-Study | b8cadff1f33f25a5d4ef33ed93f661b788b1ba0f | [
"MIT"
] | 8 | 2018-07-17T03:55:48.000Z | 2021-12-22T06:37:53.000Z | /****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
**
** GNU General Public License Usage
** Alternatively, this file may be used under the terms of the GNU
** General Public License version 3 as published by the Free Software
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
**
****************************************************************************/
#include "qmltoolsclient.h"
#include "qmldebugconnection.h"
#include <qmldebug/qpacketprotocol.h>
#include <QStringList>
//INSPECTOR SERVICE PROTOCOL
// <HEADER><COMMAND><DATA>
// <HEADER> : <type{request, response, event}><requestId/eventId>[<response_success_bool>]
// <COMMAND> : {"enable", "disable", "reload", "showAppOnTop"}
// <DATA> : select: <debugIds_int_list>
// reload: <hash<changed_filename_string, filecontents_bytearray>>
// showAppOnTop: <set_bool>
const char REQUEST[] = "request";
const char RESPONSE[] = "response";
const char EVENT[] = "event";
const char ENABLE[] = "enable";
const char DISABLE[] = "disable";
const char SELECT[] = "select";
const char SHOW_APP_ON_TOP[] = "showAppOnTop";
namespace QmlDebug {
QmlToolsClient::QmlToolsClient(QmlDebugConnection *client)
: BaseToolsClient(client, QLatin1String("QmlInspector")),
m_connection(client),
m_requestId(0)
{
setObjectName(name());
}
void QmlToolsClient::messageReceived(const QByteArray &message)
{
QPacket ds(dataStreamVersion(), message);
QByteArray type;
int requestId;
ds >> type >> requestId;
if (type == QByteArray(RESPONSE)) {
bool success = false;
ds >> success;
log(LogReceive, type, QString::fromLatin1("requestId: %1 success: %2")
.arg(QString::number(requestId)).arg(QString::number(success)));
} else if (type == QByteArray(EVENT)) {
QByteArray event;
ds >> event;
if (event == QByteArray(SELECT)) {
QList<int> debugIds;
ds >> debugIds;
debugIds.removeAll(-1);
QStringList debugIdStrings;
foreach (int debugId, debugIds) {
debugIdStrings << QString::number(debugId);
}
log(LogReceive, type + ':' + event,
QString::fromLatin1("[%1]").arg(debugIdStrings.join(QLatin1Char(','))));
emit currentObjectsChanged(debugIds);
}
} else {
log(LogReceive, type, QLatin1String("Warning: Not handling message"));
}
}
void QmlToolsClient::setObjectIdList(const QList<ObjectReference> &objectRoots)
{
if (!m_connection || !m_connection->isConnected())
return;
QList<int> debugIds;
foreach (const ObjectReference &object, objectRoots)
debugIds << object.debugId();
QPacket ds(dataStreamVersion());
ds << QByteArray(REQUEST) << m_requestId++ << QByteArray(SELECT) << debugIds;
sendMessage(ds.data());
}
void QmlToolsClient::setDesignModeBehavior(bool inDesignMode)
{
if (!m_connection || !m_connection->isConnected())
return;
QPacket ds(dataStreamVersion());
ds << QByteArray(REQUEST) << m_requestId++;
if (inDesignMode)
ds << QByteArray(ENABLE);
else
ds << QByteArray(DISABLE);
log(LogSend, ENABLE, QLatin1String(inDesignMode ? "true" : "false"));
sendMessage(ds.data());
}
void QmlToolsClient::changeToSelectTool()
{
// NOT IMPLEMENTED
}
void QmlToolsClient::changeToSelectMarqueeTool()
{
// NOT IMPLEMENTED
}
void QmlToolsClient::changeToZoomTool()
{
// NOT IMPLEMENTED
}
void QmlToolsClient::showAppOnTop(bool showOnTop)
{
if (!m_connection || !m_connection->isConnected())
return;
QPacket ds(dataStreamVersion());
ds << QByteArray(REQUEST) << m_requestId++
<< QByteArray(SHOW_APP_ON_TOP) << showOnTop;
log(LogSend, SHOW_APP_ON_TOP, QLatin1String(showOnTop ? "true" : "false"));
sendMessage(ds.data());
}
void QmlToolsClient::log(LogDirection direction,
const QByteArray &message,
const QString &extra)
{
QString msg;
if (direction == LogSend)
msg += QLatin1String("sending ");
else
msg += QLatin1String("receiving ");
msg += QLatin1String(message);
msg += QLatin1Char(' ');
msg += extra;
emit logActivity(name(), msg);
}
} // namespace QmlDebug
| 30.305882 | 90 | 0.644216 | kevinlq |
1f289f3a64863a9def62c79b27dae01a400b4167 | 8,280 | cpp | C++ | src/editor/src/resource/name_resource_pool.cpp | AirGuanZ/Atrc | a0c4bc1b7bb96ddffff8bb1350f88b651b94d993 | [
"MIT"
] | 358 | 2018-11-29T08:15:05.000Z | 2022-03-31T07:48:37.000Z | src/editor/src/resource/name_resource_pool.cpp | happyfire/Atrc | 74cac111e277be53eddea5638235d97cec96c378 | [
"MIT"
] | 23 | 2019-04-06T17:23:58.000Z | 2022-02-08T14:22:46.000Z | src/editor/src/resource/name_resource_pool.cpp | happyfire/Atrc | 74cac111e277be53eddea5638235d97cec96c378 | [
"MIT"
] | 22 | 2019-03-04T01:47:56.000Z | 2022-01-13T06:06:49.000Z | #include <agz/editor/editor.h>
#include <agz/editor/resource/pool/name_resource_pool.h>
#include <agz/tracer/utility/logger.h>
AGZ_EDITOR_BEGIN
namespace
{
constexpr int WIDGET_ITEM_HEIGHT = 35;
}
template<typename TracerObject>
NameResourcePool<TracerObject>::NameResourcePool(
ObjectContext &obj_ctx, Editor *editor, const QString &default_type)
: default_type_(default_type), obj_ctx_(obj_ctx), editor_(editor)
{
widget_ = new NameResourcePoolWidget;
connect(widget_->create, &QPushButton::clicked, [=]
{
bool ok = false;
const QString name = to_valid_name(QInputDialog::getText(
widget_, "Name", "Enter resource name",
QLineEdit::Normal, {}, &ok));
if(!ok)
return;
AGZ_INFO("create new '{}' with name: {}",
typeid(TracerObject).name(), name.toStdString());
auto panel = newBox<ResourcePanel<TracerObject>>(obj_ctx_, default_type);
add_resource(name, std::move(panel));
});
connect(widget_->remove, &QPushButton::clicked, [=]
{
auto selected = widget_->name_list->currentItem();
if(!selected)
return;
const QString name = selected->text();
const auto it = name2record_.find(name);
assert(it != name2record_.end());
AGZ_INFO("remove '{}' with name: {}",
typeid(TracerObject).name(), name.toStdString());
name2record_.erase(it);
delete widget_->name_list->takeItem(widget_->name_list->row(selected));
});
connect(widget_->duplicate, &QPushButton::clicked, [=]
{
auto selected = widget_->name_list->currentItem();
if(!selected)
return;
const QString old_name = selected->text();
const auto it = name2record_.find(old_name);
assert(it != name2record_.end());
bool ok = false;
const QString new_name = to_valid_name(QInputDialog::getText(
widget_, "Name", "Enter resource name",
QLineEdit::Normal, {}, &ok));
if(!ok)
return;
AGZ_INFO("duplicate '{}' : {} -> {}",
typeid(TracerObject).name(),
it->second->name.toStdString(), new_name.toStdString());
auto panel = it->second->rsc->clone_panel();
add_resource(new_name, Box<ResourcePanel<TracerObject>>(panel));
});
connect(widget_->edit, &QPushButton::clicked, [=]
{
auto selected = widget_->name_list->currentItem();
if(!selected)
return;
const QString old_name = selected->text();
const auto it = name2record_.find(old_name);
assert(it != name2record_.end());
show_edit_panel(it->second->rsc->get_panel(), true);
});
connect(widget_->rename, &QPushButton::clicked, [=]
{
auto selected = widget_->name_list->currentItem();
if(!selected)
return;
bool ok = false;
const QString new_name = to_valid_name(QInputDialog::getText(
widget_, "Name", "Enter resource name",
QLineEdit::Normal, {}, &ok));
if(!ok)
return;
auto it = name2record_.find(selected->text());
assert(it != name2record_.end());
it->second->name = new_name;
it->second->rsc->set_name(new_name);
selected->setText(new_name);
auto rcd = std::move(it->second);
name2record_.erase(it);
name2record_[new_name] = std::move(rcd);
});
connect(widget_->name_list, &QListWidget::currentItemChanged,
[=](QListWidgetItem *current, QListWidgetItem *previous)
{
if(!current)
return;
auto it = name2record_.find(current->text());
assert(it != name2record_.end());
show_edit_panel(it->second->rsc->get_panel(), false);
});
}
template<typename TracerObject>
Box<ResourceReference<TracerObject>>
NameResourcePool<TracerObject>::select_resource()
{
auto selected = widget_->name_list->currentItem();
if(!selected)
return nullptr;
const QString name = selected->text();
const auto it = name2record_.find(name);
return it != name2record_.end() ? it->second->rsc->create_reference() : nullptr;
}
template<typename TracerObject>
ResourceInPool<TracerObject> *NameResourcePool<TracerObject>::add_resource(
const QString &name, Box<ResourcePanel<TracerObject>> panel)
{
auto *raw_panel = panel.get();
auto rsc = newBox<ResourceInPool<TracerObject>>(name, std::move(panel));
auto raw_rsc = rsc.get();
editor_->add_to_resource_panel(raw_panel);
auto record = newBox<Record>();
record->name = name;
record->rsc = std::move(rsc);
name2record_[name] = std::move(record);
widget_->name_list->addItem(name);
auto new_item = widget_->name_list->findItems(name, Qt::MatchExactly).front();
new_item->setSizeHint(QSize(new_item->sizeHint().width(), WIDGET_ITEM_HEIGHT));
return raw_rsc;
}
template<typename TracerObject>
void NameResourcePool<TracerObject>::save_asset(AssetSaver &saver) const
{
saver.write(uint32_t(name2record_.size()));
for(auto &p : name2record_)
p.second->rsc->save_asset(saver);
}
template<typename TracerObject>
void NameResourcePool<TracerObject>::load_asset(AssetLoader &loader)
{
const uint32_t count = loader.read<uint32_t>();
for(uint32_t i = 0; i < count; ++i)
{
auto rsc = newBox<ResourceInPool<TracerObject>>(
"", newBox<ResourcePanel<TracerObject>>(obj_ctx_, default_type_));
rsc->load_asset(*this, loader);
const QString name = rsc->get_name();
auto raw_panel = rsc->get_panel();
editor_->add_to_resource_panel(raw_panel);
auto record = newBox<Record>();
record->name = name;
record->rsc = std::move(rsc);
name2record_[name] = std::move(record);
widget_->name_list->addItem(name);
auto new_item = widget_->name_list->findItems(name, Qt::MatchExactly).front();
new_item->setSizeHint(QSize(new_item->sizeHint().width(), WIDGET_ITEM_HEIGHT));
}
}
template<typename TracerObject>
void NameResourcePool<TracerObject>::to_config(
tracer::ConfigGroup &scene_grp, JSONExportContext &ctx) const
{
for(auto &p : name2record_)
{
auto rsc = p.second->rsc.get();
auto ref_name = rsc->get_config_ref_name();
tracer::ConfigGroup *grp = &scene_grp;
for(size_t i = 0; i < ref_name->size() - 1; ++i)
{
auto sub_grp = grp->find_child_group(ref_name->at_str(i));
if(sub_grp)
{
grp = sub_grp;
continue;
}
auto new_grp = newRC<tracer::ConfigGroup>();
grp->insert_child(ref_name->at_str(i), new_grp);
grp = new_grp.get();
}
auto rsc_grp = rsc->to_config(ctx);
assert(rsc_grp);
grp->insert_child(ref_name->at_str(ref_name->size() - 1), rsc_grp);
}
}
template<typename TracerObject>
ResourceInPool<TracerObject> *NameResourcePool<TracerObject>::name_to_rsc(
const QString &name)
{
auto it = name2record_.find(name);
return it == name2record_.end() ? nullptr : it->second->rsc.get();
}
template<typename TracerObject>
bool NameResourcePool<TracerObject>::is_valid_name(const QString &name) const
{
return !name.isEmpty() && name2record_.find(name) == name2record_.end();
}
template<typename TracerObject>
QString NameResourcePool<TracerObject>::to_valid_name(const QString &name) const
{
if(name.isEmpty())
return to_valid_name("auto");
if(is_valid_name(name))
return name;
for(int index = 0;; ++index)
{
QString ret = QString("%1 (%2)").arg(name).arg(index);
if(is_valid_name(ret))
return ret;
}
}
template<typename TracerObject>
void NameResourcePool<TracerObject>::show_edit_panel(
ResourcePanel<TracerObject> *rsc, bool display_rsc_panel)
{
editor_->show_resource_panel(rsc, display_rsc_panel);
}
template<typename TracerObject>
QWidget *NameResourcePool<TracerObject>::get_widget()
{
return widget_;
}
template class NameResourcePool<tracer::Geometry>;
template class NameResourcePool<tracer::Medium>;
AGZ_EDITOR_END
| 30.32967 | 87 | 0.633937 | AirGuanZ |
1f29a5cd76154351d80fd0ef6dbc700209f3948b | 13,760 | cc | C++ | src/op_mysql/op_mysql.cc | zettadb/zettalib | 3d5f96dc9e3e4aa255f4e6105489758944d37cc4 | [
"Apache-2.0"
] | null | null | null | src/op_mysql/op_mysql.cc | zettadb/zettalib | 3d5f96dc9e3e4aa255f4e6105489758944d37cc4 | [
"Apache-2.0"
] | null | null | null | src/op_mysql/op_mysql.cc | zettadb/zettalib | 3d5f96dc9e3e4aa255f4e6105489758944d37cc4 | [
"Apache-2.0"
] | 2 | 2022-02-27T14:00:01.000Z | 2022-03-31T06:24:22.000Z | /*
Copyright (c) 2019-2021 ZettaDB inc. All rights reserved.
This source code is licensed under Apache 2.0 License,
combined with Common Clause Condition 1.0, as detailed in the NOTICE file.
*/
#include "op_mysql.h"
#include "error.h"
#include "stdlib.h"
#include "string.h"
#include <sys/stat.h>
#ifdef ZETTA_LIB_COMPILER
#include "tool_func/tool_func.h"
#else
#include "zettalib/tool_func.h"
#endif
#include <memory>
#include <sys/types.h>
#include <vector>
using namespace kunlun;
using namespace std;
bool MysqlResult::Parse(MYSQL_RES *raw_mysql_res) {
raw_mysql_res_ = raw_mysql_res;
if (!raw_mysql_res_) {
setErr("Invalid MySQL result handler");
return false;
}
// fill column_index_map_ index_column_map_
fields_num_ = mysql_num_fields(raw_mysql_res_);
MYSQL_FIELD *fields = mysql_fetch_fields(raw_mysql_res_);
for (unsigned int i = 0; i < fields_num_; i++) {
column_index_map_[fields[i].name] = i;
index_column_map_[i] = fields[i].name;
}
// fill result_vec_
MYSQL_ROW mysql_raw_row;
while ((mysql_raw_row = mysql_fetch_row(raw_mysql_res_)) != nullptr) {
unsigned long *length_array = mysql_fetch_lengths(raw_mysql_res_);
MysqlResRow *row = new MysqlResRow(column_index_map_);
row->initByMysqlRawRes(mysql_raw_row, length_array, fields_num_);
result_vec_.push_back(row);
}
// mysql_free_result(raw_mysql_res_);
return true;
}
void MysqlResult::Clean() {
for (unsigned int i = 0; i < result_vec_.size(); i++) {
delete (result_vec_[i]);
}
result_vec_.clear();
raw_mysql_res_ = nullptr;
column_index_map_.clear();
index_column_map_.clear();
fields_num_ = 0;
return;
}
void MysqlConnection::Reconnect() {
Close();
Connect();
}
void MysqlConnection::Close() {
if (mysql_raw_ != nullptr) {
mysql_close(mysql_raw_);
delete mysql_raw_;
mysql_raw_ = nullptr;
}
return;
}
bool MysqlConnection::Connect() {
ENUM_SQL_CONNECT_TYPE connect_type = mysql_connection_option_.connect_type;
if (connect_type == TCP_CONNECTION) {
return ConnectImplByTcp();
} else if (connect_type == UNIX_DOMAIN_CONNECTION) {
return ConnectImplByUnix();
}
setErr("Unknown Connect Type, Tcp or Unix-domain is legal");
return false;
}
bool MysqlConnection::SetAutoCommit() {
char set_autocommit[1024] = {'\0'};
if (mysql_connection_option_.autocommit) {
sprintf(set_autocommit, "set session autocommit = 1");
} else {
sprintf(set_autocommit, "set session autocommit = 0");
}
MysqlResult res;
int ret = ExcuteQuery(set_autocommit, &res, false);
return ret == 0;
}
bool MysqlConnection::CheckIsConnected() {
if (mysql_raw_ != nullptr) {
return true;
}
if (reconnect_support_) {
return Connect();
}
setErr("MySQL connection is not established and reconnect is disabled");
return false;
}
// sql_stmt: select / set / DDL ,return 0 means success, other than failed
// result_set hold the retrived data
// sql_stmt: update / delete / insert , return >0 , 0 , <0 respectively,
// successfuly, no effect or failed
//
// retry: will do the query one more time if failed. Be careful when the query
// is in a active transaction context, retry may cause previous statment
// rollback and start another new trx to do the current query, this will
// cause the unexpected behavior. so set 'force_retry' to false if you do
// not excactlly understand what happend inside
//
// This function support reconnect if set the flag
//
int MysqlConnection::ExcuteQuery(const char *sql_stmt, MysqlResult *result_set,
bool force_retry) {
#define QUERY_FAILD -1
// clean the result_set
result_set->Clean();
// reset errno
last_errno_ = 0;
// if reconnect flag is set, will do connect()
if (!CheckIsConnected()) {
return QUERY_FAILD;
}
// do the query
int ret = mysql_query(mysql_raw_, sql_stmt);
if (ret == 0) {
// mysql_query() successfully
MYSQL_RES *query_result = nullptr;
query_result = mysql_use_result(mysql_raw_);
unsigned long affect_rows = 0;
if (query_result == nullptr) {
// maybe the statement dose not generate result set
// insert/update/delete/set ..
affect_rows = mysql_affected_rows(mysql_raw_);
if (affect_rows == (uint64_t)~0) {
// error occour
last_errno_ = mysql_errno(mysql_raw_);
setErr("execute query failed: %s, error number: %d, sql: %s ",
mysql_error(mysql_raw_), last_errno_, sql_stmt);
return QUERY_FAILD;
}
return affect_rows;
} else {
bool ret = result_set->Parse(query_result);
mysql_free_result(query_result);
if (!ret) {
setErr("%s", result_set->getErr());
return QUERY_FAILD;
}
return 0;
}
}
// mysql_query() failed
last_errno_ = mysql_errno(mysql_raw_);
if (last_errno_ == CR_SERVER_GONE_ERROR || last_errno_ == CR_SERVER_LOST) {
if (force_retry) {
Reconnect();
// we set 'force_retry' to false, only requery once
return ExcuteQuery(sql_stmt, result_set, false);
}
Close();
setErr("execute query failed [this lead to connection closed]: %s, error "
"number: %d, sql: %s",
mysql_error(mysql_raw_), last_errno_, sql_stmt);
return QUERY_FAILD;
} else if (last_errno_ == CR_COMMANDS_OUT_OF_SYNC ||
last_errno_ == CR_UNKNOWN_ERROR) {
// close this connect immedietlly
Close();
setErr("execute query failed [this lead to connection closed]: %s, error "
"number: %d, sql: %s",
mysql_error(mysql_raw_), last_errno_, sql_stmt);
return QUERY_FAILD;
} else if (last_errno_ == ER_DUP_ENTRY) {
// here we treat duplicate key as affected_num == 0
setErr("execute query failed: %s, error number: %d, sql: %s ",
mysql_error(mysql_raw_), last_errno_, sql_stmt);
return 0;
} else {
// normall error
setErr("execute query failed: %s, error number: %d, sql: %s ",
mysql_error(mysql_raw_), last_errno_, sql_stmt);
return QUERY_FAILD;
}
// can not reach here
return QUERY_FAILD;
}
bool MysqlConnection::ConnectImplByTcp() {
if (mysql_raw_) {
setErr("connection to mysql already established");
return false;
}
// TODO: connection option is legal
mysql_raw_ = new MYSQL;
mysql_init(mysql_raw_);
// set options
// connect timeout
mysql_options(
mysql_raw_, MYSQL_OPT_CONNECT_TIMEOUT,
(const void *)(&(mysql_connection_option_.connect_timeout_sec)));
// read/write timeout
mysql_options(mysql_raw_, MYSQL_OPT_READ_TIMEOUT,
(const void *)(&(mysql_connection_option_.timeout_sec)));
mysql_options(mysql_raw_, MYSQL_OPT_WRITE_TIMEOUT,
(const void *)(&(mysql_connection_option_.timeout_sec)));
// charset
mysql_options(mysql_raw_, MYSQL_SET_CHARSET_NAME,
mysql_connection_option_.charset.c_str());
mysql_options(mysql_raw_, MYSQL_DEFAULT_AUTH, "mysql_native_password");
// do realconnect()
MysqlConnectionOption op = mysql_connection_option_;
if (nullptr ==
mysql_real_connect(mysql_raw_, op.ip.c_str(), op.user.c_str(),
op.password.c_str(),
op.database.empty() ? op.database.c_str() : nullptr,
op.port_num, NULL, 0)) {
last_errno_ = mysql_errno(mysql_raw_);
setErr("mysql_real_connect faild, Errno: %d, info: %s", last_errno_,
mysql_error(mysql_raw_));
Close();
return false;
}
// connect successfully
// set database if exists
if (!op.database.empty() &&
mysql_select_db(mysql_raw_, op.database.c_str()) != 0) {
last_errno_ = mysql_errno(mysql_raw_);
setErr("set connection default database [%s] faild, Errno: %d, info: %s",
op.database.c_str(), last_errno_, mysql_error(mysql_raw_));
Close();
return false;
}
return SetAutoCommit();
}
bool MysqlConnection::ConnectImplByUnix() {
if (mysql_raw_) {
setErr("connection to mysql already established");
return false;
}
// TODO: connection option is legal
mysql_raw_ = new MYSQL;
mysql_init(mysql_raw_);
// set options
// connect timeout
mysql_options(
mysql_raw_, MYSQL_OPT_CONNECT_TIMEOUT,
(const void *)(&(mysql_connection_option_.connect_timeout_sec)));
// read/write timeout
mysql_options(mysql_raw_, MYSQL_OPT_READ_TIMEOUT,
(const void *)(&(mysql_connection_option_.timeout_sec)));
mysql_options(mysql_raw_, MYSQL_OPT_WRITE_TIMEOUT,
(const void *)(&(mysql_connection_option_.timeout_sec)));
// charset
mysql_options(mysql_raw_, MYSQL_SET_CHARSET_NAME,
mysql_connection_option_.charset.c_str());
// do realconnect()
MysqlConnectionOption op = mysql_connection_option_;
if (nullptr ==
mysql_real_connect(mysql_raw_, NULL, op.user.c_str(), op.password.c_str(),
op.database.empty() ? op.database.c_str() : nullptr, 0,
op.file_path.c_str(), 0)) {
last_errno_ = mysql_errno(mysql_raw_);
setErr("mysql_real_connect faild, Errno: %d, info: %s", last_errno_,
mysql_error(mysql_raw_));
Close();
return false;
}
// connect successfully
// set database if exists
if (!op.database.empty() &&
mysql_select_db(mysql_raw_, op.database.c_str()) != 0) {
last_errno_ = mysql_errno(mysql_raw_);
setErr("set connection default database [%s] faild, Errno: %d, info: %s",
op.database.c_str(), last_errno_, mysql_error(mysql_raw_));
Close();
return false;
}
return SetAutoCommit();
}
bool MgrMysqlConnection::parseSeeds(std::vector<std::string> &container) {
if (user_.empty()) {
setErr("username is empty");
return false;
}
if (passwd_.empty()) {
setErr("password is empty");
return false;
}
auto iter = container.begin();
for (; iter != container.end(); iter++) {
auto item = (*iter);
auto ip_port = kunlun::StringTokenize(item, ":");
if (ip_port.size() != 2) {
setErr("group seeds: %s misformate", group_seeds_.c_str());
return false;
}
std::unique_ptr<MysqlConnectionOption> ptr(new MysqlConnectionOption);
ptr->ip = ip_port[0]; // ip
ptr->port_str = ip_port[1]; // port
ptr->port_num = (unsigned int)(::atoi(ip_port[1].c_str()));
ptr->user = user_;
ptr->password = passwd_;
auto i = mgr_member_options_.find(*iter);
if (i == mgr_member_options_.end()) {
mgr_member_options_[*iter] = std::move(ptr);
} else {
setErr("mgr member in the group seeds: %s has the overlap hostaddr",
group_seeds_.c_str());
return false;
}
}
return true;
}
bool MgrMysqlConnection::isValidPrimary(MysqlConnection *conn) {
char sql[4096] = {'\0'};
snprintf(sql, 4096,
"select MEMBER_HOST, MEMBER_PORT from "
"performance_schema.replication_group_members where MEMBER_ROLE = "
"'PRIMARY' and MEMBER_STATE = 'ONLINE");
kunlun::MysqlResult result;
int ret = conn->ExcuteQuery(sql, &result);
// only support single master mgr mode
if (ret != 0 || result.GetResultLinesNum() != 1) {
return false;
}
return true;
}
bool MgrMysqlConnection::refreshMaster() {
int master_found = false;
auto iter = mgr_member_conn_.begin();
for (; iter != mgr_member_conn_.end(); ++iter) {
MysqlConnection *conn = iter->second.get();
if ((conn->CheckIsConnected()) && // will do reconnect
isValidPrimary(conn)) {
master_found = true;
master_ = conn;
break;
}
}
if (!master_found) {
setErr("no avilable master in current group");
}
return master_found;
}
MysqlConnection *MgrMysqlConnection::get_master() { return master_; }
bool MgrMysqlConnection::init() {
if (group_seeds_.empty()) {
setErr("group seeds is empty");
return false;
}
auto container = kunlun::StringTokenize(group_seeds_, ",");
if (!parseSeeds(container)) {
return false;
}
// init member mysql connection handler
auto iter = mgr_member_options_.begin();
for (; iter != mgr_member_options_.end(); iter++) {
MysqlConnectionOption *option = (iter->second).get();
std::unique_ptr<MysqlConnection> ptr(new MysqlConnection(*option));
ptr->Connect();
mgr_member_conn_[iter->first] = std::move(ptr);
}
return refreshMaster();
}
bool StorageShardConnection::isValidPrimary(MysqlConnection *conn) {
if (!(conn->CheckIsConnected())) { // will do reconnect
setErr("current connection is not connected");
return false;
}
char sql_buff[1024] = {'\0'};
snprintf(sql_buff, 1024, "set autocommit = 0");
kunlun::MysqlResult result;
int ret = conn->ExcuteQuery(sql_buff, &result);
if (ret != 0) {
setErr("error info :%s", conn->getErr());
return false;
}
bzero((void *)sql_buff, 1024);
result.Clean();
// begin
snprintf(sql_buff, 1024, "begin");
ret = conn->ExcuteQuery(sql_buff, &result);
if (ret != 0) {
setErr("error info :%s", conn->getErr());
return false;
}
bzero((void *)sql_buff, 1024);
result.Clean();
// insert tmp value to the kunlun_sysdb.cluster_info
snprintf(sql_buff, 1024,
"insert into kunlun_sysdb.cluster_info (id,cluster_name,shard_name) "
"values (100,'tmpname','tmpname')");
ret = conn->ExcuteQuery(sql_buff, &result);
if (ret <= 0) {
setErr("error info :%s", conn->getErr());
conn->Close();
return false;
}
// rollback
snprintf(sql_buff, 1024, "rollback");
ret = conn->ExcuteQuery(sql_buff, &result);
if (ret != 0) {
setErr("error info :%s", conn->getErr());
conn->Close();
return false;
}
return true;
}
| 30.241758 | 80 | 0.659956 | zettadb |
1f2a14b538c40588484eb426a9886a93e77a21fd | 283 | cc | C++ | jax/training/21-03/21-03-23-night/c.cc | JaxVanYang/acm | ee41f1cbf692b7b1463a9467401bb6e7d38aecce | [
"MIT"
] | 2 | 2022-01-01T16:55:02.000Z | 2022-03-16T14:47:29.000Z | jax/training/21-03/21-03-23-night/c.cc | JaxVanYang/acm | ee41f1cbf692b7b1463a9467401bb6e7d38aecce | [
"MIT"
] | null | null | null | jax/training/21-03/21-03-23-night/c.cc | JaxVanYang/acm | ee41f1cbf692b7b1463a9467401bb6e7d38aecce | [
"MIT"
] | null | null | null | #include <iostream>
using namespace std;
const int maxn = 505;
const int maxl = 2000;
char strs[maxn][maxl];
int main() {
int t;
cin >> t;
for (int i = 1; i <= t; ++i) {
int n;
for (int i = 1; i <= n; ++i) scanf("%s", strs + i);
string s;
}
} | 18.866667 | 59 | 0.487633 | JaxVanYang |
1f2a8e876145e8e862f63845b45959c03eba270d | 2,221 | cpp | C++ | Tests/UnitTests/Core/Time/SecondTests.cpp | SapphireSuite/Engine | f29821853aec6118508f31d3e063e83e603f52dd | [
"MIT"
] | 1 | 2022-01-20T23:17:18.000Z | 2022-01-20T23:17:18.000Z | Tests/UnitTests/Core/Time/SecondTests.cpp | SapphireSuite/Engine | f29821853aec6118508f31d3e063e83e603f52dd | [
"MIT"
] | null | null | null | Tests/UnitTests/Core/Time/SecondTests.cpp | SapphireSuite/Engine | f29821853aec6118508f31d3e063e83e603f52dd | [
"MIT"
] | null | null | null | // Copyright (c) 2021 Sapphire's Suite. All Rights Reserved.
#include <UnitTestHelper>
#include <SA/Collections/Time>
using namespace Sa;
namespace Sa::Second_UT
{
void Constants()
{
static_assert(1.0f / Second::ToTicks == Tick::ToSeconds, "1 / Second::ToTicks != Tick::ToSeconds");
static_assert(1.0f / Second::ToMilliSeconds == MilliSecond::ToSeconds, "1 / Second::ToMilliSeconds != MilliSecond::ToSeconds!");
static_assert(Second::ToMinutes == 1.0f / Minute::ToSeconds, "Second::ToMinutes != 1 / Minute::ToSeconds!");
static_assert(Second::ToHours == 1.0f / Hour::ToSeconds, "Second::ToHours != 1 / Hour::ToSeconds!");
}
void Constructors()
{
const Second t1 = 2.5f;
SA_UTH_EQ(static_cast<float>(t1), 2.5f);
const Second t2 = 4000_ui64;
SA_UTH_EQ(static_cast<uint64>(t2), 4000_ui64);
const Tick tick = 1.0f;
const Second t3 = tick;
SA_UTH_EQ(static_cast<float>(t3), 0.000001f);
const MilliSecond mil = 1.0f;
const Second t4 = mil;
SA_UTH_EQ(static_cast<float>(t4), 0.001f);
const Minute min = 1.0f;
const Second t5 = min;
SA_UTH_EQ(static_cast<float>(t5), 60.0f);
const Hour hour = 1.0f;
const Second t6 = hour;
SA_UTH_EQ(static_cast<float>(t6), 3600.0f);
}
void Casts()
{
const Second t1 = 2.5f;
float f = static_cast<float>(t1);
SA_UTH_EQ(f, 2.5f);
const Second t2 = 4000_ui64;
uint64 u = static_cast<uint64>(t2);
SA_UTH_EQ(u, 4000_ui64);
const Second t3 = 0.000001f;
const Tick tick = t3.operator Tick();
SA_UTH_EQ(static_cast<float>(tick), 1.0f);
const Second t4 = 0.001f;
const MilliSecond mil = t4.operator MilliSecond();
SA_UTH_EQ(static_cast<float>(mil), 1.0f);
const Second t5 = 60.0f;
const Minute min = t5.operator Minute();
SA_UTH_EQ(static_cast<float>(min), 1.0f);
const Second t6 = 3600.0f;
const Hour hour = t6.operator Hour();
SA_UTH_EQ(static_cast<float>(hour), 1.0f);
}
void Literal()
{
const Second t1 = 2.5_sec;
SA_UTH_EQ(static_cast<float>(t1), 2.5f);
const Second t2 = 4000_sec;
SA_UTH_EQ(static_cast<uint64>(t2), 4000_ui64);
}
}
void SecondTests()
{
using namespace Second_UT;
SA_UTH_GP(Constants());
SA_UTH_GP(Constructors());
SA_UTH_GP(Casts());
SA_UTH_GP(Literal());
}
| 24.141304 | 130 | 0.683926 | SapphireSuite |
1f2b33c45d51597918953f78724114fb628f0d30 | 566 | cpp | C++ | sg/generator/Generator.cpp | ebachard/ospray_studio | 78928c93b482f9f95aa300c8f58c728dadedbe2f | [
"Apache-2.0"
] | null | null | null | sg/generator/Generator.cpp | ebachard/ospray_studio | 78928c93b482f9f95aa300c8f58c728dadedbe2f | [
"Apache-2.0"
] | null | null | null | sg/generator/Generator.cpp | ebachard/ospray_studio | 78928c93b482f9f95aa300c8f58c728dadedbe2f | [
"Apache-2.0"
] | null | null | null | // Copyright 2009-2022 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
#include "Generator.h"
namespace ospray {
namespace sg {
Generator::Generator()
{
createChild("parameters");
}
NodeType Generator::type() const
{
return NodeType::GENERATOR;
}
void Generator::preCommit()
{
// Re-run generator on parameter changes in the UI
if (child("parameters").isModified())
generateData();
}
void Generator::postCommit()
{
}
void Generator::generateData()
{
}
} // namespace sg
} // namespace ospray
| 15.722222 | 54 | 0.64841 | ebachard |
1f2c827f768c52a73e73bf70aaf2df3859142f33 | 717 | hpp | C++ | Code/Engine/Math/FloatRange.hpp | yixuan-wei/PersonalEngine | 6f3b1df3ddeb662fbf65ca8b3ea7ddb446ef5a20 | [
"MIT"
] | 1 | 2021-06-11T06:41:29.000Z | 2021-06-11T06:41:29.000Z | Code/Engine/Math/FloatRange.hpp | yixuan-wei/PersonalEngine | 6f3b1df3ddeb662fbf65ca8b3ea7ddb446ef5a20 | [
"MIT"
] | 1 | 2022-02-25T07:46:54.000Z | 2022-02-25T07:46:54.000Z | Code/Engine/Math/FloatRange.hpp | yixuan-wei/PersonalEngine | 6f3b1df3ddeb662fbf65ca8b3ea7ddb446ef5a20 | [
"MIT"
] | null | null | null | #pragma once
#include <string>
class RandomNumberGenerator;
struct FloatRange
{
public:
float minimum = 0.f;
float maximum = 0.f;
public:
FloatRange() = default;
explicit FloatRange( float minAndMax );
explicit FloatRange( float initStart, float initEnd );
explicit FloatRange( const char* asText );
~FloatRange() = default;
//Accessors
bool IsInRange( float value ) const;
bool DoesOverlap( const FloatRange& otherRange )const;
std::string GetAsString() const;
float GetRandomInRange( RandomNumberGenerator& rng ) const;
bool operator!=( const FloatRange& compare ) const;
//Mutators
void Set( float newMinimum, float newMaximum );
bool SetFromText( const char* text );
}; | 23.129032 | 66 | 0.72106 | yixuan-wei |
1f2e21c6c089861783b0d9498512b8e29c6b3abe | 312 | cpp | C++ | aql/benchmark/lib_33/class_9.cpp | menify/sandbox | 32166c71044f0d5b414335b2b6559adc571f568c | [
"MIT"
] | null | null | null | aql/benchmark/lib_33/class_9.cpp | menify/sandbox | 32166c71044f0d5b414335b2b6559adc571f568c | [
"MIT"
] | null | null | null | aql/benchmark/lib_33/class_9.cpp | menify/sandbox | 32166c71044f0d5b414335b2b6559adc571f568c | [
"MIT"
] | null | null | null | #include "class_9.h"
#include "class_5.h"
#include "class_8.h"
#include "class_4.h"
#include "class_2.h"
#include "class_6.h"
#include <lib_32/class_6.h>
#include <lib_31/class_4.h>
#include <lib_24/class_5.h>
#include <lib_32/class_2.h>
#include <lib_32/class_1.h>
class_9::class_9() {}
class_9::~class_9() {}
| 20.8 | 27 | 0.714744 | menify |
1f30c63fc7d2c6e1d9a6bf0975ac1d1c817347e2 | 48,974 | cpp | C++ | src/Generic/events/stat/EventTriggerFinder.cpp | BBN-E/serif | 1e2662d82fb1c377ec3c79355a5a9b0644606cb4 | [
"Apache-2.0"
] | 1 | 2022-03-24T19:57:00.000Z | 2022-03-24T19:57:00.000Z | src/Generic/events/stat/EventTriggerFinder.cpp | BBN-E/serif | 1e2662d82fb1c377ec3c79355a5a9b0644606cb4 | [
"Apache-2.0"
] | null | null | null | src/Generic/events/stat/EventTriggerFinder.cpp | BBN-E/serif | 1e2662d82fb1c377ec3c79355a5a9b0644606cb4 | [
"Apache-2.0"
] | null | null | null | // Copyright 2008 by BBN Technologies Corp.
// All Rights Reserved.
#include "Generic/common/leak_detection.h"
#include "Generic/events/stat/EventTriggerFinder.h"
#include "Generic/events/stat/EventTriggerFeatureType.h"
#include "Generic/events/stat/EventTriggerFeatureTypes.h"
#include "Generic/events/stat/EventTriggerSentence.h"
#include "Generic/events/stat/PotentialEventMention.h"
#include "Generic/events/stat/EventTriggerObservation.h"
#include "Generic/events/stat/ETProbModelSet.h"
#include "Generic/docRelationsEvents/DocEventHandler.h"
#include "Generic/maxent/MaxEntModel.h"
#include "Generic/discTagger/P1Decoder.h"
#include "Generic/discTagger/DTFeatureTypeSet.h"
#include "Generic/discTagger/DTTagSet.h"
#include "Generic/common/UnexpectedInputException.h"
#include "Generic/common/ParamReader.h"
#include "Generic/common/Sexp.h"
#include "Generic/parse/LanguageSpecificFunctions.h"
#include "Generic/theories/TokenSequence.h"
#include "Generic/theories/Parse.h"
#include "Generic/theories/SynNode.h"
#include "Generic/theories/PropositionSet.h"
#include "Generic/theories/EventMentionSet.h"
#include "Generic/theories/ValueMentionSet.h"
#include "Generic/theories/EventMention.h"
#include "Generic/theories/NodeInfo.h"
EventTriggerFinder::EventTriggerFinder(int mode_) : MODE(mode_)
{
resetRoundRobinStatistics();
_observation = _new EventTriggerObservation();
EventTriggerFeatureTypes::ensureFeatureTypesInstantiated();
WordClusterTable::ensureInitializedFromParamFile();
// DEBUGGING OUTPUT
std::string buffer = ParamReader::getParam("event_trigger_debug");
DEBUG = (!buffer.empty());
if (DEBUG) _debugStream.open(buffer.c_str());
// TAG SET
std::string tag_set_file = ParamReader::getRequiredParam("event_trigger_tag_set_file");
_tagSet = _new DTTagSet(tag_set_file.c_str(), false, false);
_tagScores = _new double[_tagSet->getNTags()];
_tagFound = _new bool[_tagSet->getNTags()];
// FEATURES
std::string features_file = ParamReader::getRequiredParam("event_trigger_features_file");
_featureTypes = _new DTFeatureTypeSet(features_file.c_str(), EventTriggerFeatureType::modeltype);
_use_p1_model = ParamReader::getRequiredTrueFalseParam("et_use_p1_model");
_use_maxent_model = ParamReader::getRequiredTrueFalseParam("et_use_maxent_model");
_documentTopic = Symbol();
if (MODE == DECODE) {
// RECALL THRESHOLD
const string decode_dump_file = ParamReader::getParam("decode_dump_file");
if (decode_dump_file != "") {
SessionLogger::info("SERIF") << "Dumping feature vectors to " << decode_dump_file;
}
_recall_threshold = ParamReader::getRequiredFloatParam("event_trigger_recall_threshold");
_probModelSet = _new ETProbModelSet(_tagSet, _tagScores, _recall_threshold);
_p1Weights = 0;
_maxentWeights = 0;
_p1Model = 0;
_maxentModel = 0;
_probModelSet->clearModels();
if (_use_p1_model) {
_p1_overgen_percentage = (float) ParamReader::getRequiredFloatParam("et_p1_recall_threshold");
} else _p1_overgen_percentage = 0;
// MODEL FILE
std::string model_file = ParamReader::getParam("event_trigger_model_file");
if (!model_file.empty())
{
_probModelSet->loadModels(model_file.c_str());
if (_use_p1_model) {
std::string buffer = model_file + ".p1";
_p1Weights = _new DTFeature::FeatureWeightMap(50000);
DTFeature::readWeights(*_p1Weights, buffer.c_str(), EventTriggerFeatureType::modeltype);
_p1Model = _new P1Decoder(_tagSet, _featureTypes, _p1Weights,
_p1_overgen_percentage, false);
}
if (_use_maxent_model) {
std::string buffer = model_file + ".maxent";
_maxentWeights = _new DTFeature::FeatureWeightMap(50000);
DTFeature::readWeights(*_maxentWeights, buffer.c_str(), EventTriggerFeatureType::modeltype);
_maxentModel = _new MaxEntModel(_tagSet, _featureTypes, _maxentWeights);
}
} else if (!ParamReader::hasParam("event_round_robin_setup")) {
throw UnexpectedInputException("EventTriggerFinder::EventTriggerFinder()",
"Neither parameter 'event_trigger_model' nor 'event_round_robin_setup' specified");
}
} else if (MODE == TRAIN) {
const string train_vector_file = ParamReader::getParam("training_vectors_file");
if (train_vector_file != "") {
SessionLogger::info("SERIF") << "Dumping feature vectors to " << train_vector_file;
}
if (_use_p1_model) {
_p1Weights = _new DTFeature::FeatureWeightMap(50000);
_p1Model = _new P1Decoder(_tagSet, _featureTypes, _p1Weights, true);
if (train_vector_file != "") {
_p1Model->setLogFile(train_vector_file);
}
// SEED FEATURES
_seed_features = ParamReader::getRequiredTrueFalseParam("et_p1_trainer_seed_features");
} else {
_p1Model = 0;
_p1Weights = 0;
_seed_features = 0;
}
if (_use_maxent_model) {
// PERCENT HELD OUT
int percent_held_out =
ParamReader::getRequiredIntParam("et_maxent_trainer_percent_held_out");
if (percent_held_out < 0 || percent_held_out > 50)
throw UnexpectedInputException("EventTriggerFinder::EventTriggerFinder()",
"Parameter 'et_maxent_trainer_percent_held_out' must be between 0 and 50");
// MAX NUMBER OF ITERATIONS (STOPPING CONDITION)
int max_iterations =
ParamReader::getRequiredIntParam("et_maxent_trainer_max_iterations");
// GAUSSIAN PRIOR VARIANCE
double variance = ParamReader::getRequiredFloatParam("et_maxent_trainer_gaussian_variance");
// MIN CHANGE IN LIKELIHOOD (STOPPING CONDITION)
double likelihood_delta = ParamReader::getOptionalFloatParamWithDefaultValue("et_maxent_trainer_min_likelihood_delta", .0001);
// FREQUENCY OF STOPPING CONDITION CHECKS (NUM ITERATIONS)
int stop_check_freq = ParamReader::getOptionalIntParamWithDefaultValue("et_maxent_trainer_stop_check_frequency",1);
_maxentWeights = _new DTFeature::FeatureWeightMap(50000);
_maxentModel = _new MaxEntModel(_tagSet, _featureTypes, _maxentWeights,
MaxEntModel::SCGIS, percent_held_out, max_iterations, variance,
likelihood_delta, stop_check_freq, train_vector_file.c_str(), "");
} else {
_maxentModel = 0;
_maxentWeights = 0;
}
_probModelSet = _new ETProbModelSet(_tagSet, _tagScores, 0);
_probModelSet->createEmptyModels();
}
}
EventTriggerFinder::~EventTriggerFinder() {
delete _probModelSet;
delete _p1Model;
delete _p1Weights;
delete _maxentModel;
delete _maxentWeights;
delete _tagSet;
delete _featureTypes;
delete _observation;
delete [] _tagScores;
}
void EventTriggerFinder::replaceModel(char *model_file) {
delete _p1Weights;
delete _p1Model;
delete _maxentWeights;
delete _maxentModel;
std::string model_file_str(model_file);
if (_use_p1_model) {
std::string buffer = model_file_str + ".p1";
_p1Weights = _new DTFeature::FeatureWeightMap(50000);
DTFeature::readWeights(*_p1Weights, buffer.c_str(), EventTriggerFeatureType::modeltype);
_p1Model = _new P1Decoder(_tagSet, _featureTypes, _p1Weights,
_p1_overgen_percentage, false);
} else {
_p1Model = 0;
_p1Weights = 0;
}
if (_use_maxent_model) {
std::string buffer = model_file_str + ".maxent";
_maxentWeights = _new DTFeature::FeatureWeightMap(50000);
DTFeature::readWeights(*_maxentWeights, buffer.c_str(), EventTriggerFeatureType::modeltype);
_maxentModel = _new MaxEntModel(_tagSet, _featureTypes, _maxentWeights);
} else {
_maxentModel = 0;
_maxentWeights = 0;
}
_probModelSet->deleteModels();
_probModelSet->loadModels(model_file);
}
void EventTriggerFinder::roundRobinDecode(TokenSequence **tokenSequences, Parse **parses,
ValueMentionSet **valueMentionSets, MentionSet **mentionSets,
PropositionSet **propSets, EventMentionSet **esets,
int nsentences,
UTF8OutputStream& resultStream,
UTF8OutputStream& HRresultStream,
UTF8OutputStream& keyStream,
UTF8OutputStream& htmlStream)
{
if (MODE != DECODE)
return;
int eventTypes[MAX_SENTENCE_TOKENS];
int nEventArgs[MAX_SENTENCE_TOKENS];
EventMention *tmpEvents[MAX_TOKEN_TRIGGERS];
for (int i = 0; i < nsentences; i++) {
const TokenSequence *tseq = tokenSequences[i];
if (tseq->getSentenceNumber() == 0)
_documentTopic = DocEventHandler::assignTopic(tokenSequences, parses, i, nsentences);
for (int j = 0; j < tseq->getNTokens(); j++) {
eventTypes[j] = 0;
nEventArgs[j] = 0;
}
for (int ement = 0; ement < esets[i]->getNEventMentions(); ement++) {
EventMention *em = esets[i]->getEventMention(ement);
if (_tagSet->getTagIndex(em->getEventType()) == -1) {
throw UnexpectedInputException("EventTriggerFinder::roundRobinDecode()",
"Invalid event type in training file");
}
eventTypes[em->getAnchorNode()->getStartToken()] = _tagSet->getTagIndex(em->getEventType());
nEventArgs[em->getAnchorNode()->getStartToken()] = em->getNArgs();
}
for (int k = 0; k < tseq->getNTokens(); k++) {
int correct_answer = eventTypes[k];
if (correct_answer != _tagSet->getNoneTagIndex()) {
keyStream << L"<ENAMEX TYPE=\""
<< _tagSet->getTagSymbol(correct_answer).to_string() << L"\">";
}
keyStream << tseq->getToken(k)->getSymbol().to_string();
if (correct_answer != _tagSet->getNoneTagIndex()) {
keyStream << L"</ENAMEX>";
}
keyStream << L" ";
//Decode to get label for token
int n_system_answers = 0;
processToken(k, tseq, parses[i], mentionSets[i],
propSets[i], tmpEvents, n_system_answers, MAX_TOKEN_TRIGGERS);
// Return answer with highest score
int system_answer = _tagSet->getNoneTagIndex();
float this_score, system_score = 0;
for (int m = 0; m < n_system_answers; m++) {
this_score = exp(tmpEvents[m]->getScore());
if (this_score > system_score) {
system_score = this_score;
system_answer = _tagSet->getTagIndex(tmpEvents[m]->getEventType());
}
}
for (int n = 0; n < n_system_answers; n++)
delete tmpEvents[n];
/*
// Combine model results
int p1_answer = _tagSet->getNoneTagIndex();
int maxent_answer = _tagSet->getNoneTagIndex();
if (_use_p1_model)
p1_answer = _p1Model->decodeToInt(_observation);
if (_use_maxent_model)
maxent_answer = decodeToMaxentDistribution();
int pm_answer = _probModelSet->getAnswer(_observation);
int system_answer = pm_answer;
float system_score = 0;
if (system_answer == _tagSet->getNoneTagIndex())
system_answer = p1_answer;
if (system_answer == _tagSet->getNoneTagIndex())
system_answer = maxent_answer;
*/
//Update calculating recall, precision during round robbin
updateRRCounts(correct_answer, system_answer, nEventArgs[k]);
//Print to HTML output file with correct/missing/spurious
if (correct_answer == system_answer) {
if (correct_answer != _tagSet->getNoneTagIndex()) {
printHTMLSentence(htmlStream, tseq, k, correct_answer, system_answer, system_score);
}
} else if (correct_answer == _tagSet->getNoneTagIndex()) {
printHTMLSentence(htmlStream, tseq, k, correct_answer, system_answer, system_score);
} else if (system_answer == _tagSet->getNoneTagIndex()) {
htmlStream<<"<b>Number of Correct Event Args: "<<nEventArgs[k]<<"</b><br>\n";
printHTMLSentence(htmlStream, tseq, k, correct_answer, system_answer, system_score);
htmlStream<<"<b>CorrectFeatures: <br></b>\n";
_p1Model->printHTMLDebugInfo(_observation, correct_answer, htmlStream);
htmlStream<<"<br>\n<b>NoneFeatures: </b><br>\n";
_p1Model->printHTMLDebugInfo(_observation, _tagSet->getNoneTagIndex(), htmlStream);
} else {
printHTMLSentence(htmlStream, tseq, k, correct_answer, system_answer, system_score);
}
//Print enamex Style output
if (system_answer != _tagSet->getNoneTagIndex()) {
resultStream << L"<ENAMEX TYPE=\""
<< _tagSet->getTagSymbol(system_answer).to_string() << L"\">";
}
resultStream << tseq->getToken(k)->getSymbol().to_string();
if (system_answer != _tagSet->getNoneTagIndex()) {
resultStream << L"</ENAMEX>";
}
resultStream << L" ";
}
resultStream << L"\n\n";
HRresultStream << L"\n\n";
keyStream << L"\n\n";
}
}
void EventTriggerFinder::updateRRCounts(int correct, int ans, int nEventArgs ){
//which model was used for this decoding
bool use_sub_for_this_instance = false;
bool use_obj_for_this_instance = false;
bool use_only_confident_p1 = false;
selectModels(use_sub_for_this_instance, use_obj_for_this_instance, use_only_confident_p1);
std::set<int> known_tags = _p1Model->featureInTable(_observation, Symbol(L"stemmed-word")); //Symbol(L"lc-word"));
if(correct == ans){
if(correct != _tagSet->getNoneTagIndex()){
_scoringCounts[CORRECT][COUNT_ALL]++;
_scoringCounts[CORRECT][COUNT_BY_ARG]+=nEventArgs;
if (use_sub_for_this_instance || use_obj_for_this_instance) _scoringCounts[CORRECT][COUNT_PM]++;
if (known_tags.size() > 0) _scoringCounts[CORRECT][COUNT_KNOWN]++;
if (known_tags.find(correct) != known_tags.end()) _scoringCounts[CORRECT][COUNT_KNOWN_CORRECT]++;
}
}
else if(correct == _tagSet->getNoneTagIndex()){
_scoringCounts[SPURIOUS][COUNT_ALL]++;
_scoringCounts[SPURIOUS][COUNT_BY_ARG]+=nEventArgs;
if (use_sub_for_this_instance || use_obj_for_this_instance) _scoringCounts[SPURIOUS][COUNT_PM]++;
if (known_tags.size() > 0) _scoringCounts[SPURIOUS][COUNT_KNOWN]++;
if (known_tags.find(correct) != known_tags.end()) _scoringCounts[SPURIOUS][COUNT_KNOWN_CORRECT]++;
}
else if (ans == _tagSet->getNoneTagIndex()) {
_scoringCounts[MISSING][COUNT_ALL]++;
_scoringCounts[MISSING][COUNT_BY_ARG]+=nEventArgs;
if (use_sub_for_this_instance || use_obj_for_this_instance) _scoringCounts[MISSING][COUNT_PM]++;
if (known_tags.size() > 0) _scoringCounts[MISSING][COUNT_KNOWN]++;
if (known_tags.find(correct) != known_tags.end()) _scoringCounts[MISSING][COUNT_KNOWN_CORRECT]++;
}
else{
_scoringCounts[WRONG_TYPE][COUNT_ALL]++;
_scoringCounts[WRONG_TYPE][COUNT_BY_ARG]+=nEventArgs;
if (use_sub_for_this_instance || use_obj_for_this_instance) _scoringCounts[WRONG_TYPE][COUNT_PM]++;
if (known_tags.size() > 0) _scoringCounts[WRONG_TYPE][COUNT_KNOWN]++;
if (known_tags.find(correct) != known_tags.end()) _scoringCounts[WRONG_TYPE][COUNT_KNOWN_CORRECT]++;
}
}
void EventTriggerFinder::printHTMLSentence(UTF8OutputStream &out, const TokenSequence *tseq,
int index, int correct_answer, int system_answer,
float system_score)
{
for (int tok = 0; tok < tseq->getNTokens(); tok++) {
if (tok == index) {
out << L"<u><b>";
if (system_answer == correct_answer)
out << L"<font color=\"red\">";
else if (correct_answer == _tagSet->getNoneTagIndex())
out << L"<font color=\"blue\">";
else if (system_answer == _tagSet->getNoneTagIndex())
out << L"<font color=\"purple\">";
else out << L"<font color=\"green\">";
}
out << tseq->getToken(tok)->getSymbol().to_string();
if (DEBUG) _debugStream << tseq->getToken(tok)->getSymbol().to_string();
if (tok == index) {
if (system_answer == correct_answer)
out << L" (" << _tagSet->getTagSymbol(correct_answer) << L")";
else if (correct_answer == _tagSet->getNoneTagIndex())
out << L" (SPURIOUS: " << _tagSet->getTagSymbol(system_answer) << L")";
else if (system_answer == _tagSet->getNoneTagIndex())
out << L" (MISSING: " << _tagSet->getTagSymbol(correct_answer) << L")";
else {
out << L" (WRONG TYPE: " << _tagSet->getTagSymbol(system_answer);
out << L" should be " << _tagSet->getTagSymbol(correct_answer) << L")";
}
out << L"</font></u></b>";
}
out << L" ";
if (DEBUG) _debugStream << L" ";
}
//_probModelSet->decodeToDistribution(_observation, ETProbModelSet::WORD);
//out << "(system score: " << _tagScores[system_answer] << ")";
out << L"<br><br>\n";
if (DEBUG) _debugStream << L"\n\n";
out << L"Overall System Score = " << system_score << L"<br><br>\n";
bool use_sub_for_this_instance = false;
bool use_obj_for_this_instance = false;
bool use_only_confident_p1 = false;
selectModels(use_sub_for_this_instance, use_obj_for_this_instance, use_only_confident_p1);
out<<"Use Sub: "<<use_sub_for_this_instance <<" Use Obj: "<<use_obj_for_this_instance
<<" Use Only ConfP1: "<<use_only_confident_p1<<"<br>\n";
if (_use_p1_model)
printP1DebugScores(out);
if (_use_maxent_model)
printMaxentDebugScores(out);
_probModelSet->printPMDebugScores(_observation, out);
}
void EventTriggerFinder::selectAnnotation(Symbol *docIds, Symbol *docTopics,
TokenSequence **tokenSequences,
Parse **parses, ValueMentionSet **valueMentionSets,
MentionSet **mentionSets, PropositionSet **propSets,
EventMentionSet **esets, int nsentences,
UTF8OutputStream& annotationStream)
{
if (MODE != DECODE)
return;
int n_selected = 0;
for (int i = 0; i < nsentences; i++) {
const TokenSequence *tseq = tokenSequences[i];
_documentTopic = docTopics[i];
for (int k = 0; k < tseq->getNTokens(); k++) {
if (isHighValueAnnotation(k, tseq, parses[i], mentionSets[i], propSets[i])) {
printAnnotationSentence(annotationStream, docIds, tokenSequences, i, nsentences);
n_selected++;
break;
}
}
}
if (DEBUG)
_debugStream << n_selected << " out of " << nsentences << " sentences selected\n";
}
bool EventTriggerFinder::isHighValueAnnotation(int tok, const TokenSequence *tokens,
const Parse *parse, MentionSet *mentionSet, const PropositionSet *propSet)
{
bool result = false;
int p1tag = 0;
_observation->populate(tok, tokens, parse, mentionSet, propSet, true);
_observation->setDocumentTopic(_documentTopic);
double sub_lambda = 0;
if (_probModelSet->useModel(ETProbModelSet::SUB))
sub_lambda = _probModelSet->getLambdaForFullHistory(_observation,
_tagSet->getNoneTag(), ETProbModelSet::SUB);
double obj_lambda = 0;
if (_probModelSet->useModel(ETProbModelSet::OBJ))
obj_lambda = _probModelSet->getLambdaForFullHistory(_observation,
_tagSet->getNoneTag(), ETProbModelSet::OBJ);
double word_lambda = 0;
if (_probModelSet->useModel(ETProbModelSet::WORD))
word_lambda = _probModelSet->getLambdaForFullHistory(_observation,
_tagSet->getNoneTag(), ETProbModelSet::WORD);
if (word_lambda > .8 && !_observation->getLCWord().is_null()) {
return false;
}
if (DEBUG) {
char lambda_str[10];
_snprintf(lambda_str, 9, "%f", word_lambda);
lambda_str[9] = '\0';
_debugStream << "\n*** TOKEN = " << tokens->getToken(tok)->getSymbol().to_string();
_debugStream << " lambda = " << lambda_str << " ***\n";
}
bool use_sub_for_this_instance = false;
bool use_obj_for_this_instance = false;
bool use_word_for_this_instance = false;
bool use_only_confident_p1 = false;
if (sub_lambda > .8 && !_observation->getSubjectOfTrigger().is_null()) {
if (DEBUG) _debugStream << "Subject Model is already confident\n";
use_sub_for_this_instance = true;
use_only_confident_p1 = true;
// return false;
}
if (obj_lambda > .8 && !_observation->getObjectOfTrigger().is_null()) {
if (DEBUG) _debugStream << "Object Model is already confident\n";
use_obj_for_this_instance = true;
use_only_confident_p1 = true;
// return false;
}
if (word_lambda > .8 && !_observation->getLCWord().is_null()) {
if (DEBUG) _debugStream << "Word Model is already confident\n";
use_word_for_this_instance = true;
use_only_confident_p1 = true;
// return false;
}
int *best_tag = _new int[_probModelSet->getNModels() + 2];
int *second_best_tag = _new int[_probModelSet->getNModels() + 2];
double *best_score = _new double[_probModelSet->getNModels() + 2];
double *second_best_score = _new double[_probModelSet->getNModels() + 2];
double best_system_tag = _tagSet->getNoneTagIndex();
double best_system_score = 0;
for (int modelnum = 0; modelnum < _probModelSet->getNModels() + 2; modelnum++) {
if (modelnum < _probModelSet->getNModels() && _probModelSet->useModel(modelnum)) {
//if (modelnum == ETProbModelSet::SUB && !use_sub_for_this_instance)
// continue;
//if (modelnum == ETProbModelSet::OBJ && !use_obj_for_this_instance)
// continue;
_probModelSet->decodeToDistribution(_observation, modelnum);
} else if (modelnum == _probModelSet->getNModels() && _use_maxent_model) {
decodeToMaxentDistribution();
} else if (modelnum == _probModelSet->getNModels() + 1 && _use_p1_model) {
decodeToP1Distribution();
p1tag = _p1Model->decodeToInt(_observation);
} else continue;
int tag;
for (tag = 1; tag < _tagSet->getNTags(); tag++) {
if (!(modelnum < _probModelSet->getNModels() &&
_tagScores[tag] > log(_recall_threshold)) &&
!(modelnum == _probModelSet->getNModels() &&
_tagScores[tag] > _recall_threshold) &&
!(modelnum == _probModelSet->getNModels() + 1 && tag == p1tag))
continue;
if (modelnum == _probModelSet->getNModels() + 1 && use_only_confident_p1) {
double none_score = _tagScores[_tagSet->getNoneTagIndex()];
double tag_score = _tagScores[tag];
if (tag_score < none_score)
continue;
if ((tag_score - none_score) / tag_score < .2)
continue;
}
result = true;
if (DEBUG) {
_debugStream << "Model " << modelnum << " -- ";
_debugStream << tokens->getToken(tok)->getSymbol() << ":\n";
_debugStream << "NONE: " << _tagScores[0] << "\n";
_debugStream << _tagSet->getTagSymbol(tag) << ": " << _tagScores[tag] << "\n";
}
if (_use_p1_model) {
float none_prob = (float) _p1Model->getScore(_observation, _tagSet->getNoneTagIndex());
if (none_prob < 0)
none_prob = 0;
float prob = (float) _p1Model->getScore(_observation, tag);
if (prob < 0)
prob = 1;
float score = 0;
if (prob + none_prob != 0)
score = prob / (none_prob + prob);
if (DEBUG) _debugStream << "OVERALL SYSTEM SCORE: " << score << "\n";
if (score > best_system_score) {
best_system_score = score;
best_system_tag = tag;
}
}
}
best_tag[modelnum] = 0;
best_score[modelnum] = -20000;
second_best_tag[modelnum] = 0;
second_best_score[modelnum] = -20000;
for (tag = 1; tag < _tagSet->getNTags(); tag++) {
if (_tagScores[tag] > best_score[modelnum]) {
second_best_tag[modelnum] = best_tag[modelnum];
second_best_score[modelnum] = best_score[modelnum];
best_tag[modelnum] = tag;
best_score[modelnum] = _tagScores[tag];
}
else if (_tagScores[tag] > second_best_score[modelnum]) {
second_best_tag[modelnum] = tag;
second_best_score[modelnum] = _tagScores[tag];
}
}
}
/*
if (_use_p1_model) {
int p1_index = _probModelSet->getNModels() + 1;
float none_prob = (float) _p1Model->getScore(_observation, _tagSet->getNoneTagIndex());
if (none_prob < 0)
none_prob = 0;
float prob = (float) best_score[p1_index];
if (prob < 0)
prob = 1;
float score = 0;
if (prob + none_prob != 0)
score = prob / (none_prob + prob);
// Strong positive P1 score for a relatively unseen word
if (score > 0.5 && _probModelSet->useModel(ETProbModelSet::WORD) && word_lambda < 0.5) {
result = true;
if (DEBUG) {
_debugStream << _observation->getLCWord().to_string() << " shows a high score for ";
_debugStream << _tagSet->getTagSymbol(best_tag[p1_index]).to_string();
_debugStream << " and was relatively unseen.\n";
}
}
// Somewhat likely according to P1 and either first or second choice of SUB and OBJ
else if (score < 0.5 && //score > 0.25 &&
_probModelSet->useModel(ETProbModelSet::OBJ) &&
!_observation->getObjectOfTrigger().is_null() &&
(best_tag[ETProbModelSet::OBJ] == best_tag[p1_index] ||
second_best_tag[ETProbModelSet::OBJ] == best_tag[p1_index]) &&
_probModelSet->useModel(ETProbModelSet::SUB) &&
!_observation->getSubjectOfTrigger().is_null() &&
(best_tag[ETProbModelSet::SUB] == best_tag[p1_index] ||
second_best_tag[ETProbModelSet::SUB] == best_tag[p1_index]))
{
result = true;
if (DEBUG) {
//_debugStream << _observation->getLCWord().to_string() << " shows an okay score for ";
_debugStream << _observation->getLCWord().to_string() << " shows its best score for ";
_debugStream << _tagSet->getTagSymbol(best_tag[p1_index]).to_string();
_debugStream << ", which is reinforced by the SUB and OBJ models.\n";
}
}
}*/
delete [] best_tag;
delete [] second_best_tag;
delete [] best_score;
delete [] second_best_score;
return result;
}
void EventTriggerFinder::printAnnotationSentence(UTF8OutputStream& out,
Symbol *docIds,
TokenSequence **tokenSequences,
int index, int n_sentences)
{
const TokenSequence *tseq = tokenSequences[index];
int tok;
out << "================================================\n";
if (tseq->getSentenceNumber() > 0) {
const TokenSequence *prior = tokenSequences[index-1];
for (tok = 0; tok < prior->getNTokens(); tok++)
out << prior->getToken(tok)->getSymbol().to_string() << " ";
out << "\n\n";
}
out << "<S ID=\"" << docIds[index].to_string() << "-" << tseq->getSentenceNumber() << "\">";
for (tok = 0; tok < tseq->getNTokens(); tok++)
out << tseq->getToken(tok)->getSymbol().to_string() << " ";
out << "</S>\n\n";
if (index < n_sentences - 1 && tokenSequences[index+1]->getSentenceNumber() != 0) {
const TokenSequence *next = tokenSequences[index+1];
for (tok = 0; tok < next->getNTokens(); tok++)
out << next->getToken(tok)->getSymbol().to_string() << " ";
}
out << "\n";
}
void EventTriggerFinder::printP1DebugScores(UTF8OutputStream& out) {
int best = 0;
int second_best = 0;
int third_best = 0;
double best_score = -100000;
double second_best_score = -100000;
double third_best_score = -100000;
decodeToP1Distribution();
int p1tag = _p1Model->decodeToInt(_observation, _tagScores);
for (int i = 0; i < _tagSet->getNTags(); i++) {
if (_tagScores[i] > best_score) {
third_best = second_best;
third_best_score = second_best_score;
second_best = best;
second_best_score = best_score;
best = i;
best_score = _tagScores[i];
} else if (_tagScores[i] > second_best_score) {
third_best = second_best;
third_best_score = second_best_score;
second_best = i;
second_best_score = _tagScores[i];
} else if (_tagScores[i] > third_best_score) {
third_best = i;
third_best_score = _tagScores[i];
}
}
if (DEBUG) {
_debugStream << L"P1 Top Outcomes: " << "\n----------------\n";
_p1Model->printDebugInfo(_observation, best, _debugStream);
_debugStream << L"\n";
_p1Model->printDebugInfo(_observation, second_best, _debugStream);
_debugStream << L"\n";
_p1Model->printDebugInfo(_observation, third_best, _debugStream);
_debugStream << L"\n";
}
out << L"ETP1Model<br>\n";
out << _tagSet->getTagSymbol(best).to_string() << L": " << _tagScores[best];
if(p1tag == best)
out<<" --- Selected";
if(isConfidentP1Tag(best))
out<<" --- Confident";
out << L"<br>\n";
out << _tagSet->getTagSymbol(second_best).to_string() << L": " << _tagScores[second_best];
if(p1tag == second_best)
out<<" --- Selected";
out << L"<br>\n";
out << _tagSet->getTagSymbol(third_best).to_string() << L": " << _tagScores[third_best] << L"<br>\n";
out << "<br>\n";
}
void EventTriggerFinder::printMaxentDebugScores(UTF8OutputStream& out) {
int best = 0;
int second_best = 0;
int third_best = 0;
double best_score = -100000;
double second_best_score = -100000;
double third_best_score = -100000;
_maxentModel->decodeToDistribution(_observation, _tagScores, _tagSet->getNTags());
for (int i = 0; i < _tagSet->getNTags(); i++) {
if (_tagScores[i] > best_score) {
third_best = second_best;
third_best_score = second_best_score;
second_best = best;
second_best_score = best_score;
best = i;
best_score = _tagScores[i];
} else if (_tagScores[i] > second_best_score) {
third_best = second_best;
third_best_score = second_best_score;
second_best = i;
second_best_score = _tagScores[i];
} else if (_tagScores[i] > third_best_score) {
third_best = i;
third_best_score = _tagScores[i];
}
}
if (DEBUG) {
_debugStream << L"Maxent Top Outcomes: " << "\n--------------------\n";
_maxentModel->printDebugInfo(_observation, best, _debugStream);
_debugStream << L"\n";
_maxentModel->printDebugInfo(_observation, second_best, _debugStream);
_debugStream << L"\n";
_maxentModel->printDebugInfo(_observation, third_best, _debugStream);
_debugStream << L"\n";
}
out << _tagSet->getTagSymbol(best).to_string() << L": " << _tagScores[best] << L"<br>\n";
out << _tagSet->getTagSymbol(second_best).to_string() << L": " << _tagScores[second_best] << L"<br>\n";
out << _tagSet->getTagSymbol(third_best).to_string() << L": " << _tagScores[third_best] << L"<br>\n";
out << "<br>\n";
}
void EventTriggerFinder::decodeToP1Distribution() {
for (int i = 0; i < _tagSet->getNTags(); i++) {
_tagScores[i] = _p1Model->getScore(_observation, i);
}
}
int EventTriggerFinder::decodeToMaxentDistribution() {
int maxent_answer;
_maxentModel->decodeToDistribution(_observation, _tagScores, _tagSet->getNTags(),
&maxent_answer);
if (maxent_answer != _tagSet->getNoneTagIndex())
return maxent_answer;
double best_score = -20000;
int best_tag = 0;
double second_best_score = -20000;
int second_best_tag;
for (int i = 0; i < _tagSet->getNTags(); i++) {
if (_tagScores[i] > best_score) {
second_best_score = best_score;
second_best_tag = best_tag;
best_score = _tagScores[i];
best_tag = i;
} else if (_tagScores[i] > second_best_score) {
second_best_score = _tagScores[i];
second_best_tag = i;
}
}
if (best_tag == _tagSet->getNoneTagIndex() && second_best_score > _recall_threshold)
return second_best_tag;
else return best_tag;
}
void EventTriggerFinder::resetRoundRobinStatistics() {
for(int i = 0; i < 4; i++){
for(int j = 0; j < 5; j++){
_scoringCounts[i][j] = 0;
}
}
_correct = 0;
_wrong_type = 0;
_missed = 0;
_spurious = 0;
}
void EventTriggerFinder::printRoundRobinStatistics(UTF8OutputStream &out) {
for(int j = 0; j < 5; j++){
double recall = (double) _scoringCounts[CORRECT][j] / (_scoringCounts[CORRECT][j] + _scoringCounts[MISSING][j] +_scoringCounts[WRONG_TYPE][j]);
double precision = (double) _scoringCounts[CORRECT][j] / (_scoringCounts[CORRECT][j] + _scoringCounts[SPURIOUS][j] +_scoringCounts[WRONG_TYPE][j]);
if(j == COUNT_ALL) out <<"** REGULAR: \n";
else if(j == COUNT_BY_ARG) out <<"** ARG_WEIGHTED: \n";
else if(j == COUNT_PM) out <<"** PROB_MOD_ACTIVE: \n";
else if(j == COUNT_KNOWN) out <<"** KNOWN: \n";
else if(j == COUNT_KNOWN_CORRECT) out <<"** KNOWN_CORRECT: \n";
out <<" CORRECT: "<<_scoringCounts[CORRECT][j]<<"\n";
out <<" MISSED: "<<_scoringCounts[MISSING][j]<<"\n";
out <<" SPURIOUS: "<<_scoringCounts[SPURIOUS][j]<<"\n";
out <<" WRONG_TYPE: "<<_scoringCounts[WRONG_TYPE][j]<<"\n";
out <<" *RECALL: " << recall << L"\n";
out <<" *PRECISION: " << precision << L"\n\n";
}
}
void EventTriggerFinder::printRecPrecF1(UTF8OutputStream& out) {
int R = _missed + _wrong_type + _correct;
int P = _spurious + _wrong_type + _correct;
double recall = (double) _correct / R;
double precision = (double) _correct / P;
double f1 = (2 * precision * recall) / (precision + recall);
out << L"trigger: R=" << _correct << L"/" << R << L"=" << recall << L" P=" << _correct << L"/" << P << L"=" << precision << L" F1=" << f1 << L"\n";
}
void EventTriggerFinder::train(TokenSequence **tokenSequences, Parse **parses,
ValueMentionSet **valueMentionSets, MentionSet **mentionSets,
PropositionSet **propSets, EventMentionSet **esets,
Symbol *docTopics, int nsentences)
{
if (MODE != TRAIN)
return;
// MODEL FILE
std::string model_file = ParamReader::getRequiredParam("event_trigger_model_file");
int n_epochs = 1;
bool print_every_epoch = false;
if (_use_p1_model) {
n_epochs = ParamReader::getRequiredIntParam("et_p1_epochs");
if (ParamReader::isParamTrue("em_p1_print_every_epoch"))
print_every_epoch = true;
if (_seed_features) {
SessionLogger::info("SERIF") << "Seeding weight table with all features from training set...\n";
for (int i = 0; i < nsentences; i++) {
_documentTopic = docTopics[i];
walkThroughTrainingSentence(ADD_FEATURES, -1, tokenSequences[i], parses[i],
valueMentionSets[i], mentionSets[i],
propSets[i], esets[i]);
}
if (_use_p1_model) {
for (DTFeature::FeatureWeightMap::iterator iter = _p1Weights->begin();
iter != _p1Weights->end(); ++iter)
{
(*iter).second.addToSum();
}
}
if (print_every_epoch) {
std::string buffer = model_file + "-epoch-0.p1";
UTF8OutputStream p1_out(buffer.c_str());
dumpP1TrainingParameters(p1_out, 0);
DTFeature::writeSumWeights(*_p1Weights, p1_out, true);
p1_out.close();
}
}
}
for (int epoch = 0; epoch < n_epochs; epoch++) {
SessionLogger::LogMessageMaker msg = SessionLogger::info("SERIF");
msg << "Epoch " << epoch + 1 << "\n";
int count=0;
for (int i = 0; i < nsentences; i++) {
_documentTopic = docTopics[i];
count=count+tokenSequences[i]->getNTokens();
msg << tokenSequences[i]->getNTokens() <<"\n";
msg << count << "\n";
walkThroughTrainingSentence(TRAIN, epoch, tokenSequences[i], parses[i],
valueMentionSets[i], mentionSets[i],
propSets[i], esets[i]);
if (_use_p1_model && i % 16 == 0) {
for (DTFeature::FeatureWeightMap::iterator iter = _p1Weights->begin();
iter != _p1Weights->end(); ++iter)
{
(*iter).second.addToSum();
}
}
if (i % 10 == 0) {
msg << ".";
}
}
if (print_every_epoch) {
std::stringstream buffer;
buffer << model_file << "-epoch-" << epoch+1 << ".p1";
UTF8OutputStream p1_out(buffer.str().c_str());
dumpP1TrainingParameters(p1_out, epoch + 1);
DTFeature::writeSumWeights(*_p1Weights, p1_out);
p1_out.close();
}
if (epoch == 0) {
_probModelSet->deriveModels();
_probModelSet->printModels(model_file.c_str());
}
}
SessionLogger::info("SERIF") << "Deriving models\n";
if (_use_p1_model) {
std::string buffer = model_file + ".p1";
UTF8OutputStream p1_out(buffer.c_str());
dumpP1TrainingParameters(p1_out, n_epochs);
DTFeature::writeSumWeights(*_p1Weights, p1_out);
p1_out.close();
}
if (_use_maxent_model) {
int pruning = ParamReader::getRequiredIntParam("et_maxent_trainer_pruning_cutoff");
_maxentModel->deriveModel(pruning);
std::string buffer = model_file + ".maxent";
UTF8OutputStream maxent_out(buffer.c_str());
dumpMaxentTrainingParameters(maxent_out);
DTFeature::writeWeights(*_maxentWeights, maxent_out);
maxent_out.close();
}
// we are now set to decode
MODE = DECODE;
}
void EventTriggerFinder::walkThroughTrainingSentence(int mode, int epoch,
const TokenSequence *tseq,
const Parse *parse,
const ValueMentionSet *valueMentionSet,
MentionSet *mentionSet,
const PropositionSet *propSet,
const EventMentionSet *eset)
{
int eventTypes[MAX_SENTENCE_TOKENS];
for (int j = 0; j < tseq->getNTokens(); j++) {
eventTypes[j] = 0;
}
for (int ement = 0; ement < eset->getNEventMentions(); ement++) {
EventMention *em = eset->getEventMention(ement);
if (_tagSet->getTagIndex(em->getEventType()) == -1) {
char c[500];
sprintf( c, "ERROR: Invalid event type in training file: %s", em->getEventType().to_debug_string());
throw UnexpectedInputException("EventTriggerFinder::walkThroughTrainingSentence()", c);
}
eventTypes[em->getAnchorNode()->getStartToken()] = _tagSet->getTagIndex(em->getEventType());
}
for (int k = 0; k < tseq->getNTokens(); k++) {
_observation->populate(k, tseq, parse, mentionSet,
propSet, true);
_observation->setDocumentTopic(_documentTopic);
if (_use_p1_model) {
if (mode == TRAIN) {
_p1Model->train(_observation, eventTypes[k]);
} else if (mode == ADD_FEATURES) {
_p1Model->addFeatures(_observation, eventTypes[k]);
}
}
if (epoch == 0) {
if (_use_maxent_model)
_maxentModel->addToTraining(_observation, eventTypes[k]);
_probModelSet->addTrainingEvent(_observation,
_tagSet->getTagSymbol(eventTypes[k]));
}
}
}
void EventTriggerFinder::dumpP1TrainingParameters(UTF8OutputStream &out, int epoch) {
DTFeature::recordDate(out);
out << L"Parameters:\n";
DTFeature::recordParamForConsistency(Symbol(L"event_trigger_tag_set_file"), out);
DTFeature::recordParamForConsistency(Symbol(L"event_trigger_features_file"), out);
DTFeature::recordParamForConsistency(Symbol(L"word_cluster_bits_file"), out);
DTFeature::recordParamForReference(Symbol(L"event_training_file_list"), out);
DTFeature::recordParamForReference(Symbol(L"et_p1_epochs"), out);
out << "actual_epoch_output_here " << epoch << "\n";
out << L"\n";
}
void EventTriggerFinder::dumpMaxentTrainingParameters(UTF8OutputStream &out) {
DTFeature::recordDate(out);
out << L"Parameters:\n";
DTFeature::recordParamForConsistency(Symbol(L"event_trigger_tag_set_file"), out);
DTFeature::recordParamForConsistency(Symbol(L"event_trigger_features_file"), out);
DTFeature::recordParamForConsistency(Symbol(L"word_cluster_bits_file"), out);
DTFeature::recordParamForReference(Symbol(L"event_training_file_list"), out);
DTFeature::recordParamForReference(Symbol(L"et_maxent_trainer_percent_held_out"), out);
DTFeature::recordParamForReference(Symbol(L"et_maxent_trainer_max_iterations"), out);
DTFeature::recordParamForReference(Symbol(L"et_maxent_trainer_gaussian_variance"), out);
DTFeature::recordParamForReference(Symbol(L"et_maxent_trainer_min_likelihood_delta"), out);
DTFeature::recordParamForReference(Symbol(L"et_maxent_trainer_stop_check_frequency"), out);
DTFeature::recordParamForReference(Symbol(L"et_maxent_trainer_pruning_cutoff"), out);
out << L"\n";
}
int EventTriggerFinder::processSentence(const TokenSequence *tokens,
const Parse *parse,
MentionSet *mentionSet,
const PropositionSet *propSet,
EventMention **potentials,
int max)
{
int n_potential_events = 0;
if (DEBUG) {
_debugStream << parse->getRoot()->toTextString() << "\n";
}
for (int tok = 0; tok < tokens->getNTokens(); tok++) {
if (n_potential_events >= max)
break;
processToken(tok, tokens, parse, mentionSet, propSet,
potentials, n_potential_events, max);
}
return n_potential_events;
}
void EventTriggerFinder::processToken(int tok, const TokenSequence *tokens,
const Parse *parse, MentionSet *mentionSet,
const PropositionSet *propSet,
EventMention **potentials,
int& n_potential_events,
int max_events)
{
_observation->populate(tok, tokens, parse, mentionSet, propSet, true);
_observation->setDocumentTopic(_documentTopic);
for (int tag = 1; tag < _tagSet->getNTags(); tag++) {
_tagFound[tag] = false;
}
int p1tag = 0;
bool use_sub_for_this_instance = false;
bool use_obj_for_this_instance = false;
bool use_only_confident_p1 = false;
selectModels(use_sub_for_this_instance, use_obj_for_this_instance, use_only_confident_p1);
std::set<int> knownP1Tags;
if(_use_p1_model)
knownP1Tags = _p1Model->featureInTable(_observation, Symbol(L"lc-word"));
for (int modelnum = 0; modelnum < _probModelSet->getNModels() + 2; modelnum++) {
if (n_potential_events >= max_events)
break;
// do actual decoding
if (modelnum < _probModelSet->getNModels() && _probModelSet->useModel(modelnum)) {
if (modelnum == ETProbModelSet::SUB && !use_sub_for_this_instance)
continue;
if (modelnum == ETProbModelSet::OBJ && !use_obj_for_this_instance)
continue;
_probModelSet->decodeToDistribution(_observation, modelnum);
} else if (modelnum == _probModelSet->getNModels() && _use_maxent_model) {
decodeToMaxentDistribution();
} else if (modelnum == _probModelSet->getNModels() + 1 && _use_p1_model) {
decodeToP1Distribution();
p1tag = _p1Model->decodeToInt(_observation, _tagScores);
} else continue;
bool tok_printed = false;
for (int tag = 1; tag < _tagSet->getNTags(); tag++) {
if (n_potential_events >= max_events)
break;
if (!(modelnum < _probModelSet->getNModels() && _tagScores[tag] > log(_recall_threshold)) && //prob model condition
!(modelnum == _probModelSet->getNModels() && _tagScores[tag] > _recall_threshold) && //max_ent condition
!(modelnum == _probModelSet->getNModels() + 1 && tag == p1tag)) //P1 condition
continue;
if (modelnum == _probModelSet->getNModels() + 1 && use_only_confident_p1) {
if(!isConfidentP1Tag(tag))
continue;
}
if (DEBUG) {
if (!tok_printed) {
_debugStream << "Model " << modelnum << " -- ";
_debugStream << tokens->getToken(tok)->getSymbol() << ":\n";
_debugStream << "NONE: " << _tagScores[0] << "\n";
tok_printed = true;
}
_debugStream << _tagSet->getTagSymbol(tag) << ": " << _tagScores[tag] << "\n";
}
if (_tagFound[tag])
continue;
_tagFound[tag] = true;
potentials[n_potential_events] = _new EventMention(tokens->getSentenceNumber(), n_potential_events);
potentials[n_potential_events]->setEventType(_tagSet->getTagSymbol(tag));
const SynNode *tNode = parse->getRoot()->getNthTerminal(tok);
// we want the preterminal node, since that's what we would get if we were
// going from a proposition to a node
if (tNode->getParent() != 0)
tNode = tNode->getParent();
potentials[n_potential_events]->setAnchor(tNode, propSet);
// set score
setScore(potentials[n_potential_events], modelnum);
n_potential_events++;
}
}
}
float EventTriggerFinder::setScore(EventMention *eventMention, int modelnum) {
eventMention->setScore(0);
//eventMention->_simple_score = 0;
for (int model = 0; model < _probModelSet->getNModels(); model++) {
if (_probModelSet->useModel(model)) {
// due to new way we're combining models, comment this out..
//float prob = (float) _probModelSet->getProbability(_observation,
// eventMention->getEventType(), modelnum);
//eventMention->addToScore(prob);
//if (modelnum == ETProbModelSet::WORD)
// eventMention->_simple_score = prob;
//if (modelnum == ETProbModelSet::WORD_PRIOR)
// eventMention->_score_with_prior = prob;
}
}
if (eventMention->getScore() == 0 && _use_maxent_model) {
decodeToMaxentDistribution();
int index = _tagSet->getTagIndex(eventMention->getEventType());
eventMention->addToScore((float) _tagScores[index]);
}
if (eventMention->getScore() == 0 && _use_p1_model) {
float none_prob = (float) _p1Model->getScore(_observation, _tagSet->getNoneTagIndex());
if (none_prob < 0)
none_prob = 0;
float prob = (float) _p1Model->getScore(_observation,
_tagSet->getTagIndex(eventMention->getEventType()));
if (prob < 0)
prob = 1;
float score = 0;
if (prob + none_prob != 0)
score = prob / (none_prob + prob);
float log_score = 0;
if (score != 0)
log_score = log(score);
eventMention->addToScore(log_score);
}
/*
if (modelnum < _probModelSet->getNModels() && _probModelSet->useModel(modelnum)) {
// due to new way we're combining models, comment this out..
float prob = (float) _probModelSet->getProbability(_observation,
eventMention->getEventType(), modelnum);
eventMention->addToScore(prob);
//if (modelnum == ETProbModelSet::WORD)
// eventMention->_simple_score = prob;
//if (modelnum == ETProbModelSet::WORD_PRIOR)
// eventMention->_score_with_prior = prob;
}
if (modelnum == _probModelSet->getNModels() && _use_maxent_model) {
decodeToMaxentDistribution();
int index = _tagSet->getTagIndex(eventMention->getEventType());
eventMention->addToScore((float) _tagScores[index]);
}
if (modelnum == _probModelSet->getNModels() + 1 && _use_p1_model) {
float none_prob = (float) _p1Model->getScore(_observation, _tagSet->getNoneTagIndex());
if (none_prob < 0)
none_prob = 0;
float prob = (float) _p1Model->getScore(_observation,
_tagSet->getTagIndex(eventMention->getEventType()));
if (prob < 0)
prob = 1;
float score = 0;
if (prob + none_prob != 0)
score = prob / (none_prob + prob);
float log_score = 0;
if (score != 0)
log_score = log(score);
eventMention->addToScore(log_score);
}*/
return eventMention->getScore();
}
bool EventTriggerFinder::isLikelyTrigger(const SynNode* aNode){
return true;
const SynNode* anchorHead = aNode->getHeadPreterm();
if(LanguageSpecificFunctions::isNounPOS(anchorHead->getTag())){
if(NodeInfo::isNominalPremod(aNode)){
return false;
}
else{
return true;
}
}
else if(LanguageSpecificFunctions::isVerbPOS(anchorHead->getTag())){
return true;
}
else{
return false;
}
}
bool EventTriggerFinder::isConfidentP1Tag(int tag){
double none_score = _tagScores[_tagSet->getNoneTagIndex()];
double tag_score = _tagScores[tag];
if (tag_score < none_score)
return false;
if ((tag_score - none_score) / tag_score < .2)
return false;
return true;
}
void EventTriggerFinder::selectModels(bool& use_sub, bool& use_obj, bool& use_only_confident_P1){
if(_probModelSet->preferModel(_observation, ETProbModelSet::SUB)){
use_sub = true;
use_only_confident_P1 = true;
}
if(_probModelSet->preferModel(_observation, ETProbModelSet::OBJ)){
use_obj = true;
use_only_confident_P1 = true;
}
}
EventMentionSet* EventTriggerFinder::devTestDecode(const TokenSequence *tseq, Parse *parse, ValueMentionSet *valueMentionSet, MentionSet *mentionSet,
PropositionSet *propSet, EventMentionSet *eset, int nsentences)
{
EventMentionSet *result = _new EventMentionSet(parse);
if (MODE != DECODE)
return 0;
int eventTypes[MAX_SENTENCE_TOKENS];
for (int j = 0; j < tseq->getNTokens(); j++) {
eventTypes[j] = 0;
}
for (int ement = 0; ement < eset->getNEventMentions(); ement++) {
EventMention *em = eset->getEventMention(ement);
if (_tagSet->getTagIndex(em->getEventType()) == -1) {
throw UnexpectedInputException("EventTriggerFinder::devTestDecode()", "Invalid event type in training file");
}
eventTypes[em->getAnchorNode()->getStartToken()] = _tagSet->getTagIndex(em->getEventType());
}
for (int k = 0; k < tseq->getNTokens(); k++) {
int correct_answer = eventTypes[k];
EventMention *tmpEvents[MAX_TOKEN_TRIGGERS];
int n_system_answers = 0;
processToken(k, tseq, parse, mentionSet, propSet, tmpEvents, n_system_answers, MAX_TOKEN_TRIGGERS);
// Return answer with highest score
int system_answer = _tagSet->getNoneTagIndex();
float this_score, system_score = 0;
int systemEventIndex = -1; // points to the highest scoring event mention
for (int m = 0; m < n_system_answers; m++) {
this_score = exp(tmpEvents[m]->getScore());
if (this_score > system_score) {
system_score = this_score;
system_answer = _tagSet->getTagIndex(tmpEvents[m]->getEventType());
systemEventIndex = m;
}
}
if( (systemEventIndex != -1) && (system_answer != _tagSet->getNoneTagIndex()) ) {
result->takeEventMention(tmpEvents[systemEventIndex]); // use this predicted event mention to do event-aa prediction
for (int n=0; n<n_system_answers; n++) {
if(n != systemEventIndex)
delete tmpEvents[n];
}
}
else {
for (int n=0; n<n_system_answers; n++)
delete tmpEvents[n];
}
if (correct_answer == system_answer) {
if (correct_answer != _tagSet->getNoneTagIndex()) {
_correct++;
}
} else if (correct_answer == _tagSet->getNoneTagIndex()) {
_spurious++;
} else if (system_answer == _tagSet->getNoneTagIndex()) {
_missed++;
} else {
_wrong_type++;
}
}
return result;
}
| 36.250185 | 151 | 0.675358 | BBN-E |
1f32d7e43b7606cfed9edb7710d4401205fa291b | 464 | cpp | C++ | LeetCode/Solutions/LC0572.cpp | Mohammed-Shoaib/HackerRank-Problems | ccfb9fc2f0d8dff454439d75ce519cf83bad7c3b | [
"MIT"
] | 54 | 2019-05-13T12:13:09.000Z | 2022-02-27T02:59:00.000Z | LeetCode/Solutions/LC0572.cpp | Mohammed-Shoaib/HackerRank-Problems | ccfb9fc2f0d8dff454439d75ce519cf83bad7c3b | [
"MIT"
] | 2 | 2020-10-02T07:16:43.000Z | 2020-10-19T04:36:19.000Z | LeetCode/Solutions/LC0572.cpp | Mohammed-Shoaib/HackerRank-Problems | ccfb9fc2f0d8dff454439d75ce519cf83bad7c3b | [
"MIT"
] | 20 | 2020-05-26T09:48:13.000Z | 2022-03-18T15:18:27.000Z | /*
Problem Statement: https://leetcode.com/problems/subtree-of-another-tree/
*/
class Solution {
public:
bool isSubtree(TreeNode* s, TreeNode* t) {
if (!s)
return false;
else
return same(s, t) || isSubtree(s->left, t) || isSubtree(s->right, t);
}
bool same(TreeNode* s, TreeNode* t) {
if (!s && !t)
return true;
else if (!s || !t || s->val != t->val)
return false;
else
return same(s->left, t->left) && same(s->right, t->right);
}
}; | 21.090909 | 73 | 0.599138 | Mohammed-Shoaib |
1f3596186c8cea10fc791379045527980248c44c | 817 | cpp | C++ | Chapter1/Section1.5/numtri/numtri.cpp | suzyz/USACO | c7f58850f20693fedfc30ef462f898d20d002396 | [
"MIT"
] | null | null | null | Chapter1/Section1.5/numtri/numtri.cpp | suzyz/USACO | c7f58850f20693fedfc30ef462f898d20d002396 | [
"MIT"
] | null | null | null | Chapter1/Section1.5/numtri/numtri.cpp | suzyz/USACO | c7f58850f20693fedfc30ef462f898d20d002396 | [
"MIT"
] | null | null | null | /*
ID: suzyzha1
PROG: numtri
LANG: C++
*/
#include <iostream>
#include <fstream>
#include <cstring>
using namespace std;
const int maxn = 1010;
int n;
int tri[maxn][maxn];
int max_sum[maxn][maxn];
void dfs(int row,int col)
{
if(max_sum[row][col]>=0) return;
if(row==n-1)
{
max_sum[row][col]=tri[row][col];
return;
}
dfs(row+1,col);
dfs(row+1,col+1);
if(max_sum[row+1][col]>max_sum[row+1][col+1])
max_sum[row][col]=tri[row][col]+max_sum[row+1][col];
else
max_sum[row][col]=tri[row][col]+max_sum[row+1][col+1];
}
int main()
{
fstream fin("numtri.in",ios::in);
fstream fout("numtri.out",ios::out);
fin>>n;
for(int i=0;i<n;i++)
for(int j=0;j<=i;j++)
fin>>tri[i][j];
memset(max_sum,-1,sizeof(max_sum));
dfs(0,0);
fout<<max_sum[0][0]<<endl;
fin.close();
fout.close();
return 0;
}
| 14.589286 | 56 | 0.618115 | suzyz |
1f36a77bb5faea0d972992b2527dbe14682829f3 | 2,218 | cpp | C++ | libraries/wtf-gcit/src/module.cpp | flynnwt/espgc | a538c8e6ef5dc42a104b79b222bffa1a9364d11e | [
"MIT"
] | 9 | 2016-08-21T14:42:54.000Z | 2020-11-04T10:13:19.000Z | libraries/wtf-gcit/src/module.cpp | flynnwt/espgc | a538c8e6ef5dc42a104b79b222bffa1a9364d11e | [
"MIT"
] | null | null | null | libraries/wtf-gcit/src/module.cpp | flynnwt/espgc | a538c8e6ef5dc42a104b79b222bffa1a9364d11e | [
"MIT"
] | 2 | 2017-12-10T19:52:57.000Z | 2021-03-15T12:13:58.000Z | #include "module.h"
// for true gc, must have 1 eth/wifi and 1 ir/serial/relay
Module::Module(GCIT *p, unsigned int a, ModuleType t) {
int i;
parent = p;
type = t;
address = a;
numConnectors = 0;
for (i = 0; i < MODULE_MAX_CONNECTORS; i++) {
connectors[i] = NULL;
}
switch (type) {
case ModuleType::ethernet:
p->settings()->model = "ITachIP2";
descriptor = "0 ETHERNET";
break;
case ModuleType::wifi:
p->settings()->model = "ITachWF2";
descriptor = "0 WIFI";
break;
case ModuleType::ir:
p->settings()->model += "IR";
descriptor = "0 IR";
break;
case ModuleType::serial:
p->settings()->model += "SL";
descriptor = "0 SERIAL";
break;
case ModuleType::relay:
p->settings()->model += "CC";
descriptor = "0 RELAY";
break;
default:
p->settings()->model = "UNKNOWN";
descriptor = "0 UNKNOWN";
}
}
int Module::addConnector(ConnectorType t) { return addConnector(t, UNDEFINED_FPIN, UNDEFINED_SPIN); }
int Module::addConnector(ConnectorType t, int fPin) { return addConnector(t, fPin, UNDEFINED_SPIN); }
int Module::addConnector(ConnectorType t, int fPin, int sPin) { return addConnector(t, numConnectors + 1, fPin, sPin); }
int Module::addConnector(ConnectorType t, int address, int fPin, int sPin) {
if (address > MODULE_MAX_CONNECTORS) {
return 0;
}
connectors[address - 1] = new Connector(this, address, t, fPin, sPin);
numConnectors++;
switch (type) {
case ModuleType::ethernet:
case ModuleType::wifi:
// ERROR!
break;
case ModuleType::ir:
descriptor = String(numConnectors) + " IR";
break;
case ModuleType::serial:
descriptor = String(numConnectors) + " SERIAL";
parent->enableSerial((ConnectorSerial*)connectors[address - 1]->control);
break;
case ModuleType::relay:
descriptor = String(numConnectors) + " RELAY";
break;
default:
descriptor = String(numConnectors) + " UNKNOWN";
break;
}
return 1;
}
// connector numbering starts at 1!!!
Connector *Module::getConnector(int address) {
if (address == 0) {
return NULL;
//} else if (c > numConnectors) {
// return NULL;
} else {
return connectors[address - 1];
}
} | 25.494253 | 120 | 0.640216 | flynnwt |
1f37974613799c4cd991138584048575b97ee9ce | 398 | cpp | C++ | TP3/Projectile.cpp | JonathanRN/TP3_prog | 194c364bf81cd8f83af184af8a49acbdf36b19ea | [
"MIT"
] | null | null | null | TP3/Projectile.cpp | JonathanRN/TP3_prog | 194c364bf81cd8f83af184af8a49acbdf36b19ea | [
"MIT"
] | null | null | null | TP3/Projectile.cpp | JonathanRN/TP3_prog | 194c364bf81cd8f83af184af8a49acbdf36b19ea | [
"MIT"
] | null | null | null | #include "Projectile.h"
using namespace tp3;
tp3::Projectile::Projectile(const Vector2f& position, const Color& couleur, const int animationMaximale)
: ANIMATION_MAXIMALE(animationMaximale),
animation(0), actif(false)
{
setPosition(position);
setColor(couleur);
}
Projectile::~Projectile()
{
}
void tp3::Projectile::initGraphiques()
{
}
void tp3::Projectile::activer()
{
actif = true;
}
| 15.92 | 104 | 0.738693 | JonathanRN |
1f39a8900751f84fe1e7319942122594d03bfbf8 | 238 | cpp | C++ | solutions/119.pascals-triangle-ii.241467849.ac.cpp | satu0king/Leetcode-Solutions | 2edff60d76c2898d912197044f6284efeeb34119 | [
"MIT"
] | 78 | 2020-10-22T11:31:53.000Z | 2022-02-22T13:27:49.000Z | solutions/119.pascals-triangle-ii.241467849.ac.cpp | satu0king/Leetcode-Solutions | 2edff60d76c2898d912197044f6284efeeb34119 | [
"MIT"
] | null | null | null | solutions/119.pascals-triangle-ii.241467849.ac.cpp | satu0king/Leetcode-Solutions | 2edff60d76c2898d912197044f6284efeeb34119 | [
"MIT"
] | 26 | 2020-10-23T15:10:44.000Z | 2021-11-07T16:13:50.000Z | class Solution {
public:
vector<int> getRow(int rowIndex) {
vector<int> DP(rowIndex + 1);
DP[0] = 1;
while (rowIndex--) {
for (int i = DP.size() - 1; i > 0; i--)
DP[i] += DP[i - 1];
}
return DP;
}
};
| 18.307692 | 45 | 0.478992 | satu0king |
1f3ec6ed763ba4ea345265f4236e89ad73044c73 | 16,091 | cpp | C++ | units/hw.cpp | rgbond/zapping-ants | 9f96fa07b4caacce91f5b0b4acd5235af1e2a67b | [
"Apache-2.0"
] | 3 | 2016-11-16T18:28:42.000Z | 2020-01-10T09:49:12.000Z | units/hw.cpp | rgbond/zapping-ants | 9f96fa07b4caacce91f5b0b4acd5235af1e2a67b | [
"Apache-2.0"
] | null | null | null | units/hw.cpp | rgbond/zapping-ants | 9f96fa07b4caacce91f5b0b4acd5235af1e2a67b | [
"Apache-2.0"
] | null | null | null | /*
* Copyright 2016 Robert Bond
*
* 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 <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <iostream>
#include <sys/time.h>
#include <stdio.h>
#include <unistd.h>
#include <math.h>
#include "opencv2/core/core.hpp"
#include "opencv2/gpu/gpu.hpp"
#include "opencv2/highgui/highgui.hpp"
using namespace std;
using namespace cv;
using namespace cv::gpu;
#include "hw.h"
struct coms {
uint32_t magic;
uint16_t ms;
int16_t m1_steps;
int16_t m2_steps;
uint16_t flags;
uint16_t ok;
};
/*
* The camera coordinate system is centered under the camera,
* Inches, +x to the right, +y up, as the camera sees it.
* Mirror coordinate system is centred on mirror 1,
* Inches +x toward motor 1, +y toward mirror 2
* Mirror 1 angles are measured m1 straight up toward laser,
* Mirror 2 straight down
*/
// flags:
#define LASER_ON 0x01
#define MOTORS_ON 0x02
#define SHUTDOWN 0x04
#define M1_NEG 0x08
#define M2_NEG 0x10
// Constants
// Derived at home
// Measured distance to focal plane to be 320.5
// 308mm to flange of the camera + csmount spec of 12.5mm to the sensor
// For 16mm squares, measured 94 pixels
// Using 4.65um for pixel size
// f/94 == 320.5/16 so f == 94 * 320.5 / 16 == 1883.94 "pixels"
// 1883.94 * 0.00465 == 8.76mm
// To get new K1 - P3, run get_calib, feed the coordinates to
// Mathematica, least_sqares.nb
#define lens_focal_len (8.76 / 25.4)
#define K1 0.0010958
#define K2 0.00021057
#define K3 (-5.575E-6)
#define P1 (-0.00299204)
#define P2 0.000119739
#define P3 (-0.0227986)
#define in_per_pix (0.00465 / 25.4)
#define camera_height (320.5 / 25.4)
#define m1x 0.0
#define m1y 0.0
#define m1z 1.625
// y axis wants m2z smaller, x axis bigger
#define m2z 10.125
#define m2za (m2z-0.625)
#define m2zb (m2z+0.625)
#define steps_per_rev 200.0
#define microsteps_per_step 16
#define gear_ratio 5.2
#define camera_to_mirrors_x (49.0/25.4)
// from offset.py
// #define camera_to_mirrors_y 10.303022
#define camera_to_mirrors_y 10.1
// Step offsets from pixel pos 640, 480
#define m1_max 345
#define m1_min -380
#define m2_max 980
#define m2_min -860
// Move constants. Must agree with defaults in eibot.py
#define accel 2800.0
#define max_v 800.0
#define ramp_time (max_v/accel)
#define ramp_dist (accel * ramp_time * ramp_time / 2.0)
double steps_to_theta(int steps);
// options
extern bool fake_laser;
extern bool sql_backlash;
extern bool draw_laser;
// HW class
hw::hw(backlash *pbl)
{
struct coms icoms;
int fd;
this->pbl = pbl;
m1_limit = 0;
m2_limit = 0;
// Setup shared mem
icoms.ms = 0;
icoms.m1_steps = 0;
icoms.m2_steps = 0;
icoms.flags = 0;
icoms.ok = 0;
icoms.magic = 0x12344321;
fd = open("/home/rgb/shmem", O_RDWR | O_CREAT);
if (fd < 0) {
printf("can't open /tmp/shmem\n");
exit(1);
}
fchmod(fd, S_IRUSR|S_IWUSR);
write(fd, &icoms, sizeof(icoms));
pc = (struct coms *) mmap(0, sizeof(coms), PROT_WRITE | PROT_WRITE,
MAP_SHARED, fd, 0);
if (pc == MAP_FAILED) {
printf("mmap failed\n");
exit(1);
}
// fire up the unit
pc->flags |= MOTORS_ON;
if (!fake_laser)
pc->ok = 1;
// And wait here until clicker.py is up and running
while (pc->ok == 1)
;
}
void hw::set_home()
{
m1_limit = 0;
m2_limit = 0;
}
double hw::px_to_xd(double px)
{
return (px - xpix/2) * in_per_pix * camera_height / lens_focal_len;
}
double hw::py_to_yd(double py)
{
return -(py - ypix/2) * in_per_pix * camera_height / lens_focal_len;
}
double hw::xdyd_to_x(double xd, double yd)
{
double r2 = xd*xd + yd*yd;
double x_radial_corr = xd*(K1*r2 + K2*r2*r2 + K3*r2*r2*r2);
double x_tan_corr = (P1*(r2 + 2.0*xd*xd) + 2.0*P2*xd*yd)*(1 + P3*r2);
return (xd + x_radial_corr + x_tan_corr);
}
double hw::xdyd_to_y(double xd, double yd)
{
double r2 = xd*xd + yd*yd;
double y_radial_corr = yd*(K1*r2 + K2*r2*r2 + K3*r2*r2*r2);
double y_tan_corr = (2.0*P1*xd*yd + P2*(r2 + 2.0*yd*yd))*(1 + P3*r2);
return (yd + y_radial_corr + y_tan_corr);
}
double hw::calc_m2_theta(double x)
{
return -atan2(m1x - x, m2zb)/2.0;
}
double hw::calc_m1_theta(double y, double m2Theta)
{
return -atan2(m1y - y, m2za - m1z + m2z / cos(2.0 * m2Theta)) / 2.0;
}
double hw::theta_to_steps(double theta)
{
return (theta * steps_per_rev * microsteps_per_step * gear_ratio /
(2 * M_PI));
}
double hw::steps_to_theta(int steps)
{
return (steps * 2 * M_PI /
(steps_per_rev * microsteps_per_step * gear_ratio));
}
static uint64_t move_timer;
bool hw::start_move(double m1_steps, double m2_steps, bool laser_on)
{
if (fake_laser)
return true;
int m1 = (int)(round(m1_steps));
int m2 = (int)(round(m2_steps));
if (m1_limit + m1 < m1_min ||
m1_limit + m1 > m1_max ||
m2_limit + m2 < m2_min ||
m2_limit + m2 > m2_max) {
DPRINTF("Bad move!\n");
DPRINTF("at %d %d moving %d %d\n",
m1_limit, m2_limit, m1, m2);
return false;
}
m1_limit += m1;
m2_limit += m2;
if (pc->ok == 0) {
move_timer = getTickCount();
if (m1 != 0)
last_m1 = m1;
if (m2 != 0)
last_m2 = m2;
pc->ms = 0;
// Oh boy this sucks
if (m1 < 0) {
pc->m1_steps = -m1;
pc->flags |= M1_NEG;
} else {
pc->m1_steps = m1;
pc->flags &= ~M1_NEG;
}
if (m2_steps < 0) {
pc->m2_steps = -m2;
pc->flags |= M2_NEG;
} else {
pc->m2_steps = m2;
pc->flags &= ~M2_NEG;
}
if (laser_on)
pc->flags |= LASER_ON;
else
pc->flags &= ~LASER_ON;
pc->ok = 1;
} else {
DPRINTF("start_move command not done\n");
return false;
}
return true;
}
void hw::switch_laser(bool laser_on)
{
if (fake_laser)
return;
if (pc->ok == 0) {
pc->m1_steps = 0;
pc->m2_steps = 0;
pc->flags &= ~M1_NEG;
pc->flags &= ~M2_NEG;
if (laser_on)
pc->flags |= LASER_ON;
else
pc->flags &= ~LASER_ON;
pc->ok = 1;
} else {
DPRINTF("laser command not done!\n");
}
}
void hw::xy_to_loc(double x, double y, struct loc *ploc)
{
ploc->x = x;
ploc->y = y;
ploc->xm = camera_to_mirrors_x - ploc->x;
ploc->ym = camera_to_mirrors_y - ploc->y;
ploc->m2_theta = calc_m2_theta(ploc->xm);
ploc->m1_theta = calc_m1_theta(ploc->ym, ploc->m2_theta);
ploc->m1_steps = -theta_to_steps(ploc->m1_theta);
ploc->m2_steps = -theta_to_steps(ploc->m2_theta);
// #if 0
DPRINTF(" px: %d, py: %d, xd: %6.3lf, yd:%6.3lf\n",
ploc->px, ploc->py, ploc->xd, ploc->yd);
DPRINTF(" x: %6.3lf, y: %6.3lf, xm: %6.3lf, ym: %6.3lf\n",
ploc->x, ploc->y, ploc->xm, ploc->ym);
DPRINTF(" m1_theta: %6.4lf, m2_theta: %6.4lf, m1_steps: %6.1lf, m2_steps: %6.1lf\n",
ploc->m1_theta, ploc->m2_theta, ploc->m1_steps, ploc->m2_steps);
// #endif
}
void hw::pxy_to_loc(int px, int py, struct loc *ploc)
{
double x, y;
ploc->px = px;
ploc->py = py;
ploc->xd = px_to_xd(px);
ploc->yd = py_to_yd(py);
x = xdyd_to_x(ploc->xd, ploc->yd);
y = xdyd_to_y(ploc->xd, ploc->yd);
xy_to_loc(x, y, ploc);
}
void hw::pxy_to_xy(int px, int py, double &x, double &y)
{
double xd, yd;
xd = px_to_xd(px);
yd = py_to_yd(py);
x = xdyd_to_x(xd, yd);
y = xdyd_to_y(xd, yd);
}
double hw::mm_per_pixel(int px, int py)
{
double x1, y1, x2, y2;
int px1;
if (px >= xpix - 10)
px1 = px - 10;
else
px1 = px + 10;
pxy_to_xy(px, py, x1, y1);
pxy_to_xy(px1, py, x2, y2);
double dx = x1 - x2;
double dy = y1 - y2;
double dist_inches = sqrt(dx * dx + dy * dy) / 10.0;
return dist_inches * 25.4;
}
double hw::move_time(int px, int py)
{
struct loc tloc;
pxy_to_loc(px, py, &tloc);
double m1_delta = tloc.m1_steps - cur_loc.m1_steps;
double m2_delta = tloc.m2_steps - cur_loc.m2_steps;
double dist = sqrt(m1_delta * m1_delta + m2_delta * m2_delta);
double t;
if (draw_laser) {
t = 0.0;
} else if (dist > ramp_dist * 2.0) {
t = ramp_time * 2.0 + (dist - ramp_dist * 2.0)/max_v;
} else {
// Integral relating distance to accel is d = acc * t^2 / 2
// So t = sqrt(2d/accel)
// dist == 2d, because want ramp up then down.
t = 2.0 * sqrt(dist / accel);
}
DPRINTF("move_time to px: %d py: %d dist: %6.1lf t: %6.3lf\n",
px, py, dist, t);
return t;
}
void hw::do_move(int px, int py, int frame_index, const char *msg)
{
DPRINTF("%s, frame_index: %d\n", msg, frame_index);
if (px != target.px || py != target.py)
pxy_to_loc(px, py, &target);
double m1_delta = target.m1_steps - cur_loc.m1_steps;
double m2_delta = target.m2_steps - cur_loc.m2_steps;
pbl->start(this, m1_delta, m2_delta);
DPRINTF(" Moving %6.1lf %6.1lf\n", m1_delta, m2_delta);
while (pc->ok)
;
if (start_move(m1_delta, m2_delta, false))
cur_loc = target;
}
void hw::do_correction(int px, int py, int frame_index, const char *msg)
{
// DPRINTF("%s, frame_index: %d\n", msg, frame_index);
if (px != target.px || py != target.py)
pxy_to_loc(px, py, &target);
double m1_delta = (target.m1_steps - cur_loc.m1_steps) * 1.0;
double m2_delta = (target.m2_steps - cur_loc.m2_steps) * 1.0;
pbl->add_corr(this, m1_delta, m2_delta);
DPRINTF(" Moving %6.1lf %6.1lf\n", m1_delta, m2_delta);
while (pc->ok)
;
if(start_move(m1_delta, m2_delta, false))
cur_loc = target;
}
void hw::do_xy_move(double x, double y, const char *msg)
{
DPRINTF("%s\n", msg);
target.px = 0;
target.py = 0;
target.xd = 0;
target.yd = 0;
xy_to_loc(x, y, &target);
double m1_delta = target.m1_steps - cur_loc.m1_steps;
double m2_delta = target.m2_steps - cur_loc.m2_steps;
pbl->start(this, m1_delta, m2_delta);
DPRINTF(" Moving %6.1lf %6.1lf\n", m1_delta, m2_delta);
while (pc->ok)
;
if(start_move(m1_delta, m2_delta, false))
cur_loc = target;
}
void hw::shutdown(void)
{
while (pc->ok)
;
pc->m1_steps = 0;
pc->m2_steps = 0;
pc->flags = SHUTDOWN;
if (!fake_laser)
pc->ok = 1;
}
bool hw::hw_idle()
{
if (pc-> ok == 0 && move_timer != 0) {
uint64_t cur_time = getTickCount();
double tps = getTickFrequency();
DPRINTF("Move Timer: %d\n", (int)((cur_time-move_timer)*1000.0/tps));
move_timer = 0;
}
return pc->ok == 0;
}
/*
* much easier with the camera at 8.8mm
*/
bool hw::keepout(int px, int py, int scale)
{
if (scale == 2) {
px += px;
py += py;
} else if (scale != 1) {
px *= scale;
py *= scale;
}
if (py < 0 || py > 959)
return true;
if (px < 0 || px > 1279)
return true;
return false;
}
struct step_list {
struct loc *ploc;
int last_m1;
int last_m2;
double m1s;
double m2s;
struct step_list *next;
};
// Backlash class
backlash::backlash()
{
last_m1 = 0;
last_m2 = 0;
pstart = NULL;
ptarget = NULL;
pls = NULL;
ple = NULL;
mvidx = 0;
if (!sql_backlash)
return;
sql_out = fopen("backlash.sql", "w");
if (!sql_out) {
DPRINTF("can't open backlash.sql\n");
exit(1);
}
}
void backlash::correct(double *pm1s, double *pm2s)
{
// wrong
return;
}
void backlash::cleanup()
{
if (pstart)
delete pstart;
if (ptarget)
delete ptarget;
while (pls) {
struct step_list *tmp = pls;
if (pls->ploc)
delete pls->ploc;
pls = pls->next;
delete tmp;
}
last_m1 = 0;
last_m2 = 0;
pstart = NULL;
ptarget = NULL;
pls = NULL;
ple = NULL;
}
void backlash::start(hw *phw, double m1s, double m2s)
{
cleanup();
last_m1 = phw->last_m1;
last_m2 = phw->last_m2;
pstart = new struct loc;
*pstart = phw->cur_loc;
ptarget = new struct loc;
*ptarget = phw->target;
pls = new struct step_list;
pls->m1s = m1s;
pls->m2s = m2s;
pls->ploc = NULL;
pls->next = NULL;
ple = pls;
mvidx++;
}
void backlash::add_corr(hw *phw, double m1s, double m2s)
{
if (!sql_backlash)
return;
struct step_list *pn = new struct step_list;
pn->last_m1 = phw->last_m1;
pn->last_m2 = phw->last_m2;
pn->m1s = m1s;
pn->m2s = m2s;
pn->ploc = new struct loc;
*pn->ploc = phw->cur_loc;
pn->next = NULL;
if (ple)
ple->next = pn;
ple = pn;
}
void backlash::stop(hw *phw)
{
struct step_list *pn = new struct step_list;
pn->last_m1 = phw->last_m1;
pn->last_m2 = phw->last_m2;
pn->m1s = 0;
pn->m2s = 0;
pn->ploc = new struct loc;
*pn->ploc = phw->cur_loc;
pn->next = NULL;
if (ple)
ple->next = pn;
ple = pn;
}
void backlash::actuals(struct step_list *pn, int *pm1, int *pm2)
{
int m1 = 0;
int m2 = 0;
while (pn) {
m1 += round(pn->m1s);
m2 += round(pn->m2s);
pn = pn->next;
}
*pm1 = m1;
*pm2 = m2;
}
void backlash::dead_zone(struct step_list *pn, int *pm1dz, int *pm2dz)
{
int m1dz = 0;
int m2dz = 0;
struct step_list *plast = NULL;
while (pn) {
if (pn->ploc && plast && plast->ploc) {
if (plast->ploc->px == pn->ploc->px)
m2dz += round(plast->m2s);
if (plast->ploc->py == pn->ploc->py)
m1dz += round(plast->m1s);
}
plast = pn;
pn = pn->next;
}
*pm1dz = m1dz;
*pm2dz = m2dz;
}
void backlash::dumpit()
{
struct step_list *pn = pls;
int px, py;
int m1_delta, m2_delta;
int m1_actual, m2_actual;
int tmp_last_m1, tmp_last_m2;
int m1_dz, m2_dz;
if (!sql_backlash)
return;
// ploc is NULL for starts.
while (pn) {
if (pn->ploc) {
px = pn->ploc->px;
py = pn->ploc->py;
m1_delta = round(ptarget->m1_steps - pn->ploc->m1_steps);
m2_delta = round(ptarget->m2_steps - pn->ploc->m2_steps);
tmp_last_m1 = pn->last_m1;
tmp_last_m2 = pn->last_m2;
fprintf(sql_out, "INSERT INTO corr VALUES( %4d,", mvidx);
} else {
tmp_last_m1 = last_m1;
tmp_last_m2 = last_m2;
fprintf(sql_out, "INSERT INTO move VALUES( %4d,", mvidx);
}
fprintf(sql_out, "%4d, %4d, ", pstart->px, pstart->py);
fprintf(sql_out, "%4d, %4d, ", ptarget->px, ptarget->py);
fprintf(sql_out, "%4d, %4d, ", tmp_last_m1, tmp_last_m2);
if (pn->ploc) {
fprintf(sql_out, "%4d, %4d, ", px, py);
fprintf(sql_out, "%4d, %4d, ", m1_delta, m2_delta);
}
fprintf(sql_out, "%4d, %4d, ", (int)round(pn->m1s), (int)round(pn->m2s));
actuals(pn, &m1_actual, &m2_actual);
fprintf(sql_out, "%4d, %4d, ", m1_actual, m2_actual);
dead_zone(pn, &m1_dz, &m2_dz);
fprintf(sql_out, "%4d, %4d ", m1_dz, m2_dz);
fprintf(sql_out, ");");
fprintf(sql_out, "\n");
pn = pn->next;
}
cleanup();
}
| 24.793529 | 89 | 0.57181 | rgbond |
1f3fc0f7be93156f2a4b34b7d9fcba362be7ce6d | 2,958 | cpp | C++ | Code/Avernakis Nodejs/Avernakis-Nodejs/Private/ImgCodec.cpp | qber-soft/Ave-Nodejs | 80b843d22b0e0620b6a5af329a851ce9921d8d85 | [
"MIT"
] | 39 | 2022-03-25T17:21:17.000Z | 2022-03-31T18:24:12.000Z | Code/Avernakis Nodejs/Avernakis-Nodejs/Private/ImgCodec.cpp | qber-soft/Ave-Nodejs | 80b843d22b0e0620b6a5af329a851ce9921d8d85 | [
"MIT"
] | 1 | 2022-03-20T00:35:07.000Z | 2022-03-20T01:06:20.000Z | Code/Avernakis Nodejs/Avernakis-Nodejs/Private/ImgCodec.cpp | qber-soft/Ave-Nodejs | 80b843d22b0e0620b6a5af329a851ce9921d8d85 | [
"MIT"
] | 3 | 2022-03-26T01:08:06.000Z | 2022-03-27T23:12:40.000Z | #include "StdAfx.h"
#include "ImgCodec.h"
#include "ImgCommon.h"
#include "ImgImage.h"
#define ThisMethod($x) &ImgCodec::$x
#define AutoAddMethod($x, ...) AddMethod<__VA_ARGS__>( #$x, ThisMethod( $x ) )
#define MakeThisFunc($x) MakeFunc( this, &ImgCodec::$x )
namespace Nav
{
namespace
{
ObjectRegister<ImgCodec> c_obj;
}
void ImgCodec::DefineObject()
{
AutoAddMethod( Open );
AutoAddMethod( GetMetadata );
AutoAddMethod( SaveFile );
AutoAddMethod( SaveArrayBuffer );
}
U1 ImgCodec::Ctor()
{
m_Loader = &App::GetSingleton().GetImageLoader();
m_Container.Resize( (S32) ImgContainerType::__Count );
m_Container[(U32) ImgContainerType::AVE].m_Guid = AveGuidOf( Ave::Img::IContainer_AveImage );
m_Container[(U32) ImgContainerType::BMP].m_Guid = AveGuidOf( Ave::Img::IContainer_BMP );
m_Container[(U32) ImgContainerType::JPG].m_Guid = AveGuidOf( Ave::Img::IContainer_JPG );
m_Container[(U32) ImgContainerType::PNG].m_Guid = AveGuidOf( Ave::Img::IContainer_PNG );
m_Container[(U32) ImgContainerType::DDS].m_Guid = AveGuidOf( Ave::Img::IContainer_DDS );
m_Container[(U32) ImgContainerType::TGA].m_Guid = AveGuidOf( Ave::Img::IContainer_TGA );
m_Container[(U32) ImgContainerType::TIF].m_Guid = AveGuidOf( Ave::Img::IContainer_TIF );
m_Container[(U32) ImgContainerType::GIF].m_Guid = AveGuidOf( Ave::Img::IContainer_GIF );
return true;
}
ImgImage * ImgCodec::Open( const CallbackInfo & ci, const WrapData<IoResourceSource>& rs )
{
if ( auto ps = App::GetSingleton().OpenResourceAsStream( rs ) )
{
if ( auto img = m_Loader->Open( *ps ) )
{
if ( auto js = ci.NewJsObject<ImgImage>() )
{
js->SetImage( std::move( img ) );
return js;
}
}
}
return nullptr;
}
WrapData<Img::Metadata> ImgCodec::GetMetadata( const WrapData<IoResourceSource>& rs )
{
if ( auto ps = App::GetSingleton().OpenResourceAsStream( rs ) )
{
Img::Metadata md;
if ( m_Loader->GetMetadata( *ps, md ) )
return md;
}
return {};
}
U1 ImgCodec::SaveFile( PCWChar szFile, ImgImage * img, ImgContainerType nType )
{
if ( (U32) nType >= m_Container.Size() )
return false;
auto& c = m_Container[(U32) nType];
if ( !c.m_Container )
{
c.m_Container = AveKak.CreateWithGuid<Img::IContainer>( c.m_Guid );
if ( !c.m_Container )
return false;
}
return c.m_Container->Save( *img->Get(), szFile );
}
ArrayBuffer ImgCodec::SaveArrayBuffer( PCWChar szFile, ImgImage * img, ImgContainerType nType )
{
ArrayBuffer ab{};
ab.m_Null = true;
if ( (U32) nType >= m_Container.Size() )
return std::move( ab );
auto& c = m_Container[(U32) nType];
if ( !c.m_Container )
{
c.m_Container = AveKak.CreateWithGuid<Img::IContainer>( c.m_Guid );
if ( !c.m_Container )
return std::move( ab );
}
Io::StreamListDirect sld( ab.m_Data );
if ( !c.m_Container->Save( *img->Get(), sld ) )
return std::move( ab );
ab.m_Null = false;
return std::move( ab );
}
}
| 28.171429 | 96 | 0.669371 | qber-soft |
1f3fd874f2da74209926821372fe62724ed7f302 | 253,956 | inl | C++ | src/fonts/stb_font_times_bold_47_latin_ext.inl | stetre/moonfonts | 5c8010c02ea62edcf42902e09478b0cd14af56ea | [
"MIT"
] | 3 | 2018-03-13T12:51:57.000Z | 2021-10-11T11:32:17.000Z | src/fonts/stb_font_times_bold_47_latin_ext.inl | stetre/moonfonts | 5c8010c02ea62edcf42902e09478b0cd14af56ea | [
"MIT"
] | null | null | null | src/fonts/stb_font_times_bold_47_latin_ext.inl | stetre/moonfonts | 5c8010c02ea62edcf42902e09478b0cd14af56ea | [
"MIT"
] | null | null | null | // Font generated by stb_font_inl_generator.c (4/1 bpp)
//
// Following instructions show how to use the only included font, whatever it is, in
// a generic way so you can replace it with any other font by changing the include.
// To use multiple fonts, replace STB_SOMEFONT_* below with STB_FONT_times_bold_47_latin_ext_*,
// and separately install each font. Note that the CREATE function call has a
// totally different name; it's just 'stb_font_times_bold_47_latin_ext'.
//
/* // Example usage:
static stb_fontchar fontdata[STB_SOMEFONT_NUM_CHARS];
static void init(void)
{
// optionally replace both STB_SOMEFONT_BITMAP_HEIGHT with STB_SOMEFONT_BITMAP_HEIGHT_POW2
static unsigned char fontpixels[STB_SOMEFONT_BITMAP_HEIGHT][STB_SOMEFONT_BITMAP_WIDTH];
STB_SOMEFONT_CREATE(fontdata, fontpixels, STB_SOMEFONT_BITMAP_HEIGHT);
... create texture ...
// for best results rendering 1:1 pixels texels, use nearest-neighbor sampling
// if allowed to scale up, use bilerp
}
// This function positions characters on integer coordinates, and assumes 1:1 texels to pixels
// Appropriate if nearest-neighbor sampling is used
static void draw_string_integer(int x, int y, char *str) // draw with top-left point x,y
{
... use texture ...
... turn on alpha blending and gamma-correct alpha blending ...
glBegin(GL_QUADS);
while (*str) {
int char_codepoint = *str++;
stb_fontchar *cd = &fontdata[char_codepoint - STB_SOMEFONT_FIRST_CHAR];
glTexCoord2f(cd->s0, cd->t0); glVertex2i(x + cd->x0, y + cd->y0);
glTexCoord2f(cd->s1, cd->t0); glVertex2i(x + cd->x1, y + cd->y0);
glTexCoord2f(cd->s1, cd->t1); glVertex2i(x + cd->x1, y + cd->y1);
glTexCoord2f(cd->s0, cd->t1); glVertex2i(x + cd->x0, y + cd->y1);
// if bilerping, in D3D9 you'll need a half-pixel offset here for 1:1 to behave correct
x += cd->advance_int;
}
glEnd();
}
// This function positions characters on float coordinates, and doesn't require 1:1 texels to pixels
// Appropriate if bilinear filtering is used
static void draw_string_float(float x, float y, char *str) // draw with top-left point x,y
{
... use texture ...
... turn on alpha blending and gamma-correct alpha blending ...
glBegin(GL_QUADS);
while (*str) {
int char_codepoint = *str++;
stb_fontchar *cd = &fontdata[char_codepoint - STB_SOMEFONT_FIRST_CHAR];
glTexCoord2f(cd->s0f, cd->t0f); glVertex2f(x + cd->x0f, y + cd->y0f);
glTexCoord2f(cd->s1f, cd->t0f); glVertex2f(x + cd->x1f, y + cd->y0f);
glTexCoord2f(cd->s1f, cd->t1f); glVertex2f(x + cd->x1f, y + cd->y1f);
glTexCoord2f(cd->s0f, cd->t1f); glVertex2f(x + cd->x0f, y + cd->y1f);
// if bilerping, in D3D9 you'll need a half-pixel offset here for 1:1 to behave correct
x += cd->advance;
}
glEnd();
}
*/
#ifndef STB_FONTCHAR__TYPEDEF
#define STB_FONTCHAR__TYPEDEF
typedef struct
{
// coordinates if using integer positioning
float s0,t0,s1,t1;
signed short x0,y0,x1,y1;
int advance_int;
// coordinates if using floating positioning
float s0f,t0f,s1f,t1f;
float x0f,y0f,x1f,y1f;
float advance;
} stb_fontchar;
#endif
#define STB_FONT_times_bold_47_latin_ext_BITMAP_WIDTH 512
#define STB_FONT_times_bold_47_latin_ext_BITMAP_HEIGHT 546
#define STB_FONT_times_bold_47_latin_ext_BITMAP_HEIGHT_POW2 1024
#define STB_FONT_times_bold_47_latin_ext_FIRST_CHAR 32
#define STB_FONT_times_bold_47_latin_ext_NUM_CHARS 560
#define STB_FONT_times_bold_47_latin_ext_LINE_SPACING 30
static unsigned int stb__times_bold_47_latin_ext_pixels[]={
0xccca8000,0x000001cc,0x00000001,0x99700000,0x00000199,0x99700000,
0xc9800199,0x00002ccc,0x00000000,0x00000000,0x99950000,0x00000039,
0x01e66644,0x44000000,0x0004cccc,0x0006a000,0x99999988,0x99999999,
0x99999999,0x99700099,0x00000199,0x0004ccc4,0x77764000,0x02eeeeee,
0x22018800,0xff800000,0x00004fff,0x0000ee44,0x7fffe400,0xf980001f,
0x0004ffff,0x1fffffb0,0xfffa8000,0x7f4004ff,0x0000ffff,0x6e8801dd,
0xff300000,0x20009fff,0x2fc802fb,0x3ffe2000,0x000006ff,0x3fffff60,
0x00000001,0x17ffffe4,0xf9100000,0x70005dff,0xffffffff,0xffffffff,
0xffffffff,0xffff300b,0x2000009f,0x01fffff9,0x7ff40000,0x2fffffff,
0x77fdc000,0x002ffec1,0x9ffff300,0x3e980000,0x3e000000,0x0002ffff,
0xffffffb0,0xff880001,0x80001fff,0x0ffffffe,0xfffff500,0x3ea0007f,
0x05ff301f,0x3ff20000,0x740004ff,0x0bfb104f,0xffffd800,0x000002ff,
0xffffff98,0x00000006,0x3fffffe6,0x32000006,0x00fea9cf,0x77fffdc0,
0xffffdccc,0xfeccceff,0xfd805fff,0x000fffff,0xffffe800,0x4000005f,
0xeeeeeeec,0x220002ee,0x3ea4ffff,0x00002fff,0x000bfff9,0x0000bd00,
0x7fffcc00,0xff500002,0x009fffff,0x1ffffb80,0xfffb8000,0xd005ffff,
0x1fffffff,0x0bffa000,0x0000dff7,0x02ffffc0,0x22ffd400,0x0001ffe9,
0x3fffffe6,0x8000006f,0xfffffffe,0x00000002,0xfffffffb,0x3e000005,
0x20027c44,0xf981effb,0x883fffff,0x7d405ffe,0x05ffffff,0x7ffd4000,
0x0001ffff,0x00000000,0x93ffffd4,0x000bffff,0x0017ffe0,0x002be600,
0x7fe40000,0x3a00002f,0xfffdafff,0x3ff60001,0xf880001f,0xfffc9eff,
0x5fffdc01,0x0004fffb,0x3f27fff3,0x000001ff,0x000bfff3,0x5477ff40,
0x40004fff,0xffb9fffe,0x2000003f,0xfe9cfffa,0x0000006f,0xe8dfffa8,
0x800006ff,0x007c80fa,0xf9807fdc,0x203fffff,0x7ff405fd,0x01fffdaf,
0x3fffa000,0x0005fffc,0x5440cc00,0xfff80000,0x3fffe64f,0xff980002,
0xf7000005,0x00005fff,0x003fff80,0x83bfee00,0x10005ffc,0x00003fff,
0xfb837ff2,0x3ffe205f,0x007ffe62,0x7ffffec0,0x000004ff,0x00017ff2,
0xffffff50,0x540001ff,0x3fea0eff,0x3a000007,0x3ff623ff,0x40000002,
0x7fec3ffe,0x7cc00003,0x5c006d81,0x3ffe602f,0x3e203fff,0x83bfee05,
0x00005ffc,0x3e63fff7,0x000002ff,0xffe85ff7,0x7f540000,0x01ff5c0c,
0x006fc800,0x3ffe6000,0x2000007f,0x00003ff9,0x7dc17fe2,0xffb8001f,
0xff100002,0x407fea09,0xfe881ffc,0xfff30005,0x0001ffff,0x002ffc00,
0xffffe800,0x740003ff,0x3ff980df,0xffb80000,0x000dfb01,0x17fdc000,
0x00007fc8,0x017cc5e8,0xff301ae0,0xc807ffff,0x20bff105,0x40001ffb,
0x74c0eff8,0xb000006f,0x1fff89ff,0x00000000,0x000cb800,0x7fff4000,
0x32000005,0x6400003f,0x02fd403f,0x00017ec0,0xf9805fb0,0x200ef886,
0xb0001fd8,0x007fffff,0x077cc000,0xffa80000,0x40006fff,0x7f4404fb,
0x3e200000,0x01fe400e,0x77c40000,0x001fdc01,0x373fee00,0x04b8007f,
0x7fffffcc,0xfc82cc03,0x0037d404,0xe8817f20,0x9800002f,0x02fdc1ee,
0x00000000,0x00039300,0x06764400,0x03100000,0x00130000,0x026000a6,
0x00130000,0x80062062,0xdd100009,0x00000bdd,0x00000988,0x17777640,
0x80022000,0x22000009,0x00022001,0x00262000,0x40000044,0x000befc9,
0x7fcc0198,0x3803ffff,0x2a600130,0x07910000,0x00001760,0x00000000,
0xe9800000,0x0002efff,0x00000000,0x00020000,0x36a00000,0x00000002,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00400000,0x7fcc0000,0x0003ffff,0x00000000,0x26600000,0x99999999,
0x98809999,0x19999999,0x55555553,0xaaa98355,0xee8002aa,0x0000fb32,
0x20000000,0xabcdcba8,0x5403ec01,0x99aceedc,0x40099999,0x03ffffea,
0x26666600,0x99999999,0x55555019,0x00001555,0x0006aaa6,0xaaaaaa98,
0x554c1aaa,0x26662aaa,0x99999999,0x99880999,0x01999999,0x2b332ea2,
0x4ccc4480,0x99999999,0x26666620,0x09999999,0x26666660,0x32a60001,
0x0dc01bcc,0x33333333,0x01333333,0x33333331,0x7fcc0033,0x2003ffff,
0xaaaaaaa9,0x5554c1aa,0x310002aa,0x05799d95,0xffed80dc,0xffffffff,
0xffec81de,0xf54effff,0xbfffffff,0xffffda85,0x20fcc003,0x300003f8,
0x3379ddb9,0x00133333,0x3ffffae2,0x0bffffff,0xfd301fe4,0xffff7bff,
0x805fffff,0x01fb31ee,0x3fff7200,0xffffffff,0xfffd504d,0x20003fff,
0xfefffedb,0x000befff,0xfffffff5,0xffda85bf,0x3ffb63ff,0xffffffff,
0xffec81de,0x704effff,0xfffdffff,0xff71e239,0xffffffff,0x7fff645d,
0xefffffff,0xffffd104,0xfc8800df,0xffffffff,0xd8be22ce,0xfffffffe,
0xc81defff,0xeffffffe,0x3ffe6004,0x2a003fff,0xffffffff,0x7ffed42d,
0x3b66003f,0xffffffff,0x07e62dff,0xfffffd10,0x3a2001df,0xfe880fff,
0x6406ffff,0x7c8000ff,0x98000db0,0xfdbbfffd,0x2fffffff,0xdffffb80,
0x3fff260a,0x5409f73f,0x7f43ffff,0x02ffffff,0x07f107e6,0xffff7000,
0x6c00bfff,0x001fffff,0x5effff4c,0xffffb510,0x3ffa2005,0x7e406fff,
0xfffd100f,0x2001dfff,0x300fffe8,0x4c419ffd,0x887ffffd,0xfffffffd,
0x3fffea02,0x1000ffff,0x44005ffd,0xadfffffd,0xfffdb999,0xfe882ffe,
0x00efffff,0x01fffd10,0xfffff300,0xfe88007f,0x6406ffff,0x3f2000ff,
0x220aefff,0xfeffffb9,0xfffb801f,0x44003fff,0x3fea02ff,0x7d407fff,
0x81f50003,0x2a0004f8,0x7f42ffff,0x02ffffff,0x13ffff62,0xffffff30,
0x7fffc40b,0x9ffffa86,0x41f20099,0xfd00006d,0x001fffff,0x0fffffe4,
0x9ffff900,0xdffff980,0xffffa800,0x01fd407f,0x3fffffee,0x17fc4003,
0xa809ffd0,0xff307fff,0x801fffff,0x7ffffffa,0x002fdc00,0x3bfffff3,
0xffffe980,0xfffff702,0xff88007f,0xfff30002,0x50007fff,0x80ffffff,
0xfd3003fa,0x2e005fff,0x801fffff,0x3ffffffa,0x400ff800,0x02fffffe,
0xf80003f2,0x0003f20d,0x43ffffcc,0x999ffffa,0xfffff100,0x3ffea009,
0x3ffa01ff,0xfff884ff,0x83f5005f,0xb00003f8,0x00ffffff,0x1fffffb8,
0xffffe880,0xffff3006,0xfffd003f,0x07e405ff,0x3ffffea0,0x0ff8003f,
0x001fff90,0x7ec0fff3,0x802fffff,0x1ffffffe,0x4007f200,0x05fffffb,
0x817ffe40,0x3ffffffa,0x000ff800,0xffffff30,0x3ffa0007,0x3f202fff,
0xffffc800,0x7fcc002f,0xffa801ff,0x8002ffff,0xfffa807e,0x013a05ff,
0xffbff700,0x7ff40009,0xfff884ff,0xfffe805f,0x3fa000ff,0x3fe06fff,
0xfff03fff,0x37e003ff,0x0001f910,0x3fffff60,0x7ffdc007,0xffd801ff,
0x36000eff,0x400fffff,0x05fffffa,0x3fea013a,0x8002ffff,0xbfff307e,
0x303fdc00,0x0bffffff,0xffffff70,0x80374009,0x05fffffa,0x205ffb00,
0x2ffffffa,0x0007e800,0x3fffffe6,0xfff50003,0x02740bff,0x1fffffdc,
0x1fff9800,0xfffffa80,0x07d8002f,0x1fffffd0,0x00003f30,0x0003bfb1,
0x03fffff8,0x403fffff,0x05fffffc,0x7ffffd40,0xfffff984,0x5fffff03,
0x3fbfee00,0x3600004f,0x007fffff,0x0fffffdc,0x3ffffee0,0x7ffcc003,
0xffe805ff,0x1f980fff,0xfffffa80,0x07d8002f,0x800ffff5,0x7fff407d,
0x7c400fff,0x007fffff,0xff3007f1,0x0001ffff,0xffa817f4,0x8002ffff,
0x3e60007d,0x003fffff,0x3fffffa0,0x4401f980,0x006fffff,0x400ffd40,
0x2ffffffa,0x7007d800,0x909fffff,0x7ec0000d,0x7fcc0004,0xfff03fff,
0x3fea05ff,0x4001ffff,0x1ffffffd,0x1fffffcc,0x03fffff8,0x002f6e20,
0xffffb000,0xffb800ff,0x3e201fff,0x001fffff,0x2fffffe8,0x7ffffdc0,
0xf5006c84,0x005fffff,0x3ff20fb0,0x3ea003ff,0x3fffee00,0xffd803ff,
0xb802ffff,0x7ff4400f,0x40003fff,0xfff502fb,0xb0005fff,0x7fcc000f,
0x0003ffff,0x13ffffee,0x3ff601b2,0x80003fff,0xffa801fd,0x8002ffff,
0xfff1007d,0x03f81fff,0x1fff1000,0x7ffd4000,0xffff03ff,0x3fffa07f,
0x7e4006ff,0x86fffffe,0xf03fffff,0x0003ffff,0x7ec00000,0x4007ffff,
0x01fffffb,0x1ffffffa,0x7fffe400,0x3fe200ff,0x1fc0ffff,0xfffffa80,
0x07d8002f,0x05fffffb,0xf8803e20,0x807fffff,0x5ffffffa,0xfb805e80,
0x000fffff,0xfa817c40,0x002fffff,0x260007d8,0x03ffffff,0x3fffe200,
0x201fc0ff,0x0ffffffb,0x01f98000,0xffffffa8,0x007d8002,0x8ffffff2,
0x900000fa,0x40007fff,0x03fffff8,0x305fffff,0x0bffffff,0x7fde7dc0,
0x7e43ffff,0xff884fff,0x751006ff,0x0039dfdb,0x3ffff600,0x7fdc007f,
0xff501fff,0x0009ffff,0x3fffffee,0x7fffe403,0x4003ea3f,0x2ffffffa,
0xf707d800,0x019fffff,0xfff90070,0xff005fff,0x401fffff,0xffe802f9,
0x00006fff,0x3ffea059,0xd8002fff,0x3fe60007,0x0003ffff,0x1fffffe4,
0x7fc401f5,0x0007ffff,0x3ea007a0,0x002fffff,0x3e2007d8,0x1766ffff,
0x7ffc4000,0x7f40006f,0xff883fff,0xffc80fff,0x5004ffff,0x3fffeabf,
0x7ffcc4ff,0xffff985f,0xdeffa804,0x005ffffe,0xfffffd80,0x7ffdc007,
0xfff701ff,0x20007fff,0x5ffffff9,0x7ffffc40,0xfa801766,0x002fffff,
0xfff307d8,0x007fffff,0xfffff300,0xfffa80bf,0x3203ffff,0xffffa807,
0x000004ff,0xffffffa8,0x007d8002,0x3ffffe60,0x7c40003f,0x1766ffff,
0xffffff50,0x0040000d,0xffffffa8,0x007d8002,0x57ffffec,0x700002f8,
0x005fffff,0x2ffffd40,0x827fffcc,0x3ffffffe,0x3e26f980,0xb86fffff,
0x7e40ffff,0x7ec404ff,0x7fffe41f,0x7fec0004,0x5c007fff,0xb01fffff,
0x05ffffff,0x3fffe200,0xffd806ff,0x02f8afff,0x3ffffea0,0x07d8002f,
0x3ffffffe,0x40003fff,0x0ffffffe,0x3fffff60,0x09f106ff,0xffffffb0,
0x50000005,0x05ffffff,0x4000fb00,0x3ffffff9,0xfffd8000,0x402f8aff,
0x5ffffffc,0xa8000000,0x02ffffff,0x4c007d80,0x7bdfffff,0x3ffa0000,
0x40006fff,0x640ffffc,0x3fe05fff,0x402fffff,0x3fe20ef8,0xd507ffff,
0xffb37fff,0xdffb005f,0x0bffffe0,0xffffd800,0x7fdc007f,0xffd01fff,
0x0005ffff,0x3fffffe2,0xffff9807,0x54007bdf,0x02ffffff,0x3ea07d80,
0xffffffff,0xf70002ef,0x207fffff,0xffffdbf9,0x01fa81ff,0xfffffff8,
0xa8000002,0x02ffffff,0x20007d80,0x3ffffff9,0xfff98000,0xd807bdff,
0x03ffffff,0xfa800000,0x002fffff,0xfe8007d8,0x004fffff,0xfffff500,
0xa80003ff,0xfe99effe,0x3fe204ff,0x202fffff,0x7fc40fe8,0x200fffff,
0xbdfffffc,0xffff9800,0x5fffff83,0x3fff6000,0x7dc007ff,0xf881ffff,
0x01ffffff,0xfffff100,0xffd003ff,0x8009ffff,0x2ffffffa,0x5c07d800,
0xffffffff,0x4001dfff,0x7ffffff8,0xfff51f90,0x0dd09fff,0x3fffffe0,
0x8000001f,0x2ffffffa,0x0007d800,0x3fffffe6,0xffd00003,0xf009ffff,
0x05ffffff,0xf5000000,0x005fffff,0xf5000fb0,0x001fffff,0x3ffffa00,
0x00005fff,0x9dfffff9,0xffff9801,0x3fa01fff,0xffffff01,0x44bae05f,
0xfffc8001,0xffffe86f,0x3ff60006,0x5c007fff,0x981fffff,0x1fffffff,
0x3fffe000,0xfa802fff,0x000fffff,0x7fffffd4,0x807d8002,0xfffffffc,
0x002fffff,0x7fffffe4,0x3ffe4f82,0x1fc47fff,0x7ffffc40,0x000000ff,
0xffffffa8,0x007d8002,0x3ffffe60,0xf500003f,0x801fffff,0xfffffff8,
0x80000001,0x2ffffffa,0x0007d800,0x00dfffff,0x3fafe600,0x000fffff,
0x018975c0,0x7ffffcc0,0x05fb01ff,0x7ffffffc,0x0017f4c2,0x37fffd40,
0x037ffff4,0xfffffb00,0xfffb800f,0xfff981ff,0x0000ffff,0x3ffffffe,
0xfffff002,0xfff5000d,0xb0005fff,0x3ffee00f,0xffffffff,0x3fe6003f,
0x7d45ffff,0x3fffff21,0x2003ee2f,0xfffffff9,0xa8000001,0x02ffffff,
0x20007d80,0x3ffffff9,0x3ffe0000,0xff9806ff,0x001fffff,0xffa80000,
0x8002ffff,0xff90007d,0x200005ff,0xfffff77d,0x3a60009f,0xff80002f,
0xc81fffff,0x3ffe203f,0x7f41ffff,0xf900001f,0xfffd05ff,0x7ec000df,
0x4007ffff,0x81fffffb,0xfffffff8,0x3ffe0001,0x9001ffff,0x0005ffff,
0x5ffffff5,0x400fb000,0xffffffd8,0x002fffff,0x3ffffffa,0xfff31ba0,
0x02f4bfff,0xffffff98,0x8000002f,0x2ffffffa,0x0007d800,0x3fffffea,
0x3f200004,0xf8802fff,0x02ffffff,0xfa800000,0x002fffff,0xf10007d8,
0x00001fff,0x3ffe29f1,0xd0007fff,0xd00003ff,0x85ffffff,0x7fc404fb,
0x260fffff,0x999befff,0x81800199,0x6fffffea,0x3fff6000,0x7dc007ff,
0xff01ffff,0x005fffff,0x3ffffe20,0xff1000ff,0xf50001ff,0x005fffff,
0xb3000fb0,0xffffffff,0x7fdc00df,0x5f33ffff,0xffffffd0,0x7c005f31,
0x03ffffff,0xffa80000,0x8002ffff,0xff30007d,0x05ffffff,0x3ffe2000,
0xffff000f,0xd1007fff,0xdddddddd,0x2a07dddd,0x02ffffff,0x20006e80,
0x00004ffd,0x7ffe41f9,0x4c003fff,0x999befff,0xfc800999,0x2a3fffff,
0xfff8805f,0x7fe47fff,0xffffffff,0x4003dfff,0xfffecfea,0x3f60006f,
0x4007ffff,0x01fffffb,0x7ffffffb,0x3ffe2000,0x6c007fff,0xf50004ff,
0x005fffff,0x4c000dd0,0xfffffffe,0xfff1003f,0x41f2ffff,0xbffffffb,
0x7ffc007d,0x0004ffff,0xffffa800,0x6e8002ff,0x3fffa200,0xffffffff,
0x6c0002ef,0x3fe004ff,0x004fffff,0x3fffff22,0x2a01bfff,0x02ffffff,
0x20006e80,0x80001ff9,0x7ffcc4f8,0x64006fff,0xffffffff,0x02efffff,
0x9ffffff7,0x26003be6,0x45ffffff,0xfffffffb,0xffffffff,0x7ff5400e,
0x0dffffd3,0x7fffec00,0x7fdc007f,0xff901fff,0x0009ffff,0x3fffffe6,
0x0ffcc005,0xffffa800,0x6e8002ff,0x3aa001b0,0x04ffffff,0x3fffff20,
0xff103fbf,0x09ffffff,0xfffffd80,0x8000006f,0x2ffffffa,0x0006e800,
0x30000000,0x7e4003ff,0x005fffff,0xffffffd8,0xffff9803,0x6f8002ff,
0x00374000,0xfd81fb80,0x002fffff,0x3fffffee,0xffffffff,0x7ffcc0df,
0x0fe8dfff,0xfffff700,0xffff885f,0xffffffff,0xb106ffff,0x7ff45fff,
0x06e206ff,0x3fffffec,0x3fffea00,0xffff301f,0x2e0009ff,0x02ffffff,
0x20006e80,0x2ffffff9,0x7b06f800,0xffffd800,0x3fe6006f,0x00ffffff,
0x3ffffff2,0x7fcc001f,0x0007ffff,0xffff9800,0x6f8002ff,0x00010000,
0x800dd000,0x6ffffff9,0xffffc800,0xff9802ff,0x8003ffff,0x17c0005f,
0x505e8000,0x0bffffff,0x7ffffc40,0xffffffff,0xffd84fff,0x01feefff,
0x3fffff60,0xffffd306,0xffffffff,0xfe981fff,0x7fff42ff,0xbfff906f,
0xdfffffb0,0xffffa800,0x3fff601f,0xfb0006ff,0x000dffff,0xf98000be,
0x003fffff,0x00bb05f8,0x6ffffe88,0x7ffff400,0x7fcc05ff,0x0006ffff,
0x1ffffffd,0xf9800000,0x003fffff,0x440005f8,0x00002efd,0x3a000be0,
0x007fffff,0xffffffb8,0xffff8801,0x7cc003ff,0x01ea0003,0xd017d400,
0x03ffffff,0x7ffff4c0,0xffffffff,0xfff887ff,0x4002ffff,0x03ffffff,
0x3bbbffee,0xfffffffe,0x3fffa22f,0x6ffffe87,0x1fffff88,0x37ffffec,
0x3fffea00,0x3ffe200f,0xe8001fff,0x002fffff,0x440007a8,0x03ffffff,
0xfd81fcc0,0x7ffcc000,0x7fdc004f,0xe801ffff,0x003fffff,0xffffff70,
0x40100009,0x3ffffff8,0x001fcc00,0x03ffff20,0x01ea0000,0x7ffffcc0,
0x7fdc001f,0xd001ffff,0x00bfffff,0x75c02fc8,0x00026c0c,0x7fdc06e8,
0x4004ffff,0xfeeffffb,0xffffffff,0xfffffa82,0x7ffd4004,0xffd505ff,
0xfffd3003,0x2ffffe43,0x437ffff4,0x43fffffb,0x04fffffd,0xffff31dc,
0xffff900f,0xffa800bf,0x3ae05fff,0x00026c0c,0x2ffffff4,0x6c0bf200,
0xfff8005f,0x7fc4002f,0xf7006fff,0x0001ffff,0x3fffffec,0xd0162000,
0x00bfffff,0x40002fc8,0x003ffffc,0x4d819d70,0x3ffee000,0x7dc005ff,
0x001fffff,0x0dfffff7,0x2a037cc0,0x03e24fff,0x33be6000,0xfdcccccc,
0x00ffffff,0x009effa8,0x07fff662,0x07ffffe4,0xdffffd00,0x05fff101,
0x7f46ff80,0x7fc47fff,0xffa87fff,0x7ff40fff,0x3f602fff,0xdffff32f,
0xffffd100,0x7ff4001f,0xff500fff,0x0007c49f,0x7ffffdc0,0x81be6006,
0x7c002ffd,0xc8000fff,0x1003ffff,0x000bffff,0xffffff88,0x0df10004,
0x6fffffb8,0x001be600,0x13fbf620,0x93ffea00,0x640000f8,0x001fffff,
0x3fffffee,0xffff1001,0xff100bff,0x7fffd805,0x6c000172,0xffffffff,
0xffffffff,0x2fff803f,0x103ffc00,0x009fffff,0x07ffffee,0x0017ffcc,
0xfff89ff1,0xffcadfff,0xf887ffff,0xfff84fff,0xff100eff,0x3fffe29f,
0xfffd1004,0x3fea009f,0x3f601fff,0x001727ff,0x7ffffc40,0x2ff8805f,
0x007fff60,0x0017ffcc,0x00ffff98,0x00bfff60,0x3fffe600,0x7d4003ff,
0x7ffc401e,0xf8805fff,0x4c00002f,0xffd8001f,0x0001727f,0x077ffff4,
0xfffffb80,0x3fe6001f,0x880cffff,0xfb803fea,0x00fb9fff,0x003f8800,
0xfffffff1,0x03fff980,0x9813fe20,0x03ffffff,0x06ffffd4,0x003fffa0,
0x3f217fa2,0xcfffffff,0xecfffffd,0x307ffea1,0x803fffff,0xfff14ffd,
0xffe8800d,0x7fd404ff,0x7dc01eff,0x00fb9fff,0x3ffe6000,0xa880cfff,
0x7fec03fe,0xffe803ff,0x7ff40004,0x3ffd4004,0xffb10000,0x44019fff,
0x26005fd9,0x0cffffff,0x003fea88,0x0006b800,0xf73ffff7,0x7dc00001,
0xb801efff,0x01ffffff,0x7ffff540,0xffebceff,0xfff1003f,0x00007fff,
0xfd8003f2,0x402fffff,0x8800ffff,0x3be205fe,0xbefffea8,0x3ffff261,
0xfffb1003,0xb755355b,0x3fe605ff,0xf31effff,0x905fffff,0xfd315dff,
0xf3003fff,0x3fff93df,0x3ffee000,0xfb710adf,0x22009fff,0x03ffffff,
0xffea8000,0xebceffff,0xfd803fff,0x40aeffff,0x0003ffe9,0x8001ffb8,
0x800004ff,0xdffffffb,0xfffecaac,0xffea8002,0xebceffff,0x00003fff,
0x10001eb8,0x07ffffff,0xffb10000,0xb8813bff,0x0beffffe,0xffff9000,
0x19ffffff,0xeffc9800,0x9f100002,0xffff9800,0x7f4406ff,0xba9aadff,
0x2204ffed,0x7fecc0ee,0xdfffffff,0xdd910002,0x579dffff,0xeffda801,
0x77ff5c0b,0x3fffa602,0x001dffff,0x33ffffaa,0x75c40000,0xffffffff,
0x4c001cef,0x0002effc,0x7fffe400,0x0cffffff,0x9511db00,0xfffddfff,
0x2200001b,0x3f90005f,0x2a200000,0xfffffffd,0x0000dfff,0x7fffffe4,
0x000cffff,0x005ecc00,0x3bff2600,0x4c000002,0xfffffffd,0x0bdfffff,
0x32a60000,0x0009abcc,0xc8000000,0xffe8002f,0xa802ffff,0xffffffec,
0x1fd802de,0x5665d4c0,0x10000009,0x80088000,0x2ea60008,0x40000abc,
0x22000000,0x1abcccaa,0x00000000,0x99953000,0xb8001357,0x37997500,
0x37000001,0x000e6000,0x5d4c4000,0x0001abcc,0xbccca980,0x0000009a,
0x00000001,0x54c00000,0x19abcccb,0x00000000,0x00000000,0x20003fe2,
0x6ffffffb,0x00031000,0x00000062,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x3ffa0000,0xfff88001,
0x0003ffff,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x75400000,0x4000dfff,0xfffffffb,
0x0000002f,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0xfffff900,0x75407dff,0xffffffff,
0x0000ffff,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x40000000,0x0005eeea,0x6664c000,0x200002cc,0x0005eee9,
0x00000000,0x30336000,0x0000007b,0x9980001c,0x99999999,0x99999999,
0x00099999,0x41cc9800,0x5d4405ec,0x40002bcd,0x000001ca,0x65c006e4,
0x05d50000,0x00003930,0x02cccca8,0x40174400,0x333300e9,0x33333333,
0x90000133,0x00099999,0xcccc9800,0xddd10002,0x000bdddd,0x0005dc40,
0x01dffb00,0xfc800000,0x0000efff,0x00fffd40,0x07f60000,0x0001fd10,
0xb3bff300,0x000000df,0x200007cc,0xfffffec8,0xffffffff,0xffffffff,
0x3f200002,0x3f64ffbc,0x37ffee07,0x8002effe,0x7c45ffff,0x82fcc00d,
0xfb101ff9,0x3fe80009,0x0001fee0,0xffffff10,0x01ff0000,0xfd903fc4,
0xffffffff,0x80005bff,0x01fffff9,0x7ff40000,0x30000fff,0x0ffffffb,
0x3ffea000,0xff00002f,0x0000000b,0x003bfffe,0x27fcc000,0x3e600000,
0x07ff302f,0x7fdc0000,0x00000fff,0x0013f600,0xffffe880,0xccccceff,
0x2fffffec,0x2bf90000,0xffb0fffb,0x982fffa0,0x2a002fff,0x5c0fffff,
0x1ff700ef,0x2217fec0,0x40000ffe,0xffc84ffa,0x7e400002,0x003fffff,
0x4d67fec0,0x806ffca9,0xffffffe8,0x3200002f,0x0002ffff,0x7fffdc00,
0x7c0004ff,0x0007ffff,0x0dffffb0,0x009d3000,0x3e600000,0x00000eff,
0x00026c40,0x21ffec00,0x00006ffa,0x01eeec80,0x3e200000,0x200000ff,
0x4ffffffa,0x17fff540,0x9ffd4000,0x1ff67ffd,0x7ec17ff6,0xffb001ff,
0xff887fff,0x027fe41f,0x7ccfffe6,0xd00003ff,0x3ffa2bff,0x7c400006,
0x0fffffff,0x3ffe6000,0x2fffffff,0xfffff300,0xe80000bf,0x00002fff,
0x7ffffc40,0x20000fff,0x007fffff,0xffffff00,0x20660001,0x000000a8,
0x001dff90,0x22066000,0x3000000a,0x3ff29fff,0x2000002f,0x000a8819,
0xfffc8000,0x3e600003,0x004fffff,0x00005ff9,0x3fea5ffd,0xff31ff63,
0x3fff603f,0xffff5003,0x5fff701f,0x001fffb1,0xfffbfffb,0x7d40000d,
0x1ffffeff,0x7fec0000,0x03fffaaf,0x7fffe400,0x2004ffff,0x5ffffff8,
0x3fe60000,0x8000002f,0xff9bfffc,0x3fa0004f,0x00007fff,0x00dffffb,
0xfd0bfee0,0x0000001f,0x00001fff,0xfd0bfee0,0x2000001f,0xfffffffc,
0x2e000005,0x07ff42ff,0xff100000,0x40000dff,0x4ffffff9,0x000bf600,
0x445fff30,0x3ee3fec0,0xfffd02ff,0x7fff4009,0x3ffffa04,0xf1003fff,
0x05ffffff,0xfffe8000,0x00005fff,0xf30f7fcc,0xb80001ff,0x04ffffff,
0x7ffffc40,0x3200004f,0x000003ff,0x221fff88,0xd0001ffe,0x000fffff,
0x0bfffe60,0x227fec00,0x00001fff,0x000ffcc0,0x89ffb000,0x00001fff,
0xffffff10,0x4000003f,0x7ffc4ffd,0x2e000001,0x002fffff,0xfffff100,
0x17cc009f,0x3fff6000,0x363fec02,0xff905fff,0x0b98003f,0x7ffffd40,
0x7fe4006f,0x00006fff,0xffffff98,0x7f400000,0x04fe880e,0xcedc9800,
0xfff88001,0x00004fff,0x00000ffa,0x44077ec0,0xfd0005fe,0x0000ffff,
0x20000ba8,0x2fdc1ee9,0x54c00000,0x4c000000,0x02fdc1ee,0x3ff20000,
0x00004fff,0x2e0f74c0,0x4000005f,0x06fffffe,0xffff1000,0x206a09ff,
0x3e60002e,0x7ec03fff,0x17fffe47,0x00002db8,0x7fffff40,0x7ffc4002,
0x000001ff,0x009ffffb,0x404fa800,0x00000fe8,0xfff10000,0x00009fff,
0x00000154,0x6c00df98,0xffe8001f,0x000007ff,0x00000000,0x00000000,
0x00000000,0xdddd1000,0x0000001b,0x80000000,0xfffffffa,0xff880001,
0x5b04ffff,0x6c000590,0x6c02ffff,0x7fffd47f,0x0000002f,0x13bbbaa0,
0x00000000,0x00000000,0x00004c00,0xff880000,0x0004ffff,0x00000000,
0x004c0031,0x3fffff40,0x26000000,0x99999999,0x88099999,0x99999999,
0x99530001,0x21b80379,0x99999999,0x80999999,0x99999998,0x00000019,
0x26666600,0x99999999,0x99998809,0x80019999,0xfffffffe,0xff880005,
0x5d04ffff,0xa8800110,0x01fffffd,0x3fa23fec,0x000dffff,0x55555550,
0x80000015,0x0acccba8,0x54c00048,0x5c01bccc,0x26666661,0x99999999,
0x99999880,0x32a01999,0x999aceed,0xf1009999,0x209fffff,0x99999998,
0x33100099,0x01333333,0x00000000,0x44fffffd,0x2203dedb,0x2aaaaaaa,
0xfffffed8,0x1defffff,0xfffffec8,0x322004ef,0xffffffff,0x8be22cef,
0xffffffed,0x81deffff,0xffffffec,0x0380004e,0xfffdb000,0xdfffffff,
0xfffd903b,0x8009dfff,0xffffebf9,0x440000ff,0x84ffffff,0xb80002f8,
0xffffffff,0x7fd81eee,0xffffff98,0xfea8002f,0x261fffff,0x99999999,
0x70099999,0xfffdffff,0x2001e239,0xffffffc8,0x222cefff,0x3fffb62f,
0xefffffff,0xfffec81d,0xe984efff,0xfffbdfff,0x02ffffff,0x9ffffff1,
0x3ffffa60,0x800fffff,0xffffffeb,0x3333313f,0x13333333,0x99999880,
0xfffd0199,0x3fffeeff,0xfc881fff,0x207fffff,0xffffffe8,0xffd1000e,
0x7ec4001f,0x99adffff,0xfefffdb9,0xfffe882f,0x1000efff,0x0001fffd,
0x00003e60,0xfffffe88,0xfd1000ef,0x360001ff,0xffffff77,0xff880009,
0xfc84ffff,0xffe80002,0xffffffff,0x507fd80f,0x9fffffff,0x3fffa000,
0xffd911ff,0xffffffff,0xffe985bd,0x3ff6620c,0x362007ff,0x9adfffff,
0xefffdb99,0xffe882ff,0x000effff,0x201fffd1,0x743ffffa,0x2fffffff,
0xffffff10,0xfffe8809,0x2006ffff,0x5c1fffd8,0xffffffff,0x4c03efff,
0xeffffffe,0xfffffe80,0xffffdefa,0xfff100ef,0xffb80fff,0x4003ffff,
0x26002ff8,0x01dfffff,0x17ffff4c,0xffffffb8,0x17fc4003,0x09fb0000,
0xfffb8000,0x44003fff,0xf10002ff,0x3ffffe29,0x7c40007f,0x544fffff,
0xd80002ff,0xffffffee,0x0ffb05ee,0x3fffffa2,0x64000eff,0x881fffff,
0xfffffffe,0x013ffa02,0x200ffff5,0x1dfffff9,0x7ffff4c0,0xfffff702,
0xff88007f,0xdffff102,0x33ffff50,0x3ffe2013,0xe8804fff,0x4fffffff,
0x5017fc00,0xffffffff,0xffd88003,0x3fffa01e,0x3fa63fff,0x3fe05fff,
0x7d407fff,0x003fffff,0xf7000ff8,0x800bffff,0xf502fffc,0x007fffff,
0x00001ff0,0x0003ffe2,0xfffffa80,0x0ff8003f,0x641f9000,0x03ffffff,
0x3fffe200,0xffc98cff,0x2600002f,0x804fffff,0xafe887fd,0xeffffffe,
0x3ffee000,0xfff501ff,0x7e40bfff,0xff9800ff,0xffffb807,0x7fe4005f,
0xffff502f,0xff0007ff,0x3ffffa01,0x5ffff884,0xfffff880,0xfff3004f,
0x005fffff,0x3ee007ec,0x01ffffff,0x401ffa80,0x84fffffe,0x02fffff9,
0x80fffffd,0x2ffffffa,0x5007e800,0x00bfffff,0x540bff60,0x02ffffff,
0x00007e80,0x000ffff2,0xfffffa80,0x07e8002f,0xf989f100,0x006fffff,
0x3ffffe20,0xffffffff,0x3ee00002,0xd802ffff,0x897f447f,0xfffffffd,
0xffff7000,0x3ffe603f,0xff304fff,0x3fdc00bf,0x3ffffea0,0x5ffb0005,
0x3ffffea0,0x07e8002f,0x40fffffe,0x401fffff,0x4ffffff8,0xfffff300,
0x2003ffff,0xfffd007c,0x90009fff,0xfffd007f,0x3ffe01ff,0xfffd06ff,
0xfffa80ff,0xd8002fff,0xffff9807,0x3a0000ff,0xffff502f,0xfb0005ff,
0x3fe20000,0x200006ff,0x2ffffffa,0x0007d800,0xfffb03f7,0x20005fff,
0xeffffff8,0x02ffffec,0x3fff2000,0x2a9800ff,0x7fd437ec,0x7006ffff,
0x203fffff,0x4ffffff9,0x00ffff50,0x3fe607d8,0x0000ffff,0x7fd40bfa,
0x8002ffff,0xffff307d,0x3fffe07f,0x7ffc402f,0xf3004fff,0xfffffffb,
0x00f9001d,0x3fffffe6,0x1be2000f,0x3fffff40,0x1fffff90,0x0fffffd0,
0xffffffa8,0x407d8002,0x3fffffe8,0x817dc000,0x2ffffffa,0x0007d800,
0x5fffff70,0x3fea0000,0x8002ffff,0x0bd0007d,0x3fffffea,0xfff10005,
0x7f449fff,0x3a00002f,0x0007ffff,0x74c13fe6,0x803fffff,0x01fffffb,
0x9ffffff1,0x0fffff20,0xe880fa80,0x003fffff,0xfa817dc0,0x002fffff,
0xfff307d8,0x3ffe07ff,0x7fc403ff,0x3004ffff,0xfffffb3f,0x0f900bff,
0x7ffffec0,0x07f6005f,0x3fffff40,0x3fffff70,0x0fffffd0,0xffffffa8,
0x407d8002,0x0ffffffb,0x817c4000,0x2ffffffa,0x0007d800,0xdfffffd0,
0x3fea0000,0x8002ffff,0x2fa8007d,0x3fffffa0,0xff88001f,0x7c44ffff,
0xf100002f,0x000bffff,0x3602ffdc,0xb806ffff,0x101fffff,0x09ffffff,
0x0bfffff6,0x7dc07c40,0x000fffff,0xfa817c40,0x002fffff,0x3ffe07d8,
0xffff03ff,0xfff8803f,0xf3004fff,0x3fffffa3,0x03e404ff,0xffffff10,
0x09f3003f,0x3fffff40,0x7fffff70,0x0fffffd0,0xffffffa8,0x407d8002,
0x06fffffe,0x2a059000,0x02ffffff,0x80007d80,0xfffffffa,0xffa80001,
0x8002ffff,0x06e8007d,0x7fffffdc,0xfff88004,0x2fa84fff,0xfff30000,
0x740009ff,0xffe807ff,0x7fdc00ff,0xff101fff,0x2e09ffff,0x0cffffff,
0xfffd0380,0x20000dff,0xffff502c,0xfb0005ff,0x27fffe40,0x037fffc4,
0x7fffffc4,0x223f3004,0xffffffff,0x9001f202,0x0bffffff,0x74001fd0,
0x2a07ffff,0xe84fffff,0x5407ffff,0x02ffffff,0x3ea07d80,0x004fffff,
0xfffa8000,0xd8002fff,0xffe80007,0x005fffff,0xfffffa80,0x07d8002f,
0x66677cc0,0xfffdcccc,0x4000ffff,0x4ffffff8,0x00002f88,0x05fffff7,
0x2ffffc00,0x07fffa20,0x3fffff70,0x3ffffe20,0xffff304f,0x0007ffff,
0x9ffffff5,0xf5000000,0x005fffff,0x7fcc0fb0,0xfff985ff,0xfff8804f,
0xf3004fff,0x7ffffcc3,0x0f901fff,0xfffff880,0x0bee02ff,0xfffffd00,
0x7ffffd40,0x7ffffe85,0x7ffffd40,0x07d8002f,0x3ffffff6,0xa8000002,
0x02ffffff,0x40007d80,0xffffebf9,0x540000ff,0x02ffffff,0x6c007d80,
0xffffffff,0xffffffff,0x7fc4003f,0x5d04ffff,0xfc8015c0,0x0000ffff,
0x013ffffa,0xf700fff7,0x2203ffff,0x04ffffff,0x3ffffffe,0x36003fff,
0x02ffffff,0xffa80000,0x8002ffff,0x7ffdc07d,0x27ffe40f,0xfffff880,
0x83f3004f,0xfffffffb,0x8007c80e,0x6ffffffb,0xd000df10,0x540fffff,
0xe83fffff,0x5407ffff,0x02ffffff,0x3fe07d80,0x002fffff,0xfffa8000,
0xd8002fff,0xbbec0007,0x04ffffff,0x7fffd400,0x7d8002ff,0x400fe200,
0x7ffffff8,0x7fffc400,0x405904ff,0xfffd001f,0xfb8000ff,0x2605ffff,
0xffb805ff,0xff101fff,0x5409ffff,0xffffffff,0xff802eff,0x002fffff,
0xfffa8000,0xd8002fff,0xfffea807,0x02fffd9b,0x3ffffe20,0x03f3004f,
0xfffffff9,0x2000f90b,0x2ffffffe,0xe8001fc8,0x2e07ffff,0xe82fffff,
0x5407ffff,0x02ffffff,0x3fe07d80,0x001fffff,0xfffa8000,0xd8002fff,
0x53e20007,0x7ffffff8,0x7ffd4000,0xd8002fff,0x003f2007,0xffffffd8,
0x3ffe2002,0xa8004fff,0xffff1007,0xfd0000bf,0x503dffff,0xff7007ff,
0x3e203fff,0x404fffff,0xfffffffb,0x201dffff,0x1fffffff,0xfa800000,
0x002fffff,0x3f2007d8,0x00bdffff,0x7ffffc40,0x03f3004f,0x3ffffffa,
0x8003e43f,0x6ffffffa,0xe80027cc,0x2e07ffff,0xe80fffff,0x5407ffff,
0x02ffffff,0xff107d80,0x001fffff,0xfff50000,0xb0005fff,0x07e4000f,
0x7ffffff9,0x7ffd4000,0xd8002fff,0x009f1007,0xffffff98,0x3ffe2006,
0xe8004fff,0xffff3007,0x3fec007f,0x3fffffe6,0x802fec3f,0x01fffffb,
0x9ffffff1,0xfffff900,0x5fffffff,0xffffff10,0x0000001f,0x5ffffff5,
0x200fb000,0x000312eb,0xffffff88,0x203f3004,0xfffffff8,0x8001f22f,
0x3ffffffe,0x740003fa,0x3207ffff,0xfd07ffff,0xfa80ffff,0x002fffff,
0xfff307d8,0x0003ffff,0xffff5000,0xfb0005ff,0x313e2000,0x0dffffff,
0x7fffd400,0x7d8002ff,0x0005f900,0x5ffffffd,0x3fffe600,0x7ec004ff,
0xffff7005,0x3fec005f,0x7fffffcc,0x00dfb8df,0x3fffff70,0x3ffffe20,
0xfff7004f,0xffffffff,0xffff987f,0x00001fff,0xfffffa80,0x07d8002f,
0x00017f4c,0x3ffffe20,0x03f3004f,0x7fffffcc,0x000f90ff,0x7fffffd4,
0x0002fa8f,0x81fffffa,0xd06ffffe,0xa80fffff,0x02ffffff,0xff307d80,
0x005fffff,0xfff50000,0xb0005fff,0x07ee000f,0x3ffffff6,0xfff50002,
0xb0005fff,0x01ff100f,0xfffff700,0x3fe600df,0x1004ffff,0x36009ffb,
0x000fffff,0x7fcc1ff6,0x4fffffff,0x7fffdc00,0xffff101f,0x6c4009ff,
0xffffffff,0x3fe62fff,0x002fffff,0xfffa8000,0xd8002fff,0x00fff407,
0x3ffe6000,0xf3005fff,0xffffa803,0x00f96fff,0xfffffd80,0x40006fcf,
0x83fffffe,0x02fffff8,0x80fffffd,0x2ffffffa,0x3e07d800,0x03ffffff,
0xffa80000,0x8002ffff,0x0bd0007d,0x3fffffea,0xfff50005,0xb0005fff,
0x03ffd00f,0xfffff100,0xff5007ff,0x401dffff,0x03ffffb8,0x0dffffd0,
0x2607fd80,0xfffffffe,0x7ffdc001,0xfff101ff,0x30009fff,0xfffffffb,
0xffff8dff,0x00003fff,0xfffffa80,0x07d8002f,0x26fbffe6,0x80019999,
0x5ffffff9,0x9003f300,0xbfffffff,0xf98000f9,0x1fffffff,0x7fff4000,
0x3f623fff,0x3fe05fff,0x7d407fff,0x002fffff,0x3ffe06e8,0x0004ffff,
0xffffa800,0x6e8002ff,0x202fa800,0x1ffffffe,0xffffa800,0x6e8002ff,
0x37fffaa0,0x7ffdc000,0x202fffff,0xffffffe8,0xedcccdef,0x02ffffff,
0x09fffff0,0xc807fd80,0x0effffff,0x3fffee00,0xffff101f,0x4c0009ff,
0xfffffffe,0x3ffffe3f,0x000004ff,0xffffffa8,0x206e8002,0xfffffffc,
0x3dffffff,0x7ffff440,0xf9803fff,0xffffb001,0x000fffff,0xffffffb0,
0xffd0000b,0xf9ff7fff,0x201dffff,0xbffffffb,0xfffff500,0x0dd0005f,
0x7fffffec,0xa8000006,0x02ffffff,0xe8006e80,0x7fffdc06,0xfa8004ff,
0x002fffff,0xfff906e8,0x407dffff,0xffffffea,0x10ffffff,0xfffffffd,
0xffffffff,0xffffffff,0xffff1003,0x7fd8005f,0xffffd300,0x7fdc00bf,
0xff101fff,0x3609ffff,0xfffd5000,0x7fec9fff,0x0006ffff,0xffffa800,
0x6e8002ff,0x3ffffee0,0xffffffff,0x3ba20eff,0xffffffff,0xf303efff,
0x3ffa2003,0x007fffff,0xfffff880,0xfe80004f,0xfff57fff,0xf1017dff,
0xffffffff,0xffff303f,0xdf0005ff,0x7ffffcc0,0x8000007f,0x2ffffff9,
0x4006f800,0xcccccef9,0xfffffdcc,0x7cc000ff,0x002fffff,0x000006f8,
0x00027dc0,0x005fb800,0x1fffff10,0x007fd800,0x17ffffe4,0xfffffb80,
0xfffff101,0x000f609f,0x4dfffffb,0x7ffffff9,0xf9800000,0x002fffff,
0x3fe206f8,0xffffffff,0x06ffffff,0x98003fc8,0x3fe6001f,0x007fffff,
0xfffff880,0xfe80004f,0x5dcc7fff,0x0bfa2000,0x7ffffcc0,0x05f8003f,
0x7ffffff4,0x4c000000,0x03ffffff,0x6c005f80,0xffffffff,0xffffffff,
0x7fcc003f,0x8003ffff,0x0000005f,0x0000dfb1,0x001ff600,0x06ffff98,
0x1107fd80,0x13fffea0,0x7ffffdc0,0xfffff101,0x0017609f,0x8dffffd1,
0x0ffffffe,0x7cc00000,0x003fffff,0x7f4c05f8,0xffffffff,0x00ffffff,
0x2000bfb1,0x7d4001f9,0x007fffff,0xfffff880,0xfe80004f,0x80007fff,
0x22004fe9,0x03ffffff,0x2e01fcc0,0x04ffffff,0x3e200800,0x003fffff,
0xf1001fcc,0x3ffe2007,0x44007fff,0x03ffffff,0x0001fcc0,0x03ffb800,
0xffa80000,0x3fe20004,0xfd8003ff,0x705ffc87,0x2a00dfff,0x101fffff,
0x09ffffff,0xf30003f6,0xffb89fff,0x0004ffff,0x3ffe2008,0x4c003fff,
0xfffb803f,0xffffeeee,0xf902ffff,0x3e60007f,0xfffc8001,0x880007ff,
0x04ffffff,0xffffe800,0xffe80007,0x7fff4001,0x7e4005ff,0xffffd802,
0x2c40007f,0x3fffffa0,0x017e4005,0x6c001f90,0x02ffffff,0x7fffff40,
0x017e4005,0xffe80000,0xd8000005,0x220006ff,0x8000ffff,0x7ffc47fd,
0x6fff881f,0x7ffcc570,0xfff100ff,0x3f609fff,0xffff8005,0xfffffd82,
0x02c40007,0x17fffffa,0x5405f900,0xe9801ffe,0xffd01fff,0x07e60009,
0x7fffec00,0xff880007,0x0004ffff,0x07ffffe8,0x17ffc400,0x3fffee00,
0x1be6006f,0x7ffffc40,0xdf10004f,0xfffffb80,0x01be6006,0x4c004f88,
0x06ffffff,0x7ffffdc0,0x01be6006,0x7fc40000,0x8000007f,0x1000ffff,
0x01fffc41,0x7d47fd80,0xffd01fff,0x265ffb07,0x2207ffff,0x04ffffff,
0xf8005ffb,0xff880fff,0x0004ffff,0xffb80df1,0x26006fff,0x3ffe206f,
0x837fc002,0x0006fff8,0x220003f3,0x0007fffe,0xffffff88,0xffe80004,
0x540007ff,0x44005fff,0x05ffffff,0x2002ff88,0x3ffffff9,0x00f7d400,
0x3fffffe2,0x02ff8805,0x2000bf20,0x2ffffffe,0x3fffe200,0xff8805ff,
0x20000002,0x0004ffff,0x6ffff400,0x8a7fd400,0x360005ff,0x3fffc47f,
0x441fff88,0xfff14fff,0x7ffcc07f,0xffb04fff,0x3fe6003f,0x3ffe602f,
0x54003fff,0x7fc401ef,0x8805ffff,0x3fe602ff,0x3fe2002f,0x13fffe04,
0x000fea00,0x007fff88,0xfffff880,0xfe80005f,0x40007fff,0x002ffff9,
0x7fffffcc,0x3fea880c,0xfffd8800,0x26200cff,0x3e6005fd,0x80cfffff,
0x2003fea8,0xb8000ff8,0x06ffffff,0x7ffffcc0,0xfea880cf,0x40000003,
0x00dffffc,0xfff70000,0x7ff401df,0x0001df57,0x7fe43fec,0x04ffc80f,
0x3fe29ffb,0x7ffcc06f,0xffb04fff,0xffd007ff,0xfffb1009,0x4c4019ff,
0x3e6005fd,0x80cfffff,0xe803fea8,0xe8800fff,0x7ffe405f,0x3f6000df,
0x7fd40005,0xff880007,0x0005ffff,0x07fffff8,0xffffe800,0x7ff54004,
0xebceffff,0x40003fff,0xdffffffb,0xfffecaac,0xffea8002,0xebceffff,
0x74003fff,0xf88001ff,0x03ffffff,0x7ffff540,0xffebceff,0x0000003f,
0xdfffffd0,0xd800003b,0x1dffffff,0x7f4f7fe4,0x3fec0001,0xcabeffd8,
0x3e603fff,0x1fffc9ef,0x7ffffd40,0xffffb05f,0xfe9815df,0x7fdc003f,
0xaacdffff,0x002fffec,0xfffffea8,0xfffebcef,0xfffb1003,0xb755355b,
0xfd1005ff,0x03bdffff,0x00e7ffdc,0x000ff700,0xffffff30,0xffa8000d,
0x0002ffff,0x7fffffc4,0xff9000ce,0xffffffff,0x22000019,0xffffffda,
0x000dffff,0x7ffffe40,0x00cfffff,0x37fffaa0,0x7ffdc000,0x002fffff,
0xffffffc8,0x000cffff,0x32200000,0x01efffff,0xfffc8000,0x7e441eff,
0x80000cff,0x3f6607fd,0x801bdfff,0x0cffffea,0x7ffff440,0x8ed82fff,
0xeefffca8,0x0000dfff,0xfffffb51,0x01bfffff,0xffffc800,0x0cffffff,
0xfeec8800,0x0abcefff,0x3fff2200,0x7f541eff,0x3effffff,0x000fb000,
0xfffffe88,0xe88003ff,0xffffffff,0x3660004e,0x00cfffff,0x5e6654c0,
0x0000009a,0x2f32ea62,0x9800001a,0x09abccca,0x7fffe400,0x2a03efff,
0xfffffffe,0x000fffff,0xabccca98,0x00000009,0x06b2a200,0x75100000,
0x00010035,0x20019880,0x40040000,0xffffffe8,0x2effffff,0x332ea017,
0x2000009b,0xabccba98,0xa9800001,0x009abccc,0x00008000,0x006b2a20,
0x04800000,0xfffeeb80,0xffffffff,0x333000ee,0x13333333,0x59530000,
0x00000001,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x664c0000,0x00002ccc,
0x99999980,0x33333199,0x33333333,0x33331013,0x40033333,0x04b800dc,
0x99930000,0x006665c5,0x00000000,0x32600000,0x0002cccc,0x20057000,
0x2200002b,0x003ccccc,0xb882f640,0x0e5c400c,0x00000c00,0x00260018,
0xcccca800,0xa8000001,0x001ccccc,0x66664000,0x0000000c,0xddcaa988,
0x00000abc,0x333332a0,0x3f200001,0x0000efff,0x7fff6dc4,0xffffffff,
0xfffdb5ff,0xdfffffff,0xfffd705b,0x4009dfff,0xfb100efa,0x36000009,
0xfff10fff,0x0000000b,0x2fffffb8,0x7e400000,0x00006fff,0xc803fb00,
0x5400002f,0x000fffff,0x3e61ff60,0xff103fff,0x3aa007ff,0x400003ff,
0x01fb805f,0xffff1000,0x000000df,0x00bffffb,0xfffa8000,0x000004ff,
0x3ffff6a0,0xefffdcce,0x7400000b,0x0004ffff,0x077fff40,0xfffb1000,
0x557fffff,0x2201dff5,0xfffffffe,0xdffb1000,0x3ffa0001,0x007ff4c1,
0x7ffc4000,0x003ffee2,0xfb000000,0x00007fff,0x3ffff200,0xb8000001,
0x32a21bff,0x800000ff,0x003ffffa,0x3f61ff60,0xff906fff,0x3fa00fff,
0x00000fff,0xffa813f6,0xff900000,0x0005ffff,0x7fffc400,0xe8000005,
0x00ffffff,0x3ee20000,0x4c401cff,0x00003feb,0x00bffff1,0xefff9800,
0x3fa20000,0xffffffff,0x2e00ffc1,0x04ffffff,0x0017fc40,0x2a5fff30,
0x00003fff,0xfd8bff50,0x0000002f,0x1ffffc40,0x36000000,0x00004fff,
0xfffff880,0x005fffff,0x3ffee000,0x1ff60006,0x07fffffe,0x07fffffa,
0x9fffff30,0x7fdc0000,0xfffdccef,0xff300006,0x00dfffff,0x7ffdc000,
0xb8000005,0x4fffffff,0xff500000,0x3220005d,0x5c0000df,0x00005fff,
0x000effc8,0x3ffffe20,0x41ffffff,0x7fd400ff,0x8003ffff,0x6c0000fe,
0x6fffdfff,0x3f600000,0x013fe20f,0x2e000000,0x00004fff,0x0dffb000,
0x3ea00000,0xffffffff,0x5c000000,0xb0000fff,0xffff90ff,0x3fffee0d,
0xffff8806,0x7400002f,0xffffffff,0xfb00001f,0x7fff75ff,0x3f600000,
0x8000005f,0xfd8efff8,0x400000ff,0x00003ffc,0x40001fd3,0x00005ffe,
0x0001ffd0,0xffffffc8,0x7c1fffff,0x7ffd400f,0xd8003fff,0x7cc0000f,
0x02ffffff,0x3ff10000,0x00006fa8,0x9ffb0000,0x80000000,0x00001ffd,
0xfffff700,0x000005ff,0x000ffee0,0x7fcc3fec,0xffd102ff,0x3ff2007f,
0x9800006f,0xffffffff,0xff500003,0x03ffd41d,0x77fc4000,0xc8000000,
0x2ffe45ff,0xffe88000,0x6e800001,0x0dff1000,0x3fe60000,0x7fcc0001,
0xffffffff,0x403fc1ff,0x3ffffff9,0x0007d800,0xbfffffb0,0x7d400000,
0x0001fd84,0xff880000,0x00000004,0x00007fb0,0x77fecc00,0x0000000c,
0xd80037e4,0x002ea07f,0x930002e6,0x44000005,0x01effffd,0x037fa000,
0x0000ffe6,0x0001df70,0x07ff3000,0x00007fea,0x0001bfd1,0x0013e600,
0x00003bee,0x0000d4c0,0x7fffffe4,0x41ffffff,0xfff9807f,0xd8003fff,
0xff100007,0x00003fff,0x01a814c0,0x50000000,0x000000bf,0x00154400,
0x00000000,0x02a80000,0x000ffb00,0x00000000,0x0d544000,0x13ee0000,
0x0001fd10,0x000054c0,0x402fd800,0x6c0005f9,0x000000ef,0x26000fdc,
0x0000000a,0xfffb0000,0xffffffff,0x9807f83f,0x03ffffff,0x00007d80,
0x00000000,0x00000000,0x00001880,0x00000000,0x00000000,0x00000000,
0x00001ff6,0x00000000,0x40000000,0x00260008,0x00000000,0x00c40000,
0x003ff700,0x013a0000,0x4ccc0000,0x99999999,0x99880999,0xd1999999,
0xffffffff,0x7f83ffff,0xfffff980,0x07d8003f,0x33333331,0x26200133,
0x09999999,0x26666666,0x09999999,0x99999988,0x00000199,0x00000000,
0x00355530,0x99999980,0x99999999,0x99999880,0x26661999,0x99999999,
0x99880999,0xb1999999,0x555554ff,0x555542aa,0x65402aaa,0x999aceed,
0x00009999,0x799d9531,0x0000dc05,0x4c000000,0x00001aaa,0x0d554c00,
0x3ff98000,0x477b2600,0x980a9998,0x99751007,0xed890159,0xffffffff,
0xec81deff,0x4effffff,0xfffffffd,0xf83fffff,0xffff9807,0x7d8003ff,
0xfffffd30,0x7001ffff,0xfffffffd,0x7ffff6c7,0xdeffffff,0xffffec81,
0x40004eff,0x99999999,0x99999999,0x99999999,0xedb80009,0xffffefff,
0x3b6000be,0xffffffff,0xec81deff,0x4effffff,0x3fffffb6,0x1defffff,
0xfffffec8,0x64ffb4ef,0x47ffffff,0xffffffeb,0xdfffe980,0xfffffffb,
0x366002ff,0xfffffffe,0x3e62dfff,0x99999881,0x00000099,0x77fff6dc,
0x00beffff,0x3fb6e000,0xeffffeff,0x6fd8000b,0x37ffee00,0x03ffffb7,
0xffb805f1,0x1cfffeff,0x3ffa20f1,0x000effff,0xd81fffd1,0xffffffff,
0x3fc1ffff,0x7ffffcc0,0x07d8003f,0x7fffff44,0x362006ff,0x3a201fff,
0x0effffff,0x1fffd100,0x3bb20000,0xffffffff,0xffffffff,0x03ffffff,
0x37fffa60,0xfffb510b,0xfe88005f,0x00efffff,0x01fffd10,0x7fffff44,
0xfd1000ef,0x47fd81ff,0x07fffff8,0x81ffffff,0x743ffffa,0x2fffffff,
0xdffff900,0x7fdcc415,0xa81ffeff,0x2fffffff,0xfd300000,0x2a217bff,
0x002ffffd,0x6ffff4c0,0xfffb510b,0x7fc4005f,0x5ffd8801,0x1ffffef2,
0xffd303e8,0x7fecc419,0x3fee07ff,0x4003ffff,0xffb82ff8,0xffffffff,
0x403fc1ff,0x3ffffff9,0x8807d800,0xfffffffe,0x017fc004,0x7fffffdc,
0x17fc4003,0xffc80000,0xdfffffff,0xffeccccc,0xf9003fff,0xf9809fff,
0x2000dfff,0x3ffffffb,0x017fc400,0x7fffffdc,0x17fc4003,0x7ff43fec,
0xfffb07ff,0x7ffc41ff,0xffffa86f,0x74c00999,0x7002ffff,0x203fffff,
0x2fffffe8,0xffc80000,0x7fcc04ff,0xc8000dff,0x4c04ffff,0x800dffff,
0xfe8806fb,0x3ffea0ff,0x413604ff,0x7d404ffe,0x3fea07ff,0x8003ffff,
0xfff980ff,0xffffffff,0x4c03fc1f,0x03ffffff,0xf3007d80,0x5fffffff,
0x4007ec00,0x3ffffffa,0x000ff800,0xf7ff3000,0x405fffff,0x403fffd8,
0x06ffffe8,0x3fffff30,0x3fffea00,0xff8003ff,0xffffa800,0xff8003ff,
0xfe87fd80,0xff907fff,0x7ff41fff,0xfff884ff,0xfff9005f,0xf98005ff,
0x3f201fff,0x0002ffff,0x3ffffa20,0xffff3006,0x3fa2003f,0xf3006fff,
0xf803ffff,0xfffd803f,0x7ffffcc2,0x3f216e02,0xff9800ff,0x3fffea07,
0x7e8002ff,0x3fffffe0,0x41ffffff,0xfff9807f,0xd8003fff,0xffff3007,
0x003fffff,0x7fd401f2,0x8002ffff,0x2000007e,0xffffaafc,0xffc802ff,
0x7fffec03,0x3ff6000e,0xfa800fff,0x002fffff,0xff5007e8,0x0005ffff,
0x21ff60fd,0x907ffffe,0x7c1fffff,0xff03ffff,0xfb803fff,0x0003ffff,
0x5c03fff3,0x002fffff,0x3ffff600,0x3ff6000e,0xfd800fff,0x2000efff,
0x00fffffd,0xfb801ff5,0xfffb86ff,0x31aa00ff,0x5c00bfff,0x3ffea07f,
0xd8002fff,0x3ffff207,0x1fffffff,0x7fcc03fc,0x8003ffff,0xfbf3007d,
0x1dffffff,0x2a00f900,0x02ffffff,0x00007d80,0x3feabf30,0x9002ffff,
0x7ffdc07f,0x7cc003ff,0xa805ffff,0x02ffffff,0xf5007d80,0x005fffff,
0x1ff60fb0,0x41fffffa,0x30fffffc,0x207fffff,0x202fffff,0x06fffff8,
0x00ffd400,0x05fffff7,0x3ffee000,0x7cc003ff,0x5c05ffff,0x003fffff,
0x2fffffcc,0x7cc05fb8,0xffc83fff,0x22d405ff,0x4007fffa,0x3ffea07d,
0xd8002fff,0x7ffff407,0x41ffffff,0xfff9807f,0xd8003fff,0xfb3f3007,
0x0bffffff,0x3ea00f90,0x002fffff,0x000007d8,0x3ffea1fb,0xf1002fff,
0x3fffe207,0xfe8001ff,0x5402ffff,0x02ffffff,0xf5007d80,0x005fffff,
0x1ff60fb0,0x41fffffa,0x30fffffc,0x207fffff,0x203fffff,0x03fffffd,
0x201fd800,0x02fffffb,0xffff8800,0xfe8001ff,0xf102ffff,0x003fffff,
0x5fffffd0,0xfd809f90,0xffd80fff,0x225c03ff,0x003ffffc,0x7fd403ea,
0x8002ffff,0x7ff4407d,0x1fffffff,0x7fcc03fc,0x8003ffff,0x23f3007d,
0xfffffffe,0xa803e404,0x02ffffff,0x00007d80,0x3fea3fa8,0x0702ffff,
0x3fffa07b,0xf90007ff,0x401fffff,0x2ffffffa,0x5007d800,0x05ffffff,
0x3f60fb00,0x7ffffe87,0x1fffff90,0x81fffffc,0x701fffff,0x01ffffff,
0x403f3000,0x02fffffb,0xffffe800,0xff90007f,0xfd01ffff,0x000fffff,
0x3ffffff2,0xf301fec0,0x3fe0bfff,0x1e401fff,0x0bfffff6,0xfa807c40,
0x002fffff,0xff7007d8,0x83ffffff,0xfff9807f,0xd8003fff,0x223f3007,
0xffffffff,0x5401f202,0x02ffffff,0x00007d80,0x3fea37c4,0x6882ffff,
0xfffa83b8,0x70004fff,0x07ffffff,0x7fffffd4,0x007d8002,0x5ffffff5,
0x360fb000,0xffffe87f,0xfffff907,0x27fffe41,0x837fffc4,0x7ffffff8,
0x807a0000,0x02fffffb,0x7fffd400,0xf70004ff,0xa87fffff,0x04ffffff,
0xfffff700,0x202fe87f,0xa82ffffc,0xe807ffff,0x7ffffdc1,0x203800cf,
0x2ffffffa,0x4007d800,0x1ffffeca,0x7fcc03fc,0x8003ffff,0x43f3007e,
0xfffffff9,0x200f901f,0x2ffffffa,0x0007d800,0x3ea0fe40,0xa82fffff,
0xfff70106,0x20007fff,0x5ffffff9,0x3ffffea0,0x07d8002f,0xffffff50,
0x20fb0005,0xfffe87fd,0xffff907f,0x7fffcc1f,0x4ffff985,0xffffff50,
0x0040000d,0x8bffffee,0x400beec9,0x3ffffffb,0xffff3000,0xfffb8bff,
0x30003fff,0x8bffffff,0xfff101ff,0xfffd01ff,0x9879809f,0xffffffff,
0x3fea0003,0x8002ffff,0xfe80007d,0x7c403fc1,0x003fffff,0x3f3006e8,
0xffffffb8,0x007c80ef,0x5ffffff5,0x000fb000,0x7d427cc0,0xc82fffff,
0x3fff6006,0x10002fff,0x0dffffff,0x7fffffd4,0x007d8002,0x5ffffff5,
0x360fb000,0xffffe87f,0xfffff907,0x0ffffb81,0x9027ffe4,0x0bffffff,
0x7dc00000,0xff92ffff,0x6c05ffff,0x02ffffff,0xfffff100,0xffffd8df,
0xf10002ff,0xf8dfffff,0xffff500f,0xfffff30d,0xff04c805,0xffffffff,
0xfff50007,0xb0005fff,0x3fd0000f,0xfff007f8,0xf0007fff,0x207e600b,
0xfffffffc,0xf5007c85,0x005fffff,0x40000fb0,0xffff506e,0x06f885ff,
0x3fffffa0,0xff10002f,0x540fffff,0x02ffffff,0xf5007d80,0x005fffff,
0x1ff60fb0,0x41fffffa,0x80fffffc,0xd9bfffea,0x7ec02fff,0x003fffff,
0x3fee0000,0xfffdbfff,0xd00fffff,0x05ffffff,0x3fffe200,0x7fff47ff,
0x10002fff,0x8fffffff,0xfff701ff,0xffffb0bf,0x80fc401f,0xfffffffa,
0x2002efff,0x2ffffffa,0x0007d800,0x03fc1fe8,0x4fffffe8,0x8027c400,
0xfffd01f9,0x7c87ffff,0xfffff500,0x0fb0005f,0x40bee000,0x2ffffffa,
0xf88037e4,0x01ffffff,0xfffff100,0x3fea03ff,0x8002ffff,0xfff5007d,
0xb0005fff,0x3a1ff60f,0xf907ffff,0x6401ffff,0x0bdfffff,0xffffff80,
0x0000002f,0x3fffffee,0xfffff31e,0xfffff10b,0x220003ff,0x1fffffff,
0xfffffff1,0x3fe20003,0x3a1fffff,0xffff902f,0xfffffb87,0x2e02e405,
0xffffffff,0xa801dfff,0x02ffffff,0x80007d80,0x803fc1fe,0x05fffffd,
0x98017dc0,0xffff101f,0x3e45ffff,0xfffffa80,0x07d8002f,0x205f8800,
0xaffffffa,0x006ffea8,0xfffffff3,0x7ffc0003,0xf502ffff,0x005fffff,
0x3ea00fb0,0x002fffff,0x0ffb07d8,0x20fffffd,0x00fffffc,0x000625d7,
0xfffffff1,0x40000003,0x0ffffffb,0x43ffffe4,0xfffffff9,0x3ffe0001,
0xff32ffff,0x003fffff,0x7fffffc0,0x6c13f62f,0x3e63ffff,0x203ffffc,
0xffc800f9,0xffffffff,0x7fd402ff,0x8002ffff,0xfe80007d,0xfb803fc1,
0x000fffff,0x7cc00ff3,0x3fffe601,0x0f90ffff,0x3ffffea0,0x07d8002f,
0x200fd800,0xfffffffa,0x006fffff,0xfffffff3,0x7ffc0001,0xf502ffff,
0x005fffff,0x3ea00fb0,0x002fffff,0x0ffb07d8,0x20fffffd,0x40fffffc,
0x40002fe9,0xfffffff9,0x20000001,0x82fffffb,0x40fffffc,0xfffffff9,
0x3ffe0000,0xff32ffff,0x001fffff,0x7fffffc0,0x7417f22f,0x5f35ffff,
0x205ffff9,0x3ee002f9,0xffffffff,0x3ea03fff,0x002fffff,0xe80007d8,
0xb003fc1f,0x00bfffff,0x4c007fd1,0x7ffd401f,0x0f96ffff,0x3ffffea0,
0x07d8002f,0x6677d400,0xffdccccc,0xfdbcffff,0xff1006ff,0x003fffff,
0x7fffffc0,0xffff501f,0xfb0005ff,0x3fffea00,0x7d8002ff,0xffd0ffb0,
0x3ff20fff,0x7ff40fff,0x7fc40001,0x002fffff,0x3fee0000,0xffb82fff,
0x7fc41fff,0x001fffff,0x3fffffe0,0xfffff11f,0x7c0003ff,0x21ffffff,
0xfffb06f9,0x3f6bffff,0x3f980fff,0x3f6200a8,0xffffffff,0xfff502ff,
0xb0005fff,0x3fd0000f,0x3e2007f8,0x01cfffff,0x98009fd3,0xfffc801f,
0x07cdffff,0xffffff50,0x00fb0005,0x7ffffc40,0xffffffff,0x3e62ffff,
0x3ffe006f,0x0002ffff,0xfffffff1,0x3fffea01,0x7d8002ff,0xfffff500,
0x0fb0005f,0x3ffa1ff6,0xffc80fff,0x3fe60fff,0x99999bef,0xfffff001,
0xdd1007ff,0xdddddddd,0xffb87ddd,0xffb82fff,0xfff81fff,0x0002ffff,
0xfffffff1,0x7fffffc1,0xff10002f,0xf81fffff,0xffffc80f,0xfff50eff,
0x982fc83f,0xffd9800f,0x6fffffff,0xffffff50,0x00dd0005,0x7f83fd00,
0x7fff4c00,0xecbcefff,0xf98003ff,0xffffb001,0x200fffff,0x2ffffffa,
0x0006e800,0x3ea007f2,0x4c2fffff,0x3ff6006f,0x0003ffff,0xfffffff1,
0x7ffffd40,0x06e8002f,0xffffff50,0x20dd0005,0x7ffd47fd,0xffc84fff,
0x3ff20fff,0xffffffff,0xff03dfff,0x009fffff,0x7ffffe44,0xfb81bfff,
0xfb82ffff,0xfd81ffff,0x003fffff,0xffffff10,0xfffffd8f,0xff10003f,
0xf90fffff,0xfffff105,0x9ffffd0b,0x0f603bfb,0xffffd300,0xf507ffff,
0x005fffff,0xd0000dd0,0x0007f83f,0xffffffd5,0x0001bfff,0x744007e6,
0x7fffffff,0xfffff500,0x0dd0005f,0x4013e600,0x2ffffffa,0x3f2006d8,
0x004fffff,0xffffff30,0x7fffd40b,0x6e8002ff,0xfffff500,0x0dd0005f,
0x7ffc5ff6,0x1fffffff,0x83fffff2,0xfffffffb,0xffffffff,0x7fffe40e,
0xfd8005ff,0x203fffff,0x82fffffb,0x81fffffb,0x4ffffffc,0xffff3000,
0xfffc8bff,0x30004fff,0x0bffffff,0xf7101ff1,0x3fb2207b,0x1aa00bde,
0x3faa001b,0x984fffff,0x02ffffff,0x80006f80,0x003fc1fe,0x3ff2a660,
0xf980001d,0x3ffe6001,0x3007ffff,0x05ffffff,0x2000df00,0x3fea006e,
0x6b82ffff,0x3fffe600,0xf70004ff,0x405fffff,0x2ffffff9,0x3006f800,
0x05ffffff,0x3f60df00,0x7fe40007,0x3fe20fff,0xffffffff,0x46ffffff,
0x6ffffff9,0xffffc800,0x3fee02ff,0xffb82fff,0xff981fff,0x0004ffff,
0x5ffffff7,0xffffff98,0xfff70004,0x3f205fff,0x80000005,0x2001ec2e,
0x86fffffd,0x3ffffff9,0x0005f800,0x03fc1fe8,0x03ff9000,0x007e6000,
0xffffff50,0x3ffe600f,0xf8003fff,0x01fb8005,0x3ffffea0,0x2a06982f,
0x7ffffec2,0xfffb0006,0xff980dff,0x8003ffff,0xfff3005f,0xf0007fff,
0x001ff60b,0x1fffff90,0xfffffe98,0xffffffff,0x7fff40ff,0xfb8007ff,
0x201fffff,0x82fffffb,0x01fffffb,0x0dfffffb,0x3ffff600,0xffffb06f,
0x3f6000df,0x2206ffff,0x000002fe,0x01761720,0xdffffd10,0xffffff10,
0x03f98007,0x7c1fe800,0xff500007,0x7cc0000d,0xfffc8001,0xff1007ff,
0x8007ffff,0x7c4003f9,0x7ffd4005,0x40d02fff,0x7fffc42e,0xfe8001ff,
0x4402ffff,0x03ffffff,0x8801fcc0,0x03ffffff,0xfd81fcc0,0x7fdc0007,
0xfff707ff,0xffffdddd,0xf985ffff,0x001fffff,0x7fffffdc,0x3fffee01,
0xffffb82f,0xffff101f,0xfd0003ff,0x2205ffff,0x01ffffff,0xfffffe80,
0x007fcc02,0x07640000,0x260007ec,0xfd04ffff,0x800bffff,0xe80002fc,
0x0003fc1f,0x0006ffd8,0x40007e60,0x007ffffd,0x17fffffa,0x8005f900,
0x7d4000fd,0x002fffff,0x7fe40fd4,0x54005fff,0x005fffff,0x0bfffffd,
0x2002fc80,0x05fffffe,0xfd817e40,0xb8ae2007,0x7547ffff,0xfe9801ff,
0xfffb81ff,0x7dc005ff,0x201fffff,0x82fffffb,0x01fffffb,0x17fffff2,
0xfffff500,0xffffc80b,0x7fd4005f,0xf5005fff,0x4000001b,0x0bfb00dd,
0x05ffff00,0x1bffffee,0x0006f980,0x07f83fd0,0x3fffd000,0x07e60000,
0x7fff4400,0x3ffee007,0x3e6006ff,0x01fd4006,0x7ffffd40,0x83ec002f,
0x0fffffe8,0x3ffffa00,0xfff7000f,0x7cc00dff,0x7ffdc006,0x3e6006ff,
0x801ff606,0xfff51ffe,0x17ffc4df,0xc81bfe00,0x001fffff,0x3fffffee,
0x3fffee01,0xffffb82f,0x3ffa201f,0x3a000fff,0x400fffff,0x0fffffe8,
0x3ffffa00,0x3fea000f,0x6c400002,0x017fec05,0x403fffe0,0x5ffffff8,
0x002ff880,0x7f83fd00,0xfffb0000,0x3ea0000d,0x3fe20003,0x3fe2007f,
0x8805ffff,0x3e2002ff,0xfff50006,0x5c005fff,0x3ffa206f,0xff5004ff,
0x44003fff,0x05ffffff,0x4002ff88,0x5ffffff8,0x202ff880,0xff3007fd,
0x3fffe67f,0x00bffe62,0x7404ff88,0x000effff,0x3ffffff7,0x7ffffdc0,
0xfffffb82,0x7fff4401,0xfff5004f,0x3a2003ff,0x5004ffff,0x003fffff,
0x001bfd30,0x805fb880,0x3001fffd,0xf9805fff,0x80cfffff,0x0003fea8,
0x0ff07fa0,0x3ffea000,0x6c0001ef,0x7d40005f,0x7fcc007f,0x880cffff,
0x6c003fea,0xff50003f,0x2007ffff,0x74405ffd,0x5404ffff,0x001effff,
0xffffff98,0x3fea880c,0xffff3000,0xd51019ff,0x07fd807f,0x7d4fffa0,
0xfffe85ff,0x05fe8800,0x3dffff70,0xfffff700,0x7ffdc03f,0xfffb82ff,
0xfe8802ff,0x7d404fff,0x4001efff,0x04ffffe8,0x0f7fffd4,0x5ff91000,
0x3bf91000,0x3ffff600,0x04ffe803,0xfffffd50,0xfffd79df,0xfe800007,
0x00003fc1,0xbdfffff9,0xfffb8005,0x3ee0001c,0xffea8007,0xebceffff,
0x5c003fff,0xf70003ff,0x40bfffff,0x04fffea8,0x5bffff70,0x3fff6e21,
0x7540004f,0xceffffff,0x003fffeb,0x7ffff540,0xffebceff,0x07fd803f,
0x367bfee0,0xfd880fff,0xaa9aadff,0x4002ffdb,0x9dffffd8,0x7fff5c40,
0x3f200bef,0xfc83ffff,0x2002ffff,0x0adffffb,0x9ffffb71,0xfffb8000,
0xfb710adf,0x00009fff,0x5e77fe44,0xfb97530a,0xffd8003b,0x4c0aefff,
0xc8003ffe,0xffffffff,0x00000cff,0x03fc1fe8,0x3ffee000,0xea802eff,
0xefffffff,0x00fb0003,0x7ffffe40,0x00cfffff,0x3bfff220,0x7ffcc001,
0xcdefffff,0xfffffecc,0x3ae2003f,0xffffffff,0x00001cef,0x3ffffff2,
0x000cffff,0x3ffff200,0x0cffffff,0x800ffb00,0x0cffffeb,0x7ff76440,
0x00abceff,0x3fff6600,0xffffffff,0xe9800bdf,0x20efffff,0xdffffff9,
0x3fae2000,0xffffffff,0x100001ce,0xffffffd7,0x0039dfff,0x7f64c000,
0xacdeffff,0x11db0001,0xfddfff95,0x80001bff,0x9abccca9,0x22000000,
0x00001981,0x001bba88,0x24000000,0x6654c000,0x40009abc,0xfffffffa,
0xffdd503f,0xffffffff,0xffffffff,0x0005ffff,0x2f332aa2,0x4000001a,
0x9abccca9,0x26000000,0x09abccca,0x000cc400,0x02000010,0x75300000,
0x03357999,0xfffffb80,0xffa9ffff,0x1fffffff,0xccaa8800,0x00001abc,
0x66655440,0x000001ab,0x00002200,0x32ea0170,0x000009bc,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00333332,0x00750000,0x000000ee,
0x32219997,0x260003cc,0x02c9803e,0x0004dec4,0x10000180,0x06e01797,
0x33220000,0x000003cc,0x99999700,0x4d800001,0x0003c880,0x3200a200,
0x004b800d,0x004ca880,0x4ccccc80,0x00c00000,0xc8000031,0x001c8801,
0x02eda800,0x00130000,0x32e00022,0x0000cccc,0xffffa800,0x4000004f,
0x27d402fb,0xff100000,0x17ffdcbf,0x813fa000,0xfb800ffa,0x20000dff,
0x4c0000f9,0x22dfffff,0x800002f9,0x01fffffd,0x7c400000,0x0002ffff,
0x300dfb80,0x000005fd,0xf5003f91,0x13f6203d,0xeffd9800,0x7fcc0002,
0x00001fff,0xc83fff70,0x00000eff,0x1fd801fd,0x7fcc0000,0x800003ff,
0x02fa806e,0xffffe880,0xe8000003,0x00ffffff,0x3fe60000,0x3fee621b,
0x2e000002,0x3ffa0fff,0xff980004,0x004ffc85,0x00077fdc,0x20000fe8,
0xfffffff8,0x000ffeff,0x7fffcc00,0x000006ff,0x1ffffdc0,0xff880000,
0x037fd40e,0x0ffdc000,0x983ffb00,0x50000ffe,0x00005fff,0x00bfffee,
0xffff8000,0x13fffe66,0x577e4000,0x01ff2a21,0x3fff6000,0xc800006f,
0x03fe605f,0x7fff4400,0x5c000006,0x4fffffff,0x7f400000,0xffffffff,
0x2000000e,0x3fe21ffe,0x3f600006,0x1fffb0ef,0x3fffb000,0x00ffc800,
0x3fffee00,0x6fffffff,0xffe80000,0x002fffff,0x3ff60000,0x4000003f,
0xff71fffb,0xc800003f,0x7cc000ef,0x7fff52ff,0x3ffe6000,0x3fa00003,
0x000002ff,0x43ffffe6,0x006ffffb,0xfffff300,0x009fffff,0xffffb000,
0xf500000f,0xffb99dff,0xf88000df,0x00000fff,0xb1dfff10,0x00001fff,
0x7ffffcc0,0x0001ffff,0x713fe200,0x400003ff,0xffeefff9,0xff50002f,
0x7fd400bf,0x3b60000f,0xfffffdaa,0x400001ff,0xfe8cfffa,0x0000006f,
0x0007fff1,0x3fffa000,0x0005fffd,0x000ffdc0,0xffdfffd8,0x3fa0006f,
0x300000ff,0x00005fff,0x4bfffd00,0x003ffff8,0x3ffff200,0x000effff,
0xffffa800,0xfb000004,0xffffffff,0xff300003,0x2000007f,0x7fe45ffc,
0x54000005,0x3fffffff,0x7dc00000,0x0003fe86,0xfffffd80,0x3e20006f,
0xff3007ff,0x740001ff,0x77fedc43,0xfe800001,0x0bff623f,0x3ea00000,
0x0000004f,0x3fffffea,0x2e00000f,0x260005ff,0x2fffffff,0xffff3000,
0x7fdc0000,0x30000003,0xfea819fb,0x6400000c,0x1effffff,0x3ae00000,
0x000000bf,0xffffffd1,0x4c00009f,0x800006ff,0xff703ff9,0x88000003,
0x001dffed,0x41fe8000,0x000006f8,0x3ffffff1,0x7ffcc000,0x7ffd402f,
0x020000ff,0xb8000000,0x0dfb01ff,0x9fb00000,0xd0000000,0x009fffff,
0x0fffd400,0x3fff6000,0x2e0005ff,0x0000ffff,0x00007fd0,0x00000000,
0xeffda800,0x00000004,0x64400000,0x002fffff,0x00ff9800,0x017ec000,
0x000017ea,0x00000000,0x00a881a8,0x3ff20000,0x5c0005ff,0x2e02ffff,
0xabffffff,0x000001aa,0xef880000,0x001fe400,0x000aa000,0x7fd40000,
0x00000fff,0x000dfff1,0x3fffff10,0x7ffdc000,0x5500001f,0x00000000,
0x00000000,0x00000000,0xa8800000,0x4000001a,0x400000a9,0x00310009,
0x00000000,0x00000000,0x00000000,0x807fffe4,0xfffffffc,0x2665ffff,
0x99999999,0x98809999,0x19999999,0x01100000,0x00000000,0x00000000,
0x17ffdc00,0x00000000,0x02ffffa8,0x00000000,0x26666666,0x09999999,
0x99999988,0x00000199,0x95300000,0x1b803799,0x00000000,0x00000000,
0x00000000,0x001aaa98,0x554c0000,0x2620001a,0x99999999,0x99999999,
0x09999999,0x20ffffb0,0xffffecc8,0x362ccccf,0xfffffffe,0xc81defff,
0xeffffffe,0x00380004,0x01c00000,0x99999800,0x09999999,0x3fe00000,
0x4ccc00ff,0x99999999,0x99999999,0x22009999,0x3303ffff,0x33333333,
0x00000133,0xffffffdb,0x03bdffff,0xffffffd9,0x4ccccc9d,0x99999999,
0x99999999,0xc8800099,0xffffffff,0x0be22cef,0x0000e000,0x4ccccccc,
0x09999999,0x33333330,0x13333333,0x26666662,0x19999999,0x7ff6dc00,
0xbeffffef,0x36e00000,0xfffefffe,0xf7000bef,0xffffffff,0xffffffff,
0xbfffffff,0x01bfffa0,0x03fffff2,0x3ffffa20,0xd1000eff,0x00001fff,
0x000003e6,0x0007cc00,0x3fffba20,0xffffffff,0x1bdeffff,0xffff7000,
0xfffec880,0xffffffff,0xffffffff,0x7ffc02ff,0xffee884f,0xffffffff,
0xbdefffff,0x3fa20001,0x00efffff,0x81fffd10,0xfffffec8,0xffffffff,
0xffffffff,0x3ff62002,0x999adfff,0xffefffdb,0x07cc0002,0x3fb22000,
0xffffffff,0xfd902def,0xffffffff,0x3b665bff,0xffffffff,0x9800ceff,
0x10bdfffe,0x05ffffb5,0xfffe9800,0xffb510bd,0xff7005ff,0xfb999dff,
0x99dfffff,0x0bffffd9,0x2017fffe,0x00fffffc,0xffffff70,0x2ff88007,
0x13f60000,0x6c000000,0x2200004f,0xcffffffe,0xfffeccaa,0x74001eff,
0x22005fff,0xeffffffe,0xfecccccc,0x7402ffff,0x74405fff,0xacffffff,
0xffffecca,0xf70001ef,0x007fffff,0x4402ff88,0xeffffffe,0xfecccccc,
0x3002ffff,0x03bfffff,0x2ffffe98,0x027ec000,0xfffd1000,0x4005ffff,
0xffffffe8,0x7ffcc02f,0x000effff,0x013ffff2,0x01bffff3,0x9ffff900,
0xdffff980,0x07bfee00,0x3fffffe6,0x05ffe883,0x9007ffff,0x001fffff,
0x3fffffea,0x00ff8003,0x1fff1000,0x88000000,0x00000fff,0x3fffffee,
0xfffff701,0x3fea005f,0x7d4004ff,0x404fffff,0x402fffea,0xb805fffd,
0x01ffffff,0x5ffffff7,0xffff5000,0xff0007ff,0xffff5001,0xfea809ff,
0xffb802ff,0x64005fff,0x20002fff,0x0000fff8,0x3ffffea0,0xff98005f,
0x9005ffff,0x07ffffff,0x3ffffa20,0xffff3006,0x3fa2003f,0xf3006fff,
0x2e03ffff,0xfff300ff,0x7ec07fff,0x05fffb05,0x1fffff90,0x3fffea00,
0x7e8002ff,0x3ff20000,0x0000003f,0x001fffe4,0xfffff500,0x7ffd403f,
0xfc801fff,0x4c003fff,0x04ffffff,0xc805ff90,0xfa803fff,0x201fffff,
0x1ffffffa,0x7fffd400,0x7e8002ff,0xfffff300,0x3ff2009f,0x7fffd402,
0xffb0005f,0x7fe40005,0x2600003f,0x04ffffff,0xfffff980,0xfff7004f,
0x36005fff,0x000effff,0x03fffff6,0x3bffff60,0x3fff6000,0x02fb80ff,
0x3fffffe6,0x5c17e203,0xfc803fff,0x5000ffff,0x05ffffff,0x0000fb00,
0x01bfffe2,0xff880000,0x200006ff,0x1ffffffa,0x7ffffec0,0xffffd806,
0x7ffcc003,0x36004fff,0x7ffec02f,0xffffa800,0x7fec01ff,0x54006fff,
0x02ffffff,0xf3007d80,0x009fffff,0xff3017ec,0x0001ffff,0x880017f4,
0x0006ffff,0x3ffffe60,0xff88004f,0x7004ffff,0x03ffffff,0x7fffff70,
0xffff9800,0x7ffdc05f,0x7cc003ff,0x6b85ffff,0x7ffffcc0,0xb02e403f,
0xff900dff,0x2a001fff,0x02ffffff,0x00007d80,0x05fffff7,0x3ee00000,
0x0002ffff,0xffffff50,0xffffb803,0x7ff401ff,0x7c4002ff,0x004fffff,
0xff880be6,0xfff5003f,0xfb803fff,0x001fffff,0x3fffffea,0x007d8002,
0x9ffffff1,0x8817cc00,0x03fffffe,0x0017dc00,0x2fffffb8,0xfff10000,
0x10009fff,0x09ffffff,0x3ffffee0,0x7ffc401f,0xe8001fff,0x102fffff,
0x03ffffff,0xfffffd00,0x7cc04b85,0x403fffff,0x0ffec059,0x3fffff20,
0xffff5000,0xfb0005ff,0x3ffa0000,0x00006fff,0xfffffd00,0x3ea0000d,
0x401fffff,0x3ffffffa,0x17ffffc0,0x3fffe200,0xd03504ff,0x027fdc05,
0xffffff50,0xffffa803,0x3ea003ff,0x002fffff,0xff1007d8,0x2a09ffff,
0xff702e81,0x0001ffff,0xd0002f88,0x00dfffff,0x3fffe200,0xf88004ff,
0x004fffff,0x3ffffff7,0xfffffe80,0xfff90007,0xffd01fff,0x2000ffff,
0x0ffffffc,0xfff30066,0x07007fff,0x00cffc88,0x01fffff9,0x3ffffea0,
0x07d8002f,0xffffa800,0x00001fff,0x7ffffd40,0xa80001ff,0x01ffffff,
0x7fffffcc,0x3fffe204,0x7fc4002f,0x5b04ffff,0xffb30590,0xfffa8007,
0x7cc01fff,0x004fffff,0x3fffffea,0x007d8002,0x9ffffff1,0x40b20b60,
0x06fffffe,0x00059000,0xfffffff5,0xff100003,0x0009ffff,0x9ffffff1,
0x3fffee00,0x3fea01ff,0x0004ffff,0x7ffffff7,0xffffffa8,0xfff70004,
0x98007fff,0x03ffffff,0x3fae2000,0xfffffc81,0xffff5000,0xfb0005ff,
0xfffd0000,0x000bffff,0xffffe800,0x80005fff,0x1ffffffa,0x7ffffd40,
0x3ffe603f,0x7c4001ff,0xd04fffff,0xdfb81105,0xfff50002,0xfa803fff,
0x003fffff,0x3fffffea,0x007d8002,0x9ffffff1,0x20220ba0,0x4ffffffa,
0x40000000,0xfffffffe,0xff880005,0x8004ffff,0x4ffffff8,0xfffff700,
0x7ffdc03f,0x30003fff,0x8bffffff,0x3ffffffb,0xffff3000,0xf9800bff,
0x003fffff,0x07ff2600,0x03fffff2,0x7ffffd40,0x07d8002f,0x7f5fcc00,
0x000fffff,0xfd7f3000,0x001fffff,0xfffffa80,0x7ffe401f,0x3e601fff,
0x4001ffff,0x4ffffff8,0xf5002f88,0xf500039f,0x803fffff,0x1ffffffc,
0x3fffea00,0x7d8002ff,0xfffff100,0x005f109f,0x7fffffec,0x00000002,
0x3fffafe6,0x40000fff,0x4ffffff8,0xffff8800,0xff7004ff,0x6c03ffff,
0x02ffffff,0xfffff100,0xffffd8df,0xf10002ff,0x00dfffff,0xffffff98,
0xfe880003,0x3fff203f,0xff5000ff,0x0005ffff,0x7d8000fb,0x9ffffff7,
0x5f600000,0x4ffffffb,0x7ffd4000,0x7f401fff,0x400fffff,0x002fffff,
0x7fffffc4,0x2002fc84,0x4005ffc8,0x1ffffffa,0x7fffff40,0x3fea000f,
0x8002ffff,0xfff1007d,0x5f909fff,0x7ffffc00,0x000002ff,0x7fddf600,
0x0004ffff,0x7fffffc4,0xfff88004,0xf7004fff,0x403fffff,0x2ffffffe,
0xffff1000,0xfffe8fff,0x10002fff,0x0fffffff,0xfffff980,0x7440003f,
0x7fe401ff,0xf5000fff,0x005fffff,0x44000fb0,0xfffff14f,0x100000ff,
0x3fffe29f,0x540007ff,0x01ffffff,0x3fffffe6,0xfffff802,0x7ffc4002,
0x7fd44fff,0x5ffa8002,0x3fffea00,0x3fe601ff,0x4002ffff,0x2ffffffa,
0x1007d800,0x89ffffff,0x3e002ffa,0x01ffffff,0xf1000000,0x3ffffe29,
0x7c40007f,0x004fffff,0xffffff88,0xffff7004,0x3fe203ff,0x001fffff,
0xffffff10,0x3fffe23f,0x10001fff,0x3fffffff,0x7fffcc00,0x220003ff,
0xfc806ffe,0x5000ffff,0x05ffffff,0x4000fb00,0x3fff20fc,0x00003fff,
0xfff907e4,0x40007fff,0x1ffffffa,0xffffff50,0x3fffa009,0x7fc4002f,
0xc98cffff,0xf0002fff,0x3ea00bff,0x501fffff,0x09ffffff,0xfffff500,
0x0fb0005f,0x3ffffe20,0xfffc98cf,0xffff1002,0x00001fff,0xc83f2000,
0x03ffffff,0x3fffe200,0xf88004ff,0xaadfffff,0xdaaaaaaa,0x01ffffff,
0xfffffff3,0x7ffc0003,0xff32ffff,0x003fffff,0x7fffffc0,0x3fe6002f,
0x0003ffff,0x200fffea,0x21fffffb,0xffff503b,0xfb0005ff,0x313e2000,
0x0dffffff,0x227c4000,0x6ffffff9,0x3ffea000,0xbaa9afff,0x1dfffffd,
0x3ffff200,0x7ffc4003,0xffffffff,0xf90002ff,0xff5003ff,0x5535ffff,
0xbfffffb7,0x3fea0003,0x8002ffff,0xfff1007d,0xffffffff,0x3e6005ff,
0x01ffffff,0xf8800000,0x7ffffcc4,0x3e20006f,0x004fffff,0xffffff88,
0xffffffff,0xffffffff,0xffff301f,0x40001fff,0x2fffffff,0xfffffff3,
0x7ffc0001,0x2002ffff,0x3ffffff9,0x3fff6000,0xffff8802,0x2a05b9df,
0x02ffffff,0x70007d80,0xffffb03f,0x200005ff,0xfffd81fb,0x50002fff,
0xffffffff,0xbfffffff,0xfff70003,0xff88007f,0xfeceffff,0x90002fff,
0xf5009fff,0xffffffff,0x3bffffff,0xfffa8000,0xd8002fff,0xffff1007,
0xfffd9dff,0x3fe6005f,0x002fffff,0x1fb80000,0xffffffd8,0xfff10002,
0x10009fff,0x5bffffff,0x55555555,0x3ffffffb,0x3ffffe20,0x3e0001ff,
0x11ffffff,0x3fffffff,0x7fffc000,0x26001fff,0x03ffffff,0x0ffffe00,
0x7ffffd40,0x3fea00ff,0x8002ffff,0x0bd0007d,0x3fffffea,0x0bd00005,
0x3fffffea,0xfff50005,0xffb35fff,0x001dffff,0x0bffff30,0xfffff880,
0x0bffa24f,0x37ffec00,0x7ffffd40,0xffffd9af,0x40000eff,0x2ffffffa,
0x1007d800,0x49ffffff,0x2002ffe8,0x3fffffff,0xe8000000,0xfffff505,
0x3e2000bf,0x004fffff,0xffffff88,0xffff7004,0x7ffc03ff,0x0002ffff,
0xfffffff1,0x7fffffc1,0xff10002f,0x001fffff,0x7fffffcc,0x3ffe0003,
0x3f6a005f,0x7d401cef,0x002fffff,0xfa8006e8,0x3ffffa02,0x540001ff,
0x3fffa02f,0xa8001fff,0x11ffffff,0x9ffffffd,0x3fff6000,0x7ffc4006,
0x7fc44fff,0xfffd0002,0xffff500b,0x3ffa23ff,0x0004ffff,0x7fffffd4,
0x006e8002,0x9ffffff1,0x2002ff88,0x4fffffff,0x54000000,0x3fffa02f,
0x88001fff,0x04ffffff,0xfffff880,0xfff7004f,0x7ec03fff,0x003fffff,
0xffffff10,0xfffffd8f,0xff10003f,0x800fffff,0x3ffffff9,0x3fffa000,
0x40010006,0x2ffffffa,0x8006e800,0x7ffdc06e,0x40004fff,0x7ffdc06e,
0xa8004fff,0x21ffffff,0xfffffff9,0xfffa8002,0x7ffc4007,0x2fa84fff,
0x9ffff000,0xfffff500,0x7fffcc3f,0x20002fff,0x2ffffffa,0x1006e800,
0x09ffffff,0x7ec005f5,0x006fffff,0x03740000,0x3fffffee,0xfff88004,
0x88004fff,0x04ffffff,0xffffff70,0x7fffe403,0xf30004ff,0xc8bfffff,
0x04ffffff,0xfffff300,0xff9800bf,0x0003ffff,0x001ffff6,0xfff30002,
0xf0005fff,0xcef9800d,0xfdcccccc,0x00ffffff,0x999df300,0xfffb9999,
0x8001ffff,0x1ffffffa,0x7fffffe4,0xffe8000f,0x3fe2001f,0xf884ffff,
0xfff98002,0xfffa803f,0x7fe41fff,0x000fffff,0xffffff30,0x00df0005,
0x3fffffe2,0x2002f884,0x7ffffff9,0x26000000,0xccccccef,0xffffffdc,
0x7fc4000f,0x8004ffff,0x4ffffff8,0xfffff700,0x7ffcc03f,0x70004fff,
0x85ffffff,0x4ffffff9,0xffff7000,0xf98005ff,0x003fffff,0x03fffee0,
0x0067f540,0xffffff98,0x005f8003,0x7fffffec,0xffffffff,0xb0003fff,
0xffffffff,0xffffffff,0xffa8007f,0xfe81ffff,0x005fffff,0x003fffa8,
0x3fffffe2,0x15c05d04,0x017fffd4,0x7fffffd4,0xfffffe81,0xff30005f,
0x0007ffff,0x3fe200bf,0x5d04ffff,0x3ffa15c0,0x0000ffff,0xffffb000,
0xffffffff,0x007fffff,0xffffff88,0xfff88004,0xf7004fff,0x803fffff,
0x06fffffd,0xfffffb00,0x3ffff60d,0xffb0006f,0x3000dfff,0x07ffffff,
0x7fffd400,0xffff8802,0xffff1005,0xf98007ff,0x00fe2003,0x7fffffc4,
0x03f88007,0xffffff10,0xfffa800f,0xff881fff,0x003fffff,0x2006ffe8,
0x4ffffff8,0x40fc0590,0x800ffffb,0x1ffffffa,0xffffff88,0xff88003f,
0x4003ffff,0xff1003f9,0x3209ffff,0xff707e02,0x0009ffff,0x03f88010,
0xffffff10,0xfff8800f,0x88004fff,0x04ffffff,0xffffff70,0xffff8803,
0xfe8001ff,0xf102ffff,0x003fffff,0x5fffffd0,0xffff3000,0x4c0007ff,
0x8801ffff,0x000fffff,0x0bfffffd,0x2002fc80,0x3f6000fc,0x002fffff,
0xfb0007e4,0x005fffff,0x7fffffd4,0xfffff701,0xf88003ff,0xff1001ff,
0x0009ffff,0x3ffee0f5,0xffff5007,0x3fee03ff,0x001fffff,0x5fffffe8,
0x8017e400,0x4ffffff8,0xfb07a800,0x000fffff,0x07e40588,0xfffffb00,
0x7fc4005f,0x8004ffff,0x4ffffff8,0xfffff700,0xfff9003f,0xfa800bff,
0x6405ffff,0x005fffff,0x2fffffd4,0xffff9800,0x220003ff,0x2a007fff,
0x7001feee,0x00dfffff,0xf10037cc,0xfff98009,0x22006fff,0x7fcc004f,
0x2006ffff,0x1ffffffa,0x3fffff60,0xff98006f,0xffff1006,0xfd0009ff,
0x01fffe20,0x7fffffd4,0x3ffff601,0xfb8006ff,0x2006ffff,0x3e2006f9,
0x004fffff,0xfff107e8,0x20009fff,0x13e206f8,0xfffff300,0x7fc400df,
0x8004ffff,0x4ffffff8,0xfffff700,0xffd1003f,0x74001fff,0x400fffff,
0x0fffffe8,0x3ffffa00,0xff30000f,0x0007ffff,0x0027ffd4,0x3e2006c8,
0x805fffff,0x32002ff8,0xffe8002f,0x9002ffff,0xffd0005f,0x2005ffff,
0x1ffffffa,0x3ffffe20,0xf98004ff,0xfff9802f,0x6c004fff,0x3fffa05f,
0xffffa801,0x3fe201ff,0x004fffff,0x7fffffc4,0x02ff8805,0x3ffffe60,
0x2fec004f,0xffffff30,0x1efa8007,0x2000bf20,0x2ffffffe,0xfffff300,
0xff10009f,0x2009ffff,0x1ffffffb,0xffffd100,0x3ffea009,0xfd1001ff,
0x2a009fff,0x001fffff,0x3ffffe60,0x3f60003f,0x0fe0006f,0xfffff300,
0xfd51019f,0x07fc4007,0x7fffdc00,0xff8806ff,0xfffb8000,0xf5006fff,
0x805fffff,0xfffffffa,0x2ffa8002,0x7ffffcc0,0xffb1004f,0x27ffcc09,
0x7ffffd40,0x7ffd402f,0x4002ffff,0xcffffff9,0x03fea880,0x7ffffcc0,
0xffb1004f,0xfffd8809,0x26200cff,0x7fc405fd,0xfffb8000,0xf3006fff,
0x009fffff,0xffffff30,0x3ffee009,0x22002fff,0x404ffffe,0x01effffa,
0x7ffff440,0x7fffd404,0x7d40001e,0x004fffff,0x00effc88,0x0005d880,
0xffffffd5,0x7fffd79d,0x01ffe800,0xfffff880,0x7ff403ff,0xfff88001,
0xb803ffff,0x03ffffff,0xffffffc8,0xfd98000f,0x3fffea03,0x2e200eff,
0x4403ffff,0x2e00cffe,0x03ffffff,0xffffffc8,0x7f54000f,0xbcefffff,
0x8003fffe,0xeffffffa,0x3ffee200,0xfff7003f,0x9559bfff,0xd005fffd,
0xf10003ff,0x07ffffff,0xffffff50,0xfff5000b,0x3200bfff,0x03ffffff,
0xdffffb80,0xfffb710a,0xfb80009f,0x710adfff,0x009ffffb,0xfffff300,
0x64005fff,0x70002eff,0xf900005b,0xffffffff,0x7540019f,0x4000dfff,
0xfffffffb,0xfffea82f,0x7fdc000d,0x02ffffff,0x3fffffe6,0xffe801ff,
0x002effff,0xfd107d50,0xbdffffff,0xfffdb999,0xb1005fff,0xff309fff,
0x03ffffff,0xffffffd0,0xff90005d,0xffffffff,0xfd100019,0xbdffffff,
0xfffdb999,0x44005fff,0xffffffda,0x400dffff,0x00dfffea,0x7ffffdc0,
0x3a202fff,0x2fffffff,0x3fffa200,0x5403ffff,0xffffffff,0xfeb88001,
0xffffffff,0x100001ce,0xffffffd7,0x0039dfff,0x7ffff440,0xffffffff,
0x00d5c02e,0x00000200,0x2af332a6,0x7fe40009,0x03efffff,0x3fffffaa,
0x0fffffff,0xfffffff9,0x7ff5407d,0xffffffff,0xfffd10ff,0xffffffff,
0x3fe601df,0x07ffffff,0x7ff44600,0xffffffff,0xffffffff,0x001fffff,
0xffe89d44,0xffffffff,0xff300eff,0x0fffffff,0x3332a600,0x440009ab,
0xfffffffe,0xffffffff,0xffffffff,0x75310001,0x20035799,0xfffffffc,
0x3ffaa03e,0xffffffff,0xfffd10ff,0xffffffff,0xffd105df,0xffffffff,
0x3faa7dff,0xffffffff,0x8001efff,0xabcccaa8,0x44000001,0x1abcccaa,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x3332e000,
0x000000cc,0x0733332a,0xc8000000,0x0004cccc,0x33332600,0x4c00001c,
0x0003cccc,0x2600ba60,0xcb80002c,0x0000cccc,0x000e75c4,0x66664c00,
0x2e000003,0x000ccccc,0x11000033,0x20000000,0x005100a9,0x0c013000,
0xcca80000,0x00001ccc,0x03999993,0x2e003720,0x9800000c,0x0002a00a,
0x30720059,0x03333333,0xfffd1000,0x4000007f,0x04ffffe8,0xf3000000,
0x0003ffff,0x7fffec00,0xfd800005,0x0001ffff,0xfa813fa0,0x7c40000f,
0x0002ffff,0x00ffffd8,0x7ffec000,0x800001ff,0x02fffff8,0x00033e60,
0x6c402fb8,0x7d40000f,0x3641cfff,0xffd30000,0x02fffa87,0x7fff4000,
0x3600004f,0x2005ffff,0x3f601ff9,0x74c00005,0x7d42efff,0x00fec000,
0xfffd0bf2,0x0000ffff,0x01bfffa2,0xffd10000,0x000000df,0x0bfffee0,
0xff880000,0x800005ff,0x5ffffffa,0x3fe60000,0x003ffc85,0x2ffffb80,
0xfff88000,0x200003ff,0x5ffffffa,0xffb80000,0xe88002ff,0xff10003f,
0x013fa609,0xfffff500,0x0bf99dff,0x7ffe4000,0x1bfffa0f,0xfff88000,
0x2200005f,0x8005ffff,0x7f442ffd,0x2200000f,0xffffffff,0xc8007fbc,
0x32a21bef,0xfffa80ff,0x200007ff,0x000ffff8,0x7ff44000,0x0000001f,
0x002fffe8,0x7ffd4000,0xfd000005,0x03ffffff,0x77fec000,0x006ffd88,
0x05fffd00,0x3ffe2000,0x200004ff,0xfffffffe,0x7f400001,0x220002ff,
0xf70005fe,0x0fffa8bf,0x7fff4000,0xffffffff,0x3fa00003,0xfff12fff,
0x200001ff,0x0005fffb,0x02fffd40,0x33fff980,0x00007fff,0xffffffc8,
0x005fffff,0xffffff88,0x3a05ffff,0x0007ffff,0x01fffcc0,0x7f440000,
0x0000004f,0x001fffcc,0x77fec000,0xfb800000,0x5ffe9bff,0x3fe60000,
0x02fffeef,0x3fff8800,0x7fec0000,0x700000ff,0xffd39fff,0x7c40000d,
0x880003ff,0xff0004ff,0x7fff71bf,0xcef98000,0xfffffffd,0x7e400006,
0x7fff47ff,0x3fa00005,0xd800005f,0x20000eff,0xfffdfffc,0xff800007,
0xffffffcc,0xf70001ff,0xffffffff,0x7ffff401,0xf9800007,0x0000006f,
0x0000dff1,0x03ffb800,0xff880000,0x8800000e,0x3fa22fff,0x3600001f,
0x06ffffff,0x07ff7000,0xbf910000,0x3e200005,0x3ffa22ff,0xff700002,
0x7dc00007,0xffb8003f,0x006fffff,0x2e20fa80,0x000efffe,0x177e4400,
0x00077f66,0x002ffc40,0x077fc400,0x3ffe2000,0x0002ffff,0x36e22f80,
0x0002ffff,0x7fffffe4,0x7ffec01f,0x3000007f,0x000001ff,0x0007fe60,
0x03fe8000,0xdf500000,0x32000001,0x6fd881ef,0x3fe60000,0x0001ffff,
0x00009fd0,0xc8000000,0x0dfb01ff,0x013fa000,0x0bffe000,0x3ffffa00,
0x880001ff,0x0006a202,0x00000000,0x001df700,0x01df5000,0x3fff2000,
0x000006ff,0x0009a805,0x9dffb300,0xffffb001,0x4c00000f,0x0000000a,
0x000006a6,0x00002a80,0x0002a600,0x0077cc00,0x80000bf2,0x005ffffc,
0x0000aa00,0x10000000,0x2fc801df,0x002a8000,0x1fff9000,0xffffa800,
0x0000005f,0x00000000,0x54c00000,0x53000000,0x7c400001,0x0001ffff,
0x00000000,0xffd80000,0x000007ff,0x00000000,0x00000000,0x00000000,
0x98000000,0x00000000,0x00000000,0x99d95310,0x000dc057,0x00000980,
0x7d400000,0xed8004ff,0x31000eee,0x33333333,0x26662001,0x00099999,
0x006aaa60,0x00000000,0x00000000,0x98000000,0x00001aaa,0x3ff60000,
0x333007ff,0x33333333,0x33333333,0x00013333,0x980001c0,0x99999999,
0x99999999,0x00999999,0x4ccccccc,0x99999999,0x80999999,0x99999999,
0x99999999,0x09999999,0x4cccccc0,0x99999999,0x09999999,0x99999998,
0x09999999,0x3ffb6600,0xffffffff,0x4c07e62d,0x99999999,0x31099999,
0x33333333,0x98801333,0x01999999,0x000ffff8,0x3fa60000,0xffffffff,
0xfffeb800,0x2003ffff,0xfefffedb,0x000befff,0x26666666,0x09999999,
0x33333000,0x33310333,0x33333333,0x40000003,0xfefffedb,0x000befff,
0x26666666,0x09999999,0x07ffffd8,0xffffec88,0xffffffff,0xffffffff,
0xf300002f,0xec880001,0xffffffff,0xffffffff,0x202fffff,0xfffffffa,
0xffffffff,0x43ffffff,0xfffffec8,0xffffffff,0xffffffff,0x3fffea02,
0xffffffff,0xffffffff,0x7ff6443f,0xffffffff,0xff9002de,0x4c415dff,
0xffeffffb,0xfffec881,0xefffffff,0xfffff72d,0x7dffffff,0xffffe980,
0x7f400eff,0xdea804ff,0x00675c41,0x7fffff44,0x362006ff,0x26001fff,
0x10bdfffe,0x05ffffb5,0xffffd910,0xbdffffff,0x3ffa0007,0xd987ffff,
0xfffffffe,0xdeffffff,0xd300001b,0x2217bfff,0x02ffffda,0xffffec88,
0xdeffffff,0x7ffffd82,0x7fff4400,0xccccefff,0xfffffecc,0x9fb00002,
0x7f440000,0xccefffff,0xfffecccc,0x3fee02ff,0xaaabdfff,0xfffffaaa,
0x7f4406ff,0xccefffff,0xfffecccc,0x3fee02ff,0xaaabdfff,0xfffffaaa,
0x7f4406ff,0x02ffffff,0x3ffffa60,0xffff7002,0xffe8803f,0x202fffff,
0xfffffffa,0x7ec4001f,0xff9001ef,0x7fd401ff,0x3fff20ff,0xfffd1006,
0x8009ffff,0x3f2002ff,0x7cc04fff,0x1000dfff,0xfffffffd,0x3ea00003,
0x4c07ffff,0xdfffffff,0xfffffdcc,0x3f20004f,0x7cc04fff,0x1000dfff,
0xfffffffd,0xffffd805,0xfffa8007,0x75404fff,0x80002fff,0x0000fff8,
0x3ffffea0,0x7ff5404f,0x3ffee02f,0x7ffdc00b,0xa801ffff,0x04ffffff,
0x017fff54,0x8017fff7,0xfffffffb,0xffffa801,0x3f2005ff,0x4002ffff,
0x801ffff9,0x5ffffffa,0xfffffb80,0xfa8001ff,0x3fee001f,0x3ff603ff,
0x3fffe3ff,0xfff3001f,0x005fffff,0x744007ec,0x3006ffff,0x003fffff,
0x3fffffea,0x7f400004,0xfc807fff,0xa81fffff,0x01effffe,0x3ffffa20,
0xffff3006,0x3fea003f,0xd805ffff,0x8007ffff,0x4ffffff9,0x005ff900,
0x07fff900,0x7ffcc000,0xf9004fff,0x0ffe405f,0x7ffffc40,0xff3004ff,
0x2009ffff,0x3f202ffc,0xfff8801f,0x3004ffff,0x09ffffff,0x3ffffee0,
0xfff30003,0xffff3003,0x3fa009ff,0x004fffff,0x54003fc8,0x3205ffff,
0x3fa2ffff,0xf3000fff,0xffffffff,0x401f2003,0x00effffd,0x3fffff60,
0xffff9800,0x400003ff,0x807ffffe,0x1ffffffb,0xfffffb10,0x3fff6009,
0x3f6000ef,0x9800ffff,0x04ffffff,0x07ffffd8,0xfffff980,0x0bf6004f,
0xffff1000,0x7cc0000d,0x004fffff,0x2fd80bf6,0xfffffb00,0x3e6001ff,
0x004fffff,0x2fd80bf6,0xfffffb00,0x3e6001ff,0x804fffff,0x06fffff8,
0x00ffd400,0x7fffffcc,0xffff3004,0x44001fff,0xff98006f,0x3fe206ff,
0x27ffd46f,0xfffbf300,0x001dffff,0xfff700f9,0xf98007ff,0x9805ffff,
0x03ffffff,0x7ffec000,0xfffb807f,0x3e201fff,0x403fffff,0x03fffffb,
0x7ffffcc0,0xffff9805,0xffd804ff,0xf88007ff,0x004fffff,0x70000be6,
0x005fffff,0x3fffe200,0x3e6004ff,0x4c017a02,0x2fffffff,0x3fffe200,
0x3e6004ff,0x4c017a02,0x2fffffff,0x3fffe200,0xffd804ff,0x80003fff,
0xff8801fd,0x2004ffff,0x5ffffffd,0x0007f600,0x01ffffe6,0x0054406a,
0x3ff67e60,0x805fffff,0x7ffc407c,0xe8001fff,0x402fffff,0x3ffffff9,
0x7fec0000,0xffb807ff,0x5401ffff,0x01ffffff,0x3ffffff1,0xffffd000,
0xfff8805f,0xfd804fff,0x88007fff,0x04ffffff,0x0005d035,0x6fffffe8,
0xfff10000,0x06a09fff,0x002e80ba,0xdffffffd,0xffff8800,0xd03504ff,
0xe8017405,0x06ffffff,0x7ffffc40,0x7ffdc04f,0x80000fff,0xff8801f9,
0x2004ffff,0xfffffff8,0x004f9801,0x1fffff30,0x30000000,0x3ffffa3f,
0x3e404fff,0x3fffffa0,0xfff90007,0x7cc01fff,0x003fffff,0x7fffec00,
0xffffb807,0xfff801ff,0xffd06fff,0x2000ffff,0x0ffffffc,0x3ffffe20,
0xfffd804f,0xff88007f,0x5b04ffff,0x54000590,0x1fffffff,0xfff88000,
0x05b04fff,0xb8034059,0x1fffffff,0x7fffc400,0x905b04ff,0xfb803405,
0x01ffffff,0x7ffffc40,0x3ffe204f,0x00007fff,0x3fe2007a,0x4004ffff,
0x5ffffffc,0x0000fe80,0x23fffff1,0xaaaaaaa9,0x2aaaaa60,0x11f9802a,
0xffffffff,0xf503e405,0x009fffff,0x3ffffee0,0x3ffe603f,0x00003fff,
0x03ffffec,0x7fffffdc,0xffffc801,0x7ffd42ff,0x70004fff,0x07ffffff,
0x7fffffc4,0xffffd804,0xfff88007,0x05d04fff,0x7f400011,0x05ffffff,
0xffff8800,0x105d04ff,0x7c400401,0x04ffffff,0xfffff880,0x1105d04f,
0x7fc40040,0x004fffff,0xffffff88,0x3fffea04,0x200006ff,0xffff1000,
0xf88009ff,0x02ffffff,0x88000bee,0xd52fffff,0x43ffffff,0xffffffea,
0xf30fcc00,0x3fffffff,0xffb81f20,0x0003ffff,0xbffffff3,0x7ffffcc0,
0x6c00003f,0xb807ffff,0x01ffffff,0xffffffa8,0x7ffffdc5,0xff30003f,
0x440bffff,0x04ffffff,0x07ffffd8,0xfffff880,0x002f884f,0x7f5fcc00,
0x000fffff,0x7ffffc40,0x002f884f,0xffffb000,0x22000dff,0x84ffffff,
0x000002f8,0xdffffffb,0x3ffe2000,0x3f204fff,0x005fffff,0xff880000,
0x8004ffff,0x6ffffffb,0x8000df10,0x42fffff8,0x81fffffe,0x00ffffff,
0x3fee0fcc,0x80efffff,0x3fff607c,0x10002fff,0x0dffffff,0x7fffffcc,
0x7ec00003,0xfb807fff,0x001fffff,0x1fffffff,0x7fffffec,0xfff10002,
0x7c40dfff,0x804fffff,0x007ffffd,0xffffff88,0x0002fc84,0xfffbbec0,
0x40004fff,0x4ffffff8,0x00002fc8,0xffffffa8,0xff10002f,0xf909ffff,
0xf5000005,0x05ffffff,0x3fffe200,0x3ff604ff,0x0003ffff,0xfff88000,
0xd0004fff,0x05ffffff,0x880003f9,0x6c1fffff,0xd81fffff,0x400fffff,
0xfffc81f9,0x7c85ffff,0x3fffffa0,0xff10002f,0x4c0fffff,0x03ffffff,
0x7ffec000,0xfffb807f,0xff001fff,0x747fffff,0x02ffffff,0xfffff100,
0x7ffc40ff,0xfd804fff,0x88007fff,0x44ffffff,0x00002ffa,0x7ffc53e2,
0x40007fff,0x4ffffff8,0x00017fd4,0x3ffffe20,0x220005ff,0x44ffffff,
0x00002ffa,0x7fffffc4,0x3e20005f,0x204fffff,0x2fffffff,0x88000000,
0x04ffffff,0xfffff500,0x004f98df,0xfffff980,0x7ffffe40,0xfffffd81,
0xe80fcc00,0x3fffffff,0xfff883e4,0x0001ffff,0xfffffff1,0x3fffe603,
0x400003ff,0x807ffffd,0x1ffffffb,0xfffffd00,0x3fffe29f,0x10001fff,
0x3fffffff,0x3ffffe20,0xfffd804f,0xff88007f,0xc98cffff,0x00002fff,
0xfffc83f2,0x20003fff,0xcffffff8,0x02fffc98,0x7ffe4000,0x0000ffff,
0x3fffffe2,0x2fffc98c,0x7fe40000,0x000fffff,0x3ffffe20,0xffff104f,
0x00003fff,0xffff1000,0x740009ff,0x23ffffff,0x980000fe,0xfc87ffff,
0xfc81ffff,0x4c00ffff,0xffff101f,0x3e45ffff,0xffffff98,0x3fe0001f,
0x302fffff,0x07ffffff,0xfffd8000,0xfffb807f,0xfb001fff,0x269fffff,
0x1fffffff,0x3fffe000,0xff102fff,0xb009ffff,0x000fffff,0xfffffff1,
0x05ffffff,0x313e2000,0x0dffffff,0x7fffc400,0xffffffff,0x2600002f,
0x3fffffff,0x7ffc4000,0xffffffff,0x200002ff,0xfffffff9,0x7fc40003,
0xf304ffff,0x03ffffff,0xf1000000,0x009fffff,0x7ffffd40,0x002fa8ff,
0xdffff300,0x3fffff90,0x1fffff90,0x2601f980,0xffffffff,0x3fe60f90,
0x000fffff,0x3fffffe0,0xffff302f,0x800007ff,0x807ffffd,0x1ffffffb,
0xfffffb00,0x3fffe6bf,0x20000fff,0x2fffffff,0xffffff10,0xffffb009,
0xfff1000f,0xffd9dfff,0x200005ff,0xfffd81fb,0x10002fff,0x9dffffff,
0x005ffffd,0x7ffff400,0x880006ff,0xceffffff,0x002ffffe,0x3ffffa00,
0x880006ff,0x04ffffff,0xfffffff1,0x00000005,0x9ffffff1,0xfffd8000,
0x006fcfff,0x3fffea00,0xfffffc85,0xfffffc81,0x200fcc00,0xfffffffa,
0x3fe20f96,0x001fffff,0x3fffffe0,0xffff301f,0x800007ff,0x807ffffd,
0x1ffffffb,0xfffff900,0x3fffe2bf,0x20001fff,0x1fffffff,0xffffff10,
0xffffb009,0xfff1000f,0x7f449fff,0xbd00002f,0x3ffffea0,0xff10005f,
0x7449ffff,0x700002ff,0x3fffffff,0xfff10000,0x7f449fff,0xf700002f,
0x03ffffff,0xffff1000,0x7ffc09ff,0x8803ffff,0xeeeeeeee,0x103eeeee,
0x09ffffff,0xffff9800,0x0001ffff,0x0ffffee0,0x07fffff2,0x03fffff2,
0xf9003f30,0x9bffffff,0x7ffffc0f,0xf10002ff,0x01ffffff,0x3fffffe6,
0x7ec00003,0xfb807fff,0x001fffff,0x9ffffffb,0x7ffffffc,0xfff10002,
0x2201ffff,0x04ffffff,0x07ffffe8,0xfffff880,0x017fc44f,0xd017d400,
0x03ffffff,0xfffff100,0x02ff889f,0xffff8800,0x00004fff,0x9ffffff1,
0x0002ff88,0xffffff88,0xf100004f,0x409fffff,0x4fffffff,0x3fff2200,
0x01bfffff,0x3fffffe2,0xffd80004,0x0005ffff,0x83fffec0,0x81fffffc,
0x00fffffc,0xfd800fcc,0x7fffffff,0x3fffff60,0xff10003f,0x4c0fffff,
0x03ffffff,0x7ffec000,0xfffb807f,0xfd001fff,0x6c7fffff,0x03ffffff,
0xfffff100,0x7ffc40ff,0xfe804fff,0x4000ffff,0x4ffffff8,0x80002fa8,
0x7ffdc06e,0x88004fff,0x84ffffff,0xd80002fa,0x0fffffff,0xff880400,
0xfa84ffff,0xffd80002,0x000fffff,0xffff8804,0x3ff204ff,0x8005ffff,
0x3ffffffd,0xfffff880,0xf880004f,0x004fffff,0x1ffff400,0x1fffffc8,
0x0fffffc8,0x8800fcc0,0xfffffffe,0x3ffff207,0xf30004ff,0x40bfffff,
0x3ffffff9,0x7fec0000,0xffb807ff,0xf001ffff,0x43ffffff,0x4ffffffc,
0xffff3000,0x7fc40bff,0x5404ffff,0x0cffffff,0x3fffe200,0x02f884ff,
0x6677cc00,0xffdccccc,0x000fffff,0x7fffffc4,0x0002f884,0x7fffffd4,
0x81dc002f,0x4ffffff8,0x40002f88,0xfffffffa,0x881dc002,0x04ffffff,
0x3fffffe6,0xfffc8006,0xf8802fff,0x004fffff,0xfffff880,0x7c00004f,
0xff900fff,0xff903fff,0xf9801fff,0x3ffe6001,0x2607ffff,0x04ffffff,
0xfffff700,0x7ffcc05f,0x10003fff,0xfffffb09,0xfffff700,0x3ffe003f,
0x3e60ffff,0x004fffff,0xffffff70,0x7fffc405,0xfff104ff,0x3fffffff,
0x3fffe200,0x405d04ff,0x7ffec02b,0xffffffff,0x03ffffff,0x7ffffc40,
0x5c05d04f,0x3fffa202,0xd8005fff,0xfffff102,0xb80ba09f,0x3fffa202,
0xd8005fff,0xfffff102,0xfffe809f,0xfb8007ff,0x801fffff,0x4ffffff8,
0xfff88000,0x00004fff,0xc813ffea,0xc81fffff,0x400fffff,0x7d4001f9,
0x407fffff,0x06fffffd,0xfffffb00,0xffff980d,0x970003ff,0x0fffffb0,
0xffffff70,0xffff1003,0xfffb0dff,0x36000dff,0x406fffff,0x4ffffff8,
0x22000000,0x04ffffff,0x100fc059,0x3fe2007f,0x4007ffff,0x4ffffff8,
0x00fc0590,0xfffffff9,0x01f88001,0x9ffffff1,0x01f80b20,0x3ffffff2,
0x0fc4000f,0xffffff88,0x7fffcc04,0x7dc001ff,0x801fffff,0x4ffffff8,
0xfff88000,0x00004fff,0xc803fffa,0xc81fffff,0x400fffff,0xfc8001f9,
0x4407ffff,0x01ffffff,0xfffffe80,0x7fffcc02,0x9d0003ff,0x0fffffb0,
0xffffff70,0xffff7003,0xfff105ff,0xd0003fff,0x805fffff,0x4ffffff8,
0x01bdea80,0xfffff100,0x0f50009f,0x36000fc8,0x02ffffff,0x3ffffe20,
0x07a8004f,0x3fffffe6,0x0fc8003f,0xffffff10,0x40f50009,0xfffffff9,
0x00fc8003,0x9ffffff1,0xfffff700,0xfffb800b,0xf8801fff,0x004fffff,
0xfffff880,0xf300004f,0xffb803ff,0xffc81fff,0x7cc00fff,0xfffb0001,
0xfff900ff,0xfa800bff,0x9805ffff,0x03ffffff,0xfd83f980,0xfb807fff,
0x801fffff,0x05fffffe,0x17fffff2,0xfffff500,0xffff100b,0xff7009ff,
0xf10001ff,0x009fffff,0x27c40fd0,0x3fffe600,0x3e2006ff,0x004fffff,
0x3ffa07e8,0x8006ffff,0x3fe207f9,0x8004ffff,0x3fffa07e,0x98006fff,
0x3ffe207f,0xf9004fff,0x4003ffff,0x1ffffffb,0xfffff880,0xf880004f,
0x004fffff,0x005ffb00,0x83fffff7,0x0fffffe8,0x8000fcc0,0x807fffe8,
0x0fffffe8,0x3ffffa00,0xfff9800f,0xd8003fff,0xffffd82f,0xffffb807,
0x7fd401ff,0x2200ffff,0x00fffffe,0x3fffffa0,0xffff8800,0xfb8804ff,
0xf98004ff,0x004fffff,0x5f902fec,0xffffd000,0x3e6005ff,0x004fffff,
0xffb82fec,0x001fffff,0xf303ff44,0x009fffff,0xff705fd8,0x003fffff,
0x2607fe88,0x04ffffff,0x3bffffa0,0xffff7000,0xff3003ff,0x0009ffff,
0xffffff10,0xff30000b,0x3ffe6007,0x7fff43ff,0x7d400fff,0x3fe20003,
0xffd1007f,0x3ea009ff,0x3001ffff,0x07ffffff,0xd81ffb80,0xb807ffff,
0x01ffffff,0x1ffffff4,0x7ffff440,0xffff5004,0x3fe6003f,0x2004ffff,
0x98005ffd,0x04ffffff,0x209ffb10,0xb8000ff8,0x06ffffff,0xffffff30,
0x3ff62009,0xfffff884,0x7cc004ff,0x3fe606ff,0x1004ffff,0xff109ffb,
0x009fffff,0x206fff98,0x4ffffff9,0x7fffdc00,0xfffb801e,0xf9801fff,
0x004fffff,0xfffff880,0x7cc0005f,0x7ff4004f,0xefeaafff,0x401fffff,
0x540005fd,0x3a2007ff,0x5404ffff,0x001effff,0x3fffffe6,0x3ffee004,
0x7ffffe80,0xfffffb80,0x3fff202f,0x3a2002ff,0x5404ffff,0x001effff,
0x3fffffe6,0x9fff1004,0xffff5000,0x5c401dff,0xfd03ffff,0xff10003f,
0x007fffff,0xdffffff5,0x7ffdc401,0xffffd83f,0xb3000fff,0x540bffff,
0x0effffff,0x3fffee20,0xfffffd83,0xfb3000ff,0x7d40bfff,0x005fffff,
0xdffffd88,0x7ff5c409,0xa800beff,0x05ffffff,0xffff9800,0x2a0006ff,
0xf98001ef,0x9effffff,0x0cfffffc,0x039fff70,0x003fdc00,0x56ffffdc,
0xffffb710,0xfff50009,0x9801dfff,0xfd07fffc,0xc801ffff,0x83ffffff,
0x0effffd8,0xffff7000,0x3f6e215b,0xa8004fff,0x05ffffff,0x077fed44,
0x3fffa200,0xccdeffff,0xfffffedc,0x7fff542f,0x7fdc000d,0x02ffffff,
0x3fffffa2,0xdcccdeff,0x2ffffffe,0x7fffffd4,0xccccccef,0xfffffecc,
0xffd104ff,0x9bdfffff,0xffffdb99,0xfffa85ff,0xccceffff,0xffeccccc,
0x104fffff,0xfffffffd,0x3f660005,0xffffffff,0x000bdfff,0x3fffffa2,
0x220002ff,0xfffffffe,0x02ea8003,0x7fff5400,0xffff90df,0x3faa3fff,
0x3effffff,0x000fb000,0x3ffffae2,0x1cefffff,0xffff9800,0xccceffff,
0xfffffdcc,0xffffa87f,0xff500cff,0x9bffffff,0x5bffffdb,0xfd710000,
0xffffffff,0xd100039d,0x5fffffff,0x0b7bfe20,0xffffe880,0xffffffff,
0xffffffff,0x3ff21fff,0x03efffff,0x3fffffaa,0x0fffffff,0xffffffd1,
0xffffffff,0xffffffff,0xffffe83f,0xffffffff,0xffffffff,0x3a23ffff,
0xffffffff,0xffffffff,0x1fffffff,0x7ffffff4,0xffffffff,0xffffffff,
0x3ffa23ff,0xffffffff,0x30002eff,0x35799975,0xffe88003,0xffffffff,
0xeb802eff,0xfffffffe,0x00eeffff,0x4c000008,0x000000ab,0x00120000,
0x3332aa20,0xe88001ab,0xffffffff,0xffffffff,0x6fffffff,0x3fffffe2,
0xfd51ffff,0xffffffff,0x59dfffff,0x54400000,0x01abccca,0xffffe880,
0xffffffff,0x0000002e,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x33000000,
0x33333333,0x00000133,0x0c403100,0x100c0000,0x33310003,0x01333333,
0x26666620,0x26660999,0x99999999,0x26620199,0x19999999,0x4ccccc40,
0x33330000,0x33333333,0x00000133,0x09999988,0x332ea200,0x000480ac,
0x028804cc,0x00031000,0x59b95300,0x20000003,0x10006201,0x13333333,
0x40c40310,0x19999998,0x20000000,0x26620001,0x30099999,0x01220597,
0xbccca980,0x4400dc01,0xffffffee,0xffffffff,0x0001bdef,0x20f7fdc0,
0x0000effd,0x641fffb8,0x26000eff,0xfffffffe,0xfeb800ff,0x23ffffff,
0xffffffec,0x205fffff,0xffffffec,0x7fcc06ff,0x88003fff,0xffffffec,
0x03deffff,0x7ffc0000,0x3ee005ff,0xcfffefff,0x2a000f11,0x641cffff,
0xffc80006,0x7640001e,0xfffeffff,0x00000cef,0x320fffdc,0xf9000eff,
0x89dfffff,0x7ec1effb,0x3ffee0ef,0x0001ffff,0x7ff54000,0xffeb8003,
0xfc85ffff,0x360cffff,0x7fe44006,0xefffffff,0x000be22c,0xffffffd1,
0xffd99559,0x0003dfff,0x4bffff10,0x003ffffa,0x26ffff80,0x004ffff9,
0xfffffe88,0x362006ff,0x7ec01fff,0x02ffffff,0x3ffffe60,0x3ffea002,
0x7440006f,0x1fffffff,0xf5000000,0x2600dfff,0x2620cffe,0x007ffffd,
0xffffffa8,0x005fcbef,0x2ffffd40,0xfffe9800,0xff9510bd,0x400005ff,
0x3e65ffff,0xf9003fff,0x3e209fff,0x3fe65fff,0x7ff443ff,0x00001fff,
0x7ffff400,0x3fea0000,0x7ffdc5ff,0xfeefffff,0xfffb1005,0x73335bff,
0x5ffdfffb,0xffff7000,0x3fee03ff,0x0002ffff,0x93ffffd4,0x000bffff,
0x0fffff98,0x00dffff7,0x3ffffa20,0x7c004fff,0xfff9802f,0xe8006fff,
0xa8000dff,0x0001ffff,0x7fffffd4,0x20000004,0x000efffc,0xfa809ffd,
0xfe8007ff,0xffffffff,0x6c0003ff,0x000fffff,0x02ffffe4,0x037fffea,
0xffff3000,0x2ffffdcf,0x0ffffc80,0x4fffff30,0xc85ffffb,0x001fffff,
0x3fe60000,0x40004fff,0x7fc5ffff,0xffffffff,0xff9803ff,0x4c01dfff,
0x002ffffe,0xffffffa8,0x3fffea01,0x7c0001ff,0x3fe64fff,0xe80002ff,
0x3fe25fff,0x260003ff,0xffffffff,0x003f6002,0x3fffffe2,0x27fd4005,
0x3ffea000,0x7fcc0003,0x0003ffff,0x3bffe000,0x1fff9000,0x00fff300,
0xffecef98,0x006fffff,0x6ffffb80,0x3fffa200,0xfff7006f,0xe80003ff,
0x3fe25fff,0xff9002ff,0x7ff401ff,0x3fffe24f,0xfffffb82,0x20000001,
0x02fffff8,0x2ffff400,0xffd73bf1,0x700dffff,0x00bfffff,0x002fffc8,
0xffffffa8,0x7fffec01,0x6cc0006f,0x1ff5c0cf,0xcfd98000,0x0067f540,
0xfffff300,0x2003ffff,0xfff1007c,0x5400bfff,0x700002ff,0x98000dff,
0x03ffffff,0xff500000,0x3fe6001d,0x1fee005f,0x64c1f500,0x000efffe,
0x3ffff880,0x3ffffa00,0x3ff6000f,0x20000fff,0x7540cfd9,0x3ff2004f,
0x67ecc07f,0xb81ff5c0,0x001fffff,0x7fe40000,0xfe80006f,0x303e65ff,
0x5009ffd7,0x00bfffff,0x000bff60,0x3fffffea,0x7fffdc01,0x000001ff,
0x00000000,0x37e60000,0xefffffff,0x1007c800,0x09ffffff,0x0007bee0,
0x003ff700,0x7ffffcc0,0x0000003f,0x54001df9,0x6c007fff,0x10144007,
0x88000035,0x3ee000cb,0x4004ffff,0x05fffff9,0x80000000,0x0007fffc,
0xffffb800,0x0000001f,0x00002c98,0x044bfffd,0x7fcc0020,0x0000ffff,
0x2a000bfa,0x01ffffff,0x7fffffd4,0x00000003,0x00000000,0x3f67e600,
0x05ffffff,0xff1007c8,0xb009ffff,0x000001bf,0x98000fee,0x03ffffff,
0x1ff00000,0xffffc800,0x003ea003,0x00000000,0x7ffcc000,0xf8001fff,
0x002fffff,0x64000000,0x00007fff,0xfffffb80,0x00000001,0xffe80000,
0x8800005f,0x03fffffe,0x0017dc00,0x7fffffd4,0x7fffcc01,0x4ccc04ff,
0x99999999,0x99999999,0x00009999,0x200000e0,0xffffd1f9,0x7c809fff,
0xfffff100,0x27f4409f,0x00000000,0x7ffffcc0,0x0000003f,0x7ffec000,
0x1f1002ff,0x000e0000,0x4cccccc0,0x99999999,0x7fffff40,0xfffb0007,
0x4cc41fff,0x99999999,0x4cc40099,0x32199999,0x26607fff,0x99999999,
0x7dc09999,0x0001ffff,0x4cccccc0,0x99999999,0x09999999,0x32ffff40,
0x33333333,0xb8133333,0x00ffffff,0x0017c400,0x7fffffd4,0x7fffd401,
0x3b2203ff,0xffffffff,0xffffffff,0x002fffff,0x0001f300,0xff11f980,
0x05ffffff,0xff8803e4,0xf304ffff,0xa800005f,0x675c41de,0x3ffe6000,
0x00003fff,0xb883bd50,0x3fee00ce,0x800cffff,0x1f300003,0xfec88000,
0xffffffff,0x3fea2def,0x0004ffff,0x7ffffff5,0x7fffffdc,0x03efffff,
0x7fffff4c,0xffff90ef,0x3fffb220,0xefffffff,0x7fffdc2d,0x5555441f,
0xf500aaaa,0xffffffff,0xffffffff,0xe807ffff,0xfd915fff,0xffffffff,
0xffe85bdf,0x00006fff,0xff500059,0xc803ffff,0x01ffffff,0xfffffd10,
0x999999df,0x05fffffd,0x013f6000,0x4c3f3000,0xffffffff,0x2200f901,
0x84ffffff,0x00001efb,0x907fffd4,0x4c00dfff,0x03ffffff,0xfffa8000,
0x1bfff20f,0xffffff98,0x000003ff,0x00009fb0,0x7fffff44,0xfff702ff,
0x20007fff,0x5ffffff9,0xffffffa8,0x6c4001ff,0x7fe41eff,0xffe8807f,
0x202fffff,0x41fffffb,0xefffffc8,0xffff700c,0x555557bf,0xfffffff5,
0xbfffd00d,0xfffffd10,0x3fea05ff,0x0004ffff,0x7fd40000,0x7401ffff,
0x00ffffff,0x3ffffea0,0x7ff5404f,0xf880002f,0x200000ff,0x7ffdc1f9,
0xc80effff,0xffff1007,0x0efc89ff,0xffd80000,0x3fffe3ff,0xfff3001f,
0x00007fff,0x47ffffb0,0x201fffff,0xffffffff,0x000003ff,0x0003ffe2,
0xfffffa80,0x3fff605f,0x30002fff,0x0dffffff,0x3fffffee,0xffa8001f,
0x07fffc81,0xffffff50,0xffffb80b,0x7fff301f,0x17fff700,0xfffffb80,
0xffe801ff,0xffff505f,0x7fec0bff,0x0002ffff,0x7fd40000,0x2601ffff,
0x02ffffff,0x7ffffcc0,0x5ff9004f,0xfff90000,0x7cc00007,0xfffffc81,
0x007c85ff,0x9ffffff1,0x00bfffa2,0x3fff2000,0x3ffffa2f,0xffff3000,
0x000007ff,0x745ffff9,0x2a00ffff,0xffffffff,0x00002eff,0x003fffc8,
0x3fffe600,0x3ffa04ff,0x0002ffff,0xfffffff1,0x3ffffa01,0xfc8004ff,
0x0ffff903,0x3ffffe60,0x7ffdc04f,0x3ff501ff,0x007ff200,0x3fffffe2,
0xfffd004f,0x3fffe60b,0x3ffe04ff,0x0002ffff,0x7fd40000,0xf501ffff,
0x009fffff,0xffffff30,0x017ec009,0x3fffe200,0x3e600006,0xfffffd01,
0x007c87ff,0x9ffffff1,0x1fffffd3,0xff880000,0x27ffd46f,0xfffff300,
0x1000007f,0xffa8dfff,0xfffb804f,0xffffffff,0xf100001d,0x0000dfff,
0x7fffffcc,0xfffff104,0x220003ff,0x1fffffff,0xffffff30,0x37c4001f,
0x00ffff90,0x3fffffe6,0x7fffdc04,0x003fd01f,0xfd8017ec,0x00ffffff,
0x20bfffd0,0x4ffffff9,0x3fffffe0,0x0000001f,0x7ffffd40,0xfdbaa9af,
0x001dffff,0xffffff10,0x017cc009,0x3fffee00,0xf300002f,0x3fffe203,
0x1f22ffff,0x7ffffc40,0xffffffef,0x800000ef,0x0015101a,0xffffff98,
0x2a000003,0x40015101,0xfffffffc,0x002fffff,0xfffffb80,0xff100002,
0x2609ffff,0x0fffffff,0x3fffe000,0x3f602fff,0x005fffff,0xffc807f6,
0xfff1007f,0xfb809fff,0xfd81ffff,0x802f4001,0xfffffff9,0x3fffa002,
0xfffff105,0x3ffe209f,0x0000ffff,0x7fd40000,0xffffffff,0x01dfffff,
0x7fffc400,0xd03504ff,0xffe80005,0x00006fff,0x7fcc03f3,0x90ffffff,
0x3ffe200f,0xfffeffff,0x0005ffff,0x30000000,0x07ffffff,0x00000000,
0xfffffb80,0x3fffffff,0x7fff4000,0x100006ff,0x09ffffff,0x3fffffe6,
0x3fe0000f,0x202fffff,0xfffffff8,0x404f9801,0x1007fffc,0x09ffffff,
0x1fffffb8,0x74000fec,0xffffd002,0xfe800dff,0xfff105ff,0x3e609fff,
0x01ffffff,0x54000000,0x9affffff,0xeffffffd,0x7fc40000,0x5b04ffff,
0x54000590,0x1fffffff,0x01f98000,0x7fffffd4,0x2200f96f,0x95ffffff,
0x7fffffff,0x2aaa6000,0x2a60aaaa,0x802aaaaa,0x3ffffff9,0xaaa98000,
0x2a60aaaa,0x002aaaaa,0xffffffb1,0x005fffff,0x3ffffea0,0x880001ff,
0x04ffffff,0xfffffff1,0x7ffc0003,0x6401ffff,0x05ffffff,0x7e400fe8,
0xff1007ff,0xb809ffff,0x361fffff,0x00d0004f,0x3fffffee,0x7ff4001f,
0xffff105f,0x3fe609ff,0x002fffff,0x7d400000,0xd11fffff,0x09ffffff,
0xffff8800,0x105d04ff,0x7ff40001,0x005fffff,0xc801f980,0xdfffffff,
0xfff1007c,0x7ff49fff,0x002fffff,0xfffffea8,0x3fffaa1f,0x7cc00fff,
0x003fffff,0xffffea80,0x3ffaa1ff,0x2000ffff,0xffffffd9,0xd0006fff,
0xbfffffff,0xfff10000,0x7fc09fff,0x002fffff,0xffffff10,0xfff8801f,
0x2e02ffff,0xfffc802f,0xffff1007,0xffb809ff,0xfffb1fff,0x10010003,
0x9fffffff,0xbfffd000,0x3ffffe20,0x3fffe04f,0x00003fff,0x7ffd4000,
0x3fe61fff,0x002fffff,0x3ffffe20,0x002f884f,0x7f5fcc00,0x000fffff,
0xd800fcc0,0xffffffff,0xffff1007,0x7ffc49ff,0x000fffff,0x3fffffd0,
0x1ffffff0,0xfffff980,0x3a00003f,0xf81fffff,0x000fffff,0xfffffe98,
0x4c003fff,0xfffffebf,0x7c40000f,0x204fffff,0x3ffffffd,0xffff3000,
0x3ee00fff,0x106fffff,0x3ff200df,0xfff1007f,0xfb809fff,0xffdaffff,
0x000006ff,0xdffffffb,0x3fffa000,0xfffff105,0x7fffc09f,0x00004fff,
0x7ffd4000,0x7fe41fff,0x000fffff,0xffffff10,0x0005f909,0xfff77d80,
0x80009fff,0xfd1001f9,0x0fffffff,0x3ffffe20,0x7fffcc4f,0x8000efff,
0x81fffffd,0x00fffffd,0x7fffffcc,0xd8910003,0xd81fffff,0x6c0fffff,
0xfffd5000,0xd8009fff,0xffffff77,0xff880009,0x3204ffff,0x04ffffff,
0xfffff500,0x7ff400df,0xfc82ffff,0xffff9001,0x3fffe200,0x7fdc04ff,
0xffffffff,0x400004ff,0xfffffffa,0xfffd0002,0x3fffe20b,0x3ff604ff,
0x0006ffff,0x7fd40000,0xfe81ffff,0x005fffff,0xffffff10,0x002ffa89,
0x7c53e200,0x007fffff,0x3000fcc0,0xffffffff,0x3fffe200,0xfffb84ff,
0x8005ffff,0x81fffffc,0x00fffffd,0x7fffffcc,0xc8970003,0xd81fffff,
0x6c0fffff,0x7ffec003,0x3e2006ff,0xffffff14,0xff88000f,0x2604ffff,
0x04ffffff,0xfffff700,0x7fd4005f,0x7cc6ffff,0x3fff2004,0xffff1007,
0xffb809ff,0xfffaffff,0x00001fff,0xfffffff1,0x7ff4000b,0xffff105f,
0x7fcc09ff,0x0007ffff,0x7fd40000,0xf881ffff,0x03ffffff,0xfffff880,
0xfffc98cf,0x3f200002,0x3fffff20,0x3e60003f,0x7ffd4001,0xf1007fff,
0x209fffff,0xfffffffc,0x7ffe4003,0xfffc81ff,0x7fcc00ff,0x0003ffff,
0xffffc89d,0xffffc81f,0x2002ec0f,0x06ffffe8,0xffc83f20,0x0003ffff,
0x3fffffe2,0x7fffec04,0xff90006f,0xd000dfff,0x47ffffff,0x3f2000fe,
0xff1007ff,0xb809ffff,0xf72fffff,0x000dffff,0x3fffff20,0x3a0000ff,
0xff105fff,0xe809ffff,0x00ffffff,0x2a000000,0x01ffffff,0xfffffff7,
0xfff88003,0xffffffff,0x100002ff,0xffff989f,0x260006ff,0xffc8001f,
0xf1007fff,0x409fffff,0xfffffffe,0x3fff2001,0xfffc81ff,0x7fcc00ff,
0x8003ffff,0x7ffe43f9,0xfffc81ff,0x007ec0ff,0x13fffe60,0x3e627c40,
0x006fffff,0x3ffffe20,0x7ffcc04f,0x44001fff,0x01ffffff,0xfffffa80,
0x002fa8ff,0x803fffe4,0x4ffffff8,0x7ffffdc0,0x3fffff61,0x7fcc0004,
0x003fffff,0x82ffff40,0x4ffffff8,0x7ffffdc0,0x0080004f,0xfffff500,
0x7ffec03f,0x44006fff,0xceffffff,0x002ffffe,0xfb03f700,0x005fffff,
0x40007e60,0x007ffffd,0x9ffffff1,0x7ffffc40,0xf9000fff,0xf903ffff,
0x9801ffff,0x03ffffff,0x7e42fd80,0xfc81ffff,0x7ec0ffff,0xffff8005,
0xb03f7002,0x05ffffff,0x3fffe200,0xffc804ff,0x5c005fff,0x005fffff,
0x3fffff60,0xc8006fcf,0xf1007fff,0x809fffff,0x21fffffb,0x2ffffff8,
0x3fffa000,0x80006fff,0xf105fffe,0x009fffff,0x0ffffffb,0x00058800,
0x3ffffff5,0x7ffffc40,0x3e2004ff,0x224fffff,0x00002ffe,0x3ffea0bd,
0x30005fff,0x3a20003f,0xf1007fff,0x80bfffff,0xfffffffa,0xfffc800e,
0xfffc81ff,0x7fcc00ff,0x4003ffff,0x7fe41ffb,0xffc81fff,0x7fec0fff,
0x7fffc002,0x2a0bd000,0x05ffffff,0xfffff100,0xffd1009f,0x74001fff,
0x000fffff,0x3ffffe60,0xc8001fff,0xf1007fff,0x809fffff,0x41fffffb,
0x0ffffffb,0xffffb800,0x80001fff,0xf105fffe,0x009fffff,0x9ffffff1,
0x01be2000,0x7ffffd40,0x7ffd402f,0x1002ffff,0x89ffffff,0x80002ff8,
0x3ffa02fa,0x8001ffff,0x220003fa,0xf1007fff,0x00bfffff,0xfffffff9,
0xffff900d,0xffff903f,0xfff9801f,0x2e004fff,0x7fe40fff,0xffc81fff,
0x7fec0fff,0xfff3001f,0x80bea005,0x1ffffffe,0xffff8800,0xfb1004ff,
0x2a009fff,0x000effff,0xfffffd80,0xff90005f,0x3fe200ff,0x5c04ffff,
0xd82fffff,0x005fffff,0x7fffffc4,0xfd00004f,0x3fe20bff,0x3004ffff,
0x07ffffff,0x001efa80,0xffffff70,0xffff9007,0xf1001fff,0x509fffff,
0xdd00005f,0xfffffb80,0x5fd8004f,0x3ffd4000,0xfffff980,0xfff8806f,
0x00dfffff,0x07fffff2,0x03fffff2,0xffffff50,0xffc9801d,0xffffc87f,
0xffffc81f,0x7fffec0f,0x04ffe803,0xff701ba0,0x0009ffff,0x9ffffff1,
0xffffc800,0x7fffd404,0xf100000e,0x009fffff,0x01ffff20,0x7fffffc4,
0x7fffe404,0xffff982f,0x3f6003ff,0x00ffffff,0xfffe8040,0xfffff105,
0x7ec4009f,0x200cffff,0x0005fd98,0x3fffffe6,0xffe801ff,0x402effff,
0x4ffffff8,0x40002f88,0xcccccef9,0xfffffdcc,0x3ee000ff,0x20001cff,
0xfe8807fb,0x03ffffff,0x7fffffcc,0xc80aefff,0xc81fffff,0x200fffff,
0xfffffff9,0xdcccccef,0x87ffffff,0x81fffffc,0x40fffffc,0xaefffffd,
0x01fff4c0,0x9999df30,0xffffb999,0x88001fff,0x04ffffff,0xdfffeb80,
0xfff9510a,0x8800009f,0x04ffffff,0x0ffff900,0x3ffffe20,0x3ffa604f,
0xfe80dfff,0x802fffff,0xfffffffa,0xe81dc002,0xff105fff,0x0009ffff,
0xbffffff7,0xfffd9559,0xffd10005,0xffffffff,0x3e601dff,0x7fffffff,
0x3ffffe20,0x5c05d04f,0x7fffec02,0xffffffff,0x403fffff,0xffffffea,
0xfb0003ef,0x7ffff740,0xefffffff,0x3ffffe20,0xffffffff,0x7fffe42f,
0xffffc81f,0x7fff440f,0xffffffff,0xffffffff,0xfc86ffff,0xfc81ffff,
0x76c0ffff,0xefffca88,0x000dfffe,0x7fffffec,0xffffffff,0x44003fff,
0x04ffffff,0x3fff2600,0xaeffffff,0xf8800000,0x004fffff,0x00ffff90,
0x3fffffe2,0xfffff704,0x7f45ffff,0x6fffffff,0x3ffffa20,0x2d8005ff,
0x20bfffd0,0x4ffffff8,0xffb51000,0xffffffff,0x0000001b,0x44000000,
0x04ffffff,0x100fc059,0x3fe2007f,0x0007ffff,0x00480000,0x00000000,
0x07fffff2,0x03fffff2,0x40000000,0x81fffffc,0x40fffffc,0x7dd7500b,
0x7f100013,0x3fffe200,0x7c4007ff,0x004fffff,0xffffe880,0x000003ff,
0x7fffffc4,0xfff90004,0x3ffe200f,0x00004fff,0x3ff20000,0x000fffff,
0xffe80fc4,0xffff105f,0x100009ff,0x357bf753,0x20000000,0x0000adec,
0x7ffffc40,0x07a8004f,0xfb0007e4,0x005fffff,0x16774400,0x6c000000,
0x00000ace,0x07ffffee,0x03fffff2,0x1bde9800,0x3ffee000,0xfffc81ff,
0x7cc000ff,0x3f20000d,0x3fff6000,0x22002fff,0x04ffffff,0xffff3000,
0x00000dff,0xffffff88,0xfff90004,0x3ffe200f,0x70004fff,0x800017bd,
0xfffffff9,0x00fc8003,0x220bfffd,0x04ffffff,0x01fe4000,0x6c000000,
0x00007fff,0x7fffffc4,0x207e8004,0x7cc004f8,0x006fffff,0x3fffe200,
0x40000004,0x0005fffe,0x3ffffee0,0x7ffff441,0x3e60000f,0x70002fff,
0x883fffff,0x00fffffe,0x00ffff40,0x20027c40,0x6ffffff9,0x3fffe200,
0x200004ff,0x3ffffffc,0x3e200000,0x004fffff,0x00ffff90,0x3fffffe2,
0xfff90004,0x7f40001f,0x006fffff,0x3fa07f98,0xfff105ff,0x00009fff,
0x0037ffd4,0x32600000,0x00002fff,0x3fffffe6,0x02fec004,0xfd0005f9,
0x005fffff,0x3fff5400,0x2a000000,0x0000fffd,0x7fffff30,0xffffffe8,
0x3ae20000,0xf30006ff,0xfe87ffff,0x000fffff,0x017ffee2,0x2000bf20,
0x2ffffffe,0xfffff300,0x4400009f,0x2ffffffe,0xff100000,0x000bffff,
0x401ffff2,0x4ffffff9,0xfff93000,0x3fee0007,0x001fffff,0xfd03ff44,
0x3fe60bff,0x0004ffff,0x07fff660,0x20000000,0x00004fff,0x3fffffe6,
0x9ffb1004,0x0003fe20,0x3fffffee,0x7d400006,0x000001ff,0x017ffc40,
0xffffd000,0xffdfd55f,0x00003fff,0x4000fff7,0xaafffffe,0xfffffefe,
0x6ffd8001,0x007fc400,0x7ffffdc0,0xfff3006f,0x00009fff,0xfffffe88,
0x400000bf,0x5ffffff8,0xffff9000,0xffff3001,0xe80009ff,0xf88005ff,
0x04ffffff,0x037ffcc0,0x260bffff,0x04ffffff,0x7ffc4000,0x00000002,
0x0017ffcc,0xfffff500,0x7dc401df,0xffd03fff,0xfff10003,0x0007ffff,
0x003ffe40,0x7fd40000,0x2600001f,0xefffffff,0xcfffffc9,0x7fec0000,
0x3fe60006,0xc9efffff,0x00cfffff,0x001fff40,0x20007ffa,0xfffffff8,
0xffffa803,0x000005ff,0xfffffffb,0x00053559,0x7fffffcc,0xfff90006,
0xfff5001f,0x4000bfff,0x8003fff8,0xfffffffd,0xfffb3000,0x3ffe20bf,
0xffff505f,0x80000bff,0x0000fffa,0xfd710000,0x440000bf,0xfffffffe,
0xfedcccde,0x542fffff,0x000dfffe,0x7fffffdc,0x4c0002ff,0x0002fffb,
0x3fee6000,0xa800003f,0x90dffffe,0x3fffffff,0xffca8800,0x7540001f,
0xf90dffff,0x03ffffff,0x01dff930,0x37fffaa0,0x7ffdc000,0x202fffff,
0xffffffe8,0x3000002f,0xfffffff9,0x22000fff,0xfffffffe,0xfffc8003,
0x3fa201df,0x02ffffff,0x2fff5440,0x7fffd400,0xccccefff,0xfffecccc,
0xd984ffff,0xe885ffff,0x2fffffff,0xfea88000,0x0000003f,0x05bdff50,
0xfffd1000,0xffffffff,0xffffffff,0x7e43ffff,0x3effffff,0x3ffffaa0,
0xffffffff,0xeefd8000,0x0000000c,0x0073bbf2,0x15730000,0xff800000,
0x00000bde,0x00002ae6,0x03deff88,0x3fffff20,0x3aa03eff,0xffffffff,
0xfd10ffff,0xffffffff,0x0005dfff,0x79953100,0xeb800135,0xfffffffe,
0x00eeffff,0xeeeeeeb8,0xffffd14e,0xffffffff,0xeff9805d,0xffd0002d,
0xffffffff,0xffffffff,0x47ffffff,0xeeeeeeeb,0xfffffd14,0xdfffffff,
0xddf70005,0x00000039,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x000bb660,0x32a62000,0x2e01cccd,0x1b200001,0x00726000,0x00000000,
0x32200000,0xcccccccc,0x0000cccc,0x99999950,0x05999999,0x33326000,
0xcccccccc,0x664c004c,0xcccccccc,0x993003cc,0x99999999,0xaa800799,
0xaaaaaaaa,0x00000aaa,0x00000000,0x00040000,0x00000274,0xccb98000,
0xea80001b,0x01c9801e,0x32201a88,0x00003ccc,0xff980000,0x800004ff,
0xfffffed9,0x22dfffff,0x200001f9,0x3a60003f,0x0002efff,0x80000000,
0x22000cc9,0xffffffff,0x000fffff,0xfffff900,0xbfffffff,0x3fea0000,
0xffffffff,0x7d4007ff,0xffffffff,0xf7006fff,0xffffffff,0xe800dfff,
0xffffffff,0x0002ffff,0xdd700000,0x2ea20001,0x401abcdc,0xfb73007d,
0x000159bf,0x7c4bfff6,0x7ec406ff,0x004ffcbf,0x4017fe20,0x3a601ff8,
0x3fff201f,0x7cc001ff,0x0004ffff,0x0fffff90,0xfffc8000,0x2e621bdf,
0x1ffeffff,0x01f50000,0xd9977400,0x00000007,0x7ffc4000,0xfff1000f,
0xffffffff,0x200001ff,0xfffffffc,0x005fffff,0xfffff500,0xffffffff,
0xffffa800,0xffffffff,0xffff7006,0xffffffff,0xfffe800d,0xffffffff,
0x0000002f,0x0ffff980,0xfffd7100,0x7fffffff,0x5c03fc81,0xfeefdfff,
0x22001dff,0x3fee4fff,0x3ffa201f,0x001bffa5,0x70007fec,0x9ff505ff,
0x7ffffc40,0x7fe4006f,0x200004ff,0x00fffffd,0xfffe9800,0xffc8803f,
0x00001fff,0x7cc000bb,0x0001fc41,0x30000000,0x2005ffff,0xeeeeeee8,
0x00eeeeee,0xdddd7000,0xdddddddd,0x3a600009,0xeeeeeeee,0x54005eee,
0xeeeeeeee,0x5005eeee,0xdddddddd,0x8009dddd,0xfffffffe,0x002fffff,
0x06aaa600,0x0ffffcc0,0x6ffffdc0,0x3fff260a,0x4409f73f,0x557e2ffe,
0x5005fffe,0x3ffd8dff,0x917ffec0,0xa8009fff,0xfe8003ff,0x03ffee3f,
0xffffffd8,0x3ffe002f,0x4c00004f,0x0004ffff,0x3fffffc8,0x7fffcc00,
0x2f880001,0x6c1f2000,0x00000006,0x7fff4000,0x00000002,0x00000000,
0x00000000,0x00000000,0x00000000,0xfd970000,0xbdfffdff,0x0fffec05,
0x9ffffb10,0xfffff980,0x1fff405f,0x0dffb17e,0xf887ff60,0x7ffd406f,
0x3fffee1f,0x0bff1001,0x37ffea00,0x2603fffd,0xffe9dfff,0xbfff3006,
0x3aa00000,0x5c0000cf,0x003fffff,0x003fff30,0x8000d900,0x027c40fa,
0x00000000,0x003ffa20,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x5bfffd30,0x3fff6a21,0x04fe80be,0x13ffffe2,0x7ffffd40,
0x03ffee01,0x00dfd0bf,0xffa87ff1,0x7fffe400,0x0ffffea0,0x0007fec0,
0xffffffd0,0x24ffe80d,0xc802ffe8,0x000005ff,0xff100000,0x8000ffff,
0x80001ffa,0xdf80004e,0x40003f20,0x99999999,0x80999999,0x99999998,
0x01efb999,0x0d554c00,0x26666000,0x99999999,0x99988099,0x00199999,
0x30000380,0x33333333,0x4c133333,0x99999999,0x99999999,0x00999999,
0x5c41dea8,0xfc8000ce,0x7cc04fff,0xdcceffff,0x7fff404f,0x3fa000ff,
0x3fe06fff,0x4c2fc1ff,0x86fa806f,0xffe803fd,0x3ffea0ff,0x3ffa804f,
0x7ffd4000,0x3ea02fff,0x00dfb03f,0x00000bff,0x7ec00000,0x0004ffff,
0x40001fd8,0xb80000fa,0x004ffdff,0x3ffffb60,0xdeffffff,0xffffec81,
0x01acceff,0xfffdb700,0x17dffffd,0x7fff6c00,0xefffffff,0xfffec81d,
0x0004efff,0x200007cc,0xfffffec8,0x2defffff,0xfffffd91,0xffffffff,
0xffffffff,0xffffa805,0x01bfff20,0x4ffffe88,0xfffff300,0xfc80155b,
0x4005ffff,0x84fffffa,0x7c4ffff8,0xfb00db05,0xf005f881,0x7d41ffff,
0x7c406fff,0xfd00005f,0xfe80bfff,0x301fe401,0x266000df,0x99999999,
0x99999999,0x70099999,0x03ffffff,0x003f3000,0x377765cc,0xbfb10000,
0x3a200003,0x1fffffff,0x1fffd100,0xffd30000,0x36a217bf,0x4002ffff,
0xffffffe8,0xffd1000e,0x3600001f,0x2200004f,0xfffffffe,0x7fff4402,
0xccccefff,0xfffffecc,0x7fffec02,0x07ffffe3,0x37fffec0,0x3ffff600,
0xfffa800f,0x6c001fff,0x41ffffff,0x22fffffa,0x000d505f,0x7fffc000,
0x3fffea0f,0x007fe405,0xaaaa9800,0x40026200,0x0006202a,0x7ffff644,
0xffffffff,0xffffffff,0xffff882f,0x200006ff,0xbffb001e,0x001dfffd,
0x0013f600,0xfffff700,0xff88009f,0xffc80002,0x7fcc04ff,0x2e000dff,
0x03ffffff,0x0017fc40,0x00fff880,0x3ffea000,0xf5005fff,0x809fffff,
0x402fffea,0x3a2ffffc,0xb800ffff,0x003fffff,0x27ffffcc,0x7fffff40,
0x7f7e4006,0x7c46ffff,0xbf3fffff,0x00000040,0x43ffffd0,0x204ffffa,
0x00003ffa,0x00000000,0xfe880000,0xccefffff,0xfffecccc,0xfffa82ff,
0x00004fff,0x3ffa2002,0x0bffff63,0x1fff1000,0x7fd40000,0x8003ffff,
0x220000ff,0x006ffffe,0x03fffff3,0x3ffffea0,0x0ff8003f,0xfff90000,
0x7cc00007,0x004fffff,0x9ffffff3,0x00bff200,0xfa8dfff1,0xff8804ff,
0x8001ffff,0x02fffffe,0x3fffffe6,0x2f3ee005,0x43ffffff,0xdfffffff,
0x5553005f,0x54c15555,0x902aaaaa,0x7dc3ffff,0xff102fff,0x6440000b,
0x0b51bded,0x8def6e44,0x3b72205a,0x400b51bd,0x4ffffffa,0x17fff540,
0x7fffffdc,0x20000004,0x7f46fff8,0x40005fff,0x0003fffc,0x3ffffea0,
0x07e8002f,0x7fffec00,0x3ff6000e,0xfa800fff,0x002fffff,0x100007e8,
0x000dffff,0x7ffffcc0,0xfff3004f,0x6c009fff,0x2035002f,0xffd000a8,
0x2000dfff,0x0ffffffc,0xffffff90,0x557ea009,0x44ffffff,0xfffffffb,
0xffd5005f,0x7543ffff,0x80ffffff,0x322ffff9,0x3f206fff,0xf500000f,
0xffffdbff,0x37ffea0b,0x505ffffe,0xfffdbfff,0x7fcc00bf,0x9004ffff,
0xfffb05ff,0x00007fff,0x1fffe400,0x1ffffff3,0x3ffe2000,0x2a00006f,
0x02ffffff,0x20007d80,0x03fffffb,0x7ffffcc0,0xffffa805,0x7d8002ff,
0xfff70000,0x200005ff,0x4ffffff8,0xfffff100,0x17cc009f,0x2a000000,
0x04ffffff,0xfffff700,0x3fffa07f,0xf9803fff,0x3ffffe26,0xffffe86f,
0x000dffff,0x03fffffd,0x01ffffff,0xfd8ffff2,0x7ff501ff,0x3fe20000,
0x17ff262f,0xc98bffe2,0xfff885ff,0x017ff262,0xffffff98,0x20bf6004,
0x2ffffffe,0xf1000000,0x77645fff,0x0000ffff,0x05fffff7,0x3ffea000,
0xd8002fff,0xfff10007,0xd0003fff,0x805fffff,0x2ffffffa,0x0007d800,
0xdfffffd0,0x3fe20000,0x1004ffff,0x09ffffff,0x530ba06a,0x41555555,
0x2aaaaaa9,0xffffff70,0x3fe60007,0xff05ffff,0x805fffff,0x3fe20ef8,
0xe887ffff,0xffffffff,0xfffd802f,0xfffd81ff,0x3ff600ff,0x207fff16,
0x00005fe8,0x7e41fff6,0x907ffd86,0x0fffb0df,0xf8801bf2,0x004fffff,
0xfff10be6,0x0003ffff,0x3fff2000,0x3feafe1f,0x3fa0005f,0x0006ffff,
0xffffff50,0x00fb0005,0x3fffffa0,0xfff90007,0x7d401fff,0x002fffff,
0xa80007d8,0x1fffffff,0xfff88000,0xf1004fff,0x209fffff,0x7542c82d,
0x21ffffff,0xffffffea,0xfffffd80,0xff10002f,0xf10dffff,0x05ffffff,
0x3e207f44,0x00ffffff,0xfffffffb,0x7e401bff,0xfd81ffff,0x5400ffff,
0x00dffefe,0x00003ff2,0xd02ffff8,0x05ffff0d,0x3fffe1ba,0x4400dd02,
0x04ffffff,0xf985d035,0x01ffffff,0xffd00000,0x443ea3ff,0x3ea0001b,
0x01ffffff,0xffffa800,0x7d8002ff,0xffffa800,0xf70004ff,0x407fffff,
0x2ffffffa,0x0007d800,0xffffffe8,0xf880005f,0x004fffff,0x9ffffff1,
0x40220ba0,0x81fffffe,0x80ffffff,0x2ffffffe,0xffff1000,0xfff30fff,
0x7403ffff,0xfffff01f,0x7fdc05ff,0xefffffff,0xfffff900,0xfffff903,
0x4004c001,0x2e603ffa,0xf301bded,0xd505ffff,0x2fffff98,0x7ffcc6a8,
0x006a82ff,0x3fffffe2,0x05905b04,0x5fffffff,0x3e000000,0x0bb2ffff,
0xfffe8000,0x0005ffff,0xffffffa8,0x007d8002,0xffffffb8,0xfff30003,
0x7d40bfff,0x002fffff,0x4c0007d8,0xfffffebf,0x7c40000f,0x004fffff,
0x9ffffff1,0xd8005f10,0xd81fffff,0x440fffff,0x1fffffff,0xffff1000,
0xff983fff,0xb01fffff,0x7fffc05f,0x74402fff,0xffffffff,0xffffc80f,
0xffffc81f,0x4400000f,0x3fee05fe,0x983ffd9e,0x84ffffff,0x7ffffcc3,
0x7fcc384f,0x0384ffff,0x3ffffe20,0x1105d04f,0xffffffd0,0xdddd1007,
0xdddddddd,0x3fffe27d,0x0002f8bf,0x3ffafe60,0x0000ffff,0x7fffffd4,
0x007d8002,0xffffffd8,0xfff10002,0x7d40dfff,0x002fffff,0x6c0007d8,
0xffffff77,0xff880009,0x1004ffff,0x09ffffff,0xfc8005f9,0xfd81ffff,
0x7cc0ffff,0x01ffffff,0x3ffffe00,0xffff82ff,0x3fc81fff,0x3ffffe20,
0xff7001ff,0x09ffffff,0x03fffff9,0x01fffff9,0x0ffc8000,0x263fff90,
0xfff84fff,0x401effff,0xefffffff,0x7ffffc01,0x10001eff,0x09ffffff,
0x7e4005f1,0x003fffff,0x3fffff22,0x3e61bfff,0x07bcffff,0xfbbec000,
0x004fffff,0x7ffffd40,0x07d8002f,0xfffffe80,0xff10002f,0x540fffff,
0x02ffffff,0x20007d80,0xffff14f8,0x88000fff,0x04ffffff,0xffffff10,
0x002ffa89,0x0fffffe4,0x07ffffe4,0x3fffffe6,0x3fe0000f,0xe82fffff,
0x42ffffff,0x7fc404fb,0x000fffff,0x3ffffffe,0x7ffe41ff,0xfffc81ff,
0x200000ff,0xff303ffa,0x2ffff8ff,0x7fffffe4,0x3ff202ff,0x02ffffff,
0x3ffffff2,0xf88002ff,0xc84fffff,0x3fee002f,0x8004ffff,0x3ffffffd,
0xefffff88,0x2200004e,0xfffff14f,0xfa8000ff,0x002fffff,0x7c4007d8,
0x01ffffff,0xfffff100,0x3fea03ff,0x8002ffff,0x3f20007d,0x3fffff20,
0x3e20003f,0x004fffff,0x9ffffff1,0x05fff931,0xfffffc80,0xfffffc81,
0x7ffffc40,0x3e0001ff,0x81ffffff,0x3ffffffc,0x3e2017ea,0x007fffff,
0x7fffeefc,0x7ffe43ff,0xfffc81ff,0x100000ff,0x7ff40dfd,0x37fff46f,
0x3fffffe2,0xff104fff,0x9fffffff,0x3ffffe20,0x4004ffff,0x4ffffff8,
0x30017fd4,0x0bffffff,0xfffff700,0x3fffe05f,0x00001fff,0xfffc83f2,
0x20003fff,0x2ffffffa,0x4007d800,0xfffffff9,0x3ffe0001,0xf502ffff,
0x005fffff,0x22000fb0,0x7fffcc4f,0x220006ff,0x04ffffff,0xffffff10,
0x5fffffff,0xffffc800,0xffffc81f,0xfffff80f,0xf10002ff,0x01ffffff,
0x9ffffff7,0x26003be6,0x05ffffff,0xfffdafc0,0x7ffe45ff,0xfffc81ff,
0x900000ff,0x3fe201ff,0x7ffec6ff,0x7fff440f,0x104fffff,0xfffffffd,
0x3ffa209f,0x04ffffff,0x3ffffe20,0xfffc98cf,0x7ffec002,0x5c000fff,
0x01ffffff,0x0dfffffb,0x227c4000,0x6ffffff9,0x3ffea000,0xd8002fff,
0x7ffcc007,0x0000ffff,0x3ffffffe,0xfffff502,0x0fb0005f,0x3607ee00,
0x02ffffff,0xfffff100,0x3fe2009f,0xfeceffff,0x64002fff,0xc81fffff,
0xd80fffff,0x03ffffff,0xfffff100,0x3ffe60ff,0x0fe8dfff,0xfffff700,
0x3e00b85f,0x1bffff65,0x03fffff9,0x01fffff9,0x07ff3000,0x22ffffcc,
0x882ffffd,0xfffffffd,0xfffb100f,0x201fffff,0xffffffd8,0xff1000ff,
0xffffffff,0x88005fff,0x03ffffff,0x7ffffdc0,0xffff901f,0x200001ff,
0xfffd81fb,0x50002fff,0x05ffffff,0x8800fb00,0x1fffffff,0x3fffe000,
0xff501fff,0x0005ffff,0x17a000fb,0x7fffffd4,0xfff10005,0x22009fff,
0x24ffffff,0x4002ffe8,0x81fffffc,0x80fffffc,0x4ffffffc,0xffff3000,
0x7fec0bff,0x01feefff,0x3fffff60,0x97e02e86,0x645ffffa,0xc81fffff,
0x000fffff,0x2037f440,0x6c5ffffa,0x2e03ffff,0x3fffffff,0x7ffffdc0,
0x7fdc03ff,0x003fffff,0xdffffff1,0x05ffffd9,0xfffff500,0xfffb800d,
0xff301fff,0x540dffff,0x2a0bd004,0x05ffffff,0xfffff500,0x0fb0005f,
0xffffff00,0x3e20005f,0x00ffffff,0x5ffffff5,0x000fb000,0x7ff405f5,
0x8001ffff,0x4ffffff8,0xfffff100,0x02ff889f,0x7ffffe40,0xfffffc81,
0xfffff980,0xff70004f,0x4405ffff,0x2fffffff,0x7ffffc00,0x3e05e83f,
0x21ffffc5,0x81fffffc,0x00fffffc,0x007fe400,0xb1bfffe6,0x40c5ffff,
0x5fffffe9,0x7fff4c0c,0x74c0c5ff,0x005fffff,0x9ffffff1,0x0017ff44,
0x2fffffc8,0x3fffee00,0x3fee01ff,0x221dffff,0x2fa800fb,0x3fffffa0,
0xffa8001f,0x8002ffff,0xffd8006e,0x0003ffff,0xfffffff1,0x7ffffd40,
0x06e8002f,0x7dc06e80,0x004fffff,0xffffff88,0xffff1004,0x05f509ff,
0xfffffc80,0xfffffc81,0xfffffb00,0x3ff6000d,0xfa806fff,0x4004ffff,
0x05fffffa,0xf17e01fd,0xffb83fff,0xffc81fff,0x20000fff,0xf8803ff9,
0x7fec6fff,0x2203e0ff,0x7c6ffffd,0xffffd880,0x7ec407c6,0xf1006fff,
0x889fffff,0x360002ff,0x001fffff,0x3ffffff7,0xfffffd80,0x03ffefff,
0xffb80dd0,0x8004ffff,0x2ffffffa,0x8006e800,0x4ffffffc,0xffff3000,
0x7fd40bff,0x8002ffff,0x77cc006e,0xdccccccc,0x0fffffff,0x7fffc400,
0xff1004ff,0xf109ffff,0xfffc8005,0xfffc81ff,0xfff100ff,0xd0003fff,
0x005fffff,0x03fffff2,0xeffffe80,0x3e0bfd00,0x213ffe65,0x41fffffb,
0x0fffffe8,0x01bfa000,0x6c6fffe8,0x01fc7fff,0x3f89ffff,0xf13fffe0,
0x27fffc07,0xfffff880,0x002fa84f,0x7ffffd40,0xffffb802,0x7fc401ff,
0xffffffff,0x99df3003,0xffb99999,0x001fffff,0xffffff98,0x006f8002,
0xffffff98,0xfff70004,0x7cc05fff,0x002fffff,0x7ec006f8,0xffffffff,
0xffffffff,0x7ffc4003,0xf1004fff,0x209fffff,0xf90ae02e,0xf903ffff,
0x6401ffff,0x005fffff,0x2fffffd4,0xfffff100,0x3ffee009,0x3ffa01ff,
0x3ff65f85,0xffff980e,0x7ffff43f,0xf90000ff,0x7fd4001f,0x17fffc7f,
0x7fe407fe,0xc80ffc2f,0x0ffc2fff,0x002fffc8,0x9ffffff1,0x00005f10,
0x7bffffb1,0x3fb2a213,0x800befff,0xffffffef,0x3ff6001d,0xffffffff,
0x3fffffff,0x7fffcc00,0x5f8003ff,0xffffb000,0x3f6000df,0x4c06ffff,
0x03ffffff,0x22005f80,0xfff1003f,0x8800ffff,0x04ffffff,0xffffff10,
0x1f80b209,0x0fffffdc,0x07ffffe4,0xfffffd10,0x7ffec001,0x3e6000ff,
0x403fffff,0x00dffffa,0x5677fff4,0xdffeadf8,0x3ffffa00,0xffefeaaf,
0x98001fff,0xfd8003ff,0xbfff11ff,0xfb03ffd0,0x1ffe81df,0x740effd8,
0xeffd81ff,0xffff1000,0x80ba09ff,0x3b26002b,0xffffffff,0x000befff,
0x55dcc3ea,0x01fc4000,0xffffff88,0x7ffc4007,0x4c003fff,0xff10003f,
0x0003ffff,0x05fffffd,0xffffff88,0x01fcc003,0x6c001f90,0x02ffffff,
0x3ffffe20,0xfff1004f,0x50009fff,0xfffff70f,0xffffe883,0x7ff4400f,
0xff5004ff,0x44003fff,0xfffea8ef,0x3ff261be,0xb71003ff,0xffffffff,
0xff3005bf,0x93dfffff,0x019fffff,0x0006fe80,0xfb1bffb1,0xfffd01bf,
0x1fff715b,0x15bfffd0,0xfd01fff7,0xff715bff,0x7fc4001f,0x5904ffff,
0x30000fc0,0x33559bf7,0x002ec000,0x4001f900,0x2ffffffd,0x7ffff400,
0x17dc005f,0xffff9000,0xffa800bf,0xfd005fff,0x800bffff,0x9f1002fc,
0xffff9800,0x3e2006ff,0x004fffff,0x9ffffff1,0xf30fd000,0xfe87ffff,
0x800fffff,0x04ffffe8,0x0f7fffd4,0x981dd100,0xfffffffd,0x20002dff,
0x1efcaa98,0xfffea800,0xffff90df,0x32003fff,0x540001ff,0x202dfffd,
0xffffeced,0xd9db01ef,0x03dfffff,0x3fffb3b6,0x44001eff,0x04ffffff,
0x80007a80,0x00000cfa,0x200005f1,0x7cc004f8,0x006fffff,0x3fffffdc,
0x000df300,0xfffffe88,0x3fffa000,0xff7000ff,0x4c00dfff,0x0bf2006f,
0x3ffffa00,0xff3002ff,0x2009ffff,0x4ffffff9,0xe82fec00,0xeaafffff,
0x1fffffef,0x3fffee00,0x3ff660ad,0xfd8004ff,0x665d4c01,0x0000009a,
0xb98000bf,0x3000000a,0x08000013,0x5d441700,0x5105c00a,0x20b80157,
0x0000aba8,0x9ffffff1,0x000fd000,0x00ffff88,0x0007b800,0x2000bf20,
0x2ffffffe,0x3fffe200,0xff8805ff,0xfe880002,0xf5004fff,0x4003ffff,
0x5ffffff8,0x002ff880,0x70001ff1,0x0dffffff,0x3ffffe60,0xfff3004f,
0x22009fff,0xff304ffd,0x93dfffff,0x019fffff,0x7fff5c40,0xceffffff,
0x00310001,0x20000000,0x0000004e,0x00000000,0x00000000,0x00000000,
0x3ffffe60,0x2fec004f,0x3ff26000,0x4e80003f,0x1ff10000,0xffff7000,
0xf9800dff,0x00cfffff,0x00007fd3,0x27ffff44,0x3bfffea0,0xfff98001,
0xa880cfff,0x3fa003fe,0xff88001f,0x803fffff,0x5ffffffa,0xfffff500,
0x7dc401df,0x3aa03fff,0xf90dffff,0x03ffffff,0x99955100,0x00000357,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0xffffff98,
0x9ffb1004,0x3ffa0000,0x0fcc0004,0x1ffe8000,0xffff8800,0x4c003fff,
0xeffffffe,0x03fffdbc,0xfff70000,0x36e215bf,0x0004ffff,0x7fffff54,
0xfffebcef,0xfffd5003,0xffb8001b,0x02ffffff,0x3fffffa2,0x7f4402ff,
0xdeffffff,0xfffedccc,0xb9802fff,0x0000000a,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x80000000,0xeffffffa,0x3ffee200,
0xf980003f,0x640003ff,0xfea80006,0x5c000dff,0xffffffff,0xfffc8002,
0xcfffffff,0x44000000,0xffffffeb,0x001cefff,0x3ffff200,0x0cffffff,
0xfffff900,0x75407dff,0xffffffff,0xfd10ffff,0xffffffff,0x3a25dfff,
0xffffffff,0xffffffff,0x1fffffff,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x7fffff44,0xdcccdeff,
0x2ffffffe,0x3fae2000,0x2d80005f,0x7ffe4000,0x203effff,0xffffffea,
0x00ffffff,0xbccca980,0x0000009a,0xcccaa880,0x000001ab,0x55e6654c,
0x00000009,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x20000000,0xffffffe8,0xffffffff,
0xffffffff,0xff50001f,0x000005bd,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x40000000,0x0153003b,0x005e4c00,0x00000000,0x54c00ee0,0x33320000,
0x0000003c,0x001c8800,0x99950035,0x32e00019,0x00000ccc,0x00000000,
0x0015c400,0x000132e0,0x00000000,0x00000000,0x00000000,0x880005b5,
0x6440002b,0x332e002c,0x0000004c,0x2a801e40,0x53003b80,0x00dfa801,
0x4c0017ee,0x004ffffe,0x7fff4000,0xfa8000ff,0x01bee00e,0xfffffb80,
0xfe800002,0xbfff31ff,0xe880bfa0,0x7ffc402f,0xf98005ff,0x0004ffff,
0x0effffe8,0x0067fdc4,0x3ffffee0,0x1ffed402,0x07ff5000,0xbfffff30,
0x3ffe6000,0x800005ff,0x02fffffb,0x01dfda80,0x7fffff50,0x7ff54000,
0x6d4003ff,0x740003ff,0xff5000ef,0x00007fff,0x05fffff7,0x7e405fb8,
0x00dfa805,0x7f401bee,0x01ffd80e,0x3225db00,0x1000001f,0x003fffff,
0x64077f40,0xf10001ff,0x00dfffff,0x3fff9800,0x5403fff2,0x5ff983ff,
0xfffffd80,0x7ff4001f,0x0000ffff,0x03bfffe6,0x017ffff2,0x05ffffd0,
0x3fffff22,0xdff10003,0x7fffcc00,0x3fe60007,0x00000fff,0x017ffff4,
0x3ffffcc0,0xbffff700,0x98f74000,0x7e4400fd,0x0003ffff,0xe800bfee,
0x00ffffff,0x7ffff400,0x81bff002,0xd000ffd8,0x3ffb01df,0x47ffea00,
0x0004ffe8,0x00bd07f1,0x3ffee000,0x7cc0001f,0xbffb11ff,0x7ffe4000,
0x0002ffff,0xff17ff20,0x5ffd805f,0x3007ffea,0xbfffffff,0x7fffd400,
0x20004fff,0xf00ffffc,0x001fffff,0x80ffffe6,0x3fffd8a8,0x01ff9000,
0x2ffff980,0x3ffe6000,0x2600002f,0x0003ffff,0x05fffffb,0x07fffdc0,
0x220fcc00,0x6c54403f,0x10003fff,0x7dc009ff,0x03ffffff,0x3fffe200,
0x3bfee003,0x007ffd30,0xe88fffd4,0x7f4004ff,0x0ffffbff,0x901f7000,
0x3a00000f,0x00001fff,0xffd7fffb,0x3e60001f,0x6ffe9eff,0x3ffa0000,
0x2017fe60,0xffcdfff9,0xfffe804f,0x801fffca,0xfd9efff8,0xfd0000ff,
0x3fe203ff,0x7001ffff,0x5c007fff,0xa8003fff,0xf50003ff,0xa8000bff,
0x00005fff,0x000fffee,0x4fffffe8,0x1fffe400,0x6d83e400,0x0fffee00,
0x0077f400,0xe9efff88,0x70000fff,0xd0007fff,0xffff7fff,0x7fffd000,
0x8001ffff,0xfffffff9,0x0be20003,0x2000017a,0x0001fff8,0x3ffffe60,
0x360004ff,0x3ffa24ff,0xff980002,0x80077e42,0xfffffffd,0x0f7fd400,
0xf900dff7,0x27fe41df,0x0fffcc00,0x1bffff60,0x003ffe80,0x001fffdc,
0x0001bfa2,0x0000fff5,0x0001fff5,0x000fffa0,0x1fffff70,0x0bff9000,
0xf883f500,0x3ffee003,0x2ffb8003,0x837ff200,0xd0004ffd,0x2a0009ff,
0x2fffffff,0xffff9800,0xb0003fff,0x00dfffff,0x7dc3db00,0xfb800001,
0xd800002f,0x00ffffff,0x207ff500,0xc80006fd,0x001fe84f,0x3fffffe6,
0x80dfe803,0x3e202ffa,0x03ff704f,0x801ffc80,0x002ffff9,0x70009ff3,
0xc8007fff,0xa80000ff,0xa80002ff,0x980002ff,0x880004ff,0x0004fffd,
0x20003ff2,0x01f910df,0x01fffdc0,0x8013fe20,0xff904ff9,0x4ff88001,
0x7fff4000,0x360006ff,0x006fffff,0x3ffffe60,0xff980002,0x00005ffe,
0x00005fd0,0x3ffffe20,0x07fa0003,0x80007f90,0x027cc0ee,0x37fffec0,
0x26027dc0,0x00ff606f,0xfe800bf5,0x00154001,0x5c0013ee,0x2a003fff,
0x200003ff,0x700005fb,0xf70000bf,0xa8800009,0x3fd80000,0xfeffb800,
0x7fdc004f,0x7ff4003f,0x00bf6000,0xfb8009f7,0xffa80004,0x20001fff,
0x02fffff9,0x15555400,0x336a0000,0x26000001,0x54000000,0x40002aaa,
0x00550009,0x10000000,0x10035555,0x402a2003,0x00530009,0x00000098,
0x5c000310,0xd1003fff,0x100000df,0x0c400001,0x000c4000,0x40000000,
0xb7100009,0xff700017,0x7fdc007f,0x8004c002,0x00c40029,0x55555000,
0x55550000,0x00000005,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x07fff700,0x0007ff20,0x00000000,
0x00000000,0x00000000,0x2e000000,0xf1003fff,0x0000009f,0x00400000,
0x00000000,0x2aaaaa60,0x2aaa60aa,0xaa982aaa,0x260aaaaa,0x02aaaaaa,
0x337fb2e0,0x77edc40a,0xdb98002c,0xa980bdee,0x2aaaaaaa,0x2aaaaaaa,
0x2aaa62aa,0x6dd400aa,0x50000ade,0x0017bdb7,0xbdeedb98,0x3b6ea000,
0x730000ad,0x8017bddb,0x36ea0018,0x2e000ade,0xf9803fff,0x7500003f,
0x00015bdb,0x9dfdb751,0xb7510003,0x00039dfd,0x5d400050,0x2000bded,
0xcefedba8,0x3ffee001,0x01ffb003,0xbdb75000,0xb7300017,0x74417bdd,
0x3b6ea204,0x50001cef,0x8015bdb7,0xffffffea,0x3ffffaa1,0x7ff540ff,
0x3aa1ffff,0x00ffffff,0x7fefffdc,0xdff51fff,0x001bfff9,0xffbbffb1,
0xfffa85ff,0x323effff,0xdfffffff,0x37fff662,0x9fffd100,0x2007dffb,
0xffbdffd8,0xffd8801f,0x02ffffdd,0x6e7fff44,0xb1003eff,0xffffbbff,
0x4402dc05,0xffdcfffe,0xfffb803e,0x037f4403,0x7fff4400,0x003effdc,
0xffdbdff5,0x7d400bff,0xffffedef,0x01e20005,0x2f7ff620,0xfa801fff,
0xffffedef,0x7fff7005,0x005ff700,0xbdffd880,0xb1001fff,0xfffb9fff,
0x7d40dd17,0xffffedef,0x3ffa2005,0x03effdcf,0x0ffffff4,0x07fffffc,
0x1fffffe8,0x0ffffff8,0xb83ffd10,0x5ffdffff,0x803fff62,0x3f63ffe8,
0x7fc42fff,0xfa83ffff,0xb00fffff,0x7ffcc07f,0x13fff20d,0x4c5fff30,
0x3a203fff,0x3fff63ff,0xbfff302f,0x027ffe41,0xfd8fffa2,0x0db02fff,
0x20dfff98,0x6404fffc,0x7e404fff,0x7cc0001f,0x3ff20dff,0x3ff6204f,
0x27fffe41,0x907ff620,0x0009ffff,0xff3001aa,0x1fffcc5f,0x641ffd88,
0xc804ffff,0x7c404fff,0x7cc0005f,0x3ffe62ff,0x7fff4403,0x3bfffea0,
0x41ffd880,0x804ffffc,0x320dfff9,0x3f604fff,0xfd81ffff,0xfb00ffff,
0xfb03ffff,0x3a01ffff,0xfff905ff,0xff981fff,0xdffd105f,0x87ffffa8,
0x05fffffa,0x05fffffd,0xfff981b6,0x7fffc41f,0x0dfff103,0xd101fffb,
0xfffa8dff,0xffff987f,0x1ffffc41,0x546ffe88,0xfd07ffff,0x0ffffcc0,
0x80ffffe2,0x2604fffc,0x4c0003ff,0x7c41ffff,0xffb03fff,0x3ffffe0d,
0x41bff602,0x002fffff,0x3e2006c8,0xfffd86ff,0xf06ffd80,0xc805ffff,
0x7ec04fff,0x3e20000f,0xfffd86ff,0x7ffff100,0x20bfffb0,0xfff06ffd,
0x7fcc05ff,0x7ffc41ff,0xffff903f,0xffffb03f,0x3fff201f,0xfffd81ff,
0xfffa80ff,0xffffb82f,0x3fffd05f,0x887fff90,0xe80fffff,0xb80fffff,
0xf04fffff,0x3fffec07,0x81ffffd8,0xfb83fffc,0xfffc84ff,0x7ffffc43,
0x83fffec0,0xc81ffffd,0x7fc43fff,0x0ff80fff,0x20ffffb0,0x221ffffd,
0xcfffffca,0x0006fe82,0xb07fffd8,0xf983ffff,0xfff83fff,0xfff305ff,
0xfffff07f,0x04f9800b,0x20ffff20,0x7cc4fffb,0xfff83fff,0xfca885ff,
0xb82cffff,0x640002ff,0xffb83fff,0xffff904f,0x3ffff703,0x83ffff98,
0x205fffff,0xfb07fffd,0xff903fff,0xff903fff,0x3f201fff,0xfc81ffff,
0xfc80ffff,0xffa86fff,0xffb04fff,0xffff88bf,0x0ffffd82,0x3fffffb8,
0x7fffffd8,0xff300f98,0x3fee0dff,0x7ffcc4ff,0xffffa82f,0x0bfffe20,
0x983ffff6,0xf706ffff,0xff889fff,0xfffd82ff,0x417fc40f,0x706ffff9,
0x9989ffff,0x41999999,0xda881ffc,0xfff302de,0x3ffee0df,0x7fffe44f,
0x6ffffe86,0x0dffff90,0x00dffffd,0x98007fd4,0xfa82ffff,0x3ff20fff,
0xfffe86ff,0x3333306f,0xff883333,0x987fd005,0xfa82ffff,0x7fc40fff,
0xffb80fff,0x7ffe46ff,0xffffe86f,0xdffff306,0x13fffee0,0x07fffff2,
0x03fffff2,0x0fffffe4,0x07ffffe4,0x437fffcc,0x03fffffa,0xfc8ffffb,
0xffa81fff,0xffff104f,0xffef88df,0x02e42fff,0x20bffffd,0x6c6ffffb,
0xfa81ffff,0x3ff22fff,0xfffa81ff,0x2fffff44,0x46ffffb8,0xa81ffffc,
0xff984fff,0x5ffffe83,0x0dffff70,0x41ffcc00,0x5ffffffa,0x05ffffe8,
0xa8dffff7,0xfe86ffff,0xff506fff,0xfffd0dff,0x3ff200df,0x3fff6005,
0xffffa81f,0x1bfffea2,0x01bffffa,0x007fec00,0x3f61ffec,0xffa81fff,
0x7ffe42ff,0xffff987f,0x3ffea1ff,0xffffe86f,0xbffffd06,0x1bfffee0,
0x07fffff2,0x03fffff2,0x0fffffe4,0x07ffffe4,0xa81effd8,0x901fffff,
0x7fc1ffff,0x35101fff,0xfffffd80,0x3ffe7ae0,0xf01fc5ff,0x2a0bffff,
0x3a0fffff,0xf980ffff,0x3ffe3fff,0x035101ff,0x20bfffff,0x20fffffa,
0x101fffff,0x17fee035,0x417ffffe,0x00fffffa,0xf10dfd00,0x3fffffdf,
0x05fffff8,0x81fffff5,0xfe82fffc,0x3f206fff,0xfffe82ff,0x7ff4406f,
0x3ffa001f,0xfff980ff,0x17ffe43f,0x037ffff4,0x017fdc00,0x3a1fffdc,
0xf980ffff,0x7fec3fff,0x7f7c47ff,0x7e43ffff,0xfffe82ff,0xfffff06f,
0x3fffea0b,0x7fffe40f,0xffffc81f,0xffff900f,0xffff903f,0x440c401f,
0xeffffffc,0xfffeeeee,0xffff11ff,0xfa80005f,0x53a3ffff,0x50fffffe,
0x3ffe201f,0xfff504ff,0x7fffc3ff,0xfeeeeeef,0xfff14fff,0xf88005ff,
0xf504ffff,0x3e23ffff,0x0002ffff,0xff88fffb,0xff504fff,0x90003fff,
0x219b03ff,0x225fffe9,0x504fffff,0x203fffff,0xffffea81,0xea81806f,
0x206fffff,0x006ffff9,0x777ffffc,0xffffeeee,0xffd50304,0x8000dfff,
0xfa805ff8,0x7ffc3fff,0xeeeeeeff,0x7fc4ffff,0x4f747fff,0x304fffff,
0xfffffd50,0xfffff10d,0x3fffea09,0x7fffe41f,0xffffc81f,0xffff900f,
0xffff903f,0x7e44001f,0xdfffffbe,0xcccccccc,0xffff31cc,0xff00007f,
0x47e6dfff,0xb3fffffb,0x7fffd40b,0xffff504f,0x3fffe27f,0xccccccdf,
0xfff33ccc,0xfa8007ff,0xf504ffff,0x3e67ffff,0x0003ffff,0x7d43ffff,
0xf504ffff,0x8007ffff,0x50503ff9,0x7fd4bfff,0xff504fff,0xd5007fff,
0xdffffd9f,0xecfea800,0xf306ffff,0x4005ffff,0xcdfffff8,0xcccccccc,
0xecfea803,0x0006ffff,0x26007fec,0x223fffdf,0xccdfffff,0x3ccccccc,
0x9fffffe2,0xffff98ed,0xcfea805f,0xa86ffffe,0x504fffff,0xc87fffff,
0xc81fffff,0x900fffff,0x903fffff,0x001fffff,0xf31bff91,0x0005ffff,
0x0bfffff5,0xffff9000,0x7fc4d73f,0x02f8efff,0x13ffffea,0xa7ffffd4,
0x02fffffa,0x7ffffd40,0x7ffd4005,0xfff504ff,0x3ffea9ff,0xf98005ff,
0x3fea3fff,0xff504fff,0xe8009fff,0x7fc4006f,0x3fffea2f,0xffff504f,
0x7ff5409f,0x0dffffd3,0x74fffaa0,0xfb06ffff,0xa800ffff,0x002fffff,
0xd3ffea80,0x000dffff,0x22017fdc,0x23fff9cf,0x02fffffa,0xfffff980,
0x3fe63f97,0x3aa05fff,0xffffd3ff,0xfffff50d,0x3fffea09,0x7fffe44f,
0xffffc81f,0xffff900f,0xffff903f,0xfffa801f,0x3ffffe23,0xfff98004,
0x980006ff,0x3edfffff,0x67ffffec,0x7fffcc07,0xffff704f,0x3fffe67f,
0x7fcc003f,0x4c006fff,0x704fffff,0x267fffff,0x006fffff,0x25ffffb8,
0x04fffff9,0x07fffff7,0x000ffe40,0xff31ffea,0x3ee09fff,0xd883ffff,
0x3ffa2fff,0x7ec406ff,0x3fffa2ff,0xfffff06f,0x9877ae0d,0x003fffff,
0x8bfff620,0x006ffffe,0x880bff10,0x47fff35e,0x03fffff9,0xfffff880,
0x3fe61faf,0xfd884fff,0x3fffa2ff,0xffff986f,0xffff704f,0xffffc87f,
0xffffc81f,0xffff900f,0xffff903f,0x7ffec01f,0x7ffffc43,0xfff88006,
0xd00007ff,0x81ffffff,0x4ffffffa,0x7ffffc40,0xfffff704,0x3ffffe25,
0x7ffc4005,0x7c4007ff,0xf704ffff,0x3e25ffff,0x8007ffff,0x226ffffd,
0x704fffff,0x005fffff,0x2000ffe6,0x7fc42ffc,0xff704fff,0xfe985fff,
0x7fff42ff,0x3ffa606f,0x7ffff42f,0xfffff986,0x0ffff885,0x0bfffff1,
0x3fffa600,0x37ffff42,0x00ffd800,0xfff9876c,0x3ffffe23,0xffff0005,
0xff985fff,0x7f4c2fff,0x7fff42ff,0xffff886f,0xffff704f,0xffffc85f,
0xffffc81f,0xffff900f,0xffff903f,0x3fff601f,0xfffff80f,0xfff8000f,
0x80003fff,0x05fffffb,0x05ffffff,0x0bfffff0,0x87ffffee,0x00ffffff,
0x7fffffc0,0x7fffc003,0xffff705f,0x7ffffc3f,0x7ff4003f,0x3ffe0fff,
0xfff705ff,0x3fa003ff,0x3ff88006,0x0bfffff0,0x87ffffee,0xe87fffe8,
0xd106ffff,0xffd0ffff,0xfff70dff,0xfff70bff,0x7ffffc7f,0x7f44000f,
0xfffe87ff,0xffb8006f,0xf307e402,0xffff87ff,0xfe8000ff,0xf984ffff,
0x3a20ffff,0xffe87fff,0xffff06ff,0x3ffee0bf,0x7ffdc1ff,0xfffc81ff,
0xfff700ff,0xfff903ff,0xfff501ff,0x3fff20bf,0x20a804ff,0x06fffffd,
0xffff8800,0xffff902f,0x3fff600f,0xffff905f,0xfffffe8f,0xffb1c404,
0xd800dfff,0xf905ffff,0xffd8ffff,0x22006fff,0x21ffffff,0x905ffffd,
0x200fffff,0xe8001ffc,0x3fff603f,0xffff905f,0x5ffffc8f,0x06ffffe8,
0xd0bffff9,0xf50dffff,0xf10bffff,0x7ff47fff,0x1c404fff,0xd0bffff9,
0x800dffff,0x7d405ff8,0xfffdccce,0x3ffffa4d,0x2e1c404f,0xf507ffff,
0xffc8ffff,0xfffe85ff,0xffffb06f,0x3ffff20b,0xfffffb87,0x7ffff441,
0xffff700f,0xfffe883f,0xfffe80ff,0xffff506f,0x235403ff,0x4ffffff9,
0x3fa012a0,0x3fe607ff,0xff3004ff,0x3ff20dff,0x7ffd43ff,0x5d100fff,
0x7fffffcc,0xff992a04,0xfff906ff,0xffff987f,0x4d2a04ff,0x22ffffff,
0x906ffff9,0x3007ffff,0xf90007ff,0x3fe61887,0xfff906ff,0xffffe87f,
0x7ffffc47,0xfffffd07,0x7fffff88,0x6fffff98,0x543fffd0,0x00ffffff,
0x7fff45d1,0x7fffc47f,0x7fec007f,0x7fffd400,0x27ffffff,0x0ffffffa,
0xfff05d10,0xfff701ff,0xffffe8bf,0x7ffffc47,0xdffff307,0x0fffff20,
0x0fffffe6,0x1ffffffd,0x3ffffe60,0x7fffff43,0xfffff80f,0x7ffecc2f,
0xfa82ffff,0xfffffd81,0x00fdc1cf,0x2027ffdc,0x2001fffe,0xe80ffffc,
0xffd07fff,0xd883ffff,0xfffffd85,0x20fdc1cf,0xe80ffffc,0xffb07fff,
0xb839ffff,0xfffff51f,0xffffc87f,0x07fffe80,0x9000dfd0,0x2274c45f,
0xe80ffffc,0xfff87fff,0xffcadfff,0xff07ffff,0xf95bffff,0x20ffffff,
0x81fffffd,0xffe86ffb,0x6c41ffff,0x7fffffc5,0xfffffcad,0x3fea007f,
0xeeeea802,0x45efffee,0x1ffffffe,0xffb82ec4,0xfffc81ff,0x7ffffc0f,
0xffffcadf,0x3ff207ff,0xfffe80ff,0x3ffffa07,0xffefeaaf,0x3fa01fff,
0xfeaaffff,0x81fffffe,0xeffffffe,0xfffbefec,0xfdceffff,0xffff104f,
0xffdfffff,0x3ffe2007,0x037fdc01,0x0ffffa20,0x203ffff3,0xfffffffa,
0x880ffece,0xffffffff,0xe883ffef,0x7fcc3fff,0xfff101ff,0xfdffffff,
0x7fffc47f,0x7ff441ff,0x7fffcc3f,0x01ffc801,0x7ffffdc0,0x7f442fff,
0x7ffcc3ff,0xffffc81f,0xffdcffff,0x321ecfff,0xffffffff,0xcfffffdc,
0x3fffe21e,0x0ffdc1ef,0x7fffffd4,0x40ffecef,0xfffffffc,0xfffffdcf,
0x3fe201ec,0x7fcc0005,0xffffa83f,0xffecefff,0x9ffffb00,0x83ffff88,
0xfffffffc,0xfffffdcf,0x7ff441ec,0x7fffcc3f,0x3fffe601,0xffc9efff,
0xf300cfff,0x3dffffff,0x19fffff9,0xffffffa8,0x3fe62fff,0xffffffff,
0x7fff4404,0x03ffffff,0x4403fec0,0xd88004ff,0xffd12eff,0xfff9803d,
0x1fffffff,0x3ffffa20,0x203fffff,0xd12effd8,0xe8803dff,0xffffffff,
0xffffc83f,0x5dffb106,0x007bffa2,0x5000ffe6,0xffffffff,0xdffb101f,
0x07bffa25,0x7fffffcc,0xfffff31e,0xffff985f,0xfff31eff,0xfd305fff,
0xfb5bffff,0x7ffcc03d,0x1fffffff,0xffffff98,0xfffff31e,0x0ffd805f,
0x7ffcc000,0xfffff303,0x203fffff,0xcfffc9fc,0x03fffd88,0xdffffff3,
0x3ffffe63,0xdffb102f,0x07bffa25,0x3ffffaa0,0xfffff90d,0x3faa03ff,
0xff90dfff,0xc83fffff,0x0cefffff,0xfffffd98,0x3f6002ef,0x01ceffff,
0xb004fa80,0x7e40003f,0x0dffffff,0xffffd300,0x360019ff,0x1cefffff,
0xfffff900,0x6c001bff,0x1cefffff,0x019fd710,0xffffffc8,0xdfd000df,
0xffff9800,0x407fffff,0xfffffffc,0x7fed400d,0x7ff5c0be,0xdffb502e,
0xeffeb817,0x7ff6d402,0xd3002eef,0x19ffffff,0x5f7fed40,0x177ff5c0,
0x000bfea0,0x80fffe60,0xffffffe9,0x4c5f500c,0xcefffffe,0x77fed401,
0x77ff5c0b,0xffffc802,0x4000dfff,0x00000ab9,0x000055cc,0x2000ab98,
0x0001abb9,0x00002ee6,0x024c0032,0x0aca8800,0x55dcc000,0x17730000,
0x56544000,0x5dcc0000,0x44000000,0x44000aca,0x00000099,0x05654400,
0x44004400,0x10011000,0x00020001,0x002aee60,0x00880088,0x00003310,
0xabb98000,0x75101800,0x01100015,0x51000110,0x00000159,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x5c000000,0x0000cccc,
0x00cccca8,0x00000000,0x00000000,0x00595100,0x00599100,0x0003004c,
0x01500d4c,0x579b9750,0x79710001,0x54c40005,0x20009abb,0x2002801b,
0x98006009,0x0001cccc,0x31000000,0x1b7004c0,0x2a009900,0x000bdedb,
0x00000130,0x03799953,0x310001b8,0x05799d95,0x260000dc,0x09999999,
0x9800bca8,0x4c000600,0x004fffff,0x7ffffc40,0x7d400005,0x2003ffff,
0x05fffff8,0xfffc8000,0xffd101ff,0x40007fff,0xd8800efe,0x7ff4c4ff,
0x3ffa6003,0x03ea0bef,0xfffefea8,0xc8803fff,0x3efffefe,0x3fff2200,
0x003ffffe,0xfd305df5,0x4ffe8803,0x4017ffd4,0x006ffffe,0x17ffffe2,
0x01fffffb,0x883bff20,0xbf505ffd,0x4404fb80,0xfffbdffd,0x3ffa6001,
0xfc880004,0xffffffff,0x00be22ce,0xffffed98,0x2dffffff,0x980007e6,
0xfffffffe,0x3bfffe62,0x89ffd101,0x4002fffa,0x0ffffffe,0x3fff6000,
0x00001fff,0x00fffff6,0x3ffffe60,0x7fc00000,0x3fa02fff,0x00fffffe,
0x002ffb80,0x6c3ffff7,0xf1007fff,0xbfffffff,0x77e40ff9,0x3ffffee0,
0x5fff500e,0x402fffec,0x2e1dfffb,0x9801ffff,0xdfd88dff,0xffffc800,
0x01bfffa0,0x7ffffff7,0x3fffee00,0x7ffffb05,0x9ffff300,0x40ffffdc,
0x99abeff8,0x2603ffdb,0x3fe62fff,0xfffb003f,0x3620005f,0x9adfffff,
0xefffdb99,0xff9002ff,0x4c415dff,0xffeffffb,0xfe880001,0x3f62ffff,
0xf906ffff,0x7ff41fff,0x3fea006f,0x004fffff,0xffffff30,0x220000bf,
0x0004ffff,0x00ffffe6,0xffff9800,0xfd893602,0x7c4004ff,0x3ff6004f,
0x3fffe3ff,0xfffc801f,0xffffffff,0x309ff505,0x50bfffff,0xff98dfff,
0x3fea06ff,0xfffa80ff,0xffe8800e,0x3fa001df,0xfff12fff,0x3fe201ff,
0x007fffff,0x440bfffd,0xb805fffe,0x3f66ffff,0xff904fff,0xdfffffff,
0x437ffc40,0x4400fffd,0x005fffff,0xdfffff98,0x7fff4c01,0x7ff4c02f,
0xff7002ff,0x00003fff,0x4bffffee,0xfffffff8,0x2ffffe82,0x01fffff1,
0x36bfffe0,0xe8000fff,0xfffcafff,0xffa80001,0xf980004f,0x200005ff,
0x0c02fffc,0x0017ffd4,0xa8003bfa,0x3f21ffff,0x7fd006ff,0xfffffff9,
0x1bffe03f,0x17fffff4,0x907ffff1,0xf107ffff,0x7fc0bfff,0xff9005ff,
0xffb8009f,0x3fff60ff,0x2ffff206,0x4403fffb,0x4400efff,0x4400fffe,
0x3ea3ffff,0x3fa01fff,0x1fffffff,0x20ffff20,0xe804fffb,0x4003ffff,
0x05fffffb,0x017ffe40,0x05fffff9,0x1ffff980,0xfff70000,0x7fff45ff,
0xffb83fff,0x3fff60ff,0x1dff7006,0x2002ffe4,0x3ee1effa,0xfd80006f,
0x2a00004f,0x00000fff,0x20007fff,0x5c004ffc,0xfc8002ff,0x0efe443e,
0x7ed42f80,0xff301fff,0xfff903ff,0x7ffdc9ff,0xffffa82f,0x7fffe41f,
0x1ffff604,0xfff7ff50,0x77e44009,0x80efecc2,0x3ea2fff9,0x3fee00ff,
0xffd1000e,0x19fd5007,0x4403efc8,0x2ffffffd,0x0bfffe60,0x003fffea,
0x001ffff7,0x2fffffd4,0x02ffd800,0x07fffff7,0x07ffe600,0x7ffdc000,
0x3ffee2ff,0xfc884fff,0x0efecc2e,0xb82ffc40,0xff1001ff,0x05ff501b,
0x02ffc400,0x1ffd4000,0x1ffcc000,0x0eff9800,0x013fe200,0x28000000,
0x3ea00cc0,0xffb84fff,0x3ff65fff,0xfff982ff,0x7fff44ff,0x3fff207f,
0x0cfe980f,0x000bfff7,0x1efd8000,0x3a04ff98,0x744000ef,0x0000005f,
0x017bd950,0x81ffffd8,0x802ffffa,0x26000bc9,0x00ffffff,0x220bfa00,
0x006fffff,0x000ffd40,0xfffffb80,0x7fdeecc2,0x90000003,0x05fa807f,
0xf9809f70,0x17ea0006,0x5fa80000,0x03fc8000,0xffffe980,0x1ffd001f,
0x00000000,0xfff00000,0xffff707f,0x7ffffc9f,0xfffff882,0x7fffffc7,
0x1ffff901,0xffd01bd0,0x0000009f,0xe88037ea,0x00ef880f,0x001fd100,
0x00000000,0x203ffffa,0x003ffff9,0xfffd1000,0xb80007ff,0xffffd82f,
0xfd80003f,0xff700001,0xff805fff,0x30000002,0x400a6001,0x01510008,
0x00006200,0x00006200,0xc9800062,0xb807ffff,0x000002ff,0x00000000,
0xf901dff7,0x3e65ffff,0xff02ffff,0x7ec3ffff,0xfd05ffff,0xa8020bff,
0x0002ffff,0x10018800,0x00131035,0x00001880,0x3e000000,0xeeeeffff,
0x04ffffee,0xfff70000,0x80001fff,0x7ffdc2f8,0x80000fff,0x700001f9,
0x405fffff,0x00000ffa,0x00000000,0x00000000,0x00000000,0xf9800000,
0x3e201fff,0x2aa6004f,0x260aaaaa,0x02aaaaaa,0x2b7b6ea0,0x6c031000,
0x3ee7ffff,0xfd03ffff,0x7dc7ffff,0xf84fffff,0x31002fff,0x03ffffa1,
0x56f6dd40,0x00000000,0xa8000000,0x000bdedb,0x05ef6dd4,0xdfffff88,
0xcccccccc,0x76dd403c,0x7ff400bd,0x00006fff,0x7fffc459,0x200007ff,
0x3ae6001e,0xffff71ce,0x01fec05f,0x3bfb6ea2,0xba88001c,0x401cefed,
0xaaaaaaa9,0x2aaaaa60,0xaaaa982a,0x2aa60aaa,0xa982aaaa,0x20aaaaaa,
0x2aaaaaa9,0x37b6ea00,0xffc8000b,0x03ff602f,0xffffea80,0x3ffaa1ff,
0x4400ffff,0xffdcfffe,0x7fc0003e,0x3ff24fff,0xffb03fff,0x7fcc9fff,
0x50dfffff,0x4401dfff,0xffefffec,0x74405fff,0xeffdcfff,0x55555403,
0x2aaa02aa,0x5402aaaa,0x02aaaaaa,0xfbdffd88,0xfd8801ff,0x81fffbdf,
0x02fffffa,0x6ffec400,0xf501fffb,0x009fffff,0x3ffea000,0x00006fff,
0x7ffdc002,0xffbaffff,0xdf102fff,0xedeffa80,0x2005ffff,0xffedeffa,
0x3faa05ff,0x2a1fffff,0x0ffffffe,0x7fffff54,0x3fffaa1f,0x7f540fff,
0x2a1fffff,0x0ffffffe,0x5effec40,0x44001fff,0xff700fff,0x3ffa0005,
0xfff81fff,0x3e600fff,0x3ff20dff,0xff70004f,0xfffb8bff,0xfff904ff,
0xfffe89ff,0xfe9effff,0x7ffcc04f,0xfffea9bf,0xfff300ff,0x27ffe41b,
0xffffff90,0x7fffe40f,0x7fe407ff,0x4c07ffff,0x3fe62fff,0x3ffe603f,
0x30fffe62,0x007fffff,0x317ffcc0,0xffb07fff,0x0005ffff,0x3ffff200,
0x000005ff,0x67fffdc0,0xfffefda9,0x0ee882ff,0xc83ffb10,0x4404ffff,
0x7fe41ffd,0x7ff404ff,0xfff81fff,0xffd00fff,0xfff03fff,0x3fa01fff,
0xff81ffff,0x2600ffff,0x3fe62fff,0xf81dc43f,0x0bff104f,0x7fffec00,
0xffffd81f,0xffff300f,0x3ffff883,0xdfffe800,0x7ffffcc0,0xfffff905,
0xfffff889,0x02ffffff,0x21ffffcc,0x84fffffa,0x441ffff9,0x2203ffff,
0x407fffff,0x07fffff8,0x7fffff88,0x21bffe20,0xf880fffd,0xfffd86ff,
0x3ffffe20,0xfff10005,0x81fffb0d,0x2fffffff,0xffb00000,0x0007ffff,
0x7ffcc000,0xffffc87f,0x02fd42ff,0x7fc1bff6,0x3f602fff,0xfffff06f,
0x7fffec05,0xffffd81f,0xffffb00f,0xffffb03f,0x3fff601f,0xfffd81ff,
0xfff100ff,0x41fffb0d,0x3ea2effc,0x003ff606,0xfffffc80,0xfffffd81,
0x0ffffb00,0x007ffff6,0x103fffa8,0x01ffffff,0x07fffff9,0xffffffd3,
0xfe801dff,0xfffd07ff,0xffffb0ff,0x07ffff60,0x07ffffe8,0x07ffffe8,
0x0fffffd0,0x5c1fffe4,0xffc84fff,0x4fffb83f,0x07fffffc,0x1fffe400,
0x3e27ffdc,0x01ffffff,0xffff0000,0x00005fff,0x7ffff400,0xfffffd02,
0x260065c5,0xff83ffff,0xff305fff,0xffff07ff,0x7ffe40bf,0xfffd81ff,
0xfff900ff,0xfffb03ff,0x3ff201ff,0xffd81fff,0xff900fff,0x9fff707f,
0x77ffffcc,0x0bfee03f,0xffff9000,0xffff903f,0xffff301f,0x3fffee0d,
0x07bf6004,0x5fffffb0,0x5fffffb0,0x3ffffa20,0x501effff,0x320dffff,
0x261fffff,0xf706ffff,0x7f409fff,0xfe807fff,0xfd007fff,0x3e60ffff,
0xffa82fff,0x3ffe60ff,0xffffa82f,0x3fffffa0,0xff31c404,0xfff505ff,
0x3fffe21f,0x00000fff,0xffffff88,0x0000001f,0x01fffff3,0x0bffffee,
0x3ffff200,0x6ffffe86,0x0dffff90,0x40dffffd,0x81fffffc,0x00fffffc,
0x03fffff9,0x01fffff9,0x07fffff2,0x03fffff2,0x20bfffe6,0x220ffffa,
0x2009abba,0xfd005ff8,0xfffff907,0xfffff903,0xbffffd01,0x1bfffee0,
0x4006fc40,0x0efffff8,0x0fffffec,0xffffff30,0xfd03ffff,0x3f20bfff,
0x3fa2ffff,0xff705fff,0x7ff40dff,0xffe807ff,0xffd007ff,0x3ff60fff,
0xfffa81ff,0x3ffff62f,0x2ffffa81,0x3fffffea,0x7ec5d100,0xffa81fff,
0xffff32ff,0x00003fff,0xffffff30,0x0000003f,0x81ffffee,0x02fffffb,
0x6ffffa80,0x06ffffe8,0xd0dffff5,0x640dffff,0xc81fffff,0x900fffff,
0x903fffff,0x201fffff,0x81fffffc,0x80fffffc,0xa81ffffd,0x0002ffff,
0x6c007fec,0xfffc83ff,0xfffc81ff,0xffff80ff,0xffff505f,0x01d7001f,
0x7ffffdc0,0xffffebbe,0xffc880ff,0xfffffffd,0x3ffe20ef,0xfff704ff,
0x7fffc7ff,0xffff505f,0x3fffa01f,0xfffe807f,0xfffd007f,0x3fffa0ff,
0xffff980f,0x03ffffa3,0xd0ffffe6,0x83ffffff,0x7fff45d8,0xffff980f,
0xffffff33,0x1000005f,0x5fffffff,0x32000000,0x2e06ffff,0x002fffff,
0xd05fff90,0x640dffff,0xffe82fff,0x3ff206ff,0xffc81fff,0xff900fff,
0xff903fff,0x3f201fff,0xfc81ffff,0xfe80ffff,0xff980fff,0x2e0003ff,
0xffb802ff,0xffffc83f,0xffffc81f,0x7fffc40f,0xffff504f,0x0099003f,
0xffffff30,0xbfffffdf,0x26dffd10,0xfffffffe,0x3ffffe64,0xfffff704,
0x3ffffe29,0xfffff504,0x3ffffa03,0xffffe807,0xffffd007,0x3ffffe0f,
0xffeeeeee,0x3fffe4ff,0xfeeeeeef,0x7fd44fff,0xecefffff,0x7fffc0ff,
0xfeeeeeef,0x3ffe4fff,0x0003ffff,0xffffff00,0xddd1007f,0xdddddddd,
0x7fff47dd,0x3ffee06f,0x0c0002ff,0x7fffff54,0xfea81806,0x3206ffff,
0xc81fffff,0x900fffff,0x903fffff,0x201fffff,0x81fffffc,0x80fffffc,
0xeeefffff,0x4ffffeee,0x0bff1000,0x07ffff50,0x03fffff9,0x81fffff9,
0x04fffffa,0x07fffff5,0x220005b0,0xfa9ceeca,0x7c42ffff,0x3fa23fff,
0x2a6fffff,0x704fffff,0x2a9fffff,0x504fffff,0x207fffff,0x807ffffe,
0x007ffffe,0x10fffffd,0x99bfffff,0x79999999,0x37ffffe2,0xcccccccc,
0xffff983c,0x41ffffff,0xcdfffff8,0xcccccccc,0x3fffffe3,0xf000004f,
0x09ffffff,0x7fffe440,0x7c1bffff,0x2e06ffff,0x002fffff,0x3b3faa00,
0x4006ffff,0xfffecfea,0x3fff206f,0xfffc81ff,0xfff900ff,0xfff903ff,
0x3ff201ff,0xffc81fff,0x7fc40fff,0xccccdfff,0x003ccccc,0x9801ffb0,
0xc83fffdf,0xc81fffff,0x540fffff,0x504fffff,0x009fffff,0xb0000019,
0xfb0dffff,0xfe881fff,0xf50fffff,0x2e09ffff,0xf53fffff,0x2a09ffff,
0xd04fffff,0xd00fffff,0x200fffff,0xa87ffffe,0x002fffff,0x17ffffd4,
0x3ffa6000,0xa80cffff,0x002fffff,0xffffffd8,0xf9000006,0x00bfffff,
0xffffffb0,0xfffff307,0x7fffdc0d,0xea80002f,0xffffd3ff,0x3ffaa00d,
0x0dffffd3,0x0fffffe4,0x07ffffe4,0x1fffffc8,0x0fffffc8,0x3fffff90,
0x1fffff90,0x2fffffa8,0x3ee00000,0x4e7c402f,0xffc83fff,0xffc81fff,
0x7fcc0fff,0xff704fff,0x00007fff,0x3ffe2000,0x7ffc43ff,0xffff107f,
0x3ffe67ff,0xfff704ff,0x3ffe63ff,0xfff704ff,0x3ffa07ff,0xffe807ff,
0xffd007ff,0xfff30fff,0xf98007ff,0x0003ffff,0x802b7f20,0x03fffff9,
0xfffff980,0x3000007f,0x0dffffff,0xfffff900,0xffff105f,0x7ffdc0df,
0x220002ff,0x3fa2fffd,0x6c406fff,0x3ffa2fff,0x3ff206ff,0xffc81fff,
0xff900fff,0xff903fff,0x3f201fff,0xfc81ffff,0x7cc0ffff,0x0003ffff,
0x80bff100,0x7fff35e8,0x3fffff90,0x1fffff90,0x4fffff88,0x5fffff70,
0x20000000,0xa85ffffb,0x3606ffff,0x3e4fffff,0xf704ffff,0x3e21ffff,
0xf704ffff,0x3a05ffff,0xe807ffff,0xd007ffff,0xf10fffff,0x800bffff,
0x05fffff8,0x01ff9000,0xbfffff10,0x3fffa000,0x00000fff,0xffffffd0,
0xffff7000,0x3ffe03ff,0x3fee06ff,0x30002fff,0xfe85fffd,0x3a606fff,
0x7ff42fff,0x3ff206ff,0xffc81fff,0xff900fff,0xff903fff,0x3f201fff,
0xfc81ffff,0x7c40ffff,0x0005ffff,0x801ffb00,0x7fff30ed,0x3fffff90,
0x1fffff90,0x0bfffff0,0x07ffffee,0x74000000,0xfb80ffff,0x3ea05fff,
0x3fa3ffff,0xff705fff,0xffff8fff,0xffff705f,0x3fffa03f,0xfffe807f,
0xfffd007f,0x3fffe0ff,0x7fc000ff,0x0000ffff,0xf002ffcc,0x001fffff,
0xffffff70,0x30100009,0x03ffffff,0xfffffb80,0xfffff01f,0x7fffdc0f,
0xfe88002f,0xfffe87ff,0xfffd106f,0xdffffd0f,0x7ffffe40,0xfffffc81,
0xfffff900,0xfffff903,0x3ffff201,0xffffc81f,0xfffff80f,0x5c00000f,
0x07e402ff,0xf707fff3,0xf903ffff,0xfb01ffff,0x3f20bfff,0x64407fff,
0x900003ef,0x2605ffff,0x2206ffff,0x322fffff,0xf905ffff,0xffd8bfff,
0xfff905ff,0x7fff40ff,0xfffe807f,0xfffd007f,0x3fffa0ff,0xd1c404ff,
0x809fffff,0x1bff2038,0xfffffe80,0x7ec1c404,0x0007ffff,0xfffb82c4,
0x7dc005ff,0xb01fffff,0x203fffff,0x02fffffb,0x5ffffc80,0x06ffffe8,
0xd0bffff9,0x5c0dffff,0xc81fffff,0x700fffff,0x903fffff,0x201fffff,
0x81fffffb,0x80fffffc,0x04fffffe,0xff8801c4,0x6677d405,0x44dfffdc,
0x41fffffb,0x0fffffe8,0x06ffff98,0x807ffff9,0x003ffffd,0x17fffe40,
0x0fffff10,0x20fffff8,0xb06ffffa,0xf987ffff,0xff906fff,0x7ff407ff,
0xffe807ff,0xffd007ff,0x3fea0fff,0xd100ffff,0x7ffffd45,0x405d100f,
0x5001fffe,0x01ffffff,0x3fe20ba2,0x0004ffff,0x7fe40df1,0x2e001fff,
0x01ffffff,0x07fffff3,0x0bfffff6,0x3ffffa00,0x7ffffc47,0xfffffd07,
0x7fffff88,0x3ffffee0,0x7ffff441,0xffff700f,0xfffe883f,0xfff700ff,
0xffe883ff,0xffa80fff,0xd100ffff,0x03ff6005,0xffffff50,0xf98fffff,
0x7f43ffff,0x900fffff,0xfd01ffff,0xff980fff,0x20006fff,0x801efffc,
0x501ffffd,0xfb07ffff,0x3ffa0fff,0xffff906f,0x0ffffd01,0x07ffffe8,
0x07ffffe8,0x0fffffd0,0x7ffffff4,0x7f42ec41,0x441fffff,0x7ffec05d,
0xfffd000e,0x5d883fff,0x3ffffe60,0x77d4003f,0x7ffff401,0xfff7000e,
0x7f403fff,0x7dc0ffff,0x003fffff,0xdffffff8,0xffffffca,0xffffff07,
0xfffff95b,0x7ffcc0ff,0x7fff43ff,0xff300fff,0xffe87fff,0xf300ffff,
0xfe87ffff,0xd00fffff,0x83ffffff,0xff5005d8,0xdddd5005,0x0bdfffdd,
0x55fffffd,0xfffffdfd,0x3fffa203,0x0ffffcc3,0x3ffffea0,0xffc88007,
0xfd1000df,0x3ff20bff,0xffff105f,0x1ffff985,0x87fffd10,0x401ffff9,
0x807ffffe,0x007ffffe,0x40fffffd,0xfffffffa,0xa80ffece,0xefffffff,
0x5400ffec,0x801effff,0xfffffffa,0x400ffece,0xcfffffd8,0x17f66200,
0xeffffb80,0xffffb801,0x3fe601ff,0xfb88dfff,0x06fffffe,0xfffffc80,
0xfffdcfff,0x3f21ecff,0xcfffffff,0xecfffffd,0xfffffe81,0xfffefeaa,
0x3ffa01ff,0xefeaafff,0x201fffff,0xaafffffe,0xfffffefe,0xfffff501,
0x1ffd9dff,0x00bff100,0x03fff980,0xfffffff3,0xfffff93d,0x3ff62019,
0x3dffd12e,0x3ffffe00,0x3ff26004,0xe98001cf,0xf910cfff,0xfe8809ff,
0xfffd11ef,0xeffd8803,0x03dffd12,0x1fffffd0,0xfffffe80,0xffffe800,
0x3ffe600f,0x1fffffff,0x3ffffe60,0x001fffff,0xbffffffb,0x7fffcc05,
0x01ffffff,0x3ffffee0,0xfecaacdf,0xd88002ff,0x409dffff,0xeffffeb8,
0x7ffcc00b,0xfbbfffff,0x04ffffff,0x3ffffe60,0xffff31ef,0xfff985ff,
0xff31efff,0x2605ffff,0xefffffff,0xcfffffc9,0xfffff300,0xfff93dff,
0x3e6019ff,0x9effffff,0x0cfffffc,0xffffff30,0x2003ffff,0x40000ffd,
0x2a03fff9,0x90dffffe,0x3fffffff,0x7ffffe40,0x2a000dff,0x4401efff,
0x00beffeb,0xffffb800,0x001efffe,0x3fffffee,0x3f2000cf,0x0dffffff,
0xfffffa80,0x3ffea04f,0x7d404fff,0x404fffff,0xffffffe9,0xffe9800c,
0x000cffff,0x77ffffdc,0x7fff4c02,0x8000cfff,0xfffffda8,0x00dfffff,
0x7ffecc00,0xffffffff,0x4c000bdf,0x72fffffe,0x0359dfff,0x7dffb500,
0x2effeb81,0x17dffb50,0x02effeb8,0x6fffff54,0xffffff90,0x3ffaa03f,
0xfff90dff,0x2a03ffff,0x90dffffe,0x3fffffff,0x3ffffa60,0xf5000cff,
0xf300005f,0x573007ff,0x51000001,0xa8000159,0x01355001,0x5d4c0000,
0x200009ac,0x000abca9,0x002b2a20,0x7fffffc4,0x3e21ffff,0xffffffff,
0x7fffc41f,0x01ffffff,0x000abb98,0x00157730,0x00ddd440,0x0055dcc0,
0xcba98800,0x00001abc,0x79997530,0x20000335,0x0d4c1ba8,0x00220000,
0x00440022,0x2e600044,0x4c00000a,0x400000ab,0x00000ab9,0x000abb98,
0x00000cc4,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x30000000,0x10054035,
0x33333333,0x33333333,0x2e0036a0,0x4cc40005,0x00199999,0x56665cc4,
0xdba88002,0x0001cefe,0x00000088,0x2012ea62,0x006601a8,0x99999988,
0x20999999,0x99999999,0x80999999,0x99999999,0x00999999,0x01599750,
0x33333300,0x33333333,0x2aaaaa63,0x54c1aaaa,0x2002aaaa,0x00bcecb8,
0x2a200726,0x776dc401,0x80f4c0bd,0x02c00cb8,0x0379b751,0x55555100,
0x76dc4555,0x0000003d,0x2bcb9800,0x800ca800,0x6ecc00a8,0xfffd3002,
0x00fd417d,0xfffffff9,0xffffffff,0x501be60f,0xe98000bf,0x1fffffff,
0xdfffe880,0x002efffe,0xffdbdff5,0x22000bff,0x0000dffd,0x5bffd710,
0xffffd801,0x800fe20b,0xfffffffd,0x912fffff,0xfffffffd,0x885bdfff,
0xffffffdc,0x03dfffff,0x7fffffdc,0x7ee4003f,0xffffffff,0xfff54dff,
0x85bfffff,0x03ffffda,0xffd9ff90,0x017f405f,0x7e403fd1,0x1ffdbdff,
0xff703ff7,0x8a7c09ff,0xffffffdb,0x1004efff,0xfffffff9,0x3fffffee,
0x3f60001f,0x4001ffff,0xeffeffe9,0x03be2002,0x3200ffa8,0x4404ffff,
0xffffffff,0x7f407fcd,0xffffffff,0x05ffffff,0x266b3bfe,0x0004ffcb,
0xffffff10,0xefffa803,0x13fffea0,0x641ffd88,0x8004ffff,0x004ffffb,
0x5fffecc0,0xffffb000,0x5fd7bfff,0x3fffe200,0xffffffff,0xffffd107,
0x6c005fff,0x3fffffff,0xffffe880,0x006fffff,0xffffff70,0x3ffa20bf,
0x7e406fff,0x3ffb000f,0x40bfffe2,0xffa83ffa,0x5fffb105,0xfffeffd8,
0x7ffffe81,0x3bffffe0,0xffd7309b,0x22003dff,0xfaffffff,0xefffffde,
0xfff88000,0x7d4001ff,0x9ffd10ff,0x40ffe400,0x7fc03ffb,0x3200ffff,
0xffffffff,0x3e206fff,0xffffffff,0x2fffffff,0x3ffffee0,0x000fffff,
0x3ffff200,0x3ffee01f,0xffffe81f,0x20dffb02,0x002fffff,0x03fffff4,
0x1bfff900,0x7fffcc00,0xffffffff,0xffff7000,0xffffffff,0x7fffd409,
0x7c4005ff,0x807fffff,0xffffffe8,0x004fffff,0xffffffd0,0x7fffd401,
0x01fd407f,0x7f47ffd8,0xffd00fff,0x807ffdc9,0xf886fffe,0x4c1fffff,
0x02ffffff,0x7007ffff,0x007fffff,0x3ffffffe,0x3ffffa63,0xfffa8005,
0x7fd4001f,0x27ffd44f,0x22fff880,0x7cc06ffd,0x202fffff,0xffffcbfe,
0x2a01ffff,0xffffffff,0x7fffffff,0xfffffd80,0x98002fff,0xfdaaaaaa,
0x81acffff,0xc80fffff,0xf986ffff,0xfff83fff,0x7ec005ff,0x88005fff,
0x8005fffe,0xfffeccfc,0x2004ffff,0xfffffffe,0x201fffff,0x4ffffff9,
0xfffff800,0xdffd806f,0xffffffec,0xfd8000ff,0xe807ffff,0x202fffff,
0xff9800fc,0x7ffff46f,0xbbfff503,0x3ee09fff,0xffb03fff,0xff983fff,
0xff03ffff,0x7fdc003f,0xfe805fff,0xf984ffff,0x4002ffff,0x4001fffd,
0xf81ffff8,0xf9001fff,0x5fffd9ff,0xffffff00,0x36a1fc01,0x6402ffff,
0xffffffff,0x5fffffff,0xffffd880,0xf70003ff,0xffffffff,0xa89fffff,
0xf707ffff,0xfc81ffff,0xffe86fff,0x7cc006ff,0x4c001fff,0x0005ffff,
0xfffca8bb,0x3fe2004f,0xffffffff,0x7fcc06ff,0x8004ffff,0x06ffffff,
0x7ecc1fcc,0x001fffff,0x7fffffd8,0xfffffa80,0x74013a05,0x7fec7fff,
0x3ffa03ff,0x880fffff,0x900fffff,0x983fffff,0x02ffffff,0xf90007ff,
0xe807ffff,0xf00fffff,0x400dffff,0x8002fff8,0xff07fffb,0x3e200bff,
0x05ffffff,0x09ffff90,0x006600a8,0x56677ff4,0xffaaaaaa,0x3b2a002f,
0x260000bd,0xfdaaaaaa,0x41acffff,0x707ffffc,0xa83fffff,0xfe86ffff,
0x88006fff,0x7c4000bb,0x20005fff,0x002a601a,0x33337f70,0x01333333,
0xffffff88,0xffff8004,0x01f405ff,0x5ffffff1,0xffffb000,0x3ffa00ff,
0x1f980fff,0xfffff880,0x07fffea0,0xffffff98,0xfffff503,0x7ffffe40,
0xffffff81,0x2000df00,0x0ffffff8,0x1fffffa0,0x0fffffc8,0x005ff500,
0x41ffffe0,0x001ffffe,0x3ffffff7,0x016ecc00,0x3be00000,0x0fff3001,
0x00000000,0x0fffffdc,0x07ffffc8,0x01fffff7,0xfd05fff9,0x0000dfff,
0xffffe800,0x00000000,0x00007e80,0x7fffffc4,0xffff8004,0x00a205ff,
0x03fffff6,0x3ffff600,0xfff7007f,0x00d909ff,0x07ffffea,0xfb007df9,
0x7e40dfff,0x3f206fff,0xfe81ffff,0x0fe07fff,0xffffd800,0x3fffa05f,
0x3ffee07f,0x5fb001ff,0x3ffea000,0xffffb07f,0x3ffe2007,0x000004ff,
0x3f300000,0x02ffdc00,0x00000000,0x03fffff7,0x41fffff6,0x406ffffb,
0xffffea81,0x0000006f,0x017ffff2,0x20000000,0x400004f9,0x4ffffff8,
0xfffff800,0xfa80005f,0xb0005fff,0x00ffffff,0x3fffffe2,0xfb801fc0,
0x0002ffff,0x00d55544,0x40dffffb,0x81fffffc,0x205ffffc,0x3ea0000e,
0xd02fffff,0x5c0fffff,0x003fffff,0x7e400013,0xffb06fff,0x54c00bff,
0x00000aaa,0xfdb75100,0x0198039d,0x8017ff40,0xcefedba8,0xbd930001,
0x3fffee19,0xffffb01f,0x3ffff20f,0x33faa002,0x006ffffe,0x5ef76dcc,
0x3fffe600,0x554c002f,0x260aaaaa,0x02aaaaaa,0x26f3bff2,0x3fe20000,
0x8004ffff,0x05ffffff,0xffffb800,0xfffb0001,0x7e400fff,0x3ea3ffff,
0xffff9000,0x0000007f,0x05fffff8,0x07fffff2,0x80ffffea,0xfff80000,
0xffd06fff,0x7fd40fff,0x00004fff,0xdffffd00,0x1fffff60,0x00000000,
0x3b7bfea0,0x0005ffff,0x003ffe20,0x3fb7bfea,0x2e005fff,0xafffffff,
0x01fffffb,0x10fffffb,0x2007ffff,0xffd3ffea,0x36200dff,0xffffddff,
0xfffff902,0xfffd5000,0x7f543fff,0xd00fffff,0xffffffff,0xfff10007,
0xf0009fff,0x00bfffff,0x03fffb00,0x7fffec00,0x3fe2007f,0x01766fff,
0x5fffffb8,0x55555000,0x3fe60555,0x3f205fff,0xf981ffff,0x00001fff,
0x7fffffc0,0xffffe80f,0x3fffea07,0x5555535f,0x76dcc155,0x7fffc00b,
0xffffb06f,0x2aaaa63f,0x36e60aaa,0x400000be,0x7e41ffd8,0x00004fff,
0xd880bff7,0x7ffe41ff,0xfffc804f,0xfefda9cf,0xfb01ffff,0xffe8ffff,
0xfd8800ae,0x3fffa2ff,0xffe8806f,0x0bffff63,0x59fffff1,0x8037bdb9,
0x81fffffe,0x80ffffff,0xfffffff9,0x2002ffff,0x4ffffff8,0xfffff800,
0x7cc0005f,0x6c0001ff,0x007fffff,0x57ffffec,0x3ea002f8,0x0006ffff,
0xfffffff9,0x3ffffea0,0x3ffff205,0x0ffff01f,0xffd00000,0xfd03ffff,
0x7d40ffff,0xfd33ffff,0x325fffff,0x03ffffff,0x0dfffff1,0x4bfffff6,
0xffffffe9,0xffffff92,0x7ec00007,0xfffff06f,0xffd00005,0x06ffd805,
0x405fffff,0xd86ffffa,0x01ffffff,0xd8fffffb,0x200befff,0x742fffe9,
0x4406ffff,0x7fd46ffe,0x7ffdc7ff,0xffffffff,0x3ff603ff,0xffd81fff,
0xffc80fff,0xffffffff,0xf8801eff,0x004fffff,0x5ffffff8,0x3ffe2000,
0x7ec0004f,0x4007ffff,0xbdfffff9,0xfb999807,0x999fffff,0xfff10009,
0x3fe60fff,0x3f205fff,0xfb01ffff,0x000000df,0x5ffffffb,0x0fffffd0,
0x17ffffdc,0x2ffffff6,0xfffffffd,0xffff980f,0xffffb06f,0xffffd87f,
0xfffffdbf,0x80000fff,0xf83ffff9,0x0005ffff,0x3007ffc4,0xff07ffff,
0x7f40bfff,0xfe882fff,0xfb01ffff,0x3f20ffff,0xfe880fff,0xfffe87ff,
0x7ffe406f,0x7ffffc43,0x3fffffa0,0xffffdabe,0xffff905f,0xffffb03f,
0xfffff01f,0xffffffff,0xff8801ff,0x8004ffff,0x05ffffff,0xffffc980,
0xb0000eff,0x00ffffff,0xffffffd0,0xffff8809,0xffffffff,0x3fa004ff,
0xff107fff,0x7e40dfff,0xf701ffff,0xaaaa889f,0xaaaaaaaa,0xaaaaaaaa,
0x4ffffffd,0x07ffffe8,0x03ffffee,0xdffffff7,0x3ffffe63,0xfffffa85,
0xfffffb06,0xfffffb87,0xffff31ef,0x401980bf,0xe86ffffc,0x0006ffff,
0x3202ffdc,0xfe86ffff,0xff506fff,0x7fdc0fff,0xffb01fff,0x7ff40fff,
0xffffc85f,0x6ffffe85,0x0bfffe20,0xf83ffff6,0xfc87ffff,0xfc82ffff,
0xfc81ffff,0x7d40ffff,0xffffffff,0x06ffffff,0x7fffffc4,0xffff8004,
0x7e4005ff,0xffffffff,0xffd8001f,0xa8007fff,0x00ffffff,0x7fffffc4,
0xffffffff,0x3fffa004,0x3fffa07f,0x3fff207f,0x5ff301ff,0xffffffa8,
0xffffffff,0xffffffff,0xe85fffff,0x3207ffff,0xfb87ffff,0x6c0fffff,
0xfa87ffff,0xfb06ffff,0xfb89ffff,0x6c0fffff,0xd507ffff,0x3ea01dff,
0xffe86fff,0x740006ff,0x7fd402ff,0xfffe86ff,0xffff906f,0x7fffdc0d,
0xffffb01f,0x7fffec0f,0x3fffff42,0x1fffffe2,0x81ffffc8,0x3e24fffa,
0xf887ffff,0x640fffff,0xc81fffff,0x100fffff,0xfffb9553,0x09ffffff,
0x7fffffc4,0xffff8004,0xda8005ff,0xffffffff,0xfffd8006,0xff0007ff,
0xf100dfff,0xffffffff,0x009fffff,0x03fffff4,0x03fffff7,0x07fffff2,
0x3e607fc4,0xabffffff,0xaaaaaaaa,0xffffdaaa,0xfffe85ff,0x3fffa07f,
0xffffb86f,0xffffc82f,0x7fffd40f,0xffffb06f,0xffffb89f,0xffffc82f,
0x7fffc40f,0xfff900ff,0xdffffd05,0x7ffc4000,0x2fffc800,0x06ffffe8,
0x40dffffb,0x01fffffb,0x40fffffb,0x7c6ffffc,0xcadfffff,0x07ffffff,
0x407ffffe,0x7ffcc1a8,0xfffd06ff,0xfffc85ff,0xfffc81ff,0x644000ff,
0x7fffffff,0x3ffffe20,0xfff8004f,0x20005fff,0xffffffe8,0x7fec002f,
0x90007fff,0x0005ffff,0x0bffffee,0xffffe800,0x3fffe207,0xfffe884f,
0x21fe01ff,0xfffffff8,0xfffc8000,0xffe84fff,0xff883fff,0xffb82fff,
0xffb82fff,0x7fcc1fff,0xffb06fff,0xffb87fff,0xffb82fff,0x7fe41fff,
0x0c04ffff,0x7fffff54,0x3fee0006,0x7540c005,0xf06fffff,0x5c0bffff,
0xb01fffff,0x640fffff,0x7e47ffff,0xcfffffff,0xecfffffd,0x3ffffe21,
0x7ffd4002,0xfff706ff,0xfffc87ff,0xfffc81ff,0x2e0000ff,0x00ffffff,
0x9ffffff1,0xfffff000,0xfb0000bf,0x009fffff,0x7fffffd8,0xffff1000,
0x3fe20001,0x20002fff,0x407ffffe,0x0cfffffb,0xfffffff3,0xff836c03,
0x001fffff,0xffffffd8,0xfffffe82,0x3fff623f,0xffff705f,0xffff705f,
0xffff883f,0xffffb06f,0xffffb83f,0xffffb82f,0x7fffe41f,0x3aa006ff,
0x6ffffecf,0x0fff6000,0xecfea800,0xf886ffff,0x2e05ffff,0xb01fffff,
0x640fffff,0x260fffff,0x1effffff,0x5ffffff3,0x3fffff98,0x7fffd400,
0xffff506f,0xffffc8bf,0xffffc81f,0x7dc0000f,0xf102ffff,0x009fffff,
0xbffffff0,0x3ff60000,0x6c005fff,0x007fffff,0x0013ff60,0x03ffffd0,
0x7ffff400,0xffffb807,0xffcdffff,0x17201fff,0x7ffffff4,0xfffd8001,
0xffe81fff,0xfcffbfff,0x700effff,0x705fffff,0xf03fffff,0x360dffff,
0x5c0fffff,0xb82fffff,0x4c1fffff,0x07ffffff,0xfd3ffea8,0x2000dfff,
0x8000fff8,0xffd3ffea,0xfff30dff,0x7fdc0bff,0xffb01fff,0x7fe40fff,
0x7ed42fff,0x7f5c0bef,0xfffa82ef,0x7c4005ff,0xf307ffff,0xfc8dffff,
0xfc81ffff,0x0000ffff,0x03ffffb8,0x9ffffff1,0xfffff000,0x220000bf,
0x005fffff,0x3fffffec,0x03ff3000,0x7fffb800,0x7fff4000,0xfff7007f,
0x3ff27fff,0x0ea01fff,0x7fffffe4,0xfffe8001,0xffe80fff,0xffff57ff,
0x7dc017df,0xfb82ffff,0xfe81ffff,0xffb06fff,0xfff70fff,0xfff705ff,
0xfff703ff,0x7ec40dff,0x3fffa2ff,0xff70006f,0xffd8800b,0x3ffffa2f,
0xfffff986,0x3fffee05,0xffffb01f,0x7fffe40f,0x4c01102f,0x3fe600ee,
0xf8006fff,0xf307ffff,0xfc8bffff,0xfc81ffff,0x0000ffff,0x205fffd0,
0x4ffffff8,0xfff00b98,0x0000bfff,0x21ffffdc,0xfffb01b8,0xe8000fff,
0xff980006,0x7f40006f,0x4c007fff,0x7ffe41bb,0xf70001ff,0x005fffff,
0xdffffff0,0x1fffffa0,0x2e001773,0xb82fffff,0xd81fffff,0xfb06ffff,
0xff70dfff,0xff705fff,0xc8403fff,0xfffd305f,0x6ffffe85,0x07ffb000,
0x17fff4c0,0x21bffffa,0x06fffff8,0x07ffffee,0x03ffffec,0x03fffff9,
0x803ff500,0x07fffff8,0xfffffd80,0xfffff880,0x7ffffe43,0xfffffc81,
0xff700000,0x3ffe203f,0x7ff44fff,0xfffff83f,0x2600005f,0x3f21ffff,
0xfffd85ff,0x7c0006ff,0xfff00002,0x3a01100b,0x0007ffff,0x3fffff20,
0xfff10001,0x88007fff,0x02ffffff,0x00fffffd,0xfffff700,0xfffff705,
0xdffff903,0x17ffff60,0x0bffffee,0x07ffffee,0x3a20ffa0,0xffe87fff,
0xf88006ff,0xfd1000ff,0xfffd0fff,0x3fffe0df,0x3ffee07f,0xfffb01ff,
0x7ffdc0ff,0x7c4000ff,0xffff007f,0xfb8007ff,0xff01ffff,0xffc83fff,
0xffc81fff,0x00000fff,0x7c40fff3,0x2a4fffff,0xff87ffff,0x0004ffff,
0x43fffe20,0x41fffff8,0x06fffffd,0x8001ea00,0x3ffeacba,0xfe80f440,
0x00007fff,0x07fffff2,0xffffb800,0x7fdc004f,0x3fa05fff,0x80007fff,
0x82fffffb,0x81fffffb,0xb06ffff9,0xf707ffff,0xf705ffff,0x8803ffff,
0xfffc80ff,0xffffe85f,0x6ffa8006,0x3ffff200,0x6ffffe85,0x1fffffd0,
0x3ffffee0,0xfffffb01,0x37fffc40,0x07ffd400,0x7ffffec0,0x7ffcc006,
0xfff882ff,0xffffb87f,0xffffc81f,0xf100000f,0x7ffc407f,0x3ff24fff,
0x7ffc1fff,0x00003fff,0xff72fffc,0xffd87fff,0x75c04fff,0x40026c0c,
0xffffffe8,0xfea981cf,0xfffffd00,0x7fe40000,0xfd701fff,0x3fffa019,
0x7ff4006f,0x3fa00fff,0x80007fff,0x82fffffb,0x01fffffb,0x360ffffd,
0xfb80ffff,0xfb82ffff,0x5c01ffff,0xffffd03f,0xfffff88f,0x3ffd8007,
0x3ffffa00,0x7ffffc47,0xfffff507,0x3ffff607,0xffffb01f,0xfe877e4f,
0xfc8005ff,0xff9803ff,0x2a04ffff,0x27ffff44,0x42ffffc4,0x41fffffb,
0x0fffffe8,0x800ceeb8,0x3e600ffb,0x2e4fffff,0xff86ffff,0x2a01ffff,
0xff9803ee,0x3fffea0f,0x7ffff40f,0x3ffea02f,0x20003e24,0xfffedffb,
0xffffffff,0x3ffa07ff,0x200007ff,0x81fffffc,0x505ffffb,0x005fffff,
0x0fffffe2,0x0fffffd0,0xffff7000,0xffff705f,0x3ffee03f,0x4fffe80f,
0x5fffff70,0x3fffff70,0xff02fcc0,0xf95bffff,0x00ffffff,0x000fff88,
0x37fffffe,0xffffffca,0x3ffffe07,0x7fffdc0f,0xfffb02ff,0x53ffe2ff,
0x8001fffc,0x801ffffb,0xcffffffd,0x3e60fdc1,0xff986fff,0xfff981ff,
0x7fff43ff,0x7fc40fff,0x7f403fff,0x7fffcc01,0x3ffe64ff,0x7fffc42f,
0x7fffc06f,0x0bff200d,0xf09ffff1,0x401dffff,0x1727fffd,0x3ee2fc00,
0xffffffff,0x3fa04fff,0x00007fff,0x07fffff2,0x03fffffe,0x07ffffec,
0x2fffff40,0x3fffff40,0x7ffdc000,0xfffb82ff,0x3ffa01ff,0x0ffff81f,
0x5fffff70,0x3fffff70,0xf9013ea0,0x9fffffff,0xd9fffffb,0x0dff5003,
0xfffffc80,0xfffdcfff,0x7d41ecff,0xb88cffff,0x5fffffef,0x2fffffd0,
0xff74fff8,0x3fe60007,0x7c402fff,0xffffffff,0xff903ffe,0xfffc85ff,
0x3ffffa03,0xffefeaaf,0x7fcc1fff,0x4c1effff,0xffa802fd,0x7e45ffff,
0x7ffdc0ff,0x3fe200ef,0xf982efff,0x3fff503f,0x1fffff98,0x4ffffdc0,
0xf88000fb,0x7ffffec3,0x0fffffff,0x1fffffa0,0xfffd8000,0x7ffc42ff,
0x3ee02fff,0x7ec04fff,0xff002fff,0x0000ffff,0x05fffff7,0x03fffff9,
0x2a27ffc4,0x3ee03fff,0xfc82ffff,0xde81ffff,0xffff9801,0xfff31eff,
0x36005fff,0x7cc003ff,0x31efffff,0x05ffffff,0x3fffffea,0xffffbaff,
0x3fea3fff,0x3ff27fff,0x0005fe9d,0x7fffffdc,0xfffd103e,0x07ffffff,
0x51efffb8,0xf9807fff,0x9effffff,0x0cfffffc,0x7fffffec,0x01efdcdf,
0xfffffe88,0x6ffec2ff,0xeffffa8a,0xffffc800,0xefdabdff,0x577fe401,
0x1ffffe98,0xfffff880,0x3f60003f,0xfdbffc9a,0x3fffffff,0x7fffff40,
0xff880000,0x6c0dffff,0x8806ffff,0x30befffe,0x01bfffb7,0x3ffffea0,
0x7e40002f,0xfc83ffff,0x4402ffff,0xffd32fff,0xffffc805,0xffffc83f,
0x5400082f,0x5c0beffd,0x1002effe,0x50001fff,0xb817dffb,0x5402effe,
0x72fffffe,0x4359dfff,0x7ffffffd,0x0b7ffae2,0x7ffd4000,0x7ec03fff,
0x01ceffff,0xfdfffb30,0x3aa0039d,0xf90dffff,0x43ffffff,0xffffffc8,
0x74402dff,0xffffffff,0xd52effff,0x9fffffff,0x3ff62001,0x3effffff,
0x3fffa600,0x001dffff,0x00bbff26,0xffffd300,0x7ffffd45,0x7ffd401f,
0x20004fff,0xffffffea,0x3fa64fff,0x36e002ff,0xffffffff,0xff1002df,
0xdfffffff,0xffd30009,0x7cc1dfff,0x00dfffff,0x7ffffecc,0x7ff4c01e,
0x3e60efff,0x00dfffff,0x10011000,0x3cc98001,0x40044000,0x5d440008,
0x0000d4c1,0x80000040,0x000abba8,0x80002ee6,0x0000bba8,0x00002ae6,
0x05565d54,0x4c000000,0x000abcca,0x35795510,0xcba98000,0x000000ab,
0x80dcc000,0x2009bb98,0xfffffff8,0x00001fff,0x0002a800,0x04de5cc4,
0x00000000,0x3fffffee,0xfffa9fff,0x01ffffff,0x70015730,0xffffffff,
0xfffff53f,0x0003ffff,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x3372a600,0x330001ac,0x33333333,0x2f372a01,0x55551001,0x6dcc1555,
0xd90001ce,0x9001b709,0x55100009,0x33333555,0x33333333,0x81333333,
0x99999998,0x33100099,0x01333333,0x06540000,0x00005440,0x0de6e54c,
0x50000000,0x75100179,0x09015999,0xa80e64c0,0x2aaa60cc,0x2a60aaaa,
0x00aaaaaa,0x0d400722,0x02aaaaa8,0x20555555,0x99999998,0x40099999,
0x99999999,0x26666621,0x20999999,0x99999998,0x20099999,0x01999999,
0x0d554c00,0x16ecc000,0xffff9100,0x17dfffff,0x7fff6400,0x544fffff,
0xdffffffe,0x7fff4c00,0xfff93fff,0x88009fff,0x05fa83ff,0x4c0027dc,
0xfffffedb,0xffffffff,0xffffffff,0x74c2ffff,0xffffffff,0xffeb800f,
0x003fffff,0x01fffffb,0xf50077cc,0x6c40001f,0xcfffffff,0x20000000,
0x01effff9,0x3fbfffee,0x00f11cff,0xfc80ffdc,0x7ffff547,0x3ffaa1ff,
0x7401ffff,0x0bfa202f,0x837ffff4,0x706ffffe,0xffffffff,0xd807dfff,
0xfffffffe,0xffffff70,0x645dffff,0xfffffffe,0xd104efff,0x00dfffff,
0xefffedb8,0x00beffff,0x17fffee0,0x59fff910,0xffb55333,0xfe88009f,
0x2e4fffff,0xffca9bef,0xffc801ff,0xfffdbfff,0x002fffff,0x3e207fea,
0xdb99abdf,0x7dc002ff,0xdaacefff,0xffffffff,0xffedccce,0xd102ffff,
0xdfffffff,0x7ffec400,0x3ffe2001,0xffc801ff,0x002ffb81,0x22bbfea0,
0x005ffffc,0xffb01800,0xfd30dfff,0x7ecc419f,0x36007fff,0x41bfa07f,
0x81fffffe,0x01fffffe,0x7cc1ffd4,0x3fffa05f,0xffffd06f,0x7ffe440d,
0x8005ffff,0x40dfffe8,0xffffffd8,0x3ffea02f,0x000fffff,0x4005ffd1,
0x0bdfffe9,0x5ffffb51,0x3ffffa00,0x5dfd300f,0x3bfae200,0x3ffe6000,
0x09f74fff,0x007fffea,0xdffffff5,0x3ffffe63,0x81bf6007,0xfffffffc,
0x362006ff,0xf104ffff,0x09ffffff,0x017fff4c,0xffffffd1,0x2ff8009f,
0x7fffdc00,0x5fff1001,0x00037fec,0xfa87fff1,0x00003fff,0xfff103e6,
0xfe83ffff,0x7ffd404f,0x41bfa007,0xff904ff8,0xff903fff,0xfd003fff,
0x0fffdc9f,0x0dffffd0,0x01bffffa,0x3ffffffa,0x5ff70003,0x7ffffcc0,
0x7fd400ff,0x4007ffff,0x3f2005fb,0x7cc04fff,0x2600dfff,0x82ffffff,
0x10004ffa,0x22003ffb,0x9cffffff,0x7ffec03f,0x3ffea00f,0x7fe41fff,
0xff000fff,0x7fff4409,0x001fffff,0x09ffffd1,0xffffffb8,0x17ff4404,
0x3ffffe60,0x36002fff,0x7fec000f,0x7fe4001f,0x01fffecf,0x03fff600,
0x0017fffa,0x7c07f440,0x23ffffff,0x9800fffc,0xff1007ff,0x40ffe609,
0x81fffffb,0x01fffffc,0xfcdfff98,0x7ff404ff,0xfffd06ff,0xfff500df,
0x2000bfff,0xffd805fb,0xe802ffff,0x01ffffff,0x22007f20,0x006ffffe,
0x03fffff3,0x07fffffc,0x00007fe6,0x22003fea,0xecffffff,0xffffa805,
0x3fffea05,0xffffb83f,0x1ffa801f,0x7fffec40,0xff3002ff,0xf300ffff,
0x009fffff,0xff300bfa,0x3fffffff,0x1001f200,0x10005fff,0xbfffffff,
0x7ffcc000,0x6fffc80f,0x1ff90000,0xffffff70,0x017ffe67,0xf3007fb8,
0x07fee07f,0x0fffffdc,0x0fffffe4,0xfffffd80,0x7ff400ff,0xfffd06ff,
0x3ffa00df,0x8000ffff,0xff9800fd,0xb805ffff,0x04ffffff,0x7ec01ba0,
0x2000efff,0x00fffffd,0x88bffff7,0xd97302fe,0xb9a2379d,0xfff8805f,
0x000fffff,0x205fffff,0x83fffffa,0x01fffffb,0x2a007fc8,0x2000bdec,
0x04fffffd,0xffffff88,0x805f7004,0xfffffdf9,0x7c800eff,0x017fdc00,
0xfffff900,0x7d40001f,0xffb81fff,0xfa80004f,0x7bb500ff,0x3ffea5ff,
0x803ec007,0xff901ffb,0x7ffffdc0,0xfffffc81,0xffff3001,0xffd007ff,
0x3ffa0dff,0xff7006ff,0x8009ffff,0x3fa005f8,0x400fffff,0x7ffffff8,
0x7007f100,0x007fffff,0x5fffff98,0x360b7660,0xeffc884f,0x6fffc98a,
0x3e201fec,0x03ffffff,0x1bffffa0,0x1fffffd4,0x17ffffdc,0x00027fc0,
0xffffa800,0xff8801ff,0x8704ffff,0x4fcc02f8,0xfffffffd,0x4007c805,
0x440002fd,0x004fffff,0x1ffffe40,0x000fffe4,0x03fffea0,0x7e47fe20,
0x2a003fff,0x07fd800f,0xffb81bfa,0xffc81fff,0x36001fff,0xd006ffff,
0x3a0dffff,0x1006ffff,0x1fffffff,0x000fdc00,0x7ffffff7,0xfffffb00,
0x01f7005f,0xffffff88,0xfffe8001,0xf88002ff,0x04fff986,0x0ff11bf2,
0xffffff88,0x7fff4007,0xfffa81ff,0xfffb83ff,0x7fcc02ff,0xd0000002,
0x00dfffff,0x3fffffe2,0x02d86884,0xfffe8fcc,0x6404ffff,0x0004c007,
0x0aaaa980,0x7ffe4000,0x04ffe86f,0x7fffdc00,0x27fa800f,0x02fffffd,
0xfd001f10,0x7027fc0d,0x903fffff,0x003fffff,0x00d55544,0x06ffffe8,
0x00dffffd,0x7fffffe4,0x0017a003,0xfffffff1,0xfffff500,0x00bd00bf,
0x0ffffffd,0x3ffff200,0x7e4000ff,0x037ffc42,0x0bf21be2,0xffffff88,
0x7ffec004,0xfffa84ff,0xfffb83ff,0x3fe402ff,0x5bdb7500,0xffff7001,
0x3e2007ff,0xa84fffff,0x7cc00886,0xffffff11,0x03e405ff,0x00000000,
0x3fff2000,0x13fee1ff,0xffff9000,0x035557ff,0x7ffdc7fb,0x3800cfff,
0x7f777744,0xeeeeeeff,0x5c1eeeff,0xc81fffff,0x001fffff,0xfffd0000,
0x3fffa0df,0x3fe2006f,0x5006ffff,0xff90003f,0xf005ffff,0x01ffffff,
0x3ea017cc,0x004fffff,0xffffff70,0xd87f8007,0x6b802fff,0x3e206f88,
0x004fffff,0x37ffffec,0x1fffffd4,0x17ffffdc,0x22017fa0,0xffdcfffe,
0x3fff603e,0xf1003fff,0x909fffff,0x87e6000d,0xfffffff9,0x220f901f,
0x0aaaaaaa,0x510675cc,0x81555555,0x2000ceb9,0xadfffffa,0x40002efd,
0xfffffffd,0x7c45ffff,0x7ffffcc6,0x44003fff,0xffffffff,0xffffffff,
0x7fdc2fff,0xffc81fff,0x55501fff,0x55555555,0xfd055555,0x3fa0dfff,
0x6c006fff,0x01ffffff,0xf30006e8,0x80bfffff,0xfffffffa,0x2e01f203,
0x03ffffff,0xfffff300,0x27d400bf,0x801fffe6,0x2201fb03,0x04ffffff,
0x7ffffe40,0x7fffd40f,0xffffb83f,0x0bfe602f,0x41bfff30,0xfd04fffc,
0x005fffff,0x3fffffe2,0x80037c44,0x7ffdc1f9,0xc80effff,0xffff9107,
0x7ffe47ff,0x3fff225f,0x3ff23fff,0x3e2005ff,0x2effffff,0xecc88000,
0xcccfffff,0x203ba22c,0xffffffff,0xff1003ff,0xffffffff,0xffffffff,
0xffffb85f,0xffffc81f,0xffff881f,0xfffeeeff,0xffe86fff,0xfffd06ff,
0xff9800df,0x4c05ffff,0x3fa0002f,0x200fffff,0xfffffffd,0xb009f106,
0x05ffffff,0x3fffe200,0x3ee006ff,0x037ffe42,0x880fe400,0x04ffffff,
0x7ffffe40,0x7fffd41f,0xffffb83f,0x03fee02f,0x41ffff98,0xf83ffff8,
0x01ffffff,0xffffff10,0x0006fc89,0xfff903f3,0xf90bffff,0xfffffc80,
0xffffff93,0xfffffc81,0xffffff93,0x7fff4001,0x776406ff,0xb04eeeee,
0x201fffff,0x3fea05fa,0xffffffff,0x7fd8002e,0xf701bfa0,0xf903ffff,
0xf103ffff,0xff9813bf,0xfe82ffff,0xffd06fff,0xfd000dff,0x401fffff,
0x7dc0006d,0x303fffff,0xfffffb7f,0x003f503f,0x5ffffffd,0x3ffe2000,
0x32007fff,0x2fffec1f,0x817d4000,0x4ffffff8,0x7fffe400,0x7ffd42ff,
0xfffb83ff,0x17fa02ff,0x20ffffb0,0x261ffffd,0x1fffffff,0xfffff100,
0xdffb519f,0x407e6000,0xfffffffe,0x3ea03e43,0xffabffff,0xfa87ffff,
0xffabffff,0x2007ffff,0xfffffffb,0x3fff2203,0xffb00bef,0x19701fff,
0xfffff700,0x3bffffff,0x8837f400,0x7fdc04ff,0xffc81fff,0x5f881fff,
0x3fffffa0,0xdffffd05,0x1bffffa0,0x3fffee00,0x07f104ff,0xffff8800,
0x51f907ff,0x09ffffff,0xfff100dd,0x0003ffff,0x3fffffe2,0x7ec1881f,
0x027fff40,0x8827cc00,0x04ffffff,0x7ffffe40,0x7fffd43f,0xffffb83f,
0x07ff102f,0x837fffcc,0x2a4ffffb,0x0fffffff,0xfffff100,0xdfffffff,
0x407e6000,0xfffffff8,0xf301f22f,0x19f9ffff,0xf309fff9,0x19f9ffff,
0x7009fff9,0xfffffbff,0xffd801ff,0x7ffec00e,0xc80000ff,0xffffffff,
0x8802ffff,0x7ff304ff,0xfffffb80,0xfffffc82,0xf701f881,0x201fffff,
0xd06ffffe,0x144dffff,0xffffff80,0x0001f907,0xffffff90,0x7ffc9f05,
0x1fc47fff,0x7ffffcc0,0x3e0001ff,0x22ffffff,0xfb1dffd8,0x05ffff81,
0x104f9800,0x09ffffff,0xfffffc80,0x7fffd43f,0xffffb83f,0x01ff702f,
0x82fffff4,0x2a6ffffb,0x07ffffff,0x3ffffe20,0x6fffecef,0x403f3000,
0xfffffff9,0xf980f90f,0x445fffff,0xffff302b,0x02b88bff,0xfa97ff4c,
0x406fffff,0xfd801ffc,0x0000ffff,0xffffff70,0x07ffffff,0xf703ff98,
0xfffa803f,0xfffe82ff,0x106881ff,0x09ffffff,0x43fffff4,0x27fffff8,
0xfff9003b,0x4f885fff,0xfff30000,0x1fa8bfff,0x3ffffff2,0x26003ee2,
0x0fffffff,0x3fffe000,0x3ff62fff,0xe83f96ff,0x80006fff,0xfff102fa,
0xc8009fff,0x42ffffff,0x83fffffa,0x02fffffb,0xfff80dfb,0xfff505ff,
0x3ffe61ff,0x22007fff,0x24ffffff,0x30006ffa,0xfffa803f,0x0f96ffff,
0xffffff98,0x7ffcc001,0xa8001fff,0x7ff42fff,0x3a03ffff,0xfffb004f,
0x400001ff,0xffffffd8,0x202fffff,0xff901ffb,0xfffff300,0xfffffd87,
0x3f60101f,0x7406ffff,0x221fffff,0x0ffffffe,0x3fe2005b,0x7dc6ffff,
0x3fa00000,0x3a0fffff,0x7ffffcc6,0x44017a5f,0x1fffffff,0x3fffe000,
0xfff11fff,0x85f73fff,0x0006fffc,0xff101fc8,0x8009ffff,0x1ffffffc,
0x27ffffdc,0x17ffffdc,0xf101ffc4,0x2a09ffff,0xf11fffff,0x01ffffff,
0x3ffffe20,0x0037dc4f,0xfc801f98,0xcdffffff,0x7fffcc07,0xff98007f,
0xa8007fff,0xff987fff,0x882fffff,0x3ff6006f,0x00000fff,0xfffffd98,
0x3606ffff,0x0dfd00ff,0x3fffffe0,0xfffefdac,0x3e6002ff,0x402fffff,
0xadfffffe,0xffffdeeb,0x2000fdef,0x1ffffffd,0x7000017a,0x27ffffff,
0xfffe82f9,0x02f98fff,0x3fffffe0,0xff10002f,0x261fffff,0x9affffff,
0x7fffd44f,0x07ec0000,0xffffff88,0x7ffe4004,0x3fa20fff,0x5c1effff,
0xa82fffff,0x3fea01ff,0xff504fff,0x7ffc7fff,0x1001ffff,0x09ffffff,
0x3e6000dd,0xffffb001,0x980fffff,0x006fffff,0x6fffff98,0x7fffc400,
0xfffff905,0x01fc83ff,0x3fffff60,0x26000000,0xfffffffe,0xfffff13f,
0xffffffff,0x05ffffff,0xfffffff3,0xfffff93f,0x3ffa001b,0xff805fff,
0xdfffffff,0xffffff88,0x7fcc002f,0x3f55ffff,0xff880000,0x0f97ffff,
0x3fffffee,0x7ec007db,0x003fffff,0xffffff10,0x6ffffd8f,0x3fff61fe,
0xdf101004,0x7ffffc40,0x7fe4004f,0x3fea7fff,0x1fffffff,0x0bffffee,
0xff501bf6,0x3ea09fff,0x3f64ffff,0x002fffff,0x9ffffff1,0x26000d90,
0xffd1001f,0x80ffffff,0x05fffff9,0xfffff980,0x7ffe4005,0xffff106f,
0x3ea1ffff,0x7ffec003,0x1b0000ff,0x3fffaa00,0xfff14fff,0xffffffff,
0xffffffff,0x3fffea05,0xffff90ef,0xfb803fff,0x800fffff,0xfffffdff,
0x7ffffd44,0xfffd0002,0x00bd1fff,0x3fff2000,0x103fbfff,0xffffffff,
0xfffc8009,0x30004fff,0x8bffffff,0x322fffe9,0x7fffc42f,0x32076200,
0x3ffe202f,0x64004fff,0x006fffff,0x7ffffdc0,0x4c04ff82,0x704fffff,
0x547fffff,0x03ffffff,0xffffff10,0x0dc0d509,0x26001f98,0x7fffffff,
0x7ffffcc0,0xfff98003,0x7f4003ff,0xf301ffff,0x3dffffff,0xffb000df,
0x20001fff,0x7fec003d,0xddd16fff,0xddddddff,0xdddddfff,0x40ab9803,
0x44001fe9,0x04ffffff,0xbb98ff88,0x0055d401,0xfffff700,0x00005fbf,
0x3ffffe60,0x3f200fff,0x01ffffff,0x7ffffcc0,0xff70004f,0x2605ffff,
0xe986f882,0x3e982fff,0x7c407f88,0x004fffff,0x1fffffe4,0x3ffee000,
0x0ffd41ff,0x3ffffe20,0xfffff704,0xfffffe85,0xffff1004,0x40d109ff,
0x003f301e,0xffffffa8,0x7fffcc07,0xff98003f,0x22003fff,0x03ffffff,
0x3fffffea,0xd8000fff,0x000fffff,0xe8800bb0,0xfb86ffff,0x00ffb01f,
0x02ffa800,0xfffffd80,0x03ff5006,0x7c000000,0x06ffffff,0x7ff40000,
0x4c05ffff,0x06ffffff,0xfffffb00,0x3ff6000d,0x90006fff,0x3fff209f,
0xb00efddf,0xfff8807f,0x20204fff,0x007ffffc,0xfffffb80,0xf803fe40,
0xf705ffff,0xfb83ffff,0x1007ffff,0x09ffffff,0xf300f980,0xfff90003,
0xff980fff,0x98003fff,0x003fffff,0x3fffffe6,0x7fffe406,0x8000efff,
0x00fffffd,0x8001fb00,0xd84ffff9,0x01bfa07f,0x01fff000,0xfffff980,
0x7ff9002f,0x40000000,0x3ffffffc,0x7dc00000,0x801fffff,0x03fffffe,
0xfffff100,0xffd0003f,0x0c405fff,0x54c05fd0,0x3ee009bc,0xffff8805,
0xefea84ff,0x0fffff21,0x7dc37100,0x7fc0ffff,0xffffb004,0x3ffff20b,
0xfffffb07,0xffff3005,0x7e8009ff,0x40007e60,0x407ffffd,0x03fffff9,
0xfffff980,0x3ffe2003,0x6c05ffff,0xefffffff,0xffb01501,0x20001fff,
0xff8005fd,0x06fe82ff,0x00009ff1,0x000fffcc,0x17fffffa,0x02ffec28,
0xf1000000,0x000fffff,0xffff1000,0x3fee00df,0x20000fff,0x05fffffc,
0x7ffffd40,0x5dff9105,0x0005ff10,0x1001df70,0x09ffffff,0x7ec9fffd,
0x22000fff,0xfff70fff,0x02ff98ff,0x0dffff30,0x40fffff2,0x06fffff8,
0xffffffa8,0x817f6004,0xd10001f9,0xf980ffff,0x8003ffff,0x03fffff9,
0x7fffff40,0x7ff404ff,0x43ffffff,0xfffc80fa,0xfb0000ff,0xfff8005f,
0x827fc40f,0x00003ff9,0x800fffee,0x0ffffffb,0x7fff8b10,0x40000000,
0x003ffffd,0xfff90000,0x3fe2007f,0x440005ff,0x00fffffe,0x3fffffa0,
0xfffff700,0x009ff501,0x007bf620,0x7fffffcc,0x27ffff85,0x4003fffd,
0xff71fffa,0x07fc89ff,0x07fffe40,0x203ffff4,0x03fffff9,0x7fffffdc,
0x09ff9004,0x10001fd4,0xf980ffff,0x8003ffff,0x03fffff9,0x7ffffdc0,
0xea81dfff,0xffffffff,0x703fedff,0x5c3fffff,0x3fffb003,0x0bffe600,
0x7dc0bfe6,0x2a00001f,0x8801ffff,0x03ffffff,0xffff8972,0x00000000,
0x003fffe6,0x7fcc0000,0x3f6000ff,0x880002ff,0x004ffffe,0x03fffff5,
0x1ffffff4,0x00befe88,0x00dffc88,0x3ffffe60,0xffffd85f,0x0007ffd0,
0x3ee3fff5,0x05fe86ff,0x1ffff440,0x007fffe6,0x0fffff62,0xffffffe8,
0x7fff5406,0x0017f603,0xa80fff50,0x003fffff,0x3fffffa8,0xffffd800,
0xdcffffff,0xfffdcfff,0x6fffffff,0x3ffffe20,0x36005b9d,0xe803ffff,
0x3ff704ff,0x0001ff60,0x7fffff10,0xfffffd80,0xf993ea06,0x00001fff,
0x27ff4000,0x3a000000,0x7d4004ff,0x2200007f,0x404ffffe,0x01effffa,
0x27fffffc,0x2f7fff20,0xffdca99a,0x7f44003f,0x43ffffff,0xfaaffff9,
0x3f60003f,0x1fffe9df,0x40017fcc,0xd12effd8,0xb8003dff,0xaaceffff,
0xffffffeb,0xedccdeff,0x02ffffff,0x0039fff7,0x2e03fdc0,0x004fffff,
0x4fffffb8,0xfffd8800,0xffffffff,0x3ffee0cf,0x00efffff,0x7fffffd4,
0x3ff6000f,0x4c0aefff,0x3f603ffe,0x001bfa07,0x3fffea00,0x7fcc4dff,
0xb882ffff,0x3ffe23ff,0x00000007,0x0001ffa8,0x0ffdc000,0x0027fc00,
0x7fffdc00,0xffb710ad,0x3f2009ff,0x8800ffff,0xffffffeb,0x22002eff,
0xffffffee,0x93efffff,0x05dfffff,0xffff7000,0x1ff70159,0x7ffe4000,
0x000dffff,0xffffb510,0xffffffff,0xffffffff,0x3fffffff,0x7fffff54,
0xb0003eff,0x7ffec40f,0x22000eff,0x0efffffd,0xfffd5000,0x019fffff,
0x3fffffe6,0xffb5000d,0xed80039d,0xefffca88,0x400dfffe,0x9ff105fe,
0x3a600000,0x744fffff,0xaaffffff,0x3ffffdca,0x000177e4,0x05f80000,
0xf8800000,0x03f90005,0x3ae20000,0xffffffff,0x22001cef,0x8004fffd,
0x0aaccba9,0x20000000,0x0000acb9,0x79700100,0x32a20000,0x8800000a,
0x09999aa9,0x00000000,0x3ea09000,0xffffffff,0xffffa806,0x006fffff,
0x26f2ea60,0x0b2a6000,0x40001000,0x7997500b,0x0b320013,0x0000e644,
0x02aee600,0xfffffff7,0xffffffff,0x0000005f,0x00350000,0x06e00000,
0x0001cc00,0xccaa8800,0x40001abc,0x000000a9,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00da8000,0x880005b8,0x19999999,0x33333330,0x13333333,
0x33333310,0x6e540333,0x9999acee,0x26660999,0x00019999,0x000013b6,
0x5666e54c,0x00000001,0x99999988,0x99999999,0x99999999,0x4c000099,
0x99999999,0x99999999,0x99999999,0x20030000,0x0ea801e9,0x26666666,
0x00099999,0x00e64c00,0x26600000,0x00199999,0x4ccccccc,0x33333301,
0x33333333,0xa8800001,0x3300accc,0x10333333,0x33330597,0x20333333,
0x4c199998,0x99999999,0x88099999,0x440002cb,0x1bea00ef,0x3ffa6000,
0xd81fffff,0xfffffffe,0xc81defff,0xeffffffe,0xdfffe984,0xfffffffb,
0x3fffa2ff,0x20007fff,0x200007fc,0xffffffc8,0x000befff,0x3fffea00,
0xffffb83f,0xffffffff,0xffffffff,0x0005ffff,0x7ffff764,0xffffffff,
0xffffffff,0x7e4003ff,0x77c401ef,0xc89be600,0xfffffffe,0xeeffffff,
0xffe8001c,0x000003ff,0x3fffffa0,0x3fe2007f,0x887fffff,0xfffffffe,
0x04efffff,0xbff91000,0x441dfff9,0x7ffffffe,0x22ffffdc,0xffffffff,
0xfffe80ff,0xffd910ff,0xffffffff,0xfffb87bd,0x7fc0005f,0xfcb99ace,
0x2200004f,0x01ffffff,0x3fffffa2,0xfd1000ef,0x3fea01ff,0x7fff43ff,
0x7cc2ffff,0x0007ffff,0x0000bfe6,0x359fff91,0xfffb5533,0x3f600009,
0xff704fff,0xfb99bdff,0x99dfffff,0x0bffffd9,0x7ffe4000,0xcdffffff,
0xfffecccc,0x3e6003ff,0xfe806fff,0xfcb99ace,0xfffd105f,0xd999bfff,
0x019fffff,0xffffff50,0x40000003,0x07fffffa,0x7fffdc40,0x7ffcc07f,
0x002fffff,0x3fff4400,0xf509fffd,0xff8fffff,0x3224ffff,0x02ffffff,
0x880f7fc4,0xfffffffe,0x3ffffe01,0x3ee0003f,0xffffffff,0x6400000f,
0x401fffff,0x3ffffffb,0x817fc400,0xa86ffff8,0x0999ffff,0x07ffffe8,
0x0027fc00,0x005dfd30,0x003bfae2,0x09ffff00,0x4c07ffdc,0x83ffffff,
0x0005ffd8,0x3feffe60,0x2202ffff,0x2003fffd,0x01fffffc,0x7fffffd4,
0x2e01ffff,0x83ffffff,0x2fffffe9,0x7ffffec0,0x0000005f,0x03fffff4,
0x7fffff80,0xfffffa80,0xe800004f,0x3ffe5fff,0xfffff07f,0x7ffffd4f,
0xffffe87f,0x00ff802f,0x7fffffd4,0x3fffea04,0x6c0007ff,0xffffffff,
0xfc800003,0x5401ffff,0x03ffffff,0xfd00ff80,0xff109fff,0xffe80bff,
0x640007ff,0xff50007f,0x3f620009,0xff50001f,0x0ffb809f,0xffffff30,
0x002fec07,0xff55f900,0x9005ffff,0x7d4007ff,0xfb007fff,0x7fffffff,
0xfffffa80,0x3fff203f,0x3fee05ff,0x0006ffff,0x7fff4000,0xffd0007f,
0xff300fff,0x0007ffff,0x5ffffb80,0x740ffff6,0x3e67ffff,0x40ffffff,
0x04fffffb,0x7cc027c4,0x203fffff,0xfffffff9,0x3f620000,0x003fffff,
0xffff7000,0xfffa803f,0xe8002fff,0x3ffffe07,0x3fffff03,0x3fffff40,
0x07fea000,0x003ff300,0x001ff500,0x700bffb0,0x7ffcc05f,0x3e203fff,
0xbf300005,0x3fffffea,0x007f9002,0x004ffff8,0x3ffffff2,0xffff9803,
0x7ff403ff,0xff104fff,0x000fffff,0xfffd8000,0xffd0007f,0xff300fff,
0x0007ffff,0x5ffffc80,0xffd00dd4,0xfffe8fff,0x7fc41fff,0x7dc07fff,
0xffff9801,0x7ff403ff,0x0001ffff,0x00bdeca8,0x3fee0000,0x7d401fff,
0x002fffff,0xfff307d8,0x3ffe07ff,0x3ffa02ff,0xf80007ff,0x3fa2004f,
0x99999992,0x2e015599,0x5ff8005f,0xf980f700,0x403fffff,0xfb00005c,
0x3ffffea1,0x07f1002f,0x00039500,0x0039bd93,0x3fffffe6,0x7fffcc03,
0x9d9102ff,0x00000dfd,0x7ffffd80,0xffffd000,0xffff300f,0x800007ff,
0x005ffffd,0x87ffffe8,0x80ffccdb,0x02fffffd,0x7fcc01b6,0xb803ffff,
0x000ffccd,0x00000000,0x1fffffb8,0x7ffffd40,0x07d8002f,0x07fffff3,
0x80fffffe,0x007ffffe,0x2006fd80,0x3ff664fd,0xfffebaff,0x003fd80d,
0x4b8017ea,0x7ffffcc0,0x002cc03f,0xff51fd40,0x0e05ffff,0x000000f6,
0xff980000,0xe803ffff,0x00ffffff,0x00004fc8,0x7fffec00,0xfffd0007,
0xfff300ff,0x00007fff,0x05ffffe8,0x7ffffe80,0xfa83fd40,0xf105ffff,
0x3ffe6007,0x54003fff,0x0000007f,0xff700000,0xfa803fff,0x002fffff,
0x3ffe07d8,0xffff03ff,0x7fff403f,0xfa80007f,0x86f8801f,0x7d47fffa,
0x3fc40eff,0x98003100,0x7fffcc01,0x003803ff,0x3ea37c40,0x882fffff,
0x00003b86,0x26000000,0x03ffffff,0xffffffb8,0x002ff804,0x7fec0000,
0xfd0007ff,0xf300ffff,0xc87fffff,0x3ffe0001,0xfe8005ff,0x7e407fff,
0x3ffffe05,0x001fb80f,0x7ffffff3,0x005fc800,0x55555553,0x555554c1,
0x3b26002a,0xffff70cd,0xfffa803f,0xd8002fff,0x3ffff207,0x6ffff884,
0x3fffff40,0x0039db73,0xf9007ff1,0x0ffff105,0xf907ffff,0x00000005,
0xffffff98,0xc8000003,0x7fffd41f,0x106a82ff,0x2aaaaaa0,0xaaaaaaaa,
0xaaaaa82a,0xff3002aa,0x1007ffff,0x0fffffff,0x2aa26f98,0x261aaaaa,
0xb001cedb,0x000fffff,0x01fffffa,0x3fffffe6,0x0003fd13,0x02fffffc,
0x3fffff40,0xfc803fe0,0x6d83ffff,0x3fffe600,0x7fc003ff,0xfffd5000,
0x7f543fff,0x400fffff,0xfffffffb,0x1fffffba,0x7ffffd40,0x07d8002f,
0x217fffe6,0x404ffff9,0xf97ffffe,0x03ffffff,0x7f806fd8,0x90ffff10,
0xdf10bfff,0x55555550,0x55555555,0xfff98005,0x00003fff,0x7d427cc0,
0xc82fffff,0x3ffe2006,0xffeeefff,0xfc86ffff,0x007fffff,0x7ffffff3,
0x3ffffa00,0x87f602ff,0xffffffd8,0xffffff74,0xffffb00b,0x3ffa000f,
0x260397ff,0x9bffffff,0x7c0001ff,0x8005ffff,0x207ffffe,0x7fcc04fa,
0x1fc46fff,0xfffff300,0x27d4007f,0x7ffff400,0xfffff81f,0x3fff200f,
0xfefda9cf,0x5401ffff,0x02ffffff,0x7dc07d80,0x7fe40fff,0xfffe804f,
0xffbcfeff,0x2e00ffff,0x13ea00ff,0x6c3fffc4,0x1fb05fff,0x7fffffc4,
0xfffffeee,0x7fcc006f,0x0003ffff,0xfa837400,0x442fffff,0x3fe2006f,
0x7ffcc09d,0xff102fff,0x2600ffff,0x03ffffff,0xffffffb0,0x5c0bf209,
0xfccfffff,0x2fffffff,0x3ffffec0,0xffffe800,0xff300fdf,0x1dfdffff,
0xffff0000,0xffd000bf,0x13e60fff,0x7fffffc0,0x98003ee0,0x03ffffff,
0x20009f30,0x81fffffd,0x00fffffd,0xb0dffff5,0x03ffffff,0xffffffa8,
0x807d8002,0xd9bfffea,0xfd002fff,0x441dffff,0x00effffd,0x7dc07ff1,
0x8ffff102,0x902ffff8,0x4effc43f,0x7ffffcc0,0x7fcc002f,0x0003ffff,
0x540bee00,0x42ffffff,0x3e2006fc,0x3ffffa05,0x7fff405f,0xfff3007f,
0x36007fff,0x45ffffff,0x3ea01ed9,0x12ffffff,0x01fffffd,0x43ffffec,
0x3ffa02ca,0x2600efff,0x4fffffff,0x3ffe0000,0xfe8005ff,0x7e447fff,
0x3fff2003,0x001ba3ff,0x7ffffff3,0x003fc880,0x3fffff20,0xfffffd81,
0x5ffffd00,0xfffffd10,0xffffa803,0x7d8002ff,0x3ffff200,0x3a000bdf,
0x880fffff,0x205fffff,0x07f205fe,0x323fffc4,0x3ea06fff,0xfe817e22,
0x2a05ffff,0xffeeeeee,0xeeeeffff,0x440005ee,0x3ffea05f,0xfea8afff,
0x07e2006f,0x7fffffdc,0x7ffff400,0xfb999107,0x99bfffff,0xffc85999,
0x3626ffff,0xffff9802,0x7ffdc2ff,0x3ff601ff,0x7ffe47ff,0xfffffd04,
0xffff9801,0x400004ff,0x005fffff,0x47ffffe8,0x7cc000bd,0x7f16ffff,
0xffff9800,0x05ec03ff,0x3fff2000,0xfffc81ff,0xfffa80ff,0x3ffee07f,
0x7fd401ff,0x8002ffff,0x25d7007d,0x3fa00018,0x3fa07fff,0x3ee07fff,
0x201fb00f,0xfbaffff8,0x7cc03fff,0x7dc07e24,0x200fffff,0xfffffffb,
0xffffffff,0x40006fff,0x3fea00fd,0xffffffff,0x1a2006ff,0x7fffffc4,
0xffffe804,0xfffff307,0xffffffff,0xffb89fff,0x0007ffff,0x09fffff3,
0x05fffff5,0x13ffffec,0xd01fffff,0x300fffff,0x07ffffff,0xffff8000,
0xffe8005f,0x200007ff,0xb9fffffe,0x7fcc000f,0x0003ffff,0xffff9000,
0xffff903f,0xffff901f,0x7fffdc0d,0x7ffd401f,0xd8002fff,0x017f4c07,
0xffffd000,0x7fffe40f,0x05ff300f,0x7fc403f6,0x2ffffcff,0x1a24f980,
0x7fffffc4,0xfff30004,0x00007fff,0x9999df50,0xffffb999,0xfffb79ff,
0xfb00800d,0x200dffff,0x007ffffe,0x7ffffff3,0x3fffee00,0xf30007ff,
0xf509ffff,0x6c05ffff,0x7fc7ffff,0xfffd07ff,0xfff300ff,0x00007fff,
0x05fffff8,0x7ffffe80,0x3fee0000,0x006ecfff,0xffffff98,0x90000003,
0x903fffff,0xb01fffff,0x5c0dffff,0x401fffff,0x2ffffffa,0x7407d800,
0x200001ff,0x207ffffe,0x02fffffb,0x0fe417fa,0xf77fff88,0x5f500dff,
0xffffb008,0x7cc000df,0x003fffff,0x7fffc400,0xffffffff,0x262fffff,
0x980006ff,0x02ffffff,0x0fffffd0,0x3ffffe60,0xfff9003f,0x2000bfff,
0x84fffff9,0x03fffffa,0x91fffff6,0xff309fff,0xf300ffff,0x007fffff,
0xfffff800,0xfffe8005,0xeee8007f,0xffffeeee,0xeeeeffff,0xfff300ee,
0x00007fff,0x3ffff200,0xffffc81f,0xfffff80f,0x3fffee05,0x7ffd401f,
0xd8002fff,0x3bffe607,0x0199999b,0x3fffff40,0x9fffff70,0xfb83fe40,
0x4ffff102,0x6403fffe,0xfff9801f,0x20002fff,0x3ffffff9,0x0fe40000,
0x7ffffd40,0x0037cc2f,0x7fffff40,0x3fffa005,0xfff3007f,0x36007fff,
0x04ffffff,0xfffff300,0xfffff509,0x7fffec07,0xfa81c987,0x407fffff,
0xffffffe9,0x7fc00003,0xe8005fff,0x8007ffff,0xfeeeeeee,0xeeffffff,
0x300eeeee,0x07ffffff,0x3f200000,0xfc81ffff,0x7c40ffff,0x2e05ffff,
0x401fffff,0x2ffffffa,0x3206e800,0xffffffff,0x03dfffff,0x03fffff4,
0x0bfffff5,0x7cc17fcc,0x4ffff104,0x6c07fffa,0xfffe800f,0x4c0005ff,
0x03ffffff,0x013e6000,0x7fffffd4,0x40006d82,0x0ffffffb,0x3ffffa00,
0xffff3007,0x3f6007ff,0x003fffff,0x9fffff30,0x7fffff50,0x3ffffec0,
0xffd9f100,0x7fd40fff,0x03ffffff,0x7fffc000,0xffe8005f,0x400007ff,
0x05fffffb,0xfffff300,0x0000007f,0x07fffff2,0x03fffff2,0x0bfffff3,
0x0fffffdc,0x3ffffea0,0x06e8002f,0x3fffffee,0xffffffff,0xfffd00ef,
0x7ffd40ff,0x27fc04ff,0xfff107f8,0x03fffe8f,0xff700df1,0x0001ffff,
0xffffff98,0x1ba00003,0xfffffa80,0x0006b82f,0x3fffffe2,0x7fff4004,
0xfff3007f,0x3a007fff,0x01ffffff,0xfffff300,0xfffff509,0x7fffec07,
0x7f4a2007,0xbf907fff,0x7ffffff3,0x3e122000,0x8005ffff,0x007ffffe,
0x7fffd400,0xff30005f,0x0007ffff,0xffc80122,0xffc81fff,0x7fcc0fff,
0x3ee05fff,0x4c01ffff,0x02ffffff,0x3e206f80,0xffffffff,0x6fffffff,
0x0fffffd0,0x17ffffd4,0x7e41ff20,0x0ffff982,0x203fffe6,0x7fc402fc,
0x0004ffff,0xffffff98,0x3f700003,0x7fffd400,0x206982ff,0x3fff602a,
0xfe8006ff,0xf3007fff,0x007fffff,0x3ffffffe,0xfff30000,0xfff509ff,
0x7fec07ff,0xfd0007ff,0x9f10ffff,0x3fffffe6,0xf0970003,0x000bffff,
0x00fffffd,0xffffa800,0xff30005f,0x0007ffff,0xffc8012e,0xffc81fff,
0x7fc40fff,0x3ee06fff,0x4c01ffff,0x03ffffff,0x74c05f80,0xffffffff,
0x0fffffff,0x07ffffe8,0x03ffffea,0xf103ff50,0x5ffff70d,0x446fffd8,
0xfffd807f,0x300006ff,0x07ffffff,0x00bf1000,0xffffffa8,0x81740d02,
0x2ffffff9,0xffffe800,0xffff3007,0xff3007ff,0x0007ffff,0x27ffffcc,
0x1fffffd4,0x0fffffb0,0x3ffffa00,0x3fe62887,0x0003ffff,0xfffff07d,
0xfffd000b,0x999000ff,0xfffb9999,0x99999dff,0x3fe60199,0x0003ffff,
0x7fe4009d,0xffc81fff,0xfff80fff,0x3fee07ff,0x7c401fff,0x003fffff,
0x7dc01fcc,0xffeeeeff,0x82ffffff,0x207ffffe,0x007ffffb,0x53f209ff,
0xffffffd8,0xdffff11e,0xf300ff61,0x005fffff,0x3fffe600,0xd80003ff,
0x7fd4000f,0x4002ffff,0xfffd01fa,0xd0140bff,0x200fffff,0x3ffffff9,
0xfffffd80,0x7fcc0006,0xffa84fff,0x3f603fff,0xd0007fff,0x300fffff,
0x07ffffff,0xff05f100,0xd000bfff,0x000fffff,0xffffffff,0xffffffff,
0x201fffff,0x3ffffff9,0x003f9800,0x07ffffee,0x03fffff2,0x03fffffa,
0x0fffffdc,0x7fffff40,0x017e4005,0x3003ffd5,0xfd03fffd,0x7e40ffff,
0xfb005fff,0x9997f40d,0x20999999,0xbf719998,0xfffffd00,0x2600140b,
0x03ffffff,0x001fd400,0x7fffffd4,0xb83ec002,0x00ffffff,0x7fff40b1,
0xfff3007f,0xf8807fff,0x001fffff,0x7ffffcc0,0xfffffa84,0x3ffff603,
0xfffd0007,0xfff300ff,0xb0007fff,0xfffff03f,0xfffd000b,0xa80000ff,
0x005fffff,0xffffff30,0x05fb0007,0x7ffffdc0,0x7ffff441,0xffffa80f,
0xffffb03f,0xfff7003f,0x7cc00dff,0x0bffe206,0x3a0dff00,0x3607ffff,
0x5002ffff,0x3fe203ff,0xefb80002,0x7fffdc00,0x00b100ff,0xffffff98,
0x1be20003,0x7fffd400,0x3ee002ff,0xfffff886,0xe817203f,0x3007ffff,
0x07ffffff,0x4fffffc8,0xfff98000,0xfffa84ff,0x3ff603ff,0xfd0007ff,
0xf300ffff,0x007fffff,0xff81ffb8,0xe8005fff,0x0007ffff,0x7ffffd40,
0xfff30005,0xb8007fff,0x3e6001ff,0x7f43ffff,0xf00fffff,0xb81fffff,
0x02ffffff,0xffffff88,0x02ff8805,0x800bffe6,0xffd04ff8,0xff101fff,
0x7c400bff,0x13fea03f,0x0f7ec400,0x3ffffe20,0x0017203f,0x9ffffff5,
0x01fec000,0xfffffa80,0xbffb003f,0xdfffffb0,0xfd027d40,0x2a00ffff,
0x03ffffff,0x0fffffee,0x7ffcc000,0xfffa84ff,0x3ffa03ff,0xfd0007ff,
0xf300ffff,0x009fffff,0x7c07ffcc,0x8005ffff,0x007ffffe,0x7fffdc00,
0xff30006f,0x4009ffff,0x4000fffb,0xaafffffe,0xfffffefe,0xfffff501,
0xffdf7119,0x2600bfff,0x0cffffff,0x803fea88,0x8800fffe,0x3ffa05fe,
0xffc84fff,0x7ec000ef,0x5f7f4406,0xdffc8800,0xffffd800,0x013ea06f,
0xffffff50,0x3fee000b,0xfff70003,0x5440bfff,0x7cc4fffe,0x882fffff,
0x3fa03ffb,0xb800ffff,0x05ffffff,0x03dffff9,0x7ffd4000,0xfffb84ff,
0x3ffa04ff,0xf8000fff,0xa807ffff,0x0effffff,0x3fffe440,0x37ffffc4,
0x7ffff400,0x3200000f,0x007fffff,0xffffff50,0xffc9801d,0xff98007f,
0xc9efffff,0x00cfffff,0xfffffff5,0xfffff75f,0xfd5007ff,0x79dfffff,
0x2007fffd,0xaadfffd8,0x2ffdbaa9,0x7ef7ff40,0xdfff50bf,0x1ff70001,
0x7bfff900,0xffb95335,0x3fe6007f,0xb882ffff,0x3e6003ff,0x2fffffff,
0x3fff2200,0x7fcc001e,0xdeffffff,0xffffeccc,0x7fff43ff,0xdcaaafff,
0xf503ffff,0x809fffff,0xfffffff9,0xfffedcef,0x400003df,0xffffffd8,
0x3ffffa21,0xfffa80ef,0x2000cfff,0x3ffffffa,0x3ffffa20,0xccccefff,
0xfffffedc,0x7fffe446,0x3ea001ff,0x004fffff,0xfffff700,0x4c0019ff,
0xffffffff,0xfdccccce,0x007fffff,0xbffffd50,0x3fffff21,0xffd501ff,
0x3fee5fff,0x4001acef,0xfffffffc,0x8000cfff,0xffffeec8,0xe800abce,
0x3fffea3f,0x20003fff,0x71003ff8,0xfffffffd,0xfe8005df,0xaaafffff,
0x03ffffdc,0x7fffff44,0xefffffff,0x3fffea02,0xd503ffff,0xfffffffd,
0xffffffff,0x5fffffff,0x7fffffdc,0xffffffff,0x7ffc42ff,0x1fffffff,
0x3fffffa6,0xffffffff,0x0000adef,0xfffff980,0xff8affff,0x3fffffff,
0xfffffff1,0xf8803fff,0xffffffff,0xfffdd10f,0xffffffff,0xffffffff,
0x7fecbfff,0xefffffff,0x3fffe203,0x01ffffff,0xffffed80,0xefffffff,
0xffffd104,0xffffffff,0xffffffff,0x8000dfff,0x00000ab9,0x2a60dd44,
0x2a600001,0x009abccc,0x00008000,0x32e6202e,0x9700001a,0x97530007,
0x70001559,0xffffffff,0xffffffff,0x00000005,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x05530000,
0x33330054,0x33333333,0x26662133,0x99999999,0x4cccc199,0x99999999,
0x26600000,0x99999999,0x20001999,0x446601a8,0x09999999,0x4cccc000,
0x99999999,0x22000099,0x26602601,0x99999999,0x4cc00009,0x99999999,
0x26666661,0x00999999,0x33333300,0x01333333,0x33330000,0x40003333,
0x6544003a,0x998800ac,0x00019999,0x09970000,0x26666666,0x80999999,
0x99999998,0x26662099,0x99999999,0x4ccc4009,0x26019999,0x99999999,
0x99999999,0x44009999,0x266600cb,0x99999999,0xfd100999,0x7cc17dff,
0x3fffb201,0xffffffff,0xffffb32d,0xffffffff,0x3ffb2219,0xffffffff,
0x01ceefff,0x7ffee440,0xdfffffff,0xfffb0004,0xa9fc417f,0x2fffffff,
0x3fb22000,0xffffffff,0x90003def,0x7f441dff,0x3ffb224f,0x4fffffff,
0x3ffea000,0xceffffff,0xfffffdb0,0xdfffffff,0x7440179d,0xfffffffe,
0xffffffff,0xe8001bde,0x07ffffff,0x037fdc40,0xfffffd88,0x3fee01ef,
0x001fffff,0x7fdc0000,0xfffffd07,0x7dffffff,0xfffffd90,0x7fdc5dff,
0xffffffff,0x7f4c03ef,0x80efffff,0xfffffffa,0xffffffff,0x03ffffff,
0x20ffffe6,0xfffffec8,0x2defffff,0xfffffff0,0x001fd9bf,0xffffffd1,
0xfffa807f,0x401fffff,0xffffffe8,0xfffecccd,0xe8000cff,0x06ffffff,
0x7fffec00,0x2febdfff,0x3fffffa2,0xfd100002,0x03ffffff,0xffff9800,
0x07fffee3,0x3fffffa2,0x3a0007ff,0xffffffff,0x7fffec00,0xffedcdff,
0x4400cfff,0xcffffffe,0xfffeccaa,0x54001eff,0x007fffff,0x0dffff91,
0xffffff30,0x4403ffff,0x01fffffe,0x3e600000,0x3fe607ff,0x1fffffff,
0xcffffa80,0x3fffea00,0x4001ffff,0x201effd8,0xbdfffffb,0xffaaaaaa,
0x406fffff,0x406ffffd,0xffffffe8,0x7ffdc02f,0xffffffff,0x3ffee006,
0xfd007fff,0x009fffff,0x3fffffee,0xffffe983,0x7fd4002f,0x0002ffff,
0x3fffffe6,0x40ffffff,0x02fffffc,0x3ffea000,0x80004fff,0x365ffffb,
0xf503ffff,0x5fffffff,0xffdf3000,0x3007ffff,0x87ffffff,0x2ffffffa,
0x7ffffdc0,0xffff701f,0xfe8005ff,0x64c07fff,0x06ffffff,0x7fffffc4,
0x02ffffff,0x07fffff2,0x74400000,0x7cc07fff,0x0fffffff,0x007ffd00,
0x3fffffee,0xffa8001f,0x5fffdc01,0x7fffdc00,0x7fc01fff,0x5401ffff,
0x05ffffff,0xfffccfd8,0x402fffff,0xffffbaaa,0xaaaaaeff,0xfffdaaaa,
0x02aacfff,0x3fffffea,0x3ffff203,0x3fe6005f,0x0001ffff,0x3ffb37f2,
0x264fffff,0xcfffffda,0x0002aaaa,0x7ffffff3,0xfff10000,0x7fffd45f,
0xfff9f300,0x9000dfff,0xffffff7f,0xffff1005,0xfff507ff,0x7d403fff,
0x201fffff,0x1ffffffa,0x3ffffa00,0xffffb307,0xe80dffff,0xffffffff,
0x2e07ffff,0x001fffff,0xfffb0000,0xfff700ff,0x2009ffff,0x7f4004ff,
0x004fffff,0xfc803fc8,0xfff8801f,0xc804ffff,0x9806ffff,0x04ffffff,
0x7fed43e8,0xffe802ff,0xffffffff,0xffffffff,0xffffffff,0x3e607fff,
0x403fffff,0x04fffffe,0xffffff30,0x22ec0003,0x44ffffca,0xfffffffc,
0x007fffff,0xffffff30,0x3ae00007,0x03efc84f,0x3fffabe6,0x22001fff,
0xfffffadf,0xffff002f,0x3ff607ff,0x3ea06fff,0x401fffff,0x06fffffd,
0x1fffff60,0x7ffd4dec,0x3ea06fff,0xffeb9adf,0x701fffff,0x003fffff,
0xfff50000,0x3fa00fff,0x01ffffff,0x4c002fdc,0x0fffffff,0x401be200,
0xffb002fd,0x001fffff,0x005ffff3,0x9ffffff3,0x0cc01500,0xff755500,
0x555bffff,0xfb555555,0x559fffff,0x7fffcc05,0x7fcc03ff,0x9802ffff,
0x01ffffff,0xa9806600,0xfffda980,0x2aaaacff,0xffff3000,0x000007ff,
0xaaf98000,0x05ffffff,0x3fea7ee0,0xf002ffff,0x207fffff,0x1ffffffb,
0xffffff50,0xffffb803,0xffb001ff,0x3ea00fff,0x3a06ffff,0xffff900e,
0x3fee09ff,0x00001fff,0x7ffffc40,0xfff1007f,0x4c0dffff,0xfb0000ef,
0x00bfffff,0x5e800fec,0xfffff300,0xba8005ff,0xffff1000,0x000009ff,
0xffff8800,0xff7004ff,0x2003ffff,0x3ffffff9,0xfffffe80,0x7ffcc00f,
0xeeeeefff,0x000002bc,0x2fffffb8,0x3fe60000,0x0003ffff,0x7cc00000,
0xffffffd2,0x7d5ba001,0x002fffff,0x07ffffff,0x3fffffea,0xfffff502,
0xfffa803f,0xfb003fff,0x2600ffff,0x306fffff,0xfffe801f,0xfff705ff,
0x000003ff,0xffffefe8,0x3ffee007,0xfd04ffff,0x7fc40001,0x801fffff,
0x0ba004f9,0x7fffff40,0x8000006f,0x4ffffff8,0x40000000,0x4ffffff8,
0xfffff700,0x3fe6003f,0xb803ffff,0x04ffffff,0x7fffffcc,0xffffffee,
0x2000003f,0x02fffffb,0x3ffe6000,0x00003fff,0x97cc0000,0x4ffffffb,
0xff52f980,0x2005ffff,0x03ffffff,0x9ffffff3,0x3ffffea0,0x7ffcc01f,
0xfb004fff,0x2600ffff,0x106fffff,0xffff5001,0x3ffee09f,0x000001ff,
0x3fff6bf2,0x7fec007f,0x6c1fffff,0xfc80001f,0x805fffff,0x01a000fe,
0x7fffffdc,0x8000001f,0x4ffffff8,0xaaaaaa98,0x2fb6e60a,0x3ffe2000,
0xf7004fff,0x003fffff,0x3fffffe6,0xffff8803,0x7fcc07ff,0x3621ffff,
0x00efffff,0x55555555,0xfffffb80,0x077bae62,0xfffff980,0x2a00003f,
0x02aaaaaa,0x3fe25f30,0xc807ffff,0x3ffffea7,0xffff002f,0x3fea07ff,
0xf503ffff,0x803fffff,0x3ffffffa,0xfffffb00,0x3fffe600,0x7cc0006f,
0xf703ffff,0xa883ffff,0x0aaaaaaa,0xffb4fa80,0xf8800fff,0x26ffffff,
0x100003fb,0x5fffffff,0x20017dc0,0xffff8800,0x55004fff,0x00555555,
0x9ffffff1,0xfffffd30,0x3ffff25f,0xff1003ff,0x2009ffff,0x1ffffffb,
0xfffff300,0x3ffa007f,0x2602ffff,0x81ffffff,0x0efffffd,0xffffffc8,
0x7fffdc07,0xfffff92f,0x3fe6007f,0x0003ffff,0x3fffff20,0x45f3007f,
0x2ffffffc,0xffa93e20,0xf002ffff,0x207fffff,0x1ffffffb,0xffffff50,
0xffffc803,0xffb001ff,0x3e600fff,0x0006ffff,0x0fffffc4,0x1fffffb8,
0x7ffffe44,0x37c400ce,0x00fffffb,0xffffff50,0x0009f57f,0xfffffb80,
0x00df106f,0x3fff6000,0x32006fff,0x07ffffff,0xffffff88,0x3ffff604,
0xfffffdbf,0xf8800fff,0x004fffff,0x3ffffff7,0x3fffe600,0xffb003ff,
0x4c09ffff,0x81ffffff,0x4ffffff8,0xffffff10,0xfffffb80,0xffffffdb,
0xff9800ff,0x0003ffff,0x7ffffc40,0x4c5f3007,0x06ffffff,0xfffa83ee,
0xff002fff,0x3607ffff,0x206fffff,0x1ffffffa,0x7fffff40,0xfffb000f,
0x3fe600ff,0x40006fff,0x206ffff9,0x01fffffb,0x4007fff3,0x3fff61fe,
0xffb0007f,0x0bffffff,0x3ffa0000,0xfc82ffff,0xfa800001,0x02ffffff,
0x7ffffc40,0xffff8807,0x3fee04ff,0xf31effff,0x100bffff,0x09ffffff,
0x3ffffee0,0xfff3001f,0x36007fff,0x05ffffff,0x3fffffe6,0xfffffd01,
0x3fffa01f,0x7ffdc07f,0xff51efff,0xf300bfff,0x407fffff,0xffe80019,
0x5f3007ff,0xffffffd8,0xffa8bd01,0xf002ffff,0x307fffff,0x05ffffff,
0x7fffffd4,0x3fffe601,0x3f6002ff,0xf3007fff,0x000dffff,0x03ffffa8,
0x07ffffee,0x9000ffd4,0xffffd87f,0xfff10007,0x001fffff,0x3ffea000,
0x27cc6fff,0x7fc40000,0x005fffff,0x0fffffd0,0xffffff10,0x7fffdc09,
0x7ffec0ff,0xfff8807f,0xaaaadfff,0xffdaaaaa,0x9101ffff,0xfffffb99,
0x599999bf,0xffffffc8,0x3fffe606,0xfffb01ff,0x3fa03fff,0x7dc07fff,
0x6c0fffff,0x9807ffff,0x03ffffff,0x4001dffb,0x007ffffe,0xfffa85f3,
0x2fa85fff,0x7fffffd4,0xfffff002,0xfffe987f,0x7fd403ff,0xf501ffff,
0x009fffff,0x07ffffd8,0xdfffff30,0xfffc8000,0x7fffdc06,0x003fd01f,
0x7fec2fd4,0x2a0007ff,0x4fffffff,0x3fa00000,0x3a3fffff,0xc800000f,
0x0fffffff,0xffffd000,0xffff100f,0x7fdc09ff,0xffc82fff,0x7c400fff,
0xffffffff,0xffffffff,0x01ffffff,0xfffffff3,0xffffffff,0xffffb89f,
0x3fe607ff,0xf701ffff,0x205fffff,0x407ffffe,0x82fffffb,0x00fffffc,
0x7fffffcc,0x3ffff983,0x3ffffa00,0xd05f3007,0x81ffffff,0xffffa86d,
0xfff002ff,0xf975bfff,0x003dffff,0x5ffffff5,0xfffb7553,0xb0003bff,
0x200fffff,0x06fffff9,0x0ffffc00,0x3ffffee0,0x2001fd81,0xffd80ef8,
0x6c0007ff,0x1fffffff,0xff500000,0xf51fffff,0xf3000005,0x07ffffff,
0x7ffff400,0xffff8807,0x3fee04ff,0xffb82fff,0x7c401fff,0xaadfffff,
0xdaaaaaaa,0x01ffffff,0xffffff30,0x3ffee007,0x3e607fff,0x701fffff,
0x03ffffff,0x01fffffa,0x05fffff7,0x03fffff7,0xffffff98,0x5ffffb83,
0x3ffffa00,0x705f3007,0x47ffffff,0xfffa83f8,0xff002fff,0xffffffff,
0x4003bdff,0xfffffffa,0xffffffff,0x3f60001d,0xf3007fff,0x000dffff,
0x401fffd4,0x41fffffb,0x7ec001fd,0xfffffb01,0xfff88000,0x0006ffff,
0x3ffff600,0x0006fcff,0xfffffd00,0xfe8000df,0xf8807fff,0x204fffff,
0x82fffffb,0x01fffffb,0x7fffffc4,0xffff7004,0x3e6003ff,0x003fffff,
0xbffffff9,0x7ffffcc0,0xffffb01f,0x7fff40ff,0x7ffdc07f,0xfffb82ff,
0x7fcc01ff,0xf883ffff,0x3a002fff,0x3007ffff,0xffff105f,0x407dcfff,
0x2ffffffa,0xffffff00,0x00033339,0x7fffffd4,0xfffffd9a,0x360000ef,
0x3007ffff,0x00dfffff,0x802fff40,0x21fffffb,0x7dc004fd,0x3ffff603,
0xffb80007,0x004fffff,0xffff3000,0x0003ffff,0xfffff700,0xe80003ff,
0x8807ffff,0x04ffffff,0x0bffffee,0x07ffffee,0xffffff10,0x3ffee009,
0xf3001fff,0x007fffff,0x3ffffff6,0x3fffe604,0xfffd01ff,0x7ff40bff,
0x7fdc07ff,0xffb82fff,0x7cc01fff,0x503fffff,0xfe8005db,0xf3007fff,
0x3ffff205,0x2a09f2ff,0x02ffffff,0x7ffffff0,0x7fd40000,0xfd11ffff,
0x009fffff,0x3ffffec0,0xfffff980,0xdff70006,0x3ffee001,0x3fffb1ff,
0xb017e600,0x000fffff,0xffffff98,0x00001fff,0xffffffb0,0xf100000b,
0x09ffffff,0xffffd000,0xffff100f,0x7fdc09ff,0xffb82fff,0x7c401fff,
0x004fffff,0x3ffffff7,0x3fffe600,0xffb003ff,0x4c07ffff,0x81ffffff,
0x2ffffff8,0x1fffffa0,0x5fffff70,0x3fffff70,0xfffff980,0xe800003f,
0x3007ffff,0x3ffe605f,0x01faefff,0x5ffffff5,0x3ffffe00,0x2a00003f,
0x21ffffff,0xfffffff9,0xfffb0002,0x3fe600ff,0x88006fff,0x2e000eff,
0xfdafffff,0xfd006fff,0x9999999b,0x99fffffd,0x8ee88003,0x6ffffffe,
0xff100000,0x0009ffff,0xfffffb00,0x808001ff,0x807ffffe,0x4ffffff8,
0x3ffffee0,0xfffffb82,0x7fffc401,0xff7004ff,0x2003ffff,0x3ffffff9,
0xfffffd00,0x7ffcc03f,0xffd81fff,0x7f405fff,0x7dc07fff,0xfb82ffff,
0x4c01ffff,0x03ffffff,0x3fa09100,0xf3007fff,0x7fffec05,0x3ea06eff,
0x002fffff,0x07ffffff,0x7ffd4000,0x7fe41fff,0x000fffff,0x07ffffd8,
0xdfffff30,0x03ffb000,0xfffffb80,0x4fffffff,0xffffff80,0xffffffff,
0x4003ffff,0xffff30fe,0x00009fff,0xffffff10,0xfa800009,0x02ffffff,
0x7ff41dc0,0xff8807ff,0x2e04ffff,0xb82fffff,0x401fffff,0x4ffffff8,
0xfffff700,0x3fe6003f,0xf003ffff,0x01ffffff,0x7fffffcc,0xffffb511,
0xffe801bf,0x7fdc07ff,0xffb82fff,0x7cc01fff,0x003fffff,0x3ffa0970,
0x5f3007ff,0x7ffffd40,0x3fea02ff,0xf002ffff,0x007fffff,0x7fffd400,
0xfffe81ff,0xd8005fff,0x3007ffff,0x00dfffff,0x0401ffb8,0x7fffffdc,
0x1ffffffa,0x7fffffc0,0xffffffff,0x2003ffff,0x7ffe42fc,0x0001ffff,
0x7ffffc40,0x2200004f,0x5ffffffe,0xfe82d800,0xf8807fff,0x204fffff,
0x82fffffb,0x01fffffb,0x7fffffc4,0xffff7004,0x3e6003ff,0x803fffff,
0x3ffffff9,0x7ffffcc0,0xffffffff,0xffd002ef,0xffb80fff,0xffb82fff,
0x7cc01fff,0x003fffff,0x3ffa09d0,0x5f3007ff,0xfffffe80,0x7fffd407,
0xfff002ff,0x00007fff,0x7fffffd4,0xfffff881,0x7ec003ff,0xf3007fff,
0x400dffff,0x86801ff9,0x72fffffb,0x80dfffff,0xffffffff,0xffffffff,
0x7f7003ff,0x3fffffa0,0x200000ef,0x4ffffff8,0x3ff20000,0x000fffff,
0x7ff40fc4,0xff8807ff,0x2e04ffff,0xb82fffff,0x401fffff,0x4ffffff8,
0xfffff700,0x3fe6003f,0xd803ffff,0x806fffff,0xdffffff9,0x001abccc,
0x07ffffe8,0x17ffffdc,0x0fffffdc,0x3ffffe60,0x3f98003f,0x0fffffd0,
0xf700be60,0xa807ffff,0x02ffffff,0x7ffffff0,0x7fd40000,0xf701ffff,
0x03ffffff,0x3ffffec0,0xfffff980,0x03ff1006,0xfff70d90,0x7ffec3ff,
0x3bb604ff,0xfeeeeeee,0x2eefffff,0x2605f980,0x4fffffff,0x3fe20000,
0x0004ffff,0xffffff30,0x1f90007f,0x0fffffd0,0xffffff10,0x7fffdc09,
0xffffb82f,0x7ffc401f,0xf7004fff,0x003fffff,0x3fffffe6,0x7fffc403,
0xff9801ff,0x0001ffff,0x1fffffa0,0x5fffff70,0x3fffff70,0xfffff980,
0x2fd8003f,0x0fffffd0,0xf100be60,0xa801ffff,0x02ffffff,0x7ffffff0,
0x7fd40000,0x3601ffff,0x06ffffff,0x1fffff60,0x7ffffcc0,0x559fd006,
0xfd755555,0xfffff709,0x7ffffc43,0x7ec0002f,0x26007fff,0xfffc806f,
0x0002ffff,0xffffff10,0x3fa00009,0x006fffff,0xffd07f98,0xff100fff,
0x5c09ffff,0xb82fffff,0x401fffff,0x4ffffff8,0xfffff700,0x3fe6003f,
0x6403ffff,0x004fffff,0x3ffffff3,0x7ff40000,0x7fdc07ff,0xffb82fff,
0x7cc01fff,0x003fffff,0xfe80ffdc,0xf3007fff,0xbfff9005,0xfffff500,
0x3ffe005f,0x00003fff,0x3fffffea,0x3fffe201,0xfb004fff,0x2600ffff,
0x806fffff,0xfffffffc,0x83ffffff,0x41fffffb,0x0ffffffb,0x3fff6000,
0x3fd1007f,0x3ffffa00,0x80000fff,0x5ffffff8,0xfffb8000,0x4001ffff,
0xffd07fe8,0xff300fff,0x5c09ffff,0xc82fffff,0x401fffff,0x5ffffff9,
0xfffff900,0x3fea005f,0x2e03ffff,0x003fffff,0x3fffffe6,0x3fa00001,
0x7dc07fff,0xfb82ffff,0x4c02ffff,0x04ffffff,0x403ffee0,0x007ffffe,
0xff3005f3,0xfff7003f,0xf1005fff,0x007fffff,0x7fffd400,0x7fd402ff,
0x802fffff,0x007ffffe,0x0dfffff3,0xffffffb8,0xffffffff,0xfffffb81,
0xfffffd82,0x3ff60005,0xfe8807ff,0x3ffea004,0x0005ffff,0xffffff88,
0x7fc40005,0x004fffff,0xe837ffcc,0x9807ffff,0x04ffffff,0x0ffffff2,
0x0bfffff2,0xffffff50,0x3fff200b,0xf7003fff,0x20bfffff,0x01effffc,
0x7ffffd40,0x3a00002f,0x200fffff,0x83fffffc,0x02fffffc,0x7fffffd4,
0x7fe4c00e,0x3fffa07f,0x6fc800ff,0x200dfb00,0x3ffffffc,0xfffff980,
0x2e00004f,0x03ffffff,0xffffffc8,0x7fff400f,0xffb800ff,0xf300ffff,
0xffffffff,0x01ffffff,0x05fffff9,0x7ffffff3,0x3fff6000,0x7ff4407f,
0x7fff4003,0x0003ffff,0x7fffffcc,0x7fec0006,0x000fffff,0x0bffffb3,
0x03fffffa,0xffffff50,0x3fffa60b,0x3fe60eff,0x100dffff,0xfffffffd,
0xffffa807,0x4c01ffff,0xffffffff,0xffffedce,0xfe98003d,0x01efffff,
0xffffa800,0xffd104ff,0x7cc1bfff,0x00dfffff,0xfffffff3,0xb99999df,
0x0fffffff,0x3fffffea,0x67ffdc04,0x401fd401,0xfffffffa,0x3ffa201f,
0x002fffff,0xfffff980,0xfe801fff,0x02efffff,0x9ffffff5,0x7fffd401,
0x7c40dfff,0xffffffff,0x86ffffff,0xdfffffe9,0xfffffe80,0xffd8002f,
0xff7107ff,0x26003dff,0xffffffff,0xe88000bf,0x3fffffff,0xffff5000,
0x9999dfff,0xfffd9999,0xf509ffff,0x409fffff,0xffffffe8,0x7fffdc2f,
0xfa9fffff,0xffffffff,0xffffdd11,0xdfffffff,0x3ffffaa7,0xffffffff,
0xffffd31e,0xffffffff,0x0015bdff,0xfffffe88,0x6fffffff,0xffff8800,
0x21ffffff,0xfffffffb,0xffffa9ff,0xd11fffff,0xffffffff,0xffffffff,
0xdfffffff,0xffffff88,0x3a21ffff,0xffffffff,0xfe981a02,0xffffffff,
0xffb1efff,0xffffffff,0x44003dff,0xfffffffe,0x00efffff,0xfffffff3,
0x7fffc4ff,0x21ffffff,0xffffffec,0xd5ffffff,0xffffffff,0xbfffffff,
0xffffffb8,0x3ffa2fff,0x06ffffff,0x3ffffec0,0x7fffffe4,0xf980eeff,
0xffffffff,0xb801ffff,0xffffffee,0x0eefffff,0xfffffd00,0xffffffff,
0xffffffff,0x7fc47fff,0xffffffff,0xfffffd11,0xdfffffff,0x00000005,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x99999998,0x09999999,0x1c000000,
0x99998000,0x99999999,0x26662019,0x41999999,0x99999998,0x99999999,
0x99999999,0x26666609,0x99999999,0x33310000,0x33333333,0x26200003,
0x00999999,0x4ccccc00,0x99999999,0x99999999,0x2a200099,0x980bcdcb,
0x99999999,0x31099999,0x33333333,0x99833333,0x99999999,0x99999999,
0x00099999,0x55554c03,0x36e60aaa,0x2aa200be,0x4c0aaaaa,0xb9800ceb,
0x400bdeed,0x51bdedc8,0x6401800b,0xcccccccc,0xcccccccc,0xff884ccc,
0xffffffff,0xfe800fff,0xffffffff,0x3e603fff,0xffffffff,0x79107fff,
0xfffec881,0xefffffff,0x0000003d,0x200003e6,0xffffffec,0x205fffff,
0xffffffec,0x7ffdc6ff,0xffffffff,0xffffffff,0x365fffff,0xfffffffe,
0xffffffff,0x36600ace,0xfffffffe,0xdeffffff,0x3fea001b,0x002fffff,
0x3fffb220,0xffffffff,0xffffffff,0xff5002ff,0x83ffff7d,0xffffffec,
0x32dfffff,0xffffffdb,0x419dffff,0xffffffec,0xffffffff,0x4fffffff,
0xd300f980,0x25ffffff,0x3ffffffc,0xfffff910,0x7fffe47f,0x37ff6205,
0x502ffffd,0xfffdbfff,0x07cc00bf,0x99999c88,0x99999999,0x0c999999,
0x7fffffc4,0x0fffffff,0xfffffe80,0x3fffffff,0x3ffffe60,0x7fffffff,
0x01ffffa8,0xffffffd1,0x0000003f,0x00013f60,0xffffffb0,0x7fcc005f,
0xff702fff,0xfb999dff,0x99dfffff,0x0bffffd9,0xffffffd1,0xffffb999,
0xf3003dff,0x9bffffff,0xffffffb9,0x3ffa2009,0x00002fff,0xffffffd1,
0xd999999d,0x005fffff,0x3f61fffb,0xffd105ff,0x805fffff,0xfffffff9,
0xfffd800e,0xccccefff,0xfffffecc,0x400fe804,0xdbfffffd,0xffffffff,
0x3ffff200,0xfffff93f,0x7ffd101f,0x217fffec,0x3262fff8,0xfd1005ff,
0x0000e201,0xfff88190,0xffffffff,0xffe800ff,0xffffffff,0x3fe603ff,
0xffffffff,0xfffd87ff,0x3ffea05f,0x00004fff,0x1fff1000,0x7fcc0000,
0x8006ffff,0x2e00dffe,0xff981eff,0xe883ffff,0xfff505ff,0xffb05fff,
0x9005ffff,0x03ffffff,0x3dffffd5,0xfffff900,0x7d400005,0x404fffff,
0x402fffea,0x3f67fffc,0xff300fff,0x200bffff,0x3ffffffc,0xfffff300,
0xffd8809f,0x07fe404f,0x3ffffee0,0xffff31ef,0x7ffd40bf,0xffffabff,
0xffe887ff,0x3ffffd46,0x7e41fff6,0x01ff9006,0x900000e2,0xaaaaa881,
0x2aaaaaaa,0x55555500,0x15555555,0x55555440,0x2aaaaaaa,0x07fffff8,
0x3fffffe6,0x00000003,0x0007fff9,0x7ffffc40,0x7fd4005f,0x00ffb804,
0x7ffffff3,0xf982fec0,0x902fffff,0x05ffffff,0xffffffb8,0xffffb101,
0xfffb809f,0x200002ff,0x4ffffff9,0x405ff900,0x2e6ffff9,0x3e605fff,
0x004fffff,0x5ffffff7,0x3fffe200,0xfd3004ff,0x07ffd409,0x3ffffee0,
0x7fffec0f,0x3fffe607,0xffc8cfcf,0x3fffc84f,0x07ffffc4,0x3a05ffff,
0x0fffa806,0x80000710,0x0000000c,0x00000000,0x6fffff80,0x3ffffe60,
0x0000003f,0x06ffff88,0x3ffe2000,0x2a005fff,0x5f7002ff,0x7ffffcc0,
0x417e203f,0x2ffffff9,0x3fffffe0,0x7fffdc05,0x3fe201ff,0x2e03ffff,
0x002fffff,0x3fffe600,0x3f6004ff,0x3fffee02,0x2200e4c6,0x04ffffff,
0xffffff70,0x3ffe2003,0x26004fff,0xffff304f,0xffffb801,0xffffc82f,
0xffff300f,0x82b88bff,0xd82ffff8,0xff30ffff,0x0d505fff,0x00ffff98,
0xc8000071,0x00000000,0x00000000,0x04ffffd8,0x3fffffe6,0x80000003,
0x02fffffb,0xffff1000,0x3ee009ff,0x01ae001e,0x7ffffff3,0xff305c80,
0x6c05ffff,0x00ffffff,0x3fffffee,0x7fffd401,0xfff701ff,0x400005ff,
0x4ffffff8,0xc80be600,0x0006ffff,0x9ffffff1,0x3fffee00,0xff1001ff,
0x8009ffff,0xffffa84d,0x7ffdc00f,0xfffb82ff,0xfff301ff,0x64003fff,
0xfa81ffff,0x3ffe64ff,0x20384fff,0x00fffffa,0xc8000071,0x3b6ea200,
0x54c01cef,0x20aaaaaa,0x2aaaaaa9,0x37b6ea00,0x3fff200b,0x3ffe603f,
0x00003fff,0xffffe800,0xf100006f,0x009fffff,0xb8001bfb,0x7fffcc04,
0x82cc03ff,0x2ffffff9,0x3ffffee0,0x3ffee02f,0xff801fff,0xf706ffff,
0x0005ffff,0x7ffffc40,0x5d03504f,0x3fffff40,0xffff8800,0xff7004ff,
0x2003ffff,0x4ffffff8,0x3ee25c00,0xaabfffff,0x7fffdc1a,0xffffb82f,
0xffff301f,0xfff800ff,0x035101ff,0xdfffffff,0xffff7003,0x235557ff,
0x64000038,0xdbdff500,0x540bffff,0x1ffffffe,0x3fffffaa,0x7fec400f,
0x301fffbd,0x4c01ffff,0x03ffffff,0x7d400000,0x01ffffff,0xffff8800,
0x3fa204ff,0x80330004,0x3ffffff9,0xfff30380,0x7e405fff,0x202fffff,
0x1ffffffb,0xfffffc80,0xffffb82f,0x2200002f,0x04ffffff,0x7405905b,
0x0007ffff,0x9ffffff1,0x3fffee00,0xff1001ff,0x6409ffff,0xfff924c1,
0xffffffff,0xfffffb8b,0xfffffb82,0xfffff301,0x7ffc400d,0xfc8002ff,
0x2fffffff,0x3fffff20,0x15ffffff,0x0c800007,0x320ffec4,0x7404ffff,
0xf81fffff,0x200fffff,0x3e62fff9,0xffff03ff,0xfffff980,0x0000003f,
0x7ffffff4,0xf880005f,0x304fffff,0x000005ff,0xffffff98,0x3fe60003,
0x3a02ffff,0x01ffffff,0x3fffffee,0xffffa801,0xfffb85ff,0x3bb262ff,
0x3fe2000b,0x5d04ffff,0xeaa98110,0x2aafffff,0x3fffe200,0xff7004ff,
0x2003ffff,0x4ffffff8,0xcc8807a0,0xccfffffe,0x7ffdc2cc,0xfffb82ff,
0xfff301ff,0x7cc00bff,0x8003ffff,0xfffffff8,0xecc884ff,0xcccfffff,
0x0000712c,0x37fec0c8,0x02fffff8,0x07fffff6,0x03fffff6,0x6c37ffc4,
0xffd80fff,0x7fffcc04,0x000003ff,0x3ffafe60,0x0000ffff,0x7fffffc4,
0x001efb84,0xfff98000,0x20003fff,0x2ffffff9,0x3fffffe0,0x7fffdc05,
0xfff001ff,0xfb81ffff,0xff92ffff,0x2005ffff,0x4ffffff8,0xf9002f88,
0xffffffff,0x7fc400bf,0x7004ffff,0x03ffffff,0x3ffffe20,0x003f104f,
0x03fffff2,0x5fffff70,0x3fffff70,0x3ffffe60,0x3ffea003,0xd10005ff,
0xffffffff,0x7fffec09,0x0007100f,0x3fe60c80,0xffff83ff,0x3fff205f,
0xfffd81ff,0xfff900ff,0x09fff707,0xf9805ff7,0x003fffff,0x5df60000,
0x04ffffff,0x7fffc400,0x077e44ff,0xf9800000,0x003fffff,0x3ffffe60,
0xffffb02f,0xffb801df,0xf001ffff,0x87ffffff,0xdbfffffb,0xffffffff,
0xffff8800,0x02fc84ff,0xffff9950,0x400799ff,0x4ffffff8,0xfffff700,
0x3fe2003f,0xf704ffff,0x3fff2003,0x7fdc00ff,0xffb82fff,0xff301fff,
0x4c007fff,0x006fffff,0x3ffff620,0xfb00ffff,0x2201ffff,0x06400003,
0xd0dffff9,0x640dffff,0xc81fffff,0x980fffff,0xfa82ffff,0x7fcc0fff,
0x7fffcc00,0x000003ff,0x3fe29f10,0x0007ffff,0x7fffffc4,0x05fffd14,
0x3e600000,0x003fffff,0x3ffffe60,0x7fff442f,0xfb800dff,0x001fffff,
0x9ffffffd,0xffffffb8,0xfffff31e,0xffff100b,0x2ffa89ff,0xffffe800,
0xfff10007,0x2e009fff,0x01ffffff,0xffffff10,0x003ff509,0x03fffff2,
0x5fffff70,0x3fffff70,0x3ffffe60,0x3ffe2003,0xb80007ff,0x3fffffff,
0x1fffffb0,0x00000e20,0x7fffd419,0x6ffffe86,0x3fffff20,0xfffffc81,
0x1ffffd80,0x82ffffa8,0xfff9806f,0x00003fff,0x7e41f900,0x003fffff,
0x3ffffe20,0xffffe9cf,0x8000000f,0x3ffffff9,0x3ffe6000,0xfdcccfff,
0x001befff,0x3fffffee,0xffffb001,0xfffb89ff,0x7fe40fff,0xff8807ff,
0xc98cffff,0xe8002fff,0x0007ffff,0xbffffff1,0x55555555,0xffffffb5,
0x3ffe2003,0xf9514fff,0x3f2003ff,0x5c00ffff,0xb82fffff,0x301fffff,
0x007fffff,0x3ffffff8,0x7f4c0c00,0xfb05ffff,0x2201ffff,0x06400003,
0x3a0bfff2,0x3206ffff,0xc81fffff,0xe80fffff,0xf980ffff,0x04c83fff,
0xffffff98,0x88000003,0x7fffcc4f,0x220006ff,0xfeffffff,0x0effffff,
0x7cc00000,0x003fffff,0x3ffffe60,0xffffffff,0x2e000adf,0x01ffffff,
0xffffffb0,0xfffffb8b,0xfffffc82,0x7fffc400,0xffffffff,0xffe8002f,
0xf10007ff,0xffffffff,0xffffffff,0x03ffffff,0x3ffffe20,0xffffffff,
0xfff9001f,0xffb801ff,0xffb82fff,0xff301fff,0xd8007fff,0x006fffff,
0x7fec407c,0x3b3226ff,0xcccfffff,0x0000712c,0xd50300c8,0x40dfffff,
0x81fffffc,0x80fffffc,0xeeefffff,0x4ffffeee,0x3ffe6000,0x00003fff,
0xfd81fb80,0x002fffff,0xffffff10,0xffffffdf,0x800000bf,0x3ffffff9,
0x3ffe6000,0xca99bfff,0x1dffffff,0xfffffb80,0xfff9001f,0xffb8bfff,
0xffb82fff,0x7c401fff,0xecefffff,0x8002ffff,0x007ffffe,0xffffff10,
0x5555555b,0xfffffb55,0x3fe2003f,0xffceffff,0x9001ffff,0x801fffff,
0x82fffffb,0x01fffffb,0x07fffff3,0xfffff980,0x3f92a04f,0x993fffe0,
0xffffffff,0x0715ffff,0x800c8000,0xfffecfea,0x3fff206f,0xfffc81ff,
0x7ffc40ff,0xcccccdff,0x0003cccc,0x3fffffe6,0xe8000003,0xfffff505,
0x3e2000bf,0xf95fffff,0x07ffffff,0x7fcc0000,0x0003ffff,0x3fffffe6,
0xffffe882,0x7fdc03ff,0xb001ffff,0x89ffffff,0x82fffffb,0x01fffffb,
0x7fffffc4,0x00bffa24,0x1fffffa0,0x7fffc400,0xff7004ff,0x2003ffff,
0x4ffffff8,0x007ffb26,0x07ffffe4,0x3ffffee0,0xfffffc82,0xfffff501,
0xfffb0007,0xfb839fff,0x7e407fe1,0xfffb02ff,0x00e201ff,0x54019000,
0xfffd3ffe,0x7ffe40df,0xfffc81ff,0x7ffd40ff,0x4c0002ff,0x7fffcc00,
0x000003ff,0xffd017d4,0x0003ffff,0x9ffffff1,0x7ffffff4,0x3000002f,
0x07ffffff,0x7fffcc00,0xffd102ff,0x5c05ffff,0x01ffffff,0xffffffd0,
0xfffffb87,0xfffffb82,0x7fffc401,0x17fc44ff,0x7ffff400,0xfff10007,
0x2e009fff,0x01ffffff,0xffffff10,0x003ff109,0x03fffff2,0x7fffff90,
0x5fffff90,0x3ffffee0,0xfff88004,0xfeffffff,0x40fff43f,0xfb00effd,
0x2201ffff,0x06400003,0xd17ffec4,0x640dffff,0xc81fffff,0x4c0fffff,
0x003fffff,0xf3003ea0,0x007fffff,0x406e8000,0x4ffffffb,0xffff8800,
0x3ffe24ff,0x000fffff,0xffff9800,0x260003ff,0x02ffffff,0x3fffffe6,
0xffff700f,0x3fe003ff,0x5c1fffff,0xb82fffff,0x401fffff,0x4ffffff8,
0xe8002fa8,0x0007ffff,0x9ffffff1,0x3fffee00,0xff1001ff,0x2a09ffff,
0xfff9001f,0x7f4c01ff,0x260effff,0x0dffffff,0x7ffffec4,0xfe88000e,
0xffffffff,0xadfffe83,0x200fffb8,0x00fffffd,0xc8000071,0x17fff4c0,
0x81bffffa,0x81fffffc,0x40fffffc,0x05fffff8,0x803df100,0x3ffffff9,
0x98091000,0xccccccef,0xffffffdc,0x7fc4000f,0x7cc4ffff,0x0effffff,
0x7fcc0000,0x0003ffff,0x3fffffe6,0x7ffffc02,0xfff703ff,0x3e003fff,
0x40ffffff,0x82fffffb,0x01fffffb,0x7fffffc4,0x8002f884,0x007ffffe,
0xffffff10,0x3ffee009,0xf1001fff,0x409fffff,0xfff9001f,0x3fee01ff,
0x9fffffff,0xfffffffa,0xffff51ff,0x00dfffff,0x3fffff60,0xd9db01ce,
0x03dfffff,0x0fffffd8,0x80000710,0x3fffa20c,0x6ffffe87,0x3fffff20,
0xfffffc81,0xffffff80,0xfffd8000,0x3fffe602,0x970003ff,0xfffffd80,
0xffffffff,0x4003ffff,0x4ffffff8,0xffffffb8,0x4c00005f,0x03ffffff,
0x3fffe600,0x7fec02ff,0xf704ffff,0x003fffff,0xdffffff1,0x5fffff70,
0x3fffff70,0xfffff880,0x5c05d04f,0x7ffffe82,0xffff1000,0x3ee009ff,
0x001fffff,0x9ffffff1,0xfc800ec0,0x0000ffff,0x00000000,0x003ba600,
0x0afc882e,0xfffffb00,0x0000e201,0x7ffe4190,0xffffe85f,0x3fffee06,
0xffffc81f,0xffffe80f,0x711c404f,0x7cc0bfff,0x003fffff,0x1fc409d0,
0xfffff880,0x7fc4007f,0xf904ffff,0x07ffffff,0x7ffcc000,0x20003fff,
0x2ffffff9,0x7ffffdc0,0xffff705f,0xff7003ff,0xf705ffff,0xf705ffff,
0x8803ffff,0x04ffffff,0x740fc059,0x0007ffff,0x9ffffff1,0x3fffee00,
0xff1001ff,0x6409ffff,0xffff9001,0x3ae0001f,0xd80000bd,0x40000ace,
0x88000df9,0x3f2001ef,0x7100ffff,0x20c80000,0x447ffffe,0x207fffff,
0x41fffffb,0x0fffffe8,0xffffffa8,0xf905d100,0x7ffcc0ff,0x98003fff,
0x003f203f,0xffffffd8,0x3ffe2002,0x3fa04fff,0x01ffffff,0xffff3000,
0x4c0007ff,0x02ffffff,0x7fffffec,0xfffff703,0xfffd003f,0x3fee0bff,
0xffb82fff,0x7c401fff,0x004fffff,0xfffd07a8,0x3e2000ff,0x004fffff,
0x3ffffff7,0x3fffe200,0x800204ff,0x00fffffc,0x1ffff900,0xffff8000,
0x3fa20004,0x7ec001ff,0xff9003ff,0x0e203fff,0x7c190000,0xcadfffff,
0x07ffffff,0x0fffffe6,0x1ffffffd,0x3fffffa0,0xe82ec41f,0x3fe604ff,
0x8003ffff,0x09f102fd,0xfffff980,0x3fe2006f,0x2204ffff,0xffffffff,
0xff980000,0x0003ffff,0x3fffffe6,0x7ffffc02,0xfff702ff,0xfa803fff,
0x700fffff,0x705fffff,0x803fffff,0x4ffffff8,0xfd07e800,0x2000ffff,
0x4ffffff8,0xfffff700,0x3fe2003f,0x0004ffff,0x3fffff70,0xfc9801dc,
0x540003ff,0x0000fffe,0x009fff91,0x006fffb8,0x45fffff7,0x0000713b,
0x3fff20c8,0xfdcfffff,0x81ecffff,0xaafffffe,0xfffffefe,0xfffff501,
0x1ffd9dff,0x00effc98,0x3fffffe6,0x0ffdc003,0xe8002fc8,0x02ffffff,
0xffffff10,0xffffa80b,0x0000efff,0x7fffffcc,0x3fe60003,0x2602ffff,
0x06ffffff,0x3fffffee,0x7ffff401,0x3ffee03f,0xfffb82ff,0x7fcc01ff,
0x4004ffff,0xfffd05fd,0x3e2000ff,0x004fffff,0x3ffffff7,0x3fffe200,
0x100005ff,0x73bfffff,0xbffd000b,0xfff30000,0xffd80005,0x7ffb8005,
0xfffff300,0x01c4b73d,0xf9832000,0x31efffff,0x05ffffff,0x3fffffe6,
0xffffc9ef,0xfff300cf,0x3fffffff,0x803deff8,0x4ffffff9,0x03ffee00,
0x20003fe2,0x6ffffffb,0xfffff100,0xfff900bf,0x000dffff,0xffffff98,
0x3fe60003,0xf302ffff,0x01ffffff,0x7fffffdc,0x3ffff202,0x7ffdc02f,
0xfffb82ff,0x7fcc02ff,0x1004ffff,0x3fa09ffb,0x30007fff,0x09ffffff,
0x3ffffee0,0xfff1002f,0x0000bfff,0x7fffffd4,0x7fc4000f,0xfb80003f,
0x7c0000ff,0xfd8003ff,0x3fee005f,0x220fffff,0x06400003,0x02fbff6a,
0x805dffd7,0x0dffffea,0xfffffff9,0x3fffa603,0x0000cfff,0xffffff50,
0xffc9801d,0x03ffd07f,0xfffff100,0xff3007ff,0x100dffff,0xffffffff,
0x3ea0001b,0x004fffff,0x3ffffea0,0xffff985f,0x7e401eff,0x883fffff,
0x00effffd,0x3fffffc8,0x2fffffc8,0x7ffffd40,0x3ee200ef,0xfff03fff,
0x2a000fff,0x05ffffff,0xffffff90,0x3ffe6007,0x00006fff,0x0e77fed4,
0xbffd5100,0xffb98000,0x3260003f,0x26000dff,0x4001effb,0x41ceffda,
0xcccccce8,0xcccccccc,0x00eccccc,0x00110011,0x0000ab98,0x00abb980,
0x3ffe6000,0xccefffff,0xffffdccc,0x7ff547ff,0x7dc000df,0x2fffffff,
0x3ffffa20,0x7cc03fff,0xffffffff,0x3e6000ae,0x2fffffff,0xfffe9800,
0xfdceffff,0x02efffff,0xffffffa8,0xffedcdff,0xd3002dff,0x41dfffff,
0xdffffff9,0xffffd100,0x999bdfff,0xffffffdb,0xfffff505,0x7440017f,
0x3fffffff,0x7ffffd40,0x74401fff,0x3fffffff,0x00100000,0x05bdff30,
0xceefc800,0xdff10001,0xeef8007b,0x040000bd,0x00000000,0x00000000,
0x00000000,0xfffffe88,0xffffffff,0xffffffff,0x3fff26ff,0x203effff,
0xffffffea,0x20ffffff,0xffffffee,0x20efffff,0xfffffff8,0x2fffffff,
0x3ffffa20,0xffffffff,0x3ffa202e,0xffffffff,0xbcdeffff,0x7fff5402,
0xffffffff,0x002cefff,0x7fffffdc,0xfffa9fff,0x11ffffff,0xfffffffd,
0xffffffff,0xffffffff,0x7ffffdc3,0x205fffff,0xffffffe8,0x3effffff,
0xffffffd5,0x3dffffff,0x7fffff74,0x3effffff,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0xfff80000,0xffffffff,0x7ffec1ff,0xffffffff,
0x154c003f,0xaa880000,0x00000001,0x00000662,0x04000000,0x00000000,
0x00000000,0x55554c00,0x4c1aaaaa,0x532aaaaa,0x55555555,0x55555554,
0x2aaa62aa,0xedc880aa,0x400b51bd,0x302cdeca,0x4c079dd7,0x0aaaaaaa,
0x2aaaaaa6,0xdb751002,0x200039df,0x00adedba,0x9bfd9700,0xefdb8815,
0xdb98002c,0x2000bdee,0x00bdedba,0x55555554,0xaaaaaaaa,0x022004c2,
0x7c00cc00,0xffffffff,0x7ec1ffff,0xffffffff,0x6c003fff,0x3000007f,
0x000007ff,0x01ffec00,0x0f660000,0x7bddb730,0xaa9a7441,0x260aaaaa,
0x22aaaaaa,0x074c0dda,0x224c8010,0x2000002e,0xfffffffa,0x7fecc2df,
0xffff53ff,0x7e47dfff,0x2dffffff,0x037fff66,0xffdbfff5,0xfd980bff,
0x0effdcef,0x3ffb7ff2,0xfffea80e,0x3faa1fff,0x400fffff,0xffedeffa,
0x3a2005ff,0xeffdcfff,0xbfff7003,0x2a3fffff,0xdfffceff,0xdffd8800,
0x402ffffd,0xffbdffd8,0xffff101f,0xfffdddff,0x0ee8dfff,0x9800bee0,
0x3e02fffd,0xffffffff,0x7ec1ffff,0xffffffff,0x6c003fff,0x3000007f,
0x200007ff,0x03defdba,0x003ffff3,0xffeb8800,0x9fffb103,0xdd17fffb,
0x7fffff54,0x3fffaa1f,0xfff98fff,0x443bfe67,0x0cefffeb,0x7fc4fff2,
0x000001cf,0x0ffffffd,0x7c40ffc8,0xa83fffff,0x00ffffff,0xfff107fb,
0x02ffe4c5,0xfb8ffff5,0x23ffdaff,0xfd01fffc,0xff03ffff,0x2201ffff,
0x7fe41ffd,0xff9804ff,0x3fff20df,0x07ffa204,0xffbffff7,0x07ffec4b,
0x6c7ffd10,0xf302ffff,0x7ffcc5ff,0x09dff883,0x7fffffcc,0x88077d42,
0xfff001ff,0x2aa03fff,0xaaaaaaaa,0x55540aaa,0xaaaaaaaa,0x7ec001aa,
0xf3000007,0xe880007f,0xfffdcfff,0x0ffffc43,0xffc98000,0xfe882fff,
0x3ffea0ff,0xfffe80ef,0xffff81ff,0xffffa8ff,0xf7dffd11,0xffffffff,
0x221dff99,0x02efffff,0x7ffd4000,0x1fdc07ff,0x5fffffa8,0x5fffffd0,
0x7fec1b60,0x260df907,0xfe83ffff,0xff86ffff,0xffffb06f,0xffffb03f,
0x1bff601f,0x017ffffc,0x883ffff3,0xfd03ffff,0x3fff20bf,0x7fcc0fff,
0xdffd105f,0x87ffffa8,0xfd86fff8,0x02fc40ff,0x0bfffffd,0xffb817fa,
0x7fffd401,0x000005ff,0x6c000000,0x3000007f,0x540007ff,0x3f20efff,
0x7ffcc4ff,0x7f540000,0x880cffff,0xfd83ffff,0xfffb05ff,0xfffb03ff,
0xfffd11ff,0x7ffff443,0xfffdcdff,0x5c40efff,0x0cfffffe,0xfffd0000,
0x07ec05ff,0x1fffffd0,0x9fffff70,0x7ffc0fe0,0x3a0dd02f,0xff707fff,
0xffb09fff,0xffff905f,0xffffb03f,0xffff301f,0xbfffff07,0x83fffec0,
0x541ffffd,0xfb82ffff,0xfd05ffff,0xfff903ff,0xfffff887,0x41fffe40,
0x7c44fffb,0xfffff701,0x17fea01f,0x7007ffc4,0x0fffffff,0x00000000,
0x007fd800,0x07ff3000,0x3fffe600,0x6ffffc43,0x0005fd11,0x3fffff22,
0x7ffe402e,0xffffb81f,0xfffffc81,0xfffffd81,0xd10dff10,0x3ea05fff,
0x6cc00fff,0x02dfffff,0x7fffd400,0x809f105f,0x83fffffb,0x87fffffd,
0xfff980f9,0xb86a82ff,0xf506ffff,0xfb07ffff,0xfff90dff,0xfff903ff,
0xfff901ff,0xffffd0df,0x3fffe60d,0x9ffff706,0x86ffffc8,0x04fffffa,
0xf88bfffb,0xffd82fff,0x3ffe60ff,0xffffa82f,0x7fc41a20,0x7404ffff,
0xdff704ff,0x3fffe201,0x5d400fff,0x5000aded,0x05555555,0x007fd800,
0x07ff3000,0x3ffffa00,0xfffffd80,0xa8002dff,0x1cfffffd,0xfffff880,
0x6ffffb80,0x1fffffc8,0xafffffc8,0xf980dfca,0x7f4400ef,0xff71002f,
0x0017ffff,0x3fffffa0,0x4400fa80,0x446fffff,0x2fffffef,0xfff982e4,
0xc8384fff,0xf305ffff,0xf905ffff,0xfff90fff,0xfff903ff,0xfff501ff,
0xffffd0df,0x3ffffa0d,0xdffff705,0x86ffff98,0x03fffffa,0xfc8ffffb,
0xffa81fff,0x7fffec4f,0x2ffffa81,0xffffd804,0xfffa806f,0x01dfff03,
0x3ffbffaa,0x9fffd100,0xc807dffb,0x07ffffff,0x003fec00,0x03ff9800,
0x6ffffa80,0x09ffff70,0x3ffae200,0x2000bfff,0x987ffffc,0x41ffffff,
0x81fffffc,0xacfffffc,0x07ff6009,0x0037fc40,0x7ffffed4,0x7fdc002d,
0x05e84fff,0x1fffffb0,0x7fffcf5c,0xff01fc5f,0x03dfffff,0x04ffffe8,
0x03fffff3,0xc81ffff9,0xc81fffff,0x900fffff,0xffd05fff,0x3ffe0dff,
0xfff505ff,0xeffd81ff,0xfffffa81,0x1ffff901,0x80fffffc,0xfffe81a8,
0xffff980f,0xffff9803,0xffd002ff,0xdfff707f,0x20ff5180,0x320dfff9,
0x7c404fff,0x0007ffff,0x00003fec,0x8003ff98,0x705ffffe,0x800dffff,
0xdfffffc9,0xfffb0002,0xffef88ff,0x7fe43fff,0xffc81fff,0xf8800fff,
0x7fdc004f,0xff910002,0x0017dfff,0x8ffffff1,0xff5001f9,0xea747fff,
0xf50fffff,0x7fffe401,0xf102ffff,0x2609ffff,0xccdfffff,0x1ffffecc,
0x0fffffe4,0x07ffffe4,0x3ffaa060,0xff886fff,0xff504fff,0x03103fff,
0xffffff91,0xffdddddd,0x3fe23fff,0xf8002fff,0xeeeeffff,0x04ffffee,
0x5fffffe8,0x3fffea00,0x05ffff82,0xff985fc8,0x7ffc41ff,0x7fff403f,
0x7ec0007f,0xf3000007,0xfff0007f,0x3fea0bff,0xea800fff,0x00cfffff,
0x7ffffc00,0x7ffcf747,0x7ffe44ff,0xfffc81ff,0xffa800ff,0x1ffcc002,
0x7ff54000,0x6401dfff,0x322fffff,0x7fffc006,0x3ee3f36f,0x0bb3ffff,
0xffffff88,0xffa84fff,0xff304fff,0xdddddfff,0xc85ddddd,0xc81fffff,
0x000fffff,0x3ffb3faa,0xfffa86ff,0xfff504ff,0xf91007ff,0xbfffff7d,
0x99999999,0x3ffe6399,0x7c4003ff,0xcccdffff,0x03cccccc,0x7fffffdc,
0x7fff4000,0x7fffdc1f,0x6c0ffc04,0xffb07fff,0x7ff403ff,0x555307ff,
0xfd555555,0x5555555f,0x2aaa2555,0xfbaaaaaa,0xaaaaaadf,0xfff11aaa,
0x3fea09ff,0x3e201fff,0x003effff,0xfffff100,0x7fcc76cf,0x7fe45fff,
0xffc81fff,0xfb800fff,0x4ff8000f,0x3f260000,0x2603ffff,0x3e6fffff,
0x7ffe4002,0x3e26b9ff,0x2f8effff,0xffffe880,0x7dc4ffff,0xf303ffff,
0x0005ffff,0x07fffff2,0x03fffff2,0x74fffaa0,0xfa86ffff,0xf504ffff,
0x4409ffff,0xff98dffc,0xa8002fff,0x005fffff,0x17ffffd4,0x7ffc4000,
0xb8004fff,0x7c45ffff,0xf301ffff,0xdffff30b,0x13fffee0,0x07ffffe8,
0xfffffff9,0xffffffff,0x2fffffff,0xfffffff8,0xffffffff,0x3fffffff,
0x09fffff5,0x0fffffea,0xdfffff88,0xff300001,0x47f2ffff,0x45fffff9,
0x81fffffc,0x00fffffc,0x8000ffb8,0x200004ff,0x3fffffc9,0x7ffffec0,
0xf98007a9,0x43edffff,0x7cfffffd,0x3fff6200,0x2a0fffff,0x303fffff,
0x009fffff,0x3fffff20,0xfffffc81,0x3fff6200,0x1bffffa2,0x13ffffe6,
0x1fffffdc,0x223fffa8,0x004fffff,0x6fffff98,0x7fffcc00,0xfd80003f,
0x0006ffff,0xb81dfffd,0xd102ffff,0xffffd01d,0x3fffee0b,0x3ffffa06,
0xfffff907,0xffffffff,0xffffffff,0x3ffffe2f,0xffffffff,0xffffffff,
0xfffff53f,0x3fffea09,0x7fe4c04f,0x000befff,0x3ffffe20,0x3fe61faf,
0x7fe44fff,0xffc81fff,0xfa800fff,0x7fcc002f,0xfea80003,0x801cffff,
0xedfffffa,0xfffd0004,0xffa81fff,0x8004ffff,0xfffffffb,0x3ffffe63,
0xfffff304,0x3ff2000b,0xffc81fff,0xfd300fff,0xfffe85ff,0xffff886f,
0xffff704f,0x7fffb05f,0x6fffff88,0xffff8800,0x7fc4007f,0x40005fff,
0x2ffffff9,0xefffb800,0x1ffffc40,0x3fe05e98,0xff505fff,0x3fa01fff,
0x55307fff,0xd5555555,0x555555ff,0x2aa25555,0xbaaaaaaa,0xaaaaadff,
0xff31aaaa,0x3ee09fff,0x2003ffff,0xcfffffea,0xffff0001,0xff985fff,
0x7fe42fff,0xffc81fff,0xf9800fff,0x7fdc004f,0xff910002,0x0017dfff,
0xffffffe8,0xfff70000,0x3ffe0bff,0x81802fff,0x5fffffe9,0x13ffffe2,
0x7fffffcc,0xfffc8000,0xfffc81ff,0xffe880ff,0xffffe87f,0xbfffff06,
0x3ffffee0,0x07fffec1,0x07fffffc,0x7ffffc00,0x7ffc003f,0x20000fff,
0x05fffffe,0x1ffff80a,0x904fffc8,0x7ffc405d,0xfff504ff,0x3ffa03ff,
0x6c0007ff,0x3000007f,0xf88007ff,0xf704ffff,0x0005ffff,0xdfffff93,
0xfffe8005,0xfff984ff,0x7ffe40ff,0xfffc81ff,0xffd000ff,0x1bfe2003,
0x3fff6a00,0x20001dff,0x05fffffb,0x3fffe200,0xffff902f,0x2203e00f,
0x746ffffd,0xf504ffff,0x807fffff,0x7fffdc0a,0xffffc81f,0xffffc80f,
0x6ffffe85,0x0bffffb0,0x51fffff2,0x320bffff,0x804fffff,0x3ffff60a,
0x7ff4006f,0x1c404fff,0x7fffffdc,0x3ee0b100,0xfff881ff,0x3ea00604,
0xf504ffff,0x3a07ffff,0x0007ffff,0x00003fec,0x8003ff98,0x705fffff,
0x003fffff,0x7fff5c40,0xfb800cff,0xff507fff,0xfff70fff,0xfff903ff,
0x3e6001ff,0xffd800ef,0xffd71003,0x00017fff,0x3fffff10,0xfffe8000,
0x3fffe607,0x7c07f004,0x7fd44fff,0xfff705ff,0x2601ffff,0x7fffdc0e,
0x7fff441f,0xfffe80ff,0x7fffc47f,0xffff307f,0x3ffff20d,0x37ffff43,
0xffffffa8,0xff31aa01,0x5409ffff,0x3ffffea4,0x885d100f,0x03ffffff,
0x0fffc172,0x0005ffc8,0x4fffffa8,0x9fffff50,0x1fffffa0,0x00ffb000,
0x0ffe6000,0x3ffff600,0xfffff905,0x7ecc0000,0x402dffff,0xb80fffff,
0xfb85ffff,0x7442ffff,0x000fffff,0x4c0bfffa,0x4c00fffe,0x2dfffffc,
0xffc80000,0xfb80006f,0x7ff404ff,0x03ff001f,0x3a0bfff2,0xffb07fff,
0x81dfffff,0xfff982f9,0x7fff43ff,0xfff80fff,0xffcadfff,0x3207ffff,
0xfe80ffff,0xffff87ff,0x7fecc2ff,0xa82fffff,0xffffd81f,0x0fdc1cff,
0x3ffffffa,0x7ec2ec41,0x2a06ffff,0x02ffb84f,0x0000bff1,0x13ffffe6,
0x1fffffdc,0x07ffffe8,0x003fec00,0x03ff9800,0x6ffff980,0x07ffff90,
0xfd710000,0x7017ffff,0xf903ffff,0xff301fff,0xffd87fff,0xb000ffff,
0x9bdfffff,0xdfffffdb,0xffffd501,0x0000039f,0x001fffcc,0x00fffc40,
0xe801bfee,0xeffd81ff,0x3fffe880,0x7fffffc4,0xfecdffff,0x3ffffa05,
0xffefeaaf,0xffc81fff,0xdcffffff,0x1ecfffff,0x21ffff44,0xe81ffff9,
0xceffffff,0xffffbefe,0xffdcefff,0xfffff104,0x7ffdffff,0xffffff50,
0x81ffd9df,0x2ffffff9,0xf83ffb88,0x03bf203f,0x7ffc4000,0xfff704ff,
0x3ffa05ff,0x6c0007ff,0x3000007f,0x320007ff,0xffb07fff,0x000000ff,
0x5fffffb5,0x44ffffd8,0x103ffff8,0x75fffffd,0xfffffdfd,0x9dffb003,
0xffffffff,0x21dffb9f,0x2efffff8,0x36000000,0xb00000ff,0x9ff100ff,
0x6ffff400,0x00fffb8a,0x447fffa2,0xffe9dffd,0x05ffffff,0x7fffffcc,
0xffffc9ef,0x7ffcc0cf,0xff31efff,0x2205ffff,0xfd12effd,0x3fea03df,
0x2fffffff,0x3fffffe6,0x4404ffff,0xfffffffe,0x3fe603ff,0xffffffff,
0xfffffe81,0xffdcaaaf,0x01fdc3ff,0x00001df3,0x05fffff8,0x03fffff7,
0x01fffffa,0x000ffb00,0x00ffe600,0x17fff440,0x007fffe6,0xfb880000,
0x327f23ff,0xfd88cfff,0x7fcc03ff,0xc8efffff,0x00cfffff,0x6443bfe2,
0x20cefffe,0xfff11ffd,0x00000039,0x00009f50,0xfd8027d4,0x3b3b6001,
0x01efffff,0xfffffd90,0xffffc87f,0xfd5003ff,0x3f21bfff,0x41ffffff,
0x40beffda,0x802effeb,0xfffffffc,0x7ffe400d,0xd980ceff,0x2effffff,
0x3ffff600,0xe9801cef,0x0cffffff,0xffffffb8,0xffffffff,0x201ec2ff,
0x800000db,0x905ffffd,0x740fffff,0x9507ffff,0x99999999,0x99999ffd,
0x80099999,0x20003ff9,0xb11effd8,0x00003dff,0xa9ed4000,0x3fffa62f,
0x5001ceff,0x21bffffd,0xfffffffc,0x08036601,0x17d10ec0,0x80000000,
0x6400000c,0x80093000,0x02aea20b,0x4ddd4400,0x15775100,0x01573000,
0x20022000,0xca880008,0xab98000a,0x2aee6000,0x2ee60001,0x2ee60000,
0x0000000a,0x00000000,0x837fffcc,0x203ffffc,0xb07ffffe,0xffffffff,
0xffffffff,0x00ffffff,0x0003ff98,0xffffffb8,0x000000df,0x51018000,
0x4c000157,0x000000ab,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x0ffffc80,0x407fffe8,0x907ffffe,0xffffffff,0xffffffff,0x00ffffff,
0x0003ff98,0x002b2a20,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x22000000,0x7cc3fffe,0x7f401fff,0x9880ffff,
0x99999999,0x99999999,0x80019999,0x00000099,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x12effd88,
0xa803dffd,0x04ffffff,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x80000000,0xfffffffc,
0x3ffe200d,0x1fffffff,0x2aaaaaa6,0x2fb6e60a,0x00c40000,0xaaaa884c,
0x36e60aaa,0xca880ace,0x2a200bde,0x40aaaaaa,0x5540ceb9,0x982aaaaa,
0xaaaaaaaa,0x5555511a,0x55501555,0x35555555,0x06aaaaaa,0x00000000,
0x164c0000,0x802b8800,0x50002ca8,0x2e200039,0x0b2600bc,0x71005930,
0x5d400159,0xa8800abc,0xcc880acc,0xcccccccc,0xcccccccc,0xdd12cccc,
0xdddddddd,0xdddddddd,0x0005dddd,0x00544000,0x000b332a,0x88062064,
0x77777740,0x806eeeee,0x0000aca8,0x7fff4c00,0xfff92fff,0x20007fff,
0x87ec05f9,0xffffffd9,0xffffff73,0x7fff4c1d,0xf9102fff,0x647fffff,
0x7e45ffff,0x987fffff,0xfffffffe,0xffff911e,0xff9019df,0x39ffffff,
0x0bbffff2,0x003bf200,0xb5000950,0x0bffe200,0x04ffda80,0x3fffffa2,
0x1bfe2003,0xffffd300,0xffff907f,0x1ffff901,0xfffffd50,0x56f5403d,
0x2a01fffb,0x43ffaaff,0xfffffff8,0xffffffff,0x3fffffff,0xfffffff1,
0xffffffff,0x7fffffff,0x0fffffe4,0x5fffff88,0x427ffec4,0xffffffd8,
0x41f3002d,0x7ec0effb,0x3ffffe5f,0x07ffffff,0x00000000,0x2ffffff6,
0xfffffffd,0x7fc4000f,0x3213f201,0xfcbfffff,0x5fffffee,0xffffdff3,
0x7fe401ff,0xfff93fff,0xff881fff,0x3f207fff,0xf304ffff,0xfd1007ff,
0xf90fffff,0x3e60001d,0x3ea004ff,0x3fea004f,0x5fffb805,0x7fffe440,
0x3fbf604f,0xb000ffff,0x74007fff,0x0fffffff,0x21fffffc,0x43fffff8,
0xfffffffa,0x1ff881ff,0x7dc1ffee,0x893fea3f,0xffffffff,0xffffffff,
0x13ffffff,0xffffffff,0xffffffff,0x87ffffff,0x503ffffd,0xb81dffff,
0x740fffff,0xffffffff,0x9f600bef,0x2a4ffff8,0xfff2ffff,0xffffffff,
0x0000000f,0x7fffdc00,0xfff31eff,0x74400bff,0x03fee05f,0x3fffffea,
0x3ffff21f,0xff30cfdf,0x7d40bfff,0xffabffff,0xfd07ffff,0x7dc0ffff,
0xf303ffff,0x7fcc005f,0x7ec2ffff,0x3fe60000,0x3fe6004f,0xfffa804f,
0x3fff9803,0x7fec5440,0x6c49904f,0xf9804fff,0xc800ffff,0xffffb8ad,
0x3ffffe64,0x7ffffd45,0x46fffea5,0x641fffc9,0x3ffee6ff,0x10fffc40,
0x00003fff,0x000ffe20,0x7fec0000,0xdfffb06f,0xffffff01,0x556ffd49,
0xfffffffc,0xa97f662d,0x3f26ffff,0xffff4fff,0xffffffff,0x00000000,
0x7ffffdc0,0x7fffec0f,0x3ffd1007,0x540ffee0,0x41ffffff,0x4ffffff8,
0x06ffffe8,0x33ffffe6,0x4fffc8cf,0x0fffffd0,0x17ffffd4,0xc8002fe8,
0x2a6fffff,0xfc80001f,0x7fcc000d,0x3ffea04f,0x07ffe003,0x04fffb80,
0x05fff303,0x9ffdffd0,0xffb81900,0x3fffe25f,0x7fffc44f,0x407ffe4f,
0x7fd45ffa,0x707ffea4,0xfff81fff,0xf1000004,0x0000007f,0x20fffec0,
0xd00efff8,0x6c9fffff,0xfffb500f,0xffffffff,0x1ffffc41,0x2a3ffff5,
0xaaaaaaaa,0x000002aa,0x3fee0000,0xffc82fff,0xfd800fff,0x1fff504f,
0x3ffffea0,0xdfffff03,0x1fffff60,0xffffff98,0xfd015c45,0x7d40ffff,
0xfd82ffff,0xfff10001,0x09d15fff,0x20000000,0xfa84fff9,0xcfd883ff,
0xdf71bee0,0x09fff703,0x4027fdc0,0xfff9dffa,0xfff98000,0x17ffffc2,
0x997ffffc,0x3fe405ff,0xfffc8844,0x07ffe42f,0x0001bffe,0x001ffc40,
0xfd100000,0x0effa87f,0x3ffffee0,0x2e2017e0,0xffffffff,0x40cfea82,
0x00003efb,0x00000000,0x2fffffb8,0x1fffffb8,0x407ffec0,0x2a03fffa,
0xf03fffff,0x320dffff,0x300fffff,0x03ffffff,0xfffffd00,0x7ffffd40,
0x0000fe42,0x3bffffee,0x0000006c,0x27ffcc00,0x2e07fff5,0x5f13ffff,
0x217fffa2,0x3004fffb,0xfd001fff,0x017ff61f,0xd03ffea0,0xfb01ffff,
0x3fee1fff,0x40ffd402,0xfffbcfc8,0x207ffec2,0x00007fff,0x0007ff10,
0xfe880000,0x2007fec6,0x223fffd8,0x764c001f,0x00000cef,0x00000000,
0xff700000,0xff705fff,0x7e403fff,0xfff984ff,0x3ffea00f,0xffff03ff,
0x3fff20df,0xfff300ff,0x3a000fff,0x2a07ffff,0x322fffff,0xfd00005f,
0x003fffff,0x30000000,0xfff59fff,0x7fffd407,0xfff33d3f,0xfff709ff,
0xfffe9809,0x3fee02ff,0x007ffe24,0xf707ff90,0x3fee0fff,0x201ff66f,
0x7fd43ff9,0xd85fff53,0x7ffc0fff,0xf1000006,0x3fffe27f,0xffffffff,
0xffffffff,0x7f4403ff,0x4003ff11,0x00000028,0x00000000,0x00000000,
0x3ffffee0,0xfffffb82,0x1ffff901,0x03ffff98,0x1fffffd4,0x06fffff8,
0x01fffff9,0x1bffffe6,0x7ffff400,0x3fffea07,0x05fff92f,0xffff5000,
0x553001ff,0x55555555,0x55555555,0x7cc05555,0x803fffff,0xfefffffc,
0x0cfffffe,0x804fffb8,0x07ffffc9,0xfb81fff1,0x3fe2006f,0x0bfff305,
0xfc93ffe6,0x17fd400f,0x7fd4dff5,0x07ffdc2f,0x00013ffe,0xf89ffc40,
0xffffffff,0xffffffff,0x803fffff,0x00026098,0x00000000,0x00000000,
0x00000000,0x05fffff7,0x03fffff7,0x887ffff7,0xa807ffff,0xf03fffff,
0x320dffff,0x300fffff,0x00bfffff,0x1fffffa0,0xafffffa8,0x00fffffd,
0xffffe800,0xfffc804f,0xffffffff,0xffffffff,0x7fcc07ff,0x20c003ff,
0x2e0045eb,0x26004fff,0xfd81ffff,0x05ffd03f,0xff017f60,0x17ffc05f,
0xfd807ff5,0xb9bff60f,0x7fc42fff,0x07ffe21f,0x77440000,0xdddddd12,
0xdddddddd,0xdddddddd,0x00000005,0x00000000,0x00000000,0x40000000,
0x82fffffb,0x41fffffb,0x42ffffe8,0x805ffffb,0x03fffffa,0x20dfffff,
0x00fffffc,0x07fffff3,0x3ffffa00,0x3fffea07,0xffffffef,0xff980004,
0x6400ffff,0xffffffff,0xffffffff,0x407fffff,0x004ffffa,0x013a3ee0,
0x004fffb8,0x2617ffdc,0x3fea06ff,0x084fb807,0xfb007fec,0x0fffc41f,
0x7f46ffb8,0xfffeeeff,0x51ffdc2c,0x000009ff,0x00000000,0x00000000,
0x00000000,0x00000000,0x2e000000,0xb82fffff,0x981fffff,0xfd86ffff,
0x7d401fff,0xff03ffff,0x3f20dfff,0xf300ffff,0x0007ffff,0x81fffffa,
0xaffffffa,0x02ffffff,0xffffd800,0x5554c04f,0xaaaaaaaa,0xaaaaaaaa,
0x3fea02aa,0x4004ffff,0x5df75fe9,0x09fff700,0x40fff880,0x7f402ffe,
0x213ea03f,0x2037dc4d,0xfffa86fb,0xfffd989c,0x8f7ffdc1,0xfa81fffe,
0x4c3feabf,0xbbbbbbbb,0xbbbbbbbb,0x002bbbbb,0x00000000,0x00000000,
0x00000000,0x00000000,0xffffb800,0xffffb82f,0xffff301f,0x0bfffb05,
0x3fffffa8,0x0dfffff0,0x03fffff2,0x1fffffcc,0xffffe800,0x3fffea07,
0xfffff52f,0xfd80001f,0x000fffff,0x2a000000,0xfff9bfff,0x7fff7004,
0x7013ffe6,0x0ee09fff,0x3fea2ff4,0x0fff9805,0xeeeeffa8,0x027cc2ff,
0x7fe413e6,0x2fffffff,0xaa883510,0x2b32a200,0xfffffa80,0xffffffff,
0xffffffff,0xffffff54,0xffffffff,0x9fffffff,0x00000000,0x00000000,
0x00000000,0x70000000,0x705fffff,0x403fffff,0xe886fffa,0x3ea01fff,
0xff03ffff,0x3f20dfff,0xf300ffff,0x0007ffff,0x81fffffa,0x22fffffa,
0x05fffffd,0x3ff7ea00,0x00005fff,0xfff50000,0x027ffcc7,0xff07fffc,
0x7fe403ff,0x2effb85f,0x3ffa1bea,0x89ffb001,0xfffffff9,0x802f80ff,
0x3ffea02f,0x0001efff,0xffa80000,0xffffffff,0xffffffff,0xfff54fff,
0xffffffff,0xffffffff,0x000009ff,0x00000000,0x00000000,0x00000000,
0xfffff700,0xfffff705,0x2fffa803,0x205ffe88,0x03fffffa,0x20dfffff,
0x00fffffc,0x07fffff3,0x3ffffa00,0x3fffea07,0x3fffe22f,0xf88003ff,
0xffffff8b,0x00980001,0x07fff500,0x4409fff3,0x7fe45fff,0x7fe5442f,
0x3e62cfff,0x83feffff,0x22004ffb,0xfff31fff,0x0dffffff,0x73100000,
0x00000379,0x88888000,0x88888888,0x88888888,0xbbbbb308,0xbbbbbbbb,
0xbbbbbbbb,0x00000007,0x00000000,0x00000000,0x00000000,0x05fffff7,
0x03fffff7,0x220dff70,0xff501fff,0x3fe07fff,0xff906fff,0x3e601fff,
0x0003ffff,0x40fffffd,0x42fffffa,0x0ffffffa,0xff92f400,0x8000dfff,
0x54001ffe,0x3e603fff,0x3bf204ff,0x9837f441,0x19999999,0x04d5dd44,
0x40009988,0x33310998,0x01333333,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0xfffffb80,0xfffffc82,
0x07ff9001,0x7d417fe6,0xff03ffff,0x3f60dfff,0xf501ffff,0x0007ffff,
0x81fffffa,0x82fffffa,0x06fffffd,0xff883f20,0x0002ffff,0x4009fff5,
0x9803fff9,0x00204fff,0x00000001,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0xffff9000,
0xffff907f,0x37e4005f,0xf703ff30,0xf109ffff,0x360dffff,0x701fffff,
0x009fffff,0x3fffffa0,0xfffff900,0xfffff107,0x09f7009f,0x1ffffffb,
0x7fff1000,0x01ffcc00,0x0009ff30,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x7fff4c00,0x3fe60eff,0x000dffff,0x5fa80ff6,0x7ffffec4,0x7fffdc1e,
0x7ffd43ff,0x6c40cfff,0x00efffff,0x7ffffd40,0xfffe984f,0xffd81eff,
0x9303ffff,0xfff70bff,0x0001bfff,0x730007b5,0x00093000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x7fffdc00,0xfa9fffff,0xffffffff,0x70176001,
0x3fffea1d,0xfd3fffff,0xffffffff,0x3ffffff6,0xfff51fff,0x0dffffff,
0xffffff10,0x3ee3ffff,0xffffffff,0x3fffffa3,0x3fa0ffff,0xe9beffff,
0xffffffff,0x0000003f,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,
};
static signed short stb__times_bold_47_latin_ext_x[560]={ 0,3,3,0,1,2,1,2,1,0,2,0,1,1,
1,0,1,2,1,0,1,1,1,1,1,1,3,3,0,0,0,2,1,0,0,1,0,0,0,1,0,0,0,0,
0,0,0,1,1,1,0,2,1,0,0,0,0,0,0,4,0,1,3,-1,0,1,0,1,1,1,1,1,1,0,
-2,1,0,1,1,1,0,1,1,1,0,1,0,0,0,0,0,3,3,1,0,5,5,5,5,5,5,5,5,5,
5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,0,3,2,0,0,0,
3,1,0,1,0,0,0,1,1,-1,1,0,0,0,4,1,0,1,3,1,1,0,1,1,0,2,0,0,0,0,
0,0,-1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,3,1,0,0,0,0,0,0,1,1,1,
1,1,1,1,1,1,1,1,1,1,-1,0,-1,-1,1,1,1,1,1,1,1,0,1,1,1,1,1,0,0,0,
0,1,0,1,0,1,1,1,1,1,1,1,1,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,1,1,
1,1,1,1,1,1,0,1,0,1,0,-1,0,-1,0,-1,0,0,0,0,0,0,0,-2,0,1,1,0,0,0,
0,0,0,0,0,0,0,0,1,0,1,0,1,3,0,1,1,1,1,1,1,1,1,1,0,1,0,1,0,1,
2,1,2,1,2,1,2,1,1,0,1,0,1,0,0,1,0,1,0,1,0,1,0,1,1,1,0,0,0,0,
0,0,0,0,0,0,0,0,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,1,5,5,-1,5,5,5,
5,5,5,5,5,5,5,5,5,5,1,1,5,5,5,5,5,5,5,5,5,5,5,5,5,0,1,5,5,5,
5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,0,1,0,-1,1,
1,0,1,0,1,0,1,0,1,0,1,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
5,5,5,5,5,5,5,5,5,5,0,1,-1,1,1,1,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
5,5,5,5,5,5, };
static signed short stb__times_bold_47_latin_ext_y[560]={ 37,8,8,8,8,8,8,8,8,8,8,11,30,25,
30,8,8,8,8,8,8,8,8,8,8,8,17,17,12,18,12,8,8,8,8,8,8,8,8,8,8,8,8,8,
8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,43,7,17,8,17,8,17,8,17,8,8,
8,8,8,17,17,17,17,17,17,17,10,17,17,17,17,17,17,8,8,8,22,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,37,16,9,8,12,8,
8,8,8,8,8,17,18,25,8,3,8,11,8,8,7,17,8,19,36,8,8,17,8,8,8,16,-1,-1,-1,0,
0,1,8,8,-1,-1,-1,0,-1,-1,-1,0,8,0,-1,-1,-1,0,0,13,7,-1,-1,-1,0,-1,8,8,7,7,
7,8,8,7,17,17,7,7,7,8,7,7,7,8,8,8,7,7,7,8,8,13,16,7,7,7,8,7,8,8,
2,11,-1,8,8,17,-1,7,-2,7,0,8,-1,7,-1,8,8,8,2,11,-1,8,0,8,8,17,-1,7,-2,7,
-1,8,0,8,8,6,-2,-2,8,8,0,8,2,11,-1,8,8,8,0,17,8,8,-2,7,8,8,17,-1,-1,8,
8,8,8,8,8,8,8,-1,7,8,17,-1,7,8,8,17,2,11,-1,8,-1,7,8,17,-1,7,8,17,-1,7,
-1,7,-2,7,8,17,-1,7,8,10,-1,8,8,10,0,8,2,11,-1,8,-2,7,-1,7,8,17,-2,7,-2,7,
0,-1,7,0,8,-1,7,8,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,8,10,10,8,10,10,10,
10,10,10,10,10,10,10,10,10,10,5,15,10,10,10,10,10,10,10,10,10,10,10,10,10,2,16,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,-2,7,-2,7,-2,
7,-2,7,-1,4,-1,1,-1,0,-1,1,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,-7,-2,-2,7,-2,7,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10, };
static unsigned short stb__times_bold_47_latin_ext_w[560]={ 0,8,17,21,19,38,33,8,13,13,17,24,9,13,
8,12,19,16,19,19,19,19,19,20,19,19,8,9,24,24,24,17,38,31,27,28,29,27,25,32,33,16,21,34,
27,40,30,31,24,31,32,20,26,30,31,43,31,31,28,9,12,9,19,23,10,20,22,17,22,17,17,20,22,12,
13,23,12,34,22,19,22,22,18,15,14,22,21,31,21,21,19,12,3,13,24,23,23,23,23,23,23,23,23,23,
23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,0,8,17,21,21,22,
3,19,14,30,14,21,24,13,30,23,15,23,12,12,10,23,23,8,8,11,12,21,30,30,31,17,31,31,31,31,
31,31,42,28,27,27,27,27,16,16,16,16,30,30,31,31,31,31,31,19,31,30,30,30,30,31,25,21,20,20,
20,20,20,20,29,17,17,17,17,17,13,13,14,14,19,22,19,19,19,19,19,23,19,22,22,22,22,21,22,21,
31,20,31,20,31,21,28,17,28,17,28,17,28,17,29,30,30,22,27,17,27,17,27,17,27,17,27,17,32,20,
32,20,32,20,32,20,33,22,33,22,16,14,16,14,16,14,16,12,16,12,35,21,21,16,34,23,24,27,12,27,
12,27,20,27,18,27,12,30,22,30,22,30,22,31,31,20,31,19,31,19,31,19,40,29,32,18,32,18,32,18,
20,15,20,15,20,15,20,15,26,14,26,22,26,14,30,22,30,22,30,22,30,22,30,22,29,22,43,31,31,21,
31,28,19,28,19,28,19,17,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,29,23,23,23,23,23,23,
23,23,23,23,23,23,23,23,23,23,33,24,23,23,23,23,23,23,23,23,23,23,23,23,23,36,26,23,23,23,
23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,31,20,16,14,31,
19,30,22,30,22,30,22,30,22,30,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,
23,23,23,23,23,23,23,23,23,23,31,20,42,29,31,19,23,23,23,23,23,23,23,23,23,23,23,23,23,23,
23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,
23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,
23,23,23,23,23,23, };
static unsigned short stb__times_bold_47_latin_ext_h[560]={ 0,30,15,30,32,31,30,15,38,38,17,24,15,5,
8,30,30,29,29,30,29,30,30,30,30,30,21,28,22,10,22,30,39,29,29,30,29,29,29,30,29,29,30,29,
29,29,30,30,29,37,29,30,29,30,30,30,29,29,29,37,30,37,16,4,9,21,30,21,30,21,29,30,29,29,
39,29,29,20,20,21,30,30,20,21,28,21,21,21,20,30,20,38,39,38,8,27,27,27,27,27,27,27,27,27,
27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,0,31,36,30,22,29,
39,39,7,30,13,20,10,5,30,4,15,24,16,16,9,30,39,8,9,16,13,20,31,31,31,31,38,38,38,37,
37,36,29,37,38,38,38,37,38,38,38,37,29,38,39,39,39,38,38,19,32,39,39,39,38,38,29,30,31,31,
31,30,30,31,21,28,31,31,31,30,30,30,30,29,30,29,31,31,31,30,30,19,22,31,31,31,30,40,39,39,
35,27,38,30,39,30,39,31,40,31,38,30,39,31,38,30,29,30,35,27,38,30,37,30,39,30,38,31,40,40,
39,39,38,39,37,41,39,39,29,29,37,29,35,26,38,29,39,39,37,20,30,39,40,40,37,37,20,38,38,37,
37,29,29,29,29,29,29,39,30,37,28,39,30,29,30,30,36,27,39,30,39,31,30,21,38,30,37,28,38,30,
39,31,40,31,37,28,39,31,40,38,38,30,29,28,38,30,36,27,39,30,40,31,39,31,39,30,40,31,39,40,
37,38,30,37,29,38,30,29,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,30,27,27,39,27,27,27,
27,27,27,27,27,27,27,27,27,27,33,23,27,27,27,27,27,27,27,27,27,27,27,27,27,36,22,27,27,27,
27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,39,31,39,30,40,
31,40,31,39,34,39,37,39,38,39,37,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,
27,27,27,27,27,27,27,27,27,27,44,40,39,31,41,31,27,27,27,27,27,27,27,27,27,27,27,27,27,27,
27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,
27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,
27,27,27,27,27,27, };
static unsigned short stb__times_bold_47_latin_ext_s[560]={ 459,372,315,306,378,421,228,502,283,274,239,
60,501,498,503,85,457,308,325,248,369,192,149,22,222,202,503,500,110,402,204,
184,452,29,123,397,151,204,284,426,250,495,268,61,1,196,159,471,237,304,262,
285,96,47,395,427,389,421,453,368,122,448,282,377,427,352,99,423,24,441,232,
78,181,482,263,345,295,81,36,373,411,349,116,283,310,329,229,251,173,290,459,
325,285,126,458,416,416,416,416,416,416,416,416,416,416,416,416,416,416,416,416,
416,416,416,416,416,416,416,416,416,416,416,416,416,416,416,416,416,459,282,62,
312,182,453,239,243,483,1,349,59,377,498,135,401,333,36,302,269,438,371,32,
449,502,257,364,479,461,311,109,404,29,218,186,255,62,80,213,475,1,61,118,
34,491,175,225,378,291,311,191,388,420,445,342,219,346,254,1,344,371,242,89,
87,362,383,1,1,490,440,393,367,422,91,492,325,311,297,282,181,242,1,342,
291,244,164,262,195,135,68,45,22,141,199,476,490,212,440,459,43,155,109,32,
264,317,226,430,131,315,138,415,459,58,64,261,484,402,343,1,379,187,361,297,
208,426,86,332,375,192,311,29,33,1,365,24,130,458,115,244,21,477,276,396,
499,287,135,212,289,128,150,125,395,148,374,402,183,494,476,432,153,354,386,373,
413,434,94,325,86,477,322,32,64,149,1,35,98,67,188,118,299,338,190,1,
348,250,209,491,492,252,476,234,385,294,460,377,140,99,262,186,401,155,169,181,
461,223,1,346,85,117,398,56,328,273,156,444,404,336,89,166,419,256,146,351,
414,416,416,416,416,416,416,416,416,416,416,416,416,416,416,416,381,416,416,215,
416,416,416,416,416,416,416,416,416,416,416,416,416,312,85,416,416,416,416,416,
416,416,416,416,416,416,416,416,112,155,416,416,416,416,416,416,416,416,416,416,
416,416,416,416,416,416,416,416,416,416,416,416,416,416,416,416,416,416,92,21,
277,334,167,42,221,62,459,289,1,211,124,288,61,160,416,416,416,416,416,416,
416,416,416,416,416,416,416,416,416,416,416,416,416,416,416,416,416,416,416,416,
416,416,416,1,107,148,108,54,1,416,416,416,416,416,416,416,416,416,416,416,
416,416,416,416,416,416,416,416,416,416,416,416,416,416,416,416,416,416,416,416,
416,416,416,416,416,416,416,416,416,416,416,416,416,416,416,416,416,416,416,416,
416,416,416,416,416,416,416,416,416,416,416,416,416,416,416,416,416,416,416,416,
416,416,416,416,416,416,416,416,416, };
static unsigned short stb__times_bold_47_latin_ext_t[560]={ 41,345,523,376,243,243,376,468,126,166,523,
498,498,523,398,376,345,438,438,345,438,345,345,345,313,313,376,345,498,523,498,
313,86,468,468,313,468,468,468,313,468,438,345,468,468,438,376,376,438,205,438,
376,468,407,376,376,438,438,438,205,407,205,523,534,523,498,407,498,407,498,468,
407,468,438,46,438,438,523,523,498,345,345,523,498,468,498,498,498,523,345,498,
126,86,126,523,468,468,468,468,468,468,468,468,468,468,468,468,468,468,468,468,
468,468,468,468,468,468,468,468,468,468,468,468,468,468,468,468,468,41,280,243,
345,498,407,46,46,523,376,523,523,523,523,407,534,523,498,523,523,523,376,86,
523,484,523,523,498,280,280,313,280,166,126,126,205,205,243,407,205,166,166,166,
205,126,166,166,205,407,166,86,86,86,166,166,523,243,86,86,46,126,166,438,
345,280,280,313,345,313,280,498,468,280,313,280,313,313,313,313,438,313,438,280,
280,280,313,313,523,498,313,313,313,313,1,46,1,243,468,126,345,46,345,46,
280,1,280,126,345,46,280,166,313,438,345,243,468,126,313,243,313,46,313,126,
280,1,1,86,46,166,86,243,1,126,86,438,438,205,438,243,498,166,407,46,
46,205,523,345,86,1,1,205,205,523,166,166,205,166,407,407,438,407,407,407,
46,345,205,468,86,345,407,376,376,243,498,126,376,126,280,376,498,126,376,205,
468,126,376,86,243,1,243,205,468,46,243,1,126,126,376,407,468,126,345,243,
468,86,407,1,280,86,243,86,376,1,280,46,1,205,166,407,205,407,166,376,
407,468,468,468,468,468,468,468,468,468,468,468,468,468,468,468,345,468,468,46,
468,468,468,468,468,468,468,468,468,468,468,468,468,243,498,468,468,468,468,468,
468,468,468,468,468,468,468,468,243,498,468,468,468,468,468,468,468,468,468,468,
468,468,468,468,468,468,468,468,468,468,468,468,468,468,468,468,468,468,46,281,
46,345,1,281,1,280,1,243,46,205,46,166,46,205,468,468,468,468,468,468,
468,468,468,468,468,468,468,468,468,468,468,468,468,468,468,468,468,468,468,468,
468,468,468,1,1,86,280,1,281,468,468,468,468,468,468,468,468,468,468,468,
468,468,468,468,468,468,468,468,468,468,468,468,468,468,468,468,468,468,468,468,
468,468,468,468,468,468,468,468,468,468,468,468,468,468,468,468,468,468,468,468,
468,468,468,468,468,468,468,468,468,468,468,468,468,468,468,468,468,468,468,468,
468,468,468,468,468,468,468,468,468, };
static unsigned short stb__times_bold_47_latin_ext_a[560]={ 170,226,377,340,340,679,566,189,
226,226,340,387,170,226,170,189,340,340,340,340,340,340,340,340,
340,340,226,226,387,387,387,340,632,490,453,490,490,453,415,528,
528,264,340,528,453,641,490,528,415,528,490,378,453,490,490,679,
490,490,453,226,189,226,395,340,226,340,378,301,378,301,226,340,
378,189,226,378,189,566,378,340,378,378,301,264,226,378,340,490,
340,340,301,268,150,268,353,528,528,528,528,528,528,528,528,528,
528,528,528,528,528,528,528,528,528,528,528,528,528,528,528,528,
528,528,528,528,528,528,528,528,170,226,340,340,340,340,150,340,
226,507,204,340,387,226,507,340,272,373,204,204,226,391,367,170,
226,204,224,340,509,509,509,340,490,490,490,490,490,490,679,490,
453,453,453,453,264,264,264,264,490,490,528,528,528,528,528,387,
528,490,490,490,490,490,415,378,340,340,340,340,340,340,490,301,
301,301,301,301,189,189,189,189,340,378,340,340,340,340,340,373,
340,378,378,378,378,340,378,340,490,340,490,340,490,340,490,301,
490,301,490,301,490,301,490,498,490,378,453,301,453,301,453,301,
453,301,453,301,528,340,528,340,528,340,528,340,528,378,528,378,
264,189,264,189,264,189,264,189,264,189,559,375,340,226,528,378,
378,453,189,453,189,453,318,453,269,453,189,490,378,490,378,490,
378,495,522,378,528,340,528,340,528,340,679,490,490,301,490,301,
490,301,378,264,378,264,378,264,378,264,453,226,453,354,453,226,
490,378,490,378,490,378,490,378,490,378,490,378,679,490,490,340,
490,453,301,453,301,453,301,189,528,528,528,528,528,528,528,528,
528,528,528,528,528,528,528,502,528,528,340,528,528,528,528,528,
528,528,528,528,528,528,528,528,528,376,528,528,528,528,528,528,
528,528,528,528,528,528,528,540,407,528,528,528,528,528,528,528,
528,528,528,528,528,528,528,528,528,528,528,528,528,528,528,528,
528,528,528,528,528,490,340,264,189,528,340,490,378,490,378,490,
378,490,378,490,378,528,528,528,528,528,528,528,528,528,528,528,
528,528,528,528,528,528,528,528,528,528,528,528,528,528,528,528,
528,528,490,340,679,490,528,340,528,528,528,528,528,528,528,528,
528,528,528,528,528,528,528,528,528,528,528,528,528,528,528,528,
528,528,528,528,528,528,528,528,528,528,528,528,528,528,528,528,
528,528,528,528,528,528,528,528,528,528,528,528,528,528,528,528,
528,528,528,528,528,528,528,528,528,528,528,528,528,528,528,528,
528,528,528,528,528,528,528,528, };
// Call this function with
// font: NULL or array length
// data: NULL or specified size
// height: STB_FONT_times_bold_47_latin_ext_BITMAP_HEIGHT or STB_FONT_times_bold_47_latin_ext_BITMAP_HEIGHT_POW2
// return value: spacing between lines
static void stb_font_times_bold_47_latin_ext(stb_fontchar font[STB_FONT_times_bold_47_latin_ext_NUM_CHARS],
unsigned char data[STB_FONT_times_bold_47_latin_ext_BITMAP_HEIGHT][STB_FONT_times_bold_47_latin_ext_BITMAP_WIDTH],
int height)
{
int i,j;
if (data != 0) {
unsigned int *bits = stb__times_bold_47_latin_ext_pixels;
unsigned int bitpack = *bits++, numbits = 32;
for (i=0; i < STB_FONT_times_bold_47_latin_ext_BITMAP_WIDTH*height; ++i)
data[0][i] = 0; // zero entire bitmap
for (j=1; j < STB_FONT_times_bold_47_latin_ext_BITMAP_HEIGHT-1; ++j) {
for (i=1; i < STB_FONT_times_bold_47_latin_ext_BITMAP_WIDTH-1; ++i) {
unsigned int value;
if (numbits==0) bitpack = *bits++, numbits=32;
value = bitpack & 1;
bitpack >>= 1, --numbits;
if (value) {
if (numbits < 3) bitpack = *bits++, numbits = 32;
data[j][i] = (bitpack & 7) * 0x20 + 0x1f;
bitpack >>= 3, numbits -= 3;
} else {
data[j][i] = 0;
}
}
}
}
// build font description
if (font != 0) {
float recip_width = 1.0f / STB_FONT_times_bold_47_latin_ext_BITMAP_WIDTH;
float recip_height = 1.0f / height;
for (i=0; i < STB_FONT_times_bold_47_latin_ext_NUM_CHARS; ++i) {
// pad characters so they bilerp from empty space around each character
font[i].s0 = (stb__times_bold_47_latin_ext_s[i]) * recip_width;
font[i].t0 = (stb__times_bold_47_latin_ext_t[i]) * recip_height;
font[i].s1 = (stb__times_bold_47_latin_ext_s[i] + stb__times_bold_47_latin_ext_w[i]) * recip_width;
font[i].t1 = (stb__times_bold_47_latin_ext_t[i] + stb__times_bold_47_latin_ext_h[i]) * recip_height;
font[i].x0 = stb__times_bold_47_latin_ext_x[i];
font[i].y0 = stb__times_bold_47_latin_ext_y[i];
font[i].x1 = stb__times_bold_47_latin_ext_x[i] + stb__times_bold_47_latin_ext_w[i];
font[i].y1 = stb__times_bold_47_latin_ext_y[i] + stb__times_bold_47_latin_ext_h[i];
font[i].advance_int = (stb__times_bold_47_latin_ext_a[i]+8)>>4;
font[i].s0f = (stb__times_bold_47_latin_ext_s[i] - 0.5f) * recip_width;
font[i].t0f = (stb__times_bold_47_latin_ext_t[i] - 0.5f) * recip_height;
font[i].s1f = (stb__times_bold_47_latin_ext_s[i] + stb__times_bold_47_latin_ext_w[i] + 0.5f) * recip_width;
font[i].t1f = (stb__times_bold_47_latin_ext_t[i] + stb__times_bold_47_latin_ext_h[i] + 0.5f) * recip_height;
font[i].x0f = stb__times_bold_47_latin_ext_x[i] - 0.5f;
font[i].y0f = stb__times_bold_47_latin_ext_y[i] - 0.5f;
font[i].x1f = stb__times_bold_47_latin_ext_x[i] + stb__times_bold_47_latin_ext_w[i] + 0.5f;
font[i].y1f = stb__times_bold_47_latin_ext_y[i] + stb__times_bold_47_latin_ext_h[i] + 0.5f;
font[i].advance = stb__times_bold_47_latin_ext_a[i]/16.0f;
}
}
}
#ifndef STB_SOMEFONT_CREATE
#define STB_SOMEFONT_CREATE stb_font_times_bold_47_latin_ext
#define STB_SOMEFONT_BITMAP_WIDTH STB_FONT_times_bold_47_latin_ext_BITMAP_WIDTH
#define STB_SOMEFONT_BITMAP_HEIGHT STB_FONT_times_bold_47_latin_ext_BITMAP_HEIGHT
#define STB_SOMEFONT_BITMAP_HEIGHT_POW2 STB_FONT_times_bold_47_latin_ext_BITMAP_HEIGHT_POW2
#define STB_SOMEFONT_FIRST_CHAR STB_FONT_times_bold_47_latin_ext_FIRST_CHAR
#define STB_SOMEFONT_NUM_CHARS STB_FONT_times_bold_47_latin_ext_NUM_CHARS
#define STB_SOMEFONT_LINE_SPACING STB_FONT_times_bold_47_latin_ext_LINE_SPACING
#endif
| 71.136134 | 131 | 0.819571 | stetre |
1f432c4bd1146f7420fb388837d2977b5a0557bd | 31,130 | hpp | C++ | external/laz-perf-1.5.0/cpp/laz-perf/io.hpp | lbartoletti/pointcloud | 02662563ee57cb63be7fb91f6a6871f8b358d054 | [
"BSD-3-Clause"
] | null | null | null | external/laz-perf-1.5.0/cpp/laz-perf/io.hpp | lbartoletti/pointcloud | 02662563ee57cb63be7fb91f6a6871f8b358d054 | [
"BSD-3-Clause"
] | null | null | null | external/laz-perf-1.5.0/cpp/laz-perf/io.hpp | lbartoletti/pointcloud | 02662563ee57cb63be7fb91f6a6871f8b358d054 | [
"BSD-3-Clause"
] | null | null | null | /*
===============================================================================
FILE: io.hpp
CONTENTS:
LAZ io
PROGRAMMERS:
martin.isenburg@rapidlasso.com - http://rapidlasso.com
uday.karan@gmail.com - Hobu, Inc.
COPYRIGHT:
(c) 2007-2014, martin isenburg, rapidlasso - tools to catch reality
(c) 2014, Uday Verma, Hobu, Inc.
This is free software; you can redistribute and/or modify it under the
terms of the GNU Lesser General Licence as published by the Free Software
Foundation. See the COPYING file for more information.
This software is distributed WITHOUT ANY WARRANTY and without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
CHANGE HISTORY:
===============================================================================
*/
#ifndef __io_hpp__
#define __io_hpp__
#include <fstream>
#include <functional>
#include <limits>
#include <string.h>
#include <mutex>
#include "formats.hpp"
#include "excepts.hpp"
#include "factory.hpp"
#include "decoder.hpp"
#include "encoder.hpp"
#include "util.hpp"
#include "portable_endian.hpp"
namespace laszip {
// A simple datastructure to get input from the user
template<
typename T
>
struct vector3 {
T x, y, z;
vector3() : x(0), y(0), z(0) {}
vector3(const T& _x, const T& _y, const T& _z) :
x(_x), y(_y), z(_z) {
}
};
#define DefaultChunkSize 50000
namespace io {
// LAZ file header
#pragma pack(push, 1)
struct header {
char magic[4];
unsigned short file_source_id;
unsigned short global_encoding;
char guid[16];
struct {
unsigned char major;
unsigned char minor;
} version;
char system_identifier[32];
char generating_software[32];
struct {
unsigned short day;
unsigned short year;
} creation;
unsigned short header_size;
unsigned int point_offset;
unsigned int vlr_count;
unsigned char point_format_id;
unsigned short point_record_length;
unsigned int point_count;
unsigned int points_by_return[5];
struct {
double x, y, z;
} scale;
struct {
double x, y, z;
} offset;
struct {
double x, y, z;
} minimum;
struct {
double x, y, z;
} maximum;
};
// A Single LAZ Item representation
struct laz_item {
unsigned short type,
size,
version;
};
struct laz_vlr {
uint16_t compressor;
uint16_t coder;
struct {
unsigned char major;
unsigned char minor;
uint16_t revision;
} version;
uint32_t options;
uint32_t chunk_size;
int64_t num_points,
num_bytes;
uint16_t num_items;
laz_item *items;
laz_vlr() : num_items(0), items(NULL) {}
~laz_vlr() {
delete [] items;
}
laz_vlr(const char *data) {
items = NULL;
fill(data);
}
size_t size() const {
return sizeof(laz_vlr) - sizeof(laz_item *) +
(num_items * sizeof(laz_item));
}
laz_vlr(const laz_vlr& rhs) {
compressor = rhs.compressor;
coder = rhs.coder;
// the version we're compatible with
version.major = rhs.version.major;
version.minor = rhs.version.minor;
version.revision = rhs.version.revision;
options = rhs.options;
chunk_size = rhs.chunk_size;
num_points = rhs.num_points;
num_bytes = rhs.num_bytes;
num_items = rhs.num_items;
if (rhs.items) {
items = new laz_item[num_items];
for (int i = 0 ; i < num_items ; i ++) {
items[i] = rhs.items[i];
}
}
}
laz_vlr& operator = (const laz_vlr& rhs) {
if (this == &rhs)
return *this;
compressor = rhs.compressor;
coder = rhs.coder;
// the version we're compatible with
version.major = rhs.version.major;
version.minor = rhs.version.minor;
version.revision = rhs.version.revision;
options = rhs.options;
chunk_size = rhs.chunk_size;
num_points = rhs.num_points;
num_bytes = rhs.num_bytes;
num_items = rhs.num_items;
if (rhs.items) {
items = new laz_item[num_items];
for (int i = 0 ; i < num_items ; i ++) {
items[i] = rhs.items[i];
}
}
return *this;
}
void fill(const char *data) {
std::copy(data, data + sizeof(compressor), (char *)&compressor);
compressor = le16toh(compressor);
data += sizeof(compressor);
std::copy(data, data + sizeof(coder), (char *)&coder);
coder = le16toh(coder);
data += sizeof(coder);
version.major = *(const unsigned char *)data++;
version.minor = *(const unsigned char *)data++;
std::copy(data, data + sizeof(version.revision), (char *)&version.revision);
version.revision = le16toh(version.revision);
data += sizeof(version.revision);
std::copy(data, data + sizeof(options), (char *)&options);
options = le32toh(options);
data += sizeof(options);
std::copy(data, data + sizeof(chunk_size), (char *)&chunk_size);
chunk_size = le32toh(chunk_size);
data += sizeof(chunk_size);
std::copy(data, data + sizeof(num_points), (char *)&num_points);
num_points = le64toh(num_points);
data += sizeof(num_points);
std::copy(data, data + sizeof(num_bytes), (char *)&num_bytes);
num_bytes = le64toh(num_bytes);
data += sizeof(num_bytes);
std::copy(data, data + sizeof(num_items), (char *)&num_items);
num_items = le16toh(num_items);
data += sizeof(num_items);
delete [] items;
items = new laz_item[num_items];
for (int i = 0 ; i < num_items ; i ++) {
laz_item& item = items[i];
std::copy(data, data + sizeof(item.type), (char *)&item.type);
item.type = le16toh(item.type);
data += sizeof(item.type);
std::copy(data, data + sizeof(item.size), (char *)&item.size);
item.size = le16toh(item.size);
data += sizeof(item.size);
std::copy(data, data + sizeof(item.version), (char *)&item.version);
item.version = le16toh(item.version);
data += sizeof(item.version);
}
}
void extract(char *data) {
uint16_t s;
uint32_t i;
uint64_t ll;
char *src;
s = htole16(compressor);
src = (char *)&s;
std::copy(src, src + sizeof(compressor), data);
data += sizeof(compressor);
s = htole16(coder);
src = (char *)&s;
std::copy(src, src + sizeof(coder), data);
data += sizeof(coder);
*data++ = version.major;
*data++ = version.minor;
s = htole16(version.revision);
src = (char *)&s;
std::copy(src, src + sizeof(version.revision), data);
data += sizeof(version.revision);
i = htole32(options);
src = (char *)&i;
std::copy(src, src + sizeof(options), data);
data += sizeof(options);
i = htole32(chunk_size);
src = (char *)&i;
std::copy(src, src + sizeof(chunk_size), data);
data += sizeof(chunk_size);
ll = htole64(num_points);
src = (char *)≪
std::copy(src, src + sizeof(num_points), data);
data += sizeof(num_points);
ll = htole64(num_bytes);
src = (char *)≪
std::copy(src, src + sizeof(num_bytes), data);
data += sizeof(num_bytes);
s = htole16(num_items);
src = (char *)&s;
std::copy(src, src + sizeof(num_items), data);
data += sizeof(num_items);
for (int k = 0 ; k < num_items ; k ++) {
laz_item& item = items[k];
s = htole16(item.type);
src = (char *)&s;
std::copy(src, src + sizeof(item.type), data);
data += sizeof(item.type);
s = htole16(item.size);
src = (char *)&s;
std::copy(src, src + sizeof(item.size), data);
data += sizeof(item.size);
s = htole16(item.version);
src = (char *)&s;
std::copy(src, src + sizeof(item.version), data);
data += sizeof(item.version);
}
}
static laz_vlr from_schema(const factory::record_schema& s, uint32_t chunksize = DefaultChunkSize) {
laz_vlr r;
// We only do pointwise chunking.
r.compressor = 2;
r.coder = 0;
// the version we're compatible with
r.version.major = 2;
r.version.minor = 2;
r.version.revision = 0;
r.options = 0;
r.chunk_size = chunksize;
r.num_points = -1;
r.num_bytes = -1;
r.num_items = static_cast<unsigned short>(s.records.size());
r.items = new laz_item[s.records.size()];
for (size_t i = 0 ; i < s.records.size() ; i ++) {
laz_item& item = r.items[i];
const factory::record_item& rec = s.records.at(i);
item.type = static_cast<unsigned short>(rec.type);
item.size = static_cast<unsigned short>(rec.size);
item.version = static_cast<unsigned short>(rec.version);
}
return r;
}
static factory::record_schema to_schema(const laz_vlr& vlr, int point_len) {
// convert the laszip items into record schema to be used by
// compressor/decompressor
using namespace factory;
factory::record_schema schema;
for(auto i = 0 ; i < vlr.num_items ; i++) {
laz_item& item = vlr.items[i];
schema.push(factory::record_item(item.type, item.size,
item.version));
point_len -= item.size;
}
if (point_len < 0)
throw laszip_format_unsupported();
// Add extra bytes information
if (point_len)
schema.push(factory::record_item(record_item::BYTE,
point_len, 2));
return schema;
}
#ifdef _WIN32
__declspec(deprecated) static factory::record_schema to_schema(const laz_vlr& vlr)
#else
static factory::record_schema to_schema(const laz_vlr& vlr) __attribute__ ((deprecated))
#endif
{
// convert the laszip items into record schema to be used by
// compressor/decompressor
using namespace factory;
factory::record_schema schema;
for(auto i = 0 ; i < vlr.num_items ; i++) {
laz_item& item = vlr.items[i];
schema.push(factory::record_item(item.type, item.size,
item.version));
}
return schema;
}
};
#pragma pack(pop)
// cache line
#define BUF_SIZE (1 << 20)
template<typename StreamType>
struct __ifstream_wrapper {
__ifstream_wrapper(StreamType& f) : f_(f), offset(0), have(0),
buf_((char*)utils::aligned_malloc(BUF_SIZE)) {
}
~__ifstream_wrapper() {
utils::aligned_free(buf_);
}
__ifstream_wrapper(const __ifstream_wrapper<StreamType>&) = delete;
__ifstream_wrapper& operator = (const __ifstream_wrapper<StreamType>&) = delete;
inline void fillit_() {
offset = 0;
f_.read(buf_, BUF_SIZE);
have = f_.gcount();
if (have == 0)
throw end_of_file(); // this is an exception since we shouldn't be hitting eof
}
inline void reset() {
offset = have = 0; // when a file is seeked, reset this
}
inline unsigned char getByte() {
if (offset >= have)
fillit_();
return static_cast<unsigned char>(buf_[offset++]);
}
inline void getBytes(unsigned char *buf, size_t request) {
// Use what's left in the buffer, if anything.
size_t fetchable = (std::min)((size_t)(have - offset), request);
std::copy(buf_ + offset, buf_ + offset + fetchable, buf);
offset += fetchable;
request -= fetchable;
// If we couldn't fetch everything requested, fill buffer
// and go again. We assume fillit_() satisfies any request.
if (request)
{
fillit_();
std::copy(buf_ + offset, buf_ + offset + request, buf + fetchable);
offset += request;
}
}
StreamType& f_;
std::streamsize offset, have;
char *buf_;
};
template<typename StreamType>
struct __ofstream_wrapper {
__ofstream_wrapper(StreamType& f) : f_(f) {}
void putBytes(const unsigned char *b, size_t len) {
f_.write(reinterpret_cast<const char*>(b), len);
}
void putByte(unsigned char b) {
f_.put((char)b);
}
__ofstream_wrapper(const __ofstream_wrapper&) = delete;
__ofstream_wrapper& operator = (const __ofstream_wrapper&) = delete;
StreamType& f_;
};
namespace reader {
template <typename StreamType>
class basic_file {
typedef std::function<void (header&)> validator_type;
public:
basic_file(StreamType& st) : f_(st), wrapper_(f_) {
_open();
}
~basic_file() {
}
const header& get_header() const {
return header_;
}
const laz_vlr& get_laz_vlr() const {
return laz_;
}
const factory::record_schema& get_schema() const {
return schema_;
}
void readPoint(char *out) {
// read the next point in
if (chunk_state_.points_read == laz_.chunk_size ||
!pdecomperssor_ || !pdecoder_) {
// Its time to (re)init the decoder
//
pdecomperssor_.reset();
pdecoder_.reset();
pdecoder_.reset(new decoders::arithmetic<__ifstream_wrapper<StreamType> >(wrapper_));
pdecomperssor_ = factory::build_decompressor(*pdecoder_, schema_);
// reset chunk state
chunk_state_.current++;
chunk_state_.points_read = 0;
}
pdecomperssor_->decompress(out);
chunk_state_.points_read ++;
}
private:
void _open() {
// Make sure our header is correct
//
char magic[4];
f_.read(magic, sizeof(magic));
if (std::string(magic, magic+4) != "LASF")
throw invalid_magic();
// Read the header in
f_.seekg(0);
f_.read((char*)&header_, sizeof(header_));
// The mins and maxes are in a weird order, fix them
_fixMinMax(header_);
// make sure everything is valid with the header, note that validators are allowed
// to manipulate the header, since certain validators depend on a header's orignial state
// to determine what its final stage is going to be
for (auto f : _validators())
f(header_);
// things look fine, move on with VLR extraction
_parseLASZIP();
// parse the chunk table offset
_parseChunkTable();
// set the file pointer to the beginning of data to start reading
f_.clear(); // may have treaded past the EOL, so reset everything before we start reading:w
f_.seekg(header_.point_offset + sizeof(int64_t));
wrapper_.reset();
}
void _fixMinMax(header& h) {
double mx, my, mz, nx, ny, nz;
mx = h.minimum.x; nx = h.minimum.y;
my = h.minimum.z; ny = h.maximum.x;
mz = h.maximum.y; nz = h.maximum.z;
h.minimum.x = nx; h.maximum.x = mx;
h.minimum.y = ny; h.maximum.y = my;
h.minimum.z = nz; h.maximum.z = mz;
}
void _parseLASZIP() {
// move the pointer to the begining of the VLRs
f_.seekg(header_.header_size);
#pragma pack(push, 1)
struct {
unsigned short reserved;
char user_id[16];
unsigned short record_id;
unsigned short record_length;
char desc[32];
} vlr_header;
#pragma pack(pop)
size_t count = 0;
bool laszipFound = false;
while(count < header_.vlr_count && f_.good() && !f_.eof()) {
f_.read((char*)&vlr_header, sizeof(vlr_header));
const char *user_id = "laszip encoded";
if (std::equal(vlr_header.user_id, vlr_header.user_id + 14, user_id) &&
vlr_header.record_id == 22204) {
// this is the laszip VLR
//
laszipFound = true;
std::unique_ptr<char> buffer(
new char[vlr_header.record_length]);
f_.read(buffer.get(), vlr_header.record_length);
_parseLASZIPVLR(buffer.get());
break; // no need to keep iterating
}
f_.seekg(vlr_header.record_length, std::ios::cur); // jump foward
count++;
}
if (!laszipFound)
throw no_laszip_vlr();
schema_ = laz_vlr::to_schema(laz_, header_.point_record_length);
}
void binPrint(const char *buf, int len) {
for (int i = 0 ; i < len ; i ++) {
char b[256];
sprintf(b, "%02X", buf[i] & 0xFF);
std::cout << b << " ";
}
std::cout << std::endl;
}
void _parseLASZIPVLR(const char *buf) {
laz_.fill(buf);
if (laz_.compressor != 2)
throw laszip_format_unsupported();
}
void _parseChunkTable() {
// Move to the begining of the data
//
f_.seekg(header_.point_offset);
int64_t chunkoffset = 0;
f_.read((char*)&chunkoffset, sizeof(chunkoffset));
if (!f_.good())
throw chunk_table_read_error();
if (chunkoffset == -1)
throw not_supported("Chunk table offset == -1 is not supported at this time");
// Go to the chunk offset and read in the table
//
f_.seekg(chunkoffset);
if (!f_.good())
throw chunk_table_read_error();
// Now read in the chunk table
struct {
unsigned int version,
chunk_count;
} chunk_table_header;
f_.read((char *)&chunk_table_header, sizeof(chunk_table_header));
if (!f_.good())
throw chunk_table_read_error();
if (chunk_table_header.version != 0)
throw unknown_chunk_table_format();
// start pushing in chunk table offsets
chunk_table_offsets_.clear();
if (laz_.chunk_size == (std::numeric_limits<unsigned int>::max)())
throw not_supported("chunk_size == uint.max is not supported at this time.");
// Allocate enough room for our chunk
chunk_table_offsets_.resize(chunk_table_header.chunk_count + 1);
// Add The first one
chunk_table_offsets_[0] = header_.point_offset + sizeof(uint64_t);
if (chunk_table_header.chunk_count > 1) {
// decode the index out
//
__ifstream_wrapper<StreamType> w(f_);
decoders::arithmetic<__ifstream_wrapper<StreamType> > decoder(w);
decompressors::integer decomp(32, 2);
// start decoder
decoder.readInitBytes();
decomp.init();
for (size_t i = 1 ; i <= chunk_table_header.chunk_count ; i ++) {
chunk_table_offsets_[i] = static_cast<uint64_t>(decomp.decompress(decoder, (i > 1) ? static_cast<I32>(chunk_table_offsets_[i - 1]) : 0, 1));
}
for (size_t i = 1 ; i < chunk_table_offsets_.size() ; i ++) {
chunk_table_offsets_[i] += chunk_table_offsets_[i-1];
}
}
}
static const std::vector<validator_type>& _validators() {
static std::vector<validator_type> v; // static collection of validators
static std::mutex lock;
// To remain thread safe we need to make sure we have appropriate guards here
//
if (v.empty()) {
lock.lock();
// Double check here if we're still empty, the first empty just makes sure
// we have a quick way out where validators are already filled up (for all calls
// except the first one), for two threads competing to fill out the validators
// only one of the will get here first, and the second one will bail if the v
// is not empty, and hence the double check
//
if (v.empty()) {
// TODO: Fill all validators here
//
v.push_back(
// Make sure that the header indicates that file is compressed
//
[](header& h) {
int bit_7 = (h.point_format_id >> 7) & 1,
bit_6 = (h.point_format_id >> 6) & 1;
if (bit_7 == 1 && bit_6 == 1)
throw old_style_compression();
if ((bit_7 ^ bit_6) == 0)
throw not_compressed();
h.point_format_id &= 0x3f;
}
);
}
lock.unlock();
}
return v;
}
// The file object is not copyable or copy constructible
basic_file(const basic_file<StreamType>&) = delete;
basic_file<StreamType>& operator = (const basic_file<StreamType>&) = delete;
StreamType& f_;
__ifstream_wrapper<StreamType> wrapper_;
header header_;
laz_vlr laz_;
std::vector<uint64_t> chunk_table_offsets_;
factory::record_schema schema_; // the schema of this file, the LAZ items converted into factory recognizable description,
// Our decompressor
std::shared_ptr<decoders::arithmetic<__ifstream_wrapper<StreamType> > > pdecoder_;
formats::dynamic_decompressor::ptr pdecomperssor_;
// Establish our current state as we iterate through the file
struct __chunk_state{
int64_t current;
int64_t points_read;
int64_t current_index;
__chunk_state() : current(0u), points_read(0u), current_index(-1) {}
} chunk_state_;
};
typedef basic_file<std::ifstream> file;
}
namespace writer {
// An object to encapsulate what gets passed to
struct config {
vector3<double> scale, offset;
unsigned int chunk_size;
explicit config() : scale(1.0, 1.0, 1.0), offset(0.0, 0.0, 0.0), chunk_size(DefaultChunkSize) {}
config(const vector3<double>& s, const vector3<double>& o, unsigned int cs = DefaultChunkSize) :
scale(s), offset(o), chunk_size(cs) {}
config(const header& h) : scale(h.scale.x, h.scale.y, h.scale.z), offset(h.offset.x, h.offset.y, h.offset.z),
chunk_size(DefaultChunkSize) {}
header to_header() const {
header h; memset(&h, 0, sizeof(h)); // clear out header
h.minimum = { (std::numeric_limits<double>::max)(), (std::numeric_limits<double>::max)(),
(std::numeric_limits<double>::max)() };
h.maximum = { std::numeric_limits<double>::lowest(), std::numeric_limits<double>::lowest(),
std::numeric_limits<double>::lowest()};
h.offset.x = offset.x;
h.offset.y = offset.y;
h.offset.z = offset.z;
h.scale.x = scale.x;
h.scale.y = scale.y;
h.scale.z = scale.z;
return h;
}
};
class file {
public:
file() :
wrapper_(f_) {}
file(const std::string& filename,
const factory::record_schema& s,
const config& config) :
wrapper_(f_),
schema_(s),
header_(config.to_header()),
chunk_size_(config.chunk_size) {
open(filename, s, config);
}
void open(const std::string& filename, const factory::record_schema& s, const config& c) {
// open the file and move to offset of data, we'll write
// headers and all other things on file close
f_.open(filename, std::ios::binary | std::ios::trunc);
if (!f_.good())
throw write_open_failed();
schema_ = s;
header_ = c.to_header();
chunk_size_ = c.chunk_size;
// write junk to our prelude, we'll overwrite this with
// awesome data later
//
size_t preludeSize =
sizeof(header) + // the LAS header
54 + // size of one vlr header
(34 + s.records.size() * 6) + // the LAZ vlr size
sizeof(int64_t); // chunk table offset
char *junk = new char[preludeSize];
std::fill(junk, junk + preludeSize, 0);
f_.write(junk, preludeSize);
delete [] junk;
// the first chunk begins at the end of prelude
}
void writePoint(const char *p) {
if (chunk_state_.points_in_chunk == chunk_size_ ||
!pcompressor_ || !pencoder_) {
// Time to (re)init the encoder
//
pcompressor_.reset();
if (pencoder_) {
pencoder_->done(); // make sure we flush it out
pencoder_.reset();
}
// reset chunk state
//
chunk_state_.current_chunk_index ++;
chunk_state_.points_in_chunk = 0;
// take note of the current offset
std::streamsize offset = f_.tellp();
if (chunk_state_.current_chunk_index > 0) {
// When we hit this point the first time around, we don't do anything since we are just
// starting to write out our first chunk.
chunk_sizes_.push_back(offset - chunk_state_.last_chunk_write_offset);
}
chunk_state_.last_chunk_write_offset = offset;
// reinit stuff
pencoder_.reset(new encoders::arithmetic<__ofstream_wrapper<std::ofstream> >(wrapper_));
pcompressor_ = factory::build_compressor(*pencoder_, schema_);
}
// now write the point
pcompressor_->compress(p);
chunk_state_.total_written ++;
chunk_state_.points_in_chunk ++;
_update_min_max(*(reinterpret_cast<const formats::las::point10*>(p)));
}
void close() {
_flush();
if (f_.is_open())
f_.close();
}
private:
void _update_min_max(const formats::las::point10& p) {
double x = p.x * header_.scale.x + header_.offset.x,
y = p.y * header_.scale.y + header_.offset.y,
z = p.z * header_.scale.z + header_.offset.z;
header_.minimum.x = (std::min)(x, header_.minimum.x);
header_.minimum.y = (std::min)(y, header_.minimum.y);
header_.minimum.z = (std::min)(z, header_.minimum.z);
header_.maximum.x = (std::max)(x, header_.maximum.x);
header_.maximum.y = (std::max)(y, header_.maximum.y);
header_.maximum.z = (std::max)(z, header_.maximum.z);
}
void _flush() {
// flush out the encoder
pencoder_->done();
// Note down the size of the offset of this last chunk
chunk_sizes_.push_back((std::streamsize)f_.tellp() - chunk_state_.last_chunk_write_offset);
// Time to write our header
// Fill up things not filled up by our header
//
header_.magic[0] = 'L'; header_.magic[1] = 'A';
header_.magic[2] = 'S'; header_.magic[3] = 'F';
header_.version.major = 1;
header_.version.minor = 2;
header_.header_size = sizeof(header_);
header_.point_offset = sizeof(header) + 54 + (34 + static_cast<unsigned int>(schema_.records.size()) * 6); // 54 is the size of one vlr header
header_.vlr_count = 1;
header_.point_format_id = schema_.format();
header_.point_format_id |= (1 << 7);
header_.point_record_length = static_cast<unsigned short>(schema_.size_in_bytes());
header_.point_count = static_cast<unsigned int>(chunk_state_.total_written);
// make sure we re-arrange mins and maxs for writing
//
double mx, my, mz, nx, ny, nz;
nx = header_.minimum.x; mx = header_.maximum.x;
ny = header_.minimum.y; my = header_.maximum.y;
nz = header_.minimum.z; mz = header_.maximum.z;
header_.minimum.x = mx; header_.minimum.y = nx;
header_.minimum.z = my; header_.maximum.x = ny;
header_.maximum.y = mz; header_.maximum.z = nz;
f_.seekp(0);
f_.write(reinterpret_cast<char*>(&header_), sizeof(header_));
// before we can write the VLR, we need to write the LAS VLR definition
// for it
//
#pragma pack(push, 1)
struct {
unsigned short reserved;
char user_id[16];
unsigned short record_id;
unsigned short record_length_after_header;
char description[32];
} las_vlr_header;
#pragma pack(pop)
las_vlr_header.reserved = 0;
las_vlr_header.record_id = 22204;
las_vlr_header.record_length_after_header = static_cast<unsigned short>(34 + (schema_.records.size() * 6));
strcpy(las_vlr_header.user_id, "laszip encoded");
strcpy(las_vlr_header.description, "laz-perf variant");
// write the las vlr header
f_.write(reinterpret_cast<char*>(&las_vlr_header), sizeof(las_vlr_header));
// prep our VLR so we can write it
//
laz_vlr vlr = laz_vlr::from_schema(schema_, chunk_size_);
std::unique_ptr<char> vlrbuf(new char[vlr.size()]);
vlr.extract(vlrbuf.get());
f_.write(vlrbuf.get(), vlr.size());
// TODO: Write chunk table
//
_writeChunks();
}
void _writeChunks() {
// move to the end of the file to start emitting our compresed table
f_.seekp(0, std::ios::end);
// take note of where we're writing the chunk table, we need this later
int64_t chunk_table_offset = static_cast<int64_t>(f_.tellp());
// write out the chunk table header (version and total chunks)
#pragma pack(push, 1)
struct {
unsigned int version,
chunks_count;
} chunk_table_header = { 0, static_cast<unsigned int>(chunk_sizes_.size()) };
#pragma pack(pop)
f_.write(reinterpret_cast<char*>(&chunk_table_header),
sizeof(chunk_table_header));
// Now compress and write the chunk table
//
__ofstream_wrapper<std::ofstream> w(f_);
encoders::arithmetic<__ofstream_wrapper<std::ofstream> > encoder(w);
compressors::integer comp(32, 2);
comp.init();
for (size_t i = 0 ; i < chunk_sizes_.size() ; i ++) {
comp.compress(encoder,
i ? static_cast<int>(chunk_sizes_[i-1]) : 0,
static_cast<int>(chunk_sizes_[i]), 1);
}
encoder.done();
// go back to where we're supposed to write chunk table offset
f_.seekp(header_.point_offset);
f_.write(reinterpret_cast<char*>(&chunk_table_offset), sizeof(chunk_table_offset));
}
std::ofstream f_;
__ofstream_wrapper<std::ofstream> wrapper_;
formats::dynamic_compressor::ptr pcompressor_;
std::shared_ptr<encoders::arithmetic<__ofstream_wrapper<std::ofstream> > > pencoder_;
factory::record_schema schema_;
header header_;
unsigned int chunk_size_;
struct __chunk_state {
int64_t total_written; // total points written
int64_t current_chunk_index; // the current chunk index we're compressing
unsigned int points_in_chunk;
std::streamsize last_chunk_write_offset;
__chunk_state() : total_written(0), current_chunk_index(-1), points_in_chunk(0), last_chunk_write_offset(0) {}
} chunk_state_;
std::vector<int64_t> chunk_sizes_; // all the places where chunks begin
};
}
}
}
#endif // __io_hpp__
| 29.479167 | 147 | 0.585384 | lbartoletti |
1f43eabfaa3b57637d2bf6ccde30adf8e7f98b52 | 548 | cpp | C++ | Neps/Problems/Zip - 35.cpp | lucaswilliamgomes/QuestionsCompetitiveProgramming | f0a2cf42bb5a00e5d677b7f3211ac399fe2bf6a0 | [
"MIT"
] | null | null | null | Neps/Problems/Zip - 35.cpp | lucaswilliamgomes/QuestionsCompetitiveProgramming | f0a2cf42bb5a00e5d677b7f3211ac399fe2bf6a0 | [
"MIT"
] | null | null | null | Neps/Problems/Zip - 35.cpp | lucaswilliamgomes/QuestionsCompetitiveProgramming | f0a2cf42bb5a00e5d677b7f3211ac399fe2bf6a0 | [
"MIT"
] | null | null | null | #include <bits/stdc++.h>
using namespace std;
int main (){
int a,b,c,d, pointa, pointb;
cin >> a >> b >> c >> d;
if (a==b) pointa = 2 * (a+b);
else if (a == b+1 or b == a+1) pointa = 3 * (a+b);
else pointa = a + b;
if (c==d) pointb = 2 * (c+d);
else if (c == d+1 or d == c+1) pointb = 3 * (c+d);
else pointb = d + c;
if (pointa > pointb) cout << "Lia" << endl;
else if (pointa == pointb) cout << "empate" << endl;
else if (pointa < pointb) cout << "Carolina" << endl;
return 0;
} | 21.92 | 57 | 0.474453 | lucaswilliamgomes |
1f44accefc95d801e13c1900b8f96e33f1a8908b | 895 | cc | C++ | third_party/blink/renderer/core/css/parser/css_lazy_property_parser_impl.cc | zipated/src | 2b8388091c71e442910a21ada3d97ae8bc1845d3 | [
"BSD-3-Clause"
] | 2,151 | 2020-04-18T07:31:17.000Z | 2022-03-31T08:39:18.000Z | third_party/blink/renderer/core/css/parser/css_lazy_property_parser_impl.cc | cangulcan/src | 2b8388091c71e442910a21ada3d97ae8bc1845d3 | [
"BSD-3-Clause"
] | 395 | 2020-04-18T08:22:18.000Z | 2021-12-08T13:04:49.000Z | third_party/blink/renderer/core/css/parser/css_lazy_property_parser_impl.cc | cangulcan/src | 2b8388091c71e442910a21ada3d97ae8bc1845d3 | [
"BSD-3-Clause"
] | 338 | 2020-04-18T08:03:10.000Z | 2022-03-29T12:33:22.000Z | // Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "third_party/blink/renderer/core/css/parser/css_lazy_property_parser_impl.h"
#include "third_party/blink/renderer/core/css/parser/css_lazy_parsing_state.h"
#include "third_party/blink/renderer/core/css/parser/css_parser_impl.h"
namespace blink {
CSSLazyPropertyParserImpl::CSSLazyPropertyParserImpl(size_t offset,
CSSLazyParsingState* state)
: CSSLazyPropertyParser(), offset_(offset), lazy_state_(state) {}
CSSPropertyValueSet* CSSLazyPropertyParserImpl::ParseProperties() {
lazy_state_->CountRuleParsed();
return CSSParserImpl::ParseDeclarationListForLazyStyle(
lazy_state_->SheetText(), offset_, lazy_state_->Context());
}
} // namespace blink
| 38.913043 | 85 | 0.749721 | zipated |
1f4861b660c7ac97c5873e63c199efa7e74de58e | 732 | cc | C++ | src/ipcz/node_name.cc | krockot/ipcz | 6a6ebe43c2cb86882b0df9bf888dc5d34037f015 | [
"BSD-3-Clause"
] | null | null | null | src/ipcz/node_name.cc | krockot/ipcz | 6a6ebe43c2cb86882b0df9bf888dc5d34037f015 | [
"BSD-3-Clause"
] | null | null | null | src/ipcz/node_name.cc | krockot/ipcz | 6a6ebe43c2cb86882b0df9bf888dc5d34037f015 | [
"BSD-3-Clause"
] | null | null | null | // Copyright 2022 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ipcz/node_name.h"
#include <cinttypes>
#include <cstdint>
#include <cstdio>
#include <string>
#include <type_traits>
#include "third_party/abseil-cpp/absl/base/macros.h"
namespace ipcz {
static_assert(std::is_standard_layout<NodeName>::value, "Invalid NodeName");
NodeName::~NodeName() = default;
std::string NodeName::ToString() const {
std::string name(33, 0);
int length = snprintf(name.data(), name.size(), "%016" PRIx64 "%016" PRIx64,
high_, low_);
ABSL_ASSERT(length == 32);
return name;
}
} // namespace ipcz
| 24.4 | 78 | 0.693989 | krockot |
1f4f0cdbbf93f934fe37d224274fc9cbf041f2c3 | 1,556 | cc | C++ | src/platform/unix_thread.cc | AnthonyBrunasso/test_games | 31354d2bf95aae9a880e7292bc78ad8577b3f09c | [
"MIT"
] | null | null | null | src/platform/unix_thread.cc | AnthonyBrunasso/test_games | 31354d2bf95aae9a880e7292bc78ad8577b3f09c | [
"MIT"
] | null | null | null | src/platform/unix_thread.cc | AnthonyBrunasso/test_games | 31354d2bf95aae9a880e7292bc78ad8577b3f09c | [
"MIT"
] | 2 | 2019-11-12T23:15:18.000Z | 2020-01-15T17:49:27.000Z | #include "thread.h"
#include <pthread.h>
#include <sched.h>
#include <climits>
#include <cstddef>
static_assert(offsetof(Thread, id) == 0 &&
sizeof(Thread::id) >= sizeof(pthread_t),
"Thread_t layout must be compatible with pthread_t");
namespace platform
{
void*
pthread_shim(void* pthread_arg)
{
Thread* ti = (Thread*)pthread_arg;
ti->return_value = ti->func(ti->arg);
return NULL;
}
u64
ThreadId()
{
pthread_t ptid = pthread_self();
u64 tid;
memcpy(&tid, &ptid, MIN(sizeof(tid), sizeof(ptid)));
return tid;
}
b8
ThreadCreate(Thread* t)
{
if (t->id) return false;
pthread_attr_t attr;
pthread_attr_init(&attr);
pthread_create((pthread_t*)t, &attr, pthread_shim, t);
return true;
}
void
ThreadYield()
{
sched_yield();
}
b8
ThreadJoin(Thread* t)
{
if (!t->id) return false;
pthread_t* pt = (pthread_t*)t;
pthread_join(*pt, 0);
return true;
}
void
ThreadExit(Thread* t, u64 value)
{
t->return_value = value;
pthread_exit(&t->return_value);
}
b8
MutexCreate(Mutex* m)
{
int res = pthread_mutex_init(&m->lock, nullptr);
if (res) {
printf("mutex_create error: %d\n", res);
return false;
}
return true;
}
void
MutexLock(Mutex* m)
{
int res = pthread_mutex_lock(&m->lock);
if (res) {
printf("mutex_lock error: %d\n", res);
}
}
void
MutexUnlock(Mutex* m)
{
int res = pthread_mutex_unlock(&m->lock);
if (res) {
printf("mutex_unlock error: %d\n", res);
}
}
void
MutexFree(Mutex* m)
{
pthread_mutex_destroy(&m->lock);
}
} // namespace platform
| 14.961538 | 67 | 0.647172 | AnthonyBrunasso |
1f514034e9d0344acd0c573e8b3bc1addaaba1d8 | 1,308 | cpp | C++ | graphs/cycle_detection_using_dsu.cpp | Ashish2030/C-_Language_Code | 50b143124690249e5dbd4eaaddfb8a3dadf48f1f | [
"MIT"
] | 7 | 2021-05-05T00:14:39.000Z | 2021-05-16T07:10:06.000Z | graphs/cycle_detection_using_dsu.cpp | Ashish2030/C-_Language_Code | 50b143124690249e5dbd4eaaddfb8a3dadf48f1f | [
"MIT"
] | null | null | null | graphs/cycle_detection_using_dsu.cpp | Ashish2030/C-_Language_Code | 50b143124690249e5dbd4eaaddfb8a3dadf48f1f | [
"MIT"
] | 4 | 2021-05-17T07:54:57.000Z | 2021-06-29T15:36:54.000Z | #include<iostream>
#include<map>
#include<list>
#include<cstring>
#include<unordered_map>
#include<queue>
#include<vector>
using namespace std;
class dsu{
vector<int>part;
public:
dsu(int n){
part.resize(n);
for(int i=0;i<n;i++){
part[i]=i;
}
}
int get_superparent(int x){
if(x==part[x]){
return x;
}
return part[x]=get_superparent(part[x]);
}
void unite(int x,int y){
int super_parent_x=get_superparent(x);
int super_parent_y=get_superparent(y);
if(super_parent_x!=super_parent_y){
part[super_parent_x]=super_parent_y;
}
}
bool detect_cycle(){
int n,m;
bool cycle_present=false;
cin>>n>>m;
for(int i=0;i<m;i++){
int x,y;
cin>>x>>y;
if(get_superparent(x)!=get_superparent(y)){
unite(x,y);
}else{
cycle_present=true;
}
}
return cycle_present;
}
};
int main(){
dsu g(5);
if(g.detect_cycle()){
cout<<"Cycle is present"<<endl;
}else{
cout<<"Cycle not present"<<endl;
}
return 0;
} | 16.35 | 56 | 0.474006 | Ashish2030 |
1f56078dc315f07ce8c8a983d0fc31ce267fd54a | 1,968 | cpp | C++ | Graphics2D/Source/DDraw1DrawList.cpp | TaylorClark/PrimeTime | 3c62f6c53e0494146a95be1412273de3cf05bcd2 | [
"MIT"
] | null | null | null | Graphics2D/Source/DDraw1DrawList.cpp | TaylorClark/PrimeTime | 3c62f6c53e0494146a95be1412273de3cf05bcd2 | [
"MIT"
] | null | null | null | Graphics2D/Source/DDraw1DrawList.cpp | TaylorClark/PrimeTime | 3c62f6c53e0494146a95be1412273de3cf05bcd2 | [
"MIT"
] | null | null | null | #include "..\PrivateInclude\DDraw1DrawList.h"
/// Test if the rectangle intersects any of the dirty rectangles
bool DDraw1DrawList::IntersectsDirtyRects( const Box2i& destRect ) const
{
// Go through each dirty rectangle and test for intersection
for( std::list<Box2i>::const_iterator iterRect = m_DirtyRects.begin(); iterRect != m_DirtyRects.end(); ++iterRect )
{
if( destRect.Intersects( *iterRect ) )
return true;
}
// The destination rectangle does not intersect any of the dirty rectangles
return false;
}
DDraw1DrawList::DrawingList DDraw1DrawList::DrawImage( const TCImage* pImage, const Box2i& destRect, const Box2i& srcRect, int32 fx )
{
DrawingArray curDrawList = m_BackBufferList[m_CurBackBufferIndex];
DrawingList retList;
// Create the item for this draw
DrawnItem newItem;
newItem.destRect = destRect;
newItem.fx = fx;
newItem.pImage = pImage;
newItem.srcRect = srcRect;
// If this item has not been drawn yet then draw the entire thing
if( m_DrawIndex >= curDrawList.size() )
{
curDrawList.resize( m_DrawIndex + 1 );
curDrawList[ m_DrawIndex ] = newItem;
retList.push_back( newItem );
++m_DrawIndex;
return retList;
}
// Test if this will intersect any dirty rectangles
if( IntersectsDirtyRects( destRect ) )
{
}
// If this item is the same as last frame then there is no need to draw it
const DrawnItem& lastFrameDrawn = curDrawList[m_DrawIndex];
if( newItem == lastFrameDrawn )
{
++m_DrawIndex;
return retList;
}
// At this point in the method it is known that this draw needs to occur, but also that all
// subsequent draws above this image need to be drawn
return retList;
}
void DDraw1DrawList::DisplayScene()
{
// Step to the next back buffer, looping around if necessary
m_CurBackBufferIndex++;
m_CurBackBufferIndex %= m_BackBufferList.size();
// Clear the list of rectangles to which images were drawn
m_DirtyRects.clear();
// Reset the drawn image index
m_DrawIndex = 0;
} | 26.958904 | 133 | 0.740346 | TaylorClark |
1f5c713e1791b673ed007f8bac5fb3134b7643f3 | 2,027 | cpp | C++ | binary.tree.cpp | lucasfrct/intro-C-PlusPlus | 4f0ca777c655c00ce8c4e2e3e1ddab7dc6fd2b57 | [
"MIT"
] | null | null | null | binary.tree.cpp | lucasfrct/intro-C-PlusPlus | 4f0ca777c655c00ce8c4e2e3e1ddab7dc6fd2b57 | [
"MIT"
] | null | null | null | binary.tree.cpp | lucasfrct/intro-C-PlusPlus | 4f0ca777c655c00ce8c4e2e3e1ddab7dc6fd2b57 | [
"MIT"
] | null | null | null | #include <iostream>
using namespace std;
class Node
{
private:
Node *left, *right;
int key;
public:
Node(int key)
{
this->key = key;
this->left = NULL;
this->right = NULL;
}
int getKey()
{
return this->key;
}
Node* getLeft()
{
return this->left;
}
Node* getRight()
{
return this->right;
}
void setLeft(Node* node)
{
this->left = node;
}
void setRight(Node* node)
{
this->right = node;
}
};
class Tree
{
private:
Node* root;
public:
Tree()
{
this->root = NULL;
}
void insert(int key)
{
if(this->root == NULL) {
this->root = new Node(key);
} else {
this->insertAux(this->root, key);
}
}
void insertAux(Node* node, int key)
{
if(key < node->getKey()) {
if(node->getLeft() == NULL) {
Node* n = new Node(key);
node->setLeft(n);
} else {
this->insertAux(node->getLeft(), key);
}
} else if(key > node->getKey()) {
if(node->getRight() == NULL) {
Node* n = new Node(key);
node->setRight(n);
} else {
this->insertAux(node->getRight(), key);
}
}
}
Node* getRoot()
{
return this->root;
}
void ordered(Node* node)
{
if(node != NULL) {
this->ordered(node->getLeft());
cout << node->getKey() << " ";
this->ordered(node->getRight());
}
}
};
int main(int argc, char const *argv[])
{
Tree tree;
tree.insert(8);
tree.insert(10);
tree.insert(14);
tree.insert(13);
tree.insert(3);
tree.insert(1);
tree.insert(6);
tree.insert(4);
tree.insert(7);
tree.ordered(tree.getRoot());
cout << endl;
cout << endl;
system("pause");
return 0;
} | 16.216 | 55 | 0.443019 | lucasfrct |
1f5cd7d826074a1caeb9fd00d225e1f0eaabad62 | 1,094 | cpp | C++ | Netcode/Graphics/DX12/DX12Texture.cpp | tyekx/netcode | c46fef1eeb33ad029d0c262d39309dfa83f76c4d | [
"MIT"
] | null | null | null | Netcode/Graphics/DX12/DX12Texture.cpp | tyekx/netcode | c46fef1eeb33ad029d0c262d39309dfa83f76c4d | [
"MIT"
] | null | null | null | Netcode/Graphics/DX12/DX12Texture.cpp | tyekx/netcode | c46fef1eeb33ad029d0c262d39309dfa83f76c4d | [
"MIT"
] | null | null | null | #include "DX12Texture.h"
#include <Netcode/Graphics/ResourceEnums.h>
namespace Netcode::Graphics::DX12 {
TextureImpl::TextureImpl(DirectX::ScratchImage && tData) : textureData{ std::move(tData) } { }
ResourceDimension TextureImpl::GetDimension() const {
switch(textureData.GetMetadata().dimension) {
case DirectX::TEX_DIMENSION_TEXTURE1D:
return ResourceDimension::TEXTURE1D;
case DirectX::TEX_DIMENSION_TEXTURE2D:
return ResourceDimension::TEXTURE2D;
case DirectX::TEX_DIMENSION_TEXTURE3D:
return ResourceDimension::TEXTURE3D;
default:
return ResourceDimension::UNKNOWN;
}
}
uint16_t TextureImpl::GetMipLevelCount() const {
return static_cast<uint16_t>(textureData.GetMetadata().mipLevels);
}
const Image * TextureImpl::GetImage(uint16_t mipIndex, uint16_t arrayIndex, uint32_t slice) {
return textureData.GetImage(mipIndex, arrayIndex, slice);
}
const Image * TextureImpl::GetImages() {
return textureData.GetImages();
}
uint16_t TextureImpl::GetImageCount() {
return static_cast<uint16_t>(textureData.GetMetadata().arraySize);
}
}
| 28.051282 | 95 | 0.761426 | tyekx |
1f6095e0501b3180f137aed60a32735022874f28 | 121,952 | cc | C++ | Translator_file/examples/step-32/step-32.cc | jiaqiwang969/deal.ii-course-practice | 0da5ad1537d8152549d8a0e4de5872efe7619c8a | [
"MIT"
] | null | null | null | Translator_file/examples/step-32/step-32.cc | jiaqiwang969/deal.ii-course-practice | 0da5ad1537d8152549d8a0e4de5872efe7619c8a | [
"MIT"
] | null | null | null | Translator_file/examples/step-32/step-32.cc | jiaqiwang969/deal.ii-course-practice | 0da5ad1537d8152549d8a0e4de5872efe7619c8a | [
"MIT"
] | null | null | null |
/* ---------------------------------------------------------------------
*
* Copyright (C) 2008 - 2021 by the deal.II authors
*
* This file is part of the deal.II library.
*
* The deal.II library is free software; you can use it, redistribute
* it, and/or modify it under the terms of the GNU Lesser General
* Public License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
* The full text of the license can be found in the file LICENSE.md at
* the top level directory of deal.II.
*
* ---------------------------------------------------------------------
*
* Authors: Martin Kronbichler, Uppsala University,
* Wolfgang Bangerth, Texas A&M University,
* Timo Heister, University of Goettingen, 2008-2011
*/
// @sect3{Include files}
// 像往常一样,第一个任务是包括这些著名的deal.II库文件和一些C++头文件的功能。
#include <deal.II/base/quadrature_lib.h>
#include <deal.II/base/logstream.h>
#include <deal.II/base/function.h>
#include <deal.II/base/utilities.h>
#include <deal.II/base/conditional_ostream.h>
#include <deal.II/base/work_stream.h>
#include <deal.II/base/timer.h>
#include <deal.II/base/parameter_handler.h>
#include <deal.II/lac/full_matrix.h>
#include <deal.II/lac/solver_bicgstab.h>
#include <deal.II/lac/solver_cg.h>
#include <deal.II/lac/solver_gmres.h>
#include <deal.II/lac/affine_constraints.h>
#include <deal.II/lac/block_sparsity_pattern.h>
#include <deal.II/lac/trilinos_parallel_block_vector.h>
#include <deal.II/lac/trilinos_sparse_matrix.h>
#include <deal.II/lac/trilinos_block_sparse_matrix.h>
#include <deal.II/lac/trilinos_precondition.h>
#include <deal.II/lac/trilinos_solver.h>
#include <deal.II/grid/tria.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/filtered_iterator.h>
#include <deal.II/grid/manifold_lib.h>
#include <deal.II/grid/grid_tools.h>
#include <deal.II/grid/grid_refinement.h>
#include <deal.II/dofs/dof_handler.h>
#include <deal.II/dofs/dof_renumbering.h>
#include <deal.II/dofs/dof_tools.h>
#include <deal.II/fe/fe_q.h>
#include <deal.II/fe/fe_dgq.h>
#include <deal.II/fe/fe_dgp.h>
#include <deal.II/fe/fe_system.h>
#include <deal.II/fe/fe_values.h>
#include <deal.II/fe/mapping_q.h>
#include <deal.II/numerics/vector_tools.h>
#include <deal.II/numerics/matrix_tools.h>
#include <deal.II/numerics/data_out.h>
#include <deal.II/numerics/error_estimator.h>
#include <deal.II/numerics/solution_transfer.h>
#include <fstream>
#include <iostream>
#include <limits>
#include <locale>
#include <string>
// 这是唯一一个新的包含文件:它引入了相当于 parallel::distributed::SolutionTransfer 的 dealii::SolutionTransfer 类,用于在网格细化时将解决方案从一个网格带到下一个网格,但在并行分布式三角形计算的情况下。
#include <deal.II/distributed/solution_transfer.h>
// 以下是用于并行分布式计算的类,在 step-40 中已经全部介绍过。
#include <deal.II/base/index_set.h>
#include <deal.II/distributed/tria.h>
#include <deal.II/distributed/grid_refinement.h>
// 接下来的步骤与之前所有的教程程序一样。我们把所有东西放到一个自己的命名空间中,然后把deal.II的类和函数导入其中。
namespace Step32
{
using namespace dealii;
// @sect3{Equation data}
// 在以下命名空间中,我们定义了描述问题的各种方程数据。这对应于使问题至少有一点现实性的各个方面,并且在介绍中对测试案例的描述中已经详尽地讨论了这些方面。
// 我们从一些具有常数的系数开始(数值后面的注释表示其物理单位)。
namespace EquationData
{
constexpr double eta = 1e21; /* Pa s */
constexpr double kappa = 1e-6; /* m^2 / s */
constexpr double reference_density = 3300; /* kg / m^3 */
constexpr double reference_temperature = 293; /* K */
constexpr double expansion_coefficient = 2e-5; /* 1/K */
constexpr double specific_heat = 1250; /* J / K / kg */
constexpr double radiogenic_heating = 7.4e-12; /* W / kg */
constexpr double R0 = 6371000. - 2890000.; /* m */
constexpr double R1 = 6371000. - 35000.; /* m */
constexpr double T0 = 4000 + 273; /* K */
constexpr double T1 = 700 + 273; /* K */
// 下一组定义是用于编码密度与温度的函数、重力矢量和温度的初始值的函数。同样,所有这些(以及它们所计算的值)都在介绍中讨论过。
double density(const double temperature)
{
return (
reference_density *
(1 - expansion_coefficient * (temperature - reference_temperature)));
}
template <int dim>
Tensor<1, dim> gravity_vector(const Point<dim> &p)
{
const double r = p.norm();
return -(1.245e-6 * r + 7.714e13 / r / r) * p / r;
}
template <int dim>
class TemperatureInitialValues : public Function<dim>
{
public:
TemperatureInitialValues()
: Function<dim>(1)
{}
virtual double value(const Point<dim> & p,
const unsigned int component = 0) const override;
virtual void vector_value(const Point<dim> &p,
Vector<double> & value) const override;
};
template <int dim>
double TemperatureInitialValues<dim>::value(const Point<dim> &p,
const unsigned int) const
{
const double r = p.norm();
const double h = R1 - R0;
const double s = (r - R0) / h;
const double q =
(dim == 3) ? std::max(0.0, cos(numbers::PI * abs(p(2) / R1))) : 1.0;
const double phi = std::atan2(p(0), p(1));
const double tau = s + 0.2 * s * (1 - s) * std::sin(6 * phi) * q;
return T0 * (1.0 - tau) + T1 * tau;
}
template <int dim>
void
TemperatureInitialValues<dim>::vector_value(const Point<dim> &p,
Vector<double> & values) const
{
for (unsigned int c = 0; c < this->n_components; ++c)
values(c) = TemperatureInitialValues<dim>::value(p, c);
}
// 正如介绍中所提到的,我们需要重新调整压力的比例,以避免动量和质量守恒方程的相对条件不良。比例系数为 $\frac{\eta}{L}$ ,其中 $L$ 是一个典型的长度尺度。通过实验发现,一个好的长度尺度是烟羽的直径,大约是10公里。
constexpr double pressure_scaling = eta / 10000;
// 这个命名空间的最后一个数字是一个常数,表示每(平均,热带)年的秒数。我们只在生成屏幕输出时使用它:在内部,这个程序的所有计算都是以SI单位(公斤、米、秒)进行的,但是用秒来写地质学时间产生的数字无法与现实联系起来,所以我们用这里定义的系数转换为年。
const double year_in_seconds = 60 * 60 * 24 * 365.2425;
} // namespace EquationData
// @sect3{Preconditioning the Stokes system}
// 这个命名空间实现了预处理程序。正如介绍中所讨论的,这个预处理程序在一些关键部分与 step-31 中使用的预处理程序不同。具体来说,它是一个右预处理程序,实现了矩阵
// @f{align*}
// \left(\begin{array}{cc}A^{-1} & B^T
// \\0 & S^{-1}
// \end{array}\right)
// @f}
// 中的两个逆矩阵操作由线性求解器近似,或者,如果给这个类的构造函数加上右标志,则由速度块的单个AMG V-循环实现。 <code>vmult</code> 函数的三个代码块实现了与该预处理矩阵的三个块的乘法运算,如果你读过 step-31 或 step-20 中关于组成求解器的讨论,应该是不言自明的。
namespace LinearSolvers
{
template <class PreconditionerTypeA, class PreconditionerTypeMp>
class BlockSchurPreconditioner : public Subscriptor
{
public:
BlockSchurPreconditioner(const TrilinosWrappers::BlockSparseMatrix &S,
const TrilinosWrappers::BlockSparseMatrix &Spre,
const PreconditionerTypeMp &Mppreconditioner,
const PreconditionerTypeA & Apreconditioner,
const bool do_solve_A)
: stokes_matrix(&S)
, stokes_preconditioner_matrix(&Spre)
, mp_preconditioner(Mppreconditioner)
, a_preconditioner(Apreconditioner)
, do_solve_A(do_solve_A)
{}
void vmult(TrilinosWrappers::MPI::BlockVector & dst,
const TrilinosWrappers::MPI::BlockVector &src) const
{
TrilinosWrappers::MPI::Vector utmp(src.block(0));
{
SolverControl solver_control(5000, 1e-6 * src.block(1).l2_norm());
SolverCG<TrilinosWrappers::MPI::Vector> solver(solver_control);
solver.solve(stokes_preconditioner_matrix->block(1, 1),
dst.block(1),
src.block(1),
mp_preconditioner);
dst.block(1) *= -1.0;
}
{
stokes_matrix->block(0, 1).vmult(utmp, dst.block(1));
utmp *= -1.0;
utmp.add(src.block(0));
}
if (do_solve_A == true)
{
SolverControl solver_control(5000, utmp.l2_norm() * 1e-2);
TrilinosWrappers::SolverCG solver(solver_control);
solver.solve(stokes_matrix->block(0, 0),
dst.block(0),
utmp,
a_preconditioner);
}
else
a_preconditioner.vmult(dst.block(0), utmp);
}
private:
const SmartPointer<const TrilinosWrappers::BlockSparseMatrix>
stokes_matrix;
const SmartPointer<const TrilinosWrappers::BlockSparseMatrix>
stokes_preconditioner_matrix;
const PreconditionerTypeMp &mp_preconditioner;
const PreconditionerTypeA & a_preconditioner;
const bool do_solve_A;
};
} // namespace LinearSolvers
// @sect3{Definition of assembly data structures}
// 如介绍中所述,我们将使用 @ref threads 模块中讨论的WorkStream机制来实现单台机器的处理器之间的并行操作。WorkStream类要求数据在两种数据结构中传递,一种是用于抓取数据,一种是将数据从装配函数传递到将本地贡献复制到全局对象的函数。
// 下面的命名空间(以及两个子命名空间)包含了服务于这一目的的数据结构的集合,介绍中讨论的四种操作中的每一种都有一对,我们将想把它们并行化。每个装配例程都会得到两组数据:一个是Scratch数组,收集所有用于计算单元格贡献的类和数组,另一个是CopyData数组,保存将被写入全局矩阵的本地矩阵和向量。而CopyData是一个容器,用来存放最终写入全局矩阵和向量的数据(因此是绝对必要的),Scratch数组只是出于性能的考虑而存在;在每个单元上设置一个FEValues对象,要比只创建一次并更新一些导数数据要昂贵得多。
// Step-31 有四个汇编程序。一个用于斯托克斯系统的预处理矩阵,一个用于斯托克斯矩阵和右手边,一个用于温度矩阵,一个用于温度方程的右手边。我们在这里使用 <code>struct</code> 环境为这四个汇编组件中的每一个组织从头数组和CopyData对象(因为我们认为这些是我们传递的临时对象,而不是实现自己功能的类,尽管这是区分 <code>struct</code>s and <code>class</code> es的一个比较主观的观点)。
// 关于Scratch对象,每个结构都配备了一个构造函数,可以使用 @ref FiniteElement 、正交、 @ref Mapping (描述弯曲边界的插值)和 @ref UpdateFlags 实例创建一个 @ref FEValues 对象。此外,我们手动实现了一个复制构造函数(因为FEValues类本身是不可复制的),并提供了一些额外的矢量字段,用于在计算局部贡献时保存中间数据。
// 让我们从抓取数组开始,特别是用于组装斯托克斯预处理程序的数组。
namespace Assembly
{
namespace Scratch
{
template <int dim>
struct StokesPreconditioner
{
StokesPreconditioner(const FiniteElement<dim> &stokes_fe,
const Quadrature<dim> & stokes_quadrature,
const Mapping<dim> & mapping,
const UpdateFlags update_flags);
StokesPreconditioner(const StokesPreconditioner &data);
FEValues<dim> stokes_fe_values;
std::vector<Tensor<2, dim>> grad_phi_u;
std::vector<double> phi_p;
};
template <int dim>
StokesPreconditioner<dim>::StokesPreconditioner(
const FiniteElement<dim> &stokes_fe,
const Quadrature<dim> & stokes_quadrature,
const Mapping<dim> & mapping,
const UpdateFlags update_flags)
: stokes_fe_values(mapping, stokes_fe, stokes_quadrature, update_flags)
, grad_phi_u(stokes_fe.n_dofs_per_cell())
, phi_p(stokes_fe.n_dofs_per_cell())
{}
template <int dim>
StokesPreconditioner<dim>::StokesPreconditioner(
const StokesPreconditioner &scratch)
: stokes_fe_values(scratch.stokes_fe_values.get_mapping(),
scratch.stokes_fe_values.get_fe(),
scratch.stokes_fe_values.get_quadrature(),
scratch.stokes_fe_values.get_update_flags())
, grad_phi_u(scratch.grad_phi_u)
, phi_p(scratch.phi_p)
{}
// 下一个是用于组装完整的斯托克斯系统的从头对象。请注意,我们从上面的StokesPreconditioner类派生出StokesSystem scratch类。我们这样做是因为所有用于组装预处理程序的对象也需要用于实际的矩阵系统和右手边,还有一些额外的数据。这使得程序更加紧凑。还需要注意的是,斯托克斯系统的装配和进一步的温度右手边分别需要温度和速度的数据,所以我们实际上需要两个FEValues对象来处理这两种情况。
template <int dim>
struct StokesSystem : public StokesPreconditioner<dim>
{
StokesSystem(const FiniteElement<dim> &stokes_fe,
const Mapping<dim> & mapping,
const Quadrature<dim> & stokes_quadrature,
const UpdateFlags stokes_update_flags,
const FiniteElement<dim> &temperature_fe,
const UpdateFlags temperature_update_flags);
StokesSystem(const StokesSystem<dim> &data);
FEValues<dim> temperature_fe_values;
std::vector<Tensor<1, dim>> phi_u;
std::vector<SymmetricTensor<2, dim>> grads_phi_u;
std::vector<double> div_phi_u;
std::vector<double> old_temperature_values;
};
template <int dim>
StokesSystem<dim>::StokesSystem(
const FiniteElement<dim> &stokes_fe,
const Mapping<dim> & mapping,
const Quadrature<dim> & stokes_quadrature,
const UpdateFlags stokes_update_flags,
const FiniteElement<dim> &temperature_fe,
const UpdateFlags temperature_update_flags)
: StokesPreconditioner<dim>(stokes_fe,
stokes_quadrature,
mapping,
stokes_update_flags)
, temperature_fe_values(mapping,
temperature_fe,
stokes_quadrature,
temperature_update_flags)
, phi_u(stokes_fe.n_dofs_per_cell())
, grads_phi_u(stokes_fe.n_dofs_per_cell())
, div_phi_u(stokes_fe.n_dofs_per_cell())
, old_temperature_values(stokes_quadrature.size())
{}
template <int dim>
StokesSystem<dim>::StokesSystem(const StokesSystem<dim> &scratch)
: StokesPreconditioner<dim>(scratch)
, temperature_fe_values(
scratch.temperature_fe_values.get_mapping(),
scratch.temperature_fe_values.get_fe(),
scratch.temperature_fe_values.get_quadrature(),
scratch.temperature_fe_values.get_update_flags())
, phi_u(scratch.phi_u)
, grads_phi_u(scratch.grads_phi_u)
, div_phi_u(scratch.div_phi_u)
, old_temperature_values(scratch.old_temperature_values)
{}
// 在定义了用于组装斯托克斯系统的对象之后,我们对温度系统所需的矩阵的组装也做了同样的工作。一般的结构是非常相似的。
template <int dim>
struct TemperatureMatrix
{
TemperatureMatrix(const FiniteElement<dim> &temperature_fe,
const Mapping<dim> & mapping,
const Quadrature<dim> & temperature_quadrature);
TemperatureMatrix(const TemperatureMatrix &data);
FEValues<dim> temperature_fe_values;
std::vector<double> phi_T;
std::vector<Tensor<1, dim>> grad_phi_T;
};
template <int dim>
TemperatureMatrix<dim>::TemperatureMatrix(
const FiniteElement<dim> &temperature_fe,
const Mapping<dim> & mapping,
const Quadrature<dim> & temperature_quadrature)
: temperature_fe_values(mapping,
temperature_fe,
temperature_quadrature,
update_values | update_gradients |
update_JxW_values)
, phi_T(temperature_fe.n_dofs_per_cell())
, grad_phi_T(temperature_fe.n_dofs_per_cell())
{}
template <int dim>
TemperatureMatrix<dim>::TemperatureMatrix(
const TemperatureMatrix &scratch)
: temperature_fe_values(
scratch.temperature_fe_values.get_mapping(),
scratch.temperature_fe_values.get_fe(),
scratch.temperature_fe_values.get_quadrature(),
scratch.temperature_fe_values.get_update_flags())
, phi_T(scratch.phi_T)
, grad_phi_T(scratch.grad_phi_T)
{}
// 最后的划痕对象被用于温度系统右侧的装配。这个对象比上面的对象要大得多,因为有更多的量进入温度方程右边的计算中。特别是,前两个时间步骤的温度值和梯度需要在正交点评估,还有速度和应变率(即速度的对称梯度),它们作为摩擦加热项进入右侧。尽管有很多条款,但以下内容应该是不言自明的。
template <int dim>
struct TemperatureRHS
{
TemperatureRHS(const FiniteElement<dim> &temperature_fe,
const FiniteElement<dim> &stokes_fe,
const Mapping<dim> & mapping,
const Quadrature<dim> & quadrature);
TemperatureRHS(const TemperatureRHS &data);
FEValues<dim> temperature_fe_values;
FEValues<dim> stokes_fe_values;
std::vector<double> phi_T;
std::vector<Tensor<1, dim>> grad_phi_T;
std::vector<Tensor<1, dim>> old_velocity_values;
std::vector<Tensor<1, dim>> old_old_velocity_values;
std::vector<SymmetricTensor<2, dim>> old_strain_rates;
std::vector<SymmetricTensor<2, dim>> old_old_strain_rates;
std::vector<double> old_temperature_values;
std::vector<double> old_old_temperature_values;
std::vector<Tensor<1, dim>> old_temperature_grads;
std::vector<Tensor<1, dim>> old_old_temperature_grads;
std::vector<double> old_temperature_laplacians;
std::vector<double> old_old_temperature_laplacians;
};
template <int dim>
TemperatureRHS<dim>::TemperatureRHS(
const FiniteElement<dim> &temperature_fe,
const FiniteElement<dim> &stokes_fe,
const Mapping<dim> & mapping,
const Quadrature<dim> & quadrature)
: temperature_fe_values(mapping,
temperature_fe,
quadrature,
update_values | update_gradients |
update_hessians | update_quadrature_points |
update_JxW_values)
, stokes_fe_values(mapping,
stokes_fe,
quadrature,
update_values | update_gradients)
, phi_T(temperature_fe.n_dofs_per_cell())
, grad_phi_T(temperature_fe.n_dofs_per_cell())
,
old_velocity_values(quadrature.size())
, old_old_velocity_values(quadrature.size())
, old_strain_rates(quadrature.size())
, old_old_strain_rates(quadrature.size())
,
old_temperature_values(quadrature.size())
, old_old_temperature_values(quadrature.size())
, old_temperature_grads(quadrature.size())
, old_old_temperature_grads(quadrature.size())
, old_temperature_laplacians(quadrature.size())
, old_old_temperature_laplacians(quadrature.size())
{}
template <int dim>
TemperatureRHS<dim>::TemperatureRHS(const TemperatureRHS &scratch)
: temperature_fe_values(
scratch.temperature_fe_values.get_mapping(),
scratch.temperature_fe_values.get_fe(),
scratch.temperature_fe_values.get_quadrature(),
scratch.temperature_fe_values.get_update_flags())
, stokes_fe_values(scratch.stokes_fe_values.get_mapping(),
scratch.stokes_fe_values.get_fe(),
scratch.stokes_fe_values.get_quadrature(),
scratch.stokes_fe_values.get_update_flags())
, phi_T(scratch.phi_T)
, grad_phi_T(scratch.grad_phi_T)
,
old_velocity_values(scratch.old_velocity_values)
, old_old_velocity_values(scratch.old_old_velocity_values)
, old_strain_rates(scratch.old_strain_rates)
, old_old_strain_rates(scratch.old_old_strain_rates)
,
old_temperature_values(scratch.old_temperature_values)
, old_old_temperature_values(scratch.old_old_temperature_values)
, old_temperature_grads(scratch.old_temperature_grads)
, old_old_temperature_grads(scratch.old_old_temperature_grads)
, old_temperature_laplacians(scratch.old_temperature_laplacians)
, old_old_temperature_laplacians(scratch.old_old_temperature_laplacians)
{}
} // namespace Scratch
// CopyData对象比Scratch对象更简单,因为它们所要做的就是存储本地计算的结果,直到它们可以被复制到全局矩阵或向量对象中。因此,这些结构只需要提供一个构造函数,一个复制操作,以及一些用于本地矩阵、本地向量和本地与全局自由度之间关系的数组(又称 <code>local_dof_indices</code> )。同样,我们为我们将使用WorkStream类并行化的四个操作中的每一个都有一个这样的结构。
namespace CopyData
{
template <int dim>
struct StokesPreconditioner
{
StokesPreconditioner(const FiniteElement<dim> &stokes_fe);
StokesPreconditioner(const StokesPreconditioner &data);
StokesPreconditioner &operator=(const StokesPreconditioner &) = default;
FullMatrix<double> local_matrix;
std::vector<types::global_dof_index> local_dof_indices;
};
template <int dim>
StokesPreconditioner<dim>::StokesPreconditioner(
const FiniteElement<dim> &stokes_fe)
: local_matrix(stokes_fe.n_dofs_per_cell(), stokes_fe.n_dofs_per_cell())
, local_dof_indices(stokes_fe.n_dofs_per_cell())
{}
template <int dim>
StokesPreconditioner<dim>::StokesPreconditioner(
const StokesPreconditioner &data)
: local_matrix(data.local_matrix)
, local_dof_indices(data.local_dof_indices)
{}
template <int dim>
struct StokesSystem : public StokesPreconditioner<dim>
{
StokesSystem(const FiniteElement<dim> &stokes_fe);
Vector<double> local_rhs;
};
template <int dim>
StokesSystem<dim>::StokesSystem(const FiniteElement<dim> &stokes_fe)
: StokesPreconditioner<dim>(stokes_fe)
, local_rhs(stokes_fe.n_dofs_per_cell())
{}
template <int dim>
struct TemperatureMatrix
{
TemperatureMatrix(const FiniteElement<dim> &temperature_fe);
FullMatrix<double> local_mass_matrix;
FullMatrix<double> local_stiffness_matrix;
std::vector<types::global_dof_index> local_dof_indices;
};
template <int dim>
TemperatureMatrix<dim>::TemperatureMatrix(
const FiniteElement<dim> &temperature_fe)
: local_mass_matrix(temperature_fe.n_dofs_per_cell(),
temperature_fe.n_dofs_per_cell())
, local_stiffness_matrix(temperature_fe.n_dofs_per_cell(),
temperature_fe.n_dofs_per_cell())
, local_dof_indices(temperature_fe.n_dofs_per_cell())
{}
template <int dim>
struct TemperatureRHS
{
TemperatureRHS(const FiniteElement<dim> &temperature_fe);
Vector<double> local_rhs;
std::vector<types::global_dof_index> local_dof_indices;
FullMatrix<double> matrix_for_bc;
};
template <int dim>
TemperatureRHS<dim>::TemperatureRHS(
const FiniteElement<dim> &temperature_fe)
: local_rhs(temperature_fe.n_dofs_per_cell())
, local_dof_indices(temperature_fe.n_dofs_per_cell())
, matrix_for_bc(temperature_fe.n_dofs_per_cell(),
temperature_fe.n_dofs_per_cell())
{}
} // namespace CopyData
} // namespace Assembly
// @sect3{The <code>BoussinesqFlowProblem</code> class template}
// 这是主类的声明。它与 step-31 非常相似,但有一些区别我们将在下面评论。
// 该类的顶部与 step-31 中的内容基本相同,列出了公共方法和一组做重活的私有函数。与 step-31 相比,这部分只增加了两个:计算所有单元的最大CFL数的函数 <code>get_cfl_number()</code> ,然后我们根据它计算全局时间步长;以及用于计算熵值稳定的函数 <code>get_entropy_variation()</code> 。它类似于我们在 step-31 中用于此目的的 <code>get_extrapolated_temperature_range()</code> ,但它的工作对象是熵而不是温度。
template <int dim>
class BoussinesqFlowProblem
{
public:
struct Parameters;
BoussinesqFlowProblem(Parameters ¶meters);
void run();
private:
void setup_dofs();
void assemble_stokes_preconditioner();
void build_stokes_preconditioner();
void assemble_stokes_system();
void assemble_temperature_matrix();
void assemble_temperature_system(const double maximal_velocity);
double get_maximal_velocity() const;
double get_cfl_number() const;
double get_entropy_variation(const double average_temperature) const;
std::pair<double, double> get_extrapolated_temperature_range() const;
void solve();
void output_results();
void refine_mesh(const unsigned int max_grid_level);
double compute_viscosity(
const std::vector<double> & old_temperature,
const std::vector<double> & old_old_temperature,
const std::vector<Tensor<1, dim>> &old_temperature_grads,
const std::vector<Tensor<1, dim>> &old_old_temperature_grads,
const std::vector<double> & old_temperature_laplacians,
const std::vector<double> & old_old_temperature_laplacians,
const std::vector<Tensor<1, dim>> &old_velocity_values,
const std::vector<Tensor<1, dim>> &old_old_velocity_values,
const std::vector<SymmetricTensor<2, dim>> &old_strain_rates,
const std::vector<SymmetricTensor<2, dim>> &old_old_strain_rates,
const double global_u_infty,
const double global_T_variation,
const double average_temperature,
const double global_entropy_variation,
const double cell_diameter) const;
public:
// 第一个重要的新组件是根据介绍中的讨论为参数定义了一个结构。这个结构是在构建这个对象的过程中通过读取参数文件来初始化的。
struct Parameters
{
Parameters(const std::string ¶meter_filename);
static void declare_parameters(ParameterHandler &prm);
void parse_parameters(ParameterHandler &prm);
double end_time;
unsigned int initial_global_refinement;
unsigned int initial_adaptive_refinement;
bool generate_graphical_output;
unsigned int graphical_output_interval;
unsigned int adaptive_refinement_interval;
double stabilization_alpha;
double stabilization_c_R;
double stabilization_beta;
unsigned int stokes_velocity_degree;
bool use_locally_conservative_discretization;
unsigned int temperature_degree;
};
private:
Parameters ¶meters;
// <code>pcout</code> (用于<i>%parallel <code>std::cout</code></i>)对象被用来简化输出的书写:每个MPI进程都可以像往常一样使用它来产生输出,但由于这些进程中的每一个都会(希望)产生相同的输出,它只是被重复了许多次;使用ConditionalOStream类,只有一个MPI进程产生的输出会真正被打印到屏幕上,而所有其他线程的输出将只是被遗忘。
ConditionalOStream pcout;
// 下面的成员变量将再次与 step-31 中的成员变量相似(也与其他教程程序相似)。正如介绍中提到的,我们完全分布计算,所以我们将不得不使用 parallel::distributed::Triangulation 类(见 step-40 ),但这些变量的其余部分相当标准,有两个例外。
// -- <code>mapping</code> 这个变量是用来表示高阶多项式映射的。正如在介绍中提到的,我们在通过正交形成积分时使用这个映射,用于所有与我们域的内边界或外边界相邻的单元,其中边界是弯曲的。
// - 在命名混乱的情况下,你会注意到下面一些来自命名空间TrilinosWrappers的变量取自命名空间 TrilinosWrappers::MPI (比如右手边的向量),而其他变量则不是(比如各种矩阵)。这是由于遗留的原因。我们经常需要查询任意正交点的速度和温度;因此,每当我们需要访问与本地相关但属于另一个处理器的自由度时,我们不是导入矢量的幽灵信息,而是以%并行方式求解线性系统,但随后立即初始化一个矢量,包括求解的幽灵条目,以便进一步处理。因此,各种 <code>*_solution</code> 向量在以%parallel求解各自的线性系统后立即被填充,并且总是包含所有 @ref GlossLocallyRelevantDof "本地相关自由度 "的值;我们从求解过程中获得的完全分布的向量,只包含 @ref GlossLocallyOwnedDof "本地拥有的自由度",在求解过程后,在我们将相关值复制到成员变量向量后立即销毁。
parallel::distributed::Triangulation<dim> triangulation;
double global_Omega_diameter;
const MappingQ<dim> mapping;
const FESystem<dim> stokes_fe;
DoFHandler<dim> stokes_dof_handler;
AffineConstraints<double> stokes_constraints;
TrilinosWrappers::BlockSparseMatrix stokes_matrix;
TrilinosWrappers::BlockSparseMatrix stokes_preconditioner_matrix;
TrilinosWrappers::MPI::BlockVector stokes_solution;
TrilinosWrappers::MPI::BlockVector old_stokes_solution;
TrilinosWrappers::MPI::BlockVector stokes_rhs;
FE_Q<dim> temperature_fe;
DoFHandler<dim> temperature_dof_handler;
AffineConstraints<double> temperature_constraints;
TrilinosWrappers::SparseMatrix temperature_mass_matrix;
TrilinosWrappers::SparseMatrix temperature_stiffness_matrix;
TrilinosWrappers::SparseMatrix temperature_matrix;
TrilinosWrappers::MPI::Vector temperature_solution;
TrilinosWrappers::MPI::Vector old_temperature_solution;
TrilinosWrappers::MPI::Vector old_old_temperature_solution;
TrilinosWrappers::MPI::Vector temperature_rhs;
double time_step;
double old_time_step;
unsigned int timestep_number;
std::shared_ptr<TrilinosWrappers::PreconditionAMG> Amg_preconditioner;
std::shared_ptr<TrilinosWrappers::PreconditionJacobi> Mp_preconditioner;
std::shared_ptr<TrilinosWrappers::PreconditionJacobi> T_preconditioner;
bool rebuild_stokes_matrix;
bool rebuild_stokes_preconditioner;
bool rebuild_temperature_matrices;
bool rebuild_temperature_preconditioner;
// 下一个成员变量, <code>computing_timer</code> 是用来方便地计算在某些重复输入的代码 "部分 "所花费的计算时间。例如,我们将进入(和离开)斯托克斯矩阵装配的部分,并希望在所有的时间步骤中累积在这部分花费的运行时间。每隔一段时间,以及在程序结束时(通过TimerOutput类的析构器),我们将产生一个很好的总结,即在不同部分花费的时间,我们把这个程序的运行时间归类为不同部分。
TimerOutput computing_timer;
// 在这些成员变量之后,我们有一些辅助函数,这些函数已经从上面列出的那些函数中分解出来。具体来说,首先有三个我们从 <code>setup_dofs</code> 中调用的函数,然后是做线性系统组装的函数。
void setup_stokes_matrix(
const std::vector<IndexSet> &stokes_partitioning,
const std::vector<IndexSet> &stokes_relevant_partitioning);
void setup_stokes_preconditioner(
const std::vector<IndexSet> &stokes_partitioning,
const std::vector<IndexSet> &stokes_relevant_partitioning);
void setup_temperature_matrices(
const IndexSet &temperature_partitioning,
const IndexSet &temperature_relevant_partitioning);
// 遵循 @ref MTWorkStream "基于任务的并行化 "范式,我们将所有的汇编例程分成两部分:第一部分可以在某个单元上做所有的计算,而不需要照顾其他线程;第二部分(就是将本地数据写入全局矩阵和向量中),每次只能由一个线程进入。为了实现这一点,我们为这一程序中使用的所有四个汇编例程的这两个步骤分别提供了函数。下面的八个函数正是这样做的。
void local_assemble_stokes_preconditioner(
const typename DoFHandler<dim>::active_cell_iterator &cell,
Assembly::Scratch::StokesPreconditioner<dim> & scratch,
Assembly::CopyData::StokesPreconditioner<dim> & data);
void copy_local_to_global_stokes_preconditioner(
const Assembly::CopyData::StokesPreconditioner<dim> &data);
void local_assemble_stokes_system(
const typename DoFHandler<dim>::active_cell_iterator &cell,
Assembly::Scratch::StokesSystem<dim> & scratch,
Assembly::CopyData::StokesSystem<dim> & data);
void copy_local_to_global_stokes_system(
const Assembly::CopyData::StokesSystem<dim> &data);
void local_assemble_temperature_matrix(
const typename DoFHandler<dim>::active_cell_iterator &cell,
Assembly::Scratch::TemperatureMatrix<dim> & scratch,
Assembly::CopyData::TemperatureMatrix<dim> & data);
void copy_local_to_global_temperature_matrix(
const Assembly::CopyData::TemperatureMatrix<dim> &data);
void local_assemble_temperature_rhs(
const std::pair<double, double> global_T_range,
const double global_max_velocity,
const double global_entropy_variation,
const typename DoFHandler<dim>::active_cell_iterator &cell,
Assembly::Scratch::TemperatureRHS<dim> & scratch,
Assembly::CopyData::TemperatureRHS<dim> & data);
void copy_local_to_global_temperature_rhs(
const Assembly::CopyData::TemperatureRHS<dim> &data);
// 最后,我们向前声明一个成员类,我们将在以后定义这个成员类,它将被用来从我们的解决方案向量中计算一些数量,我们希望将这些数量放入输出文件中,以便进行可视化。
class Postprocessor;
};
// @sect3{BoussinesqFlowProblem class implementation}
// @sect4{BoussinesqFlowProblem::Parameters}
// 这里是对斯托克斯问题的参数的定义。我们允许设置模拟的结束时间、细化水平(包括全局细化和自适应细化,总的来说就是允许单元的最大细化水平),以及细化的时间间隔。
// 然后,我们让用户指定稳定参数的常数(如介绍中所讨论的)、斯托克斯速度空间的多项式程度、是否对压力使用基于FE_DGP元素的局部保守离散化(对压力使用FE_Q元素)、以及温度插值的多项式程度。
// 构造函数检查是否有有效的输入文件(如果没有,将写一个带有默认参数的文件),并最终解析参数。
template <int dim>
BoussinesqFlowProblem<dim>::Parameters::Parameters(
const std::string ¶meter_filename)
: end_time(1e8)
, initial_global_refinement(2)
, initial_adaptive_refinement(2)
, adaptive_refinement_interval(10)
, stabilization_alpha(2)
, stabilization_c_R(0.11)
, stabilization_beta(0.078)
, stokes_velocity_degree(2)
, use_locally_conservative_discretization(true)
, temperature_degree(2)
{
ParameterHandler prm;
BoussinesqFlowProblem<dim>::Parameters::declare_parameters(prm);
std::ifstream parameter_file(parameter_filename);
if (!parameter_file)
{
parameter_file.close();
std::ofstream parameter_out(parameter_filename);
prm.print_parameters(parameter_out, ParameterHandler::Text);
AssertThrow(
false,
ExcMessage(
"Input parameter file <" + parameter_filename +
"> not found. Creating a template file of the same name."));
}
prm.parse_input(parameter_file);
parse_parameters(prm);
}
// 接下来我们有一个函数,声明我们在输入文件中期望的参数,以及它们的数据类型、默认值和描述。
template <int dim>
void BoussinesqFlowProblem<dim>::Parameters::declare_parameters(
ParameterHandler &prm)
{
prm.declare_entry("End time",
"1e8",
Patterns::Double(0),
"The end time of the simulation in years.");
prm.declare_entry("Initial global refinement",
"2",
Patterns::Integer(0),
"The number of global refinement steps performed on "
"the initial coarse mesh, before the problem is first "
"solved there.");
prm.declare_entry("Initial adaptive refinement",
"2",
Patterns::Integer(0),
"The number of adaptive refinement steps performed after "
"initial global refinement.");
prm.declare_entry("Time steps between mesh refinement",
"10",
Patterns::Integer(1),
"The number of time steps after which the mesh is to be "
"adapted based on computed error indicators.");
prm.declare_entry("Generate graphical output",
"false",
Patterns::Bool(),
"Whether graphical output is to be generated or not. "
"You may not want to get graphical output if the number "
"of processors is large.");
prm.declare_entry("Time steps between graphical output",
"50",
Patterns::Integer(1),
"The number of time steps between each generation of "
"graphical output files.");
prm.enter_subsection("Stabilization parameters");
{
prm.declare_entry("alpha",
"2",
Patterns::Double(1, 2),
"The exponent in the entropy viscosity stabilization.");
prm.declare_entry("c_R",
"0.11",
Patterns::Double(0),
"The c_R factor in the entropy viscosity "
"stabilization.");
prm.declare_entry("beta",
"0.078",
Patterns::Double(0),
"The beta factor in the artificial viscosity "
"stabilization. An appropriate value for 2d is 0.052 "
"and 0.078 for 3d.");
}
prm.leave_subsection();
prm.enter_subsection("Discretization");
{
prm.declare_entry(
"Stokes velocity polynomial degree",
"2",
Patterns::Integer(1),
"The polynomial degree to use for the velocity variables "
"in the Stokes system.");
prm.declare_entry(
"Temperature polynomial degree",
"2",
Patterns::Integer(1),
"The polynomial degree to use for the temperature variable.");
prm.declare_entry(
"Use locally conservative discretization",
"true",
Patterns::Bool(),
"Whether to use a Stokes discretization that is locally "
"conservative at the expense of a larger number of degrees "
"of freedom, or to go with a cheaper discretization "
"that does not locally conserve mass (although it is "
"globally conservative.");
}
prm.leave_subsection();
}
// 然后,我们需要一个函数来读取我们通过读取输入文件得到的ParameterHandler对象的内容,并将结果放入储存我们之前声明的参数值的变量。
template <int dim>
void BoussinesqFlowProblem<dim>::Parameters::parse_parameters(
ParameterHandler &prm)
{
end_time = prm.get_double("End time");
initial_global_refinement = prm.get_integer("Initial global refinement");
initial_adaptive_refinement =
prm.get_integer("Initial adaptive refinement");
adaptive_refinement_interval =
prm.get_integer("Time steps between mesh refinement");
generate_graphical_output = prm.get_bool("Generate graphical output");
graphical_output_interval =
prm.get_integer("Time steps between graphical output");
prm.enter_subsection("Stabilization parameters");
{
stabilization_alpha = prm.get_double("alpha");
stabilization_c_R = prm.get_double("c_R");
stabilization_beta = prm.get_double("beta");
}
prm.leave_subsection();
prm.enter_subsection("Discretization");
{
stokes_velocity_degree =
prm.get_integer("Stokes velocity polynomial degree");
temperature_degree = prm.get_integer("Temperature polynomial degree");
use_locally_conservative_discretization =
prm.get_bool("Use locally conservative discretization");
}
prm.leave_subsection();
}
// @sect4{BoussinesqFlowProblem::BoussinesqFlowProblem}
// 该问题的构造函数与 step-31 中的构造函数非常相似。不同的是%并行通信。Trilinos使用消息传递接口(MPI)进行数据分配。当进入BoussinesqFlowProblem类时,我们必须决定如何进行并行化。我们选择一个相当简单的策略,让所有正在运行程序的处理器一起工作,由通信器 <code>MPI_COMM_WORLD</code> 指定。接下来,我们创建输出流(就像我们在 step-18 中已经做的那样),它只在第一个MPI进程上产生输出,而在其他所有进程上则完全不考虑。这个想法的实现是在 <code>pcout</code> 得到一个真实参数时检查进程号,它使用 <code>std::cout</code> 流进行输出。例如,如果我们是一个处理器五,那么我们将给出一个 <code>false</code> argument to <code>pcout</code> ,这意味着该处理器的输出将不会被打印。除了映射对象(我们对其使用4度的多项式),除了最后的成员变量外,其他都与 step-31 中的完全相同。
// 这个最后的对象,TimerOutput对象,然后被告知限制输出到 <code>pcout</code> 流(处理器0),然后我们指定要在程序结束时得到一个汇总表,该表显示我们的壁挂时钟时间(而不是CPU时间)。我们还将在下面的 <code>run()</code> 函数中手动请求每隔这么多时间步的中间总结。
template <int dim>
BoussinesqFlowProblem<dim>::BoussinesqFlowProblem(Parameters ¶meters_)
: parameters(parameters_)
, pcout(std::cout, (Utilities::MPI::this_mpi_process(MPI_COMM_WORLD) == 0))
,
triangulation(MPI_COMM_WORLD,
typename Triangulation<dim>::MeshSmoothing(
Triangulation<dim>::smoothing_on_refinement |
Triangulation<dim>::smoothing_on_coarsening))
,
global_Omega_diameter(0.)
,
mapping(4)
,
stokes_fe(FE_Q<dim>(parameters.stokes_velocity_degree),
dim,
(parameters.use_locally_conservative_discretization ?
static_cast<const FiniteElement<dim> &>(
FE_DGP<dim>(parameters.stokes_velocity_degree - 1)) :
static_cast<const FiniteElement<dim> &>(
FE_Q<dim>(parameters.stokes_velocity_degree - 1))),
1)
,
stokes_dof_handler(triangulation)
,
temperature_fe(parameters.temperature_degree)
, temperature_dof_handler(triangulation)
,
time_step(0)
, old_time_step(0)
, timestep_number(0)
, rebuild_stokes_matrix(true)
, rebuild_stokes_preconditioner(true)
, rebuild_temperature_matrices(true)
, rebuild_temperature_preconditioner(true)
,
computing_timer(MPI_COMM_WORLD,
pcout,
TimerOutput::summary,
TimerOutput::wall_times)
{}
// @sect4{The BoussinesqFlowProblem helper functions}
// @sect5{BoussinesqFlowProblem::get_maximal_velocity}
// 除了两个小细节外,计算速度全局最大值的函数与 step-31 中的相同。第一个细节实际上是所有在三角形的所有单元上实现循环的函数所共有的。当以%并行方式操作时,每个处理器只能处理一大块单元,因为每个处理器只拥有整个三角结构的某一部分。我们要处理的这块单元是通过所谓的 <code>subdomain_id</code> 来确定的,正如我们在 step-18 中做的那样。因此,我们需要改变的是只对当前进程所拥有的单元格(相对于幽灵或人造单元格)进行与单元格相关的操作,即对子域id等于进程ID的数字。由于这是一个常用的操作,所以这个操作有一个快捷方式:我们可以用 <code>cell-@>is_locally_owned()</code> 询问单元格是否为当前处理器所拥有。
// 第二个区别是我们计算最大值的方式。以前,我们可以简单地有一个 <code>double</code> 变量,在每个单元的每个正交点上进行检查。现在,我们必须更加小心,因为每个处理器只对单元格的一个子集进行操作。我们要做的是,首先让每个处理器计算其单元中的最大值,然后做一个全局通信操作 <code>Utilities::MPI::max</code> ,计算各个处理器所有最大值中的最大值。MPI提供了这样的调用,但更简单的是使用MPI通信器对象在命名空间 Utilities::MPI 中使用相应的函数,因为即使我们没有MPI并且只在一台机器上工作,这也会做正确的事情。对 <code>Utilities::MPI::max</code> 的调用需要两个参数,即本地最大值(input)和MPI通信器,在这个例子中是MPI_COMM_WORLD。
template <int dim>
double BoussinesqFlowProblem<dim>::get_maximal_velocity() const
{
const QIterated<dim> quadrature_formula(QTrapezoid<1>(),
parameters.stokes_velocity_degree);
const unsigned int n_q_points = quadrature_formula.size();
FEValues<dim> fe_values(mapping,
stokes_fe,
quadrature_formula,
update_values);
std::vector<Tensor<1, dim>> velocity_values(n_q_points);
const FEValuesExtractors::Vector velocities(0);
double max_local_velocity = 0;
for (const auto &cell : stokes_dof_handler.active_cell_iterators())
if (cell->is_locally_owned())
{
fe_values.reinit(cell);
fe_values[velocities].get_function_values(stokes_solution,
velocity_values);
for (unsigned int q = 0; q < n_q_points; ++q)
max_local_velocity =
std::max(max_local_velocity, velocity_values[q].norm());
}
return Utilities::MPI::max(max_local_velocity, MPI_COMM_WORLD);
}
// @sect5{BoussinesqFlowProblem::get_cfl_number}
// 下一个函数做了类似的事情,但我们现在计算CFL数,即一个单元上的最大速度除以单元直径。这个数字对于确定时间步长是必要的,因为我们对温度方程使用半显式的时间步长方案(讨论见 step-31 )。我们用上述同样的方法计算它。在所有本地拥有的单元上计算本地最大值,然后通过MPI交换,找到全球最大值。
template <int dim>
double BoussinesqFlowProblem<dim>::get_cfl_number() const
{
const QIterated<dim> quadrature_formula(QTrapezoid<1>(),
parameters.stokes_velocity_degree);
const unsigned int n_q_points = quadrature_formula.size();
FEValues<dim> fe_values(mapping,
stokes_fe,
quadrature_formula,
update_values);
std::vector<Tensor<1, dim>> velocity_values(n_q_points);
const FEValuesExtractors::Vector velocities(0);
double max_local_cfl = 0;
for (const auto &cell : stokes_dof_handler.active_cell_iterators())
if (cell->is_locally_owned())
{
fe_values.reinit(cell);
fe_values[velocities].get_function_values(stokes_solution,
velocity_values);
double max_local_velocity = 1e-10;
for (unsigned int q = 0; q < n_q_points; ++q)
max_local_velocity =
std::max(max_local_velocity, velocity_values[q].norm());
max_local_cfl =
std::max(max_local_cfl, max_local_velocity / cell->diameter());
}
return Utilities::MPI::max(max_local_cfl, MPI_COMM_WORLD);
}
// @sect5{BoussinesqFlowProblem::get_entropy_variation}
// 接下来是计算全局熵的变化 $\|E(T)-\bar{E}(T)\|_\infty$ ,其中熵 $E$ 的定义如介绍中所讨论的。 这对于评估温度方程中的稳定度是必要的,正如介绍中所解释的。实际上,只有当我们在残差计算中使用 $\alpha=2$ 作为幂时,才需要熵的变化。无限准则是由正交点上的最大值计算出来的,就像离散计算中通常的那样。
// 为了计算这个量,我们首先要找到空间平均数 $\bar{E}(T)$ ,然后评估最大值。然而,这意味着我们需要执行两个循环。我们可以通过注意到 $\|E(T)-\bar{E}(T)\|_\infty =
// \max\big(E_{\textrm{max}}(T)-\bar{E}(T),
// \bar{E}(T)-E_{\textrm{min}}(T)\big)$ ,即正负方向上与平均熵的偏差的最大值来避免开销。我们在后一个公式中需要的四个量(最大熵、最小熵、平均熵、面积)都可以在所有单元格的同一个循环中进行评估,所以我们选择这个更简单的变体。
template <int dim>
double BoussinesqFlowProblem<dim>::get_entropy_variation(
const double average_temperature) const
{
if (parameters.stabilization_alpha != 2)
return 1.;
const QGauss<dim> quadrature_formula(parameters.temperature_degree + 1);
const unsigned int n_q_points = quadrature_formula.size();
FEValues<dim> fe_values(temperature_fe,
quadrature_formula,
update_values | update_JxW_values);
std::vector<double> old_temperature_values(n_q_points);
std::vector<double> old_old_temperature_values(n_q_points);
// 在上面的两个函数中,我们计算了所有非负数的最大值,所以我们知道0肯定是一个下限。另一方面,在这里我们需要找到与平均值的最大偏差,也就是说,我们需要知道熵的最大和最小值,而这些值的符号我们并不事先知道。
// 为了计算它,我们可以从我们可以存储在一个双精度数字中的最大和最小的可能值开始。最小值被初始化为一个更大的数字,最大值被初始化为一个比将要出现的任何一个数字都小的数字。然后,我们保证这些数字将在第一个单元的循环中被覆盖,或者,如果这个处理器不拥有任何单元,最迟在通信步骤中被覆盖。下面的循环将计算最小和最大的局部熵,并跟踪我们局部拥有的域的面积/体积,以及对其熵的积分。
double min_entropy = std::numeric_limits<double>::max(),
max_entropy = -std::numeric_limits<double>::max(), area = 0,
entropy_integrated = 0;
for (const auto &cell : temperature_dof_handler.active_cell_iterators())
if (cell->is_locally_owned())
{
fe_values.reinit(cell);
fe_values.get_function_values(old_temperature_solution,
old_temperature_values);
fe_values.get_function_values(old_old_temperature_solution,
old_old_temperature_values);
for (unsigned int q = 0; q < n_q_points; ++q)
{
const double T =
(old_temperature_values[q] + old_old_temperature_values[q]) / 2;
const double entropy =
((T - average_temperature) * (T - average_temperature));
min_entropy = std::min(min_entropy, entropy);
max_entropy = std::max(max_entropy, entropy);
area += fe_values.JxW(q);
entropy_integrated += fe_values.JxW(q) * entropy;
}
}
// 现在我们只需要在处理器之间交换数据:我们需要将两个积分相加( <code>area</code>, <code>entropy_integrated</code> ),并得到最大和最小的极值。我们可以通过四个不同的数据交换来完成这个任务,但我们只需要两个就可以了。 Utilities::MPI::sum 也有一个变体,它接受一个数组的值,这些值都是要加起来的。我们还可以利用 Utilities::MPI::max 函数,认识到在最小熵上形成最小值等于在最小熵的负值上形成最大值的负值;然后这个最大值可以与在最大熵上形成最大值结合起来。
const double local_sums[2] = {entropy_integrated, area},
local_maxima[2] = {-min_entropy, max_entropy};
double global_sums[2], global_maxima[2];
Utilities::MPI::sum(local_sums, MPI_COMM_WORLD, global_sums);
Utilities::MPI::max(local_maxima, MPI_COMM_WORLD, global_maxima);
// 以这种方式计算了所有的东西之后,我们就可以计算平均熵,并通过取最大值或最小值与平均值的偏差中的较大值来找到 $L^\infty$ 准则。
const double average_entropy = global_sums[0] / global_sums[1];
const double entropy_diff = std::max(global_maxima[1] - average_entropy,
average_entropy - (-global_maxima[0]));
return entropy_diff;
}
// @sect5{BoussinesqFlowProblem::get_extrapolated_temperature_range}
// 下一个函数是计算整个领域内外推温度的最小值和最大值。同样,这只是 step-31 中相应函数的一个略微修改的版本。和上面的函数一样,我们收集局部最小值和最大值,然后用上面的技巧计算全局极值。
// 正如在 step-31 中已经讨论过的,该函数需要区分第一个时间步长和所有后续时间步长,因为当至少有两个以前的时间步长时,它使用了一个高阶温度外推方案。
template <int dim>
std::pair<double, double>
BoussinesqFlowProblem<dim>::get_extrapolated_temperature_range() const
{
const QIterated<dim> quadrature_formula(QTrapezoid<1>(),
parameters.temperature_degree);
const unsigned int n_q_points = quadrature_formula.size();
FEValues<dim> fe_values(mapping,
temperature_fe,
quadrature_formula,
update_values);
std::vector<double> old_temperature_values(n_q_points);
std::vector<double> old_old_temperature_values(n_q_points);
double min_local_temperature = std::numeric_limits<double>::max(),
max_local_temperature = -std::numeric_limits<double>::max();
if (timestep_number != 0)
{
for (const auto &cell : temperature_dof_handler.active_cell_iterators())
if (cell->is_locally_owned())
{
fe_values.reinit(cell);
fe_values.get_function_values(old_temperature_solution,
old_temperature_values);
fe_values.get_function_values(old_old_temperature_solution,
old_old_temperature_values);
for (unsigned int q = 0; q < n_q_points; ++q)
{
const double temperature =
(1. + time_step / old_time_step) *
old_temperature_values[q] -
time_step / old_time_step * old_old_temperature_values[q];
min_local_temperature =
std::min(min_local_temperature, temperature);
max_local_temperature =
std::max(max_local_temperature, temperature);
}
}
}
else
{
for (const auto &cell : temperature_dof_handler.active_cell_iterators())
if (cell->is_locally_owned())
{
fe_values.reinit(cell);
fe_values.get_function_values(old_temperature_solution,
old_temperature_values);
for (unsigned int q = 0; q < n_q_points; ++q)
{
const double temperature = old_temperature_values[q];
min_local_temperature =
std::min(min_local_temperature, temperature);
max_local_temperature =
std::max(max_local_temperature, temperature);
}
}
}
double local_extrema[2] = {-min_local_temperature, max_local_temperature};
double global_extrema[2];
Utilities::MPI::max(local_extrema, MPI_COMM_WORLD, global_extrema);
return std::make_pair(-global_extrema[0], global_extrema[1]);
}
// @sect5{BoussinesqFlowProblem::compute_viscosity}
// 计算粘度的函数是纯粹的本地函数,所以根本不需要通信。它与 step-31 中的内容基本相同,但如果选择 $\alpha=2$ ,则会有一个最新的粘度表述。
template <int dim>
double BoussinesqFlowProblem<dim>::compute_viscosity(
const std::vector<double> & old_temperature,
const std::vector<double> & old_old_temperature,
const std::vector<Tensor<1, dim>> & old_temperature_grads,
const std::vector<Tensor<1, dim>> & old_old_temperature_grads,
const std::vector<double> & old_temperature_laplacians,
const std::vector<double> & old_old_temperature_laplacians,
const std::vector<Tensor<1, dim>> & old_velocity_values,
const std::vector<Tensor<1, dim>> & old_old_velocity_values,
const std::vector<SymmetricTensor<2, dim>> &old_strain_rates,
const std::vector<SymmetricTensor<2, dim>> &old_old_strain_rates,
const double global_u_infty,
const double global_T_variation,
const double average_temperature,
const double global_entropy_variation,
const double cell_diameter) const
{
if (global_u_infty == 0)
return 5e-3 * cell_diameter;
const unsigned int n_q_points = old_temperature.size();
double max_residual = 0;
double max_velocity = 0;
for (unsigned int q = 0; q < n_q_points; ++q)
{
const Tensor<1, dim> u =
(old_velocity_values[q] + old_old_velocity_values[q]) / 2;
const SymmetricTensor<2, dim> strain_rate =
(old_strain_rates[q] + old_old_strain_rates[q]) / 2;
const double T = (old_temperature[q] + old_old_temperature[q]) / 2;
const double dT_dt =
(old_temperature[q] - old_old_temperature[q]) / old_time_step;
const double u_grad_T =
u * (old_temperature_grads[q] + old_old_temperature_grads[q]) / 2;
const double kappa_Delta_T =
EquationData::kappa *
(old_temperature_laplacians[q] + old_old_temperature_laplacians[q]) /
2;
const double gamma =
((EquationData::radiogenic_heating * EquationData::density(T) +
2 * EquationData::eta * strain_rate * strain_rate) /
(EquationData::density(T) * EquationData::specific_heat));
double residual = std::abs(dT_dt + u_grad_T - kappa_Delta_T - gamma);
if (parameters.stabilization_alpha == 2)
residual *= std::abs(T - average_temperature);
max_residual = std::max(residual, max_residual);
max_velocity = std::max(std::sqrt(u * u), max_velocity);
}
const double max_viscosity =
(parameters.stabilization_beta * max_velocity * cell_diameter);
if (timestep_number == 0)
return max_viscosity;
else
{
Assert(old_time_step > 0, ExcInternalError());
double entropy_viscosity;
if (parameters.stabilization_alpha == 2)
entropy_viscosity =
(parameters.stabilization_c_R * cell_diameter * cell_diameter *
max_residual / global_entropy_variation);
else
entropy_viscosity =
(parameters.stabilization_c_R * cell_diameter *
global_Omega_diameter * max_velocity * max_residual /
(global_u_infty * global_T_variation));
return std::min(max_viscosity, entropy_viscosity);
}
}
// @sect4{The BoussinesqFlowProblem setup functions}
// 以下三个函数设置了斯托克斯矩阵、用于斯托克斯预调节器的矩阵和温度矩阵。这些代码与 step-31 中的代码基本相同,但为了简单起见,将其分成了三个自己的函数。
// 这里的代码与 step-31 中的代码在功能上的主要区别是,我们要建立的矩阵是分布在多个处理器上的。由于我们仍然希望出于效率的原因先建立起稀疏性模式,我们可以继续将<i>entire</i>的稀疏性模式作为BlockDynamicSparsityPattern来建立,正如我们在 step-31 中所做的那样。然而,这将是低效的:每个处理器将建立相同的稀疏性模式,但只用它初始化矩阵的一小部分。这也违反了一个原则,即每个处理器应该只对它所拥有的单元格(如果有必要的话,还有它周围的幽灵单元格层)工作。
// 相反,我们使用一个类型为 TrilinosWrappers::BlockSparsityPattern, 的对象,它(显然)是对Trilinos提供的稀疏模式对象的一个封装。这样做的好处是Trilinos稀疏模式类可以在多个处理器之间进行通信:如果这个处理器填入它所拥有的单元格产生的所有非零条目,并且其他每个处理器也这样做,那么在由 <code>compress()</code> 调用发起的MPI通信结束后,我们将有全局组装的稀疏模式可用,全局矩阵可以被初始化。
// 在并行初始化Trilinos稀疏度模式时,有一个重要的方面。除了通过 @p stokes_partitioning 索引集指定矩阵的本地拥有的行和列之外,我们还提供了在某个处理器上装配时可能要写进的所有行的信息。本地相关行的集合包含了所有这样的行(可能还有一些不必要的行,但在实际获得所有单元格的索引和解决约束之前,很难找到确切的行索引)。这种额外的信息可以准确地确定在装配过程中发现的非处理器数据的结构。虽然Trilinos矩阵也能在飞行中收集这些信息(当从其他一些reinit方法初始化它们时),但效率较低,在用多线程组装矩阵时,会导致问题。在这个程序中,我们悲观地假设每次只有一个处理器可以在组装时写入矩阵(而计算是并行的),这对特里诺斯矩阵是没有问题的。在实践中,可以通过在不共享顶点的单元中提示WorkStream来做得更好,允许这些单元之间的并行性(参见图形着色算法和带有彩色迭代器的WorkStream参数)。然而,这只在只有一个MPI处理器的情况下有效,因为Trilinos的内部数据结构在飞行中积累非处理器的数据,不是线程安全。有了这里介绍的初始化,就不存在这样的问题,人们可以安全地为这个算法引入图形着色。
// 我们唯一需要做的改变是告诉 DoFTools::make_sparsity_pattern() 函数,它只应该在一个单元格子集上工作,即那些 <code>subdomain_id</code> 等于当前处理器数量的单元格,而忽略所有其他单元格。
// 这个策略被复制到以下三个函数中。
// 注意,Trilinos 矩阵存储的信息包含在稀疏模式中,所以一旦矩阵被赋予稀疏结构,我们就可以安全地释放 <code>sp</code> 变量。
template <int dim>
void BoussinesqFlowProblem<dim>::setup_stokes_matrix(
const std::vector<IndexSet> &stokes_partitioning,
const std::vector<IndexSet> &stokes_relevant_partitioning)
{
stokes_matrix.clear();
TrilinosWrappers::BlockSparsityPattern sp(stokes_partitioning,
stokes_partitioning,
stokes_relevant_partitioning,
MPI_COMM_WORLD);
Table<2, DoFTools::Coupling> coupling(dim + 1, dim + 1);
for (unsigned int c = 0; c < dim + 1; ++c)
for (unsigned int d = 0; d < dim + 1; ++d)
if (!((c == dim) && (d == dim)))
coupling[c][d] = DoFTools::always;
else
coupling[c][d] = DoFTools::none;
DoFTools::make_sparsity_pattern(stokes_dof_handler,
coupling,
sp,
stokes_constraints,
false,
Utilities::MPI::this_mpi_process(
MPI_COMM_WORLD));
sp.compress();
stokes_matrix.reinit(sp);
}
template <int dim>
void BoussinesqFlowProblem<dim>::setup_stokes_preconditioner(
const std::vector<IndexSet> &stokes_partitioning,
const std::vector<IndexSet> &stokes_relevant_partitioning)
{
Amg_preconditioner.reset();
Mp_preconditioner.reset();
stokes_preconditioner_matrix.clear();
TrilinosWrappers::BlockSparsityPattern sp(stokes_partitioning,
stokes_partitioning,
stokes_relevant_partitioning,
MPI_COMM_WORLD);
Table<2, DoFTools::Coupling> coupling(dim + 1, dim + 1);
for (unsigned int c = 0; c < dim + 1; ++c)
for (unsigned int d = 0; d < dim + 1; ++d)
if (c == d)
coupling[c][d] = DoFTools::always;
else
coupling[c][d] = DoFTools::none;
DoFTools::make_sparsity_pattern(stokes_dof_handler,
coupling,
sp,
stokes_constraints,
false,
Utilities::MPI::this_mpi_process(
MPI_COMM_WORLD));
sp.compress();
stokes_preconditioner_matrix.reinit(sp);
}
template <int dim>
void BoussinesqFlowProblem<dim>::setup_temperature_matrices(
const IndexSet &temperature_partitioner,
const IndexSet &temperature_relevant_partitioner)
{
T_preconditioner.reset();
temperature_mass_matrix.clear();
temperature_stiffness_matrix.clear();
temperature_matrix.clear();
TrilinosWrappers::SparsityPattern sp(temperature_partitioner,
temperature_partitioner,
temperature_relevant_partitioner,
MPI_COMM_WORLD);
DoFTools::make_sparsity_pattern(temperature_dof_handler,
sp,
temperature_constraints,
false,
Utilities::MPI::this_mpi_process(
MPI_COMM_WORLD));
sp.compress();
temperature_matrix.reinit(sp);
temperature_mass_matrix.reinit(sp);
temperature_stiffness_matrix.reinit(sp);
}
// 设置函数的其余部分(在拆分出上面的三个函数后)主要是处理我们需要做的跨处理器并行化的事情。因为设置所有这些都是程序的一个重要的计算时间支出,所以我们把在这里做的所有事情都放到一个定时器组中,这样我们就可以在程序结束时得到关于这部分时间的总结信息。
// 像往常一样,我们在顶部列举自由度,并按照组件/块进行排序,然后从零号处理器开始将它们的数字写到屏幕上。当 DoFHandler::distributed_dofs() 函数应用于 parallel::distributed::Triangulation 对象时,对自由度的排序是这样的:所有与子域0相关的自由度排在所有与子域1相关的自由度之前,等等。对于斯托克斯部分,这意味着速度和压力会混在一起,但这可以通过再次按块排序来解决;值得注意的是,后一种操作只保留了所有速度和压力的相对顺序,即在速度块内,我们仍然会将所有与子域零相关的速度放在与子域一相关的速度之前,等等。这一点很重要,因为我们把这个矩阵的每一个块都分布在所有的处理器上,并且希望这样做的方式是,每个处理器存储的矩阵部分与它将实际工作的单元上的自由度大致相等。
// 在打印自由度的数字时,注意如果我们使用许多处理器,这些数字将会很大。因此,我们让流在每三个数字之间放一个逗号分隔符。流的状态,使用locale,从这个操作之前保存到之后。虽然有点不透明,但这段代码是有效的,因为默认的locale(我们使用构造函数调用 <code>std::locale("")</code> 得到的)意味着打印数字时,每三位数字都有一个逗号分隔符(即千、百万、亿)。
// 在这个函数以及下面的许多函数中,我们测量了我们在这里花费的时间,并将其收集在一个叫做 "设置dof系统 "的部分,跨函数调用。这是用一个 TimerOutput::Scope 对象完成的,该对象在构建本地变量时,在上述名称为`computing_timer`的部分启动一个定时器;当`timing_section`变量的析构器被调用时,该定时器再次停止。 当然,这要么发生在函数的末尾,要么我们通过`return`语句离开函数,或者在某处抛出异常时--换句话说,只要我们以任何方式离开这个函数。因此,使用这种 "范围 "对象可以确保我们不必手动添加代码,告诉定时器在每个可能离开这个函数的地方停止。
template <int dim>
void BoussinesqFlowProblem<dim>::setup_dofs()
{
TimerOutput::Scope timing_section(computing_timer, "Setup dof systems");
stokes_dof_handler.distribute_dofs(stokes_fe);
std::vector<unsigned int> stokes_sub_blocks(dim + 1, 0);
stokes_sub_blocks[dim] = 1;
DoFRenumbering::component_wise(stokes_dof_handler, stokes_sub_blocks);
temperature_dof_handler.distribute_dofs(temperature_fe);
const std::vector<types::global_dof_index> stokes_dofs_per_block =
DoFTools::count_dofs_per_fe_block(stokes_dof_handler, stokes_sub_blocks);
const unsigned int n_u = stokes_dofs_per_block[0],
n_p = stokes_dofs_per_block[1],
n_T = temperature_dof_handler.n_dofs();
std::locale s = pcout.get_stream().getloc();
pcout.get_stream().imbue(std::locale(""));
pcout << "Number of active cells: " << triangulation.n_global_active_cells()
<< " (on " << triangulation.n_levels() << " levels)" << std::endl
<< "Number of degrees of freedom: " << n_u + n_p + n_T << " (" << n_u
<< '+' << n_p << '+' << n_T << ')' << std::endl
<< std::endl;
pcout.get_stream().imbue(s);
// 在这之后,我们必须设置各种分区器(类型为 <code>IndexSet</code> ,见介绍),描述每个矩阵或向量的哪些部分将被存储在哪里,然后调用实际设置矩阵的函数,在最后还要调整我们在这个程序中保留的各种向量的大小。
std::vector<IndexSet> stokes_partitioning, stokes_relevant_partitioning;
IndexSet temperature_partitioning(n_T),
temperature_relevant_partitioning(n_T);
IndexSet stokes_relevant_set;
{
IndexSet stokes_index_set = stokes_dof_handler.locally_owned_dofs();
stokes_partitioning.push_back(stokes_index_set.get_view(0, n_u));
stokes_partitioning.push_back(stokes_index_set.get_view(n_u, n_u + n_p));
DoFTools::extract_locally_relevant_dofs(stokes_dof_handler,
stokes_relevant_set);
stokes_relevant_partitioning.push_back(
stokes_relevant_set.get_view(0, n_u));
stokes_relevant_partitioning.push_back(
stokes_relevant_set.get_view(n_u, n_u + n_p));
temperature_partitioning = temperature_dof_handler.locally_owned_dofs();
DoFTools::extract_locally_relevant_dofs(
temperature_dof_handler, temperature_relevant_partitioning);
}
// 在这之后,我们可以计算求解向量的约束,包括悬挂节点约束和斯托克斯和温度场的同质和非同质边界值。请注意,和其他一切一样,约束对象不能在每个处理器上都持有<i>all</i>约束。相反,鉴于每个处理器只在其拥有的单元上组装线性系统,因此每个处理器只需要存储那些对正确性实际必要的约束。正如在 @ref distributed_paper "本文 "中所讨论的,我们需要了解的约束集正是所有本地相关自由度的约束集,所以这就是我们用来初始化约束对象的。
{
stokes_constraints.clear();
stokes_constraints.reinit(stokes_relevant_set);
DoFTools::make_hanging_node_constraints(stokes_dof_handler,
stokes_constraints);
FEValuesExtractors::Vector velocity_components(0);
VectorTools::interpolate_boundary_values(
stokes_dof_handler,
0,
Functions::ZeroFunction<dim>(dim + 1),
stokes_constraints,
stokes_fe.component_mask(velocity_components));
std::set<types::boundary_id> no_normal_flux_boundaries;
no_normal_flux_boundaries.insert(1);
VectorTools::compute_no_normal_flux_constraints(stokes_dof_handler,
0,
no_normal_flux_boundaries,
stokes_constraints,
mapping);
stokes_constraints.close();
}
{
temperature_constraints.clear();
temperature_constraints.reinit(temperature_relevant_partitioning);
DoFTools::make_hanging_node_constraints(temperature_dof_handler,
temperature_constraints);
VectorTools::interpolate_boundary_values(
temperature_dof_handler,
0,
EquationData::TemperatureInitialValues<dim>(),
temperature_constraints);
VectorTools::interpolate_boundary_values(
temperature_dof_handler,
1,
EquationData::TemperatureInitialValues<dim>(),
temperature_constraints);
temperature_constraints.close();
}
// 做完这些,我们就可以将各种矩阵和向量对象初始化到合适的大小。在最后,我们还记录了所有的矩阵和前置条件器必须在下一个时间步长开始时重新计算。注意我们是如何初始化斯托克斯和温度右侧的向量的。这些是可写的向量(最后一个布尔参数设置为 @p true) ),具有正确的一对一的本地拥有元素的分区,但仍被赋予相关的分区,以弄清要立即设置的向量条目。至于矩阵,这允许用多个线程将本地贡献写入向量(总是假设同一向量条目不被多个线程同时访问)。其他向量只允许对单个元素的读取访问,包括鬼魂,但不适合求解器。
setup_stokes_matrix(stokes_partitioning, stokes_relevant_partitioning);
setup_stokes_preconditioner(stokes_partitioning,
stokes_relevant_partitioning);
setup_temperature_matrices(temperature_partitioning,
temperature_relevant_partitioning);
stokes_rhs.reinit(stokes_partitioning,
stokes_relevant_partitioning,
MPI_COMM_WORLD,
true);
stokes_solution.reinit(stokes_relevant_partitioning, MPI_COMM_WORLD);
old_stokes_solution.reinit(stokes_solution);
temperature_rhs.reinit(temperature_partitioning,
temperature_relevant_partitioning,
MPI_COMM_WORLD,
true);
temperature_solution.reinit(temperature_relevant_partitioning,
MPI_COMM_WORLD);
old_temperature_solution.reinit(temperature_solution);
old_old_temperature_solution.reinit(temperature_solution);
rebuild_stokes_matrix = true;
rebuild_stokes_preconditioner = true;
rebuild_temperature_matrices = true;
rebuild_temperature_preconditioner = true;
}
// @sect4{The BoussinesqFlowProblem assembly functions}
// 按照介绍和 @ref threads 模块中的讨论,我们将装配功能分成不同的部分。
// <ul>
// <li> 矩阵和右手边的局部计算,给定某个单元作为输入(这些函数被命名为下面的 <code>local_assemble_*</code> )。换句话说,得出的函数基本上是 step-31 中所有单元格的循环体。然而,请注意,这些函数将本地计算的结果存储在CopyData命名空间的类的变量中。
// <li> 然后这些对象被交给第二步,将本地数据写入全局数据结构中(这些函数被命名为下面的 <code>copy_local_to_global_*</code> )。这些函数是相当琐碎的。
// <li> 然后这两个子函数被用于各自的汇编例程(下面称为 <code>assemble_*</code> ),在那里,一个WorkStream对象被设置并在属于处理器子域的所有单元中运行。 </ul>
// @sect5{Stokes preconditioner assembly}
// 让我们从构建斯托克斯预处理的函数开始。考虑到上面的讨论,其中的前两个是非常微不足道的。请特别注意,使用scratch数据对象的主要意义在于,我们希望避免每次访问新单元时在自由空间上分配任何对象。因此,下面的汇编函数只有自动的局部变量,其他的都是通过从头开始的数据对象访问的,在我们开始对所有单元进行循环之前,只分配了一次。
template <int dim>
void BoussinesqFlowProblem<dim>::local_assemble_stokes_preconditioner(
const typename DoFHandler<dim>::active_cell_iterator &cell,
Assembly::Scratch::StokesPreconditioner<dim> & scratch,
Assembly::CopyData::StokesPreconditioner<dim> & data)
{
const unsigned int dofs_per_cell = stokes_fe.n_dofs_per_cell();
const unsigned int n_q_points =
scratch.stokes_fe_values.n_quadrature_points;
const FEValuesExtractors::Vector velocities(0);
const FEValuesExtractors::Scalar pressure(dim);
scratch.stokes_fe_values.reinit(cell);
cell->get_dof_indices(data.local_dof_indices);
data.local_matrix = 0;
for (unsigned int q = 0; q < n_q_points; ++q)
{
for (unsigned int k = 0; k < dofs_per_cell; ++k)
{
scratch.grad_phi_u[k] =
scratch.stokes_fe_values[velocities].gradient(k, q);
scratch.phi_p[k] = scratch.stokes_fe_values[pressure].value(k, q);
}
for (unsigned int i = 0; i < dofs_per_cell; ++i)
for (unsigned int j = 0; j < dofs_per_cell; ++j)
data.local_matrix(i, j) +=
(EquationData::eta *
scalar_product(scratch.grad_phi_u[i], scratch.grad_phi_u[j]) +
(1. / EquationData::eta) * EquationData::pressure_scaling *
EquationData::pressure_scaling *
(scratch.phi_p[i] * scratch.phi_p[j])) *
scratch.stokes_fe_values.JxW(q);
}
}
template <int dim>
void BoussinesqFlowProblem<dim>::copy_local_to_global_stokes_preconditioner(
const Assembly::CopyData::StokesPreconditioner<dim> &data)
{
stokes_constraints.distribute_local_to_global(data.local_matrix,
data.local_dof_indices,
stokes_preconditioner_matrix);
}
// 现在是真正把事情放在一起的函数,使用WorkStream函数。 WorkStream::run 需要一个开始和结束迭代器来列举它应该工作的单元格。通常情况下,我们会使用 DoFHandler::begin_active() 和 DoFHandler::end() 来实现这一点,但在这里,我们实际上只想获得事实上由当前处理器拥有的单元格子集。这就是FilteredIterator类发挥作用的地方:你给它一个单元格范围,它提供一个迭代器,只迭代满足某个谓词的单元格子集(谓词是一个参数的函数,要么返回真,要么返回假)。我们在这里使用的谓词是 IteratorFilters::LocallyOwnedCell, ,也就是说,如果单元格为当前处理器所拥有,它就会准确返回真。这样得到的迭代器范围正是我们需要的。
// 有了这个障碍,我们用这组单元格、scratch和copy对象以及两个函数的指针来调用 WorkStream::run 函数:本地装配和copy-local-to-global函数。这些函数需要有非常具体的签名:前者有三个参数,后者有一个参数(关于这些参数的含义,请参见 WorkStream::run 函数的文档)。注意我们是如何使用lambda函数来创建一个满足这一要求的函数对象的。它使用了指定单元格、抓取数据和复制数据的本地装配函数的函数参数,以及期望将数据写入全局矩阵的复制函数的函数参数(也可参见 step-13 的 <code>assemble_linear_system()</code> 函数中的讨论)。另一方面,成员函数的隐含的第2个参数(即该成员函数要操作的对象的 <code>this</code> 指针)是<i>bound</i>到当前函数的 <code>this</code> 指针的,并被捕获。因此, WorkStream::run 函数不需要知道这些函数所操作的对象的任何信息。
// 当WorkStream被执行时,它将为几个单元创建几个第一类的本地装配例程,并让一些可用的处理器对其工作。然而,需要同步的函数,即写进全局矩阵的操作,每次只由一个线程按照规定的顺序执行。当然,这只适用于单个MPI进程上的并行化。不同的MPI进程将有自己的WorkStream对象,并完全独立地进行这项工作(并且在不同的内存空间)。在分布式计算中,一些数据将积累在不属于各自处理器的自由度上。如果每次遇到这样的自由度就把数据送来送去,那就没有效率了。取而代之的是,Trilinos稀疏矩阵将保留这些数据,并在装配结束时通过调用 <code>compress()</code> 命令将其发送给所有者。
template <int dim>
void BoussinesqFlowProblem<dim>::assemble_stokes_preconditioner()
{
stokes_preconditioner_matrix = 0;
const QGauss<dim> quadrature_formula(parameters.stokes_velocity_degree + 1);
using CellFilter =
FilteredIterator<typename DoFHandler<2>::active_cell_iterator>;
auto worker =
[this](const typename DoFHandler<dim>::active_cell_iterator &cell,
Assembly::Scratch::StokesPreconditioner<dim> & scratch,
Assembly::CopyData::StokesPreconditioner<dim> & data) {
this->local_assemble_stokes_preconditioner(cell, scratch, data);
};
auto copier =
[this](const Assembly::CopyData::StokesPreconditioner<dim> &data) {
this->copy_local_to_global_stokes_preconditioner(data);
};
WorkStream::run(CellFilter(IteratorFilters::LocallyOwnedCell(),
stokes_dof_handler.begin_active()),
CellFilter(IteratorFilters::LocallyOwnedCell(),
stokes_dof_handler.end()),
worker,
copier,
Assembly::Scratch::StokesPreconditioner<dim>(
stokes_fe,
quadrature_formula,
mapping,
update_JxW_values | update_values | update_gradients),
Assembly::CopyData::StokesPreconditioner<dim>(stokes_fe));
stokes_preconditioner_matrix.compress(VectorOperation::add);
}
// 这个模块的最后一个函数启动了斯托克斯预处理矩阵的装配,然后实际上是建立了斯托克斯预处理程序。它与串行情况下的功能基本相同。与 step-31 唯一不同的是,我们对压力质量矩阵使用雅可比预处理,而不是IC,这一点在介绍中已经讨论过。
template <int dim>
void BoussinesqFlowProblem<dim>::build_stokes_preconditioner()
{
if (rebuild_stokes_preconditioner == false)
return;
TimerOutput::Scope timer_section(computing_timer,
" Build Stokes preconditioner");
pcout << " Rebuilding Stokes preconditioner..." << std::flush;
assemble_stokes_preconditioner();
std::vector<std::vector<bool>> constant_modes;
FEValuesExtractors::Vector velocity_components(0);
DoFTools::extract_constant_modes(stokes_dof_handler,
stokes_fe.component_mask(
velocity_components),
constant_modes);
Mp_preconditioner =
std::make_shared<TrilinosWrappers::PreconditionJacobi>();
Amg_preconditioner = std::make_shared<TrilinosWrappers::PreconditionAMG>();
TrilinosWrappers::PreconditionAMG::AdditionalData Amg_data;
Amg_data.constant_modes = constant_modes;
Amg_data.elliptic = true;
Amg_data.higher_order_elements = true;
Amg_data.smoother_sweeps = 2;
Amg_data.aggregation_threshold = 0.02;
Mp_preconditioner->initialize(stokes_preconditioner_matrix.block(1, 1));
Amg_preconditioner->initialize(stokes_preconditioner_matrix.block(0, 0),
Amg_data);
rebuild_stokes_preconditioner = false;
pcout << std::endl;
}
// @sect5{Stokes system assembly}
// 接下来的三个函数实现了斯托克斯系统的装配,同样分为执行局部计算的部分,将局部数据写入全局矩阵和向量的部分,以及在WorkStream类的帮助下实际运行所有单元的循环。请注意,只有在我们改变了网格的情况下才需要进行斯托克斯矩阵的组装。否则,这里只需要计算(与温度有关的)右手边。由于我们正在处理分布式矩阵和向量,我们必须在装配结束时调用相应的 <code>compress()</code> 函数,以便将非本地数据发送到所有者进程。
template <int dim>
void BoussinesqFlowProblem<dim>::local_assemble_stokes_system(
const typename DoFHandler<dim>::active_cell_iterator &cell,
Assembly::Scratch::StokesSystem<dim> & scratch,
Assembly::CopyData::StokesSystem<dim> & data)
{
const unsigned int dofs_per_cell =
scratch.stokes_fe_values.get_fe().n_dofs_per_cell();
const unsigned int n_q_points =
scratch.stokes_fe_values.n_quadrature_points;
const FEValuesExtractors::Vector velocities(0);
const FEValuesExtractors::Scalar pressure(dim);
scratch.stokes_fe_values.reinit(cell);
typename DoFHandler<dim>::active_cell_iterator temperature_cell(
&triangulation, cell->level(), cell->index(), &temperature_dof_handler);
scratch.temperature_fe_values.reinit(temperature_cell);
if (rebuild_stokes_matrix)
data.local_matrix = 0;
data.local_rhs = 0;
scratch.temperature_fe_values.get_function_values(
old_temperature_solution, scratch.old_temperature_values);
for (unsigned int q = 0; q < n_q_points; ++q)
{
const double old_temperature = scratch.old_temperature_values[q];
for (unsigned int k = 0; k < dofs_per_cell; ++k)
{
scratch.phi_u[k] = scratch.stokes_fe_values[velocities].value(k, q);
if (rebuild_stokes_matrix)
{
scratch.grads_phi_u[k] =
scratch.stokes_fe_values[velocities].symmetric_gradient(k, q);
scratch.div_phi_u[k] =
scratch.stokes_fe_values[velocities].divergence(k, q);
scratch.phi_p[k] =
scratch.stokes_fe_values[pressure].value(k, q);
}
}
if (rebuild_stokes_matrix == true)
for (unsigned int i = 0; i < dofs_per_cell; ++i)
for (unsigned int j = 0; j < dofs_per_cell; ++j)
data.local_matrix(i, j) +=
(EquationData::eta * 2 *
(scratch.grads_phi_u[i] * scratch.grads_phi_u[j]) -
(EquationData::pressure_scaling * scratch.div_phi_u[i] *
scratch.phi_p[j]) -
(EquationData::pressure_scaling * scratch.phi_p[i] *
scratch.div_phi_u[j])) *
scratch.stokes_fe_values.JxW(q);
const Tensor<1, dim> gravity = EquationData::gravity_vector(
scratch.stokes_fe_values.quadrature_point(q));
for (unsigned int i = 0; i < dofs_per_cell; ++i)
data.local_rhs(i) += (EquationData::density(old_temperature) *
gravity * scratch.phi_u[i]) *
scratch.stokes_fe_values.JxW(q);
}
cell->get_dof_indices(data.local_dof_indices);
}
template <int dim>
void BoussinesqFlowProblem<dim>::copy_local_to_global_stokes_system(
const Assembly::CopyData::StokesSystem<dim> &data)
{
if (rebuild_stokes_matrix == true)
stokes_constraints.distribute_local_to_global(data.local_matrix,
data.local_rhs,
data.local_dof_indices,
stokes_matrix,
stokes_rhs);
else
stokes_constraints.distribute_local_to_global(data.local_rhs,
data.local_dof_indices,
stokes_rhs);
}
template <int dim>
void BoussinesqFlowProblem<dim>::assemble_stokes_system()
{
TimerOutput::Scope timer_section(computing_timer,
" Assemble Stokes system");
if (rebuild_stokes_matrix == true)
stokes_matrix = 0;
stokes_rhs = 0;
const QGauss<dim> quadrature_formula(parameters.stokes_velocity_degree + 1);
using CellFilter =
FilteredIterator<typename DoFHandler<2>::active_cell_iterator>;
WorkStream::run(
CellFilter(IteratorFilters::LocallyOwnedCell(),
stokes_dof_handler.begin_active()),
CellFilter(IteratorFilters::LocallyOwnedCell(), stokes_dof_handler.end()),
[this](const typename DoFHandler<dim>::active_cell_iterator &cell,
Assembly::Scratch::StokesSystem<dim> & scratch,
Assembly::CopyData::StokesSystem<dim> & data) {
this->local_assemble_stokes_system(cell, scratch, data);
},
[this](const Assembly::CopyData::StokesSystem<dim> &data) {
this->copy_local_to_global_stokes_system(data);
},
Assembly::Scratch::StokesSystem<dim>(
stokes_fe,
mapping,
quadrature_formula,
(update_values | update_quadrature_points | update_JxW_values |
(rebuild_stokes_matrix == true ? update_gradients : UpdateFlags(0))),
temperature_fe,
update_values),
Assembly::CopyData::StokesSystem<dim>(stokes_fe));
if (rebuild_stokes_matrix == true)
stokes_matrix.compress(VectorOperation::add);
stokes_rhs.compress(VectorOperation::add);
rebuild_stokes_matrix = false;
pcout << std::endl;
}
// @sect5{Temperature matrix assembly}
// 下面三个函数要完成的任务是计算温度系统的质量矩阵和拉普拉斯矩阵。这些将被结合起来,以产生半隐式时间步进矩阵,该矩阵由质量矩阵加上一个与时间 step- 相关的权重系数乘以拉普拉斯矩阵组成。这个函数本质上还是从 step-31 开始的所有单元的循环主体。
// 下面两个函数的功能与上面的类似。
template <int dim>
void BoussinesqFlowProblem<dim>::local_assemble_temperature_matrix(
const typename DoFHandler<dim>::active_cell_iterator &cell,
Assembly::Scratch::TemperatureMatrix<dim> & scratch,
Assembly::CopyData::TemperatureMatrix<dim> & data)
{
const unsigned int dofs_per_cell =
scratch.temperature_fe_values.get_fe().n_dofs_per_cell();
const unsigned int n_q_points =
scratch.temperature_fe_values.n_quadrature_points;
scratch.temperature_fe_values.reinit(cell);
cell->get_dof_indices(data.local_dof_indices);
data.local_mass_matrix = 0;
data.local_stiffness_matrix = 0;
for (unsigned int q = 0; q < n_q_points; ++q)
{
for (unsigned int k = 0; k < dofs_per_cell; ++k)
{
scratch.grad_phi_T[k] =
scratch.temperature_fe_values.shape_grad(k, q);
scratch.phi_T[k] = scratch.temperature_fe_values.shape_value(k, q);
}
for (unsigned int i = 0; i < dofs_per_cell; ++i)
for (unsigned int j = 0; j < dofs_per_cell; ++j)
{
data.local_mass_matrix(i, j) +=
(scratch.phi_T[i] * scratch.phi_T[j] *
scratch.temperature_fe_values.JxW(q));
data.local_stiffness_matrix(i, j) +=
(EquationData::kappa * scratch.grad_phi_T[i] *
scratch.grad_phi_T[j] * scratch.temperature_fe_values.JxW(q));
}
}
}
template <int dim>
void BoussinesqFlowProblem<dim>::copy_local_to_global_temperature_matrix(
const Assembly::CopyData::TemperatureMatrix<dim> &data)
{
temperature_constraints.distribute_local_to_global(data.local_mass_matrix,
data.local_dof_indices,
temperature_mass_matrix);
temperature_constraints.distribute_local_to_global(
data.local_stiffness_matrix,
data.local_dof_indices,
temperature_stiffness_matrix);
}
template <int dim>
void BoussinesqFlowProblem<dim>::assemble_temperature_matrix()
{
if (rebuild_temperature_matrices == false)
return;
TimerOutput::Scope timer_section(computing_timer,
" Assemble temperature matrices");
temperature_mass_matrix = 0;
temperature_stiffness_matrix = 0;
const QGauss<dim> quadrature_formula(parameters.temperature_degree + 2);
using CellFilter =
FilteredIterator<typename DoFHandler<2>::active_cell_iterator>;
WorkStream::run(
CellFilter(IteratorFilters::LocallyOwnedCell(),
temperature_dof_handler.begin_active()),
CellFilter(IteratorFilters::LocallyOwnedCell(),
temperature_dof_handler.end()),
[this](const typename DoFHandler<dim>::active_cell_iterator &cell,
Assembly::Scratch::TemperatureMatrix<dim> & scratch,
Assembly::CopyData::TemperatureMatrix<dim> & data) {
this->local_assemble_temperature_matrix(cell, scratch, data);
},
[this](const Assembly::CopyData::TemperatureMatrix<dim> &data) {
this->copy_local_to_global_temperature_matrix(data);
},
Assembly::Scratch::TemperatureMatrix<dim>(temperature_fe,
mapping,
quadrature_formula),
Assembly::CopyData::TemperatureMatrix<dim>(temperature_fe));
temperature_mass_matrix.compress(VectorOperation::add);
temperature_stiffness_matrix.compress(VectorOperation::add);
rebuild_temperature_matrices = false;
rebuild_temperature_preconditioner = true;
}
// @sect5{Temperature right hand side assembly}
// 这是最后一个装配函数。它计算温度系统的右侧,其中包括对流和稳定项。它包括对正交点上的旧解的大量评估(这对于计算稳定化的人工粘性是必要的),但在其他方面与其他装配函数类似。请注意,我们再次解决了具有不均匀边界条件的困境,只是在这一点上做了一个右手边(比较上面对 <code>project()</code> 函数的评论)。我们创建一些矩阵列,其值正好是为温度刚度矩阵输入的值,如果我们有不均匀约束的DFS的话。这将说明右边的向量与温度矩阵系统的正确平衡。
template <int dim>
void BoussinesqFlowProblem<dim>::local_assemble_temperature_rhs(
const std::pair<double, double> global_T_range,
const double global_max_velocity,
const double global_entropy_variation,
const typename DoFHandler<dim>::active_cell_iterator &cell,
Assembly::Scratch::TemperatureRHS<dim> & scratch,
Assembly::CopyData::TemperatureRHS<dim> & data)
{
const bool use_bdf2_scheme = (timestep_number != 0);
const unsigned int dofs_per_cell =
scratch.temperature_fe_values.get_fe().n_dofs_per_cell();
const unsigned int n_q_points =
scratch.temperature_fe_values.n_quadrature_points;
const FEValuesExtractors::Vector velocities(0);
data.local_rhs = 0;
data.matrix_for_bc = 0;
cell->get_dof_indices(data.local_dof_indices);
scratch.temperature_fe_values.reinit(cell);
typename DoFHandler<dim>::active_cell_iterator stokes_cell(
&triangulation, cell->level(), cell->index(), &stokes_dof_handler);
scratch.stokes_fe_values.reinit(stokes_cell);
scratch.temperature_fe_values.get_function_values(
old_temperature_solution, scratch.old_temperature_values);
scratch.temperature_fe_values.get_function_values(
old_old_temperature_solution, scratch.old_old_temperature_values);
scratch.temperature_fe_values.get_function_gradients(
old_temperature_solution, scratch.old_temperature_grads);
scratch.temperature_fe_values.get_function_gradients(
old_old_temperature_solution, scratch.old_old_temperature_grads);
scratch.temperature_fe_values.get_function_laplacians(
old_temperature_solution, scratch.old_temperature_laplacians);
scratch.temperature_fe_values.get_function_laplacians(
old_old_temperature_solution, scratch.old_old_temperature_laplacians);
scratch.stokes_fe_values[velocities].get_function_values(
stokes_solution, scratch.old_velocity_values);
scratch.stokes_fe_values[velocities].get_function_values(
old_stokes_solution, scratch.old_old_velocity_values);
scratch.stokes_fe_values[velocities].get_function_symmetric_gradients(
stokes_solution, scratch.old_strain_rates);
scratch.stokes_fe_values[velocities].get_function_symmetric_gradients(
old_stokes_solution, scratch.old_old_strain_rates);
const double nu =
compute_viscosity(scratch.old_temperature_values,
scratch.old_old_temperature_values,
scratch.old_temperature_grads,
scratch.old_old_temperature_grads,
scratch.old_temperature_laplacians,
scratch.old_old_temperature_laplacians,
scratch.old_velocity_values,
scratch.old_old_velocity_values,
scratch.old_strain_rates,
scratch.old_old_strain_rates,
global_max_velocity,
global_T_range.second - global_T_range.first,
0.5 * (global_T_range.second + global_T_range.first),
global_entropy_variation,
cell->diameter());
for (unsigned int q = 0; q < n_q_points; ++q)
{
for (unsigned int k = 0; k < dofs_per_cell; ++k)
{
scratch.phi_T[k] = scratch.temperature_fe_values.shape_value(k, q);
scratch.grad_phi_T[k] =
scratch.temperature_fe_values.shape_grad(k, q);
}
const double T_term_for_rhs =
(use_bdf2_scheme ?
(scratch.old_temperature_values[q] *
(1 + time_step / old_time_step) -
scratch.old_old_temperature_values[q] * (time_step * time_step) /
(old_time_step * (time_step + old_time_step))) :
scratch.old_temperature_values[q]);
const double ext_T =
(use_bdf2_scheme ? (scratch.old_temperature_values[q] *
(1 + time_step / old_time_step) -
scratch.old_old_temperature_values[q] *
time_step / old_time_step) :
scratch.old_temperature_values[q]);
const Tensor<1, dim> ext_grad_T =
(use_bdf2_scheme ? (scratch.old_temperature_grads[q] *
(1 + time_step / old_time_step) -
scratch.old_old_temperature_grads[q] * time_step /
old_time_step) :
scratch.old_temperature_grads[q]);
const Tensor<1, dim> extrapolated_u =
(use_bdf2_scheme ?
(scratch.old_velocity_values[q] * (1 + time_step / old_time_step) -
scratch.old_old_velocity_values[q] * time_step / old_time_step) :
scratch.old_velocity_values[q]);
const SymmetricTensor<2, dim> extrapolated_strain_rate =
(use_bdf2_scheme ?
(scratch.old_strain_rates[q] * (1 + time_step / old_time_step) -
scratch.old_old_strain_rates[q] * time_step / old_time_step) :
scratch.old_strain_rates[q]);
const double gamma =
((EquationData::radiogenic_heating * EquationData::density(ext_T) +
2 * EquationData::eta * extrapolated_strain_rate *
extrapolated_strain_rate) /
(EquationData::density(ext_T) * EquationData::specific_heat));
for (unsigned int i = 0; i < dofs_per_cell; ++i)
{
data.local_rhs(i) +=
(T_term_for_rhs * scratch.phi_T[i] -
time_step * extrapolated_u * ext_grad_T * scratch.phi_T[i] -
time_step * nu * ext_grad_T * scratch.grad_phi_T[i] +
time_step * gamma * scratch.phi_T[i]) *
scratch.temperature_fe_values.JxW(q);
if (temperature_constraints.is_inhomogeneously_constrained(
data.local_dof_indices[i]))
{
for (unsigned int j = 0; j < dofs_per_cell; ++j)
data.matrix_for_bc(j, i) +=
(scratch.phi_T[i] * scratch.phi_T[j] *
(use_bdf2_scheme ? ((2 * time_step + old_time_step) /
(time_step + old_time_step)) :
1.) +
scratch.grad_phi_T[i] * scratch.grad_phi_T[j] *
EquationData::kappa * time_step) *
scratch.temperature_fe_values.JxW(q);
}
}
}
}
template <int dim>
void BoussinesqFlowProblem<dim>::copy_local_to_global_temperature_rhs(
const Assembly::CopyData::TemperatureRHS<dim> &data)
{
temperature_constraints.distribute_local_to_global(data.local_rhs,
data.local_dof_indices,
temperature_rhs,
data.matrix_for_bc);
}
// 在运行实际计算右手边的WorkStream的函数中,我们也生成了最终矩阵。如上所述,它是质量矩阵和拉普拉斯矩阵的总和,再加上一些与时间 step- 相关的权重。这个权重是由BDF-2时间积分方案指定的,见 step-31 中的介绍。这个教程程序的新内容(除了使用MPI并行化和WorkStream类),是我们现在也预先计算了温度预处理程序。原因是与求解器相比,设置雅可比预处理器需要明显的时间,因为我们通常只需要10到20次迭代来求解温度系统(这听起来很奇怪,因为雅可比实际上只包括对角线,但在特里诺斯,它是从更普遍的点松弛预处理器框架中衍生出来的,效率有点低)。因此,尽管由于时间步长可能会发生变化,矩阵条目可能会略有变化,但预先计算预处理程序的效率更高。这不是太大的问题,因为我们每隔几步就重新网格化(然后重新生成预处理程序)。
template <int dim>
void BoussinesqFlowProblem<dim>::assemble_temperature_system(
const double maximal_velocity)
{
const bool use_bdf2_scheme = (timestep_number != 0);
if (use_bdf2_scheme == true)
{
temperature_matrix.copy_from(temperature_mass_matrix);
temperature_matrix *=
(2 * time_step + old_time_step) / (time_step + old_time_step);
temperature_matrix.add(time_step, temperature_stiffness_matrix);
}
else
{
temperature_matrix.copy_from(temperature_mass_matrix);
temperature_matrix.add(time_step, temperature_stiffness_matrix);
}
if (rebuild_temperature_preconditioner == true)
{
T_preconditioner =
std::make_shared<TrilinosWrappers::PreconditionJacobi>();
T_preconditioner->initialize(temperature_matrix);
rebuild_temperature_preconditioner = false;
}
// 接下来的部分是计算右手边的向量。 为此,我们首先计算平均温度 $T_m$ ,我们通过残差 $E(T) =
// (T-T_m)^2$ 来评估人工黏度的稳定。我们通过在熵粘度的定义中把最高和最低温度之间的中点定义为平均温度来做到这一点。另一种方法是使用积分平均,但结果对这种选择不是很敏感。那么剩下的就只需要再次调用 WorkStream::run ,将每次调用都相同的 <code>local_assemble_temperature_rhs</code> 函数的参数绑定到正确的值中。
temperature_rhs = 0;
const QGauss<dim> quadrature_formula(parameters.temperature_degree + 2);
const std::pair<double, double> global_T_range =
get_extrapolated_temperature_range();
const double average_temperature =
0.5 * (global_T_range.first + global_T_range.second);
const double global_entropy_variation =
get_entropy_variation(average_temperature);
using CellFilter =
FilteredIterator<typename DoFHandler<2>::active_cell_iterator>;
auto worker =
[this, global_T_range, maximal_velocity, global_entropy_variation](
const typename DoFHandler<dim>::active_cell_iterator &cell,
Assembly::Scratch::TemperatureRHS<dim> & scratch,
Assembly::CopyData::TemperatureRHS<dim> & data) {
this->local_assemble_temperature_rhs(global_T_range,
maximal_velocity,
global_entropy_variation,
cell,
scratch,
data);
};
auto copier = [this](const Assembly::CopyData::TemperatureRHS<dim> &data) {
this->copy_local_to_global_temperature_rhs(data);
};
WorkStream::run(CellFilter(IteratorFilters::LocallyOwnedCell(),
temperature_dof_handler.begin_active()),
CellFilter(IteratorFilters::LocallyOwnedCell(),
temperature_dof_handler.end()),
worker,
copier,
Assembly::Scratch::TemperatureRHS<dim>(
temperature_fe, stokes_fe, mapping, quadrature_formula),
Assembly::CopyData::TemperatureRHS<dim>(temperature_fe));
temperature_rhs.compress(VectorOperation::add);
}
// @sect4{BoussinesqFlowProblem::solve}
// 这个函数在Boussinesq问题的每个时间步长中求解线性系统。首先,我们在斯托克斯系统上工作,然后在温度系统上工作。从本质上讲,它与 step-31 中的相应函数做了同样的事情。然而,这里有一些变化。
// 第一个变化与我们存储解决方案的方式有关:我们在每个MPI节点上保留具有本地拥有的自由度的向量加鬼魂节点。当我们进入一个应该用分布式矩阵进行矩阵-向量乘积的求解器时,这不是合适的形式,虽然。在那里,我们希望求解向量的分布方式与矩阵的分布方式相同,即没有任何重影。所以我们首先要做的是生成一个名为 <code>distributed_stokes_solution</code> 的分布式向量,并只将本地拥有的dof放入其中,这可以通过特里诺向量的 <code>operator=</code> 整齐地完成。
// 接下来,我们为求解器缩放压力解(或者说,初始猜测),使其与矩阵中的长度尺度相匹配,正如在介绍中讨论的那样。在求解完成后,我们也会立即将压力值缩回到正确的单位。 我们还需要将悬挂节点的压力值设置为零。这一点我们在 step-31 中也做过,以避免一些在求解阶段实际上无关紧要的向量项干扰舒尔补数。与 step-31 不同的是,这里我们只对局部拥有的压力道夫进行了处理。在对斯托克斯解进行求解后,每个处理器将分布式解复制到解向量中,其中也包括鬼元素。
// 第三个也是最明显的变化是,我们有两种斯托克斯求解器的变体。一种是有时会崩溃的快速求解器,另一种是速度较慢的稳健求解器。这就是我们在介绍中已经讨论过的。以下是我们如何实现它的。首先,我们用快速求解器进行30次迭代,该求解器是基于AMG V型循环的简单预处理,而不是近似求解(这由 <code>false</code> 对象的 <code>LinearSolvers::BlockSchurPreconditioner</code> 参数表示)。如果我们收敛了,一切都很好。如果我们没有收敛,求解器控制对象将抛出一个异常 SolverControl::NoConvergence. 通常,这将中止程序,因为我们在通常的 <code>solve()</code> 函数中没有捕捉它们。这当然不是我们想在这里发生的。相反,我们希望切换到强求解器,并继续用我们目前得到的任何矢量进行求解。因此,我们用C++的try/catch机制来捕获这个异常。然后我们在 <code>catch</code> 子句中简单地再次经历相同的求解器序列,这次我们将 @p true 标志传递给强求解器的预处理程序,表示近似CG求解。
template <int dim>
void BoussinesqFlowProblem<dim>::solve()
{
{
TimerOutput::Scope timer_section(computing_timer,
" Solve Stokes system");
pcout << " Solving Stokes system... " << std::flush;
TrilinosWrappers::MPI::BlockVector distributed_stokes_solution(
stokes_rhs);
distributed_stokes_solution = stokes_solution;
distributed_stokes_solution.block(1) /= EquationData::pressure_scaling;
const unsigned int
start = (distributed_stokes_solution.block(0).size() +
distributed_stokes_solution.block(1).local_range().first),
end = (distributed_stokes_solution.block(0).size() +
distributed_stokes_solution.block(1).local_range().second);
for (unsigned int i = start; i < end; ++i)
if (stokes_constraints.is_constrained(i))
distributed_stokes_solution(i) = 0;
PrimitiveVectorMemory<TrilinosWrappers::MPI::BlockVector> mem;
unsigned int n_iterations = 0;
const double solver_tolerance = 1e-8 * stokes_rhs.l2_norm();
SolverControl solver_control(30, solver_tolerance);
try
{
const LinearSolvers::BlockSchurPreconditioner<
TrilinosWrappers::PreconditionAMG,
TrilinosWrappers::PreconditionJacobi>
preconditioner(stokes_matrix,
stokes_preconditioner_matrix,
*Mp_preconditioner,
*Amg_preconditioner,
false);
SolverFGMRES<TrilinosWrappers::MPI::BlockVector> solver(
solver_control,
mem,
SolverFGMRES<TrilinosWrappers::MPI::BlockVector>::AdditionalData(
30));
solver.solve(stokes_matrix,
distributed_stokes_solution,
stokes_rhs,
preconditioner);
n_iterations = solver_control.last_step();
}
catch (SolverControl::NoConvergence &)
{
const LinearSolvers::BlockSchurPreconditioner<
TrilinosWrappers::PreconditionAMG,
TrilinosWrappers::PreconditionJacobi>
preconditioner(stokes_matrix,
stokes_preconditioner_matrix,
*Mp_preconditioner,
*Amg_preconditioner,
true);
SolverControl solver_control_refined(stokes_matrix.m(),
solver_tolerance);
SolverFGMRES<TrilinosWrappers::MPI::BlockVector> solver(
solver_control_refined,
mem,
SolverFGMRES<TrilinosWrappers::MPI::BlockVector>::AdditionalData(
50));
solver.solve(stokes_matrix,
distributed_stokes_solution,
stokes_rhs,
preconditioner);
n_iterations =
(solver_control.last_step() + solver_control_refined.last_step());
}
stokes_constraints.distribute(distributed_stokes_solution);
distributed_stokes_solution.block(1) *= EquationData::pressure_scaling;
stokes_solution = distributed_stokes_solution;
pcout << n_iterations << " iterations." << std::endl;
}
// 现在让我们转到温度部分。首先,我们计算时间步长。我们发现,对于壳的几何形状,我们需要三维的时间步长比二维的小。这是因为在这种情况下,单元格的变形更大(决定CFL数值的是最小的边长)。我们不是像 step-31 中那样从最大速度和最小网格尺寸计算时间步长,而是计算局部的CFL数,即在每个单元上计算最大速度乘以网格尺寸,并计算它们的最大值。因此,我们需要将时间步长前面的因子选择得稍小一些。
// 在温度的右手边装配后,我们解决温度的线性系统(有完全分布的向量,没有任何鬼魂),应用约束条件,并将向量复制回有鬼魂的向量。
// 最后,我们提取与 step-31 类似的温度范围,以产生一些输出(例如为了帮助我们选择稳定常数,如介绍中所讨论的)。唯一的区别是,我们需要在所有处理器上交换最大值。
{
TimerOutput::Scope timer_section(computing_timer,
" Assemble temperature rhs");
old_time_step = time_step;
const double scaling = (dim == 3 ? 0.25 : 1.0);
time_step = (scaling / (2.1 * dim * std::sqrt(1. * dim)) /
(parameters.temperature_degree * get_cfl_number()));
const double maximal_velocity = get_maximal_velocity();
pcout << " Maximal velocity: "
<< maximal_velocity * EquationData::year_in_seconds * 100
<< " cm/year" << std::endl;
pcout << " "
<< "Time step: " << time_step / EquationData::year_in_seconds
<< " years" << std::endl;
temperature_solution = old_temperature_solution;
assemble_temperature_system(maximal_velocity);
}
{
TimerOutput::Scope timer_section(computing_timer,
" Solve temperature system");
SolverControl solver_control(temperature_matrix.m(),
1e-12 * temperature_rhs.l2_norm());
SolverCG<TrilinosWrappers::MPI::Vector> cg(solver_control);
TrilinosWrappers::MPI::Vector distributed_temperature_solution(
temperature_rhs);
distributed_temperature_solution = temperature_solution;
cg.solve(temperature_matrix,
distributed_temperature_solution,
temperature_rhs,
*T_preconditioner);
temperature_constraints.distribute(distributed_temperature_solution);
temperature_solution = distributed_temperature_solution;
pcout << " " << solver_control.last_step()
<< " CG iterations for temperature" << std::endl;
double temperature[2] = {std::numeric_limits<double>::max(),
-std::numeric_limits<double>::max()};
double global_temperature[2];
for (unsigned int i =
distributed_temperature_solution.local_range().first;
i < distributed_temperature_solution.local_range().second;
++i)
{
temperature[0] =
std::min<double>(temperature[0],
distributed_temperature_solution(i));
temperature[1] =
std::max<double>(temperature[1],
distributed_temperature_solution(i));
}
temperature[0] *= -1.0;
Utilities::MPI::max(temperature, MPI_COMM_WORLD, global_temperature);
global_temperature[0] *= -1.0;
pcout << " Temperature range: " << global_temperature[0] << ' '
<< global_temperature[1] << std::endl;
}
}
// @sect4{BoussinesqFlowProblem::output_results}
// 接下来是生成输出的函数。输出的数量可以像我们在 step-31 中那样手动引入。另一种方法是把这个任务交给一个继承自DataPostprocessor类的PostProcessor,它可以被附加到DataOut。这允许我们从解决方案中输出派生量,比如本例中包含的摩擦热。它重载了虚拟函数 DataPostprocessor::evaluate_vector_field(), ,然后从 DataOut::build_patches(). 内部调用。 我们必须给它数值解、它的导数、单元的法线、实际评估点和任何额外的数量。这与 step-29 和其他程序中讨论的程序相同。
template <int dim>
class BoussinesqFlowProblem<dim>::Postprocessor
: public DataPostprocessor<dim>
{
public:
Postprocessor(const unsigned int partition, const double minimal_pressure);
virtual void evaluate_vector_field(
const DataPostprocessorInputs::Vector<dim> &inputs,
std::vector<Vector<double>> &computed_quantities) const override;
virtual std::vector<std::string> get_names() const override;
virtual std::vector<
DataComponentInterpretation::DataComponentInterpretation>
get_data_component_interpretation() const override;
virtual UpdateFlags get_needed_update_flags() const override;
private:
const unsigned int partition;
const double minimal_pressure;
};
template <int dim>
BoussinesqFlowProblem<dim>::Postprocessor::Postprocessor(
const unsigned int partition,
const double minimal_pressure)
: partition(partition)
, minimal_pressure(minimal_pressure)
{}
// 这里我们定义了要输出的变量的名称。这些是速度、压力和温度的实际求解值,以及摩擦热和对每个单元拥有的处理器的编号。这使我们能够直观地看到处理器之间的领域划分。除了速度是矢量值的,其他的量都是标量。
template <int dim>
std::vector<std::string>
BoussinesqFlowProblem<dim>::Postprocessor::get_names() const
{
std::vector<std::string> solution_names(dim, "velocity");
solution_names.emplace_back("p");
solution_names.emplace_back("T");
solution_names.emplace_back("friction_heating");
solution_names.emplace_back("partition");
return solution_names;
}
template <int dim>
std::vector<DataComponentInterpretation::DataComponentInterpretation>
BoussinesqFlowProblem<dim>::Postprocessor::get_data_component_interpretation()
const
{
std::vector<DataComponentInterpretation::DataComponentInterpretation>
interpretation(dim,
DataComponentInterpretation::component_is_part_of_vector);
interpretation.push_back(DataComponentInterpretation::component_is_scalar);
interpretation.push_back(DataComponentInterpretation::component_is_scalar);
interpretation.push_back(DataComponentInterpretation::component_is_scalar);
interpretation.push_back(DataComponentInterpretation::component_is_scalar);
return interpretation;
}
template <int dim>
UpdateFlags
BoussinesqFlowProblem<dim>::Postprocessor::get_needed_update_flags() const
{
return update_values | update_gradients | update_quadrature_points;
}
// 现在我们实现计算派生量的函数。正如我们对输出所做的那样,我们将速度从其SI单位重新调整为更容易阅读的单位,即厘米/年。接下来,压力被缩放为0和最大压力之间。这使得它更容易比较--本质上是使所有的压力变量变成正数或零。温度按原样计算,摩擦热按 $2 \eta \varepsilon(\mathbf{u}) \cdot \varepsilon(\mathbf{u})$ 计算。
// 我们在这里输出的数量更多的是为了说明问题,而不是为了实际的科学价值。我们在本程序的结果部分简要地回到这一点,并解释人们实际上可能感兴趣的是什么。
template <int dim>
void BoussinesqFlowProblem<dim>::Postprocessor::evaluate_vector_field(
const DataPostprocessorInputs::Vector<dim> &inputs,
std::vector<Vector<double>> & computed_quantities) const
{
const unsigned int n_quadrature_points = inputs.solution_values.size();
Assert(inputs.solution_gradients.size() == n_quadrature_points,
ExcInternalError());
Assert(computed_quantities.size() == n_quadrature_points,
ExcInternalError());
Assert(inputs.solution_values[0].size() == dim + 2, ExcInternalError());
for (unsigned int q = 0; q < n_quadrature_points; ++q)
{
for (unsigned int d = 0; d < dim; ++d)
computed_quantities[q](d) = (inputs.solution_values[q](d) *
EquationData::year_in_seconds * 100);
const double pressure =
(inputs.solution_values[q](dim) - minimal_pressure);
computed_quantities[q](dim) = pressure;
const double temperature = inputs.solution_values[q](dim + 1);
computed_quantities[q](dim + 1) = temperature;
Tensor<2, dim> grad_u;
for (unsigned int d = 0; d < dim; ++d)
grad_u[d] = inputs.solution_gradients[q][d];
const SymmetricTensor<2, dim> strain_rate = symmetrize(grad_u);
computed_quantities[q](dim + 2) =
2 * EquationData::eta * strain_rate * strain_rate;
computed_quantities[q](dim + 3) = partition;
}
}
// <code>output_results()</code> 函数的任务与 step-31 中的类似。然而,在这里我们将演示一种不同的技术,即如何合并来自不同DoFHandler对象的输出。我们要实现这种重组的方法是创建一个联合的DoFHandler,收集两个部分,斯托克斯解和温度解。这可以通过将两个系统的有限元结合起来形成一个FES系统来很好地完成,并让这个集体系统定义一个新的DoFHandler对象。为了确保一切都做得很正确,我们进行了一次理智的检查,确保我们从斯托克斯和温度两个系统中得到了所有的道夫,甚至是在组合系统中。然后我们将数据向量合并。不幸的是,没有直接的关系告诉我们如何将斯托克斯和温度矢量分类到联合矢量中。我们可以绕过这个麻烦的方法是依靠FES系统中收集的信息。对于一个单元上的每个dof,联合有限元知道它属于哪个方程分量(速度分量、压力或温度)--这就是我们所需要的信息!这就是我们所需要的。因此,我们通过所有单元(迭代器进入所有三个DoFHandlers同步移动),对于每个联合单元dof,我们使用 FiniteElement::system_to_base_index 函数读出该分量(关于其返回值的各个部分的描述见那里)。我们还需要跟踪我们是在斯托克斯道次还是温度道次,这包含在joint_fe.system_to_base_index(i).first.first中。最终,三个系统中的任何一个系统的dof_indices数据结构都会告诉我们全局矢量和局部dof之间的关系在当前单元上是怎样的,这就结束了这项繁琐的工作。我们确保每个处理器在建立联合求解向量时,只在其本地拥有的子域上工作(而不是在幽灵或人工单元上)。然后在 DataOut::build_patches(), 中也要这样做,但该函数会自动这样做。
// 我们最终得到的是一组补丁,我们可以使用DataOutBase中的函数以各种输出格式编写补丁。在这里,我们必须注意,每个处理器所写的实际上只是它自己领域的一部分,也就是说,我们要把每个处理器的贡献写进一个单独的文件。我们通过在写解决方案时给文件名添加一个额外的数字来做到这一点。这其实并不新鲜,我们在 step-40 中也是这样做的。注意,我们用压缩格式 @p .vtu 而不是普通的vtk文件来写,这样可以节省不少存储空间。
// 所有其余的工作都在后处理程序类中完成。
template <int dim>
void BoussinesqFlowProblem<dim>::output_results()
{
TimerOutput::Scope timer_section(computing_timer, "Postprocessing");
const FESystem<dim> joint_fe(stokes_fe, 1, temperature_fe, 1);
DoFHandler<dim> joint_dof_handler(triangulation);
joint_dof_handler.distribute_dofs(joint_fe);
Assert(joint_dof_handler.n_dofs() ==
stokes_dof_handler.n_dofs() + temperature_dof_handler.n_dofs(),
ExcInternalError());
TrilinosWrappers::MPI::Vector joint_solution;
joint_solution.reinit(joint_dof_handler.locally_owned_dofs(),
MPI_COMM_WORLD);
{
std::vector<types::global_dof_index> local_joint_dof_indices(
joint_fe.n_dofs_per_cell());
std::vector<types::global_dof_index> local_stokes_dof_indices(
stokes_fe.n_dofs_per_cell());
std::vector<types::global_dof_index> local_temperature_dof_indices(
temperature_fe.n_dofs_per_cell());
typename DoFHandler<dim>::active_cell_iterator
joint_cell = joint_dof_handler.begin_active(),
joint_endc = joint_dof_handler.end(),
stokes_cell = stokes_dof_handler.begin_active(),
temperature_cell = temperature_dof_handler.begin_active();
for (; joint_cell != joint_endc;
++joint_cell, ++stokes_cell, ++temperature_cell)
if (joint_cell->is_locally_owned())
{
joint_cell->get_dof_indices(local_joint_dof_indices);
stokes_cell->get_dof_indices(local_stokes_dof_indices);
temperature_cell->get_dof_indices(local_temperature_dof_indices);
for (unsigned int i = 0; i < joint_fe.n_dofs_per_cell(); ++i)
if (joint_fe.system_to_base_index(i).first.first == 0)
{
Assert(joint_fe.system_to_base_index(i).second <
local_stokes_dof_indices.size(),
ExcInternalError());
joint_solution(local_joint_dof_indices[i]) = stokes_solution(
local_stokes_dof_indices[joint_fe.system_to_base_index(i)
.second]);
}
else
{
Assert(joint_fe.system_to_base_index(i).first.first == 1,
ExcInternalError());
Assert(joint_fe.system_to_base_index(i).second <
local_temperature_dof_indices.size(),
ExcInternalError());
joint_solution(local_joint_dof_indices[i]) =
temperature_solution(
local_temperature_dof_indices
[joint_fe.system_to_base_index(i).second]);
}
}
}
joint_solution.compress(VectorOperation::insert);
IndexSet locally_relevant_joint_dofs(joint_dof_handler.n_dofs());
DoFTools::extract_locally_relevant_dofs(joint_dof_handler,
locally_relevant_joint_dofs);
TrilinosWrappers::MPI::Vector locally_relevant_joint_solution;
locally_relevant_joint_solution.reinit(locally_relevant_joint_dofs,
MPI_COMM_WORLD);
locally_relevant_joint_solution = joint_solution;
Postprocessor postprocessor(Utilities::MPI::this_mpi_process(
MPI_COMM_WORLD),
stokes_solution.block(1).min());
DataOut<dim> data_out;
data_out.attach_dof_handler(joint_dof_handler);
data_out.add_data_vector(locally_relevant_joint_solution, postprocessor);
data_out.build_patches();
static int out_index = 0;
data_out.write_vtu_with_pvtu_record(
"./", "solution", out_index, MPI_COMM_WORLD, 5);
out_index++;
}
// @sect4{BoussinesqFlowProblem::refine_mesh}
// 这个函数也不是真正的新函数。因为我们在中间调用的 <code>setup_dofs</code> 函数有自己的定时器部分,所以我们把这个函数的定时分成两部分。这也可以让我们很容易地识别出这两个中哪个更昂贵。
//但是,
//有一点需要注意的是,我们只想在本地拥有的子域上计算错误指标。为了达到这个目的,我们向 KellyErrorEstimator::estimate 函数传递一个额外的参数。请注意,用于误差估计的向量被调整为当前进程上存在的活动单元的数量,它小于所有处理器上活动单元的总数(但大于本地拥有的活动单元的数量);每个处理器只有本地拥有的单元周围有一些粗略的单元,这在 step-40 中也有解释。
// 本地误差估计值然后被交给GridRefinement的%并行版本(在命名空间 parallel::distributed::GridRefinement, 中,也见 step-40 ),它查看误差并通过比较各处理器的误差值找到需要细化的单元。正如在 step-31 中,我们希望限制最大的网格级别。因此,万一有些单元格已经被标记为最精细的级别,我们只需清除细化标志。
template <int dim>
void
BoussinesqFlowProblem<dim>::refine_mesh(const unsigned int max_grid_level)
{
parallel::distributed::SolutionTransfer<dim, TrilinosWrappers::MPI::Vector>
temperature_trans(temperature_dof_handler);
parallel::distributed::SolutionTransfer<dim,
TrilinosWrappers::MPI::BlockVector>
stokes_trans(stokes_dof_handler);
{
TimerOutput::Scope timer_section(computing_timer,
"Refine mesh structure, part 1");
Vector<float> estimated_error_per_cell(triangulation.n_active_cells());
KellyErrorEstimator<dim>::estimate(
temperature_dof_handler,
QGauss<dim - 1>(parameters.temperature_degree + 1),
std::map<types::boundary_id, const Function<dim> *>(),
temperature_solution,
estimated_error_per_cell,
ComponentMask(),
nullptr,
0,
triangulation.locally_owned_subdomain());
parallel::distributed::GridRefinement::refine_and_coarsen_fixed_fraction(
triangulation, estimated_error_per_cell, 0.3, 0.1);
if (triangulation.n_levels() > max_grid_level)
for (typename Triangulation<dim>::active_cell_iterator cell =
triangulation.begin_active(max_grid_level);
cell != triangulation.end();
++cell)
cell->clear_refine_flag();
// 有了所有的标记,我们就可以告诉 parallel::distributed::SolutionTransfer 对象准备将数据从一个网格转移到下一个网格,当Triangulation作为 @p execute_coarsening_and_refinement() 调用的一部分通知他们时,他们就会这样做。语法类似于非%并行解决方案的传输(例外的是这里有一个指向向量项的指针就足够了)。下面函数的其余部分是在网格细化后再次设置数据结构,并在新的网格上恢复求解向量。
std::vector<const TrilinosWrappers::MPI::Vector *> x_temperature(2);
x_temperature[0] = &temperature_solution;
x_temperature[1] = &old_temperature_solution;
std::vector<const TrilinosWrappers::MPI::BlockVector *> x_stokes(2);
x_stokes[0] = &stokes_solution;
x_stokes[1] = &old_stokes_solution;
triangulation.prepare_coarsening_and_refinement();
temperature_trans.prepare_for_coarsening_and_refinement(x_temperature);
stokes_trans.prepare_for_coarsening_and_refinement(x_stokes);
triangulation.execute_coarsening_and_refinement();
}
setup_dofs();
{
TimerOutput::Scope timer_section(computing_timer,
"Refine mesh structure, part 2");
{
TrilinosWrappers::MPI::Vector distributed_temp1(temperature_rhs);
TrilinosWrappers::MPI::Vector distributed_temp2(temperature_rhs);
std::vector<TrilinosWrappers::MPI::Vector *> tmp(2);
tmp[0] = &(distributed_temp1);
tmp[1] = &(distributed_temp2);
temperature_trans.interpolate(tmp);
// 强制执行约束条件,使插值后的解决方案在新的网格上符合要求。
temperature_constraints.distribute(distributed_temp1);
temperature_constraints.distribute(distributed_temp2);
temperature_solution = distributed_temp1;
old_temperature_solution = distributed_temp2;
}
{
TrilinosWrappers::MPI::BlockVector distributed_stokes(stokes_rhs);
TrilinosWrappers::MPI::BlockVector old_distributed_stokes(stokes_rhs);
std::vector<TrilinosWrappers::MPI::BlockVector *> stokes_tmp(2);
stokes_tmp[0] = &(distributed_stokes);
stokes_tmp[1] = &(old_distributed_stokes);
stokes_trans.interpolate(stokes_tmp);
// 强制执行约束条件,使插值后的解决方案在新的网格上符合要求。
stokes_constraints.distribute(distributed_stokes);
stokes_constraints.distribute(old_distributed_stokes);
stokes_solution = distributed_stokes;
old_stokes_solution = old_distributed_stokes;
}
}
}
// @sect4{BoussinesqFlowProblem::run}
// 这是这个类中的最后一个控制函数。事实上,它运行了整个程序的其余部分,并且再次与 step-31 非常相似。唯一的实质性区别是我们现在使用了一个不同的网格(一个 GridGenerator::hyper_shell 而不是一个简单的立方体几何)。
template <int dim>
void BoussinesqFlowProblem<dim>::run()
{
GridGenerator::hyper_shell(triangulation,
Point<dim>(),
EquationData::R0,
EquationData::R1,
(dim == 3) ? 96 : 12,
true);
global_Omega_diameter = GridTools::diameter(triangulation);
triangulation.refine_global(parameters.initial_global_refinement);
setup_dofs();
unsigned int pre_refinement_step = 0;
start_time_iteration:
{
TrilinosWrappers::MPI::Vector solution(
temperature_dof_handler.locally_owned_dofs());
// VectorTools::project 通过deal.II自己的本地MatrixFree框架支持具有大多数标准有限元素的并行矢量类:由于我们使用中等阶数的标准拉格朗日元素,这个函数在这里工作得很好。
VectorTools::project(temperature_dof_handler,
temperature_constraints,
QGauss<dim>(parameters.temperature_degree + 2),
EquationData::TemperatureInitialValues<dim>(),
solution);
// 在如此计算了当前的温度字段之后,让我们设置保存温度节点的成员变量。严格来说,我们真的只需要设置 <code>old_temperature_solution</code> ,因为我们要做的第一件事是计算斯托克斯解,它只需要前一个时间步长的温度场。尽管如此,如果我们想扩展我们的数值方法或物理模型,不初始化其他的向量也不会有什么好处(特别是这是一个相对便宜的操作,我们只需要在程序开始时做一次),所以我们也初始化 <code>old_temperature_solution</code> 和 <code>old_old_temperature_solution</code> 。这个赋值确保了左边的向量(初始化后也包含鬼魂元素)也得到了正确的鬼魂元素。换句话说,这里的赋值需要处理器之间的通信。
temperature_solution = solution;
old_temperature_solution = solution;
old_old_temperature_solution = solution;
}
timestep_number = 0;
time_step = old_time_step = 0;
double time = 0;
do
{
pcout << "Timestep " << timestep_number
<< ": t=" << time / EquationData::year_in_seconds << " years"
<< std::endl;
assemble_stokes_system();
build_stokes_preconditioner();
assemble_temperature_matrix();
solve();
pcout << std::endl;
if ((timestep_number == 0) &&
(pre_refinement_step < parameters.initial_adaptive_refinement))
{
refine_mesh(parameters.initial_global_refinement +
parameters.initial_adaptive_refinement);
++pre_refinement_step;
goto start_time_iteration;
}
else if ((timestep_number > 0) &&
(timestep_number % parameters.adaptive_refinement_interval ==
0))
refine_mesh(parameters.initial_global_refinement +
parameters.initial_adaptive_refinement);
if ((parameters.generate_graphical_output == true) &&
(timestep_number % parameters.graphical_output_interval == 0))
output_results();
// 为了加快线性求解器的速度,我们从旧的时间水平上推断出新的解决方案。这可以提供一个非常好的初始猜测,使求解器所需的迭代次数减少一半以上。我们不需要在最后一次迭代中进行推断,所以如果我们达到了最后的时间,我们就在这里停止。
// 作为一个时间步长的最后一件事(在实际提高时间步长之前),我们检查当前的时间步长是否被100整除,如果是的话,我们让计算计时器打印一个到目前为止所花费的CPU时间的总结。
if (time > parameters.end_time * EquationData::year_in_seconds)
break;
TrilinosWrappers::MPI::BlockVector old_old_stokes_solution;
old_old_stokes_solution = old_stokes_solution;
old_stokes_solution = stokes_solution;
old_old_temperature_solution = old_temperature_solution;
old_temperature_solution = temperature_solution;
if (old_time_step > 0)
{
// Trilinos sadd不喜欢鬼魂向量,即使作为输入。暂时复制到分布式向量中。
{
TrilinosWrappers::MPI::BlockVector distr_solution(stokes_rhs);
distr_solution = stokes_solution;
TrilinosWrappers::MPI::BlockVector distr_old_solution(stokes_rhs);
distr_old_solution = old_old_stokes_solution;
distr_solution.sadd(1. + time_step / old_time_step,
-time_step / old_time_step,
distr_old_solution);
stokes_solution = distr_solution;
}
{
TrilinosWrappers::MPI::Vector distr_solution(temperature_rhs);
distr_solution = temperature_solution;
TrilinosWrappers::MPI::Vector distr_old_solution(temperature_rhs);
distr_old_solution = old_old_temperature_solution;
distr_solution.sadd(1. + time_step / old_time_step,
-time_step / old_time_step,
distr_old_solution);
temperature_solution = distr_solution;
}
}
if ((timestep_number > 0) && (timestep_number % 100 == 0))
computing_timer.print_summary();
time += time_step;
++timestep_number;
}
while (true);
// 如果我们要生成图形输出,也要对最后一个时间步骤这样做,除非我们在离开do-while循环之前刚刚这样做。
if ((parameters.generate_graphical_output == true) &&
!((timestep_number - 1) % parameters.graphical_output_interval == 0))
output_results();
}
} // namespace Step32
// @sect3{The <code>main</code> function}
// 主函数像往常一样简短,与 step-31 中的函数非常相似。由于我们使用了一个参数文件,该文件在命令行中被指定为参数,所以我们必须在这里读取它,并将其传递给参数类进行解析。如果命令行中没有给出文件名,我们就简单地使用与程序一起分发的 <code>\step-32.prm</code> 文件。
// 由于三维计算非常缓慢,除非你投入大量的处理器,程序默认为二维。你可以通过把下面的常数维度改为3来获得三维版本。
int main(int argc, char *argv[])
{
try
{
using namespace Step32;
using namespace dealii;
Utilities::MPI::MPI_InitFinalize mpi_initialization(
argc, argv, numbers::invalid_unsigned_int);
std::string parameter_filename;
if (argc >= 2)
parameter_filename = argv[1];
else
parameter_filename = "step-32.prm";
const int dim = 2;
BoussinesqFlowProblem<dim>::Parameters parameters(parameter_filename);
BoussinesqFlowProblem<dim> flow_problem(parameters);
flow_problem.run();
}
catch (std::exception &exc)
{
std::cerr << std::endl
<< std::endl
<< "----------------------------------------------------"
<< std::endl;
std::cerr << "Exception on processing: " << std::endl
<< exc.what() << std::endl
<< "Aborting!" << std::endl
<< "----------------------------------------------------"
<< std::endl;
return 1;
}
catch (...)
{
std::cerr << std::endl
<< std::endl
<< "----------------------------------------------------"
<< std::endl;
std::cerr << "Unknown exception!" << std::endl
<< "Aborting!" << std::endl
<< "----------------------------------------------------"
<< std::endl;
return 1;
}
return 0;
}
| 42.315059 | 776 | 0.639662 | jiaqiwang969 |
48f65f0e6699a515f68b054415877b7325865330 | 2,169 | cpp | C++ | RowOperation.cpp | spencerparkin/MatrixMath | 3fb3c95e4948e5a37912ee098176598d46ab6759 | [
"MIT"
] | null | null | null | RowOperation.cpp | spencerparkin/MatrixMath | 3fb3c95e4948e5a37912ee098176598d46ab6759 | [
"MIT"
] | null | null | null | RowOperation.cpp | spencerparkin/MatrixMath | 3fb3c95e4948e5a37912ee098176598d46ab6759 | [
"MIT"
] | null | null | null | // RowOperation.cpp
#include "RowOperation.h"
#include "Element.h"
#include "Matrix.h"
void MatrixMath::DeleteRowOperationList( RowOperationList& rowOperationList )
{
while( rowOperationList.size() > 0 )
{
RowOperationList::iterator iter = rowOperationList.begin();
RowOperation* rowOperation = *iter;
delete rowOperation;
rowOperationList.erase( iter );
}
}
MatrixMath::RowOperation::RowOperation( void )
{
}
/*virtual*/ MatrixMath::RowOperation::~RowOperation( void )
{
}
MatrixMath::RowSwap::RowSwap( int rowA, int rowB )
{
this->rowA = rowA;
this->rowB = rowB;
}
/*virtual*/ MatrixMath::RowSwap::~RowSwap( void )
{
}
/*virtual*/ bool MatrixMath::RowSwap::Apply( Matrix& matrix ) const
{
if( !matrix.HasRow( rowA ) || !matrix.HasRow( rowB ) )
return false;
for( int j = 0; j < matrix.GetCols(); j++ )
{
Element* element = matrix.elementArray[rowA][j];
matrix.elementArray[rowA][j] = matrix.elementArray[rowB][j];
matrix.elementArray[rowB][j] = element;
}
return true;
}
MatrixMath::RowScale::RowScale( int row, Element* scale )
{
this->row = row;
this->scale = scale;
}
/*virtual*/ MatrixMath::RowScale::~RowScale( void )
{
GetElementFactory()->Destroy( scale );
}
/*virtual*/ bool MatrixMath::RowScale::Apply( Matrix& matrix ) const
{
if( !matrix.HasRow( row ) )
return false;
for( int j = 0; j < matrix.GetCols(); j++ )
matrix.GetElement( row, j )->Scale( scale );
return true;
}
MatrixMath::RowMultipleAddToRow::RowMultipleAddToRow( int rowA, int rowB, Element* scale )
{
this->rowA = rowA;
this->rowB = rowB;
this->scale = scale;
}
/*virtual*/ MatrixMath::RowMultipleAddToRow::~RowMultipleAddToRow( void )
{
GetElementFactory()->Destroy( scale );
}
/*virtual*/ bool MatrixMath::RowMultipleAddToRow::Apply( Matrix& matrix ) const
{
if( !matrix.HasRow( rowA ) || !matrix.HasRow( rowB ) )
return false;
Element* product = GetElementFactory()->Create();
for( int j = 0; j < matrix.GetCols(); j++ )
{
product->SetProduct( matrix.GetElement( rowB, j ), scale );
matrix.GetElement( rowA, j )->Accumulate( product );
}
GetElementFactory()->Destroy( product );
return true;
};
// RowOperation.cpp | 21.058252 | 90 | 0.681881 | spencerparkin |
48f824644beec0164416cd3e0b96bef31a14d756 | 158 | cpp | C++ | notebooks/funcs1.cpp | itachi4869/sta-663-2021 | 6f7a50f4a95207a26b01afa4439d992d767a1387 | [
"MIT"
] | null | null | null | notebooks/funcs1.cpp | itachi4869/sta-663-2021 | 6f7a50f4a95207a26b01afa4439d992d767a1387 | [
"MIT"
] | null | null | null | notebooks/funcs1.cpp | itachi4869/sta-663-2021 | 6f7a50f4a95207a26b01afa4439d992d767a1387 | [
"MIT"
] | null | null | null | #include <pybind11/pybind11.h>
namespace py = pybind11;
int add(int a, int b) {
return a + b;
}
void init_f1(py::module &m) {
m.def("add", &add);
}
| 14.363636 | 30 | 0.601266 | itachi4869 |
48f9e695830e4fcebacbfa114da02000578d9f94 | 2,818 | cpp | C++ | src/Pauli_Matrix.cpp | nicksacco17/QPU | 29949a6dfe6a43673413925908440138862a3050 | [
"MIT"
] | null | null | null | src/Pauli_Matrix.cpp | nicksacco17/QPU | 29949a6dfe6a43673413925908440138862a3050 | [
"MIT"
] | null | null | null | src/Pauli_Matrix.cpp | nicksacco17/QPU | 29949a6dfe6a43673413925908440138862a3050 | [
"MIT"
] | null | null | null |
#include <iostream>
#include <iomanip>
#include "../include/Pauli_Matrix.h"
using std::cout;
using std::endl;
using namespace std::complex_literals;
Pauli_Matrix::Pauli_Matrix(string pauli_type)
{
// Pauli-X Matrix
// | 0 1 |
// | 1 0 |
if (pauli_type == "X" || pauli_type == "x")
{
m_num_row = 2;
m_num_col = 2;
m_trace = 0.0;
m_determinant = -1;
m_name = "Pauli-X";
m_mat = { 0, 1, 1, 0 };
}
// Pauli-Y Matrix
// | 0 -1i |
// | 1i 0 |
else if (pauli_type == "Y" || pauli_type == "y")
{
m_num_row = 2;
m_num_col = 2;
m_trace = 0.0;
m_determinant = -1;
m_name = "Pauli-Y";
m_mat = { 0, -1i, 1i, 0 };
}
// Pauli-Z Matrix
// | 1 0 |
// | 0 -1 |
else if (pauli_type == "Z" || pauli_type == "z")
{
m_num_row = 2;
m_num_col = 2;
m_trace = 0.0;
m_determinant = -1;
m_name = "Pauli-Z";
m_mat = { 1, 0, 0, -1 };
}
// Identity-N matrix (N x N)
// EX: I4 = | 1 0 0 0 |
// | 0 1 0 0 |
// | 0 0 1 0 |
// | 0 0 0 1 |
else if (pauli_type.at(0) == 'I' || pauli_type.at(0) == 'i')
{
// Convert the remaining part of the input string to an integer and use as dimenson of Identity
unsigned int size = stoi(pauli_type.substr(1));
m_num_row = size;
m_num_col = size;
m_trace = size;
m_determinant = 1;
m_name = "Identity-" + pauli_type.substr(1);
m_mat.clear();
for (unsigned int i = 0; i < size; i++)
{
vector<complex<double>> row(size, 0.0);
row.at(i) = 1;
m_mat.insert(m_mat.end(), row.begin(), row.end());
}
}
// Else invalid Pauli matrix, so just create I2
else
{
m_num_row = 2;
m_num_col = 2;
m_trace = 2;
m_mat = { 1, 0, 1, 0 };
}
}
Pauli_Matrix::~Pauli_Matrix()
{
m_mat.clear();
}
bool Pauli_Matrix::is_square()
{
return true;
}
bool Pauli_Matrix::is_Hermitian()
{
return true;
}
bool Pauli_Matrix::is_Unitary()
{
return true;
}
void Pauli_Matrix::print()
{
cout << "---------- PRINT PAULI MATRIX ----------" << endl;
cout << "NAME: " << m_name << endl;
cout << "DIMENSION: (" << m_num_row << " x " << m_num_col << ")" << endl;
cout << "TRACE: " << m_trace << endl;
cout << "DETERMINANT: " << m_determinant << endl;
cout << "SQUARE: " << std::boolalpha << is_square() << endl;
cout << "HERMITIAN: " << std::boolalpha << is_Hermitian() << endl;
cout << "UNITARY: " << std::boolalpha << is_Unitary() << endl;
cout << "ELEMENTS:\n" << endl;
vector<vector<complex<double>>>::const_iterator row_it;
vector<complex<double>>::const_iterator col_it;
for (unsigned int i = 0; i < m_num_row; i++)
{
cout << "| ";
for (unsigned int j = 0; j < m_num_col; j++)
{
cout << std::setw(8) << std::setfill(' ') << std::setprecision(6) << std::fixed << m_mat.at(RC_TO_INDEX(i, j, m_num_col));
}
cout << "|" << endl;
}
cout << "\n---------- PRINT PAULI MATRIX ----------" << endl;
} | 20.273381 | 125 | 0.565649 | nicksacco17 |
48fdcaa20efb0e9c90e88e2295002da29f9a7ade | 1,838 | cc | C++ | pw_thread_threadx/sleep.cc | antmicro/pigweed | a308c3354a6131425e3f484f07f05a1813948860 | [
"Apache-2.0"
] | null | null | null | pw_thread_threadx/sleep.cc | antmicro/pigweed | a308c3354a6131425e3f484f07f05a1813948860 | [
"Apache-2.0"
] | null | null | null | pw_thread_threadx/sleep.cc | antmicro/pigweed | a308c3354a6131425e3f484f07f05a1813948860 | [
"Apache-2.0"
] | null | null | null | // Copyright 2020 The Pigweed 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
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
// License for the specific language governing permissions and limitations under
// the License.
#include "pw_thread/sleep.h"
#include <algorithm>
#include "pw_assert/assert.h"
#include "pw_chrono/system_clock.h"
#include "pw_chrono_threadx/system_clock_constants.h"
#include "pw_thread/id.h"
#include "tx_api.h"
using pw::chrono::threadx::kMaxTimeout;
namespace pw::this_thread {
void sleep_for(chrono::SystemClock::duration for_at_least) {
PW_DCHECK(get_id() != thread::Id());
// Clamp negative durations to be 0 which maps to non-blocking.
for_at_least = std::max(for_at_least, chrono::SystemClock::duration::zero());
// The pw::sleep_{for,until} API contract is to yield if we attempt to sleep
// for a duration of 0. ThreadX's tx_thread_sleep does a no-op if 0 is passed,
// ergo we explicitly check for the yield condition if the duration is 0.
if (for_at_least == chrono::SystemClock::duration::zero()) {
tx_thread_relinquish(); // Direct API is used to reduce overhead.
return;
}
while (for_at_least > kMaxTimeout) {
const UINT result = tx_thread_sleep(kMaxTimeout.count());
PW_CHECK_UINT_EQ(TX_SUCCESS, result);
for_at_least -= kMaxTimeout;
}
const UINT result = tx_thread_sleep(for_at_least.count());
PW_CHECK_UINT_EQ(TX_SUCCESS, result);
}
} // namespace pw::this_thread
| 34.679245 | 80 | 0.736126 | antmicro |
5b01e9f8a7ecf5aa9af4bd4b721f5a604bf0f518 | 1,343 | cpp | C++ | Vic2ToHoI4Tests/HoI4WorldTests/Regions/RegionsTests.cpp | CarbonY26/Vic2ToHoI4 | af3684d6aaaafea81aaadfb64a21a2b696f618e1 | [
"MIT"
] | 25 | 2018-12-10T03:41:49.000Z | 2021-10-04T10:42:36.000Z | Vic2ToHoI4Tests/HoI4WorldTests/Regions/RegionsTests.cpp | CarbonY26/Vic2ToHoI4 | af3684d6aaaafea81aaadfb64a21a2b696f618e1 | [
"MIT"
] | 739 | 2018-12-13T02:01:20.000Z | 2022-03-28T02:57:13.000Z | Vic2ToHoI4Tests/HoI4WorldTests/Regions/RegionsTests.cpp | IhateTrains/Vic2ToHoI4 | 5ad7f7c259f7495a10e043ade052d3b18a8951dc | [
"MIT"
] | 43 | 2018-12-10T03:41:58.000Z | 2022-03-22T23:55:41.000Z | #include "HOI4World/Regions/Regions.h"
#include "HOI4World/Regions/RegionsFactory.h"
#include "gtest/gtest.h"
TEST(HoI4World_Regions_RegionsTests, ProvinceInUnmappedRegionsReturnsNullptr)
{
const auto regions = HoI4::Regions::Factory().getRegions();
EXPECT_EQ(std::nullopt, regions->getRegion(0));
}
TEST(HoI4World_Regions_RegionsTests, ProvinceInMappedRegionsReturnsRegion)
{
const auto regions = HoI4::Regions::Factory().getRegions();
EXPECT_EQ("test_region", regions->getRegion(42));
}
TEST(HoI4World_Regions_RegionsTests, NameInUnmappedRegionReturnsNullopt)
{
const auto regions = HoI4::Regions::Factory().getRegions();
EXPECT_EQ(std::nullopt, regions->getRegionName("missing_region"));
}
TEST(HoI4World_Regions_RegionsTests, NameInMappedRegionReturnsName)
{
const auto regions = HoI4::Regions::Factory().getRegions();
EXPECT_EQ("Test Region", regions->getRegionName("test_region"));
}
TEST(HoI4World_Regions_RegionsTests, AdjectiveInUnmappedRegionReturnsNullopt)
{
const auto regions = HoI4::Regions::Factory().getRegions();
EXPECT_EQ(std::nullopt, regions->getRegionName("missing_region"));
}
TEST(HoI4World_Regions_RegionsTests, AdjectiveInMappedRegionReturnsAdjective)
{
const auto regions = HoI4::Regions::Factory().getRegions();
EXPECT_EQ("Test Regional", regions->getRegionAdjective("test_region"));
} | 25.826923 | 77 | 0.787789 | CarbonY26 |
5b090d1d235ea99090453fb502d25c409a36e385 | 437 | cpp | C++ | src/ooni/tcp_connect.cpp | alessandro40/libight | de434be18791844076603b50167c436a768e830e | [
"BSD-2-Clause"
] | null | null | null | src/ooni/tcp_connect.cpp | alessandro40/libight | de434be18791844076603b50167c436a768e830e | [
"BSD-2-Clause"
] | null | null | null | src/ooni/tcp_connect.cpp | alessandro40/libight | de434be18791844076603b50167c436a768e830e | [
"BSD-2-Clause"
] | null | null | null | #include <ight/ooni/tcp_connect.hpp>
using namespace ight::common::settings;
using namespace ight::ooni::tcp_connect;
void
TCPConnect::main(std::string input, Settings options,
std::function<void(ReportEntry)>&& cb)
{
options["host"] = input;
have_entry = cb;
client = connect(options, [this]() {
logger->debug("tcp_connect: Got response to TCP connect test");
have_entry(entry);
});
}
| 25.705882 | 71 | 0.652174 | alessandro40 |
5b0b2b772b7a54dc8872b0c5c97e82516bea0976 | 6,858 | cpp | C++ | extras/usd/examples/usdDancingCubesExample/fileFormat.cpp | chen2qu/USD | 2bbedce05f61f37e7461b0319609f9ceeb91725e | [
"AML"
] | 88 | 2018-07-13T01:22:00.000Z | 2022-01-16T22:15:27.000Z | extras/usd/examples/usdDancingCubesExample/fileFormat.cpp | chen2qu/USD | 2bbedce05f61f37e7461b0319609f9ceeb91725e | [
"AML"
] | 1 | 2022-01-14T21:25:56.000Z | 2022-01-14T21:25:56.000Z | extras/usd/examples/usdDancingCubesExample/fileFormat.cpp | chen2qu/USD | 2bbedce05f61f37e7461b0319609f9ceeb91725e | [
"AML"
] | 26 | 2018-06-06T03:39:22.000Z | 2021-08-28T23:02:42.000Z | //
// Copyright 2019 Pixar
//
// Licensed under the Apache License, Version 2.0 (the "Apache License")
// with the following modification; you may not use this file except in
// compliance with the Apache License and the following modification to it:
// Section 6. Trademarks. is deleted and replaced with:
//
// 6. Trademarks. This License does not grant permission to use the trade
// names, trademarks, service marks, or product names of the Licensor
// and its affiliates, except as required to comply with Section 4(c) of
// the License and to reproduce the content of the NOTICE file.
//
// You may obtain a copy of the Apache License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the Apache License with the above modification is
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the Apache License for the specific
// language governing permissions and limitations under the Apache License.
//
#include "pxr/pxr.h"
#include "data.h"
#include "fileFormat.h"
#include "pxr/usd/pcp/dynamicFileFormatContext.h"
#include "pxr/usd/usd/usdaFileFormat.h"
#include <fstream>
#include <string>
PXR_NAMESPACE_OPEN_SCOPE
TF_DEFINE_PUBLIC_TOKENS(
UsdDancingCubesExampleFileFormatTokens,
USD_DANCING_CUBES_EXAMPLE_FILE_FORMAT_TOKENS);
TF_REGISTRY_FUNCTION(TfType)
{
SDF_DEFINE_FILE_FORMAT(UsdDancingCubesExampleFileFormat, SdfFileFormat);
}
UsdDancingCubesExampleFileFormat::UsdDancingCubesExampleFileFormat()
: SdfFileFormat(
UsdDancingCubesExampleFileFormatTokens->Id,
UsdDancingCubesExampleFileFormatTokens->Version,
UsdDancingCubesExampleFileFormatTokens->Target,
UsdDancingCubesExampleFileFormatTokens->Extension)
{
}
UsdDancingCubesExampleFileFormat::~UsdDancingCubesExampleFileFormat()
{
}
bool
UsdDancingCubesExampleFileFormat::CanRead(const std::string& filePath) const
{
return true;
}
SdfAbstractDataRefPtr
UsdDancingCubesExampleFileFormat::InitData(
const FileFormatArguments &args) const
{
// Create our special procedural abstract data with its parameters extracted
// from the file format arguments.
return UsdDancingCubesExample_Data::New(
UsdDancingCubesExample_DataParams::FromArgs(args));
}
bool
UsdDancingCubesExampleFileFormat::Read(
SdfLayer *layer,
const std::string &resolvedPath,
bool metadataOnly) const
{
if (!TF_VERIFY(layer)) {
return false;
}
// Enforce that the layer is read only.
layer->SetPermissionToSave(false);
layer->SetPermissionToEdit(false);
// We don't do anything else when we read the file as the contents aren't
// used at all in this example. There layer's data has already been
// initialized from file format arguments.
return true;
}
bool
UsdDancingCubesExampleFileFormat::WriteToString(
const SdfLayer &layer,
std::string *str,
const std::string &comment) const
{
// Write the generated contents in usda text format.
return SdfFileFormat::FindById(
UsdUsdaFileFormatTokens->Id)->WriteToString(layer, str, comment);
}
bool
UsdDancingCubesExampleFileFormat::WriteToStream(
const SdfSpecHandle &spec,
std::ostream &out,
size_t indent) const
{
// Write the generated contents in usda text format.
return SdfFileFormat::FindById(
UsdUsdaFileFormatTokens->Id)->WriteToStream(spec, out, indent);
}
void
UsdDancingCubesExampleFileFormat::ComposeFieldsForFileFormatArguments(
const std::string &assetPath,
const PcpDynamicFileFormatContext &context,
FileFormatArguments *args,
VtValue *contextDependencyData) const
{
UsdDancingCubesExample_DataParams params;
// There is one relevant metadata field that should be dictionary valued.
// Compose this field's value and extract any param values from the
// resulting dictionary.
VtValue val;
if (context.ComposeValue(UsdDancingCubesExampleFileFormatTokens->Params, &val) &&
val.IsHolding<VtDictionary>()) {
params = UsdDancingCubesExample_DataParams::FromDict(
val.UncheckedGet<VtDictionary>());
}
// Convert the entire params object to file format arguments. We always
// convert all parameters even if they're default as the args are part of
// the identity of the layer.
*args = params.ToArgs();
}
bool
UsdDancingCubesExampleFileFormat::CanFieldChangeAffectFileFormatArguments(
const TfToken &field,
const VtValue &oldValue,
const VtValue &newValue,
const VtValue &contextDependencyData) const
{
// Theres only one relevant field and its values should hold a dictionary.
const VtDictionary &oldDict = oldValue.IsHolding<VtDictionary>() ?
oldValue.UncheckedGet<VtDictionary>() : VtGetEmptyDictionary();
const VtDictionary &newDict = newValue.IsHolding<VtDictionary>() ?
newValue.UncheckedGet<VtDictionary>() : VtGetEmptyDictionary();
// The dictionary values for our metadata key are not restricted as to what
// they may contain so it's possible they may have keys that are completely
// irrelevant to generating the this file format's parameters. Here we're
// demonstrating how we can do a more fine grained analysis based on this
// fact. In some cases this can provide a better experience for users if
// the extra processing in this function can prevent expensive prim
// recompositions for changes that don't require it. But keep in mind that
// there can easily be cases where making this function more expensive can
// outweigh the benefits of avoiding unnecessary recompositions.
// Compare relevant values in the old and new dictionaries.
// If both the old and new dictionaries are empty, there's no change.
if (oldDict.empty() && newDict.empty()) {
return false;
}
// Otherwise we iterate through each possible parameter value looking for
// any one that has a value change between the two dictionaries.
for (const TfToken &token : UsdDancingCubesExample_DataParamsTokens->allTokens) {
auto oldIt = oldDict.find(token);
auto newIt = newDict.find(token);
const bool oldValExists = oldIt == oldDict.end();
const bool newValExists = newIt == newDict.end();
// If param value exists in one or not the other, we have change.
if (oldValExists != newValExists) {
return true;
}
// Otherwise if it's both and the value differs, we also have a change.
if (newValExists && oldIt->second != newIt->second) {
return true;
}
}
// None of the relevant data params changed between the two dictionaries.
return false;
}
PXR_NAMESPACE_CLOSE_SCOPE
| 34.989796 | 86 | 0.729805 | chen2qu |
5b0bc75ab024c51e45cbebf36350bfb7371fa7f8 | 1,110 | cpp | C++ | 5. Longest Palindromic Substring/main.cpp | majianfei/leetcode | d79ad7dd8c07e9f816b5727d1d98eb55c719cb6d | [
"MIT"
] | null | null | null | 5. Longest Palindromic Substring/main.cpp | majianfei/leetcode | d79ad7dd8c07e9f816b5727d1d98eb55c719cb6d | [
"MIT"
] | null | null | null | 5. Longest Palindromic Substring/main.cpp | majianfei/leetcode | d79ad7dd8c07e9f816b5727d1d98eb55c719cb6d | [
"MIT"
] | null | null | null | #include <iostream>
//TODO,优化
/**
* Runtime: 200 ms, faster than 24.74% of C++ online submissions for Longest Palindromic Substring.
* Memory Usage: 186.7 MB, less than 8.03% of C++ online submissions for Longest Palindromic Substring.
*/
class Solution {
public:
string longestPalindrome(string s) {
int size = s.size();
if (size <= 1)return s;
int max_num = 1,start=0,end=0;
vector<vector<int>> dp(size,vector<int>(size,0));
for (int i = size - 1; i >= 0; i--){
dp[i][i] = 1;
for (int j = i+1; j <size; j++){
if (s[i] == s[j]){
if (j - i <= 1)dp[i][j] = 2;
else dp[i][j] = dp[i+1][j-1]==0?0:dp[i+1][j-1]+2;
}
else{
dp[i][j] = 0;
}
if (max_num < dp[i][j]){
start = i;
end = j;
max_num = dp[i][j];
}
}
}
return s.substr(start, end-start+1);
}
}; | 30.833333 | 104 | 0.405405 | majianfei |
5b0d1239ad6bc344a9de0962a281c2bd72ab450d | 34,960 | cpp | C++ | tester_src/mockgenSampleTestBody.cpp | zettsu-t/cppMockgen | 4e33e904f50beeb90388c533e9bb21890d68d26e | [
"BSD-3-Clause"
] | null | null | null | tester_src/mockgenSampleTestBody.cpp | zettsu-t/cppMockgen | 4e33e904f50beeb90388c533e9bb21890d68d26e | [
"BSD-3-Clause"
] | null | null | null | tester_src/mockgenSampleTestBody.cpp | zettsu-t/cppMockgen | 4e33e904f50beeb90388c533e9bb21890d68d26e | [
"BSD-3-Clause"
] | null | null | null | // Declare forwarders
#include "varDecl_mockgenSample1.hpp"
// Swap class names used later to their decorator
#include "typeSwapper_mockgenSample1.hpp"
#include "mockgenSample2.hpp"
#include "mockgenTesterUtility.hpp"
#include <gtest/gtest.h>
using namespace MyUnittest;
using namespace Sample1;
using namespace Sample1::Types;
using namespace Sample1::Vars;
using namespace Sample2;
#ifndef NO_FORWARDING_TO_MOCK_IS_DEFAULT
class TestSample : public ::testing::Test{};
TEST_F(TestSample, SwapVariable) {
EXPECT_EQ(0, SampleFunc());
{
MOCK_OF(DerivedClass) mock(INSTANCE_OF(anObject));
const int expected = 1;
EXPECT_CALL(mock, Func(0, 0)).Times(1).WillOnce(::testing::Return(expected));
// Call the mock instead of the swapped object
EXPECT_EQ(expected, SampleFunc());
}
// Confirm cleanup
ASSERT_FALSE(INSTANCE_OF(anObject).pMock_);
}
TEST_F(TestSample, SwapType) {
EXPECT_EQ(0, SampleFunc());
{
MOCK_OF(DerivedClass) mock(localObject);
const int expected = 2;
EXPECT_CALL(mock, Func(0, 0)).Times(1).WillOnce(::testing::Return(expected));
// Call the mock instead of the swapped object
EXPECT_EQ(expected, SampleFunc());
}
ASSERT_FALSE(localObject.pMock_);
}
TEST_F(TestSample, SwapArray) {
EXPECT_EQ(0, SampleFunc());
{
MOCK_OF(DerivedClass) mockA(localObjectSetA[g_SampleArrayIndex]);
MOCK_OF(DerivedClass) mockB(localObjectSetB[g_SampleArrayIndex]);
const int expectedA = 1;
const int expectedB = 2;
EXPECT_CALL(mockA, Func(0, 0)).Times(1).WillOnce(::testing::Return(expectedA));
EXPECT_CALL(mockB, Func(0, 0)).Times(1).WillOnce(::testing::Return(expectedB));
// Call the mock instead of the swapped object
EXPECT_EQ(expectedA + expectedB, SampleFuncArray());
}
ASSERT_FALSE(localObjectSetA[g_SampleArrayIndex].pMock_);
ASSERT_FALSE(localObjectSetB[g_SampleArrayIndex].pMock_);
}
TEST_F(TestSample, MockClassMember) {
EXPECT_EQ(0, SampleFunc());
{
MOCK_OF(DerivedClass) mock(localObject);
DECORATOR(DerivedClass)::pClassMock_ = &mock;
constexpr int expected = 3;
EXPECT_CALL(mock, StaticFunc()).Times(1).WillOnce(::testing::Return(expected));
EXPECT_EQ(expected, localObject.StaticFunc());
}
ASSERT_FALSE(localObject.pClassMock_);
}
TEST_F(TestSample, TopLevelNamespace) {
{
MOCK_OF(TopLevelClass) mock(INSTANCE_OF(aTopLevelObject));
EXPECT_CALL(mock, GetValue()).
Times(::testing::AtLeast(1)).
WillOnce(::testing::Invoke(&mock, &MOCK_OF(TopLevelClass)::GetValue));
EXPECT_CALL(mock, FuncMissingF(::testing::_, ::testing::_, ::testing::_)).
Times(::testing::AtLeast(1)).
WillOnce(::testing::Invoke(&mock, &MOCK_OF(TopLevelClass)::FuncMissingF));
EXPECT_CALL(mock, FuncMissingG(::testing::_, ::testing::_)).
Times(::testing::AtLeast(1)).
WillOnce(::testing::Invoke(&mock, &MOCK_OF(TopLevelClass)::FuncMissingG));
EXPECT_EQ(0, TopLevelSampleFunc());
}
{
MOCK_OF(TopLevelClass) mockA(INSTANCE_OF(aTopLevelObject));
constexpr int expected = 4;
EXPECT_CALL(mockA, GetValue()).Times(2).WillRepeatedly(::testing::Return(expected));
EXPECT_EQ(expected, TopLevelSampleFunc());
{
constexpr int expectedInner = 5;
MOCK_OF(TopLevelClass) mockL(&localTopLevelObject);
EXPECT_CALL(mockL, GetValue()).Times(1).WillOnce(::testing::Return(expectedInner));
EXPECT_EQ(expected + expectedInner, TopLevelSampleFunc());
}
}
ASSERT_FALSE(INSTANCE_OF(aTopLevelObject).pMock_);
ASSERT_FALSE(localTopLevelObject.pMock_);
{
EXPECT_EQ(0, FreeFunctionCallerSample());
{
int expected = 1;
MOCK_OF(All) mock(INSTANCE_OF(all));
EXPECT_CALL(mock, FreeFunctionCalleeSample()).Times(1).WillOnce(::testing::Return(expected));
EXPECT_EQ(expected, FreeFunctionCallerSample());
}
}
{
MOCK_OF(All) mock(INSTANCE_OF(all));
int expected = 6;
EXPECT_CALL(mock, TopLevelSampleFunc()).Times(1).WillOnce(::testing::Return(expected));
INSTANCE_OF(all).TopLevelSampleFunc();
++expected;
EXPECT_CALL(mock, TopLevelSampleFunc()).Times(1).WillOnce(::testing::Return(expected));
EXPECT_EQ(expected, INSTANCE_OF(all).TopLevelSampleFunc());
}
ASSERT_FALSE(INSTANCE_OF(all).pMock_);
}
TEST_F(TestSample, SwapVariableCtorWithArg) {
EXPECT_EQ(::CTOR_VALUE_SUM, SampleFuncCtorWithArg());
{
const int arg = CTOR_VALUE_aCtorWithArg + 11;
const int dummyArg = arg + 1;
const int expected = arg + CTOR_VALUE_localCtorWithArg;
MOCK_OF(ConstructorWithArg) mock(INSTANCE_OF(aCtorWithArg), dummyArg);
EXPECT_CALL(mock, Get()).Times(1).WillOnce(::testing::Return(arg));
// Call the mock instead of the swapped object
EXPECT_EQ(expected, SampleFuncCtorWithArg());
}
ASSERT_FALSE(INSTANCE_OF(aCtorWithArg).pMock_);
}
TEST_F(TestSample, SwapTypeCtorWithArg) {
EXPECT_EQ(::CTOR_VALUE_SUM, SampleFuncCtorWithArg());
{
const int arg = CTOR_VALUE_localCtorWithArg + 11;
const int dummyArg = arg + 1;
const int expected = arg + CTOR_VALUE_aCtorWithArg;
MOCK_OF(ConstructorWithArg) mock(localCtorWithArg, dummyArg);
EXPECT_CALL(mock, Get()).Times(1).WillOnce(::testing::Return(arg));
// Call the mock instead of the swapped object
EXPECT_EQ(expected, SampleFuncCtorWithArg());
}
ASSERT_FALSE(localCtorWithArg.pMock_);
}
TEST_F(TestSample, ForwardSelective) {
{
EXPECT_EQ(0, SampleFunc());
MOCK_OF(DerivedClass) mock(INSTANCE_OF(anObject));
{
// Prohibit forwarding to the mock Func()
INSTANCE_OF(anObject).Func_nomock_ = true;
{
EXPECT_CALL(mock, Func(0, 0)).Times(0);
EXPECT_EQ(0, SampleFunc());
}
{
const int expected = 1;
EXPECT_CALL(mock, StaticFunc()).Times(1).WillOnce(::testing::Return(expected));
EXPECT_EQ(expected, INSTANCE_OF(anObject).StaticFunc());
}
}
{
// Forward to the mock Func()
INSTANCE_OF(anObject).Func_nomock_ = false;
INSTANCE_OF(anObject).StaticFunc_nomock_ = true;
{
const int expected = 2;
EXPECT_CALL(mock, Func(0, 0)).Times(1).WillOnce(::testing::Return(expected));
EXPECT_EQ(expected, SampleFunc());
}
{
EXPECT_CALL(mock, StaticFunc()).Times(0);
// Prohibit forwarding to the mock
EXPECT_EQ(0, INSTANCE_OF(anObject).StaticFunc());
}
}
}
{
EXPECT_EQ(0, SampleFunc());
MOCK_OF(DerivedClass) mock(localObject);
DECORATOR(DerivedClass)::pClassMock_ = &mock;
{
DECORATOR(DerivedClass)::StaticFunc_nomock_ = true;
EXPECT_CALL(mock, StaticFunc()).Times(0);
EXPECT_EQ(0, localObject.StaticFunc());
}
{
DECORATOR(DerivedClass)::StaticFunc_nomock_ = false;
constexpr int expected = 3;
EXPECT_CALL(mock, StaticFunc()).Times(1).WillOnce(::testing::Return(expected));
EXPECT_EQ(expected, localObject.StaticFunc());
}
}
}
TEST_F(TestSample, InlineFunctions) {
EXPECT_EQ(5, FunctionInHeader());
{
MOCK_OF(All) mock(INSTANCE_OF(all));
{
EXPECT_CALL(mock, ToBeFowarded1()).Times(1).WillOnce(::testing::Return(0));
EXPECT_CALL(mock, ToBeFowarded2(1)).Times(1).WillOnce(::testing::Return(0));
EXPECT_EQ(0, FunctionInHeader());
}
{
INSTANCE_OF(all).ToBeFowarded1_nomock_ = true;
INSTANCE_OF(all).ToBeFowarded2_nomock_ = true;
EXPECT_EQ(5, FunctionInHeader());
}
}
}
class TestMemFnPointerSample : public ::testing::Test{};
TEST_F(TestMemFnPointerSample, All) {
Counter counter;
CountLater countLater;
int expected = 0;
EXPECT_EQ(expected, counter.Get());
counter.Increment();
++expected;
EXPECT_EQ(expected, counter.Get());
counter.Decrement();
counter.Decrement();
expected -= 2;
EXPECT_EQ(expected, counter.Get());
countLater.Execute();
EXPECT_EQ(expected, counter.Get());
countLater.ExecuteLater(&counter, &Counter::Decrement);
EXPECT_EQ(expected, counter.Get());
--expected;
for(int i=0; i<2; ++i) {
countLater.Execute();
EXPECT_EQ(expected, counter.Get());
}
countLater.ExecuteLater(&counter, &Counter::Increment);
EXPECT_EQ(expected, counter.Get());
countLater.ExecuteLater(&counter, &Counter::Increment);
++expected;
EXPECT_EQ(expected, counter.Get());
}
using DataType = int;
template <typename T> TypedClass_Mock<T>* TypedClass_Decorator<T>::pClassMock_;
template class ::Sample1::Types::TypedClass<DataType>;
namespace MyUnittest {
template TypedClass_Mock<DataType>* TypedClass_Decorator<DataType>::pClassMock_;
}
class TestTemplateSample : public ::testing::Test {
protected:
using Tested = ::Sample1::Types::TypedClass<DataType>;
using Decorator = MyUnittest::TypedClass_Decorator<DataType>;
using Forwarder = MyUnittest::TypedClass_Forwarder<DataType>;
using Mock = MyUnittest::TypedClass_Mock<DataType>;
};
TEST_F(TestTemplateSample, Get) {
Tested obj(0);
EXPECT_EQ(0, obj.Get());
{
DataType expected = 1;
Forwarder forwarder(obj, expected);
EXPECT_EQ(0, forwarder.Get());
++expected;
Mock mock(forwarder, 0);
EXPECT_CALL(mock, Get()).Times(1).WillOnce(::testing::Return(expected));
EXPECT_EQ(expected, forwarder.Get());
}
{
DataType expected = 11;
Decorator decorator(expected);
EXPECT_EQ(expected, decorator.Get());
Mock mock(decorator, 0);
++expected;
EXPECT_CALL(mock, Get()).Times(1).WillOnce(::testing::Return(expected));
EXPECT_EQ(expected, decorator.Get());
}
}
using DataType3 = int;
template <size_t S, size_t V, typename ...Ts> VariadicClass_Mock<S,V,Ts...>* VariadicClass_Decorator<S,V,Ts...>::pClassMock_;
template class ::Sample1::Types::VariadicClass<1,2,int,long,unsigned long>;
namespace MyUnittest {
template VariadicClass_Mock<1,2,int,long,unsigned long>* VariadicClass_Decorator<1,2,int,long,unsigned long>::pClassMock_;
}
class TestVariadicTemplate : public ::testing::Test {
protected:
using Tested = ::Sample1::Types::VariadicClass<1,2,int,long,unsigned long>;
using Decorator = MyUnittest::VariadicClass_Decorator<1,2,int,long,unsigned long>;
using Forwarder = MyUnittest::VariadicClass_Forwarder<1,2,int,long,unsigned long>;
using Mock = MyUnittest::VariadicClass_Mock<1,2,int,long,unsigned long>;
};
TEST_F(TestVariadicTemplate, Get) {
Tested obj;
const size_t originalExpected = 7;
EXPECT_EQ(originalExpected, obj.Get());
{
Forwarder forwarder(obj);
EXPECT_EQ(originalExpected, forwarder.Get());
{
const size_t expected = originalExpected + 1;
Mock mock(forwarder);
EXPECT_CALL(mock, Get()).Times(1).WillOnce(::testing::Return(expected));
EXPECT_EQ(expected, forwarder.Get());
}
ASSERT_FALSE(forwarder.pMock_);
}
{
Decorator decorator;
EXPECT_EQ(originalExpected, decorator.Get());
{
Mock mock(decorator);
const size_t expected = originalExpected + 11;
EXPECT_CALL(mock, Get()).Times(1).WillOnce(::testing::Return(expected));
EXPECT_EQ(expected, decorator.Get());
}
ASSERT_FALSE(decorator.pMock_);
}
}
class TestFreeFunctionSwitch : public ::testing::Test{};
MACRO_GET_FREE_FUNCTION_SWITCH_BY_NAME(UniqueName)
TEST_F(TestFreeFunctionSwitch, CallFunctionPointer) {
MOCK_OF(All) mock(INSTANCE_OF(all));
{
auto pSwitch = GetFreeFunctionSwitch(g_funcPtrWithoutArg, mock, &MOCK_OF(All)::funcWithoutArg1);
EXPECT_EQ(g_returnValueWithoutArg1, callFuncPtrWithoutArg());
g_funcPtrWithoutArg = &funcWithoutArg2;
EXPECT_EQ(g_returnValueWithoutArg2, callFuncPtrWithoutArg());
pSwitch->SwitchToMock();
const int expected = g_returnValueWithoutArg2 + 1;
EXPECT_CALL(mock, funcWithoutArg1()).Times(1).WillOnce(::testing::Return(expected));
EXPECT_EQ(expected, g_funcPtrWithoutArg());
}
{
auto pSwitch = GetFreeFunctionSwitchByName(UniqueName, g_funcPtrWithoutArg, mock, &MOCK_OF(All)::funcWithoutArg1);
pSwitch->SwitchToMock();
const int expected = g_returnValueWithoutArg2 + 2;
EXPECT_CALL(mock, funcWithoutArg1()).Times(1).WillOnce(::testing::Return(expected));
EXPECT_EQ(expected, g_funcPtrWithoutArg());
}
EXPECT_EQ(&funcWithoutArg1, g_funcPtrWithoutArg);
}
// Instantiate these macros out of function and class definitions
MACRO_GET_FREE_FUNCTION_SWITCH_BY_NAME(NoArgs)
MACRO_GET_FREE_FUNCTION_SWITCH_BY_NAME(OneArg)
MACRO_GET_FREE_FUNCTION_SWITCH_BY_NAME(TwoArgs)
MACRO_GET_FREE_FUNCTION_SWITCH_BY_NAME(ThreeArgs)
MACRO_GET_FREE_FUNCTION_SWITCH_BY_NAME(FourArgs)
MACRO_GET_FREE_FUNCTION_SWITCH_BY_NAME(FiveArgs)
MACRO_GET_FREE_FUNCTION_SWITCH_BY_NAME(SixArgs)
MACRO_GET_FREE_FUNCTION_SWITCH_BY_NAME(SevenArgs)
MACRO_GET_FREE_FUNCTION_SWITCH_BY_NAME(EightArgs)
MACRO_GET_FREE_FUNCTION_SWITCH_BY_NAME(NineArgs)
MACRO_GET_FREE_FUNCTION_SWITCH_BY_NAME(SwitchA)
MACRO_GET_FREE_FUNCTION_SWITCH_BY_NAME(SwitchB)
namespace {
template <typename Mock, typename Switch>
void CheckFunctionSwitchNoArguments(Mock& mock, Switch& pSwitch) {
// Switch between free functions and a mock
{
EXPECT_CALL(mock, funcWithoutArg1()).Times(0);
EXPECT_CALL(mock, funcWithoutArg2()).Times(0);
EXPECT_EQ(g_returnValueWithoutArg1, g_funcPtrWithoutArg());
}
{
EXPECT_CALL(mock, funcWithoutArg1()).Times(0);
EXPECT_CALL(mock, funcWithoutArg2()).Times(0);
g_funcPtrWithoutArg = &funcWithoutArg2;
EXPECT_EQ(g_returnValueWithoutArg2, g_funcPtrWithoutArg());
}
{
pSwitch->SwitchToMock();
constexpr int expected = 200;
EXPECT_CALL(mock, funcWithoutArg1()).Times(1).WillOnce(::testing::Return(expected));
EXPECT_CALL(mock, funcWithoutArg2()).Times(0);
EXPECT_EQ(expected, g_funcPtrWithoutArg());
}
{
pSwitch->SwitchToOriginal();
EXPECT_CALL(mock, funcWithoutArg1()).Times(0);
EXPECT_CALL(mock, funcWithoutArg2()).Times(0);
EXPECT_EQ(g_returnValueWithoutArg1, g_funcPtrWithoutArg());
}
}
template <typename Mock, typename Switch>
void CheckFunctionSwitchOneArgument(Mock& mock, Switch& pSwitch) {
constexpr int arg1 = 101;
{
EXPECT_CALL(mock, funcWithOneArg1(::testing::_)).Times(0);
EXPECT_CALL(mock, funcWithOneArg2(::testing::_)).Times(0);
EXPECT_EQ(g_returnValueWithOneArg1, g_funcPtrWithOneArg(arg1));
}
{
EXPECT_CALL(mock, funcWithOneArg1(::testing::_)).Times(0);
EXPECT_CALL(mock, funcWithOneArg2(::testing::_)).Times(0);
g_funcPtrWithOneArg = &funcWithOneArg2;
EXPECT_EQ(g_returnValueWithOneArg2, g_funcPtrWithOneArg(arg1));
}
{
pSwitch->SwitchToMock();
constexpr long expected = 200;
EXPECT_CALL(mock, funcWithOneArg1(arg1)).Times(1).WillOnce(::testing::Return(expected));
EXPECT_CALL(mock, funcWithOneArg2(::testing::_)).Times(0);
EXPECT_EQ(expected, g_funcPtrWithOneArg(arg1));
}
{
pSwitch->SwitchToOriginal();
EXPECT_CALL(mock, funcWithOneArg1(::testing::_)).Times(0);
EXPECT_CALL(mock, funcWithOneArg2(::testing::_)).Times(0);
EXPECT_EQ(g_returnValueWithOneArg1, g_funcPtrWithOneArg(arg1));
}
}
template <typename Mock, typename Switch>
void CheckFunctionSwitchTwoArguments(Mock& mock, Switch& pSwitch) {
constexpr int arg1 = 101;
// Return value via a reference argument
constexpr char initial = 'Y';
constexpr char expected= 'Z';
{
char arg2 = initial;
EXPECT_CALL(mock, funcWithTwoArgs(::testing::_, ::testing::_)).Times(0);
g_funcPtrWithTwoArgs(arg1, arg2);
EXPECT_EQ(g_returnValueWithTwoArgs, arg2);
}
{
pSwitch->SwitchToMock();
char arg2 = initial;
EXPECT_CALL(mock, funcWithTwoArgs(arg1, ::testing::_)).Times(1).
WillOnce(::testing::SetArgReferee<1>(expected));
g_funcPtrWithTwoArgs(arg1, arg2);
EXPECT_EQ(expected, arg2);
}
}
template <typename Mock, typename Switch>
void CheckFunctionSwitchThreeArguments(Mock& mock, Switch& pSwitch) {
constexpr int arg1 = 101;
constexpr int arg2 = 102;
// Return value via a reference argument
{
long long arg3 = 0;
EXPECT_CALL(mock, funcWithThreeArgs(::testing::_, ::testing::_, ::testing::_)).Times(0);
g_funcPtrWithThreeArgs(arg1, arg2, &arg3);
EXPECT_EQ(g_returnValueWithThreeArgs, arg3);
}
{
pSwitch->SwitchToMock();
long long arg3 = 0;
constexpr int expected = 200;
EXPECT_CALL(mock, funcWithThreeArgs(arg1, arg2, ::testing::_)).Times(1).
WillOnce(::testing::SetArgPointee<2>(expected));
g_funcPtrWithThreeArgs(arg1, arg2, &arg3);
EXPECT_EQ(expected, arg3);
}
}
template <typename Mock, typename Switch4, typename Switch5, typename Switch6,
typename Switch7, typename Switch8, typename Switch9>
void CheckFunctionSwitchFourAndMoreArguments(Mock& mock, Switch4& pSwitch4, Switch5& pSwitch5, Switch6& pSwitch6,
Switch7& pSwitch7, Switch8& pSwitch8, Switch9& pSwitch9) {
using SharedSwitch = std::shared_ptr<::FREE_FUNCTION_SWITCH_NAMESPACE::FreeFunctionSwitchBase>;
std::vector<SharedSwitch> switchSet { std::move(pSwitch4), std::move(pSwitch5),
std::move(pSwitch6), std::move(pSwitch7), std::move(pSwitch8), std::move(pSwitch9)};
constexpr int arg1 = 101;
constexpr int arg2 = 102;
constexpr int arg3 = 103;
constexpr int arg4 = 104;
constexpr int arg5 = 105;
constexpr int arg6 = 106;
constexpr int arg7 = 107;
constexpr int arg8 = 108;
constexpr int arg9 = 109;
{
EXPECT_CALL(mock, funcWith4Args(::testing::_, ::testing::_, ::testing::_,
::testing::_)).Times(0);
EXPECT_CALL(mock, funcWith5Args(::testing::_, ::testing::_, ::testing::_,
::testing::_, ::testing::_)).Times(0);
EXPECT_CALL(mock, funcWith6Args(::testing::_, ::testing::_, ::testing::_,
::testing::_, ::testing::_, ::testing::_)).Times(0);
EXPECT_CALL(mock, funcWith7Args(::testing::_, ::testing::_, ::testing::_,
::testing::_, ::testing::_, ::testing::_,
::testing::_)).Times(0);
EXPECT_CALL(mock, funcWith8Args(::testing::_, ::testing::_, ::testing::_,
::testing::_, ::testing::_, ::testing::_,
::testing::_, ::testing::_)).Times(0);
EXPECT_CALL(mock, funcWith9Args(::testing::_, ::testing::_, ::testing::_,
::testing::_, ::testing::_, ::testing::_,
::testing::_, ::testing::_, ::testing::_)).Times(0);
EXPECT_EQ(4, g_funcPtrWith4Args(arg1, arg2, arg3, arg4));
EXPECT_EQ(5, g_funcPtrWith5Args(arg1, arg2, arg3, arg4, arg5));
EXPECT_EQ(6, g_funcPtrWith6Args(arg1, arg2, arg3, arg4, arg5, arg6));
EXPECT_EQ(7, g_funcPtrWith7Args(arg1, arg2, arg3, arg4, arg5, arg6, arg7));
EXPECT_EQ(8, g_funcPtrWith8Args(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8));
EXPECT_EQ(9, g_funcPtrWith9Args(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9));
}
{
constexpr size_t expected4 = 204;
constexpr size_t expected5 = 205;
constexpr size_t expected6 = 206;
constexpr size_t expected7 = 207;
constexpr size_t expected8 = 208;
constexpr size_t expected9 = 209;
for(auto pSwitch : switchSet) {
pSwitch->SwitchToMock();
}
::testing::Sequence seq;
EXPECT_CALL(mock, funcWith4Args(arg1, arg2, arg3, arg4)).
Times(1).WillOnce(::testing::Return(expected4));
EXPECT_CALL(mock, funcWith5Args(arg1, arg2, arg3, arg4, arg5)).
Times(1).WillOnce(::testing::Return(expected5));
EXPECT_CALL(mock, funcWith6Args(arg1, arg2, arg3, arg4, arg5, arg6)).
Times(1).WillOnce(::testing::Return(expected6));
EXPECT_CALL(mock, funcWith7Args(arg1, arg2, arg3, arg4, arg5, arg6, arg7)).
Times(1).WillOnce(::testing::Return(expected7));
EXPECT_CALL(mock, funcWith8Args(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8)).
Times(1).WillOnce(::testing::Return(expected8));
EXPECT_CALL(mock, funcWith9Args(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9)).
Times(1).WillOnce(::testing::Return(expected9));
EXPECT_EQ(expected4, g_funcPtrWith4Args(arg1, arg2, arg3, arg4));
EXPECT_EQ(expected5, g_funcPtrWith5Args(arg1, arg2, arg3, arg4, arg5));
EXPECT_EQ(expected6, g_funcPtrWith6Args(arg1, arg2, arg3, arg4, arg5, arg6));
EXPECT_EQ(expected7, g_funcPtrWith7Args(arg1, arg2, arg3, arg4, arg5, arg6, arg7));
EXPECT_EQ(expected8, g_funcPtrWith8Args(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8));
EXPECT_EQ(expected9, g_funcPtrWith9Args(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9));
}
}
void CheckFunctionSwitchRestored(void) {
EXPECT_EQ(&funcWithoutArg1, g_funcPtrWithoutArg);
EXPECT_EQ(&funcWithOneArg1, g_funcPtrWithOneArg);
EXPECT_EQ(&funcWithTwoArgs, g_funcPtrWithTwoArgs);
EXPECT_EQ(&funcWithThreeArgs, g_funcPtrWithThreeArgs);
EXPECT_EQ(&funcWith4Args, g_funcPtrWith4Args);
EXPECT_EQ(&funcWith5Args, g_funcPtrWith5Args);
EXPECT_EQ(&funcWith6Args, g_funcPtrWith6Args);
EXPECT_EQ(&funcWith7Args, g_funcPtrWith7Args);
EXPECT_EQ(&funcWith8Args, g_funcPtrWith8Args);
EXPECT_EQ(&funcWith9Args, g_funcPtrWith9Args);
}
}
TEST_F(TestFreeFunctionSwitch, NoArguments) {
MOCK_OF(All) mock(INSTANCE_OF(all));
{
auto pSwitch = GetFreeFunctionSwitch(g_funcPtrWithoutArg, mock, &MOCK_OF(All)::funcWithoutArg1);
CheckFunctionSwitchNoArguments(mock, pSwitch);
}
CheckFunctionSwitchRestored();
{
auto pSwitch = GetFreeFunctionSwitchByName(NoArgs, g_funcPtrWithoutArg, mock, &MOCK_OF(All)::funcWithoutArg1);
CheckFunctionSwitchNoArguments(mock, pSwitch);
}
CheckFunctionSwitchRestored();
}
TEST_F(TestFreeFunctionSwitch, OneArgument) {
MOCK_OF(All) mock(INSTANCE_OF(all));
{
auto pSwitch = GetFreeFunctionSwitch(g_funcPtrWithOneArg, mock, &MOCK_OF(All)::funcWithOneArg1);
CheckFunctionSwitchOneArgument(mock, pSwitch);
}
CheckFunctionSwitchRestored();
{
auto pSwitch = GetFreeFunctionSwitchByName(OneArg, g_funcPtrWithOneArg, mock, &MOCK_OF(All)::funcWithOneArg1);
CheckFunctionSwitchOneArgument(mock, pSwitch);
}
CheckFunctionSwitchRestored();
}
TEST_F(TestFreeFunctionSwitch, TwoArguments) {
MOCK_OF(All) mock(INSTANCE_OF(all));
{
auto pSwitch = GetFreeFunctionSwitch(g_funcPtrWithTwoArgs, mock, &MOCK_OF(All)::funcWithTwoArgs);
CheckFunctionSwitchTwoArguments(mock, pSwitch);
}
CheckFunctionSwitchRestored();
{
auto pSwitch = GetFreeFunctionSwitchByName(TwoArgs, g_funcPtrWithTwoArgs, mock, &MOCK_OF(All)::funcWithTwoArgs);
CheckFunctionSwitchTwoArguments(mock, pSwitch);
}
CheckFunctionSwitchRestored();
}
TEST_F(TestFreeFunctionSwitch, ThreeArguments) {
MOCK_OF(All) mock(INSTANCE_OF(all));
{
auto pSwitch = GetFreeFunctionSwitch(g_funcPtrWithThreeArgs, mock, &MOCK_OF(All)::funcWithThreeArgs);
CheckFunctionSwitchThreeArguments(mock, pSwitch);
}
CheckFunctionSwitchRestored();
{
auto pSwitch = GetFreeFunctionSwitchByName(ThreeArgs, g_funcPtrWithThreeArgs, mock, &MOCK_OF(All)::funcWithThreeArgs);
CheckFunctionSwitchThreeArguments(mock, pSwitch);
}
CheckFunctionSwitchRestored();
}
TEST_F(TestFreeFunctionSwitch, FourAndMoreArguments) {
MOCK_OF(All) mock(INSTANCE_OF(all));
{
auto pSwitch4 = GetFreeFunctionSwitch(g_funcPtrWith4Args, mock, &MOCK_OF(All)::funcWith4Args);
auto pSwitch5 = GetFreeFunctionSwitch(g_funcPtrWith5Args, mock, &MOCK_OF(All)::funcWith5Args);
auto pSwitch6 = GetFreeFunctionSwitch(g_funcPtrWith6Args, mock, &MOCK_OF(All)::funcWith6Args);
auto pSwitch7 = GetFreeFunctionSwitch(g_funcPtrWith7Args, mock, &MOCK_OF(All)::funcWith7Args);
auto pSwitch8 = GetFreeFunctionSwitch(g_funcPtrWith8Args, mock, &MOCK_OF(All)::funcWith8Args);
auto pSwitch9 = GetFreeFunctionSwitch(g_funcPtrWith9Args, mock, &MOCK_OF(All)::funcWith9Args);
CheckFunctionSwitchFourAndMoreArguments(mock, pSwitch4, pSwitch5, pSwitch6, pSwitch7, pSwitch8, pSwitch9);
}
CheckFunctionSwitchRestored();
{
auto pSwitch4 = GetFreeFunctionSwitchByName(FourArgs, g_funcPtrWith4Args, mock, &MOCK_OF(All)::funcWith4Args);
auto pSwitch5 = GetFreeFunctionSwitchByName(FiveArgs, g_funcPtrWith5Args, mock, &MOCK_OF(All)::funcWith5Args);
auto pSwitch6 = GetFreeFunctionSwitchByName(SixArgs, g_funcPtrWith6Args, mock, &MOCK_OF(All)::funcWith6Args);
auto pSwitch7 = GetFreeFunctionSwitchByName(SevenArgs, g_funcPtrWith7Args, mock, &MOCK_OF(All)::funcWith7Args);
auto pSwitch8 = GetFreeFunctionSwitchByName(EightArgs, g_funcPtrWith8Args, mock, &MOCK_OF(All)::funcWith8Args);
auto pSwitch9 = GetFreeFunctionSwitchByName(NineArgs, g_funcPtrWith9Args, mock, &MOCK_OF(All)::funcWith9Args);
CheckFunctionSwitchFourAndMoreArguments(mock, pSwitch4, pSwitch5, pSwitch6, pSwitch7, pSwitch8, pSwitch9);
}
CheckFunctionSwitchRestored();
}
TEST_F(TestFreeFunctionSwitch, MultipleInstances) {
MOCK_OF(All) mock(INSTANCE_OF(all));
// run twice
for(int loop=0; loop<2; ++loop) {
{
// Switch1 to 10 have their unique entry function FreeFunctionSwitch::CallToMock1 and CallToMock10
auto pSwitch1 = GetFreeFunctionSwitch(g_switchedFuncPtr1, mock, &MOCK_OF(All)::switchedFunc1);
auto pSwitch2 = GetFreeFunctionSwitch(g_switchedFuncPtr2, mock, &MOCK_OF(All)::switchedFunc2);
auto pSwitch3 = GetFreeFunctionSwitch(g_switchedFuncPtr3, mock, &MOCK_OF(All)::switchedFunc3);
auto pSwitch4 = GetFreeFunctionSwitch(g_switchedFuncPtr4, mock, &MOCK_OF(All)::switchedFunc4);
auto pSwitch5 = GetFreeFunctionSwitch(g_switchedFuncPtr5, mock, &MOCK_OF(All)::switchedFunc5);
auto pSwitch6 = GetFreeFunctionSwitch(g_switchedFuncPtr6, mock, &MOCK_OF(All)::switchedFunc6);
auto pSwitch7 = GetFreeFunctionSwitch(g_switchedFuncPtr7, mock, &MOCK_OF(All)::switchedFunc7);
auto pSwitch8 = GetFreeFunctionSwitch(g_switchedFuncPtr8, mock, &MOCK_OF(All)::switchedFunc8);
auto pSwitch9 = GetFreeFunctionSwitch(g_switchedFuncPtr9, mock, &MOCK_OF(All)::switchedFunc9);
auto pSwitch10 = GetFreeFunctionSwitch(g_switchedFuncPtr10, mock, &MOCK_OF(All)::switchedFunc10);
// Switch11 and 12 shares FreeFunctionSwitch::CallToMock
auto pSwitch11 = GetFreeFunctionSwitch(g_switchedFuncPtr11, mock, &MOCK_OF(All)::switchedFunc11);
auto pSwitch12 = GetFreeFunctionSwitch(g_switchedFuncPtr12, mock, &MOCK_OF(All)::switchedFunc12);
pSwitch1->SwitchToMock();
pSwitch2->SwitchToMock();
pSwitch3->SwitchToMock();
pSwitch4->SwitchToMock();
pSwitch5->SwitchToMock();
pSwitch6->SwitchToMock();
pSwitch7->SwitchToMock();
pSwitch8->SwitchToMock();
pSwitch9->SwitchToMock();
pSwitch10->SwitchToMock();
pSwitch11->SwitchToMock();
pSwitch12->SwitchToMock();
EXPECT_CALL(mock, switchedFunc1()).Times(1).WillOnce(::testing::Return(101));
EXPECT_CALL(mock, switchedFunc2()).Times(1).WillOnce(::testing::Return(102));
EXPECT_CALL(mock, switchedFunc3()).Times(1).WillOnce(::testing::Return(103));
EXPECT_CALL(mock, switchedFunc4()).Times(1).WillOnce(::testing::Return(104));
EXPECT_CALL(mock, switchedFunc5()).Times(1).WillOnce(::testing::Return(105));
EXPECT_CALL(mock, switchedFunc6()).Times(1).WillOnce(::testing::Return(106));
EXPECT_CALL(mock, switchedFunc7()).Times(1).WillOnce(::testing::Return(107));
EXPECT_CALL(mock, switchedFunc8()).Times(1).WillOnce(::testing::Return(108));
EXPECT_CALL(mock, switchedFunc9()).Times(1).WillOnce(::testing::Return(109));
EXPECT_CALL(mock, switchedFunc10()).Times(1).WillOnce(::testing::Return(110));
EXPECT_CALL(mock, switchedFunc11()).Times(0);
EXPECT_CALL(mock, switchedFunc12()).Times(2).WillOnce(::testing::Return(111)).WillOnce(::testing::Return(112));
EXPECT_EQ(101, g_switchedFuncPtr1());
EXPECT_EQ(102, g_switchedFuncPtr2());
EXPECT_EQ(103, g_switchedFuncPtr3());
EXPECT_EQ(104, g_switchedFuncPtr4());
EXPECT_EQ(105, g_switchedFuncPtr5());
EXPECT_EQ(106, g_switchedFuncPtr6());
EXPECT_EQ(107, g_switchedFuncPtr7());
EXPECT_EQ(108, g_switchedFuncPtr8());
EXPECT_EQ(109, g_switchedFuncPtr9());
EXPECT_EQ(110, g_switchedFuncPtr10());
EXPECT_EQ(111, g_switchedFuncPtr11()); // the 12th GetFreeFunctionSwitch overwrote the 11th
EXPECT_EQ(112, g_switchedFuncPtr12());
}
EXPECT_EQ(&switchedFunc1, g_switchedFuncPtr1);
EXPECT_EQ(&switchedFunc2, g_switchedFuncPtr2);
EXPECT_EQ(&switchedFunc3, g_switchedFuncPtr3);
EXPECT_EQ(&switchedFunc4, g_switchedFuncPtr4);
EXPECT_EQ(&switchedFunc5, g_switchedFuncPtr5);
EXPECT_EQ(&switchedFunc6, g_switchedFuncPtr6);
EXPECT_EQ(&switchedFunc7, g_switchedFuncPtr7);
EXPECT_EQ(&switchedFunc8, g_switchedFuncPtr8);
EXPECT_EQ(&switchedFunc9, g_switchedFuncPtr9);
EXPECT_EQ(&switchedFunc10, g_switchedFuncPtr10);
EXPECT_EQ(&switchedFunc11, g_switchedFuncPtr11);
EXPECT_EQ(&switchedFunc12, g_switchedFuncPtr12);
{
constexpr int expected = 101;
auto pSwitchA = GetFreeFunctionSwitchByName(SwitchA, g_switchedFuncPtr1, mock, &MOCK_OF(All)::switchedFunc1);
auto pSwitchB = GetFreeFunctionSwitchByName(SwitchB, g_switchedFuncPtr2, mock, &MOCK_OF(All)::switchedFunc2);
{
pSwitchA->SwitchToMock();
EXPECT_CALL(mock, switchedFunc1()).Times(1).WillOnce(::testing::Return(expected));
EXPECT_CALL(mock, switchedFunc2()).Times(0);
EXPECT_EQ(expected, g_switchedFuncPtr1());
EXPECT_EQ(2, g_switchedFuncPtr2());
}
{
pSwitchA->SwitchToOriginal();
EXPECT_CALL(mock, switchedFunc1()).Times(0);
EXPECT_CALL(mock, switchedFunc2()).Times(0);
EXPECT_EQ(1, g_switchedFuncPtr1());
EXPECT_EQ(2, g_switchedFuncPtr2());
}
}
EXPECT_EQ(&switchedFunc1, g_switchedFuncPtr1);
EXPECT_EQ(&switchedFunc2, g_switchedFuncPtr2);
}
}
#else
class TestSampleNoForwaring : public ::testing::Test{};
TEST_F(TestSampleNoForwaring, ForwardSelective) {
MOCK_OF(DerivedClass) mock(INSTANCE_OF(anObject));
{
EXPECT_CALL(mock, Func(0, 0)).Times(0);
EXPECT_EQ(0, SampleFunc());
}
{
// Allow to forward to the mock Func()
INSTANCE_OF(anObject).Func_nomock_ = false;
const int expected = 1;
EXPECT_CALL(mock, Func(0, 0)).Times(1).WillOnce(::testing::Return(expected));
EXPECT_EQ(expected, SampleFunc());
}
}
TEST_F(TestSampleNoForwaring, DecorateSelective) {
MOCK_OF(DerivedClass) mock(localObject);
DECORATOR(DerivedClass)::pClassMock_ = &mock;
{
EXPECT_CALL(mock, StaticFunc()).Times(0);
EXPECT_EQ(0, localObject.StaticFunc());
}
{
DECORATOR(DerivedClass)::StaticFunc_nomock_ = false;
constexpr int expected = 2;
EXPECT_CALL(mock, StaticFunc()).Times(1).WillOnce(::testing::Return(expected));
EXPECT_EQ(expected, localObject.StaticFunc());
}
// Restore manually
DECORATOR(DerivedClass)::StaticFunc_nomock_ = true;
}
#endif // NO_FORWARDING_TO_MOCK_IS_DEFAULT
/*
Local Variables:
mode: c++
coding: utf-8-dos
tab-width: nil
c-file-style: "stroustrup"
End:
*/
| 42.738386 | 127 | 0.631922 | zettsu-t |
5b0f16732c0d3bae4e7472b5eb745cf1c43a17da | 2,784 | cc | C++ | exam_in_class/1/yet_another_beautiful_merged_sequence.cc | jamie-jjd/110_spring_IDS | 7f15c0c73b9d663373b791b9ddcc836957dcc3d2 | [
"MIT"
] | 2 | 2022-02-21T10:37:22.000Z | 2022-03-02T01:43:30.000Z | exam_in_class/1/yet_another_beautiful_merged_sequence.cc | jamie-jjd/110_spring_IDS | 7f15c0c73b9d663373b791b9ddcc836957dcc3d2 | [
"MIT"
] | null | null | null | exam_in_class/1/yet_another_beautiful_merged_sequence.cc | jamie-jjd/110_spring_IDS | 7f15c0c73b9d663373b791b9ddcc836957dcc3d2 | [
"MIT"
] | 3 | 2022-02-21T05:06:19.000Z | 2022-03-27T07:58:11.000Z | /*
* author: redleaf
* email: redleaf23477@gapp.nthu.edu.tw
*/
#include <bits/stdc++.h>
using namespace std;
using LL = long long int;
/*
* Actually this problem is Dilworth theorem:
* Let (x1, y1) <= (x2, y2) iff x1 <= x2 and y1 <= y2
* Let (x1, y1) || (x2, y2) iff x1 < x2 and y1 > y2 (incompariable)
*
* The answer is size of the largest antichain of A+B
*/
/*
* Solution 1 : merge
*/
void sol1() {
int n, m; cin >> n >> m;
vector<int> Ax(n), Ay(n);
vector<int> Bx(m), By(m);
for (int i = 0; i < n; i++) cin >> Ax[i] >> Ay[i];
for (int i = 0; i < m; i++) cin >> Bx[i] >> By[i];
int ans = n + m;
for (int i = 0, j = 0; i < n && j < m;) {
if (Ax[i] < Bx[j]) {
if (Ay[i] <= By[j]) ans--;
i++;
} else if (Ax[i] == Bx[j]) {
if (Ay[i] <= By[j]) i++;
else j++;
ans--;
} else { // Ax[i] > Bx[j]
if (By[j] <= Ay[i]) ans--;
j++;
}
}
cout << ans << "\n";
}
/*
* Solution 2 : stack
*/
void sol2() {
using P = pair<int,int>;
int n, m; cin >> n >> m;
vector<P> arr(n + m);
for (auto &[x, y] : arr) cin >> x >> y;
sort(arr.begin(), arr.end());
stack<int> Y;
for (const auto &[x, y] : arr) {
while (!Y.empty()) {
if (Y.top() <= y) Y.pop();
else break;
}
Y.emplace(y);
}
cout << Y.size() << "\n";
}
/*
* Solution 3: bucket sort like idea
* In the merged list, find the maximum y for each x
* Then deleted the dominated points
*/
void sol3() {
int n, m; cin >> n >> m;
vector<int> bucket(1000000+1, -1);
for (int i = 0; i < n + m; i++) {
int x, y; cin >> x >> y;
bucket[x] = max(bucket[x], y);
}
int ans = 0, mx = 0;
for (int c = 1000000; c > 0; c--) {
if (bucket[c] > mx) {
mx = bucket[c], ans++;
}
}
cout << ans << "\n";
}
/*
* Solution 4: binary search
* For each point find if it is dominated by point in another chain
*/
void sol4() {
int n, m; cin >> n >> m;
map<int,int> A, B;
for (int i = 0; i < n; i++) {
int x, y; cin >> x >> y;
A[x] = y;
}
for (int i = 0; i < m; i++) {
int x, y; cin >> x >> y;
B[x] = y;
}
int ans = n + m;
for (auto [x, y] : A) {
auto it = B.lower_bound(x);
if (it != B.end() && it->second >= y) ans--;
}
for (auto [x, y] : B) {
auto it = A.lower_bound(x);
if (it != A.end() && it->second >= y) ans--;
if (it != A.end() && x == it->first && y == it->second) ans++; // avoid deleteing equal points twice
}
cout << ans << "\n";
}
int main() {
sol1();
// sol2();
// sol3();
// sol4();
} | 23.2 | 108 | 0.426006 | jamie-jjd |
5b12d17b3c8615a467e02e6de9544628872890f3 | 823 | cpp | C++ | AlignmentApprox.cpp | caiks/AlignmentC | 65800c03ff78369718e4d590e35b8c1e915adfa0 | [
"MIT"
] | 1 | 2020-02-19T14:58:14.000Z | 2020-02-19T14:58:14.000Z | AlignmentApprox.cpp | caiks/AlignmentC | 65800c03ff78369718e4d590e35b8c1e915adfa0 | [
"MIT"
] | null | null | null | AlignmentApprox.cpp | caiks/AlignmentC | 65800c03ff78369718e4d590e35b8c1e915adfa0 | [
"MIT"
] | null | null | null | #include "AlignmentApprox.h"
using namespace Alignment;
// histogramsEntropy :: Histogram -> Double
double Alignment::histogramsEntropy(const Histogram& aa)
{
auto s = histogramsSize(aa);
double e = 0.0;
for (auto it = aa.map_u().begin(); it != aa.map_u().end(); ++it)
if (it->second > 0)
{
double a = it->second.getDouble() / s.getDouble();
e -= a * log(a);
}
return e;
}
// histogramsAlignment :: Histogram -> Double
double Alignment::histogramsAlignment(const Histogram& aa)
{
double e = 0.0;
for (auto it = aa.map_u().begin(); it != aa.map_u().end(); ++it)
e += alngam(it->second.getDouble() + 1.0);
auto bb = histogramsIndependent(aa);
for (auto it = bb->map_u().begin(); it != bb->map_u().end(); ++it)
e -= alngam(it->second.getDouble() + 1.0);
return e;
}
| 26.548387 | 68 | 0.607533 | caiks |
5b1335d4fbb2657d3f9f60a18cf5f049b3d8bdcd | 4,411 | hpp | C++ | src/vec4.hpp | kiwicom/catboost-cxx | 7ae872fe9418215b6592e1a947d1cd4bc5b10b3d | [
"MIT"
] | 5 | 2021-02-17T14:46:26.000Z | 2021-08-28T20:10:02.000Z | src/vec4.hpp | kiwicom/catboost-cxx | 7ae872fe9418215b6592e1a947d1cd4bc5b10b3d | [
"MIT"
] | null | null | null | src/vec4.hpp | kiwicom/catboost-cxx | 7ae872fe9418215b6592e1a947d1cd4bc5b10b3d | [
"MIT"
] | 3 | 2020-12-18T07:43:29.000Z | 2021-04-26T13:29:43.000Z | #pragma once
#ifndef NOSSE
// SSE4.1
#include <smmintrin.h>
#include <cstdint>
namespace catboost {
struct Vec4i {
__m128i v;
Vec4i() : v(_mm_set_epi32(0, 0, 0, 0)) {}
explicit Vec4i(__m128i x) : v(x) {}
explicit Vec4i(__m128 x) : v(_mm_castps_si128(x)) {}
explicit Vec4i(uint32_t x0, uint32_t x1, uint32_t x2, uint32_t x3) : v(_mm_set_epi32(x0, x1, x2, x3)) {}
explicit Vec4i(uint32_t x) : v(_mm_set_epi32(x, x, x, x)) {}
Vec4i(const Vec4i&) = default;
Vec4i(Vec4i&&) = default;
Vec4i& operator=(const Vec4i&) = default;
Vec4i& operator=(Vec4i&&) = default;
~Vec4i() = default;
void load(const uint32_t* p) { v = _mm_load_si128(reinterpret_cast<const __m128i*>(p)); }
void loadu(const uint32_t* p) { v = _mm_loadu_si128(reinterpret_cast<const __m128i*>(p)); }
void store(uint32_t* p) const { _mm_store_si128(reinterpret_cast<__m128i*>(p), v); }
void storeu(uint32_t* p) const { _mm_storeu_si128(reinterpret_cast<__m128i*>(p), v); }
Vec4i& operator+=(Vec4i x) {
v = _mm_add_epi32(v, x.v);
return *this;
}
Vec4i operator+(Vec4i x) const { return Vec4i(_mm_add_epi32(v, x.v)); }
Vec4i& operator-=(Vec4i x) {
v = _mm_sub_epi32(v, x.v);
return *this;
}
Vec4i operator-(Vec4i x) const { return Vec4i(_mm_sub_epi32(v, x.v)); }
Vec4i& operator*=(Vec4i x) {
v = _mm_mul_epi32(v, x.v);
return *this;
}
Vec4i operator*(Vec4i x) const { return Vec4i(_mm_mul_epi32(v, x.v)); }
Vec4i& operator&=(Vec4i x) {
v = _mm_and_si128(v, x.v);
return *this;
}
Vec4i operator&(Vec4i x) const { return Vec4i(_mm_and_si128(v, x.v)); }
Vec4i& operator|=(Vec4i x) {
v = _mm_or_si128(v, x.v);
return *this;
}
Vec4i operator|(Vec4i x) const { return Vec4i(_mm_or_si128(v, x.v)); }
Vec4i& operator^=(Vec4i x) {
v = _mm_xor_si128(v, x.v);
return *this;
}
Vec4i operator^(Vec4i x) const { return Vec4i(_mm_xor_si128(v, x.v)); }
Vec4i& operator<<=(uint32_t s) {
v = _mm_slli_epi32(v, s);
return *this;
}
Vec4i operator<<(uint32_t s) const { return Vec4i(_mm_slli_epi32(v, s)); }
Vec4i& operator>>=(uint32_t s) {
v = _mm_srli_epi32(v, s);
return *this;
}
Vec4i operator>>(uint32_t s) const { return Vec4i(_mm_srli_epi32(v, s)); }
uint32_t sum() const {
// Let's allow optimizer to do it for us:
alignas(16) uint32_t x[4];
store(x);
return x[0] + x[1] + x[2] + x[3];
}
};
struct Vec4f {
__m128 v;
Vec4f() : v(_mm_setzero_ps()) {}
explicit Vec4f(__m128 x) : v(x) {}
explicit Vec4f(float x0, float x1, float x2, float x3) : v(_mm_set_ps(x0, x1, x2, x3)) {}
explicit Vec4f(float x) : v(_mm_set_ps(x, x, x, x)) {}
Vec4f(const Vec4f&) = default;
Vec4f(Vec4f&&) = default;
Vec4f& operator=(const Vec4f&) = default;
Vec4f& operator=(Vec4f&&) = default;
~Vec4f() = default;
void load(const float* f) { v = _mm_load_ps(f); }
void loadu(const float* f) { v = _mm_loadu_ps(f); }
void store(float* f) const { _mm_store_ps(f, v); }
void storeu(float* f) const { _mm_storeu_ps(f, v); }
Vec4i operator<(Vec4f x) { return Vec4i(_mm_cmplt_ps(v, x.v)); }
Vec4i operator<=(Vec4f x) { return Vec4i(_mm_cmple_ps(v, x.v)); }
Vec4i operator>(Vec4f x) { return Vec4i(_mm_cmpgt_ps(v, x.v)); }
Vec4i operator>=(Vec4f x) { return Vec4i(_mm_cmpge_ps(v, x.v)); }
Vec4i operator==(Vec4f x) { return Vec4i(_mm_cmpeq_ps(v, x.v)); }
Vec4i operator!=(Vec4f x) { return Vec4i(_mm_cmpneq_ps(v, x.v)); }
Vec4f& operator+=(Vec4f x) {
v = _mm_add_ps(v, x.v);
return *this;
}
Vec4f operator+(Vec4f x) const { return Vec4f(_mm_add_ps(v, x.v)); }
Vec4f& operator-=(Vec4f x) {
v = _mm_sub_ps(v, x.v);
return *this;
}
Vec4f operator-(Vec4f x) const { return Vec4f(_mm_sub_ps(v, x.v)); }
Vec4f& operator*=(Vec4f x) {
v = _mm_mul_ps(v, x.v);
return *this;
}
Vec4f operator*(Vec4f x) const { return Vec4f(_mm_mul_ps(v, x.v)); }
Vec4f& operator/=(Vec4f x) {
v = _mm_div_ps(v, x.v);
return *this;
}
Vec4f operator/(Vec4f x) const { return Vec4f(_mm_div_ps(v, x.v)); }
};
// namespace catboost
} // namespace catboost
// NOSSE
#endif
| 27.06135 | 108 | 0.590569 | kiwicom |
5b1657def1ed0ccf941d0cba721f2570ed1536dc | 7,816 | cpp | C++ | test/test_FMinus.cpp | skmuduli92/libprop | 982753ee446a44aef2bfa92c944a3ce20c4a45ad | [
"BSD-3-Clause"
] | null | null | null | test/test_FMinus.cpp | skmuduli92/libprop | 982753ee446a44aef2bfa92c944a3ce20c4a45ad | [
"BSD-3-Clause"
] | null | null | null | test/test_FMinus.cpp | skmuduli92/libprop | 982753ee446a44aef2bfa92c944a3ce20c4a45ad | [
"BSD-3-Clause"
] | 2 | 2020-10-06T15:26:51.000Z | 2020-10-11T12:55:00.000Z |
#include <gtest/gtest.h>
#include "formula.h"
#include "parse_util.h"
#include "formula_util.h"
#include "trace.h"
#include "formula_util.h"
using namespace HyperPLTL;
using namespace std;
PHyperProp propertyOnceMinusOperator() {
PVarMap varmap = std::make_shared<VarMap>();
varmap->addIntVar("x");
varmap->addIntVar("y");
std::string formula = "(F- (AND (EQ x) (EQ y)))";
return parse_formula(formula, varmap);
}
TEST(PropertyLibTest, ValidTraceOnceMinusOperator_Simple) {
PVarMap varmap = std::make_shared<VarMap>();
unsigned xid = varmap->addIntVar("x");
PHyperProp property = parse_formula("(F- (EQ x))", varmap);
PTrace trace1(new Trace(0, 1));
PTrace trace2(new Trace(0, 1));
TraceList tracelist({trace1, trace2});
bool result = false;
unsigned traceLength = rand() % 20 + 20;
size_t cycle = 0;
for (cycle = 0; cycle < traceLength; cycle++) {
if(cycle == 10){
trace1->updateTermValue(xid, cycle, 10);
trace2->updateTermValue(xid, cycle, 10);
continue;
}
trace1->updateTermValue(xid, cycle, rand() % std::numeric_limits<unsigned>::max());
trace2->updateTermValue(xid, cycle, rand() % std::numeric_limits<unsigned>::max());
}
result = evaluateTraces(property, tracelist);
EXPECT_TRUE(result);
}
TEST(PropertyLibTest, InValidTraceOnceMinusOperator_Simple) {
PVarMap varmap = std::make_shared<VarMap>();
unsigned xid = varmap->addIntVar("x");
PHyperProp property = parse_formula("(F- (EQ x))", varmap);
PTrace trace1(new Trace(0, 1));
PTrace trace2(new Trace(0, 1));
TraceList tracelist({trace1, trace2});
bool result = false;
unsigned traceLength = rand() % 20 + 20;
size_t cycle = 0;
for (cycle = 0; cycle < traceLength; cycle++) {
unsigned xvalue = rand() % std::numeric_limits<unsigned>::max();
trace1->updateTermValue(xid, cycle, xvalue);
trace2->updateTermValue(xid, cycle, !xvalue);
}
result = evaluateTraces(property, tracelist);
EXPECT_FALSE(result);
}
TEST(PropertyLibTest, ValidTraceOnceMinusOperator) {
PHyperProp property = propertyOnceMinusOperator();
PTrace trace1(new Trace(0, 2));
PTrace trace2(new Trace(0, 2));
TraceList tracelist({trace1, trace2});
unsigned xid = property->getVarId("x");
unsigned yid = property->getVarId("y");
bool result = false;
unsigned traceLength = rand() % 20 + 20;
size_t cycle = 0;
for (; cycle < traceLength; ++cycle) {
unsigned xvalue = rand() % 100;
// setting 'x' var value
trace1->updateTermValue(xid, cycle, xvalue);
trace2->updateTermValue(xid, cycle, !xvalue);
// setting 'y' var value
unsigned yvalue = rand() % 100;
trace1->updateTermValue(yid, cycle, yvalue);
trace2->updateTermValue(yid, cycle, !yvalue);
}
trace1->updateTermValue(xid, cycle, 10);
trace2->updateTermValue(xid, cycle, 10);
trace1->updateTermValue(yid, cycle, 11);
trace2->updateTermValue(yid, cycle, 11);
cycle = cycle + 1;
traceLength = rand() % 20 + 20 + cycle;
for (; cycle < traceLength; ++cycle) {
unsigned xvalue = rand() % 100;
// setting 'x' var value
trace1->updateTermValue(xid, cycle, xvalue);
trace2->updateTermValue(xid, cycle, !xvalue);
// setting 'y' var value
unsigned yvalue = rand() % 100;
trace1->updateTermValue(yid, cycle, yvalue);
trace2->updateTermValue(yid, cycle, !yvalue);
}
result = evaluateTraces(property, tracelist);
EXPECT_TRUE(result);
}
TEST(PropertyLibTest, InvalidTraceOnceMinusOperator) {
PHyperProp property = propertyOnceMinusOperator();
PTrace trace1(new Trace(0, 2));
PTrace trace2(new Trace(0, 2));
TraceList tracelist({trace1, trace2});
unsigned xid = property->getVarId("x");
unsigned yid = property->getVarId("y");
bool result = false;
unsigned traceLength = rand() % 20 + 20;
size_t cycle = 0;
for (; cycle < traceLength; ++cycle) {
unsigned xvalue = rand() % 100;
// setting 'x' var value
trace1->updateTermValue(xid, cycle, xvalue);
trace2->updateTermValue(xid, cycle, !xvalue);
// setting 'y' var value
unsigned yvalue = rand() % 100;
trace1->updateTermValue(yid, cycle, yvalue);
trace2->updateTermValue(yid, cycle, yvalue);
}
traceLength = rand() % 20 + 20 + cycle;
for (; cycle < traceLength; ++cycle) {
unsigned xvalue = rand() % 100;
// setting 'x' var value
trace1->updateTermValue(xid, cycle, xvalue);
trace2->updateTermValue(xid, cycle, xvalue);
// setting 'y' var value
unsigned yvalue = rand() % 100;
trace1->updateTermValue(yid, cycle, yvalue);
trace2->updateTermValue(yid, cycle, !yvalue);
}
result = evaluateTraces(property, tracelist);
EXPECT_FALSE(result);
}
TEST(PropertyLibTest, ValidTraceOperator_XMinus_FMinus) {
PVarMap varmap = std::make_shared<VarMap>();
unsigned xid = varmap->addIntVar("x");
unsigned yid = varmap->addIntVar("y");
std::string formula = "(F- (IMPLIES (EQ x) (X+ (EQ y))))";
auto property = parse_formula(formula, varmap);
PTrace trace1(new Trace(0, 2));
PTrace trace2(new Trace(0, 2));
TraceList tracelist({trace1, trace2});
unsigned xvalue = 0, yvalue = 0;
long cycle = 0;
for (; cycle < 10; ++cycle) {
xvalue = rand() % std::numeric_limits<unsigned>::max();
trace1->updateTermValue(xid, cycle, xvalue);
trace2->updateTermValue(xid, cycle, xvalue);
yvalue = rand() % std::numeric_limits<unsigned>::max();
trace1->updateTermValue(yid, cycle, yvalue);
yvalue = rand() % std::numeric_limits<unsigned>::max();
trace2->updateTermValue(yid, cycle, yvalue);
}
xvalue = rand() % std::numeric_limits<unsigned>::max();
trace1->updateTermValue(xid, cycle, xvalue);
trace2->updateTermValue(xid, cycle, xvalue);
yvalue = rand() % std::numeric_limits<unsigned>::max();
trace1->updateTermValue(yid, cycle, yvalue);
yvalue = rand() % std::numeric_limits<unsigned>::max();
trace2->updateTermValue(yid, cycle, yvalue);
++cycle;
xvalue = rand() % std::numeric_limits<unsigned>::max();
trace1->updateTermValue(xid, cycle, xvalue);
xvalue = rand() % std::numeric_limits<unsigned>::max();
trace2->updateTermValue(xid, cycle, xvalue);
yvalue = rand() % std::numeric_limits<unsigned>::max();
trace1->updateTermValue(yid, cycle, yvalue);
trace2->updateTermValue(yid, cycle, yvalue);
++cycle;
for (; cycle < 20; ++cycle) {
xvalue = rand() % std::numeric_limits<unsigned>::max();
trace1->updateTermValue(xid, cycle, xvalue);
xvalue = rand() % std::numeric_limits<unsigned>::max();
trace2->updateTermValue(xid, cycle, xvalue);
yvalue = rand() % std::numeric_limits<unsigned>::max();
trace1->updateTermValue(yid, cycle, yvalue);
yvalue = rand() % std::numeric_limits<unsigned>::max();
trace2->updateTermValue(yid, cycle, yvalue);
}
bool result = false;
result = evaluateTraces(property, tracelist);
ASSERT_TRUE(result);
}
TEST(PropertyLibTest, InvalidTraceOperator_XMinus_FMinus) {
PVarMap varmap = std::make_shared<VarMap>();
unsigned xid = varmap->addIntVar("x");
unsigned yid = varmap->addIntVar("y");
std::string formula = "(F- (IMPLIES (EQ x) (X- (EQ y))))";
auto property = parse_formula(formula, varmap);
PTrace trace1(new Trace(0, 2));
PTrace trace2(new Trace(0, 2));
TraceList tracelist({trace1, trace2});
unsigned xvalue = 0, yvalue = 0;
long cycle = 0;
for (; cycle < 10; ++cycle) {
xvalue = rand() % std::numeric_limits<unsigned>::max();
trace1->updateTermValue(xid, cycle, xvalue);
trace2->updateTermValue(xid, cycle, xvalue);
yvalue = rand() % std::numeric_limits<unsigned>::max();
trace1->updateTermValue(yid, cycle, yvalue);
trace2->updateTermValue(yid, cycle, !yvalue);
}
bool result = false;
result = evaluateTraces(property, tracelist);
EXPECT_FALSE(result);
}
| 29.94636 | 87 | 0.670164 | skmuduli92 |
5b16a4ac2415ecf7c2f5d50a7f5f5b7738fafef7 | 9,075 | cpp | C++ | listeners/GPII_RFIDListener/src/Diagnostic.cpp | colinbdclark/windows | 3eb9e8c4bda54bc583af7309998ab202370bde23 | [
"BSD-3-Clause"
] | null | null | null | listeners/GPII_RFIDListener/src/Diagnostic.cpp | colinbdclark/windows | 3eb9e8c4bda54bc583af7309998ab202370bde23 | [
"BSD-3-Clause"
] | null | null | null | listeners/GPII_RFIDListener/src/Diagnostic.cpp | colinbdclark/windows | 3eb9e8c4bda54bc583af7309998ab202370bde23 | [
"BSD-3-Clause"
] | null | null | null | ///////////////////////////////////////////////////////////////////////////////
//
// Diagnostic.cpp
//
// Copyright 2014 OpenDirective Ltd.
//
// Licensed under the New BSD license. You may not use this file except in
// compliance with this License.
//
// You may obtain a copy of the License at
// https://github.com/gpii/windows/blob/master/LICENSE.txt
//
// The research leading to these results has received funding from
// the European Union's Seventh Framework Programme (FP7/2007-2013)
// under grant agreement no. 289016.
//
// Access to the diagnostic window
//
// Project Files:
// Diagnostic.cpp
// Diagnostic.h
//
///////////////////////////////////////////////////////////////////////////////
#include <windows.h>
#include <windowsx.h>
#include <Strsafe.h>
#include <Diagnostic.h>
//---------------------------------------------------------
// Global Constants
//---------------------------------------------------------
static const char MY_TITLE[] = "GpiiUserListener Diagnostic";
static const char MY_CLASS[] = "gpiiDiagnosticClass";
static const int MY_SIZE_X = 480;
static const int MY_SIZE_Y = 450;
static const int MY_FONT_HEIGHT = 16;
#define WM_MYLOG WM_USER + 100
#define ID_EDIT 1000
//---------------------------------------------------------
// Global Variables
//---------------------------------------------------------
static HWND g_hWnd = NULL;
static HFONT g_hFont;
//---------------------------------------------------------
// Local Functions:
//---------------------------------------------------------
static ATOM _MyRegisterClass(HINSTANCE hInstance);
static LRESULT CALLBACK _WndProc(HWND, UINT, WPARAM, LPARAM);
///////////////////////////////////////////////////////////////////////////////
//
// FUNCTION: MyRegisterClass()
//
// PURPOSE: Registers the window class.
//
// COMMENTS:
//
// Register our window class so we can create it
//
///////////////////////////////////////////////////////////////////////////////
static ATOM _MyRegisterClass(HINSTANCE hInstance)
{
WNDCLASSEX wcex;
wcex.cbSize = sizeof(WNDCLASSEX);
wcex.style = CS_HREDRAW | CS_VREDRAW;
wcex.lpfnWndProc = (WNDPROC)_WndProc;
wcex.cbClsExtra = 0;
wcex.cbWndExtra = 0;
wcex.hInstance = hInstance;
wcex.hIcon = LoadIcon(NULL, IDI_APPLICATION); // FIXME we have icon files so why not use them?
wcex.hCursor = LoadCursor(NULL, IDC_ARROW);
wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
wcex.lpszMenuName = NULL;
wcex.lpszClassName = MY_CLASS;
wcex.hIconSm = LoadIcon(NULL, IDI_APPLICATION);
return RegisterClassEx(&wcex);
}
///////////////////////////////////////////////////////////////////////////////
//
// FUNCTION: Diagnostic_Init()
//
// PURPOSE: Initialise the diagnostic window
//
// COMMENTS:
//
// Init from InitInstance().
//
///////////////////////////////////////////////////////////////////////////////
BOOL Diagnostic_Init(HINSTANCE hInstance)
{
_MyRegisterClass(hInstance);
RECT rc;
GetWindowRect(GetDesktopWindow(), &rc);
HWND hWnd = CreateWindow(MY_CLASS, MY_TITLE, WS_OVERLAPPEDWINDOW | WS_SYSMENU,
rc.right / 10, rc.bottom / 15,
MY_SIZE_X, rc.bottom - 2 * (rc.bottom / 15), NULL, NULL, hInstance, NULL);
if (!hWnd)
return FALSE;
// Window style for the edit control.
DWORD dwStyle = WS_CHILD | WS_VISIBLE | WS_HSCROLL | WS_VSCROLL |
WS_BORDER | ES_LEFT | ES_MULTILINE | ES_NOHIDESEL |
ES_AUTOHSCROLL | ES_AUTOVSCROLL | ES_READONLY;
// Create the edit control window.
HWND hwndEdit = CreateWindowEx(
0, TEXT("edit"),
NULL, // No Window title
dwStyle, // Window style
0, 0, 0, 0, // Set size in WM_SIZE of parent
hWnd, // Parent window
(HMENU) ID_EDIT, // Control identifier
hInstance, // Instance handle
NULL);
if (!hwndEdit)
return FALSE;
// Select a non proportional font
g_hFont = CreateFont(MY_FONT_HEIGHT, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, TEXT("Courier New"));
SetWindowFont(hwndEdit, g_hFont, FALSE);
g_hWnd = hWnd;
return TRUE;
}
void Diagnostic_CleanUp(void)
{
DestroyWindow(g_hWnd);
}
void Diagnostic_Show(BOOL bShow)
{
ShowWindow(g_hWnd, (bShow) ? SW_SHOW : SW_HIDE);
}
BOOL Diagnostic_IsShowing(void)
{
return IsWindowVisible(g_hWnd);
}
///////////////////////////////////////////////////////////////////////////////
//
// FUNCTION: WndProc(HWND, unsigned, WORD, LONG)
//
// PURPOSE: Processes messages for the main window.
//
// WM_COMMAND - process the application menu
// WM_PAINT - Paint the main window
// WM_DESTROY - post a quit message and return
// WM_MYTRAY - a mouse command on the tray icon
// WM_DEVICECHANGE - a change to a device on this pc
//
///////////////////////////////////////////////////////////////////////////////
LRESULT CALLBACK _WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message)
{
//-----------------------------------------------------------
// Tray Icon Menu Commands to Show, Hide, Exit or Logout
//-----------------------------------------------------------
case WM_MYLOG:
{
LPCSTR pszStr = (LPCSTR)lParam;
// Append text - note will eventually fill up
const HWND hwndEdit = GetWindow(hWnd, GW_CHILD);
int len = Edit_GetTextLength(hwndEdit);
Edit_SetSel(hwndEdit, len, len);
Edit_ReplaceSel(hwndEdit, pszStr);
HANDLE hheap = GetProcessHeap();
HeapFree(hheap, 0, (LPVOID)pszStr);
}
break;
case WM_SETFOCUS:
{
const HWND hwndEdit = GetWindow(hWnd, GW_CHILD);
SetFocus(hwndEdit);
return 0;
}
case WM_SIZE:
// Make the edit control the size of the window's client area.
{
const HWND hwndEdit = GetWindow(hWnd, GW_CHILD);
MoveWindow(hwndEdit,
0, 0, // starting x- and y-coordinates
LOWORD(lParam), // width of client area
HIWORD(lParam), // height of client area
TRUE); // repaint window
return 0;
}
//-----------------------------------------------------------
// Close [X] Hides the Window
//-----------------------------------------------------------
case WM_CLOSE:
{
const HWND hwndEdit = GetWindow(hWnd, GW_CHILD);
Edit_SetText(hwndEdit, "");
}
break;
//-----------------------------------------------------------
// Cleanup resources
//-----------------------------------------------------------
case WM_DESTROY:
DeleteObject(g_hFont);
break;
//-----------------------------------------------------------
// Default Window Proc
//-----------------------------------------------------------
default:
return DefWindowProc(hWnd, message, wParam, lParam);
}
return 0;
}
#define _countof(a) (sizeof(a)/sizeof(a[0]))
///////////////////////////////////////////////////////////////////////////////
//
// FUNCTION: Diagnostic_LogString(LPCSTR pszPrefix, LPCSTR pszStr)
//
// PURPOSE: Cause a string to be logged in the daignostic window.
//
// NOTES: We PostMessage to be more thread safe. String is on Process Heap
//
///////////////////////////////////////////////////////////////////////////////
void Diagnostic_LogString(LPCSTR pszPrefix, LPCSTR pszString)
{
pszPrefix = (pszPrefix) ? pszPrefix : "";
pszString = (pszString) ? pszString : "";
const STRSAFE_LPCSTR pszFormat = TEXT("%s: %s\r\n");
HANDLE hheap = GetProcessHeap();
SIZE_T cbHeap = strlen(pszPrefix) + strlen(pszString) + strlen(pszFormat);
STRSAFE_LPSTR pszStrLog = (STRSAFE_LPSTR)HeapAlloc(hheap, 0, cbHeap);
if (pszStrLog)
{
(void)StringCchPrintf(pszStrLog, cbHeap, pszFormat, pszPrefix, pszString);
PostMessage(g_hWnd, WM_MYLOG, NULL, (LPARAM)pszStrLog);
}
}
//FIXME perhaps inline these functions. Perhasp use pointers not indexes
void Diagnostic_PrintHexBytes(LPTSTR pszDest, size_t cchDest, LPCBYTE pBytes, size_t cBytes)
{
*pszDest = '\0';
for (size_t i = 0; i < cBytes; i++)
{
(void)StringCchPrintf(&pszDest[i * 3], cchDest - (i * 3), TEXT("%02hhx "), pBytes[i]);
}
}
void Diagnostic_PrintCharBytes(LPTSTR pszDest, size_t cchDest, LPCBYTE pBytes, size_t cBytes)
{
*pszDest = '\0';
for (size_t i = 0; i < cBytes; i++)
{
(void)StringCchPrintf(&pszDest[i], cchDest - i, TEXT("%c"), pBytes[i]);
}
}
void Diagnostic_LogHexBlock(UINT uSector, UINT uBlock, LPCBYTE pbBlock, size_t cBytes)
{
static TCHAR pszPrefix[20];
static TCHAR pszString[500];
LPCTSTR pszFormatPrefix = TEXT("%02u-%02u");
(void)StringCchPrintf(pszPrefix, _countof(pszPrefix), pszFormatPrefix, uSector, uBlock);
Diagnostic_PrintHexBytes(pszString, _countof(pszString), pbBlock, cBytes);
Diagnostic_LogString(pszPrefix, pszString);
}
| 30.555556 | 98 | 0.53168 | colinbdclark |
5b1889c5959378c5db3f7e2f15ab2b20ed176b81 | 2,291 | cpp | C++ | YorozuyaGSLib/source/US__AbstractThreadDetail.cpp | lemkova/Yorozuya | f445d800078d9aba5de28f122cedfa03f26a38e4 | [
"MIT"
] | 29 | 2017-07-01T23:08:31.000Z | 2022-02-19T10:22:45.000Z | YorozuyaGSLib/source/US__AbstractThreadDetail.cpp | kotopes/Yorozuya | 605c97d3a627a8f6545cc09f2a1b0a8afdedd33a | [
"MIT"
] | 90 | 2017-10-18T21:24:51.000Z | 2019-06-06T02:30:33.000Z | YorozuyaGSLib/source/US__AbstractThreadDetail.cpp | kotopes/Yorozuya | 605c97d3a627a8f6545cc09f2a1b0a8afdedd33a | [
"MIT"
] | 44 | 2017-12-19T08:02:59.000Z | 2022-02-24T23:15:01.000Z | #include <US__AbstractThreadDetail.hpp>
#include <common/ATFCore.hpp>
START_ATF_NAMESPACE
namespace US
{
namespace Detail
{
Info::US__AbstractThreadctor_AbstractThread2_ptr US__AbstractThreadctor_AbstractThread2_next(nullptr);
Info::US__AbstractThreadctor_AbstractThread2_clbk US__AbstractThreadctor_AbstractThread2_user(nullptr);
Info::US__AbstractThreaddtor_AbstractThread7_ptr US__AbstractThreaddtor_AbstractThread7_next(nullptr);
Info::US__AbstractThreaddtor_AbstractThread7_clbk US__AbstractThreaddtor_AbstractThread7_user(nullptr);
void US__AbstractThreadctor_AbstractThread2_wrapper(struct US::AbstractThread* _this)
{
US__AbstractThreadctor_AbstractThread2_user(_this, US__AbstractThreadctor_AbstractThread2_next);
};
void US__AbstractThreaddtor_AbstractThread7_wrapper(struct US::AbstractThread* _this)
{
US__AbstractThreaddtor_AbstractThread7_user(_this, US__AbstractThreaddtor_AbstractThread7_next);
};
::std::array<hook_record, 2> AbstractThread_functions =
{
_hook_record {
(LPVOID)0x14041d660L,
(LPVOID *)&US__AbstractThreadctor_AbstractThread2_user,
(LPVOID *)&US__AbstractThreadctor_AbstractThread2_next,
(LPVOID)cast_pointer_function(US__AbstractThreadctor_AbstractThread2_wrapper),
(LPVOID)cast_pointer_function((void(US::AbstractThread::*)())&US::AbstractThread::ctor_AbstractThread)
},
_hook_record {
(LPVOID)0x14041d6e0L,
(LPVOID *)&US__AbstractThreaddtor_AbstractThread7_user,
(LPVOID *)&US__AbstractThreaddtor_AbstractThread7_next,
(LPVOID)cast_pointer_function(US__AbstractThreaddtor_AbstractThread7_wrapper),
(LPVOID)cast_pointer_function((void(US::AbstractThread::*)())&US::AbstractThread::dtor_AbstractThread)
},
};
}; // end namespace Detail
}; // end namespace US
END_ATF_NAMESPACE
| 46.755102 | 122 | 0.647316 | lemkova |
5b1f73ee50254763be96b6984639258706861a64 | 3,640 | cpp | C++ | Boggle/code_1.cpp | Jatin-Goyal5/Data-Structures-and-Algorithms | f6bd0f77e5640c2e0568f3fffc4694758e77af96 | [
"MIT"
] | 27 | 2019-01-31T10:22:29.000Z | 2021-08-29T08:25:12.000Z | Boggle/code_1.cpp | Jatin-Goyal5/Data-Structures-and-Algorithms | f6bd0f77e5640c2e0568f3fffc4694758e77af96 | [
"MIT"
] | 6 | 2020-09-30T19:01:49.000Z | 2020-12-17T15:10:54.000Z | Boggle/code_1.cpp | Jatin-Goyal5/Data-Structures-and-Algorithms | f6bd0f77e5640c2e0568f3fffc4694758e77af96 | [
"MIT"
] | 27 | 2019-09-21T14:19:32.000Z | 2021-09-15T03:06:41.000Z | //
// code_1.cpp
// Algorithm
//
// Created by Mohd Shoaib Rayeen on 23/11/18.
// Copyright © 2018 Shoaib Rayeen. All rights reserved.
//
#include <iostream>
using namespace std;
#define char_int(c) ((int)c - (int)'A')
#define SIZE (26)
#define M 3
#define N 3
struct TrieNode {
TrieNode *Child[SIZE];
bool leaf;
};
TrieNode *getNode() {
TrieNode * newNode = new TrieNode;
newNode->leaf = false;
for (int i =0 ; i< SIZE ; i++) {
newNode->Child[i] = NULL;
}
return newNode;
}
void insert(TrieNode *root, char *Key) {
size_t n = strlen(Key);
TrieNode * pChild = root;
for (int i = 0; i < n; i++) {
int index = char_int(Key[i]);
if (pChild->Child[index] == NULL) {
pChild->Child[index] = getNode();
}
pChild = pChild->Child[index];
}
pChild->leaf = true;
}
bool isSafe(int i, int j, bool visited[M][N]) {
return (i >=0 && i < M && j >=0 && j < N && !visited[i][j]);
}
void searchWord(TrieNode *root, char boggle[M][N], int i, int j, bool visited[][N], string str) {
if (root->leaf == true) {
cout << str << endl ;
}
if (isSafe(i, j, visited)) {
visited[i][j] = true;
for (int K =0; K < SIZE; K++) {
if (root->Child[K] != NULL) {
char ch = (char)K + (char)'A' ;
if (isSafe(i+1,j+1,visited) && boggle[i+1][j+1] == ch) {
searchWord(root->Child[K],boggle,i+1,j+1,visited,str+ch);
}
if (isSafe(i, j+1,visited) && boggle[i][j+1] == ch) {
searchWord(root->Child[K],boggle,i, j+1,visited,str+ch);
}
if (isSafe(i-1,j+1,visited) && boggle[i-1][j+1] == ch) {
searchWord(root->Child[K],boggle,i-1, j+1,visited,str+ch);
}
if (isSafe(i+1,j, visited) && boggle[i+1][j] == ch) {
searchWord(root->Child[K],boggle,i+1, j,visited,str+ch);
}
if (isSafe(i+1,j-1,visited) && boggle[i+1][j-1] == ch) {
searchWord(root->Child[K],boggle,i+1, j-1,visited,str+ch);
}
if (isSafe(i, j-1,visited)&& boggle[i][j-1] == ch) {
searchWord(root->Child[K],boggle,i,j-1,visited,str+ch);
}
if (isSafe(i-1,j-1,visited) && boggle[i-1][j-1] == ch) {
searchWord(root->Child[K],boggle,i-1, j-1,visited,str+ch);
}
if (isSafe(i-1, j,visited) && boggle[i-1][j] == ch) {
searchWord(root->Child[K],boggle,i-1, j, visited,str+ch);
}
}
}
visited[i][j] = false;
}
}
void findWords(char boggle[M][N], TrieNode *root) {
bool visited[M][N];
memset(visited,false,sizeof(visited));
TrieNode *pChild = root ;
string str = "";
for (int i = 0 ; i < M; i++) {
for (int j = 0 ; j < N ; j++) {
if (pChild->Child[char_int(boggle[i][j])] ) {
str = str+boggle[i][j];
searchWord(pChild->Child[char_int(boggle[i][j])], boggle, i, j, visited, str);
str = "";
}
}
}
}
int main() {
char *dictionary[] = {"GEEKS", "FOR", "QUIZ", "GEE"};
TrieNode *root = getNode();
int n = sizeof(dictionary)/sizeof(dictionary[0]);
for (int i=0; i<n; i++) {
insert(root, dictionary[i]);
}
char boggle[M][N] = {
{'G','I','Z'},
{'U','E','K'},
{'Q','S','E'}
};
findWords(boggle, root);
return 0;
}
| 28.4375 | 97 | 0.467308 | Jatin-Goyal5 |
5b1fc763f2b4d71d72ca122a57c98b9e2f695e8a | 1,821 | hpp | C++ | src/hex_pathfinding.hpp | cbeck88/HexWarfare | 94a70b1889afc2fbd990892ed66be874ac70d1b4 | [
"Apache-2.0"
] | null | null | null | src/hex_pathfinding.hpp | cbeck88/HexWarfare | 94a70b1889afc2fbd990892ed66be874ac70d1b4 | [
"Apache-2.0"
] | null | null | null | src/hex_pathfinding.hpp | cbeck88/HexWarfare | 94a70b1889afc2fbd990892ed66be874ac70d1b4 | [
"Apache-2.0"
] | null | null | null | /*
Copyright 2014 Kristina Simpson <sweet.kristas@gmail.com>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#pragma once
#include <tuple>
#include <boost/graph/astar_search.hpp>
#include <boost/graph/adjacency_list.hpp>
#include "geometry.hpp"
#include "game_state.hpp"
#include "hex_logical_fwd.hpp"
namespace hex
{
typedef float cost;
typedef point node_type;
typedef boost::adjacency_list<boost::listS, boost::vecS, boost::undirectedS, boost::no_property, boost::property<boost::edge_weight_t, cost>> hex_graph;
typedef boost::property_map<hex_graph, boost::edge_weight_t>::type WeightMap;
typedef hex_graph::vertex_descriptor vertex;
typedef hex_graph::edge_descriptor edge_descriptor;
typedef std::pair<point, point> edge;
struct graph_t
{
graph_t(size_t size) : graph(size) {}
hex_graph graph;
std::map<point, int> reverse_map;
std::vector<point> vertices;
};
typedef std::shared_ptr<graph_t> hex_graph_ptr;
typedef std::vector<point> result_path;
hex_graph_ptr create_cost_graph(const game::state& gs, const point& src, float max_cost);
hex_graph_ptr create_graph(const game::state& gs, int x=0, int y=0, int w=0, int h=0);
result_list find_available_moves(hex_graph_ptr graph, const point& src, float max_cost);
result_path find_path(hex_graph_ptr graph, const point& src, const point& dst);
}
| 34.358491 | 153 | 0.772103 | cbeck88 |
5b212909a05b5b47a6fb5f163a4ee1a9f760e082 | 2,291 | cpp | C++ | src/options.cpp | spjewkes/jrnz | 5a7706c102e19f7e004ffc4fda87843790f804b3 | [
"MIT"
] | null | null | null | src/options.cpp | spjewkes/jrnz | 5a7706c102e19f7e004ffc4fda87843790f804b3 | [
"MIT"
] | 29 | 2017-03-18T08:29:08.000Z | 2019-09-13T12:20:25.000Z | src/options.cpp | spjewkes/jrnz | 5a7706c102e19f7e004ffc4fda87843790f804b3 | [
"MIT"
] | null | null | null | /**
* @brief Source file implementing the programm options class.
*/
#include <iostream>
#include <getopt.h>
#include "options.hpp"
void Options::print_help()
{
std::cout << "Run: " << m_argv[0] << "[--help] [--debug] [--rom <filename>] [--break <line_no>]\n";
std::cout << "\t--help - displays this help\n";
std::cout << "\t--rom <filename> - Loads the specified ROM file (at address 0)\n";
std::cout << "\t--sna <filename> - Loads the specified SNA file into memory (at address 16384)\n";
std::cout << "\t--debug - switched on debug output\n";
std::cout << "\t--break <line_no> - Enable breakpoint at the specified line number\n";
std::cout << "\t--fast - Enable fast mode (ignores cycles and runs as fast as possible)\n";
std::cout << "\t--pause - Pause window before closing application (useful for debugging)\n";
exit(EXIT_SUCCESS);
}
void Options::process()
{
static struct option long_options[] =
{
{ "help", no_argument, 0, 'h' },
{ "debug", no_argument, 0, 'd' },
{ "fast", no_argument, 0, 'f' },
{ "pause", no_argument, 0, 'p' },
{ "rom", required_argument, 0, 'r' },
{ "break", required_argument, 0, 'b' },
{ "sna", required_argument, 0, 's' },
{ 0, 0, 0, 0 }
};
int c;
while (1)
{
int option_index = 0;
c = getopt_long(m_argc, m_argv, "hdfpr:s:", long_options, &option_index);
if (c == -1)
{
break;
}
switch (c)
{
case 'h':
{
print_help();
break;
}
case 'd':
{
debug_mode = true;
break;
}
case 'f':
{
fast_mode = true;
break;
}
case 'p':
{
pause_on_quit = true;
break;
}
case 'r':
{
rom_file = optarg;
rom_on = true;
break;
}
case 's':
{
sna_file = optarg;
sna_on = true;
break;
}
case 'b':
{
unsigned long int val = strtoul(optarg, NULL, 0);
if (val > UINT16_MAX)
{
std::cerr << "Break line should not exceed a 16-bit address\n";
abort();
}
break_addr = static_cast<uint16_t>(val);
break_on = true;
break;
}
}
}
}
| 21.212963 | 103 | 0.507639 | spjewkes |
5b21786e54a5cf1abf566e8988f8e7e8d35cf6a7 | 542 | cpp | C++ | Example/signals2_09/main.cpp | KwangjoJeong/Boost | 29c4e2422feded66a689e3aef73086c5cf95b6fe | [
"MIT"
] | null | null | null | Example/signals2_09/main.cpp | KwangjoJeong/Boost | 29c4e2422feded66a689e3aef73086c5cf95b6fe | [
"MIT"
] | null | null | null | Example/signals2_09/main.cpp | KwangjoJeong/Boost | 29c4e2422feded66a689e3aef73086c5cf95b6fe | [
"MIT"
] | null | null | null | #include <boost/signals2.hpp>
#include <vector>
#include <algorithm>
#include <iostream>
using namespace boost::signals2;
template <typename T>
struct return_all
{
typedef T result_type;
template <typename InputIterator>
T operator()(InputIterator first, InputIterator last) const
{
return T(first, last);
}
};
int main()
{
signal<int(), return_all<std::vector<int>>> s;
s.connect([]{ return 1; });
s.connect([]{ return 2; });
std::vector<int> v = s();
std::cout << *std::min_element(v.begin(), v.end()) << '\n';
} | 20.074074 | 61 | 0.654982 | KwangjoJeong |
5b21815c57f4d6d963a85fa20cd49e71e3769472 | 881 | cpp | C++ | solutions/LeetCode/C++/708.cpp | timxor/leetcode-journal | 5f1cb6bcc44a5bc33d88fb5cdb4126dfc6f4232a | [
"MIT"
] | 854 | 2018-11-09T08:06:16.000Z | 2022-03-31T06:05:53.000Z | solutions/LeetCode/C++/708.cpp | timxor/leetcode-journal | 5f1cb6bcc44a5bc33d88fb5cdb4126dfc6f4232a | [
"MIT"
] | 29 | 2019-06-02T05:02:25.000Z | 2021-11-15T04:09:37.000Z | solutions/LeetCode/C++/708.cpp | timxor/leetcode-journal | 5f1cb6bcc44a5bc33d88fb5cdb4126dfc6f4232a | [
"MIT"
] | 347 | 2018-12-23T01:57:37.000Z | 2022-03-12T14:51:21.000Z | __________________________________________________________________________________________________
class Solution {
public:
Node* insert(Node* head, int insertVal) {
if (!head) {
head = new Node(insertVal, NULL);
head->next = head;
return head;
}
Node *pre = head, *cur = pre->next;
while (cur != head) {
if (pre->val <= insertVal && cur->val >= insertVal) break;
if (pre->val > cur->val && (pre->val <= insertVal || cur->val >= insertVal)) break;
pre = cur;
cur = cur->next;
}
pre->next = new Node(insertVal, cur);
return head;
}
};
__________________________________________________________________________________________________
__________________________________________________________________________________________________
| 36.708333 | 98 | 0.642452 | timxor |
5b22a1f788e2575fadac2c4ae7a61c8d2985312a | 1,180 | cc | C++ | chrome/browser/ui/commander/commander.cc | chromium/chromium | df46e572c3449a4b108d6e02fbe4f6d24cf98381 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 14,668 | 2015-01-01T01:57:10.000Z | 2022-03-31T23:33:32.000Z | chrome/browser/ui/commander/commander.cc | chromium/chromium | df46e572c3449a4b108d6e02fbe4f6d24cf98381 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 86 | 2015-10-21T13:02:42.000Z | 2022-03-14T07:50:50.000Z | chrome/browser/ui/commander/commander.cc | chromium/chromium | df46e572c3449a4b108d6e02fbe4f6d24cf98381 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 5,941 | 2015-01-02T11:32:21.000Z | 2022-03-31T16:35:46.000Z | // Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/ui/commander/commander.h"
#include "base/no_destructor.h"
#include "chrome/browser/ui/commander/commander_controller.h"
#include "chrome/browser/ui/commander/commander_frontend.h"
#include "chrome/browser/ui/ui_features.h"
#include "content/public/browser/browser_thread.h"
namespace commander {
bool IsEnabled() {
return base::FeatureList::IsEnabled(features::kCommander);
}
// static
Commander* Commander::Get() {
static base::NoDestructor<Commander> instance;
return instance.get();
}
Commander::Commander() = default;
Commander::~Commander() = default;
void Commander::Initialize() {
DCHECK(IsEnabled());
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
DCHECK(!backend_ && !frontend_);
backend_ = std::make_unique<CommanderController>();
frontend_ = CommanderFrontend::Create(backend_.get());
}
void Commander::ToggleForBrowser(Browser* browser) {
DCHECK(IsEnabled());
DCHECK(frontend_);
frontend_->ToggleForBrowser(browser);
}
} // namespace commander
| 27.44186 | 73 | 0.754237 | chromium |
5b22f927d629a0595735e30fa52ce74c0d7fcbd7 | 2,201 | cpp | C++ | 44_DigitsInSequence/DigitsInSequence.cpp | NoMoreWaiting/CodingInterviewChinese2 | 458b2fb52b91a6601fd9b70dd3b973d30c2f3f52 | [
"BSD-3-Clause"
] | null | null | null | 44_DigitsInSequence/DigitsInSequence.cpp | NoMoreWaiting/CodingInterviewChinese2 | 458b2fb52b91a6601fd9b70dd3b973d30c2f3f52 | [
"BSD-3-Clause"
] | null | null | null | 44_DigitsInSequence/DigitsInSequence.cpp | NoMoreWaiting/CodingInterviewChinese2 | 458b2fb52b91a6601fd9b70dd3b973d30c2f3f52 | [
"BSD-3-Clause"
] | null | null | null | /*******************************************************************
Copyright(c) 2016, Harry He
All rights reserved.
Distributed under the BSD license.
(See accompanying file LICENSE.txt at
https://github.com/zhedahht/CodingInterviewChinese2/blob/master/LICENSE.txt)
*******************************************************************/
//==================================================================
// 《剑指Offer——名企面试官精讲典型编程题》代码
// 作者:何海涛
//==================================================================
// 面试题44:数字序列中某一位的数字
// 题目:数字以0123456789101112131415…的格式序列化到一个字符序列中。在这
// 个序列中,第5位(从0开始计数)是5,第13位是1,第19位是4,等等。请写一
// 个函数求任意位对应的数字。
#include <iostream>
#include <algorithm>
#include <cmath>
using namespace std;
int countOfIntegers(int digits);
int digitAtIndex(int index, int digits);
int beginNumber(int digits);
int digitAtIndex(int index)
{
if(index < 0)
return -1;
int digits = 1;
while(true)
{
int numbers = countOfIntegers(digits);
if(index < numbers * digits)
return digitAtIndex(index, digits);
index -= digits * numbers;
digits++;
}
return -1;
}
int countOfIntegers(int digits)
{
if(digits == 1)
return 10;
int count = (int) std::pow(10, digits - 1);
return 9 * count;
}
int digitAtIndex(int index, int digits)
{
int number = beginNumber(digits) + index / digits;
int indexFromRight = digits - index % digits;
for(int i = 1; i < indexFromRight; ++i)
number /= 10;
return number % 10;
}
int beginNumber(int digits)
{
if(digits == 1)
return 0;
return (int) std::pow(10, digits - 1);
}
// ====================测试代码====================
void test(const char* testName, int inputIndex, int expectedOutput)
{
if(digitAtIndex(inputIndex) == expectedOutput)
cout << testName << " passed." << endl;
else
cout << testName << " FAILED." << endl;
}
int main()
{
test((char *)"test1", 0, 0);
test((char *)"test2", 1, 1);
test((char *)"test3", 9, 9);
test((char *)"test4", 10, 1);
test((char *)"test5", 189, 9); // 数字99的最后一位,9
test((char *)"test6", 190, 1); // 数字100的第一位,1
test((char *)"test7", 1000, 3); // 数字370的第一位,3
test((char *)"test8", 1001, 7); // 数字370的第二位,7
test((char *)"test9", 1002, 0); // 数字370的第三位,0
return 0;
} | 22.690722 | 76 | 0.569741 | NoMoreWaiting |
5b23bffd5b659712ed85ddb653b3f0201114a184 | 2,060 | cc | C++ | cnet_network_delegate.cc | yahoo/cnet | d36ee43bd86ac13df5bd034f61af96b98bfed65a | [
"BSD-3-Clause"
] | 16 | 2015-02-04T17:15:04.000Z | 2019-05-14T11:53:29.000Z | cnet_network_delegate.cc | yahoo/cnet | d36ee43bd86ac13df5bd034f61af96b98bfed65a | [
"BSD-3-Clause"
] | null | null | null | cnet_network_delegate.cc | yahoo/cnet | d36ee43bd86ac13df5bd034f61af96b98bfed65a | [
"BSD-3-Clause"
] | 13 | 2015-04-15T07:28:05.000Z | 2019-06-19T01:47:26.000Z | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Changes to this code are Copyright 2014, Yahoo! Inc.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "yahoo/cnet/cnet_network_delegate.h"
#include "net/base/net_errors.h"
namespace cnet {
CnetNetworkDelegate::CnetNetworkDelegate() {
}
CnetNetworkDelegate::~CnetNetworkDelegate() {
}
int CnetNetworkDelegate::OnBeforeURLRequest(net::URLRequest* request,
const net::CompletionCallback& callback, GURL* new_url) {
return net::OK;
}
int CnetNetworkDelegate::OnBeforeSendHeaders(net::URLRequest* request,
const net::CompletionCallback& callback,
net::HttpRequestHeaders* headers) {
return net::OK;
}
int CnetNetworkDelegate::OnHeadersReceived(
net::URLRequest* request,
const net::CompletionCallback& callback,
const net::HttpResponseHeaders* original_response_headers,
scoped_refptr<net::HttpResponseHeaders>* _response_headers,
GURL* allowed_unsafe_redirect_url) {
return net::OK;
}
net::NetworkDelegate::AuthRequiredResponse
CnetNetworkDelegate::OnAuthRequired(
net::URLRequest* request,
const net::AuthChallengeInfo& auth_info,
const AuthCallback& callback,
net::AuthCredentials* credentials) {
return net::NetworkDelegate::AUTH_REQUIRED_RESPONSE_NO_ACTION;
}
bool CnetNetworkDelegate::OnCanGetCookies(const net::URLRequest& request,
const net::CookieList& cookie_list) {
return false;
}
bool CnetNetworkDelegate::OnCanSetCookie(const net::URLRequest& request,
const std::string& cookie_line, net::CookieOptions* options) {
return false;
}
bool CnetNetworkDelegate::OnCanAccessFile(const net::URLRequest& request,
const base::FilePath& path) const {
return false;
}
bool CnetNetworkDelegate::OnCanThrottleRequest(const net::URLRequest& request) const {
return false;
}
int CnetNetworkDelegate::OnBeforeSocketStreamConnect( net::SocketStream* stream,
const net::CompletionCallback& callback) {
return net::OK;
}
} // namespace cnet
| 28.611111 | 86 | 0.766505 | yahoo |
5b240a57d34a46dc1bec99d97e7f964d1405ae3d | 2,761 | cpp | C++ | src/Utils/String.cpp | vincentdelpech/biorbd | 0d7968e75e182f067a4d4c24cc15fa9a331ca792 | [
"MIT"
] | null | null | null | src/Utils/String.cpp | vincentdelpech/biorbd | 0d7968e75e182f067a4d4c24cc15fa9a331ca792 | [
"MIT"
] | null | null | null | src/Utils/String.cpp | vincentdelpech/biorbd | 0d7968e75e182f067a4d4c24cc15fa9a331ca792 | [
"MIT"
] | null | null | null | #define BIORBD_API_EXPORTS
#include "Utils/String.h"
#include <map>
#include <algorithm>
#include <vector>
#include <boost/lexical_cast.hpp>
#include "Utils/Error.h"
biorbd::utils::String::String()
: std::string("")
{
}
biorbd::utils::String::String(const char *c)
: std::string(c)
{
}
biorbd::utils::String::String(const String &s)
: std::string(s)
{
}
biorbd::utils::String::String(const std::basic_string<char> &c)
: std::string(c)
{
}
biorbd::utils::String &biorbd::utils::String::operator=(const biorbd::utils::String &other)
{
if (this==&other) // check for self-assigment
return *this;
this->std::string::operator=(other);
return *this;
}
biorbd::utils::String biorbd::utils::String::operator+(const char *c){
String tp = *this;
tp.append(c);
return tp;
}
biorbd::utils::String biorbd::utils::String::operator+(double d){
return *this + boost::lexical_cast<std::string>(d);
}
biorbd::utils::String biorbd::utils::String::operator+(unsigned int d){
return *this + boost::lexical_cast<std::string>(d);
}
biorbd::utils::String biorbd::utils::String::operator+(int d){
return *this + boost::lexical_cast<std::string>(d);
}
biorbd::utils::String biorbd::utils::String::operator()(unsigned int i) const{
biorbd::utils::Error::check(i<this->length(), "Index for string out of range");
char out[2];
out[0] = (*this)[i];
out[1] = '\0';
return out;
}
biorbd::utils::String biorbd::utils::String::operator()(unsigned int i, unsigned int j) const{
biorbd::utils::Error::check((i<this->length() || j<this->length()), "Index for string out of range");
biorbd::utils::Error::check(j>i, "Second argument should be higher than first!");
char *out = static_cast<char*>(malloc(j-i+2*sizeof(char)));
for (unsigned int k=0; k<j-i+1; ++k)
out[k] = (*this)[i+k];
out[j-i+1] = '\0';
biorbd::utils::String Out(out);
free(out);
return Out;
}
biorbd::utils::String::~String()
{
}
biorbd::utils::String biorbd::utils::String::tolower(const biorbd::utils::String &str){
biorbd::utils::String new_str = str;
std::transform(new_str.begin(), new_str.end(), new_str.begin(), ::tolower);
return new_str;
}
biorbd::utils::String biorbd::utils::String::tolower() const{
return tolower(*this);
}
biorbd::utils::String biorbd::utils::String::toupper(const biorbd::utils::String &str){
biorbd::utils::String new_str = str;
std::transform(new_str.begin(), new_str.end(), new_str.begin(), ::toupper);
return new_str;
}
biorbd::utils::String biorbd::utils::String::toupper() const{
return toupper(*this);
}
std::ostream &operator<<(std::ostream &os, const biorbd::utils::String &a)
{
os << a.c_str();
return os;
}
| 25.330275 | 105 | 0.648678 | vincentdelpech |
5b24ce8aae34b943b10c84e33e9fb73e4a00f68e | 16,480 | hh | C++ | dune/gdt/interpolations/boundary.hh | pymor/dune-gdt | fabc279a79e7362181701866ce26133ec40a05e0 | [
"BSD-2-Clause"
] | 4 | 2018-10-12T21:46:08.000Z | 2020-08-01T18:54:02.000Z | dune/gdt/interpolations/boundary.hh | dune-community/dune-gdt | fabc279a79e7362181701866ce26133ec40a05e0 | [
"BSD-2-Clause"
] | 154 | 2016-02-16T13:50:54.000Z | 2021-12-13T11:04:29.000Z | dune/gdt/interpolations/boundary.hh | dune-community/dune-gdt | fabc279a79e7362181701866ce26133ec40a05e0 | [
"BSD-2-Clause"
] | 5 | 2016-03-02T10:11:20.000Z | 2020-02-08T03:56:24.000Z | // This file is part of the dune-gdt project:
// https://github.com/dune-community/dune-gdt
// Copyright 2010-2018 dune-gdt developers and contributors. All rights reserved.
// License: Dual licensed as BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)
// or GPL-2.0+ (http://opensource.org/licenses/gpl-license)
// with "runtime exception" (http://www.dune-project.org/license.html)
// Authors:
// Felix Schindler (2019)
#ifndef DUNE_GDT_INTERPOLATIONS_BOUNDARY_HH
#define DUNE_GDT_INTERPOLATIONS_BOUNDARY_HH
#include <dune/geometry/referenceelements.hh>
#include <dune/grid/common/rangegenerators.hh>
#include <dune/xt/grid/boundaryinfo/interfaces.hh>
#include <dune/xt/grid/type_traits.hh>
#include <dune/xt/functions/generic/function.hh>
#include <dune/xt/functions/generic/grid-function.hh>
#include <dune/xt/functions/grid-function.hh>
#include <dune/gdt/exceptions.hh>
#include "default.hh"
namespace Dune {
namespace GDT {
// ### Variants for GridFunctionInterface
/**
* \brief Interpolates a localizable function restricted to certain boundary intersections within a given space [most
* general variant].
*
* Simply uses the interpolation() of the target spaces finite_element() and selects only those DoFs which lie on
* intersections of correct boundary type.
*
* \note The same restrictions apply as for the default interpolations.
*/
template <class GV, size_t r, size_t rC, class R, class V, class IGV>
std::enable_if_t<std::is_same<XT::Grid::extract_entity_t<GV>, typename IGV::Grid::template Codim<0>::Entity>::value,
void>
boundary_interpolation(const XT::Functions::GridFunctionInterface<XT::Grid::extract_entity_t<GV>, r, rC, R>& source,
DiscreteFunction<V, GV, r, rC, R>& target,
const GridView<IGV>& interpolation_grid_view,
const XT::Grid::BoundaryInfo<XT::Grid::extract_intersection_t<GridView<IGV>>>& boundary_info,
const XT::Grid::BoundaryType& target_boundary_type)
{
using D = typename GridView<IGV>::ctype;
static constexpr int d = GridView<IGV>::dimension;
auto local_dof_vector = target.dofs().localize();
auto local_source = source.local_function();
DynamicVector<R> local_dofs(target.space().mapper().max_local_size());
const auto target_basis = target.space().basis().localize();
for (auto&& element : elements(interpolation_grid_view)) {
// first check if we should do something at all on this element
size_t matching_boundary_intersections = 0;
for (auto&& intersection : intersections(interpolation_grid_view, element))
if (boundary_info.type(intersection) == target_boundary_type)
++matching_boundary_intersections;
if (matching_boundary_intersections) {
target_basis->bind(element);
// some preparations
local_source->bind(element);
local_dof_vector.bind(element);
const auto& fe = target_basis->finite_element();
// interpolate
fe.interpolation().interpolate(
[&](const auto& xx) { return local_source->evaluate(xx); }, local_source->order(), local_dofs);
const auto& reference_element = ReferenceElements<D, d>::general(element.type());
// but keep only those DoFs associated with the intersection, therefore determine these DoFs
std::set<size_t> local_target_boundary_DoFs;
const auto local_key_indices = fe.coefficients().local_key_indices();
for (auto&& intersection : intersections(interpolation_grid_view, element)) {
if (boundary_info.type(intersection) == target_boundary_type) {
const auto intersection_index = intersection.indexInInside();
for (const auto& local_DoF : local_key_indices[1][intersection_index])
local_target_boundary_DoFs.insert(local_DoF);
for (int cc = 2; cc <= d; ++cc) {
for (int ii = 0; ii < reference_element.size(intersection_index, 1, cc); ++ii) {
const auto subentity_id = reference_element.subEntity(intersection_index, 1, ii, cc);
for (const auto& local_DoF : local_key_indices[cc][subentity_id])
local_target_boundary_DoFs.insert(local_DoF);
}
}
}
}
DUNE_THROW_IF(local_target_boundary_DoFs.size() == 0,
Exceptions::interpolation_error,
"The finite element is not suitable: although the element has an intersection on the boundary, no "
"DoFs are associated with it!");
// * and use only those
for (const auto& local_DoF_id : local_target_boundary_DoFs)
local_dof_vector[local_DoF_id] = local_dofs[local_DoF_id];
}
}
} // ... boundary_interpolation(...)
/**
* \brief Interpolates a localizable function restricted to certain boundary intersections within a given space [uses
* target.space().grid_view() as interpolation_grid_view].
**/
template <class GV, size_t r, size_t rC, class R, class V>
void boundary_interpolation(
const XT::Functions::GridFunctionInterface<XT::Grid::extract_entity_t<GV>, r, rC, R>& source,
DiscreteFunction<V, GV, r, rC, R>& target,
const XT::Grid::BoundaryInfo<XT::Grid::extract_intersection_t<GV>>& boundary_info,
const XT::Grid::BoundaryType& target_boundary_type)
{
boundary_interpolation(source, target, target.space().grid_view(), boundary_info, target_boundary_type);
}
/**
* \brief Interpolates a localizable function restricted to certain boundary intersections within a given space [creates
* a suitable target function].
**/
template <class VectorType, class GV, size_t r, size_t rC, class R, class IGV>
std::enable_if_t<
XT::LA::is_vector<VectorType>::value
&& std::is_same<XT::Grid::extract_entity_t<GV>, typename IGV::Grid::template Codim<0>::Entity>::value,
DiscreteFunction<VectorType, GV, r, rC, R>>
boundary_interpolation(const XT::Functions::GridFunctionInterface<XT::Grid::extract_entity_t<GV>, r, rC, R>& source,
const SpaceInterface<GV, r, rC, R>& target_space,
const GridView<IGV>& interpolation_grid_view,
const XT::Grid::BoundaryInfo<XT::Grid::extract_intersection_t<GridView<IGV>>>& boundary_info,
const XT::Grid::BoundaryType& target_boundary_type)
{
auto target_function = make_discrete_function<VectorType>(target_space);
boundary_interpolation(source, target_function, interpolation_grid_view, boundary_info, target_boundary_type);
return target_function;
}
/**
* \brief Interpolates a localizable function restricted to certain boundary intersections within a given space [creates
* a suitable target function, uses target_space.grid_view() as interpolation_grid_view].
**/
template <class VectorType, class GV, size_t r, size_t rC, class R>
std::enable_if_t<XT::LA::is_vector<VectorType>::value, DiscreteFunction<VectorType, GV, r, rC, R>>
boundary_interpolation(const XT::Functions::GridFunctionInterface<XT::Grid::extract_entity_t<GV>, r, rC, R>& source,
const SpaceInterface<GV, r, rC, R>& target_space,
const XT::Grid::BoundaryInfo<XT::Grid::extract_intersection_t<GV>>& boundary_info,
const XT::Grid::BoundaryType& target_boundary_type)
{
auto target_function = make_discrete_function<VectorType>(target_space);
boundary_interpolation(source, target_function, boundary_info, target_boundary_type);
return target_function;
}
// ### Variants for FunctionInterface
/**
* \brief Interpolates a function restricted to certain boundary intersections within a given space [most general
* variant].
*
* Simply calls as_grid_function<>() and redirects to the appropriate boundary_interpolation() function.
*/
template <class GV, size_t r, size_t rC, class R, class V, class IGV>
std::enable_if_t<std::is_same<XT::Grid::extract_entity_t<GV>, typename IGV::Grid::template Codim<0>::Entity>::value,
void>
boundary_interpolation(const XT::Functions::FunctionInterface<GridView<IGV>::dimension, r, rC, R>& source,
DiscreteFunction<V, GV, r, rC, R>& target,
const GridView<IGV>& interpolation_grid_view,
const XT::Grid::BoundaryInfo<XT::Grid::extract_intersection_t<GridView<IGV>>>& boundary_info,
const XT::Grid::BoundaryType& target_boundary_type)
{
boundary_interpolation(XT::Functions::make_grid_function(source, interpolation_grid_view),
target,
interpolation_grid_view,
boundary_info,
target_boundary_type);
}
/**
* \brief Interpolates a function restricted to certain boundary intersections within a given space [uses
* target.space().grid_view() as interpolation_grid_view].
**/
template <class GV, size_t r, size_t rC, class R, class V>
void boundary_interpolation(const XT::Functions::FunctionInterface<GV::dimension, r, rC, R>& source,
DiscreteFunction<V, GV, r, rC, R>& target,
const XT::Grid::BoundaryInfo<XT::Grid::extract_intersection_t<GV>>& boundary_info,
const XT::Grid::BoundaryType& target_boundary_type)
{
boundary_interpolation(source, target, target.space().grid_view(), boundary_info, target_boundary_type);
}
/**
* \brief Interpolates a function restricted to certain boundary intersections within a given space [creates a suitable
* target function].
**/
template <class VectorType, class GV, size_t r, size_t rC, class R, class IGV>
std::enable_if_t<
XT::LA::is_vector<VectorType>::value
&& std::is_same<XT::Grid::extract_entity_t<GV>, typename IGV::Grid::template Codim<0>::Entity>::value,
DiscreteFunction<VectorType, GV, r, rC, R>>
boundary_interpolation(const XT::Functions::FunctionInterface<GridView<IGV>::dimension, r, rC, R>& source,
const SpaceInterface<GV, r, rC, R>& target_space,
const GridView<IGV>& interpolation_grid_view,
const XT::Grid::BoundaryInfo<XT::Grid::extract_intersection_t<GridView<IGV>>>& boundary_info,
const XT::Grid::BoundaryType& target_boundary_type)
{
return boundary_interpolation<VectorType>(XT::Functions::make_grid_function(source, interpolation_grid_view),
target_space,
interpolation_grid_view,
boundary_info,
target_boundary_type);
}
/**
* \brief Interpolates a function restricted to certain boundary intersections within a given space [creates a suitable
* target function, uses target_space.grid_view() as interpolation_grid_view].
**/
template <class VectorType, class GV, size_t r, size_t rC, class R>
std::enable_if_t<XT::LA::is_vector<VectorType>::value, DiscreteFunction<VectorType, GV, r, rC, R>>
boundary_interpolation(const XT::Functions::FunctionInterface<GV::dimension, r, rC, R>& source,
const SpaceInterface<GV, r, rC, R>& target_space,
const XT::Grid::BoundaryInfo<XT::Grid::extract_intersection_t<GV>>& boundary_info,
const XT::Grid::BoundaryType& target_boundary_type)
{
return boundary_interpolation<VectorType>(
source, target_space, target_space.grid_view(), boundary_info, target_boundary_type);
}
// ### Variants for GenericFunction
/**
* \brief Interpolates a function given as a lambda expression restricted to certain boundary intersections within a
* given space [most general variant].
*
* Simply creates a XT::Functions::GenericFunction and redirects to the appropriate boundary_interpolation() function.
*/
template <class GV, size_t r, size_t rC, class R, class V, class IGV>
std::enable_if_t<std::is_same<XT::Grid::extract_entity_t<GV>, typename IGV::Grid::template Codim<0>::Entity>::value,
void>
boundary_interpolation(
const int source_order,
const std::function<typename XT::Functions::GenericFunction<GridView<IGV>::dimension, r, rC, R>::RangeReturnType(
const typename XT::Functions::GenericFunction<GridView<IGV>::dimension, r, rC, R>::DomainType&,
const XT::Common::Parameter&)> source_evaluate_lambda,
DiscreteFunction<V, GV, r, rC, R>& target,
const GridView<IGV>& interpolation_grid_view,
const XT::Grid::BoundaryInfo<XT::Grid::extract_intersection_t<GridView<IGV>>>& boundary_info,
const XT::Grid::BoundaryType& target_boundary_type)
{
boundary_interpolation(
XT::Functions::GenericFunction<GridView<IGV>::dimension, r, rC, R>(source_order, source_evaluate_lambda),
target,
interpolation_grid_view,
boundary_info,
target_boundary_type);
}
/**
* \brief Interpolates a function given as a lambda expression restricted to certain boundary intersections within a
* given space [uses target.space().grid_view() as interpolation_grid_view].
**/
template <class GV, size_t r, size_t rC, class R, class V>
void boundary_interpolation(
const int source_order,
const std::function<typename XT::Functions::GenericFunction<GV::dimension, r, rC, R>::RangeReturnType(
const typename XT::Functions::GenericFunction<GV::dimension, r, rC, R>::DomainType&,
const XT::Common::Parameter&)> source_evaluate_lambda,
DiscreteFunction<V, GV, r, rC, R>& target,
const XT::Grid::BoundaryInfo<XT::Grid::extract_intersection_t<GV>>& boundary_info,
const XT::Grid::BoundaryType& target_boundary_type)
{
boundary_interpolation(XT::Functions::GenericFunction<GV::dimension, r, rC, R>(source_order, source_evaluate_lambda),
target,
boundary_info,
target_boundary_type);
}
/**
* \brief Interpolates a function given as a lambda expression within a given space [creates a suitable target
* function].
**/
template <class VectorType, class GV, size_t r, size_t rC, class R, class IGV>
std::enable_if_t<
XT::LA::is_vector<VectorType>::value
&& std::is_same<XT::Grid::extract_entity_t<GV>, typename IGV::Grid::template Codim<0>::Entity>::value,
DiscreteFunction<VectorType, GV, r, rC, R>>
boundary_interpolation(
const int source_order,
const std::function<typename XT::Functions::GenericFunction<GridView<IGV>::dimension, r, rC, R>::RangeReturnType(
const typename XT::Functions::GenericFunction<GridView<IGV>::dimension, r, rC, R>::DomainType&,
const XT::Common::Parameter&)> source_evaluate_lambda,
const SpaceInterface<GV, r, rC, R>& target_space,
const GridView<IGV>& interpolation_grid_view,
const XT::Grid::BoundaryInfo<XT::Grid::extract_intersection_t<GridView<IGV>>>& boundary_info,
const XT::Grid::BoundaryType& target_boundary_type)
{
return boundary_interpolation<VectorType>(
XT::Functions::GenericFunction<GridView<IGV>::dimension, r, rC, R>(source_order, source_evaluate_lambda),
target_space,
interpolation_grid_view,
boundary_info,
target_boundary_type);
}
/**
* \brief Interpolates a function given as a lambda expression within a given space [creates a suitable target
* function, uses target_space.grid_view() as interpolation_grid_view].
**/
template <class VectorType, class GV, size_t r, size_t rC, class R>
std::enable_if_t<XT::LA::is_vector<VectorType>::value, DiscreteFunction<VectorType, GV, r, rC, R>>
boundary_interpolation(
const int source_order,
const std::function<typename XT::Functions::GenericFunction<GV::dimension, r, rC, R>::RangeReturnType(
const typename XT::Functions::GenericFunction<GV::dimension, r, rC, R>::DomainType&,
const XT::Common::Parameter&)> source_evaluate_lambda,
const SpaceInterface<GV, r, rC, R>& target_space,
const XT::Grid::BoundaryInfo<XT::Grid::extract_intersection_t<GV>>& boundary_info,
const XT::Grid::BoundaryType& target_boundary_type)
{
return boundary_interpolation<VectorType>(
XT::Functions::GenericFunction<GV::dimension, r, rC, R>(source_order, source_evaluate_lambda),
target_space,
boundary_info,
target_boundary_type);
}
} // namespace GDT
} // namespace Dune
#endif // DUNE_GDT_INTERPOLATIONS_BOUNDARY_HH
| 48.328446 | 120 | 0.694782 | pymor |
5b2686e34d63b86fc5a4ba61e692695f64e1e914 | 6,000 | cpp | C++ | test/marker.cpp | fizyr/dr_marker | 039cdff23516749c5830acdce7f7be5ba71cae02 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | test/marker.cpp | fizyr/dr_marker | 039cdff23516749c5830acdce7f7be5ba71cae02 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | test/marker.cpp | fizyr/dr_marker | 039cdff23516749c5830acdce7f7be5ba71cae02 | [
"Apache-2.0",
"BSD-3-Clause"
] | 1 | 2018-06-06T10:07:13.000Z | 2018-06-06T10:07:13.000Z | /**
* Copyright 2014-2018 Fizyr BV. https://fizyr.com
*
* 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
*/
#include "marker.hpp"
#include <gtest/gtest.h>
#include <dr_eigen/ros.hpp>
#include <dr_eigen/eigen.hpp>
#include <dr_eigen/test/compare.hpp>
#include <cmath>
int main(int argc, char * * argv) {
testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
namespace dr {
TEST(MarkerTest, makeSphereMarker) {
ros::Time::init();
ros::Time now = ros::Time::now();
Eigen::Vector3d position(0.5, 0.5, 0.5); // some position
std::string frame_id = "some_frame";
double radius = 0.5;
std::string ns = "some_namespace";
ros::Duration lifetime = ros::Duration(0.5); // 0.5s lifetime
std::array<float, 4> color({{0.3f, 0.4f, 0.5f, 0.6f}});
int id = 100;
visualization_msgs::Marker marker = createSphereMarker(
"some_frame",
position,
radius,
ns,
lifetime,
color,
id
);
// expect the supplied output to be the same
EXPECT_EQ(marker.header.frame_id, frame_id);
EXPECT_TRUE(marker.header.stamp.toSec() >= now.toSec());
EXPECT_TRUE(marker.header.stamp.toSec() <= ros::Time::now().toSec());
EXPECT_EQ(marker.id, id);
EXPECT_TRUE(testEqual(position, toEigen(marker.pose.position)));
EXPECT_FLOAT_EQ(marker.color.r, color[0]);
EXPECT_FLOAT_EQ(marker.color.g, color[1]);
EXPECT_FLOAT_EQ(marker.color.b, color[2]);
EXPECT_FLOAT_EQ(marker.color.a, color[3]);
EXPECT_DOUBLE_EQ(marker.scale.x, radius);
EXPECT_DOUBLE_EQ(marker.scale.y, radius);
EXPECT_DOUBLE_EQ(marker.scale.z, radius);
EXPECT_DOUBLE_EQ(marker.lifetime.toSec(), 0.5);
EXPECT_EQ(marker.type, visualization_msgs::Marker::SPHERE);
EXPECT_EQ(marker.action, visualization_msgs::Marker::ADD);
EXPECT_EQ(marker.ns, ns);
}
TEST(MarkerTest, makeCylinderMarker) {
ros::Time::init();
ros::Time now = ros::Time::now();
std::string frame_id = "some_frame";
Eigen::AngleAxisd rotation = rotateY(M_PI);
Eigen::Isometry3d pose = translate(0.5, 0.5, 0.5) * rotation;
double radius = 0.5;
double height = 1.0;
std::string ns = "some_namespace";
ros::Duration lifetime = ros::Duration(0.5); // 0.5s lifetime
std::array<float, 4> color({{0.3f, 0.4f, 0.5f, 0.6f}});
int id = 100;
visualization_msgs::Marker marker = createCylinderMarker(
"some_frame",
pose,
radius,
height,
ns,
lifetime,
color,
id
);
// expect the supplied output to be the same
EXPECT_EQ(marker.header.frame_id, frame_id);
EXPECT_TRUE(marker.header.stamp.toSec() >= now.toSec());
EXPECT_TRUE(marker.header.stamp.toSec() <= ros::Time::now().toSec());
EXPECT_EQ(marker.id, id);
EXPECT_TRUE(testEqual(pose.translation(), toEigen(marker.pose.position)));
EXPECT_FLOAT_EQ(marker.color.r, color[0]);
EXPECT_FLOAT_EQ(marker.color.g, color[1]);
EXPECT_FLOAT_EQ(marker.color.b, color[2]);
EXPECT_FLOAT_EQ(marker.color.a, color[3]);
EXPECT_DOUBLE_EQ(marker.scale.x, radius * 2);
EXPECT_DOUBLE_EQ(marker.scale.y, radius * 2);
EXPECT_DOUBLE_EQ(marker.scale.z, height);
EXPECT_DOUBLE_EQ(marker.lifetime.toSec(), 0.5);
EXPECT_EQ(marker.type, visualization_msgs::Marker::CYLINDER);
EXPECT_EQ(marker.action, visualization_msgs::Marker::ADD);
EXPECT_EQ(marker.ns, ns);
}
TEST(MarkerTest, makeBoxMarker) {
ros::Time::init();
ros::Time now = ros::Time::now();
std::string frame_id = "some_frame";
Eigen::AlignedBox3d box;
std::string ns = "some_namespace";
ros::Duration lifetime = ros::Duration(0.5); // 0.5s lifetime
std::array<float, 4> color({{0.3f, 0.4f, 0.5f, 0.6f}});
int id = 100;
visualization_msgs::Marker marker = createBoxMarker(
"some_frame",
box,
ns,
lifetime,
color,
id
);
// expect the supplied output to be the same
EXPECT_EQ(marker.header.frame_id, frame_id);
EXPECT_TRUE(marker.header.stamp.toSec() >= now.toSec());
EXPECT_TRUE(marker.header.stamp.toSec() <= ros::Time::now().toSec());
EXPECT_EQ(marker.id, id);
EXPECT_TRUE(testEqual(box.center(), toEigen(marker.pose.position)));
EXPECT_FLOAT_EQ(marker.color.r, color[0]);
EXPECT_FLOAT_EQ(marker.color.g, color[1]);
EXPECT_FLOAT_EQ(marker.color.b, color[2]);
EXPECT_FLOAT_EQ(marker.color.a, color[3]);
EXPECT_DOUBLE_EQ(marker.scale.x, box.sizes().x());
EXPECT_DOUBLE_EQ(marker.scale.y, box.sizes().y());
EXPECT_DOUBLE_EQ(marker.scale.z, box.sizes().z());
EXPECT_DOUBLE_EQ(marker.lifetime.toSec(), 0.5);
EXPECT_EQ(marker.type, visualization_msgs::Marker::CUBE);
EXPECT_EQ(marker.action, visualization_msgs::Marker::ADD);
EXPECT_EQ(marker.ns, ns);
}
}
| 32.258065 | 83 | 0.716833 | fizyr |
5b275307317bec0185acada3bc496e71c96d3347 | 32,316 | cpp | C++ | src/Services/PickerService/PickerService.cpp | irov/Mengine | b76e9f8037325dd826d4f2f17893ac2b236edad8 | [
"MIT"
] | 39 | 2016-04-21T03:25:26.000Z | 2022-01-19T14:16:38.000Z | src/Services/PickerService/PickerService.cpp | irov/Mengine | b76e9f8037325dd826d4f2f17893ac2b236edad8 | [
"MIT"
] | 23 | 2016-06-28T13:03:17.000Z | 2022-02-02T10:11:54.000Z | src/Services/PickerService/PickerService.cpp | irov/Mengine | b76e9f8037325dd826d4f2f17893ac2b236edad8 | [
"MIT"
] | 14 | 2016-06-22T20:45:37.000Z | 2021-07-05T12:25:19.000Z | #include "PickerService.h"
#include "Interface/InputServiceInterface.h"
#include "Interface/ApplicationInterface.h"
#include "Interface/EnumeratorServiceInterface.h"
#include "Kernel/Arrow.h"
#include "Kernel/Scene.h"
#include "Kernel/VectorAuxScope.h"
#include "Kernel/Logger.h"
#include "Kernel/VectorAuxScope.h"
#include "Kernel/IntrusivePtrView.h"
#include "Kernel/Assertion.h"
#include "Kernel/RenderContextHelper.h"
#include "Kernel/MixinDebug.h"
#include "Kernel/ProfilerHelper.h"
#include "Config/Algorithm.h"
//////////////////////////////////////////////////////////////////////////
SERVICE_FACTORY( PickerService, Mengine::PickerService );
//////////////////////////////////////////////////////////////////////////
namespace Mengine
{
namespace Detail
{
//////////////////////////////////////////////////////////////////////////
class PickerVisitor
{
public:
PickerVisitor( VectorPickerStates * _states, bool _exclusive )
: m_states( _states )
, m_exclusive( _exclusive )
{
}
~PickerVisitor()
{
}
protected:
void operator = ( const PickerVisitor & ) = delete;
public:
void visit( PickerInterface * _picker, const RenderContext & _context )
{
if( m_exclusive == true && _picker->isPickerExclusive() == false )
{
return;
}
PickerStateDesc desc;
desc.picker = _picker;
desc.context.target = nullptr;
desc.context.transformation = nullptr;
const RenderViewportInterfacePtr & pickerViewport = _picker->getPickerViewport();
if( pickerViewport != nullptr )
{
desc.context.viewport = pickerViewport.get();
}
else
{
desc.context.viewport = _context.viewport;
}
const RenderCameraInterfacePtr & pickerCamera = _picker->getPickerCamera();
if( pickerCamera != nullptr )
{
desc.context.camera = pickerCamera.get();
}
else
{
desc.context.camera = _context.camera;
}
const RenderTransformationInterfacePtr & pickerTransformation = _picker->getPickerTransformation();
if( pickerTransformation != nullptr )
{
desc.context.transformation = pickerTransformation.get();
}
else
{
desc.context.transformation = _context.transformation;
}
const RenderScissorInterfacePtr & pickerScissor = _picker->getPickerScissor();
if( pickerScissor != nullptr )
{
desc.context.scissor = pickerScissor.get();
}
else
{
desc.context.scissor = _context.scissor;
}
const RenderTargetInterfacePtr & pickerTarget = _picker->getPickerTarget();
if( pickerTarget != nullptr )
{
desc.context.target = pickerTarget.get();
}
else
{
desc.context.target = _context.target;
}
desc.context.zGroup = _context.zGroup;
desc.context.zIndex = _context.zIndex;
if( _picker->isPickerDummy() == false )
{
m_states->emplace_back( desc );
}
_picker->foreachPickerChildrenEnabled( [this, desc]( PickerInterface * _picker )
{
this->visit( _picker, desc.context );
} );
}
protected:
VectorPickerStates * m_states;
bool m_exclusive;
};
}
//////////////////////////////////////////////////////////////////////////
PickerService::PickerService()
: m_block( false )
, m_handleValue( true )
, m_invalidateTraps( false )
{
}
//////////////////////////////////////////////////////////////////////////
PickerService::~PickerService()
{
}
//////////////////////////////////////////////////////////////////////////
bool PickerService::_initializeService()
{
return true;
}
//////////////////////////////////////////////////////////////////////////
void PickerService::_finalizeService()
{
m_arrow = nullptr;
m_scene = nullptr;
m_viewport = nullptr;
m_camera = nullptr;
m_transformation = nullptr;
m_scissor = nullptr;
m_target = nullptr;
MENGINE_ASSERTION_FATAL( m_states.empty() == true );
}
//////////////////////////////////////////////////////////////////////////
void PickerService::setBlock( bool _value )
{
if( m_block == _value )
{
return;
}
m_block = _value;
this->invalidateTraps();
}
//////////////////////////////////////////////////////////////////////////
void PickerService::setHandleValue( bool _value )
{
if( m_handleValue == _value )
{
return;
}
m_handleValue = _value;
this->invalidateTraps();
}
//////////////////////////////////////////////////////////////////////////
void PickerService::setArrow( const ArrowPtr & _arrow )
{
if( m_arrow == _arrow )
{
return;
}
m_arrow = _arrow;
this->invalidateTraps();
}
//////////////////////////////////////////////////////////////////////////
void PickerService::setScene( const ScenePtr & _scene )
{
if( m_scene == _scene )
{
return;
}
m_scene = _scene;
this->invalidateTraps();
}
//////////////////////////////////////////////////////////////////////////
void PickerService::setRenderViewport( const RenderViewportInterfacePtr & _viewport )
{
if( m_viewport == _viewport )
{
return;
}
m_viewport = _viewport;
this->invalidateTraps();
}
//////////////////////////////////////////////////////////////////////////
void PickerService::setRenderCamera( const RenderCameraInterfacePtr & _camera )
{
if( m_camera == _camera )
{
return;
}
m_camera = _camera;
this->invalidateTraps();
}
//////////////////////////////////////////////////////////////////////////
void PickerService::setRenderTransformation( const RenderTransformationInterfacePtr & _transformation )
{
if( m_transformation == _transformation )
{
return;
}
m_transformation = _transformation;
this->invalidateTraps();
}
//////////////////////////////////////////////////////////////////////////
void PickerService::setRenderScissor( const RenderScissorInterfacePtr & _scissor )
{
if( m_scissor == _scissor )
{
return;
}
m_scissor = _scissor;
this->invalidateTraps();
}
//////////////////////////////////////////////////////////////////////////
void PickerService::setRenderTarget( const RenderTargetInterfacePtr & _target )
{
if( m_target == _target )
{
return;
}
m_target = _target;
this->invalidateTraps();
}
//////////////////////////////////////////////////////////////////////////
bool PickerService::pickTraps( const mt::vec2f & _point, ETouchCode _touchId, float _pressure, const InputSpecialData & _special, VectorPickers * const _pickers ) const
{
VectorPickerStates statesAux;
if( this->pickStates_( _point.x, _point.y, _touchId, _pressure, _special, &statesAux ) == false )
{
return false;
}
for( VectorPickerStates::reverse_iterator
it = statesAux.rbegin(),
it_end = statesAux.rend();
it != it_end;
++it )
{
PickerStateDesc & desc = *it;
PickerInterface * picker = desc.picker;
if( picker->isPickerPicked() == false )
{
continue;
}
_pickers->emplace_back( picker );
}
return true;
}
//////////////////////////////////////////////////////////////////////////
bool PickerService::getTraps( const mt::vec2f & _point, VectorPickers * const _pickers ) const
{
VectorPickerStates statesAux;
if( this->getStates_( _point.x, _point.y, &statesAux ) == false )
{
return false;
}
for( const PickerStateDesc & desc : statesAux )
{
const PickerInterface * picker = desc.picker;
_pickers->emplace_back( picker );
}
return true;
}
//////////////////////////////////////////////////////////////////////////
void PickerService::update()
{
MENGINE_PROFILER_CATEGORY();
if( m_invalidateTraps == true )
{
this->updateTraps_();
m_invalidateTraps = false;
}
}
//////////////////////////////////////////////////////////////////////////
void PickerService::updateTraps_()
{
ETouchCode touchId = TC_TOUCH0;
const mt::vec2f & position = INPUT_SERVICE()
->getCursorPosition( touchId );
float pressure = INPUT_SERVICE()
->getCursorPressure( touchId );
InputSpecialData special;
INPUT_SERVICE()
->getSpecial( &special );
VectorPickerStates statesAux;
this->pickStates_( position.x, position.y, touchId, pressure, special, &statesAux );
}
//////////////////////////////////////////////////////////////////////////
void PickerService::invalidateTraps()
{
m_invalidateTraps = true;
}
//////////////////////////////////////////////////////////////////////////
bool PickerService::handleKeyEvent( const InputKeyEvent & _event )
{
MENGINE_VECTOR_AUX( m_states );
if( this->pickStates_( _event.x, _event.y, TC_TOUCH0, 0.f, _event.special, &m_states ) == false )
{
return false;
}
MENGINE_PROFILER_CATEGORY();
for( VectorPickerStates::reverse_iterator
it = m_states.rbegin(),
it_end = m_states.rend();
it != it_end;
++it )
{
PickerStateDesc & desc = *it;
PickerInterface * picker = desc.picker;
if( picker->isPickerEnable() == false )
{
continue;
}
InputHandlerInterface * inputHandler = picker->getPickerInputHandler();
mt::vec2f wp;
m_arrow->calcPointClick( &desc.context, mt::vec2f( _event.x, _event.y ), &wp );
InputKeyEvent ne = _event;
ne.x = wp.x;
ne.y = wp.y;
LOGGER_INFO( "picker", "handle type '%s' name '%s' UID [%u] pos [%.4f;%.4f] [key]"
, MENGINE_MIXIN_DEBUG_TYPE( inputHandler )
, MENGINE_MIXIN_DEBUG_NAME( inputHandler )
, MENGINE_MIXIN_DEBUG_UID( inputHandler )
, ne.x
, ne.y
);
if( inputHandler->handleKeyEvent( ne ) == false )
{
continue;
}
return m_handleValue;
}
return false;
}
//////////////////////////////////////////////////////////////////////////
bool PickerService::handleTextEvent( const InputTextEvent & _event )
{
MENGINE_VECTOR_AUX( m_states );
if( this->pickStates_( _event.x, _event.y, TC_TOUCH0, 0.f, _event.special, &m_states ) == false )
{
return false;
}
MENGINE_PROFILER_CATEGORY();
for( VectorPickerStates::reverse_iterator
it = m_states.rbegin(),
it_end = m_states.rend();
it != it_end;
++it )
{
PickerStateDesc & desc = *it;
PickerInterface * picker = desc.picker;
if( picker->isPickerEnable() == false )
{
continue;
}
InputHandlerInterface * inputHandler = picker->getPickerInputHandler();
mt::vec2f wp;
m_arrow->calcPointClick( &desc.context, mt::vec2f( _event.x, _event.y ), &wp );
InputTextEvent ne = _event;
ne.x = wp.x;
ne.y = wp.y;
LOGGER_INFO( "picker", "handle type '%s' name '%s' UID [%u] pos [%.4f;%.4f] [text]"
, MENGINE_MIXIN_DEBUG_TYPE( inputHandler )
, MENGINE_MIXIN_DEBUG_NAME( inputHandler )
, MENGINE_MIXIN_DEBUG_UID( inputHandler )
, ne.x
, ne.y
);
if( inputHandler->handleTextEvent( ne ) == false )
{
continue;
}
return m_handleValue;
}
return false;
}
//////////////////////////////////////////////////////////////////////////
bool PickerService::handleMouseButtonEvent( const InputMouseButtonEvent & _event )
{
MENGINE_VECTOR_AUX( m_states );
if( this->pickStates_( _event.x, _event.y, _event.touchId, _event.pressure, _event.special, &m_states ) == false )
{
return false;
}
MENGINE_PROFILER_CATEGORY();
for( VectorPickerStates::reverse_iterator
it = m_states.rbegin(),
it_end = m_states.rend();
it != it_end;
++it )
{
const PickerStateDesc & desc = *it;
PickerInterface * picker = desc.picker;
if( picker->isPickerEnable() == false )
{
continue;
}
if( picker->isPickerPicked() == false )
{
continue;
}
mt::vec2f wp;
m_arrow->calcPointClick( &desc.context, mt::vec2f( _event.x, _event.y ), &wp );
InputHandlerInterface * inputHandler = picker->getPickerInputHandler();
InputMouseButtonEvent ne = _event;
ne.x = wp.x;
ne.y = wp.y;
ne.isPressed = picker->isPickerPressed();
LOGGER_INFO( "picker", "handle type '%s' name '%s' UID [%u] pos [%.4f;%.4f] [mouse button]"
, MENGINE_MIXIN_DEBUG_TYPE( inputHandler )
, MENGINE_MIXIN_DEBUG_NAME( inputHandler )
, MENGINE_MIXIN_DEBUG_UID( inputHandler )
, ne.x
, ne.y
);
if( inputHandler->handleMouseButtonEvent( ne ) == false )
{
continue;
}
return m_handleValue;
}
return false;
}
//////////////////////////////////////////////////////////////////////////
bool PickerService::handleMouseButtonEventBegin( const InputMouseButtonEvent & _event )
{
MENGINE_VECTOR_AUX( m_states );
if( this->pickStates_( _event.x, _event.y, _event.touchId, _event.pressure, _event.special, &m_states ) == false )
{
return false;
}
MENGINE_PROFILER_CATEGORY();
for( VectorPickerStates::reverse_iterator
it = m_states.rbegin(),
it_end = m_states.rend();
it != it_end;
++it )
{
const PickerStateDesc & desc = *it;
PickerInterface * picker = desc.picker;
if( picker->isPickerEnable() == false )
{
continue;
}
if( picker->isPickerPicked() == false )
{
continue;
}
if( _event.isDown == true )
{
picker->setPickerPressed( true );
}
mt::vec2f wp;
m_arrow->calcPointClick( &desc.context, mt::vec2f( _event.x, _event.y ), &wp );
InputHandlerInterface * inputHandler = picker->getPickerInputHandler();
InputMouseButtonEvent ne = _event;
ne.x = wp.x;
ne.y = wp.y;
ne.isPressed = picker->isPickerPressed();
LOGGER_INFO( "picker", "handle type '%s' name '%s' UID [%u] pos [%.4f;%.4f] [mouse button begin]"
, MENGINE_MIXIN_DEBUG_TYPE( inputHandler )
, MENGINE_MIXIN_DEBUG_NAME( inputHandler )
, MENGINE_MIXIN_DEBUG_UID( inputHandler )
, ne.x
, ne.y
);
if( inputHandler->handleMouseButtonEventBegin( ne ) == false )
{
continue;
}
return m_handleValue;
}
return false;
}
//////////////////////////////////////////////////////////////////////////
bool PickerService::handleMouseButtonEventEnd( const InputMouseButtonEvent & _event )
{
MENGINE_VECTOR_AUX( m_states );
if( this->pickStates_( _event.x, _event.y, _event.touchId, _event.pressure, _event.special, &m_states ) == false )
{
return false;
}
MENGINE_PROFILER_CATEGORY();
for( VectorPickerStates::reverse_iterator
it = m_states.rbegin(),
it_end = m_states.rend();
it != it_end;
++it )
{
const PickerStateDesc & desc = *it;
PickerInterface * picker = desc.picker;
if( picker->isPickerEnable() == false )
{
continue;
}
if( picker->isPickerPicked() == false )
{
continue;
}
if( _event.isDown == false )
{
if( picker->isPickerPressed() == false )
{
//continue;
}
else
{
picker->setPickerPressed( false );
}
}
mt::vec2f wp;
m_arrow->calcPointClick( &desc.context, mt::vec2f( _event.x, _event.y ), &wp );
InputHandlerInterface * inputHandler = picker->getPickerInputHandler();
InputMouseButtonEvent ne = _event;
ne.x = wp.x;
ne.y = wp.y;
ne.isPressed = picker->isPickerPressed();
LOGGER_INFO( "picker", "handle type '%s' name '%s' UID [%u] pos [%.4f;%.4f] [mouse button end]"
, MENGINE_MIXIN_DEBUG_TYPE( inputHandler )
, MENGINE_MIXIN_DEBUG_NAME( inputHandler )
, MENGINE_MIXIN_DEBUG_UID( inputHandler )
, ne.x
, ne.y
);
if( inputHandler->handleMouseButtonEventEnd( ne ) == false )
{
continue;
}
return m_handleValue;
}
return false;
}
//////////////////////////////////////////////////////////////////////////
bool PickerService::handleMouseMove( const InputMouseMoveEvent & _event )
{
MENGINE_VECTOR_AUX( m_states );
if( this->pickStates_( _event.x, _event.y, _event.touchId, _event.pressure, _event.special, &m_states ) == false )
{
return false;
}
MENGINE_PROFILER_CATEGORY();
for( VectorPickerStates::reverse_iterator
it = m_states.rbegin(),
it_end = m_states.rend();
it != it_end;
++it )
{
const PickerStateDesc & desc = *it;
PickerInterface * picker = desc.picker;
if( picker->isPickerEnable() == false )
{
continue;
}
if( picker->isPickerPicked() == false )
{
continue;
}
mt::vec2f wp;
m_arrow->calcPointClick( &desc.context, mt::vec2f( _event.x, _event.y ), &wp );
mt::vec2f dp;
m_arrow->calcPointDeltha( &desc.context, mt::vec2f( _event.dx, _event.dy ), &dp );
InputHandlerInterface * inputHandler = picker->getPickerInputHandler();
InputMouseMoveEvent ne = _event;
ne.x = wp.x;
ne.y = wp.y;
ne.dx = dp.x;
ne.dy = dp.y;
LOGGER_INFO( "picker", "handle type '%s' name '%s' UID [%u] pos [%.4f;%.4f] [mouse move]"
, MENGINE_MIXIN_DEBUG_TYPE( inputHandler )
, MENGINE_MIXIN_DEBUG_NAME( inputHandler )
, MENGINE_MIXIN_DEBUG_UID( inputHandler )
, ne.x
, ne.y
);
if( inputHandler->handleMouseMove( ne ) == false )
{
continue;
}
return m_handleValue;
}
return false;
}
//////////////////////////////////////////////////////////////////////////
bool PickerService::handleMouseWheel( const InputMouseWheelEvent & _event )
{
MENGINE_VECTOR_AUX( m_states );
if( this->pickStates_( _event.x, _event.y, TC_TOUCH0, 0.f, _event.special, &m_states ) == false )
{
return false;
}
MENGINE_PROFILER_CATEGORY();
for( VectorPickerStates::reverse_iterator
it = m_states.rbegin(),
it_end = m_states.rend();
it != it_end;
++it )
{
const PickerStateDesc & desc = *it;
PickerInterface * picker = desc.picker;
if( picker->isPickerEnable() == false )
{
continue;
}
if( picker->isPickerPicked() == false )
{
continue;
}
mt::vec2f wp;
m_arrow->calcPointClick( &desc.context, mt::vec2f( _event.x, _event.y ), &wp );
InputHandlerInterface * inputHandler = picker->getPickerInputHandler();
InputMouseWheelEvent ne = _event;
ne.x = wp.x;
ne.y = wp.y;
LOGGER_INFO( "picker", "handle type '%s' name '%s' UID [%u] pos [%.4f;%.4f] [mouse wheel]"
, MENGINE_MIXIN_DEBUG_TYPE( inputHandler )
, MENGINE_MIXIN_DEBUG_NAME( inputHandler )
, MENGINE_MIXIN_DEBUG_UID( inputHandler )
, ne.x
, ne.y
);
if( inputHandler->handleMouseWheel( ne ) == false )
{
continue;
}
return m_handleValue;
}
return false;
}
//////////////////////////////////////////////////////////////////////////
bool PickerService::handleMouseEnter( const InputMouseEnterEvent & _event )
{
MENGINE_VECTOR_AUX( m_states );
this->pickStates_( _event.x, _event.y, _event.touchId, _event.pressure, _event.special, &m_states );
return false;
}
//////////////////////////////////////////////////////////////////////////
void PickerService::handleMouseLeave( const InputMouseLeaveEvent & _event )
{
if( m_arrow == nullptr )
{
return;
}
if( m_scene == nullptr )
{
return;
}
MENGINE_VECTOR_AUX( m_states );
this->fillStates_( &m_states );
for( VectorPickerStates::reverse_iterator
it = m_states.rbegin(),
it_end = m_states.rend();
it != it_end;
++it )
{
PickerStateDesc & desc = *it;
PickerInterface * picker = desc.picker;
if( picker->isPickerEnable() == false )
{
continue;
}
if( picker->isPickerPicked() == false )
{
continue;
}
picker->setPickerPicked( false );
InputHandlerInterface * inputHandler = picker->getPickerInputHandler();
mt::vec2f wp;
m_arrow->calcPointClick( &desc.context, mt::vec2f( _event.x, _event.y ), &wp );
InputMouseLeaveEvent ne = _event;
ne.x = wp.x;
ne.y = wp.y;
LOGGER_INFO( "picker", "handle type '%s' name '%s' UID [%u] pos [%.4f;%.4f] [mouse leave]"
, MENGINE_MIXIN_DEBUG_TYPE( inputHandler )
, MENGINE_MIXIN_DEBUG_NAME( inputHandler )
, MENGINE_MIXIN_DEBUG_UID( inputHandler )
, ne.x
, ne.y
);
inputHandler->handleMouseLeave( _event );
}
}
//////////////////////////////////////////////////////////////////////////
void PickerService::fillStates_( VectorPickerStates * const _states ) const
{
PickerInterface * picker = m_scene->getPicker();
Detail::PickerVisitor visitor( _states, false );
RenderContext context;
Helper::clearRenderContext( &context );
context.viewport = m_viewport.get();
context.camera = m_camera.get();
context.scissor = m_scissor.get();
visitor.visit( picker, context );
}
//////////////////////////////////////////////////////////////////////////
bool PickerService::pickStates_( float _x, float _y, ETouchCode _touchId, float _pressure, const InputSpecialData & _special, VectorPickerStates * const _states ) const
{
MENGINE_ASSERTION_FATAL( _states->empty() );
MENGINE_PROFILER_CATEGORY();
if( m_arrow == nullptr )
{
return false;
}
if( m_scene == nullptr )
{
return false;
}
if( m_camera == nullptr )
{
return false;
}
this->fillStates_( _states );
const Resolution & contentResolution = APPLICATION_SERVICE()
->getContentResolution();
mt::vec2f adapt_screen_position;
m_arrow->adaptScreenPosition_( mt::vec2f( _x, _y ), &adapt_screen_position );
bool handle = false;
for( VectorPickerStates::reverse_iterator
it = _states->rbegin(),
it_end = _states->rend();
it != it_end;
++it )
{
const PickerStateDesc & desc = *it;
PickerInterface * picker = desc.picker;
if( picker->isPickerEnable() == false )
{
continue;
}
if( handle == false || m_handleValue == false )
{
bool picked = picker->pick( adapt_screen_position, &desc.context, contentResolution, m_arrow );
if( m_block == false && picked == true )
{
if( picker->isPickerPicked() == false )
{
picker->setPickerPicked( true );
InputHandlerInterface * inputHandler = picker->getPickerInputHandler();
mt::vec2f wp;
m_arrow->calcPointClick( &desc.context, mt::vec2f( _x, _y ), &wp );
InputMouseEnterEvent ne;
ne.special = _special;
ne.touchId = _touchId;
ne.x = wp.x;
ne.y = wp.y;
ne.pressure = _pressure;
LOGGER_INFO( "picker", "handle type '%s' name '%s' UID [%u] pos [%.4f;%.4f] [mouse enter]"
, MENGINE_MIXIN_DEBUG_TYPE( inputHandler )
, MENGINE_MIXIN_DEBUG_NAME( inputHandler )
, MENGINE_MIXIN_DEBUG_UID( inputHandler )
, ne.x
, ne.y
);
handle = inputHandler->handleMouseEnter( ne );
picker->setPickerHandle( handle );
}
else
{
bool pickerHandle = picker->isPickerHandle();
handle = pickerHandle;
}
}
else
{
if( picker->isPickerPicked() == true )
{
picker->setPickerPicked( false );
InputHandlerInterface * inputHandler = picker->getPickerInputHandler();
mt::vec2f wp;
m_arrow->calcPointClick( &desc.context, mt::vec2f( _x, _y ), &wp );
InputMouseLeaveEvent ne;
ne.special = _special;
ne.touchId = _touchId;
ne.x = wp.x;
ne.y = wp.y;
ne.pressure = _pressure;
LOGGER_INFO( "picker", "handle type '%s' name '%s' UID [%u] pos [%.4f;%.4f] [mouse leave]"
, MENGINE_MIXIN_DEBUG_TYPE( inputHandler )
, MENGINE_MIXIN_DEBUG_NAME( inputHandler )
, MENGINE_MIXIN_DEBUG_UID( inputHandler )
, ne.x
, ne.y
);
inputHandler->handleMouseLeave( ne );
}
}
}
else
{
if( picker->isPickerPicked() == true )
{
picker->setPickerPicked( false );
InputHandlerInterface * inputHandler = picker->getPickerInputHandler();
mt::vec2f wp;
m_arrow->calcPointClick( &desc.context, mt::vec2f( _x, _y ), &wp );
InputMouseLeaveEvent ne;
ne.special = _special;
ne.touchId = _touchId;
ne.x = wp.x;
ne.y = wp.y;
ne.pressure = _pressure;
LOGGER_INFO( "picker", "handle type '%s' name '%s' UID [%u] pos [%.4f;%.4f] [mouse leave]"
, MENGINE_MIXIN_DEBUG_TYPE( inputHandler )
, MENGINE_MIXIN_DEBUG_NAME( inputHandler )
, MENGINE_MIXIN_DEBUG_UID( inputHandler )
, ne.x
, ne.y
);
inputHandler->handleMouseLeave( ne );
}
}
}
return true;
}
//////////////////////////////////////////////////////////////////////////
bool PickerService::getStates_( float _x, float _y, VectorPickerStates * const _states ) const
{
MENGINE_ASSERTION_FATAL( _states->empty() );
if( m_arrow == nullptr )
{
return false;
}
if( m_scene == nullptr )
{
return false;
}
if( m_camera == nullptr )
{
return false;
}
if( m_block == true )
{
return true;
}
VectorPickerStates statesAux;
this->fillStates_( &statesAux );
const Resolution & contentResolution = APPLICATION_SERVICE()
->getContentResolution();
mt::vec2f adapt_screen_position;
m_arrow->adaptScreenPosition_( mt::vec2f( _x, _y ), &adapt_screen_position );
for( const PickerStateDesc & desc : statesAux )
{
PickerInterface * picker = desc.picker;
if( picker->isPickerEnable() == false )
{
continue;
}
bool picked = picker->pick( adapt_screen_position, &desc.context, contentResolution, m_arrow );
if( picked == false )
{
continue;
}
_states->push_back( desc );
}
return true;
}
//////////////////////////////////////////////////////////////////////////
}
| 30.089385 | 172 | 0.453398 | irov |
5b2a210b884266a9629387e4c463dc844adb3705 | 1,182 | cpp | C++ | examples/twiscanner/main.cpp | 2ni/aprico | 0b421a1dcf523474d17df06ab5467ef5c369a6cd | [
"MIT"
] | 1 | 2021-03-02T19:54:04.000Z | 2021-03-02T19:54:04.000Z | examples/twiscanner/main.cpp | 2ni/aprico | 0b421a1dcf523474d17df06ab5467ef5c369a6cd | [
"MIT"
] | null | null | null | examples/twiscanner/main.cpp | 2ni/aprico | 0b421a1dcf523474d17df06ab5467ef5c369a6cd | [
"MIT"
] | null | null | null | #include <util/delay.h>
#include <avr/io.h>
#include "uart.h"
#include "twi.h"
#include "mcu.h"
int main(void) {
mcu_init();
twi_init();
DL("start scanning");
for (uint8_t addr = 0; addr<128; addr+=1) {
// DF("0x%02x: %s\n", addr, twi_start(addr) ? "-" : "yes");
if (!twi_start(addr)) {
DF("0x%02x\n", addr);
}
twi_stop();
}
DL("done.");
uint8_t data[3] = {0};
// read raw data from an SHT20
// see https://github.com/DFRobot/DFRobot_SHT20/blob/master/DFRobot_SHT20.cpp
uint8_t status = twi_read_bytes(0x40, data, 0xe3, 2); // read temp hold
if (status == 0) {
uint32_t raw = ((uint32_t)data[0]<<8) | (uint32_t)data[1];
char out[6];
// DF("%u %u\n", data[0], data[1]);
// DF("temp raw: %lu\n", raw_temp);
raw *= 17572;
raw /= 65536;
raw -= 4685;
uart_u2c(out, raw, 2);
DF("temp: %sC\n", out);
twi_read_bytes(0x40, data, 0xe5, 2); // read humidity hold
raw = ((uint32_t)data[0]<<8) | (uint32_t)data[1];
raw *= 12500;
raw /= 65536;
raw -= 6;
uart_u2c(out, raw, 2);
DF("humidity: %s%%\n", out);
} else {
DF(NOK("sensor SHT20 not found:") " %u\n", status);
}
}
| 22.730769 | 79 | 0.551607 | 2ni |
5b334ef7343ddfff5c1f6c39173f40733da94898 | 536 | cpp | C++ | Inheritance/hierarchical.cpp | git-elliot/competitive_programming_codes | b8b5646ae5074b453e7f1af982af174b9c4138e1 | [
"MIT"
] | 1 | 2021-06-20T17:28:54.000Z | 2021-06-20T17:28:54.000Z | Inheritance/hierarchical.cpp | git-elliot/competitive_programming_codes | b8b5646ae5074b453e7f1af982af174b9c4138e1 | [
"MIT"
] | null | null | null | Inheritance/hierarchical.cpp | git-elliot/competitive_programming_codes | b8b5646ae5074b453e7f1af982af174b9c4138e1 | [
"MIT"
] | null | null | null | #include<iostream>
using namespace std;
//Hierarchical inheritance is defined as the process of deriving more than one class from a base class.
class Shape{
public:
int a = 10;
int b = 20;
};
class Rectange : public Shape{
public:
int area(){
return a*b;
}
};
class Triangle : public Shape{
public:
float area(){
return 0.5*a*b;
}
};
int main(){
Rectange rect;
cout<<"Area of Rect: "<<rect.area()<<endl;
Triangle tri;
cout<<"Area of Triangle: "<<tri.area()<<endl;
} | 18.482759 | 103 | 0.602612 | git-elliot |
5b35ba30ca6d5dfdd25a376ffe5581c1cef53dc4 | 582 | cpp | C++ | libcxx/test/libcxx/modules/stdint_h_exports.sh.cpp | clayne/libcudacxx | b6908c62833db1f0bb5ae06944f6613f23d814b3 | [
"Apache-2.0"
] | 778 | 2015-01-01T03:30:02.000Z | 2022-03-20T15:58:39.000Z | libcxx/test/libcxx/modules/stdint_h_exports.sh.cpp | clayne/libcudacxx | b6908c62833db1f0bb5ae06944f6613f23d814b3 | [
"Apache-2.0"
] | 47 | 2019-12-11T02:34:13.000Z | 2020-06-08T19:26:59.000Z | libcxx/test/libcxx/modules/stdint_h_exports.sh.cpp | clayne/libcudacxx | b6908c62833db1f0bb5ae06944f6613f23d814b3 | [
"Apache-2.0"
] | 412 | 2015-01-01T06:25:38.000Z | 2022-03-26T16:58:34.000Z | //===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
// REQUIRES: modules-support
// Test that int8_t and the like are exported from stdint.h not inttypes.h
// RUN: %build_module
#include <stdint.h>
int main(int, char**) {
int8_t x; ((void)x);
return 0;
}
| 26.454545 | 80 | 0.508591 | clayne |
5b35e72d4a64ecc037629c4f870702465262d8e3 | 156 | cpp | C++ | examples/core/static/application/main.cpp | smeualex/cmake-examples | d443a5d9359565f474f56f0251a511544b2168eb | [
"MIT"
] | 979 | 2019-03-10T15:31:09.000Z | 2022-03-26T03:58:49.000Z | examples/core/static/application/main.cpp | smeualex/cmake-examples | d443a5d9359565f474f56f0251a511544b2168eb | [
"MIT"
] | 9 | 2019-03-11T13:05:08.000Z | 2021-09-27T21:27:07.000Z | examples/core/static/application/main.cpp | smeualex/cmake-examples | d443a5d9359565f474f56f0251a511544b2168eb | [
"MIT"
] | 56 | 2019-03-11T07:05:54.000Z | 2022-02-23T14:00:59.000Z | #include <iostream>
#include "calculator-static/calculator.h"
int main(int argc, char** argv)
{
std::cout << calc::square(4) << "\n";
return 0;
}
| 15.6 | 41 | 0.621795 | smeualex |
5b376114194c63acba15113fcd514aec00167d28 | 492 | hpp | C++ | FootCommander.hpp | Revertigo/wargame-b | 8cd4591586b275923c38047c480a61529cc199dc | [
"MIT"
] | null | null | null | FootCommander.hpp | Revertigo/wargame-b | 8cd4591586b275923c38047c480a61529cc199dc | [
"MIT"
] | null | null | null | FootCommander.hpp | Revertigo/wargame-b | 8cd4591586b275923c38047c480a61529cc199dc | [
"MIT"
] | null | null | null | //
// Created by osboxes on 5/19/20.
//
#ifndef WARGAME_A_FOOTCOMMANDER_HPP
#define WARGAME_A_FOOTCOMMANDER_HPP
#include "FootSoldier.hpp"
class FootCommander : public FootSoldier {
using FootSoldier::FootSoldier;
static const int DMG = 20;
static const int HP = 150;
protected:
void act(pair<int, int> src, vector<vector<Soldier *>> &board) override;
public:
FootCommander(int player): FootSoldier(player, HP, "FC", DMG){}
};
#endif //WARGAME_A_FOOTCOMMANDER_HPP
| 19.68 | 76 | 0.721545 | Revertigo |
5b38ab5fa55a82fcad14eb97c0489a7ae842c601 | 14,132 | cpp | C++ | test/input_cases/csp_financial_defaults.cpp | JordanMalan/ssc | cadb7a9f3183d63c600b5c33f53abced35b6b319 | [
"BSD-3-Clause"
] | 61 | 2017-08-09T15:10:59.000Z | 2022-02-15T21:45:31.000Z | test/input_cases/csp_financial_defaults.cpp | JordanMalan/ssc | cadb7a9f3183d63c600b5c33f53abced35b6b319 | [
"BSD-3-Clause"
] | 462 | 2017-07-31T21:26:46.000Z | 2022-03-30T22:53:50.000Z | test/input_cases/csp_financial_defaults.cpp | JordanMalan/ssc | cadb7a9f3183d63c600b5c33f53abced35b6b319 | [
"BSD-3-Clause"
] | 73 | 2017-08-24T17:39:31.000Z | 2022-03-28T08:37:47.000Z | #include "../input_cases/code_generator_utilities.h"
/**
* Default parameters for the PPA singleowner (utility) financial model
*/
ssc_data_t singleowner_defaults()
{
ssc_data_t data = ssc_data_create();
ssc_data_set_number(data, "analysis_period", 25);
ssc_number_t p_federal_tax_rate[1] = { 21 };
ssc_data_set_array(data, "federal_tax_rate", p_federal_tax_rate, 1);
ssc_number_t p_state_tax_rate[1] = { 7 };
ssc_data_set_array(data, "state_tax_rate", p_state_tax_rate, 1);
ssc_data_set_number(data, "property_tax_rate", 0);
ssc_data_set_number(data, "prop_tax_cost_assessed_percent", 100);
ssc_data_set_number(data, "prop_tax_assessed_decline", 0);
ssc_data_set_number(data, "real_discount_rate", 6.4000000953674316);
ssc_data_set_number(data, "inflation_rate", 2.5);
ssc_data_set_number(data, "insurance_rate", 0.5);
ssc_data_set_number(data, "system_capacity", 99899.9921875);
ssc_number_t p_om_fixed[1] = { 0 };
ssc_data_set_array(data, "om_fixed", p_om_fixed, 1);
ssc_data_set_number(data, "om_fixed_escal", 0);
ssc_number_t p_om_production[1] = { 4 };
ssc_data_set_array(data, "om_production", p_om_production, 1);
ssc_data_set_number(data, "om_production_escal", 0);
ssc_number_t p_om_capacity[1] = { 66 };
ssc_data_set_array(data, "om_capacity", p_om_capacity, 1);
ssc_data_set_number(data, "om_capacity_escal", 0);
ssc_number_t p_om_fuel_cost[1] = { 0 };
ssc_data_set_array(data, "om_fuel_cost", p_om_fuel_cost, 1);
ssc_data_set_number(data, "om_fuel_cost_escal", 0);
ssc_number_t p_om_batt_replacement_cost[1] = { 0 };
ssc_data_set_array(data, "om_batt_replacement_cost", p_om_batt_replacement_cost, 1);
ssc_data_set_number(data, "om_replacement_cost_escal", 0);
ssc_data_set_number(data, "itc_fed_amount", 0);
ssc_data_set_number(data, "itc_fed_amount_deprbas_fed", 1);
ssc_data_set_number(data, "itc_fed_amount_deprbas_sta", 1);
ssc_data_set_number(data, "itc_sta_amount", 0);
ssc_data_set_number(data, "itc_sta_amount_deprbas_fed", 0);
ssc_data_set_number(data, "itc_sta_amount_deprbas_sta", 0);
ssc_data_set_number(data, "itc_fed_percent", 30);
ssc_data_set_number(data, "itc_fed_percent_maxvalue", 9.9999996802856925e+37);
ssc_data_set_number(data, "itc_fed_percent_deprbas_fed", 1);
ssc_data_set_number(data, "itc_fed_percent_deprbas_sta", 1);
ssc_data_set_number(data, "itc_sta_percent", 0);
ssc_data_set_number(data, "itc_sta_percent_maxvalue", 9.9999996802856925e+37);
ssc_data_set_number(data, "itc_sta_percent_deprbas_fed", 0);
ssc_data_set_number(data, "itc_sta_percent_deprbas_sta", 0);
ssc_number_t p_ptc_fed_amount[1] = { 0 };
ssc_data_set_array(data, "ptc_fed_amount", p_ptc_fed_amount, 1);
ssc_data_set_number(data, "ptc_fed_term", 10);
ssc_data_set_number(data, "ptc_fed_escal", 0);
ssc_number_t p_ptc_sta_amount[1] = { 0 };
ssc_data_set_array(data, "ptc_sta_amount", p_ptc_sta_amount, 1);
ssc_data_set_number(data, "ptc_sta_term", 10);
ssc_data_set_number(data, "ptc_sta_escal", 0);
ssc_data_set_number(data, "ibi_fed_amount", 0);
ssc_data_set_number(data, "ibi_fed_amount_tax_fed", 1);
ssc_data_set_number(data, "ibi_fed_amount_tax_sta", 1);
ssc_data_set_number(data, "ibi_fed_amount_deprbas_fed", 0);
ssc_data_set_number(data, "ibi_fed_amount_deprbas_sta", 0);
ssc_data_set_number(data, "ibi_sta_amount", 0);
ssc_data_set_number(data, "ibi_sta_amount_tax_fed", 1);
ssc_data_set_number(data, "ibi_sta_amount_tax_sta", 1);
ssc_data_set_number(data, "ibi_sta_amount_deprbas_fed", 0);
ssc_data_set_number(data, "ibi_sta_amount_deprbas_sta", 0);
ssc_data_set_number(data, "ibi_uti_amount", 0);
ssc_data_set_number(data, "ibi_uti_amount_tax_fed", 1);
ssc_data_set_number(data, "ibi_uti_amount_tax_sta", 1);
ssc_data_set_number(data, "ibi_uti_amount_deprbas_fed", 0);
ssc_data_set_number(data, "ibi_uti_amount_deprbas_sta", 0);
ssc_data_set_number(data, "ibi_oth_amount", 0);
ssc_data_set_number(data, "ibi_oth_amount_tax_fed", 1);
ssc_data_set_number(data, "ibi_oth_amount_tax_sta", 1);
ssc_data_set_number(data, "ibi_oth_amount_deprbas_fed", 0);
ssc_data_set_number(data, "ibi_oth_amount_deprbas_sta", 0);
ssc_data_set_number(data, "ibi_fed_percent", 0);
ssc_data_set_number(data, "ibi_fed_percent_maxvalue", 9.9999996802856925e+37);
ssc_data_set_number(data, "ibi_fed_percent_tax_fed", 1);
ssc_data_set_number(data, "ibi_fed_percent_tax_sta", 1);
ssc_data_set_number(data, "ibi_fed_percent_deprbas_fed", 0);
ssc_data_set_number(data, "ibi_fed_percent_deprbas_sta", 0);
ssc_data_set_number(data, "ibi_sta_percent", 0);
ssc_data_set_number(data, "ibi_sta_percent_maxvalue", 9.9999996802856925e+37);
ssc_data_set_number(data, "ibi_sta_percent_tax_fed", 1);
ssc_data_set_number(data, "ibi_sta_percent_tax_sta", 1);
ssc_data_set_number(data, "ibi_sta_percent_deprbas_fed", 0);
ssc_data_set_number(data, "ibi_sta_percent_deprbas_sta", 0);
ssc_data_set_number(data, "ibi_uti_percent", 0);
ssc_data_set_number(data, "ibi_uti_percent_maxvalue", 9.9999996802856925e+37);
ssc_data_set_number(data, "ibi_uti_percent_tax_fed", 1);
ssc_data_set_number(data, "ibi_uti_percent_tax_sta", 1);
ssc_data_set_number(data, "ibi_uti_percent_deprbas_fed", 0);
ssc_data_set_number(data, "ibi_uti_percent_deprbas_sta", 0);
ssc_data_set_number(data, "ibi_oth_percent", 0);
ssc_data_set_number(data, "ibi_oth_percent_maxvalue", 9.9999996802856925e+37);
ssc_data_set_number(data, "ibi_oth_percent_tax_fed", 1);
ssc_data_set_number(data, "ibi_oth_percent_tax_sta", 1);
ssc_data_set_number(data, "ibi_oth_percent_deprbas_fed", 0);
ssc_data_set_number(data, "ibi_oth_percent_deprbas_sta", 0);
ssc_data_set_number(data, "cbi_fed_amount", 0);
ssc_data_set_number(data, "cbi_fed_maxvalue", 9.9999996802856925e+37);
ssc_data_set_number(data, "cbi_fed_tax_fed", 1);
ssc_data_set_number(data, "cbi_fed_tax_sta", 1);
ssc_data_set_number(data, "cbi_fed_deprbas_fed", 0);
ssc_data_set_number(data, "cbi_fed_deprbas_sta", 0);
ssc_data_set_number(data, "cbi_sta_amount", 0);
ssc_data_set_number(data, "cbi_sta_maxvalue", 9.9999996802856925e+37);
ssc_data_set_number(data, "cbi_sta_tax_fed", 1);
ssc_data_set_number(data, "cbi_sta_tax_sta", 1);
ssc_data_set_number(data, "cbi_sta_deprbas_fed", 0);
ssc_data_set_number(data, "cbi_sta_deprbas_sta", 0);
ssc_data_set_number(data, "cbi_uti_amount", 0);
ssc_data_set_number(data, "cbi_uti_maxvalue", 9.9999996802856925e+37);
ssc_data_set_number(data, "cbi_uti_tax_fed", 1);
ssc_data_set_number(data, "cbi_uti_tax_sta", 1);
ssc_data_set_number(data, "cbi_uti_deprbas_fed", 0);
ssc_data_set_number(data, "cbi_uti_deprbas_sta", 0);
ssc_data_set_number(data, "cbi_oth_amount", 0);
ssc_data_set_number(data, "cbi_oth_maxvalue", 9.9999996802856925e+37);
ssc_data_set_number(data, "cbi_oth_tax_fed", 1);
ssc_data_set_number(data, "cbi_oth_tax_sta", 1);
ssc_data_set_number(data, "cbi_oth_deprbas_fed", 0);
ssc_data_set_number(data, "cbi_oth_deprbas_sta", 0);
ssc_number_t p_pbi_fed_amount[1] = { 0 };
ssc_data_set_array(data, "pbi_fed_amount", p_pbi_fed_amount, 1);
ssc_data_set_number(data, "pbi_fed_term", 0);
ssc_data_set_number(data, "pbi_fed_escal", 0);
ssc_data_set_number(data, "pbi_fed_tax_fed", 1);
ssc_data_set_number(data, "pbi_fed_tax_sta", 1);
ssc_number_t p_pbi_sta_amount[1] = { 0 };
ssc_data_set_array(data, "pbi_sta_amount", p_pbi_sta_amount, 1);
ssc_data_set_number(data, "pbi_sta_term", 0);
ssc_data_set_number(data, "pbi_sta_escal", 0);
ssc_data_set_number(data, "pbi_sta_tax_fed", 1);
ssc_data_set_number(data, "pbi_sta_tax_sta", 1);
ssc_number_t p_pbi_uti_amount[1] = { 0 };
ssc_data_set_array(data, "pbi_uti_amount", p_pbi_uti_amount, 1);
ssc_data_set_number(data, "pbi_uti_term", 0);
ssc_data_set_number(data, "pbi_uti_escal", 0);
ssc_data_set_number(data, "pbi_uti_tax_fed", 1);
ssc_data_set_number(data, "pbi_uti_tax_sta", 1);
ssc_number_t p_pbi_oth_amount[1] = { 0 };
ssc_data_set_array(data, "pbi_oth_amount", p_pbi_oth_amount, 1);
ssc_data_set_number(data, "pbi_oth_term", 0);
ssc_data_set_number(data, "pbi_oth_escal", 0);
ssc_data_set_number(data, "pbi_oth_tax_fed", 1);
ssc_data_set_number(data, "pbi_oth_tax_sta", 1);
ssc_number_t p_degradation[1] = { 0 };
ssc_data_set_array(data, "degradation", p_degradation, 1);
ssc_data_set_number(data, "loan_moratorium", 0);
ssc_data_set_number(data, "system_use_recapitalization", 0);
ssc_data_set_number(data, "system_use_lifetime_output", 0);
ssc_data_set_number(data, "total_installed_cost", 562201472);
ssc_data_set_number(data, "reserves_interest", 1.75);
ssc_data_set_number(data, "equip1_reserve_cost", 0);
ssc_data_set_number(data, "equip1_reserve_freq", 12);
ssc_data_set_number(data, "equip2_reserve_cost", 0);
ssc_data_set_number(data, "equip2_reserve_freq", 15);
ssc_data_set_number(data, "equip3_reserve_cost", 0);
ssc_data_set_number(data, "equip3_reserve_freq", 3);
ssc_data_set_number(data, "equip_reserve_depr_sta", 0);
ssc_data_set_number(data, "equip_reserve_depr_fed", 0);
ssc_data_set_number(data, "salvage_percentage", 0);
ssc_data_set_number(data, "ppa_soln_mode", 0);
ssc_number_t p_ppa_price_input[1] = { 0.13 };
ssc_data_set_array(data, "ppa_price_input", p_ppa_price_input, 1);
ssc_data_set_number(data, "cp_capacity_payment_esc", 0);
ssc_data_set_number(data, "cp_capacity_payment_type", 0);
ssc_data_set_number(data, "cp_system_nameplate", 0);
ssc_data_set_number(data, "cp_battery_nameplate", 0);
ssc_data_set_array(data, "cp_capacity_credit_percent", p_ppa_price_input, 1);
ssc_data_set_array(data, "cp_capacity_payment_amount", p_ppa_price_input, 1);
ssc_data_set_number(data, "ppa_escalation", 1);
ssc_data_set_number(data, "construction_financing_cost", 28110074);
ssc_data_set_number(data, "term_tenor", 18);
ssc_data_set_number(data, "term_int_rate", 7);
ssc_data_set_number(data, "dscr", 1.2999999523162842);
ssc_data_set_number(data, "dscr_reserve_months", 6);
ssc_data_set_number(data, "debt_percent", 50);
ssc_data_set_number(data, "debt_option", 1);
ssc_data_set_number(data, "payment_option", 0);
ssc_data_set_number(data, "cost_debt_closing", 450000);
ssc_data_set_number(data, "cost_debt_fee", 2.75);
ssc_data_set_number(data, "months_working_reserve", 6);
ssc_data_set_number(data, "months_receivables_reserve", 0);
ssc_data_set_number(data, "cost_other_financing", 0);
ssc_data_set_number(data, "flip_target_percent", 11);
ssc_data_set_number(data, "flip_target_year", 20);
ssc_data_set_number(data, "depr_alloc_macrs_5_percent", 90);
ssc_data_set_number(data, "depr_alloc_macrs_15_percent", 1.5);
ssc_data_set_number(data, "depr_alloc_sl_5_percent", 0);
ssc_data_set_number(data, "depr_alloc_sl_15_percent", 2.5);
ssc_data_set_number(data, "depr_alloc_sl_20_percent", 3);
ssc_data_set_number(data, "depr_alloc_sl_39_percent", 0);
ssc_data_set_number(data, "depr_alloc_custom_percent", 0);
ssc_number_t p_depr_custom_schedule[1] = { 0 };
ssc_data_set_array(data, "depr_custom_schedule", p_depr_custom_schedule, 1);
ssc_data_set_number(data, "depr_bonus_sta", 0);
ssc_data_set_number(data, "depr_bonus_sta_macrs_5", 1);
ssc_data_set_number(data, "depr_bonus_sta_macrs_15", 1);
ssc_data_set_number(data, "depr_bonus_sta_sl_5", 0);
ssc_data_set_number(data, "depr_bonus_sta_sl_15", 0);
ssc_data_set_number(data, "depr_bonus_sta_sl_20", 0);
ssc_data_set_number(data, "depr_bonus_sta_sl_39", 0);
ssc_data_set_number(data, "depr_bonus_sta_custom", 0);
ssc_data_set_number(data, "depr_bonus_fed", 0);
ssc_data_set_number(data, "depr_bonus_fed_macrs_5", 1);
ssc_data_set_number(data, "depr_bonus_fed_macrs_15", 1);
ssc_data_set_number(data, "depr_bonus_fed_sl_5", 0);
ssc_data_set_number(data, "depr_bonus_fed_sl_15", 0);
ssc_data_set_number(data, "depr_bonus_fed_sl_20", 0);
ssc_data_set_number(data, "depr_bonus_fed_sl_39", 0);
ssc_data_set_number(data, "depr_bonus_fed_custom", 0);
ssc_data_set_number(data, "depr_itc_sta_macrs_5", 1);
ssc_data_set_number(data, "depr_itc_sta_macrs_15", 0);
ssc_data_set_number(data, "depr_itc_sta_sl_5", 0);
ssc_data_set_number(data, "depr_itc_sta_sl_15", 0);
ssc_data_set_number(data, "depr_itc_sta_sl_20", 0);
ssc_data_set_number(data, "depr_itc_sta_sl_39", 0);
ssc_data_set_number(data, "depr_itc_sta_custom", 0);
ssc_data_set_number(data, "depr_itc_fed_macrs_5", 1);
ssc_data_set_number(data, "depr_itc_fed_macrs_15", 0);
ssc_data_set_number(data, "depr_itc_fed_sl_5", 0);
ssc_data_set_number(data, "depr_itc_fed_sl_15", 0);
ssc_data_set_number(data, "depr_itc_fed_sl_20", 0);
ssc_data_set_number(data, "depr_itc_fed_sl_39", 0);
ssc_data_set_number(data, "depr_itc_fed_custom", 0);
ssc_data_set_number(data, "pbi_fed_for_ds", 0);
ssc_data_set_number(data, "pbi_sta_for_ds", 0);
ssc_data_set_number(data, "pbi_uti_for_ds", 0);
ssc_data_set_number(data, "pbi_oth_for_ds", 0);
ssc_data_set_number(data, "depr_stabas_method", 1);
ssc_data_set_number(data, "depr_fedbas_method", 1);
return data;
}
/**
* Default data for iph_to_lcoefcr
*/
void convert_and_adjust_fixed_charge(ssc_data_t& data)
{
ssc_data_set_number(data, "electricity_rate", 0.059999998658895493);
ssc_data_set_number(data, "fixed_operating_cost", 103758.203125);
}
/**
* Default data for lcoefcr
*/
void fixed_charge_rate_default(ssc_data_t& data)
{
ssc_data_set_number(data, "capital_cost", 7263074);
ssc_data_set_number(data, "variable_operating_cost", 0.0010000000474974513);
ssc_data_set_number(data, "fixed_charge_rate", 0.10807877779006958);
}
| 54.563707 | 88 | 0.755095 | JordanMalan |
5b42fd012491ec36c26d7ab0e6fa47e8c7a80fb4 | 3,763 | cpp | C++ | Co-Simulation/Sumo/sumo-1.7.0/src/libsumo/MeanData.cpp | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | null | null | null | Co-Simulation/Sumo/sumo-1.7.0/src/libsumo/MeanData.cpp | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | null | null | null | Co-Simulation/Sumo/sumo-1.7.0/src/libsumo/MeanData.cpp | uruzahe/carla | 940c2ab23cce1eda1ef66de35f66b42d40865fb1 | [
"MIT"
] | null | null | null | /****************************************************************************/
// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
// Copyright (C) 2017-2020 German Aerospace Center (DLR) and others.
// This program and the accompanying materials are made available under the
// terms of the Eclipse Public License 2.0 which is available at
// https://www.eclipse.org/legal/epl-2.0/
// This Source Code may also be made available under the following Secondary
// Licenses when the conditions for such availability set forth in the Eclipse
// Public License 2.0 are satisfied: GNU General Public License, version 2
// or later which is available at
// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
/****************************************************************************/
/// @file MeanData.cpp
/// @author Jakob Erdmann
/// @date 16.03.2020
///
// C++ TraCI client API implementation
/****************************************************************************/
#include <config.h>
#include <microsim/MSNet.h>
#include <microsim/MSEdge.h>
#include <microsim/output/MSDetectorControl.h>
#include <microsim/output/MSMeanData.h>
#include <libsumo/TraCIConstants.h>
#include "Helper.h"
#include "MeanData.h"
namespace libsumo {
// ===========================================================================
// static member initializations
// ===========================================================================
SubscriptionResults MeanData::mySubscriptionResults;
ContextSubscriptionResults MeanData::myContextSubscriptionResults;
// ===========================================================================
// static member definitions
// ===========================================================================
std::vector<std::string>
MeanData::getIDList() {
std::vector<std::string> ids;
for (auto item : MSNet::getInstance()->getDetectorControl().getMeanData()) {
ids.push_back(item.first);
}
std::sort(ids.begin(), ids.end());
return ids;
}
int
MeanData::getIDCount() {
return (int)getIDList().size();
}
std::string
MeanData::getParameter(const std::string& /* dataID */, const std::string& /* param */) {
return "";
}
LIBSUMO_GET_PARAMETER_WITH_KEY_IMPLEMENTATION(MeanData)
void
MeanData::setParameter(const std::string& /* dataID */, const std::string& /* key */, const std::string& /* value */) {
//MSMeanData* r = const_cast<MSMeanData*>(getMeanData(dataID));
//r->setParameter(key, value);
}
LIBSUMO_SUBSCRIPTION_IMPLEMENTATION(MeanData, MEANDATA)
MSMeanData*
MeanData::getMeanData(const std::string& id) {
auto mdMap = MSNet::getInstance()->getDetectorControl().getMeanData();
auto it = mdMap.find(id);
if (it == mdMap.end() || it->second.size() == 0) {
throw TraCIException("MeanData '" + id + "' is not known");
}
if (it->second.size() > 1) {
WRITE_WARNING("Found " + toString(it->second.size()) + " meanData definitions with id '" + id + "'.");
}
return it->second.front();
}
std::shared_ptr<VariableWrapper>
MeanData::makeWrapper() {
return std::make_shared<Helper::SubscriptionWrapper>(handleVariable, mySubscriptionResults, myContextSubscriptionResults);
}
bool
MeanData::handleVariable(const std::string& objID, const int variable, VariableWrapper* wrapper) {
switch (variable) {
case TRACI_ID_LIST:
return wrapper->wrapStringList(objID, variable, getIDList());
case ID_COUNT:
return wrapper->wrapInt(objID, variable, getIDCount());
default:
return false;
}
}
}
/****************************************************************************/
| 33.900901 | 126 | 0.581982 | uruzahe |
5b45ee309280c6904efe8f66d6a15b6d8a4ae950 | 3,673 | cpp | C++ | 3rdparty/webkit/Source/JavaScriptCore/runtime/RegExpCachedResult.cpp | mchiasson/PhaserNative | f867454602c395484bf730a7c43b9c586c102ac2 | [
"MIT"
] | null | null | null | 3rdparty/webkit/Source/JavaScriptCore/runtime/RegExpCachedResult.cpp | mchiasson/PhaserNative | f867454602c395484bf730a7c43b9c586c102ac2 | [
"MIT"
] | 9 | 2020-04-18T18:47:18.000Z | 2020-04-18T18:52:41.000Z | Source/JavaScriptCore/runtime/RegExpCachedResult.cpp | ijsf/DeniseEmbeddableWebKit | 57dfc6783d60f8f59b7129874e60f84d8c8556c9 | [
"BSD-3-Clause"
] | 1 | 2019-01-25T13:55:25.000Z | 2019-01-25T13:55:25.000Z | /*
* Copyright (C) 2012, 2016 Apple 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.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. ``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 APPLE INC. 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 "config.h"
#include "RegExpCachedResult.h"
#include "JSCInlines.h"
#include "RegExpMatchesArray.h"
namespace JSC {
void RegExpCachedResult::visitChildren(SlotVisitor& visitor)
{
visitor.append(m_lastInput);
visitor.append(m_lastRegExp);
if (m_reified) {
visitor.append(m_reifiedInput);
visitor.append(m_reifiedResult);
visitor.append(m_reifiedLeftContext);
visitor.append(m_reifiedRightContext);
}
}
JSArray* RegExpCachedResult::lastResult(ExecState* exec, JSObject* owner)
{
if (!m_reified) {
m_reifiedInput.set(exec->vm(), owner, m_lastInput.get());
if (m_result)
m_reifiedResult.setWithoutWriteBarrier(createRegExpMatchesArray(exec, exec->lexicalGlobalObject(), m_lastInput.get(), m_lastRegExp.get(), m_result.start));
else
m_reifiedResult.setWithoutWriteBarrier(createEmptyRegExpMatchesArray(exec->lexicalGlobalObject(), m_lastInput.get(), m_lastRegExp.get()));
m_reifiedLeftContext.clear();
m_reifiedRightContext.clear();
m_reified = true;
exec->vm().heap.writeBarrier(owner);
}
return m_reifiedResult.get();
}
JSString* RegExpCachedResult::leftContext(ExecState* exec, JSObject* owner)
{
// Make sure we're reified.
lastResult(exec, owner);
if (!m_reifiedLeftContext)
m_reifiedLeftContext.set(exec->vm(), owner, m_result.start ? jsSubstring(exec, m_reifiedInput.get(), 0, m_result.start) : jsEmptyString(exec));
return m_reifiedLeftContext.get();
}
JSString* RegExpCachedResult::rightContext(ExecState* exec, JSObject* owner)
{
// Make sure we're reified.
lastResult(exec, owner);
if (!m_reifiedRightContext) {
unsigned length = m_reifiedInput->length();
m_reifiedRightContext.set(exec->vm(), owner, m_result.end != length ? jsSubstring(exec, m_reifiedInput.get(), m_result.end, length - m_result.end) : jsEmptyString(exec));
}
return m_reifiedRightContext.get();
}
void RegExpCachedResult::setInput(ExecState* exec, JSObject* owner, JSString* input)
{
// Make sure we're reified, otherwise m_reifiedInput will be ignored.
lastResult(exec, owner);
leftContext(exec, owner);
rightContext(exec, owner);
ASSERT(m_reified);
m_reifiedInput.set(exec->vm(), owner, input);
}
} // namespace JSC
| 39.494624 | 178 | 0.725565 | mchiasson |
5b46ab1a6aff59cd4e94dd3da52da4c678152257 | 1,801 | hh | C++ | src/server/world/world.hh | TheBenPerson/Game | 824b2240e95529b735b4d8055a541c77102bb5dc | [
"MIT"
] | null | null | null | src/server/world/world.hh | TheBenPerson/Game | 824b2240e95529b735b4d8055a541c77102bb5dc | [
"MIT"
] | null | null | null | src/server/world/world.hh | TheBenPerson/Game | 824b2240e95529b735b4d8055a541c77102bb5dc | [
"MIT"
] | null | null | null | /*
*
* Game Development Build
* https://github.com/TheBenPerson/Game
*
* Copyright (C) 2016-2018 Ben Stockett <thebenstockett@gmail.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.
*
*/
#ifndef GAME_SERVER_WORLD
#define GAME_SERVER_WORLD
#include <stdint.h>
#include "client.hh"
#include "nodelist.hh"
#include "point.hh"
#include "tile.hh"
class World {
public:
static World *defaultWorld;
static NodeList worlds;
static World* get(char *name);
static World* newWorld(char *name);
static void sendWorld(Client *client);
Tile **tiles;
unsigned int width;
unsigned int height;
NodeList clients;
NodeList entities;
~World();
Tile* getTile(Point *pos);
void setTile(Point *pos, uint8_t id);
private:
char *name;
};
#endif
| 26.880597 | 81 | 0.738479 | TheBenPerson |
5b4808b262aef707ea7a7c1d8ebef6dda219df62 | 518 | cpp | C++ | CodeForces/fair_playoff.cpp | PieroNarciso/cprogramming | d3a53ce2afce6f853e0b7cc394190d5be6427902 | [
"MIT"
] | 2 | 2021-05-22T17:47:01.000Z | 2021-05-27T17:10:58.000Z | CodeForces/fair_playoff.cpp | PieroNarciso/cprogramming | d3a53ce2afce6f853e0b7cc394190d5be6427902 | [
"MIT"
] | null | null | null | CodeForces/fair_playoff.cpp | PieroNarciso/cprogramming | d3a53ce2afce6f853e0b7cc394190d5be6427902 | [
"MIT"
] | null | null | null | // https://codeforces.com/contest/1535/problem/A
#include <bits/stdc++.h>
using namespace std;
int s1, s2, s3, s4;
void solve() {
cin >> s1 >> s2 >> s3 >> s4;
int maxFirst = max(s1, s2);
int maxSec = max(s3, s4);
if ((maxFirst > s3 || maxFirst > s4) && (maxSec > s1 || maxSec > s2)) {
cout << "YES" << endl;
} else {
cout << "NO" << endl;
}
}
int main(int argc, const char** argv) {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int t;
cin >> t;
while (t--) {
solve();
}
return 0;
}
| 17.862069 | 72 | 0.557915 | PieroNarciso |
5b49d4572a0c31abe9a58c95e07b28d9644d623f | 1,017 | hpp | C++ | include/boost/simd/function/definition/divfix.hpp | yaeldarmon/boost.simd | 561316cc54bdc6353ca78f3b6d7e9120acd11144 | [
"BSL-1.0"
] | null | null | null | include/boost/simd/function/definition/divfix.hpp | yaeldarmon/boost.simd | 561316cc54bdc6353ca78f3b6d7e9120acd11144 | [
"BSL-1.0"
] | null | null | null | include/boost/simd/function/definition/divfix.hpp | yaeldarmon/boost.simd | 561316cc54bdc6353ca78f3b6d7e9120acd11144 | [
"BSL-1.0"
] | null | null | null | //==================================================================================================
/*!
@file
@copyright 2016 NumScale SAS
@copyright 2016 J.T.Lapreste
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
*/
//==================================================================================================
#ifndef BOOST_SIMD_FUNCTION_DEFINITION_DIVFIX_HPP_INCLUDED
#define BOOST_SIMD_FUNCTION_DEFINITION_DIVFIX_HPP_INCLUDED
#include <boost/simd/config.hpp>
#include <boost/dispatch/function/make_callable.hpp>
#include <boost/dispatch/hierarchy/functions.hpp>
#include <boost/simd/detail/dispatch.hpp>
namespace boost { namespace simd
{
namespace tag
{
BOOST_DISPATCH_MAKE_TAG(ext, divfix_, boost::dispatch::elementwise_<divfix_>);
}
namespace ext
{
BOOST_DISPATCH_FUNCTION_DECLARATION(tag, divfix_);
}
BOOST_DISPATCH_CALLABLE_DEFINITION(tag::divfix_,divfix);
} }
#endif
| 26.763158 | 100 | 0.621436 | yaeldarmon |
5b4ad5e9c00c8c56a79d05f88a8e6c79b366f86b | 485 | c++ | C++ | Hackerrank/Pairs [Medium].c++ | ammar-sayed-taha/problem-solving | 9677a738c0cc30078f6450f40fcc26ba2a379a8b | [
"MIT"
] | 1 | 2020-02-20T00:04:54.000Z | 2020-02-20T00:04:54.000Z | Hackerrank/Pairs [Medium].c++ | ammar-sayed-taha/Problem-Solving | c3ef98b8b0ebfbcc31d45990822b81a9dc549fe8 | [
"MIT"
] | null | null | null | Hackerrank/Pairs [Medium].c++ | ammar-sayed-taha/Problem-Solving | c3ef98b8b0ebfbcc31d45990822b81a9dc549fe8 | [
"MIT"
] | null | null | null | #include <bits/stdc++.h>
using namespace std;
vector<string> split_string(string);
// Complete the pairs function below.
int pairs(int k, vector<int> arr) {
sort(arr.begin(), arr.end()); // O(nlgn)
int counter=0;
for(auto i = 0; i < arr.size(); i++){ // O(n)
for(auto j=i+1; j<arr.size(); j++){ // O(n)
if(abs(arr[i] - arr[j]) == k)
counter++;
if(abs(arr[i] - arr[j]) > k) break;
}
}
return counter;
}
| 20.208333 | 51 | 0.503093 | ammar-sayed-taha |
5b4d50307cb7b27c957e3b6c53e64d10fb71b23b | 13,609 | cc | C++ | device/usb/usb_service_impl.cc | kjthegod/chromium | cf940f7f418436b77e15b1ea23e6fa100ca1c91a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 1 | 2019-11-28T10:46:52.000Z | 2019-11-28T10:46:52.000Z | device/usb/usb_service_impl.cc | kjthegod/chromium | cf940f7f418436b77e15b1ea23e6fa100ca1c91a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | device/usb/usb_service_impl.cc | kjthegod/chromium | cf940f7f418436b77e15b1ea23e6fa100ca1c91a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 2 | 2015-03-27T11:15:39.000Z | 2016-08-17T14:19:56.000Z | // Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "device/usb/usb_service.h"
#include <map>
#include <set>
#include "base/bind.h"
#include "base/lazy_instance.h"
#include "base/memory/weak_ptr.h"
#include "base/message_loop/message_loop.h"
#include "base/single_thread_task_runner.h"
#include "base/stl_util.h"
#include "base/thread_task_runner_handle.h"
#include "device/usb/usb_context.h"
#include "device/usb/usb_device_impl.h"
#include "device/usb/usb_error.h"
#include "third_party/libusb/src/libusb/libusb.h"
#if defined(OS_WIN)
#include <usbiodef.h>
#include "base/scoped_observer.h"
#include "device/core/device_monitor_win.h"
#endif // OS_WIN
namespace device {
namespace {
base::LazyInstance<scoped_ptr<UsbService> >::Leaky g_usb_service_instance =
LAZY_INSTANCE_INITIALIZER;
} // namespace
typedef struct libusb_device* PlatformUsbDevice;
typedef struct libusb_context* PlatformUsbContext;
class UsbServiceImpl : public UsbService,
private base::MessageLoop::DestructionObserver {
public:
explicit UsbServiceImpl(
PlatformUsbContext context,
scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner);
~UsbServiceImpl() override;
private:
// device::UsbService implementation
scoped_refptr<UsbDevice> GetDeviceById(uint32 unique_id) override;
void GetDevices(std::vector<scoped_refptr<UsbDevice>>* devices) override;
// base::MessageLoop::DestructionObserver implementation.
void WillDestroyCurrentMessageLoop() override;
// Enumerate USB devices from OS and update devices_ map.
void RefreshDevices();
// Adds a new UsbDevice to the devices_ map based on the given libusb device.
scoped_refptr<UsbDeviceImpl> AddDevice(PlatformUsbDevice platform_device);
// Handle hotplug events from libusb.
static int LIBUSB_CALL HotplugCallback(libusb_context* context,
PlatformUsbDevice device,
libusb_hotplug_event event,
void* user_data);
// These functions release a reference to the provided platform device.
void OnDeviceAdded(PlatformUsbDevice platform_device);
void OnDeviceRemoved(PlatformUsbDevice platform_device);
scoped_refptr<UsbContext> context_;
scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_;
#if defined(OS_WIN)
class UIThreadHelper;
UIThreadHelper* ui_thread_helper_;
#endif // OS_WIN
// TODO(reillyg): Figure out a better solution for device IDs.
uint32 next_unique_id_;
// When available the device list will be updated when new devices are
// connected instead of only when a full enumeration is requested.
// TODO(reillyg): Support this on all platforms. crbug.com/411715
bool hotplug_enabled_;
libusb_hotplug_callback_handle hotplug_handle_;
// The map from unique IDs to UsbDevices.
typedef std::map<uint32, scoped_refptr<UsbDeviceImpl> > DeviceMap;
DeviceMap devices_;
// The map from PlatformUsbDevices to UsbDevices.
typedef std::map<PlatformUsbDevice, scoped_refptr<UsbDeviceImpl> >
PlatformDeviceMap;
PlatformDeviceMap platform_devices_;
base::WeakPtrFactory<UsbServiceImpl> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(UsbServiceImpl);
};
#if defined(OS_WIN)
// This class lives on the application main thread so that it can listen for
// device change notification window messages. It registers for notifications
// regarding devices implementating the "UsbDevice" interface, which represents
// most of the devices the UsbService will enumerate.
class UsbServiceImpl::UIThreadHelper : DeviceMonitorWin::Observer {
public:
UIThreadHelper(base::WeakPtr<UsbServiceImpl> usb_service)
: task_runner_(base::ThreadTaskRunnerHandle::Get()),
usb_service_(usb_service),
device_observer_(this) {}
~UIThreadHelper() {}
void Start() {
DeviceMonitorWin* device_monitor =
DeviceMonitorWin::GetForDeviceInterface(GUID_DEVINTERFACE_USB_DEVICE);
if (device_monitor) {
device_observer_.Add(device_monitor);
}
}
private:
void OnDeviceAdded(const std::string& device_path) override {
task_runner_->PostTask(
FROM_HERE, base::Bind(&UsbServiceImpl::RefreshDevices, usb_service_));
}
void OnDeviceRemoved(const std::string& device_path) override {
task_runner_->PostTask(
FROM_HERE, base::Bind(&UsbServiceImpl::RefreshDevices, usb_service_));
}
scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
base::WeakPtr<UsbServiceImpl> usb_service_;
ScopedObserver<DeviceMonitorWin, DeviceMonitorWin::Observer> device_observer_;
};
#endif
scoped_refptr<UsbDevice> UsbServiceImpl::GetDeviceById(uint32 unique_id) {
DCHECK(CalledOnValidThread());
RefreshDevices();
DeviceMap::iterator it = devices_.find(unique_id);
if (it != devices_.end()) {
return it->second;
}
return NULL;
}
void UsbServiceImpl::GetDevices(
std::vector<scoped_refptr<UsbDevice> >* devices) {
DCHECK(CalledOnValidThread());
STLClearObject(devices);
if (!hotplug_enabled_) {
RefreshDevices();
}
for (const auto& map_entry : devices_) {
devices->push_back(map_entry.second);
}
}
void UsbServiceImpl::WillDestroyCurrentMessageLoop() {
DCHECK(CalledOnValidThread());
g_usb_service_instance.Get().reset(NULL);
}
UsbServiceImpl::UsbServiceImpl(
PlatformUsbContext context,
scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner)
: context_(new UsbContext(context)),
ui_task_runner_(ui_task_runner),
next_unique_id_(0),
hotplug_enabled_(false),
weak_factory_(this) {
base::MessageLoop::current()->AddDestructionObserver(this);
task_runner_ = base::ThreadTaskRunnerHandle::Get();
int rv = libusb_hotplug_register_callback(
context_->context(),
static_cast<libusb_hotplug_event>(LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED |
LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT),
LIBUSB_HOTPLUG_ENUMERATE, LIBUSB_HOTPLUG_MATCH_ANY,
LIBUSB_HOTPLUG_MATCH_ANY, LIBUSB_HOTPLUG_MATCH_ANY,
&UsbServiceImpl::HotplugCallback, this, &hotplug_handle_);
if (rv == LIBUSB_SUCCESS) {
hotplug_enabled_ = true;
} else {
#if defined(OS_WIN)
ui_thread_helper_ = new UIThreadHelper(weak_factory_.GetWeakPtr());
ui_task_runner_->PostTask(FROM_HERE,
base::Bind(&UIThreadHelper::Start,
base::Unretained(ui_thread_helper_)));
#endif // OS_WIN
}
}
UsbServiceImpl::~UsbServiceImpl() {
base::MessageLoop::current()->RemoveDestructionObserver(this);
if (hotplug_enabled_) {
libusb_hotplug_deregister_callback(context_->context(), hotplug_handle_);
}
#if defined(OS_WIN)
if (ui_thread_helper_) {
ui_task_runner_->DeleteSoon(FROM_HERE, ui_thread_helper_);
}
#endif // OS_WIN
for (const auto& map_entry : devices_) {
map_entry.second->OnDisconnect();
}
}
void UsbServiceImpl::RefreshDevices() {
DCHECK(CalledOnValidThread());
libusb_device** platform_devices = NULL;
const ssize_t device_count =
libusb_get_device_list(context_->context(), &platform_devices);
if (device_count < 0) {
VLOG(1) << "Failed to get device list: "
<< ConvertPlatformUsbErrorToString(device_count);
}
std::set<UsbDevice*> connected_devices;
std::vector<PlatformUsbDevice> disconnected_devices;
// Populates new devices.
for (ssize_t i = 0; i < device_count; ++i) {
if (!ContainsKey(platform_devices_, platform_devices[i])) {
scoped_refptr<UsbDeviceImpl> new_device = AddDevice(platform_devices[i]);
if (new_device) {
connected_devices.insert(new_device.get());
}
} else {
connected_devices.insert(platform_devices_[platform_devices[i]].get());
}
}
// Find disconnected devices.
for (const auto& map_entry : platform_devices_) {
PlatformUsbDevice platform_device = map_entry.first;
scoped_refptr<UsbDeviceImpl> device = map_entry.second;
if (!ContainsKey(connected_devices, device.get())) {
disconnected_devices.push_back(platform_device);
devices_.erase(device->unique_id());
NotifyDeviceRemoved(device);
device->OnDisconnect();
}
}
// Remove disconnected devices from platform_devices_.
for (const PlatformUsbDevice& platform_device : disconnected_devices) {
// UsbDevice will be destroyed after this. The corresponding
// PlatformUsbDevice will be unref'ed during this process.
platform_devices_.erase(platform_device);
}
libusb_free_device_list(platform_devices, true);
}
scoped_refptr<UsbDeviceImpl> UsbServiceImpl::AddDevice(
PlatformUsbDevice platform_device) {
libusb_device_descriptor descriptor;
int rv = libusb_get_device_descriptor(platform_device, &descriptor);
if (rv == LIBUSB_SUCCESS) {
uint32 unique_id;
do {
unique_id = ++next_unique_id_;
} while (devices_.find(unique_id) != devices_.end());
scoped_refptr<UsbDeviceImpl> new_device(new UsbDeviceImpl(
context_, ui_task_runner_, platform_device, descriptor.idVendor,
descriptor.idProduct, unique_id));
platform_devices_[platform_device] = new_device;
devices_[unique_id] = new_device;
NotifyDeviceAdded(new_device);
return new_device;
} else {
VLOG(1) << "Failed to get device descriptor: "
<< ConvertPlatformUsbErrorToString(rv);
return nullptr;
}
}
// static
int LIBUSB_CALL UsbServiceImpl::HotplugCallback(libusb_context* context,
PlatformUsbDevice device,
libusb_hotplug_event event,
void* user_data) {
// It is safe to access the UsbServiceImpl* here because libusb takes a lock
// around registering, deregistering and calling hotplug callback functions
// and so guarantees that this function will not be called by the event
// processing thread after it has been deregistered.
UsbServiceImpl* self = reinterpret_cast<UsbServiceImpl*>(user_data);
switch (event) {
case LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED:
libusb_ref_device(device); // Released in OnDeviceAdded.
if (self->task_runner_->BelongsToCurrentThread()) {
self->OnDeviceAdded(device);
} else {
self->task_runner_->PostTask(
FROM_HERE, base::Bind(&UsbServiceImpl::OnDeviceAdded,
base::Unretained(self), device));
}
break;
case LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT:
libusb_ref_device(device); // Released in OnDeviceRemoved.
if (self->task_runner_->BelongsToCurrentThread()) {
self->OnDeviceRemoved(device);
} else {
self->task_runner_->PostTask(
FROM_HERE, base::Bind(&UsbServiceImpl::OnDeviceRemoved,
base::Unretained(self), device));
}
break;
default:
NOTREACHED();
}
return 0;
}
void UsbServiceImpl::OnDeviceAdded(PlatformUsbDevice platform_device) {
DCHECK(CalledOnValidThread());
DCHECK(!ContainsKey(platform_devices_, platform_device));
AddDevice(platform_device);
libusb_unref_device(platform_device);
}
void UsbServiceImpl::OnDeviceRemoved(PlatformUsbDevice platform_device) {
DCHECK(CalledOnValidThread());
PlatformDeviceMap::iterator it = platform_devices_.find(platform_device);
if (it != platform_devices_.end()) {
scoped_refptr<UsbDeviceImpl> device = it->second;
DeviceMap::iterator dev_it = devices_.find(device->unique_id());
if (dev_it != devices_.end()) {
devices_.erase(dev_it);
} else {
NOTREACHED();
}
platform_devices_.erase(it);
NotifyDeviceRemoved(device);
device->OnDisconnect();
} else {
NOTREACHED();
}
libusb_unref_device(platform_device);
}
void UsbService::Observer::OnDeviceAdded(scoped_refptr<UsbDevice> device) {
}
void UsbService::Observer::OnDeviceRemoved(scoped_refptr<UsbDevice> device) {
}
// static
UsbService* UsbService::GetInstance(
scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner) {
UsbService* instance = g_usb_service_instance.Get().get();
if (!instance) {
PlatformUsbContext context = NULL;
const int rv = libusb_init(&context);
if (rv != LIBUSB_SUCCESS) {
VLOG(1) << "Failed to initialize libusb: "
<< ConvertPlatformUsbErrorToString(rv);
return NULL;
}
if (!context)
return NULL;
instance = new UsbServiceImpl(context, ui_task_runner);
g_usb_service_instance.Get().reset(instance);
}
return instance;
}
// static
void UsbService::SetInstanceForTest(UsbService* instance) {
g_usb_service_instance.Get().reset(instance);
}
UsbService::UsbService() {
}
UsbService::~UsbService() {
}
void UsbService::AddObserver(Observer* observer) {
DCHECK(CalledOnValidThread());
observer_list_.AddObserver(observer);
}
void UsbService::RemoveObserver(Observer* observer) {
DCHECK(CalledOnValidThread());
observer_list_.RemoveObserver(observer);
}
void UsbService::NotifyDeviceAdded(scoped_refptr<UsbDevice> device) {
DCHECK(CalledOnValidThread());
FOR_EACH_OBSERVER(Observer, observer_list_, OnDeviceAdded(device));
}
void UsbService::NotifyDeviceRemoved(scoped_refptr<UsbDevice> device) {
DCHECK(CalledOnValidThread());
FOR_EACH_OBSERVER(Observer, observer_list_, OnDeviceRemoved(device));
}
} // namespace device
| 32.557416 | 80 | 0.718936 | kjthegod |
5b5ab5562b01dcd69905548ea74ec37568c4e7cf | 1,005 | cpp | C++ | acmp.ru/0691/691.cpp | mstrechen/cp | ffac439840a71f70580a0ef197e47479e167a0eb | [
"MIT"
] | null | null | null | acmp.ru/0691/691.cpp | mstrechen/cp | ffac439840a71f70580a0ef197e47479e167a0eb | [
"MIT"
] | null | null | null | acmp.ru/0691/691.cpp | mstrechen/cp | ffac439840a71f70580a0ef197e47479e167a0eb | [
"MIT"
] | null | null | null | #include <iostream>
#include <set>
#include <string>
using namespace std;
char goodChars[12] = {'A', 'B', 'C', 'E', 'H', 'K', 'M', 'O', 'P', 'T', 'X', 'Y'};
char goodNumbers[10] = {'0','1','2','3','4','5','6','7','8','9'};
set<char> setOfChars(goodChars, goodChars+12);
set<char> setOfNums(goodNumbers, goodNumbers+10);
int answers[50];
int main(){
ios::sync_with_stdio(false);
int n;
bool allOk;
string stringToParse;
cin >> n;
getline(cin,stringToParse);
for(int i =0; i<n; i++)
{
getline(cin,stringToParse);
allOk = stringToParse.length() == 6;
if(allOk){
allOk*=setOfChars.count(stringToParse[0]);
allOk*=setOfChars.count(stringToParse[4]);
allOk*=setOfChars.count(stringToParse[5]);
allOk*=setOfNums.count(stringToParse[1]);
allOk*=setOfNums.count(stringToParse[2]);
allOk*=setOfNums.count(stringToParse[3]);
}
answers[i] = allOk;
}
for(int i = 0; i<n;i++)
if(answers[i]) cout << "Yes\n";
else cout << "No\n";
return 0;
} | 27.916667 | 83 | 0.610945 | mstrechen |
5b5f5435b492c3a5da001a943fa4102f9f138e54 | 784 | cpp | C++ | Week02-Sorting/291A.cpp | AAlab1819/Andrew-00000019529 | 7f1fc9dd3a217ca23b119438ee0366af08918c76 | [
"MIT"
] | null | null | null | Week02-Sorting/291A.cpp | AAlab1819/Andrew-00000019529 | 7f1fc9dd3a217ca23b119438ee0366af08918c76 | [
"MIT"
] | null | null | null | Week02-Sorting/291A.cpp | AAlab1819/Andrew-00000019529 | 7f1fc9dd3a217ca23b119438ee0366af08918c76 | [
"MIT"
] | null | null | null | #include<iostream>
using namespace std;
void shellSort(int arr[], int n)
{
for (int gap = n/2; gap > 0; gap /= 2)
{
for (int i = gap; i < n; i += 1)
{
int temp = arr[i];
int j;
for (j = i; j >= gap && arr[j - gap] > temp; j -= gap)
arr[j] = arr[j - gap];
arr[j] = temp;
}
}
}
int main(){
int n,counter=0;
cin>>n;
int id[n];
for(int i=0;i<n;i++)
cin>>id[i];
shellSort(id,n);
if(n!=1)
for(int i=0;i<n;i++){
if(id[i]!=0){
if(id[i]==id[i+1]&&id[i]==id[i+2]){
counter=-1;
break;
}
else if(id[i]==id[i+1]){
counter++;
i++;
}
}
}
cout<<counter;
return 0;
}
| 15.68 | 67 | 0.373724 | AAlab1819 |
5b5fa1086a789e5a089b07233585014982484c16 | 5,098 | hpp | C++ | viennacl/ocl/device_utils.hpp | yuchengs/viennacl-dev | 99f250fdb729de01ff5e9aebbed7b2ed3b1d8dfa | [
"MIT"
] | 224 | 2015-02-15T21:50:13.000Z | 2022-01-14T18:27:03.000Z | viennacl/ocl/device_utils.hpp | yuchengs/viennacl-dev | 99f250fdb729de01ff5e9aebbed7b2ed3b1d8dfa | [
"MIT"
] | 189 | 2015-01-09T17:08:04.000Z | 2021-06-04T06:23:22.000Z | viennacl/ocl/device_utils.hpp | yuchengs/viennacl-dev | 99f250fdb729de01ff5e9aebbed7b2ed3b1d8dfa | [
"MIT"
] | 84 | 2015-01-15T14:06:13.000Z | 2022-01-23T14:51:17.000Z | #ifndef VIENNACL_OCL_DEVICE_UTILS_HPP_
#define VIENNACL_OCL_DEVICE_UTILS_HPP_
/* =========================================================================
Copyright (c) 2010-2016, Institute for Microelectronics,
Institute for Analysis and Scientific Computing,
TU Wien.
Portions of this software are copyright by UChicago Argonne, LLC.
-----------------
ViennaCL - The Vienna Computing Library
-----------------
Project Head: Karl Rupp rupp@iue.tuwien.ac.at
(A list of authors and contributors can be found in the manual)
License: MIT (X11), see file LICENSE in the base directory
============================================================================= */
/** @file viennacl/ocl/device_utils.hpp
@brief Various utility implementations for dispatching with respect to the different devices available on the market.
*/
#define VIENNACL_OCL_MAX_DEVICE_NUM 8
#define CL_USE_DEPRECATED_OPENCL_1_2_APIS
#ifdef __APPLE__
#include <OpenCL/cl.h>
#else
#include <CL/cl.h>
#endif
#include <stddef.h>
#include <map>
#include <string>
#include "viennacl/forwards.h"
namespace viennacl
{
namespace ocl
{
enum vendor_id
{
beignet_id = 358,
intel_id = 32902,
nvidia_id = 4318,
amd_id = 4098,
unknown_id = 0
};
//Architecture Family
enum device_architecture_family
{
//NVidia
tesla = 0,
fermi,
kepler,
maxwell,
//AMD
evergreen,
northern_islands,
southern_islands,
volcanic_islands,
unknown
};
inline device_architecture_family get_architecture_family(cl_uint vendor_id, std::string const & name)
{
/*-NVidia-*/
if (vendor_id==nvidia_id)
{
//GeForce
vcl_size_t found=0;
if ((found= name.find("GeForce",0)) != std::string::npos)
{
if ((found = name.find_first_of("123456789", found)) != std::string::npos)
{
switch (name[found])
{
case '2' : return tesla;
case '3' : return tesla;
case '4' : return fermi;
case '5' : return fermi;
case '6' : return kepler;
case '7' : if (name[found+1] == '5')
return maxwell; // GeForce 750 (Ti) are Maxwell-based on desktop GPUs.
return kepler;
case '8' : if (name[found+3] == '0') // Geforce 8600 and friends
return tesla;
return kepler; // high-end mobile GPUs tend to be Kepler, low-end GPUs are Maxwell. What a mess. Better be conservative here and pick Kepler.
case '9' : if (name[found+3] == '0') // Geforce 9600 and friends
return tesla;
return maxwell; // GeForce 980, etc.
default: return unknown;
}
}
else
return unknown;
}
//Tesla
else if ((found = name.find("Tesla",0)) != std::string::npos)
{
if ((found = name.find_first_of("CMK", found)) != std::string::npos)
{
switch (name[found])
{
case 'C' : return fermi;
case 'M' : return fermi;
case 'K' : return kepler;
default : return unknown;
}
}
else
return unknown;
}
else
return unknown;
}
/*-AMD-*/
else if (vendor_id==amd_id)
{
#define VIENNACL_DEVICE_MAP(device,arch)if (name.find(device,0)!=std::string::npos) return arch;
//Evergreen
VIENNACL_DEVICE_MAP("Cedar",evergreen);
VIENNACL_DEVICE_MAP("Redwood",evergreen);
VIENNACL_DEVICE_MAP("Juniper",evergreen);
VIENNACL_DEVICE_MAP("Cypress",evergreen);
VIENNACL_DEVICE_MAP("Hemlock",evergreen);
//NorthernIslands
VIENNACL_DEVICE_MAP("Caicos",northern_islands);
VIENNACL_DEVICE_MAP("Turks",northern_islands);
VIENNACL_DEVICE_MAP("Barts",northern_islands);
VIENNACL_DEVICE_MAP("Cayman",northern_islands);
VIENNACL_DEVICE_MAP("Antilles",northern_islands);
//SouthernIslands
VIENNACL_DEVICE_MAP("Cape",southern_islands);
VIENNACL_DEVICE_MAP("Bonaire",southern_islands);
VIENNACL_DEVICE_MAP("Pitcairn",southern_islands);
VIENNACL_DEVICE_MAP("Curacao",southern_islands);
VIENNACL_DEVICE_MAP("Tahiti",southern_islands);
VIENNACL_DEVICE_MAP("Malta",southern_islands);
VIENNACL_DEVICE_MAP("Trinidad",southern_islands);
VIENNACL_DEVICE_MAP("Tobago",southern_islands);
VIENNACL_DEVICE_MAP("Oland",southern_islands);
//VolcanicIslands
VIENNACL_DEVICE_MAP("Hawaii",volcanic_islands);
VIENNACL_DEVICE_MAP("Vesuvius",volcanic_islands);
VIENNACL_DEVICE_MAP("Tonga",volcanic_islands);
VIENNACL_DEVICE_MAP("Antigua",volcanic_islands);
VIENNACL_DEVICE_MAP("Grenada",volcanic_islands);
VIENNACL_DEVICE_MAP("Fiji",volcanic_islands);
//APUs (map to closest hardware architecture)
VIENNACL_DEVICE_MAP("Scrapper",northern_islands);
VIENNACL_DEVICE_MAP("Devastator",northern_islands);
#undef VIENNACL_DEVICE_MAP
return unknown;
}
/*-Other-*/
else
return unknown;
}
}
} //namespace viennacl
#endif
| 26.414508 | 161 | 0.624166 | yuchengs |
5b6157f723c18eed98ad8e405446ae2b433f388a | 868 | cpp | C++ | .LHP/.Lop10/.O.L.P/.T.Vinh/OL3/DAUXE/DAUXE/DAUXE.cpp | sxweetlollipop2912/MaCode | 661d77a2096e4d772fda2b6a7f80c84113b2cde9 | [
"MIT"
] | null | null | null | .LHP/.Lop10/.O.L.P/.T.Vinh/OL3/DAUXE/DAUXE/DAUXE.cpp | sxweetlollipop2912/MaCode | 661d77a2096e4d772fda2b6a7f80c84113b2cde9 | [
"MIT"
] | null | null | null | .LHP/.Lop10/.O.L.P/.T.Vinh/OL3/DAUXE/DAUXE/DAUXE.cpp | sxweetlollipop2912/MaCode | 661d77a2096e4d772fda2b6a7f80c84113b2cde9 | [
"MIT"
] | null | null | null | #include "pch.h"
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#pragma warning(disable:4996)
#define maxN 101
#define maxL 121
#define empty '.'
#define block 'X'
typedef int maxn, maxl;
maxn n, L;
std::vector <maxl> a;
void Add(maxl &x) {
x = x - L + 1;
while (x > 0) {
a.push_back(std::min((maxl)L, x));
//std::cout << std::min(L, x) << '\n';
x -= (maxl)L;
}
x = 0;
}
void Prepare() {
std::cin >> n >> L;
char c;
maxl x = 0;
while (std::cin >> c) {
if (c == empty) x++;
if (c == block) Add(x);
}
Add(x);
}
void Process() {
std::sort(a.begin(), a.end());
maxl res = 0;
for (maxl i = 0; i < std::max((maxl)0, (maxl)a.size() - (maxl)n); i++)
res += a[i];
std::cout << res << '\n' << std::min((maxl)a.size(), (maxl)n);
}
int main() {
freopen("dauxe.inp", "r", stdin);
Prepare();
Process();
} | 14 | 72 | 0.535714 | sxweetlollipop2912 |
5b617b02df27c604edcbef53d1e78a5e445ff04b | 1,546 | cpp | C++ | new folder/55.cpp | bprithiraj/DSA-CPsolvedproblemscode | 4b3765e4afb26016fade1f1e526b36934583c668 | [
"Apache-2.0"
] | null | null | null | new folder/55.cpp | bprithiraj/DSA-CPsolvedproblemscode | 4b3765e4afb26016fade1f1e526b36934583c668 | [
"Apache-2.0"
] | null | null | null | new folder/55.cpp | bprithiraj/DSA-CPsolvedproblemscode | 4b3765e4afb26016fade1f1e526b36934583c668 | [
"Apache-2.0"
] | null | null | null | #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <bitset>
using namespace std;
#define ll long long int
#define MP make_pair
#define PB push_back
long long int testcase()
{
long long int arr[3][3];
for(int i=0;i<3;i++)
{
for(int j=0;j<3;j++)
{
if(i==1 && j==1)
continue;
cin>>arr[i][j];
}
}
map<ll,ll> m;
long double k=(arr[0][0]+arr[2][2])/2.0;
if(ceil(k)==floor(k))
m[k]++;
k=(arr[0][1]+arr[2][1])/2.0;
if(ceil(k)==floor(k))
m[k]++;
k=(arr[0][2]+arr[2][0])/2.0;
if(ceil(k)==floor(k))
m[k]++;
k=(arr[1][0]+arr[1][2])/2.0;
if(ceil(k)==floor(k))
m[k]++;
long long int a=0;
for(auto i:m)
{
a=max(a,i.second);
}
for(int i=0;i<3;i++)
{
if(arr[i][0]-arr[i][1]==arr[i][1]-arr[i][2])
a++;
}
for(int i=0;i<3;i++)
{
if(arr[0][i]-arr[1][i]==arr[1][i]-arr[2][i])
a++;
}
return a;
}
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
long long int t;
cin>>t;
for(int i=1;i<=t;i++)
{
long long int ans=testcase();
cout<<"Case #"<<i<<": "<<ans;
cout<<"\n";
}
} | 13.327586 | 52 | 0.487063 | bprithiraj |
5b6417ea47699d0e216ee0f95a98b07f34c5e405 | 22,749 | cc | C++ | lib/kahypar/tests/partition/refinement/two_way_fm_refiner_test.cc | Ace-Ma/LSOracle | 6e940906303ef6c2c6b96352f44206567fdd50d3 | [
"MIT"
] | null | null | null | lib/kahypar/tests/partition/refinement/two_way_fm_refiner_test.cc | Ace-Ma/LSOracle | 6e940906303ef6c2c6b96352f44206567fdd50d3 | [
"MIT"
] | null | null | null | lib/kahypar/tests/partition/refinement/two_way_fm_refiner_test.cc | Ace-Ma/LSOracle | 6e940906303ef6c2c6b96352f44206567fdd50d3 | [
"MIT"
] | null | null | null | /*******************************************************************************
* This file is part of KaHyPar.
*
* Copyright (C) 2014 Sebastian Schlag <sebastian.schlag@kit.edu>
*
* KaHyPar 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.
*
* KaHyPar 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 KaHyPar. If not, see <http://www.gnu.org/licenses/>.
*
******************************************************************************/
#include "gmock/gmock.h"
#include "kahypar/definitions.h"
#include "kahypar/meta/registrar.h"
#include "kahypar/partition/metrics.h"
#include "kahypar/partition/refinement/2way_fm_refiner.h"
#include "kahypar/partition/refinement/do_nothing_refiner.h"
#include "kahypar/partition/refinement/policies/fm_stop_policy.h"
using ::testing::Test;
using ::testing::Eq;
namespace kahypar {
#define REGISTER_REFINER(id, refiner) \
static meta::Registrar<RefinerFactory> register_ ## refiner( \
id, \
[](Hypergraph& hypergraph, const Context& context) -> IRefiner* { \
return new refiner(hypergraph, context); \
})
REGISTER_REFINER(RefinementAlgorithm::do_nothing, DoNothingRefiner);
using TwoWayFMRefinerSimpleStopping = TwoWayFMRefiner<NumberOfFruitlessMovesStopsSearch>;
class ATwoWayFMRefiner : public Test {
public:
ATwoWayFMRefiner() :
hypergraph(new Hypergraph(7, 4, HyperedgeIndexVector { 0, 2, 6, 9, /*sentinel*/ 12 },
HyperedgeVector { 0, 2, 0, 1, 3, 4, 3, 4, 6, 2, 5, 6 })),
context(),
refiner(nullptr),
changes() {
hypergraph->setNodePart(0, 0);
hypergraph->setNodePart(1, 1);
hypergraph->setNodePart(2, 1);
hypergraph->setNodePart(3, 0);
hypergraph->setNodePart(4, 0);
hypergraph->setNodePart(5, 1);
hypergraph->setNodePart(6, 1);
hypergraph->initializeNumCutHyperedges();
context.partition.epsilon = 0.15;
context.partition.k = 2;
context.partition.objective = Objective::cut;
context.partition.perfect_balance_part_weights.push_back(ceil(hypergraph->totalWeight() /
static_cast<double>(context.partition.k)));
context.partition.perfect_balance_part_weights.push_back(ceil(hypergraph->totalWeight() /
static_cast<double>(context.partition.k)));
context.partition.max_part_weights.push_back((1 + context.partition.epsilon)
* context.partition.perfect_balance_part_weights[0]);
context.partition.max_part_weights.push_back(context.partition.max_part_weights[0]);
context.local_search.fm.max_number_of_fruitless_moves = 50;
refiner = std::make_unique<TwoWayFMRefinerSimpleStopping>(*hypergraph, context);
changes.representative.push_back(0);
changes.contraction_partner.push_back(0);
}
std::unique_ptr<Hypergraph> hypergraph;
Context context;
std::unique_ptr<TwoWayFMRefinerSimpleStopping> refiner;
UncontractionGainChanges changes;
};
class AGainUpdateMethod : public Test {
public:
AGainUpdateMethod() :
context() {
context.partition.k = 2;
context.partition.objective = Objective::cut;
context.local_search.fm.max_number_of_fruitless_moves = 50;
}
Context context;
};
using ATwoWayFMRefinerDeathTest = ATwoWayFMRefiner;
TEST_F(ATwoWayFMRefiner, ComputesGainOfHypernodeMovement) {
refiner->initialize(100);
ASSERT_THAT(refiner->computeGain(6), Eq(0));
ASSERT_THAT(refiner->computeGain(1), Eq(1));
ASSERT_THAT(refiner->computeGain(5), Eq(-1));
}
TEST_F(ATwoWayFMRefiner, ActivatesBorderNodes) {
refiner->initialize(100);
refiner->activate(1, /* dummy max-part-weight */ { 42, 42 });
HypernodeID hn;
HyperedgeWeight gain;
PartitionID to_part;
refiner->_pq.deleteMax(hn, gain, to_part);
ASSERT_THAT(hn, Eq(1));
ASSERT_THAT(gain, Eq(1));
}
TEST_F(ATwoWayFMRefiner, CalculatesNodeCountsInBothPartitions) {
refiner->initialize(100);
ASSERT_THAT(refiner->_hg.partWeight(0), Eq(3));
ASSERT_THAT(refiner->_hg.partWeight(1), Eq(4));
}
TEST_F(ATwoWayFMRefiner, DoesNotViolateTheBalanceConstraint) {
Metrics old_metrics = { metrics::hyperedgeCut(*hypergraph),
metrics::km1(*hypergraph),
metrics::imbalance(*hypergraph, context) };
std::vector<HypernodeID> refinement_nodes = { 1, 6 };
refiner->initialize(100);
refiner->refine(refinement_nodes, { 42, 42 }, changes, old_metrics);
EXPECT_PRED_FORMAT2(::testing::DoubleLE, metrics::imbalance(*hypergraph, context),
old_metrics.imbalance);
}
TEST_F(ATwoWayFMRefiner, UpdatesNodeCountsOnNodeMovements) {
ASSERT_THAT(refiner->_hg.partWeight(0), Eq(3));
ASSERT_THAT(refiner->_hg.partWeight(1), Eq(4));
refiner->initialize(100);
refiner->moveHypernode(1, 1, 0);
ASSERT_THAT(refiner->_hg.partWeight(0), Eq(4));
ASSERT_THAT(refiner->_hg.partWeight(1), Eq(3));
}
TEST_F(ATwoWayFMRefiner, UpdatesPartitionWeightsOnRollBack) {
ASSERT_THAT(refiner->_hg.partWeight(0), Eq(3));
ASSERT_THAT(refiner->_hg.partWeight(1), Eq(4));
Metrics old_metrics = { metrics::hyperedgeCut(*hypergraph),
metrics::km1(*hypergraph),
metrics::imbalance(*hypergraph, context) };
std::vector<HypernodeID> refinement_nodes = { 1, 6 };
refiner->initialize(100);
refiner->refine(refinement_nodes, { 42, 42 }, changes, old_metrics);
ASSERT_THAT(refiner->_hg.partWeight(0), Eq(4));
ASSERT_THAT(refiner->_hg.partWeight(1), Eq(3));
}
TEST_F(ATwoWayFMRefiner, PerformsCompleteRollBackIfNoImprovementCouldBeFound) {
refiner.reset(new TwoWayFMRefinerSimpleStopping(*hypergraph, context));
hypergraph->changeNodePart(1, 1, 0);
ASSERT_THAT(hypergraph->partID(6), Eq(1));
ASSERT_THAT(hypergraph->partID(2), Eq(1));
refiner->initialize(100);
Metrics old_metrics = { metrics::hyperedgeCut(*hypergraph),
metrics::km1(*hypergraph),
metrics::imbalance(*hypergraph, context) };
std::vector<HypernodeID> refinement_nodes = { 1, 6 };
refiner->refine(refinement_nodes, { 42, 42 }, changes, old_metrics);
ASSERT_THAT(hypergraph->partID(6), Eq(1));
ASSERT_THAT(hypergraph->partID(2), Eq(1));
}
TEST_F(ATwoWayFMRefiner, RollsBackAllNodeMovementsIfCutCouldNotBeImproved) {
Metrics old_metrics = { metrics::hyperedgeCut(*hypergraph),
metrics::km1(*hypergraph),
metrics::imbalance(*hypergraph, context) };
std::vector<HypernodeID> refinement_nodes = { 1, 6 };
refiner->initialize(100);
refiner->refine(refinement_nodes, { 42, 42 }, changes, old_metrics);
ASSERT_THAT(old_metrics.cut, Eq(metrics::hyperedgeCut(*hypergraph)));
ASSERT_THAT(hypergraph->partID(1), Eq(0));
ASSERT_THAT(hypergraph->partID(5), Eq(1));
}
// Ugly: We could seriously need Mocks here!
TEST_F(AGainUpdateMethod, RespectsPositiveGainUpdateSpecialCaseForHyperedgesOfSize2) {
Hypergraph hypergraph(2, 1, HyperedgeIndexVector { 0, 2 }, HyperedgeVector { 0, 1 });
hypergraph.setNodePart(0, 0);
hypergraph.setNodePart(1, 0);
hypergraph.initializeNumCutHyperedges();
TwoWayFMRefinerSimpleStopping refiner(hypergraph, context);
refiner.initialize(100);
// bypassing activate since neither 0 nor 1 is actually a border node
refiner._hg.activate(0);
refiner._hg.activate(1);
refiner._gain_cache.setValue(0, refiner.computeGain(0));
refiner._gain_cache.setValue(1, refiner.computeGain(1));
refiner._pq.insert(0, 1, refiner._gain_cache.value(0));
refiner._pq.insert(1, 1, refiner._gain_cache.value(0));
refiner._pq.enablePart(1);
ASSERT_THAT(refiner._pq.key(0, 1), Eq(-1));
ASSERT_THAT(refiner._pq.key(1, 1), Eq(-1));
hypergraph.changeNodePart(1, 0, 1);
refiner._hg.mark(1);
refiner.updateNeighbours(1, 0, 1, /* dummy max-part-weight */ { 42, 42 });
ASSERT_THAT(refiner._pq.key(0, 1), Eq(1));
// updateNeighbours does not delete the current max_gain node, neither does it update its gain
ASSERT_THAT(refiner._pq.key(1, 1), Eq(-1));
}
TEST_F(AGainUpdateMethod, RespectsNegativeGainUpdateSpecialCaseForHyperedgesOfSize2) {
Hypergraph hypergraph(3, 2, HyperedgeIndexVector { 0, 2, 4 }, HyperedgeVector { 0, 1, 0, 2 });
hypergraph.setNodePart(0, 0);
hypergraph.setNodePart(1, 1);
hypergraph.setNodePart(2, 1);
hypergraph.initializeNumCutHyperedges();
TwoWayFMRefinerSimpleStopping refiner(hypergraph, context);
refiner.initialize(100);
refiner.activate(0, /* dummy max-part-weight */ { 42, 42 });
refiner.activate(1, /* dummy max-part-weight */ { 42, 42 });
ASSERT_THAT(refiner._pq.key(0, 1), Eq(2));
ASSERT_THAT(refiner._pq.key(1, 0), Eq(1));
refiner._pq.enablePart(0);
refiner._pq.enablePart(1);
hypergraph.changeNodePart(1, 1, 0);
refiner._hg.mark(1);
refiner.updateNeighbours(1, 1, 0, /* dummy max-part-weight */ { 42, 42 });
ASSERT_THAT(refiner._pq.key(0, 1), Eq(0));
}
TEST_F(AGainUpdateMethod, HandlesCase0To1) {
Hypergraph hypergraph(4, 1, HyperedgeIndexVector { 0, 4 }, HyperedgeVector { 0, 1, 2, 3 });
hypergraph.setNodePart(0, 0);
hypergraph.setNodePart(1, 0);
hypergraph.setNodePart(2, 0);
hypergraph.setNodePart(3, 0);
hypergraph.initializeNumCutHyperedges();
TwoWayFMRefinerSimpleStopping refiner(hypergraph, context);
refiner.initialize(100);
// bypassing activate since neither 0 nor 1 is actually a border node
refiner._hg.activate(0);
refiner._hg.activate(1);
refiner._hg.activate(2);
refiner._hg.activate(3);
refiner._gain_cache.setValue(0, refiner.computeGain(0));
refiner._gain_cache.setValue(1, refiner.computeGain(1));
refiner._gain_cache.setValue(2, refiner.computeGain(2));
refiner._gain_cache.setValue(3, refiner.computeGain(3));
refiner._pq.insert(0, 1, refiner._gain_cache.value(0));
refiner._pq.insert(1, 1, refiner._gain_cache.value(1));
refiner._pq.insert(2, 1, refiner._gain_cache.value(2));
refiner._pq.insert(3, 1, refiner._gain_cache.value(3));
refiner._pq.enablePart(1);
ASSERT_THAT(refiner._pq.key(0, 1), Eq(-1));
ASSERT_THAT(refiner._pq.key(1, 1), Eq(-1));
ASSERT_THAT(refiner._pq.key(2, 1), Eq(-1));
ASSERT_THAT(refiner._pq.key(3, 1), Eq(-1));
hypergraph.changeNodePart(3, 0, 1);
refiner._hg.mark(3);
refiner.updateNeighbours(3, 0, 1, /* dummy max-part-weight */ { 42, 42 });
ASSERT_THAT(refiner._pq.key(0, 1), Eq(0));
ASSERT_THAT(refiner._pq.key(1, 1), Eq(0));
ASSERT_THAT(refiner._pq.key(2, 1), Eq(0));
}
TEST_F(AGainUpdateMethod, HandlesCase1To0) {
Hypergraph hypergraph(5, 2, HyperedgeIndexVector { 0, 4, 8 }, HyperedgeVector { 0, 1, 2, 3, 0, 1, 2, 4 });
hypergraph.setNodePart(0, 0);
hypergraph.setNodePart(1, 0);
hypergraph.setNodePart(2, 0);
hypergraph.setNodePart(3, 1);
hypergraph.setNodePart(4, 1);
hypergraph.initializeNumCutHyperedges();
TwoWayFMRefinerSimpleStopping refiner(hypergraph, context);
refiner.initialize(100);
// bypassing activate since neither 0 nor 1 is actually a border node
refiner._gain_cache.setValue(0, refiner.computeGain(0));
refiner._gain_cache.setValue(1, refiner.computeGain(1));
refiner._gain_cache.setValue(2, refiner.computeGain(2));
refiner._gain_cache.setValue(3, refiner.computeGain(3));
refiner._gain_cache.setValue(4, refiner.computeGain(4));
refiner.activate(0, /* dummy max-part-weight */ { 42, 42 });
refiner.activate(1, /* dummy max-part-weight */ { 42, 42 });
refiner.activate(2, /* dummy max-part-weight */ { 42, 42 });
refiner.activate(3, /* dummy max-part-weight */ { 42, 42 });
refiner.activate(4, /* dummy max-part-weight */ { 42, 42 });
ASSERT_THAT(refiner._pq.key(0, 1), Eq(0));
ASSERT_THAT(refiner._pq.key(1, 1), Eq(0));
ASSERT_THAT(refiner._pq.key(2, 1), Eq(0));
ASSERT_THAT(refiner._pq.key(3, 0), Eq(1));
hypergraph.changeNodePart(3, 1, 0);
refiner._hg.mark(3);
refiner.updateNeighbours(3, 1, 0, /* dummy max-part-weight */ { 42, 42 });
ASSERT_THAT(refiner._pq.key(0, 1), Eq(-1));
ASSERT_THAT(refiner._pq.key(1, 1), Eq(-1));
ASSERT_THAT(refiner._pq.key(2, 1), Eq(-1));
}
TEST_F(AGainUpdateMethod, HandlesCase2To1) {
Hypergraph hypergraph(4, 1, HyperedgeIndexVector { 0, 4 }, HyperedgeVector { 0, 1, 2, 3 });
hypergraph.setNodePart(0, 0);
hypergraph.setNodePart(1, 0);
hypergraph.setNodePart(2, 1);
hypergraph.setNodePart(3, 1);
hypergraph.initializeNumCutHyperedges();
TwoWayFMRefinerSimpleStopping refiner(hypergraph, context);
refiner.initialize(100);
refiner.activate(0, /* dummy max-part-weight */ { 42, 42 });
refiner.activate(1, /* dummy max-part-weight */ { 42, 42 });
refiner.activate(2, /* dummy max-part-weight */ { 42, 42 });
refiner.activate(3, /* dummy max-part-weight */ { 42, 42 });
ASSERT_THAT(refiner._pq.key(0, 1), Eq(0));
ASSERT_THAT(refiner._pq.key(1, 1), Eq(0));
ASSERT_THAT(refiner._pq.key(2, 0), Eq(0));
ASSERT_THAT(refiner._pq.key(3, 0), Eq(0));
hypergraph.changeNodePart(3, 1, 0);
refiner._hg.mark(3);
refiner.updateNeighbours(3, 1, 0, /* dummy max-part-weight */ { 42, 42 });
ASSERT_THAT(refiner._pq.key(0, 1), Eq(0));
ASSERT_THAT(refiner._pq.key(1, 1), Eq(0));
ASSERT_THAT(refiner._pq.key(2, 0), Eq(1));
}
TEST_F(AGainUpdateMethod, HandlesCase1To2) {
Hypergraph hypergraph(4, 1, HyperedgeIndexVector { 0, 4 }, HyperedgeVector { 0, 1, 2, 3 });
hypergraph.setNodePart(0, 0);
hypergraph.setNodePart(1, 0);
hypergraph.setNodePart(2, 0);
hypergraph.setNodePart(3, 1);
hypergraph.initializeNumCutHyperedges();
TwoWayFMRefinerSimpleStopping refiner(hypergraph, context);
refiner.initialize(100);
refiner.activate(0, /* dummy max-part-weight */ { 42, 42 });
refiner.activate(1, /* dummy max-part-weight */ { 42, 42 });
refiner.activate(2, /* dummy max-part-weight */ { 42, 42 });
refiner.activate(3, /* dummy max-part-weight */ { 42, 42 });
ASSERT_THAT(refiner._pq.key(0, 1), Eq(0));
ASSERT_THAT(refiner._pq.key(1, 1), Eq(0));
ASSERT_THAT(refiner._pq.key(2, 1), Eq(0));
ASSERT_THAT(refiner._pq.key(3, 0), Eq(1));
hypergraph.changeNodePart(2, 0, 1);
refiner._hg.mark(2);
refiner.updateNeighbours(2, 0, 1, /* dummy max-part-weight */ { 42, 42 });
ASSERT_THAT(refiner._pq.key(0, 1), Eq(0));
ASSERT_THAT(refiner._pq.key(1, 1), Eq(0));
ASSERT_THAT(refiner._pq.key(3, 0), Eq(0));
}
TEST_F(AGainUpdateMethod, HandlesSpecialCaseOfHyperedgeWith3Pins) {
Hypergraph hypergraph(3, 1, HyperedgeIndexVector { 0, 3 }, HyperedgeVector { 0, 1, 2 });
hypergraph.setNodePart(0, 0);
hypergraph.setNodePart(1, 0);
hypergraph.setNodePart(2, 1);
hypergraph.initializeNumCutHyperedges();
TwoWayFMRefinerSimpleStopping refiner(hypergraph, context);
refiner.initialize(100);
refiner.activate(0, /* dummy max-part-weight */ { 42, 42 });
refiner.activate(1, /* dummy max-part-weight */ { 42, 42 });
refiner.activate(2, /* dummy max-part-weight */ { 42, 42 });
ASSERT_THAT(refiner._pq.key(0, 1), Eq(0));
ASSERT_THAT(refiner._pq.key(1, 1), Eq(0));
ASSERT_THAT(refiner._pq.key(2, 0), Eq(1));
hypergraph.changeNodePart(1, 0, 1);
refiner._hg.mark(1);
refiner.updateNeighbours(1, 0, 1, /* dummy max-part-weight */ { 42, 42 });
ASSERT_THAT(refiner._pq.key(0, 1), Eq(1));
ASSERT_THAT(refiner._pq.key(2, 0), Eq(0));
}
TEST_F(AGainUpdateMethod, RemovesNonBorderNodesFromPQ) {
Hypergraph hypergraph(3, 1, HyperedgeIndexVector { 0, 3 }, HyperedgeVector { 0, 1, 2 });
hypergraph.setNodePart(0, 0);
hypergraph.setNodePart(1, 1);
hypergraph.setNodePart(2, 0);
hypergraph.initializeNumCutHyperedges();
TwoWayFMRefinerSimpleStopping refiner(hypergraph, context);
refiner.initialize(100);
refiner.activate(0, /* dummy max-part-weight */ { 42, 42 });
refiner.activate(1, /* dummy max-part-weight */ { 42, 42 });
ASSERT_THAT(refiner._pq.key(0, 1), Eq(0));
ASSERT_THAT(refiner._pq.key(1, 0), Eq(1));
ASSERT_THAT(refiner._pq.contains(2, 1), Eq(false));
ASSERT_THAT(refiner._pq.contains(0, 1), Eq(true));
hypergraph.changeNodePart(1, 1, 0, refiner._non_border_hns_to_remove);
refiner._hg.mark(1);
refiner.updateNeighbours(1, 1, 0, /* dummy max-part-weight */ { 42, 42 });
ASSERT_THAT(refiner._pq.key(1, 0), Eq(1));
ASSERT_THAT(refiner._pq.contains(0), Eq(false));
ASSERT_THAT(refiner._pq.contains(2), Eq(false));
}
TEST_F(AGainUpdateMethod, ActivatesUnmarkedNeighbors) {
Hypergraph hypergraph(3, 1, HyperedgeIndexVector { 0, 3 }, HyperedgeVector { 0, 1, 2 });
hypergraph.setNodePart(0, 0);
hypergraph.setNodePart(1, 0);
hypergraph.setNodePart(2, 0);
hypergraph.initializeNumCutHyperedges();
TwoWayFMRefinerSimpleStopping refiner(hypergraph, context);
refiner.initialize(100);
// bypassing activate since neither 0 nor 1 is actually a border node
refiner._gain_cache.setValue(0, refiner.computeGain(0));
refiner._gain_cache.setValue(1, refiner.computeGain(1));
refiner._pq.insert(0, 1, refiner._gain_cache.value(0));
refiner._pq.insert(1, 1, refiner._gain_cache.value(1));
refiner._hg.activate(0);
refiner._hg.activate(1);
refiner._pq.enablePart(1);
ASSERT_THAT(refiner._pq.key(0, 1), Eq(-1));
ASSERT_THAT(refiner._pq.key(1, 1), Eq(-1));
ASSERT_THAT(refiner._pq.contains(2), Eq(false));
hypergraph.changeNodePart(1, 0, 1);
refiner._hg.mark(1);
refiner.updateNeighbours(1, 0, 1, /* dummy max-part-weight */ { 42, 42 });
ASSERT_THAT(refiner._pq.key(0, 1), Eq(0));
ASSERT_THAT(refiner._pq.key(1, 1), Eq(-1));
ASSERT_THAT(refiner._pq.contains(2, 1), Eq(true));
ASSERT_THAT(refiner._pq.key(2, 1), Eq(0));
}
TEST_F(AGainUpdateMethod, DoesNotDeleteJustActivatedNodes) {
Hypergraph hypergraph(5, 3, HyperedgeIndexVector { 0, 2, 5, 8 },
HyperedgeVector { 0, 1, 2, 3, 4, 2, 3, 4 });
hypergraph.setNodePart(0, 0);
hypergraph.setNodePart(1, 0);
hypergraph.setNodePart(2, 0);
hypergraph.setNodePart(3, 1);
hypergraph.setNodePart(4, 0);
hypergraph.initializeNumCutHyperedges();
TwoWayFMRefinerSimpleStopping refiner(hypergraph, context);
refiner.initialize(100);
// bypassing activate
refiner._pq.insert(2, 1, refiner.computeGain(2));
refiner._gain_cache.setValue(2, refiner.computeGain(2));
refiner._hg.activate(2);
refiner._pq.enablePart(1);
refiner.moveHypernode(2, 0, 1);
refiner._hg.mark(2);
refiner.updateNeighbours(2, 0, 1, /* dummy max-part-weight */ { 42, 42 });
ASSERT_THAT(refiner._pq.contains(4, 1), Eq(true));
ASSERT_THAT(refiner._pq.contains(3, 0), Eq(true));
}
TEST(ARefiner, ChecksIfMovePreservesBalanceConstraint) {
Hypergraph hypergraph(4, 1, HyperedgeIndexVector { 0, 4 },
HyperedgeVector { 0, 1, 2, 3 });
hypergraph.setNodePart(0, 0);
hypergraph.setNodePart(1, 0);
hypergraph.setNodePart(2, 0);
hypergraph.setNodePart(3, 1);
hypergraph.initializeNumCutHyperedges();
Context context;
context.partition.epsilon = 0.02;
context.partition.k = 2;
context.partition.objective = Objective::cut;
// To ensure that we can call moveIsFeasable.
// This test is actcually legacy, since the current implementation does not
// use the moveIsFeasible method anymore.
context.partition.mode = Mode::direct_kway;
context.partition.perfect_balance_part_weights.push_back(ceil(hypergraph.initialNumNodes() /
static_cast<double>(context.partition.k)));
context.partition.perfect_balance_part_weights.push_back(ceil(hypergraph.initialNumNodes() /
static_cast<double>(context.partition.k)));
context.partition.max_part_weights.push_back((1 + context.partition.epsilon)
* context.partition.perfect_balance_part_weights[0]);
context.partition.max_part_weights.push_back(context.partition.max_part_weights[0]);
TwoWayFMRefinerSimpleStopping refiner(hypergraph, context);
refiner.initialize(100);
ASSERT_THAT(refiner.moveIsFeasible(1, 0, 1), Eq(true));
ASSERT_THAT(refiner.moveIsFeasible(3, 1, 0), Eq(false));
}
TEST_F(ATwoWayFMRefinerDeathTest, ConsidersSingleNodeHEsDuringInitialGainComputation) {
hypergraph.reset(new Hypergraph(2, 2, HyperedgeIndexVector { 0, 2, /*sentinel*/ 3 },
HyperedgeVector { 0, 1, 0 }, 2));
context.local_search.fm.max_number_of_fruitless_moves = 50;
context.partition.k = 2;
context.partition.rb_lower_k = 0;
context.partition.rb_upper_k = context.partition.k - 1;
context.partition.epsilon = 1.0;
context.partition.perfect_balance_part_weights.push_back(ceil(hypergraph->totalWeight() /
static_cast<double>(context.partition.k)));
context.partition.perfect_balance_part_weights.push_back(ceil(hypergraph->totalWeight() /
static_cast<double>(context.partition.k)));
context.partition.max_part_weights.push_back((1 + context.partition.epsilon)
* context.partition.perfect_balance_part_weights[0]);
context.partition.max_part_weights.push_back(context.partition.max_part_weights[0]);
hypergraph->setNodePart(0, 0);
hypergraph->setNodePart(1, 1);
hypergraph->initializeNumCutHyperedges();
refiner.reset(new TwoWayFMRefinerSimpleStopping(*hypergraph, context));
ASSERT_DEBUG_DEATH(refiner->initialize(100), ".*");
ASSERT_DEBUG_DEATH(refiner->computeGain(0), ".*");
}
TEST_F(ATwoWayFMRefiner, KnowsIfAHyperedgeIsFullyActive) {
hypergraph.reset(new Hypergraph(3, 1, HyperedgeIndexVector { 0, /*sentinel*/ 3 },
HyperedgeVector { 0, 1, 2 }, 2));
hypergraph->setNodePart(0, 0);
hypergraph->setNodePart(1, 0);
hypergraph->setNodePart(2, 0);
hypergraph->initializeNumCutHyperedges();
refiner.reset(new TwoWayFMRefinerSimpleStopping(*hypergraph, context));
refiner->initialize(100);
refiner->_hg.activate(0);
hypergraph->changeNodePart(0, 0, 1);
refiner->_hg.mark(0);
refiner->fullUpdate(0, 1, 0);
ASSERT_THAT(refiner->_he_fully_active[0], Eq(true));
}
} // namespace kahypar
| 39.84063 | 109 | 0.684514 | Ace-Ma |
5b6d3b36244ff88ef2574a5109f44e7677af00aa | 1,355 | cpp | C++ | Broccoli/src/Broccoli/Renderer/Buffer.cpp | tross2552/broccoli | d7afc472e076fa801d0e7745e209553b73c34486 | [
"Apache-2.0"
] | 1 | 2021-08-03T01:38:41.000Z | 2021-08-03T01:38:41.000Z | Broccoli/src/Broccoli/Renderer/Buffer.cpp | tross2552/broccoli | d7afc472e076fa801d0e7745e209553b73c34486 | [
"Apache-2.0"
] | null | null | null | Broccoli/src/Broccoli/Renderer/Buffer.cpp | tross2552/broccoli | d7afc472e076fa801d0e7745e209553b73c34486 | [
"Apache-2.0"
] | null | null | null | #include "brclpch.h"
#include "Buffer.h"
#include "Renderer.h"
#include "Platform/OpenGL/OpenGLBuffer.h"
namespace brcl
{
std::unique_ptr<VertexBuffer> VertexBuffer::Create(uint32_t size)
{
switch (renderer::GetAPI())
{
case RendererAPI::API::None: BRCL_CORE_ASSERT(false, "RendererAPI::None is currently not supported!"); return nullptr;
case RendererAPI::API::OpenGL: return std::make_unique <OpenGLVertexBuffer>(size);
}
BRCL_CORE_ASSERT(false, "Unknown RendererAPI!");
return nullptr;
}
std::unique_ptr<VertexBuffer> VertexBuffer::Create(float* vertices, uint32_t size)
{
switch (renderer::GetAPI())
{
case RendererAPI::API::None: BRCL_CORE_ASSERT(false, "RendererAPI::None is currently not supported!"); return nullptr;
case RendererAPI::API::OpenGL: return std::make_unique <OpenGLVertexBuffer>(vertices, size);
}
BRCL_CORE_ASSERT(false, "Unknown RendererAPI!");
return nullptr;
}
std::unique_ptr<IndexBuffer> IndexBuffer::Create(uint32_t* indices, uint32_t size)
{
switch (renderer::GetAPI())
{
case RendererAPI::API::None: BRCL_CORE_ASSERT(false, "RendererAPI::None is currently not supported!"); return nullptr;
case RendererAPI::API::OpenGL: return std::make_unique<OpenGLIndexBuffer>(indices, size);
}
BRCL_CORE_ASSERT(false, "Unknown RendererAPI!");
return nullptr;
}
}
| 29.456522 | 123 | 0.732841 | tross2552 |
5b6fa607acf172b32aca9f7f553df46ba37ad09c | 2,195 | cpp | C++ | SerialTesting/SerialHelper.cpp | jj9146/Arduino | bfee6d42067b342eb51cbe42bb3c2020f9c9c858 | [
"MIT"
] | null | null | null | SerialTesting/SerialHelper.cpp | jj9146/Arduino | bfee6d42067b342eb51cbe42bb3c2020f9c9c858 | [
"MIT"
] | null | null | null | SerialTesting/SerialHelper.cpp | jj9146/Arduino | bfee6d42067b342eb51cbe42bb3c2020f9c9c858 | [
"MIT"
] | null | null | null | /*
SerialHelper.cpp - Library for auto-magically determining
if a board is being powered by the USB port, and will halt
all attempts to connect to and send data over COM when
there is no computer/device to listen or respond.
*** For Arduino Nano boards ***
* NOTE: Requires a 10k resistor soldered between Pin 1 of the Micro USB jack and pin D12 on the
* arduino. Attach it to the shotsky diode directly below the USB jack (easiest to solder), and
* let it sit vertically along the left side of the Micro USB jack, with the top wire bent down and
* over to the 12 pin. You could put the entire resistor in shrink-wrap tubing, but there's really
* nothing to short on, so that might be a lost cause.
*/
#include "Arduino.h"
#include "SerialHelper.h"
SerialHelper::SerialHelper(int indicatorPin, int usbPowerPin, long COM_BPS)
{
pinMode(indicatorPin, OUTPUT);
pinMode(usbPowerPin, INPUT);
_serialIndicatorPin = indicatorPin;
_usbPowerPin = usbPowerPin;
_haveCOMConnection = false;
_COM_Speed = COM_BPS;
}
/*
* ConnectAndValidateUSBPower will look for power from the USB jack to be fed into D12
* If it finds power and can make the COM connection, then it'll set "_haveCOMConnection"
* to true, and return it as the response to the caller
*/
void SerialHelper::ConnectAndValidateUSBPower()
{
//Check pin 12 to see if we have a USB connection
int USBRead = digitalRead(_usbPowerPin);
if(USBRead == HIGH)
{
//Setup the connection
Serial.begin(_COM_Speed);
_haveCOMConnection = true;
//Setup the connection indicator pin
pinMode(_serialIndicatorPin, OUTPUT);
//Turn the indicator on
digitalWrite(_serialIndicatorPin, HIGH);
}
else
{
//We don't have a connection - bail
_haveCOMConnection = false;
}
//return _haveCOMConnection;
}
// Print text to COM port without a CrLf
void SerialHelper::PrintStr(String text)
{
if(_haveCOMConnection)
{
Serial.print(text);
}
}
// Print text to COM port with a CrLf
void SerialHelper::PrintStrLn(String text)
{
if(_haveCOMConnection)
{
Serial.println(text);
}
}
| 30.486111 | 100 | 0.69795 | jj9146 |
ac8e3c77f4e63badec83e7197309bc8015c60dd4 | 836 | cc | C++ | aoj/2/2013.cc | eagletmt/procon | adbe503eb3c1bbcc1538b2ee8988aa353937e8d4 | [
"MIT"
] | 1 | 2015-04-17T09:54:23.000Z | 2015-04-17T09:54:23.000Z | aoj/2/2013.cc | eagletmt/procon | adbe503eb3c1bbcc1538b2ee8988aa353937e8d4 | [
"MIT"
] | null | null | null | aoj/2/2013.cc | eagletmt/procon | adbe503eb3c1bbcc1538b2ee8988aa353937e8d4 | [
"MIT"
] | null | null | null | #include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
using namespace std;
void read(int& s0, int& s1)
{
char d;
int h0, m0, h1, m1;
cin >> h0 >> d >> m0 >> d >> s0;
cin >> h1 >> d >> m1 >> d >> s1;
s0 += 3600*h0 + 60*m0;
s1 += 3600*h1 + 60*m1;
}
int main()
{
int n;
while (cin >> n && n != 0) {
vector<pair<int,int> > entries(n);
for (int i = 0; i < n; i++) {
read(entries[i].first, entries[i].second);
}
sort(entries.begin(), entries.end());
priority_queue<int, vector<int>, greater<int> > q;
q.push(entries.front().second);
for (int i = 1; i < n; i++) {
if (q.top() > entries[i].first) {
q.push(entries[i].second);
} else {
q.pop();
q.push(entries[i].second);
}
}
cout << q.size() << endl;
}
return 0;
}
| 20.390244 | 54 | 0.505981 | eagletmt |
ac93d08e920e7e3262ff43b035551fa9a6aaa854 | 5,889 | cpp | C++ | examples/chess/src/chess.cpp | KazDragon/munin | ca5ae77cf5f75f6604fddd1a39393fa6acb88769 | [
"MIT"
] | 6 | 2017-07-15T10:16:20.000Z | 2021-06-14T10:02:37.000Z | examples/chess/src/chess.cpp | KazDragon/munin | ca5ae77cf5f75f6604fddd1a39393fa6acb88769 | [
"MIT"
] | 243 | 2017-05-01T19:27:07.000Z | 2021-09-01T09:32:49.000Z | examples/chess/src/chess.cpp | KazDragon/munin | ca5ae77cf5f75f6604fddd1a39393fa6acb88769 | [
"MIT"
] | 2 | 2019-07-16T00:29:43.000Z | 2020-09-19T09:49:00.000Z | #include <munin/button.hpp>
#include <munin/compass_layout.hpp>
#include <munin/filled_box.hpp>
#include <munin/grid_layout.hpp>
#include <munin/image.hpp>
#include <munin/scroll_pane.hpp>
#include <munin/text_area.hpp>
#include <munin/view.hpp>
#include <munin/window.hpp>
#include <terminalpp/canvas.hpp>
#include <terminalpp/string.hpp>
#include <terminalpp/terminal.hpp>
#include <consolepp/console.hpp>
#include <boost/asio/io_context.hpp>
using namespace terminalpp::literals;
class terminal_reader
{
public:
explicit terminal_reader(munin::window &window)
: dispatcher_(window)
{
}
void operator()(terminalpp::tokens const &tokens)
{
for (auto const &token : tokens)
{
boost::apply_visitor(dispatcher_, token);
}
}
private:
struct event_dispatcher : public boost::static_visitor<>
{
explicit event_dispatcher(munin::window &window)
: window_(window)
{
}
template <class Event>
void operator()(Event const &event)
{
window_.event(event);
}
munin::window &window_;
};
event_dispatcher dispatcher_;
};
void schedule_read(
consolepp::console &console,
terminalpp::terminal &terminal,
terminal_reader &reader)
{
console.async_read(
[&](consolepp::bytes data)
{
terminal.read(reader) >> data;
schedule_read(console, terminal, reader);
});
}
auto make_board()
{
return munin::make_image({
{ "\\p-" " " "\\p+" " " "\\p-" " " "\\p+" " " "\\p-" "\\U265A " "\\p+" " " "\\p-" " " "\\p+" "\\U265C "_ets },
{ "\\p+" "\\U265F " "\\p-" "\\U265F " "\\p+" " " "\\p-" " " "\\p+" " " "\\p-" "\\U265F " "\\p+" "\\U265F " "\\p-" "\\U265F "_ets },
{ "\\p-" " " "\\p+" "\\U265B " "\\p-" " " "\\p+" " " "\\p-" "\\U265F " "\\p+" " " "\\p-" " " "\\p+" " "_ets },
{ "\\p+" " " "\\p-" " " "\\p+" " " "\\p-" "\\U265F " "\\p+" "\\U2659 " "\\p-" " " "\\p+" " " "\\p-" " "_ets },
{ "\\p-" " " "\\p+" " " "\\p-" " " "\\p+" "\\U2655 " "\\p-" " " "\\p+" "\\U2659 " "\\p-" " " "\\p+" " "_ets },
{ "\\p+" "\\U2659 " "\\p-" "\\U2659 " "\\p+" " " "\\p-" " " "\\p+" " " "\\p-" " " "\\p+" " " "\\p-" " "_ets },
{ "\\p-" " " "\\p+" " " "\\p-" " " "\\p+" " " "\\p-" " " "\\p+" " " "\\p-" "\\U2659 " "\\p+" "\\U2659 "_ets },
{ "\\p+" "\\U2656 " "\\p-" "\\U2658 " "\\p+" "\\U265C " "\\p-" "\\U2656 " "\\p+" " " "\\p-" " " "\\p+" "\\U2654 " "\\p- "_ets }
});
}
auto make_white_text()
{
auto text_area = munin::make_text_area();
text_area->insert_text(
"e4 d4 e5 Bd3 Q\\i>x\\xd3 f4 c3 Nf3 0-0 b3 c\\i>x\\xd4 Bb2 a3 "
"N\\i>x\\xd4 Rd1 B\\i>x\\xd4 Q\\i>x\\xd4 Kf2 Q\\i>x\\xb6 Ke2 Kd2 g3 "
"a4 b4"_ets);
return text_area;
}
auto make_black_text()
{
auto text_area = munin::make_text_area();
text_area->insert_text(
"c6 d5 Bf5 B\\i>x\\xd3 e6 c5 Nc6 Qb6 Nh6 c\\i>x\\xd4 Nf5 Rc8 "
"Nc\\i>x\\xd4 Bc5 N\\i>x\\xd5 B\\i>x\\xd4\\[3\\i>+\\x Rc1 R\\i>x\\xd1 "
"a\\i>x\\xb6 Rc1 Rg1 Kd7 Rc8 Rcc1"_ets
);
return text_area;
}
auto make_content(auto &button)
{
return munin::view(
munin::make_compass_layout(),
munin::view(
munin::make_grid_layout({2, 1}),
munin::view(
munin::make_compass_layout(),
make_board(),
munin::compass_layout::heading::centre,
munin::make_fill("\\[6\\U2502"_ete),
munin::compass_layout::heading::east),
munin::view(
munin::make_grid_layout({1, 2}),
munin::make_scroll_pane(make_white_text()),
munin::make_scroll_pane(make_black_text()))),
munin::compass_layout::heading::centre,
munin::view(
munin::make_compass_layout(),
munin::make_fill("\\[6\\U2500"_ete),
munin::compass_layout::heading::north,
munin::make_fill(' '),
munin::compass_layout::heading::centre,
button,
munin::compass_layout::heading::east),
munin::compass_layout::heading::south);
}
auto make_behaviour()
{
terminalpp::behaviour behaviour;
behaviour.supports_basic_mouse_tracking = true;
behaviour.supports_window_title_bel = true;
return behaviour;
}
int main()
{
auto button = munin::make_button(" OK ");
munin::window window{make_content(button)};
boost::asio::io_context io_context;
consolepp::console console{io_context};
terminalpp::canvas canvas{{console.size().width, console.size().height}};
terminalpp::terminal terminal{make_behaviour()};
auto const &console_write =
[&console](terminalpp::bytes data)
{
console.write(data);
};
auto const &repaint_window =
[&]()
{
window.repaint(canvas, terminal, console_write);
};
window.on_repaint_request.connect(repaint_window);
console.on_size_changed.connect(
[&]
{
auto const new_size = console.size();
canvas.resize({new_size.width, new_size.height});
repaint_window();
});
terminal.write(console_write)
<< terminalpp::enable_mouse()
<< terminalpp::use_alternate_screen_buffer()
<< terminalpp::set_window_title("Chess++");
auto work_guard = boost::asio::make_work_guard(io_context);
button->on_click.connect([&]{
io_context.stop();
work_guard.reset();
});
button->set_focus();
terminal_reader reader(window);
schedule_read(console, terminal, reader);
io_context.run();
terminal.write(console_write)
<< terminalpp::use_normal_screen_buffer()
<< terminalpp::disable_mouse();
}
| 30.994737 | 142 | 0.533707 | KazDragon |
ac9640d797a8fd7c5ec67170aa1b8e67cf01ed1b | 22,810 | cxx | C++ | osf-to-esf/dbsk2d/algo/dbsk2d_bnd_preprocess_common.cxx | wenhanshi/lemsvxl-shock-computation | 1208e5f6a0c9fddbdffcc20f2c1d914e07015b45 | [
"MIT"
] | 1 | 2022-01-01T20:43:47.000Z | 2022-01-01T20:43:47.000Z | osf-to-esf/dbsk2d/algo/dbsk2d_bnd_preprocess_common.cxx | wenhanshi/lemsvxl-shock-computation | 1208e5f6a0c9fddbdffcc20f2c1d914e07015b45 | [
"MIT"
] | null | null | null | osf-to-esf/dbsk2d/algo/dbsk2d_bnd_preprocess_common.cxx | wenhanshi/lemsvxl-shock-computation | 1208e5f6a0c9fddbdffcc20f2c1d914e07015b45 | [
"MIT"
] | null | null | null | // This is brcv/shp/dbsk2d/algo/dbsk2d_bnd_preprocess_common.cxx
//:
// \file
#include "dbsk2d_bnd_preprocess.h"
#include <vcl_algorithm.h>
#include <vgl/vgl_closest_point.h>
#include <vgl/vgl_distance.h>
#include <vtol/vtol_list_functions.h>
#include "../../dbgl/algo/dbgl_circ_arc.h"
#include "../../dbgl/algo/dbgl_closest_point.h"
#include "../dbsk2d_bnd_utils.h"
#include "../dbsk2d_ishock_barc.h"
// ================= COMMON ======================
//-----------------------------------------------------------------------------
//: Remove "unlinked" edges in an edge list
void dbsk2d_bnd_preprocess::
remove_unlinked_edges(vcl_list<dbsk2d_bnd_edge_sptr >& edges)
{
bnd_edge_list::iterator eit = edges.begin();
while (eit != edges.end())
{
dbsk2d_bnd_edge_sptr e = *eit;
if (e->numinf()==0 && e->numsup()==0)
eit = edges.erase(eit);
else
++eit;
}
}
//-----------------------------------------------------------------------------
//: Separate out the edges into three groups - points, lines, and arcs
void dbsk2d_bnd_preprocess::
classify_edges(vcl_list<dbsk2d_bnd_edge_sptr >& edges,
vcl_list<dbsk2d_bnd_edge_sptr >* bnd_pts,
vcl_list<dbsk2d_bnd_edge_sptr >* bnd_lines,
vcl_list<dbsk2d_bnd_edge_sptr >* bnd_arcs)
{
// clean up
if (bnd_pts) bnd_pts->clear();
if (bnd_lines) bnd_lines->clear();
if (bnd_arcs) bnd_arcs->clear();
for (bnd_edge_list::iterator eit = edges.begin();
eit != edges.end(); ++eit)
{
dbsk2d_bnd_edge_sptr e = *eit;
if (e->is_a_point())
{
if (bnd_pts) bnd_pts->push_back(e);
}
else if (e->left_bcurve()->is_a_line())
{
if (bnd_lines) bnd_lines->push_back(e);
}
else if ( e->left_bcurve()->is_an_arc())
{
if (bnd_arcs) bnd_arcs->push_back(e);
}
// if reached here, something is wrong. Some unknown edge type is present
else
dbsk2d_assert(false);
}
edges.clear();
return;
}
//------------------------------------------------------------------------
//: Convert too short lines and arcs into points
// If the points is not stand-alone, the remove it
void dbsk2d_bnd_preprocess::
remove_short_curves(vcl_list<dbsk2d_bnd_edge_sptr >& edges)
{
bnd_edge_list::iterator eit = edges.begin();
while (eit != edges.end())
{
dbsk2d_bnd_edge_sptr e = (*eit);
if (!e->is_a_point())
{
// do nothing if distance between endpoints are above threshold
double d = (e->point2()-e->point1()).length();
if (d > dbsk2d_bnd_preprocess::distance_tol)
{
++eit;
continue;
}
// when distance is below threshold, merge the two end points
// and delete the internal bcurves of edge
e->bnd_v1()->merge_with(e->bnd_v2());
}
e->clear_bcurves();
// check if this is really a stand-alone point
edge_list elist;
e->v1()->edges(elist);
if (elist.size() > 1)
{
e->unlink_from_cells();
e->unlink();
eit = edges.erase(eit);
}
else
{
++eit;
}
}
return;
}
//----------------------------------------------------------------------------
//: Merge vertices that are geometrically close
void dbsk2d_bnd_preprocess::
merge_close_vertices(vcl_list<dbsk2d_bnd_vertex_sptr >* affected_vertices,
vcl_list<dbsk2d_bnd_vertex_sptr >* vertex_set1,
vcl_list<dbsk2d_bnd_vertex_sptr >* vertex_set2)
{
// clear old stuffs
affected_vertices->clear();
bnd_vertex_list::iterator vit1;
bnd_vertex_list::iterator vit2;
dbsk2d_bnd_vertex_sptr v1 = 0;
dbsk2d_bnd_vertex_sptr v2 = 0;
bnd_vertex_list* vertex_set2b = (vertex_set2) ? vertex_set2 : vertex_set1;
// loop through all pair of vertices and check distance between them
for (vit1 = vertex_set1->begin(); vit1 != vertex_set1->end(); ++vit1)
{
v1 = (*vit1);
if (vertex_set2)
{
vit2 = vertex_set2->begin();
}
// if vit1 and vit2 of the same list, start from the next vertex
else
{
vit2 = vit1;
++vit2;
}
while (vit2 != vertex_set2b->end())
{
v2 = (*vit2);
if (v2 == v1)
{
vit2 = vertex_set2b->erase(vit2);
continue;
}
// if the two vertices have the same geometry, transfer all the links
// from one vertice to the other and delete one of them
// this should not delete any bnd_edge, hence the structure of the contours
// is preserved. No need to modify the contour
double d = (v2->point()-v1->point()).length();
if (d > dbsk2d_bnd_preprocess::distance_tol)
{
++vit2;
}
else
{
v1->merge_with(v2);
vit2 = vertex_set2b->erase(vit2);
affected_vertices->push_back(v1);
}
}
}
}
//-----------------------------------------------------------------------------
//: Insert new vertices to the middle of the edges
// The overall edge list will also be updated
void dbsk2d_bnd_preprocess::
insert_new_vertices(const vkey_vertex_map & new_vertex_map,
vcl_list<dbsk2d_bnd_edge_sptr >& all_edges,
vcl_list<dbsk2d_bnd_vertex_sptr >& affected_vertices)
{
// clear old stuffs
affected_vertices.clear();
vkey_vertex_map::const_iterator vit = new_vertex_map.begin();
while (vit != new_vertex_map.end())
{
dbsk2d_bnd_edge_sptr cur_edge = (*vit).first.first;
// list of vertices along `cur_edge'
bnd_vertex_list vertices_along_edge;
vertices_along_edge.push_back(cur_edge->bnd_v1());
vkey_vertex_map::const_iterator vit2 = vit;
for (; vit2 != new_vertex_map.end() && (*vit2).first.first == cur_edge;
++vit2)
{
vertices_along_edge.push_back((*vit2).second);
}
vertices_along_edge.push_back(cur_edge->bnd_v2());
// update vit
vit = vit2;
// vector of edges (lines or arc) that will be used to replace `cur_edge'
vcl_vector<dbsk2d_bnd_edge_sptr > new_edges;
vcl_vector<signed char > directions;
// Treat each of of belm curves (line, arc) differently
switch (cur_edge->left_bcurve()->type())
{
case(BLINE):
{
// form a vector of line edges equivalent to the old edge
bnd_vertex_list::iterator vit3 = vertices_along_edge.begin();
dbsk2d_bnd_vertex_sptr last_vertex = *vit3;
++vit3;
for (; vit3 != vertices_along_edge.end(); ++vit3)
{
dbsk2d_bnd_vertex_sptr new_vertex = (*vit3);
new_edges.push_back(dbsk2d_bnd_utils::new_line_between(last_vertex,
new_vertex, this->boundary()));
directions.push_back(1);
last_vertex = new_vertex;
}
break;
}
case(BARC):
{
dbsk2d_ishock_barc* barc =
static_cast<dbsk2d_ishock_barc*>(cur_edge->left_bcurve());
double arc_k = barc->curvature();
// form a vector of line edges equivalent to the old edge
bnd_vertex_list::iterator vit3 = vertices_along_edge.begin();
dbsk2d_bnd_vertex_sptr last_vertex = *vit3;
++vit3;
for (; vit3 != vertices_along_edge.end(); ++vit3)
{
dbsk2d_bnd_vertex_sptr new_vertex = (*vit3);
new_edges.push_back(dbsk2d_bnd_utils::new_arc_between(last_vertex,
new_vertex, arc_k, this->boundary()));
directions.push_back(1);
last_vertex = new_vertex;
}
break;
}
default:
{
vcl_cerr << "dbsk2d_bnd_preprocess::insert_new_vertices()\n" <<
"Can't handle this type of edge\n";
dbsk2d_assert(false);
}
}
// replace `cur_edge' with the new vector of edges
// containers for new_edges with reverse order and reverse directions
// in case they are needed.
vcl_vector<dbsk2d_bnd_edge_sptr > reverse_new_edges;
vcl_vector<signed char > reverse_directions;
// replace `cur_edge' with new edges, topologically
while (cur_edge->numsup()>0)
{
vtol_topology_object* t = cur_edge->superiors_list()->front();
dbsk2d_bnd_contour_sptr contour = static_cast<dbsk2d_bnd_contour* >(t);
signed char dir = contour->direction(*cur_edge);
// if direction of `cur_edge' in `contour' is -1 then we
// need to reverse the order of new edges and sign of new directions
if (dir == 1)
{
contour->replace_edges(new_edges, directions, cur_edge);
}
else
{
// only reverse copy from `new_edges' to `reverse_new_edges' once
if (reverse_new_edges.size() == 0)
{
reverse_new_edges.reserve(new_edges.size());
vcl_reverse_copy(new_edges.begin(), new_edges.end(),
reverse_new_edges.begin());
reverse_directions.assign(directions.size(), -1);
}
// replace the edge with new_edges whose orders are reversed
contour->replace_edges(reverse_new_edges, reverse_directions, cur_edge);
}
}
// replace `cur_edge' with new edges, geographically
vcl_list<dbsk2d_bnd_cell* > cells = cur_edge->cells();
cur_edge->unlink_from_cells();
// add back the replacement of `cur_edge'
for (vcl_list<dbsk2d_bnd_cell* >::iterator cit = cells.begin();
cit != cells.end(); ++cit)
{
dbsk2d_bnd_cell_sptr cell = *cit;
for (unsigned int i=0; i<new_edges.size(); ++i)
{
// ???? not consistent with new allocation method
if (new_edges[i]->intersect_cell(cell, dbsk2d_bnd_preprocess::distance_tol))
{
cell->add_bnd_edge(new_edges[i]);
}
}
}
cur_edge->unlink();
// update the overall edge list
all_edges.remove(cur_edge);
for (unsigned int i = 0; i < new_edges.size(); ++i)
{
all_edges.push_back(new_edges[i]);
}
affected_vertices.splice(affected_vertices.end(), vertices_along_edge);
}
tagged_union<dbsk2d_bnd_vertex_sptr >(&affected_vertices);
return;
}
//: Dissolve end vertices into curves(lines, arcs) when they are too close
// Require: the vertex list is unique
void dbsk2d_bnd_preprocess::
dissolve_vertices_into_curves(vcl_list<dbsk2d_bnd_edge_sptr >& tainted_edges,
vcl_list<dbsk2d_bnd_edge_sptr >& bnd_curves,
const vcl_list<dbsk2d_bnd_vertex_sptr >& vertices)
{
// A list of modification to the edges to be made at the end
vkey_vertex_map modifications;
// scan through all pairs of (vertex, line edge)
for (bnd_vertex_list::const_iterator vit = vertices.begin();
vit != vertices.end(); ++vit)
{
dbsk2d_bnd_vertex_sptr v = *vit;
// list of coordinates that the vertex may be moved to (because
// of curves it is close to)
// these coordinates will be averaged to determine final position of vertex
vcl_vector<vgl_point_2d<double > > target_pts;
// `weak link' edges, i.e. epsilon < distance < 2*epsilon
// these edges will be reconsidered after the vertex is moved to its
// final position.
bnd_edge_vector weak_link_curves;
// loop through all edges and compute distance to the vertex
for (bnd_edge_list::iterator eit = bnd_curves.begin();
eit != bnd_curves.end(); ++eit)
{
dbsk2d_bnd_edge_sptr e = *eit;
// ignore edges that have the considered vertex as end-point
if (e->is_endpoint(v.ptr())) continue;
switch (e->left_bcurve()->type())
{
case(BLINE):
{
// distance from the vertex to the line edge
vgl_point_2d<double > pv = v->point();
vgl_point_2d<double > p1 = e->point1();
vgl_point_2d<double > p2 = e->point2();
double d = vgl_distance_to_linesegment(p1.x(), p1.y(),
p2.x(), p2.y(), pv.x(), pv.y());
// No link : do nothing
if ( d > 2*dbsk2d_bnd_preprocess::distance_tol) continue;
// Weak link : add the edge to `weak link' edge (to reconsider later)
if ( d > dbsk2d_bnd_preprocess::distance_tol)
{
weak_link_curves.push_back(e);
continue;
}
// Strong link: merge the point into the line
// find location on line that is closest to the vertex
double xp, yp;
vgl_closest_point_to_linesegment<double >(xp, yp,
p1.x(), p1.y(), p2.x(), p2.y(), pv.x(), pv.y());
vgl_point_2d<double > foot_pt(xp, yp);
// add the point (xp, yp) to the target list
target_pts.push_back(foot_pt);
// mark vertex to add to the line at the end
double ratio_pt = ratio<double >(p1, p2, foot_pt);
vkey key(e, ratio_pt);
modifications.insert(vkey_vertex_pair(key, v));
break;
}
case (BARC):
{
// distance from the vertex to the arc edge
vgl_point_2d<double > pv = v->point();
vgl_point_2d<double > p1 = e->point1();
vgl_point_2d<double > p2 = e->point2();
dbsk2d_ishock_barc* barc =
static_cast<dbsk2d_ishock_barc* >(e->left_bcurve());
double arc_k = barc->curvature();
double arc_ratio;
double d = dbgl_closest_point::point_to_circular_arc(pv, p1, p2,
arc_k, arc_ratio);
// No link : do nothing
if ( d > 2*dbsk2d_bnd_preprocess::distance_tol) continue;
// Weak link : add the edge to `weak link' edge (to reconsider later)
if ( d > dbsk2d_bnd_preprocess::distance_tol)
{
weak_link_curves.push_back(e);
continue;
}
// Strong link: merge the point into the line
// find location on arc that is closest to the vertex
dbgl_circ_arc arc(p1, p2, arc_k);
vgl_point_2d<double > pt = arc.point_at_length(arc_ratio*arc.len());
// add to the target list
target_pts.push_back(pt);
// mark vertex to add to the arc at the end
vkey key(e, arc_ratio);
modifications.insert(vkey_vertex_pair(key, v));
break;
}
default:
{
vcl_cerr << "dbsk2d_bnd_preprocess::insert_new_vertices()\n" <<
"Can't handle this type of edge\n";
dbsk2d_assert(false);
}
}
}
// move the vertex to the new position and set the vertex
if (!target_pts.empty())
{
// find centroid of all target points
double centroid_x = 0;
double centroid_y = 0;
for (unsigned int i=0; i<target_pts.size(); ++i)
{
centroid_x += target_pts[i].x();
centroid_y += target_pts[i].y();
}
centroid_x = centroid_x / target_pts.size();
centroid_y = centroid_y / target_pts.size();
v->bpoint()->set_pt(centroid_x, centroid_y);
}
// reconsider the edges in the `weak-link' list
// if any distance to the vertex has moved to the "epsilon" range
// the edge will be broken but the coordinate of the vertex
// will remain unchanged
// loop through all `weak-link' edges and recompute distance
for (bnd_edge_vector::iterator eit = weak_link_curves.begin();
eit != weak_link_curves.end(); ++eit)
{
dbsk2d_bnd_edge_sptr e = *eit;
switch (e->left_bcurve()->type())
{
case(BLINE):
{
// recompute distance from the vertex to the line edge
vgl_point_2d<double > pv = v->point();
vgl_point_2d<double > p1 = e->point1();
vgl_point_2d<double > p2 = e->point2();
double d = vgl_distance_to_linesegment(p1.x(), p1.y(),
p2.x(), p2.y(), pv.x(), pv.y());
// do nothing when distance is above threshold
if ( d > dbsk2d_bnd_preprocess::distance_tol) continue;
// When distance is below threshold, merge vertex into the line
// find location on line that is closest to the vertex
double xp, yp;
vgl_closest_point_to_linesegment<double >(xp, yp,
p1.x(), p1.y(), p2.x(), p2.y(), pv.x(), pv.y());
vgl_point_2d<double > foot_pt(xp, yp);
double ratio_pt = ratio<double >(p1, p2, foot_pt);
vkey key(e, ratio_pt);
modifications.insert(vkey_vertex_pair(key, v));
}
case (BARC):
{
// recompute distance from the vertex to the arc edge
vgl_point_2d<double > pv = v->point();
vgl_point_2d<double > p1 = e->point1();
vgl_point_2d<double > p2 = e->point2();
dbsk2d_ishock_barc* barc =
static_cast<dbsk2d_ishock_barc* >(e->left_bcurve());
double arc_k = barc->curvature();
double arc_ratio;
double d = dbgl_closest_point::point_to_circular_arc(pv, p1, p2,
arc_k, arc_ratio);
// do nothing when distance is above threshold
if ( d > dbsk2d_bnd_preprocess::distance_tol) continue;
// When distance is below threshold, merge vertex into the arc
// find location on arc that is closest to the vertex
dbgl_circ_arc arc(p1, p2, arc_k);
vgl_point_2d<double > pt = arc.point_at_length(arc_ratio*arc.len());
// mark vertex to add to the arc at the end
vkey key(e, arc_ratio);
modifications.insert(vkey_vertex_pair(key, v));
break;
}
default:
break;
}
}
}
bnd_vertex_list affected_vertices;
this->insert_new_vertices(modifications, bnd_curves, affected_vertices);
dbsk2d_bnd_utils::extract_edge_list(affected_vertices, tainted_edges);
return;
}
//-------------------------------------------------------------------------
//: Form bnd_contours from edges
// require: the list of edges must be preprocessed
void dbsk2d_bnd_preprocess::
form_contours_from_edges(const vcl_list<dbsk2d_bnd_edge_sptr >& edges,
vcl_list<dbsk2d_bnd_contour_sptr >& new_contours)
{
//this->update_vertex_list();
bnd_vertex_list vertices;
dbsk2d_bnd_utils::extract_vertex_list(edges, vertices);
// sort the vertices so that vertices with order 2 are at the end of the list
vcl_list<dbsk2d_bnd_vertex_sptr > order_2_vertices;
for (vcl_list<dbsk2d_bnd_vertex_sptr >::iterator
vit = vertices.begin(); vit != vertices.end();)
{
// check order of this vertex
edge_list elist;
(*vit)->edges(elist);
// separate out edges with order != 2
if (elist.size() == 2)
{
order_2_vertices.push_back((*vit));
vit = vertices.erase(vit);
}
else
{
++vit;
}
}
// merge two lists together to have a complete list with
// order-2 vertices at the end
vertices.splice(vertices.end(), order_2_vertices);
// reset flags on edges and vertices indicating they have been visited
for (vcl_list<dbsk2d_bnd_edge_sptr >::const_iterator eit = edges.begin();
eit != edges.end(); ++eit)
{
(*eit)->unset_user_flag(VSOL_FLAG1);
}
for(vcl_list<dbsk2d_bnd_vertex_sptr >::iterator vit = vertices.begin();
vit != vertices.end(); ++vit)
{
(*vit)->unset_user_flag(VSOL_FLAG1);
}
// The algorithm:
// For each vertex v0, check if it is a starting vertex of an edge,
// i.e. vertices with degree different from 2
// For each edge that v0 is a starting vertex of
// trace along the edge till hitting an end, i.e. vertex with order different from 2
// Form a contour from the edges and marked them as traversed.
// Repeat this for ever vertex
for (vcl_list<dbsk2d_bnd_vertex_sptr >::iterator vit_s =
vertices.begin(); vit_s != vertices.end(); ++vit_s)
{
// obtain the list of edges connected to this vertex
edge_list cur_elist;
(*vit_s)->edges(cur_elist);
//// vertex with degree 2 is not an end-vertex
//if (cur_elist.size() == 2) continue;
(*vit_s)->set_user_flag(VSOL_FLAG1);
// loop through all direction to form contour
for (edge_list::iterator
eit = cur_elist.begin(); eit != cur_elist.end(); ++eit)
{
// skip edges that have been visited
if ((*eit)->get_user_flag(VSOL_FLAG1)) continue;
dbsk2d_bnd_vertex_sptr tracing_vertex = (*vit_s);
dbsk2d_bnd_edge_sptr tracing_edge =
static_cast<dbsk2d_bnd_edge* >((*eit).ptr());
//vector to hold edges that will be used to form a contour
vcl_vector< dbsk2d_bnd_edge_sptr > connected_edges;
bool contour_stopped = false;
while (!contour_stopped)
{
//safety check
if (! tracing_edge->is_class("dbsk2d_bnd_edge"))
{
vcl_cerr << "Edge is not of class <dbsk2d_bnd_edge>\n";
break;
};
// reverse edge direction if necessary
// \TODO - just set the directions_ to -1
// avoid physically reverse the direction of the edge. it is expensive.
if (tracing_edge->v1() != tracing_vertex.ptr() )
tracing_edge->reverse_direction();
// safety check
dbsk2d_assert (tracing_edge->v1() == tracing_vertex.ptr());
// add the edge to the to-form-contour edge list
connected_edges.push_back( tracing_edge);
// safety check - make sure this edge was not visited previously
//\TODO - deal with this, run-time error is bad
dbsk2d_assert( ! tracing_edge->get_user_flag(VSOL_FLAG1));
tracing_edge->set_user_flag(VSOL_FLAG1);
// update next vertex and check if it is end-vertex of the contour
tracing_vertex = tracing_edge->bnd_v2();
tracing_vertex->set_user_flag(VSOL_FLAG1);
if (tracing_vertex == (*vit_s))
{
// this is an end-vertex of a close-loop contour
contour_stopped = true;
continue;
};
edge_list temp_elist;
tracing_vertex->edges(temp_elist);
if (temp_elist.size() != 2)
{
// this is an end-vertex of a contour
contour_stopped = true;
continue;
}
// the contour is not ended yet. Find the next edge
vtol_edge_sptr temp_edge = (temp_elist.front() == tracing_edge.ptr()) ?
temp_elist.back() : temp_elist.front();
tracing_edge = static_cast<dbsk2d_bnd_edge* >(temp_edge.ptr());
}
// save the new contour to the preprocessed contour list
if (contour_stopped){
dbsk2d_bnd_contour_sptr new_con = new dbsk2d_bnd_contour(connected_edges,
this->boundary()->nextAvailableID());
// vcl_cout << "Number of edges of new_con = " << new_con->num_edges() << vcl_endl;
if (new_con->num_edges() > 0)
//this->preproc_contours_.push_back( new_con);
new_contours.push_back( new_con);
}
}
}
}
| 31.11869 | 91 | 0.604822 | wenhanshi |
ac96cdfc0f02aabe82becbdefc53c58933372f17 | 6,091 | cc | C++ | tests/unit/rdma/test_rdma_collection_handle.extended.cc | rbuch/vt | 74c2e0cae3201dfbcbfda7644c354703ddaed6bb | [
"BSD-3-Clause"
] | 26 | 2019-11-26T08:36:15.000Z | 2022-02-15T17:13:21.000Z | tests/unit/rdma/test_rdma_collection_handle.extended.cc | rbuch/vt | 74c2e0cae3201dfbcbfda7644c354703ddaed6bb | [
"BSD-3-Clause"
] | 1,215 | 2019-09-09T14:31:33.000Z | 2022-03-30T20:20:14.000Z | tests/unit/rdma/test_rdma_collection_handle.extended.cc | rbuch/vt | 74c2e0cae3201dfbcbfda7644c354703ddaed6bb | [
"BSD-3-Clause"
] | 12 | 2019-09-08T00:03:05.000Z | 2022-02-23T21:28:35.000Z | /*
//@HEADER
// *****************************************************************************
//
// test_rdma_collection_handle.extended.cc
// DARMA/vt => Virtual Transport
//
// Copyright 2019-2021 National Technology & Engineering Solutions of Sandia, LLC
// (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S.
// Government retains certain rights in this software.
//
// 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 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 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.
//
// Questions? Contact darma@sandia.gov
//
// *****************************************************************************
//@HEADER
*/
#include <gtest/gtest.h>
#include "test_parallel_harness.h"
#include "test_helpers.h"
#include "vt/vrt/collection/manager.h"
namespace vt { namespace tests { namespace unit {
bool triggered_lb = false;
template <typename T>
struct TestCol : vt::Collection<TestCol<T>, vt::Index2D> {
TestCol() = default;
struct TestMsg : vt::CollectionMessage<TestCol> { };
void makeHandles(TestMsg*) {
auto proxy = this->getCollectionProxy();
auto idx = this->getIndex();
handle_ = proxy.template makeHandleRDMA<T>(idx, 8, true);
}
void setupData(TestMsg* msg) {
auto idx = this->getIndex();
handle_.modifyExclusive([&](T* t, std::size_t count) {
for (int i = 0; i < 8; i++) {
t[i] = idx.x() * 100 + idx.y();
}
});
}
void testData(TestMsg*) {
auto idx = this->getIndex();
auto next_x = idx.x() + 1 < 8 ? idx.x() + 1 : 0;
vt::Index2D next(next_x, idx.y());
auto ptr = std::make_unique<T[]>(8);
handle_.get(next, ptr.get(), 8, 0, vt::Lock::Shared);
for (int i = 0; i < 8; i++) {
EXPECT_EQ(ptr[i], next_x * 100 + idx.y());
}
}
void migrateObjs(TestMsg*) {
auto idx = this->getIndex();
if (idx.y() > 1) {
auto node = vt::theContext()->getNode();
auto num = vt::theContext()->getNumNodes();
auto next = node + 1 < num ? node + 1 : 0;
this->migrate(next);
}
}
void runLBHooksForRDMA(TestMsg*) {
if (not triggered_lb) {
triggered_lb = true;
//fmt::print("{}: run post migration hooks\n", theContext()->getNode());
vt::thePhase()->runHooksManual(vt::phase::PhaseHook::EndPostMigration);
}
}
void checkDataAfterMigrate(TestMsg*) {
auto idx = this->getIndex();
auto next_x = idx.x() + 1 < 8 ? idx.x() + 1 : 0;
vt::Index2D next(next_x, idx.y());
auto ptr = std::make_unique<T[]>(8);
handle_.get(next, ptr.get(), 8, 0, vt::Lock::Shared);
for (int i = 0; i < 8; i++) {
EXPECT_EQ(ptr[i], next_x * 100 + idx.y());
}
}
void destroyHandles(TestMsg*) {
auto proxy = this->getCollectionProxy();
proxy.destroyHandleRDMA(handle_);
}
template <typename SerializerT>
void serialize(SerializerT& s) {
vt::Collection<TestCol<T>, vt::Index2D>::serialize(s);
s | handle_;
}
private:
vt::HandleRDMA<T, vt::Index2D> handle_;
};
template <typename T>
struct TestRDMAHandleCollection : TestParallelHarness { };
TYPED_TEST_SUITE_P(TestRDMAHandleCollection);
TYPED_TEST_P(TestRDMAHandleCollection, test_rdma_handle_collection_1) {
SET_MAX_NUM_NODES_CONSTRAINT(CMAKE_DETECTED_MAX_NUM_NODES);
using T = TypeParam;
using ColType = TestCol<T>;
using MsgType = typename ColType::TestMsg;
triggered_lb = false;
CollectionProxy<TestCol<T>, Index2D> proxy;
runInEpochCollective([&]{
auto range = vt::Index2D(8,8);
proxy = theCollection()->constructCollective<ColType>(range);
});
runInEpochCollective([=]{
proxy.template broadcastCollective<MsgType, &ColType::makeHandles>();
});
runInEpochCollective([=]{
proxy.template broadcastCollective<MsgType, &ColType::setupData>();
});
runInEpochCollective([=]{
proxy.template broadcastCollective<MsgType, &ColType::testData>();
});
runInEpochCollective([=]{
proxy.template broadcastCollective<MsgType, &ColType::migrateObjs>();
});
runInEpochCollective([=]{
proxy.template broadcastCollective<MsgType, &ColType::runLBHooksForRDMA>();
});
runInEpochCollective([=]{
proxy.template broadcastCollective<MsgType, &ColType::checkDataAfterMigrate>();
});
runInEpochCollective([=]{
proxy.template broadcastCollective<MsgType, &ColType::destroyHandles>();
});
}
using RDMACollectionTestTypes = testing::Types<
int,
double
>;
REGISTER_TYPED_TEST_SUITE_P(
TestRDMAHandleCollection,
test_rdma_handle_collection_1
);
INSTANTIATE_TYPED_TEST_SUITE_P(
test_rdma_handle_collection, TestRDMAHandleCollection, RDMACollectionTestTypes,
DEFAULT_NAME_GEN
);
}}} /* end namespace vt::tests::unit */
| 31.076531 | 83 | 0.66902 | rbuch |
ac9a566724a51c7315b883fcd236ca39fd49b1e6 | 677 | cpp | C++ | HackerRank/Algorithms/Medium/M0023.cpp | Mohammed-Shoaib/HackerRank-Problems | ccfb9fc2f0d8dff454439d75ce519cf83bad7c3b | [
"MIT"
] | 54 | 2019-05-13T12:13:09.000Z | 2022-02-27T02:59:00.000Z | HackerRank/Algorithms/Medium/M0023.cpp | Mohammed-Shoaib/HackerRank-Problems | ccfb9fc2f0d8dff454439d75ce519cf83bad7c3b | [
"MIT"
] | 2 | 2020-10-02T07:16:43.000Z | 2020-10-19T04:36:19.000Z | HackerRank/Algorithms/Medium/M0023.cpp | Mohammed-Shoaib/HackerRank-Problems | ccfb9fc2f0d8dff454439d75ce519cf83bad7c3b | [
"MIT"
] | 20 | 2020-05-26T09:48:13.000Z | 2022-03-18T15:18:27.000Z | /*
Problem Statement: https://www.hackerrank.com/challenges/hackerland-radio-transmitters/problem
*/
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int hackerlandRadioTransmitters(int k, vector<int> &x) {
int n, i, pos, transmitters;
n = x.size();
transmitters = i = 0;
sort(x.begin(), x.end());
while (i < n) {
pos = x[i] + k;
while (i < n && x[i] <= pos)
i++;
pos = x[--i] + k;
while (i < n && x[i] <= pos)
i++;
transmitters++;
}
return transmitters;
}
int main() {
int n, k;
cin >> n >> k;
vector<int> x(n);
for (int i = 0; i < n; i++)
cin >> x[i];
cout << hackerlandRadioTransmitters(k, x);
return 0;
} | 17.815789 | 94 | 0.589365 | Mohammed-Shoaib |
ac9dd0541a5ed85c2fb5017510845e234dbc75a0 | 991 | cpp | C++ | RTCSDK/service/biz_service_factory.cpp | tyouritsugun/janus-client-cplus | f478ddcf62d12f1b0efe213dd695ec022e793070 | [
"MIT"
] | 1 | 2020-12-18T09:11:05.000Z | 2020-12-18T09:11:05.000Z | RTCSDK/service/biz_service_factory.cpp | tyouritsugun/janus-client-cplus | f478ddcf62d12f1b0efe213dd695ec022e793070 | [
"MIT"
] | null | null | null | RTCSDK/service/biz_service_factory.cpp | tyouritsugun/janus-client-cplus | f478ddcf62d12f1b0efe213dd695ec022e793070 | [
"MIT"
] | 1 | 2021-08-11T01:09:22.000Z | 2021-08-11T01:09:22.000Z | /**
* This file is part of janus_client project.
* Author: Jackie Ou
* Created: 2020-10-01
**/
#include "biz_service_factory.h"
#include "notification_service.h"
namespace core {
BizServiceFactory::BizServiceFactory(const std::shared_ptr<IUnifiedFactory>& unifiedFactory)
: _unifiedFactory(unifiedFactory)
{
}
void BizServiceFactory::registerService(const std::string& key , const std::shared_ptr<IBizService> &service)
{
_serviceMap.insert(std::make_pair(key, service));
}
void BizServiceFactory::unregisterService(const std::string& key)
{
_serviceMap.erase(key);
}
std::shared_ptr<IBizService> BizServiceFactory::getService(const std::string& key)
{
auto it = _serviceMap.find(key);
return it == _serviceMap.end() ? nullptr : it->second;
}
void BizServiceFactory::cleanup()
{
for (auto item : _serviceMap) {
if(!item.second) {
continue;
}
item.second->cleanup();
}
}
void BizServiceFactory::init()
{
}
}
| 19.82 | 109 | 0.691221 | tyouritsugun |
aca384b5a196316a513c4cf34e807d77cb1efa12 | 1,515 | cpp | C++ | blank-plugin/src/cpp/GUI/__Plugin__Controller.cpp | pongasoft/jamba | 0af93fc973c61b06d7a63c8e0e67329ed9ad656c | [
"Apache-2.0"
] | 93 | 2018-08-29T22:37:20.000Z | 2022-03-24T01:57:58.000Z | blank-plugin/src/cpp/GUI/__Plugin__Controller.cpp | pongasoft/jamba | 0af93fc973c61b06d7a63c8e0e67329ed9ad656c | [
"Apache-2.0"
] | 13 | 2018-09-01T15:10:54.000Z | 2021-12-23T16:13:27.000Z | blank-plugin/src/cpp/GUI/__Plugin__Controller.cpp | pongasoft/jamba | 0af93fc973c61b06d7a63c8e0e67329ed9ad656c | [
"Apache-2.0"
] | 1 | 2021-02-22T09:47:10.000Z | 2021-02-22T09:47:10.000Z | #include "[-name-]Controller.h"
namespace [-namespace-]::GUI {
//------------------------------------------------------------------------
// Constructor
//------------------------------------------------------------------------
[-name-]Controller::[-name-]Controller() : GUIController("[-name-].uidesc"), fParams{}, fState{fParams}
{
DLOG_F(INFO, "[-name-]Controller()");
}
//------------------------------------------------------------------------
// Destructor
//------------------------------------------------------------------------
[-name-]Controller::~[-name-]Controller()
{
DLOG_F(INFO, "~[-name-]Controller()");
}
//------------------------------------------------------------------------
// [-name-]Controller::initialize
//------------------------------------------------------------------------
tresult [-name-]Controller::initialize(FUnknown *context)
{
tresult res = GUIController::initialize(context);
//------------------------------------------------------------------------
// In debug mode this code displays the order in which the GUI parameters
// will be saved
//------------------------------------------------------------------------
#ifndef NDEBUG
if(res == kResultOk)
{
using Key = Debug::ParamDisplay::Key;
DLOG_F(INFO, "GUI Save State - Version=%d --->\n%s",
fParams.getGUISaveStateOrder().fVersion,
Debug::ParamTable::from(getGUIState(), true).keys({Key::kID, Key::kTitle}).full().toString().c_str());
}
#endif
return res;
}
}
| 32.934783 | 113 | 0.392739 | pongasoft |
acaa87f0d9bab3fc3ee20deb36c8734699557abb | 6,828 | cc | C++ | project/c++/mri/src/refdata/src/utilxtreme/xmlpload.cc | jia57196/code41 | df611f84592afd453ccb2d22a7ad999ddb68d028 | [
"Apache-2.0"
] | null | null | null | project/c++/mri/src/refdata/src/utilxtreme/xmlpload.cc | jia57196/code41 | df611f84592afd453ccb2d22a7ad999ddb68d028 | [
"Apache-2.0"
] | null | null | null | project/c++/mri/src/refdata/src/utilxtreme/xmlpload.cc | jia57196/code41 | df611f84592afd453ccb2d22a7ad999ddb68d028 | [
"Apache-2.0"
] | null | null | null | // Copyright @2012 JDSU Xtreme
#include "xtreme/refdata/internal/utilxtreme/xmlpload.h"
#include <log4cxx/logger.h>
#include <boost/property_tree/xml_parser.hpp>
#include <boost/property_tree/ptree.hpp>
#include <boost/foreach.hpp>
#include <boost/bimap.hpp>
#include <boost/assign/list_of.hpp>
#include "xtreme/common/xtreme_exception.h"
#include "xtreme/common/external_resp.h"
#include "xtreme/refdata/utilxtreme/rdxtreme_types.h"
namespace xtreme {
namespace refdata {
static log4cxx::LoggerPtr logger_xmlpload(
log4cxx::Logger::getLogger("xtreme.refdata.xmlpload"));
// <req category="refdata" op="" token=""> ... </req>
const std::string PAYLOAD_TAGS::REQ = "req";
const std::string PAYLOAD_TAGS::REQ_CAT = "req.<xmlattr>.category";
const std::string PAYLOAD_TAGS::REQ_OP = "req.<xmlattr>.op";
const std::string PAYLOAD_TAGS::REQ_SESSION_TOKEN = "req.<xmlattr>.token";
const std::string PAYLOAD_TAGS::REQ_RDCSV_LOCATION = "req.rdcsv_location";
const std::string PAYLOAD_TAGS::REQ_RDCSV_FILENAME = "req.rdcsv_filename";
const std::string PAYLOAD_TAGS::REQ_RDTYPE = "req.rdtype";
const std::string PAYLOAD_TAGS::REQ_RDTIMESTAMP = "req.rdtimestamp";
// <resp result_code=""> ... </resp>
const std::string PAYLOAD_TAGS::RESP = "resp";
const std::string PAYLOAD_TAGS::RESP_RESCODE = "resp.<xmlattr>.result_code";
// Bimap : two-way map of EXTREQ_OP and its corressponding string in "PAYLOAD_TAGS::REQ_OP"
typedef boost::bimap<EXTREQ_OP, std::string> EnumMap_EXTREQ_OP_STR_T;
const EnumMap_EXTREQ_OP_STR_T EnumMap_EXTREQ_OP_STR =
boost::assign::list_of<EnumMap_EXTREQ_OP_STR_T::relation>
(kRead_refdata, "read_refdata")
(kDrop_refdata, "drop_refdata")
(kActivate_refdata, "activate_refdata")
(kReadActivate_refdata, "readactivate_refdata");
const std::string CAT_IN_EXTERNAL_REQ_REFDATA = "refdata";
EXTREQ_OP getOpCode(const std::string& _strOP) {
EXTREQ_OP _op = kUnknownOp;
try {
_op = EnumMap_EXTREQ_OP_STR.right.at(_strOP); // might throw 'out_of_range'
} catch(...) {
// Unacceptable 'op' ... UNKNOWN/UNDEFINED op-string
}
return _op;
}
std::string getOpStr(EXTREQ_OP _op) {
std::string _opStr = "unknown";
try {
_opStr = EnumMap_EXTREQ_OP_STR.left.at(_op); // might throw 'out_of_range'
} catch(...) {
// Unacceptable 'op' ... UNKNOWN/UNDEFINED op-code
}
return _opStr;
}
// Populated known TAG names for "incoming" Request PayLoad(s)
void poulateKnownTags(EXTREQ_OP _opCode, ReqPayLoad& _inPayLoad) {
if ((kRead_refdata == _opCode) ||
(kReadActivate_refdata == _opCode)) {
_inPayLoad.m_knownTAGs.push_back(PAYLOAD_TAGS::REQ_RDCSV_LOCATION);
_inPayLoad.m_knownTAGs.push_back(PAYLOAD_TAGS::REQ_RDCSV_FILENAME);
return;
}
if ((kDrop_refdata == _opCode) ||
(kActivate_refdata == _opCode)) {
_inPayLoad.m_knownTAGs.push_back(PAYLOAD_TAGS::REQ_RDTYPE);
_inPayLoad.m_knownTAGs.push_back(PAYLOAD_TAGS::REQ_RDTIMESTAMP);
return;
}
throw xtreme::XtremeException(
"XML Payload format NOT DEFINED for this operation",
xtreme::kWrongXmlFormat);
}
bool ReqPayLoad::parseReq(std::string strHttpPayload) {
boost::property_tree::ptree root;
std::stringstream ssReq(strHttpPayload);
boost::property_tree::xml_parser::read_xml(ssReq, root);
// boost::property_tree::ptree &ptReq = root.get_child(PAYLOAD_TAGS::REQ);
try {
std::string strOP = root.get < std::string > (PAYLOAD_TAGS::REQ_OP);
m_opCode = getOpCode(strOP);
if (kUnknownOp == m_opCode) {
LOG4CXX_ERROR(logger_xmlpload,
"Unknown Operation (Not Supported) ... ["
<< strHttpPayload << "]");
return false;
}
// Retrieve Session token for checking permissions (later)
m_sessTok = root.get < std::string > (PAYLOAD_TAGS::REQ_SESSION_TOKEN);
// Define relevant TAGs for current opCode
poulateKnownTags(m_opCode, *this);
// Retrieve values for known TAGs
BOOST_FOREACH(const std::string& _tagName, m_knownTAGs) {
std::string _tagValue = root.get<std::string> (_tagName);
m_tagValues[_tagName] = _tagValue;
LOG4CXX_TRACE(logger_xmlpload,
"Req: [" << _tagName << "] = ["
<< _tagValue << "]");
}
} catch(std::exception& ex) {
LOG4CXX_ERROR(logger_xmlpload,
"Invalid/Incomplete XML Request Payload: " << ex.what() << " ... ["
<< strHttpPayload << "]");
return false;
}
return true;
}
std::string ReqPayLoad::getStringVal(const std::string& PAYLOAD_TAG_Name) {
try {
std::string _val = m_tagValues.at(PAYLOAD_TAG_Name);
return _val;
} catch(...) {
throw xtreme::XtremeException(
"XML Payload does not contain information for, " + PAYLOAD_TAG_Name,
xtreme::kWrongXmlFormat);
}
}
std::string ReqPayLoad::renderReq() {
std::string _xmlStr("");
boost::property_tree::ptree ptreeReq;
std::stringstream ssBuf;
ptreeReq.add(PAYLOAD_TAGS::REQ_CAT, CAT_IN_EXTERNAL_REQ_REFDATA);
ptreeReq.add(PAYLOAD_TAGS::REQ_OP, getOpStr(m_opCode));
ptreeReq.add(PAYLOAD_TAGS::REQ_SESSION_TOKEN, m_sessTok);
BOOST_FOREACH(const std::string& _tag, m_knownTAGs) {
ptreeReq.add(_tag, m_tagValues[_tag]);
}
write_xml(ssBuf, ptreeReq);
_xmlStr = ssBuf.str();
LOG4CXX_DEBUG(logger_xmlpload,
"OutPayLoad::renderReq() ... ["
<< _xmlStr << "]");
return _xmlStr;
}
void ReqPayLoad::setStringVal(const std::string& PAYLOAD_TAG_Name,
const std::string& PAYLOAD_TAG_Val) {
if (m_knownTAGs.end()
== std::find(m_knownTAGs.begin(), m_knownTAGs.end(),
PAYLOAD_TAG_Name))
m_knownTAGs.push_back(PAYLOAD_TAG_Name);
m_tagValues[PAYLOAD_TAG_Name] = PAYLOAD_TAG_Val;
}
bool RespPayLoad::parseResp(std::string strHttpPayload) {
boost::property_tree::ptree root;
std::stringstream ssResp(strHttpPayload);
boost::property_tree::xml_parser::read_xml(ssResp, root);
std::string resCodeStr = root.get < std::string
> (PAYLOAD_TAGS::RESP_RESCODE);
m_resultCode = StringToNum<uint32_t>(resCodeStr.c_str(),
xtreme::KUndefined);
// TODO(Later): Code to parse incoming response XMLs into
// m_knownTAGs & m_tagValues, for known ops
// boost::property_tree::ptree &ptReq = root.get_child(PAYLOAD_TAGS::RESP);
return true;
}
}
} // end of namespace xtreme
| 35.936842 | 95 | 0.650996 | jia57196 |