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
109
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
48.5k
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
1b803621efe045366886c0a1b59f2ed773f422a0
574
cpp
C++
simple-functions-no-ec/main.cpp
masterl/input-studies
d713cb69ca196e9e2606f35ed385c4ba87b26e5c
[ "MIT" ]
null
null
null
simple-functions-no-ec/main.cpp
masterl/input-studies
d713cb69ca196e9e2606f35ed385c4ba87b26e5c
[ "MIT" ]
null
null
null
simple-functions-no-ec/main.cpp
masterl/input-studies
d713cb69ca196e9e2606f35ed385c4ba87b26e5c
[ "MIT" ]
null
null
null
#include <iostream> #include <sstream> #include <string> std::string read_line(); int read_integer(); int main() { int number; std::string user_input; std::cout << "Input a number: "; number = read_integer(); std::cout << "\nYou typed [" << number << "]" << std::endl; return 0; } std::string read_line() { std::string line; std::getline( std::cin, line ); return line; } int read_integer() { int value; std::string line = read_line(); std::istringstream stream( line ); stream >> value; return value; }
13.348837
63
0.587108
masterl
1b813949c2042cc6e45b8322514a5bc0bafb5b3e
190
cc
C++
src/cli_main.cc
jeresch/oonalysis
09b49dcd57616e56ff9abcd8989ef18be1489b9a
[ "BSD-Source-Code" ]
2
2019-01-02T12:06:32.000Z
2020-05-24T06:08:57.000Z
src/cli_main.cc
jeresch/oonalysis
09b49dcd57616e56ff9abcd8989ef18be1489b9a
[ "BSD-Source-Code" ]
null
null
null
src/cli_main.cc
jeresch/oonalysis
09b49dcd57616e56ff9abcd8989ef18be1489b9a
[ "BSD-Source-Code" ]
null
null
null
#include "cli/cli.h" extern "C" { #include "util/log.h" } int main(int argc, char** argv) { LOG(INFO, "Welcome to oonalysis"); oonalysis::cli::main_cli(argc, argv); return 0; }
17.272727
41
0.621053
jeresch
1b8482420c31b42c9add65105da57c73414dc212
1,593
hpp
C++
library/text/cpp/include/tetengo/text/grapheme_splitting/character_width.hpp
tetengo/tetengo
66e0d03635583c25be4320171f3cc1e7f40a56e6
[ "MIT" ]
null
null
null
library/text/cpp/include/tetengo/text/grapheme_splitting/character_width.hpp
tetengo/tetengo
66e0d03635583c25be4320171f3cc1e7f40a56e6
[ "MIT" ]
41
2021-06-25T14:20:29.000Z
2022-01-16T02:50:50.000Z
library/text/cpp/include/tetengo/text/grapheme_splitting/character_width.hpp
tetengo/tetengo
66e0d03635583c25be4320171f3cc1e7f40a56e6
[ "MIT" ]
null
null
null
/*! \file \brief A character width. Copyright (C) 2019-2022 kaoru https://www.tetengo.org/ */ #if !defined(TETENGO_TEXT_GRAPHEMESPLITTING_CHARACTERWIDTH_HPP) #define TETENGO_TEXT_GRAPHEMESPLITTING_CHARACTERWIDTH_HPP #include <cstddef> #include <boost/core/noncopyable.hpp> namespace tetengo::text::grapheme_splitting { /*! \brief A character width. */ class character_width : private boost::noncopyable { public: // types //! A class. enum class class_type { ambiguous, //!< Ambiguous. fullwidth, //!< Fullwidth. halfwidth, //!< Halfwidth. narrow, //!< Narrow. wide, //!< Wide. neutral, //!< Neutral. }; //! An emoji. enum class emoji_type { emoji, //!< Emoji character. normal, //!< Normal charactger. }; // constructors and destructor /*! \brief Destroys the character width. */ virtual ~character_width(); // functions /*! \brief Returns the width. \param class_ A class. \param emoji An emoji. \return The width of the code point. */ [[nodiscard]] std::size_t width_of(class_type class_, emoji_type emoji) const; private: // virtual functions virtual std::size_t width_of_impl(class_type class_, emoji_type emoji) const = 0; }; } #endif
20.960526
90
0.526051
tetengo
1b8987cb6145386e75379d6bbe0588eec6ee2d5d
5,693
hpp
C++
src/GL3Engine/Graphics/Texture.hpp
Mati365/Potato3D-Engine
bf683a7213716d17d61d0e53edb32469af5166eb
[ "Unlicense", "MIT" ]
null
null
null
src/GL3Engine/Graphics/Texture.hpp
Mati365/Potato3D-Engine
bf683a7213716d17d61d0e53edb32469af5166eb
[ "Unlicense", "MIT" ]
null
null
null
src/GL3Engine/Graphics/Texture.hpp
Mati365/Potato3D-Engine
bf683a7213716d17d61d0e53edb32469af5166eb
[ "Unlicense", "MIT" ]
null
null
null
#ifndef TEXTURE_HPP_ #define TEXTURE_HPP_ #include <SOIL/SOIL.h> #include "Types.hpp" namespace GL3Engine { namespace CoreMaterial { extern void putGLTextureFlags(GLenum, GLuint); struct TextureFlags { GLenum type; GLenum bytes; GLuint flags; GLenum tex_type; }; class Texture : public CoreInterface::NonCopyable { public: enum Flags { MIPMAP_NEAREST = 1 << 1, MIPMAP_LINEAR = 1 << 2, CLAMP = 1 << 3, CLAMP_TO_EDGE = 1 << 4, REPEAT = 1 << 5, LINEAR = 1 << 6, NEAREST = 1 << 7 }; static const TextureFlags default_tex_flags; protected: TextureFlags flags = default_tex_flags; GLuint handle = 0; CoreMatrix::Vec2i size; public: Texture() { } Texture(c_str, const TextureFlags& _flags = default_tex_flags); Texture(const TextureFlags&); Texture(const CoreMatrix::Vec2i&, const TextureFlags& _flags = default_tex_flags); virtual void loadTexture(c_str); virtual void generate(const CoreMatrix::Vec2i&); const TextureFlags& getTexFlags() const { return flags; } GLuint getHandle() const { return handle; } const CoreMatrix::Vec2i& getSize() const { return size; } virtual ~Texture() { glDeleteTextures(1, &handle); } protected: virtual void configure(); }; class CubeTexture : public Texture { public: static constexpr GLuint CUBE_TEX_FACES = 6; public: CubeTexture(const CoreMatrix::Vec2i&, const TextureFlags& _flags = Texture::default_tex_flags); void generate(const CoreMatrix::Vec2i&) override; private: // TODO: Wczytywanie paczki tekstur void loadTexture(c_str) override { } }; using PathList = std::vector<std::string>; class TextureArray : public CoreInterface::NonCopyable { private: GLuint handle = 0; PathList textures; TextureFlags flags = Texture::default_tex_flags; public: TextureArray() { } TextureArray(const PathList&, const TextureFlags& _flags = Texture::default_tex_flags); void create(); TextureArray& addTexture(c_str str) { textures.push_back(str); return *this; } GLuint getHandle() const { return handle; } const TextureFlags& getTexFlags() const { return flags; } ~TextureArray() { glDeleteTextures(1, &handle); } }; /** Podzielone jako TRIANGLE!!! */ using TileIterator = std::vector<CoreType::Vertex2f>::const_iterator; class Tile { public: static const GLushort quad_indices[6]; protected: Texture* tex; CoreMatrix::Vec2i cells; CoreMatrix::Vec2 cell_size; std::vector<CoreType::Vertex2f> uv; public: Tile(Texture*, const CoreMatrix::Vec2i&); const CoreMatrix::Vec2i& getCells() const { return cells; } const CoreMatrix::Vec2& getCellSize() const { return cell_size; } GLuint getHandle() const { return tex->getHandle(); } const CoreMatrix::Vec2i& getSize() const { return tex->getSize(); } const Texture* getTexture() const { return tex; } private: void tokenize(); }; /** Zwraca tablice bo Material nie * sklada sie tylko z danych dla glsl */ using MaterialBufferData = std::array<GLfloat, 16>; struct Material : public CoreInterface::NonCopyable { enum TEX_TYPE { AMBIENT, DIFFUSE, SPECULAR, ALPHA, BUMP, BILLBOARD }; std::string name = ""; GLfloat transparent = 1.f, shine = 1.f; CoreType::Color col[SPECULAR + 1] = { { 0.f, 0.f, 0.f, 1.f }, { 0.f, 0.f, 0.f, 1.f }, { 0.f, 0.f, 0.f, 1.f } }; GLuint tex_flags = 0; std::shared_ptr<TextureArray> tex_array = std::shared_ptr < TextureArray > (new TextureArray); MaterialBufferData getMaterialBufferData() const; }; using Materials = std::vector<Material*>; } } #endif
30.607527
81
0.436325
Mati365
b842f440de57c2f990b04c6041f743dc33fde7a6
12,178
cpp
C++
high-precision-anticyclic-fft/src/bench_fft_mpfr.cpp
tfhe/experimental-tfhe
248ee1fd69e4344d19026371dec251c6ab28edfc
[ "Apache-2.0" ]
15
2017-08-13T01:43:58.000Z
2021-09-10T08:56:16.000Z
high-precision-anticyclic-fft/src/bench_fft_mpfr.cpp
tfhe/experimental-tfhe
248ee1fd69e4344d19026371dec251c6ab28edfc
[ "Apache-2.0" ]
null
null
null
high-precision-anticyclic-fft/src/bench_fft_mpfr.cpp
tfhe/experimental-tfhe
248ee1fd69e4344d19026371dec251c6ab28edfc
[ "Apache-2.0" ]
1
2018-02-08T01:09:00.000Z
2018-02-08T01:09:00.000Z
#include <complex> #include <iostream> #include <cstdint> #include <vector> #include <cassert> #include <random> #include <gmpxx.h> #include <mpfr.h> using namespace std; typedef int64_t Torus64; typedef int32_t Torus32; #ifndef ALPHA_BITS const int ALPHA_BITS = 60; #endif const int MIN_N = 1000*ALPHA_BITS/35; const int LOG2N = int(ceil(log(MIN_N)/log(2.))); const int N = 1<<LOG2N; const int FPREC = ALPHA_BITS+4; const int IPREC = FPREC/2; struct Real96 { mpfr_t v; Real96() { mpfr_init2(v,FPREC+IPREC); mpfr_set_ui(v,0,MPFR_RNDN); } Real96(const Real96& r) { mpfr_init2(v,FPREC+IPREC); mpfr_set(v,r.v,MPFR_RNDN); } void operator=(const Real96& r) { mpfr_set(v,r.v,MPFR_RNDN); } ~Real96() { mpfr_clear(v); } }; void add(Real96& dest, const Real96& a, const Real96& b) { mpfr_add(dest.v,a.v,b.v,MPFR_RNDN); } void sub(Real96& dest, const Real96& a, const Real96& b) { mpfr_sub(dest.v,a.v,b.v,MPFR_RNDN); } void neg(Real96& dest, const Real96& a) { mpfr_neg(dest.v,a.v,MPFR_RNDN); } void extmul(Real96& dest, int a, const Real96& b) { mpfr_mul_si(dest.v,b.v,a,MPFR_RNDN); } void intmul(Real96& dest, const Real96& a, const Real96& b) { mpfr_mul(dest.v,a.v,b.v,MPFR_RNDN); } void div2ui(Real96& dest, const Real96& a, uint64_t b) { mpfr_div_2ui(dest.v,a.v,b,MPFR_RNDN); } Real96 t64tor96(Torus64 v) { Real96 reps; int64_t vv = v; mpfr_set_si(reps.v, vv, MPFR_RNDN); mpfr_div_2ui(reps.v, reps.v, 64, MPFR_RNDN); return reps; } Real96 dtor96(double d) { Real96 reps; mpfr_set_d(reps.v, d, MPFR_RNDN); return reps; } //auto-deduced operators Real96 operator+(const Real96& a, const Real96& b) { Real96 reps; add(reps,a,b); return reps; } void operator+=(Real96& a, const Real96& b) { add(a,a,b); } Real96 operator-(const Real96& a, const Real96& b) { Real96 reps; sub(reps,a,b); return reps; } void operator-=(Real96& a, const Real96& b) { sub(a,a,b); } Real96 operator-(const Real96& a) { Real96 reps; neg(reps,a); return reps; } Real96 operator*(int a, const Real96& b) { Real96 reps; extmul(reps,a,b); return reps; } void operator*=(Real96& b, int a) { extmul(b,a,b); } Real96 operator*(const Real96& a, const Real96& b) { Real96 reps; intmul(reps,a,b); return reps; } void operator*=(Real96& a, const Real96& b) { intmul(a,a,b); } double r96tod(const Real96& r) { return mpfr_get_d(r.v, MPFR_RNDN); } ostream& operator<<(ostream& out, const Real96& r) { out << "[" << r96tod(r) << "]"; return out; } bool very_close(const Real96& a,const Real96& b) { double dist = abs(r96tod(a-b)); bool reps = dist<1e-4; if (!reps) { cerr << "not close: " << a << " vs. " << b << endl; } return reps; } //----------------------------------------------------------------------- using Cplx96=std::complex<Real96>; //----------------------------------------------------------------------- Real96 accurate_cos(int i,int n) { //cos(2pi*i/n) Real96 reps; mpfr_t res; mpfr_init2(res,FPREC+1); i = ((i%n) + n)%n; mpfr_const_pi (res, MPFR_RNDN); mpfr_mul_si(res,res,2*i,MPFR_RNDN); mpfr_div_si(res,res,n,MPFR_RNDN); mpfr_cos(reps.v, res, MPFR_RNDN); return reps; } Real96 accurate_sin(int i,int n) { //sin(2pi*i/n) Real96 reps; mpfr_t res; mpfr_init2(res,FPREC+1); i = ((i%n) + n)%n; mpfr_const_pi (res, MPFR_RNDN); mpfr_mul_si(res,res,2*i,MPFR_RNDN); mpfr_div_si(res,res,n,MPFR_RNDN); mpfr_sin(reps.v, res, MPFR_RNDN); return reps; } //reverse the bits of i (mod n) int rev(int i, int n) { int reps=0; for (int j=1; j<n; j*=2) { reps = 2*reps + (i%2); i/=2; } return reps; } bool very_close(const Cplx96& a,const Cplx96& b) { bool reps = (very_close(a.real(),b.real()) && very_close(a.imag(),b.imag())); if (!reps) { cerr << "not close: " << a << " vs. " << b << endl; } return reps; } // FFT from Torus64^N to Cplx96^(N/2) mod X^N+1 // N = 2048 (note: n=2N ici) //at the beginning of iteration nn // a_{j,i} has P_{i%nn}(omega^j) // where j between [rev(1) and rev(3)[ // and i between [0 and nn[ void ifft_check(int n, int nn, const Cplx96* acur, const vector<Real96>& a, const vector<Cplx96>& powomega) { int ns4=n/4; cerr << "Checking iteration " << nn << endl; for (int i=0; i<ns4; i++) { cout << "i: " << i << " " << acur[i] << endl; } int m = n/nn; int rev1m = rev(1,m); int rev3m = rev(3,m); int idex = 0; for (int revj=rev1m; revj<rev3m; revj++) { int j = rev(revj,m); cerr << "check-- j: " << j << endl; for (int i=0; i<nn; i++) { cerr << "check--- i: " << i << "(mod " << nn << ")" << endl; const Cplx96& test_cur = acur[idex]; //sum_[t=i%nn] a_t omega^jt Cplx96 pij(t64tor96(0),t64tor96(0)); for (int k=i; k<n; k+=nn) { cout << "a_"<<k<<": " << a[k] << endl; pij += a[k] * powomega[(k*j) % n]; } assert(very_close(test_cur,pij)); idex++; } } } //at the beginning of iteration halfnn: // m=n/halfnn // P_{j%m}(omb^i) // for j in [rev(1,m) to rev(3,m)[ // and i in [0,halfnn[ void fft_check( int n, int halfnn, const Cplx96* pcur, const vector<Cplx96>& p, const vector<Cplx96>& powombar ) { int ns4=n/4; cerr << "DIRECT FFT: Checking iteration " << halfnn << endl; for (int i=0; i<ns4; i++) { cout << "i: " << i << " " << pcur[i] << endl; } int m = n/halfnn; int rev1m = rev(1,m); int rev3m = rev(3,m); int idex = 0; for (int revj=rev1m; revj<rev3m; revj++) { int j = rev(revj,m); cerr << "check-- j: " << j << "(mod " << m << ")" << endl; for (int i=0; i<halfnn; i++) { cerr << "check--- i: " << i << endl; //P_sum_[k=j%m] p_k omb^ik-j Cplx96 pij(t64tor96(0),t64tor96(0)); for (int k=j; k<n; k+=m) { //if (halfnn==8 && j==1 && i==1) cerr << "pij(" << pij << ")" << "+= p_"<<k<<"("<<p[k]<<") * omb["<<i*(k-j)<<"]("<< powombar[(i*(k-j)) % n] <<")" << endl; pij += p[k] * powombar[(i*(k-j)) % n]; } assert(very_close(pcur[idex],pij)); idex++; } } } void precomp_iFFT(vector<Cplx96>& powomega, int n) { powomega.resize(n); for (int i=0; i<n; i++) powomega[i]=Cplx96(accurate_cos(i,n),accurate_sin(i,n)); } void precomp_FFT(vector<Cplx96>& powombar, int n) { powombar.resize(n); for (int i=0; i<n; i++) powombar[i]=Cplx96(accurate_cos(i,n),accurate_sin((n-i)%n,n)); } // P -> P(omega) void iFFT(Cplx96* out, const Real96* in, int n, const vector<Cplx96>& powomega) { //const int N = n/2; const int ns4 = n/4; #ifndef NDEBUG vector<Real96> a; a.resize(n); for (int i=0; i<n/2; i++) div2ui(a[i],in[i],1); for (int i=0; i<n/2; i++) a[n/2+i]=-a[i]; #endif //interpret the input coefs as real and imaginary parts: //RRRRRRRRRRIIIIIIIII //multiply by omega^j for (int j=0; j<ns4; j++) out[j] = Cplx96(in[j],in[j+ns4])*powomega[j]; //at the beginning of iteration nn // a_{j,i} has P_{i%nn}(omega^j) // where j between [rev(1) and rev(3)[ // and i between [0 and nn[ for (int nn=ns4; nn>=2; nn/=2) { int halfnn = nn/2; #ifndef NDEBUG cerr << "Starting iteration " << nn << endl; int m = n/nn; ifft_check(n, nn, out, a, powomega); #endif for (int block=0; block<ns4; block+=nn) { #ifndef NDEBUG int j = rev(rev(1,m)+block,m); cerr << "-- block j: " << j << " --> " << j << "," << j+halfnn/2 << endl; #endif for (int off=0; off<halfnn; off++) { #ifndef NDEBUG cerr << "--- i: " << off << " using: omg^" << (2*(ns4/halfnn)*off)%n << endl; #endif Cplx96 t1 = out[block+off]; Cplx96 t2 = out[block+off+halfnn]; out[block+off]=t1+t2; out[block+off+halfnn]=(t1-t2)*powomega[(2*(ns4/halfnn)*off)%n]; } } } { #ifndef NDEBUG int nn = 1; ifft_check(n, nn, out, a, powomega); #endif } } // P(omega) -> P void FFT(Real96* out, Cplx96* in, int n, const vector<Cplx96>& powombar) { //const int N = n/2; const int ns4 = n/4; #ifndef NDEBUG vector<Cplx96> a; a.resize(n); for (int i=0; i<n; i++) a[i]=Cplx96(t64tor96(0),t64tor96(0)); int rev1m = rev(1,n); int rev3m = rev(3,n); for (int revj=rev1m; revj<rev3m; revj++) { int j = rev(revj,n); cout << "assign:" << j << " " << revj-rev1m << endl; a[j]=in[revj-rev1m]; a[n-j]=Cplx96(a[j].real(),-a[j].imag()); } #endif #ifndef NDEBUG cerr << "Checking iteration 1" << endl; fft_check(n, 1, in, a, powombar); #endif //at the beginning of iteration nn // a_{j,i} has P_{i%nn}(omega^j) // where j between [rev(1) and rev(3)[ // and i between [0 and nn[ for (int nn=2; nn<=ns4; nn*=2) { int halfnn = nn/2; for (int block=0; block<ns4; block+=nn) { //#ifndef NDEBUG // int j = rev(rev(1,m)+block,m); // cerr << "-- block j: " << j << " --> " << j << "," << j+halfnn/2 << endl; //#endif for (int off=0; off<halfnn; off++) { //#ifndef NDEBUG // cerr << "--- i: " << off << " using: omg^" << (2*(ns4/halfnn)*off)%n << endl; //#endif Cplx96 t1 = in[block+off]; Cplx96 t2 = in[block+off+halfnn]*powombar[(2*(ns4/halfnn)*off)%n]; in[block+off]=t1+t2; in[block+off+halfnn]=(t1-t2); } } #ifndef NDEBUG cerr << "Ending iteration " << nn << endl; fft_check(n, nn, in, a, powombar); #endif } //interpret the input coefs as real and imaginary parts: //RRRRRRRRRRIIIIIIIII //multiply by omega^j for (int j=0; j<ns4; j++) { in[j] *= powombar[j]; div2ui(out[j], in[j].real(), LOG2N-1); // /ns4; //divide by N/2 div2ui(out[j+ns4], in[j].imag(), LOG2N-1); // /ns4; //divide by N/2 } { //#ifndef NDEBUG // int nn = 1; // ifft_check(n, nn, out, a, powomega); //#endif } } int main(int argc, char** argv) { const int Ns2 = N/2; #ifndef NDEBUG const int NBTRIALS=1; #else const int NBTRIALS=100; #endif #ifndef NDEBUG cout << "trigo_test" << endl; //test cosinus for (int i=0; i<=2*N; i++) { //if (i!=1024) continue; Real96 c = accurate_cos(i,2*N); Real96 s = accurate_sin(i,2*N); Real96 t = c*c+s*s; if (!very_close(t, dtor96(1))) { cout << "i: " << i << ", " << cos(2*i*M_PI/64.) << endl; cout << "c " << c << endl; cout << "s " << s << endl; cout << "c*c " << c*c << endl; cout << "s*s " << s*s << endl; cout << "cos test" << i << ":" << t << endl; assert(false ); } } cout << "...passed!" << endl; #endif //test de la IFFT Cplx96 out[Ns2]; Real96 in[N]; Real96 revout[N]; vector<Cplx96> powomega; vector<Cplx96> powombar; std::default_random_engine generator; std::uniform_int_distribution<Torus64> distribution(numeric_limits<Torus64>::min(),numeric_limits<Torus64>::max()); for (int i=0; i<N; i++) { in[i]=t64tor96(distribution(generator)); } precomp_iFFT(powomega,2*N); precomp_FFT(powombar,2*N); #ifndef NDEBUG //test powomega cout << "powomega_test" << endl; for (int i=0; i<2*N; i++) { //if (i!=1024) continue; //cout << "powomega: " << i << " : " << powomega[i] << endl; assert(very_close(powomega[i]*powomega[(2*N-i)%(2*N)],Cplx96(dtor96(1)))); assert(very_close(powomega[i]*powombar[i],Cplx96(dtor96(1)))); } cout << "...passed!" << endl; #endif clock_t t0 = clock(); for (int i=0; i<NBTRIALS; i++) iFFT(out,in,2*N,powomega); clock_t t1 = clock(); for (int i=0; i<NBTRIALS; i++) FFT(revout,out,2*N,powombar); clock_t t2 = clock(); #ifndef NDEBUG for (int i=0; i<N; i++) cout << hex << revout[i] << " "<< in[i] << " " << (revout[i]-in[i]) << endl; #endif cerr << "ALPHA_BITS: " << ALPHA_BITS << endl; cerr << "MIN_N: " << MIN_N << endl; cerr << "LOG2N: " << LOG2N << endl; cerr << "N: " << N << endl; cerr << "FPREC: " << FPREC << endl; cerr << "IPREC: " << IPREC << endl; cerr << "time_IFFT: " << (t1-t0)/double(NBTRIALS) << " mus" << endl; cerr << "time_FFT: " << (t2-t1)/double(NBTRIALS) << " mus" << endl; printf("%d %d %d %d %d %d %lf %lf\n",ALPHA_BITS,MIN_N,LOG2N,N,FPREC,IPREC,(t1-t0)/double(NBTRIALS),(t2-t1)/double(NBTRIALS)); }
25.318087
157
0.558712
tfhe
b843d7d12819e48802975de313149d93dbedb6cc
308
cpp
C++
Passing_Arg_P.cpp
sinarashidiazar/cpp
97ff3b6821efb3857b7a1a4cc24a6294e7279e75
[ "MIT" ]
null
null
null
Passing_Arg_P.cpp
sinarashidiazar/cpp
97ff3b6821efb3857b7a1a4cc24a6294e7279e75
[ "MIT" ]
null
null
null
Passing_Arg_P.cpp
sinarashidiazar/cpp
97ff3b6821efb3857b7a1a4cc24a6294e7279e75
[ "MIT" ]
null
null
null
// PASSING ARGUMENTS THROUGH POINTERS #include <iostream> #include <conio.h> using namespace std; void f(int *); main() { int a=2; f(&a); cout<<a; //5 getch(); } void f(int *n) { *n=*n+3; } /* main() { int a=2; f(a); cout<<a; //5 getch(); } void f(int &n) { n=n+3; } */
7.512195
38
0.493506
sinarashidiazar
b84463e5c7a059f32238d831a304570db5df1e7b
495
cpp
C++
src/0078.cpp
shuihan0555/LeetCode-Solutions-in-Cpp17
8bb69fc546486c5e73839431204927626601dd18
[ "MIT" ]
null
null
null
src/0078.cpp
shuihan0555/LeetCode-Solutions-in-Cpp17
8bb69fc546486c5e73839431204927626601dd18
[ "MIT" ]
null
null
null
src/0078.cpp
shuihan0555/LeetCode-Solutions-in-Cpp17
8bb69fc546486c5e73839431204927626601dd18
[ "MIT" ]
null
null
null
class Solution { public: vector<vector<int>> subsets(vector<int>& nums) { vector<vector<int>> res; vector<int> tmp; dfs(res, tmp, nums, 0); return res; } void dfs(vector<vector<int>>& res, vector<int>& tmp, vector<int>& nums, int n) { res.emplace_back(tmp); for (int i = n; i < size(nums); ++i) { tmp.emplace_back(nums[i]); dfs(res, tmp, nums, i + 1); tmp.pop_back(); } } };
24.75
82
0.490909
shuihan0555
b844ab8f2e3ac093152c84bbd96f9db4b071c51c
325
cpp
C++
array.cpp
siddharthshenoy/LEET
130a7c526417ea9d1896553c8f048e248d4bba35
[ "MIT" ]
null
null
null
array.cpp
siddharthshenoy/LEET
130a7c526417ea9d1896553c8f048e248d4bba35
[ "MIT" ]
null
null
null
array.cpp
siddharthshenoy/LEET
130a7c526417ea9d1896553c8f048e248d4bba35
[ "MIT" ]
null
null
null
class Solution { public: int removeElement(vector<int>& nums, int val) { int i; for(i=0;i<nums.size();i++){ if(nums[i]==val){ swap(nums[i],nums[nums.size()-1]); nums.pop_back(); i=-1; } } return nums.size(); } };
21.666667
51
0.409231
siddharthshenoy
b848bb7b3559c79aafb7e54b2aedd6a6e5db6231
4,512
cpp
C++
Systems/Device.cpp
Excelsus4/TrexRunner
6b1bfdab63c7554c09072cc1b889de0e58415f49
[ "MIT" ]
null
null
null
Systems/Device.cpp
Excelsus4/TrexRunner
6b1bfdab63c7554c09072cc1b889de0e58415f49
[ "MIT" ]
null
null
null
Systems/Device.cpp
Excelsus4/TrexRunner
6b1bfdab63c7554c09072cc1b889de0e58415f49
[ "MIT" ]
null
null
null
#pragma once #include "stdafx.h" #include "Device.h" int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd) { InitWindow(hInstance, nShowCmd); InitDirect3D(hInstance); Running(); Destroy(); return 0; } HWND Hwnd = NULL; wstring Title = L"Draw Sprite"; IDXGISwapChain* SwapChain; ID3D11Device* Device; ID3D11DeviceContext* DeviceContext; ID3D11RenderTargetView* RTV; //ID3D11VertexShader* VertexShader; //ID3D11PixelShader* PixelShader; //ID3D10Blob* VsBlob; //ID3D10Blob* PsBlob; Keyboard* Key; void InitWindow(HINSTANCE hInstance, int ShowWnd) { //Register Class { WNDCLASSEX wndClass; wndClass.cbSize = sizeof(WNDCLASSEX); wndClass.style = CS_HREDRAW | CS_VREDRAW; wndClass.lpfnWndProc = WndProc; wndClass.cbClsExtra = NULL; wndClass.cbWndExtra = NULL; wndClass.hInstance = hInstance; wndClass.hIcon = LoadIcon(NULL, IDI_APPLICATION); wndClass.hCursor = LoadCursor(NULL, IDC_ARROW); wndClass.hbrBackground = (HBRUSH)(COLOR_WINDOW + 2); wndClass.lpszMenuName = NULL; wndClass.lpszClassName = Title.c_str(); wndClass.hIconSm = LoadIcon(NULL, IDI_APPLICATION); WORD check = RegisterClassEx(&wndClass); assert(check != 0); } //Create Handle { Hwnd = CreateWindowEx ( NULL, Title.c_str(), Title.c_str(), WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, Width, Height, NULL, NULL, hInstance, NULL ); assert(Hwnd != NULL); } RECT rect = { 0, 0, (LONG)Width, (LONG)Height }; UINT centerX = (GetSystemMetrics(SM_CXSCREEN) - (UINT)Width) / 2; UINT centerY = (GetSystemMetrics(SM_CYSCREEN) - (UINT)Height) / 2; AdjustWindowRect(&rect, WS_OVERLAPPEDWINDOW, FALSE); MoveWindow( Hwnd, centerX, centerY, rect.right - rect.left, rect.bottom - rect.top, TRUE ); ShowWindow(Hwnd, ShowWnd); UpdateWindow(Hwnd); } void InitDirect3D(HINSTANCE hInstance) { //Create Device and DeviceContext, SwapChain { DXGI_MODE_DESC bufferDesc; ZeroMemory(&bufferDesc, sizeof(DXGI_MODE_DESC)); bufferDesc.Width = Width; bufferDesc.Height = Height; bufferDesc.RefreshRate.Numerator = 60; bufferDesc.RefreshRate.Denominator = 1; bufferDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM; bufferDesc.ScanlineOrdering = DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED; bufferDesc.Scaling = DXGI_MODE_SCALING_UNSPECIFIED; DXGI_SWAP_CHAIN_DESC desc; ZeroMemory(&desc, sizeof(DXGI_SWAP_CHAIN_DESC)); desc.BufferDesc = bufferDesc; desc.SampleDesc.Count = 1; desc.SampleDesc.Quality = 0; desc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT; desc.BufferCount = 1; desc.OutputWindow = Hwnd; desc.Windowed = TRUE; desc.SwapEffect = DXGI_SWAP_EFFECT_DISCARD; HRESULT hr = D3D11CreateDeviceAndSwapChain ( NULL, D3D_DRIVER_TYPE_HARDWARE, NULL, NULL, NULL, NULL, D3D11_SDK_VERSION, &desc, &SwapChain, &Device, NULL, &DeviceContext ); assert(SUCCEEDED(hr)); } //Create BackBuffer { HRESULT hr; ID3D11Texture2D* BackBuffer; hr = SwapChain->GetBuffer(0, __uuidof(ID3D11Texture2D), (void**)&BackBuffer); assert(SUCCEEDED(hr)); hr = Device->CreateRenderTargetView(BackBuffer, NULL, &RTV); assert(SUCCEEDED(hr)); BackBuffer->Release(); DeviceContext->OMSetRenderTargets(1, &RTV, NULL); } //Create Viewport { D3D11_VIEWPORT viewport = { 0 }; viewport.TopLeftX = 0; viewport.TopLeftY = 0; viewport.Width = Width; viewport.Height = Height; DeviceContext->RSSetViewports(1, &viewport); } } void Destroy() { SwapChain->Release(); Device->Release(); DeviceContext->Release(); RTV->Release(); } WPARAM Running() { MSG msg; ZeroMemory(&msg, sizeof(MSG)); ImGui::Create(Hwnd, Device, DeviceContext); ImGui::StyleColorsDark(); Time::Create(); Time::Get()->Start(); Key = new Keyboard(); InitScene(); while (true) { if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) { if (msg.message == WM_QUIT) break; TranslateMessage(&msg); DispatchMessage(&msg); } else { Time::Get()->Update(); Update(); ImGui::Update(); Render(); } } DestroyScene(); delete Key; Time::Delete(); ImGui::Delete(); return msg.wParam; } LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { if(ImGui::WndProc((UINT*)hwnd, msg, wParam, lParam)) return true; switch (msg) { case WM_KEYDOWN: if (wParam == VK_ESCAPE) { DestroyWindow(hwnd); } return 0; case WM_DESTROY: PostQuitMessage(0); return 0; } return DefWindowProc(hwnd, msg, wParam, lParam); }
19.964602
95
0.706117
Excelsus4
b8496a25aaa6a44d87ea167c384c7cb261cb3d2c
2,248
hpp
C++
src/world/TextureInfoCollection.hpp
desktopgame/ofxPlanet
fe364e83f4c0ec0f169df63ce989a88ae6328c07
[ "BSD-2-Clause", "MIT" ]
3
2020-02-24T14:19:20.000Z
2021-05-17T11:25:07.000Z
src/world/TextureInfoCollection.hpp
desktopgame/ofxPlanet
fe364e83f4c0ec0f169df63ce989a88ae6328c07
[ "BSD-2-Clause", "MIT" ]
1
2020-02-25T09:20:34.000Z
2020-02-25T09:38:49.000Z
src/world/TextureInfoCollection.hpp
desktopgame/ofxPlanet
fe364e83f4c0ec0f169df63ce989a88ae6328c07
[ "BSD-2-Clause", "MIT" ]
1
2021-08-14T07:12:42.000Z
2021-08-14T07:12:42.000Z
#pragma once #ifndef WORLD_TEXTURECOLLECTIONINFO_HPP #define WORLD_TEXTURECOLLECTIONINFO_HPP #include <string> #include <vector> #include "Optional.hpp" namespace ofxPlanet { /** * TextureMappingRule is sides in block mapped texture. */ struct TextureMappingRule { explicit TextureMappingRule(); Optional<std::string> all, top, bottom, left, right, front, back; }; /** * TextureInfo is texture information for one blocks. */ struct TextureInfo { explicit TextureInfo(); std::string baseFileName; std::string reference; TextureMappingRule mappingRule; }; /** * TextureInfoCollection is collection of TextureInfo. */ class TextureInfoCollection { public: explicit TextureInfoCollection(const std::string& baseDirectory); explicit TextureInfoCollection(); /** * serialize as json. * @return */ std::string serialize() const; /** * deserialize from json. * @param json */ void deserialize(const std::string& json); /** * add TextureInfo. * @param textureInfo */ void addTextureInfo(const TextureInfo& textureInfo); /** * returns a TextureInfor from index. * @param index * @return */ TextureInfo getTextureInfo(int index) const; /** * return true if found TextureInfo from reference. * @param reference * @param outTextureInfo * @return */ bool tryGetTextureInfo(const std::string& reference, TextureInfo& outTextureInfo); /** * returns a count all TextureInfo. * @return */ int getTextureInfoCount() const; /** * returns a baseDirectory using for texture load. * @return */ std::string getBaseDirectory() const; /** * returns a baseDirectory as absolute path using for texture load. * @return */ std::string getBasePath() const; private: std::vector<TextureInfo> textureInfoVec; std::string baseDirectory; }; } // namespace ofxPlanet #endif
25.545455
75
0.585854
desktopgame
b84a9740cc8baff0def9813075bef61e37af9f25
494
cpp
C++
Solutions-to-Books/C++Primer/Chapter08/8.09.cpp
Horizon-Blue/playground
4bd42bfcec60b8e89e127f4784c99f6ba669d359
[ "MIT" ]
2
2016-08-31T19:13:24.000Z
2017-02-18T18:48:31.000Z
Solutions-to-Books/C++Primer/Chapter08/8.09.cpp
Horizon-Blue/playground
4bd42bfcec60b8e89e127f4784c99f6ba669d359
[ "MIT" ]
1
2018-12-10T16:32:26.000Z
2018-12-27T19:50:48.000Z
Solutions-to-Books/C++Primer/Chapter08/8.09.cpp
Horizon-Blue/playground
4bd42bfcec60b8e89e127f4784c99f6ba669d359
[ "MIT" ]
null
null
null
// Exercise 8.9 // Use the function you wrote for the first exercise in // Section 8.1.2 (p.314) to print the contents of an // istringstream object. // Xiaoyan Wang 3/25/2016 // Mostly copied from 8.2.cpp #include <iostream> #include <sstream> #include <string> using namespace std; istream& ifunc(istream& is) { string s; while(is >> s) cout << s << endl; is.clear(); return is; } int main() { string a = "apple is good."; istringstream iss(a); ifunc(iss); return 0; }
18.296296
55
0.653846
Horizon-Blue
b84c6b20e984cbe23d04fe7302a3ea6d153e22da
4,352
cpp
C++
src/Renderer.cpp
bashawhm/Clay
d34f10c26a1991655b1cc353b1e023988a7457bd
[ "MIT" ]
null
null
null
src/Renderer.cpp
bashawhm/Clay
d34f10c26a1991655b1cc353b1e023988a7457bd
[ "MIT" ]
null
null
null
src/Renderer.cpp
bashawhm/Clay
d34f10c26a1991655b1cc353b1e023988a7457bd
[ "MIT" ]
1
2019-08-05T01:43:16.000Z
2019-08-05T01:43:16.000Z
#include "Renderer.h" #include <cstdlib> #include <cmath> #include <iostream> #include <string> #include <sstream> #include <assert.h> #include "SDL2/SDL.h" #include "SDL2/SDL_image.h" #include "Texture.h" #include "RenderModel.h" #include "json.cpp" using json = nlohmann::json; using namespace std; #define WINDOW_WIDTH 640 #define WINDOW_HEIGHT 480 extern bool test; Renderer::Renderer() { if (!test) { win = SDL_CreateWindow("Clay", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, WINDOW_WIDTH, WINDOW_HEIGHT, SDL_WINDOW_RESIZABLE | SDL_WINDOW_ALLOW_HIGHDPI); rend = SDL_CreateRenderer(win, -1, SDL_RENDERER_PRESENTVSYNC); } winWidth = WINDOW_WIDTH; winHeight = WINDOW_HEIGHT; realWidth = -1; realHeight = -1; if (!test) { //Load Textures textures.clear(); for (unsigned long i = 0; i < texPaths.size(); ++i) { SDL_Surface *sur = IMG_Load(texPaths[i].c_str()); if (sur == NULL) { cerr << "Failed to open texture: " << texPaths[i] << endl; assert(0); } SDL_Texture *tex = SDL_CreateTextureFromSurface(rend, sur); textures.push_back(tex); SDL_FreeSurface(sur); } } } void Renderer::setRenderModels(vector<RenderModel> models) { renderables.clear(); for (unsigned long i = 0; i < models.size(); ++i) { renderables.push_back(models[i]); } } RenderModel Renderer::getFollowing() { for (unsigned long i = 0; i < renderables.size(); ++i) { if (renderables[i].following) { return renderables[i]; } } bool atLeastOneFollowing = false; assert(atLeastOneFollowing); return renderables[0]; } bool Renderer::isPointInRect(int rX, int rY, int x, int y, int w, int h) { if (rX >= x && rX <= (x+w) && rY >= y && rY <= (y+h)) { return true; } return false; } bool Renderer::isRectInRect(const SDL_Rect &r1, const SDL_Rect &r2) { if (r1.x < (r2.x + r2.w) && (r1.x + r1.w) > r2.x && r1.y < (r2.y + r2.h) && (r1.y + r1.h) > r2.y) { return true; } return false; } void Renderer::getDispRect(SDL_Rect *r) { //Get x and y coordinates of the begining of the display window as it //overlays onto the real rectangle. RenderModel player = getFollowing(); int dX = player.rRect.x - (int)round((float)winWidth / 2.0); int dY = player.rRect.y - (int)round((float)winHeight / 2.0); r->x = dX; r->y = dY; r->w = winWidth; r->h = winHeight; } void Renderer::setRenderableDispCoords(int idx) { //Get x and y coordinates of the begining of the display window as it //overlays onto the real rectangle. RenderModel player = getFollowing(); int dX = player.rRect.x - (int)round((float)winWidth / 2.0); int dY = player.rRect.y - (int)round((float)winHeight / 2.0); renderables[idx].dRect.x = (renderables[idx].rRect.x - dX); renderables[idx].dRect.y = (renderables[idx].rRect.y - dY); } void Renderer::renderDraw() { SDL_RenderClear(rend); SDL_GetWindowSize(win, &winWidth, &winHeight); SDL_Rect dispRect; getDispRect(&dispRect); //There is an issue with the following code with regards to entities not rendering until //they are within the initial 640 x 480, even though they should be rendered the whole time // cerr << "---------------------------------------------------" << endl; // cerr << "x: " << dispRect.x << " y: " << dispRect.y << " w: " << dispRect.w << " h: " << dispRect.h << endl; for (unsigned long i = 0; i < renderables.size(); ++i) { // cerr << "x: " << renderables[i].rRect.x << " y: " << renderables[i].rRect.y << " w: " << renderables[i].rRect.w << " h: " << renderables[i].rRect.h; // if (isRectInRect(renderables[i].rRect, dispRect)) { setRenderableDispCoords(i); SDL_RenderCopy(rend, textures[renderables[i].tex], NULL, &(renderables[i].dRect)); // } } SDL_RenderPresent(rend); } string Renderer::serialize() { json j = { {"realWidth", realWidth}, {"realHeight", realHeight}, }; return j.dump(); } void Renderer::deserialize(string in) { json j; j = json::parse(in); realWidth = j["realWidth"]; realHeight = j["realHeight"]; }
29.605442
167
0.596507
bashawhm
b85293857ab5daecf290dc9c27ba52360bc4c690
7,816
cpp
C++
src/Native/gc/softwarewritewatch.cpp
lambdageek/corert
11136ad55767485063226be08cfbd32ed574ca43
[ "MIT" ]
9
2018-02-28T14:24:42.000Z
2021-07-07T13:12:15.000Z
src/Native/gc/softwarewritewatch.cpp
lambdageek/corert
11136ad55767485063226be08cfbd32ed574ca43
[ "MIT" ]
8
2016-12-02T10:22:20.000Z
2020-10-08T15:06:17.000Z
src/Native/gc/softwarewritewatch.cpp
lambdageek/corert
11136ad55767485063226be08cfbd32ed574ca43
[ "MIT" ]
23
2017-06-05T16:21:58.000Z
2022-01-31T11:01:47.000Z
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. #include "common.h" #include "gcenv.h" #include "env/gcenv.os.h" #include "softwarewritewatch.h" #ifdef FEATURE_USE_SOFTWARE_WRITE_WATCH_FOR_GC_HEAP #ifndef DACCESS_COMPILE static_assert((static_cast<size_t>(1) << SOFTWARE_WRITE_WATCH_AddressToTableByteIndexShift) == OS_PAGE_SIZE, "Unexpected OS_PAGE_SIZE"); extern "C" { uint8_t *g_gc_sw_ww_table = nullptr; bool g_gc_sw_ww_enabled_for_gc_heap = false; } void SoftwareWriteWatch::StaticClose() { if (GetTable() == nullptr) { return; } g_gc_sw_ww_enabled_for_gc_heap = false; g_gc_sw_ww_table = nullptr; } bool SoftwareWriteWatch::GetDirtyFromBlock( uint8_t *block, uint8_t *firstPageAddressInBlock, size_t startByteIndex, size_t endByteIndex, void **dirtyPages, size_t *dirtyPageIndexRef, size_t dirtyPageCount, bool clearDirty) { assert(block != nullptr); assert(ALIGN_DOWN(block, sizeof(size_t)) == block); assert(firstPageAddressInBlock == reinterpret_cast<uint8_t *>(GetPageAddress(block - GetTable()))); assert(startByteIndex < endByteIndex); assert(endByteIndex <= sizeof(size_t)); assert(dirtyPages != nullptr); assert(dirtyPageIndexRef != nullptr); size_t &dirtyPageIndex = *dirtyPageIndexRef; assert(dirtyPageIndex < dirtyPageCount); size_t dirtyBytes = *reinterpret_cast<size_t *>(block); if (dirtyBytes == 0) { return true; } if (startByteIndex != 0) { size_t numLowBitsToClear = startByteIndex * 8; dirtyBytes >>= numLowBitsToClear; dirtyBytes <<= numLowBitsToClear; } if (endByteIndex != sizeof(size_t)) { size_t numHighBitsToClear = (sizeof(size_t) - endByteIndex) * 8; dirtyBytes <<= numHighBitsToClear; dirtyBytes >>= numHighBitsToClear; } while (dirtyBytes != 0) { DWORD bitIndex; static_assert(sizeof(size_t) <= 8, "Unexpected sizeof(size_t)"); if (sizeof(size_t) == 8) { BitScanForward64(&bitIndex, static_cast<DWORD64>(dirtyBytes)); } else { BitScanForward(&bitIndex, static_cast<DWORD>(dirtyBytes)); } // Each byte is only ever set to 0 or 0xff assert(bitIndex % 8 == 0); size_t byteMask = static_cast<size_t>(0xff) << bitIndex; assert((dirtyBytes & byteMask) == byteMask); dirtyBytes ^= byteMask; DWORD byteIndex = bitIndex / 8; if (clearDirty) { // Clear only the bytes for which pages are recorded as dirty block[byteIndex] = 0; } void *pageAddress = firstPageAddressInBlock + byteIndex * OS_PAGE_SIZE; assert(pageAddress >= GetHeapStartAddress()); assert(pageAddress < GetHeapEndAddress()); assert(dirtyPageIndex < dirtyPageCount); dirtyPages[dirtyPageIndex] = pageAddress; ++dirtyPageIndex; if (dirtyPageIndex == dirtyPageCount) { return false; } } return true; } void SoftwareWriteWatch::GetDirty( void *baseAddress, size_t regionByteSize, void **dirtyPages, size_t *dirtyPageCountRef, bool clearDirty, bool isRuntimeSuspended) { VerifyCreated(); VerifyMemoryRegion(baseAddress, regionByteSize); assert(dirtyPages != nullptr); assert(dirtyPageCountRef != nullptr); size_t dirtyPageCount = *dirtyPageCountRef; if (dirtyPageCount == 0) { return; } if (!isRuntimeSuspended) { // When a page is marked as dirty, a memory barrier is not issued after the write most of the time. Issue a memory // barrier on all active threads of the process now to make recent changes to dirty state visible to this thread. GCToOSInterface::FlushProcessWriteBuffers(); } uint8_t *tableRegionStart; size_t tableRegionByteSize; TranslateToTableRegion(baseAddress, regionByteSize, &tableRegionStart, &tableRegionByteSize); uint8_t *tableRegionEnd = tableRegionStart + tableRegionByteSize; uint8_t *blockStart = ALIGN_DOWN(tableRegionStart, sizeof(size_t)); assert(blockStart >= GetUntranslatedTable()); uint8_t *blockEnd = ALIGN_UP(tableRegionEnd, sizeof(size_t)); assert(blockEnd <= GetUntranslatedTableEnd()); uint8_t *fullBlockEnd = ALIGN_DOWN(tableRegionEnd, sizeof(size_t)); size_t dirtyPageIndex = 0; uint8_t *currentBlock = blockStart; uint8_t *firstPageAddressInCurrentBlock = reinterpret_cast<uint8_t *>(GetPageAddress(currentBlock - GetTable())); do { if (blockStart == fullBlockEnd) { if (GetDirtyFromBlock( currentBlock, firstPageAddressInCurrentBlock, tableRegionStart - blockStart, tableRegionEnd - fullBlockEnd, dirtyPages, &dirtyPageIndex, dirtyPageCount, clearDirty)) { *dirtyPageCountRef = dirtyPageIndex; } break; } if (tableRegionStart != blockStart) { if (!GetDirtyFromBlock( currentBlock, firstPageAddressInCurrentBlock, tableRegionStart - blockStart, sizeof(size_t), dirtyPages, &dirtyPageIndex, dirtyPageCount, clearDirty)) { break; } currentBlock += sizeof(size_t); firstPageAddressInCurrentBlock += sizeof(size_t) * OS_PAGE_SIZE; } while (currentBlock < fullBlockEnd) { if (!GetDirtyFromBlock( currentBlock, firstPageAddressInCurrentBlock, 0, sizeof(size_t), dirtyPages, &dirtyPageIndex, dirtyPageCount, clearDirty)) { break; } currentBlock += sizeof(size_t); firstPageAddressInCurrentBlock += sizeof(size_t) * OS_PAGE_SIZE; } if (currentBlock < fullBlockEnd) { break; } if (tableRegionEnd != fullBlockEnd && !GetDirtyFromBlock( currentBlock, firstPageAddressInCurrentBlock, 0, tableRegionEnd - fullBlockEnd, dirtyPages, &dirtyPageIndex, dirtyPageCount, clearDirty)) { break; } *dirtyPageCountRef = dirtyPageIndex; } while (false); if (!isRuntimeSuspended && clearDirty && dirtyPageIndex != 0) { // When dirtying a page, the dirty state of the page is first checked to see if the page is already dirty. If already // dirty, the write to mark it as dirty is skipped. So, when the dirty state of a page is cleared, we need to make sure // the cleared state is visible to other threads that may dirty the page, before marking through objects in the page, so // that the GC will not miss marking through dirtied objects in the page. Issue a memory barrier on all active threads // of the process now. MemoryBarrier(); // flush writes from this thread first to guarantee ordering GCToOSInterface::FlushProcessWriteBuffers(); } } #endif // !DACCESS_COMPILE #endif // FEATURE_USE_SOFTWARE_WRITE_WATCH_FOR_GC_HEAP
32.164609
136
0.610287
lambdageek
b853a7bf267c6fb2fee68f89dc90eda9e959dca6
229
cc
C++
src/Reader/reader_base.cc
studla/RYUTO
43abd5757745a14d0ee8824093bbfa7a361581d8
[ "BSD-3-Clause" ]
3
2021-07-26T08:48:51.000Z
2022-03-27T07:33:21.000Z
src/Reader/reader_base.cc
studla/RYUTO
43abd5757745a14d0ee8824093bbfa7a361581d8
[ "BSD-3-Clause" ]
3
2019-06-03T08:40:23.000Z
2020-09-16T11:34:53.000Z
src/Reader/reader_base.cc
studla/RYUTO
43abd5757745a14d0ee8824093bbfa7a361581d8
[ "BSD-3-Clause" ]
1
2019-06-07T21:52:26.000Z
2019-06-07T21:52:26.000Z
/* * File: reader_base.cc * Author: Thomas Gatter <thomas(at)bioinf.uni-leipzig.de> * * Created on December 2, 2015, 5:51 PM */ #include "reader_base.h" reader_base::reader_base() { } reader_base::~reader_base() { }
14.3125
58
0.659389
studla
b854d5d500fb7bd0b40f7f4b71cf8763e4da3d29
1,873
cpp
C++
Hollow_Faith/Motor2D/j1GUIconsole.cpp
juanha2/PlatformerGame
f95af3cb237ff8fcb59f16f58598ca0a94cf9f1c
[ "Unlicense" ]
4
2019-10-27T16:47:13.000Z
2020-03-16T17:02:36.000Z
Hollow_Faith/Motor2D/j1GUIconsole.cpp
juanha2/PlatformerGame
f95af3cb237ff8fcb59f16f58598ca0a94cf9f1c
[ "Unlicense" ]
null
null
null
Hollow_Faith/Motor2D/j1GUIconsole.cpp
juanha2/PlatformerGame
f95af3cb237ff8fcb59f16f58598ca0a94cf9f1c
[ "Unlicense" ]
8
2019-12-19T15:16:50.000Z
2020-06-14T22:12:33.000Z
#include "j1GUIconsole.h" #include "j1App.h" #include "j1GUI.h" #include "j1Textures.h" #include "j1Fonts.h" #include "j1Window.h" j1GUIconsole::j1GUIconsole() { this->type = GUItype::GUI_CONSOLE; texture = App->gui->GetAtlasTexture(); } j1GUIconsole::~j1GUIconsole() { } bool j1GUIconsole::Start() { //Adding console elements image = App->gui->AddGUIelement(GUItype::GUI_IMAGE, this, { 160, 60 }, { 0,0 }, interactable, enabled, { 0, 0, App->win->screen_surface->w, App->win->screen_surface->h / 2 }, nullptr); inputbox = App->gui->AddGUIelement(GUItype::GUI_INPUTBOX, this, { 0,App->win->screen_surface->h / 4 - 26 }, { 20,5 }, interactable, enabled, { 0,App->win->screen_surface->h / 2 - 42, App->win->screen_surface->w,42 }, nullptr); label = App->gui->AddGUIelement(GUItype::GUI_LABEL, this, { 0, 0 }, { 20,20 }, interactable, enabled, { 288, 144, 198, 100 }, nullptr); return true; } bool j1GUIconsole::PreUpdate() { //Update element's enabled from parent's inputbox->enabled = enabled; image->enabled = enabled; label->enabled = enabled; inputbox->focus = focus; //Delete string if not enabled if (!inputbox->enabled) consoleString.Clear(); return true; } bool j1GUIconsole::CleanUp() { //Deleting elements inputbox = nullptr; image = nullptr; label = nullptr; return true; } void j1GUIconsole::PrintText(const char* txt) { consoleString += "- "; consoleString += txt; consoleString += ";"; consoleString += "\n"; //If there's a label, print console String with new chars(- , ; , \n) if (label) { App->tex->UnLoad(label->texture); label->texture = App->fonts->Print(consoleString.GetString()); App->fonts->CalcSize(consoleString.GetString(), label->rect.w, label->rect.h); if (label->rect.h > image->rect.h - 250) consoleString.Cut(consoleString.FindFirst("-"), consoleString.FindFirst(";") + 2); } }
27.144928
227
0.674319
juanha2
b857f20838af04dc83fc106d98f392ff55e4e060
13,476
cpp
C++
src/ModelPredictiveControl.cpp
stephane-caron/lipm_walking_controller
d70ae07354f552a27b44885cdb263fec03875d36
[ "BSD-2-Clause" ]
121
2018-09-25T11:14:37.000Z
2022-03-31T05:31:39.000Z
src/ModelPredictiveControl.cpp
stephane-caron/lipm_walking_controller
d70ae07354f552a27b44885cdb263fec03875d36
[ "BSD-2-Clause" ]
57
2018-09-21T01:37:54.000Z
2020-12-29T15:59:24.000Z
src/ModelPredictiveControl.cpp
stephane-caron/lipm_walking_controller
d70ae07354f552a27b44885cdb263fec03875d36
[ "BSD-2-Clause" ]
35
2018-09-21T01:07:40.000Z
2022-02-25T21:36:47.000Z
/* * Copyright (c) 2018-2019, CNRS-UM LIRMM * 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 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 <iomanip> #include <lipm_walking/ModelPredictiveControl.h> #include <lipm_walking/utils/clamp.h> #include <lipm_walking/utils/slerp.h> namespace lipm_walking { // Repeat static constexpr declarations // Fixes <https://github.com/stephane-caron/lipm_walking_controller/issues/21>. // See also <https://stackoverflow.com/q/8016780>. constexpr double ModelPredictiveControl::SAMPLING_PERIOD; constexpr unsigned ModelPredictiveControl::INPUT_SIZE; constexpr unsigned ModelPredictiveControl::NB_STEPS; constexpr unsigned ModelPredictiveControl::STATE_SIZE; ModelPredictiveControl::ModelPredictiveControl() { velCostMat_.setZero(); constexpr double T = SAMPLING_PERIOD; double S = T * T / 2; // "square" double C = T * T * T / 6; // "cube" Eigen::Matrix<double, STATE_SIZE, STATE_SIZE> stateMatrix; // clang-format off stateMatrix << 1, 0, T, 0, S, 0, 0, 1, 0, T, 0, S, 0, 0, 1, 0, T, 0, 0, 0, 0, 1, 0, T, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1; // clang-format on Eigen::Matrix<double, STATE_SIZE, INPUT_SIZE> inputMatrix; // clang-format off inputMatrix << C, 0, 0, C, S, 0, 0, S, T, 0, 0, T; // clang-format on Eigen::VectorXd biasVector = Eigen::VectorXd::Zero(STATE_SIZE); initState_ = Eigen::VectorXd::Zero(STATE_SIZE); previewSystem_ = std::make_shared<copra::PreviewSystem>(stateMatrix, inputMatrix, biasVector, initState_, NB_STEPS); LOG_SUCCESS("Initialized new ModelPredictiveControl solver"); } void ModelPredictiveControl::configure(const mc_rtc::Configuration & config) { if(config.has("weights")) { auto weights = config("weights"); weights("jerk", jerkWeight); weights("vel", velWeights); weights("zmp", zmpWeight); } } void ModelPredictiveControl::addGUIElements(std::shared_ptr<mc_rtc::gui::StateBuilder> gui) { using namespace mc_rtc::gui; gui->addElement({"Walking", "CoM"}, ComboInput("MPC QP solver", {"QuadProgDense", "QLD"}, [this]() { switch(solver_) { case copra::SolverFlag::QLD: return "QLD"; case copra::SolverFlag::QuadProgDense: default: return "QuadProgDense"; } }, [this](const std::string & solver) { if(solver == "QLD") { solver_ = copra::SolverFlag::QLD; } else // (solver == "QuadProgDense") { solver_ = copra::SolverFlag::QuadProgDense; } }), ArrayInput("MPC QP cost weights", {"jerk", "vel_x", "vel_y", "zmp"}, [this]() { Eigen::VectorXd weights(4); weights[0] = jerkWeight; weights[1] = velWeights.x(); weights[2] = velWeights.y(); weights[3] = zmpWeight; return weights; }, [this](const Eigen::VectorXd & weights) { jerkWeight = weights[0]; velWeights.x() = weights[1]; velWeights.y() = weights[2]; zmpWeight = weights[3]; })); } void ModelPredictiveControl::addLogEntries(mc_rtc::Logger & logger) { logger.addLogEntry("mpc_velRef", [this]() -> Eigen::Vector2d { return velRef_.head<2>(); }); logger.addLogEntry("mpc_weights_jerk", [this]() { return jerkWeight; }); logger.addLogEntry("mpc_weights_vel", [this]() { return velWeights; }); logger.addLogEntry("mpc_weights_zmp", [this]() { return zmpWeight; }); logger.addLogEntry("mpc_zmpRef", [this]() -> Eigen::Vector2d { return zmpRef_.head<2>(); }); logger.addLogEntry("perf_MPCBuildAndSolve", [this]() { return buildAndSolveTime_; }); logger.addLogEntry("perf_MPCSolve", [this]() { return solveTime_; }); } void ModelPredictiveControl::phaseDurations(double initSupportDuration, double doubleSupportDuration, double targetSupportDuration) { constexpr double T = SAMPLING_PERIOD; unsigned nbStepsSoFar = 0; nbInitSupportSteps_ = std::min(static_cast<unsigned>(std::round(initSupportDuration / T)), NB_STEPS - nbStepsSoFar); nbStepsSoFar += nbInitSupportSteps_; nbDoubleSupportSteps_ = std::min(static_cast<unsigned>(std::round(doubleSupportDuration / T)), NB_STEPS - nbStepsSoFar); nbStepsSoFar += nbDoubleSupportSteps_; nbTargetSupportSteps_ = std::min(static_cast<unsigned>(std::round(targetSupportDuration / T)), NB_STEPS - nbStepsSoFar); nbStepsSoFar += nbTargetSupportSteps_; if(nbTargetSupportSteps_ > 0) // full preview mode { nbNextDoubleSupportSteps_ = NB_STEPS - nbStepsSoFar; // always positive } for(long i = 0; i <= NB_STEPS; i++) { // SSP constraint is enforced at the very first step of DSP if(i < nbInitSupportSteps_ || (0 < i && i == nbInitSupportSteps_)) { indexToHrep_[i] = 0; } else if(i - nbInitSupportSteps_ < nbDoubleSupportSteps_) { indexToHrep_[i] = 1; } else if(nbTargetSupportSteps_ > 0) { if(i - nbInitSupportSteps_ - nbDoubleSupportSteps_ <= nbTargetSupportSteps_) { indexToHrep_[i] = 2; } else if(nbNextDoubleSupportSteps_ > 0) { indexToHrep_[i] = 3; } else // (nbNextDoubleSupportSteps_ == 0) { indexToHrep_[i] = 2; } } else // (nbTargetSupportSteps_ == 0) { indexToHrep_[i] = 1; } } } void ModelPredictiveControl::computeZMPRef() { zmpRef_.setZero(); Eigen::Vector2d p_0 = initContact_.anklePos(sole_).head<2>(); Eigen::Vector2d p_1 = targetContact_.anklePos(sole_).head<2>(); Eigen::Vector2d p_2 = nextContact_.anklePos(sole_).head<2>(); if(nbTargetSupportSteps_ < 1) // half preview mode (@see phaseDurations) { p_1 = 0.5 * (initContact_.anklePos(sole_) + targetContact_.anklePos(sole_)).head<2>(); } for(long i = 0; i <= NB_STEPS; i++) { if(indexToHrep_[i] <= 1) { long j = i - nbInitSupportSteps_; double x = (nbDoubleSupportSteps_ > 0) ? static_cast<double>(j) / nbDoubleSupportSteps_ : 0.; x = clamp(x, 0., 1.); zmpRef_.segment<2>(2 * i) = (1. - x) * p_0 + x * p_1; } else // (indexToHrep_[i] <= 3), which implies nbTargetSupportSteps_ > 0 { long j = i - nbInitSupportSteps_ - nbDoubleSupportSteps_ - nbTargetSupportSteps_; double x = (nbNextDoubleSupportSteps_ > 0) ? static_cast<double>(j) / nbNextDoubleSupportSteps_ : 0; x = clamp(x, 0., 1.); zmpRef_.segment<2>(2 * i) = (1. - x) * p_1 + x * p_2; } } } void ModelPredictiveControl::updateTerminalConstraint() { Eigen::MatrixXd E_dcm = Eigen::MatrixXd::Zero(2, STATE_SIZE * (NB_STEPS + 1)); Eigen::MatrixXd E_zmp = Eigen::MatrixXd::Zero(2, STATE_SIZE * (NB_STEPS + 1)); if(nbTargetSupportSteps_ < 1) // half preview mode (@see phaseDurations) { unsigned i = nbInitSupportSteps_ + nbDoubleSupportSteps_; E_dcm.block<2, 6>(0, 6 * i) = dcmFromState_; E_zmp.block<2, 6>(0, 6 * i) = zmpFromState_; } else // full preview { E_dcm.rightCols<6>() = dcmFromState_; E_zmp.rightCols<6>() = zmpFromState_; } Eigen::Vector2d dcmTarget = zmpRef_.tail<2>(); Eigen::Vector2d zmpTarget = zmpRef_.tail<2>(); termDCMCons_ = std::make_shared<copra::TrajectoryConstraint>(E_dcm, dcmTarget, /* isInequalityConstraint = */ false); termZMPCons_ = std::make_shared<copra::TrajectoryConstraint>(E_zmp, zmpTarget, /* isInequalityConstraint = */ false); } void ModelPredictiveControl::updateZMPConstraint() { hreps_[0] = initContact_.hrep(); hreps_[2] = targetContact_.hrep(); unsigned totalRows = 0; for(long i = 0; i <= NB_STEPS; i++) { unsigned hrepIndex = indexToHrep_[i]; if(hrepIndex % 2 == 0) { const auto & hrep = hreps_[hrepIndex]; totalRows += static_cast<unsigned>(hrep.first.rows()); } } Eigen::MatrixXd A{totalRows, STATE_SIZE * (NB_STEPS + 1)}; Eigen::VectorXd b{totalRows}; A.setZero(); long nextRow = 0; for(long i = 0; i <= NB_STEPS; i++) { unsigned hrepIndex = indexToHrep_[i]; if(hrepIndex % 2 == 0) { const auto & hrep = hreps_[indexToHrep_[i]]; unsigned consRows = static_cast<unsigned>(hrep.first.rows()); A.block(nextRow, STATE_SIZE * i, consRows, STATE_SIZE) = hrep.first * zmpFromState_; b.segment(nextRow, consRows) = hrep.second; nextRow += consRows; } } zmpCons_ = std::make_shared<copra::TrajectoryConstraint>(A, b); } void ModelPredictiveControl::updateJerkCost() { Eigen::Matrix2d jerkMat = Eigen::Matrix2d::Identity(); Eigen::Vector2d jerkVec = Eigen::Vector2d::Zero(); jerkCost_ = std::make_shared<copra::ControlCost>(jerkMat, jerkVec); jerkCost_->weight(jerkWeight); } void ModelPredictiveControl::updateVelCost() { velRef_.setZero(); const Eigen::Matrix3d & R_0 = initContact_.pose.rotation(); const Eigen::Matrix3d & R_1 = targetContact_.pose.rotation(); const Eigen::Matrix3d & R_2 = nextContact_.pose.rotation(); Eigen::Vector2d v_0 = initContact_.refVel.head<2>(); Eigen::Vector2d v_1 = targetContact_.refVel.head<2>(); Eigen::Vector2d v_2 = nextContact_.refVel.head<2>(); if(nbTargetSupportSteps_ < 1) // half preview mode (@see phaseDurations) { v_1 = {0., 0.}; } Eigen::Matrix2d R; Eigen::Vector2d v; for(long i = 0; i <= NB_STEPS; i++) { if(indexToHrep_[i] <= 1) { double w = static_cast<double>(i) / (nbInitSupportSteps_ + nbDoubleSupportSteps_); w = clamp(w, 0., 1.); R = slerp(R_0, R_1, w).topLeftCorner<2, 2>(); v = (1. - w) * v_0 + w * v_1; } else // (indexToHrep_[i] <= 3), which implies nbTargetSupportSteps_ > 0 { long i2 = i - nbInitSupportSteps_ - nbDoubleSupportSteps_; // >= 0 double w = static_cast<double>(i2) / (nbTargetSupportSteps_ + nbNextDoubleSupportSteps_); w = clamp(w, 0., 1.); R = slerp(R_1, R_2, w).topLeftCorner<2, 2>(); v = (1. - w) * v_1 + w * v_2; } velCostMat_.block<2, STATE_SIZE>(2 * i, STATE_SIZE * i).block<2, 2>(0, 2) = R; velRef_.segment<2>(2 * i) = R * v; } velCost_ = std::make_shared<copra::TrajectoryCost>(velCostMat_, velRef_); velCost_->weights(velWeights); } void ModelPredictiveControl::updateZMPCost() { zmpCost_ = std::make_shared<copra::TrajectoryCost>(zmpFromState_, zmpRef_); zmpCost_->weight(zmpWeight); zmpCost_->autoSpan(); // repeat zmpFromState } bool ModelPredictiveControl::buildAndSolve() { using namespace std::chrono; auto startTime = high_resolution_clock::now(); computeZMPRef(); previewSystem_->xInit(initState_); updateTerminalConstraint(); updateZMPConstraint(); updateJerkCost(); updateVelCost(); updateZMPCost(); copra::LMPC lmpc(previewSystem_, solver_); lmpc.addConstraint(termDCMCons_); lmpc.addConstraint(termZMPCons_); lmpc.addConstraint(zmpCons_); lmpc.addCost(jerkCost_); lmpc.addCost(velCost_); lmpc.addCost(zmpCost_); bool solutionFound = lmpc.solve(); if(solutionFound) { solution_.reset(new Preview(lmpc.trajectory(), lmpc.control())); } else { LOG_ERROR("Model predictive control problem has no solution"); solution_.reset(new Preview()); } auto endTime = high_resolution_clock::now(); buildAndSolveTime_ = 1000. * duration_cast<duration<double>>(endTime - startTime).count(); solveTime_ = 1000. * lmpc.solveTime(); return solutionFound; } } // namespace lipm_walking
36.520325
119
0.625111
stephane-caron
b85b847ae5920f980028cd30b025fe5753268e5c
14,017
cpp
C++
tests/app/main.cpp
cwyyprog/bitshares-core
f47c115cd21e62829e242447398b20b40a32cddf
[ "MIT" ]
7
2016-07-04T20:07:12.000Z
2020-10-20T16:26:14.000Z
tests/app/main.cpp
cwyyprog/bitshares-core
f47c115cd21e62829e242447398b20b40a32cddf
[ "MIT" ]
19
2018-02-01T18:30:11.000Z
2019-02-11T16:53:33.000Z
tests/app/main.cpp
cwyyprog/bitshares-core
f47c115cd21e62829e242447398b20b40a32cddf
[ "MIT" ]
7
2016-11-10T05:04:08.000Z
2020-10-20T16:26:20.000Z
/* * Copyright (c) 2015 Cryptonomex, Inc., and contributors. * * The MIT License * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #include <graphene/app/application.hpp> #include <graphene/app/plugin.hpp> #include <graphene/app/config_util.hpp> #include <graphene/chain/balance_object.hpp> #include <graphene/utilities/tempdir.hpp> #include <graphene/account_history/account_history_plugin.hpp> #include <graphene/market_history/market_history_plugin.hpp> #include <graphene/witness/witness.hpp> #include <graphene/grouped_orders/grouped_orders_plugin.hpp> #include <fc/thread/thread.hpp> #include <fc/log/appender.hpp> #include <fc/log/logger.hpp> #include <boost/filesystem/path.hpp> #define BOOST_TEST_MODULE Test Application #include <boost/test/included/unit_test.hpp> #include "../common/genesis_file_util.hpp" using namespace graphene; namespace bpo = boost::program_options; namespace fc { extern std::unordered_map<std::string, logger> &get_logger_map(); extern std::unordered_map<std::string, appender::ptr> &get_appender_map(); } BOOST_AUTO_TEST_CASE(load_configuration_options_test_config_logging_files_created) { fc::temp_directory app_dir(graphene::utilities::temp_directory_path()); auto dir = app_dir.path(); auto config_ini_file = dir / "config.ini"; auto logging_ini_file = dir / "logging.ini"; /// create default config options auto node = new app::application(); bpo::options_description cli, cfg; node->set_program_options(cli, cfg); bpo::options_description cfg_options("Graphene Witness Node"); cfg_options.add(cfg); /// check preconditions BOOST_CHECK(!fc::exists(config_ini_file)); BOOST_CHECK(!fc::exists(logging_ini_file)); bpo::variables_map options; app::load_configuration_options(dir, cfg_options, options); /// check post-conditions BOOST_CHECK(fc::exists(config_ini_file)); BOOST_CHECK(fc::exists(logging_ini_file)); BOOST_CHECK_GT(fc::file_size(config_ini_file), 0u); BOOST_CHECK_GT(fc::file_size(logging_ini_file), 0u); } BOOST_AUTO_TEST_CASE(load_configuration_options_test_config_ini_options) { fc::temp_directory app_dir(graphene::utilities::temp_directory_path()); auto dir = app_dir.path(); auto config_ini_file = dir / "config.ini"; auto logging_ini_file = dir / "logging.ini"; /// create config.ini bpo::options_description cfg_options("config.ini options"); cfg_options.add_options() ("option1", bpo::value<std::string>(), "") ("option2", bpo::value<int>(), "") ; std::ofstream out(config_ini_file.preferred_string()); out << "option1=is present\n" "option2=1\n\n"; out.close(); /// check preconditions BOOST_CHECK(fc::exists(config_ini_file)); BOOST_CHECK(!fc::exists(logging_ini_file)); bpo::variables_map options; app::load_configuration_options(dir, cfg_options, options); /// check the options values are parsed into the output map BOOST_CHECK(!options.empty()); BOOST_CHECK_EQUAL(options.count("option1"), 1u); BOOST_CHECK_EQUAL(options.count("option2"), 1u); BOOST_CHECK_EQUAL(options["option1"].as<std::string>(), "is present"); BOOST_CHECK_EQUAL(options["option2"].as<int>(), 1); /// when the config.ini exists and doesn't contain logging configuration while the logging.ini doesn't exist /// the logging.ini is not created BOOST_CHECK(!fc::exists(logging_ini_file)); } BOOST_AUTO_TEST_CASE(load_configuration_options_test_logging_ini_options) { fc::temp_directory app_dir(graphene::utilities::temp_directory_path()); auto dir = app_dir.path(); auto config_ini_file = dir / "config.ini"; auto logging_ini_file = dir / "logging.ini"; /// create logging.ini /// configure exactly one logger and appender std::ofstream out(logging_ini_file.preferred_string()); out << "[log.file_appender.default]\n" "filename=test.log\n\n" "[logger.default]\n" "level=info\n" "appenders=default\n\n" ; out.close(); /// clear logger and appender state fc::get_logger_map().clear(); fc::get_appender_map().clear(); BOOST_CHECK(fc::get_logger_map().empty()); BOOST_CHECK(fc::get_appender_map().empty()); bpo::options_description cfg_options("empty"); bpo::variables_map options; app::load_configuration_options(dir, cfg_options, options); /// check the options values are parsed into the output map /// this is a little bit tricky since load_configuration_options() doesn't provide output variable for logging_config auto logger_map = fc::get_logger_map(); auto appender_map = fc::get_appender_map(); BOOST_CHECK_EQUAL(logger_map.size(), 1u); BOOST_CHECK(logger_map.count("default")); BOOST_CHECK_EQUAL(appender_map.size(), 1u); BOOST_CHECK(appender_map.count("default")); } BOOST_AUTO_TEST_CASE(load_configuration_options_test_legacy_config_ini_options) { fc::temp_directory app_dir(graphene::utilities::temp_directory_path()); auto dir = app_dir.path(); auto config_ini_file = dir / "config.ini"; auto logging_ini_file = dir / "logging.ini"; /// create config.ini bpo::options_description cfg_options("config.ini options"); cfg_options.add_options() ("option1", bpo::value<std::string>(), "") ("option2", bpo::value<int>(), "") ; std::ofstream out(config_ini_file.preferred_string()); out << "option1=is present\n" "option2=1\n\n" "[log.file_appender.default]\n" "filename=test.log\n\n" "[logger.default]\n" "level=info\n" "appenders=default\n\n" ; out.close(); /// clear logger and appender state fc::get_logger_map().clear(); fc::get_appender_map().clear(); BOOST_CHECK(fc::get_logger_map().empty()); BOOST_CHECK(fc::get_appender_map().empty()); bpo::variables_map options; app::load_configuration_options(dir, cfg_options, options); /// check logging.ini not created BOOST_CHECK(!fc::exists(logging_ini_file)); /// check the options values are parsed into the output map BOOST_CHECK(!options.empty()); BOOST_CHECK_EQUAL(options.count("option1"), 1u); BOOST_CHECK_EQUAL(options.count("option2"), 1u); BOOST_CHECK_EQUAL(options["option1"].as<std::string>(), "is present"); BOOST_CHECK_EQUAL(options["option2"].as<int>(), 1); auto logger_map = fc::get_logger_map(); auto appender_map = fc::get_appender_map(); BOOST_CHECK_EQUAL(logger_map.size(), 1u); BOOST_CHECK(logger_map.count("default")); BOOST_CHECK_EQUAL(appender_map.size(), 1u); BOOST_CHECK(appender_map.count("default")); } ///////////// /// @brief create a 2 node network ///////////// BOOST_AUTO_TEST_CASE( two_node_network ) { using namespace graphene::chain; using namespace graphene::app; try { BOOST_TEST_MESSAGE( "Creating and initializing app1" ); fc::temp_directory app_dir( graphene::utilities::temp_directory_path() ); graphene::app::application app1; app1.register_plugin< graphene::account_history::account_history_plugin>(); app1.register_plugin< graphene::market_history::market_history_plugin >(); app1.register_plugin< graphene::witness_plugin::witness_plugin >(); app1.register_plugin< graphene::grouped_orders::grouped_orders_plugin>(); app1.startup_plugins(); boost::program_options::variables_map cfg; cfg.emplace("p2p-endpoint", boost::program_options::variable_value(string("127.0.0.1:3939"), false)); cfg.emplace("genesis-json", boost::program_options::variable_value(create_genesis_file(app_dir), false)); cfg.emplace("seed-nodes", boost::program_options::variable_value(string("[]"), false)); app1.initialize(app_dir.path(), cfg); BOOST_TEST_MESSAGE( "Starting app1 and waiting 500 ms" ); app1.startup(); fc::usleep(fc::milliseconds(500)); BOOST_TEST_MESSAGE( "Creating and initializing app2" ); fc::temp_directory app2_dir( graphene::utilities::temp_directory_path() ); graphene::app::application app2; app2.register_plugin<account_history::account_history_plugin>(); app2.register_plugin< graphene::market_history::market_history_plugin >(); app2.register_plugin< graphene::witness_plugin::witness_plugin >(); app2.register_plugin< graphene::grouped_orders::grouped_orders_plugin>(); app2.startup_plugins(); auto cfg2 = cfg; cfg2.erase("p2p-endpoint"); cfg2.emplace("p2p-endpoint", boost::program_options::variable_value(string("127.0.0.1:4040"), false)); cfg2.emplace("genesis-json", boost::program_options::variable_value(create_genesis_file(app_dir), false)); cfg2.emplace("seed-node", boost::program_options::variable_value(vector<string>{"127.0.0.1:3939"}, false)); cfg2.emplace("seed-nodes", boost::program_options::variable_value(string("[]"), false)); app2.initialize(app2_dir.path(), cfg2); BOOST_TEST_MESSAGE( "Starting app2 and waiting 500 ms" ); app2.startup(); fc::usleep(fc::milliseconds(500)); BOOST_REQUIRE_EQUAL(app1.p2p_node()->get_connection_count(), 1u); BOOST_CHECK_EQUAL(std::string(app1.p2p_node()->get_connected_peers().front().host.get_address()), "127.0.0.1"); BOOST_TEST_MESSAGE( "app1 and app2 successfully connected" ); std::shared_ptr<chain::database> db1 = app1.chain_database(); std::shared_ptr<chain::database> db2 = app2.chain_database(); BOOST_CHECK_EQUAL( db1->get_balance( GRAPHENE_NULL_ACCOUNT, asset_id_type() ).amount.value, 0 ); BOOST_CHECK_EQUAL( db2->get_balance( GRAPHENE_NULL_ACCOUNT, asset_id_type() ).amount.value, 0 ); BOOST_TEST_MESSAGE( "Creating transfer tx" ); graphene::chain::precomputable_transaction trx; { account_id_type nathan_id = db2->get_index_type<account_index>().indices().get<by_name>().find( "nathan" )->id; fc::ecc::private_key nathan_key = fc::ecc::private_key::regenerate(fc::sha256::hash(string("nathan"))); balance_claim_operation claim_op; balance_id_type bid = balance_id_type(); claim_op.deposit_to_account = nathan_id; claim_op.balance_to_claim = bid; claim_op.balance_owner_key = nathan_key.get_public_key(); claim_op.total_claimed = bid(*db1).balance; trx.operations.push_back( claim_op ); db1->current_fee_schedule().set_fee( trx.operations.back() ); transfer_operation xfer_op; xfer_op.from = nathan_id; xfer_op.to = GRAPHENE_NULL_ACCOUNT; xfer_op.amount = asset( 1000000 ); trx.operations.push_back( xfer_op ); db1->current_fee_schedule().set_fee( trx.operations.back() ); trx.set_expiration( db1->get_slot_time( 10 ) ); trx.sign( nathan_key, db1->get_chain_id() ); trx.validate(); } BOOST_TEST_MESSAGE( "Pushing tx locally on db1" ); processed_transaction ptrx = db1->push_transaction(trx); BOOST_CHECK_EQUAL( db1->get_balance( GRAPHENE_NULL_ACCOUNT, asset_id_type() ).amount.value, 1000000 ); BOOST_CHECK_EQUAL( db2->get_balance( GRAPHENE_NULL_ACCOUNT, asset_id_type() ).amount.value, 0 ); BOOST_TEST_MESSAGE( "Broadcasting tx" ); app1.p2p_node()->broadcast(graphene::net::trx_message(trx)); fc::usleep(fc::milliseconds(500)); BOOST_CHECK_EQUAL( db1->get_balance( GRAPHENE_NULL_ACCOUNT, asset_id_type() ).amount.value, 1000000 ); BOOST_CHECK_EQUAL( db2->get_balance( GRAPHENE_NULL_ACCOUNT, asset_id_type() ).amount.value, 1000000 ); BOOST_TEST_MESSAGE( "Generating block on db2" ); fc::ecc::private_key committee_key = fc::ecc::private_key::regenerate(fc::sha256::hash(string("nathan"))); auto block_1 = db2->generate_block( db2->get_slot_time(1), db2->get_scheduled_witness(1), committee_key, database::skip_nothing); BOOST_TEST_MESSAGE( "Broadcasting block" ); app2.p2p_node()->broadcast(graphene::net::block_message( block_1 )); fc::usleep(fc::milliseconds(500)); BOOST_TEST_MESSAGE( "Verifying nodes are still connected" ); BOOST_CHECK_EQUAL(app1.p2p_node()->get_connection_count(), 1u); BOOST_CHECK_EQUAL(app1.chain_database()->head_block_num(), 1u); BOOST_TEST_MESSAGE( "Checking GRAPHENE_NULL_ACCOUNT has balance" ); } catch( fc::exception& e ) { edump((e.to_detail_string())); throw; } } // a contrived example to test the breaking out of application_impl to a header file #include "../../libraries/app/application_impl.hxx" BOOST_AUTO_TEST_CASE(application_impl_breakout) { class test_impl : public graphene::app::detail::application_impl { // override the constructor, just to test that we can public: test_impl() : application_impl(nullptr) {} bool has_item(const net::item_id& id) override { return true; } }; test_impl impl; graphene::net::item_id id; BOOST_CHECK(impl.has_item(id)); }
39.934473
120
0.708354
cwyyprog
b85c4ab022281377307b8eaad0a59d6f8e1c1a4a
3,676
hpp
C++
ufora/FORA/Native/TypedNativeExpressionConstantConversion.hpp
ufora/ufora
04db96ab049b8499d6d6526445f4f9857f1b6c7e
[ "Apache-2.0", "CC0-1.0", "MIT", "BSL-1.0", "BSD-3-Clause" ]
571
2015-11-05T20:07:07.000Z
2022-01-24T22:31:09.000Z
ufora/FORA/Native/TypedNativeExpressionConstantConversion.hpp
timgates42/ufora
04db96ab049b8499d6d6526445f4f9857f1b6c7e
[ "Apache-2.0", "CC0-1.0", "MIT", "BSL-1.0", "BSD-3-Clause" ]
218
2015-11-05T20:37:55.000Z
2021-05-30T03:53:50.000Z
ufora/FORA/Native/TypedNativeExpressionConstantConversion.hpp
timgates42/ufora
04db96ab049b8499d6d6526445f4f9857f1b6c7e
[ "Apache-2.0", "CC0-1.0", "MIT", "BSL-1.0", "BSD-3-Clause" ]
40
2015-11-07T21:42:19.000Z
2021-05-23T03:48:19.000Z
/*************************************************************************** Copyright 2015 Ufora Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ****************************************************************************/ #pragma once #include "NativeCode.hppml" #include "../../core/Platform.hpp" template<class T> class TypedNativeExpressionConstantConversion { public: }; template<class T> class TypedNativeExpressionConstantConversion<T*> { public: static NativeExpression get(T* in) { return NativeExpression::Constant(NativeConstant::VoidPtr((uword_t)in)) .cast(NativeTypeFor<T*>::get(), false); } }; template<> class TypedNativeExpressionConstantConversion<bool> { public: static NativeExpression get(bool in) { return NativeExpression::Constant(NativeConstant::Bool(in)); } }; template<> class TypedNativeExpressionConstantConversion<int8_t> { public: static NativeExpression get(int8_t in) { return NativeExpression::Constant(NativeConstant::Int8(in)); } }; template<> class TypedNativeExpressionConstantConversion<uint8_t> { public: static NativeExpression get(uint8_t in) { return NativeExpression::Constant(NativeConstant::UInt8(in)); } }; template<> class TypedNativeExpressionConstantConversion<int16_t> { public: static NativeExpression get(int16_t in) { return NativeExpression::Constant(NativeConstant::Int16(in)); } }; template<> class TypedNativeExpressionConstantConversion<uint16_t> { public: static NativeExpression get(uint16_t in) { return NativeExpression::Constant(NativeConstant::UInt16(in)); } }; template<> class TypedNativeExpressionConstantConversion<int32_t> { public: static NativeExpression get(int32_t in) { return NativeExpression::Constant(NativeConstant::Int32(in)); } }; template<> class TypedNativeExpressionConstantConversion<uint32_t> { public: static NativeExpression get(uint32_t in) { return NativeExpression::Constant(NativeConstant::UInt32(in)); } }; template<> class TypedNativeExpressionConstantConversion<int64_t> { public: static NativeExpression get(int64_t in) { return NativeExpression::Constant(NativeConstant::Int64(in)); } }; template<> class TypedNativeExpressionConstantConversion<uint64_t> { public: static NativeExpression get(uint64_t in) { return NativeExpression::Constant(NativeConstant::UInt64(in)); } }; template<> class TypedNativeExpressionConstantConversion<float> { public: static NativeExpression get(float in) { return NativeExpression::Constant(NativeConstant::Float(in)); } }; template<> class TypedNativeExpressionConstantConversion<double> { public: static NativeExpression get(double in) { return NativeExpression::Constant(NativeConstant::Double(in)); } }; #ifdef BSA_PLATFORM_APPLE template<> class TypedNativeExpressionConstantConversion<long> { public: static NativeExpression get(long in) { return NativeExpression::Constant(NativeConstant::Int64(in)); } }; template<> class TypedNativeExpressionConstantConversion<unsigned long> { public: static NativeExpression get(unsigned long in) { return NativeExpression::Constant(NativeConstant::UInt64(in)); } }; #endif
24.184211
77
0.737486
ufora
b85e1ed85b521e819607ad2a6d9b280c94f80dcc
3,164
cpp
C++
Fog/FogLabelStatement.cpp
UltimateScript/FOG
edc96d916fc299f0a822f8c534a4e7487c0e3ea2
[ "BSD-3-Clause" ]
null
null
null
Fog/FogLabelStatement.cpp
UltimateScript/FOG
edc96d916fc299f0a822f8c534a4e7487c0e3ea2
[ "BSD-3-Clause" ]
2
2021-07-07T17:31:49.000Z
2021-07-16T11:40:38.000Z
Fog/FogLabelStatement.cpp
OuluLinux/FOG
edc96d916fc299f0a822f8c534a4e7487c0e3ea2
[ "BSD-3-Clause" ]
null
null
null
#include <Fog/FogIncludeAll.h> TYPEINFO_SINGLE(FogLabelStatement, Super) FOGTOKEN_LEAF_IMPL(FogLabelStatement) FogLabelStatement::FogLabelStatement(FogName& aLabel, FogRaw& aStatement) : _label(aLabel), _statement(aStatement) {} FogLabelStatement::FogLabelStatement(const This& aStatement) : Super(aStatement), _label(aStatement._label), _statement(aStatement._statement) {} FogLabelStatement::~FogLabelStatement() {} void FogLabelStatement::create_usage(FogUsageContext& aContext) const { Super::create_usage(aContext); if (_label) _label->create_usage(aContext); _statement->create_usage(aContext); } bool FogLabelStatement::emit(FogEmitContext& emitContext) const { emitContext.emit_hash_line(line()); _label->emit(emitContext); emitContext.emit_space_and_text(":\n"); FogIndentEmitContext indentedContext(emitContext, 1, FogEmitContext::INDENTS); _statement->emit(indentedContext); return true; } size_t FogLabelStatement::executable_tokens() const { return _statement->executable_tokens(); } void FogLabelStatement::install(FogInstallContext& installContext) const { Super::install(installContext); _statement->install(installContext); } bool FogLabelStatement::is_actual(const FogScopeContext& scopeContext) const { return Super::is_actual(scopeContext) && (!_label || _label->is_actual(scopeContext)) && _statement->is_actual(scopeContext); } void FogLabelStatement::make_actual_from(FogMakeActualContext& makeActualContext) { Super::make_actual_from(makeActualContext); if (_label) _label->make_actual(_label.to_const(), makeActualContext); _statement->make_actual(_statement.to_const(), makeActualContext); } void FogLabelStatement::merge_from(FogMergeContext& mergeContext, const This& thatExpr) { Super::merge_from(mergeContext, thatExpr); thatExpr._label->merge_into(mergeContext, _label.to_const()); thatExpr._statement->merge_into(mergeContext, _statement.to_const()); } const FogMerge& FogLabelStatement::needs_merge_from(FogMergeContext& mergeContext, const This& thatExpr) const { FogMergeHandle needsMerge(Super::needs_merge_from(mergeContext, thatExpr)); needsMerge |= _label->needs_merge(mergeContext, *thatExpr._label); needsMerge |= _statement->needs_merge(mergeContext, *thatExpr._statement); return needsMerge; } std::ostream& FogLabelStatement::print_depth(std::ostream& s, int aDepth) const { Super::print_depth(s, aDepth); _label->print_deep(s, aDepth); _statement->print_deep(s, aDepth); return s; } std::ostream& FogLabelStatement::print_members(std::ostream& s, int aDepth) const { Super::print_members(s, aDepth); _label->print_on(s, aDepth); _statement->print_on(s, aDepth); return s; } char FogLabelStatement::print_named(std::ostream& s, const PrimId* fullId, char tailChar) const { if (is_meta()) tailChar = FogStream::space_and_emit(s, tailChar, "auto "); tailChar = _label->print_named(s, 0, tailChar); tailChar = FogStream::space_and_emit(s, tailChar, ": "); tailChar = _statement->print_named(s, 0, tailChar); return tailChar; } void FogLabelStatement::set_is_meta() { ERRMSG("Meta-label-statements are not supported."); }
29.027523
112
0.773704
UltimateScript
b860d07e7f0ca9016b7cf1b290d96410ee724861
4,411
cpp
C++
src/blfwk/src/SimPacketizer.cpp
ko7m/NXP_Kinetis_Bootloader
664682cc8ff8faca4e1e0532afb4e6c85dfdf18e
[ "BSD-3-Clause" ]
22
2016-10-01T16:22:43.000Z
2021-07-19T19:03:14.000Z
src/blfwk/src/SimPacketizer.cpp
ko7m/NXP_Kinetis_Bootloader
664682cc8ff8faca4e1e0532afb4e6c85dfdf18e
[ "BSD-3-Clause" ]
12
2016-11-20T21:26:48.000Z
2018-04-30T19:06:15.000Z
src/blfwk/src/SimPacketizer.cpp
ko7m/NXP_Kinetis_Bootloader
664682cc8ff8faca4e1e0532afb4e6c85dfdf18e
[ "BSD-3-Clause" ]
11
2016-09-25T22:41:53.000Z
2021-10-05T11:00:41.000Z
/* * Copyright (c) 2013-14, Freescale Semiconductor, 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: * * o Redistributions of source code must retain the above copyright notice, this list * of conditions and the following disclaimer. * * o 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. * * o Neither the name of Freescale Semiconductor, Inc. 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 "blfwk/SimPacketizer.h" #include "blfwk/Logging.h" #include "bootloader/bl_command.h" #include "bootloader/bootloader.h" using namespace blfwk; //////////////////////////////////////////////////////////////////////////////// // Code //////////////////////////////////////////////////////////////////////////////// // See SimPacketizer.h for documentation of this method. SimPacketizer::SimPacketizer(SimPeripheral *peripheral) : Packetizer(dynamic_cast<Peripheral *>(peripheral), kSimReadTimeoutMs) , m_isPumpEnabled(false) , m_isAborted(false) { } // See SimPacketizer.h for documentation of this method. SimPacketizer::~SimPacketizer() { delete m_peripheral; } // See SimPacketizer.h for documentation of this method. void SimPacketizer::finalize() { } // See SimPacketizer.h for documentation of this method. status_t SimPacketizer::writePacket(const uint8_t *packet, uint32_t byteCount, packet_type_t packetType) { assert(packet); // Check for receiver data phase abort. if (m_isAborted) { m_isAborted = false; return kStatus_AbortDataPhase; } // Write framing packet header. uint8_t buffer = (uint8_t)byteCount; status_t status = m_peripheral->write(&buffer, 1); // Write the packet. if (byteCount && (status == kStatus_Success)) { status = m_peripheral->write(packet, byteCount); } pumpSimulator(); return status; } // See SimPacketizer.h for documentation of this method. status_t SimPacketizer::readPacket(uint8_t **packet, uint32_t *packetLength, packet_type_t packetType) { assert(packet); assert(packetLength); *packet = NULL; *packetLength = 0; // Read framing packet header. uint8_t buffer; status_t status = m_peripheral->read(&buffer, 1, NULL, 0); if (status != kStatus_Success) { // fatal error in sumulator Log::error("Error: no data for readPacket\n"); return status; } // Read the packet. int length = (int)(buffer); if (length == 0) { // zero length packet return kStatus_Success; } status = m_peripheral->read(m_buffer, length, NULL, 0); if (status != kStatus_Success) { Log::error("Error: malformed packet\n"); return kStatus_Fail; } *packet = m_buffer; *packetLength = length; return kStatus_Success; } void SimPacketizer::pumpSimulator() { if (m_isPumpEnabled) { bootloader_command_pump(); } } //////////////////////////////////////////////////////////////////////////////// // EOF ////////////////////////////////////////////////////////////////////////////////
32.433824
105
0.63659
ko7m
b86526003835356b7678a1e03a9960969e01b831
3,470
cpp
C++
src/Core/Support/Debug.cpp
ennis/autograph-pipelines
afc66ef60bf99fca26d200bd7739528e1bf3ed8c
[ "MIT" ]
1
2021-04-24T12:29:42.000Z
2021-04-24T12:29:42.000Z
src/Core/Support/Debug.cpp
ennis/autograph-pipelines
afc66ef60bf99fca26d200bd7739528e1bf3ed8c
[ "MIT" ]
null
null
null
src/Core/Support/Debug.cpp
ennis/autograph-pipelines
afc66ef60bf99fca26d200bd7739528e1bf3ed8c
[ "MIT" ]
null
null
null
#ifdef AG_WINDOWS #include <Windows.h> #endif #include <autograph/Core/Support/Debug.h> #include <exception> #include <iostream> namespace ag { template <typename ResultT, ResultT OffsetBasis, ResultT Prime> class basic_fnv1a final { static_assert(std::is_unsigned<ResultT>::value, "need unsigned integer"); public: using result_type = ResultT; private: result_type state_{}; public: basic_fnv1a() noexcept : state_{OffsetBasis} {} void update(const void *const data, const std::size_t size) noexcept { const auto cdata = static_cast<const unsigned char *>(data); auto acc = this->state_; for (auto i = std::size_t{}; i < size; ++i) { const auto next = std::size_t{cdata[i]}; acc = (acc ^ next) * Prime; } this->state_ = acc; } result_type digest() const noexcept { return this->state_; } }; using fnv1a_32 = basic_fnv1a<std::uint32_t, UINT32_C(2166136261), UINT32_C(16777619)>; using fnv1a_64 = basic_fnv1a<std::uint64_t, UINT64_C(14695981039346656037), UINT64_C(1099511628211)>; inline std::size_t hash_bytes(const void *const data, const std::size_t size) noexcept { auto hashfn = fnv1a_64{}; hashfn.update(data, size); return hashfn.digest(); } static void setConsoleColor(std::ostream &os, int attrib) { #ifdef AG_WINDOWS HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE); SetConsoleTextAttribute(hConsole, attrib); #else switch (attrib) { case 8: os << "\033[30m"; break; case 7: os << "\033[37m"; break; case 14: os << "\033[33m"; break; case 12: os << "\033[31m"; break; } #endif } static void rawDebugOutput(int timesRepeated, const char *message) { // do not print the message again if it is repeated if (!timesRepeated) std::cerr << message; #ifdef AG_WINDOWS // Always repeat OutputDebugStringA(message); #endif } static void rawRepeatLast(int timesRepeated, const char *message) { std::cerr << "\r (Repeated " << timesRepeated << " times)"; } void rawLogMessage(LogLevel c, const char *message) { static std::size_t lastHash = 0; static int timesRepeated = 0; std::size_t curHash = hash_bytes(message, std::strlen(message)) + (std::size_t)c; // bool repeatLast = false; if (curHash == lastHash) { // repeat last output ++timesRepeated; setConsoleColor(std::cerr, 8); rawRepeatLast(timesRepeated, message); setConsoleColor(std::cerr, 7); } else { lastHash = curHash; if (timesRepeated) rawDebugOutput(0, "\n"); timesRepeated = 0; } if (c == LogLevel::Debug) { setConsoleColor(std::cerr, 8); rawDebugOutput(timesRepeated, "[DEBUG] "); } else if (c == LogLevel::Warning) { setConsoleColor(std::cerr, 14); rawDebugOutput(timesRepeated, "[WARN ] "); setConsoleColor(std::cerr, 7); } else if (c == LogLevel::Error) { setConsoleColor(std::cerr, 12); rawDebugOutput(timesRepeated, "[ERROR] "); setConsoleColor(std::cerr, 7); } else if (c == LogLevel::Fatal) { setConsoleColor(std::cerr, 12); rawDebugOutput(timesRepeated, "\n[FATAL] "); } rawDebugOutput(timesRepeated, message); rawDebugOutput(timesRepeated, "\n"); setConsoleColor(std::cerr, 7); } [[noreturn]] void failWith(const char *message) { rawLogMessage(LogLevel::Fatal, message); std::terminate(); } [[noreturn]] void failWith(const std::string &message) { failWith(message.c_str()); } }
26.090226
75
0.660807
ennis
b86665de99719224220cb3c4d4fb28877fea534f
1,339
hpp
C++
DoremiEngine/Graphic/Include/Internal/Manager/ShaderManagerImpl.hpp
meraz/doremi
452d08ebd10db50d9563c1cf97699571889ab18f
[ "MIT" ]
1
2020-03-23T15:42:05.000Z
2020-03-23T15:42:05.000Z
DoremiEngine/Graphic/Include/Internal/Manager/ShaderManagerImpl.hpp
Meraz/ssp15
452d08ebd10db50d9563c1cf97699571889ab18f
[ "MIT" ]
null
null
null
DoremiEngine/Graphic/Include/Internal/Manager/ShaderManagerImpl.hpp
Meraz/ssp15
452d08ebd10db50d9563c1cf97699571889ab18f
[ "MIT" ]
1
2020-03-23T15:42:06.000Z
2020-03-23T15:42:06.000Z
#pragma once #include <Interface/Manager/ShaderManager.hpp> #include <string> namespace DoremiEngine { namespace Graphic { struct GraphicModuleContext; class ShaderManagerImpl : public ShaderManager { public: // TODOKO Add docs ShaderManagerImpl(const GraphicModuleContext& p_graphicContext); virtual ~ShaderManagerImpl(); VertexShader* BuildVertexShader(const std::string& p_fileName, D3D11_INPUT_ELEMENT_DESC p_inputDescription[], int p_arraySize) override; VertexShader * BuildVertexShaderWithoutInput(const std::string & p_fileName) override; PixelShader* BuildPixelShader(const std::string& p_fileName) override; GeometryShader* BuildGeometryShader(const std::string& p_fileName); ComputeShader* BuildComputeShader(const std::string& p_fileName) override; void SetActiveVertexShader(VertexShader* p_shader) override; void SetActivePixelShader(PixelShader* p_shader) override; void SetActiveGeometryShader(GeometryShader* p_shader) override; void RemoveGeometryShader() override; void SetActiveComputeShader(ComputeShader* p_shader) override; private: const GraphicModuleContext& m_graphicContext; }; } }
41.84375
148
0.696042
meraz
b86bca70f1c8a709987e141703c46bc8a9f5ae97
1,230
cpp
C++
src/Camera.cpp
rabowling/senior-project
07d7a1fba73376bc197f2ff045c057f0808d7612
[ "MIT" ]
1
2021-06-15T01:44:41.000Z
2021-06-15T01:44:41.000Z
src/Camera.cpp
rabowling/senior-project
07d7a1fba73376bc197f2ff045c057f0808d7612
[ "MIT" ]
null
null
null
src/Camera.cpp
rabowling/senior-project
07d7a1fba73376bc197f2ff045c057f0808d7612
[ "MIT" ]
null
null
null
#include "Camera.h" #include <glm/glm.hpp> #include <glm/gtc/matrix_transform.hpp> #include <cmath> #include <algorithm> #include <memory> #include <iostream> #include "Application.h" #define GLM_ENABLE_EXPERIMENTAL #include <glm/gtx/quaternion.hpp> using namespace std; using namespace glm; void Camera::update(glm::vec3 pos, float deltaYaw, float deltaPitch) { yaw -= deltaYaw; pitch = std::max(std::min(pitch + deltaPitch, radians(89.0)), -radians(89.0)); eye.x = pos.x; eye.y = pos.y; eye.z = pos.z; lookAtPoint.x = eye.x + cos(pitch) * sin(yaw); lookAtPoint.y = eye.y + sin(pitch); lookAtPoint.z = eye.z + cos(pitch) * cos(M_PI - yaw); } glm::mat4 Camera::getLookAt() { return glm::lookAt(eye, lookAtPoint, upVec); } void Camera::init(glm::vec3 pos, glm::vec3 lookDir, glm::vec3 upVec) { eye = pos; lookAtPoint = pos + lookDir; pitch = asin(lookDir.y); yaw = atan2(lookDir.x, -lookDir.z); this->upVec = upVec; } void Camera::toggleMode() { if (mode == FREE_CAM) { mode = FOLLOW_CAM; } else { mode = FREE_CAM; } } void Camera::scrollCallback(double deltaY) { radius = std::max(std::min(radius - deltaY, 50.0), 1.0); }
20.5
82
0.63252
rabowling
b86d3c30da3b6cdb850c35dba2153ee65ed1dcb4
770
cpp
C++
src/elona/random.cpp
nanbansenji/ElonaFoobar
ddbd6639db8698e89f09b2512526e855d8016e46
[ "MIT" ]
1
2020-09-11T05:09:53.000Z
2020-09-11T05:09:53.000Z
src/elona/random.cpp
AFB111/elonafoobar
da7a3c86dd45e68e6e490fb260ead1d67c9fff5e
[ "MIT" ]
4
2021-10-30T16:45:25.000Z
2021-11-23T06:25:43.000Z
src/elona/random.cpp
nanbansenji/ElonaFoobar
ddbd6639db8698e89f09b2512526e855d8016e46
[ "MIT" ]
null
null
null
#include "random.hpp" #include "gdata.hpp" namespace elona { namespace detail { xoshiro256::xoshiro256_engine engine{std::random_device{}()}; } // namespace detail void randomize() { ++game_data.random_seed_offset; randomize(game_data.random_seed + game_data.random_seed_offset); } int roll(int x, int y, int z) { if (x < 1) x = 1; if (y < 1) y = 1; int ret = 0; for (int i = 0; i < x; ++i) { ret += rnd_capped(y) + 1; } return ret + z; } int roll_max(int x, int y, int z) { return x * y + z; } int roundmargin(int x, int y) { if (x > y) return x - rnd_capped(x - y); else if (x < y) return x + rnd_capped(y - x); else return x; } } // namespace elona
13.050847
68
0.549351
nanbansenji
b87403c37289509837985f283a779204eeecb0a5
1,944
hpp
C++
Test/SimpleKernel.hpp
lamsoa729/STKFMM
26d7d971c198e3bed68eb8373e5590a6eb72f764
[ "Apache-2.0" ]
null
null
null
Test/SimpleKernel.hpp
lamsoa729/STKFMM
26d7d971c198e3bed68eb8373e5590a6eb72f764
[ "Apache-2.0" ]
null
null
null
Test/SimpleKernel.hpp
lamsoa729/STKFMM
26d7d971c198e3bed68eb8373e5590a6eb72f764
[ "Apache-2.0" ]
null
null
null
#ifndef SIMPLEKERNEL_HPP #define SIMPLEKERNEL_HPP // 3 3 4 4/16/9/7 void StokesSLPVel(double *s, double *t, double *f, double *pvel); void StokesSLPVelGrad(double *s, double *t, double *f, double *pvelGrad); void StokesSLTraction(double *s, double *t, double *f, double *traction); void StokesSLPVelLaplacian(double *s, double *t, double *f, double *pvelLaplacian); // 3 3 9 4/16/9/7 void StokesDLPVel(double *s, double *t, double *db, double *pvel); void StokesDLPVelGrad(double *s, double *t, double *db, double *pvelGrad); void StokesDLTraction(double *s, double *t, double *db, double *traction); void StokesDLPVelLaplacian(double *s, double *t, double *db, double *pvelLaplacian); // 3 3 1 4/10 void LaplaceSLPGrad(double *s, double *t, double *q, double *pgrad); void LaplaceSLPGradGrad(double *s, double *t, double *q, double *pgradgrad); // 3 3 3 4/10 void LaplaceDLPGrad(double *s, double *t, double *db, double *pgrad); void LaplaceDLPGradGrad(double *s, double *t, double *db, double *pgradgrad); // 3 3 9 10 void LaplaceQPGradGrad(double *s, double *t, double *q, double *pgradgrad); // void StokesRegSLVel(double *s, double *t, double *f, double *vel); void StokesRegSLVelOmega(double *s, double *t, double *f, double *velomega); // void StokesRegDLVel(double *s, double *t, double *f, double *vel); void StokesRegDLVelOmega(double *s, double *t, double *f, double *velomega); // void StokesSLRPY(double *s, double *t, double *f, double *vlapv); void StokesDLRPY(double *s, double *t, double *f, double *vlapv); void StokesSL(double *s, double *t, double *f, double *v); void StokesDL(double *s, double *t, double *f, double *v); // #endif
43.2
84
0.612654
lamsoa729
b87413395c10e909fc0cd6508677e37abb6f170d
880
cpp
C++
source/parlex/src/match.cpp
dlin172/Plange
4b36a1225b2263bc8d38a6d1cc9b50c3d4b58e04
[ "BSD-3-Clause" ]
null
null
null
source/parlex/src/match.cpp
dlin172/Plange
4b36a1225b2263bc8d38a6d1cc9b50c3d4b58e04
[ "BSD-3-Clause" ]
null
null
null
source/parlex/src/match.cpp
dlin172/Plange
4b36a1225b2263bc8d38a6d1cc9b50c3d4b58e04
[ "BSD-3-Clause" ]
null
null
null
#include "parlex/detail/match.hpp" #include "utils.hpp" namespace parlex { namespace detail { match::match(uint32_t documentPosition, uint16_t recognizerIndex, uint32_t const consumedCharacterCount) : match_class(documentPosition, recognizerIndex), consumed_character_count(consumedCharacterCount) {} match::match(struct match_class const & matchClass, uint32_t const consumedCharacterCount) : match_class(matchClass), consumed_character_count(consumedCharacterCount) { } match & match::operator=(match && move) noexcept { this->~match(); new (this) match(std::move(move)); return *this; } bool match::operator<(match const & rhs) const { if (this->match_class::operator<(rhs)) { return true; } if (rhs.match_class::operator<(*this)) { return false; } return consumed_character_count < rhs.consumed_character_count; } } // namespace detail } // namespace parlex
30.344828
206
0.763636
dlin172
b8760e4a5edd2aa80cfdd7bc84c4485846bba99d
2,837
hpp
C++
example/contrib/socks-client/socks/query.hpp
omegacoleman/beast
98bd70d8747ff42f2d825e0d9773e8ba37dfdefd
[ "BSL-1.0" ]
null
null
null
example/contrib/socks-client/socks/query.hpp
omegacoleman/beast
98bd70d8747ff42f2d825e0d9773e8ba37dfdefd
[ "BSL-1.0" ]
null
null
null
example/contrib/socks-client/socks/query.hpp
omegacoleman/beast
98bd70d8747ff42f2d825e0d9773e8ba37dfdefd
[ "BSL-1.0" ]
null
null
null
// // Copyright (c) 2018 jackarain (jack dot wgm at gmail dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // // Official repository: https://github.com/boostorg/beast // #ifndef SOCKS_QUERY_HPP #define SOCKS_QUERY_HPP #include <socks/config.hpp> #include <iterator> #include <utility> namespace socks { /** A ForwardRange representing a reference to a parsed query string. */ class query { public: explicit query(string_view s) : s_(s) { } class const_iterator { public: struct value_type { string_view name; string_view value; value_type const& operator*() const noexcept { return *this; } value_type const* operator->() const noexcept { return this; } }; using difference_type = std::ptrdiff_t; using reference = value_type; using pointer = const value_type; using iterator_category = std::forward_iterator_tag; const_iterator() = default; explicit const_iterator(string_view s) : s_(s) { parse(); } ~const_iterator() = default; reference operator*() const noexcept { return value_; } pointer operator->() const noexcept { return value_; } const_iterator& operator++() noexcept { increment(); return *this; } const_iterator operator++(int) noexcept { const_iterator tmp = *this; increment(); return tmp; } bool operator==(const const_iterator &other) const noexcept { if ((value_.name.data() == other.value_.name.data() && value_.name.size() == other.value_.name.size()) && (value_.value.data() == other.value_.value.data() && value_.value.size() == other.value_.value.size())) return true; return false; } bool operator!=(const const_iterator &other) const noexcept { return !(*this == other); } private: inline void parse() noexcept; inline void increment(); string_view s_; value_type value_; }; inline const_iterator begin() const { return const_iterator{s_}; } inline const_iterator end() const { return {}; } private: string_view s_; }; } // socks #include <socks/impl/query.ipp> #endif
19.701389
79
0.522735
omegacoleman
b877c5719762559aaef1cf34d76178d00a0c54cb
819
cpp
C++
Armenian SPOJ Solutions/OBCHESS.cpp
aristakesyanl/Armenian-Spoj-Solutions
89d9ed139b5fd93c56f16d2944317e912524a705
[ "MIT" ]
1
2021-03-31T12:45:15.000Z
2021-03-31T12:45:15.000Z
Armenian SPOJ Solutions/OBCHESS.cpp
aristakesyanl/Armenian-Spoj-Solutions
89d9ed139b5fd93c56f16d2944317e912524a705
[ "MIT" ]
null
null
null
Armenian SPOJ Solutions/OBCHESS.cpp
aristakesyanl/Armenian-Spoj-Solutions
89d9ed139b5fd93c56f16d2944317e912524a705
[ "MIT" ]
null
null
null
#include <iostream> #include <algorithm> #include<cmath> using namespace std; int ABS(int n) { if(n>=0) return n; return (-1)*n; } int main() { ios_base::sync_with_stdio(false); int arr[8][8]; for (int i = 0; i < 8; i++) { for (int j = 0; j < 8; j++) { cin >> arr[i][j]; } } int mx = 0, count; for (int i = 0; i < 7; i++) { for (int j = 0; j < 7; j++) { count = 0; if (ABS(arr[i][j]) != 4 && ABS(arr[i + 1][j]) != 4 && ABS(arr[i][j + 1]) != 4 && ABS(arr[i + 1][j + 1]) != 4) { count += arr[i][j] + arr[i + 1][j] + arr[i][j + 1] + arr[i + 1][j + 1]; mx = max(mx, count); } } } cout << mx << endl; return 0; }
19.5
121
0.367521
aristakesyanl
b87833d603759181855606047bf43b3748b9b03f
548
cpp
C++
Cpp/Math/Problems/fizzbuzz.cpp
mailtokartik1/InterviewBit-Solutions
8a9be25cf55947aff456c7c138e2ee6f518aa6a5
[ "MIT" ]
58
2019-06-15T01:35:06.000Z
2021-04-27T08:32:39.000Z
Math/Problems/fizzbuzz.cpp
mojo912/InterviewBit-Solutions
62fb19efff15bbe3b42183c12d2e6adf7c4c2a84
[ "MIT" ]
3
2019-06-17T00:20:13.000Z
2019-06-30T05:41:10.000Z
Math/Problems/fizzbuzz.cpp
mojo912/InterviewBit-Solutions
62fb19efff15bbe3b42183c12d2e6adf7c4c2a84
[ "MIT" ]
14
2019-06-15T01:35:09.000Z
2020-08-27T19:45:28.000Z
vector<string> Solution::fizzBuzz(int A) { vector<string> B(A); // check if (i + 1) is divisible by 3 or 5 for (int i = 0; i < B.size(); i ++) { if ((i + 1) % 3 == 0 && (i + 1) % 5 == 0) { B[i] = "FizzBuzz"; continue; } else if ((i + 1) % 3 == 0) { B[i] = "Fizz"; continue; } else if ((i + 1) % 5 == 0) { B[i] = "Buzz"; continue; } else { B[i] = to_string(i + 1); continue; } } return B; }
23.826087
51
0.355839
mailtokartik1
b8789b28ab839fd718c561e459903e13478f192f
753
cpp
C++
src/cells/src/lib/logic/display/MapDisplay.cpp
SimonPiCarter/GameEngine
10d366bd37d202a5a22eb504b2a2dd9a49669dc8
[ "Apache-2.0" ]
null
null
null
src/cells/src/lib/logic/display/MapDisplay.cpp
SimonPiCarter/GameEngine
10d366bd37d202a5a22eb504b2a2dd9a49669dc8
[ "Apache-2.0" ]
15
2021-05-18T14:16:03.000Z
2021-06-17T19:36:32.000Z
src/cells/src/lib/logic/display/MapDisplay.cpp
SimonPiCarter/GameEngine
10d366bd37d202a5a22eb504b2a2dd9a49669dc8
[ "Apache-2.0" ]
null
null
null
#include "MapDisplay.h" #include <engine/GraphicEngine.h> #include "logic/layout/MapLayout.h" MapDisplay::MapDisplay(std::string const &scene_p, MapLayout const * layout_p) : _scene(scene_p) , _layout(layout_p) {} MapDisplay * newMapDisplay(std::string const &scene_p, MapLayout const * layout_p, GraphicEngine & graphic_p) { MapDisplay * display_l = new MapDisplay(scene_p, layout_p); for(Tile const &tile_l : layout_p->getTile()) { display_l->getEntities().push_back(new GraphicEntity()); display_l->getEntities().back()->addData("tile", &tile_l); graphic_p.registerMessage(new NewGraphicEntityMessage(display_l->getEntities().back(), tile_l.resource, {double(tile_l.x), double(tile_l.y), -1.}, scene_p)); } return display_l; }
27.888889
109
0.737052
SimonPiCarter
b87f8b6080b1f1a434b2da9413584760af8b8b50
677
cpp
C++
BST/111. Minimum Depth of Binary Tree.cpp
YuPeize/LeetCode-
b01d00f28e1eedcb04aee9eca984685bd9d52791
[ "MIT" ]
null
null
null
BST/111. Minimum Depth of Binary Tree.cpp
YuPeize/LeetCode-
b01d00f28e1eedcb04aee9eca984685bd9d52791
[ "MIT" ]
null
null
null
BST/111. Minimum Depth of Binary Tree.cpp
YuPeize/LeetCode-
b01d00f28e1eedcb04aee9eca984685bd9d52791
[ "MIT" ]
null
null
null
/* author: ypz */ /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ class Solution { public: int minDepth(TreeNode* root) { if(root == NULL) return 0; else if(root -> left == NULL && root -> right == NULL) return 1; else { int min_depth = INT_MAX; if(root -> left != NULL) min_depth = min(min_depth, minDepth(root -> left)); if(root -> right != NULL) min_depth = min(min_depth, minDepth(root -> right)); return min_depth + 1; } } };
25.074074
90
0.524372
YuPeize
b8826393ac775fa038ff398105f4c36129eda5ab
2,042
cpp
C++
test/c++/nda_storage.cpp
Wentzell/nda
69106a64799e7942bf4b1b78fdadf3e7c9477c70
[ "Apache-2.0" ]
1
2022-03-08T06:35:19.000Z
2022-03-08T06:35:19.000Z
test/c++/nda_storage.cpp
smile1103/nda
ff2239b910a5964942833e07d282a8cea32cb6fa
[ "Apache-2.0" ]
null
null
null
test/c++/nda_storage.cpp
smile1103/nda
ff2239b910a5964942833e07d282a8cea32cb6fa
[ "Apache-2.0" ]
null
null
null
// Copyright (c) 2018-2021 Simons Foundation // // 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.txt // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // Authors: Olivier Parcollet, Nils Wentzell #include <gtest/gtest.h> // NOLINT #include <memory> #define NDA_DEBUG_MEMORY #include <nda/mem/handle.hpp> using namespace nda::mem; //--------------------------------------------- TEST(Storage, HR) { // NOLINT handle_heap<int, void> h{10}; // make sure it is a copy h.data()[2] = 89; handle_heap<int, void> h3{h}; h.data()[2] = 0; EXPECT_EQ(h3.data()[2], 89); //NOLINT } // ---- Construct R, S TEST(Storage, HSR) { // NOLINT handle_heap<int, void> h{10}; handle_shared<int> s{h}; EXPECT_EQ(s.refcount(), 2); //NOLINT } // ---- More complex TEST(Ref, HSRS) { // NOLINT handle_heap<int, void> h{10}; handle_shared<int> s{h}; EXPECT_EQ(s.refcount(), 2); //NOLINT s = handle_shared<int>{h}; EXPECT_EQ(s.refcount(), 2); //NOLINT handle_shared<int> s2{h}; s = s2; EXPECT_EQ(s.refcount(), 3); //NOLINT } // ---- check with something that is constructed/destructed. struct Number { int u = 9; static inline int c = 0; Number() { c++; std::cerr << "Constructing Number \n"; }; ~Number() { c--; std::cerr << "Destructing Number \n"; }; }; TEST(Storage, HR_with_cd) { // NOLINT { handle_heap<Number, void> h{5}; } EXPECT_EQ(Number::c, 0); //NOLINT } // --- check with a shared_ptr TEST(Storage, HR_with_sharedPtr) { // NOLINT { handle_shared<Number> s; } EXPECT_EQ(Number::c, 0); //NOLINT }
22.688889
75
0.635162
Wentzell
b886eef21a6ba7a1968b95823cded463ab384aad
4,874
cpp
C++
library/Java/Util/Concurrent/Semaphore/SemaphoreTest.cpp
foodtiny/native
9025d337c50951b2d31eb243d0b5414496171ea5
[ "Zlib" ]
19
2017-06-10T11:32:06.000Z
2018-07-07T13:38:50.000Z
library/Java/Util/Concurrent/Semaphore/SemaphoreTest.cpp
tinylife-io/native
9025d337c50951b2d31eb243d0b5414496171ea5
[ "Zlib" ]
188
2017-06-10T19:45:18.000Z
2018-07-27T16:52:21.000Z
library/Java/Util/Concurrent/Semaphore/SemaphoreTest.cpp
foodtiny/native
9025d337c50951b2d31eb243d0b5414496171ea5
[ "Zlib" ]
8
2017-06-23T06:59:16.000Z
2018-07-19T11:38:24.000Z
/** * Copyright 2017-2020 Tiny Express Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following disclaimer * in the documentation and/or other materials provided with the * distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "../../../../Test.hpp" #include "Semaphore.hpp" using namespace Java::Util::Concurrent; void SemaphoreTestThread(int sleepTime, int releasePermits, Semaphore* semaphore) { std::this_thread::sleep_for(std::chrono::milliseconds(sleepTime)); if(semaphore) semaphore->release(releasePermits); } void SemaphoreTestThread2(int sleepTime, int loopCount, Semaphore* semaphore) { for (int i = 0; i < loopCount; ++i) { std::this_thread::sleep_for(std::chrono::milliseconds(sleepTime)); if (semaphore) { semaphore->release(); } } } TEST(JavaUtilConcurrentSemaphore, Constructor) { { Semaphore semaphoreObject; assertEquals(0, semaphoreObject.availablePermits()); } { const int initPermits = 3; Semaphore semaphoreObject(initPermits); assertEquals(initPermits, semaphoreObject.availablePermits()); } } TEST(JavaUtilConcurrentSemaphore, ToString) { Semaphore semaphoreObject(3); String expect = "[Permits = 3]"; String result; result = semaphoreObject.toString(); assertEquals(expect.toString(), result.toString()); } TEST(JavaUtilConcurrentSemaphore, Release) { const int expectPermits = 2; Semaphore semaphoreObject(1); semaphoreObject.release(); assertEquals(semaphoreObject.availablePermits(), expectPermits); } TEST(JavaUtilConcurrentSemaphore, AcquireNotPassingPermits) { const int expectPermits = 0; Semaphore semaphoreObject; std::thread testThread(SemaphoreTestThread, 100, 1, &semaphoreObject); semaphoreObject.acquire(); if (testThread.joinable()) { testThread.join(); } assertEquals(expectPermits, semaphoreObject.availablePermits()); } TEST(JavaUtilConcurrentSemaphore, AcquirePassingPermits) { const int expectPermits = 1; const int threadCount = 3; Semaphore semaphoreObject; std::vector<std::thread> testThreads(threadCount); for (auto& it : testThreads) { it = std::move(std::thread(SemaphoreTestThread, 100, 1, &semaphoreObject)); } semaphoreObject.acquire(2); for (auto& it : testThreads) { if (it.joinable()) { it.join(); } } assertEquals(expectPermits, semaphoreObject.availablePermits()); } TEST(JavaUtilConcurrentSemaphore, TryAcquireNotPassingPermits) { const int expectPermits = 1; Semaphore semaphoreObject; std::thread testThread(SemaphoreTestThread, 100, 1, &semaphoreObject); boolean result = semaphoreObject.tryAcquire(); if (testThread.joinable()) { testThread.join(); } assertFalse(result); assertEquals(expectPermits, semaphoreObject.availablePermits()); } TEST(JavaUtilConcurrentSemaphore, TryAcquirePassingPermitsWithTimeout) { const int expectPermits = 0; Semaphore semaphoreObject; std::thread testThread(SemaphoreTestThread2, 100, 2, &semaphoreObject); semaphoreObject.release(); bool result = semaphoreObject.tryAcquire(3, 1000); if (testThread.joinable()) { testThread.join(); } assertTrue(result); assertEquals(expectPermits, semaphoreObject.availablePermits()); } TEST(JavaUtilConcurrentSemaphore, TryAcquirePassingPermitsWithInitPermits) { const int expectPermits = 1; Semaphore semaphoreObject(2); semaphoreObject.tryAcquire(); assertEquals(expectPermits, semaphoreObject.availablePermits()); }
33.383562
79
0.710915
foodtiny
b88bd9c3977e9eceafbfb8f74681164f293ea7ba
17,197
cpp
C++
source/Tokenizer.cpp
xzrunner/cslang
179b645c9693c3c791be11a32db877be483e9a48
[ "MIT" ]
null
null
null
source/Tokenizer.cpp
xzrunner/cslang
179b645c9693c3c791be11a32db877be483e9a48
[ "MIT" ]
null
null
null
source/Tokenizer.cpp
xzrunner/cslang
179b645c9693c3c791be11a32db877be483e9a48
[ "MIT" ]
null
null
null
#include "cslang/Tokenizer.h" #include "cslang/keyword.h" #define HIGH_4BIT(v) ((v) >> (8 * sizeof(int) - 4) & 0x0f) #define HIGH_3BIT(v) ((v) >> (8 * sizeof(int) - 3) & 0x07) #define HIGH_1BIT(v) ((v) >> (8 * sizeof(int) - 1) & 0x01) namespace { // todo: wide void AppendSTR(std::string& str, char* tmp, int len, int wide) { for (int i = 0; i < len; ++i) { str.push_back(tmp[i]); } str.push_back('\0'); } } namespace cslang { char* Tokenizer::TokenStrings[] = { "begin", #define TOKEN(k, s) s, #include "cslang/token_cfg.h" #undef TOKEN }; Tokenizer::Tokenizer(const char* str) : lexer::Tokenizer<TokenType>(str, str + strlen(str), "\"", '\\') { InitScanners(); } lexer::Tokenizer<TokenType>::Token Tokenizer::PeekToken() { auto old_val = m_token_val; auto ret = lexer::Tokenizer<TokenType>::PeekToken(); m_token_val = old_val; return ret; } void Tokenizer::SetSkipEol(bool skip_eol) { } lexer::Tokenizer<TokenType>::Token Tokenizer::EmitToken() { //DiscardWhile(Whitespace()); SkipWhiteSpace(); size_t start_line = Line(); size_t start_column = Column(); if (Eof()) { return Token(TK_END, nullptr, nullptr, Length(), start_line, start_column); } else { const char* begin_pos = CurPos(); auto token = m_scanners[(const unsigned char)(*begin_pos)](); const char* end_pos = CurPos(); return Token(token, begin_pos, end_pos, Offset(begin_pos), start_line, start_column); } } void Tokenizer::InitScanners() { for (int i = 0, n = END_OF_FILE + 1; i < n; ++i) { if (IsLetter(i)) { m_scanners[i] = std::bind(&Tokenizer::ScanIdentifier, this); } else if (IsDigit(i)) { m_scanners[i] = std::bind(&Tokenizer::ScanNumericLiteral, this); } else { m_scanners[i] = std::bind(&Tokenizer::ScanBadChar, this); } } m_scanners[END_OF_FILE] = std::bind(&Tokenizer::ScanEOF, this); m_scanners['\''] = std::bind(&Tokenizer::ScanCharLiteral, this); m_scanners['"'] = std::bind(&Tokenizer::ScanStringLiteralDoubleQuotes, this); m_scanners['`'] = std::bind(&Tokenizer::ScanStringLiteralSingleQuotes, this); m_scanners['+'] = std::bind(&Tokenizer::ScanPlus, this); m_scanners['-'] = std::bind(&Tokenizer::ScanMinus, this); m_scanners['*'] = std::bind(&Tokenizer::ScanStar, this); m_scanners['/'] = std::bind(&Tokenizer::ScanSlash, this); m_scanners['%'] = std::bind(&Tokenizer::ScanPercent, this); m_scanners['<'] = std::bind(&Tokenizer::ScanLess, this); m_scanners['>'] = std::bind(&Tokenizer::ScanGreat, this); m_scanners['!'] = std::bind(&Tokenizer::ScanExclamation, this); m_scanners['='] = std::bind(&Tokenizer::ScanEqual, this); m_scanners['|'] = std::bind(&Tokenizer::ScanBar, this); m_scanners['&'] = std::bind(&Tokenizer::ScanAmpersand, this); m_scanners['^'] = std::bind(&Tokenizer::ScanCaret, this); m_scanners['.'] = std::bind(&Tokenizer::ScanDot, this); m_scanners['{'] = std::bind(&Tokenizer::ScanLBRACE, this); m_scanners['}'] = std::bind(&Tokenizer::ScanRBRACE, this); m_scanners['['] = std::bind(&Tokenizer::ScanLBRACKET, this); m_scanners[']'] = std::bind(&Tokenizer::ScanRBRACKET, this); m_scanners['('] = std::bind(&Tokenizer::ScanLPAREN, this); m_scanners[')'] = std::bind(&Tokenizer::ScanRPAREN, this); m_scanners[','] = std::bind(&Tokenizer::ScanCOMMA, this); m_scanners[';'] = std::bind(&Tokenizer::ScanSEMICOLON, this); m_scanners['~'] = std::bind(&Tokenizer::ScanCOMP, this); m_scanners['?'] = std::bind(&Tokenizer::ScanQUESTION, this); m_scanners[':'] = std::bind(&Tokenizer::ScanCOLON, this); m_scanners['@'] = std::bind(&Tokenizer::ScanIdentifier, this); m_scanners['$'] = std::bind(&Tokenizer::ScanIdentifier, this); } TokenType Tokenizer::ScanIdentifier() { auto start = CurPos(); int tok; if (CurChar() == 'L') { if (NextChar() == '\'') { return ScanCharLiteral(); } if (NextChar() == '"') { return ScanStringLiteralDoubleQuotes(); } if (NextChar() == '`') { return ScanStringLiteralSingleQuotes(); } } Advance(); while (CurChar() == '@' || IsLetterOrDigit(CurChar())) { Advance(); } tok = FindKeyword(start, (int)(CurPos() - start)); if (tok == TK_ID) { m_token_val.p = (void*)(m_str_pool.InsertAndQuery(start, (int)(CurPos() - start))); } return static_cast<TokenType>(tok); } TokenType Tokenizer::ScanNumericLiteral() { auto start = CurPos(); int base = 10; if (CurChar() == '.') { return ScanFloatLiteral(start); } if (CurChar() == '0' && (NextChar() == 'x' || NextChar() == 'X')) { Advance(2); start = CurPos(); base = 16; if (!IsHexDigit(CurChar())) { // Error(&TokenCoord, "Expect hex digit"); m_token_val.i[0] = 0; return TK_INTCONST; } while (IsHexDigit(CurChar())) { Advance(); } } else if (CurChar() == '0') { Advance(); base = 8; while (IsOctDigit(CurChar())) { Advance(); } } else { Advance(); while (IsDigit(CurChar())) { Advance(); } } if (base == 16 || (CurChar() != '.' && CurChar() != 'e' && CurChar() != 'E')) { return ScanIntLiteral(start, (int)(CurPos() - start), base); } else { return ScanFloatLiteral(start); } } TokenType Tokenizer::ScanBadChar() { assert(0); // Error(&TokenCoord, "illegal character:\\x%x", CurChar()); return NextToken().GetType(); } TokenType Tokenizer::ScanEOF() { return cslang::TK_END; } TokenType Tokenizer::ScanCharLiteral() { int ch = 0; int count = 0; int wide = 0; if (CurChar() == 'L') { Advance(); wide = 1; } Advance(); while (CurChar() != '\'') { if (CurChar() == '\n' || CurChar() == END_OF_FILE) { break; } ch = CurChar() == '\\' ? ScanEscapeChar(wide) : CurCharAndAdvance(); count++; } if (CurChar() != '\'') { // Error(&TokenCoord, "Expect '"); } else { Advance(); if (count > 1) { // Warning(&TokenCoord, "Two many characters"); } } m_token_val.i[0] = ch; m_token_val.i[1] = 0; return TK_INTCONST; } TokenType Tokenizer::ScanStringLiteral(const char separator) { char tmp[512]; char *cp = tmp; int *wcp = (int *)tmp; int wide = 0; int len = 0; int maxlen = 512; int ch; std::string str; if (CurChar() == 'L') { Advance(); wide = 1; maxlen /= sizeof(int); } Advance(); next_string: while (CurChar() != separator) { if (CurChar() == '\n' || CurChar() == END_OF_FILE) break; ch = CurChar() == '\\' ? ScanEscapeChar(wide) : CurCharAndAdvance(); if (wide) { wcp[len] = ch; } else { cp[len] = (char)ch; } len++; if (len >= maxlen) { AppendSTR(str, tmp, len, wide); len = 0; } } if (CurChar() != separator) { // Error(&TokenCoord, "Expect \""); goto end_string; } Advance(); SkipWhiteSpace(); if (CurChar() == separator) { if (wide == 1) { // Error(&TokenCoord, "String wideness mismatch"); } Advance(); goto next_string; } else if (CurChar() == 'L' && NextChar() == separator) { if (wide == 0) { // Error(&TokenCoord, "String wideness mismatch"); } Advance(2); goto next_string; } end_string: AppendSTR(str, tmp, len, wide); m_token_val.p = (void*)(m_str_pool.InsertAndQuery(str)); return wide ? TK_WIDESTRING : TK_STRING; } TokenType Tokenizer::ScanStringLiteralDoubleQuotes() { return ScanStringLiteral('"'); } TokenType Tokenizer::ScanStringLiteralSingleQuotes() { return ScanStringLiteral('`'); } TokenType Tokenizer::ScanPlus() { Advance(); if (CurChar() == '+') { Advance(); return TK_INC; } else if (CurChar() == '=') { Advance(); return TK_ADD_ASSIGN; } else { return TK_ADD; } } TokenType Tokenizer::ScanMinus() { Advance(); if (CurChar() == '-') { Advance(); return TK_DEC; } else if (CurChar() == '=') { Advance(); return TK_SUB_ASSIGN; } else if (CurChar() == '>') { Advance(); return TK_POINTER; } else { return TK_SUB; } } TokenType Tokenizer::ScanStar() { Advance(); if (CurChar() == '=') { Advance(); return TK_MUL_ASSIGN; } else { return TK_MUL; } } TokenType Tokenizer::ScanSlash() { Advance(); if (CurChar() == '=') { Advance(); return TK_DIV_ASSIGN; } else { return TK_DIV; } } TokenType Tokenizer::ScanPercent() { Advance(); if (CurChar() == '=') { Advance(); return TK_MOD_ASSIGN; } else { return TK_MOD; } } TokenType Tokenizer::ScanLess() { Advance(); if (CurChar() == '<') { Advance(); if (CurChar() == '=') { Advance(); return TK_LSHIFT_ASSIGN; } return TK_LSHIFT; } else if (CurChar() == '=') { Advance(); return TK_LESS_EQ; } else { return TK_LESS; } } TokenType Tokenizer::ScanGreat() { Advance(); if (CurChar() == '>') { Advance(); if (CurChar() == '=') { Advance(); return TK_RSHIFT_ASSIGN; } return TK_RSHIFT; } else if (CurChar() == '=') { Advance(); return TK_GREAT_EQ; } else { return TK_GREAT; } } TokenType Tokenizer::ScanExclamation() { Advance(); if (CurChar() == '=') { Advance(); return TK_UNEQUAL; } else { return TK_NOT; } } TokenType Tokenizer::ScanEqual() { Advance(); if (CurChar() == '=') { Advance(); return TK_EQUAL; } else { return TK_ASSIGN; } } TokenType Tokenizer::ScanBar() { Advance(); if (CurChar() == '|') { Advance(); return TK_OR; } else if (CurChar() == '=') { Advance(); return TK_BITOR_ASSIGN; } else { return TK_BITOR; } } TokenType Tokenizer::ScanAmpersand() { Advance(); if (CurChar() == '&') { Advance(); return TK_AND; } else if (CurChar() == '=') { Advance(); return TK_BITAND_ASSIGN; } else { return TK_BITAND; } } TokenType Tokenizer::ScanCaret() { Advance(); if (CurChar() == '=') { Advance(); return TK_BITXOR_ASSIGN; } else { return TK_BITXOR; } } TokenType Tokenizer::ScanDot() { if (IsDigit(NextChar())) { return ScanFloatLiteral(CurPos()); } else if (NextChar() == '.' && NextNextChar() == '.') { Advance(3); return TK_ELLIPSE; } else { Advance(); return TK_DOT; } } #define SINGLE_CHAR_SCANNER(t) \ TokenType Tokenizer::Scan##t() \ { \ Advance(); \ return TK_##t; \ } SINGLE_CHAR_SCANNER(LBRACE) SINGLE_CHAR_SCANNER(RBRACE) SINGLE_CHAR_SCANNER(LBRACKET) SINGLE_CHAR_SCANNER(RBRACKET) SINGLE_CHAR_SCANNER(LPAREN) SINGLE_CHAR_SCANNER(RPAREN) SINGLE_CHAR_SCANNER(COMMA) SINGLE_CHAR_SCANNER(SEMICOLON) SINGLE_CHAR_SCANNER(COMP) SINGLE_CHAR_SCANNER(QUESTION) SINGLE_CHAR_SCANNER(COLON) int Tokenizer::ScanEscapeChar(int wide) { int v = 0, overflow = 0; Advance(); auto c = CurChar(); Advance(); switch (c) { case 'a': return '\a'; case 'b': return '\b'; case 'f': return '\f'; case 'n': return '\n'; case 'r': return '\r'; case 't': return '\t'; case 'v': return '\v'; case '\'': case '"': case '`': case '\\': case '\?': return c; case 'x': if (!IsHexDigit(CurChar())) { // Error(&TokenCoord, "Expect hex digit"); return 'x'; } v = 0; while (IsHexDigit(CurChar())) { //if (v >> (WCharType->size - 4)) //{ // overflow = 1; //} if (IsDigit(CurChar())) { v = (v << 4) + CurChar() - '0'; } else { v = (v << 4) + ToUpper(CurChar()) - 'A' + 10; } Advance(); } if (overflow || (! wide && v > 255)) { // Warning(&TokenCoord, "Hexademical espace sequence overflow"); } return v; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': v = c - '0'; if (IsOctDigit(CurChar())) { v = (v << 3) + CurChar() - '0'; Advance(); if (IsOctDigit(CurChar())) { v = (v << 3) + CurChar() - '0'; Advance(); } } return v; default: // Warning(&TokenCoord, "Unrecognized escape sequence:\\%c", CurChar()); return CurChar(); } } TokenType Tokenizer::ScanFloatLiteral(const char* start) { double d; if (CurChar() == '.') { Advance(); while (IsDigit(CurChar())) { Advance(); } } if (CurChar() == 'e' || CurChar() == 'E') { Advance(); if (CurChar() == '+' || CurChar() == '-') { Advance(); } if (! IsDigit(CurChar())) { // Error(&TokenCoord, "Expect exponent value"); } else { while (IsDigit(CurChar())) { Advance(); } } } errno = 0; d = strtod((char *)start, NULL); if (errno == ERANGE) { // Warning(&TokenCoord, "Float literal overflow"); } m_token_val.d = d; if (CurChar() == 'f' || CurChar() == 'F') { Advance(); m_token_val.f = (float)d; return TK_FLOATCONST; } else if (CurChar() == 'L' || CurChar() == 'l') { Advance(); return TK_LDOUBLECONST; } else { return TK_DOUBLECONST; } } TokenType Tokenizer::ScanIntLiteral(const char* start, int len, int base) { const char *p = start; const char *end = start + len; unsigned int i[2] = {0, 0}; TokenType tok = TK_INTCONST; int d = 0; int carry0 = 0, carry1 = 0; int overflow = 0; while (p != end) { if (base == 16) { if ((*p >= 'A' && *p <= 'F') || (*p >= 'a' && *p <= 'f')) { d = ToUpper(*p) - 'A' + 10; } else { d = *p - '0'; } } else { d = *p - '0'; } switch (base) { case 16: carry0 = HIGH_4BIT(i[0]); carry1 = HIGH_4BIT(i[1]); i[0] = i[0] << 4; i[1] = i[1] << 4; break; case 8: carry0 = HIGH_3BIT(i[0]); carry1 = HIGH_3BIT(i[1]); i[0] = i[0] << 3; i[1] = i[1] << 3; break; case 10: { unsigned int t1, t2; carry0 = HIGH_3BIT(i[0]) + HIGH_1BIT(i[0]); carry1 = HIGH_3BIT(i[1]) + HIGH_1BIT(i[1]); t1 = i[0] << 3; t2 = i[0] << 1; if (t1 > UINT_MAX - t2) { carry0++; } i[0] = t1 + t2; t1 = i[1] << 3; t2 = i[1] << 1; if (t1 > UINT_MAX - t2) { carry1++; } i[1] = t1 + t2; } break; } if (i[0] > UINT_MAX - d) { carry0 += i[0] - (UINT_MAX - d); } if (carry1 || (i[1] > UINT_MAX - carry0)) { overflow = 1; } i[0] += d; i[1] += carry0; p++; } if (overflow || i[1] != 0) { // Warning(&TokenCoord, "Integer literal is too big"); } m_token_val.i[1] = 0; m_token_val.i[0] = i[0]; tok = TK_INTCONST; if (CurChar() == 'U' || CurChar() == 'u') { Advance(); if (tok == TK_INTCONST) { tok = TK_UINTCONST; } else if (tok == TK_LLONGCONST) { tok = TK_ULLONGCONST; } } if (CurChar() == 'L' || CurChar() == 'l') { Advance(); if (tok == TK_INTCONST) { tok = TK_LONGCONST; } else if (tok == TK_UINTCONST) { tok = TK_ULONGCONST; } if (CurChar() == 'L' || CurChar() == 'l') { Advance(); if (tok < TK_LLONGCONST) { tok = TK_LLONGCONST; }} } return tok; } void Tokenizer::SkipWhiteSpace() { int ch; //again: ch = CurChar(); while (ch == '\t' || ch == '\v' || ch == '\f' || ch == ' ' || ch == '\r' || ch == '\n' || ch == '/' || ch == '#') { switch (ch) { case '\n': Advance(); //TokenCoord.ppline++; //LINE++; //LINEHEAD = ++CURSOR; break; case '#': // ScanPPLine(); Advance(); while (CurChar() != '\n' && CurChar() != END_OF_FILE) { Advance(); } break; case '/': if (NextChar() != '/' && NextChar() != '*') { return; } Advance(); if (CurChar() == '/') { Advance(); while (CurChar() != '\n' && CurChar() != END_OF_FILE) { Advance(); } } else { Advance(2); while (CurChar() != '*' || NextChar() != '/') { if (CurChar() == '\n') { //TokenCoord.ppline++; //LINE++; } else if (CurChar() == END_OF_FILE || NextChar() == END_OF_FILE) { assert(0); // Error(&TokenCoord, "Comment is not closed"); return; } Advance(); } Advance(2); } break; default: Advance(); break; } ch = CurChar(); } //if (ExtraWhiteSpace != NULL) //{ // char *p; // FOR_EACH_ITEM(char*, p, ExtraWhiteSpace) // if (strncmp(CURSOR, p, strlen(p)) == 0) // { // CURSOR += strlen(p); // goto again; // } // ENDFOR //} } int Tokenizer::FindKeyword(const char* str, int len) const { struct keyword *p = NULL; int index = 0; if (IsLetter(*str) && *str != '_') { index = ToUpper(*str) - 'A' + 1; } p = keywords[index]; while (p->name) { if (p->len == len && strncmp((const char*)(str), p->name, len) == 0) { break; } p++; } return p->tok; } }
17.747162
93
0.531314
xzrunner
b88f7497c90b2b2e511bbd11481fae6b85a1507e
531
cc
C++
Daily_Problem/2101/Beginning/210109_Best_Time_To_Buy_And_Sell_Stock_III/method1/solution.cc
sheriby/DandAInLeetCode
dd7f5029aa0c297ea82bb20f882b524789f35c96
[ "MIT" ]
1
2020-02-07T12:25:56.000Z
2020-02-07T12:25:56.000Z
Daily_Problem/2101/Beginning/210109_Best_Time_To_Buy_And_Sell_Stock_III/method1/solution.cc
sheriby/DandAInLeetCode
dd7f5029aa0c297ea82bb20f882b524789f35c96
[ "MIT" ]
null
null
null
Daily_Problem/2101/Beginning/210109_Best_Time_To_Buy_And_Sell_Stock_III/method1/solution.cc
sheriby/DandAInLeetCode
dd7f5029aa0c297ea82bb20f882b524789f35c96
[ "MIT" ]
null
null
null
#include <vector> using std::vector; class Solution { public: // 又是股票问题,动态规划 int maxProfit(vector<int>& prices) { int n = prices.size(); int buy1 = -prices[0], sell1 = 0; int buy2 = -prices[0], sell2 = 0; for (int i = 1; i < n; ++i) { buy1 = std::max(buy1, -prices[i]); sell1 = std::max(sell1, buy1 + prices[i]); buy2 = std::max(buy2, sell1 - prices[i]); sell2 = std::max(sell2, buy2 + prices[i]); } return sell2; } };
26.55
54
0.489642
sheriby
b890d8a0ca6fcb2177fe596be01eb0c34c4cc758
5,149
cpp
C++
samples/Common/SampleFramework_Windows.cpp
SoulForMachine/GLSlayer
37a0fab90c4e2c3a22279cc93d39e8f3091b5e12
[ "MIT" ]
null
null
null
samples/Common/SampleFramework_Windows.cpp
SoulForMachine/GLSlayer
37a0fab90c4e2c3a22279cc93d39e8f3091b5e12
[ "MIT" ]
1
2017-10-24T12:19:52.000Z
2017-10-24T12:19:52.000Z
samples/Common/SampleFramework_Windows.cpp
SoulForMachine/GLSlayer
37a0fab90c4e2c3a22279cc93d39e8f3091b5e12
[ "MIT" ]
null
null
null
#include "SampleFramework_Windows.h" #include <cassert> #include "GLSlayer/RenderContextInit.h" #include "ISample.h" #pragma comment(lib, "winmm.lib") #pragma comment(lib, "GLSlayer.lib") SampleFramework::SampleFramework(const wchar_t* name, int wndWidth, int wndHeight) : _appName(name) , _wndWidth(wndWidth) , _wndHeight(wndHeight) , _hinstance(NULL) , _hwnd(NULL) , _prevMouseX(0) , _prevMouseY(0) , _lbtnDown(false), _rbtnDown(false), _mbtnDown(false) , _sample(nullptr) { } SampleFramework::~SampleFramework() { delete _sample; } int SampleFramework::Run(ISample* sample) { _hinstance = (HINSTANCE)GetModuleHandle(0); _sample = sample; if(!MyCreateWindow()) return 1; timeBeginPeriod(1); int frame_time; int prev_time = timeGetTime(); int curr_time; MSG msg = { 0 }; while(msg.message != WM_QUIT) { do { curr_time = timeGetTime(); frame_time = curr_time - prev_time; } while(frame_time < 1); prev_time = curr_time; if(PeekMessage(&msg, 0, 0, 0, PM_REMOVE)) { TranslateMessage(&msg); DispatchMessage(&msg); } _sample->Render(frame_time * 0.001f); } timeEndPeriod(1); return (int)msg.wParam; } void SampleFramework::OnSize(int width, int height) { _sample->OnResize(width, height); _wndWidth = width; _wndHeight = height; } void SampleFramework::OnMouseMove(int x, int y) { _sample->OnMouseMove(x, y); if(_lbtnDown) { _sample->OnMouseDrag(x - _prevMouseX, y - _prevMouseY); _prevMouseX = x; _prevMouseY = y; } } void SampleFramework::OnLBtnDown(int x, int y) { _lbtnDown = true; _prevMouseX = x; _prevMouseY = y; SetCapture(_hwnd); _sample->OnLBtnDown(x, y); } void SampleFramework::OnRBtnDown(int x, int y) { _rbtnDown = true; _prevMouseX = x; _prevMouseY = y; SetCapture(_hwnd); _sample->OnRBtnDown(x, y); } void SampleFramework::OnMBtnDown(int x, int y) { _mbtnDown = true; _prevMouseX = x; _prevMouseY = y; SetCapture(_hwnd); _sample->OnMBtnDown(x, y); } void SampleFramework::OnLBtnUp(int x, int y) { _lbtnDown = false; ReleaseCapture(); _sample->OnLBtnUp(x, y); } void SampleFramework::OnRBtnUp(int x, int y) { _rbtnDown = false; ReleaseCapture(); _sample->OnRBtnUp(x, y); } void SampleFramework::OnMBtnUp(int x, int y) { _mbtnDown = false; ReleaseCapture(); _sample->OnMBtnUp(x, y); } void SampleFramework::OnKeyDown(int key) { _sample->OnKeyDown(key); } void SampleFramework::OnKeyUp(int key) { _sample->OnKeyUp(key); } bool SampleFramework::MyCreateWindow() { TCHAR wndClass[] = TEXT("GLSlayer samples wnd class"); WNDCLASS wc; memset(&wc, 0, sizeof(wc)); wc.hInstance = _hinstance; wc.style = CS_OWNDC; wc.lpszClassName = wndClass; wc.lpfnWndProc = WndProc; wc.hCursor = LoadCursor(0, IDC_ARROW); if(RegisterClass(&wc)) { RECT rect = { 100, 100, 100 + _wndWidth, 100 + _wndHeight }; AdjustWindowRect(&rect, WS_OVERLAPPEDWINDOW | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, FALSE); _hwnd = CreateWindow( wndClass, _appName.c_str(), WS_OVERLAPPEDWINDOW | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, 0, 0, _hinstance, 0); gls::FramebufferFormat format; _sample->GetFramebufferFormat(format); gls::CreateContextInfo info; info.debugContext = false; info.format = &format; info.instanceHandle = _hinstance; info.windowHandle = _hwnd; info.logger = nullptr; info.version = 330; info.shareContext = nullptr; if(!_sample->Init(info)) { getc(stdin); return false; } _sample->OnResize(_wndWidth, _wndHeight); if(_hwnd) SetWindowLongPtr(_hwnd, GWLP_USERDATA, (LONG_PTR)this); return _hwnd != 0; } else { return false; } } bool SampleFramework::WindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { switch(message) { case WM_CREATE: return true; case WM_DESTROY: _sample->Deinit(); PostQuitMessage(0); return true; case WM_SIZE: OnSize(LOWORD(lParam), HIWORD(lParam)); return true; case WM_KEYDOWN: if ((lParam & (1 << 30)) == 0) { if (wParam == VK_ESCAPE) DestroyWindow(_hwnd); else OnKeyDown((int)wParam); } return true; case WM_KEYUP: OnKeyUp((int)wParam); return true; case WM_MOUSEMOVE: OnMouseMove(LOWORD(lParam), HIWORD(lParam)); return true; case WM_LBUTTONDOWN: OnLBtnDown(LOWORD(lParam), HIWORD(lParam)); return true; case WM_RBUTTONDOWN: OnRBtnDown(LOWORD(lParam), HIWORD(lParam)); return true; case WM_MBUTTONDOWN: OnMBtnDown(LOWORD(lParam), HIWORD(lParam)); return true; case WM_LBUTTONUP: OnLBtnUp(LOWORD(lParam), HIWORD(lParam)); return true; case WM_RBUTTONUP: OnRBtnUp(LOWORD(lParam), HIWORD(lParam)); return true; case WM_MBUTTONUP: OnMBtnUp(LOWORD(lParam), HIWORD(lParam)); return true; } return false; } LRESULT WINAPI SampleFramework::WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { SampleFramework* framework = (SampleFramework*)GetWindowLongPtr(hwnd, GWLP_USERDATA); if(framework) { if(framework->WindowProc(hwnd, message, wParam, lParam)) return 0; } return DefWindowProc(hwnd, message, wParam, lParam); }
18.655797
122
0.703632
SoulForMachine
b8959baefbe63158ad4c81e5b51e6c6f8542f7ea
774
cpp
C++
addons/role/config.cpp
JeffPerk/HavocTeam
6fb616c41da4baece79ebac941bac72a78c715f9
[ "MIT" ]
null
null
null
addons/role/config.cpp
JeffPerk/HavocTeam
6fb616c41da4baece79ebac941bac72a78c715f9
[ "MIT" ]
7
2021-11-22T04:36:52.000Z
2021-12-13T18:55:24.000Z
addons/role/config.cpp
JeffPerk/HavocTeam
6fb616c41da4baece79ebac941bac72a78c715f9
[ "MIT" ]
null
null
null
#include "script_component.hpp" class CfgPatches { class ADDON { name = COMPONENT_NAME; units[] = {}; weapons[] = {}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"havoc_main"}; author = ""; authors[] = {""}; VERSION_CONFIG; }; }; #include "CfgEventHandlers.hpp" class CfgVehicles { class Logic; class Module_F: Logic { class AttributesBase { class Default; class Edit; class Combo; class Checkbox; class CheckboxNumber; class ModuleDescription; class Units; }; class ModuleDescription { class AnyBrain; }; }; #include "ServicingModule.hpp" };
21.5
43
0.52584
JeffPerk
b896eac1a6f0c72429150e6a6b60f352dc5abbc0
200,737
inl
C++
2d_samples/pmj02_65.inl
st-ario/rayme
315c57c23f4aa4934a8a80e84e3243acd3400808
[ "MIT" ]
1
2021-12-10T23:35:04.000Z
2021-12-10T23:35:04.000Z
2d_samples/pmj02_65.inl
st-ario/rayme
315c57c23f4aa4934a8a80e84e3243acd3400808
[ "MIT" ]
null
null
null
2d_samples/pmj02_65.inl
st-ario/rayme
315c57c23f4aa4934a8a80e84e3243acd3400808
[ "MIT" ]
null
null
null
{std::array<float,2>{0.112185247f, 0.532156646f}, std::array<float,2>{0.805555999f, 0.294173867f}, std::array<float,2>{0.498026997f, 0.193157688f}, std::array<float,2>{0.589425921f, 0.773976266f}, std::array<float,2>{0.302895069f, 0.95057106f}, std::array<float,2>{0.746437192f, 0.122187138f}, std::array<float,2>{0.221811786f, 0.498222202f}, std::array<float,2>{0.941742122f, 0.742599845f}, std::array<float,2>{0.173526734f, 0.854069889f}, std::array<float,2>{0.916945159f, 0.156616345f}, std::array<float,2>{0.351841062f, 0.352608204f}, std::array<float,2>{0.684383512f, 0.575148344f}, std::array<float,2>{0.404271871f, 0.635546386f}, std::array<float,2>{0.543545306f, 0.414887518f}, std::array<float,2>{0.0428481586f, 0.0199298225f}, std::array<float,2>{0.845231175f, 0.884612501f}, std::array<float,2>{0.192007869f, 0.712338626f}, std::array<float,2>{0.990291417f, 0.460248798f}, std::array<float,2>{0.267678559f, 0.0911827087f}, std::array<float,2>{0.697911263f, 0.968895793f}, std::array<float,2>{0.461822122f, 0.811499357f}, std::array<float,2>{0.612105966f, 0.228237599f}, std::array<float,2>{0.0852213502f, 0.266164273f}, std::array<float,2>{0.768468261f, 0.507154882f}, std::array<float,2>{0.0298295897f, 0.93314904f}, std::array<float,2>{0.813924253f, 0.0435464159f}, std::array<float,2>{0.413225949f, 0.380271047f}, std::array<float,2>{0.511019409f, 0.673718572f}, std::array<float,2>{0.34136942f, 0.612428308f}, std::array<float,2>{0.633708239f, 0.341249019f}, std::array<float,2>{0.15585199f, 0.126752019f}, std::array<float,2>{0.893630862f, 0.813053489f}, std::array<float,2>{0.138817757f, 0.588004589f}, std::array<float,2>{0.882401049f, 0.366735935f}, std::array<float,2>{0.312701911f, 0.185136929f}, std::array<float,2>{0.649302244f, 0.864154041f}, std::array<float,2>{0.434954524f, 0.905973613f}, std::array<float,2>{0.517594993f, 0.0156225609f}, std::array<float,2>{3.00436732e-05f, 0.424245983f}, std::array<float,2>{0.830333233f, 0.643448114f}, std::array<float,2>{0.0709356964f, 0.752980769f}, std::array<float,2>{0.752108634f, 0.204618424f}, std::array<float,2>{0.442528248f, 0.305537552f}, std::array<float,2>{0.602644444f, 0.559436321f}, std::array<float,2>{0.258999646f, 0.734360874f}, std::array<float,2>{0.705162942f, 0.4815602f}, std::array<float,2>{0.217242405f, 0.105573364f}, std::array<float,2>{0.978556097f, 0.966714919f}, std::array<float,2>{0.0550860688f, 0.668911517f}, std::array<float,2>{0.870254457f, 0.402015895f}, std::array<float,2>{0.375025481f, 0.0530397557f}, std::array<float,2>{0.552862406f, 0.90701139f}, std::array<float,2>{0.364889592f, 0.828967869f}, std::array<float,2>{0.664134324f, 0.148874298f}, std::array<float,2>{0.162039414f, 0.315158248f}, std::array<float,2>{0.926505029f, 0.605654657f}, std::array<float,2>{0.244329304f, 0.986720443f}, std::array<float,2>{0.957303107f, 0.0686075538f}, std::array<float,2>{0.290590197f, 0.448301733f}, std::array<float,2>{0.721686125f, 0.702774823f}, std::array<float,2>{0.476069599f, 0.526690185f}, std::array<float,2>{0.564786613f, 0.255264699f}, std::array<float,2>{0.0981593207f, 0.249778956f}, std::array<float,2>{0.790604234f, 0.783509016f}, std::array<float,2>{0.0123531576f, 0.599331677f}, std::array<float,2>{0.842665136f, 0.324929714f}, std::array<float,2>{0.423978329f, 0.141387805f}, std::array<float,2>{0.529057682f, 0.841314912f}, std::array<float,2>{0.32100758f, 0.915581763f}, std::array<float,2>{0.645319283f, 0.0609282032f}, std::array<float,2>{0.131507248f, 0.398309171f}, std::array<float,2>{0.890025139f, 0.659049094f}, std::array<float,2>{0.205411002f, 0.791914403f}, std::array<float,2>{0.975155532f, 0.239241511f}, std::array<float,2>{0.252271175f, 0.261697829f}, std::array<float,2>{0.713240445f, 0.521208346f}, std::array<float,2>{0.446309984f, 0.687623382f}, std::array<float,2>{0.594470501f, 0.44477731f}, std::array<float,2>{0.0657962114f, 0.0740707666f}, std::array<float,2>{0.759033382f, 0.994657397f}, std::array<float,2>{0.168296456f, 0.650589764f}, std::array<float,2>{0.933498502f, 0.433969647f}, std::array<float,2>{0.37225768f, 0.00311180949f}, std::array<float,2>{0.656460583f, 0.894827366f}, std::array<float,2>{0.386887074f, 0.869111598f}, std::array<float,2>{0.55974102f, 0.177545518f}, std::array<float,2>{0.0529667288f, 0.370822579f}, std::array<float,2>{0.86416477f, 0.579805076f}, std::array<float,2>{0.103572138f, 0.956803679f}, std::array<float,2>{0.784256995f, 0.0992000997f}, std::array<float,2>{0.480489552f, 0.471540987f}, std::array<float,2>{0.573130846f, 0.725436687f}, std::array<float,2>{0.286347389f, 0.552410364f}, std::array<float,2>{0.731559634f, 0.304466844f}, std::array<float,2>{0.240695864f, 0.212877885f}, std::array<float,2>{0.965318918f, 0.759797931f}, std::array<float,2>{0.22836788f, 0.514804065f}, std::array<float,2>{0.949275315f, 0.275288284f}, std::array<float,2>{0.312276989f, 0.222422272f}, std::array<float,2>{0.735168576f, 0.802598774f}, std::array<float,2>{0.490124077f, 0.979659677f}, std::array<float,2>{0.580155373f, 0.0802197531f}, std::array<float,2>{0.124565028f, 0.462355584f}, std::array<float,2>{0.804333627f, 0.708025634f}, std::array<float,2>{0.0358240716f, 0.823065758f}, std::array<float,2>{0.854834259f, 0.137886703f}, std::array<float,2>{0.391126394f, 0.335122436f}, std::array<float,2>{0.533818662f, 0.622145712f}, std::array<float,2>{0.346718371f, 0.681318164f}, std::array<float,2>{0.673243165f, 0.390057653f}, std::array<float,2>{0.182444572f, 0.0359744094f}, std::array<float,2>{0.912699878f, 0.922671378f}, std::array<float,2>{0.0916199982f, 0.734637558f}, std::array<float,2>{0.780475676f, 0.486433715f}, std::array<float,2>{0.459549248f, 0.110545792f}, std::array<float,2>{0.619742513f, 0.942438722f}, std::array<float,2>{0.275257736f, 0.771920919f}, std::array<float,2>{0.695157111f, 0.199900761f}, std::array<float,2>{0.200857058f, 0.288188249f}, std::array<float,2>{0.994386852f, 0.54019624f}, std::array<float,2>{0.146813363f, 0.876980782f}, std::array<float,2>{0.902187169f, 0.0246788524f}, std::array<float,2>{0.331182331f, 0.40888533f}, std::array<float,2>{0.625555933f, 0.625919163f}, std::array<float,2>{0.414133221f, 0.563639998f}, std::array<float,2>{0.502443254f, 0.345862418f}, std::array<float,2>{0.017567141f, 0.171861798f}, std::array<float,2>{0.826738298f, 0.845937133f}, std::array<float,2>{0.0675344616f, 0.572146893f}, std::array<float,2>{0.764580727f, 0.356203973f}, std::array<float,2>{0.450920552f, 0.162385747f}, std::array<float,2>{0.597978652f, 0.858436286f}, std::array<float,2>{0.256369859f, 0.889572918f}, std::array<float,2>{0.718715966f, 0.0188762322f}, std::array<float,2>{0.209898159f, 0.418716162f}, std::array<float,2>{0.970713317f, 0.639340162f}, std::array<float,2>{0.127299801f, 0.780729294f}, std::array<float,2>{0.886696339f, 0.190778553f}, std::array<float,2>{0.32467255f, 0.290578455f}, std::array<float,2>{0.642829597f, 0.535207927f}, std::array<float,2>{0.42785725f, 0.746482074f}, std::array<float,2>{0.523574889f, 0.492682368f}, std::array<float,2>{0.00786410831f, 0.118884064f}, std::array<float,2>{0.837913632f, 0.948136985f}, std::array<float,2>{0.236147523f, 0.677814722f}, std::array<float,2>{0.961665213f, 0.378091097f}, std::array<float,2>{0.284996599f, 0.0415630341f}, std::array<float,2>{0.727103353f, 0.934601724f}, std::array<float,2>{0.479053527f, 0.819710612f}, std::array<float,2>{0.577709436f, 0.132007062f}, std::array<float,2>{0.109275378f, 0.336327255f}, std::array<float,2>{0.786749959f, 0.6143139f}, std::array<float,2>{0.0504398495f, 0.973837435f}, std::array<float,2>{0.861447513f, 0.0874697939f}, std::array<float,2>{0.383807421f, 0.455087274f}, std::array<float,2>{0.558201194f, 0.715522051f}, std::array<float,2>{0.368496776f, 0.503275275f}, std::array<float,2>{0.663259685f, 0.271937579f}, std::array<float,2>{0.16747053f, 0.231200233f}, std::array<float,2>{0.935084701f, 0.806660295f}, std::array<float,2>{0.18544507f, 0.557387769f}, std::array<float,2>{0.906721652f, 0.309752584f}, std::array<float,2>{0.349231005f, 0.208640084f}, std::array<float,2>{0.677654564f, 0.754760623f}, std::array<float,2>{0.397155404f, 0.961542785f}, std::array<float,2>{0.536211908f, 0.103881121f}, std::array<float,2>{0.0317263417f, 0.479889691f}, std::array<float,2>{0.85911268f, 0.726684153f}, std::array<float,2>{0.11893712f, 0.861945391f}, std::array<float,2>{0.798041463f, 0.181337729f}, std::array<float,2>{0.48722896f, 0.362950802f}, std::array<float,2>{0.584350288f, 0.590275705f}, std::array<float,2>{0.304784119f, 0.647166371f}, std::array<float,2>{0.738379955f, 0.429585904f}, std::array<float,2>{0.230682671f, 0.0110880006f}, std::array<float,2>{0.948824584f, 0.901800394f}, std::array<float,2>{0.0204476602f, 0.696031153f}, std::array<float,2>{0.821082473f, 0.451492757f}, std::array<float,2>{0.41896835f, 0.066150263f}, std::array<float,2>{0.506696343f, 0.988766253f}, std::array<float,2>{0.332484365f, 0.786638677f}, std::array<float,2>{0.629140377f, 0.242646128f}, std::array<float,2>{0.142602563f, 0.253514022f}, std::array<float,2>{0.902831256f, 0.528041065f}, std::array<float,2>{0.195815384f, 0.910803378f}, std::array<float,2>{0.9994362f, 0.0481682718f}, std::array<float,2>{0.280084312f, 0.402848721f}, std::array<float,2>{0.690998197f, 0.667951345f}, std::array<float,2>{0.453444093f, 0.603569746f}, std::array<float,2>{0.624296904f, 0.317736059f}, std::array<float,2>{0.087080799f, 0.154187337f}, std::array<float,2>{0.776428282f, 0.832623065f}, std::array<float,2>{0.046405945f, 0.517081618f}, std::array<float,2>{0.848900795f, 0.26430583f}, std::array<float,2>{0.401711911f, 0.237122223f}, std::array<float,2>{0.542473376f, 0.796061456f}, std::array<float,2>{0.356996328f, 0.996414602f}, std::array<float,2>{0.681079626f, 0.0776330009f}, std::array<float,2>{0.176430538f, 0.439159036f}, std::array<float,2>{0.919850171f, 0.693468571f}, std::array<float,2>{0.224026814f, 0.839633584f}, std::array<float,2>{0.940591276f, 0.147627383f}, std::array<float,2>{0.297416985f, 0.324061871f}, std::array<float,2>{0.742870867f, 0.594821155f}, std::array<float,2>{0.492811173f, 0.661402524f}, std::array<float,2>{0.593067467f, 0.392717183f}, std::array<float,2>{0.117058344f, 0.0547057465f}, std::array<float,2>{0.810603976f, 0.920797527f}, std::array<float,2>{0.151568025f, 0.720839143f}, std::array<float,2>{0.895915031f, 0.47498703f}, std::array<float,2>{0.339358628f, 0.0951850414f}, std::array<float,2>{0.638201773f, 0.960172594f}, std::array<float,2>{0.407899231f, 0.763658106f}, std::array<float,2>{0.512410104f, 0.217114702f}, std::array<float,2>{0.0253309421f, 0.297007561f}, std::array<float,2>{0.818089247f, 0.548602223f}, std::array<float,2>{0.0806530192f, 0.892276347f}, std::array<float,2>{0.772407889f, 0.00506468443f}, std::array<float,2>{0.466733336f, 0.432110161f}, std::array<float,2>{0.614072859f, 0.652651906f}, std::array<float,2>{0.272818953f, 0.58473742f}, std::array<float,2>{0.69986099f, 0.3740803f}, std::array<float,2>{0.191241607f, 0.172484711f}, std::array<float,2>{0.988158524f, 0.874627233f}, std::array<float,2>{0.211784005f, 0.620897114f}, std::array<float,2>{0.980612695f, 0.331408828f}, std::array<float,2>{0.261903256f, 0.136495784f}, std::array<float,2>{0.707603097f, 0.825611055f}, std::array<float,2>{0.440723062f, 0.929658651f}, std::array<float,2>{0.606859446f, 0.0336460322f}, std::array<float,2>{0.074503094f, 0.382918924f}, std::array<float,2>{0.755369306f, 0.687004209f}, std::array<float,2>{0.00551412022f, 0.797929883f}, std::array<float,2>{0.833013237f, 0.223228142f}, std::array<float,2>{0.431746691f, 0.278270572f}, std::array<float,2>{0.521981537f, 0.508382201f}, std::array<float,2>{0.316693187f, 0.706620812f}, std::array<float,2>{0.652731776f, 0.467841536f}, std::array<float,2>{0.135850832f, 0.0825910494f}, std::array<float,2>{0.875808775f, 0.984014571f}, std::array<float,2>{0.0973155275f, 0.632730603f}, std::array<float,2>{0.796120882f, 0.413510203f}, std::array<float,2>{0.472447097f, 0.0289065652f}, std::array<float,2>{0.570191026f, 0.880568087f}, std::array<float,2>{0.295744628f, 0.849817574f}, std::array<float,2>{0.725722134f, 0.16534555f}, std::array<float,2>{0.249077216f, 0.351275057f}, std::array<float,2>{0.953548074f, 0.570187032f}, std::array<float,2>{0.157428935f, 0.938172817f}, std::array<float,2>{0.924306571f, 0.115352482f}, std::array<float,2>{0.361087084f, 0.491673082f}, std::array<float,2>{0.669470429f, 0.740440488f}, std::array<float,2>{0.378991425f, 0.546782613f}, std::array<float,2>{0.547785997f, 0.285017163f}, std::array<float,2>{0.0624097995f, 0.198479444f}, std::array<float,2>{0.87202698f, 0.765903413f}, std::array<float,2>{0.0834465325f, 0.504481852f}, std::array<float,2>{0.765875399f, 0.269150913f}, std::array<float,2>{0.463522851f, 0.229578227f}, std::array<float,2>{0.610610008f, 0.809263229f}, std::array<float,2>{0.26751709f, 0.972134113f}, std::array<float,2>{0.695363402f, 0.0918440297f}, std::array<float,2>{0.195167378f, 0.458135933f}, std::array<float,2>{0.988823116f, 0.713442624f}, std::array<float,2>{0.153327018f, 0.815174818f}, std::array<float,2>{0.890765548f, 0.127727896f}, std::array<float,2>{0.342352003f, 0.343054265f}, std::array<float,2>{0.63667196f, 0.609623611f}, std::array<float,2>{0.411997437f, 0.674356878f}, std::array<float,2>{0.509692967f, 0.38123861f}, std::array<float,2>{0.0287791714f, 0.0459355377f}, std::array<float,2>{0.814966798f, 0.930745661f}, std::array<float,2>{0.219061553f, 0.746051967f}, std::array<float,2>{0.944057047f, 0.496559352f}, std::array<float,2>{0.302289546f, 0.124888159f}, std::array<float,2>{0.749319255f, 0.951226234f}, std::array<float,2>{0.498307854f, 0.777256906f}, std::array<float,2>{0.585965157f, 0.195252493f}, std::array<float,2>{0.109879427f, 0.295004725f}, std::array<float,2>{0.807193339f, 0.534514308f}, std::array<float,2>{0.0403137542f, 0.885892332f}, std::array<float,2>{0.846477926f, 0.0225295853f}, std::array<float,2>{0.40531829f, 0.416775405f}, std::array<float,2>{0.545189977f, 0.633637071f}, std::array<float,2>{0.35465306f, 0.577349484f}, std::array<float,2>{0.686439216f, 0.354949206f}, std::array<float,2>{0.174234122f, 0.159856603f}, std::array<float,2>{0.914480329f, 0.851617992f}, std::array<float,2>{0.16297704f, 0.608241379f}, std::array<float,2>{0.929312825f, 0.314125597f}, std::array<float,2>{0.365846694f, 0.150447294f}, std::array<float,2>{0.666755736f, 0.8313815f}, std::array<float,2>{0.377941519f, 0.908864498f}, std::array<float,2>{0.552481949f, 0.0521806516f}, std::array<float,2>{0.0579574108f, 0.399631232f}, std::array<float,2>{0.867677331f, 0.670255244f}, std::array<float,2>{0.100025408f, 0.782124043f}, std::array<float,2>{0.791381299f, 0.247144669f}, std::array<float,2>{0.473047316f, 0.255917847f}, std::array<float,2>{0.563288629f, 0.524306893f}, std::array<float,2>{0.292036951f, 0.701074481f}, std::array<float,2>{0.720451176f, 0.445594251f}, std::array<float,2>{0.243837371f, 0.06748344f}, std::array<float,2>{0.959558189f, 0.984876513f}, std::array<float,2>{0.00294177909f, 0.641434848f}, std::array<float,2>{0.828394115f, 0.42252925f}, std::array<float,2>{0.436683416f, 0.0124638099f}, std::array<float,2>{0.516338468f, 0.903020442f}, std::array<float,2>{0.316281646f, 0.866268694f}, std::array<float,2>{0.652281225f, 0.186334968f}, std::array<float,2>{0.138105735f, 0.364296198f}, std::array<float,2>{0.87890923f, 0.586012363f}, std::array<float,2>{0.21493116f, 0.968646228f}, std::array<float,2>{0.976851046f, 0.108094439f}, std::array<float,2>{0.260299385f, 0.482895225f}, std::array<float,2>{0.705012619f, 0.732261121f}, std::array<float,2>{0.444316149f, 0.562328517f}, std::array<float,2>{0.604827881f, 0.308268934f}, std::array<float,2>{0.0737488717f, 0.206847757f}, std::array<float,2>{0.750170946f, 0.751456797f}, std::array<float,2>{0.0522662215f, 0.580572605f}, std::array<float,2>{0.866211951f, 0.368367285f}, std::array<float,2>{0.389914751f, 0.179165736f}, std::array<float,2>{0.56131655f, 0.869815528f}, std::array<float,2>{0.374389142f, 0.897838831f}, std::array<float,2>{0.658784747f, 0.00149832712f}, std::array<float,2>{0.171774119f, 0.436222851f}, std::array<float,2>{0.92996335f, 0.650178492f}, std::array<float,2>{0.238786876f, 0.758711576f}, std::array<float,2>{0.967679024f, 0.213047177f}, std::array<float,2>{0.288386941f, 0.302482665f}, std::array<float,2>{0.733840823f, 0.552847266f}, std::array<float,2>{0.483540684f, 0.724161804f}, std::array<float,2>{0.571708381f, 0.469206423f}, std::array<float,2>{0.103357695f, 0.101408005f}, std::array<float,2>{0.781749368f, 0.954008758f}, std::array<float,2>{0.129753724f, 0.65809983f}, std::array<float,2>{0.887793243f, 0.396251053f}, std::array<float,2>{0.323504776f, 0.059141513f}, std::array<float,2>{0.647291243f, 0.917210758f}, std::array<float,2>{0.421877503f, 0.841971755f}, std::array<float,2>{0.530995965f, 0.143876567f}, std::array<float,2>{0.0153157618f, 0.326379418f}, std::array<float,2>{0.83988297f, 0.600652397f}, std::array<float,2>{0.0631713569f, 0.992206812f}, std::array<float,2>{0.761256516f, 0.070740439f}, std::array<float,2>{0.447520733f, 0.442468584f}, std::array<float,2>{0.596999526f, 0.689667284f}, std::array<float,2>{0.25073573f, 0.522895992f}, std::array<float,2>{0.712217808f, 0.25968048f}, std::array<float,2>{0.203553081f, 0.240341738f}, std::array<float,2>{0.972656965f, 0.78953743f}, std::array<float,2>{0.201630637f, 0.541145325f}, std::array<float,2>{0.994119108f, 0.285871118f}, std::array<float,2>{0.276744932f, 0.201337084f}, std::array<float,2>{0.691470623f, 0.770429969f}, std::array<float,2>{0.45811379f, 0.944287002f}, std::array<float,2>{0.618472338f, 0.112750471f}, std::array<float,2>{0.0930648372f, 0.48600325f}, std::array<float,2>{0.777938008f, 0.737729013f}, std::array<float,2>{0.018469207f, 0.845502853f}, std::array<float,2>{0.824828029f, 0.168544024f}, std::array<float,2>{0.41796869f, 0.345496207f}, std::array<float,2>{0.500486135f, 0.564562857f}, std::array<float,2>{0.329677373f, 0.628631592f}, std::array<float,2>{0.628221214f, 0.406721234f}, std::array<float,2>{0.14644438f, 0.0272116233f}, std::array<float,2>{0.900293529f, 0.875436842f}, std::array<float,2>{0.121729769f, 0.710101247f}, std::array<float,2>{0.802408934f, 0.464437217f}, std::array<float,2>{0.490683347f, 0.0781642944f}, std::array<float,2>{0.578349888f, 0.978065372f}, std::array<float,2>{0.310215533f, 0.80327642f}, std::array<float,2>{0.737762213f, 0.218954027f}, std::array<float,2>{0.229082897f, 0.275455028f}, std::array<float,2>{0.951465726f, 0.51333636f}, std::array<float,2>{0.179931402f, 0.924662113f}, std::array<float,2>{0.911733091f, 0.037472032f}, std::array<float,2>{0.344300896f, 0.388576716f}, std::array<float,2>{0.675773621f, 0.683468103f}, std::array<float,2>{0.393105298f, 0.624080956f}, std::array<float,2>{0.533099174f, 0.333396047f}, std::array<float,2>{0.0380850695f, 0.140563875f}, std::array<float,2>{0.851580501f, 0.820929646f}, std::array<float,2>{0.106545538f, 0.616277695f}, std::array<float,2>{0.788068771f, 0.339719951f}, std::array<float,2>{0.477055222f, 0.130704358f}, std::array<float,2>{0.575594425f, 0.816473365f}, std::array<float,2>{0.282842904f, 0.936183035f}, std::array<float,2>{0.730448067f, 0.0396863259f}, std::array<float,2>{0.237007394f, 0.375639856f}, std::array<float,2>{0.964421332f, 0.677090824f}, std::array<float,2>{0.164855748f, 0.806482434f}, std::array<float,2>{0.93679595f, 0.23401925f}, std::array<float,2>{0.370166242f, 0.270801157f}, std::array<float,2>{0.660624504f, 0.500292182f}, std::array<float,2>{0.386717588f, 0.717551947f}, std::array<float,2>{0.555809975f, 0.453409851f}, std::array<float,2>{0.0486657843f, 0.088133797f}, std::array<float,2>{0.860023856f, 0.976153553f}, std::array<float,2>{0.208432332f, 0.63747853f}, std::array<float,2>{0.970192969f, 0.421047062f}, std::array<float,2>{0.255405337f, 0.0167231821f}, std::array<float,2>{0.715786338f, 0.886720836f}, std::array<float,2>{0.452051401f, 0.855573177f}, std::array<float,2>{0.600963175f, 0.162029788f}, std::array<float,2>{0.0695522949f, 0.357833534f}, std::array<float,2>{0.762169838f, 0.573732078f}, std::array<float,2>{0.0102414247f, 0.946266234f}, std::array<float,2>{0.836899877f, 0.119869277f}, std::array<float,2>{0.426496357f, 0.495717913f}, std::array<float,2>{0.526260138f, 0.74942863f}, std::array<float,2>{0.326330841f, 0.537478447f}, std::array<float,2>{0.641557395f, 0.292555124f}, std::array<float,2>{0.126465127f, 0.187688679f}, std::array<float,2>{0.884027958f, 0.778200984f}, std::array<float,2>{0.142288536f, 0.530536652f}, std::array<float,2>{0.906062663f, 0.251042306f}, std::array<float,2>{0.335145652f, 0.245244995f}, std::array<float,2>{0.632788002f, 0.788570583f}, std::array<float,2>{0.420779139f, 0.991368353f}, std::array<float,2>{0.505043089f, 0.0632463768f}, std::array<float,2>{0.0221048146f, 0.449345589f}, std::array<float,2>{0.823687077f, 0.698868394f}, std::array<float,2>{0.0893670097f, 0.835508883f}, std::array<float,2>{0.774050534f, 0.154563844f}, std::array<float,2>{0.455585659f, 0.318854541f}, std::array<float,2>{0.621394336f, 0.602500081f}, std::array<float,2>{0.27918306f, 0.665712357f}, std::array<float,2>{0.688650727f, 0.406215727f}, std::array<float,2>{0.197756216f, 0.049150724f}, std::array<float,2>{0.996477902f, 0.912164509f}, std::array<float,2>{0.034050256f, 0.730376005f}, std::array<float,2>{0.857040524f, 0.477470785f}, std::array<float,2>{0.396464705f, 0.103404753f}, std::array<float,2>{0.5384444f, 0.962934136f}, std::array<float,2>{0.35097608f, 0.756205916f}, std::array<float,2>{0.679310977f, 0.208990827f}, std::array<float,2>{0.187120229f, 0.311560959f}, std::array<float,2>{0.908711493f, 0.555663526f}, std::array<float,2>{0.232514739f, 0.898582041f}, std::array<float,2>{0.946233392f, 0.0082044322f}, std::array<float,2>{0.307803303f, 0.426998049f}, std::array<float,2>{0.741516709f, 0.645294845f}, std::array<float,2>{0.486061543f, 0.592993081f}, std::array<float,2>{0.582133949f, 0.360599488f}, std::array<float,2>{0.119794562f, 0.183545202f}, std::array<float,2>{0.800339878f, 0.859434903f}, std::array<float,2>{0.0265208445f, 0.549059808f}, std::array<float,2>{0.819587946f, 0.299074441f}, std::array<float,2>{0.408653736f, 0.21491687f}, std::array<float,2>{0.51479435f, 0.765402555f}, std::array<float,2>{0.337411165f, 0.957139075f}, std::array<float,2>{0.6402964f, 0.0967924967f}, std::array<float,2>{0.14861539f, 0.473141491f}, std::array<float,2>{0.89789927f, 0.718767583f}, std::array<float,2>{0.188032225f, 0.872870564f}, std::array<float,2>{0.986242712f, 0.175654352f}, std::array<float,2>{0.271368474f, 0.372326612f}, std::array<float,2>{0.702298403f, 0.582588851f}, std::array<float,2>{0.468296587f, 0.655044615f}, std::array<float,2>{0.616784036f, 0.430236548f}, std::array<float,2>{0.078729175f, 0.00739386491f}, std::array<float,2>{0.770741045f, 0.894288361f}, std::array<float,2>{0.179513857f, 0.693242967f}, std::array<float,2>{0.921607316f, 0.44080168f}, std::array<float,2>{0.358432919f, 0.0754241869f}, std::array<float,2>{0.682543337f, 0.998645306f}, std::array<float,2>{0.399577796f, 0.79303813f}, std::array<float,2>{0.539328218f, 0.235738873f}, std::array<float,2>{0.0431847088f, 0.263109833f}, std::array<float,2>{0.851498485f, 0.518293262f}, std::array<float,2>{0.114568546f, 0.918973088f}, std::array<float,2>{0.810458541f, 0.0582943112f}, std::array<float,2>{0.495897174f, 0.392525256f}, std::array<float,2>{0.591503322f, 0.663644075f}, std::array<float,2>{0.299293011f, 0.597014129f}, std::array<float,2>{0.744166434f, 0.321377873f}, std::array<float,2>{0.224826023f, 0.145496085f}, std::array<float,2>{0.937592387f, 0.837028801f}, std::array<float,2>{0.247271508f, 0.566860139f}, std::array<float,2>{0.956736803f, 0.348476768f}, std::array<float,2>{0.294788182f, 0.166885749f}, std::array<float,2>{0.722831249f, 0.848737895f}, std::array<float,2>{0.469550401f, 0.882481635f}, std::array<float,2>{0.568131983f, 0.0297240335f}, std::array<float,2>{0.0950480774f, 0.410514235f}, std::array<float,2>{0.794897199f, 0.629101038f}, std::array<float,2>{0.0600012913f, 0.768829405f}, std::array<float,2>{0.874767959f, 0.19703269f}, std::array<float,2>{0.381167442f, 0.282186002f}, std::array<float,2>{0.549298942f, 0.543959379f}, std::array<float,2>{0.361531079f, 0.738300025f}, std::array<float,2>{0.671642721f, 0.489301741f}, std::array<float,2>{0.159628302f, 0.113924064f}, std::array<float,2>{0.922430217f, 0.941299021f}, std::array<float,2>{0.0770004019f, 0.685512125f}, std::array<float,2>{0.756215632f, 0.386411279f}, std::array<float,2>{0.43918708f, 0.0319295526f}, std::array<float,2>{0.608664691f, 0.927180171f}, std::array<float,2>{0.264460832f, 0.827596426f}, std::array<float,2>{0.710315347f, 0.132999837f}, std::array<float,2>{0.213964865f, 0.330035746f}, std::array<float,2>{0.984031498f, 0.619060934f}, std::array<float,2>{0.134496883f, 0.981333435f}, std::array<float,2>{0.878306866f, 0.0853972659f}, std::array<float,2>{0.319897056f, 0.464854717f}, std::array<float,2>{0.656227887f, 0.704176009f}, std::array<float,2>{0.429847896f, 0.510900855f}, std::array<float,2>{0.519638777f, 0.280593991f}, std::array<float,2>{0.00767028192f, 0.225298882f}, std::array<float,2>{0.835909188f, 0.799658179f}, std::array<float,2>{0.0730015635f, 0.559596777f}, std::array<float,2>{0.751848459f, 0.306619763f}, std::array<float,2>{0.445094347f, 0.203406528f}, std::array<float,2>{0.604071677f, 0.752768874f}, std::array<float,2>{0.261146694f, 0.96526283f}, std::array<float,2>{0.703911126f, 0.107382618f}, std::array<float,2>{0.216015905f, 0.481160522f}, std::array<float,2>{0.978341997f, 0.733118951f}, std::array<float,2>{0.137257561f, 0.865139663f}, std::array<float,2>{0.880018711f, 0.183615267f}, std::array<float,2>{0.31472072f, 0.365425885f}, std::array<float,2>{0.651187122f, 0.589622915f}, std::array<float,2>{0.435631037f, 0.6438815f}, std::array<float,2>{0.517500758f, 0.424946636f}, std::array<float,2>{0.00225412962f, 0.0144563774f}, std::array<float,2>{0.829514205f, 0.9045434f}, std::array<float,2>{0.242764398f, 0.701740324f}, std::array<float,2>{0.960459173f, 0.448111027f}, std::array<float,2>{0.291798055f, 0.0701584741f}, std::array<float,2>{0.71904695f, 0.987670839f}, std::array<float,2>{0.474062979f, 0.784706652f}, std::array<float,2>{0.56442827f, 0.248477921f}, std::array<float,2>{0.101046249f, 0.254788816f}, std::array<float,2>{0.792439878f, 0.526234865f}, std::array<float,2>{0.0569055192f, 0.907231987f}, std::array<float,2>{0.868595123f, 0.0537861511f}, std::array<float,2>{0.377113998f, 0.401183903f}, std::array<float,2>{0.55120492f, 0.669403851f}, std::array<float,2>{0.367007107f, 0.606675446f}, std::array<float,2>{0.667063475f, 0.315626264f}, std::array<float,2>{0.163679034f, 0.149993867f}, std::array<float,2>{0.928249478f, 0.829263508f}, std::array<float,2>{0.175763115f, 0.575785398f}, std::array<float,2>{0.915962398f, 0.352008313f}, std::array<float,2>{0.353931695f, 0.157904908f}, std::array<float,2>{0.687048137f, 0.854525149f}, std::array<float,2>{0.405210346f, 0.883162618f}, std::array<float,2>{0.546449423f, 0.0208747592f}, std::array<float,2>{0.0397567078f, 0.415943325f}, std::array<float,2>{0.846794903f, 0.636388361f}, std::array<float,2>{0.110468782f, 0.77455169f}, std::array<float,2>{0.807700753f, 0.191733241f}, std::array<float,2>{0.499306142f, 0.293718249f}, std::array<float,2>{0.5873909f, 0.532331944f}, std::array<float,2>{0.301585436f, 0.743791938f}, std::array<float,2>{0.748219967f, 0.499307394f}, std::array<float,2>{0.219744742f, 0.121908993f}, std::array<float,2>{0.944675148f, 0.949775398f}, std::array<float,2>{0.0278972741f, 0.672639668f}, std::array<float,2>{0.816311538f, 0.379095316f}, std::array<float,2>{0.41112107f, 0.0440252572f}, std::array<float,2>{0.507872641f, 0.932193637f}, std::array<float,2>{0.342983752f, 0.813660622f}, std::array<float,2>{0.634795964f, 0.125709474f}, std::array<float,2>{0.15296641f, 0.340109885f}, std::array<float,2>{0.891615272f, 0.611657739f}, std::array<float,2>{0.193691999f, 0.970179498f}, std::array<float,2>{0.990051448f, 0.0899536684f}, std::array<float,2>{0.266243905f, 0.459786236f}, std::array<float,2>{0.696885407f, 0.711202681f}, std::array<float,2>{0.463963509f, 0.506328225f}, std::array<float,2>{0.609718204f, 0.266849458f}, std::array<float,2>{0.0827527195f, 0.226937905f}, std::array<float,2>{0.766625583f, 0.812052965f}, std::array<float,2>{0.0381755754f, 0.621929824f}, std::array<float,2>{0.853176236f, 0.334498644f}, std::array<float,2>{0.39425236f, 0.137319371f}, std::array<float,2>{0.531449616f, 0.823510528f}, std::array<float,2>{0.345369011f, 0.923633099f}, std::array<float,2>{0.674560666f, 0.0364131369f}, std::array<float,2>{0.181630626f, 0.389613181f}, std::array<float,2>{0.910820842f, 0.679825187f}, std::array<float,2>{0.229654789f, 0.801611602f}, std::array<float,2>{0.952732265f, 0.22120434f}, std::array<float,2>{0.309076905f, 0.273786336f}, std::array<float,2>{0.736958742f, 0.514361084f}, std::array<float,2>{0.491361916f, 0.707908511f}, std::array<float,2>{0.580009997f, 0.4610219f}, std::array<float,2>{0.122411832f, 0.0810769871f}, std::array<float,2>{0.801291764f, 0.978791654f}, std::array<float,2>{0.145161465f, 0.626121283f}, std::array<float,2>{0.898897231f, 0.409516692f}, std::array<float,2>{0.328312486f, 0.0234519374f}, std::array<float,2>{0.62770462f, 0.878468335f}, std::array<float,2>{0.416724861f, 0.847258568f}, std::array<float,2>{0.50174737f, 0.170023814f}, std::array<float,2>{0.0194443651f, 0.346890748f}, std::array<float,2>{0.825209737f, 0.563117981f}, std::array<float,2>{0.0918933898f, 0.942185283f}, std::array<float,2>{0.778351665f, 0.109980121f}, std::array<float,2>{0.457068622f, 0.487768412f}, std::array<float,2>{0.61746341f, 0.736304104f}, std::array<float,2>{0.275469512f, 0.539678633f}, std::array<float,2>{0.692649424f, 0.287732154f}, std::array<float,2>{0.202722594f, 0.201008499f}, std::array<float,2>{0.992904425f, 0.772813797f}, std::array<float,2>{0.205040455f, 0.520183384f}, std::array<float,2>{0.97393924f, 0.260478526f}, std::array<float,2>{0.251006007f, 0.240072399f}, std::array<float,2>{0.711165547f, 0.792074084f}, std::array<float,2>{0.448455721f, 0.995611072f}, std::array<float,2>{0.596357822f, 0.0725271925f}, std::array<float,2>{0.06382595f, 0.443845123f}, std::array<float,2>{0.759965003f, 0.689032614f}, std::array<float,2>{0.014273352f, 0.839988947f}, std::array<float,2>{0.841439664f, 0.142249033f}, std::array<float,2>{0.423702419f, 0.325463414f}, std::array<float,2>{0.530184865f, 0.597890377f}, std::array<float,2>{0.322383046f, 0.659867883f}, std::array<float,2>{0.647570908f, 0.397383124f}, std::array<float,2>{0.130837917f, 0.0616388805f}, std::array<float,2>{0.88715142f, 0.914205492f}, std::array<float,2>{0.101587206f, 0.725752056f}, std::array<float,2>{0.782668829f, 0.472042441f}, std::array<float,2>{0.483244389f, 0.0979732275f}, std::array<float,2>{0.570987463f, 0.955624223f}, std::array<float,2>{0.287770122f, 0.761146665f}, std::array<float,2>{0.732980013f, 0.211067885f}, std::array<float,2>{0.24001652f, 0.302992374f}, std::array<float,2>{0.968218505f, 0.550981462f}, std::array<float,2>{0.17038776f, 0.895805478f}, std::array<float,2>{0.930867732f, 0.00197305996f}, std::array<float,2>{0.373230159f, 0.434675395f}, std::array<float,2>{0.660085976f, 0.652255595f}, std::array<float,2>{0.388844043f, 0.57903254f}, std::array<float,2>{0.561549544f, 0.369788498f}, std::array<float,2>{0.0511167496f, 0.176251531f}, std::array<float,2>{0.865772188f, 0.867273569f}, std::array<float,2>{0.12096715f, 0.590955436f}, std::array<float,2>{0.798864424f, 0.361668676f}, std::array<float,2>{0.4844082f, 0.18054457f}, std::array<float,2>{0.58384788f, 0.862707913f}, std::array<float,2>{0.306955665f, 0.901320219f}, std::array<float,2>{0.74076885f, 0.00987278763f}, std::array<float,2>{0.234272957f, 0.427853256f}, std::array<float,2>{0.946621835f, 0.647684157f}, std::array<float,2>{0.185704917f, 0.755233169f}, std::array<float,2>{0.909829617f, 0.20783639f}, std::array<float,2>{0.350432813f, 0.30868715f}, std::array<float,2>{0.678309321f, 0.557947695f}, std::array<float,2>{0.395385265f, 0.728431582f}, std::array<float,2>{0.537465036f, 0.479413897f}, std::array<float,2>{0.034668047f, 0.105207942f}, std::array<float,2>{0.855909586f, 0.962691545f}, std::array<float,2>{0.198782071f, 0.666945279f}, std::array<float,2>{0.997080088f, 0.404218853f}, std::array<float,2>{0.278205186f, 0.0473717004f}, std::array<float,2>{0.687762022f, 0.911786497f}, std::array<float,2>{0.456967264f, 0.833177328f}, std::array<float,2>{0.622780442f, 0.153175607f}, std::array<float,2>{0.0887786299f, 0.316845506f}, std::array<float,2>{0.775356114f, 0.605141819f}, std::array<float,2>{0.0225967374f, 0.989695132f}, std::array<float,2>{0.82295996f, 0.0651021749f}, std::array<float,2>{0.421581388f, 0.45233804f}, std::array<float,2>{0.504481792f, 0.696334541f}, std::array<float,2>{0.334202468f, 0.528560698f}, std::array<float,2>{0.631719232f, 0.252139539f}, std::array<float,2>{0.140631884f, 0.243297681f}, std::array<float,2>{0.904909492f, 0.785484731f}, std::array<float,2>{0.125551268f, 0.536233902f}, std::array<float,2>{0.88295275f, 0.289532274f}, std::array<float,2>{0.327747971f, 0.1897811f}, std::array<float,2>{0.641966283f, 0.779307127f}, std::array<float,2>{0.427134395f, 0.94850558f}, std::array<float,2>{0.527308822f, 0.117740475f}, std::array<float,2>{0.0112542007f, 0.493742406f}, std::array<float,2>{0.837389052f, 0.747700989f}, std::array<float,2>{0.0690075979f, 0.857586563f}, std::array<float,2>{0.762963116f, 0.163435519f}, std::array<float,2>{0.452905506f, 0.356672853f}, std::array<float,2>{0.600445688f, 0.570854843f}, std::array<float,2>{0.254734993f, 0.639746785f}, std::array<float,2>{0.716488957f, 0.419629872f}, std::array<float,2>{0.207846239f, 0.0180238374f}, std::array<float,2>{0.969681263f, 0.890590549f}, std::array<float,2>{0.0469050519f, 0.716645002f}, std::array<float,2>{0.861121833f, 0.456171274f}, std::array<float,2>{0.385591626f, 0.0860131159f}, std::array<float,2>{0.554954469f, 0.973585069f}, std::array<float,2>{0.369292796f, 0.808163047f}, std::array<float,2>{0.661897838f, 0.231697068f}, std::array<float,2>{0.165632397f, 0.272800565f}, std::array<float,2>{0.936283767f, 0.502132058f}, std::array<float,2>{0.237592831f, 0.934377313f}, std::array<float,2>{0.963448226f, 0.0429581292f}, std::array<float,2>{0.282077074f, 0.377024293f}, std::array<float,2>{0.729263723f, 0.679406583f}, std::array<float,2>{0.478375882f, 0.61402452f}, std::array<float,2>{0.57423979f, 0.337557554f}, std::array<float,2>{0.10626208f, 0.130870625f}, std::array<float,2>{0.788765728f, 0.818606377f}, std::array<float,2>{0.00670996122f, 0.509075999f}, std::array<float,2>{0.833986282f, 0.279108644f}, std::array<float,2>{0.431344837f, 0.224471644f}, std::array<float,2>{0.521085441f, 0.797191024f}, std::array<float,2>{0.318594098f, 0.98249352f}, std::array<float,2>{0.655263186f, 0.0831417516f}, std::array<float,2>{0.133569419f, 0.467511714f}, std::array<float,2>{0.877416253f, 0.705644965f}, std::array<float,2>{0.213296279f, 0.824836671f}, std::array<float,2>{0.983187437f, 0.135620832f}, std::array<float,2>{0.265195608f, 0.33037284f}, std::array<float,2>{0.709690034f, 0.619459271f}, std::array<float,2>{0.437806368f, 0.685878098f}, std::array<float,2>{0.607922256f, 0.384109676f}, std::array<float,2>{0.0780751556f, 0.0341933668f}, std::array<float,2>{0.757367671f, 0.928554475f}, std::array<float,2>{0.158931077f, 0.742044568f}, std::array<float,2>{0.923056424f, 0.491204411f}, std::array<float,2>{0.362850159f, 0.11680527f}, std::array<float,2>{0.670467019f, 0.938876092f}, std::array<float,2>{0.381997854f, 0.76698339f}, std::array<float,2>{0.550671756f, 0.197746769f}, std::array<float,2>{0.058991272f, 0.283810109f}, std::array<float,2>{0.873462439f, 0.545046866f}, std::array<float,2>{0.0942712799f, 0.879264712f}, std::array<float,2>{0.793525517f, 0.0275862031f}, std::array<float,2>{0.46985361f, 0.412748039f}, std::array<float,2>{0.566494644f, 0.631040215f}, std::array<float,2>{0.293879479f, 0.569261909f}, std::array<float,2>{0.724230349f, 0.349716932f}, std::array<float,2>{0.246345043f, 0.164497927f}, std::array<float,2>{0.955806434f, 0.851559997f}, std::array<float,2>{0.226332545f, 0.594284117f}, std::array<float,2>{0.939373076f, 0.322313428f}, std::array<float,2>{0.299983472f, 0.147179008f}, std::array<float,2>{0.745391548f, 0.83839792f}, std::array<float,2>{0.494447172f, 0.921748817f}, std::array<float,2>{0.590364814f, 0.0561848767f}, std::array<float,2>{0.113796353f, 0.394511312f}, std::array<float,2>{0.808662772f, 0.660288393f}, std::array<float,2>{0.0440086052f, 0.795192003f}, std::array<float,2>{0.850542188f, 0.237657383f}, std::array<float,2>{0.398993641f, 0.265149146f}, std::array<float,2>{0.540481448f, 0.516087294f}, std::array<float,2>{0.358222485f, 0.694756031f}, std::array<float,2>{0.682811379f, 0.438213736f}, std::array<float,2>{0.178317606f, 0.0765208453f}, std::array<float,2>{0.919991791f, 0.997098565f}, std::array<float,2>{0.0794528723f, 0.653514981f}, std::array<float,2>{0.770181835f, 0.433072954f}, std::array<float,2>{0.467071146f, 0.00450835982f}, std::array<float,2>{0.616048515f, 0.890909672f}, std::array<float,2>{0.269994885f, 0.873696506f}, std::array<float,2>{0.701746464f, 0.173511669f}, std::array<float,2>{0.188545495f, 0.373767614f}, std::array<float,2>{0.984685183f, 0.585399091f}, std::array<float,2>{0.150117487f, 0.959721744f}, std::array<float,2>{0.896771371f, 0.0946818665f}, std::array<float,2>{0.336604446f, 0.476514101f}, std::array<float,2>{0.638700545f, 0.72186327f}, std::array<float,2>{0.409579605f, 0.547524333f}, std::array<float,2>{0.513934612f, 0.297953159f}, std::array<float,2>{0.0259510223f, 0.217998222f}, std::array<float,2>{0.819278181f, 0.761977315f}, std::array<float,2>{0.0993623212f, 0.524822831f}, std::array<float,2>{0.789560258f, 0.25685814f}, std::array<float,2>{0.475162268f, 0.247058004f}, std::array<float,2>{0.566007674f, 0.783013046f}, std::array<float,2>{0.289653033f, 0.985599637f}, std::array<float,2>{0.720932245f, 0.0666365996f}, std::array<float,2>{0.245596126f, 0.446429014f}, std::array<float,2>{0.958777666f, 0.699888647f}, std::array<float,2>{0.160174519f, 0.830212831f}, std::array<float,2>{0.92756629f, 0.15160796f}, std::array<float,2>{0.363862962f, 0.31299907f}, std::array<float,2>{0.66598022f, 0.609320045f}, std::array<float,2>{0.376036882f, 0.670981407f}, std::array<float,2>{0.55376929f, 0.398753822f}, std::array<float,2>{0.0559561066f, 0.0509260483f}, std::array<float,2>{0.869974554f, 0.909741282f}, std::array<float,2>{0.218309432f, 0.730537832f}, std::array<float,2>{0.979968429f, 0.483491898f}, std::array<float,2>{0.258288324f, 0.109260157f}, std::array<float,2>{0.706683517f, 0.967599094f}, std::array<float,2>{0.441540509f, 0.750929713f}, std::array<float,2>{0.601935625f, 0.205680847f}, std::array<float,2>{0.0714495406f, 0.307570338f}, std::array<float,2>{0.753167629f, 0.560775697f}, std::array<float,2>{0.00167768693f, 0.90396446f}, std::array<float,2>{0.831991196f, 0.0135213928f}, std::array<float,2>{0.433788598f, 0.423248887f}, std::array<float,2>{0.519288123f, 0.642519474f}, std::array<float,2>{0.313863277f, 0.587229908f}, std::array<float,2>{0.649518967f, 0.363817215f}, std::array<float,2>{0.139957741f, 0.187418804f}, std::array<float,2>{0.881239116f, 0.865902185f}, std::array<float,2>{0.154391378f, 0.611112952f}, std::array<float,2>{0.893486679f, 0.342307448f}, std::array<float,2>{0.340293169f, 0.128734246f}, std::array<float,2>{0.634489536f, 0.815866888f}, std::array<float,2>{0.41288957f, 0.930499852f}, std::array<float,2>{0.510462821f, 0.0449257717f}, std::array<float,2>{0.0304425918f, 0.381897181f}, std::array<float,2>{0.813202977f, 0.675672233f}, std::array<float,2>{0.0849284828f, 0.81027019f}, std::array<float,2>{0.768994391f, 0.229210868f}, std::array<float,2>{0.462511867f, 0.268333256f}, std::array<float,2>{0.612928391f, 0.505429685f}, std::array<float,2>{0.269028783f, 0.714154005f}, std::array<float,2>{0.699098587f, 0.457645625f}, std::array<float,2>{0.192881808f, 0.0932014808f}, std::array<float,2>{0.991515398f, 0.97150296f}, std::array<float,2>{0.0415294692f, 0.633906245f}, std::array<float,2>{0.843842506f, 0.417316616f}, std::array<float,2>{0.403089136f, 0.021533737f}, std::array<float,2>{0.544856489f, 0.885201514f}, std::array<float,2>{0.353327632f, 0.852615893f}, std::array<float,2>{0.685389638f, 0.1588047f}, std::array<float,2>{0.172043756f, 0.354079396f}, std::array<float,2>{0.917001188f, 0.576538563f}, std::array<float,2>{0.220943853f, 0.952969193f}, std::array<float,2>{0.943150878f, 0.123987578f}, std::array<float,2>{0.304519743f, 0.497929186f}, std::array<float,2>{0.747375071f, 0.744521081f}, std::array<float,2>{0.496316344f, 0.534146428f}, std::array<float,2>{0.587964416f, 0.296448112f}, std::array<float,2>{0.112373084f, 0.194288209f}, std::array<float,2>{0.806631863f, 0.775490284f}, std::array<float,2>{0.0164680947f, 0.56600064f}, std::array<float,2>{0.82800132f, 0.344318211f}, std::array<float,2>{0.415461749f, 0.169347137f}, std::array<float,2>{0.50325197f, 0.84433955f}, std::array<float,2>{0.33072269f, 0.876175404f}, std::array<float,2>{0.626626134f, 0.0261246897f}, std::array<float,2>{0.14747043f, 0.407979429f}, std::array<float,2>{0.90127033f, 0.627599835f}, std::array<float,2>{0.199418366f, 0.770507872f}, std::array<float,2>{0.995555997f, 0.202486351f}, std::array<float,2>{0.27409178f, 0.286702007f}, std::array<float,2>{0.693565786f, 0.5424245f}, std::array<float,2>{0.460850626f, 0.736725509f}, std::array<float,2>{0.620817721f, 0.484599322f}, std::array<float,2>{0.0898714215f, 0.111997232f}, std::array<float,2>{0.780021489f, 0.944559336f}, std::array<float,2>{0.182998598f, 0.682585299f}, std::array<float,2>{0.913648129f, 0.387521416f}, std::array<float,2>{0.34606117f, 0.0390475467f}, std::array<float,2>{0.672767878f, 0.925705314f}, std::array<float,2>{0.39247334f, 0.821657121f}, std::array<float,2>{0.534742892f, 0.13924323f}, std::array<float,2>{0.0369661413f, 0.332828879f}, std::array<float,2>{0.854023814f, 0.623837233f}, std::array<float,2>{0.123184972f, 0.97686702f}, std::array<float,2>{0.803088188f, 0.079923518f}, std::array<float,2>{0.488417208f, 0.463094503f}, std::array<float,2>{0.581893742f, 0.709510028f}, std::array<float,2>{0.31088832f, 0.512265563f}, std::array<float,2>{0.735533357f, 0.2772443f}, std::array<float,2>{0.226821765f, 0.220078483f}, std::array<float,2>{0.950649679f, 0.803933263f}, std::array<float,2>{0.241521582f, 0.554270089f}, std::array<float,2>{0.966513813f, 0.300945818f}, std::array<float,2>{0.285923809f, 0.214264512f}, std::array<float,2>{0.730993271f, 0.759259939f}, std::array<float,2>{0.482293725f, 0.955060363f}, std::array<float,2>{0.574144483f, 0.100489587f}, std::array<float,2>{0.10513074f, 0.46992445f}, std::array<float,2>{0.783351481f, 0.722964108f}, std::array<float,2>{0.0545821711f, 0.870460927f}, std::array<float,2>{0.864604175f, 0.178253576f}, std::array<float,2>{0.388113976f, 0.367841691f}, std::array<float,2>{0.559076965f, 0.581671834f}, std::array<float,2>{0.371424764f, 0.649336874f}, std::array<float,2>{0.658087015f, 0.437468201f}, std::array<float,2>{0.169143498f, 0.00088868523f}, std::array<float,2>{0.931805611f, 0.897412479f}, std::array<float,2>{0.0650835931f, 0.690670729f}, std::array<float,2>{0.757994413f, 0.442362726f}, std::array<float,2>{0.445444852f, 0.0718701556f}, std::array<float,2>{0.59528482f, 0.993848085f}, std::array<float,2>{0.253790051f, 0.79070437f}, std::array<float,2>{0.713943779f, 0.241601139f}, std::array<float,2>{0.206986159f, 0.258272648f}, std::array<float,2>{0.976358891f, 0.522434831f}, std::array<float,2>{0.132310823f, 0.91652441f}, std::array<float,2>{0.889506519f, 0.060387101f}, std::array<float,2>{0.321474463f, 0.395214707f}, std::array<float,2>{0.646452427f, 0.656672418f}, std::array<float,2>{0.425074011f, 0.600158691f}, std::array<float,2>{0.527617216f, 0.32725051f}, std::array<float,2>{0.013389281f, 0.143455282f}, std::array<float,2>{0.843612671f, 0.842996299f}, std::array<float,2>{0.0866055265f, 0.603403151f}, std::array<float,2>{0.775732398f, 0.319947302f}, std::array<float,2>{0.454696596f, 0.156240702f}, std::array<float,2>{0.623852611f, 0.83456701f}, std::array<float,2>{0.280929297f, 0.913308322f}, std::array<float,2>{0.689553201f, 0.0500596315f}, std::array<float,2>{0.197001949f, 0.404626429f}, std::array<float,2>{0.998838723f, 0.664065123f}, std::array<float,2>{0.143575117f, 0.787283301f}, std::array<float,2>{0.903413832f, 0.245046034f}, std::array<float,2>{0.333386332f, 0.250836909f}, std::array<float,2>{0.630648017f, 0.529964507f}, std::array<float,2>{0.418912113f, 0.697460353f}, std::array<float,2>{0.507315338f, 0.450232565f}, std::array<float,2>{0.0205416307f, 0.0639915392f}, std::array<float,2>{0.821946502f, 0.991142988f}, std::array<float,2>{0.231518701f, 0.646243989f}, std::array<float,2>{0.947404087f, 0.425835848f}, std::array<float,2>{0.30643931f, 0.00913825724f}, std::array<float,2>{0.739490449f, 0.899640322f}, std::array<float,2>{0.487883598f, 0.860482693f}, std::array<float,2>{0.585851669f, 0.18207252f}, std::array<float,2>{0.117210038f, 0.359852642f}, std::array<float,2>{0.79757297f, 0.592011869f}, std::array<float,2>{0.0330887437f, 0.964197695f}, std::array<float,2>{0.858068228f, 0.102104396f}, std::array<float,2>{0.398338318f, 0.477595419f}, std::array<float,2>{0.53557086f, 0.728628516f}, std::array<float,2>{0.347744852f, 0.556345761f}, std::array<float,2>{0.676622033f, 0.3110677f}, std::array<float,2>{0.183742166f, 0.210394815f}, std::array<float,2>{0.907793701f, 0.757479906f}, std::array<float,2>{0.166919768f, 0.501247466f}, std::array<float,2>{0.933823884f, 0.269841701f}, std::array<float,2>{0.36775288f, 0.233073741f}, std::array<float,2>{0.662718177f, 0.804827929f}, std::array<float,2>{0.383118987f, 0.974767327f}, std::array<float,2>{0.557273448f, 0.089592576f}, std::array<float,2>{0.0495140217f, 0.454194576f}, std::array<float,2>{0.863053679f, 0.718654573f}, std::array<float,2>{0.10823635f, 0.817789376f}, std::array<float,2>{0.785403907f, 0.129301935f}, std::array<float,2>{0.48013556f, 0.338015109f}, std::array<float,2>{0.576299965f, 0.616006494f}, std::array<float,2>{0.283963203f, 0.675956666f}, std::array<float,2>{0.727845669f, 0.376614809f}, std::array<float,2>{0.234445199f, 0.0405930765f}, std::array<float,2>{0.962531984f, 0.937251627f}, std::array<float,2>{0.00976401195f, 0.748584926f}, std::array<float,2>{0.839796484f, 0.495029092f}, std::array<float,2>{0.429239333f, 0.120338857f}, std::array<float,2>{0.524716318f, 0.947222292f}, std::array<float,2>{0.325990051f, 0.779144764f}, std::array<float,2>{0.644015849f, 0.188831791f}, std::array<float,2>{0.127940118f, 0.291735411f}, std::array<float,2>{0.885653615f, 0.538154066f}, std::array<float,2>{0.210104018f, 0.888041735f}, std::array<float,2>{0.972389877f, 0.0160991028f}, std::array<float,2>{0.25751999f, 0.419993371f}, std::array<float,2>{0.716949284f, 0.638667285f}, std::array<float,2>{0.449924171f, 0.572496414f}, std::array<float,2>{0.598775804f, 0.358408332f}, std::array<float,2>{0.0669748858f, 0.160546228f}, std::array<float,2>{0.76472187f, 0.85718745f}, std::array<float,2>{0.061421115f, 0.543907881f}, std::array<float,2>{0.87274909f, 0.282500058f}, std::array<float,2>{0.379958659f, 0.196054116f}, std::array<float,2>{0.548365593f, 0.768173933f}, std::array<float,2>{0.36012128f, 0.939629257f}, std::array<float,2>{0.668010533f, 0.114482068f}, std::array<float,2>{0.156409711f, 0.488911867f}, std::array<float,2>{0.925761223f, 0.739930987f}, std::array<float,2>{0.248879835f, 0.848187327f}, std::array<float,2>{0.954316139f, 0.167696863f}, std::array<float,2>{0.296140969f, 0.349052161f}, std::array<float,2>{0.725236177f, 0.56811136f}, std::array<float,2>{0.471501708f, 0.630295992f}, std::array<float,2>{0.569283664f, 0.411499888f}, std::array<float,2>{0.0963568166f, 0.0306483824f}, std::array<float,2>{0.795661092f, 0.881400764f}, std::array<float,2>{0.134827971f, 0.703542769f}, std::array<float,2>{0.87619704f, 0.466056585f}, std::array<float,2>{0.317957193f, 0.0844006613f}, std::array<float,2>{0.653456688f, 0.981465697f}, std::array<float,2>{0.433448702f, 0.800130546f}, std::array<float,2>{0.522656262f, 0.226530164f}, std::array<float,2>{0.0042252196f, 0.280105144f}, std::array<float,2>{0.832233131f, 0.510649443f}, std::array<float,2>{0.0752665922f, 0.926282048f}, std::array<float,2>{0.754518211f, 0.0327029526f}, std::array<float,2>{0.439499468f, 0.384906322f}, std::array<float,2>{0.605892658f, 0.684272885f}, std::array<float,2>{0.263381243f, 0.617768407f}, std::array<float,2>{0.708156466f, 0.32813099f}, std::array<float,2>{0.212463289f, 0.134269401f}, std::array<float,2>{0.981976807f, 0.826455653f}, std::array<float,2>{0.189476699f, 0.583211601f}, std::array<float,2>{0.987195134f, 0.37115252f}, std::array<float,2>{0.2715877f, 0.174450874f}, std::array<float,2>{0.7006585f, 0.87126255f}, std::array<float,2>{0.464925766f, 0.893392742f}, std::array<float,2>{0.615222514f, 0.00652526459f}, std::array<float,2>{0.0817640945f, 0.430912614f}, std::array<float,2>{0.772828519f, 0.655794621f}, std::array<float,2>{0.0234394837f, 0.764605761f}, std::array<float,2>{0.816521943f, 0.216099039f}, std::array<float,2>{0.407155216f, 0.300565809f}, std::array<float,2>{0.513353229f, 0.550743997f}, std::array<float,2>{0.338783413f, 0.720659494f}, std::array<float,2>{0.636916876f, 0.473948091f}, std::array<float,2>{0.150994837f, 0.0962931216f}, std::array<float,2>{0.895501971f, 0.958767772f}, std::array<float,2>{0.116185844f, 0.662751198f}, std::array<float,2>{0.811598659f, 0.390960127f}, std::array<float,2>{0.493746817f, 0.0575572662f}, std::array<float,2>{0.591843784f, 0.918674171f}, std::array<float,2>{0.298054904f, 0.836385429f}, std::array<float,2>{0.743270516f, 0.145839989f}, std::array<float,2>{0.222997412f, 0.320425212f}, std::array<float,2>{0.939542353f, 0.596594572f}, std::array<float,2>{0.177516028f, 0.999144793f}, std::array<float,2>{0.918403625f, 0.0747604519f}, std::array<float,2>{0.355960637f, 0.440010637f}, std::array<float,2>{0.679819584f, 0.69167316f}, std::array<float,2>{0.400612414f, 0.519020677f}, std::array<float,2>{0.541437447f, 0.262227386f}, std::array<float,2>{0.0453412719f, 0.234551251f}, std::array<float,2>{0.847974479f, 0.794578135f}, std::array<float,2>{0.104676917f, 0.551394343f}, std::array<float,2>{0.783826053f, 0.303454697f}, std::array<float,2>{0.481634974f, 0.211470842f}, std::array<float,2>{0.57362324f, 0.761368513f}, std::array<float,2>{0.285204411f, 0.955393493f}, std::array<float,2>{0.730839014f, 0.0984772071f}, std::array<float,2>{0.242155671f, 0.472426951f}, std::array<float,2>{0.96592164f, 0.726526856f}, std::array<float,2>{0.169766262f, 0.86772722f}, std::array<float,2>{0.932411432f, 0.176409557f}, std::array<float,2>{0.371860564f, 0.369460166f}, std::array<float,2>{0.657630384f, 0.578279376f}, std::array<float,2>{0.388521761f, 0.651530623f}, std::array<float,2>{0.559506416f, 0.435254097f}, std::array<float,2>{0.05384643f, 0.00289134821f}, std::array<float,2>{0.865154207f, 0.896370769f}, std::array<float,2>{0.20622769f, 0.688879669f}, std::array<float,2>{0.975600183f, 0.444300413f}, std::array<float,2>{0.253161579f, 0.0727755353f}, std::array<float,2>{0.714467764f, 0.995524406f}, std::array<float,2>{0.445907176f, 0.792537928f}, std::array<float,2>{0.59517771f, 0.239425063f}, std::array<float,2>{0.0647138804f, 0.260239154f}, std::array<float,2>{0.758702993f, 0.519624889f}, std::array<float,2>{0.0128328856f, 0.914636195f}, std::array<float,2>{0.842940927f, 0.0624617115f}, std::array<float,2>{0.425646365f, 0.396535039f}, std::array<float,2>{0.527918279f, 0.659325302f}, std::array<float,2>{0.321870148f, 0.598626852f}, std::array<float,2>{0.645858824f, 0.325875044f}, std::array<float,2>{0.132406086f, 0.141858041f}, std::array<float,2>{0.8887164f, 0.840797782f}, std::array<float,2>{0.148093179f, 0.562905788f}, std::array<float,2>{0.900401831f, 0.347338945f}, std::array<float,2>{0.330364764f, 0.170836627f}, std::array<float,2>{0.626163423f, 0.847005725f}, std::array<float,2>{0.415959656f, 0.87798059f}, std::array<float,2>{0.503605008f, 0.0242230296f}, std::array<float,2>{0.0159550402f, 0.40975967f}, std::array<float,2>{0.827320576f, 0.626787305f}, std::array<float,2>{0.0906554759f, 0.773337364f}, std::array<float,2>{0.779423475f, 0.200373307f}, std::array<float,2>{0.460072666f, 0.287371844f}, std::array<float,2>{0.620179474f, 0.539459229f}, std::array<float,2>{0.273651093f, 0.735637069f}, std::array<float,2>{0.694017649f, 0.487990737f}, std::array<float,2>{0.199715286f, 0.109708011f}, std::array<float,2>{0.99575758f, 0.941802502f}, std::array<float,2>{0.0363049954f, 0.680438578f}, std::array<float,2>{0.853640974f, 0.388765901f}, std::array<float,2>{0.392012835f, 0.0366557986f}, std::array<float,2>{0.534590721f, 0.923305631f}, std::array<float,2>{0.346246332f, 0.823854387f}, std::array<float,2>{0.672154546f, 0.137115404f}, std::array<float,2>{0.183128893f, 0.334117413f}, std::array<float,2>{0.913283825f, 0.621333838f}, std::array<float,2>{0.227059841f, 0.979204059f}, std::array<float,2>{0.951093793f, 0.0819201246f}, std::array<float,2>{0.311137617f, 0.461715937f}, std::array<float,2>{0.736289442f, 0.707067847f}, std::array<float,2>{0.489193976f, 0.513675034f}, std::array<float,2>{0.581334472f, 0.274220377f}, std::array<float,2>{0.1235689f, 0.221169248f}, std::array<float,2>{0.80328083f, 0.800782263f}, std::array<float,2>{0.031172635f, 0.612286866f}, std::array<float,2>{0.812807441f, 0.34080708f}, std::array<float,2>{0.412282407f, 0.125047803f}, std::array<float,2>{0.509796977f, 0.814139664f}, std::array<float,2>{0.340618014f, 0.93201828f}, std::array<float,2>{0.634274423f, 0.0447840691f}, std::array<float,2>{0.154955521f, 0.379782349f}, std::array<float,2>{0.892852366f, 0.67188549f}, std::array<float,2>{0.192497984f, 0.811884344f}, std::array<float,2>{0.991931617f, 0.227534428f}, std::array<float,2>{0.269059837f, 0.267177105f}, std::array<float,2>{0.698595464f, 0.506661236f}, std::array<float,2>{0.462085843f, 0.711493134f}, std::array<float,2>{0.612390339f, 0.459064424f}, std::array<float,2>{0.0842603073f, 0.0904612765f}, std::array<float,2>{0.769224763f, 0.970513582f}, std::array<float,2>{0.17243889f, 0.635928214f}, std::array<float,2>{0.917925596f, 0.415471345f}, std::array<float,2>{0.352941513f, 0.0212667324f}, std::array<float,2>{0.684987605f, 0.883349538f}, std::array<float,2>{0.402508318f, 0.855048001f}, std::array<float,2>{0.544345081f, 0.157334894f}, std::array<float,2>{0.0413407534f, 0.352522701f}, std::array<float,2>{0.844285667f, 0.575229526f}, std::array<float,2>{0.113058165f, 0.949384212f}, std::array<float,2>{0.806014299f, 0.121106684f}, std::array<float,2>{0.497022659f, 0.499704391f}, std::array<float,2>{0.58886528f, 0.743179977f}, std::array<float,2>{0.303724378f, 0.53282696f}, std::array<float,2>{0.747947574f, 0.293381065f}, std::array<float,2>{0.221275091f, 0.192315966f}, std::array<float,2>{0.942633331f, 0.774977267f}, std::array<float,2>{0.245715052f, 0.525830925f}, std::array<float,2>{0.958099544f, 0.25438118f}, std::array<float,2>{0.289076507f, 0.248757631f}, std::array<float,2>{0.721532881f, 0.784399152f}, std::array<float,2>{0.474946916f, 0.987905443f}, std::array<float,2>{0.565458477f, 0.0695740506f}, std::array<float,2>{0.0989479423f, 0.447491467f}, std::array<float,2>{0.789175987f, 0.70160383f}, std::array<float,2>{0.0562688932f, 0.829843342f}, std::array<float,2>{0.869414389f, 0.149475396f}, std::array<float,2>{0.376609355f, 0.316388369f}, std::array<float,2>{0.554409266f, 0.607288241f}, std::array<float,2>{0.36368224f, 0.669768751f}, std::array<float,2>{0.665222287f, 0.400830954f}, std::array<float,2>{0.160716683f, 0.05450904f}, std::array<float,2>{0.926781356f, 0.908102095f}, std::array<float,2>{0.0719516128f, 0.732530236f}, std::array<float,2>{0.753644705f, 0.480846137f}, std::array<float,2>{0.44214341f, 0.1067679f}, std::array<float,2>{0.602157831f, 0.965351284f}, std::array<float,2>{0.258712798f, 0.75201875f}, std::array<float,2>{0.706143677f, 0.203635842f}, std::array<float,2>{0.218258634f, 0.305829883f}, std::array<float,2>{0.980162442f, 0.56019485f}, std::array<float,2>{0.140516207f, 0.904996812f}, std::array<float,2>{0.881475687f, 0.0139112547f}, std::array<float,2>{0.314023554f, 0.425565422f}, std::array<float,2>{0.650204241f, 0.644492984f}, std::array<float,2>{0.434359133f, 0.589037955f}, std::array<float,2>{0.518752277f, 0.365936756f}, std::array<float,2>{0.00145211804f, 0.184473619f}, std::array<float,2>{0.831181943f, 0.864643157f}, std::array<float,2>{0.0812434778f, 0.585841119f}, std::array<float,2>{0.773195207f, 0.373066127f}, std::array<float,2>{0.465370953f, 0.173216119f}, std::array<float,2>{0.614347041f, 0.873272061f}, std::array<float,2>{0.272179782f, 0.891519725f}, std::array<float,2>{0.700835645f, 0.00434130151f}, std::array<float,2>{0.190186828f, 0.433163226f}, std::array<float,2>{0.986415148f, 0.653927982f}, std::array<float,2>{0.150823161f, 0.762267232f}, std::array<float,2>{0.894562125f, 0.218332365f}, std::array<float,2>{0.337931901f, 0.298625976f}, std::array<float,2>{0.637408376f, 0.547229826f}, std::array<float,2>{0.406600207f, 0.722216666f}, std::array<float,2>{0.513041377f, 0.475613564f}, std::array<float,2>{0.0240595341f, 0.0941122696f}, std::array<float,2>{0.817105651f, 0.959017158f}, std::array<float,2>{0.223550841f, 0.661069691f}, std::array<float,2>{0.939963996f, 0.394015282f}, std::array<float,2>{0.298451215f, 0.0561049581f}, std::array<float,2>{0.743933797f, 0.921287954f}, std::array<float,2>{0.493457884f, 0.838023305f}, std::array<float,2>{0.592535973f, 0.146924362f}, std::array<float,2>{0.115594879f, 0.323050529f}, std::array<float,2>{0.812153995f, 0.593943655f}, std::array<float,2>{0.0454524197f, 0.997601688f}, std::array<float,2>{0.848528624f, 0.0767714903f}, std::array<float,2>{0.40134725f, 0.437625736f}, std::array<float,2>{0.541790724f, 0.695014596f}, std::array<float,2>{0.355576873f, 0.516483605f}, std::array<float,2>{0.680215359f, 0.264781862f}, std::array<float,2>{0.176973075f, 0.238156185f}, std::array<float,2>{0.918523967f, 0.795562208f}, std::array<float,2>{0.157187462f, 0.545691907f}, std::array<float,2>{0.925019205f, 0.283458143f}, std::array<float,2>{0.359755158f, 0.198037773f}, std::array<float,2>{0.66861552f, 0.767304182f}, std::array<float,2>{0.380723178f, 0.938996315f}, std::array<float,2>{0.548161685f, 0.116372451f}, std::array<float,2>{0.0607822835f, 0.490678757f}, std::array<float,2>{0.872212172f, 0.741425872f}, std::array<float,2>{0.0960653722f, 0.850619197f}, std::array<float,2>{0.795117795f, 0.164858714f}, std::array<float,2>{0.470827699f, 0.350374699f}, std::array<float,2>{0.568736136f, 0.568466306f}, std::array<float,2>{0.29649663f, 0.631391346f}, std::array<float,2>{0.724807322f, 0.412252545f}, std::array<float,2>{0.248310328f, 0.027916668f}, std::array<float,2>{0.954952419f, 0.8794958f}, std::array<float,2>{0.00441271393f, 0.705280662f}, std::array<float,2>{0.832658589f, 0.466980457f}, std::array<float,2>{0.432801545f, 0.0835056081f}, std::array<float,2>{0.523278832f, 0.983002663f}, std::array<float,2>{0.317532927f, 0.797555864f}, std::array<float,2>{0.654249549f, 0.224016115f}, std::array<float,2>{0.135518253f, 0.278362751f}, std::array<float,2>{0.876667678f, 0.509438396f}, std::array<float,2>{0.211914107f, 0.927848697f}, std::array<float,2>{0.981814623f, 0.0347539298f}, std::array<float,2>{0.26283884f, 0.384737581f}, std::array<float,2>{0.708621204f, 0.686167181f}, std::array<float,2>{0.440276384f, 0.619963527f}, std::array<float,2>{0.606360495f, 0.330814183f}, std::array<float,2>{0.0760974959f, 0.135023937f}, std::array<float,2>{0.754002154f, 0.824567854f}, std::array<float,2>{0.0492940545f, 0.502840161f}, std::array<float,2>{0.862362564f, 0.27324146f}, std::array<float,2>{0.383744091f, 0.232153982f}, std::array<float,2>{0.556663096f, 0.807692885f}, std::array<float,2>{0.367659807f, 0.972802043f}, std::array<float,2>{0.662357867f, 0.0868972689f}, std::array<float,2>{0.166204154f, 0.456881046f}, std::array<float,2>{0.93432492f, 0.716097951f}, std::array<float,2>{0.235304058f, 0.819299519f}, std::array<float,2>{0.962328911f, 0.131487876f}, std::array<float,2>{0.283286422f, 0.337377936f}, std::array<float,2>{0.728120625f, 0.61345154f}, std::array<float,2>{0.479884267f, 0.678723574f}, std::array<float,2>{0.577028632f, 0.377881408f}, std::array<float,2>{0.107844487f, 0.0422427878f}, std::array<float,2>{0.786086917f, 0.934039772f}, std::array<float,2>{0.128739923f, 0.747376919f}, std::array<float,2>{0.884954154f, 0.493294269f}, std::array<float,2>{0.325536579f, 0.117254406f}, std::array<float,2>{0.644479871f, 0.948869169f}, std::array<float,2>{0.428789943f, 0.780029953f}, std::array<float,2>{0.525000393f, 0.190165788f}, std::array<float,2>{0.00890282169f, 0.289591819f}, std::array<float,2>{0.839031458f, 0.537068844f}, std::array<float,2>{0.0667288825f, 0.889832675f}, std::array<float,2>{0.765205681f, 0.0181340165f}, std::array<float,2>{0.449495167f, 0.419294327f}, std::array<float,2>{0.599496126f, 0.640578866f}, std::array<float,2>{0.25690788f, 0.570367396f}, std::array<float,2>{0.717677832f, 0.357324183f}, std::array<float,2>{0.21076256f, 0.163912609f}, std::array<float,2>{0.971690059f, 0.858375907f}, std::array<float,2>{0.196379185f, 0.604948461f}, std::array<float,2>{0.998301566f, 0.317206532f}, std::array<float,2>{0.28038457f, 0.152603179f}, std::array<float,2>{0.69021517f, 0.83396554f}, std::array<float,2>{0.454325408f, 0.911558867f}, std::array<float,2>{0.623171449f, 0.0470234603f}, std::array<float,2>{0.0859583393f, 0.403361619f}, std::array<float,2>{0.776253462f, 0.666090906f}, std::array<float,2>{0.0211057235f, 0.785869658f}, std::array<float,2>{0.821646154f, 0.244076073f}, std::array<float,2>{0.418369412f, 0.252924919f}, std::array<float,2>{0.507481098f, 0.528860927f}, std::array<float,2>{0.333913743f, 0.697251499f}, std::array<float,2>{0.629923046f, 0.452822596f}, std::array<float,2>{0.144082829f, 0.064888902f}, std::array<float,2>{0.90413034f, 0.989905477f}, std::array<float,2>{0.117883727f, 0.648012996f}, std::array<float,2>{0.796958506f, 0.428538561f}, std::array<float,2>{0.487643659f, 0.0106361266f}, std::array<float,2>{0.585169792f, 0.90058583f}, std::array<float,2>{0.305899024f, 0.862914801f}, std::array<float,2>{0.740211725f, 0.17982389f}, std::array<float,2>{0.232043073f, 0.36206308f}, std::array<float,2>{0.947853088f, 0.591661394f}, std::array<float,2>{0.184139088f, 0.962120175f}, std::array<float,2>{0.90739888f, 0.10481526f}, std::array<float,2>{0.348301172f, 0.478826255f}, std::array<float,2>{0.676170945f, 0.727860808f}, std::array<float,2>{0.397551417f, 0.558513045f}, std::array<float,2>{0.535922766f, 0.309296429f}, std::array<float,2>{0.0324112773f, 0.207071379f}, std::array<float,2>{0.85761112f, 0.755817473f}, std::array<float,2>{0.0644021332f, 0.521962285f}, std::array<float,2>{0.760270655f, 0.258628428f}, std::array<float,2>{0.44914636f, 0.241721943f}, std::array<float,2>{0.595828235f, 0.790301621f}, std::array<float,2>{0.251718372f, 0.99323386f}, std::array<float,2>{0.71162051f, 0.0714662001f}, std::array<float,2>{0.204410076f, 0.4418239f}, std::array<float,2>{0.974263549f, 0.691391289f}, std::array<float,2>{0.129920125f, 0.843476236f}, std::array<float,2>{0.887267172f, 0.142726377f}, std::array<float,2>{0.323037833f, 0.328010291f}, std::array<float,2>{0.648147106f, 0.599870145f}, std::array<float,2>{0.422959507f, 0.657194853f}, std::array<float,2>{0.529699802f, 0.394610107f}, std::array<float,2>{0.0141596003f, 0.059887331f}, std::array<float,2>{0.840952635f, 0.916211843f}, std::array<float,2>{0.239581421f, 0.723608077f}, std::array<float,2>{0.968703806f, 0.470541477f}, std::array<float,2>{0.287401915f, 0.0998598859f}, std::array<float,2>{0.732591748f, 0.954106867f}, std::array<float,2>{0.482774079f, 0.759560645f}, std::array<float,2>{0.570515573f, 0.214576066f}, std::array<float,2>{0.102436632f, 0.301627398f}, std::array<float,2>{0.782839656f, 0.554108262f}, std::array<float,2>{0.0514632203f, 0.896511436f}, std::array<float,2>{0.865302205f, 7.89402693e-05f}, std::array<float,2>{0.38954547f, 0.436689675f}, std::array<float,2>{0.562275589f, 0.648706675f}, std::array<float,2>{0.373699516f, 0.58119303f}, std::array<float,2>{0.659505546f, 0.367408901f}, std::array<float,2>{0.170696706f, 0.17775175f}, std::array<float,2>{0.931467533f, 0.870636463f}, std::array<float,2>{0.181137279f, 0.62316674f}, std::array<float,2>{0.910622478f, 0.332284659f}, std::array<float,2>{0.344804257f, 0.139142215f}, std::array<float,2>{0.674250424f, 0.821847498f}, std::array<float,2>{0.393781275f, 0.924805045f}, std::array<float,2>{0.531846046f, 0.0382728316f}, std::array<float,2>{0.0389678776f, 0.386751115f}, std::array<float,2>{0.852815926f, 0.682072163f}, std::array<float,2>{0.122766629f, 0.804346442f}, std::array<float,2>{0.800826609f, 0.220696256f}, std::array<float,2>{0.491903901f, 0.276691824f}, std::array<float,2>{0.579472184f, 0.511805058f}, std::array<float,2>{0.309420496f, 0.709186018f}, std::array<float,2>{0.736529291f, 0.463556677f}, std::array<float,2>{0.230296209f, 0.0793370828f}, std::array<float,2>{0.952532828f, 0.97719413f}, std::array<float,2>{0.0188857783f, 0.627329171f}, std::array<float,2>{0.825768054f, 0.407654703f}, std::array<float,2>{0.416169614f, 0.0255996566f}, std::array<float,2>{0.501049399f, 0.876639247f}, std::array<float,2>{0.328851908f, 0.843989789f}, std::array<float,2>{0.627283096f, 0.169505373f}, std::array<float,2>{0.14498125f, 0.344127208f}, std::array<float,2>{0.898955643f, 0.565870285f}, std::array<float,2>{0.202251941f, 0.945290685f}, std::array<float,2>{0.992296636f, 0.111341156f}, std::array<float,2>{0.276194572f, 0.485275656f}, std::array<float,2>{0.693263412f, 0.737185776f}, std::array<float,2>{0.457524002f, 0.542719781f}, std::array<float,2>{0.617881954f, 0.286331028f}, std::array<float,2>{0.0926707014f, 0.202904195f}, std::array<float,2>{0.779069185f, 0.771316946f}, std::array<float,2>{0.0393920392f, 0.576910496f}, std::array<float,2>{0.847436965f, 0.353897572f}, std::array<float,2>{0.404643655f, 0.158412918f}, std::array<float,2>{0.546374917f, 0.853430271f}, std::array<float,2>{0.35422346f, 0.885438204f}, std::array<float,2>{0.6865803f, 0.0221960414f}, std::array<float,2>{0.175169811f, 0.417556137f}, std::array<float,2>{0.915173769f, 0.634539485f}, std::array<float,2>{0.220275849f, 0.776085079f}, std::array<float,2>{0.945163012f, 0.193751469f}, std::array<float,2>{0.300833404f, 0.29595089f}, std::array<float,2>{0.748818457f, 0.533479691f}, std::array<float,2>{0.499530047f, 0.744967401f}, std::array<float,2>{0.587872922f, 0.497427642f}, std::array<float,2>{0.111250781f, 0.123423859f}, std::array<float,2>{0.808222413f, 0.952427447f}, std::array<float,2>{0.152583271f, 0.675011158f}, std::array<float,2>{0.892440736f, 0.382796645f}, std::array<float,2>{0.343328118f, 0.0455362983f}, std::array<float,2>{0.635297894f, 0.929841459f}, std::array<float,2>{0.410551995f, 0.816127837f}, std::array<float,2>{0.508317947f, 0.128201395f}, std::array<float,2>{0.0274468362f, 0.342136413f}, std::array<float,2>{0.81567359f, 0.610837162f}, std::array<float,2>{0.0823459253f, 0.970773518f}, std::array<float,2>{0.76712364f, 0.0933041871f}, std::array<float,2>{0.464716733f, 0.457064092f}, std::array<float,2>{0.610325396f, 0.714588165f}, std::array<float,2>{0.266069323f, 0.504898131f}, std::array<float,2>{0.696571469f, 0.268001109f}, std::array<float,2>{0.19397676f, 0.228558004f}, std::array<float,2>{0.989298463f, 0.809741795f}, std::array<float,2>{0.216741264f, 0.561111987f}, std::array<float,2>{0.977588773f, 0.306754172f}, std::array<float,2>{0.261561036f, 0.205171302f}, std::array<float,2>{0.703254282f, 0.75034833f}, std::array<float,2>{0.444605768f, 0.966973126f}, std::array<float,2>{0.603893399f, 0.108669236f}, std::array<float,2>{0.0725143701f, 0.484362304f}, std::array<float,2>{0.751299918f, 0.731164455f}, std::array<float,2>{0.00273326202f, 0.865543425f}, std::array<float,2>{0.829815686f, 0.186966807f}, std::array<float,2>{0.436489016f, 0.363566458f}, std::array<float,2>{0.516913652f, 0.587851703f}, std::array<float,2>{0.315225154f, 0.641769707f}, std::array<float,2>{0.650602221f, 0.423539788f}, std::array<float,2>{0.137187347f, 0.0130068166f}, std::array<float,2>{0.880565464f, 0.903326631f}, std::array<float,2>{0.101130798f, 0.699296951f}, std::array<float,2>{0.792554319f, 0.447201878f}, std::array<float,2>{0.474212766f, 0.0671073645f}, std::array<float,2>{0.563551545f, 0.986046612f}, std::array<float,2>{0.291373312f, 0.782512844f}, std::array<float,2>{0.71928668f, 0.246217042f}, std::array<float,2>{0.242612287f, 0.257496268f}, std::array<float,2>{0.960037351f, 0.52523613f}, std::array<float,2>{0.163302734f, 0.909521878f}, std::array<float,2>{0.928219914f, 0.0515753366f}, std::array<float,2>{0.366585791f, 0.399388373f}, std::array<float,2>{0.667779863f, 0.67140466f}, std::array<float,2>{0.377604932f, 0.608845532f}, std::array<float,2>{0.551391959f, 0.312711239f}, std::array<float,2>{0.0574376695f, 0.152176827f}, std::array<float,2>{0.868966281f, 0.830704212f}, std::array<float,2>{0.113704398f, 0.596061945f}, std::array<float,2>{0.809324682f, 0.321062684f}, std::array<float,2>{0.494937271f, 0.146360025f}, std::array<float,2>{0.589936078f, 0.836589396f}, std::array<float,2>{0.300452024f, 0.918439448f}, std::array<float,2>{0.745616078f, 0.0567865409f}, std::array<float,2>{0.226048633f, 0.391327471f}, std::array<float,2>{0.938586116f, 0.662592351f}, std::array<float,2>{0.177908689f, 0.794406474f}, std::array<float,2>{0.920607328f, 0.235201418f}, std::array<float,2>{0.357595146f, 0.261978179f}, std::array<float,2>{0.683136344f, 0.51904577f}, std::array<float,2>{0.398623139f, 0.691916108f}, std::array<float,2>{0.540597737f, 0.439883143f}, std::array<float,2>{0.0446348526f, 0.0742973164f}, std::array<float,2>{0.849825263f, 0.999792397f}, std::array<float,2>{0.189401329f, 0.655533254f}, std::array<float,2>{0.985132575f, 0.431174546f}, std::array<float,2>{0.270114034f, 0.00622061035f}, std::array<float,2>{0.701550841f, 0.892871022f}, std::array<float,2>{0.46754843f, 0.871605277f}, std::array<float,2>{0.61558634f, 0.174247101f}, std::array<float,2>{0.0798092335f, 0.372006595f}, std::array<float,2>{0.769792438f, 0.583933294f}, std::array<float,2>{0.0254620798f, 0.958384275f}, std::array<float,2>{0.818838358f, 0.0959951952f}, std::array<float,2>{0.4097763f, 0.474246711f}, std::array<float,2>{0.514572978f, 0.720173478f}, std::array<float,2>{0.336025953f, 0.550100803f}, std::array<float,2>{0.639326751f, 0.300192058f}, std::array<float,2>{0.149418652f, 0.216562614f}, std::array<float,2>{0.896985412f, 0.763950765f}, std::array<float,2>{0.133078068f, 0.509934187f}, std::array<float,2>{0.877867937f, 0.279354662f}, std::array<float,2>{0.318963468f, 0.225781143f}, std::array<float,2>{0.654472709f, 0.800549626f}, std::array<float,2>{0.431002408f, 0.982342422f}, std::array<float,2>{0.520620525f, 0.0847585574f}, std::array<float,2>{0.00619269535f, 0.466678023f}, std::array<float,2>{0.834768414f, 0.703777313f}, std::array<float,2>{0.0772159025f, 0.826718926f}, std::array<float,2>{0.757175565f, 0.134694129f}, std::array<float,2>{0.438226044f, 0.328634441f}, std::array<float,2>{0.607849002f, 0.61731106f}, std::array<float,2>{0.264972597f, 0.683849335f}, std::array<float,2>{0.709147573f, 0.385693282f}, std::array<float,2>{0.2135638f, 0.0327563658f}, std::array<float,2>{0.982836246f, 0.92615062f}, std::array<float,2>{0.0591888279f, 0.739308238f}, std::array<float,2>{0.873539031f, 0.488601893f}, std::array<float,2>{0.382480502f, 0.11496757f}, std::array<float,2>{0.550214708f, 0.940204144f}, std::array<float,2>{0.36239025f, 0.76791364f}, std::array<float,2>{0.670310199f, 0.195500001f}, std::array<float,2>{0.158296004f, 0.283174604f}, std::array<float,2>{0.923769295f, 0.543283105f}, std::array<float,2>{0.247061282f, 0.881130874f}, std::array<float,2>{0.95529902f, 0.0310110021f}, std::array<float,2>{0.293119103f, 0.412019283f}, std::array<float,2>{0.723957121f, 0.630500197f}, std::array<float,2>{0.470626295f, 0.567802727f}, std::array<float,2>{0.567271948f, 0.349452168f}, std::array<float,2>{0.0939362198f, 0.16740638f}, std::array<float,2>{0.793302238f, 0.848133147f}, std::array<float,2>{0.0111144157f, 0.53891319f}, std::array<float,2>{0.837799191f, 0.291332394f}, std::array<float,2>{0.427547991f, 0.189441681f}, std::array<float,2>{0.526803553f, 0.778538704f}, std::array<float,2>{0.327241093f, 0.946542442f}, std::array<float,2>{0.642342925f, 0.120776169f}, std::array<float,2>{0.125464886f, 0.49452588f}, std::array<float,2>{0.883632362f, 0.748527467f}, std::array<float,2>{0.20705311f, 0.856487632f}, std::array<float,2>{0.968790054f, 0.160920024f}, std::array<float,2>{0.25428617f, 0.358887047f}, std::array<float,2>{0.716286182f, 0.573111892f}, std::array<float,2>{0.452542216f, 0.637979865f}, std::array<float,2>{0.599714935f, 0.420761555f}, std::array<float,2>{0.0687727034f, 0.0165115353f}, std::array<float,2>{0.763455093f, 0.888262749f}, std::array<float,2>{0.165262103f, 0.717993855f}, std::array<float,2>{0.935681343f, 0.454837263f}, std::array<float,2>{0.369898051f, 0.0892818645f}, std::array<float,2>{0.661598384f, 0.975201309f}, std::array<float,2>{0.385016769f, 0.805368185f}, std::array<float,2>{0.555243075f, 0.232881412f}, std::array<float,2>{0.0474625081f, 0.270042717f}, std::array<float,2>{0.860437989f, 0.501715779f}, std::array<float,2>{0.105767578f, 0.936740637f}, std::array<float,2>{0.788235903f, 0.0404830128f}, std::array<float,2>{0.477607429f, 0.376229525f}, std::array<float,2>{0.574822128f, 0.676273465f}, std::array<float,2>{0.281250656f, 0.615574718f}, std::array<float,2>{0.728738725f, 0.338788152f}, std::array<float,2>{0.238260627f, 0.129556894f}, std::array<float,2>{0.962905526f, 0.818040252f}, std::array<float,2>{0.233843118f, 0.592590153f}, std::array<float,2>{0.946942091f, 0.359891802f}, std::array<float,2>{0.307537198f, 0.182501599f}, std::array<float,2>{0.740434408f, 0.86086458f}, std::array<float,2>{0.485043555f, 0.900155783f}, std::array<float,2>{0.583487749f, 0.00947684515f}, std::array<float,2>{0.12013045f, 0.426421702f}, std::array<float,2>{0.799693167f, 0.645711064f}, std::array<float,2>{0.0342865922f, 0.757251143f}, std::array<float,2>{0.856148899f, 0.210605741f}, std::array<float,2>{0.394598484f, 0.310602009f}, std::array<float,2>{0.537852347f, 0.555852592f}, std::array<float,2>{0.35007599f, 0.729414165f}, std::array<float,2>{0.678071141f, 0.478333056f}, std::array<float,2>{0.186421886f, 0.101882696f}, std::array<float,2>{0.909649193f, 0.964775324f}, std::array<float,2>{0.0880132243f, 0.664783895f}, std::array<float,2>{0.774693966f, 0.404847473f}, std::array<float,2>{0.456134945f, 0.0506986529f}, std::array<float,2>{0.622550726f, 0.913723826f}, std::array<float,2>{0.2777628f, 0.834315836f}, std::array<float,2>{0.688459396f, 0.155537382f}, std::array<float,2>{0.198248789f, 0.319442958f}, std::array<float,2>{0.997837186f, 0.602747738f}, std::array<float,2>{0.141365662f, 0.990336299f}, std::array<float,2>{0.904445529f, 0.0637985542f}, std::array<float,2>{0.334907442f, 0.450853407f}, std::array<float,2>{0.631233394f, 0.697854102f}, std::array<float,2>{0.421328217f, 0.529617786f}, std::array<float,2>{0.504274905f, 0.250319004f}, std::array<float,2>{0.0232692752f, 0.244249105f}, std::array<float,2>{0.822271168f, 0.787766814f}, std::array<float,2>{0.0933527872f, 0.540620685f}, std::array<float,2>{0.777405739f, 0.288993567f}, std::array<float,2>{0.458873868f, 0.199342757f}, std::array<float,2>{0.618689001f, 0.772360146f}, std::array<float,2>{0.277162373f, 0.943205178f}, std::array<float,2>{0.692142308f, 0.111155637f}, std::array<float,2>{0.202131793f, 0.487086922f}, std::array<float,2>{0.993335962f, 0.734979212f}, std::array<float,2>{0.145674095f, 0.846349359f}, std::array<float,2>{0.899674952f, 0.171200603f}, std::array<float,2>{0.329198867f, 0.346359402f}, std::array<float,2>{0.628858924f, 0.56409049f}, std::array<float,2>{0.41718322f, 0.625264108f}, std::array<float,2>{0.500580072f, 0.408289969f}, std::array<float,2>{0.0178049151f, 0.0251598433f}, std::array<float,2>{0.82455045f, 0.877647996f}, std::array<float,2>{0.228568777f, 0.708527386f}, std::array<float,2>{0.951883137f, 0.462813884f}, std::array<float,2>{0.309865147f, 0.0808667317f}, std::array<float,2>{0.737935722f, 0.980395794f}, std::array<float,2>{0.49100247f, 0.802191436f}, std::array<float,2>{0.579062164f, 0.221989498f}, std::array<float,2>{0.12118382f, 0.274642378f}, std::array<float,2>{0.801850975f, 0.515526175f}, std::array<float,2>{0.0375852063f, 0.922258794f}, std::array<float,2>{0.852175236f, 0.0351693258f}, std::array<float,2>{0.393046647f, 0.39060384f}, std::array<float,2>{0.532396257f, 0.681135356f}, std::array<float,2>{0.344141364f, 0.622872829f}, std::array<float,2>{0.675218582f, 0.335539997f}, std::array<float,2>{0.180472538f, 0.138200268f}, std::array<float,2>{0.911166489f, 0.822287977f}, std::array<float,2>{0.17102316f, 0.579490423f}, std::array<float,2>{0.930244863f, 0.370443374f}, std::array<float,2>{0.374533266f, 0.176989406f}, std::array<float,2>{0.658373594f, 0.868646085f}, std::array<float,2>{0.390139818f, 0.895218015f}, std::array<float,2>{0.560771644f, 0.00369450822f}, std::array<float,2>{0.0522383898f, 0.434137583f}, std::array<float,2>{0.86684376f, 0.65124023f}, std::array<float,2>{0.103018411f, 0.76034677f}, std::array<float,2>{0.781377852f, 0.21212092f}, std::array<float,2>{0.484302074f, 0.304142654f}, std::array<float,2>{0.571804881f, 0.552008271f}, std::array<float,2>{0.288643628f, 0.7246117f}, std::array<float,2>{0.734374881f, 0.470704794f}, std::array<float,2>{0.23874256f, 0.0990250781f}, std::array<float,2>{0.966856182f, 0.95648694f}, std::array<float,2>{0.0147538604f, 0.658356667f}, std::array<float,2>{0.840371013f, 0.397807717f}, std::array<float,2>{0.422448277f, 0.0611853339f}, std::array<float,2>{0.530422449f, 0.915144444f}, std::array<float,2>{0.324010789f, 0.840855479f}, std::array<float,2>{0.646842778f, 0.140706852f}, std::array<float,2>{0.129220828f, 0.324628174f}, std::array<float,2>{0.888439953f, 0.598812342f}, std::array<float,2>{0.203754693f, 0.994269133f}, std::array<float,2>{0.973589063f, 0.0733001605f}, std::array<float,2>{0.250038654f, 0.444870412f}, std::array<float,2>{0.712618709f, 0.68818444f}, std::array<float,2>{0.447968751f, 0.520706356f}, std::array<float,2>{0.597454071f, 0.260943234f}, std::array<float,2>{0.0627497733f, 0.238663867f}, std::array<float,2>{0.761095107f, 0.791234314f}, std::array<float,2>{0.0584116392f, 0.606274426f}, std::array<float,2>{0.867468715f, 0.314563066f}, std::array<float,2>{0.378789872f, 0.149153888f}, std::array<float,2>{0.552223861f, 0.828318179f}, std::array<float,2>{0.365577608f, 0.906288326f}, std::array<float,2>{0.666053593f, 0.053254202f}, std::array<float,2>{0.162560806f, 0.401673198f}, std::array<float,2>{0.928806484f, 0.668063819f}, std::array<float,2>{0.243633792f, 0.783987582f}, std::array<float,2>{0.959125161f, 0.249035031f}, std::array<float,2>{0.292823464f, 0.255511701f}, std::array<float,2>{0.720046937f, 0.527091026f}, std::array<float,2>{0.473376632f, 0.702606142f}, std::array<float,2>{0.562845886f, 0.449161023f}, std::array<float,2>{0.100218356f, 0.0689423382f}, std::array<float,2>{0.791943192f, 0.986914873f}, std::array<float,2>{0.138492897f, 0.643042982f}, std::array<float,2>{0.879768908f, 0.424550653f}, std::array<float,2>{0.315865219f, 0.0147449346f}, std::array<float,2>{0.651369214f, 0.905575752f}, std::array<float,2>{0.437315851f, 0.863509715f}, std::array<float,2>{0.515838861f, 0.184777543f}, std::array<float,2>{0.00364349061f, 0.366275936f}, std::array<float,2>{0.828668714f, 0.588814855f}, std::array<float,2>{0.0734098032f, 0.966003478f}, std::array<float,2>{0.750639498f, 0.105969273f}, std::array<float,2>{0.443822503f, 0.481970489f}, std::array<float,2>{0.605170786f, 0.73358345f}, std::array<float,2>{0.260166109f, 0.558665037f}, std::array<float,2>{0.704457462f, 0.304780066f}, std::array<float,2>{0.215674162f, 0.204548359f}, std::array<float,2>{0.977529287f, 0.75360167f}, std::array<float,2>{0.194495514f, 0.507776499f}, std::array<float,2>{0.988365769f, 0.26599136f}, std::array<float,2>{0.266702235f, 0.227679774f}, std::array<float,2>{0.695823431f, 0.810735404f}, std::array<float,2>{0.463099003f, 0.969626904f}, std::array<float,2>{0.610878706f, 0.0914076492f}, std::array<float,2>{0.0838760957f, 0.460511833f}, std::array<float,2>{0.766239643f, 0.712514281f}, std::array<float,2>{0.0291405842f, 0.812703073f}, std::array<float,2>{0.814687192f, 0.126415327f}, std::array<float,2>{0.411471695f, 0.341348678f}, std::array<float,2>{0.509172797f, 0.61294955f}, std::array<float,2>{0.341931671f, 0.673293591f}, std::array<float,2>{0.635811627f, 0.380392492f}, std::array<float,2>{0.153833196f, 0.0434198007f}, std::array<float,2>{0.891409636f, 0.932892382f}, std::array<float,2>{0.109421395f, 0.743077695f}, std::array<float,2>{0.807071686f, 0.498686314f}, std::array<float,2>{0.498989999f, 0.122784592f}, std::array<float,2>{0.586585343f, 0.950932026f}, std::array<float,2>{0.301945835f, 0.773616076f}, std::array<float,2>{0.749538481f, 0.192422181f}, std::array<float,2>{0.21935457f, 0.294771641f}, std::array<float,2>{0.943588555f, 0.531399131f}, std::array<float,2>{0.174603105f, 0.88418895f}, std::array<float,2>{0.914610922f, 0.0204514209f}, std::array<float,2>{0.355266124f, 0.414121717f}, std::array<float,2>{0.685871005f, 0.635136902f}, std::array<float,2>{0.40621537f, 0.574650824f}, std::array<float,2>{0.545787632f, 0.35312885f}, std::array<float,2>{0.0406307504f, 0.156904563f}, std::array<float,2>{0.845750868f, 0.853742599f}, std::array<float,2>{0.0956101194f, 0.569568932f}, std::array<float,2>{0.794051409f, 0.351022005f}, std::array<float,2>{0.469133586f, 0.165876806f}, std::array<float,2>{0.567549884f, 0.850105226f}, std::array<float,2>{0.294337541f, 0.879974008f}, std::array<float,2>{0.723284364f, 0.0283745974f}, std::array<float,2>{0.247796997f, 0.414010048f}, std::array<float,2>{0.956322253f, 0.632214069f}, std::array<float,2>{0.159814999f, 0.766419411f}, std::array<float,2>{0.922083557f, 0.1989602f}, std::array<float,2>{0.362153113f, 0.284387618f}, std::array<float,2>{0.67136246f, 0.546385825f}, std::array<float,2>{0.381519169f, 0.740845263f}, std::array<float,2>{0.549321055f, 0.492026567f}, std::array<float,2>{0.0604388863f, 0.115819074f}, std::array<float,2>{0.874394476f, 0.937951505f}, std::array<float,2>{0.214629024f, 0.687315881f}, std::array<float,2>{0.983757675f, 0.38345772f}, std::array<float,2>{0.263877332f, 0.0341302454f}, std::array<float,2>{0.710539103f, 0.92883426f}, std::array<float,2>{0.438538104f, 0.825950146f}, std::array<float,2>{0.609178245f, 0.135824725f}, std::array<float,2>{0.0761762932f, 0.331925869f}, std::array<float,2>{0.756799996f, 0.620361209f}, std::array<float,2>{0.00693167979f, 0.983547866f}, std::array<float,2>{0.835281372f, 0.0823922455f}, std::array<float,2>{0.430484086f, 0.46836859f}, std::array<float,2>{0.520122707f, 0.706158221f}, std::array<float,2>{0.319780678f, 0.508081496f}, std::array<float,2>{0.655349731f, 0.277658463f}, std::array<float,2>{0.134238973f, 0.222688064f}, std::array<float,2>{0.878551483f, 0.798642099f}, std::array<float,2>{0.148946494f, 0.548149943f}, std::array<float,2>{0.89835763f, 0.297766387f}, std::array<float,2>{0.336947203f, 0.217588365f}, std::array<float,2>{0.639827609f, 0.762724817f}, std::array<float,2>{0.4090662f, 0.9608652f}, std::array<float,2>{0.51540637f, 0.0953127891f}, std::array<float,2>{0.0270899218f, 0.475332737f}, std::array<float,2>{0.819837451f, 0.721286476f}, std::array<float,2>{0.0782085955f, 0.874380171f}, std::array<float,2>{0.771173596f, 0.171890706f}, std::array<float,2>{0.468159974f, 0.374760091f}, std::array<float,2>{0.616275012f, 0.583993018f}, std::array<float,2>{0.270680308f, 0.652930081f}, std::array<float,2>{0.702909827f, 0.432535321f}, std::array<float,2>{0.187599003f, 0.00547635974f}, std::array<float,2>{0.985669196f, 0.8916291f}, std::array<float,2>{0.0437507518f, 0.694003999f}, std::array<float,2>{0.850784838f, 0.438771725f}, std::array<float,2>{0.400304466f, 0.077759698f}, std::array<float,2>{0.539730906f, 0.997018576f}, std::array<float,2>{0.358890682f, 0.796856582f}, std::array<float,2>{0.682017446f, 0.236744672f}, std::array<float,2>{0.178942889f, 0.263900608f}, std::array<float,2>{0.921344221f, 0.517193317f}, std::array<float,2>{0.225167975f, 0.919985414f}, std::array<float,2>{0.938325286f, 0.0552990921f}, std::array<float,2>{0.299644351f, 0.393329591f}, std::array<float,2>{0.745019615f, 0.662060738f}, std::array<float,2>{0.495177507f, 0.595302463f}, std::array<float,2>{0.590862632f, 0.323242277f}, std::array<float,2>{0.115200169f, 0.148169726f}, std::array<float,2>{0.809887528f, 0.838980973f}, std::array<float,2>{0.0216289945f, 0.527600884f}, std::array<float,2>{0.824097693f, 0.253398687f}, std::array<float,2>{0.419994682f, 0.242754325f}, std::array<float,2>{0.5057078f, 0.786286652f}, std::array<float,2>{0.335484475f, 0.989186823f}, std::array<float,2>{0.63232249f, 0.0654403344f}, std::array<float,2>{0.142076313f, 0.451827914f}, std::array<float,2>{0.905285537f, 0.695612192f}, std::array<float,2>{0.197321013f, 0.832494855f}, std::array<float,2>{0.996711671f, 0.15359278f}, std::array<float,2>{0.278501451f, 0.317995846f}, std::array<float,2>{0.689050019f, 0.60408026f}, std::array<float,2>{0.455216944f, 0.667426109f}, std::array<float,2>{0.621906877f, 0.402423352f}, std::array<float,2>{0.0892933831f, 0.0485484228f}, std::array<float,2>{0.773679376f, 0.91037339f}, std::array<float,2>{0.186937124f, 0.727391839f}, std::array<float,2>{0.908208072f, 0.480302393f}, std::array<float,2>{0.351393193f, 0.104078777f}, std::array<float,2>{0.679074526f, 0.961336076f}, std::array<float,2>{0.395608902f, 0.753912389f}, std::array<float,2>{0.538889289f, 0.2083866f}, std::array<float,2>{0.0334126279f, 0.31038785f}, std::array<float,2>{0.856908321f, 0.556997061f}, std::array<float,2>{0.119248874f, 0.902114511f}, std::array<float,2>{0.800032496f, 0.0115236547f}, std::array<float,2>{0.485410541f, 0.42892316f}, std::array<float,2>{0.582737446f, 0.646504045f}, std::array<float,2>{0.308514118f, 0.590389132f}, std::array<float,2>{0.741737425f, 0.362350494f}, std::array<float,2>{0.233280063f, 0.18110244f}, std::array<float,2>{0.945552349f, 0.861399114f}, std::array<float,2>{0.236505985f, 0.61476475f}, std::array<float,2>{0.963959873f, 0.336723357f}, std::array<float,2>{0.282630205f, 0.132754147f}, std::array<float,2>{0.729522645f, 0.82008636f}, std::array<float,2>{0.47676146f, 0.935194969f}, std::array<float,2>{0.575761795f, 0.0411212966f}, std::array<float,2>{0.106975861f, 0.378666669f}, std::array<float,2>{0.787214875f, 0.678442836f}, std::array<float,2>{0.0480746627f, 0.807594061f}, std::array<float,2>{0.859493911f, 0.230842024f}, std::array<float,2>{0.385876387f, 0.272408903f}, std::array<float,2>{0.556601167f, 0.503456712f}, std::array<float,2>{0.370782316f, 0.715164363f}, std::array<float,2>{0.660894036f, 0.455580711f}, std::array<float,2>{0.164078265f, 0.0869432464f}, std::array<float,2>{0.9374277f, 0.974587917f}, std::array<float,2>{0.0702788532f, 0.638785005f}, std::array<float,2>{0.762387276f, 0.418180376f}, std::array<float,2>{0.451266497f, 0.0192962158f}, std::array<float,2>{0.601512551f, 0.88874197f}, std::array<float,2>{0.255334914f, 0.858964086f}, std::array<float,2>{0.715041399f, 0.162714615f}, std::array<float,2>{0.208507568f, 0.355841905f}, std::array<float,2>{0.970341444f, 0.571541905f}, std::array<float,2>{0.126196429f, 0.947534561f}, std::array<float,2>{0.884480357f, 0.118488021f}, std::array<float,2>{0.326942474f, 0.492206514f}, std::array<float,2>{0.640632272f, 0.746779263f}, std::array<float,2>{0.426006496f, 0.535821617f}, std::array<float,2>{0.525870979f, 0.29007718f}, std::array<float,2>{0.0102540357f, 0.191153526f}, std::array<float,2>{0.836412311f, 0.781053185f}, std::array<float,2>{0.124338605f, 0.512789965f}, std::array<float,2>{0.803739965f, 0.276323646f}, std::array<float,2>{0.489575177f, 0.219368234f}, std::array<float,2>{0.580817759f, 0.803185642f}, std::array<float,2>{0.311701983f, 0.977652729f}, std::array<float,2>{0.734628737f, 0.0788984448f}, std::array<float,2>{0.227647752f, 0.464196682f}, std::array<float,2>{0.950062394f, 0.710528612f}, std::array<float,2>{0.182090193f, 0.82077235f}, std::array<float,2>{0.912355304f, 0.14009282f}, std::array<float,2>{0.347446889f, 0.33379212f}, std::array<float,2>{0.673761964f, 0.62498498f}, std::array<float,2>{0.390954822f, 0.682905078f}, std::array<float,2>{0.533607602f, 0.387752593f}, std::array<float,2>{0.035526637f, 0.0377511494f}, std::array<float,2>{0.855319798f, 0.924227715f}, std::array<float,2>{0.200419903f, 0.737988591f}, std::array<float,2>{0.994977117f, 0.485610276f}, std::array<float,2>{0.274516553f, 0.113210812f}, std::array<float,2>{0.694751501f, 0.943817258f}, std::array<float,2>{0.459470153f, 0.769997835f}, std::array<float,2>{0.61937052f, 0.201851606f}, std::array<float,2>{0.0910791978f, 0.285197437f}, std::array<float,2>{0.781006515f, 0.541885018f}, std::array<float,2>{0.017057674f, 0.875563204f}, std::array<float,2>{0.826177359f, 0.0266152117f}, std::array<float,2>{0.414640933f, 0.407080799f}, std::array<float,2>{0.502351046f, 0.628405154f}, std::array<float,2>{0.331990838f, 0.565062165f}, std::array<float,2>{0.625453591f, 0.344805896f}, std::array<float,2>{0.147080675f, 0.16802454f}, std::array<float,2>{0.901392937f, 0.844752789f}, std::array<float,2>{0.131079853f, 0.601403892f}, std::array<float,2>{0.890322983f, 0.326960146f}, std::array<float,2>{0.320563108f, 0.144516215f}, std::array<float,2>{0.644751966f, 0.842476249f}, std::array<float,2>{0.424748808f, 0.91751349f}, std::array<float,2>{0.528460205f, 0.0589602105f}, std::array<float,2>{0.0121519594f, 0.395803094f}, std::array<float,2>{0.841950774f, 0.657373428f}, std::array<float,2>{0.0663433298f, 0.789848447f}, std::array<float,2>{0.759702384f, 0.240763813f}, std::array<float,2>{0.447114229f, 0.259139776f}, std::array<float,2>{0.593894422f, 0.523200452f}, std::array<float,2>{0.252627432f, 0.690426052f}, std::array<float,2>{0.713601887f, 0.443153143f}, std::array<float,2>{0.205597073f, 0.070992142f}, std::array<float,2>{0.974866986f, 0.993009746f}, std::array<float,2>{0.0536321327f, 0.649811387f}, std::array<float,2>{0.863409519f, 0.435777992f}, std::array<float,2>{0.387260228f, 0.001259682f}, std::array<float,2>{0.560492754f, 0.89840436f}, std::array<float,2>{0.372592151f, 0.869335055f}, std::array<float,2>{0.656777024f, 0.179541737f}, std::array<float,2>{0.168594331f, 0.369049937f}, std::array<float,2>{0.932718396f, 0.580227137f}, std::array<float,2>{0.241180599f, 0.953443468f}, std::array<float,2>{0.965419948f, 0.100658953f}, std::array<float,2>{0.28680706f, 0.469289839f}, std::array<float,2>{0.732405186f, 0.72405833f}, std::array<float,2>{0.480998397f, 0.553452909f}, std::array<float,2>{0.572525501f, 0.302027851f}, std::array<float,2>{0.104139917f, 0.213519886f}, std::array<float,2>{0.784749448f, 0.757944286f}, std::array<float,2>{0.000643512816f, 0.586829305f}, std::array<float,2>{0.830766439f, 0.364854991f}, std::array<float,2>{0.435112864f, 0.185800761f}, std::array<float,2>{0.518176436f, 0.866770506f}, std::array<float,2>{0.313045114f, 0.902819097f}, std::array<float,2>{0.648637176f, 0.0118620312f}, std::array<float,2>{0.139335394f, 0.422128409f}, std::array<float,2>{0.882093012f, 0.64105767f}, std::array<float,2>{0.217767179f, 0.751490355f}, std::array<float,2>{0.979127944f, 0.206257284f}, std::array<float,2>{0.25954923f, 0.308081388f}, std::array<float,2>{0.705975533f, 0.561904967f}, std::array<float,2>{0.443111807f, 0.731850266f}, std::array<float,2>{0.603092968f, 0.483376145f}, std::array<float,2>{0.0703199878f, 0.107811272f}, std::array<float,2>{0.752718687f, 0.967833877f}, std::array<float,2>{0.161259249f, 0.670568168f}, std::array<float,2>{0.926248014f, 0.400222152f}, std::array<float,2>{0.36435923f, 0.0523328707f}, std::array<float,2>{0.664768279f, 0.908420026f}, std::array<float,2>{0.375636995f, 0.831990063f}, std::array<float,2>{0.55350548f, 0.15115115f}, std::array<float,2>{0.0555747785f, 0.313805103f}, std::array<float,2>{0.870856583f, 0.607708514f}, std::array<float,2>{0.097772561f, 0.984386623f}, std::array<float,2>{0.790056884f, 0.0682025701f}, std::array<float,2>{0.476192147f, 0.446171731f}, std::array<float,2>{0.565237105f, 0.700463712f}, std::array<float,2>{0.290145665f, 0.523760259f}, std::array<float,2>{0.722296178f, 0.256412387f}, std::array<float,2>{0.244922489f, 0.247852832f}, std::array<float,2>{0.957596779f, 0.78137821f}, std::array<float,2>{0.222618014f, 0.534863412f}, std::array<float,2>{0.942123711f, 0.295793504f}, std::array<float,2>{0.303445011f, 0.194785908f}, std::array<float,2>{0.746789217f, 0.7764979f}, std::array<float,2>{0.497488886f, 0.952064395f}, std::array<float,2>{0.588893175f, 0.124049433f}, std::array<float,2>{0.111555472f, 0.496780485f}, std::array<float,2>{0.804936767f, 0.745312452f}, std::array<float,2>{0.0423690677f, 0.852292061f}, std::array<float,2>{0.845024824f, 0.159477696f}, std::array<float,2>{0.403762072f, 0.355039448f}, std::array<float,2>{0.54331553f, 0.577987432f}, std::array<float,2>{0.352489889f, 0.633039355f}, std::array<float,2>{0.683705568f, 0.416225255f}, std::array<float,2>{0.173239082f, 0.0233120918f}, std::array<float,2>{0.916356742f, 0.886695623f}, std::array<float,2>{0.085471794f, 0.713058233f}, std::array<float,2>{0.767768979f, 0.458799183f}, std::array<float,2>{0.461119682f, 0.092686899f}, std::array<float,2>{0.611707449f, 0.972304463f}, std::array<float,2>{0.268070608f, 0.808830261f}, std::array<float,2>{0.697662652f, 0.230302736f}, std::array<float,2>{0.191471681f, 0.268633336f}, std::array<float,2>{0.991091251f, 0.504160464f}, std::array<float,2>{0.155432135f, 0.931245446f}, std::array<float,2>{0.894238591f, 0.0464109555f}, std::array<float,2>{0.340950936f, 0.38145256f}, std::array<float,2>{0.632893622f, 0.674232125f}, std::array<float,2>{0.41380167f, 0.610055566f}, std::array<float,2>{0.511481941f, 0.34332341f}, std::array<float,2>{0.029459279f, 0.127401173f}, std::array<float,2>{0.81417352f, 0.814592838f}, std::array<float,2>{0.0747979283f, 0.618436933f}, std::array<float,2>{0.755838513f, 0.329316646f}, std::array<float,2>{0.441159874f, 0.133684948f}, std::array<float,2>{0.607120335f, 0.827648818f}, std::array<float,2>{0.262281805f, 0.927730143f}, std::array<float,2>{0.707237184f, 0.0314874649f}, std::array<float,2>{0.211017624f, 0.38594687f}, std::array<float,2>{0.981035054f, 0.684856951f}, std::array<float,2>{0.136657655f, 0.799245179f}, std::array<float,2>{0.875391424f, 0.224866942f}, std::array<float,2>{0.317241609f, 0.28111735f}, std::array<float,2>{0.653049588f, 0.511376083f}, std::array<float,2>{0.432142138f, 0.704913795f}, std::array<float,2>{0.521544993f, 0.465586007f}, std::array<float,2>{0.00510489708f, 0.0855909064f}, std::array<float,2>{0.833882987f, 0.980507374f}, std::array<float,2>{0.249645665f, 0.629443824f}, std::array<float,2>{0.953948021f, 0.410843968f}, std::array<float,2>{0.295217931f, 0.0301446002f}, std::array<float,2>{0.726303756f, 0.882067502f}, std::array<float,2>{0.471908748f, 0.84950757f}, std::array<float,2>{0.569487214f, 0.166241884f}, std::array<float,2>{0.0968145803f, 0.347821265f}, std::array<float,2>{0.796388388f, 0.567113101f}, std::array<float,2>{0.0618798882f, 0.940474808f}, std::array<float,2>{0.871146739f, 0.11329861f}, std::array<float,2>{0.379789919f, 0.490156382f}, std::array<float,2>{0.547146797f, 0.738830686f}, std::array<float,2>{0.360622436f, 0.544603944f}, std::array<float,2>{0.668994367f, 0.281518281f}, std::array<float,2>{0.157895908f, 0.196478739f}, std::array<float,2>{0.924719632f, 0.769370675f}, std::array<float,2>{0.176091269f, 0.517673254f}, std::array<float,2>{0.919059098f, 0.263641626f}, std::array<float,2>{0.356504083f, 0.236142993f}, std::array<float,2>{0.681455195f, 0.793886781f}, std::array<float,2>{0.402246922f, 0.998313606f}, std::array<float,2>{0.542795479f, 0.0758950859f}, std::array<float,2>{0.0459517911f, 0.441215008f}, std::array<float,2>{0.849565744f, 0.692787766f}, std::array<float,2>{0.116465367f, 0.837544143f}, std::array<float,2>{0.81103915f, 0.144935757f}, std::array<float,2>{0.492256612f, 0.322202742f}, std::array<float,2>{0.593299627f, 0.597385287f}, std::array<float,2>{0.297011733f, 0.663237095f}, std::array<float,2>{0.74222219f, 0.391753405f}, std::array<float,2>{0.224490881f, 0.0577896722f}, std::array<float,2>{0.941183627f, 0.919473469f}, std::array<float,2>{0.024738729f, 0.719591737f}, std::array<float,2>{0.817857087f, 0.473178864f}, std::array<float,2>{0.407689095f, 0.0973296538f}, std::array<float,2>{0.511755347f, 0.957834661f}, std::array<float,2>{0.338912696f, 0.764901996f}, std::array<float,2>{0.638042271f, 0.215806141f}, std::array<float,2>{0.151872754f, 0.299468845f}, std::array<float,2>{0.896479487f, 0.549561977f}, std::array<float,2>{0.190628812f, 0.893958807f}, std::array<float,2>{0.987631619f, 0.00713660009f}, std::array<float,2>{0.273091555f, 0.43002066f}, std::array<float,2>{0.699343264f, 0.654314697f}, std::array<float,2>{0.46604073f, 0.582341731f}, std::array<float,2>{0.613552332f, 0.372634977f}, std::array<float,2>{0.0804616511f, 0.175282151f}, std::array<float,2>{0.771884143f, 0.872291386f}, std::array<float,2>{0.0318464413f, 0.554993808f}, std::array<float,2>{0.858516276f, 0.312481195f}, std::array<float,2>{0.396827936f, 0.209768295f}, std::array<float,2>{0.537040472f, 0.756411672f}, std::array<float,2>{0.348994225f, 0.963812351f}, std::array<float,2>{0.677143693f, 0.102803856f}, std::array<float,2>{0.18483831f, 0.476800472f}, std::array<float,2>{0.906745732f, 0.729650497f}, std::array<float,2>{0.231296346f, 0.860306382f}, std::array<float,2>{0.948612332f, 0.182736009f}, std::array<float,2>{0.305246264f, 0.361152589f}, std::array<float,2>{0.738797665f, 0.593267679f}, std::array<float,2>{0.486599743f, 0.644684672f}, std::array<float,2>{0.584917665f, 0.427392542f}, std::array<float,2>{0.118435934f, 0.00847406592f}, std::array<float,2>{0.798578382f, 0.899374485f}, std::array<float,2>{0.143378079f, 0.698493361f}, std::array<float,2>{0.903015912f, 0.450189441f}, std::array<float,2>{0.332630277f, 0.0628768876f}, std::array<float,2>{0.62988174f, 0.991908252f}, std::array<float,2>{0.419669032f, 0.788606107f}, std::array<float,2>{0.505864918f, 0.245844454f}, std::array<float,2>{0.019550493f, 0.251636475f}, std::array<float,2>{0.820405841f, 0.530829906f}, std::array<float,2>{0.0878731012f, 0.912734926f}, std::array<float,2>{0.77687031f, 0.0495689325f}, std::array<float,2>{0.453845173f, 0.405685663f}, std::array<float,2>{0.624851942f, 0.665283084f}, std::array<float,2>{0.279518068f, 0.601789057f}, std::array<float,2>{0.690846026f, 0.318397343f}, std::array<float,2>{0.195735842f, 0.155066311f}, std::array<float,2>{0.999831796f, 0.835094929f}, std::array<float,2>{0.209410727f, 0.573556542f}, std::array<float,2>{0.971476078f, 0.358120233f}, std::array<float,2>{0.256099403f, 0.161167309f}, std::array<float,2>{0.71820277f, 0.856418252f}, std::array<float,2>{0.450213104f, 0.887373507f}, std::array<float,2>{0.598262906f, 0.0175184719f}, std::array<float,2>{0.0683323964f, 0.421502173f}, std::array<float,2>{0.763932168f, 0.637008309f}, std::array<float,2>{0.00861333776f, 0.77774334f}, std::array<float,2>{0.838560939f, 0.188422307f}, std::array<float,2>{0.428379864f, 0.292242438f}, std::array<float,2>{0.523930907f, 0.537926733f}, std::array<float,2>{0.324969262f, 0.749973714f}, std::array<float,2>{0.64353472f, 0.495409966f}, std::array<float,2>{0.12745589f, 0.119389936f}, std::array<float,2>{0.886160254f, 0.945387304f}, std::array<float,2>{0.108538657f, 0.677307427f}, std::array<float,2>{0.786424637f, 0.375393033f}, std::array<float,2>{0.478894919f, 0.0393150114f}, std::array<float,2>{0.577273488f, 0.93557936f}, std::array<float,2>{0.284659505f, 0.817117453f}, std::array<float,2>{0.726751566f, 0.130120248f}, std::array<float,2>{0.235425785f, 0.339202642f}, std::array<float,2>{0.96141696f, 0.616792023f}, std::array<float,2>{0.167724684f, 0.97587347f}, std::array<float,2>{0.934791327f, 0.0888483301f}, std::array<float,2>{0.369107097f, 0.45378831f}, std::array<float,2>{0.663782597f, 0.717085302f}, std::array<float,2>{0.384325057f, 0.50069046f}, std::array<float,2>{0.557977259f, 0.271117896f}, std::array<float,2>{0.0499629416f, 0.233546257f}, std::array<float,2>{0.862027109f, 0.805977046f}, std::array<float,2>{0.118353717f, 0.55777806f}, std::array<float,2>{0.798614681f, 0.308880121f}, std::array<float,2>{0.486405343f, 0.207663551f}, std::array<float,2>{0.58453083f, 0.755071342f}, std::array<float,2>{0.305590719f, 0.962406516f}, std::array<float,2>{0.739249885f, 0.105276629f}, std::array<float,2>{0.231021106f, 0.479207695f}, std::array<float,2>{0.948303759f, 0.72820133f}, std::array<float,2>{0.184805334f, 0.862317741f}, std::array<float,2>{0.907183051f, 0.180378929f}, std::array<float,2>{0.3488065f, 0.361344278f}, std::array<float,2>{0.67678386f, 0.591073215f}, std::array<float,2>{0.396536916f, 0.647935152f}, std::array<float,2>{0.536723614f, 0.428123295f}, std::array<float,2>{0.0320779607f, 0.0101339761f}, std::array<float,2>{0.858682871f, 0.900912225f}, std::array<float,2>{0.195464224f, 0.696561754f}, std::array<float,2>{0.999636233f, 0.452510655f}, std::array<float,2>{0.279742956f, 0.0651920289f}, std::array<float,2>{0.69064641f, 0.989269793f}, std::array<float,2>{0.454027474f, 0.785272419f}, std::array<float,2>{0.624535084f, 0.243476987f}, std::array<float,2>{0.0875931755f, 0.252402812f}, std::array<float,2>{0.777311862f, 0.528614163f}, std::array<float,2>{0.019857822f, 0.911970019f}, std::array<float,2>{0.820738614f, 0.0477830656f}, std::array<float,2>{0.419882506f, 0.403974921f}, std::array<float,2>{0.506165683f, 0.666618168f}, std::array<float,2>{0.332766414f, 0.605358005f}, std::array<float,2>{0.629559338f, 0.316490352f}, std::array<float,2>{0.143192634f, 0.153060079f}, std::array<float,2>{0.903149188f, 0.833319604f}, std::array<float,2>{0.12782222f, 0.571177602f}, std::array<float,2>{0.885950446f, 0.35689494f}, std::array<float,2>{0.324715674f, 0.16331546f}, std::array<float,2>{0.643303394f, 0.857873857f}, std::array<float,2>{0.42870295f, 0.890167296f}, std::array<float,2>{0.524332225f, 0.0177489724f}, std::array<float,2>{0.00844110083f, 0.419700652f}, std::array<float,2>{0.838631213f, 0.640027106f}, std::array<float,2>{0.0678851157f, 0.779692113f}, std::array<float,2>{0.763821721f, 0.189621165f}, std::array<float,2>{0.450628549f, 0.289305747f}, std::array<float,2>{0.598629594f, 0.536536813f}, std::array<float,2>{0.256328106f, 0.747932792f}, std::array<float,2>{0.717930913f, 0.494053066f}, std::array<float,2>{0.209221005f, 0.118136257f}, std::array<float,2>{0.971334994f, 0.948363245f}, std::array<float,2>{0.0502554961f, 0.679646492f}, std::array<float,2>{0.862156212f, 0.377347827f}, std::array<float,2>{0.3846533f, 0.0426199809f}, std::array<float,2>{0.557724118f, 0.934087992f}, std::array<float,2>{0.368801713f, 0.818473637f}, std::array<float,2>{0.663968325f, 0.131266221f}, std::array<float,2>{0.167498186f, 0.337781936f}, std::array<float,2>{0.934966028f, 0.613911808f}, std::array<float,2>{0.235647634f, 0.973163128f}, std::array<float,2>{0.961073101f, 0.0863486379f}, std::array<float,2>{0.284420013f, 0.456404835f}, std::array<float,2>{0.727019787f, 0.71631521f}, std::array<float,2>{0.478524745f, 0.502251148f}, std::array<float,2>{0.577436388f, 0.272696137f}, std::array<float,2>{0.108870968f, 0.231520534f}, std::array<float,2>{0.786262751f, 0.808523834f}, std::array<float,2>{0.00513848662f, 0.619142294f}, std::array<float,2>{0.833572209f, 0.330208957f}, std::array<float,2>{0.432383507f, 0.135398075f}, std::array<float,2>{0.521971226f, 0.825135291f}, std::array<float,2>{0.31694755f, 0.928342044f}, std::array<float,2>{0.653180063f, 0.0345383473f}, std::array<float,2>{0.13645573f, 0.383821577f}, std::array<float,2>{0.875112951f, 0.685596704f}, std::array<float,2>{0.211240649f, 0.79688412f}, std::array<float,2>{0.981420994f, 0.224137187f}, std::array<float,2>{0.262578905f, 0.278814375f}, std::array<float,2>{0.707411945f, 0.508878589f}, std::array<float,2>{0.441325873f, 0.705975115f}, std::array<float,2>{0.607224464f, 0.467718393f}, std::array<float,2>{0.0750250667f, 0.0832782537f}, std::array<float,2>{0.755403519f, 0.982678771f}, std::array<float,2>{0.158003807f, 0.631337404f}, std::array<float,2>{0.924402177f, 0.41291365f}, std::array<float,2>{0.36049065f, 0.0276578609f}, std::array<float,2>{0.669352531f, 0.879040539f}, std::array<float,2>{0.379526228f, 0.851166308f}, std::array<float,2>{0.54707092f, 0.16428183f}, std::array<float,2>{0.0617094599f, 0.350021064f}, std::array<float,2>{0.871558309f, 0.568933606f}, std::array<float,2>{0.0969285145f, 0.938629627f}, std::array<float,2>{0.796644688f, 0.117138647f}, std::array<float,2>{0.471958011f, 0.490901113f}, std::array<float,2>{0.56962055f, 0.741734564f}, std::array<float,2>{0.295058399f, 0.545366108f}, std::array<float,2>{0.72642684f, 0.284045398f}, std::array<float,2>{0.249934912f, 0.197355106f}, std::array<float,2>{0.95373559f, 0.766821086f}, std::array<float,2>{0.224275291f, 0.515765309f}, std::array<float,2>{0.940951109f, 0.265561372f}, std::array<float,2>{0.297161758f, 0.237365812f}, std::array<float,2>{0.742654383f, 0.79492265f}, std::array<float,2>{0.492674679f, 0.997378469f}, std::array<float,2>{0.593572378f, 0.0762474313f}, std::array<float,2>{0.116420604f, 0.438318878f}, std::array<float,2>{0.811285496f, 0.69435066f}, std::array<float,2>{0.0462885387f, 0.838864744f}, std::array<float,2>{0.849173784f, 0.147296757f}, std::array<float,2>{0.401855737f, 0.322742581f}, std::array<float,2>{0.542517006f, 0.594665289f}, std::array<float,2>{0.356933415f, 0.66044116f}, std::array<float,2>{0.681317091f, 0.394102186f}, std::array<float,2>{0.175829008f, 0.0564970672f}, std::array<float,2>{0.919212222f, 0.921624303f}, std::array<float,2>{0.0801902637f, 0.722014189f}, std::array<float,2>{0.771695733f, 0.476279557f}, std::array<float,2>{0.466255695f, 0.0943417847f}, std::array<float,2>{0.613484859f, 0.959649026f}, std::array<float,2>{0.273194432f, 0.761721671f}, std::array<float,2>{0.699500918f, 0.218050435f}, std::array<float,2>{0.190863937f, 0.298248351f}, std::array<float,2>{0.987440169f, 0.547656f}, std::array<float,2>{0.152297735f, 0.890668809f}, std::array<float,2>{0.896071672f, 0.00472860551f}, std::array<float,2>{0.339214444f, 0.432684302f}, std::array<float,2>{0.637912273f, 0.65363282f}, std::array<float,2>{0.407319814f, 0.585199833f}, std::array<float,2>{0.512054145f, 0.373911589f}, std::array<float,2>{0.0245532673f, 0.173795581f}, std::array<float,2>{0.817567408f, 0.873980463f}, std::array<float,2>{0.0707109421f, 0.589537084f}, std::array<float,2>{0.75263387f, 0.365661293f}, std::array<float,2>{0.443258882f, 0.183859751f}, std::array<float,2>{0.603271782f, 0.864814639f}, std::array<float,2>{0.259299874f, 0.904318213f}, std::array<float,2>{0.705763817f, 0.0141745424f}, std::array<float,2>{0.217409655f, 0.425159812f}, std::array<float,2>{0.979303896f, 0.643573463f}, std::array<float,2>{0.139510617f, 0.752537906f}, std::array<float,2>{0.882006586f, 0.203342795f}, std::array<float,2>{0.313374162f, 0.306159317f}, std::array<float,2>{0.648762226f, 0.5600124f}, std::array<float,2>{0.435332894f, 0.733271897f}, std::array<float,2>{0.518381119f, 0.481438994f}, std::array<float,2>{0.000876175123f, 0.107155375f}, std::array<float,2>{0.830813348f, 0.965055525f}, std::array<float,2>{0.244687393f, 0.669053555f}, std::array<float,2>{0.957816601f, 0.400984645f}, std::array<float,2>{0.290286601f, 0.0541703403f}, std::array<float,2>{0.722560585f, 0.907508135f}, std::array<float,2>{0.476323277f, 0.829553187f}, std::array<float,2>{0.56517601f, 0.150192931f}, std::array<float,2>{0.0981135741f, 0.315873981f}, std::array<float,2>{0.790515959f, 0.606771946f}, std::array<float,2>{0.0553709082f, 0.987332582f}, std::array<float,2>{0.870803177f, 0.0700038671f}, std::array<float,2>{0.375744432f, 0.447884291f}, std::array<float,2>{0.553416014f, 0.702136695f}, std::array<float,2>{0.36456129f, 0.526082754f}, std::array<float,2>{0.664991438f, 0.25448069f}, std::array<float,2>{0.161499962f, 0.248147398f}, std::array<float,2>{0.925876439f, 0.784954846f}, std::array<float,2>{0.172861904f, 0.532477975f}, std::array<float,2>{0.916160703f, 0.293566108f}, std::array<float,2>{0.352288961f, 0.191584751f}, std::array<float,2>{0.683897436f, 0.774730563f}, std::array<float,2>{0.40347451f, 0.949964881f}, std::array<float,2>{0.543039978f, 0.121701576f}, std::array<float,2>{0.0421386473f, 0.499241233f}, std::array<float,2>{0.844960988f, 0.743981481f}, std::array<float,2>{0.111631177f, 0.854951203f}, std::array<float,2>{0.80488354f, 0.158176944f}, std::array<float,2>{0.497081369f, 0.351657301f}, std::array<float,2>{0.5891518f, 0.576021433f}, std::array<float,2>{0.303594112f, 0.636645079f}, std::array<float,2>{0.747004032f, 0.415554255f}, std::array<float,2>{0.222339764f, 0.0207127538f}, std::array<float,2>{0.942358732f, 0.88296175f}, std::array<float,2>{0.0295596439f, 0.710987031f}, std::array<float,2>{0.814373434f, 0.459533662f}, std::array<float,2>{0.414018393f, 0.0901623592f}, std::array<float,2>{0.511384487f, 0.969881833f}, std::array<float,2>{0.341183335f, 0.812360764f}, std::array<float,2>{0.63307637f, 0.226752117f}, std::array<float,2>{0.155615419f, 0.266685396f}, std::array<float,2>{0.8943519f, 0.505932629f}, std::array<float,2>{0.191774786f, 0.932559907f}, std::array<float,2>{0.990741968f, 0.0442781821f}, std::array<float,2>{0.268417984f, 0.379379332f}, std::array<float,2>{0.697321236f, 0.672424257f}, std::array<float,2>{0.461256802f, 0.611536384f}, std::array<float,2>{0.611454964f, 0.340052933f}, std::array<float,2>{0.0857411474f, 0.125789896f}, std::array<float,2>{0.76788801f, 0.81391865f}, std::array<float,2>{0.0353208072f, 0.514577389f}, std::array<float,2>{0.855023444f, 0.27363801f}, std::array<float,2>{0.390746653f, 0.221640214f}, std::array<float,2>{0.53344506f, 0.801324129f}, std::array<float,2>{0.347263634f, 0.978546739f}, std::array<float,2>{0.673481643f, 0.0814044997f}, std::array<float,2>{0.181784526f, 0.461249709f}, std::array<float,2>{0.9123106f, 0.707715511f}, std::array<float,2>{0.22799392f, 0.823445678f}, std::array<float,2>{0.949900806f, 0.137593374f}, std::array<float,2>{0.31195271f, 0.33481741f}, std::array<float,2>{0.734434962f, 0.621722281f}, std::array<float,2>{0.489340872f, 0.68002665f}, std::array<float,2>{0.580645859f, 0.38930425f}, std::array<float,2>{0.12402682f, 0.0361901931f}, std::array<float,2>{0.804127514f, 0.923347592f}, std::array<float,2>{0.147235811f, 0.735943198f}, std::array<float,2>{0.901633024f, 0.487424761f}, std::array<float,2>{0.331766009f, 0.110343426f}, std::array<float,2>{0.625136137f, 0.941968203f}, std::array<float,2>{0.415025741f, 0.772698998f}, std::array<float,2>{0.502008259f, 0.200842068f}, std::array<float,2>{0.0167066678f, 0.288055927f}, std::array<float,2>{0.826563895f, 0.539897382f}, std::array<float,2>{0.0910441354f, 0.878775597f}, std::array<float,2>{0.780984879f, 0.0238764603f}, std::array<float,2>{0.459207028f, 0.409226984f}, std::array<float,2>{0.619476378f, 0.62645191f}, std::array<float,2>{0.274901271f, 0.563444853f}, std::array<float,2>{0.694482386f, 0.347150207f}, std::array<float,2>{0.200485349f, 0.170320839f}, std::array<float,2>{0.994796336f, 0.847457409f}, std::array<float,2>{0.206006363f, 0.598017812f}, std::array<float,2>{0.974743724f, 0.325344503f}, std::array<float,2>{0.252887279f, 0.14239651f}, std::array<float,2>{0.713739157f, 0.840276837f}, std::array<float,2>{0.44679442f, 0.914548576f}, std::array<float,2>{0.594140947f, 0.0618686453f}, std::array<float,2>{0.0661114305f, 0.396992475f}, std::array<float,2>{0.759320021f, 0.660102546f}, std::array<float,2>{0.011805471f, 0.792399824f}, std::array<float,2>{0.842217803f, 0.239786729f}, std::array<float,2>{0.424346119f, 0.260721624f}, std::array<float,2>{0.528602302f, 0.520398319f}, std::array<float,2>{0.320540726f, 0.689425945f}, std::array<float,2>{0.645010114f, 0.443374336f}, std::array<float,2>{0.13115637f, 0.0724237338f}, std::array<float,2>{0.890422165f, 0.995862544f}, std::array<float,2>{0.104442328f, 0.652051687f}, std::array<float,2>{0.785148442f, 0.434904069f}, std::array<float,2>{0.481311083f, 0.00226303749f}, std::array<float,2>{0.572509646f, 0.895547628f}, std::array<float,2>{0.286969215f, 0.867610097f}, std::array<float,2>{0.732024908f, 0.175898224f}, std::array<float,2>{0.240894884f, 0.369972885f}, std::array<float,2>{0.965749919f, 0.578632712f}, std::array<float,2>{0.16875875f, 0.956011713f}, std::array<float,2>{0.932938814f, 0.097845979f}, std::array<float,2>{0.372929126f, 0.471914798f}, std::array<float,2>{0.65717274f, 0.726029217f}, std::array<float,2>{0.387456447f, 0.551046789f}, std::array<float,2>{0.560074925f, 0.302925885f}, std::array<float,2>{0.0532687046f, 0.211193353f}, std::array<float,2>{0.863591373f, 0.760772765f}, std::array<float,2>{0.0889160037f, 0.530126393f}, std::array<float,2>{0.773872197f, 0.250641972f}, std::array<float,2>{0.455566108f, 0.244739145f}, std::array<float,2>{0.621816278f, 0.787381768f}, std::array<float,2>{0.278564632f, 0.990876377f}, std::array<float,2>{0.689420044f, 0.0642775297f}, std::array<float,2>{0.197668716f, 0.450457573f}, std::array<float,2>{0.996914089f, 0.697667003f}, std::array<float,2>{0.141648725f, 0.834828854f}, std::array<float,2>{0.905720413f, 0.15576537f}, std::array<float,2>{0.335839242f, 0.32016176f}, std::array<float,2>{0.631977439f, 0.603114784f}, std::array<float,2>{0.420255125f, 0.664365649f}, std::array<float,2>{0.50551635f, 0.404395133f}, std::array<float,2>{0.021921562f, 0.0500371046f}, std::array<float,2>{0.823822379f, 0.913418949f}, std::array<float,2>{0.233094528f, 0.728816807f}, std::array<float,2>{0.945793927f, 0.477944195f}, std::array<float,2>{0.308112502f, 0.1025021f}, std::array<float,2>{0.742071033f, 0.963868916f}, std::array<float,2>{0.485780746f, 0.757625461f}, std::array<float,2>{0.582776725f, 0.210108519f}, std::array<float,2>{0.119509332f, 0.311437935f}, std::array<float,2>{0.800058782f, 0.556483269f}, std::array<float,2>{0.0335814916f, 0.899843693f}, std::array<float,2>{0.856644213f, 0.00900980551f}, std::array<float,2>{0.395840675f, 0.426254988f}, std::array<float,2>{0.538630724f, 0.646036685f}, std::array<float,2>{0.351238877f, 0.592245758f}, std::array<float,2>{0.678872824f, 0.359514475f}, std::array<float,2>{0.18667765f, 0.181753218f}, std::array<float,2>{0.908511877f, 0.860748291f}, std::array<float,2>{0.16450116f, 0.615811348f}, std::array<float,2>{0.937056422f, 0.338157117f}, std::array<float,2>{0.371090055f, 0.128963396f}, std::array<float,2>{0.660652459f, 0.817389369f}, std::array<float,2>{0.386110097f, 0.93745178f}, std::array<float,2>{0.556330562f, 0.0407955721f}, std::array<float,2>{0.0482136048f, 0.376814365f}, std::array<float,2>{0.85965836f, 0.676135957f}, std::array<float,2>{0.107228197f, 0.80511111f}, std::array<float,2>{0.787510037f, 0.233191043f}, std::array<float,2>{0.477014184f, 0.269559145f}, std::array<float,2>{0.576062679f, 0.501110077f}, std::array<float,2>{0.282304436f, 0.718349457f}, std::array<float,2>{0.729803562f, 0.454483926f}, std::array<float,2>{0.236801326f, 0.0897748992f}, std::array<float,2>{0.964134932f, 0.974938333f}, std::array<float,2>{0.0105429916f, 0.638295412f}, std::array<float,2>{0.836034894f, 0.420193225f}, std::array<float,2>{0.426039308f, 0.0158481468f}, std::array<float,2>{0.525417268f, 0.88779521f}, std::array<float,2>{0.326690018f, 0.857062101f}, std::array<float,2>{0.641028583f, 0.160185695f}, std::array<float,2>{0.126430959f, 0.358762324f}, std::array<float,2>{0.88469094f, 0.572539389f}, std::array<float,2>{0.208916575f, 0.946934819f}, std::array<float,2>{0.970518827f, 0.120571084f}, std::array<float,2>{0.254901975f, 0.494789928f}, std::array<float,2>{0.715179801f, 0.748984158f}, std::array<float,2>{0.451416969f, 0.538525939f}, std::array<float,2>{0.601139307f, 0.291983575f}, std::array<float,2>{0.0700478405f, 0.188486829f}, std::array<float,2>{0.762585938f, 0.778987408f}, std::array<float,2>{0.0601796731f, 0.568188429f}, std::array<float,2>{0.874041438f, 0.348663539f}, std::array<float,2>{0.38163358f, 0.167831734f}, std::array<float,2>{0.549722254f, 0.848583162f}, std::array<float,2>{0.361914396f, 0.881632566f}, std::array<float,2>{0.671036601f, 0.0304181408f}, std::array<float,2>{0.159991771f, 0.411239862f}, std::array<float,2>{0.922239065f, 0.630008399f}, std::array<float,2>{0.24801746f, 0.768361747f}, std::array<float,2>{0.956226945f, 0.196011439f}, std::array<float,2>{0.294035107f, 0.282265395f}, std::array<float,2>{0.723449945f, 0.543573976f}, std::array<float,2>{0.468948305f, 0.740201414f}, std::array<float,2>{0.567739666f, 0.489176542f}, std::array<float,2>{0.0953318179f, 0.114516124f}, std::array<float,2>{0.794397831f, 0.939881623f}, std::array<float,2>{0.134011731f, 0.684516132f}, std::array<float,2>{0.878805876f, 0.385231018f}, std::array<float,2>{0.319562018f, 0.0323604904f}, std::array<float,2>{0.655747056f, 0.926619768f}, std::array<float,2>{0.430298477f, 0.82625401f}, std::array<float,2>{0.520360887f, 0.133803442f}, std::array<float,2>{0.00723916618f, 0.328390151f}, std::array<float,2>{0.835041642f, 0.618128598f}, std::array<float,2>{0.0766402707f, 0.981757045f}, std::array<float,2>{0.756409466f, 0.0840356573f}, std::array<float,2>{0.438797176f, 0.466107816f}, std::array<float,2>{0.609019458f, 0.703280985f}, std::array<float,2>{0.264132887f, 0.510492802f}, std::array<float,2>{0.710844755f, 0.279858261f}, std::array<float,2>{0.21446538f, 0.226085022f}, std::array<float,2>{0.983456254f, 0.799861014f}, std::array<float,2>{0.187863111f, 0.55048424f}, std::array<float,2>{0.985546052f, 0.300310791f}, std::array<float,2>{0.270882815f, 0.216053188f}, std::array<float,2>{0.702700615f, 0.764399648f}, std::array<float,2>{0.467862755f, 0.958663821f}, std::array<float,2>{0.616579831f, 0.0966150537f}, std::array<float,2>{0.0784517899f, 0.473806411f}, std::array<float,2>{0.771403849f, 0.720347404f}, std::array<float,2>{0.0271518026f, 0.871384442f}, std::array<float,2>{0.820309818f, 0.17465578f}, std::array<float,2>{0.408809125f, 0.371460497f}, std::array<float,2>{0.515326738f, 0.583430529f}, std::array<float,2>{0.33734566f, 0.656242788f}, std::array<float,2>{0.640064716f, 0.430801272f}, std::array<float,2>{0.149322167f, 0.00683549698f}, std::array<float,2>{0.898020506f, 0.893211186f}, std::array<float,2>{0.114931569f, 0.691502452f}, std::array<float,2>{0.80969137f, 0.440362126f}, std::array<float,2>{0.495515764f, 0.0749699846f}, std::array<float,2>{0.591298044f, 0.999412596f}, std::array<float,2>{0.299328804f, 0.794730127f}, std::array<float,2>{0.744797766f, 0.234635368f}, std::array<float,2>{0.225573555f, 0.262645423f}, std::array<float,2>{0.938011646f, 0.518792987f}, std::array<float,2>{0.179043323f, 0.918870091f}, std::array<float,2>{0.920978487f, 0.0572925545f}, std::array<float,2>{0.359164894f, 0.390770197f}, std::array<float,2>{0.681850135f, 0.662912309f}, std::array<float,2>{0.399986953f, 0.596219063f}, std::array<float,2>{0.53985393f, 0.320599169f}, std::array<float,2>{0.0436205715f, 0.145655975f}, std::array<float,2>{0.850990176f, 0.836073756f}, std::array<float,2>{0.100406535f, 0.609004438f}, std::array<float,2>{0.791622818f, 0.313439399f}, std::array<float,2>{0.473585844f, 0.151626602f}, std::array<float,2>{0.562590182f, 0.830468059f}, std::array<float,2>{0.292624742f, 0.909954071f}, std::array<float,2>{0.719865561f, 0.0510725081f}, std::array<float,2>{0.243216828f, 0.398615897f}, std::array<float,2>{0.959287584f, 0.671209574f}, std::array<float,2>{0.162174582f, 0.782896698f}, std::array<float,2>{0.929009855f, 0.246727884f}, std::array<float,2>{0.365261734f, 0.257312983f}, std::array<float,2>{0.666418135f, 0.524469614f}, std::array<float,2>{0.378603786f, 0.700142205f}, std::array<float,2>{0.551781893f, 0.446589798f}, std::array<float,2>{0.0581386015f, 0.0668258741f}, std::array<float,2>{0.86720717f, 0.985399544f}, std::array<float,2>{0.21545054f, 0.642223954f}, std::array<float,2>{0.97727257f, 0.423004538f}, std::array<float,2>{0.259922296f, 0.0132629341f}, std::array<float,2>{0.70411557f, 0.904227316f}, std::array<float,2>{0.443367124f, 0.866144955f}, std::array<float,2>{0.605429709f, 0.187092453f}, std::array<float,2>{0.0737150535f, 0.364170611f}, std::array<float,2>{0.750852644f, 0.58692807f}, std::array<float,2>{0.0037791708f, 0.967309117f}, std::array<float,2>{0.828938663f, 0.109056629f}, std::array<float,2>{0.437038153f, 0.483766288f}, std::array<float,2>{0.515960991f, 0.730769873f}, std::array<float,2>{0.315646708f, 0.560826361f}, std::array<float,2>{0.65173775f, 0.307279676f}, std::array<float,2>{0.138366565f, 0.205868989f}, std::array<float,2>{0.879454195f, 0.750517905f}, std::array<float,2>{0.154255703f, 0.505712688f}, std::array<float,2>{0.891152263f, 0.268239856f}, std::array<float,2>{0.342056066f, 0.229299277f}, std::array<float,2>{0.636129498f, 0.810350537f}, std::array<float,2>{0.411157221f, 0.97124368f}, std::array<float,2>{0.508912325f, 0.0930019394f}, std::array<float,2>{0.0289167911f, 0.457808763f}, std::array<float,2>{0.814866245f, 0.713900506f}, std::array<float,2>{0.0836545676f, 0.815626264f}, std::array<float,2>{0.766555667f, 0.128604025f}, std::array<float,2>{0.463140875f, 0.342760891f}, std::array<float,2>{0.611187398f, 0.611013532f}, std::array<float,2>{0.266936421f, 0.675457716f}, std::array<float,2>{0.696288109f, 0.382084876f}, std::array<float,2>{0.194654465f, 0.0452741683f}, std::array<float,2>{0.988629222f, 0.930272341f}, std::array<float,2>{0.0408555716f, 0.744330406f}, std::array<float,2>{0.846161604f, 0.497569352f}, std::array<float,2>{0.405919731f, 0.123583131f}, std::array<float,2>{0.545597136f, 0.952843726f}, std::array<float,2>{0.355195343f, 0.775819421f}, std::array<float,2>{0.685777783f, 0.194075331f}, std::array<float,2>{0.174380273f, 0.296701461f}, std::array<float,2>{0.914806485f, 0.533829391f}, std::array<float,2>{0.219651282f, 0.884816885f}, std::array<float,2>{0.943811297f, 0.0219052173f}, std::array<float,2>{0.302055299f, 0.417057067f}, std::array<float,2>{0.749846697f, 0.634173393f}, std::array<float,2>{0.498546839f, 0.57636869f}, std::array<float,2>{0.586909711f, 0.354293913f}, std::array<float,2>{0.109663628f, 0.159027636f}, std::array<float,2>{0.806830108f, 0.853020847f}, std::array<float,2>{0.017854603f, 0.542151153f}, std::array<float,2>{0.824298739f, 0.286911994f}, std::array<float,2>{0.417445481f, 0.202358618f}, std::array<float,2>{0.50090152f, 0.770981789f}, std::array<float,2>{0.329382658f, 0.94461f}, std::array<float,2>{0.628605545f, 0.11217048f}, std::array<float,2>{0.145964369f, 0.484793395f}, std::array<float,2>{0.899553001f, 0.736412466f}, std::array<float,2>{0.201787114f, 0.844539285f}, std::array<float,2>{0.993627369f, 0.169176847f}, std::array<float,2>{0.276944697f, 0.344692945f}, std::array<float,2>{0.692106128f, 0.56621021f}, std::array<float,2>{0.458509177f, 0.627879977f}, std::array<float,2>{0.6189605f, 0.407927692f}, std::array<float,2>{0.0935694873f, 0.0260834713f}, std::array<float,2>{0.777739286f, 0.876267791f}, std::array<float,2>{0.180379659f, 0.709954202f}, std::array<float,2>{0.911524177f, 0.463337153f}, std::array<float,2>{0.343972832f, 0.0797938854f}, std::array<float,2>{0.675042927f, 0.976800382f}, std::array<float,2>{0.392763793f, 0.803967714f}, std::array<float,2>{0.532597065f, 0.219943181f}, std::array<float,2>{0.0372592881f, 0.277030975f}, std::array<float,2>{0.852479935f, 0.512580276f}, std::array<float,2>{0.121465631f, 0.925377965f}, std::array<float,2>{0.802243471f, 0.0387891717f}, std::array<float,2>{0.490956515f, 0.387296408f}, std::array<float,2>{0.578816056f, 0.6822294f}, std::array<float,2>{0.309733748f, 0.62367332f}, std::array<float,2>{0.738226235f, 0.332575917f}, std::array<float,2>{0.228877798f, 0.139471486f}, std::array<float,2>{0.952008545f, 0.821418226f}, std::array<float,2>{0.238415822f, 0.581842005f}, std::array<float,2>{0.967112422f, 0.368029177f}, std::array<float,2>{0.288861006f, 0.178576067f}, std::array<float,2>{0.734085381f, 0.870225668f}, std::array<float,2>{0.483927757f, 0.897074163f}, std::array<float,2>{0.572161198f, 0.000589815318f}, std::array<float,2>{0.102577083f, 0.437095255f}, std::array<float,2>{0.781569421f, 0.649006844f}, std::array<float,2>{0.0519947186f, 0.758900225f}, std::array<float,2>{0.867175698f, 0.21395722f}, std::array<float,2>{0.390523493f, 0.301249772f}, std::array<float,2>{0.560911357f, 0.554500043f}, std::array<float,2>{0.374971986f, 0.722694337f}, std::array<float,2>{0.658548832f, 0.470183402f}, std::array<float,2>{0.171263769f, 0.100181445f}, std::array<float,2>{0.930542707f, 0.954680443f}, std::array<float,2>{0.0625799298f, 0.656255722f}, std::array<float,2>{0.760968745f, 0.395356029f}, std::array<float,2>{0.448165029f, 0.0602491498f}, std::array<float,2>{0.597357452f, 0.916889131f}, std::array<float,2>{0.250389069f, 0.843037724f}, std::array<float,2>{0.712813139f, 0.143103421f}, std::array<float,2>{0.203873247f, 0.327553421f}, std::array<float,2>{0.973148763f, 0.600557029f}, std::array<float,2>{0.129066318f, 0.99409306f}, std::array<float,2>{0.888304949f, 0.072040461f}, std::array<float,2>{0.323906571f, 0.442095846f}, std::array<float,2>{0.646665871f, 0.690836668f}, std::array<float,2>{0.422696382f, 0.521992683f}, std::array<float,2>{0.530533075f, 0.257817745f}, std::array<float,2>{0.0151216397f, 0.241377398f}, std::array<float,2>{0.84071058f, 0.79096508f}, std::array<float,2>{0.0683935508f, 0.53545171f}, std::array<float,2>{0.763220906f, 0.290883392f}, std::array<float,2>{0.452319056f, 0.190653414f}, std::array<float,2>{0.600037098f, 0.780461729f}, std::array<float,2>{0.254131615f, 0.947923601f}, std::array<float,2>{0.715886891f, 0.11894875f}, std::array<float,2>{0.207325295f, 0.493053645f}, std::array<float,2>{0.969082773f, 0.746213138f}, std::array<float,2>{0.125090092f, 0.85881716f}, std::array<float,2>{0.883394718f, 0.162301078f}, std::array<float,2>{0.327570558f, 0.356092691f}, std::array<float,2>{0.642260373f, 0.571969986f}, std::array<float,2>{0.427391738f, 0.639632761f}, std::array<float,2>{0.526399851f, 0.418547034f}, std::array<float,2>{0.0108233606f, 0.0186441224f}, std::array<float,2>{0.837446451f, 0.889341354f}, std::array<float,2>{0.237864494f, 0.715778947f}, std::array<float,2>{0.963340342f, 0.45539844f}, std::array<float,2>{0.281720728f, 0.0876900479f}, std::array<float,2>{0.728909731f, 0.97407639f}, std::array<float,2>{0.477898598f, 0.806987286f}, std::array<float,2>{0.575083435f, 0.231269181f}, std::array<float,2>{0.105709791f, 0.271585226f}, std::array<float,2>{0.788434684f, 0.503159165f}, std::array<float,2>{0.0477276221f, 0.935029984f}, std::array<float,2>{0.860739827f, 0.0419767313f}, std::array<float,2>{0.384932399f, 0.378258348f}, std::array<float,2>{0.555424333f, 0.678054214f}, std::array<float,2>{0.369761109f, 0.614735305f}, std::array<float,2>{0.661330462f, 0.3360762f}, std::array<float,2>{0.165458888f, 0.132144928f}, std::array<float,2>{0.935877681f, 0.819469929f}, std::array<float,2>{0.186264515f, 0.5900594f}, std::array<float,2>{0.90940541f, 0.363140076f}, std::array<float,2>{0.349705756f, 0.181473657f}, std::array<float,2>{0.677758574f, 0.862214744f}, std::array<float,2>{0.394828111f, 0.901396155f}, std::array<float,2>{0.537778199f, 0.0108128991f}, std::array<float,2>{0.0346403085f, 0.429346621f}, std::array<float,2>{0.856299162f, 0.647371471f}, std::array<float,2>{0.120604843f, 0.754446507f}, std::array<float,2>{0.799389243f, 0.208922163f}, std::array<float,2>{0.485245019f, 0.309954196f}, std::array<float,2>{0.583061039f, 0.557257175f}, std::array<float,2>{0.307239801f, 0.726924717f}, std::array<float,2>{0.740631759f, 0.479545802f}, std::array<float,2>{0.23359102f, 0.10369914f}, std::array<float,2>{0.947234809f, 0.961762667f}, std::array<float,2>{0.0230021067f, 0.667494833f}, std::array<float,2>{0.822511196f, 0.403310686f}, std::array<float,2>{0.420931399f, 0.0478906147f}, std::array<float,2>{0.50398767f, 0.910965681f}, std::array<float,2>{0.334665358f, 0.832903862f}, std::array<float,2>{0.630965114f, 0.153926998f}, std::array<float,2>{0.141331851f, 0.317389727f}, std::array<float,2>{0.904776335f, 0.60380429f}, std::array<float,2>{0.198548108f, 0.988291264f}, std::array<float,2>{0.997662008f, 0.0663233101f}, std::array<float,2>{0.277492136f, 0.451394767f}, std::array<float,2>{0.688163221f, 0.696239769f}, std::array<float,2>{0.456440598f, 0.528306127f}, std::array<float,2>{0.622277558f, 0.253791392f}, std::array<float,2>{0.0882265791f, 0.24221094f}, std::array<float,2>{0.774544239f, 0.786943614f}, std::array<float,2>{0.044700902f, 0.595094442f}, std::array<float,2>{0.850092471f, 0.323750466f}, std::array<float,2>{0.398890257f, 0.147910103f}, std::array<float,2>{0.540789247f, 0.839516938f}, std::array<float,2>{0.357905507f, 0.9205845f}, std::array<float,2>{0.683399618f, 0.0550388098f}, std::array<float,2>{0.17816852f, 0.392880172f}, std::array<float,2>{0.920874476f, 0.661221921f}, std::array<float,2>{0.225632161f, 0.796301961f}, std::array<float,2>{0.93890518f, 0.236845419f}, std::array<float,2>{0.300569236f, 0.264451712f}, std::array<float,2>{0.745993137f, 0.516631424f}, std::array<float,2>{0.494870305f, 0.693652451f}, std::array<float,2>{0.590239584f, 0.439414859f}, std::array<float,2>{0.113340907f, 0.0773026943f}, std::array<float,2>{0.809461594f, 0.99627322f}, std::array<float,2>{0.149813667f, 0.652507901f}, std::array<float,2>{0.897419751f, 0.43166402f}, std::array<float,2>{0.336344302f, 0.00515198288f}, std::array<float,2>{0.63958782f, 0.892407358f}, std::array<float,2>{0.410038829f, 0.874974191f}, std::array<float,2>{0.514234781f, 0.172822863f}, std::array<float,2>{0.0257741101f, 0.374307036f}, std::array<float,2>{0.818422377f, 0.584616363f}, std::array<float,2>{0.0799783841f, 0.96032685f}, std::array<float,2>{0.769719958f, 0.0949082822f}, std::array<float,2>{0.467502952f, 0.474794805f}, std::array<float,2>{0.61528784f, 0.720975578f}, std::array<float,2>{0.270264804f, 0.548483253f}, std::array<float,2>{0.701376736f, 0.297173023f}, std::array<float,2>{0.189163893f, 0.216993317f}, std::array<float,2>{0.9849208f, 0.763257504f}, std::array<float,2>{0.213764921f, 0.508619905f}, std::array<float,2>{0.982465148f, 0.277839661f}, std::array<float,2>{0.264691889f, 0.223393604f}, std::array<float,2>{0.709466159f, 0.798211277f}, std::array<float,2>{0.438261062f, 0.984310567f}, std::array<float,2>{0.607601702f, 0.0828836262f}, std::array<float,2>{0.0775549784f, 0.468123764f}, std::array<float,2>{0.756995082f, 0.706857622f}, std::array<float,2>{0.00594387203f, 0.82529819f}, std::array<float,2>{0.834519386f, 0.136456102f}, std::array<float,2>{0.430852801f, 0.331128389f}, std::array<float,2>{0.52088058f, 0.620731592f}, std::array<float,2>{0.319198549f, 0.686694741f}, std::array<float,2>{0.65455091f, 0.383184761f}, std::array<float,2>{0.13305518f, 0.0332789272f}, std::array<float,2>{0.877672613f, 0.929396808f}, std::array<float,2>{0.0940089226f, 0.74059397f}, std::array<float,2>{0.79306221f, 0.491288185f}, std::array<float,2>{0.47031492f, 0.115493134f}, std::array<float,2>{0.567103684f, 0.938381672f}, std::array<float,2>{0.29333666f, 0.765666366f}, std::array<float,2>{0.723812699f, 0.198494166f}, std::array<float,2>{0.246621192f, 0.284891367f}, std::array<float,2>{0.955512702f, 0.546574831f}, std::array<float,2>{0.158523276f, 0.880673528f}, std::array<float,2>{0.923437119f, 0.029093286f}, std::array<float,2>{0.362662584f, 0.413173318f}, std::array<float,2>{0.670042396f, 0.632543623f}, std::array<float,2>{0.382608503f, 0.569996595f}, std::array<float,2>{0.549859285f, 0.351534307f}, std::array<float,2>{0.0594727993f, 0.165147215f}, std::array<float,2>{0.873885989f, 0.850006521f}, std::array<float,2>{0.110911623f, 0.574823022f}, std::array<float,2>{0.808361471f, 0.35284552f}, std::array<float,2>{0.499857575f, 0.156386971f}, std::array<float,2>{0.587537646f, 0.85436523f}, std::array<float,2>{0.301173925f, 0.884424984f}, std::array<float,2>{0.748609483f, 0.0196408331f}, std::array<float,2>{0.220557287f, 0.41476509f}, std::array<float,2>{0.94494307f, 0.63535279f}, std::array<float,2>{0.174998417f, 0.774395406f}, std::array<float,2>{0.915479243f, 0.193084955f}, std::array<float,2>{0.354430407f, 0.294271111f}, std::array<float,2>{0.686769485f, 0.531956732f}, std::array<float,2>{0.40450868f, 0.742191017f}, std::array<float,2>{0.54596132f, 0.498422444f}, std::array<float,2>{0.0392739996f, 0.122465104f}, std::array<float,2>{0.847212315f, 0.950323761f}, std::array<float,2>{0.194140613f, 0.673482955f}, std::array<float,2>{0.989537776f, 0.380052894f}, std::array<float,2>{0.265732169f, 0.0437341854f}, std::array<float,2>{0.696371496f, 0.933564126f}, std::array<float,2>{0.464480639f, 0.81341207f}, std::array<float,2>{0.610069573f, 0.126671806f}, std::array<float,2>{0.0820835605f, 0.340858042f}, std::array<float,2>{0.767487586f, 0.612581193f}, std::array<float,2>{0.0276239831f, 0.969041169f}, std::array<float,2>{0.815898657f, 0.0909880623f}, std::array<float,2>{0.410330951f, 0.460060507f}, std::array<float,2>{0.508703947f, 0.712128162f}, std::array<float,2>{0.343523473f, 0.506872237f}, std::array<float,2>{0.635674059f, 0.266564578f}, std::array<float,2>{0.152798146f, 0.228278026f}, std::array<float,2>{0.892273843f, 0.811047375f}, std::array<float,2>{0.136814952f, 0.55922997f}, std::array<float,2>{0.880768955f, 0.305392385f}, std::array<float,2>{0.315075099f, 0.204995453f}, std::array<float,2>{0.650758922f, 0.753198564f}, std::array<float,2>{0.436214626f, 0.966472566f}, std::array<float,2>{0.516845703f, 0.105913676f}, std::array<float,2>{0.00250559486f, 0.481919378f}, std::array<float,2>{0.830011606f, 0.733903527f}, std::array<float,2>{0.0723306388f, 0.863998055f}, std::array<float,2>{0.75101316f, 0.185539797f}, std::array<float,2>{0.444442034f, 0.367173463f}, std::array<float,2>{0.603560269f, 0.588187218f}, std::array<float,2>{0.261449575f, 0.643209994f}, std::array<float,2>{0.703476012f, 0.424021125f}, std::array<float,2>{0.216359228f, 0.0151706636f}, std::array<float,2>{0.977895677f, 0.906022131f}, std::array<float,2>{0.0573097169f, 0.702911556f}, std::array<float,2>{0.868872702f, 0.448492199f}, std::array<float,2>{0.377815813f, 0.0685234368f}, std::array<float,2>{0.551518619f, 0.98636061f}, std::array<float,2>{0.366321713f, 0.783400238f}, std::array<float,2>{0.667601585f, 0.249706745f}, std::array<float,2>{0.163338855f, 0.254993469f}, std::array<float,2>{0.927765906f, 0.526407897f}, std::array<float,2>{0.242237657f, 0.906945527f}, std::array<float,2>{0.960301518f, 0.0528488047f}, std::array<float,2>{0.291182071f, 0.402282834f}, std::array<float,2>{0.719579279f, 0.668604553f}, std::array<float,2>{0.474493325f, 0.605920196f}, std::array<float,2>{0.56379813f, 0.315387905f}, std::array<float,2>{0.101387136f, 0.148579642f}, std::array<float,2>{0.792795599f, 0.828765512f}, std::array<float,2>{0.0137416236f, 0.521376371f}, std::array<float,2>{0.841197968f, 0.261429161f}, std::array<float,2>{0.42312175f, 0.238852084f}, std::array<float,2>{0.529510617f, 0.791730583f}, std::array<float,2>{0.322868615f, 0.995114386f}, std::array<float,2>{0.648430228f, 0.0739002153f}, std::array<float,2>{0.130355552f, 0.444394082f}, std::array<float,2>{0.887502491f, 0.687911272f}, std::array<float,2>{0.20417051f, 0.841584802f}, std::array<float,2>{0.974597573f, 0.1411338f}, std::array<float,2>{0.251606375f, 0.324970126f}, std::array<float,2>{0.711793184f, 0.599435806f}, std::array<float,2>{0.448962629f, 0.658703804f}, std::array<float,2>{0.595949113f, 0.398020029f}, std::array<float,2>{0.0642035604f, 0.0606493875f}, std::array<float,2>{0.760644555f, 0.915819407f}, std::array<float,2>{0.170503974f, 0.725194931f}, std::array<float,2>{0.931265771f, 0.471227556f}, std::array<float,2>{0.374003708f, 0.099385336f}, std::array<float,2>{0.659322441f, 0.956652284f}, std::array<float,2>{0.389291734f, 0.760012925f}, std::array<float,2>{0.562223375f, 0.212537229f}, std::array<float,2>{0.0515759401f, 0.304303199f}, std::array<float,2>{0.865658939f, 0.552638233f}, std::array<float,2>{0.102141485f, 0.894708872f}, std::array<float,2>{0.783016801f, 0.00336875627f}, std::array<float,2>{0.482614785f, 0.433719426f}, std::array<float,2>{0.570618987f, 0.650841415f}, std::array<float,2>{0.287211925f, 0.580066919f}, std::array<float,2>{0.73271817f, 0.370888263f}, std::array<float,2>{0.23937954f, 0.177306786f}, std::array<float,2>{0.968438923f, 0.868835986f}, std::array<float,2>{0.230189309f, 0.622481942f}, std::array<float,2>{0.952352464f, 0.335369349f}, std::array<float,2>{0.30920437f, 0.138062894f}, std::array<float,2>{0.736777186f, 0.822853863f}, std::array<float,2>{0.492170662f, 0.922496736f}, std::array<float,2>{0.579145372f, 0.0358532555f}, std::array<float,2>{0.122950613f, 0.38988483f}, std::array<float,2>{0.801085234f, 0.681622446f}, std::array<float,2>{0.0386912972f, 0.802390158f}, std::array<float,2>{0.852628052f, 0.22218734f}, std::array<float,2>{0.393849432f, 0.275064915f}, std::array<float,2>{0.532082915f, 0.51499337f}, std::array<float,2>{0.345077813f, 0.708407104f}, std::array<float,2>{0.674015403f, 0.461974978f}, std::array<float,2>{0.180776611f, 0.0805296004f}, std::array<float,2>{0.910325587f, 0.979894638f}, std::array<float,2>{0.0923105925f, 0.625571489f}, std::array<float,2>{0.779034257f, 0.409018725f}, std::array<float,2>{0.457982093f, 0.024502147f}, std::array<float,2>{0.617981613f, 0.877356887f}, std::array<float,2>{0.276085466f, 0.846030891f}, std::array<float,2>{0.692944229f, 0.171587169f}, std::array<float,2>{0.202456102f, 0.345984846f}, std::array<float,2>{0.992499053f, 0.563789546f}, std::array<float,2>{0.144554332f, 0.942640066f}, std::array<float,2>{0.899214208f, 0.110749446f}, std::array<float,2>{0.328962207f, 0.486688226f}, std::array<float,2>{0.627084792f, 0.734575808f}, std::array<float,2>{0.416405618f, 0.540462375f}, std::array<float,2>{0.501409411f, 0.288532168f}, std::array<float,2>{0.018628208f, 0.200124577f}, std::array<float,2>{0.826140344f, 0.771637857f}, std::array<float,2>{0.107544117f, 0.500012815f}, std::array<float,2>{0.785691381f, 0.270630777f}, std::array<float,2>{0.479561359f, 0.234314412f}, std::array<float,2>{0.576717019f, 0.806395173f}, std::array<float,2>{0.283649027f, 0.976513743f}, std::array<float,2>{0.72843045f, 0.0881419405f}, std::array<float,2>{0.234901309f, 0.453349113f}, std::array<float,2>{0.962132454f, 0.717431009f}, std::array<float,2>{0.166346058f, 0.816843271f}, std::array<float,2>{0.934343696f, 0.130541876f}, std::array<float,2>{0.367341727f, 0.33948949f}, std::array<float,2>{0.662174582f, 0.616515338f}, std::array<float,2>{0.383518845f, 0.676902175f}, std::array<float,2>{0.556897223f, 0.375968546f}, std::array<float,2>{0.048890803f, 0.0398992561f}, std::array<float,2>{0.862653077f, 0.936376035f}, std::array<float,2>{0.210453749f, 0.749241352f}, std::array<float,2>{0.972001672f, 0.495941877f}, std::array<float,2>{0.257304311f, 0.120021604f}, std::array<float,2>{0.717404664f, 0.945824802f}, std::array<float,2>{0.449353188f, 0.77787292f}, std::array<float,2>{0.599329352f, 0.187896803f}, std::array<float,2>{0.0665905401f, 0.292905688f}, std::array<float,2>{0.765499473f, 0.537135601f}, std::array<float,2>{0.0091058109f, 0.887092531f}, std::array<float,2>{0.839292109f, 0.0169123374f}, std::array<float,2>{0.429022998f, 0.421340734f}, std::array<float,2>{0.525172293f, 0.637384474f}, std::array<float,2>{0.325201005f, 0.574029922f}, std::array<float,2>{0.644215047f, 0.357456028f}, std::array<float,2>{0.128528565f, 0.161764592f}, std::array<float,2>{0.885169983f, 0.855760336f}, std::array<float,2>{0.144445628f, 0.602072835f}, std::array<float,2>{0.903838158f, 0.319139987f}, std::array<float,2>{0.333595365f, 0.154297531f}, std::array<float,2>{0.630320787f, 0.835867643f}, std::array<float,2>{0.41802457f, 0.912399292f}, std::array<float,2>{0.50772661f, 0.0490399562f}, std::array<float,2>{0.0212962423f, 0.405969918f}, std::array<float,2>{0.821352839f, 0.665779233f}, std::array<float,2>{0.0863645002f, 0.78818959f}, std::array<float,2>{0.776105583f, 0.245573804f}, std::array<float,2>{0.454477757f, 0.251314312f}, std::array<float,2>{0.623328626f, 0.530399799f}, std::array<float,2>{0.280541271f, 0.69908303f}, std::array<float,2>{0.69010061f, 0.449472338f}, std::array<float,2>{0.196755216f, 0.0631302148f}, std::array<float,2>{0.998133659f, 0.991467834f}, std::array<float,2>{0.0324725211f, 0.645031393f}, std::array<float,2>{0.857741356f, 0.427208602f}, std::array<float,2>{0.397918314f, 0.00800138898f}, std::array<float,2>{0.535797179f, 0.8987059f}, std::array<float,2>{0.348514348f, 0.859847665f}, std::array<float,2>{0.676011384f, 0.18318972f}, std::array<float,2>{0.184407651f, 0.360527426f}, std::array<float,2>{0.90763104f, 0.593129456f}, std::array<float,2>{0.23230812f, 0.963354766f}, std::array<float,2>{0.94819665f, 0.103121862f}, std::array<float,2>{0.306031436f, 0.477054924f}, std::array<float,2>{0.739968598f, 0.729981601f}, std::array<float,2>{0.487488151f, 0.555335343f}, std::array<float,2>{0.585257709f, 0.311827064f}, std::array<float,2>{0.117922291f, 0.209366173f}, std::array<float,2>{0.797354996f, 0.755966842f}, std::array<float,2>{0.0243917108f, 0.582924187f}, std::array<float,2>{0.817296505f, 0.372095942f}, std::array<float,2>{0.406252593f, 0.175503924f}, std::array<float,2>{0.512723684f, 0.872775316f}, std::array<float,2>{0.338167638f, 0.894227743f}, std::array<float,2>{0.637668431f, 0.0077935853f}, std::array<float,2>{0.150615811f, 0.430585563f}, std::array<float,2>{0.894859076f, 0.655004084f}, std::array<float,2>{0.190071583f, 0.765209913f}, std::array<float,2>{0.986778796f, 0.215221778f}, std::array<float,2>{0.272388667f, 0.298950344f}, std::array<float,2>{0.701020062f, 0.549149632f}, std::array<float,2>{0.465745687f, 0.719090343f}, std::array<float,2>{0.61473f, 0.472718924f}, std::array<float,2>{0.0813188106f, 0.0970820636f}, std::array<float,2>{0.773186266f, 0.957499921f}, std::array<float,2>{0.177029803f, 0.663986206f}, std::array<float,2>{0.918873668f, 0.392251015f}, std::array<float,2>{0.355724275f, 0.0584641621f}, std::array<float,2>{0.680660546f, 0.919267952f}, std::array<float,2>{0.401115835f, 0.837344468f}, std::array<float,2>{0.541646779f, 0.14508073f}, std::array<float,2>{0.0456769615f, 0.321658254f}, std::array<float,2>{0.848318696f, 0.596846759f}, std::array<float,2>{0.11529056f, 0.998820543f}, std::array<float,2>{0.812483668f, 0.0755010322f}, std::array<float,2>{0.493198842f, 0.440461874f}, std::array<float,2>{0.59237349f, 0.693055332f}, std::array<float,2>{0.298643112f, 0.518508255f}, std::array<float,2>{0.743749321f, 0.262912184f}, std::array<float,2>{0.223159835f, 0.235446841f}, std::array<float,2>{0.940244079f, 0.793221772f}, std::array<float,2>{0.248221323f, 0.544324994f}, std::array<float,2>{0.954708815f, 0.281942159f}, std::array<float,2>{0.29669252f, 0.196839526f}, std::array<float,2>{0.725072026f, 0.768767238f}, std::array<float,2>{0.471098572f, 0.941053748f}, std::array<float,2>{0.568481207f, 0.114143439f}, std::array<float,2>{0.0959156901f, 0.489563406f}, std::array<float,2>{0.795358837f, 0.738565922f}, std::array<float,2>{0.0609688014f, 0.849021435f}, std::array<float,2>{0.872446775f, 0.166512728f}, std::array<float,2>{0.380417645f, 0.348262548f}, std::array<float,2>{0.548085272f, 0.566508889f}, std::array<float,2>{0.359588176f, 0.629252911f}, std::array<float,2>{0.668836117f, 0.410239428f}, std::array<float,2>{0.156761199f, 0.0293152872f}, std::array<float,2>{0.925054669f, 0.882697761f}, std::array<float,2>{0.0756958574f, 0.704520524f}, std::array<float,2>{0.754222929f, 0.465259731f}, std::array<float,2>{0.440055877f, 0.0850654915f}, std::array<float,2>{0.605977714f, 0.981158972f}, std::array<float,2>{0.262988359f, 0.799441159f}, std::array<float,2>{0.708809197f, 0.225399405f}, std::array<float,2>{0.212281078f, 0.280510396f}, std::array<float,2>{0.981451154f, 0.511227906f}, std::array<float,2>{0.135411203f, 0.926903725f}, std::array<float,2>{0.876933217f, 0.0320749916f}, std::array<float,2>{0.317772388f, 0.386497587f}, std::array<float,2>{0.653867722f, 0.685271859f}, std::array<float,2>{0.432957798f, 0.618890345f}, std::array<float,2>{0.522967935f, 0.32967025f}, std::array<float,2>{0.00470855879f, 0.133143216f}, std::array<float,2>{0.832781911f, 0.827373087f}, std::array<float,2>{0.084224619f, 0.60947752f}, std::array<float,2>{0.769446969f, 0.342994511f}, std::array<float,2>{0.462316215f, 0.127613783f}, std::array<float,2>{0.612722993f, 0.815378189f}, std::array<float,2>{0.269301683f, 0.931128085f}, std::array<float,2>{0.698368073f, 0.0463498645f}, std::array<float,2>{0.19273454f, 0.381002814f}, std::array<float,2>{0.992079139f, 0.674562037f}, std::array<float,2>{0.155130371f, 0.809396982f}, std::array<float,2>{0.892729402f, 0.229858562f}, std::array<float,2>{0.340342849f, 0.269354939f}, std::array<float,2>{0.633909404f, 0.50475347f}, std::array<float,2>{0.412386119f, 0.713740528f}, std::array<float,2>{0.510134459f, 0.458329499f}, std::array<float,2>{0.0308969077f, 0.0921104848f}, std::array<float,2>{0.812642634f, 0.971692443f}, std::array<float,2>{0.221584886f, 0.63350755f}, std::array<float,2>{0.942419291f, 0.416699648f}, std::array<float,2>{0.304135084f, 0.0228887349f}, std::array<float,2>{0.747654855f, 0.886180937f}, std::array<float,2>{0.496646136f, 0.851823509f}, std::array<float,2>{0.588417649f, 0.15999046f}, std::array<float,2>{0.112970538f, 0.354645938f}, std::array<float,2>{0.805890858f, 0.577570438f}, std::array<float,2>{0.0412066169f, 0.951639354f}, std::array<float,2>{0.844591856f, 0.124627352f}, std::array<float,2>{0.402606726f, 0.496125519f}, std::array<float,2>{0.544025302f, 0.745821834f}, std::array<float,2>{0.352693081f, 0.534286678f}, std::array<float,2>{0.684644341f, 0.295301914f}, std::array<float,2>{0.172628447f, 0.194948271f}, std::array<float,2>{0.917643487f, 0.776971698f}, std::array<float,2>{0.160927579f, 0.524077356f}, std::array<float,2>{0.927146018f, 0.256138742f}, std::array<float,2>{0.363401979f, 0.247495592f}, std::array<float,2>{0.665363848f, 0.78174603f}, std::array<float,2>{0.376784831f, 0.985178173f}, std::array<float,2>{0.554494441f, 0.0676990673f}, std::array<float,2>{0.0565915518f, 0.445495099f}, std::array<float,2>{0.86924845f, 0.700853705f}, std::array<float,2>{0.0987498313f, 0.831156194f}, std::array<float,2>{0.789435565f, 0.150763988f}, std::array<float,2>{0.474700868f, 0.314234644f}, std::array<float,2>{0.565823197f, 0.607927024f}, std::array<float,2>{0.289371789f, 0.669927657f}, std::array<float,2>{0.721218109f, 0.399891317f}, std::array<float,2>{0.246076539f, 0.0519643538f}, std::array<float,2>{0.958388865f, 0.909042597f}, std::array<float,2>{0.00100329425f, 0.732065976f}, std::array<float,2>{0.831445038f, 0.482485503f}, std::array<float,2>{0.434151024f, 0.108204879f}, std::array<float,2>{0.519017816f, 0.968371034f}, std::array<float,2>{0.31429714f, 0.75115031f}, std::array<float,2>{0.650010407f, 0.206633598f}, std::array<float,2>{0.140338436f, 0.308415025f}, std::array<float,2>{0.881742239f, 0.562048316f}, std::array<float,2>{0.217864066f, 0.903105736f}, std::array<float,2>{0.980360687f, 0.0122398138f}, std::array<float,2>{0.258454442f, 0.422735333f}, std::array<float,2>{0.706485093f, 0.641233087f}, std::array<float,2>{0.441991568f, 0.586212039f}, std::array<float,2>{0.602350175f, 0.364543021f}, std::array<float,2>{0.0721243545f, 0.186181888f}, std::array<float,2>{0.753805101f, 0.866624653f}, std::array<float,2>{0.0540805571f, 0.553075135f}, std::array<float,2>{0.864974499f, 0.30259794f}, std::array<float,2>{0.388219982f, 0.213356152f}, std::array<float,2>{0.559309542f, 0.758364856f}, std::array<float,2>{0.371679187f, 0.953837454f}, std::array<float,2>{0.657346606f, 0.101298258f}, std::array<float,2>{0.169443667f, 0.468756795f}, std::array<float,2>{0.932368755f, 0.724421382f}, std::array<float,2>{0.241837248f, 0.87010628f}, std::array<float,2>{0.966237187f, 0.178876907f}, std::array<float,2>{0.285459906f, 0.368593425f}, std::array<float,2>{0.730483294f, 0.580842674f}, std::array<float,2>{0.481901407f, 0.650009215f}, std::array<float,2>{0.573446155f, 0.436420679f}, std::array<float,2>{0.104944155f, 0.00173707574f}, std::array<float,2>{0.784089565f, 0.897553146f}, std::array<float,2>{0.132761851f, 0.689740062f}, std::array<float,2>{0.889149725f, 0.442640692f}, std::array<float,2>{0.32216996f, 0.0703726113f}, std::array<float,2>{0.645680845f, 0.992509723f}, std::array<float,2>{0.42542696f, 0.789207399f}, std::array<float,2>{0.528308451f, 0.240700111f}, std::array<float,2>{0.0130688613f, 0.259471595f}, std::array<float,2>{0.843189776f, 0.522624135f}, std::array<float,2>{0.0644846186f, 0.917258143f}, std::array<float,2>{0.758393049f, 0.0593495592f}, std::array<float,2>{0.446117014f, 0.396072298f}, std::array<float,2>{0.594832838f, 0.657885253f}, std::array<float,2>{0.253353f, 0.601011872f}, std::array<float,2>{0.714739799f, 0.32650131f}, std::array<float,2>{0.206390694f, 0.143785164f}, std::array<float,2>{0.975929141f, 0.842068851f}, std::array<float,2>{0.200066343f, 0.564899743f}, std::array<float,2>{0.996031344f, 0.345384091f}, std::array<float,2>{0.273690939f, 0.168716013f}, std::array<float,2>{0.694218397f, 0.845405936f}, std::array<float,2>{0.460347861f, 0.875000238f}, std::array<float,2>{0.620598733f, 0.0269873515f}, std::array<float,2>{0.090447247f, 0.406473249f}, std::array<float,2>{0.779569149f, 0.628765106f}, std::array<float,2>{0.0157574173f, 0.770212054f}, std::array<float,2>{0.827542722f, 0.201538041f}, std::array<float,2>{0.415646136f, 0.286081165f}, std::array<float,2>{0.503779709f, 0.541324258f}, std::array<float,2>{0.330309451f, 0.737533808f}, std::array<float,2>{0.626386702f, 0.486145288f}, std::array<float,2>{0.148273647f, 0.112523861f}, std::array<float,2>{0.900876403f, 0.943914711f}, std::array<float,2>{0.12391673f, 0.683242857f}, std::array<float,2>{0.803700745f, 0.388391942f}, std::array<float,2>{0.488996595f, 0.0371602513f}, std::array<float,2>{0.581168056f, 0.924523592f}, std::array<float,2>{0.311406374f, 0.821218252f}, std::array<float,2>{0.7360515f, 0.140150726f}, std::array<float,2>{0.22742638f, 0.333167017f}, std::array<float,2>{0.950814784f, 0.624290645f}, std::array<float,2>{0.183352098f, 0.978488624f}, std::array<float,2>{0.913543344f, 0.0785851851f}, std::array<float,2>{0.346571386f, 0.464780301f}, std::array<float,2>{0.671967745f, 0.710209489f}, std::array<float,2>{0.391732007f, 0.513469815f}, std::array<float,2>{0.534309387f, 0.275713146f}, std::array<float,2>{0.03647523f, 0.219221383f}, std::array<float,2>{0.853993297f, 0.803495765f}, std::array<float,2>{0.0965797007f, 0.54596138f}, std::array<float,2>{0.795535088f, 0.284567237f}, std::array<float,2>{0.471237391f, 0.199019939f}, std::array<float,2>{0.56906265f, 0.766323507f}, std::array<float,2>{0.296338648f, 0.937517107f}, std::array<float,2>{0.725385487f, 0.116089545f}, std::array<float,2>{0.248636454f, 0.491873384f}, std::array<float,2>{0.954455435f, 0.741094649f}, std::array<float,2>{0.15664199f, 0.850365698f}, std::array<float,2>{0.925314426f, 0.165616751f}, std::array<float,2>{0.359988272f, 0.350667983f}, std::array<float,2>{0.668220878f, 0.56965816f}, std::array<float,2>{0.380243659f, 0.631904721f}, std::array<float,2>{0.548727095f, 0.41358006f}, std::array<float,2>{0.0611032397f, 0.0287310276f}, std::array<float,2>{0.873037219f, 0.880149543f}, std::array<float,2>{0.212793544f, 0.706350029f}, std::array<float,2>{0.982225776f, 0.468642771f}, std::array<float,2>{0.263613194f, 0.0821798667f}, std::array<float,2>{0.708254039f, 0.983673871f}, std::array<float,2>{0.439817458f, 0.798365414f}, std::array<float,2>{0.605555415f, 0.223032281f}, std::array<float,2>{0.0755684376f, 0.277363002f}, std::array<float,2>{0.754663289f, 0.507866859f}, std::array<float,2>{0.00398210576f, 0.929076195f}, std::array<float,2>{0.832338393f, 0.0337538831f}, std::array<float,2>{0.433241308f, 0.383620709f}, std::array<float,2>{0.522886157f, 0.687082767f}, std::array<float,2>{0.318255842f, 0.620373785f}, std::array<float,2>{0.653595746f, 0.331784457f}, std::array<float,2>{0.135222524f, 0.136165693f}, std::array<float,2>{0.876408279f, 0.825901508f}, std::array<float,2>{0.151325822f, 0.584343195f}, std::array<float,2>{0.895247042f, 0.374548465f}, std::array<float,2>{0.338512063f, 0.172344387f}, std::array<float,2>{0.63702035f, 0.874237895f}, std::array<float,2>{0.406967044f, 0.89205718f}, std::array<float,2>{0.513638258f, 0.00585365389f}, std::array<float,2>{0.0238992665f, 0.432323128f}, std::array<float,2>{0.816673279f, 0.653253555f}, std::array<float,2>{0.0820310861f, 0.763053894f}, std::array<float,2>{0.772689998f, 0.217362091f}, std::array<float,2>{0.465096951f, 0.297564119f}, std::array<float,2>{0.614975095f, 0.547956347f}, std::array<float,2>{0.27180177f, 0.721520901f}, std::array<float,2>{0.700362742f, 0.475422442f}, std::array<float,2>{0.189819694f, 0.095471628f}, std::array<float,2>{0.98691088f, 0.960491598f}, std::array<float,2>{0.0449345335f, 0.661845267f}, std::array<float,2>{0.847675264f, 0.39312005f}, std::array<float,2>{0.400670797f, 0.0556600429f}, std::array<float,2>{0.541153789f, 0.920393467f}, std::array<float,2>{0.356262475f, 0.839175224f}, std::array<float,2>{0.679987073f, 0.148245946f}, std::array<float,2>{0.17733191f, 0.323541462f}, std::array<float,2>{0.918172121f, 0.595604956f}, std::array<float,2>{0.22279714f, 0.996638954f}, std::array<float,2>{0.939827263f, 0.0781158209f}, std::array<float,2>{0.298188061f, 0.438663721f}, std::array<float,2>{0.743476927f, 0.694151223f}, std::array<float,2>{0.494064301f, 0.51737529f}, std::array<float,2>{0.592281044f, 0.264142931f}, std::array<float,2>{0.115963794f, 0.23638767f}, std::array<float,2>{0.811778963f, 0.79641521f}, std::array<float,2>{0.0207912456f, 0.604405522f}, std::array<float,2>{0.822129905f, 0.318234801f}, std::array<float,2>{0.418675274f, 0.153350815f}, std::array<float,2>{0.507066131f, 0.832066596f}, std::array<float,2>{0.333052814f, 0.910525143f}, std::array<float,2>{0.630514562f, 0.0485893004f}, std::array<float,2>{0.1439576f, 0.40279457f}, std::array<float,2>{0.90367502f, 0.667144358f}, std::array<float,2>{0.197075009f, 0.786511779f}, std::array<float,2>{0.998582661f, 0.243109614f}, std::array<float,2>{0.28114444f, 0.252948761f}, std::array<float,2>{0.689760864f, 0.527531743f}, std::array<float,2>{0.454892635f, 0.695513606f}, std::array<float,2>{0.623599052f, 0.45202443f}, std::array<float,2>{0.0866841823f, 0.0657999963f}, std::array<float,2>{0.775590658f, 0.989001453f}, std::array<float,2>{0.183928922f, 0.646856248f}, std::array<float,2>{0.908196449f, 0.429113477f}, std::array<float,2>{0.348018855f, 0.0113178324f}, std::array<float,2>{0.676353991f, 0.902009547f}, std::array<float,2>{0.398128808f, 0.861577213f}, std::array<float,2>{0.535365701f, 0.180801317f}, std::array<float,2>{0.0328510366f, 0.362746805f}, std::array<float,2>{0.858379841f, 0.590679348f}, std::array<float,2>{0.117571823f, 0.961069524f}, std::array<float,2>{0.79778707f, 0.104459845f}, std::array<float,2>{0.488174379f, 0.480107129f}, std::array<float,2>{0.585645974f, 0.727252126f}, std::array<float,2>{0.306224048f, 0.556785941f}, std::array<float,2>{0.739572644f, 0.31009531f}, std::array<float,2>{0.231933594f, 0.208045274f}, std::array<float,2>{0.947738111f, 0.754323542f}, std::array<float,2>{0.234679222f, 0.503778934f}, std::array<float,2>{0.962771893f, 0.271976829f}, std::array<float,2>{0.283711493f, 0.230680302f}, std::array<float,2>{0.727698982f, 0.807342827f}, std::array<float,2>{0.480402321f, 0.974187791f}, std::array<float,2>{0.576543272f, 0.0871889368f}, std::array<float,2>{0.108011112f, 0.455937028f}, std::array<float,2>{0.785330474f, 0.714949608f}, std::array<float,2>{0.0496025905f, 0.82006377f}, std::array<float,2>{0.862894475f, 0.132349566f}, std::array<float,2>{0.382818907f, 0.336627811f}, std::array<float,2>{0.557394385f, 0.61513555f}, std::array<float,2>{0.368122786f, 0.678575695f}, std::array<float,2>{0.662978172f, 0.378653497f}, std::array<float,2>{0.166704446f, 0.0414677747f}, std::array<float,2>{0.933908463f, 0.935364246f}, std::array<float,2>{0.0672757998f, 0.746860743f}, std::array<float,2>{0.765070379f, 0.492582202f}, std::array<float,2>{0.450106323f, 0.118385009f}, std::array<float,2>{0.599013984f, 0.947376013f}, std::array<float,2>{0.257604241f, 0.780952632f}, std::array<float,2>{0.717107534f, 0.19124724f}, std::array<float,2>{0.210354045f, 0.29029271f}, std::array<float,2>{0.972501099f, 0.53595376f}, std::array<float,2>{0.128402755f, 0.889145374f}, std::array<float,2>{0.88539499f, 0.0192533433f}, std::array<float,2>{0.325714707f, 0.418428987f}, std::array<float,2>{0.643617332f, 0.638994336f}, std::array<float,2>{0.429608196f, 0.571462214f}, std::array<float,2>{0.524630964f, 0.355493695f}, std::array<float,2>{0.00931737106f, 0.162842542f}, std::array<float,2>{0.839407682f, 0.859137237f}, std::array<float,2>{0.0902862102f, 0.564330578f}, std::array<float,2>{0.780213475f, 0.346644282f}, std::array<float,2>{0.460648954f, 0.170945302f}, std::array<float,2>{0.620881796f, 0.846453488f}, std::array<float,2>{0.274387926f, 0.877706766f}, std::array<float,2>{0.693660796f, 0.0251286477f}, std::array<float,2>{0.199515894f, 0.40862751f}, std::array<float,2>{0.995252371f, 0.625003457f}, std::array<float,2>{0.147796571f, 0.772101402f}, std::array<float,2>{0.90106982f, 0.199607894f}, std::array<float,2>{0.330861688f, 0.288661867f}, std::array<float,2>{0.626942337f, 0.540920734f}, std::array<float,2>{0.415166914f, 0.735112429f}, std::array<float,2>{0.502956331f, 0.486889094f}, std::array<float,2>{0.0162136853f, 0.110990815f}, std::array<float,2>{0.827702701f, 0.943106413f}, std::array<float,2>{0.226776272f, 0.680668294f}, std::array<float,2>{0.950395703f, 0.390251696f}, std::array<float,2>{0.310712934f, 0.0354179963f}, std::array<float,2>{0.73579061f, 0.92210114f}, std::array<float,2>{0.488636553f, 0.822733045f}, std::array<float,2>{0.581628084f, 0.13851662f}, std::array<float,2>{0.123511858f, 0.335722476f}, std::array<float,2>{0.802791238f, 0.622757733f}, std::array<float,2>{0.0366210938f, 0.980114996f}, std::array<float,2>{0.854457736f, 0.0807695687f}, std::array<float,2>{0.392215252f, 0.462422103f}, std::array<float,2>{0.535071611f, 0.708814561f}, std::array<float,2>{0.345868737f, 0.515188038f}, std::array<float,2>{0.672566593f, 0.27467826f}, std::array<float,2>{0.182796508f, 0.2217457f}, std::array<float,2>{0.913846791f, 0.801888645f}, std::array<float,2>{0.169220313f, 0.551990986f}, std::array<float,2>{0.931895792f, 0.303876609f}, std::array<float,2>{0.371329784f, 0.212352887f}, std::array<float,2>{0.657830536f, 0.760587215f}, std::array<float,2>{0.387870163f, 0.956072688f}, std::array<float,2>{0.558833659f, 0.0987118185f}, std::array<float,2>{0.0542561673f, 0.471137255f}, std::array<float,2>{0.864266455f, 0.725064397f}, std::array<float,2>{0.105383545f, 0.868315756f}, std::array<float,2>{0.783506453f, 0.177140132f}, std::array<float,2>{0.481997043f, 0.370281041f}, std::array<float,2>{0.573776543f, 0.579186022f}, std::array<float,2>{0.285847366f, 0.650977433f}, std::array<float,2>{0.731269717f, 0.434516728f}, std::array<float,2>{0.241395086f, 0.00356795592f}, std::array<float,2>{0.966782808f, 0.895400465f}, std::array<float,2>{0.0134591544f, 0.68836844f}, std::array<float,2>{0.843344331f, 0.445215106f}, std::array<float,2>{0.424893916f, 0.0736347735f}, std::array<float,2>{0.527368188f, 0.99461484f}, std::array<float,2>{0.321667552f, 0.79138732f}, std::array<float,2>{0.646114469f, 0.238491535f}, std::array<float,2>{0.131906211f, 0.261181206f}, std::array<float,2>{0.889341891f, 0.520961106f}, std::array<float,2>{0.206586599f, 0.915346503f}, std::array<float,2>{0.976132095f, 0.0612832606f}, std::array<float,2>{0.253464639f, 0.397526324f}, std::array<float,2>{0.714272618f, 0.658493638f}, std::array<float,2>{0.445623457f, 0.598965883f}, std::array<float,2>{0.595510304f, 0.324417382f}, std::array<float,2>{0.0652429238f, 0.141011029f}, std::array<float,2>{0.758299172f, 0.841114819f}, std::array<float,2>{0.0556667149f, 0.527106047f}, std::array<float,2>{0.869759321f, 0.255668133f}, std::array<float,2>{0.376349539f, 0.249390274f}, std::array<float,2>{0.554095387f, 0.783788741f}, std::array<float,2>{0.364021093f, 0.98728627f}, std::array<float,2>{0.665729642f, 0.0692882389f}, std::array<float,2>{0.160416126f, 0.448898852f}, std::array<float,2>{0.927316844f, 0.702306569f}, std::array<float,2>{0.24532181f, 0.828396201f}, std::array<float,2>{0.958661079f, 0.149300322f}, std::array<float,2>{0.2900047f, 0.314793974f}, std::array<float,2>{0.721048295f, 0.605963111f}, std::array<float,2>{0.475356698f, 0.668391347f}, std::array<float,2>{0.566370428f, 0.401372701f}, std::array<float,2>{0.0995492637f, 0.0536015928f}, std::array<float,2>{0.789867401f, 0.906502843f}, std::array<float,2>{0.139823884f, 0.733675241f}, std::array<float,2>{0.880931735f, 0.482192785f}, std::array<float,2>{0.313667059f, 0.106371194f}, std::array<float,2>{0.64981693f, 0.966230214f}, std::array<float,2>{0.43407777f, 0.753664672f}, std::array<float,2>{0.519246459f, 0.204325303f}, std::array<float,2>{0.00184972642f, 0.305115521f}, std::array<float,2>{0.831573427f, 0.558852196f}, std::array<float,2>{0.0715690926f, 0.905496061f}, std::array<float,2>{0.753394604f, 0.0149278045f}, std::array<float,2>{0.441816986f, 0.424624264f}, std::array<float,2>{0.601797581f, 0.642750621f}, std::array<float,2>{0.257985055f, 0.588544965f}, std::array<float,2>{0.706923723f, 0.366636008f}, std::array<float,2>{0.218740448f, 0.184855968f}, std::array<float,2>{0.979554355f, 0.86359781f}, std::array<float,2>{0.193330616f, 0.613143146f}, std::array<float,2>{0.991262197f, 0.341600567f}, std::array<float,2>{0.268630415f, 0.125984624f}, std::array<float,2>{0.698818505f, 0.81291014f}, std::array<float,2>{0.462661505f, 0.932661653f}, std::array<float,2>{0.613075256f, 0.0431981646f}, std::array<float,2>{0.0844746828f, 0.380726427f}, std::array<float,2>{0.76866293f, 0.673036993f}, std::array<float,2>{0.0305908173f, 0.810963452f}, std::array<float,2>{0.8133232f, 0.227917433f}, std::array<float,2>{0.412694097f, 0.265688568f}, std::array<float,2>{0.510695398f, 0.507484257f}, std::array<float,2>{0.340025604f, 0.712815583f}, std::array<float,2>{0.634748161f, 0.460719854f}, std::array<float,2>{0.154646546f, 0.0916408226f}, std::array<float,2>{0.893132269f, 0.969397008f}, std::array<float,2>{0.112785153f, 0.634913146f}, std::array<float,2>{0.806280673f, 0.414376467f}, std::array<float,2>{0.496481538f, 0.0202165768f}, std::array<float,2>{0.588268816f, 0.884026468f}, std::array<float,2>{0.304351568f, 0.85386461f}, std::array<float,2>{0.747089326f, 0.157106668f}, std::array<float,2>{0.221090585f, 0.353419214f}, std::array<float,2>{0.943023384f, 0.574284315f}, std::array<float,2>{0.172177255f, 0.950893879f}, std::array<float,2>{0.917434633f, 0.122884341f}, std::array<float,2>{0.353045791f, 0.498904467f}, std::array<float,2>{0.68511951f, 0.742841184f}, std::array<float,2>{0.402883947f, 0.531581223f}, std::array<float,2>{0.544660866f, 0.294647336f}, std::array<float,2>{0.0419877991f, 0.192729771f}, std::array<float,2>{0.844033659f, 0.773776054f}, std::array<float,2>{0.0777310058f, 0.511711776f}, std::array<float,2>{0.75772965f, 0.280922145f}, std::array<float,2>{0.437634677f, 0.224747509f}, std::array<float,2>{0.608199358f, 0.798899591f}, std::array<float,2>{0.265509367f, 0.980953157f}, std::array<float,2>{0.709949315f, 0.0857589468f}, std::array<float,2>{0.213078335f, 0.465448469f}, std::array<float,2>{0.983131945f, 0.704732716f}, std::array<float,2>{0.133484483f, 0.828019381f}, std::array<float,2>{0.877156556f, 0.133373424f}, std::array<float,2>{0.318659037f, 0.329540908f}, std::array<float,2>{0.654810309f, 0.618279159f}, std::array<float,2>{0.431489736f, 0.68480736f}, std::array<float,2>{0.521408677f, 0.386040539f}, std::array<float,2>{0.00640066573f, 0.0315094925f}, std::array<float,2>{0.834372938f, 0.927267313f}, std::array<float,2>{0.24629651f, 0.739191413f}, std::array<float,2>{0.955865502f, 0.48993209f}, std::array<float,2>{0.293459117f, 0.113724194f}, std::array<float,2>{0.724501789f, 0.940820336f}, std::array<float,2>{0.470186621f, 0.769072115f}, std::array<float,2>{0.56688267f, 0.196534678f}, std::array<float,2>{0.0947196707f, 0.281326711f}, std::array<float,2>{0.793936193f, 0.544777274f}, std::array<float,2>{0.0587174073f, 0.882259846f}, std::array<float,2>{0.873287261f, 0.0299965497f}, std::array<float,2>{0.38210538f, 0.41113174f}, std::array<float,2>{0.550418317f, 0.629812479f}, std::array<float,2>{0.363230914f, 0.567341447f}, std::array<float,2>{0.670842648f, 0.348086149f}, std::array<float,2>{0.159142509f, 0.166485846f}, std::array<float,2>{0.923163593f, 0.849333942f}, std::array<float,2>{0.178555861f, 0.59744972f}, std::array<float,2>{0.920175135f, 0.321980774f}, std::array<float,2>{0.357993841f, 0.144532293f}, std::array<float,2>{0.683104217f, 0.837844372f}, std::array<float,2>{0.399344176f, 0.919850826f}, std::array<float,2>{0.540048242f, 0.0580473766f}, std::array<float,2>{0.0443660021f, 0.391925186f}, std::array<float,2>{0.850202382f, 0.663509488f}, std::array<float,2>{0.114026785f, 0.793637395f}, std::array<float,2>{0.808896065f, 0.235915467f}, std::array<float,2>{0.494219601f, 0.263381302f}, std::array<float,2>{0.590645313f, 0.517920911f}, std::array<float,2>{0.300174117f, 0.69247669f}, std::array<float,2>{0.745200098f, 0.440941602f}, std::array<float,2>{0.226163894f, 0.0759311691f}, std::array<float,2>{0.939203382f, 0.998050272f}, std::array<float,2>{0.0261701476f, 0.654700577f}, std::array<float,2>{0.818877339f, 0.429913253f}, std::array<float,2>{0.409399748f, 0.00694041513f}, std::array<float,2>{0.513881624f, 0.893669188f}, std::array<float,2>{0.336790264f, 0.872356892f}, std::array<float,2>{0.639015317f, 0.174943313f}, std::array<float,2>{0.150296584f, 0.372826785f}, std::array<float,2>{0.896697402f, 0.58203882f}, std::array<float,2>{0.188805565f, 0.957687557f}, std::array<float,2>{0.984476447f, 0.0975186527f}, std::array<float,2>{0.269615769f, 0.473550498f}, std::array<float,2>{0.701924026f, 0.719294548f}, std::array<float,2>{0.467036664f, 0.549474955f}, std::array<float,2>{0.615940452f, 0.299602062f}, std::array<float,2>{0.0792751685f, 0.215542942f}, std::array<float,2>{0.770439684f, 0.764687836f}, std::array<float,2>{0.0349660143f, 0.593584657f}, std::array<float,2>{0.855708718f, 0.360959381f}, std::array<float,2>{0.395110458f, 0.182914928f}, std::array<float,2>{0.537109911f, 0.86007154f}, std::array<float,2>{0.350278229f, 0.899098575f}, std::array<float,2>{0.678708136f, 0.0087084556f}, std::array<float,2>{0.185905382f, 0.427576452f}, std::array<float,2>{0.910102069f, 0.644862652f}, std::array<float,2>{0.234015286f, 0.756650984f}, std::array<float,2>{0.946460009f, 0.209484532f}, std::array<float,2>{0.306851655f, 0.312140375f}, std::array<float,2>{0.741205871f, 0.554897845f}, std::array<float,2>{0.484772861f, 0.72991997f}, std::array<float,2>{0.583647788f, 0.476946503f}, std::array<float,2>{0.120625764f, 0.102571197f}, std::array<float,2>{0.799281836f, 0.963584244f}, std::array<float,2>{0.141043246f, 0.665397644f}, std::array<float,2>{0.905061126f, 0.405481547f}, std::array<float,2>{0.334268719f, 0.0495446585f}, std::array<float,2>{0.631496847f, 0.913056672f}, std::array<float,2>{0.42183736f, 0.835428834f}, std::array<float,2>{0.504732788f, 0.15482536f}, std::array<float,2>{0.0229347497f, 0.318845898f}, std::array<float,2>{0.823115945f, 0.602028906f}, std::array<float,2>{0.0884568468f, 0.9920941f}, std::array<float,2>{0.775015533f, 0.0626982152f}, std::array<float,2>{0.456786782f, 0.44985792f}, std::array<float,2>{0.622895479f, 0.69832325f}, std::array<float,2>{0.278005242f, 0.53113848f}, std::array<float,2>{0.687645078f, 0.251754314f}, std::array<float,2>{0.199185714f, 0.246048689f}, std::array<float,2>{0.997356474f, 0.788825691f}, std::array<float,2>{0.207619995f, 0.537650108f}, std::array<float,2>{0.969347835f, 0.292174488f}, std::array<float,2>{0.254638582f, 0.188105375f}, std::array<float,2>{0.716566622f, 0.777486801f}, std::array<float,2>{0.452805132f, 0.945779085f}, std::array<float,2>{0.600180387f, 0.119231112f}, std::array<float,2>{0.0691532642f, 0.495343626f}, std::array<float,2>{0.762752056f, 0.749677241f}, std::array<float,2>{0.0117026987f, 0.856170714f}, std::array<float,2>{0.836971819f, 0.161590412f}, std::array<float,2>{0.426962942f, 0.358241767f}, std::array<float,2>{0.527037621f, 0.573341906f}, std::array<float,2>{0.327913702f, 0.636749506f}, std::array<float,2>{0.6417799f, 0.421677828f}, std::array<float,2>{0.125811324f, 0.0172970034f}, std::array<float,2>{0.883186221f, 0.88751626f}, std::array<float,2>{0.106071271f, 0.716884851f}, std::array<float,2>{0.789025426f, 0.454098821f}, std::array<float,2>{0.478089392f, 0.0885871947f}, std::array<float,2>{0.574641168f, 0.975598454f}, std::array<float,2>{0.281867385f, 0.805755019f}, std::array<float,2>{0.729203522f, 0.233765781f}, std::array<float,2>{0.237414673f, 0.271248102f}, std::array<float,2>{0.963746667f, 0.500910223f}, std::array<float,2>{0.165804937f, 0.935863435f}, std::array<float,2>{0.936109781f, 0.0391389728f}, std::array<float,2>{0.369440258f, 0.375036567f}, std::array<float,2>{0.661647022f, 0.677727401f}, std::array<float,2>{0.385273278f, 0.617092729f}, std::array<float,2>{0.554758549f, 0.339001894f}, std::array<float,2>{0.0472891666f, 0.130248919f}, std::array<float,2>{0.860951245f, 0.817241669f}, std::array<float,2>{0.122294441f, 0.624705732f}, std::array<float,2>{0.801531494f, 0.333722174f}, std::array<float,2>{0.491643816f, 0.139691561f}, std::array<float,2>{0.579741418f, 0.82038033f}, std::array<float,2>{0.308802277f, 0.924008667f}, std::array<float,2>{0.737221718f, 0.037909504f}, std::array<float,2>{0.229821533f, 0.388027072f}, std::array<float,2>{0.953049421f, 0.68285799f}, std::array<float,2>{0.181347698f, 0.802951038f}, std::array<float,2>{0.911020875f, 0.219662413f}, std::array<float,2>{0.345621049f, 0.276070267f}, std::array<float,2>{0.67441833f, 0.513046384f}, std::array<float,2>{0.394427955f, 0.710745096f}, std::array<float,2>{0.531670749f, 0.464009762f}, std::array<float,2>{0.0384216607f, 0.0788505226f}, std::array<float,2>{0.853455424f, 0.977973938f}, std::array<float,2>{0.202923909f, 0.628039837f}, std::array<float,2>{0.993082523f, 0.406751901f}, std::array<float,2>{0.275868058f, 0.0264205318f}, std::array<float,2>{0.692479491f, 0.875909805f}, std::array<float,2>{0.457490414f, 0.845158577f}, std::array<float,2>{0.617314637f, 0.168352798f}, std::array<float,2>{0.0922510773f, 0.344972759f}, std::array<float,2>{0.778780222f, 0.565241933f}, std::array<float,2>{0.0192257464f, 0.943377852f}, std::array<float,2>{0.825500786f, 0.112837747f}, std::array<float,2>{0.416794956f, 0.485554606f}, std::array<float,2>{0.50153321f, 0.738089979f}, std::array<float,2>{0.328410894f, 0.541614413f}, std::array<float,2>{0.627510786f, 0.285589904f}, std::array<float,2>{0.145408258f, 0.202045217f}, std::array<float,2>{0.898657799f, 0.769745231f}, std::array<float,2>{0.130430877f, 0.523183644f}, std::array<float,2>{0.886840701f, 0.258870006f}, std::array<float,2>{0.32267642f, 0.241208792f}, std::array<float,2>{0.647901058f, 0.789754689f}, std::array<float,2>{0.423493356f, 0.992797673f}, std::array<float,2>{0.529957056f, 0.0712404847f}, std::array<float,2>{0.0145812044f, 0.44306457f}, std::array<float,2>{0.84156698f, 0.689982474f}, std::array<float,2>{0.063653402f, 0.84270072f}, std::array<float,2>{0.760145485f, 0.144230321f}, std::array<float,2>{0.448655635f, 0.326755852f}, std::array<float,2>{0.596492827f, 0.601128161f}, std::array<float,2>{0.251390427f, 0.657707334f}, std::array<float,2>{0.711278915f, 0.395607859f}, std::array<float,2>{0.20470804f, 0.0587174706f}, std::array<float,2>{0.973705411f, 0.917881548f}, std::array<float,2>{0.0510248691f, 0.723817229f}, std::array<float,2>{0.866199613f, 0.469594717f}, std::array<float,2>{0.388952255f, 0.100893907f}, std::array<float,2>{0.561926484f, 0.953237295f}, std::array<float,2>{0.373455942f, 0.758127689f}, std::array<float,2>{0.65972805f, 0.213767439f}, std::array<float,2>{0.169985607f, 0.301874042f}, std::array<float,2>{0.931080639f, 0.553472519f}, std::array<float,2>{0.239876598f, 0.898093402f}, std::array<float,2>{0.967883885f, 0.00105816231f}, std::array<float,2>{0.287969619f, 0.435872346f}, std::array<float,2>{0.733255625f, 0.649465501f}, std::array<float,2>{0.483016819f, 0.580356896f}, std::array<float,2>{0.571149945f, 0.368757218f}, std::array<float,2>{0.101812519f, 0.179349363f}, std::array<float,2>{0.782284141f, 0.869581282f}, std::array<float,2>{0.00199495535f, 0.56169045f}, std::array<float,2>{0.829338074f, 0.307734132f}, std::array<float,2>{0.435796469f, 0.206355765f}, std::array<float,2>{0.517197013f, 0.751935482f}, std::array<float,2>{0.314622372f, 0.96818614f}, std::array<float,2>{0.651052475f, 0.10757073f}, std::array<float,2>{0.137549669f, 0.483078361f}, std::array<float,2>{0.880326688f, 0.731487513f}, std::array<float,2>{0.216168538f, 0.867052317f}, std::array<float,2>{0.978102803f, 0.185657471f}, std::array<float,2>{0.260910511f, 0.365003139f}, std::array<float,2>{0.703682244f, 0.586542666f}, std::array<float,2>{0.444967657f, 0.640800536f}, std::array<float,2>{0.604455292f, 0.422035754f}, std::array<float,2>{0.0728082806f, 0.0120626939f}, std::array<float,2>{0.751656711f, 0.902423024f}, std::array<float,2>{0.164052024f, 0.700298727f}, std::array<float,2>{0.928472817f, 0.445834726f}, std::array<float,2>{0.366743714f, 0.0680923164f}, std::array<float,2>{0.667393863f, 0.984752238f}, std::array<float,2>{0.377423465f, 0.781618834f}, std::array<float,2>{0.550858021f, 0.247727334f}, std::array<float,2>{0.0567909367f, 0.256778389f}, std::array<float,2>{0.868351638f, 0.52356267f}, std::array<float,2>{0.100679301f, 0.908554375f}, std::array<float,2>{0.792182624f, 0.0526570566f}, std::array<float,2>{0.473810524f, 0.400064439f}, std::array<float,2>{0.564116299f, 0.670762181f}, std::array<float,2>{0.291653186f, 0.607585549f}, std::array<float,2>{0.718973279f, 0.313691437f}, std::array<float,2>{0.242995068f, 0.150972664f}, std::array<float,2>{0.960931599f, 0.831584334f}, std::array<float,2>{0.22013399f, 0.577757239f}, std::array<float,2>{0.944386065f, 0.355445802f}, std::array<float,2>{0.301391095f, 0.159316838f}, std::array<float,2>{0.748515904f, 0.85251087f}, std::array<float,2>{0.499141842f, 0.886402905f}, std::array<float,2>{0.587086082f, 0.0229822807f}, std::array<float,2>{0.110676259f, 0.416281492f}, std::array<float,2>{0.807982683f, 0.633171976f}, std::array<float,2>{0.0400324725f, 0.776730597f}, std::array<float,2>{0.846970022f, 0.194359913f}, std::array<float,2>{0.404830277f, 0.295474082f}, std::array<float,2>{0.546769142f, 0.534978211f}, std::array<float,2>{0.353532076f, 0.745547295f}, std::array<float,2>{0.687376618f, 0.496876925f}, std::array<float,2>{0.175433725f, 0.124305338f}, std::array<float,2>{0.915630102f, 0.951724231f}, std::array<float,2>{0.0827990845f, 0.674003482f}, std::array<float,2>{0.766911566f, 0.381718546f}, std::array<float,2>{0.464348137f, 0.0467288271f}, std::array<float,2>{0.60947597f, 0.931598186f}, std::array<float,2>{0.266599357f, 0.814870775f}, std::array<float,2>{0.697174549f, 0.127175391f}, std::array<float,2>{0.193421379f, 0.343601286f}, std::array<float,2>{0.989952981f, 0.61033237f}, std::array<float,2>{0.153229132f, 0.972461581f}, std::array<float,2>{0.891985118f, 0.0924354568f}, std::array<float,2>{0.343224823f, 0.458735973f}, std::array<float,2>{0.635190487f, 0.713322699f}, std::array<float,2>{0.410769284f, 0.504003108f}, std::array<float,2>{0.508143663f, 0.268953294f}, std::array<float,2>{0.0282008201f, 0.230143666f}, std::array<float,2>{0.816096008f, 0.808923423f}, std::array<float,2>{0.0790679604f, 0.54708147f}, std::array<float,2>{0.770835638f, 0.298403442f}, std::array<float,2>{0.468695253f, 0.218616813f}, std::array<float,2>{0.617159784f, 0.762692094f}, std::array<float,2>{0.271168411f, 0.959442735f}, std::array<float,2>{0.702614188f, 0.0938807055f}, std::array<float,2>{0.188419834f, 0.475861847f}, std::array<float,2>{0.985950947f, 0.722444594f}, std::array<float,2>{0.148726895f, 0.873520374f}, std::array<float,2>{0.897624016f, 0.173078209f}, std::array<float,2>{0.337787241f, 0.373526067f}, std::array<float,2>{0.64045608f, 0.585684359f}, std::array<float,2>{0.408323824f, 0.654071808f}, std::array<float,2>{0.514960706f, 0.433510631f}, std::array<float,2>{0.0266266856f, 0.0039781807f}, std::array<float,2>{0.819449723f, 0.891180575f}, std::array<float,2>{0.224923968f, 0.695219874f}, std::array<float,2>{0.937846363f, 0.437824488f}, std::array<float,2>{0.299056917f, 0.0769438595f}, std::array<float,2>{0.744570374f, 0.998011529f}, std::array<float,2>{0.495657027f, 0.795881629f}, std::array<float,2>{0.591689646f, 0.237909943f}, std::array<float,2>{0.114452012f, 0.264983028f}, std::array<float,2>{0.810264051f, 0.51616019f}, std::array<float,2>{0.0433792882f, 0.92090112f}, std::array<float,2>{0.851270914f, 0.0556949936f}, std::array<float,2>{0.399731755f, 0.393788099f}, std::array<float,2>{0.539087594f, 0.660740972f}, std::array<float,2>{0.358878136f, 0.594218791f}, std::array<float,2>{0.682204962f, 0.322953641f}, std::array<float,2>{0.179260671f, 0.146548107f}, std::array<float,2>{0.921748877f, 0.838340163f}, std::array<float,2>{0.159310192f, 0.568831146f}, std::array<float,2>{0.922778547f, 0.350247383f}, std::array<float,2>{0.361743003f, 0.164707705f}, std::array<float,2>{0.671570361f, 0.850949824f}, std::array<float,2>{0.381002873f, 0.879662514f}, std::array<float,2>{0.549063981f, 0.0281678382f}, std::array<float,2>{0.0596160665f, 0.412552685f}, std::array<float,2>{0.874661624f, 0.631741822f}, std::array<float,2>{0.0949167088f, 0.76736033f}, std::array<float,2>{0.794530094f, 0.197941318f}, std::array<float,2>{0.469395578f, 0.283304423f}, std::array<float,2>{0.567886472f, 0.545523882f}, std::array<float,2>{0.294621825f, 0.741656601f}, std::array<float,2>{0.723035753f, 0.490278095f}, std::array<float,2>{0.24754633f, 0.116696849f}, std::array<float,2>{0.956981897f, 0.93931067f}, std::array<float,2>{0.00749415439f, 0.686418712f}, std::array<float,2>{0.835660219f, 0.384444326f}, std::array<float,2>{0.429965168f, 0.034965653f}, std::array<float,2>{0.519808471f, 0.928174019f}, std::array<float,2>{0.320192754f, 0.824231327f}, std::array<float,2>{0.655876994f, 0.134919778f}, std::array<float,2>{0.134587675f, 0.330737501f}, std::array<float,2>{0.878101587f, 0.619657338f}, std::array<float,2>{0.214212f, 0.983193219f}, std::array<float,2>{0.984344006f, 0.0837704763f}, std::array<float,2>{0.264298409f, 0.467253864f}, std::array<float,2>{0.710061312f, 0.705544412f}, std::array<float,2>{0.439451367f, 0.50966537f}, std::array<float,2>{0.608508527f, 0.278620183f}, std::array<float,2>{0.0768703818f, 0.223812863f}, std::array<float,2>{0.756051123f, 0.797698319f}, std::array<float,2>{0.0483418331f, 0.61362046f}, std::array<float,2>{0.860318959f, 0.337009609f}, std::array<float,2>{0.386355221f, 0.131605491f}, std::array<float,2>{0.556114376f, 0.819073737f}, std::array<float,2>{0.370441318f, 0.933631599f}, std::array<float,2>{0.660363317f, 0.0421648659f}, std::array<float,2>{0.164690807f, 0.37752068f}, std::array<float,2>{0.936624527f, 0.679029167f}, std::array<float,2>{0.237304628f, 0.807983339f}, std::array<float,2>{0.964681685f, 0.232252866f}, std::array<float,2>{0.283009857f, 0.273093194f}, std::array<float,2>{0.73016268f, 0.502527177f}, std::array<float,2>{0.47747159f, 0.715937793f}, std::array<float,2>{0.57520318f, 0.456599206f}, std::array<float,2>{0.106834143f, 0.0865476206f}, std::array<float,2>{0.787789285f, 0.972936153f}, std::array<float,2>{0.12684916f, 0.640268922f}, std::array<float,2>{0.884116113f, 0.419080645f}, std::array<float,2>{0.326540709f, 0.0184985753f}, std::array<float,2>{0.641214788f, 0.890058398f}, std::array<float,2>{0.426745802f, 0.857947052f}, std::array<float,2>{0.525902808f, 0.163697571f}, std::array<float,2>{0.00984583143f, 0.356957555f}, std::array<float,2>{0.836657643f, 0.570612609f}, std::array<float,2>{0.069789283f, 0.949058712f}, std::array<float,2>{0.76177913f, 0.117663316f}, std::array<float,2>{0.451871842f, 0.493563265f}, std::array<float,2>{0.600756526f, 0.747247756f}, std::array<float,2>{0.255692959f, 0.536778986f}, std::array<float,2>{0.715349853f, 0.289859414f}, std::array<float,2>{0.208072588f, 0.190218687f}, std::array<float,2>{0.969742119f, 0.779841304f}, std::array<float,2>{0.198008329f, 0.529142797f}, std::array<float,2>{0.996238649f, 0.252479911f}, std::array<float,2>{0.278907895f, 0.24368985f}, std::array<float,2>{0.688902676f, 0.786048472f}, std::array<float,2>{0.455879062f, 0.990074694f}, std::array<float,2>{0.621274948f, 0.0645034686f}, std::array<float,2>{0.0896232426f, 0.453124732f}, std::array<float,2>{0.77420795f, 0.696912348f}, std::array<float,2>{0.0223457254f, 0.833723187f}, std::array<float,2>{0.823321998f, 0.152352333f}, std::array<float,2>{0.420576185f, 0.316932797f}, std::array<float,2>{0.505349696f, 0.604541004f}, std::array<float,2>{0.335206598f, 0.666461527f}, std::array<float,2>{0.632510066f, 0.403753817f}, std::array<float,2>{0.142494544f, 0.047246445f}, std::array<float,2>{0.905834973f, 0.911134958f}, std::array<float,2>{0.120020844f, 0.727755725f}, std::array<float,2>{0.800648034f, 0.478528023f}, std::array<float,2>{0.486192793f, 0.104573376f}, std::array<float,2>{0.582365572f, 0.962298274f}, std::array<float,2>{0.308037966f, 0.755397737f}, std::array<float,2>{0.741263449f, 0.207490057f}, std::array<float,2>{0.232791767f, 0.3094652f}, std::array<float,2>{0.945829451f, 0.558128238f}, std::array<float,2>{0.187309772f, 0.900700092f}, std::array<float,2>{0.909039974f, 0.010365515f}, std::array<float,2>{0.350653321f, 0.428436667f}, std::array<float,2>{0.679584742f, 0.648204327f}, std::array<float,2>{0.396162719f, 0.591316819f}, std::array<float,2>{0.5381248f, 0.361971736f}, std::array<float,2>{0.0338972956f, 0.180005461f}, std::array<float,2>{0.857376516f, 0.863154233f}, std::array<float,2>{0.103114724f, 0.578500092f}, std::array<float,2>{0.782175839f, 0.369358033f}, std::array<float,2>{0.483692199f, 0.176645502f}, std::array<float,2>{0.571317494f, 0.868026078f}, std::array<float,2>{0.288117141f, 0.896073401f}, std::array<float,2>{0.733541071f, 0.00249615218f}, std::array<float,2>{0.239040866f, 0.435542375f}, std::array<float,2>{0.967480302f, 0.651634574f}, std::array<float,2>{0.171616554f, 0.761621654f}, std::array<float,2>{0.929918289f, 0.21183385f}, std::array<float,2>{0.374250382f, 0.303678989f}, std::array<float,2>{0.658961535f, 0.551573932f}, std::array<float,2>{0.389730781f, 0.726249933f}, std::array<float,2>{0.561065197f, 0.472248077f}, std::array<float,2>{0.0526267551f, 0.0982723385f}, std::array<float,2>{0.86664331f, 0.955302596f}, std::array<float,2>{0.203135088f, 0.659439266f}, std::array<float,2>{0.973056197f, 0.396922201f}, std::array<float,2>{0.250639379f, 0.062153101f}, std::array<float,2>{0.712088943f, 0.914804995f}, std::array<float,2>{0.447353601f, 0.840348661f}, std::array<float,2>{0.596879601f, 0.141750529f}, std::array<float,2>{0.0634263903f, 0.326008588f}, std::array<float,2>{0.761492968f, 0.598180473f}, std::array<float,2>{0.0155261429f, 0.995191813f}, std::array<float,2>{0.840121865f, 0.0730929673f}, std::array<float,2>{0.422196239f, 0.44392994f}, std::array<float,2>{0.531165123f, 0.688567221f}, std::array<float,2>{0.323352367f, 0.519944429f}, std::array<float,2>{0.647120297f, 0.259977192f}, std::array<float,2>{0.129594952f, 0.239549801f}, std::array<float,2>{0.88796109f, 0.79282397f}, std::array<float,2>{0.146039397f, 0.539195716f}, std::array<float,2>{0.900018871f, 0.28723368f}, std::array<float,2>{0.330061078f, 0.20057103f}, std::array<float,2>{0.628168464f, 0.773160994f}, std::array<float,2>{0.417586088f, 0.941457987f}, std::array<float,2>{0.500062227f, 0.109436885f}, std::array<float,2>{0.0182677656f, 0.488039911f}, std::array<float,2>{0.824972391f, 0.735439539f}, std::array<float,2>{0.0928451419f, 0.846771002f}, std::array<float,2>{0.778107584f, 0.170467213f}, std::array<float,2>{0.458277136f, 0.347576201f}, std::array<float,2>{0.618276894f, 0.562658966f}, std::array<float,2>{0.27639991f, 0.626585484f}, std::array<float,2>{0.691863716f, 0.410079122f}, std::array<float,2>{0.20131202f, 0.0241129007f}, std::array<float,2>{0.993721366f, 0.878333449f}, std::array<float,2>{0.0377691053f, 0.707512617f}, std::array<float,2>{0.851819158f, 0.461545497f}, std::array<float,2>{0.393486679f, 0.0817549303f}, std::array<float,2>{0.532736361f, 0.97925365f}, std::array<float,2>{0.344518572f, 0.801026225f}, std::array<float,2>{0.675482213f, 0.220796198f}, std::array<float,2>{0.179985195f, 0.273956627f}, std::array<float,2>{0.912012517f, 0.513951838f}, std::array<float,2>{0.229433894f, 0.92289561f}, std::array<float,2>{0.951213956f, 0.037057396f}, std::array<float,2>{0.310516149f, 0.389149129f}, std::array<float,2>{0.737322092f, 0.680202663f}, std::array<float,2>{0.49034822f, 0.621351659f}, std::array<float,2>{0.578515947f, 0.334414721f}, std::array<float,2>{0.121987946f, 0.136958241f}, std::array<float,2>{0.802579105f, 0.82414639f}, std::array<float,2>{0.028327629f, 0.506415963f}, std::array<float,2>{0.815232217f, 0.267430991f}, std::array<float,2>{0.411691457f, 0.227148131f}, std::array<float,2>{0.509438992f, 0.811561584f}, std::array<float,2>{0.342659771f, 0.970371068f}, std::array<float,2>{0.636333466f, 0.0907114148f}, std::array<float,2>{0.153789684f, 0.459329188f}, std::array<float,2>{0.891013265f, 0.711746514f}, std::array<float,2>{0.194908395f, 0.814315617f}, std::array<float,2>{0.989248455f, 0.125423893f}, std::array<float,2>{0.267270148f, 0.340365618f}, std::array<float,2>{0.69560796f, 0.61193341f}, std::array<float,2>{0.463834047f, 0.672267139f}, std::array<float,2>{0.610448718f, 0.379443139f}, std::array<float,2>{0.0830485895f, 0.0444550365f}, std::array<float,2>{0.765695095f, 0.931693971f}, std::array<float,2>{0.174001232f, 0.743455648f}, std::array<float,2>{0.914283037f, 0.499922246f}, std::array<float,2>{0.354868591f, 0.121342503f}, std::array<float,2>{0.686041892f, 0.949592292f}, std::array<float,2>{0.405757874f, 0.775279105f}, std::array<float,2>{0.545035958f, 0.191956162f}, std::array<float,2>{0.0402148478f, 0.292977363f}, std::array<float,2>{0.846234202f, 0.533031523f}, std::array<float,2>{0.110232405f, 0.883586764f}, std::array<float,2>{0.807443202f, 0.0211649071f}, std::array<float,2>{0.49826324f, 0.415074944f}, std::array<float,2>{0.586319804f, 0.636056304f}, std::array<float,2>{0.302551091f, 0.575674295f}, std::array<float,2>{0.749199867f, 0.352164f}, std::array<float,2>{0.218763903f, 0.157712147f}, std::array<float,2>{0.94424355f, 0.855230212f}, std::array<float,2>{0.244120494f, 0.60701859f}, std::array<float,2>{0.959727228f, 0.315959066f}, std::array<float,2>{0.292422324f, 0.14978075f}, std::array<float,2>{0.720574558f, 0.829708636f}, std::array<float,2>{0.472663134f, 0.907892406f}, std::array<float,2>{0.563224196f, 0.0542065278f}, std::array<float,2>{0.0996713564f, 0.400461167f}, std::array<float,2>{0.791040957f, 0.669522941f}, std::array<float,2>{0.0577577129f, 0.784472823f}, std::array<float,2>{0.868048668f, 0.248834342f}, std::array<float,2>{0.378216296f, 0.254081368f}, std::array<float,2>{0.552606165f, 0.525626481f}, std::array<float,2>{0.36602512f, 0.701381803f}, std::array<float,2>{0.666536808f, 0.447646439f}, std::array<float,2>{0.162665978f, 0.0696152225f}, std::array<float,2>{0.929653883f, 0.988148093f}, std::array<float,2>{0.0740898997f, 0.644076228f}, std::array<float,2>{0.750479579f, 0.425516278f}, std::array<float,2>{0.444033235f, 0.01396106f}, std::array<float,2>{0.604553699f, 0.90518415f}, std::array<float,2>{0.26056087f, 0.864379346f}, std::array<float,2>{0.704611182f, 0.184224412f}, std::array<float,2>{0.215192974f, 0.366127282f}, std::array<float,2>{0.976620793f, 0.589185059f}, std::array<float,2>{0.137933433f, 0.965692401f}, std::array<float,2>{0.87919575f, 0.106572762f}, std::array<float,2>{0.316109389f, 0.480533689f}, std::array<float,2>{0.651988447f, 0.732706189f}, std::array<float,2>{0.437010616f, 0.560323715f}, std::array<float,2>{0.516586244f, 0.306029022f}, std::array<float,2>{0.0032723709f, 0.203976557f}, std::array<float,2>{0.828150451f, 0.752430797f}, std::array<float,2>{0.116929933f, 0.519376457f}, std::array<float,2>{0.810815215f, 0.26192522f}, std::array<float,2>{0.493069857f, 0.234880403f}, std::array<float,2>{0.592938066f, 0.794171035f}, std::array<float,2>{0.297780216f, 0.999574959f}, std::array<float,2>{0.743074834f, 0.0745250136f}, std::array<float,2>{0.223633364f, 0.439513206f}, std::array<float,2>{0.940775812f, 0.692213297f}, std::array<float,2>{0.176748425f, 0.836800158f}, std::array<float,2>{0.91947031f, 0.146021768f}, std::array<float,2>{0.357329369f, 0.320923001f}, std::array<float,2>{0.680798352f, 0.595867038f}, std::array<float,2>{0.401394516f, 0.662214875f}, std::array<float,2>{0.542174041f, 0.391554445f}, std::array<float,2>{0.0468713902f, 0.0570325963f}, std::array<float,2>{0.848721921f, 0.918126285f}, std::array<float,2>{0.191015542f, 0.719932735f}, std::array<float,2>{0.987946033f, 0.474494159f}, std::array<float,2>{0.272622913f, 0.0958740264f}, std::array<float,2>{0.699982107f, 0.958206236f}, std::array<float,2>{0.46632573f, 0.76375711f}, std::array<float,2>{0.614013374f, 0.216329604f}, std::array<float,2>{0.0808207989f, 0.299895793f}, std::array<float,2>{0.772178471f, 0.54990536f}, std::array<float,2>{0.0249397922f, 0.892757893f}, std::array<float,2>{0.818344116f, 0.00606318982f}, std::array<float,2>{0.408132941f, 0.43143335f}, std::array<float,2>{0.512695134f, 0.655285001f}, std::array<float,2>{0.3397668f, 0.583625495f}, std::array<float,2>{0.638510823f, 0.371713251f}, std::array<float,2>{0.151759237f, 0.174027041f}, std::array<float,2>{0.895549119f, 0.87203902f}, std::array<float,2>{0.136055902f, 0.617646217f}, std::array<float,2>{0.875619292f, 0.329099119f}, std::array<float,2>{0.316543549f, 0.134450957f}, std::array<float,2>{0.652527392f, 0.827093303f}, std::array<float,2>{0.432047307f, 0.925836504f}, std::array<float,2>{0.522337079f, 0.0331552103f}, std::array<float,2>{0.00581225241f, 0.385419458f}, std::array<float,2>{0.833485425f, 0.683611453f}, std::array<float,2>{0.0744534582f, 0.800351679f}, std::array<float,2>{0.754914761f, 0.225976899f}, std::array<float,2>{0.440583795f, 0.279593885f}, std::array<float,2>{0.606625438f, 0.510054052f}, std::array<float,2>{0.262019455f, 0.704075873f}, std::array<float,2>{0.708002925f, 0.466485262f}, std::array<float,2>{0.211527526f, 0.0846787468f}, std::array<float,2>{0.980805993f, 0.982037604f}, std::array<float,2>{0.0621110611f, 0.630692124f}, std::array<float,2>{0.871589482f, 0.411679775f}, std::array<float,2>{0.379247427f, 0.0309961792f}, std::array<float,2>{0.547373235f, 0.881086826f}, std::array<float,2>{0.360863388f, 0.847705722f}, std::array<float,2>{0.669895828f, 0.16704534f}, std::array<float,2>{0.15765132f, 0.349350184f}, std::array<float,2>{0.923886776f, 0.567534804f}, std::array<float,2>{0.24949038f, 0.939989507f}, std::array<float,2>{0.953312159f, 0.115081638f}, std::array<float,2>{0.295410216f, 0.488468438f}, std::array<float,2>{0.725850165f, 0.739705145f}, std::array<float,2>{0.472289473f, 0.543116629f}, std::array<float,2>{0.57000941f, 0.282820284f}, std::array<float,2>{0.0974993929f, 0.195606247f}, std::array<float,2>{0.796302438f, 0.767677963f}, std::array<float,2>{0.00809115078f, 0.572936654f}, std::array<float,2>{0.83830601f, 0.359299779f}, std::array<float,2>{0.428210914f, 0.160784379f}, std::array<float,2>{0.523834825f, 0.856893301f}, std::array<float,2>{0.324262202f, 0.888559997f}, std::array<float,2>{0.642584622f, 0.0162555967f}, std::array<float,2>{0.127060294f, 0.420629084f}, std::array<float,2>{0.886356652f, 0.63771677f}, std::array<float,2>{0.209497541f, 0.778798342f}, std::array<float,2>{0.971189737f, 0.188980296f}, std::array<float,2>{0.256606579f, 0.291026682f}, std::array<float,2>{0.718461037f, 0.538596451f}, std::array<float,2>{0.451117396f, 0.748218358f}, std::array<float,2>{0.597875357f, 0.494183958f}, std::array<float,2>{0.0676490664f, 0.120878026f}, std::array<float,2>{0.764377832f, 0.946445704f}, std::array<float,2>{0.167023331f, 0.676680207f}, std::array<float,2>{0.935501516f, 0.376009226f}, std::array<float,2>{0.368377239f, 0.0402671136f}, std::array<float,2>{0.663366914f, 0.936811388f}, std::array<float,2>{0.384199351f, 0.818269372f}, std::array<float,2>{0.558411658f, 0.129639268f}, std::array<float,2>{0.0506031998f, 0.338512272f}, std::array<float,2>{0.861800432f, 0.615265727f}, std::array<float,2>{0.10908851f, 0.975580215f}, std::array<float,2>{0.786884487f, 0.0888792798f}, std::array<float,2>{0.479277134f, 0.454765975f}, std::array<float,2>{0.577973068f, 0.718061924f}, std::array<float,2>{0.284733653f, 0.501698256f}, std::array<float,2>{0.72741735f, 0.270397991f}, std::array<float,2>{0.236062527f, 0.23242709f}, std::array<float,2>{0.961809516f, 0.805661678f}, std::array<float,2>{0.230795592f, 0.556052864f}, std::array<float,2>{0.949093699f, 0.310906947f}, std::array<float,2>{0.305114686f, 0.210822925f}, std::array<float,2>{0.738584161f, 0.757053554f}, std::array<float,2>{0.486951739f, 0.964582026f}, std::array<float,2>{0.58406949f, 0.101601005f}, std::array<float,2>{0.11879684f, 0.478031337f}, std::array<float,2>{0.798096895f, 0.729217947f}, std::array<float,2>{0.0312685482f, 0.861244142f}, std::array<float,2>{0.859330356f, 0.182203397f}, std::array<float,2>{0.397368461f, 0.360203147f}, std::array<float,2>{0.536382377f, 0.592470765f}, std::array<float,2>{0.349588394f, 0.645926476f}, std::array<float,2>{0.677386224f, 0.426555812f}, std::array<float,2>{0.185144857f, 0.00962867588f}, std::array<float,2>{0.906328797f, 0.899999201f}, std::array<float,2>{0.0873171315f, 0.698070586f}, std::array<float,2>{0.776663482f, 0.451097518f}, std::array<float,2>{0.453279585f, 0.0636737943f}, std::array<float,2>{0.624027848f, 0.990499139f}, std::array<float,2>{0.279803097f, 0.788005888f}, std::array<float,2>{0.691286683f, 0.24456647f}, std::array<float,2>{0.196167439f, 0.250057191f}, std::array<float,2>{0.999245167f, 0.529488921f}, std::array<float,2>{0.142861933f, 0.914046049f}, std::array<float,2>{0.90255034f, 0.0505167544f}, std::array<float,2>{0.332227826f, 0.405060023f}, std::array<float,2>{0.62925148f, 0.664804041f}, std::array<float,2>{0.419307709f, 0.602886856f}, std::array<float,2>{0.506511211f, 0.319660962f}, std::array<float,2>{0.0201188829f, 0.15543963f}, std::array<float,2>{0.820977449f, 0.834111452f}, std::array<float,2>{0.06558121f, 0.599709213f}, std::array<float,2>{0.758889556f, 0.327753097f}, std::array<float,2>{0.446730256f, 0.143038839f}, std::array<float,2>{0.594661653f, 0.84368825f}, std::array<float,2>{0.252188593f, 0.916295826f}, std::array<float,2>{0.71307683f, 0.0596013889f}, std::array<float,2>{0.205278322f, 0.394959778f}, std::array<float,2>{0.975419104f, 0.656966567f}, std::array<float,2>{0.131716818f, 0.790258884f}, std::array<float,2>{0.889797509f, 0.241966516f}, std::array<float,2>{0.321192503f, 0.25830844f}, std::array<float,2>{0.645165145f, 0.521586061f}, std::array<float,2>{0.424241781f, 0.691100717f}, std::array<float,2>{0.529039323f, 0.44141376f}, std::array<float,2>{0.0126041854f, 0.0716532022f}, std::array<float,2>{0.842320025f, 0.993472993f}, std::array<float,2>{0.240410045f, 0.64850533f}, std::array<float,2>{0.964851856f, 0.436812192f}, std::array<float,2>{0.286473989f, 0.000300541171f}, std::array<float,2>{0.731916368f, 0.896959186f}, std::array<float,2>{0.480889857f, 0.87108624f}, std::array<float,2>{0.572866321f, 0.178023189f}, std::array<float,2>{0.103847064f, 0.36760968f}, std::array<float,2>{0.784561992f, 0.581351936f}, std::array<float,2>{0.0529959761f, 0.954361379f}, std::array<float,2>{0.86395067f, 0.0997673273f}, std::array<float,2>{0.386971086f, 0.47027576f}, std::array<float,2>{0.560025692f, 0.723260701f}, std::array<float,2>{0.372412652f, 0.5537799f}, std::array<float,2>{0.656678081f, 0.30139941f}, std::array<float,2>{0.168103009f, 0.214679658f}, std::array<float,2>{0.933250368f, 0.75928998f}, std::array<float,2>{0.18234162f, 0.51204288f}, std::array<float,2>{0.913056016f, 0.276496947f}, std::array<float,2>{0.347055137f, 0.220373243f}, std::array<float,2>{0.672994673f, 0.804475784f}, std::array<float,2>{0.391594321f, 0.977500618f}, std::array<float,2>{0.53408283f, 0.0795137212f}, std::array<float,2>{0.0361071266f, 0.463786393f}, std::array<float,2>{0.85466671f, 0.709367812f}, std::array<float,2>{0.124983102f, 0.822026253f}, std::array<float,2>{0.804622591f, 0.138860941f}, std::array<float,2>{0.48975721f, 0.332184821f}, std::array<float,2>{0.580343306f, 0.623338997f}, std::array<float,2>{0.312231302f, 0.681834221f}, std::array<float,2>{0.735065699f, 0.387167394f}, std::array<float,2>{0.228211686f, 0.0385260172f}, std::array<float,2>{0.949697793f, 0.925089598f}, std::array<float,2>{0.0173243098f, 0.737044036f}, std::array<float,2>{0.826982081f, 0.484890133f}, std::array<float,2>{0.414533734f, 0.111632325f}, std::array<float,2>{0.502702415f, 0.944852471f}, std::array<float,2>{0.331390947f, 0.771228909f}, std::array<float,2>{0.625734806f, 0.202658251f}, std::array<float,2>{0.146578893f, 0.286450326f}, std::array<float,2>{0.901941299f, 0.542954564f}, std::array<float,2>{0.201067924f, 0.876845479f}, std::array<float,2>{0.994353652f, 0.0258547906f}, std::array<float,2>{0.274914652f, 0.407245815f}, std::array<float,2>{0.695007503f, 0.627083004f}, std::array<float,2>{0.459944129f, 0.565641522f}, std::array<float,2>{0.620087922f, 0.343916774f}, std::array<float,2>{0.0913351253f, 0.169871211f}, std::array<float,2>{0.78058511f, 0.844069779f}, std::array<float,2>{0.0426345468f, 0.533284247f}, std::array<float,2>{0.845643461f, 0.296281904f}, std::array<float,2>{0.40388763f, 0.193440124f}, std::array<float,2>{0.543810189f, 0.776250601f}, std::array<float,2>{0.351768613f, 0.952373385f}, std::array<float,2>{0.684297562f, 0.123144925f}, std::array<float,2>{0.173721328f, 0.497277588f}, std::array<float,2>{0.9166798f, 0.744782567f}, std::array<float,2>{0.222078726f, 0.853110194f}, std::array<float,2>{0.941554129f, 0.158631161f}, std::array<float,2>{0.303220749f, 0.353534222f}, std::array<float,2>{0.746193051f, 0.576784313f}, std::array<float,2>{0.497635782f, 0.634477556f}, std::array<float,2>{0.5896222f, 0.4179506f}, std::array<float,2>{0.111875467f, 0.0224151388f}, std::array<float,2>{0.80540961f, 0.885706067f}, std::array<float,2>{0.156011939f, 0.714815855f}, std::array<float,2>{0.893844724f, 0.457324922f}, std::array<float,2>{0.341718912f, 0.0935811475f}, std::array<float,2>{0.633515358f, 0.971062541f}, std::array<float,2>{0.413414091f, 0.809816062f}, std::array<float,2>{0.510854006f, 0.228814483f}, std::array<float,2>{0.0300956015f, 0.267715961f}, std::array<float,2>{0.813669741f, 0.505130887f}, std::array<float,2>{0.0850075483f, 0.930011094f}, std::array<float,2>{0.768176496f, 0.0457036123f}, std::array<float,2>{0.46160987f, 0.382378519f}, std::array<float,2>{0.611980021f, 0.675060928f}, std::array<float,2>{0.268000901f, 0.61048311f}, std::array<float,2>{0.698227406f, 0.341993928f}, std::array<float,2>{0.192289516f, 0.127959773f}, std::array<float,2>{0.990710616f, 0.81639117f}, std::array<float,2>{0.21696797f, 0.587439954f}, std::array<float,2>{0.978894174f, 0.363451988f}, std::array<float,2>{0.259148657f, 0.18656221f}, std::array<float,2>{0.705373883f, 0.865332365f}, std::array<float,2>{0.442827046f, 0.903649569f}, std::array<float,2>{0.602815032f, 0.0127049172f}, std::array<float,2>{0.0712613761f, 0.42380178f}, std::array<float,2>{0.752353907f, 0.641859114f}, std::array<float,2>{0.000372591807f, 0.750221491f}, std::array<float,2>{0.830228031f, 0.205533013f}, std::array<float,2>{0.434814304f, 0.306912959f}, std::array<float,2>{0.517927349f, 0.561388969f}, std::array<float,2>{0.312920332f, 0.731364548f}, std::array<float,2>{0.649074495f, 0.484085619f}, std::array<float,2>{0.139041036f, 0.108621933f}, std::array<float,2>{0.882648051f, 0.96725595f}, std::array<float,2>{0.0985010937f, 0.671781063f}, std::array<float,2>{0.790976405f, 0.399112791f}, std::array<float,2>{0.475699067f, 0.0513891876f}, std::array<float,2>{0.564659059f, 0.909338295f}, std::array<float,2>{0.290943861f, 0.831012309f}, std::array<float,2>{0.722083807f, 0.15192458f}, std::array<float,2>{0.244479939f, 0.312914938f}, std::array<float,2>{0.957153976f, 0.608565509f}, std::array<float,2>{0.161836058f, 0.986151218f}, std::array<float,2>{0.926739037f, 0.0673435852f}, std::array<float,2>{0.365055501f, 0.446855307f}, std::array<float,2>{0.664397955f, 0.699535489f}, std::array<float,2>{0.375295907f, 0.524944663f}, std::array<float,2>{0.553094387f, 0.257618397f}, std::array<float,2>{0.054885935f, 0.246372283f}, std::array<float,2>{0.870445848f, 0.782350898f}}
49.008057
51
0.734728
st-ario
b899df87e8d62a1020c5dbdb3dcaca9161f8c4da
6,066
cpp
C++
C++/Vector4.cpp
Izhido/MiniVideoCard
bcfe5a979d8cdcaf9d5a438798e58eca4fbaa1b0
[ "MIT" ]
1
2017-05-12T15:21:00.000Z
2017-05-12T15:21:00.000Z
C++/Vector4.cpp
Izhido/MiniVideoCard
bcfe5a979d8cdcaf9d5a438798e58eca4fbaa1b0
[ "MIT" ]
null
null
null
C++/Vector4.cpp
Izhido/MiniVideoCard
bcfe5a979d8cdcaf9d5a438798e58eca4fbaa1b0
[ "MIT" ]
null
null
null
// // Vector4.cpp // MiniVideoCard // // Created by Heriberto Delgado on 4/24/17. // Copyright © 2017 Heriberto Delgado. All rights reserved. // #include "Vector4.h" #include <cmath> namespace MiniVideoCard { using namespace std; Vector4::Vector4() { source = new vector<double>(4); ownsSource = true; offset = 0; } Vector4::Vector4(double x, double y, double z) : Vector4() { Set(x, y, z); } Vector4::Vector4(double x, double y, double z, double w) : Vector4() { Set(x, y, z, w); } Vector4::Vector4(vector<double>* source, size_t offset) { if (source == nullptr) { throw runtime_error("Source cannot be null."); } if (offset + 4 > source->size()) { throw runtime_error("Offset exceeds available source size."); } this->source = source; ownsSource = false; this->offset = offset; } Vector4::Vector4(const Vector4& source) : Vector4() { Set(source); } Vector4::Vector4(Vector4&& source) { if (source.ownsSource) { this->source = source.source; ownsSource = source.ownsSource; offset = source.offset; source.ownsSource = false; } else { Set(source); } } Vector4::Vector4(Vector3& source) : Vector4() { Set(source); } Vector4::Vector4(Vector3& source, double w) : Vector4() { Set(source, w); } Vector4::Vector4(Vector2& source, double z) : Vector4() { Set(source, z); } Vector4::Vector4(Vector2& source, double z, double w) : Vector4() { Set(source, z, w); } vector<double>* Vector4::Source() { return source; } size_t Vector4::Offset() { return offset; } double Vector4::X() const { return source->at(offset); } void Vector4::SetX(double x) { source->at(offset) = x; } double Vector4::Y() const { return source->at(offset + 1); } void Vector4::SetY(double y) { source->at(offset + 1) = y; } double Vector4::Z() const { return source->at(offset + 2); } void Vector4::SetZ(double z) { source->at(offset + 2) = z; } double Vector4::W() const { return source->at(offset + 3); } void Vector4::SetW(double w) { source->at(offset + 3) = w; } void Vector4::Set(double x, double y, double z) { SetX(x); SetY(y); SetZ(z); SetW(1); } void Vector4::Set(double x, double y, double z, double w) { SetX(x); SetY(y); SetZ(z); SetW(w); } void Vector4::Set(const Vector4& source) { Set(source.X(), source.Y(), source.Z(), source.W()); } void Vector4::Set(Vector3& source) { Set(source.X(), source.Y() ,source.Z()); } void Vector4::Set(Vector3& source, double w) { Set(source.X(), source.Y(), source.Z(), w); } void Vector4::Set(Vector2& source, double z) { Set(source.X(), source.Y(), z); } void Vector4::Set(Vector2& source, double z, double w) { Set(source.X(), source.Y(), z, w); } Vector2 Vector4::XY() { return Vector2(X(), Y()); } Vector3 Vector4::XYZ() { return Vector3(X(), Y(), Z()); } void Vector4::Add(const Vector4& right, Vector4& result) const { result.Set(X() + right.X(), Y() + right.Y(), Z() + right.Z(), W() + right.W()); } void Vector4::Subtract(const Vector4& right, Vector4& result) const { result.Set(X() - right.X(), Y() - right.Y(), Z() - right.Z(), W() - right.W()); } void Vector4::Multiply(double right, Vector4 &result) const { result.Set(X() * right, Y() * right, Z() * right, W() * right); } void Vector4::Divide(double right, Vector4 &result) const { result.Set(X() / right, Y() / right, Z() / right, W() / right); } double Vector4::Dot(const Vector4& right) const { return X() * right.X() + Y() * right.Y() + Z() * right.Z() + W() * right.W(); } double Vector4::SquareLength() { return Dot(*this); } double Vector4::Length() { return sqrt(SquareLength()); } bool Vector4::Normalize() { auto length = Length(); if (length == 0) { return false; } Set(X() / length, Y() / length, Z() / length, W() / length); return true; } Vector4& Vector4::operator=(const Vector4& right) { Set(right); return *this; } Vector4::~Vector4() { if (ownsSource) { delete source; } } Vector4 operator+(const Vector4& left, const Vector4& right) { Vector4 result; left.Add(right, result); return result; } Vector4 operator-(const Vector4& left, const Vector4& right) { Vector4 result; left.Subtract(right, result); return result; } Vector4 operator*(const Vector4& left, double right) { Vector4 result; left.Multiply(right, result); return result; } Vector4 operator*(double left, const Vector4& right) { Vector4 result; right.Multiply(left, result); return result; } double operator*(const Vector4& left, const Vector4& right) { return left.Dot(right); } Vector4 operator/(const Vector4& left, double right) { Vector4 result; left.Divide(right, result); return result; } }
19.823529
87
0.491263
Izhido
b89f98ab630861341e4c18551e3ba73349b145d5
15,272
cc
C++
test/f32-vdivc-relu.cc
kimishpatel/XNNPACK
71c4d1a0b281563948210d713b6ea04f0ab7b418
[ "BSD-3-Clause" ]
1
2021-07-05T21:25:45.000Z
2021-07-05T21:25:45.000Z
test/f32-vdivc-relu.cc
kimishpatel/XNNPACK
71c4d1a0b281563948210d713b6ea04f0ab7b418
[ "BSD-3-Clause" ]
1
2021-04-06T08:53:46.000Z
2021-04-07T10:55:44.000Z
test/f32-vdivc-relu.cc
kimishpatel/XNNPACK
71c4d1a0b281563948210d713b6ea04f0ab7b418
[ "BSD-3-Clause" ]
2
2021-04-05T13:17:54.000Z
2021-04-09T00:23:23.000Z
// Copyright 2019 Google LLC // // This source code is licensed under the BSD-style license found in the // LICENSE file in the root directory of this source tree. // // Auto-generated file. Do not edit! // Specification: test/f32-vdivc-relu.yaml // Generator: tools/generate-vbinary-test.py #include <gtest/gtest.h> #include <xnnpack/common.h> #include <xnnpack/isa-checks.h> #include <xnnpack/vbinary.h> #include "vbinaryc-microkernel-tester.h" #if XNN_ARCH_WASMSIMD TEST(F32_VDIVC_RELU__WASMSIMD_X4, batch_eq_4) { VBinOpCMicrokernelTester() .batch_size(4) .Test(xnn_f32_vdivc_relu_ukernel__wasmsimd_x4, VBinOpCMicrokernelTester::OpType::DivC); } TEST(F32_VDIVC_RELU__WASMSIMD_X4, batch_div_4) { for (size_t batch_size = 8; batch_size < 40; batch_size += 4) { VBinOpCMicrokernelTester() .batch_size(batch_size) .Test(xnn_f32_vdivc_relu_ukernel__wasmsimd_x4, VBinOpCMicrokernelTester::OpType::DivC); } } TEST(F32_VDIVC_RELU__WASMSIMD_X4, batch_lt_4) { for (size_t batch_size = 1; batch_size < 4; batch_size++) { VBinOpCMicrokernelTester() .batch_size(batch_size) .Test(xnn_f32_vdivc_relu_ukernel__wasmsimd_x4, VBinOpCMicrokernelTester::OpType::DivC); } } TEST(F32_VDIVC_RELU__WASMSIMD_X4, batch_gt_4) { for (size_t batch_size = 5; batch_size < 8; batch_size++) { VBinOpCMicrokernelTester() .batch_size(batch_size) .Test(xnn_f32_vdivc_relu_ukernel__wasmsimd_x4, VBinOpCMicrokernelTester::OpType::DivC); } } TEST(F32_VDIVC_RELU__WASMSIMD_X4, inplace) { for (size_t batch_size = 1; batch_size <= 20; batch_size += 3) { VBinOpCMicrokernelTester() .batch_size(batch_size) .inplace(true) .Test(xnn_f32_vdivc_relu_ukernel__wasmsimd_x4, VBinOpCMicrokernelTester::OpType::DivC); } } #endif // XNN_ARCH_WASMSIMD #if XNN_ARCH_WASMSIMD TEST(F32_VDIVC_RELU__WASMSIMD_X8, batch_eq_8) { VBinOpCMicrokernelTester() .batch_size(8) .Test(xnn_f32_vdivc_relu_ukernel__wasmsimd_x8, VBinOpCMicrokernelTester::OpType::DivC); } TEST(F32_VDIVC_RELU__WASMSIMD_X8, batch_div_8) { for (size_t batch_size = 16; batch_size < 80; batch_size += 8) { VBinOpCMicrokernelTester() .batch_size(batch_size) .Test(xnn_f32_vdivc_relu_ukernel__wasmsimd_x8, VBinOpCMicrokernelTester::OpType::DivC); } } TEST(F32_VDIVC_RELU__WASMSIMD_X8, batch_lt_8) { for (size_t batch_size = 1; batch_size < 8; batch_size++) { VBinOpCMicrokernelTester() .batch_size(batch_size) .Test(xnn_f32_vdivc_relu_ukernel__wasmsimd_x8, VBinOpCMicrokernelTester::OpType::DivC); } } TEST(F32_VDIVC_RELU__WASMSIMD_X8, batch_gt_8) { for (size_t batch_size = 9; batch_size < 16; batch_size++) { VBinOpCMicrokernelTester() .batch_size(batch_size) .Test(xnn_f32_vdivc_relu_ukernel__wasmsimd_x8, VBinOpCMicrokernelTester::OpType::DivC); } } TEST(F32_VDIVC_RELU__WASMSIMD_X8, inplace) { for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) { VBinOpCMicrokernelTester() .batch_size(batch_size) .inplace(true) .Test(xnn_f32_vdivc_relu_ukernel__wasmsimd_x8, VBinOpCMicrokernelTester::OpType::DivC); } } #endif // XNN_ARCH_WASMSIMD #if XNN_ARCH_WASMSIMD TEST(F32_VDIVC_RELU__WASMSIMD_X16, batch_eq_16) { VBinOpCMicrokernelTester() .batch_size(16) .Test(xnn_f32_vdivc_relu_ukernel__wasmsimd_x16, VBinOpCMicrokernelTester::OpType::DivC); } TEST(F32_VDIVC_RELU__WASMSIMD_X16, batch_div_16) { for (size_t batch_size = 32; batch_size < 160; batch_size += 16) { VBinOpCMicrokernelTester() .batch_size(batch_size) .Test(xnn_f32_vdivc_relu_ukernel__wasmsimd_x16, VBinOpCMicrokernelTester::OpType::DivC); } } TEST(F32_VDIVC_RELU__WASMSIMD_X16, batch_lt_16) { for (size_t batch_size = 1; batch_size < 16; batch_size++) { VBinOpCMicrokernelTester() .batch_size(batch_size) .Test(xnn_f32_vdivc_relu_ukernel__wasmsimd_x16, VBinOpCMicrokernelTester::OpType::DivC); } } TEST(F32_VDIVC_RELU__WASMSIMD_X16, batch_gt_16) { for (size_t batch_size = 17; batch_size < 32; batch_size++) { VBinOpCMicrokernelTester() .batch_size(batch_size) .Test(xnn_f32_vdivc_relu_ukernel__wasmsimd_x16, VBinOpCMicrokernelTester::OpType::DivC); } } TEST(F32_VDIVC_RELU__WASMSIMD_X16, inplace) { for (size_t batch_size = 1; batch_size <= 80; batch_size += 15) { VBinOpCMicrokernelTester() .batch_size(batch_size) .inplace(true) .Test(xnn_f32_vdivc_relu_ukernel__wasmsimd_x16, VBinOpCMicrokernelTester::OpType::DivC); } } #endif // XNN_ARCH_WASMSIMD #if XNN_ARCH_WASM || XNN_ARCH_WASMSIMD TEST(F32_VDIVC_RELU__WASM_X1, batch_eq_1) { VBinOpCMicrokernelTester() .batch_size(1) .Test(xnn_f32_vdivc_relu_ukernel__wasm_x1, VBinOpCMicrokernelTester::OpType::DivC); } TEST(F32_VDIVC_RELU__WASM_X1, batch_gt_1) { for (size_t batch_size = 2; batch_size < 10; batch_size++) { VBinOpCMicrokernelTester() .batch_size(batch_size) .Test(xnn_f32_vdivc_relu_ukernel__wasm_x1, VBinOpCMicrokernelTester::OpType::DivC); } } TEST(F32_VDIVC_RELU__WASM_X1, inplace) { for (size_t batch_size = 1; batch_size <= 5; batch_size += 1) { VBinOpCMicrokernelTester() .batch_size(batch_size) .inplace(true) .Test(xnn_f32_vdivc_relu_ukernel__wasm_x1, VBinOpCMicrokernelTester::OpType::DivC); } } #endif // XNN_ARCH_WASM || XNN_ARCH_WASMSIMD #if XNN_ARCH_WASM || XNN_ARCH_WASMSIMD TEST(F32_VDIVC_RELU__WASM_X2, batch_eq_2) { VBinOpCMicrokernelTester() .batch_size(2) .Test(xnn_f32_vdivc_relu_ukernel__wasm_x2, VBinOpCMicrokernelTester::OpType::DivC); } TEST(F32_VDIVC_RELU__WASM_X2, batch_div_2) { for (size_t batch_size = 4; batch_size < 20; batch_size += 2) { VBinOpCMicrokernelTester() .batch_size(batch_size) .Test(xnn_f32_vdivc_relu_ukernel__wasm_x2, VBinOpCMicrokernelTester::OpType::DivC); } } TEST(F32_VDIVC_RELU__WASM_X2, batch_lt_2) { for (size_t batch_size = 1; batch_size < 2; batch_size++) { VBinOpCMicrokernelTester() .batch_size(batch_size) .Test(xnn_f32_vdivc_relu_ukernel__wasm_x2, VBinOpCMicrokernelTester::OpType::DivC); } } TEST(F32_VDIVC_RELU__WASM_X2, batch_gt_2) { for (size_t batch_size = 3; batch_size < 4; batch_size++) { VBinOpCMicrokernelTester() .batch_size(batch_size) .Test(xnn_f32_vdivc_relu_ukernel__wasm_x2, VBinOpCMicrokernelTester::OpType::DivC); } } TEST(F32_VDIVC_RELU__WASM_X2, inplace) { for (size_t batch_size = 1; batch_size <= 10; batch_size += 1) { VBinOpCMicrokernelTester() .batch_size(batch_size) .inplace(true) .Test(xnn_f32_vdivc_relu_ukernel__wasm_x2, VBinOpCMicrokernelTester::OpType::DivC); } } #endif // XNN_ARCH_WASM || XNN_ARCH_WASMSIMD #if XNN_ARCH_WASM || XNN_ARCH_WASMSIMD TEST(F32_VDIVC_RELU__WASM_X4, batch_eq_4) { VBinOpCMicrokernelTester() .batch_size(4) .Test(xnn_f32_vdivc_relu_ukernel__wasm_x4, VBinOpCMicrokernelTester::OpType::DivC); } TEST(F32_VDIVC_RELU__WASM_X4, batch_div_4) { for (size_t batch_size = 8; batch_size < 40; batch_size += 4) { VBinOpCMicrokernelTester() .batch_size(batch_size) .Test(xnn_f32_vdivc_relu_ukernel__wasm_x4, VBinOpCMicrokernelTester::OpType::DivC); } } TEST(F32_VDIVC_RELU__WASM_X4, batch_lt_4) { for (size_t batch_size = 1; batch_size < 4; batch_size++) { VBinOpCMicrokernelTester() .batch_size(batch_size) .Test(xnn_f32_vdivc_relu_ukernel__wasm_x4, VBinOpCMicrokernelTester::OpType::DivC); } } TEST(F32_VDIVC_RELU__WASM_X4, batch_gt_4) { for (size_t batch_size = 5; batch_size < 8; batch_size++) { VBinOpCMicrokernelTester() .batch_size(batch_size) .Test(xnn_f32_vdivc_relu_ukernel__wasm_x4, VBinOpCMicrokernelTester::OpType::DivC); } } TEST(F32_VDIVC_RELU__WASM_X4, inplace) { for (size_t batch_size = 1; batch_size <= 20; batch_size += 3) { VBinOpCMicrokernelTester() .batch_size(batch_size) .inplace(true) .Test(xnn_f32_vdivc_relu_ukernel__wasm_x4, VBinOpCMicrokernelTester::OpType::DivC); } } #endif // XNN_ARCH_WASM || XNN_ARCH_WASMSIMD #if XNN_ARCH_WASM || XNN_ARCH_WASMSIMD TEST(F32_VDIVC_RELU__WASM_X8, batch_eq_8) { VBinOpCMicrokernelTester() .batch_size(8) .Test(xnn_f32_vdivc_relu_ukernel__wasm_x8, VBinOpCMicrokernelTester::OpType::DivC); } TEST(F32_VDIVC_RELU__WASM_X8, batch_div_8) { for (size_t batch_size = 16; batch_size < 80; batch_size += 8) { VBinOpCMicrokernelTester() .batch_size(batch_size) .Test(xnn_f32_vdivc_relu_ukernel__wasm_x8, VBinOpCMicrokernelTester::OpType::DivC); } } TEST(F32_VDIVC_RELU__WASM_X8, batch_lt_8) { for (size_t batch_size = 1; batch_size < 8; batch_size++) { VBinOpCMicrokernelTester() .batch_size(batch_size) .Test(xnn_f32_vdivc_relu_ukernel__wasm_x8, VBinOpCMicrokernelTester::OpType::DivC); } } TEST(F32_VDIVC_RELU__WASM_X8, batch_gt_8) { for (size_t batch_size = 9; batch_size < 16; batch_size++) { VBinOpCMicrokernelTester() .batch_size(batch_size) .Test(xnn_f32_vdivc_relu_ukernel__wasm_x8, VBinOpCMicrokernelTester::OpType::DivC); } } TEST(F32_VDIVC_RELU__WASM_X8, inplace) { for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) { VBinOpCMicrokernelTester() .batch_size(batch_size) .inplace(true) .Test(xnn_f32_vdivc_relu_ukernel__wasm_x8, VBinOpCMicrokernelTester::OpType::DivC); } } #endif // XNN_ARCH_WASM || XNN_ARCH_WASMSIMD TEST(F32_VDIVC_RELU__SCALAR_X1, batch_eq_1) { VBinOpCMicrokernelTester() .batch_size(1) .Test(xnn_f32_vdivc_relu_ukernel__scalar_x1, VBinOpCMicrokernelTester::OpType::DivC, VBinOpCMicrokernelTester::Variant::Scalar); } TEST(F32_VDIVC_RELU__SCALAR_X1, batch_gt_1) { for (size_t batch_size = 2; batch_size < 10; batch_size++) { VBinOpCMicrokernelTester() .batch_size(batch_size) .Test(xnn_f32_vdivc_relu_ukernel__scalar_x1, VBinOpCMicrokernelTester::OpType::DivC, VBinOpCMicrokernelTester::Variant::Scalar); } } TEST(F32_VDIVC_RELU__SCALAR_X1, inplace) { for (size_t batch_size = 1; batch_size <= 5; batch_size += 1) { VBinOpCMicrokernelTester() .batch_size(batch_size) .inplace(true) .Test(xnn_f32_vdivc_relu_ukernel__scalar_x1, VBinOpCMicrokernelTester::OpType::DivC, VBinOpCMicrokernelTester::Variant::Scalar); } } TEST(F32_VDIVC_RELU__SCALAR_X2, batch_eq_2) { VBinOpCMicrokernelTester() .batch_size(2) .Test(xnn_f32_vdivc_relu_ukernel__scalar_x2, VBinOpCMicrokernelTester::OpType::DivC, VBinOpCMicrokernelTester::Variant::Scalar); } TEST(F32_VDIVC_RELU__SCALAR_X2, batch_div_2) { for (size_t batch_size = 4; batch_size < 20; batch_size += 2) { VBinOpCMicrokernelTester() .batch_size(batch_size) .Test(xnn_f32_vdivc_relu_ukernel__scalar_x2, VBinOpCMicrokernelTester::OpType::DivC, VBinOpCMicrokernelTester::Variant::Scalar); } } TEST(F32_VDIVC_RELU__SCALAR_X2, batch_lt_2) { for (size_t batch_size = 1; batch_size < 2; batch_size++) { VBinOpCMicrokernelTester() .batch_size(batch_size) .Test(xnn_f32_vdivc_relu_ukernel__scalar_x2, VBinOpCMicrokernelTester::OpType::DivC, VBinOpCMicrokernelTester::Variant::Scalar); } } TEST(F32_VDIVC_RELU__SCALAR_X2, batch_gt_2) { for (size_t batch_size = 3; batch_size < 4; batch_size++) { VBinOpCMicrokernelTester() .batch_size(batch_size) .Test(xnn_f32_vdivc_relu_ukernel__scalar_x2, VBinOpCMicrokernelTester::OpType::DivC, VBinOpCMicrokernelTester::Variant::Scalar); } } TEST(F32_VDIVC_RELU__SCALAR_X2, inplace) { for (size_t batch_size = 1; batch_size <= 10; batch_size += 1) { VBinOpCMicrokernelTester() .batch_size(batch_size) .inplace(true) .Test(xnn_f32_vdivc_relu_ukernel__scalar_x2, VBinOpCMicrokernelTester::OpType::DivC, VBinOpCMicrokernelTester::Variant::Scalar); } } TEST(F32_VDIVC_RELU__SCALAR_X4, batch_eq_4) { VBinOpCMicrokernelTester() .batch_size(4) .Test(xnn_f32_vdivc_relu_ukernel__scalar_x4, VBinOpCMicrokernelTester::OpType::DivC, VBinOpCMicrokernelTester::Variant::Scalar); } TEST(F32_VDIVC_RELU__SCALAR_X4, batch_div_4) { for (size_t batch_size = 8; batch_size < 40; batch_size += 4) { VBinOpCMicrokernelTester() .batch_size(batch_size) .Test(xnn_f32_vdivc_relu_ukernel__scalar_x4, VBinOpCMicrokernelTester::OpType::DivC, VBinOpCMicrokernelTester::Variant::Scalar); } } TEST(F32_VDIVC_RELU__SCALAR_X4, batch_lt_4) { for (size_t batch_size = 1; batch_size < 4; batch_size++) { VBinOpCMicrokernelTester() .batch_size(batch_size) .Test(xnn_f32_vdivc_relu_ukernel__scalar_x4, VBinOpCMicrokernelTester::OpType::DivC, VBinOpCMicrokernelTester::Variant::Scalar); } } TEST(F32_VDIVC_RELU__SCALAR_X4, batch_gt_4) { for (size_t batch_size = 5; batch_size < 8; batch_size++) { VBinOpCMicrokernelTester() .batch_size(batch_size) .Test(xnn_f32_vdivc_relu_ukernel__scalar_x4, VBinOpCMicrokernelTester::OpType::DivC, VBinOpCMicrokernelTester::Variant::Scalar); } } TEST(F32_VDIVC_RELU__SCALAR_X4, inplace) { for (size_t batch_size = 1; batch_size <= 20; batch_size += 3) { VBinOpCMicrokernelTester() .batch_size(batch_size) .inplace(true) .Test(xnn_f32_vdivc_relu_ukernel__scalar_x4, VBinOpCMicrokernelTester::OpType::DivC, VBinOpCMicrokernelTester::Variant::Scalar); } } TEST(F32_VDIVC_RELU__SCALAR_X8, batch_eq_8) { VBinOpCMicrokernelTester() .batch_size(8) .Test(xnn_f32_vdivc_relu_ukernel__scalar_x8, VBinOpCMicrokernelTester::OpType::DivC, VBinOpCMicrokernelTester::Variant::Scalar); } TEST(F32_VDIVC_RELU__SCALAR_X8, batch_div_8) { for (size_t batch_size = 16; batch_size < 80; batch_size += 8) { VBinOpCMicrokernelTester() .batch_size(batch_size) .Test(xnn_f32_vdivc_relu_ukernel__scalar_x8, VBinOpCMicrokernelTester::OpType::DivC, VBinOpCMicrokernelTester::Variant::Scalar); } } TEST(F32_VDIVC_RELU__SCALAR_X8, batch_lt_8) { for (size_t batch_size = 1; batch_size < 8; batch_size++) { VBinOpCMicrokernelTester() .batch_size(batch_size) .Test(xnn_f32_vdivc_relu_ukernel__scalar_x8, VBinOpCMicrokernelTester::OpType::DivC, VBinOpCMicrokernelTester::Variant::Scalar); } } TEST(F32_VDIVC_RELU__SCALAR_X8, batch_gt_8) { for (size_t batch_size = 9; batch_size < 16; batch_size++) { VBinOpCMicrokernelTester() .batch_size(batch_size) .Test(xnn_f32_vdivc_relu_ukernel__scalar_x8, VBinOpCMicrokernelTester::OpType::DivC, VBinOpCMicrokernelTester::Variant::Scalar); } } TEST(F32_VDIVC_RELU__SCALAR_X8, inplace) { for (size_t batch_size = 1; batch_size <= 40; batch_size += 7) { VBinOpCMicrokernelTester() .batch_size(batch_size) .inplace(true) .Test(xnn_f32_vdivc_relu_ukernel__scalar_x8, VBinOpCMicrokernelTester::OpType::DivC, VBinOpCMicrokernelTester::Variant::Scalar); } }
34.709091
134
0.729767
kimishpatel
b89fe533e9ef7d1c71158b974bcdc0da8af3c7b0
1,177
hpp
C++
src/bgs_engine/utils/pyutils.hpp
codpro880/heartspeed
8027216fe3c3bb0bd702c823b876dfa42c91ce7a
[ "MIT" ]
3
2019-04-28T16:01:38.000Z
2020-12-06T02:39:03.000Z
src/bgs_engine/utils/pyutils.hpp
codpro880/heartspeed
8027216fe3c3bb0bd702c823b876dfa42c91ce7a
[ "MIT" ]
12
2020-12-06T05:30:02.000Z
2021-04-27T00:18:13.000Z
src/bgs_engine/utils/pyutils.hpp
codpro880/heartspeed
8027216fe3c3bb0bd702c823b876dfa42c91ce7a
[ "MIT" ]
null
null
null
#pragma once #include <set> #include <string> #include <vector> #include <unordered_set> namespace pyutils { template <typename T1, typename T2> bool in(T1 to_find, std::vector<T2> vec) { return std::find(vec.begin(), vec.end(), to_find) != vec.end(); } template <typename T1, typename T2> bool in(T1 to_find, std::set<T2> vec) { return std::find(vec.begin(), vec.end(), to_find) != vec.end(); } template <typename T1, typename T2> bool in(T1 to_find, std::unordered_set<T2> vec) { return std::find(vec.begin(), vec.end(), to_find) != vec.end(); } // inline to stop duplicate symbol link errors // not sure this is portable... inline bool in(std::string to_find, std::string str) { return str.find(to_find) != std::string::npos; } inline std::string get_str_between(std::string item, std::string start_token, std::string end_token) { auto start = item.find(start_token); auto real_start = start + start_token.size(); auto end = item.find(end_token); std::string card_name = item.substr(real_start, end - real_start); return card_name; } }
30.973684
106
0.629567
codpro880
b8a2826d3cc571ef68e839fac575526e961f6916
1,302
cpp
C++
src/eepp/ui/uieventdispatcher.cpp
jayrulez/eepp
09c5c1b6b4c0306bb0a188474778c6949b5df3a7
[ "MIT" ]
37
2020-01-20T06:21:24.000Z
2022-03-21T17:44:50.000Z
src/eepp/ui/uieventdispatcher.cpp
jayrulez/eepp
09c5c1b6b4c0306bb0a188474778c6949b5df3a7
[ "MIT" ]
null
null
null
src/eepp/ui/uieventdispatcher.cpp
jayrulez/eepp
09c5c1b6b4c0306bb0a188474778c6949b5df3a7
[ "MIT" ]
9
2019-03-22T00:33:07.000Z
2022-03-01T01:35:59.000Z
#include <eepp/ui/uieventdispatcher.hpp> #include <eepp/ui/uiscenenode.hpp> #include <eepp/ui/uiwidget.hpp> #include <eepp/window/inputevent.hpp> #include <eepp/window/window.hpp> namespace EE { namespace UI { UIEventDispatcher* UIEventDispatcher::New( SceneNode* sceneNode ) { return eeNew( UIEventDispatcher, ( sceneNode ) ); } UIEventDispatcher::UIEventDispatcher( SceneNode* sceneNode ) : EventDispatcher( sceneNode ), mJustGainedFocus( false ) {} const bool& UIEventDispatcher::justGainedFocus() const { return mJustGainedFocus; } void UIEventDispatcher::inputCallback( InputEvent* Event ) { EventDispatcher::inputCallback( Event ); switch ( Event->Type ) { case InputEvent::Window: if ( Event->window.type == InputEvent::WindowKeyboardFocusGain ) { mJustGainedFocus = true; } break; case InputEvent::KeyDown: checkTabPress( Event->key.keysym.sym ); break; case InputEvent::EventsSent: mJustGainedFocus = false; break; } } void UIEventDispatcher::checkTabPress( const Uint32& KeyCode ) { eeASSERT( NULL != mFocusNode ); Window::Window* win = mFocusNode->getSceneNode()->getWindow(); if ( KeyCode == KEY_TAB && mFocusNode->isWidget() && NULL != win && !mJustGainedFocus ) { mFocusNode->asType<UIWidget>()->onTabPress(); } } }} // namespace EE::UI
27.702128
90
0.722734
jayrulez
b8a78ee407f8c2ed483e83d3171b0468536e498d
723
cpp
C++
AIC/AIC'20 - Level 1 Training/Week #11/V.cpp
MaGnsio/CP-Problems
a7f518a20ba470f554b6d54a414b84043bf209c5
[ "Unlicense" ]
3
2020-11-01T06:31:30.000Z
2022-02-21T20:37:51.000Z
AIC/AIC'20 - Level 1 Training/Week #11/V.cpp
MaGnsio/CP-Problems
a7f518a20ba470f554b6d54a414b84043bf209c5
[ "Unlicense" ]
null
null
null
AIC/AIC'20 - Level 1 Training/Week #11/V.cpp
MaGnsio/CP-Problems
a7f518a20ba470f554b6d54a414b84043bf209c5
[ "Unlicense" ]
1
2021-05-05T18:56:31.000Z
2021-05-05T18:56:31.000Z
//https://codeforces.com/group/Rv2Qzg0DgK/contest/291373/problem/V #include <bits/stdc++.h> using namespace std; #define F first #define S second typedef long long ll; typedef long double ld; ll mod = 1e9 + 7; void solve () { ll d; cin >> d; if (!d) { cout << "Y " << 0.000000000 << " " << 0.000000000 << "\n"; return; } if (d < 4) { cout << "N\n"; return; } ld a = (d + sqrt ((d * d) - (4 * d))) / 2; ld b = (d - sqrt ((d * d) - (4 * d))) / 2; cout << fixed << setprecision (9) << "Y " << a << " " << b << "\n"; } int main () { ios_base::sync_with_stdio (0); cin.tie (0); cout.tie (0); ll t; cin >> t; while (t--) solve (); }
19.540541
71
0.470263
MaGnsio
b8a7b79c89288860224ae75b3a34c6d0a1c730ba
8,451
cpp
C++
openstudiocore/src/utilities/core/System.cpp
BIMDataHub/OpenStudio-1
13ec115b00aa6a2af1426ceb26446f05014c8c8d
[ "blessing" ]
4
2015-05-02T21:04:15.000Z
2015-10-28T09:47:22.000Z
openstudiocore/src/utilities/core/System.cpp
BIMDataHub/OpenStudio-1
13ec115b00aa6a2af1426ceb26446f05014c8c8d
[ "blessing" ]
null
null
null
openstudiocore/src/utilities/core/System.cpp
BIMDataHub/OpenStudio-1
13ec115b00aa6a2af1426ceb26446f05014c8c8d
[ "blessing" ]
1
2020-11-12T21:52:36.000Z
2020-11-12T21:52:36.000Z
/********************************************************************** * Copyright (c) 2008-2015, Alliance for Sustainable Energy. * All rights reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA **********************************************************************/ #include "System.hpp" #include "Application.hpp" #include <boost/lexical_cast.hpp> #include <boost/thread.hpp> #include <boost/numeric/ublas/matrix.hpp> #include <boost/numeric/ublas/matrix_sparse.hpp> #include <boost/numeric/ublas/io.hpp> #include <boost/numeric/ublas/matrix_proxy.hpp> #include <boost/numeric/ublas/triangular.hpp> #include <boost/numeric/ublas/lu.hpp> #include <cassert> namespace openstudio{ #ifdef _WINDOWS #define _WIN32_WINNT 0x0500 #include <windows.h> /// return the amount of time that the system has been idle boost::optional<Time> System::systemIdleTime() { boost::optional<Time> result; LASTINPUTINFO lastInput; lastInput.cbSize = sizeof(LASTINPUTINFO); if (GetLastInputInfo(&lastInput)){ // current system up time in MS, lastInput is referenced to this // maximum value is 49.7 days, how telling..... DWORD tickCount = GetTickCount(); // idle milliseconds unsigned idleMS = boost::lexical_cast<unsigned>(tickCount-lastInput.dwTime); // use integer division like a pro result = Time(0,0,0,idleMS/1000); } return result; } #else /// return the amount of time that the system has been idle boost::optional<Time> System::systemIdleTime() { return boost::optional<Time>(); } #endif void System::msleep(int msecs) { boost::posix_time::ptime start = boost::posix_time::microsec_clock::universal_time(); int remainingtime = msecs; while ( remainingtime > 0 ) { bool didwork = openstudio::Application::instance().processEvents(remainingtime); remainingtime = msecs - (boost::posix_time::microsec_clock::universal_time() - start).total_milliseconds(); // std::cout << "time " << msecs << " remainingtime " << remainingtime << std::endl; int timetosleep = 0; if (remainingtime > 0) { if (didwork) { timetosleep = 1; // it was working, let it keep processing after a yield } else { timetosleep = remainingtime<10?remainingtime:10; } } #ifdef _WINDOWS Sleep(timetosleep); #else usleep(timetosleep * 1000); #endif } openstudio::Application::instance().processEvents(); // process any outstanding events } unsigned System::numberOfProcessors() { unsigned numberOfProcessors = boost::thread::hardware_concurrency(); if (numberOfProcessors < 1){ numberOfProcessors = 1; } return numberOfProcessors; } void System::testExceptions1() { try { std::cout << "testExceptions1: Test 1" << std::endl; throw std::exception(); } catch (const std::exception &) { } try { std::cout << "testExceptions1: Test 2" << std::endl; throw std::exception(); } catch (...) { } } void System::testExceptions2() { try { std::cout << "testExceptions2: Test 1" << std::endl; throw std::runtime_error("test"); } catch (const std::runtime_error &) { } try { std::cout << "testExceptions2: Test 2" << std::endl; throw std::runtime_error("test"); } catch (const std::exception &) { } try { std::cout << "testExceptions2: Test 3" << std::endl; throw std::runtime_error("test"); } catch (...) { } } void System::testExceptions5() { using namespace boost::numeric::ublas; using namespace std; struct BreakUBlas { static bool invertMatrix(matrix<double>& orig, matrix<double>& inverted) { typedef permutation_matrix<std::size_t> pmatrix; matrix<double> A(orig); pmatrix pm(A.size1()); // perform LU-factorization int res = lu_factorize(A,pm); if( res != 0 ) return false; inverted.assign(identity_matrix<double>(A.size1())); lu_substitute(A, pm, inverted); return true; }; static void breakIt() { double data[6][6] = {{15, 29700, 472042, 7.8021e+06, 1.32426e+08, 2.29091e+09}, {29700,1.32426e+08,2.29091e+09,4.01989e+10,7.13142e+11,1.27611e+13}, {472042,2.29091e+09,4.01989e+10,7.13142e+11,1.27611e+13,2.29941e+14}, {7.8021e+06,4.01989e+10,7.13142e+11,1.27611e+13,2.29941e+14,4.16694e+15}, {1.32426e+08,7.13142e+11,1.27611e+13,2.29941e+14,4.16694e+15,7.58705e+16}, {2.29091e+09,1.27611e+13,2.29941e+14,4.16694e+15,7.58705e+16,1.38694e+18}}; matrix<double> a(6, 6); for (unsigned i = 0; i < a.size1 (); ++i) for (unsigned j = 0; j < a.size2 (); ++j) a(i, j) = data[i][j]; matrix<double> b(a); invertMatrix(a, b); } }; try { std::cout << "testExceptions5: Test 1" << std::endl; BreakUBlas::breakIt(); assert(!"Exception Not Thrown"); } catch (boost::numeric::ublas::internal_logic &) { } try { std::cout << "testExceptions5: Test 2" << std::endl; BreakUBlas::breakIt(); assert(!"Exception Not Thrown"); } catch (std::logic_error &) { } try { std::cout << "testExceptions5: Test 3" << std::endl; BreakUBlas::breakIt(); assert(!"Exception Not Thrown"); } catch (std::exception &) { } } void System::testExceptions3() { class MyException : public std::runtime_error { public: MyException() : std::runtime_error("exception") {} virtual ~MyException() throw() {} }; try { std::cout << "testExceptions3: Test 1" << std::endl; throw MyException(); } catch (const MyException &) { } try { std::cout << "testExceptions3: Test 2" << std::endl; throw MyException(); } catch (const std::runtime_error &) { } try { std::cout << "testExceptions3: Test 3" << std::endl; throw MyException(); } catch (const std::exception &) { } try { std::cout << "testExceptions3: Test 4" << std::endl; throw MyException(); } catch (...) { } } void System::testExceptions4() { class MyException : public std::runtime_error { public: MyException() : std::runtime_error("exception") {} virtual ~MyException() throw() {} }; class MyException2 : public MyException { public: MyException2() {} virtual ~MyException2() throw() {} }; try { std::cout << "testExceptions4: Test 1" << std::endl; throw MyException2(); } catch (const MyException2 &) { } try { std::cout << "testExceptions4: Test 2" << std::endl; throw MyException2(); } catch (const MyException &) { } try { std::cout << "testExceptions4: Test 3" << std::endl; throw MyException2(); } catch (const std::runtime_error &) { } try { std::cout << "testExceptions4: Test 4" << std::endl; throw MyException2(); } catch (const std::exception &) { } try { std::cout << "testExceptions4: Test 5" << std::endl; throw MyException2(); } catch (...) { } } } // openstudio
26.914013
114
0.568572
BIMDataHub
b8ac2b1f6429115981daf70980d15abdb730ed60
6,737
cpp
C++
samplecode/psi/Networking/AbstractNetworkOps.cpp
juniuszhou/incubator-mesatee-sgx
63970120ffe0b2899909407dff1f449ddd0294a0
[ "Apache-2.0" ]
1
2021-04-06T05:53:44.000Z
2021-04-06T05:53:44.000Z
samplecode/psi/Networking/AbstractNetworkOps.cpp
juniuszhou/incubator-mesatee-sgx
63970120ffe0b2899909407dff1f449ddd0294a0
[ "Apache-2.0" ]
null
null
null
samplecode/psi/Networking/AbstractNetworkOps.cpp
juniuszhou/incubator-mesatee-sgx
63970120ffe0b2899909407dff1f449ddd0294a0
[ "Apache-2.0" ]
5
2019-05-23T02:54:44.000Z
2019-07-03T02:32:52.000Z
// Copyright (C) 2017-2019 Baidu, 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: // // * 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 Baidu, Inc., 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 L IABILITY, 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 "AbstractNetworkOps.h" #include <boost/lexical_cast.hpp> #include <boost/algorithm/string.hpp> using namespace util; AbstractNetworkOps::AbstractNetworkOps(boost::asio::io_service& io_service, boost::asio::ssl::context& context) : socket_(io_service, context) {} AbstractNetworkOps::~AbstractNetworkOps() {} AbstractNetworkOps::ssl_socket::lowest_layer_type& AbstractNetworkOps::socket() { return socket_.lowest_layer(); } void AbstractNetworkOps::saveCloseSocket() { boost::system::error_code ec; socket_.lowest_layer().cancel(); if (ec) { stringstream ss; Log("Socket shutdown error: %s", ec.message()); } else { socket_.lowest_layer().close(); } } void AbstractNetworkOps::read() { this->read_state = MSG_HEADER; memset(this->read_buffer_header, '\0', 20); boost::asio::async_read( socket_, boost::asio::buffer(this->read_buffer_header, 20), boost::bind( &AbstractNetworkOps::handle_read, this, boost::asio::placeholders::error, boost::asio::placeholders::bytes_transferred)); } void AbstractNetworkOps::handle_read(const boost::system::error_code& error, size_t bytes_transferred) { if (error) { if ((boost::asio::error::eof == error) || (boost::asio::error::connection_reset == error)) { Log("Connection has been closed by remote host"); } else { Log("Unknown socket error while reading occured!", log::error); } return; } vector<string> header; boost::split(header, this->read_buffer_header, boost::is_any_of("@")); int msg_size = boost::lexical_cast<int>(header[0]); int type = boost::lexical_cast<int>(header[1]); if (this->read_state == MSG_HEADER) { this->read_state = MSG_BODY; this->read_buffer_message = (char*) malloc(sizeof(char) * msg_size); memset(this->read_buffer_message, '\0', sizeof(char) * msg_size); boost::asio::async_read( socket_, boost::asio::buffer(this->read_buffer_message, msg_size), boost::bind( &AbstractNetworkOps::handle_read, this, boost::asio::placeholders::error, boost::asio::placeholders::bytes_transferred)); } else if (this->read_state == MSG_BODY) { process_read(this->read_buffer_message, msg_size, type); } } void AbstractNetworkOps::send(vector<string> v) { string type = v[0]; string msg = v[1]; if (msg.size() <= 0) { this->saveCloseSocket(); return; } const char *msg_c = msg.c_str(); int msg_length = msg.size(); string header = to_string(msg_length) + "@" + type; memset(this->write_buffer_header, '\0', 20); memcpy(this->write_buffer_header, header.c_str(), header.length()); this->write_buffer_message = (char*) malloc(sizeof(char) * msg_length); memset(this->write_buffer_message, '\0', sizeof(char) * msg_length); memcpy(this->write_buffer_message, msg_c, msg_length); this->write_state = MSG_HEADER; boost::asio::async_write( socket_, boost::asio::buffer(this->write_buffer_header, 20), boost::asio::transfer_at_least(20), boost::bind( &AbstractNetworkOps::handle_write, this, boost::asio::placeholders::error, boost::asio::placeholders::bytes_transferred)); } void AbstractNetworkOps::handle_write(const boost::system::error_code& error, size_t bytes_transferred) { if (error) { if ((boost::asio::error::eof == error) || (boost::asio::error::connection_reset == error)) { Log("Connection has been closed by remote host"); } else { Log("Unknown socket error while writing occured!", log::error); } return; } vector<string> header; boost::split(header, this->write_buffer_header, boost::is_any_of("@")); int msg_size = boost::lexical_cast<int>(header[0]); int type = boost::lexical_cast<int>(header[1]); if (this->write_state == MSG_HEADER) { this->write_state = MSG_BODY; boost::asio::async_write( socket_, boost::asio::buffer(this->write_buffer_message, msg_size), boost::asio::transfer_at_least(msg_size), boost::bind( &AbstractNetworkOps::handle_write, this, boost::asio::placeholders::error, boost::asio::placeholders::bytes_transferred)); } else if (this->write_state == MSG_BODY) { free(this->write_buffer_message); this->read(); } } void AbstractNetworkOps::setCallbackHandler(CallbackHandler cb) { this->callback_handler = cb; } void AbstractNetworkOps::process_read(char* buffer, int msg_size, int type) { std::string str(reinterpret_cast<const char*>(buffer), msg_size); free(buffer); auto msg = this->callback_handler(str, type); if (msg.size() > 0 && msg[0].size() > 0) { send(msg); } else { Log("Close connection"); this->saveCloseSocket(); } }
34.372449
145
0.654891
juniuszhou
b8b09cb873f39c39cadfd4d13d084a9e83f23cb0
15,587
cpp
C++
libs/fnd/type_traits/test/src/unit_test_fnd_type_traits_is_nothrow_move_assignable.cpp
myoukaku/bksge
0f8b60e475a3f1709723906e4796b5e60decf06e
[ "MIT" ]
4
2018-06-10T13:35:32.000Z
2021-06-03T14:27:41.000Z
libs/fnd/type_traits/test/src/unit_test_fnd_type_traits_is_nothrow_move_assignable.cpp
myoukaku/bksge
0f8b60e475a3f1709723906e4796b5e60decf06e
[ "MIT" ]
566
2017-01-31T05:36:09.000Z
2022-02-09T05:04:37.000Z
libs/fnd/type_traits/test/src/unit_test_fnd_type_traits_is_nothrow_move_assignable.cpp
myoukaku/bksge
0f8b60e475a3f1709723906e4796b5e60decf06e
[ "MIT" ]
1
2018-07-05T04:40:53.000Z
2018-07-05T04:40:53.000Z
/** * @file unit_test_fnd_type_traits_is_nothrow_move_assignable.cpp * * @brief is_nothrow_move_assignable のテスト * * @author myoukaku */ #include <bksge/fnd/type_traits/is_nothrow_move_assignable.hpp> #include <bksge/fnd/config.hpp> #include <gtest/gtest.h> #include <cstddef> #include "type_traits_test_utility.hpp" #if defined(BKSGE_HAS_CXX14_VARIABLE_TEMPLATES) #define BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(b, T) \ static_assert(bksge::is_nothrow_move_assignable_v<T> == b, #T ", " #b); \ static_assert(bksge::is_nothrow_move_assignable<T>::value == b, #T ", " #b); \ static_assert(bksge::is_nothrow_move_assignable<T>() == b, #T ", " #b) #else #define BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(b, T) \ static_assert(bksge::is_nothrow_move_assignable<T>::value == b, #T ", " #b); \ static_assert(bksge::is_nothrow_move_assignable<T>() == b, #T ", " #b) #endif namespace bksge_type_traits_test { namespace is_nothrow_move_assignable_test { // トリビアルなムーブ代入演算子を持つ struct S1 { int n; }; // 非トリビアルだが例外を投げないムーブ代入演算子を持つ struct S2 { S2& operator=(S2&&) BKSGE_NOEXCEPT_OR_NOTHROW; }; // 非トリビアルだが例外を投げないムーブ代入演算子を持つクラスをメンバに持つ struct S3 { S2 member; }; // ムーブ代入演算子が例外を投げる struct S4 { S4& operator=(S4&&); }; // ムーブ代入演算子が例外を投げる struct S5 { S5& operator=(S5&&) BKSGE_NOEXCEPT_IF(false); }; // ムーブ代入演算子を持たない struct S6 { S6& operator=(S6&&) = delete; }; BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(true, S1); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(true, S2); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(true, S3); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, S4); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, S5); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, S6); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(true, int); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, const int); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(true, volatile int); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, const volatile int); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(true, int*); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(true, const int*); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(true, volatile int*); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(true, const volatile int*); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(true, int&); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, const int&); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(true, volatile int&); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, const volatile int&); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(true, int&&); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, const int&&); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(true, volatile int&&); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, const volatile int&&); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, int[2]); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, int[]); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, int(&)[2]); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, int(&)[]); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, int(&&)[2]); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, int(&&)[]); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, void); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, const void); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, volatile void); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, const volatile void); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(true, bool); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(true, char); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(true, wchar_t); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(true, signed char); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(true, int); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(true, short); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(true, long); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(true, long long); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(true, unsigned char); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(true, unsigned int); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(true, unsigned short); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(true, unsigned long); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(true, unsigned long long); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(true, std::size_t); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(true, float); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(true, double); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(true, long double); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(true, void*); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(true, std::nullptr_t); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(true, decltype(nullptr)); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(true, enum_UDT); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(true, enum_uint32_t_UDT); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(true, enum_uint16_t_UDT); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(true, enum_uint8_t_UDT); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(true, enum_int32_t_UDT); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(true, enum_int16_t_UDT); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(true, enum_int8_t_UDT); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(true, enum_class_UDT); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(true, enum_class_uint32_t_UDT); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(true, enum_class_uint16_t_UDT); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(true, enum_class_uint8_t_UDT); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(true, enum_class_int32_t_UDT); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(true, enum_class_int16_t_UDT); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(true, enum_class_int8_t_UDT); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, UDT); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, const UDT); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, volatile UDT); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, const volatile UDT); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(true, UDT*); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(true, const UDT*); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(true, volatile UDT*); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(true, const volatile UDT*); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, UDT&); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, const UDT&); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, volatile UDT&); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, const volatile UDT&); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, UDT&&); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, const UDT&&); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, volatile UDT&&); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, const volatile UDT&&); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, UDT[2]); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, UDT[]); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, UDT(&)[2]); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, UDT(&)[]); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, UDT(&&)[2]); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, UDT(&&)[]); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(true, POD_UDT); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, const POD_UDT); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, volatile POD_UDT); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, const volatile POD_UDT); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(true, POD_UDT*); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(true, const POD_UDT*); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(true, volatile POD_UDT*); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(true, const volatile POD_UDT*); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(true, POD_UDT&); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, const POD_UDT&); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, volatile POD_UDT&); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, const volatile POD_UDT&); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(true, POD_UDT&&); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, const POD_UDT&&); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, volatile POD_UDT&&); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, const volatile POD_UDT&&); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, POD_UDT[2]); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, POD_UDT[]); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, POD_UDT(&)[2]); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, POD_UDT(&)[]); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, POD_UDT(&&)[2]); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, POD_UDT(&&)[]); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, nothrow_default_ctor_UDT); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, const nothrow_default_ctor_UDT); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, volatile nothrow_default_ctor_UDT); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, const volatile nothrow_default_ctor_UDT); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, nothrow_default_ctor_UDT&); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, const nothrow_default_ctor_UDT&); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, volatile nothrow_default_ctor_UDT&); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, const volatile nothrow_default_ctor_UDT&); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, nothrow_default_ctor_UDT&&); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, const nothrow_default_ctor_UDT&&); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, volatile nothrow_default_ctor_UDT&&); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, const volatile nothrow_default_ctor_UDT&&); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, nothrow_dtor_UDT); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, const nothrow_dtor_UDT); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, volatile nothrow_dtor_UDT); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, const volatile nothrow_dtor_UDT); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, nothrow_dtor_UDT&); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, const nothrow_dtor_UDT&); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, volatile nothrow_dtor_UDT&); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, const volatile nothrow_dtor_UDT&); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, nothrow_dtor_UDT&&); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, const nothrow_dtor_UDT&&); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, volatile nothrow_dtor_UDT&&); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, const volatile nothrow_dtor_UDT&&); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, nothrow_copy_ctor_UDT); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, const nothrow_copy_ctor_UDT); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, volatile nothrow_copy_ctor_UDT); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, const volatile nothrow_copy_ctor_UDT); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, nothrow_copy_ctor_UDT&); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, const nothrow_copy_ctor_UDT&); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, volatile nothrow_copy_ctor_UDT&); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, const volatile nothrow_copy_ctor_UDT&); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, nothrow_copy_ctor_UDT&&); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, const nothrow_copy_ctor_UDT&&); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, volatile nothrow_copy_ctor_UDT&&); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, const volatile nothrow_copy_ctor_UDT&&); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, nothrow_copy_assign_UDT); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, const nothrow_copy_assign_UDT); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, volatile nothrow_copy_assign_UDT); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, const volatile nothrow_copy_assign_UDT); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(true, nothrow_copy_assign_UDT&); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, const nothrow_copy_assign_UDT&); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, volatile nothrow_copy_assign_UDT&); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, const volatile nothrow_copy_assign_UDT&); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, nothrow_copy_assign_UDT&&); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, const nothrow_copy_assign_UDT&&); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, volatile nothrow_copy_assign_UDT&&); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, const volatile nothrow_copy_assign_UDT&&); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, nothrow_move_ctor_UDT); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, const nothrow_move_ctor_UDT); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, volatile nothrow_move_ctor_UDT); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, const volatile nothrow_move_ctor_UDT); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, nothrow_move_ctor_UDT&); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, const nothrow_move_ctor_UDT&); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, volatile nothrow_move_ctor_UDT&); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, const volatile nothrow_move_ctor_UDT&); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, nothrow_move_ctor_UDT&&); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, const nothrow_move_ctor_UDT&&); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, volatile nothrow_move_ctor_UDT&&); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, const volatile nothrow_move_ctor_UDT&&); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(true, nothrow_move_assign_UDT); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, const nothrow_move_assign_UDT); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, volatile nothrow_move_assign_UDT); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, const volatile nothrow_move_assign_UDT); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, nothrow_move_assign_UDT&); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, const nothrow_move_assign_UDT&); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, volatile nothrow_move_assign_UDT&); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, const volatile nothrow_move_assign_UDT&); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(true, nothrow_move_assign_UDT&&); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, const nothrow_move_assign_UDT&&); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, volatile nothrow_move_assign_UDT&&); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, const volatile nothrow_move_assign_UDT&&); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(true, f1); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(true, f2); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(true, f3); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(true, mf1); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(true, mf2); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(true, mf3); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(true, mf4); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(true, mp); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(true, cmf); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, foo0_t); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, foo1_t); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, foo2_t); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, foo3_t); BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST(false, foo4_t); } // namespace is_nothrow_move_assignable_test } // namespace bksge_type_traits_test #undef BKSGE_IS_NOTHROW_MOVE_ASSIGNABLE_TEST
54.5
89
0.796561
myoukaku
b8b5202e27369a74430aa130db68501ff6891eec
7,644
cpp
C++
mobile/src/operators/kernel/fpga/V2/psroi_pool_kernel.cpp
hcj5206/Paddle-Lite
eed7a506cef5d2ba6a076a34e4f51d3b5f60cddd
[ "Apache-2.0" ]
1
2019-08-21T05:54:42.000Z
2019-08-21T05:54:42.000Z
mobile/src/operators/kernel/fpga/V2/psroi_pool_kernel.cpp
hcj5206/Paddle-Lite
eed7a506cef5d2ba6a076a34e4f51d3b5f60cddd
[ "Apache-2.0" ]
null
null
null
mobile/src/operators/kernel/fpga/V2/psroi_pool_kernel.cpp
hcj5206/Paddle-Lite
eed7a506cef5d2ba6a076a34e4f51d3b5f60cddd
[ "Apache-2.0" ]
1
2019-10-11T09:34:49.000Z
2019-10-11T09:34:49.000Z
/* Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #ifdef PSROI_POOL_OP #include <cmath> #include <vector> #include "operators/kernel/detection_kernel.h" #include "fpga/V2/api.h" #include "fpga/V2/image.h" namespace paddle_mobile { namespace operators { template <> bool PSRoiPoolKernel<FPGA, float>::Init(PSRoiPoolParam<FPGA>* param) { auto dims = param->input_x_->dims(); PADDLE_MOBILE_ENFORCE(dims[1] * dims[3] % IMAGE_ALIGNMENT == 0, "data not aligned"); param->float_input = std::make_shared<Tensor>(); param->float_input->mutable_data<float>(param->input_x_->dims()); auto* rois = param->input_rois_; int rois_num = rois->dims()[0]; framework::DDim dims_out_new = framework::make_ddim( {rois_num, param->output_->dims()[1], param->output_->dims()[2], param->output_->dims()[3]}); param->output_->Resize(dims_out_new); param->output_->mutable_data<float>(dims_out_new); return true; } template <typename Dtype> void PSROIPoolingForward(const Dtype* bottom_data, const int height, const int width, const int input_channel, Dtype* top_data, const int pooled_height, const int pooled_width, const int output_channel, const Dtype* bottom_rois, const Dtype Bin_size_h, const Dtype Bin_size_w, const Dtype roi_start_h, const Dtype roi_start_w, const int pw, const int ph, const int roi_batch_ind) { int hstart = floor(static_cast<Dtype>(ph) * Bin_size_h + roi_start_h); int wstart = floor(static_cast<Dtype>(pw) * Bin_size_w + roi_start_w); int hend = ceil(static_cast<Dtype>(ph + 1) * Bin_size_h + roi_start_h); int wend = ceil(static_cast<Dtype>(pw + 1) * Bin_size_w + roi_start_w); // Add roi offsets and clip to input boundaries hstart = std::min(std::max(hstart, 0), height); hend = std::min(std::max(hend, 0), height); wstart = std::min(std::max(wstart, 0), width); wend = std::min(std::max(wend, 0), width); bool is_empty = (hend <= hstart) || (wend <= wstart); float sum_pixels_c[output_channel] = {0}; float pixels_c[output_channel] = {0}; if (!is_empty) { Dtype bin_area = (hend - hstart) * (wend - wstart); float rec_bin_area = 1 / bin_area; for (int h = hstart; h < hend; ++h) { for (int w = wstart; w < wend; ++w) { int pixel_offset = (h * width + w) * input_channel; for (int output_c = 0; output_c < output_channel; output_c++) { int input_channel_offset = output_c * pooled_height * pooled_width; int input_bias = pixel_offset + input_channel_offset + ph * pooled_width + pw; pixels_c[output_c] = bottom_data[input_bias]; } for (int output_c = 0; output_c < output_channel; output_c++) { sum_pixels_c[output_c] += pixels_c[output_c]; } } } for (int output_c = 0; output_c < output_channel; output_c++) { sum_pixels_c[output_c] *= rec_bin_area; } } int output_index_base = (ph * pooled_width + pw) * output_channel; top_data += output_index_base; memcpy(top_data, sum_pixels_c, output_channel * 4); } template <> void PSRoiPoolKernel<FPGA, float>::Compute(const PSRoiPoolParam<FPGA>& param) { auto input_tensor = param.input_x_; auto input_data = input_tensor->data<int8_t>(); auto Si = input_tensor->scale[0]; auto float_input_tensor = param.float_input.get(); auto float_input_data = float_input_tensor->data<float>(); for (int i = 0; i < float_input_tensor->numel(); i++) { float_input_data[i] = input_data[i] / 127.0 * Si; } auto* in = float_input_tensor; auto* rois = param.input_rois_; auto* out = param.output_; auto pooled_height = param.pooled_height_; auto pooled_width = param.pooled_width_; auto spatial_scale = param.spatial_scale_; auto output_channels = param.output_channels_; auto in_dims = in->dims(); int batch_size = in_dims[0]; int input_channels = in_dims[1]; int height = in_dims[2]; int width = in_dims[3]; int rois_num = rois->dims()[0]; auto data_nhwc = in->mutable_data<float>(); framework::DDim dims_out_new = framework::make_ddim( {rois_num, (param.output_)->dims()[1], (((param.output_)->dims()[2])), (param.output_)->dims()[3]}); (param.output_)->Resize(dims_out_new); const float* input_data_tmp = data_nhwc; // in->data<float>(); framework::Tensor rois_batch_id_list; rois_batch_id_list.Resize({rois_num}); auto rois_batch_id_data = rois_batch_id_list.mutable_data<int>(); PADDLE_MOBILE_ENFORCE(rois->NumLevels() > 0, "ROIS should not be empty"); auto rois_lod = rois->lod().back(); int rois_batch_size = rois_lod.size() - 1; PADDLE_MOBILE_ENFORCE( rois_batch_size == batch_size, "the rois_batch_size and input(X) batch_size should be the same."); int rois_num_with_lod = rois_lod[rois_batch_size]; PADDLE_MOBILE_ENFORCE(rois_num_with_lod == rois_num, "the rois_num from input and lod must be the same"); PADDLE_MOBILE_ENFORCE( input_channels == output_channels * pooled_height * pooled_width, "the channels of input X should equal the product of " "output_channels x pooled_height x pooled_width"); // calculate batch id index for each roi according to LoD for (int n = 0; n < rois_batch_size; ++n) { for (size_t i = rois_lod[n]; i < rois_lod[n + 1]; ++i) { rois_batch_id_data[i] = n; } } auto output_data = out->mutable_data<float>(); auto input_rois = rois->data<float>(); for (int n = 0; n < rois_num; ++n) { auto offset_input_rois = input_rois + n * 4; auto offset_output_data = output_data + pooled_height * pooled_width * output_channels * n; auto roi_start_w = static_cast<float>(round(offset_input_rois[0])) * spatial_scale; auto roi_start_h = static_cast<float>(round(offset_input_rois[1])) * spatial_scale; auto roi_end_w = static_cast<float>(round(offset_input_rois[2]) + 1.) * spatial_scale; auto roi_end_h = static_cast<float>(round(offset_input_rois[3]) + 1.) * spatial_scale; // Force too small rois to be 1 x 1 auto roi_height = std::max(roi_end_h - roi_start_h, 0.1f); // avoid 0 auto roi_width = std::max(roi_end_w - roi_start_w, 0.1f); // Compute bin size w and h at input feature map auto bin_size_h = roi_height / static_cast<float>(pooled_height); auto bin_size_w = roi_width / static_cast<float>(pooled_width); int roi_batch_ind = rois_batch_id_data[n]; for (int ph = 0; ph < pooled_height; ph++) { for (int pw = 0; pw < pooled_width; pw++) { PSROIPoolingForward<float>( input_data_tmp, height, width, input_channels, offset_output_data, pooled_height, pooled_width, output_channels, input_rois, bin_size_h, bin_size_w, roi_start_h, roi_start_w, pw, ph, roi_batch_ind); } } } } } // namespace operators } // namespace paddle_mobile #endif // PSROI_POOL_OP
37.655172
79
0.669021
hcj5206
b8b78ce03ce88990d5527bc5b35bf80976b92c48
10,392
cpp
C++
red-microdnf/microdnf/commands/advisory/advisory.cpp
redpesk-labs/red-pak
bd11881f50ae627a0641448ae0b307a9a9e2877e
[ "Apache-2.0" ]
5
2021-02-24T09:00:36.000Z
2022-02-10T16:37:10.000Z
red-microdnf/microdnf/commands/advisory/advisory.cpp
redpesk-labs/red-pak
bd11881f50ae627a0641448ae0b307a9a9e2877e
[ "Apache-2.0" ]
null
null
null
red-microdnf/microdnf/commands/advisory/advisory.cpp
redpesk-labs/red-pak
bd11881f50ae627a0641448ae0b307a9a9e2877e
[ "Apache-2.0" ]
null
null
null
/* Copyright (C) 2021 Red Hat, Inc. This file is part of microdnf: https://github.com/rpm-software-management/libdnf/ Microdnf is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version. Microdnf 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 microdnf. If not, see <https://www.gnu.org/licenses/>. */ #include "advisory.hpp" #include "../../context.hpp" #include <libdnf/conf/option_string.hpp> #include <libdnf/rpm/package_query.hpp> //TODO(amatej): just for test output -> remove #include <iostream> namespace microdnf { using namespace libdnf::cli; void CmdAdvisory::set_argument_parser(Context & ctx) { availability_option = dynamic_cast<libdnf::OptionEnum<std::string> *>( ctx.arg_parser.add_init_value(std::unique_ptr<libdnf::OptionEnum<std::string>>( new libdnf::OptionEnum<std::string>("available", {"all", "available", "installed", "updates"})))); auto all = ctx.arg_parser.add_new_named_arg("all"); all->set_long_name("all"); all->set_short_description("show advisories about any version of installed packages"); all->set_const_value("all"); all->link_value(availability_option); auto available = ctx.arg_parser.add_new_named_arg("available"); available->set_long_name("available"); available->set_short_description("show advisories about newer versions of installed packages (default)"); available->set_const_value("available"); available->link_value(availability_option); auto installed = ctx.arg_parser.add_new_named_arg("installed"); installed->set_long_name("installed"); installed->set_short_description("show advisories about equal and older versions of installed packages"); installed->set_const_value("installed"); installed->link_value(availability_option); auto updates = ctx.arg_parser.add_new_named_arg("updates"); updates->set_long_name("updates"); updates->set_short_description( "show advisories about newer versions of installed packages for which a newer version is available"); updates->set_const_value("updates"); updates->link_value(availability_option); auto conflict_args = ctx.arg_parser.add_conflict_args_group(std::unique_ptr<std::vector<ArgumentParser::Argument *>>( new std::vector<ArgumentParser::Argument *>{all, available, installed, updates})); all->set_conflict_arguments(conflict_args); available->set_conflict_arguments(conflict_args); installed->set_conflict_arguments(conflict_args); updates->set_conflict_arguments(conflict_args); patterns_to_show_options = ctx.arg_parser.add_new_values(); auto specs = ctx.arg_parser.add_new_positional_arg( "specs_to_show", ArgumentParser::PositionalArg::UNLIMITED, ctx.arg_parser.add_init_value(std::unique_ptr<libdnf::Option>(new libdnf::OptionString(nullptr))), patterns_to_show_options); specs->set_short_description("List of specs to use when searching for advisory"); output_type_option = dynamic_cast<libdnf::OptionEnum<std::string> *>( ctx.arg_parser.add_init_value(std::unique_ptr<libdnf::OptionEnum<std::string>>( new libdnf::OptionEnum<std::string>("summary", {"summary", "list", "info"})))); auto summary = ctx.arg_parser.add_new_named_arg("summary"); summary->set_long_name("summary"); summary->set_short_description("show just counts of advisory types (default)"); summary->set_const_value("summary"); summary->link_value(output_type_option); auto list = ctx.arg_parser.add_new_named_arg("list"); list->set_long_name("list"); list->set_short_description("show list of advisories"); list->set_const_value("list"); list->link_value(output_type_option); auto info = ctx.arg_parser.add_new_named_arg("info"); info->set_long_name("info"); info->set_short_description("show detailed information about advisories"); info->set_const_value("info"); info->link_value(output_type_option); conflict_args = ctx.arg_parser.add_conflict_args_group(std::unique_ptr<std::vector<ArgumentParser::Argument *>>( new std::vector<ArgumentParser::Argument *>{summary, list, info})); summary->set_conflict_arguments(conflict_args); list->set_conflict_arguments(conflict_args); info->set_conflict_arguments(conflict_args); with_cve_option = dynamic_cast<libdnf::OptionBool *>( ctx.arg_parser.add_init_value(std::unique_ptr<libdnf::OptionBool>(new libdnf::OptionBool(false)))); auto with_cve = ctx.arg_parser.add_new_named_arg("with_cve"); with_cve->set_long_name("with_cve"); with_cve->set_short_description("show only advisories with CVE reference"); with_cve->set_const_value("false"); with_cve->link_value(with_cve_option); with_bz_option = dynamic_cast<libdnf::OptionBool *>( ctx.arg_parser.add_init_value(std::unique_ptr<libdnf::OptionBool>(new libdnf::OptionBool(false)))); auto with_bz = ctx.arg_parser.add_new_named_arg("with_bz"); with_bz->set_long_name("with_bz"); with_bz->set_short_description("show only advisories with bugzilla reference"); with_bz->set_const_value("false"); with_bz->link_value(with_bz_option); auto advisory = ctx.arg_parser.add_new_command("advisory"); advisory->set_short_description("display information about update advisories"); advisory->set_description(""); advisory->set_named_args_help_header("Optional arguments:"); advisory->set_positional_args_help_header("Positional arguments:"); advisory->set_parse_hook_func([this, &ctx]( [[maybe_unused]] ArgumentParser::Argument * arg, [[maybe_unused]] const char * option, [[maybe_unused]] int argc, [[maybe_unused]] const char * const argv[]) { ctx.select_command(this); return true; }); advisory->register_named_arg(all); advisory->register_named_arg(available); advisory->register_named_arg(installed); advisory->register_named_arg(updates); advisory->register_named_arg(summary); advisory->register_named_arg(list); advisory->register_named_arg(info); advisory->register_named_arg(with_cve); advisory->register_named_arg(with_bz); advisory->register_positional_arg(specs); ctx.arg_parser.get_root_command()->register_command(advisory); } void CmdAdvisory::run(Context & ctx) { std::vector<std::string> patterns_to_show; if (patterns_to_show_options->size() > 0) { patterns_to_show.reserve(patterns_to_show_options->size()); for (auto & pattern : *patterns_to_show_options) { auto option = dynamic_cast<libdnf::OptionString *>(pattern.get()); patterns_to_show.emplace_back(option->get_value()); } } auto package_sack = ctx.base.get_rpm_package_sack(); package_sack->create_system_repo(false); libdnf::repo::RepoQuery enabled_repos(ctx.base); enabled_repos.filter_enabled(true); using LoadFlags = libdnf::rpm::PackageSack::LoadRepoFlags; ctx.load_rpm_repos(enabled_repos, LoadFlags::USE_UPDATEINFO); libdnf::rpm::PackageQuery package_query(ctx.base); using QueryCmp = libdnf::sack::QueryCmp; if (patterns_to_show.size() > 0) { package_query.filter_name(patterns_to_show, QueryCmp::IGLOB); } //DATA IS PREPARED //TODO(amatej): create advisory_query with filters on advisories prensent (if we want to limit by severity, reference..) auto advisory_query = libdnf::advisory::AdvisoryQuery(ctx.base); if (with_cve_option->get_value()) { advisory_query.filter_CVE("*", QueryCmp::IGLOB); } if (with_bz_option->get_value()) { advisory_query.filter_bug("*", QueryCmp::IGLOB); } //advisory_query.filter_name(QueryCmp::IGLOB, input_name); //advisory_query.filter_severity(QueryCmp::EQ, input_severity); std::vector<libdnf::advisory::AdvisoryPackage> result_pkgs; if (availability_option->get_value() == "installed") { auto installed_package_query = package_query.filter_installed(); result_pkgs = advisory_query.get_advisory_packages(installed_package_query, QueryCmp::LTE); } else if (availability_option->get_value() == "available") { //TODO(amatej): filter for latest and add kernel.. auto installed_package_query = package_query.filter_installed(); result_pkgs = advisory_query.get_advisory_packages(installed_package_query, QueryCmp::GT); } else if (availability_option->get_value() == "all") { auto installed_package_query = package_query.filter_installed(); result_pkgs = advisory_query.get_advisory_packages(installed_package_query, QueryCmp::LT | QueryCmp::EQ | QueryCmp::GT); } else if (availability_option->get_value() == "updates") { //auto upgradable_package_query = package_query.filter_upgradable().filter_nevra(keys, QueryCmp::GT); //result_pkgs = advisory_query.get_advisory_packages(upgradable_package_query, QueryCmp::LT | QueryCmp::EQ | QueryCmp::GT); } //TODO(amatej): output code move to libdnf-cli for (auto pkg : result_pkgs) { //auto adv = advisories_map.find(pkg.get_name() + "-" + pkg.get_arch()); //if (adv == advisories_map.end()) { // //std::cout << pkg.get_name() << std::endl << std::flush; std::cout << libdnf::advisory::Advisory(package_sack, libdnf::advisory::AdvisoryId(pkg.get_advisory_id())).get_name() << " - " << pkg.get_name() << "-" << pkg.get_evr() << "." << pkg.get_arch() << std::endl; //} else { // //std::cout << pkg.get_nevra() << " : " << advisories_map.find(pkg.get_name() + "-" + pkg.get_arch())->second.get()->get_name() << std::endl; // std::cout << pkg.get_nevra() << std::endl; // // std::cout << adv->first << std::endl; //} } } } // namespace microdnf
44.221277
155
0.705639
redpesk-labs
b8bac0e5d60cfff9a9be59952de077f3d2294cf1
3,546
cpp
C++
liblava/asset/write_image.cpp
TheLavaBlock/LavaBlock
fc2eadb75dfa58622a1941911f20fe31f8780f30
[ "MIT" ]
11
2018-10-26T02:15:53.000Z
2019-05-25T16:08:17.000Z
liblava/asset/write_image.cpp
TheLavaBlock/LavaBlock
fc2eadb75dfa58622a1941911f20fe31f8780f30
[ "MIT" ]
null
null
null
liblava/asset/write_image.cpp
TheLavaBlock/LavaBlock
fc2eadb75dfa58622a1941911f20fe31f8780f30
[ "MIT" ]
null
null
null
/** * @file liblava/asset/write_image.cpp * @brief Write image data to file * @authors Lava Block OÜ and contributors * @copyright Copyright (c) 2018-present, MIT License */ #include <liblava/asset/write_image.hpp> #include <liblava/resource/format.hpp> #define STB_IMAGE_WRITE_IMPLEMENTATION #include <stb_image_write.h> namespace lava { //----------------------------------------------------------------------------- bool write_image_png(device_p device, image::ptr image, string_ref filename, bool swizzle) { VkImageSubresource subResource{ VK_IMAGE_ASPECT_COLOR_BIT, 0, 0 }; VkSubresourceLayout subResourceLayout; vkGetImageSubresourceLayout(device->get(), image->get(), &subResource, &subResourceLayout); VmaAllocationInfo alloc_info{}; vmaGetAllocationInfo(device->get_allocator()->get(), image->get_allocation(), &alloc_info); char const* img_data_ptr = nullptr; vkMapMemory(device->get(), alloc_info.deviceMemory, 0, VK_WHOLE_SIZE, 0, (void**) &img_data_ptr); img_data_ptr += subResourceLayout.offset; data img_data(as_ptr(img_data_ptr), subResourceLayout.size); auto const img_data_block_size = format_block_size(image->get_format()); auto const size = image->get_size(); auto const width = size.x; auto const height = size.y; unique_data rgb_data(height * width * img_data_block_size); auto const rgb_data_format = VK_FORMAT_R8G8B8_UNORM; auto const rgb_data_block_size = format_block_size(rgb_data_format); if (swizzle) { for (auto y = 0u; y < height; ++y) { auto const row_rgb = y * width * rgb_data_block_size; auto const row_img = y * subResourceLayout.rowPitch; for (auto x = 0u; x < width; ++x) { rgb_data.ptr[(x * rgb_data_block_size) + row_rgb] = img_data.ptr[(x * img_data_block_size) + 2 + row_img]; rgb_data.ptr[(x * rgb_data_block_size) + 1 + row_rgb] = img_data.ptr[(x * img_data_block_size) + 1 + row_img]; rgb_data.ptr[(x * rgb_data_block_size) + 2 + row_rgb] = img_data.ptr[(x * img_data_block_size) + row_img]; } } } else { for (auto y = 0u; y < height; ++y) { auto const row_rgb = y * width * rgb_data_block_size; auto const row_img = y * subResourceLayout.rowPitch; for (auto x = 0u; x < width; ++x) { rgb_data.ptr[(x * rgb_data_block_size) + row_rgb] = img_data.ptr[(x * img_data_block_size) + row_img]; rgb_data.ptr[(x * rgb_data_block_size) + 1 + row_rgb] = img_data.ptr[(x * img_data_block_size) + 1 + row_img]; rgb_data.ptr[(x * rgb_data_block_size) + 2 + row_rgb] = img_data.ptr[(x * img_data_block_size) + 2 + row_img]; } } } vkUnmapMemory(device->get(), alloc_info.deviceMemory); return stbi_write_png(str(filename), width, height, rgb_data_block_size, rgb_data.ptr, width * rgb_data_block_size); } } // namespace lava
37.723404
79
0.545403
TheLavaBlock
b8bf5a2a3d963b36cde083ca61b3043efb6afa48
9,580
cpp
C++
old/src/resources/TexturePool.cpp
fuchstraumer/Caelestis
9c4b76288220681bb245d84e5d7bf8c7f69b2716
[ "MIT" ]
5
2018-08-16T00:55:33.000Z
2020-06-19T14:30:17.000Z
old/src/resources/TexturePool.cpp
fuchstraumer/Caelestis
9c4b76288220681bb245d84e5d7bf8c7f69b2716
[ "MIT" ]
null
null
null
old/src/resources/TexturePool.cpp
fuchstraumer/Caelestis
9c4b76288220681bb245d84e5d7bf8c7f69b2716
[ "MIT" ]
null
null
null
#include "resources/TexturePool.hpp" #include "command/TransferPool.hpp" #include "resource/DescriptorSet.hpp" #include "resource/DescriptorPool.hpp" #include "resource/DescriptorSetLayout.hpp" #include "util/easylogging++.h" #define STB_IMAGE_IMPLEMENTATION #include "stb/stb_image.h" namespace vpsk { TexturePool::TexturePool(const vpr::Device * dvc, const vpr::TransferPool * transfer_pool) : device(dvc), transferPool(transfer_pool) {} void TexturePool::AddMaterials(const std::vector<tinyobj::material_t>& materials, const std::string& path_prefix) { // Go through the given material and all the texture data to the texture data maps for (const auto& mtl : materials) { auto cmd = transferPool->Begin(); idxNameMap.emplace(idxNameMap.size(), mtl.name); auto load_texture_data = [&](const std::string& tex)->decltype(gliTextures)::const_iterator{ if (tex.empty()) { return gliTextures.cend(); } else if (stbTextures.count(tex)) { return gliTextures.find(tex); } else { auto inserted = gliTextures.try_emplace(tex, std::make_unique<vpr::Texture<gli::texture2d>>(device)); inserted.first->second->CreateFromFile(std::string(path_prefix + tex).c_str(), VK_FORMAT_BC3_UNORM_BLOCK); VkSamplerCreateInfo sampler_info = vpr::vk_sampler_create_info_base; sampler_info.addressModeU = VK_SAMPLER_ADDRESS_MODE_REPEAT; sampler_info.addressModeV = VK_SAMPLER_ADDRESS_MODE_REPEAT; sampler_info.anisotropyEnable = VK_TRUE; sampler_info.magFilter = VK_FILTER_LINEAR; sampler_info.minFilter = VK_FILTER_LINEAR; sampler_info.maxAnisotropy = 8.0f; inserted.first->second->CreateSampler(sampler_info); inserted.first->second->TransferToDevice(cmd); return inserted.first; } }; auto load_texture_buffer_data = [&]() { auto inserted = materialUboData.try_emplace(mtl.name, material_ubo_data_t{ glm::vec4{ mtl.ambient[0], mtl.ambient[1], mtl.ambient[2], 0.0f }, glm::vec4{ mtl.diffuse[0], mtl.diffuse[1], mtl.diffuse[2], 0.0f }, glm::vec4{ mtl.specular[0], mtl.specular[1], mtl.specular[2], 0.0f }, glm::vec4{ mtl.transmittance[0], mtl.transmittance[1], mtl.transmittance[2], 0.0f }, glm::vec4{ mtl.emission[0], mtl.emission[1], mtl.emission[2], 0.0f }, misc_material_data_t{ mtl.shininess, mtl.ior, mtl.dissolve, mtl.illum }, pbr_material_data_t{ mtl.roughness, mtl.metallic, mtl.sheen, mtl.clearcoat_thickness, mtl.clearcoat_roughness, mtl.anisotropy, mtl.anisotropy_rotation, 0.0f } }); if (inserted.second) { auto inserted = materialBuffers.emplace(mtl.name, std::make_unique<vpr::Buffer>(device)); auto& iter = inserted.first; iter->second->CreateBuffer(VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT, VK_MEMORY_PROPERTY_HOST_COHERENT_BIT | VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT, sizeof(material_ubo_data_t)); iter->second->CopyToMapped(&materialUboData.at(mtl.name), sizeof(material_ubo_data_t), 0); } }; materialTextures.emplace(mtl.name, material_texture_data_t()); auto ambient_iter = load_texture_data(mtl.ambient_texname); if (ambient_iter != gliTextures.cend()) { materialTextures.at(mtl.name).Ambient = ambient_iter; } auto diffuse_iter = load_texture_data(mtl.diffuse_texname); if (diffuse_iter != gliTextures.cend()) { materialTextures.at(mtl.name).Diffuse = diffuse_iter; } auto specular_iter = load_texture_data(mtl.specular_texname); if (specular_iter != gliTextures.cend()) { materialTextures.at(mtl.name).Specular = specular_iter; } auto highlight_iter = load_texture_data(mtl.specular_highlight_texname); if (highlight_iter != gliTextures.cend()) { materialTextures.at(mtl.name).SpecularHighlight = highlight_iter; } auto bump_iter = load_texture_data(mtl.bump_texname); if (bump_iter != gliTextures.cend()) { materialTextures.at(mtl.name).Bump = bump_iter; } auto displ_iter = load_texture_data(mtl.displacement_texname); if (displ_iter != gliTextures.cend()) { materialTextures.at(mtl.name).Displacement = displ_iter; } auto alpha_iter = load_texture_data(mtl.alpha_texname); if (alpha_iter != gliTextures.cend()) { materialTextures.at(mtl.name).Alpha = alpha_iter; } auto refl_iter = load_texture_data(mtl.reflection_texname); if (refl_iter != gliTextures.cend()) { materialTextures.at(mtl.name).Reflection = refl_iter; } auto rough_iter = load_texture_data(mtl.roughness_texname); if (rough_iter != gliTextures.cend()) { materialTextures.at(mtl.name).Roughness = rough_iter; } auto metallic_iter = load_texture_data(mtl.metallic_texname); if (metallic_iter != gliTextures.cend()) { materialTextures.at(mtl.name).Metallic = metallic_iter; } auto sheen_iter = load_texture_data(mtl.sheen_texname); if (sheen_iter != gliTextures.cend()) { materialTextures.at(mtl.name).Sheen = sheen_iter; } auto normal_iter = load_texture_data(mtl.normal_texname); if (normal_iter != gliTextures.cend()) { materialTextures.at(mtl.name).Normal = normal_iter; } load_texture_buffer_data(); // We've been recording all our commands - now submit. transferPool->Submit(); } createDescriptorPool(); createDescriptorSetLayout(); createDescriptorSets(); } void TexturePool::BindMaterialAtIdx(const size_t & idx, const VkCommandBuffer cmd, const VkPipelineLayout layout, const size_t num_sets_prev_bound) { const auto& name = idxNameMap.at(idx); const auto& set = materialSets.at(name); vkCmdBindDescriptorSets(cmd, VK_PIPELINE_BIND_POINT_GRAPHICS, layout, num_sets_prev_bound, 1, &set->vkHandle(), 0, nullptr); } const material_ubo_data_t & TexturePool::GetMaterialUBO(const size_t & idx) const { return materialUboData.at(idxNameMap.at(idx)); } const VkDescriptorSetLayout TexturePool::GetSetLayout() const noexcept { return setLayout->vkHandle(); } void TexturePool::createDescriptorPool() { descriptorPool = std::make_unique<vpr::DescriptorPool>(device, idxNameMap.size()); descriptorPool->AddResourceType(VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, materialBuffers.size() * 4); descriptorPool->AddResourceType(VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, materialBuffers.size()); descriptorPool->Create(); } void TexturePool::createDescriptorSetLayout() { setLayout = std::make_unique<vpr::DescriptorSetLayout>(device); setLayout->AddDescriptorBinding(VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, VK_SHADER_STAGE_FRAGMENT_BIT, 0); setLayout->AddDescriptorBinding(VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, VK_SHADER_STAGE_FRAGMENT_BIT, 1); setLayout->AddDescriptorBinding(VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, VK_SHADER_STAGE_FRAGMENT_BIT, 2); setLayout->AddDescriptorBinding(VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, VK_SHADER_STAGE_FRAGMENT_BIT, 3); setLayout->AddDescriptorBinding(VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, VK_SHADER_STAGE_VERTEX_BIT | VK_SHADER_STAGE_FRAGMENT_BIT, 4); } void TexturePool::createDescriptorSets() { for (auto& entry : idxNameMap) { const auto& name = entry.second; auto emplaced = materialSets.emplace(name, std::make_unique<vpr::DescriptorSet>(device)); if (!emplaced.second) { LOG(ERROR) << "Couldn't create a descriptor set for material " << name << "!"; throw std::runtime_error("Failed to create a descriptor set required for a material."); } materialSets.at(name)->AddDescriptorInfo(materialTextures.at(name).Diffuse->second->GetDescriptor(), VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, 0); materialSets.at(name)->AddDescriptorInfo(materialTextures.at(name).Bump->second->GetDescriptor(), VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, 1); materialSets.at(name)->AddDescriptorInfo(materialTextures.at(name).Roughness->second->GetDescriptor(), VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, 2); materialSets.at(name)->AddDescriptorInfo(materialTextures.at(name).Metallic->second->GetDescriptor(), VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, 3); materialSets.at(name)->AddDescriptorInfo(materialBuffers.at(name)->GetDescriptor(), VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER, 4); materialSets.at(name)->Init(descriptorPool.get(), setLayout.get()); } } }
52.065217
188
0.643946
fuchstraumer
b8bfd6f1c0a6458a56b771a83746516946943bb4
10,255
cpp
C++
monodrive/core/src/DataFrame.cpp
tomd-tc/monodrive-client
95b6f2e02e081dcd2d66cc66dbf68c2f39da8ed6
[ "MIT" ]
null
null
null
monodrive/core/src/DataFrame.cpp
tomd-tc/monodrive-client
95b6f2e02e081dcd2d66cc66dbf68c2f39da8ed6
[ "MIT" ]
null
null
null
monodrive/core/src/DataFrame.cpp
tomd-tc/monodrive-client
95b6f2e02e081dcd2d66cc66dbf68c2f39da8ed6
[ "MIT" ]
1
2021-08-19T16:42:04.000Z
2021-08-19T16:42:04.000Z
// Copyright (C) 2017-2020, monoDrive, LLC. All Rights Reserved. #include "DataFrame.h" #include "Stopwatch.h" #define IMU_DATA_PACKET_SIZE 35 #define GPS_DATA_PACKET_SIZE 66 #define LIDAR_PACKET_SIZE 1206 ByteBuffer BinaryDataFrame::write() const { ByteBuffer buffer = data_frame; write_mono_header(buffer); return buffer; } void BinaryDataFrame::parse(ByteBuffer& buffer){ data_frame = buffer; } ByteBuffer UltrasonicTargetListFrame::write() const{ nlohmann::json frame = { {"targets", targets} }; ByteBuffer buffer = ByteBuffer::JsonToBuffer(frame); write_mono_header(buffer); return buffer; } void UltrasonicTargetListFrame::parse(ByteBuffer& buffer){ auto frame = buffer.BufferToJson(); json_get(frame, "targets", targets); } ByteBuffer UltrasonicRawFrame::write() const{ ByteBuffer buffer(ultrasonic_raw.size()*sizeof(float), DATA_FRAME_HEADER_SIZE); auto buffer_data = reinterpret_cast<float*>(buffer.data()); std::copy(ultrasonic_raw.data(), ultrasonic_raw.data()+ultrasonic_raw.size(), buffer_data); write_mono_header(buffer); return buffer; } void UltrasonicFrame::parse(ByteBuffer& buffer){ if(bSendProcessed and currentFrameIndex % 2 == 1){ ultrasonicRawFrame->parse_header(buffer); ultrasonicRawFrame->parse(buffer); } else{ ultrasonicTargetListFrame->parse_header(buffer); ultrasonicTargetListFrame->parse(buffer); } currentFrameIndex++; } void UltrasonicRawFrame::parse(ByteBuffer& buffer){ auto data = reinterpret_cast<float*>(buffer.data()); std::copy(data, data+ultrasonic_raw.size(), ultrasonic_raw.data()); } ByteBuffer UltrasonicFrame::write() const{ throw std::runtime_error("Not implemented. Use its member frames."); return ByteBuffer(); } void RadarTargetListFrame::parse(ByteBuffer& buffer){ auto frame = buffer.BufferToJson(); json_get(frame, "target_list", targets); json_get(frame, "gt_targets", gt_targets); } ByteBuffer RadarTargetListFrame::write() const{ nlohmann::json frame = { {"target_list", targets}, {"gt_targets", gt_targets} }; ByteBuffer buffer = ByteBuffer::JsonToBuffer(frame); write_mono_header(buffer); return buffer; } ByteBuffer RadarCubeFrame::write() const{ ByteBuffer buffer(size()*sizeof(std::complex<float>), DATA_FRAME_HEADER_SIZE); auto buffer_data = reinterpret_cast<std::complex<float>*>(buffer.data()); std::copy(radar_cube.data(), radar_cube.data()+size(), buffer_data); write_mono_header(buffer); return buffer; } void RadarCubeFrame::parse(ByteBuffer& buffer){ auto data = reinterpret_cast<std::complex<float>*>(buffer.data()); std::copy(data, data+size(), radar_cube.data()); } void RadarFrame::parse(ByteBuffer& buffer){ if(bSendRadarCube and currentFrameIndex % 2 == 1){ radarCubeFrame->parse_header(buffer); radarCubeFrame->parse(buffer); } else{ radarTargetListFrame->parse_header(buffer); radarTargetListFrame->parse(buffer); } currentFrameIndex++; } ByteBuffer RadarFrame::write() const{ throw std::runtime_error("Not implemented. Use its member frames."); return ByteBuffer(); }; void StateFrame::parse(ByteBuffer& buffer){ auto j = buffer.BufferToJson(); json_get(j, "game_time", game_time); json_get(j, "time", time); json_get(j, "sample_count", sample_count); const auto& states = j["frame"]; vehicles.clear(); objects.clear(); json_get(states, "vehicles", vehicles); json_get(states, "objects", objects); } ByteBuffer StateFrame::write() const { nlohmann::json j = { {"time", time}, {"game_time", game_time}, {"sample_count", sample_count}, {"frame", { {"vehicles", vehicles}, {"objects", objects} } } }; ByteBuffer buffer = ByteBuffer::JsonToBuffer(j); write_mono_header(buffer); return buffer; } void CollisionFrame::parse(ByteBuffer& buffer){ auto j = buffer.BufferToJson(); json_get(j, "game_time", game_time); json_get(j, "time", time); json_get(j, "sample_count", sample_count); from_json(j, ego_target); json_get(j, "targets", collision_targets); } ByteBuffer CollisionFrame::write() const { nlohmann::json j; to_json(j, ego_target); j["time"] = time; j["game_time"] = game_time; j["sample_count"] = sample_count; j["targets"] = collision_targets; ByteBuffer buffer = ByteBuffer::JsonToBuffer(j); write_mono_header(buffer); return buffer; } ByteBuffer ImuFrame::write() const{ ByteBuffer buffer(IMU_DATA_PACKET_SIZE, DATA_FRAME_HEADER_SIZE); buffer.write(0xc2); buffer.writeFloat(acceleration.x); buffer.writeFloat(acceleration.y); buffer.writeFloat(acceleration.z); buffer.writeFloat(angular_velocity.x); buffer.writeFloat(angular_velocity.y); buffer.writeFloat(angular_velocity.z); buffer.writeInt(timer); buffer.writeShort(checksum); buffer.writeInt(time_of_week); write_mono_header(buffer); return buffer; } void ImuFrame::parse(ByteBuffer& buffer){ // packet_size not needed, old artifact of some specific hardware buffer.readByte(); // packet size acceleration.x = buffer.readFloat(); acceleration.y = buffer.readFloat(); acceleration.z = buffer.readFloat(); angular_velocity.x = buffer.readFloat(); angular_velocity.y = buffer.readFloat(); angular_velocity.z = buffer.readFloat(); // more hardware artifacts timer = buffer.readInt(); checksum = buffer.readShort(); time_of_week = buffer.readInt(); } ByteBuffer WaypointFrame::write() const{ nlohmann::json j = { {"time", time}, {"game_time", game_time}, {"sample_count", sample_count}, }; j["waypoints"] = nlohmann::json::array(); for(auto& awp : actor_waypoints) { nlohmann::json awp_json; to_json(awp_json, awp); j["waypoints"].push_back(awp_json); } ByteBuffer buffer = ByteBuffer::JsonToBuffer(j); write_mono_header(buffer); return buffer; } void WaypointFrame::parse(ByteBuffer& buffer) { actor_waypoints.clear(); auto data = buffer.BufferToJson(); json_get(data, "time", time); json_get(data, "game_time", game_time); json_get(data, "sample_count", sample_count); for(auto& actor_wp : data["waypoints"]) { ActorWaypoints awp; from_json(actor_wp, awp); actor_waypoints.emplace_back(awp); } } void GPSFrame::parse(ByteBuffer& buffer){ preamble = buffer.readByte(); MSG_POS_LLH = buffer.readShort(); id_hash = buffer.readShort(); payload_size = buffer.readByte(); lattitude = buffer.readDouble(); longitude = buffer.readDouble(); elevation = buffer.readDouble(); world_x = buffer.readFloat(); world_y = buffer.readFloat(); forward.x = buffer.readFloat(); forward.y = buffer.readFloat(); forward.z = buffer.readFloat(); yaw = buffer.readFloat(); speed = buffer.readFloat(); horizontal_accuracy = buffer.readShort(); vertical_accuracy = buffer.readShort(); num_sats_signal = buffer.readByte(); fixed_mode_status = buffer.readByte(); crc = buffer.readShort(); } ByteBuffer GPSFrame::write() const{ ByteBuffer buffer(GPS_DATA_PACKET_SIZE, DATA_FRAME_HEADER_SIZE); buffer.write(preamble); buffer.writeShort(MSG_POS_LLH); buffer.writeShort(id_hash); buffer.write(payload_size); buffer.writeDouble(lattitude); buffer.writeDouble(longitude); buffer.writeDouble(elevation); buffer.writeFloat(world_x); buffer.writeFloat(world_y); buffer.writeFloat(forward.x); buffer.writeFloat(forward.y); buffer.writeFloat(forward.z); buffer.writeFloat(yaw); buffer.writeFloat(speed); buffer.writeShort(horizontal_accuracy); buffer.writeShort(vertical_accuracy); buffer.write(num_sats_signal); buffer.write(fixed_mode_status); buffer.writeShort(crc); write_mono_header(buffer); return buffer; } void ImageFrame::parse(ByteBuffer& buffer){ auto data = reinterpret_cast<uint8_t*>(buffer.data()); std::copy(data, data+buffer.size(), pixels); } ByteBuffer ImageFrame::write() const { ByteBuffer buffer(size(), DATA_FRAME_HEADER_SIZE); buffer.write(pixels, size()); write_mono_header(buffer); return buffer; } void CameraAnnotationFrame::parse(ByteBuffer& buffer) { annotations.clear(); auto frames = buffer.BufferToJson(); for (auto& frame : frames) { AnnotationFrame2D annotationFrame; if (json_get(frame, annotationFrame)) { annotations.insert(std::make_pair(annotationFrame.name, annotationFrame)); } } } ByteBuffer CameraAnnotationFrame::write() const { nlohmann::json j = nlohmann::json::array(); for (auto& annotation : annotations) { j.push_back(annotation.second); } ByteBuffer buffer = ByteBuffer::JsonToBuffer(j); write_mono_header(buffer); return buffer; } ByteBuffer CameraFrame::write() const{ throw std::runtime_error("Not implemented. Use it's member frames."); return ByteBuffer(); } void CameraFrame::parse(ByteBuffer& buffer){ if(!bHasAnnotation or currentFrameIndex % 2 == 0){ buffer.reset(); imageFrame->parse_header(buffer); imageFrame->parse(buffer); } else{ buffer.reset(); annotationFrame->parse_header(buffer); annotationFrame->parse(buffer); } currentFrameIndex++; } ByteBuffer LidarFrame::write() const { ByteBuffer buffer(sizeof(LidarPacket)*packets.size(), DATA_FRAME_HEADER_SIZE); buffer.write((uint8_t*)packets.data(), sizeof(LidarPacket) * packets.size()); write_mono_header(buffer); return buffer; } void LidarFrame::parse(ByteBuffer& buffer){ packets[packetIndex++] = *reinterpret_cast<LidarPacket*>(buffer.data()); if(packetIndex == packets.size()) packetIndex = 0; } void RPMFrame::parse(ByteBuffer& buffer){ wheel_number = buffer.readInt(); speed = buffer.readFloat(); } ByteBuffer RPMFrame::write() const { ByteBuffer buffer(4, DATA_FRAME_HEADER_SIZE); buffer.writeInt(wheel_number); buffer.writeFloat(speed); write_mono_header(buffer); return buffer; }
29.638728
95
0.69137
tomd-tc
b8c03410ed29ed47d5733852a62c406b6b55a807
8,343
hpp
C++
booleannetwork-code-66-trunk/booleannetwork-code-66-trunk/include/BnSimulator/util/Counter.hpp
Markfrancisrogers/BooleanNetwork
62e755d938b70e5907e8561909a0637f0682b9b4
[ "Apache-2.0" ]
2
2017-07-04T14:57:48.000Z
2017-08-04T19:03:51.000Z
booleannetwork-code-66-trunk/booleannetwork-code-66-trunk/include/BnSimulator/util/Counter.hpp
Markfrancisrogers/BooleanNetwork
62e755d938b70e5907e8561909a0637f0682b9b4
[ "Apache-2.0" ]
null
null
null
booleannetwork-code-66-trunk/booleannetwork-code-66-trunk/include/BnSimulator/util/Counter.hpp
Markfrancisrogers/BooleanNetwork
62e755d938b70e5907e8561909a0637f0682b9b4
[ "Apache-2.0" ]
null
null
null
/* * Counter.hpp * * Created on: Aug 23, 2009 * Author: stewie */ #ifndef COUNTER_HPP_ #define COUNTER_HPP_ #include <cassert> #include <cstddef> #include <ostream> #include <utility> #include <map> #include <algorithm> // for std::swap #include <functional> // for std::less #include <boost/type_traits.hpp> #include <boost/mpl/if.hpp> #include <boost/range/begin.hpp> #include <boost/range/end.hpp> #include <boost/smart_ptr/shared_ptr.hpp> #include <boost/ptr_container/indirect_fun.hpp> namespace bn { namespace util { /** * This data structure keeps track of the number of insertion attempts of an * element. * * This class implements a map that associates a key element to the number of * insertions of that element in the map. Differently from an STL multiset, * this class stores only @e one instance of each key element. Like other STL * associative containers, keys are compared for equality using the @a Comparator * type provided during instantiation. * * Typical use case of this class are in implementations of word counters or * histograms. * * This class handles object ownership in a customizable way. If type parameter * @a T is instantiated to a non-pointer type, the ownership follows the same * rules as for STL containers (that is the container stores copies of the * inserted elements). On the other hand, if type parameter @a T is a pointer * type, this class stores <a href="http://www.boost.org/libs/smart_ptr/"> * boost::shared_ptr</a>'s of elements, that is, its value_type member type is * boost::shared_ptr<boost::remove_pointer<T>::type>. This way memory management * is simplified. * * Although only objects of type key_type can be inserted (like an STL set), * all iterator types return, when dereferenced, STL pairs of key_type and * mapped_type objects (like an STL map). * * @see <a href="http://www.boost.org/libs/smart_ptr/">The Boost Smart Pointer * Library</a> for instructions on how to use shared pointers, and * <a href="http://www.boost.org/libs/type_traits/">The Boost Type Traits * Library</a>. */ template<class T, class Comparator = std::less< typename boost::remove_pointer<T>::type> > class Counter { private: /** * MPL integral type equal to boost::mpl::true_ if @a T is a pointer type. */ typedef typename boost::is_pointer<T>::type is_ptr; /** * Key type of the underlying associative container. */ typedef typename boost::mpl::if_<is_ptr, boost::shared_ptr< typename boost::remove_pointer<T>::type>, T>::type stored_type; /** * Key comparator of the underlying associative container. */ typedef typename boost::mpl::if_<is_ptr, boost::indirect_fun<Comparator>, Comparator>::type comparator_type; /** * Type of the underlying associative container. */ typedef std::map<stored_type, size_t, comparator_type> Container; /** * Actual container that backs this class. */ Container map; /** * Total number of insertions performed. */ size_t count; public: /** * Type of the elements contained in this class. */ typedef typename Container::key_type key_type; /** * Integral type used to count the insertions. */ typedef typename Container::mapped_type mapped_type; /** * Key comparator type. */ typedef typename Container::key_compare key_compare; /** * size method returns object of this type. */ typedef typename Container::size_type size_type; /** * Input iterator for this class. * * @todo * Actually this is a bidirectional iterator (iterator type of the * underlying STL map), but this would break incapsulation! */ typedef typename Container::iterator iterator; /** * Input constant iterator for this class. */ typedef typename Container::const_iterator const_iterator; /** * Initializes an empty Counter object. * @param comp a comparator object for the keys */ explicit Counter(const comparator_type& comp = comparator_type()) : map(comp), count(0) { } /** * Initializes a Counter object with a range of elements. * @param first input iterator to the initial position of the first range * @param last input iterator to the final position of the first range * @param comp a comparator object for the keys */ template<class InputIterator> Counter(InputIterator first, const InputIterator last, const comparator_type& comp = comparator_type()) : map(comp), count(0) { for (; first != last; ++first) insert(*first); } /** * Initializes a Counter object with a range of elements. * * This overload works with Boost ranges instead of iterators. * @param r a single pass range * @param comp a comparator object for the keys */ template<class SinglePassRange> explicit Counter(const SinglePassRange& r, const comparator_type& comp = comparator_type()) : map(comp), count(0) { for (typename boost::range_iterator<SinglePassRange>::type first = boost::begin(r), last = boost::end(r); first != last; ++first) insert(*first); } /** * Copy constructor. * @param c another Counter object */ Counter(const Counter& c) : map(c.map), count(c.count) { } /** * Returns the number of key elements stored in this container. * @return the number of key elements */ size_type size() const { return map.size(); } /** * Returns the number of key element insertions since the instantiation of * this object. * * Joined with Counter::operator[](), it can be useful to compute ratios. * @return the number of key element insertions */ size_type insertions() const { return count; } /** * Tests if this container is empty. * @return @e true if this container is empty */ bool empty() const { return map.empty(); } /** * Iterator to the beginning of the container. * @return beginning iterator */ iterator begin() { return map.begin(); } /** * Iterator to the end of the container. * @return end iterator */ iterator end() { return map.end(); } /** * Constant iterator to the beginning of the container. * @return constant beginning iterator */ const_iterator begin() const { return map.begin(); } /** * Constant iterator to the end of the container. * @return constant end iterator */ const_iterator end() const { return map.end(); } /** * Inserts a key element in this container and increments its count. * * Like an STL associative container, this method returns a pair whose * @e first member is an iterator of this class and its @e second member * is @e true if a new element was inserted. * @param key an element to insert * @return an STL pair */ std::pair<iterator, bool> insert(const key_type& key) { std::pair<iterator, bool> p = map.insert( typename Container::value_type(key, 1)); if (!p.second) ++(p.first->second); ++count; return p; } /** * Implementation of swap function. * @param other a Counter object */ void swap(Counter& other) { std::swap(map, other.map); std::swap(count, other.count); } /** * Returns the number of insertions of element @a key in this container. * @param key a key element * @return number of insertions of @a key element */ mapped_type operator[](const key_type& key) const { const typename Container::const_iterator it = map.find(key); return it == map.end() ? 0 : it->second; } template<class U, class Comp> friend std::ostream& operator<<( std::ostream& out, const Counter<U, Comp>& c); }; /** * Prints a Counter to a stream. * * First it prints a key element using operator<<, then prints its count * separated by a space * @param out an output stream * @param c a Counter object * @return the stream passed as first argument */ template<class T, class Comparator> std::ostream& operator<<(std::ostream& out, const Counter<T, Comparator>& c) { for (typename Counter<T, Comparator>::const_iterator it = c.begin(), end = c.end(); it != end; ++it) out << it->first << ' ' << it->second << '\n'; return out; } } } namespace std { /** * Specialization that calls bn::util::Counter::swap(bn::util::Counter&) * on the first argument. * @param a a Counter object * @param b another Counter object */ template<class T, class Comparator> void swap( bn::util::Counter<T, Comparator>& a, bn::util::Counter<T, Comparator>& b) { a.swap(b); } } #endif /* COUNTER_HPP_ */
27.354098
81
0.694115
Markfrancisrogers
fef630089d62ff61e4f4594c83b262fe9c6b6871
522
cpp
C++
C++-practice/碱基配对2.cpp
GengchenXU/Star-gazer
19a119390d3f1bfa56c4dda1b04f6c673e49be24
[ "MIT" ]
4
2019-11-08T11:04:02.000Z
2021-09-08T08:24:50.000Z
C++-practice/碱基配对2.cpp
GengchenXU/Star-gazer
19a119390d3f1bfa56c4dda1b04f6c673e49be24
[ "MIT" ]
1
2019-11-08T11:07:35.000Z
2019-11-22T06:33:24.000Z
C++-practice/碱基配对2.cpp
GengchenXU/Star-gazer
19a119390d3f1bfa56c4dda1b04f6c673e49be24
[ "MIT" ]
null
null
null
#include<stdio.h> #include<string.h> int main() { int n; scanf("%d",&n); char a[100][100]; for(int i=0;i<n;i++) { scanf("%s",a[i]); } for(int j=0;j<n;j++){ for(int k=0;a[j][k]!='\0';k++) //for(int k=0;k<strlen(a[j]);k++) a[j]!='\0'wrong // { switch(a[j][k]){ case 'A': printf("T");break; case 'T': printf("A"); break; case 'G': printf("C"); break; default: printf("G"); } } printf("\n"); } return 0; }
20.076923
91
0.408046
GengchenXU
fef735766ae662e378631ffe8044b7b8f5a9012d
364
cpp
C++
Sandbox/PhysicsDemo/Entry.cpp
antjowie/Aphelion-engine
e26287d240db37f3e6df289dec760b1e4404135b
[ "MIT" ]
3
2019-11-11T16:16:27.000Z
2019-11-11T16:16:36.000Z
Sandbox/PhysicsDemo/Entry.cpp
antjowie/Aphelion-engine
e26287d240db37f3e6df289dec760b1e4404135b
[ "MIT" ]
1
2020-05-03T14:58:09.000Z
2020-05-03T14:58:09.000Z
Sandbox/PhysicsDemo/Entry.cpp
antjowie/Shinobu-engine
e26287d240db37f3e6df289dec760b1e4404135b
[ "MIT" ]
null
null
null
#include "Aphelion/Core/EntryPoint.h" #include "PhysicsDemoLayer.h" #include "PhysicsRaycastLayer.h" extern std::unique_ptr<ap::Application> ap::CreateApplication() { auto app = std::make_unique<ap::Application>(); app->GetLayerStack().PushLayer(new PhysicsDemoLayer()); //app->GetLayerStack().PushLayer(new PhysicsRaycastLayer()); return app; }
28
64
0.730769
antjowie
fef9bb230a36eac781b7d57746884ea493766b0b
930
cpp
C++
unit/util/std_expr.test.cpp
shmarovfedor/esbmc
3226a3d68b009d44b9535a993ac0f25e1a1fbedd
[ "BSD-3-Clause" ]
143
2015-06-22T12:30:01.000Z
2022-03-21T08:41:17.000Z
unit/util/std_expr.test.cpp
shmarovfedor/esbmc
3226a3d68b009d44b9535a993ac0f25e1a1fbedd
[ "BSD-3-Clause" ]
542
2017-06-02T13:46:26.000Z
2022-03-31T16:35:17.000Z
unit/util/std_expr.test.cpp
shmarovfedor/esbmc
3226a3d68b009d44b9535a993ac0f25e1a1fbedd
[ "BSD-3-Clause" ]
81
2015-10-21T22:21:59.000Z
2022-03-24T14:07:55.000Z
#define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do this in one cpp file #include <catch2/catch.hpp> #include <util/arith_tools.h> #include <util/c_types.h> #include <util/config.h> #include <util/namespace.h> #include <util/simplify_expr.h> #include <util/std_expr.h> #include <util/std_types.h> TEST_CASE("for a division expression...", "[unit][util][std_expr]") { typet t("signedbv"); auto dividend = from_integer(10, t); auto divisor = from_integer(5, t); auto div = div_exprt(dividend, divisor); SECTION("its divisor and dividend have the values assigned to them") { REQUIRE(div.op0() == dividend); REQUIRE(div.op1() == divisor); } /* This will not work on current implementation (and we probably shouldn't waste time on this) * after irep is switched to irep2 we have to fix this SECTION("its type is that of its operands") { REQUIRE(div.type() == t); } */ }
30
96
0.692473
shmarovfedor
fefb47768604aa04897836cb0a95e66a5d198c52
12,705
cpp
C++
Signer/DlgGetPattern.cpp
WhiteGroup/JAV-AV-Engine
c258c1bb283d2cccc358dab5d3a7bacd4fc35790
[ "MIT" ]
15
2016-11-03T20:39:13.000Z
2022-01-17T16:00:21.000Z
Signer/DlgGetPattern.cpp
ZhuHuiBeiShaDiao/JAV-AV-Engine
c258c1bb283d2cccc358dab5d3a7bacd4fc35790
[ "MIT" ]
null
null
null
Signer/DlgGetPattern.cpp
ZhuHuiBeiShaDiao/JAV-AV-Engine
c258c1bb283d2cccc358dab5d3a7bacd4fc35790
[ "MIT" ]
16
2016-11-04T11:40:39.000Z
2022-02-25T07:25:52.000Z
#include "DlgGetPattern.h" #include "ui_GetPattern.h" #include "QGetPatternModel.h" #include <QFileDialog> #include <QObject> #include <QMessageBox> #include <QMenu> #include <QVariant> extern QFileDialog *q_pFileOpenDialog ; //--------------------------------------------------------------------- DlgGetPattern::DlgGetPattern(QWidget *parent , QSqlDatabase *i_pqsqlDb):QDialog(parent),ui(new Ui::GetPattern) { ui->setupUi(this); ui->BtnApplay->setEnabled(FALSE); m_pocQGetPatternModel = new QGetPatternModel(this) ; ui->tableView->setModel(m_pocQGetPatternModel); connect ( ui->BtnAdd, SIGNAL(clicked()) , this , SLOT(BtnAdd_Click())); connect ( ui->BtnApplay, SIGNAL(clicked()) , this , SLOT(BtnApplay_Click())); m_pqsqlDb = i_pqsqlDb ; AddSate = true ; ui->PrgBar->setValue(0); ui->PrgBar->setMinimum(0); ui->PrgBar->setMaximum(100); m_pGetPatternThread = NULL ; ui->tableView->setContextMenuPolicy(Qt::CustomContextMenu); CreatePopupMenuAction(); CreatePopupMenuAndAssign(); m_qu32MenuCount = 1; m_qSqlLite = QSqlDatabase::addDatabase("QSQLITE","CrcMatchConnect"); m_qSqlLite.setDatabaseName(":memory:"); if ( !m_qSqlLite.open() ) { return ; } QSqlQuery query(m_qSqlLite); if ( query.exec("create table FileInfomTbl(Id integer primary key AUTOINCREMENT ,FileName TEXT ,VirusName TEXT, MD5 TEXT , PATH TEXT , SetId integer , FileSize integer , OrdinalId integer DEFUALT NULL )") == false ) { return ; } if ( query.exec("create table ErrFileInfomTbl(Id integer primary key AUTOINCREMENT ,FileName TEXT ,VirusName TEXT, MD5 TEXT , PATH TEXT , SetId integer , FileSize integer)") == false ) { return ; } if ( query.exec("CREATE INDEX FileInfomTbl_idx on FileInfomTbl (SetId)") == false ) { return ; } if ( query.exec("create table CheckSumTbl( CheckSum1 integer,CheckSum2 integer, Id integer ,SetId integer, MethodId integer, primary key(CheckSum1, CheckSum2, Id))") == false ) { return ; } if ( query.exec("create table SetNameId( SetId integer , SetName Text , primary key(SetId))") == false ) { return ; } QSqlQuery query1(*i_pqsqlDb); if ( query1.exec("Select SetId , SetName from `Set`") == false ) { QString TEst = query1.lastError().text(); return ; } while ( query1.next() ) { query.prepare("insert into SetNameId (SetId , SetName ) values (:1 , :2)"); query.bindValue(":1" , query1.value(0)); query.bindValue(":2" , query1.value(1)); if ( query.exec() == false) { QString TEst = query.lastError().text(); return ; } } bool ChizeKhube = connect(ui->tableView , SIGNAL(customContextMenuRequested(const QPoint &)) , this , SLOT(PopupRequest(const QPoint &))); } //--------------------------------------------------------------------- DlgGetPattern::~DlgGetPattern(void) { m_qSqlLite.close(); if ( m_pGetPatternThread != NULL ) delete m_pGetPatternThread; } //--------------------------------------------------------------------- void DlgGetPattern::BtnAdd_Click() { if (AddSate == true) { QStringList qstrfileNames; q_pFileOpenDialog->setFileMode(QFileDialog::DirectoryOnly); q_pFileOpenDialog->setAcceptMode(QFileDialog::AcceptOpen); if (q_pFileOpenDialog->exec()) { if ( m_pGetPatternThread != NULL ) { delete m_pGetPatternThread ; m_pGetPatternThread = NULL; } m_pGetPatternThread = new EnumGetPatternThread (*m_pqsqlDb , q_pFileOpenDialog->selectedFiles()[0].toStdWString(), m_qSqlLite); connect(m_pGetPatternThread,SIGNAL(FindFile(int , int,QString , bool )) , this , SLOT(GetFileInfo(int , int ,QString , bool ))); connect(m_pGetPatternThread,SIGNAL(finished()) , this , SLOT(ThreadFinish())); connect(this , SIGNAL(CancelThread()) , m_pGetPatternThread , SLOT(Cancel())); m_pGetPatternThread->start(); AddSate = false ; ui->BtnAdd->setText(tr("Cancel")); } } else { emit CancelThread() ; } } //------------------------------------------------------------------------ void DlgGetPattern::GetFileInfo(int Percent , int u32SetId ,QString i_qstrPath, bool bNoSet) { if (Percent == 100 ) { ui->PrgBar->setValue(100); return ; } else { ui->PrgBar->setValue(Percent); ui->lbCurrentPath->setText(i_qstrPath); if (bNoSet == false ) { m_pocQGetPatternModel->SetFileInfo(u32SetId); } } } //--------------------------------------------------------------------- void DlgGetPattern::GetFileInfoAction() { QItemSelectionModel *SelectModel = ui->tableView->selectionModel(); QModelIndex qCurrentIndex = SelectModel->currentIndex(); quint32 qu32SetId = qCurrentIndex.row(); if (((QGetPatternModel *)(ui->tableView->model()))->GetSetIdfromRowId(qu32SetId)) { emit GetFileInfoList(qu32SetId , &m_qSqlLite) ; } else { QMessageBox::critical(0, QObject::tr("Get Set Id Error"), tr ("Can not get set id")); } return ; } //--------------------------------------------------------------------- void DlgGetPattern::CreatePopupMenuAction() { m_qPopUpMenuAction[0] = new QAction("Show file Info" , this); connect(m_qPopUpMenuAction[0], SIGNAL(triggered()) ,this , SLOT(GetFileInfoAction())); m_qu32MenuCount = 1 ; } //--------------------------------------------------------------------- void DlgGetPattern::CreatePopupMenuAndAssign() { m_qPopMenu = new QMenu(this) ; for (int i = 0 ; i< m_qu32MenuCount ; i++) { m_qPopMenu->addAction(m_qPopUpMenuAction[i]); } return ; } //--------------------------------------------------------------------- void DlgGetPattern::PopupRequest(const QPoint & Arg) { QItemSelectionModel *SelectModel = ui->tableView->selectionModel(); QModelIndex qCurrentIndex = SelectModel->currentIndex(); QPoint TempArg = Arg ; if (SelectModel->isSelected(qCurrentIndex) && qCurrentIndex.column() == 0) { TempArg.setY(Arg.y()+ui->tableView->rowHeight(qCurrentIndex.row())); m_qPopMenu->exec(ui->tableView->mapToGlobal(TempArg)); } } //----------------------------------------------------------------------- void DlgGetPattern::BtnApplay_Click() { QSqlQuery qureySqlLite(m_qSqlLite); QSqlQuery qureyMysql(*m_pqsqlDb); QSqlQuery qureySqlLite2(m_qSqlLite); QString qstrPath ; quint32 u32VirusId; quint32 u32SetId; if ( qureySqlLite.exec("select FileName , SetId , Id , MD5 , FileSize, PATH , VirusName from FileInfomTbl where OrdinalId IS NULL") == false ) { QMessageBox::warning(NULL ,"Data base Error : Get Temp Value", qureySqlLite.lastError().text()); m_pqsqlDb->rollback() ; return ; } while ( qureySqlLite.next() ) { m_pqsqlDb->transaction(); QString qstrFilename = qureySqlLite.value(0).toString(); QString qstrVirusName = qureySqlLite.value(6).toString(); qstrPath = qureySqlLite.value(5).toString() ; u32SetId = qureySqlLite.value(1).toUInt(); quint32 u32Id = qureySqlLite.value(2).toUInt(); qureyMysql.prepare("insert into virus(VirusName) values (:VirusName)"); qureyMysql.bindValue(":VirusName" ,qstrVirusName); if ( qureyMysql.exec() == false) { m_pqsqlDb->rollback() ; return ; } u32VirusId = qureyMysql.lastInsertId().toUInt(); qureyMysql.prepare("insert into set_Virus (SetId ,VirusId) values (:SetId , :VirusId)"); qureyMysql.bindValue(":SetId" , u32SetId); qureyMysql.bindValue(":VirusId", u32VirusId); if ( qureyMysql.exec() == false ) { QMessageBox::warning(NULL ,"Data base Error : Insert File set_Virus", qureyMysql.lastError().text()); m_pqsqlDb->rollback() ; return ; } qureyMysql.prepare("insert into fileinfo (FileName , MD5 , VirusId , FileSize , FilePAth) values (:FileName , :MD5 , :VirusId , :FileSize , :FilePAth)"); qureyMysql.bindValue(":FileName" , qstrFilename); qureyMysql.bindValue(":MD5" , qureySqlLite.value(3).toByteArray()); qureyMysql.bindValue(":VirusId" , u32VirusId); qureyMysql.bindValue(":FileSize" , qureySqlLite.value(4).toULongLong()); qureyMysql.bindValue(":PATH" , qureySqlLite.value(5).toString()); if ( qureyMysql.exec() == false ) { quint32 u32NumError = qureyMysql.lastError().number(); if ( u32NumError == 1062 ) { qureyMysql.prepare("select FileName , VirusId from fileinfo where MD5 = :MD5 And FileSize = :FileSize"); qureyMysql.bindValue(":MD5" , qureySqlLite.value(3).toByteArray()); qureyMysql.bindValue(":FileSize" , qureySqlLite.value(4).toULongLong()); if ( qureyMysql.exec() == false ) { QMessageBox::warning(NULL ,"Data base Error : Insert File Info", qureyMysql.lastError().text()); m_pqsqlDb->rollback() ; return ; } if ( qureyMysql.next() == false ) { m_pqsqlDb->rollback() ; return ; } QString qstrOldVirusName = qureyMysql.value(0).toString(); quint32 u32OldVirusId = qureyMysql.value(1).toUInt(); qureyMysql.prepare("select VirusName from virus where VirusId = :VirusId"); qureyMysql.bindValue(":VirusId" ,u32OldVirusId); if ( qureyMysql.exec() == false ) { QMessageBox::warning(NULL ,"Data base Error : Insert File Info", qureyMysql.lastError().text()); m_pqsqlDb->rollback() ; return ; } if ( qureyMysql.next() == false ) { m_pqsqlDb->rollback() ; return ; } QString qstrWarringString = QString("Duplicate Entry for fileinfo File name = %1 with Virus Name = %2 Conflicted File name = %3 with Virus Name = %4").arg(qstrFilename).arg(qstrVirusName).arg(qstrOldVirusName).arg(qureyMysql.value(0).toString()) ; QMessageBox::warning(NULL ,"Data base Error : Insert File Info", qstrWarringString) ; m_pqsqlDb->rollback() ; continue ; } else { QMessageBox::warning(NULL ,"Data base Error : Insert File Info", qureyMysql.lastError().text()); m_pqsqlDb->rollback() ; return ; } } qureySqlLite2.prepare("select count(*) FROM CheckSumTbl where id = :id "); qureySqlLite2.bindValue(":id" , u32Id) ; if ( qureySqlLite2.exec() == false ) { QMessageBox::warning(NULL ,"Data base Error : Get Check Sum Info", qureyMysql.lastError().text()); m_pqsqlDb->rollback() ; return ; } if ( qureySqlLite2.next() == false) { QMessageBox::warning(NULL ,"Data base Error : Get Check Sum Info", qureyMysql.lastError().text()); m_pqsqlDb->rollback() ; continue ; } if (qureySqlLite2.value(0).toUInt() == 0 ) { QMessageBox::warning(NULL ,"Data base Error : Get Check Sum Info", qureyMysql.lastError().text()); m_pqsqlDb->rollback() ; continue ; } qureySqlLite2.prepare("select CheckSum1 , CheckSum2, MethodId FROM CheckSumTbl where id = :id "); qureySqlLite2.bindValue(":id" , u32Id) ; if ( qureySqlLite2.exec() == false ) { QMessageBox::warning(NULL ,"Data base Error : Get Check Sum Info", qureyMysql.lastError().text()); m_pqsqlDb->rollback() ; return ; } while ( qureySqlLite2.next() ) { qureyMysql.prepare("insert into checksum_virus (VirusId , CheckSum , CrcMethodId) values (:VirusId , :CheckSum , :CrcMethodId)"); qureyMysql.bindValue(":VirusId" ,u32VirusId ); bool bok ; UINT32 u32Crc1 = qureySqlLite2.value(0).toUInt() ; UINT32 u32Crc2 = qureySqlLite2.value(1).toUInt() ; UINT64 u64Crc = u32Crc2 ; u64Crc = u64Crc << 32 ; u64Crc += u32Crc1 ; qureyMysql.bindValue(":CheckSum" , u64Crc); qureyMysql.bindValue(":CrcMethodId" , qureySqlLite2.value(2).toUInt()) ; if ( qureyMysql.exec() == false ) { QString qstrError = qureyMysql.lastError().text(); qureyMysql.prepare ("Select FilePath from FileInfo where VirusId = :VirusId") ; qureyMysql.bindValue (":VirusId" , u32VirusId); if ( qureyMysql.exec() == false ) { QMessageBox::warning(NULL ,"Data base Error : Insert File set_Virus", qureyMysql.lastError().text()); m_pqsqlDb->rollback() ; return ; } if ( qureyMysql.next() == false ) { m_pqsqlDb->rollback() ; return ; } QString FilePath = qureyMysql.value(0).toString(); QMessageBox::warning(NULL ,"Data base Error : Set Check Sum Info", qstrError +"Old Path" +FilePath + "Current Path" + qstrPath); m_pqsqlDb->rollback() ; continue ; } } m_pqsqlDb->commit(); } ui->BtnApplay->setEnabled(false); if ( qureySqlLite.exec("delete from FileInfomTbl") == false ) { QMessageBox::warning(NULL ,"Data base Error : clean File info", qureyMysql.lastError().text()); } if ( qureySqlLite.exec("delete from CheckSumTbl") == false ) { QMessageBox::warning(NULL ,"Data base Error : clean checksum", qureyMysql.lastError().text()); } m_pocQGetPatternModel->Reset(); } //----------------------------------------------------------------------- void DlgGetPattern::ThreadFinish() { AddSate = true ; ui->BtnAdd->setText(tr("Add")); ui->BtnApplay->setEnabled(true); } //-----------------------------------------------------------------------
35
251
0.645258
WhiteGroup
3a02f7d0c09d0939d19ed2b928d006dbdc3a47f2
57,541
cpp
C++
Core/burn/drv/irem/d_m90.cpp
atship/FinalBurn-X
3ee18ccd6efc1bbb3a807d2c206106a5a4000e8d
[ "Apache-2.0" ]
17
2018-05-24T05:20:45.000Z
2021-12-24T07:27:22.000Z
Core/burn/drv/irem/d_m90.cpp
atship/FinalBurn-X
3ee18ccd6efc1bbb3a807d2c206106a5a4000e8d
[ "Apache-2.0" ]
6
2016-10-20T02:36:07.000Z
2017-03-08T15:23:06.000Z
Core/burn/drv/irem/d_m90.cpp
atship/FinalBurn-X
3ee18ccd6efc1bbb3a807d2c206106a5a4000e8d
[ "Apache-2.0" ]
5
2019-01-21T00:45:00.000Z
2021-07-20T08:34:22.000Z
// FB Alpha Irem M90 driver module // Based on MAME driver by Bryan McPhail #include "tiles_generic.h" #include "z80_intf.h" #include "burn_ym2151.h" #include "nec_intf.h" #include "irem_cpu.h" #include "dac.h" static UINT8 *AllMem; static UINT8 *MemEnd; static UINT8 *AllRam; static UINT8 *RamEnd; static UINT8 *DrvV30ROM; static UINT8 *DrvZ80ROM; static UINT8 *DrvGfxROM0; static UINT8 *DrvGfxROM1; static UINT8 *DrvSndROM; static UINT8 *DrvVidRAM; static UINT8 *DrvV30RAM; static UINT8 *DrvZ80RAM; static UINT8 *DrvSprRAM; static UINT8 *DrvPalRAM; static UINT8 *m90_video_control; static UINT8 *RamPrioBitmap; static UINT8 *soundlatch; static UINT32 *DrvPalette; static UINT8 DrvRecalc; static UINT8 irqvector; static INT32 sample_address; static UINT8 DrvJoy1[8]; static UINT8 DrvJoy2[8]; static UINT8 DrvJoy3[8]; static UINT8 DrvJoy4[8]; static UINT8 DrvJoy5[8]; static UINT8 DrvDips[2]; static UINT8 DrvInputs[5]; static UINT8 DrvReset; static INT32 vblank; static INT32 code_mask[2]; static INT32 video_offsets[2] = { 0, 0 }; enum { VECTOR_INIT, YM2151_ASSERT, YM2151_CLEAR, Z80_ASSERT, Z80_CLEAR }; static struct BurnInputInfo p4commonInputList[] = { {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 2, "p1 coin" }, {"P1 Start", BIT_DIGITAL, DrvJoy3 + 0, "p1 start" }, {"P1 Up", BIT_DIGITAL, DrvJoy1 + 3, "p1 up" }, {"P1 Down", BIT_DIGITAL, DrvJoy1 + 2, "p1 down" }, {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left" }, {"P1 Right", BIT_DIGITAL, DrvJoy1 + 0, "p1 right" }, {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 7, "p1 fire 1" }, {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 2" }, {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 3, "p2 coin" }, {"P2 Start", BIT_DIGITAL, DrvJoy3 + 1, "p2 start" }, {"P2 Up", BIT_DIGITAL, DrvJoy2 + 3, "p2 up" }, {"P2 Down", BIT_DIGITAL, DrvJoy2 + 2, "p2 down" }, {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left" }, {"P2 Right", BIT_DIGITAL, DrvJoy2 + 0, "p2 right" }, {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 7, "p2 fire 1" }, {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 2" }, {"P3 Coin", BIT_DIGITAL, DrvJoy4 + 5, "p3 coin" }, {"P3 Start", BIT_DIGITAL, DrvJoy4 + 4, "p3 start" }, {"P3 Up", BIT_DIGITAL, DrvJoy4 + 3, "p3 up" }, {"P3 Down", BIT_DIGITAL, DrvJoy4 + 2, "p3 down" }, {"P3 Left", BIT_DIGITAL, DrvJoy4 + 1, "p3 left" }, {"P3 Right", BIT_DIGITAL, DrvJoy4 + 0, "p3 right" }, {"P3 Button 1", BIT_DIGITAL, DrvJoy4 + 7, "p3 fire 1" }, {"P3 Button 2", BIT_DIGITAL, DrvJoy4 + 6, "p3 fire 2" }, {"P4 Coin", BIT_DIGITAL, DrvJoy5 + 5, "p4 coin" }, {"P4 Start", BIT_DIGITAL, DrvJoy5 + 4, "p4 start" }, {"P4 Up", BIT_DIGITAL, DrvJoy5 + 3, "p4 up" }, {"P4 Down", BIT_DIGITAL, DrvJoy5 + 2, "p4 down" }, {"P4 Left", BIT_DIGITAL, DrvJoy5 + 1, "p4 left" }, {"P4 Right", BIT_DIGITAL, DrvJoy5 + 0, "p4 right" }, {"P4 Button 1", BIT_DIGITAL, DrvJoy5 + 7, "p4 fire 1" }, {"P4 Button 2", BIT_DIGITAL, DrvJoy5 + 6, "p4 fire 2" }, {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, {"Service", BIT_DIGITAL, DrvJoy3 + 4, "service" }, {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, }; STDINPUTINFO(p4common) static struct BurnInputInfo p2commonInputList[] = { {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 2, "p1 coin" }, {"P1 Start", BIT_DIGITAL, DrvJoy3 + 0, "p1 start" }, {"P1 Up", BIT_DIGITAL, DrvJoy1 + 3, "p1 up" }, {"P1 Down", BIT_DIGITAL, DrvJoy1 + 2, "p1 down" }, {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left" }, {"P1 Right", BIT_DIGITAL, DrvJoy1 + 0, "p1 right" }, {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 7, "p1 fire 1" }, {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 2" }, {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 3, "p2 coin" }, {"P2 Start", BIT_DIGITAL, DrvJoy3 + 1, "p2 start" }, {"P2 Up", BIT_DIGITAL, DrvJoy2 + 3, "p2 up" }, {"P2 Down", BIT_DIGITAL, DrvJoy2 + 2, "p2 down" }, {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left" }, {"P2 Right", BIT_DIGITAL, DrvJoy2 + 0, "p2 right" }, {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 7, "p2 fire 1" }, {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 2" }, {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, {"Service", BIT_DIGITAL, DrvJoy3 + 4, "service" }, {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, }; STDINPUTINFO(p2common) static struct BurnInputInfo Quizf1InputList[] = { {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 2, "p1 coin" }, {"P1 Start", BIT_DIGITAL, DrvJoy3 + 0, "p1 start" }, {"P1 Up", BIT_DIGITAL, DrvJoy1 + 3, "p1 up" }, {"P1 Down", BIT_DIGITAL, DrvJoy1 + 2, "p1 down" }, {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left" }, {"P1 Right", BIT_DIGITAL, DrvJoy1 + 0, "p1 right" }, {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 7, "p1 fire 1" }, {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 2" }, {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 3" }, {"P1 Button 4", BIT_DIGITAL, DrvJoy1 + 4, "p1 fire 4" }, {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 3, "p2 coin" }, {"P2 Start", BIT_DIGITAL, DrvJoy3 + 1, "p2 start" }, {"P2 Up", BIT_DIGITAL, DrvJoy2 + 3, "p2 up" }, {"P2 Down", BIT_DIGITAL, DrvJoy2 + 2, "p2 down" }, {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left" }, {"P2 Right", BIT_DIGITAL, DrvJoy2 + 0, "p2 right" }, {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 7, "p2 fire 1" }, {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 2" }, {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 3" }, {"P2 Button 4", BIT_DIGITAL, DrvJoy2 + 4, "p2 fire 4" }, {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, {"Service", BIT_DIGITAL, DrvJoy3 + 4, "service" }, {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, }; STDINPUTINFO(Quizf1) static struct BurnInputInfo Matchit2InputList[] = { {"P1 Coin", BIT_DIGITAL, DrvJoy3 + 2, "p1 coin" }, {"P1 Start", BIT_DIGITAL, DrvJoy3 + 0, "p1 start" }, {"P1 Up", BIT_DIGITAL, DrvJoy1 + 3, "p1 up" }, {"P1 Down", BIT_DIGITAL, DrvJoy1 + 2, "p1 down" }, {"P1 Left", BIT_DIGITAL, DrvJoy1 + 1, "p1 left" }, {"P1 Right", BIT_DIGITAL, DrvJoy1 + 0, "p1 right" }, {"P1 Button 1", BIT_DIGITAL, DrvJoy1 + 7, "p1 fire 1" }, {"P1 Button 2", BIT_DIGITAL, DrvJoy1 + 6, "p1 fire 2" }, {"P1 Button 3", BIT_DIGITAL, DrvJoy1 + 5, "p1 fire 3" }, {"P2 Coin", BIT_DIGITAL, DrvJoy3 + 3, "p2 coin" }, {"P2 Start", BIT_DIGITAL, DrvJoy3 + 1, "p2 start" }, {"P2 Up", BIT_DIGITAL, DrvJoy2 + 3, "p2 up" }, {"P2 Down", BIT_DIGITAL, DrvJoy2 + 2, "p2 down" }, {"P2 Left", BIT_DIGITAL, DrvJoy2 + 1, "p2 left" }, {"P2 Right", BIT_DIGITAL, DrvJoy2 + 0, "p2 right" }, {"P2 Button 1", BIT_DIGITAL, DrvJoy2 + 7, "p2 fire 1" }, {"P2 Button 2", BIT_DIGITAL, DrvJoy2 + 6, "p2 fire 2" }, {"P2 Button 3", BIT_DIGITAL, DrvJoy2 + 5, "p2 fire 3" }, {"Reset", BIT_DIGITAL, &DrvReset, "reset" }, {"Service", BIT_DIGITAL, DrvJoy3 + 4, "service" }, {"Dip A", BIT_DIPSWITCH, DrvDips + 0, "dip" }, {"Dip B", BIT_DIPSWITCH, DrvDips + 1, "dip" }, }; STDINPUTINFO(Matchit2) static struct BurnDIPInfo DynablstDIPList[]= { {0x22, 0xff, 0xff, 0xbf, NULL }, {0x23, 0xff, 0xff, 0xff, NULL }, {0 , 0xfe, 0 , 4, "Lives" }, {0x22, 0x01, 0x03, 0x02, "2" }, {0x22, 0x01, 0x03, 0x03, "3" }, {0x22, 0x01, 0x03, 0x01, "4" }, {0x22, 0x01, 0x03, 0x00, "5" }, {0 , 0xfe, 0 , 4, "Difficulty" }, {0x22, 0x01, 0x0c, 0x08, "Easy" }, {0x22, 0x01, 0x0c, 0x0c, "Medium" }, {0x22, 0x01, 0x0c, 0x04, "Hard" }, {0x22, 0x01, 0x0c, 0x00, "Hardest" }, {0 , 0xfe, 0 , 2, "Game Title" }, {0x22, 0x01, 0x10, 0x10, "Dynablaster" }, {0x22, 0x01, 0x10, 0x00, "Bomber Man" }, {0 , 0xfe, 0 , 2, "Allow Continue" }, {0x22, 0x01, 0x20, 0x00, "No" }, {0x22, 0x01, 0x20, 0x20, "Yes" }, {0 , 0xfe, 0 , 2, "Demo Sounds" }, {0x22, 0x01, 0x40, 0x40, "Off" }, {0x22, 0x01, 0x40, 0x00, "On" }, {0 , 0xfe, 0 , 2, "Service Mode" }, {0x22, 0x01, 0x80, 0x80, "Off" }, {0x22, 0x01, 0x80, 0x00, "On" }, {0 , 0xfe, 0 , 2, "Flip Screen" }, {0x23, 0x01, 0x01, 0x01, "Off" }, {0x23, 0x01, 0x01, 0x00, "On" }, {0 , 0xfe, 0 , 4, "Cabinet" }, {0x23, 0x01, 0x06, 0x04, "2 Player Upright" }, {0x23, 0x01, 0x06, 0x06, "4 Player Upright A" }, {0x23, 0x01, 0x06, 0x02, "4 Player Upright B" }, {0x23, 0x01, 0x06, 0x00, "Cocktail" }, {0 , 0xfe, 0 , 2, "Coin Mode" }, {0x23, 0x01, 0x08, 0x08, "1" }, {0x23, 0x01, 0x08, 0x00, "2" }, {0 , 0xfe, 0 , 16, "Coinage" }, {0x23, 0x01, 0xf0, 0xa0, "6 Coins 1 Credits" }, {0x23, 0x01, 0xf0, 0xb0, "5 Coins 1 Credits" }, {0x23, 0x01, 0xf0, 0xc0, "4 Coins 1 Credits" }, {0x23, 0x01, 0xf0, 0xd0, "3 Coins 1 Credits" }, {0x23, 0x01, 0xf0, 0xe0, "2 Coins 1 Credits" }, {0x23, 0x01, 0xf0, 0x10, "2 Coins to Start/1 to Continue" }, {0x23, 0x01, 0xf0, 0x30, "3 Coins 2 Credits" }, {0x23, 0x01, 0xf0, 0x20, "4 Coins 3 Credits" }, {0x23, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, {0x23, 0x01, 0xf0, 0x40, "2 Coins 3 Credits" }, {0x23, 0x01, 0xf0, 0x90, "1 Coin 2 Credits" }, {0x23, 0x01, 0xf0, 0x80, "1 Coin 3 Credits" }, {0x23, 0x01, 0xf0, 0x70, "1 Coin 4 Credits" }, {0x23, 0x01, 0xf0, 0x60, "1 Coin 5 Credits" }, {0x23, 0x01, 0xf0, 0x50, "1 Coin 6 Credits" }, {0x23, 0x01, 0xf0, 0x00, "Free Play" }, }; STDDIPINFO(Dynablst) static struct BurnDIPInfo AtompunkDIPList[]= { {0x22, 0xff, 0xff, 0xbf, NULL }, {0x23, 0xff, 0xff, 0xff, NULL }, {0 , 0xfe, 0 , 4, "Lives" }, {0x22, 0x01, 0x03, 0x02, "2" }, {0x22, 0x01, 0x03, 0x03, "3" }, {0x22, 0x01, 0x03, 0x01, "4" }, {0x22, 0x01, 0x03, 0x00, "5" }, {0 , 0xfe, 0 , 4, "Difficulty" }, {0x22, 0x01, 0x0c, 0x08, "Easy" }, {0x22, 0x01, 0x0c, 0x0c, "Medium" }, {0x22, 0x01, 0x0c, 0x04, "Hard" }, {0x22, 0x01, 0x0c, 0x00, "Hardest" }, {0 , 0xfe, 0 , 2, "Unknown" }, {0x22, 0x01, 0x10, 0x10, "Off" }, {0x22, 0x01, 0x10, 0x00, "On" }, {0 , 0xfe, 0 , 2, "Allow Continue" }, {0x22, 0x01, 0x20, 0x00, "No" }, {0x22, 0x01, 0x20, 0x20, "Yes" }, {0 , 0xfe, 0 , 2, "Demo Sounds" }, {0x22, 0x01, 0x40, 0x40, "Off" }, {0x22, 0x01, 0x40, 0x00, "On" }, {0 , 0xfe, 0 , 2, "Service Mode" }, {0x22, 0x01, 0x80, 0x80, "Off" }, {0x22, 0x01, 0x80, 0x00, "On" }, {0 , 0xfe, 0 , 2, "Flip Screen" }, {0x23, 0x01, 0x01, 0x01, "Off" }, {0x23, 0x01, 0x01, 0x00, "On" }, {0 , 0xfe, 0 , 4, "Cabinet" }, {0x23, 0x01, 0x06, 0x04, "2 Player Upright" }, {0x23, 0x01, 0x06, 0x06, "4 Player Upright A" }, {0x23, 0x01, 0x06, 0x02, "4 Player Upright B" }, {0x23, 0x01, 0x06, 0x00, "Cocktail" }, {0 , 0xfe, 0 , 2, "Coin Mode" }, {0x23, 0x01, 0x08, 0x08, "1" }, {0x23, 0x01, 0x08, 0x00, "2" }, {0 , 0xfe, 0 , 16, "Coinage" }, {0x23, 0x01, 0xf0, 0xa0, "6 Coins 1 Credits" }, {0x23, 0x01, 0xf0, 0xb0, "5 Coins 1 Credits" }, {0x23, 0x01, 0xf0, 0xc0, "4 Coins 1 Credits" }, {0x23, 0x01, 0xf0, 0xd0, "3 Coins 1 Credits" }, {0x23, 0x01, 0xf0, 0xe0, "2 Coins 1 Credits" }, {0x23, 0x01, 0xf0, 0x10, "2 Coins to Start/1 to Continue" }, {0x23, 0x01, 0xf0, 0x30, "3 Coins 2 Credits" }, {0x23, 0x01, 0xf0, 0x20, "4 Coins 3 Credits" }, {0x23, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, {0x23, 0x01, 0xf0, 0x40, "2 Coins 3 Credits" }, {0x23, 0x01, 0xf0, 0x90, "1 Coin 2 Credits" }, {0x23, 0x01, 0xf0, 0x80, "1 Coin 3 Credits" }, {0x23, 0x01, 0xf0, 0x70, "1 Coin 4 Credits" }, {0x23, 0x01, 0xf0, 0x60, "1 Coin 5 Credits" }, {0x23, 0x01, 0xf0, 0x50, "1 Coin 6 Credits" }, {0x23, 0x01, 0xf0, 0x00, "Free Play" }, }; STDDIPINFO(Atompunk) static struct BurnDIPInfo BombrmanDIPList[]= { {0x12, 0xff, 0xff, 0xaf, NULL }, {0x13, 0xff, 0xff, 0xf9, NULL }, {0 , 0xfe, 0 , 4, "Lives" }, {0x12, 0x01, 0x03, 0x02, "2" }, {0x12, 0x01, 0x03, 0x03, "3" }, {0x12, 0x01, 0x03, 0x01, "4" }, {0x12, 0x01, 0x03, 0x00, "5" }, {0 , 0xfe, 0 , 4, "Difficulty" }, {0x12, 0x01, 0x0c, 0x08, "Easy" }, {0x12, 0x01, 0x0c, 0x0c, "Medium" }, {0x12, 0x01, 0x0c, 0x04, "Hard" }, {0x12, 0x01, 0x0c, 0x00, "Hardest" }, {0 , 0xfe, 0 , 2, "Allow Continue" }, {0x12, 0x01, 0x20, 0x00, "No" }, {0x12, 0x01, 0x20, 0x20, "Yes" }, {0 , 0xfe, 0 , 2, "Demo Sounds" }, {0x12, 0x01, 0x40, 0x40, "Off" }, {0x12, 0x01, 0x40, 0x00, "On" }, {0 , 0xfe, 0 , 2, "Service Mode" }, {0x12, 0x01, 0x80, 0x80, "Off" }, {0x12, 0x01, 0x80, 0x00, "On" }, {0 , 0xfe, 0 , 2, "Flip Screen" }, {0x13, 0x01, 0x01, 0x01, "Off" }, {0x13, 0x01, 0x01, 0x00, "On" }, {0 , 0xfe, 0 , 2, "Coin Mode" }, {0x13, 0x01, 0x08, 0x08, "1" }, {0x13, 0x01, 0x08, 0x00, "2" }, {0 , 0xfe, 0 , 16, "Coinage" }, {0x13, 0x01, 0xf0, 0xa0, "6 Coins 1 Credits" }, {0x13, 0x01, 0xf0, 0xb0, "5 Coins 1 Credits" }, {0x13, 0x01, 0xf0, 0xc0, "4 Coins 1 Credits" }, {0x13, 0x01, 0xf0, 0xd0, "3 Coins 1 Credits" }, {0x13, 0x01, 0xf0, 0xe0, "2 Coins 1 Credits" }, {0x13, 0x01, 0xf0, 0x10, "2 Coins to Start/1 to Continue" }, {0x13, 0x01, 0xf0, 0x30, "3 Coins 2 Credits" }, {0x13, 0x01, 0xf0, 0x20, "4 Coins 3 Credits" }, {0x13, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, {0x13, 0x01, 0xf0, 0x40, "2 Coins 3 Credits" }, {0x13, 0x01, 0xf0, 0x90, "1 Coin 2 Credits" }, {0x13, 0x01, 0xf0, 0x80, "1 Coin 3 Credits" }, {0x13, 0x01, 0xf0, 0x70, "1 Coin 4 Credits" }, {0x13, 0x01, 0xf0, 0x60, "1 Coin 5 Credits" }, {0x13, 0x01, 0xf0, 0x50, "1 Coin 6 Credits" }, {0x13, 0x01, 0xf0, 0x00, "Free Play" }, }; STDDIPINFO(Bombrman) static struct BurnDIPInfo HasamuDIPList[]= { {0x12, 0xff, 0xff, 0xbf, NULL }, {0x13, 0xff, 0xff, 0xff, NULL }, {0 , 0xfe, 0 , 2, "Allow Continue" }, {0x12, 0x01, 0x20, 0x00, "No" }, {0x12, 0x01, 0x20, 0x20, "Yes" }, {0 , 0xfe, 0 , 2, "Demo Sounds" }, {0x12, 0x01, 0x40, 0x40, "Off" }, {0x12, 0x01, 0x40, 0x00, "On" }, {0 , 0xfe, 0 , 2, "Service Mode" }, {0x12, 0x01, 0x80, 0x80, "Off" }, {0x12, 0x01, 0x80, 0x00, "On" }, {0 , 0xfe, 0 , 2, "Flip Screen" }, {0x13, 0x01, 0x01, 0x01, "Off" }, {0x13, 0x01, 0x01, 0x00, "On" }, {0 , 0xfe, 0 , 2, "Unknown" }, {0x13, 0x01, 0x02, 0x02, "Off" }, {0x13, 0x01, 0x02, 0x00, "On" }, {0 , 0xfe, 0 , 2, "Coin Mode" }, {0x13, 0x01, 0x08, 0x08, "1" }, {0x13, 0x01, 0x08, 0x00, "2" }, {0 , 0xfe, 0 , 16, "Coinage" }, {0x13, 0x01, 0xf0, 0xa0, "6 Coins 1 Credits" }, {0x13, 0x01, 0xf0, 0xb0, "5 Coins 1 Credits" }, {0x13, 0x01, 0xf0, 0xc0, "4 Coins 1 Credits" }, {0x13, 0x01, 0xf0, 0xd0, "3 Coins 1 Credits" }, {0x13, 0x01, 0xf0, 0xe0, "2 Coins 1 Credits" }, {0x13, 0x01, 0xf0, 0x10, "2 Coins to Start/1 to Continue" }, {0x13, 0x01, 0xf0, 0x30, "3 Coins 2 Credits" }, {0x13, 0x01, 0xf0, 0x20, "4 Coins 3 Credits" }, {0x13, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, {0x13, 0x01, 0xf0, 0x40, "2 Coins 3 Credits" }, {0x13, 0x01, 0xf0, 0x90, "1 Coin 2 Credits" }, {0x13, 0x01, 0xf0, 0x80, "1 Coin 3 Credits" }, {0x13, 0x01, 0xf0, 0x70, "1 Coin 4 Credits" }, {0x13, 0x01, 0xf0, 0x60, "1 Coin 5 Credits" }, {0x13, 0x01, 0xf0, 0x50, "1 Coin 6 Credits" }, {0x13, 0x01, 0xf0, 0x00, "Free Play" }, }; STDDIPINFO(Hasamu) static struct BurnDIPInfo RiskchalDIPList[]= { {0x12, 0xff, 0xff, 0xbf, NULL }, {0x13, 0xff, 0xff, 0xff, NULL }, {0 , 0xfe, 0 , 4, "Lives" }, {0x12, 0x01, 0x03, 0x02, "2" }, {0x12, 0x01, 0x03, 0x03, "3" }, {0x12, 0x01, 0x03, 0x01, "4" }, {0x12, 0x01, 0x03, 0x00, "5" }, {0 , 0xfe, 0 , 4, "Difficulty" }, {0x12, 0x01, 0x0c, 0x08, "Easy" }, {0x12, 0x01, 0x0c, 0x0c, "Medium" }, {0x12, 0x01, 0x0c, 0x04, "Hard" }, {0x12, 0x01, 0x0c, 0x00, "Hardest" }, {0 , 0xfe, 0 , 2, "Demo Sounds" }, {0x12, 0x01, 0x40, 0x40, "Off" }, {0x12, 0x01, 0x40, 0x00, "On" }, {0 , 0xfe, 0 , 2, "Service Mode" }, {0x12, 0x01, 0x80, 0x80, "Off" }, {0x12, 0x01, 0x80, 0x00, "On" }, {0 , 0xfe, 0 , 2, "Flip Screen" }, {0x13, 0x01, 0x01, 0x01, "Off" }, {0x13, 0x01, 0x01, 0x00, "On" }, {0 , 0xfe, 0 , 2, "Coin Slots" }, {0x13, 0x01, 0x04, 0x04, "Common" }, {0x13, 0x01, 0x04, 0x00, "Separate" }, {0 , 0xfe, 0 , 2, "Coin Mode" }, {0x13, 0x01, 0x08, 0x08, "1" }, {0x13, 0x01, 0x08, 0x00, "2" }, {0 , 0xfe, 0 , 16, "Coinage" }, {0x13, 0x01, 0xf0, 0xa0, "6 Coins 1 Credits" }, {0x13, 0x01, 0xf0, 0xb0, "5 Coins 1 Credits" }, {0x13, 0x01, 0xf0, 0xc0, "4 Coins 1 Credits" }, {0x13, 0x01, 0xf0, 0xd0, "3 Coins 1 Credits" }, {0x13, 0x01, 0xf0, 0xe0, "2 Coins 1 Credits" }, {0x13, 0x01, 0xf0, 0x10, "2 Coins to Start/1 to Continue" }, {0x13, 0x01, 0xf0, 0x30, "3 Coins 2 Credits" }, {0x13, 0x01, 0xf0, 0x20, "4 Coins 3 Credits" }, {0x13, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, {0x13, 0x01, 0xf0, 0x40, "2 Coins 3 Credits" }, {0x13, 0x01, 0xf0, 0x90, "1 Coin 2 Credits" }, {0x13, 0x01, 0xf0, 0x80, "1 Coin 3 Credits" }, {0x13, 0x01, 0xf0, 0x70, "1 Coin 4 Credits" }, {0x13, 0x01, 0xf0, 0x60, "1 Coin 5 Credits" }, {0x13, 0x01, 0xf0, 0x50, "1 Coin 6 Credits" }, {0x13, 0x01, 0xf0, 0x00, "Free Play" }, }; STDDIPINFO(Riskchal) static struct BurnDIPInfo BbmanwDIPList[]= { {0x22, 0xff, 0xff, 0xbf, NULL }, {0x23, 0xff, 0xff, 0xff, NULL }, {0 , 0xfe, 0 , 4, "Lives" }, {0x22, 0x01, 0x03, 0x02, "2" }, {0x22, 0x01, 0x03, 0x03, "3" }, {0x22, 0x01, 0x03, 0x01, "4" }, {0x22, 0x01, 0x03, 0x00, "5" }, {0 , 0xfe, 0 , 4, "Difficulty" }, {0x22, 0x01, 0x0c, 0x08, "Easy" }, {0x22, 0x01, 0x0c, 0x0c, "Medium" }, {0x22, 0x01, 0x0c, 0x04, "Hard" }, {0x22, 0x01, 0x0c, 0x00, "Hardest" }, {0 , 0xfe, 0 , 2, "Game Title" }, {0x22, 0x01, 0x10, 0x10, "Bomber Man World" }, {0x22, 0x01, 0x10, 0x00, "New Dyna Blaster Global Quest" }, {0 , 0xfe, 0 , 2, "Allow Continue" }, {0x22, 0x01, 0x20, 0x00, "No" }, {0x22, 0x01, 0x20, 0x20, "Yes" }, {0 , 0xfe, 0 , 2, "Demo Sounds" }, {0x22, 0x01, 0x40, 0x40, "Off" }, {0x22, 0x01, 0x40, 0x00, "On" }, {0 , 0xfe, 0 , 2, "Service Mode" }, {0x22, 0x01, 0x80, 0x80, "Off" }, {0x22, 0x01, 0x80, 0x00, "On" }, {0 , 0xfe, 0 , 2, "Flip Screen" }, {0x23, 0x01, 0x01, 0x01, "Off" }, {0x23, 0x01, 0x01, 0x00, "On" }, {0 , 0xfe, 0 , 4, "Cabinet" }, {0x23, 0x01, 0x06, 0x04, "2 Player" }, {0x23, 0x01, 0x06, 0x06, "4 Player Seprate Coins" }, {0x23, 0x01, 0x06, 0x02, "4 Player Shared Coins" }, {0x23, 0x01, 0x06, 0x00, "4 Player 1&2 3&4 Share Coins" }, {0 , 0xfe, 0 , 2, "Coin Mode" }, {0x23, 0x01, 0x08, 0x08, "1" }, {0x23, 0x01, 0x08, 0x00, "2" }, {0 , 0xfe, 0 , 16, "Coinage" }, {0x23, 0x01, 0xf0, 0xa0, "6 Coins 1 Credits" }, {0x23, 0x01, 0xf0, 0xb0, "5 Coins 1 Credits" }, {0x23, 0x01, 0xf0, 0xc0, "4 Coins 1 Credits" }, {0x23, 0x01, 0xf0, 0xd0, "3 Coins 1 Credits" }, {0x23, 0x01, 0xf0, 0xe0, "2 Coins 1 Credits" }, {0x23, 0x01, 0xf0, 0x10, "2 Coins to Start/1 to Continue" }, {0x23, 0x01, 0xf0, 0x30, "3 Coins 2 Credits" }, {0x23, 0x01, 0xf0, 0x20, "4 Coins 3 Credits" }, {0x23, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, {0x23, 0x01, 0xf0, 0x40, "2 Coins 3 Credits" }, {0x23, 0x01, 0xf0, 0x90, "1 Coin 2 Credits" }, {0x23, 0x01, 0xf0, 0x80, "1 Coin 3 Credits" }, {0x23, 0x01, 0xf0, 0x70, "1 Coin 4 Credits" }, {0x23, 0x01, 0xf0, 0x60, "1 Coin 5 Credits" }, {0x23, 0x01, 0xf0, 0x50, "1 Coin 6 Credits" }, {0x23, 0x01, 0xf0, 0x00, "Free Play" }, }; STDDIPINFO(Bbmanw) static struct BurnDIPInfo BbmanwjDIPList[]= { {0x22, 0xff, 0xff, 0xbf, NULL }, {0x23, 0xff, 0xff, 0xff, NULL }, {0 , 0xfe, 0 , 4, "Lives" }, {0x22, 0x01, 0x03, 0x02, "2" }, {0x22, 0x01, 0x03, 0x03, "3" }, {0x22, 0x01, 0x03, 0x01, "4" }, {0x22, 0x01, 0x03, 0x00, "5" }, {0 , 0xfe, 0 , 4, "Difficulty" }, {0x22, 0x01, 0x0c, 0x08, "Easy" }, {0x22, 0x01, 0x0c, 0x0c, "Medium" }, {0x22, 0x01, 0x0c, 0x04, "Hard" }, {0x22, 0x01, 0x0c, 0x00, "Hardest" }, {0 , 0xfe, 0 , 2, "Allow Continue" }, {0x22, 0x01, 0x20, 0x00, "No" }, {0x22, 0x01, 0x20, 0x20, "Yes" }, {0 , 0xfe, 0 , 2, "Demo Sounds" }, {0x22, 0x01, 0x40, 0x40, "Off" }, {0x22, 0x01, 0x40, 0x00, "On" }, {0 , 0xfe, 0 , 2, "Service Mode" }, {0x22, 0x01, 0x80, 0x80, "Off" }, {0x22, 0x01, 0x80, 0x00, "On" }, {0 , 0xfe, 0 , 2, "Flip Screen" }, {0x23, 0x01, 0x01, 0x01, "Off" }, {0x23, 0x01, 0x01, 0x00, "On" }, {0 , 0xfe, 0 , 4, "Cabinet" }, {0x23, 0x01, 0x06, 0x04, "2 Player" }, {0x23, 0x01, 0x06, 0x06, "4 Player Seprate Coins" }, {0x23, 0x01, 0x06, 0x02, "4 Player Shared Coins" }, {0x23, 0x01, 0x06, 0x00, "4 Player 1&2 3&4 Share Coins" }, {0 , 0xfe, 0 , 2, "Coin Mode" }, {0x23, 0x01, 0x08, 0x08, "1" }, {0x23, 0x01, 0x08, 0x00, "2" }, {0 , 0xfe, 0 , 16, "Coinage" }, {0x23, 0x01, 0xf0, 0xa0, "6 Coins 1 Credits" }, {0x23, 0x01, 0xf0, 0xb0, "5 Coins 1 Credits" }, {0x23, 0x01, 0xf0, 0xc0, "4 Coins 1 Credits" }, {0x23, 0x01, 0xf0, 0xd0, "3 Coins 1 Credits" }, {0x23, 0x01, 0xf0, 0xe0, "2 Coins 1 Credits" }, {0x23, 0x01, 0xf0, 0x10, "2 Coins to Start/1 to Continue" }, {0x23, 0x01, 0xf0, 0x30, "3 Coins 2 Credits" }, {0x23, 0x01, 0xf0, 0x20, "4 Coins 3 Credits" }, {0x23, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, {0x23, 0x01, 0xf0, 0x40, "2 Coins 3 Credits" }, {0x23, 0x01, 0xf0, 0x90, "1 Coin 2 Credits" }, {0x23, 0x01, 0xf0, 0x80, "1 Coin 3 Credits" }, {0x23, 0x01, 0xf0, 0x70, "1 Coin 4 Credits" }, {0x23, 0x01, 0xf0, 0x60, "1 Coin 5 Credits" }, {0x23, 0x01, 0xf0, 0x50, "1 Coin 6 Credits" }, {0x23, 0x01, 0xf0, 0x00, "Free Play" }, }; STDDIPINFO(Bbmanwj) static struct BurnDIPInfo Quizf1DIPList[]= { {0x16, 0xff, 0xff, 0x9f, NULL }, {0x17, 0xff, 0xff, 0xff, NULL }, {0 , 0xfe, 0 , 4, "Lives" }, {0x16, 0x01, 0x03, 0x02, "2" }, {0x16, 0x01, 0x03, 0x03, "3" }, {0x16, 0x01, 0x03, 0x01, "4" }, {0x16, 0x01, 0x03, 0x00, "5" }, {0 , 0xfe, 0 , 2, "Input Device" }, {0x16, 0x01, 0x20, 0x20, "Joystick" }, {0x16, 0x01, 0x20, 0x00, "Buttons" }, {0 , 0xfe, 0 , 2, "Demo Sounds" }, {0x16, 0x01, 0x40, 0x40, "Off" }, {0x16, 0x01, 0x40, 0x00, "On" }, {0 , 0xfe, 0 , 2, "Service Mode" }, {0x16, 0x01, 0x80, 0x80, "Off" }, {0x16, 0x01, 0x80, 0x00, "On" }, {0 , 0xfe, 0 , 2, "Flip Screen" }, {0x17, 0x01, 0x01, 0x01, "Off" }, {0x17, 0x01, 0x01, 0x00, "On" }, {0 , 0xfe, 0 , 2, "Coin Mode" }, {0x17, 0x01, 0x08, 0x08, "1" }, {0x17, 0x01, 0x08, 0x00, "2" }, {0 , 0xfe, 0 , 16, "Coinage" }, {0x17, 0x01, 0xf0, 0xa0, "6 Coins 1 Credits" }, {0x17, 0x01, 0xf0, 0xb0, "5 Coins 1 Credits" }, {0x17, 0x01, 0xf0, 0xc0, "4 Coins 1 Credits" }, {0x17, 0x01, 0xf0, 0xd0, "3 Coins 1 Credits" }, {0x17, 0x01, 0xf0, 0xe0, "2 Coins 1 Credits" }, {0x17, 0x01, 0xf0, 0x10, "2 Coins to Start/1 to Continue" }, {0x17, 0x01, 0xf0, 0x30, "3 Coins 2 Credits" }, {0x17, 0x01, 0xf0, 0x20, "4 Coins 3 Credits" }, {0x17, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, {0x17, 0x01, 0xf0, 0x40, "2 Coins 3 Credits" }, {0x17, 0x01, 0xf0, 0x90, "1 Coin 2 Credits" }, {0x17, 0x01, 0xf0, 0x80, "1 Coin 3 Credits" }, {0x17, 0x01, 0xf0, 0x70, "1 Coin 4 Credits" }, {0x17, 0x01, 0xf0, 0x60, "1 Coin 5 Credits" }, {0x17, 0x01, 0xf0, 0x50, "1 Coin 6 Credits" }, {0x17, 0x01, 0xf0, 0x00, "Free Play" }, }; STDDIPINFO(Quizf1) static struct BurnDIPInfo Matchit2DIPList[]= { {0x14, 0xff, 0xff, 0xff, NULL }, {0x15, 0xff, 0xff, 0xff, NULL }, {0 , 0xfe, 0 , 2, "Girls Mode" }, {0x14, 0x01, 0x01, 0x00, "Off" }, {0x14, 0x01, 0x01, 0x01, "On" }, {0 , 0xfe, 0 , 2, "China Tiles" }, {0x14, 0x01, 0x02, 0x02, "Mahjong" }, {0x14, 0x01, 0x02, 0x00, "Alpha-Numeric" }, {0 , 0xfe, 0 , 4, "Difficulty" }, {0x14, 0x01, 0x0c, 0x00, "Very Hard" }, {0x14, 0x01, 0x0c, 0x04, "Hard" }, {0x14, 0x01, 0x0c, 0x0c, "Normal" }, {0x14, 0x01, 0x0c, 0x08, "Easy" }, {0 , 0xfe, 0 , 4, "Timer Speed" }, {0x14, 0x01, 0x30, 0x00, "Very Hard" }, {0x14, 0x01, 0x30, 0x10, "Hard" }, {0x14, 0x01, 0x30, 0x30, "Normal" }, {0x14, 0x01, 0x30, 0x20, "Easy" }, {0 , 0xfe, 0 , 2, "Title Screen" }, {0x14, 0x01, 0x40, 0x40, "Match It II" }, {0x14, 0x01, 0x40, 0x00, "Shisensho II" }, {0 , 0xfe, 0 , 2, "Service Mode" }, {0x14, 0x01, 0x80, 0x80, "Off" }, {0x14, 0x01, 0x80, 0x00, "On" }, {0 , 0xfe, 0 , 2, "Flip Screen" }, {0x15, 0x01, 0x01, 0x01, "Off" }, {0x15, 0x01, 0x01, 0x00, "On" }, {0 , 0xfe, 0 , 3, "Language" }, {0x15, 0x01, 0x06, 0x06, "English" }, {0x15, 0x01, 0x06, 0x04, "German" }, {0x15, 0x01, 0x06, 0x02, "Korean" }, {0 , 0xfe, 0 , 2, "Coin Mode" }, {0x15, 0x01, 0x08, 0x08, "1" }, {0x15, 0x01, 0x08, 0x00, "2" }, {0 , 0xfe, 0 , 16, "Coinage" }, {0x15, 0x01, 0xf0, 0xa0, "6 Coins 1 Credits" }, {0x15, 0x01, 0xf0, 0xb0, "5 Coins 1 Credits" }, {0x15, 0x01, 0xf0, 0xc0, "4 Coins 1 Credits" }, {0x15, 0x01, 0xf0, 0xd0, "3 Coins 1 Credits" }, {0x15, 0x01, 0xf0, 0xe0, "2 Coins 1 Credits" }, {0x15, 0x01, 0xf0, 0x10, "2 Coins to Start/1 to Continue" }, {0x15, 0x01, 0xf0, 0x30, "3 Coins 2 Credits" }, {0x15, 0x01, 0xf0, 0x20, "4 Coins 3 Credits" }, {0x15, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, {0x15, 0x01, 0xf0, 0x40, "2 Coins 3 Credits" }, {0x15, 0x01, 0xf0, 0x90, "1 Coin 2 Credits" }, {0x15, 0x01, 0xf0, 0x80, "1 Coin 3 Credits" }, {0x15, 0x01, 0xf0, 0x70, "1 Coin 4 Credits" }, {0x15, 0x01, 0xf0, 0x60, "1 Coin 5 Credits" }, {0x15, 0x01, 0xf0, 0x50, "1 Coin 6 Credits" }, {0x15, 0x01, 0xf0, 0x00, "Free Play" }, }; STDDIPINFO(Matchit2) static struct BurnDIPInfo Shisen2DIPList[]= { {0x14, 0xff, 0xff, 0xbf, NULL }, {0x15, 0xff, 0xff, 0xff, NULL }, {0 , 0xfe, 0 , 2, "Girls Mode" }, {0x14, 0x01, 0x01, 0x00, "Off" }, {0x14, 0x01, 0x01, 0x01, "On" }, {0 , 0xfe, 0 , 4, "Difficulty" }, {0x14, 0x01, 0x0c, 0x00, "Very Hard" }, {0x14, 0x01, 0x0c, 0x04, "Hard" }, {0x14, 0x01, 0x0c, 0x0c, "Normal" }, {0x14, 0x01, 0x0c, 0x08, "Easy" }, {0 , 0xfe, 0 , 4, "Timer Speed" }, {0x14, 0x01, 0x30, 0x00, "Very Hard" }, {0x14, 0x01, 0x30, 0x10, "Hard" }, {0x14, 0x01, 0x30, 0x30, "Normal" }, {0x14, 0x01, 0x30, 0x20, "Easy" }, {0 , 0xfe, 0 , 2, "Demo Sounds" }, {0x14, 0x01, 0x40, 0x40, "Off" }, {0x14, 0x01, 0x40, 0x00, "On" }, {0 , 0xfe, 0 , 2, "Service Mode" }, {0x14, 0x01, 0x80, 0x80, "Off" }, {0x14, 0x01, 0x80, 0x00, "On" }, {0 , 0xfe, 0 , 2, "Flip Screen" }, {0x15, 0x01, 0x01, 0x01, "Off" }, {0x15, 0x01, 0x01, 0x00, "On" }, {0 , 0xfe, 0 , 2, "Coin Mode" }, {0x15, 0x01, 0x08, 0x08, "1" }, {0x15, 0x01, 0x08, 0x00, "2" }, {0 , 0xfe, 0 , 16, "Coinage" }, {0x15, 0x01, 0xf0, 0xa0, "6 Coins 1 Credits" }, {0x15, 0x01, 0xf0, 0xb0, "5 Coins 1 Credits" }, {0x15, 0x01, 0xf0, 0xc0, "4 Coins 1 Credits" }, {0x15, 0x01, 0xf0, 0xd0, "3 Coins 1 Credits" }, {0x15, 0x01, 0xf0, 0xe0, "2 Coins 1 Credits" }, {0x15, 0x01, 0xf0, 0x10, "2 Coins to Start/1 to Continue" }, {0x15, 0x01, 0xf0, 0x30, "3 Coins 2 Credits" }, {0x15, 0x01, 0xf0, 0x20, "4 Coins 3 Credits" }, {0x15, 0x01, 0xf0, 0xf0, "1 Coin 1 Credits" }, {0x15, 0x01, 0xf0, 0x40, "2 Coins 3 Credits" }, {0x15, 0x01, 0xf0, 0x90, "1 Coin 2 Credits" }, {0x15, 0x01, 0xf0, 0x80, "1 Coin 3 Credits" }, {0x15, 0x01, 0xf0, 0x70, "1 Coin 4 Credits" }, {0x15, 0x01, 0xf0, 0x60, "1 Coin 5 Credits" }, {0x15, 0x01, 0xf0, 0x50, "1 Coin 6 Credits" }, {0x15, 0x01, 0xf0, 0x00, "Free Play" }, }; STDDIPINFO(Shisen2) static void setvector_callback(INT32 param) { switch (param) { case VECTOR_INIT: irqvector = 0xff; break; case YM2151_ASSERT: irqvector &= 0xef; break; case YM2151_CLEAR: irqvector |= 0x10; break; case Z80_ASSERT: irqvector &= 0xdf; break; case Z80_CLEAR: irqvector |= 0x20; break; } ZetSetVector(irqvector); ZetSetIRQLine(0, (irqvector == 0xff) ? ZET_IRQSTATUS_NONE : ZET_IRQSTATUS_ACK); } static inline void update_palette_entry(INT32 entry) { UINT16 d = *((UINT16*)(DrvPalRAM + entry)); #ifndef LSB_FIRST d = BURN_ENDIAN_SWAP_INT16(d); #endif UINT8 r = (d >> 0) & 0x1f; UINT8 g = (d >> 5) & 0x1f; UINT8 b = (d >> 10) & 0x1f; r = (r << 3) | (r >> 2); g = (g << 3) | (g >> 2); b = (b << 3) | (b >> 2); DrvPalette[entry / 2] = BurnHighCol(r, g, b, 0); } void __fastcall m90_main_write(UINT32 address, UINT8 data) { if ((address & 0xffc00) == 0xe0000) { DrvPalRAM[address & 0x3ff] = data; update_palette_entry(address & 0x3fe); return; } } UINT8 __fastcall m90_main_read(UINT32 /*address*/) { return 0; } void __fastcall m90_main_write_port(UINT32 port, UINT8 data) { if ((port & ~0x0f) == 0x80) { m90_video_control[port & 0x0f] = data; return; } switch (port) { case 0x00: // case 0x01: *soundlatch = data; setvector_callback(Z80_ASSERT); return; case 0x02: // case 0x03: // coin counter return; case 0x04: //case 0x05: { INT32 bankaddress = 0x100000 + 0x10000 * (data & 0x0f); VezMapArea(0x80000, 0x8ffff, 0, DrvV30ROM + bankaddress); VezMapArea(0x80000, 0x8ffff, 2, DrvV30ROM + bankaddress); } return; case 0x90: // case 0x91: // nop dynablsb return; //default: // bprintf (0, _T("Writing %2.2x to port %2.2x wp\n"), data, port); // break; } } UINT8 __fastcall m90_main_read_port(UINT32 port) { switch (port) { case 0x00: return DrvInputs[0]; case 0x01: return DrvInputs[1]; case 0x02: return (DrvInputs[2] & 0x7f) | vblank; // system // case 0x03: return 0xff; // ? case 0x04: return DrvDips[0]; case 0x05: return DrvDips[1]; case 0x06: return DrvInputs[3]; case 0x07: return DrvInputs[4]; //default: // bprintf (0, _T("Reading port: %2.2x\n"), port); // break; } return 0; } void __fastcall m90_sound_write_port(UINT16 port, UINT8 data) { switch (port & 0xff) { case 0x00: case 0x40: // bbmanw BurnYM2151SelectRegister(data); return; case 0x01: case 0x41: // bbmanw BurnYM2151WriteRegister(data); return; case 0x80: sample_address >>= 5; sample_address = (sample_address & 0x00ff) | (data << 8); sample_address <<= 5; return; case 0x81: sample_address >>= 5; sample_address = (sample_address & 0xff00) | (data << 0); sample_address <<= 5; return; case 0x82: DACSignedWrite(0, data); sample_address = (sample_address + 1) & 0x3ffff; return; case 0x42: // bbmanw case 0x83: setvector_callback(Z80_CLEAR); return; } } UINT8 __fastcall m90_sound_read_port(UINT16 port) { switch (port & 0xff) { case 0x00: case 0x01: case 0x40: // bbmanw case 0x41: return BurnYM2151ReadStatus(); case 0x42: // bbmanw case 0x80: ZetSetVector(0xff); ZetSetIRQLine(0, ZET_IRQSTATUS_NONE); return *soundlatch; case 0x84: return DrvSndROM[sample_address & 0x3fff]; } return 0; } static void m72YM2151IRQHandler(INT32 nStatus) { setvector_callback(nStatus ? YM2151_ASSERT : YM2151_CLEAR); } static INT32 m90SyncDAC() { return (INT32)(float)(nBurnSoundLen * (ZetTotalCycles() / (3579545.000 / (nBurnFPS / 100.000)))); } static INT32 DrvDoReset() { memset (AllRam, 0, RamEnd - AllRam); VezOpen(0); VezReset(); VezClose(); ZetOpen(0); ZetReset(); setvector_callback(VECTOR_INIT); ZetClose(); BurnYM2151Reset(); DACReset(); sample_address = 0; return 0; } static INT32 MemIndex() { UINT8 *Next; Next = AllMem; DrvV30ROM = Next; Next += 0x200000; DrvZ80ROM = Next; Next += 0x010000; DrvGfxROM0 = Next; Next += 0x400000; DrvGfxROM1 = Next; Next += 0x400000; DrvSndROM = Next; Next += 0x180000; RamPrioBitmap = Next; Next += nScreenWidth * nScreenHeight; AllRam = Next; DrvSprRAM = Next; Next += 0x000800; DrvVidRAM = Next; Next += 0x010000; DrvV30RAM = Next; Next += 0x004000; DrvPalRAM = Next; Next += 0x000800; DrvZ80RAM = Next; Next += 0x001000; soundlatch = Next; Next += 0x000001; m90_video_control = Next; Next += 0x000010; RamEnd = Next; DrvPalette = (UINT32 *) Next; Next += 0x0200 * sizeof(UINT32); MemEnd = Next; return 0; } static INT32 DrvLoadRoms(INT32 codesize, INT32 samples, INT32 bank) { if (BurnLoadRom(DrvV30ROM + 1, 0, 2)) return 1; if (BurnLoadRom(DrvV30ROM + 0, 1, 2)) return 1; if (codesize == 0x40000) { memcpy (DrvV30ROM + 0x7fff0, DrvV30ROM + 0x3fff0, 0x10); } if (BurnLoadRom(DrvZ80ROM, 2, 1)) return 1; if (BurnLoadRom(DrvGfxROM1 + 0x000000, 3, 1)) return 1; if (BurnLoadRom(DrvGfxROM1 + 0x080000, 4, 1)) return 1; if (BurnLoadRom(DrvGfxROM1 + 0x100000, 5, 1)) return 1; if (BurnLoadRom(DrvGfxROM1 + 0x180000, 6, 1)) return 1; if (samples) { if (BurnLoadRom(DrvSndROM, 7, 1)) return 1; if (samples < 0x40000) { memcpy (DrvSndROM + 0x20000, DrvSndROM + 0x00000, 0x20000); } } if (bank) { if (BurnLoadRom(DrvV30ROM + 0x100001, 8, 2)) return 1; if (BurnLoadRom(DrvV30ROM + 0x100000, 9, 2)) return 1; } return 0; } static void map_main_cpu(UINT8 *decrypt_table, INT32 codesize, INT32 spriteram) { VezInit(0, V35_TYPE, 32000000/2); VezOpen(0); if (decrypt_table != NULL) { VezSetDecode(decrypt_table); } VezMapArea(0x00000, (codesize-1), 0, DrvV30ROM + 0x000000); VezMapArea(0x00000, (codesize-1), 2, DrvV30ROM + 0x000000); VezMapArea(0x80000, 0x8ffff, 0, DrvV30ROM + 0x100000); VezMapArea(0x80000, 0x8ffff, 2, DrvV30ROM + 0x100000); VezMapArea(0xa0000, 0xa3fff, 0, DrvV30RAM); VezMapArea(0xa0000, 0xa3fff, 1, DrvV30RAM); VezMapArea(0xa0000, 0xa3fff, 2, DrvV30RAM); VezMapArea(0xd0000, 0xdffff, 0, DrvVidRAM); VezMapArea(0xd0000, 0xdffff, 1, DrvVidRAM); VezMapArea(0xd0000, 0xdffff, 2, DrvVidRAM); VezMapArea(0xe0000, 0xe07ff, 0, DrvPalRAM); // VezMapArea(0xe0000, 0xe07ff, 1, DrvPalRAM); VezMapArea(0xe0000, 0xe07ff, 2, DrvPalRAM); VezMapArea(0xff800, 0xfffff, 0, DrvV30ROM + 0x07f800); VezMapArea(0xff800, 0xfffff, 2, DrvV30ROM + 0x07f800); if (spriteram) { VezMapArea(0x00000 + spriteram, 0x00fff + spriteram, 0, DrvSprRAM); // 00e - fff // ?? VezMapArea(0x00000 + spriteram, 0x00fff + spriteram, 1, DrvSprRAM); VezMapArea(0x00000 + spriteram, 0x00fff + spriteram, 2, DrvSprRAM); } VezSetReadHandler(m90_main_read); VezSetWriteHandler(m90_main_write); VezSetReadPort(m90_main_read_port); VezSetWritePort(m90_main_write_port); VezClose(); } static void DrvGfxDecode() { INT32 Plane[4] = { 0x180000 * 8, 0x100000 * 8, 0x080000 * 8, 0x000000 * 8 }; INT32 XOffs[16] = { 0, 1, 2, 3, 4, 5, 6, 7, 16*8+0, 16*8+1, 16*8+2, 16*8+3, 16*8+4, 16*8+5, 16*8+6, 16*8+7 }; INT32 YOffs[16] = { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, 8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 }; UINT8 *tmp = (UINT8*)BurnMalloc(0x200000); if (tmp == NULL) { return; } memcpy (tmp, DrvGfxROM1, 0x200000); GfxDecode(0x10000, 4, 8, 8, Plane, XOffs, YOffs, 0x040, tmp, DrvGfxROM0); GfxDecode(0x04000, 4, 16, 16, Plane, XOffs, YOffs, 0x100, tmp, DrvGfxROM1); BurnFree (tmp); } static INT32 DrvInit(INT32 codesize, INT32 gfxlen, INT32 samples, INT32 bank, INT32 spriteram, const UINT8 *decrypt_table) { GenericTilesInit(); AllMem = NULL; MemIndex(); INT32 nLen = MemEnd - (UINT8 *)0; if ((AllMem = (UINT8 *)BurnMalloc(nLen)) == NULL) return 1; memset(AllMem, 0, nLen); MemIndex(); if (DrvLoadRoms(codesize, samples, bank)) return 1; DrvGfxDecode(); map_main_cpu((UINT8*)decrypt_table, codesize, spriteram); ZetInit(0); ZetOpen(0); ZetMapArea(0x0000, 0xefff, 0, DrvZ80ROM); ZetMapArea(0x0000, 0xefff, 2, DrvZ80ROM); ZetMapArea(0xf000, 0xffff, 0, DrvZ80RAM); ZetMapArea(0xf000, 0xffff, 1, DrvZ80RAM); ZetMapArea(0xf000, 0xffff, 2, DrvZ80RAM); ZetSetOutHandler(m90_sound_write_port); ZetSetInHandler(m90_sound_read_port); ZetClose(); BurnYM2151Init(3579545); YM2151SetIrqHandler(0, &m72YM2151IRQHandler); BurnYM2151SetAllRoutes(0.15, BURN_SND_ROUTE_BOTH); DACInit(0, 0, 1, m90SyncDAC); DACSetRoute(0, 0.10, BURN_SND_ROUTE_BOTH); code_mask[0] = ((gfxlen * 2) - 1) / (8 * 8); code_mask[1] = ((gfxlen * 2) - 1) / (16 * 16); DrvDoReset(); return 0; } static INT32 DrvExit() { GenericTilesExit(); BurnYM2151Exit(); DACExit(); ZetExit(); VezExit(); BurnFree(AllMem); video_offsets[0] = video_offsets[1] = 0; return 0; } static void RenderTilePrio(UINT16 *dest, UINT8 *gfx, INT32 code, INT32 color, INT32 sx, INT32 sy, INT32 flipx, INT32 flipy, INT32 width, INT32 height, UINT8 *pri, INT32 prio) { if (sx <= (0-width) || sx >= nScreenWidth || sy <= (0-height) || sy >= nScreenHeight) return; INT32 flip = 0; if (flipy) flip |= (height - 1) * width; if (flipx) flip |= width - 1; gfx += code * width * height; for (INT32 y = 0; y < height; y++, sy++) { if (sy < 0 || sy >= nScreenHeight) continue; for (INT32 x = 0; x < width; x++, sx++) { if (sx < 0 || sx >= nScreenWidth) continue; INT32 pxl = gfx[((y * width) + x) ^ flip]; if (pxl == 0) continue; if ((prio & (1 << pri[sy * nScreenWidth + sx])) == 0) { dest[sy * nScreenWidth + sx] = pxl | color; pri[sy * nScreenWidth + sx] = 7; } } sx -= width; } } static void draw_sprites() { INT32 pri_ctrl = m90_video_control[14] & 0x03; UINT16 *sram = (UINT16*)(DrvVidRAM + 0xee00); for (INT32 offs = 0x1f2/2; offs >= 0; offs -= 3) { INT32 sy = BURN_ENDIAN_SWAP_INT16(sram[offs + 0]); INT32 code = BURN_ENDIAN_SWAP_INT16(sram[offs + 1]); INT32 sx = BURN_ENDIAN_SWAP_INT16(sram[offs + 2]); INT32 flipy = sy & 0x8000; INT32 flipx = sx & 0x0200; INT32 multi = 1 << ((sy & 0x6000) >> 13); INT32 color = (sy >> 9) & 0x0f; sx = ((sx - video_offsets[0]) & 0x1ff) - 16; sy = (512 - ((sy + video_offsets[1]) & 0x1ff)) - (16 * multi); INT32 prio = 0x82; if (pri_ctrl & 0x01) { if ((color & 0x08) == 0x08) prio = 0x80; } else if (pri_ctrl & 0x02) { if ((color & 0x0c) == 0x0c) prio = 0x80; } for (INT32 i = 0; i < multi; i++) { RenderTilePrio(pTransDraw, DrvGfxROM1, (code + (flipy ? multi-1 - i : i)) & code_mask[1], (color << 4)|0x100, sx, sy+i*16, flipx, flipy, 16, 16, RamPrioBitmap, prio); } } } static void draw_layer(INT32 layer) { INT32 control = m90_video_control[10 + (layer * 2)]; if (control & 0x10) return; // disable layer INT32 enable_rowscroll = control & 0x20; INT32 enable_colscroll = control & 0x40; INT32 wide = (control & 0x04) ? 128 : 64; INT32 trans = layer ? 0xff : 0; INT32 pmask = (wide == 128) ? 2 : 3; UINT16 *vram = (UINT16*)(DrvVidRAM + (control & pmask) * 0x4000); UINT16 scrollx = ((m90_video_control[(layer*4)+2] << 0) | (m90_video_control[(layer*4)+3] << 8)) + video_offsets[0]; UINT16 scrolly = ((m90_video_control[(layer*4)+0] << 0) | (m90_video_control[(layer*4)+1] << 8)) + video_offsets[1]; scrollx += layer ? -2 : 2; scrollx += ((wide & 0x80) * 2); UINT16 *xscroll = (UINT16*)(DrvVidRAM + 0xf000 + (layer * 0x400)); UINT16 *yscroll = (UINT16*)(DrvVidRAM + 0xf800 + (layer * 0x400)); for (INT32 sy = 0; sy < nScreenHeight; sy++) { INT32 scrollx_1 = scrollx; INT32 scrolly_1 = 0; UINT16 *dest = pTransDraw + (sy * nScreenWidth); UINT8 *pri = RamPrioBitmap + (sy * nScreenWidth); if (enable_rowscroll) scrollx_1 += BURN_ENDIAN_SWAP_INT16(xscroll[sy]); if (enable_colscroll) { scrolly_1 += (scrolly + sy + BURN_ENDIAN_SWAP_INT16(yscroll[sy]) + 128) & 0x1ff; } else { scrolly_1 += (scrolly + sy) & 0x1ff; } INT32 romoff_1 = (scrolly_1 & 0x07) << 3; for (INT32 sx = 0; sx < nScreenWidth + 8; sx+=8) { INT32 scrollx_2 = (scrollx_1 + sx) & ((wide * 8) - 1); INT32 offs = ((scrolly_1 / 8) * wide) | (scrollx_2 / 8); INT32 code = BURN_ENDIAN_SWAP_INT16(vram[offs * 2 + 0]) & code_mask[0]; INT32 color = BURN_ENDIAN_SWAP_INT16(vram[offs * 2 + 1]); INT32 flipy = color & 0x80; INT32 flipx = color & 0x40; INT32 group =(color & 0x30) ? 0 : 1; color &= 0x0f; { color <<= 4; INT32 x_xor = 0; INT32 romoff = romoff_1; if (flipy) romoff ^= 0x38; if (flipx) x_xor = 7; UINT8 *rom = DrvGfxROM0 + (code * 0x40) + romoff; INT32 xx = sx - (scrollx_2&0x7); for (INT32 x = 0; x < 8; x++, xx++) { if (xx < 0 || xx >= nScreenWidth) continue; INT32 pxl = rom[x ^ x_xor]; if (pxl == trans) continue; dest[xx] = pxl | color; pri[xx] = 1 << group; } } } } } static INT32 DrvDraw() { if (DrvRecalc) { for (INT32 i = 0; i < 0x400; i+=2) { update_palette_entry(i); } DrvRecalc = 0; } if ((m90_video_control[14] & 0x04) == 0) { if (m90_video_control[12] & 0x10) { memset (RamPrioBitmap, 0, nScreenWidth * nScreenHeight); BurnTransferClear(); } else { if (nBurnLayer & 1) draw_layer(1); } if (nBurnLayer & 2) draw_layer(0); if (nBurnLayer & 4) draw_sprites(); } else { BurnTransferClear(); } BurnTransferCopy(DrvPalette); return 0; } static void compile_inputs() { memset (DrvInputs, 0xff, 5); for (INT32 i = 0; i < 8; i++) { DrvInputs[0] ^= (DrvJoy1[i] & 1) << i; DrvInputs[1] ^= (DrvJoy2[i] & 1) << i; DrvInputs[2] ^= (DrvJoy3[i] & 1) << i; DrvInputs[3] ^= (DrvJoy4[i] & 1) << i; DrvInputs[4] ^= (DrvJoy5[i] & 1) << i; } } static INT32 DrvFrame() { if (DrvReset) { DrvDoReset(); } compile_inputs(); INT32 nInterleave = 128; // nmi pulses for sound cpu INT32 nCyclesTotal[2]; INT32 nCyclesDone[2]; // overclocking... nCyclesTotal[0] = (INT32)((INT64)(8000000 / 60) * nBurnCPUSpeedAdjust / 0x0100); nCyclesTotal[1] = (INT32)((INT64)(3579545 / 60) * nBurnCPUSpeedAdjust / 0x0100); nCyclesDone[0] = nCyclesDone[1] = 0; VezNewFrame(); ZetNewFrame(); VezOpen(0); ZetOpen(0); vblank = 0; for (INT32 i = 0; i < nInterleave; i++) { nCyclesDone[0] += VezRun(nCyclesTotal[0] / nInterleave); if (i == (nInterleave - 1)) { VezSetIRQLineAndVector(NEC_INPUT_LINE_INTP0, 0xff, VEZ_IRQSTATUS_ACK); VezRun(0); VezSetIRQLineAndVector(NEC_INPUT_LINE_INTP0, 0xff, VEZ_IRQSTATUS_NONE); } nCyclesDone[1] += ZetRun(nCyclesTotal[1] / nInterleave); ZetNmi(); if (i == 124) vblank = 0x80; } if (pBurnSoundOut) { BurnYM2151Render(pBurnSoundOut, nBurnSoundLen); DACUpdate(pBurnSoundOut, nBurnSoundLen); } VezClose(); ZetClose(); if (pBurnDraw) { DrvDraw(); } return 0; } // Hasamu (Japan) static struct BurnRomInfo hasamuRomDesc[] = { { "hasc-p1.bin", 0x20000, 0x53df9834, 1 | BRF_PRG | BRF_ESS }, // 0 V30 Code { "hasc-p0.bin", 0x20000, 0xdff0ba6e, 1 | BRF_PRG | BRF_ESS }, // 1 { "hasc-sp.bin", 0x10000, 0x259b1687, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code { "hasc-c0.bin", 0x20000, 0xdd5a2174, 3 | BRF_GRA }, // 3 Tiles and sprites { "hasc-c1.bin", 0x20000, 0x76b8217c, 3 | BRF_GRA }, // 4 { "hasc-c2.bin", 0x20000, 0xd90f9a68, 3 | BRF_GRA }, // 5 { "hasc-c3.bin", 0x20000, 0x6cfe0d39, 3 | BRF_GRA }, // 6 }; STD_ROM_PICK(hasamu) STD_ROM_FN(hasamu) static INT32 hasamuInit() { video_offsets[0] = 48; video_offsets[1] = 136; return DrvInit(0x40000, 0x80000, 0x00000, 0, 0, gunforce_decryption_table); } struct BurnDriver BurnDrvHasamu = { "hasamu", NULL, NULL, NULL, "1991", "Hasamu (Japan)\0", NULL, "Irem", "M90", NULL, NULL, NULL, NULL, BDF_GAME_WORKING, 2, HARDWARE_IREM_M90, GBF_MISC, 0, NULL, hasamuRomInfo, hasamuRomName, NULL, NULL, p2commonInputInfo, HasamuDIPInfo, hasamuInit, DrvExit, DrvFrame, DrvDraw, NULL, &DrvRecalc, 0x200, 384, 240, 4, 3 }; // Dynablaster / Bomber Man static struct BurnRomInfo dynablstRomDesc[] = { { "bbm-cp1e.62", 0x20000, 0x27667681, 1 | BRF_PRG | BRF_ESS }, // 0 V30 Code { "bbm-cp0e.65", 0x20000, 0x95db7a67, 1 | BRF_PRG | BRF_ESS }, // 1 { "bbm-sp.23", 0x10000, 0x251090cd, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code { "bbm-c0.66", 0x40000, 0x695d2019, 3 | BRF_GRA }, // 3 Tiles and sprites { "bbm-c1.67", 0x40000, 0x4c7c8bbc, 3 | BRF_GRA }, // 4 { "bbm-c2.68", 0x40000, 0x0700d406, 3 | BRF_GRA }, // 5 { "bbm-c3.69", 0x40000, 0x3c3613af, 3 | BRF_GRA }, // 6 { "bbm-v0.20", 0x20000, 0x0fa803fe, 4 | BRF_SND }, // 7 Samples }; STD_ROM_PICK(dynablst) STD_ROM_FN(dynablst) static INT32 dynablstInit() { video_offsets[0] = 80; video_offsets[1] = 136; return DrvInit(0x40000, 0x100000, 0x20000, 0, 0, bomberman_decryption_table); } struct BurnDriver BurnDrvDynablst = { "dynablst", NULL, NULL, NULL, "1991", "Dynablaster / Bomber Man\0", NULL, "Irem (licensed from Hudson Soft)", "M90", NULL, NULL, NULL, NULL, BDF_GAME_WORKING, 4, HARDWARE_IREM_M90, GBF_MISC, 0, NULL, dynablstRomInfo, dynablstRomName, NULL, NULL, p4commonInputInfo, DynablstDIPInfo, dynablstInit, DrvExit, DrvFrame, DrvDraw, NULL, &DrvRecalc, 0x200, 320, 240, 4, 3 }; // Bomber Man (Japan) static struct BurnRomInfo bombrmanRomDesc[] = { { "bbm-p1.62", 0x20000, 0x982bd166, 1 | BRF_PRG | BRF_ESS }, // 0 V30 Code { "bbm-p0.65", 0x20000, 0x0a20afcc, 1 | BRF_PRG | BRF_ESS }, // 1 { "bbm-sp.23", 0x10000, 0x251090cd, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code { "bbm-c0.66", 0x40000, 0x695d2019, 3 | BRF_GRA }, // 3 Tiles and sprites { "bbm-c1.67", 0x40000, 0x4c7c8bbc, 3 | BRF_GRA }, // 4 { "bbm-c2.68", 0x40000, 0x0700d406, 3 | BRF_GRA }, // 5 { "bbm-c3.69", 0x40000, 0x3c3613af, 3 | BRF_GRA }, // 6 { "bbm-v0.20", 0x20000, 0x0fa803fe, 4 | BRF_SND }, // 7 Samples }; STD_ROM_PICK(bombrman) STD_ROM_FN(bombrman) struct BurnDriver BurnDrvBombrman = { "bombrman", "dynablst", NULL, NULL, "1991", "Bomber Man (Japan)\0", NULL, "Irem (licensed from Hudson Soft)", "M90", NULL, NULL, NULL, NULL, BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_IREM_M90, GBF_MISC, 0, NULL, bombrmanRomInfo, bombrmanRomName, NULL, NULL, p2commonInputInfo, BombrmanDIPInfo, dynablstInit, DrvExit, DrvFrame, DrvDraw, NULL, &DrvRecalc, 0x200, 320, 240, 4, 3 }; // Atomic Punk (US) static struct BurnRomInfo atompunkRomDesc[] = { { "bbm-cp0d.65", 0x20000, 0x860c0479, 1 | BRF_PRG | BRF_ESS }, // 0 V30 Code { "bbm-cp1d.62", 0x20000, 0xbe57bf74, 1 | BRF_PRG | BRF_ESS }, // 1 { "bbm-sp.23", 0x10000, 0x251090cd, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code { "bbm-c0.66", 0x40000, 0x695d2019, 3 | BRF_GRA }, // 3 Tiles and sprites { "bbm-c1.67", 0x40000, 0x4c7c8bbc, 3 | BRF_GRA }, // 4 { "bbm-c2.68", 0x40000, 0x0700d406, 3 | BRF_GRA }, // 5 { "bbm-c3.69", 0x40000, 0x3c3613af, 3 | BRF_GRA }, // 6 { "bbm-v0.20", 0x20000, 0x0fa803fe, 4 | BRF_SND }, // 7 Samples }; STD_ROM_PICK(atompunk) STD_ROM_FN(atompunk) struct BurnDriver BurnDrvAtompunk = { "atompunk", "dynablst", NULL, NULL, "1991", "Atomic Punk (US)\0", NULL, "Irem America (licensed from Hudson Soft)", "M90", NULL, NULL, NULL, NULL, BDF_GAME_WORKING | BDF_CLONE, 4, HARDWARE_IREM_M90, GBF_MISC, 0, NULL, atompunkRomInfo, atompunkRomName, NULL, NULL, p4commonInputInfo, AtompunkDIPInfo, dynablstInit, DrvExit, DrvFrame, DrvDraw, NULL, &DrvRecalc, 0x200, 320, 240, 4, 3 }; // Bomber Man World / New Dyna Blaster - Global Quest static struct BurnRomInfo bbmanwRomDesc[] = { { "bbm2-h0-b.77", 0x40000, 0x567d3709, 1 | BRF_PRG | BRF_ESS }, // 0 V30 Code { "bbm2-l0-b.79", 0x40000, 0xe762c22b, 1 | BRF_PRG | BRF_ESS }, // 1 { "bbm2-sp.33", 0x10000, 0x6bc1689e, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code { "bbm2-c0.81", 0x40000, 0xe7ce058a, 3 | BRF_GRA }, // 3 Tiles and sprites { "bbm2-c1.82", 0x40000, 0x636a78a9, 3 | BRF_GRA }, // 4 { "bbm2-c2.83", 0x40000, 0x9ac2142f, 3 | BRF_GRA }, // 5 { "bbm2-c3.84", 0x40000, 0x47af1750, 3 | BRF_GRA }, // 6 { "bbm2-v0.30", 0x20000, 0x4ad889ed, 4 | BRF_SND }, // 7 Samples }; STD_ROM_PICK(bbmanw) STD_ROM_FN(bbmanw) static INT32 bbmanwInit() { video_offsets[0] = 80; video_offsets[1] = 136; return DrvInit(0x80000, 0x100000, 0x20000, 0, 0, dynablaster_decryption_table); } struct BurnDriver BurnDrvBbmanw = { "bbmanw", NULL, NULL, NULL, "1992", "Bomber Man World / New Dyna Blaster - Global Quest\0", NULL, "Irem", "M90", NULL, NULL, NULL, NULL, BDF_GAME_WORKING, 2, HARDWARE_IREM_M90, GBF_MISC, 0, NULL, bbmanwRomInfo, bbmanwRomName, NULL, NULL, p4commonInputInfo, BbmanwDIPInfo, bbmanwInit, DrvExit, DrvFrame, DrvDraw, NULL, &DrvRecalc, 0x200, 320, 240, 4, 3 }; // Bomber Man World (Japan) static struct BurnRomInfo bbmanwjRomDesc[] = { { "bbm2-h0.77", 0x40000, 0xe1407b91, 1 | BRF_PRG | BRF_ESS }, // 0 V30 Code { "bbm2-l0.79", 0x40000, 0x20873b49, 1 | BRF_PRG | BRF_ESS }, // 1 { "bbm2-sp-b.bin", 0x10000, 0xb8d8108c, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code { "bbm2-c0.81", 0x40000, 0xe7ce058a, 3 | BRF_GRA }, // 3 Tiles and sprites { "bbm2-c1.82", 0x40000, 0x636a78a9, 3 | BRF_GRA }, // 4 { "bbm2-c2.83", 0x40000, 0x9ac2142f, 3 | BRF_GRA }, // 5 { "bbm2-c3.84", 0x40000, 0x47af1750, 3 | BRF_GRA }, // 6 { "bbm2-v0-b.30", 0x20000, 0x0ae655ff, 4 | BRF_SND }, // 7 Samples }; STD_ROM_PICK(bbmanwj) STD_ROM_FN(bbmanwj) struct BurnDriver BurnDrvBbmanwj = { "bbmanwj", "bbmanw", NULL, NULL, "1992", "Bomber Man World (Japan)\0", NULL, "Irem", "M90", NULL, NULL, NULL, NULL, BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_IREM_M90, GBF_MISC, 0, NULL, bbmanwjRomInfo, bbmanwjRomName, NULL, NULL, p4commonInputInfo, BbmanwjDIPInfo, bbmanwInit, DrvExit, DrvFrame, DrvDraw, NULL, &DrvRecalc, 0x200, 320, 240, 4, 3 }; // New Atomic Punk - Global Quest (US) static struct BurnRomInfo newapunkRomDesc[] = { { "bbm2-h0-a.77", 0x40000, 0x7d858682, 1 | BRF_PRG | BRF_ESS }, // 0 V30 Code { "bbm2-l0-a.79", 0x40000, 0xc7568031, 1 | BRF_PRG | BRF_ESS }, // 1 { "bbm2-sp.33", 0x10000, 0x6bc1689e, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code { "bbm2-c0.81", 0x40000, 0xe7ce058a, 3 | BRF_GRA }, // 3 Tiles and sprites { "bbm2-c1.82", 0x40000, 0x636a78a9, 3 | BRF_GRA }, // 4 { "bbm2-c2.83", 0x40000, 0x9ac2142f, 3 | BRF_GRA }, // 5 { "bbm2-c3.84", 0x40000, 0x47af1750, 3 | BRF_GRA }, // 6 { "bbm2-v0.30", 0x20000, 0x4ad889ed, 4 | BRF_SND }, // 7 Samples }; STD_ROM_PICK(newapunk) STD_ROM_FN(newapunk) struct BurnDriver BurnDrvNewapunk = { "newapunk", "bbmanw", NULL, NULL, "1992", "New Atomic Punk - Global Quest (US)\0", NULL, "Irem America", "M90", NULL, NULL, NULL, NULL, BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_IREM_M90, GBF_MISC, 0, NULL, newapunkRomInfo, newapunkRomName, NULL, NULL, p4commonInputInfo, BbmanwjDIPInfo, bbmanwInit, DrvExit, DrvFrame, DrvDraw, NULL, &DrvRecalc, 0x200, 320, 240, 4, 3 }; // Quiz F1 1-2 Finish (Japan) static struct BurnRomInfo quizf1RomDesc[] = { { "qf1-h0-.77", 0x40000, 0x280e3049, 1 | BRF_PRG | BRF_ESS }, // 0 V30 Code { "qf1-l0-.79", 0x40000, 0x94588a6f, 1 | BRF_PRG | BRF_ESS }, // 1 { "qf1-sp-.33", 0x10000, 0x0664fa9f, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code { "qf1-c0-.81", 0x80000, 0xc26b521e, 3 | BRF_GRA }, // 3 Tiles and sprites { "qf1-c1-.82", 0x80000, 0xdb9d7394, 3 | BRF_GRA }, // 4 { "qf1-c2-.83", 0x80000, 0x0b1460ae, 3 | BRF_GRA }, // 5 { "qf1-c3-.84", 0x80000, 0x2d32ff37, 3 | BRF_GRA }, // 6 { "qf1-v0-.30", 0x40000, 0xb8d16e7c, 4 | BRF_SND }, // 7 Samples { "qf1-h1-.78", 0x80000, 0xc6c2eb2b, 5 | BRF_PRG | BRF_ESS }, // 8 V30 banked code { "qf1-l1-.80", 0x80000, 0x3132c144, 5 | BRF_PRG | BRF_ESS }, // 9 }; STD_ROM_PICK(quizf1) STD_ROM_FN(quizf1) static INT32 quizf1Init() { video_offsets[0] = 48; video_offsets[1] = 128; return DrvInit(0x80000, 0x200000, 0x40000, 0x100000, 0, lethalth_decryption_table); } struct BurnDriver BurnDrvQuizf1 = { "quizf1", NULL, NULL, NULL, "1992", "Quiz F1 1-2 Finish (Japan)\0", NULL, "Irem", "M90", NULL, NULL, NULL, NULL, BDF_GAME_WORKING, 2, HARDWARE_IREM_M90, GBF_MISC, 0, NULL, quizf1RomInfo, quizf1RomName, NULL, NULL, Quizf1InputInfo, Quizf1DIPInfo, quizf1Init, DrvExit, DrvFrame, DrvDraw, NULL, &DrvRecalc, 0x200, 384, 240, 4, 3 }; // Risky Challenge static struct BurnRomInfo riskchalRomDesc[] = { { "rc_h0.ic77", 0x40000, 0x4c9b5344, 1 | BRF_PRG | BRF_ESS }, // 0 V30 Code { "rc_l0.ic79", 0x40000, 0x0455895a, 1 | BRF_PRG | BRF_ESS }, // 1 { "l4_a-sp.ic33", 0x10000, 0xbb80094e, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code { "rc_c0.rom", 0x80000, 0x84d0b907, 3 | BRF_GRA }, // 3 Tiles and sprites { "rc_c1.rom", 0x80000, 0xcb3784ef, 3 | BRF_GRA }, // 4 { "rc_c2.rom", 0x80000, 0x687164d7, 3 | BRF_GRA }, // 5 { "rc_c3.rom", 0x80000, 0xc86be6af, 3 | BRF_GRA }, // 6 { "rc_v0.rom", 0x40000, 0xcddac360, 4 | BRF_SND }, // 7 Samples }; STD_ROM_PICK(riskchal) STD_ROM_FN(riskchal) static INT32 riskchalInit() { video_offsets[0] = 80; video_offsets[1] = 136; return DrvInit(0x80000, 0x200000, 0x40000, 0, 0, gussun_decryption_table); } struct BurnDriver BurnDrvRiskchal = { "riskchal", NULL, NULL, NULL, "1993", "Risky Challenge\0", "Unemulated CPU functions", "Irem", "M90", NULL, NULL, NULL, NULL, BDF_GAME_WORKING, 2, HARDWARE_IREM_M90, GBF_MISC, 0, NULL, riskchalRomInfo, riskchalRomName, NULL, NULL, p2commonInputInfo, RiskchalDIPInfo, riskchalInit, DrvExit, DrvFrame, DrvDraw, NULL, &DrvRecalc, 0x200, 320, 240, 4, 3 }; // Gussun Oyoyo (Japan) static struct BurnRomInfo gussunRomDesc[] = { { "l4_a-h0.ic77", 0x40000, 0x9d585e61, 1 | BRF_PRG | BRF_ESS }, // 0 V30 Code { "l4_a-l0.ic79", 0x40000, 0xc7b4c519, 1 | BRF_PRG | BRF_ESS }, // 1 { "l4_a-sp.ic33", 0x10000, 0xbb80094e, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code { "rc_c0.rom", 0x80000, 0x84d0b907, 3 | BRF_GRA }, // 3 Tiles and sprites { "rc_c1.rom", 0x80000, 0xcb3784ef, 3 | BRF_GRA }, // 4 { "rc_c2.rom", 0x80000, 0x687164d7, 3 | BRF_GRA }, // 5 { "rc_c3.rom", 0x80000, 0xc86be6af, 3 | BRF_GRA }, // 6 { "rc_v0.rom", 0x40000, 0xcddac360, 4 | BRF_SND }, // 7 Samples }; STD_ROM_PICK(gussun) STD_ROM_FN(gussun) struct BurnDriver BurnDrvGussun = { "gussun", "riskchal", NULL, NULL, "1993", "Gussun Oyoyo (Japan)\0", "Unemulated CPU functions", "Irem", "M90", NULL, NULL, NULL, NULL, BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_IREM_M90, GBF_MISC, 0, NULL, gussunRomInfo, gussunRomName, NULL, NULL, p2commonInputInfo, RiskchalDIPInfo, riskchalInit, DrvExit, DrvFrame, DrvDraw, NULL, &DrvRecalc, 0x200, 320, 240, 4, 3 }; // Match It II static struct BurnRomInfo matchit2RomDesc[] = { { "sis2-h0-b.bin", 0x40000, 0x9a2556ac, 1 | BRF_PRG | BRF_ESS }, // 0 V30 Code { "sis2-l0-b.bin", 0x40000, 0xd35d948a, 1 | BRF_PRG | BRF_ESS }, // 1 { "sis2-sp-.rom", 0x10000, 0x6fc0ff3a, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code { "ic81.rom", 0x80000, 0x5a7cb88f, 3 | BRF_GRA }, // 3 Tiles and sprites { "ic82.rom", 0x80000, 0x54a7852c, 3 | BRF_GRA }, // 4 { "ic83.rom", 0x80000, 0x2bd65dc6, 3 | BRF_GRA }, // 5 { "ic84.rom", 0x80000, 0x876d5fdb, 3 | BRF_GRA }, // 6 }; STD_ROM_PICK(matchit2) STD_ROM_FN(matchit2) static INT32 matchit2Init() { video_offsets[0] = 48; video_offsets[1] = 128; return DrvInit(0x80000, 0x200000, 0, 0, 0, matchit2_decryption_table); } struct BurnDriver BurnDrvMatchit2 = { "matchit2", NULL, NULL, NULL, "1993", "Match It II\0", NULL, "Tamtex", "M90", NULL, NULL, NULL, NULL, BDF_GAME_WORKING, 2, HARDWARE_IREM_M90, GBF_MISC, 0, NULL, matchit2RomInfo, matchit2RomName, NULL, NULL, Matchit2InputInfo, Matchit2DIPInfo, matchit2Init, DrvExit, DrvFrame, DrvDraw, NULL, &DrvRecalc, 0x200, 384, 240, 4, 3 }; // Shisensho II static struct BurnRomInfo shisen2RomDesc[] = { { "sis2-h0-.rom", 0x40000, 0x6fae0aea, 1 | BRF_PRG | BRF_ESS }, // 0 V30 Code { "sis2-l0-.rom", 0x40000, 0x2af25182, 1 | BRF_PRG | BRF_ESS }, // 1 { "sis2-sp-.rom", 0x10000, 0x6fc0ff3a, 2 | BRF_PRG | BRF_ESS }, // 2 Z80 Code { "ic81.rom", 0x80000, 0x5a7cb88f, 3 | BRF_GRA }, // 3 Tiles and sprites { "ic82.rom", 0x80000, 0x54a7852c, 3 | BRF_GRA }, // 4 { "ic83.rom", 0x80000, 0x2bd65dc6, 3 | BRF_GRA }, // 5 { "ic84.rom", 0x80000, 0x876d5fdb, 3 | BRF_GRA }, // 6 }; STD_ROM_PICK(shisen2) STD_ROM_FN(shisen2) struct BurnDriver BurnDrvShisen2 = { "shisen2", "matchit2", NULL, NULL, "1993", "Shisensho II\0", NULL, "Tamtex", "M90", NULL, NULL, NULL, NULL, BDF_GAME_WORKING | BDF_CLONE, 2, HARDWARE_IREM_M90, GBF_MISC, 0, NULL, shisen2RomInfo, shisen2RomName, NULL, NULL, Matchit2InputInfo, Shisen2DIPInfo, matchit2Init, DrvExit, DrvFrame, DrvDraw, NULL, &DrvRecalc, 0x200, 384, 240, 4, 3 };
31.633315
174
0.591978
atship
3a08f5606313c47d45294e741e1348a65ec86d4c
3,566
hpp
C++
Graphics/install-sh/include/sh/ShVariantCast.hpp
Solidstatewater/Anubis-Engine
d2720167c0d5306d4d12a027dc31686b5cbb0f18
[ "BSD-2-Clause" ]
2
2017-10-29T06:43:05.000Z
2020-03-27T10:27:07.000Z
Graphics/install-sh/include/sh/ShVariantCast.hpp
Solidstatewater/Anubis-Engine
d2720167c0d5306d4d12a027dc31686b5cbb0f18
[ "BSD-2-Clause" ]
null
null
null
Graphics/install-sh/include/sh/ShVariantCast.hpp
Solidstatewater/Anubis-Engine
d2720167c0d5306d4d12a027dc31686b5cbb0f18
[ "BSD-2-Clause" ]
5
2016-02-06T11:01:51.000Z
2019-03-18T13:56:00.000Z
// Sh: A GPU metaprogramming language. // // Copyright (c) 2003 University of Waterloo Computer Graphics Laboratory // Project administrator: Michael D. McCool // Authors: Zheng Qin, Stefanus Du Toit, Kevin Moule, Tiberiu S. Popa, // Michael D. McCool // // This software is provided 'as-is', without any express or implied // warranty. In no event will the authors be held liable for any damages // arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it // freely, subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; you must // not claim that you wrote the original software. If you use this // software in a product, an acknowledgment in the product documentation // would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, and must // not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source // distribution. ////////////////////////////////////////////////////////////////////////////// #ifndef SHVARIANTCAST_HPP #define SHVARIANTCAST_HPP #include "ShDllExport.hpp" #include "ShVariableType.hpp" #include "ShDataType.hpp" #include "ShVariant.hpp" namespace SH { // forward declaration class ShVariant; /// @file ShVariantCast.hpp /// Declares a cast between one data type of a storage type and another. struct SH_DLLEXPORT ShVariantCast { public: virtual ~ShVariantCast() {} /** Casts data from src into dest. src must have Src value type and SrcDT * data type. dest similarly must match Dest and DestDT. * Also, must guarantee dest != src (it will work if they are the same * but what a waste...) * @{ */ virtual void doCast(ShVariant* dest, const ShVariant* src) const = 0; // @} virtual void getCastTypes(ShValueType &dest, ShDataType &destDT, ShValueType &src, ShDataType &srcDT) const = 0; /** Returns whether the destination of this caster matches the given types **/ virtual void getDestTypes(ShValueType &valueType, ShDataType &dataType) const = 0; }; /** @brief Handles casting between S and D storage types. * * The actual data cast will have type ShHostType<SRC> to ShHostType<DEST> * and may have some extra conversion code (e.g. clamping) applied * in addition to the default C cast for those types. */ template<typename Dest, ShDataType DestDT, typename Src, ShDataType SrcDT> struct ShDataVariantCast: public ShVariantCast { public: static const ShValueType DestValueType = ShStorageTypeInfo<Dest>::value_type; static const ShValueType SrcValueType = ShStorageTypeInfo<Src>::value_type; typedef typename ShDataTypeCppType<Dest, DestDT>::type D; typedef typename ShDataTypeCppType<Src, SrcDT>::type S; typedef ShDataVariant<Dest, DestDT> DestVariant; typedef const ShDataVariant<Src, SrcDT> SrcVariant; void doCast(ShVariant* dest, const ShVariant* src) const; void getCastTypes(ShValueType &dest, ShDataType &destDT, ShValueType &src, ShDataType &srcDT) const; void getDestTypes(ShValueType &valueType, ShDataType &dataType) const; void doCast(D &dest, const S &src) const; static const ShDataVariantCast *instance(); private: static ShDataVariantCast *m_instance; ShDataVariantCast() {} }; } #include "ShVariantCastImpl.hpp" #endif
34.288462
86
0.706955
Solidstatewater
3a0d4e9d5fe8b941da502811d249aa5a1b8facce
380
hpp
C++
include/level_1.hpp
BokorBence/Jack-O-Lector
dde9a10be4b89ea1634b7945a99de7ea41862051
[ "MIT" ]
null
null
null
include/level_1.hpp
BokorBence/Jack-O-Lector
dde9a10be4b89ea1634b7945a99de7ea41862051
[ "MIT" ]
11
2021-09-30T14:25:02.000Z
2021-12-07T12:04:23.000Z
include/level_1.hpp
BokorBence/Jack-O-Lector
dde9a10be4b89ea1634b7945a99de7ea41862051
[ "MIT" ]
1
2021-10-03T13:23:39.000Z
2021-10-03T13:23:39.000Z
#pragma once #include <iostream> #include <fstream> #include <string> #include <sstream> #include "../include/level.hpp" #include "../include/guard.hpp" #include "../include/walkingEntity.hpp" #include "../include/entity.hpp" #include "../include/tile.hpp" class Level_1 : public Level { public: Level_1(std::string path); Level_1(Level l, std::string path); ~Level_1(); };
19
39
0.7
BokorBence
3a10184692feff001722e8ddd18daa835b08f012
4,209
cpp
C++
Cpufit/matlab/mex/CpufitMex.cpp
yongdengzhang/Gpufit
6e719585badff1c40488a1439fa04da1792e41b8
[ "MIT" ]
null
null
null
Cpufit/matlab/mex/CpufitMex.cpp
yongdengzhang/Gpufit
6e719585badff1c40488a1439fa04da1792e41b8
[ "MIT" ]
null
null
null
Cpufit/matlab/mex/CpufitMex.cpp
yongdengzhang/Gpufit
6e719585badff1c40488a1439fa04da1792e41b8
[ "MIT" ]
1
2019-06-18T15:13:27.000Z
2019-06-18T15:13:27.000Z
#include "Cpufit/cpufit.h" #include <mex.h> #include <cstring> #include <string> /* Get a arbitrary scalar (non complex) and check for class id. https://www.mathworks.com/help/matlab/apiref/mxclassid.html */ template<class T> inline bool get_scalar(const mxArray *p, T &v, const mxClassID id) { if (mxIsNumeric(p) && !mxIsComplex(p) && mxGetNumberOfElements(p) == 1 && mxGetClassID(p) == id) { v = *static_cast<T *>(mxGetData(p)); return true; } else { return false; } } void mexFunction(int nlhs, mxArray *plhs[], int nrhs, mxArray const *prhs[]) { int expected_nrhs = 0; int expected_nlhs = 0; bool wrong_nrhs = false; bool wrong_nlhs = false; expected_nrhs = 13; expected_nlhs = 4; if (nrhs != expected_nrhs) { wrong_nrhs = true; } else if (nlhs != expected_nlhs) { wrong_nlhs = true; } if (wrong_nrhs || wrong_nlhs) { if (nrhs != expected_nrhs) { char s1[50]; _itoa_s(expected_nrhs, s1, 10); char const s2[] = " input arguments required."; size_t const string_length = strlen(s1) + 1 + strlen(s2); strcat_s(s1, string_length, s2); mexErrMsgIdAndTxt("Cpufit:Mex", s1); } else if (nlhs != expected_nlhs) { char s1[50]; _itoa_s(expected_nlhs, s1, 10); char const s2[] = " output arguments required."; size_t const string_length = strlen(s1) + 1 + strlen(s2); strcat_s(s1, string_length, s2); mexErrMsgIdAndTxt("Cpufit:Mex", s1); } } // input parameters float * data = (float*)mxGetPr(prhs[0]); float * weights = (float*)mxGetPr(prhs[1]); std::size_t n_fits = (std::size_t)*mxGetPr(prhs[2]); std::size_t n_points = (std::size_t)*mxGetPr(prhs[3]); // tolerance float tolerance = 0; if (!get_scalar(prhs[4], tolerance, mxSINGLE_CLASS)) { mexErrMsgIdAndTxt("Cpufit:Mex", "tolerance is not a single"); } // max_n_iterations int max_n_iterations = 0; if (!get_scalar(prhs[5], max_n_iterations, mxINT32_CLASS)) { mexErrMsgIdAndTxt("Cpufit:Mex", "max_n_iteration is not int32"); } int estimator_id = (int)*mxGetPr(prhs[6]); float * initial_parameters = (float*)mxGetPr(prhs[7]); int * parameters_to_fit = (int*)mxGetPr(prhs[8]); int model_id = (int)*mxGetPr(prhs[9]); int n_parameters = (int)*mxGetPr(prhs[10]); int * user_info = (int*)mxGetPr(prhs[11]); std::size_t user_info_size = (std::size_t)*mxGetPr(prhs[12]); // output parameters float * output_parameters; mxArray * mx_parameters; mx_parameters = mxCreateNumericMatrix(1, n_fits*n_parameters, mxSINGLE_CLASS, mxREAL); output_parameters = (float*)mxGetData(mx_parameters); plhs[0] = mx_parameters; int * output_states; mxArray * mx_states; mx_states = mxCreateNumericMatrix(1, n_fits, mxINT32_CLASS, mxREAL); output_states = (int*)mxGetData(mx_states); plhs[1] = mx_states; float * output_chi_squares; mxArray * mx_chi_squares; mx_chi_squares = mxCreateNumericMatrix(1, n_fits, mxSINGLE_CLASS, mxREAL); output_chi_squares = (float*)mxGetData(mx_chi_squares); plhs[2] = mx_chi_squares; int * output_n_iterations; mxArray * mx_n_iterations; mx_n_iterations = mxCreateNumericMatrix(1, n_fits, mxINT32_CLASS, mxREAL); output_n_iterations = (int*)mxGetData(mx_n_iterations); plhs[3] = mx_n_iterations; // call to gpufit int const status = cpufit ( n_fits, n_points, data, weights, model_id, initial_parameters, tolerance, max_n_iterations, parameters_to_fit, estimator_id, user_info_size, reinterpret_cast< char * >( user_info ), output_parameters, output_states, output_chi_squares, output_n_iterations ) ; // check status if (status != STATUS_OK) { std::string const error = cpufit_get_last_error() ; mexErrMsgIdAndTxt( "Cpufit:Mex", error.c_str() ) ; } }
28.828767
97
0.614635
yongdengzhang
3a125c822043a6e75043a8a29a1ca8dfce289d91
4,422
cc
C++
bwt_test.cc
nurettin/libnuwen
5b3012d9e75552c372a4d09b218b7af04a928e68
[ "BSL-1.0" ]
9
2019-09-17T10:33:58.000Z
2021-07-29T10:03:42.000Z
bwt_test.cc
nurettin/libnuwen
5b3012d9e75552c372a4d09b218b7af04a928e68
[ "BSL-1.0" ]
null
null
null
bwt_test.cc
nurettin/libnuwen
5b3012d9e75552c372a4d09b218b7af04a928e68
[ "BSL-1.0" ]
1
2019-10-05T04:31:22.000Z
2019-10-05T04:31:22.000Z
// Copyright Stephan T. Lavavej, http://nuwen.net . // Distributed under the Boost Software License, Version 1.0. // See accompanying file LICENSE_1_0.txt or copy at // http://boost.org/LICENSE_1_0.txt . #include "bwt.hh" #include "clock.hh" #include "file.hh" #include "gluon.hh" #include "memory.hh" #include "string.hh" #include "test.hh" #include "typedef.hh" #include "external_begin.hh" #include <iostream> #include <ostream> #include <string> #include "external_end.hh" using namespace std; using namespace nuwen; using namespace nuwen::chrono; using namespace nuwen::file; bool core(const vuc_t& v, const vuc_t& correct) { const vuc_t b = bwt(v); return b == correct && unbwt(b) == v; } bool test_tiny() { return core(vuc_t(1, 88), vec(glu<uc_t>(0)(0)(0)(1)(0)(0)(0)(0)(0)(88))); } bool test_medium() { const uc_t I = 73; const uc_t M = 77; const uc_t P = 80; const uc_t S = 83; return core(vec(glu<uc_t>(M)(I)(S)(S)(I)(S)(S)(I)(P)(P)(I)), vec(glu<uc_t>(0)(0)(0)(2)(0)(0)(0)(4)(S)(S)(M)(P)(0)(P)(I)(S)(S)(I)(I)(I))); } bool test_big() { return core(vuc_t(3 * 1048576, 77), vec(glu<uc_t>(0)(0)(0)(1)(0)(0)(0)(0)(0)(vuc_t(3 * 1048576, 77)))); } vuc_t instrumented_bwt(const vuc_t& v) { using namespace pham::ukk; if (v.size() < MIN_ALLOWED_SIZE) { throw logic_error("LOGIC ERROR: instrumented_bwt() - v is too small."); } if (v.size() > MAX_ALLOWED_SIZE) { throw runtime_error("RUNTIME ERROR: instrumented_bwt() - v is too big."); } vuc_t dest(v.size() + 9); const ull_t initial_usage = vm_bytes(); ull_t memory_usage = 0; double ukkonen_time = 0; double dfs_time = 0; const watch total; { tree st(v); ukkonen_time = total.seconds(); st.dfs(bwt_helper(v, dest)); dfs_time = total.seconds() - ukkonen_time; memory_usage = vm_bytes() - initial_usage; } const double total_time = total.seconds(); const double dtor_time = total_time - ukkonen_time - dfs_time; cout << " File size (B): " << comma_from_ull(v.size()) << endl; cout << " Memory usage (B): " << comma_from_ull(memory_usage) << endl; cout << "Memory factor (N): " << static_cast<double>(memory_usage) / static_cast<double>(v.size()) << endl; cout << "(Not including the input and output vectors.)" << endl; cout << "Ukkonen (s): " << ukkonen_time << endl; cout << " DFS (s): " << dfs_time << endl; cout << " Dtor (s): " << dtor_time << endl; cout << " Total (s): " << total_time << endl; cout << "Ukkonen (KB/s): " << v.size() / ukkonen_time / 1024 << endl; cout << " DFS (KB/s): " << v.size() / dfs_time / 1024 << endl; cout << " Dtor (KB/s): " << v.size() / dtor_time / 1024 << endl; cout << " Total (KB/s): " << v.size() / total_time / 1024 << endl; cout << "Memory consumption (KB/s): " << static_cast<double>(memory_usage) / total_time / 1024 << endl; cout << endl; return dest; } bool test_instrumented(const string& s) { const vuc_t v = read_file(s); return unbwt(instrumented_bwt(v)) == v; } bool test_timing(const string& s) { const vuc_t v = read_file(s); watch w; const vuc_t b = bwt(v); const double bwt_time = w.seconds(); w.reset(); const vuc_t u = unbwt(b); const double unbwt_time = w.seconds(); cout << " BWT (s): " << bwt_time << endl; cout << "UnBWT (s): " << unbwt_time << endl; cout << " BWT (KB/s): " << v.size() / bwt_time / 1024 << endl; cout << "UnBWT (KB/s): " << v.size() / unbwt_time / 1024 << endl; return u == v; } int main(int argc, char * argv[]) { if (argc == 1) { NUWEN_TEST("bwt1", test_tiny()) NUWEN_TEST("bwt2", test_medium()) NUWEN_TEST("bwt3", test_big()) } else if (argc == 2) { NUWEN_TEST("bwt4", test_instrumented(argv[1])) NUWEN_TEST("bwt5", test_timing(argv[1])) } else { cout << "USAGE: bwt_test (for correctness)" << endl; cout << "USAGE: bwt_test <filename> (for profiling)" << endl; } }
29.284768
111
0.54161
nurettin
3a12949c40a464222685ff4a9c6f1983a4b61919
230
cc
C++
Mu2eG4/src/checkParticleCodeForG4.cc
resnegfk/Offline
4ba81dad54486188fa83fea8c085438d104afbbc
[ "Apache-2.0" ]
9
2020-03-28T00:21:41.000Z
2021-12-09T20:53:26.000Z
Mu2eG4/src/checkParticleCodeForG4.cc
resnegfk/Offline
4ba81dad54486188fa83fea8c085438d104afbbc
[ "Apache-2.0" ]
684
2019-08-28T23:37:43.000Z
2022-03-31T22:47:45.000Z
Mu2eG4/src/checkParticleCodeForG4.cc
resnegfk/Offline
4ba81dad54486188fa83fea8c085438d104afbbc
[ "Apache-2.0" ]
61
2019-08-16T23:28:08.000Z
2021-12-20T08:29:48.000Z
#include "Offline/Mu2eG4/inc/checkParticleCodeForG4.hh" #include "Geant4/G4ParticleTable.hh" namespace mu2e { bool checkParticleCodeForG4(int pdgId) { return G4ParticleTable::GetParticleTable()->FindParticle(pdgId); } }
23
68
0.773913
resnegfk
3a168a4bfe6a2474ffe24aaa073159b33d9fcaa8
20,290
cpp
C++
Samples/2.0/ApiUsage/InstantRadiosity/InstantRadiosityGameState.cpp
resttime/ogre-next
7435e60bd6df422d2fb4c742a493c3f37ef9a7a9
[ "MIT" ]
701
2019-09-08T15:56:41.000Z
2022-03-31T05:51:26.000Z
Samples/2.0/ApiUsage/InstantRadiosity/InstantRadiosityGameState.cpp
resttime/ogre-next
7435e60bd6df422d2fb4c742a493c3f37ef9a7a9
[ "MIT" ]
204
2019-09-01T23:02:32.000Z
2022-03-28T14:58:39.000Z
Samples/2.0/ApiUsage/InstantRadiosity/InstantRadiosityGameState.cpp
resttime/ogre-next
7435e60bd6df422d2fb4c742a493c3f37ef9a7a9
[ "MIT" ]
188
2019-09-05T05:14:46.000Z
2022-03-22T21:51:39.000Z
#include "InstantRadiosityGameState.h" #include "CameraController.h" #include "GraphicsSystem.h" #include "OgreSceneManager.h" #include "OgreItem.h" #include "OgreMeshManager.h" #include "OgreMeshManager2.h" #include "OgreMesh2.h" #include "OgreCamera.h" #include "OgreHlmsPbsDatablock.h" #include "OgreRoot.h" #include "OgreHlmsManager.h" #include "OgreHlmsPbs.h" #include "OgreLwString.h" #include "../LocalCubemaps/LocalCubemapScene.h" #include "InstantRadiosity/OgreInstantRadiosity.h" #include "OgreIrradianceVolume.h" #include "OgreForward3D.h" #include "OgreTextureGpu.h" #include "OgreTextureGpuManager.h" using namespace Demo; namespace Demo { InstantRadiosityGameState::InstantRadiosityGameState( const Ogre::String &helpDescription ) : TutorialGameState( helpDescription ), mLightNode( 0 ), mLight( 0 ), mCurrentType( Ogre::Light::LT_SPOTLIGHT ), mInstantRadiosity( 0 ), mIrradianceVolume( 0 ), mIrradianceCellSize(1.5f) { mDisplayHelpMode = 2; mNumDisplayHelpModes = 3; } //----------------------------------------------------------------------------------- void InstantRadiosityGameState::createLight() { Ogre::SceneManager *sceneManager = mGraphicsSystem->getSceneManager(); Ogre::SceneNode *rootNode = sceneManager->getRootSceneNode(); if( mLight ) { sceneManager->destroyLight( mLight ); mLight = 0; mLightNode->getParentSceneNode()->removeAndDestroyChild( mLightNode ); mLightNode = 0; } mLight = sceneManager->createLight(); mLightNode = rootNode->createChildSceneNode(); mLightNode->attachObject( mLight ); mLight->setPowerScale( Ogre::Math::PI ); switch( mCurrentType ) { default: case Ogre::Light::LT_SPOTLIGHT: mLight->setType( Ogre::Light::LT_SPOTLIGHT ); mLight->setDirection( Ogre::Vector3( -1, -1, -1 ).normalisedCopy() ); mLightNode->setPosition( Ogre::Vector3( -0.505, 3.400016, 5.423867 ) ); mLight->setAttenuation( 23.0f, 0.5f, 0.0f, 0.5f ); break; case Ogre::Light::LT_POINT: mLight->setType( Ogre::Light::LT_POINT ); mLightNode->setPosition( Ogre::Vector3( -0.505, 3.400016, 5.423867 ) ); mLight->setAttenuation( 23.0f, 0.5f, 0.0f, 0.5f ); break; case Ogre::Light::LT_DIRECTIONAL: mLight->setType( Ogre::Light::LT_DIRECTIONAL ); mLight->setDirection( Ogre::Vector3( 1, -1, -1 ).normalisedCopy() ); mLight->setAttenuation( std::numeric_limits<Ogre::Real>::max(), 1.0f, 0, 0 ); break; } mInstantRadiosity->build(); } //----------------------------------------------------------------------------------- void InstantRadiosityGameState::updateIrradianceVolume() { Ogre::HlmsManager *hlmsManager = mGraphicsSystem->getRoot()->getHlmsManager(); assert( dynamic_cast<Ogre::HlmsPbs*>( hlmsManager->getHlms( Ogre::HLMS_PBS ) ) ); Ogre::HlmsPbs *hlmsPbs = static_cast<Ogre::HlmsPbs*>( hlmsManager->getHlms(Ogre::HLMS_PBS) ); if( !hlmsPbs->getIrradianceVolume() ) return; Ogre::Vector3 volumeOrigin; Ogre::Real lightMaxPower; Ogre::uint32 numBlocksX, numBlocksY, numBlocksZ; mInstantRadiosity->suggestIrradianceVolumeParameters( Ogre::Vector3( mIrradianceCellSize ), volumeOrigin, lightMaxPower, numBlocksX, numBlocksY, numBlocksZ); mIrradianceVolume->createIrradianceVolumeTexture(numBlocksX, numBlocksY, numBlocksZ); mInstantRadiosity->fillIrradianceVolume( mIrradianceVolume, Ogre::Vector3(mIrradianceCellSize), volumeOrigin, lightMaxPower, false ); } //----------------------------------------------------------------------------------- void InstantRadiosityGameState::createScene01() { //Setup a scene similar to that of PBS sample, except //we apply the cubemap to everything via C++ code Ogre::SceneManager *sceneManager = mGraphicsSystem->getSceneManager(); Ogre::v1::MeshPtr planeMeshV1 = Ogre::v1::MeshManager::getSingleton().createPlane( "Plane v1", Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, Ogre::Plane( Ogre::Vector3::UNIT_Y, 1.0f ), 50.0f, 50.0f, 1, 1, true, 1, 4.0f, 4.0f, Ogre::Vector3::UNIT_Z, Ogre::v1::HardwareBuffer::HBU_STATIC, Ogre::v1::HardwareBuffer::HBU_STATIC ); Ogre::MeshPtr planeMesh = Ogre::MeshManager::getSingleton().createByImportingV1( "Plane", Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, planeMeshV1.get(), true, true, true ); { Ogre::HlmsManager *hlmsManager = mGraphicsSystem->getRoot()->getHlmsManager(); assert( dynamic_cast<Ogre::HlmsPbs*>( hlmsManager->getHlms( Ogre::HLMS_PBS ) ) ); Ogre::HlmsPbs *hlmsPbs = static_cast<Ogre::HlmsPbs*>( hlmsManager->getHlms(Ogre::HLMS_PBS) ); Ogre::HlmsBlendblock blendblock; Ogre::HlmsMacroblock macroblock; struct DemoMaterials { Ogre::String matName; Ogre::ColourValue colour; }; DemoMaterials materials[4] = { { "Red", Ogre::ColourValue::Red }, { "Green", Ogre::ColourValue::Green }, { "Blue", Ogre::ColourValue::Blue }, { "Cream", Ogre::ColourValue::White }, }; for( int i=0; i<4; ++i ) { Ogre::String finalName = materials[i].matName; Ogre::HlmsPbsDatablock *datablock; datablock = static_cast<Ogre::HlmsPbsDatablock*>( hlmsPbs->createDatablock( finalName, finalName, macroblock, blendblock, Ogre::HlmsParamVec() ) ); datablock->setBackgroundDiffuse( materials[i].colour ); datablock->setFresnel( Ogre::Vector3( 0.1f ), false ); datablock->setRoughness( 0.02 ); } } generateScene( sceneManager ); Ogre::HlmsManager *hlmsManager = mGraphicsSystem->getRoot()->getHlmsManager(); mInstantRadiosity = new Ogre::InstantRadiosity( sceneManager, hlmsManager ); mInstantRadiosity->mVplThreshold = 0.0005f; //Guide where to shoot the rays for directional lights the 3 windows + the //hole in the ceiling). We use a sphere radius of 30 to ensure when the directional //light's dir is towards -X, we actually hit walls (instead of going through these //walls and generating incorrect results). mInstantRadiosity->mAoI.push_back( Ogre::InstantRadiosity::AreaOfInterest( Ogre::Aabb( Ogre::Vector3( -0.746887f, 7.543859f, 5.499001f ), Ogre::Vector3( 2.876101f, 2.716137f, 6.059607f ) * 0.5f ), 30.0f ) ); mInstantRadiosity->mAoI.push_back( Ogre::InstantRadiosity::AreaOfInterest( Ogre::Aabb( Ogre::Vector3( -6.26f, 3.969576f, 6.628003f ), Ogre::Vector3( 1.673888f, 6.04f, 1.3284f ) * 0.5f ), 30.0f ) ); mInstantRadiosity->mAoI.push_back( Ogre::InstantRadiosity::AreaOfInterest( Ogre::Aabb( Ogre::Vector3( -6.26f, 3.969576f, 3.083399f ), Ogre::Vector3( 1.673888f, 6.04f, 1.3284f ) * 0.5f ), 30.0f ) ); mInstantRadiosity->mAoI.push_back( Ogre::InstantRadiosity::AreaOfInterest( Ogre::Aabb( Ogre::Vector3( -6.26f, 3.969576f, -0.415852f ), Ogre::Vector3( 1.673888f, 6.04f, 1.3284f ) * 0.5f ), 30.0f ) ); createLight(); mCameraController = new CameraController( mGraphicsSystem, false ); mCameraController->mCameraBaseSpeed = 1.0f; mCameraController->mCameraSpeedBoost = 10.0f; sceneManager->setForwardClustered( true, 16, 8, 24, 96, 0, 0, 2, 50 ); //Required by InstantRadiosity sceneManager->getForwardPlus()->setEnableVpls( true ); mIrradianceVolume = new Ogre::IrradianceVolume(hlmsManager); TutorialGameState::createScene01(); } //----------------------------------------------------------------------------------- void InstantRadiosityGameState::destroyScene() { // Ogre::HlmsManager *hlmsManager = mGraphicsSystem->getRoot()->getHlmsManager(); // assert( dynamic_cast<Ogre::HlmsPbs*>( hlmsManager->getHlms( Ogre::HLMS_PBS ) ) ); // Ogre::HlmsPbs *hlmsPbs = static_cast<Ogre::HlmsPbs*>( hlmsManager->getHlms(Ogre::HLMS_PBS) ); // hlmsPbs->setParallaxCorrectedCubemap( 0 ); delete mInstantRadiosity; mInstantRadiosity = 0; } //----------------------------------------------------------------------------------- void InstantRadiosityGameState::update( float timeSinceLast ) { /*if( mAnimateObjects ) { for( int i=0; i<16; ++i ) mSceneNode[i]->yaw( Ogre::Radian(timeSinceLast * i * 0.125f) ); }*/ std::map<SDL_Keycode, SDL_Keysym>::const_iterator itor = mKeysHold.begin(); std::map<SDL_Keycode, SDL_Keysym>::const_iterator end = mKeysHold.end(); bool needsIrradianceVolumeRebuild = false; bool changedVplSetting = false; bool needsRebuild = false; while( itor != end ) { const SDL_Keysym &keySym = itor->second; const bool reverse = (keySym.mod & (KMOD_LSHIFT|KMOD_RSHIFT)) != 0; const float modPerFrame = reverse ? -timeSinceLast : timeSinceLast; if( keySym.scancode == SDL_SCANCODE_H ) { mInstantRadiosity->mCellSize += modPerFrame; mInstantRadiosity->mCellSize = std::max( mInstantRadiosity->mCellSize, Ogre::Real(0.001f) ); needsRebuild = true; } if( keySym.scancode == SDL_SCANCODE_J ) { mInstantRadiosity->mBias += modPerFrame; mInstantRadiosity->mBias = Ogre::Math::Clamp( mInstantRadiosity->mBias, Ogre::Real(0.0f), Ogre::Real(1.0f) ); needsRebuild = true; } if( keySym.scancode == SDL_SCANCODE_U ) { mInstantRadiosity->mVplMaxRange += modPerFrame * 4.0f; changedVplSetting = true; needsIrradianceVolumeRebuild = true; } if( keySym.scancode == SDL_SCANCODE_I ) { mInstantRadiosity->mVplPowerBoost += modPerFrame * 2.0f; changedVplSetting = true; needsIrradianceVolumeRebuild = true; } if( keySym.scancode == SDL_SCANCODE_O ) { mInstantRadiosity->mVplThreshold += modPerFrame * 0.05f; changedVplSetting = true; } if( keySym.scancode == SDL_SCANCODE_P ) { mInstantRadiosity->mVplIntensityRangeMultiplier += modPerFrame * 10.0; mInstantRadiosity->mVplIntensityRangeMultiplier = std::max( mInstantRadiosity->mVplIntensityRangeMultiplier, 0.01 ); changedVplSetting = true; needsIrradianceVolumeRebuild = true; } if( keySym.scancode == SDL_SCANCODE_M ) { mIrradianceCellSize += modPerFrame * 10.0f; mIrradianceCellSize = std::max( mIrradianceCellSize, Ogre::Real(0.1f) ); needsIrradianceVolumeRebuild = true; } ++itor; } if( changedVplSetting && !needsRebuild ) mInstantRadiosity->updateExistingVpls(); if( needsRebuild ) mInstantRadiosity->build(); if( needsIrradianceVolumeRebuild || needsRebuild ) updateIrradianceVolume(); TutorialGameState::update( timeSinceLast ); } //----------------------------------------------------------------------------------- void InstantRadiosityGameState::generateDebugText( float timeSinceLast, Ogre::String &outText ) { TutorialGameState::generateDebugText( timeSinceLast, outText ); if( mDisplayHelpMode != 2 ) return; Ogre::HlmsManager *hlmsManager = mGraphicsSystem->getRoot()->getHlmsManager(); assert( dynamic_cast<Ogre::HlmsPbs*>( hlmsManager->getHlms( Ogre::HLMS_PBS ) ) ); Ogre::HlmsPbs *hlmsPbs = static_cast<Ogre::HlmsPbs*>( hlmsManager->getHlms(Ogre::HLMS_PBS) ); outText += "\nF2 to toggle debug VPL markers "; outText += mInstantRadiosity->getEnableDebugMarkers() ? "[On]" : "[Off]"; outText += "\nF3 to change light type "; switch( mCurrentType ) { default: case Ogre::Light::LT_SPOTLIGHT: outText += "[Spot]"; break; case Ogre::Light::LT_POINT: outText += "[Point]"; break; case Ogre::Light::LT_DIRECTIONAL: outText += "[Directional]"; break; } outText += "\nF4 to toggle intensity for max range "; outText += mInstantRadiosity->mVplUseIntensityForMaxRange ? "[On]" : "[Off]"; outText += "\nF5 to use Irradiance Volumes instead of VPLs "; outText += hlmsPbs->getIrradianceVolume() ? "[Irradiance]" : "[VPL]"; outText += "\nHold [Shift] to change value in opposite direction"; outText += "\nVPL Max range [U]: "; outText += Ogre::StringConverter::toString( mInstantRadiosity->mVplMaxRange ); outText += "\nVPL Power Boost [I]: "; outText += Ogre::StringConverter::toString( mInstantRadiosity->mVplPowerBoost ); outText += "\nVPL Threshold [O]: "; outText += Ogre::StringConverter::toString( mInstantRadiosity->mVplThreshold ); if( mInstantRadiosity->mVplUseIntensityForMaxRange ) { outText += "\nVPL Intensity Range Multiplier [P]: "; outText += Ogre::StringConverter::toString( mInstantRadiosity->mVplIntensityRangeMultiplier ); } outText += "\nNum Rays [G]: "; outText += Ogre::StringConverter::toString( mInstantRadiosity->mNumRays ); outText += "\nCluster size [H]: "; outText += Ogre::StringConverter::toString( mInstantRadiosity->mCellSize ); outText += "\nBias [J]: "; outText += Ogre::StringConverter::toString( mInstantRadiosity->mBias ); outText += "\nSpread Iterations [K]: "; outText += Ogre::StringConverter::toString( mInstantRadiosity->mNumSpreadIterations ); outText += "\nNum bounces [L]: "; outText += Ogre::StringConverter::toString( mInstantRadiosity->mNumRayBounces ); if( hlmsPbs->getIrradianceVolume() ) { outText += "\nIrradiance Cell Size [M]: "; outText += Ogre::StringConverter::toString( mIrradianceCellSize ); } Ogre::Camera *camera = mGraphicsSystem->getCamera(); outText += "\nCamera: "; outText += Ogre::StringConverter::toString( camera->getPosition().x ) + ", " + Ogre::StringConverter::toString( camera->getPosition().y ) + ", " + Ogre::StringConverter::toString( camera->getPosition().z ); } //----------------------------------------------------------------------------------- void InstantRadiosityGameState::keyPressed( const SDL_KeyboardEvent &arg ) { mKeysHold[arg.keysym.scancode] = arg.keysym; TutorialGameState::keyPressed( arg ); } //----------------------------------------------------------------------------------- void InstantRadiosityGameState::keyReleased( const SDL_KeyboardEvent &arg ) { mKeysHold.erase( arg.keysym.scancode ); if( (arg.keysym.mod & ~(KMOD_NUM|KMOD_CAPS|KMOD_LSHIFT|KMOD_RSHIFT)) != 0 ) { TutorialGameState::keyReleased( arg ); return; } if( arg.keysym.scancode == SDL_SCANCODE_F2 ) { mInstantRadiosity->setEnableDebugMarkers( !mInstantRadiosity->getEnableDebugMarkers() ); } else if( arg.keysym.scancode == SDL_SCANCODE_F3 ) { mCurrentType = static_cast<Ogre::Light::LightTypes>( (mCurrentType + 1) % Ogre::Light::LT_VPL ); createLight(); updateIrradianceVolume(); } else if( arg.keysym.scancode == SDL_SCANCODE_F4 ) { mInstantRadiosity->mVplUseIntensityForMaxRange = !mInstantRadiosity->mVplUseIntensityForMaxRange; mInstantRadiosity->updateExistingVpls(); updateIrradianceVolume(); } else if( arg.keysym.scancode == SDL_SCANCODE_F5 ) { Ogre::HlmsManager *hlmsManager = mGraphicsSystem->getRoot()->getHlmsManager(); assert( dynamic_cast<Ogre::HlmsPbs*>( hlmsManager->getHlms( Ogre::HLMS_PBS ) ) ); Ogre::HlmsPbs *hlmsPbs = static_cast<Ogre::HlmsPbs*>( hlmsManager->getHlms(Ogre::HLMS_PBS) ); if( !hlmsPbs->getIrradianceVolume() ) { hlmsPbs->setIrradianceVolume( mIrradianceVolume ); updateIrradianceVolume(); mInstantRadiosity->setUseIrradianceVolume(true); } else { hlmsPbs->setIrradianceVolume( 0 ); mInstantRadiosity->setUseIrradianceVolume(false); } } else if( arg.keysym.scancode == SDL_SCANCODE_G ) { const bool reverse = (arg.keysym.mod & (KMOD_LSHIFT|KMOD_RSHIFT)) != 0; if( reverse ) mInstantRadiosity->mNumRays >>= 1u; else mInstantRadiosity->mNumRays <<= 1u; //Too many rays and the app will become unresponsive mInstantRadiosity->mNumRays = std::max<size_t>( mInstantRadiosity->mNumRays, 1u ); mInstantRadiosity->mNumRays = std::min<size_t>( mInstantRadiosity->mNumRays, 32768u ); mInstantRadiosity->build(); updateIrradianceVolume(); } else if( arg.keysym.scancode == SDL_SCANCODE_K ) { const bool reverse = (arg.keysym.mod & (KMOD_LSHIFT|KMOD_RSHIFT)) != 0; if( reverse ) { if( mInstantRadiosity->mNumSpreadIterations ) --mInstantRadiosity->mNumSpreadIterations; } else { if( mInstantRadiosity->mNumSpreadIterations < 10 ) ++mInstantRadiosity->mNumSpreadIterations; } mInstantRadiosity->build(); updateIrradianceVolume(); } else if( arg.keysym.scancode == SDL_SCANCODE_L ) { const bool reverse = (arg.keysym.mod & (KMOD_LSHIFT|KMOD_RSHIFT)) != 0; if( reverse ) { if( mInstantRadiosity->mNumRayBounces ) --mInstantRadiosity->mNumRayBounces; } else { if( mInstantRadiosity->mNumRayBounces < 5 ) ++mInstantRadiosity->mNumRayBounces; } mInstantRadiosity->build(); updateIrradianceVolume(); } else { TutorialGameState::keyReleased( arg ); } } }
42.987288
105
0.55106
resttime
3a18c2fe3e04ba95cadeb351200c26063f0c34b4
1,534
cpp
C++
KITTIVoxelizer/Source/Geometry/Animation/CatmullRom.cpp
AlfonsoLRz/KITTIVoxelizer
d718a1e0072d94e047c149f52fc202314f09d82e
[ "MIT" ]
14
2021-08-23T04:59:21.000Z
2022-03-25T10:34:55.000Z
KITTIVoxelizer/Source/Geometry/Animation/CatmullRom.cpp
AlfonsoLRz/KITTIVoxelizer
d718a1e0072d94e047c149f52fc202314f09d82e
[ "MIT" ]
null
null
null
KITTIVoxelizer/Source/Geometry/Animation/CatmullRom.cpp
AlfonsoLRz/KITTIVoxelizer
d718a1e0072d94e047c149f52fc202314f09d82e
[ "MIT" ]
6
2021-08-05T17:10:10.000Z
2022-03-31T17:26:47.000Z
#include "stdafx.h" #include "CatmullRom.h" /// [Static attributes] const float CatmullRom::COEFFICIENTS[16] = { -1, 2, -1, 0, 3, -5, 0, 2, -3, 4, 1, 0, 1, -1, 0, 0 }; /// [Public methods] CatmullRom::CatmullRom(std::vector<vec4>& waypoints) : Interpolation(waypoints) { } CatmullRom::~CatmullRom() { } vec4 CatmullRom::getPosition(float t, bool& finished) { if (t < glm::epsilon<float>() && !_waypoints.empty()) return _waypoints[0]; else if (t >= 1.0f && !_waypoints.empty()) return _waypoints[_waypoints.size() - 1]; const unsigned size = std::min(_timeKey.size(), _waypoints.size()); int k = 0; while (_timeKey[k] < t) k++; // Find key const float h = (t - _timeKey[glm::clamp(k - 1, 0, k)]) / (_timeKey[k] - _timeKey[glm::clamp(k - 1, 0, k)]); // Interpolant vec4 result(.0f); for (int i = 0; i < 4; i++) { int kn = k + i - 2; if (kn < 0) kn = 0; else if (kn > (size - 1)) kn = size - 1; const float* coefficient = COEFFICIENTS + 4 * i; const float b = 0.5f * (((coefficient[0] * h + coefficient[1]) * h + coefficient[2]) * h + coefficient[3]); result += b * _waypoints[kn]; } return result; } void CatmullRom::getPath(std::vector<vec4>& path, const unsigned resolution) { const float tIncrement = 1.0f / resolution; float t = .0f; bool finished; while (t <= 1.0f) { path.push_back(this->getPosition(t, finished)); t += tIncrement; } }
27.392857
138
0.556714
AlfonsoLRz
3a1bbb866653c97f411fa16a03b97daa79b15912
351
hpp
C++
oauth/include/oauth/authorize.hpp
zina1995/Twitter-API-C-Library
87b29c63b89be6feb05adbe05ebed0213aa67f9b
[ "MIT" ]
null
null
null
oauth/include/oauth/authorize.hpp
zina1995/Twitter-API-C-Library
87b29c63b89be6feb05adbe05ebed0213aa67f9b
[ "MIT" ]
null
null
null
oauth/include/oauth/authorize.hpp
zina1995/Twitter-API-C-Library
87b29c63b89be6feb05adbe05ebed0213aa67f9b
[ "MIT" ]
null
null
null
#ifndef OAUTH_AUTHORIZE_HPP #define OAUTH_AUTHORIZE_HPP #include <oauth/credentials.hpp> namespace network { struct Request; } // namespace network namespace oauth { /// Add App and Account OAuth 1.0a header to HTTP request. void authorize(network::Request& request, Credentials const& keys); } // namespace oauth #endif // OAUTH_AUTHORIZE_HPP
21.9375
67
0.769231
zina1995
3a1d2339b1f819cc8eb9f71ca30e1e25415aab87
4,220
cpp
C++
tests/GoogleTest/GoogleTestFinderTest.cpp
clagah/mull
9b5a7824b4f3ecdeff64e3b77ee63db2b40b3f99
[ "Apache-2.0" ]
null
null
null
tests/GoogleTest/GoogleTestFinderTest.cpp
clagah/mull
9b5a7824b4f3ecdeff64e3b77ee63db2b40b3f99
[ "Apache-2.0" ]
null
null
null
tests/GoogleTest/GoogleTestFinderTest.cpp
clagah/mull
9b5a7824b4f3ecdeff64e3b77ee63db2b40b3f99
[ "Apache-2.0" ]
1
2019-06-10T02:43:04.000Z
2019-06-10T02:43:04.000Z
#include "mull/TestFrameworks/GoogleTest/GoogleTestFinder.h" #include "FixturePaths.h" #include "TestModuleFactory.h" #include "mull/Config/ConfigParser.h" #include "mull/Config/Configuration.h" #include "mull/Driver.h" #include "mull/Filter.h" #include "mull/ModuleLoader.h" #include "mull/MutationsFinder.h" #include "mull/Mutators/MutatorsFactory.h" #include "mull/Program/Program.h" #include "mull/TestFrameworks/NativeTestRunner.h" #include "mull/Toolchain/JITEngine.h" #include "mull/Toolchain/Toolchain.h" #include <llvm/IR/CallSite.h> #include <llvm/IR/InstrTypes.h> #include <llvm/IR/LLVMContext.h> #include <llvm/IR/Module.h> #include <llvm/Support/DynamicLibrary.h> #include <llvm/Support/SourceMgr.h> #include <llvm/Support/YAMLTraits.h> #include "gtest/gtest.h" using namespace mull; using namespace llvm; #pragma mark - Finding Tests TEST(GoogleTestFinder, FindTest) { LLVMContext llvmContext; ModuleLoader loader; auto ModuleWithTests = loader.loadModuleAtPath( fixtures::google_test_google_test_Test_bc_path(), llvmContext); std::vector<std::unique_ptr<MullModule>> modules; modules.push_back(std::move(ModuleWithTests)); Program program({}, {}, std::move(modules)); const char *configYAML = R"YAML( mutators: - math_add_mutator - negate_mutator - remove_void_function_mutator )YAML"; yaml::Input Input(configYAML); ConfigParser Parser; auto config = Parser.loadConfig(Input); Filter filter; GoogleTestFinder Finder; auto tests = Finder.findTests(program, filter); ASSERT_EQ(2U, tests.size()); ASSERT_EQ("HelloTest.testSumOfTestee", tests[0].getTestName()); ASSERT_EQ("HelloTest.testSumOfTestee2", tests[1].getTestName()); } TEST(GoogleTestFinder, findTests_filter) { LLVMContext llvmContext; ModuleLoader loader; auto ModuleWithTests = loader.loadModuleAtPath( fixtures::google_test_google_test_Test_bc_path(), llvmContext); std::vector<std::unique_ptr<MullModule>> modules; modules.push_back(std::move(ModuleWithTests)); Program program({}, {}, std::move(modules)); const char *configYAML = R"YAML( mutators: - math_add_mutator - negate_mutator - remove_void_function_mutator )YAML"; yaml::Input Input(configYAML); ConfigParser Parser; auto config = Parser.loadConfig(Input); Filter filter; filter.includeTest("HelloTest.testSumOfTestee"); GoogleTestFinder Finder; auto tests = Finder.findTests(program, filter); ASSERT_EQ(1U, tests.size()); ASSERT_EQ("HelloTest.testSumOfTestee", tests[0].getTestName()); } TEST(DISABLED_GoogleTestRunner, runTest) { const char *configYAML = R"YAML( mutators: - math_add_mutator - negate_mutator - remove_void_function_mutator )YAML"; yaml::Input Input(configYAML); ConfigParser Parser; auto rawConfig = Parser.loadConfig(Input); Configuration configuration(rawConfig); Toolchain toolchain(configuration); LLVMContext llvmContext; ModuleLoader loader; auto moduleWithTests = loader.loadModuleAtPath( fixtures::google_test_google_test_Test_bc_path(), llvmContext); auto moduleWithTestees = loader.loadModuleAtPath( fixtures::google_test_google_test_Testee_bc_path(), llvmContext); auto compiledModule_tests = toolchain.compiler().compileModule( moduleWithTests->getModule(), toolchain.targetMachine()); auto compiledModule_testees = toolchain.compiler().compileModule( moduleWithTestees->getModule(), toolchain.targetMachine()); std::vector<std::unique_ptr<MullModule>> modules; modules.push_back(std::move(moduleWithTests)); modules.push_back(std::move(moduleWithTestees)); Program program({}, {}, std::move(modules)); Filter filter; GoogleTestFinder Finder; auto tests = Finder.findTests(program, filter); ASSERT_EQ(2U, tests.size()); ASSERT_EQ("HelloTest.testSumOfTestee", tests[0].getTestName()); ASSERT_EQ("HelloTest.testSumOfTestee2", tests[1].getTestName()); NativeTestRunner runner(toolchain.mangler()); JITEngine jit; std::vector<llvm::object::ObjectFile *> objects( {compiledModule_tests.getBinary(), compiledModule_testees.getBinary()}); /// TODO: enable eventually // runner.loadProgram(objects, jit); runner.runTest(jit, program, tests[0]); }
28.513514
78
0.755924
clagah
3a1e55936c6a7e7c5f307e8496c6ae0515aca40c
2,916
cpp
C++
packages/SFML/src/SFML/Graphics/Glsl.cpp
JamesOrson/KomodoCPP
62d481f1125213f9fe7553fa680eba31c38a7c74
[ "Unlicense" ]
1
2019-07-03T12:27:16.000Z
2019-07-03T12:27:16.000Z
ext/SFML/src/SFML/Graphics/Glsl.cpp
Senryoku/NESen
7573eddc55da0e140cf01e609b1041b2c6e4e853
[ "MIT" ]
9
2019-07-03T12:31:39.000Z
2019-07-05T14:30:59.000Z
engine/third_party/SFML/src/SFML/Graphics/Glsl.cpp
wemadedis/wme
f84ecb6106614eefaa3bf233ca7927ad7708f143
[ "MIT" ]
null
null
null
//////////////////////////////////////////////////////////// // // SFML - Simple and Fast Multimedia Library // Copyright (C) 2007-2019 Laurent Gomila (laurent@sfml-dev.org) // // This software is provided 'as-is', without any express or implied warranty. // In no event will the authors be held liable for any damages arising from the use of this software. // // Permission is granted to anyone to use this software for any purpose, // including commercial applications, and to alter it and redistribute it freely, // subject to the following restrictions: // // 1. The origin of this software must not be misrepresented; // you must not claim that you wrote the original software. // If you use this software in a product, an acknowledgment // in the product documentation would be appreciated but is not required. // // 2. Altered source versions must be plainly marked as such, // and must not be misrepresented as being the original software. // // 3. This notice may not be removed or altered from any source distribution. // //////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////// // Headers //////////////////////////////////////////////////////////// #include <SFML/Graphics/Glsl.hpp> #include <algorithm> namespace sf { namespace priv { //////////////////////////////////////////////////////////// void copyMatrix(const Transform& source, Matrix<3, 3>& dest) { const float* from = source.getMatrix(); // 4x4 float* to = dest.array; // 3x3 // Use only left-upper 3x3 block (for a 2D transform) to[0] = from[ 0]; to[1] = from[ 1]; to[2] = from[ 3]; to[3] = from[ 4]; to[4] = from[ 5]; to[5] = from[ 7]; to[6] = from[12]; to[7] = from[13]; to[8] = from[15]; } //////////////////////////////////////////////////////////// void copyMatrix(const Transform& source, Matrix<4, 4>& dest) { // Adopt 4x4 matrix as-is copyMatrix(source.getMatrix(), 4 * 4, dest.array); } //////////////////////////////////////////////////////////// void copyMatrix(const float* source, std::size_t elements, float* dest) { std::copy(source, source + elements, dest); } //////////////////////////////////////////////////////////// void copyVector(const Color& source, Vector4<float>& dest) { dest.x = source.r / 255.f; dest.y = source.g / 255.f; dest.z = source.b / 255.f; dest.w = source.a / 255.f; } //////////////////////////////////////////////////////////// void copyVector(const Color& source, Vector4<int>& dest) { dest.x = static_cast<int>(source.r); dest.y = static_cast<int>(source.g); dest.z = static_cast<int>(source.b); dest.w = static_cast<int>(source.a); } } // namespace priv } // namespace sf
33.517241
101
0.509945
JamesOrson
3a20cf2915156bd1063602f5ec1eac9955448318
1,298
cpp
C++
CONTRIB/LLVM/_Demo/Lib_GZ/Debugging.cpp
Cwc-Test/CpcdosOS2.1
d52c170be7f11cc50de38ef536d4355743d21706
[ "Apache-2.0" ]
1
2021-05-05T20:42:24.000Z
2021-05-05T20:42:24.000Z
CONTRIB/LLVM/_Demo/Lib_GZ/Debugging.cpp
Cwc-Test/CpcdosOS2.1
d52c170be7f11cc50de38ef536d4355743d21706
[ "Apache-2.0" ]
null
null
null
CONTRIB/LLVM/_Demo/Lib_GZ/Debugging.cpp
Cwc-Test/CpcdosOS2.1
d52c170be7f11cc50de38ef536d4355743d21706
[ "Apache-2.0" ]
null
null
null
//This file is part of "GZE - GroundZero Engine" //The permisive licence allow to use GZE for free or commercial project (Apache License, Version 2.0). //For conditions of distribution and use, see copyright notice in Licence.txt, this license must be included with any distribution of the code. //Though not required by the license agreement, please consider the following will be greatly appreciated: //- We would like to hear about projects where GZE is used. //- Include an attribution statement somewhere in your project. //- If you want to see GZE evolve please help us with a donation. #include "Lib_GZ/Lib_GZ.h" #include "Lib_GZ/Sys/Debug.h" #include "Debugging.h" #ifdef GZ_tHaveCallStack gzPtr gzaCallStack[GZ_tCallStackSize]; gzUInt gznCallStackIndex; #endif namespace Lib_GZ{ void fConsole(gzPStr _sValue){ printf("c:"); printf("%s", (char*)_sValue.fcStr() ); printf("\n"); } void fSpAssertError(gzUInt _nLine){ Lib_GZ::fConsole(gzStrL("Shared Ptr Error, place breakpoint here to get the call stack")); GZ_Crash(); } void fSpAssertError(gzPStr _sMessage, gzUInt _nLine){ Lib_GZ::fConsole(gzStrL("Shared Ptr Error:") + _sMessage + gzStrL(", place breakpoint here to get the call stack")); GZ_Crash(); } }
31.658537
143
0.714946
Cwc-Test
3a22bd657441b1b00eb4ee549ae2f009ab03e1df
298
hpp
C++
include/clientdata.hpp
Kuxe/swordbow-magic
22c4bde7fe70728f631bfa77765dbe8ea121df33
[ "MIT" ]
1
2020-03-29T16:20:02.000Z
2020-03-29T16:20:02.000Z
include/clientdata.hpp
Kuxe/swordbow-magic
22c4bde7fe70728f631bfa77765dbe8ea121df33
[ "MIT" ]
47
2015-01-02T16:54:57.000Z
2015-10-08T21:09:06.000Z
include/clientdata.hpp
Kuxe/swordbow-magic
22c4bde7fe70728f631bfa77765dbe8ea121df33
[ "MIT" ]
2
2015-01-02T17:23:18.000Z
2020-03-29T16:20:04.000Z
#ifndef CLIENTDATA_HPP #define CLIENTDATA_HPP #include "timer.hpp" typedef unsigned int ID; //Intended as value in unordered_maps where key is the IpAddress struct ClientData { uint16_t sequence; ID id; bool congested = false; Timer congestionTimer; }; #endif //CLIENTDATA_HPP
17.529412
64
0.741611
Kuxe
3a26f1198d2d4049b8c04928d3e29b7dbe326aa3
989
cpp
C++
C_C++_Projects/0_Reference Sheets/testmergesort.cpp
sunjerry019/RandomCodes
4402604aaeee63bb1ce6fa962c496b438bb17e50
[ "MIT" ]
null
null
null
C_C++_Projects/0_Reference Sheets/testmergesort.cpp
sunjerry019/RandomCodes
4402604aaeee63bb1ce6fa962c496b438bb17e50
[ "MIT" ]
null
null
null
C_C++_Projects/0_Reference Sheets/testmergesort.cpp
sunjerry019/RandomCodes
4402604aaeee63bb1ce6fa962c496b438bb17e50
[ "MIT" ]
null
null
null
#include <bits/stdc++.h> #include <iterator> #include <algorithm> // for std::inplace_merge #include <functional> // for std::less using namespace std; template<typename RandomAccessIterator, typename Order> void mergesort(RandomAccessIterator first, RandomAccessIterator last, Order order) { if (last - first > 1) { RandomAccessIterator middle = first + (last - first) / 2; mergesort(first, middle, order); mergesort(middle, last, order); inplace_merge(first, middle, last, order); } } template<typename RandomAccessIterator> void mergesort(RandomAccessIterator first, RandomAccessIterator last) { mergesort(first, last, less<typename iterator_traits<RandomAccessIterator>::value_type>()); } int main () { int x[10] = {5,1,2,4,8,42,5,12}; printf("%s", "Hi1"); mergesort(x, x + sizeof(x)); printf("%s", "Hi3"); for (int i = 0; i < 8; ++i) { printf("%s", "Hi2"); cout << "Hi"; cout << x[i] << " "; } return 0; }
24.725
93
0.647118
sunjerry019
3a26fdc90c4cdb999d47cb65e158e0347b58db77
8,681
cpp
C++
plugins/community/repos/ImpromptuModular/src/IMWidgets.cpp
x42/VeeSeeVSTRack
0f5576f92e026ac1480e1477e55084911eca4052
[ "Zlib", "BSD-3-Clause" ]
null
null
null
plugins/community/repos/ImpromptuModular/src/IMWidgets.cpp
x42/VeeSeeVSTRack
0f5576f92e026ac1480e1477e55084911eca4052
[ "Zlib", "BSD-3-Clause" ]
null
null
null
plugins/community/repos/ImpromptuModular/src/IMWidgets.cpp
x42/VeeSeeVSTRack
0f5576f92e026ac1480e1477e55084911eca4052
[ "Zlib", "BSD-3-Clause" ]
null
null
null
//*********************************************************************************************** //Impromptu Modular: Modules for VCV Rack by Marc Boulé // //Based on code from Valley Rack Free by Dale Johnson //See ./LICENSE.txt for all licenses //*********************************************************************************************** #include "IMWidgets.hpp" // Dynamic SVGScrew ScrewCircle::ScrewCircle(float _angle) { static const float highRadius = 1.4f;// radius for 0 degrees (screw looks like a +) static const float lowRadius = 1.1f;// radius for 45 degrees (screw looks like an x) angle = _angle; _angle = fabs(angle - M_PI/4.0f); radius = ((highRadius - lowRadius)/(M_PI/4.0f)) * _angle + lowRadius; } void ScrewCircle::draw(NVGcontext *vg) { NVGcolor backgroundColor = nvgRGB(0x72, 0x72, 0x72); NVGcolor borderColor = nvgRGB(0x72, 0x72, 0x72); nvgBeginPath(vg); nvgCircle(vg, box.size.x/2.0f, box.size.y/2.0f, radius);// box, radius nvgFillColor(vg, backgroundColor); nvgFill(vg); nvgStrokeWidth(vg, 1.0); nvgStrokeColor(vg, borderColor); nvgStroke(vg); } DynamicSVGScrew::DynamicSVGScrew() { mode = nullptr; oldMode = -1; // for random rotated screw used in primary mode (code copied from ImpromptuModular.cpp ScrewSilverRandomRot::ScrewSilverRandomRot()) // ********** float angle0_90 = randomUniform()*M_PI/2.0f; //float angle0_90 = randomUniform() > 0.5f ? M_PI/4.0f : 0.0f;// for testing tw = new TransformWidget(); addChild(tw); sw = new SVGWidget(); tw->addChild(sw); //sw->setSVG(SVG::load(assetPlugin(plugin, "res/Screw.svg"))); sw->setSVG(SVG::load(assetGlobal("res/ComponentLibrary/ScrewSilver.svg"))); sc = new ScrewCircle(angle0_90); sc->box.size = sw->box.size; tw->addChild(sc); box.size = sw->box.size; tw->box.size = sw->box.size; tw->identity(); // Rotate SVG Vec center = sw->box.getCenter(); tw->translate(center); tw->rotate(angle0_90); tw->translate(center.neg()); // for fixed svg screw used in alternate mode // ********** swAlt = new SVGWidget(); swAlt->visible = false; addChild(swAlt); } void DynamicSVGScrew::addSVGalt(std::shared_ptr<SVG> svg) { if(!swAlt->svg) { swAlt->setSVG(svg); } } void DynamicSVGScrew::step() { // all code except middle if() from SVGPanel::step() in SVGPanel.cpp if (isNear(rack::global_ui->window.gPixelRatio, 1.0)) { // Small details draw poorly at low DPI, so oversample when drawing to the framebuffer oversample = 2.f; } if(mode != nullptr && *mode != oldMode) { if ((*mode) == 0) { sw->visible = true; swAlt->visible = false; } else { sw->visible = false; swAlt->visible = true; } oldMode = *mode; dirty = true; } FramebufferWidget::step(); } // Dynamic SVGPanel void PanelBorderWidget_Impromptu::draw(NVGcontext *vg) { // carbon copy from SVGPanel.cpp NVGcolor borderColor = nvgRGBAf(0.5, 0.5, 0.5, 0.5); nvgBeginPath(vg); nvgRect(vg, 0.5, 0.5, box.size.x - 1.0, box.size.y - 1.0);// full rect of module (including expansion area if a module has one) nvgStrokeColor(vg, borderColor); nvgStrokeWidth(vg, 1.0); nvgStroke(vg); if (expWidth != nullptr && *expWidth != nullptr) {// add expansion division when pannel uses expansion area int expW = **expWidth; nvgBeginPath(vg); nvgMoveTo(vg, box.size.x - expW, 1); nvgLineTo(vg, box.size.x - expW, box.size.y - 1.0); nvgStrokeWidth(vg, 2.0); nvgStroke(vg); } } DynamicSVGPanel::DynamicSVGPanel() { mode = nullptr; oldMode = -1; expWidth = nullptr; visiblePanel = new SVGWidget(); addChild(visiblePanel); border = new PanelBorderWidget_Impromptu(); border->expWidth = &expWidth; addChild(border); } void DynamicSVGPanel::addPanel(std::shared_ptr<SVG> svg) { panels.push_back(svg); if(!visiblePanel->svg) { visiblePanel->setSVG(svg); box.size = visiblePanel->box.size.div(RACK_GRID_SIZE).round().mult(RACK_GRID_SIZE); border->box.size = box.size; } } void DynamicSVGPanel::step() { // all code except middle if() from SVGPanel::step() in SVGPanel.cpp if (isNear(rack::global_ui->window.gPixelRatio, 1.0)) { // Small details draw poorly at low DPI, so oversample when drawing to the framebuffer oversample = 2.f; } if(mode != nullptr && *mode != oldMode) { visiblePanel->setSVG(panels[*mode]); oldMode = *mode; dirty = true; } FramebufferWidget::step(); } // Dynamic SVGPort DynamicSVGPort::DynamicSVGPort() { mode = nullptr; oldMode = -1; //SVGPort constructor automatically called } void DynamicSVGPort::addFrame(std::shared_ptr<SVG> svg) { frames.push_back(svg); if(!background->svg) SVGPort::setSVG(svg); } void DynamicSVGPort::step() { if (isNear(rack::global_ui->window.gPixelRatio, 1.0)) { // Small details draw poorly at low DPI, so oversample when drawing to the framebuffer oversample = 2.f; } if(mode != nullptr && *mode != oldMode) { background->setSVG(frames[*mode]); oldMode = *mode; dirty = true; } Port::step(); } // Dynamic SVGSwitch DynamicSVGSwitch::DynamicSVGSwitch() { mode = nullptr; oldMode = -1; //SVGSwitch constructor automatically called } void DynamicSVGSwitch::addFrameAll(std::shared_ptr<SVG> svg) { framesAll.push_back(svg); if (framesAll.size() == 2) { addFrame(framesAll[0]); addFrame(framesAll[1]); } } void DynamicSVGSwitch::step() { if (isNear(rack::global_ui->window.gPixelRatio, 1.0)) { // Small details draw poorly at low DPI, so oversample when drawing to the framebuffer oversample = 2.f; } if(mode != nullptr && *mode != oldMode) { if ((*mode) == 0) { frames[0]=framesAll[0]; frames[1]=framesAll[1]; } else { frames[0]=framesAll[2]; frames[1]=framesAll[3]; } oldMode = *mode; onChange(*(new EventChange()));// required because of the way SVGSwitch changes images, we only change the frames above. //dirty = true;// dirty is not sufficient when changing via frames assignments above (i.e. onChange() is required) } } // Dynamic SVGKnob DynamicSVGKnob::DynamicSVGKnob() { mode = nullptr; oldMode = -1; effect = new SVGWidget(); //SVGKnob constructor automatically called } void DynamicSVGKnob::addFrameAll(std::shared_ptr<SVG> svg) { framesAll.push_back(svg); if (framesAll.size() == 1) { setSVG(svg); } } void DynamicSVGKnob::addEffect(std::shared_ptr<SVG> svg) { effect->setSVG(svg); addChild(effect); } void DynamicSVGKnob::step() { if (isNear(rack::global_ui->window.gPixelRatio, 1.0)) { // Small details draw poorly at low DPI, so oversample when drawing to the framebuffer oversample = 2.f; } if(mode != nullptr && *mode != oldMode) { if ((*mode) == 0) { setSVG(framesAll[0]); effect->visible = false; } else { setSVG(framesAll[1]); effect->visible = true; } oldMode = *mode; dirty = true; } SVGKnob::step(); } // Dynamic IMTactile DynamicIMTactile::DynamicIMTactile() { snap = false; smooth = false;// must be false or else DynamicIMTactile::changeValue() call from module will crash Rack wider = nullptr; paramReadRequest = nullptr; oldWider = -1.0f; box.size = Vec(padWidth, padHeight); } void DynamicIMTactile::step() { if(wider != nullptr && *wider != oldWider) { if ((*wider) > 0.5f) { box.size = Vec(padWidthWide, padHeight); } else { box.size = Vec(padWidth, padHeight); } oldWider = *wider; } if (paramReadRequest != nullptr) { float readVal = *paramReadRequest; if (readVal != -10.0f) { setValue(readVal); *paramReadRequest = -10.0f; } } FramebufferWidget::step(); } void DynamicIMTactile::onDragStart(EventDragStart &e) { dragValue = value; dragY = rack::global_ui->app.gRackWidget->lastMousePos.y; } void DynamicIMTactile::onDragMove(EventDragMove &e) { float rangeValue = maxValue - minValue;// infinite not supported (not relevant) float newDragY = rack::global_ui->app.gRackWidget->lastMousePos.y; float delta = -(newDragY - dragY) * rangeValue / box.size.y; dragY = newDragY; dragValue += delta; float dragValueClamped = clamp2(dragValue, minValue, maxValue); if (snap) dragValueClamped = roundf(dragValueClamped); setValue(dragValueClamped); } void DynamicIMTactile::onMouseDown(EventMouseDown &e) { float val = rescale(e.pos.y, box.size.y, 0.0f , minValue, maxValue); if (snap) val = roundf(val); setValue(val); ParamWidget::onMouseDown(e); } //void DynamicIMTactile::changeValue(float newVal) { // setValue(newVal); //}
26.628834
134
0.646239
x42
3a270e5805aca8f01acf5f84d4a443a56727c652
1,283
cpp
C++
Kattis/zoo.cpp
YourName0729/competitive-programming
437ef18a46074f520e0bfa0bdd718bb6b1c92800
[ "MIT" ]
3
2021-02-19T17:01:11.000Z
2021-03-11T16:50:19.000Z
Kattis/zoo.cpp
YourName0729/competitive-programming
437ef18a46074f520e0bfa0bdd718bb6b1c92800
[ "MIT" ]
null
null
null
Kattis/zoo.cpp
YourName0729/competitive-programming
437ef18a46074f520e0bfa0bdd718bb6b1c92800
[ "MIT" ]
null
null
null
// https://open.kattis.com/problems/zoo #include <bits/stdc++.h> #include <ext/pb_ds/tree_policy.hpp> #include <ext/pb_ds/assoc_container.hpp> #define For(i, n) for (int i = 0; i < n; ++i) #define Forcase int __t = 0; cin >> __t; while (__t--) #define ll long long #define ull unsigned long long #define ar array using namespace std; using namespace __gnu_pbds; template<class Type> using indexed_set=tree<Type,null_type,less<Type>,rb_tree_tag,tree_order_statistics_node_update>; const int MOD = 1e9 + 7; const int INF = 2147483647; const unsigned ll IINF = 1e18; const double eps = 1e-12; string lower(string s) { for (char& c : s) { if ('A' <= c && c <= 'Z') { c = c - 'A' + 'a'; } } return s; } int main(){ ios_base::sync_with_stdio(0); cin.tie(0); int cnt = 0; int n; while (cin >> n && n) { cnt++; string s; map<string, int> mp; getline(cin, s); For (i, n) { getline(cin, s); stringstream ss; ss << s; while (ss >> s); mp[lower(s)]++; } cout << "List " << cnt << ":\n"; for (auto p : mp) { cout << p.first << " | " << p.second << '\n'; } } return 0; }
21.745763
117
0.522993
YourName0729
3a2d1c7038692a23a9c99fd3b89475cf1a73ef0b
7,981
cpp
C++
submodules/libtgvoip/JitterBuffer.cpp
we11cheng/WCTelegram
8d6e098be215ea6e8c4f557a8e5a03620c0fad61
[ "MIT" ]
3
2018-08-28T12:37:54.000Z
2021-11-19T03:23:26.000Z
submodules/libtgvoip/JitterBuffer.cpp
we11cheng/WCTelegram
8d6e098be215ea6e8c4f557a8e5a03620c0fad61
[ "MIT" ]
null
null
null
submodules/libtgvoip/JitterBuffer.cpp
we11cheng/WCTelegram
8d6e098be215ea6e8c4f557a8e5a03620c0fad61
[ "MIT" ]
4
2020-02-24T15:32:39.000Z
2021-11-19T03:23:20.000Z
// // Created by Grishka on 19.06.16. // #include "JitterBuffer.h" #include "logging.h" CJitterBuffer::CJitterBuffer(CMediaStreamItf *out, uint32_t step):bufferPool(JITTER_SLOT_SIZE, JITTER_SLOT_COUNT){ if(out) out->SetCallback(CJitterBuffer::CallbackOut, this); this->step=step; memset(slots, 0, sizeof(jitter_packet_t)*JITTER_SLOT_COUNT); minDelay=6; lostCount=0; needBuffering=true; tickCount=0; dontIncMinDelay=0; dontDecMinDelay=0; lostPackets=0; if(step<30) minMinDelay=2; else if(step<50) minMinDelay=4; else minMinDelay=6; Reset(); init_mutex(mutex); } CJitterBuffer::~CJitterBuffer(){ Reset(); free_mutex(mutex); } void CJitterBuffer::SetMinPacketCount(uint32_t count){ if(minDelay==count) return; minDelay=count; Reset(); } int CJitterBuffer::GetMinPacketCount(){ return minDelay; } size_t CJitterBuffer::CallbackIn(unsigned char *data, size_t len, void *param){ //((CJitterBuffer*)param)->HandleInput(data, len); return 0; } size_t CJitterBuffer::CallbackOut(unsigned char *data, size_t len, void *param){ return ((CJitterBuffer*)param)->HandleOutput(data, len, 0); } void CJitterBuffer::HandleInput(unsigned char *data, size_t len, uint32_t timestamp){ jitter_packet_t pkt; pkt.size=len; pkt.buffer=data; pkt.timestamp=timestamp; lock_mutex(mutex); PutInternal(&pkt); unlock_mutex(mutex); //LOGV("in, ts=%d", timestamp); } void CJitterBuffer::Reset(){ wasReset=true; needBuffering=true; lastPutTimestamp=0; int i; for(i=0;i<JITTER_SLOT_COUNT;i++){ if(slots[i].buffer){ bufferPool.Reuse(slots[i].buffer); slots[i].buffer=NULL; } } memset(delayHistory, 0, sizeof(int)*64); memset(lateHistory, 0, sizeof(int)*64); adjustingDelay=false; } size_t CJitterBuffer::HandleOutput(unsigned char *buffer, size_t len, int offsetInSteps){ jitter_packet_t pkt; pkt.buffer=buffer; pkt.size=len; lock_mutex(mutex); int result=GetInternal(&pkt, offsetInSteps); unlock_mutex(mutex); if(result==JR_OK){ return pkt.size; }else{ return 0; } } int CJitterBuffer::GetInternal(jitter_packet_t* pkt, int offset){ /*if(needBuffering && lastPutTimestamp<nextTimestamp){ LOGV("jitter: don't have timestamp %lld, buffering", nextTimestamp); Advance(); return JR_BUFFERING; }*/ //needBuffering=false; int64_t timestampToGet=nextTimestamp+offset*(int32_t)step; int i; for(i=0;i<JITTER_SLOT_COUNT;i++){ if(slots[i].buffer!=NULL && slots[i].timestamp==timestampToGet){ break; } } if(i<JITTER_SLOT_COUNT){ if(pkt && pkt->size<slots[i].size){ LOGE("jitter: packet won't fit into provided buffer of %d (need %d)", slots[i].size, pkt->size); }else{ if(pkt) { pkt->size = slots[i].size; pkt->timestamp = slots[i].timestamp; memcpy(pkt->buffer, slots[i].buffer, slots[i].size); } } bufferPool.Reuse(slots[i].buffer); slots[i].buffer=NULL; if(offset==0) Advance(); lostCount=0; needBuffering=false; return JR_OK; } LOGW("jitter: found no packet for timestamp %lld (last put = %d)", timestampToGet, lastPutTimestamp); if(offset==0) Advance(); if(!needBuffering){ lostCount++; if(offset==0) lostPackets++; if(lostCount>=10){ LOGW("jitter: lost %d packets in a row, resetting", lostCount); //minDelay++; dontIncMinDelay=16; dontDecMinDelay+=128; if(GetCurrentDelay()<minDelay) nextTimestamp-=(minDelay-GetCurrentDelay()); lostCount=0; Reset(); } return JR_MISSING; } return JR_BUFFERING; } void CJitterBuffer::PutInternal(jitter_packet_t* pkt){ if(pkt->size>JITTER_SLOT_SIZE){ LOGE("The packet is too big to fit into the jitter buffer"); return; } int i; if(wasReset){ wasReset=false; nextTimestamp=((int64_t)pkt->timestamp)-step*minDelay; LOGI("jitter: resyncing, next timestamp = %lld (step=%d, minDelay=%d)", nextTimestamp, step, minDelay); for(i=0;i<JITTER_SLOT_COUNT;i++){ if(slots[i].buffer!=NULL){ if(slots[i].timestamp<nextTimestamp-1){ bufferPool.Reuse(slots[i].buffer); slots[i].buffer=NULL; } } } } if(pkt->timestamp<nextTimestamp){ LOGW("jitter: would drop packet with timestamp %d because it is late but not hopelessly", pkt->timestamp); latePacketCount++; lostPackets--; }else if(pkt->timestamp<nextTimestamp-1){ LOGW("jitter: dropping packet with timestamp %d because it is too late", pkt->timestamp); latePacketCount++; return; } if(pkt->timestamp>lastPutTimestamp) lastPutTimestamp=pkt->timestamp; for(i=0;i<JITTER_SLOT_COUNT;i++){ if(slots[i].buffer==NULL) break; } if(i==JITTER_SLOT_COUNT){ int toRemove=JITTER_SLOT_COUNT; uint32_t bestTimestamp=0xFFFFFFFF; for(i=0;i<JITTER_SLOT_COUNT;i++){ if(slots[i].timestamp<bestTimestamp){ toRemove=i; bestTimestamp=slots[i].timestamp; } } bufferPool.Reuse(slots[toRemove].buffer); slots[toRemove].buffer=NULL; i=toRemove; } slots[i].timestamp=pkt->timestamp; slots[i].size=pkt->size; slots[i].buffer=bufferPool.Get(); if(slots[i].buffer) memcpy(slots[i].buffer, pkt->buffer, pkt->size); else LOGE("WTF!!"); } void CJitterBuffer::Advance(){ nextTimestamp+=step; } int CJitterBuffer::GetCurrentDelay(){ int delay=0; int i; for(i=0;i<JITTER_SLOT_COUNT;i++){ if(slots[i].buffer!=NULL) delay++; } return delay; } void CJitterBuffer::Tick(){ lock_mutex(mutex); int i; for(i=0;i<JITTER_SLOT_COUNT;i++){ if(slots[i].buffer!=NULL){ if(slots[i].timestamp<nextTimestamp-2){ bufferPool.Reuse(slots[i].buffer); slots[i].buffer=NULL; } } } memmove(&lateHistory[1], lateHistory, 63*sizeof(int)); lateHistory[0]=latePacketCount; latePacketCount=0; bool absolutelyNoLatePackets=true; double avgLate64=0, avgLate32=0, avgLate16=0; for(i=0;i<64;i++){ avgLate64+=lateHistory[i]; if(i<32) avgLate32+=lateHistory[i]; if(i<16){ avgLate16+=lateHistory[i]; } if(lateHistory[i]>0) absolutelyNoLatePackets=false; } avgLate64/=64; avgLate32/=32; avgLate16/=16; //LOGV("jitter: avg late=%.1f, %.1f, %.1f", avgLate16, avgLate32, avgLate64); if(avgLate16>=0.3){ if(dontIncMinDelay==0 && minDelay<15){ minDelay++; if(GetCurrentDelay()<minDelay) nextTimestamp-=(minDelay-GetCurrentDelay()); dontIncMinDelay=16; dontDecMinDelay+=128; } }else if(absolutelyNoLatePackets){ if(dontDecMinDelay>0) dontDecMinDelay--; if(dontDecMinDelay==0 && minDelay>minMinDelay){ minDelay--; dontDecMinDelay=64; dontIncMinDelay+=16; } } if(dontIncMinDelay>0) dontIncMinDelay--; memmove(&delayHistory[1], delayHistory, 63*sizeof(int)); delayHistory[0]=GetCurrentDelay(); int avgDelay=0; int min=100; for(i=0;i<32;i++){ avgDelay+=delayHistory[i]; if(delayHistory[i]<min) min=delayHistory[i]; } avgDelay/=32; //LOGV("jitter: avg delay=%d, delay=%d, late16=%.1f, dontDecMinDelay=%d", avgDelay, delayHistory[0], avgLate16, dontDecMinDelay); if(!adjustingDelay) { if (avgDelay>=minDelay/2 && delayHistory[0]>minDelay && avgLate16<=0.1 && absolutelyNoLatePackets && dontDecMinDelay<32 && min>minDelay) { LOGI("jitter: need adjust"); adjustingDelay=true; } }else{ if(!absolutelyNoLatePackets){ LOGI("jitter: done adjusting because we're losing packets"); adjustingDelay=false; }else if(tickCount%5==0){ LOGD("jitter: removing a packet to reduce delay"); GetInternal(NULL, 0); if(GetCurrentDelay()<=minDelay || min<=minDelay){ adjustingDelay = false; LOGI("jitter: done adjusting"); } } } tickCount++; unlock_mutex(mutex); } void CJitterBuffer::GetAverageLateCount(double *out){ double avgLate64=0, avgLate32=0, avgLate16=0; int i; for(i=0;i<64;i++){ avgLate64+=lateHistory[i]; if(i<32) avgLate32+=lateHistory[i]; if(i<16) avgLate16+=lateHistory[i]; } avgLate64/=64; avgLate32/=32; avgLate16/=16; out[0]=avgLate16; out[1]=avgLate32; out[2]=avgLate64; } int CJitterBuffer::GetAndResetLostPacketCount(){ lock_mutex(mutex); int r=lostPackets; lostPackets=0; unlock_mutex(mutex); return r; }
22.673295
140
0.697281
we11cheng
3a2d1f56ce25ea37596fea40e4126e743ed018c4
5,916
cpp
C++
core/fpdfapi/edit/cpdf_pagecontentmanager.cpp
WarGloom/pdfium
e9a79aa2ef7d63aa8e1b2716d25725cf280f199f
[ "Apache-2.0" ]
7
2018-05-17T22:53:33.000Z
2022-02-05T15:51:41.000Z
core/fpdfapi/edit/cpdf_pagecontentmanager.cpp
WarGloom/pdfium
e9a79aa2ef7d63aa8e1b2716d25725cf280f199f
[ "Apache-2.0" ]
null
null
null
core/fpdfapi/edit/cpdf_pagecontentmanager.cpp
WarGloom/pdfium
e9a79aa2ef7d63aa8e1b2716d25725cf280f199f
[ "Apache-2.0" ]
3
2018-05-17T22:53:42.000Z
2022-01-18T05:53:34.000Z
// Copyright 2018 PDFium 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 "core/fpdfapi/edit/cpdf_pagecontentmanager.h" #include <map> #include <numeric> #include <vector> #include "core/fpdfapi/page/cpdf_pageobject.h" #include "core/fpdfapi/page/cpdf_pageobjectholder.h" #include "core/fpdfapi/parser/cpdf_array.h" #include "core/fpdfapi/parser/cpdf_dictionary.h" #include "core/fpdfapi/parser/cpdf_document.h" #include "core/fpdfapi/parser/cpdf_reference.h" #include "core/fpdfapi/parser/cpdf_stream.h" #include "third_party/base/check.h" #include "third_party/base/containers/adapters.h" #include "third_party/base/numerics/safe_conversions.h" CPDF_PageContentManager::CPDF_PageContentManager( const CPDF_PageObjectHolder* obj_holder) : obj_holder_(obj_holder), doc_(obj_holder_->GetDocument()) { CPDF_Dictionary* page_dict = obj_holder_->GetDict(); CPDF_Object* contents_obj = page_dict->GetObjectFor("Contents"); CPDF_Array* contents_array = ToArray(contents_obj); if (contents_array) { contents_array_.Reset(contents_array); return; } CPDF_Reference* contents_reference = ToReference(contents_obj); if (contents_reference) { CPDF_Object* indirect_obj = contents_reference->GetDirect(); if (!indirect_obj) return; contents_array = indirect_obj->AsArray(); if (contents_array) contents_array_.Reset(contents_array); else if (indirect_obj->IsStream()) contents_stream_.Reset(indirect_obj->AsStream()); } } CPDF_PageContentManager::~CPDF_PageContentManager() = default; CPDF_Stream* CPDF_PageContentManager::GetStreamByIndex(size_t stream_index) { if (contents_stream_) return stream_index == 0 ? contents_stream_.Get() : nullptr; if (contents_array_) { CPDF_Reference* stream_reference = ToReference(contents_array_->GetObjectAt(stream_index)); if (!stream_reference) return nullptr; return stream_reference->GetDirect()->AsStream(); } return nullptr; } size_t CPDF_PageContentManager::AddStream(fxcrt::ostringstream* buf) { CPDF_Stream* new_stream = doc_->NewIndirect<CPDF_Stream>(); new_stream->SetDataFromStringstream(buf); // If there is one Content stream (not in an array), now there will be two, so // create an array with the old and the new one. The new one's index is 1. if (contents_stream_) { CPDF_Array* new_contents_array = doc_->NewIndirect<CPDF_Array>(); new_contents_array->AppendNew<CPDF_Reference>( doc_.Get(), contents_stream_->GetObjNum()); new_contents_array->AppendNew<CPDF_Reference>(doc_.Get(), new_stream->GetObjNum()); CPDF_Dictionary* page_dict = obj_holder_->GetDict(); page_dict->SetNewFor<CPDF_Reference>("Contents", doc_.Get(), new_contents_array->GetObjNum()); contents_array_.Reset(new_contents_array); contents_stream_ = nullptr; return 1; } // If there is an array, just add the new stream to it, at the last position. if (contents_array_) { contents_array_->AppendNew<CPDF_Reference>(doc_.Get(), new_stream->GetObjNum()); return contents_array_->size() - 1; } // There were no Contents, so add the new stream as the single Content stream. // Its index is 0. CPDF_Dictionary* page_dict = obj_holder_->GetDict(); page_dict->SetNewFor<CPDF_Reference>("Contents", doc_.Get(), new_stream->GetObjNum()); contents_stream_.Reset(new_stream); return 0; } void CPDF_PageContentManager::ScheduleRemoveStreamByIndex(size_t stream_index) { streams_to_remove_.insert(stream_index); } void CPDF_PageContentManager::ExecuteScheduledRemovals() { // This method assumes there are no dirty streams in the // CPDF_PageObjectHolder. If there were any, their indexes would need to be // updated. // Since this is only called by CPDF_PageContentGenerator::GenerateContent(), // which cleans up the dirty streams first, this should always be true. DCHECK(!obj_holder_->HasDirtyStreams()); if (contents_stream_) { // Only stream that can be removed is 0. if (streams_to_remove_.find(0) != streams_to_remove_.end()) { CPDF_Dictionary* page_dict = obj_holder_->GetDict(); page_dict->RemoveFor("Contents"); contents_stream_ = nullptr; } } else if (contents_array_) { // Initialize a vector with the old stream indexes. This will be used to // build a map from the old to the new indexes. std::vector<size_t> streams_left(contents_array_->size()); std::iota(streams_left.begin(), streams_left.end(), 0); // In reverse order so as to not change the indexes in the middle of the // loop, remove the streams. for (size_t stream_index : pdfium::base::Reversed(streams_to_remove_)) { contents_array_->RemoveAt(stream_index); streams_left.erase(streams_left.begin() + stream_index); } // Create a mapping from the old to the new stream indexes, shifted due to // the deletion of the |streams_to_remove_|. std::map<size_t, size_t> stream_index_mapping; for (size_t i = 0; i < streams_left.size(); ++i) stream_index_mapping[streams_left[i]] = i; // Update the page objects' content stream indexes. for (const auto& obj : *obj_holder_) { int32_t old_stream_index = obj->GetContentStream(); int32_t new_stream_index = pdfium::base::checked_cast<int32_t>( stream_index_mapping[old_stream_index]); obj->SetContentStream(new_stream_index); } // Even if there is a single content stream now, keep the array with a // single element. It's valid, a second stream might be added soon, and the // complexity of removing it is not worth it. } streams_to_remove_.clear(); }
38.167742
80
0.709601
WarGloom
3a2d48768066e8e3b0b260fd1796dd04a796a243
774
cpp
C++
src/stp/tactics/passive/Halt.cpp
maxthielen/yml
58f5a1707f1034eb4e24c305e416def1e5cbf50b
[ "MIT" ]
16
2018-10-10T09:55:22.000Z
2021-04-26T09:58:47.000Z
src/stp/tactics/passive/Halt.cpp
maxthielen/yml
58f5a1707f1034eb4e24c305e416def1e5cbf50b
[ "MIT" ]
688
2018-09-26T11:42:21.000Z
2022-03-17T09:32:25.000Z
src/stp/tactics/passive/Halt.cpp
maxthielen/yml
58f5a1707f1034eb4e24c305e416def1e5cbf50b
[ "MIT" ]
5
2018-12-25T12:45:56.000Z
2020-09-25T07:51:02.000Z
// // Created by jessevw on 24.03.20. /// ROTATES robot to face forwards // #include "stp/tactics/passive/Halt.h" #include "stp/skills/Rotate.h" namespace rtt::ai::stp::tactic { Halt::Halt() { skills = collections::state_machine<Skill, Status, StpInfo>{skill::Rotate()}; } std::optional<StpInfo> Halt::calculateInfoForSkill(StpInfo const &info) noexcept { StpInfo skillInfo = info; skillInfo.setAngle(0.00001); return skillInfo; } bool Halt::isTacticFailing(const StpInfo &info) noexcept { return false; } bool Halt::shouldTacticReset(const StpInfo &info) noexcept { return false; } bool Halt::isEndTactic() noexcept { // This is an end tactic return true; } const char *Halt::getName() { return "Halt"; } } // namespace rtt::ai::stp::tactic
23.454545
94
0.700258
maxthielen
3a2de28a2e2afa326429e5a2042fc971ccda01d9
5,256
cc
C++
src/third_party/v8-3.25/src/checks.cc
stbrody/mongo
e6df4d48792498545a9069f08ff78f7840700ef6
[ "Apache-2.0" ]
29
2015-01-31T08:17:36.000Z
2022-03-06T04:40:57.000Z
src/third_party/v8-3.25/src/checks.cc
wujf/mongo
f2f48b749ded0c5585c798c302f6162f19336670
[ "Apache-2.0" ]
1
2015-05-29T16:12:10.000Z
2015-05-29T16:12:10.000Z
src/third_party/v8-3.25/src/checks.cc
wujf/mongo
f2f48b749ded0c5585c798c302f6162f19336670
[ "Apache-2.0" ]
12
2015-01-24T08:40:28.000Z
2017-10-04T17:23:39.000Z
// Copyright 2006-2008 the V8 project authors. All rights reserved. // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following // disclaimer in the documentation and/or other materials provided // with the distribution. // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived // from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "checks.h" #if V8_LIBC_GLIBC || V8_OS_BSD # include <cxxabi.h> # include <execinfo.h> #elif V8_OS_QNX # include <backtrace.h> #endif // V8_LIBC_GLIBC || V8_OS_BSD #include <stdio.h> #include "platform.h" #include "v8.h" namespace v8 { namespace internal { intptr_t HeapObjectTagMask() { return kHeapObjectTagMask; } // Attempts to dump a backtrace (if supported). void DumpBacktrace() { #if V8_LIBC_GLIBC || V8_OS_BSD void* trace[100]; int size = backtrace(trace, ARRAY_SIZE(trace)); char** symbols = backtrace_symbols(trace, size); OS::PrintError("\n==== C stack trace ===============================\n\n"); if (size == 0) { OS::PrintError("(empty)\n"); } else if (symbols == NULL) { OS::PrintError("(no symbols)\n"); } else { for (int i = 1; i < size; ++i) { OS::PrintError("%2d: ", i); char mangled[201]; if (sscanf(symbols[i], "%*[^(]%*[(]%200[^)+]", mangled) == 1) { // NOLINT int status; size_t length; char* demangled = abi::__cxa_demangle(mangled, NULL, &length, &status); OS::PrintError("%s\n", demangled != NULL ? demangled : mangled); free(demangled); } else { OS::PrintError("??\n"); } } } free(symbols); #elif V8_OS_QNX char out[1024]; bt_accessor_t acc; bt_memmap_t memmap; bt_init_accessor(&acc, BT_SELF); bt_load_memmap(&acc, &memmap); bt_sprn_memmap(&memmap, out, sizeof(out)); OS::PrintError(out); bt_addr_t trace[100]; int size = bt_get_backtrace(&acc, trace, ARRAY_SIZE(trace)); OS::PrintError("\n==== C stack trace ===============================\n\n"); if (size == 0) { OS::PrintError("(empty)\n"); } else { bt_sprnf_addrs(&memmap, trace, size, const_cast<char*>("%a\n"), out, sizeof(out), NULL); OS::PrintError(out); } bt_unload_memmap(&memmap); bt_release_accessor(&acc); #endif // V8_LIBC_GLIBC || V8_OS_BSD } } } // namespace v8::internal // Contains protection against recursive calls (faults while handling faults). extern "C" void V8_Fatal(const char* file, int line, const char* format, ...) { i::AllowHandleDereference allow_deref; i::AllowDeferredHandleDereference allow_deferred_deref; fflush(stdout); fflush(stderr); i::OS::PrintError("\n\n#\n# Fatal error in %s, line %d\n# ", file, line); va_list arguments; va_start(arguments, format); i::OS::VPrintError(format, arguments); va_end(arguments); i::OS::PrintError("\n#\n"); v8::internal::DumpBacktrace(); fflush(stderr); i::OS::Abort(); } void CheckEqualsHelper(const char* file, int line, const char* expected_source, v8::Handle<v8::Value> expected, const char* value_source, v8::Handle<v8::Value> value) { if (!expected->Equals(value)) { v8::String::Utf8Value value_str(value); v8::String::Utf8Value expected_str(expected); V8_Fatal(file, line, "CHECK_EQ(%s, %s) failed\n# Expected: %s\n# Found: %s", expected_source, value_source, *expected_str, *value_str); } } void CheckNonEqualsHelper(const char* file, int line, const char* unexpected_source, v8::Handle<v8::Value> unexpected, const char* value_source, v8::Handle<v8::Value> value) { if (unexpected->Equals(value)) { v8::String::Utf8Value value_str(value); V8_Fatal(file, line, "CHECK_NE(%s, %s) failed\n# Value: %s", unexpected_source, value_source, *value_str); } }
36.248276
80
0.641172
stbrody
3a307acbf76bd4a189e8c7fca568b6e6e2455c94
6,244
cpp
C++
src/detail/Testing.cpp
bgn9000/rapidcheck
593ada72f6938221973bf30bf7a7f7e6a24160de
[ "BSD-2-Clause" ]
null
null
null
src/detail/Testing.cpp
bgn9000/rapidcheck
593ada72f6938221973bf30bf7a7f7e6a24160de
[ "BSD-2-Clause" ]
null
null
null
src/detail/Testing.cpp
bgn9000/rapidcheck
593ada72f6938221973bf30bf7a7f7e6a24160de
[ "BSD-2-Clause" ]
1
2019-03-05T13:52:28.000Z
2019-03-05T13:52:28.000Z
#include "Testing.h" #include "rapidcheck/BeforeMinimalTestCase.h" #include "rapidcheck/shrinkable/Operations.h" namespace rc { namespace detail { namespace { int sizeFor(const TestParams &params, int i) { // We want sizes to be evenly spread, even when maxSuccess is not an even // multiple of the number of sizes (i.e. maxSize + 1). Another thing is that // we always want to ensure that the maximum size is actually used. const auto numSizes = params.maxSize + 1; const auto numRegular = (params.maxSuccess / numSizes) * numSizes; if (i < numRegular) { return i % numSizes; } const auto numRest = params.maxSuccess - numRegular; if (numRest == 1) { return 0; } else { return ((i % numSizes) * params.maxSize) / (numRest - 1); } } } // namespace SearchResult searchProperty(const Property &property, const TestParams &params, TestListener &listener) { SearchResult searchResult; searchResult.type = SearchResult::Type::Success; searchResult.numSuccess = 0; searchResult.numDiscarded = 0; searchResult.tags.reserve(params.maxSuccess); const auto maxDiscard = params.maxDiscardRatio * params.maxSuccess; auto recentDiscards = 0; auto r = Random(params.seed); while (searchResult.numSuccess < params.maxSuccess) { const auto size = sizeFor(params, searchResult.numSuccess) + (recentDiscards / 10); const auto random = r.split(); auto shrinkable = property(random, size); auto caseDescription = shrinkable.value(); listener.onTestCaseFinished(caseDescription); const auto &result = caseDescription.result; switch (result.type) { case CaseResult::Type::Failure: searchResult.type = SearchResult::Type::Failure; searchResult.failure = SearchResult::Failure(std::move(shrinkable), size, random); return searchResult; case CaseResult::Type::Discard: searchResult.numDiscarded++; recentDiscards++; if (searchResult.numDiscarded > maxDiscard) { searchResult.type = SearchResult::Type::GaveUp; searchResult.failure = SearchResult::Failure(std::move(shrinkable), size, random); return searchResult; } break; case CaseResult::Type::Success: searchResult.numSuccess++; recentDiscards = 0; if (!caseDescription.tags.empty()) { searchResult.tags.push_back(std::move(caseDescription.tags)); } break; } } return searchResult; } std::pair<Shrinkable<CaseDescription>, std::vector<std::size_t>> shrinkTestCase(const Shrinkable<CaseDescription> &shrinkable, TestListener &listener) { std::vector<std::size_t> path; Shrinkable<CaseDescription> best = shrinkable; auto shrinks = shrinkable.shrinks(); std::size_t i = 0; while (auto shrink = shrinks.next()) { auto caseDescription = shrink->value(); bool accept = caseDescription.result.type == CaseResult::Type::Failure; listener.onShrinkTried(caseDescription, accept); if (accept) { best = std::move(*shrink); shrinks = best.shrinks(); path.push_back(i); i = 0; } else { i++; } } return std::make_pair(std::move(best), std::move(path)); } namespace { TestResult doTestProperty(const Property &property, const TestParams &params, TestListener &listener) { const auto searchResult = searchProperty(property, params, listener); if (searchResult.type == SearchResult::Type::Success) { SuccessResult success; success.numSuccess = searchResult.numSuccess; for (const auto &tags : searchResult.tags) { success.distribution[tags]++; } return success; } else if (searchResult.type == SearchResult::Type::GaveUp) { GaveUpResult gaveUp; gaveUp.numSuccess = searchResult.numSuccess; const auto &shrinkable = searchResult.failure->shrinkable; gaveUp.description = shrinkable.value().result.description; return gaveUp; } else { // Shrink it unless shrinking is disabled const auto &shrinkable = searchResult.failure->shrinkable; auto shrinkResult = params.disableShrinking ? std::make_pair(shrinkable, std::vector<std::size_t>()) : shrinkTestCase(shrinkable, listener); // Give the developer a chance to set a breakpoint before the final minimal // test case is run beforeMinimalTestCase(); // ...and here we actually run it const auto caseDescription = shrinkResult.first.value(); FailureResult failure; failure.numSuccess = searchResult.numSuccess; failure.description = std::move(caseDescription.result.description); failure.reproduce.random = searchResult.failure->random; failure.reproduce.size = searchResult.failure->size; failure.reproduce.shrinkPath = std::move(shrinkResult.second); failure.counterExample = caseDescription.example(); return failure; } } } // namespace TestResult testProperty(const Property &property, const TestMetadata &metadata, const TestParams &params, TestListener &listener) { TestResult result = doTestProperty(property, params, listener); listener.onTestFinished(metadata, result); return result; } TestResult reproduceProperty(const Property &property, const Reproduce &reproduce) { const auto shrinkable = property(reproduce.random, reproduce.size); const auto minShrinkable = shrinkable::walkPath(shrinkable, reproduce.shrinkPath); if (!minShrinkable) { return Error("Unable to reproduce minimum value"); } // Give the developer a chance to set a breakpoint before the final minimal // test case is run beforeMinimalTestCase(); // ...and here we actually run it auto desc = minShrinkable->value(); if (desc.result.type != CaseResult::Type::Failure) { return Error("Reproduced value is not a failure"); } FailureResult failure; failure.numSuccess = 0; failure.description = std::move(desc.result.description); failure.reproduce = reproduce; failure.counterExample = desc.example(); return failure; } } // namespace detail } // namespace rc
32.520833
79
0.679693
bgn9000
3a359443aef92d044f2e2c17a2fdcdb2726fa5de
10,708
cpp
C++
MonoNative/mscorlib/System/Globalization/mscorlib_System_Globalization_IdnMapping.cpp
brunolauze/MonoNative
959fb52c2c1ffe87476ab0d6e4fcce0ad9ce1e66
[ "BSD-2-Clause" ]
7
2015-03-10T03:36:16.000Z
2021-11-05T01:16:58.000Z
MonoNative/mscorlib/System/Globalization/mscorlib_System_Globalization_IdnMapping.cpp
brunolauze/MonoNative
959fb52c2c1ffe87476ab0d6e4fcce0ad9ce1e66
[ "BSD-2-Clause" ]
1
2020-06-23T10:02:33.000Z
2020-06-24T02:05:47.000Z
MonoNative/mscorlib/System/Globalization/mscorlib_System_Globalization_IdnMapping.cpp
brunolauze/MonoNative
959fb52c2c1ffe87476ab0d6e4fcce0ad9ce1e66
[ "BSD-2-Clause" ]
null
null
null
#include <mscorlib/System/Globalization/mscorlib_System_Globalization_IdnMapping.h> #include <mscorlib/System/mscorlib_System_String.h> #include <mscorlib/System/mscorlib_System_Type.h> namespace mscorlib { namespace System { namespace Globalization { //Public Methods mscorlib::System::Boolean IdnMapping::Equals(mscorlib::System::Object obj) { MonoType *__parameter_types__[1]; void *__parameters__[1]; __parameter_types__[0] = Global::GetType(typeid(obj).name()); __parameters__[0] = (MonoObject*)obj; MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.Globalization", "IdnMapping", 0, NULL, "Equals", __native_object__, 1, __parameter_types__, __parameters__, NULL); return *(mscorlib::System::Boolean*)mono_object_unbox(__result__); } mscorlib::System::Int32 IdnMapping::GetHashCode() { MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.Globalization", "IdnMapping", 0, NULL, "GetHashCode", __native_object__, 0, NULL, NULL, NULL); return *(mscorlib::System::Int32*)mono_object_unbox(__result__); } mscorlib::System::String IdnMapping::GetAscii(mscorlib::System::String unicode) { MonoType *__parameter_types__[1]; void *__parameters__[1]; __parameter_types__[0] = Global::GetType(typeid(unicode).name()); __parameters__[0] = (MonoObject*)unicode; MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.Globalization", "IdnMapping", 0, NULL, "GetAscii", __native_object__, 1, __parameter_types__, __parameters__, NULL); return mscorlib::System::String(__result__); } mscorlib::System::String IdnMapping::GetAscii(const char *unicode) { MonoType *__parameter_types__[1]; void *__parameters__[1]; __parameter_types__[0] = Global::GetType("mscorlib", "System", "String"); __parameters__[0] = mono_string_new(Global::GetDomain(), unicode); MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.Globalization", "IdnMapping", 0, NULL, "GetAscii", __native_object__, 1, __parameter_types__, __parameters__, NULL); return mscorlib::System::String(__result__); } mscorlib::System::String IdnMapping::GetAscii(mscorlib::System::String unicode, mscorlib::System::Int32 index) { MonoType *__parameter_types__[2]; void *__parameters__[2]; __parameter_types__[0] = Global::GetType(typeid(unicode).name()); __parameter_types__[1] = Global::GetType(typeid(index).name()); __parameters__[0] = (MonoObject*)unicode; __parameters__[1] = &index; MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.Globalization", "IdnMapping", 0, NULL, "GetAscii", __native_object__, 2, __parameter_types__, __parameters__, NULL); return mscorlib::System::String(__result__); } mscorlib::System::String IdnMapping::GetAscii(const char *unicode, mscorlib::System::Int32 index) { MonoType *__parameter_types__[2]; void *__parameters__[2]; __parameter_types__[0] = Global::GetType("mscorlib", "System", "String"); __parameter_types__[1] = Global::GetType(typeid(index).name()); __parameters__[0] = mono_string_new(Global::GetDomain(), unicode); __parameters__[1] = &index; MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.Globalization", "IdnMapping", 0, NULL, "GetAscii", __native_object__, 2, __parameter_types__, __parameters__, NULL); return mscorlib::System::String(__result__); } mscorlib::System::String IdnMapping::GetAscii(mscorlib::System::String unicode, mscorlib::System::Int32 index, mscorlib::System::Int32 count) { MonoType *__parameter_types__[3]; void *__parameters__[3]; __parameter_types__[0] = Global::GetType(typeid(unicode).name()); __parameter_types__[1] = Global::GetType(typeid(index).name()); __parameter_types__[2] = Global::GetType(typeid(count).name()); __parameters__[0] = (MonoObject*)unicode; __parameters__[1] = &index; __parameters__[2] = &count; MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.Globalization", "IdnMapping", 0, NULL, "GetAscii", __native_object__, 3, __parameter_types__, __parameters__, NULL); return mscorlib::System::String(__result__); } mscorlib::System::String IdnMapping::GetAscii(const char *unicode, mscorlib::System::Int32 index, mscorlib::System::Int32 count) { MonoType *__parameter_types__[3]; void *__parameters__[3]; __parameter_types__[0] = Global::GetType("mscorlib", "System", "String"); __parameter_types__[1] = Global::GetType(typeid(index).name()); __parameter_types__[2] = Global::GetType(typeid(count).name()); __parameters__[0] = mono_string_new(Global::GetDomain(), unicode); __parameters__[1] = &index; __parameters__[2] = &count; MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.Globalization", "IdnMapping", 0, NULL, "GetAscii", __native_object__, 3, __parameter_types__, __parameters__, NULL); return mscorlib::System::String(__result__); } mscorlib::System::String IdnMapping::GetUnicode(mscorlib::System::String ascii) { MonoType *__parameter_types__[1]; void *__parameters__[1]; __parameter_types__[0] = Global::GetType(typeid(ascii).name()); __parameters__[0] = (MonoObject*)ascii; MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.Globalization", "IdnMapping", 0, NULL, "GetUnicode", __native_object__, 1, __parameter_types__, __parameters__, NULL); return mscorlib::System::String(__result__); } mscorlib::System::String IdnMapping::GetUnicode(const char *ascii) { MonoType *__parameter_types__[1]; void *__parameters__[1]; __parameter_types__[0] = Global::GetType("mscorlib", "System", "String"); __parameters__[0] = mono_string_new(Global::GetDomain(), ascii); MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.Globalization", "IdnMapping", 0, NULL, "GetUnicode", __native_object__, 1, __parameter_types__, __parameters__, NULL); return mscorlib::System::String(__result__); } mscorlib::System::String IdnMapping::GetUnicode(mscorlib::System::String ascii, mscorlib::System::Int32 index) { MonoType *__parameter_types__[2]; void *__parameters__[2]; __parameter_types__[0] = Global::GetType(typeid(ascii).name()); __parameter_types__[1] = Global::GetType(typeid(index).name()); __parameters__[0] = (MonoObject*)ascii; __parameters__[1] = &index; MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.Globalization", "IdnMapping", 0, NULL, "GetUnicode", __native_object__, 2, __parameter_types__, __parameters__, NULL); return mscorlib::System::String(__result__); } mscorlib::System::String IdnMapping::GetUnicode(const char *ascii, mscorlib::System::Int32 index) { MonoType *__parameter_types__[2]; void *__parameters__[2]; __parameter_types__[0] = Global::GetType("mscorlib", "System", "String"); __parameter_types__[1] = Global::GetType(typeid(index).name()); __parameters__[0] = mono_string_new(Global::GetDomain(), ascii); __parameters__[1] = &index; MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.Globalization", "IdnMapping", 0, NULL, "GetUnicode", __native_object__, 2, __parameter_types__, __parameters__, NULL); return mscorlib::System::String(__result__); } mscorlib::System::String IdnMapping::GetUnicode(mscorlib::System::String ascii, mscorlib::System::Int32 index, mscorlib::System::Int32 count) { MonoType *__parameter_types__[3]; void *__parameters__[3]; __parameter_types__[0] = Global::GetType(typeid(ascii).name()); __parameter_types__[1] = Global::GetType(typeid(index).name()); __parameter_types__[2] = Global::GetType(typeid(count).name()); __parameters__[0] = (MonoObject*)ascii; __parameters__[1] = &index; __parameters__[2] = &count; MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.Globalization", "IdnMapping", 0, NULL, "GetUnicode", __native_object__, 3, __parameter_types__, __parameters__, NULL); return mscorlib::System::String(__result__); } mscorlib::System::String IdnMapping::GetUnicode(const char *ascii, mscorlib::System::Int32 index, mscorlib::System::Int32 count) { MonoType *__parameter_types__[3]; void *__parameters__[3]; __parameter_types__[0] = Global::GetType("mscorlib", "System", "String"); __parameter_types__[1] = Global::GetType(typeid(index).name()); __parameter_types__[2] = Global::GetType(typeid(count).name()); __parameters__[0] = mono_string_new(Global::GetDomain(), ascii); __parameters__[1] = &index; __parameters__[2] = &count; MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.Globalization", "IdnMapping", 0, NULL, "GetUnicode", __native_object__, 3, __parameter_types__, __parameters__, NULL); return mscorlib::System::String(__result__); } //Get Set Properties Methods // Get/Set:AllowUnassigned mscorlib::System::Boolean IdnMapping::get_AllowUnassigned() const { MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.Globalization", "IdnMapping", 0, NULL, "get_AllowUnassigned", __native_object__, 0, NULL, NULL, NULL); return *(mscorlib::System::Boolean*)mono_object_unbox(__result__); } void IdnMapping::set_AllowUnassigned(mscorlib::System::Boolean value) { MonoType *__parameter_types__[1]; void *__parameters__[1]; __parameter_types__[0] = Global::GetType(typeid(value).name()); __parameters__[0] = reinterpret_cast<void*>(value); Global::InvokeMethod("mscorlib", "System.Globalization", "IdnMapping", 0, NULL, "set_AllowUnassigned", __native_object__, 1, __parameter_types__, __parameters__, NULL); } // Get/Set:UseStd3AsciiRules mscorlib::System::Boolean IdnMapping::get_UseStd3AsciiRules() const { MonoObject *__result__ = Global::InvokeMethod("mscorlib", "System.Globalization", "IdnMapping", 0, NULL, "get_UseStd3AsciiRules", __native_object__, 0, NULL, NULL, NULL); return *(mscorlib::System::Boolean*)mono_object_unbox(__result__); } void IdnMapping::set_UseStd3AsciiRules(mscorlib::System::Boolean value) { MonoType *__parameter_types__[1]; void *__parameters__[1]; __parameter_types__[0] = Global::GetType(typeid(value).name()); __parameters__[0] = reinterpret_cast<void*>(value); Global::InvokeMethod("mscorlib", "System.Globalization", "IdnMapping", 0, NULL, "set_UseStd3AsciiRules", __native_object__, 1, __parameter_types__, __parameters__, NULL); } } } }
50.037383
189
0.716287
brunolauze
3a36f2586e4c69b6430af41dcf65449445ac5975
5,021
cpp
C++
src/onthepitch/player/playerbase.cpp
alexhuntley/GameplayFootball
67a3c123e31384b757b1d223c53acf9f7fcb8b41
[ "Apache-2.0" ]
56
2020-07-22T22:11:06.000Z
2022-03-09T08:11:43.000Z
GameplayFootball/src/onthepitch/player/playerbase.cpp
ElsevierSoftwareX/SOFTX-D-20-00016
48c28adb72aa167a251636bc92111b3c43c0be67
[ "MIT" ]
9
2021-04-22T07:06:25.000Z
2022-01-22T12:54:52.000Z
GameplayFootball/src/onthepitch/player/playerbase.cpp
ElsevierSoftwareX/SOFTX-D-20-00016
48c28adb72aa167a251636bc92111b3c43c0be67
[ "MIT" ]
18
2020-10-15T08:11:07.000Z
2022-03-23T14:49:46.000Z
// written by bastiaan konings schuiling 2008 - 2015 // this work is public domain. the code is undocumented, scruffy, untested, and should generally not be used for anything important. // i do not offer support, so don't ask. to be used for inspiration :) #include "player.hpp" #include "../match.hpp" #include "controller/elizacontroller.hpp" #include "controller/strategies/strategy.hpp" #include "../../main.hpp" #include "../../utils.hpp" #include "base/geometry/triangle.hpp" int PlayerBase::playerCount = 0; PlayerBase::PlayerBase(Match *match, PlayerData *playerData) : match(match), playerData(playerData), id(playerCount++), humanoid(0), controller(0), externalController(0), isActive(false) { debug = false; lastTouchTime_ms = 0; lastTouchType = e_TouchType_None; fatigueFactorInv = 1.0; confidenceFactor = 1.0; averageStat = GetStat("physical_balance") + GetStat("physical_reaction") + GetStat("physical_acceleration") + GetStat("physical_velocity") + GetStat("physical_stamina") + GetStat("physical_agility") + GetStat("physical_shotpower") + GetStat("technical_standingtackle") + GetStat("technical_slidingtackle") + GetStat("technical_ballcontrol") + GetStat("technical_dribble") + GetStat("technical_shortpass") + GetStat("technical_highpass") + GetStat("technical_header") + GetStat("technical_shot") + GetStat("technical_volley") + GetStat("mental_calmness") + GetStat("mental_workrate") + GetStat("mental_resilience") + GetStat("mental_defensivepositioning") + GetStat("mental_offensivepositioning") + GetStat("mental_vision"); averageStat /= 22.0; //if (Verbose()) printf("player '%s' has an average stat of %f\n", playerData->GetLastName().c_str(), averageStat); Log(e_Notice, "PlayerBase", "PlayerBase", "player '" + playerData->GetLastName() + "' has an average stat of " + real_to_str(averageStat)); } PlayerBase::~PlayerBase() { if (Verbose()) printf("exiting playerbase.. "); if (isActive) Deactivate(); if (Verbose()) printf("deleting humanoid.. "); if (humanoid) delete humanoid; if (Verbose()) printf("done\n"); } void PlayerBase::Deactivate() { ResetSituation(GetPosition()); isActive = false; if (humanoid) humanoid->Hide(); if (externalController) externalController = 0; delete controller; } IController *PlayerBase::GetController() { if (externalController) return externalController; else return controller; } void PlayerBase::RequestCommand(PlayerCommandQueue &commandQueue) { if (externalController) externalController->RequestCommand(commandQueue); else controller->RequestCommand(commandQueue); } void PlayerBase::SetExternalController(IController *externalController) { this->externalController = externalController; if (this->externalController) { this->externalController->Reset(); this->externalController->SetPlayer(this); this->externalController->SetFallbackController(controller); //debug = true; } else { controller->Reset(); //debug = false; } } void PlayerBase::SetDebug(bool state) { debug = state; } bool PlayerBase::GetDebug() const { if (IsReleaseVersion()) return false; else return debug; } void PlayerBase::Process() { if (isActive) { if (externalController) externalController->Process(); else controller->Process(); humanoid->Process(); } else { if (humanoid) humanoid->Hide(); } //if (debug) printf("::%f velo\n", GetMovement().GetLength()); } void PlayerBase::PreparePutBuffers(unsigned long snapshotTime_ms) { humanoid->PreparePutBuffers(snapshotTime_ms); } void PlayerBase::FetchPutBuffers(unsigned long putTime_ms) { humanoid->FetchPutBuffers(putTime_ms); } void PlayerBase::Put() { humanoid->Put(); } float PlayerBase::GetStat(const char *name) const { return playerData->GetStat(name); } float PlayerBase::GetMaxVelocity() const { // see humanoidbase's physics function return sprintVelocity * GetVelocityMultiplier(); } float PlayerBase::GetVelocityMultiplier() const { // see humanoid_utils' physics function return 0.9f + GetStat("physical_velocity") * 0.1f; } float PlayerBase::GetLastTouchBias(int decay_ms, unsigned long time_ms) { unsigned long adaptedTime_ms = time_ms; if (time_ms == 0) adaptedTime_ms = match->GetActualTime_ms(); if (decay_ms > 0) return 1.0f - clamp((adaptedTime_ms - GetLastTouchTime_ms()) / (float)decay_ms, 0.0f, 1.0f); return 0.0f; } void PlayerBase::ResetSituation(const Vector3 &focusPos) { positionHistoryPerSecond.clear(); lastTouchTime_ms = 0; lastTouchType = e_TouchType_None; if (IsActive()) humanoid->ResetSituation(focusPos); if (GetController()) GetController()->Reset(); }
32.393548
188
0.678749
alexhuntley
3a37280be2819c3b911a1cb0c6d36b1840eb1bd7
1,266
hpp
C++
libs/tl/tl/containers/array.hpp
tuket/reproject
8f93f93904be550941c008ea023cd707838520ff
[ "MIT" ]
null
null
null
libs/tl/tl/containers/array.hpp
tuket/reproject
8f93f93904be550941c008ea023cd707838520ff
[ "MIT" ]
null
null
null
libs/tl/tl/containers/array.hpp
tuket/reproject
8f93f93904be550941c008ea023cd707838520ff
[ "MIT" ]
null
null
null
#pragma once #include <tl/int_types.hpp> #include <initializer_list> #include <assert.h> namespace tl { template<typename T, size_t N> class Array { public: static constexpr size_t s_size = N; typedef T ElemTypes; typedef const T* ConstIterator; typedef T* Iterator; constexpr size_t size()const{ return N; } T* data() { return _a; } const T* data()const { return _a; } const T& operator[](size_t i)const{ return _a[i]; } T& operator[](size_t i){ return _a[i]; } Iterator begin(){ return &_a[0]; } ConstIterator begin()const { return &_a[0]; } ConstIterator cbegin()const { return &_a[0]; } Iterator end() { return &_a[N]; } ConstIterator end()const { return &_a[N]; } ConstIterator cend()const { return &_a[N]; } bool operator==(const Array& o); bool operator<(const Array& o); public: T _a[N]; }; template <typename T, size_t N> bool Array<T, N>::operator==(const Array& o) { for(size_t i=0; i<N; i++) { if(_a[i] != o._a[i]) return false; } return true; } template <typename T, size_t N> bool Array<T, N>::operator<(const Array& o) { for(size_t i=0; i<N; i++) { if(_a[i] < o._a[i]) return false; } return true; } }
20.095238
55
0.594787
tuket
3a389e08c6abd56436e6ea987651dfcac6b97292
1,096
cpp
C++
11195.cpp
michaelarakel/uva-solutions
b91f4c40970200c29db6bda5822bc89ccda1a977
[ "Unlicense" ]
null
null
null
11195.cpp
michaelarakel/uva-solutions
b91f4c40970200c29db6bda5822bc89ccda1a977
[ "Unlicense" ]
null
null
null
11195.cpp
michaelarakel/uva-solutions
b91f4c40970200c29db6bda5822bc89ccda1a977
[ "Unlicense" ]
null
null
null
#include <iostream> #include <fstream> #include <vector> using namespace std; int counter; const int maxn = 15; bool col[maxn], diag1[2 * maxn - 1], diag2[2 * maxn - 1]; char v[maxn][maxn]; void sol (int Qnum, int n) { if (Qnum == n) { ++counter; return; } int i = Qnum; for (int j = 0; j < n; j++) { int diag1Def = i - j + n - 1, diag2Def = i + j; if (v[i][j] != '*' && col[j] && diag1[diag1Def] && diag2[diag2Def]) { v[i][j] = '*'; col[j] = diag1[diag1Def] = diag2[diag2Def] = false; sol(Qnum + 1, n); v[i][j] = '.'; col[j] = diag1[diag1Def] = diag2[diag2Def] = true; } } return; } void nextit (int n, int itnum) { for (int i = 0; i < n; i++) { col[i] = true; for (int j = 0; j < n; j++) cin >> v[i][j]; } for (int i = 0; i < 2 * n - 1; ++i) diag1[i] = diag2[i] = true; counter = 0; int Qnum = 0; sol(Qnum, n); cout << "Case " << itnum << ": " << counter << endl; } int main () { int n, itnum = 1; cin >> n; while (n != 0) { nextit(n, itnum); cin >> n; ++itnum; } }
17.967213
70
0.474453
michaelarakel
3a3b4342021435ef567dc0ea843cb9bfee2eefef
61
cpp
C++
source/materials/Lambertian.cpp
zhanghao00925/CG-Path_Tracing-Algorithm
12bd6d7334051aa2bb0544dd26bfe4ad13ec5560
[ "MIT" ]
3
2020-04-05T13:09:17.000Z
2021-03-16T10:56:17.000Z
source/materials/Lambertian.cpp
zhanghao00925/CG-Path_Tracing-Algorithm
12bd6d7334051aa2bb0544dd26bfe4ad13ec5560
[ "MIT" ]
null
null
null
source/materials/Lambertian.cpp
zhanghao00925/CG-Path_Tracing-Algorithm
12bd6d7334051aa2bb0544dd26bfe4ad13ec5560
[ "MIT" ]
1
2020-02-19T02:59:44.000Z
2020-02-19T02:59:44.000Z
// // Created by hao on 2/27/19. // #include "Lambertian.h"
10.166667
29
0.606557
zhanghao00925
3a3c2f709fe302b70818aec8d117c149c2c78e40
849
hpp
C++
cbir/f2d_descriptor.hpp
stereomatchingkiss/ocv_libs
1424ac2f8a2c034513483b3050d8138ca0a0ae3f
[ "FSFAP" ]
18
2015-12-17T05:28:37.000Z
2021-05-21T02:59:29.000Z
cbir/f2d_descriptor.hpp
stereomatchingkiss/ocv_libs
1424ac2f8a2c034513483b3050d8138ca0a0ae3f
[ "FSFAP" ]
null
null
null
cbir/f2d_descriptor.hpp
stereomatchingkiss/ocv_libs
1424ac2f8a2c034513483b3050d8138ca0a0ae3f
[ "FSFAP" ]
8
2017-05-10T11:20:13.000Z
2021-06-19T17:06:06.000Z
#ifndef OCV_CBIR_F2D_DETECTOR_H #define OCV_CBIR_F2D_DETECTOR_H #include <opencv2/core.hpp> #include <opencv2/features2d.hpp> #include <vector> /*! * \addtogroup ocv * @{ */ namespace ocv{ /*! * \addtogroup cbir * @{ */ namespace cbir{ class f2d_detector { public: using result_type = std::pair<std::vector<cv::KeyPoint>, cv::Mat>; explicit f2d_detector(cv::Ptr<cv::FeatureDetector> detector, cv::Ptr<cv::DescriptorExtractor> extractor); void get_descriptor(cv::Mat const &input, result_type &output); result_type get_descriptor(cv::Mat const &input); private: cv::Ptr<cv::FeatureDetector> detector_; cv::Ptr<cv::DescriptorExtractor> extractor_; }; } /*! @} End of Doxygen Groups*/ } /*! @} End of Doxygen Groups*/ #endif // OCV_CBIR_F2D_DETECTOR_H
18.866667
70
0.652532
stereomatchingkiss
3a3d6d492d0370c3705873e3aaad9a9a94e1cff1
1,482
hh
C++
src/semantic/Scope.hh
walecome/seal
204b2dbad9f0bf3ac77f5e32173de39ef1fb81c1
[ "MIT" ]
1
2020-01-06T09:43:56.000Z
2020-01-06T09:43:56.000Z
src/semantic/Scope.hh
walecome/seal
204b2dbad9f0bf3ac77f5e32173de39ef1fb81c1
[ "MIT" ]
null
null
null
src/semantic/Scope.hh
walecome/seal
204b2dbad9f0bf3ac77f5e32173de39ef1fb81c1
[ "MIT" ]
null
null
null
#pragma once #include <cassert> #include <string> #include <unordered_map> #include "Constants.hh" #include "Error.hh" class FunctionDecl; class VariableDecl; struct Scope; static FunctionDecl *get_context(Scope *, FunctionDecl *); struct Scope { Scope(Scope *parent = nullptr, FunctionDecl *context = nullptr) : parent { parent }, context { get_context(parent, context) } {} // Silence compile warnings until we actually need them Scope(const Scope &) = delete; bool operator=(const Scope &) = delete; void add_function(FunctionDecl *const function_declaration); void add_variable(VariableDecl *const variable_declaration); bool has_function(const std::string_view identifier, bool traverse_parent) const; bool has_variable(const std::string_view identifier, bool traverse_parent) const; FunctionDecl *get_function(const std::string_view identifier) const; VariableDecl *get_variable(const std::string_view identifier) const; unsigned function_count() const; bool is_top_level() const; std::unordered_map<std::string_view, VariableDecl *const> variables {}; std::unordered_map<std::string_view, FunctionDecl *const> functions {}; Scope *const parent; FunctionDecl *const context; }; static FunctionDecl *get_context(Scope *parent, FunctionDecl *context) { if (context) return context; if (parent) return parent->context; return nullptr; }
29.058824
75
0.7139
walecome
3a3d85281ac19d495973da02fc33971c8576dd1e
1,076
cpp
C++
codeforce1/143C. Help Farmer.cpp
khaled-farouk/My_problem_solving_solutions
46ed6481fc9b424d0714bc717cd0ba050a6638ef
[ "MIT" ]
null
null
null
codeforce1/143C. Help Farmer.cpp
khaled-farouk/My_problem_solving_solutions
46ed6481fc9b424d0714bc717cd0ba050a6638ef
[ "MIT" ]
null
null
null
codeforce1/143C. Help Farmer.cpp
khaled-farouk/My_problem_solving_solutions
46ed6481fc9b424d0714bc717cd0ba050a6638ef
[ "MIT" ]
null
null
null
/* Idea: - Brute force. - Try any 3 combination of divisors of `n` to construct A, B and C. */ #include <bits/stdc++.h> using namespace std; long long n; vector<long long> d; void divisors(long long x) { d.clear(); int sqrtx = sqrt(x); for(int i = 1; i <= sqrtx + 1; ++i) if(x % i == 0) { d.push_back(i); if(x / i != i) d.push_back(x / i); } sort(d.begin(), d.end()); } int main() { cin >> n; divisors(n); long long mn = 2e18, mx = -2e18; for(int i = 0; i < d.size(); ++i) for(int j = i; j < d.size(); ++j) if(n % (d[i] * d[j]) == 0) { long long k = n / (d[i] * d[j]); mn = min(mn, (d[i] + 1) * (d[j] + 2) * (k + 2) - n); mx = max(mx, (d[i] + 1) * (d[j] + 2) * (k + 2) - n); mn = min(mn, (d[i] + 2) * (d[j] + 1) * (k + 2) - n); mx = max(mx, (d[i] + 2) * (d[j] + 1) * (k + 2) - n); mn = min(mn, (d[i] + 2) * (d[j] + 2) * (k + 1) - n); mx = max(mx, (d[i] + 2) * (d[j] + 2) * (k + 1) - n); } cout << mn << ' ' << mx << endl; return 0; }
21.098039
71
0.398699
khaled-farouk
3a437a8590195242701d215fa2dfda5de27fa5b1
1,337
cpp
C++
ql/time/daycounters/thirty365.cpp
urgu00/QuantLib
fecce0abb0ff3d50da29c129f8f9e73176e20ab9
[ "BSD-3-Clause" ]
3,358
2015-12-18T02:56:17.000Z
2022-03-31T02:42:47.000Z
ql/time/daycounters/thirty365.cpp
urgu00/QuantLib
fecce0abb0ff3d50da29c129f8f9e73176e20ab9
[ "BSD-3-Clause" ]
965
2015-12-21T10:35:28.000Z
2022-03-30T02:47:00.000Z
ql/time/daycounters/thirty365.cpp
urgu00/QuantLib
fecce0abb0ff3d50da29c129f8f9e73176e20ab9
[ "BSD-3-Clause" ]
1,663
2015-12-17T17:45:38.000Z
2022-03-31T07:58:29.000Z
/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* Copyright (C) 2015 StatPro Italia srl This file is part of QuantLib, a free-software/open-source library for financial quantitative analysts and developers - http://quantlib.org/ QuantLib is free software: you can redistribute it and/or modify it under the terms of the QuantLib license. You should have received a copy of the license along with this program; if not, please email <quantlib-dev@lists.sf.net>. The license is also available online at <http://quantlib.org/license.shtml>. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the license for more details. */ #include <ql/time/daycounters/thirty365.hpp> namespace QuantLib { Date::serial_type Thirty365::Impl::dayCount(const Date& d1, const Date& d2) const { Day dd1 = d1.dayOfMonth(), dd2 = d2.dayOfMonth(); Integer mm1 = d1.month(), mm2 = d2.month(); Year yy1 = d1.year(), yy2 = d2.year(); return 360*(yy2-yy1) + 30*(mm2-mm1) + (dd2-dd1); } Thirty365::Thirty365() : DayCounter(ext::shared_ptr<DayCounter::Impl>(new Thirty365::Impl)) {} }
36.135135
79
0.676141
urgu00
3a440ec6e6a0cd1f2bd3726de847c341647e1c28
2,168
cpp
C++
test/test1.cpp
mithun218/GiNaCDE
8dae46abf589bfa9056a10bb4e6b5a46172996cf
[ "MIT" ]
1
2021-11-22T01:09:10.000Z
2021-11-22T01:09:10.000Z
test/test1.cpp
mithun218/GiNaCDE
8dae46abf589bfa9056a10bb4e6b5a46172996cf
[ "MIT" ]
19
2021-11-08T10:02:51.000Z
2022-02-04T10:36:15.000Z
test/test1.cpp
mithun218/GiNaCDE
8dae46abf589bfa9056a10bb4e6b5a46172996cf
[ "MIT" ]
1
2021-11-10T09:53:18.000Z
2021-11-10T09:53:18.000Z
/** @file test1.cpp * * Program to test GiNaCDE library. This solve following odes i. linear ode - the damped harmonic oscillator. ii. nonlinear ode - modified Painlev-Ince equation */ #include "GiNaCDE.h" int main() { const ex u=reader("u"),x=reader("x"),a=reader("a"),b=reader("b"), c=reader("c"),w=reader("w"),A_0=reader("A_0"),A_1=reader("A_1"),A_2=reader("A_2"); ex ode,res; size_t solu_num1,solu_num2; stringstream diffStr,algSoluStr,diffSoluStr; string str; depend(u, {x}); twcPhase = lst{lst{},lst{}}; ode = Diff(u,x,2) + Diff(u,x,1) + w*w*u; // the damped harmonic oscillator output = ginac;// Outputs are saved in ginac format; filename = "damped_FIM.txt"; desolve(ode,{u},FIM,true); /* Checking all solutions*/ diffStr.str(""); diffStr<<ode; solu_num1 = (solutionClt).size(); for(size_t i=0;i<solu_num1;i++) { algSoluStr.str(""); algSoluStr<<solutionClt[i][0]; solu_num2 = nops(solutionClt[i]); for(size_t j=1;j<solu_num2;j++) { diffSoluStr.str(""); diffSoluStr<<solutionClt[i][j]; res = checkSolu(diffStr.str(),diffSoluStr.str(),algSoluStr.str()); if(res!=_ex0) return -1; } } ode = Diff(u,x,2) + a*u*Diff(u,x,1) + b*u*u*u; // modified Painlev-Ince equation output = ginac; filename = "Painlev_FIMextravar.txt"; paraInDiffSolve = lst{a,b}; desolve(ode,{u},FIM,true); /* Checking all solutions*/ diffStr.str(""); diffStr<<ode; solu_num1 = (solutionClt).size(); for(size_t i=0;i<solu_num1;i++) { algSoluStr.str(""); algSoluStr<<solutionClt[i][0]; solu_num2 = nops(solutionClt[i]); for(size_t j=1;j<solu_num2;j++) { diffSoluStr.str(""); diffSoluStr<<solutionClt[i][j]; res = checkSolu(diffStr.str(),diffSoluStr.str(),algSoluStr.str()); if(res!=_ex0) return -1; } } return 0; }
27.1
96
0.536439
mithun218
3a450cce383110cc96872beee9404707f25c3ca1
1,043
cpp
C++
Geeks For Geeks Solutions/HashMap/Union of two arrays.cpp
bilwa496/Placement-Preparation
bd32ee717f671d95c17f524ed28b0179e0feb044
[ "MIT" ]
169
2021-05-30T10:02:19.000Z
2022-03-27T18:09:32.000Z
Geeks For Geeks Solutions/HashMap/Union of two arrays.cpp
bilwa496/Placement-Preparation
bd32ee717f671d95c17f524ed28b0179e0feb044
[ "MIT" ]
1
2021-10-02T14:46:26.000Z
2021-10-02T14:46:26.000Z
Geeks For Geeks Solutions/HashMap/Union of two arrays.cpp
bilwa496/Placement-Preparation
bd32ee717f671d95c17f524ed28b0179e0feb044
[ "MIT" ]
44
2021-05-30T19:56:29.000Z
2022-03-17T14:49:00.000Z
//Initial template for C++ #include <bits/stdc++.h> using namespace std; // } Driver Code Ends //User function template in C++ class Solution{ public: //Function to return the count of number of elements in union of two arrays. int doUnion(int a[], int n, int b[], int m) { unordered_map<int,int> mp; int count=0; for(int i=0;i<n;i++) { if(mp[a[i]]!=1) { mp[a[i]]++; } } for(int i=0;i<m;i++) { if(mp[b[i]]!=1) { mp[b[i]]++; } } return mp.size(); } }; // { Driver Code Starts. int main() { int t; cin >> t; while(t--){ int n, m; cin >> n >> m; int a[n], b[m]; for(int i = 0;i<n;i++) cin >> a[i]; for(int i = 0;i<m;i++) cin >> b[i]; Solution ob; cout << ob.doUnion(a, n, b, m) << endl; } return 0; } // } Driver Code Ends
16.555556
80
0.400767
bilwa496
3a4ef8ea9a4a81fc72a15f8fcf13d2be9a659e90
744
cpp
C++
ares/sfc/coprocessor/spc7110/serialization.cpp
CasualPokePlayer/ares
58690cd5fc7bb6566c22935c5b80504a158cca29
[ "BSD-3-Clause" ]
153
2020-07-25T17:55:29.000Z
2021-10-01T23:45:01.000Z
ares/sfc/coprocessor/spc7110/serialization.cpp
CasualPokePlayer/ares
58690cd5fc7bb6566c22935c5b80504a158cca29
[ "BSD-3-Clause" ]
245
2021-10-08T09:14:46.000Z
2022-03-31T08:53:13.000Z
ares/sfc/coprocessor/spc7110/serialization.cpp
CasualPokePlayer/ares
58690cd5fc7bb6566c22935c5b80504a158cca29
[ "BSD-3-Clause" ]
44
2020-07-25T08:51:55.000Z
2021-09-25T16:09:01.000Z
auto SPC7110::serialize(serializer& s) -> void { Thread::serialize(s); s(ram); s(r4801); s(r4802); s(r4803); s(r4804); s(r4805); s(r4806); s(r4807); s(r4809); s(r480a); s(r480b); s(r480c); s(dcuPending); s(dcuMode); s(dcuAddress); s(dcuOffset); s(dcuTile); if(decompressor) s(*decompressor); s(r4810); s(r4811); s(r4812); s(r4813); s(r4814); s(r4815); s(r4816); s(r4817); s(r4818); s(r481a); s(r4820); s(r4821); s(r4822); s(r4823); s(r4824); s(r4825); s(r4826); s(r4827); s(r4828); s(r4829); s(r482a); s(r482b); s(r482c); s(r482d); s(r482e); s(r482f); s(mulPending); s(divPending); s(r4830); s(r4831); s(r4832); s(r4833); s(r4834); }
12.196721
48
0.543011
CasualPokePlayer
3a50d2f3bc544022ad0983f8063b399920b2a825
8,527
cc
C++
src/zg/extrapolation.cc
arnabSur/tchecker
24ba7703068a41c6e9c613b4ef80ad6c788e65bc
[ "MIT" ]
7
2019-08-12T12:22:07.000Z
2021-11-18T01:48:27.000Z
src/zg/extrapolation.cc
arnabSur/tchecker
24ba7703068a41c6e9c613b4ef80ad6c788e65bc
[ "MIT" ]
40
2019-07-03T04:31:19.000Z
2022-03-31T03:40:43.000Z
src/zg/extrapolation.cc
arnabSur/tchecker
24ba7703068a41c6e9c613b4ef80ad6c788e65bc
[ "MIT" ]
8
2019-07-04T06:40:49.000Z
2021-12-03T15:51:50.000Z
/* * This file is a part of the TChecker project. * * See files AUTHORS and LICENSE for copyright details. * */ #include "tchecker/zg/extrapolation.hh" #include "tchecker/clockbounds/solver.hh" namespace tchecker { namespace zg { /* no_extrapolation_t */ void no_extrapolation_t::extrapolate(tchecker::dbm::db_t * dbm, tchecker::clock_id_t dim, tchecker::vloc_t const & vloc) {} /* global_lu_extrapolation_t */ namespace details { global_lu_extrapolation_t::global_lu_extrapolation_t( std::shared_ptr<tchecker::clockbounds::global_lu_map_t const> const & clock_bounds) : _clock_bounds(clock_bounds) { } } // end of namespace details /* global_extra_lu_t */ void global_extra_lu_t::extrapolate(tchecker::dbm::db_t * dbm, tchecker::clock_id_t dim, tchecker::vloc_t const & vloc) { assert(dim == _clock_bounds->clock_number() + 1); tchecker::dbm::extra_lu(dbm, dim, _clock_bounds->L().ptr(), _clock_bounds->U().ptr()); } /* global_extra_lu_plus_t */ void global_extra_lu_plus_t::extrapolate(tchecker::dbm::db_t * dbm, tchecker::clock_id_t dim, tchecker::vloc_t const & vloc) { assert(dim == _clock_bounds->clock_number() + 1); tchecker::dbm::extra_lu_plus(dbm, dim, _clock_bounds->L().ptr(), _clock_bounds->U().ptr()); } /* local_lu_extrapolation_t */ namespace details { local_lu_extrapolation_t::local_lu_extrapolation_t( std::shared_ptr<tchecker::clockbounds::local_lu_map_t const> const & clock_bounds) : _l(nullptr), _u(nullptr), _clock_bounds(clock_bounds) { _l = tchecker::clockbounds::allocate_map(_clock_bounds->clock_number()); _u = tchecker::clockbounds::allocate_map(_clock_bounds->clock_number()); } local_lu_extrapolation_t::local_lu_extrapolation_t(tchecker::zg::details::local_lu_extrapolation_t const & e) : _clock_bounds(e._clock_bounds) { _l = tchecker::clockbounds::clone_map(*e._l); _u = tchecker::clockbounds::clone_map(*e._u); } local_lu_extrapolation_t::local_lu_extrapolation_t(tchecker::zg::details::local_lu_extrapolation_t && e) : _l(std::move(e._l)), _u(std::move(e._u)), _clock_bounds(std::move(e._clock_bounds)) { e._l = nullptr; e._u = nullptr; } local_lu_extrapolation_t::~local_lu_extrapolation_t() { tchecker::clockbounds::deallocate_map(_l); tchecker::clockbounds::deallocate_map(_u); } tchecker::zg::details::local_lu_extrapolation_t & local_lu_extrapolation_t::operator=(tchecker::zg::details::local_lu_extrapolation_t const & e) { if (this != &e) { _clock_bounds = e._clock_bounds; tchecker::clockbounds::deallocate_map(_l); _l = tchecker::clockbounds::clone_map(*e._l); tchecker::clockbounds::deallocate_map(_u); _u = tchecker::clockbounds::clone_map(*e._u); } return *this; } tchecker::zg::details::local_lu_extrapolation_t & local_lu_extrapolation_t::operator=(tchecker::zg::details::local_lu_extrapolation_t && e) { if (this != &e) { _clock_bounds = std::move(e._clock_bounds); _l = std::move(e._l); _u = std::move(e._u); e._l = nullptr; e._u = nullptr; } return *this; } } // end of namespace details /* local_extra_lu_t */ void local_extra_lu_t::extrapolate(tchecker::dbm::db_t * dbm, tchecker::clock_id_t dim, tchecker::vloc_t const & vloc) { assert(dim == _clock_bounds->clock_number() + 1); _clock_bounds->bounds(vloc, *_l, *_u); tchecker::dbm::extra_lu(dbm, dim, _l->ptr(), _u->ptr()); } /* local_extra_lu_plus_t */ void local_extra_lu_plus_t::extrapolate(tchecker::dbm::db_t * dbm, tchecker::clock_id_t dim, tchecker::vloc_t const & vloc) { assert(dim == _clock_bounds->clock_number() + 1); _clock_bounds->bounds(vloc, *_l, *_u); tchecker::dbm::extra_lu_plus(dbm, dim, _l->ptr(), _u->ptr()); } /* global_m_extrapolation_t */ namespace details { global_m_extrapolation_t::global_m_extrapolation_t( std::shared_ptr<tchecker::clockbounds::global_m_map_t const> const & clock_bounds) : _clock_bounds(clock_bounds) { } } // end of namespace details /* global_extra_m_t */ void global_extra_m_t::extrapolate(tchecker::dbm::db_t * dbm, tchecker::clock_id_t dim, tchecker::vloc_t const & vloc) { assert(dim == _clock_bounds->clock_number() + 1); tchecker::dbm::extra_m(dbm, dim, _clock_bounds->M().ptr()); } /* global_extra_m_plus_t */ void global_extra_m_plus_t::extrapolate(tchecker::dbm::db_t * dbm, tchecker::clock_id_t dim, tchecker::vloc_t const & vloc) { assert(dim == _clock_bounds->clock_number() + 1); tchecker::dbm::extra_m_plus(dbm, dim, _clock_bounds->M().ptr()); } /* local_m_extrapolation_t */ namespace details { local_m_extrapolation_t::local_m_extrapolation_t( std::shared_ptr<tchecker::clockbounds::local_m_map_t const> const & clock_bounds) : _m(nullptr), _clock_bounds(clock_bounds) { _m = tchecker::clockbounds::allocate_map(_clock_bounds->clock_number()); } local_m_extrapolation_t::local_m_extrapolation_t(tchecker::zg::details::local_m_extrapolation_t const & e) : _m(nullptr), _clock_bounds(e._clock_bounds) { _m = tchecker::clockbounds::clone_map(*e._m); } local_m_extrapolation_t::local_m_extrapolation_t(tchecker::zg::details::local_m_extrapolation_t && e) : _m(std::move(e._m)), _clock_bounds(std::move(e._clock_bounds)) { e._m = nullptr; } local_m_extrapolation_t::~local_m_extrapolation_t() { tchecker::clockbounds::deallocate_map(_m); } tchecker::zg::details::local_m_extrapolation_t & local_m_extrapolation_t::operator=(tchecker::zg::details::local_m_extrapolation_t const & e) { if (this != &e) { tchecker::clockbounds::deallocate_map(_m); _m = tchecker::clockbounds::clone_map(*e._m); _clock_bounds = e._clock_bounds; } return *this; } tchecker::zg::details::local_m_extrapolation_t & local_m_extrapolation_t::operator=(tchecker::zg::details::local_m_extrapolation_t && e) { if (this != &e) { _m = std::move(e._m); e._m = nullptr; _clock_bounds = std::move(e._clock_bounds); } return *this; } } // namespace details /* local_extra_m_t */ void local_extra_m_t::extrapolate(tchecker::dbm::db_t * dbm, tchecker::clock_id_t dim, tchecker::vloc_t const & vloc) { assert(dim == _clock_bounds->clock_number() + 1); _clock_bounds->bounds(vloc, *_m); tchecker::dbm::extra_m(dbm, dim, _m->ptr()); } /* local_extra_m_plus_t */ void local_extra_m_plus_t::extrapolate(tchecker::dbm::db_t * dbm, tchecker::clock_id_t dim, tchecker::vloc_t const & vloc) { assert(dim == _clock_bounds->clock_number() + 1); _clock_bounds->bounds(vloc, *_m); tchecker::dbm::extra_m_plus(dbm, dim, _m->ptr()); } /* factories */ tchecker::zg::extrapolation_t * extrapolation_factory(enum extrapolation_type_t extrapolation_type, tchecker::ta::system_t const & system) { if (extrapolation_type == tchecker::zg::NO_EXTRAPOLATION) return new tchecker::zg::no_extrapolation_t; std::unique_ptr<tchecker::clockbounds::clockbounds_t> clock_bounds{tchecker::clockbounds::compute_clockbounds(system)}; if (clock_bounds.get() == nullptr) return nullptr; return tchecker::zg::extrapolation_factory(extrapolation_type, *clock_bounds); } tchecker::zg::extrapolation_t * extrapolation_factory(enum extrapolation_type_t extrapolation_type, tchecker::clockbounds::clockbounds_t const & clock_bounds) { if (extrapolation_type == tchecker::zg::NO_EXTRAPOLATION) return new tchecker::zg::no_extrapolation_t; switch (extrapolation_type) { case tchecker::zg::EXTRA_LU_GLOBAL: return new tchecker::zg::global_extra_lu_t{clock_bounds.global_lu_map()}; case tchecker::zg::EXTRA_LU_LOCAL: return new tchecker::zg::local_extra_lu_t{clock_bounds.local_lu_map()}; case tchecker::zg::EXTRA_LU_PLUS_GLOBAL: return new tchecker::zg::global_extra_lu_plus_t{clock_bounds.global_lu_map()}; case tchecker::zg::EXTRA_LU_PLUS_LOCAL: return new tchecker::zg::local_extra_lu_plus_t{clock_bounds.local_lu_map()}; case tchecker::zg::EXTRA_M_GLOBAL: return new tchecker::zg::global_extra_m_t{clock_bounds.global_m_map()}; case tchecker::zg::EXTRA_M_LOCAL: return new tchecker::zg::local_extra_m_t{clock_bounds.local_m_map()}; case tchecker::zg::EXTRA_M_PLUS_GLOBAL: return new tchecker::zg::global_extra_m_plus_t{clock_bounds.global_m_map()}; case tchecker::zg::EXTRA_M_PLUS_LOCAL: return new tchecker::zg::local_extra_m_plus_t{clock_bounds.local_m_map()}; default: throw std::invalid_argument("Unknown zone extrapolation"); } } } // end of namespace zg } // end of namespace tchecker
32.177358
124
0.727571
arnabSur
3a5154314cb86cd231ccafc0de91077024488816
4,435
cpp
C++
extensions/mxhumanizer.cpp
arturocepeda/Modus
849c9ada0e8bf7803db6e1b5c6098ab5898bc430
[ "MIT" ]
2
2015-04-08T21:03:09.000Z
2016-03-20T17:46:31.000Z
extensions/mxhumanizer.cpp
arturocepeda/Modus
849c9ada0e8bf7803db6e1b5c6098ab5898bc430
[ "MIT" ]
null
null
null
extensions/mxhumanizer.cpp
arturocepeda/Modus
849c9ada0e8bf7803db6e1b5c6098ab5898bc430
[ "MIT" ]
2
2015-08-18T08:59:07.000Z
2021-04-02T23:03:48.000Z
//////////////////////////////////////////////////////////////////////// // // Modus // C++ Music Library // [eXtension] // // Copyright (c) 2012-2015 Arturo Cepeda // // -------------------------------------------------------------------- // // This file is part of Modus. Permission is hereby granted, free // of charge, to any person obtaining a copy of this software and // associated documentation files (the "Software"), to deal in the // Software without restriction, including without limitation the // rights to use, copy, modify, merge, publish, distribute, // sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to // the following conditions: // // The above copyright notice and this permission notice shall be // included in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY // KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE // WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS // OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR // OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // //////////////////////////////////////////////////////////////////////// #include "mxhumanizer.h" #include <time.h> #include <iostream> #include <algorithm> using namespace Modus; void MCHumanizer::humanizeRandom(MCScore* Score, unsigned char TimeMaxError, unsigned char IntensityMaxError, unsigned char DurationMaxError, unsigned char BeatsPerMeasure) { humanizeRandom(Score, TimeMaxError, IntensityMaxError, DurationMaxError, INT_MIN, INT_MAX, BeatsPerMeasure); } void MCHumanizer::humanizeRandom(MCScore* Score, unsigned char TimeMaxError, unsigned char IntensityMaxError, unsigned char DurationMaxError, int MeasureFrom, int MeasureTo, unsigned char BeatsPerMeasure) { int iError; MSScoreEntry mAuxEntry; int iAuxPosition; // seed for random numbers: [-MaxError, MaxError] srand((unsigned int)time(NULL)); for(unsigned int i = 0; i < Score->getNumberOfEntries(); i++) { // measure bounds management if(Score->getEntry(i)->TimePosition.Measure < MeasureFrom) continue; if(Score->getEntry(i)->TimePosition.Measure > MeasureTo) return; // ignore control notes if(Score->getEntry(i)->Note.Pitch > 127) continue; // intensity error if(Score->getEntry(i)->Note.Intensity != 0) { iError = rand() % (IntensityMaxError * 2 + 1) - IntensityMaxError; if(iError >= 0) Score->getEntry(i)->Note.Intensity = std::min(127, Score->getEntry(i)->Note.Intensity + iError); else Score->getEntry(i)->Note.Intensity = std::max(0, Score->getEntry(i)->Note.Intensity + iError); } // duration error if(Score->getEntry(i)->Note.Duration != 0) { iError = rand() % (DurationMaxError * 2 + 1) - DurationMaxError; if(iError >= 0) Score->getEntry(i)->Note.Duration += iError; else Score->getEntry(i)->Note.Duration = std::max(1, Score->getEntry(i)->Note.Intensity + iError); } // time error iError = rand() % (TimeMaxError * 2 + 1) - TimeMaxError; Score->getEntry(i)->TimePosition.add(iError, BeatsPerMeasure); if(Score->getEntry(i)->TimePosition.Measure < MeasureFrom) { Score->getEntry(i)->TimePosition.Measure = MeasureFrom; Score->getEntry(i)->TimePosition.Beat = 1; Score->getEntry(i)->TimePosition.Tick = 0; } iAuxPosition = i; while(iAuxPosition > 0 && Score->getEntry(iAuxPosition - 1)->TimePosition > Score->getEntry(i)->TimePosition) iAuxPosition--; if(Score->getEntry(iAuxPosition)->TimePosition > Score->getEntry(i)->TimePosition) { mAuxEntry = *Score->getEntry(i); Score->removeEntry(i); Score->addEntry(mAuxEntry); } } }
37.268908
117
0.596618
arturocepeda
3a55fbaf2e1554ce4afd7b4bce1c2ae93604b4a2
18,792
cpp
C++
NewsExercise/main.cpp
Thanatoslayer6/CPP_Programming
2a00e1db709b8b5c65969706b8a18af8c62761de
[ "BSD-3-Clause" ]
null
null
null
NewsExercise/main.cpp
Thanatoslayer6/CPP_Programming
2a00e1db709b8b5c65969706b8a18af8c62761de
[ "BSD-3-Clause" ]
null
null
null
NewsExercise/main.cpp
Thanatoslayer6/CPP_Programming
2a00e1db709b8b5c65969706b8a18af8c62761de
[ "BSD-3-Clause" ]
null
null
null
#include <iostream> #include <string> using namespace std; string database[][2] = { {"admin12345", "wisdom123"}, {"ellejohn", "pass123"}, {"test", "pp"} }; string username, password; int pageNum; bool loggedIn = false; string Pages[7] = { "Front Page", "Headline", "News Articles", "Entertainment", "Sports Page", "Editorial", "EXIT"}; char option, keyCodes[7] = {'f', 'h', 'n', 'e', 's', 'd', 'x'}; bool validateCredentials() { for (int i = 0; i < 3; i++){ if (database[i][0] == username && database[i][1] == password) { return true; // Means username and pwd are correct } } return false; } int checkPage(){ for (int i = 0; i < 7; i++) { if (keyCodes[i] == option || keyCodes[i] == option + 32) { // can be upper or lowercase return i; // Returns the right index for the page } } return -1; // -1 for error } void showTableOfContents() { // Show possible pages cout << "\n\t~ Table of Contents ~ \n\n"; for (int i = 0; i < 7; i++) { if (i == 6) { // Exit cout << "\n [ Press x for " << Pages[i] << " ]\n"; } else { cout << " * " << Pages[i] << "\t - " << keyCodes[i] << "\n"; } } } void Login() { cout << "\n.-=-=-=-=-=-=-=-=-=-=-=-=-=-=-SITE LOGIN-=-=-=-=-=-=-=-=-=-=-=-=-=-=-.\n"; cout << "\tEnter username: "; cin >> username; cout << "\tEnter password: "; cin >> password; if (validateCredentials() == false) { throw 5; } else { loggedIn = true; } cout << ".-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-.\n"; } void Home() { // Greet the user cout << R"( |\ | _ ,_ |\ | _ _ (`.|- _ | \|(/_()|| | \|(/_LL|_\ _)||_(/_ )"; cout << "\n ~ [ WELCOME TO THE NEON NEWS SITE (Logged in as " << username << ") ] ~\n"; cout << "\n Where do you want to go? ------ Please enter only one character \n\n"; } void ShowPage() { switch(pageNum) { case 0: // Front page cout << "\n.-=-=-=-=-=-=-=-=-=-=-=-=-=-=-FRONT PAGE-=-=-=-=-=-=-=-=-=-=-=-=-=-=-.\n\n"; cout << R"( *--------------------------------------------------------------------------------* | Monday, April 4, 2022 | CALL US NOW! (212) 804-6003 | PH LOTTO RESULTS 6/58 | |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| | _ _ _ _ _ _ ___ ____ ____ ____ ____ _ _ ____ _ _ _ |-o o/|| | |\ | | | |\/| |__] |___ |__/ | | |___ |\ | |___ | | | | \ q / o| | | \| |__| | | |__] |___ | \ |__| | | \| |___ |_|_| | o .-o-. o | | | o-(o o o)-o | | ____ ____ _ _ _ ___ ____ ____ ____ ____ ____ ____ | o ._o_. o | | | | | | | | | \ __ /| |__| | |__| [__ |___ [__ | / b \ q| | |___ |__| \/ | |__/ _|_ | |___ | | ___] |___ ___] |--------------| | |COVID-19 VIRUS| | `--------------| | ____ ____ ____ _ _ ____ _ _ _ ___ ____ ____ ___ ___ _ _ _ ____ / | | |__| |__/ |___ |\ | | | | | | | \ |__/ | | |__] |__] | |\ | | __ / | | | | | \ |___ | \| |__| |_|_| |__/ | \ |__| | | | | \| |__] . | | | | [ H E A D L I N E ] | |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| | [ N E W S - A R T I C L E S ] | [ E N T E R T A I N M E N T ] | | | | | PCS STUDENTS WORRIED ABOUT THE | /\ _ |_. _. _ _ |_ _ _| | | UPCOMING EXAMS | /--\| )|_|(_||_)(_||_(-(_| | | | | | | ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ | __ __ __ __ | | | |\/| _ . _ _ . _ _) / \ _) _) | | ELECTIONS 2022: WHY TECHNOLOGY | | |(_)\/|(-_) || ) /__ \__/ /__ /__ | | IS IMPORTANT | | | | | |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| | | [ S P O R T S ] | | ..,,;;;;;;,,,, | | | .,;'';;,..,;;;,,,,,.''';;,.. | THE RISE IN POPULARITY | | ,,'' '';;;;,;'' | | | ;' ,;@@;' ,@@;, @@, ';;;@@;,;';. | OF CHESS | | '' ,;@@@@@' ;@@@@; '' ;;@@@@@;;;; | | | ;;@@@@@; ''' .,,;;;@@@@@@@;;; | AMIDST THE PANDEMIC | | ;;@@@@@@; , ';;;@@@@@@@@;;;. | | | '';@@@@@,. , . ',;;;@@@@@@;;;;;; | (\=, | | . '';;;;;;;;;,;;;;@@@@@;;' ,.:;' | __ |'-'-'| // .\ | | ''..,, '''' ' .,;' | / \ |_____| (( \_ \ | | ''''''::'''''''' | \__/ |===| )) `\_) | | | /____\ | | (/ \ | | "In a world of universal deceit, | | | | | | _.-'| | | telling the truth is a revolutionary act." | |__| )___( )___( | | | (====) (=====) (=====) | | ~ George Orwell ~ 1984 ~ | }===={ }====={ }====={ | | | (______)(_______)(_______) | | [ E D I T O R I A L ] - A World On Fire? | ><><><><><><><><><><><><><><>< | *--------------------------------------------------------------------------------* )" << '\n'; cout << "\n.-=-=-=-=-=-=-=-=-=-=-=-=-END OF FRONT PAGE-=-=-=-=-=-=-=-=-=-=-=-=-=-=-.\n"; break; case 1: // Headline cout << "\n.-=-=-=-=-=-=-=-=-=-=-=-=-=-=-HEADLINE-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-.\n\n"; cout << "\t ~~~ Number Of New COVID-19 Cases Are Now Dropping! ~~~\n\n"; cout << " Reports have shown the gradual decrease of people being infected by COVID-19\n" " in a day to day basis. From more than 1k cases per day, now we see cases that\n" " are less than that. However there are still active cases with over 40k+ people\n" " these active cases are somewhat stable; a plateau for now. On the other hand, \n" " countless reports from professionals have said we're transitioning from a pan-\n" " demic towards an endemic. Wherein the virus will still live on but the majority\n" " will be immune to the virus and its discovered variants.\n"; cout << "\n.-=-=-=-=-=-=-=-=-=-=-=-=-=-END OF SECTION-=-=-=-=-=-=-=-=-=-=-=-=-=-=-.\n"; break; case 2: // News Articles cout << "\n.-=-=-=-=-=-=-=-=-=-=-=-=-=-NEWS ARTICLES-=-=-=-=-=-=-=-=-=-=-=-=-=-.\n\n"; cout << "\t ~~~ PCS Students Worried About The Upcoming Exams! ~~~\n\n"; cout << " As the exams are approaching near, and the school year closing in\n" " Many students are worried and anxious about taking their last exam\n" " As a result, students are finding ways to cope and relax as much as\n" " possible. Ways such as playing video games, watching Netflix, and more\n" " in order to lessen their stress and break free from all the tasks that\n" " these students have encountered. \n\n" " One student from 11 - Albert The Great (STEM) shared some techniques and\n" " ways to handle the fear of failing and the overall anxiety towards exams\n" " the student happily said 'You must be prepared at all times, kasi ganun\n" " talaga, kung titignan mo you also need to be independent in learning all\n" " by yourself if you can in this situation... avoid procrastinating and\n" " remove distractions. If you have free time, make sure to use it for your\n" " own benefit! don't be afraid to fail, study online, grasp and that's it.'\n"; cout << "\n\t ~~~ Elections 2022: Why Technology is Important ~~~\n\n"; cout << " The election day is almost here, it is time for Filipinos to practice\n" " and exercise their right in a democratic way by means of voting for their\n" " desired candidate. While elections can be an active way of showing one's \n" " support towards a candidate. Technology can also come into play, and from\n" " its inception, the advancement towards communication and self-expression \n" " has never been easier.\n\n" " For this reason, people of today especially millenials have been utilizing\n" " it (Social Media) to show support, or even hate towards an idea or a person.\n" " As a result, the current state of technology has never been so influential\n" " in the recent years, and is deemed to be important in one's nation\n"; cout << "\n.-=-=-=-=-=-=-=-=-=-=-=-=-=-END OF SECTION-=-=-=-=-=-=-=-=-=-=-=-=-=-=-.\n"; break; case 3: // Entertainment cout << "\n.-=-=-=-=-=-=-=-=-=-=-=-=-=-ENTERTAINMENT-=-=-=-=-=-=-=-=-=-=-=-=-=-=-.\n\n"; cout << "\n\t ~~~ Anticipated Movies in 2022 ~~~\n\n"; cout << " It's been the third month of the year, and so far we have seen movies or shows\n" " that exceed our expectations, some are entertaining, some will leave its viewers\n" " a moral or a lesson, and some will make you speechless. As we move forward through\n" " the years, normal/mediocre movies come and go, it will stay there for a while but\n" " movies that are made with true essence and is on its purest form will stay longer.\n" " We see this, as some rare and old movies still become relevant and influential\n" " throughout the decades. With that, we have considered 5 movies that are mostly\n" " anticipated by critics and praised by its fans.\n\n" " LIST OF MOVIES (IN NO ORDER)\n\n" " * Nope\n\t - Directed by Jordan Peele, Horror/Thriller\n\n" " * Top Gun: Maverick\n\t - Directed by Joseph Kosinski, Action/Adventure\n\n" " * The Northman\n\t - Directed by Robert Eggers, Action/Adventure\n\n" " * Thor: Love and Thunder\n\t - Directed by Taika Waititi, Action/Adventure\n\n" " * The Batman (NOW SHOWING)\n\t - Directed by Matt Reeves, Action/Adventure\n\n" " * Doctor Strange in the Multiverse of Madness\n\t - Directed by Sam Raimi, Adventure/Fantasy\n\n" " * Lightyear\n\t - Directed by Angus MacLane, Adventure/Fantasy\n\n" " * Jurrasic World: Dominion\n\t - Directed by Colin Trevorrow, Sci-Fi/Adventure\n\n" " * Avatar 2\n\t - Directed by James Cameron, Sci-Fi/Action\n\n" " * Turning Red (NOW SHOWING)\n\t - Directed by Domee Shi, Comedy/Family\n\n"; cout << "\n.-=-=-=-=-=-=-=-=-=-=-=-=-=-END OF SECTION-=-=-=-=-=-=-=-=-=-=-=-=-=-=-.\n"; break; case 4: // Sports Page cout << "\n.-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-SPORTS-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-.\n\n"; cout << "\n\t ~~~ The Rise In Popularity Of Chess Amidst The Pandemic ~~~\n\n"; cout << " Chess has been totally on the rise since the start of the pandemic, from\n" " its ancient history 1500 years ago. Chess is considered as a recreational\n" " activity, it is a sport in which decades of competition have sparked from\n" " countries that are focusing on it such as Russia, and the United States back\n" " then in the span of the Cold War, where both countries battle in order to see\n" " who's the smartest and the toughest of them all. Now in the present time, Chess\n" " is still seen as a competitive sport. However, it can be a means of entertainment\n" " as well.\n\n" " Amidst the current situation that this pandemic has brought to us, many people are\n" " forced to stay in their homes, especially adults or kids who are working or study-\n" " ing for a period of time. With professional chess players switching to the digital\n" " side of technology, we now have livestreamers who play Chess and teach the masses\n" " and for that cause, the advancement of technology is at work as well. Considereing\n" " that in the past we didn't have online Chess. From this little spark, a recent tv-\n" " show on Netflix entitled 'The Queen's Gambit' gained a lot of attention, not just \n" " from Chess players, but from normal people as well. As a result, it boosted the pop\n" " ularity of the game. As of now, Chess is still becoming more popular as new players\n" " are introduced to the game, the ease of access within chess is literally clicks away\n" " countless platforms such as 'Lichess.org', allows users (even users with no accounts)\n" " to play live and real-time. In the end, people stay at home and find new ways to gain\n" " hobbies or interests, just to pass the time.\n"; cout << "\n.-=-=-=-=-=-=-=-=-=-=-=-=-=-END OF SECTION-=-=-=-=-=-=-=-=-=-=-=-=-=-=-.\n"; break; case 5: // Editorial cout << "\n.-=-=-=-=-=-=-=-=-=-=-=-=-=-=-EDITORIAL-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-.\n\n"; cout << "\n\t ~~~ OPINION: A World On Fire ~~~\n\n"; cout << " Apparently, you might have heard the recent news about the Russian invasion of Ukraine\n" " while this seems, quite alarming and shocking at the same time. What's truly happening is we're\n" " like slowly approacing our doom, and this is like the first step, from diseases, wars\n" " famine, poverty and more.\n\n" " We're slowly killing ourselves, deteriorating, every aspect in our life is basically affected,\n" " from the moment you hold your phone, you are not in control. What's sad about the 21st Century\n" " is that, it got real. It got real to the point where there's simply no return, and if you\n" " think this Russian invasion is the first thing to happen in this decade or year....\n" " and will probably be the last thing to happen... You're wrong! because it's happening \n" " in basically almost every part of the world, like Afghanistan, Sudan, Yemen, and much \n" " more in terms of minor or major conflicts. In fact, China is already planning their way\n" " in a long term, theres no need for blood to pour down in every nation. In fact, what they're\n" " doing now is colonizing us. Neocolonialism if u may, it just doesn't happen right in the\n" " Philippines, as many Southeast Asian countries are also affected like Malaysia, Thailand\n" " and much more. Moving on, we can somewhat see a pattern that governments are becoming too\n" " powerful and tyrannical. History is just forced to repeat itself from Hitler, Mao Zedong,\n" " Stalin and Kim II-Sung, we now have Kim Jong-Un, Duterte/Marcos, Putin, Xi Jinping ironically\n" " and literally becoming the 'Four Horsemen of the Apocalypse'. Only these men have brought\n" " suffering and oppression to the totality of all people, their lies twist and bend history\n" " and the minds of the people especially the youth which is the future of one's nation.\n" " The crazy thing is, people are vulnerable and they have no idea, that they're no longer\n" " protected, and in control of their minds. From mass surveillance, fake news/disinformation\n" " social media/gaming addiction, you name it, and from these typical things what is at the cen-\n" " ter is technology itself. Ever since we got it, it made things easier, and now it seems like\n" " we want more of that, whether it's convenience, pleasure, satisfaction.\n\n" " In the end, we humans are naturally inclined to greed and selfishness. From all of these things,\n" " you might ask yourself, when will we ever wake up? when will we ever just get along? Well you\n" " must understand and realize that the power is in your hands use it for the greater good for your\n" " family, your people, and most importantly yourself. Someday, we'll just get there....\n\n" " Thanks for reading =)\n"; cout << "\n.-=-=-=-=-=-=-=-=-=-=-=-=-=-END OF SECTION-=-=-=-=-=-=-=-=-=-=-=-=-=-=-.\n"; break; case 6: // EXIT cout << "\n ==================/\\ ^_^ GOODBYE READER ^_^ /\\=======================\n"; loggedIn = false; break; } } void Navigation() { showTableOfContents(); cout << "\n Navigate to -----> "; cin >> option; pageNum = checkPage(); // Assign return value of function if (pageNum == -1) { throw 8; } } int main() { try { Login(); Home(); while (loggedIn == true) { Navigation(); ShowPage(); } } catch (int errcode) { switch (errcode) { case 5: cout << "\n\tError code 5: Failed to login (wrong username/password) Exiting now...\n"; break; case 8: cout << "\n\tError code 8: Page doesn't exist! Exiting now...\n"; break; } } }
63.060403
116
0.461047
Thanatoslayer6
3a567f2dbfee9b91afa133c07a065e585936ea74
5,839
cpp
C++
imagery/netwin.cpp
Pokefinder-org/DiskImagery64
10557fed083834455f8ace70a1d740a9b007d853
[ "X11" ]
null
null
null
imagery/netwin.cpp
Pokefinder-org/DiskImagery64
10557fed083834455f8ace70a1d740a9b007d853
[ "X11" ]
null
null
null
imagery/netwin.cpp
Pokefinder-org/DiskImagery64
10557fed083834455f8ace70a1d740a9b007d853
[ "X11" ]
1
2021-07-01T10:14:19.000Z
2021-07-01T10:14:19.000Z
#include "netwin.h" #include "codenet.h" #include "preferences.h" #include <QGridLayout> #include <QLabel> #include <QTextEdit> #include <QToolButton> NetWin::NetWin(QWidget *parent) : QDialog(parent, Qt::Tool), m_copyDialog(nullptr) { setWindowTitle("DiskImagery64: " + tr("Network")); QGridLayout *layout = new QGridLayout(this); // log view m_logView = new QTextEdit(this); m_logView->setReadOnly(true); m_logView->setLineWrapMode(QTextEdit::NoWrap); QFont smallFont("Monaco"); smallFont.setPointSize(9); m_logView->setFont(smallFont); // packet counter m_packetsInLabel = new QLabel(this); m_packetsOutLabel = new QLabel(this); m_stopButton = new QToolButton(this); m_stopButton->setText(tr("Abort")); connect(m_stopButton, SIGNAL(clicked()), this, SLOT(stopNet())); layout->addWidget(m_logView, 0, 0, 1, 3); layout->addWidget(m_packetsInLabel, 1, 0); layout->addWidget(m_packetsOutLabel, 1, 1); layout->addWidget(m_stopButton, 1, 2); layout->setMargin(2); resetCounters(); loadSettings(); logService(&m_codeNet); logService(&m_netDrive); logService(&m_warpCopy); } NetWin::~NetWin() { if (m_copyDialog != nullptr) delete m_copyDialog; saveSettings(); stopNet(); } // ----- Settings ----- void NetWin::saveSettings() { QSettings settings; settings.beginGroup("NetWin"); // geometry settings.setValue("geometry", geometry()); // visible settings.setValue("visible", isVisible()); settings.endGroup(); } void NetWin::loadSettings() { QSettings settings; settings.beginGroup("NetWin"); // geometry QRect rect = settings.value("geometry", QRect(400, 100, 200, 100)).toRect(); move(rect.topLeft()); resize(rect.size()); // visible bool visible = settings.value("visible", false).toBool(); if (visible) show(); else hide(); settings.endGroup(); } // ----- UI ----- void NetWin::logMessage(const QString &msg) { QDateTime now = QDateTime::currentDateTime(); QLocale locale; QString header = locale.toString(now.date(), QLocale::ShortFormat) + " " + locale.toString(now.time(), QLocale::ShortFormat) + " "; m_logView->append(header + msg); } void NetWin::logService(NetService *service) { connect(service, SIGNAL(networkEvent(const QString &)), this, SLOT(logMessage(const QString &))); connect(service, SIGNAL(sentPacket(int)), this, SLOT(reportOutPacket(int))); connect(service, SIGNAL(receivedPacket(int)), this, SLOT(reportInPacket(int))); } void NetWin::resetCounters() { m_packetsIn = 0; m_packetsInSize = 0; m_packetsOut = 0; m_packetsOutSize = 0; updateCounters(); } void NetWin::updateCounters() { QString inMsg; inMsg.asprintf("In: %d/%d bytes", m_packetsIn, m_packetsInSize); m_packetsInLabel->setText(inMsg); QString outMsg; outMsg.asprintf("Out: %d/%d bytes", m_packetsOut, m_packetsOutSize); m_packetsOutLabel->setText(outMsg); } void NetWin::reportInPacket(int size) { m_packetsIn++; m_packetsInSize += size; updateCounters(); } void NetWin::reportOutPacket(int size) { m_packetsOut++; m_packetsOutSize += size; updateCounters(); } // ----- Commands ----- void NetWin::stopNet() { if (m_codeNet.isServiceAvailable()) m_codeNet.stopService(); if (m_netDrive.isServiceAvailable()) m_netDrive.stopService(); if (m_warpCopy.isServiceAvailable()) m_warpCopy.stopService(); resetCounters(); } void NetWin::runProgram(quint16 addr, const QByteArray &data) { if (!startCodeNet()) return; m_codeNet.sendData(addr, data); if (addr == 0x0801) m_codeNet.execRun(); else m_codeNet.execJump(addr); } void NetWin::shareFiles(const CBMFileList &files) { if (!startNetDrive()) return; m_netDrive.shareFiles(files); } // ----- warp copy ----- bool NetWin::warpReadDisk(DImage *image) { return copyDisk(WarpCopyDisk::READ_DISK_WARP, image); } bool NetWin::warpWriteDisk(DImage *image) { return copyDisk(WarpCopyDisk::WRITE_DISK_WARP, image); } bool NetWin::readDisk(DImage *image) { return copyDisk(WarpCopyDisk::READ_DISK_SLOW, image); } bool NetWin::writeDisk(DImage *image) { return copyDisk(WarpCopyDisk::WRITE_DISK_SLOW, image); } bool NetWin::copyDisk(WarpCopyDisk::Mode mode, DImage *image) { if (!startWarpCopy()) return false; if (m_copyDialog == nullptr) m_copyDialog = new CopyDialog; return m_copyDialog->copyDisk(8, &m_warpCopy, mode, image); } // ----- other wc ops ----- void NetWin::formatDisk(const QString &name, const QString &id) { QString cmd = "N:" + name; if (id != "") cmd += "," + id; if (!startWarpCopy()) return; m_warpCopy.sendDOSCommand(8, cmd); } void NetWin::verifyDisk() { if (!startWarpCopy()) return; m_warpCopy.sendDOSCommand(8, "V"); } void NetWin::sendDOSCommand(const QString &cmd) { if (!startWarpCopy()) return; m_warpCopy.sendDOSCommand(8, cmd); } void NetWin::getDriveStatus() { if (!startWarpCopy()) return; m_warpCopy.getDriveStatus(8); } // ---------- start services ---------- bool NetWin::startCodeNet() { if (!m_codeNet.isServiceAvailable()) { AddrPair addrPair; Preferences::getNetworkDefaults(addrPair); return m_codeNet.startService(addrPair); } return true; } bool NetWin::startNetDrive() { if (!m_netDrive.isServiceAvailable()) { AddrPair addrPair; Preferences::getNetworkDefaults(addrPair); return m_netDrive.startService(addrPair); } return true; } bool NetWin::startWarpCopy() { if (!m_warpCopy.isServiceAvailable()) { AddrPair addrPair; Preferences::getNetworkDefaults(addrPair); return m_warpCopy.startService(addrPair); } return true; }
25.722467
101
0.668265
Pokefinder-org
3a5c030f53942c88c502b4e217a56c2e349ac17d
6,816
cpp
C++
src/beast/beast/utility/impl/Journal.cpp
SingaporeLMC/LMC
b8734f7c67c829f69ae06c1217b9f64e2c078a1a
[ "BSL-1.0" ]
null
null
null
src/beast/beast/utility/impl/Journal.cpp
SingaporeLMC/LMC
b8734f7c67c829f69ae06c1217b9f64e2c078a1a
[ "BSL-1.0" ]
null
null
null
src/beast/beast/utility/impl/Journal.cpp
SingaporeLMC/LMC
b8734f7c67c829f69ae06c1217b9f64e2c078a1a
[ "BSL-1.0" ]
1
2018-11-23T01:30:41.000Z
2018-11-23T01:30:41.000Z
//------------------------------------------------------------------------------ /* This file is part of Beast: https://github.com/vinniefalco/Beast Copyright 2013, Vinnie Falco <vinnie.falco@gmail.com> Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ //============================================================================== #include <beast/utility/Journal.h> #include <beast/module/core/memory/SharedSingleton.h> namespace beast { //------------------------------------------------------------------------------ // A Sink that does nothing. class NullJournalSink : public Journal::Sink { public: bool active (Journal::Severity) const { return false; } bool console() const { return false; } void console (bool) { } Journal::Severity severity() const { return Journal::kDisabled; } void severity (Journal::Severity) { } void write (Journal::Severity, std::string const&) { } }; //------------------------------------------------------------------------------ Journal::Sink& Journal::getNullSink () { return *SharedSingleton <NullJournalSink>::get ( SingletonLifetime::neverDestroyed); } //------------------------------------------------------------------------------ Journal::Sink::Sink () : m_level (kAll) , m_console (false) { } Journal::Sink::~Sink () { } bool Journal::Sink::active (Severity level) const { return level >= m_level; } bool Journal::Sink::console () const { return m_console; } void Journal::Sink::console (bool output) { m_console = output; } Journal::Severity Journal::Sink::severity () const { return m_level; } void Journal::Sink::severity (Severity level) { m_level = level; } //------------------------------------------------------------------------------ Journal::ScopedStream::ScopedStream (Stream const& stream) : m_sink (stream.sink ()) , m_level (stream.severity ()) , m_active (stream.active ()) { init (); } Journal::ScopedStream::ScopedStream (ScopedStream const& other) : m_sink (other.m_sink) , m_level (other.m_level) , m_active (other.m_active) { init (); } Journal::ScopedStream::ScopedStream ( Stream const& stream, std::ostream& manip (std::ostream&)) : m_sink (stream.sink ()) , m_level (stream.severity ()) , m_active (stream.active ()) { init (); if (active ()) m_ostream << manip; } Journal::ScopedStream::~ScopedStream () { if (active ()) { std::string const& s (m_ostream.str()); if (! s.empty ()) { if (s == "\n") m_sink.write (m_level, ""); else m_sink.write (m_level, s); } } } void Journal::ScopedStream::init () { // Modifiers applied from all ctors m_ostream << std::boolalpha << std::showbase //<< std::hex ; } std::ostream& Journal::ScopedStream::operator<< (std::ostream& manip (std::ostream&)) const { return m_ostream << manip; } std::ostringstream& Journal::ScopedStream::ostream () const { return m_ostream; } //------------------------------------------------------------------------------ Journal::Stream::Stream () : m_sink (&getNullSink ()) , m_level (kDisabled) , m_disabled (true) { } Journal::Stream::Stream (Sink& sink, Severity level, bool active) : m_sink (&sink) , m_level (level) , m_disabled (! active) { bassert (level != kDisabled); } Journal::Stream::Stream (Stream const& stream, bool active) : m_sink (&stream.sink ()) , m_level (stream.severity ()) , m_disabled (! active) { } Journal::Stream::Stream (Stream const& other) : m_sink (other.m_sink) , m_level (other.m_level) , m_disabled (other.m_disabled) { } Journal::Sink& Journal::Stream::sink () const { return *m_sink; } Journal::Severity Journal::Stream::severity () const { return m_level; } bool Journal::Stream::active () const { return ! m_disabled && m_sink->active (m_level); } Journal::Stream& Journal::Stream::operator= (Stream const& other) { m_sink = other.m_sink; m_level = other.m_level; return *this; } Journal::ScopedStream Journal::Stream::operator<< ( std::ostream& manip (std::ostream&)) const { return ScopedStream (*this, manip); } //------------------------------------------------------------------------------ Journal::Journal () : m_sink (&getNullSink()) , m_level (kDisabled) , trace (stream (kTrace)) , debug (stream (kDebug)) , info (stream (kInfo)) , warning (stream (kWarning)) , error (stream (kError)) , fatal (stream (kFatal)) { } Journal::Journal (Sink& sink, Severity level) : m_sink (&sink) , m_level (level) , trace (stream (kTrace)) , debug (stream (kDebug)) , info (stream (kInfo)) , warning (stream (kWarning)) , error (stream (kError)) , fatal (stream (kFatal)) { } Journal::Journal (Journal const& other) : m_sink (other.m_sink) , m_level (other.m_level) , trace (stream (kTrace)) , debug (stream (kDebug)) , info (stream (kInfo)) , warning (stream (kWarning)) , error (stream (kError)) , fatal (stream (kFatal)) { } Journal::Journal (Journal const& other, Severity level) : m_sink (other.m_sink) , m_level (std::max (other.m_level, level)) , trace (stream (kTrace)) , debug (stream (kDebug)) , info (stream (kInfo)) , warning (stream (kWarning)) , error (stream (kError)) , fatal (stream (kFatal)) { } Journal::~Journal () { } Journal::Sink& Journal::sink() const { return *m_sink; } Journal::Stream Journal::stream (Severity level) const { return Stream (*m_sink, level, level >= m_level); } bool Journal::active (Severity level) const { if (level == kDisabled) return false; if (level < m_level) return false; return m_sink->active (level); } Journal::Severity Journal::severity () const { return m_level; } }
22.201954
91
0.563527
SingaporeLMC
3a5d3c5b446a9f5dc2404172c899fb91591c9851
11,876
cpp
C++
Source/CompilingLibrary/Parser/Parser.cpp
KonstantinTomashevich/simple-llvm-language-compiler
6adddedf57c5b964c430d0bffe6b0391c762cdd3
[ "MIT" ]
null
null
null
Source/CompilingLibrary/Parser/Parser.cpp
KonstantinTomashevich/simple-llvm-language-compiler
6adddedf57c5b964c430d0bffe6b0391c762cdd3
[ "MIT" ]
null
null
null
Source/CompilingLibrary/Parser/Parser.cpp
KonstantinTomashevich/simple-llvm-language-compiler
6adddedf57c5b964c430d0bffe6b0391c762cdd3
[ "MIT" ]
null
null
null
#include "Parser.hpp" #include <assert.h> #include <iostream> #include <cctype> #include <cstdio> #include <memory> namespace Compiling { namespace Parser { void Parser::EatToken () { lastTokenIndex_++; if (lastTokenIndex_ < currentTokensList_.size ()) { currentToken_ = currentTokensList_.at (lastTokenIndex_); if (currentToken_.token_ == Lexer::TOKEN_END_OF_INPUT) isListed_ = true; } else fprintf (stderr, "Error while parsing: %s\n", "trying to eat token, but all tokens is listed!"); } int Parser::GetOperatorPrecedence (std::string operatorName) { int precedence = binaryOperatorsPrecedence_ [operatorName]; if (precedence <= 0) { binaryOperatorsPrecedence_ [operatorName] = -1; return -1; } else return precedence; } AST::Expression *Parser::ErrorInExpression (const char *error) { std::cerr << "Error in expression!\n last_token_index = " << lastTokenIndex_ << "\n error: " << error << "\n"; return 0; } AST::Prototype *Parser::ErrorInPrototype (const char *error) { std::cerr << "Error in prototype!\n last_token_index = " << lastTokenIndex_ << "\n error: " << error << "\n"; return 0; } AST::Function *Parser::ErrorInFunction (const char *error) { std::cerr << "Error in function!\n last_token_index = " << lastTokenIndex_ << "\n error: " << error << "\n"; return 0; } AST::Number *Parser::ParseNumber () { std::cout << "Parsing number... "; assert (currentToken_.token_ == Lexer::TOKEN_NUMBER); AST::Number *result = new AST::Number (currentToken_.additionalData_); std::cout << currentToken_.additionalData_ << " done\n"; EatToken (); return result; } AST::Expression *Parser::ParseParentBrackets () { std::cout << "Parsing parent brackets..."; assert (currentToken_.token_ == Lexer::TOKEN_OPERATOR); assert (currentToken_.additionalData_ == "("); EatToken (); if (isListed_) return ErrorInExpression ("')' expected, but end of input reached!"); if (currentToken_.token_ == Lexer::TOKEN_OPERATOR && currentToken_.additionalData_ == ")") return ErrorInExpression ("empty parent brackets '()'!"); AST::Expression *expressionInBrackers = ParseExpression (); if (!expressionInBrackers) return 0; if (currentToken_.token_ != Lexer::TOKEN_OPERATOR || currentToken_.additionalData_ != ")") return ErrorInExpression ("')' expected!"); EatToken (); std::cout << "done\n"; return expressionInBrackers; } AST::Expression *Parser::ParseIdentifier () { std::cout << "Parsing identifier..."; assert (currentToken_.token_ == Lexer::TOKEN_IDENTIFIER); std::string identifier = currentToken_.additionalData_; std::cout << identifier; EatToken (); if (currentToken_.token_ == Lexer::TOKEN_OPERATOR && currentToken_.additionalData_ == "(") { std::cout << " as function call...\n"; EatToken (); if (isListed_) return ErrorInExpression ("call arguments and ')' expected, but end of input reached!"); std::vector <AST::Expression *> arguments; std::cout << "Parsing arguments...\n"; if (currentToken_.token_ != Lexer::TOKEN_OPERATOR || currentToken_.additionalData_ != ")") { while (true) { AST::Expression *argument = ParseExpression (); if (!argument) return 0; arguments.push_back (argument); if (isListed_) return ErrorInExpression ("call arguments and ')' expected, but end of input reached!"); if (currentToken_.token_ == Lexer::TOKEN_OPERATOR && currentToken_.additionalData_ == ")") break; if (currentToken_.token_ != Lexer::TOKEN_OPERATOR || currentToken_.additionalData_ != ",") return ErrorInExpression ("',' or ')' expected!" ); EatToken (); } } std::cout << "done\n"; EatToken (); std::cout << "done\n"; return new AST::Call (identifier, arguments); } else { std::cout << " as variable reference...done\n"; return new AST::Variable (identifier); } } AST::Expression *Parser::ParsePrimary () { std::cout << "Parsing as primary...\n"; assert (!isListed_); if (currentToken_.token_ == Lexer::TOKEN_NUMBER) return ParseNumber (); else if (currentToken_.token_ == Lexer::TOKEN_OPERATOR && currentToken_.additionalData_ == "(") return ParseParentBrackets (); else if (currentToken_.token_ == Lexer::TOKEN_IDENTIFIER) return ParseIdentifier (); else return ErrorInExpression ("unknown token when expecting an expression!"); } AST::Expression *Parser::ParseExpression (int expressionPrecedence) { std::cout << "Parsing expression with start in token " << lastTokenIndex_ << "...\n"; AST::Expression *left = ParsePrimary (); if (!left) return 0; return ParseTwoArgumentOperatorRight (expressionPrecedence, left); } AST::Expression *Parser::ParseTwoArgumentOperatorRight (int expressionPrecedence, AST::Expression *left) { while (true) { std::cout << "Parsing two argument operator...\n"; std::cout << "Expression precedence: " << expressionPrecedence << "\n"; int operatorPrecedence = -1; if (currentToken_.token_ == Lexer::TOKEN_OPERATOR) operatorPrecedence = GetOperatorPrecedence (currentToken_.additionalData_); std::cout << "Operator: " << currentToken_.additionalData_ << " with precedence " << operatorPrecedence << "\n"; if (operatorPrecedence < expressionPrecedence) return left; std::string binaryOperatorName = currentToken_.additionalData_; EatToken (); AST::Expression *right = ParseExpression (operatorPrecedence); if (!right) return 0; int nextOperatorPrecedence = -1; if (currentToken_.token_ == Lexer::TOKEN_OPERATOR) nextOperatorPrecedence = GetOperatorPrecedence (currentToken_.additionalData_); std::cout << "Next operator: " << currentToken_.additionalData_ << " with precedence " << nextOperatorPrecedence << "\n"; if (operatorPrecedence < nextOperatorPrecedence) { std::cout << "Parsing next operator args..."; right = ParseTwoArgumentOperatorRight (operatorPrecedence + 1, right); if (!right) return 0; } std::cout << "Done, creating two argument operator AST value.."; left = new AST::TwoArgumentsOperator (binaryOperatorName, left, right); } } AST::Prototype *Parser::ParsePrototype () { std::cout << "Parsing prototype...\n"; if (currentToken_.token_ != Lexer::TOKEN_IDENTIFIER) return ErrorInPrototype ("expected function name in prototype!"); std::string functionName = currentToken_.additionalData_; std::cout << "Prototype function name: " << functionName << "\n"; EatToken (); if (currentToken_.token_ != Lexer::TOKEN_OPERATOR || currentToken_.additionalData_ != "(") return ErrorInPrototype ("expected '(' in prototype!"); EatToken (); std::vector <std::string> argumentsNames; std::cout << "Reading arguments...\n"; while (currentToken_.token_ == Lexer::TOKEN_IDENTIFIER) { argumentsNames.push_back (currentToken_.additionalData_); std::cout << "Found argument: " << currentToken_.additionalData_ << "\n"; EatToken (); if (currentToken_.token_ == Lexer::TOKEN_OPERATOR && currentToken_.additionalData_ == ")") break; if (currentToken_.token_ != Lexer::TOKEN_OPERATOR || currentToken_.additionalData_ != ",") return ErrorInPrototype ("',' expected before next argument name!"); else EatToken (); } std::cout << "Arguments readed!\n"; if (currentToken_.token_ != Lexer::TOKEN_OPERATOR || currentToken_.additionalData_ != ")") return ErrorInPrototype ("')' expected in the end of prototype!"); EatToken (); std::cout << "Prototype successfully readed!\n"; return new AST::Prototype (functionName, argumentsNames); } AST::Function *Parser::ParseFunctionDefinition () { std::cout << "Parsing function definition...\n"; assert (currentToken_.token_ == Lexer::TOKEN_DEF_COMMAND); EatToken (); std::cout << "Parsing prototype...\n"; AST::Prototype *prototype = ParsePrototype (); if (!prototype) return 0; std::cout << "Parsing body...\n"; AST::Expression *body = ParseExpression (); if (body) { std::cout << "done\n"; return new AST::Function (prototype, body); } else return 0; } AST::Prototype *Parser::ParseExtern () { assert (currentToken_.token_ == Lexer::TOKEN_EXTERN_COMMAND); std::cout << "Parsing extern...\n"; EatToken (); return ParsePrototype (); } AST::Function *Parser::ParseTopLevelExpression () { std::cout << "Parsing top-level expression...\n"; AST::Expression *expression = ParseExpression (); if (expression) { AST::Prototype *prototype = new AST::Prototype ("", std::vector <std::string> ()); return new AST::Function (prototype, expression); } else return 0; } Parser::Parser () { isListed_ = false; binaryOperatorsPrecedence_ ["*"] = 2000; binaryOperatorsPrecedence_ ["/"] = 2000; binaryOperatorsPrecedence_ ["%"] = 2000; //TODO: Not supported by LLVM generator now. binaryOperatorsPrecedence_ ["+"] = 1700; binaryOperatorsPrecedence_ ["-"] = 1700; binaryOperatorsPrecedence_ ["<"] = 1500; binaryOperatorsPrecedence_ [">"] = 1400; binaryOperatorsPrecedence_ ["<="] = 1300; binaryOperatorsPrecedence_ [">="] = 1200; binaryOperatorsPrecedence_ ["=="] = 1100; binaryOperatorsPrecedence_ ["!="] = 1000; binaryOperatorsPrecedence_ ["&&"] = 900; //TODO: Not supported by LLVM generator now. binaryOperatorsPrecedence_ [ "||"] = 800; //TODO: Not supported by LLVM generator now. binaryOperatorsPrecedence_ ["="] = 700; //TODO: Not supported by LLVM generator now. binaryOperatorsPrecedence_ ["*="] = 600; //TODO: Not supported by LLVM generator now. binaryOperatorsPrecedence_ ["/="] = 500; //TODO: Not supported by LLVM generator now. binaryOperatorsPrecedence_ ["%="] = 400; //TODO: Not supported by LLVM generator now. binaryOperatorsPrecedence_ ["+="] = 300; //TODO: Not supported by LLVM generator now. binaryOperatorsPrecedence_ ["-="] = 200; //TODO: Not supported by LLVM generator now. } AST::TreeNode *Parser::Parse (std::vector <Lexer::TokenData> tokens, bool &resultOutput) { currentTokensList_ = tokens; lastTokenIndex_ = -1; isListed_ = false; EatToken (); AST::TreeNode *rootNode = new AST::TreeNode (); bool isErrored = false; while (!isListed_ && !isErrored) { AST::TreeValue *nextValue = 0; std::cout << "\nParsing new tree value from token " << lastTokenIndex_ << ":\n"; if (currentToken_.token_ == Lexer::TOKEN_EXTERN_COMMAND) nextValue = ParseExtern (); else if (currentToken_.token_ == Lexer::TOKEN_DEF_COMMAND) nextValue = ParseFunctionDefinition (); else nextValue = ParseTopLevelExpression (); if (!nextValue) { std::cout << "Parsing stopped by error!\n"; isErrored = true; } else rootNode->PushValue (nextValue); } if (isErrored) resultOutput = false; else resultOutput = true; return rootNode; } Parser::~Parser() { } } }
33.834758
129
0.623611
KonstantinTomashevich
3a5e0c10a393e2a094f6e4aa5684b3ac7a5e3c74
7,968
cpp
C++
src/pgen/03_test_turb_sn.cpp
zunyibrt/athena_snclouds
f0faca6486844ed5080b37d9db50f8f9c18b55d6
[ "BSD-3-Clause" ]
null
null
null
src/pgen/03_test_turb_sn.cpp
zunyibrt/athena_snclouds
f0faca6486844ed5080b37d9db50f8f9c18b55d6
[ "BSD-3-Clause" ]
null
null
null
src/pgen/03_test_turb_sn.cpp
zunyibrt/athena_snclouds
f0faca6486844ed5080b37d9db50f8f9c18b55d6
[ "BSD-3-Clause" ]
null
null
null
//======================================================================================== // Athena++ astrophysical MHD code // Copyright(C) 2014 James M. Stone <jmstone@princeton.edu> and other code contributors // Licensed under the 3-clause BSD License, see LICENSE file for details //======================================================================================== //! \file turb.cpp //! \brief Problem generator for turbulence driver // C headers // C++ headers #include <cmath> #include <ctime> #include <sstream> #include <stdexcept> // Athena++ headers #include "../athena.hpp" #include "../athena_arrays.hpp" #include "../coordinates/coordinates.hpp" #include "../eos/eos.hpp" #include "../fft/athena_fft.hpp" #include "../field/field.hpp" #include "../globals.hpp" #include "../hydro/hydro.hpp" #include "../mesh/mesh.hpp" #include "../parameter_input.hpp" #include "../utils/utils.hpp" #include "../utils/sn_injection.hpp" #ifdef OPENMP_PARALLEL #include <omp.h> #endif // User defined source functions void sn_injection(MeshBlock *pmb, const Real time, const Real dt, const AthenaArray<Real> &prim, const AthenaArray<Real> &prim_scalar, const AthenaArray<Real> &bcc, AthenaArray<Real> &cons, AthenaArray<Real> &cons_scalar); // User defined history functions Real CalculateSNEnergyInjection(MeshBlock *pmb, int iout); Real CalculateSNMassInjection(MeshBlock *pmb, int iout); Real CalculateSNVolumeInjection(MeshBlock *pmb, int iout); // Code Units (cgs) static Real const amu = 1.6605e-24; // atomic mass unit (g) static Real const kb = 1.380648e-16; // boltzmann constant (erg/K) static Real const mu = 0.6173; // mean molecular weight (Solar) // X = 0.7; Z = 0.02 static Real const unit_len = 3.086e20; // 100 pc static Real const unit_temp = 1.0e4; // 10^4 K static Real const unit_n = 1.0; // cm^-3 static Real const unit_rho = unit_n * amu * mu; static Real const unit_mass = unit_rho * std::pow(unit_len,3); static Real const unit_pres = kb * unit_n * unit_temp; static Real const unit_engy = unit_pres * std::pow(unit_len,3); static Real const unit_vel = std::sqrt(unit_pres / unit_rho); static Real const unit_time = unit_len / unit_vel; static Real const unit_kap = (unit_pres * unit_len * unit_len) / (unit_time * unit_temp); static Real const unit_gam = (unit_pres/unit_time)/(unit_n*unit_n); // Globals static std::vector<Real> sn_times; static int next_sn_idx; static Real r_inj,e_sn,m_ej; //======================================================================================== //! \fn void Mesh::InitUserMeshData(ParameterInput *pin) // \brief //======================================================================================== void Mesh::InitUserMeshData(ParameterInput *pin) { // turb_flag is initialzed in the Mesh constructor to 0 by default; // turb_flag = 1 for decaying turbulence // turb_flag = 2 for impulsively driven turbulence // turb_flag = 3 for continuously driven turbulence turb_flag = pin->GetInteger("problem","turb_flag"); if (turb_flag != 0) { #ifndef FFT std::stringstream msg; msg << "### FATAL ERROR in TurbulenceDriver::TurbulenceDriver" << std::endl << "non zero Turbulence flag is set without FFT!" << std::endl; ATHENA_ERROR(msg); return; #endif } EnrollUserExplicitSourceFunction(sn_injection); // Generate SN times with M_cluster and tlim next_sn_idx = 0; Real cluster_mass = pin->GetOrAddReal("SN","M_cluster",1e6); sn_times = get_sn_times(cluster_mass,pin->GetReal("SN","tlim")); // Compute E and M injection densities from injection radius r_inj = pin->GetReal("SN","r_inj"); // Input in code unis Real sphere_vol = (4.0/3.0)*PI*std::pow(r_inj,3); e_sn = pin->GetOrAddReal("SN","E_sn",std::pow(10,51)/unit_engy)/sphere_vol; // Input in ergs m_ej = pin->GetOrAddReal("SN","M_ej",8.4*1.988e33/unit_mass)/sphere_vol; // Input in solar mass std::cout << M_ej // Enroll user defined history outputs AllocateUserHistoryOutput(3); EnrollUserHistoryOutput(0,CalculateSNEnergyInjection,"SNEnergyInjection"); EnrollUserHistoryOutput(1,CalculateSNMassInjection,"SNMassInjection"); EnrollUserHistoryOutput(2,CalculateSNVolumeInjection,"SNVolumeInjection"); return; } void MeshBlock::InitUserMeshBlockData(ParameterInput *pin) { AllocateUserOutputVariables(3); } //======================================================================================== //! \fn void MeshBlock::ProblemGenerator(ParameterInput *pin) // \brief //======================================================================================== void MeshBlock::ProblemGenerator(ParameterInput *pin) { Real rho = pin->GetReal("problem","rho"); Real temp = pin->GetReal("problem","temp"); for (int k=ks; k<=ke; k++) { for (int j=js; j<=je; j++) { for (int i=is; i<=ie; i++) { phydro->u(IDN,k,j,i) = rho; phydro->u(IM1,k,j,i) = 0.0; phydro->u(IM2,k,j,i) = 0.0; phydro->u(IM3,k,j,i) = 0.0; phydro->u(IEN,k,j,i) = rho*temp/((5.0/3.0)-1.0); } } } } //======================================================================================== //! \fn void Mesh::UserWorkAfterLoop(ParameterInput *pin) // \brief //======================================================================================== void Mesh::UserWorkAfterLoop(ParameterInput *pin) { } // User Defined SN Function void sn_injection(MeshBlock *pmb, const Real time, const Real dt, const AthenaArray<Real> &prim, const AthenaArray<Real> &prim_scalar, const AthenaArray<Real> &bcc, AthenaArray<Real> &cons, AthenaArray<Real> &cons_scalar) { if (time > sn_times.at(next_sn_idx)) { for (int k=pmb->ks; k<=pmb->ke; ++k) { for (int j=pmb->js; j<=pmb->je; ++j) { for (int i=pmb->is; i<=pmb->ie; ++i) { Real x = pmb->pcoord->x1v(i); Real y = pmb->pcoord->x2v(j); Real z = pmb->pcoord->x3v(k); if (SQR(x) + SQR(y) + SQR(z) < SQR(r_inj)) { // Inject energy and mass into cell cons(IEN,k,j,i) += e_sn; cons(IDN,k,j,i) += m_ej; // Store the changes in a user defined output variable pmb->user_out_var(0,k,j,i) += e_sn; pmb->user_out_var(1,k,j,i) += m_ej; pmb->user_out_var(2,k,j,i) += 1.0; } } } } next_sn_idx++; } return; } // User defined history functions Real CalculateSNEnergyInjection(MeshBlock *pmb, int iout) { int is=pmb->is, ie=pmb->ie, js=pmb->js, je=pmb->je, ks=pmb->ks, ke=pmb->ke; AthenaArray<Real> vol(pmb->ncells1); Real sum = 0.0; for (int k=ks; k<=ke; k++) { for (int j=js; j<=je; j++) { pmb->pcoord->CellVolume(k,j,is,ie,vol); for (int i=is; i<=ie; i++) { sum += pmb->user_out_var(0,k,j,i)*vol(i); } }} return sum; } Real CalculateSNMassInjection(MeshBlock *pmb, int iout) { int is=pmb->is, ie=pmb->ie, js=pmb->js, je=pmb->je, ks=pmb->ks, ke=pmb->ke; AthenaArray<Real> vol(pmb->ncells1); Real sum = 0.0; for (int k=ks; k<=ke; k++) { for (int j=js; j<=je; j++) { pmb->pcoord->CellVolume(k,j,is,ie,vol); for (int i=is; i<=ie; i++) { sum += pmb->user_out_var(1,k,j,i)*vol(i); } }} return sum; } Real CalculateSNVolumeInjection(MeshBlock *pmb, int iout) { int is=pmb->is, ie=pmb->ie, js=pmb->js, je=pmb->je, ks=pmb->ks, ke=pmb->ke; AthenaArray<Real> vol(pmb->ncells1); Real sum = 0.0; for (int k=ks; k<=ke; k++) { for (int j=js; j<=je; j++) { pmb->pcoord->CellVolume(k,j,is,ie,vol); for (int i=is; i<=ie; i++) { sum += pmb->user_out_var(2,k,j,i)*vol(i); } }} return sum; }
33.338912
98
0.567897
zunyibrt
3a65754f15dd6d962d17dd4e924af4790dbf3d9e
795
hpp
C++
test/00-Common/Src/Camera.hpp
DragonJoker/Ashes
a6ed950b3fd8fb9626c60b4291fbd52ea75ac66e
[ "MIT" ]
227
2018-09-17T16:03:35.000Z
2022-03-19T02:02:45.000Z
test/00-Common/Src/Camera.hpp
DragonJoker/RendererLib
0f8ad8edec1b0929ebd10247d3dd0a9ee8f8c91a
[ "MIT" ]
39
2018-02-06T22:22:24.000Z
2018-08-29T07:11:06.000Z
test/00-Common/Src/Camera.hpp
DragonJoker/Ashes
a6ed950b3fd8fb9626c60b4291fbd52ea75ac66e
[ "MIT" ]
8
2019-05-04T10:33:32.000Z
2021-04-05T13:19:27.000Z
#pragma once #include "Prerequisites.hpp" namespace vkapp { class Camera { public: void update(); inline void reset() { m_position = utils::Vec3{}; m_rotation = utils::Quaternion{}; } inline void translate( utils::Vec3 const & value ) { m_position += value; } inline void rotate( utils::Quaternion const & value ) { m_rotation *= value; } inline utils::Mat4 const & getView()const { return m_transform; } inline utils::Vec3 const & getPosition()const { return m_position; } inline utils::Quaternion const & getRotation()const { return m_rotation; } inline utils::Quaternion & getRotation() { return m_rotation; } private: utils::Vec3 m_position; utils::Quaternion m_rotation; utils::Mat4 m_transform; }; }
14.722222
55
0.654088
DragonJoker
3a666ae84aab7a31cde136ba2b10e74a70ec0aa5
739
cpp
C++
AcCoRD2/src/passive_actor_no_shape.cpp
Jackrekirby/AcCoRD2
d712b3f7e73f32dc1894fcb79bec4510a13a9dce
[ "MIT" ]
null
null
null
AcCoRD2/src/passive_actor_no_shape.cpp
Jackrekirby/AcCoRD2
d712b3f7e73f32dc1894fcb79bec4510a13a9dce
[ "MIT" ]
null
null
null
AcCoRD2/src/passive_actor_no_shape.cpp
Jackrekirby/AcCoRD2
d712b3f7e73f32dc1894fcb79bec4510a13a9dce
[ "MIT" ]
null
null
null
// The AcCoRD 2 Simulator (Actor - based Communication via Reaction - Diffusion) // Copyright 2021 Jack Kirby. All rights reserved. // For license details, read LICENSE.txt in the root AcCoRD2 directory #include "pch.h" #include "passive_actor_no_shape.h" namespace accord { PassiveActorNoShape::PassiveActorNoShape() { } bool PassiveActorNoShape::IsMoleculeInsideBorder(const Vec3d& position) const { return false; } bool PassiveActorNoShape::IsSubvolumeInsideBorder(const shape::relation::Box& box) const { return false; } bool PassiveActorNoShape::IsSubvolumeOverlappingBorder(const shape::relation::Box& box) const { return false; } void PassiveActorNoShape::ToJson(Json& j) const { j = "Shapeless"; } }
21.114286
94
0.752368
Jackrekirby
3a668554f7f9290e5d42bcd53422d131c2c6a034
7,914
cpp
C++
tests/ocltst/module/perf/OCLPerfImageReadWrite.cpp
jpsamaroo/ROCm-OpenCL-Runtime
875c1f8b4741a7285757a9bc7e98405bc202785a
[ "MIT" ]
7
2022-03-23T07:04:20.000Z
2022-03-30T02:44:42.000Z
tests/ocltst/module/perf/OCLPerfImageReadWrite.cpp
jpsamaroo/ROCm-OpenCL-Runtime
875c1f8b4741a7285757a9bc7e98405bc202785a
[ "MIT" ]
null
null
null
tests/ocltst/module/perf/OCLPerfImageReadWrite.cpp
jpsamaroo/ROCm-OpenCL-Runtime
875c1f8b4741a7285757a9bc7e98405bc202785a
[ "MIT" ]
null
null
null
/* Copyright (c) 2010-present Advanced Micro Devices, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "OCLPerfImageReadWrite.h" #include <assert.h> #include <stdio.h> #include <string.h> #include "CL/opencl.h" #include "Timer.h" // Quiet pesky warnings #ifdef WIN_OS #define SNPRINTF sprintf_s #else #define SNPRINTF snprintf #endif #define KERNEL_CODE(...) #__VA_ARGS__ #define NUM_SIZES 4 static const unsigned int Sizes[NUM_SIZES] = {256, 512, 1024, 2048}; #if defined(CL_VERSION_2_0) #define NUM_FORMATS 2 static const cl_image_format formats[NUM_FORMATS] = { {CL_RGBA, CL_UNSIGNED_INT8}, {CL_sRGBA, CL_UNORM_INT8}}; static const char *textFormats[NUM_FORMATS] = {"CL_RGBA , CL_UNSIGNED_INT8", "CL_sRGBA, CL_UNORM_INT8 "}; static const unsigned int formatSize[NUM_FORMATS] = {sizeof(CL_UNSIGNED_INT8), sizeof(CL_UNORM_INT8)}; #else #define NUM_FORMATS 1 static const cl_image_format formats[NUM_FORMATS] = { {CL_RGBA, CL_UNSIGNED_INT8}}; static const char *textFormats[NUM_FORMATS] = {"CL_RGBA , CL_UNSIGNED_INT8"}; static const unsigned int formatSize[NUM_FORMATS] = {sizeof(CL_UNSIGNED_INT8)}; #endif const static char *strKernel = {KERNEL_CODE( \n __constant sampler_t s_nearest = CLK_FILTER_NEAREST | CLK_NORMALIZED_COORDS_FALSE | CLK_ADDRESS_CLAMP_TO_EDGE; \n __kernel void image_kernel(read_write image2d_t image, uint zero) { int x = get_global_id(0); int y = get_global_id(1); int offset = y * get_image_width(image) + x; int2 coords = (int2)(x, y); uint4 tmp = read_imageui(image, s_nearest, coords); write_imageui(image, coords, 1 + tmp * zero); } \n)}; OCLPerfImageReadWrite::OCLPerfImageReadWrite() { _numSubTests = NUM_SIZES * NUM_FORMATS; } OCLPerfImageReadWrite::~OCLPerfImageReadWrite() {} static void CL_CALLBACK notify_callback(const char *errinfo, const void *private_info, size_t cb, void *user_data) {} void OCLPerfImageReadWrite::setData(void *ptr, unsigned int size, unsigned int value) { unsigned int *ptr2 = (unsigned int *)ptr; for (unsigned int i = 0; i < size >> 2; i++) { ptr2[i] = value; value++; } } void OCLPerfImageReadWrite::open(unsigned int test, char *units, double &conversion, unsigned int deviceId) { error_ = CL_SUCCESS; testId_ = test; OCLTestImp::open(test, units, conversion, deviceId); CHECK_RESULT((error_ != CL_SUCCESS), "Error opening test"); program_ = 0; kernel_ = 0; cmd_queue_ = 0; imageBuffer_ = 0; skip_ = false; // check device version size_t param_size = 0; char *strVersion = 0; error_ = _wrapper->clGetDeviceInfo( devices_[_deviceId], CL_DEVICE_OPENCL_C_VERSION, 0, 0, &param_size); CHECK_RESULT(error_ != CL_SUCCESS, "clGetDeviceInfo failed"); strVersion = new char[param_size]; error_ = _wrapper->clGetDeviceInfo(devices_[_deviceId], CL_DEVICE_OPENCL_C_VERSION, param_size, strVersion, 0); CHECK_RESULT(error_ != CL_SUCCESS, "clGetDeviceInfo failed"); if (strVersion[9] < '2') { skip_ = true; testDescString = "Image read_write qualifier not supported in OpenCL C < 2.0. Test " "Skipped."; delete strVersion; return; } delete strVersion; bufSize_ = Sizes[test % NUM_SIZES]; bufnum_ = (test / NUM_SIZES) % NUM_FORMATS; memSize = bufSize_ * bufSize_ * formatSize[bufnum_]; numIter = 100; memptr = new char[memSize]; cmd_queue_ = cmdQueues_[_deviceId]; program_ = _wrapper->clCreateProgramWithSource(context_, 1, &strKernel, NULL, &error_); CHECK_RESULT((error_ != CL_SUCCESS), "clCreateProgramWithSource() failed"); error_ = _wrapper->clBuildProgram(program_, 1, &devices_[deviceId], "-cl-std=CL2.0", NULL, NULL); if (error_ != CL_SUCCESS) { char programLog[1024]; _wrapper->clGetProgramBuildInfo(program_, devices_[deviceId], CL_PROGRAM_BUILD_LOG, 1024, programLog, 0); printf("\n%s\n", programLog); fflush(stdout); } CHECK_RESULT((error_ != CL_SUCCESS), "clBuildProgram() failed"); kernel_ = _wrapper->clCreateKernel(program_, "image_kernel", &error_); CHECK_RESULT((error_ != CL_SUCCESS), "clCreateKernel() failed"); // create image setData(memptr, memSize, 0x0); imageBuffer_ = _wrapper->clCreateImage2D( context_, CL_MEM_READ_WRITE | CL_MEM_USE_HOST_PTR, &formats[bufnum_], bufSize_, bufSize_, 0, memptr, &error_); CHECK_RESULT(error_ != CL_SUCCESS, "clCreateImage2D() failed"); const unsigned int zero = 0; // set kernel arguments error_ = _wrapper->clSetKernelArg(kernel_, 0, sizeof(cl_mem), &imageBuffer_); CHECK_RESULT((error_ != CL_SUCCESS), "clSetKernelArg() failed"); error_ = _wrapper->clSetKernelArg(kernel_, 1, sizeof(unsigned int), &zero); CHECK_RESULT((error_ != CL_SUCCESS), "clSetKernelArg() failed"); } void OCLPerfImageReadWrite::run(void) { if (skip_) { return; } CPerfCounter timer; size_t gws[2] = {bufSize_, bufSize_}; size_t lws[2] = {8, 8}; error_ = _wrapper->clEnqueueNDRangeKernel(cmd_queue_, kernel_, 2, NULL, gws, lws, 0, NULL, NULL); CHECK_RESULT((error_ != CL_SUCCESS), "clEnqueueNDRangeKernel() failed"); _wrapper->clFinish(cmd_queue_); timer.Reset(); timer.Start(); for (unsigned int i = 0; i < numIter; ++i) { error_ = _wrapper->clEnqueueNDRangeKernel(cmd_queue_, kernel_, 2, NULL, gws, lws, 0, NULL, NULL); CHECK_RESULT((error_ != CL_SUCCESS), "clEnqueueNDRangeKernel() failed"); _wrapper->clFinish(cmd_queue_); } timer.Stop(); double sec = timer.GetElapsedTime(); // speed in GB/s double perf = ((double)memSize * numIter * (double)(1e-09)) * 2 / sec; _perfInfo = (float)perf; char buf[256]; unsigned int fmt_num = (testId_ / NUM_SIZES) % NUM_FORMATS; SNPRINTF(buf, sizeof(buf), " (%4dx%4d) fmt:%s(%1d) i: %4d (GB/s) ", bufSize_, bufSize_, textFormats[fmt_num], formatSize[bufnum_], numIter); testDescString = buf; } unsigned int OCLPerfImageReadWrite::close(void) { if (!skip_) { if (memptr) { delete memptr; } if (imageBuffer_) { error_ = _wrapper->clReleaseMemObject(imageBuffer_); CHECK_RESULT_NO_RETURN(error_ != CL_SUCCESS, "clReleaseMemObject(imageBuffer_) failed"); } } return OCLTestImp::close(); }
35.330357
116
0.651756
jpsamaroo
3a680558fb9748b2fe804d11555e879f291a5077
3,375
cpp
C++
+sl/+array/+indices/private/mex_ismember_tol.cpp
JimHokanson/matlab_standard_library
b474cce3c70397f9695aa75cd293546734bd39ef
[ "MIT" ]
4
2015-07-08T21:53:37.000Z
2020-04-08T18:15:06.000Z
+sl/+array/+indices/private/mex_ismember_tol.cpp
JimHokanson/matlab_standard_library
b474cce3c70397f9695aa75cd293546734bd39ef
[ "MIT" ]
41
2015-02-19T12:45:57.000Z
2020-03-29T18:29:49.000Z
+sl/+array/+indices/private/mex_ismember_tol.cpp
JimHokanson/matlab_standard_library
b474cce3c70397f9695aa75cd293546734bd39ef
[ "MIT" ]
5
2015-03-27T00:47:39.000Z
2020-06-08T03:29:36.000Z
#include "mex.h" #include "matrix.h" #include <algorithm> #include <cmath> #include "MexSupport.h" #include "MexAlgorithmSupport.h" #include "MexDataTypes.h" using namespace std; using namespace MexSupport; void print_usage(); void mexFunction(int nlhs, mxArray** plhs, int nrhs, const mxArray * prhs[]) { if(nrhs < 3) { print_usage(); return; } double* pA = mxGetPr(prhs[0]); double* pB = mxGetPr(prhs[1]); double tol = *mxGetPr(prhs[2]); bool one_sided = false; int tol_sign = 1; if( nrhs > 3 ) { one_sided = *mxGetLogicals(prhs[3]); tol_sign = (tol > 0 ? 1 : -1); tol = fabs(tol); } int nA = mxGetNumberOfElements(prhs[0]); int nB = mxGetNumberOfElements(prhs[1]); // sort inputs. requires deep copy of input double *pA_sort(0x0); MexUInt32 *pA_idx(0x0); sort_with_index(pA,nA,pA_sort,pA_idx); double *pB_sort(0x0); MexUInt32 *pB_idx(0x0); sort_with_index(pB,nB,pB_sort,pB_idx); bool* pMask = (bool*)mxMalloc(sizeof(bool)*nA); double* pIdx = (double*)mxMalloc(sizeof(double)*nA); int iiB = 0; int last_break = 0; double err(0.0); bool match(false); for(int iiA = 0; iiA < nA; iiA++) { match = false; // The following loop iterates until either a match is found or the // current element of A is significantly less than that of B. This // relies on A & B having been sorted, see above. for(iiB = last_break; iiB < nB; iiB++) { err = pA_sort[iiA] - pB_sort[iiB]; if(err < -tol) { // A is significantly less than B. Because both vectors // are sorted and we are increasing B there is no need to keep // searching, this value will not be found last_break = iiB; break; } else if(err > tol) { // A is significantly larger than B, this is ok because the // vectors are sorted and we are iterating up B until the // two values are close } else { // match found // if one_sided check that the sign of the err matches the // sign of the tolerance value if(!one_sided || (one_sided && err*tol_sign > 0)) { match = true; break; } } } if( match ) { pIdx[(int)pA_idx[iiA]] = pB_idx[iiB]+1; pMask[(int)pA_idx[iiA]] = true; last_break = iiB; } else { pIdx[(int)pA_idx[iiA]] = 0; pMask[(int)pA_idx[iiA]] = false; } } pMask = (bool*)mxRealloc(pMask, nA*sizeof(bool)); assignToMxArray(pMask, 1, nA, plhs[0]); if(nlhs > 1 ) { pIdx = (double*)mxRealloc(pIdx, nA*sizeof(double)); assignToMxArray(pIdx, 1, nA, plhs[1]); } else { mxFree(pIdx); } mxFree(pA_sort); mxFree(pA_idx); mxFree(pB_sort); mxFree(pB_idx); } void print_usage() { mexPrintf("mex_setdiff_tol(A,B,tolerance)\n"); }
29.347826
79
0.507556
JimHokanson