blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 4 201 | content_id stringlengths 40 40 | detected_licenses listlengths 0 85 | license_type stringclasses 2
values | repo_name stringlengths 7 100 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringclasses 260
values | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 11.4k 681M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 17
values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 80
values | src_encoding stringclasses 28
values | language stringclasses 1
value | is_vendor bool 1
class | is_generated bool 2
classes | length_bytes int64 8 9.86M | extension stringclasses 52
values | content stringlengths 8 9.86M | authors listlengths 1 1 | author stringlengths 0 119 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
17a85cda263dbf6f0adb14e68a7f4cecdb97e0e9 | c0e97b2955fd3434cdd751840043ad2cd545f46f | /TicTacToe/TicTacToe_TOFILL.cpp | f01e148daee5e697ec214d1f059c075f813198f1 | [] | no_license | jsberbel/ClubProgramacio | ee74a3ac931abec10758beb78a3f1b6beed20f03 | b1e26fbd7fab4bf8e0f5d7be131461ffda3e1f09 | refs/heads/master | 2016-09-13T11:26:03.070847 | 2016-04-26T23:02:07 | 2016-04-26T23:02:07 | 56,692,335 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,054 | cpp | #include <iostream>
using namespace std;
#define PLAYER1_TURN 0
#define PLAYER2_TURN 1
#define PLAYER1_MARK 'X'
#define PLAYER2_MARK 'O'
#define MAX_CELLS 9
enum GameState { PLAY, WINNER, EXIT };
// --------------------------------------------------------------- //
// GLOBAL VARIABLES
// --------------------------------------------------------------- //
char gameBoard[MAX_CELLS] = { '1','2','3','4','5','6','7','8','9' };
int player = PLAYER1_TURN;
char mark = PLAYER1_TURN;
GameState gameState = PLAY;
// --------------------------------------------------------------- //
// MAIN FUNCTIONS
// --------------------------------------------------------------- //
/* CheckWin returns de game status
- PLAY if game is in progress
- WINNER if game over and there's a winner
- EXIT if game is over and nobody wins */
GameState CheckWin() {
// TODO
return PLAY;
}
// DrawBoard prints the game board on the screen
void DrawBoard() {
system("cls");
cout << "//////////////////////////\n";
cout << "//\tTic Tac Toe\t//\n";
cout << "//////////////////////////\n\n";
cout << "Player 1 (X) - Player 2 (O)" << endl << endl;
cout << endl;
cout << " | | " << endl;
cout << " " << gameBoard[0] << " | " << gameBoard[1] << " | " << gameBoard[2] << endl;
cout << "_____|_____|_____" << endl;
cout << " | | " << endl;
cout << " " << gameBoard[3] << " | " << gameBoard[4] << " | " << gameBoard[5] << endl;
cout << "_____|_____|_____" << endl;
cout << " | | " << endl;
cout << " " << gameBoard[6] << " | " << gameBoard[7] << " | " << gameBoard[8] << endl;
cout << " | | " << endl << endl;
}
// DoLogic gets the player input and checks the character entered in order to put a mark
void DoLogic() {
// TODO
}
int main() {
while (gameState == PLAY) {
gameState = CheckWin();
DrawBoard();
DoLogic();
}
DrawBoard();
if (gameState == WINNER) cout << "==>\aPlayer " << player << " win " << endl;
else cout << "==>\aGame draw" << endl;
system("pause");
return 0;
} | [
"jsberbel95@gmail.com"
] | jsberbel95@gmail.com |
f162146737a286db474862a50955e1cff27b77b2 | d9ea45dbc964799991b9191ae620d2f150652a3d | /Backends/System/Wasm/Sources/kinc/backend/windowdata.h | 564060737d7826eca5cc731897cc1f0d47c9a838 | [
"Zlib"
] | permissive | Kode/Kinc | 6ebb1cfa11c6e9ed0e153c486f573f1d7dca5664 | d90b7478b192c8270e0ee32c0c3ee18977becd7a | refs/heads/main | 2023-08-08T16:50:01.534587 | 2023-08-07T20:22:46 | 2023-08-07T20:22:46 | 10,254,751 | 283 | 249 | Zlib | 2023-08-26T12:27:36 | 2013-05-23T22:22:58 | C | UTF-8 | C++ | false | false | 101 | h | #pragma once
namespace Kore {
struct WindowData {
int width, height, mode;
WindowData();
};
}
| [
"git2016@robdangero.us"
] | git2016@robdangero.us |
c5849fa2ab50612388782db8e47545a578cc0354 | cfeac52f970e8901871bd02d9acb7de66b9fb6b4 | /generated/src/aws-cpp-sdk-eventbridge/source/model/ListPartnerEventSourcesRequest.cpp | a3b3869f26fec114f0f65fb91166bd91972ac066 | [
"Apache-2.0",
"MIT",
"JSON"
] | permissive | aws/aws-sdk-cpp | aff116ddf9ca2b41e45c47dba1c2b7754935c585 | 9a7606a6c98e13c759032c2e920c7c64a6a35264 | refs/heads/main | 2023-08-25T11:16:55.982089 | 2023-08-24T18:14:53 | 2023-08-24T18:14:53 | 35,440,404 | 1,681 | 1,133 | Apache-2.0 | 2023-09-12T15:59:33 | 2015-05-11T17:57:32 | null | UTF-8 | C++ | false | false | 1,207 | cpp | /**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/eventbridge/model/ListPartnerEventSourcesRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::EventBridge::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
ListPartnerEventSourcesRequest::ListPartnerEventSourcesRequest() :
m_namePrefixHasBeenSet(false),
m_nextTokenHasBeenSet(false),
m_limit(0),
m_limitHasBeenSet(false)
{
}
Aws::String ListPartnerEventSourcesRequest::SerializePayload() const
{
JsonValue payload;
if(m_namePrefixHasBeenSet)
{
payload.WithString("NamePrefix", m_namePrefix);
}
if(m_nextTokenHasBeenSet)
{
payload.WithString("NextToken", m_nextToken);
}
if(m_limitHasBeenSet)
{
payload.WithInteger("Limit", m_limit);
}
return payload.View().WriteReadable();
}
Aws::Http::HeaderValueCollection ListPartnerEventSourcesRequest::GetRequestSpecificHeaders() const
{
Aws::Http::HeaderValueCollection headers;
headers.insert(Aws::Http::HeaderValuePair("X-Amz-Target", "AWSEvents.ListPartnerEventSources"));
return headers;
}
| [
"sdavtaker@users.noreply.github.com"
] | sdavtaker@users.noreply.github.com |
54b60e5cc3da0a161cb91acff9e7bab327a9722d | b75746d852236a867a72f717efcacb9a3e141250 | /examples/ASX/Event_Server/Event_Server/Event_Analyzer.h | 041592d0ab11b424d018a899c04f82d8f001c960 | [] | no_license | longfem/ACE-toolkit | e8c94cc1d75a2930ceba78dac13d1b84c0efecc8 | c1fedd5f2033951eee9ecf898f6f2b75584aaefc | refs/heads/master | 2021-06-01T06:54:56.916537 | 2016-08-17T14:36:01 | 2016-08-17T14:36:01 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,227 | h | /* -*- C++ -*- */
#ifndef _EVENT_ANALYZER_H
#define _EVENT_ANALYZER_H
#include "ace/Stream.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
#include "ace/Module.h"
#include "ace/Task.h"
class Event_Analyzer : public ACE_Task<ACE_SYNCH>
{
// = TITLE
// This class forwards all the <ACE_Message_Block>s it receives
// onto its neighboring Module in the Stream.
//
// = DESCRIPTION
// In a "real" event service, application-specific processing
// would be done in the <put> (or <svc>) method in this class.
public:
// = Initialization hooks called by <ACE_Stream> (not used).
virtual int open (void *a = 0);
virtual int close (u_long flags = 0);
virtual int put (ACE_Message_Block *msg,
ACE_Time_Value * = 0);
// Entry point into this task.
// Dynamic linking hooks (not used).
virtual int init (int argc, ACE_TCHAR *argv[]);
virtual int fini (void);
virtual int info (ACE_TCHAR **info_string,
size_t length) const;
private:
virtual int control (ACE_Message_Block *);
// Implements the watermark control processing.
};
#endif /* _EVENT_ANALYZER_H */
| [
"yehonal.azeroth@gmail.com"
] | yehonal.azeroth@gmail.com |
65e53815327045d8c27d098b122678f4c4f09a57 | 5365bc9a462933f01a4f9e82b4734cbfbf331466 | /Hw/Hw4/Boxes/boxtest3.cpp | a6c8d70731225b2ffa617a544abc52d2d662b562 | [] | no_license | 95jasonkim/cs202 | 4a62d69b45ba913b33aa74e16aa3b11c9f13f5cc | 0ccca5ec86b2cdb21673404498fb1ba74238e30b | refs/heads/master | 2023-04-16T08:41:08.333912 | 2021-04-25T05:52:44 | 2021-04-25T05:52:44 | 329,735,974 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 22,071 | cpp | // Box_test.cpp
// Chris Hartman, 9/23/2010
//
// Modified 10/2017
// For Boxes3 Homework in CS 202
// Includes for code to be tested
#include "box.hpp" // For class Box
#include "box.hpp" // Double inclusion test
// Includes for testing package & code common to all test programs
#include <iostream> // for std::cout, std::endl, std::cin
#include <string> // for std::string
#include <stdexcept> // for std::runtime_error
// Additional includes for this test program
#include <sstream> // for std::ostringstream
#include <memory> // for std::unique_ptr
// ************************************************************************
// Testing Package:
// Class Tester - For Tracking Tests
// ************************************************************************
// class Tester
// For extremely simple unit testing.
// Keeps track of number of tests and number of passes.
// Use test (with success/failure parameter) to do a test.
// Get results with numTests, numPassed, numFailed, allPassed.
// Restart testing with reset.
// Invariants:
// countTests_ == number of tests (calls to test) since last reset.
// countPasses_ == number of times function test called with true param
// since last reset.
// 0 <= countPasses_ <= countTests_.
// tolerance_ >= 0.
class Tester {
// ***** Tester: ctors, dctor, op= *****
public:
// Default ctor
// Sets countTests_, countPasses_ to zero, tolerance_ to given value
// Pre: None.
// Post:
// numTests == 0, countPasses == 0, tolerance_ == abs(theTolerance)
// Does not throw (No-Throw Guarantee)
Tester(double theTolerance = 0.0000001)
:countTests_(0),
countPasses_(0),
tolerance_(theTolerance >= 0 ? theTolerance : -theTolerance)
{}
// Compiler-generated copy ctor, copy op=, dctor are used
// ***** Tester: general public functions *****
public:
// test
// Handles single test, param indicates pass/fail
// Pre: None.
// Post:
// countTests_ incremented
// countPasses_ incremented if (success)
// Message indicating test name (if given)
// and pass/fail printed to cout
// Does not throw (No-Throw Guarantee)
// - Assuming exceptions have not been turned on for cout.
void test(bool success,
const std::string & testName = "")
{
++countTests_;
if (success) ++countPasses_;
std::cout << " ";
if (testName != "")
{
std::cout << "Test: "
<< testName
<< " - ";
}
std::cout << (success ? "passed" : "********** FAILED **********")
<< std::endl;
}
// ftest
// Does single floating-point test.
// Tests passes iff difference of first two values is <= tolerance.
// Pre: None.
// Post:
// countTests_ incremented
// countPasses_ incremented if (abs(val1-val2) <= tolerance_)
// Message indicating test name (if given)
// and pass/fail printed to cout
// Does not throw (No-Throw Guarantee)
void ftest(double val1,
double val2,
const std::string & testName = "")
{ test(val1-val2 <= tolerance_ && val2-val1 <= tolerance_, testName); }
// reset
// Resets *this to default constructed state
// Pre: None.
// Post:
// countTests_ == 0, countPasses_ == 0
// Does not throw (No-Throw Guarantee)
void reset()
{
countTests_ = 0;
countPasses_ = 0;
}
// numTests
// Returns the number of tests that have been done since last reset
// Pre: None.
// Post:
// return == countTests_
// Does not throw (No-Throw Guarantee)
int numTests() const
{ return countTests_; }
// numPassed
// Returns the number of tests that have passed since last reset
// Pre: None.
// Post:
// return == countPasses_
// Does not throw (No-Throw Guarantee)
int numPassed() const
{ return countPasses_; }
// numFailed
// Returns the number of tests that have not passed since last reset
// Pre: None.
// Post:
// return + countPasses_ == numTests_
// Does not throw (No-Throw Guarantee)
int numFailed() const
{ return countTests_ - countPasses_; }
// allPassed
// Returns true if all tests since last reset have passed
// Pre: None.
// Post:
// return == (countPasses_ == countTests_)
// Does not throw (No-Throw Guarantee)
bool allPassed() const
{ return countPasses_ == countTests_; }
// setTolerance
// Sets tolerance_ to given value
// Pre: None.
// Post:
// tolerance_ = abs(theTolerance)
// Does not throw (No-Throw Guarantee)
void setTolerance(double theTolerance)
{ tolerance_ = (theTolerance >= 0 ? theTolerance : -theTolerance); }
// ***** Tester: data members *****
private:
int countTests_; // Number of tests done since last reset
int countPasses_; // Number of tests passed since last reset
double tolerance_; // Tolerance for floating-point near-equality tests
}; // end class Tester
// ************************************************************************
// Testing Package:
// Class TypeCheck - Helper Class for Type Checking
// ************************************************************************
// class TypeCheck
// This class exists in order to have static member function check, which
// takes a parameter of a given type, by reference. Objects of type
// TypeCheck<T> cannot be created.
// Usage:
// TypeCheck<MyType>::check(x)
// returns true if the type of x is (MyType) or (const MyType),
// otherwise false.
// Invariants: None.
// Requirements on Types: None.
template<typename T>
class TypeCheck {
private:
// Uncopyable class. Do not define copy ctor, copy assn.
TypeCheck(const TypeCheck &);
TypeCheck<T> & operator=(const TypeCheck &);
// Compiler-generated dctor is used (but irrelevant).
public:
// check
// The function and function template below simulate a single function
// that takes a single parameter, and returns true iff the parameter has
// type T or (const T).
// check (reference-to-const T)
// Pre: None.
// Post:
// Return is true.
// Does not throw (No-Throw Guarantee)
static bool check(const T & param)
{ return true; }
// check (reference-to-const non-T)
// Pre: None.
// Post:
// Return is false.
// Requirements on types: None.
// Does not throw (No-Throw Guarantee)
template <typename OtherType>
static bool check(const OtherType & param)
{ return false; }
}; // End class TypeCheck
// ************************************************************************
// Testing Package:
// Class Counter - Helper Class for Counting Calls & Objects, Throwing
// ************************************************************************
// class Counter
// Item type for counting ctor, dctor, op= calls, counting existing
// objects, and possibly throwing on copy. Has operator< (which always
// returns false), allowing it to be the value type of a sorted container.
// If static member copyThrow_ is set, then copy ctor and copy assn throw
// std::runtime_error. Exception object's "what" member is set to "C" by
// the copy ctor and "A" by copy assn.
// Increments static data member ctorCount_ on default construction and
// successful copy construction. Increments static data member assnCount_
// on successful copy assignment. Increments static data member
// dctorCount_ on destruction.
// Increments static data member existing_ on construction, and decrements
// it on destruction.
// Static data member maxExisting_ is highest value of existing_ since last
// reset, or start of program if reset has never been called.
// Invariants:
// Counter::existing_ is number of existing objects of this class.
// Counter::ctorCount_ is number of successful ctor calls since
// most recent call to reset, or start of program if reset has never
// been called.
// Counter::dctorCount_ is (similarly) number of dctor calls.
// Counter::assnCount_ is (similarly) number of copy assn calls.
// Counter::maxExisting_ is (similarly) highest value existing_ has
// assumed.
class Counter {
// ***** Counter: Ctors, dctor, op= *****
public:
// Default ctor
// Pre: None.
// Post:
// (ctorCount_ has been incremented.)
// (existing_ has been incremented.)
// Does not throw (No-Throw Guarantee)
Counter()
{
++existing_;
if (existing_ > maxExisting_)
maxExisting_ = existing_;
++ctorCount_;
}
// Copy ctor
// Throws std::runtime_error if copyThrow_.
// Pre: None.
// Post:
// (ctorCount_ has been incremented.)
// (existing_ has been incremented.)
// May throw std::runtime_error
// Strong Guarantee
Counter(const Counter & other)
{
if (copyThrow_)
throw std::runtime_error("C");
++existing_;
if (existing_ > maxExisting_)
maxExisting_ = existing_;
++ctorCount_;
}
// Copy assignment
// Throws std::runtime_error if copyThrow_.
// Pre: None.
// Post:
// Return value is *this.
// (assnCount_ has been incremented.)
// May throw std::runtime_error
// Strong Guarantee
Counter & operator=(const Counter & rhs)
{
if (copyThrow_)
throw std::runtime_error("A");
++assnCount_;
return *this;
}
// Dctor
// Pre: None.
// Post:
// (dctorCount_ has been incremented.)
// (existing_ has been decremented.)
// Does not throw (No-Throw Guarantee)
~Counter()
{
--existing_;
++dctorCount_;
}
// ***** Counter: Functions dealing with count *****
public:
// reset
// Pre: None.
// Post:
// maxExisting_ == existing_.
// ctorCount_ == 0.
// dctorCount_ == 0.
// assnCount_ == 0.
// copyThrow_ == shouldThrow.
// Does not throw (No-Throw Guarantee)
static void reset(bool shouldThrow = false)
{
maxExisting_ = existing_;
ctorCount_ = 0;
dctorCount_ = 0;
assnCount_ = 0;
copyThrow_ = shouldThrow;
}
// getExisting
// Pre: None.
// Post:
// return == existing_.
// Does not throw (No-Throw Guarantee)
static int getExisting()
{ return existing_; }
// getMaxExisting
// Pre: None.
// Post:
// return == maxExisting_.
// Does not throw (No-Throw Guarantee)
static int getMaxExisting()
{ return maxExisting_; }
// getCtorCount
// Pre: None.
// Post:
// return == ctorCount_.
// Does not throw (No-Throw Guarantee)
static int getCtorCount()
{ return ctorCount_; }
// getDctorCount
// Pre: None.
// Post:
// return == dctorCount_.
// Does not throw (No-Throw Guarantee)
static int getDctorCount()
{ return dctorCount_; }
// getAssnCount
// Pre: None.
// Post:
// return == assnCount_.
// Does not throw (No-Throw Guarantee)
static int getAssnCount()
{ return assnCount_; }
// setCopyThrow
// Pre: None.
// Post:
// copyThrow_ == shouldThrow
// Does not throw (No-Throw Guarantee)
static void setCopyThrow(bool shouldThrow)
{ copyThrow_ = shouldThrow; }
// ***** Counter: Data Members *****
private:
static int existing_; // # of existing objects
static int maxExisting_; // Max # of existing objects
static int ctorCount_; // # of successful (non-throwing) ctor calls
static int dctorCount_; // # of dctor calls
static int assnCount_; // # of successful (non-throwing) copy = calls
static bool copyThrow_; // true if copy operations (ctor, =) throw
}; // End class Counter
// Definition of static data member of class Counter
int Counter::existing_ = 0;
int Counter::maxExisting_ = 0;
int Counter::ctorCount_ = 0;
int Counter::dctorCount_ = 0;
int Counter::assnCount_ = 0;
bool Counter::copyThrow_ = false;
// operator< (Counter)
// Dummy-ish operator<, forming a strict weak order for Counter class
// Returns false (which is legal for a strict weak order; all objects of
// type Counter are equivalent).
// Pre: None.
// Post:
// Return value == false.
// Does not throw (No-Throw Guarantee)
bool operator<(const Counter & a,
const Counter & b)
{ return false; }
// ************************************************************************
// Test Suite Functions
// ************************************************************************
// test_class_Box_default_ctor
// Test suite for class Box, default ctor
// Pre: None.
// Post:
// Pass/fail status of tests have been registered with t.
// Appropriate messages have been printed to cout.
// Does not throw (No-Throw Guarantee)
void test_class_Box_default_ctor(Tester & t)
{
std::cout << "Test Suite: class Box, default ctor" << std::endl;
std::string s1; // Holds type
int i1; // Holds width and height
// Default construct const
const FilledBox con1;
// Check default constructed const width
i1 = con1.getWidth();
t.test(i1 == 1, "FilledBox Default ctor, width");
// Check default constructed const height
i1 = con1.getHeight();
t.test(i1 == 1, "FilledBox Default ctor, height");
// Check Filled constructed type
s1 = con1.type();
t.test(s1 == "Filled", "FilledBox, type");
const HollowBox con2;
const CheckeredBox con3;
s1 = con2.type();
t.test(s1 == "Hollow", "HollowBox, type");
s1 = con3.type();
t.test(s1 == "Checkered", "CheckeredBox, type");
}
// test_class_Box_data_ctor
// Test suite for class Box, ctor from data
// Pre: None.
// Post:
// Pass/fail status of tests have been registered with t.
// Appropriate messages have been printed to cout.
// Does not throw (No-Throw Guarantee)
void test_class_Box_data_ctor(Tester & t)
{
std::cout << "Test Suite: class Box, ctor from data" << std::endl;
std::string s1; // Holds type
int i1; // Holds width and height
// data ctor param type
FilledBox con0(2, 2); // This only needs to compile
t.test(true, "Filled Ctor from data, two parameters");
// Construct from data #1
const HollowBox con1(3,7);
t.test(true, "Hollow Ctor from data, three parameter");
// Check constructed from data #1 type
s1 = con1.type();
t.test(s1 == "Hollow", "Hollow Ctor from data, type");
// Check constructed from data #1 width
i1 = con1.getWidth();
t.test(i1 == 3, "Hollow Ctor from data, width");
// Check constructed from data #1 height
i1 = con1.getHeight();
t.test(i1 == 7, "Hollow Ctor from data, height");
// Copy Construct
const HollowBox ccon1(con1);
t.test(true, "HollowBox Copy Ctor");
// Check constructed from data #1 type
s1 = ccon1.type();
t.test(s1 == "Hollow", "Hollow Copy Ctor, type");
// Check constructed from data #1 width
i1 = ccon1.getWidth();
t.test(i1 == 3, "Hollow Copy Ctor, width");
// Check constructed from data #1 height
i1 = ccon1.getHeight();
t.test(i1 == 7, "Hollow Copy Ctor, height");
// Construct from data #2 (const)
const FilledBox con2(4,2);
// Check constructed from data #2 type
s1 = con2.type();
t.test(s1 == "Filled", "Filled Ctor from data, const, type");
// Check constructed from data #2 height
i1 = con2.getHeight();
t.test(i1 == 2, "Filled Ctor from data, const, height");
// Check constructed from data #2 width
i1 = con2.getWidth();
t.test(i1 == 4, "Filled Ctor from data, const, width");
// Construct from data #2 (const)
const CheckeredBox con3(2,2);
// Check constructed from data #2 type
s1 = con3.type();
t.test(s1 == "Checkered", "Checkered Ctor from data, const, type");
}
// test_class_Box_get_and_set_functions
// Test suite for class Box, get & set functions
// Pre: None.
// Post:
// Pass/fail status of tests have been registered with t.
// Appropriate messages have been printed to cout.
// Does not throw (No-Throw Guarantee)
void test_class_Box_get_and_set_functions(Tester & t)
{
std::cout << "Test Suite: class Box, get and set functions (uses FilledBox)" << std::endl;
std::string s1; // Holds type
int i1; // Holds width and height
bool typeCheck; // Holds typecheck result
FilledBox con1(4,5);
const FilledBox & con1r(con1);
FilledBox con2(6,7);
// setWidth parameter type
FilledBox con0;
con0.setWidth(2); // This only needs to compile
t.test(true, "setWidth param type = int");
// Check getWidth return type non-const
typeCheck = TypeCheck<int>::check(con1.getWidth());
t.test(typeCheck, "getWidth non-const, return type = int");
// Check getWidth return type const
typeCheck = TypeCheck<int>::check(con1r.getWidth());
t.test(typeCheck, "getWidth const, return type = int");
// Check getHeight return type non-const
typeCheck = TypeCheck<int>::check(con1.getHeight());
t.test(typeCheck, "getHeight non-const, return type = int");
// Check getHeight return type const
typeCheck = TypeCheck<int>::check(con1r.getHeight());
t.test(typeCheck, "getHeight const, return type = int");
// Check type return type non-const
typeCheck = TypeCheck<std::string>::check(con1.type());
t.test(typeCheck, "type non-const, return type = int");
// Check type return type const
typeCheck = TypeCheck<std::string>::check(con1r.type());
t.test(typeCheck, "type const, return type = int");
// Check setWidth #1
con1.setWidth(13);
i1 = con1.getWidth();
t.test(i1 == 13, "setWidth #1");
// Check setHeight #1
con1.setHeight(14);
i1 = con1.getHeight();
t.test(i1 == 14, "setHeight #1");
}
// test_class_Box_print
// Test suite for class Box, print
// Pre: None.
// Post:
// Pass/fail status of tests have been registered with t.
// Appropriate messages have been printed to cout.
// Does not throw (No-Throw Guarantee)
void test_class_Box_print(Tester & t)
{
std::cout << "Test Suite: class Box, print" << std::endl;
std::ostringstream os; // Holds output
// Test #1
FilledBox con1;
// Check print #1
os << con1;
t.test(os.str() == "x\n", "print, default box");
// Test #2 (const)
const FilledBox con2(4,3);
// Check print #2
os.str(""); //reset output holder
os << con2;
t.test(os.str() == "xxxx\nxxxx\nxxxx\n", "print 4x3 box, const");
// Test #3 (1x1 hollow)
HollowBox con3(1,1);
// Check print #3
os.str(""); //reset output holder
os << con3;
t.test(os.str() == "x\n", "print 1x1 hollow box");
// Test #4 (2x2 hollow)
HollowBox con4(2,2);
// Check print #4
os.str(""); //reset output holder
os << con4;
t.test(os.str() == "xx\nxx\n", "print 2x2 hollow box");
// Test #5 (8x3 hollow)
con4.setWidth(8);
con4.setHeight(3);
// Check print #5
os.str(""); //reset output holder
os << con4;
t.test(os.str() == "xxxxxxxx\nx x\nxxxxxxxx\n", "print 8x3 hollow box");
// Test #6 (2x2 checkered)
CheckeredBox con6(2,2);
// Check print #6
os.str(""); //reset output holder
os << con6;
t.test(os.str() == "x \n x\n", "print 2x2 checkered box");
// Test #7 (5x3 checkered)
std::unique_ptr<Box> bptr = boxFactory('c',5,3);
// Check print #7
os.str(""); //reset output holder
bptr->print(os);
t.test(os.str() == "x x x\n x x \nx x x\n", "print 5x3 checkered box from factory");
// Check pring #8
bptr = boxFactory('h',8,3);
// Check boxFactory hollow
os.str(""); //reset output holder
os << *bptr << "test";
t.test(os.str() == "xxxxxxxx\nx x\nxxxxxxxx\ntest", "print 8x3 hollow box from factory using cascaded <<");
}
class dBox : public FilledBox {
public:
static bool destructedAny;
~dBox() {
destructedAny = true;
}
};
bool dBox::destructedAny=false;
// test_class_Box_virtual_destructor
// Test suite for class Box, virtual destructor
// Pre: None.
// Post:
// Pass/fail status of tests have been registered with t.
// Appropriate messages have been printed to cout.
// Does not throw (No-Throw Guarantee)
void test_class_Box_virtual_destructor(Tester & t)
{
{
std::unique_ptr<Box>(new dBox);
}
t.test(dBox::destructedAny,"Box class has virtual destructor.");
}
// test_class_Box
// Test suite for class Box
// Uses other test-suite functions
// Pre: None.
// Post:
// Pass/fail status of tests have been registered with t.
// Appropriate have been messages printed to cout.
// Does not throw (No-Throw Guarantee)
void test_class_Box(Tester & t)
{
// Do all the test suites
std::cout << "TEST SUITES FOR CLASS Box" << std::endl;
test_class_Box_default_ctor(t);
test_class_Box_data_ctor(t);
test_class_Box_get_and_set_functions(t);
test_class_Box_print(t);
test_class_Box_virtual_destructor(t);
}
// ************************************************************************
// Main program
// ************************************************************************
// main
// Runs class Box test suite, prints results to cout.
int main()
{
Tester t;
test_class_Box(t);
std::cout << std::endl;
if (t.allPassed())
{
std::cout << "All tests successful"
<< std::endl;
}
else
{
std::cout << "Tests ********** UNSUCCESSFUL **********"
<< std::endl;
}
std::cout << std::endl;
std::cout << "Press ENTER to quit ";
while (std::cin.get() != '\n') ;
return 0;
}
| [
"95jasonkim@gmail.com"
] | 95jasonkim@gmail.com |
27dc5431cfa92c5620eb6aaea9236456e3203f0e | a99d2b80580ad7db897c401ed07ca9f2853897de | /vec.h | 3e8e5a5f18d44f8a7b530bfe597b79446c1b50cb | [] | no_license | m-bilu/linSuite | 01543f0d82ee6aad1f7b0ae3878a4e8516c28e2b | 9f210d2e9a1cfe8e18dfb0a7da2eb303d4b91843 | refs/heads/master | 2023-08-25T20:26:37.052400 | 2021-10-23T01:36:42 | 2021-10-23T01:36:42 | 416,470,641 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,042 | h | #ifndef _VEC
#define _VEC
#include <iostream>
#include <string>
#include <sstream>
#include <assert.h>
struct vec {
int m, n;
int * items;
// ACCESS/MODIFY FIELDS
friend int getm(const vec & vector);
friend int getn(const vec & vector);
int getitem(const vec & vector, const int row, const int col);
void modifitem(vec & vector, const int row, const int col, const int val);
void scale(vec & vector, const int newM, const int newN);
// DEFAULT CONTSTRUCTOR
explicit vec(const int & sm = 1, const int & sn = 1, const int *sitems = nullptr);
//DESTRUCTOR
~vec();
// COPY CONSTRUCTORS
vec(const vec & original);
// OVERLOADED COPY ASSIGNMENT OPERATOR
vec & operator= (const vec & other);
// MOVE CONSTRUCTOR
vec(vec && other);
vec & operator= (vec && other);
// BOOLEAN CHECKERS
bool operator== (const vec & other);
bool sumDefined(const vec & a, const vec & b);
bool multDefined(const vec & a, const vec & b);
// OVERLOADED +, *, -
// +
vec operator+ (const vec & other);
vec operator+ (const int other);
// -
vec operator- (const vec & other);
vec operator- (const int other);
// *
vec operator* (const vec & other);
vec operator* (const int other);
// +=
vec & operator+= (const vec & other);
vec & operator+= (const int other);
// -=
vec & operator-= (const vec & other);
vec & operator-= (const int other);
// *=
vec & operator*= (const vec & other);
vec & operator*= (const int other);
// MATRIX METHODS
vec transpose();
int det(const vec & vector);
};
vec operator+ (const int left, const vec & other); // WILL CREATE NEW OBJECT
vec operator* (const int left, const vec & other);
vec operator- (const int left, const vec & other);
vec & operator+= (const int left, const vec & other); // WILL CREATE NEW OBJECT
vec & operator-= (const int left, const vec & other);
vec & operator*= (const int left, const vec & other);
// Reads input, allocates and returns a new vec object.
std::ostream &operator<< (std::ostream &out, const vec & vector);
#endif
| [
"02.mbilalkhan@gmail.com"
] | 02.mbilalkhan@gmail.com |
db56dafa688119e3b8e95d931b83239ff74953ef | 2834f98b53d78bafc9f765344ded24cf41ffebb0 | /components/viz/service/display/skia_output_surface.h | 2f06602e9c0dbcffbd74eadcf5cee31fd885f0d2 | [
"BSD-3-Clause"
] | permissive | cea56/chromium | 81bffdf706df8b356c2e821c1a299f9d4bd4c620 | 013d244f2a747275da76758d2e6240f88c0165dd | refs/heads/master | 2023-01-11T05:44:41.185820 | 2019-12-09T04:14:16 | 2019-12-09T04:14:16 | 226,785,888 | 1 | 0 | BSD-3-Clause | 2019-12-09T04:40:07 | 2019-12-09T04:40:07 | null | UTF-8 | C++ | false | false | 7,869 | h | // Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef COMPONENTS_VIZ_SERVICE_DISPLAY_SKIA_OUTPUT_SURFACE_H_
#define COMPONENTS_VIZ_SERVICE_DISPLAY_SKIA_OUTPUT_SURFACE_H_
#include <memory>
#include <vector>
#include "build/build_config.h"
#include "components/viz/common/resources/resource_format.h"
#include "components/viz/common/resources/resource_id.h"
#include "components/viz/service/display/external_use_client.h"
#include "components/viz/service/display/output_surface.h"
#include "components/viz/service/display/overlay_processor.h"
#include "third_party/skia/include/core/SkRefCnt.h"
#if defined(OS_WIN)
#include "components/viz/service/display/dc_layer_overlay.h"
#endif
#if defined(OS_MACOSX)
#include "components/viz/service/display/ca_layer_overlay.h"
#endif
class SkCanvas;
class SkImage;
namespace gfx {
class ColorSpace;
} // namespace gfx
namespace viz {
class OverlayCandidate;
class ContextLostObserver;
class CopyOutputRequest;
namespace copy_output {
struct RenderPassGeometry;
} // namespace copy_output
// This class extends the OutputSurface for SkiaRenderer needs. In future, the
// SkiaRenderer will be the only renderer. When other renderers are removed,
// we will replace OutputSurface with SkiaOutputSurface, and remove all
// OutputSurface's methods which are not useful for SkiaRenderer.
class VIZ_SERVICE_EXPORT SkiaOutputSurface : public OutputSurface,
public ExternalUseClient {
public:
#if defined(OS_ANDROID)
using OverlayList = std::vector<OverlayCandidate>;
#elif defined(OS_MACOSX)
using OverlayList = CALayerOverlayList;
#elif defined(OS_WIN)
using OverlayList = DCLayerOverlayList;
#elif defined(USE_OZONE)
using OverlayList = std::vector<OverlayCandidate>;
#else
// Default.
using OverlayList = std::vector<OverlayCandidate>;
#endif
explicit SkiaOutputSurface(OutputSurface::Type type);
~SkiaOutputSurface() override;
SkiaOutputSurface* AsSkiaOutputSurface() override;
// Begin painting the current frame. This method will create a
// SkDeferredDisplayListRecorder and return a SkCanvas of it.
// The SkiaRenderer will use this SkCanvas to paint the current
// frame.
// And this SkCanvas may become invalid, when FinishPaintCurrentFrame is
// called.
virtual SkCanvas* BeginPaintCurrentFrame() = 0;
// Make a promise SkImage from the given |image_context|. The SkiaRenderer can
// use the image with SkCanvas returned by |GetSkCanvasForCurrentFrame|, but
// Skia will not read the content of the resource until the |sync_token| in
// the |image_context| is satisfied. The SwapBuffers should take care of this
// by scheduling a GPU task with all resource sync tokens recorded by
// MakePromiseSkImage for the current frame.
virtual void MakePromiseSkImage(
ExternalUseClient::ImageContext* image_context) = 0;
// Make a promise SkImage from the given |contexts| and the |yuv_color_space|.
// For YUV format, at least three resource contexts should be provided.
// contexts[0] contains pixels from y panel, contexts[1] contains pixels
// from u panel, contexts[2] contains pixels from v panel. For NV12 format,
// at least two resource contexts should be provided. contexts[0] contains
// pixels from y panel, contexts[1] contains pixels from u and v panels. If
// has_alpha is true, the last item in contexts contains alpha panel.
virtual sk_sp<SkImage> MakePromiseSkImageFromYUV(
const std::vector<ExternalUseClient::ImageContext*>& contexts,
SkYUVColorSpace yuv_color_space,
sk_sp<SkColorSpace> dst_color_space,
bool has_alpha) = 0;
// Swaps the current backbuffer to the screen.
virtual void SkiaSwapBuffers(OutputSurfaceFrame frame) = 0;
// TODO(weiliangc): This API should move to OverlayProcessor.
// Schedule |output_surface_plane| as an overlay plane to be displayed.
virtual void ScheduleOutputSurfaceAsOverlay(
OverlayProcessor::OutputSurfaceOverlayPlane output_surface_plane) = 0;
// Begin painting a render pass. This method will create a
// SkDeferredDisplayListRecorder and return a SkCanvas of it. The SkiaRenderer
// will use this SkCanvas to paint the render pass.
// Note: BeginPaintRenderPass cannot be called without finishing the prior
// paint render pass.
virtual SkCanvas* BeginPaintRenderPass(const RenderPassId& id,
const gfx::Size& size,
ResourceFormat format,
bool mipmap,
sk_sp<SkColorSpace> color_space) = 0;
// Finish painting the current frame or current render pass, depends on which
// BeginPaint function is called last. This method will schedule a GPU task to
// play the DDL back on GPU thread on a cached SkSurface. This method returns
// a sync token which can be waited on in a command buffer to ensure the paint
// operation is completed. This token is released when the GPU ops from
// painting the render pass have been seen and processed by the GPU main.
// Optionally the caller may specify |on_finished| callback to be called after
// the GPU has finished processing all submitted commands. The callback may be
// called on a different thread.
virtual gpu::SyncToken SubmitPaint(base::OnceClosure on_finished) = 0;
// Make a promise SkImage from a render pass id. The render pass has been
// painted with BeginPaintRenderPass and FinishPaintRenderPass. The format
// and mipmap must match arguments used for BeginPaintRenderPass() to paint
// this render pass.
virtual sk_sp<SkImage> MakePromiseSkImageFromRenderPass(
const RenderPassId& id,
const gfx::Size& size,
ResourceFormat format,
bool mipmap,
sk_sp<SkColorSpace> color_space) = 0;
// Remove cached resources generated by BeginPaintRenderPass and
// FinishPaintRenderPass.
virtual void RemoveRenderPassResource(std::vector<RenderPassId> ids) = 0;
// Copy the output of the current frame if the |id| is zero, otherwise copy
// the output of a cached SkSurface for the given |id|.
virtual void CopyOutput(RenderPassId id,
const copy_output::RenderPassGeometry& geometry,
const gfx::ColorSpace& color_space,
std::unique_ptr<CopyOutputRequest> request) = 0;
// Schedule drawing overlays at next SkiaSwapBuffers() call. Waits on
// |sync_tokens| for the overlay textures to be ready before scheduling.
virtual void ScheduleOverlays(OverlayList overlays,
std::vector<gpu::SyncToken> sync_tokens) = 0;
#if defined(OS_WIN)
// Enables/disables drawing with DC layers. Should be enabled before
// ScheduleDCLayers() will be called.
virtual void SetEnableDCLayers(bool enable) = 0;
#endif
// Add context lost observer.
virtual void AddContextLostObserver(ContextLostObserver* observer) = 0;
// Remove context lost observer.
virtual void RemoveContextLostObserver(ContextLostObserver* observer) = 0;
// Only used for SkiaOutputSurfaceImpl unit tests.
virtual void ScheduleGpuTaskForTesting(
base::OnceClosure callback,
std::vector<gpu::SyncToken> sync_tokens) = 0;
// Only used for the Android pre-SurfaceControl overlay code path to pass all
// promotion hints.
virtual void SendOverlayPromotionNotification(
std::vector<gpu::SyncToken> sync_tokens,
base::flat_set<gpu::Mailbox> promotion_denied,
base::flat_map<gpu::Mailbox, gfx::Rect> possible_promotions) = 0;
private:
DISALLOW_COPY_AND_ASSIGN(SkiaOutputSurface);
};
} // namespace viz
#endif // COMPONENTS_VIZ_SERVICE_DISPLAY_SKIA_OUTPUT_SURFACE_H_
| [
"commit-bot@chromium.org"
] | commit-bot@chromium.org |
378c097e79a2d434ba6563c9f1929387ce788012 | 370881312084d8d2ce0f9c8dce147b81a3a9a923 | /Game_Code/Game_Dll_Archive/GameDll/Environment/LedgeManager.cpp | 186852b3ac75a42286e2b714d71c252a1643672a | [] | no_license | ShadowShell/QuestDrake | 3030c396cd691be96819eec0f0f376eb8c64ac89 | 9be472a977882df97612efb9c18404a5d43e76f5 | refs/heads/master | 2016-09-05T20:23:14.165400 | 2015-03-06T14:17:22 | 2015-03-06T14:17:22 | 31,463,818 | 3 | 2 | null | 2015-02-28T18:26:22 | 2015-02-28T13:45:52 | C++ | UTF-8 | C++ | false | false | 31,149 | cpp | /*************************************************************************
Crytek Source File.
Copyright (C), Crytek Studios, 2001-2009.
-------------------------------------------------------------------------
$Id$
$DateTime$
Description: Climb-able Ledge system
-------------------------------------------------------------------------
History:
- 20:04:2009: Created by Michelle Martin
*************************************************************************/
#include "StdAfx.h"
#include "LedgeManager.h"
#include "IRenderAuxGeom.h"
#include <TypeInfo_impl.h>
#define LEDGE_DATA_FILE_VERSION 3
STRUCT_INFO_BEGIN(SLedgeObject)
STRUCT_VAR_INFO(m_entityId, TYPE_INFO(EntityId))
STRUCT_VAR_INFO(m_markersStartIdx, TYPE_INFO(uint16))
STRUCT_VAR_INFO(m_markersCount, TYPE_INFO(uint16))
STRUCT_VAR_INFO(m_ledgeFlags, TYPE_ARRAY(LedgeSide_Count, TYPE_INFO(ELedgeFlagBitfield)))
STRUCT_VAR_INFO(m_ledgeCornerEndAdjustAmount, TYPE_INFO(float))
STRUCT_INFO_END(SLedgeObject)
STRUCT_INFO_BEGIN(SLedgeMarker)
STRUCT_VAR_INFO(m_worldPosition, TYPE_INFO(Vec3))
STRUCT_VAR_INFO(m_facingDirection, TYPE_INFO(Vec3))
STRUCT_VAR_INFO(m_endOrCorner, Type_info(bool))
STRUCT_INFO_END(SLedgeMarker)
namespace
{
ILINE Vec3 _FindVectorToClosestPointOnLedge( const Vec3 &referencePoint, const SLedgeInfo &ledgeInfo )
{
const Vec3 ledgePosition = ledgeInfo.GetPosition();
Vec3 vXDir = ledgeInfo.GetSegment();
const float halfWidth = (vXDir.NormalizeSafe() * 0.5f); // this is normalizing so projection below is valid
const float quarterWidth = halfWidth * 0.5f; // we use this to ensure when adjusting ends of a ledge a ledge will always be at least half its size. If the desired adjust amount is greater than the ledge size
float distToP0 = halfWidth;
float distToP1 = halfWidth;
float endAdjustment = ledgeInfo.GetCornerEndAdjustAmount();
// must keep this clamping in sync with editor and game DebugDraw() below
if (ledgeInfo.AreFlagsSet(kledgeRunTimeOnlyFlag_p0IsEndOrCorner))
{
const float adjustAmount = min(endAdjustment, quarterWidth);
distToP0 -= adjustAmount;
}
if (ledgeInfo.AreFlagsSet(kledgeRunTimeOnlyFlag_p1IsEndOrCorner))
{
const float adjustAmount = min(endAdjustment, quarterWidth);
distToP1 -= adjustAmount;
}
const float fD = clamp_tpl( (referencePoint - ledgePosition) * vXDir, -distToP0, distToP1 );
return ((ledgePosition + fD * vXDir) - referencePoint);
}
ILINE bool IsBestLedge( const Vec3& positionToLedge, const Vec3& testDirection, const SLedgeInfo& ledgeInfo, const float bestDistanceSq, const float cosMaxAngle, const bool enabled, float& newBestDistanceSq )
{
const float distanceSq = positionToLedge.GetLengthSquared();
if (distanceSq > bestDistanceSq)
{
return false;
}
newBestDistanceSq = distanceSq;
const float fCosAngle = -(testDirection * ledgeInfo.GetFacingDirection());
// Note: We do the enable check at the end, because,
// 99% of the time we don't reach this point, we save the extra branching while looping through those ledges
return ((fCosAngle > cosMaxAngle) && enabled);
}
ILINE bool PointInShere( const Vec3& point, const Sphere& sphere )
{
return ( (sphere.center - point).GetLengthSquared() < (sphere.radius * sphere.radius) );
}
void DrawLedge( IRenderAuxGeom* pRenderAuxGeometry, const Vec3 startPoint, const Vec3& endPoint, const Vec3& facingDirection, const ELedgeFlagBitfield flags[LedgeSide_Count] )
{
const float side[2] = { 1.0f, -1.0f };
const float drawOffset[2] = { 0.01f, 0.01f };
uint32 currentSide = 0;
const uint32 sideCount = 1 + ((flags[0] & kLedgeFlag_isDoubleSided) != 0);
CRY_ASSERT(sideCount <= 2);
const ColorB colorTable[3][2] = { { Col_Grey, Col_Grey }, { Col_SlateBlue, Col_SlateBlue }, { Col_Red, Col_Orange } };
do
{
const Vec3 direction = facingDirection * side[currentSide];
const Vec3 start = startPoint + (direction * drawOffset[currentSide]);
const Vec3 end = endPoint + (direction * drawOffset[currentSide]);
const Vec3 middle = (start + end) * 0.5f;
const Vec3 ledgeDirection = (end - start).GetNormalized();
const uint32 colorIdx = ((flags[currentSide] & kLedgeFlag_enabled) == 0) ? 0 : 1 + ((flags[currentSide] & (kLedgeFlag_useVault|kLedgeFlag_useHighVault)) == 0); // TODO - add a different colour for highVault vs normal vault
CRY_ASSERT(colorIdx <= 2);
pRenderAuxGeometry->DrawLine( start, colorTable[colorIdx][0], end, colorTable[colorIdx][0], 8.0f );
pRenderAuxGeometry->DrawLine( middle, colorTable[colorIdx][0], middle + (direction * 0.3f), colorTable[colorIdx][1], 4.0f);
pRenderAuxGeometry->DrawTriangle( middle - (ledgeDirection * 0.05f), colorTable[colorIdx][0], middle + (ledgeDirection * 0.05f), colorTable[colorIdx][0], middle + (direction * 0.15f), colorTable[colorIdx][1]);
pRenderAuxGeometry->DrawTriangle( middle + (ledgeDirection * 0.05f), colorTable[colorIdx][0], middle - (ledgeDirection * 0.05f), colorTable[colorIdx][0], middle + (direction * 0.15f), colorTable[colorIdx][1]);
++currentSide;
} while ( currentSide < sideCount );
}
struct SLedgeMarkerBuffer
{
SLedgeMarkerBuffer( const uint32 _bufferSize )
: bufferSize(_bufferSize)
, pMarkers(NULL)
{
if (bufferSize)
{
pMarkers = new SLedgeMarker[bufferSize];
}
}
~SLedgeMarkerBuffer()
{
SAFE_DELETE_ARRAY(pMarkers);
}
ILINE void InsertAt( const SLedgeMarker& marker, const uint32 index )
{
CRY_ASSERT( index < bufferSize );
pMarkers[index] = marker;
}
SLedgeMarker* pMarkers;
const uint32 bufferSize;
};
}
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
#if LEDGE_MANAGER_EDITING_ENABLED
#include "Utility/DesignerWarning.h"
void SLedgeObjectEditor::DebugDraw( IRenderAuxGeom* pRenderAux, const Sphere& visibleArea ) const
{
if ( PointInShere( m_markers[0].m_worldPosition, visibleArea) == false )
return;
for (size_t markerIdx = 0; markerIdx < (m_markers.size() - 1); ++markerIdx)
{
ELedgeFlagBitfield ledgeFlags[LedgeSide_Count];
ledgeFlags[LedgeSide_In] = m_ledgeFlags[LedgeSide_In];
ledgeFlags[LedgeSide_Out] = m_ledgeFlags[LedgeSide_Out];
Vec3 startPos = m_markers[markerIdx].m_worldPosition;
Vec3 endPos = m_markers[markerIdx+1].m_worldPosition;
Vec3 startToEnd = endPos - startPos;
const float startToEndLen = startToEnd.NormalizeSafe();
const float quarterWidth = startToEndLen * 0.25f; // we use 1/4 width to ensure that a ledge will get no smaller than half its size if the edge adjust amount is larger than the ledge size
// Must keep this clamping in sync with _FindVectorToClosestPointOnLedge() above
float endAdjustment = m_ledgeCornerEndAdjustAmount;
const float adjustAmount = min(endAdjustment, quarterWidth);
if (m_markers[markerIdx].m_endOrCorner)
{
startPos += startToEnd * adjustAmount;
ledgeFlags[LedgeSide_In] |= kledgeRunTimeOnlyFlag_p0IsEndOrCorner;
ledgeFlags[LedgeSide_Out] |= kledgeRunTimeOnlyFlag_p0IsEndOrCorner;
}
if (m_markers[markerIdx+1].m_endOrCorner)
{
endPos -= startToEnd * adjustAmount;
ledgeFlags[LedgeSide_In] |= kledgeRunTimeOnlyFlag_p1IsEndOrCorner;
ledgeFlags[LedgeSide_Out] |= kledgeRunTimeOnlyFlag_p1IsEndOrCorner;
}
DrawLedge( pRenderAux, startPos, endPos, m_markers[markerIdx].m_facingDirection, ledgeFlags);
}
}
void CLedgeManagerEdit::RegisterLedge( EntityId entityId, const SLedgeMarker* pMarkersArray, const uint32 markerCount, ELedgeFlagBitfield ledgeInFlags, ELedgeFlagBitfield ledgeOutFlags, float ledgeCornerMaxAngle, float ledgeCornerEndAdjustAmount )
{
if (markerCount == 0)
return;
TLedgeObjectsEditorContainer::iterator ledgeIt = std::find(m_ledgeObjects.begin(), m_ledgeObjects.end(), entityId);
const bool notRegistered = ledgeIt == m_ledgeObjects.end();
if (notRegistered)
{
if ( m_ledgeObjects.size() == m_ledgeObjects.max_size() )
{
DesignerWarning( true, "Exceeding maximum ledge count, %d! Not possible to register this ledge in the manager", MAX_LEDGE_ENTITIES);
return;
}
m_ledgeObjects.push_back( SLedgeObjectEditor() );
}
SLedgeObjectEditor& ledgeObject = notRegistered ? m_ledgeObjects.back() : *ledgeIt;
ledgeObject.m_entityId = entityId;
ledgeObject.m_ledgeFlags[LedgeSide_In] = ledgeInFlags;
ledgeObject.m_ledgeFlags[LedgeSide_Out] = ledgeOutFlags;
ledgeObject.m_ledgeCornerMaxAngle = ledgeCornerMaxAngle;
ledgeObject.m_ledgeCornerEndAdjustAmount = ledgeCornerEndAdjustAmount;
if (ledgeObject.m_markers.size() != markerCount)
{
ledgeObject.m_markers.resize(markerCount);
}
for (uint32 markerIdx = 0; markerIdx < markerCount; ++markerIdx)
{
ledgeObject.m_markers[markerIdx] = pMarkersArray[markerIdx];
}
}
void CLedgeManagerEdit::UnregisterLedge( EntityId entityId )
{
const size_t objectCount = m_ledgeObjects.size();
size_t removeIdx = 0;
while ((removeIdx < objectCount) && (m_ledgeObjects[removeIdx] != entityId))
{
removeIdx++;
}
if (removeIdx < objectCount)
{
m_ledgeObjects.removeAt( (uint32)removeIdx );
}
}
void CLedgeManagerEdit::UpdateLedgeMarkers( const EntityId entityId, const SLedgeMarker* pMarkersArray, const uint32 markerCount )
{
TLedgeObjectsEditorContainer::iterator ledgeIt = std::find(m_ledgeObjects.begin(), m_ledgeObjects.end(), entityId);
if ((ledgeIt != m_ledgeObjects.end()) && (ledgeIt->m_markers.size() == markerCount))
{
for (uint32 markerIdx = 0; markerIdx < markerCount; ++markerIdx)
{
ledgeIt->m_markers[markerIdx] = pMarkersArray[markerIdx];
}
}
}
void CLedgeManagerEdit::EnableLedge( const EntityId entityId, bool enable )
{
TLedgeObjectsEditorContainer::iterator ledgeIt = std::find(m_ledgeObjects.begin(), m_ledgeObjects.end(), entityId);
if (ledgeIt != m_ledgeObjects.end())
{
SLedgeObjectEditor& ledgeObject = *ledgeIt;
CRY_ASSERT( (ledgeObject.m_ledgeFlags[LedgeSide_In] & kLedgeFlag_static) == 0 );
if (enable)
{
ledgeObject.m_ledgeFlags[LedgeSide_In] |= kLedgeFlag_enabled;
ledgeObject.m_ledgeFlags[LedgeSide_Out] |= kLedgeFlag_enabled;
}
else
{
ledgeObject.m_ledgeFlags[LedgeSide_In] &= ~kLedgeFlag_enabled;
ledgeObject.m_ledgeFlags[LedgeSide_Out] &= ~kLedgeFlag_enabled;
}
}
}
SLedgeInfo CLedgeManagerEdit::GetLedgeById( const LedgeId& ledgeId ) const
{
const uint16 objectIdx = ledgeId.GetLedgeObjectIdx();
if ( objectIdx < m_ledgeObjects.size() )
{
const SLedgeObjectEditor& ledgeObject = m_ledgeObjects[objectIdx];
const uint16 subSegmentIdx = ledgeId.GetSubSegmentIdx();
if ( subSegmentIdx < (ledgeObject.m_markers.size() - 1) )
{
const uint16 side = ledgeId.GetSide();
CRY_ASSERT( side < 2 );
const float sideValue[2] = { 1.0f, -1.0f };
const Vec3 facingDirection = ledgeObject.m_markers[subSegmentIdx].m_facingDirection * sideValue[side];
const EntityId entityId = (ledgeObject.m_ledgeFlags[side] & kLedgeFlag_static) ? 0 : ledgeObject.m_entityId;
ELedgeFlagBitfield flags = ledgeObject.m_ledgeFlags[side];
if (ledgeObject.m_markers[subSegmentIdx].m_endOrCorner)
{
flags |= kledgeRunTimeOnlyFlag_p0IsEndOrCorner;
}
if (ledgeObject.m_markers[subSegmentIdx+1].m_endOrCorner)
{
flags |= kledgeRunTimeOnlyFlag_p1IsEndOrCorner;
}
return SLedgeInfo( entityId, ledgeObject.m_markers[subSegmentIdx].m_worldPosition, ledgeObject.m_markers[subSegmentIdx + 1].m_worldPosition, facingDirection, flags, ledgeObject.m_ledgeCornerEndAdjustAmount );
}
}
return SLedgeInfo();
}
LedgeId CLedgeManagerEdit::FindNearestLedge( const Vec3 &referencePosition, const Vec3 &testDirection, const float maxDistance, const float angleRange, const float extendedAngleRange ) const
{
LedgeId bestLedgeId;
float closestDistanceSq = maxDistance* maxDistance;
const float fCosMaxAngleTable[2] = { cosf(angleRange), cosf(extendedAngleRange) };
const float side[2] = { 1.0f, -1.0f };
SLedgeInfo ledgeInfo;
const uint32 ledgeObjectCount = (uint32)m_ledgeObjects.size();
for(uint32 objectIdx = 0; objectIdx < ledgeObjectCount; ++objectIdx)
{
const SLedgeObjectEditor& ledgeObject = m_ledgeObjects[objectIdx];
const uint32 markersCount = (uint32)ledgeObject.m_markers.size();
const uint32 sideCount = 1 + ((ledgeObject.m_ledgeFlags[LedgeSide_In] & kLedgeFlag_isDoubleSided) != 0);
const bool enabled = (ledgeObject.m_ledgeFlags[LedgeSide_In] & kLedgeFlag_enabled) != 0;
CRY_ASSERT(sideCount <= 2);
uint32 currentSide = 0;
do
{
for (uint32 markerIdx = 0; markerIdx < (markersCount - 1); ++markerIdx)
{
ELedgeFlagBitfield flags = kLedgeFlag_none;
if (ledgeObject.m_markers[markerIdx].m_endOrCorner)
{
flags |= kledgeRunTimeOnlyFlag_p0IsEndOrCorner;
}
if (ledgeObject.m_markers[markerIdx+1].m_endOrCorner)
{
flags |= kledgeRunTimeOnlyFlag_p1IsEndOrCorner;
}
ledgeInfo = SLedgeInfo( ledgeObject.m_entityId, ledgeObject.m_markers[markerIdx].m_worldPosition, ledgeObject.m_markers[markerIdx+1].m_worldPosition,
ledgeObject.m_markers[markerIdx].m_facingDirection * side[currentSide], flags, ledgeObject.m_ledgeCornerEndAdjustAmount );
// Explanation: (Please do not delete this comment)
// The item can be skipped if the angle is too big.
// Since only the cosine of angles are compared,
// bigger angles result in smaller values (hence the less_than comparison)
const uint32 thresholdIdx = ((ledgeObject.m_ledgeFlags[currentSide] & (kLedgeFlag_useVault|kLedgeFlag_useHighVault)) != 0);
CRY_ASSERT( thresholdIdx < 2 );
const float fCosMaxAngle = fCosMaxAngleTable[thresholdIdx];
const Vec3 vPosToLedge = _FindVectorToClosestPointOnLedge( referencePosition, ledgeInfo );
float distanceSq;
if( IsBestLedge( vPosToLedge, testDirection, ledgeInfo, closestDistanceSq, fCosMaxAngle, enabled, distanceSq ) == false )
continue;
bestLedgeId = LedgeId( objectIdx, markerIdx, currentSide );
closestDistanceSq = distanceSq;
}
currentSide++;
} while ( currentSide < sideCount );
}
return bestLedgeId;
}
void CLedgeManagerEdit::Export( const char* fileName ) const
{
const uint32 totalLedgeObjectsCount = m_ledgeObjects.size();
if (totalLedgeObjectsCount > 0)
{
CCryFile file;
if( false != file.Open( fileName, "wb" ) )
{
// Count number of markers ...
uint32 totalLedgeMarkersCount = 0;
for (uint32 objectIdx = 0; objectIdx < totalLedgeObjectsCount; ++objectIdx)
{
totalLedgeMarkersCount += m_ledgeObjects[objectIdx].m_markers.size();
}
// Prepare buffers ...
SLedgeObject ledgeObjectBuffer[MAX_LEDGE_ENTITIES];
SLedgeMarkerBuffer ledgeMarkersBuffer(totalLedgeMarkersCount);
uint32 currentMarkerIdx = 0;
for (uint32 objectIdx = 0; objectIdx < totalLedgeObjectsCount; ++objectIdx)
{
SLedgeObject& ledgeObject = ledgeObjectBuffer[objectIdx];
const SLedgeObjectEditor& ledgeObjectEdit = m_ledgeObjects[objectIdx];
ledgeObject.m_entityId = ((ledgeObjectEdit.m_ledgeFlags[LedgeSide_In] & kLedgeFlag_static) == 0) ? ledgeObjectEdit.m_entityId : 0;
ledgeObject.m_ledgeFlags[LedgeSide_In] = ledgeObjectEdit.m_ledgeFlags[LedgeSide_In];
ledgeObject.m_ledgeFlags[LedgeSide_Out] = ledgeObjectEdit.m_ledgeFlags[LedgeSide_Out];
ledgeObject.m_ledgeCornerEndAdjustAmount = ledgeObjectEdit.m_ledgeCornerEndAdjustAmount;
ledgeObject.m_markersStartIdx = currentMarkerIdx;
ledgeObject.m_markersCount = ledgeObjectEdit.m_markers.size();
CRY_ASSERT((ledgeObject.m_markersStartIdx + ledgeObject.m_markersCount) <= totalLedgeMarkersCount);
for(size_t markerIdx = 0; markerIdx < ledgeObjectEdit.m_markers.size(); ++markerIdx)
{
ledgeMarkersBuffer.InsertAt( ledgeObjectEdit.m_markers[markerIdx], currentMarkerIdx + markerIdx );
}
currentMarkerIdx += ledgeObject.m_markersCount;
}
// Write to file...
// File version
uint32 nFileVersion = LEDGE_DATA_FILE_VERSION;
file.Write( &nFileVersion,sizeof(nFileVersion) );
// Ledges and markers info
file.Write( &totalLedgeObjectsCount, sizeof(totalLedgeObjectsCount) );
file.Write( &totalLedgeMarkersCount, sizeof(totalLedgeMarkersCount) );
file.Write( &ledgeObjectBuffer[0], sizeof(ledgeObjectBuffer[0]) * totalLedgeObjectsCount );
file.Write( &ledgeMarkersBuffer.pMarkers[0], sizeof(ledgeMarkersBuffer.pMarkers[0]) * ledgeMarkersBuffer.bufferSize );
file.Close();
}
}
}
void CLedgeManagerEdit::DebugDraw() const
{
const bool doDraw = (g_LedgeGrabManager_DebugDrawInEditor >= 2) || ((g_LedgeGrabManager_DebugDrawInEditor == 1) && (gEnv->IsEditing()));
if (doDraw)
{
IRenderAuxGeom* pRenderAuxGeometry = gEnv->pRenderer->GetIRenderAuxGeom();
const CCamera& viewCamera = gEnv->pSystem->GetViewCamera();
const Sphere visibleArea( viewCamera.GetPosition(), g_LedgeGrabManager_DebugDrawInEditor_Distance );
for (uint32 objectIdx = 0; objectIdx < m_ledgeObjects.size(); ++objectIdx)
{
m_ledgeObjects[objectIdx].DebugDraw( pRenderAuxGeometry, visibleArea );
}
}
}
void CLedgeManagerEdit::OnDisplayHelpersChanged( bool displayHelpers )
{
if (displayHelpers)
{
g_LedgeGrabManager_DebugDrawInEditor = m_lastDebugDrawValue;
}
else
{
m_lastDebugDrawValue = g_LedgeGrabManager_DebugDrawInEditor;
g_LedgeGrabManager_DebugDrawInEditor = 0;
}
}
void CLedgeManagerEdit::RegisterCVars()
{
REGISTER_CVAR(g_LedgeGrabManager_DebugDrawInEditor, 1, VF_DUMPTODISK, "Toggles debug rendering on ledges in editor: 0 - Disabled / 1 - Enabled in editing mode / 2 - Enabled in game mode / 3 - Visualize only deprecated ledge entities");
REGISTER_CVAR(g_LedgeGrabManager_DebugDrawInEditor_Distance, 35.0f, VF_CHEAT, "Max distance from camera at which ledges are rendered");
m_lastDebugDrawValue = g_LedgeGrabManager_DebugDrawInEditor;
}
#endif //LEDGE_MANAGER_EDITING_ENABLED
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
CLedgeManager::CLedgeManager()
: m_editorManager( gEnv->IsEditor() )
{
RegisterCVars();
Reset();
}
CLedgeManager::~CLedgeManager()
{
}
void CLedgeManager::Reset()
{
if(m_editorManager.IsInEditorMode())
{
m_editorManager.Reset();
}
else
{
m_levelLedges.Release();
}
}
void CLedgeManager::Load( const char* fileName )
{
// Clear in case there is anything left
Reset();
// In editor we don't load exported data, entities will recreate on load
if (m_editorManager.IsInEditorMode())
return;
CCryFile file;
if( false != file.Open( fileName, "rb" ) )
{
// File version
uint32 nFileVersion;
file.ReadType( &nFileVersion );
if (nFileVersion != LEDGE_DATA_FILE_VERSION)
{
GameWarning("!LedgeManager: Level data could not be loaded, file %s has version %d, expected %d. Level needs re-export", fileName, nFileVersion, LEDGE_DATA_FILE_VERSION);
return;
}
// Ledges and markers info
uint32 totalLedgeObjectsCount, totalLedgeMarkersCount;
file.ReadType( &totalLedgeObjectsCount );
file.ReadType( &totalLedgeMarkersCount );
m_levelLedges.Allocate( totalLedgeObjectsCount, totalLedgeMarkersCount );
file.ReadType( &m_levelLedges.m_pLedgeObjects[0], totalLedgeObjectsCount );
file.ReadType( &m_levelLedges.m_pMarkers[0], totalLedgeMarkersCount );
file.Close();
}
}
void CLedgeManager::UpdateLedgeMarkers( const EntityId entityId, const SLedgeMarker* pMarkersArray, const uint32 markerCount )
{
if (m_editorManager.IsInEditorMode())
{
m_editorManager.UpdateLedgeMarkers( entityId, pMarkersArray, markerCount );
}
else
{
SLedgeObject* pLedgeObject = m_levelLedges.FindLedgeForEntity( entityId );
if ((pLedgeObject != NULL) && (pLedgeObject->m_markersCount == markerCount))
{
const uint32 endMarkerIdx = pLedgeObject->m_markersStartIdx + pLedgeObject->m_markersCount;
CRY_ASSERT( endMarkerIdx <= m_levelLedges.m_markerCount );
for (uint32 markerIdx = pLedgeObject->m_markersStartIdx, idx = 0; markerIdx < endMarkerIdx; ++markerIdx, ++idx)
{
m_levelLedges.m_pMarkers[markerIdx] = pMarkersArray[idx];
}
}
}
}
void CLedgeManager::EnableLedge( const EntityId entityId, bool enable )
{
if (m_editorManager.IsInEditorMode())
{
m_editorManager.EnableLedge( entityId, enable );
}
else
{
SLedgeObject* pLedgeObject = m_levelLedges.FindLedgeForEntity( entityId );
if (pLedgeObject != NULL)
{
CRY_ASSERT( (pLedgeObject->m_ledgeFlags[LedgeSide_In] & kLedgeFlag_static) == 0 );
if (enable)
{
pLedgeObject->m_ledgeFlags[LedgeSide_In] |= kLedgeFlag_enabled;
pLedgeObject->m_ledgeFlags[LedgeSide_Out] |= kLedgeFlag_enabled;
}
else
{
pLedgeObject->m_ledgeFlags[LedgeSide_In] &= ~kLedgeFlag_enabled;
pLedgeObject->m_ledgeFlags[LedgeSide_Out] &= ~kLedgeFlag_enabled;
}
}
}
}
LedgeId CLedgeManager::FindNearestLedge( const Vec3 &referencePosition, const Vec3 &testDirection, float maxDistance /*= 2.0f*/, float angleRange /*= DEG2RAD(35.0f)*/, float extendedAngleRange /*= DEG2RAD(50.0f)*/ ) const
{
if (m_editorManager.IsInEditorMode())
{
return m_editorManager.FindNearestLedge( referencePosition, testDirection, maxDistance, angleRange, extendedAngleRange );
}
else
{
LedgeId bestLedgeId;
float closestDistanceSq = maxDistance* maxDistance;
const float fCosMaxAngleTable[2] = { cosf(angleRange), cosf(extendedAngleRange) };
const float side[2] = { 1.0f, -1.0f };
SLedgeInfo ledgeInfo;
const uint32 ledgeObjectCount = m_levelLedges.m_ledgeCount;
for(uint32 objectIdx = 0; objectIdx < ledgeObjectCount; ++objectIdx)
{
const SLedgeObject& ledgeObject = m_levelLedges.m_pLedgeObjects[objectIdx];
const uint32 startMarkerIdx = ledgeObject.m_markersStartIdx;
const uint32 endMarkerIdx = ledgeObject.m_markersStartIdx + ledgeObject.m_markersCount;
CRY_ASSERT ( endMarkerIdx <= m_levelLedges.m_markerCount );
const uint32 sideCount = 1 + ((ledgeObject.m_ledgeFlags[LedgeSide_In] & kLedgeFlag_isDoubleSided) != 0);
const bool enabled = (ledgeObject.m_ledgeFlags[LedgeSide_In] & kLedgeFlag_enabled) != 0;
CRY_ASSERT(sideCount <= 2);
uint32 currentSide = 0;
do
{
for (uint32 markerIdx = startMarkerIdx; markerIdx < (endMarkerIdx - 1); ++markerIdx)
{
ELedgeFlagBitfield flags = kLedgeFlag_none;
if (m_levelLedges.m_pMarkers[markerIdx].m_endOrCorner)
{
flags |= kledgeRunTimeOnlyFlag_p0IsEndOrCorner;
}
if (m_levelLedges.m_pMarkers[markerIdx+1].m_endOrCorner)
{
flags |= kledgeRunTimeOnlyFlag_p1IsEndOrCorner;
}
ledgeInfo = SLedgeInfo( ledgeObject.m_entityId, m_levelLedges.m_pMarkers[markerIdx].m_worldPosition, m_levelLedges.m_pMarkers[markerIdx+1].m_worldPosition,
m_levelLedges.m_pMarkers[markerIdx].m_facingDirection * side[currentSide], flags, ledgeObject.m_ledgeCornerEndAdjustAmount );
// Explanation: (Please do not delete this comment)
// The item can be skipped if the angle is too big.
// Since only the cosine of angles are compared,
// bigger angles result in smaller values (hence the less_than comparison)
const uint32 thresholdIdx = ((ledgeObject.m_ledgeFlags[currentSide] & (kLedgeFlag_useVault|kLedgeFlag_useHighVault)) != 0);
CRY_ASSERT( thresholdIdx < 2 );
const float fCosMaxAngle = fCosMaxAngleTable[thresholdIdx];
const Vec3 vPosToLedge = _FindVectorToClosestPointOnLedge( referencePosition, ledgeInfo );
float distanceSq;
if( IsBestLedge( vPosToLedge, testDirection, ledgeInfo, closestDistanceSq, fCosMaxAngle, enabled, distanceSq ) == false )
continue;
bestLedgeId = LedgeId( objectIdx, (markerIdx - startMarkerIdx), currentSide );
closestDistanceSq = distanceSq;
}
currentSide++;
} while ( currentSide < sideCount );
}
return bestLedgeId;
}
}
// ---------------------------------------------------
SLedgeInfo CLedgeManager::GetLedgeById( const LedgeId& ledgeId ) const
{
if ( m_editorManager.IsInEditorMode() )
{
return m_editorManager.GetLedgeById( ledgeId );
}
else
{
const uint16 objectIdx = ledgeId.GetLedgeObjectIdx();
if ( objectIdx < m_levelLedges.m_ledgeCount )
{
const SLedgeObject& ledgeObject = m_levelLedges.m_pLedgeObjects[objectIdx];
CRY_ASSERT( ledgeId.GetSubSegmentIdx() < ledgeObject.m_markersCount );
const uint16 segmentIdx = ledgeObject.m_markersStartIdx + ledgeId.GetSubSegmentIdx();
if ( segmentIdx < (m_levelLedges.m_markerCount - 1) )
{
const uint16 side = ledgeId.GetSide();
CRY_ASSERT( side < 2 );
const float sideValue[2] = { 1.0f, -1.0f };
const Vec3 facingDirection = m_levelLedges.m_pMarkers[segmentIdx].m_facingDirection * sideValue[side];
const EntityId entityId = (ledgeObject.m_ledgeFlags[side] & kLedgeFlag_static) ? 0 : ledgeObject.m_entityId;
ELedgeFlagBitfield flags = ledgeObject.m_ledgeFlags[side];
if (m_levelLedges.m_pMarkers[segmentIdx].m_endOrCorner)
{
flags |= kledgeRunTimeOnlyFlag_p0IsEndOrCorner;
}
if (m_levelLedges.m_pMarkers[segmentIdx + 1].m_endOrCorner)
{
flags |= kledgeRunTimeOnlyFlag_p1IsEndOrCorner;
}
return SLedgeInfo( entityId, m_levelLedges.m_pMarkers[segmentIdx].m_worldPosition, m_levelLedges.m_pMarkers[segmentIdx + 1].m_worldPosition, facingDirection, flags, ledgeObject.m_ledgeCornerEndAdjustAmount );
}
}
return SLedgeInfo();
}
}
Vec3 CLedgeManager::FindVectorToClosestPointOnLedge( const Vec3 &vPoint, const SLedgeInfo &ledgeInfo ) const
{
return _FindVectorToClosestPointOnLedge( vPoint, ledgeInfo );
}
void CLedgeManager::Serialize( TSerialize ser )
{
if (ser.IsReading())
{
ser.BeginGroup( "LevelLedges" );
{
uint32 objectsToSerialize = 0;
ser.Value( "serializedLedgeCount", objectsToSerialize );
for (uint32 idx = 0; idx < objectsToSerialize; ++idx)
{
ser.BeginGroup( "Ledge" );
{
uint32 objectIdx = 0;
ser.Value( "ledgeIndex", objectIdx );
if( objectIdx < m_levelLedges.m_ledgeCount )
{
SLedgeObject& ledgeObject = m_levelLedges.m_pLedgeObjects[objectIdx];
ser.Value( "flagsIn", ledgeObject.m_ledgeFlags[LedgeSide_In] );
ser.Value( "flagsOut", ledgeObject.m_ledgeFlags[LedgeSide_Out] );
uint32 markerCount = 0;
ser.Value( "markersCount", markerCount );
if( markerCount == ledgeObject.m_markersCount )
{
const uint32 markerEnd = ledgeObject.m_markersStartIdx + ledgeObject.m_markersCount;
CRY_ASSERT( markerEnd <= m_levelLedges.m_markerCount );
for( uint32 markerIdx = ledgeObject.m_markersStartIdx; markerIdx < markerEnd; ++markerIdx )
{
SLedgeMarker& marker = m_levelLedges.m_pMarkers[markerIdx];
ser.BeginGroup( "Marker" );
{
ser.Value( "pos", marker.m_worldPosition );
ser.Value( "dir", marker.m_facingDirection );
}
ser.EndGroup(); // "Marker"
}
}
else
{
//Save game not in synch with level data
GameWarning( "LedgeManager - Trying to update markers for ledge %d, but there is a mismatch in the markers count. %d-%d", objectIdx, markerCount, ledgeObject.m_markersCount );
}
}
else
{
//Save game not in synch with level data
GameWarning( "LedgeManager - Trying to load saved data for ledge %d, when there is only %d registered", objectIdx, m_levelLedges.m_ledgeCount );
}
}
ser.EndGroup(); // "Ledge"
}
}
ser.EndGroup(); // "LevelLedges"
}
else
{
ser.BeginGroup( "LevelLedges" );
{
uint32 objectsToSerialize = 0;
for (uint32 objectIdx = 0; objectIdx < m_levelLedges.m_ledgeCount; ++objectIdx)
{
objectsToSerialize += (m_levelLedges.m_pLedgeObjects[objectIdx].NeedsToBeSerialized());
}
ser.Value( "serializedLedgeCount", objectsToSerialize );
for (uint32 objectIdx = 0; objectIdx < m_levelLedges.m_ledgeCount; ++objectIdx)
{
SLedgeObject& ledgeObject = m_levelLedges.m_pLedgeObjects[objectIdx];
if ( ledgeObject.NeedsToBeSerialized() == false )
continue;
ser.BeginGroup( "Ledge" );
{
ser.Value( "ledgeIndex", objectIdx );
ser.Value( "flagsIn", ledgeObject.m_ledgeFlags[LedgeSide_In] );
ser.Value( "flagsOut", ledgeObject.m_ledgeFlags[LedgeSide_Out] );
ser.Value( "markersCount", ledgeObject.m_markersCount );
const uint32 markerEnd = ledgeObject.m_markersStartIdx + ledgeObject.m_markersCount;
CRY_ASSERT( markerEnd <= m_levelLedges.m_markerCount );
for( uint32 markerIdx = ledgeObject.m_markersStartIdx; markerIdx < markerEnd; ++markerIdx )
{
SLedgeMarker& marker = m_levelLedges.m_pMarkers[markerIdx];
ser.BeginGroup( "Marker" );
{
ser.Value( "pos", marker.m_worldPosition );
ser.Value( "dir", marker.m_facingDirection );
}
ser.EndGroup(); // "Marker"
}
}
ser.EndGroup(); // "Ledge"
}
}
ser.EndGroup(); // "LevelLedges"
}
}
void CLedgeManager::DebugDraw() const
{
if (m_editorManager.IsInEditorMode())
{
m_editorManager.DebugDraw();
}
else
{
const bool doDraw = (g_LedgeGrabManager_DebugDraw != 0);
if (doDraw)
{
IRenderAuxGeom* pRenderAuxGeometry = gEnv->pRenderer->GetIRenderAuxGeom();
const CCamera& viewCamera = gEnv->pSystem->GetViewCamera();
const Sphere visibleArea( viewCamera.GetPosition(), g_LedgeGrabManager_DebugDraw_Distance );
const int sideCountMultiplier[2] = { 1, 2 };
int totalLedgeCount = 0;
int nonStaticLedges = 0;
for (uint32 objectIdx = 0; objectIdx < m_levelLedges.m_ledgeCount; ++objectIdx)
{
const SLedgeObject& ledgeObject = m_levelLedges.m_pLedgeObjects[objectIdx];
const uint32 startMarkerIdx = ledgeObject.m_markersStartIdx;
const uint32 endMarkerIdx = ledgeObject.m_markersStartIdx + ledgeObject.m_markersCount;
CRY_ASSERT( endMarkerIdx <= m_levelLedges.m_markerCount );
const uint32 sideIdx = ((ledgeObject.m_ledgeFlags[LedgeSide_In] & kLedgeFlag_isDoubleSided) != 0);
CRY_ASSERT( sideIdx < 2 );
nonStaticLedges += (ledgeObject.m_entityId != 0);
totalLedgeCount += ((ledgeObject.m_markersCount - 1) * sideCountMultiplier[sideIdx]);
if ( PointInShere( m_levelLedges.m_pMarkers[startMarkerIdx].m_worldPosition, visibleArea) == false )
continue;
for (size_t markerIdx = startMarkerIdx; markerIdx < (endMarkerIdx - 1); ++markerIdx)
{
DrawLedge( pRenderAuxGeometry, m_levelLedges.m_pMarkers[markerIdx].m_worldPosition, m_levelLedges.m_pMarkers[markerIdx + 1].m_worldPosition, m_levelLedges.m_pMarkers[markerIdx].m_facingDirection, ledgeObject.m_ledgeFlags );
}
}
if (g_LedgeGrabManager_DebugDraw > 1)
{
gEnv->pRenderer->Draw2dLabel( 50.0f, 50.f, 1.5f, Col_White, false, "Total Number of ledges %d - Non static %d", totalLedgeCount, nonStaticLedges );
}
}
}
}
void CLedgeManager::RegisterCVars()
{
if (m_editorManager.IsInEditorMode() == false)
{
REGISTER_CVAR(g_LedgeGrabManager_DebugDraw, 0, VF_CHEAT, "Toggles debug rendering on ledges: 0 - Disabled / 1 - Enabled");
REGISTER_CVAR(g_LedgeGrabManager_DebugDraw_Distance, 35.0f, VF_CHEAT, "Max distance from camera at which ledges are rendered");
}
}
| [
"cloudcodexmain@gmail.com"
] | cloudcodexmain@gmail.com |
24075da9a2b4d5a725c0c269a3c7bee3c4933d26 | b6cf1c5ef5136da7f54db7418a0ff363bc0f04c6 | /Command-Abstract_Factory/Stack.h | b6ba0bc1cbf45db236a8076b07ea4d380e31ca1e | [] | no_license | ShamiJohnson/Design-Patterns | b46059f35aa7d4459522cb51a6b83510261a5366 | 5a9a7207676700c0fe23afa6b725c7de6e7bfc62 | refs/heads/master | 2022-03-24T19:20:25.788138 | 2020-01-14T03:58:14 | 2020-01-14T03:58:14 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,493 | h | // -*- C++ -*-
// $Id: Stack.h 380 2010-02-08 05:10:33Z hillj $
//==============================================================================
/**
* Honor Pledge:
*
* I pledge that I have neither given nor received any help
* on this assignment.
*/
//==============================================================================
#ifndef _CS507_STACK_H_
#define _CS507_STACK_H_
#include <exception>
#include <stdexcept>
#include "Array.h"
#define DEFAULT_SIZE 10
/**
* @class Stack
*
* Basic stack for abitrary elements.
*/
template <typename T>
class Stack
{
public:
/// Type definition of the type.
typedef T type;
/**
* @class empty_exception
*
* Exception thrown to indicate the stack is empty.
*/
class empty_exception : public std::exception
{
public:
/// Default constructor.
empty_exception (void)
: std::exception () { }
};
/// Default constructor.
Stack (void);
/// Copy constructor.
Stack (const Stack & s);
/// Destructor.
~Stack (void);
/**
* Assignment operator
*
* @param[in] rhs Right-hand side of operator
* @return Reference to self
*/
const Stack & operator = (const Stack & rhs);
/**
* Push a new \a element onto the stack. The element is inserted
* before all the other elements in the list.
*
* @param[in] element Element to add to the list
*/
void push (T element);
/**
* Remove the top-most element from the stack.
*
* @exception empty_exception The stack is empty.
*/
void pop (void);
/**
* Get the top-most element on the stack. If there are no element
* on the stack, then the stack_is_empty exception is thrown.
*
* @return Element on top of the stack.
* @exception empty_exception The stack is empty
*/
T top (void) const;
/**
* Test if the stack is empty
*
* @retval true The stack is empty
* @retval false The stack is not empty
*/
bool is_empty (void) const;
/**
* Number of element on the stack.
*
* @return Size of the stack.
*/
size_t size (void) const;
/// Remove all elements from the stack.
void clear (void);
private:
// add member variable here
Array<T> array;
int topIndex; //top of stacks
};
// include the inline files
#include "Stack.inl"
// include the source file since template class
#include "Stack.cpp"
#endif // !defined _CS507_STACK_H_
| [
"enisar@iu.edu"
] | enisar@iu.edu |
48e6d4cdabacc687ef37224cf34c171215c3a588 | 96d1d4e9ce08628f7d83a8ff9bbba7665a87eff7 | /main.cpp | c55cc2bc4d6b70ed21a6e4b2881801036ea455f2 | [
"BSD-3-Clause"
] | permissive | InfoSec812/ipmi-exercises | 441595a9263c217b68a63730feb900e5ab7e07c3 | 01a1164c93bf2ae755f08bf432841ca57e712af8 | refs/heads/master | 2021-04-06T05:22:31.887898 | 2018-04-07T12:38:34 | 2018-04-07T12:38:34 | 125,119,226 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,620 | cpp | /* Copyright 2018 Red Hat, Inc.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <iostream>
int main() {
std::cout << "Hello, World!" << std::endl;
return 0;
} | [
"deven.phillips@redhat.com"
] | deven.phillips@redhat.com |
873c3630ee677c20a9108c301cc609c5a8cdf61d | 419b7eaa4db52e3bee5866069063dc51ca44b890 | /Assembler.cpp | 4c394330fdd6eab773145d4b7b82732d9ac5f37f | [] | no_license | abishjha/VC-3600-Assembler-and-Emulator | a26e46e6364913a20e535c482902e83350578809 | 372ee64c7ded673b27e25ab49d4d021c62983cd0 | refs/heads/master | 2021-08-28T23:07:22.153052 | 2017-12-13T07:52:12 | 2017-12-13T07:52:12 | 114,090,633 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 7,783 | cpp | //
// Implementation of the Assembler class.
//
#include "stdafx.h"
#include "Assembler.h"
#include "Errors.h"
/**/
/*
Assembler::Assembler( int argc, char *argv[] )
NAME
Assembler::Assembler - constructor for the Assembler class.
SYNOPSIS
Assembler::Assembler( int argc, char *argv[] );
argc --> total number of arguments received in the command line.
*argv[] --> a pointer to the array of arguments passed through the command line.
DESCRIPTION
Constructor for the assembler. Note: we are passing argc and argv to the file access constructor.
RETURNS
AUTHOR
Abish Jha
DATE
12/05/2017
*/
/**/
Assembler::Assembler( int argc, char *argv[] )
: m_facc( argc, argv )
{
// Nothing else to do here at this point.
} /* Assembler::Assembler( int argc, char *argv[] ) */
/**/
/*
Assembler::PassI()
NAME
Assembler::PassI - first pass through the source code.
SYNOPSIS
Assembler::PassI();
DESCRIPTION
This function is the first pass for the Assembler. Pass I establishes the location of the
labels and constructs a symbol table using the SymbolTable class.
RETURNS
AUTHOR
Abish Jha
DATE
12/05/2017
*/
/**/
void Assembler::PassI()
{
int loc = 0; // Tracks the location of the instructions to be generated.
// Successively process each line of source code.
for (; ; ) {
// Read the next line from the source file.
string buff;
if (!m_facc.GetNextLine(buff)) {
// If there are no more lines, we are missing an end statement.
// We will let this error be reported by Pass II.
return;
}
// Parse the line and get the instruction type.
Instruction::InstructionType st = m_inst.ParseInstruction(buff);
// If this is an end statement, there is nothing left to do in pass I.
// Pass II will determine if the end is the last statement.
if (st == Instruction::ST_End) return;
// Labels can only be on machine language and assembler language
// instructions. So, skip other instruction types.
if (st != Instruction::ST_MachineLanguage && st != Instruction::ST_AssemblerInstr)
{
continue;
}
// If the instruction has a label, record it and its location in the
// symbol table.
if (m_inst.isLabel()) {
m_symtab.AddSymbol(m_inst.GetLabel(), loc);
}
// Compute the location of the next instruction.
loc = m_inst.LocationNextInstruction(loc);
}
} /* void Assembler::PassI() */
/**/
/*
Assembler::PassII()
NAME
Assembler::PassII - second pass through the source code.
SYNOPSIS
void Assembler::PassII();
DESCRIPTION
Pass II does a second traversal of the source code. It uses the symbol table established in Pass I
and starts translating the source code into code for the VC-3600 computer. Pass II does the most
work in this project as it translates the instructions, it records any errors encountered, and stores
the translated instruction in a vector of pairs for further use. Pass II also prints out the original
statement and the translated code for every line of instruction in the source code with help from the
TranslateInstruction function in the Instruction class. At the end, if errors have been encountered,
the function prints them out.
RETURNS
AUTHOR
Abish Jha
DATE
12/05/2017
*/
/**/
void Assembler::PassII()
{
m_facc.rewind(); // Resets the flags for the open file so it can be read again from the top
int loc = 0; // Tracks the location of the instructions to be generated.
bool is_end = false; // Flag to indicate if the code has hit the end statement
Errors::InitErrorReporting();
// Clearing the vector which will hold the (location, content) pair which will be fed into the emulator
m_machinecode.clear();
// Print the header for the translation table output . The rest is printed by the Instruction class
cout << setw(12) << left << "Location" << setw(12) << left << "Contents" << "Original Statement" << endl;
// Successively process each line of source code.
for (; ; ) {
// Read the next line from the source file.
string buff;
if (!m_facc.GetNextLine(buff)) {
// Returned as was expected with no lines after code
if (is_end == true)
break;
// Report error : since there are no more lines, we are missing an end statement
string error = "(location " + to_string(loc) + ") Missing end statement";
Errors::RecordError(error);
break;
}
if (is_end == true) {
string error = "(location " + to_string(loc) + ") Lines after end statement";
Errors::RecordError(error);
break;
}
pair<int, string> translation = m_inst.TranslateInstruction(buff, loc);
// Set the is_end flag to true to indicate the apperance of end statement
if (translation == pair<int, string>(0, "end") )
is_end = true;
// Do not push the pair onto the vector if there is no valid machine code
else if (translation != pair<int, string>(0, "n/a"))
m_machinecode.push_back(translation);
// Compute the location of the next instruction.
loc = m_inst.LocationNextInstruction(loc);
}
if (!Errors::Empty())
Errors::DisplayErrors();
cout << "Press Enter to continue...";
cin.ignore();
} /* void Assembler::PassII() */
/**/
/*
Assembler::RunEmulator()
NAME
Assembler::RunEmulator - run the emulator on the translated code.
SYNOPSIS
void Assembler::RunEmulator();
DESCRIPTION
Run the emulator on the translated code from Pass II. If errors have been encountered, emulation is halted.
If not, the function loads all the translated instruction into the emulator's memory and then runs the emulator.
This function also detects errors encountered during emulation and reports them after.
RETURNS
AUTHOR
Abish Jha
DATE
12/05/2017
*/
/**/
void Assembler::RunEmulator()
{
// Terminate emulation if errors are encountered
if (!Errors::Empty()) {
cout << "Errors were encountered during compilation...\nExiting emulation\n";
return;
}
// Insert the machine code into the emulator class and report errors.
for (vector<pair<int, string>>::iterator it = m_machinecode.begin(); it != m_machinecode.end(); ++it) {
bool insertion_check = m_emul.insertMemory(it->first, stoi(it->second));
if (insertion_check == false) {
string error = "Error inserting the command " + to_string(it->first) + " " + it->second + " into the emulator memory";
Errors::RecordError(error);
}
}
// Run program and report error if encountered any.
bool run_check = m_emul.runProgram();
if (run_check == false) {
string error = "Error running the emulator";
Errors::RecordError(error);
}
// Display any errors encountered during emulation.
if (!Errors::Empty())
Errors::DisplayErrors();
cout << "Press Enter to continue...\n";
cin.ignore();
} /* void Assembler::RunEmulator() */
| [
"noreply@github.com"
] | noreply@github.com |
8b482283744c58f6cb1ed06fb84af68fe8d86642 | 3e69b159d352a57a48bc483cb8ca802b49679d65 | /tags/release-2006-01-06/pcbnew/lay2plot.cpp | 5cdbfe3b69822c807e40d290f64d4a98d2d3a4db | [] | no_license | BackupTheBerlios/kicad-svn | 4b79bc0af39d6e5cb0f07556eb781a83e8a464b9 | 4c97bbde4b1b12ec5616a57c17298c77a9790398 | refs/heads/master | 2021-01-01T19:38:40.000652 | 2006-06-19T20:01:24 | 2006-06-19T20:01:24 | 40,799,911 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 6,588 | cpp | /**********************************************/
/* Routine de selection de couches pour trace */
/**********************************************/
#include "fctsys.h"
#include "gr_basic.h"
#include "common.h"
#include "pcbnew.h"
#include "pcbplot.h"
#include "protos.h"
/* Variables locales : */
/* Routines Locales */
static void Plot_Module(WinEDA_DrawPanel * panel, wxDC * DC, MODULE * Module,
int draw_mode, int masklayer);
/****************************/
int GetLayerNumber(void)
/****************************/
/* retourne le nombre de couches a tracer
*/
{
int ii = 29;
//TO REDO
return ii;
}
/**********************************************************************************/
void WinEDA_DrawPanel::PrintPage(wxDC *DC, bool Print_Sheet_Ref, int printmasklayer)
/**********************************************************************************/
/* routine de trace du pcb, avec selection des couches */
{
MODULE * Module;
EDA_BaseStruct * PtStruct;
int drawmode = GR_COPY;
DISPLAY_OPTIONS save_opt;
TRACK * pt_piste;
WinEDA_BasePcbFrame * frame = (WinEDA_BasePcbFrame *) m_Parent;
BOARD * Pcb = frame->m_Pcb;
save_opt = DisplayOpt;
if( printmasklayer & ALL_CU_LAYERS ) DisplayOpt.DisplayPadFill = FILLED;
else DisplayOpt.DisplayPadFill = SKETCH;
frame->m_DisplayPadFill = DisplayOpt.DisplayPadFill;
frame->m_DisplayPadNum = DisplayOpt.DisplayPadNum = FALSE;
DisplayOpt.DisplayPadNoConn = FALSE;
DisplayOpt.DisplayPadIsol = FALSE;
DisplayOpt.DisplayModEdge = FILLED;
DisplayOpt.DisplayModText = FILLED;
frame->m_DisplayPcbTrackFill = DisplayOpt.DisplayPcbTrackFill = FILLED;
DisplayOpt.DisplayTrackIsol = FALSE;
DisplayOpt.DisplayDrawItems = FILLED;
DisplayOpt.DisplayZones = TRUE;
printmasklayer |= EDGE_LAYER;
/* Trace des elements particuliers de Drawings Pcb */
PtStruct = Pcb->m_Drawings;
for( ; PtStruct != NULL; PtStruct = PtStruct->Pnext )
{
switch(PtStruct->m_StructType)
{
case TYPEDRAWSEGMENT:
if( (g_TabOneLayerMask[((DRAWSEGMENT*)PtStruct)->m_Layer] & printmasklayer) == 0 )
break;
Trace_DrawSegmentPcb(this, DC, (DRAWSEGMENT*) PtStruct, drawmode);
break;
case TYPECOTATION:
if( (g_TabOneLayerMask[((COTATION*)PtStruct)->m_Layer] & printmasklayer) == 0 )
break;
((COTATION*) PtStruct)->Draw(this, DC, wxPoint(0,0), drawmode);
break;
case TYPETEXTE:
{
if( (g_TabOneLayerMask[((TEXTE_PCB *)PtStruct)->m_Layer] & printmasklayer) == 0 )
break;
((TEXTE_PCB *) PtStruct)->Draw(this, DC, wxPoint(0,0), drawmode);
break;
}
case TYPEMIRE:
if( (g_TabOneLayerMask[((MIREPCB*)PtStruct)->m_Layer] & printmasklayer) == 0 ) break;
((MIREPCB*) PtStruct)->Draw(this, DC, wxPoint(0,0), drawmode);
break;
case TYPEMARQUEUR: /* Trace des marqueurs */
break;
default: break;
}
}
/* trace des pistes */
pt_piste = Pcb->m_Track;
for ( ; pt_piste != NULL ; pt_piste = (TRACK*) pt_piste->Pnext )
{
if( (printmasklayer & pt_piste->ReturnMaskLayer() ) == 0 ) continue;
if ( pt_piste->m_StructType == TYPEVIA ) /* VIA rencontree */
{
int rayon = pt_piste->m_Width >> 1;
int color = g_DesignSettings.m_ViaColor[pt_piste->m_Shape];
GRSetDrawMode(DC, drawmode);
GRFilledCircle(&m_ClipBox, DC, pt_piste->m_Start.x, pt_piste->m_Start.y,
rayon, color, color) ;
}
else pt_piste->Draw(this, DC, drawmode);
}
pt_piste = Pcb->m_Zone;
for ( ; pt_piste != NULL ; pt_piste = (TRACK*) pt_piste->Pnext )
{
if( (printmasklayer & pt_piste->ReturnMaskLayer() ) == 0 ) continue ;
pt_piste->Draw(this, DC, drawmode);
}
// Trace des modules en dernier, pour imprimer en blanc le trou des pastilles
Module = (MODULE*) Pcb->m_Modules;
for ( ; Module != NULL; Module = (MODULE *) Module->Pnext )
{
Plot_Module(this, DC, Module, drawmode, printmasklayer);
}
/* trace des trous des vias*/
pt_piste = Pcb->m_Track;
int rayon = g_DesignSettings.m_ViaDrill / 2;
int color = WHITE;
for ( ; pt_piste != NULL ; pt_piste = (TRACK*) pt_piste->Pnext )
{
if( (printmasklayer & pt_piste->ReturnMaskLayer() ) == 0 ) continue;
if ( pt_piste->m_StructType == TYPEVIA ) /* VIA rencontree */
{
GRSetDrawMode(DC, drawmode);
GRFilledCircle(&m_ClipBox, DC, pt_piste->m_Start.x, pt_piste->m_Start.y,
rayon, color, color) ;
}
}
if ( Print_Sheet_Ref )
m_Parent->TraceWorkSheet( DC, ActiveScreen);
DisplayOpt = save_opt;
frame->m_DisplayPcbTrackFill = DisplayOpt.DisplayPcbTrackFill;
frame->m_DisplayPadFill = DisplayOpt.DisplayPadFill;
frame->m_DisplayPadNum = DisplayOpt.DisplayPadNum;
}
/***********************************************************/
static void Plot_Module(WinEDA_DrawPanel * panel, wxDC * DC,
MODULE * Module, int draw_mode, int masklayer)
/***********************************************************/
{
D_PAD * pt_pad ;
EDA_BaseStruct * PtStruct;
TEXTE_MODULE * TextMod;
int mlayer;
/* trace des pastilles */
pt_pad = Module->m_Pads;
for( ; pt_pad != NULL; pt_pad = (D_PAD*) pt_pad->Pnext )
{
if( (pt_pad->m_Masque_Layer & masklayer ) == 0 ) continue;
pt_pad->Draw(panel, DC, wxPoint(0,0), draw_mode);
}
/* impression des graphismes */
PtStruct = Module->m_Drawings;
mlayer = g_TabOneLayerMask[Module->m_Layer];
if( Module->m_Layer == CUIVRE_N) mlayer = SILKSCREEN_LAYER_CU;
if( Module->m_Layer == CMP_N) mlayer = SILKSCREEN_LAYER_CMP;
if( mlayer & masklayer )
{
/* Analyse des autorisations de trace pour les textes VALEUR et REF */
bool trace_val, trace_ref;
trace_val = trace_ref = TRUE; // les 2 autorisations de tracer sont donnees
if(Module->m_Reference->m_NoShow) trace_ref = FALSE;
if(Module->m_Value->m_NoShow) trace_val = FALSE;
if(trace_ref)
Module->m_Reference->Draw(panel, DC, wxPoint(0,0), draw_mode );
if(trace_val)
Module->m_Value->Draw(panel, DC, wxPoint(0,0), draw_mode );
}
for( ;PtStruct != NULL; PtStruct = PtStruct->Pnext )
{
switch( PtStruct->m_StructType )
{
case TYPETEXTEMODULE:
if( (mlayer & masklayer ) == 0) break;
TextMod = (TEXTE_MODULE *) PtStruct;
TextMod->Draw(panel, DC, wxPoint(0,0), draw_mode );
break;
case TYPEEDGEMODULE:
{
EDGE_MODULE * edge = (EDGE_MODULE *) PtStruct;
if( (g_TabOneLayerMask[edge->m_Layer] & masklayer ) == 0) break;
edge->Draw(panel, DC, wxPoint(0,0), draw_mode);
break;
}
default: break;
}
}
}
| [
"bokeoa@244deca0-f506-0410-ab94-f4f3571dea26"
] | bokeoa@244deca0-f506-0410-ab94-f4f3571dea26 |
16649f87e999f54df41f2039c6cb51218548bc68 | e7139c0813d278a4a7c7a979f2beb1d09b9b3fac | /Source/City/ApartmentSpecification.h | df033124cea08e0ab8e38f2e23a5ab29f6d25448 | [
"MIT"
] | permissive | magnificus/Procedural-Cities | b6befdb2490d9dabba09a83b46fd62c826ef727f | 5a2f1f501a7d736055b3f5e4cc16030d1e01337c | refs/heads/master | 2022-06-02T18:40:06.434228 | 2020-06-19T20:42:24 | 2020-06-19T20:42:24 | 86,442,951 | 614 | 138 | MIT | 2020-06-19T20:42:25 | 2017-03-28T09:46:44 | C++ | UTF-8 | C++ | false | false | 3,559 | h | #pragma once
#include "CoreMinimal.h"
#include "RoomBuilder.h"
/**
* In here and in ApartmentSpecification.cpp the specifications for the different apartments are defined. Expanding the number of apartments should be easy by just following the same structure, make sure you use the new specifications when generating interiors in HouseBuilder as well.
*/
class CITY_API ApartmentSpecification
{
public:
ApartmentSpecification();
virtual ~ApartmentSpecification();
virtual RoomBlueprint getBlueprint(float areaScale) = 0;
virtual FRoomInfo buildApartment(FRoomPolygon *f, int floor, float height, TMap<FString, UHierarchicalInstancedStaticMeshComponent*> &map, bool potentialBalcony, bool shellOnly, FRandomStream stream);
virtual void intermediateInteractWithRooms(TArray<FRoomPolygon*> &roomPols, FRoomInfo &r, TMap<FString, UHierarchicalInstancedStaticMeshComponent*> &map, bool potentialBalcony) {};
void placeEntranceMeshes(FRoomInfo &r, FRoomPolygon *r2);
virtual float getWindowDensity(FRandomStream stream) = 0;
virtual float getWindowWidth(FRandomStream stream) = 0;
virtual float getWindowHeight(FRandomStream stream) = 0;
virtual bool getWindowFrames() = 0;
virtual float getMaxApartmentSize() = 0;
};
class CITY_API OfficeSpecification : public ApartmentSpecification
{
public:
RoomBlueprint getBlueprint(float areaScale);
float getWindowDensity(FRandomStream stream) { return 1; }
float getWindowWidth(FRandomStream stream) { return stream.FRandRange(200, 400); }
float getWindowHeight(FRandomStream stream) { return stream.FRandRange(200, 300); }
bool getWindowFrames() { return false; }
float getMaxApartmentSize() { return 600; }
};
class CITY_API LivingSpecification : public ApartmentSpecification
{
public:
RoomBlueprint getBlueprint(float areaScale);
void intermediateInteractWithRooms(TArray<FRoomPolygon*> &roomPols, FRoomInfo &r, TMap<FString, UHierarchicalInstancedStaticMeshComponent*> &map, bool potentialBalcony);
float getWindowDensity(FRandomStream stream) { return 0.003; }
float getWindowWidth(FRandomStream stream) { return 200.0f; }
float getWindowHeight(FRandomStream stream) { return 200.0f; }
bool getWindowFrames() { return true;}
float getMaxApartmentSize() { return 400; }
};
class CITY_API StoreSpecification : public ApartmentSpecification
{
public:
RoomBlueprint getBlueprint(float areaScale);
void intermediateInteractWithRooms(TArray<FRoomPolygon*> &roomPols, FRoomInfo &r, TMap<FString, UHierarchicalInstancedStaticMeshComponent*> &map, bool potentialBalcony);
float getWindowDensity(FRandomStream stream) { return 1; }
float getWindowWidth(FRandomStream stream) { return stream.FRandRange(200, 400); }
float getWindowHeight(FRandomStream stream) { return stream.FRandRange(200, 300); }
bool getWindowFrames() { return true; }
float getMaxApartmentSize() { return 5000; }
};
class CITY_API RestaurantSpecification : public ApartmentSpecification
{
public:
RoomBlueprint getBlueprint(float areaScale);
void intermediateInteractWithRooms(TArray<FRoomPolygon*> &roomPols, FRoomInfo &r, TMap<FString, UHierarchicalInstancedStaticMeshComponent*> &map, bool potentialBalcony);
float getWindowDensity(FRandomStream stream) { return 1; }
float getWindowWidth(FRandomStream stream) { return stream.FRandRange(200, 400); }
float getWindowHeight(FRandomStream stream) { return stream.FRandRange(200, 300); }
bool getWindowFrames() { return true; }
float getMaxApartmentSize() { return 5000; }
};
| [
"tobiaselinder@gmail.com"
] | tobiaselinder@gmail.com |
2794b5c411a01908c245abea5a0099c88eb108fe | 6b09043b97fb379aebd4363ff07d4cc53e8ec0b9 | /Day 11/11-DailyFlash_Solutions/25_Jan_Solutions_Three/C++/prog3.cpp | 1585954d72024ee339a685af6050d2e9611f31fb | [] | no_license | Aadesh-Shigavan/Python_Daily_Flash | 6a4bdd73a33f533f3b121fae9eef973e10bf3945 | b118beeca3f4c97de54ae1a610f83da81157009a | refs/heads/master | 2022-11-28T13:03:17.573906 | 2020-08-06T15:36:36 | 2020-08-06T15:36:36 | 276,581,310 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 325 | cpp | #include<iostream>
int main() {
int num1, num2;
std::cout << "Enter num1 : ";
std::cin >> num1;
std::cout << "Enter num2 : ";
std::cin >> num2;
for(int i = num1; i <= num2; i++) {
if(i % 2 == 0)
std::cout << "Sqr of : " << i << " : " << i * i << "\nCube of " << i << " : " << i * i * i << "\n\n";
}
return 0;
}
| [
"aadesh.shigavan01@gmail.com"
] | aadesh.shigavan01@gmail.com |
495888ce3c74d75a086b5892598a5e81026240ef | d66f95e3cbb7030b5c5b476a0cc50ac126ff64ad | /practice/week-10/example_map.cpp | 286bba9fcf2632a66c4087cb281c5c97b493d519 | [] | no_license | ceko98/sdp-kn-group2-2020 | 8f9d5de40668563440ffa22956bd1ec138b66b52 | 30e8007381d0c2051629c31f0f52dffa924764ad | refs/heads/main | 2023-02-21T02:37:17.722468 | 2021-01-21T11:20:37 | 2021-01-21T11:20:37 | 302,458,162 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 592 | cpp | #include <iostream>
#include <string>
#include <map>
using namespace std;
class Person
{
public:
string first;
string last;
int age;
public:
Person(int age) : age(age) {};
bool operator<(const Person& other) const
{
return age < other.age;
}
};
// template <>
// struct std::less<Person>
// {
// bool operator()(const Person &a, const Person &b)
// {
// return a.age < b.age;
// }
// };
int main()
{
map<Person, int> mp;
Person a(2);
Person b(3);
mp[a] = 2;
mp[b] = 3;
cout << mp[a] << endl;
return 0;
} | [
"ceko9898@gmail.com"
] | ceko9898@gmail.com |
ddbb8fe29366368d485e36ba85d388fc5523e2df | 230b7714d61bbbc9a75dd9adc487706dffbf301e | /components/feed/content/feed_offline_host.h | 66a9fdf7071ae7518afcc71edd3b78226600ec0d | [
"BSD-3-Clause"
] | permissive | byte4byte/cloudretro | efe4f8275f267e553ba82068c91ed801d02637a7 | 4d6e047d4726c1d3d1d119dfb55c8b0f29f6b39a | refs/heads/master | 2023-02-22T02:59:29.357795 | 2021-01-25T02:32:24 | 2021-01-25T02:32:24 | 197,294,750 | 1 | 2 | BSD-3-Clause | 2019-09-11T19:35:45 | 2019-07-17T01:48:48 | null | UTF-8 | C++ | false | false | 6,432 | h | // Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef COMPONENTS_FEED_CONTENT_FEED_OFFLINE_HOST_H_
#define COMPONENTS_FEED_CONTENT_FEED_OFFLINE_HOST_H_
#include <string>
#include <vector>
#include "base/callback.h"
#include "base/containers/flat_map.h"
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "base/optional.h"
#include "components/feed/core/content_metadata.h"
#include "components/offline_pages/core/offline_page_model.h"
#include "components/offline_pages/core/prefetch/suggestions_provider.h"
class GURL;
namespace offline_pages {
class PrefetchService;
} // namespace offline_pages
namespace feed {
// Responsible for wiring up connections for Feed operations pertaining to
// articles that can be loaded from Offline Pages component. Most significantly
// this class connects Prefetch and the Feed, and tracks offlined articles the
// Feed may have badged for this user. This knowledge is later used when Feed
// articles are opened to populate load params.
class FeedOfflineHost : public offline_pages::SuggestionsProvider,
public offline_pages::OfflinePageModel::Observer {
public:
using GetKnownContentCallback =
base::OnceCallback<void(std::vector<ContentMetadata>)>;
using NotifyStatusChangeCallback =
base::RepeatingCallback<void(const std::string&, bool)>;
FeedOfflineHost(offline_pages::OfflinePageModel* offline_page_model,
offline_pages::PrefetchService* prefetch_service,
base::RepeatingClosure on_suggestion_consumed,
base::RepeatingClosure on_suggestions_shown);
~FeedOfflineHost() override;
// Initialize with callbacks to call into bridge/Java side. Should only be
// called once, and done as soon as the bridge is ready. The FeedOfflineHost
// will not be fully ready to perform its function without these dependencies.
// Neither of these callbacks will be invoked until after this method exits.
void Initialize(const base::RepeatingClosure& trigger_get_known_content,
const NotifyStatusChangeCallback& notify_status_change);
// Called during initialization make ourselves known to |prefetch_service_|.
// This method is used to wrap PrefetchService::SetSuggestionProvider() to let
// our weak pointer guarantee everyone is still alive.
void SetSuggestionProvider();
// Synchronously returns the offline id of the given page. The host will only
// have knowledge of the page if it had previously returned status about it
// through GetOfflineState() or as a notification. Otherwise the caller will
// receive a false negative. Additionally, since the host tracks pages by
// hashing, there's also a small chance that the host erroneously returns an
// id for a page that is not offlined.
base::Optional<int64_t> GetOfflineId(const std::string& url);
// Asynchronously fetches offline status for the given URLs. Any pages that
// are currently offlined will be remembered by the FeedOfflineHost.
void GetOfflineStatus(
std::vector<std::string> urls,
base::OnceCallback<void(std::vector<std::string>)> callback);
// Should be called from Feed any time the user manually removes articles or
// groupings of articles. Propagates the signal to Prefetch.
void OnContentRemoved(std::vector<std::string> urls);
// Should be called from Feed any time new articles are fetched.
void OnNewContentReceived();
// Should be called from Feed side any time there are no active surfaces
// displaying articles and listening to our notifications. This signal is used
// to clear local tracking of offlined items.
void OnNoListeners();
// Should be called when async GetKnownContent is completed. Broadcasts to all
// waiting consumers in |pending_known_content_callbacks_|.
void OnGetKnownContentDone(std::vector<ContentMetadata> suggestions);
// offline_pages::SuggestionsProvider:
void GetCurrentArticleSuggestions(
offline_pages::SuggestionsProvider::SuggestionCallback
suggestions_callback) override;
void ReportArticleListViewed() override;
void ReportArticleViewed(GURL article_url) override;
// offline_pages::OfflinePageModel::Observer:
void OfflinePageModelLoaded(offline_pages::OfflinePageModel* model) override;
void OfflinePageAdded(
offline_pages::OfflinePageModel* model,
const offline_pages::OfflinePageItem& added_page) override;
void OfflinePageDeleted(
const offline_pages::OfflinePageItem& deleted_page) override;
private:
// Stores the given record in |url_hash_to_id_|. If there's a conflict, the
// new id will overwrite the old value.
void CacheOfflinePageUrlAndId(const std::string& url, int64_t id);
// Removes a previously cached |id| for the given |url| if there was one.
void EvictOfflinePageUrl(const std::string& url);
// The following objects all outlive us, so it is safe to hold raw pointers to
// them. This is guaranteed by the FeedHostServiceFactory.
offline_pages::OfflinePageModel* offline_page_model_;
offline_pages::PrefetchService* prefetch_service_;
base::RepeatingClosure on_suggestion_consumed_;
base::RepeatingClosure on_suggestions_shown_;
// Only offlined pages that have passed through the host are stored. If there
// are ever no listeners to the offline host logic and OnNoListeners() is
// called this map is cleared. The key is the hash of the url, and the value
// is the offline id for the given page.
base::flat_map<uint32_t, int64_t> url_hash_to_id_;
// Starts an the async request for ContentMetadata through KnownContentApi's
// GetKnownContent(). Will only be invoked when there isn't already an
// outstanding GetKnownContent().
base::RepeatingClosure trigger_get_known_content_;
// Holds all consumers of GetKnownContent(). It is assumed that there's an
// outstanding GetKnownContent() if and only if this vector is not empty.
std::vector<GetKnownContentCallback> pending_known_content_callbacks_;
// Calls all OfflineStatusListeners with the updated status.
NotifyStatusChangeCallback notify_status_change_;
base::WeakPtrFactory<FeedOfflineHost> weak_factory_{this};
DISALLOW_COPY_AND_ASSIGN(FeedOfflineHost);
};
} // namespace feed
#endif // COMPONENTS_FEED_CONTENT_FEED_OFFLINE_HOST_H_
| [
"commit-bot@chromium.org"
] | commit-bot@chromium.org |
86fe3b945d6b89261d56175e4b6f0ce52810c5c5 | 23034a6d9eec66ca1ee69d64858b56e7fc9d6ea1 | /DoublyLinkedList/DoublyLinkedList.cpp | e634d190b3e7a12d4d9af6f6b1d1124fff1f935d | [] | no_license | DartzMok/Mok_assignment3 | 3c5480398f4d3f9850ffc22b164d3cd695b3153a | 4236fbe198bb5f5b95d8f922bf01b4305db61807 | refs/heads/master | 2023-03-10T06:22:18.660682 | 2021-02-22T16:49:12 | 2021-02-22T16:49:12 | 335,342,623 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,291 | cpp | #include "DoublyLinkedList.h"
#include "ItemType.h"
#include <iostream>
#include <string>
#include <stdlib.h>
#include <exception>
using namespace std;
DoublyLinkedList::DoublyLinkedList(){
head = NULL;
tail = NULL;
length = 0;
}
int DoublyLinkedList::lengthIs() const{
return length;
}
void DoublyLinkedList::print(){
if(length != 0){
NodeType *temp = head;
for(int i = 0; i < length; i++){
temp -> data.print();
cout << " ";
temp = temp -> next;
}
}
cout << endl;
}
void DoublyLinkedList::printReverse(){
NodeType *temp = tail;
for(int i = 0; i < length; i++){
temp -> data.print();
cout << " ";
temp = temp -> back;
}
cout << endl;
}
void DoublyLinkedList::insertItem(ItemType &item){
NodeType *temp = new NodeType;
temp -> data = item;
if(length == 0){
head = temp;
tail = temp;
length++;
}
else{
NodeType *dupl = head;
bool duplicate = false;
for(int i = 0; i < length; i++){
if(dupl -> data.compareTo(item) == EQUAL){
duplicate = true;
}
dupl = dupl -> next;
}
if(!duplicate){
if(head -> data.compareTo(item) == GREATER){
temp -> next = head;
head -> back = temp;
head = temp;
length++;
}
else if(tail -> data.compareTo(item) == LESS){
temp -> back = tail;
tail -> next = temp;
tail = temp;
length++;
}
else{
NodeType *checker = head;
bool found = false;
while(!found){
if(checker -> data.compareTo(item) == LESS){
checker = checker -> next;
}
else{
found = true;
}
}
temp -> back = checker -> back;
temp -> next = checker;
checker -> back -> next = temp;
checker -> back = temp;
length++;
}
}
else{
delete temp;
cout << "Sorry. You cannot insert a duplicate item" << endl;
}
}
}
void DoublyLinkedList::deleteItem(ItemType &item){
if(length == 0){
cout << "Sorry you cannot delete from an empty list" << endl;
}
else if(length == 1){
delete head;
head = NULL;
tail = NULL;
length--;
}
else{
bool itemFound = false;
NodeType *checker = head;
for(int i = 0; i < length; i++){
if(checker -> data.compareTo(item) == EQUAL){
itemFound = true;
}
else{
checker = checker -> next;
}
}
if(itemFound){
if(head -> data.compareTo(item) == EQUAL){
item = head -> data;
head = head -> next;
delete checker;
length--;
}
else if(tail -> data.compareTo(item) == EQUAL){
item = tail -> data;
tail = tail -> back;
delete checker;
length--;
}
else{
item = checker -> data;
checker -> back -> next = checker -> next;
checker -> next -> back = checker -> back;
delete checker;
length--;
}
}
else{
cout << "Item not in list!" << endl;
}
}
}
DoublyLinkedList::~DoublyLinkedList(){
if(length != 0){
NodeType *temp = NULL;
for(int i = 0; i < length; i++){
temp = head;
head = head -> next;
delete temp;
}
}
length = 0;
}
| [
"ethan.w.mok@gmail.com"
] | ethan.w.mok@gmail.com |
0adb8c3ecaf6203b8ab7cb994446aeff564397f7 | 514e53d25623da6f29dc9b95eb5d3f9a74e6b52c | /docs/examples/Paint_003.cpp | 0ee293b6f6261e91de18693e1b9ace0e34342091 | [
"BSD-3-Clause"
] | permissive | xiaofei2ivan/skia | f7230aa17f7f1cf11420a3c3d355ee8955794917 | d95286de1dda8c1c0403de22151e1b2a9b7ddf96 | refs/heads/master | 2021-10-22T11:59:22.331872 | 2019-03-16T22:05:45 | 2019-03-16T23:04:07 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 440 | cpp | // Copyright 2019 Google LLC.
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
#include "fiddle/examples.h"
// HASH=ef269937ade7e7353635121d9a64f9f7
REG_FIDDLE(Paint_003, 256, 256, true, 0) {
void draw(SkCanvas* canvas) {
SkPaint paint1, paint2;
paint1.setColor(SK_ColorRED);
paint1.reset();
SkDebugf("paint1 %c= paint2", paint1 == paint2 ? '=' : '!');
}
} // END FIDDLE
| [
"halcanary@google.com"
] | halcanary@google.com |
93dea82106b5e81eedfb4a01a2501b8842d902e2 | ef1dc4f96cf3fce75dcf727f8af0c4ea6c825047 | /src/textures/texture.hpp | 0c0c2cd1ce76d7eb80ae074012134d9426c78863 | [
"MIT"
] | permissive | demonixis/SFMLRaytracer | 19a838c700feff67231e9cc47ab4d15f8f4a8480 | d3bc8523a6c66f9754d882966c8ffc2b20cfbf84 | refs/heads/master | 2020-03-16T15:35:51.792032 | 2018-05-16T17:13:36 | 2018-05-16T17:13:36 | 132,750,564 | 2 | 0 | MIT | 2018-05-11T09:12:27 | 2018-05-09T12:01:50 | C++ | UTF-8 | C++ | false | false | 196 | hpp | #ifndef TEXTURE_HPP
#define TEXTURE_HPP
#include <glm.hpp>
class Texture
{
public:
virtual glm::vec3 Value(const float u, const float v, const glm::vec3 &p) { return glm::vec3(0); };
};
#endif | [
"comte.yannick@gmail.com"
] | comte.yannick@gmail.com |
3b80fe80033db598136d3abc9d59dda08c17068b | fe35c9799bc3171f7918ad2883faa3a36eff53ca | /group-privacy-client/group_privacy/step_out_group_signatures/OPEProcedureInput.hpp | f7ef0d8fad7b41d92cfe66fb90b0d9e114612352 | [] | no_license | pawel-kieliszczyk/step-out-group-signatures | 63a1312b97884a40f8344a884e4dd62187fe07d3 | fc2c81f01a9760f5a79719e02f52ae369e8bc2a4 | refs/heads/master | 2020-12-24T14:17:44.677979 | 2018-09-12T18:13:37 | 2018-09-12T18:13:37 | 31,135,798 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 2,422 | hpp | /**
* @file OPEProcedureInput.hpp
* @author Pawel Kieliszczyk <pawel.kieliszczyk@gmail.com>
* @version 1.0
*
* @section LICENSE
*
* Copyright (C) 2011 Pawel Kieliszczyk
*
* This file is part of Group Privacy.
*
* Group Privacy is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Group Privacy 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 Group Privacy. If not, see <http://www.gnu.org/licenses/>.
*
* @section DESCRIPTION
*/
#ifndef OPEPROCEDUREINPUT_HPP
#define OPEPROCEDUREINPUT_HPP
#include "../mpi/BigInteger.hpp"
#include "StepOutGroupSignaturesConstants.hpp"
#include <boost/array.hpp>
#include <boost/serialization/array.hpp>
#include <boost/serialization/access.hpp>
#include <boost/tuple/tuple.hpp>
class OPEProcedureInputElement : public boost::tuple<BigInteger, BigInteger>
{
friend class boost::serialization::access;
public:
OPEProcedureInputElement();
OPEProcedureInputElement(const BigInteger& t, const BigInteger& x);
OPEProcedureInputElement(const OPEProcedureInputElement& element);
OPEProcedureInputElement& operator=(const OPEProcedureInputElement& element);
const BigInteger& t() const;
BigInteger& t();
const BigInteger& x() const;
BigInteger& x();
private:
template<typename Archive>
void serialize(Archive& archive, const unsigned int version)
{
archive & t();
archive & x();
}
};
class OPEProcedureInput : public boost::array<OPEProcedureInputElement, SGS::OPE_PROCEDURE_INPUT_SIZE>
{
friend class boost::serialization::access;
public:
OPEProcedureInput();
OPEProcedureInput(const OPEProcedureInput& array);
OPEProcedureInput& operator=(const OPEProcedureInput& array);
private:
template<typename Archive>
void serialize(Archive& archive, const unsigned int version)
{
archive & dynamic_cast<boost::array<OPEProcedureInputElement, SGS::OPE_PROCEDURE_INPUT_SIZE>&>(*this);
}
};
#endif // OPEPROCEDUREINPUT_HPP
| [
"pawel.kieliszczyk@gmail.com"
] | pawel.kieliszczyk@gmail.com |
249826c504ac19764f8227817be6752a82943c85 | ebb0c4090b7b5519797e53c5285b2248c36c68d9 | /tensorstore/index_space/internal/diagonal_op.cc | e47a41d27a40ab1f995f8d5714c3ade54f2054df | [
"LicenseRef-scancode-warranty-disclaimer",
"Apache-2.0",
"MIT"
] | permissive | stuarteberg/tensorstore | 2a38d54af39018e99a8351406fa268b2323497dc | 2c22a3c9f798b0fbf023031633c58cc7c644235d | refs/heads/master | 2022-12-13T05:45:29.120259 | 2020-08-25T23:46:26 | 2020-08-25T23:47:02 | 293,180,417 | 0 | 0 | Apache-2.0 | 2020-09-06T01:14:10 | 2020-09-06T01:14:09 | null | UTF-8 | C++ | false | false | 8,226 | cc | // Copyright 2020 The TensorStore Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include "tensorstore/index_space/internal/diagonal_op.h"
#include "absl/container/fixed_array.h"
namespace tensorstore {
namespace internal_index_space {
namespace {
/// Copies the range `[first, first + n - 1]` to `[first + 1, first + n]`.
template <typename R>
void ShiftRangeForwardByOne(R range) {
for (DimensionIndex i = range.size() - 1; i > 0; --i) {
range[i] = range[i - 1];
}
}
/// Extracts the diagonal of the specified dimensions of `original`, and stores
/// in the resultant transform in `result`.
///
/// \param original[in] Non-null pointer to original transform.
/// \param result[out] Non-null pointer to representation that will be set to
/// the new transform. May alias `original`.
/// \param dimensions[in,out] Must be non-null. On input, specifies the
/// dimensions from which to extract the diagonal. On return, set to `{0}`.
void ExtractDiagonal(TransformRep* original, TransformRep* result,
DimensionIndexBuffer* dimensions) {
const DimensionIndex orig_input_rank = original->input_rank;
const DimensionIndex output_rank = original->output_rank;
const DimensionIndex new_input_rank =
orig_input_rank - dimensions->size() + 1;
ABSL_ASSERT(result->input_rank_capacity >= new_input_rank);
// Input dimension of the new transform corresponding to the diagonal.
const DimensionIndex diag_input_dim = 0;
// Maps input dimensions of the existing transform to input dimensions of the
// new transform. Multiple existing dimensions may map to `diag_input_dim`.
absl::FixedArray<DimensionIndex, internal::kNumInlinedDims>
orig_to_new_input_dim(orig_input_rank, -1);
// Indicates whether the lower or upper bounds of all dimensions in
// `*dimensions` are implicit.
bool lower_diagonal_bound_implicit = true,
upper_diagonal_bound_implicit = true;
// Bounds of the new diagonal dimension, equal to the intersection of the
// bounds of each dimension in `*dimensions`.
IndexInterval diagonal_bounds;
// Computes `diagonal_bounds`, `{lower,upper}_diagonal_bound_implicit`, and
// `orig_to_new_input_dim`.
for (DimensionIndex orig_input_dim : *dimensions) {
orig_to_new_input_dim[orig_input_dim] = diag_input_dim;
const auto d = original->input_dimension(orig_input_dim);
diagonal_bounds = Intersect(diagonal_bounds, d.domain());
if (!d.implicit_lower_bound()) {
lower_diagonal_bound_implicit = false;
}
if (!d.implicit_upper_bound()) {
upper_diagonal_bound_implicit = false;
}
}
// Initializes `orig_to_new_input_dim` for all remaining dimensions.
for (DimensionIndex orig_input_dim = 0, new_input_dim = 1;
orig_input_dim < orig_input_rank; ++orig_input_dim) {
if (orig_to_new_input_dim[orig_input_dim] == -1) {
orig_to_new_input_dim[orig_input_dim] = new_input_dim++;
}
}
// Computes the output index maps of `result`.
span<const OutputIndexMap> orig_maps =
original->output_index_maps().first(output_rank);
span<OutputIndexMap> result_maps =
result->output_index_maps().first(output_rank);
for (DimensionIndex output_dim = 0; output_dim < output_rank; ++output_dim) {
const auto& orig_map = orig_maps[output_dim];
auto& result_map = result_maps[output_dim];
result_map.stride() = orig_map.stride();
result_map.offset() = orig_map.offset();
switch (orig_map.method()) {
case OutputIndexMethod::constant:
result_map.SetConstant();
break;
case OutputIndexMethod::single_input_dimension: {
const DimensionIndex orig_input_dim = orig_map.input_dimension();
ABSL_ASSERT(orig_input_dim >= 0 && orig_input_dim < orig_input_rank);
const DimensionIndex new_input_dim =
orig_to_new_input_dim[orig_input_dim];
result_map.SetSingleInputDimension(new_input_dim);
break;
}
case OutputIndexMethod::array: {
auto& result_index_array = result_map.SetArrayIndexing(new_input_rank);
// This is safe even if result_map aliases orig_map because
// SetArrayIndexing is guaranteed not to reduce the capacity.
const auto& orig_index_array = orig_map.index_array_data();
ABSL_ASSERT(orig_index_array.rank_capacity >= orig_input_rank);
Index diag_byte_stride = 0;
for (DimensionIndex orig_input_dim : *dimensions) {
diag_byte_stride += orig_index_array.byte_strides[orig_input_dim];
}
// We can safely copy byte strides in forward order, even if `original`
// aliases `result`, because it is guaranteed that
// `new_input_dim - 1 <= orig_input_dim`.
//
// To handle aliasing, we first store the byte strides for the new
// non-diagonal input dimensions 1, ..., new_input_rank-1 at positions
// 0, ..., new_input_rank-2, and then shift them over by one using
// ShiftRangeForwardByOne.
for (DimensionIndex orig_input_dim = 0;
orig_input_dim < orig_input_rank; ++orig_input_dim) {
const DimensionIndex new_input_dim =
orig_to_new_input_dim[orig_input_dim];
if (new_input_dim == diag_input_dim) continue;
ABSL_ASSERT(new_input_dim - 1 <= orig_input_dim);
result_index_array.byte_strides[new_input_dim - 1] =
orig_index_array.byte_strides[orig_input_dim];
}
ShiftRangeForwardByOne(
span(result_index_array.byte_strides, new_input_rank));
result_index_array.byte_strides[diag_input_dim] = diag_byte_stride;
result_index_array.index_range = orig_index_array.index_range;
result_index_array.element_pointer =
orig_index_array.element_pointer.pointer();
break;
}
}
}
// Copies the input dimension fields for input dimensions not part of the
// diagonal. We can safely update these fields in forward order. To handle
// aliasing, we first store the new field values at one position behind the
// correct position, then shift them over by one using ShiftRangeForwardByOne.
for (DimensionIndex orig_input_dim = 0; orig_input_dim < orig_input_rank;
++orig_input_dim) {
const DimensionIndex new_input_dim = orig_to_new_input_dim[orig_input_dim];
if (new_input_dim == diag_input_dim) continue;
ABSL_ASSERT(new_input_dim - 1 <= orig_input_dim);
result->input_dimension(new_input_dim - 1) =
original->input_dimension(orig_input_dim);
}
ShiftRangeForwardByOne(result->all_input_dimensions(new_input_rank));
// Sets input dimension fields for the new input dimension of `result`
// corresponding to the diagonal.
{
const auto d = result->input_dimension(diag_input_dim);
d.domain() = diagonal_bounds;
d.implicit_lower_bound() = lower_diagonal_bound_implicit;
d.implicit_upper_bound() = upper_diagonal_bound_implicit;
d.SetEmptyLabel();
}
result->input_rank = new_input_rank;
result->output_rank = output_rank;
dimensions->clear();
dimensions->push_back(diag_input_dim);
}
} // namespace
Result<IndexTransform<>> ApplyDiagonal(IndexTransform<> transform,
DimensionIndexBuffer* dimensions) {
TransformRep* rep = TransformAccess::rep(transform);
const DimensionIndex new_input_rank =
rep->input_rank - dimensions->size() + 1;
TransformRep::Ptr<> new_rep =
NewOrMutableRep(rep, new_input_rank, rep->output_rank);
ExtractDiagonal(rep, new_rep.get(), dimensions);
return TransformAccess::Make<IndexTransform<>>(std::move(new_rep));
}
} // namespace internal_index_space
} // namespace tensorstore
| [
"noreply@google.com"
] | noreply@google.com |
e35278c85186b28d83c8cb947df04c6afb8ab79d | fcca902e842cd5e0eab62aeedcb23cd380ade033 | /jam/src/ShaderFile.cpp | 09a1f19d5a48c0b0cc98397fcda3702ce9922567 | [
"MIT"
] | permissive | gzito/jamengine | 244e85e9eb2b526712d9b21a0c5a6d06a2d9bfa6 | 451ab1e1d74231a3239a56aed4c40dc445fa6db8 | refs/heads/master | 2022-12-19T02:35:28.422183 | 2020-09-23T18:09:07 | 2020-09-23T18:09:07 | 295,172,988 | 0 | 0 | MIT | 2020-09-15T09:17:04 | 2020-09-13T14:51:37 | C++ | UTF-8 | C++ | false | false | 4,069 | cpp | /**********************************************************************************
*
* ShaderFile.cpp
*
* This file is part of Jam
*
* Copyright (c) 2014-2019 Giovanni Zito.
* Copyright (c) 2014-2019 Jam contributors (cf. AUTHORS.md)
*
* 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 <stdafx.h>
#include "jam/ShaderFile.h"
#include <stdexcept>
#include <fstream>
#include <string>
#include <cassert>
#include <sstream>
namespace jam
{
ShaderFile::ShaderFile( GLenum shaderType ) :
m_objectID(0), m_shaderType(shaderType), m_compiled(false), m_sourceCode(), m_resHandle()
{
}
ShaderFile::ShaderFile( ResHandle* resHandle, GLenum shaderType ) :
ShaderFile( shaderType )
{
m_resHandle = resHandle ;
if( m_resHandle ) {
setSource( m_resHandle->getBuffer() ) ;
}
}
ShaderFile::~ShaderFile()
{
if( m_objectID != 0 ) {
glDeleteShader(m_objectID); m_objectID = 0;
}
}
void ShaderFile::compile()
{
if( !m_compiled ) {
//compile
JAM_TRACE( "Compiling shader \"%s\"\n", m_resHandle->getResource().getName().c_str() ) ;
glCompileShader(m_objectID);
//throw exception if compile error occurred
GLint status;
glGetShaderiv(m_objectID, GL_COMPILE_STATUS, &status);
if (status == GL_FALSE) {
String msg("Compile failure in shader: \"" + m_resHandle->getResource().getName() + "\"\n");
GLint infoLogLength;
glGetShaderiv(m_objectID, GL_INFO_LOG_LENGTH, &infoLogLength);
char* strInfoLog = new char[infoLogLength + 1];
glGetShaderInfoLog(m_objectID, infoLogLength, NULL, strInfoLog);
msg += strInfoLog;
delete[] strInfoLog;
glDeleteShader(m_objectID); m_objectID = 0;
JAM_ERROR(msg.c_str());
}
m_compiled = true ;
}
}
GLuint ShaderFile::objectID() const {
return m_objectID;
}
ShaderFile* ShaderFile::shaderFromFile( ResHandle* resHandle, GLenum shaderType ) {
ShaderFile* sh = new ShaderFile(resHandle, shaderType) ;
sh->compile() ;
return sh;
}
void ShaderFile::setSource( const String& shaderCode )
{
if( m_objectID == 0) {
//create the shader object
m_objectID = glCreateShader(m_shaderType);
if(m_objectID == 0) {
JAM_ERROR("glCreateShader failed");
}
}
m_sourceCode = shaderCode ;
const char* code = m_sourceCode.c_str();
glShaderSource(m_objectID, 1, (const GLchar**)&code, NULL);
m_compiled = false ;
}
//
// ShaderFileResourceLoader
//
ShaderFileResourceLoader::ShaderFileResourceLoader()
{
m_patterns.clear() ;
m_patterns.push_back("*.vert");
m_patterns.push_back("*.frag");
}
bool ShaderFileResourceLoader::useRawFile() const
{
return true;
}
size_t ShaderFileResourceLoader::getLoadedResourceSize(char* rawBuffer,size_t rawSize)
{
return rawSize;
}
bool ShaderFileResourceLoader::loadResource(char* rawBuffer,size_t rawSize,ResHandle& handle)
{
return true;
}
bool ShaderFileResourceLoader::discardRawBufferAfterLoad() const
{
return false;
}
bool ShaderFileResourceLoader::addNullZero() const
{
return true;
}
}
| [
"g.zito@hotmail.it"
] | g.zito@hotmail.it |
2b037f1e24e6733e1c9bf6891dbeea712327e52b | 6780de392f3c741e48345c65d524046dc3da02c0 | /Randomized Select ith Order Statistic/Randomized Select ith Order Statistic/Source.cpp | bfae69f0a94d43b4b21d696cdf07040a634dce67 | [] | no_license | Thudcrackers/school | d29f04b8a78d2aca935483cabc07922841d769ec | 4644583b92e3d0114ebde0655133ded67009151e | refs/heads/master | 2021-01-10T15:22:47.005938 | 2018-01-23T19:19:38 | 2018-01-23T19:19:38 | 53,738,027 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,302 | cpp | #include <iostream>
#include <vector>
#include <ctime>
using namespace std;
//prototypes
vector<int> Populate(vector<int> &v);
void Print(vector<int> v);
int randomizedSelect(vector<int> &v, int p, int r, int k);
int Partition(vector<int> &v, int p, int r);
void Quicksort(vector<int> &v, int p, int r);
int randomPartition(vector<int> v, int p, int r);
void main() {
vector<int> arr(10);
Populate(arr);
Print(arr);
int randomSelect = randomizedSelect(arr, 0, arr.size() - 1, 3);
Quicksort(arr, 0, arr.size() - 1);
Print(arr);
cout << "The third smallest element in the array is " << randomSelect << endl;
}
//function to populate array randomly and alternate between positive and negative
vector<int> Populate(vector<int> &v) {
srand(clock());
for (int i = 0; i < v.size(); i++) {
//generate a 0 or 1
//this value will determine if we generate a negative or positive number
int negORpos = rand() % 2;
//generate a negative number for 0
if (negORpos == 0)
v[i] = -rand() % 100;
//generate a positive number for 1
else
v[i] = rand() % 100;
}
//return the now populated vector
return v;
}
void Print(vector<int> v) {
//output each element
for (int i = 0; i < v.size(); i++) {
cout << v[i] << " "; //add a space for formatting
}
//add an extra line for formatting
cout << endl;
}
//this function will recursively sort the array
void Quicksort(vector<int> &v, int p, int r) {
//r must be greater than p to avoid index intersection
if (p < r) {
int q = Partition(v, p, r); //partition the subarray
Quicksort(v, p, q - 1); //quick sort the first subarray
Quicksort(v, q + 1, r); //quick sort the second subarray
}
}
int randomizedSelect(vector<int> &v, int p, int r, int k) {
//if the beginning and end are the same, there is only one element
if (p == r)
return v[p];
//if the ith element we are searching for is
if (k == 0)
return NULL;
//as long as the beginning is actually before the end, check the next side
if (p < r) {
int q = Partition(v, p, r); //partition the subarray
int i = q - p + 1; //if the partition we are looking at is in the second half, we have to account for that
if (i == k) //if the calculated location of the ith element is k, the ith element passed to the function, return that place
return v[q];
else if (k < i) //else if k < i we need to look on the left side
return randomizedSelect(v, p, q - 1, k);
else //else look on the right side
return randomizedSelect(v, q + 1, r, k - i);
}
}
//this function will rearrange the subarray in place
//all elements less than the pivot go to the left,
//all that are greater than the pivot go to the right
int Partition(vector<int> &v, int left, int right) {
//set the pivot
int pivot = v[right];
//set the index for left
int i = left - 1;
//set the index for right and begin the loop
for (int j = left; j < right; j++) {
if (v[j] <= pivot) {
//if the value is less than the pivot value, swap it with v[j]
i++;
int temp = v[i];
v[i] = v[j];
v[j] = temp;
}
}
//increase i
i++;
//and swap v[i] with v[right] (it puts it back in the correct place)
int temp = v[i];
v[i] = v[right];
v[right] = temp;
return i;
} | [
"noreply@github.com"
] | noreply@github.com |
9cef26299b41d7d7f00b2a0ce61be71a8bd18193 | 4bca2f952bc7e749bb282cebb5ba6fe4e723089e | /adultParams/CardiogramVFibrParam_I12.h | 9771cfc596dae5b8f8a94086cb603957957ba2ae | [] | no_license | dongtaoapp/BlsNetPlatformPro | 63081a78cac66398b6ea4cb074774898de75062e | 43ca4faa3eb1c760630a3138f1c36d4cb52ed45c | refs/heads/master | 2021-09-12T13:17:08.815046 | 2018-04-17T04:00:49 | 2018-04-17T04:00:49 | 126,117,629 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 659 | h | #pragma once
#include "..\simulatorbase\vircardiogramparam.h"
namespace jysoft { namespace simulator { namespace ecg {
class CCardiogramVFibrParam_I12 : public CVirCardiogramParam
{
public:
CCardiogramVFibrParam_I12(IStorage *pRootStorage );
virtual ~CCardiogramVFibrParam_I12(void);
public:
//���ز���ֵ
virtual void LoadCardiogramParam(QRS eQRS, BasicRhythm eRhythm,int uHR, short sConduct = 0, short sExtendParam = 0);
//�Ƿ���ʼ����ʱ���������ĵ�ͼ����
virtual bool IsInitialSendDoubleSampleData() { return false; };
private:
short m_sExtendParam;
};
}}}
| [
"1058611121@qq.com"
] | 1058611121@qq.com |
649c440caa183c98c3eb79b30701a49461ad411a | 1a160fd0b4a96c85a3d5cc6c5a93b242e9cfda65 | /src/compat/glibc_sanity.cpp | 4285a8c534f903dbce2551d1ec3e4abc294cba2e | [
"MIT"
] | permissive | Alonewolf-123/AmbankCoin-Core | fc2bdf2e5a18264a8584ea71872f7383d3967fc0 | 76d6281eff342bb75827bb2b12768b1bd81dc14e | refs/heads/master | 2022-12-03T08:22:14.041666 | 2020-08-03T14:19:47 | 2020-08-03T14:19:47 | 282,668,150 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,856 | cpp | // Copyright (c) 2009-2017 The Bitcoin Core developers
// Copyright (c) 2016-2019 The AMBANKCOIN developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#if defined(HAVE_CONFIG_H)
#include "config/ambankcoin-config.h"
#endif
#include <cstddef>
#if defined(HAVE_SYS_SELECT_H)
#include <sys/select.h>
#endif
extern "C" void* memcpy(void* a, const void* b, size_t c);
void* memcpy_int(void* a, const void* b, size_t c)
{
return memcpy(a, b, c);
}
namespace
{
// trigger: Use the memcpy_int wrapper which calls our internal memcpy.
// A direct call to memcpy may be optimized away by the compiler.
// test: Fill an array with a sequence of integers. memcpy to a new empty array.
// Verify that the arrays are equal. Use an odd size to decrease the odds of
// the call being optimized away.
template <unsigned int T>
bool sanity_test_memcpy()
{
unsigned int memcpy_test[T];
unsigned int memcpy_verify[T] = {};
for (unsigned int i = 0; i != T; ++i)
memcpy_test[i] = i;
memcpy_int(memcpy_verify, memcpy_test, sizeof(memcpy_test));
for (unsigned int i = 0; i != T; ++i) {
if (memcpy_verify[i] != i)
return false;
}
return true;
}
#if defined(HAVE_SYS_SELECT_H)
// trigger: Call FD_SET to trigger __fdelt_chk. FORTIFY_SOURCE must be defined
// as >0 and optimizations must be set to at least -O2.
// test: Add a file descriptor to an empty fd_set. Verify that it has been
// correctly added.
bool sanity_test_fdelt()
{
fd_set fds;
FD_ZERO(&fds);
FD_SET(0, &fds);
return FD_ISSET(0, &fds);
}
#endif
} // anon namespace
bool glibc_sanity_test()
{
#if defined(HAVE_SYS_SELECT_H)
if (!sanity_test_fdelt())
return false;
#endif
return sanity_test_memcpy<1025>();
} | [
"alonewolf2ksk@gmail.com"
] | alonewolf2ksk@gmail.com |
f3c271bdf88823e5e38d6536032bc4fa8ab6ecd9 | 186d5d7d0b94c4d37e12e1cfd97409d2a85d807b | /data_structure/cll/main_cll.cpp | 15388b8224dbfcef0f978e7069da94d32bfa7dac | [
"MIT"
] | permissive | offamitkumar/C-Plus-Plus | b0a7c7e67742eecbd3b1c80d3388e327418a7d4c | d7f7fbb98a40d43b1c323532adb9f0aafa61c0fd | refs/heads/master | 2022-08-28T10:48:01.698838 | 2020-05-25T05:17:24 | 2020-05-25T05:17:24 | 266,010,135 | 4 | 2 | MIT | 2020-05-22T03:34:19 | 2020-05-22T03:34:18 | null | UTF-8 | C++ | false | false | 1,160 | cpp | #include "cll.h"
using namespace std;
int main()
{
/* Test CLL */
cout << "----------- Test construct -----------" << endl;
cll list1;
list1.display();
cout << "----------- Test insert front -----------" << endl;
list1.insert_front(5);
cout << "After insert 5 at front: "<<endl;
list1.display();
cout << "After insert 10 3 7 at front: "<<endl;
list1.insert_front(10);
list1.insert_front(3);
list1.insert_front(7);
list1.display();
cout << "----------- Test insert tail -----------" << endl;
cout << "After insert 18 19 20 at tail: "<<endl;
list1.insert_tail(18);
list1.insert_tail(19);
list1.insert_tail(20);
list1.display();
cout << "----------- Test find item -----------" << endl;
if (list1.find_item(10))
cout << "PASS" << endl;
else
cout << "FAIL" << endl;
if (!list1.find_item(30))
cout << "PASS" << endl;
else
cout << "FAIL" << endl;
cout << "----------- Test * operator -----------" << endl;
int value = *list1;
cout << "Value at *list1: " << value <<endl;
cout << "----------- Test ++ operator -----------" << endl;
list1.display();
++list1;
cout << "After ++list1: " <<endl;
list1.display();
return 0;
}
| [
"haihoangdang91@gmail.com"
] | haihoangdang91@gmail.com |
cc6350f32eae26b05044f25b403fe1225523faf1 | 8119cb0f6a64c41c9bae782acd80b111e616be7f | /PointLight.cpp | 364c8fe72f064194321646610659e5b1f26777ff | [] | no_license | stawrocek/luksja-raytracer | c8f29a026320d88ee0b16d464cd5b965af3746e5 | f53825295b7e8732533431fd0893b78d8086ac27 | refs/heads/master | 2020-03-25T09:07:20.839479 | 2018-08-05T21:26:03 | 2018-08-05T21:26:03 | 143,648,585 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 395 | cpp | #include "PointLight.hpp"
unsigned int PointLight::pointLightCounter = 0;
PointLight::PointLight(const json& j)
:Sphere(j)
{
//maybe it isn't nest classes hierarchy...
if(name.empty() || name.substr(0, 6) == "SPHERE")
name = "POINT_LIGHT"+std::to_string(++pointLightCounter);
//...but it works
}
void PointLight::renderGui(){
Sphere::renderGui();
ImGui::InputFloat("power", &power);
}
| [
"stawrocek@gmail.com"
] | stawrocek@gmail.com |
fdd7e0314e15a320aa64b97db74fc72d775c135a | 8d53c2022a03d73b19eb0ec44580ffbd9e9b9e92 | /nettool/api/tcpserver.cpp | 1eb3aac0a6e20df8a807abdf31517b1f6aed03c2 | [] | no_license | jaycewang/QWidgetDemo | e7412c3b093731c673a652c0ef6ab7adec75a6d6 | a36e06a08b7ea7ece1bd3945da81c10daa764b1b | refs/heads/master | 2020-09-27T05:01:29.009987 | 2019-12-06T04:55:41 | 2019-12-06T04:55:41 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,873 | cpp | #include "tcpserver.h"
#include "quiwidget.h"
TcpClient::TcpClient(QObject *parent) : QTcpSocket(parent)
{
ip = "127.0.0.1";
port = 6000;
connect(this, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(deleteLater()));
connect(this, SIGNAL(disconnected()), this, SLOT(deleteLater()));
connect(this, SIGNAL(readyRead()), this, SLOT(readData()));
}
void TcpClient::setIP(const QString &ip)
{
this->ip = ip;
}
QString TcpClient::getIP() const
{
return this->ip;
}
void TcpClient::setPort(int port)
{
this->port = port;
}
int TcpClient::getPort() const
{
return this->port;
}
void TcpClient::readData()
{
QByteArray data = this->readAll();
if (data.length() <= 0) {
return;
}
QString buffer;
if (App::HexReceiveTcpServer) {
buffer = QUIHelper::byteArrayToHexStr(data);
} else if (App::AsciiTcpServer) {
buffer = QUIHelper::byteArrayToAsciiStr(data);
} else {
buffer = QString(data);
}
emit receiveData(ip, port, buffer);
//自动回复数据,可以回复的数据是以;隔开,每行可以带多个;所以这里不需要继续判断
if (App::DebugTcpServer) {
int count = App::Keys.count();
for (int i = 0; i < count; i++) {
if (App::Keys.at(i) == buffer) {
sendData(App::Values.at(i));
break;
}
}
}
}
void TcpClient::sendData(const QString &data)
{
QByteArray buffer;
if (App::HexSendTcpServer) {
buffer = QUIHelper::hexStrToByteArray(data);
} else if (App::AsciiTcpServer) {
buffer = QUIHelper::asciiStrToByteArray(data);
} else {
buffer = data.toLatin1();
}
this->write(buffer);
emit sendData(ip, port, data);
}
TcpServer::TcpServer(QObject *parent) : QTcpServer(parent)
{
}
void TcpServer::incomingConnection(int handle)
{
TcpClient *client = new TcpClient(this);
client->setSocketDescriptor(handle);
connect(client, SIGNAL(disconnected()), this, SLOT(disconnected()));
connect(client, SIGNAL(sendData(QString, int, QString)), this, SIGNAL(sendData(QString, int, QString)));
connect(client, SIGNAL(receiveData(QString, int, QString)), this, SIGNAL(receiveData(QString, int, QString)));
QString ip = client->peerAddress().toString();
ip = ip.replace("::ffff:", "");
int port = client->peerPort();
client->setIP(ip);
client->setPort(port);
emit clientConnected(ip, port);
emit sendData(ip, port, "客户端上线");
//连接后加入链表
clients.append(client);
}
void TcpServer::disconnected()
{
TcpClient *client = (TcpClient *)sender();
QString ip = client->getIP();
int port = client->getPort();
emit clientDisconnected(ip, port);
emit sendData(ip, port, "客户端下线");
//断开连接后从链表中移除
clients.removeOne(client);
}
bool TcpServer::start()
{
bool ok = listen(QHostAddress(App::TcpListenIP), App::TcpListenPort);
return ok;
}
void TcpServer::stop()
{
remove();
this->close();
}
void TcpServer::writeData(const QString &ip, int port, const QString &data)
{
foreach (TcpClient *client, clients) {
if (client->peerAddress().toString() == ip && client->peerPort() == port) {
client->sendData(data);
break;
}
}
}
void TcpServer::writeData(const QString &data)
{
foreach (TcpClient *client, clients) {
client->sendData(data);
}
}
void TcpServer::remove(const QString &ip, int port)
{
foreach (TcpClient *client, clients) {
if (client->peerAddress().toString() == ip && client->peerPort() == port) {
client->disconnectFromHost();
break;
}
}
}
void TcpServer::remove()
{
foreach (TcpClient *client, clients) {
client->disconnectFromHost();
}
}
| [
"feiyangqingyun@163.com"
] | feiyangqingyun@163.com |
0807201cfbc40b90a359424752078c1e2d944361 | 27ce12b5564f073d502cdf2bdf3e6a9690ada6fd | /YangsNet/Tcp.cpp | 27a3b6af5a47840cc094d8a8657190beaef9cb0c | [] | no_license | dengguoyu/Jyu802.1x-Client | 798c7f9a704b2d59716d32d4885eecd3a84d683e | 5952b79defb422415eca104c3a277b9bfa6feeb0 | refs/heads/master | 2021-06-16T16:19:42.530668 | 2017-05-12T02:42:01 | 2017-05-12T02:42:01 | 108,198,027 | 0 | 1 | null | 2017-10-25T00:13:59 | 2017-10-25T00:13:59 | null | GB18030 | C++ | false | false | 1,883 | cpp | #include "stdafx.h"
#include "Tcp.h"
Tcp::Tcp(void)
{
s=NULL;
}
Tcp::~Tcp(void)
{
}
void Tcp::setRecvTimeOut(int millsecond)
{
setsockopt(s,SOL_SOCKET,SO_RCVTIMEO,(const char *)&millsecond,sizeof(int));
}
DWORD Tcp::resolveIP(char *hostName)
{
hostent *hent;
char **addresslist;
DWORD result = 0;
hent = gethostbyname(hostName);
if(hent)
{
addresslist = hent->h_addr_list;
if (*addresslist)
{
result = *((DWORD *)(*addresslist));
}
}
if(result == 0)
{
DWORD result = inet_addr(hostName);
}
return result;
}
bool Tcp::connect(char* IPorDNS, int port)
{
DWORD ip = resolveIP(IPorDNS);
bool ret = false;
s = socket(AF_INET, SOCK_STREAM, 0);
if(s == INVALID_SOCKET)
return false;
sockaddr_in sin;
sin.sin_addr.s_addr = ip;
sin.sin_family = AF_INET;
sin.sin_port = htons(port);
int error = -1;
int len = sizeof(int);
timeval tm;
fd_set set;
unsigned long ul = 1;
ioctlsocket(s, FIONBIO, &ul); //设置为非阻塞模式
if(::connect(s, (sockaddr *)&sin, sizeof(sin)) == -1)
{
tm.tv_sec = 7;
tm.tv_usec = 0;
FD_ZERO(&set);
FD_SET(s, &set);
if( select(s+1, NULL, &set, NULL, &tm) > 0)
{
getsockopt(s, SOL_SOCKET, SO_ERROR, (char *)&error, /*(socklen_t *)*/&len);
if(error == 0)
ret = true;
else
ret = false;
}
else
ret = false;
}else
{
ret=true;
}
int timeout=2000;
//setsockopt(s,SOL_SOCKET,SO_SNDTIMEO,(const char *)&timeout,sizeof(int));
//setsockopt(s,SOL_SOCKET,SO_RCVTIMEO,(const char *)&timeout,sizeof(int));
ul=0;
ioctlsocket(s, FIONBIO, &ul); //设置为阻塞模式
return ret;
}
void Tcp::disconnect()
{
closesocket(this->s);
}
int Tcp::recv(char* buf,int len)
{
return ::recv(s,buf,len,0);
}
int Tcp::send(char* buf,int len )
{
return ::send(this->s,buf,len,0);
}
| [
"x@icexz.com"
] | x@icexz.com |
b514c8e3403184312497cc84e35337c5655ca31a | 82815230eeaf24d53f38f2a3f144dd8e8d4bc6b5 | /Airfoil/wingMotion/wingMotion2D_pimpleFoam/0.54/nut | 499a22269bba6e4f9ce81bcd2e9f935e23479bd7 | [
"MIT"
] | permissive | ishantja/KUHPC | 6355c61bf348974a7b81b4c6bf8ce56ac49ce111 | 74967d1b7e6c84fdadffafd1f7333bf533e7f387 | refs/heads/main | 2023-01-21T21:57:02.402186 | 2020-11-19T13:10:42 | 2020-11-19T13:10:42 | 312,429,902 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 174,560 | /*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1912 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0.54";
object nut;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 2 -1 0 0 0 0];
internalField nonuniform List<scalar>
12556
(
1.15588419
1.155853198
1.155823803
1.155802782
1.156029047
1.156029869
1.15605222
1.156102463
1.156196566
1.156350244
1.156528478
1.091404012
1.023053568
1.057094241
1.156647976
1.156422897
1.156262329
1.156156402
1.156079236
1.156050952
1.15582873
1.15584036
1.155863971
1.155890126
1.155123897
1.155037103
1.154954235
1.154899437
1.155126167
1.155170831
1.155305172
1.155612904
1.156060617
1.15679043
1.157830486
1.017140939
0.9436806012
0.9590499357
1.061290344
1.157401614
1.156543149
1.155929032
1.155463392
1.155261987
1.154962086
1.155002635
1.155074117
1.15515389
1.154334573
1.154186364
1.154059295
1.15400054
1.154256489
1.154402927
1.154732427
1.155371944
1.156467628
1.128031251
0.9103396934
0.7889472158
0.7414554311
0.7599125763
0.8459310419
1.006518227
1.157519972
1.15611115
1.155085139
1.154599337
1.154173625
1.154172584
1.154272292
1.154404027
1.15352105
1.153328806
1.153176192
1.153135889
1.15345229
1.153788673
1.15455642
1.155754145
1.103600302
0.8216823121
0.6462764661
0.5463341719
0.5072700725
0.5256154402
0.6013109069
0.7370804123
0.9537407574
1.157122994
1.155161263
1.154176148
1.153422701
1.153380666
1.153483231
1.153654208
1.152691435
1.152450688
1.152291294
1.152321251
1.152762308
1.153407959
1.154853354
1.157024775
0.8365637299
0.5974804649
0.4410618413
0.3431571173
0.3030026715
0.323678023
0.3982240099
0.5223464427
0.7107873839
0.9989103388
1.155917681
1.154087507
1.152857429
1.152621176
1.152688949
1.152885866
1.151854146
1.151588878
1.15145047
1.151572409
1.152237967
1.153350867
1.155835527
0.9825786595
0.6631457966
0.4514813708
0.2977596273
0.1934817977
0.1516264086
0.177922896
0.2533874119
0.3694478001
0.5398647466
0.7916164483
1.157461117
1.154409554
1.152444984
1.151917428
1.151903088
1.152100011
1.15100882
1.150730213
1.150644641
1.150966154
1.151900494
1.153673141
1.157426567
0.8387116193
0.5601321728
0.3638934533
0.2125575268
0.09784685043
0.05563250464
0.08814590232
0.1642723968
0.2722779008
0.4272296909
0.6470704844
1.003505927
1.155214274
1.152183907
1.151267583
1.151111966
1.151288406
1.150217582
1.149943202
1.149942578
1.150522852
1.15170409
1.154398733
1.060082413
0.7610954205
0.5149986859
0.3358616051
0.1942579897
0.08020560806
0.05065493812
0.124407786
0.2211794387
0.3617729298
0.5635475392
0.8892411049
1.156413671
1.15213567
1.150715657
1.150349716
1.150474979
1.149486217
1.14923216
1.149357186
1.150248565
1.151796805
1.155508687
0.9953578147
0.7219462258
0.513672706
0.3616883852
0.248293468
0.1763760698
0.06220103208
0.1218926047
0.2061174939
0.3333049416
0.5179412405
0.8197554713
1.157889368
1.152301285
1.150281498
1.149659944
1.14971553
1.148897583
1.148678696
1.148950175
1.15019132
1.152205586
1.156933288
0.9635130832
0.7246584362
0.5385579121
0.4099218537
0.3306267377
0.3265040641
0.08758847616
0.1387531631
0.2154491978
0.3345653593
0.5075711726
0.7853134416
1.128153907
1.152715112
1.150050405
1.1491241
1.149085181
1.148447957
1.148280808
1.148740119
1.150406605
1.152897292
1.158601806
0.9531284971
0.7383904904
0.5733293052
0.4609228085
0.4008983642
0.4462614915
0.1189918597
0.1677909605
0.2426886092
0.3562548578
0.5188703403
0.780096948
1.087851422
1.153350542
1.150027832
1.148796941
1.148658693
1.148195802
1.148086345
1.148726195
1.150804024
1.153815092
1.160356067
0.9578260726
0.7638042187
0.6114748012
0.5029793021
0.4349338429
0.4496627215
0.1551728261
0.2087868876
0.2868301921
0.4009312162
0.555637835
0.8008810698
1.080189976
1.154233161
1.150267987
1.148723787
1.148476051
1.148079995
1.148043868
1.148935981
1.151484157
1.154865539
1.162132334
0.9737593914
0.8055287991
0.656653319
0.5441212843
0.4519144715
0.3877124569
0.05517530564
0.2014684674
0.2697241019
0.355270772
0.4676331591
0.6208588835
0.8433991138
1.090479157
1.155212451
1.150724404
1.148898433
1.148559229
1.148148348
1.148184404
1.149297636
1.152232446
1.156251929
1.164072591
1.031981359
0.8561430759
0.7208609322
0.6039410413
0.4959078031
0.2932133194
0.1114064407
0.2967520071
0.3761653994
0.4589329522
0.5654408285
0.705362966
0.9049197086
1.127082213
1.156263619
1.151357459
1.149286002
1.148876267
1.148278502
1.148377846
1.149696656
1.15301777
1.157496772
1.16583219
1.102200429
0.9420821102
0.8140838014
0.7057745933
0.6002685638
0.1045459973
0.1577315705
0.4228085279
0.5655445374
0.61499538
0.6978726078
0.8236714233
1.001677346
1.166800914
1.15729432
1.152079037
1.149822124
1.149342227
1.148519644
1.14867784
1.150174044
1.153828987
1.158697003
1.167422364
1.172673407
1.070048319
0.9573383558
0.8734505927
0.8246612761
0.05106711223
0.1842584511
0.4642844766
0.763744645
0.8336198671
0.8763238648
0.9758028104
1.138220787
1.168064663
1.158238182
1.152814138
1.150439075
1.149932303
1.148721434
1.148919884
1.150562394
1.154534484
1.159783659
1.168794609
1.174295176
1.166613921
1.131714604
1.032271784
0.6107272712
0.02848052369
0.2487636439
0.5310811504
0.8164710454
1.013253218
1.111298411
1.155138918
1.17133918
1.169048462
1.159030231
1.153491345
1.151043091
1.150499097
1.148965267
1.14919681
1.150951842
1.155168882
1.160698931
1.169894477
1.175540463
1.167497436
1.123950534
0.9557122214
0.2686485582
0.04091543546
0.3239366037
0.6056422496
0.8611236664
1.027554206
1.116387196
1.157626033
1.172466222
1.169683047
1.159638539
1.154074925
1.151617452
1.151062979
1.149099169
1.149345986
1.151180764
1.155618679
1.16141781
1.170715701
1.176347842
1.167867226
1.119515583
0.8730863226
0.1355709283
0.08434473959
0.3797547827
0.652318208
0.879901628
1.033105943
1.119250726
1.159143863
1.173069722
1.170005179
1.160028913
1.154493273
1.152055541
1.151499021
1.149249875
1.149512139
1.151400542
1.155980246
1.161934289
1.171270691
1.176796225
1.167773839
1.113883015
0.8148119296
0.1188236112
0.1076518539
0.3960006123
0.6605800466
0.8869316343
1.037061259
1.121089006
1.159943018
1.173252688
1.170058034
1.160282663
1.154833334
1.152430097
1.15187111
1.149258855
1.149527883
1.15144931
1.15615303
1.162266467
1.171595095
1.176973836
1.16733459
1.106709628
0.7548490335
0.1101587937
0.1222765576
0.4046720916
0.6655727936
0.8915986118
1.039799075
1.122176208
1.16022033
1.173108215
1.169895583
1.160346503
1.154997043
1.152634714
1.152075178
1.149292884
1.149578653
1.151525761
1.156287906
1.162442475
1.171733807
1.17694588
1.16661042
1.097856851
0.7029790689
0.1049225167
0.1343277768
0.4113726978
0.6689639101
0.8940051847
1.041452175
1.122679577
1.160116883
1.172716237
1.169570351
1.160332248
1.155113107
1.152789425
1.152222067
1.149173491
1.14947416
1.151442236
1.156269005
1.162500533
1.171730241
1.176762682
1.165619775
1.086659925
0.6637429912
0.1021415497
0.1440398293
0.4164731306
0.6711635447
0.894642141
1.042060549
1.122684469
1.159722364
1.172141802
1.169125943
1.160165317
1.155061251
1.152771101
1.152195221
1.149102845
1.149431506
1.151425977
1.156272534
1.162469364
1.171621019
1.17645378
1.164305661
1.072226366
0.6345752395
0.1011541247
0.1518260131
0.4202631742
0.6724060148
0.8940790707
1.041725389
1.122235694
1.159088183
1.171432195
1.168594328
1.159978194
1.155007931
1.152743581
1.152151361
1.14887384
1.149228598
1.151249456
1.156138745
1.16237649
1.17143366
1.176029821
1.16253161
1.054934941
0.6124909113
0.1016062925
0.1580737622
0.4230315456
0.6728700879
0.8927127486
1.040621673
1.121380508
1.15825021
1.170621429
1.167999189
1.159658855
1.1547938
1.152548666
1.151940602
1.148722334
1.14911465
1.151170485
1.156067551
1.162232907
1.171186621
1.175488585
1.160126709
1.036524631
0.5956045481
0.1032239677
0.1630723812
0.4249567749
0.6726942841
0.8907773619
1.038929544
1.120178769
1.157240609
1.169735292
1.167357728
1.159367993
1.154626419
1.152392937
1.151762046
1.148411137
1.148836196
1.150923781
1.15585385
1.162053825
1.170891668
1.174820158
1.156963551
1.018585876
0.582671459
0.1058057078
0.1670250167
0.4261775654
0.6719934609
0.8884177725
1.03679489
1.118692475
1.156090172
1.168794081
1.166682959
1.158947384
1.154296729
1.152071193
1.151419914
1.148202386
1.148670081
1.15079951
1.155735149
1.1618402
1.170556586
1.174008518
1.153020422
1.001913269
0.5727931051
0.1092205571
0.1701736055
0.4268253262
0.6708686549
0.8857331244
1.034325607
1.116976195
1.154826195
1.167813318
1.165984296
1.158597884
1.154057058
1.151832114
1.151153957
1.147839518
1.148341936
1.150504369
1.155463117
1.16160486
1.170185963
1.173034335
1.148391232
0.9867632823
0.5652974702
0.1133411724
0.1726878768
0.4270046864
0.6694020704
0.8827979088
1.031600862
1.115074254
1.15347108
1.166804599
1.165268794
1.158110274
1.15365009
1.151426508
1.150725998
1.147587048
1.148134276
1.150343186
1.155312558
1.161344806
1.169782421
1.171880014
1.143233008
0.9731434755
0.5596855559
0.1180837747
0.1747111913
0.4268163587
0.6676595833
0.8796687134
1.028677641
1.113020535
1.152041751
1.165776036
1.164542388
1.157728042
1.153361445
1.151130548
1.150400897
1.147206462
1.14778726
1.15002755
1.155006623
1.16107288
1.169345969
1.170534852
1.137718814
0.9609669944
0.5556242106
0.1233795038
0.1763641134
0.4263314944
0.6656910234
0.8763862935
1.025596695
1.110840566
1.15055066
1.164732992
1.163807691
1.157204474
1.152916006
1.150683769
1.149931886
1.146905468
1.147532121
1.149821825
1.154823411
1.160782458
1.16887547
1.168998148
1.13200572
0.9501177866
0.5528716086
0.1291661995
0.1777527844
0.4256133389
0.6635359678
0.8729833485
1.022389809
1.108554467
1.149006731
1.16367881
1.163069568
1.156790157
1.152575654
1.150331434
1.149549114
1.146552523
1.147209175
1.149527569
1.154523381
1.160484942
1.168367799
1.167278785
1.126215798
0.9404433535
0.5512046263
0.1353800085
0.1789304125
0.4247189751
0.6612379165
0.8694920209
1.019084099
1.106178652
1.147416731
1.162615637
1.162324901
1.156280696
1.152148052
1.149901232
1.149098757
1.146171675
1.146875475
1.149244627
1.154271873
1.160173659
1.167822919
1.165393486
1.120433761
0.9317795727
0.5503665485
0.1419137714
0.1799524936
0.4237084253
0.6588414596
0.8659440934
1.015703386
1.10372739
1.145787399
1.161547093
1.161583998
1.155782683
1.151711967
1.149452418
1.148618079
1.145911038
1.146639355
1.149034377
1.154058641
1.159862992
1.167247013
1.163379101
1.114713667
0.9239596784
0.5501164539
0.1486333581
0.1808773056
0.4226353332
0.656388086
0.8623642215
1.012266702
1.101212508
1.144122969
1.160487703
1.160845959
1.155405219
1.151396339
1.149132004
1.148281124
1.145390144
1.146175406
1.148632423
1.153687427
1.159583986
1.166676967
1.1613506
1.109104274
0.916891002
0.5502905332
0.1554197963
0.1817429386
0.4215454938
0.6539214445
0.8587808225
1.008794949
1.098644309
1.142423586
1.159505698
1.160185863
1.154708743
1.150785655
1.148507734
1.14761854
0.1574272658
0.05553567639
0.04366512212
0.3108747975
0.0803262529
0.05850864353
0.4335441261
0.1126169496
0.0841780244
0.4551169906
0.14234735
0.11734422
0.3964546044
0.04137198001
0.05169622026
0.1776780261
0.1461600273
0.3381053338
0.08198523985
0.04250415741
0.1056756501
0.2407785244
0.1806875555
0.0779912684
0.05592200669
0.04505706966
0.08377062974
0.02825081612
0.01884429953
0.05967458178
0.1032489162
0.1051097886
0.3100372508
0.3033086915
0.1814040698
0.02886552013
0.0425642641
0.08420049139
0.1189201089
0.105701315
0.3862040193
0.4164245995
0.3181938261
0.3715562256
0.208096884
0.2343563999
0.05130023945
0.03621472139
0.1149745537
0.1465147401
0.1248651165
0.4299903902
0.4481423606
0.4274014339
0.4655571116
0.1351018413
0.1757437259
0.09692161182
0.07066340697
0.4443344567
0.3989698927
0.4446320994
0.4299498261
0.07939879517
0.1050446832
0.01764973434
0.1334706475
0.1287347463
0.4820904947
0.3841748837
0.392000425
0.3675592623
0.03083845457
0.05094559464
0.2958347109
0.1133588273
0.08393779002
0.06421039906
0.1477603309
0.03071520932
0.05831203293
0.04369082052
0.02950073954
0.04736191218
0.03128734523
0.04800877298
0.2379077219
0.2631665054
0.2585387687
0.2050882381
0.1907246938
0.1669185745
0.2079733938
0.03583385075
0.02872640292
0.06992435428
0.04258962661
0.04864352525
0.04926058645
0.04279017043
0.06842019289
0.1785658391
0.2041711789
0.3874148311
0.1588053186
0.1338949157
0.1889358408
0.1608709332
0.06720410403
0.05259805358
0.100445569
0.07233527146
0.09344527478
0.04915688286
0.06958965752
0.09620108846
0.1064921941
0.1334091481
0.4656230049
0.1068277278
0.08088948161
0.1324580565
0.1082124536
0.1275387889
0.101033969
0.05193768339
0.07758658463
0.4185682816
0.01324050945
0.05419272245
0.03244632746
0.07980739599
0.05579373575
0.0122601963
0.1400144191
0.1353689388
0.01997862449
0.004727017624
0.03053690381
0.3613625729
0.06619226198
0.01907257882
0.01101031363
0.03209223658
0.01939829069
0.06340511332
0.2299683905
0.1644109804
0.09335459734
0.09983269272
0.06320819338
0.03604968351
0.01607254468
0.008212642618
0.238567505
0.266502577
0.162095976
0.009541657121
0.1483458261
0.1825832993
0.1546733555
0.01131621542
0.05696391451
0.04922373122
0.07910740596
0.1561810462
0.143805623
0.14702692
0.0704263731
0.1114964407
0.0416865486
0.01273224937
0.02223465728
0.02161283102
0.02960270381
0.0457778187
0.04767256762
0.03425490916
0.131418169
0.1225369242
0.1302032899
0.0968439766
0.120583383
0.1283512395
0.02864178062
0.01279461045
0.05007311393
0.02212251726
0.03759385653
0.02996696771
0.01901560228
0.02917913862
0.02110248798
0.01494339248
0.02246464772
0.01903523143
0.009777369468
0.01600038811
0.02128120188
0.03671357399
0.03731099366
0.04378182219
0.04272326857
0.01759227467
0.01012220155
0.08515943531
0.01475943048
0.02683958237
0.009525459435
0.01276332885
0.08130274204
0.09396777955
0.2649668647
0.252186542
0.0729002359
0.06103491925
0.01105197231
0.0459620135
0.1958423324
0.1830837518
0.2134469822
0.2010113992
0.0463108446
0.05016928521
0.04204738374
0.09361343476
0.06600101536
0.05633109171
0.04025611264
0.06553856233
0.1054194879
0.03722672564
0.02309573779
0.01455562383
0.05184364863
0.02574306419
0.04111432651
0.02475907565
0.0575498177
0.03943059299
0.03858368907
0.2026433433
0.03140089209
0.2019982397
0.2230621645
0.03509210035
0.03922981198
0.03181575361
0.03459779517
0.2191540514
0.03418628649
0.03390307768
0.04604371258
0.0676980581
0.06313289012
0.07404746674
0.06938294686
0.04634074803
0.05098801954
0.05538992045
0.05027248879
0.06150098839
0.05681658973
0.05006488869
0.1466437262
0.1450341157
0.176159673
0.17441582
0.06327071522
0.009369937787
0.06198399584
0.09726096911
0.09540441549
0.1198072086
0.1181670961
0.02853455337
0.04191585065
0.112817357
0.03196824204
0.01892939699
0.06841135145
0.2308231293
0.2179577845
0.2478369396
0.2350673353
0.06974996696
0.02600168109
0.04965029417
0.04862182265
0.07261672263
0.07174904158
0.007477483089
0.03436395169
0.0894987959
0.07707764951
0.1781264588
0.1689216107
0.02453306791
0.01224228591
0.01988078135
0.01403591882
0.03065105236
0.01241285274
0.01359536166
0.01282687135
0.03069198376
0.05361579856
0.01293588822
0.01680244917
0.003584975834
0.01852249874
0.01416015418
0.5646674594
0.3984218347
0.382373341
0.2679278463
0.008658219056
0.005325895367
0.1520519365
0.3485925378
0.2699921833
0.005801822606
0.01274419335
0.01088514711
0.1059361074
0.09398333198
0.03680042449
0.1927337149
0.1622937868
0.08239513971
0.009199672195
0.01560005608
0.01245219189
0.008353182183
0.01227931285
0.008691593885
0.03115521232
0.01310090718
0.01232101516
0.03987956734
0.04764732941
0.01371234824
0.01890574467
0.009146044603
0.009255393945
0.03793840376
0.1494764522
0.3291716252
0.3174177142
0.3445534768
0.3330517606
0.1527935736
0.2814328978
0.2689866701
0.09528399223
0.03393560373
0.0991518225
0.09381320271
0.01185059512
0.01675707242
0.09104475985
0.0456299485
0.01483638236
0.01321124182
0.03756287983
0.0420670201
0.03773520355
0.04863568864
0.04361188786
0.03921557789
0.0350030408
0.009329723406
0.009173470563
0.0300512991
0.1895559766
0.3594787198
0.3482927914
0.06067790386
0.06263819021
0.1386588991
0.02007006301
0.0219412144
0.05627041664
0.08077607584
0.1005484267
0.09310304042
0.05543764686
0.08144855256
0.07589709586
0.09039349894
0.0836247266
0.05658625124
0.1201390125
0.2976086492
0.2854654035
0.3134867599
0.3016226527
0.1219752986
0.1028170558
0.03733023342
0.03806437624
0.02151321203
0.02234632239
0.08535011064
0.1272658642
0.05644676634
0.06026821704
0.03836957396
0.039055445
0.1123675832
0.1168439353
0.04419502796
0.06054640187
0.008052290218
0.01751322722
0.05183216913
0.03964794918
0.0766912925
0.02089443421
0.02137076222
0.02050355544
0.06525719437
0.01144615254
0.004402004136
0.12966222
0.1123516715
0.0920017896
0.08770464994
0.03020419163
0.01796077106
0.02971834314
0.07486371419
0.01884576468
0.01175232304
0.01837063213
0.02356111952
0.002835587668
0.03162639082
0.02045809903
0.01191592066
0.006245842661
0.01151183157
0.009558456763
0.009377928764
0.02713800065
0.02078562208
0.007330637884
0.0387318932
0.0403777658
0.01480657598
0.01087561862
0.007019849187
0.01144719299
0.0161418384
0.01071838196
0.01313354908
0.04007421722
0.01049399161
0.01039077922
0.01183585101
0.01286087725
0.03414774381
0.01204306369
0.01190633685
0.01311906516
0.01191031533
0.01243618025
0.01790758118
0.0139915424
0.02544821773
0.0198498721
0.01246534692
0.01464346063
0.02153229156
0.01790101975
0.0268799086
0.02264041291
0.01745085332
0.01559424437
0.01225054906
0.01134592768
0.008870101227
0.03296274672
0.03925315418
0.01209632982
0.01145749122
0.01284447102
0.0133411152
0.04642134104
0.009043960033
0.009049370375
0.01110251577
0.009189742332
0.00904332322
0.03906727683
0.009035356344
0.01262207785
0.01249921395
0.01142274552
0.01948022067
0.0501546489
0.04520343524
0.01060880161
0.03661954986
0.03123564364
0.04340707463
0.03862725352
0.01095010669
0.01163525773
0.035356545
0.02956795831
0.1077340936
0.1010319546
0.03785807875
0.04850476127
0.115087978
0.1095554523
0.04523767681
0.04438407691
0.06801336852
0.07706607629
0.09333210753
0.05783871473
0.07233436075
0.06889395696
0.0604865584
0.1393746993
0.128208743
0.1010829048
0.133119886
0.06040143231
0.03828172154
0.04250434784
0.05294943241
0.033096358
0.03702054244
0.02086416817
0.01979562041
0.04436564912
0.01423321212
0.01429506737
0.01119089332
0.02079909041
0.02463468494
0.01481840638
0.02099587338
0.03420828418
0.02871713916
0.02187051391
0.02957181196
0.09604583605
0.08417409403
0.1023973733
0.09850426966
0.0307064923
0.07575223316
0.07354697182
0.0807885489
0.0765482256
0.03659921135
0.1184953282
0.11414135
0.1255367536
0.1200375473
0.03718772408
0.0329324577
0.1074462672
0.1037296362
0.1127460263
0.1087345793
0.03327714789
0.009653951299
0.009421698892
0.03476757823
0.03135403556
0.009425970922
0.009745514954
0.04379251376
0.04301995174
0.04598431246
0.04405791945
0.04159067819
0.04053212282
0.04276279423
0.04186594204
0.07018428645
0.06822122509
0.07286107854
0.07086519774
0.06271030453
0.04873084249
0.06740299412
0.06529787896
0.02290283604
0.01943996922
0.02967796065
0.02477487586
0.006659788096
0.01242286877
0.01160837635
0.01814683098
0.01273792938
0.03636048793
0.03697148786
0.1014473326
0.02152319824
0.02130920641
0.02218400194
0.02170944183
0.02063912331
0.08774455732
0.02301008321
0.03416402358
0.04122677523
0.05454366643
0.1254572726
0.03771081945
0.0243449303
0.04039231725
0.03738822255
0.02296398869
0.02242123707
0.02390043408
0.02318733799
0.1137755256
0.03928694107
0.0401826539
0.006880725166
0.02653560677
0.01020011278
0.01036460063
0.01015808015
0.02469951354
0.008397923976
0.01965703814
0.01162126239
0.01193585611
0.05117475141
0.04463092364
0.02029786238
0.02078638181
0.07573149185
0.06748981784
0.01941227169
0.02023654543
0.01135165978
0.0290995667
0.08505925876
0.07649382607
0.0132884743
0.01264220173
0.01806678502
0.0121659676
0.01361969233
0.01613910502
0.03151644895
0.008857742232
0.01322183796
0.01199710726
0.01314571816
0.02130698877
0.05195232707
0.1102168277
0.142529259
0.0109274578
0.01064141094
0.1843095557
0.2345158719
0.193535658
0.007223578703
0.03597451298
0.01370102087
0.01753439036
0.1343845248
0.1400483398
0.1570545579
0.00470866639
0.007182346944
0.005291226427
0.004820414371
0.005641617969
0.004411078309
0.05539971955
0.03457683575
0.02188200077
0.02503977811
0.02293168946
0.02681090365
0.2196831851
0.3635000846
0.377353208
0.3442588819
0.3562682753
0.2233971458
0.04296591093
0.03735683827
0.01249476937
0.06449665878
0.0764177029
0.131835526
0.1224445113
0.1168468108
0.04899804177
0.02772631009
0.02975044587
0.03265636323
0.3737822279
0.3631064085
0.1930781102
0.1533350396
0.06831255454
0.07213400222
0.07522914558
0.08608093796
0.1670694477
0.05977625795
0.1308377353
0.124393044
0.01142400949
0.0113755952
0.01432653673
0.02016384863
0.02046309827
0.03330841175
0.01159217406
0.01162984276
0.01137312247
0.02653441778
0.0518115081
0.04456303167
0.01902075649
0.03188334791
0.0197193674
0.01989726708
0.01942658259
0.01482095352
0.009737890184
0.01156151177
0.01107428013
0.01126401117
0.02270283657
0.0281802328
0.05667653395
0.04058163997
0.03637130766
0.0332039007
0.02448263119
0.04204206988
0.01483169506
0.02054647994
0.01216804835
0.008739458164
0.008861567717
0.01245145443
0.01231265303
0.02250509659
0.01427645797
0.00986633054
0.01744150417
0.01910309236
0.01762567372
0.01379561188
0.01717935879
0.01609592175
0.01054323641
0.01108870783
0.006613789589
0.009683731788
0.01054474857
0.05697107424
0.05175905412
0.02118681695
0.009407731825
0.01294248235
0.01189226998
0.01120488524
0.01406360745
0.01260799574
0.04810584608
0.03721019841
0.04280394507
0.06672757119
0.0939560289
0.09262959951
0.04181804194
0.06755780464
0.06393607183
0.09156944175
0.08990534821
0.06421725783
0.03205292648
0.03863257227
0.03467562448
0.02664939153
0.02729930295
0.02252754783
0.04689952875
0.04556934542
0.04902008666
0.02377092174
0.03423061018
0.03258216018
0.05276475236
0.05238936031
0.03114434225
0.02887624584
0.02846110088
0.03152803747
0.03081651977
0.03562248832
0.05877847045
0.05817285174
0.06233159847
0.06158243711
0.0384723906
0.03214627455
0.05398321767
0.05346784495
0.05754919492
0.05693329234
0.03414079638
0.06569770147
0.06760887699
0.1516196044
0.1401817209
0.0632278654
0.06508999731
0.092951443
0.09610009807
0.18162353
0.02684618305
0.02669908273
0.02822085038
0.02799901344
0.02045626439
0.02642743456
0.02632052533
0.1689324478
0.08831630479
0.09177727511
0.009264298437
0.009254744448
0.0115213478
0.01109836438
0.009356324874
0.009125553411
0.006806260978
0.05753776001
0.02283687916
0.0280830826
0.1391637253
0.132986568
0.06307950941
0.07274859669
0.1465482347
0.1410038215
0.03258297241
0.03264054264
0.05000702461
0.04830362957
0.03218557286
0.03213191368
0.01114757495
0.02318418435
0.03705754975
0.03650213706
0.008637074832
0.01472503201
0.01765134299
0.01374044735
0.01319647749
0.01879741132
0.0190418205
0.03110895476
0.01251530399
0.009124258071
0.01237773438
0.01271107122
0.02908601168
0.01829290922
0.0188857273
0.01366902881
0.03316942906
0.02779755149
0.01106713272
0.01104650051
0.010865835
0.01110238517
0.0154330785
0.006366910214
0.00406932089
0.007461743698
0.01166880817
0.01066914361
0.0108485484
0.01059262134
0.01077239299
0.01094915389
0.009962141715
0.006554228871
0.0051961451
0.01135623291
0.01167879339
0.01100986216
0.01110042758
0.01275785648
0.01957948867
0.01982134647
0.01921445573
0.01940828899
0.01263969656
0.009104249048
0.0150486688
0.01502758191
0.01555468094
0.01516593862
0.009005920471
0.0140856714
0.0219985104
0.02444177376
0.02009976066
0.02072720871
0.01364435877
0.00930907572
0.01504111451
0.01504225747
0.01499191562
0.01503208704
0.00923297211
0.01067125005
0.01085224947
0.01032271723
0.01082189956
0.03749503967
0.05701196471
0.05653804554
0.02175152456
0.03630258597
0.03604647097
0.03764524226
0.0366722592
0.02196237647
0.01183685361
0.01137497648
0.0115980388
0.01191176152
0.0204133114
0.02021690503
0.02085341364
0.02063157673
0.0159003219
0.03543672902
0.02106900945
0.02200424826
0.02107092009
0.03554672803
0.03532293132
0.03588568353
0.03569977534
0.02119865339
0.02176944238
0.02116579867
0.03186947879
0.0227508152
0.01630800298
0.007869898175
0.01140133997
0.01129710869
0.007763488745
0.04357117589
0.03025274876
0.002988651788
0.03020522648
0.04639997408
0.04606152355
0.01880922543
0.01167134798
0.008571762851
0.00344147685
0.01319888721
0.01349425714
0.01947910775
0.01964791717
0.03181569094
0.01985179948
0.01079411233
0.01139778569
0.01466449309
0.004515805311
0.009036495756
0.00693133697
0.006737423658
0.007391064405
0.00958984614
0.006581751126
0.01097707995
0.01099797691
0.0108759006
0.04032622783
0.03122802105
0.00823318999
0.01024679734
0.01131316611
0.01848772459
0.0207037421
0.01207801462
0.01496950985
0.01457689146
0.01061905551
0.007003927111
0.01056936202
0.01197205958
0.008336016159
0.0118773948
0.01216670929
0.01238042644
0.01233853859
0.01213145796
0.01229192672
0.01220411967
0.01214882496
0.01244710329
0.01243200406
0.01231540674
0.01262695159
0.01292915645
0.01268102459
0.01814967054
0.01956873983
0.01835232105
0.0259889193
0.02243685504
0.0174179626
0.01632798125
0.01759231542
0.01088283628
0.01737629162
0.01837875804
0.01252160126
0.01733657872
0.01168912719
0.01188286552
0.01885511451
0.01902632662
0.01844811614
0.01870030742
0.011717866
0.01302281227
0.02261133088
0.02220068291
0.009078645052
0.009059044693
0.0099310441
0.007314660513
0.009017176576
0.009020969678
0.008942021756
0.008546585811
0.01040141218
0.01866861374
0.01666666865
0.02158296084
0.02046383058
0.0118503332
0.009722503875
0.01026703242
0.01418832916
0.006664064382
0.009960685033
0.009916928229
0.01116397733
0.009723525627
0.00990552197
0.01686975157
0.01499242626
0.009867594762
0.04640592095
0.04339423544
0.08293694737
0.0744149752
0.04377266314
0.06395691873
0.08907777759
0.08565572457
0.03469520499
0.03196683809
0.03000241784
0.02267398004
0.02931266808
0.04254003464
0.04296188156
0.03773797656
0.02080456768
0.02993204121
0.0303731526
0.02722434265
0.02814747516
0.01961898514
0.01346539905
0.01445831554
0.02219377471
0.0156782009
0.01490646114
0.01676352779
0.01589846274
0.02250743629
0.01525284979
0.01589148313
0.01249888048
0.01630378367
0.04832767685
0.04851848559
0.03101950605
0.030684062
0.05141702684
0.05140963384
0.02957268427
0.02917715578
0.03035223645
0.02992651617
0.05988583726
0.05930853396
0.03602483442
0.03781285463
0.06100943906
0.06045364891
0.05517483402
0.0546276956
0.03258364369
0.03366715681
0.05630697833
0.05573563021
0.009554647873
0.0151030631
0.01512887961
0.01507977753
0.01510785703
0.009513860026
0.009784270072
0.01405082762
0.01222960706
0.01505528285
0.0148002621
0.00978106129
0.04352299566
0.02554447473
0.02581514329
0.02511809943
0.02532547396
0.043277169
0.04485607532
0.02676350353
0.02725343258
0.02608272725
0.02639511207
0.04437716353
0.04120752206
0.02389419593
0.0241341512
0.02352596014
0.02375717377
0.04097221077
0.04248269218
0.02472193517
0.02491378849
0.02429911259
0.02453344436
0.04220712047
0.02728813589
0.02710171767
0.06953888834
0.04661592686
0.0469379193
0.04591621888
0.04619801544
0.06882335087
0.02773752769
0.02752976947
0.02517113189
0.02644188557
0.06061340384
0.04215325747
0.0418485328
0.02816085678
0.02957804716
0.05411189166
0.06691962649
0.0452147712
0.04541522879
0.04449578556
0.04444460686
0.06568367459
0.02598997559
0.02603590369
0.009249499638
0.009402240357
0.009188890078
0.01067184724
0.009824929113
0.01206218482
0.009190428315
0.009185632393
0.009094184266
0.009143035299
0.01197453218
0.01623468099
0.009820398356
0.01081857088
0.009300585895
0.009130403586
0.01404569463
0.03628072918
0.05443436804
0.05412000701
0.0558457315
0.05548102172
0.03687303186
0.0214786867
0.02123693662
0.02205922781
0.02178479425
0.02174880611
0.01701269157
0.02420460771
0.04468572783
0.03999641539
0.05192731911
0.05008583613
0.03444180768
0.02644083686
0.01834554087
0.023627403
0.02512865201
0.03970982588
0.02317066601
0.02346127307
0.02248205156
0.0232260257
0.0397791586
0.02279715923
0.0225703629
0.02362979885
0.02338232956
0.01036271506
0.01132607348
0.011063504
0.01377294438
0.01218334477
0.01036702456
0.0099627421
0.0101312934
0.01062211083
0.01040782283
0.006759091958
0.01204044532
0.01153245339
0.01169101582
0.01229294779
0.0118404396
0.01198577894
0.01975392733
0.01970912171
0.02000925447
0.01994390397
0.03047883712
0.03044569299
0.04626071192
0.01893443644
0.01998573774
0.01947261959
0.0195416949
0.02051320638
0.03473169362
0.0343663252
0.0351617026
0.03487876906
0.0205926478
0.0199665288
0.03367372012
0.03178341568
0.03424472016
0.03364785065
0.01994991649
0.01147396397
0.04442090637
0.04387674438
0.02888640643
0.01345067801
0.01096256592
0.01070617461
0.008165708762
0.0112109229
0.01281462692
0.01863796851
0.01280999398
0.0138000602
0.01352162292
0.03122638322
0.01915378076
0.01935827447
0.01223126682
0.0122753003
0.01229191459
0.01303358066
0.01288693803
0.00876056114
0.009002918283
0.01308576001
0.01240748613
0.01282779451
0.01553187169
0.01917402012
0.0291165651
1.155382983
1.156013647
1.155928881
1.156280365
1.157302688
1.156587251
1.157729446
1.022125484
1.157528399
0.9823694632
0.8717255351
1.032576904
0.8513164348
0.8021354557
0.9467562938
0.7995169725
0.8080449921
0.9528888255
0.8162380901
0.8804804031
1.043438827
0.905726734
1.030382133
1.157680188
1.073877294
1.157539045
1.156729309
1.157165527
1.156231802
1.156056794
1.155583023
1.156908996
1.156136556
1.157499961
0.9538678207
1.157728443
0.8914090584
0.7441074771
0.9517991495
0.7073779533
0.6239259105
0.8103200088
0.6045906492
0.5704653222
0.7459514363
0.564803364
0.5730096908
0.7504705384
0.582894526
0.6354247098
0.8192051217
0.6602758336
0.7590016071
0.9607179715
0.800851668
0.9623078187
1.157976117
1.029664282
1.157259743
1.156395196
1.156611222
0.976746628
1.157346858
0.8947908578
0.6979919021
0.8810233025
0.6458664715
0.5198676999
0.6817292423
0.4864975193
0.4081872371
0.5653792897
0.3890835139
0.3535263464
0.5111569432
0.3494138201
0.3591729421
0.5157989304
0.3693963326
0.4198349311
0.577080996
0.4429860653
0.5329200873
0.696736579
0.5693238617
0.7100470379
0.8917414107
0.7654592868
0.9637914444
1.157709013
1.029999831
0.7700821933
0.9151684884
0.7012445084
0.5286845284
0.6480709394
0.4808717491
0.3612387846
0.4741556022
0.3280233036
0.2467286586
0.362525391
0.2259908656
0.1883056619
0.3071641847
0.1844254143
0.1972479887
0.3130670094
0.2088166116
0.2615259489
0.3751404118
0.2838493687
0.368941329
0.4851984827
0.4019583248
0.5263216661
0.6575143698
0.5764835805
0.7578457503
0.904181968
0.8684296784
0.6416507678
0.7299005342
0.5802192564
0.4239744464
0.4967044977
0.3800021328
0.2630295576
0.3317909598
0.2285651201
0.1395602727
0.2148193207
0.1171520266
0.06681361544
0.1557137036
0.06672402403
0.09346395324
0.1655273211
0.105456214
0.1599279905
0.2309119984
0.1818211414
0.2609478507
0.336180278
0.2918606622
0.4053629022
0.4907637591
0.4506126014
0.6138819477
0.7174248789
0.7764816163
0.5768224941
0.6200039786
0.5218374495
0.3791442865
0.4075801058
0.3373456131
0.2248198732
0.2478072192
0.1915865605
0.091678622
0.1223520794
0.08598843653
0.05258443557
0.08318572497
0.02727827731
0.03559485252
0.0599336469
0.06817202833
0.09032050499
0.1056191311
0.1301418213
0.2016673596
0.2417481287
0.2301656024
0.3331900542
0.3830066357
0.374325849
0.5222565403
0.585472148
0.7290023791
0.5570184639
0.5683935624
0.5095551377
0.3871526393
0.3763811349
0.3510621342
0.2570564207
0.2265991602
0.2013863455
0.174928811
0.1651672918
0.08399739215
0.07298833409
0.06631200773
0.05161860198
0.07352922815
0.07598567523
0.1201843647
0.1817337582
0.1934629148
0.2070856518
0.2999411901
0.3216002572
0.3373650839
0.473143589
0.5062928255
0.7237392091
0.5727390253
0.5590911365
0.5310378674
0.4256302592
0.3963589014
0.3963395963
0.3256260397
0.2720812735
0.2681683652
0.2502489493
0.2268913575
0.1965656228
0.1960803183
0.1728786631
0.07154649957
0.08725932833
0.08087010554
0.1331727241
0.1876027661
0.1814003641
0.2098820775
0.2969812926
0.2966357237
0.3323087159
0.4618334252
0.4661380144
0.7327858999
0.6006629355
0.5786122547
0.5642757939
0.4734359686
0.437790683
0.4488740038
0.394613084
0.3440691976
0.3505028199
0.3448126967
0.3222758311
0.3413253862
0.3518713574
0.3391043139
0.09889136813
0.113175239
0.1030234623
0.1595310552
0.2121568993
0.1926763387
0.2340734599
0.3156389567
0.2993667093
0.348454911
0.4669568141
0.4618005186
0.7549587582
0.6349214279
0.60877354
0.6013621288
0.5165342381
0.4848319429
0.4931475421
0.4395960872
0.4086234232
0.4131248119
0.4121716325
0.3998851925
0.4560389632
0.3874615865
0.3985293105
0.1311783088
0.1472334904
0.134098214
0.1972528903
0.2518508258
0.2206984856
0.2743312756
0.3553227237
0.3237071847
0.3875488197
0.4998944198
0.4740831526
0.7907549659
0.6777300884
0.6446515161
0.6442890716
0.5578251345
0.5266955309
0.5324023377
0.4639077215
0.446880116
0.4311011574
0.4387162355
0.4256137302
0.4427350306
0.3236448904
0.3361854672
0.1630240877
0.1797188064
0.1685056861
0.2516044708
0.3116247431
0.2642328211
0.3349789726
0.4175008175
0.368608037
0.4491970519
0.5565912954
0.5131876349
0.8373495143
0.7333063957
0.690321371
0.7009561604
0.6116613548
0.5698301726
0.5837604734
0.5007599692
0.4696037238
0.4595225279
0.4281130903
0.433095564
0.3805233385
0.254501007
0.2676943784
0.06596191549
0.1184525332
0.1104201463
0.2646824013
0.3252196312
0.2517270131
0.3440149839
0.4066042549
0.3319164304
0.4297018564
0.5066661304
0.4364933217
0.5361485123
0.6325004755
0.5743867371
0.9158258942
0.815968978
0.7525930696
0.7867731923
0.7000711059
0.6318826204
0.6740213096
0.5930696556
0.5189882329
0.5120110892
0.4806469259
0.46200255
0.2886266882
0.1446307435
0.1620792784
0.1240041396
0.2371377559
0.2066955508
0.4153740772
0.4971734444
0.3589167142
0.5089112697
0.5521321441
0.4370685
0.5701597301
0.6363824595
0.5362355442
0.6622399238
0.7446736459
0.6576670278
1.032337361
0.9416371352
0.8439612726
0.915657977
0.8453574911
0.7313413168
0.8245960489
0.7657043805
0.6291962971
0.7533463012
0.2554642557
0.3757147629
0.06716728518
0.1027417496
0.08819102893
0.1740965251
0.3787892245
0.3545348697
0.4515589447
0.6774293188
0.5585970541
0.7514107083
0.7675467367
0.5993383479
0.7730715158
0.8094986093
0.6730653756
0.8274181232
0.8988230749
0.7810137291
1.166377726
1.128611442
0.9818004003
1.110721756
1.077433319
0.8926603146
1.045463468
0.8340162123
0.8332121286
0.6865560147
0.08386523388
0.2187601085
0.02912222353
0.1570847149
0.1120401291
0.2300444449
0.4352944714
0.3901444764
0.5124587764
0.734810425
0.6906902931
0.8032731691
0.9672209196
0.8330580931
1.007846305
1.036844517
0.8610919984
1.043946734
1.092729479
0.9449095609
1.167353676
1.141093649
1.144017558
1.125596728
1.036722823
1.069077189
0.9784518389
0.5612837254
0.788701594
0.3375353084
0.03591774976
0.05873430433
0.03526922301
0.243806825
0.1773408003
0.3059788661
0.5120599865
0.4535394046
0.5881968264
0.7924428229
0.7500961468
0.8517782874
0.9911309813
0.9743202729
1.025334551
1.098470757
1.094411854
1.115465871
1.149908727
1.147676295
1.167827124
1.139163731
1.140563088
1.120683791
0.9897658634
1.024005886
0.8876732747
0.3066446627
0.4742687842
0.1526823935
0.04217669368
0.0357520553
0.07310463961
0.3127444998
0.2646607474
0.3693347243
0.5747241515
0.530833773
0.644819216
0.8269696366
0.8041322766
0.8777419046
1.000303938
0.9947707297
1.03189103
1.102214635
1.099548299
1.118644505
1.151924694
1.150505747
1.167833183
1.136508025
1.138589274
1.11543535
0.9561587932
0.9818386302
0.8298594111
0.2525299954
0.278633206
0.1216584895
0.05067792407
0.045000842
0.1035840822
0.3354129287
0.3227196013
0.3934666271
0.5923389386
0.5839084451
0.6589920361
0.8356879227
0.8296344731
0.8853930881
1.005376785
1.001727083
1.036196246
1.104716051
1.102941066
1.120708561
1.153101283
1.15228758
1.16747318
1.132923785
1.135699895
1.108650618
0.9168466077
0.9469380493
0.7694805167
0.2309195033
0.246263467
0.1119695218
0.05698686762
0.05216757944
0.1188688783
0.3433562207
0.3375533234
0.4027064514
0.5987435119
0.5941418891
0.6644986974
0.8412175849
0.8373409661
0.8906549431
1.008992831
1.006408305
1.039218558
1.106313197
1.105190432
1.121964105
1.15366012
1.153291629
1.16681611
1.128384
1.131882117
1.100250661
0.8717158838
0.9059678623
0.7147535186
0.2165682296
0.2267343562
0.1059687375
0.06385163572
0.05867245556
0.1315415034
0.3497442536
0.3450925491
0.4098602885
0.6034231151
0.6000533085
0.668239192
0.8441449261
0.8421694039
0.8935934147
1.011289562
1.009690207
1.041138695
1.107209415
1.1065979
1.122602737
1.153763289
1.153723907
1.165893953
1.122706094
1.12708777
1.089738569
0.8275164526
0.8602250053
0.6724684606
0.2073624975
0.2138432656
0.1026526827
0.07078593334
0.06559249234
0.1418100034
0.3547533085
0.3511182018
0.4153313232
0.6067947562
0.604378311
0.6707113169
0.8451942781
0.8445536241
0.8946154493
1.012299172
1.011660194
1.042002627
1.107502834
1.107337388
1.122727351
1.153518009
1.15373191
1.164670718
1.115316569
1.121049941
1.076149777
0.7904287058
0.8174882537
0.6411084576
0.2017314492
0.2056887736
0.1012571698
0.07748954055
0.07249024388
0.1500360883
0.3585780711
0.3558126253
0.4194264821
0.6090934684
0.6074623102
0.6721746713
0.8450240288
0.8452466681
0.8943073163
1.012162017
1.012364066
1.041888698
1.107239695
1.10748779
1.122388106
1.152985957
1.153410562
1.163027313
1.105590094
1.113118024
1.059441785
0.7609581032
0.7824023918
0.6174643959
0.198839716
0.2007821457
0.1013772586
0.08377826723
0.07910414985
0.1566363358
0.3613974178
0.359373121
0.4224233385
0.6105051012
0.6095230767
0.6728188905
0.8440347213
0.8448428079
0.8931148349
1.011121104
1.011976801
1.040959374
1.106473231
1.10709283
1.121629275
1.152206163
1.152813249
1.160795241
1.093656021
1.102789134
1.041131982
0.7376197881
0.7546121075
0.5994121854
0.1980547778
0.1984703792
0.1027268368
0.08955126668
0.08526881249
0.1619302236
0.363383099
0.3619641169
0.4245472526
0.6111789663
0.6107376381
0.6727917452
0.84245095
0.8436883153
0.8913056555
1.009411973
1.010748684
1.039399078
1.105277886
1.10621162
1.120508227
1.151213603
1.151976947
1.157827877
1.080419131
1.090427955
1.022969733
0.7190255371
0.7325773263
0.5855889631
0.1988845049
0.1981286498
0.1050820387
0.09480262039
0.0909099347
0.166120611
0.3647039235
0.3637692525
0.4259304488
0.6112386069
0.6112467448
0.6722120659
0.8404124982
0.841979684
0.8890415025
1.007213635
1.008902761
1.037363593
1.103733047
1.10492164
1.11908758
1.150043375
1.150936679
1.154074697
1.066873978
1.077031106
1.005943598
0.704120027
0.7149919748
0.5750227063
0.2009875394
0.1993041325
0.108302187
0.09953255616
0.09602967217
0.1694526949
0.3654968283
0.3649474672
0.4267120854
0.6107971356
0.6111709714
0.6711848184
0.8380197656
0.8398442719
0.8864304495
1.004651786
1.006603434
1.03496963
1.101908838
1.103300868
1.117424266
1.148727952
1.14972724
1.149604353
1.053697492
1.063527915
0.9904052547
0.6921003865
0.7008726161
0.5669812963
0.2040716756
0.2016780942
0.1122582134
0.1037485027
0.1006281197
0.1721124968
0.3658505059
0.365622313
0.4269975165
0.6099476562
0.610619583
0.6697968849
0.8353503569
0.8373756698
0.8835518265
1.00181544
1.003965631
1.032302573
1.099861908
1.101416141
1.115565138
1.147294622
1.148379948
1.144562056
1.04123912
1.050509439
0.9764098593
0.6823786429
0.6894739735
0.5609347069
0.2079345284
0.2049696177
0.1168558072
0.107482121
0.1047167385
0.1742487637
0.3658565463
0.3658802396
0.4268941597
0.6087675001
0.6096807011
0.6681180414
0.8324658041
0.8346473637
0.8804667441
0.9987687913
1.001071572
1.029424619
1.097635867
1.099320864
1.113546684
1.145764773
1.146920723
1.139121085
1.029639797
1.038258091
0.9638809975
0.6745286142
0.680243039
0.5565101494
0.2124529673
0.2090044026
0.122027461
0.1107839882
0.1083329631
0.1759860133
0.3656045776
0.3658139621
0.426476957
0.6073160644
0.6084281705
0.6662021775
0.8294112373
0.8317166434
0.877219411
0.995556954
0.9979799622
1.026379872
1.095263077
1.097055446
1.111396214
1.144154271
1.14536938
1.133444739
1.018940188
1.026881988
0.9527141496
0.6682821944
0.6728316214
0.5534500524
0.2175376063
0.2136671318
0.1277098407
0.1137232279
0.1115312827
0.1774386783
0.3651559647
0.3655075747
0.4258126472
0.6056397643
0.6069157045
0.6640899562
0.8262210869
0.8286251038
0.873843648
0.9922140851
0.9947323905
1.023201803
1.092768674
1.094650088
1.109134999
1.142474873
1.143740643
1.127664689
1.009127725
1.016407581
0.94276156
0.663377326
0.6669436285
0.5515362218
0.2231084149
0.2188732705
0.1338484909
0.1163612842
0.1143810598
0.178672294
0.3645502105
0.3650152706
0.4249576403
0.6037888871
0.6051910693
0.6618231933
0.8229284859
0.8254060871
0.870371301
0.9887694412
0.9913614116
1.019918394
1.090173051
1.09212859
1.10678018
1.14073554
1.142045486
1.12187472
1.000134325
1.006808009
0.9338604676
0.6595480159
0.662331259
0.5505194759
0.2290455226
0.224531243
0.1403619227
0.1187618357
0.1169398376
0.1797374064
0.3638359983
0.3643743659
0.423973473
0.6018208337
0.6033037614
0.6594478519
0.8195685807
0.8220933619
0.8668349135
0.9852497302
0.9878956125
1.016554485
1.087493773
1.089510496
1.1043466
1.13894473
1.140292532
1.116134412
0.9918676899
0.9980049274
0.9258397965
0.6565402475
0.658727664
0.5501544498
0.2352078457
0.2304989618
0.147137399
0.120995473
0.1192729731
0.1806965179
0.3630697561
0.3636376514
0.422917136
0.599788388
0.6013160858
0.6570069438
0.8161709213
0.8187214595
0.863261461
0.9816766843
0.984360686
1.013130294
1.084745423
1.086812645
1.101846691
1.137108846
1.13848991
1.110481554
0.9842259261
0.9899069291
0.9185541294
0.6541502756
0.6558848758
0.5502580704
0.2415024107
0.2366147471
0.1540888825
0.1231189814
0.1214438098
0.1815905006
0.3622764457
0.3628586044
0.4218161567
0.5977031785
0.5992685795
0.6545222298
0.8127519568
0.8153171986
0.8596672944
0.9780670618
0.9807769724
1.009662445
1.081942016
1.084048912
1.099292987
1.135235391
1.13664349
1.10461215
0.9766989453
0.9824593812
0.9114917699
0.6521658302
0.6536456532
0.5507895548
0.2483173555
0.2427449107
0.1616514884
0.1253262259
0.1234998235
0.1825102573
0.3614128229
0.3620779381
0.4206065413
0.5954290044
0.5971980587
0.6518424819
0.8090990003
0.8119111383
0.8558337351
0.9742210799
0.9771674918
1.005965712
1.07895144
1.081232454
1.096571146
1.133257284
1.134755259
0.1512517717
0.1317710248
0.1401290638
0.05243759823
0.04639607815
0.05098266759
0.03672094127
0.03681495052
0.04352471581
0.3295333201
0.3177124354
0.2934236666
0.07707725742
0.07217757168
0.07703073252
0.05257029701
0.05814337328
0.06090598546
0.402064614
0.4126643064
0.4188063963
0.1086948394
0.1061810499
0.1104311004
0.07922395629
0.08397987213
0.08802946316
0.3402563555
0.3524043559
0.459749899
0.1393695275
0.1358456018
0.1380597304
0.1143621906
0.1183747281
0.1213944155
0.272272046
0.2855452205
0.4025953662
0.03927950056
0.03234721603
0.03404851061
0.06801475337
0.06428071433
0.04793772002
0.1616814739
0.1423719958
0.1514637049
0.1404315048
0.1430889357
0.1490379582
0.1670966831
0.1814511463
0.3439979881
0.07645979777
0.02955694332
0.03094240884
0.01945345896
0.02612208838
0.04351048108
0.1418299749
0.1361437613
0.0933485035
0.2094556631
0.1776288029
0.2124072592
0.1554887107
0.1704210333
0.2026499097
0.03522350803
0.04724258952
0.08173817141
0.002971561283
0.003710631805
0.003733113652
0.07097186163
0.04443707418
0.02910147129
0.003051818101
0.002730526202
0.04723703191
0.04001333729
0.03736887212
0.06462223549
0.04033394595
0.06080300198
0.02741683906
0.02673737878
0.02779168836
0.01624467977
0.01654597671
0.01916965221
0.0781243831
0.07482934217
0.05298020489
0.1021145989
0.08675414947
0.0887740105
0.08831371279
0.08649999782
0.1026240798
0.2986018339
0.2744267961
0.2889782446
0.2542007713
0.2567686855
0.298574578
0.2027131219
0.2425752815
0.236169206
0.02920199763
0.01812847803
0.01794119108
0.02981642187
0.02920768845
0.04149489642
0.09899157661
0.0906242636
0.07369717082
0.1136743935
0.1016345272
0.1075452569
0.09214929391
0.09650135691
0.1092437493
0.3843025583
0.3656211949
0.369190844
0.3761650571
0.3578042409
0.3937242101
0.3100664059
0.350368035
0.3616352255
0.3836708814
0.3633694082
0.3561731363
0.2121052681
0.269762726
0.2658862052
0.2918272812
0.2882969603
0.2307321256
0.05001983976
0.03887720932
0.04032128742
0.02516651969
0.02534587561
0.03661589159
0.1295784554
0.1175360596
0.1028664268
0.138795016
0.1282237311
0.1361704479
0.1137742637
0.1206414465
0.1315826436
0.4256972817
0.4206081524
0.4226010808
0.4515276936
0.41757908
0.4321143135
0.3960009449
0.4220986352
0.4491681123
0.3721384002
0.3837064593
0.4624762045
0.1404403448
0.2089559483
0.2054597926
0.231892051
0.2275094953
0.1709636437
0.0930327358
0.06813709618
0.07199393936
0.04271651424
0.04735454832
0.07403478857
0.4265256889
0.4434104895
0.4375214762
0.4190228517
0.4300791367
0.4197250625
0.4227064938
0.4301971963
0.4231776091
0.3069469917
0.3195402394
0.4351342515
0.08691587568
0.1504097379
0.1527162451
0.1720617045
0.1682147317
0.1008169608
0.02677758213
0.02462862786
0.01569032823
0.1324054164
0.08071610002
0.09352414582
0.1094249304
0.1134976667
0.1286350362
0.4458196534
0.4397554708
0.4691090654
0.3755621266
0.4213066893
0.4332111509
0.4193546737
0.4185213734
0.3775256573
0.236729728
0.2496416184
0.3721491707
0.03105557181
0.04938944133
0.04854066328
0.07349349219
0.07218028377
0.05019443749
0.009625596961
0.009446896134
0.2530035851
0.09519114808
0.01806478065
0.01826223131
0.034520733
0.04349722976
0.08207399568
0.07278975425
0.07241612881
0.06200653709
0.1606210373
0.1363809707
0.1322055842
0.03219189617
0.02672534637
0.02539832776
0.05332028206
0.04719060927
0.05195481376
0.04533453461
0.03163499451
0.0304765003
0.02900044101
0.03004845131
0.03028593553
0.04066980998
0.04480391904
0.04984651222
0.03316469675
0.03449936615
0.0327202255
0.04612661742
0.04423513525
0.04479472865
0.2482198925
0.3271583816
0.3397512199
0.2761039965
0.3178794343
0.2518285779
0.273791627
0.3055342864
0.2664750179
0.2001542252
0.1250295182
0.1298033064
0.101577258
0.1050747134
0.1961665048
0.1892299578
0.1517159926
0.1579832132
0.1313520177
0.1360319623
0.2119359874
0.03554034431
0.02490353785
0.02498689428
0.01789588014
0.01786765949
0.02878335066
0.06544503281
0.06931166581
0.07759059486
0.04335316498
0.06734080223
0.06204238593
0.07571176368
0.07406509281
0.04744308048
0.05293279054
0.05022845792
0.04812685263
0.06100158965
0.05770014696
0.0450348517
0.06138093475
0.05895561369
0.06358227469
0.182510513
0.239327472
0.2352772987
0.262025776
0.2581815497
0.2003971562
0.4031269826
0.4162969627
0.3982772253
0.156907826
0.1278708457
0.1298130833
0.107885306
0.109258834
0.1355480319
0.1834318159
0.09719296769
0.1004564854
0.1320535879
0.1344334103
0.1629651041
0.06402405462
0.03613929714
0.04112900926
0.04161365241
0.0427221455
0.05380998267
0.0961939964
0.1020733818
0.1047286362
0.07495080214
0.09631301845
0.09381250712
0.1083396358
0.1031987656
0.08399425881
0.05115973347
0.07914319928
0.07740844699
0.09122424022
0.08797527044
0.06111257066
0.09202726135
0.08683527332
0.09253361368
0.1115051788
0.1794484586
0.1756351999
0.2019068309
0.1983217539
0.1284925199
0.4634349895
0.3564140283
0.3682513517
0.1054899434
0.08046864289
0.08139990003
0.056754668
0.05749835786
0.08210036229
0.1308275039
0.1051843296
0.1066348627
0.08241002547
0.08337345809
0.1095812387
0.1244274403
0.1008246952
0.105034923
0.07568745225
0.07962924391
0.1049385531
0.05353827991
0.07688001347
0.07496127207
0.1521443304
0.1482053211
0.0738926875
0.4109713736
0.2899009162
0.3027529556
0.05321360082
0.03358853473
0.03392737064
0.07874380922
0.05556581918
0.0561513271
0.03481962052
0.03703108268
0.05840597289
0.1369223347
0.1151577972
0.1228665909
0.0980724112
0.1107236038
0.1353383247
0.0220659813
0.03088133703
0.02914937384
0.003273537933
0.02830771481
0.01581247298
0.04769188925
0.04723593301
0.03047268634
0.3731272503
0.2185874436
0.2311374836
0.05138863476
0.05423406139
0.06943467572
0.01557763879
0.01437654987
0.00492564541
0.06014651683
0.04524090323
0.04836035658
0.2054986578
0.1873356306
0.2138150963
0.1228640613
0.1601157784
0.1891173172
0.1306266989
0.1518156329
0.1120659095
0.08793794985
0.07892307798
0.09031512732
0.04599315301
0.06629590466
0.0786602032
0.05151370631
0.06014170785
0.04194579064
0.007160557107
0.009000619289
0.008768882521
0.2446275473
0.2202846613
0.2173432124
0.2391248484
0.2204766538
0.261184117
0.1658236352
0.2044374234
0.2180445566
0.1579425418
0.1547735671
0.135036373
0.1724975838
0.1619697102
0.1714894998
0.1444118666
0.1527188504
0.1634554121
0.05325893151
0.03020627657
0.03604722648
0.04080465562
0.04209853323
0.05141889462
0.1244471805
0.1218837115
0.06961765973
0.1515403371
0.1360502621
0.1402401295
0.128252303
0.1314418176
0.1475904216
0.1071628706
0.1199156761
0.1513790536
0.08603210134
0.1087810002
0.09641413479
0.1248575544
0.1147053383
0.1000676855
0.0129167957
0.0107870042
0.01054776009
0.02056973624
0.01835980005
0.01975628038
0.02337512653
0.03191052405
0.03167276574
0.03103567191
0.02957061528
0.02784732697
0.04426572946
0.03710892373
0.03903213132
0.04569419004
0.036787555
0.03852891491
0.02470030291
0.0266842589
0.03599217967
0.1298309331
0.1333436316
0.1350831805
0.1272943745
0.1279232692
0.1291243302
0.135080426
0.1317602418
0.1311622896
0.1069759099
0.1166791131
0.1121051263
0.1250676502
0.1189807199
0.1105208826
0.1249443824
0.1222770575
0.1258204327
0.01931374247
0.02166220289
0.03041361721
0.0139158211
0.0134645019
0.01258625329
0.0471687626
0.02824769638
0.03321171494
0.0277621389
0.01786707466
0.01193107534
0.03367177223
0.02132879001
0.03118155995
0.01533125985
0.01914913949
0.03235046364
0.01972661334
0.0168199319
0.01620488874
0.0264104762
0.01644535687
0.02513231629
0.01154160417
0.0145038245
0.02349814493
0.01934276674
0.0219788179
0.0239865126
0.01097677396
0.01498216574
0.01344802384
0.0161640516
0.01471604469
0.01510080328
0.01986025062
0.0177117362
0.01871073951
0.02654931688
0.02555051194
0.03580665803
0.03798896964
0.0272889728
0.02674542019
0.03306451898
0.03374392376
0.04458521163
0.04164982188
0.03097077899
0.03219122637
0.06103864149
0.06458546643
0.08898111269
0.01670131961
0.02576711009
0.02382139806
0.03682737292
0.03522509301
0.02516019976
0.0218260886
0.02026325912
0.01168364547
0.07783133842
0.04922332975
0.05200743491
0.1576785663
0.1527504813
0.08912240403
0.2605808564
0.2058351142
0.2105133429
0.1974747917
0.2024500276
0.2565096485
0.06884436531
0.05075330565
0.05454497128
0.03831814738
0.04247349078
0.06477573806
0.06417099879
0.06229703856
0.04405029026
0.1924983897
0.1418307294
0.1444128005
0.120821643
0.1311893669
0.1868614119
0.2094515423
0.1574824779
0.1611679467
0.1497090167
0.1529809281
0.2047406575
0.04734439577
0.06667423499
0.06531472113
0.09331803102
0.07864640029
0.08265701733
0.05557527043
0.06140006079
0.06391042131
0.1183110231
0.1233121765
0.1014245619
0.03327977016
0.02965450289
0.03423258021
0.01788465437
0.02415220348
0.0292280656
0.02067792607
0.02220739415
0.01655279483
0.04669660022
0.04706529764
0.05094839153
0.02852754997
0.03104924013
0.0285530162
0.04610619804
0.04154458203
0.03672012804
0.03886621954
0.0405627774
0.04116068787
0.03762598746
0.0365400186
0.03736822333
0.1141486158
0.1229194388
0.1987122876
0.1978571221
0.1063137273
0.1113946134
0.144381062
0.1498121272
0.2136222719
0.2152973396
0.1376360513
0.1426515007
0.02452187616
0.02457185703
0.03437755482
0.03343077551
0.0239167627
0.0243459866
0.06887894071
0.06718100139
0.04419093865
0.06630315219
0.06602833326
0.06781480349
0.06206614168
0.06286620224
0.06469817538
0.07253089817
0.07255755883
0.07418564819
0.06935568245
0.07094696353
0.07096071136
0.04711261855
0.07242125024
0.07074578928
0.05459929639
0.05237155635
0.05400650557
0.05369946493
0.05237567725
0.05417802364
0.04876079002
0.05056238609
0.05199727674
0.0600470472
0.06011763702
0.06092462517
0.05580084013
0.05818908363
0.05840716186
0.04638850151
0.05819720366
0.05681828606
0.1187411115
0.1201555121
0.1482946419
0.1434013379
0.115957907
0.1173473772
0.1476155209
0.1492858334
0.1780097928
0.172568124
0.1442933262
0.1459491497
0.02979252388
0.03425916954
0.07070504204
0.06034549355
0.04892845866
0.05018664902
0.07441305353
0.07542709388
0.09872043976
0.09315431194
0.07011530964
0.07244471297
0.09178604175
0.0941737381
0.1215106285
0.1166444107
0.08859654693
0.08997689321
0.03433218143
0.05799191461
0.05820793581
0.0653382055
0.06171540839
0.03629758234
0.1090284666
0.08375130492
0.0879049895
0.03009133536
0.02042688962
0.02252485102
0.0113023926
0.01230803555
0.02064074801
0.09074739904
0.0891290208
0.06733102598
0.2265572549
0.173854159
0.1778743882
0.1654631044
0.1695461541
0.2221697961
0.2435552289
0.1894667374
0.1933203778
0.1818093418
0.1856496653
0.2393011066
0.07064055203
0.0937939805
0.09235292484
0.02401259611
0.01541321909
0.0171428733
0.05207589096
0.0528057734
0.07374858578
0.07044922178
0.05062474115
0.0516830166
0.05283582913
0.04896825624
0.02863438061
0.08552612859
0.06636821504
0.0702584174
0.05856042856
0.06227032823
0.08113458059
0.1757298787
0.1120086939
0.1181310867
0.09982171611
0.1089608
0.1684234144
0.01989081201
0.01477825361
0.01500659392
0.01327269863
0.01312590868
0.01453648675
0.01319123685
0.01358884873
0.01336444523
0.03933080846
0.04276526819
0.05686424596
0.01329785361
0.01550326298
0.01453353666
0.03465418409
0.03443407404
0.01426458729
0.01671339491
0.01127951431
0.01178661256
0.5357696455
0.5047031676
0.5351593532
0.3698580326
0.4680610609
0.4969407787
0.4355511593
0.4601181555
0.3777780509
0.1377440089
0.1609907041
0.2792924066
0.00842054245
0.04065543745
0.03309311325
0.1056685032
0.1226813084
0.006774491847
0.2231394938
0.2168998733
0.1298537621
0.3425946721
0.2838534679
0.2897424508
0.2338008972
0.2770126839
0.3125068767
0.1023374131
0.082454167
0.08627147017
0.07440154064
0.07829545377
0.0977916556
0.04438154578
0.06031322951
0.05649676109
0.1800169732
0.1600977167
0.1704178215
0.1453829602
0.1520946907
0.169741809
0.08967312842
0.1316624668
0.1259332379
0.01064594317
0.008180777025
0.005578020704
0.01329095071
0.009087203024
0.01260955326
0.007010858653
0.008351020553
0.01317775147
0.008583640325
0.007346805462
0.007073940307
0.0105643171
0.00755806653
0.01041492422
0.005452373281
0.006544940625
0.009350753761
0.0197728923
0.0186047651
0.029892737
0.04072831364
0.02880403824
0.02830688121
0.03613064422
0.03742158783
0.04873560726
0.01496883535
0.02556524008
0.02424763635
0.02916383157
0.02736485659
0.01708627666
0.03719439946
0.02572285357
0.0263545042
0.2159421153
0.2124322446
0.142382049
0.3252616338
0.2690284293
0.2729389295
0.2613266281
0.2651624297
0.3213446107
0.3407151916
0.2846210238
0.2886368203
0.2769011088
0.2808797586
0.3369131007
0.1689592634
0.2243494745
0.2197342208
0.2772756395
0.2221557699
0.2262494617
0.2140922597
0.2183880978
0.2732504673
0.09946283103
0.1648027055
0.1606813468
0.05347042607
0.05102570846
0.03195812826
0.09729023058
0.07320020926
0.07546033651
0.06996572635
0.07124128245
0.09535245384
0.01356478881
0.02745807713
0.02055809228
0.03012790963
0.02690976452
0.01690015474
0.08711954078
0.05454298068
0.05742365575
0.03587229546
0.0333297777
0.04644417588
0.03906746818
0.03649448749
0.03503974575
0.04057119825
0.03807203296
0.03975724054
0.03476166252
0.03636241144
0.03919324912
0.04697609144
0.0452175639
0.0469995816
0.04142127228
0.04333329164
0.04533603331
0.04341905777
0.04237945135
0.04067170389
0.02472647592
0.0247951165
0.03524648381
0.02913596719
0.01819402472
0.01914155756
0.2468408557
0.242945463
0.1858263463
0.3557835255
0.3000403649
0.3038905478
0.2923546321
0.2962818672
0.3520685161
0.06143164661
0.08437180738
0.0832729434
0.08633673392
0.08528384888
0.06196635425
0.1370441638
0.1105338655
0.1119004101
0.02077556538
0.03169863913
0.03062452675
0.03365667726
0.03271115765
0.02134993039
0.05501610028
0.04382112794
0.04487032882
0.1010804154
0.09874862132
0.07787806669
0.09825407365
0.09730280948
0.09983517767
0.09217861495
0.09473811589
0.09548598801
0.08241385985
0.08081588191
0.0522069934
0.07962613904
0.07937837868
0.08115926261
0.07588891995
0.07763035636
0.07764533848
0.08813083683
0.08730090442
0.08969386574
0.08305579202
0.08517034317
0.08567789994
0.05935313189
0.08600616062
0.08413954588
0.1872754503
0.1833066439
0.1136182328
0.2935826306
0.2380602709
0.2420556511
0.23010097
0.2341178563
0.2895574741
0.3095429264
0.2536668169
0.2574949562
0.2459624511
0.2498202589
0.3055855
0.1268832524
0.1947058707
0.1910456974
0.07856800852
0.07943955887
0.1041149241
0.05818845955
0.05764862484
0.03785295538
0.08351513251
0.05849574041
0.0601285471
0.1018734623
0.1037634925
0.129254055
0.0588115371
0.08010237587
0.07805269847
0.08242898865
0.08113006285
0.05913849315
0.03858631766
0.05935633241
0.05879470047
0.06052336104
0.05994842376
0.03884936891
0.1109780264
0.08437714103
0.08536438592
0.09218240643
0.09643631415
0.1204010749
0.04815797228
0.07309051256
0.06932021193
0.08133908804
0.0771363343
0.05684462024
0.01572129435
0.01163120903
0.0122071768
0.03318100096
0.03334207018
0.05243620946
0.0544345469
0.05502161359
0.07774254732
0.06202427157
0.04146528346
0.04653792789
0.01009139456
0.006992283379
0.002812168016
0.1229023553
0.064858723
0.07119235049
0.05701344701
0.06271691023
0.1170432154
0.09070212121
0.06764157677
0.06852311129
0.0654477168
0.06620529371
0.08877005205
0.02152892076
0.04002052385
0.03817109433
0.04441572359
0.04290498546
0.02763239138
0.07159617527
0.05741150501
0.05950246775
0.01601631856
0.01366835383
0.01472252617
0.01368491038
0.0129316751
0.01566960267
0.006236579557
0.008029542377
0.01006911859
0.009961710488
0.01262956753
0.0252348084
0.01623685374
0.01804237258
0.01304146392
0.01452024189
0.02300089917
0.01298301075
0.0114588589
0.01348676268
0.008500546258
0.009455944516
0.007174362485
0.01785903313
0.01648806541
0.01488058265
0.01101088553
0.01750645316
0.01575718391
0.02157591144
0.01941559245
0.01175803335
0.03843276312
0.02869817444
0.0307611667
0.01185461274
0.01438622961
0.01323693599
0.0175474156
0.01584641388
0.01228944418
0.03258612937
0.02408547884
0.02634512286
0.01648135828
0.01301429255
0.01365080131
0.01228491987
0.01239824576
0.0150959469
0.02371830265
0.01663161678
0.01776492576
0.01457796601
0.01546817429
0.02142225803
0.0201195169
0.02004363935
0.02197198679
0.01706296348
0.01863845392
0.01902128571
0.02275629646
0.02246273981
0.02418669745
0.01655628001
0.01502894701
0.01616343516
0.0141860313
0.01444513797
0.01587410552
0.01360167613
0.01336136315
0.01272723409
0.03456161417
0.02460808638
0.02213837906
0.02798877466
0.02753315981
0.03852266622
0.02349143096
0.0230006285
0.01307941743
0.04559040004
0.0344164365
0.03517010542
0.02764381535
0.02932412485
0.04030288943
0.02915243453
0.02758838877
0.01822226344
0.04854872499
0.0382497269
0.03997545235
0.03428090888
0.03625318787
0.04682027778
0.03487250316
0.02407918808
0.02589168433
0.02070812809
0.02217035539
0.03283030554
0.04197632099
0.03053840612
0.03226410927
0.02757241418
0.02896066528
0.04001874338
0.01138310573
0.01917104233
0.01815692544
0.01740366204
0.01550431764
0.01117098535
0.03375527046
0.0246439011
0.0267997195
0.02033788329
0.02250079102
0.03133146997
0.1055760133
0.08310999076
0.0850161212
0.07822907908
0.08073735431
0.1035119495
0.04245011788
0.06001678669
0.05694963044
0.06887832758
0.06765399129
0.04775338392
0.1131687529
0.08979797064
0.09137747658
0.08667391119
0.08829290896
0.1114522987
0.08129388348
0.08901316702
0.06723496093
0.08166294673
0.08316476475
0.07661513833
0.09817479431
0.0902715141
0.08727667935
0.06353410283
0.0603068418
0.05577768316
0.07069710987
0.0653129075
0.06830043269
0.0705761701
0.06765774642
0.07424224198
0.1354422965
0.1047676189
0.1098876595
0.09508834424
0.09916716179
0.1316155593
0.1100589958
0.1179814925
0.1079096813
0.1130124595
0.1160594769
0.1210261047
0.03961997428
0.04308842113
0.04232310711
0.04534154269
0.0436282476
0.04072813196
0.05183752243
0.04859805789
0.04992722179
0.0428704496
0.04022309694
0.03814900464
0.03423492969
0.03578268893
0.03530965398
0.02599233518
0.03499799838
0.03437367244
0.03239278248
0.03380086741
0.02299111525
0.09327617278
0.06870664096
0.07110525466
0.05542648352
0.06140389193
0.08890448284
0.1013091761
0.07598480645
0.07663273014
0.07403682245
0.07452823879
0.09975417687
0.07499914001
0.04938937275
0.04975682209
0.04863936595
0.04903862991
0.0742705537
0.0787499483
0.05107037024
0.05238184899
0.05010005596
0.05049867403
0.07748512175
0.1170073192
0.08682250778
0.08779164881
0.0849270358
0.08588278832
0.1155622937
0.1234401861
0.09102415951
0.0926047257
0.08878815546
0.08983002526
0.1216589633
0.1062033054
0.07941224803
0.08028380968
0.07765210397
0.07847901316
0.1049133607
0.1113788618
0.0830208377
0.08396741978
0.08117803172
0.08208091913
0.1100366564
0.03457771
0.02463096056
0.02466278928
0.02110142639
0.02291932077
0.03258064357
0.07219607548
0.04799073859
0.04830688107
0.0473107914
0.04763761935
0.07152306905
0.02144627999
0.0121359992
0.01327618341
0.01129723031
0.01174527583
0.02040710302
0.02829687482
0.01864511673
0.01962030144
0.01544416225
0.0173404945
0.02663285127
0.1001706743
0.07668722092
0.07750123761
0.06285626331
0.06666277119
0.09052808174
0.04373153698
0.06808433212
0.0652390036
0.07567815554
0.07205193801
0.04866703883
0.1230010365
0.09696564532
0.09964331568
0.08638422916
0.08743564008
0.1151897044
0.03949741233
0.06175455032
0.06112534839
0.06354358804
0.06251122318
0.03976849369
0.01725858976
0.01863186855
0.02816293622
0.02269633499
0.01387259933
0.01574846071
0.01310801409
0.0140517863
0.02167333096
0.05071267104
0.03289112151
0.03296160394
0.07465719039
0.05328277601
0.05391235437
0.04821818789
0.05027338688
0.06939796725
0.0841973033
0.06241796025
0.06334708671
0.05428142198
0.05545063453
0.07623322782
0.01356854274
0.01357137323
0.01309604794
0.01509524892
0.01326269453
0.01349671622
0.01295539792
0.01331852561
0.01319797326
0.07781555316
0.08177066343
0.0638907142
0.1178685181
0.09964516977
0.09134195258
0.1229735751
0.109618332
0.1287304991
0.2036182159
0.1907919216
0.1718424348
0.2191517964
0.2031644769
0.2170620506
0.1809156656
0.1911340715
0.2057448617
0.02835944035
0.03034636737
0.03777001829
0.0145653765
0.02133708288
0.01942276662
0.02583211681
0.02382156671
0.01597265902
0.1307199781
0.140940293
0.1377885979
0.1455180987
0.1431805518
0.1370806715
0.005367413643
0.003855831043
0.003594782394
0.00637697988
0.005467148221
0.006059725543
0.004356589536
0.0042059019
0.006110626073
0.004074586174
0.003741866602
0.003153706318
0.00484517399
0.003746705961
0.004857752395
0.003526218239
0.003584190344
0.004387226693
0.02967146585
0.036399719
0.04075054331
0.03200254295
0.03226177234
0.02729122599
0.02504795565
0.02573456453
0.02588730888
0.02405016319
0.02537392074
0.02463812761
0.0273362003
0.02603708427
0.02558025187
0.2773300949
0.2735669407
0.2159436266
0.3704303306
0.3297963378
0.3334168974
0.3226393076
0.3262756604
0.381078494
0.3469693784
0.3442879453
0.3472876626
0.3370145435
0.3406695069
0.3521959196
0.2270908723
0.2847056053
0.281038682
0.04099207063
0.03320756297
0.03509309017
0.02899077535
0.03115243645
0.03911137607
0.01388722504
0.02215518949
0.01974941656
0.0682538765
0.08987609188
0.08559005059
0.09862312319
0.09432018616
0.07233309972
0.1205095464
0.09602409003
0.09770742089
0.09288471301
0.09446935568
0.1187211254
0.04964344255
0.07108190316
0.06990016629
0.02898635104
0.02983715773
0.02856956344
0.0327768854
0.03112761539
0.03062465745
0.03170970011
0.0312843534
0.03271854156
0.3701483296
0.3151952578
0.3189458232
0.3076566403
0.3114499022
0.3666767864
0.1967572807
0.2544036372
0.2505673868
0.1245629228
0.1261350454
0.1550610183
0.06915524392
0.09717809696
0.09588075737
0.1007221333
0.09872441102
0.07029349711
0.07954878483
0.1064063127
0.103354533
0.1116904067
0.1092830883
0.08352943754
0.165043481
0.1367758353
0.1389218021
0.08214027363
0.0793101023
0.05615287008
0.1285964234
0.1037700483
0.106189235
0.09949725888
0.101507967
0.1264492141
0.03481895397
0.03319147425
0.024255002
0.04804205511
0.04127385144
0.0412848801
0.03721055427
0.0385871142
0.04676326523
0.02445418225
0.03333346488
0.03179360195
0.03709024458
0.03561875636
0.02623501255
0.05268052993
0.04499239577
0.04468682704
0.03506162897
0.03190892681
0.0332583535
0.02571236873
0.02811842426
0.02703986562
0.03282158983
0.034723881
0.04391387175
0.01652002768
0.02568589044
0.02379706341
0.02961079826
0.02778655519
0.01848583659
0.01955875788
0.01780985015
0.02105576909
0.01273743937
0.01521070428
0.01676759244
0.01348641206
0.01422093293
0.01138917455
0.05498838616
0.045789149
0.04701081541
0.0419803568
0.04360041251
0.05349031236
0.02310867259
0.03291786563
0.0311301373
0.0335762942
0.03210295828
0.03023288197
0.03689735272
0.03483743463
0.03639397272
0.03143766424
0.03369957246
0.03645463524
0.06631724187
0.09250098759
0.09143784628
0.09470260482
0.09358274797
0.06694635413
0.1499530928
0.1215927066
0.1230502012
0.1132220911
0.1145999291
0.1418249661
0.06386964151
0.08835117536
0.0873093914
0.09040060168
0.08935915371
0.0644743842
0.0939458093
0.1210290075
0.119638465
0.1239050385
0.1224785617
0.09505693026
0.1797706359
0.1509693922
0.152668589
0.1408492246
0.1425962456
0.1708140716
0.08943876535
0.1152580193
0.1137085526
0.1181806327
0.1168091804
0.09084242728
0.04612381441
0.04735941745
0.0589832342
0.02421207836
0.03635426622
0.03492071525
0.03976233759
0.03821514288
0.02618308398
0.1371326997
0.1128608097
0.1147940417
0.1085536121
0.110818301
0.1351708847
0.06535759502
0.08716203061
0.08479924653
0.09677199598
0.09533053754
0.0718053775
0.1447200077
0.1205021303
0.1224830978
0.1166836043
0.1185697707
0.1429473624
0.01380602395
0.01408309655
0.01846493232
0.01376770081
0.01349910458
0.01338805255
0.0138529101
0.01343088182
0.01408002948
0.0174919599
0.01647540171
0.01351908126
0.03138530788
0.02304333837
0.02494676739
0.01937775956
0.02112527623
0.02921408135
0.009178068149
0.008077145872
0.00955573393
0.005850528668
0.006800424881
0.00758578464
0.006091710222
0.006273828951
0.005114738664
0.03273100644
0.01584467789
0.02267544473
0.0148081475
0.0155519372
0.03107028393
0.002035925432
0.006878611208
0.00666053712
0.01017235739
0.008105017735
0.003157258729
0.01224220211
0.009372698872
0.01024057973
0.01072732095
0.01010724241
0.01219643246
1.155592932
1.15562297
1.156037833
1.155670385
1.155732656
1.156078649
1.155827772
1.155954463
1.156142347
1.156123881
1.156340992
1.156266117
1.156606292
1.156938464
1.156437664
1.157312902
1.121407292
1.156663381
1.051534008
1.008070548
1.043744568
0.9906415486
0.9951852796
1.027605
1.021509181
1.073153206
1.112737043
1.150160088
1.157245755
1.156501741
1.156868654
1.156569378
1.156339797
1.156326788
1.156129375
1.156199222
1.155967008
1.15585784
1.15610627
1.155756405
1.155688147
1.156060922
1.154684223
1.154713281
1.155137696
1.15477119
1.154862472
1.155226711
1.154982132
1.155241448
1.155536137
1.155504216
1.15562756
1.155705178
1.156080315
1.156293673
1.156220537
1.157011742
1.157322164
1.157031542
1.135678504
1.055329776
1.112901572
0.9719647804
0.9308713461
0.9778305828
0.9046997643
0.8989798875
0.9425732007
0.9149103136
0.9447249476
0.9860159116
1.011468124
1.077495433
1.12677072
1.157827822
1.157472187
1.15717217
1.15669534
1.156451316
1.156360357
1.156003038
1.155489947
1.155600329
1.155228004
1.155042169
1.155344191
1.15491118
1.154843818
1.155217739
1.153857853
1.153933856
1.154308764
1.154072443
1.154281593
1.154542812
1.154597405
1.155251215
1.155196083
1.155396875
1.155658845
1.155588677
1.15672417
1.157166432
1.156842886
1.047213048
0.9829144625
1.060577969
0.8402703108
0.8035257206
0.8699935686
0.7267195924
0.7087759494
0.7690116491
0.6827124272
0.680379301
0.7405421874
0.7011929148
0.7160469706
0.7758074408
0.7838862134
0.8159657023
0.8806713341
0.9369871006
0.9911240019
1.065274447
1.157962051
1.157472076
1.157092983
1.156742115
1.155621614
1.155483226
1.155044929
1.15464326
1.154802609
1.154359498
1.154196606
1.154470066
1.153123112
1.153281777
1.153582559
1.153560961
1.153988064
1.154095774
1.154618527
1.155954496
1.155350969
1.155990255
1.156533718
1.156210551
1.029307718
0.9495241066
1.023137796
0.7576999387
0.7073921494
0.7688558341
0.5890707259
0.5586745155
0.6150807978
0.4907908165
0.4752554786
0.5307347604
0.451777925
0.4520380039
0.5066332737
0.470713742
0.4840791154
0.5392007733
0.5451657692
0.5724424986
0.6292729268
0.6771837609
0.7216806544
0.7828828362
0.8857651819
0.9546140463
1.023918702
1.042625477
1.156516561
1.155949487
1.155436915
1.154643849
1.154589674
1.154091913
1.153746063
1.1538968
1.15251588
1.152816726
1.153017327
1.15332825
1.154099932
1.153990723
1.15525628
1.116619348
1.156277588
1.13733292
1.041311625
1.09847049
0.7862626947
0.7175830094
0.7671930908
0.5540194755
0.5093223161
0.5519994339
0.3995064933
0.3698630933
0.4114874389
0.3007361102
0.284579906
0.327380696
0.2600299579
0.2598099391
0.3027071291
0.2820381204
0.2961279414
0.3377797668
0.3561745785
0.3821689488
0.4245500585
0.4800217862
0.518483693
0.563797635
0.6615504406
0.7182087919
0.7692155356
0.8234789906
1.068128415
1.157363974
1.156591696
1.155180904
1.154850814
1.15419902
1.153509817
1.153592079
1.152050042
1.152589502
1.152675198
1.153452831
1.15473431
1.15435634
1.156541375
0.9560741874
1.08207681
0.9393419463
0.8492313708
0.8885591138
0.6311757673
0.5720174532
0.6029975391
0.4241785764
0.3805297069
0.4073679093
0.2709401284
0.2403720644
0.267341411
0.1645734755
0.1463084474
0.1763480505
0.1227281658
0.1231262847
0.1519124131
0.1504971689
0.1658505752
0.1934203766
0.2266188958
0.2506672304
0.2787314832
0.3405661615
0.375611312
0.4061387769
0.5071218332
0.55839445
0.5932075409
0.6684060601
0.8907960626
0.9704792454
1.082694164
1.156329339
1.155717403
1.154756562
1.153592026
1.153476046
1.151749523
1.152643444
1.152593291
1.153973101
1.1558897
1.15525831
1.108130122
0.8559449743
0.9309488449
0.8148991416
0.7363871232
0.7581281944
0.5441335858
0.4902248863
0.5053872803
0.3512443229
0.3105784099
0.3226950503
0.2007865007
0.1675538415
0.1799271071
0.04500522189
0.04546612787
0.05584540323
0.1497439852
0.1728179787
0.1878928912
0.2556953189
0.2885515751
0.3061895968
0.4067892838
0.4537372644
0.4752902332
0.5770926156
0.7701851847
0.8259942114
0.9392005856
1.135313276
1.157185786
1.155769447
1.154026743
1.153719265
1.151712078
1.153013211
1.152811486
1.15488329
1.157424547
1.156595571
1.023067565
0.7998105278
0.8396701144
0.7502223034
0.6813025086
0.6905612414
0.5110040696
0.4630721904
0.4655311356
0.3377152878
0.3011452864
0.297684744
0.05059500125
0.05812669318
0.05845623888
0.1211622461
0.1410721726
0.1452397082
0.214463406
0.2440888029
0.2516291802
0.3515103912
0.394530253
0.405802287
0.5252536397
0.6913816888
0.7247441358
0.8501355913
1.037307455
1.082621396
1.157081979
1.154778313
1.154325422
1.151966146
1.153707602
1.153357151
1.156142692
1.149407196
1.158292891
0.9764067023
0.78442312
0.7902049788
0.7244416176
0.6655329868
0.6626712944
0.5186593334
0.4773968455
0.4716877749
0.3713385212
0.3415761027
0.3290052575
0.06552589993
0.07044223671
0.06775208882
0.1245721897
0.1416812576
0.1395304174
0.2066340474
0.2333462147
0.2334266386
0.3310096952
0.370708099
0.3735916323
0.5112984775
0.6548744955
0.668425542
0.7984705788
0.9698449611
0.9993734143
1.157021216
1.155815875
1.155234703
1.15250338
1.154705231
1.15423015
1.157643158
1.108312618
1.126304434
0.9560471078
0.7849277703
0.7847294869
0.7259612427
0.6745754286
0.670841358
0.5466979969
0.5113727028
0.501932164
0.4232026482
0.3994941848
0.3848569914
0.09119162103
0.09487955048
0.09142590376
0.145007641
0.1608235386
0.1547576485
0.2209978265
0.2460320497
0.240580106
0.338217418
0.3754307268
0.3736542118
0.5113552069
0.6477738237
0.6487014104
0.7792085401
0.932855537
0.9481280852
1.099443754
1.157060561
1.156410201
1.15331894
1.155952041
1.155392597
1.159322152
1.087070256
1.095274118
0.9542132739
0.7998112205
0.7932454829
0.7424512326
0.6970189376
0.6905229956
0.5826090491
0.550952709
0.5409848974
0.4723545154
0.4516465015
0.439897469
0.1231032782
0.1273759744
0.123234723
0.176825219
0.1927098964
0.1836731051
0.2516953389
0.2763648712
0.2669670419
0.3658118932
0.4015465104
0.3923475987
0.53945846
0.6665534645
0.6541762099
0.7875704156
0.9240147193
0.9257587496
1.06931973
1.158440551
1.157746401
1.154357119
1.157328905
1.156775689
1.161138406
1.084456622
1.083457672
0.9645414769
0.8319803244
0.8164569029
0.7705803001
0.7301495789
0.719988167
0.6219113277
0.5913634355
0.5808663537
0.5127374528
0.4906364125
0.4815821538
0.1549854006
0.1627165246
0.1574771657
0.2215750115
0.2387965921
0.2255367615
0.301273296
0.3262677596
0.3119505659
0.4149564166
0.4496470142
0.4357975813
0.5932828786
0.705627497
0.6839425645
0.8204765879
0.938371472
0.930146594
1.066657506
1.159879923
1.159162949
1.155636734
1.159089239
1.158336298
1.163152866
1.094352009
1.088572748
1.000382714
0.8821937999
0.8619329051
0.8120206729
0.774028036
0.7628454222
0.6703383382
0.6400177937
0.6265862424
0.5559941323
0.5299112951
0.5190408617
0.3884552788
0.3699614611
0.3745104236
0.05882620431
0.07559315611
0.07193144786
0.2179784775
0.2373300841
0.2187218418
0.2907096687
0.3104493725
0.289457857
0.3776876052
0.4033516929
0.380489529
0.4888285595
0.5219992954
0.5012716473
0.6705586557
0.7747009507
0.7345030029
0.8704313217
0.9781355534
0.9566114983
1.085647383
1.161263837
1.160595789
1.156887213
1.160670754
1.15995327
1.164958948
1.140587058
1.114616428
1.062758073
0.9451821756
0.9116665694
0.8698762858
0.8363536299
0.8206869402
0.7371377759
0.7070691371
0.6903288467
0.6213174591
0.593577765
0.5760416998
0.1157202437
0.1522965437
0.147227407
0.337371619
0.3560794624
0.3156290617
0.4150417717
0.4334299632
0.3955960456
0.4921816236
0.5157944683
0.4832230922
0.5934214146
0.6239683044
0.5953078245
0.775106703
0.8696790525
0.8203927464
0.9488549534
1.047137785
1.010113085
1.13486735
1.162570204
1.161970505
1.158128544
1.162194047
1.161506789
1.166616929
1.170311846
1.169385642
1.152498509
1.051080721
0.9892486224
0.968537554
0.9355996548
0.9066921209
0.8438426776
0.816656686
0.784365032
0.740661955
0.7166748868
0.6799394804
0.6419504328
0.6233313897
0.5765404298
0.09153869999
0.01569503801
0.01514987531
0.1618217362
0.2324733547
0.2284418879
0.4310681517
0.5046474793
0.4953649955
0.6301611936
0.6337105925
0.5750528039
0.6634840528
0.6786618291
0.6326238509
0.7382667018
0.7622232747
0.7246585568
0.9157639048
0.9895998043
0.9258064284
1.064061327
1.147475607
1.094044347
1.16739756
1.163764206
1.163214583
1.159284145
1.163582426
1.162921006
1.168152252
1.171882107
1.171152657
1.173585359
1.17011595
1.109377235
1.107790566
1.077199088
1.036566757
1.00320151
0.9820822866
0.9342861226
0.9278909584
0.9152570963
0.8548584856
0.7992155273
0.6322272383
0.6719048473
0.0420349795
0.01917321536
0.01754873411
0.1971627201
0.2668031947
0.2548903061
0.478763434
0.5548125365
0.5400911541
0.7766395593
0.8417912307
0.8304210822
0.8992303149
0.899649847
0.8391522253
0.9284565881
0.9449632336
0.8940649738
1.090926906
1.150747693
1.063228195
1.170548163
1.170853035
1.170143866
1.168623665
1.16476926
1.1643114
1.160287914
1.164732442
1.16416952
1.169384461
1.173240229
1.172602124
1.174933458
1.171343028
1.170464605
1.166909243
1.161123324
1.161083622
1.129647501
1.112479595
1.116049294
1.017422363
0.9560356332
0.9799889853
0.5137778266
0.2956905983
0.3742435625
0.02946470959
0.04029948145
0.03080596036
0.2680565741
0.3318853709
0.3136972316
0.5503105935
0.6238143128
0.6057440629
0.8291703463
0.8862687752
0.8757778953
1.018049398
1.049231677
1.045801406
1.113319733
1.127598448
1.119300729
1.157108804
1.168671985
1.167798276
1.171975047
1.171904318
1.171434051
1.169423957
1.165517893
1.165200618
1.161103808
1.165640565
1.165197085
1.170344073
1.17422472
1.173771057
1.175998817
1.17207181
1.171578305
1.167640414
1.161427941
1.161409026
1.122693392
1.098163912
1.101299793
0.9314136406
0.8070903082
0.8498030155
0.2172339183
0.09294271663
0.1248359885
0.04954550381
0.121988039
0.09518879953
0.3407813682
0.406207201
0.3885899089
0.6212305048
0.6884645635
0.6744143487
0.8686601801
0.917315453
0.9116002299
1.029138844
1.056836735
1.055497606
1.117219467
1.130955213
1.130243921
1.158842412
1.169866258
1.16935428
1.172827159
1.172507786
1.172254401
1.169895482
1.165997075
1.165809625
1.161715953
1.166312038
1.16598918
1.171028219
1.174900116
1.174598939
1.176610422
1.172340486
1.172174822
1.167881805
1.161244909
1.161344259
1.118252613
1.08914419
1.091575425
0.8590287927
0.6816362745
0.7015269945
0.128402146
0.05519592286
0.05707516393
0.09459488813
0.1923110705
0.1813632293
0.3874788555
0.4529691329
0.4460988693
0.6552566457
0.7176287109
0.7149764673
0.8818780936
0.9269779164
0.9252125715
1.034224362
1.06116132
1.06021857
1.119793815
1.133122616
1.132671498
1.159799859
1.170458349
1.170227927
1.173208017
1.172731186
1.172659091
1.170074319
1.166233577
1.166166134
1.162133075
1.16676002
1.166548484
1.171461824
1.17530251
1.17513209
1.176914641
1.172271919
1.172350805
1.167694176
1.160566695
1.160775914
1.112236471
1.077835391
1.080894458
0.7996392125
0.6104658841
0.6267536983
0.1162860204
0.05331301182
0.05358871324
0.1115562528
0.2039585633
0.2015085986
0.3983792009
0.4622941278
0.460191906
0.6620162056
0.7249651208
0.7234717085
0.8883226188
0.9327827397
0.9315152738
1.037851745
1.06417655
1.063526148
1.121423259
1.13443727
1.134174815
1.160191294
1.170593254
1.170574886
1.173216248
1.172651929
1.172721931
1.170010703
1.16626432
1.166295173
1.16237793
1.167015814
1.16689776
1.171687177
1.175480303
1.175416164
1.176981967
1.171948512
1.172212612
1.167178953
1.159483447
1.159790271
1.104667387
1.063977842
1.067700202
0.7407617535
0.5571375857
0.5687192413
0.108608189
0.05289900147
0.05290960688
0.1255200376
0.2125761727
0.2105848376
0.4065157548
0.469658877
0.4679689989
0.6665497029
0.7292666517
0.7284014876
0.8923989906
0.9366223559
0.9358474711
1.040312691
1.066176129
1.06576226
1.122352471
1.135121423
1.135000573
1.160172096
1.170389294
1.17052741
1.172938826
1.172344839
1.172520479
1.16975916
1.166127048
1.166237923
1.162487292
1.167118249
1.167073431
1.17174924
1.175480825
1.175499626
1.176871357
1.171421097
1.171835631
1.166388826
1.158019822
1.158422021
1.095320659
1.046885715
1.051537821
0.6920337798
0.520305514
0.5282904874
0.1040340652
0.05329800522
0.05313801669
0.1369628039
0.219598495
0.2179758979
0.4127855284
0.4754753515
0.4741572035
0.6696151382
0.7317111133
0.7312315441
0.8943065242
0.9385484017
0.9382331572
1.041700229
1.067283811
1.067087888
1.122725649
1.135314709
1.135307376
1.159844037
1.169933688
1.170188715
1.172448594
1.171872236
1.172124369
1.169368127
1.165864499
1.166032505
1.162493697
1.167105741
1.167115106
1.171688449
1.175347198
1.175428274
1.176622914
1.170691971
1.171260507
1.165325875
1.156125437
1.156646926
1.08337319
1.025459082
1.031213051
0.6556468632
0.4943170321
0.5000433993
0.1017466303
0.05424979804
0.05396668079
0.1461483011
0.2251916854
0.2239328523
0.4175337807
0.479920377
0.4789271089
0.6715563285
0.7329363973
0.7327237836
0.8945951596
0.9388837311
0.9389236735
1.042059338
1.067545252
1.067556035
1.122613344
1.135093223
1.135184883
1.159265941
1.169285602
1.169630804
1.171801592
1.17127889
1.171587107
1.168875417
1.165504159
1.165718012
1.1624277
1.167009573
1.167058626
1.171537067
1.175112256
1.175240679
1.176256127
1.169709675
1.170475261
1.163912371
1.153620289
1.154317304
1.068118514
1.000827585
1.007120851
0.6284815992
0.4754354698
0.4796164062
0.1011474179
0.0556223464
0.05524186663
0.1535180042
0.2294563757
0.2284941528
0.4210407016
0.4831892253
0.4824730973
0.6725890299
0.7332649337
0.7332547352
0.8938016555
0.9380806337
0.9383660367
1.041514252
1.067038121
1.067230427
1.122057929
1.134500976
1.134681566
1.15847585
1.168486619
1.168902822
1.171037737
1.170596563
1.170946199
1.168308128
1.165074939
1.165318532
1.16230583
1.166852415
1.166930806
1.171317849
1.174796907
1.174963589
1.175774386
1.168386773
1.169417268
1.161996114
1.150215304
1.151164577
1.050363615
0.9760121631
0.9820840928
0.6078391923
0.461687674
0.4647237472
0.1019151084
0.05733992991
0.05687760447
0.159430313
0.2327269119
0.2319899167
0.4235866847
0.4854562985
0.4849729455
0.672881441
0.7328938982
0.7330441179
0.892275681
0.9364977389
0.936952187
1.040247562
1.065890306
1.066229625
1.121110182
1.133581076
1.13383913
1.157506261
1.167568619
1.168040744
1.170186431
1.169848952
1.170228877
1.16768699
1.164589384
1.164859463
1.162143283
1.16664813
1.16674986
1.171045612
1.174412909
1.17461282
1.175171256
1.166627264
1.167994227
1.159409953
1.145689814
1.146931102
1.031952537
0.9532143248
0.9586657387
0.5920374842
0.4518123953
0.4539811964
0.1037895664
0.05935594555
0.05882040908
0.1641477866
0.23522809
0.2346644205
0.4253219973
0.4869042362
0.4866103138
0.6725640647
0.7319598768
0.7322398773
0.8902229015
0.9343649032
0.9349406337
1.038432691
1.06423797
1.06469155
1.119831659
1.132382819
1.132705711
1.156388392
1.166558045
1.1670734
1.169270566
1.169054226
1.169455923
1.167026399
1.164067176
1.16435134
1.161945102
1.166406844
1.166526812
1.170729894
1.173965822
1.174196798
1.174433633
1.164357631
1.166113
1.156047655
1.140028912
1.14154471
1.014284615
0.9331475144
0.9379041634
0.579947522
0.4449280906
0.4464083623
0.1065925673
0.06165268704
0.06104452841
0.1678800081
0.2371428005
0.2367104997
0.426390497
0.4876885445
0.4875480394
0.671748435
0.7305723685
0.730956432
0.8877739482
0.9318281406
0.9324942437
1.036205544
1.062196637
1.062738133
1.118283135
1.130955324
1.131331216
1.155150603
1.165476802
1.16602503
1.168307956
1.168226156
1.168643108
1.166338192
1.163511744
1.163811975
1.16172043
1.166134743
1.166270118
1.17037702
1.173456194
1.17371838
1.173543366
1.161555976
1.163710399
1.151922072
1.133464645
1.13517762
0.9979811709
0.9157568004
0.9198716086
0.5707389133
0.4403450698
0.4413076127
0.110196426
0.06423145367
0.06354987663
0.1708566503
0.2385993326
0.2382733081
0.4269092316
0.4879717074
0.4879418524
0.6705311595
0.728822888
0.729289869
0.8850203663
0.9289859744
0.9297208225
1.0336659
1.059855536
1.06046488
1.11651669
1.129341298
1.129760251
1.153816519
1.164342155
1.164915138
1.167312189
1.167375141
1.167802476
1.165629621
1.162937506
1.163242993
1.161473004
1.165838503
1.165985009
1.16999066
1.17288051
1.173175783
1.172481429
1.158256734
1.160779542
1.147144424
1.126282994
1.128118328
0.9832192549
0.9006948825
0.9042612027
0.5637361895
0.437523226
0.4380850848
0.1144817325
0.06709520456
0.06633696509
0.1732373812
0.2396767826
0.2394373293
0.4269886518
0.4878424197
0.4879100272
0.6689899903
0.7267854259
0.7273183512
0.8820319935
0.9259106577
0.9266981591
1.030886915
1.057281822
1.05794412
1.114573986
1.12757523
1.128029445
1.152404469
1.163166902
1.163758693
1.166293173
1.166508914
1.166942701
1.164908524
1.162344739
1.16265963
1.161207093
1.165521337
1.165677384
1.169572779
1.172232804
1.172563753
1.171233229
1.154536424
1.157367008
1.141881083
1.118788557
1.120677832
0.9699676314
0.8876266648
0.8907227069
0.5585386941
0.4361046231
0.4363414661
0.1193749755
0.07026028199
0.06941774201
0.1751593506
0.2404546167
0.2402820077
0.4267200476
0.4873654466
0.4875138253
0.6671869305
0.7245177807
0.7251037787
0.8788610772
0.92265477
0.92348348
1.027920835
1.054524209
1.05522878
1.112486516
1.125683298
1.126166941
1.150927917
1.161959627
1.162566153
1.165257899
1.165633231
1.166070502
1.164177873
1.161741872
1.162057383
1.160931973
1.165188514
1.165348848
1.169123259
1.171506365
1.171875278
1.169793288
1.1504917
1.153556439
1.13630373
1.111215567
1.113106021
0.9581374033
0.8762840013
0.8789707337
0.5548240222
0.4358490238
0.4358121536
0.1248090516
0.0737379894
0.07280327498
0.1767419006
0.2410099311
0.2408836813
0.4261718498
0.4865924645
0.4868100533
0.6651680456
0.7220625889
0.7226920436
0.8755456244
0.9192563664
0.9201175813
1.024805709
1.051618651
1.052357276
1.11027834
1.123685514
1.12419398
1.149396501
1.160727189
1.161344566
1.164211341
1.164752272
1.165189778
1.163444383
1.161134487
1.16145169
1.160638279
1.164839765
1.165003877
1.168640954
1.170695134
1.171103304
1.168165598
1.146217132
1.149445968
1.130561616
1.103732291
1.105588115
0.9475972276
0.8664541942
0.8687802479
0.5523663363
0.4365797501
0.4363110215
0.1307267038
0.0775464287
0.07650868599
0.1780800251
0.2414034971
0.24131152
0.4254047247
0.485584025
0.4858551521
0.6629729037
0.7194557478
0.7201195712
0.8721175004
0.9157469448
0.9166330034
1.021571694
1.048593527
1.04935962
1.107968372
1.121597432
1.122127176
1.147817275
1.15947575
1.160099781
1.163157265
1.16386942
1.164303881
1.162707257
1.160514939
1.160832149
1.160353888
1.164478987
1.164638823
1.168122269
1.169793587
1.170242726
1.16635984
1.141793584
1.145127287
1.124767111
1.096441174
1.098242559
0.9381909871
0.8579097823
0.8599359104
0.5509334458
0.4381031834
0.4376526064
0.1370662759
0.08171395781
0.0805624886
0.1792212383
0.2416626972
0.2415953065
0.4244775456
0.4843930405
0.4847030539
0.6606464354
0.7167375753
0.7174250993
0.8686091972
0.9121573502
0.913060586
1.018245149
1.045473114
1.046260921
1.105572434
1.119432032
1.119979955
1.146197219
1.158208198
1.15883588
1.162098069
1.162986278
1.163413232
1.16197468
1.159914273
1.160215173
1.160033368
1.164098228
1.164261508
1.167560328
1.168792894
1.169293785
1.164381086
1.137282984
1.140677017
1.118996443
1.089392085
1.091130509
0.9297517904
0.8504315011
0.8522175604
0.5502702438
0.4401938017
0.4396101256
0.143724138
0.08625983872
0.08496243378
0.1802268036
0.241837238
0.2417776563
0.42345132
0.4830841817
0.4834154822
0.6582330948
0.7139491481
0.7146504559
0.8650514413
0.9085159687
0.9094298209
1.014848841
1.042278188
1.043082916
1.103104243
1.117200751
1.117764194
1.144540715
1.156923514
1.157554807
1.161030794
1.16210039
1.162522367
1.161236723
1.159276648
1.159586766
1.159734861
1.16368374
1.163870551
1.166931444
1.167665893
1.168270037
1.162203163
1.13273084
1.136152984
1.113298095
1.082604892
1.084279905
0.9221222403
0.843816276
0.8453990039
0.5501577111
0.4426596915
0.4419621782
0.1505950502
0.09116412423
0.08968358787
0.1811492582
0.2419705069
0.2419102916
0.4223722578
0.4817078798
0.4820488477
0.6557708856
0.7111208845
0.7118293315
0.8614669071
0.9048441727
0.9057636861
1.011401116
1.039025839
1.039843148
1.100575679
1.114913519
1.115489682
1.142852379
1.155598126
1.156267918
1.159924899
1.161183638
1.161642107
1.160479561
1.158682619
1.158971703
1.159359187
1.16322743
1.163512569
1.166207339
1.166334716
1.167220775
1.15967157
1.127910123
1.131607848
1.107666198
1.076028153
1.077707517
0.9150941795
0.8378374597
0.8393710209
0.5504447078
0.445399317
0.4445468715
0.1576243128
0.09641400788
0.09470598527
0.1820218086
0.2420779812
0.2420275742
0.4212375546
0.4802615197
0.4806559217
0.6532363059
0.7082281292
0.7090015495
0.857842293
0.9011318712
0.902088865
1.007902588
1.035719645
1.036560156
1.097995717
1.112580115
1.113163882
1.141080426
1.154138926
1.155044437
1.158737502
1.160213755
1.160835704
1.159677256
1.157973672
1.158409076
0.3791898002
0.3837899887
0.3954685714
0.1701184875
0.1625268787
0.1671730407
0.269176953
0.2806371129
0.3327077
0.0790781548
0.0631877519
0.06538069024
0.03639173355
0.0368184547
0.04586467464
0.1770823077
0.178575612
0.1874221037
0.06296777841
0.06303233147
0.07752384093
0.05972442011
0.04933542446
0.04619932452
0.06550189487
0.06334081187
0.05714197315
0.2877133418
0.2819388373
0.2962067752
0.1873007534
0.202539194
0.1992710146
0.08817704865
0.08517960031
0.08057423664
0.4040336845
0.393505537
0.4042252974
0.3114522167
0.3250165671
0.3326311862
0.1188201463
0.1147864164
0.1110415892
0.4505352467
0.4403137899
0.4382903906
0.4154234923
0.4231841888
0.4368785054
0.1368246606
0.1634257311
0.1616745241
0.4059264314
0.4108553086
0.405817102
0.4374493292
0.4334610407
0.4403813476
0.08169999243
0.1064577157
0.1046697497
0.1308786516
0.1292145263
0.1036210984
0.1330424613
0.1322684133
0.1291546063
0.3847927221
0.3941129664
0.3974791262
0.4010112754
0.3966746983
0.3855396559
0.3427834953
0.3469142879
0.3656846654
0.0463830918
0.04554272522
0.04691951923
0.2413988897
0.2987631002
0.295280043
0.2987540454
0.3132376393
0.2590885774
0.1613929354
0.1632237969
0.192585983
0.04254711547
0.05799123312
0.05808264588
0.06193659547
0.06143433421
0.04820876798
0.05056760947
0.04890168757
0.04795891449
0.05838562106
0.05882910245
0.04323267805
0.187076221
0.1578427199
0.1596073769
0.1087571392
0.1069280139
0.09017305403
0.049698611
0.06305464559
0.06243837519
0.108011628
0.13426084
0.1325501813
0.159979576
0.1581916186
0.1317489639
0.1029444541
0.1013490311
0.07620333685
0.4180559963
0.4084429375
0.4142511372
0.133073962
0.1304448504
0.1359524018
0.3662688797
0.3343457472
0.3376634397
0.1488086622
0.1587650287
0.1723352221
0.1104845199
0.1129159314
0.09644178912
0.05683999192
0.0632682704
0.0690961962
0.04220227431
0.043290614
0.03767211531
0.2705762524
0.2639678557
0.2808642294
0.1626276448
0.1771665181
0.178805185
0.1537688262
0.1498540305
0.147872696
0.09624288276
0.09349270224
0.0763229165
0.1326743782
0.1352538866
0.1481679499
0.07590210704
0.08335480451
0.07829907225
0.02187515903
0.02501321938
0.02503778006
0.1245224308
0.1247892187
0.123348714
0.1343384918
0.1329675961
0.1327550975
0.1001815199
0.11258396
0.1110172404
0.1217029049
0.1209134219
0.1173537336
0.02361464572
0.02021586241
0.01819223992
0.0245973411
0.02469839575
0.03008520663
0.01802768092
0.01803889974
0.02107219537
0.009703354445
0.01116085681
0.01125236288
0.1178136582
0.1160854631
0.09246497014
0.02100700065
0.02348543432
0.02604784194
0.01576776999
0.01659637571
0.01466013367
0.1802587573
0.184919322
0.2024348012
0.2009647572
0.173737943
0.1766406963
0.05940481502
0.05924744
0.04564414417
0.04657266204
0.05979669724
0.05964540774
0.0563805164
0.05556942557
0.05193861389
0.0490161148
0.05890842225
0.05814726497
0.05190042689
0.0528695444
0.06507741293
0.03036362954
0.04064930041
0.03911176125
0.05153860072
0.04963420054
0.04016115511
0.0420649393
0.03990885917
0.03265519652
0.0241548911
0.02275602509
0.01578589215
0.397526677
0.4000156179
0.3843464069
0.01266201979
0.01162834196
0.005707387073
0.03715648442
0.04673821623
0.04328883962
0.08479614749
0.1020548411
0.09924573917
0.01037714907
0.01040755981
0.01239994848
0.1718947734
0.1710558411
0.1467890645
0.1570366981
0.1721193346
0.1724466849
0.09672123112
0.121071471
0.1193328777
0.01234756582
0.01718758381
0.01618167112
0.03684892288
0.03558636175
0.03567420952
0.04059645649
0.04004821154
0.03916365729
0.068206882
0.06719776768
0.05445973323
0.05739735247
0.0701813783
0.0691130768
0.1459053326
0.1439308338
0.1180848745
0.1236577373
0.1495389116
0.1477109548
0.04554095446
0.05521749187
0.05307790385
0.01916679008
0.02769545862
0.02626634619
0.01589348957
0.01373681068
0.01880222282
0.05994601593
0.06135380067
0.05410878584
0.1321752483
0.1377513061
0.1357949261
0.1532445879
0.1467386511
0.1509063811
0.04733544473
0.0431856022
0.05098395588
0.02523674575
0.02568269869
0.02272435415
0.1298741981
0.1177137246
0.1216585369
0.02994586088
0.03081548365
0.03432753954
0.01144912636
0.01170553039
0.01066931755
1.155563808
1.155578562
1.155427625
1.15594325
1.155739348
1.155768224
1.155805545
1.155752471
1.155917879
1.156593651
1.156414166
1.156152672
1.156999807
1.156676685
1.156927288
1.1563879
1.156498449
1.156763353
1.135035447
1.157710172
1.157307545
1.089769501
1.15806118
1.084843174
1.157272859
1.157621252
1.155173783
0.9352824302
0.9969080771
1.059199535
0.929065492
0.9753774247
0.9062519712
1.091513559
1.040854609
0.98159197
0.8274568362
0.8816946139
0.9139997878
0.8558419206
0.8736562164
0.8156307944
0.9677094004
0.9259385716
0.9030333473
0.7985004433
0.8514714802
0.856386812
0.8627052108
0.8508009497
0.800195639
0.9445047198
0.8987830182
0.9122827329
0.8345405882
0.8920878735
0.8681234352
0.9422610567
0.9038989386
0.851139318
0.9979804317
0.951998512
0.999742182
0.9458685476
1.013292293
0.9611269881
1.104275074
1.037239835
0.9788554577
1.14794741
1.093686317
1.158115661
1.139061769
1.157906448
1.1365095
1.157185645
1.157534871
1.157973882
1.156948569
1.157212668
1.156923155
1.1568157
1.156601464
1.156898162
1.156122542
1.156359459
1.15651124
1.156205918
1.156261028
1.15606312
1.155964364
1.155781717
1.155465809
1.156578997
1.156153822
1.156408752
1.155841733
1.155967103
1.156321981
1.100584682
1.15761074
1.157056584
1.032198872
1.105259169
1.024928508
1.157245982
1.157687651
1.112652595
0.8354346197
0.9070725055
0.9669150475
0.8105631523
0.8561316055
0.7869996624
1.005717453
0.9294537246
0.8804016137
0.6749683133
0.7380241587
0.7722374703
0.6848673805
0.7096781157
0.6475939053
0.8394995045
0.7739692
0.7474269777
0.5886496243
0.6482948805
0.664965172
0.630042794
0.6368888409
0.5772307055
0.7565716617
0.6969248019
0.6885799205
0.5622666279
0.6203029901
0.6235108677
0.631738057
0.6247806453
0.5663975116
0.7436198195
0.6842856635
0.6912855864
0.5966851134
0.6559685957
0.64171277
0.6959195255
0.6736270958
0.6140019958
0.7938031874
0.7340100268
0.7575500928
0.6892107775
0.7517520884
0.7214893781
0.8243585881
0.7851563582
0.7216236432
0.9157345499
0.8504143048
0.8920170861
0.8487731141
0.918444862
0.8677847529
1.036923257
0.9736884697
0.9017354331
1.121381667
1.048134163
1.113631674
1.100986133
1.157914122
1.102869576
1.156900713
1.157385647
1.157814944
1.156724854
1.157009473
1.156614735
1.153943672
1.156909089
1.156282055
1.043151439
1.12952425
1.064540636
1.156735982
1.157156577
1.112791376
0.8215262651
0.8822058072
0.9586956663
0.7533136963
0.8140798084
0.7562689
0.9483530559
0.8780024555
0.8142243755
0.5991552682
0.650892774
0.6991955133
0.5696360991
0.6079034915
0.5573214571
0.7226110258
0.6629513227
0.6235693302
0.456842503
0.5059036283
0.5358124939
0.4572523004
0.4798204751
0.4307988705
0.5883821637
0.5323949649
0.5097305133
0.3734120044
0.4227654317
0.4382664115
0.4027775019
0.4110798262
0.3616011009
0.5190761533
0.4635030699
0.4550739422
0.3490998313
0.3989803287
0.3989979611
0.4083734796
0.401844439
0.3522873603
0.5096043807
0.4545860558
0.4608590129
0.382874059
0.4319319131
0.4183972644
0.4688981869
0.4487567852
0.3997101203
0.556274658
0.5009388016
0.5213742895
0.4693484734
0.5190334258
0.4922983782
0.5837525115
0.5492647492
0.4994263594
0.660807571
0.603213921
0.6380179587
0.6109983801
0.6655837961
0.6232527803
0.7640814317
0.7114483273
0.6570116487
0.8341583396
0.7712561191
0.8244767651
0.825436648
0.8875301198
0.8243425578
1.034822025
0.9566275131
0.8920654056
1.097882488
1.026351567
1.102532228
0.9339637979
0.9853665867
1.082639996
0.814116422
0.8962976018
0.8463131192
1.003193381
0.949139326
0.8628258956
0.6377148979
0.6764846987
0.7426786331
0.5624632542
0.6167688474
0.5815373425
0.7044946159
0.6572839843
0.6032032254
0.4370980917
0.4713893525
0.5143675089
0.3953931145
0.4317416551
0.3970104287
0.5110381893
0.4689372999
0.4324330783
0.29781564
0.3321634403
0.362211578
0.2816960058
0.3053043019
0.2707401653
0.3853382649
0.3434949273
0.3203962941
0.2090250371
0.2452454312
0.2615560993
0.224538876
0.2328764003
0.1963757438
0.3154015476
0.2723567619
0.2642210978
0.1845415976
0.2203673467
0.2204358294
0.2321164671
0.2243260198
0.188810101
0.3060769186
0.2634741876
0.2710165205
0.2233333654
0.2580854475
0.2435746816
0.2954736928
0.2753182568
0.2411838225
0.3549987095
0.313125157
0.3331046616
0.3091968436
0.3434816218
0.3182525945
0.4041499536
0.3719344401
0.3376772079
0.4537400813
0.4104589873
0.4424815751
0.4393520788
0.4769111725
0.439797586
0.5656997176
0.518093658
0.480456258
0.6068257317
0.5606865629
0.6098191514
0.6309487231
0.6727018915
0.6171449029
0.8013164138
0.7338454948
0.6914462027
0.8338057121
0.7814855035
0.8497750098
0.7843721335
0.814173477
0.8997780772
0.6669191673
0.7363929707
0.7087860759
0.8041699969
0.7680546165
0.6961773489
0.5242505247
0.5463256289
0.6037313115
0.4442002156
0.4935152909
0.4724831845
0.5480799144
0.518072138
0.4686565953
0.3386032174
0.3577698822
0.3995724961
0.2822897625
0.3190579895
0.2992098925
0.36732472
0.3413460513
0.3052347961
0.1965879432
0.2165822792
0.2480151414
0.161766638
0.1877260552
0.1673285889
0.2395670404
0.2122434837
0.1867667919
0.09774069011
0.1209697826
0.1377839473
0.1001184247
0.1081151146
0.08368236459
0.1636837406
0.1329890956
0.1248811033
0.07173687394
0.09759946013
0.09524053699
0.1128617001
0.1042670498
0.08243865368
0.1567899016
0.1280524794
0.1379588174
0.1209652818
0.1423514224
0.1258525011
0.1802513661
0.1601689231
0.1397756546
0.2111439187
0.1836993765
0.2038984965
0.2056749031
0.2264088825
0.202554903
0.2825970229
0.253400727
0.2319012204
0.3059565899
0.277872746
0.3077338193
0.3263561668
0.3497690871
0.3147828267
0.4305579446
0.3884104049
0.3640167518
0.4463242959
0.4160115675
0.4596177151
0.4999025134
0.5276715412
0.4770572462
0.6454677124
0.5831908952
0.5541805173
0.652254139
0.6158220687
0.6797065441
0.7029876598
0.7178643734
0.7931399665
0.5878829781
0.6497217378
0.6368385427
0.6856348532
0.6658462334
0.6021462104
0.470813896
0.4788562765
0.5313319833
0.3851921656
0.4305930256
0.4235273923
0.4550885119
0.4409619169
0.3944224854
0.297982668
0.3022113872
0.3423874834
0.2280272577
0.2639785988
0.2603188161
0.2835627159
0.2718722052
0.2359064704
0.1574526935
0.1597845431
0.1933916479
0.09907934934
0.1287560654
0.1264845784
0.1504119289
0.1382194312
0.1075649444
0.05986212238
0.07026578836
0.06473292675
0.02886902622
0.03657225664
0.03599120686
0.04231039745
0.03839897861
0.03158984649
0.05712156765
0.04710486332
0.05101277543
0.1517869151
0.160984384
0.1384459433
0.212396526
0.185680224
0.1756625821
0.2135343745
0.1981858679
0.2257483338
0.2614566511
0.2737467828
0.2416759595
0.3471465818
0.3087831476
0.2956779969
0.3429154183
0.3245087416
0.3637394043
0.4192498881
0.4350997625
0.3892136492
0.5398289516
0.4851715683
0.4682210205
0.5277921037
0.5050988243
0.5614748747
0.6659769333
0.6742508091
0.7414995022
0.5591657744
0.613905139
0.6088563928
0.626626644
0.6193091481
0.562837173
0.4657988096
0.4628573761
0.5090610092
0.3797175513
0.4199006677
0.4251620366
0.4194983103
0.4184616382
0.3767706147
0.3168556343
0.3073957629
0.3423398033
0.2437367571
0.2744433982
0.2856455101
0.2612154237
0.2661147596
0.2330976309
0.05891509586
0.05814511172
0.0507608932
0.07415782957
0.06612215758
0.06590482623
0.138451841
0.1389196764
0.1198617974
0.1837714104
0.1601315949
0.1588776951
0.168213802
0.1631254538
0.1875614926
0.2351189879
0.2386630653
0.2098781855
0.3051010427
0.2703028468
0.2659615885
0.2849882753
0.2766119909
0.3123234298
0.3784910869
0.3853572663
0.3433386482
0.4817770841
0.4316624589
0.4237632144
0.4537036465
0.4415736103
0.4933736097
0.6684836324
0.6673503578
0.7252175728
0.5677414469
0.6151696077
0.6183453674
0.6085172752
0.6120575121
0.5633564921
0.4928357253
0.4843701847
0.5242996305
0.413708423
0.4475489736
0.4577826306
0.4326702917
0.4391280518
0.4037921105
0.3699226057
0.3552264211
0.3829889886
0.3070514028
0.3299446037
0.3464200004
0.2991034124
0.314035932
0.2889519292
0.07540890166
0.07290369477
0.06939054203
0.0854417409
0.07872032283
0.08146240082
0.07400326808
0.07632045083
0.08227742219
0.1494624569
0.1449666689
0.1282482203
0.1845165016
0.1638762852
0.1676065929
0.1591849767
0.1609235361
0.1824752982
0.235323546
0.2335221218
0.2075266336
0.2957135867
0.2630562726
0.2646555173
0.2634481514
0.262469868
0.2948632717
0.3716209024
0.3700744866
0.3310978601
0.4592778023
0.4126272103
0.4147083238
0.4178635668
0.4140900683
0.4611254522
0.6846395724
0.6793276585
0.7299298721
0.5928103146
0.6339497925
0.6406192879
0.6224965103
0.627818232
0.5853777079
0.5310821362
0.521134885
0.5553326079
0.4616473233
0.4899536952
0.500844543
0.4684256446
0.4791167755
0.4497467942
0.4272281351
0.4136669103
0.4362102392
0.3789164208
0.3945010452
0.4089721746
0.3629440487
0.3790608895
0.3619511973
0.3501752748
0.3418455805
0.3522560854
0.3284566498
0.3382073319
0.339909051
0.1023658746
0.09862879133
0.09498024721
0.1098785388
0.104355491
0.1074496356
0.0967512864
0.100184965
0.1058572915
0.1753272907
0.1676511307
0.1518664687
0.2047547397
0.185061013
0.1925958542
0.1725542311
0.1783742344
0.1983098717
0.2584856776
0.2517097416
0.2269567485
0.3093745068
0.2791394303
0.2857160132
0.2682945303
0.2734816101
0.304199834
0.3844637884
0.3785980209
0.3424200823
0.4618701035
0.4184322896
0.4240959921
0.416375992
0.4161378647
0.4595773714
0.7116959945
0.7040933701
0.7497836385
0.6259621507
0.663201226
0.6715823293
0.6476680056
0.6552413391
0.6172575674
0.5705766616
0.5607580114
0.5919176339
0.5063413534
0.5322703932
0.5423407594
0.5115255165
0.5220779336
0.4958722215
0.4722813414
0.462331818
0.4829871319
0.4309380015
0.4447347391
0.4541952618
0.4222131375
0.4341754619
0.4207500775
0.3912171537
0.4428317255
0.4390773553
0.4500274805
0.446318883
0.3948764666
0.1357899725
0.1318395058
0.1270584538
0.2136080265
0.2027426367
0.1865496723
0.240291173
0.2203941072
0.2315716403
0.2010191556
0.2100258199
0.2296633055
0.2989045054
0.2866188798
0.2622182824
0.3431603659
0.3134096117
0.3258122731
0.2939908054
0.3034663887
0.3334985282
0.4223906238
0.4112535408
0.3758398524
0.4906321023
0.4496318132
0.4602328117
0.4316502406
0.4403309408
0.4814434412
0.7493222884
0.7399649829
0.7835214332
0.6654511649
0.7003116358
0.7114618096
0.6806228686
0.6905303316
0.6549330885
0.6137552423
0.60195533
0.6323983308
0.5470182838
0.5735454131
0.5849642199
0.5526478558
0.563081884
0.5369041293
0.5086527088
0.4993784851
0.5222812847
0.458593575
0.4786144214
0.4869619423
0.4626246873
0.470886035
0.4536621295
0.3279397096
0.3809331452
0.3763672943
0.3891198628
0.3850013999
0.3320277781
0.2702374685
0.2534744832
0.2354849744
0.2944525793
0.2731300669
0.2902342781
0.2439441372
0.2578507132
0.2786342326
0.3606750121
0.3426489457
0.3177133819
0.3990245356
0.3694670883
0.387826457
0.3389358839
0.3532640936
0.3828700637
0.4833229444
0.465197445
0.4308489188
0.5405790393
0.5015954333
0.5194379188
0.4733338067
0.4867271927
0.5257010883
0.8030678908
0.7874817295
0.8274352815
0.7162837429
0.7512399987
0.7676564773
0.7259512552
0.7377428998
0.7027004909
0.6700537836
0.6532298799
0.6838341175
0.5958580075
0.6238122002
0.6402745139
0.5972613125
0.6108518564
0.5831387792
0.556500293
0.5421683967
0.56852388
0.4870706072
0.5175221466
0.5296407964
0.4959696858
0.506288881
0.4774758389
0.360787704
0.3652991408
0.3797591506
0.2587093502
0.3129989434
0.308537672
0.3221727839
0.3176639691
0.2633832762
0.08287531194
0.07942973927
0.06251785857
0.1173807295
0.09810937534
0.1015192243
0.09039710148
0.09408904162
0.1137932738
0.2835799762
0.2584832867
0.2390195575
0.2966207466
0.274655307
0.302565142
0.2329544895
0.2517808696
0.2723591615
0.3635323314
0.3357229874
0.3155649752
0.3781473172
0.3565955956
0.3843688112
0.3100827442
0.331307963
0.3535092636
0.4535171248
0.4258721089
0.401002519
0.4818993875
0.4533642417
0.4796153668
0.4069370031
0.4296670677
0.4585450593
0.5682087383
0.5454637385
0.5126345017
0.6121946618
0.5784238746
0.6018159618
0.5366868482
0.5566414965
0.5912228558
0.8820754887
0.8575235512
0.8937185307
0.7907621713
0.8232906877
0.8477377861
0.7860288142
0.8014409842
0.7684548605
0.7570731888
0.7301703391
0.7594775315
0.6725909456
0.7009364547
0.7274357408
0.6607348118
0.6775120472
0.6493272859
0.6471521441
0.6178606712
0.6449185452
0.5617093376
0.5904381626
0.6208839542
0.5476018219
0.5653125328
0.5368772282
0.2163795653
0.211945484
0.1569474253
0.1612205745
0.1565534319
0.1212828899
0.1830776053
0.1862910313
0.2224372315
0.4665260349
0.4059376004
0.3892273992
0.4445934122
0.4265465401
0.4832891177
0.3368567265
0.378024501
0.3983997048
0.5224488763
0.4750157831
0.4587309845
0.5107384189
0.4922795933
0.5370449229
0.416198499
0.4520089495
0.4709611497
0.5905092304
0.5515828278
0.530711025
0.5982030183
0.5738493925
0.61231234
0.5087676721
0.5400056823
0.5655405014
0.6884670442
0.6546535407
0.625131861
0.7140438104
0.6840494076
0.7157345913
0.6267898105
0.6552356274
0.6839927859
1.000179631
0.9655461151
1.00073395
0.9056965033
0.9345142814
0.9694562459
0.8747455307
0.9034134775
0.8726445159
0.8907031053
0.851735209
0.878177012
0.8028787993
0.8265536011
0.8672838441
0.7569118017
0.7900633268
0.7651896916
0.8045152946
0.7582206732
0.7800646115
0.714471542
0.7371526664
0.7843294384
0.6553184167
0.6940108849
0.6697448495
0.7170826325
0.6735556432
0.6914981265
0.3137784782
0.5582873594
0.5120088522
0.5455043523
0.5747611319
0.3344374811
0.01670106319
0.01597625513
0.07852372879
0.09621858166
0.03351250443
0.0364597523
0.03002098674
0.03179811948
0.09234665911
0.2452407922
0.2378410639
0.1666924684
0.3692310204
0.3060138503
0.314155194
0.2945138232
0.2995908418
0.3612530899
0.5268431173
0.5150653521
0.4405481834
0.6651302244
0.5902471367
0.6024231063
0.5508512998
0.579256996
0.6305061454
0.7731930552
0.6991083035
0.7041760783
0.7071146639
0.7009350306
0.7664608982
0.5863834995
0.6411227365
0.6508766379
0.7819007864
0.7284027876
0.7162621908
0.7610954043
0.7433689331
0.7941272256
0.651957764
0.6960271622
0.7158307997
0.8470249437
0.8031463193
0.7814187625
0.857863162
0.8277350431
0.871380871
0.750914038
0.7877590566
0.8165565857
1.16109908
1.122102048
1.154958391
1.073763448
1.095866428
1.149573902
1.008071308
1.049849282
1.025680055
1.096141956
1.034920665
1.053584106
1.003739371
1.017885127
1.085739776
0.9127994932
0.9622957329
0.9440362453
1.000091412
0.9953898477
0.9957699121
0.8763333956
0.9613908582
0.9332160506
0.8391221934
0.9120226075
0.9066373337
0.4817161023
0.5453811203
0.7420290139
0.1258349976
0.3100580933
0.2501447433
0.4652532819
0.3947858961
0.1557135941
0.02496465531
0.02134492835
0.03236025709
0.1392329341
0.06120222745
0.07834456308
0.04147130697
0.04932456513
0.1242187941
0.2965361934
0.2807903718
0.2126284692
0.4184809542
0.3503862815
0.3662098562
0.3242368329
0.3363309204
0.4033798547
0.5879560952
0.5708514844
0.4948906015
0.7196075436
0.6460576851
0.6624428522
0.6158381467
0.630434744
0.7048091424
0.8647023848
0.8532898618
0.7898967399
0.9596408872
0.9100830664
0.9195341585
0.8403049356
0.90039887
0.9067469967
1.041818214
0.9661782079
0.9732451711
0.9740917162
0.9676406828
1.036285059
0.8483966892
0.906058931
0.9160518197
1.055633234
0.9981839898
0.9837022405
1.041520348
1.0168115
1.072634224
0.9166340381
0.9659654942
0.9902255001
1.161346004
1.161212312
1.167156848
1.141950809
1.152940841
1.152773596
1.153659186
1.153254889
1.142950868
1.104899164
1.108706632
1.127570817
1.048725189
1.083503818
1.076626646
1.095846473
1.089989485
1.059703589
0.8910979844
0.924641738
0.9988161357
0.6450181501
0.811700686
0.7560319203
0.9039716318
0.8631218059
0.7171305819
0.1618297914
0.2225891309
0.4297405858
0.03672897351
0.08610678356
0.06272775107
0.1692646852
0.1310517938
0.04263804453
0.07241784111
0.05361784947
0.03172538977
0.2214907216
0.1449678252
0.1690026017
0.09862845794
0.1212416102
0.1990745674
0.3698700615
0.350731291
0.2873196789
0.4925317053
0.4212534812
0.4404969542
0.3835659913
0.4020367229
0.4727842803
0.6587038443
0.6416092503
0.5695432039
0.7793232294
0.7122728416
0.7276281725
0.6792268593
0.6959924736
0.7650533639
0.9044417493
0.8958932558
0.8410545184
0.9864306706
0.9444612018
0.9509411054
0.9285530129
0.9369250885
0.980773429
1.054009696
1.051990202
1.022112049
1.097284619
1.076714089
1.078109515
1.072609141
1.074925416
1.095970756
1.129452649
1.128573583
1.114446389
1.14924026
1.140044451
1.140807776
1.132809084
1.139196611
1.148498293
1.161411032
1.161441663
1.167756869
1.139661096
1.152390763
1.152204772
1.152693095
1.1525424
1.140103636
1.093845922
1.095935386
1.12172653
0.9990598991
1.057545717
1.053358454
1.069673704
1.063194381
1.011301905
0.7275062147
0.7654234429
0.9084590049
0.3455840192
0.5627698996
0.5152369983
0.6877122113
0.6239922275
0.4057300437
0.06348305136
0.07397122612
0.1764838714
0.0393750795
0.04192584576
0.04144301986
0.04870102398
0.04327226085
0.03730419481
0.1664418153
0.1459932801
0.06040662531
0.2993257155
0.2333393347
0.2497330462
0.1921896242
0.2140167521
0.2833699976
0.4356510518
0.422185448
0.3560170907
0.5629566066
0.4923060584
0.5049556885
0.4592972976
0.4766696461
0.5478616669
0.7091868631
0.7000535509
0.6345896235
0.821677944
0.7632569144
0.7707537852
0.7414953691
0.753629011
0.813917039
0.9233089797
0.9211208127
0.8745025662
0.9987660561
0.9623766366
0.9641677509
0.9562235473
0.9600979655
0.997080167
1.059188449
1.058063962
1.030571559
1.101411988
1.081560708
1.082513937
1.079367564
1.080514663
1.100525562
1.132163229
1.131592975
1.117969423
1.15150905
1.142652301
1.143138072
1.141492615
1.142105658
1.151038344
1.160959411
1.161116114
1.167868943
1.137259784
1.151312629
1.150944926
1.151943872
1.151642534
1.137953177
1.083800382
1.086551746
1.116891793
0.96504592
1.039691041
1.034640551
1.049059867
1.04450113
0.9736096281
0.6441345935
0.6624838503
0.8446218515
0.2595369578
0.4479534534
0.434176014
0.4814578799
0.4634550896
0.2674411
0.05395096166
0.05441741282
0.1248282156
0.04923024773
0.04241601903
0.04269383695
0.04172018221
0.04215465406
0.04771083321
0.1989249389
0.1961792234
0.09936953039
0.3331524128
0.2737219507
0.2757998783
0.2617678347
0.2707189732
0.3302237317
0.4579802191
0.4556538068
0.3907577751
0.5903714404
0.5227742373
0.5248653571
0.5148734541
0.5204273892
0.5881474541
0.7217663361
0.7198263387
0.6572316089
0.8338531155
0.7791213574
0.7810375659
0.774589301
0.7769859096
0.831836667
0.930125995
0.9286143686
0.8837080549
1.004256445
0.9687707629
0.9700839637
0.9658190917
0.9673508667
1.003041628
1.062809754
1.062023188
1.035252199
1.104186252
1.084886252
1.085535114
1.083381577
1.084170158
1.103596075
1.133870449
1.13352095
1.120278104
1.152872431
1.144272671
1.144556737
1.143567171
1.143944031
1.152602637
1.160073297
1.160332336
1.167593
1.133907504
1.149620062
1.149106491
1.150539824
1.150097691
1.134832166
1.071243007
1.074619333
1.110492052
0.9273078705
1.018062192
1.012026812
1.029357637
1.023836833
0.9373251703
0.5814395631
0.5953485086
0.7844702326
0.2355294166
0.4013208718
0.3925459371
0.4219481247
0.4110685452
0.2406296234
0.05297926859
0.05311023301
0.1140055525
0.05533360299
0.04366307935
0.04403615014
0.04299272723
0.04331626682
0.05372422427
0.2084896993
0.2062835034
0.1152970374
0.341522536
0.2812477483
0.2828519685
0.2777305014
0.2795432177
0.3395890001
0.4661800307
0.4642893248
0.4006114203
0.5973291324
0.5304392332
0.5320860049
0.5268349538
0.5286906663
0.5957994184
0.7274085182
0.7262699445
0.6633171556
0.8401011064
0.7855275141
0.7866442728
0.7827378479
0.7842302743
0.838810548
0.934949467
0.9339278017
0.8895634399
1.008214157
0.9734115537
0.9743208774
0.9712938052
0.972402495
1.007352876
1.065292167
1.064764339
1.038569861
1.105985621
1.087120933
1.087541424
1.086121157
1.086648462
1.1056122
1.134847647
1.134660706
1.121713882
1.153568521
1.145171729
1.145306987
1.144799275
1.145003253
1.153446478
1.158799437
1.159153266
1.167005654
1.129613282
1.147345872
1.146685388
1.148556375
1.14796911
1.130777914
1.055920186
1.060059208
1.102516551
0.8832693628
0.9920272188
0.9846515391
1.00569735
0.9990378196
0.8947332846
0.5370252218
0.5466055556
0.7273615709
0.2195909177
0.3708627415
0.3649368154
0.3845974452
0.3773993238
0.2229802398
0.0530179194
0.05293540257
0.1071947447
0.06211257081
0.04528999483
0.0457502097
0.04443172071
0.04485142912
0.06038469287
0.2162687131
0.2144679796
0.1286088815
0.3482837969
0.2871321534
0.2884008455
0.2843632221
0.2857883007
0.346734355
0.4727502833
0.4712517473
0.4082430679
0.6023871437
0.5364567744
0.5377354432
0.5336353016
0.5350911449
0.6012655707
0.7306702469
0.7300187553
0.6674361534
0.8436201382
0.7890738596
0.7896300523
0.7875964985
0.7884009273
0.8429658051
0.9378109685
0.9372757093
0.8930609945
1.010838242
0.9764447715
0.9769523999
0.9751296461
0.9758374904
1.010305036
1.066838308
1.066534588
1.04075891
1.107044369
1.088510902
1.088741813
1.08791204
1.088234649
1.106840849
1.135273426
1.135211902
1.122494038
1.153773724
1.145534665
1.145557059
1.145411367
1.145486515
1.153760865
1.157134383
1.157591404
1.166150081
1.124257747
1.144457015
1.14362031
1.145985677
1.145243712
1.125714235
1.036716233
1.041945138
1.09261991
0.8380258597
0.9605425495
0.9520484582
0.9769233762
0.9688613505
0.8489552554
0.5062474356
0.5129831503
0.681878754
0.2092560751
0.3501654067
0.346087751
0.3595413969
0.3546366995
0.2114355487
0.05371494628
0.05348906335
0.1032769069
0.06906409739
0.04723482221
0.04776435373
0.04622685894
0.04672387361
0.06733297656
0.2225829211
0.2211348101
0.1394563821
0.3536197319
0.2917921228
0.2927951184
0.2895976073
0.2907273436
0.3524092018
0.4778572394
0.4767076979
0.4141034609
0.6060604676
0.5410784649
0.5420384758
0.5389299272
0.5400432532
0.6052560584
0.7324517657
0.7321159287
0.670196262
0.8450674905
0.7907181892
0.7909203283
0.7900821406
0.7904415153
0.8448571266
0.9388861056
0.9387635868
0.8945065414
1.012162454
0.9778997567
0.9780371262
0.9773618946
0.9776762435
1.011950212
1.067516928
1.067426572
1.041883085
1.107483308
1.089168091
1.089223617
1.088927881
1.089069698
1.107428259
1.135252748
1.135296284
1.122741247
1.1536083
1.145482581
1.145413699
1.145555207
1.145529899
1.153679506
1.154965606
1.155566528
1.165010225
1.117365747
1.140747155
1.139645544
1.142727727
1.141772065
1.119272796
1.013360988
1.019491897
1.07986832
0.7989427055
0.9264458571
0.9181547335
0.9434718881
0.9349082424
0.807958855
0.4841358853
0.4890283684
0.6481167466
0.2028543691
0.3359085596
0.3331027851
0.3423779449
0.3389877419
0.2041654468
0.05488893187
0.05455485679
0.1014490625
0.07584503348
0.04942824982
0.0500095694
0.04830489881
0.0488624049
0.07417952324
0.2274661394
0.2263676531
0.1481464546
0.3577224543
0.2954588318
0.2962381166
0.2937391752
0.2946261479
0.3568013824
0.4816899037
0.4808405535
0.4185161523
0.6086086886
0.5444960765
0.5451840342
0.5429260968
0.5437442658
0.6080658521
0.7331985448
0.7330935277
0.671892345
0.8451552366
0.7911426347
0.791106258
0.7910545445
0.7911268564
0.8452312393
0.9385986724
0.9387732488
0.8944812264
1.01229121
0.9779847572
0.9778315115
0.9780932856
0.9780738487
1.012359843
1.067380475
1.067486125
1.042000981
1.107355234
1.089139792
1.089032195
1.089236755
1.089208383
1.107438155
1.134840901
1.134978377
1.122514226
1.153143876
1.145085124
1.144936927
1.145324174
1.145214289
1.153285201
1.152044245
1.152862566
1.163487257
1.108252678
1.135774004
1.134294655
1.138453589
1.137177726
1.110764208
0.9882651067
0.9945275425
1.063846556
0.7676916433
0.8947587536
0.887548942
0.9100863578
0.9022754217
0.7748298376
0.4680101945
0.4715721527
0.6227859874
0.1993433724
0.3262327734
0.3244194008
0.3305772009
0.328272211
0.1999866898
0.05644145503
0.05601867282
0.1012185529
0.08224994365
0.05180108876
0.05241866549
0.05059628135
0.05119739529
0.08069431991
0.2312027058
0.2303589096
0.1551206964
0.3607787554
0.2982830934
0.2988718291
0.2969677749
0.2976486539
0.3601054548
0.4844358853
0.4838423509
0.4217603776
0.6102265543
0.5468928063
0.547351919
0.5458112078
0.5463800119
0.609899951
0.7331573894
0.7332317347
0.6727258723
0.844344609
0.7907191525
0.7905076544
0.7910213238
0.7908912354
0.8446149466
0.9373697598
0.937747181
0.8934788893
1.011452375
0.9770362829
0.9766748432
0.9776190764
0.9773523933
1.011738752
1.066535486
1.06680575
1.041257835
1.106708244
1.088488813
1.08823973
1.088886773
1.088705035
1.106915129
1.134078975
1.134299891
1.121855403
1.152422728
1.144384789
1.144166862
1.144770503
1.144586095
1.152624873
1.148099183
1.149194151
1.161418308
1.09680519
1.129200065
1.12728733
1.132714442
1.13101049
1.09985458
0.9642878872
0.9700748242
1.045753229
0.7429632057
0.867738036
0.8617170703
0.8806456341
0.8740432361
0.7486178056
0.4563284666
0.4589016433
0.6034880895
0.1980841793
0.3200093629
0.3188979108
0.3227491821
0.321282331
0.1982183872
0.05831253888
0.0578130379
0.1022844338
0.08815504019
0.05429703169
0.05494043489
0.05303634133
0.05366790944
0.0867323351
0.2340617472
0.2334165275
0.1607180635
0.3629547232
0.3003855693
0.3008091911
0.2994189353
0.2999230071
0.3624828127
0.4862725602
0.4858886841
0.424091335
0.6110726908
0.5484296671
0.5486961094
0.5477596526
0.5481182214
0.6109262263
0.7324900118
0.7327086276
0.6728547075
0.8428941963
0.7896583618
0.789310447
0.7902589146
0.7899751105
0.8433072591
0.9354894625
0.9360093461
0.8918058206
1.009891179
0.9753531164
0.9748438919
0.976271573
0.9758298981
1.010337563
1.065119325
1.065519587
1.039839181
1.105612566
1.087311087
1.086946706
1.087959272
1.087649114
1.10592417
1.133013549
1.133305656
1.120819045
1.151480048
1.143420591
1.143143085
1.143933175
1.143684058
1.151734306
1.142994223
1.144377282
1.15864434
1.083792242
1.120998157
1.118745156
1.125277937
1.123178356
1.087133223
0.942834258
0.9479373572
1.027429076
0.723293298
0.8452433173
0.8402442556
0.8559689464
0.8504803704
0.7278039385
0.4480646811
0.449881709
0.5887058888
0.1985469243
0.3164454809
0.3158934047
0.3179415183
0.3171242496
0.1982922313
0.06046902003
0.05989755604
0.104403037
0.09353550525
0.05687874657
0.05754245367
0.05557877706
0.05623263551
0.09224219796
0.236248942
0.235755092
0.1651627947
0.3644275995
0.3018693363
0.3021605326
0.3011959217
0.3015488762
0.3641170733
0.4873705006
0.4871570889
0.4256458743
0.611274807
0.5492465774
0.5493539384
0.5489196748
0.5491025241
0.6112781669
0.7313166511
0.7316516284
0.6724027694
0.8409588061
0.7880966021
0.7876406247
0.7889330762
0.7885279112
0.8414816678
0.9331400666
0.9337641649
0.8896436894
1.007801499
0.9731446889
0.9725280957
0.9743045982
0.9737374621
1.008365118
1.063259773
1.063760217
1.037910062
1.104147997
1.085709834
1.085254413
1.086557397
1.086144592
1.104544522
1.131694862
1.132045654
1.119467588
1.150350978
1.142233671
1.141906871
1.142852434
1.142548971
1.150648593
1.136846573
1.138467319
1.155084617
1.070246947
1.111641246
1.109191028
1.116428873
1.114056657
1.073635403
0.9241380135
0.9285614719
1.010068026
0.7075492275
0.8265506772
0.8223864579
0.8354702084
0.8309079572
0.7111676953
0.4423876736
0.4435917494
0.5773998638
0.2003589387
0.3149149579
0.3147936568
0.3154581718
0.315133793
0.1997956361
0.06290683894
0.0622621473
0.1074173554
0.09839419816
0.05952863309
0.06021114172
0.05819568006
0.05886909797
0.09723261563
0.2379233883
0.2375461246
0.1686879758
0.3653430014
0.3028757546
0.3030672899
0.3024234081
0.3026616497
0.3651607867
0.4878851159
0.487800811
0.4265679579
0.6109489852
0.5494742008
0.5494510918
0.5494264572
0.5494667661
0.6110740997
0.7297379075
0.7301657826
0.6714784636
0.8386466365
0.7861380877
0.7855966378
0.7871613172
0.7866600415
0.8392551724
0.9304402768
0.9311430912
0.8871110606
1.005321002
0.9705505031
0.9698536316
0.9718891554
0.9712294396
1.005971961
1.061058924
1.061636531
1.035596644
1.10238777
1.083775305
1.083248479
1.084779388
1.084285944
1.102852041
1.130169289
1.13056784
1.117860121
1.149069034
1.140863571
1.140496533
1.141569289
1.141221247
1.149401986
1.129929953
1.131713921
1.15078295
1.056933599
1.101701671
1.099184621
1.10671222
1.104212845
1.060211501
0.907957208
0.9117875769
0.9941444132
0.6948722241
0.8109474912
0.8074605488
0.8184030323
0.814591846
0.6977905473
0.4387402883
0.4394922692
0.5688093489
0.2032213497
0.3149370811
0.3151396225
0.3147603326
0.3148095623
0.2024231678
0.06562670402
0.06490775972
0.1111989547
0.1027346608
0.0622361522
0.06293623092
0.06087594308
0.06156737909
0.1017034995
0.2391804201
0.2389001166
0.1715003711
0.365797913
0.303512104
0.3036204707
0.3032363852
0.3033849122
0.3657228707
0.487954793
0.4879756892
0.4269662942
0.6101937556
0.5492178256
0.5490903135
0.5493995676
0.5493213851
0.6104181893
0.7278361618
0.7283379859
0.6701735757
0.8360400037
0.7838662209
0.7832575093
0.7850367373
0.7844596128
0.8367154021
0.9274737531
0.9282366585
0.8842929222
1.002546394
0.9676661791
0.9669084171
0.9691397853
0.9684102782
1.003263415
1.058594337
1.059231755
1.032991204
1.100391933
1.081579268
1.080996244
1.0827062
1.082149502
1.100910206
1.128475454
1.128912901
1.116046123
1.147662914
1.13934411
1.138944226
1.140120673
1.139736323
1.148024547
1.122558872
1.124428815
1.145867626
1.044276773
1.091647402
1.08915634
1.096666349
1.09415187
1.047367111
0.8939302764
0.8972528036
0.9797679482
0.6846133416
0.7978571645
0.7949265953
0.8041201417
0.8009212015
0.6869805128
0.4366554065
0.4370476572
0.5622806084
0.206900731
0.3161442798
0.3166055379
0.3154094542
0.3157457696
0.2059143421
0.06863909146
0.06783986539
0.1156390927
0.1065814174
0.06499296288
0.06571209253
0.06360847847
0.06431780385
0.1056727463
0.2400986849
0.2398947471
0.1737531956
0.3658818288
0.3038387334
0.30388043
0.3037097274
0.3037830896
0.3658912801
0.4876434209
0.4877532169
0.4269520273
0.6090898135
0.5485774064
0.5483664292
0.5489403141
0.5487690812
0.6093945876
0.7256774392
0.7262382055
0.66856175
0.833204381
0.7813482451
0.7806866087
0.7826344011
0.7819977374
0.83393178
0.9243026966
0.9251119654
0.881254693
0.9995474648
0.964560917
0.9637562283
0.9661377409
0.9653549694
1.000315258
1.055923564
1.056608115
1.030161246
1.09820726
1.079176598
1.07854868
1.080401005
1.079794221
1.098769069
1.126643646
1.1271132
1.114064632
1.146155502
1.137702295
1.137275223
1.138537123
1.13812297
1.146540677
1.114999972
1.116895351
1.140510184
1.032456766
1.081791347
1.079383194
1.086681027
1.084224433
1.035329397
0.8817542894
0.884639207
0.9668805125
0.6763501009
0.7868467876
0.7843772404
0.7921128743
0.7894217449
0.6782615705
0.4358427369
0.435938505
0.5574804319
0.2112618681
0.3183115598
0.3189876919
0.3171200339
0.3176911819
0.2101185138
0.07195925995
0.07107195832
0.120666755
0.1099804001
0.06779604294
0.06853717304
0.06638895147
0.06711889112
0.1091830669
0.2407552626
0.2406080156
0.1755762742
0.3656871607
0.3039220821
0.3039142881
0.3039063983
0.3039215575
0.3657583511
0.4870122746
0.4871976727
0.4266065704
0.6077020476
0.5476300031
0.5473552188
0.5481372073
0.5478906584
0.6080732079
0.7233114174
0.7239201599
0.6667009996
0.8301888209
0.7786351309
0.7779309002
0.7800135183
0.7793294827
0.8309574263
0.9209713793
0.9218172761
0.8780444878
0.9963734118
0.9612836876
0.9604419385
0.9629414209
0.9621169809
0.9971812019
1.05308804
1.053810511
1.027154743
1.095868562
1.076607568
1.075943102
1.077910874
1.077263608
1.096466107
1.12469659
1.125193125
1.111944965
1.144563886
1.135958435
1.13550843
1.136842106
1.136403009
1.144968782
1.107454864
1.109331536
1.134878894
1.021530953
1.072323079
1.07003159
1.077000743
1.07464623
1.024177755
0.8711910595
0.8736939909
0.9553868921
0.669710377
0.7775869255
0.77550847
0.7820131536
0.7797475298
0.6712236987
0.4361017527
0.4359442938
0.5540981075
0.2162058459
0.3212842065
0.3221463417
0.3197055221
0.3204760494
0.2149292913
0.07559906695
0.0746143426
0.1262150547
0.1129963564
0.0706436588
0.07141324466
0.06921385948
0.069967912
0.1122945603
0.2412253632
0.2411166754
0.1770871137
0.3652826268
0.3038272425
0.303784278
0.3038932408
0.3038671376
0.3654019839
0.4861142178
0.4863600272
0.425998179
0.6060769805
0.5464488362
0.5461205468
0.5470665336
0.54676445
0.6065026814
0.7207757585
0.7214236127
0.6646341794
0.8270295587
0.7757644758
0.7750260574
0.7772173834
0.7764951036
0.8278310779
0.9175135902
0.9183882092
0.8746978949
0.9930604532
0.957870519
0.9569996208
0.9595921611
0.9587348535
0.9939000265
1.050119428
1.050872576
1.02400724
1.093402513
1.073902717
1.073208277
1.075270527
1.074590253
1.094029743
1.1226519
1.123171424
1.109709708
1.142900768
1.134127971
1.13365827
1.135053249
1.134592993
1.143322584
1.100058592
1.101889001
1.129114572
1.011500933
1.063347031
1.061185101
1.067771162
1.06554239
1.01392698
0.8620340262
0.8642052554
0.9451450199
0.6644929634
0.7698225723
0.7680912266
0.773549424
0.7716508283
0.6656809988
0.4372559422
0.4368905471
0.551918834
0.2216521581
0.3249391907
0.3259563517
0.3230360107
0.323978227
0.2202686105
0.07958371629
0.07849122766
0.1322253672
0.1156935565
0.07355021205
0.07436149972
0.07208768973
0.07287662545
0.1150764069
0.2415475476
0.2414695422
0.1783651974
0.3647109749
0.3035942765
0.303523601
0.3037265247
0.3036689959
0.364870277
0.4850072993
0.4853001677
0.4251843688
0.604264828
0.5450659816
0.5446939277
0.545780075
0.545428715
0.6047329423
0.7181078139
0.7187848362
0.6624016785
0.8237592466
0.7727703744
0.7720069333
0.774280533
0.7735285208
0.8245853824
0.9139602158
0.9148557834
0.871246571
0.989638599
0.9543519882
0.9534593899
0.9561226016
0.9552399401
0.990502783
1.047043793
1.047821414
1.020747675
1.090830428
1.071086533
1.070367674
1.072507211
1.071799869
1.091482403
1.1205236
1.121062808
1.107376802
1.141175617
1.132222755
1.131736008
1.133184093
1.132705511
1.141612183
1.092884939
1.09465551
1.123320312
1.00231143
1.054890397
1.052856592
1.059054821
1.056956184
1.004535333
0.8540626258
0.8559504347
0.9359955989
0.6604178873
0.7633145175
0.7618545175
0.7664308071
0.7648401169
0.6613455714
0.4390909629
0.438569861
0.5506989701
0.2274855804
0.3291148178
0.3302493712
0.3269750046
0.3280534084
0.2260406507
0.0839434916
0.08272082846
0.1386153399
0.1181306064
0.07654297495
0.0774112346
0.07503438433
0.07587189428
0.1175864916
0.2417572356
0.2416952808
0.1794565843
0.3640145425
0.3032531582
0.3031692604
0.3034338638
0.3033547938
0.3642027085
0.4837496688
0.484072225
0.4242243401
0.6023189987
0.5435250579
0.5431221852
0.5443124085
0.5439237157
0.6028143239
0.7153498972
0.7160454082
0.6600491117
0.8204129995
0.7696907687
0.7689118746
0.7712388027
0.7704666964
0.8212548213
0.9103416227
0.9112508779
0.8677233293
0.9861354122
0.9507572854
0.9498497261
0.9525624746
0.9516616602
0.9870174806
1.043883838
1.044680658
1.01740182
1.088170603
1.068180121
1.067441544
1.069643459
1.068914178
1.08884291
1.118323997
1.118879998
1.10496167
1.139397027
1.130253191
1.129751788
1.131245431
1.130751083
1.139846172
1.085962689
1.087670615
1.11756402
0.9938723009
1.046933059
1.045016965
1.050852635
1.048877606
0.9959169456
0.8470268124
0.8487037203
0.927772256
0.6572221751
0.7577956367
0.7565472431
0.7604487143
0.759097502
0.6579565774
0.4413884471
0.4407492012
0.5501813623
0.2335461192
0.3336129377
0.3348449521
0.3313364853
0.3325177695
0.2321062599
0.08866799256
0.08728256733
0.1452582716
0.1203758996
0.0796434869
0.08058881505
0.07807839987
0.07898247261
0.1198956843
0.2419076372
0.2418476915
0.1804243474
0.3632513008
0.3028566853
0.3027732268
0.3030585084
0.3029743033
0.3634567552
0.4824022972
0.4827389764
0.4231769663
0.6002986953
0.5418757963
0.5414571414
0.542710237
0.5422983439
0.6008111471
0.7125387856
0.7132440136
0.6576197616
0.8170222581
0.7665604402
0.7657736619
0.7681300842
0.7673467013
0.8178729712
0.9066827393
0.9076000281
0.8641569039
0.9825739049
0.947111096
0.9461938697
0.9489392985
0.9480264126
0.9834687093
1.040658112
1.041469805
1.013991006
1.08543825
1.065200924
1.064446545
1.066698656
1.065951729
1.08612741
1.116063433
1.116633761
1.102477245
1.137571978
1.128228073
1.127713977
1.129247073
1.128739125
1.138032209
1.07930254
1.080950725
1.111891108
0.9860976245
1.039441487
1.037623715
1.043130585
1.041268609
0.987978194
0.8407738433
0.8422876245
0.9203339867
0.6546909662
0.7530588567
0.751966293
0.7553388701
0.754176889
0.6552799351
0.4439967594
0.4432332423
0.5501567279
0.2396836306
0.3382594358
0.3396251901
0.335927584
0.3372142381
0.2383411431
0.09374554314
0.09215931577
0.1520245309
0.1224837593
0.0828702775
0.08392092081
0.08124013736
0.08223386079
0.1220676188
0.2420277051
0.2419687025
0.1813153738
0.3624657252
0.3024464063
0.3023594728
0.3026509777
0.3025687596
0.3626767427
0.4809988665
0.4813510716
0.4220884206
0.5982311508
0.5401647853
0.5397266614
0.5410254726
0.5406008715
0.5987534386
0.7096925899
0.7104105378
0.6551506085
0.8136101346
0.7634050411
0.7626090548
0.7649840627
0.7641953013
0.8144642408
0.9030000176
0.9039236299
0.860568813
0.9789726308
0.9434328889
0.9425084667
0.9452746717
0.9443545321
0.9798758521
1.03738275
1.038205068
1.010532737
1.08264619
1.062163581
1.061397927
1.063688616
1.062928087
1.083349699
1.113752832
1.114332939
1.099934377
1.135705766
1.126154334
1.125631858
1.127196837
1.126677673
1.136176627
1.07251836
1.07465406
1.106448486
0.9791016677
1.03256894
1.030221706
1.035880158
1.034037286
0.9805622546
0.8348259291
0.8367488034
0.9137589147
0.6527798797
0.7491220778
0.7477505872
0.7509625477
0.7498557977
0.6531187121
0.4470494806
0.4458956347
0.5505288287
0.245779765
0.342923637
0.3448741094
0.3405977233
0.3420798009
0.2446990461
0.09956372274
0.09732200123
0.1588087816
0.1244983007
0.08624505966
0.08770696051
0.08453741353
0.08565514109
0.1241565473
0.2421449925
0.242090798
0.1821628811
0.3617105835
0.3020620208
0.3019129955
0.3022470129
0.3021419971
0.3618613193
0.4794541471
0.4799909014
0.4210264468
0.5962150165
0.5384850867
0.5378255071
0.5393054627
0.5388193673
0.5966161582
0.7066297115
0.7076659273
0.6527618933
0.8102827651
0.7603375803
0.7592183845
0.7618350519
0.7609922144
0.81101251
0.8990758352
0.9003207392
0.8570624817
0.975416481
0.939815412
0.9385825857
0.9415935205
0.9406395399
0.9762360985
1.033889357
1.034952514
1.00710287
1.07984014
1.059123994
1.05814532
1.060629275
1.059849208
1.080517514
1.111294625
1.112004
1.097368886
1.133808657
1.124049849
1.123423447
1.125099409
1.124577063
1.134290578
0.04787902062
0.04972590451
0.04867454312
0.05287524057
0.05177531261
0.04943378525
0.07412615102
0.07556832752
0.07452776546
0.07887283506
0.07759181655
0.0759255771
0.05430111173
0.05615993913
0.05495228826
0.05982317385
0.05808627116
0.0560240244
0.4055525856
0.4397282347
0.4534907481
0.4242326827
0.4383518789
0.4091362947
0.1069007995
0.1086242894
0.1064695114
0.08039911007
0.08256083232
0.08131612729
0.08624204594
0.08481885368
0.08284369165
0.3443668878
0.3971826725
0.3929805283
0.4051243549
0.4010855149
0.3483908221
0.2766630979
0.3313580757
0.3268089855
0.3404976428
0.3359362794
0.2811118948
0.4039441938
0.3885070461
0.3932072123
0.1547741792
0.1588762567
0.1658213616
0.1451936396
0.1515411926
0.1483618722
0.1587627017
0.1548823936
0.1479038992
0.1716271077
0.2259539112
0.2212775273
0.2353576506
0.2300854351
0.1764357922
0.3374964763
0.2844102795
0.29018951
0.06340338604
0.062495431
0.08037943732
0.02563308891
0.04505854403
0.04945539644
0.04927857681
0.04511765976
0.0270204097
0.02156224517
0.03024226071
0.02842713312
0.03383264829
0.03228555006
0.02388753162
0.0928161699
0.1147209661
0.108888977
0.1856659431
0.205184713
0.1929992361
0.2240332065
0.2126759614
0.2006098237
0.1594613478
0.1703947659
0.1646686886
0.1844148571
0.1774160933
0.1641630076
0.03887567857
0.05080950639
0.0507950506
0.05891206863
0.05402852339
0.04207080102
0.07955732819
0.06470060911
0.068789586
0.06160300456
0.05379854829
0.06307839621
0.03768984624
0.04548253993
0.05245118881
0.0367275132
0.04023256293
0.0327025634
0.05549613064
0.06143402097
0.06874662716
0.04653110687
0.05365143181
0.0475382693
0.06635719024
0.05908099374
0.05274720867
0.07721010438
0.07006912373
0.07185172257
0.0673065083
0.06823320278
0.07504922676
0.05496460018
0.06160307338
0.05997534301
0.2510249675
0.2661985562
0.2715190071
0.2936194824
0.2819529645
0.2839439703
0.2176551553
0.2188072083
0.2346016841
0.09641101491
0.09017434572
0.09301721343
0.08428988176
0.08715608473
0.09275481159
0.07577855157
0.08177708899
0.07846719639
0.3675968715
0.3800243533
0.3904115213
0.3733255976
0.371925238
0.3641533713
0.3937523927
0.3879843487
0.3785913312
0.3249802668
0.3209663857
0.3107820609
0.3475730854
0.3379565256
0.3350138466
0.3471005658
0.339935482
0.353172579
0.3794440815
0.3708438455
0.3833667835
0.3558773737
0.3670337803
0.3661662805
0.1256795992
0.1207459054
0.1234697139
0.1122664305
0.1153112425
0.1211904986
0.1069460324
0.1104626729
0.1064550057
0.4389329206
0.4393293562
0.4518739197
0.4291363459
0.4287034887
0.4321989425
0.4300261411
0.4358836245
0.4218815945
0.410239156
0.4111684566
0.4082441853
0.4228546968
0.4232590089
0.4091548543
0.4442252197
0.4309989546
0.4349451631
0.376034273
0.4281502854
0.4242845963
0.4355464108
0.4317475554
0.3798700252
0.1667612574
0.1650877193
0.1386023729
0.0441935605
0.05425398887
0.05277161573
0.05738318518
0.0557247657
0.04596093119
0.4201057875
0.4158239839
0.4126996597
0.4256780848
0.4190365995
0.4195920812
0.4143743155
0.4168900198
0.4237830277
0.4350078486
0.4285322396
0.4363419716
0.4191690048
0.4217179528
0.4262462741
0.4343061998
0.4284127567
0.4243558393
0.3110568875
0.365624737
0.3621885977
0.3727510382
0.3680272141
0.3151646145
0.1105435523
0.1081046733
0.08438053849
0.1353364011
0.1394915282
0.1527023923
0.1022300938
0.1275861108
0.1258955078
0.1256245105
0.1283882147
0.131278769
0.08487416953
0.1073560195
0.1031412664
0.1157953619
0.1118925808
0.08934430047
0.3907397865
0.3911594112
0.3798648785
0.4225772338
0.4103186009
0.4096720137
0.4161170551
0.4110804827
0.4264322158
0.4173297647
0.4104124895
0.4121204377
0.409110271
0.4093297156
0.4185109661
0.3806673631
0.3930712941
0.3908036174
0.2405779376
0.2945752888
0.2905834344
0.3037892365
0.2994716469
0.2456039318
0.3726299591
0.3516907179
0.3560954835
0.02832109472
0.02600535122
0.009475261761
0.2419656807
0.1059509045
0.1228796646
0.0611042483
0.06311890344
0.09847799517
0.01760449758
0.03631090762
0.03275611414
0.03850170162
0.05563524069
0.05314303095
0.06951999696
0.06947961455
0.07276786118
0.0611216452
0.06435709781
0.06422213041
0.1638171555
0.1517033992
0.1620958564
0.1313435527
0.1385201186
0.1463672827
0.04186686025
0.04391062253
0.04302355291
0.04670983116
0.04575287739
0.0434636218
0.0459785336
0.0442273428
0.04344152013
0.3058094418
0.3022515027
0.2448158911
0.331575875
0.3370329966
0.330070678
0.3443426831
0.3412781974
0.3368561834
0.2885720197
0.2975006444
0.288210756
0.3197431149
0.3081995366
0.3021702835
0.2561867565
0.3133217766
0.309494417
0.1267004842
0.1548834589
0.1528818379
0.1583001161
0.1565644389
0.1283193033
0.1027223687
0.1328448767
0.1313089158
0.135979928
0.1344003663
0.1038850567
0.1943578008
0.1650922162
0.167032599
0.1536944626
0.1844151378
0.1821139154
0.1768578634
0.186658629
0.1557560582
0.1328831248
0.1617297216
0.1599067328
0.1652245707
0.1634178894
0.1344492968
0.06693249519
0.07126198211
0.06974098798
0.07166322754
0.07243598489
0.06818369624
0.05832239473
0.05803142034
0.04279850771
0.06537230743
0.06768496964
0.0693710424
0.0655614351
0.06625645105
0.06277627224
0.04780031243
0.06102995698
0.06064425591
0.05136929793
0.05050615296
0.05178185583
0.06028525322
0.06400620232
0.06471820798
0.05960983266
0.0619983518
0.05831253301
0.04393797628
0.05950856101
0.06040616384
0.05977318929
0.06495490968
0.06307492514
0.06793078465
0.06609640751
0.06147603677
0.4195123768
0.4067089239
0.4212859646
0.3882793036
0.4020868288
0.403251245
0.154378777
0.1561036984
0.1852810176
0.09826421026
0.1268224206
0.1253652271
0.1297944476
0.1283033773
0.09936107634
0.03794613609
0.04844396512
0.04706438935
0.05131112997
0.04996379048
0.03964566051
0.09727705489
0.09926790986
0.09739210064
0.1039066803
0.1019642305
0.101196353
0.1074693717
0.1063157047
0.1082805715
0.1021945174
0.1044300297
0.1052418736
0.0869313044
0.1051081215
0.1032414935
0.06446796714
0.06368882596
0.05038668528
0.05997261727
0.07722524986
0.07308628399
0.08804092136
0.0903009418
0.08865683025
0.09468817818
0.09289838249
0.09132771227
0.1379024644
0.1360520327
0.1096589586
0.1301084858
0.1565035118
0.1547092805
0.3603850979
0.4129475613
0.4089250744
0.4206229075
0.4166902039
0.3643155574
0.1511616496
0.1292326699
0.1320146169
0.1245743102
0.126795495
0.1498081527
0.0749553439
0.09979026237
0.09830610642
0.398088294
0.4030737141
0.4093135943
0.2942379419
0.349514237
0.3450293791
0.3581772193
0.3539356533
0.2985328384
0.1186948309
0.1268287783
0.1276715794
0.1287959856
0.1285930406
0.1232129892
0.1022087661
0.1237965665
0.1203142192
0.1293802134
0.1268232576
0.106751622
0.1374797597
0.1353984651
0.1299065897
0.005995494548
0.006379448796
0.003735158639
0.03662680327
0.01210280781
0.01429689462
0.3246530883
0.3280493463
0.3646650462
0.2210407985
0.275161131
0.2719745189
0.2851205176
0.2822145962
0.2285389908
0.01176677693
0.01368255005
0.01438598341
0.008782066457
0.0130197334
0.01142670543
0.1355120065
0.1463564248
0.1349518552
0.1028178113
0.1171565545
0.1255450805
0.0529678228
0.05785089514
0.0511135434
0.0691878702
0.06328527014
0.05897825133
0.07301290497
0.06803254167
0.07418630117
0.05437724468
0.05107932864
0.05511948686
0.03937729051
0.04621629292
0.04922905398
0.2271104723
0.2447365676
0.2602238336
0.2328877532
0.2363493712
0.2247555593
0.2675942013
0.2560091028
0.248715988
0.1767495958
0.1755788725
0.1642322216
0.2057239879
0.1936830089
0.1927999751
0.1976526641
0.1932501409
0.2089971433
0.1393927384
0.1442016481
0.1400181983
0.03223147506
0.04089668601
0.03907563187
0.04474442268
0.04272688519
0.03423631615
0.1245329552
0.1131328001
0.1126426184
0.1056278432
0.1081554374
0.1220904266
0.07277474932
0.0897268948
0.0866383552
0.1233167582
0.1292231764
0.1307160962
0.1116595869
0.1227440524
0.1192962218
0.1285389976
0.1240793947
0.1149233614
0.148230598
0.1377722117
0.1415071199
0.09214615468
0.08659048095
0.07999247136
0.1035748806
0.09572186716
0.1014012783
0.08689209065
0.09194474305
0.1011364791
0.02610984314
0.02544327834
0.02252958658
0.03179422211
0.02880916661
0.02915856664
0.02881746192
0.02793452857
0.03131526854
0.03720804969
0.0387846253
0.03890818825
0.04136937575
0.04057511681
0.03831615296
0.1272676989
0.1270598683
0.1297080035
0.1260249231
0.1225613557
0.1288606328
0.1286004946
0.1308256403
0.129072488
0.1158893133
0.1145477699
0.1036564595
0.1149765755
0.1163302498
0.1154855846
0.1129890917
0.1125678952
0.1132015266
0.1229076114
0.1234314462
0.1223929224
0.1198093359
0.1189580412
0.1208325245
0.1138174633
0.1190981527
0.1179004556
0.03009608587
0.03751855969
0.03559327231
0.04173871144
0.03863537112
0.03232019889
0.02427897065
0.0216737695
0.02612589225
0.01536009807
0.01822429493
0.02085246853
0.01508204714
0.01662686246
0.013384668
0.02358660197
0.02804668035
0.02567850231
0.01593081937
0.0202273078
0.01956912813
0.02332357482
0.02140138524
0.01730569168
0.03123783076
0.02562967946
0.02702278998
0.02242265309
0.02552318252
0.02749781815
0.01892078645
0.02147198449
0.01910673038
0.02683309008
0.02530403411
0.02175852498
0.0118924184
0.01489773231
0.01465076844
0.01720590917
0.01571617411
0.01286935704
0.02223993461
0.01875653795
0.02012199821
0.01993330527
0.02109637775
0.02041328793
0.02284726664
0.02219684882
0.02089423746
0.01193749
0.01148026569
0.01014904057
0.01474295768
0.01393107358
0.0136960091
0.01922293344
0.0189484409
0.01823580908
0.0502658854
0.0606840597
0.05877188927
0.06618811203
0.06187248398
0.0526669987
0.09098255107
0.114444391
0.1124024381
0.0396850303
0.0486237128
0.04634962676
0.05380889676
0.04991622222
0.04260315949
0.1235743972
0.1427482827
0.1417142357
0.1435018208
0.1433475938
0.1270440762
0.08923906723
0.0907250879
0.09557051398
0.07925848797
0.08360836565
0.0821708903
0.1162568485
0.1166628035
0.1216056905
0.1033750865
0.1081532149
0.1062044599
0.02011195591
0.02146828228
0.01937243569
0.02756442272
0.02573671472
0.02659991487
0.01537704424
0.01792172715
0.01877791348
0.1173456678
0.1472064105
0.145166926
0.1511800695
0.1486757815
0.1203462575
0.1690680986
0.1712696876
0.199508834
0.1076735212
0.1392667784
0.1375917162
0.1430329825
0.1410590503
0.1092907332
0.1461505242
0.17625783
0.1743419549
0.1801500196
0.1781159021
0.1479530922
0.1392790342
0.1688112502
0.1669387691
0.1725050202
0.1706037667
0.1409450429
0.04498763376
0.05890198283
0.0586119208
0.06031571969
0.0600583194
0.04683862141
0.05290708554
0.05389236183
0.05301228588
0.06084692719
0.06015042847
0.04776492233
0.03114507756
0.04265290642
0.04150718766
0.04549111118
0.04432700342
0.03263936045
0.06619662471
0.05510635738
0.05425885962
0.04434876445
0.04258956436
0.03236383704
0.04972887842
0.04928695757
0.06231061422
0.03810383073
0.04794977094
0.04617531655
0.03067236368
0.0383466125
0.03661078738
0.1135172823
0.1367036033
0.1353355409
0.1401741945
0.1386116421
0.1160546657
0.09960111805
0.123761204
0.1236508222
0.1325823107
0.1313063488
0.1078282989
0.02727538012
0.02852006584
0.03774097838
0.01500140278
0.02051119272
0.01869670802
0.4472637684
0.4217559874
0.4150678733
0.3869566331
0.407803209
0.4229006229
0.1008490218
0.04353374412
0.05093370081
0.0306767387
0.03967042151
0.09193814507
0.006394487948
0.0101343693
0.01057432523
0.1073282401
0.1044782583
0.08794775136
0.006945743472
0.008331244489
0.009066860023
0.006856531286
0.007439486998
0.006382768281
0.01050923471
0.0113809362
0.01090534832
0.007191700685
0.008801556167
0.008564546751
0.01005129655
0.009367533323
0.007801181388
0.01266491904
0.01082734999
0.01198288054
0.008904315769
0.009496151181
0.008863573412
0.005384772275
0.006482789745
0.006509913152
0.007530784374
0.007065544356
0.0057713703
0.144465073
0.1697848521
0.168314073
0.124318669
0.1226316784
0.09804340833
0.01859342565
0.01746544668
0.01359546864
0.0271714224
0.02026627651
0.01980551506
0.01707130383
0.01835418706
0.02313937004
0.04211807123
0.04127758439
0.04197230279
0.05324578677
0.06624512919
0.06531599397
0.07227098208
0.07103746281
0.058629839
0.1158721512
0.1419334278
0.1398951693
0.1530259537
0.1512375836
0.1252924282
0.0605844454
0.05651717793
0.04848343777
0.09555820257
0.09407067197
0.05365981297
0.03006737373
0.02927269395
0.02086059399
0.01245035668
0.0128531637
0.01247269515
0.0124552072
0.01414198478
0.01319525427
0.05798564879
0.06595261177
0.07112008287
0.1383614313
0.1398933136
0.1362749776
0.02438636056
0.02753728844
0.02932366644
1.155568534
1.155575856
1.156027033
1.155644036
1.155625318
1.156047609
1.155915412
1.155803381
1.155821246
1.156262722
1.155928372
1.155839933
1.157508935
1.156884948
1.156560526
0.9242444019
0.992828445
1.097334476
0.7393983502
0.8006730178
0.8697869263
0.6150379776
0.677895491
0.7195696633
0.5469653849
0.6017683632
0.6258063308
0.5115308089
0.5627447016
0.5722621708
0.5041971222
0.5547007842
0.5540104091
0.5231100649
0.5722481029
0.5603982021
0.5628388175
0.6130782969
0.5921086131
0.62960065
0.6814937303
0.6503463332
0.7190349618
0.781777512
0.7364784055
0.841218289
0.8975035364
0.843290435
0.9980766503
1.042675475
0.973205331
1.155870194
1.161591679
1.144365954
1.158088219
1.163501912
1.16311841
1.159403908
1.164591018
1.164389891
1.1600554
1.165077599
1.16501003
1.160225638
1.165128479
1.165158506
1.160042305
1.164860778
1.164964381
1.159583704
1.164347834
1.164509588
1.158895384
1.16363431
1.163843117
1.158011573
1.162754102
1.163000923
1.156964042
1.161737006
1.16201412
1.155782922
1.160610104
1.160911009
1.15449434
1.159396358
1.159715875
1.153119329
1.158113987
1.158448258
1.151673581
1.156776202
1.15712259
1.150168571
1.155392568
1.155749154
1.148612403
1.153970391
1.154335817
1.147012077
1.152515128
1.152888384
1.145373762
1.151030946
1.151411277
1.143702866
1.149524476
1.149909061
1.142013324
1.148020145
1.148387339
0.07949283274
0.06781879978
0.07680936669
0.4210948361
0.4295839753
0.4285361876
0.07936342672
0.09802502018
0.2222859196
0.1008065264
0.06742778226
0.06593063422
0.06964366746
0.0688602165
0.09072463854
0.07031279195
0.07193799013
0.07100718339
0.06743718148
0.06734133487
0.06901303977
0.1945906092
0.1898203118
0.1852222888
0.07891868418
0.08367959592
0.0715533669
0.06622958879
0.07610162005
0.07599828139
0.09137542537
0.1059524386
0.1059559637
0.07559452641
0.08714156982
0.09429920341
0.08802459746
0.07844361997
0.068494551
0.07711300381
0.08430262132
0.07833947957
0.06762716919
0.06541331929
0.07401427282
0.142682627
0.1384074742
0.1404549155
0.1294518356
0.131859611
0.1382301448
0.4536151291
0.4249062854
0.4408040749
0.1734776503
0.1673004837
0.1625577941
0.4342768138
0.4378797713
0.4537003934
0.4335273541
0.4485227865
0.4258070507
0.4633224342
0.4806794526
0.4426041957
0.1520951717
0.2062820476
0.2187481156
0.2252361061
0.1933859071
0.1905470978
0.3286077653
0.3139406513
0.3239515519
0.2985537507
0.3069925679
0.3188223749
0.1146836854
0.1139543266
0.1103843783
0.2092638149
0.2150802054
0.2216925051
0.1937125872
0.1888863186
0.1918673514
0.03545388235
0.04146499142
0.0412750692
0.2708561404
0.264930628
0.2521739438
0.214744165
0.2057878115
0.1924784915
0.2352958501
0.2217591709
0.2292336282
0.4359346099
0.4293250093
0.4431166119
0.4298140251
0.4395402202
0.4317750954
0.4425939784
0.4532936852
0.4803926746
0.4436048066
0.4588297931
0.4330029356
0.01049920722
0.0232844464
0.02726986747
0.04796489933
0.03811663243
0.01997871523
0.06306879432
0.057200959
0.04229940409
0.3022937225
0.2832745021
0.2913479814
0.07467374535
0.07426731148
0.07700797147
0.06160729395
0.06463858081
0.06385446378
0.1673157577
0.154901188
0.1453466351
0.1783561005
0.1663178726
0.1790254612
0.1366340539
0.1235828169
0.1222174369
0.1369478691
0.1291719647
0.1471462364
0.146512498
0.1468445883
0.1562445351
0.02919346704
0.03364996825
0.03602966895
0.0333865356
0.03077660885
0.0262307644
0.4219537051
0.4382555508
0.3420188209
0.4294450971
0.4447967403
0.4444613773
0.127232161
0.1758382039
0.1632835488
0.2521303571
0.2618453954
0.2411408713
0.08299895774
0.07551538867
0.06918061092
0.1729585476
0.1847615232
0.1779267669
0.03333157545
0.03094261105
0.02873702916
1.155313915
1.155217281
1.155142335
1.15547391
1.1553494
1.155414092
1.155780813
1.155795979
1.155944423
1.155198109
1.15497279
1.154934579
1.155056746
1.154990829
1.155177522
1.15628623
1.156066749
1.156471088
1.15570223
1.155184192
1.155377609
1.154981766
1.155064308
1.155505255
1.100360049
1.157363825
1.130862115
1.157097427
1.156254589
1.156624913
1.155606322
1.155910505
1.156639806
0.888392326
0.9774472255
0.8866282292
0.9951758042
1.099100851
1.043273543
1.157085465
1.112845562
1.024791309
0.732342825
0.7860140844
0.7128088443
0.8782554529
0.9694882775
0.9383689053
1.028382111
0.9851965078
0.8993569496
0.6354061647
0.6670751621
0.5989081653
0.8142646348
0.8906676365
0.8765996939
0.9242637665
0.9030012996
0.8251401893
0.5777883824
0.5938547285
0.5359379731
0.7885301649
0.8525798267
0.8527800413
0.8648971405
0.8604239341
0.7895011522
0.5590561603
0.5609536755
0.5098399154
0.7870459793
0.8411499511
0.8503105725
0.8440745043
0.8490711637
0.7823253501
0.5603958565
0.5532983884
0.507797939
0.803008019
0.8480653996
0.8637045138
0.842697437
0.8552724728
0.7907586201
0.5896094793
0.573184564
0.5344128704
0.8356720303
0.8709905482
0.8941444024
0.857088243
0.8756189832
0.8125078872
0.6445294746
0.6169247186
0.5841778288
0.8866438543
0.9189621929
0.9481851723
0.888365442
0.9163993651
0.854629594
0.7277562159
0.6891866023
0.6599224861
0.9454007342
0.9797259988
1.016770297
0.9460037564
0.9816002518
0.9054627273
0.8371782019
0.7891758164
0.7601017166
1.043724589
1.061125347
1.10974062
1.014110364
1.057615265
0.991642511
0.9659173114
0.9053100942
0.8958398806
1.16969221
1.171976705
1.172382386
1.115270514
1.171485951
1.122264794
1.133093057
1.051063446
1.06451873
1.171103631
1.173416996
1.173710317
1.1727697
1.173120096
1.170819879
1.162665822
1.162167094
1.15652058
1.171938054
1.174388784
1.174555998
1.17394152
1.174193988
1.171766027
1.16413373
1.163848556
1.158489189
1.172307678
1.174906317
1.174976155
1.17469737
1.174812275
1.172254544
1.16489807
1.164769145
1.15961976
1.172315288
1.175078583
1.175076486
1.175029356
1.175060171
1.172342526
1.165148922
1.165133782
1.160136721
1.172050129
1.174997676
1.174941548
1.175065172
1.175034014
1.17213802
1.165028829
1.165098146
1.16020947
1.171571923
1.174728064
1.174627484
1.174883673
1.174804377
1.171708809
1.164631764
1.164766049
1.159952212
1.170896744
1.174300698
1.174156071
1.174533986
1.174411491
1.171083858
1.16401386
1.164200406
1.159432833
1.16998546
1.173707226
1.173512653
1.174026582
1.173857704
1.170237457
1.163213105
1.163441984
1.158692646
1.168757253
1.172913102
1.172658548
1.173338188
1.17311478
1.169097034
1.16226087
1.162523781
1.157764916
1.167115569
1.171870199
1.171543145
1.172426141
1.172136663
1.16756716
1.161185732
1.161475486
1.156681194
1.164978113
1.170526582
1.170114774
1.17123924
1.170870732
1.165559064
1.160012851
1.160323627
1.155470875
1.16230879
1.168839424
1.168335411
1.169727988
1.169270114
1.163022441
1.158762839
1.159090118
1.154158859
1.159128418
1.166789527
1.166193492
1.167860052
1.167309011
1.159964582
1.157451436
1.157791955
1.152764817
1.155504885
1.164387196
1.163706843
1.165630886
1.16499066
1.156443385
1.156089774
1.15644128
1.151303285
1.151532103
1.161668943
1.16091699
1.163064804
1.162346105
1.15254852
1.154686274
1.155047028
1.1497848
1.147306917
1.158685761
1.15787632
1.160207463
1.159424026
1.148377955
1.153247382
1.153615905
1.148216858
1.142914053
1.155491319
1.154637381
1.157112464
1.156278267
1.144019933
1.1517775
1.152152728
1.146606482
1.138421087
1.152133799
1.151244689
1.153831888
1.152960277
1.139546998
1.150279017
1.150660619
1.14495899
1.133880426
1.148654517
1.147729652
1.150412039
1.149518671
1.135014197
1.148749667
1.149140149
1.143278291
1.129418724
1.145135231
1.143937879
1.146900444
1.145999808
1.130443117
1.147150267
1.147583979
1.141567813
0.07451227604
0.09027508794
0.09344083601
0.07977119846
0.07887137967
0.06854104574
0.1095026896
0.1047619664
0.09313226463
0.04216533259
0.04094714549
0.0363152176
0.009537272276
0.004205797992
0.000375646433
0.00946644652
0.004173088483
0.0003757386462
0.02098138876
0.007988937753
0.0004206368045
0.009668668763
0.003280921484
0.0005611842031
0.01064225122
0.007161611998
0.0005815430284
0.02108936336
0.007943761022
0.0004240099861
0.01048330383
0.007092140337
0.0005533832613
0.01025855571
0.005756842178
0.0005748708016
0.006992598561
0.001551982337
0.0003022147648
0.009689758904
0.003377922896
0.0005504251561
0.003807865278
0.005467519516
0.0004836131518
0.01009138577
0.004388621245
0.0003724051294
0.01017587654
0.004395655698
0.0003729240662
0.01008985542
0.004383562047
0.0003722622147
0.01005783788
0.004457971967
0.0003714726554
0.009857545655
0.004286549615
0.0003727270552
0.010477766
0.006743837066
0.000546174388
0.00963818643
0.004438175742
0.000373394836
0.001100347722
0.0002114170335
0.009507919657
0.004083596283
0.0003753572312
0.008700375575
0.005251764311
0.0009083168849
0.005384587285
0.006521786497
0.0005998569638
0.005367619766
0.006641643494
0.000607192779
0.005389702206
0.006992820231
0.0006202832611
0.007461109531
0.007497683035
0.0006444073163
0.007128208458
0.00762776957
0.0006488531757
0.007524176634
0.007574869722
0.0006440758343
0.007915572246
0.007292322272
0.0006373039409
0.01958282935
0.007253039019
0.0004110565801
0.01966459261
0.007318495257
0.0004138505287
0.01083806373
0.006392423854
0.0005463456854
0.01049046899
0.005993719643
0.0005579542582
0.01049292535
0.007068134641
0.0005866319697
0.01055296332
0.007152723347
0.0005841427266
0.01101361385
0.007221209825
0.0005671727974
0.02253667194
0.008576158987
0.0004417313921
0.02220904595
0.008439929387
0.0004375540126
0.01091366224
0.004802200469
0.0003746052876
0.01060944037
0.004628379462
0.0003752485486
0.01072612391
0.004718679087
0.0003748304242
0.01087230922
0.004788225919
0.0003746033646
0.0107744391
0.004737110865
0.0003747445107
0.01019090808
0.004402694553
0.0003730778888
0.01027328794
0.004492719972
0.000372705658
0.01055014944
0.004581525001
0.0003753853045
0.01040511711
0.004379614202
0.0003753402513
0.01032363212
0.004500457862
0.0003728151805
0.01038855987
0.00442580453
0.0003743334168
0.009968343461
0.004448160205
0.0003723294297
0.01003294837
0.004460206062
0.0003716045116
0.01109433603
0.00693831431
0.0005525576328
0.009925264869
0.004413345421
0.0003728398259
0.009826551362
0.00422047201
0.0003734964668
0.01094950352
0.006628630585
0.000545622036
0.01042566187
0.006491708456
0.0005463436818
0.009218182931
0.003824486107
0.0003740859623
0.0054763331
0.006016254021
0.0005768606341
0.005755197522
0.005455211028
0.0005363276116
0.005539174033
0.005827429594
0.0005644282585
0.005862404981
0.005288408584
0.0005278367519
0.005468165527
0.007354022849
0.0006364303521
0.005428795864
0.007035025355
0.0006247436622
0.005583994939
0.007380772699
0.0006378537411
0.006687365775
0.007874271477
0.000655336096
0.007005389597
0.007763041197
0.0006526558671
0.006595851118
0.007855030678
0.0006543615713
0.008004251154
0.007323185533
0.000635172049
0.00825100802
0.007494268682
0.0006245857279
0.008808890589
0.006991806621
0.0006186279157
0.008397814639
0.007364595935
0.0006253692614
0.008714352587
0.007072885375
0.0006196566558
0.01036759161
0.007236545019
0.0005699325499
0.01103975563
0.006736314345
0.0005502696617
0.00964273849
0.004335651984
0.0003740569623
0.009658071747
0.004374155071
0.0003733586508
0.009586284176
0.004216110011
0.0003746228108
0.009594572112
0.004191115318
0.0003744644314
0.009494121063
0.004187481625
0.0003752741704
0.009467875257
0.004124851208
0.0003756063084
0.02031822244
0.007501387279
0.0004183958456
0.01007513559
0.006080019897
0.0005532843787
0.009710372309
0.003284078796
0.0005660225502
0.01061482431
0.007158224953
0.0005823145498
0.02453364038
0.009478301923
0.0004723569294
0.02478444326
0.009740442989
0.0004825325174
0.02407831914
0.009226643051
0.0004625603914
0.0233542796
0.008956183548
0.0004531891833
0.02143345833
0.00808937933
0.0004287441881
0.01113807089
0.007012648745
0.0005529439328
0.009531121793
0.004212005793
0.0003752480196
0.009555726764
0.004254351751
0.0003750150602
0.01018005172
0.005668561001
0.0005703876518
0.009551327557
0.004251452138
0.0003750533998
0.009547057753
0.004303062662
0.0003748864839
0.009641463548
0.005471785866
0.0005945495461
0.00715585686
0.002656651272
0.0003458679653
0.009425510189
0.006942099791
0.0005925518094
0.01007204667
0.007212204451
0.0005784551245
0.01076658888
0.007378265284
0.0005801426915
0.005743955484
0.006137475066
0.001938880638
0.01013538583
0.00442270017
0.0003724253401
0.01015482168
0.004417075384
0.0003726120739
0.01008414644
0.004419209114
0.0003718779193
0.0100686889
0.004448657755
0.0003715650286
0.01057866169
0.006884359598
0.0005519329278
0.01107219697
0.006782970671
0.0005508778518
0.009862169465
0.004345806985
0.0003719246828
0.009683556797
0.004381983739
0.000373010826
0.009704606824
0.004379386194
0.0003723699189
0.009654812311
0.004421015604
0.0003727604439
0.009653913019
0.004311796647
0.0003735294962
0.009523078678
0.004353133652
0.0003743579021
0.00950465696
0.004207669232
0.0003751893102
0.008280820183
0.005374433986
0.0007858324892
0.008313042792
0.005275299222
0.0008486794509
0.005407749302
0.006422406219
0.0005940160682
0.005433396246
0.00626552773
0.0005908672675
0.005367461866
0.006761808526
0.0006117876158
0.005332909227
0.006917907522
0.0006184214444
0.007331351928
0.007645289694
0.0006485238216
0.007186479143
0.007719037947
0.0006486265093
0.007681562934
0.007514030044
0.0006418309798
0.007790476014
0.007345110285
0.0006411712174
0.02000810446
0.007396491106
0.0004163881599
0.01078921395
0.006317186926
0.0005464725133
0.01040890985
0.005987246613
0.0005541471751
0.004710161509
0.005796174231
0.000520821041
0.006254252551
0.00416464413
0.0005490352985
0.006758665263
0.003953155939
0.0005527024474
0.01059853448
0.007194708511
0.0005833499072
0.01110457998
0.007320342386
0.0005665441521
0.01042231806
0.007246513601
0.0005662003663
0.01108912881
0.007290659863
0.0005662387842
0.02582774495
0.01042426951
0.0005085235885
0.02528072204
0.01002369384
0.0004931349258
0.02773702127
0.0114101958
0.0005754339784
0.0263162125
0.0106901909
0.0005241161443
0.02670302931
0.01088451522
0.0005417436091
0.02296709706
0.008792823579
0.0004478787092
0.02167513695
0.008165703187
0.0004324937982
0.01094715299
0.004808037966
0.0003746188852
0.01064356915
0.004667453345
0.0003750470763
0.01069876144
0.00469897726
0.0003749523868
0.01084580612
0.004772456613
0.0003746455099
0.01080170531
0.004754572784
0.0003747296357
0.01027432608
0.004475783591
0.0003727480244
0.0105113464
0.004527262255
0.0003755808018
0.01041714397
0.004413464173
0.0003757487815
0.0103358434
0.004492382891
0.0003729550484
0.01037236507
0.004476815329
0.0003735487673
0.009986554928
0.004456840698
0.0003719947413
0.01001345466
0.00445512575
0.0003718210451
0.01112754599
0.006935229954
0.0005525553155
0.009896862861
0.004357405218
0.0003732846653
0.009820843072
0.004244093087
0.0003738033255
0.0108862529
0.006518241373
0.0005469376309
0.01094516645
0.006588162369
0.000546708343
0.00962278161
0.004408933213
0.0003730625461
0.00961041253
0.004350240666
0.0003740275619
0.01001758888
0.005692498682
0.0005698971759
0.009496269573
0.004217324553
0.0003747849277
0.009963358906
0.005453571686
0.0006025341761
0.01002060785
0.003349127973
0.000367295682
0.00568647841
0.005704040198
0.0005544044189
0.00562542856
0.005783440744
0.0005577105835
0.00596004571
0.005173683832
0.00051996883
0.00548923222
0.007234590545
0.0006317852286
0.005413336062
0.007145225542
0.0006302533128
0.005591350699
0.00745357454
0.0006420600411
0.005667387171
0.007495316533
0.0006432523698
0.006814950846
0.007756016195
0.0006510050767
0.006865855804
0.0078329134
0.000652344623
0.006534540348
0.007778627192
0.0006531068195
0.006421297506
0.007789746567
0.0006574398121
0.008208680261
0.007301789199
0.0006274960284
0.008891106153
0.006909697159
0.0006153989752
0.008518950538
0.007128126395
0.0006247608916
0.008617730806
0.00707462938
0.000623344577
0.01081331094
0.007156094602
0.0005822670892
0.01080841321
0.007310700137
0.0005814173886
0.01079166336
0.007444153642
0.0005795028724
0.0002343007054
0.01048458141
0.007206102042
0.0005628648186
0.0110252869
0.007181720225
0.000561861276
0.002985586057
0.003068461968
0.0009865458335
0.002748938324
0.00231066339
0.0006675171223
0.002824306153
0.002199879633
0.0005519785327
0.01849863421
0.006887285499
0.0004057489632
0.01824600679
0.006823108732
0.000404164036
0.01667059888
0.006324576306
0.0003944277309
0.01111327548
0.007013980078
0.0005549510636
0.0105549277
0.006099078199
0.0005496893394
0.01057778305
0.006075129142
0.0005494980311
0.01028905768
0.007270455134
0.0005862131938
0.0103445458
0.00739501868
0.0005855869392
0.01508703921
0.005889063075
0.0003874849708
0.01642284118
0.006246400759
0.0003937335744
0.01302065338
0.005400287413
0.0003793170031
0.01386421602
0.00563787203
0.0003816674139
0.01491797449
0.005862576515
0.0003868673356
0.01397412612
0.005647808468
0.0003821389675
0.01296779073
0.005351205348
0.0003785007634
0.01251052878
0.005462759984
0.000374481903
0.01243777587
0.005458747887
0.0003742970758
0.008174223214
0.004499027649
0.0008275251197
0.007493404522
0.003959668059
0.000506623229
0.009810984657
0.006968979539
0.0005900582966
0.009733584422
0.007009057333
0.0005917859017
0.01000810396
0.01020089734
0.001038909761
0.008124941995
0.008009921123
0.001448732603
0.01112636102
0.007078324444
0.0005606274063
0.01040663118
0.00672498339
0.0005483651003
0.009818269603
0.004365312326
0.0003717541938
0.01098647251
0.006719413359
0.0005461793363
0.00981405989
0.004366637291
0.0003719757217
0.009711665316
0.004241555634
0.0003730425067
0.008722609092
0.005285663703
0.0007045799582
0.005068526452
0.0005505817323
0.009146302687
0.005327073034
0.0007305279028
0.005956853734
0.007758480951
0.0006550712399
0.005647115925
0.007667260691
0.0006508753524
0.00579559712
0.007676161101
0.0006499794925
0.005966752514
0.007936647787
0.000657084548
0.006383649268
0.007762572975
0.0006558201015
0.006265274206
0.007812276712
0.0006594688648
0.01087109979
0.00718288154
0.0005697347779
0.01213549875
0.01224857113
0.0008988126039
0.02484600448
0.01223753601
0.0006487964847
0.01758338941
0.006647176594
0.0003991183463
0.01730162443
0.00651069539
0.0003982672684
0.01046547998
0.007072184238
0.0005596578742
0.009746924583
0.007139330694
0.0005862648176
0.02771662207
0.01179502891
0.0006102090273
0.01564625596
0.006061973445
0.0003895414409
0.0157782247
0.006060192163
0.0003912523987
0.01342648445
0.005563250325
0.0003797824676
0.01352996418
0.0055872418
0.0003800666405
0.01455457692
0.005800490823
0.000383572774
0.01437624008
0.005796174715
0.0003826837405
0.01277192993
0.005469436022
0.0003757070931
0.01269975634
0.005471409942
0.0003752495267
0.01219749634
0.005421587525
0.0003740970103
0.01227616522
0.005429355401
0.0003741718895
0.01024582266
0.004438476459
0.000372913261
0.00971518859
0.004365905962
0.0003713562882
0.009708323612
0.004376343727
0.0003720496918
0.009728059858
0.004357317859
0.000371377501
0.0097085382
0.004205331189
0.0003730695287
0.009822715658
0.005849993433
0.0005638650662
0.009198739405
0.005363173693
0.0006327194337
0.009096499092
0.005427524236
0.0006154767232
0.00884902608
0.003499586202
0.0005326383562
0.008338569183
0.003554702477
0.0005198979867
0.008119858019
0.007298702963
0.0006296137784
0.009983661374
0.007133554367
0.0005881569793
0.01092349242
0.007245349733
0.0005751040751
0.01101878747
0.007299708731
0.0005686445191
0.01092680262
0.007211207133
0.0005755381529
0.0044327537
0.004764287336
0.002052895399
0.01113660365
0.007323355609
0.0005633638211
0.0111769032
0.007232899145
0.0005601702843
0.01884077984
0.007035935519
0.0004068375153
0.01926752569
0.007133619845
0.000408350425
0.0180349268
0.006768106949
0.0004023004412
0.0169481102
0.006477689329
0.0003954529132
0.01114931687
0.007028605656
0.0005563676916
0.01020849065
0.006172912077
0.0005469655249
0.008113893532
0.003582323889
0.0005608670583
0.01022274053
0.007147900462
0.0005843418557
0.01036273422
0.007271105048
0.0005868143403
0.009924249593
0.007124065988
0.0005878212365
0.01526993898
0.005944005303
0.0003879725586
0.01621840254
0.006184833638
0.0003932485189
0.01319852616
0.00550665315
0.0003794100774
0.01373810827
0.00561397776
0.0003809985588
0.01475702517
0.005804975481
0.000386035766
0.01414509558
0.005659800967
0.0003825064417
0.01291446248
0.005447765996
0.0003772731009
0.01256152199
0.005463057431
0.0003746530122
0.01215165652
0.005380319273
0.000374082772
0.01208761328
0.005385604184
0.0003741097707
0.01238578924
0.005448413649
0.0003742536353
0.01120120536
0.004830679722
0.000375830936
0.01124730021
0.004843676609
0.0003760829153
0.01159147878
0.005106922592
0.0003751938132
0.01156495354
0.005123610698
0.0003750290565
0.01203398088
0.005396041123
0.0003740340149
0.01200890711
0.005417436949
0.0003741304571
0.01164499416
0.005098546694
0.0003754597509
0.0116850612
0.00508344859
0.0003757025093
0.01117230722
0.004845995207
0.0003754168429
0.011116955
0.004851259718
0.0003751729106
0.009565421471
0.005627784661
0.0005851271196
0.008207038184
0.005653666312
0.001099028438
0.009249919871
0.00333357198
0.0005477439974
0.00772635543
0.003725377497
0.0005056948391
0.007159647777
0.004176565784
0.0004980877169
0.006943674853
0.004308207197
0.0004978888601
0.009087606889
0.006970583043
0.0006083874288
0.008951894568
0.007006067959
0.0006112694491
0.0098787729
0.006962312447
0.0005908139573
0.00917048171
0.00687085461
0.0006079996231
0.009267279338
0.006801058785
0.0006057187629
0.003814117889
0.003377185189
0.0004715528346
0.01105539158
0.007228751298
0.0005638582474
0.01116013071
0.007357517552
0.0005624464037
0.01116635102
0.007186450527
0.0005614597633
0.009844010831
0.004369169171
0.0003717645475
0.01103582381
0.006792451978
0.000544017503
0.01100139002
0.006870726904
0.0005443077965
0.009790458734
0.004361977902
0.0003720802814
0.009771853999
0.004332173852
0.000372585429
0.009563649848
0.004227928275
0.0003743672372
0.008608975198
0.005289078801
0.0006738006075
0.005906815798
0.007693273161
0.0006523137369
0.005828959978
0.007646768372
0.0006519457458
0.00612689547
0.007858046099
0.0006551649251
0.006158272068
0.007883392003
0.0006572732454
0.01999704982
0.0128757029
0.0006993880305
0.01525702668
0.01352549535
0.0007731581552
0.01779529229
0.006700262927
0.0004004777594
0.01706597189
0.006457265319
0.0003970678562
0.01113512091
0.007033301054
0.0005566389507
0.01073559694
0.006280142546
0.0005433842039
0.01068002554
0.006274969332
0.0005459279471
0.01065518888
0.006226180457
0.0005447536106
0.01021297714
0.006265636854
0.000546138073
0.005223619815
0.004821320375
0.0005404446759
0.01015941116
0.007100347162
0.0005868074374
0.01548087976
0.006017821287
0.0003884608325
0.01595550355
0.006083568327
0.0003924496279
0.01330631729
0.005539264829
0.0003794851216
0.01364075022
0.005601859378
0.0003805284222
0.01460296373
0.005801434386
0.0003848932942
0.01431824196
0.005742083473
0.0003824551082
0.01283110644
0.005465380873
0.00037630728
0.01264016338
0.00546730316
0.000374939117
0.01220379103
0.005397931783
0.0003741182143
0.01231079088
0.005435239052
0.0003741798576
0.01137523293
0.004966341748
0.0003758227961
0.0113101991
0.004900659516
0.0003760395576
0.01143340918
0.00503243181
0.0003754839566
0.01150203866
0.00510000542
0.0003752619998
0.01186146384
0.005269168838
0.0003751123193
0.01193527913
0.00536595356
0.0003745242161
0.01180512874
0.005183282697
0.000375589267
0.0117255418
0.005106876732
0.0003758414085
0.0110306832
0.00482559315
0.000374929657
0.01108751187
0.004838710709
0.0003750172294
0.01103761812
0.004813341641
0.0003747462074
0.01100178363
0.004809529038
0.0003746646151
0.009715164606
0.004369749492
0.0003715841244
0.00969497572
0.004379718817
0.0003717278575
0.009730768091
0.004323579438
0.0003717325331
0.009726794713
0.004250712791
0.000372510448
0.009604326792
0.005318976529
0.0006491597392
0.007862869925
0.005432236358
0.001020453026
0.00797836568
0.005406665295
0.00110727043
0.009126280525
0.003407858965
0.0005363152006
0.00808613267
0.003602387637
0.000520916999
0.006482486784
0.004556728024
0.0005025960764
0.006694760872
0.004413172056
0.0004963122046
0.006317633943
0.00476656314
0.0005124478399
0.006156042705
0.004991901959
0.0005171609574
0.00993005296
0.006990257854
0.0005869381694
0.009410558862
0.006888414558
0.0005996308008
0.009348642846
0.006870369672
0.0006025509633
0.009500447562
0.006852959018
0.0005983190117
0.009539344962
0.006840535813
0.0005961909482
0.01083111635
0.00713381739
0.0005773724437
0.0102051793
0.007109341687
0.0005807702193
0.01102724608
0.007309218092
0.0005691847483
0.01103681421
0.007396838036
0.0005690303411
0.01092650163
0.007143855018
0.0005748629497
0.01026456619
0.007127252124
0.0005737121668
0.003107535961
0.002424527421
0.0004938443349
0.0009021480627
)
;
boundaryField
{
topAndBottom
{
type calculated;
value nonuniform List<scalar>
72
(
1.15588419
1.155890126
1.155123897
1.15515389
1.154334573
1.154404027
1.15352105
1.153654208
1.152691435
1.152885866
1.151854146
1.152100011
1.15100882
1.151288406
1.150217582
1.150474979
1.149486217
1.14971553
1.148897583
1.149085181
1.148447957
1.148658693
1.148195802
1.148476051
1.148079995
1.148559229
1.148148348
1.148876267
1.148278502
1.149342227
1.148519644
1.149932303
1.148721434
1.150499097
1.148965267
1.151062979
1.149099169
1.151499021
1.149249875
1.15187111
1.149258855
1.152075178
1.149292884
1.152222067
1.149173491
1.152195221
1.149102845
1.152151361
1.14887384
1.151940602
1.148722334
1.151762046
1.148411137
1.151419914
1.148202386
1.151153957
1.147839518
1.150725998
1.147587048
1.150400897
1.147206462
1.149931886
1.146905468
1.149549114
1.146552523
1.149098757
1.146171675
1.148618079
1.145911038
1.148281124
1.145390144
1.14761854
)
;
}
inlet
{
type calculated;
value nonuniform List<scalar>
40
(
1.15625
1.15625
1.15625
1.15625
1.15625
1.15625
1.15625
1.15625
1.15625
1.15625
1.15625
1.09345025
1.024093546
1.058431297
1.15625
1.15625
1.15625
1.15625
1.15625
1.15625
1.15625
1.15625
1.15625
1.15625
1.15625
1.15625
1.15625
1.15625
1.15625
1.15625
1.044839486
1.028668296
1.115188922
1.15625
1.15625
1.15625
1.15625
1.15625
1.15625
1.15625
)
;
}
outlet
{
type calculated;
value nonuniform List<scalar>
62
(
1.145390144
1.146175406
1.148632423
1.153687427
1.154708743
1.150785655
1.148507734
1.14761854
1.10461215
0.9766989453
0.9114917699
0.6521658302
0.5507895548
0.2483173555
0.1616514884
0.1253262259
0.1825102573
0.3614128229
0.4206065413
0.5954290044
0.6518424819
0.8090990003
0.8558337351
0.9742210799
1.005965712
1.07895144
1.096571146
1.133257284
1.159359187
1.16322743
1.166207339
1.166334716
1.15967157
1.127910123
1.141080426
1.154138926
1.158737502
1.160213755
1.159677256
1.157973672
1.07251836
1.030221706
0.8348259291
0.7477505872
0.4470494806
0.3448741094
0.09956372274
0.08770696051
0.2421449925
0.3019129955
0.4794541471
0.5378255071
0.7066297115
0.7592183845
0.8990758352
0.9385825857
1.033889357
1.05814532
1.111294625
1.123423447
1.143937879
1.147150267
)
;
}
wing
{
type nutkWallFunction;
Cmu 0.09;
kappa 0.41;
E 9.8;
value nonuniform List<scalar>
378
(
0.0006946442639
0.0001862445637
0.0001862858466
0.0001918573498
0.0002902978781
0.0002384634797
0.0001919752399
0.0002129305766
0.0001699273975
0.0001400514416
0.0002855996616
0.000293514235
0.0001829803123
0.0001830328816
0.0001829767493
0.0001830933128
0.0001831778733
0.0002013570838
0.000185901671
8.489492731e-05
0.0001864109289
0.0001419753765
0.0002804522365
0.0002818881546
0.0002842762343
0.0002779559027
0.0002808059223
0.0002774747669
0.0002733978025
0.0001906056399
0.0001908442002
0.0001945308661
0.000177990677
0.0002414614484
0.0002406184087
0.0002261736503
0.0001935862405
0.0001933001961
0.0001839890215
0.0001838976896
0.0001839801603
0.0001839977644
0.0001839892527
0.0001830766694
0.0001831633541
0.0001838220886
0.0001834083376
0.0001831849138
0.000183277997
0.0001833413416
0.0001831626097
0.0002101544984
0.000183382929
0.0001831803682
0.0001998701398
0.0001960880123
0.0001854060683
0.0002745899309
0.0002662809993
0.0002719425423
0.0002644985847
0.0002865346173
0.0002847033904
0.000286367225
0.0002845859471
0.0002824186332
0.000284747696
0.0002724575403
0.0002691927457
0.0002627740858
0.0002683837679
0.0002639613191
0.0002272950249
0.0002065766394
0.0001846257159
0.0001845083479
0.0001845819791
0.000184591505
0.0001860958089
0.0001863197902
0.0001915768781
0.0001811495545
0.0002933571084
0.0002391549592
0.0001959851183
0.000196870298
0.0001953177532
0.0001945281013
0.0001923763288
0.0002120107899
0.0001852630576
0.0001852713836
0.0001711480483
0.0001853442221
0.0001854828011
0.000164851923
0.0001687105384
0.0002498128248
0.0002375296692
0.0002379310034
0.0002197321187
0.0001830138117
0.0001830153519
0.0001829967538
0.000183037059
0.0002089523304
0.0002076222054
0.0001832090339
0.0001844372788
0.0001842701047
0.0001849073006
0.0001847330731
0.0001860915574
0.0001864969074
0.0001476670219
0.0001444399561
0.0002793335736
0.000278357639
0.0002827136279
0.0002842240815
0.0002797252025
0.0002804642626
0.000276272318
0.0002750244564
0.000191197803
0.0001931971518
0.0001790953674
0.0002988710899
0.0003001247966
0.0002993205773
0.0002399811733
0.000225754507
0.0002242740097
0.0002250943847
0.0001987157425
0.0001976221215
0.0002023984525
0.0001993207555
0.0002001539892
0.0001941805384
0.000192688736
0.0001839887631
0.0001839351067
0.0001839718611
0.0001840065627
0.0001840087049
0.0001831607676
0.0001837413059
0.0001835711566
0.0001831817953
0.0001832338766
0.0001832784388
0.0001832260029
0.000211041752
0.0001833584253
0.0001832574221
0.0001976320725
0.0001989020835
0.0001850772126
0.0001852201553
0.0001733814853
0.0001854332057
0.000162837327
0.000181420428
0.0002711063036
0.0002712671435
0.0002629844961
0.0002856878948
0.0002856168151
0.0002868995676
0.0002867924702
0.0002830210007
0.0002830124716
0.00028462453
0.0002859831092
0.0002697621879
0.0002611528278
0.000266815121
0.0002654763627
0.0002360345484
0.0002369708809
0.0002375671495
6.926306039e-05
0.0002212378772
0.0002203104265
0.0002487501088
0.000262263014
0.0002703816822
0.000189849086
0.0001895505502
0.0001880250778
0.0002138352906
0.0001840883336
0.0001825645067
0.0002444064011
0.0002441577066
0.0001862006718
0.0001878064594
0.0001836936791
0.0001847023368
0.0001859905267
0.0001848277094
0.000183490571
0.0001833082242
0.0001833428009
9.914485511e-05
0.0002625317355
0.0002481632421
0.0002492057195
0.0002108230116
0.0002131496226
0.0002178738326
0.0002051552245
0.0001833029015
0.0002038853684
0.0001833908433
0.0001834359885
0.0001506360302
6.683651536e-05
0.0001490122614
0.0002881185322
0.0002885218386
0.0002879644941
0.0002887422051
0.0002861737411
0.0002875814956
0.0002292633266
0.0002105301074
0.0002056709353
0.0001888802335
0.0001886650292
0.0002168498719
0.0002456228835
0.0002037513061
0.0001867628719
0.0001870081189
0.0001841672913
0.0001842818085
0.0001853834663
0.000185303059
0.0001832613208
0.0001832450153
0.0001835884808
0.0001835269714
0.0001831345525
0.0001837335478
0.0001841421061
0.0001836237027
0.0001833992444
0.0001758384145
0.0001577924073
0.0001602934551
0.0002746289019
0.0002689968279
0.0002707025943
0.0002464814256
0.0002329133203
0.0002289458074
0.0002322963005
0.000231598324
0.0002223204016
0.0002195452392
0.000190116939
0.0001903467322
0.0001893044764
0.000188187576
0.0002148363163
0.0001856221029
0.0002975214535
0.0002441279056
0.0002436472803
0.0002426389445
0.0001864350592
0.0001875705857
0.000183898484
0.0001845440835
0.0001857606107
0.0001850333374
0.0001833669207
0.0001832715994
0.000183741731
0.0001838492383
0.0001833994856
0.000184097291
0.0001841581628
0.0001841963004
0.0001842268247
0.0001839201218
0.0001840373654
0.0001841880316
0.0001841749404
0.0001840484723
0.0001840317899
0.0001677586303
0.0001296681948
0.0002817914214
0.0002625567867
0.0002602574712
0.0002596926362
0.0002583476571
0.000259819973
0.0002475340848
0.0002571334377
0.00025554781
0.0002852483981
0.0002232628633
0.000222785743
0.0002189601491
0.0001832774034
0.0002029781944
0.0002023997251
0.0001834294982
0.0001834915397
0.0001856047553
0.0001529368823
0.0002876314019
0.0002879332644
0.0002878328724
0.0002878081981
0.0002079303009
0.0002084723448
0.0001890885428
0.0001884026719
0.0002155658912
0.0001883679708
0.000187468798
0.000189596704
0.0001913888344
0.0003007232448
0.0002450472582
0.0001866146491
0.0001872797126
0.0001840256186
0.0001844171751
0.0001855462773
0.0001852109367
0.0001833025643
0.0001832588828
0.0001836604995
0.0001834504678
0.0001842567939
0.0001842209077
0.0001842684875
0.0001842820115
0.0001841852084
0.0001841257054
0.0001842068879
0.0001841966732
0.0001839953358
0.0001840076855
0.000183978372
0.0001839865826
0.0001838797095
0.0001839965491
0.0001835079227
0.0001834312374
0.000155761306
0.0001405915498
0.0001359886191
0.000277620111
0.0002673805497
0.0002591337175
0.0002582865229
0.0002616180529
0.0002627984153
0.000246306042
0.0002531277476
0.0002543345285
0.000252065773
0.0002509049138
0.0002336227174
0.000234805752
0.0002280385038
0.0002287022648
0.0002313583186
0.0002304196245
0.0002793130366
0.0001076326647
)
;
}
front
{
type empty;
}
back
{
type empty;
}
}
// ************************************************************************* //
| [
"ishantamrakat24@gmail.com"
] | ishantamrakat24@gmail.com | |
f6da5b325fcf806bfbe8c4820ceb377b844dbd53 | 54294d1fe7dc7c18f769597e82655d834a362772 | /ex3/main.cpp | 507fc03b8f48893782b9d10b5dfa7e1dc0849b29 | [] | no_license | h3shiri/CPP_Workshop | 3e104a0e5c1baa6cec652818ba1e280a32eddcab | b72ccb3acf32a3d1f1e203f10084dadec7cd748c | refs/heads/master | 2020-09-17T05:34:29.256582 | 2016-09-22T17:41:43 | 2016-09-22T17:41:43 | 67,338,185 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 441 | cpp |
#include "Matrix.hpp"
using namespace std;
int main()
{
int myMat[] = {1, 2, 3 ,4 , 5, 6};
vector<int> myVec = vector<int>();
for(int i = 0; i< 6; ++i)
{
myVec.push_back(myMat[i]);
}
Matrix<int> mat1 = Matrix<int>(2, 3, myVec);
Matrix<int> mat2 = Matrix<int>(3, 2, myVec);
Matrix<int> mat3 = Matrix<int>(2, 2);
mat3 = (mat1 * mat2);
cout << mat3;
cout << (mat1.trans());
return 0;
} | [
"h3shiri@gmail.com"
] | h3shiri@gmail.com |
16635451e5677bd16715b821c1f8cd2c7b60be1b | ff6d4b70caa643be0ad1212ab7bda52b095aa560 | /BreakPointsDlg.h | d71881a80fde92bde989578518b62bf830f3c251 | [] | no_license | watsonjiang/iehttpheaders | cf8b3186030bf50edfd7711b8f3576fba26d16c9 | 14a1735249c6b6231528920b6803086da6adbaaf | refs/heads/master | 2020-07-02T04:42:33.750603 | 2019-08-13T05:02:16 | 2019-08-13T05:02:16 | 201,419,175 | 0 | 0 | null | 2019-08-09T07:50:50 | 2019-08-09T07:50:49 | null | UTF-8 | C++ | false | false | 800 | h | // aboutdlg.h : interface of the CAboutDlg class
//
/////////////////////////////////////////////////////////////////////////////
#pragma once
class CBreakPointsDlg : public CDialogImpl<CBreakPointsDlg>
{
public:
enum { IDD = IDD_BREAKPOINTS };
BEGIN_MSG_MAP(CBreakPointsDlg )
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
COMMAND_HANDLER(IDOK, BN_CLICKED, OnBnClickedOk)
COMMAND_HANDLER(IDCANCEL, BN_CLICKED, OnBnClickedCancel)
END_MSG_MAP()
LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
LRESULT OnBnClickedOk(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
LRESULT OnBnClickedCancel(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
private:
};
| [
"jonas.blunck@blunck.se"
] | jonas.blunck@blunck.se |
5cfe975ef3de1d578c9296d2c937dc6a6d387047 | 36779e6fbd26233be5e636e8cc01e27fa5e0366b | /LibrariesArgoUML_0_13_1/antlr-2.7.2/lib/cpp/src/dll.cpp | 9e3f1674265e8f38c5fd024d91c92da8e7a2740e | [
"ANTLR-PD"
] | permissive | BackupTheBerlios/ccl-plugin | 0e01b1a010cb03cddc2528d41f14cca9a2858d37 | 9be0fac3a3c95c362b3defb956302976b55d7870 | refs/heads/master | 2016-09-06T15:22:47.637350 | 2003-07-12T18:48:29 | 2003-07-12T18:48:29 | 40,255,269 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 567 | cpp | /* ANTLR Translator Generator
* Project led by Terence Parr at http://www.jGuru.com
* Software rights: http://www.antlr.org/RIGHTS.html
*
* $Id: dll.cpp,v 1.1 2003/07/12 18:40:46 layekers Exp $
*/
/*
* DLL stub for MSVC 6. Based upon versions of Stephen Naughton and Michael
* T. Richter
*/
#if _MSC_VER > 1000
# pragma once
#endif // _MSC_VER > 1000
// Exclude rarely-used stuff from Windows headers
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
BOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved )
{
return TRUE;
}
| [
"layekers"
] | layekers |
6c8586d42aa146504ec8b303be551ac056b4ce0a | f3b47f853b0b76bcf402c145c3a17373f2ffec8c | /cpp/include/kdac.h | 879a2960e8c30a007da1807172a73fffa382d10c | [
"MIT"
] | permissive | yiskylee/NICE | fb11ec146001e249375b2adf8ba02eabbe7874c7 | bdd625bf431fe29919b39207ca20a06cc7399ff9 | refs/heads/develop | 2021-04-12T03:41:24.786124 | 2018-01-25T21:07:10 | 2018-01-25T21:07:10 | 57,996,618 | 3 | 18 | MIT | 2018-01-25T21:07:12 | 2016-05-03T19:36:23 | C++ | UTF-8 | C++ | false | false | 23,005 | h | // The MIT License (MIT)
//
// Copyright (c) 2016 Northeastern University
//
// 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.
// Kernel Dimension Alternative Clustering (KDAC base class)
// Please refer to the paper published in PAMI by Liu, Dy and Jordan at:
// http://people.eecs.berkeley.edu/~jordan/papers/niu-dy-jordan-pami.pdf
// We try to follow naming conventions in the paper as much as possible.
// The lower cased variable names is the same as in the paper, and the
// upper cased matrix variable names in the paper are converted to lower
// case suffixed with "_matrix". For example:
// matrix U in the paper is named u_matrix in this implementation.
#ifndef CPP_INCLUDE_KDAC_H_
#define CPP_INCLUDE_KDAC_H_
#include <tgmath.h>
#include <functional>
#include <vector>
#include <cmath>
#include <valarray>
#include <numeric>
#include <limits>
#include "include/matrix.h"
#include "include/vector.h"
#include "include/cpu_operations.h"
#include "include/gpu_operations.h"
#include "include/svd_solver.h"
#include "include/kmeans.h"
#include "Eigen/Core"
#include "include/util.h"
#include "include/kernel_types.h"
#include "include/kdac_profiler.h"
namespace Nice {
template<typename T>
class KDAC {
public:
/// This is the default constructor for KDAC
/// Number of clusters c and reduced dimension q will be both set to 2
KDAC() :
c_(2),
q_(2),
n_(0),
d_(0),
lambda_(1),
alpha_(1.0),
kernel_type_(kGaussianKernel),
constant_(1.0),
u_converge_(false),
w_converge_(false),
u_w_converge_(false),
threshold1_(0.01),
threshold2_(0.01),
x_matrix_(),
w_matrix_(),
pre_w_matrix_(),
y_matrix_(),
y_matrix_temp_(),
y_matrix_tilde_(),
d_matrix_(),
d_matrix_to_the_minus_half_(),
d_ii_(),
d_i_(),
didj_matrix_(),
k_matrix_(),
k_matrix_y_(),
u_matrix_(),
pre_u_matrix_(),
u_matrix_normalized_(),
l_matrix_(),
h_matrix_(),
gamma_matrix_(),
g_of_w_(),
clustering_result_(),
verbose_(false),
debug_(false),
max_time_exceeded_(false),
max_time_(72000) {}
~KDAC() {}
KDAC(const KDAC &rhs) {}
// Set the number of clusters c
void SetC(int c) { c_ = c; }
// Set user-defined W
void SetW(const Matrix<T> &w_matrix) {
if (w_matrix.cols() != q_ || w_matrix.rows() != d_) {
std::cerr << "Matrix W must be a " << d_ << " * " << q_ << " matrix\n";
exit(1);
}
w_matrix_ = w_matrix;
}
// Set lambda for HSIC
void SetLambda(float lambda) { lambda_ = lambda; }
/// Set the reduced dimension q
void SetQ(int q) { q_ = q; }
/// Set thresholds
void SetThreshold1(float thresh1) { threshold1_ = thresh1; }
void SetThreshold2(float thresh2) { threshold2_ = thresh2; }
/// Set time limit before breaking out of the program
void SetMaxTime(int max_time) { max_time_ = max_time; }
/// Set the kernel type: kGaussianKernel, kPolynomialKernel, kLinearKernel
/// And set the constant associated the kernel
void SetKernel(KernelType kernel_type, float constant) {
kernel_type_ = kernel_type;
constant_ = constant;
}
void SetVerbose(bool verbose) { verbose_ = verbose; }
void SetDebug(bool debug) { debug_ = debug; }
int GetD(void) { return d_; }
int GetN(void) { return n_; }
int GetQ(void) { return q_; }
int GetC(void) { return c_; }
Matrix<T> GetU(void) { return u_matrix_; }
Matrix<T> GetW(void) { return w_matrix_; }
Matrix<T> GetUNormalized(void) { return u_matrix_normalized_; }
Matrix<T> GetL(void) { return l_matrix_; }
Matrix<T> GetDMatrix(void) { return d_matrix_; }
Matrix<T> GetDToTheMinusHalf(void) { return d_matrix_to_the_minus_half_; }
Matrix<T> GetK(void) {
GenKernelMatrix();
return k_matrix_;
}
Matrix<T> GetY(void) { return y_matrix_; }
Matrix<T> GetYTilde(void) { return y_matrix_tilde_; }
Matrix<T> GetGamma(void) { return gamma_matrix_; }
KDACProfiler GetProfiler(void) { return profiler_; }
void OutputProgress() {
if (u_converge_ && !w_converge_)
std::cout << "U Converged | W Not Converged" << std::endl;
else if (!u_converge_ && w_converge_)
std::cout << "U Not Converged | W Converged" << std::endl;
else if (!u_converge_ && !w_converge_)
std::cout << "U Not Converged | W Not Converged" << std::endl;
else
std::cout << "U Converged | W Converged" << std::endl;
}
/// This function can be used when the user is not satisfied with
/// the previous clustering results and want to discard the result from
/// the last run so she can re-run Fit with new parameters
void DiscardLastRun() {
if (debug_)
util::Print(y_matrix_, "y_matrix_before");
Matrix<T> y_matrix_new = Matrix<T>::Zero(n_, y_matrix_.cols() - c_);
y_matrix_new = y_matrix_.leftCols(y_matrix_.cols() - c_);
y_matrix_ = y_matrix_new;
if (debug_)
util::Print(y_matrix_, "y_matrix_after");
}
/// This function creates the first clustering result
/// \param input_matrix
/// The input matrix of n samples and d features where each row
/// represents a sample
/// \return
/// It only generates the clustering result but does not returns it
/// Users can use Predict() to get the clustering result returned
void Fit(const Matrix<T> &input_matrix) {
profiler_.fit.Start();
profiler_.exit_timer.Start();
PROFILE(Init(input_matrix), profiler_.init);
// When there is no Y, it is the the first round when the second term
// lambda * HSIC is zero, we do not need to optimize W, and we directly
// go to kmeans where Y_0 is generated. And both u and v are converged.
PROFILE(OptimizeU(), profiler_.u);
PROFILE(RunKMeans(), profiler_.kmeans);
profiler_.fit.Stop();
}
// Fit() with an empty param list can only be run when the X and Y already
// exist from the previous round of computation
void Fit(void) {
// Only changes w_matrix and y_tilde matrix
profiler_.fit.Start();
profiler_.exit_timer.Start();
PROFILE(Init(), profiler_.init);
while (!u_w_converge_ && !max_time_exceeded_) {
pre_u_matrix_ = u_matrix_;
pre_w_matrix_ = w_matrix_;
PROFILE(OptimizeU(), profiler_.u);
PROFILE(OptimizeW(), profiler_.w);
u_converge_ = util::CheckConverged(u_matrix_, pre_u_matrix_, threshold2_);
w_converge_ = util::CheckConverged(w_matrix_, pre_w_matrix_, threshold2_);
u_w_converge_ = u_converge_ && w_converge_;
if (verbose_)
OutputProgress();
}
PROFILE(RunKMeans(), profiler_.kmeans);
if (verbose_)
std::cout << "Kmeans Done" << std::endl;
profiler_.fit.Stop();
}
/// This function creates an alternative clustering result
/// Must be called after \ref Fit(const Matrix<T> &input_matrix)
/// when the first clustering result is generated
/// \param input_matrix
/// The input matrix of n samples and d features where each row
/// represents a sample
/// \param y_matrix
/// The binary matrix of n x (c0 + c1 + c2 + ...) which represent
/// the previous cluster assignments
/// \return
/// It only generates the clustering result but does not returns it
/// Users can use Predict() to get the clustering result returned
void Fit(const Matrix<T> &input_matrix, const Matrix<T> &y_matrix) {
// This is called when we have exsiting labels Y
// now we are generating an alternative view with a
// given Y_previous by doing Optimize both W and U until they converge
// Following the pseudo code in Algorithm 1 in the paper
profiler_.fit.Start();
profiler_.exit_timer.Start();
PROFILE(Init(input_matrix, y_matrix), profiler_.init);
while (!u_w_converge_ && !max_time_exceeded_) {
pre_u_matrix_ = u_matrix_;
pre_w_matrix_ = w_matrix_;
PROFILE(OptimizeU(), profiler_.u);
PROFILE(OptimizeW(), profiler_.w);
u_converge_ = util::CheckConverged(u_matrix_, pre_u_matrix_, threshold2_);
w_converge_ = util::CheckConverged(w_matrix_, pre_w_matrix_, threshold2_);
u_w_converge_ = u_converge_ && w_converge_;
if (verbose_)
OutputProgress();
}
PROFILE(RunKMeans(), profiler_.kmeans);
if (verbose_)
std::cout << "Kmeans Done" << std::endl;
profiler_.fit.Stop();
}
/// Running Predict() after Fit() returns
/// the current clustering result as a Vector of T
/// \return
/// A NICE vector of T that specifies the clustering result
Vector<T> Predict(void) {
if (clustering_result_.rows() == 0) {
std::cerr << "Fit() must be run before Predict(), exiting" << std::endl;
exit(1);
} else {
return clustering_result_;
}
}
protected:
int c_; // cluster number c
int q_; // reduced dimension q
int n_; // number of samples in input data X
int d_; // input data X dimension d
float lambda_; // Learning rate lambda
float alpha_; // Alpha in W optimization
KernelType kernel_type_; // The kernel type of the kernel matrix
float constant_; // In Gaussian kernel, this is sigma;
// In Polynomial kernel, this is the polynomial order
// In Linear kernel, this is c as well
bool u_converge_; // If matrix U reaches convergence, false by default
bool w_converge_; // If matrix W reaches convergence, false by default
bool u_w_converge_; // If matrix U and W both converge, false by default
T threshold1_; // threshold for column convergence
T threshold2_; // threshold for matrix convergence
Matrix<T> x_matrix_; // Input matrix X (n by d)
Matrix<T> w_matrix_; // Transformation matrix W (d by q, q < d).
// Initialized to (d by d) of I
Matrix<T> pre_w_matrix_; // W matrix from last iteration,
// to check convergence
Matrix<T> y_matrix_; // Labeling matrix Y (n by (c0 + c1 + c2 + ..))
Matrix<T> y_matrix_temp_; // The matrix that holds the current Y_i
Matrix<T> y_matrix_tilde_; // The kernel matrix for Y
Matrix<T> d_matrix_; // Diagonal degree matrix D (n by n)
Matrix<T> d_matrix_to_the_minus_half_; // D^(-1/2) matrix
Vector<T> d_ii_; // The diagonal vector of the matrix D
Vector<T> d_i_; // The diagonal vector of the matrix D^(-1/2)
Matrix<T> didj_matrix_; // The matrix whose element (i, j) equals to
// di * dj - the ith and jth element from vector d_i_
Matrix<T> k_matrix_; // Kernel matrix K (n by n)
Matrix<T> k_matrix_y_; // Kernel matrix for Y (n by n)
Matrix<T> u_matrix_; // Embedding matrix U (n by c)
Matrix<T> pre_u_matrix_; // The U from last iteration, to check convergence
Matrix<T> u_matrix_normalized_; // Row-wise normalized U
Matrix<T> l_matrix_; // D^(-1/2) * K * D^(-1/2)
Matrix<T> h_matrix_; // Centering matrix (n by n)
Matrix<T> gamma_matrix_; // The nxn gamma matrix used in gamma_ij
Matrix<T> g_of_w_; // g(w) for updating gradient
// in formula 5
Vector<T> clustering_result_; // Current clustering result
T phi_of_alpha_, phi_of_zero_, phi_of_zero_prime_;
// A struct contains timers for different functions
KDACProfiler profiler_;
// Set to true for debug use
bool verbose_;
bool debug_;
bool max_time_exceeded_;
// Maximum time before exiting, 72000 seconds by default
int max_time_;
Vector<T> GenOrthogonal(const Matrix<T> &space,
const Vector<T> &vector) {
Vector<T> projection = Vector<T>::Zero(space.rows());
for (int j = 0; j < space.cols(); j++) {
// projection = (v * u / u^2) * u
projection += (vector.dot(space.col(j)) /
space.col(j).squaredNorm()) * space.col(j);
}
return vector - projection;
}
Vector<T> GenOrthonormal(const Matrix<T> &space,
const Vector<T> &vector) {
util::CheckFinite(space, "space");
Vector<T> ortho_vector = GenOrthogonal(space, vector);
util::CheckFinite(ortho_vector, "ortho_vector");
return ortho_vector.array() / ortho_vector.norm();
}
void GenGammaMatrix(void) {
// didj matrix contains the element (i, j) that equal to d_i * d_j
didj_matrix_ = d_i_ * d_i_.transpose();
// Generate the Gamma matrix in equation 5, which is a constant since
// we have U fixed. Note that instead of generating one element of
// gamma_ij on the fly as in the paper, we generate the whole gamma matrix
// at one time and then access its entry of (i, j)
// This is an element-wise operation
// u*ut and didj matrix has the same size
gamma_matrix_ = ((u_matrix_ * u_matrix_.transpose()).array() /
didj_matrix_.array()).matrix() - lambda_ * y_matrix_tilde_;
}
void GenGofW(void) {
// After gamma_matrix is generated, we are optimizing gamma * kij as in 5
// g_of_w is g(w_l) that is multiplied by g(w_(l+1)) in each iteration
// of changing l.
// Note that here the g_of_w is a n*n matrix because it contains A_ij
// g_of_w(i, j) corresponding to exp(-w_T * A_ij * w / 2sigma^2)
// When l = 0, g_of_w is 1
// when l = 1, g_of_w is 1 .* g(w_1)
// when l = 2, g_of_w is 1 .* g(w_1) .* g(w_2)...
g_of_w_ = Matrix<T>::Constant(this->n_, this->n_, 1);
}
/// Generates a degree matrix D from an input kernel matrix
/// It also generates D^(-1/2) and two diagonal vectors
void GenDegreeMatrix(void) {
// Generate the diagonal vector d_i and degree matrix D
d_ii_ = k_matrix_.rowwise().sum();
d_matrix_ = d_ii_.asDiagonal();
// Generate matrix D^(-1/2)
d_i_ = d_ii_.array().sqrt().unaryExpr(std::ptr_fun(util::reciprocal<T>));
d_matrix_to_the_minus_half_ = d_i_.asDiagonal();
}
/// Generate the Kernel Matrix based on the current W
void GenKernelMatrix() {
// Project X to subspace W (n * d to d * q)
// Generate the kernel matrix based on kernel type from projected X
// when there is no existing clustering solution
// X is projected to (d * d) identity matrix, which is still X
Matrix<T> projected_x_matrix = x_matrix_ * w_matrix_;
if (kernel_type_ == kGaussianKernel) {
float sigma_sq = constant_ * constant_;
for (int i = 0; i < n_; i++)
for (int j = 0; j < n_; j++) {
Vector<T> delta_ij =
projected_x_matrix.row(i) - projected_x_matrix.row(j);
T i_j_dist = delta_ij.norm();
k_matrix_(i, j) = exp(-i_j_dist / (2 * sigma_sq));
}
}
}
// Check if q is not bigger than c
void CheckQD() {
if (q_ >= d_) {
std::cerr << "Reduced dimension q cannot >= dimension d" << std::endl;
exit(1);
}
}
/// This function runs KMeans on the normalized U
void RunKMeans() {
KMeans<T> kms;
T eps = std::numeric_limits<T>::min();
// Add a very small number to the l2 norm of each row in case it is 0
u_matrix_normalized_ = u_matrix_.array().colwise() /
(u_matrix_.rowwise().norm().array() + eps);
kms.Fit(u_matrix_normalized_, c_);
clustering_result_ = kms.GetLabels();
if (y_matrix_.cols() == 0) {
// When this is calculating Y0
y_matrix_ = Matrix<T>::Zero(n_, c_);
for (int i = 0; i < n_; i++)
y_matrix_(i, clustering_result_(i)) = 1;
} else {
// When this is to calculate Y_i and append it to Y_[0~i-1]
y_matrix_temp_ = Matrix<T>::Zero(n_, c_);
for (int i = 0; i < n_; i++)
y_matrix_temp_(i, clustering_result_(i)) = 1;
Matrix<T> y_matrix_new(n_, y_matrix_.cols() + c_);
y_matrix_new << y_matrix_, y_matrix_temp_;
y_matrix_ = y_matrix_new;
// Reset the y_matrix_temp holder to zero
}
}
void OptimizeU(void) {
GenKernelMatrix();
// Generate degree matrix from the kernel matrix
// d_i is the diagonal vector of degree matrix D
// This is a reference to how to directly generate D^(-1/2)
// Vector<T> d_i = k_matrix_.rowwise().sum().array().sqrt().unaryExpr(
// std::ptr_fun(util::reciprocal<T>));
// d_matrix_ = d_i.asDiagonal();
// Generate D and D^(-1/2)
GenDegreeMatrix();
l_matrix_ = d_matrix_to_the_minus_half_ *
k_matrix_ * d_matrix_to_the_minus_half_;
SvdSolver<T> solver;
solver.Compute(l_matrix_);
// Generate a u matrix from SVD solver and then use Normalize
// to normalize its rows
u_matrix_ = solver.MatrixU().leftCols(c_);
CheckFiniteOptimizeU();
if (verbose_)
std::cout << "U Optimized" << std::endl;
}
virtual void OptimizeW(void) {
// We optimize each column in the W matrix
for (int l = 0; l < w_matrix_.cols(); l++) {
Vector<T> w_l;
// Number of iterations in converging w_l
// Get orthogonal to make w_l orthogonal to vectors from w_0 to w_(l-1)
// when l is not 0
if (l == 0) {
w_l = w_matrix_.col(l);
w_l = w_l.array() / w_l.norm();
} else {
w_l = GenOrthonormal(w_matrix_.leftCols(l), w_matrix_.col(l));
}
// Search for the w_l that maximizes formula 5
// The initial objective is set to the lowest number
T objective = std::numeric_limits<T>::lowest();
bool w_l_converged = false;
while (!w_l_converged) {
Vector<T> grad_f_vertical;
T pre_objective = objective;
// Calculate the w gradient in equation 13, then find the gradient
// that is vertical to the space spanned by w_0 to w_l
Vector<T> grad_f = GenWGradient(w_l);
grad_f_vertical =
GenOrthonormal(w_matrix_.leftCols(l + 1), grad_f);
LineSearch(grad_f_vertical, &w_l, &objective);
w_l = sqrt(1.0 - pow(alpha_, 2)) * w_l + alpha_ * grad_f_vertical;
w_matrix_.col(l) = w_l;
w_l_converged =
util::CheckConverged(objective, pre_objective, threshold1_);
}
UpdateGOfW(w_l);
// TODO(yiskylee):
// Need to learn about if using Vector<T> &w_l = w_matrix_.col(l)
if (verbose_)
std::cout << "Column " << l+1 << " cost: " << objective << " | ";
}
if (verbose_)
std::cout << "W Optimized" << std::endl;
profiler_.exit_timer.Stop();
// If the whole program runs for more than 20 hours, it returns
if (profiler_.exit_timer.vec_.back() / 1e3 > max_time_) {
std::cout << "Exceeds maximum time limit. " << std::endl;
max_time_exceeded_ = true;
}
profiler_.gen_phi.SumRecords();
profiler_.gen_grad.SumRecords();
profiler_.update_g_of_w.SumRecords();
}
void LineSearch(const Vector<T> &gradient,
Vector<T> *w_l, T *objective) {
alpha_ = 1.0;
float a1 = 0.1;
float rho = 0.8;
if (kernel_type_ == kGaussianKernel) {
GenPhi(*w_l, gradient, true);
if (phi_of_zero_prime_ < 0) {
*w_l = -(*w_l);
GenPhi(*w_l, gradient, true);
}
while ((phi_of_alpha_ < phi_of_zero_ +
alpha_ * a1 * phi_of_zero_prime_)) {
alpha_ = alpha_ * rho;
GenPhi(*w_l, gradient, false);
}
*objective = phi_of_alpha_;
}
}
void CheckFiniteOptimizeU(void) {
util::CheckFinite(k_matrix_, "Kernel");
util::CheckFinite(d_matrix_to_the_minus_half_, "d_matrix_to_minus_half");
util::CheckFinite(l_matrix_, "L");
util::CheckFinite(u_matrix_, "U");
}
void CheckFiniteOptimizeW(void) {
util::CheckFinite(didj_matrix_, "didj");
util::CheckFinite(gamma_matrix_, "Gamma");
util::CheckFinite(w_matrix_, "W");
}
// Initialization when Fit() is called, w_matrix is already set up in
// Fit(input) or Fit(input, y), if w_matrix is setup in Fit(input), it is
// still a d x d matrix, we need to change it to d x q matrix
void Init() {
if (w_matrix_.cols() == d_)
w_matrix_ = Matrix<T>::Identity(d_, q_);
k_matrix_y_ = y_matrix_ * y_matrix_.transpose();
y_matrix_tilde_ = h_matrix_ * k_matrix_y_ * h_matrix_;
u_converge_ = false;
w_converge_ = false;
u_w_converge_ = false;
max_time_exceeded_ = false;
}
// Used only in Fit(const Matrix<T> &input_matrix)
virtual void Init(const Matrix<T> &input_matrix) {
x_matrix_ = input_matrix;
n_ = input_matrix.rows();
d_ = input_matrix.cols();
CheckQD();
// When the user does not initialize W using SetW()
// W matrix is initialized to be a d x d identity matrix
// because Init(input) is only called when spectral clustering
// is used.
if (w_matrix_.cols() == 0)
w_matrix_ = Matrix<T>::Identity(d_, d_);
h_matrix_ = Matrix<T>::Identity(n_, n_)
- Matrix<T>::Constant(n_, n_, 1) / static_cast<T>(n_);
// kernel matrix
k_matrix_ = Matrix<T>::Zero(n_, n_);
max_time_exceeded_ = false;
}
// Initialization for generating alternative views with a given Y
virtual void Init(const Matrix<T> &input_matrix,
const Matrix<T> &y_matrix) {
x_matrix_ = input_matrix;
n_ = input_matrix.rows();
d_ = input_matrix.cols();
CheckQD();
// When the user does not initialize W using SetW()
// W matrix is initilized to be an identity matrix
if (w_matrix_.cols() == 0)
w_matrix_ = Matrix<T>::Identity(d_, q_);
h_matrix_ = Matrix<T>::Identity(n_, n_)
- Matrix<T>::Constant(n_, n_, 1) / static_cast<T>(n_);
y_matrix_ = y_matrix;
// kernel matrix
k_matrix_ = Matrix<T>::Zero(n_, n_);
// Generate the kernel for the label matrix Y: K_y
k_matrix_y_ = y_matrix_ * y_matrix_.transpose();
// Generate Y tilde matrix in equation 5 from kernel matrix of Y
y_matrix_tilde_ = h_matrix_ * k_matrix_y_ * h_matrix_;
u_converge_ = false;
w_converge_ = false;
u_w_converge_ = false;
max_time_exceeded_ = false;
}
virtual void UpdateGOfW(const Vector<T> &w_l) = 0;
virtual void GenPhi(const Vector<T> &w_l,
const Vector<T> &gradient,
bool w_l_changed) = 0;
virtual void GenPhiCoeff(const Vector<T> &w_l, const Vector<T> &gradient) = 0;
virtual Vector<T> GenWGradient(const Vector<T> &w_l) = 0;
};
} // namespace Nice
#endif // CPP_INCLUDE_KDAC_H_
| [
"yiskylee@gmail.com"
] | yiskylee@gmail.com |
ebbc151e43c0a1ea7a456f21b6ca43a9b9bdbd70 | 3a469c2dc6852632a9fbb2be7ddc2b2bc220a78a | /LinkedList/linkedlist.cpp | 234155ce376b781dd8228de8abdcf80c4aa43e80 | [] | no_license | piyushmarya/Data-Structures | 624555468eaa51d509b8d3852170318aa1af2501 | d83fa6c00b8336d8f64820248aaea99e716b2de2 | refs/heads/master | 2020-04-01T06:23:19.919107 | 2020-01-06T10:01:35 | 2020-01-06T10:01:35 | 152,944,971 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,398 | cpp | #include<iostream>
using namespace std;
struct node{
int data;
node *next;
};
class linkedlist
{
node *head;
public:
linkedlist()
{
head=NULL;
}
void createnode(int val)
{
node *newnode;
newnode=(node*)malloc(sizeof node );
newnode->data=val;
newnode->next=NULL;
head=new node ;
}
void insert(int val)
{
if(head==NULL)
createnode(val);
else
{
node *firstnode;
firstnode=(node*)malloc(sizeof node);
firstnode->data=val;
firstnode->next=head;
head=firstnode;
}
}
void traverse()
{
struct node *curr;
for(curr=head;curr!=NULL;curr=curr.next)
cout<<curr;
}
void insertatend(int val)
{
if(head==NULL)
{
createnode(val);
}
else
{
node *temp;
temp=head;
while(temp->next!=NULL)
{
temp=temp->next;
}
node *newnode;
newnode=(node*)malloc(sizeof node);
newnode->data=val;
newnode->next=NULL;
temp->next=newnode;
}
}
void insertatloc(int val,int loc)
{
if(head==NULL)
{
createnode(val);
}
else if(head->next==NULL)
insertatend(val);
else
{
node->temp;
temp=head;
for(int i=1;i<loc-1;i++)
{
temp=temp->next;
}
node *newnode;
newnode->data=val;
newnode->next=temp->next;
temp-next+=newnode;
}
}
};
void main()
{
linkedlist l;
l.createnode(50);
l.insert(60);
l.insert(70);
l.traverse();
}
| [
"noreply@github.com"
] | noreply@github.com |
fce86c7ccfc72c3133c6d5fbdefdf5c597801d67 | 4634afd811902634fe803d0d62398dcc7f358214 | /main.cpp | a6a56a6082f4802d52ce82df37a68014c7b2ab09 | [] | no_license | meesokim/chips-spc1000 | fc9a52a1915615dc7199a6a71b097cc06315cfd0 | f995e994b8102bc340cd2a52f81d75a1348e0329 | refs/heads/master | 2020-11-24T15:22:25.529193 | 2019-12-16T16:44:17 | 2019-12-16T16:44:17 | 228,214,396 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 17,797 | cpp | //
// main.c
//
// SPC1000 - Samsung SPC-1000 emulator for Raspberry Pi
// Copyright (C) 2019 Miso Kim <meeso.kim@gmail.com>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
#include <stdlib.h>
#include <stdio.h>
#include <bcm_host.h>
#include <interface/vchiq_arm/vchiq_if.h>
#include <EGL/egl.h>
#include <GLES2/gl2.h>
#include <SDL.h>
#include "imgui.h"
extern "C" {
#include "imgui_impl_opengl3.h"
#include "imgui_impl_sdl.h"
}
typedef struct
{
uint32_t screen_width;
uint32_t screen_height;
// OpenGL|ES objects
DISPMANX_ELEMENT_HANDLE_T dispman_element;
DISPMANX_DISPLAY_HANDLE_T dispman_display;
EGLDisplay display;
EGLSurface surface;
EGLContext context;
} GLES2_STATE_T;
static GLES2_STATE_T _state, *state=&_state;
uint32_t screenWidth = 0;
uint32_t screenHeight = 0;
static SDL_Surface *sdlScreen;
static SDL_Window *sdlWindow;
#define check() assert(glGetError() == 0)
int piInitVideo();
int piDestoryVideo();
extern "C" int test_main(int w, int h);
extern "C" void _glSwapWindow();
extern "C" int ImGui_NewFrame();
/***********************************************************
* Name: init_ogl
*
* Arguments:
* GLES2_STATE_T *state - holds OGLES model info
*
* Description: Sets the display, OpenGL|ES context and screen stuff
*
* Returns: void
*
***********************************************************/
static void init_ogl(GLES2_STATE_T *state)
{
int32_t success = 0;
EGLBoolean result;
EGLint num_config;
static EGL_DISPMANX_WINDOW_T nativewindow;
DISPMANX_UPDATE_HANDLE_T dispman_update;
VC_RECT_T dst_rect;
VC_RECT_T src_rect;
static const EGLint attribute_list[] =
{
EGL_RED_SIZE, 8,
EGL_GREEN_SIZE, 8,
EGL_BLUE_SIZE, 8,
EGL_ALPHA_SIZE, 8,
EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
EGL_NONE
};
static const EGLint context_attributes[] =
{
EGL_CONTEXT_CLIENT_VERSION, 2,
EGL_NONE
};
EGLConfig config;
// get an EGL display connection
state->display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
assert(state->display!=EGL_NO_DISPLAY);
check();
// initialize the EGL display connection
result = eglInitialize(state->display, NULL, NULL);
assert(EGL_FALSE != result);
check();
// get an appropriate EGL frame buffer configuration
result = eglChooseConfig(state->display, attribute_list, &config, 1, &num_config);
assert(EGL_FALSE != result);
check();
// get an appropriate EGL frame buffer configuration
result = eglBindAPI(EGL_OPENGL_ES_API);
assert(EGL_FALSE != result);
check();
// create an EGL rendering context
state->context = eglCreateContext(state->display, config, EGL_NO_CONTEXT, context_attributes);
assert(state->context!=EGL_NO_CONTEXT);
check();
// create an EGL window surface
success = graphics_get_display_size(0 /* LCD */, &state->screen_width, &state->screen_height);
assert( success >= 0 );
dst_rect.x = 0;
dst_rect.y = 0;
dst_rect.width = state->screen_width;
dst_rect.height = state->screen_height;
src_rect.x = 0;
src_rect.y = 0;
src_rect.width = state->screen_width << 16;
src_rect.height = state->screen_height << 16;
state->dispman_display = vc_dispmanx_display_open( 0 /* LCD */);
dispman_update = vc_dispmanx_update_start( 0 );
state->dispman_element = vc_dispmanx_element_add ( dispman_update, state->dispman_display,
0/*layer*/, &dst_rect, 0/*src*/,
&src_rect, DISPMANX_PROTECTION_NONE, 0 /*alpha*/, 0/*clamp*/, DISPMANX_NO_ROTATE /*transform*/);
nativewindow.element = state->dispman_element;
nativewindow.width = state->screen_width;
nativewindow.height = state->screen_height;
vc_dispmanx_update_submit_sync( dispman_update );
check();
state->surface = eglCreateWindowSurface( state->display, config, &nativewindow, NULL );
assert(state->surface != EGL_NO_SURFACE);
check();
// connect the context to the surface
result = eglMakeCurrent(state->display, state->surface, state->surface, state->context);
assert(EGL_FALSE != result);
check();
// Set background color and clear buffers
glClearColor(0.15f, 0.25f, 0.35f, 1.0f);
glClear( GL_COLOR_BUFFER_BIT );
check();
}
void _glSwapWindow()
{
// ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData());
eglSwapBuffers(state->display, state->surface);
}
extern "C" unsigned char * dump_namyangju_godic_otf;
int main (int argc, char **argv)
{
bcm_host_init();
// Clear application state
memset( state, 0, sizeof( *state ) );
// Start OGLES
init_ogl(state);
SDL_Init(SDL_INIT_EVERYTHING);
sdlWindow = SDL_CreateWindow("GLES",
SDL_WINDOWPOS_UNDEFINED,
SDL_WINDOWPOS_UNDEFINED,
state->screen_width, state->screen_height,
SDL_WINDOW_SHOWN);
ImGui::CreateContext();
ImGuiIO& io = ImGui::GetIO();
//io.Fonts->AddFontFromMemoryTTF(dump_namyangju_godic_otf, 2420460, 16.0f, NULL, io.Fonts->GetGlyphRangesKorean());
io.Fonts->AddFontFromFileTTF("namyangju_godic.otf", 14.0f, NULL, io.Fonts->GetGlyphRangesKorean());
io.MouseDrawCursor = true;
io.DisplaySize = ImVec2((float)state->screen_width, (float)state->screen_height);
ImGui::StyleColorsDark();
ImGui_ImplSDL2_InitForOpenGL(sdlWindow, state->context);
ImGui_ImplOpenGL3_Init(0);
// ImGui::PushFontSize(14.0f);
#if 1
test_main(state->screen_width, state->screen_height);
#else
// Our state
bool show_demo_window = true;
bool show_another_window = true;
ImVec4 clear_color = ImVec4(0.45f, 0.55f, 0.60f, 1.00f);
// Main loop
bool done = false;
int mx, my;
while (!done)
{
// Poll and handle events (inputs, window resize, etc.)
// You can read the io.WantCaptureMouse, io.WantCaptureKeyboard flags to tell if dear imgui wants to use your inputs.
// - When io.WantCaptureMouse is true, do not dispatch mouse input data to your main application.
// - When io.WantCaptureKeyboard is true, do not dispatch keyboard input data to your main application.
// Generally you may always pass all inputs to dear imgui, and hide them from your application based on those two flags.
#if 0
SDL_Event event;
while (SDL_PollEvent(&event))
{
ImGui_ImplSDL2_ProcessEvent(&event);
if (event.type == SDL_QUIT)
done = true;
if (event.type == SDL_WINDOWEVENT && event.window.event == SDL_WINDOWEVENT_CLOSE && event.window.windowID == SDL_GetWindowID(sdlWindow))
done = true;
}
#else
ImGui_NewFrame();
ImGui::NewFrame();
#endif
// Start the Dear ImGui frame
// 1. Show the big demo window (Most of the sample code is in ImGui::ShowDemoWindow()! You can browse its code to learn more about Dear ImGui!).
if (show_demo_window)
ImGui::ShowDemoWindow(&show_demo_window);
// 2. Show a simple window that we create ourselves. We use a Begin/End pair to created a named window.
{
static float f = 0.0f;
static int counter = 0;
ImGui::Begin("Hello, World!"); // Create a window called "Hello, world!" and append into it.
ImGui::Text("This is some useful text."); // Display some text (you can use a format strings too)
ImGui::Checkbox("Demo Window", &show_demo_window); // Edit bools storing our window open/close state
ImGui::Checkbox("Another Window", &show_another_window);
ImGui::SliderFloat("float", &f, 0.0f, 1.0f); // Edit 1 float using a slider from 0.0f to 1.0f
ImGui::ColorEdit3("clear color", (float*)&clear_color); // Edit 3 floats representing a color
if (ImGui::Button("Button")) // Buttons return true when clicked (most widgets return true when edited/activated)
counter++;
ImGui::SameLine();
ImGuiIO& io = ImGui::GetIO();
ImGui::Text("counter = %d, %d, %d", counter, (int)io.MousePos.x, (int)io.MousePos.y);
ImGui::Text("Application average %.3f ms/frame (%.1f FPS)", 1000.0f / ImGui::GetIO().Framerate, ImGui::GetIO().Framerate);
ImGui::End();
}
// 3. Show another simple window.
if (show_another_window)
{
ImGui::Begin("Another Window", &show_another_window); // Pass a pointer to our bool variable (the window will have a closing button that will clear the bool when clicked)
ImGui::Text("Hello from another window!");
if (ImGui::Button("Close Me"))
show_another_window = false;
ImGui::End();
}
//Rendering
ImGui::Render();
glViewport(0, 0, (int)io.DisplaySize.x, (int)io.DisplaySize.y);
glClearColor(clear_color.x, clear_color.y, clear_color.z, clear_color.w);
glClear(GL_COLOR_BUFFER_BIT);
ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData());
//glFlush();
_glSwapWindow();
}
#endif
return 0;
}
extern "C" void sdl_keyinput(SDL_Event *event);
extern "C" int ImGui_NewFrame()
{
bool done = false;
ImGui_ImplOpenGL3_NewFrame();
ImGui_ImplSDL2_NewFrame(sdlWindow);
//ImGui::NewFrame();
SDL_Event event;
while (SDL_PollEvent(&event))
{
ImGui_ImplSDL2_ProcessEvent(&event);
switch (event.type)
{
case SDL_QUIT:
done = true;
break;
case SDL_KEYDOWN:
case SDL_KEYUP:
sdl_keyinput(&event);
//printf("keycode=%d\n", event.key.keysym.sym);
break;
}
}
return done;
}
#if 0
int _main (int argc, char **argv)
{
piInitVideo();
ImGui::CreateContext();
ImGuiIO& io = ImGui::GetIO();
io.MouseDrawCursor = true;
ImGui::StyleColorsDark();
ImGui_ImplSDL2_InitForOpenGL(sdlWindow, context);
ImGui_ImplOpenGL3_Init(0);
glClear(GL_COLOR_BUFFER_BIT);
// test_main(screenWidth, screenHeight);
// Our state
bool show_demo_window = true;
bool show_another_window = true;
ImVec4 clear_color = ImVec4(0.45f, 0.55f, 0.60f, 1.00f);
// Main loop
bool done = false;
while (!done)
{
// Poll and handle events (inputs, window resize, etc.)
// You can read the io.WantCaptureMouse, io.WantCaptureKeyboard flags to tell if dear imgui wants to use your inputs.
// - When io.WantCaptureMouse is true, do not dispatch mouse input data to your main application.
// - When io.WantCaptureKeyboard is true, do not dispatch keyboard input data to your main application.
// Generally you may always pass all inputs to dear imgui, and hide them from your application based on those two flags.
// SDL_Event event;
// while (SDL_PollEvent(&event))
// {
// ImGui_ImplSDL2_ProcessEvent(&event);
// if (event.type == SDL_QUIT)
// done = true;
// if (event.type == SDL_WINDOWEVENT && event.window.event == SDL_WINDOWEVENT_CLOSE && event.window.windowID == SDL_GetWindowID(window))
// done = true;
// }
//printf("\rTest:%d", counter++);
ImGui_NewFrame();
// Start the Dear ImGui frame
// 1. Show the big demo window (Most of the sample code is in ImGui::ShowDemoWindow()! You can browse its code to learn more about Dear ImGui!).
if (show_demo_window)
ImGui::ShowDemoWindow(&show_demo_window);
// 2. Show a simple window that we create ourselves. We use a Begin/End pair to created a named window.
{
static float f = 0.0f;
static int counter = 0;
ImGui::Begin("Hello, world!"); // Create a window called "Hello, world!" and append into it.
ImGui::Text("This is some useful text."); // Display some text (you can use a format strings too)
ImGui::Checkbox("Demo Window", &show_demo_window); // Edit bools storing our window open/close state
ImGui::Checkbox("Another Window", &show_another_window);
ImGui::SliderFloat("float", &f, 0.0f, 1.0f); // Edit 1 float using a slider from 0.0f to 1.0f
ImGui::ColorEdit3("clear color", (float*)&clear_color); // Edit 3 floats representing a color
if (ImGui::Button("Button")) // Buttons return true when clicked (most widgets return true when edited/activated)
counter++;
ImGui::SameLine();
ImGui::Text("counter = %d", counter);
ImGui::Text("Application average %.3f ms/frame (%.1f FPS)", 1000.0f / ImGui::GetIO().Framerate, ImGui::GetIO().Framerate);
ImGui::End();
}
// 3. Show another simple window.
if (show_another_window)
{
ImGui::Begin("Another Window", &show_another_window); // Pass a pointer to our bool variable (the window will have a closing button that will clear the bool when clicked)
ImGui::Text("Hello from another window!");
if (ImGui::Button("Close Me"))
show_another_window = false;
ImGui::End();
}
//Rendering
ImGui::Render();
glViewport(0, 0, (int)io.DisplaySize.x, (int)io.DisplaySize.y);
glClearColor(clear_color.x, clear_color.y, clear_color.z, clear_color.w);
glClear(GL_COLOR_BUFFER_BIT);
ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData());
glFlush();
_glSwapWindow();
}
}
int piInitVideo()
{
bcm_host_init();
// get an EGL display connection
display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
if (display == EGL_NO_DISPLAY) {
fprintf(stdout, "eglGetDisplay() failed: EGL_NO_DISPLAY\n");
return 0;
}
// initialize the EGL display connection
EGLBoolean result = eglInitialize(display, NULL, NULL);
if (result == EGL_FALSE) {
fprintf(stdout, "eglInitialize() failed: EGL_FALSE\n");
return 0;
}
// get an appropriate EGL frame buffer configuration
EGLint numConfig;
EGLConfig config;
static const EGLint attributeList[] = {
EGL_RED_SIZE, 8,
EGL_GREEN_SIZE, 8,
EGL_BLUE_SIZE, 8,
EGL_ALPHA_SIZE, 8,
EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
EGL_NONE
};
result = eglChooseConfig(display, attributeList, &config, 1, &numConfig);
if (result == EGL_FALSE) {
fprintf(stdout, "eglChooseConfig() failed: EGL_FALSE\n");
return 0;
}
result = eglBindAPI(EGL_OPENGL_ES_API);
if (result == EGL_FALSE) {
fprintf(stdout, "eglBindAPI() failed: EGL_FALSE\n");
return 0;
}
// create an EGL rendering context
static const EGLint contextAttributes[] = {
EGL_CONTEXT_CLIENT_VERSION, 2,
EGL_NONE
};
context = eglCreateContext(display, config, EGL_NO_CONTEXT, contextAttributes);
if (context == EGL_NO_CONTEXT) {
fprintf(stdout, "eglCreateContext() failed: EGL_NO_CONTEXT\n");
return 0;
}
// create an EGL window surface
int32_t success = graphics_get_display_size(0, &screenWidth, &screenHeight);
if (result < 0) {
fprintf(stdout, "graphics_get_display_size() failed: < 0\n");
return 0;
}
printf( "Width/height: %d/%d\n", screenWidth, screenHeight);
VC_RECT_T dstRect;
dstRect.x = 0;
dstRect.y = 0;
dstRect.width = screenWidth;
dstRect.height = screenHeight;
VC_RECT_T srcRect;
srcRect.x = 0;
srcRect.y = 0;
srcRect.width = screenWidth << 16;
srcRect.height = screenHeight << 16;
DISPMANX_DISPLAY_HANDLE_T dispManDisplay = vc_dispmanx_display_open(0);
DISPMANX_UPDATE_HANDLE_T dispmanUpdate = vc_dispmanx_update_start(0);
DISPMANX_ELEMENT_HANDLE_T dispmanElement = vc_dispmanx_element_add(dispmanUpdate,
dispManDisplay, 0, &dstRect, 0, &srcRect,
DISPMANX_PROTECTION_NONE, NULL, NULL, DISPMANX_NO_ROTATE);
nativeWindow.element = dispmanElement;
nativeWindow.width = screenWidth;
nativeWindow.height = screenHeight;
vc_dispmanx_update_submit_sync(dispmanUpdate);
fprintf(stdout, "Initializing window surface...\n");
surface = eglCreateWindowSurface(display, config, &nativeWindow, NULL);
if (surface == EGL_NO_SURFACE) {
fprintf(stdout, "eglCreateWindowSurface() failed: EGL_NO_SURFACE\n");
return 0;
}
fprintf(stdout, "Connecting context to surface...\n");
// connect the context to the surface
result = eglMakeCurrent(display, surface, surface, context);
if (result == EGL_FALSE) {
fprintf(stdout, "eglMakeCurrent() failed: EGL_FALSE\n");
return 0;
}
glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
glFinish();
// eglSwapBuffers(display, surface);
SDL_Init(SDL_INIT_EVERYTHING);
sdlWindow = SDL_CreateWindow("My Game Window",
0,
0,
0, 0,
0);
sdlScreen = SDL_GetWindowSurface(sdlWindow);
SDL_ShowCursor(SDL_DISABLE);
return 0;
}
void piDestroyVideo()
{
if (sdlScreen) {
SDL_FreeSurface(sdlScreen);
}
// Release OpenGL resources
if (display) {
eglMakeCurrent(display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
eglDestroySurface(display, surface);
eglDestroyContext(display, context);
eglTerminate(display);
}
bcm_host_deinit();
}
#endif
#if 0
extern "C" {
long unsigned int circle_get_time()
{
return 0;
}
void circle_initialize()
{
}
void circle_run()
{
}
void circle_start_timer()
{
}
}
#endif | [
"meeso.kim@gmail.com"
] | meeso.kim@gmail.com |
cf08c15ac79f7ec1e6a1ae08a2f85a83e0d71ab0 | a9324dfc545e6bc89b0b505660a13e964cc47170 | /src/utiltime.h | fd36c41a524cd705b29c6e6fd3f56832c172e0d3 | [
"MIT"
] | permissive | lgsproject/LogisCoin | 85bd286d8b46db4c14bb3c612c3a5c74cac22cc8 | 1ff570832b90d2c5d3bb3a951def398c955e1156 | refs/heads/master | 2020-03-25T19:43:42.413235 | 2019-01-31T13:33:57 | 2019-01-31T13:33:57 | 144,097,294 | 15 | 17 | null | null | null | null | UTF-8 | C++ | false | false | 709 | h | // Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2014 The Bitcoin developers
// Copyright (c) 2017-2018 The PIVX developers
// Copyright (c) 2018 The LogisCoin developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef BITCOIN_UTILTIME_H
#define BITCOIN_UTILTIME_H
#include <stdint.h>
#include <string>
int64_t GetTime();
int64_t GetTimeMillis();
int64_t GetTimeMicros();
void SetMockTime(int64_t nMockTimeIn);
void MilliSleep(int64_t n);
std::string DateTimeStrFormat(const char* pszFormat, int64_t nTime);
std::string DurationToDHMS(int64_t nDurationTime);
#endif // BITCOIN_UTILTIME_H
| [
"root@ubuntu16.local"
] | root@ubuntu16.local |
207fb737e0491d8b1f5a2dfac843ff8e7b4e6eb6 | b5c0abacc667e09b98231f5109c2a869ff62d029 | /lib/ObjectDump/NMSymbol.cpp | ff43e3a6666a78d79084608cacf36e9c0be3faec | [
"MIT"
] | permissive | thfabian/findsymbol | b0d04dab346b939edab9e1195dc7e4bb3773a12e | 88d8f1ce520884f67ebebe07eaddd35e8d71888f | refs/heads/master | 2016-09-06T05:44:25.173672 | 2015-09-14T18:01:15 | 2015-09-14T18:01:15 | 42,254,587 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,145 | cpp | /*******************************************************************- C++ -****\
*
* FindSymbol v1.0
* (c) 2015 Fabian Thüring
*
* This file is distributed under the MIT Open Source License. See
* LICENSE.TXT for details.
*
\******************************************************************************/
#include "findsymbol/ObjectDump/NMSymbol.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/GlobalAlias.h"
#include "llvm/IR/GlobalVariable.h"
#include "llvm/Object/ELFObjectFile.h"
#include "llvm/Object/IRObjectFile.h"
#include "llvm/Object/ObjectFile.h"
using namespace findsymbol;
using namespace llvm;
using namespace object;
#if LLVM_VERSION_MAJOR >= 3 && LLVM_VERSION_MINOR >= 8
template <class ELFT>
static bool checkForGlobalTextSymbol(ELFObjectFile<ELFT>& Obj,
basic_symbol_iterator I)
{
symbol_iterator SymI(I);
ErrorOr<elf_section_iterator> SecIOrErr = SymI->getSection();
if(SecIOrErr.getError())
return false;
elf_section_iterator SecI = *SecIOrErr;
if(SecI != Obj.section_end() && (SecI->getType() == ELF::SHT_PROGBITS
|| SecI->getType() == ELF::SHT_DYNAMIC)
&& SecI->getFlags() == (ELF::SHF_ALLOC | ELF::SHF_EXECINSTR))
return true;
else
return false;
}
#else
template <class ELFT>
static bool checkForGlobalTextSymbol(ELFObjectFile<ELFT>& Obj,
basic_symbol_iterator I)
{
typedef typename ELFObjectFile<ELFT>::Elf_Sym Elf_Sym;
typedef typename ELFObjectFile<ELFT>::Elf_Shdr Elf_Shdr;
symbol_iterator SymI(I);
DataRefImpl Symb = I->getRawDataRefImpl();
const Elf_Sym* ESym = Obj.getSymbol(Symb);
const ELFFile<ELFT>& EF = *Obj.getELFFile();
const Elf_Shdr* ESec = EF.getSection(ESym);
if(ESec && (ESec->sh_type == ELF::SHT_PROGBITS
|| ESec->sh_type == ELF::SHT_DYNAMIC)
&& (ESec->sh_flags == (ELF::SHF_ALLOC | ELF::SHF_EXECINSTR)))
return true;
else
return false;
}
#endif
NMSymbol::NMSymbol(SymbolicFile& obj, basic_symbol_iterator symIt)
: isGlobalTextSymbol_(false)
{
uint32_t symflags = symIt->getFlags();
if((symflags & object::SymbolRef::SF_Weak))
return;
if(symflags & object::SymbolRef::SF_Undefined)
return;
if(symflags & object::SymbolRef::SF_Common)
return;
if(symflags & object::SymbolRef::SF_Absolute)
return;
if(!(symflags & object::SymbolRef::SF_Global))
return;
else if(ELF32LEObjectFile* ELF = dyn_cast<ELF32LEObjectFile>(&obj))
isGlobalTextSymbol_ = checkForGlobalTextSymbol(*ELF, symIt);
else if(ELF64LEObjectFile* ELF = dyn_cast<ELF64LEObjectFile>(&obj))
isGlobalTextSymbol_ = checkForGlobalTextSymbol(*ELF, symIt);
else if(ELF32BEObjectFile* ELF = dyn_cast<ELF32BEObjectFile>(&obj))
isGlobalTextSymbol_ = checkForGlobalTextSymbol(*ELF, symIt);
else if(ELF64BEObjectFile* ELF = dyn_cast<ELF64BEObjectFile>(&obj))
isGlobalTextSymbol_ = checkForGlobalTextSymbol(*ELF, symIt);
}
| [
"fabian_thuering@hotmail.com"
] | fabian_thuering@hotmail.com |
8cb4c65819ace1dda006a6ed56dd8b77f7962fd2 | b3c47795e8b6d95ae5521dcbbb920ab71851a92f | /Jisuanke/T54138-wy的单机游戏.cc | d9c432b2df67beb6e4161709393ff1be475bee2a | [
"LicenseRef-scancode-warranty-disclaimer"
] | no_license | Wizmann/ACM-ICPC | 6afecd0fd09918c53a2a84c4d22c244de0065710 | 7c30454c49485a794dcc4d1c09daf2f755f9ecc1 | refs/heads/master | 2023-07-15T02:46:21.372860 | 2023-07-09T15:30:27 | 2023-07-09T15:30:27 | 3,009,276 | 51 | 23 | null | null | null | null | UTF-8 | C++ | false | false | 2,929 | cc | #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <functional>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <deque>
#include <string>
#include <cassert>
using namespace std;
typedef long long llint;
const int INF = 0x3f3f3f3f;
const llint INFLL = 0x3f3f3f3f3f3f3f3fLL;
#define print(x) cout << x << endl
#define input(x) cin >> x
const int N = 123;
struct Point {
int y, x;
};
char board[N][N];
int dp[N][N];
Point mp[N][N];
char inq[N][N];
const int my[] = {-1, 0, 1, 0};
const int mx[] = {0, 1, 0, -1};
int solve(int n, int m) {
memset(dp, INF, sizeof(dp));
memset(mp, -1, sizeof(mp));
memset(inq, 0, sizeof(inq));
map<char, vector<Point> > portals;
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
if (board[i][j] >= 'A' && board[i][j] <= 'Z') {
portals[board[i][j]].push_back({i, j});
}
}
}
for (int i = 0; i < 26; i++) {
if (portals['A' + i].size() == 0) {
continue;
}
Point p1 = portals['A' + i][0];
Point p2 = portals['A' + i][1];
mp[p1.y][p1.x] = p2;
mp[p2.y][p2.x] = p1;
}
queue<Point> q;
dp[0][0] = 0;
q.push({0, 0});
while (!q.empty()) {
Point cur = q.front();
q.pop();
inq[cur.y][cur.x] = 0;
// print(cur.y << ' ' << cur.x << ' ' << dp[cur.y][cur.x]);
for (int i = 0; i < 4; i++) {
int ny = cur.y + my[i];
int nx = cur.x + mx[i];
if (ny < 0 || ny >= n || nx < 0 || nx >= m || board[ny][nx] == '#') {
continue;
}
if (mp[ny][nx].y != -1) {
int ny_ = mp[ny][nx].y;
int nx_ = mp[ny][nx].x;
ny = ny_;
nx = nx_;
}
if (dp[ny][nx] > dp[cur.y][cur.x] + 1) {
dp[ny][nx] = dp[cur.y][cur.x] + 1;
if (inq[ny][nx] == 0) {
q.push({ny, nx});
inq[ny][nx] = 1;
}
}
}
}
return dp[n - 1][m - 1];
}
int main() {
#ifndef __CPRUN__
freopen("game.in", "r", stdin);
freopen("game.out", "w", stdout);
#endif
int n, m;
scanf("%d%d", &n, &m);
for (int i = 0; i < n; i++) {
scanf("%s", board[i]);
}
int res = solve(n, m);
if (res >= INF) {
puts("Game Over.");
} else {
printf("%d\n", res);
}
return 0;
}
/*
^^^TEST^^^
3 3
.#.
A#A
.#.
-----
2
$$$TEST$$$
^^^TEST^^^
3 3
.#.
.#.
.#.
-----
Game Over.
$$$TEST$$$
^^^TEST^^^
3 3
.#.
.#.
ZZ.
-----
3
$$$TEST$$$
^^^TEST^^^
3 3
.#A
.#.
ZZA
-----
5
$$$TEST$$$
^^^TEST^^^
1 6
.AABB.
-----
3
$$$TEST$$$
^^^TEST^^^
2 6
.AAB..
B###..
-----
4
$$$TEST$$$
^^^TEST^^^
3 3
.#A
A##
...
-----
Game Over.
$$$TEST$$$
*/
| [
"noreply@github.com"
] | noreply@github.com |
d188669de0cc7edf26f3dc6f4a2141fa4cce1a76 | 0f7a4119185aff6f48907e8a5b2666d91a47c56b | /sstd_utility/windows_boost/boost/units/base_units/si/ampere.hpp | e5cf43ace07a641321b0ac4e11c3a96a578c1dd7 | [] | no_license | jixhua/QQmlQuickBook | 6636c77e9553a86f09cd59a2e89a83eaa9f153b6 | 782799ec3426291be0b0a2e37dc3e209006f0415 | refs/heads/master | 2021-09-28T13:02:48.880908 | 2018-11-17T10:43:47 | 2018-11-17T10:43:47 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,194 | hpp | // Boost.Units - A C++ library for zero-overhead dimensional analysis and
// unit/quantity manipulation and conversion
//
// Copyright (C) 2003-2008 Matthias Christian Schabel
// Copyright (C) 2007-2008 Steven Watanabe
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_UNITS_SI_AMPERE_BASE_UNIT_HPP
#define BOOST_UNITS_SI_AMPERE_BASE_UNIT_HPP
#include <string>
#include <boost/units/config.hpp>
#include <boost/units/base_unit.hpp>
#include <boost/units/physical_dimensions/current.hpp>
namespace boost {
namespace units {
namespace si {
struct ampere_base_unit : public base_unit<ampere_base_unit, current_dimension, -6>
{
static std::string name() { return("ampere"); }
static std::string symbol() { return("A"); }
};
} // namespace si
} // namespace units
} // namespace boost
#if BOOST_UNITS_HAS_BOOST_TYPEOF
#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
BOOST_TYPEOF_REGISTER_TYPE(boost::units::si::ampere_base_unit)
#endif
//#include <boost/units/base_units/detail/conversions.hpp>
#endif // BOOST_UNITS_SI_AMPERE_BASE_UNIT_HPP
| [
"nanguazhude@vip.qq.com"
] | nanguazhude@vip.qq.com |
f23d1de8766f843decc5f3dd8c0ec59681ef5438 | 56a13917921ee7b8bb2445c30bcbbba1dea0a503 | /Codeforces/Candies.cpp | 5ec00ab9f28e3f093bef87e8b7e933b8d3051bb4 | [] | no_license | VaibhavVerma16113108/Competitive-Programming | 4ffaeee01c35b4d400551865400c35c2e94a8aee | b67df9eab98ecb383ce39b11e089d4db4b75a4ec | refs/heads/main | 2023-05-11T21:09:02.795214 | 2021-06-08T12:02:27 | 2021-06-08T12:02:27 | 333,001,192 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 518 | cpp | #include <iostream>
#include <vector>
using namespace std;
#define ll long long
int main()
{
int t;
cin >> t;
while (t--)
{
ll n;
cin >> n;
// n should be divisible by 3, 7, 15, ... 2^k - 1
ll p = 4;
for (int k = 2; p - 1 <= n; k++)
{
// cout << p - 1 << endl;
if (n % (p - 1) == 0)
{
cout << n / (p - 1) << endl;
break;
}
p *= 2;
}
}
return 0;
} | [
"vaibhav.verrma@gmail.com"
] | vaibhav.verrma@gmail.com |
c77eb8baa002ed0f9160720d1ecada654e2e2d37 | e371c4f4f5b1d4812fdbd50ab27eb767eba6faaf | /RayTracer - Rasterization/BRDF/GlossySpecular.h | 188120001f6beb3a1a64c9c2fd63c7072aa4895b | [] | no_license | tsargs/Ray-tracer | ce01baba0e2175f25bec97d74a0681e2ebab7934 | b069aa16fbf0e3d2a77bd42e589382dbae4d408c | refs/heads/master | 2021-03-22T04:59:53.057456 | 2018-02-12T01:40:07 | 2018-02-12T01:40:07 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,211 | h | #ifndef GLOSSYSPECULAR
#define GLOSSYSPECULAR
// =============================================================================
//
// Created by Shyam Prathish Sargunam on 02/21/15.
// Copyright © 2015 Shyam Prathish Sargunam. All rights reserved.
//
// =============================================================================
#include "BRDF.h"
#include <iostream>
class GlossySpecular:public BRDF
{
public:
float ks; // Specular reflection coefficient
RGBColor specularColor;
float e; //Exponent to control the reflection lobe
//Constructors
GlossySpecular(void); //Default Constructor
GlossySpecular(Sampler* samplerPointer);
GlossySpecular(const float& kdVal, const RGBColor colorObj, const float& eVal);
GlossySpecular(const GlossySpecular& glossySpecular);
//Destructor
~GlossySpecular(void);
//Member Functions
GlossySpecular& operator=(const GlossySpecular& glossySpecular); //Assignment Operator
RGBColor GetBRDF(const ShadeRecord& sr, const Vector3D& wi, const Vector3D& wo) const;
RGBColor SampleBRDF(const ShadeRecord& sr, Vector3D& wi, const Vector3D& wo) const;
RGBColor Rho(const ShadeRecord& sr, const Vector3D& wo) const;
};
#endif
| [
"shyam.prathish@tamu.edu"
] | shyam.prathish@tamu.edu |
be833259381dd3f6d6a2cdd41221d3e5869a830e | 14b33be3928764026e3d0431edfb01b79e733986 | /9781285852744/605-11.cpp | 956bd17c90b4847cb747d750f9df4c8e1b530595 | [] | no_license | gcmillora/slader-codes | cfb4f9ff3fc9346ad6abd645111b3006740cffef | 282a0cf384ed1d499818e3e9b45ec117e681a2d3 | refs/heads/main | 2023-05-03T08:01:20.707814 | 2021-05-11T13:21:35 | 2021-05-11T13:21:35 | 342,483,286 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 234 | cpp | #include<iostream>
#include <string>
using namespace std;
void getData(string num1,string num2){
getline(cin,num1);
getline(cin,num2);
}
int main(){
string str_num1;
string str_num2;
getData(str_num1,str_num2);
} | [
"59990974+gcmillora@users.noreply.github.com"
] | 59990974+gcmillora@users.noreply.github.com |
d8f36ee3a80da888bddeb62c235d9777fab193e4 | 4d42d26fd71bf977d422fbb06ba40e8dba494b0f | /dynamic/wrappers/cell_based/DiffusionCaUpdateRule2.pypp.cpp | c5fb9f08b7a98bc0be970261cf849d5fcb559c64 | [] | no_license | myousefi2016/PyChaste | dc1649b9992aeecabdbe2a1977541757b7e9fd6c | af5b30d5135ed0a0664d695ca62b0e88af05ca1b | refs/heads/master | 2020-12-30T12:34:48.266420 | 2017-04-13T10:04:09 | 2017-04-13T10:04:09 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,632 | cpp | // This file has been generated by Py++.
/*
Copyright (c) 2005-2016, University of Oxford.
All rights reserved.
University of Oxford means the Chancellor, Masters and Scholars of the
University of Oxford, having an administrative office at Wellington
Square, Oxford OX1 2JD, UK.
This file is part of Chaste.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the University of Oxford 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 "boost/python.hpp"
#include "cell_based_headers.hpp"
#include "DiffusionCaUpdateRule2.pypp.hpp"
namespace bp = boost::python;
struct DiffusionCaUpdateRule_less__2__greater__wrapper : DiffusionCaUpdateRule< 2 >, bp::wrapper< DiffusionCaUpdateRule< 2 > > {
DiffusionCaUpdateRule_less__2__greater__wrapper(DiffusionCaUpdateRule<2> const & arg )
: DiffusionCaUpdateRule<2>( arg )
, bp::wrapper< DiffusionCaUpdateRule< 2 > >(){
// copy constructor
}
DiffusionCaUpdateRule_less__2__greater__wrapper( )
: DiffusionCaUpdateRule<2>( )
, bp::wrapper< DiffusionCaUpdateRule< 2 > >(){
// null constructor
}
virtual double EvaluateProbability( unsigned int currentNodeIndex, unsigned int targetNodeIndex, ::CaBasedCellPopulation< 2 > & rCellPopulation, double dt, double deltaX, ::CellPtr cell ) {
if( bp::override func_EvaluateProbability = this->get_override( "EvaluateProbability" ) )
return func_EvaluateProbability( currentNodeIndex, targetNodeIndex, boost::ref(rCellPopulation), dt, deltaX, cell );
else{
return this->DiffusionCaUpdateRule< 2 >::EvaluateProbability( currentNodeIndex, targetNodeIndex, boost::ref(rCellPopulation), dt, deltaX, cell );
}
}
double default_EvaluateProbability( unsigned int currentNodeIndex, unsigned int targetNodeIndex, ::CaBasedCellPopulation< 2 > & rCellPopulation, double dt, double deltaX, ::CellPtr cell ) {
return DiffusionCaUpdateRule< 2 >::EvaluateProbability( currentNodeIndex, targetNodeIndex, boost::ref(rCellPopulation), dt, deltaX, cell );
}
virtual void OutputUpdateRuleParameters( ::out_stream & rParamsFile ) {
if( bp::override func_OutputUpdateRuleParameters = this->get_override( "OutputUpdateRuleParameters" ) )
func_OutputUpdateRuleParameters( boost::ref(rParamsFile) );
else{
this->DiffusionCaUpdateRule< 2 >::OutputUpdateRuleParameters( boost::ref(rParamsFile) );
}
}
void default_OutputUpdateRuleParameters( ::out_stream & rParamsFile ) {
DiffusionCaUpdateRule< 2 >::OutputUpdateRuleParameters( boost::ref(rParamsFile) );
}
};
void register_DiffusionCaUpdateRule2_class(){
bp::class_< DiffusionCaUpdateRule_less__2__greater__wrapper, bp::bases< AbstractCaUpdateRule< 2 > > >( "DiffusionCaUpdateRule2", bp::init< >() )
.def(
"EvaluateProbability"
, (double ( ::DiffusionCaUpdateRule<2>::* )( unsigned int,unsigned int,::CaBasedCellPopulation< 2 > &,double,double,::CellPtr ))(&::DiffusionCaUpdateRule< 2 >::EvaluateProbability)
, (double ( DiffusionCaUpdateRule_less__2__greater__wrapper::* )( unsigned int,unsigned int,::CaBasedCellPopulation< 2 > &,double,double,::CellPtr ))(&DiffusionCaUpdateRule_less__2__greater__wrapper::default_EvaluateProbability)
, ( bp::arg("currentNodeIndex"), bp::arg("targetNodeIndex"), bp::arg("rCellPopulation"), bp::arg("dt"), bp::arg("deltaX"), bp::arg("cell") ) )
.def(
"GetDiffusionParameter"
, (double ( ::DiffusionCaUpdateRule<2>::* )( ))( &::DiffusionCaUpdateRule< 2 >::GetDiffusionParameter ) )
.def(
"OutputUpdateRuleParameters"
, (void ( ::DiffusionCaUpdateRule<2>::* )( ::out_stream & ))(&::DiffusionCaUpdateRule< 2 >::OutputUpdateRuleParameters)
, (void ( DiffusionCaUpdateRule_less__2__greater__wrapper::* )( ::out_stream & ))(&DiffusionCaUpdateRule_less__2__greater__wrapper::default_OutputUpdateRuleParameters)
, ( bp::arg("rParamsFile") ) )
.def(
"SetDiffusionParameter"
, (void ( ::DiffusionCaUpdateRule<2>::* )( double ))( &::DiffusionCaUpdateRule< 2 >::SetDiffusionParameter )
, ( bp::arg("diffusionParameter") ) );
}
| [
"grogan@maths.ox.ac.uk"
] | grogan@maths.ox.ac.uk |
35b7f71ec0bdbebd2f5a392d40628dfa2728edba | bb6ebff7a7f6140903d37905c350954ff6599091 | /ppapi/proxy/ppb_audio_proxy.cc | d84c3cb6995837ca992527c420d0b52328177088 | [
"BSD-3-Clause",
"LicenseRef-scancode-khronos"
] | permissive | PDi-Communication-Systems-Inc/lollipop_external_chromium_org | faa6602bd6bfd9b9b6277ce3cd16df0bd26e7f2f | ccadf4e63dd34be157281f53fe213d09a8c66d2c | refs/heads/master | 2022-12-23T18:07:04.568931 | 2016-04-11T16:03:36 | 2016-04-11T16:03:36 | 53,677,925 | 0 | 1 | BSD-3-Clause | 2022-12-09T23:46:46 | 2016-03-11T15:49:07 | C++ | UTF-8 | C++ | false | false | 12,037 | cc | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ppapi/proxy/ppb_audio_proxy.h"
#include "base/compiler_specific.h"
#include "base/threading/simple_thread.h"
#include "ppapi/c/pp_errors.h"
#include "ppapi/c/ppb_audio.h"
#include "ppapi/c/ppb_audio_config.h"
#include "ppapi/c/ppb_var.h"
#include "ppapi/proxy/enter_proxy.h"
#include "ppapi/proxy/plugin_dispatcher.h"
#include "ppapi/proxy/ppapi_messages.h"
#include "ppapi/shared_impl/api_id.h"
#include "ppapi/shared_impl/platform_file.h"
#include "ppapi/shared_impl/ppapi_globals.h"
#include "ppapi/shared_impl/ppb_audio_shared.h"
#include "ppapi/shared_impl/resource.h"
#include "ppapi/thunk/ppb_audio_config_api.h"
#include "ppapi/thunk/enter.h"
#include "ppapi/thunk/resource_creation_api.h"
#include "ppapi/thunk/thunk.h"
using ppapi::IntToPlatformFile;
using ppapi::proxy::SerializedHandle;
using ppapi::thunk::EnterResourceNoLock;
using ppapi::thunk::PPB_Audio_API;
using ppapi::thunk::PPB_AudioConfig_API;
namespace ppapi {
namespace proxy {
class Audio : public Resource, public PPB_Audio_Shared {
public:
Audio(const HostResource& audio_id,
PP_Resource config_id,
const AudioCallbackCombined& callback,
void* user_data);
virtual ~Audio();
// Resource overrides.
virtual PPB_Audio_API* AsPPB_Audio_API();
// PPB_Audio_API implementation.
virtual PP_Resource GetCurrentConfig() OVERRIDE;
virtual PP_Bool StartPlayback() OVERRIDE;
virtual PP_Bool StopPlayback() OVERRIDE;
virtual int32_t Open(
PP_Resource config_id,
scoped_refptr<TrackedCallback> create_callback) OVERRIDE;
virtual int32_t GetSyncSocket(int* sync_socket) OVERRIDE;
virtual int32_t GetSharedMemory(int* shm_handle, uint32_t* shm_size) OVERRIDE;
private:
// Owning reference to the current config object. This isn't actually used,
// we just dish it out as requested by the plugin.
PP_Resource config_;
DISALLOW_COPY_AND_ASSIGN(Audio);
};
Audio::Audio(const HostResource& audio_id,
PP_Resource config_id,
const AudioCallbackCombined& callback,
void* user_data)
: Resource(OBJECT_IS_PROXY, audio_id),
config_(config_id) {
SetCallback(callback, user_data);
PpapiGlobals::Get()->GetResourceTracker()->AddRefResource(config_);
}
Audio::~Audio() {
#if defined(OS_NACL)
// Invoke StopPlayback() to ensure audio back-end has a chance to send the
// escape value over the sync socket, which will terminate the client side
// audio callback loop. This is required for NaCl Plugins that can't escape
// by shutting down the sync_socket.
StopPlayback();
#endif
PpapiGlobals::Get()->GetResourceTracker()->ReleaseResource(config_);
}
PPB_Audio_API* Audio::AsPPB_Audio_API() {
return this;
}
PP_Resource Audio::GetCurrentConfig() {
// AddRef for the caller.
PpapiGlobals::Get()->GetResourceTracker()->AddRefResource(config_);
return config_;
}
PP_Bool Audio::StartPlayback() {
if (playing())
return PP_TRUE;
if (!PPB_Audio_Shared::IsThreadFunctionReady())
return PP_FALSE;
SetStartPlaybackState();
PluginDispatcher::GetForResource(this)->Send(
new PpapiHostMsg_PPBAudio_StartOrStop(
API_ID_PPB_AUDIO, host_resource(), true));
return PP_TRUE;
}
PP_Bool Audio::StopPlayback() {
if (!playing())
return PP_TRUE;
PluginDispatcher::GetForResource(this)->Send(
new PpapiHostMsg_PPBAudio_StartOrStop(
API_ID_PPB_AUDIO, host_resource(), false));
SetStopPlaybackState();
return PP_TRUE;
}
int32_t Audio::Open(PP_Resource config_id,
scoped_refptr<TrackedCallback> create_callback) {
return PP_ERROR_NOTSUPPORTED; // Don't proxy the trusted interface.
}
int32_t Audio::GetSyncSocket(int* sync_socket) {
return PP_ERROR_NOTSUPPORTED; // Don't proxy the trusted interface.
}
int32_t Audio::GetSharedMemory(int* shm_handle, uint32_t* shm_size) {
return PP_ERROR_NOTSUPPORTED; // Don't proxy the trusted interface.
}
PPB_Audio_Proxy::PPB_Audio_Proxy(Dispatcher* dispatcher)
: InterfaceProxy(dispatcher),
callback_factory_(this) {
}
PPB_Audio_Proxy::~PPB_Audio_Proxy() {
}
// static
PP_Resource PPB_Audio_Proxy::CreateProxyResource(
PP_Instance instance_id,
PP_Resource config_id,
const AudioCallbackCombined& audio_callback,
void* user_data) {
PluginDispatcher* dispatcher = PluginDispatcher::GetForInstance(instance_id);
if (!dispatcher)
return 0;
EnterResourceNoLock<PPB_AudioConfig_API> config(config_id, true);
if (config.failed())
return 0;
if (!audio_callback.IsValid())
return 0;
HostResource result;
dispatcher->Send(new PpapiHostMsg_PPBAudio_Create(
API_ID_PPB_AUDIO, instance_id,
config.object()->GetSampleRate(), config.object()->GetSampleFrameCount(),
&result));
if (result.is_null())
return 0;
return (new Audio(result, config_id,
audio_callback, user_data))->GetReference();
}
bool PPB_Audio_Proxy::OnMessageReceived(const IPC::Message& msg) {
bool handled = true;
IPC_BEGIN_MESSAGE_MAP(PPB_Audio_Proxy, msg)
// Don't build host side into NaCl IRT.
#if !defined(OS_NACL)
IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBAudio_Create, OnMsgCreate)
IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBAudio_StartOrStop,
OnMsgStartOrStop)
#endif
IPC_MESSAGE_HANDLER(PpapiMsg_PPBAudio_NotifyAudioStreamCreated,
OnMsgNotifyAudioStreamCreated)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
return handled;
}
#if !defined(OS_NACL)
void PPB_Audio_Proxy::OnMsgCreate(PP_Instance instance_id,
int32_t sample_rate,
uint32_t sample_frame_count,
HostResource* result) {
thunk::EnterResourceCreation resource_creation(instance_id);
if (resource_creation.failed())
return;
// Make the resource and get the API pointer to its trusted interface.
result->SetHostResource(
instance_id,
resource_creation.functions()->CreateAudioTrusted(instance_id));
if (result->is_null())
return;
// At this point, we've set the result resource, and this is a sync request.
// Anything below this point must issue the AudioChannelConnected callback
// to the browser. Since that's an async message, it will be issued back to
// the plugin after the Create function returns (which is good because it
// would be weird to get a connected message with a failure code for a
// resource you haven't finished creating yet).
//
// The ...ForceCallback class will help ensure the callback is always called.
// All error cases must call SetResult on this class.
EnterHostFromHostResourceForceCallback<PPB_Audio_API> enter(
*result, callback_factory_,
&PPB_Audio_Proxy::AudioChannelConnected, *result);
if (enter.failed())
return; // When enter fails, it will internally schedule the callback.
// Make an audio config object.
PP_Resource audio_config_res =
resource_creation.functions()->CreateAudioConfig(
instance_id, static_cast<PP_AudioSampleRate>(sample_rate),
sample_frame_count);
if (!audio_config_res) {
enter.SetResult(PP_ERROR_FAILED);
return;
}
// Initiate opening the audio object.
enter.SetResult(enter.object()->Open(audio_config_res,
enter.callback()));
// Clean up the temporary audio config resource we made.
const PPB_Core* core = static_cast<const PPB_Core*>(
dispatcher()->local_get_interface()(PPB_CORE_INTERFACE));
core->ReleaseResource(audio_config_res);
}
void PPB_Audio_Proxy::OnMsgStartOrStop(const HostResource& audio_id,
bool play) {
EnterHostFromHostResource<PPB_Audio_API> enter(audio_id);
if (enter.failed())
return;
if (play)
enter.object()->StartPlayback();
else
enter.object()->StopPlayback();
}
void PPB_Audio_Proxy::AudioChannelConnected(
int32_t result,
const HostResource& resource) {
IPC::PlatformFileForTransit socket_handle =
IPC::InvalidPlatformFileForTransit();
base::SharedMemoryHandle shared_memory = IPC::InvalidPlatformFileForTransit();
uint32_t audio_buffer_length = 0;
int32_t result_code = result;
if (result_code == PP_OK) {
result_code = GetAudioConnectedHandles(resource, &socket_handle,
&shared_memory,
&audio_buffer_length);
}
// Send all the values, even on error. This simplifies some of our cleanup
// code since the handles will be in the other process and could be
// inconvenient to clean up. Our IPC code will automatically handle this for
// us, as long as the remote side always closes the handles it receives
// (in OnMsgNotifyAudioStreamCreated), even in the failure case.
SerializedHandle fd_wrapper(SerializedHandle::SOCKET, socket_handle);
SerializedHandle handle_wrapper(shared_memory, audio_buffer_length);
dispatcher()->Send(new PpapiMsg_PPBAudio_NotifyAudioStreamCreated(
API_ID_PPB_AUDIO, resource, result_code, fd_wrapper, handle_wrapper));
}
int32_t PPB_Audio_Proxy::GetAudioConnectedHandles(
const HostResource& resource,
IPC::PlatformFileForTransit* foreign_socket_handle,
base::SharedMemoryHandle* foreign_shared_memory_handle,
uint32_t* shared_memory_length) {
// Get the audio interface which will give us the handles.
EnterHostFromHostResource<PPB_Audio_API> enter(resource);
if (enter.failed())
return PP_ERROR_NOINTERFACE;
// Get the socket handle for signaling.
int32_t socket_handle;
int32_t result = enter.object()->GetSyncSocket(&socket_handle);
if (result != PP_OK)
return result;
// socket_handle doesn't belong to us: don't close it.
*foreign_socket_handle = dispatcher()->ShareHandleWithRemote(
IntToPlatformFile(socket_handle), false);
if (*foreign_socket_handle == IPC::InvalidPlatformFileForTransit())
return PP_ERROR_FAILED;
// Get the shared memory for the buffer.
int shared_memory_handle;
result = enter.object()->GetSharedMemory(&shared_memory_handle,
shared_memory_length);
if (result != PP_OK)
return result;
// shared_memory_handle doesn't belong to us: don't close it.
*foreign_shared_memory_handle = dispatcher()->ShareHandleWithRemote(
IntToPlatformFile(shared_memory_handle), false);
if (*foreign_shared_memory_handle == IPC::InvalidPlatformFileForTransit())
return PP_ERROR_FAILED;
return PP_OK;
}
#endif // !defined(OS_NACL)
// Processed in the plugin (message from host).
void PPB_Audio_Proxy::OnMsgNotifyAudioStreamCreated(
const HostResource& audio_id,
int32_t result_code,
SerializedHandle socket_handle,
SerializedHandle handle) {
CHECK(socket_handle.is_socket());
CHECK(handle.is_shmem());
EnterPluginFromHostResource<PPB_Audio_API> enter(audio_id);
if (enter.failed() || result_code != PP_OK) {
// The caller may still have given us these handles in the failure case.
// The easiest way to clean these up is to just put them in the objects
// and then close them. This failure case is not performance critical.
base::SyncSocket temp_socket(
IPC::PlatformFileForTransitToPlatformFile(socket_handle.descriptor()));
base::SharedMemory temp_mem(handle.shmem(), false);
} else {
EnterResourceNoLock<PPB_AudioConfig_API> config(
static_cast<Audio*>(enter.object())->GetCurrentConfig(), true);
static_cast<Audio*>(enter.object())->SetStreamInfo(
enter.resource()->pp_instance(), handle.shmem(), handle.size(),
IPC::PlatformFileForTransitToPlatformFile(socket_handle.descriptor()),
config.object()->GetSampleRate(),
config.object()->GetSampleFrameCount());
}
}
} // namespace proxy
} // namespace ppapi
| [
"mrobbeloth@pdiarm.com"
] | mrobbeloth@pdiarm.com |
ac2cecec1937298be25af77a3dafe59fa94514e0 | 83bacfbdb7ad17cbc2fc897b3460de1a6726a3b1 | /third_party/WebKit/Source/modules/plugins/DOMPluginArray.h | ee22470faa2bb7189b6023b2dc03593c6b712598 | [
"BSD-3-Clause",
"LGPL-2.0-or-later",
"LicenseRef-scancode-warranty-disclaimer",
"LGPL-2.1-only",
"GPL-1.0-or-later",
"GPL-2.0-only",
"LGPL-2.0-only",
"BSD-2-Clause",
"LicenseRef-scancode-other-copyleft",
"Apache-2.0"
] | permissive | cool2528/miniblink49 | d909e39012f2c5d8ab658dc2a8b314ad0050d8ea | 7f646289d8074f098cf1244adc87b95e34ab87a8 | refs/heads/master | 2020-06-05T03:18:43.211372 | 2019-06-01T08:57:37 | 2019-06-01T08:59:56 | 192,294,645 | 2 | 0 | Apache-2.0 | 2019-06-17T07:16:28 | 2019-06-17T07:16:27 | null | UTF-8 | C++ | false | false | 1,870 | h | /*
Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
Copyright (C) 2008 Apple Inc. All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef DOMPluginArray_h
#define DOMPluginArray_h
#include "bindings/core/v8/ScriptWrappable.h"
#include "core/frame/DOMWindowProperty.h"
#include "modules/plugins/DOMPlugin.h"
#include "platform/heap/Handle.h"
#include "wtf/Forward.h"
namespace blink {
class LocalFrame;
class PluginData;
class DOMPluginArray final : public GarbageCollectedFinalized<DOMPluginArray>, public ScriptWrappable, public DOMWindowProperty {
DEFINE_WRAPPERTYPEINFO();
WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(DOMPluginArray);
public:
static DOMPluginArray* create(LocalFrame* frame)
{
return new DOMPluginArray(frame);
}
unsigned length() const;
DOMPlugin* item(unsigned index);
DOMPlugin* namedItem(const AtomicString& propertyName);
void refresh(bool reload);
DECLARE_VIRTUAL_TRACE();
private:
explicit DOMPluginArray(LocalFrame*);
PluginData* pluginData() const;
};
} // namespace blink
#endif // DOMPluginArray_h
| [
"22249030@qq.com"
] | 22249030@qq.com |
6bc7d58d917e14f4ca5edc6c4643034257d4b492 | 9e53d765020db9361c393f32f8c228c5dee22473 | /FFT/FFTShift.h | 2fd973ea08a329a269ccea6d3795757e2a5ef173 | [] | no_license | marwan-abdellah/Dummy | 1173bb6ac79e619863c1cb77c5099ebd26c55199 | 1e5c0f1656b9ecb0430ababf381b128036177212 | refs/heads/master | 2020-05-20T04:09:33.462476 | 2012-08-17T02:44:01 | 2012-08-17T02:44:01 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,948 | h | /*********************************************************************
* Copyrights (c) Marwan Abdellah. All rights reserved.
* This code is part of my Master's Thesis Project entitled "High
* Performance Fourier Volume Rendering on Graphics Processing Units
* (GPUs)" and submitted to the Systems & Biomedical Engineering
* Department, Faculty of Engineering, Cairo University.
* Please, don't use or distribute without authors' permission.
* File : Typedefs.h
* Author(s) : Marwan Abdellah <abdellah.marwan@gmail.com>
* Created : April 2011
* Description :
* Note(s) :
*********************************************************************/
#ifndef FFT_SHIFT_H_
#define FFT_SHIFT_H_
#include "Globals.h"
#include "CUDA/cuGlobals.h"
#include "Utilities/MACROS.h"
#include "Timers/BoostTimers.h"
#include "Timers/TimerGlobals.h"
namespace FFT
{
/* @ float*/
float* FFT_Shift_1D_float(float* input, int nX, durationStruct* duration);
float** FFT_Shift_2D_float(float** input, int nX, int nY, durationStruct* duration);
float*** FFT_Shift_3D_float(float*** input, int nX, int nY, int nZ, durationStruct* duration);
float* repack_2D_float(float** input_2D, int nX, int nY, durationStruct* duration);
float* repack_3D_float(float*** input_3D, int nX, int nY, int nZ, durationStruct* duration);
/* @ double */
double* FFT_Shift_1D_double(double* input, int nX, durationStruct* duration);
double** FFT_Shift_2D_double(double** input, int nX, int nY, durationStruct* duration);
double*** FFT_Shift_3D_double(double*** input, int nX, int nY, int nZ, durationStruct* duration);
double* repack_2D_double(double** input_2D, int nX, int nY, durationStruct* duration);
double* repack_3D_double(double*** input_3D, int nX, int nY, int nZ, durationStruct* duration);
/* @ cuComplex */
cuComplex* FFT_Shift_1D_cuComplex(cuComplex* input, int nX, durationStruct* duration);
cuComplex** FFT_Shift_2D_cuComplex(cuComplex** input, int nX, int nY, durationStruct* duration);
cuComplex*** FFT_Shift_3D_cuComplex(cuComplex*** input, int nX, int nY, int nZ, durationStruct* duration);
cuComplex* repack_2D_cuComplex(cuComplex** input_2D, int nX, int nY, durationStruct* duration);
cuComplex* repack_3D_cuComplex(cuComplex*** input_3D, int nX, int nY, int nZ, durationStruct* duration);
/* @ cuDoubleComplex */
cuDoubleComplex* FFT_Shift_1D_cuDoubleComplex(cuDoubleComplex* input, int nX, durationStruct* duration);
cuDoubleComplex** FFT_Shift_2D_cuDoubleComplex(cuDoubleComplex** input, int nX, int nY, durationStruct* duration);
cuDoubleComplex*** FFT_Shift_3D_cuDoubleComplex(cuDoubleComplex*** input, int nX, int nY, int nZ, durationStruct* duration);
cuDoubleComplex* repack_2D_cuDoubleComplex(cuDoubleComplex** input_2D, int nX, int nY, durationStruct* duration);
cuDoubleComplex* repack_3D_cuDoubleComplex(cuDoubleComplex*** input_3D, int nX, int nY, int nZ, durationStruct* duration);
}
#endif /* FFT_SHIFT_H_ */
| [
"abdellah.marwan@gmail.com"
] | abdellah.marwan@gmail.com |
51252db83ff5f2b65328e6c2fe2db837e89ccaa8 | e8e233d8370d0c087cda77e91c086a0d35474c1f | /exercises/cpp/ukf_mean_and_cov/ukf.cpp | 19143414c452c1dccf16ce9a87ba40969cee7567 | [] | no_license | mohanadhammad/sfnd-unscented-kalman-filter | 3d44fc7ccf0d771abec5a36da126b38b4ca6aad3 | 8d2d072bae45e05564060e458ee1e4e0065675e3 | refs/heads/master | 2022-04-20T04:42:15.326469 | 2020-04-19T16:31:21 | 2020-04-19T16:31:21 | 256,297,944 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,718 | cpp | #include <iostream>
#include "ukf.h"
using Eigen::MatrixXd;
using Eigen::VectorXd;
UKF::UKF() {
Init();
}
UKF::~UKF() {
}
void UKF::Init() {
}
/**
* Programming assignment functions:
*/
void UKF::PredictMeanAndCovariance(VectorXd* x_out, MatrixXd* P_out) {
// set state dimension
int n_x = 5;
// set augmented dimension
int n_aug = 7;
// define spreading parameter
double lambda = 3 - n_aug;
// create example matrix with predicted sigma points
MatrixXd Xsig_pred = MatrixXd(n_x, 2 * n_aug + 1);
Xsig_pred <<
5.9374, 6.0640, 5.925, 5.9436, 5.9266, 5.9374, 5.9389, 5.9374, 5.8106, 5.9457, 5.9310, 5.9465, 5.9374, 5.9359, 5.93744,
1.48, 1.4436, 1.660, 1.4934, 1.5036, 1.48, 1.4868, 1.48, 1.5271, 1.3104, 1.4787, 1.4674, 1.48, 1.4851, 1.486,
2.204, 2.2841, 2.2455, 2.2958, 2.204, 2.204, 2.2395, 2.204, 2.1256, 2.1642, 2.1139, 2.204, 2.204, 2.1702, 2.2049,
0.5367, 0.47338, 0.67809, 0.55455, 0.64364, 0.54337, 0.5367, 0.53851, 0.60017, 0.39546, 0.51900, 0.42991, 0.530188, 0.5367, 0.535048,
0.352, 0.29997, 0.46212, 0.37633, 0.4841, 0.41872, 0.352, 0.38744, 0.40562, 0.24347, 0.32926, 0.2214, 0.28687, 0.352, 0.318159;
// create vector for weights
VectorXd weights = VectorXd(2*n_aug+1);
// create vector for predicted state
VectorXd x = VectorXd(n_x);
// create covariance matrix for prediction
MatrixXd P = MatrixXd(n_x, n_x);
/**
* Student part begin
*/
// set weights
double a = n_aug + lambda;
weights(0) = lambda / a;
for (size_t i = 1; i < weights.rows(); i++)
{
weights(i) = 0.5 / a;
}
// predict state mean
for (size_t i = 0; i < Xsig_pred.cols(); ++i)
{
x += weights(i) * Xsig_pred.col(i);
}
// wrap the angle between [-180, 180]
while (x(3) > M_PI)
{
x(3) -= 2*M_PI;
}
while (x(3) < -M_PI)
{
x(3) += 2*M_PI;
}
// predict state covariance matrix
for (size_t i = 0; i < Xsig_pred.cols(); i++)
{
VectorXd xDiff = Xsig_pred.col(i) - x;
while (xDiff(3) > M_PI)
{
xDiff(3) -= 2*M_PI;
}
while (xDiff(3) < -M_PI)
{
xDiff(3) += 2*M_PI;
}
P += weights(i) * xDiff * xDiff.transpose();
}
/**
* Student part end
*/
// print result
std::cout << "Predicted state" << std::endl;
std::cout << x << std::endl;
std::cout << "Predicted covariance matrix" << std::endl;
std::cout << P << std::endl;
// write result
*x_out = x;
*P_out = P;
} | [
"mohanad.magdy.hammad@gmail.com"
] | mohanad.magdy.hammad@gmail.com |
c9a015ba96f02cad2c3190db80b84462e48a19ed | 21db87cb0d86cb639c6a325dd2a4316391bfd408 | /frequency_table.cpp | e3bb4673688892510977277495f6879667e759b7 | [] | no_license | juliag325/Huffman-Encoder | 58c5f0f4a4521714692c9c1af8dc1c8bd315766b | 9498a75ae64858f739887ec7e285c1af12c15c6e | refs/heads/master | 2022-04-21T07:38:08.361292 | 2020-04-15T18:10:15 | 2020-04-15T18:10:15 | 257,662,699 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,665 | cpp | #include <iostream>
#include "frequency_table.h"
#include <fstream>
#include <sstream>
frequency_table::frequency_table(const std::string &file_name) {
//Takes in a text file of characters.
char ch;
//read in file name
std::fstream input(file_name, std::fstream::in);
if (input.fail()) {
throw std::runtime_error ("File does not exist");
}
input >> std::noskipws;
//create hashmap
frequency_table m();
//While the file is not done (don't skip whitespace)
while (input >> ch) {
//if it exists
if (frequency_table::m.count(ch) > 0) {
frequency_table::m.at(ch)++;
}
else {
//doesn't exist
frequency_table::m.insert(std::pair<char, int>(ch,1));
}
}
}
frequency_table::~frequency_table() {
m.clear();
}
int frequency_table::get_frequency(char c) const {
//Given a character c
// Check if it exists - if it does, return the frequency int.
//else return runtime (does not exist?)
int result;
// If c doesn't exist
if (m.find(c) == m.end()) {
result = 0;
return result;
}
//c does exist!!
else {
result = m.at(c);
return result;
}
}
/* Logic:
Iterate through the text file, character by character (include spaces)
If character does not exist in the hashmap, put as key and add value count.
else
add value count to the character that already exists
if file is not found, return runtime error if file is not found
*/ | [
"juliag325@gmail.com"
] | juliag325@gmail.com |
4190635bf2dda1e8aad7c26f836eaa12fccbc36a | 2eeab40a405a7b27a52386f52f6f9753672cde78 | /OJ_Codes/CodeMarshal/kuet_iupc_2019/G.cpp | 15a8a0e230a6519e030ea7ffd63785dd68513798 | [] | no_license | rifatr/Competitive-Programming | c562c56f5090b9b76510d8c57e74a2c90d723643 | e802d9e73624607904223fddf7f29950fa429341 | refs/heads/master | 2023-05-24T02:02:56.062656 | 2023-05-22T08:08:02 | 2023-05-22T08:08:02 | 611,465,080 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,296 | cpp | #include<bits/stdc++.h>
using namespace std;
#define endl '\n'
#define pb push_back
#define pii pair<int,int>
const int mx=3e4+5;
vector<pii>adj[mx];
int sum;
int vis[mx];
int n,m,q,root;
int parent[mx];
int dist[mx],tot[mx],type[mx];
///0==singlular,1=circular
void dfs(int node,int par)
{
vis[node]=1;
parent[node]=root;
for(auto son:adj[node])
{
if(son.first==par) continue;
if(son.first==root)
{
sum+=son.second;
continue;
}
if(vis[son.first]) continue;
sum+=son.second;
dist[son.first]=sum;
dfs(son.first,node);
}
}
void all_clear()
{
for(int i=1; i<=n; i++)
{
adj[i].clear();
vis[i]=0;
dist[i]=0;
tot[i]=0;
type[i]=0;
parent[i]=i;
}
}
int main()
{
ios_base::sync_with_stdio(0); cin.tie(0);
int t;
cin>>t;
int tc=0;
while(t--)
{
cin>>n>>m;
all_clear();
for(int i=0; i<m; i++)
{
int x,y,z;
cin>>x>>y>>z;
adj[x].pb({y,z});
adj[y].pb({x,z});
}
for(int i=1; i<=n; i++)
{
if(vis[i] || adj[i].size()>1) continue;
sum=0;
root=i;
dfs(i,0);
dist[root]=0;
tot[root]=sum;
}
for(int i=1; i<=n; i++)
{
if(vis[i]) continue;
sum=0;
root=i;
dfs(i,0);
dist[root]=0;
tot[root]=sum;
type[root]=1;
}
cin>>q;
cout<<"Case "<<++tc<<":"<<endl;
while(q--)
{
int x,y;
cin>>x>>y;
if(parent[x]!=parent[y])
{
cout<<-1<<endl;
continue;
}
if(type[parent[x]]==0)///singular
{
int mx=max(dist[x],dist[y]);
int mn=min(dist[x],dist[y]);
cout<<mx-mn<<endl;
continue;
}
int mx=max(dist[x],dist[y]);
int mn=min(dist[x],dist[y]);
int ans=mx-mn;
ans=min(ans,tot[parent[x]]-ans);
cout<<ans<<endl;
}
}
}
/**
1
5 5
1 2 1
2 3 2
3 4 3
5 1 5
4 5 4
4
1 1
1 3
3 5
5 2
*/
| [
"rifatrraazz@gmail.com"
] | rifatrraazz@gmail.com |
b200c6929d6fcc00688ff36afe3ae6bb32cae324 | ca4a4112c45423fc5727eeeae7c49e87c9deb33e | /Source/AddDelDlg.cpp | 3c13b117a0009b62afa45f5b3c18db8bf1949528 | [] | no_license | Wagnerp/Word-Aid | 0a3a099f729b0738ccd047ecd6e2f88efcc21f0f | aef97b39ed1e5718c5bf67c00599efe0e7d7bf75 | refs/heads/master | 2020-07-11T11:27:02.936143 | 2019-08-26T17:38:54 | 2019-08-26T17:38:54 | 204,526,971 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,199 | cpp | // AddDelDlg.cpp : implementation file
//
#include "stdafx.h"
#include "wordaid2.h"
#include "AddDelDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CAddDelDlg dialog
CAddDelDlg::CAddDelDlg(CWnd* pParent /*=NULL*/)
: CDialog(CAddDelDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CAddDelDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CAddDelDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAddDelDlg)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CAddDelDlg, CDialog)
//{{AFX_MSG_MAP(CAddDelDlg)
ON_BN_CLICKED(IDC_CHK_TOPIC, OnChkTopic)
ON_BN_CLICKED(IDC_CHK_ALPHA, OnChkAlpha)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
int CAddDelDlg::GetType()
{
return m_nType;
}
/////////////////////////////////////////////////////////////////////////////
// CAddDelDlg message handlers
void CAddDelDlg::OnChkTopic()
{
// TODO: Add your control notification handler code here
m_nType = IDC_CHK_TOPIC;
OnOK();
}
void CAddDelDlg::OnChkAlpha()
{
// TODO: Add your control notification handler code here
m_nType = IDC_CHK_ALPHA;
OnOK();
}
void CAddDelDlg::OnOK()
{
// TODO: Add extra validation here
CDialog::OnOK();
}
BOOL CAddDelDlg::OnInitDialog()
{
CDialog::OnInitDialog();
CStatic* text = (CStatic*)GetDlgItem(IDC_STATIC_5);
CString szTitle = _T("");
// TODO: Add extra initialization here
if (m_bAdd)
szTitle.LoadString(IDS_INSERT_WORD);
else
szTitle.LoadString(IDS_DELETE_WORD);
text->SetWindowText(szTitle);
CButton* button = (CButton*)GetDlgItem(IDC_CHK_ALPHA);
szTitle.LoadString(IDS_ALPHA_WORDLIST);
button->SetWindowText(szTitle);
button = (CButton*)GetDlgItem(IDC_CHK_TOPIC);
szTitle.LoadString(IDS_TOPIC_WORDLIST);
button->SetWindowText(szTitle);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
| [
"noreply@github.com"
] | noreply@github.com |
561186cd8ef9fc31d7b9ccba52fc926b35a430fd | a3c7af0084f4fc7e21715f1a6108d5edcbd1deed | /BeaconMap/work/milestone0/main/src/main.cpp | 743f0f1cffcc119221f70372b71b731cec59f7f8 | [] | no_license | SauryCC/BeaconMap | b0bcfcc1f3b01fc4bbcdf6dd2242efa67fc4e686 | b45185f765b707d073e8cb1c8b8f89c050a71967 | refs/heads/master | 2020-04-28T09:07:00.093883 | 2019-03-12T07:17:35 | 2019-03-12T07:17:35 | 175,154,617 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,037 | cpp | /*
* File: physics_utils.h
* Author: Mohamed
*
* Description: Computes center of mass of a cuboid with various density distribution functions.
*/
#include <iostream>
#include "math_utils.h"
#include "physics_utils.h"
#include "Polynomial.h"
#include "Coordinates.h"
#include <iomanip>
using namespace std;
int main() {
//define a density polynomial
Polynomial *my_density_function = new Polynomial(5,3,0.5,2,1,5);
Polynomial *my_density_function_g = new Polynomial(1,1,2,2,3,3);
//find the center of mass of a cuboid of size (5,6,10) with our density function
Coordinates center_of_mass = compute_center_of_mass(*my_density_function,5,6,10);
Coordinates center_of_mass_g = compute_center_of_mass(*my_density_function_g,5,5,5);
//print out center of mass
cout << setprecision(4) << "center of mass (x,y,z) = " << center_of_mass << endl;
cout << setprecision(4) << "center of mass_g (x,y,z) = " << center_of_mass_g << endl;
//a useless print statement
return 0;
}
| [
"31738977+SauryCC@users.noreply.github.com"
] | 31738977+SauryCC@users.noreply.github.com |
059a1492b99efe8b40be1d92de362f48c2e8cc44 | c78c31473a3bf0cb181e166472670b1f30c55f24 | /GAME1017_Template_W01/SpriteSheet.cpp | 6b81389ea5ada255da8a748ae1db05b97bcaebdb | [] | no_license | julaxe/IndianaJones | 6cef2ec6e3fe17f11cda2d65a1877f3526481209 | 8b55833bf627d6019d9055aaad722207dbc4e517 | refs/heads/master | 2022-11-27T19:11:25.923297 | 2020-08-04T23:45:08 | 2020-08-04T23:45:08 | 273,011,006 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,099 | cpp | #include "SpriteSheet.h"
#include "TextureManager.h"
#include <fstream>
#include <string>
#include <vector>
SpriteSheet::SpriteSheet(std::string text, const char* path, std::string key) : text(text), path(path), key(key)
{
TEMA::RegisterTexture(path, key);
loadText();
}
void SpriteSheet::loadText()
{
std::string line;
std::ifstream myfile(text);
std::string delimeter = " ";
std::string name;
int x, y, w, h;
if (myfile.is_open())
{
while (std::getline(myfile, line))
{
size_t linePosition = 0;
std::vector<std::string> tokens;
for (auto i = 0; i < 5; ++i)
{
linePosition = line.find(delimeter);
tokens.push_back(line.substr(0, linePosition));
line.erase(0, linePosition + 1);
}
name = tokens[0];
x = std::stoi(tokens[1]);
y = std::stoi(tokens[2]);
w = std::stoi(tokens[3]);
h = std::stoi(tokens[4]);
// add the new frame to the spritesheet
addFrame(new Frame(name, x, y, w, h));
}
myfile.close();
}
}
void SpriteSheet::addFrame(Frame* frame)
{
framesOnSpriteSheet[frame->m_name] =frame;
}
| [
"59695404+julaxe@users.noreply.github.com"
] | 59695404+julaxe@users.noreply.github.com |
547af43dcd247cbce9630eb2f302b58af4db25fd | c933701e5853a57145497c04b025268e41f34964 | /third_party/draco/src/draco/compression/mesh/mesh_encoder_test.cc | b3272faa8f2fb6af6e5a9f4c3dbd276581edc9b2 | [
"Apache-2.0",
"CC0-1.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | zhyl19920810/filament | 5aa442dd12de8a276609a2d3614c21ce7c896625 | 6c222bf4e3d00fc8dcd2add212616ed2374bde9e | refs/heads/main | 2023-02-02T23:19:57.023197 | 2020-12-15T22:48:38 | 2020-12-15T22:48:38 | 323,374,227 | 1 | 0 | Apache-2.0 | 2020-12-21T15:23:57 | 2020-12-21T15:23:56 | null | UTF-8 | C++ | false | false | 3,641 | cc | // Copyright 2016 The Draco Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#include "draco/compression/mesh/mesh_encoder.h"
#include "draco/compression/expert_encode.h"
#include "draco/core/decoder_buffer.h"
#include "draco/core/draco_test_base.h"
#include "draco/core/draco_test_utils.h"
#include "draco/io/obj_decoder.h"
namespace draco {
class MeshEncoderTest : public ::testing::TestWithParam<const char *> {
protected:
MeshEncoderTest() {}
// Fills out_method with id of the encoding method used for the test.
// Returns false if the encoding method is not set properly.
bool GetMethod(MeshEncoderMethod *out_method) const {
if (strcmp(GetParam(), "sequential") == 0) {
*out_method = MESH_SEQUENTIAL_ENCODING;
return true;
}
if (strcmp(GetParam(), "edgebreaker") == 0) {
*out_method = MESH_EDGEBREAKER_ENCODING;
return true;
}
return false;
}
};
TEST_P(MeshEncoderTest, EncodeGoldenMesh) {
// This test verifies that a given set of meshes are encoded to an expected
// output. This is useful for catching bugs in code changes that are not
// supposed to change the encoding.
// The test is expected to fail when the encoding is modified. In such case,
// the golden files need to be updated to reflect the changes.
MeshEncoderMethod method;
ASSERT_TRUE(GetMethod(&method))
<< "Test is run for an unknown encoding method";
const std::string file_name = "test_nm.obj";
std::string golden_file_name = file_name;
golden_file_name += '.';
golden_file_name += GetParam();
golden_file_name += ".1.2.0.drc";
const std::unique_ptr<Mesh> mesh(ReadMeshFromTestFile(file_name));
ASSERT_NE(mesh, nullptr) << "Failed to load test model " << file_name;
ExpertEncoder encoder(*mesh.get());
encoder.SetEncodingMethod(method);
encoder.SetAttributeQuantization(0, 20);
EncoderBuffer buffer;
ASSERT_TRUE(encoder.EncodeToBuffer(&buffer).ok())
<< "Failed encoding test mesh " << file_name << " with method "
<< GetParam();
// Check that the encoded mesh was really encoded with the selected method.
DecoderBuffer decoder_buffer;
decoder_buffer.Init(buffer.data(), buffer.size());
decoder_buffer.Advance(8); // Skip the header to the encoding method id.
uint8_t encoded_method;
ASSERT_TRUE(decoder_buffer.Decode(&encoded_method));
ASSERT_EQ(encoded_method, method);
if (!FLAGS_update_golden_files) {
EXPECT_TRUE(
CompareGoldenFile(golden_file_name, buffer.data(), buffer.size()))
<< "Encoded data is different from the golden file. Please verify that "
"the encoding works as expected and update the golden file if "
"necessary (run the test with --update_golden_files flag).";
} else {
// Save the files into the local folder.
EXPECT_TRUE(
GenerateGoldenFile(golden_file_name, buffer.data(), buffer.size()))
<< "Failed to generate new golden file for " << file_name;
}
}
INSTANTIATE_TEST_SUITE_P(MeshEncoderTests, MeshEncoderTest,
::testing::Values("sequential", "edgebreaker"));
} // namespace draco
| [
"philiprideout@gmail.com"
] | philiprideout@gmail.com |
55fad09f4080d507eb687563bd5f41e39d809f4d | 1bb6a0b3692b5468f7d148788298320ac3ba2a23 | /Codeforces/Educ_127/c.cpp | 34915a5681fb4816989b929308624097350cebb7 | [] | no_license | ablondal/comp-prog | ee6ea5c0b32d7fbe0321a4b9919a9cec23fe85f6 | 725e369476993307874f9f5d6e2e7299918251a0 | refs/heads/master | 2022-10-08T05:40:39.206721 | 2022-09-25T22:29:49 | 2022-09-25T22:29:49 | 243,620,860 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 806 | cpp | #include <bits/stdc++.h>
using namespace std;
// incomplete
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef complex<double> cd;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int t;
cin >> t;
while(t--){
ll n, x;
cin >> n >> x;
vector<ll> a(n), b(n);
rep(i,0,n){
cin >> a[i];
}
sort(all(a));
rep(i,0,n){
b[i] = a[i];
if (i) b[i] += b[i-1];
}
ll tot = 0;
ll last_t = 0;
for(int i = n-1; i>=0; --i){
if (b[i] + (i+1)*last_t > x) continue;
ll diff = x - (b[i] + (i+1)*last_t);
ll num = 1 + (diff / (i+1));
tot += (i+1)*num;
last_t += num;
}
cout << tot << endl;
}
} | [
"ari.blondal@gmail.com"
] | ari.blondal@gmail.com |
f0d1d3f85215da6902c13f0aa1cda345e557667a | 09e9f04bd98495b81598cd6e8110457f9e71039f | /January_Challenge/2.cpp | 925fe33d26d4742dc3cf74775dde8d8c1ce84f9b | [] | no_license | AnjaliPatle/Leetcode-Challenge | 64a1ee381b3141b820f7c179fb288f0e8d2f4459 | 842fe0bcb968902db4b1bcacae74199f9e0e66dc | refs/heads/master | 2023-06-23T12:25:45.993507 | 2021-07-25T18:15:14 | 2021-07-25T18:15:14 | 300,607,343 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 355 | cpp | class Solution {
public:
TreeNode* getTargetCopy(TreeNode* original, TreeNode* cloned, TreeNode* target) {
if(original==NULL)return NULL;
if(original==target)return cloned;
TreeNode *temp=getTargetCopy(original->left,cloned->left,target);
return temp?temp: getTargetCopy(original->right,cloned->right,target);
}
};
| [
"noreply@github.com"
] | noreply@github.com |
f9584ccf9ec15a3c9f547c583704495ad33cb5c5 | b7f3edb5b7c62174bed808079c3b21fb9ea51d52 | /gpu/angle_end2end_tests_main.cc | 75b40ed1ef13c697bf894bf0fa414dae316a1d47 | [
"BSD-3-Clause"
] | permissive | otcshare/chromium-src | 26a7372773b53b236784c51677c566dc0ad839e4 | 64bee65c921db7e78e25d08f1e98da2668b57be5 | refs/heads/webml | 2023-03-21T03:20:15.377034 | 2020-11-16T01:40:14 | 2020-11-16T01:40:14 | 209,262,645 | 18 | 21 | BSD-3-Clause | 2023-03-23T06:20:07 | 2019-09-18T08:52:07 | null | UTF-8 | C++ | false | false | 1,263 | cc | // Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/bind.h"
#include "base/command_line.h"
#include "base/task/single_thread_task_executor.h"
#include "base/test/launcher/unit_test_launcher.h"
#include "base/test/test_suite.h"
#include "testing/gmock/include/gmock/gmock.h"
namespace {
int RunHelper(base::TestSuite* test_suite) {
base::SingleThreadTaskExecutor task_executor;
return test_suite->Run();
}
} // namespace
// Located in third_party/angle/src/tests/test_utils/ANGLETest.cpp.
// Defined here so we can avoid depending on the ANGLE headers.
void ANGLEProcessTestArgs(int *argc, char *argv[]);
void RegisterContextCompatibilityTests();
int main(int argc, char** argv) {
base::CommandLine::Init(argc, argv);
ANGLEProcessTestArgs(&argc, argv);
testing::InitGoogleMock(&argc, argv);
RegisterContextCompatibilityTests();
base::TestSuite test_suite(argc, argv);
int rt = base::LaunchUnitTestsWithOptions(
argc, argv,
1, // Run tests serially.
0, // Disable batching.
true, // Use job objects.
base::BindOnce(&RunHelper, base::Unretained(&test_suite)));
return rt;
}
| [
"commit-bot@chromium.org"
] | commit-bot@chromium.org |
3088627140eb0aa012e5ba5c9eead208a35d80f0 | 9eb2245869dcc3abd3a28c6064396542869dab60 | /benchspec/CPU/511.povray_r/src/image.cpp | 362f838213460884ed5822eb808977b271047427 | [] | no_license | lapnd/CPU2017 | 882b18d50bd88e0a87500484a9d6678143e58582 | 42dac4b76117b1ba4a08e41b54ad9cfd3db50317 | refs/heads/master | 2023-03-23T23:34:58.350363 | 2021-03-24T10:01:03 | 2021-03-24T10:01:03 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 34,684 | cpp | /****************************************************************************
* image.cpp
*
* This module implements the mapped textures including image map, bump map
* and material map.
*
* from Persistence of Vision(tm) Ray Tracer version 3.6.
* Copyright 1991-2003 Persistence of Vision Team
* Copyright 2003-2009 Persistence of Vision Raytracer Pty. Ltd.
*---------------------------------------------------------------------------
* NOTICE: This source code file is provided so that users may experiment
* with enhancements to POV-Ray and to port the software to platforms other
* than those supported by the POV-Ray developers. There are strict rules
* regarding how you are permitted to use this file. These rules are contained
* in the distribution and derivative versions licenses which should have been
* provided with this file.
*
* These licences may be found online, linked from the end-user license
* agreement that is located at http://www.povray.org/povlegal.html
*---------------------------------------------------------------------------
* This program is based on the popular DKB raytracer version 2.12.
* DKBTrace was originally written by David K. Buck.
* DKBTrace Ver 2.0-2.12 were written by David K. Buck & Aaron A. Collins.
*---------------------------------------------------------------------------
* $File: //depot/povray/spec-3.6/source/image.cpp $
* $Revision: #1 $
* $Change: 5014 $
* $DateTime: 2010/06/13 03:51:51 $
* $Author: thorsten $
* $Log$
*****************************************************************************/
#include "frame.h"
#include "vector.h"
#include "texture.h"
#include "image.h"
#include "matrices.h"
#include "povray.h"
#include "isosurf.h"
#include "fpmetric.h"
#include "colour.h"
BEGIN_POV_NAMESPACE
/*****************************************************************************
* Local preprocessor defines
******************************************************************************/
/*****************************************************************************
* Local typedefs
******************************************************************************/
/*****************************************************************************
* Local variables
******************************************************************************/
const DBL DIV_1_BY_65535 = 1.0 / 65535.0;
const DBL DIV_1_BY_255 = 1.0 / 255.0;
/*****************************************************************************
* Static functions
******************************************************************************/
static int cylindrical_image_map (VECTOR EPoint, IMAGE * Image, DBL *u, DBL *v);
static int torus_image_map (VECTOR EPoint, IMAGE * Image, DBL *u, DBL *v);
static int spherical_image_map (VECTOR EPoint, IMAGE * Image, DBL *u, DBL *v);
static int planar_image_map (VECTOR EPoint, IMAGE * Image, DBL *u, DBL *v);
static void no_interpolation (IMAGE * Image, DBL xcoor, DBL ycoor, COLOUR colour, int *index);
static DBL bilinear (DBL *corners, DBL x, DBL y);
static DBL norm_dist (DBL *corners, DBL x, DBL y);
static void Interp (IMAGE * Image, DBL xcoor, DBL ycoor, COLOUR colour, int *index);
static void image_colour_at (IMAGE * Image, DBL xcoor, DBL ycoor, COLOUR colour, int *index);
static int map (VECTOR EPoint, TPATTERN * Turb, DBL *xcoor, DBL *ycoor);
/*
* 2-D to 3-D Procedural Texture Mapping of a Bitmapped Image onto an Object:
*
* A. Simplistic (planar) method of image projection devised by DKB and AAC:
*
* 1. Transform texture in 3-D space if requested. 2. Determine local object 2-d
* coords from 3-d coords by <X Y Z> triple. 3. Return pixel color value at
* that position on the 2-d plane of "Image". 3. Map colour value in Image
* [0..255] to a more normal colour range [0..1].
*
* B. Specialized shape projection variations by Alexander Enzmann:
*
* 1. Cylindrical mapping 2. Spherical mapping 3. Torus mapping
*/
/*****************************************************************************
*
* FUNCTION
*
* image_map
*
* INPUT
*
* EPoint -- 3-D point at which function is evaluated
* Pigment -- Pattern containing various parameters
*
* OUTPUT
*
* Colour -- color at EPoint
*
* RETURNS
*
* int - true, if current point on the image map
* false, if current point is not on the image map
*
* AUTHOR
*
* POV-Ray Team
*
* DESCRIPTION : Determines color of a 3-D point from a 2-D bitmap
*
* CHANGES
*
******************************************************************************/
int image_map(VECTOR EPoint, PIGMENT *Pigment, COLOUR colour)
{
int reg_number;
DBL xcoor = 0.0, ycoor = 0.0;
/* If outside map coverage area, return clear */
if (map(EPoint, ((TPATTERN *) Pigment), &xcoor, &ycoor))
{
Make_ColourA(colour, 1.0, 1.0, 1.0, 0.0, 1.0);
return(false);
}
else
{
image_colour_at(Pigment->Vals.Image, xcoor, ycoor, colour, ®_number);
}
return(true);
}
/*****************************************************************************
*
* FUNCTION
*
* INPUT
*
* OUTPUT
*
* RETURNS
*
* AUTHOR
*
* DESCRIPTION
*
* Very different stuff than the other routines here. This routine takes an
* intersection point and a texture and returns a new texture based on the
* index/color of that point in an image/materials map. CdW 7/91
*
* CHANGES
*
******************************************************************************/
TEXTURE *material_map(VECTOR EPoint, TEXTURE *Texture)
{
int reg_number = 0;
int Material_Number;
int numtex;
DBL xcoor = 0.0, ycoor = 0.0;
COLOUR colour;
TEXTURE *Temp_Tex;
/*
* Now we have transformed x, y, z we use image mapping routine to determine
* texture index.
*/
if (map(EPoint, ((TPATTERN *) Texture), &xcoor, &ycoor))
{
Material_Number = 0;
}
else
{
Make_ColourA(colour, 0.0, 0.0, 0.0, 0.0, 0.0);
image_colour_at(Texture->Vals.Image, xcoor, ycoor, colour, ®_number);
if (Texture->Vals.Image->Colour_Map == NULL)
{
Material_Number = (int)(colour[pRED] * 255.0);
}
else
{
Material_Number = reg_number;
}
}
if (Material_Number > Texture->Num_Of_Mats)
{
Material_Number %= Texture->Num_Of_Mats;
}
for (numtex = 0, Temp_Tex = Texture->Materials;
(Temp_Tex->Next_Material != NULL) && (numtex < Material_Number);
Temp_Tex = Temp_Tex->Next_Material, numtex++)
{
/* do nothing */
}
return (Temp_Tex);
}
/*****************************************************************************
*
* FUNCTION
*
* INPUT
*
* OUTPUT
*
* RETURNS
*
* AUTHOR
*
* DESCRIPTION
*
* CHANGES
*
******************************************************************************/
void bump_map(VECTOR EPoint, TNORMAL *Tnormal, VECTOR normal)
{
DBL xcoor = 0.0, ycoor = 0.0;
int index, index2, index3;
COLOUR colour1, colour2, colour3;
VECTOR p1, p2, p3;
VECTOR bump_normal;
VECTOR xprime, yprime, zprime, Temp;
DBL Length;
DBL Amount = Tnormal->Amount;
IMAGE *Image = Tnormal->Vals.Image;
Make_ColourA(colour1, 0.0, 0.0, 0.0, 0.0, 0.0);
Make_ColourA(colour2, 0.0, 0.0, 0.0, 0.0, 0.0);
Make_ColourA(colour3, 0.0, 0.0, 0.0, 0.0, 0.0);
/* going to have to change this */
/* need to know if bump point is off of image for all 3 points */
if (map(EPoint, (TPATTERN *) Tnormal, &xcoor, &ycoor))
{
return;
}
else
{
image_colour_at(Image, xcoor, ycoor, colour1, &index);
}
xcoor--;
ycoor++;
if (xcoor < 0.0)
{
xcoor += (DBL)Image->iwidth;
}
else
{
if (xcoor >= Image->iwidth)
{
xcoor -= (DBL)Image->iwidth;
}
}
if (ycoor < 0.0)
{
ycoor += (DBL)Image->iheight;
}
else
{
if (ycoor >= (DBL)Image->iheight)
{
ycoor -= (DBL)Image->iheight;
}
}
image_colour_at(Image, xcoor, ycoor, colour2, &index2);
xcoor += 2.0;
if (xcoor < 0.0)
{
xcoor += (DBL)Image->iwidth;
}
else
{
if (xcoor >= Image->iwidth)
{
xcoor -= (DBL)Image->iwidth;
}
}
image_colour_at(Image, xcoor, ycoor, colour3, &index3);
if (Image->Colour_Map == NULL || Image->Use_Colour_Flag)
{
p1[X] = 0;
p1[Y] = Amount * (GREY_SCALE( colour1 ));
p1[Z] = 0;
p2[X] = -1;
p2[Y] = Amount * (GREY_SCALE( colour2 ));
p2[Z] = 1;
p3[X] = 1;
p3[Y] = Amount * (GREY_SCALE( colour3 ));
p3[Z] = 1;
}
else
{
p1[X] = 0;
p1[Y] = Amount * index;
p1[Z] = 0;
p2[X] = -1;
p2[Y] = Amount * index2;
p2[Z] = 1;
p3[X] = 1;
p3[Y] = Amount * index3;
p3[Z] = 1;
}
/* we have points 1,2,3 for a triangle now we need the surface normal for it */
VSub(xprime, p1, p2);
VSub(yprime, p3, p2);
VCross(bump_normal, yprime, xprime);
VNormalize(bump_normal, bump_normal);
Assign_Vector(yprime, normal);
Make_Vector(Temp, 0.0, 1.0, 0.0);
VCross(xprime, yprime, Temp);
VLength(Length, xprime);
if (Length < EPSILON)
{
if (fabs(normal[Y] - 1.0) < Small_Tolerance)
{
Make_Vector(yprime, 0.0, 1.0, 0.0);
Make_Vector(xprime, 1.0, 0.0, 0.0);
Length = 1.0;
}
else
{
Make_Vector(yprime, 0.0, -1.0, 0.0);
Make_Vector(xprime, 1.0, 0.0, 0.0);
Length = 1.0;
}
}
VScaleEq(xprime, 1.0 / Length);
VCross(zprime, xprime, yprime);
VNormalizeEq(zprime);
VScaleEq(xprime, bump_normal[X]);
VScaleEq(yprime, bump_normal[Y]);
VScaleEq(zprime, bump_normal[Z]);
VAdd(Temp, xprime, yprime);
VScaleEq(zprime, -1);
VAdd(normal, Temp, zprime);
}
/*****************************************************************************
*
* FUNCTION
*
* INPUT
*
* OUTPUT
*
* RETURNS
*
* AUTHOR Nathan Kopp
*
* DESCRIPTION
*
* CHANGES
*
******************************************************************************/
DBL image_pattern(VECTOR EPoint, TPATTERN *TPattern)
{
DBL xcoor = 0.0, ycoor = 0.0;
int index;
COLOUR colour;
IMAGE *Image = TPattern->Vals.Image;
DBL Value;
Make_ColourA(colour, 0.0, 0.0, 0.0, 0.0, 0.0);
/* going to have to change this */
/* need to know if bump point is off of image for all 3 points */
if (map(EPoint, (TPATTERN *) TPattern, &xcoor, &ycoor))
{
return 0.0;
}
else
{
image_colour_at(Image, xcoor, ycoor, colour, &index);
}
if (Image->Colour_Map == NULL || Image->Use_Colour_Flag)
{
if (Image->Use_Colour_Flag == USE_ALPHA)
{
/* use alpha channel or red channel */
if ((Image->Image_Type & IS16BITIMAGE) == IS16BITIMAGE)
{
if (Image->data.rgb16_lines[0].transm != NULL)
Value = colour[pTRANSM];
else
Value = colour[pRED]; /* otherwise, just use the red channel */
}
else
{
if (Image->data.rgb8_lines[0].transm != NULL)
Value = colour[pTRANSM];
else
Value = colour[pRED]; /* otherwise, just use the red channel */
}
}
else
/* use grey-scaled version of the color */
Value = GREY_SCALE(colour);
}
else
Value = index / 255.0;
if (Value<0) Value = 0;
else if (Value>1.0) Value = 1.0;
return Value;
}
/*****************************************************************************
*
* FUNCTION
*
* INPUT
*
* OUTPUT
*
* RETURNS
*
* AUTHOR
*
* DESCRIPTION
*
* CHANGES
*
******************************************************************************/
static void image_colour_at(IMAGE *Image, DBL xcoor, DBL ycoor, COLOUR colour, int *index)
{
switch (Image->Interpolation_Type)
{
case NO_INTERPOLATION:
no_interpolation(Image, xcoor, ycoor, colour, index);
break;
default:
Interp(Image, xcoor, ycoor, colour, index);
break;
}
}
/*****************************************************************************
*
* FUNCTION
*
* INPUT
*
* OUTPUT
*
* RETURNS
*
* AUTHOR
*
* DESCRIPTION
*
* CHANGES
*
******************************************************************************/
HF_VAL image_height_at(IMAGE *Image, int x, int y)
{
int temp1 = 0, temp2 = 0;
switch(Image->File_Type & IMAGE_FILE_MASK)
{
case GIF_FILE:
temp1 = Image->data.map_lines[y][x];
temp2 = 0;
break;
case POT_FILE:
temp1 = Image->data.map_lines[y][x];
temp2 = Image->data.map_lines[y][x + Image->iwidth];
break;
case JPEG_FILE:
case PPM_FILE:
case PGM_FILE:
case TGA_FILE:
case PNG_FILE:
case TIFF_FILE:
case SYS_FILE:
if(Image->Colour_Map == NULL)
{
if((Image->Image_Type & IS16BITIMAGE) == IS16BITIMAGE)
{
temp1 = 0;
if((Image->Image_Type & IS16GRAYIMAGE) == IS16GRAYIMAGE)
temp2 = Image->data.gray16_lines[y][x];
else
{
temp2 = GREY_SCALE3(
Image->data.rgb16_lines[y].red[x],
Image->data.rgb16_lines[y].green[x],
Image->data.rgb16_lines[y].blue[x]
);
}
}
else
{
temp1 = Image->data.rgb8_lines[y].red[x];
temp2 = Image->data.rgb8_lines[y].green[x];
}
}
else
{
temp1 = Image->data.map_lines[y][x];
temp2 = 0;
}
break;
default:
Error("Unknown image type in image_height_at.");
}
return (HF_VAL)(256*temp1 + temp2);
}
/*****************************************************************************
*
* FUNCTION
*
* INPUT
*
* OUTPUT
*
* RETURNS
*
* AUTHOR
*
* DESCRIPTION
*
* CHANGES
*
******************************************************************************/
bool is_image_opaque(IMAGE *Image)
{
int x, y;
if(Image->Colour_Map != NULL)
{
/* Test color map. */
for(x = 0; x < (int)Image->Colour_Map_Size; x++)
{
if(Image->Colour_Map[x].Filter > 0)
return false;
if(Image->Colour_Map[x].Transmit > 0)
return false;
}
}
else
{
if (Image->AllFilter!=0.0 || Image->AllTransmit != 0.0)
{
return false;
}
if((Image->Image_Type & IS16BITIMAGE) == IS16BITIMAGE)
{
if((Image->Image_Type & IS16GRAYIMAGE) == IS16GRAYIMAGE)
return true;
else
{
/* Test 16 bit per color component image. */
if(Image->data.rgb16_lines[0].transm != NULL)
{
for(y = 0; y < Image->iheight; y++)
{
for(x = 0; x < Image->iwidth; x++)
{
if (Image->data.rgb16_lines[y].transm[x] > 0)
return false;
}
}
}
}
}
else
{
/* Test 8 bit per color component image. */
if(Image->data.rgb8_lines[0].transm != NULL)
{
for(y = 0; y < Image->iheight; y++)
{
for(x = 0; x < Image->iwidth; x++)
{
if(Image->data.rgb8_lines[y].transm[x] > 0)
return false;
}
}
}
}
}
return true;
}
/*****************************************************************************
*
* FUNCTION
*
* INPUT
*
* OUTPUT
*
* RETURNS
*
* AUTHOR
*
* DESCRIPTION
*
* Map a point (x, y, z) on a cylinder of radius 1, height 1, that has its axis
* of symmetry along the y-axis to the square [0,1]x[0,1].
*
* CHANGES
*
******************************************************************************/
static int cylindrical_image_map(VECTOR EPoint, IMAGE *Image, DBL *u, DBL *v)
{
DBL len, theta;
DBL x = EPoint[X];
DBL y = EPoint[Y];
DBL z = EPoint[Z];
if ((Image->Once_Flag) && ((y < 0.0) || (y > 1.0)))
{
return 0;
}
*v = fmod(y * Image->height, (DBL) Image->height);
/* Make sure this vector is on the unit sphere. */
len = sqrt(x * x + y * y + z * z);
if (len == 0.0)
{
return 0;
}
else
{
x /= len;
z /= len;
}
/* Determine its angle from the point (1, 0, 0) in the x-z plane. */
len = sqrt(x * x + z * z);
if (len == 0.0)
{
return 0;
}
else
{
if (z == 0.0)
{
if (x > 0)
{
theta = 0.0;
}
else
{
theta = M_PI;
}
}
else
{
theta = acos(x / len);
if (z < 0.0)
{
theta = TWO_M_PI - theta;
}
}
theta /= TWO_M_PI; /* This will be from 0 to 1 */
}
*u = (theta * Image->width);
return 1;
}
/*****************************************************************************
*
* FUNCTION
*
* INPUT
*
* OUTPUT
*
* RETURNS
*
* AUTHOR
*
* DESCRIPTION
*
* Map a point (x, y, z) on a torus to a 2-d image.
*
* CHANGES
*
******************************************************************************/
static int torus_image_map(VECTOR EPoint, IMAGE *Image, DBL *u, DBL *v)
{
DBL len, phi, theta;
DBL r0;
DBL x = EPoint[X];
DBL y = EPoint[Y];
DBL z = EPoint[Z];
r0 = Image->Gradient[X];
/* Determine its angle from the x-axis. */
len = sqrt(x * x + z * z);
if (len == 0.0)
{
return 0;
}
else
{
if (z == 0.0)
{
if (x > 0)
{
theta = 0.0;
}
else
{
theta = M_PI;
}
}
else
{
theta = acos(x / len);
if (z < 0.0)
{
theta = TWO_M_PI - theta;
}
}
}
theta = 0.0 - theta;
/* Now rotate about the y-axis to get the point (x, y, z) into the x-y plane. */
x = len - r0;
len = sqrt(x * x + y * y);
phi = acos(-x / len);
if (y > 0.0)
{
phi = TWO_M_PI - phi;
}
/* Determine the parametric coordinates. */
theta /= TWO_M_PI;
phi /= TWO_M_PI;
*u = (-theta * Image->width);
*v = (phi * Image->height);
return 1;
}
/*****************************************************************************
*
* FUNCTION
*
* INPUT
*
* OUTPUT
*
* RETURNS
*
* AUTHOR
*
* DESCRIPTION
*
* Map a point (x, y, z) on a sphere of radius 1 to a 2-d image. (Or is it the
* other way around?)
*
* CHANGES
*
******************************************************************************/
static int spherical_image_map(VECTOR EPoint, IMAGE *Image, DBL *u, DBL *v)
{
DBL len, phi, theta;
DBL x = EPoint[X];
DBL y = EPoint[Y];
DBL z = EPoint[Z];
/* Make sure this vector is on the unit sphere. */
len = sqrt(x * x + y * y + z * z);
if (len == 0.0)
{
return 0;
}
else
{
x /= len;
y /= len;
z /= len;
}
/* Determine its angle from the x-z plane. */
phi = 0.5 + asin(y) / M_PI; /* This will be from 0 to 1 */
/* Determine its angle from the point (1, 0, 0) in the x-z plane. */
len = sqrt(x * x + z * z);
if (len == 0.0)
{
/* This point is at one of the poles. Any value of xcoord will be ok... */
theta = 0;
}
else
{
if (z == 0.0)
{
if (x > 0)
{
theta = 0.0;
}
else
{
theta = M_PI;
}
}
else
{
theta = acos(x / len);
if (z < 0.0)
{
theta = TWO_M_PI - theta;
}
}
theta /= TWO_M_PI; /* This will be from 0 to 1 */
}
*u = (theta * Image->width);
*v = (phi * Image->height);
return 1;
}
/*
* 2-D to 3-D Procedural Texture Mapping of a Bitmapped Image onto an Object:
*
* Simplistic planar method of object image projection devised by DKB and AAC.
*
* 1. Transform texture in 3-D space if requested. 2. Determine local object 2-d
* coords from 3-d coords by <X Y Z> triple. 3. Return pixel color value at
* that position on the 2-d plane of "Image". 3. Map colour value in Image
* [0..255] to a more normal colour range [0..1].
*/
/*****************************************************************************
*
* FUNCTION
*
* INPUT
*
* OUTPUT
*
* RETURNS
*
* AUTHOR
*
* DESCRIPTION
*
* Return 0 if there is no color at this point (i.e. invisible), return 1 if a
* good mapping is found.
*
* CHANGES
*
******************************************************************************/
static int planar_image_map(VECTOR EPoint, IMAGE *Image, DBL *u, DBL *v)
{
DBL x = EPoint[X];
DBL y = EPoint[Y];
DBL z = EPoint[Z];
if (Image->Gradient[X] != 0.0)
{
if ((Image->Once_Flag) && ((x < 0.0) || (x > 1.0)))
{
return 0;
}
if (Image->Gradient[X] > 0)
{
*u = fmod(x * Image->width, (DBL) Image->width);
}
else
{
*v = fmod(x * Image->height, (DBL) Image->height);
}
}
if (Image->Gradient[Y] != 0.0)
{
if ((Image->Once_Flag) && ((y < 0.0) || (y > 1.0)))
{
return 0;
}
if (Image->Gradient[Y] > 0)
{
*u = fmod(y * Image->width, (DBL) Image->width);
}
else
{
*v = fmod(y * Image->height, (DBL) Image->height);
}
}
if (Image->Gradient[Z] != 0.0)
{
if ((Image->Once_Flag) && ((z < 0.0) || (z > 1.0)))
{
return 0;
}
if (Image->Gradient[Z] > 0)
{
*u = fmod(z * Image->width, (DBL) Image->width);
}
else
{
*v = fmod(z * Image->height, (DBL) Image->height);
}
}
return 1;
}
/*****************************************************************************
*
* FUNCTION
*
* map
*
* INPUT
*
* EPoint -- 3-D point at which function is evaluated
* TPattern -- Pattern containing various parameters
*
* OUTPUT
*
* xcoor, ycoor -- 2-D result
*
* RETURNS
*
* Map returns 1 if point off of map 0 if on map
*
* AUTHOR
*
* POV-Ray Team
*
* DESCRIPTION : Maps a 3-D point to a 2-D point depending upon map type
*
* CHANGES
*
******************************************************************************/
static int map(VECTOR EPoint, TPATTERN *TPattern, DBL *xcoor, DBL *ycoor)
{
IMAGE *Image = TPattern->Vals.Image;
/* Now determine which mapper to use. */
switch (Image->Map_Type)
{
case PLANAR_MAP:
if (!planar_image_map(EPoint, Image, xcoor, ycoor))
{
return (1);
}
break;
case SPHERICAL_MAP:
if (!spherical_image_map(EPoint, Image, xcoor, ycoor))
{
return (1);
}
break;
case CYLINDRICAL_MAP:
if (!cylindrical_image_map(EPoint, Image, xcoor, ycoor))
{
return (1);
}
break;
case TORUS_MAP:
if (!torus_image_map(EPoint, Image, xcoor, ycoor))
{
return (1);
}
break;
default:
if (!planar_image_map(EPoint, Image, xcoor, ycoor))
{
return (1);
}
break;
}
/* Now make sure the point is on the image */
/* and apply integer repeats and offsets */
*xcoor += Image->Offset[U] + Small_Tolerance;
*ycoor += Image->Offset[V] + Small_Tolerance;
DBL xx=(*xcoor)/(DBL)(Image->iwidth);
DBL yy=(*ycoor)/(DBL)(Image->iheight);
if (Image->Once_Flag)
{
if ((xx>1.0) || (yy>1.0) || (xx<0.0) || (yy<0.0))
{
return (1);
}
}
*xcoor -= ((int)xx)*Image->iwidth;
*ycoor -= ((int)yy)*Image->iheight;
/* Compensate for y coordinates on the images being upsidedown */
*ycoor = (DBL)Image->iheight - *ycoor;
if (*xcoor < 0.0)
{
*xcoor += (DBL)Image->iwidth;
}
else
{
if (*xcoor >= (DBL)Image->iwidth)
{
*xcoor -= (DBL)Image->iwidth;
}
}
if (*ycoor < 0.0)
{
*ycoor += (DBL)Image->iheight;
}
else
{
if (*ycoor >= (DBL)Image->iheight)
{
*ycoor -= (DBL)Image->iheight;
}
}
if ((*xcoor >= (DBL)Image->iwidth) ||
(*ycoor >= (DBL)Image->iheight) ||
(*xcoor < 0.0) || (*ycoor < 0.0))
{
Error("Picture index out of range.");
}
return (0);
}
/*****************************************************************************
*
* FUNCTION
*
* INPUT
*
* OUTPUT
*
* RETURNS
*
* AUTHOR
*
* DESCRIPTION
*
* CHANGES
*
******************************************************************************/
static void no_interpolation(IMAGE *Image, DBL xcoor, DBL ycoor, COLOUR colour, int *index)
{
IMAGE_COLOUR *map_colour = NULL;
IMAGE16_LINE *line16 = NULL;
IMAGE8_LINE *line8 = NULL;
unsigned short **gray16 = NULL;
int iycoor, ixcoor;
if(Image->Once_Flag)
{
if (xcoor < 0.0)
xcoor = 0.0;
else if (xcoor >= (DBL)Image->iwidth)
xcoor -= 1.0;
if (ycoor < 0.0)
ycoor = 0.0;
else if (ycoor >= (DBL)Image->iheight)
ycoor -= 1.0;
}
else
{
if (xcoor < 0.0)
xcoor += (DBL)Image->iwidth;
else if (xcoor >= (DBL)Image->iwidth)
xcoor -= (DBL)Image->iwidth;
if (ycoor < 0.0)
ycoor += (DBL)Image->iheight;
else if (ycoor >= (DBL)Image->iheight)
ycoor -= (DBL)Image->iheight;
}
iycoor = (int)ycoor;
ixcoor = (int)xcoor;
if(Image->Colour_Map == NULL)
{
if((Image->Image_Type & IS16BITIMAGE) == IS16BITIMAGE)
{
if((Image->Image_Type & IS16GRAYIMAGE) == IS16GRAYIMAGE)
{
gray16 = Image->data.gray16_lines;
colour[pRED] +=(DBL)gray16[iycoor][ixcoor] * DIV_1_BY_65535;
colour[pGREEN] +=(DBL)gray16[iycoor][ixcoor] * DIV_1_BY_65535;
colour[pBLUE] +=(DBL)gray16[iycoor][ixcoor] * DIV_1_BY_65535;
}
else
{
line16 = &Image->data.rgb16_lines[iycoor];
colour[pRED] += (DBL)line16->red[ixcoor] * DIV_1_BY_65535;
colour[pGREEN] += (DBL)line16->green[ixcoor] * DIV_1_BY_65535;
colour[pBLUE] += (DBL)line16->blue[ixcoor] * DIV_1_BY_65535;
if (line16->transm != NULL)
colour[pTRANSM] += (DBL)line16->transm[ixcoor] * DIV_1_BY_65535;
}
}
else
{
line8 = &Image->data.rgb8_lines[iycoor];
colour[pRED] += (DBL)line8->red[ixcoor] * DIV_1_BY_255;
colour[pGREEN] += (DBL)line8->green[ixcoor] * DIV_1_BY_255;
colour[pBLUE] += (DBL)line8->blue[ixcoor] * DIV_1_BY_255;
if (line8->transm != NULL)
colour[pTRANSM] += (DBL)line8->transm[ixcoor] * DIV_1_BY_255;
}
/* Note: Transmit_all suppliments alpha channel */
colour[pTRANSM] += Image->AllTransmit;
colour[pFILTER] += Image->AllFilter;
*index = -1;
}
else
{
*index = Image->data.map_lines[iycoor][ixcoor];
map_colour = &Image->Colour_Map[*index];
colour[pRED] += (DBL)map_colour->Red * DIV_1_BY_255;
colour[pGREEN] += (DBL)map_colour->Green * DIV_1_BY_255;
colour[pBLUE] += (DBL)map_colour->Blue * DIV_1_BY_255;
colour[pFILTER] += (DBL)map_colour->Filter * DIV_1_BY_255;
colour[pTRANSM] += (DBL)map_colour->Transmit * DIV_1_BY_255;
}
}
/*****************************************************************************
*
* FUNCTION
*
* INPUT
*
* OUTPUT
*
* RETURNS
*
* AUTHOR
*
* DESCRIPTION
*
* CHANGES
*
******************************************************************************/
/* Interpolate color and filter values when mapping */
static void Interp(IMAGE *Image, DBL xcoor, DBL ycoor, COLOUR colour, int *index)
{
int iycoor, ixcoor, i;
int Corners_Index[4];
DBL Index_Crn[4];
COLOUR Corner_Colour[4];
DBL Red_Crn[4];
DBL Green_Crn[4];
DBL Blue_Crn[4];
DBL Filter_Crn[4];
DBL Transm_Crn[4];
DBL val1, val2, val3, val4, val5;
val1 = val2 = val3 = val4 = val5 = 0.0;
iycoor = (int)ycoor;
ixcoor = (int)xcoor;
for (i = 0; i < 4; i++)
{
Make_ColourA(Corner_Colour[i], 0.0, 0.0, 0.0, 0.0, 0.0);
}
/* OK, now that you have the corners, what are you going to do with them? */
if (Image->Interpolation_Type == BILINEAR)
{
no_interpolation(Image, (DBL)ixcoor + 1, (DBL)iycoor, Corner_Colour[0], &Corners_Index[0]);
no_interpolation(Image, (DBL)ixcoor, (DBL)iycoor, Corner_Colour[1], &Corners_Index[1]);
no_interpolation(Image, (DBL)ixcoor + 1, (DBL)iycoor - 1, Corner_Colour[2], &Corners_Index[2]);
no_interpolation(Image, (DBL)ixcoor, (DBL)iycoor - 1, Corner_Colour[3], &Corners_Index[3]);
for (i = 0; i < 4; i++)
{
Red_Crn[i] = Corner_Colour[i][pRED];
Green_Crn[i] = Corner_Colour[i][pGREEN];
Blue_Crn[i] = Corner_Colour[i][pBLUE];
Filter_Crn[i] = Corner_Colour[i][pFILTER];
Transm_Crn[i] = Corner_Colour[i][pTRANSM];
// Debug_Info("Crn %d = %lf %lf %lf\n",i,Red_Crn[i],Blue_Crn[i],Green_Crn[i]);
}
val1 = bilinear(Red_Crn, xcoor, ycoor);
val2 = bilinear(Green_Crn, xcoor, ycoor);
val3 = bilinear(Blue_Crn, xcoor, ycoor);
val4 = bilinear(Filter_Crn, xcoor, ycoor);
val5 = bilinear(Transm_Crn, xcoor, ycoor);
}
if (Image->Interpolation_Type == NORMALIZED_DIST)
{
no_interpolation(Image, (DBL)ixcoor, (DBL)iycoor - 1, Corner_Colour[0], &Corners_Index[0]);
no_interpolation(Image, (DBL)ixcoor + 1, (DBL)iycoor - 1, Corner_Colour[1], &Corners_Index[1]);
no_interpolation(Image, (DBL)ixcoor, (DBL)iycoor, Corner_Colour[2], &Corners_Index[2]);
no_interpolation(Image, (DBL)ixcoor + 1, (DBL)iycoor, Corner_Colour[3], &Corners_Index[3]);
for (i = 0; i < 4; i++)
{
Red_Crn[i] = Corner_Colour[i][pRED];
Green_Crn[i] = Corner_Colour[i][pGREEN];
Blue_Crn[i] = Corner_Colour[i][pBLUE];
Filter_Crn[i] = Corner_Colour[i][pFILTER];
Transm_Crn[i] = Corner_Colour[i][pTRANSM];
// Debug_Info("Crn %d = %lf %lf %lf\n",i,Red_Crn[i],Blue_Crn[i],Green_Crn[i]);
}
val1 = norm_dist(Red_Crn, xcoor, ycoor);
val2 = norm_dist(Green_Crn, xcoor, ycoor);
val3 = norm_dist(Blue_Crn, xcoor, ycoor);
val4 = norm_dist(Filter_Crn, xcoor, ycoor);
val5 = norm_dist(Transm_Crn, xcoor, ycoor);
}
colour[pRED] += val1;
colour[pGREEN] += val2;
colour[pBLUE] += val3;
colour[pFILTER] += val4;
colour[pTRANSM] += val5;
// Debug_Info("Final = %lf %lf %lf\n",val1,val2,val3);
// use bilinear for index try average later
for (i = 0; i < 4; i++)
{
Index_Crn[i] = (DBL)Corners_Index[i];
}
if (Image->Interpolation_Type == BILINEAR)
{
*index = (int)(bilinear(Index_Crn, xcoor, ycoor) + 0.5);
}
if (Image->Interpolation_Type == NORMALIZED_DIST)
{
*index = (int)(norm_dist(Index_Crn, xcoor, ycoor) + 0.5);
}
}
/*****************************************************************************
*
* FUNCTION
*
* INPUT
*
* OUTPUT
*
* RETURNS
*
* AUTHOR
*
* DESCRIPTION
*
* CHANGES
*
******************************************************************************/
/* These interpolation techniques are taken from an article by */
/* Girish T. Hagan in the C Programmer's Journal V 9 No. 8 */
/* They were adapted for POV-Ray by CdW */
static DBL bilinear(DBL *corners, DBL x, DBL y)
{
DBL p, q;
DBL val;
p = x - (int)x;
q = y - (int)y;
/*
removed per suggestion of R. Suzuki
if ((p == 0.0) && (q == 0.0))
{
return (*corners); // upper left
}
*/
val = (p * q * *corners) + (q * (1 - p) * *(corners + 1)) +
(p * (1 - q) * *(corners + 2)) + ((1 - p) * (1 - q) * *(corners + 3));
return (val);
}
/*****************************************************************************
*
* FUNCTION
*
* INPUT
*
* OUTPUT
*
* RETURNS
*
* AUTHOR
*
* DESCRIPTION
*
* CHANGES
*
******************************************************************************/
const int MAX_PTS = 4;
#define PYTHAGOREAN_SQ(a,b) ( (a)*(a) + (b)*(b) )
static DBL norm_dist(DBL *corners, DBL x, DBL y)
{
register int i;
DBL p, q;
DBL wts[MAX_PTS];
DBL sum_inv_wts = 0.0;
DBL sum_I = 0.0;
p = x - (int)x;
q = y - (int)y;
/*
removed per suggestion of R. Suzuki
if ((p == 0.0) && (q == 0.0))
{
return (*corners); // upper left
}
*/
wts[0] = PYTHAGOREAN_SQ(p, q);
wts[1] = PYTHAGOREAN_SQ(1 - p, q);
wts[2] = PYTHAGOREAN_SQ(p, 1 - q);
wts[3] = PYTHAGOREAN_SQ(1 - p, 1 - q);
for (i = 0; i < MAX_PTS; i++)
{
sum_inv_wts += 1 / wts[i];
sum_I += *(corners + i) / wts[i];
}
return (sum_I / sum_inv_wts);
}
/*****************************************************************************
*
* FUNCTION
*
* Create_Image
*
* INPUT
*
* OUTPUT
*
* RETURNS
*
* AUTHOR
*
* POV-Ray Team
*
* DESCRIPTION
*
* -
*
* CHANGES
*
* Scott Manley Added repeat vector initialisation
*
******************************************************************************/
IMAGE *Create_Image()
{
IMAGE *Image;
Image = (IMAGE *) POV_CALLOC(1, sizeof(IMAGE), "image file");
Image->References = 1;
Image->File_Type = NO_FILE;
Image->Image_Type = 0;
Image->Map_Type = PLANAR_MAP;
Image->Interpolation_Type = NO_INTERPOLATION;
Image->iwidth = Image->iheight = 0;
Image->width = Image->height = 0.0;
Image->Once_Flag = false;
Make_UV_Vector(Image->Offset,0.0,0.0);
Image->Use_Colour_Flag = false;
Make_Vector(Image->Gradient, 1.0, -1.0, 0.0);
Image->AllFilter = 0;
Image->AllTransmit = 0;
Image->Colour_Map_Size = 0;
Image->Colour_Map = NULL;
Image->Object = NULL;
return (Image);
}
/*****************************************************************************
*
* FUNCTION
*
* Copy_Image
*
* INPUT
*
* OUTPUT
*
* RETURNS
*
* AUTHOR
*
* POV-Ray Team
*
* DESCRIPTION
*
* -
*
* CHANGES
*
* -
*
******************************************************************************/
IMAGE *Copy_Image(IMAGE *Old)
{
if (Old != NULL)
{
Old->References++;
}
return (Old);
}
/*****************************************************************************
*
* FUNCTION
*
* Destroy_Image
*
* INPUT
*
* OUTPUT
*
* RETURNS
*
* AUTHOR
*
* POV-Ray Team
*
* DESCRIPTION
*
* -
*
* CHANGES
*
* -
*
******************************************************************************/
void Destroy_Image(IMAGE *Image)
{
int i;
if ((Image == NULL) || (--(Image->References) > 0))
{
return;
}
if (Image->Colour_Map != NULL)
{
POV_FREE(Image->Colour_Map);
Image->Colour_Map = NULL;
if (Image->data.map_lines != NULL)
{
for (i = 0; i < Image->iheight; i++)
{
POV_FREE(Image->data.map_lines[i]);
}
POV_FREE(Image->data.map_lines);
Image->data.map_lines = NULL;
}
}
else
{
if ((Image->Image_Type & IS16BITIMAGE) == IS16BITIMAGE)
{
if ((Image->Image_Type & IS16GRAYIMAGE) == IS16GRAYIMAGE)
{
if (Image->data.gray16_lines != NULL)
{
for (i = 0; i < Image->iheight; i++)
{
POV_FREE(Image->data.gray16_lines[i]);
}
POV_FREE(Image->data.gray16_lines);
Image->data.gray16_lines = NULL;
}
}
else if (Image->data.rgb16_lines != NULL)
{
for (i = 0; i < Image->iheight; i++)
{
POV_FREE(Image->data.rgb16_lines[i].red);
POV_FREE(Image->data.rgb16_lines[i].green);
POV_FREE(Image->data.rgb16_lines[i].blue);
if (Image->data.rgb16_lines[i].transm != NULL)
{
POV_FREE(Image->data.rgb16_lines[i].transm);
}
}
POV_FREE(Image->data.rgb16_lines);
Image->data.rgb16_lines = NULL;
}
}
else
{
if (Image->data.rgb8_lines != NULL)
{
for (i = 0; i < Image->iheight; i++)
{
POV_FREE(Image->data.rgb8_lines[i].red);
POV_FREE(Image->data.rgb8_lines[i].green);
POV_FREE(Image->data.rgb8_lines[i].blue);
if (Image->data.rgb8_lines[i].transm != NULL)
{
POV_FREE(Image->data.rgb8_lines[i].transm);
}
}
POV_FREE(Image->data.rgb8_lines);
Image->data.rgb8_lines = NULL;
}
}
}
POV_FREE(Image);
}
END_POV_NAMESPACE
| [
"cuda@hp-arm64-09-02.nvidia.com"
] | cuda@hp-arm64-09-02.nvidia.com |
eab15c186e821bc39a87227acb60dbd6cf857d28 | 9c5d00397522025a79d4773e5d97a09a9bca65f8 | /SboCli/src/Wnd/StaticGrp.cpp | 36e578c84648cdbc4549a86a45976a82508bb1b0 | [] | no_license | uraraworks/SBOP2 | b818c2a0515110c21f02fcd99fb1a26553cb8e10 | 11a77d846782df6ba74dd45803477cf19fb32934 | refs/heads/master | 2023-07-05T07:52:52.013477 | 2021-08-17T08:33:24 | 2021-08-17T08:33:24 | 275,423,701 | 0 | 0 | null | null | null | null | SHIFT_JIS | C++ | false | false | 7,180 | cpp | /* Copyright(C)URARA-works 2007 */
/* ========================================================================= */
/* ファイル名 :StaticGrp.cpp */
/* 内容 :画像表示スタティックコントロールクラス 実装ファイル */
/* 作成 :年がら年中春うらら(URARA-works) */
/* 作成開始日 :2007/11/10 */
/* ========================================================================= */
#include "stdafx.h"
#include "Img32.h"
#include "MgrData.h"
#include "MgrDraw.h"
#include "MgrGrpData.h"
#include "StaticGrp.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/* ========================================================================= */
/* クラス設定 */
/* ========================================================================= */
BEGIN_MESSAGE_MAP(CStaticGrp, CStatic)
//{{AFX_MSG_MAP(CStaticGrp)
ON_WM_CREATE()
ON_WM_PAINT()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/* ========================================================================= */
/* 関数名 :CStaticGrp::CStaticGrp */
/* 内容 :コンストラクタ */
/* 日付 :2007/11/10 */
/* ========================================================================= */
CStaticGrp::CStaticGrp()
{
m_pWndParent = NULL;
m_pMgrData = NULL;
m_pMgrGrpData = NULL;
m_dwGrpIDMain = 0;
m_dwGrpIDSub = 0;
m_dwGrpIDParam = 0;
m_pImgBack = new CImg32;
}
/* ========================================================================= */
/* 関数名 :CStaticGrp::~CStaticGrp */
/* 内容 :デストラクタ */
/* 日付 :2007/11/10 */
/* ========================================================================= */
CStaticGrp::~CStaticGrp()
{
SAFE_DELETE (m_pImgBack);
}
/* ========================================================================= */
/* 関数名 :CStaticGrp::Create */
/* 内容 :作成 */
/* 日付 :2007/11/10 */
/* ========================================================================= */
BOOL CStaticGrp::Create(CWnd *pParent, CMgrData *pMgrData)
{
m_pWndParent = pParent;
m_pMgrData = pMgrData;
m_pMgrGrpData = m_pMgrData->GetMgrGrpData ();
return TRUE;
}
/* ========================================================================= */
/* 関数名 :CStaticGrp::Init */
/* 内容 :初期化 */
/* 日付 :2007/11/14 */
/* ========================================================================= */
void CStaticGrp::Init(CImg32 *pSrc)
{
int cx, cy;
m_pImgBack->Destroy ();
cx = pSrc->Width ();
cy = pSrc->Height ();
m_pImgBack->Create (cx, cy);
m_pImgBack->Blt (0, 0, cx, cy, pSrc, 0, 0);
SetWindowPos (NULL, 0, 0, cx, cy, SWP_NOZORDER | SWP_NOMOVE);
InvalidateRect (NULL);
}
/* ========================================================================= */
/* 関数名 :CStaticGrp::Init */
/* 内容 :初期化 */
/* 日付 :2007/11/10 */
/* ========================================================================= */
void CStaticGrp::Init(DWORD dwGrpIDMain)
{
m_dwGrpIDMain = dwGrpIDMain;
Set (0);
}
/* ========================================================================= */
/* 関数名 :CStaticGrp::Set */
/* 内容 :画像設定 */
/* 日付 :2007/11/10 */
/* ========================================================================= */
void CStaticGrp::Set(DWORD dwGrpIdSub)
{
m_dwGrpIDSub = dwGrpIdSub;
RenewGrp (m_dwGrpIDMain, m_dwGrpIDSub);
}
/* ========================================================================= */
/* 関数名 :CStaticGrp::SetParam */
/* 内容 :画像パラメータ設定 */
/* 日付 :2008/09/06 */
/* ========================================================================= */
void CStaticGrp::SetParam(DWORD dwGrpIDParam)
{
m_dwGrpIDParam = dwGrpIDParam;
RenewGrp (m_dwGrpIDMain, m_dwGrpIDSub);
}
/* ========================================================================= */
/* 関数名 :CStaticGrp::OnCreate */
/* 内容 :メッセージハンドラ(WM_CREATE) */
/* 日付 :2007/11/10 */
/* ========================================================================= */
int CStaticGrp::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CStatic::OnCreate (lpCreateStruct) == -1) {
return -1;
}
m_pImgBack->Create (32, 32);
return 0;
}
/* ========================================================================= */
/* 関数名 :CStaticGrp::OnPaint */
/* 内容 :メッセージハンドラ(WM_PAINT) */
/* 日付 :2007/11/10 */
/* ========================================================================= */
void CStaticGrp::OnPaint()
{
int cx, cy;
HDC hDC;
CDC *pDCTmp;
CPaintDC dc(this);
cx = m_pImgBack->Width ();
cy = m_pImgBack->Height ();
hDC = m_pImgBack->Lock ();
pDCTmp = dc.FromHandle (hDC);
dc.BitBlt (0, 0, cx, cy, pDCTmp, 0, 0, SRCCOPY);
m_pImgBack->Unlock ();
}
/* ========================================================================= */
/* 関数名 :CStaticGrp::RenewGrp */
/* 内容 :画像更新 */
/* 日付 :2007/11/10 */
/* ========================================================================= */
void CStaticGrp::RenewGrp(DWORD dwGrpIDMain, DWORD dwGrpIDSub)
{
PCImg32 pImgTmp;
DWORD dwParam;
int x, y, nSize, nCountX;
m_pImgBack->Destroy ();
x = y = 0;
pImgTmp = NULL;
dwParam = 0;
nSize = m_pMgrGrpData->GetGrpSize (dwGrpIDMain);
nCountX = m_pMgrGrpData->GetGrpCountX (dwGrpIDMain);
if (dwGrpIDSub == 0) {
goto Exit;
}
switch (dwGrpIDMain) {
case GRPIDMAIN_CHAR: /* キャラ画像 */
case GRPIDMAIN_2X2_CHAR: /* キャラ(32x32)画像 */
dwGrpIDSub --;
dwParam = FAMILYTYPE_HUMAN;
x = (dwGrpIDSub % nCountX) * nSize;
y = (dwGrpIDSub / nCountX) * nSize;
break;
case GRPIDMAIN_ICON32: /* アイコン(2倍表示) */
dwParam = m_dwGrpIDParam;
if (dwGrpIDSub == 0) {
break;
}
x = (dwGrpIDSub % nCountX) * nSize;
y = (dwGrpIDSub / nCountX) * nSize;
nSize = 32;
break;
default:
dwGrpIDSub --;
dwParam = m_dwGrpIDParam;
if (dwGrpIDSub == 0) {
break;
}
x = (dwGrpIDSub % nCountX) * nSize;
y = (dwGrpIDSub / nCountX) * nSize;
break;
}
pImgTmp = m_pMgrGrpData->GetDib (dwGrpIDMain, dwGrpIDSub, dwParam);
Exit:
m_pImgBack->Create (nSize, nSize);
if (pImgTmp) {
if (dwGrpIDMain == GRPIDMAIN_ICON32) {
m_pMgrData->GetMgrDraw ()->DrawIcon (m_pImgBack, 0, 0, dwGrpIDSub);
} else {
m_pImgBack->BltFrom256 (0, 0, nSize, nSize, pImgTmp, x, y);
}
}
SetWindowPos (NULL, 0, 0, nSize, nSize, SWP_NOZORDER | SWP_NOMOVE);
InvalidateRect (NULL);
}
/* Copyright(C)URARA-works 2007 */
| [
"RXP10430@868715c2-6dae-4c12-b071-75cd31844a78"
] | RXP10430@868715c2-6dae-4c12-b071-75cd31844a78 |
a1a2930d90de953ee16ebb1905da53f3a77173ab | 9870e11c26c15aec3cc13bc910e711367749a7ff | /CF/cd_84_A.cpp | 4c82e41af40ac27335e4cc9a84e3c680496907cf | [] | no_license | liuq901/code | 56eddb81972d00f2b733121505555b7c7cbc2544 | fcbfba70338d3d10bad2a4c08f59d501761c205a | refs/heads/master | 2021-01-15T23:50:10.570996 | 2016-01-16T16:14:18 | 2016-01-16T16:14:18 | 12,918,517 | 1 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 106 | cpp | #include <cstdio>
int main()
{
int n;
scanf("%d",&n);
printf("%d\n",n/2*3);
return(0);
}
| [
"liuq901@163.com"
] | liuq901@163.com |
4299867eaef4b7d12f53d73697f66e15f7d361bf | a799d67184b535243004ed06980d15f546cafd9b | /loopingRandomNumber/loopingRandomNumber/Source.cpp | 524cc56a596c896628ec4bd9613c99e35a66c9e0 | [
"MIT"
] | permissive | DipeshKazi/C-Repository | 487be7a11e8189ab9168a63f2936714f1637f18b | b58f26a1bdb2a159b3a1d025fea2f0d4b2d70823 | refs/heads/master | 2020-12-31T06:56:52.931306 | 2017-05-05T16:08:07 | 2017-05-05T16:08:07 | 86,593,139 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 200 | cpp | #include <iostream>
#include <cstdlib>
#include <ctime>
int main()
{
srand(time(0));
for (int random = 0; random < 10; random++)
{
std::cout << 1 + (rand() % 6) << std::endl;
}
return 0;
} | [
"dipesh2025@hotmail.com"
] | dipesh2025@hotmail.com |
3e9e2d1ea8296733e7a84ab371d3b083b81f3204 | 47145fdb5e9a6eaf99c04012c8480bb8255a4c00 | /Bounce_Back_2/Hazards/Water3.h | aa7d2b11564f419777d24a82aeb00abd85922a13 | [] | no_license | Ozzyblade/bb2ohp2020 | a7127dae115325955b0019553b41bcc6e1ae7a13 | dc6e914790b5856d9a4ba1b2c155691fd84ba13b | refs/heads/master | 2022-11-17T21:47:04.181857 | 2020-07-13T13:41:15 | 2020-07-13T13:41:15 | 279,311,988 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 269 | h | // Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "Hazards/Water.h"
#include "Water3.generated.h"
/**
*
*/
UCLASS()
class BOUNCE_BACK_2_API AWater3 : public AWater
{
GENERATED_BODY()
public:
AWater3 ();
};
| [
"b6011786@my.shu.ac.uk"
] | b6011786@my.shu.ac.uk |
132346e99a49f61b1e7e2b48051fc2a2d48a2231 | 04f684cc29c2d1b3c397635abd16ea195a58c353 | /pat甲级/mid1050.cpp | d53f1fe12e45a264afc54016e87e380e226d1e47 | [] | no_license | Edogawa-Konan/code_in_school | 5dd465bd733b05d119eeed447de9faa23ed9a792 | ffa04aaa60c2c896b4bd32c4a9c44539f10bdc27 | refs/heads/master | 2021-09-07T17:08:08.041739 | 2018-02-26T16:03:33 | 2018-02-26T16:03:33 | 82,790,805 | 2 | 3 | null | null | null | null | UTF-8 | C++ | false | false | 504 | cpp | //
// @author prime on 2017/6/25.
//
#include <iostream>
#include <unordered_set>
#include <string>
using namespace std;
int main()
{
string s1,s2;
getline(cin,s1);
getline(cin,s2);
unordered_set<char> remove;
for (auto &e:s2)
{
remove.insert(e);
}
for (auto &e:s1)
{
if(remove.find(e)!=remove.end())
{//存在于集合中
continue;
}
else
{
printf("%c",e);
}
}
return 0;
}
| [
"1977786930@qq.com"
] | 1977786930@qq.com |
6abe610d03d771554e299ddf61c3bf6225a9373c | 73b2408eb3cb2d08affe8d0c99cacb4eaae2a995 | /porousCondensateFoam/tutorials/twoPhaseCoupledFoamD-tutorial/darcyVertical2D/constant/polyMesh/neighbour | fec17812e1276f956d79b041ec3af9b3bfa2cfc5 | [] | no_license | davoodghomi/porousCondensateCoupledFoam | 656001b986f60eab489495838766f6654d92fd41 | f4cc0c010e5add093f486079a52030c582cc0228 | refs/heads/master | 2021-09-07T11:36:43.289260 | 2018-02-22T11:41:53 | 2018-02-22T11:41:53 | 113,503,828 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 14,460 | /*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | foam-extend: Open Source CFD |
| \\ / O peration | Version: 4.0 |
| \\ / A nd | Web: http://www.foam-extend.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class labelList;
note "nPoints: 3362 nCells: 1600 nFaces: 6480 nInternalFaces: 3120";
location "constant/polyMesh";
object neighbour;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
3120
(
1
40
2
41
3
42
4
43
5
44
6
45
7
46
8
47
9
48
10
49
11
50
12
51
13
52
14
53
15
54
16
55
17
56
18
57
19
58
20
59
21
60
22
61
23
62
24
63
25
64
26
65
27
66
28
67
29
68
30
69
31
70
32
71
33
72
34
73
35
74
36
75
37
76
38
77
39
78
79
41
80
42
81
43
82
44
83
45
84
46
85
47
86
48
87
49
88
50
89
51
90
52
91
53
92
54
93
55
94
56
95
57
96
58
97
59
98
60
99
61
100
62
101
63
102
64
103
65
104
66
105
67
106
68
107
69
108
70
109
71
110
72
111
73
112
74
113
75
114
76
115
77
116
78
117
79
118
119
81
120
82
121
83
122
84
123
85
124
86
125
87
126
88
127
89
128
90
129
91
130
92
131
93
132
94
133
95
134
96
135
97
136
98
137
99
138
100
139
101
140
102
141
103
142
104
143
105
144
106
145
107
146
108
147
109
148
110
149
111
150
112
151
113
152
114
153
115
154
116
155
117
156
118
157
119
158
159
121
160
122
161
123
162
124
163
125
164
126
165
127
166
128
167
129
168
130
169
131
170
132
171
133
172
134
173
135
174
136
175
137
176
138
177
139
178
140
179
141
180
142
181
143
182
144
183
145
184
146
185
147
186
148
187
149
188
150
189
151
190
152
191
153
192
154
193
155
194
156
195
157
196
158
197
159
198
199
161
200
162
201
163
202
164
203
165
204
166
205
167
206
168
207
169
208
170
209
171
210
172
211
173
212
174
213
175
214
176
215
177
216
178
217
179
218
180
219
181
220
182
221
183
222
184
223
185
224
186
225
187
226
188
227
189
228
190
229
191
230
192
231
193
232
194
233
195
234
196
235
197
236
198
237
199
238
239
201
240
202
241
203
242
204
243
205
244
206
245
207
246
208
247
209
248
210
249
211
250
212
251
213
252
214
253
215
254
216
255
217
256
218
257
219
258
220
259
221
260
222
261
223
262
224
263
225
264
226
265
227
266
228
267
229
268
230
269
231
270
232
271
233
272
234
273
235
274
236
275
237
276
238
277
239
278
279
241
280
242
281
243
282
244
283
245
284
246
285
247
286
248
287
249
288
250
289
251
290
252
291
253
292
254
293
255
294
256
295
257
296
258
297
259
298
260
299
261
300
262
301
263
302
264
303
265
304
266
305
267
306
268
307
269
308
270
309
271
310
272
311
273
312
274
313
275
314
276
315
277
316
278
317
279
318
319
281
320
282
321
283
322
284
323
285
324
286
325
287
326
288
327
289
328
290
329
291
330
292
331
293
332
294
333
295
334
296
335
297
336
298
337
299
338
300
339
301
340
302
341
303
342
304
343
305
344
306
345
307
346
308
347
309
348
310
349
311
350
312
351
313
352
314
353
315
354
316
355
317
356
318
357
319
358
359
321
360
322
361
323
362
324
363
325
364
326
365
327
366
328
367
329
368
330
369
331
370
332
371
333
372
334
373
335
374
336
375
337
376
338
377
339
378
340
379
341
380
342
381
343
382
344
383
345
384
346
385
347
386
348
387
349
388
350
389
351
390
352
391
353
392
354
393
355
394
356
395
357
396
358
397
359
398
399
361
400
362
401
363
402
364
403
365
404
366
405
367
406
368
407
369
408
370
409
371
410
372
411
373
412
374
413
375
414
376
415
377
416
378
417
379
418
380
419
381
420
382
421
383
422
384
423
385
424
386
425
387
426
388
427
389
428
390
429
391
430
392
431
393
432
394
433
395
434
396
435
397
436
398
437
399
438
439
401
440
402
441
403
442
404
443
405
444
406
445
407
446
408
447
409
448
410
449
411
450
412
451
413
452
414
453
415
454
416
455
417
456
418
457
419
458
420
459
421
460
422
461
423
462
424
463
425
464
426
465
427
466
428
467
429
468
430
469
431
470
432
471
433
472
434
473
435
474
436
475
437
476
438
477
439
478
479
441
480
442
481
443
482
444
483
445
484
446
485
447
486
448
487
449
488
450
489
451
490
452
491
453
492
454
493
455
494
456
495
457
496
458
497
459
498
460
499
461
500
462
501
463
502
464
503
465
504
466
505
467
506
468
507
469
508
470
509
471
510
472
511
473
512
474
513
475
514
476
515
477
516
478
517
479
518
519
481
520
482
521
483
522
484
523
485
524
486
525
487
526
488
527
489
528
490
529
491
530
492
531
493
532
494
533
495
534
496
535
497
536
498
537
499
538
500
539
501
540
502
541
503
542
504
543
505
544
506
545
507
546
508
547
509
548
510
549
511
550
512
551
513
552
514
553
515
554
516
555
517
556
518
557
519
558
559
521
560
522
561
523
562
524
563
525
564
526
565
527
566
528
567
529
568
530
569
531
570
532
571
533
572
534
573
535
574
536
575
537
576
538
577
539
578
540
579
541
580
542
581
543
582
544
583
545
584
546
585
547
586
548
587
549
588
550
589
551
590
552
591
553
592
554
593
555
594
556
595
557
596
558
597
559
598
599
561
600
562
601
563
602
564
603
565
604
566
605
567
606
568
607
569
608
570
609
571
610
572
611
573
612
574
613
575
614
576
615
577
616
578
617
579
618
580
619
581
620
582
621
583
622
584
623
585
624
586
625
587
626
588
627
589
628
590
629
591
630
592
631
593
632
594
633
595
634
596
635
597
636
598
637
599
638
639
601
640
602
641
603
642
604
643
605
644
606
645
607
646
608
647
609
648
610
649
611
650
612
651
613
652
614
653
615
654
616
655
617
656
618
657
619
658
620
659
621
660
622
661
623
662
624
663
625
664
626
665
627
666
628
667
629
668
630
669
631
670
632
671
633
672
634
673
635
674
636
675
637
676
638
677
639
678
679
641
680
642
681
643
682
644
683
645
684
646
685
647
686
648
687
649
688
650
689
651
690
652
691
653
692
654
693
655
694
656
695
657
696
658
697
659
698
660
699
661
700
662
701
663
702
664
703
665
704
666
705
667
706
668
707
669
708
670
709
671
710
672
711
673
712
674
713
675
714
676
715
677
716
678
717
679
718
719
681
720
682
721
683
722
684
723
685
724
686
725
687
726
688
727
689
728
690
729
691
730
692
731
693
732
694
733
695
734
696
735
697
736
698
737
699
738
700
739
701
740
702
741
703
742
704
743
705
744
706
745
707
746
708
747
709
748
710
749
711
750
712
751
713
752
714
753
715
754
716
755
717
756
718
757
719
758
759
721
760
722
761
723
762
724
763
725
764
726
765
727
766
728
767
729
768
730
769
731
770
732
771
733
772
734
773
735
774
736
775
737
776
738
777
739
778
740
779
741
780
742
781
743
782
744
783
745
784
746
785
747
786
748
787
749
788
750
789
751
790
752
791
753
792
754
793
755
794
756
795
757
796
758
797
759
798
799
761
800
762
801
763
802
764
803
765
804
766
805
767
806
768
807
769
808
770
809
771
810
772
811
773
812
774
813
775
814
776
815
777
816
778
817
779
818
780
819
781
820
782
821
783
822
784
823
785
824
786
825
787
826
788
827
789
828
790
829
791
830
792
831
793
832
794
833
795
834
796
835
797
836
798
837
799
838
839
801
840
802
841
803
842
804
843
805
844
806
845
807
846
808
847
809
848
810
849
811
850
812
851
813
852
814
853
815
854
816
855
817
856
818
857
819
858
820
859
821
860
822
861
823
862
824
863
825
864
826
865
827
866
828
867
829
868
830
869
831
870
832
871
833
872
834
873
835
874
836
875
837
876
838
877
839
878
879
841
880
842
881
843
882
844
883
845
884
846
885
847
886
848
887
849
888
850
889
851
890
852
891
853
892
854
893
855
894
856
895
857
896
858
897
859
898
860
899
861
900
862
901
863
902
864
903
865
904
866
905
867
906
868
907
869
908
870
909
871
910
872
911
873
912
874
913
875
914
876
915
877
916
878
917
879
918
919
881
920
882
921
883
922
884
923
885
924
886
925
887
926
888
927
889
928
890
929
891
930
892
931
893
932
894
933
895
934
896
935
897
936
898
937
899
938
900
939
901
940
902
941
903
942
904
943
905
944
906
945
907
946
908
947
909
948
910
949
911
950
912
951
913
952
914
953
915
954
916
955
917
956
918
957
919
958
959
921
960
922
961
923
962
924
963
925
964
926
965
927
966
928
967
929
968
930
969
931
970
932
971
933
972
934
973
935
974
936
975
937
976
938
977
939
978
940
979
941
980
942
981
943
982
944
983
945
984
946
985
947
986
948
987
949
988
950
989
951
990
952
991
953
992
954
993
955
994
956
995
957
996
958
997
959
998
999
961
1000
962
1001
963
1002
964
1003
965
1004
966
1005
967
1006
968
1007
969
1008
970
1009
971
1010
972
1011
973
1012
974
1013
975
1014
976
1015
977
1016
978
1017
979
1018
980
1019
981
1020
982
1021
983
1022
984
1023
985
1024
986
1025
987
1026
988
1027
989
1028
990
1029
991
1030
992
1031
993
1032
994
1033
995
1034
996
1035
997
1036
998
1037
999
1038
1039
1001
1040
1002
1041
1003
1042
1004
1043
1005
1044
1006
1045
1007
1046
1008
1047
1009
1048
1010
1049
1011
1050
1012
1051
1013
1052
1014
1053
1015
1054
1016
1055
1017
1056
1018
1057
1019
1058
1020
1059
1021
1060
1022
1061
1023
1062
1024
1063
1025
1064
1026
1065
1027
1066
1028
1067
1029
1068
1030
1069
1031
1070
1032
1071
1033
1072
1034
1073
1035
1074
1036
1075
1037
1076
1038
1077
1039
1078
1079
1041
1080
1042
1081
1043
1082
1044
1083
1045
1084
1046
1085
1047
1086
1048
1087
1049
1088
1050
1089
1051
1090
1052
1091
1053
1092
1054
1093
1055
1094
1056
1095
1057
1096
1058
1097
1059
1098
1060
1099
1061
1100
1062
1101
1063
1102
1064
1103
1065
1104
1066
1105
1067
1106
1068
1107
1069
1108
1070
1109
1071
1110
1072
1111
1073
1112
1074
1113
1075
1114
1076
1115
1077
1116
1078
1117
1079
1118
1119
1081
1120
1082
1121
1083
1122
1084
1123
1085
1124
1086
1125
1087
1126
1088
1127
1089
1128
1090
1129
1091
1130
1092
1131
1093
1132
1094
1133
1095
1134
1096
1135
1097
1136
1098
1137
1099
1138
1100
1139
1101
1140
1102
1141
1103
1142
1104
1143
1105
1144
1106
1145
1107
1146
1108
1147
1109
1148
1110
1149
1111
1150
1112
1151
1113
1152
1114
1153
1115
1154
1116
1155
1117
1156
1118
1157
1119
1158
1159
1121
1160
1122
1161
1123
1162
1124
1163
1125
1164
1126
1165
1127
1166
1128
1167
1129
1168
1130
1169
1131
1170
1132
1171
1133
1172
1134
1173
1135
1174
1136
1175
1137
1176
1138
1177
1139
1178
1140
1179
1141
1180
1142
1181
1143
1182
1144
1183
1145
1184
1146
1185
1147
1186
1148
1187
1149
1188
1150
1189
1151
1190
1152
1191
1153
1192
1154
1193
1155
1194
1156
1195
1157
1196
1158
1197
1159
1198
1199
1161
1200
1162
1201
1163
1202
1164
1203
1165
1204
1166
1205
1167
1206
1168
1207
1169
1208
1170
1209
1171
1210
1172
1211
1173
1212
1174
1213
1175
1214
1176
1215
1177
1216
1178
1217
1179
1218
1180
1219
1181
1220
1182
1221
1183
1222
1184
1223
1185
1224
1186
1225
1187
1226
1188
1227
1189
1228
1190
1229
1191
1230
1192
1231
1193
1232
1194
1233
1195
1234
1196
1235
1197
1236
1198
1237
1199
1238
1239
1201
1240
1202
1241
1203
1242
1204
1243
1205
1244
1206
1245
1207
1246
1208
1247
1209
1248
1210
1249
1211
1250
1212
1251
1213
1252
1214
1253
1215
1254
1216
1255
1217
1256
1218
1257
1219
1258
1220
1259
1221
1260
1222
1261
1223
1262
1224
1263
1225
1264
1226
1265
1227
1266
1228
1267
1229
1268
1230
1269
1231
1270
1232
1271
1233
1272
1234
1273
1235
1274
1236
1275
1237
1276
1238
1277
1239
1278
1279
1241
1280
1242
1281
1243
1282
1244
1283
1245
1284
1246
1285
1247
1286
1248
1287
1249
1288
1250
1289
1251
1290
1252
1291
1253
1292
1254
1293
1255
1294
1256
1295
1257
1296
1258
1297
1259
1298
1260
1299
1261
1300
1262
1301
1263
1302
1264
1303
1265
1304
1266
1305
1267
1306
1268
1307
1269
1308
1270
1309
1271
1310
1272
1311
1273
1312
1274
1313
1275
1314
1276
1315
1277
1316
1278
1317
1279
1318
1319
1281
1320
1282
1321
1283
1322
1284
1323
1285
1324
1286
1325
1287
1326
1288
1327
1289
1328
1290
1329
1291
1330
1292
1331
1293
1332
1294
1333
1295
1334
1296
1335
1297
1336
1298
1337
1299
1338
1300
1339
1301
1340
1302
1341
1303
1342
1304
1343
1305
1344
1306
1345
1307
1346
1308
1347
1309
1348
1310
1349
1311
1350
1312
1351
1313
1352
1314
1353
1315
1354
1316
1355
1317
1356
1318
1357
1319
1358
1359
1321
1360
1322
1361
1323
1362
1324
1363
1325
1364
1326
1365
1327
1366
1328
1367
1329
1368
1330
1369
1331
1370
1332
1371
1333
1372
1334
1373
1335
1374
1336
1375
1337
1376
1338
1377
1339
1378
1340
1379
1341
1380
1342
1381
1343
1382
1344
1383
1345
1384
1346
1385
1347
1386
1348
1387
1349
1388
1350
1389
1351
1390
1352
1391
1353
1392
1354
1393
1355
1394
1356
1395
1357
1396
1358
1397
1359
1398
1399
1361
1400
1362
1401
1363
1402
1364
1403
1365
1404
1366
1405
1367
1406
1368
1407
1369
1408
1370
1409
1371
1410
1372
1411
1373
1412
1374
1413
1375
1414
1376
1415
1377
1416
1378
1417
1379
1418
1380
1419
1381
1420
1382
1421
1383
1422
1384
1423
1385
1424
1386
1425
1387
1426
1388
1427
1389
1428
1390
1429
1391
1430
1392
1431
1393
1432
1394
1433
1395
1434
1396
1435
1397
1436
1398
1437
1399
1438
1439
1401
1440
1402
1441
1403
1442
1404
1443
1405
1444
1406
1445
1407
1446
1408
1447
1409
1448
1410
1449
1411
1450
1412
1451
1413
1452
1414
1453
1415
1454
1416
1455
1417
1456
1418
1457
1419
1458
1420
1459
1421
1460
1422
1461
1423
1462
1424
1463
1425
1464
1426
1465
1427
1466
1428
1467
1429
1468
1430
1469
1431
1470
1432
1471
1433
1472
1434
1473
1435
1474
1436
1475
1437
1476
1438
1477
1439
1478
1479
1441
1480
1442
1481
1443
1482
1444
1483
1445
1484
1446
1485
1447
1486
1448
1487
1449
1488
1450
1489
1451
1490
1452
1491
1453
1492
1454
1493
1455
1494
1456
1495
1457
1496
1458
1497
1459
1498
1460
1499
1461
1500
1462
1501
1463
1502
1464
1503
1465
1504
1466
1505
1467
1506
1468
1507
1469
1508
1470
1509
1471
1510
1472
1511
1473
1512
1474
1513
1475
1514
1476
1515
1477
1516
1478
1517
1479
1518
1519
1481
1520
1482
1521
1483
1522
1484
1523
1485
1524
1486
1525
1487
1526
1488
1527
1489
1528
1490
1529
1491
1530
1492
1531
1493
1532
1494
1533
1495
1534
1496
1535
1497
1536
1498
1537
1499
1538
1500
1539
1501
1540
1502
1541
1503
1542
1504
1543
1505
1544
1506
1545
1507
1546
1508
1547
1509
1548
1510
1549
1511
1550
1512
1551
1513
1552
1514
1553
1515
1554
1516
1555
1517
1556
1518
1557
1519
1558
1559
1521
1560
1522
1561
1523
1562
1524
1563
1525
1564
1526
1565
1527
1566
1528
1567
1529
1568
1530
1569
1531
1570
1532
1571
1533
1572
1534
1573
1535
1574
1536
1575
1537
1576
1538
1577
1539
1578
1540
1579
1541
1580
1542
1581
1543
1582
1544
1583
1545
1584
1546
1585
1547
1586
1548
1587
1549
1588
1550
1589
1551
1590
1552
1591
1553
1592
1554
1593
1555
1594
1556
1595
1557
1596
1558
1597
1559
1598
1599
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
)
// ************************************************************************* //
| [
"noreply@github.com"
] | noreply@github.com | |
ef7d0613b01c96345145e87bb859af7e04015d30 | fbd9dd36e67ab796fdaae07671dc6ae64d5f7fca | /src/chiave_hash.cc | 502e9527f51169c175466b59e9687162060c4e62 | [
"MIT"
] | permissive | morinim/joker | 58d165afa053703bf7d79d051cd823a5f33f4015 | 83fb1faf4d1d691f337102d869a7e488c3dd4b88 | refs/heads/master | 2021-01-22T00:52:27.157626 | 2019-07-19T12:21:06 | 2019-07-19T12:21:06 | 102,196,941 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,074 | cc | /*
* Chiave_hash.cc
*/
#include "chiave_hash.h"
namespace Joker
{
unsigned64 chiave_hash::codice_posizione[2][7][64];
//-----------------------------------------------------------------------------
// Calcola_array:
//-----------------------------------------------------------------------------
void chiave_hash::calcola_array()
{
colore c(false);
do
{
for (unsigned pz(vuoto); pz <= re; pz++)
for (posizione p(a1); !p.fuori(); ++p)
codice_posizione[c][pz][p] = random::random64();
} while (c^=1);
}
//-----------------------------------------------------------------------------
// Chiave_hash:
//-----------------------------------------------------------------------------
chiave_hash::chiave_hash(const scacchiera &s, colore c_mossa)
{
chiave = 0;
colore c(false);
do
for (pezzo pz(pedone); pz <= re; ++pz)
{
bitboard mp(s.mappa(c,pz));
while (mp)
{
const posizione pos(mp.firstone());
chiave ^= codice_posizione[c][pz][pos];
mp.elimina(pos);
}
}
while (c^=1);
if (c_mossa == nero)
chiave = ~chiave;
}
//-----------------------------------------------------------------------------
// Operator>>:
//-----------------------------------------------------------------------------
std::istream &operator>>(std::istream &i, chiave_hash &c)
{
unsigned64 tmp1(0), tmp2(0);
i >> tmp1 >> tmp2;
c.chiave = (tmp1 << 32) | tmp2;
return i;
}
//-----------------------------------------------------------------------------
// Operator<<:
//-----------------------------------------------------------------------------
std::ostream &operator<<(std::ostream &o, const chiave_hash &c)
{
const unsigned32 n1(unsigned32(c.chiave >> 32));
const unsigned32 n2(unsigned32(c.chiave & u32_max));
o << std::setw(10) << n1 << ' ' << std::setw(10) << n2;
return o;
}
#if defined(_DEBUG)
bool chiave_hash::verifica(const scacchiera &s, colore c) const
{
chiave_hash tmp(s,c);
return chiave == tmp.chiave;
}
#endif
} // Namespace Joker.
| [
"morinim@gmail.com"
] | morinim@gmail.com |
3c3dc8c6ffa9c9f521b2ee8374d2bf393d96de24 | 3761c72b12b5d80ff4c054be3fdfdbd5a5bce7c8 | /minimum maximum.cpp | e5635f442c1d19c7c33e8fc4003268ca369b8153 | [] | no_license | sen329/CS-ASSIGNMENTS-3 | 1f7ceee09ad2f8f964c57b67801f73d5e0566082 | e2cae0a177efd5d412876681ba6f41c806a5abd6 | refs/heads/master | 2021-01-11T01:09:34.199138 | 2016-10-17T01:26:36 | 2016-10-17T01:26:36 | 71,051,371 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 300 | cpp | #include <iostream>
using namespace std;
int main () {
int num1;
int num2;
cout << "Enter 2 numbers: ";
cin >> num1;
cin >> num2;
if(num1>num2){
cout << num1 << " is bigger than " << num2;
}
else {
cout << num2 << " is bigger than " << num1;
}
return 0;
}
| [
"noreply@github.com"
] | noreply@github.com |
dae009b82ea7d99015ae54b107530d1dd57740e5 | 00857266ddf21820b12f45e0972ccc8973d71c62 | /BaiKiemTra_2/1610207_LaQuocThang_BaiTap02/1610207_LaQuocThang_BaiTap02/Program.cpp | 6fe2d3b3905d38e1aa5c34dae30fe547642493dc | [] | no_license | dominhdang148/CTDL-GT | 3f8a58315cec68f197b853e90c5de58ee0ba8161 | 31f52f9f4fad6db3f6d4ce228a41b68c910b8a51 | refs/heads/master | 2022-09-24T03:58:21.256796 | 2020-06-07T11:09:13 | 2020-06-07T11:09:13 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 437 | cpp | //MSSV: 1610207
//Họ và tên: La Quốc Thắng
#include <iostream>
#include <conio.h>
#include <fstream>
#include <string.h>
#include <iomanip>
using namespace std;
#include "Thuvien.h"
#include "Menu.h"
void ChayChuongTrinh();
int main()
{
ChayChuongTrinh();
return 1;
}
void ChayChuongTrinh()
{
int menu, soMenu = 8, n = 0;
SinhVien a[MAX];
do
{
menu = ChonMenu(soMenu);
XuLyMenu(menu, a, n);
} while (menu > 0);
} | [
"37357028+laquocthang@users.noreply.github.com"
] | 37357028+laquocthang@users.noreply.github.com |
3a3f341202cee87a1ba2a899effcc8c32f7691c7 | 503510d6e899af409e75b4ae1f3fb6c964f11448 | /src/GameClient/Windows/Window/DialogWindow.cpp | 56a0657af03f95c01c2c8fe869bb6e9fcd61a404 | [
"MIT"
] | permissive | karelz/WarPlusPlus | 5d0002066f705f9ae1952ed03a26d0e94f73cbdf | 9750f0d63bcddd91f253cc9618da3f8b1dda6c9c | refs/heads/master | 2020-06-05T05:31:41.208218 | 2019-09-16T14:00:26 | 2019-09-16T14:00:26 | 192,327,562 | 4 | 4 | MIT | 2019-09-16T14:00:27 | 2019-06-17T10:44:55 | C++ | UTF-8 | C++ | false | false | 4,675 | cpp | // DialogWindow.cpp: implementation of the CDialogWindow class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "DialogWindow.h"
#include "..\Controls\Layouts.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
IMPLEMENT_DYNAMIC(CDialogWindow, CCaptionWindow);
BEGIN_OBSERVER_MAP(CDialogWindow, CCaptionWindow)
BEGIN_NOTIFIER(CDialogWindow::IDC_CANCEL)
ON_BUTTONRELEASED(OnCancel)
END_NOTIFIER()
END_OBSERVER_MAP(CDialogWindow, CCaptionWindow)
CDialogWindow::CDialogWindow()
{
m_pOwner = NULL;
m_pLayout = NULL;
m_pEventManager = NULL;
}
CDialogWindow::~CDialogWindow()
{
}
#ifdef _DEBUG
void CDialogWindow::AssertValid() const
{
CCaptionWindow::AssertValid();
}
void CDialogWindow::Dump(CDumpContext &dc) const
{
CCaptionWindow::Dump(dc);
}
#endif
BOOL CDialogWindow::Create(CRect &rcBound, CString strCaption, CDialogWindowLayout *pLayout, CWindow *pParent)
{
if(pLayout == NULL){
m_pLayout = CLayouts::m_pDefaults->GetDialogWindowLayout();
}
else{
ASSERT_VALID(pLayout);
m_pLayout = pLayout;
}
// set our window as topmost
m_bTopMost = TRUE;
// remeber the owner (given as parent)
m_pOwner = pParent;
// don't have the tab stop - no keyboard input for us
m_bTabStop = FALSE;
// create the dialog window
if(!CCaptionWindow::Create(rcBound, strCaption, m_pLayout, g_pDesktopWindow, FALSE)) return FALSE;
// first create the close button
{
// create the point and button itself there
CPoint pt(rcBound.Width() - m_pLayout->m_dwCloseRightMargin,
m_pLayout->m_dwCloseTopMargin);
m_CloseButton.Create(pt, &(m_pLayout->m_CloseButtonLayout), this, FALSE);
// CRect rcSensitive;
// rcSensitive.l
// set the accelerator to Esc
m_CloseButton.SetKeyAcc(VK_ESCAPE, 0);
// connect it
m_CloseButton.Connect(this, IDC_CANCEL);
}
// call the InitDialog function
InitDialog();
// activate us
Activate();
// set the focus to the first control in dialog
// it's same as set focus to the first child window
// if it doesn't have the TabStop flag set, this functin will find first next child
// which does have
TrySetFocus();
return TRUE;
}
void CDialogWindow::Delete()
{
m_CloseButton.Delete();
m_pLayout = NULL;
CCaptionWindow::Delete();
}
void CDialogWindow::InitDialog()
{
// here do nothing
}
DWORD CDialogWindow::DoLoop()
{
DWORD dwRet;
// first we have to determine the event manager for this thread
CEventManager *pEventManager = CEventManager::FindEventManager(GetCurrentThreadId());
// then disable the owner window
if(m_pOwner){
m_pOwner->EnableWindow(FALSE);
}
// internaly enable us
// we could be disabled by the previous action
InternalEnableWindow(TRUE);
// say that we're starting the loop for this manager
m_pEventManager = pEventManager;
// start our own message loop
// remeber the returned value - it's the value of the dialog end cause
dwRet = pEventManager->DoEventLoop();
// we've done looping for this manager
m_pEventManager = NULL;
// enable the owner
if(m_pOwner){
m_pOwner->EnableWindow(TRUE);
}
// OK we've done
return dwRet;
}
void CDialogWindow::EndDialog(DWORD dwCode)
{
// we have to determine, if the dialog was in modal state
// if so -> inlay the quit event
if(m_pEventManager){
m_pEventManager->InlayQuitEvent(dwCode);
}
}
DWORD CDialogWindow::DoModal(CRect &rcBound, CString strCaption, CDialogWindowLayout *pLayout, CWindow *pParent)
{
DWORD dwRet;
// create the dialog
Create(rcBound, strCaption, pLayout, pParent);
// do the loop
dwRet = DoLoop();
// delete the dialog
Delete();
return dwRet;
}
DWORD CDialogWindow::DoModal(CWindow *pParent)
{
// use defaults
return DoModal(GetDefaultPosition(), GetDefaultCaption(), NULL, pParent);
}
DWORD CDialogWindow::DoModal()
{
// were we created ?
ASSERT_VALID(m_pLayout);
// just do the loop
return DoLoop();
}
void CDialogWindow::OnCancel()
{
// if cancel just end the dialog with apropriate code
EndDialog(IDC_CANCEL);
}
CRect CDialogWindow::GetDefaultPosition()
{
return CRect(50, 50, 300, 200);
}
CString CDialogWindow::GetDefaultCaption()
{
return CString();
}
CRect CDialogWindow::GetCenterPosition(CSize size)
{
CRect rc;
rc.left = (g_pDDPrimarySurface->GetScreenRect()->Width() - size.cx) / 2;
rc.right = rc.left + size.cx;
rc.top = (g_pDDPrimarySurface->GetScreenRect()->Height() - size.cy) / 2;
rc.bottom = rc.top + size.cy;
return rc;
}
| [
"karelz@microsoft.com"
] | karelz@microsoft.com |
b75a11a27cde7eeb9f9835ccb3898a03fb887847 | 2f5417a87db200168bb6e932ade65b6c9e16de02 | /[iLab]стековый калькулятор/stack_functions.cpp | f35e3ed59729668c03e00171b3baec91dbd681ba | [] | no_license | kopoden/Common-Storage | 9d5a75dc56af5c5c90dab33fc14fe6e9e2777c7a | fe1be5699c7898b89f6a301246387f358a401593 | refs/heads/master | 2021-01-25T08:42:35.445771 | 2014-12-22T20:22:50 | 2014-12-22T20:23:21 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,611 | cpp | #include "stack_functions.h"
//===========================================================
int stack_ctor ( STACK_t* new_stack ) {
if (new_stack == NULL)
return NOT_INITIALIZED;
new_stack->stack_arr = NULL; // Empty stack
new_stack->counter = 0; // Empty stack. Counter points to the zero element
new_stack->max_size = 0;
return OK;
}
//======================================================
//======================================================
int push (STACK_t* Stack, data_t value) {
int check = stack_ok(Stack);
if (check != OK && check != EMPTY)
return check;
Stack->counter++;
Stack->stack_arr[Stack->counter - 1] = value;
return OK;
}
//======================================================
//======================================================
int pop (STACK_t* Stack, data_t* value) {
int check = stack_ok(Stack);
if (check != FULL && check != OK) {
return check;
}
Stack->counter--;
if (value == NULL)
return OK;
*value = Stack->stack_arr[Stack->counter];
return OK;
}
//======================================================
int stack_resize (STACK_t* Stack, int Size) {
if (Stack == NULL)
return NOT_INITIALIZED;
if (Stack->stack_arr == NULL && (Stack->counter != 0 || Stack->max_size != 0))
return NULL_DATA_POINTER;
if (Stack->stack_arr == NULL)
Stack->stack_arr = (data_t*) calloc (Size, sizeof(data_t));
else
Stack->stack_arr = (data_t*) realloc (Stack->stack_arr, sizeof(data_t) * Size);
if (Stack->stack_arr == NULL && Size != 0) {
return ERR_MEM;
}
Stack->max_size = Size;
return OK;
}
//======================================================
//======================================================
int insrt (STACK_t* Stack, int position, data_t value) {
if ((position < 0) && (position >= Stack->max_size))
return INCORRECT_POSITION_FOR_INSERT;
int check = stack_ok(Stack);
if (check != OK && check != EMPTY)
return check;
Stack->counter++;
for (int END = Stack->counter - 1; END > position; END--)
Stack->stack_arr[END] = Stack->stack_arr[END - 1];
Stack->stack_arr[position] = value;
return OK;
}
//======================================================
//======================================================
int stack_ok (STACK_t* Stack) {
if (Stack == NULL)
return NOT_INITIALIZED;
if (Stack->stack_arr == NULL)
return NULL_DATA_POINTER;
if ((Stack->counter < 0) || (Stack->counter > Stack->max_size))
return INCORRECT_COUNTER;
if (Stack->counter == Stack->max_size)
return FULL;
if (Stack->counter == 0)
return EMPTY; //Stack is empty(can't pop, but still can push).
return OK; //Stack is fully workable.
}
//======================================================
//======================================================
int stack_dtor(STACK_t* Stack) {
if (Stack == NULL)
return NOT_INITIALIZED;
free(Stack->stack_arr);
Stack->stack_arr = NULL;
Stack->counter = 0;
Stack->max_size = 0;
return OK;
}
//=====================================================
void stack_dump(STACK_t* Stack, FILE* dump) {
if (Stack == NULL) {
fprintf(dump, "*********************STACK DUMP******************************\nCOUNTER: %d\nMAX SIZE: %d\n\
IMPOSSIBLE TO DUMP STACK. STACK POINTER = NULL. DATA LOCATION UNDEFINED.\n\
*************************************************************\n\n", \
Stack->counter, Stack->max_size);
return;
}
if (Stack->stack_arr == NULL) {
fprintf(dump, "*********************STACK DUMP******************************\nCOUNTER: %d\nMAX SIZE: %d\n\
IMPOSSIBLE TO DUMP STACK. STACK DATA POINTER = NULL. DATA LOCATION UNDEFINED.\n\
*************************************************************\n\n", \
Stack->counter, Stack->max_size);
fprintf(dump, "\n*************************************************************\n\n");
return;
}
fprintf(dump, "*********************STACK DUMP******************************\nCOUNTER: %d\nMAX SIZE: %d\nSTACK:", \
Stack->counter, Stack->max_size);
for (int i = 0; i < Stack->counter; i++)
fprintf(dump, " | %lg |", Stack->stack_arr[i]);
fprintf(dump, "\n*************************************************************\n\n");
}
| [
"kopoden@mail.ru"
] | kopoden@mail.ru |
36c5d73f48c46d70e9f36435fa1270124aec3154 | d2f5e0b43885cd080a4c5026ce133e288482f8d0 | /Juez EDA/EDA_Juez2_7/EDA_Juez2_7/Source.cpp | 4e0dfff06c66872b7fe2654b6b4efd3e1cc95fce | [] | no_license | tito-kimbo/Online-Judge-Solutions | fb0ea2f2b9d8724a4b1f914a8be02294f1664135 | 1207e95365fb6f2691de077beaf2cbe7f0724c11 | refs/heads/master | 2020-06-03T04:18:32.970773 | 2019-06-11T19:12:52 | 2019-06-11T19:12:52 | 191,435,206 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 513 | cpp | #include <iostream>
#include "checkML.h"
#include "operable_queue.h"
void resolver(int & aux) {
operable_queue<int> q;
while (aux != 0) {
q.push(aux);
std::cin >> aux;
}
q.reverse();
while (!q.empty()) {
std::cout << q.front();
q.pop();
if (!q.empty()) {
std::cout << ' ';
}
}
std::cout << '\n';
}
int main() {
#ifndef DOMJUDGE
_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
#endif
int aux;
std::cin >> aux;
while (std::cin) {
resolver(aux);
std::cin >> aux;
}
} | [
"eduriver@ucm.es"
] | eduriver@ucm.es |
833a850201e3362e3a52bb040dbaed92a46150d4 | 9fad4848e43f4487730185e4f50e05a044f865ab | /src/cc/blink/web_layer_impl.h | af1145ce9137ad69e2d94d794ead2519f02e6b7a | [
"BSD-3-Clause"
] | permissive | dummas2008/chromium | d1b30da64f0630823cb97f58ec82825998dbb93e | 82d2e84ce3ed8a00dc26c948219192c3229dfdaa | refs/heads/master | 2020-12-31T07:18:45.026190 | 2016-04-14T03:17:45 | 2016-04-14T03:17:45 | 56,194,439 | 4 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 6,122 | h | // Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CC_BLINK_WEB_LAYER_IMPL_H_
#define CC_BLINK_WEB_LAYER_IMPL_H_
#include <stddef.h>
#include <stdint.h>
#include <memory>
#include <string>
#include <utility>
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "cc/blink/cc_blink_export.h"
#include "cc/layers/layer_client.h"
#include "third_party/WebKit/public/platform/WebColor.h"
#include "third_party/WebKit/public/platform/WebDoublePoint.h"
#include "third_party/WebKit/public/platform/WebFloatPoint.h"
#include "third_party/WebKit/public/platform/WebLayer.h"
#include "third_party/WebKit/public/platform/WebPoint.h"
#include "third_party/WebKit/public/platform/WebRect.h"
#include "third_party/WebKit/public/platform/WebSize.h"
#include "third_party/WebKit/public/platform/WebString.h"
#include "third_party/WebKit/public/platform/WebVector.h"
#include "third_party/skia/include/utils/SkMatrix44.h"
namespace blink {
struct WebFloatRect;
}
namespace base {
namespace trace_event {
class ConvertableToTraceFormat;
}
}
namespace cc {
class FilterOperations;
class Layer;
}
namespace cc_blink {
class WebLayerImpl : public blink::WebLayer {
public:
CC_BLINK_EXPORT WebLayerImpl();
CC_BLINK_EXPORT explicit WebLayerImpl(scoped_refptr<cc::Layer>);
~WebLayerImpl() override;
CC_BLINK_EXPORT cc::Layer* layer() const;
// If set to true, content opaqueness cannot be changed using setOpaque.
// However, it can still be modified using SetContentsOpaque on the
// cc::Layer.
CC_BLINK_EXPORT void SetContentsOpaqueIsFixed(bool fixed);
// WebLayer implementation.
int id() const override;
void invalidateRect(const blink::WebRect&) override;
void invalidate() override;
void addChild(blink::WebLayer* child) override;
void insertChild(blink::WebLayer* child, size_t index) override;
void replaceChild(blink::WebLayer* reference,
blink::WebLayer* new_layer) override;
void removeFromParent() override;
void removeAllChildren() override;
void setBounds(const blink::WebSize& bounds) override;
blink::WebSize bounds() const override;
void setMasksToBounds(bool masks_to_bounds) override;
bool masksToBounds() const override;
void setMaskLayer(blink::WebLayer* mask) override;
void setReplicaLayer(blink::WebLayer* replica) override;
void setOpacity(float opacity) override;
float opacity() const override;
void setBlendMode(blink::WebBlendMode blend_mode) override;
blink::WebBlendMode blendMode() const override;
void setIsRootForIsolatedGroup(bool root) override;
bool isRootForIsolatedGroup() override;
void setOpaque(bool opaque) override;
bool opaque() const override;
void setPosition(const blink::WebFloatPoint& position) override;
blink::WebFloatPoint position() const override;
void setTransform(const SkMatrix44& transform) override;
void setTransformOrigin(const blink::WebFloatPoint3D& point) override;
blink::WebFloatPoint3D transformOrigin() const override;
SkMatrix44 transform() const override;
void setDrawsContent(bool draws_content) override;
bool drawsContent() const override;
void setDoubleSided(bool double_sided) override;
void setShouldFlattenTransform(bool flatten) override;
void setRenderingContext(int context) override;
void setUseParentBackfaceVisibility(bool visible) override;
void setBackgroundColor(blink::WebColor color) override;
blink::WebColor backgroundColor() const override;
void setFilters(const cc::FilterOperations& filters) override;
void setBackgroundFilters(const cc::FilterOperations& filters) override;
bool hasActiveAnimationForTesting() override;
void setForceRenderSurface(bool force) override;
void setScrollPositionDouble(blink::WebDoublePoint position) override;
blink::WebDoublePoint scrollPositionDouble() const override;
void setScrollClipLayer(blink::WebLayer* clip_layer) override;
bool scrollable() const override;
void setUserScrollable(bool horizontal, bool vertical) override;
bool userScrollableHorizontal() const override;
bool userScrollableVertical() const override;
void addMainThreadScrollingReasons(
uint32_t main_thread_scrolling_reasons) override;
void clearMainThreadScrollingReasons(
uint32_t main_thread_scrolling_reasons_to_clear) override;
uint32_t mainThreadScrollingReasons() override;
bool shouldScrollOnMainThread() const override;
void setNonFastScrollableRegion(
const blink::WebVector<blink::WebRect>& region) override;
blink::WebVector<blink::WebRect> nonFastScrollableRegion() const override;
void setTouchEventHandlerRegion(
const blink::WebVector<blink::WebRect>& region) override;
blink::WebVector<blink::WebRect> touchEventHandlerRegion() const override;
void setFrameTimingRequests(
const blink::WebVector<std::pair<int64_t, blink::WebRect>>& requests)
override;
blink::WebVector<std::pair<int64_t, blink::WebRect>> frameTimingRequests()
const override;
void setIsContainerForFixedPositionLayers(bool is_container) override;
bool isContainerForFixedPositionLayers() const override;
void setPositionConstraint(
const blink::WebLayerPositionConstraint& constraint) override;
blink::WebLayerPositionConstraint positionConstraint() const override;
void setScrollClient(blink::WebLayerScrollClient* client) override;
void setLayerClient(cc::LayerClient* client) override;
const cc::Layer* ccLayer() const override;
cc::Layer* ccLayer() override;
void setElementId(uint64_t id) override;
uint64_t elementId() const override;
void setCompositorMutableProperties(uint32_t properties) override;
uint32_t compositorMutableProperties() const override;
void setScrollParent(blink::WebLayer* parent) override;
void setClipParent(blink::WebLayer* parent) override;
protected:
scoped_refptr<cc::Layer> layer_;
bool contents_opaque_is_fixed_;
private:
DISALLOW_COPY_AND_ASSIGN(WebLayerImpl);
};
} // namespace cc_blink
#endif // CC_BLINK_WEB_LAYER_IMPL_H_
| [
"dummas@163.com"
] | dummas@163.com |
7fdfc8335f97e33acb1ec480c635fd286363434a | 1c7cb3154854a0d5f628c4285aa209affd8d2fc9 | /chaos-ns-3/ns-3.27/src/internet-apps/model/dhcp-server.cc | 13538b5c6bbc8b13b312116219ee4ec726941a11 | [
"GPL-2.0-only",
"LicenseRef-scancode-free-unknown",
"MIT"
] | permissive | ErikNatanael/royal-chaos | fac8e5891044490cd2e61b7367f284d99951d0d1 | a8e763d3720cc3e158e98143cabce8106d8de2aa | refs/heads/master | 2022-07-16T12:21:31.494237 | 2020-05-12T12:50:08 | 2020-05-12T12:50:08 | 263,333,134 | 0 | 0 | MIT | 2020-05-12T12:42:08 | 2020-05-12T12:42:08 | null | UTF-8 | C++ | false | false | 14,451 | cc | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2011 UPB
* Copyright (c) 2017 NITK Surathkal
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation;
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: Radu Lupu <rlupu@elcom.pub.ro>
* Ankit Deepak <adadeepak8@gmail.com>
* Deepti Rajagopal <deeptir96@gmail.com>
*
*/
#include "ns3/log.h"
#include "ns3/assert.h"
#include "ns3/ipv4-address.h"
#include "ns3/nstime.h"
#include "ns3/inet-socket-address.h"
#include "ns3/ipv4-packet-info-tag.h"
#include "ns3/socket.h"
#include "ns3/simulator.h"
#include "ns3/socket-factory.h"
#include "ns3/packet.h"
#include "ns3/uinteger.h"
#include "ns3/config.h"
#include "dhcp-server.h"
#include "dhcp-header.h"
#include "ns3/ipv4.h"
#include <map>
#include <algorithm>
namespace ns3 {
NS_LOG_COMPONENT_DEFINE ("DhcpServer");
NS_OBJECT_ENSURE_REGISTERED (DhcpServer);
TypeId
DhcpServer::GetTypeId (void)
{
static TypeId tid = TypeId ("ns3::DhcpServer")
.SetParent<Application> ()
.AddConstructor<DhcpServer> ()
.SetGroupName ("Internet-Apps")
.AddAttribute ("LeaseTime",
"Lease for which address will be leased.",
TimeValue (Seconds (30)),
MakeTimeAccessor (&DhcpServer::m_lease),
MakeTimeChecker ())
.AddAttribute ("RenewTime",
"Time after which client should renew.",
TimeValue (Seconds (15)),
MakeTimeAccessor (&DhcpServer::m_renew),
MakeTimeChecker ())
.AddAttribute ("RebindTime",
"Time after which client should rebind.",
TimeValue (Seconds (25)),
MakeTimeAccessor (&DhcpServer::m_rebind),
MakeTimeChecker ())
.AddAttribute ("PoolAddresses",
"Pool of addresses to provide on request.",
Ipv4AddressValue (),
MakeIpv4AddressAccessor (&DhcpServer::m_poolAddress),
MakeIpv4AddressChecker ())
.AddAttribute ("FirstAddress",
"The First valid address that can be given.",
Ipv4AddressValue (),
MakeIpv4AddressAccessor (&DhcpServer::m_minAddress),
MakeIpv4AddressChecker ())
.AddAttribute ("LastAddress",
"The Last valid address that can be given.",
Ipv4AddressValue (),
MakeIpv4AddressAccessor (&DhcpServer::m_maxAddress),
MakeIpv4AddressChecker ())
.AddAttribute ("PoolMask",
"Mask of the pool of addresses.",
Ipv4MaskValue (),
MakeIpv4MaskAccessor (&DhcpServer::m_poolMask),
MakeIpv4MaskChecker ())
.AddAttribute ("Gateway",
"Address of default gateway",
Ipv4AddressValue (),
MakeIpv4AddressAccessor (&DhcpServer::m_gateway),
MakeIpv4AddressChecker ())
;
return tid;
}
DhcpServer::DhcpServer ()
{
NS_LOG_FUNCTION (this);
}
DhcpServer::~DhcpServer ()
{
NS_LOG_FUNCTION (this);
}
void
DhcpServer::DoDispose (void)
{
NS_LOG_FUNCTION (this);
Application::DoDispose ();
}
void DhcpServer::StartApplication (void)
{
NS_LOG_FUNCTION (this);
NS_ASSERT_MSG (m_minAddress < m_maxAddress,"Invalid Address range");
Ipv4Address myOwnAddress;
if (m_socket)
{
NS_ABORT_MSG ("DHCP daemon is not (yet) meant to be started twice or more.");
}
uint32_t addrIndex;
//add the DHCP local address to the leased addresses list, if it is defined!
Ptr<Ipv4> ipv4 = GetNode ()->GetObject<Ipv4> ();
int32_t ifIndex = ipv4->GetInterfaceForPrefix (m_poolAddress, m_poolMask);
if (ifIndex < 0)
{
NS_ABORT_MSG ("DHCP daemon must be run on the same subnet it is assigning the addresses.");
}
for (addrIndex = 0; addrIndex < ipv4->GetNAddresses (ifIndex); addrIndex++)
{
if (ipv4->GetAddress (ifIndex, addrIndex).GetLocal ().CombineMask (m_poolMask) == m_poolAddress &&
ipv4->GetAddress (ifIndex, addrIndex).GetLocal ().Get () >= m_minAddress.Get () &&
ipv4->GetAddress (ifIndex, addrIndex).GetLocal ().Get () <= m_maxAddress.Get ())
{
// set infinite GRANTED_LEASED_TIME for my address
myOwnAddress = ipv4->GetAddress (ifIndex, addrIndex).GetLocal ();
m_leasedAddresses[Address ()] = std::make_pair (myOwnAddress, 0xffffffff);
break;
}
}
TypeId tid = TypeId::LookupByName ("ns3::UdpSocketFactory");
m_socket = Socket::CreateSocket (GetNode (), tid);
InetSocketAddress local = InetSocketAddress (Ipv4Address::GetAny (), PORT);
m_socket->SetAllowBroadcast (true);
m_socket->BindToNetDevice (ipv4->GetNetDevice (ifIndex));
m_socket->Bind (local);
m_socket->SetRecvPktInfo (true);
uint32_t range = m_maxAddress.Get () - m_minAddress.Get () + 1;
for (uint32_t searchSeq = 0; searchSeq < range; searchSeq ++)
{
Ipv4Address poolAddress = Ipv4Address (m_minAddress.Get () + searchSeq);
if (poolAddress != myOwnAddress)
{
NS_LOG_LOGIC ("Adding " << poolAddress << " to the pool");
m_availableAddresses.push_back (poolAddress);
}
}
m_socket->SetRecvCallback (MakeCallback (&DhcpServer::NetHandler, this));
m_expiredEvent = Simulator::Schedule (Seconds (1), &DhcpServer::TimerHandler, this);
}
void DhcpServer::StopApplication ()
{
NS_LOG_FUNCTION (this);
if (m_socket != 0)
{
m_socket->SetRecvCallback (MakeNullCallback<void, Ptr<Socket> > ());
}
m_leasedAddresses.clear ();
Simulator::Remove (m_expiredEvent);
}
void DhcpServer::TimerHandler ()
{
NS_LOG_FUNCTION (this);
// Set up timeout events and release of unsolicited addresses from the list
LeasedAddressIter i;
for (i = m_leasedAddresses.begin (); i != m_leasedAddresses.end (); i++)
{
// update the address state
if (i->second.second != 0xffffffff && i->second.second != 0)
{
i->second.second--;
if (i->second.second == 0)
{
NS_LOG_INFO ("Address leased state expired, address removed - " <<
"chaddr: " << i->first <<
"IP address " << i->second.first);
i->second.second = 0;
m_expiredAddresses.push_front (i->first);
}
}
}
m_expiredEvent = Simulator::Schedule (Seconds (1), &DhcpServer::TimerHandler, this);
}
void DhcpServer::NetHandler (Ptr<Socket> socket)
{
NS_LOG_FUNCTION (this << socket);
DhcpHeader header;
Ptr<Packet> packet = 0;
Address from;
packet = m_socket->RecvFrom (from);
InetSocketAddress senderAddr = InetSocketAddress::ConvertFrom (from);
Ipv4PacketInfoTag interfaceInfo;
if (!packet->RemovePacketTag (interfaceInfo))
{
NS_ABORT_MSG ("No incoming interface on DHCP message, aborting.");
}
uint32_t incomingIf = interfaceInfo.GetRecvIf ();
Ptr<NetDevice> iDev = GetNode ()->GetDevice (incomingIf);
if (packet->RemoveHeader (header) == 0)
{
return;
}
if (header.GetType () == DhcpHeader::DHCPDISCOVER)
{
SendOffer (iDev, header, senderAddr);
}
if (header.GetType () == DhcpHeader::DHCPREQ && (header.GetReq ()).Get () >= m_minAddress.Get () && (header.GetReq ()).Get () <= m_maxAddress.Get ())
{
SendAck (iDev, header, senderAddr);
}
}
void DhcpServer::SendOffer (Ptr<NetDevice> iDev, DhcpHeader header, InetSocketAddress from)
{
NS_LOG_FUNCTION (this << iDev << header << from);
DhcpHeader newDhcpHeader;
Address sourceChaddr = header.GetChaddr ();
uint32_t tran = header.GetTran ();
Ptr<Packet> packet = 0;
Ipv4Address offeredAddress;
NS_LOG_INFO ("DHCP DISCOVER from: " << from.GetIpv4 () << " source port: " << from.GetPort ());
LeasedAddressIter iter = m_leasedAddresses.find (sourceChaddr);
if (iter != m_leasedAddresses.end ())
{
// We know this client from some time ago
if (m_leasedAddresses[sourceChaddr].second != 0 && m_leasedAddresses[sourceChaddr].second != 0xffffffff)
{
NS_LOG_LOGIC ("This client is sending a DISCOVER but it has still a lease active - perhaps it didn't shut down gracefully: " << sourceChaddr);
}
m_expiredAddresses.remove (sourceChaddr);
offeredAddress = m_leasedAddresses[sourceChaddr].first;
}
else
{
// No previous record of the client, we must find a suitable address and create a record.
if (!m_availableAddresses.empty ())
{
// use an address never used before (if there is one)
offeredAddress = m_availableAddresses.front ();
m_availableAddresses.pop_front ();
}
else
{
// there's still hope: reuse the old ones.
if (!m_expiredAddresses.empty ())
{
Address oldestChaddr = m_expiredAddresses.back ();
m_expiredAddresses.pop_back ();
offeredAddress = m_leasedAddresses[oldestChaddr].first;
m_leasedAddresses.erase (oldestChaddr);
}
}
}
if (offeredAddress != Ipv4Address ())
{
m_leasedAddresses[sourceChaddr] = std::make_pair (offeredAddress, m_lease.GetSeconds ());
packet = Create<Packet> ();
newDhcpHeader.ResetOpt ();
newDhcpHeader.SetType (DhcpHeader::DHCPOFFER);
newDhcpHeader.SetChaddr (sourceChaddr);
newDhcpHeader.SetYiaddr (offeredAddress);
Ptr<Ipv4> ipv4 = GetNode ()->GetObject<Ipv4> ();
Ipv4Address myAddress = ipv4->SelectSourceAddress (iDev, offeredAddress, Ipv4InterfaceAddress::InterfaceAddressScope_e::GLOBAL);
newDhcpHeader.SetDhcps (myAddress);
newDhcpHeader.SetMask (m_poolMask.Get ());
newDhcpHeader.SetTran (tran);
newDhcpHeader.SetLease (m_lease.GetSeconds ());
newDhcpHeader.SetRenew (m_renew.GetSeconds ());
newDhcpHeader.SetRebind (m_rebind.GetSeconds ());
newDhcpHeader.SetTime ();
if (m_gateway != Ipv4Address ())
{
newDhcpHeader.SetRouter (m_gateway);
}
packet->AddHeader (newDhcpHeader);
if ((m_socket->SendTo (packet, 0, InetSocketAddress (Ipv4Address ("255.255.255.255"), from.GetPort ()))) >= 0)
{
NS_LOG_INFO ("DHCP OFFER" << " Offered Address: " << offeredAddress);
}
else
{
NS_LOG_INFO ("Error while sending DHCP OFFER");
}
}
}
void DhcpServer::SendAck (Ptr<NetDevice> iDev, DhcpHeader header, InetSocketAddress from)
{
NS_LOG_FUNCTION (this << iDev << header << from);
DhcpHeader newDhcpHeader;
Address sourceChaddr = header.GetChaddr ();
uint32_t tran = header.GetTran ();
Ptr<Packet> packet = 0;
Ipv4Address address = header.GetReq ();
NS_LOG_INFO ("DHCP REQUEST from: " << from.GetIpv4 () <<
" source port: " << from.GetPort () <<
" - refreshed addr: " << address);
LeasedAddressIter iter;
iter = m_leasedAddresses.find (sourceChaddr);
if (iter != m_leasedAddresses.end ())
{
// update the lease time of this address - send ACK
(iter->second.second) += m_lease.GetSeconds ();
packet = Create<Packet> ();
newDhcpHeader.ResetOpt ();
newDhcpHeader.SetType (DhcpHeader::DHCPACK);
newDhcpHeader.SetChaddr (sourceChaddr);
newDhcpHeader.SetYiaddr (address);
newDhcpHeader.SetTran (tran);
newDhcpHeader.SetTime ();
packet->AddHeader (newDhcpHeader);
if (from.GetIpv4 () != address)
{
m_socket->SendTo (packet, 0, InetSocketAddress (Ipv4Address ("255.255.255.255"), from.GetPort ()));
}
else
{
m_socket->SendTo (packet, 0, from);
}
}
else
{
// Deleted or expired lease - send NACK
packet = Create<Packet> ();
newDhcpHeader.ResetOpt ();
newDhcpHeader.SetType (DhcpHeader::DHCPNACK);
newDhcpHeader.SetChaddr (sourceChaddr);
newDhcpHeader.SetYiaddr (address);
newDhcpHeader.SetTran (tran);
newDhcpHeader.SetTime ();
packet->AddHeader (newDhcpHeader);
if (from.GetIpv4 () != address)
{
m_socket->SendTo (packet, 0, InetSocketAddress (Ipv4Address ("255.255.255.255"), from.GetPort ()));
}
else
{
m_socket->SendTo (packet, 0, from);
}
NS_LOG_INFO ("IP addr does not exists or released!");
}
}
void DhcpServer::AddStaticDhcpEntry (Address chaddr, Ipv4Address addr)
{
NS_LOG_FUNCTION (this << chaddr << addr);
Address cleanedCaddr;
NS_ASSERT_MSG (addr.Get () >= m_minAddress.Get () && addr.Get () <= m_maxAddress.Get (),
"Required address is not in the pool " << addr << " is not in [" << m_minAddress << ", " << m_maxAddress << "]");
// We need to cleanup the type from the stored chaddr, or later we'll fail to compare it.
// Moreover, the length is always 16, because chaddr is 16 bytes.
uint8_t buffer[Address::MAX_SIZE];
std::memset (buffer, 0, Address::MAX_SIZE);
uint32_t len = chaddr.CopyTo (buffer);
NS_ASSERT_MSG (len <= 16, "DHCP server can not handle a chaddr larger than 16 bytes");
cleanedCaddr.CopyFrom (buffer, 16);
NS_ASSERT_MSG (m_leasedAddresses.find (cleanedCaddr) == m_leasedAddresses.end (),
"Client has already an active lease: " << m_leasedAddresses[cleanedCaddr].first);
AvailableAddress::iterator it = find (m_availableAddresses.begin (), m_availableAddresses.end (), addr);
NS_ASSERT_MSG (it == m_availableAddresses.end (),
"Required address is not available (perhaps it has been already assigned): " << addr);
m_availableAddresses.remove (addr);
m_leasedAddresses[cleanedCaddr] = std::make_pair (addr, 0xffffffff);
}
} // Namespace ns3
| [
"zhanglong3030@qq.com"
] | zhanglong3030@qq.com |
08bb9cac31dbab8425439dedd0e542ea83d7aeb3 | 5102892f18f44b02b340cea85f220982eea18435 | /NewFramework/BlastHornetWing.h | a293dbc841f2bfa8610e44cfcc1041302dc3cb48 | [
"MIT"
] | permissive | lhthang1998/Megaman_X3_DirectX | b87ee477ac596954122e1aa838e3aa6242127632 | 2c695fefad81c37a7872cc79c78d0de3ff6db9ca | refs/heads/master | 2021-10-10T11:07:38.695966 | 2019-01-10T03:38:01 | 2019-01-10T03:38:01 | 164,980,874 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 289 | h | #pragma once
#include "MObject.h"
#define ANIM_DELAY -1
#define OFFSET_X 8
#define OFFSET_Y -75
class BlastHornetWing : public MObject
{
MObject* blastHornet;
public:
BlastHornetWing();
BlastHornetWing(MObject* _blastHornet);
~BlastHornetWing();
void Update();
void Render();
}; | [
"lhthang.1998@gmail.com"
] | lhthang.1998@gmail.com |
f3ff0715a094758cbea97797da779bb401ea956f | 9f7cd9a6c339e1548c3cc5697939e8e0fbd95ef0 | /src/core/renderer/RenderSystem.cpp | e7a4f860fb456b85cf16a488d668c6125e2b713e | [] | no_license | NathanLewry255/Transport2D | 19ed94cd74cfd6811c6e8d20603810d2cba6bfd1 | 1dd94eaf89da6e86b01345f84001165d09edb253 | refs/heads/master | 2023-05-10T12:38:21.262371 | 2021-06-24T02:36:53 | 2021-06-24T02:36:53 | 379,780,916 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 11,715 | cpp | #include "RenderSystem.h"
#include <vector>
#include <fstream>
#include <algorithm>
#include "../objectsystem/ComponentScript.h"
#include "../objectsystem/Object.h"
#include "../console/Console.h"
#include "../Core.h"
#include "../objectsystem/RenderComponent.h"
#include "../physics/PhysicsSystem.h"
#include "../objectsystem/GroundBodyComponent.h"
using namespace core_renderer;
using namespace core_objectsystem;
using namespace core_physics;
RenderSystem* RenderSystem::s_instance = nullptr;
RenderSystem::RenderSystem() {
if (s_instance != nullptr) {
delete s_instance;
}
s_instance = this;
m_shouldRender = true;
Console::log("RenderSystem (" + Console::ptrToString(s_instance) + ") has been initialised");
}
void RenderSystem::start() {
// Create a Camera
int width, height;
glfwGetWindowSize(Core::getWindow(), &width, &height);
m_camera = new Camera(width, height);
m_camera->setZoomFactor(24);
m_showUI = false;
m_renderObjectOrigins = false;
Core::getInstance()->set60FpsLimitStatus(true);
std::fstream fileStream;
// Open the filestream and get the vertex source code from the file
fileStream.open("res/shaders/vertex_shader.vs");
std::string vSource = "";
char nextChar;
if (!fileStream.is_open()) {
Console::logError("Failed to open 'res/shaders/vertex_shader.vs'");
}
while (fileStream.get(nextChar)) {
vSource += nextChar;
}
fileStream.close();
// Open the filestream and get the fragment source code from the file
fileStream.open("res/shaders/fragment_shader.fs");
std::string fSource = "";
if (!fileStream.is_open()) {
Console::logError("Failed to open 'res/shaders/fragment_shader.fsn'");
}
while (fileStream.get(nextChar)) {
fSource += nextChar;
}
fileStream.close();
m_shaderProgramId = compileAndLinkShader(vSource.c_str(), fSource.c_str());
m_defaultTexture = Texture("res/textures/engine/default_texture.png");
Console::log("RenderSystem (" + Console::ptrToString(this) + ") has successfully started");
}
void RenderSystem::update(double delta) {
if (m_showUI) {
b2Vec2 screenSize = Camera::getInstance()->getScreenSize();
ImGui::SetNextWindowPos(ImVec2(screenSize.x - 205, 30), ImGuiCond_FirstUseEver);
ImGui::SetNextWindowSize(ImVec2(200, 300), ImGuiCond_FirstUseEver);
ImGui::Begin("Debug::Renderer");
std::string s = "";
s += "Frame Time: ";
s += std::to_string(delta);
s += "\nFPS: ";
int fps = 1000 / delta;
s += std::to_string(fps);
s += "\nItems Rendered: " + std::to_string(m_itemsRenderedLastFrame);
ImGui::Text(s.c_str());
ImGui::Checkbox("Render Components", &m_shouldRender);
ImGui::Checkbox("Render Origins", &m_renderObjectOrigins);
float tempZoom = Camera::getInstance()->getZoomFactor();
ImGui::SliderFloat("Camera Zoom", &tempZoom, 0.1, 100);
Camera::getInstance()->setZoomFactor(tempZoom);
bool tempFpsLimit = Core::getInstance()->get60FpsLimitStatus();
ImGui::Checkbox("Limit to 60fps", &tempFpsLimit);
Core::getInstance()->set60FpsLimitStatus(tempFpsLimit);
ImGui::End();
}
}
void RenderSystem::render(double delta) {
glEnable(GL_TEXTURE);
glEnable(GL_BLEND);
glEnable(GL_PROGRAM_POINT_SIZE);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnableClientState(GL_COLOR_ARRAY);
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_INDEX_ARRAY);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
if (m_shouldRender) {
renderComponents();
}
// We need to disable blend so that the box2d rendering shows up
glDisable(GL_BLEND);
renderObjectOrigins();
}
void RenderSystem::renderComponents() {
std::vector<Object*> objs = Object::getObjects();
std::vector<RenderComponent*> renderComponents;
// Loop through all Objects and get all the RenderComponents.
// Only add valid components that should be rendered (shouldRender() == true) to the vector
for (int i = 0; i < objs.size(); i++) {
RenderComponent* rc = (RenderComponent*)objs[i]->getComponentScript("RenderComponent");
if (rc != nullptr) {
if (rc->getShouldRender()) {
renderComponents.push_back(rc);
}
}
}
// Sort the vector so that Objects are rendered based on their m_renderPriority
std::sort(renderComponents.begin(), renderComponents.end(), [](RenderComponent* rhs, RenderComponent* lhs) { return rhs->getRenderPriority() < lhs->getRenderPriority(); });
int itemsRendered = 0;
for (int i = 0; i < renderComponents.size(); i++) {
b2Vec2 renderSize = renderComponents[i]->getSize();
float* renderColour = renderComponents[i]->getColour();
Texture tex = renderComponents[i]->getTexture();
float vertexData[32] = {
worldToScreenCoords(renderComponents[i]->getVertexWorldPosition(1)).x, worldToScreenCoords(renderComponents[i]->getVertexWorldPosition(1)).y, 1.0f, renderColour[0], renderColour[1], renderColour[2], 1.0f, 0.0f,
worldToScreenCoords(renderComponents[i]->getVertexWorldPosition(2)).x, worldToScreenCoords(renderComponents[i]->getVertexWorldPosition(2)).y, 1.0f, renderColour[0], renderColour[1], renderColour[2], 1.0f, 1.0f,
worldToScreenCoords(renderComponents[i]->getVertexWorldPosition(3)).x, worldToScreenCoords(renderComponents[i]->getVertexWorldPosition(3)).y, 1.0f, renderColour[0], renderColour[1], renderColour[2], 0.0f, 1.0f,
worldToScreenCoords(renderComponents[i]->getVertexWorldPosition(4)).x, worldToScreenCoords(renderComponents[i]->getVertexWorldPosition(4)).y, 1.0f, renderColour[0], renderColour[1], renderColour[2], 0.0f, 0.0f
};
int indiceData[6] = {
0, 1, 3,
1, 2, 3
};
GLuint vao, vbo, ebo;
glGenVertexArrays(1, &vao);
glGenBuffers(1, &vbo);
glGenBuffers(1, &ebo);
glBindVertexArray(vao);
// Bind the data to the vertex buffer
glBindBuffer(GL_ARRAY_BUFFER, vbo);
glBufferData(GL_ARRAY_BUFFER, sizeof(float) * 32, vertexData, GL_STATIC_DRAW);
// Bind the data to the element buffer
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, ebo);
glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(int) * 6, indiceData, GL_STATIC_DRAW);
// position attribute
glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 8 * sizeof(float), (void*)0);
glEnableVertexAttribArray(0);
// color attribute
glVertexAttribPointer(1, 3, GL_FLOAT, GL_FALSE, 8 * sizeof(float), (void*)(3 * sizeof(float)));
glEnableVertexAttribArray(1);
// texture coord attribute
glVertexAttribPointer(2, 2, GL_FLOAT, GL_FALSE, 8 * sizeof(float), (void*)(6 * sizeof(float)));
glEnableVertexAttribArray(2);
glActiveTexture(0);
glBindTexture(GL_TEXTURE_2D, tex.getId());
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER);
//glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, tex.getWidth(), tex.getHeight(), 0, GL_RGBA, GL_UNSIGNED_BYTE, tex.getData());
glUseProgram(m_shaderProgramId);
glUniform1i(glGetUniformLocation(m_shaderProgramId, "ourTexture"), 0);
glBindVertexArray(vao);
glDrawElements(GL_TRIANGLES, 6, GL_UNSIGNED_INT, 0);
glDeleteBuffers(1, &ebo);
glDeleteBuffers(1, &vbo);
glDeleteVertexArrays(1, &vao);
//delete[] vertexData;
//delete[] indiceData;
itemsRendered++;
}
m_itemsRenderedLastFrame = itemsRendered;
}
void RenderSystem::renderObjectOrigins() {
glPointSize(5);
if (m_renderObjectOrigins) {
glBegin(GL_POINTS);
std::vector<Object*> objects = Object::getObjects();
for (int i = 0; i < objects.size(); i++) {
glColor3b(0, 0, 0);
glVertex2f(worldToScreenCoords(objects[i]->getPosition()).x, worldToScreenCoords(objects[i]->getPosition()).y);
}
glEnd();
}
}
void RenderSystem::setUIStatus(bool v) {
m_showUI = v;
}
bool RenderSystem::getUIStatus() {
return m_showUI;
}
void RenderSystem::setOriginRenderStatus(bool v) {
m_renderObjectOrigins = v;
}
bool RenderSystem::getOriginRenderStatus() {
return m_renderObjectOrigins;
}
void RenderSystem::close() {
}
GLint RenderSystem::compileAndLinkShader(const char* vertSource, const char* fragSource) {
// Create and compile the vertex shader
GLuint vertShaderId = glCreateShader(GL_VERTEX_SHADER);
glShaderSource(vertShaderId, 1, &vertSource, nullptr);
glCompileShader(vertShaderId);
std::string vertResStr = getShaderInfoMsg(vertShaderId);
if (vertResStr != "") {
Console::logError("Failed to compile vertex shader");
Console::logError("Error: " + vertResStr);
} else {
Console::log("Successfully compiled vertex shader");
}
// Create and compile the fragment shader
GLuint fragShaderId = glCreateShader(GL_FRAGMENT_SHADER);
glShaderSource(fragShaderId, 1, &fragSource, nullptr);
glCompileShader(fragShaderId);
std::string fragResStr = getShaderInfoMsg(fragShaderId);
if (fragResStr != "") {
Console::logError("Failed to compile fragment shader");
Console::logError("Error: " + fragResStr);
} else {
Console::log("Successfully compiled fragment shader");
}
GLuint shaderProgram = glCreateProgram();
glAttachShader(shaderProgram, vertShaderId);
glAttachShader(shaderProgram, fragShaderId);
glLinkProgram(shaderProgram);
glValidateProgram(shaderProgram);
int result;
glGetProgramiv(shaderProgram, GL_LINK_STATUS, &result);
if (result == GL_FALSE) {
int length;
glGetProgramiv(shaderProgram, GL_INFO_LOG_LENGTH, &length);
char message[1024];
glGetProgramInfoLog(shaderProgram, length, &length, message);
Console::logError("Failed to link/validate shader program");
Console::logError("Error " + std::string(message));
glDeleteProgram(shaderProgram);
return 0;
} else {
Console::log("Successfully linked and validated shader program");
}
glDeleteShader(vertShaderId);
glDeleteShader(fragShaderId);
return shaderProgram;
}
std::string RenderSystem::getShaderInfoMsg(const GLuint shaderId) {
int result;
std::string returnStr;
glGetShaderiv(shaderId, GL_COMPILE_STATUS, &result);
if (result == GL_FALSE) {
int length;
glGetShaderiv(shaderId, GL_INFO_LOG_LENGTH, &length);
char message[1024] = "";
glGetShaderInfoLog(shaderId, length, &length, message);
returnStr = std::string(message);
} else {
returnStr = "";
}
return returnStr;
}
int RenderSystem::getRenderCountLastFrame() {
return m_itemsRenderedLastFrame;
}
void RenderSystem::setRenderStatus(bool val) {
m_shouldRender = val;
}
bool RenderSystem::getRenderStatus() {
return m_shouldRender;
}
b2Vec2 RenderSystem::worldToScreenCoords(b2Vec2 worldPos) {
b2Vec2 screenCoords = b2Vec2(0, 0);
b2Vec2 cameraPos = Camera::getInstance()->getPosition();
screenCoords.x = ((worldPos.x - cameraPos.x) / (Camera::getInstance()->getScreenSize().x / 2)) * Camera::getInstance()->getZoomFactor();
screenCoords.y = ((worldPos.y - cameraPos.y) / (Camera::getInstance()->getScreenSize().y / 2)) * Camera::getInstance()->getZoomFactor();
return screenCoords;
}
b2Vec2 RenderSystem::applyRotationScaleToPoint(b2Vec2 point, b2Vec2 origin, float rotationInRad, float scale) {
float x = origin.x + (point.x - origin.x) * (float)cos(rotationInRad) + (point.y - origin.y) * (float)sin(rotationInRad);
float y = origin.y - (point.x - origin.x) * (float)sin(rotationInRad) + (point.y - origin.y) * (float)cos(rotationInRad);
//return b2Vec2(x / (Camera::getInstance()->getDefaultDisplayAreaWidth() / 2.0), y / (Camera::getInstance()->getDefaultDisplayAreaHeight() / 2.0));
return b2Vec2(x * scale, y * scale);
}
RenderSystem* RenderSystem::getInstance() {
return s_instance;
}
Texture& RenderSystem::getDefaultTexture() {
return getInstance()->m_defaultTexture;
}
RenderSystem::~RenderSystem() {
glDeleteProgram(m_shaderProgramId);
} | [
"nathanlewry255@gmail.com"
] | nathanlewry255@gmail.com |
dad008a2e209d295bd612e27010bcd07939a93f9 | 3e40a7406df5888df064249eb2f903ad9d5ded53 | /PBR_Assignment/PBR_Assignment/SphereClass.h | 4da632af3b35cd55947337086abec67e0b862292 | [] | no_license | NPPprojects/PBR | 2862bf0a2f759aca63ad25c5788d33f7295e1d7a | d11ea0281318d0ba4bf821fe8eb2cabbc2ee3371 | refs/heads/master | 2020-09-10T09:12:32.900778 | 2020-01-10T11:20:31 | 2020-01-10T11:20:31 | 221,708,745 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,164 | h | #pragma once
#include "ObjectClass.h"
#include "stdafx.h"
#include "Shader.h"
#include "CameraObject.h"
class SphereClass
{
public:
SphereClass(std::shared_ptr <Shader> _objectShader, std::shared_ptr <CameraObject> _camera, int _screenWidth, int _ScreenHeight);
~SphereClass();
void initialiseSphere();
void initaliseTextureSphere();
void setScreenParameters(int _screenWidth, int _screenHeight);
void setPosition(glm::vec3 _position);
void setScale(glm::vec3 _scale);
void updateModelMatrix();
void setShader(std::shared_ptr<Shader> _objectShader);
void setCamera(std::shared_ptr<CameraObject> _camera);
void useSphere();
void useTextureSphere();
private:
unsigned int VBO, VAO, EBO; //Vertex Buffer Object, Vertex Array Object, Element Buffer Object
unsigned int indexCount;
glm::mat4 transform;
glm::mat4 model;
glm::mat4 view;
glm::mat4 projection;
glm::vec3 position;
glm::vec3 scale;
//Shader
std::shared_ptr <Shader> objectShader;
//Camera
std::shared_ptr <CameraObject> camera;
int screenWidth;
int screenHeight;
//Collumn Rows and spacing for multiple spheres
int nrRows;
int nrColumns;
float spacing;
};
| [
"s5064371@bournemouth.ac.uk"
] | s5064371@bournemouth.ac.uk |
30e1b02cb2fb7fd67018488396d9c898018b5669 | 3f75df57ae155e3eaada2885b12b78a63bbc43a1 | /source/Geometry/LDC/include/ClicYoke01.hh | 4583227820e9abf8ff1df7844d3af2b52f22f7b9 | [] | no_license | nkxuyin/mokka-cepc | 52bb13455b6fc5961de678ad7cb695f754e49a47 | 61ce9f792a4cb8883f0d1cd1391884444b372dc0 | refs/heads/master | 2021-01-20T10:42:00.982704 | 2015-02-11T12:59:43 | 2015-02-11T12:59:43 | 24,243,983 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 1,692 | hh | // *********************************************************
// * Mokka *
// * -- A Detailed Geant 4 Simulation for the ILC -- *
// * *
// * polywww.in2p3.fr/geant4/tesla/www/mokka/mokka.html *
// *********************************************************
//
// $Id: ClicYoke01.hh,v 1.1 2010/08/17 $
// $Name: mokka-07-05$
#ifndef ClicYoke01_hh
#define ClicYoke01_hh 1
#include "VSubDetectorDriver.hh"
class G4LogicalVolume;
class Database;
class G4VSolid;
class muonSD;
class HECSD;
class G4UserLimits;
class G4Polyhedra;
class G4Material;
class G4Box;
class ClicYoke01: public VSubDetectorDriver
{
public:
ClicYoke01(void): VSubDetectorDriver("ClicYoke01", "yoke") {}
~ClicYoke01(void) {}
G4bool ContextualConstruct(const CGAGeometryEnvironment &env, G4LogicalVolume *worldLog);
private:
G4LogicalVolume * BuildRPC1Box(G4Box* ChamberSolid,
muonSD* theSD,
G4int layer_id,
G4UserLimits* pULimits,
Database *db);
G4LogicalVolume * BuildRPC1ECShape(G4Polyhedra* ChamberSolid,
muonSD* theSD,
G4int layer_id,
G4UserLimits* pULimits,
Database *db,const CGAGeometryEnvironment &env);
G4LogicalVolume * BuildRPC1PlugShape(G4Polyhedra* ChamberSolid,
muonSD* theSD,
G4int layer_id,
G4UserLimits* pULimits,
Database *db,const CGAGeometryEnvironment &env);
G4double iron_thickness;
G4double layer_thickness;
G4int number_of_layers;
G4int symmetry;
G4double HCAL_R_max;
};
#endif
| [
"xuyin@nankai.edu.cn"
] | xuyin@nankai.edu.cn |
78083f7b1cdc30a3e700470969ad809f378dae2f | 0f7a4119185aff6f48907e8a5b2666d91a47c56b | /sstd_utility/windows_boost/boost/atomic.hpp | 6df760f255eacd8bac17fc6aef577bb5740fc99f | [] | no_license | jixhua/QQmlQuickBook | 6636c77e9553a86f09cd59a2e89a83eaa9f153b6 | 782799ec3426291be0b0a2e37dc3e209006f0415 | refs/heads/master | 2021-09-28T13:02:48.880908 | 2018-11-17T10:43:47 | 2018-11-17T10:43:47 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 403 | hpp | #ifndef BOOST_ATOMIC_HPP
#define BOOST_ATOMIC_HPP
// Copyright (c) 2011 Helge Bahmann
//
// 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)
// This header includes all Boost.Atomic public headers
#include <boost/atomic/atomic.hpp>
#ifdef BOOST_HAS_PRAGMA_ONCE
#pragma once
#endif
#endif
| [
"nanguazhude@vip.qq.com"
] | nanguazhude@vip.qq.com |
c6898f6cbf0c690664d0aae0ef859665be589c41 | ae02b8e0b31daf871f9ddab6fedc948c13b633ec | /code/cpp/quick_sort.cpp | 381c1d46784a3e0dbbd79bf01bda04198f27ea96 | [] | no_license | luiscarlossf/how-to-contribute | 35f0eaaafd5b3d27e09d26f80ac52b54656e46d4 | a87a186c6d5ff7ba65e174a5386f8f72343e79a2 | refs/heads/master | 2021-11-11T14:11:35.800391 | 2019-10-10T19:27:22 | 2019-10-10T19:27:22 | 151,171,578 | 3 | 41 | null | 2019-10-19T12:29:56 | 2018-10-01T22:55:52 | C++ | UTF-8 | C++ | false | false | 708 | cpp | #include <iostream>
#include <vector>
using namespace std;
int partition(vector <int> &arr, int l, int r)
{
int pivot = arr[r];
int i = (l - 1);
for (int j = l; j <= r; j++)
{
if (arr[j] <= pivot)
{
i++;
swap(arr[i], arr[j]);
}
}
return i;
}
void quick_sort(vector <int> &arr, int l, int r)
{
if (l < r)
{
int p = partition(arr, l, r);
quick_sort(arr, l, p - 1);
quick_sort(arr, p + 1, r);
}
}
int main()
{
cout << "Enter number of elements: ";
int n; cin >> n;
cout << "Array: ";
vector <int> arr(n);
for (int i = 0; i < n; i++)
cin >> arr[i];
quick_sort(arr, 0, n - 1);
cout << "Sorted: ";
for (auto u : arr)
cout << u << " ";
cout << "\n";
return 0;
} | [
"noreply@github.com"
] | noreply@github.com |
000f5ad38fe3cff5f8ffc90d8c8f37ad581966f1 | 9f36afb86babcbe860f104d79d1a5b6754cebd91 | /main.cpp | d3c32704dbcd10b95cef89869825e471bb4c2ced | [] | no_license | mfzhang/StructureFromMotion_OpenCV | 42dfc960cb2431d1b0813cfdf98fb5c1bc4a371e | eae027ec52476a4ef7042e32efca03c00a9e98b4 | refs/heads/master | 2021-06-06T08:17:32.786362 | 2014-03-28T16:54:57 | 2014-03-28T16:54:57 | null | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 8,014 | cpp | /**
* @file SURF_FlannMatcher
* @brief SURF detector + descriptor + FLANN Matcher
* @author A. Huaman
*/
#include <stdio.h>
#include <iostream>
#include "opencv2/core/core.hpp"
#include "opencv2/features2d/features2d.hpp"
#include "opencv2/highgui/highgui.hpp"
#include <opencv2/calib3d/calib3d.hpp>
#include "opencv2/nonfree/features2d.hpp"
#include <opencv2/core/core.hpp>
#include "FeatureMatching.h"
#include "CalculateCameraMatrix.h"
#include "Triangulation.h"
#include "Common.h"
#include "SaveXYZimages.h"
#include <stdlib.h>
//#include <windows.h>
#include <GL/glut.h>
#include <GL/gl.h>
#include <math.h>
using namespace std;
using namespace cv;
void readme();
float imgdata[2448][3264][3];
float texture[2448][3264][3];
int width=0, height=0, rx = 0, ry = 0;
int eyex = 30, eyez = 20, atx = 100, atz = 50;
int eyey = -15;
float scalar = 0.1; //scalar of converting pixel color to float coordinates
vector<CloudPoint> pointcloud;
float allx = 0.0;
float ally = 0.0;
float allz = 0.0;
void special(int key, int x, int y)
{
switch(key)
{
case GLUT_KEY_LEFT:
ry-=5;
glutPostRedisplay();
break;
case GLUT_KEY_RIGHT:
ry+=5;
glutPostRedisplay();
break;
case GLUT_KEY_UP:
rx+=5;
glutPostRedisplay();
break;
case GLUT_KEY_DOWN:
rx-=5;
glutPostRedisplay();
break;
}
}
//////////////////////////////////////////////////////////////////////////
void renderScene(void) {
glClear (GL_COLOR_BUFFER_BIT);
glLoadIdentity();// Reset the coordinate system before modifying
gluLookAt (eyex, eyey, eyez, allx, ally, allz, 0.0, 1.0, 0.0); //
glRotatef(ry, 0.0, 1.0, 0.0); //rotate about the z axis //
//glRotatef(ry, allx, ally, 0); //rotate about the z axis
//glRotatef(rx-180, 1.0, 0.0, 0.0); //rotate about the y axis
glRotatef(rx, 1.0, 0.0, 0.0); //rotate about the y axis
//glRotatef(rx, allx, ally, 0); //rotate about the y axis
float x,y,z;
glPointSize(1.0);
glBegin(GL_POINTS);//GL_POINTS
for(int i=0;i<pointcloud.size();i++)
{
glColor3f(255,255,255);
x = -(pointcloud[i].pt.x - allx)/scalar; //
y = -(pointcloud[i].pt.y - ally)/scalar;
z = (pointcloud[i].pt.z - allz)/scalar;
glVertex3f(x,y,z);
}
/*
for (int i=0;i<height;i++){
for (int j=0;j<width;j++){
glColor3f(texture[i][j][0]/255, texture[i][j][1]/255, texture[i][j][2]/255); //
x=-imgdata[i][j][0]/scalar; //
y=-imgdata[i][j][1]/scalar;
z=imgdata[i][j][2]/scalar;
glVertex3f(x,y,z);
}
}
*/
glEnd();
glFlush();
}
//////////////////////////////////////////////////////////////////////////
void reshape (int w, int h) {
glViewport (0, 0, (GLsizei)w, (GLsizei)h);
glMatrixMode (GL_PROJECTION);
glLoadIdentity ();
gluPerspective (60, (GLfloat)w / (GLfloat)h, 1.0, 5000.0); //
glMatrixMode (GL_MODELVIEW);
}
////Function Main
int main( int argc, char** argv )
{
// if( argc != 3 )
//{ readme(); return -1; }
//Mat img_1 = imread( argv[1], IMREAD_GRAYSCALE );
//Mat img_2 = imread( argv[2], IMREAD_GRAYSCALE );
string filename1 = "C:\\OpenCV_Project\\SFM_Exp\\Building5.JPG";
string filename2 = "C:\\OpenCV_Project\\SFM_Exp\\Building6.JPG";
Mat img_1 = imread(filename1);
Mat img_2 = imread(filename2);
std::vector<KeyPoint> keypoints_1, keypoints_2,keypts1_good,keypts2_good, corr;
std::vector< DMatch > matches;
width = img_1.cols;
height = img_1.rows;
if( !img_1.data || !img_2.data )
{ std::cout<< " --(!) Error reading images " << std::endl; return -1; } /// Read in Images
// Start Feature Matching
int Method = 1;
FeatureMatching(img_1,img_2,keypoints_1,keypoints_2,keypts1_good,keypts2_good,&matches,Method); // matched featurepoints
// Calculate Matrices
vector<Point2f> pts1,pts2;
vector<uchar> status;
vector<KeyPoint> imgpts1_tmp,imgpts1_good,imgpts2_good;
vector<KeyPoint> imgpts2_tmp;
GetAlignedPointsFromMatch(keypoints_1, keypoints_2, matches, imgpts1_tmp, imgpts2_tmp);
KeyPointsToPoints(imgpts1_tmp, pts1);
KeyPointsToPoints(imgpts2_tmp, pts2);
double minVal,maxVal;
cv::minMaxIdx(pts1,&minVal,&maxVal);
Mat F = findFundamentalMat(pts1, pts2, FM_RANSAC, 0.006*maxVal, 0.99, status);
double status_nz = countNonZero(status);
double status_sz = status.size();
double kept_ratio = status_nz / status_sz;
vector<DMatch> new_matches;
cout << "F keeping " << countNonZero(status) << " / " << status.size() << endl;
for (unsigned int i=0; i<status.size(); i++) {
if (status[i])
{
imgpts1_good.push_back(imgpts1_tmp[i]);
imgpts2_good.push_back(imgpts2_tmp[i]);
new_matches.push_back(matches[i]);
//good_matches_.push_back(DMatch(imgpts1_good.size()-1,imgpts1_good.size()-1,1.0));
}
}
cout << matches.size() << " matches before, " << new_matches.size() << " new matches after Fundamental Matrix\n";
matches = new_matches; //keep only those points who survived the fundamental matrix
Mat img_matches;
drawMatches( img_1, keypoints_1, img_2, keypoints_2,
matches, img_matches, Scalar::all(-1), Scalar::all(-1),
vector<char>(), DrawMatchesFlags::NOT_DRAW_SINGLE_POINTS );
//-- Show detected matches
imshow( "Feature Matches", img_matches );
waitKey(0);
destroyWindow("Feature Matches");
imwrite("C:\\OpenCV_Project\\SFM_Exp\\Image_Matches.jpg",img_matches);
/////////////////////
Mat K,Kinv,discoeff; // Read from calibration file
string filename = "C:\\OpenCV_Project\\camera_calibration\\result.xml";
FileStorage fs(filename, FileStorage::READ);
FileNode n = fs.getFirstTopLevelNode();
fs["Camera_Matrix"] >> K;
fs["Distortion_Coefficients"] >> discoeff;
cout << "K " << endl << Mat(K) << endl;
Kinv = K.inv();
Matx34d P, P1;
bool CM = FindCameraMatrices(K,Kinv,F,P,P1,discoeff,imgpts1_tmp,imgpts2_tmp,imgpts1_good,imgpts2_good,matches,pointcloud);
// Reconstruct 3D
//double mse = TriangulatePoints(keypts1_good,keypts2_good,K,Kinv,P,P1,pointcloud,keypts1_good,discoeff);
// Write points to file
Mat X(img_1.rows,img_1.cols,CV_32FC1);
Mat Y(img_1.rows,img_1.cols,CV_32FC1);
Mat Z(img_1.rows,img_1.cols,CV_32FC1);
string filepath = "C:\\OpenCV_Project\\SFM_Exp\\";
saveXYZimages(img_1,pointcloud,imgpts1_good,filepath,X,Y,Z);
double Nindex = X.rows * X.cols;
for(int i=0;i<pointcloud.size();i++ )
{
allx += pointcloud[i].pt.x;
ally += pointcloud[i].pt.y;
allz += pointcloud[i].pt.z;
}
allx = 1.0 * allx/(float)pointcloud.size();
ally = 1.0 * ally/(float)pointcloud.size();
allz = 1.0 * allz/(float)pointcloud.size();
/*
for(int i=0;i<X.rows;i++)
{
for(int j=0;j<X.cols;j++)
{
float* Xr =X.ptr<float>(i);
imgdata[i][j][0] = Xr[j];
float* TXr = img_1.ptr<float>(i);
texture[i][j][0] = TXr[j];
}
}
for(int i=0;i<Y.rows;i++)
{
for(int j=0;j<Y.cols;j++)
{
float* Yr =Y.ptr<float>(i);
imgdata[i][j][1] = Yr[j];
float* TYr = img_1.ptr<float>(i);
texture[i][j][1] = TYr[j];
}
}
for(int i=0;i<Z.rows;i++)
{
for(int j=0;j<Z.cols;j++)
{
float* Zr =Z.ptr<float>(i);
imgdata[i][j][2] = Zr[j];
float* TZr = img_1.ptr<float>(i);
texture[i][j][2] = TZr[j];
}
}
*/
//////// OpenGL Draw
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DEPTH | GLUT_SINGLE | GLUT_RGBA);
glutInitWindowPosition(100,100);
glutInitWindowSize(1024,768);
glutCreateWindow("3D Reconstruct Model");
glutReshapeFunc (reshape); // 窗口变化时重构图像
glutDisplayFunc(renderScene); // 显示三维图像
glutSpecialFunc(special); // 响应方向键按键消息
glutPostRedisplay();
glutMainLoop();
//cvWaitKey(0);
return 0;
}
/**
* @function readme
*/
void readme()
{ std::cout << " Usage: ./SURF_FlannMatcher <img1> <img2>" << std::endl; } | [
"wmh199014@gmail.com"
] | wmh199014@gmail.com |
243950b39b8cd37dba4f9982257508b2dc2068ec | c9c039bf8227952568f6b3ab534439db61658229 | /include/osf/tmp/algorithm/sort.hpp | 1b74b46d17cdfc824caeb84ba0efcc9d51b8464c | [
"MIT",
"LicenseRef-scancode-generic-cla",
"LicenseRef-scancode-unknown"
] | permissive | skunkforce/tmp | 9c82854dcc1b0e749a909ee3f76e073c4d813012 | 0296f33d0e67006dd7b266a6dbde96d6201d752b | refs/heads/master | 2021-05-20T11:10:07.356958 | 2020-04-08T22:18:19 | 2020-04-11T17:30:51 | 252,267,924 | 0 | 0 | MIT | 2020-04-06T21:08:13 | 2020-04-01T19:27:38 | C++ | UTF-8 | C++ | false | false | 8,147 | hpp | #ifndef OSF_TMP_SORT_HPP_INCLUDED
#define OSF_TMP_SORT_HPP_INCLUDED
#include "../comparison.hpp"
#include "../detail/capabilities.hpp"
#include "../sequence/push_front.hpp"
#include "../sequence/take.hpp"
#include "../vocabulary.hpp"
namespace osf {
namespace tmp {
template <typename F = less_<>, typename C = listify_>
struct sort_ {};
namespace detail {
namespace btree {
template <typename... Ts>
struct blist {};
template <typename L, typename E, typename R>
struct bnode {};
template <typename T>
struct bun;
template <bool, template <typename...> class F>
struct bpush;
template <template <typename...> class F>
struct bpush<false, F> {
template <typename T, typename L, typename E, typename R>
using n = bnode<L, E, typename bun<R>::template f<F, T>>;
template <typename T, typename LL, typename LE, typename LR, typename E,
typename RL, typename RE, typename RR>
using nn = typename bpush<F<T, RE>::value, F>::template nn_0<T, LL, LE, LR, E,
RL, RE, RR>;
template <typename T, typename LL, typename LE, typename LR, typename E,
typename RL, typename RE, typename RR>
using nn_0 = bnode<bnode<bnode<LL, LE, LR>, E, RL>, RE,
typename bun<RR>::template f<F, T>>;
template <typename T, typename LL, typename LE, typename LR, typename E,
typename RL, typename RE, typename RR>
using nn_1 = bnode<bnode<LL, LE, typename bun<LR>::template f<F, T>>, E,
bnode<RL, RE, RR>>;
template <typename T, typename E>
using l1 = blist<E, T>;
template <typename T, typename E0, typename E1>
using l2_0 = typename bpush<F<T, E1>::value, F>::template l2_1<T, E0, E1>;
template <typename T, typename E0, typename E1>
using l2_1 = bnode<blist<E0>, E1, blist<T>>;
};
template <template <typename...> class F>
struct bpush<true, F> {
template <typename T, typename L, typename E, typename R>
using n = bnode<typename bun<L>::template f<F, T>, E, R>;
template <typename T, typename LL, typename LE, typename LR, typename E,
typename RL, typename RE, typename RR>
using nn = typename bpush<F<T, LE>::value, F>::template nn_1<T, LL, LE, LR, E,
RL, RE, RR>;
template <typename T, typename LL, typename LE, typename LR, typename E,
typename RL, typename RE, typename RR>
using nn_0 = bnode<bnode<LL, LE, LR>, E,
bnode<typename bun<RL>::template f<F, T>, RE, RR>>;
template <typename T, typename LL, typename LE, typename LR, typename E,
typename RL, typename RE, typename RR>
using nn_1 = bnode<typename bun<LL>::template f<F, T>, LE,
bnode<LR, E, bnode<RL, RE, RR>>>;
template <typename T, typename E>
using l1 = blist<T, E>;
template <typename T, typename E0, typename E1>
using l2_0 = bnode<blist<T>, E0, blist<E1>>;
template <typename T, typename E0, typename E1>
using l2_1 = bnode<blist<E0>, T, blist<E1>>;
};
template <>
struct bun<blist<>> {
template <template <typename...> class F, typename T>
using f = blist<T>;
};
template <typename E>
struct bun<blist<E>> {
template <template <typename...> class F, typename T>
using f = typename bpush<F<T, E>::value, F>::template l1<T, E>;
};
template <typename E0, typename E1>
struct bun<blist<E0, E1>> {
template <template <typename...> class F, typename T>
using f = typename bpush<F<T, E0>::value, F>::template l2_0<T, E0, E1>;
};
template <typename L, typename E, typename R>
struct bun<bnode<L, E, R>> {
template <template <typename...> class F, typename T>
using f = typename bpush<F<T, E>::value, F>::template n<T, L, E, R>;
};
template <typename LL, typename LE, typename LR, typename E, typename RL,
typename RE, typename RR>
struct bun<bnode<bnode<LL, LE, LR>, E, bnode<RL, RE, RR>>> {
template <template <typename...> class F, typename T>
using f = typename bpush<F<T, E>::value, F>::template nn<T, LL, LE, LR, E, RL,
RE, RR>;
};
template <typename LLL, typename LLE, typename LLR, typename LE, typename LR,
typename E, typename... Ts>
struct bun<bnode<bnode<bnode<LLL, LLE, LLR>, LE, LR>, E, blist<Ts...>>> {
template <template <typename...> class F, typename T>
using f = typename bpush<F<T, LE>::value, F>::template nn<T, LLL, LLE, LLR, LE,
LR, E, blist<Ts...>>;
};
template <typename... Ts, typename E, typename RL, typename RE, typename RRL,
typename RRE, typename RRR>
struct bun<bnode<blist<Ts...>, E, bnode<RL, RE, bnode<RRL, RRE, RRR>>>> {
template <template <typename...> class F, typename T>
using f =
typename bpush<F<T, RE>::value, F>::template nn<T, blist<Ts...>, E, RL,
RE, RRL, RRE, RRR>;
};
template <typename LL, typename LE, typename LR, typename E, typename RL,
typename RE, typename RR>
struct join7;
template <typename... LL, typename LE, typename... LR, typename E, typename... RL,
typename RE, typename... RR>
struct join7<blist<LL...>, LE, blist<LR...>, E, blist<RL...>, RE, blist<RR...>> {
using type = blist<LL..., LE, LR..., E, RL..., RE, RR...>;
};
template <typename T>
struct bflat;
template <typename L, typename E, typename R>
struct bflat<bnode<L, E, R>> {
using type = typename bflat<
bnode<typename bflat<L>::type, E, typename bflat<R>::type>>::type;
};
template <typename LL, typename LE, typename LR, typename E, typename RL,
typename RE, typename RR>
struct bflat<bnode<bnode<LL, LE, LR>, E, bnode<RL, RE, RR>>> {
using type =
typename join7<typename bflat<LL>::type, LE, typename bflat<LR>::type,
E, typename bflat<RL>::type, RE,
typename bflat<RR>::type>::type;
};
template <typename... L, typename E, typename... R>
struct bflat<bnode<blist<L...>, E, blist<R...>>> {
using type = blist<L..., E, R...>;
};
template <typename... T>
struct bflat<blist<T...>> {
using type = blist<T...>;
};
template <typename T>
using collapse_t = typename btree::bflat<T>::type;
} // namespace btree
template <typename F>
struct element_pusher {};
template <typename F>
struct dispatch<2, element_pusher<F>> {
template <typename T, typename U>
using f = typename btree::bun<T>::template f<dispatch<2, F>::template f, U>;
};
template <template <typename...> class F>
struct dispatch<2, element_pusher<lift_<F>>> {
template <typename T, typename U>
using f = typename btree::bun<T>::template f<F, U>;
};
template <template <typename...> class F>
struct pusher {
template <typename T, typename U>
using f = typename btree::bun<T>::template f<F, U>;
};
template <template <typename...> class F, typename C = identity_,
typename Initial = btree::blist<>>
using make_binary_tree =
push_front_<Initial, fold_left_<lift_<pusher<F>::template f>, C>>;
template <typename C>
using collapse_unpack = lift_<btree::collapse_t, unpack_<C>>;
template <unsigned N, template <typename...> class F, typename C>
struct dispatch<N, sort_<lift_<F>, C>>
: dispatch<N, make_binary_tree<F, collapse_unpack<C>, btree::blist<>>> {};
template <unsigned N, typename F, typename C>
struct dispatch<N, sort_<F, C>>
: dispatch<N, make_binary_tree<dispatch<2, F>::template f, collapse_unpack<C>,
btree::blist<>>> {};
} // namespace detail
} // namespace tmp
} // namespace osf
#endif | [
"odinthenerd@gmail.com"
] | odinthenerd@gmail.com |
a2ede71f4b0ec8e0b362e92804342ec8b349e6df | 0570750c6d8e28d837f9e4f7dc825c968c874fb4 | /build/Android/Preview/app/src/main/include/Uno.Platform.Display.h | 9d81366d48e405f45afebc0e0dce4a124710f0ca | [] | no_license | theaustinthompson/maryjane | b3671d950aad58fd2ed490bda8aa1113aedf5a97 | b4ddf76aa2a2caae77765435d0315cf9111d6626 | refs/heads/master | 2021-04-12T08:37:47.311922 | 2018-03-27T23:06:47 | 2018-03-27T23:06:47 | 126,034,050 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,402 | h | // This file was generated based on C:/Users/borde_000/AppData/Local/Fusetools/Packages/UnoCore/1.8.0/Source/Uno/Platform/Displays.uno.
// WARNING: Changes might be lost if you edit this file directly.
#pragma once
#include <Uno.Object.h>
namespace g{namespace Uno{namespace Platform{struct Display;}}}
namespace g{namespace Uno{namespace Platform{struct TimerEventArgs;}}}
namespace g{
namespace Uno{
namespace Platform{
// public abstract class Display :54
// {
struct Display_type : uType
{
void(*fp_DisableTicks)(::g::Uno::Platform::Display*);
void(*fp_EnableTicks)(::g::Uno::Platform::Display*);
void(*fp_GetDensity)(::g::Uno::Platform::Display*, float*);
};
Display_type* Display_typeof();
void Display__ctor__fn(Display* __this);
void Display__add__tick_fn(Display* __this, uDelegate* value);
void Display__remove__tick_fn(Display* __this, uDelegate* value);
void Display__get_Density_fn(Display* __this, float* __retval);
void Display__DisableTicks_fn(Display* __this);
void Display__EnableTicks_fn(Display* __this);
void Display__OnTick_fn(Display* __this, ::g::Uno::Platform::TimerEventArgs* args);
void Display__SetTicksPerSecond_fn(Display* __this, uint32_t* value);
void Display__add_Tick_fn(Display* __this, uDelegate* value);
void Display__remove_Tick_fn(Display* __this, uDelegate* value);
void Display__get_TicksPerSecond_fn(Display* __this, uint32_t* __retval);
void Display__set_TicksPerSecond_fn(Display* __this, uint32_t* value);
struct Display : uObject
{
uint32_t _ticksPerSecond;
uStrong<uDelegate*> _tick1;
void ctor_();
void add__tick(uDelegate* value);
void remove__tick(uDelegate* value);
float Density();
void DisableTicks() { (((Display_type*)__type)->fp_DisableTicks)(this); }
void EnableTicks() { (((Display_type*)__type)->fp_EnableTicks)(this); }
float GetDensity() { float __retval; return (((Display_type*)__type)->fp_GetDensity)(this, &__retval), __retval; }
void OnTick(::g::Uno::Platform::TimerEventArgs* args);
void SetTicksPerSecond(uint32_t value);
void add_Tick(uDelegate* value);
void remove_Tick(uDelegate* value);
uint32_t TicksPerSecond();
void TicksPerSecond(uint32_t value);
static void DisableTicks(Display* __this) { Display__DisableTicks_fn(__this); }
static void EnableTicks(Display* __this) { Display__EnableTicks_fn(__this); }
};
// }
}}} // ::g::Uno::Platform
| [
"austin@believeinthompson.com"
] | austin@believeinthompson.com |
70e4c4a87854d21ab34ec3d07574affe5f9846b4 | 550c48e2af790d9eb17fb79e86864fde93b2909c | /utils/display/gl-display-test/gl-display-test.cpp | f4676ebdee1a25acc08a123431020b20ed169b0b | [] | no_license | FanSun126/ONNX-TensorRT-LibTorch | 0d49717f9d12ab1018fa70855ac54525e77ed86c | 9b8086e908a60ec2ccea70752a654e4811f722ab | refs/heads/main | 2023-09-05T06:41:32.136923 | 2021-11-17T09:10:30 | 2021-11-17T09:10:30 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 6,033 | cpp | /*
* Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved.
*
* 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 "glDisplay.h"
#include "glTexture.h"
#include "glBuffer.h"
#include "glCamera.h"
#include "cudaFont.h"
#include "cudaNormalize.h"
#include "cudaInteropKernels.h"
#include "timespec.h"
#include <stdio.h>
#include <signal.h>
#include <unistd.h>
#define TEXTURE_WIDTH 768
#define TEXTURE_HEIGHT 64
#define TEXTURE_OFFSET 30
#define GRID_N 128
#define GRID_POINTS (GRID_N * GRID_N)
#define GRID_WORLD_SIZE 10.0f
bool signal_recieved = false;
void sig_handler(int signo)
{
if( signo == SIGINT )
{
printf("received SIGINT\n");
signal_recieved = true;
}
}
int main( int argc, char** argv )
{
/*
* register signal handler (Ctrl+C)
*/
if( signal(SIGINT, sig_handler) == SIG_ERR )
printf("can't catch SIGINT\n");
/*
* create openGL window
*/
glDisplay* display = glDisplay::Create("NVIDIA OpenGL/CUDA Interoperability Test");
if( !display )
{
printf("gl-display-test: failed to create openGL display\n");
return 0;
}
/*
* allocate openGL texture
*/
glTexture* texture = glTexture::Create(TEXTURE_WIDTH, TEXTURE_HEIGHT, GL_RGBA32F, NULL);
if( !texture )
{
printf("gl-display-test: failed to create openGL texture\n");
return 0;
}
/*
* create font
*/
cudaFont* font = cudaFont::Create();
if( !font )
{
printf("gl-display-test: failed to create cudaFont object\n");
return 0;
}
/*
* create 3D camera
*/
glCamera* camera = glCamera::Create(glCamera::LookAt);
if( !camera )
{
printf("gl-display-test: failed to create glCamera object\n");
return 0;
}
camera->SetEye(0.0f, GRID_WORLD_SIZE, GRID_WORLD_SIZE);
camera->StoreDefaults();
/*
* create vertex buffer
*/
glBuffer* buffer = glBuffer::Create(GL_VERTEX_BUFFER, GRID_POINTS * sizeof(PointVertex), NULL, GL_DYNAMIC_DRAW);
if( !buffer )
{
printf("gl-display-test: failed to create glBuffer object\n");
return 0;
}
/*
* rendering loop
*/
while( !signal_recieved && display->IsOpen() )
{
display->BeginRender();
display->RenderRect( 10, 100, 200, 100, 0.9f, 0.0f, 0.2f);
display->RenderRect(210, 100, 200, 100, 0.0f, 0.9f, 0.4f);
display->RenderRect(410, 100, 200, 100, 0.0f, 0.4f, 0.9f);
// draw point buffer
PointVertex* points = (PointVertex*)buffer->Map(GL_MAP_CUDA, GL_WRITE_DISCARD);
if( points != NULL )
{
// animate the points in CUDA
CUDA(cudaGeneratePointGrid(points, GRID_N, GRID_WORLD_SIZE, apptime()));
CUDA(cudaDeviceSynchronize());
buffer->Unmap();
// change the viewport
display->SetViewport(display->GetWidth() / 2, display->GetHeight() / 2,
display->GetWidth(), display->GetHeight());
display->RenderRect(0.15f, 0.15f, 0.15f);
// enable the camera and buffer
camera->Activate();
buffer->Bind();
GL(glEnableClientState(GL_VERTEX_ARRAY));
GL(glVertexPointer(3, GL_FLOAT, sizeof(PointVertex), 0));
GL(glEnableClientState(GL_COLOR_ARRAY));
GL(glColorPointer(4, GL_UNSIGNED_BYTE, sizeof(PointVertex), (void*)offsetof(PointVertex, color)));
// draw the points
GL(glDrawArrays(GL_POINTS, 0, GRID_POINTS));
// disable the buffer and camera
GL(glDisableClientState(GL_COLOR_ARRAY));
GL(glDisableClientState(GL_VERTEX_ARRAY));
buffer->Unbind();
camera->Deactivate();
display->ResetViewport();
}
// draw test texture
if( texture != NULL && font != NULL )
{
void* textureCUDA = texture->Map(GL_MAP_CUDA, GL_WRITE_DISCARD);
if( textureCUDA != NULL )
{
// clear the texture (from last frame)
//CUDA(cudaMemset(textureCUDA, 0, texture->GetSize()));
// test text
char str[256];
sprintf(str, "AaBbCcDdEeFfGgHhIiJjKkLlMmNn123456890");
font->OverlayText((float4*)textureCUDA, texture->GetWidth(), texture->GetHeight(),
str, 0, 0, make_float4(0.0f, 190.0f, 255.0f, 255.0f));
// FPS counter
sprintf(str, "%.0f FPS", display->GetFPS());
font->OverlayText((float4*)textureCUDA, texture->GetWidth(), texture->GetHeight(),
str, 0, 36, make_float4(255.0f, 190.0f, 0.0f, 255.0f));
// rescale image pixel intensities for display
CUDA(cudaNormalize((float4*)textureCUDA, make_float2(0.0f, 255.0f),
(float4*)textureCUDA, make_float2(0.0f, 1.0f),
texture->GetWidth(), texture->GetHeight()));
texture->Unmap();
}
texture->Render(TEXTURE_OFFSET, TEXTURE_OFFSET);
}
display->EndRender();
}
/*
* close the window
*/
if( display != NULL )
{
delete display;
display = NULL;
}
printf("gl-display-test: OpenGL display has been un-initialized.\n");
printf("gl-display-test: this concludes the test of the device.\n");
return 0;
}
| [
"wangjichen2012@163.com"
] | wangjichen2012@163.com |
cf6363aed8f36a64bfd88872e4ca1234d59f2f59 | 0eff74b05b60098333ad66cf801bdd93becc9ea4 | /second/download/httpd/gumtree/httpd_old_hunk_2850.cpp | 96abaee354fde5356298c00d1bfd700d096532e2 | [] | no_license | niuxu18/logTracker-old | 97543445ea7e414ed40bdc681239365d33418975 | f2b060f13a0295387fe02187543db124916eb446 | refs/heads/master | 2021-09-13T21:39:37.686481 | 2017-12-11T03:36:34 | 2017-12-11T03:36:34 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 547 | cpp | really an href */
}
if (!strcasecmp(menu, "formatted")) {
ap_rvputs(r, "<pre> <a href=\"", href, "\">", text,
"</a></pre>\n", NULL);
}
if (!strcasecmp(menu, "semiformatted")) {
ap_rvputs(r, "<pre> <a href=\"", href, "\">", text,
"</a></pre>\n", NULL);
}
if (!strcasecmp(menu, "unformatted")) {
ap_rvputs(r, "<a href=\"", href, "\">", text, "</a>", NULL);
}
return;
}
static void menu_footer(request_rec *r)
| [
"993273596@qq.com"
] | 993273596@qq.com |
3a65145382581b62fcee8bef6cc8a29a5d1858fa | 32968426530e3faa42a9df31c17ab1cfa443d133 | /c++/4.24.cpp | 902b0b5c0d6dc7edcfbdb4e059ecdad091d8e140 | [] | no_license | orochina/github | 47875209207b79ce7e5d222ad43605f00495cdcb | 86778fc5a25ee54679ebc56551944985f6b53d04 | refs/heads/master | 2020-07-17T13:24:38.240108 | 2019-12-03T02:32:35 | 2019-12-03T02:32:35 | 206,027,721 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,107 | cpp | // choices.cpp -- array variations
#include <iostream>
#include <vector> // STL C+98
#include <array> // C++11
int main()
{
using namespace std;
// C, original C++
double a1[4] ={1.2, 2.4, 3.6, 4.8};
// C++98 STL
vector<double> a2(4); // create vector with 4 elements
// no simple way to initialize in C98
a2[0] = 1.0/3.0;
a2[1] = 1.0/5.0;
a2[2] = 1.0/7.0;
a2[3] = 1.9/9.0;
// C+11 -- create and initialize array object
array<double,4> a3 = {3.14, 2.72, 1.62, 1.41};
array<double,4> a4 ;
a4 = a3 ; // valid for array objects of sanme size
// use array notation
cout << "a1[2]: " << a1[2] << " at " << &a1[2] << endl;
cout << "a2[2]: " << a2[2] << " at " << &a2[2] << endl;
cout << "a3[2]: " << a3[2] << " at " << &a3[2] << endl;
cout << "a4[2]: " << a4[2] << " at " << &a4[2] << endl;
// misdeed
a1[-2] = 20.2 ;
cout << "a1[-2]: " << a1[-2] << " at " << &a1[-2] << endl;
cout << "a3[2]: " << a3[2] << " at " << &a3[2] << endl;
cout << "a4[2]: " << a4[2] << " at " << &a4[2] << endl;
return 0;
}
| [
"nking07@163.com"
] | nking07@163.com |
99faa0d27632c9e8e5613cd2ef720d312058104a | a99c58e14ea782e99672d780d27676f07fd4d635 | /13.roman-to-integer.cpp | a4c18f8641db767906c234b8d640cbb09eb783b9 | [] | no_license | XZeusJ/Leetcode | ba73b87fef1f97c52ae0b731db3ca20b5d3469a1 | 2a61cba4c817c0179f991e02baaa3cdcce6c1030 | refs/heads/master | 2020-08-06T21:41:10.440208 | 2020-06-17T01:34:59 | 2020-06-17T01:34:59 | 213,166,098 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,493 | cpp | /*
* @lc app=leetcode id=13 lang=cpp
*
* [13] Roman to Integer
*
* https://leetcode.com/problems/roman-to-integer/description/
*
* algorithms
* Easy (53.42%)
* Likes: 1528
* Dislikes: 2965
* Total Accepted: 517.4K
* Total Submissions: 964.8K
* Testcase Example: '"III"'
*
* Roman numerals are represented by seven different symbols: I, V, X, L, C, D
* and M.
*
*
* Symbol Value
* I 1
* V 5
* X 10
* L 50
* C 100
* D 500
* M 1000
*
* For example, two is written as II in Roman numeral, just two one's added
* together. Twelve is written as, XII, which is simply X + II. The number
* twenty seven is written as XXVII, which is XX + V + II.
*
* Roman numerals are usually written largest to smallest from left to right.
* However, the numeral for four is not IIII. Instead, the number four is
* written as IV. Because the one is before the five we subtract it making
* four. The same principle applies to the number nine, which is written as IX.
* There are six instances where subtraction is used:
*
*
* I can be placed before V (5) and X (10) to make 4 and 9.
* X can be placed before L (50) and C (100) to make 40 and 90.
* C can be placed before D (500) and M (1000) to make 400 and 900.
*
*
* Given a roman numeral, convert it to an integer. Input is guaranteed to be
* within the range from 1 to 3999.
*
* Example 1:
*
*
* Input: "III"
* Output: 3
*
* Example 2:
*
*
* Input: "IV"
* Output: 4
*
* Example 3:
*
*
* Input: "IX"
* Output: 9
*
* Example 4:
*
*
* Input: "LVIII"
* Output: 58
* Explanation: L = 50, V= 5, III = 3.
*
*
* Example 5:
*
*
* Input: "MCMXCIV"
* Output: 1994
* Explanation: M = 1000, CM = 900, XC = 90 and IV = 4.
*
*/
// @lc code=start
class Solution {
public:
int romanToInt(string s) {
int res = 0;
unordered_map<char, int> m{{'I', 1}, {'V', 5}, {'X', 10}, {'L', 50}, {'C', 100}, {'D', 500}, {'M', 1000}};
for (int i = 0; i < s.size(); i++) {
int val = m[s[i]];
// consider two case:
// 1. if current num is the last one, or bigger than later one -> add
// 2. other case, substract
if (i == s.size() - 1 || m[s[i + 1]] <= m[s[i]])
res += val;
else
res -= val;
}
return res;
}
};
// @lc code=end
| [
"394386241@qq.com"
] | 394386241@qq.com |
c73ee2246ffffc767f7cd885a6ee67b2b5b0aa9d | 66deb611781cae17567efc4fd3717426d7df5e85 | /pcmanager/src/publish/safemon/safemonitor.h | 9dced6838d6a252da77def2655e381a4228968a7 | [
"Apache-2.0"
] | permissive | heguoxing98/knoss-pcmanager | 4671548e14b8b080f2d3a9f678327b06bf9660c9 | 283ca2e3b671caa85590b0f80da2440a3fab7205 | refs/heads/master | 2023-03-19T02:11:01.833194 | 2020-01-03T01:45:24 | 2020-01-03T01:45:24 | 504,422,245 | 1 | 0 | null | 2022-06-17T06:40:03 | 2022-06-17T06:40:02 | null | GB18030 | C++ | false | false | 6,681 | h | /*
dummyz@126.com
2009/12/10
*/
#ifndef _SAFE_MONITOR_INC_
#define _SAFE_MONITOR_INC_ // 其他地方使用,不能使用#pragma once
/*
1、危险注册表操作行为监控
2、危险进程创建监控
3、溢出行为监控
*/
#include <assert.h>
////////////////////////////////////////////////////////////////////////////////////////////////
// const value defined
////////////////////////////////////////////////////////////////////////////////////////////////
#define BKSAFE_MONITOR_NUMBER 4 // 基础防护4 个
// 监控器标识
#define SM_ID_INVAILD 0
#define SM_ID_PROCESS 1 // 进程监控
#define SM_ID_RISK 2 // 风险操作监控
#define SM_ID_UDISK 4 // u盘自动运行拦截
#define SM_ID_VIRUS 5
#define SM_ID_LEAK 6 // 漏洞防护
#define SM_ID_RESCAN SM_ID_VIRUS // 回扫
#define SM_ID_KWS 11 //网盾浏览器保护
#define SM_ID_KWS_SAFE_DOWN 12 //下载保护泡泡
#define SM_ID_KWS_URL_MON 13 // url 防火墙
#define SM_ID_REPORT 14 // 异步数据提交
#define SM_ID_ARP 15
// 监控器运行状态
#define SM_STATUS_INVALID 0
#define SM_STATUS_RUN 1
#define SM_STATUS_STOP 2
#define SM_STATUS_PAUSE 3
// 监视器支持的控制
#define SM_CTRL_TRUST 0x0001 // 信任
#define SM_CTRL_BLOCK 0x0002 // 阻止
#define SM_CTRL_CLEAN 0x0004 // 阻止的同时执行清除操作
#define SM_CTRL_REMEMBER 0x00010000 // 记住操作,不在提示
#define SM_CTRL_HISTROY 0x00020000 // 操作来自历史
#define SM_CTRL_FAST_SCAN 0x00040000 // 同时执行了快速扫描
#define IS_SM_CTRL_TRUST(x) (((x) & SM_CTRL_TRUST) == SM_CTRL_TRUST)
#define IS_SM_CTRL_BLOCK(x) (((x) & SM_CTRL_BLOCK) == SM_CTRL_BLOCK)
#define IS_SM_CTRL_CLEAN(x) (((x) & SM_CTRL_CLEAN) == SM_CTRL_CLEAN)
#define IS_SM_CTRL_REMERBER(x) (((x) & SM_CTRL_REMEMBER) == SM_CTRL_REMEMBER)
#define IS_SM_CTRL_HISTROY(x) (((x) & SM_CTRL_HISTROY) == SM_CTRL_HISTROY)
#define IS_SM_CTRL_FAST_SCAN(x) (((x) & SM_CTRL_FAST_SCAN) == SM_CTRL_FAST_SCAN)
// 监视器捕捉到的动作
#define SM_ACTION_NOTING 0
#define SM_ACTION_ADD 1 // 新建
#define SM_ACTION_DELETE 2 // 删除
#define SM_ACTION_MODIFY 3 // 修改
// 清除结果
#define SM_CLEAN_DELETE 1
#define SM_CLEAN_REPAIR 2
#define SM_CLEAN_FAILED 0x00010000
#define SM_CLEAN_SUCCESS 0x00020000
#define SM_CLEAN_REBOOT 0x00030000
#define GET_SM_CLEAN_OPERATOR(x) ((x) & 0xffff)
#define GET_SM_CLEAN_RESULT(x) ((x) & 0xffff0000)
//文件类型
enum SM_FILE_TYPE {
SM_FILE_TYPE_UNKNOWN = 0x00000000,
SM_FILE_TYPE_SAFE = 0x00010000,
SM_FILE_TYPE_VIRUS = 0x00020000
};
enum SM_FT_VIRUS // 病毒的子类型
{
SM_FT_VIRUS_TROJAN = 1,
SM_FT_VIRUS_THREAT,
SM_FT_VIRUS_MALWARE,
SM_FT_VIRUS_WORM,
SM_FT_VIRUS_ADWARE,
SM_FT_VIRUS_RISK_LOW,// 风险程序
SM_FT_VIRUS_RISK_MED,
SM_FT_VIRUS_RISK_HIG,
};
enum SM_FT_UNKNOWN // 未知的子类型
{
SM_FT_UNKNOWN_NET_ERROR = 1,
SM_FT_UNKNOWN_TIMEOUT,
SM_FT_UNKNOWN_SCAN_ERROR,
SM_FT_UNKNOWN_SCAN_RESULT_ERROR
};
inline DWORD GET_SM_FILE_TYPE(DWORD dwFileTyppe)
{
return (dwFileTyppe & 0xffff0000);
}
inline DWORD GET_SM_SUB_FILE_TYPE(DWORD dwFileType)
{
DWORD f = dwFileType & 0xffff;
return (f <= 0xff) ? f : 0;
}
inline SM_FILE_TYPE MAKE_SM_FILE_TYPE(DWORD dwFileType, DWORD dwSubFileType, DWORD dwSecLevel = 0)
{
dwSubFileType = dwSubFileType + (dwSecLevel << 8);
assert(dwSubFileType <= 0xFFFF);
return (SM_FILE_TYPE)(dwFileType | dwSubFileType);
}
// 文件扫描引擎
enum SM_FILE_ENGINE
{
SM_FILE_ENGINE_UNKNOWN = 0x00000000,
SM_FILE_ENGINE_VIRUS = 0x00000001, // 本地引擎
SM_FILE_ENGINE_LOCAL = SM_FILE_ENGINE_VIRUS,
SM_FILE_ENGINE_CLOUND = 0x00000002, // 云端引擎
SM_FILE_ENGINE_PLUGIN = 0x00000004, // 插件引擎
SM_FILE_ENGINE_KNOWLEDGELIB = 0x00000008, // 知识库引擎
SM_FILE_ENGINE_HEURISTIC = 0x00000010, // 启发
SM_FILE_ENGINE_RUNDATA = 0x00000020, // 启动项库
SM_FILE_ENGINE_VERIFY_SIGN = 0x00000080, // 签名
SM_FILE_ENGINE_RISK_SIGN = 0x00000100, // 黑“特征”,检测风险安装包
SM_FILE_ENGINE_ALL = 0xFFFFFFFF
};
////////////////////////////////////////////////////////////////////////////////////////////////
// interface define
////////////////////////////////////////////////////////////////////////////////////////////////
#include "SafeMonitorEvent.h"
#include <assert.h>
class ISafeMonitorObserver;
class ISafeMonitorManager;
class CSafeMonitorEvent;
class ISafeMonitorObserver
{
public:
virtual DWORD __stdcall MonitorEvent(CSafeMonitorEvent* lpEvent) = 0;
};
class ISafeMonitorManager : public ISafeMonitorObserver
{
public:
virtual HRESULT __stdcall Init() = 0;
virtual HRESULT __stdcall Uninit() = 0;
virtual HRESULT __stdcall Startup(ISafeMonitorObserver* lpObserver) = 0;
virtual HRESULT __stdcall Shutdown() = 0;
// SM_ID_RISK 支持 'default_homepage', 'default_browser'
virtual HRESULT __stdcall SetProperty(DWORD dwMonitorId, LPCTSTR lpName, LPCTSTR lpValue) = 0;
virtual HRESULT __stdcall GetProperty(DWORD dwMonitorId, LPCTSTR lpName, LPTSTR& lpValue) = 0;
// SM_ID_ALL 支持 'status',
// set 'plugin_lib_updated', 'knowledge_lib_updated', 'riskpoint_lib_updated'
virtual HRESULT __stdcall SetPropertyInt(DWORD dwMonitorId, LPCTSTR lpName, DWORD dwValue) = 0;
virtual HRESULT __stdcall GetPropertyInt(DWORD dwMonitorId, LPCTSTR lpName, DWORD& dwValue) = 0;
};
#define SMM_DLL_NAME _T("ksfmon.dll")
#define SMM_FUN_NAME "A1"
#define GCPSR_FUN_NAME "D1"
typedef ISafeMonitorManager* (WINAPI* PFN_GetSafeMonitorManager)();
ISafeMonitorManager* WINAPI GetSafeMonitorManager();
//////////////////////////////////////////////////////////////////////////
// CSafeMonitorLoader
class CSafeMonitorLoader
{
public:
CSafeMonitorLoader()
{
m_pfnGet = NULL;
m_hModule = LoadLibrary(SMM_DLL_NAME);
if ( m_hModule != NULL )
{
m_pfnGet = (PFN_GetSafeMonitorManager)GetProcAddress(m_hModule, SMM_FUN_NAME);
}
}
~CSafeMonitorLoader()
{
FreeLibrary(m_hModule);
}
operator bool ()
{
return (m_hModule != NULL) && (m_pfnGet != NULL);
}
ISafeMonitorManager* GetManager()
{
assert(m_pfnGet != NULL);
return (m_pfnGet != NULL) ? m_pfnGet() : NULL;
}
protected:
PFN_GetSafeMonitorManager m_pfnGet;
HMODULE m_hModule;
};
#endif /* _SAFE_MONITOR_INC_ */
| [
"dreamsxin@qq.com"
] | dreamsxin@qq.com |
a21d29c5dcaa64affbbd6d1486f7cdb692c53efd | 5ec08066620066b87177760d6d066f6f0cf68bca | /access/mcredis/include/redisnode.h | db36bb433ce0d5747f9d54f3b2150816114fcc73 | [] | no_license | miluzhao/C--Learn | efc0e4e6b9ce9e2b6aa57166817e3bf6ed16f77c | 631a8972db721cfccf302ccd6fe477ce254a59cf | refs/heads/master | 2020-06-13T20:31:44.995615 | 2020-03-29T12:31:39 | 2020-03-29T12:31:39 | 194,779,204 | 0 | 1 | null | null | null | null | GB18030 | C++ | false | false | 3,289 | h | #ifndef _REDIS_NODE_H_
#define _REDIS_NODE_H_
#include <vector>
#include "hiredisdef.h"
#include "mcinterface.h"
#include "threadlock.h"
class CMCRedis;
#define REDIS_SLOTS_NUM 16384 //3.0版本redis集群共有16384个槽位
#define MAX_IP_LEN 50
#define MAX_DBCONN_ID_LEN 64
#define OUT
enum eMCConnectType
{
REDIS_MASTER = 0,
REDIS_SLAVE,
};
/****redis连接结构:
一个数据库连接可以有i个集群节点(Node),
每个Node有自己的槽列表(slots),有一个主实例(master)和j个从实例(slave)
每个实例有自己的ip端口和集群唯一GUID
****/
typedef struct tagRedisNodeSlotsRange
{
int slotStart;
int slotEnd;
tagRedisNodeSlotsRange()
{
slotStart = 0;
slotEnd = 0;
}
}TRedisNodeSlotsRange;
typedef struct tagRedisConnInfo
{
char szIPAddr[MAX_IP_LEN]; //集群节点的IP地址
int nPort; //集群节点的端口号
char szConnGUID[MAX_DBCONN_ID_LEN]; //集群节点的唯一ID
redisContext *pRedisCtx; //实际连接hiredis的指针
bool bConnected; //是否连接成功
tagRedisConnInfo()
{
memset(this, 0, sizeof(tagRedisConnInfo));
bConnected = false;
}
}TRedisConnInfo;
typedef struct tagRedisNodeInfo
{
TRedisConnInfo masterConn; //集群主节点的连接信息
std::vector<TRedisConnInfo> slaveConn; //集群从节点信息数组
std::vector<TRedisNodeSlotsRange> nodeSlots;//集群节点slots数组
}TRedisNodeInfo;
class CRedisNode
{
public:
CRedisNode();
~CRedisNode();
//
bool Init(CMCRedis *pcMcRedis, TRedisNodeInfo &tNodeInfo, std::string &strPassword, unsigned int nTimeout = 0);
BOOL32 RedisConnect();
BOOL32 RedisReConnect();
bool RedisDisConnect();
//slave节点手动重连
bool RedisReConSlave(TRedisConnInfo &tSlaveConnInfo);
BOOL32 Ping();
//
redisContext * const GetConnection(int nConType);
unsigned int HaveSlave() const { return m_bHaveSlave; }
bool GetConnStatus() const { return m_bConnStatus; }
void PrintNodeInfo();
//
bool CheckSlot(unsigned int nSlot);
//获取数据的实际存储类型,如果回MC_TYPE_ERR说明数据不存在或格式不支持
eMCValueType GetKeyType(const s8* pszKey);
bool ExecCommand(int nConType,OUT redisReply *&reply, const char* cmd, ...);
bool AppendCommand( int nConType, const char* cmd, ...);
bool GetReply(int nConType, OUT redisReply **reply);
private:
bool Auth(redisContext *pCtx);
redisContext *ConnectWithTimeout(TRedisConnInfo &tConnInfo);
redisContext * const GetSlaveConnection();
private:
// redis connector context
TRedisNodeInfo m_tNodeInfo;
std::string m_strPassword; // redis server password
unsigned int m_nTimeout; // connect timeout second
bool m_bHaveSlave; // redis role
BOOL32 m_bConnStatus; // redis connection status
bool m_bInit; //
//printlog param
CMCRedis *m_pcMcParent; //连接所属对象的地址,用于打印日志信息
//互斥锁
CThreadLockMutex m_clmLock;
};
#endif //_REDIS_NODE_H_ | [
"reback1991@126.com"
] | reback1991@126.com |
e7a949373a8283f8f436ef848db56fae96fb9845 | d9e3cc612c7277384725a4df7a1066c88c8f9297 | /cocos/renderer/gfx-gles2/GLES2DescriptorSetLayout.h | 4308e5a8c1174c511f89f0781d5e7f17e9a290c6 | [
"MIT"
] | permissive | PatriceJiang/cocos2d-x-lite | 64764a1eded5dfca9542f17dd53e3aa90abcd397 | c34fab5cef3427ec5ac3bcab479897efa2aab769 | refs/heads/ohos | 2023-08-16T19:21:53.541303 | 2021-04-27T12:52:05 | 2021-04-27T12:52:05 | 139,783,503 | 2 | 2 | null | 2021-06-22T03:32:56 | 2018-07-05T02:09:32 | C++ | UTF-8 | C++ | false | false | 1,982 | h | /****************************************************************************
Copyright (c) 2020 Xiamen Yaji Software Co., Ltd.
http://www.cocos2d-x.org
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#ifndef CC_GFXGLES2_DESCRIPTOR_SET_LAYOUT_H_
#define CC_GFXGLES2_DESCRIPTOR_SET_LAYOUT_H_
namespace cc {
namespace gfx {
class GLES2GPUDescriptorSetLayout;
class CC_GLES2_API GLES2DescriptorSetLayout final : public DescriptorSetLayout {
public:
GLES2DescriptorSetLayout(Device *device);
~GLES2DescriptorSetLayout();
public:
virtual bool initialize(const DescriptorSetLayoutInfo &info) override;
virtual void destroy() override;
CC_INLINE GLES2GPUDescriptorSetLayout *gpuDescriptorSetLayout() const { return _gpuDescriptorSetLayout; }
private:
GLES2GPUDescriptorSetLayout *_gpuDescriptorSetLayout = nullptr;
};
} // namespace gfx
} // namespace cc
#endif // CC_GFXGLES2_DESCRIPTOR_SET_LAYOUT_H_
| [
"noreply@github.com"
] | noreply@github.com |
61e3c85719badcdfd9d2411614a8df8ed1bb351f | 1525553bb9645687ae8858e7650efffacf06831d | /SDL Game Development/09.Inheritance/GameStateMachine.cpp | bf37c4196c0e94aced3aea6e71f12a2724b36e5c | [] | no_license | hoseogame/20131670_SDL | 6455f66f23b5ac8bd68000336f9c7409fe1404c2 | 27e182130503364313efa4d0300ff9bc6c7fa586 | refs/heads/master | 2021-01-20T20:52:19.698357 | 2016-06-17T02:21:53 | 2016-06-17T02:21:53 | 61,255,052 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 998 | cpp | #include "GameStateMachine.h"
#include <iostream>
void GameStateMachine::update()
{
if (!m_gameStates.empty())
{
m_gameStates.back()->update();
}
}
void GameStateMachine::render()
{
if (!m_gameStates.empty())
{
m_gameStates.back()->render();
}
}
void GameStateMachine::pushState(GameState *pState)
{
m_gameStates.push_back(pState);
m_gameStates.back()->onEnter();
}
void GameStateMachine::popState()
{
if (!m_gameStates.empty())
{
m_gameStates.back()->onExit();
m_gameStates.pop_back();
}
m_gameStates.back()->resume();
}
void GameStateMachine::changeState(GameState *pState)
{
if (!m_gameStates.empty())
{
if (m_gameStates.back()->getStateID() == pState->getStateID())
{
return;
}
m_gameStates.back()->onExit();
m_gameStates.pop_back();
}
pState->onEnter();
m_gameStates.push_back(pState);
}
void GameStateMachine::clean()
{
if (!m_gameStates.empty())
{
m_gameStates.back()->onExit();
delete m_gameStates.back();
m_gameStates.clear();
}
} | [
"gpqls0387@gmail.com"
] | gpqls0387@gmail.com |
15a238c678f0d86a74438e3712c9c0153e662613 | b8963f11d2a16376fb3540ebc08b9e0256822719 | /uri/iniciante/e1052.cpp | 95ac77f00adbd66a2ce3c04825744e78c99863f1 | [] | no_license | rafaelGuasselli/estudo_cpp | 62531208592b8fef0f7219eba8de2eb7c2c693d9 | 8b0fc7f8ea4ded57e10961761305d86a809c1ec6 | refs/heads/master | 2022-03-10T10:02:44.768433 | 2019-09-27T21:48:24 | 2019-09-27T21:48:24 | 208,942,409 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 293 | cpp | #include<iostream>
#include<string>
using namespace std;
int n;
string meses[] = {"January", "February", "March", "April", "May", "June", "July",
"August", "September", "October", "November", "December"};
int main(){
cin>>n;
cout<<meses[n - 1]<<endl;
return 0;
} | [
"rafael.g.l.silva@gmail.com"
] | rafael.g.l.silva@gmail.com |
4c63fdec92873cc368aada9c6d9e0a26ab3e0199 | f2eb60395dcadd5ac5e26290f02fcd2af4fbce3b | /src/qt/form/uritests.cpp | f49a4710c6650ab7147680d61c511e94ec4282a5 | [
"MIT"
] | permissive | mygirl8893/MyElysiumCoin | 4191d995540deaf418ed92aabcd97ea66c915c91 | ed4f73cf3fab177b140b6c7953eef3fbb54445fc | refs/heads/master | 2021-01-25T04:49:18.512604 | 2017-02-05T06:38:52 | 2017-02-05T06:38:52 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,904 | cpp | #include "uritests.h"
#include "../guiutil.h"
#include "../walletmodel.h"
#include <QUrl>
void URITests::uriTests()
{
SendCoinsRecipient rv;
QUrl uri;
uri.setUrl(QString("elysium:LQDPC5rbjDB72fGFVHu4enYhxGAZuRiFh9?req-dontexist="));
QVERIFY(!GUIUtil::parseBitcoinURI(uri, &rv));
uri.setUrl(QString("elysium:LQDPC5rbjDB72fGFVHu4enYhxGAZuRiFh9?dontexist="));
QVERIFY(GUIUtil::parseBitcoinURI(uri, &rv));
QVERIFY(rv.address == QString("LQDPC5rbjDB72fGFVHu4enYhxGAZuRiFh9"));
QVERIFY(rv.label == QString());
QVERIFY(rv.amount == 0);
uri.setUrl(QString("elysium:LQDPC5rbjDB72fGFVHu4enYhxGAZuRiFh9?label=Wikipedia Example Address"));
QVERIFY(GUIUtil::parseBitcoinURI(uri, &rv));
QVERIFY(rv.address == QString("LQDPC5rbjDB72fGFVHu4enYhxGAZuRiFh9"));
QVERIFY(rv.label == QString("Wikipedia Example Address"));
QVERIFY(rv.amount == 0);
uri.setUrl(QString("elysium:LQDPC5rbjDB72fGFVHu4enYhxGAZuRiFh9?amount=0.001"));
QVERIFY(GUIUtil::parseBitcoinURI(uri, &rv));
QVERIFY(rv.address == QString("LQDPC5rbjDB72fGFVHu4enYhxGAZuRiFh9"));
QVERIFY(rv.label == QString());
QVERIFY(rv.amount == 100000);
uri.setUrl(QString("elysium:LQDPC5rbjDB72fGFVHu4enYhxGAZuRiFh9?amount=1.001"));
QVERIFY(GUIUtil::parseBitcoinURI(uri, &rv));
QVERIFY(rv.address == QString("LQDPC5rbjDB72fGFVHu4enYhxGAZuRiFh9"));
QVERIFY(rv.label == QString());
QVERIFY(rv.amount == 100100000);
uri.setUrl(QString("elysium:LQDPC5rbjDB72fGFVHu4enYhxGAZuRiFh9?amount=100&label=Wikipedia Example"));
QVERIFY(GUIUtil::parseBitcoinURI(uri, &rv));
QVERIFY(rv.address == QString("LQDPC5rbjDB72fGFVHu4enYhxGAZuRiFh9"));
QVERIFY(rv.amount == 10000000000LL);
QVERIFY(rv.label == QString("Wikipedia Example"));
uri.setUrl(QString("elysium:LQDPC5rbjDB72fGFVHu4enYhxGAZuRiFh9?message=Wikipedia Example Address"));
QVERIFY(GUIUtil::parseBitcoinURI(uri, &rv));
QVERIFY(rv.address == QString("LQDPC5rbjDB72fGFVHu4enYhxGAZuRiFh9"));
QVERIFY(rv.label == QString());
QVERIFY(GUIUtil::parseBitcoinURI("elysium://LQDPC5rbjDB72fGFVHu4enYhxGAZuRiFh9?message=Wikipedia Example Address", &rv));
QVERIFY(rv.address == QString("LQDPC5rbjDB72fGFVHu4enYhxGAZuRiFh9"));
QVERIFY(rv.label == QString());
// We currently don't implement the message parameter (ok, yea, we break spec...)
uri.setUrl(QString("elysium:LQDPC5rbjDB72fGFVHu4enYhxGAZuRiFh9?req-message=Wikipedia Example Address"));
QVERIFY(!GUIUtil::parseBitcoinURI(uri, &rv));
uri.setUrl(QString("elysium:LQDPC5rbjDB72fGFVHu4enYhxGAZuRiFh9?amount=1,000&label=Wikipedia Example"));
QVERIFY(!GUIUtil::parseBitcoinURI(uri, &rv));
uri.setUrl(QString("elysium:LQDPC5rbjDB72fGFVHu4enYhxGAZuRiFh9?amount=1,000.0&label=Wikipedia Example"));
QVERIFY(!GUIUtil::parseBitcoinURI(uri, &rv));
}
| [
"noreply@github.com"
] | noreply@github.com |
7736525215dd724430c7bee33cd8ef639d8eefbb | 9d0778c97504c1d50673ae90eb4204d3602a0f7a | /src/action.cpp | 02770a905b7928fb19880dab35e22b5761e78535 | [
"Zlib",
"BSD-3-Clause",
"MIT"
] | permissive | tasaif/wslobby | 75dada36b31a8205456a8009365f9cc90ca4cd2a | 23af583129906f8c744e984d2b8e06eb2d8b50a4 | refs/heads/master | 2021-01-21T13:11:32.431039 | 2016-05-25T06:35:47 | 2016-05-25T06:35:47 | 55,921,839 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 202 | cpp | #include "action.h"
Action::Action(ActionType t, connection_hdl h){
type = t;
hdl = h;
}
Action::Action(ActionType t, connection_hdl h, server::message_ptr m){
type = t;
hdl = h;
msg = m;
}
| [
"saif.tareq@gmail.com"
] | saif.tareq@gmail.com |
0e13b40fa82193350077aaffbb59fed16701323d | 5dd0a356e209d59f95acd6f5e9f694d690132c57 | /test/Main.cpp | 932de0f2b97999475f85306bcd1b7b535f1f59b9 | [
"MIT"
] | permissive | demidko/native-library | 6b7aad91a44f6d4b51c17dd6e73002e820a2f384 | 16764449a98af84ab40c25502477f8f399c19fb3 | refs/heads/main | 2023-08-02T15:45:26.301691 | 2021-09-29T11:27:08 | 2021-09-29T11:27:08 | 411,502,593 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 100 | cpp | #define CATCH_CONFIG_MAIN
#include <catch2/catch.hpp>
TEST_CASE("Test") {
REQUIRE(2 + 2 == 4);
} | [
"DanielDemidko@gmail.com"
] | DanielDemidko@gmail.com |
5b52673bad696f0f924f33ebdf2666e0d7ee3f8d | 8dc84558f0058d90dfc4955e905dab1b22d12c08 | /third_party/blink/renderer/core/css/cssom/css_keyword_value.h | 8ecb9824756c07aca03abbd9b1ac45946a30143c | [
"LGPL-2.0-only",
"BSD-2-Clause",
"LGPL-2.1-only",
"LGPL-2.0-or-later",
"GPL-1.0-or-later",
"MIT",
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference",
"BSD-3-Clause"
] | permissive | meniossin/src | 42a95cc6c4a9c71d43d62bc4311224ca1fd61e03 | 44f73f7e76119e5ab415d4593ac66485e65d700a | refs/heads/master | 2022-12-16T20:17:03.747113 | 2020-09-03T10:43:12 | 2020-09-03T10:43:12 | 263,710,168 | 1 | 0 | BSD-3-Clause | 2020-05-13T18:20:09 | 2020-05-13T18:20:08 | null | UTF-8 | C++ | false | false | 1,601 | h | // Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_CSS_CSSOM_CSS_KEYWORD_VALUE_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_CSS_CSSOM_CSS_KEYWORD_VALUE_H_
#include "base/macros.h"
#include "third_party/blink/renderer/core/core_export.h"
#include "third_party/blink/renderer/core/css/cssom/css_style_value.h"
#include "third_party/blink/renderer/core/css_value_keywords.h"
namespace blink {
class ExceptionState;
class CORE_EXPORT CSSKeywordValue final : public CSSStyleValue {
DEFINE_WRAPPERTYPEINFO();
public:
static CSSKeywordValue* Create(const String& keyword);
static CSSKeywordValue* Create(const String& keyword, ExceptionState&);
static CSSKeywordValue* FromCSSValue(const CSSValue&);
StyleValueType GetType() const override { return kKeywordType; }
const String& value() const;
void setValue(const String& keyword, ExceptionState&);
CSSValueID KeywordValueID() const;
const CSSValue* ToCSSValue() const override;
private:
explicit CSSKeywordValue(const String& keyword) : keyword_value_(keyword) {}
String keyword_value_;
DISALLOW_COPY_AND_ASSIGN(CSSKeywordValue);
};
DEFINE_TYPE_CASTS(CSSKeywordValue,
CSSStyleValue,
value,
value->GetType() ==
CSSStyleValue::StyleValueType::kKeywordType,
value.GetType() ==
CSSStyleValue::StyleValueType::kKeywordType);
} // namespace blink
#endif
| [
"arnaud@geometry.ee"
] | arnaud@geometry.ee |
20c2d5f7c9c471f06bd964aeac0be77e4c330f1f | 7947f43c91dbab595842bf7bfa255edb92675749 | /Filters/Points/vtkSPHKernel.cxx | 74689da83a6de075530a568e053f2c4f5e5bc72b | [
"BSD-3-Clause"
] | permissive | imorgan1618/VTK | 0b1e7f22b873a41571d0e2ac7617ce09197f156b | 0f9bf00fc6ca953007ca644057e6c8acd8194faf | refs/heads/master | 2020-12-11T05:55:52.681174 | 2016-09-22T18:40:12 | 2016-09-22T18:40:12 | 68,615,660 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,771 | cxx | /*=========================================================================
Program: Visualization Toolkit
Module: vtkSPHKernel.cxx
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#include "vtkSPHKernel.h"
#include "vtkAbstractPointLocator.h"
#include "vtkObjectFactory.h"
#include "vtkIdList.h"
#include "vtkDoubleArray.h"
#include "vtkFloatArray.h"
#include "vtkDataArray.h"
#include "vtkDataSet.h"
#include "vtkMath.h"
vtkCxxSetObjectMacro(vtkSPHKernel,CutoffArray,vtkDataArray);
vtkCxxSetObjectMacro(vtkSPHKernel,DensityArray,vtkDataArray);
vtkCxxSetObjectMacro(vtkSPHKernel,MassArray,vtkDataArray);
//----------------------------------------------------------------------------
vtkSPHKernel::vtkSPHKernel()
{
this->RequiresInitialization = true;
this->SpatialStep = 0.001;
this->Dimension = 3;
this->CutoffArray = NULL;
this->DensityArray = NULL;
this->MassArray = NULL;
}
//----------------------------------------------------------------------------
vtkSPHKernel::~vtkSPHKernel()
{
this->SetCutoffArray(NULL);
this->SetDensityArray(NULL);
this->SetMassArray(NULL);
}
//----------------------------------------------------------------------------
// At this point, the spatial step, the dimension of the kernel, the cutoff
// factor, and the sigma normalization factor should be known.
void vtkSPHKernel::
Initialize(vtkAbstractPointLocator *loc, vtkDataSet *ds, vtkPointData *attr)
{
this->Superclass::Initialize(loc, ds, attr);
// this->CutoffFactor should have been set by subclass
this->Cutoff = this->CutoffFactor * this->SpatialStep;
this->DistNorm = 1.0 / this->SpatialStep;
this->NormFactor = this->Sigma * pow(this->DistNorm,this->Dimension);
this->DefaultVolume = pow(this->SpatialStep,this->Dimension);
// See if cutoff array is provided.
if ( this->CutoffArray && this->CutoffArray->GetNumberOfComponents() == 1 )
{
this->UseCutoffArray = true;
}
else
{
this->UseCutoffArray = false;
}
// See if local mass and density information is provided
if ( this->DensityArray && this->MassArray &&
this->DensityArray->GetNumberOfComponents() == 1 &&
this->MassArray->GetNumberOfComponents() == 1 )
{
this->UseArraysForVolume = true;
}
else
{
this->UseArraysForVolume = false;
}
}
//----------------------------------------------------------------------------
// Radius around point is cutoff factor * smoothing length. That is unless
// cutoff array is provided.
vtkIdType vtkSPHKernel::
ComputeBasis(double x[3], vtkIdList *pIds, vtkIdType ptId)
{
double cutoff;
if ( this->UseCutoffArray )
{
this->CutoffArray->GetTuple(ptId,&cutoff);
}
else
{
cutoff = this->Cutoff;
}
this->Locator->FindPointsWithinRadius(cutoff, x, pIds);
return pIds->GetNumberOfIds();
}
//----------------------------------------------------------------------------
vtkIdType vtkSPHKernel::
ComputeWeights(double x[3], vtkIdList *pIds, vtkDoubleArray *weights)
{
vtkIdType numPts = pIds->GetNumberOfIds();
int i;
vtkIdType id;
double d, y[3];
weights->SetNumberOfTuples(numPts);
double *w = weights->GetPointer(0);
double KW, mass, density, volume;
// Compute SPH coefficients.
for (i=0; i<numPts; ++i)
{
id = pIds->GetId(i);
this->DataSet->GetPoint(id,y);
d = sqrt( vtkMath::Distance2BetweenPoints(x,y) );
KW = this->ComputeFunctionWeight(d*this->DistNorm);
if ( this->UseArraysForVolume )
{
this->MassArray->GetTuple(id,&mass);
this->DensityArray->GetTuple(id,&density);
volume = mass /density;
}
else
{
volume = this->DefaultVolume;
}
w[i] = this->NormFactor * KW * volume;
}//over all neighbor points
return numPts;
}
//----------------------------------------------------------------------------
vtkIdType vtkSPHKernel::
ComputeDerivWeights(double x[3], vtkIdList *pIds, vtkDoubleArray *weights,
vtkDoubleArray *gradWeights)
{
vtkIdType numPts = pIds->GetNumberOfIds();
int i;
vtkIdType id;
double d, y[3];
weights->SetNumberOfTuples(numPts);
double *w = weights->GetPointer(0);
gradWeights->SetNumberOfTuples(numPts);
double *gw = gradWeights->GetPointer(0);
double KW, GW, volume=this->DefaultVolume;
// Compute SPH coefficients for data and deriative data
for (i=0; i<numPts; ++i)
{
id = pIds->GetId(i);
this->DataSet->GetPoint(id,y);
d = sqrt( vtkMath::Distance2BetweenPoints(x,y) );
KW = this->ComputeFunctionWeight(d*this->DistNorm);
GW = this->ComputeDerivWeight(d*this->DistNorm);
w[i] = this->NormFactor * KW * volume;
gw[i] = this->NormFactor * GW * volume;
}//over all neighbor points
return numPts;
}
//----------------------------------------------------------------------------
void vtkSPHKernel::PrintSelf(ostream& os, vtkIndent indent)
{
this->Superclass::PrintSelf(os,indent);
os << indent << "Spatial Step: " << this->SpatialStep << "\n";
os << indent << "Dimension: " << this->Dimension << "\n";
os << indent << "Cutoff Factor: " << this->CutoffFactor << "\n";
os << indent << "Sigma: " << this->Sigma << "\n";
os << indent << "Cutoff Array: " << this->CutoffArray<< "\n";
os << indent << "Density Array: " << this->DensityArray << "\n";
os << indent << "Mass Array: " << this->MassArray << "\n";
}
| [
"will.schroeder@kitware.com"
] | will.schroeder@kitware.com |
26899a0812c2f74962303e5991eeb48434998416 | 65845cdee27f55b7ce256cd144a3f60e9e5c57d8 | /Trab_Final/Arduino.ino | 40e92da45120f0380ebde8e26b90222c0249f99a | [] | no_license | bbeltrame01/Sistemas_Distribuidos | 05b6744ff0f5eb3a243b365e5aad3b04c06e36d8 | b0eb62b4e30a507b950623f153c2df490e9cc8bc | refs/heads/master | 2022-04-09T17:29:46.659907 | 2020-03-21T00:03:34 | 2020-03-21T00:03:34 | 208,920,855 | 1 | 0 | null | 2020-03-19T19:35:04 | 2019-09-17T00:07:40 | Python | UTF-8 | C++ | false | false | 1,109 | ino |
void setup() {
pinMode(LED_BUILTIN, OUTPUT);
Serial.begin(9600);
}
/**
* Função que lê uma string da Serial
* e retorna-a
*/
String leStringSerial(){
String conteudo = "";
char caractere;
// Enquanto receber algo pela serial
while(Serial.available() > 0) {
// Lê byte da serial
caractere = Serial.read();
// Ignora caractere de quebra de linha
if (caractere != '\n'){
// Concatena valores
conteudo.concat(caractere);
}
// Aguarda buffer serial ler próximo caractere
delay(10);
}
Serial.print("Recebi: ");
Serial.println(conteudo);
return conteudo;
}
void loop() {
// Se receber algo pela serial
if (Serial.available() > 0){
// Lê toda string recebida
String recebido = leStringSerial();
if (recebido == "1"){
printf("%s", recebido);
digitalWrite(LED_BUILTIN, HIGH);
}
if (recebido == "0"){
printf("%s", recebido);
digitalWrite(LED_BUILTIN, LOW);
}
}
}
| [
"noreply@github.com"
] | noreply@github.com |
7e29d4ddf58dd75264d8fd0600b20a0942966773 | 814fd0bea5bc063a4e34ebdd0a5597c9ff67532b | /cc/debug/picture_debug_util.cc | e653b78e235e10ceed2e5921675733e690bd635f | [
"BSD-3-Clause"
] | permissive | rzr/chromium-crosswalk | 1b22208ff556d69c009ad292bc17dca3fe15c493 | d391344809adf7b4f39764ac0e15c378169b805f | refs/heads/master | 2021-01-21T09:11:07.316526 | 2015-02-16T11:52:21 | 2015-02-16T11:52:21 | 38,887,985 | 0 | 0 | NOASSERTION | 2019-08-07T21:59:20 | 2015-07-10T15:35:50 | C++ | UTF-8 | C++ | false | false | 2,439 | cc | // Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "cc/debug/picture_debug_util.h"
#include <vector>
#include "base/base64.h"
#include "base/memory/scoped_ptr.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "third_party/skia/include/core/SkData.h"
#include "third_party/skia/include/core/SkImageInfo.h"
#include "third_party/skia/include/core/SkPicture.h"
#include "third_party/skia/include/core/SkPixelSerializer.h"
#include "third_party/skia/include/core/SkStream.h"
#include "ui/gfx/codec/jpeg_codec.h"
#include "ui/gfx/codec/png_codec.h"
namespace {
class BitmapSerializer : public SkPixelSerializer {
protected:
bool onUseEncodedData(const void* data, size_t len) override { return true; }
SkData* onEncodePixels(const SkImageInfo& info,
const void* pixels,
size_t row_bytes) override {
const int kJpegQuality = 80;
std::vector<unsigned char> data;
// If bitmap is opaque, encode as JPEG.
// Otherwise encode as PNG.
bool encoding_succeeded = false;
if (info.isOpaque()) {
encoding_succeeded =
gfx::JPEGCodec::Encode(reinterpret_cast<const unsigned char*>(pixels),
gfx::JPEGCodec::FORMAT_SkBitmap, info.width(),
info.height(), row_bytes, kJpegQuality, &data);
} else {
SkBitmap bm;
// The cast is ok, since we only read the bm.
if (!bm.installPixels(info, const_cast<void*>(pixels), row_bytes)) {
return nullptr;
}
encoding_succeeded = gfx::PNGCodec::EncodeBGRASkBitmap(bm, false, &data);
}
if (encoding_succeeded) {
return SkData::NewWithCopy(&data.front(), data.size());
}
return nullptr;
}
};
} // namespace
namespace cc {
void PictureDebugUtil::SerializeAsBase64(const SkPicture* picture,
std::string* output) {
SkDynamicMemoryWStream stream;
BitmapSerializer serializer;
picture->serialize(&stream, &serializer);
size_t serialized_size = stream.bytesWritten();
scoped_ptr<char[]> serialized_picture(new char[serialized_size]);
stream.copyTo(serialized_picture.get());
base::Base64Encode(std::string(serialized_picture.get(), serialized_size),
output);
}
} // namespace cc
| [
"commit-bot@chromium.org"
] | commit-bot@chromium.org |
26600fcb8592bdc9bb40aa720bd004dd6d02285e | 9de18ef120a8ae68483b866c1d4c7b9c2fbef46e | /src/SymbolProvider/include/SymbolProvider/SymbolLoadingOutcome.h | 79e2a6808c9fa8ff763b3067a983bd02901ac5fc | [
"BSD-2-Clause",
"LicenseRef-scancode-free-unknown"
] | permissive | google/orbit | 02a5b4556cd2f979f377b87c24dd2b0a90dff1e2 | 68c4ae85a6fe7b91047d020259234f7e4961361c | refs/heads/main | 2023-09-03T13:14:49.830576 | 2023-08-25T06:28:36 | 2023-08-25T06:28:36 | 104,358,587 | 2,680 | 325 | BSD-2-Clause | 2023-08-25T06:28:37 | 2017-09-21T14:28:35 | C++ | UTF-8 | C++ | false | false | 1,911 | h | // Copyright (c) 2022 The Orbit Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef SYMBOL_PROVIDER_SYMBOL_LOADING_OUTCOME_H_
#define SYMBOL_PROVIDER_SYMBOL_LOADING_OUTCOME_H_
#include <filesystem>
#include <string>
#include <utility>
#include <variant>
#include "OrbitBase/CanceledOr.h"
#include "OrbitBase/NotFoundOr.h"
#include "OrbitBase/Result.h"
namespace orbit_symbol_provider {
struct SymbolLoadingSuccessResult {
enum class SymbolSource {
kUnknown,
kOrbitCache,
kLocalStadiaSdk,
kStadiaInstance,
kSymbolLocationsDialog,
kAdditionalSymbolPathsFlag,
kStadiaSymbolStore,
kMicrosoftSymbolServer,
kUserDefinedSymbolStore,
kUsrLibDebugDirectory,
kStadiaInstanceUsrLibDebug
};
enum class SymbolFileSeparation { kDifferentFile, kModuleFile };
explicit SymbolLoadingSuccessResult(std::filesystem::path path, SymbolSource symbol_source,
SymbolFileSeparation symbol_file_separation)
: path(std::move(path)),
symbol_source(symbol_source),
symbol_file_separation(symbol_file_separation) {}
std::filesystem::path path;
SymbolSource symbol_source;
SymbolFileSeparation symbol_file_separation;
};
using SymbolLoadingOutcome =
ErrorMessageOr<orbit_base::CanceledOr<orbit_base::NotFoundOr<SymbolLoadingSuccessResult>>>;
[[nodiscard]] bool IsCanceled(const SymbolLoadingOutcome& outcome);
[[nodiscard]] bool IsNotFound(const SymbolLoadingOutcome& outcome);
[[nodiscard]] std::string GetNotFoundMessage(const SymbolLoadingOutcome& outcome);
[[nodiscard]] bool IsSuccessResult(const SymbolLoadingOutcome& outcome);
[[nodiscard]] SymbolLoadingSuccessResult GetSuccessResult(const SymbolLoadingOutcome& outcome);
} // namespace orbit_symbol_provider
#endif // SYMBOL_PROVIDER_SYMBOL_LOADING_OUTCOME_H_ | [
"noreply@github.com"
] | noreply@github.com |
0912e413e3622a5a0355a4aca2cc85a35c9f0a94 | b059cd4dfca19b0798a76428d8f36555de2ac9b1 | /inline.cpp | 95c887dff5a36ca05b769d6d1f1d624c961dac7f | [] | no_license | SakshiRathore982/data-structure | e66f0f9e5a9edb5ec7228bf4d57abb0ee4c8cd81 | 1ba6341c238eac2003f8e1053d538637cb33e1da | refs/heads/main | 2023-04-04T04:10:50.018178 | 2021-04-18T18:27:59 | 2021-04-18T18:27:59 | 336,478,744 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 155 | cpp | #include<iostream>
using namespace std;
inline int max(int x, int y)
{
return (x>y)?x:y;
}
class
int main()
{
cout<<max(20,10);
return 0;
}
| [
"noreply@github.com"
] | noreply@github.com |
87b21b43ba89e0d88d2288085e2660d4875ffff4 | c776476e9d06b3779d744641e758ac3a2c15cddc | /examples/litmus/c/run-scripts/tmp_1/R+dmb.st+rfi-ctrlisb-[fr-rf].c.cbmc.cpp | 9f0d27b2a63b95f90441521dfead07f80a523415 | [] | no_license | ashutosh0gupta/llvm_bmc | aaac7961c723ba6f7ffd77a39559e0e52432eade | 0287c4fb180244e6b3c599a9902507f05c8a7234 | refs/heads/master | 2023-08-02T17:14:06.178723 | 2023-07-31T10:46:53 | 2023-07-31T10:46:53 | 143,100,825 | 3 | 4 | null | 2023-05-25T05:50:55 | 2018-08-01T03:47:00 | C++ | UTF-8 | C++ | false | false | 45,205 | cpp | // 0:vars:2
// 5:thr0:1
// 6:thr1:1
// 3:atom_1_X3_0:1
// 2:atom_1_X2_2:1
// 4:atom_1_X5_1:1
// 7:thr2:1
#define ADDRSIZE 8
#define NPROC 4
#define NCONTEXT 1
#define ASSUME(stmt) __CPROVER_assume(stmt)
#define ASSERT(stmt) __CPROVER_assert(stmt, "error")
#define max(a,b) (a>b?a:b)
char __get_rng();
char get_rng( char from, char to ) {
char ret = __get_rng();
ASSUME(ret >= from && ret <= to);
return ret;
}
char get_rng_th( char from, char to ) {
char ret = __get_rng();
ASSUME(ret >= from && ret <= to);
return ret;
}
int main(int argc, char **argv) {
// declare arrays for intial value version in contexts
int meminit_[ADDRSIZE*NCONTEXT];
#define meminit(x,k) meminit_[(x)*NCONTEXT+k]
int coinit_[ADDRSIZE*NCONTEXT];
#define coinit(x,k) coinit_[(x)*NCONTEXT+k]
int deltainit_[ADDRSIZE*NCONTEXT];
#define deltainit(x,k) deltainit_[(x)*NCONTEXT+k]
// declare arrays for running value version in contexts
int mem_[ADDRSIZE*NCONTEXT];
#define mem(x,k) mem_[(x)*NCONTEXT+k]
int co_[ADDRSIZE*NCONTEXT];
#define co(x,k) co_[(x)*NCONTEXT+k]
int delta_[ADDRSIZE*NCONTEXT];
#define delta(x,k) delta_[(x)*NCONTEXT+k]
// declare arrays for local buffer and observed writes
int buff_[NPROC*ADDRSIZE];
#define buff(x,k) buff_[(x)*ADDRSIZE+k]
int pw_[NPROC*ADDRSIZE];
#define pw(x,k) pw_[(x)*ADDRSIZE+k]
// declare arrays for context stamps
char cr_[NPROC*ADDRSIZE];
#define cr(x,k) cr_[(x)*ADDRSIZE+k]
char iw_[NPROC*ADDRSIZE];
#define iw(x,k) iw_[(x)*ADDRSIZE+k]
char cw_[NPROC*ADDRSIZE];
#define cw(x,k) cw_[(x)*ADDRSIZE+k]
char cx_[NPROC*ADDRSIZE];
#define cx(x,k) cx_[(x)*ADDRSIZE+k]
char is_[NPROC*ADDRSIZE];
#define is(x,k) is_[(x)*ADDRSIZE+k]
char cs_[NPROC*ADDRSIZE];
#define cs(x,k) cs_[(x)*ADDRSIZE+k]
char crmax_[NPROC*ADDRSIZE];
#define crmax(x,k) crmax_[(x)*ADDRSIZE+k]
char sforbid_[ADDRSIZE*NCONTEXT];
#define sforbid(x,k) sforbid_[(x)*NCONTEXT+k]
// declare arrays for synchronizations
int cl[NPROC];
int cdy[NPROC];
int cds[NPROC];
int cdl[NPROC];
int cisb[NPROC];
int caddr[NPROC];
int cctrl[NPROC];
int cstart[NPROC];
int creturn[NPROC];
// declare arrays for contexts activity
int active[NCONTEXT];
int ctx_used[NCONTEXT];
__LOCALS__
buff(0,0) = 0;
pw(0,0) = 0;
cr(0,0) = 0;
iw(0,0) = 0;
cw(0,0) = 0;
cx(0,0) = 0;
is(0,0) = 0;
cs(0,0) = 0;
crmax(0,0) = 0;
buff(0,1) = 0;
pw(0,1) = 0;
cr(0,1) = 0;
iw(0,1) = 0;
cw(0,1) = 0;
cx(0,1) = 0;
is(0,1) = 0;
cs(0,1) = 0;
crmax(0,1) = 0;
buff(0,2) = 0;
pw(0,2) = 0;
cr(0,2) = 0;
iw(0,2) = 0;
cw(0,2) = 0;
cx(0,2) = 0;
is(0,2) = 0;
cs(0,2) = 0;
crmax(0,2) = 0;
buff(0,3) = 0;
pw(0,3) = 0;
cr(0,3) = 0;
iw(0,3) = 0;
cw(0,3) = 0;
cx(0,3) = 0;
is(0,3) = 0;
cs(0,3) = 0;
crmax(0,3) = 0;
buff(0,4) = 0;
pw(0,4) = 0;
cr(0,4) = 0;
iw(0,4) = 0;
cw(0,4) = 0;
cx(0,4) = 0;
is(0,4) = 0;
cs(0,4) = 0;
crmax(0,4) = 0;
buff(0,5) = 0;
pw(0,5) = 0;
cr(0,5) = 0;
iw(0,5) = 0;
cw(0,5) = 0;
cx(0,5) = 0;
is(0,5) = 0;
cs(0,5) = 0;
crmax(0,5) = 0;
buff(0,6) = 0;
pw(0,6) = 0;
cr(0,6) = 0;
iw(0,6) = 0;
cw(0,6) = 0;
cx(0,6) = 0;
is(0,6) = 0;
cs(0,6) = 0;
crmax(0,6) = 0;
buff(0,7) = 0;
pw(0,7) = 0;
cr(0,7) = 0;
iw(0,7) = 0;
cw(0,7) = 0;
cx(0,7) = 0;
is(0,7) = 0;
cs(0,7) = 0;
crmax(0,7) = 0;
cl[0] = 0;
cdy[0] = 0;
cds[0] = 0;
cdl[0] = 0;
cisb[0] = 0;
caddr[0] = 0;
cctrl[0] = 0;
cstart[0] = get_rng(0,NCONTEXT-1);
creturn[0] = get_rng(0,NCONTEXT-1);
buff(1,0) = 0;
pw(1,0) = 0;
cr(1,0) = 0;
iw(1,0) = 0;
cw(1,0) = 0;
cx(1,0) = 0;
is(1,0) = 0;
cs(1,0) = 0;
crmax(1,0) = 0;
buff(1,1) = 0;
pw(1,1) = 0;
cr(1,1) = 0;
iw(1,1) = 0;
cw(1,1) = 0;
cx(1,1) = 0;
is(1,1) = 0;
cs(1,1) = 0;
crmax(1,1) = 0;
buff(1,2) = 0;
pw(1,2) = 0;
cr(1,2) = 0;
iw(1,2) = 0;
cw(1,2) = 0;
cx(1,2) = 0;
is(1,2) = 0;
cs(1,2) = 0;
crmax(1,2) = 0;
buff(1,3) = 0;
pw(1,3) = 0;
cr(1,3) = 0;
iw(1,3) = 0;
cw(1,3) = 0;
cx(1,3) = 0;
is(1,3) = 0;
cs(1,3) = 0;
crmax(1,3) = 0;
buff(1,4) = 0;
pw(1,4) = 0;
cr(1,4) = 0;
iw(1,4) = 0;
cw(1,4) = 0;
cx(1,4) = 0;
is(1,4) = 0;
cs(1,4) = 0;
crmax(1,4) = 0;
buff(1,5) = 0;
pw(1,5) = 0;
cr(1,5) = 0;
iw(1,5) = 0;
cw(1,5) = 0;
cx(1,5) = 0;
is(1,5) = 0;
cs(1,5) = 0;
crmax(1,5) = 0;
buff(1,6) = 0;
pw(1,6) = 0;
cr(1,6) = 0;
iw(1,6) = 0;
cw(1,6) = 0;
cx(1,6) = 0;
is(1,6) = 0;
cs(1,6) = 0;
crmax(1,6) = 0;
buff(1,7) = 0;
pw(1,7) = 0;
cr(1,7) = 0;
iw(1,7) = 0;
cw(1,7) = 0;
cx(1,7) = 0;
is(1,7) = 0;
cs(1,7) = 0;
crmax(1,7) = 0;
cl[1] = 0;
cdy[1] = 0;
cds[1] = 0;
cdl[1] = 0;
cisb[1] = 0;
caddr[1] = 0;
cctrl[1] = 0;
cstart[1] = get_rng(0,NCONTEXT-1);
creturn[1] = get_rng(0,NCONTEXT-1);
buff(2,0) = 0;
pw(2,0) = 0;
cr(2,0) = 0;
iw(2,0) = 0;
cw(2,0) = 0;
cx(2,0) = 0;
is(2,0) = 0;
cs(2,0) = 0;
crmax(2,0) = 0;
buff(2,1) = 0;
pw(2,1) = 0;
cr(2,1) = 0;
iw(2,1) = 0;
cw(2,1) = 0;
cx(2,1) = 0;
is(2,1) = 0;
cs(2,1) = 0;
crmax(2,1) = 0;
buff(2,2) = 0;
pw(2,2) = 0;
cr(2,2) = 0;
iw(2,2) = 0;
cw(2,2) = 0;
cx(2,2) = 0;
is(2,2) = 0;
cs(2,2) = 0;
crmax(2,2) = 0;
buff(2,3) = 0;
pw(2,3) = 0;
cr(2,3) = 0;
iw(2,3) = 0;
cw(2,3) = 0;
cx(2,3) = 0;
is(2,3) = 0;
cs(2,3) = 0;
crmax(2,3) = 0;
buff(2,4) = 0;
pw(2,4) = 0;
cr(2,4) = 0;
iw(2,4) = 0;
cw(2,4) = 0;
cx(2,4) = 0;
is(2,4) = 0;
cs(2,4) = 0;
crmax(2,4) = 0;
buff(2,5) = 0;
pw(2,5) = 0;
cr(2,5) = 0;
iw(2,5) = 0;
cw(2,5) = 0;
cx(2,5) = 0;
is(2,5) = 0;
cs(2,5) = 0;
crmax(2,5) = 0;
buff(2,6) = 0;
pw(2,6) = 0;
cr(2,6) = 0;
iw(2,6) = 0;
cw(2,6) = 0;
cx(2,6) = 0;
is(2,6) = 0;
cs(2,6) = 0;
crmax(2,6) = 0;
buff(2,7) = 0;
pw(2,7) = 0;
cr(2,7) = 0;
iw(2,7) = 0;
cw(2,7) = 0;
cx(2,7) = 0;
is(2,7) = 0;
cs(2,7) = 0;
crmax(2,7) = 0;
cl[2] = 0;
cdy[2] = 0;
cds[2] = 0;
cdl[2] = 0;
cisb[2] = 0;
caddr[2] = 0;
cctrl[2] = 0;
cstart[2] = get_rng(0,NCONTEXT-1);
creturn[2] = get_rng(0,NCONTEXT-1);
buff(3,0) = 0;
pw(3,0) = 0;
cr(3,0) = 0;
iw(3,0) = 0;
cw(3,0) = 0;
cx(3,0) = 0;
is(3,0) = 0;
cs(3,0) = 0;
crmax(3,0) = 0;
buff(3,1) = 0;
pw(3,1) = 0;
cr(3,1) = 0;
iw(3,1) = 0;
cw(3,1) = 0;
cx(3,1) = 0;
is(3,1) = 0;
cs(3,1) = 0;
crmax(3,1) = 0;
buff(3,2) = 0;
pw(3,2) = 0;
cr(3,2) = 0;
iw(3,2) = 0;
cw(3,2) = 0;
cx(3,2) = 0;
is(3,2) = 0;
cs(3,2) = 0;
crmax(3,2) = 0;
buff(3,3) = 0;
pw(3,3) = 0;
cr(3,3) = 0;
iw(3,3) = 0;
cw(3,3) = 0;
cx(3,3) = 0;
is(3,3) = 0;
cs(3,3) = 0;
crmax(3,3) = 0;
buff(3,4) = 0;
pw(3,4) = 0;
cr(3,4) = 0;
iw(3,4) = 0;
cw(3,4) = 0;
cx(3,4) = 0;
is(3,4) = 0;
cs(3,4) = 0;
crmax(3,4) = 0;
buff(3,5) = 0;
pw(3,5) = 0;
cr(3,5) = 0;
iw(3,5) = 0;
cw(3,5) = 0;
cx(3,5) = 0;
is(3,5) = 0;
cs(3,5) = 0;
crmax(3,5) = 0;
buff(3,6) = 0;
pw(3,6) = 0;
cr(3,6) = 0;
iw(3,6) = 0;
cw(3,6) = 0;
cx(3,6) = 0;
is(3,6) = 0;
cs(3,6) = 0;
crmax(3,6) = 0;
buff(3,7) = 0;
pw(3,7) = 0;
cr(3,7) = 0;
iw(3,7) = 0;
cw(3,7) = 0;
cx(3,7) = 0;
is(3,7) = 0;
cs(3,7) = 0;
crmax(3,7) = 0;
cl[3] = 0;
cdy[3] = 0;
cds[3] = 0;
cdl[3] = 0;
cisb[3] = 0;
caddr[3] = 0;
cctrl[3] = 0;
cstart[3] = get_rng(0,NCONTEXT-1);
creturn[3] = get_rng(0,NCONTEXT-1);
// Dumping initializations
mem(0+0,0) = 0;
mem(0+1,0) = 0;
mem(5+0,0) = 0;
mem(6+0,0) = 0;
mem(3+0,0) = 0;
mem(2+0,0) = 0;
mem(4+0,0) = 0;
mem(7+0,0) = 0;
// Dumping context matching equalities
co(0,0) = 0;
delta(0,0) = -1;
co(1,0) = 0;
delta(1,0) = -1;
co(2,0) = 0;
delta(2,0) = -1;
co(3,0) = 0;
delta(3,0) = -1;
co(4,0) = 0;
delta(4,0) = -1;
co(5,0) = 0;
delta(5,0) = -1;
co(6,0) = 0;
delta(6,0) = -1;
co(7,0) = 0;
delta(7,0) = -1;
// Dumping thread 1
int ret_thread_1 = 0;
cdy[1] = get_rng(0,NCONTEXT-1);
ASSUME(cdy[1] >= cstart[1]);
T1BLOCK0:
// call void @llvm.dbg.value(metadata i8* %arg, metadata !37, metadata !DIExpression()), !dbg !46
// br label %label_1, !dbg !47
goto T1BLOCK1;
T1BLOCK1:
// call void @llvm.dbg.label(metadata !45), !dbg !48
// call void @llvm.dbg.value(metadata i64* getelementptr inbounds ([2 x i64], [2 x i64]* @vars, i64 0, i64 0), metadata !38, metadata !DIExpression()), !dbg !49
// call void @llvm.dbg.value(metadata i64 2, metadata !41, metadata !DIExpression()), !dbg !49
// store atomic i64 2, i64* getelementptr inbounds ([2 x i64], [2 x i64]* @vars, i64 0, i64 0) monotonic, align 8, !dbg !50
// ST: Guess
iw(1,0) = get_rng(0,NCONTEXT-1);// 1 ASSIGN STIW
old_cw = cw(1,0);
cw(1,0) = get_rng(0,NCONTEXT-1);// 1 ASSIGN STCOM
// Check
ASSUME(active[iw(1,0)] == 1);
ASSUME(active[cw(1,0)] == 1);
ASSUME(sforbid(0,cw(1,0))== 0);
ASSUME(iw(1,0) >= 0);
ASSUME(iw(1,0) >= 0);
ASSUME(cw(1,0) >= iw(1,0));
ASSUME(cw(1,0) >= old_cw);
ASSUME(cw(1,0) >= cr(1,0));
ASSUME(cw(1,0) >= cl[1]);
ASSUME(cw(1,0) >= cisb[1]);
ASSUME(cw(1,0) >= cdy[1]);
ASSUME(cw(1,0) >= cdl[1]);
ASSUME(cw(1,0) >= cds[1]);
ASSUME(cw(1,0) >= cctrl[1]);
ASSUME(cw(1,0) >= caddr[1]);
// Update
caddr[1] = max(caddr[1],0);
buff(1,0) = 2;
mem(0,cw(1,0)) = 2;
co(0,cw(1,0))+=1;
delta(0,cw(1,0)) = -1;
ASSUME(creturn[1] >= cw(1,0));
// call void (...) @dmbst(), !dbg !51
// dumbst: Guess
cds[1] = get_rng(0,NCONTEXT-1);
// Check
ASSUME(cds[1] >= cdy[1]);
ASSUME(cds[1] >= cw(1,0+0));
ASSUME(cds[1] >= cw(1,0+1));
ASSUME(cds[1] >= cw(1,5+0));
ASSUME(cds[1] >= cw(1,6+0));
ASSUME(cds[1] >= cw(1,3+0));
ASSUME(cds[1] >= cw(1,2+0));
ASSUME(cds[1] >= cw(1,4+0));
ASSUME(cds[1] >= cw(1,7+0));
ASSUME(creturn[1] >= cds[1]);
// call void @llvm.dbg.value(metadata i64* getelementptr inbounds ([2 x i64], [2 x i64]* @vars, i64 0, i64 1), metadata !42, metadata !DIExpression()), !dbg !52
// call void @llvm.dbg.value(metadata i64 1, metadata !44, metadata !DIExpression()), !dbg !52
// store atomic i64 1, i64* getelementptr inbounds ([2 x i64], [2 x i64]* @vars, i64 0, i64 1) monotonic, align 8, !dbg !53
// ST: Guess
iw(1,0+1*1) = get_rng(0,NCONTEXT-1);// 1 ASSIGN STIW
old_cw = cw(1,0+1*1);
cw(1,0+1*1) = get_rng(0,NCONTEXT-1);// 1 ASSIGN STCOM
// Check
ASSUME(active[iw(1,0+1*1)] == 1);
ASSUME(active[cw(1,0+1*1)] == 1);
ASSUME(sforbid(0+1*1,cw(1,0+1*1))== 0);
ASSUME(iw(1,0+1*1) >= 0);
ASSUME(iw(1,0+1*1) >= 0);
ASSUME(cw(1,0+1*1) >= iw(1,0+1*1));
ASSUME(cw(1,0+1*1) >= old_cw);
ASSUME(cw(1,0+1*1) >= cr(1,0+1*1));
ASSUME(cw(1,0+1*1) >= cl[1]);
ASSUME(cw(1,0+1*1) >= cisb[1]);
ASSUME(cw(1,0+1*1) >= cdy[1]);
ASSUME(cw(1,0+1*1) >= cdl[1]);
ASSUME(cw(1,0+1*1) >= cds[1]);
ASSUME(cw(1,0+1*1) >= cctrl[1]);
ASSUME(cw(1,0+1*1) >= caddr[1]);
// Update
caddr[1] = max(caddr[1],0);
buff(1,0+1*1) = 1;
mem(0+1*1,cw(1,0+1*1)) = 1;
co(0+1*1,cw(1,0+1*1))+=1;
delta(0+1*1,cw(1,0+1*1)) = -1;
ASSUME(creturn[1] >= cw(1,0+1*1));
// ret i8* null, !dbg !54
ret_thread_1 = (- 1);
// Dumping thread 2
int ret_thread_2 = 0;
cdy[2] = get_rng(0,NCONTEXT-1);
ASSUME(cdy[2] >= cstart[2]);
T2BLOCK0:
// call void @llvm.dbg.value(metadata i8* %arg, metadata !57, metadata !DIExpression()), !dbg !88
// br label %label_2, !dbg !70
goto T2BLOCK1;
T2BLOCK1:
// call void @llvm.dbg.label(metadata !86), !dbg !90
// call void @llvm.dbg.value(metadata i64* getelementptr inbounds ([2 x i64], [2 x i64]* @vars, i64 0, i64 1), metadata !58, metadata !DIExpression()), !dbg !91
// call void @llvm.dbg.value(metadata i64 2, metadata !60, metadata !DIExpression()), !dbg !91
// store atomic i64 2, i64* getelementptr inbounds ([2 x i64], [2 x i64]* @vars, i64 0, i64 1) monotonic, align 8, !dbg !73
// ST: Guess
iw(2,0+1*1) = get_rng(0,NCONTEXT-1);// 2 ASSIGN STIW
old_cw = cw(2,0+1*1);
cw(2,0+1*1) = get_rng(0,NCONTEXT-1);// 2 ASSIGN STCOM
// Check
ASSUME(active[iw(2,0+1*1)] == 2);
ASSUME(active[cw(2,0+1*1)] == 2);
ASSUME(sforbid(0+1*1,cw(2,0+1*1))== 0);
ASSUME(iw(2,0+1*1) >= 0);
ASSUME(iw(2,0+1*1) >= 0);
ASSUME(cw(2,0+1*1) >= iw(2,0+1*1));
ASSUME(cw(2,0+1*1) >= old_cw);
ASSUME(cw(2,0+1*1) >= cr(2,0+1*1));
ASSUME(cw(2,0+1*1) >= cl[2]);
ASSUME(cw(2,0+1*1) >= cisb[2]);
ASSUME(cw(2,0+1*1) >= cdy[2]);
ASSUME(cw(2,0+1*1) >= cdl[2]);
ASSUME(cw(2,0+1*1) >= cds[2]);
ASSUME(cw(2,0+1*1) >= cctrl[2]);
ASSUME(cw(2,0+1*1) >= caddr[2]);
// Update
caddr[2] = max(caddr[2],0);
buff(2,0+1*1) = 2;
mem(0+1*1,cw(2,0+1*1)) = 2;
co(0+1*1,cw(2,0+1*1))+=1;
delta(0+1*1,cw(2,0+1*1)) = -1;
ASSUME(creturn[2] >= cw(2,0+1*1));
// call void @llvm.dbg.value(metadata i64* getelementptr inbounds ([2 x i64], [2 x i64]* @vars, i64 0, i64 1), metadata !63, metadata !DIExpression()), !dbg !93
// %0 = load atomic i64, i64* getelementptr inbounds ([2 x i64], [2 x i64]* @vars, i64 0, i64 1) monotonic, align 8, !dbg !75
// LD: Guess
old_cr = cr(2,0+1*1);
cr(2,0+1*1) = get_rng(0,NCONTEXT-1);// 2 ASSIGN LDCOM
// Check
ASSUME(active[cr(2,0+1*1)] == 2);
ASSUME(cr(2,0+1*1) >= iw(2,0+1*1));
ASSUME(cr(2,0+1*1) >= 0);
ASSUME(cr(2,0+1*1) >= cdy[2]);
ASSUME(cr(2,0+1*1) >= cisb[2]);
ASSUME(cr(2,0+1*1) >= cdl[2]);
ASSUME(cr(2,0+1*1) >= cl[2]);
// Update
creg_r0 = cr(2,0+1*1);
crmax(2,0+1*1) = max(crmax(2,0+1*1),cr(2,0+1*1));
caddr[2] = max(caddr[2],0);
if(cr(2,0+1*1) < cw(2,0+1*1)) {
r0 = buff(2,0+1*1);
} else {
if(pw(2,0+1*1) != co(0+1*1,cr(2,0+1*1))) {
ASSUME(cr(2,0+1*1) >= old_cr);
}
pw(2,0+1*1) = co(0+1*1,cr(2,0+1*1));
r0 = mem(0+1*1,cr(2,0+1*1));
}
ASSUME(creturn[2] >= cr(2,0+1*1));
// call void @llvm.dbg.value(metadata i64 %0, metadata !65, metadata !DIExpression()), !dbg !93
// %conv = trunc i64 %0 to i32, !dbg !76
// call void @llvm.dbg.value(metadata i32 %conv, metadata !61, metadata !DIExpression()), !dbg !88
// %tobool = icmp ne i32 %conv, 0, !dbg !77
// br i1 %tobool, label %if.then, label %if.else, !dbg !79
old_cctrl = cctrl[2];
cctrl[2] = get_rng(0,NCONTEXT-1);
ASSUME(cctrl[2] >= old_cctrl);
ASSUME(cctrl[2] >= creg_r0);
ASSUME(cctrl[2] >= 0);
if((r0!=0)) {
goto T2BLOCK2;
} else {
goto T2BLOCK3;
}
T2BLOCK2:
// br label %lbl_LC00, !dbg !80
goto T2BLOCK4;
T2BLOCK3:
// br label %lbl_LC00, !dbg !81
goto T2BLOCK4;
T2BLOCK4:
// call void @llvm.dbg.label(metadata !87), !dbg !101
// call void (...) @isb(), !dbg !83
// isb: Guess
cisb[2] = get_rng(0,NCONTEXT-1);
// Check
ASSUME(cisb[2] >= cdy[2]);
ASSUME(cisb[2] >= cctrl[2]);
ASSUME(cisb[2] >= caddr[2]);
ASSUME(creturn[2] >= cisb[2]);
// call void @llvm.dbg.value(metadata i64* getelementptr inbounds ([2 x i64], [2 x i64]* @vars, i64 0, i64 0), metadata !67, metadata !DIExpression()), !dbg !103
// %1 = load atomic i64, i64* getelementptr inbounds ([2 x i64], [2 x i64]* @vars, i64 0, i64 0) monotonic, align 8, !dbg !85
// LD: Guess
old_cr = cr(2,0);
cr(2,0) = get_rng(0,NCONTEXT-1);// 2 ASSIGN LDCOM
// Check
ASSUME(active[cr(2,0)] == 2);
ASSUME(cr(2,0) >= iw(2,0));
ASSUME(cr(2,0) >= 0);
ASSUME(cr(2,0) >= cdy[2]);
ASSUME(cr(2,0) >= cisb[2]);
ASSUME(cr(2,0) >= cdl[2]);
ASSUME(cr(2,0) >= cl[2]);
// Update
creg_r1 = cr(2,0);
crmax(2,0) = max(crmax(2,0),cr(2,0));
caddr[2] = max(caddr[2],0);
if(cr(2,0) < cw(2,0)) {
r1 = buff(2,0);
} else {
if(pw(2,0) != co(0,cr(2,0))) {
ASSUME(cr(2,0) >= old_cr);
}
pw(2,0) = co(0,cr(2,0));
r1 = mem(0,cr(2,0));
}
ASSUME(creturn[2] >= cr(2,0));
// call void @llvm.dbg.value(metadata i64 %1, metadata !69, metadata !DIExpression()), !dbg !103
// %conv4 = trunc i64 %1 to i32, !dbg !86
// call void @llvm.dbg.value(metadata i32 %conv4, metadata !66, metadata !DIExpression()), !dbg !88
// call void @llvm.dbg.value(metadata i64* getelementptr inbounds ([2 x i64], [2 x i64]* @vars, i64 0, i64 0), metadata !71, metadata !DIExpression()), !dbg !106
// %2 = load atomic i64, i64* getelementptr inbounds ([2 x i64], [2 x i64]* @vars, i64 0, i64 0) monotonic, align 8, !dbg !88
// LD: Guess
old_cr = cr(2,0);
cr(2,0) = get_rng(0,NCONTEXT-1);// 2 ASSIGN LDCOM
// Check
ASSUME(active[cr(2,0)] == 2);
ASSUME(cr(2,0) >= iw(2,0));
ASSUME(cr(2,0) >= 0);
ASSUME(cr(2,0) >= cdy[2]);
ASSUME(cr(2,0) >= cisb[2]);
ASSUME(cr(2,0) >= cdl[2]);
ASSUME(cr(2,0) >= cl[2]);
// Update
creg_r2 = cr(2,0);
crmax(2,0) = max(crmax(2,0),cr(2,0));
caddr[2] = max(caddr[2],0);
if(cr(2,0) < cw(2,0)) {
r2 = buff(2,0);
} else {
if(pw(2,0) != co(0,cr(2,0))) {
ASSUME(cr(2,0) >= old_cr);
}
pw(2,0) = co(0,cr(2,0));
r2 = mem(0,cr(2,0));
}
ASSUME(creturn[2] >= cr(2,0));
// call void @llvm.dbg.value(metadata i64 %2, metadata !73, metadata !DIExpression()), !dbg !106
// %conv8 = trunc i64 %2 to i32, !dbg !89
// call void @llvm.dbg.value(metadata i32 %conv8, metadata !70, metadata !DIExpression()), !dbg !88
// %cmp = icmp eq i32 %conv, 2, !dbg !90
// %conv9 = zext i1 %cmp to i32, !dbg !90
// call void @llvm.dbg.value(metadata i32 %conv9, metadata !74, metadata !DIExpression()), !dbg !88
// call void @llvm.dbg.value(metadata i64* @atom_1_X2_2, metadata !75, metadata !DIExpression()), !dbg !110
// %3 = zext i32 %conv9 to i64
// call void @llvm.dbg.value(metadata i64 %3, metadata !77, metadata !DIExpression()), !dbg !110
// store atomic i64 %3, i64* @atom_1_X2_2 seq_cst, align 8, !dbg !92
// ST: Guess
iw(2,2) = get_rng(0,NCONTEXT-1);// 2 ASSIGN STIW
old_cw = cw(2,2);
cw(2,2) = get_rng(0,NCONTEXT-1);// 2 ASSIGN STCOM
// Check
ASSUME(active[iw(2,2)] == 2);
ASSUME(active[cw(2,2)] == 2);
ASSUME(sforbid(2,cw(2,2))== 0);
ASSUME(iw(2,2) >= max(creg_r0,0));
ASSUME(iw(2,2) >= 0);
ASSUME(cw(2,2) >= iw(2,2));
ASSUME(cw(2,2) >= old_cw);
ASSUME(cw(2,2) >= cr(2,2));
ASSUME(cw(2,2) >= cl[2]);
ASSUME(cw(2,2) >= cisb[2]);
ASSUME(cw(2,2) >= cdy[2]);
ASSUME(cw(2,2) >= cdl[2]);
ASSUME(cw(2,2) >= cds[2]);
ASSUME(cw(2,2) >= cctrl[2]);
ASSUME(cw(2,2) >= caddr[2]);
// Update
caddr[2] = max(caddr[2],0);
buff(2,2) = (r0==2);
mem(2,cw(2,2)) = (r0==2);
co(2,cw(2,2))+=1;
delta(2,cw(2,2)) = -1;
ASSUME(creturn[2] >= cw(2,2));
// %cmp13 = icmp eq i32 %conv4, 0, !dbg !93
// %conv14 = zext i1 %cmp13 to i32, !dbg !93
// call void @llvm.dbg.value(metadata i32 %conv14, metadata !78, metadata !DIExpression()), !dbg !88
// call void @llvm.dbg.value(metadata i64* @atom_1_X3_0, metadata !79, metadata !DIExpression()), !dbg !113
// %4 = zext i32 %conv14 to i64
// call void @llvm.dbg.value(metadata i64 %4, metadata !81, metadata !DIExpression()), !dbg !113
// store atomic i64 %4, i64* @atom_1_X3_0 seq_cst, align 8, !dbg !95
// ST: Guess
iw(2,3) = get_rng(0,NCONTEXT-1);// 2 ASSIGN STIW
old_cw = cw(2,3);
cw(2,3) = get_rng(0,NCONTEXT-1);// 2 ASSIGN STCOM
// Check
ASSUME(active[iw(2,3)] == 2);
ASSUME(active[cw(2,3)] == 2);
ASSUME(sforbid(3,cw(2,3))== 0);
ASSUME(iw(2,3) >= max(creg_r1,0));
ASSUME(iw(2,3) >= 0);
ASSUME(cw(2,3) >= iw(2,3));
ASSUME(cw(2,3) >= old_cw);
ASSUME(cw(2,3) >= cr(2,3));
ASSUME(cw(2,3) >= cl[2]);
ASSUME(cw(2,3) >= cisb[2]);
ASSUME(cw(2,3) >= cdy[2]);
ASSUME(cw(2,3) >= cdl[2]);
ASSUME(cw(2,3) >= cds[2]);
ASSUME(cw(2,3) >= cctrl[2]);
ASSUME(cw(2,3) >= caddr[2]);
// Update
caddr[2] = max(caddr[2],0);
buff(2,3) = (r1==0);
mem(3,cw(2,3)) = (r1==0);
co(3,cw(2,3))+=1;
delta(3,cw(2,3)) = -1;
ASSUME(creturn[2] >= cw(2,3));
// %cmp18 = icmp eq i32 %conv8, 1, !dbg !96
// %conv19 = zext i1 %cmp18 to i32, !dbg !96
// call void @llvm.dbg.value(metadata i32 %conv19, metadata !82, metadata !DIExpression()), !dbg !88
// call void @llvm.dbg.value(metadata i64* @atom_1_X5_1, metadata !83, metadata !DIExpression()), !dbg !116
// %5 = zext i32 %conv19 to i64
// call void @llvm.dbg.value(metadata i64 %5, metadata !85, metadata !DIExpression()), !dbg !116
// store atomic i64 %5, i64* @atom_1_X5_1 seq_cst, align 8, !dbg !98
// ST: Guess
iw(2,4) = get_rng(0,NCONTEXT-1);// 2 ASSIGN STIW
old_cw = cw(2,4);
cw(2,4) = get_rng(0,NCONTEXT-1);// 2 ASSIGN STCOM
// Check
ASSUME(active[iw(2,4)] == 2);
ASSUME(active[cw(2,4)] == 2);
ASSUME(sforbid(4,cw(2,4))== 0);
ASSUME(iw(2,4) >= max(creg_r2,0));
ASSUME(iw(2,4) >= 0);
ASSUME(cw(2,4) >= iw(2,4));
ASSUME(cw(2,4) >= old_cw);
ASSUME(cw(2,4) >= cr(2,4));
ASSUME(cw(2,4) >= cl[2]);
ASSUME(cw(2,4) >= cisb[2]);
ASSUME(cw(2,4) >= cdy[2]);
ASSUME(cw(2,4) >= cdl[2]);
ASSUME(cw(2,4) >= cds[2]);
ASSUME(cw(2,4) >= cctrl[2]);
ASSUME(cw(2,4) >= caddr[2]);
// Update
caddr[2] = max(caddr[2],0);
buff(2,4) = (r2==1);
mem(4,cw(2,4)) = (r2==1);
co(4,cw(2,4))+=1;
delta(4,cw(2,4)) = -1;
ASSUME(creturn[2] >= cw(2,4));
// ret i8* null, !dbg !99
ret_thread_2 = (- 1);
// Dumping thread 3
int ret_thread_3 = 0;
cdy[3] = get_rng(0,NCONTEXT-1);
ASSUME(cdy[3] >= cstart[3]);
T3BLOCK0:
// call void @llvm.dbg.value(metadata i8* %arg, metadata !121, metadata !DIExpression()), !dbg !126
// br label %label_3, !dbg !44
goto T3BLOCK1;
T3BLOCK1:
// call void @llvm.dbg.label(metadata !125), !dbg !128
// call void @llvm.dbg.value(metadata i64* getelementptr inbounds ([2 x i64], [2 x i64]* @vars, i64 0, i64 0), metadata !122, metadata !DIExpression()), !dbg !129
// call void @llvm.dbg.value(metadata i64 1, metadata !124, metadata !DIExpression()), !dbg !129
// store atomic i64 1, i64* getelementptr inbounds ([2 x i64], [2 x i64]* @vars, i64 0, i64 0) monotonic, align 8, !dbg !47
// ST: Guess
iw(3,0) = get_rng(0,NCONTEXT-1);// 3 ASSIGN STIW
old_cw = cw(3,0);
cw(3,0) = get_rng(0,NCONTEXT-1);// 3 ASSIGN STCOM
// Check
ASSUME(active[iw(3,0)] == 3);
ASSUME(active[cw(3,0)] == 3);
ASSUME(sforbid(0,cw(3,0))== 0);
ASSUME(iw(3,0) >= 0);
ASSUME(iw(3,0) >= 0);
ASSUME(cw(3,0) >= iw(3,0));
ASSUME(cw(3,0) >= old_cw);
ASSUME(cw(3,0) >= cr(3,0));
ASSUME(cw(3,0) >= cl[3]);
ASSUME(cw(3,0) >= cisb[3]);
ASSUME(cw(3,0) >= cdy[3]);
ASSUME(cw(3,0) >= cdl[3]);
ASSUME(cw(3,0) >= cds[3]);
ASSUME(cw(3,0) >= cctrl[3]);
ASSUME(cw(3,0) >= caddr[3]);
// Update
caddr[3] = max(caddr[3],0);
buff(3,0) = 1;
mem(0,cw(3,0)) = 1;
co(0,cw(3,0))+=1;
delta(0,cw(3,0)) = -1;
ASSUME(creturn[3] >= cw(3,0));
// ret i8* null, !dbg !48
ret_thread_3 = (- 1);
// Dumping thread 0
int ret_thread_0 = 0;
cdy[0] = get_rng(0,NCONTEXT-1);
ASSUME(cdy[0] >= cstart[0]);
T0BLOCK0:
// %thr0 = alloca i64, align 8
// %thr1 = alloca i64, align 8
// %thr2 = alloca i64, align 8
// call void @llvm.dbg.value(metadata i32 %argc, metadata !139, metadata !DIExpression()), !dbg !188
// call void @llvm.dbg.value(metadata i8** %argv, metadata !140, metadata !DIExpression()), !dbg !188
// %0 = bitcast i64* %thr0 to i8*, !dbg !92
// call void @llvm.lifetime.start.p0i8(i64 8, i8* %0) #7, !dbg !92
// call void @llvm.dbg.declare(metadata i64* %thr0, metadata !141, metadata !DIExpression()), !dbg !190
// %1 = bitcast i64* %thr1 to i8*, !dbg !94
// call void @llvm.lifetime.start.p0i8(i64 8, i8* %1) #7, !dbg !94
// call void @llvm.dbg.declare(metadata i64* %thr1, metadata !145, metadata !DIExpression()), !dbg !192
// %2 = bitcast i64* %thr2 to i8*, !dbg !96
// call void @llvm.lifetime.start.p0i8(i64 8, i8* %2) #7, !dbg !96
// call void @llvm.dbg.declare(metadata i64* %thr2, metadata !146, metadata !DIExpression()), !dbg !194
// call void @llvm.dbg.value(metadata i64* getelementptr inbounds ([2 x i64], [2 x i64]* @vars, i64 0, i64 1), metadata !147, metadata !DIExpression()), !dbg !195
// call void @llvm.dbg.value(metadata i64 0, metadata !149, metadata !DIExpression()), !dbg !195
// store atomic i64 0, i64* getelementptr inbounds ([2 x i64], [2 x i64]* @vars, i64 0, i64 1) monotonic, align 8, !dbg !99
// ST: Guess
iw(0,0+1*1) = get_rng(0,NCONTEXT-1);// 0 ASSIGN STIW
old_cw = cw(0,0+1*1);
cw(0,0+1*1) = get_rng(0,NCONTEXT-1);// 0 ASSIGN STCOM
// Check
ASSUME(active[iw(0,0+1*1)] == 0);
ASSUME(active[cw(0,0+1*1)] == 0);
ASSUME(sforbid(0+1*1,cw(0,0+1*1))== 0);
ASSUME(iw(0,0+1*1) >= 0);
ASSUME(iw(0,0+1*1) >= 0);
ASSUME(cw(0,0+1*1) >= iw(0,0+1*1));
ASSUME(cw(0,0+1*1) >= old_cw);
ASSUME(cw(0,0+1*1) >= cr(0,0+1*1));
ASSUME(cw(0,0+1*1) >= cl[0]);
ASSUME(cw(0,0+1*1) >= cisb[0]);
ASSUME(cw(0,0+1*1) >= cdy[0]);
ASSUME(cw(0,0+1*1) >= cdl[0]);
ASSUME(cw(0,0+1*1) >= cds[0]);
ASSUME(cw(0,0+1*1) >= cctrl[0]);
ASSUME(cw(0,0+1*1) >= caddr[0]);
// Update
caddr[0] = max(caddr[0],0);
buff(0,0+1*1) = 0;
mem(0+1*1,cw(0,0+1*1)) = 0;
co(0+1*1,cw(0,0+1*1))+=1;
delta(0+1*1,cw(0,0+1*1)) = -1;
ASSUME(creturn[0] >= cw(0,0+1*1));
// call void @llvm.dbg.value(metadata i64* getelementptr inbounds ([2 x i64], [2 x i64]* @vars, i64 0, i64 0), metadata !150, metadata !DIExpression()), !dbg !197
// call void @llvm.dbg.value(metadata i64 0, metadata !152, metadata !DIExpression()), !dbg !197
// store atomic i64 0, i64* getelementptr inbounds ([2 x i64], [2 x i64]* @vars, i64 0, i64 0) monotonic, align 8, !dbg !101
// ST: Guess
iw(0,0) = get_rng(0,NCONTEXT-1);// 0 ASSIGN STIW
old_cw = cw(0,0);
cw(0,0) = get_rng(0,NCONTEXT-1);// 0 ASSIGN STCOM
// Check
ASSUME(active[iw(0,0)] == 0);
ASSUME(active[cw(0,0)] == 0);
ASSUME(sforbid(0,cw(0,0))== 0);
ASSUME(iw(0,0) >= 0);
ASSUME(iw(0,0) >= 0);
ASSUME(cw(0,0) >= iw(0,0));
ASSUME(cw(0,0) >= old_cw);
ASSUME(cw(0,0) >= cr(0,0));
ASSUME(cw(0,0) >= cl[0]);
ASSUME(cw(0,0) >= cisb[0]);
ASSUME(cw(0,0) >= cdy[0]);
ASSUME(cw(0,0) >= cdl[0]);
ASSUME(cw(0,0) >= cds[0]);
ASSUME(cw(0,0) >= cctrl[0]);
ASSUME(cw(0,0) >= caddr[0]);
// Update
caddr[0] = max(caddr[0],0);
buff(0,0) = 0;
mem(0,cw(0,0)) = 0;
co(0,cw(0,0))+=1;
delta(0,cw(0,0)) = -1;
ASSUME(creturn[0] >= cw(0,0));
// call void @llvm.dbg.value(metadata i64* @atom_1_X2_2, metadata !153, metadata !DIExpression()), !dbg !199
// call void @llvm.dbg.value(metadata i64 0, metadata !155, metadata !DIExpression()), !dbg !199
// store atomic i64 0, i64* @atom_1_X2_2 monotonic, align 8, !dbg !103
// ST: Guess
iw(0,2) = get_rng(0,NCONTEXT-1);// 0 ASSIGN STIW
old_cw = cw(0,2);
cw(0,2) = get_rng(0,NCONTEXT-1);// 0 ASSIGN STCOM
// Check
ASSUME(active[iw(0,2)] == 0);
ASSUME(active[cw(0,2)] == 0);
ASSUME(sforbid(2,cw(0,2))== 0);
ASSUME(iw(0,2) >= 0);
ASSUME(iw(0,2) >= 0);
ASSUME(cw(0,2) >= iw(0,2));
ASSUME(cw(0,2) >= old_cw);
ASSUME(cw(0,2) >= cr(0,2));
ASSUME(cw(0,2) >= cl[0]);
ASSUME(cw(0,2) >= cisb[0]);
ASSUME(cw(0,2) >= cdy[0]);
ASSUME(cw(0,2) >= cdl[0]);
ASSUME(cw(0,2) >= cds[0]);
ASSUME(cw(0,2) >= cctrl[0]);
ASSUME(cw(0,2) >= caddr[0]);
// Update
caddr[0] = max(caddr[0],0);
buff(0,2) = 0;
mem(2,cw(0,2)) = 0;
co(2,cw(0,2))+=1;
delta(2,cw(0,2)) = -1;
ASSUME(creturn[0] >= cw(0,2));
// call void @llvm.dbg.value(metadata i64* @atom_1_X3_0, metadata !156, metadata !DIExpression()), !dbg !201
// call void @llvm.dbg.value(metadata i64 0, metadata !158, metadata !DIExpression()), !dbg !201
// store atomic i64 0, i64* @atom_1_X3_0 monotonic, align 8, !dbg !105
// ST: Guess
iw(0,3) = get_rng(0,NCONTEXT-1);// 0 ASSIGN STIW
old_cw = cw(0,3);
cw(0,3) = get_rng(0,NCONTEXT-1);// 0 ASSIGN STCOM
// Check
ASSUME(active[iw(0,3)] == 0);
ASSUME(active[cw(0,3)] == 0);
ASSUME(sforbid(3,cw(0,3))== 0);
ASSUME(iw(0,3) >= 0);
ASSUME(iw(0,3) >= 0);
ASSUME(cw(0,3) >= iw(0,3));
ASSUME(cw(0,3) >= old_cw);
ASSUME(cw(0,3) >= cr(0,3));
ASSUME(cw(0,3) >= cl[0]);
ASSUME(cw(0,3) >= cisb[0]);
ASSUME(cw(0,3) >= cdy[0]);
ASSUME(cw(0,3) >= cdl[0]);
ASSUME(cw(0,3) >= cds[0]);
ASSUME(cw(0,3) >= cctrl[0]);
ASSUME(cw(0,3) >= caddr[0]);
// Update
caddr[0] = max(caddr[0],0);
buff(0,3) = 0;
mem(3,cw(0,3)) = 0;
co(3,cw(0,3))+=1;
delta(3,cw(0,3)) = -1;
ASSUME(creturn[0] >= cw(0,3));
// call void @llvm.dbg.value(metadata i64* @atom_1_X5_1, metadata !159, metadata !DIExpression()), !dbg !203
// call void @llvm.dbg.value(metadata i64 0, metadata !161, metadata !DIExpression()), !dbg !203
// store atomic i64 0, i64* @atom_1_X5_1 monotonic, align 8, !dbg !107
// ST: Guess
iw(0,4) = get_rng(0,NCONTEXT-1);// 0 ASSIGN STIW
old_cw = cw(0,4);
cw(0,4) = get_rng(0,NCONTEXT-1);// 0 ASSIGN STCOM
// Check
ASSUME(active[iw(0,4)] == 0);
ASSUME(active[cw(0,4)] == 0);
ASSUME(sforbid(4,cw(0,4))== 0);
ASSUME(iw(0,4) >= 0);
ASSUME(iw(0,4) >= 0);
ASSUME(cw(0,4) >= iw(0,4));
ASSUME(cw(0,4) >= old_cw);
ASSUME(cw(0,4) >= cr(0,4));
ASSUME(cw(0,4) >= cl[0]);
ASSUME(cw(0,4) >= cisb[0]);
ASSUME(cw(0,4) >= cdy[0]);
ASSUME(cw(0,4) >= cdl[0]);
ASSUME(cw(0,4) >= cds[0]);
ASSUME(cw(0,4) >= cctrl[0]);
ASSUME(cw(0,4) >= caddr[0]);
// Update
caddr[0] = max(caddr[0],0);
buff(0,4) = 0;
mem(4,cw(0,4)) = 0;
co(4,cw(0,4))+=1;
delta(4,cw(0,4)) = -1;
ASSUME(creturn[0] >= cw(0,4));
// %call = call i32 @pthread_create(i64* noundef %thr0, %union.pthread_attr_t* noundef null, i8* (i8*)* noundef @t0, i8* noundef null) #7, !dbg !108
// dumbsy: Guess
old_cdy = cdy[0];
cdy[0] = get_rng(0,NCONTEXT-1);
// Check
ASSUME(cdy[0] >= old_cdy);
ASSUME(cdy[0] >= cisb[0]);
ASSUME(cdy[0] >= cdl[0]);
ASSUME(cdy[0] >= cds[0]);
ASSUME(cdy[0] >= cctrl[0]);
ASSUME(cdy[0] >= cw(0,0+0));
ASSUME(cdy[0] >= cw(0,0+1));
ASSUME(cdy[0] >= cw(0,5+0));
ASSUME(cdy[0] >= cw(0,6+0));
ASSUME(cdy[0] >= cw(0,3+0));
ASSUME(cdy[0] >= cw(0,2+0));
ASSUME(cdy[0] >= cw(0,4+0));
ASSUME(cdy[0] >= cw(0,7+0));
ASSUME(cdy[0] >= cr(0,0+0));
ASSUME(cdy[0] >= cr(0,0+1));
ASSUME(cdy[0] >= cr(0,5+0));
ASSUME(cdy[0] >= cr(0,6+0));
ASSUME(cdy[0] >= cr(0,3+0));
ASSUME(cdy[0] >= cr(0,2+0));
ASSUME(cdy[0] >= cr(0,4+0));
ASSUME(cdy[0] >= cr(0,7+0));
ASSUME(creturn[0] >= cdy[0]);
ASSUME(cstart[1] >= cdy[0]);
// %call9 = call i32 @pthread_create(i64* noundef %thr1, %union.pthread_attr_t* noundef null, i8* (i8*)* noundef @t1, i8* noundef null) #7, !dbg !109
// dumbsy: Guess
old_cdy = cdy[0];
cdy[0] = get_rng(0,NCONTEXT-1);
// Check
ASSUME(cdy[0] >= old_cdy);
ASSUME(cdy[0] >= cisb[0]);
ASSUME(cdy[0] >= cdl[0]);
ASSUME(cdy[0] >= cds[0]);
ASSUME(cdy[0] >= cctrl[0]);
ASSUME(cdy[0] >= cw(0,0+0));
ASSUME(cdy[0] >= cw(0,0+1));
ASSUME(cdy[0] >= cw(0,5+0));
ASSUME(cdy[0] >= cw(0,6+0));
ASSUME(cdy[0] >= cw(0,3+0));
ASSUME(cdy[0] >= cw(0,2+0));
ASSUME(cdy[0] >= cw(0,4+0));
ASSUME(cdy[0] >= cw(0,7+0));
ASSUME(cdy[0] >= cr(0,0+0));
ASSUME(cdy[0] >= cr(0,0+1));
ASSUME(cdy[0] >= cr(0,5+0));
ASSUME(cdy[0] >= cr(0,6+0));
ASSUME(cdy[0] >= cr(0,3+0));
ASSUME(cdy[0] >= cr(0,2+0));
ASSUME(cdy[0] >= cr(0,4+0));
ASSUME(cdy[0] >= cr(0,7+0));
ASSUME(creturn[0] >= cdy[0]);
ASSUME(cstart[2] >= cdy[0]);
// %call10 = call i32 @pthread_create(i64* noundef %thr2, %union.pthread_attr_t* noundef null, i8* (i8*)* noundef @t2, i8* noundef null) #7, !dbg !110
// dumbsy: Guess
old_cdy = cdy[0];
cdy[0] = get_rng(0,NCONTEXT-1);
// Check
ASSUME(cdy[0] >= old_cdy);
ASSUME(cdy[0] >= cisb[0]);
ASSUME(cdy[0] >= cdl[0]);
ASSUME(cdy[0] >= cds[0]);
ASSUME(cdy[0] >= cctrl[0]);
ASSUME(cdy[0] >= cw(0,0+0));
ASSUME(cdy[0] >= cw(0,0+1));
ASSUME(cdy[0] >= cw(0,5+0));
ASSUME(cdy[0] >= cw(0,6+0));
ASSUME(cdy[0] >= cw(0,3+0));
ASSUME(cdy[0] >= cw(0,2+0));
ASSUME(cdy[0] >= cw(0,4+0));
ASSUME(cdy[0] >= cw(0,7+0));
ASSUME(cdy[0] >= cr(0,0+0));
ASSUME(cdy[0] >= cr(0,0+1));
ASSUME(cdy[0] >= cr(0,5+0));
ASSUME(cdy[0] >= cr(0,6+0));
ASSUME(cdy[0] >= cr(0,3+0));
ASSUME(cdy[0] >= cr(0,2+0));
ASSUME(cdy[0] >= cr(0,4+0));
ASSUME(cdy[0] >= cr(0,7+0));
ASSUME(creturn[0] >= cdy[0]);
ASSUME(cstart[3] >= cdy[0]);
// %3 = load i64, i64* %thr0, align 8, !dbg !111, !tbaa !112
// LD: Guess
old_cr = cr(0,5);
cr(0,5) = get_rng(0,NCONTEXT-1);// 0 ASSIGN LDCOM
// Check
ASSUME(active[cr(0,5)] == 0);
ASSUME(cr(0,5) >= iw(0,5));
ASSUME(cr(0,5) >= 0);
ASSUME(cr(0,5) >= cdy[0]);
ASSUME(cr(0,5) >= cisb[0]);
ASSUME(cr(0,5) >= cdl[0]);
ASSUME(cr(0,5) >= cl[0]);
// Update
creg_r4 = cr(0,5);
crmax(0,5) = max(crmax(0,5),cr(0,5));
caddr[0] = max(caddr[0],0);
if(cr(0,5) < cw(0,5)) {
r4 = buff(0,5);
} else {
if(pw(0,5) != co(5,cr(0,5))) {
ASSUME(cr(0,5) >= old_cr);
}
pw(0,5) = co(5,cr(0,5));
r4 = mem(5,cr(0,5));
}
ASSUME(creturn[0] >= cr(0,5));
// %call11 = call i32 @pthread_join(i64 noundef %3, i8** noundef null), !dbg !116
// dumbsy: Guess
old_cdy = cdy[0];
cdy[0] = get_rng(0,NCONTEXT-1);
// Check
ASSUME(cdy[0] >= old_cdy);
ASSUME(cdy[0] >= cisb[0]);
ASSUME(cdy[0] >= cdl[0]);
ASSUME(cdy[0] >= cds[0]);
ASSUME(cdy[0] >= cctrl[0]);
ASSUME(cdy[0] >= cw(0,0+0));
ASSUME(cdy[0] >= cw(0,0+1));
ASSUME(cdy[0] >= cw(0,5+0));
ASSUME(cdy[0] >= cw(0,6+0));
ASSUME(cdy[0] >= cw(0,3+0));
ASSUME(cdy[0] >= cw(0,2+0));
ASSUME(cdy[0] >= cw(0,4+0));
ASSUME(cdy[0] >= cw(0,7+0));
ASSUME(cdy[0] >= cr(0,0+0));
ASSUME(cdy[0] >= cr(0,0+1));
ASSUME(cdy[0] >= cr(0,5+0));
ASSUME(cdy[0] >= cr(0,6+0));
ASSUME(cdy[0] >= cr(0,3+0));
ASSUME(cdy[0] >= cr(0,2+0));
ASSUME(cdy[0] >= cr(0,4+0));
ASSUME(cdy[0] >= cr(0,7+0));
ASSUME(creturn[0] >= cdy[0]);
ASSUME(cdy[0] >= creturn[1]);
// %4 = load i64, i64* %thr1, align 8, !dbg !117, !tbaa !112
// LD: Guess
old_cr = cr(0,6);
cr(0,6) = get_rng(0,NCONTEXT-1);// 0 ASSIGN LDCOM
// Check
ASSUME(active[cr(0,6)] == 0);
ASSUME(cr(0,6) >= iw(0,6));
ASSUME(cr(0,6) >= 0);
ASSUME(cr(0,6) >= cdy[0]);
ASSUME(cr(0,6) >= cisb[0]);
ASSUME(cr(0,6) >= cdl[0]);
ASSUME(cr(0,6) >= cl[0]);
// Update
creg_r5 = cr(0,6);
crmax(0,6) = max(crmax(0,6),cr(0,6));
caddr[0] = max(caddr[0],0);
if(cr(0,6) < cw(0,6)) {
r5 = buff(0,6);
} else {
if(pw(0,6) != co(6,cr(0,6))) {
ASSUME(cr(0,6) >= old_cr);
}
pw(0,6) = co(6,cr(0,6));
r5 = mem(6,cr(0,6));
}
ASSUME(creturn[0] >= cr(0,6));
// %call12 = call i32 @pthread_join(i64 noundef %4, i8** noundef null), !dbg !118
// dumbsy: Guess
old_cdy = cdy[0];
cdy[0] = get_rng(0,NCONTEXT-1);
// Check
ASSUME(cdy[0] >= old_cdy);
ASSUME(cdy[0] >= cisb[0]);
ASSUME(cdy[0] >= cdl[0]);
ASSUME(cdy[0] >= cds[0]);
ASSUME(cdy[0] >= cctrl[0]);
ASSUME(cdy[0] >= cw(0,0+0));
ASSUME(cdy[0] >= cw(0,0+1));
ASSUME(cdy[0] >= cw(0,5+0));
ASSUME(cdy[0] >= cw(0,6+0));
ASSUME(cdy[0] >= cw(0,3+0));
ASSUME(cdy[0] >= cw(0,2+0));
ASSUME(cdy[0] >= cw(0,4+0));
ASSUME(cdy[0] >= cw(0,7+0));
ASSUME(cdy[0] >= cr(0,0+0));
ASSUME(cdy[0] >= cr(0,0+1));
ASSUME(cdy[0] >= cr(0,5+0));
ASSUME(cdy[0] >= cr(0,6+0));
ASSUME(cdy[0] >= cr(0,3+0));
ASSUME(cdy[0] >= cr(0,2+0));
ASSUME(cdy[0] >= cr(0,4+0));
ASSUME(cdy[0] >= cr(0,7+0));
ASSUME(creturn[0] >= cdy[0]);
ASSUME(cdy[0] >= creturn[2]);
// %5 = load i64, i64* %thr2, align 8, !dbg !119, !tbaa !112
// LD: Guess
old_cr = cr(0,7);
cr(0,7) = get_rng(0,NCONTEXT-1);// 0 ASSIGN LDCOM
// Check
ASSUME(active[cr(0,7)] == 0);
ASSUME(cr(0,7) >= iw(0,7));
ASSUME(cr(0,7) >= 0);
ASSUME(cr(0,7) >= cdy[0]);
ASSUME(cr(0,7) >= cisb[0]);
ASSUME(cr(0,7) >= cdl[0]);
ASSUME(cr(0,7) >= cl[0]);
// Update
creg_r6 = cr(0,7);
crmax(0,7) = max(crmax(0,7),cr(0,7));
caddr[0] = max(caddr[0],0);
if(cr(0,7) < cw(0,7)) {
r6 = buff(0,7);
} else {
if(pw(0,7) != co(7,cr(0,7))) {
ASSUME(cr(0,7) >= old_cr);
}
pw(0,7) = co(7,cr(0,7));
r6 = mem(7,cr(0,7));
}
ASSUME(creturn[0] >= cr(0,7));
// %call13 = call i32 @pthread_join(i64 noundef %5, i8** noundef null), !dbg !120
// dumbsy: Guess
old_cdy = cdy[0];
cdy[0] = get_rng(0,NCONTEXT-1);
// Check
ASSUME(cdy[0] >= old_cdy);
ASSUME(cdy[0] >= cisb[0]);
ASSUME(cdy[0] >= cdl[0]);
ASSUME(cdy[0] >= cds[0]);
ASSUME(cdy[0] >= cctrl[0]);
ASSUME(cdy[0] >= cw(0,0+0));
ASSUME(cdy[0] >= cw(0,0+1));
ASSUME(cdy[0] >= cw(0,5+0));
ASSUME(cdy[0] >= cw(0,6+0));
ASSUME(cdy[0] >= cw(0,3+0));
ASSUME(cdy[0] >= cw(0,2+0));
ASSUME(cdy[0] >= cw(0,4+0));
ASSUME(cdy[0] >= cw(0,7+0));
ASSUME(cdy[0] >= cr(0,0+0));
ASSUME(cdy[0] >= cr(0,0+1));
ASSUME(cdy[0] >= cr(0,5+0));
ASSUME(cdy[0] >= cr(0,6+0));
ASSUME(cdy[0] >= cr(0,3+0));
ASSUME(cdy[0] >= cr(0,2+0));
ASSUME(cdy[0] >= cr(0,4+0));
ASSUME(cdy[0] >= cr(0,7+0));
ASSUME(creturn[0] >= cdy[0]);
ASSUME(cdy[0] >= creturn[3]);
// call void @llvm.dbg.value(metadata i64* getelementptr inbounds ([2 x i64], [2 x i64]* @vars, i64 0, i64 0), metadata !163, metadata !DIExpression()), !dbg !218
// %6 = load atomic i64, i64* getelementptr inbounds ([2 x i64], [2 x i64]* @vars, i64 0, i64 0) seq_cst, align 8, !dbg !122
// LD: Guess
old_cr = cr(0,0);
cr(0,0) = get_rng(0,NCONTEXT-1);// 0 ASSIGN LDCOM
// Check
ASSUME(active[cr(0,0)] == 0);
ASSUME(cr(0,0) >= iw(0,0));
ASSUME(cr(0,0) >= 0);
ASSUME(cr(0,0) >= cdy[0]);
ASSUME(cr(0,0) >= cisb[0]);
ASSUME(cr(0,0) >= cdl[0]);
ASSUME(cr(0,0) >= cl[0]);
// Update
creg_r7 = cr(0,0);
crmax(0,0) = max(crmax(0,0),cr(0,0));
caddr[0] = max(caddr[0],0);
if(cr(0,0) < cw(0,0)) {
r7 = buff(0,0);
} else {
if(pw(0,0) != co(0,cr(0,0))) {
ASSUME(cr(0,0) >= old_cr);
}
pw(0,0) = co(0,cr(0,0));
r7 = mem(0,cr(0,0));
}
ASSUME(creturn[0] >= cr(0,0));
// call void @llvm.dbg.value(metadata i64 %6, metadata !165, metadata !DIExpression()), !dbg !218
// %conv = trunc i64 %6 to i32, !dbg !123
// call void @llvm.dbg.value(metadata i32 %conv, metadata !162, metadata !DIExpression()), !dbg !188
// %cmp = icmp eq i32 %conv, 2, !dbg !124
// %conv14 = zext i1 %cmp to i32, !dbg !124
// call void @llvm.dbg.value(metadata i32 %conv14, metadata !166, metadata !DIExpression()), !dbg !188
// call void @llvm.dbg.value(metadata i64* getelementptr inbounds ([2 x i64], [2 x i64]* @vars, i64 0, i64 1), metadata !168, metadata !DIExpression()), !dbg !222
// %7 = load atomic i64, i64* getelementptr inbounds ([2 x i64], [2 x i64]* @vars, i64 0, i64 1) seq_cst, align 8, !dbg !126
// LD: Guess
old_cr = cr(0,0+1*1);
cr(0,0+1*1) = get_rng(0,NCONTEXT-1);// 0 ASSIGN LDCOM
// Check
ASSUME(active[cr(0,0+1*1)] == 0);
ASSUME(cr(0,0+1*1) >= iw(0,0+1*1));
ASSUME(cr(0,0+1*1) >= 0);
ASSUME(cr(0,0+1*1) >= cdy[0]);
ASSUME(cr(0,0+1*1) >= cisb[0]);
ASSUME(cr(0,0+1*1) >= cdl[0]);
ASSUME(cr(0,0+1*1) >= cl[0]);
// Update
creg_r8 = cr(0,0+1*1);
crmax(0,0+1*1) = max(crmax(0,0+1*1),cr(0,0+1*1));
caddr[0] = max(caddr[0],0);
if(cr(0,0+1*1) < cw(0,0+1*1)) {
r8 = buff(0,0+1*1);
} else {
if(pw(0,0+1*1) != co(0+1*1,cr(0,0+1*1))) {
ASSUME(cr(0,0+1*1) >= old_cr);
}
pw(0,0+1*1) = co(0+1*1,cr(0,0+1*1));
r8 = mem(0+1*1,cr(0,0+1*1));
}
ASSUME(creturn[0] >= cr(0,0+1*1));
// call void @llvm.dbg.value(metadata i64 %7, metadata !170, metadata !DIExpression()), !dbg !222
// %conv18 = trunc i64 %7 to i32, !dbg !127
// call void @llvm.dbg.value(metadata i32 %conv18, metadata !167, metadata !DIExpression()), !dbg !188
// %cmp19 = icmp eq i32 %conv18, 2, !dbg !128
// %conv20 = zext i1 %cmp19 to i32, !dbg !128
// call void @llvm.dbg.value(metadata i32 %conv20, metadata !171, metadata !DIExpression()), !dbg !188
// call void @llvm.dbg.value(metadata i64* @atom_1_X2_2, metadata !173, metadata !DIExpression()), !dbg !226
// %8 = load atomic i64, i64* @atom_1_X2_2 seq_cst, align 8, !dbg !130
// LD: Guess
old_cr = cr(0,2);
cr(0,2) = get_rng(0,NCONTEXT-1);// 0 ASSIGN LDCOM
// Check
ASSUME(active[cr(0,2)] == 0);
ASSUME(cr(0,2) >= iw(0,2));
ASSUME(cr(0,2) >= 0);
ASSUME(cr(0,2) >= cdy[0]);
ASSUME(cr(0,2) >= cisb[0]);
ASSUME(cr(0,2) >= cdl[0]);
ASSUME(cr(0,2) >= cl[0]);
// Update
creg_r9 = cr(0,2);
crmax(0,2) = max(crmax(0,2),cr(0,2));
caddr[0] = max(caddr[0],0);
if(cr(0,2) < cw(0,2)) {
r9 = buff(0,2);
} else {
if(pw(0,2) != co(2,cr(0,2))) {
ASSUME(cr(0,2) >= old_cr);
}
pw(0,2) = co(2,cr(0,2));
r9 = mem(2,cr(0,2));
}
ASSUME(creturn[0] >= cr(0,2));
// call void @llvm.dbg.value(metadata i64 %8, metadata !175, metadata !DIExpression()), !dbg !226
// %conv24 = trunc i64 %8 to i32, !dbg !131
// call void @llvm.dbg.value(metadata i32 %conv24, metadata !172, metadata !DIExpression()), !dbg !188
// call void @llvm.dbg.value(metadata i64* @atom_1_X3_0, metadata !177, metadata !DIExpression()), !dbg !229
// %9 = load atomic i64, i64* @atom_1_X3_0 seq_cst, align 8, !dbg !133
// LD: Guess
old_cr = cr(0,3);
cr(0,3) = get_rng(0,NCONTEXT-1);// 0 ASSIGN LDCOM
// Check
ASSUME(active[cr(0,3)] == 0);
ASSUME(cr(0,3) >= iw(0,3));
ASSUME(cr(0,3) >= 0);
ASSUME(cr(0,3) >= cdy[0]);
ASSUME(cr(0,3) >= cisb[0]);
ASSUME(cr(0,3) >= cdl[0]);
ASSUME(cr(0,3) >= cl[0]);
// Update
creg_r10 = cr(0,3);
crmax(0,3) = max(crmax(0,3),cr(0,3));
caddr[0] = max(caddr[0],0);
if(cr(0,3) < cw(0,3)) {
r10 = buff(0,3);
} else {
if(pw(0,3) != co(3,cr(0,3))) {
ASSUME(cr(0,3) >= old_cr);
}
pw(0,3) = co(3,cr(0,3));
r10 = mem(3,cr(0,3));
}
ASSUME(creturn[0] >= cr(0,3));
// call void @llvm.dbg.value(metadata i64 %9, metadata !179, metadata !DIExpression()), !dbg !229
// %conv28 = trunc i64 %9 to i32, !dbg !134
// call void @llvm.dbg.value(metadata i32 %conv28, metadata !176, metadata !DIExpression()), !dbg !188
// call void @llvm.dbg.value(metadata i64* @atom_1_X5_1, metadata !181, metadata !DIExpression()), !dbg !232
// %10 = load atomic i64, i64* @atom_1_X5_1 seq_cst, align 8, !dbg !136
// LD: Guess
old_cr = cr(0,4);
cr(0,4) = get_rng(0,NCONTEXT-1);// 0 ASSIGN LDCOM
// Check
ASSUME(active[cr(0,4)] == 0);
ASSUME(cr(0,4) >= iw(0,4));
ASSUME(cr(0,4) >= 0);
ASSUME(cr(0,4) >= cdy[0]);
ASSUME(cr(0,4) >= cisb[0]);
ASSUME(cr(0,4) >= cdl[0]);
ASSUME(cr(0,4) >= cl[0]);
// Update
creg_r11 = cr(0,4);
crmax(0,4) = max(crmax(0,4),cr(0,4));
caddr[0] = max(caddr[0],0);
if(cr(0,4) < cw(0,4)) {
r11 = buff(0,4);
} else {
if(pw(0,4) != co(4,cr(0,4))) {
ASSUME(cr(0,4) >= old_cr);
}
pw(0,4) = co(4,cr(0,4));
r11 = mem(4,cr(0,4));
}
ASSUME(creturn[0] >= cr(0,4));
// call void @llvm.dbg.value(metadata i64 %10, metadata !183, metadata !DIExpression()), !dbg !232
// %conv32 = trunc i64 %10 to i32, !dbg !137
// call void @llvm.dbg.value(metadata i32 %conv32, metadata !180, metadata !DIExpression()), !dbg !188
// %and = and i32 %conv28, %conv32, !dbg !138
creg_r12 = max(creg_r10,creg_r11);
ASSUME(active[creg_r12] == 0);
r12 = r10 & r11;
// call void @llvm.dbg.value(metadata i32 %and, metadata !184, metadata !DIExpression()), !dbg !188
// %and33 = and i32 %conv24, %and, !dbg !139
creg_r13 = max(creg_r9,creg_r12);
ASSUME(active[creg_r13] == 0);
r13 = r9 & r12;
// call void @llvm.dbg.value(metadata i32 %and33, metadata !185, metadata !DIExpression()), !dbg !188
// %and34 = and i32 %conv20, %and33, !dbg !140
creg_r14 = max(max(creg_r8,0),creg_r13);
ASSUME(active[creg_r14] == 0);
r14 = (r8==2) & r13;
// call void @llvm.dbg.value(metadata i32 %and34, metadata !186, metadata !DIExpression()), !dbg !188
// %and35 = and i32 %conv14, %and34, !dbg !141
creg_r15 = max(max(creg_r7,0),creg_r14);
ASSUME(active[creg_r15] == 0);
r15 = (r7==2) & r14;
// call void @llvm.dbg.value(metadata i32 %and35, metadata !187, metadata !DIExpression()), !dbg !188
// %cmp36 = icmp eq i32 %and35, 1, !dbg !142
// br i1 %cmp36, label %if.then, label %if.end, !dbg !144
old_cctrl = cctrl[0];
cctrl[0] = get_rng(0,NCONTEXT-1);
ASSUME(cctrl[0] >= old_cctrl);
ASSUME(cctrl[0] >= creg_r15);
ASSUME(cctrl[0] >= 0);
if((r15==1)) {
goto T0BLOCK1;
} else {
goto T0BLOCK2;
}
T0BLOCK1:
// call void @__assert_fail(i8* noundef getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* noundef getelementptr inbounds ([113 x i8], [113 x i8]* @.str.1, i64 0, i64 0), i32 noundef 81, i8* noundef getelementptr inbounds ([23 x i8], [23 x i8]* @__PRETTY_FUNCTION__.main, i64 0, i64 0)) #8, !dbg !145
// unreachable, !dbg !145
r16 = 1;
T0BLOCK2:
// %11 = bitcast i64* %thr2 to i8*, !dbg !148
// call void @llvm.lifetime.end.p0i8(i64 8, i8* %11) #7, !dbg !148
// %12 = bitcast i64* %thr1 to i8*, !dbg !148
// call void @llvm.lifetime.end.p0i8(i64 8, i8* %12) #7, !dbg !148
// %13 = bitcast i64* %thr0 to i8*, !dbg !148
// call void @llvm.lifetime.end.p0i8(i64 8, i8* %13) #7, !dbg !148
// ret i32 0, !dbg !149
ret_thread_0 = 0;
ASSERT(r16== 0);
}
| [
"tuan-phong.ngo@it.uu.se"
] | tuan-phong.ngo@it.uu.se |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.