blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
3
264
content_id
stringlengths
40
40
detected_licenses
listlengths
0
85
license_type
stringclasses
2 values
repo_name
stringlengths
5
140
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
986 values
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
3.89k
681M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
23 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
145 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
3
10.4M
extension
stringclasses
122 values
content
stringlengths
3
10.4M
authors
listlengths
1
1
author_id
stringlengths
0
158
962942111c1eae176d4290225b72454036cd1be2
4ccf73a7282b56a47b9211e6b759a3d1c0d95463
/src/debug/debug-interface.h
9234fe35acb3ada97147b0c0c350f82a677164da
[ "BSD-3-Clause", "Apache-2.0", "SunPro" ]
permissive
RekGRpth/v8
a83c039904e042d447f6c787a3698482d02987c3
eec34b405e7718657d0ecc2058a8945bf3a5af01
refs/heads/master
2023-08-21T14:00:15.598843
2020-09-17T03:09:31
2020-09-17T04:08:12
296,223,125
1
0
NOASSERTION
2023-07-20T10:26:53
2020-09-17T04:55:50
null
UTF-8
C++
false
false
20,372
h
// Copyright 2016 the V8 project 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 V8_DEBUG_DEBUG_INTERFACE_H_ #define V8_DEBUG_DEBUG_INTERFACE_H_ #include <memory> #include "include/v8-inspector.h" #include "include/v8-util.h" #include "include/v8.h" #include "src/base/platform/time.h" #include "src/common/globals.h" #include "src/debug/interface-types.h" #include "src/utils/vector.h" namespace v8 { namespace internal { struct CoverageBlock; struct CoverageFunction; struct CoverageScript; struct TypeProfileEntry; struct TypeProfileScript; class Coverage; class PostponeInterruptsScope; class Script; class TypeProfile; } // namespace internal namespace debug { void SetContextId(Local<Context> context, int id); int GetContextId(Local<Context> context); void SetInspector(Isolate* isolate, v8_inspector::V8Inspector*); v8_inspector::V8Inspector* GetInspector(Isolate* isolate); // Schedule a debugger break to happen when function is called inside given // isolate. V8_EXPORT_PRIVATE void SetBreakOnNextFunctionCall(Isolate* isolate); // Remove scheduled debugger break in given isolate if it has not // happened yet. V8_EXPORT_PRIVATE void ClearBreakOnNextFunctionCall(Isolate* isolate); /** * Returns array of internal properties specific to the value type. Result has * the following format: [<name>, <value>,...,<name>, <value>]. Result array * will be allocated in the current context. */ MaybeLocal<Array> GetInternalProperties(Isolate* isolate, Local<Value> value); /** * Returns through the out parameters names_out a vector of names * in v8::String for private members, including fields, methods, * accessors specific to the value type. * The values are returned through the out parameter values_out in the * corresponding indices. Private fields and methods are returned directly * while accessors are returned as v8::debug::AccessorPair. Missing components * in the accessor pairs are null. * If an exception occurs, false is returned. Otherwise true is returned. * Results will be allocated in the current context and handle scope. */ V8_EXPORT_PRIVATE bool GetPrivateMembers(Local<Context> context, Local<Object> value, std::vector<Local<Value>>* names_out, std::vector<Local<Value>>* values_out); /** * Forwards to v8::Object::CreationContext, but with special handling for * JSGlobalProxy objects. */ Local<Context> GetCreationContext(Local<Object> value); enum ExceptionBreakState { NoBreakOnException = 0, BreakOnUncaughtException = 1, BreakOnAnyException = 2 }; /** * Defines if VM will pause on exceptions or not. * If BreakOnAnyExceptions is set then VM will pause on caught and uncaught * exception, if BreakOnUncaughtException is set then VM will pause only on * uncaught exception, otherwise VM won't stop on any exception. */ void ChangeBreakOnException(Isolate* isolate, ExceptionBreakState state); void RemoveBreakpoint(Isolate* isolate, BreakpointId id); void SetBreakPointsActive(Isolate* isolate, bool is_active); enum StepAction { StepOut = 0, // Step out of the current function. StepNext = 1, // Step to the next statement in the current function. StepIn = 2 // Step into new functions invoked or the next statement // in the current function. }; void PrepareStep(Isolate* isolate, StepAction action); void ClearStepping(Isolate* isolate); V8_EXPORT_PRIVATE void BreakRightNow(Isolate* isolate); // Use `SetTerminateOnResume` to indicate that an TerminateExecution interrupt // should be set shortly before resuming, i.e. shortly before returning into // the JavaScript stack frames on the stack. In contrast to setting the // interrupt with `RequestTerminateExecution` directly, this flag allows // the isolate to be entered for further JavaScript execution. V8_EXPORT_PRIVATE void SetTerminateOnResume(Isolate* isolate); bool AllFramesOnStackAreBlackboxed(Isolate* isolate); class Script; struct LiveEditResult { enum Status { OK, COMPILE_ERROR, BLOCKED_BY_RUNNING_GENERATOR, BLOCKED_BY_FUNCTION_ABOVE_BREAK_FRAME, BLOCKED_BY_FUNCTION_BELOW_NON_DROPPABLE_FRAME, BLOCKED_BY_ACTIVE_FUNCTION, BLOCKED_BY_NEW_TARGET_IN_RESTART_FRAME, FRAME_RESTART_IS_NOT_SUPPORTED }; Status status = OK; bool stack_changed = false; // Available only for OK. v8::Local<v8::debug::Script> script; // Fields below are available only for COMPILE_ERROR. v8::Local<v8::String> message; int line_number = -1; int column_number = -1; }; /** * Native wrapper around v8::internal::Script object. */ class V8_EXPORT_PRIVATE Script { public: v8::Isolate* GetIsolate() const; ScriptOriginOptions OriginOptions() const; bool WasCompiled() const; bool IsEmbedded() const; int Id() const; int LineOffset() const; int ColumnOffset() const; std::vector<int> LineEnds() const; MaybeLocal<String> Name() const; MaybeLocal<String> SourceURL() const; MaybeLocal<String> SourceMappingURL() const; Maybe<int> ContextId() const; MaybeLocal<String> Source() const; bool IsWasm() const; bool IsModule() const; bool GetPossibleBreakpoints( const debug::Location& start, const debug::Location& end, bool restrict_to_function, std::vector<debug::BreakLocation>* locations) const; int GetSourceOffset(const debug::Location& location) const; v8::debug::Location GetSourceLocation(int offset) const; bool SetScriptSource(v8::Local<v8::String> newSource, bool preview, LiveEditResult* result) const; bool SetBreakpoint(v8::Local<v8::String> condition, debug::Location* location, BreakpointId* id) const; void RemoveWasmBreakpoint(BreakpointId id); bool SetBreakpointOnScriptEntry(BreakpointId* id) const; }; // Specialization for wasm Scripts. class WasmScript : public Script { public: static WasmScript* Cast(Script* script); enum class DebugSymbolsType { None, SourceMap, EmbeddedDWARF, ExternalDWARF }; DebugSymbolsType GetDebugSymbolType() const; MemorySpan<const char> ExternalSymbolsURL() const; int NumFunctions() const; int NumImportedFunctions() const; MemorySpan<const uint8_t> Bytecode() const; std::pair<int, int> GetFunctionRange(int function_index) const; int GetContainingFunction(int byte_offset) const; uint32_t GetFunctionHash(int function_index); int CodeOffset() const; int CodeLength() const; }; V8_EXPORT_PRIVATE void GetLoadedScripts( Isolate* isolate, PersistentValueVector<Script>& scripts); // NOLINT(runtime/references) MaybeLocal<UnboundScript> CompileInspectorScript(Isolate* isolate, Local<String> source); enum ExceptionType { kException, kPromiseRejection }; class DebugDelegate { public: virtual ~DebugDelegate() = default; virtual void ScriptCompiled(v8::Local<Script> script, bool is_live_edited, bool has_compile_error) {} // |inspector_break_points_hit| contains id of breakpoints installed with // debug::Script::SetBreakpoint API. virtual void BreakProgramRequested( v8::Local<v8::Context> paused_context, const std::vector<debug::BreakpointId>& inspector_break_points_hit) {} virtual void ExceptionThrown(v8::Local<v8::Context> paused_context, v8::Local<v8::Value> exception, v8::Local<v8::Value> promise, bool is_uncaught, ExceptionType exception_type) {} virtual bool IsFunctionBlackboxed(v8::Local<debug::Script> script, const debug::Location& start, const debug::Location& end) { return false; } virtual bool ShouldBeSkipped(v8::Local<v8::debug::Script> script, int line, int column) { return false; } }; V8_EXPORT_PRIVATE void SetDebugDelegate(Isolate* isolate, DebugDelegate* listener); V8_EXPORT_PRIVATE void TierDownAllModulesPerIsolate(Isolate* isolate); V8_EXPORT_PRIVATE void TierUpAllModulesPerIsolate(Isolate* isolate); class AsyncEventDelegate { public: virtual ~AsyncEventDelegate() = default; virtual void AsyncEventOccurred(debug::DebugAsyncActionType type, int id, bool is_blackboxed) = 0; }; void SetAsyncEventDelegate(Isolate* isolate, AsyncEventDelegate* delegate); void ResetBlackboxedStateCache(Isolate* isolate, v8::Local<debug::Script> script); int EstimatedValueSize(Isolate* isolate, v8::Local<v8::Value> value); enum Builtin { kStringToLowerCase }; Local<Function> GetBuiltin(Isolate* isolate, Builtin builtin); V8_EXPORT_PRIVATE void SetConsoleDelegate(Isolate* isolate, ConsoleDelegate* delegate); V8_DEPRECATED("See http://crbug.com/v8/10566.") int GetStackFrameId(v8::Local<v8::StackFrame> frame); v8::Local<v8::StackTrace> GetDetailedStackTrace(Isolate* isolate, v8::Local<v8::Object> error); /** * Native wrapper around v8::internal::JSGeneratorObject object. */ class GeneratorObject { public: v8::MaybeLocal<debug::Script> Script(); v8::Local<v8::Function> Function(); debug::Location SuspendedLocation(); bool IsSuspended(); static v8::Local<debug::GeneratorObject> Cast(v8::Local<v8::Value> value); }; /* * Provide API layer between inspector and code coverage. */ class V8_EXPORT_PRIVATE Coverage { public: MOVE_ONLY_NO_DEFAULT_CONSTRUCTOR(Coverage); // Forward declarations. class ScriptData; class FunctionData; class V8_EXPORT_PRIVATE BlockData { public: MOVE_ONLY_NO_DEFAULT_CONSTRUCTOR(BlockData); int StartOffset() const; int EndOffset() const; uint32_t Count() const; private: explicit BlockData(i::CoverageBlock* block, std::shared_ptr<i::Coverage> coverage) : block_(block), coverage_(std::move(coverage)) {} i::CoverageBlock* block_; std::shared_ptr<i::Coverage> coverage_; friend class v8::debug::Coverage::FunctionData; }; class V8_EXPORT_PRIVATE FunctionData { public: MOVE_ONLY_NO_DEFAULT_CONSTRUCTOR(FunctionData); int StartOffset() const; int EndOffset() const; uint32_t Count() const; MaybeLocal<String> Name() const; size_t BlockCount() const; bool HasBlockCoverage() const; BlockData GetBlockData(size_t i) const; private: explicit FunctionData(i::CoverageFunction* function, std::shared_ptr<i::Coverage> coverage) : function_(function), coverage_(std::move(coverage)) {} i::CoverageFunction* function_; std::shared_ptr<i::Coverage> coverage_; friend class v8::debug::Coverage::ScriptData; }; class V8_EXPORT_PRIVATE ScriptData { public: MOVE_ONLY_NO_DEFAULT_CONSTRUCTOR(ScriptData); Local<debug::Script> GetScript() const; size_t FunctionCount() const; FunctionData GetFunctionData(size_t i) const; private: explicit ScriptData(size_t index, std::shared_ptr<i::Coverage> c); i::CoverageScript* script_; std::shared_ptr<i::Coverage> coverage_; friend class v8::debug::Coverage; }; static Coverage CollectPrecise(Isolate* isolate); static Coverage CollectBestEffort(Isolate* isolate); static void SelectMode(Isolate* isolate, CoverageMode mode); size_t ScriptCount() const; ScriptData GetScriptData(size_t i) const; bool IsEmpty() const { return coverage_ == nullptr; } private: explicit Coverage(std::shared_ptr<i::Coverage> coverage) : coverage_(std::move(coverage)) {} std::shared_ptr<i::Coverage> coverage_; }; /* * Provide API layer between inspector and type profile. */ class V8_EXPORT_PRIVATE TypeProfile { public: MOVE_ONLY_NO_DEFAULT_CONSTRUCTOR(TypeProfile); class ScriptData; // Forward declaration. class V8_EXPORT_PRIVATE Entry { public: MOVE_ONLY_NO_DEFAULT_CONSTRUCTOR(Entry); int SourcePosition() const; std::vector<MaybeLocal<String>> Types() const; private: explicit Entry(const i::TypeProfileEntry* entry, std::shared_ptr<i::TypeProfile> type_profile) : entry_(entry), type_profile_(std::move(type_profile)) {} const i::TypeProfileEntry* entry_; std::shared_ptr<i::TypeProfile> type_profile_; friend class v8::debug::TypeProfile::ScriptData; }; class V8_EXPORT_PRIVATE ScriptData { public: MOVE_ONLY_NO_DEFAULT_CONSTRUCTOR(ScriptData); Local<debug::Script> GetScript() const; std::vector<Entry> Entries() const; private: explicit ScriptData(size_t index, std::shared_ptr<i::TypeProfile> type_profile); i::TypeProfileScript* script_; std::shared_ptr<i::TypeProfile> type_profile_; friend class v8::debug::TypeProfile; }; static TypeProfile Collect(Isolate* isolate); static void SelectMode(Isolate* isolate, TypeProfileMode mode); size_t ScriptCount() const; ScriptData GetScriptData(size_t i) const; private: explicit TypeProfile(std::shared_ptr<i::TypeProfile> type_profile) : type_profile_(std::move(type_profile)) {} std::shared_ptr<i::TypeProfile> type_profile_; }; class V8_EXPORT_PRIVATE ScopeIterator { public: static std::unique_ptr<ScopeIterator> CreateForFunction( v8::Isolate* isolate, v8::Local<v8::Function> func); static std::unique_ptr<ScopeIterator> CreateForGeneratorObject( v8::Isolate* isolate, v8::Local<v8::Object> generator); ScopeIterator() = default; virtual ~ScopeIterator() = default; enum ScopeType { ScopeTypeGlobal = 0, ScopeTypeLocal, ScopeTypeWith, ScopeTypeClosure, ScopeTypeCatch, ScopeTypeBlock, ScopeTypeScript, ScopeTypeEval, ScopeTypeModule, ScopeTypeWasmExpressionStack }; virtual bool Done() = 0; virtual void Advance() = 0; virtual ScopeType GetType() = 0; virtual v8::Local<v8::Object> GetObject() = 0; virtual v8::Local<v8::Value> GetFunctionDebugName() = 0; virtual int GetScriptId() = 0; virtual bool HasLocationInfo() = 0; virtual debug::Location GetStartLocation() = 0; virtual debug::Location GetEndLocation() = 0; virtual bool SetVariableValue(v8::Local<v8::String> name, v8::Local<v8::Value> value) = 0; private: DISALLOW_COPY_AND_ASSIGN(ScopeIterator); }; class V8_EXPORT_PRIVATE StackTraceIterator { public: static bool SupportsWasmDebugEvaluate(); static std::unique_ptr<StackTraceIterator> Create(Isolate* isolate, int index = 0); StackTraceIterator() = default; virtual ~StackTraceIterator() = default; virtual bool Done() const = 0; virtual void Advance() = 0; virtual int GetContextId() const = 0; virtual v8::MaybeLocal<v8::Value> GetReceiver() const = 0; virtual v8::Local<v8::Value> GetReturnValue() const = 0; virtual v8::Local<v8::String> GetFunctionDebugName() const = 0; virtual v8::Local<v8::debug::Script> GetScript() const = 0; virtual debug::Location GetSourceLocation() const = 0; virtual v8::Local<v8::Function> GetFunction() const = 0; virtual std::unique_ptr<ScopeIterator> GetScopeIterator() const = 0; virtual bool Restart() = 0; virtual v8::MaybeLocal<v8::Value> Evaluate(v8::Local<v8::String> source, bool throw_on_side_effect) = 0; virtual v8::MaybeLocal<v8::String> EvaluateWasm( internal::Vector<const internal::byte> source, int frame_index) = 0; private: DISALLOW_COPY_AND_ASSIGN(StackTraceIterator); }; class QueryObjectPredicate { public: virtual ~QueryObjectPredicate() = default; virtual bool Filter(v8::Local<v8::Object> object) = 0; }; void QueryObjects(v8::Local<v8::Context> context, QueryObjectPredicate* predicate, v8::PersistentValueVector<v8::Object>* objects); void GlobalLexicalScopeNames(v8::Local<v8::Context> context, v8::PersistentValueVector<v8::String>* names); void SetReturnValue(v8::Isolate* isolate, v8::Local<v8::Value> value); enum class NativeAccessorType { None = 0, HasGetter = 1 << 0, HasSetter = 1 << 1 }; int64_t GetNextRandomInt64(v8::Isolate* isolate); using RuntimeCallCounterCallback = std::function<void(const char* name, int64_t count, base::TimeDelta time)>; void EnumerateRuntimeCallCounters(v8::Isolate* isolate, RuntimeCallCounterCallback callback); enum class EvaluateGlobalMode { kDefault, kDisableBreaks, kDisableBreaksAndThrowOnSideEffect }; V8_EXPORT_PRIVATE v8::MaybeLocal<v8::Value> EvaluateGlobal( v8::Isolate* isolate, v8::Local<v8::String> source, EvaluateGlobalMode mode, bool repl_mode = false); int GetDebuggingId(v8::Local<v8::Function> function); bool SetFunctionBreakpoint(v8::Local<v8::Function> function, v8::Local<v8::String> condition, BreakpointId* id); v8::Platform* GetCurrentPlatform(); void ForceGarbageCollection( v8::Isolate* isolate, v8::EmbedderHeapTracer::EmbedderStackState embedder_stack_state); class PostponeInterruptsScope { public: explicit PostponeInterruptsScope(v8::Isolate* isolate); ~PostponeInterruptsScope(); private: std::unique_ptr<i::PostponeInterruptsScope> scope_; }; class WeakMap : public v8::Object { public: WeakMap() = delete; V8_EXPORT_PRIVATE V8_WARN_UNUSED_RESULT v8::MaybeLocal<v8::Value> Get( v8::Local<v8::Context> context, v8::Local<v8::Value> key); V8_EXPORT_PRIVATE V8_WARN_UNUSED_RESULT v8::MaybeLocal<WeakMap> Set( v8::Local<v8::Context> context, v8::Local<v8::Value> key, v8::Local<v8::Value> value); V8_EXPORT_PRIVATE static Local<WeakMap> New(v8::Isolate* isolate); V8_INLINE static WeakMap* Cast(Value* obj); }; /** * Pairs of accessors. * * In the case of private accessors, getters and setters are either null or * Functions. */ class V8_EXPORT_PRIVATE AccessorPair : public v8::Value { public: AccessorPair() = delete; v8::Local<v8::Value> getter(); v8::Local<v8::Value> setter(); static bool IsAccessorPair(v8::Local<v8::Value> obj); V8_INLINE static AccessorPair* Cast(v8::Value* obj); private: static void CheckCast(v8::Value* obj); }; struct PropertyDescriptor { bool enumerable : 1; bool has_enumerable : 1; bool configurable : 1; bool has_configurable : 1; bool writable : 1; bool has_writable : 1; v8::Local<v8::Value> value; v8::Local<v8::Value> get; v8::Local<v8::Value> set; }; class PropertyIterator { public: static std::unique_ptr<PropertyIterator> Create(v8::Local<v8::Object> object); virtual ~PropertyIterator() = default; virtual bool Done() const = 0; virtual void Advance() = 0; virtual v8::Local<v8::Name> name() const = 0; virtual bool is_native_accessor() = 0; virtual bool has_native_getter() = 0; virtual bool has_native_setter() = 0; virtual Maybe<PropertyAttribute> attributes() = 0; virtual Maybe<PropertyDescriptor> descriptor() = 0; virtual bool is_own() = 0; virtual bool is_array_index() = 0; }; // Wrapper around v8::internal::WasmValue. class V8_EXPORT_PRIVATE WasmValue : public v8::Value { public: WasmValue() = delete; static bool IsWasmValue(v8::Local<v8::Value> obj); V8_INLINE static WasmValue* Cast(v8::Value* obj); int value_type(); // Get the underlying values as a byte array, this is only valid if value_type // is i32, i64, f32, f64, or s128. v8::Local<v8::Array> bytes(); // Get the underlying externref, only valid if value_type is externref. v8::Local<v8::Value> ref(); private: static void CheckCast(v8::Value* obj); }; AccessorPair* AccessorPair::Cast(v8::Value* value) { #ifdef V8_ENABLE_CHECKS CheckCast(value); #endif return static_cast<AccessorPair*>(value); } WasmValue* WasmValue::Cast(v8::Value* value) { #ifdef V8_ENABLE_CHECKS CheckCast(value); #endif return static_cast<WasmValue*>(value); } MaybeLocal<Message> GetMessageFromPromise(Local<Promise> promise); } // namespace debug } // namespace v8 #endif // V8_DEBUG_DEBUG_INTERFACE_H_
[ "commit-bot@chromium.org" ]
commit-bot@chromium.org
6727326109d6174e2eff19c0cb38837b31d43796
c9737f2433be94df20ce6a78605e3168d761391e
/codeup/228.cpp
e67829a4087ed29598128d6c2e51cb3bf9152d3e
[]
no_license
leehosu/coding-test-cpp
b8d0e3f5830e3cf1bd21d7780b8a4ce40ba96a2b
3946ac32d913354119a137f60dbdd89cad7bd852
refs/heads/master
2020-12-02T04:52:09.277796
2020-02-19T11:24:52
2020-02-19T11:24:52
230,893,844
0
0
null
2020-02-19T11:24:53
2019-12-30T10:14:18
C++
UHC
C++
false
false
377
cpp
#include<iostream> #include<math.h> #include<algorithm> using namespace std; int main(){ cin.tie(NULL); ios_base::sync_with_stdio(false); double h, m; cin >> h >> m; double avg_m = (h-100) * 0.9; double bmi = (m - avg_m) * 100 / avg_m ; if(bmi <= 10) cout << "정상"; else if(bmi > 10 && bmi <= 20 ) cout <<"과체중"; else cout << "비만"; return 0; }
[ "48622670+leehosu@users.noreply.github.com" ]
48622670+leehosu@users.noreply.github.com
defc4208ed7302f9ec542393c9c178890034b0f1
000a335b6c8e9719f321fd42f8b791389c8e59d6
/source/common/shader.cpp
44616bb4970c03339b85ae4642aa7bad5557b6b1
[ "MIT" ]
permissive
Abdelrahman-Shahda/Graphics-Project
b7e69e00a644e11c3663619f9aeacaf80e06e731
3d86a24d34c871a20ae2d09ad3a41a6d3621a073
refs/heads/main
2023-04-30T06:43:42.590861
2020-11-07T18:36:33
2020-11-07T18:36:33
369,996,370
0
0
null
null
null
null
UTF-8
C++
false
false
3,460
cpp
#include "shader.hpp" #include <cassert> #include <iostream> #include <filesystem> // Since GLSL doesn't support "#include" preprocessors, we use a library to do it for us called "stb_include" #define STB_INCLUDE_LINE_GLSL #define STB_INCLUDE_IMPLEMENTATION #include <stb/stb_include.h> void GraphicsProject::ShaderProgram::create() { //Create Shader Program program = glCreateProgram(); } void GraphicsProject::ShaderProgram::destroy() { //Delete Shader Program if(program != 0) glDeleteProgram(program); program = 0; } bool GraphicsProject::ShaderProgram::attach(const std::string &filename, GLenum type) const { // first, we use C++17 filesystem library to get the directory (parent) path of the file. // the parent path will be sent to stb_include to search for files referenced by any "#include" preprocessor command. auto file_path = std::filesystem::path(filename); auto file_path_string = file_path.string(); auto parent_path_string = file_path.parent_path().string(); auto path_to_includes = &(parent_path_string[0]); char error[256]; // Read the file as a string and resolve any "#include"s recursively auto source = stb_include_file(&(file_path_string[0]), nullptr, path_to_includes, error); // Check if any loading errors happened if (source == nullptr) { std::cerr << "ERROR: " << error << std::endl; return false; } GLuint shaderID = glCreateShader(type); //Create shader of the given type // Function parameter: // shader (GLuint): shader object name. // count (GLsizei): number of strings passed in the third parameter. We only have one string here. // string (const GLchar**): an array of source code strings. // lengths (const GLint*): an array of string lengths for each string in the third parameter. if null is passed, // then the function will deduce the lengths automatically by searching for '\0'. glShaderSource(shaderID, 1, &source, nullptr); //Send shader source code glCompileShader(shaderID); //Compile the shader code free(source); //Check and log for any error in the compilation process GLint status; glGetShaderiv(shaderID, GL_COMPILE_STATUS, &status); if (!status) { GLint length; glGetShaderiv(shaderID, GL_INFO_LOG_LENGTH, &length); char *logStr = new char[length]; glGetShaderInfoLog(shaderID, length, nullptr, logStr); std::cerr << "ERROR IN " << filename << std::endl; std::cerr << logStr << std::endl; delete[] logStr; glDeleteShader(shaderID); return false; } glAttachShader(program, shaderID); //Attach shader to program glDeleteShader(shaderID); //Delete shader (the shader is already attached to the program so its object is no longer needed) return true; } bool GraphicsProject::ShaderProgram::link() const { //Link glLinkProgram(program); //Check and log for any error in the linking process GLint status; glGetProgramiv(program, GL_LINK_STATUS, &status); if (!status) { GLint length; glGetProgramiv(program, GL_INFO_LOG_LENGTH, &length); char *logStr = new char[length]; glGetProgramInfoLog(program, length, nullptr, logStr); std::cerr << "LINKING ERROR" << std::endl; std::cerr << logStr << std::endl; delete[] logStr; return false; } return true; }
[ "61043093+abdelrahman-elasfar@users.noreply.github.com" ]
61043093+abdelrahman-elasfar@users.noreply.github.com
9b2d8e71b396e2b117516072f96b19d1bb3184d0
5a1a051de47e1371765ffdada5752ad20e5aed31
/AppServer/lib/casablanca/cpprest/http_client.h
068bf437badfe4b737b628cd2e611201ce4270ce
[]
no_license
nicolas-vazquez/tp75521c
94623600354a89908eafb16b2d5530bed47a2655
737d4b0c690969b9cebe42708ed801021207f963
refs/heads/master
2021-01-21T14:43:14.579110
2016-06-25T15:05:36
2016-06-25T15:05:36
58,244,414
0
0
null
null
null
null
UTF-8
C++
false
false
30,173
h
/*** * ==++== * * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * ==--== * =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ * * HTTP Library: Client-side APIs. * * For the latest on this and related APIs, please see: https://github.com/Microsoft/cpprestsdk * * =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- ****/ #pragma once #ifndef _CASA_HTTP_CLIENT_H #define _CASA_HTTP_CLIENT_H #if defined (__cplusplus_winrt) #if !defined(__WRL_NO_DEFAULT_LIB__) #define __WRL_NO_DEFAULT_LIB__ #endif #include <wrl.h> #include <msxml6.h> namespace web { namespace http{namespace client{ typedef IXMLHTTPRequest2* native_handle;}}} #else namespace web { namespace http{namespace client{ typedef void* native_handle;}}} #endif // __cplusplus_winrt #include <memory> #include <limits> #include "casablanca/pplx/pplxtasks.h" #include "http_msg.h" #include "json.h" #include "uri.h" #include "cpprest/details/web_utilities.h" #include "cpprest/details/basic_types.h" #include "asyncrt_utils.h" #if !defined(CPPREST_TARGET_XP) #include "oauth1.h" #endif #include "oauth2.h" #if !defined(_WIN32) && !defined(__cplusplus_winrt) #if defined(__clang__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wconversion" #endif #include "boost/asio/ssl.hpp" #if defined(__clang__) #pragma clang diagnostic pop #endif #endif /// The web namespace contains functionality common to multiple protocols like HTTP and WebSockets. namespace web { /// Declarations and functionality for the HTTP protocol. namespace http { /// HTTP client side library. namespace client { // credentials and web_proxy class has been moved from web::http::client namespace to web namespace. // The below using declarations ensure we don't break existing code. // Please use the web::credentials and web::web_proxy class going forward. using web::credentials; using web::web_proxy; /// <summary> /// HTTP client configuration class, used to set the possible configuration options /// used to create an http_client instance. /// </summary> class http_client_config { public: http_client_config() : m_guarantee_order(false), m_timeout(std::chrono::seconds(30)), m_chunksize(0) #if !defined(__cplusplus_winrt) , m_validate_certificates(true) #endif , m_set_user_nativehandle_options([](native_handle)->void{}) #if !defined(_WIN32) && !defined(__cplusplus_winrt) , m_ssl_context_callback([](boost::asio::ssl::context&)->void{}) , m_tlsext_sni_enabled(true) #endif #if defined(_WIN32) && !defined(__cplusplus_winrt) , m_buffer_request(false) #endif { } #if !defined(CPPREST_TARGET_XP) /// <summary> /// Get OAuth 1.0 configuration. /// </summary> /// <returns>Shared pointer to OAuth 1.0 configuration.</returns> const std::shared_ptr<oauth1::experimental::oauth1_config> oauth1() const { return m_oauth1; } /// <summary> /// Set OAuth 1.0 configuration. /// </summary> /// <param name="config">OAuth 1.0 configuration to set.</param> void set_oauth1(oauth1::experimental::oauth1_config config) { m_oauth1 = std::make_shared<oauth1::experimental::oauth1_config>(std::move(config)); } #endif /// <summary> /// Get OAuth 2.0 configuration. /// </summary> /// <returns>Shared pointer to OAuth 2.0 configuration.</returns> const std::shared_ptr<oauth2::experimental::oauth2_config> oauth2() const { return m_oauth2; } /// <summary> /// Set OAuth 2.0 configuration. /// </summary> /// <param name="config">OAuth 2.0 configuration to set.</param> void set_oauth2(oauth2::experimental::oauth2_config config) { m_oauth2 = std::make_shared<oauth2::experimental::oauth2_config>(std::move(config)); } /// <summary> /// Get the web proxy object /// </summary> /// <returns>A reference to the web proxy object.</returns> const web_proxy& proxy() const { return m_proxy; } /// <summary> /// Set the web proxy object /// </summary> /// <param name="proxy">A reference to the web proxy object.</param> void set_proxy(web_proxy proxy) { m_proxy = std::move(proxy); } /// <summary> /// Get the client credentials /// </summary> /// <returns>A reference to the client credentials.</returns> const http::client::credentials& credentials() const { return m_credentials; } /// <summary> /// Set the client credentials /// </summary> /// <param name="cred">A reference to the client credentials.</param> void set_credentials(const http::client::credentials& cred) { m_credentials = cred; } /// <summary> /// Get the 'guarantee order' property /// </summary> /// <returns>The value of the property.</returns> bool guarantee_order() const { return m_guarantee_order; } /// <summary> /// Set the 'guarantee order' property /// </summary> /// <param name="guarantee_order">The value of the property.</param> CASABLANCA_DEPRECATED("Confusing API will be removed in future releases. If you need to order HTTP requests use task continuations.") void set_guarantee_order(bool guarantee_order) { m_guarantee_order = guarantee_order; } /// <summary> /// Get the timeout /// </summary> /// <returns>The timeout (in seconds) used for each send and receive operation on the client.</returns> utility::seconds timeout() const { return std::chrono::duration_cast<utility::seconds>(m_timeout); } /// <summary> /// Get the timeout /// </summary> /// <returns>The timeout (in whatever duration) used for each send and receive operation on the client.</returns> template <class T> T timeout() const { return std::chrono::duration_cast<T>(m_timeout); } /// <summary> /// Set the timeout /// </summary> /// <param name="timeout">The timeout (duration from microseconds range and up) used for each send and receive operation on the client.</param> template <class T> void set_timeout(const T &timeout) { m_timeout = std::chrono::duration_cast<std::chrono::microseconds>(timeout); } /// <summary> /// Get the client chunk size. /// </summary> /// <returns>The internal buffer size used by the http client when sending and receiving data from the network.</returns> size_t chunksize() const { return m_chunksize == 0 ? 64 * 1024 : m_chunksize; } /// <summary> /// Sets the client chunk size. /// </summary> /// <param name="size">The internal buffer size used by the http client when sending and receiving data from the network.</param> /// <remarks>This is a hint -- an implementation may disregard the setting and use some other chunk size.</remarks> void set_chunksize(size_t size) { m_chunksize = size; } /// <summary> /// Returns true if the default chunk size is in use. /// <remarks>If true, implementations are allowed to choose whatever size is best.</remarks> /// </summary> /// <returns>True if default, false if set by user.</returns> bool is_default_chunksize() const { return m_chunksize == 0; } #if !defined(__cplusplus_winrt) /// <summary> /// Gets the server certificate validation property. /// </summary> /// <returns>True if certificates are to be verified, false otherwise.</returns> bool validate_certificates() const { return m_validate_certificates; } /// <summary> /// Sets the server certificate validation property. /// </summary> /// <param name="validate_certs">False to turn ignore all server certificate validation errors, true otherwise.</param> /// <remarks>Note ignoring certificate errors can be dangerous and should be done with caution.</remarks> void set_validate_certificates(bool validate_certs) { m_validate_certificates = validate_certs; } #endif #ifdef _WIN32 #if !defined(__cplusplus_winrt) /// <summary> /// Checks if request data buffering is turned on, the default is off. /// </summary> /// <returns>True if buffering is enabled, false otherwise</returns> bool buffer_request() const { return m_buffer_request; } /// <summary> /// Sets the request buffering property. /// If true, in cases where the request body/stream doesn't support seeking the request data will be buffered. /// This can help in situations where an authentication challenge might be expected. /// </summary> /// <param name="buffer_request">True to turn on buffer, false otherwise.</param> /// <remarks>Please note there is a performance cost due to copying the request data.</remarks> void set_buffer_request(bool buffer_request) { m_buffer_request = buffer_request; } #endif #endif /// <summary> /// Sets a callback to enable custom setting of platform specific options. /// </summary> /// <remarks> /// The native_handle is the following type depending on the underlying platform: /// Windows Desktop, WinHTTP - HINTERNET /// Windows Runtime, WinRT - IXMLHTTPRequest2 * /// All other platforms, Boost.Asio: /// https - boost::asio::ssl::stream<boost::asio::ip::tcp::socket &> * /// http - boost::asio::ip::tcp::socket * /// </remarks> /// <param name="callback">A user callback allowing for customization of the request</param> void set_nativehandle_options(const std::function<void(native_handle)> &callback) { m_set_user_nativehandle_options = callback; } /// <summary> /// Invokes a user's callback to allow for customization of the request. /// </summary> /// <param name="handle">A internal implementation handle.</param> void invoke_nativehandle_options(native_handle handle) const { m_set_user_nativehandle_options(handle); } #if !defined(_WIN32) && !defined(__cplusplus_winrt) /// <summary> /// Sets a callback to enable custom setting of the ssl context, at construction time. /// </summary> /// <param name="callback">A user callback allowing for customization of the ssl context at construction time.</param> void set_ssl_context_callback(const std::function<void(boost::asio::ssl::context&)>& callback) { m_ssl_context_callback = callback; } /// <summary> /// Gets the user's callback to allow for customization of the ssl context. /// </summary> const std::function<void(boost::asio::ssl::context&)>& get_ssl_context_callback() const { return m_ssl_context_callback; } /// <summary> /// Gets the TLS extension server name indication (SNI) status. /// </summary> /// <returns>True if TLS server name indication is enabled, false otherwise.</returns> bool is_tlsext_sni_enabled() const { return m_tlsext_sni_enabled; } /// <summary> /// Sets the TLS extension server name indication (SNI) status. /// </summary> /// <param name="tlsext_sni_enabled">False to disable the TLS (ClientHello) extension for server name indication, true otherwise.</param> /// <remarks>Note: This setting is enabled by default as it is required in most virtual hosting scenarios.</remarks> void set_tlsext_sni_enabled(bool tlsext_sni_enabled) { m_tlsext_sni_enabled = tlsext_sni_enabled; } #endif private: #if !defined(CPPREST_TARGET_XP) std::shared_ptr<oauth1::experimental::oauth1_config> m_oauth1; #endif std::shared_ptr<oauth2::experimental::oauth2_config> m_oauth2; web_proxy m_proxy; http::client::credentials m_credentials; // Whether or not to guarantee ordering, i.e. only using one underlying TCP connection. bool m_guarantee_order; std::chrono::microseconds m_timeout; size_t m_chunksize; #if !defined(__cplusplus_winrt) // IXmlHttpRequest2 doesn't allow configuration of certificate verification. bool m_validate_certificates; #endif std::function<void(native_handle)> m_set_user_nativehandle_options; #if !defined(_WIN32) && !defined(__cplusplus_winrt) std::function<void(boost::asio::ssl::context&)> m_ssl_context_callback; bool m_tlsext_sni_enabled; #endif #if defined(_WIN32) && !defined(__cplusplus_winrt) bool m_buffer_request; #endif }; /// <summary> /// HTTP client class, used to maintain a connection to an HTTP service for an extended session. /// </summary> class http_client { public: /// <summary> /// Creates a new http_client connected to specified uri. /// </summary> /// <param name="base_uri">A string representation of the base uri to be used for all requests. Must start with either "http://" or "https://"</param> _ASYNCRTIMP http_client(const uri &base_uri); /// <summary> /// Creates a new http_client connected to specified uri. /// </summary> /// <param name="base_uri">A string representation of the base uri to be used for all requests. Must start with either "http://" or "https://"</param> /// <param name="client_config">The http client configuration object containing the possible configuration options to initialize the <c>http_client</c>. </param> _ASYNCRTIMP http_client(const uri &base_uri, const http_client_config &client_config); /// <summary> /// Note the destructor doesn't necessarily close the connection and release resources. /// The connection is reference counted with the http_responses. /// </summary> ~http_client() CPPREST_NOEXCEPT {} /// <summary> /// Gets the base URI. /// </summary> /// <returns> /// A base URI initialized in constructor /// </returns> _ASYNCRTIMP const uri& base_uri() const; /// <summary> /// Get client configuration object /// </summary> /// <returns>A reference to the client configuration object.</returns> _ASYNCRTIMP const http_client_config& client_config() const; /// <summary> /// Adds an HTTP pipeline stage to the client. /// </summary> /// <param name="handler">A function object representing the pipeline stage.</param> void add_handler(const std::function<pplx::task<http_response>(http_request, std::shared_ptr<http::http_pipeline_stage>)> &handler) { m_pipeline->append(std::make_shared<::web::http::details::function_pipeline_wrapper>(handler)); } /// <summary> /// Adds an HTTP pipeline stage to the client. /// </summary> /// <param name="stage">A shared pointer to a pipeline stage.</param> void add_handler(const std::shared_ptr<http::http_pipeline_stage> &stage) { m_pipeline->append(stage); } /// <summary> /// Asynchronously sends an HTTP request. /// </summary> /// <param name="request">Request to send.</param> /// <param name="token">Cancellation token for cancellation of this request operation.</param> /// <returns>An asynchronous operation that is completed once a response from the request is received.</returns> _ASYNCRTIMP pplx::task<http_response> request(http_request request, const pplx::cancellation_token &token = pplx::cancellation_token::none()); /// <summary> /// Asynchronously sends an HTTP request. /// </summary> /// <param name="mtd">HTTP request method.</param> /// <param name="token">Cancellation token for cancellation of this request operation.</param> /// <returns>An asynchronous operation that is completed once a response from the request is received.</returns> pplx::task<http_response> request(const method &mtd, const pplx::cancellation_token &token = pplx::cancellation_token::none()) { http_request msg(mtd); return request(msg, token); } /// <summary> /// Asynchronously sends an HTTP request. /// </summary> /// <param name="mtd">HTTP request method.</param> /// <param name="path_query_fragment">String containing the path, query, and fragment, relative to the http_client's base URI.</param> /// <param name="token">Cancellation token for cancellation of this request operation.</param> /// <returns>An asynchronous operation that is completed once a response from the request is received.</returns> pplx::task<http_response> request( const method &mtd, const utility::string_t &path_query_fragment, const pplx::cancellation_token &token = pplx::cancellation_token::none()) { http_request msg(mtd); msg.set_request_uri(path_query_fragment); return request(msg, token); } /// <summary> /// Asynchronously sends an HTTP request. /// </summary> /// <param name="mtd">HTTP request method.</param> /// <param name="path_query_fragment">String containing the path, query, and fragment, relative to the http_client's base URI.</param> /// <param name="body_data">The data to be used as the message body, represented using the json object library.</param> /// <param name="token">Cancellation token for cancellation of this request operation.</param> /// <returns>An asynchronous operation that is completed once a response from the request is received.</returns> pplx::task<http_response> request( const method &mtd, const utility::string_t &path_query_fragment, const json::value &body_data, const pplx::cancellation_token &token = pplx::cancellation_token::none()) { http_request msg(mtd); msg.set_request_uri(path_query_fragment); msg.set_body(body_data); return request(msg, token); } /// <summary> /// Asynchronously sends an HTTP request with a string body. Assumes the /// character encoding of the string is UTF-8. /// </summary> /// <param name="mtd">HTTP request method.</param> /// <param name="path_query_fragment">String containing the path, query, and fragment, relative to the http_client's base URI.</param> /// <param name="content_type">A string holding the MIME type of the message body.</param> /// <param name="body_data">String containing the text to use in the message body.</param> /// <param name="token">Cancellation token for cancellation of this request operation.</param> /// <returns>An asynchronous operation that is completed once a response from the request is received.</returns> pplx::task<http_response> request( const method &mtd, const utf8string &path_query_fragment, const utf8string &body_data, const utf8string &content_type = "text/plain; charset=utf-8", const pplx::cancellation_token &token = pplx::cancellation_token::none()) { http_request msg(mtd); msg.set_request_uri(::utility::conversions::to_string_t(path_query_fragment)); msg.set_body(body_data, content_type); return request(msg, token); } /// <summary> /// Asynchronously sends an HTTP request with a string body. Assumes the /// character encoding of the string is UTF-8. /// </summary> /// <param name="mtd">HTTP request method.</param> /// <param name="path_query_fragment">String containing the path, query, and fragment, relative to the http_client's base URI.</param> /// <param name="content_type">A string holding the MIME type of the message body.</param> /// <param name="body_data">String containing the text to use in the message body.</param> /// <param name="token">Cancellation token for cancellation of this request operation.</param> /// <returns>An asynchronous operation that is completed once a response from the request is received.</returns> pplx::task<http_response> request( const method &mtd, const utf8string &path_query_fragment, utf8string &&body_data, const utf8string &content_type = "text/plain; charset=utf-8", const pplx::cancellation_token &token = pplx::cancellation_token::none()) { http_request msg(mtd); msg.set_request_uri(::utility::conversions::to_string_t(path_query_fragment)); msg.set_body(std::move(body_data), content_type); return request(msg, token); } /// <summary> /// Asynchronously sends an HTTP request with a string body. Assumes the /// character encoding of the string is UTF-16 will perform conversion to UTF-8. /// </summary> /// <param name="mtd">HTTP request method.</param> /// <param name="path_query_fragment">String containing the path, query, and fragment, relative to the http_client's base URI.</param> /// <param name="content_type">A string holding the MIME type of the message body.</param> /// <param name="body_data">String containing the text to use in the message body.</param> /// <param name="token">Cancellation token for cancellation of this request operation.</param> /// <returns>An asynchronous operation that is completed once a response from the request is received.</returns> pplx::task<http_response> request( const method &mtd, const utf16string &path_query_fragment, const utf16string &body_data, const utf16string &content_type = ::utility::conversions::to_utf16string("text/plain"), const pplx::cancellation_token &token = pplx::cancellation_token::none()) { http_request msg(mtd); msg.set_request_uri(::utility::conversions::to_string_t(path_query_fragment)); msg.set_body(body_data, content_type); return request(msg, token); } /// <summary> /// Asynchronously sends an HTTP request with a string body. Assumes the /// character encoding of the string is UTF-8. /// </summary> /// <param name="mtd">HTTP request method.</param> /// <param name="path_query_fragment">String containing the path, query, and fragment, relative to the http_client's base URI.</param> /// <param name="body_data">String containing the text to use in the message body.</param> /// <param name="token">Cancellation token for cancellation of this request operation.</param> /// <returns>An asynchronous operation that is completed once a response from the request is received.</returns> pplx::task<http_response> request( const method &mtd, const utf8string &path_query_fragment, const utf8string &body_data, const pplx::cancellation_token &token) { return request(mtd, path_query_fragment, body_data, "text/plain; charset=utf-8", token); } /// <summary> /// Asynchronously sends an HTTP request with a string body. Assumes the /// character encoding of the string is UTF-8. /// </summary> /// <param name="mtd">HTTP request method.</param> /// <param name="path_query_fragment">String containing the path, query, and fragment, relative to the http_client's base URI.</param> /// <param name="body_data">String containing the text to use in the message body.</param> /// <param name="token">Cancellation token for cancellation of this request operation.</param> /// <returns>An asynchronous operation that is completed once a response from the request is received.</returns> pplx::task<http_response> request( const method &mtd, const utf8string &path_query_fragment, utf8string &&body_data, const pplx::cancellation_token &token) { http_request msg(mtd); msg.set_request_uri(::utility::conversions::to_string_t(path_query_fragment)); msg.set_body(std::move(body_data), "text/plain; charset=utf-8"); return request(msg, token); } /// <summary> /// Asynchronously sends an HTTP request with a string body. Assumes /// the character encoding of the string is UTF-16 will perform conversion to UTF-8. /// </summary> /// <param name="mtd">HTTP request method.</param> /// <param name="path_query_fragment">String containing the path, query, and fragment, relative to the http_client's base URI.</param> /// <param name="body_data">String containing the text to use in the message body.</param> /// <param name="token">Cancellation token for cancellation of this request operation.</param> /// <returns>An asynchronous operation that is completed once a response from the request is received.</returns> pplx::task<http_response> request( const method &mtd, const utf16string &path_query_fragment, const utf16string &body_data, const pplx::cancellation_token &token) { return request(mtd, path_query_fragment, body_data, ::utility::conversions::to_utf16string("text/plain"), token); } #if !defined (__cplusplus_winrt) /// <summary> /// Asynchronously sends an HTTP request. /// </summary> /// <param name="mtd">HTTP request method.</param> /// <param name="path_query_fragment">String containing the path, query, and fragment, relative to the http_client's base URI.</param> /// <param name="body">An asynchronous stream representing the body data.</param> /// <param name="content_type">A string holding the MIME type of the message body.</param> /// <param name="token">Cancellation token for cancellation of this request operation.</param> /// <returns>A task that is completed once a response from the request is received.</returns> pplx::task<http_response> request( const method &mtd, const utility::string_t &path_query_fragment, const concurrency::streams::istream &body, const utility::string_t &content_type = _XPLATSTR("application/octet-stream"), const pplx::cancellation_token &token = pplx::cancellation_token::none()) { http_request msg(mtd); msg.set_request_uri(path_query_fragment); msg.set_body(body, content_type); return request(msg, token); } /// <summary> /// Asynchronously sends an HTTP request. /// </summary> /// <param name="mtd">HTTP request method.</param> /// <param name="path_query_fragment">String containing the path, query, and fragment, relative to the http_client's base URI.</param> /// <param name="body">An asynchronous stream representing the body data.</param> /// <param name="token">Cancellation token for cancellation of this request operation.</param> /// <returns>A task that is completed once a response from the request is received.</returns> pplx::task<http_response> request( const method &mtd, const utility::string_t &path_query_fragment, const concurrency::streams::istream &body, const pplx::cancellation_token &token) { return request(mtd, path_query_fragment, body, _XPLATSTR("application/octet-stream"), token); } #endif // __cplusplus_winrt /// <summary> /// Asynchronously sends an HTTP request. /// </summary> /// <param name="mtd">HTTP request method.</param> /// <param name="path_query_fragment">String containing the path, query, and fragment, relative to the http_client's base URI.</param> /// <param name="body">An asynchronous stream representing the body data.</param> /// <param name="content_length">Size of the message body.</param> /// <param name="content_type">A string holding the MIME type of the message body.</param> /// <param name="token">Cancellation token for cancellation of this request operation.</param> /// <returns>A task that is completed once a response from the request is received.</returns> /// <remarks>Winrt requires to provide content_length.</remarks> pplx::task<http_response> request( const method &mtd, const utility::string_t &path_query_fragment, const concurrency::streams::istream &body, size_t content_length, const utility::string_t &content_type = _XPLATSTR("application/octet-stream"), const pplx::cancellation_token &token = pplx::cancellation_token::none()) { http_request msg(mtd); msg.set_request_uri(path_query_fragment); msg.set_body(body, content_length, content_type); return request(msg, token); } /// <summary> /// Asynchronously sends an HTTP request. /// </summary> /// <param name="mtd">HTTP request method.</param> /// <param name="path_query_fragment">String containing the path, query, and fragment, relative to the http_client's base URI.</param> /// <param name="body">An asynchronous stream representing the body data.</param> /// <param name="content_length">Size of the message body.</param> /// <param name="token">Cancellation token for cancellation of this request operation.</param> /// <returns>A task that is completed once a response from the request is received.</returns> /// <remarks>Winrt requires to provide content_length.</remarks> pplx::task<http_response> request( const method &mtd, const utility::string_t &path_query_fragment, const concurrency::streams::istream &body, size_t content_length, const pplx::cancellation_token &token) { return request(mtd, path_query_fragment, body, content_length, _XPLATSTR("application/octet-stream"), token); } private: void build_pipeline(const uri &base_uri, const http_client_config &client_config); std::shared_ptr<::web::http::http_pipeline> m_pipeline; }; }}} #endif
[ "74123698Fede" ]
74123698Fede
6b75463e783720d7dac99b82b18c6c0b73044ef0
b2ad870194ffc177b783062d200ca4b527d2363f
/thrift/lib/cpp2/async/ClientChannel.cpp
2c65b8d23ca31f54f98fe843d4ada823423f6d0e
[ "Apache-2.0" ]
permissive
strogo/fbthrift
629dcaf2d7a7ce435546776a6d2d15e866153ed4
818696ff46c062dc82766cedc05955c86cadb657
refs/heads/master
2023-09-01T03:51:45.694587
2021-10-02T05:42:40
2021-10-02T05:43:58
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,603
cpp
/* * Copyright (c) Facebook, Inc. and its affiliates. * * 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 <thrift/lib/cpp2/async/ClientChannel.h> #ifdef __linux__ #include <sys/utsname.h> #endif #include <thrift/lib/cpp2/Flags.h> #include <thrift/lib/cpp2/PluggableFunction.h> THRIFT_FLAG_DEFINE_int64(thrift_client_checksum_sampling_rate, 0); namespace apache { namespace thrift { ClientChannel::ClientChannel() { setChecksumSamplingRate(THRIFT_FLAG(thrift_client_checksum_sampling_rate)); } namespace detail { THRIFT_PLUGGABLE_FUNC_REGISTER(ClientHostMetadata, getClientHostMetadata) { ClientHostMetadata hostMetadata; #ifdef __linux__ struct utsname bufs; ::uname(&bufs); hostMetadata.hostname = bufs.nodename; #endif return hostMetadata; } } // namespace detail /* static */ const std::optional<ClientHostMetadata>& ClientChannel::getHostMetadata() { static const auto& hostMetadata = *new std::optional<ClientHostMetadata>{ detail::THRIFT_PLUGGABLE_FUNC(getClientHostMetadata)()}; return hostMetadata; } } // namespace thrift } // namespace apache
[ "facebook-github-bot@users.noreply.github.com" ]
facebook-github-bot@users.noreply.github.com
434cf841ed2c90c15de41a3edfe333abc62861e9
4ccadd5be8d3ffa1aaffe528b0786a8a956128aa
/paddle/fluid/inference/tests/api/trt_dynamic_shape_ernie_test.cc
52b3d2abd30dff766522aadd27f8d502e840d015
[ "Apache-2.0" ]
permissive
yaoxuefeng6/Paddle
1844879647cca7d725b34f2ddf3be65600f5b321
e58619295e82b86795da6d29587a17a3efdc486a
refs/heads/develop
2022-09-06T19:17:26.502784
2020-05-13T03:05:26
2020-05-13T03:05:26
192,290,841
1
0
Apache-2.0
2022-05-23T10:02:47
2019-06-17T06:51:06
C++
UTF-8
C++
false
false
5,633
cc
/* Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #include <gflags/gflags.h> #include <glog/logging.h> #include <gtest/gtest.h> #include "paddle/fluid/inference/tests/api/trt_test_helper.h" namespace paddle { namespace inference { void run(const AnalysisConfig& config, std::vector<float>* out_data) { auto predictor = CreatePaddlePredictor(config); auto input_names = predictor->GetInputNames(); int run_batch = 1; const int run_seq_len = 128; std::vector<int64_t> tmp_input; std::vector<float> tmp_four_input; tmp_input.reserve(run_batch * run_seq_len); tmp_four_input.reserve(run_batch * run_seq_len); int64_t i0[run_seq_len] = { 1, 3558, 4, 75, 491, 89, 340, 313, 93, 4, 255, 10, 75, 321, 4095, 1902, 4, 134, 49, 75, 311, 14, 44, 178, 543, 15, 12043, 2, 75, 201, 340, 9, 14, 44, 486, 218, 1140, 279, 12043, 2}; int64_t i1[run_seq_len] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; int64_t i2[run_seq_len] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39}; float i3[run_seq_len] = {1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0}; // first input auto input_t = predictor->GetInputTensor(input_names[0]); input_t->Reshape({run_batch, run_seq_len, 1}); input_t->copy_from_cpu(i0); // second input auto input_t2 = predictor->GetInputTensor(input_names[1]); input_t2->Reshape({run_batch, run_seq_len, 1}); input_t2->copy_from_cpu(i1); // third input. auto input_t3 = predictor->GetInputTensor(input_names[2]); input_t3->Reshape({run_batch, run_seq_len, 1}); input_t3->copy_from_cpu(i2); auto input_t4 = predictor->GetInputTensor(input_names[3]); input_t4->Reshape({run_batch, run_seq_len, 1}); input_t4->copy_from_cpu(i3); ASSERT_TRUE(predictor->ZeroCopyRun()); auto output_names = predictor->GetOutputNames(); auto output_t = predictor->GetOutputTensor(output_names[0]); std::vector<int> output_shape = output_t->shape(); int out_num = std::accumulate(output_shape.begin(), output_shape.end(), 1, std::multiplies<int>()); out_data->resize(out_num); output_t->copy_to_cpu(out_data->data()); } void trt_ernie(bool with_fp16, std::vector<float> result) { AnalysisConfig config; std::string model_dir = FLAGS_infer_model; SetConfig(&config, model_dir, true /* use_gpu */); config.SwitchUseFeedFetchOps(false); int head_number = 12; int batch = 1; int min_seq_len = 1; int max_seq_len = 128; int opt_seq_len = 128; std::vector<int> min_shape = {batch, min_seq_len, 1}; std::vector<int> max_shape = {batch, max_seq_len, 1}; std::vector<int> opt_shape = {batch, opt_seq_len, 1}; // Set the input's min, max, opt shape std::map<std::string, std::vector<int>> min_input_shape = { {"read_file_0.tmp_0", min_shape}, {"read_file_0.tmp_1", min_shape}, {"read_file_0.tmp_2", min_shape}, {"stack_0.tmp_0", {batch, head_number, min_seq_len, min_seq_len}}}; std::map<std::string, std::vector<int>> max_input_shape = { {"read_file_0.tmp_0", max_shape}, {"read_file_0.tmp_1", max_shape}, {"read_file_0.tmp_2", max_shape}, {"stack_0.tmp_0", {batch, head_number, max_seq_len, max_seq_len}}}; std::map<std::string, std::vector<int>> opt_input_shape = { {"read_file_0.tmp_0", opt_shape}, {"read_file_0.tmp_1", opt_shape}, {"read_file_0.tmp_2", opt_shape}, {"stack_0.tmp_0", {batch, head_number, opt_seq_len, opt_seq_len}}}; auto precision = AnalysisConfig::Precision::kFloat32; if (with_fp16) { precision = AnalysisConfig::Precision::kHalf; } config.EnableTensorRtEngine(1 << 30, 1, 1, precision, false, true); config.SetTRTDynamicShapeInfo(min_input_shape, max_input_shape, opt_input_shape); std::vector<float> out_data; run(config, &out_data); for (size_t i = 0; i < out_data.size(); i++) { EXPECT_NEAR(result[i], out_data[i], 1e-6); } } TEST(AnalysisPredictor, no_fp16) { std::vector<float> result = {0.597841, 0.219972, 0.182187}; trt_ernie(false, result); } TEST(AnalysisPredictor, fp16) { #ifdef SUPPORTS_CUDA_FP16 std::vector<float> result = {0.598336, 0.219558, 0.182106}; trt_ernie(true, result); #endif } } // namespace inference } // namespace paddle
[ "noreply@github.com" ]
yaoxuefeng6.noreply@github.com
d2945cb53ea1029c9c13de54156b945c1da02c3f
0619c96beb1d46e813d5171755c856ea378916b5
/SerialTestUI/debug/moc_mainwindow.cpp
1fcc2627262f4342bc72a3e40184c91805b20ce4
[]
no_license
Neuromancer2701/irrigationgui
d8f77eb299d1beadc04222e1663459fbdff123cc
9da8610a1f81aa47506a30da0f1fc94cac447129
refs/heads/master
2020-04-09T02:08:11.897300
2011-03-17T00:11:08
2011-03-17T00:11:08
32,092,689
0
0
null
null
null
null
UTF-8
C++
false
false
2,548
cpp
/**************************************************************************** ** Meta object code from reading C++ file 'mainwindow.h' ** ** Created: Sun Sep 26 22:08:32 2010 ** by: The Qt Meta Object Compiler version 62 (Qt 4.6.1) ** ** WARNING! All changes made in this file will be lost! *****************************************************************************/ #include "../mainwindow.h" #if !defined(Q_MOC_OUTPUT_REVISION) #error "The header file 'mainwindow.h' doesn't include <QObject>." #elif Q_MOC_OUTPUT_REVISION != 62 #error "This file was generated using the moc from 4.6.1. It" #error "cannot be used with the include files from this version of Qt." #error "(The moc has changed too much.)" #endif QT_BEGIN_MOC_NAMESPACE static const uint qt_meta_data_MainWindow[] = { // content: 4, // revision 0, // classname 0, 0, // classinfo 2, 14, // methods 0, 0, // properties 0, 0, // enums/sets 0, 0, // constructors 0, // flags 0, // signalCount // slots: signature, parameters, type, tag, flags 12, 11, 11, 11, 0x08, 36, 11, 11, 11, 0x08, 0 // eod }; static const char qt_meta_stringdata_MainWindow[] = { "MainWindow\0\0on_pushButton_clicked()\0" "on_DataButton_clicked()\0" }; const QMetaObject MainWindow::staticMetaObject = { { &QMainWindow::staticMetaObject, qt_meta_stringdata_MainWindow, qt_meta_data_MainWindow, 0 } }; #ifdef Q_NO_DATA_RELOCATION const QMetaObject &MainWindow::getStaticMetaObject() { return staticMetaObject; } #endif //Q_NO_DATA_RELOCATION const QMetaObject *MainWindow::metaObject() const { return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; } void *MainWindow::qt_metacast(const char *_clname) { if (!_clname) return 0; if (!strcmp(_clname, qt_meta_stringdata_MainWindow)) return static_cast<void*>(const_cast< MainWindow*>(this)); return QMainWindow::qt_metacast(_clname); } int MainWindow::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QMainWindow::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { switch (_id) { case 0: on_pushButton_clicked(); break; case 1: on_DataButton_clicked(); break; default: ; } _id -= 2; } return _id; } QT_END_MOC_NAMESPACE
[ "king.seth@1baa6d84-2001-11df-aa13-c314d3631722" ]
king.seth@1baa6d84-2001-11df-aa13-c314d3631722
645df9ed6432dca285277563ea6e3b35e90b3db9
8c6bf55a740ddf1e73b3f493bfd1ea3c719565c8
/Coin Piles .cpp
cd6ff940a60047f85b826a6c16a46a4989a40f71
[]
no_license
anishagg17/Cses
80b3f9b7fcf96e5a127d6d49b91d0c5c6adbf3d1
839b04652c0c8004e1055b5facbd6e82957cd485
refs/heads/master
2020-09-28T06:39:45.072152
2020-01-11T19:01:05
2020-01-11T19:01:05
226,714,519
0
0
null
null
null
null
UTF-8
C++
false
false
1,355
cpp
#include <iostream> #include <bits/stdc++.h> using namespace std; #define endl '\n' #define ll long long #define re register #define pb(x) push_back(x) #define ce(x) cout << x << endl; using db = long double; using pii = pair < int, int >; using pll = pair < ll, ll >; #define scl1(a) scanf(“%I64d", &a) #define scl2(a, b) scanf("%lld %lld", &a, &b) #define rep(i,x,n,inc) for(i=x ; i<n ; i+=inc) #define repr(i,x,n,inc) for( i=x ; i>n ; i+=inc) #define all(a) (a).begin(),(a).end() #define rall(x) (x).rbegin(), (x).rend() #define unique_sort(x) sort(all(x)), x.resize(distance(x.begin(), unique(all(x)))) #define mp(a,b) make_pair(a,b) #define ff first #define ss second #define hell 1000000007 const db pi = acos(-1); const long long infl = LLONG_MAX; const int inf = 0x3f3f3f3f; #define Foxen(i,s) for (i=s.begin(); i!=s.end(); i++) #define Fill(s,v) memset(s,v,sizeof(s)) #define cout_p(x, p) cout << fixed << setprecision((p)) << x << endl //print with precision #define tc(tt) \ ll tt; \ cin >> tt; \ for (ll _tt = 0; _tt < tt; _tt++) // testcase int32_t main(){ ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); ll t,i,j,x,y=0,z=0,k,n; string s,ss; cin>>n; while(n--){ cin>>x>>y; t=x+y; if(t%3==0 && (x+y==0 || (x && y)) && x>=t/3 && y>=t/3 && x<=(t*2)/3) ce("YES") else ce("NO") } }
[ "anish17122000@gmail.com" ]
anish17122000@gmail.com
d48d7401f08dc75db28cdaeb34a792578255b85b
a5419164a76c74754793e80fe963e510e151452d
/leetcode_206.cpp
f18df193a70dcc7c588fdb4c7aa0287e103c595e
[]
no_license
Gazella019/Leetcode
aed66a349a0f1aed60eba2e9aa66b25b8b47152b
761468170026d243ac8c06c74600979f75508c36
refs/heads/main
2023-03-11T08:58:39.274460
2021-02-27T03:07:39
2021-02-27T03:07:39
342,758,173
0
0
null
null
null
null
UTF-8
C++
false
false
313
cpp
class Solution { public: ListNode* reverseList(ListNode* head) { ListNode *cur, *pre, *nex; cur = head; pre = NULL; while(cur != NULL){ nex = cur->next; cur->next = pre; pre = cur; cur = nex; } return pre; } };
[ "edison19951219@gmail.com" ]
edison19951219@gmail.com
b23f6025a26a1f92d1efd0138e4494189f3f74a3
a820e59294d1851f6b7b4400b78c690ee1d10f1d
/samples/F2/GLSLShader.cpp
c55254c97a78371d475026a93591ba5f121ab555
[]
no_license
ebugger/SDK
d550331898fff963504775599673ca419806ce8a
c217093da6688bc8aa5c1dfa7316b79c6eac9da5
refs/heads/master
2020-09-29T15:58:33.102926
2012-09-04T19:09:42
2012-09-04T19:09:42
null
0
0
null
null
null
null
UTF-8
C++
false
false
7,985
cpp
#include "utils.hpp" #include "glslshader.hpp" #include <fstream> // NEED To BE IN SYNC WITH enum shaderTemplate const char * shaderTemplateName[shaderTemplateMax] = { "UberShader", "ShadowPass", "ComputeSSAO", "OutputNormal", "BlurPass", "AppendClear", "AppendResolve", "QuadTex", "GlowPass" }; ////////////////////////////////////////////////////////////////////// std::string ReadFileContent(const std::string& filename) { std::ifstream ifs; ifs.open(filename.c_str()); if(ifs.bad()) { return std::string(); } std::string res((std::istreambuf_iterator<char>(ifs)), std::istreambuf_iterator<char>()); return res; } ////////////////////////////////////////////////////////////////////// void WriteFileContent(const std::string& filename, const std::string& filecontent) { std::ofstream myfile; myfile.open(filename.c_str()); myfile << filecontent; myfile.close(); } /////////////////////////////////////////////////////////////////////////////////////// GLSLShader::GLSLShader() :m_programObject(0) ,m_bGLSLAvailable(true) ,m_bShaderActive(false) ,m_shaderProfile(0) { } /////////////////////////////////////////////////////////////////////////////////////// GLSLShader::~GLSLShader() { Clean(); } /////////////////////////////////////////////////////////////////////////////////////// bool GLSLShader::IsActive() const { return m_bShaderActive; } /////////////////////////////////////////////////////////////////////////////////////// void OutputLog(GLuint obj) { int infologLength = 0; int maxLength = 256; if(glIsShader(obj)) glGetShaderiv(obj,GL_INFO_LOG_LENGTH,&maxLength); else glGetProgramiv(obj,GL_INFO_LOG_LENGTH,&maxLength); char * infoLog = new char[maxLength]; if (glIsShader(obj)) glGetShaderInfoLog(obj, maxLength, &infologLength, infoLog); else glGetProgramInfoLog(obj, maxLength, &infologLength, infoLog); if (infologLength > 0) OutputDebugString(infoLog); delete infoLog; } /////////////////////////////////////////////////////////////////////////////////////// GLhandleARB GLSLShader::CreateObject(const std::string& prog, GLenum progType) { // create GLhandleARB obj = glCreateShaderObjectARB(progType); if(!CheckOglError()) { return static_cast<GLhandleARB>(0); } // set source GLint size = static_cast<GLint>(prog.size()); const GLcharARB* progString = static_cast<const GLcharARB*>(&prog[0]); glShaderSource(obj, 1, &progString, &size); if(!CheckOglError()) { glDeleteObjectARB(obj); return static_cast<GLhandleARB>(0); } // compile glCompileShader(obj); GLint compiled; glGetObjectParameterivARB(obj, GL_OBJECT_COMPILE_STATUS_ARB, &compiled); OutputLog(obj); if (compiled==0 ) { return static_cast<GLhandleARB>(0); } // return return obj; } /////////////////////////////////////////////////////////////////////////////////////// bool GLSLShader::CreateGPUProgram(const std::string& vertexProg, const std::string& fragmentProg, GpuParams * params) { // vertex GLhandleARB vtxObj = CreateObject(vertexProg,GL_VERTEX_SHADER_ARB); if(vtxObj==static_cast<GLhandleARB>(0)) { OutputDebugString("Error while creating Vertex shader\n"); return false; } // pixel GLhandleARB fragObj = CreateObject(fragmentProg,GL_FRAGMENT_SHADER_ARB); if(fragObj==static_cast<GLhandleARB>(0)) { OutputDebugString("Error while creating Fragment shader\n"); return false; } // program - create GLhandleARB progObj = glCreateProgramObjectARB(); if(!CheckOglError()) { OutputDebugString("Error While creating program"); glDeleteObjectARB(vtxObj); glDeleteObjectARB(fragObj); return false; } // program - attached glAttachObjectARB(progObj, vtxObj); glAttachObjectARB(progObj, fragObj); if(!CheckOglError()) { OutputDebugString("Error While attaching object"); glDeleteObjectARB(vtxObj); glDeleteObjectARB(fragObj); glDeleteObjectARB(progObj); return false; } // Don't need the shader objs any more glDeleteObjectARB(vtxObj); glDeleteObjectARB(fragObj); if(!CheckOglError()) { OutputDebugString("Error While deleting object"); glDeleteObjectARB(progObj); return false; } // program - link GLint linked = TRUE; { try { glLinkProgram(progObj); } catch(...) { linked = FALSE; OutputDebugString("ERROR in GLSLShader: Cannot CreateGPUProgram - link\n"); } } OutputLog(progObj); if (linked) { glGetObjectParameterivARB(progObj, GL_OBJECT_LINK_STATUS_ARB, &linked); if (linked && WillRunSoftware(progObj)) linked = FALSE; } if (!linked) { OutputDebugString("Error While linking object!\n"); glDeleteObjectARB(progObj); return false; } // unform stuff m_UniformBinding.Finalize(progObj, params); // we are done with opengl m_programObject = progObj; // should be true return CheckOglError(); } /////////////////////////////////////////////////////////////////////////////////////// bool GLSLShader::SanityCheck() { // Return if GLSL is not available, eventually will trigger fallback to fixed-pipeline if (!m_bGLSLAvailable) { OutputDebugString("GLSLShader_c::Init: GLSL not available!\n"); return false; } // Check errors if (!CheckOglError()) { OutputDebugString("GLSLShader_c::Init: there are previous OPENGL error!\n"); return false; } return true; } /////////////////////////////////////////////////////////////////////////////////////// bool GLSLShader::Init(unsigned int shaderProfile, GpuParams * params) { m_shaderProfile = shaderProfile; // Return if GLSL is not available, eventually will trigger fallback to fixed-pipeline if (!SanityCheck()) { //GL::NotifyFailure(); return false; } int id = (shaderProfile & 0x000000FF) - 1; if (id < 0 || id > shaderTemplateMax) return false; m_ProgramName = shaderTemplateName[id]; // filename std::string VertexProgramName = m_ProgramName + ".vert"; std::string FragmentProgramName = m_ProgramName + ".frag"; // path std::string ProgramPath = "data/shaders/"; // load std::string vertexShaderCode = ReadFileContent(ProgramPath + VertexProgramName); std::string pixelShaderCode = ReadFileContent(ProgramPath + FragmentProgramName); if(vertexShaderCode.size()==0 || pixelShaderCode.size()==0) { OutputDebugString("GLSLShader_c::Init: Cannot load code from file!\n"); return false; } // create shader char tmp[256]; sprintf_s(tmp, 255, "\n----- SHADER CREATION: %s -----\n", m_ProgramName.c_str()); OutputDebugString(tmp); if(!CreateGPUProgram(vertexShaderCode, pixelShaderCode, params)) { OutputDebugString("GLSLShader_c::Init: Something wrong during the init...\n"); return false; } // everything looks good! return true; } /////////////////////////////////////////////////////////////////////////////////////// void GLSLShader::Clean() { if (m_programObject) { glDeleteObjectARB(m_programObject); CheckOglError(); } m_programObject = 0; } /////////////////////////////////////////////////////////////////////////////////////// bool GLSLShader::Activate() { //assert(!m_bShaderActive); // OZ: if we are here, we forgot to call Finish CheckOglError(); glUseProgramObjectARB(m_programObject); if(!CheckOglError()) { glUseProgramObjectARB(0); return false; } m_bShaderActive = true; return true; } /////////////////////////////////////////////////////////////////////////////////////// bool GLSLShader::Deactivate() { if (m_bShaderActive) // Avoid when following a failed Setup() { // Load the NULL shader to revert to fixed fxn OGL glUseProgramObjectARB(0); m_bShaderActive = false; } // Check errors return CheckOglError(); } /////////////////////////////////////////////////////////////////////////////////////// bool GLSLShader::WillRunSoftware(GLhandleARB hProgram) { /* const GLsizei logSize = 4096; GLcharARB log[logSize]; log[0]='\0'; glGetInfoLogARB(hProgram, logSize, NULL, log); CString findSoftwareRun(log); return (findSoftwareRun.Find(_T("software")) != -1); */ return false; }
[ "mail@g-truc.net" ]
mail@g-truc.net
35dbe4c9a22af341b3219a086d197dfc9780fd7e
1c70d751de19e0e1cd358181da418220ccfd069c
/inversamod.cpp
ce407c80a5b33c154716bf47f1acbadefb1f3124
[]
no_license
FabioCarbajal/Algebra-Abstracta
1709859e7d56ff74e02bec74c7b98bd251167e15
26e6fdaab985ea41afd8af654f6932bde6f7629a
refs/heads/master
2021-01-22T18:01:57.832604
2017-11-17T20:12:00
2017-11-17T20:12:00
100,746,348
0
0
null
null
null
null
UTF-8
C++
false
false
767
cpp
#include <iostream> #include <vector> using namespace std; int modulo(int a,int b) { int q=a/b; int r=a-q*b; if(r<0) r+=b; return r; } vector<int> inversa(int a, int b) { vector<int> respuestas; int r1=a; int r2=b; int u,v,q,r; int u1=1; int u2=0; int v1=0; int v2=1; while(r2>0) { q=r1/r2; r=r1-q*r2; r1=r2; r2=r; u=u1-q*u2; u1=u2; u2=u; v=v1-q*v2; v1=v2; v2=v; } cout << "La inversa es: " << modulo(u1,b) << endl; respuestas.push_back(r1); respuestas.push_back(u1); respuestas.push_back(v1); return respuestas; } int main() { inversa(7,3); return 0; }
[ "noreply@github.com" ]
FabioCarbajal.noreply@github.com
186d1f258e6379bd2959a33a1e92c07b77cd0fa9
66037f049481cc96d917c28c848a89025d86408a
/src/simd512x86def.hpp
cb7d454f7028b255190c62277d7ecb881739b0a7
[]
no_license
anupzope/simd
48622df90787bebe833a5c510326479e9a68455d
f300c0a5dd8e5a0f0c41c7b81af43a4d9f0c4215
refs/heads/master
2020-08-14T02:17:56.795210
2019-10-14T15:51:46
2019-10-14T15:51:46
215,079,433
0
0
null
null
null
null
UTF-8
C++
false
false
153,775
hpp
#ifndef SIMD_SIMD512X86DEF_HPP #define SIMD_SIMD512X86DEF_HPP #include <immintrin.h> #include <iostream> #include <iomanip> namespace simd { //void print_mm512i_epi32(__m256i var) { // int32_t *val = (int32_t*) &var; // for(int i = 0; i < 15; ++i) { // std::cout << val[i] << " "; // } // std::cout << val[15] << std::endl; //} //void print_mm512i_epi64(__m256i var) { // int64_t *val = (int64_t*) &var; // for(int i = 0; i < 7; ++i) { // std::cout << val[i] << " "; // } // std::cout << val[7] << std::endl; //} #if SIMD512 //void print_epi64(__m512i *op) { // __int64* values = reinterpret_cast<__int64*>(op); // // for(int i = 0; i < 8; ++i) { // std::cout << std::hex << std::setw(16) << values[i] << std::endl; // } // std::cout << std::dec << std::endl; //} //void print_epi32(__m512i *op) { // __int32* values = reinterpret_cast<__int32*>(op); // // for(int i = 0; i < 16; i+=2) { // std::cout << std::hex << std::setw(8) << values[i] << " " << std::hex << std::setw(8) << values[i+1] << std::endl; // } // std::cout << std::dec << std::endl; //} template<> struct defaults<int> { static constexpr int nway = 16; }; template<> struct defaults<long> { static constexpr int nway = 8; }; template<> struct defaults<float> { static constexpr int nway = 16; }; template<> struct defaults<double> { static constexpr int nway = 8; }; template<int NW> struct type_traits<int, NW> { static_assert(NW%simd::defaults<int>::nway == 0, "Invalid NW"); static_assert(NW/simd::defaults<int>::nway > 0, "Invalid NW"); typedef int base_type; typedef __m512i register_type; typedef __mmask16 mask_register_type; static constexpr int num_regs = NW/simd::defaults<int>::nway; static constexpr int num_vals = NW; static constexpr int num_bvals = NW; static constexpr int num_vals_per_reg = NW/num_regs; static constexpr int num_bvals_per_reg = NW/num_regs; static constexpr int num_bvals_per_val = 1; }; template<int NW> struct type_traits<long, NW> { static_assert(NW%simd::defaults<long>::nway == 0, "Invalid NW"); static_assert(NW/simd::defaults<long>::nway > 0, "Invalid NW"); typedef long base_type; typedef __m512i register_type; typedef __mmask8 mask_register_type; static constexpr int num_regs = NW/simd::defaults<long>::nway; static constexpr int num_vals = NW; static constexpr int num_bvals = NW; static constexpr int num_vals_per_reg = NW/num_regs; static constexpr int num_bvals_per_reg = NW/num_regs; static constexpr int num_bvals_per_val = 1; }; template<int NW> struct type_traits<float, NW> { static_assert(NW%simd::defaults<float>::nway == 0, "Invalid NW"); static_assert(NW/simd::defaults<float>::nway > 0, "Invalid NW"); typedef float base_type; typedef __m512 register_type; typedef __mmask16 mask_register_type; static constexpr int num_regs = NW/simd::defaults<float>::nway; static constexpr int num_vals = NW; static constexpr int num_bvals = NW; static constexpr int num_vals_per_reg = NW/num_regs; static constexpr int num_bvals_per_reg = NW/num_regs; static constexpr int num_bvals_per_val = 1; }; template<int NW> struct type_traits<double, NW> { static_assert(NW%simd::defaults<double>::nway == 0, "Invalid NW"); static_assert(NW/simd::defaults<double>::nway > 0, "Invalid NW"); typedef double base_type; typedef __m512d register_type; typedef __mmask8 mask_register_type; static constexpr int num_regs = NW/simd::defaults<double>::nway; static constexpr int num_vals = NW; static constexpr int num_bvals = NW; static constexpr int num_vals_per_reg = NW/num_regs; static constexpr int num_bvals_per_reg = NW/num_regs; static constexpr int num_bvals_per_val = 1; }; /* Conversion functions */ // int -> long inline __m512i cvt512_epi32lo_epi64(__m512i op) { #if defined(SIMD_AVX512F) return _mm512_cvtepi32_epi64(_mm512_castsi512_si256(op)); #else __mmask16 k1 = _mm512_int2mask(0b0000111100001111); __mmask16 k2 = _mm512_int2mask(0b1010101010101010); __m512i temp = _mm512_permute4f128_epi32(op, _MM_PERM_BBAA); temp = _mm512_mask_shuffle_epi32(temp, k1, temp, _MM_PERM_BBAA); temp = _mm512_mask_shuffle_epi32(temp, _mm512_knot(k1), temp, _MM_PERM_DDCC); temp = _mm512_mask_srai_epi32(temp, k2, temp, 32); return _mm512_mask_slli_epi32(temp, k2, temp, 31); #endif } inline __m512i cvt512_epi32hi_epi64(__m512i op) { #if defined(SIMD_AVX512F) return _mm512_cvtepi32_epi64(_mm512_castsi512_si256(_mm512_shuffle_i32x4(op, op, _MM_SHUFFLE(1, 0, 3, 2)))); #else __mmask16 k1 = _mm512_int2mask(0b0000111100001111); __mmask16 k2 = _mm512_int2mask(0b1010101010101010); __m512i temp = _mm512_permute4f128_epi32(op, _MM_PERM_DDCC); temp = _mm512_mask_shuffle_epi32(temp, k1, temp, _MM_PERM_BBAA); temp = _mm512_mask_shuffle_epi32(temp, _mm512_knot(k1), temp, _MM_PERM_DDCC); temp = _mm512_mask_srai_epi32(temp, k2, temp, 32); return _mm512_mask_slli_epi32(temp, k2, temp, 31); #endif } // int -> float inline __m512 cvt512_epi32_ps(__m512i op) { #if defined(SIMD_AVX512F) return _mm512_cvtepi32_ps(op); #else return _mm512_cvtfxpnt_round_adjustepi32_ps(op, _MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC, _MM_EXPADJ_NONE); #endif } // int -> double inline __m512d cvt512_epi32lo_pd(__m512i op) { return _mm512_cvtepi32lo_pd(op); } inline __m512d cvt512_epi32hi_pd(__m512i op) { #if defined(SIMD_AVX512F) return _mm512_cvtepi32lo_pd(_mm512_shuffle_i32x4(op, op, _MM_SHUFFLE(1, 0, 3, 2))); #else return _mm512_cvtepi32lo_pd(_mm512_permute4f128_epi32(op, _MM_PERM_BADC)); #endif } // long -> int inline __m512i cvt512_epi64_epi32lo(__m512i op) { #if defined(SIMD_AVX512F) return _mm512_castsi256_si512(_mm512_cvtepi64_epi32(op)); #else __m512i zero; return _mm512_swizzle_epi32( _mm512_permute4f128_epi32( _mm512_swizzle_epi64( _mm512_swizzle_epi64( _mm512_mask_shuffle_epi32( _mm512_xor_si512(zero, zero), _mm512_int2mask(0b0011001100110011), op, _MM_PERM_DBCA ), _MM_SWIZ_REG_DACB ), _MM_SWIZ_REG_DACB ), _MM_PERM_DBCA ), _MM_SWIZ_REG_BADC ); #endif } inline __m512i cvt512_epi64_epi32hi(__m512i op) { #if defined(SIMD_AVX512F) __m512i temp = _mm512_castsi256_si512(_mm512_cvtepi64_epi32(op)); return _mm512_shuffle_i32x4(temp, temp, _MM_SHUFFLE(1, 0, 3, 2)); #else __m512i zero; return _mm512_swizzle_epi32( _mm512_permute4f128_epi32( _mm512_swizzle_epi64( _mm512_swizzle_epi64( _mm512_mask_shuffle_epi32( _mm512_xor_si512(zero, zero), _mm512_int2mask(0b0101010101010101), op, _MM_PERM_DBCA ), _MM_SWIZ_REG_DACB ), _MM_SWIZ_REG_DACB ), _MM_PERM_CADB ), _MM_SWIZ_REG_BADC ); #endif } inline __m512i cvt512_epi64x2_epi32(__m512i hi, __m512i lo) { #if defined(SIMD_AVX512F) __m512i hi1 = _mm512_castsi256_si512(_mm512_cvtepi64_epi32(hi)); __m512i lo1 = _mm512_castsi256_si512(_mm512_cvtepi64_epi32(lo)); return _mm512_mask_blend_epi32( _mm512_int2mask(0b0000000011111111), _mm512_shuffle_i32x4(hi1, hi1, _MM_SHUFFLE(1, 0, 3, 2)), lo1 ); #else __m512i temp = _mm512_permute4f128_epi32( _mm512_swizzle_epi64( _mm512_swizzle_epi64( _mm512_shuffle_epi32( _mm512_mask_blend_epi32( _mm512_int2mask(0b0101010101010101), _mm512_swizzle_epi32(hi, _MM_SWIZ_REG_CDAB), lo ) , _MM_PERM_DBCA ), _MM_SWIZ_REG_DACB ), _MM_SWIZ_REG_DACB ), _MM_PERM_DBCA ); return _mm512_mask_swizzle_epi32(temp, _mm512_int2mask(0b0000000011111111), temp, _MM_SWIZ_REG_BADC); #endif } // long -> float inline __m512 cvt512_epi64_pslo(__m512i op) { #if defined(SIMD_AVX512F) return _mm512_cvtepi64_ps(op); #else __m512i temp = _mm512_swizzle_epi64( _mm512_swizzle_epi64( _mm512_shuffle_epi32(op, _MM_PERM_DBCA), _MM_SWIZ_REG_DACB ), _MM_SWIZ_REG_DACB ); temp = _mm512_mask_shuffle_epi32(temp, _mm512_int2mask(0b0000111100001111), temp, _MM_PERM_BADC); __m512i lo = _mm512_permute4f128_epi32(temp, _MM_PERM_CACA); // unsigned part __m512i hi = _mm512_permute4f128_epi32(temp, _MM_PERM_DBDB); // signed part __m512 lops = _mm512_cvtfxpnt_round_adjustepu32_ps(lo, _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC, _MM_EXPADJ_NONE); __m512 hips = _mm512_cvtfxpnt_round_adjustepi32_ps(hi, _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC, _MM_EXPADJ_32); __m512i zero; zero = _mm512_xor_si512(zero, zero); __mmask16 k = _mm512_int2mask(0b0000000011111111); return _mm512_mask_add_ps(_mm512_castsi512_ps(zero), k, lops, hips); #endif } inline __m512 cvt512_epi64_pshi(__m512i op) { #if defined(SIMD_AVX512F) __m512 temp = _mm512_castps256_ps512(_mm512_cvtepi64_ps(op)); return _mm512_shuffle_f32x4(temp, temp, _MM_SHUFFLE(1, 0, 3, 2)); #else __m512i temp = _mm512_swizzle_epi64( _mm512_swizzle_epi64( _mm512_shuffle_epi32(op, _MM_PERM_DBCA), _MM_SWIZ_REG_DACB ), _MM_SWIZ_REG_DACB ); temp = _mm512_mask_shuffle_epi32(temp, _mm512_int2mask(0b0000111100001111), temp, _MM_PERM_BADC); __m512i lo = _mm512_permute4f128_epi32(temp, _MM_PERM_CACA); // unsigned part __m512i hi = _mm512_permute4f128_epi32(temp, _MM_PERM_DBDB); // signed part __m512 lops = _mm512_cvtfxpnt_round_adjustepu32_ps(lo, _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC, _MM_EXPADJ_NONE); __m512 hips = _mm512_cvtfxpnt_round_adjustepi32_ps(hi, _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC, _MM_EXPADJ_32); __m512i zero; zero = _mm512_xor_si512(zero, zero); __mmask16 k = _mm512_int2mask(0b1111111100000000); return _mm512_mask_add_ps(_mm512_castsi512_ps(zero), k, lops, hips); #endif } inline __m512 cvt512_epi64x2_ps(__m512i hi, __m512i lo) { return _mm512_mask_blend_ps(_mm512_int2mask(0b0000000011111111), cvt512_epi64_pshi(hi), cvt512_epi64_pslo(lo)); } // long -> double inline __m512d cvt512_epi64_pd(__m512i op) { #if defined(SIMD_AVX512F) return _mm512_cvtepi64_pd(op); #else static const double mul = 4294967296.0; __m512i temp = _mm512_swizzle_epi64( _mm512_swizzle_epi64( _mm512_shuffle_epi32(op, _MM_PERM_DBCA), _MM_SWIZ_REG_DACB ), _MM_SWIZ_REG_DACB ); temp = _mm512_mask_swizzle_epi32(temp, _mm512_int2mask(0b0000111100001111), temp, _MM_SWIZ_REG_BADC); __m512i lo = _mm512_permute4f128_epi32(temp, _MM_PERM_DBCA); // unsigned part __m512i hi = _mm512_permute4f128_epi32(temp, _MM_PERM_CADB); // signed part __m512d lopd = _mm512_cvtepu32lo_pd(lo); __m512d hipd = _mm512_cvtepi32lo_pd(hi); __m512d himl = _mm512_extload_pd(&mul, _MM_UPCONV_PD_NONE, _MM_BROADCAST_1X8, _MM_HINT_NONE); return _mm512_fmadd_pd(himl, hipd, lopd); #endif } // float -> int inline __m512i cvt512_ps_epi32(__m512 op) { #if defined(SIMD_AVX512F) return _mm512_cvtps_epi32(op); #else return _mm512_cvtfxpnt_round_adjustps_epi32(op, _MM_FROUND_TO_ZERO | _MM_FROUND_NO_EXC, _MM_EXPADJ_NONE); #endif } // float -> long #if !defined(SIMD_AVX512F) __m512i cvt512_pshilo_epi64(__m512 op) { __m512i result; __mmask16 himask = _mm512_int2mask(0b1010101010101010); __mmask16 lomask = _mm512_int2mask(0b0101010101010101); __m512i zero; zero = _mm512_xor_si512(zero, zero); // mask for mantisa static const int mant_mask_val = 0x007fffff; __m512i mant = _mm512_extload_epi32(&mant_mask_val, _MM_UPCONV_EPI32_NONE, _MM_BROADCAST_1X16, _MM_HINT_NONE); // mask for exponent + mantisa static const int mantexp_mask_val = 0x7fffffff; __m512i mantexp = _mm512_extload_epi32(&mantexp_mask_val, _MM_UPCONV_EPI32_NONE, _MM_BROADCAST_1X16, _MM_HINT_NONE); // obtain absolute value of op __m512i absop = _mm512_and_epi32(_mm512_castps_si512(op), mantexp); // obtain raw exponent of op __m512i expraw = _mm512_andnot_epi64(mant, absop); // obtain mantisa static const int implicit_mantisa_val = 0x00800000; __m512i implicit_mantisa = _mm512_extload_epi32(&implicit_mantisa_val, _MM_UPCONV_EPI32_NONE, _MM_BROADCAST_1X16, _MM_HINT_NONE); __m512i mantisa = _mm512_or_epi32(implicit_mantisa, _mm512_and_si512(absop, mant)); // obtain exponent shifted to 23 static const int exp23_base_val = 150; __m512i exp23_base = _mm512_extload_epi32(&exp23_base_val, _MM_UPCONV_EPI32_NONE, _MM_BROADCAST_1X16, _MM_HINT_NONE); __m512i exp23 = _mm512_sub_epi32(_mm512_srli_epi32(expraw, 23), exp23_base); static const int exp32_cutoff_val = 32; __m512i exp32_cutoff = _mm512_extload_epi32(&exp32_cutoff_val, _MM_UPCONV_EPI32_NONE, _MM_BROADCAST_1X16, _MM_HINT_NONE); __mmask16 exp23lt32 = _mm512_cmp_epi32_mask(exp23, exp32_cutoff, _MM_CMPINT_LT); static const int exp40_cutoff_val = 40; __m512i exp40_cutoff = _mm512_extload_epi32(&exp40_cutoff_val, _MM_UPCONV_EPI32_NONE, _MM_BROADCAST_1X16, _MM_HINT_NONE); __mmask16 exp23lt40 = _mm512_cmp_epi32_mask(exp23, exp40_cutoff, _MM_CMPINT_LT); static const int sign_val = 0x80000000; __m512i sign = _mm512_extload_epi32(&sign_val, _MM_UPCONV_EPI32_NONE, _MM_BROADCAST_1X16, _MM_HINT_NONE); // For numbers with exponent in range [55, 63) result = _mm512_mask_blend_epi32( himask, _mm512_mask_mov_epi32(zero, exp23lt40, zero), _mm512_mask_sllv_epi32(sign, exp23lt40, mantisa, _mm512_sub_epi32(exp23, exp32_cutoff)) ); // For numbers with exponent in range [23, 55) result = _mm512_mask_blend_epi32( himask, _mm512_mask_sllv_epi32(result, exp23lt32, mantisa, exp23), _mm512_mask_srlv_epi32(result, exp23lt32, mantisa, _mm512_sub_epi32(exp32_cutoff, exp23)) ); // number 2^23 static const int num2to23_val = 0x4b000000; __m512i num2to23 = _mm512_extload_epi32(&num2to23_val, _MM_UPCONV_EPI32_NONE, _MM_BROADCAST_1X16, _MM_HINT_NONE); // For numbers with exponent less than 23 result = _mm512_mask_mov_epi32( result, _mm512_kand(lomask, _mm512_cmplt_ps_mask(_mm512_castsi512_ps(expraw), _mm512_castsi512_ps(num2to23))), _mm512_sub_epi32(_mm512_castps_si512(_mm512_add_round_ps(_mm512_castsi512_ps(num2to23), _mm512_castsi512_ps(absop), _MM_FROUND_TO_ZERO)), num2to23) ); // For negative numbers find their 2's complement __mmask16 negmask = _mm512_cmplt_ps_mask(op, _mm512_castsi512_ps(zero)); __mmask16 borrow, borrow2; __m512i numneg = _mm512_mask_subsetb_epi32(zero, lomask, lomask, result, &borrow); int bint = _mm512_mask2int(borrow); bint += bint; borrow2 = _mm512_int2mask(bint); numneg = _mm512_mask_sbb_epi32(numneg, himask, borrow2, result, &borrow); result = _mm512_mask_mov_epi32(result, negmask, numneg); return result; //union dtol { // float dbl; // int lng; //}; // //int main(int argc, char **argv) { // alignas(64) float src[16]; // alignas(64) long dst[8]; // // std::srand(std::time(NULL)); // for(int i = 0; i < 16; ++i) { // src[i] = 1.0; // for(long j = 0; j < 2; ++j) { // src[i] *= (std::rand()%2 ? -1.0 : 1.0)*std::rand(); // } // } // // //int raw = 0x4a512928; // positive number less than 2^23 // //int raw = 0xca512928; // negative number less than 2^23 // //int raw = 0xdb5539a8; // //_mm512_store_ps(src, _mm512_castsi512_ps(_mm512_extload_epi32(&raw, _MM_UPCONV_EPI32_NONE, _MM_BROADCAST_1X16, _MM_HINT_NONE))); // // _mm512_store_si512(dst, cvt_pslo_epi64(_mm512_load_ps(src))); // // dtol t; // for(int i = 0; i < 8; ++i) { // t.dbl = src[i]; // std::cout << std::dec << "custom cvt: 0x" << std::hex << dst[i] << ", " << std::dec << dst[i]; // std::cout << std::dec << ", compiler cvt: 0x" << std::hex << (long)src[i] << ", " << std::dec << (long)src[i]; // std::cout << ", original number: 0x" << std::hex << t.lng << std::dec << ", " << src[i] << std::endl; // assert(dst[i] == (long)src[i]); // } // // return 0; //} } #endif inline __m512i cvt512_pslo_epi64(__m512 op) { #if defined(SIMD_AVX512F) return _mm512_cvtps_epi64(_mm512_castps512_ps256(op)); #else // Obtain low elements in packed float __m512i temp = _mm512_permute4f128_epi32(_mm512_castps_si512(op), _MM_PERM_BBAA); temp = _mm512_mask_swizzle_epi32(temp, _mm512_int2mask(0b1111000011110000), temp, _MM_SWIZ_REG_BADC); temp = _mm512_shuffle_epi32(temp, _MM_PERM_BBAA); return cvt512_pshilo_epi64(_mm512_castsi512_ps(temp)); #endif } inline __m512i cvt512_pshi_epi64(__m512 op) { #if defined(SIMD_AVX512F) return _mm512_cvtps_epi64(_mm512_castps512_ps256(_mm512_shuffle_f32x4(op, op, _MM_SHUFFLE(1, 0, 3, 2)))); #else // Obtain hi elements in packed float __m512i temp = _mm512_permute4f128_epi32(_mm512_castps_si512(op), _MM_PERM_DDCC); temp = _mm512_mask_swizzle_epi32(temp, _mm512_int2mask(0b1111000011110000), temp, _MM_SWIZ_REG_BADC); temp = _mm512_shuffle_epi32(temp, _MM_PERM_BBAA); return cvt512_pshilo_epi64(_mm512_castsi512_ps(temp)); #endif } // float -> double inline __m512d cvt512_pslo_pd(__m512 op) { return _mm512_cvtpslo_pd(op); } inline __m512d cvt512_pshi_pd(__m512 op) { #if defined(SIMD_AVX512F) return _mm512_cvtpslo_pd(_mm512_shuffle_f32x4(op, op, _MM_SHUFFLE(1, 0, 3, 2))); #else return _mm512_cvtpslo_pd(_mm512_permute4f128_ps(op, _MM_PERM_BADC)); #endif } // double -> int inline __m512i cvt512_pd_epi32lo(__m512d op) { #if defined(SIMD_AVX512F) return _mm512_castsi256_si512(_mm512_cvtpd_epi32(op)); #else return _mm512_cvtfxpnt_roundpd_epi32lo(op, _MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC); #endif } inline __m512i cvt512_pd_epi32hi(__m512d op) { #if defined(SIMD_AVX512F) __m512i temp = _mm512_castsi256_si512(_mm512_cvtpd_epi32(op)); return _mm512_shuffle_i32x4(temp, temp, _MM_SHUFFLE(1, 0, 3, 2)); #else return _mm512_permute4f128_epi32(_mm512_cvtfxpnt_roundpd_epi32lo(op, _MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC), _MM_PERM_BADC); #endif } inline __m512i cvt512_pdx2_epi32(__m512d hi, __m512d lo) { return _mm512_mask_blend_epi32(_mm512_int2mask(0b0000000011111111), cvt512_pd_epi32hi(hi), cvt512_pd_epi32lo(lo)); } // double -> long inline __m512i cvt512_pd_epi64(__m512d op) { #if defined(SIMD_AVX512F) return _mm512_cvtpd_epi64(op); #else __m512i result; // mask for hi 32 bits of each double __mmask16 himask = _mm512_int2mask(0b1010101010101010); // mask for lo 32 bits of each double __mmask16 lomask = _mm512_int2mask(0b0101010101010101); // zero __m512i zero; zero = _mm512_xor_si512(zero, zero); // integer bit width static const int ceil32_val = 32; __m512i ceil32 = _mm512_extload_epi32(&ceil32_val, _MM_UPCONV_EPI32_NONE, _MM_BROADCAST_1X16, _MM_HINT_NONE); // bit mask for mantisa part of a double static const long mant_mask_val = 0x000fffffffffffff; __m512i mant = _mm512_extload_epi64(&mant_mask_val, _MM_UPCONV_EPI64_NONE, _MM_BROADCAST_1X8, _MM_HINT_NONE); // Get absolute value of op static const long mantexp_mask_val = 0x7fffffffffffffff; __m512i mantexp = _mm512_extload_epi64(&mantexp_mask_val, _MM_UPCONV_EPI64_NONE, _MM_BROADCAST_1X8, _MM_HINT_NONE); __m512i absop = _mm512_and_epi64(_mm512_castpd_si512(op), mantexp); // Get raw exponent of op __m512i expraw = _mm512_andnot_epi64(mant, absop); // number 2^52 static const long num2to52_val = 0x4330000000000000; __m512i num2to52 = _mm512_extload_epi64(&num2to52_val, _MM_UPCONV_EPI64_NONE, _MM_BROADCAST_1X8, _MM_HINT_NONE); // Get exponent shifted to 52 static const long longexp_val = 1075; __m512i longexp = _mm512_extload_epi64(&longexp_val, _MM_UPCONV_EPI64_NONE, _MM_BROADCAST_1X8, _MM_HINT_NONE); __m512i exp52 = _mm512_shuffle_epi32( _mm512_sub_epi32( _mm512_srli_epi32( _mm512_mask_mov_epi32(zero, lomask, _mm512_shuffle_epi32(expraw, _MM_PERM_CDAB)), 20 ), longexp ), _MM_PERM_CCAA ); // Get mantisa of each double in op static const long implicit_mantisa_val = 0x0010000000000000; __m512i implicit_mantisa = _mm512_extload_epi64(&implicit_mantisa_val, _MM_UPCONV_EPI64_NONE, _MM_BROADCAST_1X8, _MM_HINT_NONE); __m512i mantisa = _mm512_or_epi64(_mm512_and_epi64(_mm512_castpd_si512(op), mant), implicit_mantisa); // Get mask with 52-shifted exponent less than 32 __mmask16 exp52lt32 = _mm512_cmplt_epi32_mask(exp52, ceil32); // Get mask with 52-shifted exponent less than 32 and not zero __mmask16 exp52lt32nz = _mm512_kand(himask, _mm512_mask_cmp_epi32_mask(exp52lt32, exp52, zero, _MM_CMPINT_NE)); // Get mask for numbers with 52-shifted exponent less than 11 static const int ceil11_val = 0x0000000b; __m512i ceil11 = _mm512_extload_epi32(&ceil11_val, _MM_UPCONV_EPI32_NONE, _MM_BROADCAST_1X16, _MM_HINT_NONE); __mmask16 exp52lt11 = _mm512_cmplt_epi32_mask(exp52, ceil11); // Get operand with all bits set to 1 static const long sign_val = 0x8000000000000000; __m512i sign = _mm512_extload_epi64(&sign_val, _MM_UPCONV_EPI64_NONE, _MM_BROADCAST_1X8, _MM_HINT_NONE); // Get adjusted mantisa for numbers with exponents in range [52, 63) __m512i zmm13 = _mm512_sllv_epi32(mantisa, exp52); zmm13 = _mm512_mask_or_epi32(zmm13, exp52lt32nz, zmm13, _mm512_shuffle_epi32(_mm512_srlv_epi32(mantisa, _mm512_subr_epi32(exp52, ceil32)), _MM_PERM_CDAB)); result = _mm512_mask_mov_epi32(sign, exp52lt11, zmm13); // // Get mask with 52-shifted exponent less than 32 // __mmask16 exp52lt32 = _mm512_cmplt_epi32_mask(exp52, ceil32); // // // Get mask with 52-shifted exponent less than 32 and not zero // __mmask16 exp52lt32nz = _mm512_kand(himask, _mm512_mask_cmp_epi32_mask(exp52lt32, exp52, zero, _MM_CMPINT_NE)); // // // Get mantisa of each double in op // static const long implicit_mantisa_val = 0x0010000000000000; // __m512i implicit_mantisa = _mm512_extload_epi64(&implicit_mantisa_val, _MM_UPCONV_EPI64_NONE, _MM_BROADCAST_1X8, _MM_HINT_NONE); // __m512i mantisa = _mm512_or_epi64(_mm512_and_epi64(_mm512_castpd_si512(op), mant), implicit_mantisa); // // // Get adjusted mantisa for numbers with exponents in range [52+32, 52+64) // result = _mm512_sllv_epi32(_mm512_mask_mov_epi32(zero, himask, _mm512_shuffle_epi32(mantisa, _MM_PERM_CDAB)), _mm512_sub_epi32(exp52, ceil32)); // // // Get adjusted mantisa for numbers with exponents in range [52, 52+32) // __m512i zmm13 = _mm512_sllv_epi32(mantisa, exp52); // zmm13 = _mm512_mask_or_epi32(zmm13, exp52lt32nz, zmm13, _mm512_shuffle_epi32(_mm512_srlv_epi32(mantisa, _mm512_subr_epi32(exp52, ceil32)), _MM_PERM_CDAB)); // result = _mm512_mask_mov_epi32(result, exp52lt32, zmm13); // For numbers less than 2^52 in absolute value result = _mm512_mask_mov_epi64( result, _mm512_cmplt_pd_mask(_mm512_castsi512_pd(expraw), _mm512_castsi512_pd(num2to52)), _mm512_sub_epi32(_mm512_castpd_si512(_mm512_add_round_pd(_mm512_castsi512_pd(num2to52), _mm512_castsi512_pd(absop), _MM_FROUND_TO_ZERO)), num2to52) ); // For negative numbers find their 2's complement __mmask16 borrow, borrow2; __m512i numneg = _mm512_mask_subsetb_epi32(zero, lomask, lomask, result, &borrow); int bint = _mm512_mask2int(borrow); bint += bint; borrow2 = _mm512_int2mask(bint); numneg = _mm512_mask_sbb_epi32(numneg, himask, borrow2, result, &borrow); result = _mm512_castpd_si512( _mm512_mask_mov_pd( _mm512_castsi512_pd(result), _mm512_cmplt_pd_mask(op, _mm512_castsi512_pd(zero)), _mm512_castsi512_pd(numneg) ) ); return result; // Test fixture //union dtol { // double dbl; // long lng; //}; // //int main(int argc, char **argv) { // alignas(64) double src[8]; // alignas(64) long dst[8]; // // std::srand(std::time(NULL)); // for(int i = 0; i < 8; ++i) { // src[i] = 1.0; // for(long j = 0; j < 10000; ++j) { // src[i] += (std::rand()%2 ? -1.0 : 1.0)*(double)std::rand(); // } // } // //long raw = 0x473fffffffffffff; // //long raw = 0x472fffffffffffff; // //long raw = 0x4730000000000000; // //long raw = 0x4720000000000000; // //long raw = 0x440fffffffffffff; // //long raw = 0x43d7ee740579ae20; // //long raw = 0xc3e7ee740579ae20; // //long raw = 0xc3efffffffffffff; // //long raw = 0x43d43cd0d251fa54; // //_mm512_store_pd(src, _mm512_castsi512_pd(_mm512_extload_epi64(&raw, _MM_UPCONV_EPI64_NONE, _MM_BROADCAST_1X8, _MM_HINT_NONE))); // // _mm512_store_si512(dst, cvt(_mm512_load_pd(src))); // // dtol t; // for(int i = 0; i < 8; ++i) { // t.dbl = src[i]; // std::cout << std::dec << "custom cvt: 0x" << std::hex << dst[i] << ", " << std::dec << dst[i]; // std::cout << std::dec << ", compiler cvt: 0x" << std::hex << (long)src[i] << ", " << std::dec << (long)src[i]; // std::cout << ", original number: 0x" << std::hex << t.lng << std::dec << ", " << src[i] << std::endl; // assert(dst[i] == (long)src[i]); // } // // return 0; //} #endif } // double -> float inline __m512 cvt512_pd_pslo(__m512d op) { return _mm512_cvtpd_pslo(op); } inline __m512 cvt512_pd_pshi(__m512d op) { __m512 temp = _mm512_cvtpd_pslo(op); #if defined(SIMD_AVX512F) return _mm512_shuffle_f32x4(temp, temp, _MM_SHUFFLE(1, 0, 3, 2)); #else return _mm512_permute4f128_ps(temp, _MM_PERM_BADC); #endif } inline __m512 cvt512_pdx2_ps(__m512d hi, __m512d lo) { return _mm512_mask_blend_ps(_mm512_int2mask(0b0000000011111111), cvt512_pd_pshi(hi), cvt512_pd_pslo(lo)); } /* mask supplementary functions */ inline __mmask16 maskconvert16(__mmask16 m) { return m; } inline __mmask16 maskconvert16(__mmask8 m) { return _mm512_kmovlhb(m, m); } /* mask_set(...) implementations */ template<typename T, int NW> mask<T, NW>& mask_set(mask<T, NW> &m, bool value) { const int val = (value ? 0xffffffff : 0x0); for(int i = 0; i < type_traits<T, NW>::num_regs; ++i) { m(i) = _mm512_int2mask(val); } return m; } template<typename T, int NW> mask<T, NW>& mask_set(mask<T, NW> &m, rindex ari, bool value) { const int val = (value ? 0xffffffff : 0x0); m(ari) = _mm512_int2mask(val); return m; } template<typename T, int NW> mask<T, NW>& mask_set(mask<T, NW> &m, vindex avi, bool value) { int ari = avi / type_traits<T, NW>::num_vals_per_reg; int v = avi % type_traits<T, NW>::num_vals_per_reg; int right = v * type_traits<T, NW>::num_bvals_per_val; int left = 32 - right - type_traits<T, NW>::num_bvals_per_val; unsigned int filter_value = _mm512_mask2int(m(ari)); filter_value = (value ? ~filter_value : filter_value); filter_value <<= left; filter_value >>= (left+right); filter_value <<= right; m(ari) = _mm512_kxor(m(ari), _mm512_mask2int(filter_value)); return m; } template<typename T, int NW> mask<T, NW>& mask_set(mask<T, NW> &m, bindex abi, bool value) { int ari = abi / type_traits<T, NW>::num_bvals_per_reg; int b = abi % type_traits<T, NW>::num_bvals_per_reg; int filter_value = (0x1 << b); if(value) { m(ari) = _mm512_kor(m(ari), _mm512_int2mask(filter_value)); } else { m(ari) = _mm512_kandnr(m(ari), _mm512_int2mask(filter_value)); } return m; } template<typename T, int NW> mask<T, NW>& mask_set(mask<T, NW> &m, rindex ari, vindex v, bool value) { int right = v * type_traits<T, NW>::num_bvals_per_val; int left = 32 - right - type_traits<T, NW>::num_bvals_per_val; unsigned int filter_value = _mm512_mask2int(m(ari)); filter_value = (value ? ~filter_value : filter_value); filter_value <<= left; filter_value >>= (left+right); filter_value <<= right; m(ari) = _mm512_kxor(m(ari), _mm512_mask2int(filter_value)); return m; } template<typename T, int NW> mask<T, NW>& mask_set(mask<T, NW> &m, rindex ari, bindex b, bool value) { int filter_value = (0x1 << b); if(value) { m(ari) = _mm512_kor(m(ari), _mm512_int2mask(filter_value)); } else { m(ari) = _mm512_kandnr(m(ari), _mm512_int2mask(filter_value)); } return m; } template<typename T, int NW> mask<T, NW>& mask_set(mask<T, NW> &m, vindex avi, bindex b, bool value) { int ari = avi / type_traits<T>::num_vals_per_reg; int v = avi % type_traits<T>::num_vals_per_reg; int bstart = v * type_traits<T, NW>::num_bvals_per_val + b; int filter_value = (0x1 << bstart); if(value) { m(ari) = _mm512_kor(m(ari), _mm512_int2mask(filter_value)); } else { m(ari) = _mm512_kandnr(m(ari), _mm512_int2mask(filter_value)); } return m; } template<typename T, int NW> mask<T, NW>& mask_set(mask<T, NW> &m, rindex ari, vindex v, bindex b, bool value) { int bstart = v * type_traits<T, NW>::num_bvals_per_val + b; int filter_value = (0x1 << bstart); if(value) { m(ari) = _mm512_kor(m(ari), _mm512_int2mask(filter_value)); } else { m(ari) = _mm512_kandnr(m(ari), _mm512_int2mask(filter_value)); } return m; } /* mask_reset(...) implementations */ template<typename T, int NW> mask<T, NW>& mask_reset(mask<T, NW> &m) { __mmask16 zero; zero = _mm512_kxor(zero, zero); for(int i = 0; i < type_traits<T, NW>::num_regs; ++i) { m(i) = zero; } return m; } template<typename T, int NW> mask<T, NW>& mask_reset(mask<T, NW> &m, rindex ari) { __mmask16 zero; m(ari) = _mm512_kxor(zero, zero); return m; } template<typename T, int NW> mask<T, NW>& mask_reset(mask<T, NW> &m, vindex avi) { return mask_set(m, avi, false); } template<typename T, int NW> mask<T, NW>& mask_reset(mask<T, NW> &m, bindex abi) { return mask_set(m, abi, false); } template<typename T, int NW> mask<T, NW>& mask_reset(mask<T, NW> &m, rindex ari, vindex v) { return mask_set(m, ari, v, false); } template<typename T, int NW> mask<T, NW>& mask_reset(mask<T, NW> &m, rindex ari, bindex b) { return mask_set(m, ari, b, false); } template<typename T, int NW> mask<T, NW>& mask_reset(mask<T, NW> &m, vindex avi, bindex b) { return mask_set(m, avi, b, false); } template<typename T, int NW> mask<T, NW>& mask_reset(mask<T, NW> &m, rindex ari, vindex v, bindex b) { return mask_set(m, ari, v, b, false); } /* mask_flip(...) implementations */ template<typename T, int NW> mask<T, NW>& mask_flip(mask<T, NW> &m) { for(int i = 0; i < type_traits<T, NW>::num_regs; ++i) { m(i) = _mm512_knot(m(i)); } return m; } template<typename T, int NW> mask<T, NW>& mask_flip(mask<T, NW> &m, rindex ari) { m(ari) = _mm512_knot(m(ari)); return m; } template<typename T, int NW> mask<T, NW>& mask_flip(mask<T, NW> &m, vindex avi) { int ari = avi / type_traits<T, NW>::num_vals_per_reg; int v = avi % type_traits<T, NW>::num_vals_per_reg; int right = v * type_traits<T, NW>::num_bvals_per_val; int left = 32 - right - type_traits<T, NW>::num_bvals_per_val; unsigned int filter_value = (((0xffffffffu << left) >> (left+right)) << right); m(ari) = _mm512_kxor(m(ari), _mm512_int2mask(filter_value)); return m; } template<typename T, int NW> mask<T, NW>& mask_flip(mask<T, NW> &m, bindex abi) { int ari = abi / type_traits<T, NW>::num_bvals_per_reg; int b = abi % type_traits<T, NW>::num_bvals_per_reg; int filter_value = 0x1 << b; m(ari) = _mm512_kxor(m(ari), _mm512_int2mask(filter_value)); return m; } template<typename T, int NW> mask<T, NW>& mask_flip(mask<T, NW> &m, rindex ari, vindex v) { int right = v * type_traits<T, NW>::num_bvals_per_val; int left = 32 - right - type_traits<T, NW>::num_bvals_per_val; unsigned int filter_value = (((0xffffffffu << left) >> (left+right)) << right); m(ari) = _mm512_kxor(m(ari), _mm512_int2mask(filter_value)); return m; } template<typename T, int NW> mask<T, NW>& mask_flip(mask<T, NW> &m, rindex ari, bindex b) { int filter_value = 0x1 << b; m(ari) = _mm512_kxor(m(ari), _mm512_int2mask(filter_value)); return m; } template<typename T, int NW> mask<T, NW>& mask_flip(mask<T, NW> &m, vindex avi, bindex b) { int ari = avi / type_traits<T, NW>::num_vals_per_reg; int v = avi % type_traits<T, NW>::num_vals_per_reg; int bstart = v * type_traits<T, NW>::num_bvals_per_val + b; int filter_value = 0x1 << bstart; m(ari) = _mm512_kxor(m(ari), _mm512_int2mask(filter_value)); return m; } template<typename T, int NW> mask<T, NW>& mask_flip(mask<T, NW> &m, rindex ari, vindex v, bindex b) { int bstart = v * type_traits<T, NW>::num_bvals_per_val + b; int filter_value = 0x1 << bstart; m(ari) = _mm512_kxor(m(ari), _mm512_int2mask(filter_value)); return m; } /* mask_all(...) implementations */ template<typename T, int NW> bool mask_all(const mask<T, NW> &m) { bool value = true; for(int i = 0; i < type_traits<T, NW>::num_regs; ++i) { __mmask16 temp = maskconvert16(m(i)); value = value && (bool)_mm512_kortestc(temp, temp); } return value; } template<typename T, int NW> bool mask_all(const mask<T, NW> &m, rindex ari) { __mmask16 temp = maskconvert16(m(ari)); return (bool)_mm512_kortestc(temp, temp); } template<typename T, int NW> bool mask_all(const mask<T, NW> &m, vindex avi) { int ari = avi / type_traits<T, NW>::num_vals_per_reg; int v = avi % type_traits<T, NW>::num_vals_per_reg; int right = v * type_traits<T, NW>::num_bvals_per_val; int left = 32 - right - type_traits<T, NW>::num_bvals_per_val; unsigned int filter_value = ~(((0xffffffffu << left) >> (right+left)) << right); return _mm512_kortestc(m(ari), _mm512_int2mask(filter_value)); } template<typename T, int NW> bool mask_all(const mask<T, NW> &m, rindex ari, vindex v) { int right = v * type_traits<T, NW>::num_bvals_per_val; int left = 32 - right - type_traits<T, NW>::num_bvals_per_val; unsigned int filter_value = ~(((0xffffffffu << left) >> (right+left)) << right); return _mm512_kortestc(m(ari), _mm512_int2mask(filter_value)); } /* mask_any(...) implementations */ template<typename T, int NW> bool mask_any(const mask<T, NW> &m) { bool value = false; for(int i = 0; i < type_traits<T, NW>::num_regs; ++i) { value = value || !(bool)_mm512_kortestz(m(i), m(i)); } return value; } template<typename T, int NW> bool mask_any(const mask<T, NW> &m, rindex ari) { return !(bool)_mm512_kortestz(m(ari), m(ari)); } template<typename T, int NW> bool mask_any(const mask<T, NW> &m, vindex avi) { int ari = avi / type_traits<T, NW>::num_vals_per_reg; int v = avi % type_traits<T, NW>::num_vals_per_reg; int right = v * type_traits<T, NW>::num_bvals_per_val; int left = 32 - right - type_traits<T, NW>::num_bvals_per_val; unsigned int filter_value = (((0xffffffffu << left) >> (right+left)) << right); __mmask16 filtered_mask = _mm512_kand(m(ari), _mm512_int2mask(filter_value)); return !((bool)_mm512_kortestz(filtered_mask, filtered_mask)); } template<typename T, int NW> bool mask_any(const mask<T, NW> &m, rindex ari, vindex v) { int right = v * type_traits<T, NW>::num_bvals_per_val; int left = 32 - right - type_traits<T, NW>::num_bvals_per_val; unsigned int filter_value = (((0xffffffffu << left) >> (right+left)) << right); __mmask16 filtered_mask = _mm512_kand(m(ari), _mm512_int2mask(filter_value)); return !_mm512_kortestz(filtered_mask, filtered_mask); } /* mask_none(...) implementations */ template<typename T, int NW> bool mask_none(const mask<T, NW> &m) { bool value = true; for(int i = 0; i < type_traits<T, NW>::num_regs; ++i) { value = value && (bool)_mm512_kortestz(m(i), m(i)); } return value; } template<typename T, int NW> bool mask_none(const mask<T, NW> &m, rindex ari) { return (bool)_mm512_kortestz(m(ari), m(ari)); } template<typename T, int NW> bool mask_none(const mask<T, NW> &m, vindex avi) { int ari = avi / type_traits<T, NW>::num_vals_per_reg; int v = avi % type_traits<T, NW>::num_vals_per_reg; int right = v * type_traits<T, NW>::num_bvals_per_val; int left = 32 - right - type_traits<T, NW>::num_bvals_per_val; unsigned int filter_value = (((0xffffffffu << left) >> (right+left)) << right); __mmask16 filtered_mask = _mm512_kand(m(ari), _mm512_int2mask(filter_value)); return _mm512_kortestz(filtered_mask, filtered_mask); } template<typename T, int NW> bool mask_none(const mask<T, NW> &m, rindex ari, vindex v) { int right = v * type_traits<T, NW>::num_bvals_per_val; int left = 32 - right - type_traits<T, NW>::num_bvals_per_val; unsigned int filter_value = (((0xffffffffu << left) >> (right+left)) << right); __mmask16 filtered_mask = _mm512_kand(m(ari), _mm512_int2mask(filter_value)); return _mm512_kortestz(filtered_mask, filtered_mask); } /* mask_test(...) implementations */ template<typename T, int NW> bool mask_test(const mask<T, NW> &m, bindex abi) { int ari = abi / type_traits<T, NW>::num_bvals_per_reg; int b = abi % type_traits<T, NW>::num_bvals_per_reg; __mmask16 filtered_mask = _mm512_kand(m(ari), _mm512_int2mask(0x1 << b)); return !_mm512_kortestz(filtered_mask, filtered_mask); } template<typename T, int NW> bool mask_test(const mask<T, NW> &m, rindex ari, bindex b) { __mmask16 filtered_mask = _mm512_kand(m(ari), _mm512_int2mask(0x1 << b)); return !_mm512_kortestz(filtered_mask, filtered_mask); } /* Functions to set value to zero */ template<typename T, int NW, int W> inline void set_zero(pack<T, NW, __m512i, int, W> &op) { for(int i = 0; i < pack<T, NW, __m512i, int, W>::num_regs; ++i) { #if defined(SIMD_AVX512F) op(i) = _mm512_setzero_si512(); #else __m512i a; op(i) = _mm512_xor_si512(a, a); #endif } } template<typename T, int NW, int W> inline void set_zero(pack<T, NW, __m512i, long, W> &op) { for(int i = 0; i < pack<T, NW, __m512i, long, W>::num_regs; ++i) { #if defined(SIMD_AVX512F) op(i) = _mm512_setzero_si512(); #else __m512i a; op(i) = _mm512_xor_si512(a, a); #endif } } template<typename T, int NW, int W> inline void set_zero(pack<T, NW, __m512, float, W> &op) { for(int i = 0; i < pack<T, NW, __m512, float, W>::num_regs; ++i) { #if defined(SIMD_AVX512F) op(i) = _mm512_setzero_ps(); #else __m512i a; op(i) = _mm512_castsi512_ps(_mm512_xor_si512(a, a)); #endif } } template<typename T, int NW, int W> inline void set_zero(pack<T, NW, __m512d, double, W> &op) { for(int i = 0; i < pack<T, NW, __m512d, double, W>::num_regs; ++i) { #if defined(SIMD_AVX512F) op(i) = _mm512_setzero_pd(); #else __m512i a; op(i) = _mm512_castsi512_pd(_mm512_xor_si512(a, a)); #endif } } /* Function to set all elements of a pack to a scalar value */ template<typename T, int NW, int W> inline void set_scalar(pack<T, NW, __m512i, int, W> &op, int value) { #if defined(SIMD_AVX512F) for(int i = 0; i < pack<T, NW, __m512i, int, W>::num_regs; ++i) { op(i) = _mm512_set1_epi32(value); } #else __m512i temp = _mm512_extload_epi32(&value, _MM_UPCONV_EPI32_NONE, _MM_BROADCAST_1X16, _MM_HINT_NONE); for(int i = 0; i < pack<T, NW, __m512i, int, W>::num_regs; ++i) { op(i) = temp; } #endif } template<typename T, int NW, int W> inline void set_scalar(pack<T, NW, __m512i, long, W> &op, long value) { #if defined(SIMD_AVX512F) for(int i = 0; i < pack<T, NW, __m512i, long, W>::num_regs; ++i) { op(i) = _mm512_set1_epi64((__int64)value); } #else __m512i temp = _mm512_extload_epi64(&value, _MM_UPCONV_EPI64_NONE, _MM_BROADCAST_1X8, _MM_HINT_NONE); for(int i = 0; i < pack<T, NW, __m512i, long, W>::num_regs; ++i) { op(i) = temp; } #endif } template<typename T, int NW, int W> inline void set_scalar(pack<T, NW, __m512, float, W> &op, float value) { #if defined(SIMD_AVX512F) for(int i = 0; i < pack<T, NW, __m512, float, W>::num_regs; ++i) { op(i) = _mm512_set1_ps(value); } #else __m512 temp = _mm512_extload_ps(&value, _MM_UPCONV_PS_NONE, _MM_BROADCAST_1X16, _MM_HINT_NONE); for(int i = 0; i < pack<T, NW, __m512, float, W>::num_regs; ++i) { op(i) = temp; } #endif } template<typename T, int NW, int W> inline void set_scalar(pack<T, NW, __m512d, double, W> &op, double value) { #if defined(SIMD_AVX512F) for(int i = 0; i < pack<T, NW, __m512d, double, W>::num_regs; ++i) { op(i) = _mm512_set1_pd(value); } #else __m512d temp = _mm512_extload_pd(&value, _MM_UPCONV_PD_NONE, _MM_BROADCAST_1X8, _MM_HINT_NONE); for(int i = 0; i < pack<T, NW, __m512d, double, W>::num_regs; ++i) { op(i) = temp; } #endif } /* Arithmetic operator: + */ template<typename T, int NW, int W> inline pack<T, NW, __m512i, int, W> operator+(const pack<T, NW, __m512i, int, W> &lhs, const pack<T, NW, __m512i, int, W> &rhs) { pack<T, NW, __m512i, int, W> temp; for(int i = 0; i < pack<T, NW, __m512i, int, W>::num_regs; ++i) { temp(i) = _mm512_add_epi32(lhs(i), rhs(i)); } return temp; } template<typename T, int NW, int W> inline pack<T, NW, __m512i, long, W> operator+(const pack<T, NW, __m512i, long, W> &lhs, const pack<T, NW, __m512i, long, W> &rhs) { pack<T, NW, __m512i, long, W> temp; for(int i = 0; i < pack<T, NW, __m512i, long, W>::num_regs; ++i) { temp(i) = _mm512_add_epi64(lhs(i), rhs(i)); } return temp; } template<typename T, int NW, int W> inline pack<T, NW, __m512, float, W> operator+(const pack<T, NW, __m512, float, W> &lhs, const pack<T, NW, __m512, float, W> &rhs) { pack<T, NW, __m512, float, W> temp; for(int i = 0; i < pack<T, NW, __m512, float, W>::num_regs; ++i) { temp(i) = _mm512_add_ps(lhs(i), rhs(i)); } return temp; } template<typename T, int NW, int W> inline pack<T, NW, __m512d, double, W> operator+(const pack<T, NW, __m512d, double, W> &lhs, const pack<T, NW, __m512d, double, W> &rhs) { pack<T, NW, __m512d, double, W> temp; for(int i = 0; i < pack<T, NW, __m512d, double, W>::num_regs; ++i) { temp(i) = _mm512_add_pd(lhs(i), rhs(i)); } return temp; } /* Arithmetic operator: - */ template<typename T, int NW, int W> inline pack<T, NW, __m512i, int, W> operator-(const pack<T, NW, __m512i, int, W> &lhs, const pack<T, NW, __m512i, int, W> &rhs) { pack<T, NW, __m512i, int, W> temp; for(int i = 0; i < pack<T, NW, __m512i, int, W>::num_regs; ++i) { temp(i) = _mm512_sub_epi32(lhs(i), rhs(i)); } return temp; } template<typename T, int NW, int W> inline pack<T, NW, __m512i, long, W> operator-(const pack<T, NW, __m512i, long, W> &lhs, const pack<T, NW, __m512i, long, W> &rhs) { pack<T, NW, __m512i, long, W> temp; #if defined(SIMD_KNC) __mmask16 borrow; __mmask16 mask1 = _mm512_int2mask(0x5555); #endif for(int i = 0; i < pack<T, NW, __m512i, long, W>::num_regs; ++i) { #if defined(SIMD_AVX512F) temp(i) = _mm512_sub_epi64(lhs(i), rhs(i)); #else temp(i) = _mm512_mask_subsetb_epi32(lhs(i), mask1, _mm512_int2mask(0x0000), rhs(i), &borrow); borrow = _mm512_int2mask(_mm512_mask2int(borrow) << 1); temp(i) = _mm512_sbb_epi32(lhs(i), borrow, rhs(i), &borrow); #endif } return temp; } template<typename T, int NW, int W> inline pack<T, NW, __m512, float, W> operator-(const pack<T, NW, __m512, float, W> &lhs, const pack<T, NW, __m512, float, W> &rhs) { pack<T, NW, __m512, float, W> temp; for(int i = 0; i < pack<T, NW, __m512, float, W>::num_regs; ++i) { temp(i) = _mm512_sub_ps(lhs(i), rhs(i)); } return temp; } template<typename T, int NW, int W> inline pack<T, NW, __m512d, double, W> operator-(const pack<T, NW, __m512d, double, W> &lhs, const pack<T, NW, __m512d, double, W> &rhs) { pack<T, NW, __m512d, double, W> temp; for(int i = 0; i < pack<T, NW, __m512d, double, W>::num_regs; ++i) { temp(i) = _mm512_sub_pd(lhs(i), rhs(i)); } return temp; } /* Arithmetic operator: * */ template<typename T, int NW, int W> inline pack<T, NW, __m512i, int, W> operator*(const pack<T, NW, __m512i, int, W> &lhs, const pack<T, NW, __m512i, int, W> &rhs) { pack<T, NW, __m512i, int, W> temp; for(int i = 0; i < pack<T, NW, __m512i, int, W>::num_regs; ++i) { temp(i) = _mm512_mullo_epi32(lhs(i), rhs(i)); } return temp; } template<typename T, int NW, int W> inline pack<T, NW, __m512i, long, W> operator*(const pack<T, NW, __m512i, long, W> &lhs, const pack<T, NW, __m512i, long, W> &rhs) { pack<T, NW, __m512i, long, W> temp; #if defined(SIMD_KNC) __m512i zero; zero = _mm512_xor_epi32(zero, zero); __mmask16 lomask = _mm512_int2mask(0x5555); __mmask16 himask = _mm512_int2mask(0xAAAA); #endif for(int i = 0; i < pack<T, NW, __m512i, long, W>::num_regs; ++i) { #if defined(SIMD_AVX512F) temp(i) = _mm512_mullo_epi64(lhs(i), rhs(i)); #else __m512i res0 = _mm512_mullo_epi32(lhs(i), rhs(i)); __m512i res1 = _mm512_shuffle_epi32( _mm512_mask_mulhi_epu32(zero, lomask, lhs(i), rhs(i)), _MM_PERM_CDAB ); __m512i rhsswap = _mm512_shuffle_epi32(rhs(i), _MM_PERM_CDAB); __m512i res2 = _mm512_mullo_epi32(lhs(i), rhsswap); __m512i res3 = _mm512_shuffle_epi32(res2, _MM_PERM_CDAB); __m512i res4 = _mm512_mask_add_epi32(zero, himask, res2, res3); temp(i) = _mm512_add_epi32(_mm512_add_epi32(res0, res1), res4); #endif } return temp; } template<typename T, int NW, int W> inline pack<T, NW, __m512, float, W> operator*(const pack<T, NW, __m512, float, W> &lhs, const pack<T, NW, __m512, float, W> &rhs) { pack<T, NW, __m512, float, W> temp; for(int i = 0; i < pack<T, NW, __m512, float, W>::num_regs; ++i) { temp(i) = _mm512_mul_ps(lhs(i), rhs(i)); } return temp; } template<typename T, int NW, int W> inline pack<T, NW, __m512d, double, W> operator*(const pack<T, NW, __m512d, double, W> &lhs, const pack<T, NW, __m512d, double, W> &rhs) { pack<T, NW, __m512d, double, W> temp; for(int i = 0; i < pack<T, NW, __m512d, double, W>::num_regs; ++i) { temp(i) = _mm512_mul_pd(lhs(i), rhs(i)); } return temp; } /* Arithmetic operator: / */ template<typename T, int NW, int W> inline pack<T, NW, __m512i, int, W> operator/(const pack<T, NW, __m512i, int, W> &lhs, const pack<T, NW, __m512i, int, W> &rhs) { pack<T, NW, __m512i, int, W> temp; for(int i = 0; i < pack<T, NW, __m512i, int, W>::num_regs; ++i) { temp(i) = _mm512_div_epi32(lhs(i), rhs(i)); } return temp; } template<typename T, int NW, int W> inline pack<T, NW, __m512i, long, W> operator/(const pack<T, NW, __m512i, long, W> &lhs, const pack<T, NW, __m512i, long, W> &rhs) { pack<T, NW, __m512i, long, W> temp; for(int i = 0; i < pack<T, NW, __m512i, long, W>::num_regs; ++i) { temp(i) = _mm512_div_epi64(lhs(i), rhs(i)); } return temp; } template<typename T, int NW, int W> inline pack<T, NW, __m512, float, W> operator/(const pack<T, NW, __m512, float, W> &lhs, const pack<T, NW, __m512, float, W> &rhs) { pack<T, NW, __m512, float, W> temp; for(int i = 0; i < pack<T, NW, __m512, float, W>::num_regs; ++i) { temp(i) = _mm512_div_ps(lhs(i), rhs(i)); } return temp; } template<typename T, int NW, int W> inline pack<T, NW, __m512d, double, W> operator/(const pack<T, NW, __m512d, double, W> &lhs, const pack<T, NW, __m512d, double, W> &rhs) { pack<T, NW, __m512d, double, W> temp; for(int i = 0; i < pack<T, NW, __m512d, double, W>::num_regs; ++i) { temp(i) = _mm512_div_pd(lhs(i), rhs(i)); } return temp; } /* Arithmetic operator: % - only for integer types */ template<typename T, int NW, int W> inline pack<T, NW, __m512i, int, W> operator%(const pack<T, NW, __m512i, int, W> &lhs, const pack<T, NW, __m512i, int, W> &rhs) { pack<T, NW, __m512i, int, W> temp; for(int i = 0; i < pack<T, NW, __m512i, int, W>::num_regs; ++i) { temp(i) = _mm512_rem_epi32(lhs(i), rhs(i)); } return temp; } template<typename T, int NW, int W> inline pack<T, NW, __m512i, long, W> operator%(const pack<T, NW, __m512i, long, W> &lhs, const pack<T, NW, __m512i, long, W> &rhs) { pack<T, NW, __m512i, long, W> temp; for(int i = 0; i < pack<T, NW, __m512i, long, W>::num_regs; ++i) { temp(i) = _mm512_rem_epi64(lhs(i), rhs(i)); } return temp; } /* Comparison operator: == */ template<typename T, int NW, int W> inline typename pack<T, NW, __m512i, int, W>::mask_type operator==(const pack<T, NW, __m512i, int, W> &lhs, const pack<T, NW, __m512i, int, W> &rhs) { typename pack<T, NW, __m512i, int, W>::mask_type temp; for(int i = 0; i < pack<T, NW, __m512i, int, W>::num_regs; ++i) { temp(i) = _mm512_cmpeq_epi32_mask(lhs(i), rhs(i)); } return temp; } template<typename T, int NW, int W> inline typename pack<T, NW, __m512i, long, W>::mask_type operator==(const pack<T, NW, __m512i, long, W> &lhs, const pack<T, NW, __m512i, long, W> &rhs) { typename pack<T, NW, __m512i, long, W>::mask_type temp; for(int i = 0; i < pack<T, NW, __m512i, long, W>::num_regs; ++i) { #if defined(SIMD_AVX512F) temp(i) = _mm512_cmpeq_epi64_mask(lhs(i), rhs(i)); #else unsigned int res = _mm512_mask2int(_mm512_cmpeq_epi32_mask(lhs(i), rhs(i))); // temp(i) = _mm512_int2mask(_pext_u32(res & (res >> 1), 0x00005555)); res = (res & (res >> 1)) & 0x55555555; res = (res | (res >> 1)) & 0x33333333; res = (res | (res >> 2)) & 0x0f0f0f0f; res = (res | (res >> 4)) & 0x00ff00ff; temp(i) = _mm512_int2mask(res); #endif } return temp; } template<typename T, int NW, int W> inline typename pack<T, NW, __m512, float, W>::mask_type operator==(const pack<T, NW, __m512, float, W> &lhs, const pack<T, NW, __m512, float, W> &rhs) { typename pack<T, NW, __m512, float, W>::mask_type temp; for(int i = 0; i < pack<T, NW, __m512, float, W>::num_regs; ++i) { temp(i) = _mm512_cmpeq_ps_mask(lhs(i), rhs(i)); } return temp; } template<typename T, int NW, int W> inline typename pack<T, NW, __m512d, double, W>::mask_type operator==(const pack<T, NW, __m512d, double, W> &lhs, const pack<T, NW, __m512d, double, W> &rhs) { typename pack<T, NW, __m512d, double, W>::mask_type temp; for(int i = 0; i < pack<T, NW, __m512d, double, W>::num_regs; ++i) { temp(i) = _mm512_cmpeq_pd_mask(lhs(i), rhs(i)); } return temp; } /* Comparison operator: != */ template<typename T, int NW, int W> inline typename pack<T, NW, __m512i, int, W>::mask_type operator!=(const pack<T, NW, __m512i, int, W> &lhs, const pack<T, NW, __m512i, int, W> &rhs) { typename pack<T, NW, __m512i, int, W>::mask_type temp; for(int i = 0; i < pack<T, NW, __m512i, int, W>::num_regs; ++i) { temp(i) = _mm512_cmpneq_epi32_mask(lhs(i), rhs(i)); } return temp; } template<typename T, int NW, int W> inline typename pack<T, NW, __m512i, long, W>::mask_type operator!=(const pack<T, NW, __m512i, long, W> &lhs, const pack<T, NW, __m512i, long, W> &rhs) { typename pack<T, NW, __m512i, long, W>::mask_type temp; for(int i = 0; i < pack<T, NW, __m512i, long, W>::num_regs; ++i) { #if defined(SIMD_AVX512F) temp(i) = _mm512_cmpneq_epi64_mask(lhs(i), rhs(i)); #else unsigned int res = _mm512_mask2int(_mm512_cmpneq_epi32_mask(lhs(i), rhs(i))); // temp(i) = _mm512_int2mask(_pext_u32(res & (res >> 1), 0x5555)); res = (res | (res >> 1)) & 0x55555555; res = (res | (res >> 1)) & 0x33333333; res = (res | (res >> 2)) & 0x0f0f0f0f; res = (res | (res >> 4)) & 0x00ff00ff; temp(i) = _mm512_int2mask(res); #endif } return temp; } template<typename T, int NW, int W> inline typename pack<T, NW, __m512, float, W>::mask_type operator!=(const pack<T, NW, __m512, float, W> &lhs, const pack<T, NW, __m512, float, W> &rhs) { typename pack<T, NW, __m512, float, W>::mask_type temp; for(int i = 0; i < pack<T, NW, __m512, float, W>::num_regs; ++i) { temp(i) = _mm512_cmpneq_ps_mask(lhs(i), rhs(i)); } return temp; } template<typename T, int NW, int W> inline typename pack<T, NW, __m512d, double, W>::mask_type operator!=(const pack<T, NW, __m512d, double, W> &lhs, const pack<T, NW, __m512d, double, W> &rhs) { typename pack<T, NW, __m512d, double, W>::mask_type temp; for(int i = 0; i < pack<T, NW, __m512d, double, W>::num_regs; ++i) { temp(i) = _mm512_cmpneq_pd_mask(lhs(i), rhs(i)); } return temp; } /* Comparison operator: < */ template<typename T, int NW, int W> inline typename pack<T, NW, __m512i, int, W>::mask_type operator<(const pack<T, NW, __m512i, int, W> &lhs, const pack<T, NW, __m512i, int, W> &rhs) { typename pack<T, NW, __m512i, int, W>::mask_type temp; for(int i = 0; i < pack<T, NW, __m512i, int, W>::num_regs; ++i) { temp(i) = _mm512_cmplt_epi32_mask(lhs(i), rhs(i)); } return temp; } template<typename T, int NW, int W> inline typename pack<T, NW, __m512i, long, W>::mask_type operator<(const pack<T, NW, __m512i, long, W> &lhs, const pack<T, NW, __m512i, long, W> &rhs) { typename pack<T, NW, __m512i, long, W>::mask_type temp; #if defined(SIMD_KNC) __mmask16 oddmask = _mm512_int2mask(0xAAAA); // 1, 3, 5, ... __mmask16 evenmask = _mm512_int2mask(0x5555); // 0, 2, 4, ... #endif for(int i = 0; i < pack<T, NW, __m512i, long, W>::num_regs; ++i) { #if defined(SIMD_AVX512F) temp(i) = _mm512_cmplt_epi64_mask(lhs(i), rhs(i)); #else // unsigned int res = _mm512_mask2int(_mm512_cmplt_epi32_mask(lhs(i), rhs(i))); // temp(i) = _mm512_int2mask(_pext_u32(res & (res >> 1), 0x5555)); // unsigned int res = _mm512_mask2int(_mm512_cmplt_epi32_mask(lhs(i), rhs(i))); // res = (res & (res >> 1)) & 0x55555555; // res = (res | (res >> 1)) & 0x33333333; // res = (res | (res >> 2)) & 0x0f0f0f0f; // res = (res | (res >> 4)) & 0x00ff00ff; // temp(i) = _mm512_int2mask(res); // unsigned int res1 = _mm512_mask2int(_mm512_mask_cmplt_epi32_mask(oddmask, lhs(i), rhs(i))); // unsigned int res2 = _mm512_mask2int(_mm512_mask_cmplt_epu32_mask(evenmask, lhs(i), rhs(i))); // unsigned int res3 = _mm512_mask2int(_mm512_mask_cmpeq_epi32_mask(oddmask, lhs(i), rhs(i))); // unsigned int res = (res1>>1) | (res2 & (res3>>1)); // res = (res | (res >> 1)) & 0x33333333; // res = (res | (res >> 2)) & 0x0f0f0f0f; // res = (res | (res >> 4)) & 0x00ff00ff; // temp(i) = _mm512_int2mask(res); unsigned int res1 = _mm512_mask2int(_mm512_mask_cmpge_epi32_mask(oddmask, lhs(i), rhs(i))); unsigned int res2 = _mm512_mask2int(_mm512_mask_cmpge_epu32_mask(evenmask, lhs(i), rhs(i))); unsigned int res = (res1>>1) & res2; res = (res | (res >> 1)) & 0x33333333; res = (res | (res >> 2)) & 0x0f0f0f0f; res = (res | (res >> 4)) & 0x00ff00ff; temp(i) = _mm512_int2mask(~res); #endif } return temp; } template<typename T, int NW, int W> inline typename pack<T, NW, __m512, float, W>::mask_type operator<(const pack<T, NW, __m512, float, W> &lhs, const pack<T, NW, __m512, float, W> &rhs) { typename pack<T, NW, __m512, float, W>::mask_type temp; for(int i = 0; i < pack<T, NW, __m512, float, W>::num_regs; ++i) { temp(i) = _mm512_cmplt_ps_mask(lhs(i), rhs(i)); } return temp; } template<typename T, int NW, int W> inline typename pack<T, NW, __m512d, double, W>::mask_type operator<(const pack<T, NW, __m512d, double, W> &lhs, const pack<T, NW, __m512d, double, W> &rhs) { typename pack<T, NW, __m512d, double, W>::mask_type temp; for(int i = 0; i < pack<T, NW, __m512d, double, W>::num_regs; ++i) { temp(i) = _mm512_cmplt_pd_mask(lhs(i), rhs(i)); } return temp; } /* Comparison operator: > */ template<typename T, int NW, int W> inline typename pack<T, NW, __m512i, int, W>::mask_type operator>(const pack<T, NW, __m512i, int, W> &lhs, const pack<T, NW, __m512i, int, W> &rhs) { typename pack<T, NW, __m512i, int, W>::mask_type temp; for(int i = 0; i < pack<T, NW, __m512i, int, W>::num_regs; ++i) { temp(i) = _mm512_cmpgt_epi32_mask(lhs(i), rhs(i)); } return temp; } template<typename T, int NW, int W> inline typename pack<T, NW, __m512i, long, W>::mask_type operator>(const pack<T, NW, __m512i, long, W> &lhs, const pack<T, NW, __m512i, long, W> &rhs) { typename pack<T, NW, __m512i, long, W>::mask_type temp; #if defined(SIMD_KNC) __mmask16 oddmask = _mm512_int2mask(0xAAAA); // 1, 3, 5, ... __mmask16 evenmask = _mm512_int2mask(0x5555); // 0, 2, 4, ... #endif for(int i = 0; i < pack<T, NW, __m512i, long, W>::num_regs; ++i) { #if defined(SIMD_AVX512F) temp(i) = _mm512_cmpgt_epi64_mask(lhs(i), rhs(i)); #else // unsigned int res = _mm512_mask2int(_mm512_cmpgt_epi32_mask(lhs(i), rhs(i))); // res = (res & (res >> 1)) & 0x55555555; // res = (res | (res >> 1)) & 0x33333333; // res = (res | (res >> 2)) & 0x0f0f0f0f; // res = (res | (res >> 4)) & 0x00ff00ff; // temp(i) = _mm512_int2mask(res); // unsigned int res = _mm512_mask2int(_mm512_cmpgt_epi32_mask(lhs(i), rhs(i))); // temp(i) = _mm512_int2mask(_pext_u32(res & (res >> 1), 0x5555)); // unsigned int res1 = _mm512_mask2int(_mm512_mask_cmpgt_epi32_mask(oddmask, lhs(i), rhs(i))); // unsigned int res2 = _mm512_mask2int(_mm512_mask_cmpgt_epu32_mask(evenmask, lhs(i), rhs(i))); // unsigned int res3 = _mm512_mask2int(_mm512_mask_cmpeq_epi32_mask(oddmask, lhs(i), rhs(i))); // unsigned int res = (res1>>1) | (res2 & (res3>>1)); // res = (res | (res >> 1)) & 0x33333333; // res = (res | (res >> 2)) & 0x0f0f0f0f; // res = (res | (res >> 4)) & 0x00ff00ff; // temp(i) = _mm512_int2mask(res); unsigned int res1 = _mm512_mask2int(_mm512_mask_cmple_epi32_mask(oddmask, lhs(i), rhs(i))); unsigned int res2 = _mm512_mask2int(_mm512_mask_cmple_epu32_mask(evenmask, lhs(i), rhs(i))); unsigned int res = (res1>>1) & res2; res = (res | (res >> 1)) & 0x33333333; res = (res | (res >> 2)) & 0x0f0f0f0f; res = (res | (res >> 4)) & 0x00ff00ff; temp(i) = _mm512_int2mask(~res); #endif } return temp; } template<typename T, int NW, int W> inline typename pack<T, NW, __m512, float, W>::mask_type operator>(const pack<T, NW, __m512, float, W> &lhs, const pack<T, NW, __m512, float, W> &rhs) { typename pack<T, NW, __m512, float, W>::mask_type temp; for(int i = 0; i < pack<T, NW, __m512, float, W>::num_regs; ++i) { temp(i) = _mm512_cmplt_ps_mask(rhs(i), lhs(i)); } return temp; } template<typename T, int NW, int W> inline typename pack<T, NW, __m512d, double, W>::mask_type operator>(const pack<T, NW, __m512d, double, W> &lhs, const pack<T, NW, __m512d, double, W> &rhs) { typename pack<T, NW, __m512d, double, W>::mask_type temp; for(int i = 0; i < pack<T, NW, __m512d, double, W>::num_regs; ++i) { temp(i) = _mm512_cmplt_pd_mask(rhs(i), lhs(i)); } return temp; } /* Comparison operator: <= */ template<typename T, int NW, int W> inline typename pack<T, NW, __m512i, int, W>::mask_type operator<=(const pack<T, NW, __m512i, int, W> &lhs, const pack<T, NW, __m512i, int, W> &rhs) { typename pack<T, NW, __m512i, int, W>::mask_type temp; for(int i = 0; i < pack<T, NW, __m512i, int, W>::num_regs; ++i) { temp(i) = _mm512_cmple_epi32_mask(lhs(i), rhs(i)); } return temp; } template<typename T, int NW, int W> inline typename pack<T, NW, __m512i, long, W>::mask_type operator<=(const pack<T, NW, __m512i, long, W> &lhs, const pack<T, NW, __m512i, long, W> &rhs) { typename pack<T, NW, __m512i, long, W>::mask_type temp; #if defined(SIMD_KNC) __mmask16 oddmask = _mm512_int2mask(0xAAAA); // 1, 3, 5, ... __mmask16 evenmask = _mm512_int2mask(0x5555); // 0, 2, 4, ... #endif for(int i = 0; i < pack<T, NW, __m512i, long, W>::num_regs; ++i) { #if defined(SIMD_AVX512F) temp(i) = _mm512_cmple_epi64_mask(lhs(i), rhs(i)); #else // unsigned int res = _mm512_mask2int(_mm512_cmple_epi32_mask(lhs(i), rhs(i))); // res = (res & (res >> 1)) & 0x55555555; // res = (res | (res >> 1)) & 0x33333333; // res = (res | (res >> 2)) & 0x0f0f0f0f; // res = (res | (res >> 4)) & 0x00ff00ff; // temp(i) = _mm512_int2mask(res); // unsigned int res = _mm512_mask2int(_mm512_cmple_epi32_mask(lhs(i), rhs(i))); // temp(i) = _mm512_int2mask(_pext_u32(res & (res >> 1), 0x5555)); unsigned int res1 = _mm512_mask2int(_mm512_mask_cmple_epi32_mask(oddmask, lhs(i), rhs(i))); unsigned int res2 = _mm512_mask2int(_mm512_mask_cmple_epu32_mask(evenmask, lhs(i), rhs(i))); unsigned int res = (res1>>1) & res2; res = (res | (res >> 1)) & 0x33333333; res = (res | (res >> 2)) & 0x0f0f0f0f; res = (res | (res >> 4)) & 0x00ff00ff; temp(i) = _mm512_int2mask(res); #endif } return temp; } template<typename T, int NW, int W> inline typename pack<T, NW, __m512, float, W>::mask_type operator<=(const pack<T, NW, __m512, float, W> &lhs, const pack<T, NW, __m512, float, W> &rhs) { typename pack<T, NW, __m512, float, W>::mask_type temp; for(int i = 0; i < pack<T, NW, __m512, float, W>::num_regs; ++i) { temp(i) = _mm512_cmple_ps_mask(lhs(i), rhs(i)); } return temp; } template<typename T, int NW, int W> inline typename pack<T, NW, __m512d, double, W>::mask_type operator<=(const pack<T, NW, __m512d, double, W> &lhs, const pack<T, NW, __m512d, double, W> &rhs) { typename pack<T, NW, __m512d, double, W>::mask_type temp; for(int i = 0; i < pack<T, NW, __m512d, double, W>::num_regs; ++i) { temp(i) = _mm512_cmple_pd_mask(lhs(i), rhs(i)); } return temp; } /* Comparison operator: >= */ template<typename T, int NW, int W> inline typename pack<T, NW, __m512i, int, W>::mask_type operator>=(const pack<T, NW, __m512i, int, W> &lhs, const pack<T, NW, __m512i, int, W> &rhs) { typename pack<T, NW, __m512i, int, W>::mask_type temp; for(int i = 0; i < pack<T, NW, __m512i, int, W>::num_regs; ++i) { temp(i) = _mm512_cmpge_epi32_mask(lhs(i), rhs(i)); } return temp; } template<typename T, int NW, int W> inline typename pack<T, NW, __m512i, long, W>::mask_type operator>=(const pack<T, NW, __m512i, long, W> &lhs, const pack<T, NW, __m512i, long, W> &rhs) { typename pack<T, NW, __m512i, long, W>::mask_type temp; #if defined(SIMD_KNC) __mmask16 oddmask = _mm512_int2mask(0xAAAA); // 1, 3, 5, ... __mmask16 evenmask = _mm512_int2mask(0x5555); // 0, 2, 4, ... #endif for(int i = 0; i < pack<T, NW, __m512i, long, W>::num_regs; ++i) { #if defined(SIMD_AVX512F) temp(i) = _mm512_cmpge_epi64_mask(lhs(i), rhs(i)); #else // unsigned int res = _mm512_mask2int(_mm512_cmpge_epi32_mask(lhs(i), rhs(i))); // res = (res & (res >> 1)) & 0x55555555; // res = (res | (res >> 1)) & 0x33333333; // res = (res | (res >> 2)) & 0x0f0f0f0f; // res = (res | (res >> 4)) & 0x00ff00ff; // temp(i) = _mm512_int2mask(res); // unsigned int res = _mm512_mask2int(_mm512_cmpge_epi32_mask(lhs(i), rhs(i))); // temp(i) = _mm512_int2mask(_pext_u32(res & (res >> 1), 0x5555)); unsigned int res1 = _mm512_mask2int(_mm512_mask_cmpge_epi32_mask(oddmask, lhs(i), rhs(i))); unsigned int res2 = _mm512_mask2int(_mm512_mask_cmpge_epu32_mask(evenmask, lhs(i), rhs(i))); unsigned int res = (res1>>1) & res2; res = (res | (res >> 1)) & 0x33333333; res = (res | (res >> 2)) & 0x0f0f0f0f; res = (res | (res >> 4)) & 0x00ff00ff; temp(i) = _mm512_int2mask(res); #endif } return temp; } template<typename T, int NW, int W> inline typename pack<T, NW, __m512, float, W>::mask_type operator>=(const pack<T, NW, __m512, float, W> &lhs, const pack<T, NW, __m512, float, W> &rhs) { typename pack<T, NW, __m512, float, W>::mask_type temp; for(int i = 0; i < pack<T, NW, __m512, float, W>::num_regs; ++i) { temp(i) = _mm512_cmple_ps_mask(rhs(i), lhs(i)); } return temp; } template<typename T, int NW, int W> inline typename pack<T, NW, __m512d, double, W>::mask_type operator>=(const pack<T, NW, __m512d, double, W> &lhs, const pack<T, NW, __m512d, double, W> &rhs) { typename pack<T, NW, __m512d, double, W>::mask_type temp; for(int i = 0; i < pack<T, NW, __m512d, double, W>::num_regs; ++i) { temp(i) = _mm512_cmple_pd_mask(rhs(i), lhs(i)); } return temp; } /* Function: inverse */ template<typename T, int NW, int W> pack<T, NW, __m512, float, W> inv(const pack<T, NW, __m512, float, W> &op) { pack<T, NW, __m512, float, W> temp; __m512 one = _mm512_set1_ps(1.0f); for(int i = 0; i < pack<T, NW, __m512, float, W>::num_regs; ++i) { temp(i) = _mm512_div_ps(one, op(i)); } return temp; } template<typename T, int NW, int W> pack<T, NW, __m512d, double, W> inv(const pack<T, NW, __m512d, double, W> &op) { pack<T, NW, __m512d, double, W> temp; __m512d one = _mm512_set1_pd(1.0); for(int i = 0; i < pack<T, NW, __m512d, double, W>::num_regs; ++i) { temp(i) = _mm512_div_pd(one, op(i)); } return temp; } /* Function: sin */ template<typename T, int NW, int W> pack<T, NW, __m512, float, W> sin(const pack<T, NW, __m512, float, W> &op) { pack<T, NW, __m512, float, W> temp; for(int i = 0; i < pack<T, NW, __m512, float, W>::num_regs; ++i) { temp(i) = _mm512_sin_ps(op(i)); } return temp; } template<typename T, int NW, int W> pack<T, NW, __m512d, double, W> sin(const pack<T, NW, __m512d, double, W> &op) { pack<T, NW, __m512d, double, W> temp; for(int i = 0; i < pack<T, NW, __m512d, double, W>::num_regs; ++i) { temp(i) = _mm512_sin_pd(op(i)); } return temp; } /* Function: cos */ template<typename T, int NW, int W> pack<T, NW, __m512, float, W> cos(const pack<T, NW, __m512, float, W> &op) { pack<T, NW, __m512, float, W> temp; for(int i = 0; i < pack<T, NW, __m512, float, W>::num_regs; ++i) { temp(i) = _mm512_cos_ps(op(i)); } return temp; } template<typename T, int NW, int W> pack<T, NW, __m512d, double, W> cos(const pack<T, NW, __m512d, double, W> &op) { pack<T, NW, __m512d, double, W> temp; for(int i = 0; i < pack<T, NW, __m512d, double, W>::num_regs; ++i) { temp(i) = _mm512_cos_pd(op(i)); } return temp; } /* Function: tan */ template<typename T, int NW, int W> pack<T, NW, __m512, float, W> tan(const pack<T, NW, __m512, float, W> &op) { pack<T, NW, __m512, float, W> temp; for(int i = 0; i < pack<T, NW, __m512, float, W>::num_regs; ++i) { temp(i) = _mm512_tan_ps(op(i)); } return temp; } template<typename T, int NW, int W> pack<T, NW, __m512d, double, W> tan(const pack<T, NW, __m512d, double, W> &op) { pack<T, NW, __m512d, double, W> temp; for(int i = 0; i < pack<T, NW, __m512d, double, W>::num_regs; ++i) { temp(i) = _mm512_tan_pd(op(i)); } return temp; } /* Function: add adjacent numbers and interleave results */ template<typename T, int NW, int W> pack<T, NW, __m512, float, W> hadd_pairwise_interleave(const pack<T, NW, __m512, float, W> &lhs, const pack<T, NW, __m512, float, W> &rhs) { pack<T, NW, __m512, float, W> temp; for(int i = 0; i < pack<T, NW, __m512, float, W>::num_regs; ++i) { temp(i) = _mm512_mask_blend_ps( _mm512_int2mask(0b1010101010101010), _mm512_add_ps(lhs(i), _mm512_swizzle_ps(lhs(i), _MM_SWIZ_REG_CDAB)), _mm512_add_ps(rhs(i), _mm512_swizzle_ps(rhs(i), _MM_SWIZ_REG_CDAB)) ); } return temp; } template<typename T, int NW, int W> pack<T, NW, __m512d, double, W> hadd_pairwise_interleave(const pack<T, NW, __m512d, double, W> &lhs, const pack<T, NW, __m512d, double, W> &rhs) { pack<T, NW, __m512d, double, W> temp; for(int i = 0; i < pack<T, NW, __m512d, double, W>::num_regs; ++i) { temp(i) = _mm512_mask_blend_pd( _mm512_int2mask(0b1010101010101010), _mm512_add_pd(lhs(i), _mm512_swizzle_pd(lhs(i), _MM_SWIZ_REG_CDAB)), _mm512_add_pd(rhs(i), _mm512_swizzle_pd(rhs(i), _MM_SWIZ_REG_CDAB)) ); } return temp; } /* Load functions */ // unaligned temporal load: int <- int template<typename T, int NW, int W> inline void load(pack<T, NW, __m512i, int, W> &op, const_mptr<int, memhint::temporal|memhint::unaligned> ptr) { typedef pack<T, NW, __m512i, int, W> type_t; int const *p = ptr; #if defined(SIMD_AVX512F) __mmask16 m; m = _mm512_kxnor(m, m); #endif for(int i = 0; i < type_t::num_regs; ++i) { #if defined(SIMD_AVX512F) op(i) = _mm512_maskz_loadu_epi32(m, p); p += type_traits<int>::num_bvals_per_reg; #else op(i) = _mm512_loadunpacklo_epi32(op(i), p); p += type_traits<int>::num_bvals_per_reg; op(i) = _mm512_loadunpackhi_epi32(op(i), p); #endif } } // masked unaligned temporal load: int <- int template<typename T, int NW, int W> inline void load(pack<T, NW, __m512i, int, W> &op, const_mptr<int, memhint::temporal|memhint::unaligned> ptr, const mask<T, NW> &m) { typedef pack<T, NW, __m512i, int, W> type_t; int const *p = ptr; #if !defined(SIMD_AVX512F) __m512i zero; zero = _mm512_xor_si512(zero, zero); #endif for(int i = 0; i < type_t::num_regs; ++i) { #if defined(SIMD_AVX512F) op(i) = _mm512_maskz_loadu_epi32(m(i), p); p += type_traits<int>::num_bvals_per_reg; #else op(i) = _mm512_loadunpacklo_epi32(op(i), p); p += type_traits<int>::num_bvals_per_reg; op(i) = _mm512_loadunpackhi_epi32(op(i), p); op(i) = _mm512_mask_blend_epi32(m(i), zero, op(i)); #endif } } // unaligned temporal load: int <- long template<typename T, int NW, int W> inline void load(pack<T, NW, __m512i, int, W> &op, const_mptr<long, memhint::temporal|memhint::unaligned> ptr) { typedef pack<T, NW, __m512i, int, W> type_t; long const *p = ptr; #if defined(SIMD_AVX512F) __mmask16 m; m = _mm512_kxnor(m, m); #endif for(int i = 0; i < type_t::num_regs; ++i) { __m512i lo, hi; #if defined(SIMD_AVX512F) lo = _mm512_maskz_loadu_epi64(m, p); p += type_traits<long>::num_bvals_per_reg; hi = _mm512_maskz_loadu_epi64(m, p); p += type_traits<long>::num_bvals_per_reg; #else lo = _mm512_loadunpacklo_epi64(lo, p); p += type_traits<long>::num_bvals_per_reg; lo = _mm512_loadunpackhi_epi64(lo, p); hi = _mm512_loadunpacklo_epi64(hi, p); p += type_traits<long>::num_bvals_per_reg; hi = _mm512_loadunpackhi_epi64(hi, p); #endif op(i) = cvt512_epi64x2_epi32(hi, lo); } } // masked unaligned temporal load: int <- long template<typename T, int NW, int W> inline void load(pack<T, NW, __m512i, int, W> &op, const_mptr<long, memhint::temporal|memhint::unaligned> ptr, const mask<T, NW> &m) { typedef pack<T, NW, __m512i, int, W> type_t; long const *p = ptr; #if !defined(SIMD_AVX512F) __m512i zero; zero = _mm512_xor_si512(zero, zero); #endif for(int i = 0; i < type_t::num_regs; ++i) { __m512i lo, hi; __mmask16 himask = _mm512_kmerge2l1h(m(i), m(i)); #if defined(SIMD_AVX512F) lo = _mm512_maskz_loadu_epi64(m(i), p); p += type_traits<long>::num_bvals_per_reg; hi = _mm512_maskz_loadu_epi64(himask, p); p += type_traits<long>::num_bvals_per_reg; #else lo = _mm512_loadunpacklo_epi64(lo, p); p += type_traits<long>::num_bvals_per_reg; lo = _mm512_loadunpackhi_epi64(lo, p); lo = _mm512_mask_blend_epi64(m(i), zero, lo); hi = _mm512_loadunpacklo_epi64(hi, p); p += type_traits<long>::num_bvals_per_reg; hi = _mm512_loadunpackhi_epi64(hi, p); hi = _mm512_mask_blend_epi64(himask, zero, hi); #endif op(i) = cvt512_epi64x2_epi32(hi, lo); } } // unaligned temporal load: int <- float template<typename T, int NW, int W> inline void load(pack<T, NW, __m512i, int, W> &op, const_mptr<float, memhint::temporal|memhint::unaligned> ptr) { typedef pack<T, NW, __m512i, int, W> type_t; float const *p = ptr; for(int i = 0; i < type_t::num_regs; ++i) { __m512 temp; #if defined(SIMD_AVX512F) temp = _mm512_loadu_ps(p); p += type_traits<float>::num_bvals_per_reg; #else temp = _mm512_loadunpacklo_ps(temp, p); p += type_traits<float>::num_bvals_per_reg; temp = _mm512_loadunpackhi_ps(temp, p); #endif op(i) = cvt512_ps_epi32(temp); } } // masked unaligned temporal load: int <- float template<typename T, int NW, int W> inline void load(pack<T, NW, __m512i, int, W> &op, const_mptr<float, memhint::temporal|memhint::unaligned> ptr, const mask<T, NW> &m) { typedef pack<T, NW, __m512i, int, W> type_t; float const *p = ptr; #if !defined(SIMD_AVX512F) __m512 zero; zero = _mm512_castsi512_ps(_mm512_xor_si512(_mm512_castps_si512(zero), _mm512_castps_si512(zero))); #endif for(int i = 0; i < type_t::num_regs; ++i) { __m512 temp; #if defined(SIMD_AVX512F) temp = _mm512_maskz_loadu_ps(m(i), p); p += type_traits<float>::num_bvals_per_reg; #else temp = _mm512_loadunpacklo_ps(temp, p); p += type_traits<float>::num_bvals_per_reg; temp = _mm512_loadunpackhi_ps(temp, p); temp = _mm512_mask_blend_ps(m(i), zero, temp); #endif op(i) = cvt512_ps_epi32(temp); } } // unaligned temporal load: int <- double template<typename T, int NW, int W> inline void load(pack<T, NW, __m512i, int, W> &op, const_mptr<double, memhint::temporal|memhint::unaligned> ptr) { typedef pack<T, NW, __m512i, int, W> type_t; double const *p = ptr; for(int i = 0; i < type_t::num_regs; ++i) { __m512d lo, hi; #if defined(SIMD_AVX512F) lo = _mm512_loadu_pd(p); p += type_traits<double>::num_bvals_per_reg; hi = _mm512_loadu_pd(p); p += type_traits<double>::num_bvals_per_reg; #else lo = _mm512_loadunpacklo_pd(lo, p); p += type_traits<double>::num_bvals_per_reg; lo = _mm512_loadunpackhi_pd(lo, p); hi = _mm512_loadunpacklo_pd(hi, p); p += type_traits<double>::num_bvals_per_reg; hi = _mm512_loadunpackhi_pd(hi, p); #endif op(i) = cvt512_pdx2_epi32(hi, lo); } } // masked unaligned temporal load: int <- double template<typename T, int NW, int W> inline void load(pack<T, NW, __m512i, int, W> &op, const_mptr<double, memhint::temporal|memhint::unaligned> ptr, const mask<T, NW> &m) { typedef pack<T, NW, __m512i, int, W> type_t; double const *p = ptr; #if !defined(SIMD_AVX512F) __m512d zero; zero = _mm512_castsi512_pd(_mm512_xor_si512(_mm512_castpd_si512(zero), _mm512_castpd_si512(zero))); #endif for(int i = 0; i < type_t::num_regs; ++i) { __m512d lo, hi; __mmask16 himask = _mm512_kmerge2l1h(m(i), m(i)); #if defined(SIMD_AVX512F) lo = _mm512_maskz_loadu_pd(m(i), p); p += type_traits<double>::num_bvals_per_reg; hi = _mm512_maskz_loadu_pd(m(i), p); p += type_traits<double>::num_bvals_per_reg; #else lo = _mm512_loadunpacklo_pd(lo, p); p += type_traits<double>::num_bvals_per_reg; lo = _mm512_loadunpackhi_pd(lo, p); lo = _mm512_mask_blend_pd(m(i), zero, lo); hi = _mm512_loadunpacklo_pd(hi, p); p += type_traits<double>::num_bvals_per_reg; hi = _mm512_loadunpackhi_pd(hi, p); hi = _mm512_mask_blend_pd(himask, zero, hi); #endif op(i) = cvt512_pdx2_epi32(hi, lo); } } // unaligned temporal load: long <- int template<typename T, int NW, int W> inline void load(pack<T, NW, __m512i, long, W> &op, const_mptr<int, memhint::temporal|memhint::unaligned> ptr) { typedef pack<T, NW, __m512i, long, W> type_t; int const *p = ptr; __mmask16 lm = _mm512_int2mask(0b0000000011111111); for(int i = 0; i < type_t::num_regs; ++i) { __m512i temp; #if defined(SIMD_AVX512F) temp = _mm512_maskz_loadu_epi32(lm, p); #else temp = _mm512_mask_loadunpacklo_epi32(temp, lm, p); temp = _mm512_mask_loadunpackhi_epi32(temp, lm, p+type_traits<int>::num_bvals_per_reg); #endif op(i) = cvt512_epi32lo_epi64(temp); p += type_traits<long>::num_bvals_per_reg; } } // masked unaligned temporal load: long <- int template<typename T, int NW, int W> inline void load(pack<T, NW, __m512i, long, W> &op, const_mptr<int, memhint::temporal|memhint::unaligned> ptr, const mask<T, NW> &m) { typedef pack<T, NW, __m512i, long, W> type_t; int const *p = ptr; __mmask16 lm = _mm512_int2mask(0b0000000011111111); #if !defined(SIMD_AVX512F) __m512i zero; zero = _mm512_xor_si512(zero, zero); #endif for(int i = 0; i < type_t::num_regs; ++i) { __m512i temp; #if defined(SIMD_AVX512F) temp = _mm512_maskz_loadu_epi32(_mm512_kand(m(i), lm), p); #else temp = _mm512_mask_loadunpacklo_epi32(temp, lm, p); temp = _mm512_mask_loadunpackhi_epi32(temp, lm, p+type_traits<int>::num_bvals_per_reg); temp = _mm512_mask_blend_epi32(m(i), zero, temp); #endif op(i) = cvt512_epi32lo_epi64(temp); p += type_traits<long>::num_bvals_per_reg; } } // unaligned temporal load: long <- long template<typename T, int NW, int W> inline void load(pack<T, NW, __m512i, long, W> &op, const_mptr<long, memhint::temporal|memhint::unaligned> ptr) { typedef pack<T, NW, __m512i, long, W> type_t; long const *p = ptr; #if defined(SIMD_AVX512F) __mmask16 lm = _mm512_int2mask(0b0000000011111111); #endif for(int i = 0; i < type_t::num_regs; ++i) { #if defined(SIMD_AVX512F) op(i) = _mm512_maskz_loadu_epi64(lm, p); p += type_traits<long>::num_bvals_per_reg; #else op(i) = _mm512_loadunpacklo_epi64(op(i), p); p += type_traits<long>::num_bvals_per_reg; op(i) = _mm512_loadunpackhi_epi64(op(i), p); #endif } } // masked unaligned temporal load: long <- long template<typename T, int NW, int W> inline void load(pack<T, NW, __m512i, long, W> &op, const_mptr<long, memhint::temporal|memhint::unaligned> ptr, const mask<T, NW> &m) { typedef pack<T, NW, __m512i, long, W> type_t; long const *p = ptr; #if !defined(SIMD_AVX512F) __m512i zero; zero = _mm512_xor_si512(zero, zero); #endif for(int i = 0; i < type_t::num_regs; ++i) { #if defined(SIMD_AVX512F) op(i) = _mm512_maskz_loadu_epi64(m(i), p); p += type_traits<long>::num_bvals_per_reg; #else op(i) = _mm512_loadunpacklo_epi64(op(i), p); p += type_traits<long>::num_bvals_per_reg; op(i) = _mm512_loadunpackhi_epi64(op(i), p); op(i) = _mm512_mask_blend_epi64(m(i), zero, op(i)); #endif } } // unaligned temporal load: long <- float template<typename T, int NW, int W> inline void load(pack<T, NW, __m512i, long, W> &op, const_mptr<float, memhint::temporal|memhint::unaligned> ptr) { typedef pack<T, NW, __m512i, long, W> type_t; float const *p = ptr; __mmask16 lm = _mm512_int2mask(0b0000000011111111); for(int i = 0; i < type_t::num_regs; ++i) { __m512 temp; #if defined(SIMD_AVX512F) temp = _mm512_maskz_loadu_ps(lm, p); #else temp = _mm512_mask_loadunpacklo_ps(temp, lm, p); temp = _mm512_mask_loadunpackhi_ps(temp, lm, p+type_traits<float>::num_bvals_per_reg); #endif op(i) = cvt512_pslo_epi64(temp); p += type_traits<long>::num_bvals_per_reg; } } // masked unaligned temporal load: long <- float template<typename T, int NW, int W> inline void load(pack<T, NW, __m512i, long, W> &op, const_mptr<float, memhint::temporal|memhint::unaligned> ptr, const mask<T, NW> &m) { typedef pack<T, NW, __m512i, long, W> type_t; float const *p = ptr; __mmask16 lm = _mm512_int2mask(0b0000000011111111); #if !defined(SIMD_AVX512F) __m512 zero; zero = _mm512_castsi512_ps(_mm512_xor_si512(_mm512_castps_si512(zero), _mm512_castps_si512(zero))); #endif for(int i = 0; i < type_t::num_regs; ++i) { __m512 temp; #if defined(SIMD_AVX512F) temp = _mm512_maskz_loadu_ps(_mm512_kand(m(i), lm), p); #else temp = _mm512_mask_loadunpacklo_ps(temp, lm, p); temp = _mm512_mask_loadunpackhi_ps(temp, lm, p+type_traits<float>::num_bvals_per_reg); temp = _mm512_mask_blend_ps(m(i), zero, temp); #endif op(i) = cvt512_pslo_epi64(temp); p += type_traits<long>::num_bvals_per_reg; } } // unaligned temporal load: long <- double template<typename T, int NW, int W> inline void load(pack<T, NW, __m512i, long, W> &op, const_mptr<double, memhint::temporal|memhint::unaligned> ptr) { typedef pack<T, NW, __m512i, long, W> type_t; double const *p = ptr; for(int i = 0; i < type_t::num_regs; ++i) { __m512d temp; #if defined(SIMD_AVX512F) temp = _mm512_loadu_pd(p); p += type_traits<long>::num_bvals_per_reg; #else temp = _mm512_loadunpacklo_pd(temp, p); p += type_traits<long>::num_bvals_per_reg; temp = _mm512_loadunpackhi_pd(temp, p); #endif op(i) = cvt512_pd_epi64(temp); } } // masked unaligned temporal load: long <- double template<typename T, int NW, int W> inline void load(pack<T, NW, __m512i, long, W> &op, const_mptr<double, memhint::temporal|memhint::unaligned> ptr, const mask<T, NW> &m) { typedef pack<T, NW, __m512i, long, W> type_t; double const *p = ptr; #if !defined(SIMD_AVX512F) __m512d zero; zero = _mm512_castsi512_pd(_mm512_xor_si512(_mm512_castpd_si512(zero), _mm512_castpd_si512(zero))); #endif for(int i = 0; i < type_t::num_regs; ++i) { __m512d temp; #if defined(SIMD_AVX512F) temp = _mm512_maskz_loadu_pd(m(i), p); p += type_traits<long>::num_bvals_per_reg; #else temp = _mm512_loadunpacklo_pd(temp, p); p += type_traits<long>::num_bvals_per_reg; temp = _mm512_loadunpackhi_pd(temp, p); temp = _mm512_mask_blend_pd(m(i), zero, temp); #endif op(i) = cvt512_pd_epi64(temp); } } // unaligned temporal load: float <- int template<typename T, int NW, int W> inline void load(pack<T, NW, __m512, float, W> &op, const_mptr<int, memhint::temporal|memhint::unaligned> ptr) { typedef pack<T, NW, __m512, float, W> type_t; int const *p = ptr; #if defined(SIMD_AVX512F) __mmask16 lm; lm = _mm512_kxnor(lm lm); #endif for(int i = 0; i < type_t::num_regs; ++i) { __m512i temp; #if defined(SIMD_AVX512F) temp = _mm512_maskz_loadu_epi32(lm, p); p += type_traits<float>::num_bvals_per_reg; #else temp = _mm512_loadunpacklo_epi32(temp, p); p += type_traits<float>::num_bvals_per_reg; temp = _mm512_loadunpackhi_epi32(temp, p); #endif op(i) = cvt512_epi32_ps(temp); } } // masked unaligned temporal load: float <- int template<typename T, int NW, int W> inline void load(pack<T, NW, __m512, float, W> &op, const_mptr<int, memhint::temporal|memhint::unaligned> ptr, const mask<T, NW> &m) { typedef pack<T, NW, __m512, float, W> type_t; int const *p = ptr; #if !defined(SIMD_AVX512F) __m512i zero; zero = _mm512_xor_si512(zero, zero); #endif for(int i = 0; i < type_t::num_regs; ++i) { __m512i temp; #if defined(SIMD_AVX512F) temp = _mm512_maskz_loadu_epi32(m(i), p); p += type_traits<float>::num_bvals_per_reg; #else temp = _mm512_loadunpacklo_epi32(temp, p); p += type_traits<float>::num_bvals_per_reg; temp = _mm512_loadunpackhi_epi32(temp, p); temp = _mm512_mask_blend_epi32(m(i), zero, temp); #endif op(i) = cvt512_epi32_ps(temp); } } // unaligned temporal load: float <- long template<typename T, int NW, int W> inline void load(pack<T, NW, __m512, float, W> &op, const_mptr<long, memhint::temporal|memhint::unaligned> ptr) { typedef pack<T, NW, __m512, float, W> type_t; long const *p = ptr; #if defined(SIMD_AVX512F) __mmask16 lm; lm = _mm512_kxnor(lm, lm); #endif for(int i = 0; i < type_t::num_regs; ++i) { __m512i lo, hi; #if defined(SIMD_AVX512F) lo = _mm512_maskz_loadu_epi64(lm, p); p += type_traits<long>::num_bvals_per_reg; hi = _mm512_maskz_loadu_epi64(lm, p) p += type_traits<long>::num_bvals_per_reg; #else lo = _mm512_loadunpacklo_epi64(lo, p); p += type_traits<long>::num_bvals_per_reg; lo = _mm512_loadunpackhi_epi64(lo, p); hi = _mm512_loadunpacklo_epi64(hi, p); p += type_traits<long>::num_bvals_per_reg; hi = _mm512_loadunpackhi_epi64(hi, p); #endif op(i) = cvt512_epi64x2_ps(hi, lo); } } // masked unaligned temporal load: float <- long template<typename T, int NW, int W> inline void load(pack<T, NW, __m512, float, W> &op, const_mptr<long, memhint::temporal|memhint::unaligned> ptr, mask<T, NW> &m) { typedef pack<T, NW, __m512, float, W> type_t; long const *p = ptr; #if !defined(SIMD_AVX512F) __m512i zero; zero = _mm512_xor_si512(zero, zero); #endif for(int i = 0; i < type_t::num_regs; ++i) { __m512i lo, hi; __mmask16 himask = _mm512_kmerge2l1h(m(i), m(i)); #if defined(SIMD_AVX512F) lo = _mm512_maskz_loadu_epi64(m(i), p); p += type_traits<long>::num_bvals_per_reg; hi = _mm512_maskz_laodu_epi64(himask, p); p += type_traits<long>::num_bvals_per_reg; #else lo = _mm512_loadunpacklo_epi64(lo, p); p += type_traits<long>::num_bvals_per_reg; lo = _mm512_loadunpackhi_epi64(lo, p); lo = _mm512_mask_blend_epi64(m(i), zero, lo); hi = _mm512_loadunpacklo_epi64(hi, p); p += type_traits<long>::num_bvals_per_reg; hi = _mm512_loadunpackhi_epi64(hi, p); hi = _mm512_mask_blend_epi64(himask, zero, hi); #endif op(i) = cvt512_epi64x2_ps(hi, lo); } } // unaligned temporal load: float <- float template<typename T, int NW, int W> inline void load(pack<T, NW, __m512, float, W> &op, const_mptr<float, memhint::temporal|memhint::unaligned> ptr) { typedef pack<T, NW, __m512, float, W> type_t; float const *p = ptr; for(int i = 0; i < type_t::num_regs; ++i) { #if defined(SIMD_AVX512F) op(i) = _mm512_loadu_ps(p); p += type_traits<float>::num_bvals_per_reg; #else op(i) = _mm512_loadunpacklo_ps(op(i), p); p += type_traits<float>::num_bvals_per_reg; op(i) = _mm512_loadunpackhi_ps(op(i), p); #endif } } // masked unaligned temporal load: float <- float template<typename T, int NW, int W> inline void load(pack<T, NW, __m512, float, W> &op, const_mptr<float, memhint::temporal|memhint::unaligned> ptr, const mask<T, NW> &m) { typedef pack<T, NW, __m512, float, W> type_t; float const *p = ptr; #if !defined(SIMD_AVX512F) __m512 zero; zero = _mm512_castsi512_ps(_mm512_xor_si512(_mm512_castps_si512(zero), _mm512_castps_si512(zero))); #endif for(int i = 0; i < type_t::num_regs; ++i) { #if defined(SIMD_AVX512F) op(i) = _mm512_maskz_loadu_ps(m(i), p); p += type_traits<float>::num_bvals_per_reg; #else op(i) = _mm512_loadunpacklo_ps(op(i), p); p += type_traits<float>::num_bvals_per_reg; op(i) = _mm512_loadunpackhi_ps(op(i), p); op(i) = _mm512_mask_blend_ps(m(i), zero, op(i)); #endif } } // unaligned temporal load: float <- double template<typename T, int NW, int W> inline void load(pack<T, NW, __m512, float, W> &op, const_mptr<double, memhint::temporal|memhint::unaligned> ptr) { typedef pack<T, NW, __m512, float, W> type_t; double const *p = ptr; for(int i = 0; i < type_t::num_regs; ++i) { __m512d lo, hi; #if defined(SIMD_AVX512F) lo = _mm512_loadu_pd(p); p += type_traits<double>::num_bvals_per_reg; hi = _mm512_loadu_pd(p); p += type_traits<double>::num_bvals_per_reg; #else lo = _mm512_loadunpacklo_pd(lo, p); p += type_traits<double>::num_bvals_per_reg; lo = _mm512_loadunpackhi_pd(lo, p); hi = _mm512_loadunpacklo_pd(hi, p); p += type_traits<double>::num_bvals_per_reg; hi = _mm512_loadunpackhi_pd(hi, p); #endif op(i) = cvt512_pdx2_ps(hi, lo); } } // masked unaligned temporal load: float <- double template<typename T, int NW, int W> inline void load(pack<T, NW, __m512, float, W> &op, const_mptr<double, memhint::temporal|memhint::unaligned> ptr, const mask<T, NW> &m) { typedef pack<T, NW, __m512, float, W> type_t; double const *p = ptr; #if !defined(SIMD_AVX512F) __m512d zero; zero = _mm512_castsi512_pd(_mm512_xor_si512(_mm512_castpd_si512(zero), _mm512_castpd_si512(zero))); #endif for(int i = 0; i < type_t::num_regs; ++i) { __m512d lo, hi; __mmask16 himask = _mm512_kmerge2l1h(m(i), m(i)); #if defined(SIMD_AVX512F) lo = _mm512_maskz_loadu_pd(m(i), p); p += type_traits<double>::num_bvals_per_reg; hi = _mm512_maskz_loadu_pd(himask, p); p += type_traits<double>::num_bvals_per_reg; #else lo = _mm512_loadunpacklo_pd(lo, p); p += type_traits<double>::num_bvals_per_reg; lo = _mm512_loadunpackhi_pd(lo, p); lo = _mm512_mask_blend_pd(m(i), zero, lo); hi = _mm512_loadunpacklo_pd(hi, p); p += type_traits<double>::num_bvals_per_reg; hi = _mm512_loadunpackhi_pd(hi, p); hi = _mm512_mask_blend_pd(himask, zero, hi); #endif op(i) = cvt512_pdx2_ps(hi, lo); } } // unaligned temporal load: double <- int template<typename T, int NW, int W> inline void load(pack<T, NW, __m512d, double, W> &op, const_mptr<int, memhint::temporal|memhint::unaligned> ptr) { typedef pack<T, NW, __m512d, double, W> type_t; int const *p = ptr; __mmask16 lm = _mm512_int2mask(0b0000000011111111); for(int i = 0; i < type_t::num_regs; ++i) { __m512i temp; #if defined(SIMD_AVX512F) temp = _mm512_maskz_loadu_epi32(lm, p); #else temp = _mm512_mask_loadunpacklo_epi32(temp, lm, p); temp = _mm512_mask_loadunpackhi_epi32(temp, lm, p+type_traits<int>::num_bvals_per_reg); #endif op(i) = cvt512_epi32lo_pd(temp); p += type_traits<double>::num_bvals_per_reg; } } // masked unaligned temporal load: double <- int template<typename T, int NW, int W> inline void load(pack<T, NW, __m512d, double, W> &op, const_mptr<int, memhint::temporal|memhint::unaligned> ptr, const mask<T, NW> &m) { typedef pack<T, NW, __m512d, double, W> type_t; int const *p = ptr; __mmask16 lm = _mm512_int2mask(0b0000000011111111); #if !defined(SIMD_AVX512F) __m512i zero; zero = _mm512_xor_si512(zero, zero); #endif for(int i = 0; i < type_t::num_regs; ++i) { __m512i temp; #if defined(SIMD_AVX512F) temp = _mm512_maskz_loadu_epi32(_mm512_kand(m(i), lm), p); #else temp = _mm512_mask_loadunpacklo_epi32(temp, lm, p); temp = _mm512_mask_loadunpackhi_epi32(temp, lm, p+type_traits<int>::num_bvals_per_reg); temp = _mm512_mask_blend_epi32(m(i), zero, temp); #endif op(i) = cvt512_epi32lo_pd(temp); p += type_traits<double>::num_bvals_per_reg; } } // unaligned temporal load: double <- long template<typename T, int NW, int W> inline void load(pack<T, NW, __m512d, double, W> &op, const_mptr<long, memhint::temporal|memhint::unaligned> ptr) { typedef pack<T, NW, __m512d, double, W> type_t; long const *p = ptr; #if defined(SIMD_AVX512F) __mmask16 lm; lm = _mm512_kxnor(lm, lm); #endif for(int i = 0; i < type_t::num_regs; ++i) { __m512i temp; #if defined(SIMD_AVX512F) temp = _mm512_maskz_loadu_epi64(lm, p); p += type_traits<double>::num_bvals_per_reg; #else temp = _mm512_loadunpacklo_epi64(temp, p); p += type_traits<double>::num_bvals_per_reg; temp = _mm512_loadunpackhi_epi64(temp, p); #endif op(i) = cvt512_epi64_pd(temp); } } // masked unaligned temporal load: double <- long template<typename T, int NW, int W> inline void load(pack<T, NW, __m512d, double, W> &op, const_mptr<long, memhint::temporal|memhint::unaligned> ptr, const mask<T, NW> &m) { typedef pack<T, NW, __m512d, double, W> type_t; long const *p = ptr; #if !defined(SIMD_AVX512F) __m512i zero; zero =_mm512_xor_si512(zero, zero); #endif for(int i = 0; i < type_t::num_regs; ++i) { __m512i temp; #if defined(SIMD_AVX512F) temp = _mm512_maskz_loadu_epi64(m(i), p); p += type_traits<double>::num_bvals_per_reg; #else temp = _mm512_loadunpacklo_epi64(temp, p); p += type_traits<double>::num_bvals_per_reg; temp = _mm512_loadunpackhi_epi64(temp, p); temp = _mm512_mask_blend_epi64(m(i), zero, temp); #endif op(i) = cvt512_epi64_pd(temp); } } // unaligned temporal load: double <- float template<typename T, int NW, int W> inline void load(pack<T, NW, __m512d, double, W> &op, const_mptr<float, memhint::temporal|memhint::unaligned> ptr) { typedef pack<T, NW, __m512d, double, W> type_t; float const *p = ptr; __mmask16 lm = _mm512_int2mask(0b0000000011111111); for(int i = 0; i < type_t::num_regs; ++i) { __m512 temp; #if defined(SIMD_AVX512F) temp = _mm512_maskz_loadu_ps(lm, p); #else temp = _mm512_mask_loadunpacklo_ps(temp, lm, p); temp = _mm512_mask_loadunpackhi_ps(temp, lm, p+type_traits<float>::num_bvals_per_reg); #endif op(i) = cvt512_pslo_pd(temp); p += type_traits<double>::num_bvals_per_reg; } } // masked unaligned temporal load: double <- float template<typename T, int NW, int W> inline void load(pack<T, NW, __m512d, double, W> &op, const_mptr<float, memhint::temporal|memhint::unaligned> ptr, const mask<T, NW> &m) { typedef pack<T, NW, __m512d, double, W> type_t; float const *p = ptr; __mmask16 lm = _mm512_int2mask(0b0000000011111111); #if !defined(SIMD_AVX512F) __m512 zero; zero = _mm512_castsi512_ps(_mm512_xor_si512(_mm512_castps_si512(zero), _mm512_castps_si512(zero))); #endif for(int i = 0; i < type_t::num_regs; ++i) { __m512 temp; #if defined(SIMD_AVX512F) temp = _mm512_maskz_loadu_ps(_mm512_kand(m(i), lm), p); #else temp = _mm512_mask_loadunpacklo_ps(temp, lm, p); temp = _mm512_mask_loadunpackhi_ps(temp, lm, p+type_traits<float>::num_bvals_per_reg); temp = _mm512_mask_blend_ps(m(i), zero, temp); #endif op(i) = cvt512_pslo_pd(temp); p += type_traits<double>::num_bvals_per_reg; } } // unaligned temporal load: double <- double template<typename T, int NW, int W> inline void load(pack<T, NW, __m512d, double, W> &op, const_mptr<double, memhint::temporal|memhint::unaligned> ptr) { typedef pack<T, NW, __m512d, double, W> type_t; double const *p = ptr; for(int i = 0; i < type_t::num_regs; ++i) { #if defined(SIMD_AVX512F) op(i) = _mm512_loadu_pd(p); p += type_traits<double>::num_bvals_per_reg; #else op(i) = _mm512_loadunpacklo_pd(op(i), p); p += type_traits<double>::num_bvals_per_reg; op(i) = _mm512_loadunpackhi_pd(op(i), p); #endif } } // masked unaligned temporal load: double <- double template<typename T, int NW, int W> inline void load(pack<T, NW, __m512d, double, W> &op, const_mptr<double, memhint::temporal|memhint::unaligned> ptr, const mask<T, NW> &m) { typedef pack<T, NW, __m512d, double, W> type_t; double const *p = ptr; #if !defined(SIMD_AVX512F) __m512d zero; zero = _mm512_castsi512_pd(_mm512_xor_si512(_mm512_castpd_si512(zero), _mm512_castpd_si512(zero))); #endif for(int i = 0; i < type_t::num_regs; ++i) { #if defined(SIMD_AVX512F) op(i) = _mm512_maskz_loadu_pd(m(i), p); p += type_traits<double>::num_bvals_per_reg; #else op(i) = _mm512_loadunpacklo_pd(op(i), p); p += type_traits<double>::num_bvals_per_reg; op(i) = _mm512_loadunpackhi_pd(op(i), p); op(i) = _mm512_mask_blend_pd(m(i), zero, op(i)); #endif } } /* Store functions */ // unaligned temporal store: int -> int template<typename T, int NW, int W> inline void store(pack<T, NW, __m512i, int, W> &op, mptr<int, memhint::temporal|memhint::unaligned> ptr) { typedef pack<T, NW, __m512i, int, W> type_t; int *p = ptr; #if defined(SIMD_AVX512F) __mmask16 m; m = _mm512_kxnor(m, m); #endif for(int i = 0; i < type_t::num_regs; ++i) { #if defined(SIMD_AVX512F) _mm512_mask_storeu_epi32(p, m, op(i)); p += type_traits<int>::num_bvals_per_reg; #else _mm512_packstorelo_epi32(p, op(i)); p += type_traits<int>::num_bvals_per_reg; _mm512_packstorehi_epi32(p, op(i)); #endif } } // masked unaligned temporal store: int -> int template<typename T, int NW, int W> inline void store(pack<T, NW, __m512i, int, W> &op, mptr<int, memhint::temporal|memhint::unaligned> ptr, const mask<T, NW> &m) { typedef pack<T, NW, __m512i, int, W> type_t; int *p = ptr; for(int i = 0; i < type_t::num_regs; ++i) { #if defined(SIMD_AVX512F) _mm512_mask_storeu_epi32(p, m(i), op(i)); p += type_traits<int>::num_bvals_per_reg; #else __m512i temp; temp = _mm512_loadunpacklo_epi32(temp, p); temp = _mm512_loadunpackhi_epi32(temp, p+type_traits<int>::num_bvals_per_reg); temp = _mm512_mask_blend_epi32(m(i), temp, op(i)); _mm512_packstorelo_epi32(p, temp); p += type_traits<int>::num_bvals_per_reg; _mm512_packstorehi_epi32(p, temp); #endif } } // unaligned temporal store: int -> long template<typename T, int NW, int W> inline void store(pack<T, NW, __m512i, int, W> &op, mptr<long, memhint::temporal|memhint::unaligned> ptr) { typedef pack<T, NW, __m512i, int, W> type_t; long *p = ptr; #if defined(SIMD_AVX512F) __mmask16 m; m = _mm512_kxnor(m, m); #endif for(int i = 0; i < type_t::num_regs; ++i) { __m512i lo = cvt512_epi32lo_epi64(op(i)); __m512i hi = cvt512_epi32hi_epi64(op(i)); #if defined(SIMD_AVX512F) _mm512_mask_storeu_epi64(p, m, lo); p += type_traits<long>::num_bvals_per_reg; _mm512_mask_storeu_epi64(p, m, hi); p += type_traits<long>::num_bvals_per_reg; #else _mm512_packstorelo_epi64(p, lo); p += type_traits<long>::num_bvals_per_reg; _mm512_packstorehi_epi64(p, lo); _mm512_packstorelo_epi64(p, hi); p += type_traits<long>::num_bvals_per_reg; _mm512_packstorehi_epi64(p, hi); #endif } } // masked unaligned temporal store: int -> long template<typename T, int NW, int W> inline void store(pack<T, NW, __m512i, int, W> &op, mptr<long, memhint::temporal|memhint::unaligned> ptr, const mask<T, NW> &m) { typedef pack<T, NW, __m512i, int, W> type_t; long *p = ptr; for(int i = 0; i < type_t::num_regs; ++i) { __m512i lo = cvt512_epi32lo_epi64(op(i)); __m512i hi = cvt512_epi32hi_epi64(op(i)); __mmask16 himask = _mm512_kmerge2l1h(m(i), m(i)); #if defined(SIMD_AVX512F) _mm512_mask_storeu_epi64(p, m(i), lo); p += type_traits<long>::num_bvals_per_reg; _mm512_mask_storeu_epi64(p, himask, hi); p += type_traits<long>::num_bvals_per_reg; #else __m512i temp, temp1; temp = _mm512_loadunpacklo_epi64(temp, p); temp = _mm512_loadunpackhi_epi64(temp, p+type_traits<long>::num_bvals_per_reg); temp = _mm512_mask_blend_epi64(m(i), temp, lo); _mm512_packstorelo_epi64(p, temp); p += type_traits<long>::num_bvals_per_reg; _mm512_packstorehi_epi64(p, temp); temp1 = _mm512_loadunpacklo_epi64(temp1, p); temp1 = _mm512_loadunpackhi_epi64(temp1, p+type_traits<long>::num_bvals_per_reg); temp1 = _mm512_mask_blend_epi64(himask, temp1, hi); _mm512_packstorelo_epi64(p, temp1); p += type_traits<long>::num_bvals_per_reg; _mm512_packstorehi_epi64(p, temp1); #endif } } // unaligned temporal store: int -> float template<typename T, int NW, int W> inline void store(pack<T, NW, __m512i, int, W> &op, mptr<float, memhint::temporal|memhint::unaligned> ptr) { typedef pack<T, NW, __m512i, int, W> type_t; float *p = ptr; for(int i = 0; i < type_t::num_regs; ++i) { __m512 temp = cvt512_epi32_ps(op(i)); #if defined(SIMD_AVX512F) _mm512_storeu_ps(p, temp); p += type_traits<float>::num_bvals_per_reg; #else _mm512_packstorelo_ps(p, temp); p += type_traits<float>::num_bvals_per_reg; _mm512_packstorehi_ps(p, temp); #endif } } // masked unaligned temporal store: int -> float template<typename T, int NW, int W> inline void store(pack<T, NW, __m512i, int, W> &op, mptr<float, memhint::temporal|memhint::unaligned> ptr, const mask<T, NW> &m) { typedef pack<T, NW, __m512i, int, W> type_t; float *p = ptr; for(int i = 0; i < type_t::num_regs; ++i) { __m512 temp = cvt512_epi32_ps(op(i)); #if defined(SIMD_AVX512F) _mm512_mask_storeu_ps(p, m(i), temp); p += type_traits<float>::num_bvals_per_reg; #else __m512 temp1; temp1 = _mm512_loadunpacklo_ps(temp1, p); temp1 = _mm512_loadunpackhi_ps(temp1, p+type_traits<float>::num_bvals_per_reg); temp = _mm512_mask_blend_ps(m(i), temp1, temp); _mm512_packstorelo_ps(p, temp); p += type_traits<float>::num_bvals_per_reg; _mm512_packstorehi_ps(p, temp); #endif } } // unaligned temporal store: int -> double template<typename T, int NW, int W> inline void store(pack<T, NW, __m512i, int, W> &op, mptr<double, memhint::temporal|memhint::unaligned> ptr) { typedef pack<T, NW, __m512i, int, W> type_t; double *p = ptr; for(int i = 0; i < type_t::num_regs; ++i) { __m512d lo = cvt512_epi32lo_pd(op(i)); __m512d hi = cvt512_epi32hi_pd(op(i)); #if defined(SIMD_AVX512F) _mm512_storeu_pd(p, lo); p += type_traits<double>::num_bvals_per_reg; _mm512_storeu_pd(p, hi); p += type_traits<double>::num_bvals_per_reg; #else _mm512_packstorelo_pd(p, lo); p += type_traits<double>::num_bvals_per_reg; _mm512_packstorehi_pd(p, lo); _mm512_packstorelo_pd(p, hi); p += type_traits<double>::num_bvals_per_reg; _mm512_packstorehi_pd(p, hi); #endif } } // masked unaligned temporal store: int -> double template<typename T, int NW, int W> inline void store(pack<T, NW, __m512i, int, W> &op, mptr<double, memhint::temporal|memhint::unaligned> ptr, const mask<T, NW> &m) { typedef pack<T, NW, __m512i, int, W> type_t; double *p = ptr; for(int i = 0; i < type_t::num_regs; ++i) { __m512d lo = cvt512_epi32lo_pd(op(i)); __m512d hi = cvt512_epi32hi_pd(op(i)); __mmask16 himask = _mm512_kmerge2l1h(m(i), m(i)); #if defined(SIMD_AVX512F) _mm512_mask_storeu_pd(p, m(i), lo); p += type_traits<double>::num_bvals_per_reg; _mm512_mask_storeu_pd(p, himask, hi); #else __m512d temp, temp1; temp = _mm512_loadunpacklo_pd(temp, p); temp = _mm512_loadunpackhi_pd(temp, p+type_traits<double>::num_bvals_per_reg); temp = _mm512_mask_blend_pd(m(i), temp, lo); _mm512_packstorelo_pd(p, temp); p += type_traits<double>::num_bvals_per_reg; _mm512_packstorehi_pd(p, temp); temp1 = _mm512_loadunpacklo_pd(temp1, p); temp1 = _mm512_loadunpackhi_pd(temp1, p+type_traits<double>::num_bvals_per_reg); temp1 = _mm512_mask_blend_pd(himask, temp1, hi); _mm512_packstorelo_pd(p, temp1); p += type_traits<double>::num_bvals_per_reg; _mm512_packstorehi_pd(p, temp1); #endif } } // unaligned temporal store: long -> int template<typename T, int NW, int W> inline void store(pack<T, NW, __m512i, long, W> &op, mptr<int, memhint::temporal|memhint::unaligned> ptr) { typedef pack<T, NW, __m512i, long, W> type_t; int *p = ptr; __mmask16 sm = _mm512_int2mask(0b0000000011111111); for(int i = 0; i < type_t::num_regs; ++i) { __m512i temp = cvt512_epi64_epi32lo(op(i)); #if defined(SIMD_AVX512F) _mm512_mask_storeu_epi32(p, sm, temp); #else _mm512_mask_packstorelo_epi32(p, sm, temp); _mm512_mask_packstorehi_epi32(p+type_traits<int>::num_bvals_per_reg, sm, temp); #endif p += type_traits<long>::num_bvals_per_reg; } } // masked unaligned temporal store: long -> int template<typename T, int NW, int W> inline void store(pack<T, NW, __m512i, long, W> &op, mptr<int, memhint::temporal|memhint::unaligned> ptr, const mask<T, NW> &m) { typedef pack<T, NW, __m512i, long, W> type_t; int *p = ptr; __mmask16 sm = _mm512_int2mask(0b0000000011111111); for(int i = 0; i < type_t::num_regs; ++i) { __m512i temp = cvt512_epi64_epi32lo(op(i)); #if defined(SIMD_AVX512F) _mm512_mask_storeu_epi32(p, _mm512_kand(sm, m(i)), temp); #else __m512i temp1; temp1 = _mm512_mask_loadunpacklo_epi32(temp1, sm, p); temp1 = _mm512_mask_loadunpackhi_epi32(temp1, sm, p+type_traits<int>::num_bvals_per_reg); temp = _mm512_mask_blend_epi32(m(i), temp1, temp); _mm512_mask_packstorelo_epi32(p, sm, temp); _mm512_mask_packstorehi_epi32(p+type_traits<int>::num_bvals_per_reg, sm, temp); #endif p += type_traits<long>::num_bvals_per_reg; } } // unaligned temporal store: long -> long template<typename T, int NW, int W> inline void store(pack<T, NW, __m512i, long, W> &op, mptr<long, memhint::temporal|memhint::unaligned> ptr) { typedef pack<T, NW, __m512i, long, W> type_t; long *p = ptr; #if defined(SIMD_AVX512F) __mmask16 sm = _mm512_int2mask(0b0000000011111111); #endif for(int i = 0; i < type_t::num_regs; ++i) { #if defined(SIMD_AVX512F) _mm512_mask_storeu_epi64(p, sm, op(i)); p += type_traits<long>::num_bvals_per_reg; #else _mm512_packstorelo_epi64(p, op(i)); p += type_traits<long>::num_bvals_per_reg; _mm512_packstorehi_epi64(p, op(i)); #endif } } // masked unaligned temporal store: long -> long template<typename T, int NW, int W> inline void store(pack<T, NW, __m512i, long, W> &op, mptr<long, memhint::temporal|memhint::unaligned> ptr, const mask<T, NW> &m) { typedef pack<T, NW, __m512i, long, W> type_t; long *p = ptr; for(int i = 0; i < type_t::num_regs; ++i) { #if defined(SIMD_AVX512F) _mm512_mask_storeu_epi64(p, m(i), op(i)); p += type_traits<long>::num_bvals_per_reg; #else __m512i temp; temp = _mm512_loadunpacklo_epi64(temp, p); temp = _mm512_loadunpackhi_epi64(temp, p+type_traits<long>::num_bvals_per_reg); temp = _mm512_mask_blend_epi64(m(i), temp, op(i)); _mm512_packstorelo_epi64(p, temp); p += type_traits<long>::num_bvals_per_reg; _mm512_packstorehi_epi64(p, temp); #endif } } // unaligned temporal store: long -> float template<typename T, int NW, int W> inline void store(pack<T, NW, __m512i, long, W> &op, mptr<float, memhint::temporal|memhint::unaligned> ptr) { typedef pack<T, NW, __m512i, long, W> type_t; float *p = ptr; __mmask16 sm = _mm512_int2mask(0b0000000011111111); for(int i = 0; i < type_t::num_regs; ++i) { __m512 temp = cvt512_epi64_pslo(op(i)); #if defined(SIMD_AVX512F) _mm512_mask_storeu_ps(p, sm, temp); #else _mm512_mask_packstorelo_ps(p, sm, temp); _mm512_mask_packstorehi_ps(p+type_traits<float>::num_bvals_per_reg, sm, temp); #endif p += type_traits<long>::num_bvals_per_reg; } } // masked unaligned temporal store: long -> float template<typename T, int NW, int W> inline void store(pack<T, NW, __m512i, long, W> &op, mptr<float, memhint::temporal|memhint::unaligned> ptr, const mask<T, NW> &m) { typedef pack<T, NW, __m512i, long, W> type_t; float *p = ptr; __mmask16 sm = _mm512_int2mask(0b0000000011111111); for(int i = 0; i < type_t::num_regs; ++i) { __m512 temp = cvt512_epi64_pslo(op(i)); #if defined(SIMD_AVX512F) _mm512_mask_storeu_ps(p, _mm512_kand(sm, m(i)), temp); #else __m512 temp1; temp1 = _mm512_mask_loadunpacklo_ps(temp1, sm, p); temp1 = _mm512_mask_loadunpackhi_ps(temp1, sm, p+type_traits<float>::num_bvals_per_reg); temp = _mm512_mask_blend_ps(m(i), temp1, temp); _mm512_mask_packstorelo_ps(p, sm, temp); _mm512_mask_packstorehi_ps(p+type_traits<float>::num_bvals_per_reg, sm, temp); #endif p += type_traits<long>::num_bvals_per_reg; } } // unaligned temporal store: long -> double template<typename T, int NW, int W> inline void store(pack<T, NW, __m512i, long, W> &op, mptr<double, memhint::temporal|memhint::unaligned> ptr) { typedef pack<T, NW, __m512i, long, W> type_t; double *p = ptr; for(int i = 0; i < type_t::num_regs; ++i) { __m512d temp = cvt512_epi64_pd(op(i)); #if defined(SIMD_AVX512F) _mm512_storeu_pd(p, temp); p += type_traits<long>::num_bvals_per_reg; #else _mm512_packstorelo_pd(p, temp); p += type_traits<long>::num_bvals_per_reg; _mm512_packstorehi_pd(p, temp); #endif } } // masked unaligned temporal store: long -> double template<typename T, int NW, int W> inline void store(pack<T, NW, __m512i, long, W> &op, mptr<double, memhint::temporal|memhint::unaligned> ptr, const mask<T, NW> &m) { typedef pack<T, NW, __m512i, long, W> type_t; double *p = ptr; for(int i = 0; i < type_t::num_regs; ++i) { __m512d temp = cvt512_epi64_pd(op(i)); #if defined(SIMD_AVX512F) _mm512_mask_storeu_pd(p, m(i), temp); p += type_traits<long>::num_bvals_per_reg; #else __m512d temp1; temp1 = _mm512_loadunpacklo_pd(temp1, p); temp1 = _mm512_loadunpackhi_pd(temp1, p+type_traits<double>::num_bvals_per_reg); temp = _mm512_mask_blend_pd(m(i), temp1, temp); _mm512_packstorelo_pd(p, temp); p += type_traits<long>::num_bvals_per_reg; _mm512_packstorehi_pd(p, temp); #endif } } // unaligned temporal store: float -> int template<typename T, int NW, int W> inline void store(pack<T, NW, __m512, float, W> &op, mptr<int, memhint::temporal|memhint::unaligned> ptr) { typedef pack<T, NW, __m512, float, W> type_t; int *p = ptr; #if defined(SIMD_AVX512F) __mmask16 sm; sm = _mm512_kxnor(sm, sm); #endif for(int i = 0; i < type_t::num_regs; ++i) { __m512i temp = cvt512_ps_epi32(op(i)); #if defined(SIMD_AVX512F) _mm512_mask_storeu_epi32(p, sm, temp); p += type_traits<float>::num_bvals_per_reg; #else _mm512_packstorelo_epi32(p, temp); p += type_traits<float>::num_bvals_per_reg; _mm512_packstorehi_epi32(p, temp); #endif } } // masked unaligned temporal store: float -> int template<typename T, int NW, int W> inline void store(pack<T, NW, __m512, float, W> &op, mptr<int, memhint::temporal|memhint::unaligned> ptr, const mask<T, NW> &m) { typedef pack<T, NW, __m512, float, W> type_t; int *p = ptr; for(int i = 0; i < type_t::num_regs; ++i) { __m512i temp = cvt512_ps_epi32(op(i)); #if defined(SIMD_AVX512F) _mm512_mask_storeu_epi32(p, m(i), temp); p += type_traits<float>::num_bvals_per_reg; #else __m512i temp1; temp1 = _mm512_loadunpacklo_epi32(temp1, p); temp1 = _mm512_loadunpackhi_epi32(temp1, p+type_traits<int>::num_bvals_per_reg); temp = _mm512_mask_blend_epi32(m(i), temp1, temp); _mm512_packstorelo_epi32(p, temp); p += type_traits<float>::num_bvals_per_reg; _mm512_packstorehi_epi32(p, temp); #endif } } // unaligned temporal store: float -> long template<typename T, int NW, int W> inline void store(pack<T, NW, __m512, float, W> &op, mptr<long, memhint::temporal|memhint::unaligned> ptr) { typedef pack<T, NW, __m512, float, W> type_t; long *p = ptr; #if defined(SIMD_AVX512F) __mmask16 sm; sm = _mm512_kxnor(sm, sm); #endif for(int i = 0; i < type_t::num_regs; ++i) { __m512i lo = cvt512_pslo_epi64(op(i)); __m512i hi = cvt512_pshi_epi64(op(i)); #if defined(SIMD_AVX512F) _mm512_mask_storeu_epi64(p, sm, lo); p += type_traits<long>::num_bvals_per_reg; _mm512_mask_storeu_epi64(p, sm, hi); p += type_traits<long>::num_bvals_per_reg; #else _mm512_packstorelo_epi64(p, lo); p += type_traits<long>::num_bvals_per_reg; _mm512_packstorehi_epi64(p, lo); _mm512_packstorelo_epi64(p, hi); p += type_traits<long>::num_bvals_per_reg; _mm512_packstorehi_epi64(p, hi); #endif } } // masked unaligned temporal store: float -> long template<typename T, int NW, int W> inline void store(pack<T, NW, __m512, float, W> &op, mptr<long, memhint::temporal|memhint::unaligned> ptr, const mask<T, NW> &m) { typedef pack<T, NW, __m512, float, W> type_t; long *p = ptr; for(int i = 0; i < type_t::num_regs; ++i) { __m512i lo = cvt512_pslo_epi64(op(i)); __m512i hi = cvt512_pshi_epi64(op(i)); __mmask16 himask = _mm512_kmerge2l1h(m(i), m(i)); #if defined(SIMD_AVX512F) _mm512_mask_storeu_epi64(p, m(i), lo); p += type_traits<long>::num_bvals_per_reg; _mm512_mask_storeu_epi64(p, himask, hi); p += type_traits<long>::num_bvals_per_reg; #else __m512i temp, temp1; temp = _mm512_loadunpacklo_epi64(temp, p); temp = _mm512_loadunpackhi_epi64(temp, p+type_traits<long>::num_bvals_per_reg); lo = _mm512_mask_blend_epi64(m(i), temp, lo); _mm512_packstorelo_epi64(p, lo); p += type_traits<long>::num_bvals_per_reg; _mm512_packstorehi_epi64(p, lo); temp1 = _mm512_loadunpacklo_epi64(temp1, p); temp1 = _mm512_loadunpackhi_epi64(temp1, p+type_traits<long>::num_bvals_per_reg); hi = _mm512_mask_blend_epi64(himask, temp1, hi); _mm512_packstorelo_epi64(p, hi); p += type_traits<long>::num_bvals_per_reg; _mm512_packstorehi_epi64(p, hi); #endif } } // unaligned temporal store: float -> float template<typename T, int NW, int W> inline void store(pack<T, NW, __m512, float, W> &op, mptr<float, memhint::temporal|memhint::unaligned> ptr) { typedef pack<T, NW, __m512, float, W> type_t; float *p = ptr; for(int i = 0; i < type_t::num_regs; ++i) { #if defined(SIMD_AVX512F) _mm512_storeu_ps(p, op(i)); p += type_traits<float>::num_bvals_per_reg; #else _mm512_packstorelo_ps(p, op(i)); p += type_traits<float>::num_bvals_per_reg; _mm512_packstorehi_ps(p, op(i)); #endif } } // masked unaligned temporal store: float -> float template<typename T, int NW, int W> inline void store(pack<T, NW, __m512, float, W> &op, mptr<float, memhint::temporal|memhint::unaligned> ptr, const mask<T, NW> &m) { typedef pack<T, NW, __m512, float, W> type_t; float *p = ptr; for(int i = 0; i < type_t::num_regs; ++i) { #if defined(SIMD_AVX512F) _mm512_mask_storeu_ps(p, m(i), op(i)); #else __m512 temp; temp = _mm512_loadunpacklo_ps(temp, p); temp = _mm512_loadunpackhi_ps(temp, p+type_traits<float>::num_bvals_per_reg); temp = _mm512_mask_blend_ps(m(i), temp, op(i)); _mm512_packstorelo_ps(p, temp); p += type_traits<float>::num_bvals_per_reg; _mm512_packstorehi_ps(p, temp); #endif } } // unaligned temporal store: float -> double template<typename T, int NW, int W> inline void store(pack<T, NW, __m512, float, W> &op, mptr<double, memhint::temporal|memhint::unaligned> ptr) { typedef pack<T, NW, __m512, float, W> type_t; double *p = ptr; for(int i = 0; i < type_t::num_regs; ++i) { __m512d lo = cvt512_pslo_pd(op(i)); __m512d hi = cvt512_pshi_pd(op(i)); #if defined(SIMD_AVX512F) _mm512_storeu_pd(p, lo); p += type_traits<double>::num_bvals_per_reg; _mm512_storeu_pd(p, hi); p += type_traits<double>::num_bvals_per_reg; #else _mm512_packstorelo_pd(p, lo); p += type_traits<double>::num_bvals_per_reg; _mm512_packstorehi_pd(p, lo); _mm512_packstorelo_pd(p, hi); p += type_traits<double>::num_bvals_per_reg; _mm512_packstorehi_pd(p, hi); #endif } } // masked unaligned temporal store: float -> double template<typename T, int NW, int W> inline void store(pack<T, NW, __m512, float, W> &op, mptr<double, memhint::temporal|memhint::unaligned> ptr, const mask<T, NW> &m) { typedef pack<T, NW, __m512, float, W> type_t; double *p = ptr; for(int i = 0; i < type_t::num_regs; ++i) { __m512d lo = cvt512_pslo_pd(op(i)); __m512d hi = cvt512_pshi_pd(op(i)); __mmask16 himask = _mm512_kmerge2l1h(m(i), m(i)); #if defined(SIMD_AVX512F) _mm512_mask_storeu_pd(p, m(i), lo); p += type_traits<double>::num_bvals_per_reg; _mm512_mask_storeu_pd(p, himask, hi); p += type_traits<double>::num_bvals_per_reg; #else __m512d temp, temp1; temp = _mm512_loadunpacklo_pd(temp, p); temp = _mm512_loadunpackhi_pd(temp, p+type_traits<double>::num_bvals_per_reg); lo = _mm512_mask_blend_pd(m(i), temp, lo); temp1 = _mm512_loadunpacklo_pd(temp1, p+type_traits<double>::num_bvals_per_reg); temp1 = _mm512_loadunpackhi_pd(temp1, p+type_traits<double>::num_bvals_per_reg+type_traits<double>::num_bvals_per_reg); hi = _mm512_mask_blend_pd(himask, temp1, hi); _mm512_packstorelo_pd(p, lo); p += type_traits<double>::num_bvals_per_reg; _mm512_packstorehi_pd(p, lo); _mm512_packstorelo_pd(p, hi); p += type_traits<double>::num_bvals_per_reg; _mm512_packstorehi_pd(p, hi); #endif } } // unaligned temporal store: double -> int template<typename T, int NW, int W> inline void store(pack<T, NW, __m512d, double, W> &op, mptr<int, memhint::temporal|memhint::unaligned> ptr) { typedef pack<T, NW, __m512d, double, W> type_t; int *p = ptr; __mmask16 sm = _mm512_int2mask(0b0000000011111111); for(int i = 0; i < type_t::num_regs; ++i) { __m512i temp = cvt512_pd_epi32lo(op(i)); #if defined(SIMD_AVX512F) _mm512_mask_storeu_epi32(p, sm, temp); #else _mm512_mask_packstorelo_epi32(p, sm, temp); _mm512_mask_packstorehi_epi32(p+type_traits<int>::num_bvals_per_reg, sm, temp); #endif p += type_traits<double>::num_bvals_per_reg; } } // masked unaligned temporal store: double -> int template<typename T, int NW, int W> inline void store(pack<T, NW, __m512d, double, W> &op, mptr<int, memhint::temporal|memhint::unaligned> ptr, const mask<T, NW> &m) { typedef pack<T, NW, __m512d, double, W> type_t; int *p = ptr; __mmask16 sm = _mm512_int2mask(0b0000000011111111); for(int i = 0; i < type_t::num_regs; ++i) { __m512i temp = cvt512_pd_epi32lo(op(i)); #if defined(SIMD_AVX512F) _mm512_mask_storeu_epi32(p, _mm512_kand(m(i), sm), temp); #else __m512i temp1; temp1 = _mm512_mask_loadunpacklo_epi32(temp1, sm, p); temp1 = _mm512_mask_loadunpackhi_epi32(temp1, sm, p+type_traits<int>::num_bvals_per_reg); temp =_mm512_mask_blend_epi32(m(i), temp1, temp); _mm512_mask_packstorelo_epi32(p, sm, temp); _mm512_mask_packstorehi_epi32(p+type_traits<int>::num_bvals_per_reg, sm, temp); #endif p += type_traits<double>::num_bvals_per_reg; } } // unaligned temporal store: double -> long template<typename T, int NW, int W> inline void store(pack<T, NW, __m512d, double, W> &op, mptr<long, memhint::temporal|memhint::unaligned> ptr) { typedef pack<T, NW, __m512d, double, W> type_t; long *p = ptr; #if defined(SIMD_AVX512F) __mmask16 sm; sm = _mm512_kxnor(sm, sm); #endif for(int i = 0; i < type_t::num_regs; ++i) { __m512i temp = cvt512_pd_epi64(op(i)); #if defined(SIMD_AVX512F) _mm512_mask_storeu_epi64(p, sm, temp); p += type_traits<double>::num_bvals_per_reg; #else _mm512_packstorelo_epi64(p, temp); p += type_traits<double>::num_bvals_per_reg; _mm512_packstorehi_epi64(p, temp); #endif } } // masked unaligned temporal store: double -> long template<typename T, int NW, int W> inline void store(pack<T, NW, __m512d, double, W> &op, mptr<long, memhint::temporal|memhint::unaligned> ptr, const mask<T, NW> &m) { typedef pack<T, NW, __m512d, double, W> type_t; long *p = ptr; for(int i = 0; i < type_t::num_regs; ++i) { __m512i temp = cvt512_pd_epi64(op(i)); #if defined(SIMD_AVX512F) _mm512_mask_storeu_epi64(p, m(i), temp); p += type_traits<double>::num_bvals_per_reg; #else __m512i temp1; temp1 = _mm512_loadunpacklo_epi64(temp1, p); temp1 = _mm512_loadunpackhi_epi64(temp1, p+type_traits<long>::num_bvals_per_reg); temp = _mm512_mask_blend_epi64(m(i), temp1, temp); _mm512_packstorelo_epi64(p, temp); p += type_traits<double>::num_bvals_per_reg; _mm512_packstorehi_epi64(p, temp); #endif } } // unaligned temporal store: double -> float template<typename T, int NW, int W> inline void store(pack<T, NW, __m512d, double, W> &op, mptr<float, memhint::temporal|memhint::unaligned> ptr) { typedef pack<T, NW, __m512d, double, W> type_t; float *p = ptr; __mmask16 sm = _mm512_int2mask(0b0000000011111111); for(int i = 0; i < type_t::num_regs; ++i) { __m512 temp = cvt512_pd_pslo(op(i)); #if defined(SIMD_AVX512F) _mm512_mask_storeu_ps(p, sm, temp); #else _mm512_mask_packstorelo_ps(p, sm, temp); _mm512_mask_packstorehi_ps(p+type_traits<float>::num_bvals_per_reg, sm, temp); #endif p += type_traits<double>::num_bvals_per_reg; } } // masked unaligned temporal store: double -> float template<typename T, int NW, int W> inline void store(pack<T, NW, __m512d, double, W> &op, mptr<float, memhint::temporal|memhint::unaligned> ptr, const mask<T, NW> &m) { typedef pack<T, NW, __m512d, double, W> type_t; float *p = ptr; __mmask16 sm = _mm512_int2mask(0b0000000011111111); for(int i = 0; i < type_t::num_regs; ++i) { __m512 temp = cvt512_pd_pslo(op(i)); #if defined(SIMD_AVX512F) _mm512_mask_storeu_ps(p, _mm512_kand(m(i), sm), temp); #else __m512 temp1; temp1 = _mm512_mask_loadunpacklo_ps(temp1, sm, p); temp1 = _mm512_mask_loadunpackhi_ps(temp1, sm, p+type_traits<float>::num_bvals_per_reg); temp = _mm512_mask_blend_ps(m(i), temp1, temp); _mm512_mask_packstorelo_ps(p, sm, temp); _mm512_mask_packstorehi_ps(p+type_traits<float>::num_bvals_per_reg, sm, temp); #endif p += type_traits<double>::num_bvals_per_reg; } } // unaligned temporal store: double -> double template<typename T, int NW, int W> inline void store(pack<T, NW, __m512d, double, W> &op, mptr<double, memhint::temporal|memhint::unaligned> ptr) { typedef pack<T, NW, __m512d, double, W> type_t; double *p = ptr; for(int i = 0; i < type_t::num_regs; ++i) { #if defined(SIMD_AVX512F) _mm512_storeu_pd(p, op(i)); p += type_traits<double>::num_bvals_per_reg; #else _mm512_packstorelo_pd(p, op(i)); p += type_traits<double>::num_bvals_per_reg; _mm512_packstorehi_pd(p, op(i)); #endif } } // masked unaligned temporal store: double -> double template<typename T, int NW, int W> inline void store(pack<T, NW, __m512d, double, W> &op, mptr<double, memhint::temporal|memhint::unaligned> ptr, const mask<T, NW> &m) { typedef pack<T, NW, __m512d, double, W> type_t; double *p = ptr; for(int i = 0; i < type_t::num_regs; ++i) { #if defined(SIMD_AVX512F) _mm512_mask_storeu_pd(p, m(i), op(i)); p += type_traits<double>::num_bvals_per_reg; #else __m512d temp; temp = _mm512_loadunpacklo_pd(temp, p); temp = _mm512_loadunpackhi_pd(temp, p+type_traits<double>::num_bvals_per_reg); temp = _mm512_mask_blend_pd(m(i), temp, op(i)); _mm512_packstorelo_pd(p, temp); p += type_traits<double>::num_bvals_per_reg; _mm512_packstorehi_pd(p, temp); #endif } } /*template<typename T, int NW, int W> inline void load(pack<T, NW, __m512i, long, W> &op, const_mptr<long, memhint::temporal|memhint::unaligned> ptr) { typedef pack<T, NW, __m512i, long, W> type_t; long const *p = ptr; for(int i = 0; i < type_t::num_regs; ++i) { op(i) = _mm512_loadunpacklo_epi64(op(i), p); p += type_t::num_bvals_per_reg; op(i) = _mm512_loadunpackhi_epi64(op(i), p); } }*/ /*template<typename T, int NW, int W> inline void load(pack<T, NW, __m512, float, W> &op, const_mptr<float, memhint::temporal|memhint::unaligned> ptr) { float const *p = ptr; for(int i = 0; i < pack<T, NW, __m512, float, W>::num_regs; ++i) { op(i) = _mm512_loadunpacklo_ps(op(i), p); p += pack<T, NW, __m512, float, W>::num_bvals_per_reg; op(i) = _mm512_loadunpackhi_ps(op(i), p); } }*/ /*template<typename T, int NW, int W> inline void load(pack<T, NW, __m512d, double, W> &op, const_mptr<double, memhint::temporal|memhint::unaligned> ptr) { double const *p = ptr; for(int i = 0; i < pack<T, NW, __m512d, double, W>::num_regs; ++i) { op(i) = _mm512_loadunpacklo_pd(op(i), p); p += pack<T, NW, __m512d, double, W>::num_bvals_per_reg; op(i) = _mm512_loadunpackhi_pd(op(i), p); } }*/ /*template<typename T, int NW, int W> inline void store(pack<T, NW, __m512i, int, W> const &op, mptr<int, memhint::temporal|memhint::unaligned> ptr) { int *p = ptr; for(int i = 0; i < pack<T, NW, __m512i, int, W>::num_regs; ++i) { _mm512_packstorelo_epi32(p, op(i)); p += pack<T, NW, __m512i, int, W>::num_bvals_per_reg; _mm512_packstorehi_epi32(p, op(i)); } }*/ /*template<typename T, int NW, int W> inline void store(pack<T, NW, __m512i, long, W> const &op, mptr<long, memhint::temporal|memhint::unaligned> ptr) { long *p = ptr; for(int i = 0; i < pack<T, NW, __m512i, long, W>::num_regs; ++i) { _mm512_packstorelo_epi64(p, op(i)); p += pack<T, NW, __m512i, long, W>::num_bvals_per_reg; _mm512_packstorehi_epi64(p, op(i)); } }*/ /*template<typename T, int NW, int W> inline void store(pack<T, NW, __m512, float, W> const &op, mptr<float, memhint::temporal|memhint::unaligned> ptr) { float *p = ptr; for(int i = 0; i < pack<T, NW, __m512, float, W>::num_regs; ++i) { _mm512_packstorelo_ps(p, op(i)); p += pack<T, NW, __m512, float, W>::num_bvals_per_reg; _mm512_packstorehi_ps(p, op(i)); } }*/ /*template<typename T, int NW, int W> inline void store(pack<T, NW, __m512d, double, W> const &op, mptr<double, memhint::temporal|memhint::unaligned> ptr) { double *p = ptr; for(int i = 0; i < pack<T, NW, __m512d, double, W>::num_regs; ++i) { _mm512_packstorelo_pd(p, op(i)); p += pack<T, NW, __m512d, double, W>::num_bvals_per_reg; _mm512_packstorehi_pd(p, op(i)); } }*/ /* Permute functions */ template<> class permutation<permute_pattern::aacc> { public: template<typename T, int NW> inline static pack<T, NW, __m512i, int, 4> permute(const pack<T, NW, __m512i, int, 4> &op) { typedef pack<T, NW, __m512i, int, 4> type; type temp; for(int i = 0; i < type::num_regs; ++i) { temp(i) = _mm512_shuffle_epi32(op(i), _MM_PERM_CCAA); } return temp; } template<typename T, int NW> inline static pack<T, NW, __m512i, long, 4> permute(const pack<T, NW, __m512i, long, 4> &op) { typedef pack<T, NW, __m512i, long, 4> type; type temp; for(int i = 0; i < type::num_regs; ++i) { temp(i) = _mm512_shuffle_epi32(op(i), _MM_PERM_BABA); } return temp; } template<typename T, int NW> inline static pack<T, NW, __m512, float, 4> permute(const pack<T, NW, __m512, float, 4> &op) { typedef pack<T, NW, __m512, float, 4> type; type temp; for(int i = 0; i < type::num_regs; ++i) { #if defined(SIMD_AVX512F) temp(i) = _mm512_permute_ps(op(i), _MM_PERM_CCAA); #else temp(i) = _mm512_castsi512_ps(_mm512_shuffle_epi32(_mm512_castps_si512(op(i)), _MM_PERM_CCAA)); #endif } return temp; } template<typename T, int NW> inline static pack<T, NW, __m512d, double, 4> permute(const pack<T, NW, __m512d, double, 4> &op) { typedef pack<T, NW, __m512d, double, 4> type; type temp; for(int i = 0; i < type::num_regs; ++i) { #if defined(SIMD_AVX512F) temp(i) = _mm512_permute_pd(op(i), 0x0); #else temp(i) = _mm512_castsi512_pd(_mm512_shuffle_epi32(_mm512_castpd_si512(op(i)), _MM_PERM_BABA)); #endif } return temp; } }; template<> class permutation<permute_pattern::abab> { public: template<typename T, int NW> inline static pack<T, NW, __m512i, int, 4> permute(const pack<T, NW, __m512i, int, 4> &op) { typedef pack<T, NW, __m512i, int, 4> type; type temp; for(int i = 0; i < type::num_regs; ++i) { temp(i) = _mm512_shuffle_epi32(op(i), _MM_PERM_BABA); } return temp; } template<typename T, int NW> inline static pack<T, NW, __m512i, long, 4> permute(const pack<T, NW, __m512i, long, 4> &op) { typedef pack<T, NW, __m512i, long, 4> type; type temp; for(int i = 0; i < type::num_regs; ++i) { temp(i) = _mm512_permute4f128_epi32(op(i), _MM_PERM_CCAA); } return temp; } template<typename T, int NW> inline static pack<T, NW, __m512, float, 4> permute(const pack<T, NW, __m512, float, 4> &op) { typedef pack<T, NW, __m512, float, 4> type; type temp; for(int i = 0; i < type::num_regs; ++i) { #if defined(SIMD_AVX512F) temp(i) = _mm512_permute_ps(op(i), _MM_PERM_BABA); #else temp(i) = _mm512_castsi512_ps(_mm512_shuffle_epi32(_mm512_castps_si512(op(i)), _MM_PERM_BABA)); #endif } return temp; } template<typename T, int NW> inline static pack<T, NW, __m512d, double, 4> permute(const pack<T, NW, __m512d, double, 4> &op) { typedef pack<T, NW, __m512d, double, 4> type; type temp; for(int i = 0; i < type::num_regs; ++i) { temp(i) = _mm512_castsi512_pd(_mm512_permute4f128_epi32(_mm512_castpd_si512(op(i)), _MM_PERM_CCAA)); } return temp; } }; template<> class permutation<permute_pattern::bbdd> { public: template<typename T, int NW> inline static pack<T, NW, __m512i, int, 4> permute(const pack<T, NW, __m512i, int, 4> &op) { typedef pack<T, NW, __m512i, int, 4> type; type temp; for(int i = 0; i < type::num_regs; ++i) { temp(i) = _mm512_shuffle_epi32(op(i), _MM_PERM_DDBB); } return temp; } template<typename T, int NW> inline static pack<T, NW, __m512i, long, 4> permute(const pack<T, NW, __m512i, long, 4> &op) { typedef pack<T, NW, __m512i, long, 4> type; type temp; for(int i = 0; i < type::num_regs; ++i) { temp(i) = _mm512_shuffle_epi32(op(i), _MM_PERM_DCDC); } return temp; } template<typename T, int NW> inline static pack<T, NW, __m512, float, 4> permute(const pack<T, NW, __m512, float, 4> &op) { typedef pack<T, NW, __m512, float, 4> type; type temp; for(int i = 0; i < type::num_regs; ++i) { #if defined(SIMD_AVX512F) temp(i) = _mm512_permute_ps(op(i), _MM_PERM_DDBB); #else temp(i) = _mm512_castsi512_ps(_mm512_shuffle_epi32(_mm512_castps_si512(op(i)), _MM_PERM_DDBB)); #endif } return temp; } template<typename T, int NW> inline static pack<T, NW, __m512d, double, 4> permute(const pack<T, NW, __m512d, double, 4> &op) { typedef pack<T, NW, __m512d, double, 4> type; type temp; for(int i = 0; i < type::num_regs; ++i) { temp(i) = _mm512_castsi512_pd(_mm512_shuffle_epi32(_mm512_castpd_si512(op(i)), _MM_PERM_DCDC)); } return temp; } }; template<> class permutation<permute_pattern::cdcd> { public: template<typename T, int NW> inline static pack<T, NW, __m512i, int, 4> permute(const pack<T, NW, __m512i, int, 4> &op) { typedef pack<T, NW, __m512i, int, 4> type; type temp; for(int i = 0; i < type::num_regs; ++i) { temp(i) = _mm512_shuffle_epi32(op(i), _MM_PERM_DCDC); } return temp; } template<typename T, int NW> inline static pack<T, NW, __m512i, long, 4> permute(const pack<T, NW, __m512i, long, 4> &op) { typedef pack<T, NW, __m512i, long, 4> type; type temp; for(int i = 0; i < type::num_regs; ++i) { temp(i) = _mm512_permute4f128_epi32(op(i), _MM_PERM_DDBB); } return temp; } template<typename T, int NW> inline static pack<T, NW, __m512, float, 4> permute(const pack<T, NW, __m512, float, 4> &op) { typedef pack<T, NW, __m512, float, 4> type; type temp; for(int i = 0; i < type::num_regs; ++i) { #if defined(SIMD_AVX512F) temp(i) = _mm512_permute_ps(op(i), _MM_PERM_DCDC); #else temp(i) = _mm512_castsi512_ps(_mm512_shuffle_epi32(_mm512_castps_si512(op(i)), _MM_PERM_DCDC)); #endif } return temp; } template<typename T, int NW> inline static pack<T, NW, __m512d, double, 4> permute(const pack<T, NW, __m512d, double, 4> &op) { typedef pack<T, NW, __m512d, double, 4> type; type temp; for(int i = 0; i < type::num_regs; ++i) { temp(i) = _mm512_castsi512_pd(_mm512_permute4f128_epi32(_mm512_castpd_si512(op(i)), _MM_PERM_DDBB)); } return temp; } }; template<> class permutation<permute_pattern::dcba> { public: template<typename T, int NW> inline static pack<T, NW, __m512i, int, 4> permute(const pack<T, NW, __m512i, int, 4> &op) { typedef pack<T, NW, __m512i, int, 4> type; type temp; for(int i = 0; i < type::num_regs; ++i) { temp(i) = _mm512_shuffle_epi32(op(i), _MM_PERM_ABCD); } return temp; } template<typename T, int NW> inline static pack<T, NW, __m512i, long, 4> permute(const pack<T, NW, __m512i, long, 4> &op) { typedef pack<T, NW, __m512i, long, 4> type; type temp; for(int i = 0; i < type::num_regs; ++i) { #if defined(SIMD_AVX512F) temp(i) = _mm512_permutex_epi64(op(i), _MM_SHUFFLE(0,1,2,3)); #else temp(i) = _mm512_swizzle_epi64(_mm512_swizzle_epi64(op(i), _MM_SWIZ_REG_CDAB), _MM_SWIZ_REG_BADC); #endif } return temp; } template<typename T, int NW> inline static pack<T, NW, __m512, float, 4> permute(const pack<T, NW, __m512, float, 4> &op) { typedef pack<T, NW, __m512, float, 4> type; type temp; for(int i = 0; i < type::num_regs; ++i) { #if defined(SIMD_AVX512F) temp(i) = _mm512_permute_ps(op(i), _MM_SHUFFLE(0,1,2,3)); #else temp(i) = _mm512_swizzle_ps(_mm512_swizzle_ps(op(i), _MM_SWIZ_REG_CDAB), _MM_SWIZ_REG_BADC); #endif } return temp; } template<typename T, int NW> inline static pack<T, NW, __m512d, double, 4> permute(const pack<T, NW, __m512d, double, 4> &op) { typedef pack<T, NW, __m512d, double, 4> type; type temp; for(int i = 0; i < type::num_regs; ++i) { #if defined(SIMD_AVX512F) temp(i) = _mm512_permutex_pd(op(i), _MM_SHUFFLE(0,1,2,3)); #else temp(i) = _mm512_swizzle_pd(_mm512_swizzle_pd(op(i), _MM_SWIZ_REG_CDAB), _MM_SWIZ_REG_BADC); #endif } return temp; } }; template<> class permutation<permute_pattern::dbca> { public: template<typename T, int NW> inline static pack<T, NW, __m512i, int, 4> permute(const pack<T, NW, __m512i, int, 4> &op) { typedef pack<T, NW, __m512i, int, 4> type; type temp; for(int i = 0; i < type::num_regs; ++i) { temp(i) = _mm512_shuffle_epi32(op(i), _MM_PERM_ACBD); } return temp; } template<typename T, int NW> inline static pack<T, NW, __m512i, long, 4> permute(const pack<T, NW, __m512i, long, 4> &op) { typedef pack<T, NW, __m512i, long, 4> type; type temp; for(int i = 0; i < type::num_regs; ++i) { #if defined(SIMD_AVX512F) temp(i) = _mm512_permutex_epi64(op(i), _MM_SHUFFLE(0,2,1,3)); #else temp(i) = _mm512_mask_blend_epi64( _mm512_int2mask(0b1001100110011001), op(i), _mm512_swizzle_epi64(_mm512_swizzle_epi64(op(i), _MM_SWIZ_REG_CDAB), _MM_SWIZ_REG_BADC) ); #endif } return temp; } template<typename T, int NW> inline static pack<T, NW, __m512, float, 4> permute(const pack<T, NW, __m512, float, 4> &op) { typedef pack<T, NW, __m512, float, 4> type; type temp; for(int i = 0; i < type::num_regs; ++i) { #if defined(SIMD_AVX512F) temp(i) = _mm512_permute_ps(op(i), _MM_SHUFFLE(0,2,1,3)); #else temp(i) = _mm512_mask_blend_ps( _mm512_int2mask(0b1001100110011001), op(i), _mm512_swizzle_ps(_mm512_swizzle_ps(op(i), _MM_SWIZ_REG_CDAB), _MM_SWIZ_REG_BADC) ); #endif } return temp; } template<typename T, int NW> inline static pack<T, NW, __m512d, double, 4> permute(const pack<T, NW, __m512d, double, 4> &op) { typedef pack<T, NW, __m512d, double, 4> type; type temp; for(int i = 0; i < type::num_regs; ++i) { #if defined(SIMD_AVX512F) temp(i) = _mm512_permutex_pd(op(i), _MM_SHUFFLE(0,2,1,3)); #else temp(i) = _mm512_mask_blend_pd( _mm512_int2mask(0b1001100110011001), op(i), _mm512_swizzle_pd(_mm512_swizzle_pd(op(i), _MM_SWIZ_REG_CDAB), _MM_SWIZ_REG_BADC) ); #endif } return temp; } }; template<> class permutation<permute_pattern::acac> { public: template<typename T, int NW> inline static pack<T, NW, __m512i, int, 4> permute(const pack<T, NW, __m512i, int, 4> &op) { typedef pack<T, NW, __m512i, int, 4> type; type temp; for(int i = 0; i < type::num_regs; ++i) { temp(i) = _mm512_shuffle_epi32(op(i), _MM_PERM_CACA); } return temp; } template<typename T, int NW> inline static pack<T, NW, __m512i, long, 4> permute(const pack<T, NW, __m512i, long, 4> &op) { typedef pack<T, NW, __m512i, long, 4> type; type temp; for(int i = 0; i < type::num_regs; ++i) { #if defined(SIMD_AVX512F) temp(i) = _mm512_permutex_epi64(op(i), _MM_SHUFFLE(2,0,2,0)); #else temp(i) = _mm512_mask_blend_epi64( _mm512_int2mask(0b1010101010101010), _mm512_swizzle_epi64(op(i), _MM_SWIZ_REG_AAAA), _mm512_swizzle_epi64(op(i), _MM_SWIZ_REG_CCCC) ); #endif } return temp; } template<typename T, int NW> inline static pack<T, NW, __m512, float, 4> permute(const pack<T, NW, __m512, float, 4> &op) { typedef pack<T, NW, __m512, float, 4> type; type temp; for(int i = 0; i < type::num_regs; ++i) { #if defined(SIMD_AVX512F) temp(i) = _mm512_permute_ps(op(i), _MM_SHUFFLE(2,0,2,0)); #else temp(i) = _mm512_mask_blend_ps( _mm512_int2mask(0b1010101010101010), _mm512_swizzle_ps(op(i), _MM_SWIZ_REG_AAAA), _mm512_swizzle_ps(op(i), _MM_SWIZ_REG_CCCC) ); #endif } return temp; } template<typename T, int NW> inline static pack<T, NW, __m512d, double, 4> permute(const pack<T, NW, __m512d, double, 4> &op) { typedef pack<T, NW, __m512d, double, 4> type; type temp; for(int i = 0; i < type::num_regs; ++i) { #if defined(SIMD_AVX512F) temp(i) = _mm512_permutex_pd(op(i), _MM_SHUFFLE(2,0,2,0)); #else temp(i) = _mm512_mask_blend_pd( _mm512_int2mask(0b1010101010101010), _mm512_swizzle_pd(op(i), _MM_SWIZ_REG_AAAA), _mm512_swizzle_pd(op(i), _MM_SWIZ_REG_CCCC) ); #endif } return temp; } }; template<> class permutation<permute_pattern::bdbd> { public: template<typename T, int NW> inline static pack<T, NW, __m512i, int, 4> permute(const pack<T, NW, __m512i, int, 4> &op) { typedef pack<T, NW, __m512i, int, 4> type; type temp; for(int i = 0; i < type::num_regs; ++i) { temp(i) = _mm512_shuffle_epi32(op(i), _MM_PERM_DBDB); } return temp; } template<typename T, int NW> inline static pack<T, NW, __m512i, long, 4> permute(const pack<T, NW, __m512i, long, 4> &op) { typedef pack<T, NW, __m512i, long, 4> type; type temp; for(int i = 0; i < type::num_regs; ++i) { #if defined(SIMD_AVX512F) temp(i) = _mm512_permutex_epi64(op(i), _MM_SHUFFLE(3,1,3,1)); #else temp(i) = _mm512_mask_blend_epi64( _mm512_int2mask(0b1010101010101010), _mm512_swizzle_epi64(op(i), _MM_SWIZ_REG_BBBB), _mm512_swizzle_epi64(op(i), _MM_SWIZ_REG_DDDD) ); #endif } return temp; } template<typename T, int NW> inline static pack<T, NW, __m512, float, 4> permute(const pack<T, NW, __m512, float, 4> &op) { typedef pack<T, NW, __m512, float, 4> type; type temp; for(int i = 0; i < type::num_regs; ++i) { #if defined(SIMD_AVX512F) temp(i) = _mm512_permute_ps(op(i), _MM_SHUFFLE(3,1,3,1)); #else temp(i) = _mm512_mask_blend_ps( _mm512_int2mask(0b1010101010101010), _mm512_swizzle_ps(op(i), _MM_SWIZ_REG_BBBB), _mm512_swizzle_ps(op(i), _MM_SWIZ_REG_DDDD) ); #endif } return temp; } template<typename T, int NW> inline static pack<T, NW, __m512d, double, 4> permute(const pack<T, NW, __m512d, double, 4> &op) { typedef pack<T, NW, __m512d, double, 4> type; type temp; for(int i = 0; i < type::num_regs; ++i) { #if defined(SIMD_AVX512F) temp(i) = _mm512_permutex_pd(op(i), _MM_SHUFFLE(3,1,3,1)); #else temp(i) = _mm512_mask_blend_pd( _mm512_int2mask(0b1010101010101010), _mm512_swizzle_pd(op(i), _MM_SWIZ_REG_BBBB), _mm512_swizzle_pd(op(i), _MM_SWIZ_REG_DDDD) ); #endif } return temp; } }; template<> class permutation<permute_pattern::acbd> { public: template<typename T, int NW> inline static pack<T, NW, __m512i, int, 4> permute(const pack<T, NW, __m512i, int, 4> &op) { typedef pack<T, NW, __m512i, int, 4> type; type temp; for(int i = 0; i < type::num_regs; ++i) { temp(i) = _mm512_shuffle_epi32(op(i), _MM_PERM_DBCA); } return temp; } template<typename T, int NW> inline static pack<T, NW, __m512i, long, 4> permute(const pack<T, NW, __m512i, long, 4> &op) { typedef pack<T, NW, __m512i, long, 4> type; type temp; for(int i = 0; i < type::num_regs; ++i) { #if defined(SIMD_AVX512F) temp(i) = _mm512_permutex_epi64(op(i), _MM_SHUFFLE(3,1,2,0)); #else temp(i) = _mm512_mask_blend_epi64( _mm512_int2mask(0b0110011001100110), op(i), _mm512_swizzle_epi64(_mm512_swizzle_epi64(op(i), _MM_SWIZ_REG_CDAB), _MM_SWIZ_REG_BADC) ); #endif } return temp; } template<typename T, int NW> inline static pack<T, NW, __m512, float, 4> permute(const pack<T, NW, __m512, float, 4> &op) { typedef pack<T, NW, __m512, float, 4> type; type temp; for(int i = 0; i < type::num_regs; ++i) { #if defined(SIMD_AVX512F) temp(i) = _mm512_permute_ps(op(i), _MM_SHUFFLE(3,1,2,0)); #else temp(i) = _mm512_mask_blend_ps( _mm512_int2mask(0b0110011001100110), op(i), _mm512_swizzle_ps(_mm512_swizzle_ps(op(i), _MM_SWIZ_REG_CDAB), _MM_SWIZ_REG_BADC) ); #endif } return temp; } template<typename T, int NW> inline static pack<T, NW, __m512d, double, 4> permute(const pack<T, NW, __m512d, double, 4> &op) { typedef pack<T, NW, __m512d, double, 4> type; type temp; for(int i = 0; i < type::num_regs; ++i) { #if defined(SIMD_AVX512F) temp(i) = _mm512_permutex_pd(op(i), _MM_SHUFFLE(3,1,2,0)); #else temp(i) = _mm512_mask_blend_pd( _mm512_int2mask(0b0110011001100110), op(i), _mm512_swizzle_pd(_mm512_swizzle_pd(op(i), _MM_SWIZ_REG_CDAB), _MM_SWIZ_REG_BADC) ); #endif } return temp; } }; /* Interleave functions */ template<typename T, int NW, int VF> void interleave(varray<pack<T, NW, __m512, float, 1>, VF> op) { typedef pack<T, NW, __m512, float, 1> type_t; __mmask16 m1 = _mm512_int2mask(0b1010101010101010); __mmask16 m2 = _mm512_int2mask(0b1100110011001100); __mmask16 m3 = _mm512_int2mask(0b1111000011110000); __mmask16 m4 = _mm512_int2mask(0b1111111100000000); for(int ri = 0; ri < type_t::num_regs; ++ri) { for(int i = 0; i < NW; i+=2) { __m512 op1 = _mm512_swizzle_ps(op[i](ri), _MM_SWIZ_REG_CDAB); __m512 op2 = _mm512_swizzle_ps(op[i+1](ri), _MM_SWIZ_REG_CDAB); op[i](ri) = _mm512_mask_blend_ps(m1, op[i](ri), op2); op[i+1](ri) = _mm512_mask_blend_ps(m1, op1, op[i+1](ri)); } for(int i = 0; i < NW; i+=4) { for(int j = 0; j < 2; ++j) { __m512 op1 = _mm512_swizzle_ps(op[i+j](ri), _MM_SWIZ_REG_BADC); __m512 op2 = _mm512_swizzle_ps(op[i+j+2](ri), _MM_SWIZ_REG_BADC); op[i+j](ri) = _mm512_mask_blend_ps(m2, op[i+j](ri), op2); op[i+j+2](ri) = _mm512_mask_blend_ps(m2, op1, op[i+j+2](ri)); } } for(int i = 0; i < NW; i += 8) { for(int j = 0; j < 4; ++j) { __m512 op1 = _mm512_permute4f128_ps(op[i+j](ri), _MM_PERM_CDAB); __m512 op2 = _mm512_permute4f128_ps(op[i+j+4](ri), _MM_PERM_CDAB); op[i+j](ri) = _mm512_mask_blend_ps(m3, op[i+j](ri), op2); op[i+j+4](ri) = _mm512_mask_blend_ps(m3, op1, op[i+j+4](ri)); } } for(int i = 0; i < NW; i += 16) { for(int j = 0; j < 8; ++j) { __m512 op1 = _mm512_permute4f128_ps(op[i+j](ri), _MM_PERM_BADC); __m512 op2 = _mm512_permute4f128_ps(op[i+j+8](ri), _MM_PERM_BADC); op[i+j](ri) = _mm512_mask_blend_ps(m4, op[i+j](ri), op2); op[i+j+8](ri) = _mm512_mask_blend_ps(m4, op1, op[i+j+8](ri)); } } } if(type_t::num_regs > 1) { for(int i = 0; i < type_t::num_regs; ++i) { for(int j = i+1; j < type_t::num_regs; ++j) { int m1 = i*16; int m2 = j*16; for(int k = 0; k < 16; ++k, ++m1, ++m2) { __m512 lo = op[m1](j); op[m1](j) = op[m2](i); op[m2](i) = lo; } } } } } template<typename T, int NW, int VF> void interleave(varray<pack<T, NW, __m512, float, 2>, VF> op) { typedef pack<T, NW, __m512, float, 2> type_t; __mmask16 m2 = _mm512_int2mask(0b1100110011001100); __mmask16 m3 = _mm512_int2mask(0b1111000011110000); __mmask16 m4 = _mm512_int2mask(0b1111111100000000); for(int ri = 0; ri < type_t::num_regs; ++ri) { for(int i = 0; i < NW; i+=2) { __m512 op1 = _mm512_swizzle_ps(op[i](ri), _MM_SWIZ_REG_BADC); __m512 op2 = _mm512_swizzle_ps(op[i+1](ri), _MM_SWIZ_REG_BADC); op[i](ri) = _mm512_mask_blend_ps(m2, op[i](ri), op2); op[i+1](ri) = _mm512_mask_blend_ps(m2, op1, op[i+1](ri)); } for(int i = 0; i < NW; i+=4) { for(int j = 0; j < 2; ++j) { __m512 op1 = _mm512_permute4f128_ps(op[i+j](ri), _MM_PERM_CDAB); __m512 op2 = _mm512_permute4f128_ps(op[i+j+2](ri), _MM_PERM_CDAB); op[i+j](ri) = _mm512_mask_blend_ps(m3, op[i+j](ri), op2); op[i+j+2](ri) = _mm512_mask_blend_ps(m3, op1, op[i+j+2](ri)); } } for(int i = 0; i < NW; i += 8) { for(int j = 0; j < 4; ++j) { __m512 op1 = _mm512_permute4f128_ps(op[i+j](ri), _MM_PERM_BADC); __m512 op2 = _mm512_permute4f128_ps(op[i+j+4](ri), _MM_PERM_BADC); op[i+j](ri) = _mm512_mask_blend_ps(m4, op[i+j](ri), op2); op[i+j+4](ri) = _mm512_mask_blend_ps(m4, op1, op[i+j+4](ri)); } } } if(type_t::num_regs > 1) { for(int i = 0; i < type_t::num_regs; ++i) { for(int j = i+1; j < type_t::num_regs; ++j) { int m1 = i*8; int m2 = j*8; for(int k = 0; k < 8; ++k, ++m1, ++m2) { __m512 lo = op[m1](j); op[m1](j) = op[m2](i); op[m2](i) = lo; } } } } } template<typename T, int NW, int VF> void interleave(varray<pack<T, NW, __m512, float, 4>, VF> op) { typedef pack<T, NW, __m512, float, 4> type_t; __mmask16 m3 = _mm512_int2mask(0b1111000011110000); __mmask16 m4 = _mm512_int2mask(0b1111111100000000); for(int ri = 0; ri < type_t::num_regs; ++ri) { for(int i = 0; i < NW; i+=2) { __m512 op1 = _mm512_permute4f128_ps(op[i](ri), _MM_PERM_CDAB); __m512 op2 = _mm512_permute4f128_ps(op[i+1](ri), _MM_PERM_CDAB); op[i](ri) = _mm512_mask_blend_ps(m3, op[i](ri), op2); op[i+1](ri) = _mm512_mask_blend_ps(m3, op1, op[i+1](ri)); } for(int i = 0; i < NW; i+=4) { for(int j = 0; j < 2; ++j) { __m512 op1 = _mm512_permute4f128_ps(op[i+j](ri), _MM_PERM_BADC); __m512 op2 = _mm512_permute4f128_ps(op[i+j+2](ri), _MM_PERM_BADC); op[i+j](ri) = _mm512_mask_blend_ps(m4, op[i+j](ri), op2); op[i+j+2](ri) = _mm512_mask_blend_ps(m4, op1, op[i+j+2](ri)); } } } if(type_t::num_regs > 1) { for(int i = 0; i < type_t::num_regs; ++i) { for(int j = i+1; j < type_t::num_regs; ++j) { int m1 = i*4; int m2 = j*4; for(int k = 0; k < 4; ++k, ++m1, ++m2) { __m512 lo = op[m1](j); op[m1](j) = op[m2](i); op[m2](i) = lo; } } } } } template<typename T, int NW, int VF> void interleave(varray<pack<T, NW, __m512, float, 8>, VF> op) { typedef pack<T, NW, __m512, float, 8> type_t; __mmask16 m4 = _mm512_int2mask(0b1111111100000000); for(int ri = 0; ri < type_t::num_regs; ++ri) { for(int i = 0; i < NW; i+=2) { __m512 op1 = _mm512_permute4f128_ps(op[i](ri), _MM_PERM_BADC); __m512 op2 = _mm512_permute4f128_ps(op[i+1](ri), _MM_PERM_BADC); op[i](ri) = _mm512_mask_blend_ps(m4, op[i](ri), op2); op[i+1](ri) = _mm512_mask_blend_ps(m4, op1, op[i+1](ri)); } } if(type_t::num_regs > 1) { for(int i = 0; i < type_t::num_regs; ++i) { for(int j = i+1; j < type_t::num_regs; ++j) { int m1 = i*2; int m2 = j*2; for(int k = 0; k < 2; ++k, ++m1, ++m2) { __m512 lo = op[m1](j); op[m1](j) = op[m2](i); op[m2](i) = lo; } } } } } template<typename T, int NW, int VF> void interleave(varray<pack<T, NW, __m512, float, 16>, VF> op) { typedef pack<T, NW, __m512, float, 16> type_t; if(type_t::num_regs > 1) { for(int i = 0; i < type_t::num_regs; ++i) { for(int j = i+1; j < type_t::num_regs; ++j) { __m512 lo = op[i](j); op[i](j) = op[j](i); op[j](i) = lo; } } } } template<typename T, int NW, int VF> void interleave(varray<pack<T, NW, __m512d, double, 1>, VF> op) { typedef pack<T, NW, __m512d, double, 1> type_t; __mmask8 m1 = _mm512_int2mask(0b10101010); __mmask8 m2 = _mm512_int2mask(0b11001100); __mmask8 m3 = _mm512_int2mask(0b11110000); for(int ri = 0; ri < type_t::num_regs; ++ri) { for(int i = 0; i < NW; i+=2) { __m512d op1 = _mm512_swizzle_pd(op[i](ri), _MM_SWIZ_REG_CDAB); __m512d op2 = _mm512_swizzle_pd(op[i+1](ri), _MM_SWIZ_REG_CDAB); op[i](ri) = _mm512_mask_blend_pd(m1, op[i](ri), op2); op[i+1](ri) = _mm512_mask_blend_pd(m1, op1, op[i+1](ri)); } for(int i = 0; i < NW; i += 4) { for(int j = 0; j < 2; ++j) { __m512d op1 = _mm512_swizzle_pd(op[i+j](ri), _MM_SWIZ_REG_BADC); __m512d op2 = _mm512_swizzle_pd(op[i+j+2](ri), _MM_SWIZ_REG_BADC); op[i+j](ri) = _mm512_mask_blend_pd(m2, op[i+j](ri), op2); op[i+j+2](ri) = _mm512_mask_blend_pd(m2, op1, op[i+j+2](ri)); } } for(int i = 0; i < NW; i += 8) { for(int j = 0; j < 4; ++j) { __m512d op1 = _mm512_castps_pd(_mm512_permute4f128_ps(_mm512_castpd_ps(op[i+j](ri)), _MM_PERM_BADC)); __m512d op2 = _mm512_castps_pd(_mm512_permute4f128_ps(_mm512_castpd_ps(op[i+j+4](ri)), _MM_PERM_BADC)); op[i+j](ri) = _mm512_mask_blend_pd(m3, op[i+j](ri), op2); op[i+j+4](ri) = _mm512_mask_blend_pd(m3, op1, op[i+j+4](ri)); } } } if(type_t::num_regs > 1) { for(int i = 0; i < type_t::num_regs; ++i) { for(int j = i+1; j < type_t::num_regs; ++j) { int m1 = i*8; int m2 = j*8; for(int k = 0; k < 8; ++k, ++m1, ++m2) { __m512d lo = op[m1](j); op[m1](j) = op[m2](i); op[m2](i) = lo; } } } } } template<typename T, int NW, int VF> void interleave(varray<pack<T, NW, __m512d, double, 2>, VF> op) { typedef pack<T, NW, __m512d, double, 2> type_t; __mmask8 m2 = _mm512_int2mask(0b11001100); __mmask8 m3 = _mm512_int2mask(0b11110000); for(int ri = 0; ri < type_t::num_regs; ++ri) { for(int i = 0; i < NW; i+=2) { __m512d op1 = _mm512_swizzle_pd(op[i](ri), _MM_SWIZ_REG_BADC); __m512d op2 = _mm512_swizzle_pd(op[i+1](ri), _MM_SWIZ_REG_BADC); op[i](ri) = _mm512_mask_blend_pd(m2, op[i](ri), op2); op[i+1](ri) = _mm512_mask_blend_pd(m2, op1, op[i+1](ri)); } for(int i = 0; i < NW; i += 4) { for(int j = 0; j < 2; ++j) { __m512d op1 = _mm512_castps_pd(_mm512_permute4f128_ps(_mm512_castpd_ps(op[i+j](ri)), _MM_PERM_BADC)); __m512d op2 = _mm512_castps_pd(_mm512_permute4f128_ps(_mm512_castpd_ps(op[i+j+2](ri)), _MM_PERM_BADC)); op[i+j](ri) = _mm512_mask_blend_pd(m3, op[i+j](ri), op2); op[i+j+2](ri) = _mm512_mask_blend_pd(m3, op1, op[i+j+2](ri)); } } } if(type_t::num_regs > 1) { for(int i = 0; i < type_t::num_regs; ++i) { for(int j = i+1; j < type_t::num_regs; ++j) { int m1 = i*4; int m2 = j*4; for(int k = 0; k < 4; ++k, ++m1, ++m2) { __m512d lo = op[m1](j); op[m1](j) = op[m2](i); op[m2](i) = lo; } } } } } template<typename T, int NW, int VF> void interleave(varray<pack<T, NW, __m512d, double, 4>, VF> op) { typedef pack<T, NW, __m512d, double, 4> type_t; __mmask8 m3 = _mm512_int2mask(0b11110000); for(int ri = 0; ri < type_t::num_regs; ++ri) { for(int i = 0; i < NW; i+=2) { __m512d op1 = _mm512_castps_pd(_mm512_permute4f128_ps(_mm512_castpd_ps(op[i](ri)), _MM_PERM_BADC)); __m512d op2 = _mm512_castps_pd(_mm512_permute4f128_ps(_mm512_castpd_ps(op[i+1](ri)), _MM_PERM_BADC)); op[i](ri) = _mm512_mask_blend_pd(m3, op[i](ri), op2); op[i+1](ri) = _mm512_mask_blend_pd(m3, op1, op[i+1](ri)); } } if(type_t::num_regs > 1) { for(int i = 0; i < type_t::num_regs; ++i) { for(int j = i+1; j < type_t::num_regs; ++j) { int m1 = i*2; int m2 = j*2; for(int k = 0; k < 2; ++k, ++m1, ++m2) { __m512d lo = op[m1](j); op[m1](j) = op[m2](i); op[m2](i) = lo; } } } } } template<typename T, int NW, int VF> void interleave(varray<pack<T, NW, __m512d, double, 8>, VF> op) { typedef pack<T, NW, __m512d, double, 8> type_t; if(type_t::num_regs > 1) { for(int i = 0; i < type_t::num_regs; ++i) { for(int j = i+1; j < type_t::num_regs; ++j) { __m512d lo = op[i](j); op[i](j) = op[j](i); op[j](i) = lo; } } } } #endif // SIMD512 } /*#if SIMD512 namespace simd { //------------------------------------------------------------------------------ // Macros that define SIMD width of various types //------------------------------------------------------------------------------ #define SIMD512_WIDTH 64 #ifdef __SIZEOF_SHORT__ #if __SIZEOF_SHORT__ == 2 CHECK_TYPE_SIZE(short, 2, simd) #define SIMD512_SHORT_WIDTH 32 #else #error "Unsupported short size" #endif #else #error "Macro __SIZEOF_SHORT__ not defined" #endif #ifdef __SIZEOF_INT__ #if __SIZEOF_INT__ == 4 CHECK_TYPE_SIZE(int, 4, simd) #define SIMD512_INT_WIDTH 16 #else #error "Unsupported int size" #endif #else #error "Macro __SIZEOF_INT__ not defined" #endif #ifdef __SIZEOF_LONG__ #if __SIZEOF_LONG__ == 8 CHECK_TYPE_SIZE(long, 8, simd) #define SIMD512_LONG_WIDTH 8 #else #error "Unsupported long size" #endif #else #error "Macro __SIZEOF_LONG__ not defined" #endif #ifdef __SIZEOF_FLOAT__ #if __SIZEOF_FLOAT__ == 4 CHECK_TYPE_SIZE(float, 4, simd) #define SIMD512_FLOAT_WIDTH 16 #else #error "Unsupported float size" #endif #else #error "Macro __SIZEOF_FLOAT__ not defined" #endif #ifdef __SIZEOF_DOUBLE__ #if __SIZEOF_DOUBLE__ == 8 CHECK_TYPE_SIZE(double, 8, simd) #define SIMD512_DOUBLE_WIDTH 8 #else #error "Unsupported double size" #endif #else #error "Macro __SIZEOF_DOUBLE__ not defined" #endif //------------------------------------------------------------------------------ // SIMD value types //------------------------------------------------------------------------------ template<typename ctype, int x> struct value; template<> struct value<short, 512> { //#if defined(SIMD_KNC) // typedef reg2x<__m256i> reg; //#else typedef __m512i reg; //#endif static const size_t width = SIMD512_SHORT_WIDTH; }; template<> struct value<unsigned short, 512> { //#if defined(SIMD_KNC) // typedef reg2x<__m256i> reg; //#else typedef __m512i reg; //#endif static const size_t width = SIMD512_SHORT_WIDTH; }; template<> struct value<int, 512> { typedef __m512i reg; static const size_t width = SIMD512_INT_WIDTH; }; template<> struct value<unsigned int, 512> { typedef __m512i reg; static const size_t width = SIMD512_INT_WIDTH; }; template<> struct value<long, 512> { typedef __m512i reg; static const size_t width = SIMD512_LONG_WIDTH; }; template<> struct value<unsigned long, 512> { typedef __m512i reg; static const size_t width = SIMD512_LONG_WIDTH; }; template<> struct value<float, 512> { typedef __m512 reg; static const size_t width = SIMD512_FLOAT_WIDTH; }; template<> struct value<double, 512> { typedef __m512d reg; static const size_t width = SIMD512_DOUBLE_WIDTH; }; } #endif // #if SIMD512 */ #endif // SIMD_SIMD512X86DEF_HPP
[ "anupzope@gmail.com" ]
anupzope@gmail.com
25d21f80d694a962b9458bbf78ab168eb94f22de
a7f35dc96ba0a0bd63e3d92bacf30db0e393c28f
/lib/dbdparser.h
3c6bc97684759349821f9090668ed5c5b0627762
[]
no_license
mdavidsaver/epicsdbd
1510d419a8f3bd689e8850515500007e7cd93056
ca32da3be4ec39375d80dc5fc4da75fed7240c62
refs/heads/master
2016-09-05T09:32:41.095453
2015-02-12T15:42:29
2015-02-12T15:42:29
30,707,978
0
0
null
null
null
null
UTF-8
C++
false
false
1,776
h
#ifndef DBDPARSER_H #define DBDPARSER_H #include <vector> #include <list> #include "dbdlexer.h" /** @brief Parser for DB/DBD grammar * @code value : tokBare | tokQuote entry : command | code | comment | block command : tokBare value code : tokCode comment : tokComment block : tokeBare block_head | tokeBare block_head bock_body block_head : '(' ')' | '(' value *(',' value) ')' block_body : '{' dbd '}' dbd : | entry | entry dbd @endcode */ class DBDParser : public DBDLexer { public: DBDParser(); virtual ~DBDParser(){}; virtual void reset(); enum parState_t { parDBD, parCoB, parCom, parCode, parArg, parArgCont, parTail }; static const char* parStateName(parState_t S); virtual void lex(std::istream&); inline unsigned depth() const {return parDepth;} bool parDebug; typedef std::vector<std::string> blockarg_t; protected: //! Command name from CoBtoken and arg from tok virtual void parse_command(DBDToken& cmd, DBDToken& arg)=0; //! comment from tok virtual void parse_comment(DBDToken&)=0; //! code from tok virtual void parse_code(DBDToken&)=0; //! Command name from CoBtoken and args from blockargs virtual void parse_block(DBDToken& name, blockarg_t&)=0; //! Mark start of block body virtual void parse_block_body_start()=0; //! Mark start of block body virtual void parse_block_body_end()=0; virtual void parse_start(); virtual void parse_eoi(); private: virtual void token(tokState_t, DBDToken&); parState_t parState; unsigned parDepth; DBDToken CoBtoken; blockarg_t blockargs; }; #endif // DBDPARSER_H
[ "mdavidsaver@bnl.gov" ]
mdavidsaver@bnl.gov
f8c8234810b0d359698729c8b06192aa67e3a1bf
600df3590cce1fe49b9a96e9ca5b5242884a2a70
/third_party/WebKit/Source/core/paint/ObjectPaintProperties.cpp
f216b15f52e9c2e2b0470649535aae4fbd1cf4f6
[ "BSD-2-Clause", "LGPL-2.1-only", "LGPL-2.0-only", "BSD-3-Clause", "LGPL-2.0-or-later", "LicenseRef-scancode-warranty-disclaimer", "GPL-1.0-or-later", "GPL-2.0-only", "LicenseRef-scancode-other-copyleft", "MIT", "Apache-2.0" ]
permissive
metux/chromium-suckless
efd087ba4f4070a6caac5bfbfb0f7a4e2f3c438a
72a05af97787001756bae2511b7985e61498c965
refs/heads/orig
2022-12-04T23:53:58.681218
2017-04-30T10:59:06
2017-04-30T23:35:58
89,884,931
5
3
BSD-3-Clause
2022-11-23T20:52:53
2017-05-01T00:09:08
null
UTF-8
C++
false
false
1,180
cpp
// Copyright 2016 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "core/paint/ObjectPaintProperties.h" namespace blink { ObjectPaintProperties::PropertyTreeStateWithOffset ObjectPaintProperties::contentsProperties() const { ObjectPaintProperties::PropertyTreeStateWithOffset propertiesWithOffset = *localBorderBoxProperties(); if (svgLocalToBorderBoxTransform()) { propertiesWithOffset.propertyTreeState.setTransform( svgLocalToBorderBoxTransform()); // There's no paint offset for the contents because // svgLocalToBorderBoxTransform bakes in the paint offset. propertiesWithOffset.paintOffset = LayoutPoint(); } else if (scrollTranslation()) { propertiesWithOffset.propertyTreeState.setTransform(scrollTranslation()); } if (overflowClip()) propertiesWithOffset.propertyTreeState.setClip(overflowClip()); else if (cssClip()) propertiesWithOffset.propertyTreeState.setClip(cssClip()); // TODO(chrishtr): cssClipFixedPosition needs to be handled somehow. return propertiesWithOffset; } } // namespace blink
[ "enrico.weigelt@gr13.net" ]
enrico.weigelt@gr13.net
2ce166e9c9c859ac90b6475f20978b8aeb4a912a
0f7a4119185aff6f48907e8a5b2666d91a47c56b
/sstd_utility/windows_boost/boost/spirit/home/classic/core/non_terminal/rule.hpp
f4a14cb8b9b22d548689384f9df8a40a0b008105
[]
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
5,880
hpp
/*============================================================================= Copyright (c) 1998-2003 Joel de Guzman http://spirit.sourceforge.net/ 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) =============================================================================*/ #if !defined(BOOST_SPIRIT_RULE_HPP) #define BOOST_SPIRIT_RULE_HPP #include <boost/static_assert.hpp> /////////////////////////////////////////////////////////////////////////////// // // Spirit predefined maximum number of simultaneously usable different // scanner types. // // This limit defines the maximum number of possible different scanner // types for which a specific rule<> may be used. If this isn't defined, a // rule<> may be used with one scanner type only (multiple scanner support // is disabled). // /////////////////////////////////////////////////////////////////////////////// #if !defined(BOOST_SPIRIT_RULE_SCANNERTYPE_LIMIT) # define BOOST_SPIRIT_RULE_SCANNERTYPE_LIMIT 1 #endif // Ensure a meaningful maximum number of simultaneously usable scanner types BOOST_STATIC_ASSERT(BOOST_SPIRIT_RULE_SCANNERTYPE_LIMIT > 0); #include <boost/scoped_ptr.hpp> #include <boost/spirit/home/classic/namespace.hpp> #include <boost/spirit/home/classic/core/non_terminal/impl/rule.ipp> #if BOOST_SPIRIT_RULE_SCANNERTYPE_LIMIT > 1 # include <boost/preprocessor/enum_params.hpp> #endif /////////////////////////////////////////////////////////////////////////////// namespace boost { namespace spirit { BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN #if BOOST_SPIRIT_RULE_SCANNERTYPE_LIMIT > 1 /////////////////////////////////////////////////////////////////////////// // // scanner_list (a fake scanner) // // Typically, rules are tied to a specific scanner type and // a particular rule cannot be used with anything else. Sometimes // there's a need for rules that can accept more than one scanner // type. The scanner_list<S0, ...SN> can be used as a template // parameter to the rule class to specify up to the number of // scanner types defined by the BOOST_SPIRIT_RULE_SCANNERTYPE_LIMIT // constant. Example: // // rule<scanner_list<ScannerT0, ScannerT1> > r; // // *** This feature is available only to compilers that support // partial template specialization. *** // /////////////////////////////////////////////////////////////////////////// template < BOOST_PP_ENUM_PARAMS( BOOST_SPIRIT_RULE_SCANNERTYPE_LIMIT, typename ScannerT ) > struct scanner_list : scanner_base {}; #endif /////////////////////////////////////////////////////////////////////////// // // rule class // // The rule is a polymorphic parser that acts as a named place- // holder capturing the behavior of an EBNF expression assigned to // it. // // The rule is a template class parameterized by: // // 1) scanner (scanner_t, see scanner.hpp), // 2) the rule's context (context_t, see parser_context.hpp) // 3) an arbitrary tag (tag_t, see parser_id.hpp) that allows // a rule to be tagged for identification. // // These template parameters may be specified in any order. The // scanner will default to scanner<> when it is not specified. // The context will default to parser_context when not specified. // The tag will default to parser_address_tag when not specified. // // The definition of the rule (its right hand side, RHS) held by // the rule through a scoped_ptr. When a rule is seen in the RHS // of an assignment or copy construction EBNF expression, the rule // is held by the LHS rule by reference. // /////////////////////////////////////////////////////////////////////////// template < typename T0 = nil_t , typename T1 = nil_t , typename T2 = nil_t > class rule : public impl::rule_base< rule<T0, T1, T2> , rule<T0, T1, T2> const& , T0, T1, T2> { public: typedef rule<T0, T1, T2> self_t; typedef impl::rule_base< self_t , self_t const& , T0, T1, T2> base_t; typedef typename base_t::scanner_t scanner_t; typedef typename base_t::attr_t attr_t; typedef impl::abstract_parser<scanner_t, attr_t> abstract_parser_t; rule() : ptr() {} ~rule() {} rule(rule const& r) : ptr(new impl::concrete_parser<rule, scanner_t, attr_t>(r)) {} template <typename ParserT> rule(ParserT const& p) : ptr(new impl::concrete_parser<ParserT, scanner_t, attr_t>(p)) {} template <typename ParserT> rule& operator=(ParserT const& p) { ptr.reset(new impl::concrete_parser<ParserT, scanner_t, attr_t>(p)); return *this; } rule& operator=(rule const& r) { ptr.reset(new impl::concrete_parser<rule, scanner_t, attr_t>(r)); return *this; } rule<T0, T1, T2> copy() const { return rule<T0, T1, T2>(ptr.get() ? ptr->clone() : 0); } private: friend class impl::rule_base_access; abstract_parser_t* get() const { return ptr.get(); } rule(abstract_parser_t* ptr_) : ptr(ptr_) {} rule(abstract_parser_t const* ptr_) : ptr(ptr_) {} scoped_ptr<abstract_parser_t> ptr; }; BOOST_SPIRIT_CLASSIC_NAMESPACE_END }} // namespace BOOST_SPIRIT_CLASSIC_NS #endif
[ "nanguazhude@vip.qq.com" ]
nanguazhude@vip.qq.com
8f57993337271ae44481ed2c2a62c12138452da0
b77349e25b6154dae08820d92ac01601d4e761ee
/Transparent window/TransparentButton/TransparentButtonDemoDlg.h
3c6466bd4ab4213b0e9c54de9048a5c8d8aac85f
[]
no_license
ShiverZm/MFC
e084c3460fe78f820ff1fec46fe1fc575c3e3538
3d05380d2e02b67269d2f0eb136a3ac3de0dbbab
refs/heads/master
2023-02-21T08:57:39.316634
2021-01-26T10:18:38
2021-01-26T10:18:38
332,725,087
0
0
null
2021-01-25T11:35:20
2021-01-25T11:29:59
null
UTF-8
C++
false
false
994
h
// TransparentButtonDemoDlg.h : header file // #pragma once #include "afxwin.h" #include "HoverButton.h" // CTransparentButtonDemoDlg dialog class CTransparentButtonDemoDlg : public CDialog { // Construction public: CTransparentButtonDemoDlg(CWnd* pParent = NULL); // standard constructor // Dialog Data enum { IDD = IDD_TRANSPARENTBUTTONDEMO_DIALOG }; protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support // Implementation protected: HICON m_hIcon; const int m_nWidth; const int m_nHeight; CRgn m_WinRgn; CBitmap m_Bitmap; CPalette m_Palette; int m_nBkGrndBitmapID; // Generated message map functions virtual BOOL OnInitDialog(); afx_msg void OnPaint(); afx_msg HCURSOR OnQueryDragIcon(); DECLARE_MESSAGE_MAP() public: CHoverButtonEx m_OpenButton; CHoverButtonEx m_SaveButton; CHoverButtonEx m_Btn1; CHoverButtonEx m_Btn2; CHoverButtonEx m_Btn3; CHoverButtonEx m_Btn4; CHoverButtonEx m_ExitBtn; afx_msg void OnBnClickedNextBg(); };
[ "w.z.y2006@163.com" ]
w.z.y2006@163.com
45f0240ff95782fde992000a3971aebcc1ffa987
24ab4757b476a29439ae9f48de3e85dc5195ea4a
/lib/magma-2.2.0/testing/testing_spotrf_mgpu.cpp
702866befa93d575a05a3c2fb9ec2341c49d2506
[]
no_license
caomw/cuc_double
6025d2005a7bfde3372ebf61cbd14e93076e274e
99db19f7cb56c0e3345a681b2c103ab8c88e491f
refs/heads/master
2021-01-17T05:05:07.006372
2017-02-10T10:29:51
2017-02-10T10:29:51
83,064,594
10
2
null
2017-02-24T17:09:11
2017-02-24T17:09:11
null
UTF-8
C++
false
false
6,728
cpp
/* -- MAGMA (version 2.2.0) -- Univ. of Tennessee, Knoxville Univ. of California, Berkeley Univ. of Colorado, Denver @date November 2016 @generated from testing/testing_zpotrf_mgpu.cpp, normal z -> s, Sun Nov 20 20:20:35 2016 */ // includes, system #include <stdlib.h> #include <stdio.h> #include <string.h> #include <math.h> // includes, project #include "flops.h" #include "magma_v2.h" #include "magma_lapack.h" #include "testings.h" /* //////////////////////////////////////////////////////////////////////////// -- Testing spotrf_mgpu */ int main( int argc, char** argv ) { TESTING_CHECK( magma_init() ); magma_print_environment(); real_Double_t gflops, gpu_perf, gpu_time, cpu_perf=0, cpu_time=0; float Anorm, error, work[1]; float c_neg_one = MAGMA_S_NEG_ONE; float *h_A, *h_R; magmaFloat_ptr d_lA[ MagmaMaxGPUs ]; magma_int_t N, n2, lda, ldda, max_size, ngpu; magma_int_t info, nb; magma_int_t ione = 1; magma_int_t ISEED[4] = {0,0,0,1}; int status = 0; magma_opts opts; opts.parse_opts( argc, argv ); opts.ngpu = abs( opts.ngpu ); // always uses multi-GPU code opts.lapack |= opts.check; // check (-c) implies lapack (-l) float tol = opts.tolerance * lapackf77_slamch("E"); magma_queue_t queues[ MagmaMaxAccelerators ] = { NULL }; for( int dev=0; dev < opts.ngpu; ++dev ) { magma_queue_create( dev, &queues[dev] ); } printf("%% ngpu = %lld, uplo = %s\n", (long long) opts.ngpu, lapack_uplo_const(opts.uplo) ); printf("%% N CPU Gflop/s (sec) GPU Gflop/s (sec) ||R||_F / ||A||_F\n"); printf("%%================================================================\n"); for( int itest = 0; itest < opts.ntest; ++itest ) { for( int iter = 0; iter < opts.niter; ++iter ) { N = opts.nsize[itest]; lda = N; n2 = lda*N; nb = magma_get_spotrf_nb( N ); gflops = FLOPS_SPOTRF( N ) / 1e9; // ngpu must be at least the number of blocks ngpu = min( opts.ngpu, magma_ceildiv(N,nb) ); if ( ngpu < opts.ngpu ) { printf( " * too many GPUs for the matrix size, using %lld GPUs\n", (long long) ngpu ); } // Allocate host memory for the matrix TESTING_CHECK( magma_smalloc_cpu( &h_A, n2 )); TESTING_CHECK( magma_smalloc_pinned( &h_R, n2 )); // Allocate device memory // matrix is distributed by block-rows or block-columns // this is maximum size that any GPU stores; // size is rounded up to full blocks in both rows and columns max_size = (1+N/(nb*ngpu))*nb * magma_roundup( N, nb ); for( int dev=0; dev < ngpu; dev++ ) { magma_setdevice( dev ); TESTING_CHECK( magma_smalloc( &d_lA[dev], max_size )); } /* Initialize the matrix */ lapackf77_slarnv( &ione, ISEED, &n2, h_A ); magma_smake_hpd( N, h_A, lda ); lapackf77_slacpy( MagmaFullStr, &N, &N, h_A, &lda, h_R, &lda ); /* ===================================================================== Performs operation using LAPACK =================================================================== */ if ( opts.lapack ) { cpu_time = magma_wtime(); lapackf77_spotrf( lapack_uplo_const(opts.uplo), &N, h_A, &lda, &info ); cpu_time = magma_wtime() - cpu_time; cpu_perf = gflops / cpu_time; if (info != 0) { printf("lapackf77_spotrf returned error %lld: %s.\n", (long long) info, magma_strerror( info )); } } /* ==================================================================== Performs operation using MAGMA =================================================================== */ if ( opts.uplo == MagmaUpper ) { ldda = magma_roundup( N, nb ); magma_ssetmatrix_1D_col_bcyclic( ngpu, N, N, nb, h_R, lda, d_lA, ldda, queues ); } else { ldda = (1+N/(nb*ngpu))*nb; magma_ssetmatrix_1D_row_bcyclic( ngpu, N, N, nb, h_R, lda, d_lA, ldda, queues ); } gpu_time = magma_wtime(); magma_spotrf_mgpu( ngpu, opts.uplo, N, d_lA, ldda, &info ); gpu_time = magma_wtime() - gpu_time; gpu_perf = gflops / gpu_time; if (info != 0) { printf("magma_spotrf_mgpu returned error %lld: %s.\n", (long long) info, magma_strerror( info )); } if ( opts.uplo == MagmaUpper ) { magma_sgetmatrix_1D_col_bcyclic( ngpu, N, N, nb, d_lA, ldda, h_R, lda, queues ); } else { magma_sgetmatrix_1D_row_bcyclic( ngpu, N, N, nb, d_lA, ldda, h_R, lda, queues ); } /* ===================================================================== Check the result compared to LAPACK =================================================================== */ if ( opts.lapack ) { blasf77_saxpy( &n2, &c_neg_one, h_A, &ione, h_R, &ione ); Anorm = lapackf77_slange("f", &N, &N, h_A, &lda, work ); error = lapackf77_slange("f", &N, &N, h_R, &lda, work ) / Anorm; printf("%5lld %7.2f (%7.2f) %7.2f (%7.2f) %8.2e %s\n", (long long) N, cpu_perf, cpu_time, gpu_perf, gpu_time, error, (error < tol ? "ok" : "failed") ); status += ! (error < tol); } else { printf("%5lld --- ( --- ) %7.2f (%7.2f) ---\n", (long long) N, gpu_perf, gpu_time ); } magma_free_cpu( h_A ); magma_free_pinned( h_R ); for( int dev=0; dev < ngpu; dev++ ) { magma_setdevice( dev ); magma_free( d_lA[dev] ); } fflush( stdout ); } if ( opts.niter > 1 ) { printf( "\n" ); } } for( int dev=0; dev < opts.ngpu; ++dev ) { magma_queue_destroy( queues[dev] ); } opts.cleanup(); TESTING_CHECK( magma_finalize() ); return status; }
[ "policmic@fel.cvut.cz" ]
policmic@fel.cvut.cz
cba07642bf2005946de939374979177633859dc2
39f8efad2711780dc486af1b2947505699afa65d
/include/raytracer.h
8b460713c756582ca85b20e4445d5755a8be3a37
[ "MIT" ]
permissive
dburggie/raytracer
0208c29bdb595ecc4a20ffd70fb5f94def45ffc3
d88a7c273c861e83608eb2a52b527cf76fbcc045
refs/heads/master
2021-01-17T17:40:03.621470
2020-04-27T17:20:26
2020-04-27T17:20:26
61,597,729
1
0
null
null
null
null
UTF-8
C++
false
false
5,645
h
#ifndef __RAYTRACER_H #define __RAYTRACER_H #include <random> #define DIV_LIMIT 0.000001 #define ZERO 0.000001 #define ARRAY_SIZE 1000 namespace raytracer { class RNG { private: static RNG * singleton; static bool initialized; std::mt19937 engine; std::uniform_real_distribution<double> uniform; RNG(); public: static RNG * get(); static void init(); double next(); }; class Vector { private: protected: public: double x, y, z; Vector(); Vector(double x, double y, double z); Vector(const Vector & v); static Vector random(double r); // returns a vector in Ball(r) static Vector randunit(); // return random vector of length 1 static double dot(const Vector & v, const Vector & w); double dot() const; double dot(const Vector & v) const; static Vector cross(const Vector & v, const Vector & w); Vector cross(const Vector & v) const; void copy(const Vector & v); void copy(double x, double y, double z); void power(double p); void normalize(); void scale(double s); void scale(const Vector & v); void add(const Vector & v); void add(double x, double y, double z); void subtract(const Vector & v); void subtract(double x, double y, double z); void translate(const Vector & v, double s); void project(const Vector & v); void unproject(const Vector & v); // reflect vector over surface defined by the normal vector void reflect(const Vector & normal); // alter direction of vector across an interface with a ratio of // indexes of refraction defined for a ray traveling in the // direction of the normal void refract(const Vector & normal, double index_ratio); }; class Ray { private: public: Vector p, v; Ray(); Ray(const Vector & point, const Vector & direction); Ray(const Ray & ray); //returns vector some distance along the ray (p+dv) Vector follow(double distance) const; }; class Body { private: public: Body() { } virtual ~Body() { } //return a pointer to a copy of the body virtual Body * clone() const = 0; //check whether a body is transparent at a point virtual bool isTransparent(const Vector & p) const = 0; //get the index of refraction of a body virtual double getIndex(const Vector & p) const = 0; //get the percentage of light absorbed by a body per unit of //travel through it virtual Vector getInteriorColor(const Vector & p) const = 0; //return surface color at a point virtual Vector getColor(const Vector & p) const = 0; //get a Vector perpendicular to the surface at a point //must point to the exterior of the object. virtual Vector getNormal(const Vector & p) const = 0; //find distance to the body (negative if no hit) virtual double getDistance(const Ray & r) const = 0; //percent of light that reflects specularly at a point virtual double getReflectivity(const Vector & p) const = 0; //detect whether a ray was interior to the body at intersection virtual bool isInterior(const Ray & incident_ray) const = 0; }; class Light { private: protected: public: Light() { } virtual ~Light() { } virtual Light * clone() const = 0; virtual Vector getDirection(const Vector & p) const = 0; virtual Vector getColor() const = 0; virtual Vector getIntensity(const Vector & p) const = 0; }; class Sky { private: protected: public: Sky() { } virtual ~Sky() { } virtual Sky * clone() const = 0; virtual Vector getColor(const Vector & direction) const = 0; }; class World { private: int body_count; int light_count; Sky *sky; Light *lights[ARRAY_SIZE]; Body *bodies[ARRAY_SIZE]; protected: public: World(); ~World(); World(const World & w); void addBody(Body * b); void addLight(Light * l); void setSky(Sky * s); Vector sample(Ray r, int depth = 4); }; class Window { private: bool initialized; Vector center, up, down, right, left, origin; double width, height, pixel_size, pixels_per_unit; int x_count, y_count; protected: RNG * rng; public: Window(); void setFocus(const Vector & p); void setOrientation(const Vector & right, const Vector & up); void setSize(double width, double height); void setResolution(int vertical_pixel_count); void init(); //returns true if settings fail int getWidth() const; // in pixels int getHeight() const; // in pixels Vector getPixel(int x, int y) const; // <0,0> is top left corner }; class Camera : public Window { private: Vector position; bool hasBlur; double blur; protected: public: Camera(); Camera(const Vector & position); Camera(const Vector & position, const Vector & focus); void setPosition(const Vector & p); void setBlur(double b); Ray getRay(int x, int y) const; //from position towards pixel <x,y> }; class Image { private: int width, height; Vector ***scanlines; public: Image(); Image(int w, int h); Image(const Image & image); ~Image(); void setDims(int width, int height); void setPixel(int x, int y, const Vector & color); void write(const char * filename) const; }; class Tracer { private: const char * filename; Camera * camera; World * world; protected: public: Tracer(); Tracer(const Tracer & t); ~Tracer(); World * getWorld(); Camera * getCamera(); void render(int anti_alias = 32, int depth = 4); void setOutputName(const char * filename); }; } //end additions to namespace raytracer #endif
[ "dcburggraf@gmail.com" ]
dcburggraf@gmail.com
8082c9d540fd3dbbbad47827252ca7a4c50ecaf5
ca8c1c27ce4f68d9d07df904241288ef707dcc90
/src/lib/data/data_utils.h
e90e90d9b67757cffffa802686e1652c20dcbd37
[ "MIT" ]
permissive
PearCoding/PearSim
9f39442e20c95c7c81900da458b8c56d38e81d62
5bcb306e5949f8e9c54bd6074e2cac9c167d3a6f
refs/heads/master
2021-01-21T19:27:42.175671
2015-08-01T23:10:03
2015-08-01T23:10:03
34,022,060
1
0
null
null
null
null
UTF-8
C++
false
false
3,909
h
#pragma once #include "data.h" // Collection of element based operations! template<typename T> inline Data<T> operator + (const Data<T>& v1, const Data<T>& v2) { Q_ASSERT(v1.hasSameStructure(v2)); Data<T> ret = v1; for (Data<T>::size_type i = 0; i < v1.size(); ++i) { ret.set(i, v1.at(i) + v2.at(i)); } return ret; } template<typename T> inline Data<T> operator + (const Data<T>& v1, const T& v2) { Data<T> ret = v1; for (Data<T>::size_type i = 0; i < v1.size(); ++i) { ret.set(i, v1.at(i) + v2); } return ret; } template<typename T> inline Data<T> operator - (const Data<T>& v1, const Data<T>& v2) { Q_ASSERT(v1.hasSameStructure(v2)); Data<T> ret = v1; for (Data<T>::size_type i = 0; i < v1.size(); ++i) { ret.set(i, v1.at(i) - v2.at(i)); } return ret; } template<typename T> inline Data<T> operator - (const Data<T>& v1, const T& v2) { Data<T> ret = v1; for (Data<T>::size_type i = 0; i < v1.size(); ++i) { ret.set(i, v1.at(i) - v2); } return ret; } template<typename T> inline Data<T> operator * (const Data<T>& v1, const Data<T>& v2) { Q_ASSERT(v1.hasSameStructure(v2)); Data<T> ret = v1; for (Data<T>::size_type i = 0; i < v1.size(); ++i) { ret.set(i, v1.at(i) * v2.at(i)); } return ret; } template<typename T> inline Data<T> operator * (const Data<T>& v1, const T& v2) { Data<T> ret = v1; for (Data<T>::size_type i = 0; i < v1.size(); ++i) { ret.set(i, v1.at(i) * v2); } return ret; } template<typename T> inline Data<T> operator / (const Data<T>& v1, const Data<T>& v2) { Q_ASSERT(v1.hasSameStructure(v2)); Data<T> ret = v1; for (Data<T>::size_type i = 0; i < v1.size(); ++i) { ret.set(i, v1.at(i) / v2.at(i)); } return ret; } template<typename T> inline Data<T> operator / (const Data<T>& v1, const T& v2) { Q_ASSERT(v2 != 0); Data<T> ret = v1; for (Data<T>::size_type i = 0; i < v1.size(); ++i) { ret.set(i, v1.at(i) / v2); } return ret; } template<typename T> inline bool operator == (const Data<T>& v1, const Data<T>& v2) { Q_ASSERT(v1.hasSameStructure(v2)); for (Data<T>::size_type i = 0; i < v1.size(); ++i) { if (v1.at(i) != v2.at(i)) { return false; } } return true; } template<typename T> inline bool operator == (const Data<T>& v1, const T& v2) { for (Data<T>::size_type i = 0; i < v1.size(); ++i) { if (v1.at(i) != v2) { return false; } } return true; } template<typename T> inline bool operator != (const Data<T>& v1, const Data<T>& v2) { return !(v1 == v2); } template<typename T> inline bool operator != (const Data<T>& v1, const T& v2) { return !(v1 == v2); } template<typename T> inline bool operator >= (const Data<T>& v1, const Data<T>& v2) { Q_ASSERT(v1.hasSameStructure(v2)); for (Data<T>::size_type i = 0; i < v1.size(); ++i) { if (v1.at(i) < v2.at(i)) { return false; } } return true; } template<typename T> inline bool operator >= (const Data<T>& v1, const T& v2) { for (Data<T>::size_type i = 0; i < v1.size(); ++i) { if (v1.at(i) < v2) { return false; } } return true; } template<typename T> inline bool operator <= (const Data<T>& v1, const Data<T>& v2) { Q_ASSERT(v1.hasSameStructure(v2)); for (Data<T>::size_type i = 0; i < v1.size(); ++i) { if (v1.at(i) > v2.at(i)) { return false; } } return true; } template<typename T> inline bool operator <= (const Data<T>& v1, const T& v2) { for (Data<T>::size_type i = 0; i < v1.size(); ++i) { if (v1.at(i) > v2) { return false; } } return true; } template<typename T> inline bool operator < (const Data<T>& v1, const Data<T>& v2) { return !(v1 >= v2); } template<typename T> inline bool operator < (const Data<T>& v1, const T& v2) { return !(v1 >= v2); } template<typename T> inline bool operator > (const Data<T>& v1, const Data<T>& v2) { return !(v1 <= v2); } template<typename T> inline bool operator > (const Data<T>& v1, const T& v2) { return !(v1 <= v2); }
[ "oe.yazici@stud.uni-heidelberg.de" ]
oe.yazici@stud.uni-heidelberg.de
fc309250b62e7e7426890f204d8ffa5481a46273
375fccaa7deeefaa392036e9c7e4c2be1b8cef44
/source/octoon-hal/OpenGL 30/gl30_descriptor_set.h
7bbcc8013d4b52d205ea17c3184fb965aa9e621e
[ "MIT" ]
permissive
naeioi/octoon
b98678df257e87da9fb27e56f0f209ff46cc126b
e32152fe4730fa609def41114613dbe067d31276
refs/heads/master
2020-07-09T05:33:15.019542
2019-08-22T11:34:54
2019-08-22T11:34:58
203,893,478
1
0
MIT
2019-08-23T00:22:11
2019-08-23T00:22:11
null
UTF-8
C++
false
false
9,876
h
#ifndef OCTOON_GL30_DESCRIPTOR_H_ #define OCTOON_GL30_DESCRIPTOR_H_ #include "gl30_types.h" namespace octoon { namespace hal { class GL30GraphicsUniformSet final : public GraphicsUniformSet { OctoonDeclareSubClass(GL30GraphicsUniformSet, GraphicsUniformSet) public: GL30GraphicsUniformSet() noexcept; virtual ~GL30GraphicsUniformSet() noexcept; const std::string& getName() const noexcept override; void uniform1b(bool value) noexcept override; void uniform1i(std::int32_t i1) noexcept override; void uniform2i(const int2& value) noexcept override; void uniform2i(std::int32_t i1, std::int32_t i2) noexcept override; void uniform3i(const int3& value) noexcept override; void uniform3i(std::int32_t i1, std::int32_t i2, std::int32_t i3) noexcept override; void uniform4i(const int4& value) noexcept override; void uniform4i(std::int32_t i1, std::int32_t i2, std::int32_t i3, std::int32_t i4) noexcept override; void uniform1ui(std::uint32_t i1) noexcept override; void uniform2ui(const uint2& value) noexcept override; void uniform2ui(std::uint32_t i1, std::uint32_t i2) noexcept override; void uniform3ui(const uint3& value) noexcept override; void uniform3ui(std::uint32_t i1, std::uint32_t i2, std::uint32_t i3) noexcept override; void uniform4ui(const uint4& value) noexcept override; void uniform4ui(std::uint32_t i1, std::uint32_t i2, std::uint32_t i3, std::uint32_t i4) noexcept override; void uniform1f(float i1) noexcept override; void uniform2f(const float2& value) noexcept override; void uniform2f(float i1, float i2) noexcept override; void uniform3f(const float3& value) noexcept override; void uniform3f(float i1, float i2, float i3) noexcept override; void uniform4f(const float4& value) noexcept override; void uniform4f(float i1, float i2, float i3, float i4) noexcept override; void uniform2fmat(const float* mat2) noexcept override; void uniform2fmat(const float2x2& value) noexcept override; void uniform3fmat(const float* mat3) noexcept override; void uniform3fmat(const float3x3& value) noexcept override; void uniform4fmat(const float* mat4) noexcept override; void uniform4fmat(const float4x4& value) noexcept override; void uniform1iv(const std::vector<int1>& value) noexcept override; void uniform1iv(std::size_t num, const std::int32_t* str) noexcept override; void uniform2iv(const std::vector<int2>& value) noexcept override; void uniform2iv(std::size_t num, const std::int32_t* str) noexcept override; void uniform3iv(const std::vector<int3>& value) noexcept override; void uniform3iv(std::size_t num, const std::int32_t* str) noexcept override; void uniform4iv(const std::vector<int4>& value) noexcept override; void uniform4iv(std::size_t num, const std::int32_t* str) noexcept override; void uniform1uiv(const std::vector<uint1>& value) noexcept override; void uniform1uiv(std::size_t num, const std::uint32_t* str) noexcept override; void uniform2uiv(const std::vector<uint2>& value) noexcept override; void uniform2uiv(std::size_t num, const std::uint32_t* str) noexcept override; void uniform3uiv(const std::vector<uint3>& value) noexcept override; void uniform3uiv(std::size_t num, const std::uint32_t* str) noexcept override; void uniform4uiv(const std::vector<uint4>& value) noexcept override; void uniform4uiv(std::size_t num, const std::uint32_t* str) noexcept override; void uniform1fv(const std::vector<float1>& value) noexcept override; void uniform1fv(std::size_t num, const float* str) noexcept override; void uniform2fv(const std::vector<float2>& value) noexcept override; void uniform2fv(std::size_t num, const float* str) noexcept override; void uniform3fv(const std::vector<float3>& value) noexcept override; void uniform3fv(std::size_t num, const float* str) noexcept override; void uniform4fv(const std::vector<float4>& value) noexcept override; void uniform4fv(std::size_t num, const float* str) noexcept override; void uniform2fmatv(const std::vector<float2x2>& value) noexcept override; void uniform2fmatv(std::size_t num, const float* mat2) noexcept override; void uniform3fmatv(const std::vector<float3x3>& value) noexcept override; void uniform3fmatv(std::size_t num, const float* mat3) noexcept override; void uniform4fmatv(const std::vector<float4x4>& value) noexcept override; void uniform4fmatv(std::size_t num, const float* mat4) noexcept override; void uniformTexture(GraphicsTexturePtr texture, GraphicsSamplerPtr sampler) noexcept override; void uniformBuffer(GraphicsDataPtr ubo) noexcept override; bool getBool() const noexcept override; int getInt() const noexcept override; const int2& getInt2() const noexcept override; const int3& getInt3() const noexcept override; const int4& getInt4() const noexcept override; uint1 getUInt() const noexcept override; const uint2& getUInt2() const noexcept override; const uint3& getUInt3() const noexcept override; const uint4& getUInt4() const noexcept override; float getFloat() const noexcept override; const float2& getFloat2() const noexcept override; const float3& getFloat3() const noexcept override; const float4& getFloat4() const noexcept override; const float2x2& getFloat2x2() const noexcept override; const float3x3& getFloat3x3() const noexcept override; const float4x4& getFloat4x4() const noexcept override; const std::vector<int1>& getIntArray() const noexcept override; const std::vector<int2>& getInt2Array() const noexcept override; const std::vector<int3>& getInt3Array() const noexcept override; const std::vector<int4>& getInt4Array() const noexcept override; const std::vector<uint1>& getUIntArray() const noexcept override; const std::vector<uint2>& getUInt2Array() const noexcept override; const std::vector<uint3>& getUInt3Array() const noexcept override; const std::vector<uint4>& getUInt4Array() const noexcept override; const std::vector<float1>& getFloatArray() const noexcept override; const std::vector<float2>& getFloat2Array() const noexcept override; const std::vector<float3>& getFloat3Array() const noexcept override; const std::vector<float4>& getFloat4Array() const noexcept override; const std::vector<float2x2>& getFloat2x2Array() const noexcept override; const std::vector<float3x3>& getFloat3x3Array() const noexcept override; const std::vector<float4x4>& getFloat4x4Array() const noexcept override; const GraphicsTexturePtr& getTexture() const noexcept override; const GraphicsSamplerPtr& getTextureSampler() const noexcept override; const GraphicsDataPtr& getBuffer() const noexcept override; void setGraphicsParam(GraphicsParamPtr param) noexcept; const GraphicsParamPtr& getGraphicsParam() const noexcept override; private: GL30GraphicsUniformSet(const GL30GraphicsUniformSet&) = delete; GL30GraphicsUniformSet& operator=(const GL30GraphicsUniformSet&) = delete; private: GraphicsParamPtr _param; GraphicsVariant _variant; }; class GL30DescriptorPool final : public GraphicsDescriptorPool { OctoonDeclareSubClass(GL30DescriptorPool, GraphicsDescriptorPool) public: GL30DescriptorPool() noexcept; ~GL30DescriptorPool() noexcept; bool setup(const GraphicsDescriptorPoolDesc& desc) noexcept; void close() noexcept; const GraphicsDescriptorPoolDesc& getDescriptorPoolDesc() const noexcept override; private: friend class GL30Device; void setDevice(GraphicsDevicePtr device) noexcept; GraphicsDevicePtr getDevice() noexcept override; private: GL30DescriptorPool(const GL30DescriptorPool&) noexcept = delete; GL30DescriptorPool& operator=(const GL30DescriptorPool&) noexcept = delete; private: GraphicsDeviceWeakPtr _device; GraphicsDescriptorPoolDesc _descriptorPoolDesc; }; class GL30DescriptorSetLayout final : public GraphicsDescriptorSetLayout { OctoonDeclareSubClass(GL30DescriptorSetLayout, GraphicsDescriptorSetLayout) public: GL30DescriptorSetLayout() noexcept; ~GL30DescriptorSetLayout() noexcept; bool setup(const GraphicsDescriptorSetLayoutDesc& desc) noexcept; void close() noexcept; const GraphicsDescriptorSetLayoutDesc& getDescriptorSetLayoutDesc() const noexcept override; private: friend class GL30Device; void setDevice(GraphicsDevicePtr device) noexcept; GraphicsDevicePtr getDevice() noexcept override; private: GL30DescriptorSetLayout(const GL30DescriptorSetLayout&) noexcept = delete; GL30DescriptorSetLayout& operator=(const GL30DescriptorSetLayout&) noexcept = delete; private: GraphicsDeviceWeakPtr _device; GraphicsDescriptorSetLayoutDesc _descripotrSetLayoutDesc; }; class GL30DescriptorSet final : public GraphicsDescriptorSet { OctoonDeclareSubClass(GL30DescriptorSet, GraphicsDescriptorSet) public: GL30DescriptorSet() noexcept; ~GL30DescriptorSet() noexcept; bool setup(const GraphicsDescriptorSetDesc& desc) noexcept; void close() noexcept; void apply(const GL30Program& program) noexcept; void copy(std::uint32_t descriptorCopyCount, const GraphicsDescriptorSetPtr descriptorCopies[]) noexcept; const GraphicsUniformSets& getUniformSets() const noexcept override; const GraphicsDescriptorSetDesc& getDescriptorSetDesc() const noexcept override; private: friend class GL30Device; void setDevice(GraphicsDevicePtr device) noexcept; GraphicsDevicePtr getDevice() noexcept override; private: GL30DescriptorSet(const GL30DescriptorSet&) noexcept = delete; GL30DescriptorSet& operator=(const GL30DescriptorSet&) noexcept = delete; private: GraphicsUniformSets _activeUniformSets; GraphicsDeviceWeakPtr _device; GraphicsDescriptorSetDesc _descriptorSetDesc; }; } } #endif
[ "2221870259@qq.com" ]
2221870259@qq.com
6b83415f1f95ec56ca34c77d86b00a8e7d161254
ea847b0ea9485077d5f9a8ab737001d6234a93bc
/PushOn/branches/APP - Non Phonon Branch/preferences.cpp
ade2ad8495f945be9e4ed1726fb3348f34f68835
[]
no_license
mmcev106/maxmobility
d79386ad2b6aca9e34efaa182fa9afa76d0461f2
32220b22aadb40b6e212b4cdd53f54d5d9ab70c0
refs/heads/master
2021-01-20T09:41:30.796478
2012-02-29T00:27:39
2012-02-29T00:27:39
32,224,545
0
0
null
null
null
null
UTF-8
C++
false
false
813
cpp
#include "preferences.h" #include <QDebug> const QString Preferences::FILENAME = "Preferences.txt"; bool Preferences::gender = MALE; bool Preferences::measurementSystem = STANDARD; QextSerialPort* Preferences::serialPort = NULL; QApplication* Preferences::application = NULL; unsigned char Preferences::messageData[BEAGLE_BOARD_MESSAGE_LENGTH]; State Preferences::currentState; float Preferences::getCurrentSpeed(){ float speed = messageData[1]; speed /= 10; return speed; } void Preferences::setCurrentSpeed(float speed) { messageData[1] = (unsigned char) (speed * 10) ; } float Preferences::getCurrentGrade(){ float speed = messageData[2]; speed /= 10; return speed; } void Preferences::setCurrentGrade(float grade){ messageData[2] = (unsigned char) (grade * 10); }
[ "mark@fastmail.net@9db6a66f-09bd-6529-4fc0-e4370dc81027" ]
mark@fastmail.net@9db6a66f-09bd-6529-4fc0-e4370dc81027
4e6309a20d33b3f710ece8398cfb98026939199d
f68a9a6d3fee27391025817e49f8f329985f33ce
/SearchPath_QT/SearchPath/cthreadsearch.h
4a5238e39f73987ffaaf62ca5a39462e72eaa8aa
[]
no_license
owenliu-rdc/SearchPath
905e21cdfa3757f1d71e9438c804fb77efef710d
7442dff62d62564dd2e3fc9c3393ba84740c65a4
refs/heads/master
2023-04-01T19:17:30.567070
2014-09-23T02:46:35
2014-09-23T02:46:35
null
0
0
null
null
null
null
UTF-8
C++
false
false
359
h
#ifndef CTHREADSEARCH_H #define CTHREADSEARCH_H #include <QThread> #include <QMutex> class MainWindow; class CThreadSearch : public QThread { Q_OBJECT public: explicit CThreadSearch(QObject *parent = 0); ~CThreadSearch(); public: MainWindow *m_pMainWindow; QMutex m_Mutex; private: int m_Seed; void run(); }; #endif // CTHREADSEARCH_H
[ "yu.zhang.bit@gmail.com" ]
yu.zhang.bit@gmail.com
3548af35f68ccfbbf513374872b3df0c2b7cac77
ca9a8dac9adab9925fde6b99b8f7dc155312b984
/GranularTextureSynthesis/Source/Permutation.h
b6cfde2f3d21c129967968743eb22bcb895ca540
[]
no_license
rupschy/GranularTextureSynthesis
0e9cd71d0dc4c799d0004d4c85542fce709d6ef5
bd3b3a73869c3cf15df73d7da17a4fdb34462e46
refs/heads/main
2023-04-02T03:11:56.179546
2021-04-16T18:21:24
2021-04-16T18:21:24
342,366,410
2
1
null
null
null
null
UTF-8
C++
false
false
714
h
/* ============================================================================== Permutation.h Created: 29 Mar 2021 2:42:29pm Author: John Rupsch ============================================================================== */ #pragma once #include "AudioEffect.h" #include <JuceHeader.h> class Permutation { public: Permutation(); // sets parameters for use in later functions in/out of class void setParameters(int & grainSize, int & lenInN); int setPermutationSet(int permutationSet, float framesOut, float numInputFrames, int grainSize); protected: float framesOut; float numInputFrames; private: };
[ "john.rupsch@pop.belmont.edu" ]
john.rupsch@pop.belmont.edu
bccc5653181ab6976e370f5633fa68a7fefbbb53
11b679228b7f3fbb7521946adda9a4b3ba22aa3a
/ros/flytcore/include/core_api/IsAuthenticated.h
3ba43c7380aebb040fe0554527a0f67bb225a5d2
[]
no_license
IgorLebed/spiiran_drone
7f49513a2fa3f2dffd54e43990b76145db9ae542
d73221243cabcf89090e7311de5a18fa0faef10c
refs/heads/master
2020-05-02T19:45:15.132838
2020-03-20T08:18:08
2020-03-20T08:18:08
178,167,867
0
0
null
null
null
null
UTF-8
C++
false
false
2,782
h
// Generated by gencpp from file core_api/IsAuthenticated.msg // DO NOT EDIT! #ifndef CORE_API_MESSAGE_ISAUTHENTICATED_H #define CORE_API_MESSAGE_ISAUTHENTICATED_H #include <ros/service_traits.h> #include <core_api/IsAuthenticatedRequest.h> #include <core_api/IsAuthenticatedResponse.h> namespace core_api { struct IsAuthenticated { typedef IsAuthenticatedRequest Request; typedef IsAuthenticatedResponse Response; Request request; Response response; typedef Request RequestType; typedef Response ResponseType; }; // struct IsAuthenticated } // namespace core_api namespace ros { namespace service_traits { template<> struct MD5Sum< ::core_api::IsAuthenticated > { static const char* value() { return "d77d7c0327f89f653a29b046a4817b94"; } static const char* value(const ::core_api::IsAuthenticated&) { return value(); } }; template<> struct DataType< ::core_api::IsAuthenticated > { static const char* value() { return "core_api/IsAuthenticated"; } static const char* value(const ::core_api::IsAuthenticated&) { return value(); } }; // service_traits::MD5Sum< ::core_api::IsAuthenticatedRequest> should match // service_traits::MD5Sum< ::core_api::IsAuthenticated > template<> struct MD5Sum< ::core_api::IsAuthenticatedRequest> { static const char* value() { return MD5Sum< ::core_api::IsAuthenticated >::value(); } static const char* value(const ::core_api::IsAuthenticatedRequest&) { return value(); } }; // service_traits::DataType< ::core_api::IsAuthenticatedRequest> should match // service_traits::DataType< ::core_api::IsAuthenticated > template<> struct DataType< ::core_api::IsAuthenticatedRequest> { static const char* value() { return DataType< ::core_api::IsAuthenticated >::value(); } static const char* value(const ::core_api::IsAuthenticatedRequest&) { return value(); } }; // service_traits::MD5Sum< ::core_api::IsAuthenticatedResponse> should match // service_traits::MD5Sum< ::core_api::IsAuthenticated > template<> struct MD5Sum< ::core_api::IsAuthenticatedResponse> { static const char* value() { return MD5Sum< ::core_api::IsAuthenticated >::value(); } static const char* value(const ::core_api::IsAuthenticatedResponse&) { return value(); } }; // service_traits::DataType< ::core_api::IsAuthenticatedResponse> should match // service_traits::DataType< ::core_api::IsAuthenticated > template<> struct DataType< ::core_api::IsAuthenticatedResponse> { static const char* value() { return DataType< ::core_api::IsAuthenticated >::value(); } static const char* value(const ::core_api::IsAuthenticatedResponse&) { return value(); } }; } // namespace service_traits } // namespace ros #endif // CORE_API_MESSAGE_ISAUTHENTICATED_H
[ "hazz808@gmail.com" ]
hazz808@gmail.com
91cde1f72c32afdb6fcada29ad3a8bc342e83f4c
dc8abb81705a42e4b47ae09635610deb44fb8243
/Arduino/sketchbook/libraries/ros_lib/stdr_msgs/CO2SourceVector.h
3bb76f235e509b29be0e50bbc8bb3378f322779b
[]
no_license
FWachter/LIT
719a1d36212bf3bdce05667a7b1151c62760e2c7
a6393682afa1f1e6f5b93b5d6cec6aee6c801a33
refs/heads/master
2020-12-31T05:55:33.015273
2017-11-30T03:10:38
2017-11-30T03:10:38
59,099,249
0
0
null
2017-11-30T03:10:38
2016-05-18T09:01:02
C++
UTF-8
C++
false
false
2,195
h
#ifndef _ROS_stdr_msgs_CO2SourceVector_h #define _ROS_stdr_msgs_CO2SourceVector_h #include <stdint.h> #include <string.h> #include <stdlib.h> #include "ros/msg.h" #include "stdr_msgs/CO2Source.h" namespace stdr_msgs { class CO2SourceVector : public ros::Msg { public: uint32_t co2_sources_length; stdr_msgs::CO2Source st_co2_sources; stdr_msgs::CO2Source * co2_sources; CO2SourceVector(): co2_sources_length(0), co2_sources(NULL) { } virtual int serialize(unsigned char *outbuffer) const { int offset = 0; *(outbuffer + offset + 0) = (this->co2_sources_length >> (8 * 0)) & 0xFF; *(outbuffer + offset + 1) = (this->co2_sources_length >> (8 * 1)) & 0xFF; *(outbuffer + offset + 2) = (this->co2_sources_length >> (8 * 2)) & 0xFF; *(outbuffer + offset + 3) = (this->co2_sources_length >> (8 * 3)) & 0xFF; offset += sizeof(this->co2_sources_length); for( uint32_t i = 0; i < co2_sources_length; i++){ offset += this->co2_sources[i].serialize(outbuffer + offset); } return offset; } virtual int deserialize(unsigned char *inbuffer) { int offset = 0; uint32_t co2_sources_lengthT = ((uint32_t) (*(inbuffer + offset))); co2_sources_lengthT |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); co2_sources_lengthT |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); co2_sources_lengthT |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); offset += sizeof(this->co2_sources_length); if(co2_sources_lengthT > co2_sources_length) this->co2_sources = (stdr_msgs::CO2Source*)realloc(this->co2_sources, co2_sources_lengthT * sizeof(stdr_msgs::CO2Source)); co2_sources_length = co2_sources_lengthT; for( uint32_t i = 0; i < co2_sources_length; i++){ offset += this->st_co2_sources.deserialize(inbuffer + offset); memcpy( &(this->co2_sources[i]), &(this->st_co2_sources), sizeof(stdr_msgs::CO2Source)); } return offset; } const char * getType(){ return "stdr_msgs/CO2SourceVector"; }; const char * getMD5(){ return "5ded45505bc7155e81a2d6033817c7f3"; }; }; } #endif
[ "wachterfreddy@gmail.com" ]
wachterfreddy@gmail.com
07ec9dbb0c3808626c1d937662183277ac45a3be
e6e69e8d6794f409398af2cefed7092fed4691ca
/计算机与软件学院/面向对象程序设计(荣誉)/大作业1/沈晨玙 大作业1.cpp
641dd205042dc9c07c3b472a34fcd0bd9de5ca09
[]
no_license
LKHUUU/SZU_Learning_Resource
1faca5fcaf0431adb64da031dde4fe47abcdc6ba
88f121f275a57fc48f395bb73377e6f6e22d7529
refs/heads/main
2023-08-30T06:31:24.414351
2021-10-22T13:53:40
2021-10-22T13:53:40
null
0
0
null
null
null
null
GB18030
C++
false
false
17,993
cpp
#include<fstream> #include<iostream> #include<string> #include<vector> #include<algorithm> using namespace std; struct Problem2 { string problemID; //记录是第几份提交的代码 int submitNum; void operator=(Problem2& p2) { problemID = p2.problemID; submitNum = p2.submitNum; } }; class Student { public: //同学学号 string studentID; //该同学正确题号集合(含多次提交) vector<string> correctProblemID; //该同学错误题号集合(含多次提交) vector<string> wrongProblemID; vector<Problem2> correctProblemID2; vector<Problem2> wrongProblemID2; int problemNum; //根据信息行,将同学每题信息填入 Student(string studentID, string problemID, string correctORwrong) { this->studentID = studentID; Problem2 temp{ problemID,getProblemNum() + 1 }; if (correctORwrong == "正确") correctProblemID2.push_back(temp); else wrongProblemID2.push_back(temp); if (correctORwrong == "正确") correctProblemID.push_back(studentID); else wrongProblemID.push_back(studentID); } //添加学生回答信息 void addProblem(string problemID, string correctORwrong) { Problem2 temp{ problemID,getProblemNum() }; if (correctORwrong == "正确") correctProblemID2.push_back(temp); else wrongProblemID2.push_back(temp); } //返回该学生总答题数 int getProblemNum() { return correctProblemID2.size() + wrongProblemID2.size(); } //返回某一题号提交过几次 int sameProblemNum(string id) { int sum = 0; for_each(begin(correctProblemID2), end(correctProblemID2), [id, &sum](Problem2 a) {if (a.problemID == id) sum++; }); for_each(begin(wrongProblemID2), end(wrongProblemID2), [id, &sum](Problem2 a) {if (a.problemID == id) sum++; }); return sum; } }; class Problem { public: string problemID; //该题目答对同学ID集合(含多次提交) vector<string> correctStudentID; //该题目答错同学ID集合(含多次提交) vector<string> wrongStudentID; //根据信息行,将题目对应信息填入 Problem(string studentID, string problemID, string correctORwrong) { this->problemID = problemID; if (correctORwrong == "正确") correctStudentID.push_back(studentID); else wrongStudentID.push_back(studentID); } //添加该题对应的学生信息 void addStudent(string studentID, string correctORwrong) { if (correctORwrong == "正确") correctStudentID.push_back(studentID); else wrongStudentID.push_back(studentID); } //返回回答该题的学生人数 int getStudentNum() { return correctStudentID.size() + wrongStudentID.size(); } }; //储存所有同学的信息 vector<Student> studentVec; //储存所有题目的信息 vector<Problem> problemVec; //正在拆分文件的文件名 string FileBeingSplit; //总文件数量 int FileSum = 0; void Menu1() { cout << "------------------------------------" << endl; cout << "1.拆分文件 " << endl; cout << "2.统计数据 " << endl; cout << "3.作弊检查 " << endl; cout << "4.退出程序 " << endl; cout << "请输入1/2/3/4,选择功能 " << endl; cout << "------------------------------------" << endl; } void Menu2() { cout << "------------------------------------" << endl; cout << "1.整体统计结果 " << endl; cout << "2.学生信息查询 " << endl; cout << "3.题目信息查询 " << endl; cout << "4.返回上级页面 " << endl; cout << "请输入1/2/3/4,选择功能 " << endl; cout << "------------------------------------" << endl; } void SplitFiles() { ofstream ofs; ifstream ifs; string filename; string str; string openFileName; string targetFolder; studentVec.clear(); problemVec.clear(); FileSum = 0; system("CLS"); cout << "------------------------------------" << endl; cout << "请输入你需要拆分并分析的文件名: " << endl; cout << "注:1.文件名举例:logs-1005.txt " << endl; cout << " 2.确保待拆分文件在同一文件夹下 " << endl; cout << " 3.测试时对于文件夹目录的选择,请修改原码(因为不会写)" << endl; cout << " 4.txt文件编码格式为ANSI(防止出现乱码)" << endl; cout << "------------------------------------" << endl; cin >> openFileName; FileBeingSplit = openFileName; int filenum = 0; int linenum = -1; //linenum标记该文件有几行 若文件结束设置为-1; ifs.open(openFileName, ios::in); //检查文件是否打开失败 if (ifs.is_open() == 0) { cout << "待拆分文件不存在" << endl; system("pause"); return; } cout << "正在拆分文件。。。" << endl; while (getline(ifs, str)) { //linenum为-1说明上一个文件结束,需要重新命名文件 //第一行为每一份代码的信息 if (linenum == -1) { FileSum++; string studentID = str.substr(0, str.find(":")); string problemID = str.substr(str.find("m") + 1, 4); //correctORwrong---正确/错误 string correctORwrong = str.substr(str.find("m") + 6, 4); vector<Student>::iterator it = find_if(studentVec.begin(), studentVec.end(), [studentID](Student s) ->bool {return s.studentID == studentID; }); //未创建学生 if (it == studentVec.end()) { Student temp(studentID, problemID, correctORwrong); studentVec.push_back(temp); } //已创建学生 else { it->addProblem(problemID, correctORwrong); } vector<Problem>::iterator it2 = find_if(problemVec.begin(), problemVec.end(), [problemID](Problem s) ->bool {return s.problemID == problemID; }); //未创建问题 if (it2 == problemVec.end()) { Problem temp2(studentID, problemID, correctORwrong); problemVec.push_back(temp2); } //已创建问题 else { it2->addStudent(studentID, correctORwrong); } it = find_if(studentVec.begin(), studentVec.end(), [studentID](Student s) ->bool {return s.studentID == studentID; }); int num = it->sameProblemNum(problemID); filename = "E:\\大学\\课程\\面向对象程序设计(荣誉)\\大作业1\\素材1\\" + studentID + "_" + problemID + "_" + to_string(num) + ".cpp"; linenum = 1; ofs.open(filename, ios::out); } if (str == "------------------------------------------------------") { linenum = -1; //说明当前文件结束 ofs.close(); } else { ofs << str << endl; linenum++; } } ifs.close(); //整理收集到的信息,并进行排序 //按照学生ID大小从小到大 sort(studentVec.begin(), studentVec.end(), [](Student a, Student b)->bool {return a.studentID < b.studentID; }); //按照题目ID大小从小到大 sort(problemVec.begin(), problemVec.end(), [](Problem a, Problem b)->bool {return a.problemID < b.problemID; }); cout << "文件拆分完毕。" << endl; system("pause"); return; } void overallData() { system("CLS"); cout << "当前正在分析的文件的是:" << FileBeingSplit << endl; cout << "------------------------------------" << endl; cout << "1.总文件数:" << FileSum << endl; cout << "2.总题目数:" << problemVec.size() << endl; cout << "3.总学生数:" << studentVec.size() << endl; cout << "------------------------------------" << endl; system("pause"); return; } void studentData() { system("CLS"); cout << "当前正在分析的文件的是:" << FileBeingSplit << endl; cout << "------------------------------------" << endl; cout << "是否显示本次参与实验的同学ID?" << endl; cout << "1:是 2:否" << endl; cout << "------------------------------------" << endl; int n; cin >> n; if (n == 1) { cout << "------------------------------------" << endl; cout << "参与实验的同学ID如下:" << endl; for_each(studentVec.begin(), studentVec.end(), [](Student s) {cout << s.studentID << endl; }); cout << "------------------------------------" << endl; } cout << "------------------------------------" << endl; cout << "请输入你要查询的同学的ID:(输入-1退出查询)" << endl; cout << "------------------------------------" << endl; string id; cin >> id; while (id != "-1") { //在studentvec中寻找学生id相同对象,it指向Student对象 auto it = find_if(studentVec.begin(), studentVec.end(), [id](Student s)->bool {return s.studentID == id; }); if (it == studentVec.end()) { cout << "未找到该学生" << endl; } else { cout << "------------------------------------" << endl; cout << it->studentID << "同学总共提交" << it->getProblemNum() << "次。" << endl; cout << "其中正确次数:" << it->correctProblemID2.size() << endl; cout << " 错误次数:" << it->wrongProblemID2.size() << endl; cout << "------------------------------------" << endl; } cout << "------------------------------------" << endl; cout << "请输入你要查询的同学的ID:(输入-1退出查询)" << endl; cout << "------------------------------------" << endl; cin >> id; } } void problemData() { system("CLS"); cout << "当前正在分析的文件的是:" << FileBeingSplit << endl; cout << "------------------------------------" << endl; cout << "是否显示本次所有题目ID?" << endl; cout << "1:是 2:否" << endl; cout << "------------------------------------" << endl; int n; cin >> n; if (n == 1) { cout << "------------------------------------" << endl; cout << "本次所有题目ID如下:" << endl; for_each(problemVec.begin(), problemVec.end(), [](Problem p) {cout << p.problemID << endl; }); cout << "------------------------------------" << endl; } cout << "------------------------------------" << endl; cout << "请输入你要查询的题目的ID:(输入-1退出查询)" << endl; cout << "------------------------------------" << endl; string id; cin >> id; //Copy1包含所有答对该题的同学的ID(不重复) vector<string> Copy1; //Copy2包含所有参与考试的同学的ID(不重复) vector<string> Copy2; //Temp包含Copy2-Copy1的同学ID(即答错或未答题) vector<string> Temp; //直到输入id=-1结束 while (id != "-1") { Copy1.clear(); Copy2.clear(); Temp.clear(); ////在problemvec中寻找学生id相同对象,it指向Problem对象 auto it = find_if(problemVec.begin(), problemVec.end(), [id](Problem p)->bool {return p.problemID == id; }); if (it == problemVec.end()) { cout << "未找到该题目" << endl; } else { Copy1.resize(it->correctStudentID.size()); //Copy1初始化 copy(it->correctStudentID.begin(), it->correctStudentID.end(), Copy1.begin()); //排序 sort(Copy1.begin(), Copy1.end()); //删除重复的值 Copy1.erase(unique(Copy1.begin(), Copy1.end()), Copy1.end()); //Copy2初始化 for_each(studentVec.begin(), studentVec.end(), [&Copy2](Student s) {Copy2.push_back(s.studentID); }); //Copy3初始化 set_symmetric_difference(begin(Copy1), end(Copy1), begin(Copy2), end(Copy2), back_inserter(Temp)); cout << "------------------------------------" << endl; cout << "题号"<<it->problemID << "总共提交" << it->getStudentNum() << "人次。" << endl; cout << "其中正确次数:" << it->correctStudentID.size() << endl; cout << " 错误次数:" << it->wrongStudentID.size() << endl << endl; cout << "答对同学ID:" << endl; if (Copy1.size() == 0) cout <<" "<< "无" << endl; for (auto it2 = Copy1.begin(); it2 != Copy1.end(); it2++) cout << " " << *it2 << endl; cout << "答错或未提交答案同学ID:" << endl; if (Temp.size() == 0) cout << " " << "无" << endl; for (auto it2 = Temp.begin(); it2 != Temp.end(); it2++) cout << " " << *it2 << endl; cout << "------------------------------------" << endl; } cout << "------------------------------------" << endl; cout << "请输入你要查询的题目的ID:(输入-1退出查询)" << endl; cout << "------------------------------------" << endl; cin >> id; } } void wrongInput() { cout << "输入错误请重新输入。" << endl; system("pause"); return; } void calData() { //如果当前无文件被拆分 if (studentVec.size() == 0 || problemVec.size() == 0) { cout << "------------------------------------" << endl; cout << "尚未拆分文件,操作失败" << endl; cout << "------------------------------------" << endl; system("pause"); return; } //分析当前正在拆分文件 int opt; while (true) { system("CLS"); cout << "当前正在分析的文件的是:" << FileBeingSplit << endl; Menu2(); cin >> opt; switch (opt) { case 1:overallData(); break; case 2:studentData(); break; case 3:problemData(); break; case 4:return; break; default:wrongInput(); break; } } } int checkFile(string toBeOpenFileName1, string toBeOpenFileName2, string name1, string name2, string toBeCheckID) { ifstream ifs1, ifs2; string trash, str1, str2; //check=0,不同;check=1 完全相同 int check = 0; ifs1.open(toBeOpenFileName1, ios::in); ifs2.open(toBeOpenFileName2, ios::in); //第一行为信息行,无效信息 getline(ifs1, trash); getline(ifs2, trash); while (!ifs1.eof() && !ifs2.eof()) { //第二行开始为代码区域 getline(ifs1, str1); getline(ifs2, str2); if (str1 == str2) check = 1; else { check = 0; break; } } if (check == 0) return 0; else if (check == 1) { cout << name1 << "与" << name2 << "的题目" << toBeCheckID << "完全相同" << endl; return 1; } ifs1.close(); ifs2.close(); return 0; } void checkCheat() { //如果当前无文件被拆分 if (studentVec.size() == 0 || problemVec.size() == 0) { cout << "------------------------------------" << endl; cout << "尚未拆分文件,操作失败" << endl; cout << "------------------------------------" << endl; system("pause"); return; } system("CLS"); cout << "当前正在分析的文件的是:" << FileBeingSplit << endl; cout << "------------------------------------" << endl; cout << "是否显示本次所有题目ID?" << endl; cout << "1:是 2:否" << endl; cout << "------------------------------------" << endl; int n; cin >> n; if (n == 1) { cout << "------------------------------------" << endl; cout << "本次所有题目ID如下:" << endl; for_each(problemVec.begin(), problemVec.end(), [](Problem p) {cout << p.problemID << endl; }); cout << "------------------------------------" << endl; } cout << "------------------------------------" << endl; cout << "请输入你需要进行作弊检查的题目ID:(输入-1退出查询)" << endl; cout << "------------------------------------" << endl; string toBeCheckID; cin >> toBeCheckID; while (toBeCheckID != "-1") { //在problemvec中寻找学生id相同对象,it指向Problem对象 ////只要有一对人作弊,ifCheat=1 int ifCheat = 0; auto it = find_if(problemVec.begin(), problemVec.end(), [toBeCheckID](Problem p)->bool {return p.problemID == toBeCheckID; }); if (it == problemVec.end()) { cout << "未找到该题目" << endl; } else { string toBeOpenFileName1, toBeOpenFileName2; string name1, name2; int submitTime1,submitTime2; //Copy1包含所有答对该题的同学的ID(不重复) vector<string> Copy1; Copy1.resize(it->correctStudentID.size()); //Copy1初始化 copy(it->correctStudentID.begin(), it->correctStudentID.end(), Copy1.begin()); //排序 sort(Copy1.begin(), Copy1.end()); //删除重复的值 Copy1.erase(unique(Copy1.begin(), Copy1.end()), Copy1.end()); cout << "------------------------------------" << endl; cout << "正在进行作弊对比分析。。。" << endl; for (auto check1 = Copy1.begin(); check1 != Copy1.end() - 1; check1++) { auto check2 = check1 + 1; while (check2 != Copy1.end()) { name1 = *check1; name2 = *check2; //跳过助教、老师的代码 if (name1 == "szuzy" || name1 == "zj07" || name2 == "szuzy" || name2 == "zj07") { check2++; continue; } //在studentvec中寻找学生id相同对象,it指向Student对象 auto checkIT1 = find_if(studentVec.begin(), studentVec.end(), [name1](Student s)->bool {return s.studentID == name1; }); submitTime1 = checkIT1->sameProblemNum(toBeCheckID); //在studentvec中寻找学生id相同对象,it指向Student对象 auto checkIT2 = find_if(studentVec.begin(), studentVec.end(), [name2](Student s)->bool {return s.studentID == name2; }); submitTime2 = checkIT2->sameProblemNum(toBeCheckID); toBeOpenFileName1 = "E:\\大学\\课程\\面向对象程序设计(荣誉)\\大作业1\\素材1\\" + name1 + "_" + toBeCheckID + "_" + to_string(submitTime1) + ".cpp"; toBeOpenFileName2 = "E:\\大学\\课程\\面向对象程序设计(荣誉)\\大作业1\\素材1\\" + name2 + "_" + toBeCheckID + "_" + to_string(submitTime2) + ".cpp"; int temp = checkFile(toBeOpenFileName1, toBeOpenFileName2, name1, name2, toBeCheckID); //只要有一对人作弊,ifCheat=1 if (temp == 1) ifCheat = 1; //对比下一位 check2++; } } if (ifCheat != 1) cout << "此题没有人作弊。" << endl; cout << "作弊对比分析完成" << endl; cout << "------------------------------------" << endl; } cout << "------------------------------------" << endl; cout << "请输入你要查询的题目的ID:(输入-1退出查询)" << endl; cout << "------------------------------------" << endl; cin >> toBeCheckID; } } void exitProgram() { cout << "感谢使用!" << endl; exit(-1); } int main() { while (true) { system("CLS"); Menu1(); int opt; cin >> opt; switch (opt) { case 1:SplitFiles(); break; case 2:calData(); break; case 3:checkCheat(); break; case 4:exitProgram(); break; default: wrongInput(); break; } } }
[ "939826879@qq.com" ]
939826879@qq.com
bd10a2677bc385c72a7ef791d56dc7f778fef85e
72e59a47eb012891b84b10f9b1bd738f02aa5a9a
/esercizi consigliati/esercizi_consigliati_array.cc
9e6a1e6ba6a92767fed687f9096f79adcb6dffa0
[]
no_license
Leonelli/C-plus-plus-works
8a366f9716284ef804de5c707c5a0904afb217a7
f4a9971b5391d5864ffcf208a2845c4a224969fe
refs/heads/master
2020-03-29T17:22:53.737281
2019-02-13T16:50:48
2019-02-13T16:50:48
150,159,156
1
0
null
null
null
null
UTF-8
C++
false
false
2,128
cc
/* 1) scrivere una funzione che prenda come parametri 2 array di double della stessa dimensione e ne calcoli il prodotto scalare. 2) scrivere una procedura che calcoli la norma di un vettore di double (la radice quadrata del prodotto scalare con se' stesso). 3) scrivere una procedura che normalizzi un vettore, cio'che sostituisca un vettore con quallo risultante dalla divisione di tutti i suoi elementi per la nua norma. 4) scrivere una funzione che dica se due vettori della stessa dimensione sono ortogonali (due vettori sono ortogonali se il loro prodotto scalare e' nullo). 5) scrivere una procedura che prende in ingresso un vettore v e la sua dimensione d, un nuovo elemento x e un indice i, e aggiunga l'elemento x in posizione i nel vettore, e incrementi d di uno. Il vettore passato deve avere almeno d+1 elementi. Esempio: v = [4 1 3 6 8] d = 5 x = 7 i = 2 ===> v = [4 1 7 3 6 8] d = 6 6) scrivere una procedura che prende in ingresso un vettore ORDINATO v, la sua dimensione d, e un nuovo elemento x, e inserisca x nel vettore in modo ordinato. Il vettore passato deve avere almeno d+1 elementi. Esempio: v = [1 3 4 6 8] d = 5 x = 7 ===> v = [1 3 4 6 7 8] d = 6 7) scrivere una procedura che prenda un vettore v e la sua dimensione d, un elemento x, ed elimina tutte le occorrenze di x (dimnuemdo la dimensione d del vettore) Esempio: v = [4 1 3 6 8 4 2] d = 7 x = 4 ===> v = [1 3 6 8 2] d = 5 8) scrivere una procedura che prende in ingresso due vettori ORDINATI v1 e v2 di dimensione d1 e d2 e restituisce un vettore ORDINATO v di dimensione d1+d2 che contiene tutti gli elementi che stanno in v1 e v2. Esempio: v1=[2 4 6 8], d1 = 4 v2=[1 2 5 7 8], d1 = 5 ==> v3=[1 2 2 4 5 6 7 8 8] */ using namespace std; #include <iostream> #include <cmath> int scalare(int[],int[]); int dim=4; int main(){ //cout << "Dimmi la dimensione: "; //cin >> dim; int vettore1 [dim] = {1,2,3,4}; int vettore2 [dim] = {1,2,3,4}; cout << scalare(vettore1,vettore2)<<endl; return 0; } int scalare(int v1[],int v2[]){ int res = 0; for (int i = 0; i < dim; i++) { res+=v1[i]*v2[i]; } return res; }
[ "matteoleonelli99@gmail.com" ]
matteoleonelli99@gmail.com
72b8da7bdd6211158e4404e29c9197bf9eaec5be
f0a26ec6b779e86a62deaf3f405b7a83868bc743
/Engine/Source/Editor/BehaviorTreeEditor/Private/BehaviorTreeDecoratorGraphNode.cpp
64d78e5e096fab21baa6eaaa5f022530fc36da1b
[]
no_license
Tigrouzen/UnrealEngine-4
0f15a56176439aef787b29d7c80e13bfe5c89237
f81fe535e53ac69602bb62c5857bcdd6e9a245ed
refs/heads/master
2021-01-15T13:29:57.883294
2014-03-20T15:12:46
2014-03-20T15:12:46
18,375,899
1
0
null
null
null
null
UTF-8
C++
false
false
2,190
cpp
// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved. #include "BehaviorTreeEditorPrivatePCH.h" UBehaviorTreeDecoratorGraphNode::UBehaviorTreeDecoratorGraphNode(const class FPostConstructInitializeProperties& PCIP) : Super(PCIP) { bAllowModifingInputs = true; } UEdGraphPin* UBehaviorTreeDecoratorGraphNode::GetInputPin(int32 InputIndex) const { check(InputIndex >= 0); for (int32 PinIndex = 0, FoundInputs = 0; PinIndex < Pins.Num(); PinIndex++) { if (Pins[PinIndex]->Direction == EGPD_Input) { if (InputIndex == FoundInputs) { return Pins[PinIndex]; } else { FoundInputs++; } } } return NULL; } UEdGraphPin* UBehaviorTreeDecoratorGraphNode::GetOutputPin(int32 InputIndex) const { check(InputIndex >= 0); for (int32 PinIndex = 0, FoundInputs = 0; PinIndex < Pins.Num(); PinIndex++) { if (Pins[PinIndex]->Direction == EGPD_Output) { if (InputIndex == FoundInputs) { return Pins[PinIndex]; } else { FoundInputs++; } } } return NULL; } UBehaviorTreeDecoratorGraph* UBehaviorTreeDecoratorGraphNode::GetDecoratorGraph() { return CastChecked<UBehaviorTreeDecoratorGraph>(GetGraph()); } EBTDecoratorLogic::Type UBehaviorTreeDecoratorGraphNode::GetOperationType() const { return EBTDecoratorLogic::Invalid; } void UBehaviorTreeDecoratorGraphNode::AutowireNewNode(UEdGraphPin* FromPin) { Super::AutowireNewNode(FromPin); if (FromPin != NULL) { if (GetSchema()->TryCreateConnection(FromPin, FromPin->Direction == EGPD_Input ? GetOutputPin() : GetInputPin())) { FromPin->GetOwningNode()->NodeConnectionListChanged(); } } } void UBehaviorTreeDecoratorGraphNode::NodeConnectionListChanged() { const UBehaviorTreeDecoratorGraph* MyGraph = CastChecked<UBehaviorTreeDecoratorGraph>(GetGraph()); UBehaviorTreeGraphNode_CompositeDecorator* CompositeDecorator = Cast<UBehaviorTreeGraphNode_CompositeDecorator>(MyGraph->GetOuter()); CompositeDecorator->OnInnerGraphChanged(); } bool UBehaviorTreeDecoratorGraphNode::CanCreateUnderSpecifiedSchema(const UEdGraphSchema* DesiredSchema) const { return DesiredSchema->GetClass()->IsChildOf(UEdGraphSchema_BehaviorTreeDecorator::StaticClass()); }
[ "michaellam430@gmail.com" ]
michaellam430@gmail.com
d5ced8ec4470edb59e0f0bcd404df4d1ff4dac7c
0b23767f76fa5286eda0aacc8f9a77e497d494b2
/solar_system.hpp
729951fd94d8f7f7f28e7e9e89aa775ab97db06d
[]
no_license
wjiang14/solar_system
4014326f3743721a1c7f5548d365e57475d18c7b
3b8b810bac0c9aaab8b9556af33c0feb2d516972
refs/heads/master
2020-07-03T14:26:02.583336
2017-01-10T19:32:16
2017-01-10T19:32:16
74,161,509
0
0
null
null
null
null
UTF-8
C++
false
false
416
hpp
// // Created by wei on 11/18/16. // #include <GLUT/glut.h> #include "Star.hpp" #define STAR_NUM 10 class SolarSystem { public: SolarSystem(); ~SolarSystem(); void onDisplay(); void onUpdate(); void onKeyboard(unsigned char key, int x, int y); private: Star* stars[STAR_NUM]; // perspective para GLdouble viewX, viewY, viewZ; GLdouble centerX, centerY, centerZ; GLdouble upX, upY, upZ; };
[ "jwjovi@gmail.com" ]
jwjovi@gmail.com
27cfcbb1e999e2b59a07bd1b3cec0c6b4e59d297
90a57c66c6bc9b92cd11163681f1a1eeb023fba0
/cpp-step-by-step-project/step09/AccountHandler.cpp
4f4897c981f91eb542a64089ec4d515c72faa18d
[]
no_license
devsophia/language-c-cpp-practice
9013e9c65e2824bd34198f37a02719d4b1561a21
3b0b32f1e73c3a66d7dc2b2a91c366096ae59bff
refs/heads/master
2020-03-25T17:58:35.961385
2019-02-04T14:34:22
2019-02-04T14:34:22
144,006,474
0
0
null
null
null
null
UTF-8
C++
false
false
3,106
cpp
/* * File Name : AccountHandler.cpp * Version : 0.8 * Update Date : 2019.01.27 */ #include <BankingCommonDecl.h> #include <AccountHandler.h> #include <Account.h> #include <NormalAccount.h> #include <HighCreditAccount.h> AccountHandler::AccountHandler() : num(0) {} void AccountHandler::makeAccount() { ACCOUNT_PTR pAccount; int kindOfAcc = 0; int address; char name[15]; double balance; double intRatio; char grade; cout << "[계좌종류선택]" << endl; cout << "1. 보통예금계좌 2. 신용신뢰계좌" << endl; cout << "선택 : "; cin >> kindOfAcc; switch(kindOfAcc) { case 1: cout << "[보통예금계좌 개설]" << endl; break; case 2: cout << "[신용신뢰계좌 개설]" << endl; break; default: cout << "1, 2중에서 선택해 주세요." << endl; return; } cout << "계좌주소 : "; cin >> address; cout << "성함 : "; cin >> name; cout << "입금액 : "; cin >> balance; cout << "이자율 : "; cin >> intRatio; if(kindOfAcc == 2) { cout << "고객등급 : "; cin >> grade; } switch(kindOfAcc) { case 1: pAccount = new NormalAccount(address, name, balance, intRatio); break; case 2: pAccount = new HighCreditAccount(address, name, balance, intRatio, grade); break; default: break; } this->arr[this->num++] = pAccount; } void AccountHandler::deposit() const { int address; double balance; cout << "입금계좌주소 : "; cin >> address; int i; for(i = 0; i < this->num && !(this->arr[i]->getAddress() == address); i++); if(i == this->num) { cout << "찾으시는 계좌가 없습니다. 다시 시도해 주세요." << endl; return; } cout << "입금금액 : "; cin >> balance; if(this->arr[i]->addBalance(balance)) cout << this->arr[i]->getName() << " 에게 " << balance << " 원 입금 완료 !" << endl; } void AccountHandler::withdrawal() const { int address; double balance; cout << "출금계좌주소 : "; cin >> address; int i; for(i = 0; i < this->num && !(this->arr[i]->getAddress() == address); i++); if(i == this->num) { cout << "찾으시는 계좌가 없습니다. 다시 시도해 주세요." << endl; return; } cout << "출금금액 : "; cin >> balance; if(this->arr[i]->addBalance(-balance)) cout << this->arr[i]->getName() << " 계좌에서 " << balance << " 원 출금 완료 !" << endl; } void AccountHandler::allPrint() const { cout << "**전체 계좌정보 출력**" << endl; for(int i=0; i < this->num; i++) { cout << "-" << i+1 << "번째 고객정보" << endl; this->arr[i]->showInfo(); } } void AccountHandler::showMenu() { cout << "\n"; cout << "**MENU**" << endl; cout << "1. 계좌 개설" << endl; cout << "2. 입금" << endl; cout << "3. 출금" << endl; cout << "4. 계좌정보 전체 출력" << endl; cout << "5. 프로그램 종료" << endl; }
[ "changmin.developer@gmail.com" ]
changmin.developer@gmail.com
dd14bf9034ed5f6db276a0a69c70a15829113747
773357b475f59bbdde3a2de632638fef976e330a
/src/ScenarioLoader.cpp
c53764d680b93aafd74d0571fb8e7a6e7011c065
[ "MIT" ]
permissive
q4a/GLKeeper
568544cc86a88536f104f7f38d6e018a62e47510
a2207e2a459a254cbc703306ef92a09ecf714090
refs/heads/master
2022-11-25T08:32:44.100454
2020-06-26T11:36:25
2020-06-26T11:36:25
null
0
0
null
null
null
null
UTF-8
C++
false
false
59,977
cpp
#include "pch.h" #include "ScenarioLoader.h" #include "Console.h" #include "FileSystem.h" #define DIVIDER_FLOAT 4096.0f #define DIVIDER_DOUBLE 65536.0f #define READ_FSTREAM_DATATYPE(filestream, destination, datatype) \ { \ datatype dataBuffer; \ long bytesRead = filestream->ReadData(&dataBuffer, sizeof(datatype)); \ if (bytesRead != sizeof(datatype)) \ { \ return false; \ } \ destination = static_cast<std::remove_reference<decltype(destination)>::type>(dataBuffer); \ } #define SKIP_FSTREAM_BYTES(filestream, numBytes) \ { \ if (!filestream->AdvanceCursorPosition(numBytes)) \ { \ return false; \ } \ } #define READ_FSTREAM_UINT8(filestream, destination) \ READ_FSTREAM_DATATYPE(filestream, destination, unsigned char) #define READ_FSTREAM_UINT16(filestream, destination) \ READ_FSTREAM_DATATYPE(filestream, destination, unsigned short) #define READ_FSTREAM_UINT32(filestream, destination) \ READ_FSTREAM_DATATYPE(filestream, destination, unsigned int) // ArtResource flags enum { ARTRESF_PLAYER_COLOURED = (0x000002UL), ARTRESF_ANIMATING_TEXTURE = (0x000004UL), ARTRESF_HAS_START_ANIMATION = (0x000008UL), ARTRESF_HAS_END_ANIMATION = (0x000010UL), ARTRESF_RANDOM_START_FRAME = (0x000020UL), ARTRESF_ORIGIN_AT_BOTTOM = (0x000040UL), ARTRESF_DOESNT_LOOP = (0x000080UL), ARTRESF_FLAT = (0x000100UL), ARTRESF_DOESNT_USE_PROGRESSIVE_MESH = (0x000200UL), ARTRESF_USE_ANIMATING_TEXTURE_FOR_SELECTION = (0x010000UL), ARTRESF_PRELOAD = (0x020000UL), ARTRESF_BLOOD = (0x040000UL) }; enum { TERRAINF_SOLID = (0x00000001UL), TERRAINF_IMPENETRABLE = (0x00000002UL), TERRAINF_OWNABLE = (0x00000004UL), TERRAINF_TAGGABLE = (0x00000008UL), TERRAINF_ATTACKABLE = (0x00000020UL), TERRAINF_TORCH = (0x00000040UL), // has torch? TERRAINF_WATER = (0x00000080UL), TERRAINF_LAVA = (0x00000100UL), TERRAINF_ALWAYS_EXPLORED = (0x00000200UL), // doesnt used TERRAINF_PLAYER_COLOURED_PATH = (0x00000400UL), TERRAINF_PLAYER_COLOURED_WALL = (0x00000800UL), TERRAINF_CONSTRUCTION_TYPE_WATER = (0x00001000UL), TERRAINF_CONSTRUCTION_TYPE_QUAD = (0x00002000UL), TERRAINF_UNEXPLORE_IF_DUG_BY_ANOTHER_PLAYER = (0x00004000UL), // doesnt used TERRAINF_FILL_INABLE = (0x00008000UL), TERRAINF_ALLOW_ROOM_WALLS = (0x00010000UL), TERRAINF_DECAY = (0x00020000UL), TERRAINF_RANDOM_TEXTURE = (0x00040000UL), TERRAINF_TERRAIN_COLOR_R = (0x00080000UL), // expands R channel of lightColor TERRAINF_TERRAIN_COLOR_G = (0x00100000UL), // expands G channel of lightColor TERRAINF_TERRAIN_COLOR_B = (0x00200000UL), // expands B channel of lightColor TERRAINF_DWARF_CAN_DIG_THROUGH = (0x00800000UL), TERRAINF_REVEAL_THROUGH_FOG_OF_WAR = (0x01000000UL), TERRAINF_AMBIENT_COLOR_R = (0x02000000UL), // expands R channel of ambientLight TERRAINF_AMBIENT_COLOR_G = (0x04000000UL), // expands G channel of ambientLight TERRAINF_AMBIENT_COLOR_B = (0x08000000UL), // expands B channel of ambientLight TERRAINF_LIGHT = (0x10000000UL), TERRAINF_AMBIENT_LIGHT = (0x20000000UL), }; enum { ROOMF_PLACEABLE_ON_WATER = (0x0001UL), ROOMF_PLACEABLE_ON_LAVA = (0x0002UL), ROOMF_PLACEABLE_ON_LAND = (0x0004UL), ROOMF_HAS_WALLS = (0x0008UL), ROOMF_CENTRE = (0x0010UL), // Placement ROOMF_SPECIAL_TILES = (0x0020UL), // Placement ROOMF_NORMAL_TILES = (0x0040UL), // Placement ROOMF_BUILDABLE = (0x0080UL), ROOMF_SPECIAL_WALLS = (0x0100UL), // Placement ROOMF_ATTACKABLE = (0x0200UL), ROOMF_UNK_0x0400 = (0x0400UL), ROOMF_UNK_0x0800 = (0x0800UL), ROOMF_HAS_FLAME = (0x1000UL), ROOMF_IS_GOOD = (0x2000UL) }; enum { OBJECTF_DIE_OVER_TIME = (0x0000001UL), OBJECTF_DIE_OVER_TIME_IF_NOT_IN_ROOM = (0x0000002UL), OBJECTF_TYPE_SPECIAL = (0x0000004UL), OBJECTF_TYPE_SPELL_BOOK = (0x0000008UL), OBJECTF_TYPE_CRATE = (0x0000010UL), OBJECTF_TYPE_LAIR = (0x0000020UL), OBJECTF_TYPE_GOLD = (0x0000040UL), OBJECTF_TYPE_FOOD = (0x0000080UL), OBJECTF_CAN_BE_PICKED_UP = (0x0000100UL), OBJECTF_CAN_BE_SLAPPED = (0x0000200UL), OBJECTF_DIE_WHEN_SLAPPED = (0x0000400UL), OBJECTF_TYPE_LEVEL_GEM = (0x0001000UL), OBJECTF_CAN_BE_DROPPED_ON_ANY_LAND = (0x0002000UL), OBJECTF_OBSTACLE = (0x0004000UL), OBJECTF_BOUNCE = (0x0008000UL), OBJECTF_BOULDER_CAN_ROLL_THROUGH = (0x0010000UL), OBJECTF_BOULDER_DESTROYS = (0x0020000UL), OBJECTF_PILLAR = (0x0040000UL), OBJECTF_DOOR_KEY = (0x0100000UL), OBJECTF_DAMAGEABLE = (0x0200000UL), OBJECTF_HIGHLIGHTABLE = (0x0400000UL), OBJECTF_PLACEABLE = (0x0800000UL), OBJECTF_FIRST_PERSON_OBSTACLE = (0x1000000UL), OBJECTF_SOLID_OBSTACLE = (0x2000000UL), OBJECTF_CAST_SHADOWS = (0x4000000UL) }; inline bool KwdToENUM(unsigned int inputInt, ePlayerID& outputID) { static const ePlayerID IDs[] = { ePlayerID_Null, // 0 ePlayerID_Good, // 1 ePlayerID_Neutral, // 2 ePlayerID_Keeper1, // 3 ePlayerID_Keeper2, // 4 ePlayerID_Keeper3, // 5 ePlayerID_Keeper4, // 6 }; if (inputInt < ePlayerID_COUNT) { outputID = IDs[inputInt]; return true; } return false; } inline bool KwdToENUM(unsigned int inputInt, eBridgeTerrain& outputID) { static const eBridgeTerrain IDs[] = { eBridgeTerrain_Null, // 0 eBridgeTerrain_Water, // 1 eBridgeTerrain_Lava, // 2 }; if (inputInt < eBridgeTerrain_COUNT) { outputID = IDs[inputInt]; return true; } return false; } inline bool KwdToENUM(unsigned int inputInt, eGameObjectMaterial& outputID) { static const eGameObjectMaterial IDs[] = { eGameObjectMaterial_None, // 0 eGameObjectMaterial_Flesh, // 1 eGameObjectMaterial_Rock, // 2 eGameObjectMaterial_Wood, // 3 eGameObjectMaterial_Metal1, // 4 eGameObjectMaterial_Metal2, // 5 eGameObjectMaterial_Magic, // 6 eGameObjectMaterial_Glass, // 7 }; if (inputInt < eGameObjectMaterial_COUNT) { outputID = IDs[inputInt]; return true; } return false; } inline bool KwdToENUM(unsigned int inputInt, eArtResource& outputID) { static const eArtResource IDs[] = { eArtResource_Null, // 0 eArtResource_Sprite, // 1 eArtResource_Alpha, // 2 eArtResource_AdditiveAlpha, // 3 eArtResource_TerrainMesh, // 4 eArtResource_Mesh, // 5 eArtResource_AnimatingMesh, // 6 eArtResource_ProceduralMesh, // 7 eArtResource_MeshCollection, // 8 }; if (inputInt < eArtResource_COUNT) { outputID = IDs[inputInt]; return true; } return false; } inline bool KwdToENUM(unsigned int inputInt, ePlayerType& outputID) { static const ePlayerType IDs[] = { ePlayerType_Human, // 0 ePlayerType_Computer, // 1 }; if (inputInt < ePlayerType_COUNT) { outputID = IDs[inputInt]; return true; } return false; } inline bool KwdToENUM(unsigned int inputInt, eComputerAI& outputID) { static const eComputerAI IDs[] = { eComputerAI_MasterKeeper, // 0 eComputerAI_Conqueror, // 1 eComputerAI_Psychotic, // 2 eComputerAI_Stalwart, // 3 eComputerAI_Greyman, // 4 eComputerAI_Idiot, // 5 eComputerAI_Guardian, // 6 eComputerAI_ThickSkinned, // 7 eComputerAI_Paranoid, // 8 }; if (inputInt < eComputerAI_COUNT) { outputID = IDs[inputInt]; return true; } return false; } inline bool KwdToENUM(unsigned int inputInt, eRoomTileConstruction& outputID) { static const eRoomTileConstruction IDs[] = { eRoomTileConstruction_Complete, eRoomTileConstruction_Quad, eRoomTileConstruction_3_by_3, eRoomTileConstruction_3_by_3_Rotated, eRoomTileConstruction_Normal, eRoomTileConstruction_CenterPool, eRoomTileConstruction_DoubleQuad, eRoomTileConstruction_5_by_5_Rotated, eRoomTileConstruction_HeroGate, eRoomTileConstruction_HeroGateTile, eRoomTileConstruction_HeroGate_2_by_2, eRoomTileConstruction_HeroGateFrontEnd, eRoomTileConstruction_HeroGate_3_by_1, }; if (inputInt == 0) return false; --inputInt; // shift down index if (inputInt < eRoomTileConstruction_COUNT) { outputID = IDs[inputInt]; return true; } return false; } ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// bool ScenarioLoader::ReadString(BinaryInputStream* fileStream, unsigned int stringLength, std::string& ansiString) { const long dataLength = stringLength * 2; ByteArray bytes; bytes.resize(dataLength); // read bytes long readBytes = fileStream->ReadData(bytes.data(), dataLength); if (readBytes != dataLength) return false; // convert std::wstring tempString(reinterpret_cast<wchar_t*>(&bytes[0]), stringLength); ansiString.assign( tempString.begin(), tempString.end()); // trim ansiString.erase( std::find_if(ansiString.begin(), ansiString.end(), [](const char& c)->bool { return c == 0; }), ansiString.end()); return true; } bool ScenarioLoader::ReadString8(BinaryInputStream* fileStream, unsigned int stringLength, std::string& ansiString) { ByteArray bytes; bytes.resize(stringLength + 1); // read bytes long readBytes = fileStream->ReadData(bytes.data(), stringLength); if (readBytes != stringLength) return false; ansiString.assign(bytes.begin(), bytes.end()); // trim ansiString.erase( std::find_if(ansiString.begin(), ansiString.end(), [](const char& c)->bool { return c == 0; }), ansiString.end()); return true; } bool ScenarioLoader::ReadTimestamp(BinaryInputStream* fileStream) { unsigned int ignoreData; READ_FSTREAM_UINT16(fileStream, ignoreData); // year READ_FSTREAM_UINT8(fileStream, ignoreData); // day READ_FSTREAM_UINT8(fileStream, ignoreData); // month READ_FSTREAM_UINT16(fileStream, ignoreData); // unknown READ_FSTREAM_UINT8(fileStream, ignoreData); // hour READ_FSTREAM_UINT8(fileStream, ignoreData); // minute READ_FSTREAM_UINT8(fileStream, ignoreData); // second READ_FSTREAM_UINT8(fileStream, ignoreData); // unknown return true; } bool ScenarioLoader::Read32bitsFloat(BinaryInputStream* fileStream, float& outputFloat) { unsigned int encoded_float; READ_FSTREAM_UINT32(fileStream, encoded_float); // decode float outputFloat = encoded_float / DIVIDER_FLOAT; return true; } bool ScenarioLoader::ReadLight(BinaryInputStream* fileStream) { unsigned int ikpos; READ_FSTREAM_UINT32(fileStream, ikpos); // x, / ConversionUtils.FLOAT READ_FSTREAM_UINT32(fileStream, ikpos); // y, / ConversionUtils.FLOAT READ_FSTREAM_UINT32(fileStream, ikpos); // z, / ConversionUtils.FLOAT unsigned int iradius; READ_FSTREAM_UINT32(fileStream, iradius); // / ConversionUtils.FLOAT unsigned int flags; READ_FSTREAM_UINT32(fileStream, flags); unsigned char rgb; READ_FSTREAM_UINT8(fileStream, rgb); // r READ_FSTREAM_UINT8(fileStream, rgb); // g READ_FSTREAM_UINT8(fileStream, rgb); // b READ_FSTREAM_UINT8(fileStream, rgb); // a return true; } bool ScenarioLoader::ReadArtResource(BinaryInputStream* fileStream, ArtResource& artResource) { if (!ReadString8(fileStream, 64, artResource.mResourceName)) return false; unsigned int flags = 0; READ_FSTREAM_UINT32(fileStream, flags); // reading flags artResource.mPlayerColoured = (flags & ARTRESF_PLAYER_COLOURED) > 0; artResource.mAnimatingTexture = (flags & ARTRESF_ANIMATING_TEXTURE) > 0; artResource.mHasStartAnimation = (flags & ARTRESF_HAS_START_ANIMATION) > 0; artResource.mHasEndAnimation = (flags & ARTRESF_HAS_END_ANIMATION) > 0; artResource.mRandomStartFrame = (flags & ARTRESF_RANDOM_START_FRAME) > 0; artResource.mOriginAtBottom = (flags & ARTRESF_ORIGIN_AT_BOTTOM) > 0; artResource.mDoesntLoop = (flags & ARTRESF_DOESNT_LOOP) > 0; artResource.mFlat = (flags & ARTRESF_FLAT) > 0; artResource.mDoesntUseProgressiveMesh = (flags & ARTRESF_DOESNT_USE_PROGRESSIVE_MESH) > 0; artResource.mUseAnimatingTextureForSelection = (flags & ARTRESF_USE_ANIMATING_TEXTURE_FOR_SELECTION) > 0; artResource.mPreload = (flags & ARTRESF_PRELOAD) > 0; artResource.mBlood = (flags & ARTRESF_BLOOD) > 0; union packed_data_t { struct { unsigned int mEncodedWidth; unsigned int mEncodedHeight; unsigned short mFrames; unsigned short mNone_1; } mImageType; struct { unsigned int mEncodedScale; unsigned short mFrames; unsigned short mNone_1; unsigned int mNone_2; } mMeshType; struct { unsigned int mFrames; unsigned int mFps; unsigned short mStartDist; unsigned short mEndDist; } mAnimType; struct { unsigned int mId; unsigned int mNone_1; unsigned int mNone_2; } mProcType; struct { unsigned int mNone_1; unsigned int mNone_2; unsigned int mNone_3; } mTerrainType; unsigned char mBytes[12]; }; packed_data_t packed_data; const long packed_data_length = 12; static_assert(sizeof(packed_data) == packed_data_length, "Wrong size"); long bytesRead = fileStream->ReadData(&packed_data, packed_data_length); if (bytesRead != packed_data_length) return false; // map resource type unsigned char resourceType; READ_FSTREAM_UINT8(fileStream, resourceType); if (!KwdToENUM(resourceType, artResource.mResourceType)) return false; READ_FSTREAM_UINT8(fileStream, artResource.mStartAF); READ_FSTREAM_UINT8(fileStream, artResource.mEndAF); unsigned char unknownByte; READ_FSTREAM_UINT8(fileStream, unknownByte); switch (artResource.mResourceType) { case eArtResource_Sprite: case eArtResource_Alpha: case eArtResource_AdditiveAlpha: artResource.mImageDesc.mFrames = packed_data.mImageType.mFrames; artResource.mImageDesc.mWidth = packed_data.mImageType.mEncodedWidth / DIVIDER_FLOAT; artResource.mImageDesc.mHeight = packed_data.mImageType.mEncodedHeight / DIVIDER_FLOAT; break; case eArtResource_Mesh: case eArtResource_MeshCollection: artResource.mMeshDesc.mFrames = packed_data.mMeshType.mFrames; artResource.mMeshDesc.mScale = packed_data.mMeshType.mEncodedScale / DIVIDER_FLOAT; break; case eArtResource_AnimatingMesh: artResource.mAnimationDesc.mFps = packed_data.mAnimType.mFps; artResource.mAnimationDesc.mFrames = packed_data.mAnimType.mFrames; artResource.mAnimationDesc.mDistStart = packed_data.mAnimType.mStartDist; artResource.mAnimationDesc.mDistEnd = packed_data.mAnimType.mEndDist; break; case eArtResource_ProceduralMesh: artResource.mProcDesc.mId = packed_data.mProcType.mId; break; } return true; } bool ScenarioLoader::ReadTerrainFlags(BinaryInputStream* fileStream, TerrainDefinition& terrainDef) { unsigned int flags = 0; READ_FSTREAM_UINT32(fileStream, flags); terrainDef.mIsSolid = (flags & TERRAINF_SOLID) > 0; terrainDef.mIsImpenetrable = (flags & TERRAINF_IMPENETRABLE) > 0; terrainDef.mIsOwnable = (flags & TERRAINF_OWNABLE) > 0; terrainDef.mIsTaggable = (flags & TERRAINF_TAGGABLE) > 0; terrainDef.mIsAttackable = (flags & TERRAINF_ATTACKABLE) > 0; terrainDef.mHasTorch = (flags & TERRAINF_TORCH) > 0; terrainDef.mIsWater = (flags & TERRAINF_WATER) > 0; terrainDef.mIsLava = (flags & TERRAINF_LAVA) > 0; terrainDef.mAlwaysExplored = (flags & TERRAINF_ALWAYS_EXPLORED) > 0; terrainDef.mPlayerColouredPath = (flags & TERRAINF_PLAYER_COLOURED_PATH) > 0; terrainDef.mPlayerColouredWall = (flags & TERRAINF_PLAYER_COLOURED_WALL) > 0; terrainDef.mConstructionTypeWater = (flags & TERRAINF_CONSTRUCTION_TYPE_WATER) > 0; terrainDef.mConstructionTypeQuad = (flags & TERRAINF_CONSTRUCTION_TYPE_QUAD) > 0; terrainDef.mUnexploreIfDugByAnotherPlayer = (flags & TERRAINF_UNEXPLORE_IF_DUG_BY_ANOTHER_PLAYER) > 0; terrainDef.mFillInable = (flags & TERRAINF_FILL_INABLE) > 0; terrainDef.mAllowRoomWalls = (flags & TERRAINF_ALLOW_ROOM_WALLS) > 0; terrainDef.mIsDecay = (flags & TERRAINF_DECAY) > 0; terrainDef.mHasRandomTexture = (flags & TERRAINF_RANDOM_TEXTURE) > 0; terrainDef.mTerrainColorR = (flags & TERRAINF_TERRAIN_COLOR_R) > 0; terrainDef.mTerrainColorG = (flags & TERRAINF_TERRAIN_COLOR_G) > 0; terrainDef.mTerrainColorB = (flags & TERRAINF_TERRAIN_COLOR_B) > 0; terrainDef.mDwarfCanDigThrough = (flags & TERRAINF_DWARF_CAN_DIG_THROUGH) > 0; terrainDef.mRevealThroughFogOfWar = (flags & TERRAINF_REVEAL_THROUGH_FOG_OF_WAR) > 0; terrainDef.mAmbientColorR = (flags & TERRAINF_AMBIENT_COLOR_R) > 0; terrainDef.mAmbientColorG = (flags & TERRAINF_AMBIENT_COLOR_G) > 0; terrainDef.mAmbientColorB = (flags & TERRAINF_AMBIENT_COLOR_B) > 0; terrainDef.mHasLight = (flags & TERRAINF_LIGHT) > 0; terrainDef.mHasAmbientLight = (flags & TERRAINF_AMBIENT_LIGHT) > 0; return true; } bool ScenarioLoader::ReadRoomFlags(BinaryInputStream* fileStream, RoomDefinition& roomDef) { unsigned int flags = 0; READ_FSTREAM_UINT32(fileStream, flags); roomDef.mPlaceableOnWater = (flags & ROOMF_PLACEABLE_ON_WATER) > 0; roomDef.mPlaceableOnLava = (flags & ROOMF_PLACEABLE_ON_LAVA) > 0; roomDef.mPlaceableOnLand = (flags & ROOMF_PLACEABLE_ON_LAND) > 0; roomDef.mHasWalls = (flags & ROOMF_HAS_WALLS) > 0; roomDef.mCentre = (flags & ROOMF_CENTRE) > 0; roomDef.mSpecialTiles = (flags & ROOMF_SPECIAL_TILES) > 0; roomDef.mNormalTiles = (flags & ROOMF_NORMAL_TILES) > 0; roomDef.mBuildable = (flags & ROOMF_BUILDABLE) > 0; roomDef.mSpecialWalls = (flags & ROOMF_SPECIAL_WALLS) > 0; roomDef.mIsAttackable = (flags & ROOMF_ATTACKABLE) > 0; roomDef.mHasFlame = (flags & ROOMF_HAS_FLAME) > 0; roomDef.mIsGood = (flags & ROOMF_IS_GOOD) > 0; return true; } bool ScenarioLoader::ReadObjectFlags(BinaryInputStream* fileStream, GameObjectDefinition& objectDef) { unsigned int flags; READ_FSTREAM_UINT32(fileStream, flags); objectDef.mDieOverTime = (flags & OBJECTF_DIE_OVER_TIME) > 0; objectDef.mDieOverTimeIfNotInRoom = (flags & OBJECTF_DIE_OVER_TIME_IF_NOT_IN_ROOM) > 0; objectDef.mTypeSpecial = (flags & OBJECTF_TYPE_SPECIAL) > 0; objectDef.mTypeSpellBook = (flags & OBJECTF_TYPE_SPELL_BOOK) > 0; objectDef.mTypeCrate = (flags & OBJECTF_TYPE_CRATE) > 0; objectDef.mTypeLair = (flags & OBJECTF_TYPE_LAIR) > 0; objectDef.mTypeGold = (flags & OBJECTF_TYPE_GOLD) > 0; objectDef.mTypeFood = (flags & OBJECTF_TYPE_FOOD) > 0; objectDef.mCanBePickedUp = (flags & OBJECTF_CAN_BE_PICKED_UP) > 0; objectDef.mCanBeSlapped = (flags & OBJECTF_CAN_BE_SLAPPED) > 0; objectDef.mDieWhenSlapped = (flags & OBJECTF_DIE_WHEN_SLAPPED) > 0; objectDef.mTypeLevelGem = (flags & OBJECTF_TYPE_LEVEL_GEM) > 0; objectDef.mCanBeDroppedOnAnyLand = (flags & OBJECTF_CAN_BE_DROPPED_ON_ANY_LAND) > 0; objectDef.mObstacle = (flags & OBJECTF_OBSTACLE) > 0; objectDef.mBounce = (flags & OBJECTF_BOUNCE) > 0; objectDef.mBoulderCanRollThrough = (flags & OBJECTF_BOULDER_CAN_ROLL_THROUGH) > 0; objectDef.mBoulderDestroys = (flags & OBJECTF_BOULDER_DESTROYS) > 0; objectDef.mIsPillar = (flags & OBJECTF_PILLAR) > 0; objectDef.mDoorKey = (flags & OBJECTF_DOOR_KEY) > 0; objectDef.mIsDamageable = (flags & OBJECTF_DAMAGEABLE) > 0; objectDef.mHighlightable = (flags & OBJECTF_HIGHLIGHTABLE) > 0; objectDef.mPlaceable = (flags & OBJECTF_PLACEABLE) > 0; objectDef.mFirstPersonObstacle = (flags & OBJECTF_FIRST_PERSON_OBSTACLE) > 0; objectDef.mSolidObstacle = (flags & OBJECTF_SOLID_OBSTACLE) > 0; objectDef.mCastShadows = (flags & OBJECTF_CAST_SHADOWS) > 0; return true; } bool ScenarioLoader::ReadStringId(BinaryInputStream* fileStream) { unsigned int ids[5]; for (unsigned int& id_entry : ids) { READ_FSTREAM_UINT32(fileStream, id_entry); } unsigned int unknownDword; READ_FSTREAM_UINT32(fileStream, unknownDword); return true; } bool ScenarioLoader::ReadMapData(BinaryInputStream* fileStream) { mScenarioData.mMapTiles.resize(mScenarioData.mLevelDimensionX * mScenarioData.mLevelDimensionY); // read tiles for (int tiley = 0; tiley < mScenarioData.mLevelDimensionY; ++tiley) for (int tilex = 0; tilex < mScenarioData.mLevelDimensionX; ++tilex) { const int tileIndex = (tiley * mScenarioData.mLevelDimensionX) + tilex; // terrain type is not mapped to internal id so it can be red as is READ_FSTREAM_UINT8(fileStream, mScenarioData.mMapTiles[tileIndex].mTerrainType); unsigned char playerID; READ_FSTREAM_UINT8(fileStream, playerID); if (!KwdToENUM(playerID, mScenarioData.mMapTiles[tileIndex].mOwnerIdentifier)) return false; unsigned char bridgeTerrain; READ_FSTREAM_UINT8(fileStream, bridgeTerrain); if (!KwdToENUM(bridgeTerrain, mScenarioData.mMapTiles[tileIndex].mTerrainUnderTheBridge)) return false; unsigned char filler; READ_FSTREAM_UINT8(fileStream, filler); } return true; } bool ScenarioLoader::ReadObjectDefinition(BinaryInputStream* fileStream, GameObjectDefinition& objectDef) { if (!ReadString8(fileStream, 32, objectDef.mObjectName)) return false; // resources if (!ReadArtResource(fileStream, objectDef.mMeshResource)) return false; if (!ReadArtResource(fileStream, objectDef.mGuiIconResource)) return false; if (!ReadArtResource(fileStream, objectDef.mInHandIconResource)) return false; if (!ReadArtResource(fileStream, objectDef.mInHandMeshResource)) return false; if (!ReadArtResource(fileStream, objectDef.mUnknownResource)) return false; ArtResource additionalResources[4]; // not used for (ArtResource& additionalResource : additionalResources) { if (!ReadArtResource(fileStream, objectDef.mUnknownResource)) return false; } if (!ReadLight(fileStream)) return false; unsigned int width; unsigned int height; unsigned int mass; unsigned int speed; unsigned int airFriction; READ_FSTREAM_UINT32(fileStream, width); READ_FSTREAM_UINT32(fileStream, height); READ_FSTREAM_UINT32(fileStream, mass); READ_FSTREAM_UINT32(fileStream, speed); READ_FSTREAM_UINT32(fileStream, airFriction); // set params objectDef.mWidth = (width * 1.0f) / DIVIDER_FLOAT; objectDef.mHeight = (height * 1.0f) / DIVIDER_FLOAT; objectDef.mPhysicsMass = (mass * 1.0f) / DIVIDER_FLOAT; objectDef.mPhysicsSpeed = (speed * 1.0f) / DIVIDER_FLOAT; objectDef.mPhysicsAirFriction = (airFriction * 1.0f) / DIVIDER_DOUBLE; unsigned char objMaterial; READ_FSTREAM_UINT8(fileStream, objMaterial); if (!KwdToENUM(objMaterial, objectDef.mObjectMaterial)) return false; SKIP_FSTREAM_BYTES(fileStream, 3); if (!ReadObjectFlags(fileStream, objectDef)) return false; READ_FSTREAM_UINT16(fileStream, objectDef.mHitpoints); READ_FSTREAM_UINT16(fileStream, objectDef.mMaxAngle); SKIP_FSTREAM_BYTES(fileStream, 2); READ_FSTREAM_UINT16(fileStream, objectDef.mManaValue); READ_FSTREAM_UINT16(fileStream, objectDef.mTooltipStringId); READ_FSTREAM_UINT16(fileStream, objectDef.mNameStringId); READ_FSTREAM_UINT16(fileStream, objectDef.mSlapEffectId); READ_FSTREAM_UINT16(fileStream, objectDef.mDeathEffectId); READ_FSTREAM_UINT16(fileStream, objectDef.mMiscEffectId); // object type is not mapped to internal id so it can be red as is READ_FSTREAM_UINT8(fileStream, objectDef.mObjectType); unsigned char initialState; READ_FSTREAM_UINT8(fileStream, initialState); READ_FSTREAM_UINT8(fileStream, objectDef.mRoomCapacity); unsigned char pickupPriority; READ_FSTREAM_UINT8(fileStream, pickupPriority); // sound category if (!ReadString8(fileStream, 32, objectDef.mSoundCategory)) return false; return true; } bool ScenarioLoader::ReadObjectsData(BinaryInputStream* fileStream, int numElements) { mScenarioData.mGameObjectDefs.resize(numElements + 1); mScenarioData.mGameObjectDefs[0] = {}; // dummy element // read definitions for (int iobject = 1; iobject < numElements + 1; ++iobject) { if (!ReadObjectDefinition(fileStream, mScenarioData.mGameObjectDefs[iobject])) return false; bool correctId = (mScenarioData.mGameObjectDefs[iobject].mObjectType == iobject); debug_assert(correctId); } return true; } bool ScenarioLoader::ReadPlayerDefinition(BinaryInputStream* fileStream, PlayerDefinition& playerDef) { READ_FSTREAM_UINT32(fileStream, playerDef.mInitialGold); unsigned int playerType; READ_FSTREAM_UINT32(fileStream, playerType); if (!KwdToENUM(playerType, playerDef.mPlayerType)) return false; unsigned char aiType; READ_FSTREAM_UINT8(fileStream, aiType); if (!KwdToENUM(aiType, playerDef.mComputerAI)) return false; unsigned char speed; READ_FSTREAM_UINT8(fileStream, speed); unsigned char openness; READ_FSTREAM_UINT8(fileStream, openness); unsigned char fillerByte; READ_FSTREAM_UINT8(fileStream, fillerByte); READ_FSTREAM_UINT8(fileStream, fillerByte); READ_FSTREAM_UINT8(fileStream, fillerByte); READ_FSTREAM_UINT8(fileStream, fillerByte); READ_FSTREAM_UINT8(fileStream, fillerByte); unsigned int fillerDword; READ_FSTREAM_UINT32(fileStream, fillerDword); READ_FSTREAM_UINT32(fileStream, fillerDword); READ_FSTREAM_UINT32(fileStream, fillerDword); READ_FSTREAM_UINT8(fileStream, fillerByte); READ_FSTREAM_UINT8(fileStream, fillerByte); READ_FSTREAM_UINT8(fileStream, fillerByte); READ_FSTREAM_UINT8(fileStream, fillerByte); READ_FSTREAM_UINT8(fileStream, fillerByte); READ_FSTREAM_UINT8(fileStream, fillerByte); READ_FSTREAM_UINT8(fileStream, fillerByte); // build order SKIP_FSTREAM_BYTES(fileStream, 15); READ_FSTREAM_UINT8(fileStream, fillerByte); // flexibility READ_FSTREAM_UINT8(fileStream, fillerByte); // digToNeutralRoomsWithinTilesOfClaimedArea unsigned short fillerWord; READ_FSTREAM_UINT16(fileStream, fillerWord); // removeCallToArmsAfterSeconds READ_FSTREAM_UINT32(fileStream, fillerDword); // boulderTrapsOnLongCorridors READ_FSTREAM_UINT32(fileStream, fillerDword); // boulderTrapsOnRouteToBreachPoints READ_FSTREAM_UINT8(fileStream, fillerByte); // trapUseStyle READ_FSTREAM_UINT8(fileStream, fillerByte); // doorTrapPreference READ_FSTREAM_UINT8(fileStream, fillerByte); // doorUsage READ_FSTREAM_UINT8(fileStream, fillerByte); // chanceOfLookingToUseTrapsAndDoors READ_FSTREAM_UINT32(fileStream, fillerDword); // requireMinLevelForCreatures READ_FSTREAM_UINT32(fileStream, fillerDword); // requireTotalThreatGreaterThanTheEnemy READ_FSTREAM_UINT32(fileStream, fillerDword); // requireAllRoomTypesPlaced READ_FSTREAM_UINT32(fileStream, fillerDword); // requireAllKeeperSpellsResearched READ_FSTREAM_UINT32(fileStream, fillerDword); // onlyAttackAttackers READ_FSTREAM_UINT32(fileStream, fillerDword); // neverAttack READ_FSTREAM_UINT8(fileStream, fillerByte); // minLevelForCreatures READ_FSTREAM_UINT8(fileStream, fillerByte); // totalThreatGreaterThanTheEnemy READ_FSTREAM_UINT8(fileStream, fillerByte); // firstAttemptToBreachRoom READ_FSTREAM_UINT8(fileStream, fillerByte); // firstDigToEnemyPoint READ_FSTREAM_UINT8(fileStream, fillerByte); // breachAtPointsSimultaneously READ_FSTREAM_UINT8(fileStream, fillerByte); // usePercentageOfTotalCreaturesInFirstFightAfterBreach READ_FSTREAM_UINT16(fileStream, playerDef.mManaValue); READ_FSTREAM_UINT16(fileStream, fillerWord); // placeCallToArmsWhereThreatValueIsGreaterThan READ_FSTREAM_UINT16(fileStream, fillerWord); // removeCallToArmsIfLessThanEnemyCreatures READ_FSTREAM_UINT16(fileStream, fillerWord); // removeCallToArmsIfLessThanEnemyCreaturesWithinTiles READ_FSTREAM_UINT16(fileStream, fillerWord); // pullCreaturesFromFightIfOutnumberedAndUnableToDropReinforcements READ_FSTREAM_UINT8(fileStream, fillerByte); // threatValueOfDroppedCreaturesIsPercentageOfEnemyThreatValue READ_FSTREAM_UINT8(fileStream, fillerByte); // spellStyle READ_FSTREAM_UINT8(fileStream, fillerByte); // attemptToImprisonPercentageOfEnemyCreatures READ_FSTREAM_UINT8(fileStream, fillerByte); // ifCreatureHealthIsPercentageAndNotInOwnRoomMoveToLairOrTemple READ_FSTREAM_UINT16(fileStream, playerDef.mGoldValue); READ_FSTREAM_UINT32(fileStream, fillerDword); // tryToMakeUnhappyOnesHappy READ_FSTREAM_UINT32(fileStream, fillerDword); // tryToMakeAngryOnesHappy READ_FSTREAM_UINT32(fileStream, fillerDword); // disposeOfAngryCreatures READ_FSTREAM_UINT32(fileStream, fillerDword); // disposeOfRubbishCreaturesIfBetterOnesComeAlong READ_FSTREAM_UINT8(fileStream, fillerByte); // disposalMethod READ_FSTREAM_UINT8(fileStream, fillerByte); // maximumNumberOfImps READ_FSTREAM_UINT8(fileStream, fillerByte); // willNotSlapCreatures READ_FSTREAM_UINT8(fileStream, fillerByte); // attackWhenNumberOfCreaturesIsAtLeast READ_FSTREAM_UINT32(fileStream, fillerDword); // useLightningIfEnemyIsInWater READ_FSTREAM_UINT8(fileStream, fillerByte); // useSightOfEvil READ_FSTREAM_UINT8(fileStream, fillerByte); // useSpellsInBattle READ_FSTREAM_UINT8(fileStream, fillerByte); // spellsPowerPreference READ_FSTREAM_UINT8(fileStream, fillerByte); // useCallToArms READ_FSTREAM_UINT8(fileStream, fillerByte); READ_FSTREAM_UINT8(fileStream, fillerByte); READ_FSTREAM_UINT16(fileStream, fillerWord); // mineGoldUntil READ_FSTREAM_UINT16(fileStream, fillerWord); // waitSecondsAfterPreviousAttackBeforeAttackingAgain READ_FSTREAM_UINT32(fileStream, playerDef.mInitialMana); READ_FSTREAM_UINT16(fileStream, fillerWord); // exploreUpToTilesToFindSpecials READ_FSTREAM_UINT16(fileStream, fillerWord); // impTilesRatio READ_FSTREAM_UINT16(fileStream, fillerWord); // buildStartX READ_FSTREAM_UINT16(fileStream, fillerWord); // buildStartY READ_FSTREAM_UINT16(fileStream, fillerWord); // buildEndX READ_FSTREAM_UINT16(fileStream, fillerWord); // buildEndY READ_FSTREAM_UINT8(fileStream, fillerByte); // likelyhoodToMovingCreaturesToLibraryForResearching READ_FSTREAM_UINT8(fileStream, fillerByte); // chanceOfExploringToFindSpecials READ_FSTREAM_UINT8(fileStream, fillerByte); // chanceOfFindingSpecialsWhenExploring READ_FSTREAM_UINT8(fileStream, fillerByte); // fateOfImprisonedCreatures READ_FSTREAM_UINT16(fileStream, fillerWord); // triggerId unsigned char playerID; READ_FSTREAM_UINT8(fileStream, playerID); if (!KwdToENUM(playerID, playerDef.mPlayerIdentifier)) return false; READ_FSTREAM_UINT16(fileStream, playerDef.mStartCameraX); // cameraX READ_FSTREAM_UINT16(fileStream, playerDef.mStartCameraY); // cameraY if (!ReadString8(fileStream, 32, playerDef.mPlayerName)) return false; return true; } bool ScenarioLoader::ReadPlayersData(BinaryInputStream* fileStream, int numElements) { mScenarioData.mPlayerDefs.resize(numElements + 1); mScenarioData.mPlayerDefs[0] = {}; // dummy element // read definitions for (int iplayer = 1; iplayer < numElements + 1; ++iplayer) { if (!ReadPlayerDefinition(fileStream, mScenarioData.mPlayerDefs[iplayer])) return false; bool correctId = (mScenarioData.mPlayerDefs[iplayer].mPlayerIdentifier == iplayer); debug_assert(correctId); } return true; } bool ScenarioLoader::ReadRoomDefinition(BinaryInputStream* fileStream, RoomDefinition& roomDef) { if (!ReadString8(fileStream, 32, roomDef.mRoomName)) return false; // resources if (!ReadArtResource(fileStream, roomDef.mGuiIconResource)) return false; if (!ReadArtResource(fileStream, roomDef.mEditorIconResource)) return false; if (!ReadArtResource(fileStream, roomDef.mCompleteResource)) return false; if (!ReadArtResource(fileStream, roomDef.mStraightResource)) return false; if (!ReadArtResource(fileStream, roomDef.mInsideCornerResource)) return false; if (!ReadArtResource(fileStream, roomDef.mUnknownResource)) return false; if (!ReadArtResource(fileStream, roomDef.mOutsideCornerResource)) return false; if (!ReadArtResource(fileStream, roomDef.mWallResource)) return false; if (!ReadArtResource(fileStream, roomDef.mCapResource)) return false; if (!ReadArtResource(fileStream, roomDef.mCeilingResource)) return false; unsigned int ceilingHeight; READ_FSTREAM_UINT32(fileStream, ceilingHeight); unsigned short fillerWord; READ_FSTREAM_UINT16(fileStream, fillerWord); unsigned short torchIntensity; READ_FSTREAM_UINT16(fileStream, torchIntensity); if (!ReadRoomFlags(fileStream, roomDef)) return false; unsigned short tooltipStringId; READ_FSTREAM_UINT16(fileStream, tooltipStringId); unsigned short nameStringId; READ_FSTREAM_UINT16(fileStream, nameStringId); READ_FSTREAM_UINT16(fileStream, roomDef.mCost); unsigned short fightEffectId; READ_FSTREAM_UINT16(fileStream, fightEffectId); unsigned short generalDescriptionStringId; READ_FSTREAM_UINT16(fileStream, generalDescriptionStringId); unsigned short strenghtStringId; READ_FSTREAM_UINT16(fileStream, strenghtStringId); unsigned short torchRadius; READ_FSTREAM_UINT16(fileStream, torchRadius); unsigned short effects[8]; for (unsigned short& effectEntry : effects) { READ_FSTREAM_UINT16(fileStream, effectEntry); } READ_FSTREAM_UINT8(fileStream, roomDef.mRoomType); unsigned char fillerByte; READ_FSTREAM_UINT8(fileStream, fillerByte); READ_FSTREAM_UINT8(fileStream, roomDef.mTerrainType); unsigned char tileConstruction; READ_FSTREAM_UINT8(fileStream, tileConstruction); if (!KwdToENUM(tileConstruction, roomDef.mTileConstruction)) return false; unsigned char createdCreatureId; READ_FSTREAM_UINT8(fileStream, createdCreatureId); unsigned char torchColor[3]; for (unsigned char& colorComponent : torchColor) { READ_FSTREAM_UINT8(fileStream, colorComponent); } for (int& objectid : roomDef.mFloorObjectsIds) { READ_FSTREAM_UINT8(fileStream, objectid); } for (int& objectid : roomDef.mWallObjectsIds) { READ_FSTREAM_UINT8(fileStream, objectid); } if (!ReadString8(fileStream, 32, roomDef.mSoundCategory)) return false; READ_FSTREAM_UINT8(fileStream, roomDef.mOrderInEditor); READ_FSTREAM_UINT8(fileStream, fillerByte); READ_FSTREAM_UINT16(fileStream, fillerWord); READ_FSTREAM_UINT8(fileStream, fillerByte); if (!ReadArtResource(fileStream, roomDef.mTorchResource)) return false; READ_FSTREAM_UINT8(fileStream, roomDef.mRecommendedSizeX); READ_FSTREAM_UINT8(fileStream, roomDef.mRecommendedSizeY); short healthGain; READ_FSTREAM_UINT16(fileStream, healthGain); return true; } bool ScenarioLoader::ReadRoomsData(BinaryInputStream* fileStream, int numElements) { mScenarioData.mRoomDefs.resize(numElements + 1); mScenarioData.mRoomDefs[0] = {}; // dummy element // read definitions for (int iroom = 1; iroom < numElements + 1; ++iroom) { if (!ReadRoomDefinition(fileStream, mScenarioData.mRoomDefs[iroom])) return false; bool correctId = (mScenarioData.mRoomDefs[iroom].mRoomType == iroom); debug_assert(correctId); } return true; } bool ScenarioLoader::ReadCreaturesDefinition(BinaryInputStream* fileStream, const KwdFileHeader& header, CreatureDefinition& creature) { long startoffset = fileStream->GetCursorPosition(); long elementSize = header.mContentSize / header.mItemsCount; debug_assert(elementSize); if (!ReadString8(fileStream, 32, creature.mCreatureName)) return false; SKIP_FSTREAM_BYTES(fileStream, 84); // unknown data // parse primary animations for (int ianim = 0; ianim < 36; ++ianim) { if (!ReadArtResource(fileStream, creature.mAnimationResources[ianim])) return false; } if (!fileStream->SetCursorPosition(startoffset + elementSize)) return false; return true; } bool ScenarioLoader::ReadCreaturesData(BinaryInputStream* fileStream, const KwdFileHeader& header) { mScenarioData.mCreatureDefs.resize(header.mItemsCount + 1); mScenarioData.mCreatureDefs[0] = {}; // dummy element long startoffset = fileStream->GetCursorPosition(); // read definitions for (int icreature = 1; icreature < header.mItemsCount + 1; ++icreature) { if (!ReadCreaturesDefinition(fileStream, header, mScenarioData.mCreatureDefs[icreature])) return false; // bool correctId = (mScenarioData.mCreatureDefs[icreature].mCreatureClass == icreature); // debug_assert(correctId); } long endoffset = fileStream->GetCursorPosition(); debug_assert(endoffset - startoffset == header.mContentSize); return true; } bool ScenarioLoader::ReadTerrainDefinition(BinaryInputStream* fileStream, TerrainDefinition& terrainDef) { terrainDef = {}; if (!ReadString8(fileStream, 32, terrainDef.mName)) return false; // complete resource if (!ReadArtResource(fileStream, terrainDef.mResourceComplete)) return false; // side resource if (!ReadArtResource(fileStream, terrainDef.mResourceSide)) return false; // top resource if (!ReadArtResource(fileStream, terrainDef.mResourceTop)) return false; // tagged top resource if (!ReadArtResource(fileStream, terrainDef.mResourceTagged)) return false; if (!ReadStringId(fileStream)) return false; unsigned int depthInt; READ_FSTREAM_UINT32(fileStream, depthInt); if (!Read32bitsFloat(fileStream, terrainDef.mLightHeight)) return false; if (!ReadTerrainFlags(fileStream, terrainDef)) return false; READ_FSTREAM_UINT16(fileStream, terrainDef.mDamage); unsigned short filledWord; READ_FSTREAM_UINT16(fileStream, filledWord); READ_FSTREAM_UINT16(fileStream, filledWord); READ_FSTREAM_UINT16(fileStream, terrainDef.mGoldCapacity); READ_FSTREAM_UINT16(fileStream, terrainDef.mManaGain); READ_FSTREAM_UINT16(fileStream, terrainDef.mManaGainMax); unsigned short toolTipStringId; READ_FSTREAM_UINT16(fileStream, toolTipStringId); unsigned short nameStringId; READ_FSTREAM_UINT16(fileStream, nameStringId); unsigned short maxHealthEffectId; READ_FSTREAM_UINT16(fileStream, maxHealthEffectId); unsigned short destroyedEffectId; READ_FSTREAM_UINT16(fileStream, destroyedEffectId); unsigned short generalDescriptionStringId; READ_FSTREAM_UINT16(fileStream, generalDescriptionStringId); unsigned short strengthStringId; READ_FSTREAM_UINT16(fileStream, strengthStringId); unsigned short weaknessStringId; READ_FSTREAM_UINT16(fileStream, weaknessStringId); SKIP_FSTREAM_BYTES(fileStream, 16 * sizeof(unsigned short)); // unknown unsigned char wibbleH; READ_FSTREAM_UINT8(fileStream, wibbleH); unsigned char leanH[3]; for (unsigned char& entryLeanH : leanH) { READ_FSTREAM_UINT8(fileStream, entryLeanH); } unsigned char wibbleV; READ_FSTREAM_UINT8(fileStream, wibbleV); unsigned char leanV[3]; for (unsigned char& entryLeanV : leanV) { READ_FSTREAM_UINT8(fileStream, entryLeanV); } READ_FSTREAM_UINT8(fileStream, terrainDef.mTerrainType); READ_FSTREAM_UINT16(fileStream, terrainDef.mHealthInitial); READ_FSTREAM_UINT8(fileStream, terrainDef.mBecomesTerrainTypeWhenMaxHealth); READ_FSTREAM_UINT8(fileStream, terrainDef.mBecomesTerrainTypeWhenDestroyed); unsigned char colorComponents[3]; // terrain color READ_FSTREAM_UINT8(fileStream, colorComponents[0]); READ_FSTREAM_UINT8(fileStream, colorComponents[1]); READ_FSTREAM_UINT8(fileStream, colorComponents[2]); terrainDef.mTerrainColor.Setup( // details unknown (terrainDef.mTerrainColorR) ? colorComponents[0] : colorComponents[0], (terrainDef.mTerrainColorG) ? colorComponents[1] : colorComponents[1], (terrainDef.mTerrainColorB) ? colorComponents[2] : colorComponents[2], 255 ); READ_FSTREAM_UINT8(fileStream, terrainDef.mTextureFrames); std::string soundCategory; if (!ReadString8(fileStream, 32, soundCategory)) return false; READ_FSTREAM_UINT16(fileStream, terrainDef.mHealthMax); // ambient color READ_FSTREAM_UINT8(fileStream, colorComponents[0]); READ_FSTREAM_UINT8(fileStream, colorComponents[1]); READ_FSTREAM_UINT8(fileStream, colorComponents[2]); terrainDef.mAmbientColor.Setup( // details unknown (terrainDef.mAmbientColorR) ? colorComponents[0] : colorComponents[0], (terrainDef.mAmbientColorG) ? colorComponents[1] : colorComponents[1], (terrainDef.mAmbientColorB) ? colorComponents[2] : colorComponents[2], 255 ); std::string soundCategoryFirstPerson; if (!ReadString8(fileStream, 32, soundCategoryFirstPerson)) return false; unsigned int fillerDword; READ_FSTREAM_UINT32(fileStream, fillerDword); return true; } bool ScenarioLoader::ReadTerrainData(BinaryInputStream* fileStream, int numElements) { mScenarioData.mTerrainDefs.resize(numElements + 1); mScenarioData.mTerrainDefs[0] = {}; // dummy element // read definitions for (int ielement = 1; ielement < numElements + 1; ++ielement) { if (!ReadTerrainDefinition(fileStream, mScenarioData.mTerrainDefs[ielement])) return false; bool correctId = (mScenarioData.mTerrainDefs[ielement].mTerrainType == ielement); debug_assert(correctId); } return true; } bool ScenarioLoader::ReadLevelVariables(BinaryInputStream* fileStream) { unsigned short fillerWord; unsigned int fillerDword; READ_FSTREAM_UINT16(fileStream, fillerWord); // trigger id READ_FSTREAM_UINT16(fileStream, fillerWord); SKIP_FSTREAM_BYTES(fileStream, 520); // unknown data // read text messages std::vector<std::string> levelMessages; levelMessages.resize(512); for (std::string& messageEntry: levelMessages) { if (!ReadString(fileStream, 20, messageEntry)) return false; } READ_FSTREAM_UINT16(fileStream, fillerWord); // flags std::string speechString; if (!ReadString8(fileStream, 32, speechString)) return false; unsigned char talismanPieces; READ_FSTREAM_UINT8(fileStream, talismanPieces); READ_FSTREAM_UINT32(fileStream, fillerDword); READ_FSTREAM_UINT32(fileStream, fillerDword); unsigned char soundtrack; unsigned char textTableId; READ_FSTREAM_UINT8(fileStream, soundtrack); READ_FSTREAM_UINT8(fileStream, textTableId); READ_FSTREAM_UINT16(fileStream, fillerWord); // textTitleId READ_FSTREAM_UINT16(fileStream, fillerWord); // textPlotId READ_FSTREAM_UINT16(fileStream, fillerWord); // textDebriefId READ_FSTREAM_UINT16(fileStream, fillerWord); // textObjectvId READ_FSTREAM_UINT16(fileStream, fillerWord); READ_FSTREAM_UINT16(fileStream, fillerWord); READ_FSTREAM_UINT16(fileStream, fillerWord); READ_FSTREAM_UINT16(fileStream, fillerWord); READ_FSTREAM_UINT16(fileStream, fillerWord); // speclvlIdx // unknown data SKIP_FSTREAM_BYTES(fileStream, 8 * sizeof(unsigned char)); SKIP_FSTREAM_BYTES(fileStream, 8 * sizeof(unsigned short)); // path std::string terrainPath; if (!ReadString8(fileStream, 32, terrainPath)) return false; unsigned char oneShotHornyLev; unsigned char fillerByte; READ_FSTREAM_UINT8(fileStream, oneShotHornyLev); READ_FSTREAM_UINT8(fileStream, fillerByte); READ_FSTREAM_UINT8(fileStream, fillerByte); READ_FSTREAM_UINT8(fileStream, fillerByte); READ_FSTREAM_UINT16(fileStream, fillerWord); READ_FSTREAM_UINT16(fileStream, fillerWord); READ_FSTREAM_UINT16(fileStream, fillerWord); READ_FSTREAM_UINT16(fileStream, fillerWord); READ_FSTREAM_UINT16(fileStream, fillerWord); READ_FSTREAM_UINT16(fileStream, fillerWord); std::string heroName; if (!ReadString(fileStream, 32, heroName)) return false; return true; } bool ScenarioLoader::ReadMapInfo(BinaryInputStream* fileStream) { if (!fileStream->SetCursorPosition(20)) return false; // additional header data unsigned short pathCount; unsigned short unknownCount; unsigned int fillerDword; READ_FSTREAM_UINT16(fileStream, pathCount); READ_FSTREAM_UINT16(fileStream, unknownCount); READ_FSTREAM_UINT32(fileStream, fillerDword); // timestamp 1 if (!ReadTimestamp(fileStream)) return false; // timestamp 2 if (!ReadTimestamp(fileStream)) return false; READ_FSTREAM_UINT32(fileStream, fillerDword); READ_FSTREAM_UINT32(fileStream, fillerDword); // property data if (!ReadString(fileStream, 64, mScenarioData.mLevelName)) return false; if (!ReadString(fileStream, 1024, mScenarioData.mLevelDescription)) return false; if (!ReadString(fileStream, 64, mScenarioData.mLevelAuthor)) return false; if (!ReadString(fileStream, 64, mScenarioData.mLevelEmail)) return false; if (!ReadString(fileStream, 1024, mScenarioData.mLevelInformation)) return false; // variables if (!ReadLevelVariables(fileStream)) return false; SKIP_FSTREAM_BYTES(fileStream, 8); // unknown data // read paths mPaths.resize(pathCount); for (LevelDataFilePath& pathEntry: mPaths) { READ_FSTREAM_UINT32(fileStream, pathEntry.mId); READ_FSTREAM_UINT32(fileStream, fillerDword); if (!ReadString8(fileStream, 64, pathEntry.mFilePath)) return false; } // unknown data SKIP_FSTREAM_BYTES(fileStream, unknownCount * sizeof(unsigned short)); return !!fileStream; } bool ScenarioLoader::ReadDataFile(BinaryInputStream* fileStream, eLevelDataFile dataTypeId) { KwdFileHeader headerData; if (dataTypeId == DKLD_GLOBALS) { // skip global info return true; } // read header unsigned int headerId; READ_FSTREAM_UINT32(fileStream, headerId); if (headerId != dataTypeId) // data type id mistmatch return false; unsigned int byteSize = 0; unsigned int checkOne = 0; READ_FSTREAM_UINT32(fileStream, byteSize); READ_FSTREAM_UINT32(fileStream, headerData.mFileSize); READ_FSTREAM_UINT32(fileStream, checkOne); READ_FSTREAM_UINT32(fileStream, headerData.mHeaderEndOffset); debug_assert(byteSize == sizeof(unsigned int)); long startoffset = fileStream->GetCursorPosition(); switch (dataTypeId) { case eLevelDataFile::DKLD_MAP: { READ_FSTREAM_UINT32(fileStream, mScenarioData.mLevelDimensionX); READ_FSTREAM_UINT32(fileStream, mScenarioData.mLevelDimensionY); } break; case eLevelDataFile::DKLD_TRIGGERS: { SKIP_FSTREAM_BYTES(fileStream, 4); //itemcount 1 SKIP_FSTREAM_BYTES(fileStream, 4); //itemcount 2 SKIP_FSTREAM_BYTES(fileStream, 4); //unknown if (!ReadTimestamp(fileStream)) // created return false; if (!ReadTimestamp(fileStream)) // modified return false; } break; case eLevelDataFile::DKLD_LEVEL: { READ_FSTREAM_UINT16(fileStream, headerData.mItemsCount); SKIP_FSTREAM_BYTES(fileStream, 2); // height SKIP_FSTREAM_BYTES(fileStream, 4); // unknown if (!ReadTimestamp(fileStream)) // created return false; if (!ReadTimestamp(fileStream)) // modified return false; } break; default: { READ_FSTREAM_UINT32(fileStream, headerData.mItemsCount); SKIP_FSTREAM_BYTES(fileStream, 4); // unknown if (!ReadTimestamp(fileStream)) // created return false; if (!ReadTimestamp(fileStream)) // modified return false; } break; } unsigned int checkTwo; READ_FSTREAM_UINT32(fileStream, checkTwo); READ_FSTREAM_UINT32(fileStream, headerData.mContentSize); // read body switch (dataTypeId) { case eLevelDataFile::DKLD_GLOBALS: break; case eLevelDataFile::DKLD_MAP: { if (!ReadMapData(fileStream)) return false; } break; case eLevelDataFile::DKLD_TERRAIN: { if (!ReadTerrainData(fileStream, headerData.mItemsCount)) return false; } break; case eLevelDataFile::DKLD_ROOMS: { if (!ReadRoomsData(fileStream, headerData.mItemsCount)) return false; } break; case eLevelDataFile::DKLD_TRAPS: break; case eLevelDataFile::DKLD_DOORS: break; case eLevelDataFile::DKLD_KEEPER_SPELLS: break; case eLevelDataFile::DKLD_CREATURE_SPELLS: break; case eLevelDataFile::DKLD_CREATURES: { if (!ReadCreaturesData(fileStream, headerData)) return false; } break; case eLevelDataFile::DKLD_PLAYERS: { if (!ReadPlayersData(fileStream, headerData.mItemsCount)) return false; } break; case eLevelDataFile::DKLD_THINGS: break; case eLevelDataFile::DKLD_TRIGGERS: break; case eLevelDataFile::DKLD_LEVEL: break; case eLevelDataFile::DKLD_VARIABLES: break; case eLevelDataFile::DKLD_OBJECTS: { if (!ReadObjectsData(fileStream, headerData.mItemsCount)) return false; } break; case eLevelDataFile::DKLD_EFFECT_ELEMENTS: break; case eLevelDataFile::DKLD_SHOTS: break; case eLevelDataFile::DKLD_EFFECTS: break; } return true; } bool ScenarioLoader::ScanTerrainTypes() { // all definitions are loaded at this point, so we should map rooms to terrain types bool roomAndTerrainDefinitionsNotNull = !(mScenarioData.mRoomDefs.empty() || mScenarioData.mTerrainDefs.empty()); if (!roomAndTerrainDefinitionsNotNull) return false; mScenarioData.mRoomByTerrainType.resize(mScenarioData.mTerrainDefs.size(), RoomType_Null); // explore each room definition for (RoomDefinition& roomDefinition : mScenarioData.mRoomDefs) { // null definition is being skipped if (roomDefinition.mRoomType == RoomType_Null) continue; // bind identifier mScenarioData.mRoomByTerrainType[roomDefinition.mTerrainType] = roomDefinition.mRoomType; } // find special terrain types for (TerrainDefinition& terrainDefinition : mScenarioData.mTerrainDefs) { // null definition is being skipped if (terrainDefinition.mTerrainType == TerrainType_Null) continue; if (terrainDefinition.mIsLava) { mScenarioData.mLavaTerrainType = terrainDefinition.mTerrainType; } if (terrainDefinition.mIsWater) { mScenarioData.mWaterTerrainType = terrainDefinition.mTerrainType; } if (terrainDefinition.mPlayerColouredPath && (mScenarioData.mPlayerColouredPathTerrainType == TerrainType_Null)) { if (mScenarioData.mRoomByTerrainType[terrainDefinition.mTerrainType] == RoomType_Null) { mScenarioData.mPlayerColouredPathTerrainType = terrainDefinition.mTerrainType; } } if (terrainDefinition.mPlayerColouredWall) { mScenarioData.mPlayerColouredWallTerrainType = terrainDefinition.mTerrainType; } } return true; } void ScenarioLoader::FixTerrainResources() { // hero lair complete resource is missed, seems it originally hardcoded in game exe const int HeroLairTerrainIdentifier = 35; debug_assert(HeroLairTerrainIdentifier < mScenarioData.mTerrainDefs.size()); TerrainDefinition& terrainDef = mScenarioData.mTerrainDefs[HeroLairTerrainIdentifier]; if (!terrainDef.mResourceComplete.IsDefined()) { terrainDef.mResourceComplete.mResourceType = eArtResource_TerrainMesh; terrainDef.mResourceComplete.mResourceName = "hero_outpost_floor"; } else { debug_assert(false); } // does not use player colors terrainDef.mPlayerColouredPath = false; } bool ScenarioLoader::LoadScenarioData(const std::string& scenario) { mScenarioData.Clear(); std::string scenarioName = scenario; cxx::path_remove_extension(scenarioName); std::string scenarioFileName = scenario; cxx::path_set_extension(scenarioFileName, ".kwd"); // open file stream BinaryInputStream* fileStream = gFileSystem.OpenDataFile(scenarioFileName); if (fileStream == nullptr) { gConsole.LogMessage(eLogMessage_Warning, "Cannot open scenario file '%s'", scenarioName.c_str()); return false; } if (!ReadMapInfo(fileStream)) { gConsole.LogMessage(eLogMessage_Warning, "Error reading scenario data '%s'", scenarioName.c_str()); return false; } gFileSystem.CloseFileStream(fileStream); // override paths mPaths.clear(); // globals mPaths.emplace_back(eLevelDataFile::DKLD_TERRAIN, "../Terrain.kwd"); mPaths.emplace_back(eLevelDataFile::DKLD_OBJECTS, "../Objects.kwd"); mPaths.emplace_back(eLevelDataFile::DKLD_ROOMS, "../Rooms.kwd"); mPaths.emplace_back(eLevelDataFile::DKLD_CREATURES, "../Creatures.kwd"); mPaths.emplace_back(eLevelDataFile::DKLD_CREATURE_SPELLS, "../CreatureSpells.kwd"); mPaths.emplace_back(eLevelDataFile::DKLD_TRAPS, "../Traps.kwd"); mPaths.emplace_back(eLevelDataFile::DKLD_DOORS, "../Doors.kwd"); mPaths.emplace_back(eLevelDataFile::DKLD_SHOTS, "../Shots.kwd"); mPaths.emplace_back(eLevelDataFile::DKLD_KEEPER_SPELLS, "../KeeperSpells.kwd"); mPaths.emplace_back(eLevelDataFile::DKLD_VARIABLES, "../GlobalVariables.kwd"); // level data mPaths.emplace_back(eLevelDataFile::DKLD_PLAYERS, scenarioName + "Players.kld"); mPaths.emplace_back(eLevelDataFile::DKLD_MAP, scenarioName + "Map.kld"); mPaths.emplace_back(eLevelDataFile::DKLD_TRIGGERS, scenarioName + "Triggers.kld"); mPaths.emplace_back(eLevelDataFile::DKLD_VARIABLES, scenarioName + "Variables.kld"); mPaths.emplace_back(eLevelDataFile::DKLD_THINGS, scenarioName + "Things.kld"); // read data from data files for (const LevelDataFilePath& pathEntry: mPaths) { BinaryInputStream* dataFileStream = gFileSystem.OpenDataFile(pathEntry.mFilePath); if (dataFileStream == nullptr) { gConsole.LogMessage(eLogMessage_Warning, "Cannot locate scenario data file '%s'", pathEntry.mFilePath.c_str()); continue; } if (!ReadDataFile(dataFileStream, pathEntry.mId)) { gConsole.LogMessage(eLogMessage_Warning, "Error reading scenario data file '%s'", pathEntry.mFilePath.c_str()); return false; } gFileSystem.CloseFileStream(dataFileStream); } if (!ScanTerrainTypes()) { gConsole.LogMessage(eLogMessage_Warning, "Error exploring scenario terrain types"); return false; } FixTerrainResources(); return true; }
[ "codename.cpp@gmail.com" ]
codename.cpp@gmail.com
44f75eaf10af4d5733928d595bf9379d82a0a2f5
4121d1428a43c53591a04f7790d00649e918b51f
/Cheetah/src/Platform/OpenGL/OpenGLGraphicsContext.h
fe68b98530b7e792eb2e8d47e19dbb3d3bf6bcd8
[]
no_license
ricknijhuis/Cheetah
a491ac31d44006b0ad517668c7f21ddda3446eef
0079d2b42e1b9cd085430cc25bf81c17a71661c9
refs/heads/master
2023-06-07T12:07:49.078411
2020-01-16T08:19:48
2020-01-16T08:19:48
232,648,927
1
0
null
null
null
null
UTF-8
C++
false
false
536
h
#ifndef CHEETAH_PLATFORM_OPENGL_OPENGLGRAPHICSCONTEXT #define CHEETAH_PLATFORM_OPENGL_OPENGLGRAPHICSCONTEXT #include "Renderer/GraphicsContext.h" #include "glad/glad.h" #include "GLFW/glfw3.h" namespace cheetah { namespace opengl { class OpenGLGraphicsContext : public GraphicsContext { public: OpenGLGraphicsContext(GLFWwindow* window); virtual void init() override; virtual void swapBuffers() override; private: GLFWwindow* m_windowHandle; }; } } #endif // !CHEETAH_PLATFORM_OPENGL_OPENGLGRAPHICSCONTEXT
[ "rick.nijhuis@sycade.com" ]
rick.nijhuis@sycade.com
c6afe5b70a2507052ec1604f1e9a5ca47f85468d
0f346f08ce5b6c5b68b0bf5d56ba1aeb49bed1b9
/001 출력 printf/001 welcome to c.cpp
73296eb2bd5ff4197e621f703733da2d93bf04ac
[]
no_license
contacoonta/SGAProgramming-1Cpp
5e2672e60a1804d09d9895cc004d83c02faee8d1
d4e9331ae129d19484498efe5389dc81aca90eb4
refs/heads/master
2021-01-19T21:25:31.635939
2014-06-26T06:18:45
2014-06-26T06:18:45
null
0
0
null
null
null
null
UHC
C++
false
false
214
cpp
//주석 comment /* 이것도 주석 설명이나 묘사를 해줄때 사용. */ /* IDE ( Integreated Development Environment ) */ #include <stdio.h> void main() { printf("우리는 c를 배웁니다."); }
[ "contacoonta@gmail.com" ]
contacoonta@gmail.com
4281f19878142c6c3f33174225f894e698deabee
d92494d5d2d046d834f45f1888da4bdf291ebc9d
/Cases/nonAchetable.h
a975899b048c1138777269bfd650951300710a9d
[]
no_license
ECN-SEC-SMP/projet2021-gobin-ramirez-prudhomme-puillandre
725dc59624b67458219ecd425cccf05d4d1d2178
f746991786110c13ae8a179d70d2206d49715208
refs/heads/master
2023-04-12T13:41:06.808421
2021-04-25T21:26:14
2021-04-25T21:26:14
358,583,647
0
0
null
null
null
null
UTF-8
C++
false
false
224
h
#ifndef nonachetable_def #define nonachetable_def #include "cases.h" #include "../joueur.h" class nonAchetable: public cases { public: //constructeur nonAchetable(string _nom); bool sonAction(joueur j); }; #endif
[ "" ]
9bdb05c97cf4caeda9134c5850caaac2b19b5986
81f43fdb1af8cf08bbf8c126c66eb4fe8fc1cec6
/Render/Device/Device.cpp
26339a8c8898e4db47e388247ed9245a30dedf27
[]
no_license
cuixiangzhi/Engine
404eb034a386d03c158d07f86a16f4ed72517c0e
b1c5b386144a021caa7fb466d47edeec25dd33a2
refs/heads/master
2021-06-21T15:47:17.615028
2021-06-11T03:41:24
2021-06-11T03:41:24
186,078,088
2
0
null
null
null
null
GB18030
C++
false
false
7,287
cpp
#include "Device.h" #include "Window.h" #include "../Render/Mesh.h" #include "../Render/Shader.h" #include "../Render/Object.h" #include "../Render/Texture.h" #include "../Logic.h" namespace Engine { Device* Device::mDeviceInstance = NULL; Device::Device() { mWindow = NULL; mShader = NULL; mDefaultTarget = NULL; mActiveTarget = NULL; } Device::~Device() { mWindow = NULL; mShader = NULL; mActiveTarget = NULL; if (mDefaultTarget != NULL) { delete mDefaultTarget; mDefaultTarget = NULL; } } Device* Device::Create(Window* window) { Device* device = new Device(); device->mWindow = window; device->mDefaultTarget = RenderTexture::Create(window->GetWidth(), window->GetHeight(), true, true, window->GetBitmapBuffer()); device->mActiveTarget = device->mDefaultTarget; if (device->mActiveTarget == NULL) goto CREATE_FAILED; mDeviceInstance = device; return device; CREATE_FAILED: delete device; return NULL; } void Device::Clear(RenderTexture* renderTarget) { mActiveTarget = renderTarget != NULL ? renderTarget : mDefaultTarget; mActiveTarget->Clear(); } void Device::Present() { if (mWindow != NULL) mWindow->SwapBuffer(); } int Device::GetWidth() const { return mActiveTarget->GetWidth(); } int Device::GetHeight() const { return mActiveTarget->GetHeight(); } void Device::DrawObject(Object* object, Shader* shader) { mShader = shader; for (int i = 0; i < object->mesh->faceCount; ++i) { auto& vertexData = object->mesh->vertexData; auto& faceData = object->mesh->faceData; DrawTriangle(vertexData[faceData[i].v0], vertexData[faceData[i].v1], vertexData[faceData[i].v2]); } } void Device::DrawTriangle(const Vertex& v0, const Vertex& v1, const Vertex& v2) { //顶点着色器 Fragment& clipV0 = mShader->vertex(v0); Fragment& clipV1 = mShader->vertex(v1); Fragment& clipV2 = mShader->vertex(v2); //CVV裁剪 vector<Fragment> input = { clipV0, clipV1, clipV2 }, output = {}; mShader->cvvcull(input, output); //遍历裁剪出来的凸多边形 for (int i = 2; i < (int)input.size(); ++i) { clipV0 = input[0]; clipV1 = input[i - 1]; clipV2 = input[i]; //透视除法 mShader->division(clipV0, clipV1, clipV2); //背面剔除 if (!mShader->backcull(clipV0, clipV1, clipV2)) continue; //视口变换 mShader->viewport(clipV0, clipV1, clipV2); //光栅化 switch (Logic::GetRenderMode()) { case RenderMode::RENDER_WIREFRAME: if (i == 2) DrawLineDDA(clipV0, clipV1); if (i == input.size() - 1) DrawLineDDA(clipV2, clipV0); DrawLineDDA(clipV1, clipV2); break; case RenderMode::RENDER_SHADED: DrawTriangleScanline(clipV0, clipV1, clipV2); break; } } } void Device::DrawTriangleScanline(Fragment v0, Fragment v1, Fragment v2) { //确保屏幕坐标为整数 v0.position.y = Math::Floorf(v0.position.y); v1.position.y = Math::Floorf(v1.position.y); v2.position.y = Math::Floorf(v2.position.y); //过滤水平线 if (v0.position.y == v1.position.y && v0.position.y == v2.position.y) return; //从低到高排序 if (v0.position.y > v1.position.y) { swap(v0, v1); } if (v0.position.y > v2.position.y) { swap(v0, v2); } if (v1.position.y > v2.position.y) { swap(v1, v2); } bool upTriangle = v0.position.y == v1.position.y; bool downTriangle = v1.position.y == v2.position.y; if (upTriangle || downTriangle) { Fragment lbv, ltv, rbv, rtv, linel, liner; if (upTriangle) { if (v0.position.x > v1.position.x) { swap(v0, v1); } lbv = v0; ltv = v2; rbv = v1; rtv = v2; } else if (downTriangle) { if (v1.position.x > v2.position.x) { swap(v1, v2); } lbv = v0; ltv = v1; rbv = v0; rtv = v2; } //把三角形当做梯形处理,只对边界做舍入,误差会累积 float hPercent, wPercent, linexl, linexr, boty = Math::Floorf(lbv.position.y), topy = Math::Floorf(ltv.position.y); for (float y = boty; y <= topy; ++y) { linexl = Math::Floorf(linel.position.x); linexr = Math::Floorf(liner.position.x); for (float x = linexl; x < linexr; ++x) { wPercent = linexl == linexr ? 0.0f : (x - linexl) / (linexr - linexl); auto v = Fragment::Lerp(linel, liner, wPercent); v.position.x = x; v.position.y = y; DrawPixel(v); } hPercent = topy == boty ? 1.0f : (y - boty) / (topy - boty); linel = Fragment::Lerp(lbv, ltv, hPercent); liner = Fragment::Lerp(rbv, rtv, hPercent); } } else { //把三角形分成上下两部分 Fragment newv = Fragment::Lerp(v0, v2, (v1.position.y - v0.position.y) / (v2.position.y - v0.position.y)); DrawTriangleScanline(v0, v1, newv); DrawTriangleScanline(newv, v1, v2); } } void Device::DrawLineDDA(Fragment v0, Fragment v1) { //确保屏幕坐标为整数 v0.position.x = Math::Floorf(v0.position.x); v0.position.y = Math::Floorf(v0.position.y); v1.position.x = Math::Floorf(v1.position.x); v1.position.y = Math::Floorf(v1.position.y); if (v0.position.x == v1.position.x && v0.position.y == v1.position.y) { //一个点 DrawPixel(v0); } else if (v0.position.x == v1.position.x) { //垂直线 if (v0.position.y > v1.position.y) { swap(v0, v1); } for (float y = v0.position.y; y <= v1.position.y; ++y) { DrawPixel(Fragment::Lerp(v0, v1, (y - v0.position.y) / (v1.position.y - v0.position.y))); } } else if (v0.position.y == v1.position.y) { //水平线 if (v0.position.x > v1.position.x) { swap(v0, v1); } for (float x = v0.position.x; x <= v1.position.x; ++x) { DrawPixel(Fragment::Lerp(v0, v1, (x - v0.position.x) / (v1.position.x - v0.position.x))); } } else { float k = (v1.position.y - v0.position.y) / (v1.position.x - v0.position.x); if (k >= -1 && k <= 1) { //|k|<=1 由左向右x增量为1,y增量为k if (v0.position.x > v1.position.x) { swap(v0, v1); } float y = v0.position.y, dy = (v1.position.y - v0.position.y) / (v1.position.x - v0.position.x); for (float x = v0.position.x; x <= v1.position.x; x += 1.0f, y += dy) { DrawPixel(Fragment::Lerp(v0, v1, (x - v0.position.x) / (v1.position.x - v0.position.x))); } } else { //|k|>1 由下向上y增量为1,x增量为1/k if (v0.position.y > v1.position.y) { swap(v0, v1); } float x = v0.position.x, dx = (v1.position.x - v0.position.x) / (v1.position.y - v0.position.y); for (float y = v0.position.y; y <= v1.position.y; y += 1.0f, x += dx) { DrawPixel(Fragment::Lerp(v0, v1, (y - v0.position.y) / (v1.position.y - v0.position.y))); } } } } void Device::DrawPixel(const Fragment& v) { int x = (int)Math::Floorf(v.position.x); int y = (int)Math::Floorf(v.position.y); //深度测试 if (!mShader->depthtest(v.position.z, mActiveTarget->GetDepth(x, y))) return; //像素着色器 Color color = mShader->fragment(v); //修改深度和颜色 mShader->updatecolor(mActiveTarget, x, y, color); mShader->updatedepth(mActiveTarget, x, y, v.position.z); } }
[ "874101646@qq.com" ]
874101646@qq.com
b2efec1c8a92c881f3b49bf94f9feeaa744fe759
36741ebbbeed10df63fa9d81cb6e5fbec04a7051
/src/tests/dE2000_test.cpp
f05d6e82786ef4adaf2e252255d7637db3f96a8b
[ "BSD-3-Clause", "LicenseRef-scancode-public-domain" ]
permissive
oyranos-cms/oyranos
514c1663934f408e2ebab85a75d19349daddeef8
9ab91fa085c93bc8415aa1ae9539acc0808c3fdf
refs/heads/master
2023-06-08T10:00:39.168911
2023-05-30T06:14:51
2023-05-30T06:14:51
22,095,358
21
7
NOASSERTION
2019-04-04T06:44:11
2014-07-22T07:46:14
C
UTF-8
C++
false
false
844
cpp
// translate with: // c++ -Wall -g dE2000_test.cpp -o dE2000_test2 icc_utils.o icc_formeln.o icc_helfer.o fl_i18n.o icc_speicher.o #include "icc_formeln.h" #include "icc_utils.h" #include "ciede2000testdata.h" int main () { DBG_PROG_START Lab quelle, ziel; double de00; for (int i = 0 ; i < cietest_; i++) { FarbeZuDouble (&quelle, &cietest[i][0]); FarbeZuDouble (&ziel, &cietest[i][3]); de00 = dE2000(quelle, ziel, 1.0,1.0,1.0); cout << i << ": " << de00 << " - " << cietest[i][6] << " = " << de00 - cietest[i][6] << endl; } quelle.L = 54.44073903; quelle.a = -34.82222743; quelle.b = 0.18986800; ziel.L = 54.92340686; ziel.a = -33.45703125; ziel.b = 0.00000000; de00 = dE2000(quelle, ziel, 1.0,1.0,1.0); cout << de00 << " - " << "Test = " << de00 << endl; DBG_PROG_ENDE return 0; }
[ "ku.b@gmx.de" ]
ku.b@gmx.de
712d63ef447aae301690b23d9ded1563f4c4684f
61c5bb077be0a7835132b3f1d6554089291e36ad
/src/compiler/code-assembler.h
d17bb9265b7f4cd5eb1d87cf8e22850d01f6dd41
[ "BSD-3-Clause", "SunPro", "bzip2-1.0.6" ]
permissive
shangfengpawan/v8
0d1c14d7417599d924763efe0acecc9a8bbc22ba
e51782d33bbdb464b3a47c5e8decc04405ddf008
refs/heads/master
2020-03-25T20:10:06.507759
2018-08-09T06:54:56
2018-08-09T06:57:49
null
0
0
null
null
null
null
UTF-8
C++
false
false
57,366
h
// Copyright 2015 the V8 project 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 V8_COMPILER_CODE_ASSEMBLER_H_ #define V8_COMPILER_CODE_ASSEMBLER_H_ #include <map> #include <memory> // Clients of this interface shouldn't depend on lots of compiler internals. // Do not include anything from src/compiler here! #include "src/allocation.h" #include "src/base/macros.h" #include "src/builtins/builtins.h" #include "src/code-factory.h" #include "src/globals.h" #include "src/heap/heap.h" #include "src/machine-type.h" #include "src/objects.h" #include "src/objects/data-handler.h" #include "src/objects/map.h" #include "src/objects/maybe-object.h" #include "src/runtime/runtime.h" #include "src/zone/zone-containers.h" namespace v8 { namespace internal { class Callable; class CallInterfaceDescriptor; class Isolate; class JSCollection; class JSRegExpStringIterator; class JSWeakCollection; class JSWeakMap; class JSWeakSet; class MaybeObject; class PromiseCapability; class PromiseFulfillReactionJobTask; class PromiseReaction; class PromiseReactionJobTask; class PromiseRejectReactionJobTask; class InterpreterData; class Factory; class Zone; template <typename T> class Signature; struct UntaggedT {}; struct IntegralT : UntaggedT {}; struct WordT : IntegralT { static const MachineRepresentation kMachineRepresentation = (kPointerSize == 4) ? MachineRepresentation::kWord32 : MachineRepresentation::kWord64; }; struct RawPtrT : WordT { static constexpr MachineType kMachineType = MachineType::Pointer(); }; template <class To> struct RawPtr : RawPtrT {}; struct Word32T : IntegralT { static const MachineRepresentation kMachineRepresentation = MachineRepresentation::kWord32; }; struct Int32T : Word32T { static constexpr MachineType kMachineType = MachineType::Int32(); }; struct Uint32T : Word32T { static constexpr MachineType kMachineType = MachineType::Uint32(); }; struct Word64T : IntegralT { static const MachineRepresentation kMachineRepresentation = MachineRepresentation::kWord64; }; struct Int64T : Word64T { static constexpr MachineType kMachineType = MachineType::Int64(); }; struct Uint64T : Word64T { static constexpr MachineType kMachineType = MachineType::Uint64(); }; struct IntPtrT : WordT { static constexpr MachineType kMachineType = MachineType::IntPtr(); }; struct UintPtrT : WordT { static constexpr MachineType kMachineType = MachineType::UintPtr(); }; struct Float32T : UntaggedT { static const MachineRepresentation kMachineRepresentation = MachineRepresentation::kFloat32; static constexpr MachineType kMachineType = MachineType::Float32(); }; struct Float64T : UntaggedT { static const MachineRepresentation kMachineRepresentation = MachineRepresentation::kFloat64; static constexpr MachineType kMachineType = MachineType::Float64(); }; // Result of a comparison operation. struct BoolT : Word32T {}; // Value type of a Turbofan node with two results. template <class T1, class T2> struct PairT {}; inline constexpr MachineType CommonMachineType(MachineType type1, MachineType type2) { return (type1 == type2) ? type1 : ((type1.IsTagged() && type2.IsTagged()) ? MachineType::AnyTagged() : MachineType::None()); } template <class Type, class Enable = void> struct MachineTypeOf { static constexpr MachineType value = Type::kMachineType; }; template <class Type, class Enable> constexpr MachineType MachineTypeOf<Type, Enable>::value; template <> struct MachineTypeOf<Object> { static constexpr MachineType value = MachineType::AnyTagged(); }; template <> struct MachineTypeOf<MaybeObject> { static constexpr MachineType value = MachineType::AnyTagged(); }; template <> struct MachineTypeOf<Smi> { static constexpr MachineType value = MachineType::TaggedSigned(); }; template <class HeapObjectSubtype> struct MachineTypeOf<HeapObjectSubtype, typename std::enable_if<std::is_base_of< HeapObject, HeapObjectSubtype>::value>::type> { static constexpr MachineType value = MachineType::TaggedPointer(); }; template <class HeapObjectSubtype> constexpr MachineType MachineTypeOf< HeapObjectSubtype, typename std::enable_if<std::is_base_of< HeapObject, HeapObjectSubtype>::value>::type>::value; template <class Type, class Enable = void> struct MachineRepresentationOf { static const MachineRepresentation value = Type::kMachineRepresentation; }; template <class T> struct MachineRepresentationOf< T, typename std::enable_if<std::is_base_of<Object, T>::value>::type> { static const MachineRepresentation value = MachineTypeOf<T>::value.representation(); }; template <class T> struct MachineRepresentationOf< T, typename std::enable_if<std::is_base_of<MaybeObject, T>::value>::type> { static const MachineRepresentation value = MachineTypeOf<T>::value.representation(); }; template <class T> struct is_valid_type_tag { static const bool value = std::is_base_of<Object, T>::value || std::is_base_of<UntaggedT, T>::value || std::is_base_of<MaybeObject, T>::value || std::is_same<ExternalReference, T>::value; static const bool is_tagged = std::is_base_of<Object, T>::value || std::is_base_of<MaybeObject, T>::value; }; template <class T1, class T2> struct is_valid_type_tag<PairT<T1, T2>> { static const bool value = is_valid_type_tag<T1>::value && is_valid_type_tag<T2>::value; static const bool is_tagged = false; }; template <class T1, class T2> struct UnionT; template <class T1, class T2> struct is_valid_type_tag<UnionT<T1, T2>> { static const bool is_tagged = is_valid_type_tag<T1>::is_tagged && is_valid_type_tag<T2>::is_tagged; static const bool value = is_tagged; }; template <class T1, class T2> struct UnionT { static constexpr MachineType kMachineType = CommonMachineType(MachineTypeOf<T1>::value, MachineTypeOf<T2>::value); static const MachineRepresentation kMachineRepresentation = kMachineType.representation(); static_assert(kMachineRepresentation != MachineRepresentation::kNone, "no common representation"); static_assert(is_valid_type_tag<T1>::is_tagged && is_valid_type_tag<T2>::is_tagged, "union types are only possible for tagged values"); }; using Number = UnionT<Smi, HeapNumber>; using Numeric = UnionT<Number, BigInt>; #define ENUM_ELEMENT(Name) k##Name, #define ENUM_STRUCT_ELEMENT(NAME, Name, name) k##Name, enum class ObjectType { kObject, OBJECT_TYPE_LIST(ENUM_ELEMENT) HEAP_OBJECT_TYPE_LIST(ENUM_ELEMENT) STRUCT_LIST(ENUM_STRUCT_ELEMENT) }; #undef ENUM_ELEMENT #undef ENUM_STRUCT_ELEMENT class AccessCheckNeeded; class BigIntWrapper; class ClassBoilerplate; class BooleanWrapper; class CompilationCacheTable; class Constructor; class Filler; class InternalizedString; class JSArgumentsObject; class JSContextExtensionObject; class JSError; class JSSloppyArgumentsObject; class MapCache; class MutableHeapNumber; class NativeContext; class NumberWrapper; class ScriptWrapper; class SloppyArgumentsElements; class StringWrapper; class SymbolWrapper; class Undetectable; class UniqueName; class WasmExportedFunctionData; class WasmGlobalObject; class WasmMemoryObject; class WasmModuleObject; class WasmTableObject; template <class T> struct ObjectTypeOf {}; #define OBJECT_TYPE_CASE(Name) \ template <> \ struct ObjectTypeOf<Name> { \ static const ObjectType value = ObjectType::k##Name; \ }; #define OBJECT_TYPE_STRUCT_CASE(NAME, Name, name) \ template <> \ struct ObjectTypeOf<Name> { \ static const ObjectType value = ObjectType::k##Name; \ }; #define OBJECT_TYPE_TEMPLATE_CASE(Name) \ template <class... Args> \ struct ObjectTypeOf<Name<Args...>> { \ static const ObjectType value = ObjectType::k##Name; \ }; OBJECT_TYPE_CASE(Object) OBJECT_TYPE_LIST(OBJECT_TYPE_CASE) HEAP_OBJECT_ORDINARY_TYPE_LIST(OBJECT_TYPE_CASE) STRUCT_LIST(OBJECT_TYPE_STRUCT_CASE) HEAP_OBJECT_TEMPLATE_TYPE_LIST(OBJECT_TYPE_TEMPLATE_CASE) #undef OBJECT_TYPE_CASE #undef OBJECT_TYPE_STRUCT_CASE #undef OBJECT_TYPE_TEMPLATE_CASE Smi* CheckObjectType(Object* value, Smi* type, String* location); namespace compiler { class CallDescriptor; class CodeAssemblerLabel; class CodeAssemblerVariable; template <class T> class TypedCodeAssemblerVariable; class CodeAssemblerState; class Node; class RawMachineAssembler; class RawMachineLabel; typedef ZoneVector<CodeAssemblerVariable*> CodeAssemblerVariableList; typedef std::function<void()> CodeAssemblerCallback; template <class T, class U> struct is_subtype { static const bool value = std::is_base_of<U, T>::value; }; template <class T1, class T2, class U> struct is_subtype<UnionT<T1, T2>, U> { static const bool value = is_subtype<T1, U>::value && is_subtype<T2, U>::value; }; template <class T, class U1, class U2> struct is_subtype<T, UnionT<U1, U2>> { static const bool value = is_subtype<T, U1>::value || is_subtype<T, U2>::value; }; template <class T1, class T2, class U1, class U2> struct is_subtype<UnionT<T1, T2>, UnionT<U1, U2>> { static const bool value = (is_subtype<T1, U1>::value || is_subtype<T1, U2>::value) && (is_subtype<T2, U1>::value || is_subtype<T2, U2>::value); }; template <class T, class U> struct types_have_common_values { static const bool value = is_subtype<T, U>::value || is_subtype<U, T>::value; }; template <class U> struct types_have_common_values<Uint32T, U> { static const bool value = types_have_common_values<Word32T, U>::value; }; template <class U> struct types_have_common_values<Int32T, U> { static const bool value = types_have_common_values<Word32T, U>::value; }; template <class U> struct types_have_common_values<Uint64T, U> { static const bool value = types_have_common_values<Word64T, U>::value; }; template <class U> struct types_have_common_values<Int64T, U> { static const bool value = types_have_common_values<Word64T, U>::value; }; template <class U> struct types_have_common_values<IntPtrT, U> { static const bool value = types_have_common_values<WordT, U>::value; }; template <class U> struct types_have_common_values<UintPtrT, U> { static const bool value = types_have_common_values<WordT, U>::value; }; template <class T1, class T2, class U> struct types_have_common_values<UnionT<T1, T2>, U> { static const bool value = types_have_common_values<T1, U>::value || types_have_common_values<T2, U>::value; }; template <class T, class U1, class U2> struct types_have_common_values<T, UnionT<U1, U2>> { static const bool value = types_have_common_values<T, U1>::value || types_have_common_values<T, U2>::value; }; template <class T1, class T2, class U1, class U2> struct types_have_common_values<UnionT<T1, T2>, UnionT<U1, U2>> { static const bool value = types_have_common_values<T1, U1>::value || types_have_common_values<T1, U2>::value || types_have_common_values<T2, U1>::value || types_have_common_values<T2, U2>::value; }; template <class T> struct types_have_common_values<T, MaybeObject> { static const bool value = types_have_common_values<T, Object>::value; }; template <class T> struct types_have_common_values<MaybeObject, T> { static const bool value = types_have_common_values<Object, T>::value; }; // TNode<T> is an SSA value with the static type tag T, which is one of the // following: // - a subclass of internal::Object represents a tagged type // - a subclass of internal::UntaggedT represents an untagged type // - ExternalReference // - PairT<T1, T2> for an operation returning two values, with types T1 // and T2 // - UnionT<T1, T2> represents either a value of type T1 or of type T2. template <class T> class TNode { public: static_assert(is_valid_type_tag<T>::value, "invalid type tag"); template <class U, typename std::enable_if<is_subtype<U, T>::value, int>::type = 0> TNode(const TNode<U>& other) : node_(other) {} TNode() : node_(nullptr) {} TNode operator=(TNode other) { DCHECK_NOT_NULL(other.node_); node_ = other.node_; return *this; } operator compiler::Node*() const { return node_; } static TNode UncheckedCast(compiler::Node* node) { return TNode(node); } protected: explicit TNode(compiler::Node* node) : node_(node) {} private: compiler::Node* node_; }; // SloppyTNode<T> is a variant of TNode<T> and allows implicit casts from // Node*. It is intended for function arguments as long as some call sites // still use untyped Node* arguments. // TODO(tebbi): Delete this class once transition is finished. template <class T> class SloppyTNode : public TNode<T> { public: SloppyTNode(compiler::Node* node) // NOLINT(runtime/explicit) : TNode<T>(node) {} template <class U, typename std::enable_if<is_subtype<U, T>::value, int>::type = 0> SloppyTNode(const TNode<U>& other) // NOLINT(runtime/explicit) : TNode<T>(other) {} }; // This macro alias allows to use PairT<T1, T2> as a macro argument. #define PAIR_TYPE(T1, T2) PairT<T1, T2> #define CODE_ASSEMBLER_COMPARE_BINARY_OP_LIST(V) \ V(Float32Equal, BoolT, Float32T, Float32T) \ V(Float32LessThan, BoolT, Float32T, Float32T) \ V(Float32LessThanOrEqual, BoolT, Float32T, Float32T) \ V(Float32GreaterThan, BoolT, Float32T, Float32T) \ V(Float32GreaterThanOrEqual, BoolT, Float32T, Float32T) \ V(Float64Equal, BoolT, Float64T, Float64T) \ V(Float64NotEqual, BoolT, Float64T, Float64T) \ V(Float64LessThan, BoolT, Float64T, Float64T) \ V(Float64LessThanOrEqual, BoolT, Float64T, Float64T) \ V(Float64GreaterThan, BoolT, Float64T, Float64T) \ V(Float64GreaterThanOrEqual, BoolT, Float64T, Float64T) \ /* Use Word32Equal if you need Int32Equal */ \ V(Int32GreaterThan, BoolT, Word32T, Word32T) \ V(Int32GreaterThanOrEqual, BoolT, Word32T, Word32T) \ V(Int32LessThan, BoolT, Word32T, Word32T) \ V(Int32LessThanOrEqual, BoolT, Word32T, Word32T) \ /* Use WordEqual if you need IntPtrEqual */ \ V(IntPtrLessThan, BoolT, WordT, WordT) \ V(IntPtrLessThanOrEqual, BoolT, WordT, WordT) \ V(IntPtrGreaterThan, BoolT, WordT, WordT) \ V(IntPtrGreaterThanOrEqual, BoolT, WordT, WordT) \ /* Use Word32Equal if you need Uint32Equal */ \ V(Uint32LessThan, BoolT, Word32T, Word32T) \ V(Uint32LessThanOrEqual, BoolT, Word32T, Word32T) \ V(Uint32GreaterThan, BoolT, Word32T, Word32T) \ V(Uint32GreaterThanOrEqual, BoolT, Word32T, Word32T) \ /* Use WordEqual if you need UintPtrEqual */ \ V(UintPtrLessThan, BoolT, WordT, WordT) \ V(UintPtrLessThanOrEqual, BoolT, WordT, WordT) \ V(UintPtrGreaterThan, BoolT, WordT, WordT) \ V(UintPtrGreaterThanOrEqual, BoolT, WordT, WordT) #define CODE_ASSEMBLER_BINARY_OP_LIST(V) \ CODE_ASSEMBLER_COMPARE_BINARY_OP_LIST(V) \ V(Float64Add, Float64T, Float64T, Float64T) \ V(Float64Sub, Float64T, Float64T, Float64T) \ V(Float64Mul, Float64T, Float64T, Float64T) \ V(Float64Div, Float64T, Float64T, Float64T) \ V(Float64Mod, Float64T, Float64T, Float64T) \ V(Float64Atan2, Float64T, Float64T, Float64T) \ V(Float64Pow, Float64T, Float64T, Float64T) \ V(Float64Max, Float64T, Float64T, Float64T) \ V(Float64Min, Float64T, Float64T, Float64T) \ V(Float64InsertLowWord32, Float64T, Float64T, Word32T) \ V(Float64InsertHighWord32, Float64T, Float64T, Word32T) \ V(IntPtrAddWithOverflow, PAIR_TYPE(IntPtrT, BoolT), IntPtrT, IntPtrT) \ V(IntPtrSubWithOverflow, PAIR_TYPE(IntPtrT, BoolT), IntPtrT, IntPtrT) \ V(Int32Add, Word32T, Word32T, Word32T) \ V(Int32AddWithOverflow, PAIR_TYPE(Int32T, BoolT), Int32T, Int32T) \ V(Int32Sub, Word32T, Word32T, Word32T) \ V(Int32SubWithOverflow, PAIR_TYPE(Int32T, BoolT), Int32T, Int32T) \ V(Int32Mul, Word32T, Word32T, Word32T) \ V(Int32MulWithOverflow, PAIR_TYPE(Int32T, BoolT), Int32T, Int32T) \ V(Int32Div, Int32T, Int32T, Int32T) \ V(Int32Mod, Int32T, Int32T, Int32T) \ V(WordRor, WordT, WordT, IntegralT) \ V(Word32Ror, Word32T, Word32T, Word32T) \ V(Word64Ror, Word64T, Word64T, Word64T) TNode<Float64T> Float64Add(TNode<Float64T> a, TNode<Float64T> b); #define CODE_ASSEMBLER_UNARY_OP_LIST(V) \ V(Float64Abs, Float64T, Float64T) \ V(Float64Acos, Float64T, Float64T) \ V(Float64Acosh, Float64T, Float64T) \ V(Float64Asin, Float64T, Float64T) \ V(Float64Asinh, Float64T, Float64T) \ V(Float64Atan, Float64T, Float64T) \ V(Float64Atanh, Float64T, Float64T) \ V(Float64Cos, Float64T, Float64T) \ V(Float64Cosh, Float64T, Float64T) \ V(Float64Exp, Float64T, Float64T) \ V(Float64Expm1, Float64T, Float64T) \ V(Float64Log, Float64T, Float64T) \ V(Float64Log1p, Float64T, Float64T) \ V(Float64Log2, Float64T, Float64T) \ V(Float64Log10, Float64T, Float64T) \ V(Float64Cbrt, Float64T, Float64T) \ V(Float64Neg, Float64T, Float64T) \ V(Float64Sin, Float64T, Float64T) \ V(Float64Sinh, Float64T, Float64T) \ V(Float64Sqrt, Float64T, Float64T) \ V(Float64Tan, Float64T, Float64T) \ V(Float64Tanh, Float64T, Float64T) \ V(Float64ExtractLowWord32, Word32T, Float64T) \ V(Float64ExtractHighWord32, Word32T, Float64T) \ V(BitcastTaggedToWord, IntPtrT, Object) \ V(BitcastMaybeObjectToWord, IntPtrT, MaybeObject) \ V(BitcastWordToTagged, Object, WordT) \ V(BitcastWordToTaggedSigned, Smi, WordT) \ V(TruncateFloat64ToFloat32, Float32T, Float64T) \ V(TruncateFloat64ToWord32, Word32T, Float64T) \ V(TruncateInt64ToInt32, Int32T, Int64T) \ V(ChangeFloat32ToFloat64, Float64T, Float32T) \ V(ChangeFloat64ToUint32, Uint32T, Float64T) \ V(ChangeFloat64ToUint64, Uint64T, Float64T) \ V(ChangeInt32ToFloat64, Float64T, Int32T) \ V(ChangeInt32ToInt64, Int64T, Int32T) \ V(ChangeUint32ToFloat64, Float64T, Word32T) \ V(ChangeUint32ToUint64, Uint64T, Word32T) \ V(BitcastInt32ToFloat32, Float32T, Word32T) \ V(BitcastFloat32ToInt32, Word32T, Float32T) \ V(RoundFloat64ToInt32, Int32T, Float64T) \ V(RoundInt32ToFloat32, Int32T, Float32T) \ V(Float64SilenceNaN, Float64T, Float64T) \ V(Float64RoundDown, Float64T, Float64T) \ V(Float64RoundUp, Float64T, Float64T) \ V(Float64RoundTiesEven, Float64T, Float64T) \ V(Float64RoundTruncate, Float64T, Float64T) \ V(Word32Clz, Int32T, Word32T) \ V(Word32Not, Word32T, Word32T) \ V(WordNot, WordT, WordT) \ V(Int32AbsWithOverflow, PAIR_TYPE(Int32T, BoolT), Int32T) \ V(Int64AbsWithOverflow, PAIR_TYPE(Int64T, BoolT), Int64T) \ V(IntPtrAbsWithOverflow, PAIR_TYPE(IntPtrT, BoolT), IntPtrT) \ V(Word32BinaryNot, Word32T, Word32T) // A "public" interface used by components outside of compiler directory to // create code objects with TurboFan's backend. This class is mostly a thin // shim around the RawMachineAssembler, and its primary job is to ensure that // the innards of the RawMachineAssembler and other compiler implementation // details don't leak outside of the the compiler directory.. // // V8 components that need to generate low-level code using this interface // should include this header--and this header only--from the compiler // directory (this is actually enforced). Since all interesting data // structures are forward declared, it's not possible for clients to peek // inside the compiler internals. // // In addition to providing isolation between TurboFan and code generation // clients, CodeAssembler also provides an abstraction for creating variables // and enhanced Label functionality to merge variable values along paths where // they have differing values, including loops. // // The CodeAssembler itself is stateless (and instances are expected to be // temporary-scoped and short-lived); all its state is encapsulated into // a CodeAssemblerState instance. class V8_EXPORT_PRIVATE CodeAssembler { public: explicit CodeAssembler(CodeAssemblerState* state) : state_(state) {} ~CodeAssembler(); static Handle<Code> GenerateCode(CodeAssemblerState* state, const AssemblerOptions& options); bool Is64() const; bool IsFloat64RoundUpSupported() const; bool IsFloat64RoundDownSupported() const; bool IsFloat64RoundTiesEvenSupported() const; bool IsFloat64RoundTruncateSupported() const; bool IsInt32AbsWithOverflowSupported() const; bool IsInt64AbsWithOverflowSupported() const; bool IsIntPtrAbsWithOverflowSupported() const; // Shortened aliases for use in CodeAssembler subclasses. using Label = CodeAssemblerLabel; using Variable = CodeAssemblerVariable; template <class T> using TVariable = TypedCodeAssemblerVariable<T>; using VariableList = CodeAssemblerVariableList; // =========================================================================== // Base Assembler // =========================================================================== template <class PreviousType, bool FromTyped> class CheckedNode { public: #ifdef DEBUG CheckedNode(Node* node, CodeAssembler* code_assembler, const char* location) : node_(node), code_assembler_(code_assembler), location_(location) {} #else CheckedNode(compiler::Node* node, CodeAssembler*, const char*) : node_(node) {} #endif template <class A> operator TNode<A>() { static_assert( !std::is_same<A, MaybeObject>::value, "Can't cast to MaybeObject, use explicit conversion functions. "); static_assert(types_have_common_values<A, PreviousType>::value, "Incompatible types: this cast can never succeed."); static_assert(std::is_convertible<TNode<A>, TNode<Object>>::value, "Coercion to untagged values cannot be " "checked."); static_assert( !FromTyped || !std::is_convertible<TNode<PreviousType>, TNode<A>>::value, "Unnecessary CAST: types are convertible."); #ifdef DEBUG if (FLAG_debug_code) { if (std::is_same<PreviousType, MaybeObject>::value) { code_assembler_->GenerateCheckMaybeObjectIsObject(node_, location_); } Node* function = code_assembler_->ExternalConstant( ExternalReference::check_object_type()); code_assembler_->CallCFunction3( MachineType::AnyTagged(), MachineType::AnyTagged(), MachineType::TaggedSigned(), MachineType::AnyTagged(), function, node_, code_assembler_->SmiConstant( static_cast<int>(ObjectTypeOf<A>::value)), code_assembler_->StringConstant(location_)); } #endif return TNode<A>::UncheckedCast(node_); } template <class A> operator SloppyTNode<A>() { return implicit_cast<TNode<A>>(*this); } Node* node() const { return node_; } private: Node* node_; #ifdef DEBUG CodeAssembler* code_assembler_; const char* location_; #endif }; template <class T> TNode<T> UncheckedCast(Node* value) { return TNode<T>::UncheckedCast(value); } template <class T, class U> TNode<T> UncheckedCast(TNode<U> value) { static_assert(types_have_common_values<T, U>::value, "Incompatible types: this cast can never succeed."); return TNode<T>::UncheckedCast(value); } // ReinterpretCast<T>(v) has the power to cast even when the type of v is // unrelated to T. Use with care. template <class T> TNode<T> ReinterpretCast(Node* value) { return TNode<T>::UncheckedCast(value); } CheckedNode<Object, false> Cast(Node* value, const char* location = "") { return {value, this, location}; } template <class T> CheckedNode<T, true> Cast(TNode<T> value, const char* location = "") { return {value, this, location}; } #ifdef DEBUG #define STRINGIFY(x) #x #define TO_STRING_LITERAL(x) STRINGIFY(x) #define CAST(x) \ Cast(x, "CAST(" #x ") at " __FILE__ ":" TO_STRING_LITERAL(__LINE__)) #else #define CAST(x) Cast(x) #endif #ifdef DEBUG void GenerateCheckMaybeObjectIsObject(Node* node, const char* location); #endif // Constants. TNode<Int32T> Int32Constant(int32_t value); TNode<Int64T> Int64Constant(int64_t value); TNode<IntPtrT> IntPtrConstant(intptr_t value); TNode<Number> NumberConstant(double value); TNode<Smi> SmiConstant(Smi* value); TNode<Smi> SmiConstant(int value); template <typename E, typename = typename std::enable_if<std::is_enum<E>::value>::type> TNode<Smi> SmiConstant(E value) { STATIC_ASSERT(sizeof(E) <= sizeof(int)); return SmiConstant(static_cast<int>(value)); } TNode<HeapObject> UntypedHeapConstant(Handle<HeapObject> object); template <class Type> TNode<Type> HeapConstant(Handle<Type> object) { return UncheckedCast<Type>(UntypedHeapConstant(object)); } TNode<String> StringConstant(const char* str); TNode<Oddball> BooleanConstant(bool value); TNode<ExternalReference> ExternalConstant(ExternalReference address); TNode<Float64T> Float64Constant(double value); TNode<HeapNumber> NaNConstant(); TNode<BoolT> Int32TrueConstant() { return ReinterpretCast<BoolT>(Int32Constant(1)); } TNode<BoolT> Int32FalseConstant() { return ReinterpretCast<BoolT>(Int32Constant(0)); } TNode<BoolT> BoolConstant(bool value) { return value ? Int32TrueConstant() : Int32FalseConstant(); } bool ToInt32Constant(Node* node, int32_t& out_value); bool ToInt64Constant(Node* node, int64_t& out_value); bool ToSmiConstant(Node* node, Smi*& out_value); bool ToIntPtrConstant(Node* node, intptr_t& out_value); bool IsUndefinedConstant(TNode<Object> node); bool IsNullConstant(TNode<Object> node); TNode<Int32T> Signed(TNode<Word32T> x) { return UncheckedCast<Int32T>(x); } TNode<IntPtrT> Signed(TNode<WordT> x) { return UncheckedCast<IntPtrT>(x); } TNode<Uint32T> Unsigned(TNode<Word32T> x) { return UncheckedCast<Uint32T>(x); } TNode<UintPtrT> Unsigned(TNode<WordT> x) { return UncheckedCast<UintPtrT>(x); } static constexpr int kTargetParameterIndex = -1; Node* Parameter(int value); TNode<Context> GetJSContextParameter(); void Return(SloppyTNode<Object> value); void Return(SloppyTNode<Object> value1, SloppyTNode<Object> value2); void Return(SloppyTNode<Object> value1, SloppyTNode<Object> value2, SloppyTNode<Object> value3); void PopAndReturn(Node* pop, Node* value); void ReturnIf(Node* condition, Node* value); void ReturnRaw(Node* value); void DebugAbort(Node* message); void DebugBreak(); void Unreachable(); void Comment(const char* format, ...); void Bind(Label* label); #if DEBUG void Bind(Label* label, AssemblerDebugInfo debug_info); #endif // DEBUG void Goto(Label* label); void GotoIf(SloppyTNode<IntegralT> condition, Label* true_label); void GotoIfNot(SloppyTNode<IntegralT> condition, Label* false_label); void Branch(SloppyTNode<IntegralT> condition, Label* true_label, Label* false_label); void Switch(Node* index, Label* default_label, const int32_t* case_values, Label** case_labels, size_t case_count); // Access to the frame pointer Node* LoadFramePointer(); Node* LoadParentFramePointer(); // Access to the stack pointer Node* LoadStackPointer(); // Poison |value| on speculative paths. TNode<Object> TaggedPoisonOnSpeculation(SloppyTNode<Object> value); TNode<WordT> WordPoisonOnSpeculation(SloppyTNode<WordT> value); // Load raw memory location. Node* Load(MachineType rep, Node* base, LoadSensitivity needs_poisoning = LoadSensitivity::kSafe); template <class Type> TNode<Type> Load(MachineType rep, TNode<RawPtr<Type>> base) { DCHECK( IsSubtype(rep.representation(), MachineRepresentationOf<Type>::value)); return UncheckedCast<Type>(Load(rep, static_cast<Node*>(base))); } Node* Load(MachineType rep, Node* base, Node* offset, LoadSensitivity needs_poisoning = LoadSensitivity::kSafe); Node* AtomicLoad(MachineType rep, Node* base, Node* offset); // Load a value from the root array. TNode<Object> LoadRoot(Heap::RootListIndex root_index); // Store value to raw memory location. Node* Store(Node* base, Node* value); Node* Store(Node* base, Node* offset, Node* value); Node* StoreWithMapWriteBarrier(Node* base, Node* offset, Node* value); Node* StoreNoWriteBarrier(MachineRepresentation rep, Node* base, Node* value); Node* StoreNoWriteBarrier(MachineRepresentation rep, Node* base, Node* offset, Node* value); Node* AtomicStore(MachineRepresentation rep, Node* base, Node* offset, Node* value); // Exchange value at raw memory location Node* AtomicExchange(MachineType type, Node* base, Node* offset, Node* value); // Compare and Exchange value at raw memory location Node* AtomicCompareExchange(MachineType type, Node* base, Node* offset, Node* old_value, Node* new_value); Node* AtomicAdd(MachineType type, Node* base, Node* offset, Node* value); Node* AtomicSub(MachineType type, Node* base, Node* offset, Node* value); Node* AtomicAnd(MachineType type, Node* base, Node* offset, Node* value); Node* AtomicOr(MachineType type, Node* base, Node* offset, Node* value); Node* AtomicXor(MachineType type, Node* base, Node* offset, Node* value); // Store a value to the root array. Node* StoreRoot(Heap::RootListIndex root_index, Node* value); // Basic arithmetic operations. #define DECLARE_CODE_ASSEMBLER_BINARY_OP(name, ResType, Arg1Type, Arg2Type) \ TNode<ResType> name(SloppyTNode<Arg1Type> a, SloppyTNode<Arg2Type> b); CODE_ASSEMBLER_BINARY_OP_LIST(DECLARE_CODE_ASSEMBLER_BINARY_OP) #undef DECLARE_CODE_ASSEMBLER_BINARY_OP TNode<IntPtrT> WordShr(TNode<IntPtrT> left, TNode<IntegralT> right) { return UncheckedCast<IntPtrT>( WordShr(static_cast<Node*>(left), static_cast<Node*>(right))); } TNode<IntPtrT> WordAnd(TNode<IntPtrT> left, TNode<IntPtrT> right) { return UncheckedCast<IntPtrT>( WordAnd(static_cast<Node*>(left), static_cast<Node*>(right))); } template <class Left, class Right, class = typename std::enable_if< std::is_base_of<Object, Left>::value && std::is_base_of<Object, Right>::value>::type> TNode<BoolT> WordEqual(TNode<Left> left, TNode<Right> right) { return WordEqual(ReinterpretCast<WordT>(left), ReinterpretCast<WordT>(right)); } TNode<BoolT> WordEqual(TNode<Object> left, Node* right) { return WordEqual(ReinterpretCast<WordT>(left), ReinterpretCast<WordT>(right)); } TNode<BoolT> WordEqual(Node* left, TNode<Object> right) { return WordEqual(ReinterpretCast<WordT>(left), ReinterpretCast<WordT>(right)); } template <class Left, class Right, class = typename std::enable_if< std::is_base_of<Object, Left>::value && std::is_base_of<Object, Right>::value>::type> TNode<BoolT> WordNotEqual(TNode<Left> left, TNode<Right> right) { return WordNotEqual(ReinterpretCast<WordT>(left), ReinterpretCast<WordT>(right)); } TNode<BoolT> WordNotEqual(TNode<Object> left, Node* right) { return WordNotEqual(ReinterpretCast<WordT>(left), ReinterpretCast<WordT>(right)); } TNode<BoolT> WordNotEqual(Node* left, TNode<Object> right) { return WordNotEqual(ReinterpretCast<WordT>(left), ReinterpretCast<WordT>(right)); } TNode<BoolT> IntPtrEqual(SloppyTNode<WordT> left, SloppyTNode<WordT> right); TNode<BoolT> WordEqual(SloppyTNode<WordT> left, SloppyTNode<WordT> right); TNode<BoolT> WordNotEqual(SloppyTNode<WordT> left, SloppyTNode<WordT> right); TNode<BoolT> Word32Equal(SloppyTNode<Word32T> left, SloppyTNode<Word32T> right); TNode<BoolT> Word32NotEqual(SloppyTNode<Word32T> left, SloppyTNode<Word32T> right); TNode<BoolT> Word64Equal(SloppyTNode<Word64T> left, SloppyTNode<Word64T> right); TNode<BoolT> Word64NotEqual(SloppyTNode<Word64T> left, SloppyTNode<Word64T> right); TNode<Int32T> Int32Add(TNode<Int32T> left, TNode<Int32T> right) { return Signed( Int32Add(static_cast<Node*>(left), static_cast<Node*>(right))); } TNode<WordT> IntPtrAdd(SloppyTNode<WordT> left, SloppyTNode<WordT> right); TNode<WordT> IntPtrSub(SloppyTNode<WordT> left, SloppyTNode<WordT> right); TNode<WordT> IntPtrMul(SloppyTNode<WordT> left, SloppyTNode<WordT> right); TNode<IntPtrT> IntPtrAdd(TNode<IntPtrT> left, TNode<IntPtrT> right) { return Signed( IntPtrAdd(static_cast<Node*>(left), static_cast<Node*>(right))); } TNode<IntPtrT> IntPtrSub(TNode<IntPtrT> left, TNode<IntPtrT> right) { return Signed( IntPtrSub(static_cast<Node*>(left), static_cast<Node*>(right))); } TNode<IntPtrT> IntPtrMul(TNode<IntPtrT> left, TNode<IntPtrT> right) { return Signed( IntPtrMul(static_cast<Node*>(left), static_cast<Node*>(right))); } TNode<WordT> WordShl(SloppyTNode<WordT> value, int shift); TNode<WordT> WordShr(SloppyTNode<WordT> value, int shift); TNode<WordT> WordSar(SloppyTNode<WordT> value, int shift); TNode<IntPtrT> WordShr(TNode<IntPtrT> value, int shift) { return UncheckedCast<IntPtrT>(WordShr(static_cast<Node*>(value), shift)); } TNode<Word32T> Word32Shr(SloppyTNode<Word32T> value, int shift); TNode<WordT> WordOr(SloppyTNode<WordT> left, SloppyTNode<WordT> right); TNode<WordT> WordAnd(SloppyTNode<WordT> left, SloppyTNode<WordT> right); TNode<WordT> WordXor(SloppyTNode<WordT> left, SloppyTNode<WordT> right); TNode<WordT> WordShl(SloppyTNode<WordT> left, SloppyTNode<IntegralT> right); TNode<WordT> WordShr(SloppyTNode<WordT> left, SloppyTNode<IntegralT> right); TNode<WordT> WordSar(SloppyTNode<WordT> left, SloppyTNode<IntegralT> right); TNode<Word32T> Word32Or(SloppyTNode<Word32T> left, SloppyTNode<Word32T> right); TNode<Word32T> Word32And(SloppyTNode<Word32T> left, SloppyTNode<Word32T> right); TNode<Word32T> Word32Xor(SloppyTNode<Word32T> left, SloppyTNode<Word32T> right); TNode<Word32T> Word32Shl(SloppyTNode<Word32T> left, SloppyTNode<Word32T> right); TNode<Word32T> Word32Shr(SloppyTNode<Word32T> left, SloppyTNode<Word32T> right); TNode<Word32T> Word32Sar(SloppyTNode<Word32T> left, SloppyTNode<Word32T> right); TNode<Word64T> Word64Or(SloppyTNode<Word64T> left, SloppyTNode<Word64T> right); TNode<Word64T> Word64And(SloppyTNode<Word64T> left, SloppyTNode<Word64T> right); TNode<Word64T> Word64Xor(SloppyTNode<Word64T> left, SloppyTNode<Word64T> right); TNode<Word64T> Word64Shl(SloppyTNode<Word64T> left, SloppyTNode<Word64T> right); TNode<Word64T> Word64Shr(SloppyTNode<Word64T> left, SloppyTNode<Word64T> right); TNode<Word64T> Word64Sar(SloppyTNode<Word64T> left, SloppyTNode<Word64T> right); // Unary #define DECLARE_CODE_ASSEMBLER_UNARY_OP(name, ResType, ArgType) \ TNode<ResType> name(SloppyTNode<ArgType> a); CODE_ASSEMBLER_UNARY_OP_LIST(DECLARE_CODE_ASSEMBLER_UNARY_OP) #undef DECLARE_CODE_ASSEMBLER_UNARY_OP // Changes a double to an inptr_t for pointer arithmetic outside of Smi range. // Assumes that the double can be exactly represented as an int. TNode<UintPtrT> ChangeFloat64ToUintPtr(SloppyTNode<Float64T> value); // Changes an intptr_t to a double, e.g. for storing an element index // outside Smi range in a HeapNumber. Lossless on 32-bit, // rounds on 64-bit (which doesn't affect valid element indices). Node* RoundIntPtrToFloat64(Node* value); // No-op on 32-bit, otherwise zero extend. TNode<UintPtrT> ChangeUint32ToWord(SloppyTNode<Word32T> value); // No-op on 32-bit, otherwise sign extend. TNode<IntPtrT> ChangeInt32ToIntPtr(SloppyTNode<Word32T> value); // No-op that guarantees that the value is kept alive till this point even // if GC happens. Node* Retain(Node* value); // Projections Node* Projection(int index, Node* value); template <int index, class T1, class T2> TNode<typename std::tuple_element<index, std::tuple<T1, T2>>::type> Projection(TNode<PairT<T1, T2>> value) { return UncheckedCast< typename std::tuple_element<index, std::tuple<T1, T2>>::type>( Projection(index, value)); } // Calls template <class... TArgs> TNode<Object> CallRuntime(Runtime::FunctionId function, SloppyTNode<Object> context, TArgs... args) { return CallRuntimeImpl(function, context, {implicit_cast<SloppyTNode<Object>>(args)...}); } template <class... TArgs> TNode<Object> CallRuntimeWithCEntry(Runtime::FunctionId function, TNode<Code> centry, SloppyTNode<Object> context, TArgs... args) { return CallRuntimeWithCEntryImpl(function, centry, context, {args...}); } template <class... TArgs> void TailCallRuntime(Runtime::FunctionId function, SloppyTNode<Object> context, TArgs... args) { int argc = static_cast<int>(sizeof...(args)); TNode<Int32T> arity = Int32Constant(argc); return TailCallRuntimeImpl(function, arity, context, {implicit_cast<SloppyTNode<Object>>(args)...}); } template <class... TArgs> void TailCallRuntime(Runtime::FunctionId function, TNode<Int32T> arity, SloppyTNode<Object> context, TArgs... args) { return TailCallRuntimeImpl(function, arity, context, {implicit_cast<SloppyTNode<Object>>(args)...}); } template <class... TArgs> void TailCallRuntimeWithCEntry(Runtime::FunctionId function, TNode<Code> centry, TNode<Object> context, TArgs... args) { int argc = sizeof...(args); TNode<Int32T> arity = Int32Constant(argc); return TailCallRuntimeWithCEntryImpl( function, arity, centry, context, {implicit_cast<SloppyTNode<Object>>(args)...}); } // // If context passed to CallStub is nullptr, it won't be passed to the stub. // template <class T = Object, class... TArgs> TNode<T> CallStub(Callable const& callable, SloppyTNode<Object> context, TArgs... args) { TNode<Code> target = HeapConstant(callable.code()); return CallStub<T>(callable.descriptor(), target, context, args...); } template <class T = Object, class... TArgs> TNode<T> CallStub(const CallInterfaceDescriptor& descriptor, SloppyTNode<Code> target, SloppyTNode<Object> context, TArgs... args) { return UncheckedCast<T>(CallStubR(descriptor, 1, target, context, args...)); } template <class... TArgs> Node* CallStubR(const CallInterfaceDescriptor& descriptor, size_t result_size, SloppyTNode<Code> target, SloppyTNode<Object> context, TArgs... args) { return CallStubRImpl(descriptor, result_size, target, context, {args...}); } Node* CallStubN(const CallInterfaceDescriptor& descriptor, size_t result_size, int input_count, Node* const* inputs); template <class... TArgs> void TailCallStub(Callable const& callable, SloppyTNode<Object> context, TArgs... args) { TNode<Code> target = HeapConstant(callable.code()); return TailCallStub(callable.descriptor(), target, context, args...); } template <class... TArgs> void TailCallStub(const CallInterfaceDescriptor& descriptor, SloppyTNode<Code> target, SloppyTNode<Object> context, TArgs... args) { return TailCallStubImpl(descriptor, target, context, {args...}); } template <class... TArgs> Node* TailCallBytecodeDispatch(const CallInterfaceDescriptor& descriptor, Node* target, TArgs... args); template <class... TArgs> Node* TailCallStubThenBytecodeDispatch( const CallInterfaceDescriptor& descriptor, Node* target, Node* context, TArgs... args) { return TailCallStubThenBytecodeDispatchImpl(descriptor, target, context, {args...}); } // Tailcalls to the given code object with JSCall linkage. The JS arguments // (including receiver) are supposed to be already on the stack. // This is a building block for implementing trampoline stubs that are // installed instead of code objects with JSCall linkage. // Note that no arguments adaption is going on here - all the JavaScript // arguments are left on the stack unmodified. Therefore, this tail call can // only be used after arguments adaptation has been performed already. TNode<Object> TailCallJSCode(TNode<Code> code, TNode<Context> context, TNode<JSFunction> function, TNode<Object> new_target, TNode<Int32T> arg_count); template <class... TArgs> Node* CallJS(Callable const& callable, Node* context, Node* function, Node* receiver, TArgs... args) { int argc = static_cast<int>(sizeof...(args)); Node* arity = Int32Constant(argc); return CallStub(callable, context, function, arity, receiver, args...); } template <class... TArgs> Node* ConstructJS(Callable const& callable, Node* context, Node* new_target, TArgs... args) { int argc = static_cast<int>(sizeof...(args)); Node* arity = Int32Constant(argc); Node* receiver = LoadRoot(Heap::kUndefinedValueRootIndex); // Construct(target, new_target, arity, receiver, arguments...) return CallStub(callable, context, new_target, new_target, arity, receiver, args...); } Node* CallCFunctionN(Signature<MachineType>* signature, int input_count, Node* const* inputs); // Call to a C function with one argument. Node* CallCFunction1(MachineType return_type, MachineType arg0_type, Node* function, Node* arg0); // Call to a C function with one argument, while saving/restoring caller // registers except the register used for return value. Node* CallCFunction1WithCallerSavedRegisters(MachineType return_type, MachineType arg0_type, Node* function, Node* arg0, SaveFPRegsMode mode); // Call to a C function with two arguments. Node* CallCFunction2(MachineType return_type, MachineType arg0_type, MachineType arg1_type, Node* function, Node* arg0, Node* arg1); // Call to a C function with three arguments. Node* CallCFunction3(MachineType return_type, MachineType arg0_type, MachineType arg1_type, MachineType arg2_type, Node* function, Node* arg0, Node* arg1, Node* arg2); // Call to a C function with three arguments, while saving/restoring caller // registers except the register used for return value. Node* CallCFunction3WithCallerSavedRegisters( MachineType return_type, MachineType arg0_type, MachineType arg1_type, MachineType arg2_type, Node* function, Node* arg0, Node* arg1, Node* arg2, SaveFPRegsMode mode); // Call to a C function with four arguments. Node* CallCFunction4(MachineType return_type, MachineType arg0_type, MachineType arg1_type, MachineType arg2_type, MachineType arg3_type, Node* function, Node* arg0, Node* arg1, Node* arg2, Node* arg3); // Call to a C function with five arguments. Node* CallCFunction5(MachineType return_type, MachineType arg0_type, MachineType arg1_type, MachineType arg2_type, MachineType arg3_type, MachineType arg4_type, Node* function, Node* arg0, Node* arg1, Node* arg2, Node* arg3, Node* arg4); // Call to a C function with six arguments. Node* CallCFunction6(MachineType return_type, MachineType arg0_type, MachineType arg1_type, MachineType arg2_type, MachineType arg3_type, MachineType arg4_type, MachineType arg5_type, Node* function, Node* arg0, Node* arg1, Node* arg2, Node* arg3, Node* arg4, Node* arg5); // Call to a C function with nine arguments. Node* CallCFunction9(MachineType return_type, MachineType arg0_type, MachineType arg1_type, MachineType arg2_type, MachineType arg3_type, MachineType arg4_type, MachineType arg5_type, MachineType arg6_type, MachineType arg7_type, MachineType arg8_type, Node* function, Node* arg0, Node* arg1, Node* arg2, Node* arg3, Node* arg4, Node* arg5, Node* arg6, Node* arg7, Node* arg8); // Exception handling support. void GotoIfException(Node* node, Label* if_exception, Variable* exception_var = nullptr); // Helpers which delegate to RawMachineAssembler. Factory* factory() const; Isolate* isolate() const; Zone* zone() const; CodeAssemblerState* state() { return state_; } void BreakOnNode(int node_id); bool UnalignedLoadSupported(MachineRepresentation rep) const; bool UnalignedStoreSupported(MachineRepresentation rep) const; protected: void RegisterCallGenerationCallbacks( const CodeAssemblerCallback& call_prologue, const CodeAssemblerCallback& call_epilogue); void UnregisterCallGenerationCallbacks(); bool Word32ShiftIsSafe() const; PoisoningMitigationLevel poisoning_level() const; bool IsJSFunctionCall() const; private: TNode<Object> CallRuntimeImpl(Runtime::FunctionId function, TNode<Object> context, std::initializer_list<TNode<Object>> args); TNode<Object> CallRuntimeWithCEntryImpl( Runtime::FunctionId function, TNode<Code> centry, TNode<Object> context, std::initializer_list<TNode<Object>> args); void TailCallRuntimeImpl(Runtime::FunctionId function, TNode<Int32T> arity, TNode<Object> context, std::initializer_list<TNode<Object>> args); void TailCallRuntimeWithCEntryImpl(Runtime::FunctionId function, TNode<Int32T> arity, TNode<Code> centry, TNode<Object> context, std::initializer_list<TNode<Object>> args); void TailCallStubImpl(const CallInterfaceDescriptor& descriptor, TNode<Code> target, TNode<Object> context, std::initializer_list<Node*> args); Node* TailCallStubThenBytecodeDispatchImpl( const CallInterfaceDescriptor& descriptor, Node* target, Node* context, std::initializer_list<Node*> args); Node* CallStubRImpl(const CallInterfaceDescriptor& descriptor, size_t result_size, SloppyTNode<Code> target, SloppyTNode<Object> context, std::initializer_list<Node*> args); // These two don't have definitions and are here only for catching use cases // where the cast is not necessary. TNode<Int32T> Signed(TNode<Int32T> x); TNode<Uint32T> Unsigned(TNode<Uint32T> x); RawMachineAssembler* raw_assembler() const; // Calls respective callback registered in the state. void CallPrologue(); void CallEpilogue(); CodeAssemblerState* state_; DISALLOW_COPY_AND_ASSIGN(CodeAssembler); }; class CodeAssemblerVariable { public: explicit CodeAssemblerVariable(CodeAssembler* assembler, MachineRepresentation rep); CodeAssemblerVariable(CodeAssembler* assembler, MachineRepresentation rep, Node* initial_value); #if DEBUG CodeAssemblerVariable(CodeAssembler* assembler, AssemblerDebugInfo debug_info, MachineRepresentation rep); CodeAssemblerVariable(CodeAssembler* assembler, AssemblerDebugInfo debug_info, MachineRepresentation rep, Node* initial_value); #endif // DEBUG ~CodeAssemblerVariable(); void Bind(Node* value); Node* value() const; MachineRepresentation rep() const; bool IsBound() const; private: class Impl; friend class CodeAssemblerLabel; friend class CodeAssemblerState; friend std::ostream& operator<<(std::ostream&, const Impl&); friend std::ostream& operator<<(std::ostream&, const CodeAssemblerVariable&); Impl* impl_; CodeAssemblerState* state_; DISALLOW_COPY_AND_ASSIGN(CodeAssemblerVariable); }; std::ostream& operator<<(std::ostream&, const CodeAssemblerVariable&); std::ostream& operator<<(std::ostream&, const CodeAssemblerVariable::Impl&); template <class T> class TypedCodeAssemblerVariable : public CodeAssemblerVariable { public: TypedCodeAssemblerVariable(TNode<T> initial_value, CodeAssembler* assembler) : CodeAssemblerVariable(assembler, MachineRepresentationOf<T>::value, initial_value) {} explicit TypedCodeAssemblerVariable(CodeAssembler* assembler) : CodeAssemblerVariable(assembler, MachineRepresentationOf<T>::value) {} #if DEBUG TypedCodeAssemblerVariable(AssemblerDebugInfo debug_info, CodeAssembler* assembler) : CodeAssemblerVariable(assembler, debug_info, MachineRepresentationOf<T>::value) {} TypedCodeAssemblerVariable(AssemblerDebugInfo debug_info, TNode<T> initial_value, CodeAssembler* assembler) : CodeAssemblerVariable(assembler, debug_info, MachineRepresentationOf<T>::value, initial_value) {} #endif // DEBUG TNode<T> value() const { return TNode<T>::UncheckedCast(CodeAssemblerVariable::value()); } void operator=(TNode<T> value) { Bind(value); } void operator=(const TypedCodeAssemblerVariable<T>& variable) { Bind(variable.value()); } private: using CodeAssemblerVariable::Bind; }; class CodeAssemblerLabel { public: enum Type { kDeferred, kNonDeferred }; explicit CodeAssemblerLabel( CodeAssembler* assembler, CodeAssemblerLabel::Type type = CodeAssemblerLabel::kNonDeferred) : CodeAssemblerLabel(assembler, 0, nullptr, type) {} CodeAssemblerLabel( CodeAssembler* assembler, const CodeAssemblerVariableList& merged_variables, CodeAssemblerLabel::Type type = CodeAssemblerLabel::kNonDeferred) : CodeAssemblerLabel(assembler, merged_variables.size(), &(merged_variables[0]), type) {} CodeAssemblerLabel( CodeAssembler* assembler, size_t count, CodeAssemblerVariable* const* vars, CodeAssemblerLabel::Type type = CodeAssemblerLabel::kNonDeferred); CodeAssemblerLabel( CodeAssembler* assembler, std::initializer_list<CodeAssemblerVariable*> vars, CodeAssemblerLabel::Type type = CodeAssemblerLabel::kNonDeferred) : CodeAssemblerLabel(assembler, vars.size(), vars.begin(), type) {} CodeAssemblerLabel( CodeAssembler* assembler, CodeAssemblerVariable* merged_variable, CodeAssemblerLabel::Type type = CodeAssemblerLabel::kNonDeferred) : CodeAssemblerLabel(assembler, 1, &merged_variable, type) {} ~CodeAssemblerLabel(); inline bool is_bound() const { return bound_; } inline bool is_used() const { return merge_count_ != 0; } private: friend class CodeAssembler; void Bind(); #if DEBUG void Bind(AssemblerDebugInfo debug_info); #endif // DEBUG void UpdateVariablesAfterBind(); void MergeVariables(); bool bound_; size_t merge_count_; CodeAssemblerState* state_; RawMachineLabel* label_; // Map of variables that need to be merged to their phi nodes (or placeholders // for those phis). std::map<CodeAssemblerVariable::Impl*, Node*> variable_phis_; // Map of variables to the list of value nodes that have been added from each // merge path in their order of merging. std::map<CodeAssemblerVariable::Impl*, std::vector<Node*>> variable_merges_; }; class V8_EXPORT_PRIVATE CodeAssemblerState { public: // Create with CallStub linkage. // |result_size| specifies the number of results returned by the stub. // TODO(rmcilroy): move result_size to the CallInterfaceDescriptor. CodeAssemblerState(Isolate* isolate, Zone* zone, const CallInterfaceDescriptor& descriptor, Code::Kind kind, const char* name, PoisoningMitigationLevel poisoning_level, uint32_t stub_key = 0, int32_t builtin_index = Builtins::kNoBuiltinId); // Create with JSCall linkage. CodeAssemblerState(Isolate* isolate, Zone* zone, int parameter_count, Code::Kind kind, const char* name, PoisoningMitigationLevel poisoning_level, int32_t builtin_index = Builtins::kNoBuiltinId); ~CodeAssemblerState(); const char* name() const { return name_; } int parameter_count() const; #if DEBUG void PrintCurrentBlock(std::ostream& os); bool InsideBlock(); #endif // DEBUG void SetInitialDebugInformation(const char* msg, const char* file, int line); private: friend class CodeAssembler; friend class CodeAssemblerLabel; friend class CodeAssemblerVariable; friend class CodeAssemblerTester; CodeAssemblerState(Isolate* isolate, Zone* zone, CallDescriptor* call_descriptor, Code::Kind kind, const char* name, PoisoningMitigationLevel poisoning_level, uint32_t stub_key, int32_t builtin_index); std::unique_ptr<RawMachineAssembler> raw_assembler_; Code::Kind kind_; const char* name_; uint32_t stub_key_; int32_t builtin_index_; bool code_generated_; ZoneSet<CodeAssemblerVariable::Impl*> variables_; CodeAssemblerCallback call_prologue_; CodeAssemblerCallback call_epilogue_; DISALLOW_COPY_AND_ASSIGN(CodeAssemblerState); }; } // namespace compiler } // namespace internal } // namespace v8 #endif // V8_COMPILER_CODE_ASSEMBLER_H_
[ "commit-bot@chromium.org" ]
commit-bot@chromium.org
4384d9f3046b98ff94cb65064b23d153a610e6a8
c1806b6625b0391599364f2cc5aa2a604ecdcc1f
/96-A-86320017.cpp
8b6cf6d02b93a499316eb7c0b746a36c769dd646
[]
no_license
mdjawadulhasan/Codeforces-Submitted-solution-s-
bb240cf9fb7a9763e5ff16b4dcf40dcbb3b75431
036a08a954c0402602306cb9845797544e530c08
refs/heads/main
2023-07-27T23:48:51.556205
2021-09-12T00:48:55
2021-09-12T00:48:55
405,512,574
0
0
null
null
null
null
UTF-8
C++
false
false
683
cpp
#include<bits\stdc++.h> using namespace std; int main() { string str; cin>>str; int l=str.length(); int ct=0,bt=0; int ok=0; for(int i=0;i<l;i++) { if(str[i]=='1') { ct++; bt=0; } else { bt++; ct=0; } if(ct==7 || bt==7) { ok=1; break; } } if(ok==1) { cout<<"YES"<<endl; } else { cout<<"NO"<<endl; } }
[ "noreply@github.com" ]
mdjawadulhasan.noreply@github.com
8ea769fbafb51e8d967212addac9b22a086bf397
eba303a42022ec4236e7e62fde67903f2a931384
/Source/MainModule/joystick/Joystick.h
bd6c1755285e68dd0625aa8254ba3c052ae06531
[]
no_license
1046811284/hackFlight-ue4Demo
073d7856d2f1d9943a3c723a60b01e57546a6748
735413007b2c354708a5a5b6d318cfd9527c259b
refs/heads/master
2022-03-06T02:04:35.630794
2019-11-08T07:54:42
2019-11-08T07:54:42
218,028,123
1
0
null
null
null
null
GB18030
C++
false
false
3,309
h
/* * Joystick/gamepad support for flight simulators * * Copyright (C) 2018 Simon D. Levy * * MIT License */ #pragma once #include <stdint.h> #include <stdbool.h> #include <stdio.h> #ifndef MAINMODULE_API #define MAINMODULE_API #endif class Joystick { private: //各种手柄的id: 有误,等待修正!!! static const uint16_t PRODUCT_PS3_CLONE = 0x0003; static const uint16_t PRODUCT_XBOX360 = 0x02a1; static const uint16_t PRODUCT_XBOX360_CLONE2 = 0x028e; static const uint16_t PRODUCT_XBOX360_WIRELESS = 0x0719; static const uint16_t PRODUCT_INTERLINK = 0x0e56; static const uint16_t PRODUCT_TARANIS = 0x5710; static const uint16_t PRODUCT_SPEKTRUM = 0x572b; static const uint16_t PRODUCT_EXTREMEPRO3D = 0xc215; static const uint16_t PRODUCT_F310 = 0xc216; static const uint16_t PRODUCT_PS4 = 0x09cc; static const uint16_t PRODUCT_XBOX360_CLONE = 0xfafe; static constexpr float AUX1_MID = 0.3f; // positve but less than 0.5 uint16_t _productId = 0; int _joystickId = 0; bool _isGameController = false; public: typedef enum { ERROR_NOERROR, ERROR_MISSING, ERROR_PRODUCT } error_t; protected: enum { AX_THR, AX_ROL, AX_PIT, AX_YAW, AX_AU1, AX_AU2, AX_NIL }; //把button状态: 设置到axes的[5][6]两个位置 void buttonsToAxes(uint8_t buttons, uint8_t top, uint8_t rgt, uint8_t bot, uint8_t lft, float * axes) { static float _aux1 = 0; static float _aux2 = -1; static bool _down; if (buttons) { if (!_down) { // Left button sets AUX2 if (buttons == lft) { _aux2 *= -1; } // Other buttons set AUX1 else { _aux1 = (buttons == top) ? -1 : (buttons == rgt ? AUX1_MID : +1); } _down = true; } } else { _down = false; } axes[AX_AU1] = _aux1; axes[AX_AU2] = _aux2; } //获取手柄状态: ==> 保存到buttons(按钮状态) 和axes (轴状态) error_t pollProduct(float axes[6], uint8_t & buttons); public: MAINMODULE_API Joystick(const char * devname = "/dev/input/js0"); // ignored by Windows //把手柄状态: 设置到axes[6]中 MAINMODULE_API error_t poll(float axes[6]) { uint8_t buttons = 0; //获取手柄状态: 到axes, buttons变量中 error_t status = pollProduct(axes, buttons); //picth轴和油门: 通过axes获取 // Invert throttle, pitch axes on game controllers if (_isGameController) { axes[AX_THR] *= -1; axes[AX_PIT] *= -1; } switch (_productId) { case PRODUCT_F310: buttonsToAxes(buttons, 8, 4, 2, 1, axes); break; case PRODUCT_XBOX360: case PRODUCT_XBOX360_CLONE2: buttonsToAxes(buttons, 8, 2, 1, 4, axes); //无法识别手柄: 按照360手柄处理 default: //把button状态: 设置到axes的[5][6]两个位置 buttonsToAxes(buttons, 8, 2, 1, 4, axes); } return status; } };
[ "914079662@qq.com" ]
914079662@qq.com
789453bbcd23669181c414feb3f7f924437cf51e
4296e51c67eb12c83bd01c9eb93d1cd1fd1852ef
/export/windows/obj/src/flixel/system/_FlxBasePreloader/DefaultPreloader.cpp
a16e2527a12a14a302b5336a7a04e9422e601a87
[]
no_license
Jmacklin308/HaxeFlixel_DungeonCrawler
de23d7e86deb2fa3c2f135e6cc664b68bd1c8515
e5b7cdf540913a8c2e9e1fdc4780831a9b823856
refs/heads/main
2023-06-26T14:33:12.532371
2021-07-18T04:03:18
2021-07-18T04:03:18
386,560,939
0
0
null
null
null
null
UTF-8
C++
false
true
9,621
cpp
// Generated by Haxe 4.2.1+bf9ff69 #include <hxcpp.h> #ifndef INCLUDED_Std #include <Std.h> #endif #ifndef INCLUDED_flixel_system__FlxBasePreloader_DefaultPreloader #include <flixel/system/_FlxBasePreloader/DefaultPreloader.h> #endif #ifndef INCLUDED_openfl_display_DisplayObject #include <openfl/display/DisplayObject.h> #endif #ifndef INCLUDED_openfl_display_DisplayObjectContainer #include <openfl/display/DisplayObjectContainer.h> #endif #ifndef INCLUDED_openfl_display_IBitmapDrawable #include <openfl/display/IBitmapDrawable.h> #endif #ifndef INCLUDED_openfl_display_InteractiveObject #include <openfl/display/InteractiveObject.h> #endif #ifndef INCLUDED_openfl_display_LoaderInfo #include <openfl/display/LoaderInfo.h> #endif #ifndef INCLUDED_openfl_display_Sprite #include <openfl/display/Sprite.h> #endif #ifndef INCLUDED_openfl_events_Event #include <openfl/events/Event.h> #endif #ifndef INCLUDED_openfl_events_EventDispatcher #include <openfl/events/EventDispatcher.h> #endif #ifndef INCLUDED_openfl_events_IEventDispatcher #include <openfl/events/IEventDispatcher.h> #endif #ifndef INCLUDED_openfl_events_ProgressEvent #include <openfl/events/ProgressEvent.h> #endif HX_DEFINE_STACK_FRAME(_hx_pos_b5ad01cadf9f6950_417_new,"flixel.system._FlxBasePreloader.DefaultPreloader","new",0xd190e230,"flixel.system._FlxBasePreloader.DefaultPreloader.new","flixel/system/FlxBasePreloader.hx",417,0x863b5dde) HX_LOCAL_STACK_FRAME(_hx_pos_b5ad01cadf9f6950_423_onAddedToStage,"flixel.system._FlxBasePreloader.DefaultPreloader","onAddedToStage",0x45f82252,"flixel.system._FlxBasePreloader.DefaultPreloader.onAddedToStage","flixel/system/FlxBasePreloader.hx",423,0x863b5dde) HX_LOCAL_STACK_FRAME(_hx_pos_b5ad01cadf9f6950_434_onComplete,"flixel.system._FlxBasePreloader.DefaultPreloader","onComplete",0xb0729d28,"flixel.system._FlxBasePreloader.DefaultPreloader.onComplete","flixel/system/FlxBasePreloader.hx",434,0x863b5dde) HX_LOCAL_STACK_FRAME(_hx_pos_b5ad01cadf9f6950_445_onProgress,"flixel.system._FlxBasePreloader.DefaultPreloader","onProgress",0xb6d5941c,"flixel.system._FlxBasePreloader.DefaultPreloader.onProgress","flixel/system/FlxBasePreloader.hx",445,0x863b5dde) HX_LOCAL_STACK_FRAME(_hx_pos_b5ad01cadf9f6950_448_onInit,"flixel.system._FlxBasePreloader.DefaultPreloader","onInit",0x814533ff,"flixel.system._FlxBasePreloader.DefaultPreloader.onInit","flixel/system/FlxBasePreloader.hx",448,0x863b5dde) HX_LOCAL_STACK_FRAME(_hx_pos_b5ad01cadf9f6950_452_onLoaded,"flixel.system._FlxBasePreloader.DefaultPreloader","onLoaded",0x051c9ab4,"flixel.system._FlxBasePreloader.DefaultPreloader.onLoaded","flixel/system/FlxBasePreloader.hx",452,0x863b5dde) HX_LOCAL_STACK_FRAME(_hx_pos_b5ad01cadf9f6950_456_onUpdate,"flixel.system._FlxBasePreloader.DefaultPreloader","onUpdate",0x33b2d8b8,"flixel.system._FlxBasePreloader.DefaultPreloader.onUpdate","flixel/system/FlxBasePreloader.hx",456,0x863b5dde) namespace flixel{ namespace _hx_system{ namespace _FlxBasePreloader{ void DefaultPreloader_obj::__construct(){ HX_STACKFRAME(&_hx_pos_b5ad01cadf9f6950_417_new) HXLINE( 418) super::__construct(); HXLINE( 419) this->addEventListener(HX_("addedToStage",63,22,55,0c),this->onAddedToStage_dyn(),null(),null(),null()); } Dynamic DefaultPreloader_obj::__CreateEmpty() { return new DefaultPreloader_obj; } void *DefaultPreloader_obj::_hx_vtable = 0; Dynamic DefaultPreloader_obj::__Create(::hx::DynamicArray inArgs) { ::hx::ObjectPtr< DefaultPreloader_obj > _hx_result = new DefaultPreloader_obj(); _hx_result->__construct(); return _hx_result; } bool DefaultPreloader_obj::_hx_isInstanceOf(int inClassId) { if (inClassId<=(int)0x1f4df417) { if (inClassId<=(int)0x0c89e854) { if (inClassId<=(int)0x0330636f) { return inClassId==(int)0x00000001 || inClassId==(int)0x0330636f; } else { return inClassId==(int)0x0c89e854; } } else { return inClassId==(int)0x1f4df417; } } else { if (inClassId<=(int)0x4af7dd8e) { return inClassId==(int)0x318ede3c || inClassId==(int)0x4af7dd8e; } else { return inClassId==(int)0x6b353933; } } } void DefaultPreloader_obj::onAddedToStage( ::openfl::events::Event _){ HX_STACKFRAME(&_hx_pos_b5ad01cadf9f6950_423_onAddedToStage) HXLINE( 424) this->removeEventListener(HX_("addedToStage",63,22,55,0c),this->onAddedToStage_dyn(),null()); HXLINE( 426) this->onInit(); HXLINE( 427) int _hx_tmp = this->get_loaderInfo()->bytesLoaded; HXDLIN( 427) this->onUpdate(_hx_tmp,this->get_loaderInfo()->bytesTotal); HXLINE( 429) this->addEventListener(HX_("progress",ad,f7,2a,86),this->onProgress_dyn(),null(),null(),null()); HXLINE( 430) this->addEventListener(HX_("complete",b9,00,c8,7f),this->onComplete_dyn(),null(),null(),null()); } HX_DEFINE_DYNAMIC_FUNC1(DefaultPreloader_obj,onAddedToStage,(void)) void DefaultPreloader_obj::onComplete( ::openfl::events::Event event){ HX_STACKFRAME(&_hx_pos_b5ad01cadf9f6950_434_onComplete) HXLINE( 435) event->preventDefault(); HXLINE( 437) this->removeEventListener(HX_("progress",ad,f7,2a,86),this->onProgress_dyn(),null()); HXLINE( 438) this->removeEventListener(HX_("complete",b9,00,c8,7f),this->onComplete_dyn(),null()); HXLINE( 440) this->onLoaded(); } HX_DEFINE_DYNAMIC_FUNC1(DefaultPreloader_obj,onComplete,(void)) void DefaultPreloader_obj::onProgress( ::openfl::events::ProgressEvent event){ HX_STACKFRAME(&_hx_pos_b5ad01cadf9f6950_445_onProgress) HXDLIN( 445) int _hx_tmp = ::Std_obj::_hx_int(event->bytesLoaded); HXDLIN( 445) this->onUpdate(_hx_tmp,::Std_obj::_hx_int(event->bytesTotal)); } HX_DEFINE_DYNAMIC_FUNC1(DefaultPreloader_obj,onProgress,(void)) void DefaultPreloader_obj::onInit(){ HX_STACKFRAME(&_hx_pos_b5ad01cadf9f6950_448_onInit) } HX_DEFINE_DYNAMIC_FUNC0(DefaultPreloader_obj,onInit,(void)) void DefaultPreloader_obj::onLoaded(){ HX_GC_STACKFRAME(&_hx_pos_b5ad01cadf9f6950_452_onLoaded) HXDLIN( 452) this->dispatchEvent( ::openfl::events::Event_obj::__alloc( HX_CTX ,HX_("unload",ff,a0,8c,65),null(),null())); } HX_DEFINE_DYNAMIC_FUNC0(DefaultPreloader_obj,onLoaded,(void)) void DefaultPreloader_obj::onUpdate(int bytesLoaded,int bytesTotal){ HX_STACKFRAME(&_hx_pos_b5ad01cadf9f6950_456_onUpdate) HXLINE( 457) Float percentLoaded = ((Float)0.0); HXLINE( 458) if ((bytesTotal > 0)) { HXLINE( 460) percentLoaded = (( (Float)(bytesLoaded) ) / ( (Float)(bytesTotal) )); HXLINE( 461) if ((percentLoaded > 1)) { HXLINE( 462) percentLoaded = ( (Float)(1) ); } } } HX_DEFINE_DYNAMIC_FUNC2(DefaultPreloader_obj,onUpdate,(void)) ::hx::ObjectPtr< DefaultPreloader_obj > DefaultPreloader_obj::__new() { ::hx::ObjectPtr< DefaultPreloader_obj > __this = new DefaultPreloader_obj(); __this->__construct(); return __this; } ::hx::ObjectPtr< DefaultPreloader_obj > DefaultPreloader_obj::__alloc(::hx::Ctx *_hx_ctx) { DefaultPreloader_obj *__this = (DefaultPreloader_obj*)(::hx::Ctx::alloc(_hx_ctx, sizeof(DefaultPreloader_obj), true, "flixel.system._FlxBasePreloader.DefaultPreloader")); *(void **)__this = DefaultPreloader_obj::_hx_vtable; __this->__construct(); return __this; } DefaultPreloader_obj::DefaultPreloader_obj() { } ::hx::Val DefaultPreloader_obj::__Field(const ::String &inName,::hx::PropertyAccess inCallProp) { switch(inName.length) { case 6: if (HX_FIELD_EQ(inName,"onInit") ) { return ::hx::Val( onInit_dyn() ); } break; case 8: if (HX_FIELD_EQ(inName,"onLoaded") ) { return ::hx::Val( onLoaded_dyn() ); } if (HX_FIELD_EQ(inName,"onUpdate") ) { return ::hx::Val( onUpdate_dyn() ); } break; case 10: if (HX_FIELD_EQ(inName,"onComplete") ) { return ::hx::Val( onComplete_dyn() ); } if (HX_FIELD_EQ(inName,"onProgress") ) { return ::hx::Val( onProgress_dyn() ); } break; case 14: if (HX_FIELD_EQ(inName,"onAddedToStage") ) { return ::hx::Val( onAddedToStage_dyn() ); } } return super::__Field(inName,inCallProp); } #ifdef HXCPP_SCRIPTABLE static ::hx::StorageInfo *DefaultPreloader_obj_sMemberStorageInfo = 0; static ::hx::StaticInfo *DefaultPreloader_obj_sStaticStorageInfo = 0; #endif static ::String DefaultPreloader_obj_sMemberFields[] = { HX_("onAddedToStage",22,82,44,36), HX_("onComplete",f8,d4,7e,5d), HX_("onProgress",ec,cb,e1,63), HX_("onInit",cf,43,45,e8), HX_("onLoaded",84,3e,1c,38), HX_("onUpdate",88,7c,b2,66), ::String(null()) }; ::hx::Class DefaultPreloader_obj::__mClass; void DefaultPreloader_obj::__register() { DefaultPreloader_obj _hx_dummy; DefaultPreloader_obj::_hx_vtable = *(void **)&_hx_dummy; ::hx::Static(__mClass) = new ::hx::Class_obj(); __mClass->mName = HX_("flixel.system._FlxBasePreloader.DefaultPreloader",3e,4a,10,91); __mClass->mSuper = &super::__SGetClass(); __mClass->mConstructEmpty = &__CreateEmpty; __mClass->mConstructArgs = &__Create; __mClass->mGetStaticField = &::hx::Class_obj::GetNoStaticField; __mClass->mSetStaticField = &::hx::Class_obj::SetNoStaticField; __mClass->mStatics = ::hx::Class_obj::dupFunctions(0 /* sStaticFields */); __mClass->mMembers = ::hx::Class_obj::dupFunctions(DefaultPreloader_obj_sMemberFields); __mClass->mCanCast = ::hx::TCanCast< DefaultPreloader_obj >; #ifdef HXCPP_SCRIPTABLE __mClass->mMemberStorageInfo = DefaultPreloader_obj_sMemberStorageInfo; #endif #ifdef HXCPP_SCRIPTABLE __mClass->mStaticStorageInfo = DefaultPreloader_obj_sStaticStorageInfo; #endif ::hx::_hx_RegisterClass(__mClass->mName, __mClass); } } // end namespace flixel } // end namespace system } // end namespace _FlxBasePreloader
[ "jmacklin308@gmail.com" ]
jmacklin308@gmail.com
734b79efc35070f9427c8f306395450e4149fbf2
c416836c53f6add2437524e88254d017775f822e
/TemplateDataStructure/MyQueue/myqueue.h
f8237b00728429132271be905829f65a85e0bda6
[]
no_license
YYC572652645/DataStructure
68be9406a1cbba514fac25ce5f65d1661e320eec
e6442bf2856db2bca69e39e3c827b064f16aec71
refs/heads/master
2021-05-04T14:17:20.983522
2019-06-03T14:22:11
2019-06-03T14:22:11
120,197,551
13
2
null
null
null
null
UTF-8
C++
false
false
301
h
#ifndef MYQUEUE_H #define MYQUEUE_H #include <iostream> #include <vector> using namespace std; template <class T> class MyQueue { public: int size(); void enQueue(const T &elementData); T deQueue(); bool isEmpty(); private: vector<T> queueElements; }; #endif // MYQUEUE_H
[ "YYC572652645@163.com" ]
YYC572652645@163.com
a9abb59f8b23969ab33637b538b31087af7b8db8
1c4a59a443086e9c256836b295dfb5cbb739369a
/Windows/Src/HttpServer.cpp
b741711ef5111bd93b6d9d6e8e10290cc2e6e11a
[ "Apache-2.0" ]
permissive
ldcsaa/HP-Socket
75f1e066472a294d29beba40db73bf9d50eda681
fb45e228974e4f2cac2c222ab0d07a7a316a07f3
refs/heads/dev
2023-08-16T03:00:10.580279
2023-08-12T21:21:14
2023-08-12T21:21:14
15,257,213
6,720
1,934
NOASSERTION
2021-12-27T06:33:17
2013-12-17T14:53:52
C
UTF-8
C++
false
false
16,050
cpp
/* * Copyright: JessMA Open Source (ldcsaa@gmail.com) * * Author : Bruce Liang * Website : https://github.com/ldcsaa * Project : https://github.com/ldcsaa/HP-Socket * Blog : http://www.cnblogs.com/ldcsaa * Wiki : http://www.oschina.net/p/hp-socket * QQ Group : 44636872, 75375912 * * 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 "stdafx.h" #include "HttpServer.h" #ifdef _HTTP_SUPPORT template<class T, USHORT default_port> BOOL CHttpServerT<T, default_port>::Start(LPCTSTR lpszBindAddress, USHORT usPort) { BOOL isOK = __super::Start(lpszBindAddress, usPort); if(isOK) ENSURE(m_thCleaner.Start(this, &CHttpServerT::CleanerThreadProc)); return isOK; } template<class T, USHORT default_port> BOOL CHttpServerT<T, default_port>::CheckParams() { if ((m_enLocalVersion != HV_1_1 && m_enLocalVersion != HV_1_0) || (m_dwReleaseDelay < MIN_HTTP_RELEASE_DELAY || m_dwReleaseDelay > MAX_HTTP_RELEASE_DELAY)) { SetLastError(SE_INVALID_PARAM, __FUNCTION__, ERROR_INVALID_PARAMETER); return FALSE; } return __super::CheckParams(); } template<class T, USHORT default_port> void CHttpServerT<T, default_port>::PrepareStart() { __super::PrepareStart(); m_objPool.SetHttpObjLockTime(GetFreeSocketObjLockTime()); m_objPool.SetHttpObjPoolSize(GetFreeSocketObjPool()); m_objPool.SetHttpObjPoolHold(GetFreeSocketObjHold()); m_objPool.Prepare(); } template<class T, USHORT default_port> BOOL CHttpServerT<T, default_port>::SendResponse(CONNID dwConnID, USHORT usStatusCode, LPCSTR lpszDesc, const THeader lpHeaders[], int iHeaderCount, const BYTE* pData, int iLength) { WSABUF szBuffer[2]; CStringA strHeader; ::MakeStatusLine(m_enLocalVersion, usStatusCode, lpszDesc, strHeader); ::MakeHeaderLines(lpHeaders, iHeaderCount, nullptr, iLength, FALSE, IsKeepAlive(dwConnID), nullptr, 0, strHeader); ::MakeHttpPacket(strHeader, pData, iLength, szBuffer); return SendPackets(dwConnID, szBuffer, 2); } template<class T, USHORT default_port> BOOL CHttpServerT<T, default_port>::SendLocalFile(CONNID dwConnID, LPCSTR lpszFileName, USHORT usStatusCode, LPCSTR lpszDesc, const THeader lpHeaders[], int iHeaderCount) { CAtlFile file; CAtlFileMapping<> fmap; HRESULT hr = ::ReadSmallFile(CA2T(lpszFileName), file, fmap); if(FAILED(hr)) { ::SetLastError(HRESULT_CODE(hr)); return FALSE; } return SendResponse(dwConnID, usStatusCode, lpszDesc, lpHeaders, iHeaderCount, (BYTE*)(char*)fmap, (int)fmap.GetMappingSize()); } template<class T, USHORT default_port> BOOL CHttpServerT<T, default_port>::SendChunkData(CONNID dwConnID, const BYTE* pData, int iLength, LPCSTR lpszExtensions) { char szLen[12]; WSABUF bufs[5]; int iCount = MakeChunkPackage(pData, iLength, lpszExtensions, szLen, bufs); return SendPackets(dwConnID, bufs, iCount); } template<class T, USHORT default_port> BOOL CHttpServerT<T, default_port>::Release(CONNID dwConnID) { if(!HasStarted()) return FALSE; THttpObj* pHttpObj = FindHttpObj(dwConnID); if(pHttpObj == nullptr || pHttpObj->HasReleased()) return FALSE; pHttpObj->Release(); m_lsDyingQueue.PushBack(TDyingConnection::Construct(dwConnID)); return TRUE; } template<class T, USHORT default_port> BOOL CHttpServerT<T, default_port>::SendWSMessage(CONNID dwConnID, BOOL bFinal, BYTE iReserved, BYTE iOperationCode, const BYTE* pData, int iLength, ULONGLONG ullBodyLen) { WSABUF szBuffer[2]; BYTE szHeader[HTTP_MAX_WS_HEADER_LEN]; if(!::MakeWSPacket(bFinal, iReserved, iOperationCode, nullptr, (BYTE*)pData, iLength, ullBodyLen, szHeader, szBuffer)) return FALSE; return SendPackets(dwConnID, szBuffer, 2); } template<class T, USHORT default_port> UINT CHttpServerT<T, default_port>::CleanerThreadProc(PVOID pv) { TRACE("---------------> Connection Cleaner Thread 0x%08X started <---------------\n", SELF_THREAD_ID); DWORD dwRetValue = 0; DWORD dwInterval = max(MIN_HTTP_RELEASE_CHECK_INTERVAL, (m_dwReleaseDelay - MIN_HTTP_RELEASE_DELAY / 2)); while(HasStarted()) { dwRetValue = ::WaitForSingleObject(m_evCleaner, dwInterval); if(dwRetValue == WAIT_TIMEOUT) KillDyingConnection(); else if(dwRetValue == WAIT_OBJECT_0) break; else ASSERT(FALSE); } ReleaseDyingConnection(); TRACE("---------------> Connection Cleaner Thread 0x%08X stoped <---------------\n", SELF_THREAD_ID); return 0; } template<class T, USHORT default_port> void CHttpServerT<T, default_port>::KillDyingConnection() { TDyingConnection* pDyingConn = nullptr; TDyingConnection* pFirstDyingConn = nullptr; DWORD now = ::TimeGetTime(); while(m_lsDyingQueue.UnsafePeekFront(&pDyingConn)) { if((int)(now - pDyingConn->killTime) < (int)m_dwReleaseDelay) break; BOOL bDisconnect = TRUE; BOOL bDestruct = TRUE; ENSURE(m_lsDyingQueue.UnsafePopFront(&pDyingConn)); int iPending; if(!GetPendingDataLength(pDyingConn->connID, iPending)) bDisconnect = FALSE; else if(iPending > 0) { bDisconnect = FALSE; bDestruct = FALSE; } if(bDisconnect) Disconnect(pDyingConn->connID, TRUE); if(bDestruct) { TDyingConnection::Destruct(pDyingConn); if(pFirstDyingConn == pDyingConn) pFirstDyingConn = nullptr; } else { m_lsDyingQueue.PushBack(pDyingConn); if(pFirstDyingConn == nullptr) pFirstDyingConn = pDyingConn; else if(pFirstDyingConn == pDyingConn) break; } } } template<class T, USHORT default_port> void CHttpServerT<T, default_port>::ReleaseDyingConnection() { TDyingConnection* pDyingConn = nullptr; while(m_lsDyingQueue.UnsafePopFront(&pDyingConn)) TDyingConnection::Destruct(pDyingConn); ENSURE(m_lsDyingQueue.IsEmpty()); } template<class T, USHORT default_port> EnHandleResult CHttpServerT<T, default_port>::FireAccept(TSocketObj* pSocketObj) { return m_bHttpAutoStart ? __super::FireAccept(pSocketObj) : __super::DoFireAccept(pSocketObj); } template<class T, USHORT default_port> EnHandleResult CHttpServerT<T, default_port>::DoFireAccept(TSocketObj* pSocketObj) { THttpObj* pHttpObj = DoStartHttp(pSocketObj); EnHandleResult result = __super::DoFireAccept(pSocketObj); if(result == HR_ERROR) { m_objPool.PutFreeHttpObj(pHttpObj); SetConnectionReserved(pSocketObj, nullptr); } return result; } template<class T, USHORT default_port> EnHandleResult CHttpServerT<T, default_port>::DoFireHandShake(TSocketObj* pSocketObj) { EnHandleResult result = __super::DoFireHandShake(pSocketObj); if(result == HR_ERROR) { THttpObj* pHttpObj = FindHttpObj(pSocketObj); if(pHttpObj != nullptr) { m_objPool.PutFreeHttpObj(pHttpObj); SetConnectionReserved(pSocketObj, nullptr); } } return result; } template<class T, USHORT default_port> EnHandleResult CHttpServerT<T, default_port>::DoFireReceive(TSocketObj* pSocketObj, const BYTE* pData, int iLength) { THttpObj* pHttpObj = FindHttpObj(pSocketObj); if(pHttpObj == nullptr) return DoFireSuperReceive(pSocketObj, pData, iLength); else { if(pHttpObj->HasReleased()) return HR_ERROR; return pHttpObj->Execute(pData, iLength); } } template<class T, USHORT default_port> EnHandleResult CHttpServerT<T, default_port>::DoFireClose(TSocketObj* pSocketObj, EnSocketOperation enOperation, int iErrorCode) { EnHandleResult result = __super::DoFireClose(pSocketObj, enOperation, iErrorCode); THttpObj* pHttpObj = FindHttpObj(pSocketObj); if(pHttpObj != nullptr) { m_objPool.PutFreeHttpObj(pHttpObj); SetConnectionReserved(pSocketObj, nullptr); } return result; } template<class T, USHORT default_port> EnHandleResult CHttpServerT<T, default_port>::DoFireShutdown() { EnHandleResult result = __super::DoFireShutdown(); m_objPool.Clear(); WaitForCleanerThreadEnd(); return result; } template<class T, USHORT default_port> void CHttpServerT<T, default_port>::WaitForCleanerThreadEnd() { if(m_thCleaner.IsRunning()) { m_evCleaner.Set(); ENSURE(m_thCleaner.Join(TRUE)); m_evCleaner.Reset(); } } template<class T, USHORT default_port> BOOL CHttpServerT<T, default_port>::IsUpgrade(CONNID dwConnID) { THttpObj* pHttpObj = FindHttpObj(dwConnID); if(pHttpObj == nullptr) return FALSE; return pHttpObj->IsUpgrade(); } template<class T, USHORT default_port> BOOL CHttpServerT<T, default_port>::IsKeepAlive(CONNID dwConnID) { THttpObj* pHttpObj = FindHttpObj(dwConnID); if(pHttpObj == nullptr) return FALSE; return pHttpObj->IsKeepAlive(); } template<class T, USHORT default_port> USHORT CHttpServerT<T, default_port>::GetVersion(CONNID dwConnID) { THttpObj* pHttpObj = FindHttpObj(dwConnID); if(pHttpObj == nullptr) return 0; return pHttpObj->GetVersion(); } template<class T, USHORT default_port> LPCSTR CHttpServerT<T, default_port>::GetHost(CONNID dwConnID) { THttpObj* pHttpObj = FindHttpObj(dwConnID); if(pHttpObj == nullptr) return nullptr; return pHttpObj->GetHost(); } template<class T, USHORT default_port> ULONGLONG CHttpServerT<T, default_port>::GetContentLength(CONNID dwConnID) { THttpObj* pHttpObj = FindHttpObj(dwConnID); if(pHttpObj == nullptr) return 0; return pHttpObj->GetContentLength(); } template<class T, USHORT default_port> LPCSTR CHttpServerT<T, default_port>::GetContentType(CONNID dwConnID) { THttpObj* pHttpObj = FindHttpObj(dwConnID); if(pHttpObj == nullptr) return nullptr; return pHttpObj->GetContentType(); } template<class T, USHORT default_port> LPCSTR CHttpServerT<T, default_port>::GetContentEncoding(CONNID dwConnID) { THttpObj* pHttpObj = FindHttpObj(dwConnID); if(pHttpObj == nullptr) return nullptr; return pHttpObj->GetContentEncoding(); } template<class T, USHORT default_port> LPCSTR CHttpServerT<T, default_port>::GetTransferEncoding(CONNID dwConnID) { THttpObj* pHttpObj = FindHttpObj(dwConnID); if(pHttpObj == nullptr) return nullptr; return pHttpObj->GetTransferEncoding(); } template<class T, USHORT default_port> EnHttpUpgradeType CHttpServerT<T, default_port>::GetUpgradeType(CONNID dwConnID) { THttpObj* pHttpObj = FindHttpObj(dwConnID); if(pHttpObj == nullptr) return HUT_NONE; return pHttpObj->GetUpgradeType(); } template<class T, USHORT default_port> USHORT CHttpServerT<T, default_port>::GetParseErrorCode(CONNID dwConnID, LPCSTR* lpszErrorDesc) { THttpObj* pHttpObj = FindHttpObj(dwConnID); if(pHttpObj == nullptr) return 0; return pHttpObj->GetParseErrorCode(lpszErrorDesc); } template<class T, USHORT default_port> BOOL CHttpServerT<T, default_port>::GetHeader(CONNID dwConnID, LPCSTR lpszName, LPCSTR* lpszValue) { THttpObj* pHttpObj = FindHttpObj(dwConnID); if(pHttpObj == nullptr) return FALSE; return pHttpObj->GetHeader(lpszName, lpszValue); } template<class T, USHORT default_port> BOOL CHttpServerT<T, default_port>::GetHeaders(CONNID dwConnID, LPCSTR lpszName, LPCSTR lpszValue[], DWORD& dwCount) { THttpObj* pHttpObj = FindHttpObj(dwConnID); if(pHttpObj == nullptr) return FALSE; return pHttpObj->GetHeaders(lpszName, lpszValue, dwCount); } template<class T, USHORT default_port> BOOL CHttpServerT<T, default_port>::GetAllHeaders(CONNID dwConnID, THeader lpHeaders[], DWORD& dwCount) { THttpObj* pHttpObj = FindHttpObj(dwConnID); if(pHttpObj == nullptr) return FALSE; return pHttpObj->GetAllHeaders(lpHeaders, dwCount); } template<class T, USHORT default_port> BOOL CHttpServerT<T, default_port>::GetAllHeaderNames(CONNID dwConnID, LPCSTR lpszName[], DWORD& dwCount) { THttpObj* pHttpObj = FindHttpObj(dwConnID); if(pHttpObj == nullptr) return FALSE; return pHttpObj->GetAllHeaderNames(lpszName, dwCount); } template<class T, USHORT default_port> BOOL CHttpServerT<T, default_port>::GetCookie(CONNID dwConnID, LPCSTR lpszName, LPCSTR* lpszValue) { THttpObj* pHttpObj = FindHttpObj(dwConnID); if(pHttpObj == nullptr) return FALSE; return pHttpObj->GetCookie(lpszName, lpszValue); } template<class T, USHORT default_port> BOOL CHttpServerT<T, default_port>::GetAllCookies(CONNID dwConnID, TCookie lpCookies[], DWORD& dwCount) { THttpObj* pHttpObj = FindHttpObj(dwConnID); if(pHttpObj == nullptr) return FALSE; return pHttpObj->GetAllCookies(lpCookies, dwCount); } template<class T, USHORT default_port> USHORT CHttpServerT<T, default_port>::GetUrlFieldSet(CONNID dwConnID) { THttpObj* pHttpObj = FindHttpObj(dwConnID); if(pHttpObj == nullptr) return 0; return pHttpObj->GetUrlFieldSet(); } template<class T, USHORT default_port> LPCSTR CHttpServerT<T, default_port>::GetUrlField(CONNID dwConnID, EnHttpUrlField enField) { THttpObj* pHttpObj = FindHttpObj(dwConnID); if(pHttpObj == nullptr) return nullptr; return pHttpObj->GetUrlField(enField); } template<class T, USHORT default_port> LPCSTR CHttpServerT<T, default_port>::GetMethod(CONNID dwConnID) { THttpObj* pHttpObj = FindHttpObj(dwConnID); if(pHttpObj == nullptr) return nullptr; return pHttpObj->GetMethod(); } template<class T, USHORT default_port> BOOL CHttpServerT<T, default_port>::GetWSMessageState(CONNID dwConnID, BOOL* lpbFinal, BYTE* lpiReserved, BYTE* lpiOperationCode, LPCBYTE* lpszMask, ULONGLONG* lpullBodyLen, ULONGLONG* lpullBodyRemain) { THttpObj* pHttpObj = FindHttpObj(dwConnID); if(pHttpObj == nullptr) return FALSE; return pHttpObj->GetWSMessageState(lpbFinal, lpiReserved, lpiOperationCode, lpszMask, lpullBodyLen, lpullBodyRemain); } template<class T, USHORT default_port> inline typename CHttpServerT<T, default_port>::THttpObj* CHttpServerT<T, default_port>::FindHttpObj(CONNID dwConnID) { THttpObj* pHttpObj = nullptr; GetConnectionReserved(dwConnID, (PVOID*)&pHttpObj); return pHttpObj; } template<class T, USHORT default_port> inline typename CHttpServerT<T, default_port>::THttpObj* CHttpServerT<T, default_port>::FindHttpObj(TSocketObj* pSocketObj) { THttpObj* pHttpObj = nullptr; GetConnectionReserved(pSocketObj, (PVOID*)&pHttpObj); return pHttpObj; } template<class T, USHORT default_port> BOOL CHttpServerT<T, default_port>::StartHttp(CONNID dwConnID) { if(IsHttpAutoStart()) { ::SetLastError(ERROR_INVALID_OPERATION); return FALSE; } TSocketObj* pSocketObj = FindSocketObj(dwConnID); if(!TSocketObj::IsValid(pSocketObj)) { ::SetLastError(ERROR_OBJECT_NOT_FOUND); return FALSE; } return StartHttp(pSocketObj); } template<class T, USHORT default_port> BOOL CHttpServerT<T, default_port>::StartHttp(TSocketObj* pSocketObj) { if(!pSocketObj->HasConnected()) { ::SetLastError(ERROR_INVALID_STATE); return FALSE; } CCriSecLock locallock(pSocketObj->csSend); if(!TSocketObj::IsValid(pSocketObj)) { ::SetLastError(ERROR_OBJECT_NOT_FOUND); return FALSE; } if(!pSocketObj->HasConnected()) { ::SetLastError(ERROR_INVALID_STATE); return FALSE; } THttpObj* pHttpObj = FindHttpObj(pSocketObj); if(pHttpObj != nullptr) { ::SetLastError(ERROR_ALREADY_INITIALIZED); return FALSE; } DoStartHttp(pSocketObj); if(!IsSecure()) FireHandShake(pSocketObj); else { #ifdef _SSL_SUPPORT if(IsSSLAutoHandShake()) StartSSLHandShake(pSocketObj); #endif } return TRUE; } template<class T, USHORT default_port> typename CHttpServerT<T, default_port>::THttpObj* CHttpServerT<T, default_port>::DoStartHttp(TSocketObj* pSocketObj) { THttpObj* pHttpObj = m_objPool.PickFreeHttpObj(this, pSocketObj); ENSURE(SetConnectionReserved(pSocketObj, pHttpObj)); return pHttpObj; } // ------------------------------------------------------------------------------------------------------------- // template class CHttpServerT<CTcpServer, HTTP_DEFAULT_PORT>; #ifdef _SSL_SUPPORT #include "SSLServer.h" template class CHttpServerT<CSSLServer, HTTPS_DEFAULT_PORT>; #endif #endif
[ "ldcsaa@21cn.com" ]
ldcsaa@21cn.com
6d08f21581b2e0c3c1446780bab8f1d8b69ee307
4897b9d75d851a81606d19a0e046b32eb16aa1bd
/other/lcof/list/12-ju-zhen-zhong-de-lu-jing-lcof/12-tiankonguse.cpp
da906d31a6ab0447d1c7e7c995db18982315a66a
[]
no_license
tiankonguse/leetcode-solutions
0b5e3a5b3f7063374e9543b5f516e9cecee0ad1f
a36269c861bd5797fe3835fc179a19559fac8655
refs/heads/master
2023-09-04T11:01:00.787559
2023-09-03T04:26:25
2023-09-03T04:26:25
33,770,209
83
38
null
2020-05-12T15:13:59
2015-04-11T09:31:39
C++
UTF-8
C++
false
false
2,767
cpp
#include "base.h" typedef long long ll; typedef long long LL; typedef unsigned long long ull; typedef unsigned long long ULL; typedef pair<int, int> pii; typedef pair<ll, ll> pll; // const int mod = 1e9 + 7; template <class T> using min_queue = priority_queue<T, vector<T>, greater<T>>; template <class T> using max_queue = priority_queue<T>; // int dir[4][2] = {{0,1},{0,-1},{1,0},{-1,0}}; // int dir[8][2] = {{0,1},{1, 1},{1,0},{1,-1}, {0,-1}, {-1, -1}, {-1,0}, {-1, 1}}; // lower_bound 大于等于 // upper_bound 大于 // vector/array: upper_bound(vec.begin(), vec.end(), v) // map: m.upper_bound(v) // reserve vector预先分配内存 // reverse(v.begin(), v.end()) 反转 // sum = accumulate(a.begin(), a.end(), 0); // unordered_map / unordered_set // 排序,小于是升序:[](auto&a, auto&b){ return a < b; }) // 优先队列 priority_queue<Node>:大于是升序 // struct Node{ // int t; // bool operator<(const Node & that)const { return this->t > that.t; } // }; const LL INF = 0x3f3f3f3f3f3f3f3fll; const double PI = acos(-1.0), eps = 1e-7; const int inf = 0x3f3f3f3f, ninf = 0xc0c0c0c0, mod = 1000000007; const int max3 = 2100, max4 = 11100, max5 = 200100, max6 = 2000100; int dir[4][2] = {{0,1},{0,-1},{1,0},{-1,0}}; class Solution { vector<vector<char>> board; string word; int n, m, l; bool Dfs(int x, int y, int pos){ if(pos == l) { return true; } if(x < 0 || y < 0 || x >= n || y >= m) return false; if(board[x][y] != word[pos]) return false; char c = board[x][y]; board[x][y] = '0'; for(int i = 0; i < 4; i++){ int X = x + dir[i][0]; int Y = y + dir[i][1]; if(Dfs(X, Y, pos + 1)){ return true; } } board[x][y] = c; return false; } public: bool exist(vector<vector<char>>& board_, string& word_) { board.swap(board_); word.swap(word_); n = board.size(); m = board[0].size(); l = word.length(); if(l == 0){ return true; } if(l > n * m){ return false; } for(int i = 0; i < n; i++){ for(int j = 0; j < m; j++){ if(board[i][j] != word[0]) continue; if(Dfs(i, j, 0)){ return true; } } } return false; } }; int main() { // vector<double> ans = {1.00000,-1.00000,3.00000,-1.00000}; // vector<vector<int>> cars = {{1, 2}, {2, 1}, {4, 3}, {7, 2}}; // TEST_SMP1(Solution, getCollisionTimes, ans, cars); return 0; }
[ "i@tiankonguse.com" ]
i@tiankonguse.com
84db569c213b8a0be5f75b10190a23444cc0b83c
d2190cbb5ea5463410eb84ec8b4c6a660e4b3d0e
/old_hydra/hydra/tags/apr07/hyp/hhypPPEpEmXAlg.cc
b95962f79a00f025cfc3ecfa2a1eeae8a8f96ab2
[]
no_license
wesmail/hydra
6c681572ff6db2c60c9e36ec864a3c0e83e6aa6a
ab934d4c7eff335cc2d25f212034121f050aadf1
refs/heads/master
2021-07-05T17:04:53.402387
2020-08-12T08:54:11
2020-08-12T08:54:11
149,625,232
0
0
null
null
null
null
UTF-8
C++
false
false
6,054
cc
//*-- Author : B. Spruck //*-- Modified : 2005-04-25 //*-- Modified : 22/Dec/2005 B. Spruck //_HADES_CLASS_DESCRIPTION //////////////////////////////////////////////////////////////////////// // // HHypPPEpEmXAlg // // This Algorythm will select 4, 5 and 6 particle evens with the following // conditions: 3p+1n, 4p+1n 3p+2n, for the 5 particle events one // particle is threaten as FAKE, and removed from the list // => Output is in ANY case a 3p+1n event!!! // // 1 Fake events are only taken if ONEFAKE is set. // 2 Fake events are only taken if TWOFAKES is set. // Note: TWOFAKES will not add ONEFAKE option! // // Note for adding more fillers: // Make sure you cover ALL cases! // F.e. 3fakes: 4+p3 4+p2n1 4+p1n2 4+n3 // //////////////////////////////////////////////////////////////////////// using namespace std; #include <stdlib.h> #include <iostream> #include "hhypPPEpEmXAlg.h" #include "hypinfodef.h" ClassImp(HHypPPEpEmXAlg) HHypPPEpEmXAlg::HHypPPEpEmXAlg(char *name_i, Option_t par[]) :HHypBaseAlgorithm(name_i,par) { // 4 Particles filler = NULL; filler4 = NULL; // 4 + 1 fake filler4p1 = NULL; filler4m1 = NULL; // 4 + 2 fakes filler4p2 = NULL; filler4p1m1 = NULL; filler4m2 = NULL; } HHypPPEpEmXAlg::~HHypPPEpEmXAlg() { if (filler) delete filler; if (filler4) delete filler4; if (filler4p1) delete filler4p1; if (filler4m1) delete filler4m1; if (filler4p2) delete filler4p2; if (filler4p1m1) delete filler4p1m1; if (filler4m2) delete filler4m2; } Bool_t HHypPPEpEmXAlg::execute() { // In principle, the first question should be: // How many particles are in that events! // Depending on that the appopriate filler should be called. // Doing it in the following way is a waste of cpu time ... // 4 Particles if( use_InclusiveFiller){ if(exitIdx==ERROR_IDX) exitIdx = filler->execute(); if (exitIdx > -1) return kTRUE; return kFALSE; } exitIdx = filler4->execute(); // 4+1 fake if( use_4_1){ // if no 3p 1n then try next filler if(exitIdx==ERROR_IDX) exitIdx = filler4m1->execute(); // if no 3p 2n then try next filler if(exitIdx==ERROR_IDX) exitIdx = filler4p1->execute(); // if no 4p 1n then forget about it } // 4+2 fakes if( use_4_2){ if(exitIdx==ERROR_IDX) exitIdx = filler4m2->execute(); if(exitIdx==ERROR_IDX) exitIdx = filler4p1m1->execute(); if(exitIdx==ERROR_IDX) exitIdx = filler4p2->execute(); } if (exitIdx > -1) return kTRUE; return kFALSE; } Bool_t HHypPPEpEmXAlg::init() { Bool_t flag; use_InclusiveFiller = kFALSE; use_InclusiveFiller = (GetOpt("use_InclusiveFiller") != NULL); if( use_InclusiveFiller ){ filler = new HHypListFillerInclusive("filler", "filler"); filler->AddTrack(HPidPhysicsConstants::pid("p")); filler->AddTrack(HPidPhysicsConstants::pid("p")); filler->AddTrack(HPidPhysicsConstants::pid("e+")); filler->AddTrack(HPidPhysicsConstants::pid("e-")); flag = filler->init(); return flag; } use_4_1 = kFALSE; use_4_1 = (GetOpt("ONEFAKE") != NULL); use_4_2 = kFALSE; use_4_2 = (GetOpt("TWOFAKES") != NULL); // Normal 4 part filler filler4 = new HHypListFiller("filler4", "filler4"); filler4->SetExitList(exitList); filler4->AddTrack(HPidPhysicsConstants::pid("p")); filler4->AddTrack(HPidPhysicsConstants::pid("p")); filler4->AddTrack(HPidPhysicsConstants::pid("e+")); filler4->AddTrack(HPidPhysicsConstants::pid("e-")); flag=filler4->init(); // 4 + 1 part filler if(use_4_1){ cout << "HHypPPEpEmXAlg will use option ONEFAKE" << endl; filler4p1 = new HHypListFiller("filler4p1", "filler4p1"); filler4p1->SetExitList(exitList); filler4p1->AddTrack(HPidPhysicsConstants::pid("p")); filler4p1->AddTrack(HPidPhysicsConstants::pid("p")); filler4p1->AddTrack(HPidPhysicsConstants::pid("e+")); filler4p1->AddTrack(HPidPhysicsConstants::pid("e-")); filler4p1->AddTrack(HPidPhysicsConstants::fakePos()); flag &= filler4p1->init(); filler4m1 = new HHypListFiller("filler4m1", "filler4m1"); filler4m1->SetExitList(exitList); filler4m1->AddTrack(HPidPhysicsConstants::pid("p")); filler4m1->AddTrack(HPidPhysicsConstants::pid("p")); filler4m1->AddTrack(HPidPhysicsConstants::pid("e+")); filler4m1->AddTrack(HPidPhysicsConstants::pid("e-")); filler4m1->AddTrack(HPidPhysicsConstants::fakeNeg()); flag &= filler4m1->init(); } // 4 + 2 part filler if(use_4_2){ cout << "HHypPPEpEmXAlg will use option TWOFAKES" << endl; filler4p2 = new HHypListFiller("filler4p2", "filler4p2"); filler4p2->SetExitList(exitList); filler4p2->AddTrack(HPidPhysicsConstants::pid("p")); filler4p2->AddTrack(HPidPhysicsConstants::pid("p")); filler4p2->AddTrack(HPidPhysicsConstants::pid("e+")); filler4p2->AddTrack(HPidPhysicsConstants::pid("e-")); filler4p2->AddTrack(HPidPhysicsConstants::fakePos()); filler4p2->AddTrack(HPidPhysicsConstants::fakePos()); flag &= filler4p2->init(); filler4p1m1 = new HHypListFiller("filler4p1m1", "filler4p1m1"); filler4p1m1->SetExitList(exitList); filler4p1m1->AddTrack(HPidPhysicsConstants::pid("p")); filler4p1m1->AddTrack(HPidPhysicsConstants::pid("p")); filler4p1m1->AddTrack(HPidPhysicsConstants::pid("e+")); filler4p1m1->AddTrack(HPidPhysicsConstants::pid("e-")); filler4p1m1->AddTrack(HPidPhysicsConstants::fakePos()); filler4p1m1->AddTrack(HPidPhysicsConstants::fakeNeg()); flag &= filler4p1m1->init(); filler4m2 = new HHypListFiller("filler4m2", "filler4m2"); filler4m2->SetExitList(exitList); filler4m2->AddTrack(HPidPhysicsConstants::pid("p")); filler4m2->AddTrack(HPidPhysicsConstants::pid("p")); filler4m2->AddTrack(HPidPhysicsConstants::pid("e+")); filler4m2->AddTrack(HPidPhysicsConstants::pid("e-")); filler4m2->AddTrack(HPidPhysicsConstants::fakeNeg()); filler4m2->AddTrack(HPidPhysicsConstants::fakeNeg()); flag &= filler4m2->init(); } return flag; } Bool_t HHypPPEpEmXAlg::reinit() { return kTRUE; } Bool_t HHypPPEpEmXAlg::finalize() { return kTRUE; }
[ "waleed.physics@gmail.com" ]
waleed.physics@gmail.com
45e752f1dff571c728aa701b5365dcb8cb182e66
a4385a4852daf4435d98c373990739ccc8d96c61
/d2.cpp
5d810edcbaa34d2d6f00f26275d1fd8992e9512f
[]
no_license
divanshArora/Algorithms
c4bc92d4a20af69d8cd3fd6e6c194785e7499203
87c6e15ec12c76e907619c438d360be70887ac5d
refs/heads/master
2020-06-10T17:39:36.559998
2019-07-04T11:27:51
2019-07-04T11:27:51
75,919,807
0
0
null
null
null
null
UTF-8
C++
false
false
3,467
cpp
// Program to find Dijkstra's shortest path using STL set //Correct tested geeks for geeks copy #include<bits/stdc++.h> using namespace std; # define INF 0x3f3f3f3f // This class represents a directed graph using // adjacency list representation class Graph { int V; // No. of vertices // In a weighted graph, we need to store vertex // and weight pair for every edge list< pair<int, int> > *adj; public: Graph(int V); // Constructor // function to add an edge to graph void addEdge(int u, int v, int w); // prints shortest path from s void shortestPath(int s,int B); }; // Allocates memory for adjacency list Graph::Graph(int V) { this->V = V; adj = new list< pair<int, int> >[V]; } void Graph::addEdge(int u, int v, int w) { adj[u].push_back(make_pair(v, w)); } // Prints shortest paths from src to all other vertices void Graph::shortestPath(int src, int B) { // Create a set to store vertices that are being // prerocessed set< pair<int, int> > setds; // Create a vector for distances and initialize all // distances as infinite (INF) vector<int> dist(V, INF); // Insert source itself in Set and initialize its // distance as 0. setds.insert(make_pair(0, src)); dist[src] = 0; /* Looping till all shortest distance are finalized then setds will become empty */ while (!setds.empty()) { // The first vertex in Set is the minimum distance // vertex, extract it from set. pair<int, int> tmp = *(setds.begin()); setds.erase(setds.begin()); // vertex label is stored in second of pair (it // has to be done this way to keep the vertices // sorted distance (distance must be first item // in pair) int u = tmp.second; // 'i' is used to get all adjacent vertices of a vertex list< pair<int, int> >::iterator i; for (i = adj[u].begin(); i != adj[u].end(); ++i) { // Get vertex label and weight of current adjacent // of u. int v = (*i).first; int weight = (*i).second; // If there is shorter path to v through u. if (dist[v] > dist[u] + weight) { /* If distance of v is not INF then it must be in our set, so removing it and inserting again with updated less distance. Note : We extract only those vertices from Set for which distance is finalized. So for them, we would never reach here. */ if (dist[v] != INF) setds.erase(setds.find(make_pair(dist[v], v))); // Updating distance of v dist[v] = dist[u] + weight; setds.insert(make_pair(dist[v], v)); } } } // Print shortest distances stored in dist[] //printf("Vertex Distance from Source\n"); if(dist[B]==INF) { printf("NO\n"); } else { printf("%d\n",dist[B]); } } // Driver program to test methods of graph class int main() { int t; cin>>t; while(t--) { int n,e; scanf("%d%d",&n,&e); Graph g(n); for(int i=0;i<e;i++) { int a,b,c; scanf("%d%d%d",&a,&b,&c); a--;b--; g.addEdge(a,b,c); } int A,B; scanf("%d%d",&A,&B); A--;B--; g.shortestPath(A,B); } return 0; }
[ "divanshar@gmail.com" ]
divanshar@gmail.com
b6cee4ae543a5aee7cad3dd7580398812689a026
233b5624f5dd13bc8fd01001ae811e1fb3c67d48
/examples/lighting-app/linux/main.cpp
9a1500a04f77b24a457ed33b67c947eacfcfac71
[ "LicenseRef-scancode-unknown-license-reference", "Apache-2.0" ]
permissive
jotaemedois/connectedhomeip
5b619652f842b15c5d10e2174692c7a26af7f940
74c269637293e0ac349862c47cd3e3f35302fa1d
refs/heads/master
2023-02-12T08:43:37.970146
2021-01-11T14:38:59
2021-01-11T14:38:59
null
0
0
null
null
null
null
UTF-8
C++
false
false
6,130
cpp
/* * * Copyright (c) 2020 Project CHIP Authors * All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <platform/CHIPDeviceLayer.h> #include <platform/PlatformManager.h> #include "af.h" #include "gen/attribute-id.h" #include "gen/cluster-id.h" #include <app/chip-zcl-zpro-codec.h> #include <app/util/af-types.h> #include <app/util/attribute-storage.h> #include <app/util/util.h> #include <core/CHIPError.h> #include <setup_payload/QRCodeSetupPayloadGenerator.h> #include <setup_payload/SetupPayload.h> #include <support/CHIPMem.h> #include <support/RandUtils.h> #include "LightingManager.h" #include "Options.h" #include "Server.h" #include <cassert> #include <iostream> using namespace chip; using namespace chip::Inet; using namespace chip::Transport; using namespace chip::DeviceLayer; constexpr uint32_t kDefaultSetupPinCode = 12345678; // TODO: Should be a macro in CHIPProjectConfig.h like other example apps. void emberAfPostAttributeChangeCallback(EndpointId endpoint, ClusterId clusterId, AttributeId attributeId, uint8_t mask, uint16_t manufacturerCode, uint8_t type, uint8_t size, uint8_t * value) { if (clusterId != ZCL_ON_OFF_CLUSTER_ID) { ChipLogProgress(Zcl, "Unknown cluster ID: %d", clusterId); return; } if (attributeId != ZCL_ON_OFF_ATTRIBUTE_ID) { ChipLogProgress(Zcl, "Unknown attribute ID: %d", attributeId); return; } if (*value) { LightingMgr().InitiateAction(LightingManager::ON_ACTION); } else { LightingMgr().InitiateAction(LightingManager::OFF_ACTION); } } /** @brief OnOff Cluster Init * * This function is called when a specific cluster is initialized. It gives the * application an opportunity to take care of cluster initialization procedures. * It is called exactly once for each endpoint where cluster is present. * * @param endpoint Ver.: always * * TODO Issue #3841 * emberAfOnOffClusterInitCallback happens before the stack initialize the cluster * attributes to the default value. * The logic here expects something similar to the deprecated Plugins callback * emberAfPluginOnOffClusterServerPostInitCallback. * */ void emberAfOnOffClusterInitCallback(EndpointId endpoint) { // TODO: implement any additional Cluster Server init actions } namespace { void EventHandler(const chip::DeviceLayer::ChipDeviceEvent * event, intptr_t arg) { (void) arg; if (event->Type == chip::DeviceLayer::DeviceEventType::kCHIPoBLEConnectionEstablished) { ChipLogProgress(DeviceLayer, "Receive kCHIPoBLEConnectionEstablished"); } } CHIP_ERROR PrintQRCodeContent() { CHIP_ERROR err = CHIP_NO_ERROR; // If we do not have a discriminator, generate one chip::SetupPayload payload; uint32_t setUpPINCode; uint16_t setUpDiscriminator; uint16_t vendorId; uint16_t productId; std::string result; err = ConfigurationMgr().GetSetupPinCode(setUpPINCode); if (err == CHIP_DEVICE_ERROR_CONFIG_NOT_FOUND) { setUpPINCode = kDefaultSetupPinCode; err = ConfigurationMgr().StoreSetupPinCode(setUpPINCode); } SuccessOrExit(err); err = ConfigurationMgr().GetSetupDiscriminator(setUpDiscriminator); if (err == CHIP_DEVICE_ERROR_CONFIG_NOT_FOUND) { setUpDiscriminator = GetRandU16() & 0xFFF; err = ConfigurationMgr().StoreSetupDiscriminator(setUpDiscriminator); } SuccessOrExit(err); err = ConfigurationMgr().GetVendorId(vendorId); SuccessOrExit(err); err = ConfigurationMgr().GetProductId(productId); SuccessOrExit(err); payload.version = 1; payload.vendorID = vendorId; payload.productID = productId; payload.setUpPINCode = setUpPINCode; payload.discriminator = setUpDiscriminator; // Wrap it so SuccessOrExit can work { chip::QRCodeSetupPayloadGenerator generator(payload); err = generator.payloadBase41Representation(result); SuccessOrExit(err); } std::cout << "SetupPINCode: [" << setUpPINCode << "]" << std::endl; // There might be whitespace in setup QRCode, add brackets to make it clearer. std::cout << "SetupQRCode: [" << result << "]" << std::endl; exit: if (err != CHIP_NO_ERROR) { std::cerr << "Failed to generate QR Code: " << ErrorStr(err) << std::endl; } return err; } } // namespace int main(int argc, char * argv[]) { CHIP_ERROR err = CHIP_NO_ERROR; err = chip::Platform::MemoryInit(); SuccessOrExit(err); err = ParseArguments(argc, argv); SuccessOrExit(err); err = chip::DeviceLayer::PlatformMgr().InitChipStack(); SuccessOrExit(err); err = PrintQRCodeContent(); SuccessOrExit(err); chip::DeviceLayer::PlatformMgrImpl().AddEventHandler(EventHandler, 0); chip::DeviceLayer::ConnectivityMgr().SetBLEDeviceName(nullptr); // Use default device name (CHIP-XXXX) chip::DeviceLayer::Internal::BLEMgrImpl().ConfigureBle(LinuxDeviceOptions::GetInstance().mBleDevice, false); chip::DeviceLayer::ConnectivityMgr().SetBLEAdvertisingEnabled(true); LightingMgr().Init(); // Init ZCL Data Model and CHIP App Server InitServer(); chip::DeviceLayer::PlatformMgr().RunEventLoop(); exit: if (err != CHIP_NO_ERROR) { std::cerr << "Failed to run Linux Lighting App: " << ErrorStr(err) << std::endl; // End the program with non zero error code to indicate a error. return 1; } return 0; }
[ "noreply@github.com" ]
jotaemedois.noreply@github.com
b3f58c95e8602061fb6a993a36762ff7835678ee
6301e2e3669b5f194253e099527212cfe5e4fc92
/leetcode/spiral-matrix-ii/spiral-matrix-ii.cpp
f6bb140dc8b47b87525a2f52ce506853da8e8128
[]
no_license
jiongdu/Algorithm
253ff365d812aefdd12f25970530775cb3b75e4d
14e58057da7439d9818cfb9547d4b5713c1e1e26
refs/heads/master
2021-06-05T10:18:01.631658
2021-05-02T06:58:54
2021-05-02T06:58:54
62,377,889
4
3
null
null
null
null
UTF-8
C++
false
false
812
cpp
/************************************** * @author dujiong * @date 2016.12.2 * @version V0.1 **************************************/ class Solution { public: vector<vector<int> > generateMatrix(int n) { vector<vector<int> > res(n, vector<int>(n, 0)); int level=n/2; int num=1; for(int l=0;l<level;l++){ for(int i=l;i<n-l;i++){ res[l][i]=num++; } for(int i=l+1;i<n-l;i++){ res[i][n-1-l]=num++; } for(int i=n-2-l;i>=l;i--){ res[n-1-l][i]=num++; } for(int i=n-2-l;i>l;i--){ res[i][l]=num++; } } if(n%2==1){ res[level][level]=n*n; } return res; } };
[ "dujiong.uestc@gmail.com" ]
dujiong.uestc@gmail.com
b0d58139fd8bb55ee7602d3dcd6c2b681cab72b3
60ecb2cf32ae8b94e9796981d2ff06a769555072
/problems/uva/11498 Division of Nlogonia.cpp
864d24d5c04ebae39c31ea0edb81c0f9f12db3aa
[]
no_license
klhui97/CS3391
fbe06b1cdd90d9d03617bad5065501f53d48f7e6
09a516df73ac45232a4a2a01a4d39e0e550ea5f3
refs/heads/master
2020-04-17T09:08:17.234360
2019-06-17T15:57:52
2019-06-17T15:57:52
166,446,278
0
0
null
null
null
null
UTF-8
C++
false
false
731
cpp
#include <iostream> using namespace std; int main() { int m, n, x, y, t; scanf("%d",&t); while (t != 0) { scanf("%d %d",&n,&m); while(t--) { scanf("%d %d",&x,&y); if (abs(n) == abs(x) || abs(m) == abs(y)) { printf("divisa\n"); }else if (n > x) { if (m > y) { printf("SO\n"); }else { printf("NO\n"); } }else { if (m > y) { printf("SE\n"); }else { printf("NE\n"); } } } scanf("%d",&t); } return 0; }
[ "huikldavid@gmail.com" ]
huikldavid@gmail.com
cd16c51560513108f26445776f9dbc978c5bdd7d
bdc72f89c090e1ba1ecb1bc36d63f9087f1c70d9
/lab5qt/widget.cpp
7ca4c310952a13787ff7f6a415723a9dd97cf5cf
[]
no_license
Lixard/computer-graphics-labs
ec6e852480cc9533dda4def9ef54c72f2e4f811a
1dcb6ad5a0a08f145bbe96c6e2ca4970ca4aae76
refs/heads/master
2022-12-10T06:30:47.401520
2020-06-22T08:20:36
2020-06-22T08:20:36
273,510,144
0
0
null
null
null
null
UTF-8
C++
false
false
3,631
cpp
#include "widget.h" #include "ui_widget.h" #include "findcoordpoint.h" #define eps 0.0001 #include <cmath> #include <QMessageBox> #include <QPainter> double dist_p_p(double ax, double ay, double bx, double by) { return sqrt((bx - ax)*(bx - ax) + (by - ay)*(by - ay)); } double GetDistanceToSegment(double ax, double ay, double bx, double by, double x, double y) { double a = dist_p_p(x, y, ax, ay); double b = dist_p_p(x, y, bx, by); double c = dist_p_p(ax, ay, bx, by); if (c < eps) return 0; if (a >= b + c) return b; if (b >= a + c) return a; double p = (a + b + c) / 2.0; double s = sqrt((p - a) * (p - b) * (p - c) * p); return s * 2.0 / c; } Widget::Widget(QWidget *parent) : QWidget(parent) , ui(new Ui::Widget) { ui->setupUi(this); setFixedSize(800,600); } Widget::~Widget() { delete ui; } void Widget::createLines(QPainter &painter){ QPen pen(Qt::black); pen.setWidth(5); QPoint line1_point1(line1_x1,line1_y1); QPoint line1_point2(line1_x2,line1_y2); QPoint line2_point1(line2_x1,line2_y1); QPoint line2_point2(line2_x2,line2_y2); painter.setPen(pen); painter.drawLine(line1_point1,line1_point2); painter.drawLine(line2_point1,line2_point2); } void Widget::paintEvent(QPaintEvent *event) { Q_UNUSED(event); QPainter painter(this); createLines(painter); search_dist(painter); createPoint(painter); } void Widget::createPoint(QPainter &painter){ QPen pen(Qt::darkBlue); pen.setWidth(8); QPoint point(point_x,point_y); painter.setPen(pen); painter.drawPoint(point); } void Widget::search_dist(QPainter &painter) { QPen pen(Qt::yellow); pen.setWidth(6); QPoint point(x,y); painter.setPen(pen); painter.drawPoint(point); } void Widget::on_drawLines_clicked() { line1_x1 = ui->line1_x1->text().toDouble(); line1_y1 = ui->line1_y1->text().toDouble(); line1_x2 = ui->line1_x2->text().toDouble(); line1_y2 = ui->line1_y2->text().toDouble(); line2_x1 = ui->line2_x1->text().toDouble(); line2_y1 = ui->line2_y1->text().toDouble(); line2_x2 = ui->line2_x2->text().toDouble(); line2_y2 = ui->line2_y2->text().toDouble(); update(); } void Widget::on_findDistance_clicked() { QMessageBox message; double dist1 = GetDistanceToSegment(line1_x1,line1_y1,line1_x2,line1_y2,point_x,point_y); double dist2 = GetDistanceToSegment(line2_x1,line2_y1,line2_x2,line2_y2,point_x,point_y); if(dist1>dist2) { QString str = "Расстояние от точки до первого отрезка: " + QString::number(dist2); message.setText(str); message.exec(); } else { QString str = "Расстояние от точки до второго отрезка: " + QString::number(dist1); message.setText(str); message.exec(); } } void Widget::on_drawPoint_clicked() { point_x = ui->point_x->text().toDouble(); point_y = ui->point_y->text().toDouble(); update(); } void Widget::on_findCommonPoint_clicked() { FindCoordPoint findCoordPoint; findCoordPoint.addListPoint(line1_x1,line1_y1); findCoordPoint.addListPoint(line1_x2,line1_y2); findCoordPoint.addListPoint(line2_x1,line2_y1); findCoordPoint.addListPoint(line2_x2,line2_y2); if (findCoordPoint.setDataLine()) { findCoordPoint.getXYCoord(findX,findY); x = findX; y = findY; ui->commonPoint_x->setText(QLocale ().toString(findX)); ui->commonPoint_y->setText(QLocale ().toString(findY)); update(); } }
[ "Lixard870@gmail.com" ]
Lixard870@gmail.com
7ca8d007eb269ba091f382d481fd79c8bebc99aa
fb7efe44f4d9f30d623f880d0eb620f3a81f0fbd
/components/prefs/testing_pref_service.cc
fdaa33b0fa277f1252ba342c388324cf9cb968ed
[ "BSD-3-Clause" ]
permissive
wzyy2/chromium-browser
2644b0daf58f8b3caee8a6c09a2b448b2dfe059c
eb905f00a0f7e141e8d6c89be8fb26192a88c4b7
refs/heads/master
2022-11-23T20:25:08.120045
2018-01-16T06:41:26
2018-01-16T06:41:26
117,618,467
3
2
BSD-3-Clause
2022-11-20T22:03:57
2018-01-16T02:09:10
null
UTF-8
C++
false
false
2,103
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 "components/prefs/testing_pref_service.h" #include "base/bind.h" #include "base/compiler_specific.h" #include "components/prefs/default_pref_store.h" #include "components/prefs/pref_notifier_impl.h" #include "components/prefs/pref_registry_simple.h" #include "components/prefs/pref_value_store.h" #include "testing/gtest/include/gtest/gtest.h" template <> TestingPrefServiceBase<PrefService, PrefRegistry>::TestingPrefServiceBase( TestingPrefStore* managed_prefs, TestingPrefStore* extension_prefs, TestingPrefStore* user_prefs, TestingPrefStore* recommended_prefs, PrefRegistry* pref_registry, PrefNotifierImpl* pref_notifier) : PrefService( pref_notifier, new PrefValueStore(managed_prefs, NULL, extension_prefs, NULL, user_prefs, recommended_prefs, pref_registry->defaults().get(), pref_notifier), user_prefs, pref_registry, base::Bind(&TestingPrefServiceBase<PrefService, PrefRegistry>::HandleReadError), false), managed_prefs_(managed_prefs), extension_prefs_(extension_prefs), user_prefs_(user_prefs), recommended_prefs_(recommended_prefs) {} TestingPrefServiceSimple::TestingPrefServiceSimple() : TestingPrefServiceBase<PrefService, PrefRegistry>( new TestingPrefStore(), new TestingPrefStore(), new TestingPrefStore(), new TestingPrefStore(), new PrefRegistrySimple(), new PrefNotifierImpl()) {} TestingPrefServiceSimple::~TestingPrefServiceSimple() { } PrefRegistrySimple* TestingPrefServiceSimple::registry() { return static_cast<PrefRegistrySimple*>(DeprecatedGetPrefRegistry()); }
[ "jacob-chen@iotwrt.com" ]
jacob-chen@iotwrt.com
db5176e4b3af81ca9abdbd47aa369d793cf85e21
3cf9e141cc8fee9d490224741297d3eca3f5feff
/C++ Benchmark Programs/Benchmark Files 1/classtester/autogen-sources/source-3178.cpp
a7623b8ce0f63e539f27836a64bea3e5c635aedf
[]
no_license
TeamVault/tauCFI
e0ac60b8106fc1bb9874adc515fc01672b775123
e677d8cc7acd0b1dd0ac0212ff8362fcd4178c10
refs/heads/master
2023-05-30T20:57:13.450360
2021-06-14T09:10:24
2021-06-14T09:10:24
154,563,655
0
1
null
null
null
null
UTF-8
C++
false
false
2,389
cpp
struct c0; void __attribute__ ((noinline)) tester0(c0* p); struct c0 { bool active0; c0() : active0(true) {} virtual ~c0() { tester0(this); active0 = false; } virtual void f0(){} }; void __attribute__ ((noinline)) tester0(c0* p) { p->f0(); } struct c1; void __attribute__ ((noinline)) tester1(c1* p); struct c1 { bool active1; c1() : active1(true) {} virtual ~c1() { tester1(this); active1 = false; } virtual void f1(){} }; void __attribute__ ((noinline)) tester1(c1* p) { p->f1(); } struct c2; void __attribute__ ((noinline)) tester2(c2* p); struct c2 { bool active2; c2() : active2(true) {} virtual ~c2() { tester2(this); active2 = false; } virtual void f2(){} }; void __attribute__ ((noinline)) tester2(c2* p) { p->f2(); } struct c3; void __attribute__ ((noinline)) tester3(c3* p); struct c3 : c2, c0 { bool active3; c3() : active3(true) {} virtual ~c3() { tester3(this); c0 *p0_0 = (c0*)(c3*)(this); tester0(p0_0); c2 *p2_0 = (c2*)(c3*)(this); tester2(p2_0); active3 = false; } virtual void f3(){} }; void __attribute__ ((noinline)) tester3(c3* p) { p->f3(); if (p->active0) p->f0(); if (p->active2) p->f2(); } struct c4; void __attribute__ ((noinline)) tester4(c4* p); struct c4 : c1, virtual c0, virtual c2 { bool active4; c4() : active4(true) {} virtual ~c4() { tester4(this); c0 *p0_0 = (c0*)(c4*)(this); tester0(p0_0); c1 *p1_0 = (c1*)(c4*)(this); tester1(p1_0); c2 *p2_0 = (c2*)(c4*)(this); tester2(p2_0); active4 = false; } virtual void f4(){} }; void __attribute__ ((noinline)) tester4(c4* p) { p->f4(); if (p->active1) p->f1(); if (p->active0) p->f0(); if (p->active2) p->f2(); } int __attribute__ ((noinline)) inc(int v) {return ++v;} int main() { c0* ptrs0[25]; ptrs0[0] = (c0*)(new c0()); ptrs0[1] = (c0*)(c3*)(new c3()); ptrs0[2] = (c0*)(c4*)(new c4()); for (int i=0;i<3;i=inc(i)) { tester0(ptrs0[i]); delete ptrs0[i]; } c1* ptrs1[25]; ptrs1[0] = (c1*)(new c1()); ptrs1[1] = (c1*)(c4*)(new c4()); for (int i=0;i<2;i=inc(i)) { tester1(ptrs1[i]); delete ptrs1[i]; } c2* ptrs2[25]; ptrs2[0] = (c2*)(new c2()); ptrs2[1] = (c2*)(c3*)(new c3()); ptrs2[2] = (c2*)(c4*)(new c4()); for (int i=0;i<3;i=inc(i)) { tester2(ptrs2[i]); delete ptrs2[i]; } c3* ptrs3[25]; ptrs3[0] = (c3*)(new c3()); for (int i=0;i<1;i=inc(i)) { tester3(ptrs3[i]); delete ptrs3[i]; } c4* ptrs4[25]; ptrs4[0] = (c4*)(new c4()); for (int i=0;i<1;i=inc(i)) { tester4(ptrs4[i]); delete ptrs4[i]; } return 0; }
[ "ga72foq@mytum.de" ]
ga72foq@mytum.de
960943a99fb02e971f30c3516d9aee2f1a562a81
9016e3870e9e06957f25e127b3f50225db4d65b4
/src/net/third_party/quiche/src/quic/core/congestion_control/bbr_sender_test.cc
6acfe80519ad80080df2e0040909640208b10219
[ "BSD-3-Clause" ]
permissive
bylond/naiveproxy
f0a30493e0662251247a87c73a1b73388ef16d1b
a04a8330a8bb0d0892259cf6d795271fbe6e6d0e
refs/heads/master
2021-02-02T00:46:35.836722
2020-03-11T03:43:22
2020-03-11T03:43:22
243,525,007
1
0
BSD-3-Clause
2020-03-11T03:43:23
2020-02-27T13:23:59
null
UTF-8
C++
false
false
60,896
cc
// Copyright 2016 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "net/third_party/quiche/src/quic/core/congestion_control/bbr_sender.h" #include <algorithm> #include <map> #include <memory> #include <utility> #include "net/third_party/quiche/src/quic/core/congestion_control/rtt_stats.h" #include "net/third_party/quiche/src/quic/core/quic_packets.h" #include "net/third_party/quiche/src/quic/core/quic_utils.h" #include "net/third_party/quiche/src/quic/platform/api/quic_flags.h" #include "net/third_party/quiche/src/quic/platform/api/quic_logging.h" #include "net/third_party/quiche/src/quic/platform/api/quic_test.h" #include "net/third_party/quiche/src/quic/test_tools/mock_clock.h" #include "net/third_party/quiche/src/quic/test_tools/quic_config_peer.h" #include "net/third_party/quiche/src/quic/test_tools/quic_connection_peer.h" #include "net/third_party/quiche/src/quic/test_tools/quic_sent_packet_manager_peer.h" #include "net/third_party/quiche/src/quic/test_tools/quic_test_utils.h" #include "net/third_party/quiche/src/quic/test_tools/simulator/quic_endpoint.h" #include "net/third_party/quiche/src/quic/test_tools/simulator/simulator.h" #include "net/third_party/quiche/src/quic/test_tools/simulator/switch.h" using testing::AllOf; using testing::Ge; using testing::Le; namespace quic { namespace test { // Use the initial CWND of 10, as 32 is too much for the test network. const uint32_t kInitialCongestionWindowPackets = 10; const uint32_t kDefaultWindowTCP = kInitialCongestionWindowPackets * kDefaultTCPMSS; // Test network parameters. Here, the topology of the network is: // // BBR sender // | // | <-- local link (10 Mbps, 2 ms delay) // | // Network switch // * <-- the bottleneck queue in the direction // | of the receiver // | // | <-- test link (4 Mbps, 30 ms delay) // | // | // Receiver // // The reason the bandwidths chosen are relatively low is the fact that the // connection simulator uses QuicTime for its internal clock, and as such has // the granularity of 1us, meaning that at bandwidth higher than 20 Mbps the // packets can start to land on the same timestamp. const QuicBandwidth kTestLinkBandwidth = QuicBandwidth::FromKBitsPerSecond(4000); const QuicBandwidth kLocalLinkBandwidth = QuicBandwidth::FromKBitsPerSecond(10000); const QuicTime::Delta kTestPropagationDelay = QuicTime::Delta::FromMilliseconds(30); const QuicTime::Delta kLocalPropagationDelay = QuicTime::Delta::FromMilliseconds(2); const QuicTime::Delta kTestTransferTime = kTestLinkBandwidth.TransferTime(kMaxOutgoingPacketSize) + kLocalLinkBandwidth.TransferTime(kMaxOutgoingPacketSize); const QuicTime::Delta kTestRtt = (kTestPropagationDelay + kLocalPropagationDelay + kTestTransferTime) * 2; const QuicByteCount kTestBdp = kTestRtt * kTestLinkBandwidth; class BbrSenderTest : public QuicTest { protected: BbrSenderTest() : simulator_(), bbr_sender_(&simulator_, "BBR sender", "Receiver", Perspective::IS_CLIENT, /*connection_id=*/TestConnectionId(42)), competing_sender_(&simulator_, "Competing sender", "Competing receiver", Perspective::IS_CLIENT, /*connection_id=*/TestConnectionId(43)), receiver_(&simulator_, "Receiver", "BBR sender", Perspective::IS_SERVER, /*connection_id=*/TestConnectionId(42)), competing_receiver_(&simulator_, "Competing receiver", "Competing sender", Perspective::IS_SERVER, /*connection_id=*/TestConnectionId(43)), receiver_multiplexer_("Receiver multiplexer", {&receiver_, &competing_receiver_}) { rtt_stats_ = bbr_sender_.connection()->sent_packet_manager().GetRttStats(); sender_ = SetupBbrSender(&bbr_sender_); clock_ = simulator_.GetClock(); simulator_.set_random_generator(&random_); uint64_t seed = QuicRandom::GetInstance()->RandUint64(); random_.set_seed(seed); QUIC_LOG(INFO) << "BbrSenderTest simulator set up. Seed: " << seed; } simulator::Simulator simulator_; simulator::QuicEndpoint bbr_sender_; simulator::QuicEndpoint competing_sender_; simulator::QuicEndpoint receiver_; simulator::QuicEndpoint competing_receiver_; simulator::QuicEndpointMultiplexer receiver_multiplexer_; std::unique_ptr<simulator::Switch> switch_; std::unique_ptr<simulator::SymmetricLink> bbr_sender_link_; std::unique_ptr<simulator::SymmetricLink> competing_sender_link_; std::unique_ptr<simulator::SymmetricLink> receiver_link_; SimpleRandom random_; // Owned by different components of the connection. const QuicClock* clock_; const RttStats* rtt_stats_; BbrSender* sender_; // Enables BBR on |endpoint| and returns the associated BBR congestion // controller. BbrSender* SetupBbrSender(simulator::QuicEndpoint* endpoint) { const RttStats* rtt_stats = endpoint->connection()->sent_packet_manager().GetRttStats(); // Ownership of the sender will be overtaken by the endpoint. BbrSender* sender = new BbrSender( endpoint->connection()->clock()->Now(), rtt_stats, QuicSentPacketManagerPeer::GetUnackedPacketMap( QuicConnectionPeer::GetSentPacketManager(endpoint->connection())), kInitialCongestionWindowPackets, GetQuicFlag(FLAGS_quic_max_congestion_window), &random_, QuicConnectionPeer::GetStats(endpoint->connection())); QuicConnectionPeer::SetSendAlgorithm(endpoint->connection(), sender); endpoint->RecordTrace(); return sender; } // Creates a default setup, which is a network with a bottleneck between the // receiver and the switch. The switch has the buffers four times larger than // the bottleneck BDP, which should guarantee a lack of losses. void CreateDefaultSetup() { switch_ = std::make_unique<simulator::Switch>(&simulator_, "Switch", 8, 2 * kTestBdp); bbr_sender_link_ = std::make_unique<simulator::SymmetricLink>( &bbr_sender_, switch_->port(1), kLocalLinkBandwidth, kLocalPropagationDelay); receiver_link_ = std::make_unique<simulator::SymmetricLink>( &receiver_, switch_->port(2), kTestLinkBandwidth, kTestPropagationDelay); } // Same as the default setup, except the buffer now is half of the BDP. void CreateSmallBufferSetup() { switch_ = std::make_unique<simulator::Switch>(&simulator_, "Switch", 8, 0.5 * kTestBdp); bbr_sender_link_ = std::make_unique<simulator::SymmetricLink>( &bbr_sender_, switch_->port(1), kLocalLinkBandwidth, kLocalPropagationDelay); receiver_link_ = std::make_unique<simulator::SymmetricLink>( &receiver_, switch_->port(2), kTestLinkBandwidth, kTestPropagationDelay); } // Creates the variation of the default setup in which there is another sender // that competes for the same bottleneck link. void CreateCompetitionSetup() { switch_ = std::make_unique<simulator::Switch>(&simulator_, "Switch", 8, 2 * kTestBdp); // Add a small offset to the competing link in order to avoid // synchronization effects. const QuicTime::Delta small_offset = QuicTime::Delta::FromMicroseconds(3); bbr_sender_link_ = std::make_unique<simulator::SymmetricLink>( &bbr_sender_, switch_->port(1), kLocalLinkBandwidth, kLocalPropagationDelay); competing_sender_link_ = std::make_unique<simulator::SymmetricLink>( &competing_sender_, switch_->port(3), kLocalLinkBandwidth, kLocalPropagationDelay + small_offset); receiver_link_ = std::make_unique<simulator::SymmetricLink>( &receiver_multiplexer_, switch_->port(2), kTestLinkBandwidth, kTestPropagationDelay); } // Creates a BBR vs BBR competition setup. void CreateBbrVsBbrSetup() { SetupBbrSender(&competing_sender_); CreateCompetitionSetup(); } void EnableAggregation(QuicByteCount aggregation_bytes, QuicTime::Delta aggregation_timeout) { // Enable aggregation on the path from the receiver to the sender. switch_->port_queue(1)->EnableAggregation(aggregation_bytes, aggregation_timeout); } void DoSimpleTransfer(QuicByteCount transfer_size, QuicTime::Delta deadline) { bbr_sender_.AddBytesToTransfer(transfer_size); // TODO(vasilvv): consider rewriting this to run until the receiver actually // receives the intended amount of bytes. bool simulator_result = simulator_.RunUntilOrTimeout( [this]() { return bbr_sender_.bytes_to_transfer() == 0; }, deadline); EXPECT_TRUE(simulator_result) << "Simple transfer failed. Bytes remaining: " << bbr_sender_.bytes_to_transfer(); QUIC_LOG(INFO) << "Simple transfer state: " << sender_->ExportDebugState(); } // Drive the simulator by sending enough data to enter PROBE_BW. void DriveOutOfStartup() { ASSERT_FALSE(sender_->ExportDebugState().is_at_full_bandwidth); DoSimpleTransfer(1024 * 1024, QuicTime::Delta::FromSeconds(15)); EXPECT_EQ(BbrSender::PROBE_BW, sender_->ExportDebugState().mode); EXPECT_APPROX_EQ(kTestLinkBandwidth, sender_->ExportDebugState().max_bandwidth, 0.02f); } // Send |bytes|-sized bursts of data |number_of_bursts| times, waiting for // |wait_time| between each burst. void SendBursts(size_t number_of_bursts, QuicByteCount bytes, QuicTime::Delta wait_time) { ASSERT_EQ(0u, bbr_sender_.bytes_to_transfer()); for (size_t i = 0; i < number_of_bursts; i++) { bbr_sender_.AddBytesToTransfer(bytes); // Transfer data and wait for three seconds between each transfer. simulator_.RunFor(wait_time); // Ensure the connection did not time out. ASSERT_TRUE(bbr_sender_.connection()->connected()); ASSERT_TRUE(receiver_.connection()->connected()); } simulator_.RunFor(wait_time + kTestRtt); ASSERT_EQ(0u, bbr_sender_.bytes_to_transfer()); } void SetConnectionOption(QuicTag option) { QuicConfig config; QuicTagVector options; options.push_back(option); QuicConfigPeer::SetReceivedConnectionOptions(&config, options); sender_->SetFromConfig(config, Perspective::IS_SERVER); } }; TEST_F(BbrSenderTest, SetInitialCongestionWindow) { EXPECT_NE(3u * kDefaultTCPMSS, sender_->GetCongestionWindow()); sender_->SetInitialCongestionWindowInPackets(3); EXPECT_EQ(3u * kDefaultTCPMSS, sender_->GetCongestionWindow()); } // Test a simple long data transfer in the default setup. TEST_F(BbrSenderTest, SimpleTransfer) { // Disable Ack Decimation on the receiver, because it can increase srtt. QuicConnectionPeer::SetAckMode(receiver_.connection(), AckMode::TCP_ACKING); CreateDefaultSetup(); // At startup make sure we are at the default. EXPECT_EQ(kDefaultWindowTCP, sender_->GetCongestionWindow()); // At startup make sure we can send. EXPECT_TRUE(sender_->CanSend(0)); // And that window is un-affected. EXPECT_EQ(kDefaultWindowTCP, sender_->GetCongestionWindow()); // Verify that Sender is in slow start. EXPECT_TRUE(sender_->InSlowStart()); // Verify that pacing rate is based on the initial RTT. QuicBandwidth expected_pacing_rate = QuicBandwidth::FromBytesAndTimeDelta( 2.885 * kDefaultWindowTCP, rtt_stats_->initial_rtt()); EXPECT_APPROX_EQ(expected_pacing_rate.ToBitsPerSecond(), sender_->PacingRate(0).ToBitsPerSecond(), 0.01f); ASSERT_GE(kTestBdp, kDefaultWindowTCP + kDefaultTCPMSS); DoSimpleTransfer(12 * 1024 * 1024, QuicTime::Delta::FromSeconds(30)); EXPECT_EQ(BbrSender::PROBE_BW, sender_->ExportDebugState().mode); EXPECT_EQ(0u, bbr_sender_.connection()->GetStats().packets_lost); EXPECT_FALSE(sender_->ExportDebugState().last_sample_is_app_limited); // The margin here is quite high, since there exists a possibility that the // connection just exited high gain cycle. EXPECT_APPROX_EQ(kTestRtt, rtt_stats_->smoothed_rtt(), 0.2f); } // Test a simple transfer in a situation when the buffer is less than BDP. TEST_F(BbrSenderTest, SimpleTransferSmallBuffer) { CreateSmallBufferSetup(); DoSimpleTransfer(12 * 1024 * 1024, QuicTime::Delta::FromSeconds(30)); EXPECT_EQ(BbrSender::PROBE_BW, sender_->ExportDebugState().mode); EXPECT_APPROX_EQ(kTestLinkBandwidth, sender_->ExportDebugState().max_bandwidth, 0.01f); EXPECT_GE(bbr_sender_.connection()->GetStats().packets_lost, 0u); EXPECT_FALSE(sender_->ExportDebugState().last_sample_is_app_limited); // The margin here is quite high, since there exists a possibility that the // connection just exited high gain cycle. EXPECT_APPROX_EQ(kTestRtt, sender_->GetMinRtt(), 0.2f); } TEST_F(BbrSenderTest, SimpleTransferEarlyPacketLoss) { SetQuicReloadableFlag(quic_bbr_no_bytes_acked_in_startup_recovery, true); // Enable rate based startup so the recovery window doesn't hide the true // congestion_window_ in GetCongestionWindow(). SetConnectionOption(kBBS1); // Disable Ack Decimation on the receiver, because it can increase srtt. QuicConnectionPeer::SetAckMode(receiver_.connection(), AckMode::TCP_ACKING); CreateDefaultSetup(); // At startup make sure we are at the default. EXPECT_EQ(kDefaultWindowTCP, sender_->GetCongestionWindow()); // Verify that Sender is in slow start. EXPECT_TRUE(sender_->InSlowStart()); // At startup make sure we can send. EXPECT_TRUE(sender_->CanSend(0)); // And that window is un-affected. EXPECT_EQ(kDefaultWindowTCP, sender_->GetCongestionWindow()); // Transfer 12MB. bbr_sender_.AddBytesToTransfer(12 * 1024 * 1024); // Drop the first packet. receiver_.DropNextIncomingPacket(); bool simulator_result = simulator_.RunUntilOrTimeout( [this]() { if (sender_->InRecovery()) { // Two packets are acked before the first is declared lost. EXPECT_LE(sender_->GetCongestionWindow(), (kDefaultWindowTCP + 2 * kDefaultTCPMSS)); } return bbr_sender_.bytes_to_transfer() == 0 || !sender_->InSlowStart(); }, QuicTime::Delta::FromSeconds(30)); EXPECT_TRUE(simulator_result) << "Simple transfer failed. Bytes remaining: " << bbr_sender_.bytes_to_transfer(); EXPECT_EQ(BbrSender::DRAIN, sender_->ExportDebugState().mode); EXPECT_EQ(1u, bbr_sender_.connection()->GetStats().packets_lost); EXPECT_FALSE(sender_->ExportDebugState().last_sample_is_app_limited); } // Test a simple long data transfer with 2 rtts of aggregation. TEST_F(BbrSenderTest, SimpleTransfer2RTTAggregationBytes) { CreateDefaultSetup(); // 2 RTTs of aggregation, with a max of 10kb. EnableAggregation(10 * 1024, 2 * kTestRtt); // Transfer 12MB. DoSimpleTransfer(12 * 1024 * 1024, QuicTime::Delta::FromSeconds(35)); EXPECT_EQ(BbrSender::PROBE_BW, sender_->ExportDebugState().mode); // It's possible to read a bandwidth as much as 50% too high with aggregation. EXPECT_LE(kTestLinkBandwidth * 0.99f, sender_->ExportDebugState().max_bandwidth); // TODO(ianswett): Tighten this bound once we understand why BBR is // overestimating bandwidth with aggregation. b/36022633 EXPECT_GE(kTestLinkBandwidth * 1.5f, sender_->ExportDebugState().max_bandwidth); // TODO(ianswett): Expect 0 packets are lost once BBR no longer measures // bandwidth higher than the link rate. // The margin here is high, because the aggregation greatly increases // smoothed rtt. EXPECT_GE(kTestRtt * 4, rtt_stats_->smoothed_rtt()); EXPECT_APPROX_EQ(kTestRtt, rtt_stats_->min_rtt(), 0.2f); } // Test a simple long data transfer with 2 rtts of aggregation. TEST_F(BbrSenderTest, SimpleTransferAckDecimation) { // Decrease the CWND gain so extra CWND is required with stretch acks. SetQuicFlag(FLAGS_quic_bbr_cwnd_gain, 1.0); sender_ = new BbrSender( bbr_sender_.connection()->clock()->Now(), rtt_stats_, QuicSentPacketManagerPeer::GetUnackedPacketMap( QuicConnectionPeer::GetSentPacketManager(bbr_sender_.connection())), kInitialCongestionWindowPackets, GetQuicFlag(FLAGS_quic_max_congestion_window), &random_, QuicConnectionPeer::GetStats(bbr_sender_.connection())); QuicConnectionPeer::SetSendAlgorithm(bbr_sender_.connection(), sender_); // Enable Ack Decimation on the receiver. QuicConnectionPeer::SetAckMode(receiver_.connection(), AckMode::ACK_DECIMATION); CreateDefaultSetup(); // Transfer 12MB. DoSimpleTransfer(12 * 1024 * 1024, QuicTime::Delta::FromSeconds(35)); EXPECT_EQ(BbrSender::PROBE_BW, sender_->ExportDebugState().mode); // It's possible to read a bandwidth as much as 50% too high with aggregation. EXPECT_LE(kTestLinkBandwidth * 0.99f, sender_->ExportDebugState().max_bandwidth); // TODO(ianswett): Tighten this bound once we understand why BBR is // overestimating bandwidth with aggregation. b/36022633 EXPECT_GE(kTestLinkBandwidth * 1.5f, sender_->ExportDebugState().max_bandwidth); // TODO(ianswett): Expect 0 packets are lost once BBR no longer measures // bandwidth higher than the link rate. EXPECT_FALSE(sender_->ExportDebugState().last_sample_is_app_limited); // The margin here is high, because the aggregation greatly increases // smoothed rtt. EXPECT_GE(kTestRtt * 2, rtt_stats_->smoothed_rtt()); EXPECT_APPROX_EQ(kTestRtt, rtt_stats_->min_rtt(), 0.1f); } // Test a simple long data transfer with 2 rtts of aggregation. TEST_F(BbrSenderTest, SimpleTransfer2RTTAggregationBytes20RTTWindow) { // Disable Ack Decimation on the receiver, because it can increase srtt. QuicConnectionPeer::SetAckMode(receiver_.connection(), AckMode::TCP_ACKING); CreateDefaultSetup(); SetConnectionOption(kBBR4); // 2 RTTs of aggregation, with a max of 10kb. EnableAggregation(10 * 1024, 2 * kTestRtt); // Transfer 12MB. DoSimpleTransfer(12 * 1024 * 1024, QuicTime::Delta::FromSeconds(35)); EXPECT_TRUE(sender_->ExportDebugState().mode == BbrSender::PROBE_BW || sender_->ExportDebugState().mode == BbrSender::PROBE_RTT); // It's possible to read a bandwidth as much as 50% too high with aggregation. EXPECT_LE(kTestLinkBandwidth * 0.99f, sender_->ExportDebugState().max_bandwidth); // TODO(ianswett): Tighten this bound once we understand why BBR is // overestimating bandwidth with aggregation. b/36022633 EXPECT_GE(kTestLinkBandwidth * 1.5f, sender_->ExportDebugState().max_bandwidth); // TODO(ianswett): Expect 0 packets are lost once BBR no longer measures // bandwidth higher than the link rate. // The margin here is high, because the aggregation greatly increases // smoothed rtt. EXPECT_GE(kTestRtt * 4, rtt_stats_->smoothed_rtt()); EXPECT_APPROX_EQ(kTestRtt, rtt_stats_->min_rtt(), 0.25f); } // Test a simple long data transfer with 2 rtts of aggregation. TEST_F(BbrSenderTest, SimpleTransfer2RTTAggregationBytes40RTTWindow) { // Disable Ack Decimation on the receiver, because it can increase srtt. QuicConnectionPeer::SetAckMode(receiver_.connection(), AckMode::TCP_ACKING); CreateDefaultSetup(); SetConnectionOption(kBBR5); // 2 RTTs of aggregation, with a max of 10kb. EnableAggregation(10 * 1024, 2 * kTestRtt); // Transfer 12MB. DoSimpleTransfer(12 * 1024 * 1024, QuicTime::Delta::FromSeconds(35)); EXPECT_TRUE(sender_->ExportDebugState().mode == BbrSender::PROBE_BW || sender_->ExportDebugState().mode == BbrSender::PROBE_RTT); // It's possible to read a bandwidth as much as 50% too high with aggregation. EXPECT_LE(kTestLinkBandwidth * 0.99f, sender_->ExportDebugState().max_bandwidth); // TODO(ianswett): Tighten this bound once we understand why BBR is // overestimating bandwidth with aggregation. b/36022633 EXPECT_GE(kTestLinkBandwidth * 1.5f, sender_->ExportDebugState().max_bandwidth); // TODO(ianswett): Expect 0 packets are lost once BBR no longer measures // bandwidth higher than the link rate. // The margin here is high, because the aggregation greatly increases // smoothed rtt. EXPECT_GE(kTestRtt * 4, rtt_stats_->smoothed_rtt()); EXPECT_APPROX_EQ(kTestRtt, rtt_stats_->min_rtt(), 0.25f); } // Test the number of losses incurred by the startup phase in a situation when // the buffer is less than BDP. TEST_F(BbrSenderTest, PacketLossOnSmallBufferStartup) { CreateSmallBufferSetup(); DriveOutOfStartup(); float loss_rate = static_cast<float>(bbr_sender_.connection()->GetStats().packets_lost) / bbr_sender_.connection()->GetStats().packets_sent; EXPECT_LE(loss_rate, 0.31); } // Test the number of losses incurred by the startup phase in a situation when // the buffer is less than BDP, with a STARTUP CWND gain of 2. TEST_F(BbrSenderTest, PacketLossOnSmallBufferStartupDerivedCWNDGain) { CreateSmallBufferSetup(); SetConnectionOption(kBBQ2); DriveOutOfStartup(); float loss_rate = static_cast<float>(bbr_sender_.connection()->GetStats().packets_lost) / bbr_sender_.connection()->GetStats().packets_sent; EXPECT_LE(loss_rate, 0.1); } // Ensures the code transitions loss recovery states correctly (NOT_IN_RECOVERY // -> CONSERVATION -> GROWTH -> NOT_IN_RECOVERY). TEST_F(BbrSenderTest, RecoveryStates) { const QuicTime::Delta timeout = QuicTime::Delta::FromSeconds(10); bool simulator_result; CreateSmallBufferSetup(); bbr_sender_.AddBytesToTransfer(100 * 1024 * 1024); ASSERT_EQ(BbrSender::NOT_IN_RECOVERY, sender_->ExportDebugState().recovery_state); simulator_result = simulator_.RunUntilOrTimeout( [this]() { return sender_->ExportDebugState().recovery_state != BbrSender::NOT_IN_RECOVERY; }, timeout); ASSERT_TRUE(simulator_result); ASSERT_EQ(BbrSender::CONSERVATION, sender_->ExportDebugState().recovery_state); simulator_result = simulator_.RunUntilOrTimeout( [this]() { return sender_->ExportDebugState().recovery_state != BbrSender::CONSERVATION; }, timeout); ASSERT_TRUE(simulator_result); ASSERT_EQ(BbrSender::GROWTH, sender_->ExportDebugState().recovery_state); simulator_result = simulator_.RunUntilOrTimeout( [this]() { return sender_->ExportDebugState().recovery_state != BbrSender::GROWTH; }, timeout); ASSERT_EQ(BbrSender::NOT_IN_RECOVERY, sender_->ExportDebugState().recovery_state); ASSERT_TRUE(simulator_result); } // Verify the behavior of the algorithm in the case when the connection sends // small bursts of data after sending continuously for a while. TEST_F(BbrSenderTest, ApplicationLimitedBursts) { CreateDefaultSetup(); DriveOutOfStartup(); EXPECT_FALSE(sender_->ExportDebugState().last_sample_is_app_limited); SendBursts(20, 512, QuicTime::Delta::FromSeconds(3)); EXPECT_TRUE(sender_->ExportDebugState().last_sample_is_app_limited); EXPECT_APPROX_EQ(kTestLinkBandwidth, sender_->ExportDebugState().max_bandwidth, 0.01f); } // Verify the behavior of the algorithm in the case when the connection sends // small bursts of data and then starts sending continuously. TEST_F(BbrSenderTest, ApplicationLimitedBurstsWithoutPrior) { CreateDefaultSetup(); SendBursts(40, 512, QuicTime::Delta::FromSeconds(3)); EXPECT_TRUE(sender_->ExportDebugState().last_sample_is_app_limited); DriveOutOfStartup(); EXPECT_APPROX_EQ(kTestLinkBandwidth, sender_->ExportDebugState().max_bandwidth, 0.01f); EXPECT_FALSE(sender_->ExportDebugState().last_sample_is_app_limited); } // Verify that the DRAIN phase works correctly. TEST_F(BbrSenderTest, Drain) { // Disable Ack Decimation on the receiver, because it can increase srtt. QuicConnectionPeer::SetAckMode(receiver_.connection(), AckMode::TCP_ACKING); CreateDefaultSetup(); const QuicTime::Delta timeout = QuicTime::Delta::FromSeconds(10); // Get the queue at the bottleneck, which is the outgoing queue at the port to // which the receiver is connected. const simulator::Queue* queue = switch_->port_queue(2); bool simulator_result; // We have no intention of ever finishing this transfer. bbr_sender_.AddBytesToTransfer(100 * 1024 * 1024); // Run the startup, and verify that it fills up the queue. ASSERT_EQ(BbrSender::STARTUP, sender_->ExportDebugState().mode); simulator_result = simulator_.RunUntilOrTimeout( [this]() { return sender_->ExportDebugState().mode != BbrSender::STARTUP; }, timeout); ASSERT_TRUE(simulator_result); ASSERT_EQ(BbrSender::DRAIN, sender_->ExportDebugState().mode); EXPECT_APPROX_EQ(sender_->BandwidthEstimate() * (1 / 2.885f), sender_->PacingRate(0), 0.01f); // BBR uses CWND gain of 2.88 during STARTUP, hence it will fill the buffer // with approximately 1.88 BDPs. Here, we use 1.5 to give some margin for // error. EXPECT_GE(queue->bytes_queued(), 1.5 * kTestBdp); // Observe increased RTT due to bufferbloat. const QuicTime::Delta queueing_delay = kTestLinkBandwidth.TransferTime(queue->bytes_queued()); EXPECT_APPROX_EQ(kTestRtt + queueing_delay, rtt_stats_->latest_rtt(), 0.1f); // Transition to the drain phase and verify that it makes the queue // have at most a BDP worth of packets. simulator_result = simulator_.RunUntilOrTimeout( [this]() { return sender_->ExportDebugState().mode != BbrSender::DRAIN; }, timeout); ASSERT_TRUE(simulator_result); ASSERT_EQ(BbrSender::PROBE_BW, sender_->ExportDebugState().mode); EXPECT_LE(queue->bytes_queued(), kTestBdp); // Wait for a few round trips and ensure we're in appropriate phase of gain // cycling before taking an RTT measurement. const QuicRoundTripCount start_round_trip = sender_->ExportDebugState().round_trip_count; simulator_result = simulator_.RunUntilOrTimeout( [this, start_round_trip]() { QuicRoundTripCount rounds_passed = sender_->ExportDebugState().round_trip_count - start_round_trip; return rounds_passed >= 4 && sender_->ExportDebugState().gain_cycle_index == 7; }, timeout); ASSERT_TRUE(simulator_result); // Observe the bufferbloat go away. EXPECT_APPROX_EQ(kTestRtt, rtt_stats_->smoothed_rtt(), 0.1f); } // TODO(wub): Re-enable this test once default drain_gain changed to 0.75. // Verify that the DRAIN phase works correctly. TEST_F(BbrSenderTest, DISABLED_ShallowDrain) { // Disable Ack Decimation on the receiver, because it can increase srtt. QuicConnectionPeer::SetAckMode(receiver_.connection(), AckMode::TCP_ACKING); CreateDefaultSetup(); const QuicTime::Delta timeout = QuicTime::Delta::FromSeconds(10); // Get the queue at the bottleneck, which is the outgoing queue at the port to // which the receiver is connected. const simulator::Queue* queue = switch_->port_queue(2); bool simulator_result; // We have no intention of ever finishing this transfer. bbr_sender_.AddBytesToTransfer(100 * 1024 * 1024); // Run the startup, and verify that it fills up the queue. ASSERT_EQ(BbrSender::STARTUP, sender_->ExportDebugState().mode); simulator_result = simulator_.RunUntilOrTimeout( [this]() { return sender_->ExportDebugState().mode != BbrSender::STARTUP; }, timeout); ASSERT_TRUE(simulator_result); ASSERT_EQ(BbrSender::DRAIN, sender_->ExportDebugState().mode); EXPECT_EQ(0.75 * sender_->BandwidthEstimate(), sender_->PacingRate(0)); // BBR uses CWND gain of 2.88 during STARTUP, hence it will fill the buffer // with approximately 1.88 BDPs. Here, we use 1.5 to give some margin for // error. EXPECT_GE(queue->bytes_queued(), 1.5 * kTestBdp); // Observe increased RTT due to bufferbloat. const QuicTime::Delta queueing_delay = kTestLinkBandwidth.TransferTime(queue->bytes_queued()); EXPECT_APPROX_EQ(kTestRtt + queueing_delay, rtt_stats_->latest_rtt(), 0.1f); // Transition to the drain phase and verify that it makes the queue // have at most a BDP worth of packets. simulator_result = simulator_.RunUntilOrTimeout( [this]() { return sender_->ExportDebugState().mode != BbrSender::DRAIN; }, timeout); ASSERT_TRUE(simulator_result); ASSERT_EQ(BbrSender::PROBE_BW, sender_->ExportDebugState().mode); EXPECT_LE(queue->bytes_queued(), kTestBdp); // Wait for a few round trips and ensure we're in appropriate phase of gain // cycling before taking an RTT measurement. const QuicRoundTripCount start_round_trip = sender_->ExportDebugState().round_trip_count; simulator_result = simulator_.RunUntilOrTimeout( [this, start_round_trip]() { QuicRoundTripCount rounds_passed = sender_->ExportDebugState().round_trip_count - start_round_trip; return rounds_passed >= 4 && sender_->ExportDebugState().gain_cycle_index == 7; }, timeout); ASSERT_TRUE(simulator_result); // Observe the bufferbloat go away. EXPECT_APPROX_EQ(kTestRtt, rtt_stats_->smoothed_rtt(), 0.1f); } // Verify that the connection enters and exits PROBE_RTT correctly. TEST_F(BbrSenderTest, ProbeRtt) { CreateDefaultSetup(); DriveOutOfStartup(); // We have no intention of ever finishing this transfer. bbr_sender_.AddBytesToTransfer(100 * 1024 * 1024); // Wait until the connection enters PROBE_RTT. const QuicTime::Delta timeout = QuicTime::Delta::FromSeconds(12); bool simulator_result = simulator_.RunUntilOrTimeout( [this]() { return sender_->ExportDebugState().mode == BbrSender::PROBE_RTT; }, timeout); ASSERT_TRUE(simulator_result); ASSERT_EQ(BbrSender::PROBE_RTT, sender_->ExportDebugState().mode); // Exit PROBE_RTT. const QuicTime probe_rtt_start = clock_->Now(); const QuicTime::Delta time_to_exit_probe_rtt = kTestRtt + QuicTime::Delta::FromMilliseconds(200); simulator_.RunFor(1.5 * time_to_exit_probe_rtt); EXPECT_EQ(BbrSender::PROBE_BW, sender_->ExportDebugState().mode); EXPECT_GE(sender_->ExportDebugState().min_rtt_timestamp, probe_rtt_start); } // Verify that the connection enters and exits PROBE_RTT correctly. TEST_F(BbrSenderTest, ProbeRttBDPBasedCWNDTarget) { CreateDefaultSetup(); SetQuicReloadableFlag(quic_bbr_less_probe_rtt, true); SetConnectionOption(kBBR6); DriveOutOfStartup(); // We have no intention of ever finishing this transfer. bbr_sender_.AddBytesToTransfer(100 * 1024 * 1024); // Wait until the connection enters PROBE_RTT. const QuicTime::Delta timeout = QuicTime::Delta::FromSeconds(12); bool simulator_result = simulator_.RunUntilOrTimeout( [this]() { return sender_->ExportDebugState().mode == BbrSender::PROBE_RTT; }, timeout); ASSERT_TRUE(simulator_result); ASSERT_EQ(BbrSender::PROBE_RTT, sender_->ExportDebugState().mode); // Exit PROBE_RTT. const QuicTime probe_rtt_start = clock_->Now(); const QuicTime::Delta time_to_exit_probe_rtt = kTestRtt + QuicTime::Delta::FromMilliseconds(200); simulator_.RunFor(1.5 * time_to_exit_probe_rtt); EXPECT_EQ(BbrSender::PROBE_BW, sender_->ExportDebugState().mode); EXPECT_GE(sender_->ExportDebugState().min_rtt_timestamp, probe_rtt_start); } // Verify that the connection enters does not enter PROBE_RTT. TEST_F(BbrSenderTest, ProbeRttSkippedAfterAppLimitedAndStableRtt) { CreateDefaultSetup(); SetQuicReloadableFlag(quic_bbr_less_probe_rtt, true); SetConnectionOption(kBBR7); DriveOutOfStartup(); // We have no intention of ever finishing this transfer. bbr_sender_.AddBytesToTransfer(100 * 1024 * 1024); // Wait until the connection enters PROBE_RTT. const QuicTime::Delta timeout = QuicTime::Delta::FromSeconds(12); bool simulator_result = simulator_.RunUntilOrTimeout( [this]() { return sender_->ExportDebugState().mode == BbrSender::PROBE_RTT; }, timeout); ASSERT_FALSE(simulator_result); ASSERT_EQ(BbrSender::PROBE_BW, sender_->ExportDebugState().mode); } // Verify that the connection enters does not enter PROBE_RTT. TEST_F(BbrSenderTest, ProbeRttSkippedAfterAppLimited) { CreateDefaultSetup(); SetQuicReloadableFlag(quic_bbr_less_probe_rtt, true); SetConnectionOption(kBBR8); DriveOutOfStartup(); // We have no intention of ever finishing this transfer. bbr_sender_.AddBytesToTransfer(100 * 1024 * 1024); // Wait until the connection enters PROBE_RTT. const QuicTime::Delta timeout = QuicTime::Delta::FromSeconds(12); bool simulator_result = simulator_.RunUntilOrTimeout( [this]() { return sender_->ExportDebugState().mode == BbrSender::PROBE_RTT; }, timeout); ASSERT_FALSE(simulator_result); ASSERT_EQ(BbrSender::PROBE_BW, sender_->ExportDebugState().mode); } // Ensure that a connection that is app-limited and is at sufficiently low // bandwidth will not exit high gain phase, and similarly ensure that the // connection will exit low gain early if the number of bytes in flight is low. TEST_F(BbrSenderTest, InFlightAwareGainCycling) { // Disable Ack Decimation on the receiver, because it can increase srtt. QuicConnectionPeer::SetAckMode(receiver_.connection(), AckMode::TCP_ACKING); CreateDefaultSetup(); DriveOutOfStartup(); const QuicTime::Delta timeout = QuicTime::Delta::FromSeconds(5); bool simulator_result; // Start a few cycles prior to the high gain one. simulator_result = simulator_.RunUntilOrTimeout( [this]() { return sender_->ExportDebugState().gain_cycle_index == 6; }, timeout); // Send at 10% of available rate. Run for 3 seconds, checking in the middle // and at the end. The pacing gain should be high throughout. QuicBandwidth target_bandwidth = 0.1f * kTestLinkBandwidth; QuicTime::Delta burst_interval = QuicTime::Delta::FromMilliseconds(300); for (int i = 0; i < 2; i++) { SendBursts(5, target_bandwidth * burst_interval, burst_interval); EXPECT_EQ(BbrSender::PROBE_BW, sender_->ExportDebugState().mode); EXPECT_EQ(0, sender_->ExportDebugState().gain_cycle_index); EXPECT_APPROX_EQ(kTestLinkBandwidth, sender_->ExportDebugState().max_bandwidth, 0.01f); } // Now that in-flight is almost zero and the pacing gain is still above 1, // send approximately 1.25 BDPs worth of data. This should cause the // PROBE_BW mode to enter low gain cycle, and exit it earlier than one min_rtt // due to running out of data to send. bbr_sender_.AddBytesToTransfer(1.3 * kTestBdp); simulator_result = simulator_.RunUntilOrTimeout( [this]() { return sender_->ExportDebugState().gain_cycle_index == 1; }, timeout); ASSERT_TRUE(simulator_result); simulator_.RunFor(0.75 * sender_->ExportDebugState().min_rtt); EXPECT_EQ(BbrSender::PROBE_BW, sender_->ExportDebugState().mode); EXPECT_EQ(2, sender_->ExportDebugState().gain_cycle_index); } // Ensure that the pacing rate does not drop at startup. TEST_F(BbrSenderTest, NoBandwidthDropOnStartup) { CreateDefaultSetup(); const QuicTime::Delta timeout = QuicTime::Delta::FromSeconds(5); bool simulator_result; QuicBandwidth initial_rate = QuicBandwidth::FromBytesAndTimeDelta( kInitialCongestionWindowPackets * kDefaultTCPMSS, rtt_stats_->initial_rtt()); EXPECT_GE(sender_->PacingRate(0), initial_rate); // Send a packet. bbr_sender_.AddBytesToTransfer(1000); simulator_result = simulator_.RunUntilOrTimeout( [this]() { return receiver_.bytes_received() == 1000; }, timeout); ASSERT_TRUE(simulator_result); EXPECT_GE(sender_->PacingRate(0), initial_rate); // Wait for a while. simulator_.RunFor(QuicTime::Delta::FromSeconds(2)); EXPECT_GE(sender_->PacingRate(0), initial_rate); // Send another packet. bbr_sender_.AddBytesToTransfer(1000); simulator_result = simulator_.RunUntilOrTimeout( [this]() { return receiver_.bytes_received() == 2000; }, timeout); ASSERT_TRUE(simulator_result); EXPECT_GE(sender_->PacingRate(0), initial_rate); } // Test exiting STARTUP earlier due to the 1RTT connection option. TEST_F(BbrSenderTest, SimpleTransfer1RTTStartup) { CreateDefaultSetup(); SetConnectionOption(k1RTT); EXPECT_EQ(1u, sender_->num_startup_rtts()); // Run until the full bandwidth is reached and check how many rounds it was. bbr_sender_.AddBytesToTransfer(12 * 1024 * 1024); QuicRoundTripCount max_bw_round = 0; QuicBandwidth max_bw(QuicBandwidth::Zero()); bool simulator_result = simulator_.RunUntilOrTimeout( [this, &max_bw, &max_bw_round]() { if (max_bw < sender_->ExportDebugState().max_bandwidth) { max_bw = sender_->ExportDebugState().max_bandwidth; max_bw_round = sender_->ExportDebugState().round_trip_count; } return sender_->ExportDebugState().is_at_full_bandwidth; }, QuicTime::Delta::FromSeconds(5)); ASSERT_TRUE(simulator_result); EXPECT_EQ(BbrSender::DRAIN, sender_->ExportDebugState().mode); EXPECT_EQ(1u, sender_->ExportDebugState().round_trip_count - max_bw_round); EXPECT_EQ(1u, sender_->ExportDebugState().rounds_without_bandwidth_gain); EXPECT_EQ(0u, bbr_sender_.connection()->GetStats().packets_lost); EXPECT_FALSE(sender_->ExportDebugState().last_sample_is_app_limited); } // Test exiting STARTUP earlier due to the 2RTT connection option. TEST_F(BbrSenderTest, SimpleTransfer2RTTStartup) { CreateDefaultSetup(); SetConnectionOption(k2RTT); EXPECT_EQ(2u, sender_->num_startup_rtts()); // Run until the full bandwidth is reached and check how many rounds it was. bbr_sender_.AddBytesToTransfer(12 * 1024 * 1024); QuicRoundTripCount max_bw_round = 0; QuicBandwidth max_bw(QuicBandwidth::Zero()); bool simulator_result = simulator_.RunUntilOrTimeout( [this, &max_bw, &max_bw_round]() { if (max_bw < sender_->ExportDebugState().max_bandwidth) { max_bw = sender_->ExportDebugState().max_bandwidth; max_bw_round = sender_->ExportDebugState().round_trip_count; } return sender_->ExportDebugState().is_at_full_bandwidth; }, QuicTime::Delta::FromSeconds(5)); ASSERT_TRUE(simulator_result); EXPECT_EQ(BbrSender::DRAIN, sender_->ExportDebugState().mode); EXPECT_EQ(2u, sender_->ExportDebugState().round_trip_count - max_bw_round); EXPECT_EQ(2u, sender_->ExportDebugState().rounds_without_bandwidth_gain); EXPECT_EQ(0u, bbr_sender_.connection()->GetStats().packets_lost); EXPECT_FALSE(sender_->ExportDebugState().last_sample_is_app_limited); } // Test exiting STARTUP earlier upon loss due to the LRTT connection option. TEST_F(BbrSenderTest, SimpleTransferLRTTStartup) { CreateDefaultSetup(); SetConnectionOption(kLRTT); EXPECT_EQ(3u, sender_->num_startup_rtts()); // Run until the full bandwidth is reached and check how many rounds it was. bbr_sender_.AddBytesToTransfer(12 * 1024 * 1024); QuicRoundTripCount max_bw_round = 0; QuicBandwidth max_bw(QuicBandwidth::Zero()); bool simulator_result = simulator_.RunUntilOrTimeout( [this, &max_bw, &max_bw_round]() { if (max_bw < sender_->ExportDebugState().max_bandwidth) { max_bw = sender_->ExportDebugState().max_bandwidth; max_bw_round = sender_->ExportDebugState().round_trip_count; } return sender_->ExportDebugState().is_at_full_bandwidth; }, QuicTime::Delta::FromSeconds(5)); ASSERT_TRUE(simulator_result); EXPECT_EQ(BbrSender::DRAIN, sender_->ExportDebugState().mode); EXPECT_EQ(3u, sender_->ExportDebugState().round_trip_count - max_bw_round); EXPECT_EQ(3u, sender_->ExportDebugState().rounds_without_bandwidth_gain); EXPECT_EQ(0u, bbr_sender_.connection()->GetStats().packets_lost); EXPECT_FALSE(sender_->ExportDebugState().last_sample_is_app_limited); } // Test exiting STARTUP earlier upon loss due to the LRTT connection option. TEST_F(BbrSenderTest, SimpleTransferLRTTStartupSmallBuffer) { CreateSmallBufferSetup(); SetConnectionOption(kLRTT); EXPECT_EQ(3u, sender_->num_startup_rtts()); // Run until the full bandwidth is reached and check how many rounds it was. bbr_sender_.AddBytesToTransfer(12 * 1024 * 1024); QuicRoundTripCount max_bw_round = 0; QuicBandwidth max_bw(QuicBandwidth::Zero()); bool simulator_result = simulator_.RunUntilOrTimeout( [this, &max_bw, &max_bw_round]() { if (max_bw < sender_->ExportDebugState().max_bandwidth) { max_bw = sender_->ExportDebugState().max_bandwidth; max_bw_round = sender_->ExportDebugState().round_trip_count; } return sender_->ExportDebugState().is_at_full_bandwidth; }, QuicTime::Delta::FromSeconds(5)); ASSERT_TRUE(simulator_result); EXPECT_EQ(BbrSender::DRAIN, sender_->ExportDebugState().mode); EXPECT_GE(2u, sender_->ExportDebugState().round_trip_count - max_bw_round); EXPECT_EQ(1u, sender_->ExportDebugState().rounds_without_bandwidth_gain); EXPECT_NE(0u, bbr_sender_.connection()->GetStats().packets_lost); EXPECT_FALSE(sender_->ExportDebugState().last_sample_is_app_limited); } // Test slower pacing after loss in STARTUP due to the BBRS connection option. TEST_F(BbrSenderTest, SimpleTransferSlowerStartup) { CreateSmallBufferSetup(); SetConnectionOption(kBBRS); EXPECT_EQ(3u, sender_->num_startup_rtts()); // Run until the full bandwidth is reached and check how many rounds it was. bbr_sender_.AddBytesToTransfer(12 * 1024 * 1024); QuicRoundTripCount max_bw_round = 0; QuicBandwidth max_bw(QuicBandwidth::Zero()); bool simulator_result = simulator_.RunUntilOrTimeout( [this, &max_bw, &max_bw_round]() { if (max_bw < sender_->ExportDebugState().max_bandwidth) { max_bw = sender_->ExportDebugState().max_bandwidth; max_bw_round = sender_->ExportDebugState().round_trip_count; } // Expect the pacing rate in STARTUP to decrease once packet loss // is observed, but the CWND does not. if (bbr_sender_.connection()->GetStats().packets_lost > 0 && !sender_->ExportDebugState().is_at_full_bandwidth && sender_->has_non_app_limited_sample()) { EXPECT_EQ(1.5f * max_bw, sender_->PacingRate(0)); } return sender_->ExportDebugState().is_at_full_bandwidth; }, QuicTime::Delta::FromSeconds(5)); ASSERT_TRUE(simulator_result); EXPECT_EQ(BbrSender::DRAIN, sender_->ExportDebugState().mode); EXPECT_GE(3u, sender_->ExportDebugState().round_trip_count - max_bw_round); EXPECT_EQ(3u, sender_->ExportDebugState().rounds_without_bandwidth_gain); EXPECT_NE(0u, bbr_sender_.connection()->GetStats().packets_lost); EXPECT_FALSE(sender_->ExportDebugState().last_sample_is_app_limited); } // Ensures no change in congestion window in STARTUP after loss. TEST_F(BbrSenderTest, SimpleTransferNoConservationInStartup) { CreateSmallBufferSetup(); SetConnectionOption(kBBS1); // Run until the full bandwidth is reached and check how many rounds it was. bbr_sender_.AddBytesToTransfer(12 * 1024 * 1024); bool used_conservation_cwnd = false; bool simulator_result = simulator_.RunUntilOrTimeout( [this, &used_conservation_cwnd]() { if (!sender_->ExportDebugState().is_at_full_bandwidth && sender_->GetCongestionWindow() < sender_->ExportDebugState().congestion_window) { used_conservation_cwnd = true; } return sender_->ExportDebugState().is_at_full_bandwidth; }, QuicTime::Delta::FromSeconds(5)); ASSERT_TRUE(simulator_result); EXPECT_FALSE(used_conservation_cwnd); EXPECT_EQ(BbrSender::DRAIN, sender_->ExportDebugState().mode); EXPECT_EQ(3u, sender_->ExportDebugState().rounds_without_bandwidth_gain); EXPECT_NE(0u, bbr_sender_.connection()->GetStats().packets_lost); EXPECT_FALSE(sender_->ExportDebugState().last_sample_is_app_limited); } // Ensures no change in congestion window in STARTUP after loss, but that the // rate decreases. TEST_F(BbrSenderTest, SimpleTransferStartupRateReduction) { SetQuicReloadableFlag(quic_bbr_startup_rate_reduction, true); CreateSmallBufferSetup(); SetConnectionOption(kBBS4); // Run until the full bandwidth is reached and check how many rounds it was. bbr_sender_.AddBytesToTransfer(12 * 1024 * 1024); bool used_conservation_cwnd = false; bool simulator_result = simulator_.RunUntilOrTimeout( [this, &used_conservation_cwnd]() { if (!sender_->ExportDebugState().is_at_full_bandwidth && sender_->GetCongestionWindow() < sender_->ExportDebugState().congestion_window) { used_conservation_cwnd = true; } // Exit once a loss is hit. return bbr_sender_.connection()->GetStats().packets_lost > 0 || sender_->ExportDebugState().is_at_full_bandwidth; }, QuicTime::Delta::FromSeconds(5)); ASSERT_TRUE(simulator_result); EXPECT_TRUE(sender_->InRecovery()); EXPECT_FALSE(used_conservation_cwnd); EXPECT_EQ(BbrSender::STARTUP, sender_->ExportDebugState().mode); EXPECT_NE(0u, bbr_sender_.connection()->GetStats().packets_lost); // Lose each outstanding packet and the pacing rate decreases. const QuicBandwidth original_pacing_rate = sender_->PacingRate(0); QuicBandwidth pacing_rate = original_pacing_rate; const QuicByteCount original_cwnd = sender_->GetCongestionWindow(); LostPacketVector lost_packets; lost_packets.push_back( LostPacket(QuicPacketNumber(), kMaxOutgoingPacketSize)); QuicPacketNumber largest_sent = bbr_sender_.connection()->sent_packet_manager().GetLargestSentPacket(); for (QuicPacketNumber packet_number = bbr_sender_.connection()->sent_packet_manager().GetLeastUnacked(); packet_number <= largest_sent; ++packet_number) { lost_packets[0].packet_number = packet_number; sender_->OnCongestionEvent(false, 0, clock_->Now(), {}, lost_packets); EXPECT_EQ(original_cwnd, sender_->GetCongestionWindow()); EXPECT_GT(original_pacing_rate, sender_->PacingRate(0)); EXPECT_GE(pacing_rate, sender_->PacingRate(0)); EXPECT_LE(1.25 * sender_->BandwidthEstimate(), sender_->PacingRate(0)); pacing_rate = sender_->PacingRate(0); } } // Ensures no change in congestion window in STARTUP after loss, but that the // rate decreases twice as fast as BBS4. TEST_F(BbrSenderTest, SimpleTransferDoubleStartupRateReduction) { SetQuicReloadableFlag(quic_bbr_startup_rate_reduction, true); CreateSmallBufferSetup(); SetConnectionOption(kBBS5); // Run until the full bandwidth is reached and check how many rounds it was. bbr_sender_.AddBytesToTransfer(12 * 1024 * 1024); bool used_conservation_cwnd = false; bool simulator_result = simulator_.RunUntilOrTimeout( [this, &used_conservation_cwnd]() { if (!sender_->ExportDebugState().is_at_full_bandwidth && sender_->GetCongestionWindow() < sender_->ExportDebugState().congestion_window) { used_conservation_cwnd = true; } // Exit once a loss is hit. return bbr_sender_.connection()->GetStats().packets_lost > 0 || sender_->ExportDebugState().is_at_full_bandwidth; }, QuicTime::Delta::FromSeconds(5)); ASSERT_TRUE(simulator_result); EXPECT_TRUE(sender_->InRecovery()); EXPECT_FALSE(used_conservation_cwnd); EXPECT_EQ(BbrSender::STARTUP, sender_->ExportDebugState().mode); EXPECT_NE(0u, bbr_sender_.connection()->GetStats().packets_lost); // Lose each outstanding packet and the pacing rate decreases. const QuicBandwidth original_pacing_rate = sender_->PacingRate(0); QuicBandwidth pacing_rate = original_pacing_rate; const QuicByteCount original_cwnd = sender_->GetCongestionWindow(); LostPacketVector lost_packets; lost_packets.push_back( LostPacket(QuicPacketNumber(), kMaxOutgoingPacketSize)); QuicPacketNumber largest_sent = bbr_sender_.connection()->sent_packet_manager().GetLargestSentPacket(); for (QuicPacketNumber packet_number = bbr_sender_.connection()->sent_packet_manager().GetLeastUnacked(); packet_number <= largest_sent; ++packet_number) { lost_packets[0].packet_number = packet_number; sender_->OnCongestionEvent(false, 0, clock_->Now(), {}, lost_packets); EXPECT_EQ(original_cwnd, sender_->GetCongestionWindow()); EXPECT_GT(original_pacing_rate, sender_->PacingRate(0)); EXPECT_GE(pacing_rate, sender_->PacingRate(0)); EXPECT_LE(1.25 * sender_->BandwidthEstimate(), sender_->PacingRate(0)); pacing_rate = sender_->PacingRate(0); } } TEST_F(BbrSenderTest, DerivedPacingGainStartup) { CreateDefaultSetup(); SetConnectionOption(kBBQ1); EXPECT_EQ(3u, sender_->num_startup_rtts()); // Verify that Sender is in slow start. EXPECT_TRUE(sender_->InSlowStart()); // Verify that pacing rate is based on the initial RTT. QuicBandwidth expected_pacing_rate = QuicBandwidth::FromBytesAndTimeDelta( 2.773 * kDefaultWindowTCP, rtt_stats_->initial_rtt()); EXPECT_APPROX_EQ(expected_pacing_rate.ToBitsPerSecond(), sender_->PacingRate(0).ToBitsPerSecond(), 0.01f); // Run until the full bandwidth is reached and check how many rounds it was. bbr_sender_.AddBytesToTransfer(12 * 1024 * 1024); bool simulator_result = simulator_.RunUntilOrTimeout( [this]() { return sender_->ExportDebugState().is_at_full_bandwidth; }, QuicTime::Delta::FromSeconds(5)); ASSERT_TRUE(simulator_result); EXPECT_EQ(BbrSender::DRAIN, sender_->ExportDebugState().mode); EXPECT_EQ(3u, sender_->ExportDebugState().rounds_without_bandwidth_gain); EXPECT_APPROX_EQ(kTestLinkBandwidth, sender_->ExportDebugState().max_bandwidth, 0.01f); EXPECT_EQ(0u, bbr_sender_.connection()->GetStats().packets_lost); EXPECT_FALSE(sender_->ExportDebugState().last_sample_is_app_limited); } TEST_F(BbrSenderTest, DerivedCWNDGainStartup) { CreateSmallBufferSetup(); SetConnectionOption(kBBQ2); EXPECT_EQ(3u, sender_->num_startup_rtts()); // Verify that Sender is in slow start. EXPECT_TRUE(sender_->InSlowStart()); // Verify that pacing rate is based on the initial RTT. QuicBandwidth expected_pacing_rate = QuicBandwidth::FromBytesAndTimeDelta( 2.885 * kDefaultWindowTCP, rtt_stats_->initial_rtt()); EXPECT_APPROX_EQ(expected_pacing_rate.ToBitsPerSecond(), sender_->PacingRate(0).ToBitsPerSecond(), 0.01f); // Run until the full bandwidth is reached and check how many rounds it was. bbr_sender_.AddBytesToTransfer(12 * 1024 * 1024); bool simulator_result = simulator_.RunUntilOrTimeout( [this]() { return sender_->ExportDebugState().is_at_full_bandwidth; }, QuicTime::Delta::FromSeconds(5)); ASSERT_TRUE(simulator_result); EXPECT_EQ(BbrSender::DRAIN, sender_->ExportDebugState().mode); EXPECT_EQ(3u, sender_->ExportDebugState().rounds_without_bandwidth_gain); EXPECT_APPROX_EQ(kTestLinkBandwidth, sender_->ExportDebugState().max_bandwidth, 0.01f); float loss_rate = static_cast<float>(bbr_sender_.connection()->GetStats().packets_lost) / bbr_sender_.connection()->GetStats().packets_sent; EXPECT_LT(loss_rate, 0.15f); EXPECT_FALSE(sender_->ExportDebugState().last_sample_is_app_limited); // Expect an SRTT less than 2.7 * Min RTT on exit from STARTUP. EXPECT_GT(kTestRtt * 2.7, rtt_stats_->smoothed_rtt()); } TEST_F(BbrSenderTest, AckAggregationInStartup) { // Disable Ack Decimation on the receiver to avoid loss and make results // consistent. QuicConnectionPeer::SetAckMode(receiver_.connection(), AckMode::TCP_ACKING); CreateDefaultSetup(); SetConnectionOption(kBBQ3); EXPECT_EQ(3u, sender_->num_startup_rtts()); // Verify that Sender is in slow start. EXPECT_TRUE(sender_->InSlowStart()); // Verify that pacing rate is based on the initial RTT. QuicBandwidth expected_pacing_rate = QuicBandwidth::FromBytesAndTimeDelta( 2.885 * kDefaultWindowTCP, rtt_stats_->initial_rtt()); EXPECT_APPROX_EQ(expected_pacing_rate.ToBitsPerSecond(), sender_->PacingRate(0).ToBitsPerSecond(), 0.01f); // Run until the full bandwidth is reached and check how many rounds it was. bbr_sender_.AddBytesToTransfer(12 * 1024 * 1024); bool simulator_result = simulator_.RunUntilOrTimeout( [this]() { return sender_->ExportDebugState().is_at_full_bandwidth; }, QuicTime::Delta::FromSeconds(5)); ASSERT_TRUE(simulator_result); EXPECT_EQ(BbrSender::DRAIN, sender_->ExportDebugState().mode); EXPECT_EQ(3u, sender_->ExportDebugState().rounds_without_bandwidth_gain); EXPECT_APPROX_EQ(kTestLinkBandwidth, sender_->ExportDebugState().max_bandwidth, 0.01f); EXPECT_EQ(0u, bbr_sender_.connection()->GetStats().packets_lost); EXPECT_FALSE(sender_->ExportDebugState().last_sample_is_app_limited); } // Test that two BBR flows started slightly apart from each other terminate. TEST_F(BbrSenderTest, SimpleCompetition) { const QuicByteCount transfer_size = 10 * 1024 * 1024; const QuicTime::Delta transfer_time = kTestLinkBandwidth.TransferTime(transfer_size); CreateBbrVsBbrSetup(); // Transfer 10% of data in first transfer. bbr_sender_.AddBytesToTransfer(transfer_size); bool simulator_result = simulator_.RunUntilOrTimeout( [this]() { return receiver_.bytes_received() >= 0.1 * transfer_size; }, transfer_time); ASSERT_TRUE(simulator_result); // Start the second transfer and wait until both finish. competing_sender_.AddBytesToTransfer(transfer_size); simulator_result = simulator_.RunUntilOrTimeout( [this]() { return receiver_.bytes_received() == transfer_size && competing_receiver_.bytes_received() == transfer_size; }, 3 * transfer_time); ASSERT_TRUE(simulator_result); } // Test that BBR can resume bandwidth from cached network parameters. TEST_F(BbrSenderTest, ResumeConnectionState) { CreateDefaultSetup(); bbr_sender_.connection()->AdjustNetworkParameters( SendAlgorithmInterface::NetworkParams(kTestLinkBandwidth, kTestRtt, false)); if (!GetQuicReloadableFlag(quic_bbr_donot_inject_bandwidth)) { EXPECT_EQ(kTestLinkBandwidth, sender_->ExportDebugState().max_bandwidth); EXPECT_EQ(kTestLinkBandwidth, sender_->BandwidthEstimate()); } EXPECT_EQ(kTestLinkBandwidth * kTestRtt, sender_->ExportDebugState().congestion_window); if (GetQuicReloadableFlag(quic_bbr_fix_pacing_rate)) { EXPECT_EQ(kTestLinkBandwidth, sender_->PacingRate(/*bytes_in_flight=*/0)); } EXPECT_APPROX_EQ(kTestRtt, sender_->ExportDebugState().min_rtt, 0.01f); DriveOutOfStartup(); } // Test with a min CWND of 1 instead of 4 packets. TEST_F(BbrSenderTest, ProbeRTTMinCWND1) { CreateDefaultSetup(); SetConnectionOption(kMIN1); DriveOutOfStartup(); // We have no intention of ever finishing this transfer. bbr_sender_.AddBytesToTransfer(100 * 1024 * 1024); // Wait until the connection enters PROBE_RTT. const QuicTime::Delta timeout = QuicTime::Delta::FromSeconds(12); bool simulator_result = simulator_.RunUntilOrTimeout( [this]() { return sender_->ExportDebugState().mode == BbrSender::PROBE_RTT; }, timeout); ASSERT_TRUE(simulator_result); ASSERT_EQ(BbrSender::PROBE_RTT, sender_->ExportDebugState().mode); // The PROBE_RTT CWND should be 1 if the min CWND is 1. EXPECT_EQ(kDefaultTCPMSS, sender_->GetCongestionWindow()); // Exit PROBE_RTT. const QuicTime probe_rtt_start = clock_->Now(); const QuicTime::Delta time_to_exit_probe_rtt = kTestRtt + QuicTime::Delta::FromMilliseconds(200); simulator_.RunFor(1.5 * time_to_exit_probe_rtt); EXPECT_EQ(BbrSender::PROBE_BW, sender_->ExportDebugState().mode); EXPECT_GE(sender_->ExportDebugState().min_rtt_timestamp, probe_rtt_start); } TEST_F(BbrSenderTest, StartupStats) { CreateDefaultSetup(); DriveOutOfStartup(); ASSERT_FALSE(sender_->InSlowStart()); const QuicConnectionStats& stats = bbr_sender_.connection()->GetStats(); EXPECT_EQ(1u, stats.slowstart_count); EXPECT_THAT(stats.slowstart_num_rtts, AllOf(Ge(5u), Le(15u))); EXPECT_THAT(stats.slowstart_packets_sent, AllOf(Ge(100u), Le(1000u))); EXPECT_THAT(stats.slowstart_bytes_sent, AllOf(Ge(100000u), Le(1000000u))); EXPECT_LE(stats.slowstart_packets_lost, 10u); EXPECT_LE(stats.slowstart_bytes_lost, 10000u); EXPECT_FALSE(stats.slowstart_duration.IsRunning()); EXPECT_THAT(stats.slowstart_duration.GetTotalElapsedTime(), AllOf(Ge(QuicTime::Delta::FromMilliseconds(500)), Le(QuicTime::Delta::FromMilliseconds(1500)))); EXPECT_EQ(stats.slowstart_duration.GetTotalElapsedTime(), QuicConnectionPeer::GetSentPacketManager(bbr_sender_.connection()) ->GetSlowStartDuration()); } // Regression test for b/143540157. TEST_F(BbrSenderTest, RecalculatePacingRateOnCwndChange1RTT) { CreateDefaultSetup(); bbr_sender_.AddBytesToTransfer(1 * 1024 * 1024); // Wait until an ACK comes back. const QuicTime::Delta timeout = QuicTime::Delta::FromSeconds(5); bool simulator_result = simulator_.RunUntilOrTimeout( [this]() { return !sender_->ExportDebugState().min_rtt.IsZero(); }, timeout); ASSERT_TRUE(simulator_result); const QuicByteCount previous_cwnd = sender_->ExportDebugState().congestion_window; // Bootstrap cwnd. bbr_sender_.connection()->AdjustNetworkParameters( SendAlgorithmInterface::NetworkParams(kTestLinkBandwidth, QuicTime::Delta::Zero(), false)); if (!GetQuicReloadableFlag(quic_bbr_donot_inject_bandwidth)) { EXPECT_EQ(kTestLinkBandwidth, sender_->ExportDebugState().max_bandwidth); EXPECT_EQ(kTestLinkBandwidth, sender_->BandwidthEstimate()); } EXPECT_LT(previous_cwnd, sender_->ExportDebugState().congestion_window); if (GetQuicReloadableFlag(quic_bbr_fix_pacing_rate)) { // Verify pacing rate is re-calculated based on the new cwnd and min_rtt. EXPECT_APPROX_EQ(QuicBandwidth::FromBytesAndTimeDelta( sender_->ExportDebugState().congestion_window, sender_->ExportDebugState().min_rtt), sender_->PacingRate(/*bytes_in_flight=*/0), 0.01f); } else { // Pacing rate is still based on initial cwnd. EXPECT_APPROX_EQ(QuicBandwidth::FromBytesAndTimeDelta( kInitialCongestionWindowPackets * kDefaultTCPMSS, sender_->ExportDebugState().min_rtt), sender_->PacingRate(/*bytes_in_flight=*/0), 0.01f); } } TEST_F(BbrSenderTest, RecalculatePacingRateOnCwndChange0RTT) { CreateDefaultSetup(); // Initial RTT is available. const_cast<RttStats*>(rtt_stats_)->set_initial_rtt(kTestRtt); // Bootstrap cwnd. bbr_sender_.connection()->AdjustNetworkParameters( SendAlgorithmInterface::NetworkParams(kTestLinkBandwidth, QuicTime::Delta::Zero(), false)); if (!GetQuicReloadableFlag(quic_bbr_donot_inject_bandwidth)) { EXPECT_EQ(kTestLinkBandwidth, sender_->ExportDebugState().max_bandwidth); EXPECT_EQ(kTestLinkBandwidth, sender_->BandwidthEstimate()); } EXPECT_LT(kInitialCongestionWindowPackets * kDefaultTCPMSS, sender_->ExportDebugState().congestion_window); // No Rtt sample is available. EXPECT_TRUE(sender_->ExportDebugState().min_rtt.IsZero()); if (GetQuicReloadableFlag(quic_bbr_fix_pacing_rate)) { // Verify pacing rate is re-calculated based on the new cwnd and initial // RTT. EXPECT_APPROX_EQ(QuicBandwidth::FromBytesAndTimeDelta( sender_->ExportDebugState().congestion_window, rtt_stats_->initial_rtt()), sender_->PacingRate(/*bytes_in_flight=*/0), 0.01f); } else { // Pacing rate is still based on initial cwnd. EXPECT_APPROX_EQ( 2.885f * QuicBandwidth::FromBytesAndTimeDelta( kInitialCongestionWindowPackets * kDefaultTCPMSS, rtt_stats_->initial_rtt()), sender_->PacingRate(/*bytes_in_flight=*/0), 0.01f); } } } // namespace test } // namespace quic
[ "kizdiv@gmail.com" ]
kizdiv@gmail.com
d936eef4180b4219c55acff0f1fcfa694ca6c643
29a4c1e436bc90deaaf7711e468154597fc379b7
/modules/gsl_specfun/include/nt2/toolbox/gsl_specfun/function/simd/sse/sse4_2/gsl_sf_laguerre_3.hpp
b75cbeb388cc6010b3fcc5a2971584b062a2b686
[ "BSL-1.0" ]
permissive
brycelelbach/nt2
31bdde2338ebcaa24bb76f542bd0778a620f8e7c
73d7e8dd390fa4c8d251c6451acdae65def70e0b
refs/heads/master
2021-01-17T12:41:35.021457
2011-04-03T17:37:15
2011-04-03T17:37:15
1,263,345
1
0
null
null
null
null
UTF-8
C++
false
false
771
hpp
////////////////////////////////////////////////////////////////////////////// /// Copyright 2003 and onward LASMEA UMR 6602 CNRS/U.B.P Clermont-Ferrand /// Copyright 2009 and onward LRI UMR 8623 CNRS/Univ Paris Sud XI /// /// Distributed under the Boost Software License, Version 1.0 /// See accompanying file LICENSE.txt or copy at /// http://www.boost.org/LICENSE_1_0.txt ////////////////////////////////////////////////////////////////////////////// #ifndef NT2_TOOLBOX_GSL_SPECFUN_FUNCTION_SIMD_SSE_SSE4_2_GSL_SF_LAGUERRE_3_HPP_INCLUDED #define NT2_TOOLBOX_GSL_SPECFUN_FUNCTION_SIMD_SSE_SSE4_2_GSL_SF_LAGUERRE_3_HPP_INCLUDED #include <nt2/toolbox/gsl_specfun/function/simd/sse/sse4_1/gsl_sf_laguerre_3.hpp> #endif
[ "joel.falcou@lri.fr" ]
joel.falcou@lri.fr
c3617e56622a1d710dde429bd6a64f3c292934a6
b6ce9b399dfdf0f5e7a11d69ac077f462ccbec63
/include/roomviewer/RoomViewerScene.h
790d9d9df97b6c86e70d5d2f1c377cd7069ce0c0
[]
no_license
AsTeFu/Roguelike
6db30abd80b01ee61bf02d005c4385bab985b02d
221241f8a645c92a864d1bc967c845565a31dfdc
refs/heads/master
2020-07-11T10:05:29.219942
2019-09-18T19:15:34
2019-09-18T19:15:34
202,659,470
1
0
null
null
null
null
UTF-8
C++
false
false
1,145
h
// // Created by AsTeFu on 04.09.2019. // #ifndef INCLUDE_ROOMVIEWER_ROOMVIEWERSCENE_H_ #define INCLUDE_ROOMVIEWER_ROOMVIEWERSCENE_H_ #include <editor/Components/StructureComponent.h> #include <game/Scenes/SceneManager.h> #include <string> #include <vector> class RoomViewerScene : public Scene { private: std::vector<StructureComponent*> _structures; std::vector<std::string> _names; int currentRoom{0}; Vector2 _position; Vector2 _size; Vector2 _offsetPosition; int _margin{6}; int _topMargin{4}; public: RoomViewerScene(Context* const context, SceneManager* sceneManager); void start(SceneManager* sceneManager) override; void update(SceneManager* sceneManager) override; void end(SceneManager* sceneManager) override; void render() override; void leftward(); void rightward(); void renderStructure(const StructureComponent* structure, const Vector2& position) const; void renderSecondaryStructure(const StructureComponent* structure, const Vector2& position, int roomIndex) const; void renderName(const Vector2& position, int roomIndex) const; }; #endif // INCLUDE_ROOMVIEWER_ROOMVIEWERSCENE_H_
[ "astefuapps@gmail.com" ]
astefuapps@gmail.com
06aabb68390424c195e9fa6b97e9f9e96a235cb7
d18ad9e17134e517879330d15c355b3a3f102615
/Povox/src/pxpch.h
babe4036c6a4fa23258b751daa79bd716a6a8a31
[ "Apache-2.0" ]
permissive
PowerOfNames/Povox
5b21e8057a95ee7f3ed1398bf422863601e8e188
9c6e590fe7d5b82fbb0f9c4d0c07821cb9cad0b6
refs/heads/master
2023-08-13T21:12:03.425458
2023-08-07T13:23:39
2023-08-07T13:23:39
233,458,408
0
0
null
null
null
null
UTF-8
C++
false
false
437
h
#pragma once #include <iostream> #include <memory> #include <utility> #include <algorithm> #include <functional> #include <optional> #include <chrono> #include <string> #include <sstream> #include <vector> #include <map> #include <unordered_map> #include <set> #include <unordered_set> #include <variant> #include "Povox/Core/Log.h" #include "Povox/Debugging/Instrumentor.h" #ifdef PX_PLATFORM_WINDOWS #include <Windows.h> #endif
[ "PowerOfNames@web.de" ]
PowerOfNames@web.de
af175f95929c7bcf5c3c248e4f67bd09d394f2bc
553cd650a0af193c83866deab14a922ecd1d3613
/src/wallet/tests/address_book_test.cpp
acbbf58bcd26c9bab9fc709f677b07b8f3d10ecc
[ "MIT" ]
permissive
edwardstock/mintex
9251703ef5b5e4dc11a6baa2974fed2f972f414b
edb9a5cef4fa145921a5ceac6d981e423f893f86
refs/heads/master
2020-05-17T03:16:57.538043
2019-07-25T22:17:34
2019-07-25T22:17:34
183,473,512
1
0
null
null
null
null
UTF-8
C++
false
false
1,285
cpp
/*! * mintex. * address_book_test.cpp * * \date 2019 * \author Eduard Maximovich (edward.vstock@gmail.com) * \link https://github.com/edwardstock */ #include <gtest/gtest.h> #include <string> #include <boost/filesystem.hpp> #include "wallet/data/address_book.h" TEST(AddressBook, TestAll) { namespace fs = boost::filesystem; std::system("rm -rf /tmp/test.db"); using namespace wallet; leveldb::Options opts; auto storage = wallet::address_book::create(db::kv_storage("/tmp/test.db", opts)); book_record rec1{validator, "monster", "Mp46d3d6afe0084fcf530b03d1f4427e516a1cb4ec542640bcbc84c2c4b4f53c13"}; storage->set(rec1); book_record res1 = storage->get("monster"); ASSERT_EQ(wallet::record_type::validator, res1.type); ASSERT_STREQ("monster", res1.name.c_str()); ASSERT_STREQ("Mp46d3d6afe0084fcf530b03d1f4427e516a1cb4ec542640bcbc84c2c4b4f53c13", res1.value.c_str()); book_record rec2{record_type::wallet, "main", "Mxa0e1c038dea3dc5970a3dcf30be0b2d85e4d1759"}; storage->set(rec2); book_record res2 = storage->get("main"); ASSERT_EQ(wallet::record_type::wallet, res2.type); ASSERT_STREQ("main", res2.name.c_str()); ASSERT_STREQ("Mxa0e1c038dea3dc5970a3dcf30be0b2d85e4d1759", res2.value.c_str()); }
[ "edward.vstock@gmail.com" ]
edward.vstock@gmail.com
65d7a54cccf5e2fb43023f52e6a7e51e0bb21a6d
e6c4ffd58d9c3b11a46ca2cffc596df0cec3ab87
/clients/testings/testing_scatter.cpp
b6702ab4da7ec632fbf4f2ba6cfff67ad54ff850
[ "MIT" ]
permissive
jsandham/rocSPARSE
1e60455a83f1852bb98c4887484278f1d6d971e1
881eb358a484c9f83e08be8599676fdad0045040
refs/heads/master
2023-08-31T11:26:19.329200
2021-01-06T17:35:32
2021-01-06T17:35:32
236,610,308
0
0
MIT
2020-01-27T22:32:13
2020-01-27T22:32:13
null
UTF-8
C++
false
false
6,797
cpp
/* ************************************************************************ * Copyright (c) 2020 Advanced Micro Devices, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * * ************************************************************************ */ #include "testing.hpp" template <typename I, typename T> void testing_scatter_bad_arg(const Arguments& arg) { I size = 100; I nnz = 100; rocsparse_index_base base = rocsparse_index_base_zero; // Index and data type rocsparse_indextype itype = get_indextype<I>(); rocsparse_datatype ttype = get_datatype<T>(); // Create rocsparse handle rocsparse_local_handle handle; // Allocate memory on device device_vector<I> dx_ind(nnz); device_vector<T> dx_val(nnz); device_vector<T> dy(size); if(!dx_ind || !dx_val || !dy) { CHECK_HIP_ERROR(hipErrorOutOfMemory); return; } // Structures rocsparse_local_spvec x(size, nnz, dx_ind, dx_val, itype, base, ttype); rocsparse_local_dnvec y(size, dy, ttype); EXPECT_ROCSPARSE_STATUS(rocsparse_scatter(nullptr, x, y), rocsparse_status_invalid_handle); EXPECT_ROCSPARSE_STATUS(rocsparse_scatter(handle, nullptr, y), rocsparse_status_invalid_pointer); EXPECT_ROCSPARSE_STATUS(rocsparse_scatter(handle, x, nullptr), rocsparse_status_invalid_pointer); } template <typename I, typename T> void testing_scatter(const Arguments& arg) { I size = arg.M; I nnz = arg.nnz; rocsparse_index_base base = arg.baseA; // Index and data type rocsparse_indextype itype = get_indextype<I>(); rocsparse_datatype ttype = get_datatype<T>(); // Create rocsparse handle rocsparse_local_handle handle; // Argument sanity check before allocating invalid memory if(size <= 0 || nnz <= 0) { static const I safe_size = 100; // Allocate memory on device device_vector<T> dx_ind(safe_size); device_vector<T> dx_val(safe_size); device_vector<T> dy(safe_size); if(!dx_ind || !dx_val || !dy) { CHECK_HIP_ERROR(hipErrorOutOfMemory); return; } // Check structures rocsparse_local_spvec x(size, nnz, dx_ind, dx_val, itype, base, ttype); rocsparse_local_dnvec y(size, dy, ttype); // Check Scatter when structures were created if(size >= 0 && nnz >= 0) { EXPECT_ROCSPARSE_STATUS(rocsparse_scatter(handle, x, y), rocsparse_status_success); } return; } // Allocate host memory for matrix host_vector<I> hx_ind(nnz); host_vector<T> hx_val(nnz); host_vector<T> hy(size); host_vector<T> hy_gold(size); // Initialize data on CPU rocsparse_seedrand(); rocsparse_init_index(hx_ind, nnz, 1, size); rocsparse_init<T>(hx_val, 1, nnz, 1); rocsparse_init<T>(hy, 1, size, 1); hy_gold = hy; // Allocate device memory device_vector<I> dx_ind(nnz); device_vector<T> dx_val(nnz); device_vector<T> dy(size); if(!dx_ind || !dx_val || !dy) { CHECK_HIP_ERROR(hipErrorOutOfMemory); return; } // Copy data from CPU to device CHECK_HIP_ERROR(hipMemcpy(dx_ind, hx_ind, sizeof(I) * nnz, hipMemcpyHostToDevice)); CHECK_HIP_ERROR(hipMemcpy(dx_val, hx_val, sizeof(T) * nnz, hipMemcpyHostToDevice)); CHECK_HIP_ERROR(hipMemcpy(dy, hy, sizeof(T) * size, hipMemcpyHostToDevice)); // Create descriptors rocsparse_local_spvec x(size, nnz, dx_ind, dx_val, itype, base, ttype); rocsparse_local_dnvec y(size, dy, ttype); if(arg.unit_check) { // Scatter CHECK_ROCSPARSE_ERROR(rocsparse_scatter(handle, x, y)); // Copy output to host CHECK_HIP_ERROR(hipMemcpy(hy, dy, sizeof(T) * size, hipMemcpyDeviceToHost)); // CPU scatter host_sctr<I, T>(nnz, hx_val, hx_ind, hy_gold, base); unit_check_general<T>(1, size, 1, hy_gold, hy); } if(arg.timing) { int number_cold_calls = 2; int number_hot_calls = arg.iters; // Warm up for(int iter = 0; iter < number_cold_calls; ++iter) { CHECK_ROCSPARSE_ERROR(rocsparse_scatter(handle, x, y)); } double gpu_time_used = get_time_us(); // Performance run for(int iter = 0; iter < number_hot_calls; ++iter) { CHECK_ROCSPARSE_ERROR(rocsparse_scatter(handle, x, y)); } gpu_time_used = (get_time_us() - gpu_time_used) / number_hot_calls; double gpu_gbyte = sctr_gbyte_count<I, T>(nnz) / gpu_time_used * 1e6; std::cout.precision(2); std::cout.setf(std::ios::fixed); std::cout.setf(std::ios::left); std::cout << std::setw(12) << "nnz" << std::setw(12) << "GB/s" << std::setw(12) << "usec" << std::setw(12) << "iter" << std::setw(12) << "verified" << std::endl; std::cout << std::setw(12) << nnz << std::setw(12) << gpu_gbyte << std::setw(12) << gpu_time_used << std::setw(12) << number_hot_calls << std::setw(12) << (arg.unit_check ? "yes" : "no") << std::endl; } } #define INSTANTIATE(ITYPE, TTYPE) \ template void testing_scatter_bad_arg<ITYPE, TTYPE>(const Arguments& arg); \ template void testing_scatter<ITYPE, TTYPE>(const Arguments& arg) INSTANTIATE(int32_t, float); INSTANTIATE(int32_t, double); INSTANTIATE(int32_t, rocsparse_float_complex); INSTANTIATE(int32_t, rocsparse_double_complex); INSTANTIATE(int64_t, float); INSTANTIATE(int64_t, double); INSTANTIATE(int64_t, rocsparse_float_complex); INSTANTIATE(int64_t, rocsparse_double_complex);
[ "noreply@github.com" ]
jsandham.noreply@github.com
027649fb15766256621778fe3bcaae712d18592e
ae9df4db0dc16065b53030e39d1325d0c81e0221
/src/FalconEngine/Content/CustomImporter.cpp
fa804f4f660ae9676e0d67d9f21f5c5f1ca0a13e
[ "MIT" ]
permissive
LiuYiZhou95/FalconEngine
c0895dba8c2a86a8dcdf156da1537d4f2e9724c3
b798f20e9dbd01334a4e4cdbbd9a5bec74966418
refs/heads/master
2021-10-25T18:40:42.868445
2017-07-30T10:23:26
2017-07-30T10:23:26
285,249,037
0
1
null
2020-08-05T09:58:53
2020-08-05T09:58:52
null
UTF-8
C++
false
false
913
cpp
#include <FalconEngine/Content/CustomImporter.h> namespace FalconEngine { /************************************************************************/ /* Constructors and Destructor */ /************************************************************************/ CustomImporter::CustomImporter(CustomImporterPolicy assetImportPolicy) : mAssetImportPolicy(assetImportPolicy) { } CustomImporter::~CustomImporter() { } /************************************************************************/ /* Public Members */ /************************************************************************/ bool CustomImporter::Import( _IN_OUT_ Model * /* model */, _IN_ const std::string& /* modelFilePath */, _IN_ const ModelImportOption& /* modelImportOption */) { return false; } }
[ "linwx_xin@hotmail.com" ]
linwx_xin@hotmail.com
add369ddc12994bd480f2b930011f990bf523368
d41a8c2ec8acf444530a4239751f415d59919f83
/old/quick_sort.cpp
55e29902b07798cdbfd343891619f82996e4f0ad
[]
no_license
fedochet/Stepic
bf7a8c8d301500cc4e9aa1569aeda9215841afd5
e4086c9d48a5307de403866ef56e938fa4db4bb1
refs/heads/master
2020-05-18T04:47:45.110621
2014-11-10T12:46:57
2014-11-10T12:46:57
null
0
0
null
null
null
null
UTF-8
C++
false
false
665
cpp
#include <iostream> #include <vector> using namespace std; struct line{ private: int x_b, x_e; public: line (int b = 0, int e = 0):x_b(b),x_e(e){} ~line(){} void print(){ cout<<"x_b == "<<x_b<<"; x_e == "<<x_e<<endl; } bool includes(int x) { return ((x>=x_b) && (x<=x_e)); } }; int main() { vector<line> v(0); int n1,n2; cin>>n1; cin>>n2; for(int i = 0; i<n1; i++) { int b,e; cin>>b>>e; v.push_back(line(b,e)); } for(int i = 0; i<n2; i++) { int point; cin>>point; int inceptions(0); for (int j = 0; j<n1; j++) { if (v[j].includes(point)) { inceptions++; } } cout<<inceptions<<" "; } return 0; }
[ "fedochet@yandex.ru" ]
fedochet@yandex.ru
f0deb0b59c9ecede42da203d0fdc2ef3f2dfb555
a85ebc9f07ded83e816e15e82d5f4d5eb3aaa3b0
/simulation.h
cc94041a9bbc44ad793f6298281563cb11930f6a
[]
no_license
kaivanwadia/VirtualCatwalkMilestone1
36c515065c7afe1446a595595a7aa81ce753e392
e0154d0022fd762f2ea5fb4243264d65d8f7ed2e
refs/heads/master
2020-04-06T04:03:12.856004
2015-09-18T22:02:10
2015-09-18T22:02:10
26,777,812
0
0
null
null
null
null
UTF-8
C++
false
false
1,170
h
#ifndef SIMULATION_H #define SIMULATION_H #include <Eigen/Core> #include <Eigen/Sparse> #include <vector> #include <set> #include <QMutex> #include "simparameters.h" #include <QGLWidget> class RigidBodyTemplate; class RigidBodyInstance; class Cloth; typedef Eigen::Triplet<double> Tr; class SimParameters; class Simulation { public: Simulation(const SimParameters &params); ~Simulation(); void takeSimulationStep(); void initializeGL(); void renderFloor(); void renderObjects(); void clearScene(); void accelerateBody(double vx, double vy, double vz, double wx, double wy, double wz); Eigen::VectorXd computeForces(); Eigen::VectorXd computeGravity(); Eigen::VectorXd computeStretchingForce(); Eigen::VectorXd computeDampingForce(); Eigen::VectorXd computeContactForce(); Eigen::VectorXd computeBendingForce(); private: void loadFloorTexture(); void loadRigidBodies(); const SimParameters &params_; QMutex renderLock_; double time_; GLuint floorTex_; RigidBodyTemplate * bodyTemplate_; RigidBodyInstance * bodyInstance_; Cloth * cloth_; }; #endif // SIMULATION_H
[ "kaivanwadia@gmail.com" ]
kaivanwadia@gmail.com
9f4d0da945b878d5d511f9a66f1f70d7dc79d41b
86bfae94def1ca36bec20ab0ecadd72c1f97272e
/src/post/main/MessageTraces.hpp
2866584f0441ab22864814bfa1c2b07212136427
[ "BSD-3-Clause" ]
permissive
ucd-plse/mpi-error-prop
22b947ff5a51c86817b973e55c68e4a2cf19e664
4367df88bcdc4d82c9a65b181d0e639d04962503
refs/heads/master
2020-09-17T06:24:19.740006
2020-01-31T21:48:35
2020-01-31T21:48:35
224,017,672
6
0
null
null
null
null
UTF-8
C++
false
false
226
hpp
#ifndef MESSAGE_TRACES #define MESSAGE_TRACES class MessageTraces : public Message { public: virtual string format(); virtual string getErrorCodeStr(bool starBefore=false); private: string getLocationStr(); }; #endif
[ "dcdefreez@ucdavis.edu" ]
dcdefreez@ucdavis.edu
6cca5870a2a8e6be7acffa4a0825d6cea3471f87
6f3f75fff9c94dd9efbb03cdfd28e1dd71da1aaf
/Graph/GraphVisitByDfs.cpp
3563f57b948d701719d88c749fab9e52a724ae16
[]
no_license
bw98/DataStructure
2d34e2c0bc4bc6cfab3d8c1d8644b29b7c7c90a2
f9777f6449888f04b5d385a340cfa13d9468c991
refs/heads/master
2021-09-11T20:59:35.302250
2018-04-12T09:50:37
2018-04-12T09:50:37
109,584,489
0
0
null
null
null
null
UTF-8
C++
false
false
3,587
cpp
/************************************************************************* > File Name: GraphVisitByDfs.cpp > Author: bw98 > Mail: 786016476@qq.com > Created Time: 2017年12月13日 星期三 10时42分49秒 ************************************************************************/ #include<iostream> #include<stack> #include<queue> #define MAX 100 using namespace std; typedef struct { int adjx[MAX][MAX]; //邻接矩阵 int v; //顶点数 int e; //边数 }Graph; void createGraph (Graph *); //创建无向图 void dfs_Recursion (Graph& , int ); //dfs递归 void dfs_NotRecursion (Graph& , int ); //dfs非递归 void bfs (Graph& , int ); //bfs void printAdjx (Graph& ); //打印无向图 bool visited2[MAX] = {0}; int main (void) { int vertexNumber, eNumber; cout << "please input vertex total Number and e total Number" << endl; cin >> vertexNumber >> eNumber; if (vertexNumber > 0) { Graph G; G.v = vertexNumber; G.e = eNumber; createGraph (&G); printAdjx(G); int startVertex; cout << "please input first visiting vertex you want" << endl; cin >> startVertex; //dfs bfs 加在这 //若考虑图不为连通图,想得到连通分量,可在此行判断是否所有点都被访问 } cout << endl; return 0; } void createGraph (Graph *G) { int i,j; int v1,v2,val; //<v1, v2> 用于存储边的权值 for (i = 0; i < G->v; i++) { for (j = 0; j < G->v; j++) { G->adjx[i][j] = 0; } } for (i = 0; i < G->e; i++) { cout << "v1, v2, and value is: " << endl; cin >> v1 >> v2 >> val; G->adjx[v1][v2] = val; G->adjx[v2][v1] = val; } } void printAdjx (Graph& G) { int i,j; for (i = 0; i < G.v; i++) { for (j = 0; j< G.v; j++) { cout << G.adjx[i][j] << " "; } cout << endl; } } void dfs_Recursion (Graph& G, int v0) { //递归算法,只能通过全局的访问数组进行标记 visited2[v0] = true; cout << v0 << " "; //移动到第一个相邻的邻接点 int i; for (i = 0; i < G.v; ++i) { if (G.adjx[v0][i] && !visited2[i]) { break; } } //没有未被标记且与v相邻的顶点 if (i == G.v) { return; }; //找到与 v 相邻的顶点 dfs_Recursion (G, i); } void dfs_NotRecursion (Graph &G, int n) { bool visited[G.v]; int i; for (i = 0; i < G.v; ++i) { visited[i] = false; } stack<int> s; cout << n << " "; visited[n] = true; s.push(n); while (!s.empty()) { int topVertexIndex; topVertexIndex = s.top(); for (i = 0; i < G.v; ++i) { if ((G.adjx[topVertexIndex][i] != 0) && (visited[i] == false) ) { cout << topVertexIndex << " "; visited[i] = true; s.push(i); break; } } if (i == G.v) { s.pop(); } //所有相邻点都被访问 } } void bfs (Graph& G, int v0){ //访问结点并标记 cout << v0 << " "; visited2[v0] = true; queue<int> q; q.push(v0); while (!q.empty()) { //队列为空说明所有有路的点都已访问 int v; v = q.front(); q.pop(); int i; for (i = 0; i < G.v; ++i) { if (G.adjx[v][i] && !visited2[i]) { cout << i << " "; visited2[i] = true; q.push(i); } } } }
[ "786016746@qq.com" ]
786016746@qq.com
8d8a33f978d7beb5b09fd361c960bb44610d8e47
631f8e0ab403eef0e1a8fb013457aa22fc1e47f6
/src/Landscape.cpp
34986d9637824ed61b12c545d5fdbae4a4990934
[]
no_license
gdev-munky/awge
675b9c249e7156483969140cda3fd37fac0e43ef
a73a6674ae6dafa8a4cd57c94fbac03bf06aed6b
refs/heads/master
2021-01-22T02:52:50.107893
2013-10-01T16:12:58
2013-10-01T16:12:58
null
0
0
null
null
null
null
WINDOWS-1251
C++
false
false
1,951
cpp
#include "Landscape.h" //------------------------------------- // Генерирует ландшафт, задается шириной, минимальной высотой и максимальной высотой, все в блоках //------------------------------------- void Landscape::generate(int _width, int minBlocks, int maxBlocks) { width = _width; height = new int[width*2]; height[0] = int(floor(ofRandom(minBlocks, maxBlocks))); int last = height[0]; for (int x=1; x < width*2; x++) { //высота отличается от предыдущей не более чем на 2 блока height[x] = int(floor(ofRandom(-2,2))) + last; if (height[x] > maxBlocks) height[x] = maxBlocks; else if (height[x] < minBlocks) height[x] = minBlocks; //запомнили последнюю сгенерированную высоту last = height[x]; } worldSize = width*blockSize/2; //инициализация текстуры блоков texBlock.loadImage(texPath); } //------------------------------------- // Высота ландшафта по координате X (мировая X, относительная Высота) //------------------------------------- float Landscape::getHeightAtX(float x) // f(0) not exist { int ax = int(floor(x/blockSize)) + width; if (ax < 0) ax = 0; else if (ax > 2*width) ax = width; return height[ax]*blockSize; } void Landscape::draw(float playerX) { int x=1, y=getHeightAtX(x); int ax = int(floor(playerX/blockSize)) + width; int ww = ofGetScreenWidth()/blockSize; int sx = max(0, ax-ww); int ex = min(width*2, ax+ww); float bs = blockSize/2; float my = ofGetWindowHeight(); float blockX; for( int x = sx; x < ex; x++ ) { blockX = (x - width) * blockSize - playerX + ofGetScreenWidth()/2; ofSetColor(255); for( int y = 1; y <= height[x]; y++ ) { texBlock.draw(blockX, my-y*blockSize, blockSize, blockSize); } } }
[ "ml4_aem@mail.ru" ]
ml4_aem@mail.ru
35ce652469e55a2cf9142efe5800138a85417767
868e8628acaa0bf276134f9cc3ced379679eab10
/squareDrop/0.386/p
05749c15cdf0fd1f2e18e755488db3a3ce060a67
[]
no_license
stigmn/droplet
921af6851f88c0acf8b1cd84f5e2903f1d0cb87a
1649ceb0a9ce5abb243fb77569211558c2f0dc96
refs/heads/master
2020-04-04T20:08:37.912624
2015-11-25T11:20:32
2015-11-25T11:20:32
45,102,907
0
0
null
2015-10-28T09:46:30
2015-10-28T09:46:29
null
UTF-8
C++
false
false
116,910
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2.4.0 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; location "0.386"; object p; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [1 -1 -2 0 0 0 0]; internalField nonuniform List<scalar> 10000 ( 0.00241111 0.00241037 0.00240976 0.00240969 0.00241038 0.00241189 0.00241421 0.00241728 0.00242102 0.00242535 0.00243018 0.00243543 0.00244101 0.00244684 0.00245285 0.00245897 0.00246514 0.00247128 0.00247734 0.00248326 0.00248898 0.00249447 0.00249969 0.00250464 0.00250934 0.00251382 0.00251819 0.00252252 0.00252697 0.00253165 0.00253671 0.00254226 0.00254838 0.00255512 0.0025625 0.00257052 0.00257921 0.00258859 0.00259872 0.00260963 0.00262135 0.00263383 0.00264701 0.0026608 0.00267507 0.00268971 0.00270461 0.00271967 0.0027348 0.00274994 0.00241183 0.0024111 0.00241062 0.0024107 0.00241147 0.00241295 0.00241515 0.00241802 0.00242152 0.00242557 0.0024301 0.00243504 0.00244031 0.00244585 0.00245159 0.00245746 0.00246341 0.00246937 0.00247529 0.00248113 0.00248683 0.00249236 0.0024977 0.00250286 0.00250784 0.0025127 0.0025175 0.00252232 0.00252727 0.00253246 0.00253798 0.00254393 0.00255038 0.00255737 0.00256492 0.00257303 0.00258173 0.00259106 0.00260107 0.00261179 0.00262326 0.00263544 0.00264829 0.00266173 0.00267567 0.00269001 0.00270464 0.00271947 0.00273442 0.00274943 0.00241243 0.00241156 0.00241108 0.00241123 0.00241203 0.00241348 0.00241558 0.00241829 0.00242157 0.00242538 0.00242965 0.00243432 0.00243934 0.00244462 0.00245013 0.0024558 0.00246157 0.00246738 0.00247321 0.00247898 0.00248468 0.00249027 0.00249575 0.0025011 0.00250636 0.00251155 0.00251674 0.002522 0.0025274 0.00253303 0.00253898 0.0025453 0.00255206 0.00255929 0.00256699 0.00257517 0.00258386 0.00259309 0.00260294 0.00261346 0.00262468 0.00263658 0.00264915 0.0026623 0.00267597 0.00269006 0.00270448 0.00271914 0.00273396 0.00274888 0.00241247 0.00241144 0.0024109 0.00241105 0.00241185 0.00241327 0.0024153 0.0024179 0.00242104 0.00242469 0.00242878 0.00243326 0.00243809 0.00244321 0.00244855 0.00245408 0.00245974 0.00246547 0.00247125 0.00247701 0.00248274 0.00248841 0.002494 0.00249953 0.002505 0.00251046 0.00251595 0.00252154 0.00252728 0.00253326 0.00253953 0.00254615 0.00255317 0.0025606 0.00256844 0.00257667 0.00258529 0.00259438 0.00260403 0.00261432 0.0026253 0.00263698 0.00264934 0.0026623 0.0026758 0.00268976 0.00270407 0.00271865 0.00273343 0.00274831 0.00241173 0.00241063 0.00241005 0.00241021 0.00241101 0.00241242 0.0024144 0.00241693 0.00241999 0.00242352 0.00242749 0.00243185 0.00243655 0.00244155 0.0024468 0.00245224 0.00245784 0.00246354 0.00246931 0.0024751 0.00248088 0.00248663 0.00249234 0.00249802 0.00250368 0.00250935 0.00251508 0.00252092 0.00252692 0.00253317 0.00253971 0.00254659 0.00255385 0.00256148 0.00256946 0.00257771 0.00258621 0.00259507 0.00260445 0.00261448 0.00262523 0.00263671 0.00264891 0.00266176 0.00267519 0.0026891 0.0027034 0.00271799 0.00273278 0.0027477 0.00241014 0.00240907 0.00240853 0.00240872 0.00240956 0.00241097 0.00241294 0.00241544 0.00241844 0.00242191 0.0024258 0.00243008 0.00243471 0.00243964 0.00244484 0.00245025 0.00245583 0.00246154 0.00246733 0.00247317 0.00247902 0.00248487 0.0024907 0.00249652 0.00250233 0.00250817 0.00251408 0.00252011 0.00252633 0.00253279 0.00253955 0.00254666 0.00255415 0.00256203 0.00257019 0.00257845 0.00258675 0.00259526 0.00260426 0.00261395 0.00262445 0.00263576 0.00264786 0.00266068 0.00267412 0.00268808 0.00270245 0.00271712 0.00273201 0.00274702 0.00240772 0.00240676 0.00240633 0.00240661 0.0024075 0.00240896 0.00241095 0.00241345 0.00241643 0.00241986 0.00242372 0.00242796 0.00243255 0.00243746 0.00244265 0.00244807 0.00245368 0.00245943 0.00246529 0.00247121 0.00247716 0.00248312 0.00248906 0.00249499 0.00250093 0.00250689 0.00251293 0.00251911 0.00252547 0.00253209 0.00253904 0.00254636 0.00255411 0.0025623 0.00257076 0.00257908 0.00258706 0.00259498 0.00260342 0.00261269 0.0026229 0.00263407 0.00264614 0.002659 0.00267256 0.00268667 0.00270121 0.00271607 0.00273112 0.00274629 0.0024045 0.00240374 0.00240348 0.00240388 0.00240487 0.00240639 0.00240843 0.00241096 0.00241395 0.00241739 0.00242124 0.00242548 0.00243008 0.002435 0.00244022 0.00244569 0.00245137 0.00245722 0.00246318 0.00246921 0.00247527 0.00248135 0.0024874 0.00249344 0.00249946 0.00250551 0.00251162 0.00251786 0.00252429 0.002531 0.00253809 0.00254557 0.0025536 0.00256228 0.00257133 0.00257984 0.00258728 0.00259422 0.00260182 0.00261054 0.00262046 0.00263153 0.00264366 0.0026567 0.00267048 0.00268486 0.00269969 0.00271482 0.00273013 0.00274553 0.00240057 0.00240005 0.00240001 0.00240057 0.00240168 0.00240331 0.00240542 0.002408 0.00241103 0.00241449 0.00241837 0.00242264 0.00242728 0.00243225 0.00243754 0.0024431 0.00244889 0.00245487 0.00246097 0.00246715 0.00247336 0.00247956 0.00248573 0.00249184 0.0024979 0.00250395 0.00251003 0.00251622 0.0025226 0.00252925 0.00253641 0.00254394 0.00255218 0.00256165 0.00257194 0.002581 0.00258754 0.00259278 0.00259914 0.00260722 0.0026169 0.002628 0.00264034 0.0026537 0.00266787 0.00268266 0.00269789 0.00271341 0.00272908 0.00274477 0.00239598 0.00239576 0.00239596 0.00239672 0.00239798 0.00239972 0.00240192 0.00240458 0.00240767 0.00241119 0.00241512 0.00241944 0.00242414 0.00242919 0.00243458 0.00244027 0.00244622 0.00245238 0.00245868 0.00246504 0.00247141 0.00247775 0.002484 0.00249013 0.00249612 0.00250202 0.00250791 0.00251391 0.00252006 0.00252646 0.0025336 0.00254103 0.0025492 0.00255985 0.00257289 0.00258318 0.00258789 0.0025899 0.00259453 0.00260206 0.00261174 0.00262316 0.00263599 0.00264992 0.00266468 0.00268005 0.00269585 0.00271188 0.002728 0.00274408 0.00239084 0.00239092 0.0023914 0.00239236 0.00239379 0.00239566 0.00239797 0.00240072 0.00240389 0.00240747 0.00241147 0.00241586 0.00242064 0.00242579 0.00243131 0.00243717 0.00244334 0.00244974 0.00245627 0.00246284 0.00246938 0.00247581 0.00248207 0.00248811 0.00249391 0.00249953 0.00250515 0.00251092 0.00251675 0.00252273 0.00252983 0.00253701 0.0025449 0.00255679 0.00257574 0.0025887 0.00258941 0.0025848 0.00258678 0.00259393 0.00260409 0.00261636 0.0026302 0.00264514 0.00266083 0.00267705 0.00269359 0.00271029 0.00272697 0.00274352 0.00238521 0.0023856 0.00238636 0.00238754 0.00238914 0.00239115 0.00239359 0.00239643 0.00239969 0.00240335 0.00240742 0.00241189 0.00241676 0.00242203 0.0024277 0.00243376 0.00244018 0.00244687 0.00245368 0.00246044 0.00246708 0.00247356 0.00247979 0.0024857 0.00249131 0.0024967 0.00250214 0.00250786 0.00251331 0.0025188 0.0025265 0.00253143 0.00254103 0.00255692 0.00258212 0.00260404 0.0025973 0.00257756 0.00257473 0.00258188 0.00259335 0.00260709 0.00262244 0.00263891 0.00265604 0.00267351 0.00269113 0.00270869 0.00272607 0.00274317 0.00237917 0.00237986 0.0023809 0.00238229 0.00238407 0.00238623 0.00238879 0.00239174 0.00239509 0.00239883 0.00240297 0.00240751 0.00241247 0.00241784 0.00242365 0.0024299 0.00243658 0.0024436 0.0024507 0.00245764 0.00246442 0.00247104 0.00247735 0.00248323 0.00248874 0.0024939 0.00249923 0.00250521 0.00251006 0.00251415 0.00252673 0.0025362 0.00252607 0.00255734 0.00265059 0.00265194 0.00261286 0.00256416 0.00255364 0.00256574 0.00258101 0.0025967 0.00261359 0.00263156 0.0026502 0.0026692 0.00268828 0.00270707 0.00272537 0.00274314 0.00237278 0.00237377 0.00237506 0.00237666 0.0023786 0.00238091 0.00238359 0.00238665 0.00239008 0.0023939 0.00239811 0.00240271 0.0024077 0.0024131 0.00241896 0.00242532 0.00243223 0.00243963 0.00244716 0.00245447 0.00246165 0.0024687 0.00247525 0.00248115 0.00248655 0.00249108 0.00249582 0.00250243 0.002508 0.00251335 0.00252345 0.00253751 0.00266634 0.00254861 0.00269729 0.00274405 0.00264603 0.0025437 0.00253348 0.00255946 0.00257581 0.00259024 0.00260681 0.00262508 0.00264443 0.00266454 0.00268507 0.00270533 0.00272482 0.00274349 0.00236613 0.00236736 0.00236889 0.00237067 0.00237277 0.00237522 0.00237801 0.00238117 0.00238469 0.00238858 0.00239282 0.00239741 0.00240233 0.00240762 0.00241341 0.00241983 0.00242699 0.00243489 0.00244308 0.00245113 0.00245919 0.00246706 0.00247397 0.00247979 0.00248491 0.00248785 0.00249054 0.00249722 0.00250833 0.00251593 0.0025375 0.00253022 0.00250234 0.00229787 0.00348925 0.00368053 0.00278658 0.00245821 0.00258657 0.00257779 0.00258231 0.00258952 0.00260319 0.00262034 0.00263957 0.00266028 0.00268208 0.00270373 0.00272441 0.0027441 0.00235924 0.00236068 0.00236241 0.00236436 0.0023666 0.00236917 0.00237208 0.00237533 0.00237893 0.00238286 0.00238708 0.00239154 0.00239626 0.0024014 0.00240714 0.00241367 0.00242115 0.00242955 0.00243854 0.00244776 0.00245737 0.00246664 0.00247407 0.00247961 0.00248407 0.00248384 0.0024831 0.00249012 0.00250643 0.00253183 0.00262818 0.00260064 0.00270144 0.00671958 0.00987892 0.00983616 0.00984633 0.00351054 0.0026533 0.00259136 0.00258344 0.00258718 0.00259863 0.00261499 0.00263436 0.00265595 0.0026796 0.0027029 0.00272445 0.00274492 0.00235217 0.00235378 0.00235566 0.00235774 0.0023601 0.00236278 0.00236579 0.00236914 0.0023728 0.00237674 0.00238086 0.00238512 0.00238967 0.00239479 0.0024007 0.0024075 0.00241529 0.00242407 0.00243381 0.00244462 0.00245655 0.0024683 0.00247683 0.0024819 0.00248565 0.00247819 0.00247248 0.00247713 0.00248812 0.00250692 0.00252651 0.00254759 0.00259897 0.00385399 0.00983523 0.0101618 0.0066827 0.00259763 0.00258477 0.00257433 0.00256878 0.00257585 0.00258871 0.00260638 0.00262661 0.00264977 0.00267713 0.00270324 0.0027254 0.00274613 0.00234494 0.00234665 0.00234865 0.00235083 0.00235329 0.00235607 0.00235918 0.00236261 0.00236633 0.00237024 0.00237421 0.00237834 0.00238295 0.00238836 0.00239471 0.002402 0.00241025 0.00241945 0.00243007 0.00244269 0.00245741 0.00247319 0.00248462 0.00248966 0.00250041 0.00248761 0.0024507 0.00247647 0.00248468 0.00248986 0.00251073 0.00248942 0.00252856 0.00243912 0.00347979 0.00371987 0.00282787 0.00263354 0.002554 0.0025441 0.00254804 0.00256018 0.00257498 0.00259346 0.00261383 0.00263881 0.00267376 0.00270535 0.00272763 0.00274794 0.00233757 0.00233933 0.00234138 0.00234363 0.00234617 0.00234903 0.00235223 0.00235575 0.00235952 0.00236339 0.0023673 0.0023715 0.00237643 0.0023824 0.00238948 0.00239756 0.00240681 0.00241746 0.00242973 0.00244402 0.00246111 0.0024835 0.00249801 0.00250784 0.00248781 0.00251992 0.00346423 0.00247992 0.00248166 0.00247924 0.00249065 0.00248836 0.00246475 0.00251523 0.0025789 0.00258557 0.00253267 0.00247527 0.00249208 0.00251511 0.00253953 0.0025533 0.0025606 0.00257344 0.00259391 0.0026212 0.00267161 0.00271274 0.00273296 0.00275072 0.00233005 0.0023318 0.00233386 0.00233614 0.00233873 0.00234166 0.00234495 0.00234856 0.0023524 0.00235628 0.00236026 0.00236474 0.00237016 0.00237682 0.00238473 0.00239378 0.00240462 0.00241845 0.00243444 0.00245122 0.00247505 0.00251331 0.00254433 0.00252459 0.00251793 0.00251183 0.00262444 0.00252148 0.00247656 0.00246756 0.00246884 0.00248126 0.00250223 0.0025223 0.00257316 0.00257437 0.00254653 0.00252923 0.00252664 0.00253872 0.00254678 0.00254473 0.00253337 0.00255703 0.00256755 0.00259421 0.00266998 0.00272886 0.0027408 0.00275049 0.00232236 0.00232404 0.00232605 0.00232833 0.00233095 0.00233395 0.00233732 0.00234104 0.00234497 0.00234896 0.00235316 0.00235804 0.00236401 0.00237128 0.00237988 0.00238956 0.00240134 0.0024188 0.00244084 0.0024611 0.0024974 0.00253935 0.00260269 0.00281887 0.00258447 0.00253633 0.00255376 0.00250743 0.00246102 0.00244815 0.00245334 0.00245835 0.00247613 0.00250209 0.00252159 0.00253322 0.00252777 0.00251914 0.00251666 0.00252058 0.00252958 0.00255474 0.00310783 0.0025444 0.00251387 0.00253295 0.00269424 0.00278543 0.00275627 0.0027524 0.00231446 0.00231601 0.00231793 0.00232017 0.0023228 0.00232585 0.00232931 0.00233315 0.00233723 0.00234142 0.00234596 0.00235128 0.00235776 0.00236551 0.00237464 0.00238429 0.00239626 0.00241637 0.00244779 0.00244479 0.00240384 0.00339309 0.00267245 0.00268083 0.00271308 0.00258921 0.00251834 0.00256478 0.00238203 0.00241972 0.0024325 0.00244006 0.00245244 0.00246472 0.00248764 0.00250233 0.00251651 0.00252062 0.00252445 0.00253488 0.0025381 0.00255597 0.00259742 0.00254439 0.00247366 0.00248285 0.00306286 0.00315219 0.00294623 0.00285072 0.00230629 0.00230766 0.00230945 0.00231162 0.00231424 0.00231733 0.00232088 0.00232486 0.00232913 0.00233361 0.00233852 0.0023443 0.00235124 0.00235947 0.00236909 0.00237898 0.00239263 0.00241747 0.00243661 0.00247632 0.00269903 0.00256995 0.00269248 0.00310159 0.00732478 0.00868101 0.00478138 0.00223796 0.0023641 0.0024104 0.0024154 0.00241754 0.00243175 0.00245076 0.00247453 0.00250191 0.00252714 0.00254444 0.0025532 0.00255202 0.00256367 0.00256297 0.0025737 0.00258756 0.00255454 0.003293 0.00853158 0.00809908 0.00365705 0.00280102 0.00229778 0.00229893 0.00230054 0.00230263 0.00230522 0.00230833 0.00231197 0.0023161 0.00232059 0.0023254 0.00233071 0.00233692 0.0023443 0.00235303 0.00236304 0.00237366 0.00239203 0.00240657 0.00243173 0.00315411 0.00251649 0.00265022 0.00262398 0.0090397 0.0107457 0.0112346 0.0108232 0.00397916 0.00245424 0.00250867 0.00299747 0.00238124 0.00242018 0.00244567 0.00246236 0.0024895 0.00251304 0.00253166 0.00255483 0.00260173 0.00262102 0.00260148 0.00258914 0.00265406 0.00283462 0.00584963 0.00839206 0.00834286 0.00828887 0.00323533 0.00228884 0.00228974 0.00229116 0.00229313 0.00229568 0.00229881 0.00230252 0.00230679 0.00231153 0.00231667 0.00232238 0.00232899 0.00233681 0.00234599 0.00235661 0.00237067 0.00238495 0.00240693 0.00258048 0.00243465 0.00247539 0.00254414 0.00248523 0.0114421 0.0110127 0.0111941 0.0113701 0.0046632 0.00242032 0.00239833 0.00236249 0.00239514 0.00242102 0.00244281 0.00246384 0.00248729 0.00251774 0.00255062 0.00256936 0.00278929 0.00313278 0.00267811 0.00259125 0.00262183 0.00265825 0.00292249 0.00804871 0.00811058 0.00350751 0.00276098 0.00227937 0.00228002 0.00228123 0.00228307 0.00228556 0.00228869 0.00229246 0.00229686 0.00230183 0.0023073 0.00231338 0.00232037 0.00232854 0.00233809 0.00235051 0.00236352 0.00238169 0.0024465 0.00240827 0.00242778 0.00248358 0.00252078 0.00250157 0.00828436 0.010612 0.0112876 0.0107954 0.00379802 0.00236575 0.00241214 0.00242975 0.00243473 0.00242336 0.00243775 0.00245656 0.00247954 0.00250292 0.00252714 0.00254943 0.00254937 0.00251727 0.00256248 0.00257565 0.00260462 0.00259305 0.00266964 0.00296814 0.00303138 0.00292869 0.00275583 0.00226929 0.00226968 0.00227067 0.00227239 0.0022748 0.00227792 0.00228173 0.00228623 0.0022914 0.00229717 0.00230359 0.00231088 0.00231931 0.0023296 0.00234169 0.00235554 0.00238845 0.00238517 0.00240475 0.00245664 0.00249028 0.00253519 0.00261503 0.00305389 0.00686797 0.008471 0.00412808 0.00213189 0.0022978 0.0023664 0.00241075 0.00245546 0.0024673 0.00268795 0.00244808 0.00247334 0.00249429 0.00251965 0.00254087 0.00254515 0.0025485 0.00256831 0.00258391 0.00257116 0.00265149 0.00269306 0.00277946 0.00280193 0.00273825 0.00274143 0.0022585 0.00225864 0.00225944 0.00226102 0.00226336 0.00226644 0.00227027 0.00227485 0.00228017 0.00228617 0.00229288 0.00230042 0.00230909 0.0023193 0.00233111 0.00234621 0.00235988 0.00237742 0.0023988 0.00242565 0.00302848 0.00253296 0.00258364 0.00265753 0.00263387 0.00250511 0.00246855 0.00235044 0.00233955 0.0023798 0.0024135 0.00288367 0.00243895 0.00247525 0.00245569 0.00247656 0.00249013 0.00251016 0.00270871 0.00255266 0.00255087 0.0025451 0.00253862 0.00248618 0.00265387 0.0027547 0.00278641 0.00279467 0.0027867 0.00277037 0.00224693 0.00224685 0.00224746 0.00224891 0.00225118 0.00225422 0.00225805 0.00226267 0.00226808 0.00227425 0.00228118 0.00228891 0.00229767 0.00230772 0.00231935 0.00233294 0.00234948 0.00236668 0.00238545 0.0024428 0.00244511 0.00248413 0.00253286 0.00259477 0.00254708 0.0025185 0.00244169 0.00239366 0.00237798 0.00239173 0.00241755 0.00238229 0.00278933 0.0024793 0.00247553 0.00248519 0.00251041 0.00260287 0.00257733 0.00255572 0.00257296 0.00255673 0.00263378 0.00230718 0.00276362 0.00287011 0.00276463 0.00277011 0.00273808 0.00274694 0.00223451 0.00223425 0.00223469 0.00223604 0.00223822 0.00224123 0.00224504 0.00224966 0.00225512 0.00226139 0.00226846 0.00227633 0.00228512 0.002295 0.00230622 0.00231956 0.00233503 0.00235076 0.00237043 0.00240161 0.00240786 0.00243486 0.00245705 0.00272869 0.00247266 0.00262763 0.00241906 0.00240937 0.0024199 0.00238979 0.00240268 0.00240255 0.00242101 0.00245726 0.00247625 0.00249162 0.00250872 0.00252165 0.00255489 0.00259934 0.0026704 0.00310628 0.00885041 0.0169562 0.00973559 0.00370603 0.0026766 0.00269986 0.00271579 0.00271914 0.0022212 0.00222079 0.0022211 0.00222235 0.00222447 0.00222742 0.00223121 0.00223582 0.00224128 0.00224758 0.00225472 0.00226268 0.00227149 0.00228123 0.0022921 0.00230439 0.00231883 0.00233509 0.00235932 0.00237173 0.00238953 0.00239743 0.00251205 0.00239868 0.00239308 0.00239033 0.00239719 0.00239573 0.0023736 0.00238702 0.00239919 0.00240923 0.00242657 0.00244986 0.00247004 0.00248848 0.00250727 0.00252701 0.00254827 0.00256862 0.00259462 0.010995 0.0178158 0.0188822 0.0177836 0.0122885 0.00286543 0.00269064 0.0026848 0.00271049 0.00220696 0.00220644 0.00220666 0.00220784 0.0022099 0.00221281 0.00221656 0.00222114 0.00222657 0.00223286 0.00223999 0.00224797 0.00225678 0.00226643 0.00227697 0.00228858 0.00230176 0.00231656 0.00233277 0.00235365 0.00235333 0.00236458 0.00236906 0.00236934 0.00238412 0.00238819 0.00238366 0.00237498 0.00237599 0.00238497 0.00239628 0.00240898 0.00242655 0.00244635 0.00246698 0.00248724 0.00250652 0.0025238 0.002535 0.0025158 0.00225965 0.0128977 0.0189827 0.0188849 0.0188952 0.0152999 0.00237558 0.00255436 0.00262101 0.00264754 0.00219177 0.0021912 0.00219136 0.00219249 0.00219451 0.00219738 0.00220109 0.00220564 0.00221103 0.00221726 0.00222434 0.00223227 0.00224102 0.00225057 0.00226089 0.00227204 0.00228427 0.00229764 0.00231044 0.00232116 0.00233099 0.00234134 0.00234727 0.00235395 0.00236229 0.00235788 0.00235487 0.00236271 0.0023712 0.00238097 0.00239272 0.00240653 0.00242349 0.00244344 0.00246527 0.00248928 0.00251716 0.00255337 0.00260281 0.00268458 0.00294403 0.0139571 0.0181499 0.0186515 0.0185324 0.0162853 0.00315216 0.00262329 0.00265303 0.00278038 0.00217565 0.00217506 0.0021752 0.0021763 0.00217829 0.00218113 0.0021848 0.00218931 0.00219466 0.00220083 0.00220783 0.00221565 0.00222429 0.00223371 0.00224386 0.00225469 0.00226622 0.00227818 0.00228987 0.00230112 0.00231092 0.00232036 0.00232665 0.00233267 0.00233903 0.00234314 0.00234851 0.00235427 0.00236287 0.00237395 0.00238667 0.0024012 0.00241818 0.00243782 0.00246004 0.00248504 0.00251327 0.0025534 0.00261796 0.00270766 0.00287329 0.00407929 0.0154328 0.0190908 0.0174031 0.0054844 0.00231611 0.00252522 0.00260469 0.00261941 0.0021586 0.00215802 0.00215817 0.00215927 0.00216125 0.00216407 0.00216772 0.00217219 0.00217748 0.00218359 0.0021905 0.0021982 0.00220669 0.00221592 0.00222586 0.00223642 0.00224749 0.00225888 0.00227024 0.00228087 0.00229075 0.00229986 0.00230776 0.00231497 0.00232325 0.00233084 0.002337 0.00234419 0.00235351 0.00236495 0.00237814 0.00239305 0.0024099 0.00242892 0.00245054 0.00247409 0.00250111 0.00254253 0.00283414 0.0026257 0.0026483 0.00255048 0.00278498 0.0022937 0.00290841 0.00256105 0.0024811 0.00253417 0.00266876 0.00262598 0.00214064 0.00214012 0.0021403 0.00214142 0.0021434 0.00214622 0.00214985 0.0021543 0.00215954 0.00216558 0.0021724 0.00217998 0.00218829 0.0021973 0.00220694 0.00221715 0.0022278 0.00223872 0.00224962 0.00226024 0.00227055 0.00228023 0.00228927 0.0022982 0.00230691 0.00231529 0.00232378 0.00233282 0.00234307 0.00235485 0.00236813 0.00238306 0.00239946 0.00241728 0.00243776 0.00246093 0.00249195 0.00253137 0.00253341 0.00256617 0.00257274 0.00254825 0.00254857 0.0024822 0.00261097 0.00262374 0.00258165 0.00256823 0.00259971 0.0026257 0.00212181 0.00212136 0.00212161 0.00212276 0.00212477 0.00212759 0.00213122 0.00213564 0.00214085 0.00214683 0.00215357 0.00216103 0.00216917 0.00217794 0.00218728 0.0021971 0.0022073 0.00221772 0.00222818 0.00223853 0.00224863 0.00225839 0.00226775 0.00227712 0.00228666 0.00229666 0.0023073 0.00231881 0.00233135 0.0023449 0.00235903 0.00237359 0.00238868 0.00240504 0.00242347 0.00244521 0.00246781 0.00248735 0.00250659 0.00252565 0.0025327 0.00253619 0.00253403 0.00250175 0.00254907 0.00258026 0.0025831 0.0025767 0.00259572 0.00262006 0.00210215 0.00210179 0.00210211 0.00210331 0.00210535 0.0021082 0.00211183 0.00211625 0.00212144 0.00212738 0.00213404 0.00214139 0.00214938 0.00215794 0.00216701 0.00217653 0.0021864 0.00219649 0.00220667 0.00221678 0.00222672 0.00223644 0.00224599 0.00225547 0.00226522 0.00227534 0.00228606 0.00229788 0.00231145 0.00232694 0.00234346 0.00236084 0.00237766 0.00239406 0.00241092 0.00242866 0.00244708 0.00246523 0.00248344 0.00249978 0.0025117 0.00251826 0.00252496 0.00252108 0.00254364 0.00277575 0.00260309 0.00258055 0.00259706 0.00262017 0.00208168 0.00208142 0.00208183 0.0020831 0.00208518 0.00208806 0.00209171 0.00209614 0.00210132 0.00210723 0.00211385 0.0021211 0.00212895 0.00213733 0.00214621 0.00215552 0.0021652 0.00217512 0.00218516 0.00219518 0.0022051 0.00221485 0.00222446 0.00223407 0.00224388 0.00225415 0.00226514 0.00227736 0.00229158 0.00230793 0.00232419 0.00234109 0.00235727 0.00237426 0.00239298 0.00241245 0.00243067 0.00244736 0.00246296 0.00247821 0.00249081 0.00250067 0.00250989 0.00251464 0.00253063 0.00253819 0.00255188 0.00258294 0.00260326 0.00262389 0.00206044 0.00206029 0.00206079 0.00206213 0.00206427 0.00206719 0.00207087 0.00207532 0.00208051 0.00208642 0.00209299 0.00210016 0.00210789 0.00211614 0.0021249 0.00213412 0.00214373 0.00215359 0.0021636 0.00217362 0.00218355 0.00219331 0.00220291 0.00221245 0.00222216 0.00223234 0.00224329 0.00225576 0.00227119 0.00229021 0.00230728 0.0023255 0.00233935 0.00235252 0.00236769 0.00238571 0.00240611 0.00242717 0.002446 0.00246152 0.00247445 0.00248587 0.00249704 0.00250694 0.0025211 0.00253325 0.00255024 0.00257238 0.00259244 0.00261085 0.00203846 0.00203842 0.00203901 0.00204043 0.00204263 0.0020456 0.00204933 0.00205381 0.00205902 0.00206493 0.00207147 0.00207857 0.00208621 0.00209441 0.00210314 0.00211237 0.002122 0.00213192 0.00214198 0.00215205 0.00216199 0.0021717 0.00218115 0.0021904 0.0021997 0.00220934 0.00221958 0.00223189 0.00224952 0.00227399 0.00229098 0.00231315 0.00232336 0.00233175 0.00234438 0.00236086 0.00237949 0.00239891 0.00241952 0.00244044 0.00245908 0.00247324 0.00248512 0.00249656 0.0025108 0.00252693 0.00254468 0.00256463 0.00258293 0.0026048 0.00201578 0.00201583 0.00201651 0.002018 0.00202027 0.00202329 0.00202708 0.00203161 0.00203686 0.00204278 0.00204929 0.00205634 0.00206396 0.00207217 0.00208097 0.0020903 0.00210006 0.00211011 0.0021203 0.00213046 0.00214043 0.00215005 0.0021592 0.00216789 0.00217629 0.00218461 0.00219299 0.00220406 0.00222547 0.00226329 0.00227716 0.00230757 0.0023109 0.00230949 0.00231852 0.0023349 0.00235421 0.00237444 0.00239477 0.00241455 0.00243407 0.00245395 0.00247211 0.00248661 0.00250069 0.00251639 0.00253458 0.00255407 0.0025712 0.00259049 0.0019924 0.00199254 0.0019933 0.00199486 0.00199719 0.00200029 0.00200413 0.00200872 0.00201401 0.00201995 0.00202644 0.00203348 0.00204114 0.00204945 0.00205841 0.00206793 0.0020779 0.00208817 0.00209857 0.00210891 0.00211896 0.00212848 0.00213725 0.0021451 0.00215197 0.00215766 0.00216218 0.00217022 0.00219417 0.00226854 0.00227219 0.00231941 0.00229983 0.00227797 0.00228533 0.00230548 0.0023279 0.00235019 0.00237179 0.00239245 0.00241226 0.00243142 0.00245058 0.00247051 0.00248961 0.00250754 0.00252666 0.0025471 0.00255926 0.00258452 0.00196835 0.00196855 0.00196939 0.00197102 0.00197341 0.00197657 0.00198048 0.00198514 0.00199048 0.00199643 0.00200292 0.00201002 0.00201779 0.00202628 0.00203545 0.00204524 0.00205552 0.00206611 0.00207684 0.00208747 0.00209774 0.00210729 0.00211575 0.00212264 0.00212748 0.00212924 0.00212625 0.00212332 0.0021955 0.00225668 0.00229947 0.00236954 0.00229223 0.00223199 0.00223952 0.00227049 0.00229992 0.00232602 0.00234975 0.00237164 0.00239218 0.00241182 0.00243096 0.00245012 0.00247012 0.00249102 0.00251076 0.0025289 0.0025492 0.00257596 0.00194362 0.00194389 0.00194478 0.00194647 0.00194893 0.00195215 0.00195613 0.00196085 0.00196625 0.00197221 0.00197874 0.00198594 0.0019939 0.00200262 0.00201208 0.0020222 0.00203286 0.00204389 0.00205509 0.00206621 0.00207694 0.00208687 0.0020954 0.00210172 0.00210462 0.00210164 0.0020873 0.00205608 0.00204906 0.0045366 0.00765329 0.00646257 0.00264861 0.00210149 0.00217865 0.00223338 0.00227121 0.00230262 0.00232899 0.00235207 0.00237324 0.00239324 0.00241247 0.00243139 0.00245055 0.0024706 0.00249219 0.00251356 0.00253014 0.00254622 0.00191823 0.00191853 0.00191948 0.00192121 0.00192373 0.00192702 0.00193107 0.00193586 0.00194129 0.00194729 0.0019539 0.00196126 0.00196944 0.00197844 0.00198822 0.00199872 0.00200983 0.00202138 0.0020332 0.00204505 0.00205663 0.00206753 0.00207712 0.00208436 0.00208754 0.00208483 0.00207013 0.00199056 0.00426695 0.0123641 0.0133847 0.0126138 0.00795878 0.00209007 0.00214564 0.00220703 0.00225012 0.00228336 0.00231078 0.00233411 0.00235531 0.00237533 0.00239442 0.00241299 0.00243159 0.00245071 0.00247087 0.00249389 0.00251679 0.00252963 0.00189215 0.00189248 0.00189347 0.00189524 0.00189781 0.00190116 0.00190528 0.00191014 0.00191561 0.00192166 0.00192839 0.00193595 0.00194438 0.00195368 0.0019638 0.00197469 0.00198626 0.00199839 0.00201092 0.00202369 0.00203647 0.00204897 0.00206076 0.00207093 0.00207686 0.00207478 0.00207371 0.00212149 0.0106975 0.0133275 0.0131595 0.0131749 0.0143355 0.00220279 0.0021567 0.00219729 0.00223634 0.00226908 0.0022958 0.00231786 0.00233811 0.00235769 0.00237637 0.00239439 0.00241235 0.00243074 0.00244978 0.00246959 0.00249274 0.00251044 0.00186539 0.00186574 0.00186674 0.00186856 0.00187117 0.00187458 0.00187876 0.00188367 0.00188919 0.00189531 0.00190219 0.00190997 0.00191867 0.00192826 0.00193871 0.00194997 0.00196197 0.00197464 0.00198788 0.00200161 0.00201576 0.00203033 0.00204536 0.00206115 0.00207571 0.00209598 0.00212395 0.00212293 0.00394169 0.0114193 0.0131832 0.0122239 0.00740057 0.00224183 0.00220327 0.00222277 0.00224156 0.0022655 0.00228676 0.00230401 0.00232126 0.00233979 0.00235782 0.00237522 0.00239243 0.0024101 0.0024287 0.00244844 0.00246931 0.00249316 0.00183793 0.00183827 0.00183929 0.00184113 0.00184379 0.00184725 0.00185149 0.00185645 0.00186201 0.00186823 0.00187528 0.00188329 0.00189225 0.00190211 0.00191284 0.00192441 0.00193677 0.00194988 0.0019637 0.00197822 0.00199354 0.0020099 0.00202757 0.00204607 0.00207801 0.00209408 0.00212712 0.00219283 0.00239972 0.00421725 0.0103516 0.00711192 0.00286347 0.00228039 0.00222611 0.00223115 0.00224125 0.00226371 0.00228876 0.00229378 0.00230425 0.00232063 0.0023385 0.00235577 0.00237223 0.00238889 0.00240714 0.00242823 0.00245282 0.00248032 0.00180974 0.00181007 0.0018111 0.00181296 0.00181566 0.00181917 0.00182346 0.00182846 0.00183408 0.00184041 0.00184764 0.00185586 0.00186504 0.00187513 0.0018861 0.0018979 0.00191052 0.00192395 0.00193817 0.00195325 0.00196935 0.00198676 0.00200592 0.00202738 0.00205009 0.00209662 0.00211782 0.00217442 0.00225623 0.00229419 0.00219345 0.00220399 0.00237322 0.00228511 0.0022361 0.00223045 0.00223311 0.00225647 0.00229853 0.0022774 0.00228353 0.00230038 0.00232215 0.0023398 0.0023538 0.00236802 0.00238427 0.00240529 0.00243389 0.0024694 0.00276504 0.0027801 0.00279509 0.00281002 0.0028249 0.00283974 0.00285455 0.00286932 0.00288403 0.00289866 0.00291314 0.00292741 0.00294138 0.00295497 0.00296811 0.00298078 0.00299298 0.00300479 0.00301632 0.00302766 0.00303889 0.00305006 0.00306118 0.00307229 0.00308345 0.00309466 0.00310586 0.00311697 0.00312788 0.00313849 0.00314873 0.00315858 0.00316803 0.00317709 0.00318579 0.00319414 0.00320217 0.00320987 0.00321725 0.00322428 0.00323093 0.00323713 0.0032428 0.00324786 0.00325219 0.00325566 0.00325815 0.00325958 0.00325992 0.00325952 0.00276445 0.00277945 0.00279441 0.00280931 0.00282416 0.00283894 0.00285367 0.00286832 0.00288288 0.00289731 0.00291158 0.00292561 0.00293936 0.00295277 0.00296578 0.0029784 0.00299064 0.00300257 0.00301429 0.00302589 0.00303743 0.00304893 0.0030604 0.00307187 0.00308335 0.00309486 0.00310633 0.00311767 0.00312879 0.0031396 0.00315003 0.00316006 0.00316966 0.00317884 0.00318761 0.00319599 0.00320399 0.0032116 0.00321883 0.00322567 0.00323206 0.00323798 0.00324336 0.00324811 0.00325216 0.00325541 0.00325776 0.00325914 0.0032595 0.00325909 0.00276384 0.0027788 0.00279373 0.00280861 0.00282343 0.00283816 0.00285281 0.00286736 0.00288178 0.00289605 0.00291012 0.00292396 0.00293752 0.00295075 0.00296363 0.00297617 0.0029884 0.00300039 0.00301224 0.00302406 0.00303591 0.00304775 0.00305958 0.00307139 0.00308324 0.0030951 0.00310691 0.00311857 0.00312998 0.00314105 0.00315172 0.00316194 0.00317171 0.003181 0.00318985 0.00319824 0.0032062 0.00321373 0.00322083 0.00322748 0.00323366 0.00323933 0.00324445 0.00324895 0.00325278 0.00325585 0.0032581 0.00325945 0.00325982 0.0032594 0.00276326 0.00277821 0.00279314 0.00280801 0.0028228 0.0028375 0.00285209 0.00286655 0.00288088 0.00289502 0.00290897 0.00292266 0.00293608 0.00294917 0.00296192 0.00297434 0.00298649 0.00299844 0.00301033 0.0030223 0.00303443 0.00304661 0.00305877 0.0030709 0.0030831 0.00309536 0.0031076 0.00311967 0.00313145 0.00314284 0.00315377 0.0031642 0.00317412 0.00318353 0.00319243 0.00320083 0.00320876 0.00321621 0.00322319 0.0032297 0.00323571 0.0032412 0.00324614 0.00325048 0.00325417 0.00325715 0.00325936 0.00326073 0.00326115 0.0032608 0.00276267 0.00277766 0.0027926 0.00280748 0.00282226 0.00283693 0.00285148 0.00286589 0.00288014 0.00289421 0.00290806 0.00292166 0.00293496 0.00294793 0.00296054 0.0029728 0.00298476 0.00299655 0.00300836 0.00302042 0.00303289 0.00304544 0.00305795 0.00307033 0.0030829 0.00309565 0.00310841 0.003121 0.00313325 0.00314502 0.00315626 0.00316692 0.003177 0.0031865 0.00319545 0.00320386 0.00321174 0.00321912 0.003226 0.00323238 0.00323826 0.00324361 0.00324841 0.00325264 0.00325626 0.00325921 0.00326145 0.0032629 0.00326346 0.0032633 0.00276207 0.00277712 0.00279212 0.00280702 0.00282181 0.00283648 0.002851 0.00286537 0.00287957 0.00289359 0.00290739 0.00292092 0.00293415 0.002947 0.00295946 0.00297149 0.00298315 0.0029946 0.00300613 0.00301821 0.00303116 0.00304419 0.00305706 0.00306955 0.00308248 0.00309585 0.00310933 0.00312261 0.00313544 0.00314769 0.00315927 0.00317018 0.00318041 0.00319001 0.00319898 0.00320737 0.0032152 0.0032225 0.00322928 0.00323555 0.0032413 0.00324654 0.00325125 0.00325541 0.003259 0.00326197 0.00326428 0.00326588 0.00326669 0.00326681 0.00276148 0.00277663 0.00279171 0.00280666 0.00282147 0.00283614 0.00285065 0.002865 0.00287918 0.00289318 0.00290696 0.00292048 0.00293366 0.00294643 0.0029587 0.00297042 0.00298158 0.00299236 0.00300322 0.00301512 0.00302894 0.00304269 0.00305595 0.00306813 0.00308142 0.00309567 0.00311019 0.00312443 0.00313805 0.00315088 0.00316288 0.00317405 0.00318443 0.00319409 0.00320307 0.00321141 0.00321917 0.00322637 0.00323304 0.00323919 0.00324484 0.00324999 0.00325463 0.00325875 0.00326234 0.00326537 0.00326781 0.00326961 0.00327072 0.00327122 0.00276091 0.00277621 0.00279139 0.00280642 0.00282127 0.00283594 0.00285044 0.00286478 0.00287896 0.00289296 0.00290676 0.00292029 0.00293346 0.00294615 0.00295819 0.00296946 0.00297984 0.00298941 0.00299885 0.00301018 0.00302595 0.00304098 0.00305479 0.0030656 0.00307917 0.00309478 0.00311085 0.00312643 0.00314106 0.00315461 0.00316709 0.00317856 0.0031891 0.0031988 0.00320774 0.00321601 0.00322366 0.00323074 0.00323729 0.00324332 0.00324885 0.00325391 0.0032585 0.0032626 0.00326623 0.00326935 0.00327195 0.003274 0.00327548 0.0032764 0.00276041 0.0027759 0.00279122 0.00280633 0.00282122 0.0028359 0.00285038 0.0028647 0.00287885 0.00289284 0.00290663 0.00292018 0.00293335 0.00294597 0.00295781 0.00296858 0.00297792 0.00298559 0.0029924 0.00300235 0.00302271 0.00304002 0.00305503 0.00306177 0.00307565 0.00309348 0.00311184 0.00312913 0.00314487 0.00315909 0.00317199 0.00318373 0.00319441 0.00320415 0.00321303 0.00322118 0.00322868 0.00323561 0.003242 0.00324789 0.00325332 0.00325829 0.00326282 0.00326692 0.0032706 0.00327384 0.00327663 0.00327895 0.00328083 0.00328222 0.00276002 0.00277575 0.00279123 0.00280642 0.00282134 0.00283599 0.00285041 0.00286462 0.00287867 0.00289258 0.00290635 0.00291995 0.00293328 0.00294609 0.00295803 0.00296854 0.00297664 0.00298118 0.00298304 0.00299001 0.00302089 0.00304163 0.00305923 0.00305579 0.00307012 0.00309188 0.00311395 0.00313351 0.0031503 0.00316489 0.00317787 0.00318964 0.00320036 0.00321009 0.00321891 0.00322692 0.00323424 0.00324097 0.00324717 0.0032529 0.00325819 0.00326306 0.00326754 0.00327165 0.00327538 0.00327875 0.00328175 0.00328438 0.00328668 0.00328856 0.00275983 0.00277583 0.00279148 0.00280674 0.00282164 0.00283618 0.00285042 0.00286444 0.00287831 0.00289214 0.00290599 0.00291989 0.00293376 0.00294731 0.00296003 0.002971 0.0029778 0.00297613 0.0029659 0.00296707 0.00302501 0.0030536 0.00307389 0.00304338 0.00305586 0.00308801 0.00311794 0.00314067 0.00315819 0.0031726 0.00318516 0.00319657 0.00320704 0.00321661 0.00322531 0.00323317 0.00324029 0.00324679 0.00325277 0.00325831 0.00326344 0.0032682 0.00327262 0.00327672 0.00328052 0.00328402 0.00328723 0.00329017 0.00329291 0.00329528 0.00275991 0.00277622 0.00279203 0.00280732 0.00282211 0.00283646 0.00285045 0.00286424 0.00287797 0.00289183 0.00290596 0.00292048 0.00293544 0.00295063 0.00296556 0.00297931 0.00298809 0.0029792 0.00293496 0.00290388 0.00304327 0.00309396 0.00312331 0.00301067 0.00303028 0.00309052 0.00312905 0.00315278 0.00316954 0.00318276 0.00319414 0.00320474 0.00321464 0.00322379 0.00323221 0.00323987 0.00324678 0.00325304 0.00325876 0.00326406 0.003269 0.00327363 0.00327797 0.00328206 0.00328591 0.00328955 0.00329297 0.00329622 0.0032994 0.00330228 0.00276038 0.00277702 0.00279298 0.00280824 0.00282286 0.00283696 0.00285071 0.0028643 0.00287796 0.00289191 0.00290641 0.00292179 0.00293836 0.00295618 0.00297512 0.00299527 0.00301426 0.00301901 0.00299566 0.00275628 0.00363619 0.00346286 0.00360233 0.0030517 0.00307418 0.00312206 0.00315301 0.00317088 0.00318483 0.00319557 0.00320472 0.00321416 0.00322329 0.00323178 0.00323967 0.00324697 0.00325363 0.00325963 0.00326509 0.00327012 0.00327484 0.0032793 0.00328355 0.0032876 0.0032915 0.00329525 0.00329888 0.00330244 0.00330605 0.00330943 0.00276135 0.00277837 0.00279445 0.00280964 0.00282405 0.00283791 0.00285143 0.00286484 0.00287839 0.00289235 0.00290706 0.00292307 0.00294124 0.00296224 0.00298674 0.0030194 0.00306343 0.00312156 0.00321422 0.0044828 0.0144868 0.0154461 0.0145813 0.0045677 0.00325402 0.00320437 0.00319589 0.00319803 0.00320429 0.00321025 0.00321761 0.00322535 0.00323327 0.00324075 0.00324781 0.0032545 0.00326076 0.00326649 0.00327167 0.00327642 0.00328088 0.00328515 0.00328927 0.00329327 0.00329719 0.00330105 0.00330487 0.00330873 0.00331276 0.00331663 0.00276283 0.0027804 0.00279663 0.0028117 0.0028259 0.0028395 0.00285277 0.00286592 0.00287916 0.00289281 0.00290717 0.00292304 0.0029415 0.00296326 0.00299026 0.00302948 0.00308311 0.00318256 0.00330503 0.0108156 0.0155328 0.0154834 0.0155311 0.0106074 0.00337349 0.00323815 0.00321839 0.00321943 0.00322227 0.00322463 0.00322694 0.00323569 0.00324349 0.00325037 0.00325657 0.00326248 0.00326817 0.00327351 0.0032784 0.00328286 0.00328705 0.00329109 0.00329506 0.00329899 0.00330291 0.00330686 0.00331085 0.00331498 0.00331942 0.00332376 0.00276463 0.00278316 0.00279972 0.00281463 0.00282856 0.00284185 0.00285477 0.00286747 0.00288009 0.00289291 0.00290598 0.00292029 0.00293758 0.00295809 0.00298497 0.00301518 0.0032383 0.00325061 0.00334064 0.0106015 0.0152112 0.0153797 0.0152814 0.0106728 0.0033475 0.00325956 0.00323964 0.00323502 0.00323728 0.00323811 0.00323729 0.00324608 0.00325427 0.00326046 0.00326573 0.00327083 0.00327581 0.00328063 0.00328518 0.00328936 0.00329326 0.00329705 0.00330083 0.00330465 0.00330856 0.00331257 0.00331671 0.00332109 0.00332591 0.00333071 0.00276657 0.00278636 0.00280392 0.00281868 0.00283223 0.00284509 0.00285748 0.00286946 0.00288117 0.00289317 0.00290505 0.00291524 0.00293039 0.00295013 0.00297184 0.00361159 0.00309878 0.00316574 0.00329428 0.0041724 0.0128106 0.0156008 0.0129004 0.00435517 0.00327048 0.00326714 0.00326695 0.00324412 0.00324435 0.00326049 0.0036841 0.00326797 0.00326939 0.00327272 0.00327627 0.00328 0.00328389 0.00328792 0.00329194 0.00329579 0.00329941 0.00330292 0.00330649 0.00331019 0.00331405 0.00331809 0.00332235 0.00332695 0.00333212 0.00333735 0.00276873 0.00278958 0.00280898 0.00282425 0.00283719 0.00284941 0.00286117 0.00287227 0.00288286 0.00289662 0.00290079 0.00290536 0.00291607 0.00293814 0.00297111 0.00302199 0.00305046 0.00310314 0.00315983 0.00306246 0.00357713 0.00346973 0.00362748 0.0031935 0.00322143 0.00324444 0.003317 0.00374222 0.00324059 0.00326391 0.00327902 0.00327858 0.00327979 0.00328307 0.00328654 0.00328924 0.00329209 0.00329524 0.00329861 0.00330204 0.00330536 0.00330862 0.00331196 0.0033155 0.00331928 0.00332333 0.00332768 0.00333247 0.00333794 0.00334355 0.00277113 0.0027927 0.00281396 0.0028315 0.00284369 0.00285516 0.00286648 0.00287717 0.00288536 0.00289642 0.0028998 0.00289611 0.00288947 0.00291407 0.00294204 0.00298533 0.00300592 0.00304625 0.00310776 0.00319328 0.0031388 0.00390931 0.00333906 0.00332205 0.00325342 0.00325824 0.00328 0.00328306 0.00328271 0.00327652 0.00329231 0.00330944 0.00328778 0.00329358 0.00329683 0.00329843 0.00330032 0.00330252 0.00330512 0.00330801 0.00331101 0.00331401 0.00331712 0.00332049 0.00332417 0.0033282 0.00333261 0.00333753 0.00334325 0.00334918 0.00277154 0.0027955 0.00281824 0.00283919 0.00285322 0.00286317 0.00287386 0.00288759 0.00288844 0.00288768 0.00323609 0.00288237 0.00284871 0.00288261 0.00291429 0.00296251 0.0029672 0.00301805 0.0030792 0.00327708 0.00306095 0.00299589 0.0030764 0.0033226 0.00325498 0.00326721 0.00327628 0.00329431 0.00329895 0.00384433 0.00329072 0.00330245 0.00330134 0.00330572 0.0033078 0.00330837 0.00330885 0.00330983 0.00331144 0.00331364 0.00331623 0.00331898 0.00332187 0.00332507 0.00332864 0.00333262 0.00333703 0.00334204 0.00334794 0.0033541 0.00277555 0.00280221 0.00282458 0.00284561 0.00286433 0.00287525 0.00288426 0.00289572 0.00290528 0.00289752 0.00287729 0.00283392 0.00275375 0.00283762 0.0029522 0.00298993 0.0029445 0.0030117 0.00306976 0.00308088 0.003092 0.00308627 0.00312381 0.00316907 0.00324157 0.00328659 0.00329443 0.00329704 0.00332113 0.00334325 0.00332312 0.0033169 0.00332177 0.00332109 0.00332058 0.0033191 0.0033177 0.0033171 0.00331748 0.00331883 0.00332092 0.00332341 0.00332612 0.00332915 0.0033326 0.00333651 0.00334089 0.00334592 0.0033519 0.00335819 0.00282543 0.00282863 0.00284074 0.00285532 0.00287365 0.0028889 0.00289935 0.00290906 0.00323105 0.00294333 0.00291368 0.00282642 0.00248922 0.00476478 0.00989661 0.00482488 0.00272696 0.00302839 0.0031162 0.0031417 0.00316728 0.0031532 0.00317911 0.00321513 0.00346519 0.00331407 0.00333077 0.00385474 0.00332531 0.00338778 0.00334074 0.00333507 0.00333882 0.00333628 0.00333355 0.00333009 0.00332654 0.00332406 0.003323 0.00332338 0.00332492 0.00332716 0.00332974 0.00333266 0.00333601 0.00333983 0.00334414 0.00334911 0.00335506 0.00336133 0.00285736 0.00285815 0.00286022 0.00286795 0.00288323 0.00290256 0.00291582 0.00293498 0.00296593 0.00299689 0.00303105 0.00310461 0.0061187 0.0152635 0.0160531 0.0153605 0.00688246 0.00332631 0.00322346 0.00321928 0.00333216 0.00318851 0.00320973 0.00322738 0.00323799 0.00328923 0.00333006 0.00336311 0.00335649 0.003605 0.00332019 0.00339153 0.0033566 0.0033503 0.00334557 0.00334058 0.00333469 0.00333013 0.00332756 0.00332698 0.00332801 0.00333008 0.00333265 0.00333553 0.00333882 0.00334255 0.00334676 0.00335159 0.00335736 0.00336346 0.0029493 0.00287954 0.00287163 0.00287477 0.0028886 0.00291152 0.00293294 0.00295806 0.0029926 0.00303621 0.00309574 0.00317855 0.00656042 0.015698 0.0156923 0.0156791 0.00675693 0.00338076 0.00328568 0.00324114 0.0032213 0.00322023 0.00323195 0.00324623 0.00326605 0.00329332 0.00356174 0.00335796 0.00335874 0.00335324 0.00373238 0.00337138 0.00336993 0.00336061 0.0033574 0.00335088 0.00334131 0.00333447 0.00333051 0.00332918 0.00332994 0.00333203 0.00333474 0.00333773 0.00334102 0.0033447 0.00334877 0.00335338 0.00335883 0.00336456 0.00283037 0.00284858 0.00285325 0.00286564 0.002884 0.00291004 0.0029426 0.00297218 0.00301777 0.00307595 0.00317093 0.00336706 0.00919027 0.0150466 0.0155247 0.0153208 0.0107382 0.00350599 0.00331217 0.00325527 0.00324034 0.00324053 0.00324883 0.00326351 0.00328258 0.00330479 0.00332598 0.00335436 0.00337538 0.00339843 0.00344692 0.00347954 0.00392185 0.00337263 0.00337257 0.00336357 0.00334682 0.00333681 0.00333131 0.00332955 0.00333042 0.00333287 0.00333599 0.00333927 0.00334268 0.00334633 0.00335025 0.00335455 0.00335953 0.00336468 0.00278963 0.00281881 0.00283538 0.00285241 0.00287471 0.00290252 0.00293706 0.00297912 0.00302288 0.00307862 0.00316619 0.00322554 0.00344574 0.0108887 0.0160405 0.01212 0.00370617 0.00314617 0.00321351 0.00322942 0.00323626 0.00324446 0.00325843 0.00327488 0.00329456 0.00331672 0.00333932 0.00336255 0.00338309 0.00340152 0.00342258 0.00347147 0.00347277 0.00347129 0.00340674 0.00338379 0.00335161 0.00333591 0.0033287 0.00332738 0.00332918 0.00333252 0.00333641 0.00334022 0.00334389 0.00334757 0.00335132 0.00335526 0.00335961 0.00336399 0.00276773 0.00280301 0.00282311 0.00284153 0.00286515 0.00289369 0.0029266 0.00296626 0.00300771 0.0030378 0.00307402 0.00309418 0.00304288 0.0032755 0.00302468 0.00333359 0.00308496 0.00312109 0.00317162 0.00321548 0.00322876 0.00324399 0.00326164 0.00328143 0.00330443 0.00332741 0.00335086 0.00337376 0.00339419 0.00341189 0.00342088 0.00379758 0.0035887 0.00355493 0.00414488 0.00342396 0.00335761 0.0033293 0.0033213 0.00332246 0.00332629 0.00333113 0.00333617 0.00334078 0.00334485 0.00334861 0.0033522 0.0033557 0.0033593 0.00336273 0.00292813 0.00285344 0.00282624 0.00283284 0.00285573 0.00288401 0.00291471 0.00294867 0.00298654 0.00301571 0.00303515 0.0030439 0.00303664 0.00306524 0.00305599 0.00312572 0.00310954 0.00313269 0.00317085 0.00330874 0.0032166 0.00324784 0.00328329 0.0032836 0.00331193 0.00333681 0.00336256 0.00338766 0.00341125 0.00343315 0.00345295 0.00346758 0.00370087 0.0036736 0.0037517 0.00353054 0.00333656 0.0032997 0.00330512 0.00331409 0.00332186 0.00332903 0.0033356 0.00334122 0.00334581 0.00334971 0.00335313 0.00335616 0.00335891 0.00336125 0.00276829 0.00278989 0.00279696 0.00281524 0.00284277 0.00287124 0.00290056 0.00293151 0.00296532 0.00299918 0.00301673 0.0030261 0.0030357 0.00305445 0.00304919 0.00310709 0.00313995 0.00314309 0.003167 0.0031938 0.00321466 0.00324404 0.0032667 0.00343108 0.00331744 0.00334614 0.00337432 0.00340217 0.00342954 0.00345662 0.00348452 0.0035151 0.00357504 0.00377818 0.00405173 0.00349205 0.00317323 0.00322026 0.00327663 0.00330265 0.00331701 0.00332721 0.0033354 0.00334202 0.00334714 0.00335118 0.00335443 0.00335696 0.0033588 0.00335997 0.00273307 0.00275273 0.00277711 0.00280094 0.00282828 0.00285634 0.00288487 0.00291428 0.00294582 0.00297874 0.00300639 0.00301826 0.0030308 0.00304666 0.00305357 0.00307969 0.00340059 0.00312876 0.00315973 0.00318282 0.00320989 0.00323578 0.00326253 0.00329524 0.00332582 0.00335568 0.00338564 0.00341589 0.00344661 0.00347811 0.00369206 0.00354995 0.00352938 0.00367434 0.0153571 0.00699877 0.00274676 0.00313921 0.00326298 0.00329722 0.00331616 0.00332777 0.00333659 0.00334373 0.00334921 0.00335333 0.00335641 0.00335846 0.00335938 0.00335937 0.00271504 0.00273264 0.0027606 0.00278445 0.00281251 0.0028414 0.00287018 0.00290102 0.0029326 0.00296202 0.00299018 0.00301188 0.00302366 0.00304239 0.00305844 0.00308471 0.00309816 0.00313071 0.00315883 0.00317728 0.00320077 0.00326113 0.00325469 0.00329597 0.00333307 0.00336497 0.0033963 0.00342852 0.00346416 0.00351046 0.00357685 0.00363971 0.00407761 0.0266469 0.0321289 0.0308093 0.00806624 0.0034754 0.00339907 0.00335034 0.00333637 0.00333623 0.00334099 0.00334697 0.00335231 0.00335643 0.00335937 0.003361 0.00336108 0.00335993 0.00266476 0.00270722 0.00275179 0.00276432 0.00279552 0.00282621 0.00285456 0.00288268 0.00292037 0.00295219 0.00297618 0.00300309 0.00302209 0.00303855 0.00305953 0.00308476 0.00313685 0.00313193 0.00314781 0.00316783 0.00318517 0.00320819 0.00324413 0.00329652 0.00334147 0.00337381 0.00340385 0.00343481 0.00347024 0.00351845 0.00358681 0.00371696 0.00446209 0.0314973 0.0319913 0.0326066 0.0164271 0.00376062 0.00343247 0.00336271 0.00334381 0.0033398 0.00334347 0.00334983 0.00335584 0.00336043 0.00336351 0.00336492 0.00336433 0.00336218 0.00294703 0.00271872 0.00275429 0.00290443 0.00279395 0.00281671 0.00283948 0.00287874 0.00292322 0.00295084 0.00296547 0.00299146 0.00301981 0.00304062 0.00305788 0.00307357 0.00333 0.00312857 0.00314354 0.00315921 0.00316355 0.00317723 0.00322513 0.00330491 0.00335592 0.00338308 0.0034071 0.00343058 0.00345647 0.0034908 0.00352911 0.00357366 0.00378113 0.0165429 0.0320226 0.0264247 0.0058223 0.0033018 0.00332679 0.00331615 0.00332085 0.00333077 0.00334155 0.00335163 0.00335976 0.00336552 0.00336914 0.00337062 0.0033696 0.0033667 0.00263972 0.0026858 0.00272174 0.00275485 0.00277455 0.00280907 0.0028334 0.00298992 0.00294214 0.00296525 0.00297475 0.00298606 0.0030121 0.00304191 0.00306173 0.00307835 0.00309581 0.00312492 0.00314429 0.00314833 0.00313006 0.00310291 0.00318306 0.00335629 0.0033835 0.00339889 0.00341403 0.00342302 0.00343331 0.00343919 0.00344297 0.00338693 0.00330256 0.00303548 0.0072212 0.00471418 0.00242451 0.00305422 0.00318248 0.00325572 0.00329454 0.00332099 0.0033402 0.00335466 0.00336525 0.00337242 0.00337679 0.00337855 0.0033774 0.00337408 0.00265028 0.00268527 0.00285621 0.00277172 0.00277857 0.00280387 0.00286719 0.00300338 0.00346506 0.00346523 0.00297361 0.00298755 0.00301212 0.00303975 0.00306711 0.00308939 0.00311114 0.00313447 0.00315353 0.00315516 0.00312027 0.00292688 0.00433288 0.00565086 0.00359782 0.00342255 0.00343295 0.00346911 0.00341979 0.0034174 0.00339797 0.00336412 0.00328092 0.00328877 0.00353409 0.00320228 0.00292975 0.00306843 0.00317985 0.00325015 0.00329349 0.00332318 0.00334508 0.00336158 0.0033737 0.00338193 0.00338698 0.00338915 0.00338818 0.00338484 0.00265192 0.00267905 0.00270527 0.00274027 0.00276678 0.00279851 0.00286415 0.00287404 0.00342873 0.0034719 0.00295409 0.00298208 0.00301068 0.00303885 0.00307002 0.0031002 0.00312828 0.00315851 0.00318657 0.00321633 0.0032502 0.00351547 0.00736216 0.00731282 0.00567961 0.00355047 0.00345151 0.00342941 0.00341803 0.00340836 0.00339914 0.00338761 0.00335017 0.00333821 0.00332836 0.00325426 0.00314487 0.00315918 0.00322339 0.00326963 0.00330673 0.00333447 0.00335599 0.00337281 0.00338553 0.0033944 0.0034 0.00340267 0.00340218 0.00339927 0.00264714 0.00267247 0.00270964 0.00280184 0.00275661 0.00278445 0.00281454 0.00284146 0.00289596 0.00291839 0.00294552 0.00297698 0.00300876 0.00303741 0.00307109 0.00310951 0.00314651 0.00318391 0.00322338 0.00329912 0.00333704 0.00352932 0.00685639 0.00713945 0.00701911 0.00355376 0.00343442 0.00341774 0.00341107 0.00339962 0.0033915 0.00341654 0.00339788 0.0033904 0.00341061 0.00334055 0.00363322 0.00321207 0.00326011 0.00329833 0.00332786 0.00335211 0.00337189 0.00338801 0.00340069 0.00340987 0.00341591 0.00341916 0.00341946 0.00341743 0.00264286 0.00266813 0.00269788 0.00272275 0.00274984 0.00277134 0.00279236 0.00282118 0.00286698 0.00290648 0.00294682 0.00298196 0.00300934 0.00303289 0.00307091 0.00311707 0.00316294 0.00320405 0.00324111 0.00328483 0.00334644 0.00344628 0.00404201 0.0068204 0.00477487 0.00323488 0.00342753 0.00339003 0.0033981 0.00338887 0.00334508 0.00362257 0.00342487 0.00343788 0.00383667 0.0033694 0.00344758 0.00350348 0.00329926 0.00333312 0.00335617 0.00337518 0.00339204 0.00340667 0.00341885 0.00342811 0.00343453 0.00343847 0.00343982 0.00343906 0.00264623 0.00266691 0.00269213 0.00271965 0.00274682 0.00277895 0.00279247 0.00278675 0.00285908 0.00290762 0.00295587 0.00299483 0.00301748 0.00302595 0.0030652 0.00312269 0.00317873 0.00322323 0.00325307 0.00328413 0.0033247 0.00337279 0.00336438 0.00345485 0.00326597 0.00330681 0.00336579 0.00339268 0.00340972 0.00341453 0.00373349 0.00457289 0.00416211 0.00344641 0.00345107 0.00344466 0.00341026 0.00338827 0.00337062 0.00337663 0.00338955 0.00340248 0.00341556 0.00342816 0.00343952 0.00344875 0.00345556 0.00346028 0.0034629 0.00346371 0.00263404 0.00265454 0.00269301 0.00272479 0.00273879 0.00275395 0.00298407 0.00298126 0.00289935 0.00293431 0.0029854 0.00303373 0.00304567 0.00302925 0.00303951 0.00313177 0.00320181 0.0032445 0.00326011 0.00328111 0.0033069 0.00332795 0.00335199 0.0034233 0.00352433 0.00339778 0.00339909 0.00341404 0.00342309 0.00344369 0.00400819 0.00461655 0.00450433 0.00346442 0.00347313 0.0034849 0.00399823 0.00342419 0.00341536 0.00341541 0.00342151 0.00343018 0.00344046 0.0034514 0.00346203 0.00347126 0.00347856 0.00348416 0.00348822 0.00349079 0.0026702 0.00277923 0.00268993 0.00272291 0.00272623 0.00310719 0.00294628 0.00294595 0.00288658 0.00348626 0.00344928 0.00304823 0.00313147 0.00322592 0.00350723 0.0034992 0.00325602 0.00328833 0.0032651 0.00327537 0.00329514 0.00331008 0.00329865 0.003173 0.00327151 0.00349355 0.00343944 0.00344602 0.00343058 0.0034197 0.00338788 0.00404935 0.00366721 0.00341328 0.00345299 0.00346132 0.00345318 0.00344921 0.00344669 0.00344589 0.00345007 0.00345689 0.00346563 0.00347555 0.00348576 0.00349517 0.00350305 0.00350964 0.00351523 0.00351965 0.00261954 0.00263863 0.00266981 0.00273093 0.00274705 0.00305996 0.00296414 0.00295477 0.00297449 0.00314911 0.00349848 0.00352332 0.0029706 0.00298334 0.00308166 0.00321093 0.00331481 0.00336205 0.00326749 0.00326493 0.00329311 0.00331471 0.00331377 0.0032492 0.00538362 0.00531636 0.00392411 0.00349407 0.00343731 0.00341916 0.00343078 0.00344733 0.00342384 0.00343244 0.00344842 0.00345772 0.00346691 0.00347934 0.00347034 0.00347094 0.00347591 0.00348251 0.00349066 0.00350015 0.00351026 0.00352 0.0035286 0.00353626 0.00354342 0.0035497 0.00260857 0.00263436 0.00273051 0.00274473 0.00284907 0.00296763 0.00291095 0.00285851 0.00290087 0.00289018 0.00287996 0.00288134 0.00279128 0.00281376 0.00318588 0.00330517 0.00346758 0.00352272 0.00324694 0.00322458 0.00329428 0.0033488 0.00339088 0.00346712 0.00513519 0.00526452 0.0051942 0.00357245 0.0034198 0.00341049 0.00341749 0.003429 0.00343631 0.00344678 0.00345817 0.00347341 0.00350542 0.00392295 0.00348355 0.00349257 0.00350019 0.00350717 0.0035154 0.00352489 0.00353518 0.00354541 0.00355482 0.0035636 0.00357232 0.0035804 0.00260534 0.00264509 0.00266527 0.00323981 0.00333246 0.00328488 0.00280004 0.00280937 0.00287384 0.00292262 0.00290938 0.00281953 0.00255748 0.00237571 0.00343619 0.00340493 0.0037932 0.00396905 0.00296604 0.00307756 0.00328837 0.00338047 0.00343865 0.00352995 0.00406269 0.00538712 0.00559397 0.0034036 0.00335492 0.00338162 0.00340609 0.00342787 0.00344398 0.00345931 0.0034747 0.00349106 0.00350553 0.00350784 0.00351013 0.00351501 0.00352344 0.0035313 0.00353986 0.0035496 0.00356025 0.00357108 0.00358136 0.00359128 0.00360154 0.00361133 0.00257224 0.00261253 0.00263529 0.00299026 0.00350151 0.00293021 0.00269014 0.00275839 0.00289497 0.00301726 0.00301617 0.00293422 0.00241959 0.000415215 0.0113035 0.045012 0.042408 0.00990232 0.00140301 0.00298577 0.00336173 0.00342229 0.00345007 0.00348129 0.00348339 0.00400769 0.00385203 0.0032124 0.00330593 0.00336622 0.00340246 0.00342964 0.00345102 0.00347047 0.00348797 0.00350348 0.00351572 0.00352508 0.0035329 0.00353827 0.00354606 0.00355467 0.00356389 0.0035741 0.00358525 0.00359675 0.00360793 0.00361901 0.00363074 0.00364216 0.00260176 0.0026073 0.00257784 0.00251002 0.00243442 0.00247388 0.00251508 0.00267351 0.00296629 0.00321665 0.00328422 0.00346457 0.00398501 0.0105293 0.0610137 0.0650557 0.0645392 0.0589427 0.00832672 0.00419232 0.00371236 0.00355719 0.00349048 0.00345845 0.00343211 0.00338214 0.00330536 0.00327267 0.00333076 0.0033766 0.00341105 0.00343891 0.00346228 0.0034832 0.00350159 0.00351749 0.00353109 0.00354309 0.00355242 0.00355962 0.00356783 0.0035773 0.00358741 0.00359826 0.00360999 0.0036222 0.0036343 0.00364651 0.00365967 0.00367263 0.00253181 0.00275752 0.00259722 0.00252767 0.00249105 0.00249371 0.00222689 0.00584112 0.00568134 0.00374966 0.00335705 0.00374276 0.00425236 0.00736855 0.0645135 0.064672 0.0646335 0.0638448 0.00613384 0.00438322 0.00379088 0.00356404 0.0034719 0.00342719 0.00339753 0.00336417 0.00333186 0.00333629 0.00336302 0.0033963 0.00342636 0.00345268 0.00347558 0.00349792 0.00351658 0.0035329 0.00354753 0.00356006 0.00357092 0.0035799 0.0035891 0.00359951 0.00361048 0.003622 0.00363433 0.00364724 0.00366024 0.00367356 0.00368809 0.00370253 0.00251134 0.00252357 0.00253582 0.00256337 0.00258764 0.00261361 0.00465361 0.00948623 0.0093028 0.00787397 0.00331215 0.0040182 0.00427364 0.0197663 0.0632373 0.0644619 0.064516 0.063176 0.014662 0.00419175 0.00361129 0.00345935 0.00339916 0.00337169 0.00335766 0.00334645 0.00334619 0.00335867 0.00338623 0.00341647 0.00344437 0.00346846 0.00349189 0.00351559 0.00353275 0.00354928 0.00356452 0.00357777 0.00358941 0.00359976 0.00361014 0.00362139 0.00363307 0.0036452 0.0036581 0.00367169 0.00368555 0.00369996 0.00371582 0.00373168 0.00251192 0.00253988 0.0025691 0.0026061 0.00266293 0.00277026 0.0055677 0.00929217 0.00926704 0.0093799 0.0062665 0.00316154 0.0028544 0.00157291 0.0317308 0.0654959 0.0658224 0.0283814 0.00192961 0.00266046 0.0031041 0.00320748 0.00325313 0.00328543 0.00330805 0.00332403 0.00334951 0.00342072 0.0034095 0.00343335 0.0034623 0.00349022 0.00351742 0.00353147 0.00354918 0.00356605 0.00358184 0.00359576 0.00360811 0.00361952 0.0036309 0.00364281 0.00365504 0.00366769 0.00368113 0.00369535 0.00371004 0.0037255 0.00374267 0.00375991 0.00250222 0.00253397 0.00257163 0.00262034 0.0026938 0.00282446 0.00326299 0.0082636 0.00925623 0.00935223 0.00407603 0.00265148 0.00257666 0.00230077 0.00438198 0.0044834 0.00597544 0.00327893 0.00160026 0.00238221 0.00284265 0.00304551 0.00315006 0.00321723 0.0032635 0.00330285 0.00334911 0.00338412 0.00346208 0.00345282 0.0034811 0.0035164 0.00365889 0.00354265 0.00356482 0.00358341 0.00359943 0.00361383 0.00362682 0.00363903 0.00365113 0.0036635 0.00367614 0.00368925 0.00370319 0.00371802 0.00373351 0.00374999 0.00376843 0.00378704 0.0017808 0.00178113 0.00178215 0.00178404 0.00178676 0.00179031 0.00179465 0.00179969 0.00180538 0.00181183 0.00181923 0.00182764 0.001837 0.00184727 0.0018584 0.00187037 0.00188316 0.00189679 0.00191127 0.00192671 0.00194327 0.00196121 0.00198084 0.00200303 0.00202626 0.0020532 0.00210108 0.00213625 0.0021759 0.00221547 0.0021683 0.00219955 0.00224279 0.00222951 0.00221497 0.0022115 0.00221245 0.00222669 0.00223353 0.00224595 0.00226507 0.00227584 0.00232482 0.00232866 0.00233177 0.00234279 0.00235702 0.00237765 0.00241019 0.00245797 0.0017511 0.00175141 0.00175244 0.00175434 0.00175709 0.00176067 0.00176505 0.00177013 0.0017759 0.00178248 0.00179002 0.00179858 0.00180808 0.00181847 0.00182971 0.00184178 0.00185469 0.00186845 0.0018831 0.00189872 0.0019155 0.00193363 0.00195338 0.00197515 0.00199721 0.00202241 0.00205226 0.002234 0.0021232 0.00214704 0.00212887 0.00215897 0.00218562 0.0021844 0.00218547 0.00221987 0.00219122 0.00220137 0.00221466 0.00222959 0.0022418 0.00225207 0.00227077 0.00228798 0.00230024 0.00231208 0.00232251 0.00233606 0.00238079 0.00245214 0.00172061 0.00172091 0.00172194 0.00172385 0.00172663 0.00173024 0.00173465 0.00173978 0.00174563 0.00175233 0.00176 0.00176865 0.00177824 0.0017887 0.00180001 0.00181215 0.00182513 0.00183897 0.00185369 0.0018694 0.00188623 0.00190429 0.00192375 0.00194546 0.00196734 0.00199247 0.00207306 0.00204355 0.00207258 0.00209299 0.00209678 0.00215467 0.00214759 0.00214815 0.00220405 0.00215132 0.00216425 0.00217605 0.00219276 0.00219881 0.00222093 0.00222171 0.00224306 0.00226383 0.00227843 0.00229067 0.00229032 0.00225568 0.00235931 0.0024915 0.00168932 0.00168961 0.00169064 0.00169257 0.00169537 0.00169901 0.00170345 0.00170862 0.00171456 0.00172137 0.00172912 0.00173784 0.00174747 0.00175796 0.0017693 0.00178148 0.0017945 0.00180836 0.00182312 0.00183882 0.00185558 0.00187347 0.00189258 0.00191324 0.00193615 0.00195812 0.00198141 0.00200284 0.00202917 0.0020489 0.00206125 0.00222254 0.00210158 0.00211016 0.00211304 0.00212333 0.00213785 0.00215376 0.00219086 0.00234779 0.00244527 0.00222425 0.00222172 0.00224027 0.00225808 0.00227487 0.00228333 0.00227286 0.00377485 0.00364112 0.0016572 0.0016575 0.00165854 0.00166048 0.0016633 0.00166697 0.00167144 0.00167666 0.00168268 0.00168957 0.00169739 0.00170614 0.00171578 0.00172628 0.00173763 0.0017498 0.00176282 0.00177668 0.0017914 0.00180703 0.00182365 0.00184127 0.00185998 0.00187978 0.00190068 0.0019222 0.00194477 0.00196618 0.00198777 0.00200747 0.0020319 0.00204038 0.00205476 0.00207088 0.00208026 0.00209139 0.00210798 0.00212854 0.00214373 0.00217436 0.00238404 0.00218423 0.00219954 0.0022217 0.00224325 0.00226736 0.00230144 0.00248031 0.00369843 0.00366344 0.00162425 0.00162456 0.00162562 0.00162759 0.00163043 0.00163413 0.00163862 0.00164389 0.00164998 0.00165693 0.00166479 0.00167354 0.00168318 0.00169366 0.00170499 0.00171715 0.00173013 0.00174394 0.00175858 0.00177409 0.00179051 0.00180785 0.00182612 0.00184537 0.00186545 0.00188603 0.00190703 0.00192729 0.0019478 0.00196619 0.00198229 0.00199876 0.00201408 0.002029 0.00204438 0.00205857 0.00207504 0.00209378 0.00210822 0.00212408 0.00215194 0.00215959 0.00218153 0.00220003 0.00222425 0.00225165 0.00228819 0.00233914 0.00269183 0.00356341 0.00159046 0.0015908 0.00159189 0.00159389 0.00159676 0.00160047 0.00160499 0.00161031 0.00161645 0.00162345 0.00163133 0.00164007 0.00164968 0.00166013 0.00167142 0.00168353 0.00169645 0.00171018 0.00172471 0.00174005 0.00175623 0.00177326 0.0017911 0.00180977 0.00182912 0.00184886 0.0018683 0.00188784 0.00190703 0.00192532 0.00194283 0.00195965 0.00197498 0.00199123 0.00200728 0.0020223 0.00203853 0.00205588 0.00207308 0.00209195 0.00211249 0.00213082 0.00215112 0.00218146 0.00219086 0.00221916 0.0022602 0.00230504 0.00236222 0.00247239 0.00155581 0.0015562 0.00155734 0.00155938 0.00156228 0.00156601 0.00157057 0.00157592 0.0015821 0.00158913 0.00159701 0.00160574 0.00161531 0.00162571 0.00163694 0.00164898 0.00166181 0.00167542 0.0016898 0.00170495 0.00172087 0.00173756 0.001755 0.0017731 0.00179176 0.00181066 0.00182936 0.00184801 0.00186658 0.00188477 0.00190232 0.00191916 0.00193567 0.00195228 0.00196858 0.00198427 0.00200072 0.00201858 0.00203717 0.00205686 0.00207763 0.00209786 0.0021287 0.00213859 0.00216581 0.00219841 0.00232412 0.00225279 0.00228144 0.00228655 0.00152032 0.00152078 0.00152198 0.00152406 0.001527 0.00153076 0.00153534 0.00154073 0.00154694 0.00155397 0.00156185 0.00157054 0.00158007 0.00159041 0.00160156 0.0016135 0.00162622 0.00163969 0.00165389 0.00166882 0.00168446 0.0017008 0.00171782 0.00173542 0.00175344 0.00177163 0.00178977 0.00180791 0.001826 0.00184384 0.00186128 0.0018784 0.0018952 0.00191203 0.00192878 0.00194541 0.00196261 0.00198076 0.00199956 0.00201882 0.00203986 0.00206085 0.00208103 0.0021036 0.00213227 0.00218113 0.00218 0.00220325 0.00223105 0.00224008 0.00148399 0.00148454 0.00148582 0.00148796 0.00149093 0.00149473 0.00149933 0.00150474 0.00151096 0.001518 0.00152585 0.00153451 0.00154398 0.00155425 0.0015653 0.00157713 0.0015897 0.001603 0.00161701 0.00163169 0.00164704 0.00166303 0.00167962 0.00169672 0.00171418 0.00173182 0.00174951 0.00176723 0.00178491 0.00180245 0.00181978 0.00183691 0.00185391 0.00187092 0.001888 0.00190532 0.00192303 0.00194134 0.00196021 0.00197958 0.00199959 0.00202063 0.00204271 0.00206706 0.00210048 0.00211448 0.00213754 0.00216175 0.00218526 0.00220201 0.00144683 0.00144748 0.00144886 0.00145107 0.0014541 0.00145792 0.00146255 0.00146797 0.0014742 0.00148122 0.00148904 0.00149765 0.00150705 0.00151722 0.00152817 0.00153986 0.00155227 0.00156538 0.00157916 0.00159358 0.00160863 0.00162426 0.00164042 0.00165705 0.00167401 0.00169118 0.00170844 0.00172577 0.0017431 0.00176038 0.00177757 0.00179468 0.00181177 0.00182895 0.00184627 0.00186385 0.00188181 0.00190027 0.00191926 0.00193882 0.00195906 0.00198005 0.00200278 0.0020259 0.00204976 0.00207216 0.00209635 0.00211961 0.00214291 0.00216395 0.00140885 0.00140963 0.00141113 0.00141342 0.00141651 0.00142037 0.00142502 0.00143045 0.00143667 0.00144366 0.00145144 0.00145998 0.00146929 0.00147936 0.00149017 0.00150171 0.00151394 0.00152684 0.00154037 0.00155452 0.00156924 0.0015845 0.00160026 0.00161643 0.00163292 0.00164964 0.0016665 0.00168345 0.00170046 0.00171749 0.00173452 0.00175157 0.00176869 0.00178593 0.00180338 0.00182111 0.00183921 0.00185777 0.00187685 0.00189651 0.00191684 0.00193785 0.00195963 0.00198245 0.0020061 0.00202966 0.00205264 0.00207661 0.00210076 0.00212463 0.00137007 0.00137101 0.00137264 0.00137503 0.00137819 0.0013821 0.00138677 0.0013922 0.0013984 0.00140535 0.00141307 0.00142153 0.00143074 0.00144068 0.00145134 0.0014627 0.00147473 0.00148739 0.00150067 0.00151451 0.0015289 0.00154379 0.00155913 0.00157486 0.00159091 0.00160719 0.00162365 0.00164025 0.00165694 0.00167371 0.00169056 0.0017075 0.00172456 0.00174181 0.00175929 0.00177708 0.00179524 0.00181384 0.00183295 0.00185262 0.00187293 0.00189392 0.0019157 0.0019383 0.00196141 0.00198447 0.00200834 0.00203268 0.00205745 0.00208267 0.00133051 0.00133163 0.00133342 0.00133593 0.00133916 0.00134313 0.00134782 0.00135325 0.00135941 0.00136632 0.00137397 0.00138234 0.00139142 0.00140122 0.00141171 0.00142286 0.00143467 0.00144708 0.00146006 0.00147359 0.00148763 0.00150214 0.00151706 0.00153236 0.00154797 0.00156383 0.00157989 0.00159612 0.00161249 0.00162899 0.00164561 0.00166238 0.00167933 0.0016965 0.00171394 0.0017317 0.00174984 0.00176842 0.0017875 0.00180713 0.00182737 0.00184829 0.00186994 0.00189227 0.00191513 0.00193855 0.00196253 0.00198709 0.00201225 0.00203813 0.00129021 0.00129153 0.0012935 0.00129614 0.00129947 0.00130349 0.0013082 0.00131363 0.00131976 0.00132661 0.00133416 0.00134242 0.00135138 0.00136101 0.0013713 0.00138224 0.00139379 0.00140592 0.0014186 0.00143179 0.00144546 0.00145957 0.00147408 0.00148894 0.00150411 0.00151954 0.0015352 0.00155104 0.00156707 0.00158325 0.00159961 0.00161616 0.00163293 0.00164995 0.00166727 0.00168493 0.00170298 0.00172147 0.00174046 0.00175999 0.00178012 0.00180091 0.00182239 0.00184456 0.00186737 0.00189079 0.00191483 0.00193955 0.00196497 0.00199121 0.00124919 0.00125074 0.0012529 0.00125569 0.00125913 0.00126322 0.00126796 0.00127338 0.00127947 0.00128624 0.0012937 0.00130184 0.00131064 0.00132009 0.00133018 0.00134087 0.00135215 0.00136398 0.00137632 0.00138915 0.00140243 0.00141613 0.00143021 0.00144463 0.00145935 0.00147434 0.00148956 0.001505 0.00152065 0.00153649 0.00155253 0.0015688 0.00158532 0.00160212 0.00161924 0.00163673 0.00165462 0.00167295 0.00169178 0.00171115 0.00173111 0.00175172 0.00177301 0.001795 0.00181767 0.00184102 0.00186507 0.00188984 0.00191538 0.00194178 0.0012075 0.00120929 0.00121168 0.00121464 0.00121819 0.00122235 0.00122713 0.00123254 0.00123859 0.00124528 0.00125263 0.00126062 0.00126926 0.00127851 0.00128837 0.0012988 0.00130978 0.00132129 0.00133328 0.00134573 0.0013586 0.00137187 0.00138549 0.00139945 0.0014137 0.00142823 0.001443 0.001458 0.00147322 0.00148867 0.00150435 0.00152028 0.00153649 0.001553 0.00156986 0.00158709 0.00160474 0.00162285 0.00164145 0.00166059 0.00168032 0.00170068 0.00172172 0.00174347 0.00176594 0.00178913 0.00181307 0.00183778 0.00186329 0.00188968 0.00116517 0.00116723 0.00116986 0.001173 0.00117669 0.00118094 0.00118576 0.00119116 0.00119716 0.00120377 0.00121099 0.00121883 0.00122728 0.00123632 0.00124592 0.00125608 0.00126674 0.0012779 0.00128952 0.00130156 0.00131401 0.00132682 0.00133997 0.00135345 0.00136721 0.00138124 0.00139552 0.00141005 0.00142482 0.00143983 0.00145509 0.00147063 0.00148646 0.00150262 0.00151913 0.00153604 0.00155337 0.00157117 0.00158947 0.0016083 0.00162773 0.00164778 0.00166851 0.00168995 0.00171212 0.00173505 0.00175876 0.00178327 0.00180861 0.00183482 0.00112224 0.00112459 0.00112749 0.00113083 0.00113466 0.00113901 0.00114388 0.00114928 0.00115523 0.00116175 0.00116884 0.00117651 0.00118476 0.00119356 0.0012029 0.00121275 0.00122308 0.00123387 0.00124509 0.00125671 0.0012687 0.00128104 0.0012937 0.00130666 0.00131991 0.00133342 0.00134718 0.0013612 0.00137547 0.00139 0.00140479 0.00141987 0.00143527 0.001451 0.00146711 0.00148362 0.00150056 0.00151797 0.00153588 0.00155433 0.00157337 0.00159303 0.00161336 0.0016344 0.00165618 0.00167874 0.00170209 0.00172625 0.00175126 0.00177714 0.00107877 0.00108144 0.00108462 0.00108818 0.00109217 0.00109662 0.00110154 0.00110695 0.00111285 0.00111928 0.00112623 0.00113373 0.00114175 0.0011503 0.00115935 0.00116887 0.00117885 0.00118925 0.00120005 0.00121121 0.00122273 0.00123457 0.00124671 0.00125914 0.00127184 0.0012848 0.00129802 0.00131149 0.00132522 0.00133922 0.0013535 0.00136807 0.00138297 0.00139822 0.00141385 0.00142989 0.00144636 0.00146331 0.00148076 0.00149874 0.0015173 0.00153648 0.00155632 0.00157686 0.00159814 0.00162019 0.00164303 0.00166671 0.00169122 0.00171661 0.0010348 0.00103781 0.0010413 0.00104509 0.00104925 0.00105382 0.0010588 0.00106421 0.00107007 0.0010764 0.00108321 0.00109052 0.00109831 0.00110659 0.00111533 0.00112451 0.0011341 0.00114409 0.00115444 0.00116513 0.00117615 0.00118746 0.00119906 0.00121093 0.00122306 0.00123544 0.00124808 0.00126097 0.00127413 0.00128755 0.00130127 0.00131528 0.00132963 0.00134433 0.00135942 0.00137492 0.00139086 0.00140727 0.00142417 0.0014416 0.0014596 0.00147821 0.00149745 0.00151738 0.00153804 0.00155945 0.00158165 0.00160466 0.00162852 0.00165323 0.000990401 0.000993767 0.000997586 0.00100162 0.00100596 0.00101065 0.0010157 0.00102112 0.00102693 0.00103317 0.00103983 0.00104694 0.00105449 0.00106248 0.00107089 0.0010797 0.0010889 0.00109844 0.00110832 0.00111852 0.001129 0.00113977 0.0011508 0.00116208 0.00117361 0.00118538 0.00119741 0.00120968 0.00122222 0.00123504 0.00124814 0.00126155 0.0012753 0.0012894 0.00130389 0.00131878 0.00133412 0.00134992 0.0013662 0.001383 0.00140035 0.00141828 0.00143684 0.00145606 0.00147597 0.00149661 0.00151801 0.00154021 0.00156321 0.00158705 0.00094562 0.000949368 0.000953534 0.00095783 0.000962364 0.000967183 0.000972298 0.000977729 0.000983497 0.000989627 0.000996138 0.00100304 0.00101034 0.00101803 0.00102609 0.00103451 0.00104328 0.00105236 0.00106175 0.00107142 0.00108135 0.00109154 0.00110197 0.00111263 0.00112353 0.00113467 0.00114605 0.00115768 0.00116957 0.00118173 0.00119418 0.00120694 0.00122003 0.00123347 0.0012473 0.00126153 0.0012762 0.00129132 0.00130691 0.001323 0.00133962 0.0013568 0.00137457 0.00139297 0.00141203 0.00143177 0.00145223 0.00147344 0.00149541 0.00151818 0.000900523 0.000904676 0.000909207 0.000913779 0.000918515 0.00092347 0.000928658 0.000934098 0.000939817 0.000945839 0.000952186 0.000958872 0.0009659 0.000973268 0.000980967 0.000988983 0.0009973 0.0010059 0.00101477 0.00102388 0.00103324 0.00104282 0.00105262 0.00106264 0.00107288 0.00108335 0.00109405 0.001105 0.0011162 0.00112767 0.00113942 0.00115148 0.00116387 0.0011766 0.00118972 0.00120323 0.00121716 0.00123153 0.00124636 0.00126167 0.00127748 0.00129382 0.00131072 0.00132821 0.0013463 0.00136502 0.00138441 0.00140448 0.00142526 0.00144675 0.000855178 0.000859757 0.000864674 0.000869535 0.000874482 0.000879578 0.00088484 0.000890288 0.000895951 0.000901858 0.00090803 0.000914485 0.000921228 0.00092826 0.000935574 0.000943161 0.000951007 0.000959097 0.000967418 0.000975957 0.000984704 0.000993653 0.0010028 0.00101215 0.0010217 0.00103147 0.00104146 0.00105168 0.00106216 0.0010729 0.00108391 0.00109523 0.00110687 0.00111885 0.00113119 0.00114392 0.00115706 0.00117062 0.00118463 0.00119909 0.00121402 0.00122944 0.00124538 0.00126185 0.00127887 0.00129647 0.00131466 0.00133346 0.00135288 0.00137293 0.000809658 0.000814685 0.000820005 0.000825168 0.000830334 0.000835575 0.000840909 0.000846362 0.000851962 0.000857742 0.000863727 0.000869934 0.000876374 0.000883049 0.000889958 0.000897092 0.000904442 0.000911997 0.000919746 0.000927679 0.00093579 0.000944077 0.00095254 0.000961184 0.000970019 0.000979054 0.000988303 0.000997777 0.00100749 0.00101746 0.0010277 0.00103823 0.00104908 0.00106025 0.00107178 0.00108368 0.00109597 0.00110866 0.00112177 0.00113531 0.00114929 0.00116372 0.00117862 0.00119399 0.00120986 0.00122623 0.00124311 0.0012605 0.00127841 0.00129685 0.000764038 0.000769535 0.000775276 0.000780753 0.000786143 0.000791531 0.000796936 0.000802387 0.000807915 0.000813555 0.000819335 0.000825276 0.000831391 0.000837687 0.000844165 0.000850822 0.00085765 0.000864642 0.000871789 0.000879088 0.000886534 0.000894129 0.000901879 0.000909791 0.000917877 0.000926151 0.000934625 0.000943314 0.000952233 0.000961396 0.000970824 0.000980533 0.000990542 0.00100087 0.00101153 0.00102255 0.00103394 0.00104571 0.00105787 0.00107043 0.00108339 0.00109676 0.00111054 0.00112474 0.00113936 0.0011544 0.00116986 0.00118574 0.00120202 0.00121869 0.000718402 0.000724389 0.000730568 0.000736368 0.000741988 0.000747522 0.000752994 0.000758433 0.000763876 0.00076936 0.000774916 0.000780568 0.000786334 0.000792225 0.000798246 0.000804396 0.000810672 0.000817071 0.000823587 0.00083022 0.00083697 0.000843844 0.00085085 0.000858001 0.000865309 0.000872791 0.00088046 0.000888331 0.000896422 0.000904748 0.000913327 0.000922176 0.000931312 0.000940751 0.000950509 0.0009606 0.000971038 0.000981832 0.00099299 0.00100451 0.0010164 0.00102865 0.00104125 0.0010542 0.0010675 0.00108113 0.00109508 0.00110933 0.00112386 0.00113865 0.000672839 0.000679335 0.000685968 0.000692098 0.00069795 0.000703627 0.000709158 0.000714574 0.000719916 0.000725223 0.000730532 0.00073587 0.00074126 0.000746717 0.000752249 0.000757861 0.000763553 0.000769325 0.000775176 0.000781111 0.000787134 0.000793255 0.000799488 0.000805846 0.000812347 0.000819005 0.000825838 0.000832862 0.000840094 0.00084755 0.000855248 0.000863203 0.000871431 0.000879944 0.000888758 0.000897882 0.000907329 0.000917104 0.000927211 0.000937646 0.000948403 0.00095947 0.000970835 0.000982481 0.000994389 0.00100654 0.0010189 0.00103144 0.00104413 0.00105692 0.000627443 0.000634467 0.000641565 0.000648033 0.000654115 0.00065993 0.000665508 0.000670885 0.000676105 0.000681213 0.000686247 0.000691242 0.000696224 0.000701213 0.000706222 0.00071126 0.000716332 0.000721441 0.000726593 0.000731795 0.000737057 0.000742394 0.000747821 0.000753357 0.000759019 0.000764824 0.000770792 0.000776938 0.000783281 0.000789838 0.000796624 0.000803654 0.00081094 0.000818496 0.00082633 0.000834454 0.000842873 0.000851591 0.000860605 0.000869909 0.00087949 0.000889331 0.000899409 0.000909698 0.000920166 0.000930776 0.000941487 0.000952253 0.00096302 0.000973728 0.000582319 0.000589885 0.00059746 0.000604266 0.000610574 0.000616516 0.000622126 0.000627444 0.000632517 0.000637396 0.000642125 0.000646743 0.00065128 0.000655764 0.000660211 0.000664636 0.000669048 0.000673456 0.00067787 0.000682302 0.000686768 0.000691287 0.000695876 0.000700558 0.00070535 0.000710273 0.000715346 0.000720587 0.000726013 0.000731643 0.000737489 0.000743564 0.000749881 0.000756448 0.000763274 0.000770366 0.000777727 0.000785354 0.000793242 0.000801379 0.000809747 0.000818324 0.000827077 0.00083597 0.000844957 0.000853988 0.000863007 0.000871951 0.000880747 0.000889319 0.000537579 0.0005457 0.000553757 0.000560899 0.000567423 0.000573476 0.000579097 0.000584328 0.000589225 0.000593842 0.000598228 0.000602428 0.00060648 0.000610415 0.000614258 0.000618026 0.000621735 0.000625398 0.000629033 0.000632657 0.00063629 0.000639955 0.000643673 0.000647468 0.00065136 0.000655371 0.000659521 0.00066383 0.000668314 0.00067299 0.000677869 0.000682964 0.000688284 0.000693837 0.00069963 0.000705665 0.00071194 0.00071845 0.000725184 0.000732126 0.000739254 0.000746538 0.000753939 0.000761408 0.000768889 0.000776317 0.000783621 0.00079072 0.000797524 0.000803934 0.000493343 0.000502027 0.000510567 0.000518037 0.000524762 0.000530903 0.000536507 0.00054162 0.000546302 0.000550615 0.000554615 0.000558352 0.000561871 0.00056521 0.000568398 0.00057146 0.000574418 0.000577291 0.000580103 0.000582877 0.000585638 0.000588412 0.000591225 0.0005941 0.000597061 0.000600132 0.000603333 0.000606684 0.000610201 0.000613898 0.000617787 0.000621878 0.000626178 0.000630696 0.000635432 0.000640388 0.000645556 0.000650927 0.000656486 0.000662214 0.000668083 0.000674056 0.000680087 0.000686117 0.00069208 0.000697898 0.000703484 0.000708741 0.000713559 0.000717818 0.000449746 0.000458994 0.000468011 0.000475792 0.000482695 0.000488895 0.000494445 0.000499399 0.000503822 0.000507783 0.000511344 0.000514565 0.000517497 0.000520184 0.000522662 0.000524964 0.000527118 0.000529151 0.000531093 0.000532972 0.00053482 0.000536666 0.000538536 0.000540459 0.00054246 0.000544563 0.000546789 0.000549157 0.000551684 0.00055438 0.000557257 0.000560323 0.000563586 0.000567048 0.00057071 0.000574568 0.000578611 0.000582827 0.000587197 0.000591697 0.000596296 0.000600949 0.000605604 0.000610194 0.000614641 0.000618859 0.000622746 0.000626186 0.000629053 0.000631206 0.000406929 0.000416736 0.000426215 0.000434284 0.000441331 0.000447551 0.000453003 0.000457747 0.000461857 0.000465408 0.000468473 0.000471116 0.000473398 0.00047537 0.000477078 0.00047856 0.000479852 0.000480991 0.000482011 0.00048295 0.000483842 0.000484718 0.000485611 0.000486549 0.00048756 0.000488667 0.000489894 0.000491258 0.000492772 0.000494447 0.000496294 0.000498318 0.000500526 0.000502918 0.000505491 0.000508237 0.000511142 0.000514191 0.000517363 0.00052063 0.000523955 0.000527288 0.00053057 0.000533728 0.000536678 0.000539322 0.000541545 0.000543218 0.000544197 0.000544323 0.000365049 0.000375399 0.000385315 0.000393638 0.000400786 0.000406976 0.000412274 0.000416748 0.00042048 0.000423556 0.000426054 0.00042805 0.000429612 0.000430801 0.000431669 0.000432265 0.000432634 0.00043282 0.000432866 0.000432815 0.000432705 0.000432573 0.000432452 0.000432372 0.000432363 0.000432451 0.000432655 0.000432993 0.000433475 0.000434113 0.000434913 0.000435882 0.000437022 0.000438332 0.000439805 0.000441428 0.000443188 0.000445065 0.000447035 0.000449068 0.000451122 0.000453142 0.000455064 0.000456811 0.000458293 0.000459403 0.000460017 0.000459993 0.000459172 0.000457382 0.000324276 0.000335143 0.000345458 0.000353986 0.000361181 0.000367277 0.000372353 0.000376485 0.000379765 0.000382286 0.00038414 0.000385409 0.000386172 0.000386499 0.000386454 0.000386093 0.000385472 0.000384644 0.000383661 0.000382569 0.000381412 0.000380229 0.000379057 0.000377929 0.000376875 0.000375918 0.000375079 0.000374372 0.000373807 0.000373392 0.000373134 0.000373037 0.000373101 0.00037332 0.000373685 0.00037418 0.00037479 0.000375493 0.000376264 0.000377068 0.000377859 0.000378581 0.000379164 0.000379531 0.000379585 0.000379214 0.000378288 0.000376656 0.000374149 0.000370581 0.000284796 0.000296138 0.0003068 0.000315471 0.00032264 0.000328566 0.000333337 0.000337041 0.000339779 0.000341657 0.000342774 0.000343226 0.000343102 0.000342482 0.00034144 0.000340045 0.000338364 0.000336458 0.000334386 0.000332201 0.000329951 0.000327678 0.000325421 0.000323215 0.000321089 0.000319067 0.000317167 0.000315399 0.000313773 0.000312296 0.000310972 0.000309802 0.000308783 0.000307906 0.000307159 0.000306524 0.000305985 0.000305518 0.000305097 0.000304681 0.000304224 0.000303666 0.00030294 0.000301963 0.000300639 0.000298853 0.000296468 0.000293331 0.000289268 0.000284082 0.000246811 0.000258571 0.000269506 0.000278239 0.000285295 0.000290955 0.000295322 0.000298494 0.000300586 0.000301714 0.000301991 0.000301523 0.00030041 0.000298747 0.000296619 0.000294107 0.000291289 0.000288236 0.000285015 0.000281684 0.000278294 0.000274892 0.000271518 0.000268207 0.000264988 0.000261882 0.000258904 0.000256064 0.000253368 0.000250821 0.000248425 0.000246179 0.000244075 0.000242101 0.000240242 0.00023848 0.000236796 0.000235168 0.000233562 0.00023194 0.000230253 0.000228441 0.000226438 0.000224162 0.000221516 0.000218384 0.000214632 0.000210105 0.000204627 0.000198 0.000210541 0.000222638 0.000233754 0.000242444 0.000249276 0.000254555 0.000258398 0.000260918 0.000262241 0.000262497 0.000261811 0.000260304 0.00025809 0.000255276 0.000251961 0.000248242 0.000244206 0.000239935 0.000235501 0.00023097 0.000226395 0.000221826 0.000217304 0.000212864 0.000208532 0.000204327 0.00020026 0.000196339 0.000192568 0.000188949 0.000185481 0.000182158 0.00017897 0.0001759 0.000172933 0.00017005 0.000167231 0.000164449 0.000161673 0.000158861 0.000155964 0.000152927 0.000149684 0.000146154 0.000142244 0.000137842 0.000132817 0.000127019 0.000120277 0.000112394 0.000176225 0.000188554 0.000199727 0.000208247 0.00021472 0.000219478 0.000222656 0.000224379 0.00022479 0.000224032 0.000222245 0.000219565 0.000216122 0.000212037 0.000207428 0.000202403 0.000197062 0.000191497 0.000185787 0.000180001 0.000174197 0.000168426 0.000162729 0.000157139 0.000151679 0.000146364 0.000141202 0.000136197 0.00013135 0.00012666 0.000122122 0.000117727 0.000113459 0.0001093 0.000105233 0.000101238 9.72929e-05 9.33713e-05 8.94384e-05 8.5454e-05 8.13719e-05 7.71389e-05 7.26916e-05 6.7955e-05 6.28403e-05 5.7243e-05 5.10409e-05 4.40924e-05 3.62343e-05 2.72819e-05 0.000144123 0.000156547 0.000167622 0.000175812 0.000181763 0.000185835 0.000188181 0.000188942 0.000188275 0.000186341 0.000183296 0.000179292 0.000174478 0.000168994 0.000162973 0.000156538 0.000149802 0.000142865 0.000135815 0.000128722 0.000121649 0.000114645 0.000107751 0.000100996 9.4398e-05 8.79678e-05 8.1709e-05 7.56217e-05 6.97035e-05 6.39494e-05 5.83495e-05 5.2889e-05 4.75496e-05 4.23118e-05 3.71559e-05 3.20613e-05 2.70045e-05 2.19569e-05 1.6884e-05 1.17475e-05 6.50397e-06 1.10405e-06 -4.51075e-06 -1.04092e-05 -1.66716e-05 -2.33918e-05 -3.06807e-05 -3.86662e-05 -4.74954e-05 -5.7335e-05 0.00011452 0.000126859 0.000137641 0.000145309 0.000150544 0.000153735 0.000155055 0.000154663 0.00015273 0.000149436 0.000144955 0.000139461 0.000133121 0.000126096 0.000118537 0.000110583 0.000102359 9.39751e-05 8.55219e-05 7.70755e-05 6.86975e-05 6.04368e-05 5.23296e-05 4.44002e-05 3.66614e-05 2.91177e-05 2.17679e-05 1.46072e-05 7.6288e-06 8.2226e-07 -5.82758e-06 -1.23403e-05 -1.87373e-05 -2.504e-05 -3.12695e-05 -3.74482e-05 -4.36015e-05 -4.9759e-05 -5.59537e-05 -6.22216e-05 -6.86025e-05 -7.51413e-05 -8.189e-05 -8.89087e-05 -9.62667e-05 -0.000104045 -0.000112339 -0.000121258 -0.000130927 -0.000141486 8.77246e-05 9.97507e-05 0.000109996 0.000116907 0.000121197 0.000123282 0.000123353 0.000121585 0.000118171 0.000113307 0.000107191 0.000100019 9.19819e-05 8.32627e-05 7.40323e-05 6.44459e-05 5.46406e-05 4.47332e-05 3.48198e-05 2.49775e-05 1.52664e-05 5.73173e-06 -3.59618e-06 -1.27002e-05 -2.15747e-05 -3.02218e-05 -3.86492e-05 -4.68671e-05 -5.48885e-05 -6.273e-05 -7.04122e-05 -7.79592e-05 -8.53956e-05 -9.27448e-05 -0.00010003 -0.000107275 -0.000114507 -0.000121757 -0.000129054 -0.000136433 -0.000143929 -0.000151582 -0.000159435 -0.000167539 -0.000175949 -0.000184732 -0.000193964 -0.00020373 -0.000214125 -0.00022526 6.40678e-05 7.54872e-05 8.48919e-05 9.07634e-05 9.38395e-05 9.45541e-05 9.31166e-05 8.97204e-05 8.45763e-05 7.79039e-05 6.99262e-05 6.0866e-05 5.09416e-05 4.03608e-05 2.93155e-05 1.79777e-05 6.49559e-06 -5.00768e-06 -1.64337e-05 -2.77064e-05 -3.87701e-05 -4.95863e-05 -6.01329e-05 -7.04023e-05 -8.03976e-05 -9.01294e-05 -9.96124e-05 -0.000108864 -0.000117905 -0.000126758 -0.000135449 -0.000144008 -0.000152462 -0.000160836 -0.000169155 -0.000177448 -0.000185741 -0.000194064 -0.000202446 -0.000210918 -0.000219511 -0.000228258 -0.000237194 -0.000246357 -0.000255789 -0.00026554 -0.00027566 -0.000286209 -0.000297248 -0.000308848 4.38991e-05 5.43349e-05 6.25222e-05 6.70192e-05 6.85672e-05 6.76078e-05 6.43643e-05 5.9047e-05 5.18879e-05 4.3133e-05 3.30358e-05 2.18512e-05 9.82867e-06 -2.79601e-06 -1.58082e-05 -2.90198e-05 -4.22725e-05 -5.54389e-05 -6.84215e-05 -8.11489e-05 -9.35732e-05 -0.000105667 -0.000117418 -0.000128832 -0.000139923 -0.00015071 -0.000161218 -0.000171473 -0.000181502 -0.000191338 -0.000201011 -0.000210555 -0.00022 -0.000229375 -0.000238708 -0.000248027 -0.000257363 -0.000266743 -0.000276194 -0.000285744 -0.00029542 -0.000305248 -0.000315254 -0.000325464 -0.000335905 -0.000346605 -0.000357591 -0.00036889 -0.000380526 -0.000392527 2.75937e-05 3.65893e-05 4.31219e-05 4.58785e-05 4.55651e-05 4.26103e-05 3.72443e-05 2.9693e-05 2.02123e-05 9.07968e-06 -3.41446e-06 -1.69763e-05 -3.13196e-05 -4.61772e-05 -6.131e-05 -7.6514e-05 -9.16226e-05 -0.000106508 -0.000121076 -0.000135267 -0.000149043 -0.000162392 -0.000175318 -0.00018784 -0.000199984 -0.000211784 -0.000223273 -0.000234488 -0.000245466 -0.000256245 -0.000266864 -0.000277357 -0.000287761 -0.000298106 -0.000308424 -0.000318746 -0.0003291 -0.000339515 -0.000350017 -0.000360629 -0.000371375 -0.000382273 -0.00039334 -0.000404591 -0.000416036 -0.000427681 -0.000439529 -0.000451571 -0.000463793 -0.00047617 1.55265e-05 2.26025e-05 2.70552e-05 2.77481e-05 2.52919e-05 2.00707e-05 1.23117e-05 2.25408e-06 -9.82066e-06 -2.35977e-05 -3.87416e-05 -5.49117e-05 -7.17779e-05 -8.90364e-05 -0.000106421 -0.000123712 -0.000140736 -0.000157368 -0.000173524 -0.000189155 -0.000204246 -0.0002188 -0.000232841 -0.000246405 -0.000259535 -0.000272277 -0.000284679 -0.000296787 -0.000308649 -0.000320308 -0.00033181 -0.000343195 -0.000354502 -0.000365764 -0.000377017 -0.000388292 -0.000399619 -0.000411025 -0.000422535 -0.000434171 -0.000445951 -0.000457887 -0.000469989 -0.000482257 -0.000494686 -0.000507263 -0.000519961 -0.00053274 -0.000545542 -0.000558292 7.70899e-06 1.23476e-05 1.42713e-05 1.25374e-05 7.60344e-06 -2.23325e-07 -1.07269e-05 -2.36529e-05 -3.86861e-05 -5.54627e-05 -7.35892e-05 -9.26657e-05 -0.000112309 -0.000132173 -0.000151963 -0.000171445 -0.000190443 -0.000208841 -0.000226571 -0.000243609 -0.000259959 -0.000275652 -0.000290735 -0.000305265 -0.000319304 -0.000332915 -0.000346158 -0.000359092 -0.000371774 -0.000384255 -0.000396587 -0.000408813 -0.000420976 -0.000433113 -0.000445262 -0.000457455 -0.000469723 -0.000482093 -0.000494589 -0.00050723 -0.000520032 -0.000533001 -0.000546139 -0.000559435 -0.00057287 -0.00058641 -0.000600003 -0.000613575 -0.000627027 -0.000640232 1.51591e-06 1.97081e-06 -6.47555e-07 -6.69234e-06 -1.59388e-05 -2.82051e-05 -4.32664e-05 -6.08068e-05 -8.04255e-05 -0.000101662 -0.000124031 -0.000147054 -0.000170294 -0.000193376 -0.000216002 -0.000237953 -0.000259086 -0.000279326 -0.00029865 -0.000317079 -0.000334662 -0.00035147 -0.000367582 -0.000383084 -0.00039806 -0.00041259 -0.000426749 -0.000440607 -0.000454229 -0.000467674 -0.000480995 -0.000494241 -0.000507456 -0.00052068 -0.000533953 -0.000547309 -0.00056078 -0.000574394 -0.000588175 -0.000602143 -0.000616311 -0.000630684 -0.000645256 -0.000660011 -0.000674916 -0.00068992 -0.000704946 -0.000719887 -0.000734607 -0.000748929 0.00250005 0.00252983 0.0025637 0.00259454 0.00266793 0.00273152 0.00276106 0.00315349 0.00380833 0.00361054 0.00240862 0.00250425 0.00261125 0.00265098 0.00311081 0.00340242 0.00333813 0.00270357 0.00234244 0.00259497 0.00285108 0.00300757 0.00310623 0.00317994 0.00323218 0.00326563 0.00335088 0.00339523 0.00343957 0.00347336 0.00349986 0.00352754 0.00354859 0.00356363 0.00358222 0.00360088 0.00361716 0.00363177 0.00364517 0.0036579 0.00367046 0.00368316 0.00369613 0.00370965 0.00372406 0.00373947 0.00375573 0.00377319 0.0037929 0.00381287 0.00250483 0.00252664 0.00254429 0.00257219 0.00261646 0.00264595 0.0028207 0.00278197 0.00281936 0.00270829 0.00254595 0.00260541 0.00267954 0.00274617 0.00294466 0.00304146 0.00297471 0.00277342 0.00263971 0.0027634 0.00291291 0.003018 0.00309384 0.0031575 0.00320017 0.00336934 0.00343327 0.00341346 0.00347184 0.00350443 0.00352326 0.0035457 0.00356735 0.00358482 0.00360105 0.00361844 0.00363452 0.00364916 0.00366275 0.00367576 0.00368858 0.00370149 0.00371474 0.00372864 0.00374351 0.00375948 0.00377646 0.0037949 0.00381585 0.00383718 0.00253993 0.00253369 0.00252747 0.00253999 0.00256986 0.00258423 0.00262116 0.00267755 0.00270598 0.00268783 0.00266186 0.00268759 0.00272237 0.0027598 0.00283753 0.00286051 0.00282436 0.00275242 0.0027571 0.00287327 0.00298344 0.00305155 0.00310189 0.00316008 0.00320968 0.00324036 0.00369898 0.00360858 0.00353819 0.00354827 0.00355266 0.00357531 0.0035865 0.00360342 0.00361918 0.00363569 0.00365127 0.00366571 0.00367926 0.00369231 0.00370521 0.00371826 0.00373173 0.00374597 0.00376128 0.00377777 0.00379547 0.00381485 0.00383704 0.00385974 0.00290926 0.0025318 0.00250069 0.00250106 0.00251146 0.00253396 0.00258153 0.00264434 0.00269949 0.00274106 0.00275183 0.0027394 0.00274551 0.00275319 0.00276848 0.00273842 0.00264738 0.00264877 0.00278818 0.00298287 0.00308394 0.00309477 0.00309257 0.00316623 0.00322981 0.00329512 0.0034366 0.0037891 0.00376167 0.00357376 0.00356723 0.00359233 0.00359956 0.00361817 0.00363591 0.00365196 0.0036671 0.00368115 0.00369443 0.00370732 0.00372014 0.00373322 0.00374685 0.00376138 0.00377708 0.0037941 0.00381248 0.00383279 0.00385622 0.00388029 0.00373359 0.00292355 0.00242973 0.0024572 0.00247432 0.00247151 0.00249654 0.00257574 0.00268173 0.00275282 0.00284826 0.00275941 0.00275709 0.00274159 0.00273157 0.00265489 0.00237594 0.00453841 0.00426768 0.00319201 0.00325489 0.00315357 0.00322576 0.00325476 0.00324385 0.00333138 0.00344515 0.00368361 0.00389535 0.00373487 0.00355322 0.003583 0.00360353 0.00362906 0.0036496 0.00366666 0.00368159 0.00369517 0.003708 0.00372053 0.00373313 0.00374611 0.00375981 0.00377457 0.00379064 0.00380817 0.00382723 0.00384846 0.00387312 0.00389859 0.00383889 0.00280686 0.00233584 0.00237778 0.00238214 0.00236856 0.00249338 0.00248382 0.00265853 0.00283093 0.00295866 0.00292315 0.00281192 0.00274936 0.00275151 0.00273127 0.00304401 0.00537963 0.00508251 0.00431101 0.00342361 0.0031172 0.00311795 0.00327928 0.00337065 0.00334404 0.00347613 0.00354627 0.00395472 0.0039262 0.00352919 0.00358526 0.00361875 0.0036429 0.00366356 0.00368043 0.00369473 0.00370754 0.00371967 0.00373166 0.00374388 0.00375665 0.00377032 0.00378523 0.00380164 0.00381968 0.00383944 0.00386158 0.00388749 0.00391435 0.0023622 0.00219991 0.00228187 0.00232352 0.00233165 0.00230271 0.00213615 0.00447726 0.00663402 0.00651922 0.00409623 0.0030907 0.00280533 0.00284238 0.00275092 0.00281542 0.00287905 0.00474435 0.00473589 0.00464158 0.0041686 0.0029913 0.00313254 0.0031219 0.00323418 0.00330468 0.00345428 0.00358211 0.00354824 0.00352087 0.00356221 0.00361143 0.0036432 0.00366246 0.00367957 0.00369403 0.00370654 0.00371798 0.00372907 0.00374031 0.00375202 0.00376448 0.00377803 0.00379304 0.00380977 0.00382833 0.00384881 0.00387188 0.00389903 0.0039273 0.00226046 0.00224508 0.00227286 0.00230599 0.00232488 0.00233441 0.00265201 0.00682316 0.00658231 0.00642664 0.00603453 0.00411712 0.00259006 0.0026668 0.0027233 0.00281389 0.00298044 0.00353925 0.00433355 0.00485364 0.00518003 0.00277214 0.00291626 0.0030252 0.0031677 0.00330375 0.00341912 0.00361783 0.0036573 0.00363057 0.00363332 0.00365348 0.00367063 0.00368422 0.00369588 0.00370648 0.00371629 0.00372582 0.0037356 0.00374596 0.00375708 0.00376918 0.00378257 0.00379763 0.00381467 0.00383379 0.00385503 0.00387907 0.00390747 0.00393714 0.00223759 0.00224449 0.00226806 0.00229894 0.00233122 0.00236687 0.00255145 0.00638033 0.00644533 0.00652789 0.00676009 0.00548728 0.00245719 0.00256488 0.00264986 0.00275081 0.00288083 0.0030546 0.0034338 0.00524186 0.0036782 0.00243194 0.00267344 0.00289484 0.00312338 0.00331488 0.00348283 0.00371773 0.00373095 0.00366396 0.00367968 0.00370606 0.00369351 0.00370237 0.00370931 0.00371575 0.00372257 0.00373005 0.00373847 0.00374796 0.00375853 0.00377031 0.00378355 0.00379867 0.00381601 0.00383572 0.00385779 0.00388284 0.0039125 0.00394356 0.00221347 0.00222903 0.00225333 0.00229048 0.0023303 0.0023981 0.00250969 0.00379943 0.00611795 0.0065657 0.00651564 0.00373112 0.00235422 0.00249927 0.00258751 0.00266263 0.00272977 0.00276327 0.00264496 0.00251943 0.00225302 0.0023503 0.00250477 0.00279854 0.00312698 0.00337285 0.00354352 0.00381018 0.00389073 0.00370199 0.00371495 0.0037169 0.00371611 0.00371616 0.00371757 0.00372002 0.0037239 0.00372945 0.00373673 0.00374559 0.00375582 0.00376742 0.00378062 0.00379583 0.00381351 0.00383381 0.00385675 0.00388286 0.00391378 0.00394623 0.00218384 0.00220579 0.00223799 0.00229883 0.00242579 0.00237134 0.00246521 0.00248389 0.0031525 0.00351442 0.00300454 0.00221467 0.00234746 0.00246092 0.00254014 0.00259334 0.00262354 0.00261596 0.0025371 0.00240139 0.00221701 0.00208984 0.00230551 0.00266631 0.00319636 0.00350472 0.00369007 0.00377125 0.0037827 0.00377044 0.00376391 0.00374708 0.00373308 0.00372344 0.00371868 0.00371732 0.00371864 0.00372269 0.00372938 0.00373811 0.00374837 0.00376005 0.00377342 0.0037889 0.00380698 0.00382785 0.00385162 0.0038788 0.003911 0.00394483 0.00214892 0.00217558 0.00220562 0.00225339 0.00234196 0.00242389 0.00237671 0.00242332 0.00243802 0.00241937 0.00240801 0.00236057 0.00240655 0.00251192 0.00250216 0.00254278 0.00255596 0.00253528 0.00246176 0.00234385 0.00214745 0.00151842 0.0031257 0.00254049 0.00346216 0.00377398 0.00393696 0.003975 0.00393341 0.00388821 0.00381315 0.00376548 0.00373722 0.00371915 0.00370946 0.00370546 0.00370505 0.00370839 0.00371536 0.00372473 0.00373567 0.00374787 0.00376167 0.00377768 0.00379621 0.00381759 0.0038421 0.00387035 0.00390383 0.003939 0.0021089 0.00213681 0.00216612 0.00220089 0.00224312 0.00227093 0.00236793 0.00235769 0.00237453 0.00237168 0.00237894 0.00237284 0.00244245 0.00245398 0.00252458 0.00251099 0.00251538 0.00250277 0.00244462 0.00233735 0.00239553 0.0088302 0.0178968 0.0162745 0.00594994 0.00421778 0.00434283 0.00427096 0.00410871 0.0039357 0.00402825 0.003756 0.00372077 0.0036979 0.00368606 0.00368222 0.00368163 0.00368538 0.00369367 0.00370483 0.00371757 0.003731 0.00374546 0.00376198 0.00378092 0.00380276 0.00382794 0.0038572 0.00389193 0.00392838 0.00206504 0.00209344 0.00212358 0.00215734 0.00219397 0.00222453 0.00225808 0.00229871 0.00232438 0.00233656 0.00235502 0.0023704 0.00240802 0.00244033 0.00256909 0.00255517 0.00248603 0.00247489 0.00242096 0.00225913 0.00582895 0.0158955 0.0161288 0.0151668 0.0133927 0.00533265 0.00491405 0.00463008 0.0042859 0.00397667 0.00404766 0.00380439 0.00367786 0.00365388 0.00364628 0.00364612 0.00364751 0.00365318 0.00366346 0.00367863 0.00369487 0.00371018 0.00372542 0.00374207 0.00376115 0.0037833 0.00380902 0.00383912 0.00387497 0.00391257 0.0020185 0.0020472 0.00207756 0.00211017 0.00214369 0.00217476 0.0022076 0.00224077 0.00227085 0.00229734 0.00232706 0.00237129 0.00241308 0.00263658 0.00275246 0.0025257 0.00251207 0.00251202 0.00249075 0.00241191 0.00628976 0.0163092 0.0151457 0.0148915 0.0144309 0.00612062 0.00545663 0.00495601 0.00437913 0.0039942 0.00384743 0.00396887 0.00360446 0.00358301 0.00358538 0.00359781 0.00360382 0.00361171 0.0036245 0.00364757 0.00366922 0.00368665 0.00370249 0.0037185 0.00373729 0.0037594 0.00378538 0.00381597 0.00385264 0.00389111 0.00196921 0.00199789 0.00202794 0.0020594 0.00209155 0.00212353 0.00215637 0.00218941 0.00222167 0.00225401 0.00229006 0.00233449 0.00236232 0.00271449 0.00275884 0.00252009 0.00256747 0.00262751 0.00270968 0.0028322 0.00334127 0.012984 0.0144389 0.0147406 0.0148676 0.0074335 0.00506764 0.00526566 0.00426464 0.00385893 0.00354245 0.00374824 0.00365486 0.00346218 0.00350848 0.00355103 0.00355266 0.00355345 0.00357227 0.00361194 0.00364335 0.00366225 0.00367731 0.00369113 0.00370907 0.00373119 0.00375703 0.00378764 0.00382463 0.00386343 0.00191705 0.00194552 0.00197516 0.00200599 0.0020377 0.00206994 0.00210303 0.00213699 0.00217154 0.00220756 0.00224722 0.00228615 0.00231924 0.00257569 0.00262724 0.0025195 0.00259942 0.0027031 0.00285037 0.00309279 0.00359017 0.00516704 0.0111622 0.0150217 0.00868668 0.00279768 0.00219913 0.00360324 0.00351872 0.00340851 0.00340823 0.00337756 0.00348282 0.00344493 0.0034327 0.00353573 0.00347133 0.00345703 0.00349632 0.00358385 0.00362244 0.00364024 0.00365097 0.0036599 0.00367629 0.00369794 0.0037235 0.00375398 0.0037907 0.003829 0.00186198 0.00189016 0.00191942 0.00194978 0.00198117 0.00201353 0.00204715 0.00208218 0.00211874 0.00215737 0.00219868 0.00224236 0.00229629 0.00235871 0.00242671 0.00250908 0.00260092 0.00271871 0.00287428 0.00308521 0.00334803 0.00349595 0.00374195 0.00407142 0.00576026 0.00128903 0.00377464 0.00527275 0.00556588 0.00286776 0.00323243 0.00297307 0.00324901 0.00313511 0.00340119 0.00359354 0.00411823 0.00441087 0.00350945 0.00356646 0.00361254 0.00362638 0.00362555 0.00362471 0.00363638 0.00365793 0.00368424 0.00371513 0.00375112 0.00378783 0.00180395 0.00183174 0.00186058 0.00189053 0.00192163 0.001954 0.0019879 0.00202361 0.00206146 0.00210204 0.00214619 0.00219412 0.00224843 0.00231508 0.00238945 0.0024772 0.00259732 0.00270643 0.0028462 0.00302622 0.00323666 0.00347139 0.00377265 0.00448219 0.0051592 0.00412277 0.00502975 0.00632434 0.00717155 0.00377348 0.00275884 0.00296157 0.00291668 0.00308225 0.00312604 0.00370275 0.00414518 0.00422032 0.00358762 0.0036028 0.00363166 0.00362704 0.00360143 0.00358164 0.00358728 0.00360979 0.00363921 0.00367181 0.00370712 0.00374118 0.00174292 0.00177018 0.0017985 0.00182795 0.00185866 0.00189081 0.00192469 0.00196068 0.00199922 0.00204095 0.00208669 0.00213727 0.00219468 0.00226181 0.00233867 0.00242714 0.00252517 0.0026399 0.00277969 0.00294144 0.00316842 0.00334333 0.00357203 0.00389324 0.00411581 0.00385366 0.00425441 0.0077531 0.00909893 0.00410911 0.00228818 0.00260668 0.00278705 0.00300978 0.00306385 0.00394006 0.00406032 0.0039766 0.00362196 0.00365698 0.00367517 0.00364299 0.00357616 0.00352185 0.00351979 0.00354995 0.00358791 0.00362552 0.00366145 0.00369255 0.00167885 0.00170542 0.00173304 0.00176183 0.00179195 0.00182363 0.00185717 0.00189299 0.0019316 0.00197366 0.00201995 0.00207132 0.00212904 0.00219535 0.00227087 0.00235624 0.00245295 0.0025618 0.00268466 0.0028201 0.0029666 0.00312371 0.00327166 0.0034207 0.00347011 0.00328216 0.00286396 0.00475369 0.00729178 0.00268342 0.00196568 0.00240818 0.00266615 0.00283827 0.00291856 0.00398874 0.0041059 0.00358379 0.00365045 0.00373119 0.00375188 0.00369307 0.00355571 0.00342029 0.00341267 0.00347131 0.0035301 0.00357958 0.00361928 0.00364878 0.00161177 0.00163743 0.00166413 0.00169201 0.00172127 0.00175216 0.00178499 0.00182016 0.00185819 0.0018997 0.00194541 0.00199611 0.00205293 0.00211734 0.00218965 0.00227044 0.00236047 0.00245907 0.00256556 0.00267845 0.00279462 0.00290381 0.00299376 0.00306858 0.00305974 0.00291602 0.00260836 0.00219365 0.00191257 0.00169014 0.00208815 0.00239417 0.00260779 0.00276511 0.00286144 0.00300592 0.00324847 0.00354075 0.00367652 0.00385683 0.00392359 0.00378558 0.00350821 0.00317877 0.00321621 0.00338844 0.00347526 0.00354233 0.00358918 0.00362065 0.00154177 0.00156626 0.00159176 0.00161842 0.00164646 0.00167615 0.00170781 0.00174183 0.00177869 0.00181896 0.00186326 0.0019123 0.0019668 0.00202774 0.0020955 0.00217022 0.00225166 0.00233902 0.0024293 0.00252301 0.00261395 0.00269058 0.00274953 0.00278799 0.00276952 0.00272303 0.00256423 0.00231901 0.00213451 0.00209755 0.00225581 0.00244854 0.00261094 0.00275133 0.00287561 0.00302307 0.00322443 0.00353371 0.00368797 0.00411087 0.00431373 0.00408138 0.00748078 0.00487757 0.00309293 0.00332976 0.00345064 0.00352734 0.00358187 0.00361928 0.00146901 0.00149208 0.00151608 0.00154117 0.00156758 0.00159558 0.00162551 0.00165776 0.00169279 0.00173111 0.00177327 0.00181983 0.00187126 0.00192811 0.00199064 0.00205821 0.00213058 0.00220691 0.00228466 0.00236389 0.00243655 0.00248067 0.00247259 0.00301385 0.00364531 0.0028858 0.00259523 0.00238571 0.00227222 0.00226668 0.00236658 0.00249293 0.00261861 0.00273999 0.00285757 0.0029814 0.00305895 0.00425132 0.00382983 0.00455069 0.00502953 0.0055753 0.00749449 0.00759666 0.00366114 0.00344403 0.0034974 0.00355426 0.00360423 0.00364792 0.00139363 0.00141505 0.00143728 0.00146048 0.00148488 0.00151073 0.00153837 0.00156817 0.00160058 0.00163607 0.00167518 0.00171839 0.00176613 0.0018186 0.00187565 0.00193626 0.00199923 0.00206152 0.00212421 0.00220256 0.00227755 0.00229176 0.00300323 0.00355913 0.00348923 0.00324138 0.00286942 0.00237081 0.00231919 0.00233381 0.0024089 0.0025066 0.00261382 0.00272231 0.00282797 0.00294045 0.00309868 0.00336745 0.0034673 0.00438562 0.00549722 0.00621155 0.00689175 0.00714623 0.0036903 0.0035363 0.0035506 0.00358865 0.00363634 0.00368876 0.00131582 0.00133537 0.00135559 0.00137662 0.00139865 0.00142196 0.00144684 0.00147364 0.00150278 0.0015347 0.00156987 0.00160876 0.00165181 0.00169933 0.0017512 0.00180659 0.0018635 0.00191734 0.00198989 0.00207208 0.00214301 0.00219917 0.00268242 0.00330763 0.00323212 0.00319504 0.00317472 0.00253202 0.00228646 0.00233239 0.00240502 0.00249621 0.00259551 0.00269329 0.00278269 0.00286345 0.00295548 0.00310404 0.00451637 0.00871984 0.00755494 0.00681659 0.00683735 0.00622259 0.00376164 0.00360779 0.00359667 0.00361932 0.00366392 0.00372342 0.00123577 0.00125326 0.00127124 0.00128982 0.0013092 0.0013296 0.0013513 0.00137464 0.0014 0.00142781 0.00145853 0.00149259 0.00153038 0.00157225 0.00161859 0.00166952 0.0017245 0.00178289 0.00189247 0.00206367 0.00195597 0.00214567 0.00227112 0.0028106 0.00299431 0.00309998 0.00319702 0.00264157 0.00220277 0.00228709 0.00237064 0.00246343 0.00256807 0.00266337 0.00273644 0.00278183 0.00279003 0.0027201 0.00402966 0.0080432 0.00559203 0.00668984 0.00698262 0.00428519 0.00366047 0.00360079 0.00360025 0.00362444 0.00367196 0.00373702 0.00115367 0.00116894 0.00118448 0.00120039 0.00121683 0.00123401 0.00125217 0.00127161 0.0012927 0.00131589 0.00134167 0.0013705 0.0014028 0.00143886 0.00147914 0.00152408 0.00157368 0.00163146 0.00169193 0.00186567 0.00194477 0.00194097 0.00207368 0.00220533 0.00276278 0.00303494 0.00302478 0.00224667 0.00212742 0.00223262 0.00231776 0.00248841 0.00258707 0.00264456 0.00272516 0.00276341 0.00275405 0.0026219 0.00258972 0.00314025 0.00395852 0.0038014 0.0036295 0.00343712 0.00353535 0.00355094 0.0035705 0.00360541 0.0036581 0.00372681 0.00106977 0.00108267 0.00109561 0.00110867 0.00112195 0.00113564 0.00114994 0.00116512 0.00118153 0.00119962 0.00121993 0.00124301 0.00126936 0.00129934 0.00133318 0.0013714 0.00141445 0.00146325 0.00152001 0.00159025 0.0017313 0.00179574 0.00178155 0.00182027 0.00200639 0.00268171 0.00210588 0.00189124 0.00204253 0.0021796 0.00228206 0.0028408 0.00289527 0.00269188 0.00275651 0.00279725 0.00281784 0.00281509 0.00285495 0.00313654 0.00344316 0.00347518 0.00341382 0.00342969 0.00346945 0.00350074 0.00353237 0.00357216 0.00362701 0.00369688 0.000984319 0.000994742 0.00100497 0.00101503 0.001025 0.001035 0.00104523 0.0010559 0.00106736 0.00108002 0.00109447 0.00111133 0.00113119 0.00115447 0.00118143 0.00121227 0.00124714 0.00128623 0.00132889 0.00137112 0.0014156 0.00149002 0.00150217 0.00152564 0.00149053 0.00151102 0.00158023 0.00175923 0.00197484 0.00215006 0.00230151 0.00262449 0.00280077 0.00281749 0.00278855 0.00284297 0.00288665 0.00292498 0.00298046 0.0031338 0.00330195 0.0033576 0.00336314 0.00339416 0.00342001 0.00345254 0.0034864 0.00352659 0.00358131 0.0036507 0.000897583 0.000905465 0.000912908 0.000919891 0.000926444 0.000932658 0.000938681 0.000944725 0.000951083 0.000958163 0.000966505 0.000976814 0.00098982 0.00100601 0.00102571 0.00104891 0.00107516 0.00110508 0.00113708 0.00116852 0.00119956 0.00122521 0.00125288 0.00127353 0.00126645 0.00128353 0.0013844 0.00160957 0.00191569 0.00214221 0.0023239 0.0025082 0.00270382 0.00284749 0.00276363 0.00288158 0.00293556 0.00298073 0.00303494 0.00313479 0.0032378 0.00328506 0.00330715 0.00333644 0.00336194 0.00340032 0.00342969 0.00346818 0.00352201 0.00358989 0.000809847 0.000815161 0.000819786 0.000823663 0.000826774 0.000829167 0.000830959 0.000832342 0.000833584 0.000835013 0.000837087 0.000840566 0.000846438 0.000855421 0.000868363 0.000883515 0.000901151 0.000922499 0.00094557 0.000969744 0.000992634 0.00101331 0.00102831 0.00102707 0.000993449 0.000955581 0.00108007 0.00139855 0.00189306 0.00217048 0.00233129 0.00248572 0.00260728 0.00283006 0.00289195 0.00291652 0.00298241 0.0030185 0.00306442 0.00312846 0.00319199 0.00322658 0.00324995 0.00327427 0.00329965 0.00332965 0.00335774 0.00339597 0.00344966 0.00351541 0.000721393 0.000724156 0.000725987 0.000726785 0.00072649 0.000725106 0.000722716 0.000719494 0.000715678 0.000711516 0.000707348 0.000703911 0.000702462 0.00070449 0.000710666 0.000719093 0.000728396 0.000741238 0.000755726 0.000774749 0.00079522 0.000810019 0.000812041 0.000789611 0.000711546 0.000450666 0.000643142 0.00104191 0.00202748 0.00228593 0.00235152 0.00245735 0.00257435 0.00279041 0.0029449 0.00306333 0.00302138 0.00303783 0.00307822 0.00311885 0.0031562 0.00316923 0.00318789 0.00320908 0.00322897 0.00329273 0.00327358 0.00331234 0.00336522 0.00342844 0.000632498 0.000632775 0.000631887 0.000629696 0.0006261 0.00062106 0.00061462 0.000606922 0.000598188 0.000588642 0.000578517 0.000568391 0.000559787 0.000554027 0.000547195 0.000673716 0.000555956 0.000564092 0.000569035 0.000586244 0.000609734 0.00062899 0.000631034 0.000597887 0.000520491 0.000997679 0.0117623 0.0111993 0.00309424 0.00248957 0.00236236 0.00241567 0.00252379 0.00262887 0.00279461 0.00317063 0.00312868 0.00301919 0.00309486 0.00310668 0.00317707 0.00313931 0.00312182 0.00313681 0.00315046 0.00317123 0.00318387 0.00321774 0.0032685 0.00332904 0.000543427 0.000541332 0.000537857 0.00053283 0.000526112 0.000517617 0.000507348 0.000495405 0.000481987 0.000467347 0.000451714 0.000435563 0.000419671 0.000406136 0.000399723 0.000393086 0.000389332 0.000422545 0.000397863 0.000406698 0.000442043 0.000476187 0.000496049 0.000481437 0.000388416 0.00941787 0.0122214 0.0118203 0.00964325 0.00292355 0.00225807 0.00227953 0.00239746 0.00256165 0.00272211 0.00279085 0.0033301 0.00311546 0.0031429 0.00311727 0.00332124 0.00327196 0.00307004 0.00306217 0.00305926 0.00306621 0.00308244 0.00311141 0.00315799 0.00321567 0.000454434 0.000450125 0.00044425 0.000436606 0.000427016 0.000415355 0.000401576 0.000385735 0.000367998 0.000348616 0.000327867 0.000306189 0.000284289 0.000263237 0.000244218 0.00023228 0.000218568 0.000205492 0.000205462 0.000232298 0.00029732 0.000366377 0.000424363 0.000460292 0.000378161 0.0107386 0.0110637 0.0112009 0.0110451 0.0050435 0.00188294 0.0019287 0.00217133 0.00245791 0.00271224 0.00285848 0.00297812 0.00303677 0.00313189 0.00315351 0.00332514 0.00302683 0.00302856 0.0029775 0.00294629 0.00294811 0.00296354 0.00299076 0.00303153 0.0030865 0.000365747 0.000359426 0.000351389 0.000341407 0.000329269 0.000314811 0.000297941 0.000278665 0.000257101 0.000233479 0.000208128 0.000181495 0.000154206 0.000127173 0.000101715 7.93118e-05 5.76871e-05 3.90559e-05 1.92156e-05 5.10638e-05 0.000178565 0.000302266 0.000438237 0.000629476 0.00100992 0.00342131 0.00847779 0.0110519 0.0117893 0.00563439 0.00106342 0.00138421 0.00184739 0.00233849 0.00275787 0.00299068 0.00309652 0.00313782 0.00313807 0.00306145 0.00309982 0.00303754 0.00295159 0.00288018 0.00278591 0.00281137 0.00282954 0.00285494 0.0028897 0.0029412 0.000277558 0.000269461 0.000259545 0.000247557 0.000233259 0.00021645 0.000196995 0.000174847 0.00015007 0.000122844 9.34604e-05 6.23312e-05 3.00085e-05 -2.77957e-06 -3.52182e-05 -6.64067e-05 -9.65481e-05 -0.000125651 -0.000159386 0.000306316 0.000727708 0.000270044 0.000371387 0.000567307 0.000973422 0.00183728 0.00412138 0.0124681 0.0120978 0.00148085 5.78872e-05 0.000696945 0.0014438 0.0022428 0.00290628 0.00322533 0.00331859 0.00329805 0.00322531 0.00313018 0.00306247 0.00300404 0.00374371 0.00316278 0.00265227 0.00267295 0.00269064 0.00270566 0.00273592 0.00278001 0.000190002 0.000180393 0.000168913 0.000155295 0.000139278 0.00012063 9.91717e-05 7.48071e-05 4.7537e-05 1.74687e-05 -1.51798e-05 -5.00743e-05 -8.6741e-05 -0.000124542 -0.000162764 -0.000200773 -0.000238813 -0.00027642 -0.000312901 -0.000271767 0.000539796 0.000380217 0.000201687 0.000264014 0.000351318 0.000367083 -0.000289596 1.48274e-07 -0.00103745 -0.00163192 -0.000868772 -5.32726e-05 0.000993624 0.0022281 0.00326501 0.00366443 0.00366753 0.0035178 0.00333915 0.00316481 0.0030178 0.00278387 0.0043276 0.0027216 0.00257271 0.00254496 0.00255197 0.0026116 0.00256405 0.0026062 0.000103151 9.23091e-05 7.96054e-05 6.47645e-05 4.751e-05 2.75838e-05 4.77157e-06 -2.10761e-05 -5.00255e-05 -8.20527e-05 -0.000117034 -0.000154727 -0.000194717 -0.000236357 -0.000278735 -0.000320708 -0.000361209 -0.000398476 -0.00042902 -0.00043777 -0.000344801 0.000113118 3.87201e-05 -7.40905e-05 -0.000198909 -0.000386651 -0.000775437 -0.00127043 -0.00175887 -0.0019817 -0.0017695 -0.00106234 0.000413714 0.0022623 0.00413743 0.00451032 0.00419722 0.00379271 0.00345536 0.00318166 0.00298679 0.00304485 0.00359652 0.00251033 0.0024355 0.00239262 0.00237635 0.00236989 0.00237875 0.00241318 1.70279e-05 5.24009e-06 -8.33667e-06 -2.39765e-05 -4.19612e-05 -6.25643e-05 -8.60314e-05 -0.000112561 -0.000142291 -0.000175291 -0.000211548 -0.000250935 -0.000293123 -0.00033747 -0.0003829 -0.000427797 -0.000469943 -0.000505996 -0.000529508 -0.00052683 -0.000479273 -0.000400959 -0.000168464 -0.000173922 -0.000643858 -0.000889069 -0.00124566 -0.00175047 -0.00228021 -0.00281355 -0.00327756 -0.00297407 -0.000291077 0.00589124 0.00645009 0.00599197 0.0048555 0.00404196 0.00349812 0.0031034 0.0028547 0.00346709 0.00265106 0.00234799 0.00225966 0.00220959 0.00218143 0.00216874 0.00217207 0.00219815 -6.83735e-05 -8.0824e-05 -9.4925e-05 -0.000110936 -0.000129131 -0.000149787 -0.000173172 -0.000199526 -0.000229059 -0.000261941 -0.000298294 -0.00033814 -0.000381302 -0.000427249 -0.000474933 -0.000522621 -0.000567745 -0.000606499 -0.0006332 -0.000639223 -0.000615899 -0.000588241 -0.00033252 -0.000188646 -0.000860913 -0.00124994 -0.00160131 -0.00213214 -0.00283348 -0.00380402 -0.00539511 -0.00427479 0.00852669 0.0106032 0.012421 0.00786317 0.00535959 0.00408858 0.00337987 0.00283273 0.0027283 0.00344539 0.00203251 0.00207678 0.00202432 0.00198714 0.00196154 0.00194639 0.00194255 0.00195849 -0.000153096 -0.000165943 -0.000180234 -0.000196199 -0.000214089 -0.000234169 -0.000256711 -0.000281986 -0.000310268 -0.00034183 -0.000376946 -0.000415829 -0.000458531 -0.000504777 -0.000553776 -0.000604055 -0.000653334 -0.000698408 -0.000735049 -0.000758791 -0.000768068 -0.000776941 -0.000798294 -0.000355864 -0.000931175 -0.00142294 -0.00171175 -0.00220003 -0.0029478 -0.00406488 -0.00592067 0.0138447 0.0374839 0.0196114 0.0108194 0.00749354 0.00491962 0.00342959 0.00295249 0.00222585 0.0027782 0.00257295 0.00186744 0.00180129 0.00176813 0.00174261 0.00172076 0.00170412 0.00169456 0.00169863 -0.000237258 -0.000250263 -0.00026444 -0.000279971 -0.000297066 -0.000315956 -0.000336892 -0.000360154 -0.000386059 -0.000414976 -0.000447329 -0.000483556 -0.000524008 -0.000568793 -0.000617581 -0.000669428 -0.000722657 -0.000774791 -0.0008225 -0.000861835 -0.000891589 -0.000924159 -0.000990588 -0.00105379 -0.00121384 -0.00133883 -0.00154402 -0.00186688 -0.00238522 -0.00312202 -0.00365949 0.0214573 0.0347607 0.0268785 0.0229866 0.0252393 0.020761 0.00239234 0.00229821 0.00194566 0.00239145 0.00139959 0.00149345 0.0014651 0.00147799 0.0014741 0.00146221 0.00144773 0.00143348 0.00142587 -0.000321089 -0.000334061 -0.000347867 -0.00036263 -0.000378492 -0.000395619 -0.000414214 -0.000434527 -0.000456879 -0.0004817 -0.000509541 -0.000541065 -0.000576972 -0.000617852 -0.000664021 -0.000715324 -0.00077093 -0.000829116 -0.000886487 -0.000937238 -0.000971322 -0.000992021 -0.0010182 -0.00104804 -0.00109596 -0.00113642 -0.00117869 -0.00125365 -0.00135982 -0.00147949 -0.00165334 0.0114972 0.0164109 0.0251324 0.0253752 0.0263772 0.0271044 0.0158607 0.000156056 0.00082996 0.00162364 0.00101869 0.00108862 0.00115159 0.00118587 0.00119935 0.00119674 0.00118489 0.00116662 0.00114854 -0.000404916 -0.000417722 -0.000430974 -0.000444711 -0.000458983 -0.00047386 -0.000489451 -0.000505923 -0.00052354 -0.000542716 -0.000564067 -0.000588435 -0.000616856 -0.00065048 -0.000690447 -0.000737718 -0.000792778 -0.000855126 -0.000921748 -0.000983444 -0.00101405 -0.00101066 -0.000990213 -0.000966422 -0.000927128 -0.00085362 -0.00073177 -0.000529477 -0.000179607 0.000458882 0.00191405 0.00733578 0.0124559 0.022555 0.0255962 0.0274696 0.0297456 0.0264779 -0.0011938 -0.000115666 0.000318713 0.000608276 0.000792776 0.000872388 0.000911525 0.00093118 0.000933794 0.000923288 0.00090121 0.000874197 -0.000488669 -0.000501243 -0.000513837 -0.000526385 -0.000538819 -0.000551077 -0.000563121 -0.000574966 -0.000586726 -0.000598687 -0.000611393 -0.00062573 -0.000642972 -0.000664812 -0.000693365 -0.00073111 -0.000780635 -0.000844387 -0.000922322 -0.00100547 -0.00103843 -0.000996591 -0.000932066 -0.000846664 -0.000736198 -0.000575451 -0.000353733 -6.69016e-06 0.00055085 0.00144882 0.00320187 0.00687188 0.0085013 0.0243707 0.0269878 0.0281665 0.0277141 0.00512617 -1.83742e-05 0.000277925 0.000330065 0.000461073 0.000561977 0.000624388 0.000658849 0.000675868 0.000678575 0.000667743 0.000642113 0.000608322 -0.000570891 -0.000583215 -0.000595111 -0.000606395 -0.000616856 -0.000626262 -0.000634373 -0.000640966 -0.000645889 -0.000649135 -0.000650964 -0.00065204 -0.000653603 -0.000657674 -0.00066732 -0.00068685 -0.000722195 -0.000783587 -0.000887339 -0.00103862 -0.00109931 -0.000997272 -0.000851946 -0.000726629 -0.000585609 -0.000381466 -0.00012675 0.000215408 0.000678309 0.00128263 0.00207508 0.00278859 0.0018878 0.00696592 0.0277062 0.0122556 0.0127112 0.00015796 0.000220453 0.000254178 0.000258345 0.000311725 0.000361403 0.000395394 0.00041577 0.00042614 0.000426543 0.000415343 0.000388291 0.00035216 -0.000653027 -0.000665206 -0.000676514 -0.00068664 -0.000695212 -0.000701794 -0.00070589 -0.000706954 -0.000704429 -0.000697811 -0.000686776 -0.000671349 -0.000652193 -0.000631038 -0.000611341 -0.000599096 -0.000604752 -0.000654209 -0.000811646 -0.00115276 -0.00129562 -0.00104355 -0.000802086 -0.000592286 -0.000378048 0.000487813 0.000140504 0.000269919 0.000570293 0.00080815 0.000914492 0.0011168 4.54307e-06 -0.00158122 -0.000785803 -0.000475438 -7.07864e-05 -6.12917e-06 0.000113928 0.00014503 0.000144641 0.000155137 0.000162696 0.00016754 0.000170526 0.000171251 0.000168664 0.000160048 0.000138944 0.000109694 -0.000762625 -0.000775409 -0.000786927 -0.000796742 -0.000804318 -0.000809007 -0.000810026 -0.000806448 -0.000797202 -0.000781093 -0.000756879 -0.000723422 -0.000679994 -0.000626873 -0.000566457 -0.000505232 -0.000457595 -0.000462769 -0.000634471 -0.00122176 -0.00119011 -0.000826928 -0.000562024 -0.000344476 -0.000169031 0.000483327 0.000716154 0.000334284 0.000386861 0.000369078 0.000285223 0.000236391 0.000143074 0.00011489 0.000798181 0.000477261 0.000582689 0.000338701 0.000200937 0.000112922 5.6079e-05 2.27375e-05 -1.87162e-06 -1.92675e-05 -2.96356e-05 -3.5625e-05 -3.78827e-05 -3.79932e-05 -4.06623e-05 -5.05184e-05 ) ; boundaryField { leftWall { type calculated; value nonuniform List<scalar> 100 ( 0.00241111 0.00241183 0.00241243 0.00241247 0.00241173 0.00241014 0.00240772 0.0024045 0.00240057 0.00239598 0.00239084 0.00238521 0.00237917 0.00237278 0.00236613 0.00235924 0.00235217 0.00234494 0.00233757 0.00233005 0.00232236 0.00231446 0.00230629 0.00229778 0.00228884 0.00227937 0.00226929 0.0022585 0.00224693 0.00223451 0.0022212 0.00220696 0.00219177 0.00217565 0.0021586 0.00214064 0.00212181 0.00210215 0.00208168 0.00206044 0.00203846 0.00201578 0.0019924 0.00196835 0.00194362 0.00191823 0.00189215 0.00186539 0.00183793 0.00180974 0.0017808 0.0017511 0.00172061 0.00168932 0.0016572 0.00162425 0.00159046 0.00155581 0.00152032 0.00148399 0.00144683 0.00140885 0.00137007 0.00133051 0.00129021 0.00124919 0.0012075 0.00116517 0.00112224 0.00107877 0.0010348 0.000990401 0.00094562 0.000900523 0.000855178 0.000809658 0.000764038 0.000718402 0.000672839 0.000627443 0.000582319 0.000537579 0.000493343 0.000449746 0.000406929 0.000365049 0.000324276 0.000284796 0.000246811 0.000210541 0.000176225 0.000144123 0.00011452 8.77246e-05 6.40678e-05 4.38991e-05 2.75937e-05 1.55265e-05 7.70899e-06 1.51591e-06 ) ; } rightWall { type calculated; value nonuniform List<scalar> 100 ( 0.00325952 0.00325909 0.0032594 0.0032608 0.0032633 0.00326681 0.00327122 0.0032764 0.00328222 0.00328856 0.00329528 0.00330228 0.00330943 0.00331663 0.00332376 0.00333071 0.00333735 0.00334355 0.00334918 0.0033541 0.00335819 0.00336133 0.00336346 0.00336456 0.00336468 0.00336399 0.00336273 0.00336125 0.00335997 0.00335937 0.00335993 0.00336218 0.0033667 0.00337408 0.00338484 0.00339927 0.00341743 0.00343906 0.00346371 0.00349079 0.00351965 0.0035497 0.0035804 0.00361133 0.00364216 0.00367263 0.00370253 0.00373168 0.00375991 0.00378704 0.00381287 0.00383718 0.00385974 0.00388029 0.00389859 0.00391435 0.0039273 0.00393714 0.00394356 0.00394623 0.00394483 0.003939 0.00392838 0.00391257 0.00389111 0.00386343 0.003829 0.00378783 0.00374118 0.00369255 0.00364878 0.00362065 0.00361928 0.00364792 0.00368876 0.00372342 0.00373702 0.00372681 0.00369688 0.0036507 0.00358989 0.00351541 0.00342844 0.00332904 0.00321567 0.0030865 0.0029412 0.00278001 0.0026062 0.00241318 0.00219815 0.00195849 0.00169863 0.00142587 0.00114854 0.000874197 0.000608322 0.00035216 0.000109694 -5.05184e-05 ) ; } lowerWall { type calculated; value nonuniform List<scalar> 100 ( 0.00241111 0.00241037 0.00240976 0.00240969 0.00241038 0.00241189 0.00241421 0.00241728 0.00242102 0.00242535 0.00243018 0.00243543 0.00244101 0.00244684 0.00245285 0.00245897 0.00246514 0.00247128 0.00247734 0.00248326 0.00248898 0.00249447 0.00249969 0.00250464 0.00250934 0.00251382 0.00251819 0.00252252 0.00252697 0.00253165 0.00253671 0.00254226 0.00254838 0.00255512 0.0025625 0.00257052 0.00257921 0.00258859 0.00259872 0.00260963 0.00262135 0.00263383 0.00264701 0.0026608 0.00267507 0.00268971 0.00270461 0.00271967 0.0027348 0.00274994 0.00276504 0.0027801 0.00279509 0.00281002 0.0028249 0.00283974 0.00285455 0.00286932 0.00288403 0.00289866 0.00291314 0.00292741 0.00294138 0.00295497 0.00296811 0.00298078 0.00299298 0.00300479 0.00301632 0.00302766 0.00303889 0.00305006 0.00306118 0.00307229 0.00308345 0.00309466 0.00310586 0.00311697 0.00312788 0.00313849 0.00314873 0.00315858 0.00316803 0.00317709 0.00318579 0.00319414 0.00320217 0.00320987 0.00321725 0.00322428 0.00323093 0.00323713 0.0032428 0.00324786 0.00325219 0.00325566 0.00325815 0.00325958 0.00325992 0.00325952 ) ; } atmosphere { type calculated; value nonuniform List<scalar> 100 ( -3.96972e-07 -3.59718e-06 -1.0038e-05 -1.97587e-05 -3.27348e-05 -4.88287e-05 -6.77688e-05 -8.91556e-05 -0.000112489 -0.000137213 -0.000162761 -0.000188601 -0.000214273 -0.000239406 -0.000263727 -0.000287061 -0.000309314 -0.000330462 -0.000350534 -0.000369596 -0.000387735 -0.000405051 -0.000421649 -0.00043763 -0.000453092 -0.000468124 -0.000482808 -0.000497217 -0.000511419 -0.000525472 -0.000539431 -0.000553345 -0.000567258 -0.000581212 -0.000595245 -0.000609393 -0.00062369 -0.000638164 -0.000652842 -0.000667745 -0.000682887 -0.000698274 -0.000713901 -0.00072975 -0.000745784 -0.000761944 -0.000778146 -0.000794275 -0.000810175 -0.000825648 -0.000840442 -0.000854241 -0.000866654 -0.000877196 -0.000885273 -0.000890153 -0.000890937 -0.000886527 -0.000875589 -0.000856528 -0.000827483 -0.000786367 -0.000730999 -0.000659375 -0.000570161 -0.000463494 -0.000342183 -0.000213543 -9.18126e-05 -7.80675e-06 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ) ; } defaultFaces { type empty; } } // ************************************************************************* //
[ "stig.m.nilsen@gmail.com" ]
stig.m.nilsen@gmail.com
4712103be0a599157057a99368a8e78ae5c01f97
c4537de39f9a35c5e96df6203aa8df4aca725235
/Server.h
77c87e55fb3f2f055b25a169d353247162d29e4a
[]
no_license
galsnir/Flight-Simulator-Part-1
a625cd60952310f056bb928442a66a18e95518fb
5dace7d017ac4ea0ad2d664f1141daeb5bc63e89
refs/heads/master
2020-04-14T00:44:52.306278
2018-12-29T21:14:26
2018-12-29T21:14:26
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,720
h
#ifndef SIMULATOR1_SERVER_H #define SIMULATOR1_SERVER_H #include "Parser.h" struct ArgumentForServerRunning { double portNum; double frequency; Parser* parser; }; struct ArgumentForVarUpdating { string buffer; Parser* parser; }; class Server { public: /** * Method is created to run in it's own thread, hence it created static. It creates * server, and accepts connection from FlightGear simulator, using regular procedure * for such aims. Then, when connection initialized, it enters while loop, where it * reads buffer of socket, where stored all new values for variables, that appear in * xml file. Then it calls for another method, that sends this valies to our program. * Each iteration, it calls method "checkServerClose" that returns true, if it needed * to break loop, and end thread. * @param arg - set of arguments. * @return - void pointer. */ static void* runServer(void* arg); /** * Method creates map of path and updated value, and sends it to parser. To gain this, * it creates map of updated variables, that it readed from socket, using method "split line" * of class Lexer, map orderXml, that holds path, and order that this path appears in xml file. * Then it gets from parses map of binded values, and manipulating with this three maps allow * us to get reulting map with path of variables, that needed to update (that defined in out * program, and binded to these paths), and new values, that we got ftom FlightGear simulator. * @param argument - struct of arguments. * @return - pointer to void. */ static void* updateVariables(void* argument); }; #endif //SIMULATOR1_SERVER_H
[ "noreply@github.com" ]
galsnir.noreply@github.com
40433aeee183791c04f66a4ab594e54cdeb8ffb9
8301dd556b87b1ccaa0b903f17c3132bb2d449e7
/mortgagewindow.cpp
17072be9abf20efcdf6f54ca99928cfd4116f022
[]
no_license
WisdomStoneWorshiper/comp2012h_project
30c21e35a372466df593734a9f23c0c1ca0834b6
1bdd81dfed3ed24f2a0bcb0809f6e41307ee926f
refs/heads/master
2022-03-19T22:46:11.648172
2019-12-16T01:24:52
2019-12-16T01:24:52
224,777,999
0
0
null
null
null
null
UTF-8
C++
false
false
4,536
cpp
#include "mortgagewindow.h" #include "ui_mortgagewindow.h" //convension constructor MortgageWindow::MortgageWindow(const vector<Player *> &playerList, const vector<Box *> &gameField, QWidget *parent) : QDialog(parent), ui(new Ui::MortgageWindow) { ui->setupUi(this); this->playerList = playerList; this->gameField = gameField; } //destructor MortgageWindow::~MortgageWindow() { delete ui; playerList.clear(); gameField.clear(); } //initalize the class void MortgageWindow::init(Player *currentPlayer) { this->currentPlayer = currentPlayer; ui->mortgageList->clear(); ui->mortgageList->setEnabled(false); ui->confirmBtn->setEnabled(false); } //action will be performed when apply radio button is clicked void MortgageWindow::on_applyBtn_clicked() { ui->mortgageList->clear(); ui->payBtn->setChecked(false); ui->applyBtn->setChecked(true); //find property owned by the user for (vector<Box *>::const_iterator box = gameField.begin(); box != gameField.end(); ++box) { if (typeid(*(*box)) == typeid(BuildableProperty) || typeid(*(*box)) == typeid(Restaurant)) { Property *currentProperty = static_cast<Property *>(*box); //if current player own this property, and that property is not in mortgage, add to the combobox if (currentProperty->getOwnerId() == currentPlayer->getId() && currentProperty->getMortgage() == false) { ui->mortgageList->addItem(currentProperty->getName()); } } } ui->mortgageList->setEnabled(true); } //action will be performed when pay radio button is clicked void MortgageWindow::on_payBtn_clicked() { ui->mortgageList->clear(); ui->payBtn->setChecked(true); ui->applyBtn->setChecked(false); for (vector<Box *>::const_iterator box = gameField.begin(); box != gameField.end(); ++box) { //find property owned by the user if (typeid(*(*box)) == typeid(BuildableProperty) || typeid(*(*box)) == typeid(Restaurant)) { Property *currentProperty = static_cast<Property *>(*box); //if current player own this property, and that property is in mortgage, add to the combobox if (currentProperty->getOwnerId() == currentPlayer->getId() && currentProperty->getMortgage() == true) { ui->mortgageList->addItem(currentProperty->getName()); } } } ui->mortgageList->setEnabled(true); } //action will be performed when mortgage list comboBox is clicked void MortgageWindow::on_mortgageList_activated(const QString &targetName) { vector<Box *>::const_iterator target = find_if(gameField.begin(), gameField.end(), [&](Box *t) { return t->getName().compare(targetName) == 0; }); targetProperty = static_cast<Property *>(*target); //if the apply radio button is clicked, so the cooresponding message if (ui->applyBtn->isChecked() == true) { ui->mortgageMessage->setText("After apply, you can get $" + QString::number(targetProperty->getPropertyPrice() / 2)); ui->confirmBtn->setEnabled(true); } else if (ui->payBtn->isChecked() == true) //if the apply radio button is clicked, ceck whether current player has enough money to pay the mortgage { if (currentPlayer->getMoney() < targetProperty->getPropertyPrice() / 2 * 1.1) { //if no, so the cooresponding message ui->mortgageMessage->setText("You need $" + QString::number(targetProperty->getPropertyPrice() / 2 * 1.1) + "\nYou do not have enough money"); } else { //if yes, so the cooresponding message ui->mortgageMessage->setText("You need $" + QString::number(targetProperty->getPropertyPrice() / 2 * 1.1) + "\nYou can return the mortgage"); ui->confirmBtn->setEnabled(true); } } } //action will be performed when comfirm button is clicked void MortgageWindow::on_confirmBtn_clicked() { //call the signal depends on which radio button is clicked, then close this window if (ui->applyBtn->isChecked() == true) doMortgage(targetProperty, Apply); else if (ui->payBtn->isChecked() == true) doMortgage(targetProperty, Pay); this->close(); } //action will be performed when cancel button is clicked void MortgageWindow::on_cancelBtn_clicked() { this->close(); }
[ "klloaj@connect.ust.hk" ]
klloaj@connect.ust.hk
65070e09099f8d43d3726d25192bbc619e189a05
5c8a0d7752e7c37e207f28a7e03d96a5011f8d68
/MapTweet/iOS/Classes/Native/mscorlib_System_Array_InternalEnumerator_1_gen844404404.h
f7d47eb8180e2fa5bda5f4916f16c168df0e38e2
[]
no_license
anothercookiecrumbles/ar_storytelling
8119ed664c707790b58fbb0dcf75ccd8cf9a831b
002f9b8d36a6f6918f2d2c27c46b893591997c39
refs/heads/master
2021-01-18T20:00:46.547573
2017-03-10T05:39:49
2017-03-10T05:39:49
84,522,882
1
0
null
null
null
null
UTF-8
C++
false
false
1,454
h
#pragma once #include "il2cpp-config.h" #ifndef _MSC_VER # include <alloca.h> #else # include <malloc.h> #endif #include <stdint.h> // System.Array struct Il2CppArray; #include "mscorlib_System_ValueType3507792607.h" #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // System.Array/InternalEnumerator`1<OnlineMapsBingMapsElevationResult/Resource> struct InternalEnumerator_1_t844404404 { public: // System.Array System.Array/InternalEnumerator`1::array Il2CppArray * ___array_0; // System.Int32 System.Array/InternalEnumerator`1::idx int32_t ___idx_1; public: inline static int32_t get_offset_of_array_0() { return static_cast<int32_t>(offsetof(InternalEnumerator_1_t844404404, ___array_0)); } inline Il2CppArray * get_array_0() const { return ___array_0; } inline Il2CppArray ** get_address_of_array_0() { return &___array_0; } inline void set_array_0(Il2CppArray * value) { ___array_0 = value; Il2CppCodeGenWriteBarrier(&___array_0, value); } inline static int32_t get_offset_of_idx_1() { return static_cast<int32_t>(offsetof(InternalEnumerator_1_t844404404, ___idx_1)); } inline int32_t get_idx_1() const { return ___idx_1; } inline int32_t* get_address_of_idx_1() { return &___idx_1; } inline void set_idx_1(int32_t value) { ___idx_1 = value; } }; #ifdef __clang__ #pragma clang diagnostic pop #endif
[ "priyanjana@mac.com" ]
priyanjana@mac.com
15b2f28911e1840477d645e5b45823e575117da3
52ca17dca8c628bbabb0f04504332c8fdac8e7ea
/boost/spirit/repository/include/qi_directive.hpp
32b39681361c2ecd34e4d42ddfdb8f6792661a56
[]
no_license
qinzuoyan/thirdparty
f610d43fe57133c832579e65ca46e71f1454f5c4
bba9e68347ad0dbffb6fa350948672babc0fcb50
refs/heads/master
2021-01-16T17:47:57.121882
2015-04-21T06:59:19
2015-04-21T06:59:19
33,612,579
0
0
null
2015-04-08T14:39:51
2015-04-08T14:39:51
null
UTF-8
C++
false
false
84
hpp
#include "thirdparty/boost_1_58_0/boost/spirit/repository/include/qi_directive.hpp"
[ "qinzuoyan@xiaomi.com" ]
qinzuoyan@xiaomi.com
132fd17b58bc154aad4a69efafb91c106a0b28a6
7f56bb80de8179d33f51ea42fbc6677b5e1fc678
/macloader/macloader.cpp
91f9a20d83ccfd9d64b08485675828339bcc340c
[]
no_license
AndroidForWave/android_hardware_samsung
fed0d074cfbb6d38a6e2f5e26be6a0a6eb2810b7
21bdac9b94bd24df6e394e23418de3eab54313a5
refs/heads/master
2021-01-01T06:00:41.100845
2013-09-09T18:12:19
2013-09-09T18:12:19
null
0
0
null
null
null
null
UTF-8
C++
false
false
4,155
cpp
/* * Copyright (C) 2012, The CyanogenMod Project * Daniel Hillenbrand <codeworkx@cyanogenmod.com> * Marco Hillenbrand <marco.hillenbrand@googlemail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/stat.h> #include <cutils/log.h> #define LOG_TAG "macloader" #define LOG_NDEBUG 0 #define MACADDR_PATH "/efs/wifi/.mac.info" #define CID_PATH "/data/.cid.info" enum Type { NONE, MURATA, SEMCOSH, SEMCOVE }; /* * murata: * 00:37:6d * 88:30:8a * * semcosh: * 5c:0a:5b * */ int main() { FILE* file; FILE* cidfile; char* str; char mac_addr_half[9]; int ret = -1; int amode; enum Type type = NONE; /* open mac addr file */ file = fopen(MACADDR_PATH, "r"); if(file == 0) { fprintf(stderr, "open(%s) failed\n", MACADDR_PATH); LOGE("Can't open %s\n", MACADDR_PATH); return -1; } /* get and compare mac addr */ str = fgets(mac_addr_half, 9, file); if(str == 0) { fprintf(stderr, "fgets() from file %s failed\n", MACADDR_PATH); LOGE("Can't read from %s\n", MACADDR_PATH); return -1; } /* murata */ if(strncasecmp(mac_addr_half, "00:37:6d", 9) == 0 || strncasecmp(mac_addr_half, "88:30:8a", 9) == 0 || strncasecmp(mac_addr_half, "20:02:af", 9) == 0) { type = MURATA; } /* semcosh */ if(strncasecmp(mac_addr_half, "5c:0a:5b", 9) == 0) { type = SEMCOSH; } if (type != NONE) { /* open cid file */ cidfile = fopen(CID_PATH, "w"); if(cidfile == 0) { fprintf(stderr, "open(%s) failed\n", CID_PATH); LOGE("Can't open %s\n", CID_PATH); return -1; } switch(type) { case NONE: return -1; break; case MURATA: /* write murata to cid file */ LOGI("Writing murata to %s\n", CID_PATH); ret = fputs("murata", cidfile); break; case SEMCOSH: /* write semcosh to cid file */ LOGI("Writing semcosh to %s\n", CID_PATH); ret = fputs("semcosh", cidfile); break; case SEMCOVE: /* write semcove to cid file */ LOGI("Writing semcove to %s\n", CID_PATH); ret = fputs("semcove", cidfile); break; } if(ret != 0) { fprintf(stderr, "fputs() to file %s failed\n", CID_PATH); LOGE("Can't write to %s\n", CID_PATH); return -1; } fclose(cidfile); /* set permissions on cid file */ LOGD("Setting permissions on %s\n", CID_PATH); amode = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH; ret = chmod(CID_PATH, amode); char* chown_cmd = (char*) malloc(strlen("chown system ") + strlen(CID_PATH)); char* chgrp_cmd = (char*) malloc(strlen("chgrp system ") + strlen(CID_PATH)); sprintf(chown_cmd, "chown system %s", CID_PATH); sprintf(chgrp_cmd, "chgrp system %s", CID_PATH); system(chown_cmd); system(chgrp_cmd); if(ret != 0) { fprintf(stderr, "chmod() on file %s failed\n", CID_PATH); LOGE("Can't set permissions on %s\n", CID_PATH); return ret; } } else { /* delete cid file if no specific type */ LOGD("Deleting file %s\n", CID_PATH); remove(CID_PATH); } fclose(file); return 0; }
[ "adis1313@ubuntu.(none)" ]
adis1313@ubuntu.(none)
2974ad87e17c1f0dc472e186cbb6865c67f5cbdd
a0a6d0b3026f903b72aefce16705d1278f72b01e
/src/utility/x11_Utility.cpp
40faa69735e09b1ab3cfb0afa82e29edd4292264
[ "MIT" ]
permissive
FunkyCat/bakge
90b35cb56fd85472dad9d13d2fa204ea267c0b2c
3cd9ef1c14ae7882b94214d5ec652c498b94f128
refs/heads/master
2021-01-18T05:56:11.400488
2013-07-02T22:39:59
2013-07-02T22:39:59
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,372
cpp
/* * * The MIT License (MIT) * * Copyright (c) 2013 Paul Holden et al. (See AUTHORS) * * 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 <bakge/Bakge.h> namespace bakge { timespec StartTime; Result PlatformInit(int argc, char* argv[]) { clock_gettime(CLOCK_MONOTONIC, &StartTime); return BGE_SUCCESS; } } /* bakge */
[ "paulholden2@gmail.com" ]
paulholden2@gmail.com
63f650c13384c6cd51c21b2e96e75a1f12cb9bc1
38b9daafe39f937b39eefc30501939fd47f7e668
/tutorials/2WayCouplingOceanWave3D/basicTutorialwtProbesResultsWtPhiCoupled/20/p_rgh
4cf02ccd6eb89c3d266a23e80133f7e4b135dac8
[]
no_license
rubynuaa/2-way-coupling
3a292840d9f56255f38c5e31c6b30fcb52d9e1cf
a820b57dd2cac1170b937f8411bc861392d8fbaa
refs/heads/master
2020-04-08T18:49:53.047796
2018-08-29T14:22:18
2018-08-29T14:22:18
null
0
0
null
null
null
null
UTF-8
C++
false
false
196,450
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 3.0.1 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; location "20"; object p_rgh; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [1 -1 -2 0 0 0 0]; internalField nonuniform List<scalar> 21420 ( -228.161 -246.158 -262.56 -277.323 -290.416 -301.877 -311.739 -320.045 -326.829 -332.127 -335.981 -338.383 -339.304 -338.614 -336.511 -332.933 -327.897 -321.387 -313.355 -303.763 -292.566 -279.702 -265.124 -248.791 -230.663 -210.721 -188.951 -165.353 -139.968 -112.856 -84.0994 -53.8282 -22.2556 10.354 43.3425 77.3258 111.71 146.045 179.906 212.907 244.611 274.61 302.486 327.846 350.353 369.69 385.577 397.792 406.17 410.597 410.944 407.268 399.594 387.977 372.632 353.793 331.708 306.68 279.059 249.232 217.598 184.556 150.526 115.924 81.1452 46.6548 13.8564 -19.3068 -51.4991 -82.4175 -111.864 -139.694 -165.799 -190.105 -212.555 -233.113 -251.777 -268.541 -283.407 -296.406 -307.567 -316.911 -324.472 -330.303 -334.455 -336.957 -337.832 -337.097 -334.842 -331.113 -325.947 -319.374 -311.41 -302.056 -291.308 -279.151 -265.553 -250.478 -233.894 -215.77 -196.075 -174.796 -151.943 -127.544 -101.648 -74.3366 -45.722 -15.948 14.8159 46.4177 78.5 110.852 143.18 175.163 206.457 236.697 265.505 292.496 317.283 339.49 358.757 374.755 387.189 395.82 400.466 400.94 397.29 389.526 377.681 361.95 342.557 319.795 294.01 265.588 234.953 202.552 168.847 134.299 99.3664 64.487 30.0755 -3.49649 -35.9018 -66.8662 -96.1722 -123.658 -149.216 -172.79 -194.365 -213.964 -231.628 -247.428 -261.444 -273.759 -284.458 -293.625 -301.338 -307.662 -312.658 -316.373 -318.848 -320.091 -320.107 -318.934 -316.54 -312.914 -308.021 -301.826 -294.288 -285.351 -274.96 -263.052 -249.563 -234.435 -217.607 -199.034 -178.693 -156.563 -132.659 -107.03 -79.7526 -50.9433 -20.7636 10.5855 42.8928 75.7915 108.995 142.144 174.849 206.705 237.293 266.197 293.006 317.329 338.807 357.113 371.967 383.145 390.478 393.844 393.219 388.615 380.16 367.937 352.17 333.105 311.031 286.277 259.194 230.157 199.55 167.762 135.175 102.162 69.0759 36.2488 3.98426 -27.4468 -57.807 -86.8947 -114.544 -140.623 -165.032 -187.702 -208.589 -227.674 -244.952 -260.434 -274.143 -286.109 -296.356 -304.926 -311.854 -317.162 -320.916 -323.119 -323.765 -322.972 -320.726 -317.044 -311.949 -305.458 -297.578 -288.311 -277.66 -265.618 -252.173 -237.311 -221.009 -203.238 -183.975 -163.194 -140.877 -117.031 -91.6777 -64.8646 -36.6798 -7.25188 23.2644 54.6476 86.6161 118.881 151.099 182.889 213.847 243.548 271.561 297.463 320.845 341.333 358.591 372.324 382.313 388.403 390.457 388.559 382.69 372.943 359.451 342.51 322.411 299.449 273.98 246.411 217.144 186.555 155.046 123.027 90.8351 58.7856 27.3313 -2.71461 -32.331 -61.0527 -88.6265 -114.907 -139.787 -163.177 -185.023 -205.284 -223.932 -240.946 -256.311 -270.022 -282.073 -292.467 -301.208 -308.311 -313.792 -317.675 -319.933 -320.587 -319.623 -317.105 -313.027 -307.377 -300.177 -291.412 -281.073 -269.168 -255.683 -240.616 -223.981 -205.782 -186.048 -164.811 -142.116 -118.038 -92.6699 -66.1016 -38.4398 -9.86083 17.7488 47.4884 77.5032 107.571 137.416 166.758 195.339 222.838 248.936 273.336 295.71 315.771 333.219 347.812 359.341 367.613 372.503 373.864 371.49 365.329 355.537 342.298 325.793 306.357 284.372 -228.237 -246.232 -262.632 -277.393 -290.484 -301.942 -311.802 -320.106 -326.888 -332.185 -336.037 -338.439 -339.365 -338.672 -336.567 -332.991 -327.956 -321.447 -313.417 -303.829 -292.634 -279.773 -265.198 -248.867 -230.741 -210.801 -189.032 -165.435 -140.05 -112.937 -84.1772 -53.9013 -22.3218 10.2964 43.2906 77.2862 111.685 146.035 179.914 212.932 244.654 274.672 302.566 327.942 350.465 369.817 385.715 397.939 406.325 410.756 411.106 407.418 399.741 388.117 372.762 353.908 331.809 306.763 279.125 249.279 217.627 184.567 150.52 115.902 81.1072 46.6 13.806 -19.3708 -51.572 -82.4963 -111.947 -139.779 -165.885 -190.192 -212.642 -233.2 -251.862 -268.626 -283.49 -296.488 -307.648 -316.99 -324.551 -330.382 -334.533 -337.032 -337.902 -337.169 -334.913 -331.184 -326.017 -319.444 -311.481 -302.128 -291.382 -279.226 -265.63 -250.558 -233.975 -215.853 -196.161 -174.882 -152.03 -127.63 -101.732 -74.4178 -45.7991 -16.0194 14.7518 46.3613 78.4538 110.817 143.158 175.155 206.465 236.721 265.546 292.556 317.361 339.584 358.868 374.88 387.326 395.967 400.624 401.092 397.441 389.673 377.82 362.077 342.669 319.89 294.087 265.645 234.989 202.569 168.844 134.278 99.3276 64.4328 30.008 -3.5751 -35.9891 -66.96 -96.27 -123.758 -149.316 -172.889 -194.462 -214.057 -231.718 -247.514 -261.526 -273.836 -284.531 -293.695 -301.405 -307.726 -312.72 -316.434 -318.908 -320.148 -320.167 -318.994 -316.6 -312.975 -308.084 -301.891 -294.355 -285.421 -275.033 -263.128 -249.642 -234.517 -217.691 -199.121 -178.781 -156.653 -132.748 -107.118 -79.8378 -51.024 -20.8378 10.5196 42.8361 75.7472 108.965 142.129 174.851 206.724 237.331 266.254 293.081 317.422 338.915 357.236 372.101 383.288 390.628 394.002 393.368 388.76 380.299 368.066 352.287 333.207 311.118 286.347 259.247 230.193 199.569 167.764 135.162 102.135 69.0361 36.1979 3.92384 -27.5152 -57.8818 -86.9743 -114.627 -140.708 -165.118 -187.788 -208.675 -227.758 -245.035 -260.515 -274.223 -286.186 -296.432 -305 -311.925 -317.233 -320.986 -323.184 -323.832 -323.038 -320.79 -317.108 -312.013 -305.522 -297.642 -288.376 -277.725 -265.684 -252.241 -237.381 -221.08 -203.312 -184.05 -163.27 -140.955 -117.109 -91.7557 -64.941 -36.7529 -7.31967 23.2034 54.5953 86.5749 118.853 151.086 182.893 213.869 243.589 271.621 297.542 320.941 341.447 358.719 372.464 382.462 388.558 390.62 388.71 382.836 373.083 359.58 342.626 322.511 299.533 274.046 246.459 217.174 186.568 155.043 123.011 90.806 58.7453 27.2854 -2.76828 -32.3913 -61.1176 -88.6946 -114.977 -139.858 -163.249 -185.096 -205.356 -224.003 -241.016 -256.381 -270.091 -282.141 -292.533 -301.274 -308.376 -313.856 -317.737 -319.995 -320.648 -319.686 -317.166 -313.088 -307.438 -300.239 -291.475 -281.137 -269.233 -255.749 -240.683 -224.048 -205.85 -186.116 -164.879 -142.182 -118.102 -92.7318 -66.1606 -38.4954 -9.91377 17.7157 47.4596 77.4819 107.559 137.415 166.769 195.363 222.876 248.987 273.401 295.79 315.864 333.324 347.928 359.465 367.745 372.64 374.011 371.622 365.46 355.664 342.417 325.902 306.453 284.453 -228.39 -246.381 -262.776 -277.532 -290.618 -302.072 -311.927 -320.227 -327.006 -332.299 -336.148 -338.552 -339.489 -338.788 -336.68 -333.105 -328.073 -321.568 -313.543 -303.959 -292.77 -279.915 -265.345 -249.02 -230.898 -210.961 -189.196 -165.6 -140.214 -113.098 -84.3324 -54.0473 -22.4539 10.1818 43.1872 77.2074 111.635 146.017 179.929 212.983 244.741 274.796 302.726 328.137 350.691 370.071 385.993 398.235 406.635 411.069 411.433 407.721 400.036 388.398 373.021 354.141 332.01 306.93 279.256 249.374 217.685 184.59 150.509 115.859 81.0324 46.4922 13.7058 -19.4969 -51.7155 -82.6509 -112.109 -139.945 -166.053 -190.36 -212.809 -233.365 -252.024 -268.784 -283.645 -296.638 -307.794 -317.133 -324.69 -330.518 -334.667 -337.158 -338.021 -337.289 -335.03 -331.299 -326.131 -319.558 -311.595 -302.244 -291.5 -279.347 -265.756 -250.688 -234.11 -215.992 -196.303 -175.027 -152.175 -127.774 -101.873 -74.5539 -45.9274 -16.1369 14.6481 46.2729 78.3852 110.771 143.136 175.162 206.502 236.791 265.65 292.694 317.534 339.792 359.107 375.147 387.618 396.276 400.946 401.42 397.76 389.982 378.113 362.345 342.907 320.095 294.254 265.772 235.076 202.616 168.853 134.25 99.2664 64.3412 29.8904 -3.71453 -36.1455 -67.1288 -96.4467 -123.938 -149.497 -173.067 -194.635 -214.223 -231.876 -247.663 -261.666 -273.969 -284.656 -293.812 -301.516 -307.833 -312.822 -316.534 -319.006 -320.241 -320.263 -319.09 -316.699 -313.076 -308.188 -301.999 -294.468 -285.539 -275.157 -263.259 -249.78 -234.661 -217.841 -199.276 -178.94 -156.814 -132.91 -107.277 -79.9918 -51.1694 -20.9708 10.4029 42.7373 75.6725 108.918 142.112 174.867 206.775 237.419 266.379 293.242 317.618 339.143 357.492 372.381 383.585 390.936 394.325 393.672 389.06 380.585 368.333 352.529 333.421 311.299 286.495 259.361 230.272 199.614 167.778 135.145 102.09 68.9664 36.1064 3.81353 -27.641 -58.0199 -87.1217 -114.781 -140.866 -165.278 -187.948 -208.833 -227.914 -245.187 -260.663 -274.366 -286.326 -296.567 -305.132 -312.054 -317.359 -321.109 -323.298 -323.95 -323.153 -320.904 -317.221 -312.125 -305.634 -297.754 -288.489 -277.84 -265.801 -252.361 -237.504 -221.207 -203.443 -184.186 -163.409 -141.097 -117.253 -91.8981 -65.0804 -36.8862 -7.44273 23.0935 54.5025 86.5041 118.808 151.07 182.91 213.922 243.679 271.749 297.707 321.143 341.682 358.982 372.75 382.766 388.873 390.95 389.015 383.134 373.365 359.841 342.86 322.714 299.701 274.179 246.556 217.236 186.596 155.04 122.979 90.7483 58.6654 27.1946 -2.87531 -32.5114 -61.247 -88.8305 -115.117 -140.001 -163.392 -185.239 -205.499 -224.145 -241.157 -256.52 -270.229 -282.277 -292.667 -301.406 -308.505 -313.983 -317.861 -320.116 -320.772 -319.811 -317.288 -313.211 -307.562 -300.364 -291.602 -281.266 -269.363 -255.882 -240.817 -224.183 -205.986 -186.252 -165.013 -142.314 -118.231 -92.8554 -66.2785 -38.6066 -10.018 17.6481 47.4021 77.4394 107.535 137.412 166.79 195.41 222.95 249.09 273.533 295.95 316.05 333.534 348.159 359.715 368.008 372.914 374.303 371.888 365.723 355.919 342.656 326.119 306.644 284.616 -228.62 -246.605 -262.993 -277.741 -290.82 -302.267 -312.115 -320.409 -327.182 -332.471 -336.315 -338.719 -339.673 -338.963 -336.849 -333.276 -328.248 -321.749 -313.731 -304.154 -292.974 -280.127 -265.565 -249.248 -231.133 -211.201 -189.441 -165.847 -140.46 -113.34 -84.5656 -54.2665 -22.6524 10.0094 43.0319 77.0889 111.56 145.99 179.952 213.059 244.872 274.982 302.966 328.428 351.03 370.452 386.409 398.679 407.098 411.539 411.918 408.18 400.481 388.82 373.41 354.489 332.312 307.181 279.453 249.517 217.773 184.624 150.493 115.795 80.9203 46.3298 13.5561 -19.6864 -51.9311 -82.8829 -112.352 -140.195 -166.305 -190.612 -213.06 -233.612 -252.266 -269.021 -283.877 -296.863 -308.013 -317.346 -324.897 -330.721 -334.864 -337.344 -338.202 -337.466 -335.204 -331.469 -326.299 -319.725 -311.762 -302.413 -291.674 -279.526 -265.941 -250.88 -234.309 -216.197 -196.512 -175.241 -152.39 -127.987 -102.082 -74.7548 -46.1165 -16.3101 14.4956 46.1438 78.2855 110.704 143.107 175.175 206.561 236.898 265.808 292.905 317.798 340.106 359.469 375.552 388.058 396.744 401.425 401.921 398.244 390.45 378.555 362.75 343.268 320.404 294.507 265.967 235.21 202.69 168.869 134.211 99.177 64.2061 29.7161 -3.92151 -36.378 -67.3799 -96.7096 -124.207 -149.766 -173.332 -194.892 -214.47 -232.111 -247.885 -261.876 -274.166 -284.841 -293.987 -301.682 -307.991 -312.974 -316.681 -319.15 -320.38 -320.406 -319.233 -316.845 -313.226 -308.342 -302.159 -294.636 -285.716 -275.343 -263.454 -249.985 -234.875 -218.065 -199.508 -179.177 -157.054 -133.151 -107.515 -80.2217 -51.3863 -21.1693 10.2286 42.5903 75.5617 108.848 142.088 174.892 206.854 237.552 266.567 293.485 317.913 339.487 357.877 372.801 384.031 391.4 394.803 394.137 389.514 381.016 368.735 352.894 333.742 311.573 286.718 259.532 230.392 199.684 167.799 135.121 102.024 68.8631 35.9703 3.64931 -27.8284 -58.2259 -87.3417 -115.011 -141.101 -165.516 -188.187 -209.069 -228.146 -245.414 -260.884 -274.581 -286.534 -296.77 -305.329 -312.245 -317.547 -321.292 -323.471 -324.126 -323.325 -321.073 -317.388 -312.292 -305.801 -297.922 -288.659 -278.012 -265.976 -252.54 -237.688 -221.397 -203.64 -184.388 -163.617 -141.31 -117.467 -92.1109 -65.2887 -37.0853 -7.6267 22.9293 54.364 86.3987 118.741 151.048 182.937 214.002 243.816 271.943 297.957 321.447 342.035 359.377 373.18 383.224 389.346 391.437 389.482 383.584 373.788 360.233 343.212 323.018 299.954 274.379 246.703 217.329 186.638 155.035 122.931 90.6616 58.5453 27.0585 -3.0362 -32.6918 -61.4414 -89.0346 -115.328 -140.216 -163.609 -185.455 -205.714 -224.358 -241.368 -256.729 -270.435 -282.48 -292.868 -301.604 -308.7 -314.174 -318.046 -320.297 -320.96 -319.998 -317.472 -313.395 -307.747 -300.551 -291.792 -281.459 -269.558 -256.08 -241.018 -224.386 -206.19 -186.455 -165.215 -142.513 -118.423 -93.0409 -66.4554 -38.7733 -10.1743 17.5463 47.3156 77.3755 107.499 137.409 166.822 195.48 223.062 249.245 273.73 296.189 316.329 333.85 348.507 360.089 368.404 373.324 374.734 372.292 366.12 356.301 343.013 326.444 306.931 284.861 -228.926 -246.903 -263.281 -278.021 -291.089 -302.527 -312.366 -320.651 -327.418 -332.7 -336.536 -338.939 -339.911 -339.192 -337.074 -333.504 -328.482 -321.991 -313.981 -304.415 -293.245 -280.41 -265.859 -249.552 -231.447 -211.522 -189.768 -166.177 -140.788 -113.663 -84.8768 -54.5593 -22.9175 9.77887 42.8243 76.9305 111.46 145.952 179.982 213.161 245.046 275.229 303.286 328.817 351.482 370.96 386.964 399.272 407.716 412.167 412.559 408.799 401.075 389.383 373.929 354.954 332.714 307.516 279.716 249.706 217.889 184.669 150.472 115.709 80.7708 46.1103 13.3584 -19.94 -52.2192 -83.1927 -112.676 -140.527 -166.642 -190.949 -213.394 -233.942 -252.59 -269.337 -284.186 -297.163 -308.305 -317.631 -325.174 -330.991 -335.124 -337.593 -338.446 -337.703 -335.435 -331.696 -326.523 -319.948 -311.985 -302.64 -291.905 -279.764 -266.187 -251.136 -234.574 -216.469 -196.792 -175.526 -152.677 -128.272 -102.361 -75.0224 -46.3684 -16.5408 14.2919 45.9726 78.153 110.616 143.069 175.193 206.639 237.042 266.02 293.187 318.15 340.526 359.953 376.092 388.646 397.367 402.067 402.583 398.894 391.075 379.145 363.292 343.75 320.818 294.846 266.226 235.389 202.789 168.89 134.16 99.0576 64.0258 29.4835 -4.1977 -36.6883 -67.715 -97.0606 -124.565 -150.125 -173.685 -195.235 -214.798 -232.424 -248.182 -262.155 -274.429 -285.088 -294.219 -301.902 -308.201 -313.176 -316.878 -319.34 -320.569 -320.596 -319.424 -317.039 -313.425 -308.548 -302.374 -294.86 -285.951 -275.59 -263.714 -250.258 -235.161 -218.363 -199.817 -179.494 -157.374 -133.472 -107.832 -80.5285 -51.6759 -21.4343 9.99553 42.3944 75.4137 108.754 142.055 174.926 206.958 237.73 266.819 293.809 318.307 339.945 358.391 373.362 384.628 392.018 395.428 394.765 390.123 381.593 369.272 353.38 334.171 311.939 287.016 259.761 230.552 199.776 167.827 135.089 101.936 68.7253 35.7886 3.43017 -28.0786 -58.5008 -87.6351 -115.317 -141.416 -165.834 -188.505 -209.384 -228.455 -245.717 -261.179 -274.868 -286.812 -297.041 -305.592 -312.501 -317.797 -321.534 -323.704 -324.361 -323.554 -321.298 -317.612 -312.515 -306.023 -298.146 -288.884 -278.241 -266.21 -252.779 -237.933 -221.65 -203.901 -184.658 -163.895 -141.593 -117.753 -92.3951 -65.5668 -37.3512 -7.87264 22.7097 54.1791 86.2577 118.652 151.017 182.973 214.109 243.997 272.2 298.289 321.852 342.506 359.905 373.755 383.834 389.976 392.073 390.112 384.189 374.355 360.755 343.681 323.424 300.291 274.646 246.898 217.453 186.694 155.027 122.867 90.5457 58.3852 26.8768 -3.25141 -32.9328 -61.7008 -89.307 -115.609 -140.502 -163.897 -185.743 -206.001 -224.642 -241.649 -257.007 -270.71 -282.752 -293.135 -301.867 -308.959 -314.428 -318.294 -320.541 -321.21 -320.246 -317.716 -313.64 -307.994 -300.8 -292.045 -281.716 -269.819 -256.345 -241.286 -224.657 -206.462 -186.727 -165.484 -142.777 -118.68 -93.2883 -66.6913 -38.9958 -10.384 17.4109 47.1998 77.2899 107.451 137.404 166.864 195.574 223.211 249.451 273.994 296.508 316.701 334.27 348.97 360.589 368.931 373.871 375.3 372.84 366.651 356.812 343.491 326.879 307.314 285.188 -229.309 -247.275 -263.642 -278.37 -291.426 -302.852 -312.68 -320.955 -327.712 -332.986 -336.815 -339.213 -340.2 -339.476 -337.354 -333.79 -328.774 -322.292 -314.294 -304.74 -293.585 -280.764 -266.226 -249.933 -231.839 -211.923 -190.177 -166.589 -141.198 -114.067 -85.2663 -54.9261 -23.2496 9.48969 42.5642 76.7318 111.334 145.905 180.02 213.287 245.264 275.539 303.686 329.303 352.047 371.596 387.659 400.012 408.489 412.954 413.352 409.579 401.821 390.088 374.578 355.535 333.218 307.934 280.044 249.943 218.034 184.726 150.444 115.602 80.5844 45.8321 13.1136 -20.2585 -52.5802 -83.5808 -113.081 -140.944 -167.063 -191.37 -213.813 -234.355 -252.994 -269.733 -284.572 -297.539 -308.67 -317.986 -325.52 -331.328 -335.448 -337.907 -338.75 -337.999 -335.724 -331.979 -326.802 -320.226 -312.264 -302.922 -292.194 -280.062 -266.495 -251.455 -234.905 -216.811 -197.142 -175.882 -153.035 -128.628 -102.709 -75.3575 -46.6837 -16.8299 14.0357 45.7588 77.9869 110.505 143.021 175.214 206.737 237.221 266.285 293.539 318.59 341.052 360.558 376.769 389.382 398.148 402.873 403.406 399.711 391.859 379.885 363.97 344.354 321.335 295.269 266.551 235.613 202.912 168.916 134.095 98.9077 63.7995 29.1918 -4.54395 -37.0772 -68.1348 -97.5001 -125.014 -150.574 -174.127 -195.664 -215.21 -232.816 -248.553 -262.504 -274.757 -285.397 -294.511 -302.178 -308.465 -313.43 -317.123 -319.578 -320.806 -320.833 -319.663 -317.283 -313.674 -308.806 -302.642 -295.141 -286.245 -275.899 -264.04 -250.601 -235.519 -218.736 -200.204 -179.889 -157.776 -133.875 -108.229 -80.9126 -52.0387 -21.7667 9.70282 42.1489 75.2281 108.636 142.013 174.967 207.088 237.951 267.133 294.215 318.8 340.518 359.035 374.064 385.374 392.792 396.209 395.55 390.887 382.314 369.944 353.989 334.707 312.395 287.389 260.047 230.752 199.892 167.861 135.047 101.826 68.5523 35.5608 3.15561 -28.3921 -58.8449 -88.0026 -115.701 -141.809 -166.232 -188.903 -209.778 -228.843 -246.095 -261.548 -275.226 -287.159 -297.379 -305.921 -312.82 -318.11 -321.836 -323.999 -324.653 -323.841 -321.58 -317.891 -312.793 -306.302 -298.425 -289.167 -278.527 -266.501 -253.078 -238.24 -221.967 -204.229 -184.996 -164.242 -141.947 -118.111 -92.7511 -65.9151 -37.6843 -8.18112 22.4342 53.9473 86.0807 118.539 150.979 183.017 214.241 244.224 272.522 298.705 322.358 343.095 360.565 374.473 384.597 390.764 392.864 390.901 384.947 375.065 361.41 344.268 323.932 300.712 274.978 247.141 217.607 186.762 155.017 122.786 90.4003 58.185 26.6492 -3.52145 -33.2346 -62.0256 -89.6479 -115.961 -140.859 -164.257 -186.103 -206.359 -224.997 -242.001 -257.355 -271.053 -283.091 -293.469 -302.196 -309.283 -314.746 -318.604 -320.849 -321.52 -320.554 -318.022 -313.946 -308.303 -301.112 -292.362 -282.037 -270.145 -256.677 -241.621 -224.995 -206.802 -187.067 -165.821 -143.107 -119.002 -93.5978 -66.9863 -39.2741 -10.6471 17.2414 47.0543 77.1824 107.39 137.397 166.917 195.691 223.397 249.708 274.323 296.907 317.166 334.796 349.55 361.213 369.59 374.554 376 373.532 367.319 357.451 344.088 327.422 307.793 285.596 -229.768 -247.723 -264.076 -278.789 -291.83 -303.242 -313.057 -321.319 -328.065 -333.33 -337.149 -339.543 -340.541 -339.812 -337.689 -334.132 -329.124 -322.654 -314.67 -305.131 -293.992 -281.188 -266.667 -250.39 -232.31 -212.406 -190.669 -167.084 -141.692 -114.553 -85.7347 -55.3672 -23.6493 9.14148 42.2509 76.4923 111.181 145.849 180.064 213.438 245.524 275.91 304.166 329.887 352.726 372.359 388.493 400.902 409.417 413.9 414.301 410.519 402.719 390.935 375.358 356.233 333.822 308.436 280.438 250.227 218.207 184.792 150.411 115.472 80.3615 45.4949 12.8209 -20.6432 -53.0149 -84.0475 -113.569 -141.444 -167.569 -191.876 -214.315 -234.851 -253.48 -270.208 -285.036 -297.99 -309.108 -318.412 -325.936 -331.731 -335.838 -338.285 -339.116 -338.354 -336.071 -332.318 -327.138 -320.559 -312.599 -303.262 -292.542 -280.419 -266.865 -251.838 -235.302 -217.22 -197.562 -176.31 -153.466 -129.055 -103.128 -75.7603 -47.0631 -17.1779 13.7265 45.5021 77.7866 110.371 142.963 175.239 206.853 237.435 266.602 293.961 319.118 341.682 361.284 377.581 390.266 399.086 403.842 404.391 400.692 392.801 380.773 364.784 345.078 321.956 295.777 266.94 235.88 203.059 168.947 134.015 98.7267 63.5267 28.8403 -4.96088 -37.5453 -68.6399 -98.0287 -125.554 -151.114 -174.659 -196.179 -215.704 -233.287 -248.998 -262.923 -275.151 -285.768 -294.86 -302.509 -308.781 -313.733 -317.416 -319.864 -321.09 -321.117 -319.949 -317.575 -313.974 -309.115 -302.964 -295.477 -286.599 -276.27 -264.431 -251.012 -235.949 -219.184 -200.668 -180.365 -158.258 -134.359 -108.706 -81.3744 -52.4753 -22.1668 9.35005 41.8537 75.0042 108.494 141.963 175.016 207.243 238.217 267.509 294.701 319.391 341.206 359.807 374.908 386.27 393.722 397.151 396.491 391.803 383.182 370.75 354.72 335.351 312.944 287.836 260.39 230.991 200.029 167.902 134.997 101.692 68.3438 35.2864 2.82513 -28.7692 -59.2589 -88.4445 -116.162 -142.283 -166.71 -189.381 -210.252 -229.308 -246.55 -261.991 -275.656 -287.577 -297.784 -306.316 -313.204 -318.484 -322.198 -324.354 -325.004 -324.185 -321.919 -318.227 -313.128 -306.636 -298.761 -289.506 -278.871 -266.851 -253.436 -238.609 -222.347 -204.622 -185.402 -164.659 -142.373 -118.541 -93.1791 -66.3341 -38.085 -8.55268 22.1025 53.6682 85.867 118.402 150.931 183.069 214.4 244.495 272.908 299.204 322.966 343.802 361.358 375.337 385.514 391.709 393.816 391.847 385.858 375.919 362.196 344.973 324.541 301.217 275.377 247.433 217.792 186.844 155.005 122.687 90.2248 57.9446 26.3752 -3.84685 -33.5975 -62.416 -90.0575 -116.384 -141.289 -164.691 -186.535 -206.789 -225.423 -242.424 -257.772 -271.466 -283.498 -293.87 -302.591 -309.671 -315.127 -318.977 -321.219 -321.89 -320.923 -318.388 -314.313 -308.673 -301.486 -292.742 -282.423 -270.537 -257.074 -242.024 -225.401 -207.21 -187.474 -166.226 -143.505 -119.388 -93.9694 -67.3404 -39.6081 -10.9624 17.036 46.8786 77.0526 107.317 137.388 166.979 195.831 223.62 250.017 274.718 297.386 317.724 335.427 350.245 361.962 370.381 375.374 376.836 374.365 368.122 358.219 344.805 328.074 308.369 286.086 -230.305 -248.245 -264.582 -279.277 -292.302 -303.697 -313.496 -321.744 -328.477 -333.731 -337.54 -339.928 -340.931 -340.202 -338.078 -334.531 -329.533 -323.075 -315.108 -305.587 -294.467 -281.683 -267.182 -250.923 -232.859 -212.969 -191.242 -167.662 -142.268 -115.12 -86.2822 -55.8833 -24.1171 8.73362 41.884 76.2115 111.002 145.781 180.115 213.614 245.828 276.342 304.726 330.568 353.518 373.251 389.468 401.942 410.502 415.007 415.41 411.614 403.769 391.924 376.268 357.047 334.528 309.022 280.897 250.557 218.409 184.869 150.371 115.321 80.1029 45.1009 12.4771 -21.0959 -53.5241 -84.5932 -114.138 -142.028 -168.16 -192.466 -214.902 -235.43 -254.047 -270.762 -285.577 -298.516 -309.619 -318.91 -326.42 -332.201 -336.292 -338.726 -339.543 -338.768 -336.477 -332.715 -327.53 -320.949 -312.989 -303.658 -292.947 -280.836 -267.296 -252.286 -235.766 -217.699 -198.054 -176.81 -153.969 -129.556 -103.617 -76.2314 -47.5069 -17.5854 13.3636 45.2024 77.5517 110.213 142.893 175.267 206.988 237.684 266.971 294.453 319.733 342.418 362.132 378.529 391.299 400.181 404.976 405.543 401.836 393.902 381.81 365.736 345.924 322.681 296.37 267.393 236.192 203.23 168.981 133.921 98.5139 63.2068 28.4282 -5.44918 -38.0932 -69.2309 -98.647 -126.186 -151.746 -175.279 -196.782 -216.282 -233.837 -249.518 -263.412 -275.611 -286.2 -295.268 -302.895 -309.149 -314.088 -317.759 -320.198 -321.422 -321.449 -320.284 -317.916 -314.323 -309.476 -303.34 -295.87 -287.011 -276.704 -264.887 -251.492 -236.451 -219.708 -201.21 -180.92 -158.823 -134.925 -109.264 -81.9143 -52.9861 -22.6354 8.93689 41.508 74.7415 108.327 141.902 175.072 207.422 238.525 267.948 295.268 320.081 342.009 360.71 375.892 387.317 394.808 398.252 397.589 392.872 384.196 371.692 355.574 336.102 313.583 288.357 260.79 231.269 200.189 167.948 134.938 101.535 68.0992 34.9651 2.43828 -29.2103 -59.743 -88.9611 -116.701 -142.835 -167.269 -189.939 -210.805 -229.851 -247.08 -262.507 -276.158 -288.064 -298.258 -306.776 -313.652 -318.921 -322.621 -324.77 -325.412 -324.586 -322.314 -318.619 -313.518 -307.026 -299.153 -289.902 -279.271 -267.26 -253.854 -239.038 -222.79 -205.081 -185.875 -165.145 -142.87 -119.043 -93.6795 -66.8241 -38.5539 -8.98786 21.7139 53.3411 85.6161 118.242 150.874 183.127 214.584 244.811 273.359 299.787 323.676 344.627 362.283 376.346 386.585 392.814 394.929 392.952 386.922 376.918 363.114 345.796 325.252 301.806 275.843 247.773 218.006 186.938 154.989 122.571 90.0189 57.6638 26.0541 -4.22817 -34.0219 -62.8722 -90.5362 -116.877 -141.791 -165.196 -187.04 -207.291 -225.921 -242.916 -258.26 -271.947 -283.973 -294.338 -303.052 -310.125 -315.573 -319.414 -321.652 -322.32 -321.353 -318.815 -314.741 -309.105 -301.923 -293.185 -282.873 -270.994 -257.538 -242.493 -225.875 -207.687 -187.951 -166.698 -143.968 -119.839 -94.4034 -67.7539 -39.998 -11.3287 16.7931 46.6719 76.8999 107.23 137.377 167.051 195.993 223.88 250.377 275.179 297.945 318.375 336.164 351.057 362.836 371.304 376.331 377.812 375.336 369.062 359.116 345.643 328.836 309.04 286.658 -230.919 -248.842 -265.16 -279.836 -292.841 -304.217 -313.999 -322.23 -328.948 -334.189 -337.987 -340.368 -341.372 -340.644 -338.524 -334.987 -330 -323.556 -315.609 -306.108 -295.009 -282.25 -267.77 -251.533 -233.488 -213.613 -191.898 -168.324 -142.928 -115.77 -86.9094 -56.4748 -24.6538 8.26587 41.4622 75.8886 110.796 145.703 180.172 213.813 246.174 276.836 305.366 331.346 354.424 374.271 390.583 403.131 411.743 416.274 416.679 412.867 404.971 393.056 377.31 357.979 335.335 309.691 281.421 250.935 218.637 184.956 150.324 115.147 79.8096 44.6568 12.0739 -21.6189 -54.1087 -85.2187 -114.791 -142.697 -168.836 -193.142 -215.572 -236.092 -254.695 -271.395 -286.196 -299.118 -310.203 -319.478 -326.974 -332.738 -336.811 -339.231 -340.031 -339.242 -336.939 -333.168 -327.977 -321.393 -313.435 -304.11 -293.41 -281.313 -267.789 -252.798 -236.297 -218.247 -198.616 -177.382 -154.546 -130.128 -104.178 -76.7711 -48.0156 -18.0526 12.9464 44.8593 77.2816 110.031 142.811 175.298 207.14 237.967 267.391 295.015 320.436 343.259 363.102 379.615 392.481 401.435 406.276 406.861 403.144 395.163 382.998 366.824 346.891 323.51 297.047 267.911 236.547 203.424 169.019 133.811 98.2686 62.8391 27.9549 -6.00969 -38.7217 -69.9086 -99.3557 -126.909 -152.469 -175.99 -197.471 -216.942 -234.465 -250.112 -263.972 -276.136 -286.695 -295.734 -303.336 -309.57 -314.492 -318.15 -320.581 -321.801 -321.827 -320.666 -318.305 -314.721 -309.889 -303.769 -296.318 -287.482 -277.199 -265.408 -252.04 -237.025 -220.307 -201.83 -181.556 -159.468 -135.572 -109.903 -82.5332 -53.5719 -23.1731 8.46289 41.1111 74.4395 108.134 141.831 175.134 207.627 238.877 268.449 295.917 320.871 342.928 361.743 377.02 388.516 396.052 399.513 398.845 394.094 385.356 372.77 356.55 336.962 314.315 288.952 261.246 231.586 200.371 168 134.868 101.354 67.8181 34.5963 1.9945 -29.7161 -60.2978 -89.5528 -117.318 -143.468 -167.909 -190.578 -211.437 -230.473 -247.687 -263.098 -276.732 -288.621 -298.799 -307.302 -314.164 -319.42 -323.106 -325.244 -325.878 -325.044 -322.765 -319.066 -313.964 -307.471 -299.601 -290.354 -279.73 -267.727 -254.332 -239.529 -223.297 -205.605 -186.417 -165.702 -143.44 -119.618 -94.2526 -67.3854 -39.0914 -9.48727 21.2679 52.9655 85.3273 118.057 150.807 183.193 214.793 245.17 273.873 300.452 324.487 345.571 363.342 377.501 387.81 394.079 396.205 394.216 388.139 378.061 364.166 346.737 326.065 302.48 276.374 248.161 218.25 187.044 154.969 122.437 89.7819 57.3423 25.6851 -4.66606 -34.5084 -63.3947 -91.0842 -117.443 -142.365 -165.773 -187.618 -207.865 -226.49 -243.48 -258.816 -272.497 -284.516 -294.874 -303.579 -310.644 -316.082 -319.913 -322.147 -322.81 -321.843 -319.304 -315.229 -309.599 -302.422 -293.692 -283.388 -271.516 -258.069 -243.03 -226.417 -208.232 -188.495 -167.238 -144.499 -120.355 -94.8999 -68.2267 -40.4438 -11.7454 16.5111 46.4334 76.7238 107.13 137.362 167.131 196.177 224.175 250.788 275.705 298.584 319.12 337.007 351.986 363.837 372.36 377.426 378.927 376.445 370.138 360.144 346.602 329.708 309.808 287.313 -231.609 -249.514 -265.811 -280.465 -293.448 -304.802 -314.564 -322.777 -329.478 -334.705 -338.489 -340.862 -341.865 -341.14 -339.024 -335.498 -330.526 -324.096 -316.172 -306.694 -295.619 -282.887 -268.433 -252.219 -234.196 -214.338 -192.636 -169.07 -143.673 -116.503 -87.617 -57.1422 -25.2604 7.73809 40.9841 75.5229 110.563 145.613 180.235 214.036 246.562 277.392 306.086 332.223 355.445 375.419 391.839 404.471 413.141 417.702 418.109 414.277 406.326 394.332 378.484 359.029 336.244 310.444 282.01 251.358 218.893 185.052 150.269 114.95 79.4828 44.1818 11.5909 -22.2148 -54.7695 -85.9245 -115.526 -143.45 -169.598 -193.903 -216.327 -236.837 -255.426 -272.108 -286.891 -299.796 -310.861 -320.118 -327.598 -333.342 -337.396 -339.798 -340.581 -339.776 -337.46 -333.678 -328.48 -321.893 -313.937 -304.619 -293.93 -281.849 -268.344 -253.374 -236.895 -218.864 -199.249 -178.027 -155.195 -130.774 -104.81 -77.3799 -48.5896 -18.5799 12.474 44.4721 76.9756 109.824 142.718 175.33 207.31 238.284 267.863 295.646 321.227 344.205 364.194 380.837 393.812 402.849 407.741 408.347 404.617 396.584 384.336 368.051 347.981 324.443 297.809 268.492 236.945 203.64 169.06 133.686 97.9901 62.4228 27.4194 -6.64327 -39.4317 -70.6738 -100.155 -127.725 -153.284 -176.791 -198.248 -217.687 -235.173 -250.781 -264.601 -276.727 -287.251 -296.258 -303.832 -310.043 -314.947 -318.59 -321.011 -322.227 -322.252 -321.095 -318.742 -315.17 -310.353 -304.252 -296.822 -288.011 -277.757 -265.995 -252.657 -237.672 -220.981 -202.528 -182.273 -160.196 -136.303 -110.624 -83.2314 -54.2332 -23.7805 7.92711 40.6622 74.0972 107.914 141.749 175.203 207.855 239.272 269.013 296.646 321.759 343.962 362.906 378.29 389.866 397.454 400.936 400.261 395.471 386.663 373.984 357.649 337.929 315.137 289.621 261.759 231.942 200.574 168.057 134.788 101.148 67.4997 34.1793 1.49314 -30.287 -60.9239 -90.2202 -118.014 -144.181 -168.63 -191.298 -212.15 -231.172 -248.371 -263.763 -277.378 -289.248 -299.409 -307.894 -314.74 -319.981 -323.652 -325.778 -326.402 -325.559 -323.273 -319.569 -314.465 -307.973 -300.105 -290.862 -280.245 -268.251 -254.869 -240.082 -223.868 -206.195 -187.026 -166.33 -144.081 -120.266 -94.899 -68.0186 -39.6982 -10.0518 20.7638 52.5406 84.9998 117.845 150.729 183.265 215.027 245.573 274.45 301.201 325.4 346.634 364.536 378.804 389.19 395.504 397.643 395.64 389.511 379.349 365.351 347.797 326.98 303.238 276.972 248.596 218.523 187.161 154.945 122.283 89.5131 56.9798 25.2674 -5.16116 -35.0575 -63.9838 -91.7021 -118.08 -143.012 -166.424 -188.267 -208.511 -227.13 -244.114 -259.443 -273.116 -285.127 -295.476 -304.172 -311.227 -316.655 -320.477 -322.703 -323.361 -322.393 -319.853 -315.778 -310.154 -302.983 -294.261 -283.967 -272.104 -258.666 -243.635 -227.026 -208.846 -189.109 -167.846 -145.096 -120.936 -95.4592 -68.759 -40.9456 -12.2117 16.1886 46.1624 76.5237 107.015 137.345 167.221 196.383 224.507 251.249 276.297 299.303 319.959 337.956 353.032 364.964 373.55 378.658 380.183 377.695 371.352 361.301 347.682 330.689 310.673 288.049 -232.377 -250.261 -266.535 -281.164 -294.122 -305.451 -315.191 -323.384 -330.066 -335.277 -339.048 -341.41 -342.408 -341.688 -339.58 -336.066 -331.109 -324.697 -316.797 -307.345 -296.297 -283.595 -269.169 -252.981 -234.982 -215.144 -193.457 -169.899 -144.501 -117.318 -88.4056 -57.8863 -25.9379 7.15013 40.4482 75.1134 110.3 145.511 180.303 214.283 246.992 278.008 306.886 333.197 356.58 376.697 393.236 405.962 414.697 419.292 419.701 415.847 407.834 395.752 379.789 360.196 337.254 311.281 282.665 251.827 219.176 185.157 150.206 114.731 79.123 43.6831 11.0188 -22.8856 -55.5076 -86.7113 -116.345 -144.289 -170.446 -194.75 -217.167 -237.665 -256.238 -272.901 -287.665 -300.549 -311.593 -320.829 -328.29 -334.013 -338.046 -340.429 -341.192 -340.369 -338.037 -334.245 -329.038 -322.447 -314.494 -305.183 -294.508 -282.445 -268.96 -254.014 -237.559 -219.551 -199.954 -178.745 -155.918 -131.493 -105.515 -78.0583 -49.2293 -19.1677 11.945 44.0413 76.6326 109.592 142.611 175.363 207.496 238.635 268.386 296.346 322.105 345.257 365.409 382.197 395.293 404.423 409.373 410.002 406.256 398.167 385.826 369.416 349.194 325.481 298.656 269.138 237.386 203.878 169.102 133.544 97.6775 61.9567 26.8207 -7.35079 -40.2243 -71.5274 -101.047 -128.634 -154.192 -177.682 -199.112 -218.515 -235.959 -251.524 -265.301 -277.384 -287.868 -296.84 -304.382 -310.568 -315.451 -319.078 -321.489 -322.699 -322.724 -321.572 -319.227 -315.668 -310.868 -304.788 -297.382 -288.6 -278.376 -266.647 -253.343 -238.391 -221.731 -203.305 -183.071 -161.007 -137.116 -111.427 -84.0099 -54.9706 -24.4584 7.32878 40.1604 73.714 107.667 141.655 175.276 208.107 239.709 269.638 297.457 322.747 345.113 364.201 379.704 391.37 399.015 402.52 401.837 397.003 388.118 375.335 358.872 339.004 316.051 290.365 262.327 232.336 200.797 168.117 134.696 100.917 67.1434 33.7133 0.933537 -30.9239 -61.6219 -90.9639 -118.79 -144.976 -169.432 -192.099 -212.942 -231.95 -249.13 -264.502 -278.096 -289.944 -300.085 -308.552 -315.38 -320.604 -324.259 -326.371 -326.984 -326.131 -323.837 -320.128 -315.022 -308.53 -300.664 -291.427 -280.818 -268.834 -255.465 -240.696 -224.502 -206.851 -187.704 -167.027 -144.794 -120.988 -95.6191 -68.7241 -40.3749 -10.6819 20.2002 52.0657 84.6329 117.608 150.64 183.341 215.284 246.02 275.091 302.033 326.415 347.817 365.865 380.253 390.727 397.09 399.245 397.226 391.037 380.784 366.67 348.976 327.996 304.08 277.636 249.078 218.823 187.29 154.916 122.109 89.2117 56.576 24.8 -5.71412 -35.6696 -64.6399 -92.3902 -118.789 -143.732 -167.149 -188.99 -209.229 -227.842 -244.818 -260.14 -273.804 -285.807 -296.145 -304.831 -311.875 -317.293 -321.103 -323.322 -323.974 -323.003 -320.462 -316.389 -310.771 -303.607 -294.894 -284.61 -272.758 -259.329 -244.307 -227.704 -209.529 -189.791 -168.523 -145.761 -121.583 -96.0816 -69.3509 -41.5035 -12.7271 15.8239 45.8579 76.2987 106.886 137.324 167.318 196.61 224.874 251.762 276.955 300.102 320.892 339.012 354.195 366.217 374.873 380.028 381.58 379.084 372.702 362.589 348.883 331.782 311.635 288.868 -233.223 -251.083 -267.331 -281.933 -294.863 -306.166 -315.881 -324.052 -330.714 -335.907 -339.663 -342.012 -342.998 -342.29 -340.19 -336.689 -331.75 -325.359 -317.485 -308.06 -297.042 -284.375 -269.98 -253.819 -235.849 -216.033 -194.362 -170.814 -145.415 -118.218 -89.276 -58.7081 -26.687 6.50193 39.8525 74.6591 110.009 145.396 180.375 214.552 247.464 278.685 307.766 334.269 357.829 378.105 394.776 407.605 416.412 421.044 421.456 417.576 409.496 397.318 381.228 361.481 338.366 312.201 283.384 252.342 219.485 185.27 150.134 114.488 78.73 43.1589 10.3577 -23.6328 -56.3238 -87.5798 -117.249 -145.214 -171.38 -195.683 -218.092 -238.577 -257.132 -273.774 -288.515 -301.379 -312.398 -321.61 -329.051 -334.752 -338.761 -341.122 -341.866 -341.021 -338.672 -334.867 -329.652 -323.057 -315.106 -305.804 -295.143 -283.1 -269.639 -254.719 -238.29 -220.307 -200.731 -179.536 -156.716 -132.286 -106.293 -78.8068 -49.9354 -19.8163 11.3642 43.5603 76.2518 109.333 142.491 175.398 207.698 239.018 268.96 297.115 323.071 346.414 366.746 383.695 396.926 406.159 411.173 411.827 408.064 399.912 387.469 370.921 350.529 326.623 299.587 269.847 237.87 204.138 169.146 133.384 97.3298 61.44 26.1574 -8.13334 -41.1006 -72.4703 -102.032 -129.637 -155.194 -178.665 -200.063 -219.426 -236.825 -252.342 -266.07 -278.106 -288.547 -297.479 -304.987 -311.145 -316.006 -319.616 -322.014 -323.219 -323.244 -322.095 -319.76 -316.215 -311.435 -305.377 -297.998 -289.246 -279.057 -267.364 -254.097 -239.183 -222.557 -204.16 -183.95 -161.9 -138.012 -112.314 -84.8693 -55.785 -25.2076 6.66674 39.6046 73.2889 107.393 141.549 175.355 208.382 240.188 270.325 298.349 323.834 346.38 365.627 381.262 393.028 400.736 404.267 403.573 398.691 389.721 376.823 360.219 340.189 317.057 291.182 262.952 232.768 201.041 168.182 134.593 100.66 66.7484 33.1976 0.314908 -31.6275 -62.3927 -91.7846 -119.645 -145.852 -170.316 -192.981 -213.815 -232.807 -249.967 -265.316 -278.885 -290.711 -300.83 -309.276 -316.084 -321.289 -324.927 -327.024 -327.624 -326.759 -324.458 -320.743 -315.634 -309.143 -301.279 -292.048 -281.448 -269.475 -256.121 -241.371 -225.198 -207.572 -188.45 -167.796 -145.579 -121.784 -96.4133 -69.503 -41.1222 -11.3785 19.5761 51.5396 84.2254 117.342 150.538 183.422 215.565 246.51 275.794 302.95 327.533 349.121 367.33 381.852 392.42 398.84 401.012 398.974 392.719 382.366 368.125 350.275 329.115 305.007 278.366 249.607 219.152 187.429 154.881 121.914 88.8766 56.1304 24.2817 -6.32553 -36.3454 -65.3639 -93.1492 -119.571 -144.525 -167.946 -189.785 -210.02 -228.626 -245.594 -260.907 -274.561 -286.554 -296.882 -305.556 -312.589 -317.994 -321.792 -324.002 -324.647 -323.674 -321.132 -317.06 -311.449 -304.294 -295.59 -285.318 -273.477 -260.06 -245.046 -228.45 -210.281 -190.543 -169.269 -146.493 -122.296 -96.7674 -70.0026 -42.1176 -13.2915 15.4157 45.519 76.0482 106.741 137.298 167.423 196.858 225.276 252.324 277.679 300.982 321.918 340.174 355.476 367.597 376.331 381.538 383.119 380.613 374.19 364.009 350.208 332.985 312.695 289.769 -234.146 -251.981 -268.199 -282.772 -295.672 -306.946 -316.634 -324.78 -331.42 -336.593 -340.333 -342.669 -343.636 -342.946 -340.856 -337.368 -332.449 -326.081 -318.234 -308.841 -297.856 -285.225 -270.864 -254.735 -236.795 -217.003 -195.349 -171.813 -146.413 -119.202 -90.229 -59.6085 -27.5089 5.79345 39.1951 74.1589 109.687 145.268 180.451 214.843 247.977 279.422 308.725 335.44 359.194 379.642 396.458 409.402 418.287 422.96 423.376 419.466 411.313 399.029 382.8 362.885 339.58 313.205 284.169 252.901 219.82 185.39 150.052 114.22 78.303 42.6104 9.60407 -24.4573 -57.2191 -88.5308 -118.238 -146.225 -172.401 -196.703 -219.102 -239.573 -258.109 -274.727 -289.443 -302.283 -313.276 -322.463 -329.882 -335.559 -339.542 -341.878 -342.6 -341.733 -339.364 -335.546 -330.321 -323.722 -315.773 -306.48 -295.835 -283.813 -270.379 -255.487 -239.088 -221.133 -201.579 -180.401 -157.587 -133.154 -107.143 -79.6264 -50.7084 -20.5265 10.7406 43.0187 75.8324 109.047 142.357 175.431 207.916 239.433 269.583 297.953 324.123 347.677 368.207 385.332 398.711 408.057 413.143 413.823 410.04 401.82 389.265 372.566 351.989 327.871 300.603 270.62 238.396 204.419 169.191 133.206 96.9461 60.8711 25.4286 -8.99235 -42.0616 -73.5038 -103.111 -130.735 -156.29 -179.74 -201.104 -220.422 -237.77 -253.234 -266.909 -278.894 -289.286 -298.176 -305.646 -311.773 -316.609 -320.201 -322.586 -323.784 -323.809 -322.665 -320.341 -316.812 -312.052 -306.019 -298.669 -289.952 -279.8 -268.147 -254.921 -240.047 -223.459 -205.095 -184.911 -162.877 -138.993 -113.284 -85.8106 -56.6772 -26.0293 5.93965 38.9942 72.8208 107.089 141.429 175.437 208.679 240.71 271.074 299.321 325.021 347.765 367.187 382.966 394.84 402.619 406.178 405.472 400.537 391.474 378.45 361.69 341.482 318.154 292.073 263.632 233.236 201.304 168.249 134.477 100.376 66.3138 32.6313 -0.36368 -32.3987 -63.2367 -92.6832 -120.581 -146.81 -171.283 -193.946 -214.769 -233.743 -250.88 -266.204 -279.747 -291.547 -301.642 -310.065 -316.852 -322.037 -325.655 -327.737 -328.321 -327.445 -325.135 -321.413 -316.302 -309.811 -301.95 -292.725 -282.134 -270.174 -256.837 -242.106 -225.958 -208.359 -189.265 -168.635 -146.438 -122.653 -97.2823 -70.3561 -41.941 -12.1426 18.8906 50.9613 83.7762 117.047 150.423 183.507 215.868 247.042 276.56 303.949 328.753 350.544 368.932 383.599 394.272 400.754 402.947 400.885 394.558 384.096 369.715 351.692 330.335 306.019 279.162 250.182 219.507 187.578 154.839 121.696 88.5066 55.6424 23.7112 -6.99592 -37.0853 -66.1563 -93.9795 -120.425 -145.392 -168.816 -190.654 -210.883 -229.481 -246.44 -261.743 -275.387 -287.369 -297.686 -306.348 -313.367 -318.759 -322.544 -324.745 -325.382 -324.405 -321.862 -317.792 -312.188 -305.043 -296.349 -286.091 -274.262 -260.857 -245.854 -229.266 -211.103 -191.364 -170.083 -147.293 -123.075 -97.5169 -70.7147 -42.7877 -13.9051 14.9629 45.1448 75.7714 106.58 137.267 167.534 197.126 225.713 252.936 278.467 301.942 323.039 341.443 356.875 369.106 377.923 383.187 384.8 382.284 375.817 365.56 351.655 334.3 313.852 290.753 -235.147 -252.953 -269.141 -283.681 -296.548 -307.79 -317.45 -325.569 -332.185 -337.336 -341.059 -343.38 -344.325 -343.655 -341.577 -338.102 -333.205 -326.862 -319.045 -309.686 -298.738 -286.145 -271.823 -255.729 -237.821 -218.056 -196.421 -172.899 -147.498 -120.271 -91.2658 -60.5888 -28.4048 5.02466 38.4733 73.6117 109.335 145.125 180.53 215.155 248.531 280.22 309.764 336.709 360.675 381.311 398.285 411.352 420.323 425.041 425.463 421.518 413.285 400.888 384.506 364.409 340.897 314.293 285.018 253.505 220.179 185.517 149.958 113.925 77.8401 42.0419 8.75137 -25.3596 -58.1945 -89.5648 -119.313 -147.324 -173.51 -197.81 -220.197 -240.653 -259.168 -275.76 -290.449 -303.263 -314.228 -323.388 -330.781 -336.433 -340.389 -342.698 -343.396 -342.503 -340.114 -336.28 -331.045 -324.441 -316.495 -307.212 -296.584 -284.586 -271.18 -256.32 -239.953 -222.028 -202.5 -181.34 -158.534 -134.097 -108.068 -80.5179 -51.5492 -21.2992 10.0606 42.4283 75.3735 108.733 142.206 175.464 208.148 239.879 270.256 298.859 325.263 349.045 369.791 387.109 400.65 410.118 415.282 415.991 412.187 403.893 391.216 374.351 353.573 329.223 301.704 271.457 238.963 204.72 169.235 133.009 96.5251 60.2488 24.6329 -9.92937 -43.1087 -74.6294 -104.284 -131.93 -157.481 -180.908 -202.233 -221.503 -238.795 -254.201 -267.818 -279.747 -290.087 -298.93 -306.36 -312.453 -317.263 -320.834 -323.205 -324.397 -324.421 -323.283 -320.97 -317.458 -312.719 -306.714 -299.397 -290.715 -280.605 -268.995 -255.814 -240.984 -224.437 -206.109 -185.954 -163.938 -140.059 -114.338 -86.8346 -57.6484 -26.9245 5.14592 38.3282 72.3087 106.755 141.295 175.522 208.998 241.272 271.884 300.375 326.308 349.268 368.879 384.816 396.809 404.664 408.254 407.535 402.541 393.377 380.215 363.287 342.884 319.344 293.038 264.366 233.742 201.587 168.318 134.347 100.065 65.8386 32.0135 -1.10327 -33.2383 -64.1551 -93.6603 -121.598 -147.85 -172.333 -194.993 -215.803 -234.758 -251.87 -267.166 -280.681 -292.453 -302.521 -310.921 -317.684 -322.847 -326.445 -328.508 -329.076 -328.188 -325.867 -322.139 -317.025 -310.534 -302.676 -293.458 -282.878 -270.931 -257.611 -242.903 -226.781 -209.212 -190.148 -169.545 -147.37 -123.598 -98.2269 -71.2841 -42.832 -12.9752 18.142 50.3299 83.2841 116.723 150.293 183.595 216.192 247.616 277.389 305.031 330.076 352.088 370.672 385.495 396.283 402.836 405.05 402.961 396.555 385.976 371.441 353.229 331.658 307.115 280.024 250.802 219.889 187.736 154.79 121.455 88.1006 55.1108 23.087 -7.72565 -37.8902 -67.0177 -94.882 -121.353 -146.333 -169.761 -191.597 -211.818 -230.408 -247.357 -262.65 -276.283 -288.253 -298.558 -307.206 -314.211 -319.589 -323.359 -325.549 -326.177 -325.196 -322.653 -318.585 -312.988 -305.855 -297.171 -286.928 -275.113 -261.72 -246.729 -230.15 -211.993 -192.256 -170.967 -148.162 -123.921 -98.3305 -71.4874 -43.5135 -14.5691 14.4647 44.7342 75.4674 106.402 137.23 167.651 197.412 226.184 253.599 279.322 302.982 324.255 342.82 358.392 370.742 379.652 384.978 386.622 384.096 377.582 367.244 353.226 335.727 315.108 291.82 -236.226 -254.002 -270.155 -284.66 -297.491 -308.7 -318.327 -326.418 -333.008 -338.136 -341.84 -344.145 -345.071 -344.418 -342.352 -338.891 -334.019 -327.704 -319.918 -310.597 -299.689 -287.137 -272.856 -256.801 -238.926 -219.191 -197.578 -174.07 -148.67 -121.426 -92.3874 -61.65 -29.3759 4.1954 37.6843 73.0163 108.951 144.967 180.611 215.488 249.125 281.078 310.883 338.076 362.271 383.111 400.256 413.457 422.52 427.287 427.717 423.732 415.414 402.894 386.347 366.053 342.316 315.464 285.931 254.152 220.563 185.649 149.852 113.604 77.3385 41.425 7.8257 -26.3393 -59.2508 -90.6828 -120.474 -148.509 -174.706 -199.004 -221.379 -241.816 -260.309 -276.873 -291.533 -304.319 -315.254 -324.384 -331.75 -337.375 -341.301 -343.58 -344.251 -343.332 -340.922 -337.07 -331.823 -325.214 -317.271 -307.999 -297.39 -285.417 -272.043 -257.217 -240.885 -222.994 -203.494 -182.353 -159.556 -135.115 -109.068 -81.4819 -52.4587 -22.1353 9.32205 41.7893 74.8743 108.39 142.04 175.494 208.395 240.357 270.977 299.832 326.491 350.52 371.5 389.027 402.743 412.345 417.594 418.335 414.507 406.132 393.323 376.279 355.282 330.682 302.89 272.357 239.571 205.04 169.278 132.79 96.0655 59.5716 23.7687 -10.946 -44.2432 -75.8485 -105.554 -133.221 -158.768 -182.168 -203.451 -222.668 -239.901 -255.243 -268.797 -280.665 -290.949 -299.741 -307.127 -313.184 -317.965 -321.515 -323.87 -325.055 -325.079 -323.947 -321.647 -318.153 -313.438 -307.462 -300.179 -291.537 -281.471 -269.909 -256.776 -241.994 -225.492 -207.204 -187.08 -165.084 -141.211 -115.478 -87.9422 -58.7 -27.8944 4.28511 37.6048 71.7514 106.39 141.146 175.608 209.338 241.875 272.754 301.509 327.695 350.889 370.706 386.813 398.936 406.873 410.497 409.762 404.704 395.431 382.12 365.009 344.395 320.625 294.076 265.156 234.284 201.887 168.388 134.203 99.7242 65.3218 31.3431 -1.90499 -34.1474 -65.149 -94.7167 -122.697 -148.974 -173.466 -196.122 -216.919 -235.853 -252.937 -268.203 -281.687 -293.429 -303.469 -311.842 -318.581 -323.72 -327.295 -329.339 -329.889 -328.987 -326.656 -322.921 -317.803 -311.312 -303.459 -294.247 -283.677 -271.746 -258.444 -243.76 -227.668 -210.131 -191.099 -170.527 -148.376 -124.618 -99.2476 -72.2878 -43.7965 -13.8775 17.3295 49.6438 82.7475 116.367 150.147 183.684 216.536 248.231 278.28 306.196 331.502 353.755 372.55 387.543 398.455 405.085 407.323 405.202 398.711 388.006 373.304 354.886 333.084 308.297 280.95 251.467 220.297 187.902 154.731 121.189 87.6574 54.5342 22.4082 -8.51538 -38.7607 -67.949 -95.8571 -122.354 -147.348 -170.78 -192.612 -212.827 -231.406 -248.344 -263.627 -277.248 -289.205 -299.497 -308.13 -315.12 -320.482 -324.238 -326.415 -327.034 -326.046 -323.504 -319.439 -313.85 -306.729 -298.057 -287.83 -276.031 -262.651 -247.673 -231.104 -212.954 -193.218 -171.92 -149.099 -124.833 -99.2086 -72.3212 -44.2954 -15.2839 13.9205 44.2862 75.1352 106.206 137.186 167.774 197.717 226.688 254.31 280.241 304.103 325.565 344.304 360.03 372.508 381.517 386.91 388.588 386.051 379.488 369.061 354.921 337.267 316.462 292.97 -237.383 -255.126 -271.242 -285.708 -298.502 -309.674 -319.268 -327.328 -333.89 -338.994 -342.676 -344.964 -345.877 -345.233 -343.182 -339.736 -334.89 -328.605 -320.852 -311.572 -300.708 -288.199 -273.964 -257.95 -240.112 -220.409 -198.821 -175.328 -149.929 -122.669 -93.5947 -62.7941 -30.423 3.30509 36.8248 72.3718 108.535 144.794 180.693 215.841 249.758 281.995 312.081 339.543 363.985 385.043 402.373 415.718 424.88 429.701 430.139 426.109 417.701 405.049 388.324 367.817 343.838 316.72 286.909 254.843 220.97 185.786 149.732 113.254 76.7947 40.7452 6.83965 -27.3958 -60.3887 -91.8859 -121.723 -149.784 -175.99 -200.286 -222.648 -243.064 -261.533 -278.068 -292.695 -305.45 -316.353 -325.451 -332.787 -338.384 -342.28 -344.526 -345.167 -344.222 -341.787 -337.916 -332.656 -326.042 -318.101 -308.841 -298.252 -286.308 -272.967 -258.179 -241.885 -224.03 -204.561 -183.441 -160.655 -136.209 -110.143 -82.5191 -53.4384 -23.0359 8.52383 41.1008 74.3337 108.018 141.856 175.522 208.653 240.864 271.747 300.873 327.805 352.101 373.332 391.086 404.992 414.739 420.079 420.854 417 408.54 395.588 378.351 357.116 332.247 304.16 273.319 240.219 205.379 169.318 132.55 95.5664 58.8378 22.8346 -12.044 -45.4666 -77.1625 -106.922 -134.612 -160.152 -183.523 -204.759 -223.919 -241.086 -256.359 -269.846 -281.648 -291.871 -300.609 -307.948 -313.966 -318.717 -322.244 -324.583 -325.758 -325.782 -324.657 -322.371 -318.897 -314.208 -308.262 -301.017 -292.417 -282.399 -270.888 -257.807 -243.077 -226.625 -208.378 -188.288 -166.315 -142.449 -116.704 -89.1347 -59.8334 -28.9401 3.35582 36.8223 71.1475 105.992 140.979 175.696 209.697 242.518 273.685 302.725 329.183 352.629 372.668 388.959 401.221 409.247 412.907 412.155 407.029 397.638 384.166 366.857 346.016 321.998 295.188 265.999 234.861 202.205 168.459 134.043 99.3541 64.7622 30.6191 -2.76989 -35.127 -66.2193 -95.8534 -123.879 -150.182 -174.684 -197.336 -218.117 -237.028 -254.082 -269.315 -282.766 -294.475 -304.484 -312.829 -319.542 -324.655 -328.207 -330.228 -330.76 -329.843 -327.501 -323.759 -318.636 -312.146 -304.297 -295.093 -284.534 -272.618 -259.336 -244.677 -228.617 -211.115 -192.119 -171.581 -149.456 -125.714 -100.345 -73.3682 -44.836 -14.8504 16.4513 48.9017 82.165 115.978 149.984 183.773 216.9 248.886 279.233 307.443 333.033 355.544 374.567 389.744 400.79 407.504 409.77 407.61 401.03 390.189 375.304 356.663 334.613 309.564 281.941 252.175 220.729 188.076 154.662 120.897 87.1757 53.9105 21.6739 -9.36543 -39.6975 -68.951 -96.9058 -123.431 -148.438 -171.873 -193.702 -213.908 -232.477 -249.403 -264.674 -278.282 -290.226 -300.504 -309.121 -316.094 -321.44 -325.179 -327.343 -327.951 -326.956 -324.415 -320.353 -314.773 -307.665 -299.007 -288.797 -277.014 -263.648 -248.684 -232.127 -213.984 -194.25 -172.943 -150.105 -125.813 -100.152 -73.2164 -45.1342 -16.0506 13.3298 43.7996 74.774 105.992 137.135 167.9 198.04 227.225 255.071 281.226 305.304 326.97 345.897 361.787 374.403 383.519 388.984 390.699 388.148 381.533 371.013 356.741 338.92 317.916 294.203 -238.619 -256.326 -272.403 -286.827 -299.579 -310.713 -320.27 -328.298 -334.831 -339.907 -343.567 -345.838 -346.742 -346.099 -344.065 -340.637 -335.819 -329.566 -321.848 -312.611 -301.794 -289.332 -275.147 -259.179 -241.378 -221.71 -200.15 -176.673 -151.277 -124 -94.8891 -64.0227 -31.5471 2.35216 35.8917 71.6775 108.085 144.603 180.776 216.214 250.43 282.971 313.359 341.108 365.815 387.108 404.637 418.135 427.404 432.283 432.731 428.651 420.147 407.354 390.437 369.703 345.463 318.06 287.95 255.576 221.401 185.926 149.596 112.873 76.2046 39.9975 5.79579 -28.529 -61.6089 -93.1751 -123.06 -151.147 -177.363 -201.656 -224.003 -244.397 -262.839 -279.343 -293.935 -306.656 -317.526 -326.591 -333.894 -339.461 -343.324 -345.535 -346.143 -345.17 -342.709 -338.817 -333.543 -326.923 -318.985 -309.738 -299.171 -287.256 -273.952 -259.205 -242.952 -225.137 -205.701 -184.605 -161.83 -137.381 -111.294 -83.6306 -54.4891 -24.0024 7.66517 40.3614 73.7508 107.614 141.654 175.545 208.923 241.4 272.564 301.98 329.205 353.788 375.29 393.288 407.398 417.3 422.739 423.55 419.669 411.117 398.011 380.566 359.078 333.918 305.516 274.344 240.907 205.735 169.354 132.287 95.0261 58.0457 21.8284 -13.225 -46.7809 -78.573 -108.389 -136.101 -161.634 -184.973 -206.158 -225.254 -242.352 -257.551 -270.964 -282.697 -292.854 -301.533 -308.822 -314.799 -319.517 -323.02 -325.342 -326.508 -326.531 -325.414 -323.142 -319.689 -315.027 -309.115 -301.909 -293.356 -283.388 -271.932 -258.907 -244.234 -227.834 -209.634 -189.581 -167.633 -143.774 -118.018 -90.4135 -61.0496 -30.0631 2.35623 35.9796 70.4955 105.56 140.795 175.783 210.076 243.201 274.676 304.022 330.772 354.488 374.766 391.255 403.666 411.788 415.487 414.717 409.516 399.998 386.354 368.832 347.748 323.463 296.372 266.896 235.473 202.539 168.529 133.867 98.953 64.1584 29.8398 -3.69899 -36.1788 -67.367 -97.0717 -125.145 -151.475 -175.986 -198.633 -219.397 -238.282 -255.305 -270.502 -283.916 -295.591 -305.566 -313.881 -320.567 -325.653 -329.178 -331.177 -331.689 -330.755 -328.401 -324.651 -319.524 -313.035 -305.19 -295.994 -285.447 -273.548 -260.287 -245.655 -229.629 -212.165 -193.209 -172.706 -150.611 -126.887 -101.521 -74.5262 -45.9519 -15.895 15.5058 48.102 81.5355 115.555 149.801 183.861 217.283 249.581 280.247 308.773 334.667 357.458 376.724 392.098 403.29 410.094 412.392 410.186 403.512 392.524 377.441 358.562 336.248 310.916 282.996 252.926 221.187 188.256 154.58 120.577 86.6537 53.2362 20.8847 -10.2758 -40.7014 -70.0246 -98.0288 -124.582 -149.604 -173.041 -194.866 -215.063 -233.62 -250.533 -265.792 -279.386 -291.315 -301.578 -310.178 -317.133 -322.463 -326.184 -328.332 -328.931 -327.925 -325.386 -321.328 -315.756 -308.663 -300.021 -289.828 -278.064 -264.713 -249.765 -233.219 -215.085 -195.354 -174.037 -151.181 -126.86 -101.16 -74.1737 -46.0303 -16.8703 12.692 43.2731 74.3828 105.759 137.076 168.03 198.378 227.793 255.88 282.276 306.587 328.471 347.599 363.665 376.428 385.659 391.202 392.957 390.391 383.72 373.099 358.688 340.687 319.469 295.52 -239.933 -257.602 -273.636 -288.016 -300.724 -311.817 -321.335 -329.328 -335.83 -340.878 -344.513 -346.766 -347.669 -347.017 -345.003 -341.594 -336.803 -330.585 -322.907 -313.715 -302.948 -290.537 -276.405 -260.485 -242.725 -223.094 -201.565 -178.105 -152.713 -125.421 -96.2716 -65.3376 -32.7511 1.3377 34.8805 70.9328 107.601 144.394 180.857 216.604 251.141 284.006 314.716 342.773 367.762 389.307 407.047 420.711 430.093 435.034 435.492 431.359 422.755 409.809 392.688 371.711 347.192 319.484 289.055 256.351 221.853 186.068 149.443 112.46 75.5655 39.1803 4.69311 -29.7392 -62.9125 -94.5515 -124.485 -152.601 -178.827 -203.115 -225.447 -245.815 -264.229 -280.699 -295.254 -307.938 -318.773 -327.802 -335.071 -340.605 -344.435 -346.609 -347.179 -346.177 -343.687 -339.774 -334.484 -327.858 -319.923 -310.689 -300.146 -288.263 -274.999 -260.295 -244.088 -226.315 -206.916 -185.846 -163.084 -138.632 -112.523 -84.8177 -55.6116 -25.0363 6.74514 39.5699 73.1244 107.177 141.432 175.562 209.204 241.964 273.427 303.154 330.692 355.582 377.374 395.633 409.962 420.031 425.576 426.427 422.516 413.865 400.594 382.927 361.167 335.696 306.956 275.431 241.634 206.107 169.386 131.998 94.4432 57.1932 20.748 -14.4906 -48.1886 -80.0813 -109.957 -137.692 -163.215 -186.518 -207.648 -226.675 -243.698 -258.818 -272.152 -283.809 -293.898 -302.514 -309.748 -315.683 -320.366 -323.843 -326.147 -327.303 -327.325 -326.217 -323.96 -320.529 -315.897 -310.02 -302.857 -294.352 -284.438 -273.041 -260.078 -245.464 -229.121 -210.971 -190.959 -169.037 -145.188 -119.42 -91.7793 -62.35 -31.2652 1.28515 35.0746 69.7937 105.092 140.591 175.869 210.473 243.922 275.727 305.399 332.462 356.467 377.002 393.702 406.274 414.498 418.238 417.448 412.167 402.514 388.684 370.935 349.59 325.02 297.629 267.847 236.119 202.888 168.597 133.672 98.5194 63.5094 29.0039 -4.69372 -37.3038 -68.5934 -98.3726 -126.496 -152.854 -177.374 -200.015 -220.76 -239.617 -256.605 -271.764 -285.138 -296.777 -306.717 -314.999 -321.656 -326.713 -330.211 -332.185 -332.676 -331.724 -329.358 -325.599 -320.468 -313.979 -306.138 -296.951 -286.417 -274.534 -261.297 -246.694 -230.703 -213.282 -194.368 -173.903 -151.841 -128.138 -102.775 -75.7631 -47.1451 -17.0133 14.4916 47.2429 80.857 115.096 149.598 183.946 217.683 250.314 281.321 310.187 336.405 359.496 379.022 394.608 405.957 412.857 415.184 412.932 406.16 395.013 379.716 360.583 337.988 312.353 284.113 253.721 221.668 188.441 154.485 120.228 86.0894 52.5041 20.0441 -11.2463 -41.7731 -71.171 -99.2269 -125.809 -150.846 -174.285 -196.104 -216.29 -234.835 -251.735 -266.98 -280.56 -292.473 -302.72 -311.302 -318.238 -323.549 -327.251 -329.383 -329.972 -328.955 -326.416 -322.364 -316.799 -309.723 -301.098 -290.924 -279.18 -265.845 -250.913 -234.382 -216.255 -196.529 -175.203 -152.327 -127.976 -102.234 -75.1937 -46.9844 -17.7436 12.0063 42.7053 73.9606 105.505 137.007 168.162 198.732 228.393 256.737 283.392 307.95 330.067 349.411 365.665 378.585 387.938 393.565 395.362 392.78 386.049 375.322 360.761 342.569 321.123 296.921 -241.326 -258.954 -274.942 -289.274 -301.936 -312.985 -322.462 -330.418 -336.888 -341.906 -345.514 -347.748 -348.643 -347.987 -345.994 -342.607 -337.845 -331.663 -324.027 -314.883 -304.17 -291.814 -277.738 -261.87 -244.152 -224.562 -203.067 -179.627 -154.24 -126.933 -97.7433 -66.7408 -34.0385 0.260019 33.7892 70.1379 107.081 144.165 180.937 217.012 251.888 285.099 316.152 344.537 369.828 391.641 409.607 423.446 432.949 437.957 438.424 434.234 425.526 412.415 395.078 373.842 349.024 320.992 290.222 257.167 222.327 186.209 149.272 112.013 74.8746 38.2932 3.52886 -31.0273 -64.3008 -96.016 -126.002 -154.146 -180.38 -204.663 -226.977 -247.319 -265.702 -282.137 -296.652 -309.295 -320.093 -329.086 -336.318 -341.817 -345.612 -347.746 -348.28 -347.241 -344.723 -340.786 -335.479 -328.846 -320.915 -311.694 -301.176 -289.328 -276.106 -261.45 -245.291 -227.565 -208.205 -187.163 -164.415 -139.961 -113.83 -86.081 -56.807 -26.1389 5.76236 38.7249 72.4533 106.706 141.189 175.573 209.494 242.555 274.336 304.393 332.264 357.482 379.584 398.122 412.686 422.934 428.593 429.486 425.542 416.786 403.34 385.434 363.384 337.581 308.481 276.579 242.399 206.494 169.411 131.684 93.8162 56.2787 19.591 -15.8427 -49.6915 -81.6898 -111.628 -139.385 -164.897 -188.16 -209.231 -228.183 -245.124 -260.161 -273.41 -284.987 -295.002 -303.551 -310.727 -316.616 -321.263 -324.712 -326.998 -328.144 -328.165 -327.065 -324.826 -321.418 -316.817 -310.978 -303.859 -295.405 -285.551 -274.216 -261.317 -246.768 -230.486 -212.39 -192.421 -170.528 -146.691 -120.913 -93.2335 -63.7361 -32.5483 0.140866 34.1059 69.0408 104.587 140.366 175.952 210.886 244.681 276.838 306.857 334.254 358.568 379.375 396.302 409.044 417.378 421.161 420.35 414.984 405.185 391.158 373.166 351.542 326.669 298.959 268.85 236.798 203.253 168.662 133.459 98.0519 62.8141 28.1101 -5.75567 -38.5033 -69.8998 -99.7573 -127.933 -154.32 -178.849 -201.483 -222.207 -241.033 -257.983 -273.101 -286.433 -298.032 -307.936 -316.184 -322.81 -327.836 -331.305 -333.253 -333.72 -332.749 -330.37 -326.602 -321.467 -314.978 -307.142 -297.964 -287.443 -275.579 -262.365 -247.792 -231.84 -214.464 -195.596 -175.174 -153.147 -129.466 -104.108 -77.0799 -48.4166 -18.207 13.407 46.3227 80.127 114.6 149.373 184.028 218.099 251.086 282.456 311.683 338.249 361.658 381.463 397.276 408.793 415.792 418.145 415.853 408.974 397.657 382.131 362.728 339.833 313.874 285.293 254.557 222.173 188.629 154.374 119.85 85.4799 51.7069 19.1563 -12.2772 -42.9137 -72.3913 -100.501 -127.113 -152.165 -175.605 -197.417 -217.591 -236.123 -253.008 -268.238 -281.804 -293.7 -303.93 -312.493 -319.408 -324.699 -328.382 -330.496 -331.073 -330.044 -327.505 -323.46 -317.904 -310.845 -302.239 -292.085 -280.362 -267.046 -252.131 -235.614 -217.497 -197.776 -176.44 -153.543 -129.161 -103.375 -76.2772 -47.997 -18.67 11.2706 42.0948 73.5061 105.23 136.928 168.295 199.1 229.023 257.643 284.572 309.395 331.76 351.331 367.787 380.873 390.356 396.073 397.913 395.316 388.522 377.681 362.961 344.567 322.877 298.405 -242.799 -260.383 -276.322 -290.603 -303.215 -314.217 -323.652 -331.568 -338.003 -342.99 -346.57 -348.782 -349.665 -349.011 -347.039 -343.676 -338.942 -332.8 -325.209 -316.116 -305.459 -293.163 -279.146 -263.334 -245.662 -226.114 -204.657 -181.239 -155.857 -128.535 -99.3062 -68.2348 -35.4135 -0.888367 32.6211 69.2936 106.525 143.915 181.013 217.436 252.672 286.249 317.668 346.4 372.013 394.11 412.315 426.34 435.974 441.052 441.527 437.279 428.46 415.174 397.607 376.096 350.96 322.585 291.451 258.025 222.82 186.349 149.082 111.53 74.1287 37.337 2.29961 -32.395 -65.775 -97.5699 -127.609 -155.783 -182.024 -206.301 -228.596 -248.909 -267.258 -283.655 -298.129 -310.729 -321.487 -330.442 -337.636 -343.096 -346.854 -348.949 -349.439 -348.364 -345.816 -341.853 -336.528 -329.887 -321.959 -312.753 -302.262 -290.451 -277.274 -262.669 -246.563 -228.886 -209.569 -188.558 -165.826 -141.37 -115.216 -87.4217 -58.0766 -27.3113 4.71519 37.8253 71.7356 106.2 140.924 175.575 209.792 243.172 275.29 305.697 333.923 359.489 381.92 400.757 415.572 426.011 431.79 432.728 428.751 419.883 406.249 388.09 365.73 339.574 310.091 277.788 243.202 206.895 169.429 131.341 93.143 55.2998 18.3553 -17.2837 -51.2914 -83.4006 -113.403 -141.182 -166.681 -189.899 -210.905 -229.778 -246.631 -261.578 -274.738 -286.228 -296.165 -304.645 -311.759 -317.599 -322.208 -325.628 -327.894 -329.029 -329.049 -327.959 -325.738 -322.355 -317.786 -311.987 -304.915 -296.517 -286.724 -275.457 -262.627 -248.146 -231.929 -213.89 -193.969 -172.108 -148.284 -122.496 -94.7777 -65.2095 -33.9141 -1.07823 33.0713 68.235 104.043 140.119 176.031 211.315 245.476 278.007 308.395 336.148 360.79 381.888 399.057 411.98 420.429 424.26 423.425 417.967 408.015 393.777 375.527 353.607 328.41 300.36 269.905 237.509 203.63 168.722 133.225 97.5493 62.0708 27.1568 -6.88612 -39.779 -71.2874 -101.227 -129.456 -155.874 -180.41 -203.036 -223.738 -242.53 -259.439 -274.513 -287.801 -299.357 -309.222 -317.434 -324.027 -329.021 -332.46 -334.379 -334.821 -333.831 -331.437 -327.66 -322.52 -316.032 -308.201 -299.032 -288.525 -276.68 -263.491 -248.95 -233.039 -215.712 -196.893 -176.517 -154.528 -130.874 -105.523 -78.4779 -49.768 -19.4779 12.2503 45.3399 79.3432 114.063 149.124 184.104 218.53 251.893 283.651 313.262 340.197 363.946 384.047 400.103 411.799 418.902 421.28 418.949 411.957 400.455 384.687 364.998 341.783 315.478 286.534 255.436 222.7 188.818 154.247 119.44 84.823 50.8406 18.2216 -13.3687 -44.1245 -73.6869 -101.852 -128.494 -153.56 -177 -198.805 -218.966 -237.482 -254.353 -269.568 -283.118 -294.997 -305.207 -313.752 -320.644 -325.913 -329.575 -331.67 -332.233 -331.194 -328.653 -324.616 -319.07 -312.028 -303.444 -293.311 -281.611 -268.315 -253.417 -236.916 -218.811 -199.095 -177.75 -154.831 -130.415 -104.583 -77.4252 -49.0699 -19.647 10.4811 41.4398 73.0184 104.933 136.838 168.428 199.48 229.682 258.595 285.818 310.92 333.548 353.363 370.032 383.295 392.916 398.727 400.611 398.001 391.139 380.178 365.29 346.681 324.733 299.974 -244.35 -261.888 -277.775 -292.002 -304.561 -315.514 -324.904 -332.778 -339.176 -344.131 -347.682 -349.868 -350.736 -350.091 -348.136 -344.8 -340.096 -333.995 -326.453 -317.412 -306.815 -294.584 -280.63 -264.877 -247.254 -227.75 -206.334 -182.942 -157.566 -130.23 -100.962 -69.8217 -36.8822 -2.13081 31.3971 68.4006 105.931 143.642 181.085 217.875 253.491 287.457 319.262 348.364 374.317 396.717 415.175 429.397 439.169 444.32 444.802 440.495 431.56 418.087 400.277 378.473 353.001 324.262 292.741 258.922 223.333 186.485 148.871 111.009 73.3264 36.311 1.00149 -33.8437 -67.3367 -99.2145 -129.309 -157.512 -183.76 -208.028 -230.304 -250.587 -268.897 -285.255 -299.685 -312.239 -322.954 -331.869 -339.024 -344.444 -348.163 -350.214 -350.66 -349.547 -346.965 -342.974 -337.631 -330.981 -323.055 -313.866 -303.403 -291.632 -278.503 -263.953 -247.902 -230.28 -211.009 -190.031 -167.317 -142.859 -116.683 -88.8413 -59.4215 -28.555 3.60205 36.8696 70.9703 105.657 140.634 175.569 210.096 243.813 276.288 307.066 335.667 361.602 384.385 403.538 418.62 429.263 435.172 436.157 432.145 423.157 409.324 390.895 368.206 341.675 311.786 279.057 244.04 207.309 169.436 130.969 92.4219 54.2538 17.0388 -18.8163 -52.9902 -85.2156 -115.285 -143.085 -168.568 -191.736 -212.673 -231.46 -248.219 -263.071 -276.136 -287.535 -297.388 -305.794 -312.842 -318.631 -323.201 -326.59 -328.834 -329.959 -329.978 -328.898 -326.696 -323.34 -318.805 -313.049 -306.026 -297.685 -287.958 -276.763 -264.006 -249.599 -233.452 -215.474 -195.604 -173.778 -149.969 -124.172 -96.4141 -66.7718 -35.3639 -2.37457 31.9687 67.3744 103.458 139.847 176.104 211.759 246.308 279.235 310.014 338.144 363.134 384.541 401.967 415.083 423.656 427.535 426.674 421.12 411.003 396.541 378.017 355.783 330.243 301.834 271.012 238.252 204.021 168.777 132.968 97.01 61.2773 26.1428 -8.08674 -41.1324 -72.7578 -102.783 -131.068 -157.517 -182.06 -204.675 -225.353 -244.109 -260.974 -276.001 -289.24 -300.752 -310.576 -318.75 -325.309 -330.269 -333.675 -335.564 -335.98 -334.969 -332.56 -328.773 -323.629 -317.141 -309.315 -300.156 -289.664 -277.838 -264.674 -250.167 -234.301 -217.025 -198.261 -177.934 -155.987 -132.361 -107.02 -79.9586 -51.2005 -20.8271 11.0191 44.2922 78.5036 113.484 148.848 184.171 218.974 252.736 284.906 314.923 342.251 366.361 386.777 403.091 414.976 422.19 424.597 422.224 415.11 403.41 387.385 367.394 343.84 317.164 287.838 256.357 223.247 189.006 154.101 118.998 84.1161 49.9 17.2421 -14.5219 -45.4073 -75.059 -103.28 -129.954 -155.033 -178.473 -200.267 -220.414 -238.915 -255.769 -270.967 -284.501 -296.362 -306.553 -315.077 -321.946 -327.191 -330.831 -332.906 -333.454 -332.404 -329.859 -325.831 -320.298 -313.273 -304.712 -294.602 -282.927 -269.652 -254.772 -238.289 -220.197 -200.487 -179.133 -156.189 -131.739 -105.858 -78.6384 -50.204 -20.6724 9.63357 40.7388 72.4962 104.613 136.736 168.56 199.871 230.368 259.595 287.129 312.528 335.433 355.505 372.4 385.85 395.618 401.528 403.457 400.836 393.902 382.815 367.749 348.913 326.691 301.628 -245.981 -263.471 -279.301 -293.471 -305.973 -316.874 -326.217 -334.048 -340.407 -345.327 -348.849 -351.006 -351.856 -351.225 -349.283 -345.977 -341.306 -335.248 -327.757 -318.773 -308.238 -296.076 -282.189 -266.5 -248.929 -229.471 -208.099 -184.737 -159.367 -132.018 -102.713 -71.5035 -38.4501 -3.51761 30.1632 67.4601 105.298 143.345 181.151 218.327 254.345 288.721 320.935 350.428 376.741 399.461 418.186 432.618 442.536 447.763 448.251 443.886 434.826 421.155 403.089 380.975 355.147 326.023 294.093 259.86 223.862 186.616 148.638 110.447 72.4674 35.2139 -0.369407 -35.3752 -68.9876 -100.951 -131.102 -159.336 -185.59 -209.847 -232.1 -252.351 -270.621 -286.937 -301.32 -313.826 -324.495 -333.368 -340.483 -345.861 -349.538 -351.544 -351.944 -350.787 -348.169 -344.151 -338.786 -332.127 -324.204 -315.031 -304.599 -292.87 -279.793 -265.301 -249.311 -231.746 -212.525 -191.583 -168.889 -144.431 -118.232 -90.3412 -60.8436 -29.8714 2.42228 35.8554 70.1564 105.077 140.318 175.551 210.406 244.477 277.329 308.498 337.496 363.823 386.978 406.468 421.833 432.694 438.739 439.774 435.725 426.611 412.567 393.851 370.814 343.885 313.565 280.387 244.914 207.735 169.432 130.566 91.6516 53.1377 15.6388 -20.4436 -54.7904 -87.1375 -117.276 -145.095 -170.56 -193.674 -214.534 -233.231 -249.889 -264.639 -277.603 -288.905 -298.671 -306.998 -313.978 -319.712 -324.242 -327.599 -329.82 -330.932 -330.951 -329.882 -327.7 -324.372 -319.874 -314.161 -307.191 -298.911 -289.254 -278.134 -265.455 -251.126 -235.053 -217.141 -197.326 -175.539 -151.745 -125.942 -98.1441 -68.425 -36.8998 -3.75041 30.7967 66.4567 102.831 139.548 176.17 212.216 247.175 280.521 311.713 340.242 365.603 387.337 405.035 418.356 427.058 430.99 430.101 424.444 414.153 399.453 380.639 358.071 332.168 303.378 272.17 239.024 204.422 168.824 132.689 96.432 60.4333 25.0651 -9.35952 -42.5649 -74.3129 -104.427 -132.77 -159.249 -183.799 -206.402 -227.053 -245.771 -262.588 -277.564 -290.753 -302.217 -311.998 -320.132 -326.655 -331.58 -334.952 -336.809 -337.195 -336.163 -333.739 -329.941 -324.792 -318.304 -310.484 -301.336 -290.858 -279.053 -265.916 -251.443 -235.624 -218.405 -199.699 -179.425 -157.523 -133.928 -108.601 -81.5239 -52.7156 -22.2563 9.71427 43.1747 77.6058 112.861 148.545 184.229 219.429 253.613 286.218 316.667 344.409 368.903 389.654 406.242 418.327 425.659 428.099 425.679 418.433 406.524 390.229 369.917 346 318.933 289.203 257.319 223.814 189.191 153.936 118.523 83.3563 48.8784 16.2223 -15.7383 -46.7639 -76.509 -104.787 -131.493 -156.584 -180.023 -201.806 -221.936 -240.42 -257.257 -272.438 -285.955 -297.797 -307.967 -316.47 -323.314 -328.533 -332.149 -334.202 -334.733 -333.673 -331.124 -327.106 -321.586 -314.579 -306.043 -295.959 -284.309 -271.057 -256.196 -239.732 -221.655 -201.952 -180.59 -157.62 -133.134 -107.202 -79.9176 -51.4007 -21.7491 8.72896 39.9904 71.9383 104.269 136.62 168.688 200.271 231.082 260.642 288.505 314.217 337.416 357.76 374.893 388.54 398.464 404.479 406.45 403.822 396.813 385.592 370.338 351.263 328.752 303.367 -247.691 -265.13 -280.901 -295.009 -307.453 -318.299 -327.593 -335.378 -341.695 -346.58 -350.07 -352.197 -353.026 -352.411 -350.483 -347.209 -342.574 -336.559 -329.122 -320.198 -309.728 -297.64 -283.826 -268.202 -250.686 -231.276 -209.953 -186.624 -161.262 -133.9 -104.559 -73.2818 -40.1203 -5.05267 28.9179 66.4711 104.624 143.023 181.21 218.791 255.232 290.04 322.685 352.592 379.287 402.344 421.352 436.004 446.077 451.384 451.875 447.454 438.26 424.381 406.044 383.601 357.399 327.867 295.505 260.837 224.406 186.741 148.381 109.841 71.5509 34.0441 -1.81643 -36.9915 -70.7294 -102.782 -132.991 -161.253 -187.513 -211.757 -233.986 -254.203 -272.43 -288.699 -303.035 -315.49 -326.11 -334.939 -342.012 -347.347 -350.979 -352.938 -353.286 -352.085 -349.431 -345.381 -339.994 -333.324 -325.404 -316.249 -305.849 -294.165 -281.144 -266.713 -250.788 -233.286 -214.118 -193.216 -170.543 -146.085 -119.864 -91.9227 -62.3447 -31.2616 1.17449 34.7803 69.292 104.456 139.975 175.52 210.72 245.162 278.411 309.993 339.409 366.15 389.699 409.547 425.213 436.304 442.496 443.584 439.496 430.248 415.98 396.96 373.553 346.205 315.428 281.776 245.822 208.169 169.414 130.13 90.8303 51.9478 14.1522 -22.168 -56.6943 -89.1691 -119.376 -147.216 -172.657 -195.713 -216.491 -235.089 -251.64 -266.282 -279.14 -290.34 -300.012 -308.257 -315.164 -320.842 -325.329 -328.655 -330.851 -331.949 -331.968 -330.911 -328.751 -325.452 -320.991 -315.325 -308.409 -300.193 -290.611 -279.571 -266.975 -252.728 -236.734 -218.892 -199.137 -177.391 -153.617 -127.806 -99.9693 -70.1714 -38.5239 -5.20825 29.5531 65.4803 102.159 139.221 176.226 212.685 248.076 281.864 313.493 342.443 368.195 390.275 408.262 421.799 430.64 434.626 433.707 427.942 417.465 402.513 383.392 360.471 334.186 304.994 273.378 239.827 204.833 168.863 132.384 95.8144 59.536 23.923 -10.7062 -44.0781 -75.9544 -106.161 -134.562 -161.072 -185.628 -208.216 -228.839 -247.515 -264.282 -279.203 -292.338 -303.751 -313.487 -321.58 -328.066 -332.954 -336.289 -338.112 -338.468 -337.413 -334.973 -331.164 -326.009 -319.523 -311.708 -302.57 -292.109 -280.325 -267.214 -252.778 -237.008 -219.85 -201.207 -180.99 -159.137 -135.577 -110.265 -83.175 -54.3158 -23.7671 8.34423 41.9742 76.6473 112.191 148.212 184.275 219.894 254.524 287.588 318.493 346.674 371.575 392.68 409.556 421.854 429.311 431.785 429.316 421.928 409.799 393.22 372.567 348.264 320.785 290.631 258.322 224.397 189.372 153.751 118.012 82.5412 47.7649 15.1701 -17.02 -48.1965 -78.0386 -106.374 -133.113 -158.215 -181.65 -203.42 -223.532 -241.998 -258.817 -273.98 -287.479 -299.302 -309.45 -317.93 -324.749 -329.94 -333.53 -335.559 -336.069 -335.002 -332.448 -328.439 -322.935 -315.945 -307.438 -297.381 -285.758 -272.531 -257.689 -241.246 -223.186 -203.491 -182.121 -159.124 -134.601 -108.615 -81.2636 -52.6619 -22.8794 7.76744 39.193 71.3437 103.9 136.49 168.812 200.678 231.821 261.735 289.946 315.988 339.495 360.127 377.512 391.366 401.455 407.579 409.596 406.96 399.87 388.51 373.059 353.733 330.916 305.191 -249.481 -266.867 -282.574 -296.618 -309 -319.787 -329.03 -336.768 -343.041 -347.889 -351.346 -353.442 -354.232 -353.648 -351.738 -348.493 -343.897 -337.927 -330.547 -321.687 -311.284 -299.276 -285.539 -269.984 -252.525 -233.168 -211.896 -188.606 -163.252 -135.877 -106.503 -75.1579 -41.8948 -6.74987 27.6691 65.4311 103.907 142.673 181.259 219.266 256.151 291.415 324.514 354.857 381.954 405.367 424.672 439.557 449.793 455.184 455.68 451.2 441.863 427.765 409.144 386.353 359.758 329.795 296.978 261.852 224.963 186.859 148.097 109.188 70.5761 32.7996 -3.3426 -38.6946 -72.5638 -104.709 -134.976 -163.267 -189.53 -213.76 -235.962 -256.143 -274.324 -290.544 -304.828 -317.231 -327.799 -336.582 -343.611 -348.903 -352.489 -354.396 -354.688 -353.443 -350.749 -346.666 -341.255 -334.574 -326.656 -317.519 -307.154 -295.517 -282.554 -268.191 -252.335 -234.899 -215.79 -194.929 -172.28 -147.824 -121.579 -93.5873 -63.9259 -32.7269 -0.142548 33.643 68.3753 103.793 139.602 175.474 211.035 245.868 279.533 311.549 341.407 368.584 392.55 412.776 428.762 440.097 446.444 447.589 443.458 434.069 419.564 400.223 376.426 348.634 317.376 283.223 246.762 208.611 169.381 129.657 89.9578 50.6808 12.5769 -23.9916 -58.7045 -91.3119 -121.591 -149.448 -174.861 -197.854 -218.543 -237.035 -253.473 -268.001 -280.746 -291.839 -301.412 -309.571 -316.401 -322.019 -326.463 -329.756 -331.927 -333.008 -333.028 -331.984 -329.848 -326.579 -322.157 -316.539 -309.681 -301.533 -292.028 -281.074 -268.564 -254.405 -238.496 -220.729 -201.036 -179.335 -155.583 -129.767 -101.892 -72.0134 -40.2381 -6.74975 28.2337 64.443 101.44 138.865 176.271 213.165 249.009 283.264 315.353 344.747 370.912 393.358 411.65 425.416 434.402 438.446 437.494 431.615 420.941 405.724 386.278 362.985 336.295 306.681 274.634 240.656 205.252 168.891 132.051 95.1556 58.5837 22.7141 -12.129 -45.6741 -77.6843 -107.985 -136.447 -162.988 -187.548 -210.12 -230.712 -249.343 -266.054 -280.917 -293.995 -305.355 -315.044 -323.093 -329.542 -334.391 -337.687 -339.474 -339.798 -338.719 -336.262 -332.442 -327.281 -320.796 -312.987 -303.86 -293.415 -281.653 -268.57 -254.171 -238.455 -221.362 -202.786 -182.629 -160.829 -137.31 -112.014 -84.9132 -56.0039 -25.3613 6.89466 40.6998 75.6254 111.472 147.846 184.307 220.366 255.466 289.014 320.4 349.045 374.376 395.856 413.037 425.559 433.151 435.667 433.136 425.598 413.24 396.358 375.343 350.633 322.721 292.122 259.364 224.994 189.546 153.544 117.463 81.6697 46.562 14.08 -18.3703 -49.7077 -79.6492 -108.043 -134.813 -159.925 -183.355 -205.11 -225.202 -243.648 -260.449 -275.594 -289.073 -300.876 -311.001 -319.457 -326.249 -331.411 -334.973 -336.976 -337.462 -336.389 -333.831 -329.83 -324.344 -317.374 -308.896 -298.87 -287.273 -274.074 -259.253 -242.83 -224.791 -205.105 -183.727 -160.7 -136.14 -110.098 -82.6769 -53.9899 -24.0652 6.74877 38.3455 70.7108 103.505 136.346 168.93 201.089 232.584 262.873 291.453 317.842 341.672 362.607 380.257 394.329 404.592 410.832 412.901 410.25 403.078 391.571 375.912 356.323 333.186 307.1 -251.35 -268.682 -284.321 -298.296 -310.613 -321.341 -330.528 -338.218 -344.446 -349.253 -352.676 -354.74 -355.48 -354.935 -353.048 -349.83 -345.276 -339.353 -332.032 -323.239 -312.908 -300.982 -287.33 -271.847 -254.446 -235.145 -213.928 -190.682 -165.338 -137.948 -108.545 -77.1337 -43.7726 -8.56307 26.3644 64.3349 103.144 142.293 181.298 219.749 257.101 292.843 326.419 357.223 384.743 408.53 428.148 443.28 453.686 459.165 459.666 455.125 445.637 431.312 412.389 389.232 362.224 331.805 298.511 262.903 225.531 186.968 147.784 108.485 69.5414 31.4774 -4.94982 -40.4872 -74.493 -106.733 -137.058 -165.377 -191.643 -215.855 -238.028 -258.17 -276.304 -292.47 -306.701 -319.049 -329.563 -338.296 -345.281 -350.529 -354.067 -355.919 -356.15 -354.858 -352.123 -348.004 -342.567 -335.874 -327.959 -318.841 -308.512 -296.926 -284.026 -269.733 -253.951 -236.586 -217.54 -196.724 -174.101 -149.649 -123.381 -95.337 -65.5888 -34.2701 -1.53164 32.4418 67.4031 103.086 139.199 175.41 211.349 246.592 280.694 313.165 343.487 371.126 395.53 416.157 432.482 444.074 450.586 451.791 447.615 438.079 423.324 403.642 379.434 351.174 319.407 284.729 247.735 209.059 169.331 129.147 89.0329 49.3328 10.9095 -25.9172 -60.825 -93.5679 -123.921 -151.793 -177.175 -200.099 -220.692 -239.071 -255.388 -269.796 -282.421 -293.4 -302.871 -310.939 -317.688 -323.243 -327.643 -330.903 -333.048 -334.111 -334.129 -333.101 -330.991 -327.754 -323.372 -317.804 -311.006 -302.929 -293.505 -282.641 -270.224 -256.157 -240.338 -222.65 -203.025 -181.374 -157.646 -131.827 -103.913 -73.9528 -42.0449 -8.37725 26.836 63.3421 100.672 138.475 176.302 213.652 249.974 284.718 317.292 347.154 373.755 396.587 415.201 429.209 438.348 442.453 441.465 435.465 424.585 409.086 389.298 365.613 338.496 308.438 275.938 241.514 205.677 168.907 131.689 94.4536 57.5745 21.4368 -13.6298 -47.3545 -79.5041 -109.902 -138.425 -164.997 -189.56 -212.113 -232.671 -251.254 -267.907 -282.707 -295.725 -307.029 -316.668 -324.672 -331.083 -335.891 -339.147 -340.896 -341.184 -340.08 -337.607 -333.774 -328.607 -322.123 -314.32 -305.205 -294.777 -283.037 -269.983 -255.622 -239.961 -222.939 -204.437 -184.343 -162.6 -139.126 -113.851 -86.74 -57.7813 -27.0422 5.3619 39.3504 74.5383 110.701 147.445 184.323 220.845 256.44 290.496 322.389 351.524 377.308 399.184 416.687 429.446 437.18 439.74 437.14 429.445 416.846 399.645 378.244 353.106 324.741 293.675 260.442 225.603 189.714 153.315 116.874 80.7423 45.273 12.9461 -19.794 -51.3001 -81.3423 -109.794 -136.595 -161.716 -185.139 -206.876 -226.947 -245.372 -262.153 -277.279 -290.738 -302.52 -312.622 -321.052 -327.816 -332.946 -336.479 -338.454 -338.911 -337.834 -335.273 -331.278 -325.813 -318.864 -310.417 -300.425 -288.856 -275.685 -260.886 -244.484 -226.47 -206.794 -185.408 -162.351 -137.753 -111.651 -84.158 -55.3876 -25.3126 5.67658 37.4465 70.0383 103.083 136.185 169.041 201.502 233.369 264.058 293.026 319.777 343.947 365.2 383.13 397.43 407.877 414.237 416.365 413.696 406.436 394.776 378.898 359.035 335.561 309.094 -253.298 -270.575 -286.142 -300.043 -312.293 -322.958 -332.088 -339.726 -345.908 -350.673 -354.061 -356.092 -356.78 -356.275 -354.412 -351.219 -346.711 -340.836 -333.576 -324.855 -314.598 -302.76 -289.198 -273.793 -256.45 -237.207 -216.051 -192.855 -167.521 -140.117 -110.688 -79.2109 -45.7512 -10.4668 24.9711 63.1765 102.333 141.883 181.324 220.24 258.081 294.324 328.402 359.691 387.657 411.836 431.783 447.173 457.759 463.331 463.842 459.231 449.584 435.022 415.78 392.239 364.797 333.898 300.105 263.989 226.109 187.066 147.439 107.732 68.4447 30.0744 -6.64026 -42.3719 -76.5194 -108.855 -139.241 -167.587 -193.852 -218.044 -240.185 -260.286 -278.37 -294.48 -308.654 -320.943 -331.401 -340.082 -347.021 -352.224 -355.715 -357.507 -357.671 -356.332 -353.553 -349.397 -343.932 -337.225 -329.312 -320.214 -309.923 -298.391 -285.557 -271.34 -255.637 -238.348 -219.369 -198.602 -176.008 -151.56 -125.271 -97.1726 -67.3342 -35.8926 -2.99446 31.1761 66.3744 102.333 138.763 175.329 211.662 247.333 281.891 314.84 345.65 373.774 398.641 419.691 436.374 448.24 454.925 456.194 451.971 442.279 427.26 407.22 382.578 353.824 321.525 286.292 248.739 209.512 169.261 128.597 88.0535 47.8984 9.14551 -27.9486 -63.0587 -95.9409 -126.372 -154.255 -179.6 -202.448 -222.938 -241.198 -257.385 -271.667 -284.166 -295.025 -304.387 -312.361 -319.025 -324.513 -328.868 -332.095 -334.213 -335.254 -335.273 -334.263 -332.179 -328.975 -324.635 -319.119 -312.385 -304.381 -295.043 -284.275 -271.955 -257.985 -242.262 -224.658 -205.105 -183.507 -159.806 -133.987 -106.036 -75.9914 -43.9475 -10.093 25.3585 62.1763 99.8507 138.051 176.317 214.147 250.969 286.228 319.312 349.666 376.725 399.964 418.919 433.181 442.481 446.648 445.623 439.494 428.396 412.601 392.451 368.353 340.789 310.264 277.289 242.396 206.107 168.91 131.297 93.7056 56.5061 20.0891 -15.2102 -49.1219 -81.415 -111.913 -140.499 -167.102 -191.666 -214.198 -234.718 -253.25 -269.841 -284.573 -297.527 -308.773 -318.36 -326.317 -332.688 -337.455 -340.668 -342.375 -342.626 -341.497 -339.007 -335.161 -329.988 -323.504 -315.707 -306.606 -296.195 -284.478 -271.451 -257.13 -241.528 -224.581 -206.158 -186.133 -164.451 -141.026 -115.776 -88.6571 -59.6486 -28.8128 3.74312 37.9237 73.3829 109.875 147.004 184.319 221.325 257.441 292.031 324.458 354.109 380.369 402.664 420.508 433.519 441.401 444.012 441.334 433.478 420.623 403.082 381.274 355.687 326.847 295.288 261.554 226.223 189.874 153.059 116.242 79.7606 43.9003 11.7627 -21.297 -52.9765 -83.1196 -111.629 -138.46 -163.589 -187.002 -208.719 -228.767 -247.168 -263.929 -279.036 -292.474 -304.234 -314.312 -322.714 -329.449 -334.546 -338.048 -339.993 -340.414 -339.335 -336.774 -332.784 -327.341 -320.417 -312.001 -302.045 -290.506 -277.366 -262.59 -246.209 -228.223 -208.56 -187.166 -164.076 -139.44 -113.274 -85.7077 -56.8576 -26.6252 4.55235 36.4945 69.3245 102.634 136.008 169.141 201.913 234.176 265.287 294.664 321.796 346.32 367.909 386.132 400.672 411.31 417.797 419.988 417.299 409.947 398.124 382.02 361.87 338.043 311.175 -255.325 -272.547 -288.037 -301.859 -314.038 -324.64 -333.71 -341.294 -347.427 -352.149 -355.5 -357.497 -358.133 -357.667 -355.829 -352.66 -348.199 -342.376 -335.181 -326.534 -316.355 -304.608 -291.144 -275.823 -258.535 -239.355 -218.267 -195.125 -169.802 -142.383 -112.932 -81.3912 -47.8289 -12.4576 23.4773 61.95 101.471 141.439 181.334 220.737 259.089 295.857 330.461 362.26 390.694 415.284 435.578 451.238 462.012 467.683 468.206 463.52 453.707 438.897 419.32 395.376 367.477 336.074 301.759 265.108 226.696 187.153 147.057 106.927 67.2833 28.5882 -8.41624 -44.3518 -78.6455 -111.079 -141.524 -169.896 -196.158 -220.327 -242.434 -262.491 -280.522 -296.573 -310.686 -322.914 -333.314 -341.94 -348.831 -353.989 -357.43 -359.163 -359.255 -357.864 -355.04 -350.843 -345.348 -338.626 -330.715 -321.638 -311.387 -299.912 -287.148 -273.011 -257.393 -240.185 -221.279 -200.565 -178.001 -153.56 -127.25 -99.097 -69.1649 -37.5964 -4.53387 29.8434 65.2865 101.531 138.29 175.226 211.97 248.088 283.124 316.573 347.894 376.529 401.884 423.38 440.442 452.597 459.466 460.801 456.529 446.673 431.376 410.957 385.858 356.586 323.724 287.91 249.772 209.966 169.167 128.003 87.0203 46.3726 7.28416 -30.088 -65.4061 -98.433 -128.942 -156.835 -182.136 -204.902 -225.283 -243.414 -259.464 -273.613 -285.98 -296.713 -305.96 -313.837 -320.412 -325.828 -330.138 -333.333 -335.422 -336.439 -336.459 -335.467 -333.413 -330.245 -325.946 -320.484 -313.816 -305.89 -296.641 -285.974 -273.756 -259.89 -244.269 -226.753 -207.276 -185.737 -162.065 -136.249 -108.262 -78.1324 -45.949 -11.9005 23.7968 60.9422 98.9733 137.59 176.315 214.646 251.993 287.791 321.41 352.281 379.822 403.49 422.803 437.333 446.802 451.038 449.969 443.707 432.379 416.272 395.742 371.211 343.175 312.161 278.689 243.304 206.542 168.897 130.872 92.9102 55.3764 18.6678 -16.8727 -50.9789 -83.4197 -114.02 -142.669 -169.303 -193.865 -216.374 -236.855 -255.331 -271.855 -286.515 -299.401 -310.585 -320.12 -328.027 -334.358 -339.083 -342.25 -343.913 -344.125 -342.969 -340.461 -336.603 -331.423 -324.939 -317.15 -308.061 -297.67 -285.975 -272.977 -258.694 -243.156 -226.29 -207.952 -188 -166.382 -143.011 -117.792 -90.6669 -61.6084 -30.6747 2.03573 36.4181 72.1574 108.994 146.525 184.297 221.81 258.47 293.624 326.61 356.804 383.565 406.3 424.504 437.779 445.814 448.447 445.717 437.692 424.567 406.663 384.43 358.375 329.036 296.959 262.697 226.853 190.025 152.774 115.565 78.7289 42.4492 10.5193 -22.8857 -54.74 -84.9829 -113.549 -140.407 -165.543 -188.942 -210.639 -230.66 -249.038 -265.778 -280.865 -294.281 -306.017 -316.071 -324.445 -331.149 -336.212 -339.678 -341.592 -341.975 -340.893 -338.333 -334.347 -328.929 -322.032 -313.647 -303.733 -292.225 -279.115 -264.364 -248.005 -230.051 -210.405 -189.002 -165.875 -141.203 -114.97 -87.3265 -58.4028 -28.0052 3.37573 35.4874 68.5679 102.158 135.813 169.229 202.319 235.001 266.561 296.37 323.897 348.792 370.732 389.263 404.056 414.893 421.513 423.772 421.059 413.614 401.619 385.277 364.829 340.634 313.341 -257.431 -274.6 -290.005 -303.745 -315.849 -326.385 -335.394 -342.922 -349.005 -353.68 -356.993 -358.956 -359.541 -359.111 -357.299 -354.155 -349.742 -343.973 -336.845 -328.277 -318.178 -306.528 -293.169 -277.938 -260.702 -241.588 -220.575 -197.495 -172.181 -144.749 -115.28 -83.6763 -50.0049 -14.5398 21.878 60.6504 100.556 140.959 181.328 221.236 260.124 297.442 332.596 364.931 393.858 418.878 439.533 455.478 466.449 472.224 472.762 467.992 458.009 442.94 423.009 398.644 370.263 338.334 303.471 266.256 227.291 187.223 146.634 106.068 66.0514 27.0181 -10.2811 -46.43 -80.8737 -113.404 -143.91 -172.308 -198.562 -222.706 -244.775 -264.786 -282.76 -298.75 -312.799 -324.961 -335.3 -343.871 -350.713 -355.824 -359.215 -360.887 -360.895 -359.453 -356.582 -352.342 -346.815 -340.076 -332.167 -323.111 -312.903 -301.488 -288.798 -274.747 -259.219 -242.099 -223.272 -202.614 -180.083 -155.651 -129.32 -101.113 -71.0845 -39.3841 -6.15185 28.4389 64.1368 100.679 137.78 175.1 212.272 248.855 284.391 318.363 350.218 379.389 405.258 427.224 444.687 457.147 464.211 465.616 461.293 451.266 435.675 414.857 389.277 359.462 326.011 289.588 250.836 210.425 169.052 127.367 85.9404 44.7524 5.32525 -32.3366 -67.8696 -101.046 -131.636 -159.535 -184.782 -207.463 -227.726 -245.72 -261.624 -275.634 -287.863 -298.463 -307.589 -315.364 -321.848 -327.189 -331.451 -334.616 -336.675 -337.664 -337.687 -336.716 -334.692 -331.56 -327.305 -321.898 -315.301 -307.455 -298.3 -287.739 -275.63 -261.872 -246.357 -228.937 -209.542 -188.066 -164.426 -138.615 -110.595 -80.379 -48.0515 -13.803 22.1471 59.6375 98.0376 137.088 176.292 215.147 253.045 289.407 323.586 355.001 383.048 407.166 426.858 441.669 451.314 455.622 454.507 448.104 436.535 420.098 399.168 374.182 345.652 314.124 280.131 244.232 206.976 168.864 130.411 92.0648 54.1838 17.1707 -18.6188 -52.9269 -85.5196 -116.225 -144.936 -171.601 -196.158 -218.64 -239.079 -257.496 -273.949 -288.533 -301.348 -312.466 -321.947 -329.803 -336.092 -340.775 -343.894 -345.511 -345.681 -344.498 -341.972 -338.1 -332.913 -326.43 -318.647 -309.572 -299.2 -287.529 -274.559 -260.316 -244.844 -228.065 -209.82 -189.945 -168.397 -145.085 -119.902 -92.774 -63.6663 -32.6332 0.231913 34.8267 70.8533 108.049 145.998 184.246 222.29 259.52 295.266 328.839 359.602 386.894 410.092 428.676 442.231 450.425 453.118 450.305 442.1 428.686 410.402 387.722 361.175 331.311 298.687 263.873 227.494 190.164 152.454 114.841 77.6516 40.9397 9.19007 -24.568 -56.5934 -86.9341 -115.556 -142.44 -167.583 -190.963 -212.635 -232.629 -250.98 -267.698 -282.766 -296.159 -307.871 -317.9 -326.244 -332.915 -337.941 -341.372 -343.252 -343.594 -342.505 -339.949 -335.969 -330.576 -323.71 -315.357 -305.487 -294.013 -280.934 -266.208 -249.872 -231.954 -212.33 -190.916 -167.749 -143.042 -116.737 -89.0146 -60.0262 -29.454 2.14613 34.4224 67.767 101.653 135.601 169.304 202.715 235.844 267.88 298.142 326.082 351.363 373.671 392.526 407.581 418.628 425.388 427.712 424.978 417.438 405.26 388.67 367.913 343.334 315.594 -259.615 -276.733 -292.048 -305.7 -317.727 -328.193 -337.139 -344.609 -350.64 -355.266 -358.541 -360.471 -361.008 -360.607 -358.82 -355.704 -351.337 -345.624 -338.568 -330.082 -320.066 -308.519 -295.271 -280.138 -262.951 -243.906 -222.975 -199.966 -174.661 -147.214 -117.732 -86.0683 -52.2797 -16.716 20.1673 59.2733 99.5864 140.44 181.301 221.737 261.182 299.076 334.806 367.704 397.148 422.618 443.65 459.893 471.071 476.955 477.507 472.651 462.494 447.149 426.85 402.044 373.157 340.678 305.242 267.435 227.894 187.275 146.17 105.154 64.7449 25.366 -12.2374 -48.6089 -83.2059 -115.834 -146.4 -174.823 -201.065 -225.179 -247.208 -267.17 -285.085 -301.01 -314.992 -327.085 -337.359 -345.874 -352.666 -357.729 -361.068 -362.678 -362.586 -361.098 -358.18 -353.894 -348.332 -341.575 -333.667 -324.633 -314.47 -303.12 -290.508 -276.548 -261.115 -244.089 -225.346 -204.749 -182.253 -157.833 -131.482 -103.221 -73.0946 -41.2579 -7.85053 26.9593 62.922 99.7711 137.225 174.946 212.563 249.63 285.688 320.207 352.622 382.357 408.764 431.228 449.114 461.894 469.164 470.642 466.265 456.059 440.16 418.921 392.836 362.452 328.38 291.318 251.924 210.879 168.906 126.676 84.8029 43.0245 3.2561 -34.7043 -70.461 -103.787 -134.462 -162.364 -187.546 -210.134 -230.271 -248.117 -263.868 -277.731 -289.812 -300.275 -309.272 -316.941 -323.331 -328.593 -332.805 -335.943 -337.975 -338.927 -338.953 -338.006 -336.015 -332.921 -328.709 -323.36 -316.836 -309.073 -300.017 -289.568 -277.574 -263.928 -248.528 -231.209 -211.899 -190.494 -166.89 -141.086 -113.039 -82.7345 -50.2585 -15.804 20.4051 58.2595 97.0405 136.542 176.247 215.649 254.123 291.076 325.841 357.827 386.405 410.997 431.086 446.193 456.021 460.406 459.238 452.688 440.865 424.082 402.732 377.27 348.222 316.156 281.621 245.184 207.415 168.814 129.915 91.1706 52.9286 15.5969 -20.4504 -54.967 -87.7165 -118.53 -147.303 -173.997 -198.548 -221 -241.395 -259.749 -276.125 -290.627 -303.367 -314.416 -323.842 -331.645 -337.892 -342.53 -345.599 -347.166 -347.292 -346.08 -343.535 -339.65 -334.455 -327.974 -320.197 -311.136 -300.786 -289.138 -276.194 -261.992 -246.587 -229.903 -211.761 -191.965 -170.489 -147.244 -122.104 -94.9755 -65.8203 -34.6867 -1.66529 33.1511 69.4727 107.04 145.426 184.168 222.768 260.595 296.961 331.148 362.51 390.361 414.044 433.027 446.875 455.235 457.952 455.082 446.689 432.969 414.288 391.142 364.078 333.662 300.468 265.08 228.142 190.287 152.097 114.069 76.5337 39.4483 7.6948 -26.3517 -58.5393 -88.9751 -117.651 -144.557 -169.707 -193.067 -214.708 -234.672 -252.996 -269.691 -284.739 -298.11 -309.795 -319.799 -328.112 -334.748 -339.736 -343.129 -344.972 -345.268 -344.174 -341.622 -337.65 -332.282 -325.448 -317.129 -307.308 -295.87 -282.822 -268.122 -251.81 -233.932 -214.335 -192.909 -169.698 -144.96 -118.576 -90.7723 -61.7311 -30.972 0.862858 33.2957 66.9201 101.12 135.37 169.362 203.095 236.701 269.244 299.982 328.349 354.033 376.727 395.923 411.25 422.516 429.424 431.815 429.057 421.421 409.05 392.201 371.124 346.145 317.932 -261.875 -278.948 -294.164 -307.724 -319.669 -330.065 -338.946 -346.356 -352.331 -356.908 -360.142 -362.04 -362.54 -362.158 -360.39 -357.305 -352.986 -347.331 -340.35 -331.951 -322.018 -310.581 -297.453 -282.427 -265.282 -246.309 -225.469 -202.542 -177.242 -149.778 -120.293 -88.5698 -54.6543 -18.9891 18.3379 57.8151 98.5588 139.879 181.253 222.237 262.263 300.759 337.091 370.579 400.566 426.506 447.932 464.487 475.883 481.881 482.442 477.502 467.164 451.529 430.845 405.578 376.159 343.106 307.068 268.643 228.502 187.302 145.66 104.18 63.3557 23.6291 -14.2908 -50.8945 -85.6462 -118.372 -148.999 -177.441 -203.669 -227.75 -249.736 -269.647 -287.497 -303.353 -317.266 -329.287 -339.492 -347.949 -354.691 -359.704 -362.99 -364.538 -364.348 -362.806 -359.834 -355.498 -349.899 -343.123 -335.215 -326.204 -316.087 -304.806 -292.276 -278.412 -263.08 -246.155 -227.5 -206.968 -184.509 -160.104 -133.734 -105.418 -75.1908 -43.2142 -9.62608 25.4106 61.6466 98.8118 136.631 174.765 212.845 250.414 287.014 322.102 355.101 385.428 412.399 435.387 453.721 466.84 474.328 475.882 471.451 461.057 444.833 423.152 396.538 365.557 330.835 293.102 253.038 211.332 168.729 125.93 83.6031 41.2 1.08082 -37.1861 -73.1756 -106.651 -137.414 -165.318 -190.421 -212.909 -232.915 -250.6 -266.185 -279.897 -291.824 -302.142 -311.009 -318.566 -324.861 -330.039 -334.199 -337.313 -339.319 -340.227 -340.254 -339.337 -337.382 -334.326 -330.156 -324.867 -318.417 -310.743 -301.791 -291.461 -279.586 -266.058 -250.78 -233.567 -214.348 -193.021 -169.455 -143.662 -115.591 -85.1988 -52.5707 -17.9047 18.5673 56.8035 95.9746 135.946 176.169 216.145 255.218 292.791 328.168 360.752 389.888 414.976 435.487 450.906 460.924 465.393 464.167 457.467 445.378 428.229 406.439 380.478 350.888 318.259 283.156 246.158 207.853 168.74 129.38 90.2218 51.6049 13.942 -22.3719 -57.1024 -90.0131 -120.936 -149.771 -176.494 -201.035 -223.453 -243.799 -262.087 -278.381 -292.792 -305.454 -316.43 -325.797 -333.549 -339.753 -344.348 -347.365 -348.877 -348.956 -347.715 -345.151 -341.251 -336.049 -329.569 -321.801 -312.754 -302.427 -290.802 -277.884 -263.721 -248.388 -231.806 -213.777 -194.063 -172.662 -149.493 -124.402 -97.2756 -68.0752 -36.8408 -3.6609 31.3848 68.0109 105.962 144.804 184.057 223.238 261.689 298.704 333.535 365.524 393.96 418.152 437.553 451.715 460.254 463.046 460.074 451.475 437.436 418.34 394.702 367.094 336.098 302.309 266.322 228.799 190.389 151.698 113.248 75.3733 37.9731 6.02833 -28.2429 -60.5805 -91.1086 -119.835 -146.76 -171.916 -195.252 -216.859 -236.789 -255.086 -271.757 -286.784 -300.132 -311.79 -321.768 -330.049 -336.648 -341.596 -344.948 -346.754 -346.999 -345.897 -343.351 -339.389 -334.045 -327.248 -318.966 -309.198 -297.795 -284.781 -270.106 -253.819 -235.985 -216.423 -194.984 -171.721 -146.957 -120.486 -92.5992 -63.5231 -32.5591 -0.474511 32.1037 66.0252 100.56 135.122 169.403 203.453 237.572 270.654 301.891 330.7 356.8 379.901 399.454 415.063 426.558 433.622 436.079 433.299 425.565 412.989 395.87 374.464 349.07 320.356 -264.21 -281.248 -296.353 -309.818 -321.678 -331.999 -340.815 -348.162 -354.079 -358.605 -361.797 -363.665 -364.139 -363.761 -362.01 -358.958 -354.689 -349.091 -342.19 -333.883 -324.035 -312.712 -299.714 -284.807 -267.693 -248.796 -228.057 -205.227 -179.925 -152.44 -122.966 -91.1832 -57.1291 -21.3583 16.3799 56.272 97.4712 139.274 181.182 222.732 263.365 302.489 339.448 373.557 404.114 430.543 452.379 469.26 480.886 487.001 487.569 482.546 472.019 456.08 434.996 409.244 379.269 345.617 308.949 269.878 229.113 187.302 145.106 103.144 61.8853 21.8095 -16.4413 -53.2854 -88.1934 -121.016 -151.705 -180.163 -206.372 -230.415 -252.355 -272.212 -289.996 -305.778 -319.621 -331.565 -341.697 -350.09 -356.781 -361.748 -364.982 -366.468 -366.171 -364.573 -361.544 -357.151 -351.512 -344.714 -336.806 -327.819 -317.751 -306.543 -294.1 -280.338 -265.117 -248.297 -229.74 -209.278 -186.86 -162.473 -136.086 -107.716 -77.3845 -45.2639 -11.4907 23.7842 60.3015 97.7958 135.996 174.558 213.12 251.212 288.377 324.06 357.668 388.613 416.176 439.713 458.519 471.991 479.703 481.338 476.852 466.261 449.695 427.55 400.379 368.772 333.368 294.935 254.171 211.777 168.514 125.124 82.2894 39.3316 -1.19974 -39.783 -76.0137 -109.639 -140.492 -168.397 -193.405 -215.782 -235.65 -253.162 -268.577 -282.131 -293.902 -304.069 -312.8 -320.24 -326.435 -331.528 -335.628 -338.721 -340.707 -341.565 -341.588 -340.707 -338.79 -335.773 -331.645 -326.418 -320.046 -312.464 -303.62 -293.412 -281.663 -268.261 -253.111 -236.011 -216.889 -195.644 -172.119 -146.343 -118.249 -87.77 -54.9844 -20.0984 16.6584 55.2626 94.8499 135.312 176.071 216.647 256.345 294.562 330.581 363.788 393.507 419.116 440.067 455.814 466.029 470.57 469.292 462.435 450.067 432.534 410.279 383.794 353.639 320.419 284.723 247.145 208.281 168.637 128.801 89.2166 50.2097 12.2033 -24.3848 -59.3357 -92.4117 -123.445 -152.34 -179.091 -203.617 -225.997 -246.289 -264.506 -280.709 -295.026 -307.605 -318.508 -327.816 -335.514 -341.676 -346.228 -349.192 -350.644 -350.671 -349.403 -346.818 -342.904 -337.695 -331.215 -323.456 -314.424 -304.122 -292.519 -279.626 -265.503 -250.246 -233.772 -215.867 -196.239 -174.917 -151.832 -126.799 -99.6761 -70.4323 -39.0984 -5.75628 29.5262 66.4672 104.816 144.131 183.916 223.701 262.805 300.497 336.003 368.65 397.697 422.427 442.267 456.754 465.476 468.314 465.258 456.449 442.079 422.547 398.391 370.209 338.609 304.203 267.591 229.455 190.462 151.256 112.377 74.166 36.5193 4.18633 -30.2426 -62.7177 -93.3357 -122.109 -149.051 -174.213 -197.521 -219.087 -238.981 -257.248 -273.895 -288.902 -302.227 -313.856 -323.806 -332.056 -338.616 -343.52 -346.831 -348.595 -348.781 -347.678 -345.136 -341.186 -335.867 -329.108 -320.865 -311.156 -299.79 -286.811 -272.16 -255.899 -238.115 -218.594 -197.143 -173.818 -149.036 -122.469 -94.494 -65.4093 -34.215 -1.86659 30.8423 65.0796 99.9717 134.855 169.424 203.781 238.453 272.109 303.87 333.135 359.666 383.193 403.122 419.023 430.757 437.983 440.504 437.713 429.87 417.079 399.676 377.933 352.11 322.865 -266.618 -283.636 -298.616 -311.981 -323.752 -333.997 -342.744 -350.026 -355.885 -360.357 -363.505 -365.344 -365.843 -365.417 -363.68 -360.662 -356.446 -350.904 -344.089 -335.877 -326.115 -314.912 -302.055 -287.281 -270.184 -251.365 -230.738 -208.022 -182.709 -155.201 -125.751 -93.9115 -59.7032 -23.838 14.2944 54.6406 96.3214 138.621 181.084 223.22 264.485 304.264 341.876 376.638 407.793 434.73 456.993 474.217 486.083 492.319 492.89 487.79 477.062 460.805 439.304 413.044 382.49 348.211 310.884 271.144 229.725 187.273 144.507 102.039 60.3338 19.8967 -18.696 -55.7908 -90.8555 -123.772 -154.524 -182.996 -209.179 -233.181 -255.072 -274.872 -292.586 -308.287 -322.053 -333.914 -343.967 -352.299 -358.94 -363.86 -367.043 -368.466 -368.039 -366.391 -363.305 -358.851 -353.168 -346.345 -338.436 -329.472 -319.456 -308.325 -295.972 -282.318 -267.213 -250.505 -232.054 -211.667 -189.292 -164.928 -138.528 -110.109 -79.6716 -47.4052 -13.4469 22.0728 58.8751 96.7083 135.299 174.3 213.368 251.998 289.751 326.058 360.301 391.897 420.086 444.201 463.508 477.354 485.307 487.023 482.479 471.681 454.757 432.124 404.369 372.11 335.993 296.829 255.337 212.228 168.273 124.263 80.8552 37.4303 -3.58618 -42.4891 -78.9723 -112.746 -143.687 -171.594 -196.485 -218.748 -238.479 -255.806 -271.043 -284.434 -296.039 -306.047 -314.633 -321.949 -328.044 -333.049 -337.086 -340.16 -342.133 -342.935 -342.95 -342.11 -340.235 -337.258 -333.171 -328.007 -321.716 -314.23 -305.498 -295.417 -283.804 -270.533 -255.517 -238.541 -219.522 -198.367 -174.892 -149.137 -121.027 -90.4676 -57.5226 -22.4105 14.6404 53.6202 93.6385 134.615 175.93 217.134 257.487 296.377 333.068 366.929 397.26 423.413 444.828 460.92 471.338 475.976 474.621 467.602 454.942 437.007 414.267 387.238 356.492 322.657 286.346 248.163 208.718 168.518 128.188 88.1657 48.7527 10.3874 -26.4816 -61.6601 -94.9053 -126.051 -155.004 -181.783 -206.288 -228.624 -248.858 -267.001 -283.111 -297.329 -309.824 -320.65 -329.898 -337.539 -343.656 -348.163 -351.071 -352.456 -352.43 -351.137 -348.529 -344.602 -339.385 -332.906 -325.158 -316.141 -305.866 -294.285 -281.416 -267.331 -252.154 -235.795 -218.026 -198.489 -177.25 -154.257 -129.292 -102.177 -72.8941 -41.466 -7.95978 27.5648 64.8275 103.587 143.395 183.731 224.148 263.936 302.339 338.55 371.888 401.583 426.879 447.181 462.006 470.913 473.793 470.646 461.621 446.904 426.912 402.208 373.43 341.205 306.158 268.893 230.114 190.511 150.773 111.453 72.9056 35.1006 2.15145 -32.3532 -64.9549 -95.6603 -124.476 -151.429 -176.597 -199.872 -221.395 -241.247 -259.483 -276.106 -291.093 -304.395 -315.994 -325.915 -334.133 -340.653 -345.509 -348.776 -350.499 -350.609 -349.516 -346.976 -343.038 -337.748 -331.029 -322.827 -313.183 -301.854 -288.914 -274.284 -258.047 -240.323 -220.851 -199.389 -175.985 -151.202 -124.524 -96.4534 -67.3985 -35.9387 -3.31467 29.5077 64.0807 99.3577 134.572 169.423 204.067 239.344 273.612 305.921 335.653 362.629 386.605 406.928 423.13 435.115 442.51 445.09 442.299 434.34 421.32 403.617 381.533 355.269 325.458 -269.096 -286.115 -300.951 -314.212 -325.891 -336.057 -344.733 -351.951 -357.747 -362.163 -365.266 -367.077 -367.588 -367.127 -365.402 -362.417 -358.255 -352.77 -346.045 -337.935 -328.255 -317.181 -304.476 -289.852 -272.751 -254.015 -233.513 -210.933 -185.596 -158.059 -128.653 -96.7591 -62.3734 -26.4453 12.0828 52.9185 95.1081 137.919 180.957 223.698 265.622 306.084 344.375 379.823 411.605 439.07 461.776 479.358 491.478 497.838 498.411 493.236 482.295 465.709 443.77 416.979 385.821 350.886 312.873 272.434 230.33 187.21 143.855 100.856 58.701 17.888 -21.0556 -58.4077 -93.6267 -126.633 -157.447 -185.933 -212.078 -236.034 -257.872 -277.609 -295.247 -310.864 -324.55 -336.329 -346.301 -354.571 -361.16 -366.031 -369.163 -370.52 -369.916 -368.251 -365.109 -360.591 -354.863 -348.013 -340.102 -331.164 -321.202 -310.151 -297.893 -284.354 -269.368 -252.781 -234.439 -214.132 -191.8 -167.46 -141.05 -112.58 -82.0315 -49.6162 -15.4655 20.3053 57.3984 95.5786 134.572 174.021 213.61 252.794 291.149 328.106 363.004 395.276 424.122 448.843 468.678 482.923 491.127 492.926 488.329 477.32 460.022 436.875 408.513 375.569 338.703 298.771 256.513 212.663 167.979 123.324 79.2748 35.5163 -6.0779 -45.3055 -82.0481 -115.969 -146.996 -174.922 -199.678 -221.816 -241.404 -258.531 -273.57 -286.79 -298.221 -308.064 -316.502 -323.683 -329.681 -334.598 -338.565 -341.619 -343.591 -344.361 -344.335 -343.551 -341.713 -338.762 -334.724 -329.623 -323.416 -316.029 -307.413 -297.465 -285.993 -272.857 -257.983 -241.139 -222.228 -201.171 -177.75 -152.021 -123.907 -93.2686 -60.1619 -24.823 12.5242 51.8932 92.3464 133.858 175.745 217.604 258.638 298.229 335.623 370.165 401.141 427.865 449.767 466.226 476.852 481.565 480.155 472.974 460.009 441.652 418.402 390.802 359.441 324.96 288.004 249.192 209.139 168.36 127.522 87.0481 47.2166 8.4765 -28.6777 -64.0882 -97.5032 -128.763 -157.762 -184.566 -209.04 -231.331 -251.509 -269.576 -285.588 -299.694 -312.101 -322.845 -332.022 -339.611 -345.678 -350.142 -352.995 -354.307 -354.228 -352.91 -350.279 -346.337 -341.112 -334.636 -326.898 -317.899 -307.651 -296.095 -283.246 -269.197 -254.103 -237.869 -220.253 -200.806 -179.648 -156.76 -131.874 -104.766 -75.4462 -43.9286 -10.2617 25.5127 63.1029 102.282 142.597 183.501 224.571 265.067 304.218 341.16 375.219 405.593 431.481 452.272 467.461 476.562 479.504 476.257 467.01 451.929 431.45 406.169 376.769 343.891 308.173 270.22 230.765 190.526 150.239 110.464 71.5781 33.6411 -0.00675994 -34.5711 -67.2924 -98.0816 -126.932 -153.894 -179.068 -202.298 -223.778 -243.585 -261.789 -278.389 -293.356 -306.635 -318.201 -328.095 -336.279 -342.758 -347.564 -350.785 -352.467 -352.486 -351.414 -348.871 -344.945 -339.687 -333.01 -324.85 -315.281 -303.986 -291.089 -276.476 -260.263 -242.608 -223.194 -201.724 -178.221 -153.458 -126.652 -98.4726 -69.5021 -37.7308 -4.81634 28.0943 63.0248 98.7199 134.274 169.399 204.299 240.244 275.163 308.047 338.253 365.687 390.138 410.875 427.385 439.633 447.206 449.84 447.059 438.976 425.717 407.695 385.266 358.55 328.134 -271.64 -288.69 -303.359 -316.51 -328.095 -338.181 -346.784 -353.935 -359.665 -364.022 -367.08 -368.861 -369.367 -368.889 -367.174 -364.223 -360.118 -354.691 -348.061 -340.055 -330.455 -319.517 -306.977 -292.531 -275.393 -256.744 -236.378 -213.961 -188.582 -161.011 -131.674 -99.7293 -65.1354 -29.2045 9.75087 51.1014 93.8315 137.163 180.797 224.162 266.773 307.946 346.942 383.111 415.552 443.563 466.73 484.687 497.072 503.562 504.139 498.883 487.721 470.795 448.397 421.051 389.264 353.641 314.919 273.749 230.931 187.119 143.156 99.6041 57.0016 15.7939 -23.5074 -61.1302 -96.5029 -129.597 -160.477 -188.977 -215.068 -238.967 -260.749 -280.422 -297.984 -313.52 -327.129 -338.825 -348.707 -356.907 -363.438 -368.257 -371.341 -372.645 -371.875 -370.16 -366.95 -362.36 -356.583 -349.703 -341.793 -332.879 -322.971 -312.01 -299.852 -286.431 -271.575 -255.122 -236.901 -216.679 -194.398 -170.089 -143.675 -115.152 -84.4949 -51.9294 -17.5766 18.4521 55.8436 94.3832 133.797 173.709 213.844 253.605 292.588 330.222 365.803 398.781 428.311 453.666 474.052 488.714 497.168 499.038 494.395 483.165 465.469 441.782 412.78 379.121 341.471 300.741 257.695 213.083 167.651 122.338 77.6469 33.5232 -8.66664 -48.2165 -85.2164 -119.284 -150.386 -178.341 -202.929 -224.93 -244.367 -261.272 -276.113 -289.161 -300.413 -310.091 -318.381 -325.417 -331.321 -336.156 -340.046 -343.074 -345.061 -345.791 -345.71 -345.002 -343.197 -340.27 -336.28 -331.247 -325.126 -317.842 -309.351 -299.542 -288.212 -275.221 -260.501 -243.792 -224.998 -204.054 -180.685 -154.985 -126.881 -96.1639 -62.891 -27.3202 10.3616 50.07 90.9942 133.066 175.538 218.079 259.819 300.137 338.265 373.513 405.165 432.487 454.898 471.742 482.579 487.347 485.891 478.546 465.26 446.458 422.673 394.477 362.477 327.319 289.695 250.233 209.555 168.178 126.812 85.8832 45.6243 6.49666 -30.9383 -66.5842 -100.168 -131.543 -160.584 -187.424 -211.861 -234.108 -254.226 -272.206 -288.107 -302.092 -314.402 -325.068 -334.163 -341.709 -347.72 -352.143 -354.944 -356.174 -356.046 -354.708 -352.051 -348.094 -342.863 -336.39 -328.665 -319.685 -309.469 -297.944 -285.11 -271.097 -256.092 -239.994 -222.552 -203.196 -182.118 -159.347 -134.562 -107.456 -78.1028 -46.4947 -12.671 23.3652 61.2973 100.906 141.753 183.243 224.995 266.228 306.161 343.864 378.675 409.756 436.264 457.562 473.134 482.426 485.37 482.064 472.592 457.124 436.13 410.248 380.204 346.648 310.235 271.565 231.407 190.514 149.661 109.413 70.1907 32.1181 -2.24572 -36.8821 -69.7221 -100.594 -129.475 -156.442 -181.627 -204.805 -226.238 -245.997 -264.17 -280.745 -295.695 -308.95 -320.482 -330.348 -338.497 -344.933 -349.685 -352.856 -354.501 -354.393 -353.362 -350.822 -346.906 -341.682 -335.05 -326.931 -317.452 -306.187 -293.34 -278.737 -262.544 -244.97 -225.624 -204.149 -180.519 -155.811 -128.85 -100.544 -71.7362 -39.5917 -6.36729 26.5967 61.9071 98.062 133.963 169.351 204.461 241.152 276.765 310.249 340.936 368.84 393.792 414.966 431.79 444.315 452.073 454.77 451.991 443.781 430.269 411.907 389.134 361.957 330.891 -274.248 -291.377 -305.838 -318.872 -330.361 -340.364 -348.892 -355.974 -361.636 -365.932 -368.944 -370.692 -371.181 -370.705 -368.996 -366.077 -362.033 -356.662 -350.132 -342.235 -332.706 -321.925 -309.574 -295.362 -278.128 -259.552 -239.338 -217.125 -191.671 -164.053 -134.814 -102.817 -67.9784 -32.1323 7.2967 49.1834 92.4928 136.35 180.603 224.608 267.934 309.85 349.575 386.504 419.637 448.211 471.856 490.205 502.868 509.495 510.077 504.736 493.344 476.064 453.187 425.264 392.82 356.481 317.024 275.091 231.532 187 142.401 98.2788 55.222 13.5929 -26.0633 -63.9765 -99.5038 -132.678 -163.614 -192.123 -218.14 -241.972 -263.698 -283.302 -300.771 -316.199 -329.699 -341.289 -351.074 -359.198 -365.671 -370.427 -373.465 -374.697 -373.717 -372.066 -368.805 -364.139 -358.307 -351.394 -343.48 -334.585 -324.731 -313.862 -301.802 -288.5 -273.776 -257.467 -239.373 -219.243 -197.029 -172.762 -146.353 -117.789 -87.0337 -54.3225 -19.7747 16.5087 54.198 93.1011 132.942 173.321 214.021 254.38 294.009 332.357 368.649 402.37 432.625 458.65 479.622 494.727 503.464 505.404 500.708 489.248 471.136 446.883 417.219 382.824 344.357 302.807 258.952 213.551 167.338 121.33 75.9941 31.4491 -11.3677 -51.2182 -88.4806 -122.694 -153.857 -181.845 -206.241 -228.081 -247.373 -264.031 -278.652 -291.525 -302.594 -312.104 -320.247 -327.129 -332.936 -337.716 -341.524 -344.501 -346.53 -347.567 -347.159 -346.424 -344.673 -341.782 -337.817 -332.857 -326.819 -319.644 -311.285 -301.616 -290.426 -277.589 -263.031 -246.465 -227.799 -206.988 -183.681 -158.02 -129.945 -99.1646 -65.7265 -29.9231 8.08623 48.1565 89.5526 132.207 175.277 218.536 261.009 302.087 340.977 376.96 409.318 437.266 460.212 477.462 488.519 493.337 491.836 484.328 470.706 451.437 427.095 398.281 365.617 329.759 291.441 251.308 209.986 167.981 126.083 84.7035 43.9996 4.4621 -33.2611 -69.1623 -102.927 -134.429 -163.502 -190.375 -214.741 -236.922 -256.959 -274.836 -290.612 -304.469 -316.68 -327.266 -336.279 -343.779 -349.742 -354.119 -356.874 -358.034 -357.863 -356.501 -353.819 -349.844 -344.609 -338.138 -330.43 -321.472 -311.295 -299.804 -286.975 -272.997 -258.087 -242.132 -224.89 -205.629 -184.638 -161.999 -137.337 -110.244 -80.8688 -49.1785 -15.206 21.0928 59.3698 99.4132 140.82 182.905 225.373 267.375 308.128 346.633 382.23 414.059 441.217 463.051 479.03 488.518 491.495 488.103 478.393 462.519 440.989 414.483 383.766 349.507 312.372 272.951 232.065 190.485 149.036 108.299 68.7376 30.5165 -4.56687 -39.289 -72.2528 -103.21 -132.115 -159.081 -184.284 -207.393 -228.774 -248.475 -266.602 -283.144 -298.081 -311.316 -322.813 -332.655 -340.768 -347.157 -351.85 -354.966 -356.565 -356.318 -355.364 -352.831 -348.926 -343.733 -337.158 -329.078 -319.709 -308.468 -295.698 -281.079 -264.893 -247.414 -228.152 -206.676 -182.877 -158.265 -131.112 -102.653 -74.1211 -41.5179 -7.96273 25.0096 60.721 97.3893 133.643 169.28 204.531 242.069 278.419 312.532 343.701 372.086 397.57 419.203 436.347 449.162 457.114 459.887 457.098 448.757 434.979 416.25 393.137 365.495 333.724 -276.877 -294.124 -308.354 -321.272 -332.68 -342.603 -351.057 -358.071 -363.663 -367.893 -370.859 -372.503 -372.369 -369.434 -365.66 -361.18 -355.661 -349.715 -343.34 -336.899 -330.378 -323.107 -312.065 -298.166 -280.743 -262.336 -242.348 -220.466 -195.017 -167.184 -138.096 -106.046 -70.8872 -35.2355 4.72335 47.1628 91.0954 135.474 180.369 225.032 269.105 311.794 352.27 390.002 423.862 453.014 477.154 495.915 508.867 515.64 516.226 510.796 499.168 481.52 458.143 429.619 396.487 359.406 319.186 276.451 232.127 186.841 141.586 96.8808 53.3621 11.2989 -28.6997 -66.9151 -102.565 -135.767 -166.714 -195.149 -220.898 -244.361 -265.455 -283.901 -299.276 -311.283 -319.679 -324.465 -325.985 -324.712 -321.604 -317.984 -314.691 -312.866 -312.312 -313.407 -315.212 -317.401 -319.536 -321.067 -321.709 -320.806 -317.887 -312.266 -303.209 -290.517 -275.922 -259.762 -241.803 -221.777 -199.616 -175.394 -149.003 -120.416 -89.569 -56.7254 -21.9951 14.5444 52.531 91.7906 132.064 172.91 214.187 255.151 295.434 334.524 371.544 406.033 437.049 463.779 485.366 500.947 509.973 511.955 507.239 495.551 477.003 452.151 421.8 386.634 347.299 304.892 260.173 213.949 166.917 120.206 74.2412 29.1821 -14.1074 -54.3198 -91.7991 -126.11 -157.234 -185.139 -209.213 -230.605 -249.289 -265.094 -278.584 -289.886 -298.915 -306.014 -311.393 -315.429 -318.107 -319.424 -320.71 -321.551 -320.313 -320.244 -321.51 -321.327 -321.022 -320.997 -321.037 -320.384 -318.531 -315.479 -310.52 -303.087 -292.511 -279.833 -265.457 -249.048 -230.533 -209.883 -186.653 -161.041 -133.023 -102.209 -68.6125 -32.594 5.72833 46.1796 88.0362 131.295 174.97 218.975 262.205 304.081 343.767 380.509 413.61 442.209 465.719 483.397 494.673 499.43 497.977 490.316 476.342 456.585 431.664 402.199 368.852 332.258 293.216 252.389 210.4 167.738 125.281 83.4341 42.2529 2.29353 -35.7024 -71.8409 -105.732 -137.275 -166.255 -193.026 -217.074 -238.801 -258.101 -274.794 -288.735 -299.917 -308.565 -314.614 -318.368 -320.244 -320.652 -320.317 -319.451 -318.794 -318.731 -319.142 -319.859 -320.755 -321.158 -321.083 -319.659 -316.424 -310.562 -301.35 -288.736 -274.787 -259.998 -244.208 -227.191 -208.026 -187.134 -164.636 -140.109 -113.047 -83.6659 -51.9176 -17.8095 18.7526 57.371 97.8435 139.831 182.512 225.72 268.517 310.122 349.463 385.88 418.491 446.335 468.732 485.144 494.832 497.813 494.359 484.413 468.114 446.022 418.862 387.443 352.451 314.563 274.357 232.72 190.415 148.348 107.109 67.2136 28.7832 -6.92468 -41.7754 -74.8676 -105.895 -134.801 -161.715 -186.936 -209.938 -231.206 -250.758 -268.697 -284.956 -299.471 -312.104 -322.748 -331.379 -337.878 -342.373 -344.893 -345.665 -344.82 -341.819 -339.577 -337.424 -335.054 -332.686 -329.956 -326.177 -320.564 -310.692 -297.976 -283.385 -267.254 -249.896 -230.804 -209.384 -185.321 -160.842 -133.454 -104.799 -76.6835 -43.499 -9.59607 23.3285 59.46 96.7106 133.315 169.188 204.48 243 280.129 314.9 346.546 375.423 401.473 423.59 441.054 454.176 462.331 465.191 462.376 453.916 439.847 420.72 397.277 369.171 336.629 -279.555 -268.49 -230.692 -195.963 -165.179 -138.447 -115.625 -96.6001 -81.2095 -69.2176 -60.7712 -56.0546 -54.9519 -58.1599 -64.5099 -74.0347 -86.5911 -102.46 -121.165 -142.914 -168.607 -197.052 -228.481 -253.321 -252.154 -244.945 -235.939 -222.591 -198.138 -170.177 -141.506 -109.636 -73.8583 -38.586 2.02361 45.0434 89.6615 134.535 180.096 225.425 270.28 313.777 355.024 393.604 428.234 457.975 482.625 501.819 515.075 522.001 522.587 517.07 505.195 487.164 463.269 434.117 400.269 362.422 321.407 277.84 232.729 186.663 140.74 95.4364 51.453 8.94488 -31.3297 -69.8054 -105.504 -138.503 -168.945 -195.985 -217.854 -232.601 -236.639 -226.204 -202.659 -177.864 -154.436 -133.635 -116.003 -101.608 -90.5523 -82.9001 -78.5007 -76.9115 -78.1975 -81.9919 -88.5847 -97.8046 -109.138 -122.611 -137.961 -154.934 -173.078 -191.485 -208.478 -221.294 -227.462 -229.936 -227.828 -219.153 -201.943 -177.905 -151.57 -122.999 -92.0549 -59.1048 -24.2249 12.5751 50.8503 90.4596 131.185 172.499 214.366 255.952 296.903 336.758 374.521 409.804 441.608 469.066 491.294 507.378 516.692 518.669 513.959 502.03 483.016 457.529 426.453 390.481 350.23 306.947 261.37 214.325 166.471 119.099 72.5296 27.0023 -16.7189 -57.192 -94.6981 -128.8 -159.365 -186.039 -207.257 -223.362 -233.052 -235.145 -230.3 -218.168 -203.032 -188.949 -176.502 -165.664 -156.303 -148.569 -141.983 -136.378 -132.979 -132.362 -132.238 -133.68 -136.874 -142.223 -149.759 -159.156 -169.995 -182.305 -195.303 -208.392 -219.696 -225.78 -229.267 -229.034 -223.735 -210.961 -189.363 -163.871 -136 -105.208 -71.4728 -35.2866 3.32422 44.1616 86.4534 130.332 174.626 219.385 263.401 306.097 346.611 384.147 418.024 447.311 471.415 489.548 501.058 505.761 504.33 496.517 482.171 461.899 436.363 406.22 372.169 334.794 295.004 253.46 210.793 167.459 124.424 82.1538 40.5256 0.189414 -37.9803 -74.2424 -108.079 -139.372 -167.57 -192.744 -212.876 -227.07 -233.11 -229.147 -214.802 -195.788 -177.267 -160.267 -145.508 -133.081 -123.284 -116.239 -112.161 -109.885 -109.896 -112.78 -118.053 -125.743 -135.825 -148.317 -162.87 -179.114 -195.831 -211.298 -222.453 -227.846 -229.922 -228.368 -222.126 -209.167 -189.442 -167.138 -142.817 -115.812 -86.4438 -54.671 -20.4611 16.3614 55.3257 96.2164 138.803 182.089 226.052 269.672 312.166 352.364 389.647 423.066 451.628 474.62 491.492 501.378 504.305 500.84 490.651 473.9 451.22 423.373 391.226 355.482 316.822 275.803 233.395 190.34 147.648 105.88 65.6521 26.9626 -9.2726 -44.2528 -77.4278 -108.477 -137.259 -163.871 -188.45 -209.901 -227.736 -240.277 -245.074 -238.186 -218.017 -194.941 -173.072 -153.213 -136.102 -122.347 -112.332 -106.092 -103.367 -104.409 -108.716 -116.252 -126.759 -140 -156.171 -175.864 -197.567 -222.565 -241.227 -245.793 -243.266 -237.995 -229.176 -211.79 -187.484 -163.486 -135.911 -107.024 -79.5159 -45.548 -11.2818 21.5483 58.1188 96.0454 132.985 169.082 204.271 243.95 281.898 317.358 349.468 378.847 405.501 428.132 445.911 459.363 467.732 470.662 467.82 459.258 444.88 425.312 401.552 372.994 339.599 -23.1336 -6.86939 -3.99743 -2.47008 -1.51396 -0.790652 -0.282069 0.0295359 0.198274 0.191224 0.146314 0.097377 0.0493797 0.00185883 -0.0420577 -0.0811786 -0.115439 -0.14351 -0.164934 -0.176066 -0.235888 -0.652355 -2.75055 -11.205 -33.8915 -64.0996 -97.1691 -130.826 -157.696 -151.22 -137.946 -112.759 -76.5764 -42.2482 -0.948278 42.7801 88.1898 133.55 179.793 225.79 271.46 315.797 357.831 397.311 432.756 463.096 488.27 507.921 521.495 528.582 529.158 523.564 511.431 492.998 468.572 438.762 404.171 365.541 323.696 279.27 233.35 186.466 139.868 93.9483 49.5465 6.65127 -33.7991 -72.1826 -106.669 -133.94 -147.701 -137.166 -112.191 -85.0891 -59.5182 -39.0785 -26.6446 -17.9735 -11.8487 -7.6843 -4.95286 -3.25642 -2.2806 -1.78627 -1.58028 -1.53794 -1.60635 -1.75242 -2.02504 -2.45415 -3.07363 -4.00855 -5.36365 -7.41897 -10.5413 -15.3196 -22.8285 -34.5756 -51.3165 -71.0518 -93.5769 -117.52 -137.244 -142.876 -137.524 -121.994 -94.3605 -61.3736 -26.4214 10.6128 49.1361 89.0658 130.264 172.038 214.515 256.748 298.379 339.038 377.569 413.68 446.307 474.522 497.417 514.026 523.652 525.6 520.903 508.715 489.195 463.05 431.233 394.457 353.267 309.118 262.697 214.818 166.049 118.077 71.0617 25.1748 -18.8715 -59.2714 -95.7198 -125.327 -143.092 -141.397 -122.593 -100.871 -79.6637 -61.2316 -45.8139 -34.4455 -26.9703 -21.2248 -16.7123 -13.2555 -10.5748 -8.50338 -7.11711 -6.2625 -5.81384 -5.15757 -4.73644 -4.85625 -5.29168 -5.88269 -6.69216 -7.93246 -9.91977 -12.7475 -16.878 -23.1375 -32.6944 -46.7667 -63.985 -84.5123 -107.424 -129.164 -142.209 -141.047 -130.362 -107.464 -74.067 -37.8576 0.971968 42.1635 84.8516 129.348 174.261 219.781 264.612 308.143 349.511 387.87 422.552 452.558 477.28 495.898 507.653 512.065 510.861 502.901 488.162 467.346 441.162 410.318 375.542 337.365 296.817 254.548 211.238 167.227 123.649 81.0298 38.9651 -1.68827 -39.9036 -75.8301 -107.762 -132.759 -144.969 -136.785 -115.182 -91.8442 -69.5011 -50.559 -36.7484 -27.0861 -19.8433 -14.4941 -10.4829 -7.55098 -5.52418 -4.2082 -3.45844 -3.1149 -3.09743 -3.29012 -3.67478 -4.24496 -5.18615 -6.55177 -8.68551 -11.9184 -16.8989 -24.822 -37.1896 -53.7355 -72.0071 -91.731 -112.214 -131.323 -142.123 -141.486 -133.722 -116.555 -88.9828 -57.3044 -23.0981 13.9481 53.2397 94.5141 137.72 181.611 226.355 270.827 314.252 355.331 393.513 427.773 457.083 480.705 498.067 508.152 510.952 507.534 497.097 479.879 456.596 428.03 395.146 358.63 319.188 277.332 234.128 190.292 146.956 104.639 64.0964 25.1414 -11.4705 -46.4679 -79.4036 -109.104 -133.478 -148.605 -146.861 -126.687 -102.828 -78.0407 -54.3046 -34.6422 -23.4186 -15.9713 -10.4159 -6.45348 -3.78053 -2.0511 -1.04305 -0.490531 -0.245801 -0.253196 -0.293396 -0.368865 -0.526765 -0.758986 -1.15543 -1.9879 -3.55887 -7.28211 -15.8993 -33.814 -58.801 -86.288 -116.352 -147.607 -156.963 -149.861 -134.435 -108.534 -82.4618 -47.6522 -13.0898 19.6412 56.6523 95.3958 132.662 168.977 203.859 244.933 283.731 319.913 352.464 382.352 409.658 432.835 450.914 464.725 473.322 476.302 473.434 464.776 450.086 430.034 405.949 376.972 342.621 1.32022 1.20977 0.95174 0.857331 0.725621 0.591097 0.460166 0.337267 0.247479 0.190734 0.142687 0.0942995 0.0477969 0.00272355 -0.0388415 -0.0758785 -0.108286 -0.13481 -0.155009 -0.161752 -0.163686 -0.195167 -0.262299 -0.276289 -0.290004 -0.342462 -0.591636 -2.05754 -9.55777 -28.1529 -50.0515 -70.7521 -61.6456 -41.1022 -3.5563 40.3889 86.3468 132.428 179.442 226.142 272.661 317.86 360.689 401.122 437.431 468.378 494.086 514.22 528.131 535.387 535.94 530.281 517.874 499.026 474.057 443.554 408.194 368.765 326.05 280.729 233.978 186.234 139.016 92.5162 47.8033 4.95938 -33.1167 -59.1154 -58.4403 -44.6479 -27.9831 -14.8237 -7.43719 -2.85768 -0.545116 0.024924 0.0361448 0.0440119 0.0481683 0.0476978 0.0381076 0.0323894 0.0293857 0.0272784 0.0249651 0.0219556 0.0187095 0.0155722 0.0105697 0.00387411 -0.00472304 -0.0169224 -0.0335351 -0.0583736 -0.0968455 -0.156516 -0.255828 -0.42636 -0.747063 -1.37529 -2.67337 -5.57745 -11.9267 -24.4938 -40.5372 -56.1848 -62.2438 -49.7547 -26.1494 8.8079 47.4963 87.66 129.275 171.487 214.561 257.456 299.773 341.263 380.597 417.568 451.074 480.102 503.691 520.872 530.852 532.76 528.089 515.635 495.59 468.767 436.2 398.576 356.357 311.247 263.968 215.299 165.638 117.064 69.4939 23.3898 -19.2808 -50.8739 -59.1301 -48.1243 -33.2022 -19.5726 -11.2362 -5.79336 -2.43087 -0.717296 -0.0190609 0.0338673 0.0160949 0.00391383 -0.00786881 -0.0164657 -0.0275396 -0.036128 -0.0417572 -0.0639172 -0.100791 -0.0742992 -0.0338003 -0.036033 -0.036092 -0.0295938 -0.0285482 -0.0410458 -0.0708039 -0.112927 -0.170742 -0.253691 -0.376605 -0.61292 -1.04126 -1.9751 -3.99993 -8.33091 -17.8074 -33.0156 -49.6312 -61.7252 -55.6983 -35.051 -1.03293 40.3397 83.3105 128.395 173.867 220.179 265.833 310.216 352.478 391.681 427.198 457.96 483.318 502.451 514.476 518.673 517.583 509.499 494.313 472.951 446.077 414.515 378.992 339.995 298.669 255.631 211.686 166.892 122.72 79.7042 37.2881 -2.7902 -36.8905 -58.183 -56.2034 -43.7733 -29.3995 -17.0122 -9.33817 -4.37235 -1.54465 -0.311573 -0.0722018 -0.101546 -0.0813154 -0.0516606 -0.0323984 -0.0165658 -0.00651231 6.4779e-05 0.00149195 0.00282054 0.000977544 -0.00231842 -0.00751909 -0.0136067 -0.0256804 -0.0432762 -0.0708786 -0.1111 -0.1685 -0.269238 -0.449066 -0.780799 -1.39183 -2.52824 -4.7102 -9.2775 -18.1716 -31.2962 -45.8224 -58.8763 -60.6845 -47.4547 -23.6385 11.7321 51.2128 92.8089 136.593 181.059 226.614 271.955 316.356 358.343 397.474 432.604 462.695 486.985 504.865 515.151 517.775 514.445 503.751 486.044 462.127 432.808 399.162 361.849 321.614 278.881 234.852 190.192 146.219 103.39 62.657 23.6716 -12.4526 -43.1499 -61.7202 -58.3243 -46.0787 -31.2449 -17.5342 -9.90465 -4.78575 -1.58995 -0.0833725 0.0535739 0.0656567 0.0704838 0.0709554 0.0685792 0.0645604 0.0583862 0.0506263 0.0421371 0.0366231 0.0293043 0.020593 0.0103051 -0.00252073 -0.016886 -0.0327228 -0.0531987 -0.0767351 -0.101217 -0.126794 -0.171407 -0.27274 -0.522614 -1.34293 -4.60759 -15.932 -35.65 -56.1902 -70.3639 -68.1833 -44.864 -14.074 17.7333 54.9961 94.4691 132.323 168.858 203.179 245.975 285.633 322.576 355.529 385.933 413.947 437.705 456.056 470.27 479.104 482.104 479.22 470.477 455.47 434.884 410.452 381.121 345.679 1.25112 1.14531 0.922085 0.816788 0.691212 0.563444 0.439626 0.324836 0.240351 0.184031 0.136399 0.0899887 0.0455642 0.00277791 -0.0366354 -0.0717997 -0.102482 -0.127611 -0.146676 -0.154186 -0.159087 -0.188304 -0.246529 -0.264884 -0.271813 -0.286817 -0.304152 -0.33679 -0.341938 -0.364759 -0.391717 -0.385426 -0.220552 1.49231 11.238 42.7738 84.9159 131.043 178.913 226.378 273.845 319.98 363.606 405.044 442.269 473.82 500.073 520.715 534.983 542.418 542.926 537.228 524.521 505.248 479.727 448.483 412.342 372.083 328.452 282.218 234.612 186.058 138.301 91.4736 48.6727 18.4373 5.87595 0.807848 0.304309 0.167672 0.13013 0.109492 0.0873669 0.074297 0.0693615 0.0758304 0.065074 0.0587898 0.0549081 0.0517585 0.0487871 0.0470153 0.0463204 0.0454014 0.0439415 0.0421159 0.0401634 0.039227 0.0381593 0.0374527 0.0370542 0.0371372 0.0375499 0.0383448 0.0391842 0.0404544 0.0428989 0.0460637 0.0493626 0.053887 0.0579495 0.0611929 0.0673797 0.0816251 0.115423 0.201574 0.479516 1.55059 5.90485 21.5107 50.1193 86.5353 128.374 170.994 214.607 258.098 301.118 343.427 383.538 421.418 455.807 485.711 510.025 527.813 538.214 539.972 535.393 522.66 502.006 474.406 441.021 402.493 359.169 313.082 264.913 215.296 164.543 115.451 68.6731 30.1446 10.6785 2.37744 0.321489 0.195321 0.130195 0.117681 0.0977288 0.0896581 0.0768213 0.065842 0.0663891 0.0578094 0.0531356 0.0475784 0.0431499 0.0390429 0.0344047 0.031217 0.0299149 0.0272933 0.024704 0.0280316 0.0310081 0.0317044 0.0337752 0.0362917 0.0381861 0.036379 0.0338981 0.0333111 0.0359116 0.0397984 0.0437225 0.0511522 0.0573138 0.058804 0.0596098 0.0593734 0.064746 0.0818032 0.128453 0.28713 0.893378 3.68043 15.674 44.3383 82.2623 127.607 173.493 220.62 267.079 312.276 355.487 395.579 431.939 463.49 489.53 509.202 521.539 525.396 524.512 516.301 500.615 478.674 451.043 418.725 382.397 342.48 300.287 256.373 211.675 165.969 121.366 78.8541 40.6114 16.6082 5.69548 0.858128 0.255719 0.26543 0.137039 0.0859604 0.0779096 0.0773482 0.0736032 0.0538628 0.034218 0.0354684 0.0398001 0.0429115 0.0442814 0.044402 0.0429943 0.0411404 0.038453 0.0356473 0.0344054 0.0335951 0.0334503 0.0340194 0.0332458 0.0316935 0.0292288 0.0285009 0.0303569 0.0324541 0.0370692 0.0429616 0.0477407 0.0501808 0.0453658 0.047194 0.055779 0.0705327 0.109498 0.207073 0.531983 1.74556 6.5468 23.3759 52.9588 91.3322 135.555 180.534 226.875 273.069 318.476 361.345 401.495 437.503 468.438 493.442 511.872 522.379 524.679 521.564 510.601 492.375 467.784 437.665 403.228 365.073 324.028 280.374 235.488 190.022 145.501 102.347 62.7192 29.8189 12.0526 3.56179 0.45282 0.263836 0.181266 0.119688 0.127364 0.111949 0.102175 0.095502 0.0962357 0.0879565 0.0833646 0.0784045 0.0735123 0.0683776 0.0630333 0.0570142 0.0495951 0.0416983 0.0357353 0.0285196 0.0202557 0.0102012 -0.00157641 -0.0148922 -0.0301876 -0.0481338 -0.0687157 -0.0886912 -0.104079 -0.128997 -0.155191 -0.187725 -0.231571 -0.258505 -0.301722 -0.34937 -0.40223 -0.425422 -0.506048 0.0358053 7.73805 24.6179 55.0992 94.003 132.032 168.609 202.053 247.071 287.595 325.362 358.659 389.583 418.373 442.752 461.331 476.007 485.086 488.061 485.173 476.36 461.047 439.868 415.032 385.459 348.746 1.16868 1.07166 0.881785 0.773909 0.65535 0.535293 0.4193 0.312569 0.232478 0.176997 0.130238 0.0857891 0.0434521 0.00296761 -0.0343066 -0.0675898 -0.0965913 -0.120417 -0.138739 -0.147332 -0.154681 -0.182026 -0.232457 -0.249914 -0.258868 -0.273846 -0.291468 -0.31777 -0.333024 -0.346354 -0.36764 -0.345006 -0.233357 1.21889 11.7359 41.9946 85.4772 130.239 178.577 226.261 274.662 322.058 366.524 409.083 447.295 479.428 506.233 527.408 542.055 549.68 550.113 544.404 531.368 511.669 485.582 453.543 416.608 375.478 330.879 283.81 235.269 185.778 136.888 89.4635 47.008 17.8176 5.71082 0.787589 0.291534 0.162179 0.119032 0.102158 0.0835429 0.0717947 0.067413 0.0706893 0.0623559 0.0565461 0.0526864 0.0495729 0.0468002 0.0450278 0.0442237 0.0432886 0.0419077 0.0404234 0.0385781 0.0376327 0.036626 0.0359907 0.0356146 0.0357065 0.036099 0.0368376 0.037692 0.0389552 0.0412087 0.0441483 0.0471374 0.0510349 0.0542205 0.0574949 0.0636914 0.0782091 0.11026 0.190948 0.455167 1.47123 5.58387 20.6684 48.8337 84.9019 127.202 170.483 214.77 258.795 302.489 345.669 386.474 425.318 460.572 491.312 516.378 534.768 545.562 547.159 542.642 529.573 508.232 479.813 445.549 406.065 361.506 314.298 265.118 214.44 162.582 112.964 66.1659 28.3826 9.91476 2.18909 0.313614 0.196159 0.131036 0.113409 0.0966967 0.0878281 0.0751976 0.0650074 0.0636337 0.0562806 0.0514358 0.0461451 0.0417499 0.0377366 0.0331978 0.0300254 0.0284798 0.0263421 0.0250657 0.0274162 0.030664 0.0312375 0.0330408 0.0354794 0.0368796 0.0349053 0.0325576 0.0318917 0.0347335 0.0385761 0.0427099 0.0497201 0.0554758 0.0571679 0.0590936 0.0593521 0.0636474 0.0768283 0.120328 0.270598 0.843861 3.44557 14.8063 42.9812 80.8106 126.734 173.099 221.096 268.356 314.336 358.515 399.528 436.774 469.129 495.898 516.14 528.833 532.254 531.642 523.241 506.975 484.396 455.903 422.742 385.535 344.546 301.398 256.522 211.068 164.464 119.399 76.872 38.9306 15.7022 5.32774 0.839619 0.255374 0.248844 0.135268 0.091843 0.0795122 0.0768179 0.0704913 0.0523018 0.0350012 0.0344026 0.0384739 0.0415657 0.0430888 0.0432321 0.0419536 0.0402061 0.0377527 0.0350251 0.0334989 0.0326944 0.0326659 0.0331984 0.0325245 0.0309476 0.0287059 0.027818 0.029061 0.031161 0.0358178 0.0420404 0.046886 0.049783 0.0460261 0.0471292 0.0532777 0.0662228 0.102445 0.195803 0.507268 1.64161 6.10505 22.2002 51.297 89.7583 134.488 180.019 227.215 274.238 320.662 364.401 405.631 442.494 474.316 500.085 519.071 529.823 531.702 528.867 517.592 498.797 473.48 442.487 407.248 368.162 326.3 281.771 235.971 189.592 144.228 100.493 60.9944 28.7672 11.6801 3.50476 0.440631 0.256388 0.171412 0.122721 0.118436 0.106617 0.0978057 0.0917618 0.0914825 0.0839387 0.0794126 0.0746146 0.069901 0.0649889 0.0598684 0.0541475 0.0472441 0.039987 0.0340466 0.0272755 0.0191798 0.00962155 -0.00163214 -0.0143904 -0.0290781 -0.0459047 -0.0655066 -0.0838036 -0.100002 -0.123334 -0.148828 -0.179132 -0.219174 -0.250061 -0.28638 -0.332073 -0.379048 -0.439312 -0.417358 -0.0232362 4.32411 26.2516 55.4878 96.2912 132.439 169.073 200.303 248.066 289.519 328.265 361.82 393.289 422.94 447.99 466.728 481.942 491.277 494.182 491.285 482.423 466.841 444.992 419.637 390.013 351.79 1.08987 1.00223 0.838885 0.731887 0.619978 0.50732 0.398811 0.299576 0.223829 0.169661 0.124104 0.0815962 0.0413339 0.00308254 -0.0321063 -0.0635491 -0.0909178 -0.113467 -0.130959 -0.140252 -0.149319 -0.174853 -0.218372 -0.236194 -0.245941 -0.2606 -0.277017 -0.301991 -0.314849 -0.329244 -0.347755 -0.354016 -0.360569 -0.363996 -0.229699 1.06409 16.5071 75.3861 155.702 222.417 275.555 323.877 369.032 413.1 452.468 485.182 512.563 534.307 549.347 557.18 557.495 551.811 538.416 518.289 491.616 458.695 420.946 378.958 333.317 284.896 231.683 161.862 82.2612 27.8623 6.10353 0.803501 0.367077 0.210935 0.1466 0.105715 0.093783 0.0880754 0.0767231 0.0680951 0.0646663 0.0660412 0.0592508 0.0539605 0.0502196 0.0472254 0.0446804 0.0429639 0.0421019 0.0411579 0.0398595 0.0384707 0.0368562 0.0358876 0.0349704 0.0343683 0.0340196 0.0341063 0.0344676 0.0351457 0.0359998 0.0372114 0.0392593 0.0419336 0.044635 0.0478125 0.0498674 0.051378 0.0528871 0.0556709 0.0588897 0.0620173 0.0761203 0.124652 0.287495 0.979499 4.443 21.166 72.2876 139.184 204.32 257.767 303.717 347.891 389.343 429.224 465.417 496.93 522.763 541.781 552.997 554.319 549.934 536.539 514.438 485.165 450.014 409.48 363.526 315.26 264.009 204.095 123.118 50.4685 15.3211 2.1191 0.464523 0.266328 0.141975 0.11524 0.0981968 0.0970267 0.0865217 0.0800621 0.0708976 0.0628339 0.0606813 0.0543927 0.0495476 0.0446096 0.0403577 0.0364271 0.031946 0.0286301 0.0268791 0.0252353 0.024379 0.0262959 0.0291134 0.0299728 0.03199 0.0348736 0.0357595 0.0335885 0.0312278 0.030527 0.0333372 0.0369542 0.0410639 0.0474859 0.0525745 0.0539343 0.0547968 0.0528672 0.051271 0.0503361 0.0524165 0.0649388 0.0939401 0.186422 0.622281 3.14983 17.7802 71.5918 143.854 212.955 268.667 316.207 361.385 403.355 441.576 474.772 502.321 523.17 536.291 539.593 538.973 530.33 513.418 490.164 460.712 426.661 388.538 346.37 302.15 254.941 199.987 126.569 58.4831 21.1931 4.51868 0.596556 0.518714 0.253478 0.109608 0.0983298 0.079341 0.0683586 0.0637471 0.0651243 0.0635539 0.0500044 0.035143 0.0333823 0.0368484 0.0400904 0.0417616 0.0419889 0.0409024 0.0392135 0.0365651 0.0340897 0.0324095 0.0315866 0.0317505 0.0323135 0.0317289 0.0301842 0.0280845 0.0269786 0.0275596 0.0293601 0.0337323 0.0401436 0.0445981 0.0466728 0.0421438 0.0399577 0.0402456 0.041561 0.0452565 0.0521809 0.0756423 0.128725 0.291297 1.00957 4.82963 25.0799 82.6366 154.6 220.558 274.817 322.751 367.398 409.803 447.582 480.314 506.91 526.47 537.503 539.116 536.419 524.769 505.317 479.172 447.188 411.033 370.903 328.199 282.177 231.728 167.402 93.9038 37.0206 12.0174 1.58141 0.482694 0.246293 0.184213 0.14688 0.121773 0.102842 0.104454 0.0979789 0.0917217 0.0869961 0.0864872 0.0798318 0.0754959 0.0709469 0.0664222 0.0617404 0.0568323 0.0513589 0.0448879 0.0381581 0.032322 0.0257916 0.0180815 0.00893737 -0.00173797 -0.0137728 -0.0278646 -0.04368 -0.0619137 -0.079497 -0.0954418 -0.117453 -0.141662 -0.171068 -0.208057 -0.236917 -0.272359 -0.316785 -0.363603 -0.417784 -0.467892 -0.527357 -0.591958 -0.497453 0.803554 18.7197 77.2108 146.377 195.648 248.977 291.754 331.262 364.833 396.917 427.642 453.43 472.226 488.085 497.69 500.481 497.551 488.655 472.852 450.259 424.242 394.768 354.685 1.01467 0.935918 0.794324 0.690479 0.585033 0.479525 0.37821 0.285991 0.214512 0.162043 0.117964 0.0774148 0.0392329 0.00317136 -0.0299695 -0.0595967 -0.0853715 -0.106684 -0.12336 -0.133222 -0.14344 -0.167234 -0.205212 -0.222816 -0.232977 -0.247438 -0.263181 -0.285345 -0.298035 -0.311192 -0.32912 -0.334501 -0.343933 -0.355549 -0.364348 -0.372331 -0.167099 1.51083 20.1787 119.856 236.658 317.199 371.368 416.957 457.505 490.835 518.948 541.395 556.863 564.926 565.068 559.452 545.642 525.08 497.775 463.863 425.298 381.577 329.036 243.449 125.398 40.2081 7.26304 1.13805 0.489332 0.252621 0.152913 0.126313 0.109301 0.091115 0.0857573 0.0814119 0.0723136 0.0648877 0.0616994 0.0617943 0.0561073 0.0513002 0.0477397 0.0448877 0.0425261 0.0408484 0.0399289 0.0389731 0.0377584 0.0364263 0.0349965 0.0340338 0.033194 0.032627 0.0323033 0.0323919 0.0327275 0.0333736 0.034232 0.0354109 0.0373319 0.0397907 0.0424179 0.0452978 0.0472221 0.0487372 0.0499819 0.0519661 0.0536701 0.0525572 0.0523986 0.0542758 0.057585 0.0815367 0.192155 0.679727 3.45167 19.8456 88.4112 188.405 279.67 345.239 391.811 432.819 470.143 502.484 529.109 548.852 560.554 562.136 557.699 543.934 520.969 490.791 454.708 413.007 364.113 301.173 196.054 82.759 23.3206 2.86814 0.808548 0.406644 0.157594 0.108486 0.0960799 0.0912812 0.0871339 0.0892449 0.0817004 0.0758384 0.0679725 0.060908 0.058071 0.0523679 0.0474733 0.0427836 0.0386737 0.0348265 0.0305623 0.0273099 0.0254749 0.0242826 0.0236067 0.0259113 0.0279424 0.028731 0.0308894 0.0336912 0.0341167 0.0322121 0.0298863 0.029324 0.0321425 0.0356548 0.0397468 0.0462734 0.0505787 0.0520294 0.052952 0.0511714 0.0485803 0.0463003 0.0459481 0.0496142 0.0522561 0.052957 0.0692505 0.15372 0.567661 3.25263 21.7524 102.742 212.617 300.735 362.123 406.782 446.063 480.172 508.586 530.124 543.786 548.418 546.626 537.667 520.019 496.032 465.521 430.563 391.108 344.158 278.074 176.508 77.7372 24.6425 3.75262 0.923016 0.624792 0.245824 0.151702 0.106201 0.0597421 0.0636874 0.0654754 0.0629107 0.0600847 0.0616812 0.0601401 0.0483154 0.035092 0.032672 0.0354806 0.0386334 0.0403924 0.0406209 0.039632 0.0379953 0.0355343 0.0331512 0.0313084 0.030452 0.0307313 0.0313712 0.0308245 0.029341 0.0273906 0.0261233 0.0262251 0.0278283 0.032134 0.0388358 0.0436556 0.0455799 0.0411545 0.0381482 0.0373832 0.0374145 0.0389106 0.0403475 0.0472801 0.0542322 0.0611296 0.0874271 0.207265 0.789805 4.40539 28.0932 115.148 225.552 311.221 369.163 413.666 452.468 486.261 513.73 533.92 545.425 547.662 544.467 532.321 512.07 484.974 451.864 414.338 371.742 320.023 235.863 126.962 46.078 11.066 1.31085 0.622427 0.320817 0.183363 0.12556 0.128595 0.119994 0.107994 0.0966647 0.0974156 0.0924049 0.0869068 0.0826715 0.0816766 0.0756602 0.0715079 0.0672056 0.0628985 0.0584783 0.0538054 0.0486024 0.0425628 0.0362967 0.0306243 0.0244131 0.0169997 0.00833077 -0.00176139 -0.013216 -0.0265938 -0.0414353 -0.0585574 -0.0750935 -0.0908598 -0.111615 -0.134848 -0.162576 -0.196493 -0.224852 -0.258596 -0.300611 -0.344376 -0.395303 -0.445011 -0.502337 -0.563962 -0.623336 -0.703593 -0.727331 -0.320241 7.43305 75.627 178.426 275.694 330.058 368.053 400.517 432.43 459.012 477.733 494.442 504.342 507.139 504.046 495.067 479.023 455.682 428.753 399.772 357.725 0.942691 0.872195 0.74865 0.64948 0.550417 0.451849 0.357471 0.271883 0.20462 0.154163 0.111789 0.0732323 0.0371353 0.00322382 -0.0279057 -0.0557443 -0.0799584 -0.100055 -0.115888 -0.126116 -0.137055 -0.159172 -0.192443 -0.209631 -0.220047 -0.23407 -0.249078 -0.269173 -0.28127 -0.293929 -0.310033 -0.315589 -0.325197 -0.336395 -0.348199 -0.354965 -0.362522 -0.350091 -0.154264 3.13383 33.5463 164.887 316.358 406.868 462.535 496.601 525.373 548.561 564.506 572.905 572.842 567.264 552.947 531.919 503.692 467.345 419.062 323.274 176.79 58.7476 10.8857 1.6055 0.665823 0.308068 0.174736 0.135598 0.107648 0.10543 0.0975372 0.0852064 0.080706 0.0762064 0.0682238 0.0616399 0.0585873 0.0578617 0.0529644 0.0485628 0.045184 0.0424678 0.04026 0.0386451 0.0377019 0.0367506 0.0356027 0.0343333 0.0330472 0.0321271 0.0313411 0.0308192 0.0305061 0.0305935 0.0308857 0.0314914 0.0323076 0.0334179 0.0352105 0.0374609 0.0399239 0.0425462 0.0444306 0.0460766 0.0471866 0.0489292 0.0504807 0.0493188 0.0487558 0.0486142 0.0454416 0.0427338 0.0427004 0.0536714 0.134311 0.560173 3.17584 19.6081 99.7554 233.399 348.476 424.317 473.916 507.608 535.082 555.727 568.007 569.099 565.157 551.034 527.088 495.637 455.768 395.489 272.229 125.935 38.7689 5.85112 1.43123 0.651406 0.216375 0.126155 0.0875777 0.0794987 0.0837693 0.0838987 0.0824582 0.0839854 0.0778854 0.0722921 0.0648976 0.058319 0.0550113 0.0498294 0.0451129 0.0406875 0.0367755 0.0330418 0.0290789 0.0259858 0.0241919 0.0231105 0.0225942 0.0243646 0.0264004 0.0272895 0.0293408 0.0319758 0.0321971 0.0305458 0.028458 0.0280256 0.0306618 0.0340125 0.0380256 0.0444091 0.0480376 0.0498355 0.0506189 0.0490669 0.0461236 0.043812 0.0438903 0.04705 0.0479051 0.0441566 0.0410989 0.0422452 0.0569847 0.132246 0.591112 4.02734 29.8993 136.221 277.163 380.14 444.552 484.977 514.204 536.62 550.884 554.722 553.596 544.45 526.028 501.04 467.757 423.764 346.772 218.422 94.5561 30.0871 4.60298 1.56965 0.767587 0.257807 0.147176 0.103069 0.0852032 0.0749674 0.0524657 0.0573835 0.0617074 0.0605485 0.0583219 0.059104 0.0568687 0.0462854 0.0346319 0.0318184 0.0339899 0.0368512 0.0385704 0.0388115 0.037947 0.0363962 0.0340599 0.0318033 0.0299792 0.0291556 0.029391 0.0300352 0.0296346 0.0281995 0.0264227 0.0251005 0.0248828 0.0262302 0.0305475 0.0371645 0.0427243 0.0442222 0.0401295 0.0365967 0.035193 0.0351334 0.0369073 0.0383926 0.0439244 0.0475042 0.0462445 0.0440536 0.0482383 0.0721202 0.175338 0.770593 5.06118 37.3967 156.506 295.703 394.005 453.552 491.626 520.268 541.033 553.059 554.999 552.242 539.681 518.596 490.007 452.593 397.642 294.256 161.036 58.9847 12.9512 1.71105 0.868573 0.38597 0.227374 0.170186 0.1246 0.102827 0.113504 0.109953 0.101036 0.0923205 0.0915859 0.087165 0.0820973 0.0782281 0.0768515 0.0714997 0.0675414 0.0634801 0.0594041 0.0552207 0.0507765 0.0458498 0.0402164 0.0343768 0.0289223 0.0229863 0.0159607 0.00774574 -0.00179317 -0.0125842 -0.0252436 -0.0391789 -0.0551701 -0.0707976 -0.0861434 -0.10572 -0.127745 -0.153952 -0.185387 -0.212702 -0.24469 -0.2844 -0.325897 -0.373252 -0.420132 -0.475044 -0.532941 -0.591999 -0.660402 -0.721725 -0.78592 -0.847546 -0.708405 2.07002 48.7481 185.155 315.083 390.246 433.669 464.901 483.277 501.032 511.251 514.282 510.792 501.615 485.291 461.419 433.29 385.499 239.626 0.87362 0.810686 0.702344 0.608801 0.516088 0.424276 0.3366 0.257315 0.19423 0.146039 0.105561 0.0690403 0.0350355 0.00324288 -0.0259072 -0.0519813 -0.0746634 -0.0935656 -0.108593 -0.118967 -0.130268 -0.150775 -0.180065 -0.196625 -0.207105 -0.220626 -0.234881 -0.253048 -0.264629 -0.276751 -0.291468 -0.29713 -0.306108 -0.316992 -0.326164 -0.335457 -0.343769 -0.35125 -0.338016 -0.277675 -0.0118505 3.96378 48.8754 203.068 372.008 469.143 523.742 556.096 572.214 580.533 580.213 574.259 558.076 532.042 482.045 367.926 210.952 75.9125 16.5487 2.0158 0.866432 0.391855 0.210283 0.137471 0.109171 0.107969 0.0957048 0.0963407 0.0904094 0.0803818 0.0758431 0.0712571 0.0642127 0.0583648 0.0553609 0.0540821 0.0497983 0.0457789 0.0425887 0.0400172 0.0379508 0.0364067 0.0354592 0.0345228 0.0334512 0.0322555 0.0310809 0.0302021 0.0294709 0.0289856 0.0286878 0.0287633 0.0290188 0.0295811 0.0303486 0.0313949 0.033063 0.0351039 0.0373783 0.0397245 0.0414841 0.0430394 0.0439576 0.0455854 0.0469579 0.0461829 0.0457722 0.0451352 0.0420915 0.0385707 0.0344809 0.0282827 0.0244865 0.0312847 0.101656 0.503841 3.06242 20.5061 101.716 253.116 391.85 477.209 528.404 558.245 572.575 574.182 570.209 553.457 519.921 454.111 327.608 168.523 57.7549 11.2826 2.43551 1.23773 0.343556 0.15072 0.0938784 0.0804288 0.0719581 0.0726253 0.0782472 0.0795726 0.0787109 0.0789639 0.0735534 0.0681445 0.0613919 0.0553822 0.0518403 0.0470951 0.0426251 0.0384704 0.0347663 0.0311984 0.02751 0.0246602 0.0229242 0.0218122 0.0214673 0.0231411 0.0248605 0.0258239 0.0276961 0.0300797 0.0302521 0.0287597 0.0269804 0.0266163 0.0289932 0.0321246 0.0360263 0.0419055 0.0452025 0.0470064 0.0475737 0.0463512 0.0436331 0.0412869 0.041821 0.0449484 0.0457328 0.04217 0.0378987 0.0345413 0.031029 0.0251514 0.0370555 0.136753 0.761238 5.076 37.5738 157.21 308.821 421.724 488.92 529.528 551.069 557.654 556.301 544.701 517.389 468.505 366.283 231.587 104.522 34.5194 5.99151 2.28405 1.16724 0.384342 0.173223 0.0860106 0.0671489 0.0730549 0.0722559 0.0673746 0.0516778 0.0552322 0.0589682 0.05784 0.0558469 0.0559769 0.0533668 0.0439639 0.0337706 0.0307683 0.0323704 0.0348306 0.036449 0.036727 0.0359832 0.0345226 0.0324165 0.0302469 0.0284893 0.027742 0.0278651 0.0284229 0.0281532 0.0268083 0.0252232 0.0239166 0.0235455 0.0247085 0.0289123 0.0352717 0.0410666 0.042204 0.0386443 0.0349566 0.0330092 0.0332352 0.0350241 0.037039 0.0422861 0.0456083 0.0441635 0.0407299 0.0379623 0.0362063 0.0307216 0.0497162 0.179684 0.985905 6.89035 47.3415 184.42 332.612 440.608 503.324 538.27 554.962 560.252 555.948 539.637 507.113 441.165 319.825 173.323 66.9867 15.9114 2.26626 1.47957 0.541754 0.230275 0.17025 0.140449 0.133695 0.110013 0.0965717 0.10531 0.102542 0.0950615 0.0875817 0.0858935 0.0819141 0.0772915 0.0737391 0.0721155 0.067372 0.0636019 0.0597695 0.0559142 0.0519595 0.0477511 0.0431037 0.0378647 0.0324269 0.0272204 0.0215887 0.0149215 0.00717497 -0.00179168 -0.0119601 -0.0238779 -0.0369168 -0.0518276 -0.0665662 -0.0813572 -0.0997648 -0.120631 -0.145203 -0.174304 -0.200451 -0.230821 -0.268112 -0.307106 -0.351291 -0.396077 -0.447639 -0.501963 -0.555783 -0.620688 -0.676073 -0.741864 -0.79604 -0.836903 -0.917469 -0.944023 -0.22847 14.9194 125.287 265.834 398.812 469.327 499.539 515.571 521.695 518.109 508.111 467.021 350.536 208.811 66.6188 17.4613 0.807134 0.751094 0.655745 0.56839 0.482007 0.39679 0.315604 0.242343 0.183408 0.137692 0.0992685 0.0648315 0.032928 0.00322858 -0.0239707 -0.0483021 -0.069476 -0.0871935 -0.101428 -0.111758 -0.123139 -0.142095 -0.167976 -0.183759 -0.194165 -0.207088 -0.220555 -0.237017 -0.248168 -0.259516 -0.272987 -0.278742 -0.28679 -0.297823 -0.306472 -0.315902 -0.321466 -0.327777 -0.318378 -0.320021 -0.323701 -0.253906 0.250825 4.67213 42.4263 169.98 317.411 443.473 520.034 547.976 541.572 501.318 422.542 316.066 177.718 71.757 17.6716 1.92053 0.923758 0.427532 0.226675 0.145433 0.113653 0.0997801 0.0933023 0.0970558 0.0891505 0.0890731 0.0838764 0.0754624 0.0710768 0.0665278 0.0602649 0.0550118 0.0520641 0.0504138 0.0466141 0.0429537 0.0399639 0.0375445 0.0356134 0.0341449 0.0332088 0.0322951 0.031293 0.0301765 0.0291119 0.0282721 0.0275952 0.0271406 0.0268689 0.0269172 0.0271553 0.0276585 0.0283846 0.0293615 0.0309103 0.0327397 0.0348538 0.0369297 0.0385856 0.0399935 0.0408626 0.0422914 0.0433562 0.0426257 0.0421208 0.0412875 0.0387609 0.035741 0.0314986 0.0251154 0.018186 0.00986536 0.00135687 0.003799 0.0724739 0.491514 2.7853 17.012 81.985 213.971 340.551 435.218 486.214 492.609 471.523 403.517 289.139 158.024 66.3702 17.412 4.50912 2.0334 0.659743 0.217013 0.0840073 0.0723208 0.0687405 0.0695948 0.0668487 0.0689083 0.0738313 0.0748971 0.0741567 0.0737007 0.0689788 0.0638682 0.0577378 0.0522584 0.0486346 0.0442723 0.0400672 0.0361871 0.0326858 0.0293194 0.0258929 0.0232762 0.021608 0.0205285 0.0202946 0.0218087 0.0232716 0.0242926 0.0260062 0.0280908 0.0282434 0.0269101 0.0254364 0.0251657 0.0272663 0.0301877 0.0339572 0.0391737 0.042152 0.0439106 0.0444392 0.0432502 0.0407273 0.0384376 0.0392963 0.0422888 0.0430148 0.039851 0.0357096 0.0326199 0.02872 0.0196701 0.0103417 -0.000277933 0.0115198 0.150857 1.01842 5.85313 32.9632 120.703 245.785 348.805 410.11 428.186 419.528 372.724 283.369 178.951 86.3187 30.5854 6.88573 3.56237 1.61057 0.526058 0.221071 0.0921985 0.0655752 0.0534039 0.0555755 0.0660463 0.0672858 0.0628829 0.0504906 0.0525528 0.0556141 0.0546984 0.0529531 0.0525874 0.049772 0.0414523 0.0325761 0.029535 0.0306459 0.0327115 0.0342511 0.0345053 0.0338661 0.0325106 0.0305672 0.0285303 0.0269056 0.0262217 0.026284 0.0267134 0.0264551 0.0252312 0.0237952 0.0225729 0.0221795 0.023312 0.0272527 0.0331292 0.0387259 0.0397998 0.0365416 0.0328639 0.0308024 0.0311591 0.0329412 0.035283 0.0402957 0.0435285 0.0424118 0.0390553 0.0361597 0.0331509 0.0237158 0.0167245 0.00896696 0.0251478 0.206955 1.27901 7.97341 41.7612 146.304 278.716 374.36 420.809 441.35 419.115 355.119 256.497 142.636 61.7177 15.9366 3.59503 2.19663 0.839208 0.294131 0.151289 0.115887 0.119855 0.117919 0.119544 0.102751 0.092512 0.0979289 0.0955277 0.0890684 0.082601 0.0804194 0.0767674 0.072568 0.0692777 0.0674595 0.0632084 0.059642 0.0560348 0.0524098 0.0486886 0.0447214 0.0403618 0.0355009 0.0304474 0.0255132 0.0201873 0.0139109 0.0066346 -0.00177231 -0.0113029 -0.0224726 -0.0346381 -0.0485088 -0.0623454 -0.0764904 -0.0937686 -0.1134 -0.136403 -0.163299 -0.188231 -0.216855 -0.251753 -0.288277 -0.32946 -0.371777 -0.419976 -0.470559 -0.521402 -0.580837 -0.633567 -0.691589 -0.745551 -0.785283 -0.86404 -0.898039 -0.907111 -0.945149 -0.84503 -0.75615 4.30202 64.334 146.471 201.464 215.522 187.434 120.257 48.0184 19.2103 8.03331 4.04782 3.44476 0.742953 0.693178 0.60909 0.528214 0.448143 0.369376 0.294492 0.227018 0.172208 0.129136 0.0929036 0.0606 0.0308139 0.00318175 -0.0220918 -0.0447002 -0.0643859 -0.0809246 -0.0943433 -0.104491 -0.115724 -0.133188 -0.156117 -0.171022 -0.181216 -0.193479 -0.206129 -0.22106 -0.23167 -0.242312 -0.254648 -0.260582 -0.267755 -0.278971 -0.288157 -0.294682 -0.299878 -0.305883 -0.297786 -0.298693 -0.304972 -0.282118 -0.29072 -0.268024 -0.102892 0.783306 5.59032 23.6972 58.2411 93.8034 109.439 97.6327 68.9233 34.6084 6.59843 1.11097 0.803489 0.36995 0.192301 0.125799 0.0962764 0.0918356 0.0902751 0.0877844 0.086246 0.089343 0.0831175 0.0822683 0.0777387 0.0705778 0.0663861 0.0619344 0.0563015 0.0515466 0.0486895 0.0468277 0.0434263 0.0400989 0.0373147 0.0350526 0.0332522 0.0318641 0.0309527 0.03007 0.0291386 0.0281108 0.027141 0.0263452 0.0257209 0.0252901 0.0250412 0.0250697 0.0252882 0.0257433 0.0264238 0.0273342 0.0287551 0.0304053 0.0323492 0.0341795 0.0357423 0.0369795 0.0378503 0.0390225 0.0398602 0.0393168 0.0387196 0.0376872 0.0353818 0.0322246 0.0280494 0.0224728 0.0160319 0.00777536 -0.00313474 -0.0144616 -0.0261531 -0.0290959 0.0176636 0.357987 2.0795 9.64276 30.0015 71.8975 115.933 125.685 115.84 82.0815 39.6304 11.891 4.725 2.81186 1.04244 0.288678 0.0823721 0.0441106 0.0419012 0.0563895 0.0613603 0.0641782 0.0629177 0.0649465 0.0689891 0.0699492 0.069327 0.0684534 0.0643156 0.0595452 0.0539836 0.0489943 0.0453897 0.0413703 0.0374453 0.03384 0.0305525 0.0273938 0.0242379 0.0218292 0.0202333 0.019224 0.0190687 0.0204276 0.0216551 0.0226723 0.0242617 0.0260571 0.0261832 0.0250387 0.0238014 0.0236058 0.0254924 0.0281682 0.0317661 0.0363885 0.0390605 0.0407144 0.0412211 0.0400468 0.0377219 0.0356266 0.0364283 0.0389531 0.0393912 0.0367807 0.0331347 0.0302131 0.0266563 0.0178357 0.00768779 -0.00623586 -0.020277 -0.0324955 -0.0135885 0.157713 1.0084 4.66982 15.7892 41.9477 72.9747 88.3973 85.5883 67.4216 36.4046 13.1287 6.01074 3.6966 1.74837 0.672537 0.253625 0.0843491 0.0514076 0.040829 0.0492573 0.0487739 0.0528351 0.0613899 0.0625414 0.0584523 0.0485938 0.0496628 0.0520516 0.0513308 0.0498131 0.049084 0.0461845 0.0388343 0.0311117 0.0281283 0.0288468 0.0305643 0.0319989 0.0322065 0.0316608 0.0304004 0.0284779 0.0267099 0.0252513 0.024591 0.0246353 0.0249455 0.0246821 0.0235608 0.0222289 0.0211654 0.020826 0.0219188 0.0255681 0.030969 0.0360947 0.037126 0.0341229 0.0306171 0.0285079 0.0287108 0.0305208 0.0330225 0.0376094 0.0406362 0.0399439 0.0367695 0.034067 0.0310978 0.0224378 0.0137071 0.000723296 -0.0146008 -0.0229655 -0.00224365 0.200039 1.21961 5.19092 21.094 48.6343 75.575 94.6775 85.4784 59.4719 27.902 8.15343 4.3761 2.7257 1.00001 0.357989 0.146916 0.0761284 0.0783783 0.0875556 0.103796 0.107955 0.109989 0.0965751 0.0878491 0.090887 0.0887842 0.0830967 0.0775784 0.075077 0.0716529 0.0678199 0.0647798 0.0628278 0.0590134 0.0556666 0.0522892 0.0488934 0.0454092 0.0416907 0.0376198 0.0331242 0.0284435 0.0237991 0.0187947 0.0129079 0.00610691 -0.00173623 -0.0106317 -0.0210467 -0.0323564 -0.0452087 -0.0581604 -0.0715705 -0.0877214 -0.106114 -0.127536 -0.152354 -0.175923 -0.202825 -0.235288 -0.269412 -0.30762 -0.347493 -0.392221 -0.439285 -0.48699 -0.541865 -0.59101 -0.644637 -0.69523 -0.733069 -0.80165 -0.834322 -0.850565 -0.869657 -0.808199 -0.851964 -0.682174 -0.54316 -0.498585 -0.336455 0.676478 0.870075 0.736448 1.31911 1.53934 2.00407 2.49194 2.66276 0.680819 0.636737 0.562537 0.488258 0.414468 0.342025 0.27327 0.211383 0.160679 0.120391 0.086463 0.0563411 0.0286924 0.00310274 -0.0202666 -0.0411693 -0.0593829 -0.0747453 -0.0873237 -0.0971649 -0.10807 -0.124094 -0.144438 -0.158391 -0.16826 -0.179809 -0.191627 -0.205159 -0.215196 -0.225114 -0.236404 -0.242394 -0.249143 -0.260167 -0.269466 -0.272483 -0.27791 -0.284077 -0.277716 -0.276853 -0.281794 -0.264355 -0.272803 -0.266269 -0.250805 -0.242927 -0.217437 -0.191876 -0.172214 -0.157751 -0.125359 0.0197548 0.0986764 0.164313 0.266424 0.119335 0.0839892 0.0638032 0.0581725 0.0648662 0.0687102 0.0767626 0.0808662 0.0805415 0.0804659 0.082243 0.0770234 0.0760871 0.0719262 0.0657122 0.0616622 0.0573658 0.0523042 0.0480044 0.0452618 0.0433007 0.0402379 0.0372196 0.0346433 0.0325424 0.0308706 0.0295672 0.0286915 0.027847 0.0269837 0.0260422 0.0251479 0.0244084 0.0238335 0.0234325 0.0231984 0.0232149 0.0234056 0.0238244 0.0244426 0.0252837 0.0265747 0.0280636 0.0297996 0.0314545 0.0328443 0.0340036 0.0347512 0.0357602 0.0364377 0.0359613 0.0353485 0.0342601 0.0321432 0.0290471 0.0251802 0.0198547 0.0134834 0.00562864 -0.00394481 -0.0149038 -0.0285706 -0.0437273 -0.0629711 -0.0806965 -0.102476 -0.121373 -0.12356 -0.13503 -0.140137 -0.121189 -0.0309335 1.51246 2.16219 1.37538 0.668904 0.295787 0.0667463 -0.0121907 -0.00492283 0.0199734 0.0338609 0.0499373 0.0561471 0.0592199 0.0587709 0.0607207 0.0639965 0.0649029 0.0643549 0.0632395 0.0595804 0.0551811 0.0501496 0.0456003 0.0421094 0.0384039 0.0347766 0.0314365 0.02838 0.0254375 0.0225536 0.0203468 0.0188615 0.0179023 0.0177958 0.0189944 0.0200568 0.0210337 0.0224893 0.0240241 0.0241153 0.0231693 0.0221522 0.0220209 0.0237304 0.0261365 0.0294941 0.0335139 0.0359582 0.037497 0.0378969 0.0368511 0.0347098 0.0329265 0.0335549 0.0356332 0.0358791 0.0335189 0.0300463 0.0270111 0.0236403 0.0157161 0.00617224 -0.00744237 -0.0226175 -0.0402397 -0.0557194 -0.0713033 -0.0876231 -0.100736 -0.095749 -0.103966 -0.112395 -0.103793 -0.100002 1.3096 1.85707 1.37309 0.875842 0.462836 0.204018 0.0549972 0.015139 0.0116003 0.0276499 0.0339957 0.0445797 0.0459692 0.0498357 0.0567618 0.0577582 0.0540852 0.0462161 0.046623 0.0484027 0.0478333 0.0464859 0.0455065 0.0426167 0.0361282 0.029418 0.0265623 0.0269803 0.0283813 0.0296677 0.0298398 0.0293694 0.0282074 0.0264299 0.0248624 0.0235467 0.0229083 0.0229104 0.0231348 0.022865 0.0218497 0.0206514 0.0197209 0.0194445 0.0205007 0.0238543 0.0287196 0.0334136 0.0343412 0.0316719 0.028376 0.0262631 0.0263909 0.0281005 0.0306856 0.0347206 0.0373752 0.0368323 0.0337693 0.0311801 0.0282523 0.0206056 0.0119294 -0.000614005 -0.0165241 -0.0325597 -0.0523461 -0.0735445 -0.0908012 -0.102174 -0.115954 -0.117916 -0.0787823 -0.106055 0.754901 1.32872 1.68486 1.09014 0.586983 0.317042 0.100936 0.0226239 0.0290739 0.0442198 0.0625866 0.0780432 0.0945891 0.0999133 0.100881 0.09016 0.0827639 0.0842631 0.0822035 0.0771988 0.0724016 0.0697161 0.0665186 0.0630329 0.0602338 0.0582271 0.0547969 0.0516765 0.0485315 0.0453678 0.0421227 0.0386575 0.0348787 0.0307359 0.0264192 0.0220787 0.0174062 0.0119207 0.00559874 -0.00168087 -0.00994067 -0.0195974 -0.0300634 -0.0419268 -0.0539837 -0.0666014 -0.0816318 -0.0987626 -0.118618 -0.141445 -0.163586 -0.188709 -0.218774 -0.250467 -0.285842 -0.323078 -0.364493 -0.408035 -0.452739 -0.502988 -0.548924 -0.598214 -0.645577 -0.681729 -0.742245 -0.773016 -0.785985 -0.801585 -0.751694 -0.778548 -0.628123 -0.508808 -0.458147 -0.312955 -0.117139 0.168778 0.452491 0.894933 1.26882 1.64285 2.09285 2.35046 0.620502 0.5816 0.516191 0.448511 0.380959 0.314724 0.251949 0.195479 0.148863 0.111472 0.0799461 0.0520504 0.0265494 0.00299132 -0.018491 -0.0377033 -0.054458 -0.0686433 -0.0803567 -0.0897827 -0.100214 -0.114848 -0.132898 -0.145853 -0.155295 -0.166087 -0.177061 -0.189311 -0.198716 -0.207927 -0.21825 -0.224249 -0.23029 -0.240382 -0.247833 -0.25209 -0.256848 -0.262614 -0.257836 -0.256268 -0.260273 -0.246144 -0.249433 -0.245503 -0.230812 -0.223386 -0.200852 -0.177375 -0.158523 -0.141904 -0.11539 -0.0777584 -0.0606962 -0.0615621 -0.0379115 -0.0236817 -0.000970784 0.0192441 0.0342514 0.0504015 0.0601329 0.0687489 0.0737909 0.074084 0.0745984 0.0754707 0.0712481 0.0700558 0.0661726 0.0607284 0.0568986 0.0528333 0.0482834 0.0444001 0.0417932 0.039814 0.0370504 0.0343207 0.0319535 0.0300151 0.0284719 0.027257 0.0264257 0.0256262 0.0248296 0.0239591 0.0231451 0.022464 0.0219356 0.0215636 0.0213479 0.0213482 0.0215181 0.0218937 0.0224514 0.0232144 0.0243751 0.0257045 0.0272443 0.0287155 0.0299349 0.0309915 0.0316022 0.0324917 0.0329989 0.0324647 0.0318662 0.03075 0.0286607 0.0258056 0.0221389 0.0172583 0.0111973 0.00394908 -0.00501743 -0.0156033 -0.0282137 -0.0423894 -0.0601438 -0.0782911 -0.0992162 -0.116474 -0.123371 -0.133109 -0.136158 -0.120049 -0.112034 -0.054127 0.00101193 -0.0177443 -0.0544398 -0.0774551 -0.0687058 -0.0450316 -0.014582 0.0140696 0.0297024 0.0446883 0.0512593 0.0543609 0.0544612 0.0562866 0.0589569 0.0597797 0.059284 0.0580583 0.0548088 0.0507948 0.0462689 0.0421244 0.0388142 0.0354073 0.032081 0.0290025 0.0261819 0.0234624 0.0208413 0.0188341 0.0174555 0.0165774 0.0164923 0.0175281 0.0184465 0.0193816 0.0206883 0.0219937 0.0220726 0.0212841 0.0204477 0.0203829 0.0219186 0.0240639 0.0271302 0.0306168 0.0327687 0.0341462 0.0344603 0.0335178 0.031719 0.0301624 0.0306797 0.0323275 0.0324874 0.0303749 0.0272797 0.024273 0.0209668 0.0134258 0.00414596 -0.00831741 -0.0228393 -0.0393086 -0.0553143 -0.0702322 -0.0875655 -0.10108 -0.106457 -0.113666 -0.113107 -0.101315 -0.105253 -0.0778993 0.00841756 -0.0020248 -0.0100633 -0.0438151 -0.0476262 -0.0349489 -0.0135929 0.0033163 0.0226511 0.0309599 0.0404867 0.042922 0.0465639 0.052182 0.052992 0.0497598 0.0434439 0.0433791 0.0446838 0.044201 0.0429813 0.0418558 0.0390453 0.0333448 0.0275259 0.0248592 0.025036 0.0261678 0.0272774 0.0274277 0.0270115 0.0259575 0.0243849 0.0229466 0.0217699 0.0211704 0.0211326 0.0212692 0.0209878 0.0200903 0.0190404 0.018237 0.0180309 0.0190341 0.0220696 0.0263872 0.0305152 0.0313761 0.0290654 0.0260348 0.0240091 0.0241315 0.0257844 0.0283076 0.03191 0.0342443 0.0338294 0.0310908 0.0285004 0.025435 0.0181566 0.00972959 -0.0016175 -0.0162024 -0.0322249 -0.0514008 -0.071866 -0.0885953 -0.103156 -0.116821 -0.1199 -0.108314 -0.111451 -0.0831056 -0.0602859 -0.00116646 -0.0041108 -0.04227 -0.0583081 -0.045067 -0.0208736 0.0125183 0.0355908 0.0552849 0.071512 0.0867167 0.0917948 0.0922206 0.0836994 0.0773925 0.0777584 0.0756459 0.0712617 0.0670742 0.0643632 0.0613855 0.0582209 0.0556471 0.0536473 0.0505613 0.0476725 0.0447618 0.0418319 0.0388286 0.0356215 0.0321357 0.0283377 0.0243758 0.0203532 0.0160211 0.0109434 0.00510436 -0.00161148 -0.00923338 -0.0181316 -0.0277647 -0.0386568 -0.0498181 -0.0615917 -0.0755011 -0.0913559 -0.109655 -0.130567 -0.151208 -0.174522 -0.202201 -0.23149 -0.26406 -0.298606 -0.336731 -0.376873 -0.418361 -0.464306 -0.506827 -0.552169 -0.595968 -0.630239 -0.683181 -0.711647 -0.724331 -0.735383 -0.694445 -0.705819 -0.580111 -0.471243 -0.415338 -0.282836 -0.101162 0.154156 0.413292 0.791349 1.14683 1.4843 1.8724 2.11554 0.561788 0.527615 0.470118 0.408964 0.347599 0.287468 0.230536 0.17934 0.136797 0.102395 0.0733545 0.047725 0.0243746 0.00284769 -0.016761 -0.0342962 -0.0496024 -0.0626083 -0.0734318 -0.0823478 -0.0921883 -0.105475 -0.121468 -0.133393 -0.142321 -0.152322 -0.162445 -0.173504 -0.18224 -0.190743 -0.200161 -0.206118 -0.211549 -0.219679 -0.225394 -0.233154 -0.236209 -0.241686 -0.237889 -0.236217 -0.238775 -0.227555 -0.227932 -0.225342 -0.212005 -0.203283 -0.183777 -0.163282 -0.147025 -0.131836 -0.105532 -0.0790018 -0.0701201 -0.0738756 -0.0537242 -0.035842 -0.0110753 0.0112328 0.0291181 0.0438625 0.0544927 0.0622632 0.0672713 0.0678264 0.0685014 0.0688441 0.065453 0.0640057 0.0604635 0.0556964 0.0521169 0.0483252 0.0442414 0.0407437 0.0382927 0.0363565 0.0338639 0.0314059 0.0292475 0.0274728 0.0260582 0.0249355 0.0241555 0.0234074 0.0226779 0.0218678 0.0211448 0.0205176 0.0200349 0.0196874 0.0194916 0.0194771 0.0196245 0.0199493 0.0204515 0.0211334 0.0221638 0.0233411 0.0247009 0.0259681 0.0270601 0.0279428 0.028491 0.0291995 0.0295354 0.0289974 0.028339 0.0271922 0.0251524 0.0224724 0.0189431 0.014442 0.00880086 0.00200392 -0.0061464 -0.0160719 -0.0274382 -0.0406376 -0.0574877 -0.074519 -0.0942695 -0.110122 -0.118804 -0.127721 -0.128985 -0.119329 -0.110132 -0.116609 -0.120998 -0.121233 -0.115562 -0.103286 -0.0761481 -0.0456303 -0.0161121 0.010548 0.0263727 0.0400561 0.0465206 0.0495411 0.0500018 0.0516786 0.0538662 0.0546058 0.0541633 0.0529077 0.0500278 0.0463887 0.0423407 0.0385909 0.035501 0.0323896 0.0293587 0.0265442 0.0239604 0.021471 0.019103 0.0172784 0.0160168 0.0152184 0.015157 0.01603 0.0168367 0.0177034 0.0188712 0.0199912 0.0200529 0.0194018 0.0187018 0.0186889 0.0200435 0.0219419 0.024718 0.0276999 0.0296107 0.0308214 0.0310281 0.0301669 0.0285104 0.0272001 0.0276154 0.0289063 0.0289392 0.0270171 0.0242153 0.0213677 0.0180588 0.011226 0.00235124 -0.00898833 -0.0226513 -0.037931 -0.0531742 -0.0674218 -0.0845256 -0.0974204 -0.105029 -0.111452 -0.110662 -0.10509 -0.105306 -0.113319 -0.105472 -0.104248 -0.101083 -0.0900697 -0.0687804 -0.0423764 -0.0168294 0.00139234 0.0193684 0.0282328 0.0367497 0.0396585 0.0430092 0.0475624 0.0482092 0.0453912 0.0403032 0.0399344 0.0408551 0.0404272 0.0393329 0.0381507 0.0354778 0.0305021 0.0254702 0.0230278 0.023018 0.0239313 0.0248612 0.0249991 0.024633 0.0236853 0.0222909 0.0209702 0.0199298 0.0193849 0.0193103 0.0193816 0.0191059 0.0183105 0.0173933 0.0166771 0.0165372 0.017487 0.020218 0.024021 0.0275389 0.0282561 0.0262654 0.0235434 0.0216926 0.0218312 0.0233418 0.0256897 0.0288835 0.0309393 0.0305905 0.0281911 0.0255885 0.0225627 0.0159239 0.00784094 -0.00275094 -0.0162621 -0.0311587 -0.0488548 -0.0686546 -0.0848901 -0.099849 -0.11257 -0.115472 -0.112114 -0.107847 -0.112943 -0.115994 -0.108124 -0.103439 -0.100194 -0.0879728 -0.0571613 -0.0248669 0.0075846 0.0305861 0.0498869 0.0656881 0.0789992 0.0837965 0.0841411 0.0771164 0.071628 0.0712473 0.0691623 0.0653202 0.0616433 0.0590059 0.0562486 0.0533856 0.0510266 0.0490819 0.0463094 0.0436556 0.0409811 0.038287 0.0355277 0.0325824 0.0293908 0.025932 0.0223166 0.0186232 0.0146388 0.00997629 0.00462348 -0.00152709 -0.00851069 -0.0166503 -0.0254588 -0.0353978 -0.0456567 -0.0565483 -0.0693329 -0.0839018 -0.100653 -0.119708 -0.138795 -0.160268 -0.185583 -0.212467 -0.242285 -0.274083 -0.30897 -0.345732 -0.383933 -0.425756 -0.464878 -0.506329 -0.546524 -0.578636 -0.624836 -0.649131 -0.66322 -0.670698 -0.636438 -0.638279 -0.531674 -0.433073 -0.374585 -0.253541 -0.0857777 0.142558 0.384061 0.718213 1.0405 1.34926 1.68711 1.90113 0.504484 0.47465 0.424351 0.369611 0.314372 0.260247 0.209042 0.162997 0.124513 0.0931767 0.0666911 0.0433641 0.0221698 0.00267306 -0.0150727 -0.0309422 -0.0448082 -0.0566307 -0.0665405 -0.0748643 -0.0840215 -0.0959999 -0.110122 -0.120998 -0.129338 -0.138522 -0.147788 -0.157731 -0.165765 -0.173552 -0.182168 -0.18818 -0.193356 -0.200269 -0.205774 -0.213353 -0.215772 -0.221094 -0.217834 -0.216384 -0.217812 -0.208847 -0.207582 -0.20532 -0.193462 -0.184388 -0.167034 -0.148346 -0.133908 -0.119769 -0.0986471 -0.074498 -0.0663403 -0.0676774 -0.0500635 -0.0334585 -0.0108613 0.00865992 0.0262908 0.0390991 0.0495885 0.0563599 0.0609652 0.0616446 0.0623106 0.0622904 0.0595578 0.058014 0.0548078 0.050632 0.0473218 0.0438317 0.0401805 0.0370446 0.0347669 0.0329174 0.0306779 0.0284779 0.0265266 0.024916 0.0236306 0.0226036 0.0218805 0.0211895 0.0205262 0.0197832 0.0191444 0.0185685 0.0181325 0.0178076 0.0176277 0.0176029 0.0177225 0.0179972 0.0184338 0.0190313 0.0199294 0.0209526 0.0221282 0.0232114 0.0241614 0.0248793 0.0253576 0.0258678 0.0260531 0.0255327 0.0247877 0.0236056 0.0216566 0.0190841 0.0157502 0.0115282 0.00631263 4.14774e-07 -0.00748832 -0.0164687 -0.0267892 -0.0388713 -0.0542006 -0.0697713 -0.0876732 -0.102388 -0.111306 -0.11933 -0.120122 -0.11232 -0.104783 -0.110418 -0.117357 -0.117208 -0.109988 -0.0965068 -0.0713829 -0.0432448 -0.01597 0.00831783 0.0234446 0.0356948 0.0418169 0.0447106 0.0454011 0.0469348 0.0487375 0.0493933 0.0490004 0.0477812 0.0452344 0.0419742 0.0383793 0.0350117 0.0321764 0.0293537 0.0266192 0.0240657 0.0217241 0.0194657 0.0173464 0.0157039 0.0145621 0.0138418 0.0137965 0.0145286 0.0152411 0.0160409 0.0170632 0.018016 0.0180668 0.0175311 0.0169411 0.0169612 0.0181565 0.0198172 0.0222952 0.024845 0.026512 0.0275511 0.027674 0.0268431 0.025326 0.024226 0.0244843 0.0253813 0.0252945 0.0235375 0.0209713 0.0182114 0.0148758 0.00859792 0.000376504 -0.0100064 -0.0225857 -0.0365968 -0.0504229 -0.0640064 -0.0795304 -0.0917281 -0.0994756 -0.105495 -0.104791 -0.100698 -0.101221 -0.107059 -0.104956 -0.103589 -0.0993903 -0.0868824 -0.0657678 -0.0408023 -0.0170502 0.000509451 0.0167978 0.0255414 0.0330682 0.0361312 0.0391585 0.0428833 0.0434104 0.040989 0.0368879 0.0363555 0.0369637 0.0365846 0.0356173 0.0344371 0.0319511 0.0276335 0.0232983 0.0210949 0.020955 0.0216886 0.0224545 0.0225852 0.0222591 0.0214175 0.0202099 0.0190139 0.0180928 0.0175919 0.0174899 0.0175095 0.0172387 0.0165388 0.0157356 0.0151029 0.0150142 0.0158891 0.0183215 0.0216278 0.0246026 0.0251888 0.0234721 0.021064 0.019375 0.019504 0.0207986 0.0229343 0.0257097 0.0274535 0.0271596 0.0249842 0.0224388 0.0193521 0.0133023 0.00577862 -0.00397272 -0.0163179 -0.0301021 -0.0462947 -0.0644531 -0.0798591 -0.0940117 -0.10572 -0.108322 -0.105871 -0.102154 -0.107303 -0.111261 -0.106481 -0.102003 -0.0965171 -0.0834412 -0.0550688 -0.0246111 0.00516502 0.0270526 0.045198 0.0598044 0.0714839 0.0760621 0.0761787 0.070318 0.0656027 0.0647529 0.0627359 0.0593708 0.0561348 0.0536375 0.0511062 0.0485293 0.0463789 0.0445262 0.0420439 0.039627 0.0371899 0.0347336 0.03222 0.02954 0.0266434 0.0235185 0.0202461 0.0168878 0.0132579 0.00901771 0.00415425 -0.00143034 -0.00777398 -0.0151568 -0.0231469 -0.0321465 -0.0414972 -0.0514757 -0.0631308 -0.0764048 -0.0916173 -0.10886 -0.126353 -0.145953 -0.168928 -0.193408 -0.220504 -0.249514 -0.2812 -0.314626 -0.349487 -0.387306 -0.423003 -0.460633 -0.497224 -0.526926 -0.567242 -0.588494 -0.602774 -0.607066 -0.578206 -0.573298 -0.48282 -0.394246 -0.335521 -0.225661 -0.0728011 0.13107 0.353246 0.648758 0.937572 1.21808 1.51198 1.69654 0.448411 0.422582 0.378901 0.330441 0.281262 0.233058 0.187475 0.146478 0.112041 0.0838317 0.0599601 0.0389682 0.0199387 0.00246944 -0.0134222 -0.0276355 -0.0400677 -0.0507023 -0.0596757 -0.0673367 -0.0757362 -0.0864393 -0.0988422 -0.108658 -0.116347 -0.124693 -0.133098 -0.141986 -0.149289 -0.156355 -0.164181 -0.170075 -0.17543 -0.181363 -0.186895 -0.192235 -0.195044 -0.20007 -0.197699 -0.196202 -0.1971 -0.189948 -0.188015 -0.185517 -0.174665 -0.165922 -0.150353 -0.133334 -0.120137 -0.107057 -0.0892168 -0.0678494 -0.0602785 -0.0597654 -0.0449008 -0.0302743 -0.0103792 0.00686828 0.0230695 0.0350219 0.0449058 0.0506854 0.0548102 0.0555531 0.0561355 0.0558769 0.0536335 0.0520757 0.0491925 0.0455409 0.0425161 0.0393444 0.0361004 0.0333077 0.0312187 0.0294899 0.0274907 0.025537 0.0237912 0.0223464 0.0211898 0.020262 0.0196003 0.0189713 0.0183786 0.0177183 0.0171507 0.0166249 0.0162331 0.01593 0.0157613 0.0157235 0.0158184 0.0160432 0.0164148 0.0169275 0.0176955 0.0185623 0.0195655 0.0204636 0.0212629 0.021829 0.0222042 0.0225369 0.0225765 0.022034 0.0212214 0.020018 0.0181464 0.0156783 0.0125542 0.00860281 0.00377833 -0.00198163 -0.00883842 -0.0169193 -0.0262693 -0.0372682 -0.0507756 -0.0647801 -0.0805786 -0.0935941 -0.101945 -0.108947 -0.109536 -0.103057 -0.0971542 -0.101242 -0.106891 -0.106525 -0.0998072 -0.0871658 -0.0647828 -0.0394444 -0.0148953 0.00666385 0.0206261 0.0314626 0.037144 0.0398849 0.0407208 0.0421078 0.0436132 0.0441912 0.0438346 0.0426936 0.0404617 0.0375714 0.0344057 0.0314116 0.0288411 0.0263078 0.0238645 0.021575 0.0194742 0.0174499 0.0155708 0.0141106 0.013085 0.0124465 0.0124191 0.0130408 0.0136404 0.0143715 0.0152522 0.0160482 0.0160894 0.0156489 0.0151569 0.0152006 0.0162349 0.0176636 0.0198368 0.0219873 0.023416 0.0242388 0.0242958 0.0234957 0.022156 0.0211776 0.021306 0.0218905 0.0216598 0.0200112 0.0176136 0.0149553 0.0116747 0.00597585 -0.00159968 -0.0110685 -0.0225538 -0.0351489 -0.0476707 -0.060171 -0.0738226 -0.0848649 -0.0921838 -0.0975116 -0.0969494 -0.0938526 -0.0944952 -0.0986553 -0.0972794 -0.0955501 -0.0910338 -0.0793127 -0.0601529 -0.0375585 -0.0161914 5.25437e-05 0.0145069 0.0227536 0.0293914 0.0324433 0.0351721 0.0382337 0.0386685 0.0366314 0.03332 0.0327119 0.0330894 0.0327468 0.0318913 0.0307537 0.0284824 0.0247611 0.0210425 0.0190836 0.0188571 0.0194413 0.0200635 0.0201828 0.0198926 0.0191527 0.0180958 0.0170386 0.0162303 0.0157757 0.0156616 0.0156356 0.0153725 0.0147587 0.014059 0.0135093 0.0134588 0.0142548 0.0163926 0.0192268 0.0217129 0.0221732 0.020659 0.0185643 0.0170695 0.0171212 0.0182748 0.0201772 0.0225186 0.0239294 0.0235905 0.0216313 0.0191286 0.016083 0.0106039 0.00361908 -0.005354 -0.0165183 -0.0290737 -0.043741 -0.0600659 -0.0741514 -0.0868799 -0.0972352 -0.0995035 -0.0976485 -0.0942951 -0.0990651 -0.102111 -0.0980076 -0.0936301 -0.0880328 -0.0756133 -0.0504576 -0.0226483 0.00397518 0.0240811 0.0407079 0.0539839 0.0641537 0.0682984 0.0682765 0.063439 0.0594031 0.0582732 0.0563539 0.0534127 0.0505687 0.0482548 0.0459552 0.0436525 0.0417073 0.0399747 0.0377654 0.0355865 0.0333881 0.0311712 0.0289057 0.0264935 0.0238928 0.0210978 0.0181673 0.0151467 0.0118783 0.00806637 0.00369528 -0.00132205 -0.00702476 -0.0136525 -0.0208293 -0.0289012 -0.0373377 -0.0463783 -0.0568981 -0.0688707 -0.0825525 -0.0980204 -0.113883 -0.131585 -0.152239 -0.174318 -0.198713 -0.224913 -0.253424 -0.283541 -0.315025 -0.348956 -0.381223 -0.415082 -0.448062 -0.475166 -0.510203 -0.530102 -0.541547 -0.54438 -0.519925 -0.51072 -0.433732 -0.354878 -0.297813 -0.199002 -0.0616574 0.119253 0.32058 0.580143 0.836327 1.08739 1.34117 1.49959 0.393407 0.371299 0.333766 0.291444 0.248257 0.205894 0.165843 0.129808 0.099406 0.0743747 0.0531667 0.0345388 0.0176838 0.00223926 -0.0118056 -0.0243707 -0.035374 -0.0448156 -0.0528318 -0.0597695 -0.067352 -0.0768085 -0.0876121 -0.0963618 -0.103348 -0.11084 -0.118381 -0.126263 -0.13282 -0.139445 -0.146614 -0.151776 -0.157819 -0.162028 -0.167235 -0.17147 -0.174443 -0.178422 -0.177503 -0.175776 -0.176526 -0.170936 -0.168642 -0.165964 -0.156135 -0.147717 -0.133727 -0.118575 -0.10651 -0.0944972 -0.0796817 -0.0605908 -0.0534685 -0.0519312 -0.0398256 -0.0274611 -0.0105103 0.00503807 0.0190106 0.0312006 0.0402943 0.0451115 0.0487394 0.0494862 0.0499537 0.0495497 0.0476803 0.0461703 0.0436036 0.0404279 0.037702 0.0348597 0.0320042 0.0295408 0.0276532 0.0260695 0.0243023 0.0225859 0.0210435 0.0197642 0.0187372 0.0179112 0.0173146 0.0167522 0.0162298 0.0156571 0.0151562 0.0146851 0.014335 0.0140533 0.0138956 0.0138403 0.0139104 0.0140834 0.014391 0.0148179 0.0154564 0.0161773 0.0170111 0.0177335 0.0183839 0.0187934 0.0190653 0.0192346 0.0191394 0.0185651 0.0176938 0.0164725 0.0146678 0.012304 0.00937601 0.00569621 0.0012715 -0.00395667 -0.0101491 -0.0173697 -0.0256777 -0.0355459 -0.0473335 -0.0595952 -0.0732935 -0.0844572 -0.0917885 -0.0974963 -0.0977902 -0.0923363 -0.0877376 -0.0907943 -0.0951883 -0.094693 -0.0885285 -0.0768998 -0.0573108 -0.0350546 -0.01351 0.00528643 0.0178982 0.027396 0.0325642 0.0350997 0.0360115 0.0372598 0.0384956 0.0390012 0.0386819 0.037632 0.0356977 0.0331662 0.0304102 0.0277812 0.0254896 0.0232466 0.0210929 0.0190696 0.017212 0.0154227 0.0137778 0.0124928 0.0115885 0.0110273 0.0110103 0.0115553 0.0120426 0.012691 0.0134463 0.0141023 0.0141193 0.0137589 0.0133424 0.0133982 0.0142763 0.0154969 0.0173808 0.0191359 0.0203357 0.0209653 0.0209085 0.0201461 0.0189329 0.0180461 0.0180342 0.0183803 0.0180042 0.0164457 0.014199 0.0116684 0.008468 0.00330911 -0.00364322 -0.0121552 -0.022345 -0.0335159 -0.0446325 -0.055772 -0.0676175 -0.0772805 -0.0837695 -0.0882744 -0.0877849 -0.0853626 -0.0859349 -0.0889941 -0.0879805 -0.0860623 -0.0813895 -0.0706029 -0.0535563 -0.0336353 -0.0148476 -0.000252349 0.012397 0.0199534 0.0257736 0.0286875 0.0311191 0.0336298 0.0339862 0.0322914 0.0296196 0.0290016 0.0292074 0.0289003 0.0281469 0.027085 0.0250512 0.0218711 0.0187093 0.0169931 0.0167165 0.0171763 0.017678 0.0177833 0.0175308 0.0168884 0.0159754 0.0150521 0.0143514 0.0139437 0.013823 0.0137658 0.0135146 0.0129761 0.0123687 0.011893 0.0118714 0.0125809 0.0144364 0.0168277 0.0188782 0.0191786 0.0178439 0.016004 0.0146904 0.0146993 0.0157074 0.0173472 0.0192874 0.020406 0.0200075 0.018225 0.0158031 0.0128329 0.00784936 0.00138998 -0.00674868 -0.016654 -0.0278869 -0.0409487 -0.0553197 -0.0678577 -0.0789374 -0.0877783 -0.089648 -0.0881978 -0.0851753 -0.0892354 -0.0915133 -0.0879769 -0.0837795 -0.078274 -0.0667349 -0.0447569 -0.0200565 0.00327108 0.0213171 0.0361897 0.0481559 0.0568326 0.0605206 0.0604596 0.0564844 0.0530458 0.0517815 0.0499907 0.0474356 0.0449526 0.0428539 0.040794 0.0387575 0.0370167 0.0354265 0.0334775 0.0315373 0.0295785 0.0276024 0.0255868 0.0234447 0.02114 0.0186715 0.0160816 0.0134026 0.0105009 0.00712156 0.00324529 -0.00120389 -0.00626458 -0.0121399 -0.0185071 -0.0256609 -0.0331775 -0.0412603 -0.0506388 -0.0613049 -0.073463 -0.0871833 -0.101391 -0.117168 -0.135523 -0.155199 -0.176912 -0.200283 -0.225642 -0.252469 -0.280566 -0.310693 -0.33955 -0.369667 -0.399042 -0.423369 -0.453651 -0.472438 -0.479475 -0.482508 -0.46172 -0.44997 -0.38459 -0.315111 -0.261259 -0.173431 -0.0516831 0.107004 0.286306 0.511894 0.736379 0.957561 1.17471 1.30931 0.339316 0.320695 0.288928 0.252607 0.215345 0.178752 0.144156 0.11301 0.0866325 0.0648198 0.0463168 0.0300782 0.0154071 0.00198517 -0.0102189 -0.0211425 -0.0307207 -0.0389641 -0.0460043 -0.0521679 -0.0588864 -0.0671208 -0.0764214 -0.0841034 -0.0903432 -0.0969713 -0.103643 -0.110557 -0.116346 -0.122743 -0.129334 -0.133567 -0.139391 -0.142779 -0.147776 -0.152427 -0.154283 -0.157265 -0.157418 -0.155645 -0.15649 -0.151854 -0.14939 -0.146499 -0.13769 -0.129703 -0.117181 -0.103775 -0.0929242 -0.0820122 -0.069131 -0.0529704 -0.0464815 -0.0441728 -0.034208 -0.0239556 -0.0100204 0.00349887 0.0155316 0.0274668 0.0356528 0.0396466 0.0427883 0.0434786 0.0438102 0.0433119 0.0417316 0.0403067 0.0380435 0.035302 0.0328822 0.0303739 0.0278912 0.0257467 0.0240706 0.022651 0.0211108 0.0196239 0.0182832 0.0171693 0.0162726 0.0155507 0.0150231 0.0145304 0.0140765 0.013582 0.0131513 0.0127389 0.0124307 0.0121717 0.0120217 0.0119502 0.0119871 0.0121085 0.0123478 0.0126871 0.0131988 0.0137755 0.0144429 0.0149979 0.0154985 0.0157594 0.015918 0.015935 0.0157162 0.015096 0.0141762 0.0129373 0.0111894 0.00894497 0.00621725 0.00282844 -0.0011824 -0.00587172 -0.0114251 -0.0177447 -0.0250403 -0.0337017 -0.0437207 -0.0542093 -0.0657019 -0.0749253 -0.0810858 -0.0854865 -0.0854228 -0.0807702 -0.077175 -0.0794423 -0.0827955 -0.0821806 -0.0766735 -0.0663673 -0.0495903 -0.0304867 -0.0119688 0.00416316 0.0152658 0.0234723 0.0280679 0.0303464 0.0312587 0.0323569 0.0333754 0.0337996 0.0335152 0.0325929 0.0309303 0.0287586 0.0263998 0.0241279 0.0221289 0.0201774 0.0183122 0.0165544 0.0149407 0.0133879 0.0119712 0.0108617 0.0100789 0.00959835 0.00959123 0.010049 0.0104725 0.0110227 0.011652 0.0121702 0.0121675 0.0118612 0.0115135 0.0115615 0.0122965 0.0133284 0.0149085 0.0162993 0.0172315 0.0176943 0.0175464 0.0167798 0.0157168 0.0148862 0.0147782 0.014882 0.0143904 0.0129084 0.0107777 0.00834698 0.00527778 0.000568332 -0.00566661 -0.0132518 -0.0221575 -0.0318486 -0.0414334 -0.0510244 -0.0609726 -0.0691172 -0.0745763 -0.078148 -0.0776199 -0.0756576 -0.0760452 -0.0783058 -0.07751 -0.0755271 -0.0710015 -0.0613698 -0.0465885 -0.0294384 -0.0132473 -0.000441573 0.0104468 0.0171798 0.0222074 0.0248861 0.0270027 0.0290567 0.0293455 0.0279535 0.025813 0.0252267 0.0253149 0.0250453 0.0243929 0.023434 0.0216547 0.0189738 0.0163193 0.0148427 0.0145483 0.0149056 0.0153047 0.0153952 0.0151783 0.0146318 0.0138611 0.0130701 0.0124625 0.0121024 0.0119785 0.0118991 0.0116613 0.0111904 0.0106683 0.0102604 0.0102551 0.0108616 0.0124344 0.0144161 0.0160507 0.0162099 0.0150141 0.0134156 0.0122749 0.012291 0.0131334 0.0145089 0.0160685 0.0169138 0.0164313 0.0147386 0.0124404 0.00956707 0.00501939 -0.000818243 -0.00810863 -0.0168248 -0.0266883 -0.0380331 -0.0502842 -0.0610902 -0.0703793 -0.0776037 -0.0790029 -0.0778079 -0.0752486 -0.0784985 -0.0800789 -0.077042 -0.0731483 -0.0679409 -0.0575429 -0.0386278 -0.01718 0.00288906 0.0187282 0.0317312 0.042212 0.0496062 0.0528416 0.0527584 0.0495071 0.0465979 0.0453016 0.0436612 0.0414583 0.0393099 0.0374434 0.0356266 0.033848 0.0323103 0.0308774 0.0291785 0.0274764 0.0257573 0.0240231 0.0222589 0.0203887 0.0183809 0.0162366 0.0139871 0.0116549 0.00912216 0.00618032 0.00280209 -0.00107747 -0.00549486 -0.0106197 -0.0161801 -0.022423 -0.0290141 -0.0361227 -0.0443541 -0.0537099 -0.0643512 -0.0763468 -0.088879 -0.10271 -0.118782 -0.136056 -0.155099 -0.175633 -0.19786 -0.221415 -0.246119 -0.272484 -0.297923 -0.324325 -0.350112 -0.371553 -0.397493 -0.414019 -0.419199 -0.421432 -0.403617 -0.390685 -0.335439 -0.275055 -0.225653 -0.148813 -0.0427426 0.0942902 0.25083 0.444015 0.637474 0.82861 1.01187 1.12462 0.285997 0.27067 0.244363 0.213916 0.182514 0.15163 0.122421 0.0961038 0.0737424 0.0551806 0.0394171 0.0255895 0.0131111 0.0017103 -0.00865801 -0.0179454 -0.026101 -0.0331407 -0.0391881 -0.0445344 -0.0503513 -0.0573836 -0.0652564 -0.0718698 -0.0773255 -0.083078 -0.08888 -0.0948528 -0.0998243 -0.105877 -0.111663 -0.115103 -0.119871 -0.123277 -0.128103 -0.133577 -0.133812 -0.135566 -0.137269 -0.135376 -0.136183 -0.132823 -0.130529 -0.127228 -0.119409 -0.111884 -0.100809 -0.0890622 -0.0793938 -0.0696421 -0.0585491 -0.0452612 -0.0395665 -0.0366924 -0.0281282 -0.0192558 -0.00794352 0.00269411 0.013107 0.0231477 0.0304872 0.0342167 0.0368848 0.0374612 0.0376508 0.0370956 0.035754 0.034448 0.032486 0.0301537 0.0280506 0.0258819 0.0237628 0.0219299 0.0204746 0.0192335 0.0179159 0.0166528 0.0155119 0.0145636 0.0137977 0.0131809 0.0127258 0.0123053 0.0119243 0.0115143 0.0111476 0.0107876 0.0105158 0.0102735 0.0101271 0.0100335 0.0100382 0.0101074 0.0102757 0.0105238 0.0109083 0.0113395 0.0118429 0.0122321 0.0125848 0.0127038 0.0127421 0.0126187 0.0122832 0.0116118 0.0106539 0.00940813 0.00772675 0.00561078 0.0030882 -1.85731e-06 -0.00361598 -0.0077551 -0.0126362 -0.0181122 -0.0243664 -0.0317761 -0.0400726 -0.0487432 -0.0580468 -0.0652945 -0.0700672 -0.0731891 -0.072727 -0.0688126 -0.0659477 -0.0675962 -0.0701027 -0.0694398 -0.0647036 -0.0558982 -0.0418327 -0.0258419 -0.0102957 0.00322527 0.0127262 0.0196481 0.0236244 0.0256228 0.0264786 0.0274195 0.0282567 0.02861 0.028363 0.0275754 0.0261843 0.0243577 0.0223808 0.0204636 0.0187565 0.0171025 0.0155214 0.0140307 0.0126611 0.0113447 0.0101519 0.0092154 0.00855197 0.00814978 0.00815185 0.00849661 0.00885413 0.00931718 0.00982697 0.0102315 0.0102075 0.00994944 0.00964856 0.00968344 0.0102694 0.0110889 0.0123542 0.0134144 0.0140974 0.0143599 0.0141208 0.0133862 0.0124178 0.0116383 0.0114324 0.0113549 0.0107472 0.00932298 0.00732674 0.00502957 0.00212872 -0.00210844 -0.00764824 -0.0142657 -0.0219037 -0.0301027 -0.0381251 -0.0460712 -0.0541101 -0.060617 -0.064877 -0.067455 -0.0667873 -0.0651085 -0.06532 -0.0669332 -0.066282 -0.064383 -0.0602651 -0.0519564 -0.039481 -0.0250787 -0.0114643 -0.00053848 0.00862344 0.0144415 0.0186918 0.0210627 0.0228676 0.0245275 0.0247599 0.0236378 0.0219464 0.0214147 0.0214327 0.0211992 0.0206446 0.0198092 0.0182911 0.0160748 0.013886 0.0126451 0.0123574 0.0126305 0.0129418 0.0130172 0.0128338 0.0123782 0.0117369 0.0110619 0.0105545 0.0102428 0.0101204 0.0100264 0.00980399 0.00939562 0.00895232 0.00860324 0.00860223 0.00910144 0.0103902 0.0119692 0.0132214 0.01325 0.0121637 0.0107846 0.00981256 0.0098111 0.0105192 0.0116346 0.0128615 0.0134332 0.0128512 0.0112561 0.00907463 0.0063385 0.00223543 -0.00297632 -0.00939279 -0.0169401 -0.0254048 -0.0350323 -0.0451742 -0.0540647 -0.0614694 -0.0670556 -0.0678623 -0.0667587 -0.0649441 -0.0671414 -0.0681376 -0.0655679 -0.0620928 -0.0573579 -0.0482607 -0.0322868 -0.0141097 0.0027539 0.0163006 0.0273931 0.0363045 0.0424765 0.0452145 0.0451064 0.0424652 0.0400333 0.038783 0.0373147 0.035443 0.0336172 0.0320013 0.0304371 0.028915 0.0275843 0.0263233 0.0248702 0.0234081 0.0219315 0.0204416 0.0189315 0.0173356 0.015625 0.0138025 0.0118915 0.00990747 0.00775403 0.00524894 0.00236901 -0.00094121 -0.00471536 -0.00909288 -0.0138493 -0.0191886 -0.0248507 -0.0309734 -0.0380545 -0.0460987 -0.0552275 -0.0655128 -0.0763509 -0.0882178 -0.102021 -0.116892 -0.133275 -0.150966 -0.170062 -0.190347 -0.211645 -0.234334 -0.256425 -0.279151 -0.301503 -0.320043 -0.341894 -0.354729 -0.35979 -0.361054 -0.345644 -0.332575 -0.286348 -0.234795 -0.190825 -0.125012 -0.0346837 0.0811148 0.214411 0.376411 0.539409 0.700574 0.852102 0.94461 0.233312 0.221129 0.200038 0.175351 0.149754 0.124524 0.100647 0.0791099 0.060756 0.045471 0.0324744 0.021076 0.0107977 0.00141657 -0.0071202 -0.0147759 -0.0215109 -0.0273435 -0.0323861 -0.0368811 -0.0417685 -0.0476171 -0.0541242 -0.0596729 -0.0643184 -0.0692003 -0.0741566 -0.0791526 -0.0833048 -0.0886621 -0.0939283 -0.0967958 -0.100805 -0.104142 -0.10856 -0.112361 -0.113072 -0.114189 -0.116415 -0.115234 -0.115861 -0.113549 -0.111536 -0.108461 -0.10132 -0.0941792 -0.084507 -0.0743438 -0.0658551 -0.0573302 -0.0479086 -0.0373767 -0.0326137 -0.0297527 -0.0225624 -0.0147454 -0.00525103 0.00327771 0.0120555 0.0187137 0.0248688 0.0287138 0.030941 0.0314529 0.0315403 0.0309492 0.029805 0.0286336 0.0269605 0.0250103 0.0232243 0.0213923 0.0196247 0.0180955 0.016866 0.0158126 0.0147161 0.0136723 0.0127303 0.0119474 0.0113135 0.0108033 0.0104239 0.0100773 0.00976624 0.00942781 0.00912681 0.00882144 0.00858357 0.00836087 0.00822208 0.00811527 0.00808987 0.00810681 0.00820215 0.00835844 0.00861608 0.00890462 0.00924292 0.00947094 0.00966842 0.00964228 0.00955089 0.00928896 0.00883736 0.00810464 0.00710688 0.00585589 0.00423909 0.00225236 -7.11458e-05 -0.0028638 -0.00607758 -0.00966261 -0.0138292 -0.0184028 -0.023585 -0.0296882 -0.0362869 -0.0431677 -0.0503127 -0.0556179 -0.0589427 -0.0607743 -0.059891 -0.0565418 -0.0542814 -0.0554676 -0.0573009 -0.0566566 -0.0527482 -0.0455215 -0.034082 -0.0211551 -0.00852816 0.00244566 0.0102866 0.0159435 0.0192546 0.0209357 0.0217015 0.0224833 0.0231379 0.0234254 0.0232245 0.0225659 0.0214363 0.0199497 0.0183432 0.0167713 0.0153708 0.0140109 0.0127185 0.0114941 0.0103723 0.00929174 0.00832084 0.00755274 0.00701278 0.00667998 0.00667665 0.00691643 0.00721656 0.00760277 0.00800237 0.00830953 0.00826679 0.00804138 0.00778045 0.00779116 0.00822968 0.00884312 0.00980576 0.0105652 0.010995 0.011076 0.0107325 0.0100023 0.0090702 0.00832796 0.00800766 0.00774807 0.00704113 0.00566065 0.00378432 0.00162012 -0.00107768 -0.0048581 -0.00967446 -0.0153112 -0.0216627 -0.0283105 -0.0347268 -0.0409425 -0.0470524 -0.0518749 -0.0548575 -0.0564122 -0.0554991 -0.0539659 -0.0539977 -0.0551152 -0.054587 -0.0528964 -0.0493569 -0.0424724 -0.0323031 -0.0206077 -0.00953927 -0.000554992 0.00691483 0.0117473 0.015231 0.0172379 0.0187314 0.0200358 0.0202195 0.019336 0.0180307 0.0175727 0.0175527 0.0173553 0.0168979 0.0161986 0.0149476 0.0131671 0.0114131 0.0104032 0.010143 0.0103463 0.0105833 0.0106445 0.0104943 0.0101268 0.00961049 0.00903864 0.00863465 0.00837346 0.0082578 0.00815662 0.00795274 0.0076023 0.00722884 0.00693132 0.00692666 0.00732032 0.00833778 0.00954284 0.0104387 0.010327 0.00932801 0.0081197 0.00729529 0.00729556 0.00785539 0.00871324 0.00958882 0.0098927 0.00922565 0.00769555 0.00563663 0.00307245 -0.000582144 -0.00513596 -0.0106451 -0.0170005 -0.0240109 -0.0319008 -0.0399601 -0.0468509 -0.0523601 -0.056273 -0.0564053 -0.0552981 -0.0543233 -0.0554609 -0.0559824 -0.053843 -0.0508333 -0.0467023 -0.0390298 -0.0258387 -0.0109381 0.00276604 0.0139766 0.0231401 0.0304581 0.0354458 0.0376724 0.0375429 0.0354273 0.0334323 0.0322832 0.0310041 0.029447 0.0279309 0.0265705 0.0252597 0.0239877 0.0228621 0.0217785 0.0205632 0.0193373 0.0180991 0.0168498 0.015591 0.0142675 0.0128522 0.0113493 0.00977826 0.00814971 0.00635985 0.00430301 0.00192787 -0.000808873 -0.00393669 -0.007567 -0.0115193 -0.0159575 -0.0206841 -0.0258073 -0.0317279 -0.0384502 -0.0460638 -0.0546507 -0.0638012 -0.0736869 -0.0852344 -0.0977018 -0.111433 -0.126278 -0.142262 -0.159326 -0.177271 -0.196496 -0.215194 -0.234236 -0.252869 -0.268439 -0.286194 -0.296032 -0.300053 -0.300717 -0.287918 -0.275405 -0.237342 -0.194395 -0.156623 -0.101898 -0.0273559 0.0675124 0.177267 0.309028 0.442022 0.57341 0.694927 0.76845 0.181133 0.171981 0.155917 0.136895 0.11705 0.0974325 0.0788397 0.0620433 0.0476902 0.0357019 0.025495 0.0165415 0.00847137 0.00111214 -0.00559475 -0.0116207 -0.0169356 -0.0215567 -0.025573 -0.0291869 -0.033122 -0.037801 -0.0429896 -0.0474801 -0.0513003 -0.0553176 -0.0594084 -0.0635735 -0.0668477 -0.0713019 -0.075986 -0.0780532 -0.0813694 -0.0843615 -0.0880584 -0.0894425 -0.092169 -0.0934668 -0.0943698 -0.0948623 -0.0954319 -0.0926068 -0.0908407 -0.0891018 -0.0828146 -0.0765938 -0.0683461 -0.0597117 -0.0524268 -0.0451587 -0.0374397 -0.0295487 -0.0257392 -0.0232164 -0.0175251 -0.0109518 -0.00306482 0.00401031 0.01093 0.0155931 0.0196805 0.0230638 0.0248312 0.0253131 0.0253449 0.0247718 0.0238036 0.0227854 0.0214016 0.0198237 0.0183651 0.0168759 0.0154594 0.0142349 0.0132416 0.0123879 0.0115126 0.0106852 0.00994143 0.00932401 0.00882253 0.00841963 0.00811825 0.00784657 0.00760876 0.007348 0.00711097 0.00686148 0.0066592 0.00646185 0.0063298 0.00621635 0.00616815 0.00614296 0.00617365 0.00624443 0.00638259 0.00653527 0.00671339 0.0067867 0.00682401 0.00665861 0.00643016 0.00603779 0.00546971 0.00466467 0.00362314 0.0023583 0.000791368 -0.00107878 -0.00322038 -0.00573026 -0.00855298 -0.0116175 -0.0151152 -0.0188369 -0.0229518 -0.0277134 -0.0326079 -0.0376282 -0.0426261 -0.0459926 -0.0478111 -0.0483765 -0.047043 -0.0441252 -0.0423645 -0.0431664 -0.0444636 -0.0438995 -0.040853 -0.0352452 -0.026421 -0.0164412 -0.00669143 0.00179526 0.00792252 0.0123249 0.0149361 0.0162673 0.016904 0.0175141 0.0180101 0.0182315 0.0180682 0.017554 0.0166746 0.015524 0.0142829 0.0130605 0.0119711 0.0109082 0.0099036 0.0089494 0.00807517 0.00723325 0.00648091 0.00588365 0.00546406 0.0052055 0.00520306 0.00535131 0.0055897 0.00589483 0.00619472 0.0064073 0.00634699 0.0061488 0.00592581 0.00590971 0.0062179 0.00664322 0.00731925 0.00778859 0.00797325 0.00786301 0.00742444 0.00668756 0.00580202 0.00508869 0.0046614 0.00422229 0.00340722 0.00204235 0.000254717 -0.00179031 -0.00429611 -0.00764382 -0.011774 -0.0164443 -0.0215439 -0.0266295 -0.0314028 -0.0358369 -0.040004 -0.0430724 -0.0446739 -0.0451745 -0.0439268 -0.0424309 -0.0422747 -0.0430169 -0.0426044 -0.0412103 -0.0383637 -0.0329648 -0.025092 -0.0160622 -0.00750498 -0.000500136 0.00529863 0.00909284 0.0118137 0.0134123 0.0145811 0.0155634 0.0157014 0.0150367 0.0140652 0.0137004 0.0136609 0.0135034 0.0131451 0.0125918 0.0116131 0.0102499 0.00890621 0.00812448 0.00790646 0.00805338 0.0082263 0.00827451 0.00815659 0.00787498 0.00748026 0.00700249 0.00670867 0.00650238 0.00639941 0.00629858 0.00611557 0.00582083 0.00551242 0.00526413 0.00525246 0.00554013 0.00630285 0.00716516 0.00773272 0.00747768 0.00654585 0.00548267 0.00478758 0.00478538 0.00520494 0.00580911 0.00632684 0.0063642 0.0055939 0.00411074 0.00215652 -0.000232542 -0.00346249 -0.00737307 -0.0119842 -0.0171597 -0.0226908 -0.0288326 -0.0347995 -0.0396329 -0.0432091 -0.045421 -0.0448297 -0.0435667 -0.0432854 -0.0434616 -0.0436614 -0.0419775 -0.0394963 -0.0360863 -0.0299477 -0.0195245 -0.00781037 0.00286699 0.0117079 0.0189271 0.0246417 0.0284653 0.0301518 0.029983 0.0283098 0.0267021 0.0256952 0.0246203 0.0233574 0.0221395 0.0210497 0.020005 0.0189866 0.0180747 0.0171943 0.0162179 0.0152332 0.0142407 0.0132412 0.0122462 0.0112066 0.0100959 0.00891624 0.00768223 0.00640232 0.00503545 0.00341087 0.00153198 -0.000638808 -0.00312623 -0.00601746 -0.00917306 -0.0127202 -0.0165147 -0.0206389 -0.0254052 -0.0308187 -0.0369537 -0.0438803 -0.0513577 -0.0591682 -0.0684717 -0.0785395 -0.0896273 -0.101626 -0.114554 -0.128345 -0.142865 -0.158365 -0.173169 -0.188396 -0.202786 -0.215241 -0.229007 -0.23676 -0.240564 -0.239544 -0.229807 -0.218738 -0.188425 -0.1539 -0.122913 -0.0793434 -0.0206244 0.0535269 0.139561 0.241808 0.345162 0.447018 0.539856 0.595348 0.129333 0.123138 0.111964 0.0985337 0.0844037 0.0703655 0.0570214 0.0449365 0.0345783 0.0258997 0.0184954 0.0119926 0.00612896 0.000779085 -0.00410768 -0.00851349 -0.0124157 -0.0158238 -0.0187926 -0.0214981 -0.0244501 -0.0279418 -0.0318046 -0.0351907 -0.0381121 -0.0411891 -0.0442967 -0.0477044 -0.0503403 -0.0538061 -0.0571278 -0.0586919 -0.0612524 -0.063708 -0.0665246 -0.0673066 -0.070461 -0.0717828 -0.0722633 -0.0732936 -0.0739976 -0.0712428 -0.0696559 -0.0685508 -0.0636877 -0.0589751 -0.0521242 -0.0449654 -0.0389172 -0.0329526 -0.0269498 -0.0212364 -0.0184627 -0.0163798 -0.0121388 -0.00720086 -0.0014394 0.00366756 0.00840977 0.0125348 0.0150101 0.0174909 0.0187146 0.0190511 0.0190354 0.0185669 0.0177661 0.01692 0.0158313 0.0146206 0.013499 0.0123671 0.0112992 0.0103749 0.00961799 0.00896533 0.00830624 0.00769022 0.00714301 0.00669089 0.00632289 0.00602924 0.0058084 0.00561234 0.00544546 0.00527827 0.00510908 0.00491975 0.00475813 0.00458833 0.004464 0.00434167 0.00426469 0.00419689 0.00416211 0.00414896 0.00417137 0.00419255 0.00421786 0.00414382 0.00403292 0.00373577 0.00338003 0.00286778 0.00219723 0.00132688 0.000255996 -0.00100705 -0.00251561 -0.00426862 -0.00623028 -0.00847433 -0.0109361 -0.0135347 -0.0164074 -0.0193254 -0.0224264 -0.0258897 -0.0291831 -0.032326 -0.0351625 -0.0365286 -0.0367593 -0.0360495 -0.0342359 -0.0316477 -0.0303093 -0.0308132 -0.0316741 -0.0312404 -0.0290637 -0.0250726 -0.0188289 -0.0117375 -0.00484077 0.00121886 0.00560803 0.00874925 0.0106378 0.0116015 0.0120755 0.0125173 0.012867 0.0130282 0.0129049 0.012538 0.0119126 0.0110918 0.0102105 0.00934119 0.00856016 0.00779904 0.00707987 0.0063988 0.00577217 0.00517079 0.00463439 0.00420841 0.00390925 0.00372555 0.00372847 0.00381771 0.00399211 0.00420647 0.0044071 0.00452876 0.00444331 0.00426951 0.00407517 0.00403471 0.00421818 0.00446273 0.00485982 0.00504684 0.00499533 0.00470642 0.0041505 0.00341846 0.00259178 0.00190581 0.00140214 0.00083881 -6.19723e-05 -0.00140505 -0.00310199 -0.00502414 -0.00733514 -0.0102754 -0.013756 -0.0175003 -0.0214142 -0.0249779 -0.0281609 -0.0308204 -0.0330783 -0.0343751 -0.0345197 -0.0338958 -0.0322058 -0.0306443 -0.0303078 -0.0307624 -0.0304624 -0.0294246 -0.0273506 -0.0234804 -0.0178838 -0.0114762 -0.00540256 -0.000393683 0.00374108 0.00646584 0.00842151 0.00957592 0.0104142 0.0111028 0.0111948 0.0107369 0.0100582 0.00979921 0.00975365 0.00964068 0.00938448 0.00898586 0.00828412 0.00732471 0.00637438 0.00581911 0.00565372 0.00575338 0.00587097 0.00590713 0.00582247 0.00562554 0.00535415 0.00499332 0.00479392 0.00464348 0.00455435 0.00445769 0.00429363 0.00405016 0.00380473 0.00360403 0.00358143 0.0037646 0.00427668 0.00481098 0.00507355 0.00467689 0.00379435 0.00288195 0.00229785 0.00228962 0.0025838 0.00296477 0.0031963 0.00299241 0.00212491 0.000681491 -0.00117316 -0.00339192 -0.00622415 -0.00952746 -0.013278 -0.017325 -0.021459 -0.0258929 -0.0298463 -0.0326157 -0.0342016 -0.0346865 -0.0332598 -0.0316962 -0.0314331 -0.0311326 -0.0311587 -0.0299544 -0.0281211 -0.0255666 -0.0210983 -0.0136915 -0.00504181 0.00290336 0.00934333 0.0145968 0.0187135 0.0214149 0.0225643 0.0223687 0.0211105 0.019868 0.0190523 0.0182097 0.0172523 0.0163192 0.015479 0.0146823 0.0139213 0.0132507 0.0126148 0.0118951 0.0111654 0.0104272 0.00968134 0.0089346 0.00815615 0.00732401 0.00644881 0.00554504 0.00462364 0.00355431 0.0023772 0.00100203 -0.000592734 -0.00242606 -0.0045617 -0.00689987 -0.00953534 -0.0123682 -0.0154612 -0.0190452 -0.0231279 -0.0277741 -0.0330021 -0.0386439 -0.0445325 -0.05156 -0.0591926 -0.0676066 -0.0767338 -0.0866268 -0.0970314 -0.107977 -0.119458 -0.130268 -0.141695 -0.152252 -0.161544 -0.17163 -0.177242 -0.180587 -0.17853 -0.171128 -0.162378 -0.139577 -0.113333 -0.0895678 -0.0572122 -0.0143227 0.0392655 0.101487 0.174767 0.248741 0.321298 0.386433 0.424556 0.0777799 0.0744822 0.0680829 0.06017 0.0517087 0.0432147 0.0350881 0.027695 0.0213345 0.0159886 0.0114191 0.00740468 0.00378772 0.000501243 -0.00252136 -0.00526194 -0.00770544 -0.00985427 -0.0117341 -0.0134696 -0.0153854 -0.0176727 -0.020231 -0.0225261 -0.0245628 -0.0267562 -0.029002 -0.0315124 -0.0340708 -0.0364433 -0.0386564 -0.0409526 -0.0433137 -0.0456959 -0.0482114 -0.0495362 -0.0522604 -0.0540968 -0.0551274 -0.0561024 -0.0569399 -0.0549427 -0.053297 -0.0515543 -0.0470912 -0.0427319 -0.0366892 -0.0307034 -0.025749 -0.0209869 -0.0166024 -0.013555 -0.0116667 -0.00997533 -0.00706265 -0.00393854 -0.000339747 0.00277351 0.00554413 0.0083379 0.0101425 0.0116979 0.0123507 0.0124644 0.0123702 0.0120168 0.0114179 0.0107933 0.0100382 0.00922141 0.00847015 0.00773067 0.0070306 0.00642333 0.00592299 0.00549023 0.0050629 0.00467065 0.00432952 0.00404822 0.00381678 0.00363309 0.00349424 0.00337522 0.00328821 0.00324426 0.00311683 0.00297941 0.0028529 0.00270884 0.00259036 0.00245793 0.00234953 0.00223421 0.00212887 0.00202473 0.00192693 0.00180947 0.00167766 0.00144734 0.00118366 0.000743732 0.000258693 -0.000380707 -0.0011551 -0.00208861 -0.00318102 -0.00442834 -0.0058662 -0.0074874 -0.00924223 -0.0112008 -0.0132684 -0.0153313 -0.0175471 -0.0196082 -0.0217053 -0.0239016 -0.0256299 -0.0269845 -0.0277275 -0.0271369 -0.025756 -0.0237821 -0.0214709 -0.0191261 -0.0181793 -0.0184524 -0.0189423 -0.0186721 -0.0173614 -0.0149652 -0.011244 -0.00703265 -0.00292916 0.000684893 0.0033325 0.00521628 0.00636107 0.00694451 0.00723837 0.00751334 0.00771719 0.00781945 0.00774385 0.0075236 0.00714936 0.0066572 0.00613106 0.00560983 0.00514038 0.00468341 0.00425061 0.00384191 0.00346606 0.00310513 0.00278367 0.00252954 0.00235117 0.0022459 0.00225815 0.00233843 0.0024461 0.00255941 0.00264109 0.00266664 0.00255253 0.00238982 0.00221639 0.00215212 0.00220985 0.00227353 0.00238368 0.00228004 0.00197783 0.00149644 0.000834488 9.70787e-05 -0.000692095 -0.00134652 -0.00191736 -0.00260752 -0.00357983 -0.00489583 -0.00648351 -0.00825111 -0.010329 -0.0128482 -0.0156558 -0.0184564 -0.0211564 -0.0231984 -0.0248529 -0.0257175 -0.0260832 -0.0256209 -0.0243166 -0.0225807 -0.0204137 -0.0187255 -0.0182169 -0.018449 -0.0182674 -0.0176326 -0.0163805 -0.014059 -0.010713 -0.00689321 -0.00326061 -0.000255309 0.00221855 0.00386125 0.00504349 0.00573602 0.00624367 0.00665538 0.00670364 0.0064393 0.00603371 0.00588177 0.00584671 0.00578022 0.00562726 0.00538732 0.00496502 0.00439521 0.0038286 0.0034968 0.0033934 0.00345127 0.00351989 0.00354306 0.00349344 0.00337843 0.00323118 0.00305679 0.00291097 0.00280603 0.00272584 0.00262862 0.00247806 0.00227839 0.00209262 0.00193913 0.001904 0.00198306 0.00225207 0.00246157 0.00241307 0.00185413 0.000996814 0.000235151 -0.00023215 -0.000235492 -6.36881e-05 0.000101015 6.60968e-05 -0.000369387 -0.00133295 -0.00274235 -0.00448959 -0.00649545 -0.00891583 -0.0115827 -0.0144549 -0.0173751 -0.0201693 -0.0229251 -0.0249237 -0.025626 -0.0252182 -0.0240097 -0.0216972 -0.0197634 -0.0194512 -0.0187049 -0.0186353 -0.0178969 -0.0167925 -0.0152077 -0.0124997 -0.00819687 -0.00277718 0.00242828 0.00640724 0.00965458 0.0121927 0.0138414 0.0145121 0.014349 0.013545 0.0127191 0.0121514 0.0115778 0.0109507 0.0102849 0.00966405 0.00908837 0.00857267 0.00813783 0.00773756 0.00728553 0.00682896 0.00637231 0.00591816 0.00545767 0.00498274 0.00448399 0.00396952 0.00343411 0.00287235 0.00234524 0.00165099 0.000822899 -0.000159512 -0.00130986 -0.00267039 -0.0041789 -0.00590025 -0.00777433 -0.00984387 -0.0122655 -0.0150413 -0.0182202 -0.0217921 -0.0255659 -0.0299895 -0.0349221 -0.0402938 -0.0462282 -0.0526822 -0.059706 -0.0670106 -0.0746776 -0.0826227 -0.0900283 -0.0979182 -0.10513 -0.111234 -0.117749 -0.120949 -0.122506 -0.120352 -0.114241 -0.107385 -0.0912435 -0.0728714 -0.0565273 -0.0354157 -0.00847094 0.0245652 0.0628496 0.107495 0.152248 0.195743 0.233922 0.255211 0.0263614 0.0260326 0.0244955 0.0222252 0.0195503 0.0166772 0.0137889 0.0110626 0.00864611 0.0065534 0.00470571 0.00302719 0.0014649 1.11013e-05 -0.00137627 -0.00267741 -0.00387926 -0.00497978 -0.00599493 -0.00700361 -0.0081703 -0.00956461 -0.0111269 -0.0126008 -0.0140066 -0.0155575 -0.017189 -0.018973 -0.0210643 -0.0227119 -0.0245652 -0.0268497 -0.0289943 -0.0311657 -0.0333413 -0.0351293 -0.0373072 -0.0393486 -0.040356 -0.0412168 -0.041828 -0.0401384 -0.0382765 -0.0358802 -0.0315596 -0.0270523 -0.0217757 -0.0168154 -0.0126127 -0.00891931 -0.00618373 -0.00444075 -0.00309968 -0.00184404 -0.000339609 0.00106363 0.00251014 0.00367167 0.00459857 0.00541112 0.00598981 0.00632455 0.00631325 0.00611039 0.00583647 0.00549105 0.00507829 0.00467371 0.00424706 0.00381987 0.00343532 0.00307508 0.00274394 0.00245766 0.00222128 0.00201829 0.00182871 0.00166079 0.00151976 0.00140509 0.00130981 0.00123495 0.00117924 0.00113683 0.00112344 0.0011141 0.00104949 0.000965024 0.000873648 0.000751932 0.000636187 0.000488265 0.000344035 0.000172524 -1.23841e-05 -0.000219948 -0.000451583 -0.000725414 -0.00103229 -0.00144438 -0.00188281 -0.0024996 -0.00313907 -0.00393767 -0.00484875 -0.00588075 -0.00703724 -0.00830611 -0.00969992 -0.011202 -0.0127377 -0.0143778 -0.0159989 -0.0174141 -0.0188733 -0.0199402 -0.0208632 -0.0215621 -0.0214815 -0.020844 -0.0193962 -0.0167837 -0.0138747 -0.0108518 -0.00832917 -0.0065134 -0.00603668 -0.00612272 -0.00628214 -0.00619473 -0.00576005 -0.00496647 -0.0037375 -0.00234452 -0.000969331 0.000206183 0.00109887 0.00173193 0.00211801 0.00231298 0.00241371 0.00250955 0.00257751 0.00261439 0.00258735 0.00251181 0.00238631 0.00222105 0.00204604 0.00187234 0.00171509 0.00156326 0.00141853 0.00128201 0.00115718 0.00103644 0.000929669 0.00084669 0.000789503 0.000755831 0.000774096 0.000808256 0.000822268 0.000838392 0.000825206 0.000749298 0.000594039 0.000437605 0.00027759 0.000177712 0.000101459 -4.52022e-05 -0.000246901 -0.000683193 -0.00126631 -0.00198945 -0.00275953 -0.00353434 -0.00430072 -0.00493621 -0.00559474 -0.00643857 -0.00752065 -0.00884455 -0.0103486 -0.0119681 -0.0137897 -0.015831 -0.0178693 -0.0195619 -0.0208734 -0.0211462 -0.0209753 -0.0198201 -0.0181498 -0.0158754 -0.013184 -0.0105395 -0.00814641 -0.00658366 -0.00607889 -0.00613981 -0.00608064 -0.00587135 -0.00546235 -0.00469273 -0.00358452 -0.00231402 -0.00109968 -9.67897e-05 0.000728108 0.0012811 0.00168053 0.00191266 0.0020835 0.0022206 0.00223387 0.00214688 0.0020123 0.00196261 0.00195079 0.00192912 0.00187711 0.00179634 0.00165462 0.0014654 0.00127771 0.00116693 0.00113159 0.00115065 0.00117331 0.00118127 0.00116631 0.0011309 0.00110677 0.00104903 0.000982967 0.000917217 0.000844803 0.000743187 0.000606112 0.000448928 0.000315148 0.000201361 0.000151012 0.000115908 0.000121245 -1.20052e-05 -0.000398713 -0.00115409 -0.00201405 -0.00267671 -0.00300428 -0.00297539 -0.00292884 -0.00301086 -0.00336438 -0.00407467 -0.00518076 -0.00659584 -0.00825109 -0.0100192 -0.0119834 -0.0139208 -0.01579 -0.0174235 -0.018617 -0.0194253 -0.0191876 -0.0176364 -0.0152188 -0.0124553 -0.00950403 -0.00745027 -0.00674181 -0.00618782 -0.0061033 -0.00580611 -0.00538826 -0.00478233 -0.00379672 -0.00233443 -0.000411103 0.00153875 0.00300207 0.00421706 0.00519366 0.00585588 0.0061574 0.00614884 0.00590562 0.0056345 0.00543386 0.00522546 0.00499738 0.00472842 0.00446695 0.00422184 0.00400081 0.00380687 0.00361874 0.00340761 0.00318851 0.0029649 0.0027376 0.00250079 0.00225196 0.00198786 0.0017051 0.00139361 0.00111513 0.000820687 0.000394407 -0.000115758 -0.000718915 -0.00142803 -0.00226704 -0.00319543 -0.00425973 -0.0054304 -0.00671805 -0.0082144 -0.00988941 -0.0117719 -0.0138758 -0.0160703 -0.0187665 -0.0216107 -0.0246769 -0.0280185 -0.0316015 -0.0354236 -0.0393142 -0.0433229 -0.0473176 -0.050886 -0.0546399 -0.0578277 -0.0601485 -0.062487 -0.0628339 -0.0623629 -0.0601445 -0.0556493 -0.0508567 -0.0418775 -0.032022 -0.0235873 -0.0137948 -0.002292 0.0108179 0.0253676 0.0414886 0.0567854 0.0708901 0.0820888 0.0865785 ) ; boundaryField { inlet { type zeroGradient; } bottom { type zeroGradient; } outlet { type zeroGradient; } atmosphere { type totalPressure; rho none; psi none; gamma 1; p0 uniform 0; value nonuniform List<scalar> 357 ( 0 0 0 0 0 0 0 0 0 0 0 0 0 -3.71383e-07 -1.16274e-05 -3.85312e-05 -8.04481e-05 -0.000136692 -0.000208321 -0.000303496 -0.000440989 -0.000636057 -0.000894386 -0.00119434 -0.00154354 -0.00197967 -0.0025018 -0.00315217 -0.00390093 -0.0046928 -0.00565256 -0.00674476 -0.00796261 -0.00926958 -0.0106482 -0.0120486 -0.0135111 -0.0151607 -0.0162304 -0.0171339 -0.0179793 -0.0174948 -0.0166542 -0.0153209 -0.0129582 -0.0103359 -0.00742344 -0.00471289 -0.00247471 -0.000912552 -9.45008e-05 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -1.27038e-06 -2.76384e-05 -8.86066e-05 -0.000169399 -0.000288968 -0.000411296 -0.000578806 -0.000751463 -0.000966356 -0.00120659 -0.00148511 -0.00180644 -0.00218468 -0.00261026 -0.00314846 -0.00371053 -0.00446085 -0.0052146 -0.00614232 -0.00716418 -0.0082842 -0.00950677 -0.0108139 -0.012208 -0.0136549 -0.0150646 -0.0164994 -0.0178179 -0.0187724 -0.0197047 -0.0201104 -0.0202206 -0.0198667 -0.0185306 -0.0165998 -0.0138827 -0.0103397 -0.00692474 -0.0037138 -0.0014356 -0.000180541 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -9.94152e-07 -1.79595e-05 -6.03492e-05 -0.000148609 -0.000287145 -0.000470603 -0.000627913 -0.000784764 -0.000910445 -0.00107665 -0.00136427 -0.00176957 -0.00243246 -0.00321636 -0.00408917 -0.00495751 -0.00575258 -0.00651548 -0.00714885 -0.0078901 -0.00886716 -0.0100537 -0.0114165 -0.0128946 -0.0144407 -0.0161031 -0.0178248 -0.0193219 -0.0202671 -0.0206768 -0.0197725 -0.0184421 -0.0160566 -0.0132287 -0.0100127 -0.00671851 -0.00383305 -0.00160152 -0.000358817 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -5.2955e-07 -2.20638e-05 -7.40364e-05 -0.00015277 -0.000266696 -0.000403445 -0.000539856 -0.000646056 -0.000741176 -0.000803952 -0.000911779 -0.0010725 -0.00143553 -0.00206111 -0.00296494 -0.00382567 -0.00440203 -0.00462171 -0.00456771 -0.00460579 -0.00486474 -0.00544112 -0.00636244 -0.0076037 -0.00906341 -0.0106848 -0.0123117 -0.0139779 -0.0154152 -0.0165909 -0.0173819 -0.0174599 -0.0169483 -0.0152696 -0.0124942 -0.00911579 -0.00574791 -0.00280048 -0.000977509 -4.64865e-05 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -3.14972e-06 -3.0156e-05 -8.61076e-05 -0.000169801 -0.000283731 -0.000432152 -0.000604931 -0.000813622 -0.00105123 -0.00131483 -0.00162622 -0.00196679 -0.0023432 -0.00276663 -0.00321133 -0.00371557 -0.00425268 -0.00481753 -0.00541676 -0.00603707 -0.0066691 -0.00726482 -0.00784286 -0.00835156 -0.00870295 -0.00906545 -0.0092409 -0.00916335 -0.00906646 -0.00853746 -0.00790862 -0.00704483 -0.00584124 -0.00473962 -0.00323068 -0.00189 -0.00100027 -0.000323167 -1.69686e-06 0 0 0 0 0 0 0 ) ; } frontBack { type empty; } } // ************************************************************************* //
[ "abenaz15@etudiant.mines-nantes.fr" ]
abenaz15@etudiant.mines-nantes.fr
603a616e964a3e0b97543ba9113a1a05886421ba
69ef99f5e407db4346c97310709ab85b7514d5ea
/src/builtins/builtins-collections-gen.cc
a8f9820e3106d96622bef53e273dc075955afa92
[ "bzip2-1.0.6", "BSD-3-Clause", "SunPro", "Apache-2.0" ]
permissive
KaoRz/v8
0f771449cf728938ff882c8822ec2fe0dca2d974
242df3a2ed30d28d98076ab0584c95a9256c5cd6
refs/heads/master
2022-12-06T23:08:49.016515
2020-08-10T14:20:01
2020-08-10T14:59:46
286,530,234
1
0
null
2020-08-10T16:49:55
2020-08-10T16:49:54
null
UTF-8
C++
false
false
120,568
cc
// Copyright 2017 the V8 project 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 "src/builtins/builtins-collections-gen.h" #include "src/builtins/builtins-constructor-gen.h" #include "src/builtins/builtins-iterator-gen.h" #include "src/builtins/builtins-utils-gen.h" #include "src/codegen/code-stub-assembler.h" #include "src/execution/protectors.h" #include "src/heap/factory-inl.h" #include "src/heap/heap-inl.h" #include "src/objects/hash-table-inl.h" #include "src/objects/js-collection.h" #include "src/objects/ordered-hash-table.h" #include "src/roots/roots.h" namespace v8 { namespace internal { using compiler::Node; template <class T> using TVariable = compiler::TypedCodeAssemblerVariable<T>; class BaseCollectionsAssembler : public CodeStubAssembler { public: explicit BaseCollectionsAssembler(compiler::CodeAssemblerState* state) : CodeStubAssembler(state) {} virtual ~BaseCollectionsAssembler() = default; protected: enum Variant { kMap, kSet, kWeakMap, kWeakSet }; // Adds an entry to a collection. For Maps, properly handles extracting the // key and value from the entry (see LoadKeyValue()). void AddConstructorEntry(Variant variant, TNode<Context> context, TNode<Object> collection, TNode<Object> add_function, TNode<Object> key_value, Label* if_may_have_side_effects = nullptr, Label* if_exception = nullptr, TVariable<Object>* var_exception = nullptr); // Adds constructor entries to a collection. Choosing a fast path when // possible. void AddConstructorEntries(Variant variant, TNode<Context> context, TNode<Context> native_context, TNode<HeapObject> collection, TNode<Object> initial_entries); // Fast path for adding constructor entries. Assumes the entries are a fast // JS array (see CodeStubAssembler::BranchIfFastJSArray()). void AddConstructorEntriesFromFastJSArray(Variant variant, TNode<Context> context, TNode<Context> native_context, TNode<Object> collection, TNode<JSArray> fast_jsarray, Label* if_may_have_side_effects); // Adds constructor entries to a collection using the iterator protocol. void AddConstructorEntriesFromIterable(Variant variant, TNode<Context> context, TNode<Context> native_context, TNode<Object> collection, TNode<Object> iterable); // Constructs a collection instance. Choosing a fast path when possible. TNode<JSObject> AllocateJSCollection(TNode<Context> context, TNode<JSFunction> constructor, TNode<JSReceiver> new_target); // Fast path for constructing a collection instance if the constructor // function has not been modified. TNode<JSObject> AllocateJSCollectionFast(TNode<JSFunction> constructor); // Fallback for constructing a collection instance if the constructor function // has been modified. TNode<JSObject> AllocateJSCollectionSlow(TNode<Context> context, TNode<JSFunction> constructor, TNode<JSReceiver> new_target); // Allocates the backing store for a collection. virtual TNode<HeapObject> AllocateTable( Variant variant, TNode<IntPtrT> at_least_space_for) = 0; // Main entry point for a collection constructor builtin. void GenerateConstructor(Variant variant, Handle<String> constructor_function_name, TNode<Object> new_target, TNode<IntPtrT> argc, TNode<Context> context); // Retrieves the collection function that adds an entry. `set` for Maps and // `add` for Sets. TNode<Object> GetAddFunction(Variant variant, TNode<Context> context, TNode<Object> collection); // Retrieves the collection constructor function. TNode<JSFunction> GetConstructor(Variant variant, TNode<Context> native_context); // Retrieves the initial collection function that adds an entry. Should only // be called when it is certain that a collection prototype's map hasn't been // changed. TNode<JSFunction> GetInitialAddFunction(Variant variant, TNode<Context> native_context); // Checks whether {collection}'s initial add/set function has been modified // (depending on {variant}, loaded from {native_context}). void GotoIfInitialAddFunctionModified(Variant variant, TNode<NativeContext> native_context, TNode<HeapObject> collection, Label* if_modified); // Gets root index for the name of the add/set function. RootIndex GetAddFunctionNameIndex(Variant variant); // Retrieves the offset to access the backing table from the collection. int GetTableOffset(Variant variant); // Estimates the number of entries the collection will have after adding the // entries passed in the constructor. AllocateTable() can use this to avoid // the time of growing/rehashing when adding the constructor entries. TNode<IntPtrT> EstimatedInitialSize(TNode<Object> initial_entries, TNode<BoolT> is_fast_jsarray); void GotoIfNotJSReceiver(const TNode<Object> obj, Label* if_not_receiver); // Determines whether the collection's prototype has been modified. TNode<BoolT> HasInitialCollectionPrototype(Variant variant, TNode<Context> native_context, TNode<Object> collection); // Gets the initial prototype map for given collection {variant}. TNode<Map> GetInitialCollectionPrototype(Variant variant, TNode<Context> native_context); // Loads an element from a fixed array. If the element is the hole, returns // `undefined`. TNode<Object> LoadAndNormalizeFixedArrayElement(TNode<FixedArray> elements, TNode<IntPtrT> index); // Loads an element from a fixed double array. If the element is the hole, // returns `undefined`. TNode<Object> LoadAndNormalizeFixedDoubleArrayElement( TNode<HeapObject> elements, TNode<IntPtrT> index); }; void BaseCollectionsAssembler::AddConstructorEntry( Variant variant, TNode<Context> context, TNode<Object> collection, TNode<Object> add_function, TNode<Object> key_value, Label* if_may_have_side_effects, Label* if_exception, TVariable<Object>* var_exception) { compiler::ScopedExceptionHandler handler(this, if_exception, var_exception); CSA_ASSERT(this, Word32BinaryNot(IsTheHole(key_value))); if (variant == kMap || variant == kWeakMap) { TorqueStructKeyValuePair pair = if_may_have_side_effects != nullptr ? LoadKeyValuePairNoSideEffects(context, key_value, if_may_have_side_effects) : LoadKeyValuePair(context, key_value); TNode<Object> key_n = pair.key; TNode<Object> value_n = pair.value; Call(context, add_function, collection, key_n, value_n); } else { DCHECK(variant == kSet || variant == kWeakSet); Call(context, add_function, collection, key_value); } } void BaseCollectionsAssembler::AddConstructorEntries( Variant variant, TNode<Context> context, TNode<Context> native_context, TNode<HeapObject> collection, TNode<Object> initial_entries) { TVARIABLE(BoolT, use_fast_loop, IsFastJSArrayWithNoCustomIteration(context, initial_entries)); TNode<IntPtrT> at_least_space_for = EstimatedInitialSize(initial_entries, use_fast_loop.value()); Label allocate_table(this, &use_fast_loop), exit(this), fast_loop(this), slow_loop(this, Label::kDeferred); Goto(&allocate_table); BIND(&allocate_table); { TNode<HeapObject> table = AllocateTable(variant, at_least_space_for); StoreObjectField(collection, GetTableOffset(variant), table); GotoIf(IsNullOrUndefined(initial_entries), &exit); GotoIfInitialAddFunctionModified(variant, CAST(native_context), collection, &slow_loop); Branch(use_fast_loop.value(), &fast_loop, &slow_loop); } BIND(&fast_loop); { TNode<JSArray> initial_entries_jsarray = UncheckedCast<JSArray>(initial_entries); #if DEBUG CSA_ASSERT(this, IsFastJSArrayWithNoCustomIteration( context, initial_entries_jsarray)); TNode<Map> original_initial_entries_map = LoadMap(initial_entries_jsarray); #endif Label if_may_have_side_effects(this, Label::kDeferred); AddConstructorEntriesFromFastJSArray(variant, context, native_context, collection, initial_entries_jsarray, &if_may_have_side_effects); Goto(&exit); if (variant == kMap || variant == kWeakMap) { BIND(&if_may_have_side_effects); #if DEBUG { // Check that add/set function has not been modified. Label if_not_modified(this), if_modified(this); GotoIfInitialAddFunctionModified(variant, CAST(native_context), collection, &if_modified); Goto(&if_not_modified); BIND(&if_modified); Unreachable(); BIND(&if_not_modified); } CSA_ASSERT(this, TaggedEqual(original_initial_entries_map, LoadMap(initial_entries_jsarray))); #endif use_fast_loop = Int32FalseConstant(); Goto(&allocate_table); } } BIND(&slow_loop); { AddConstructorEntriesFromIterable(variant, context, native_context, collection, initial_entries); Goto(&exit); } BIND(&exit); } void BaseCollectionsAssembler::AddConstructorEntriesFromFastJSArray( Variant variant, TNode<Context> context, TNode<Context> native_context, TNode<Object> collection, TNode<JSArray> fast_jsarray, Label* if_may_have_side_effects) { TNode<FixedArrayBase> elements = LoadElements(fast_jsarray); TNode<Int32T> elements_kind = LoadElementsKind(fast_jsarray); TNode<JSFunction> add_func = GetInitialAddFunction(variant, native_context); CSA_ASSERT(this, TaggedEqual(GetAddFunction(variant, native_context, collection), add_func)); CSA_ASSERT(this, IsFastJSArrayWithNoCustomIteration(context, fast_jsarray)); TNode<IntPtrT> length = SmiUntag(LoadFastJSArrayLength(fast_jsarray)); CSA_ASSERT(this, IntPtrGreaterThanOrEqual(length, IntPtrConstant(0))); CSA_ASSERT( this, HasInitialCollectionPrototype(variant, native_context, collection)); #if DEBUG TNode<Map> original_collection_map = LoadMap(CAST(collection)); TNode<Map> original_fast_js_array_map = LoadMap(fast_jsarray); #endif Label exit(this), if_doubles(this), if_smiorobjects(this); GotoIf(IntPtrEqual(length, IntPtrConstant(0)), &exit); Branch(IsFastSmiOrTaggedElementsKind(elements_kind), &if_smiorobjects, &if_doubles); BIND(&if_smiorobjects); { auto set_entry = [&](TNode<IntPtrT> index) { TNode<Object> element = LoadAndNormalizeFixedArrayElement( CAST(elements), UncheckedCast<IntPtrT>(index)); AddConstructorEntry(variant, context, collection, add_func, element, if_may_have_side_effects); }; // Instead of using the slower iteration protocol to iterate over the // elements, a fast loop is used. This assumes that adding an element // to the collection does not call user code that could mutate the elements // or collection. BuildFastLoop<IntPtrT>(IntPtrConstant(0), length, set_entry, 1, IndexAdvanceMode::kPost); Goto(&exit); } BIND(&if_doubles); { // A Map constructor requires entries to be arrays (ex. [key, value]), // so a FixedDoubleArray can never succeed. if (variant == kMap || variant == kWeakMap) { CSA_ASSERT(this, IntPtrGreaterThan(length, IntPtrConstant(0))); TNode<Object> element = LoadAndNormalizeFixedDoubleArrayElement(elements, IntPtrConstant(0)); ThrowTypeError(context, MessageTemplate::kIteratorValueNotAnObject, element); } else { DCHECK(variant == kSet || variant == kWeakSet); auto set_entry = [&](TNode<IntPtrT> index) { TNode<Object> entry = LoadAndNormalizeFixedDoubleArrayElement( elements, UncheckedCast<IntPtrT>(index)); AddConstructorEntry(variant, context, collection, add_func, entry); }; BuildFastLoop<IntPtrT>(IntPtrConstant(0), length, set_entry, 1, IndexAdvanceMode::kPost); Goto(&exit); } } BIND(&exit); #if DEBUG CSA_ASSERT(this, TaggedEqual(original_collection_map, LoadMap(CAST(collection)))); CSA_ASSERT(this, TaggedEqual(original_fast_js_array_map, LoadMap(fast_jsarray))); #endif } void BaseCollectionsAssembler::AddConstructorEntriesFromIterable( Variant variant, TNode<Context> context, TNode<Context> native_context, TNode<Object> collection, TNode<Object> iterable) { Label exit(this), loop(this), if_exception(this, Label::kDeferred); CSA_ASSERT(this, Word32BinaryNot(IsNullOrUndefined(iterable))); TNode<Object> add_func = GetAddFunction(variant, context, collection); IteratorBuiltinsAssembler iterator_assembler(this->state()); TorqueStructIteratorRecord iterator = iterator_assembler.GetIterator(context, iterable); CSA_ASSERT(this, Word32BinaryNot(IsUndefined(iterator.object))); TNode<Map> fast_iterator_result_map = CAST( LoadContextElement(native_context, Context::ITERATOR_RESULT_MAP_INDEX)); TVARIABLE(Object, var_exception); Goto(&loop); BIND(&loop); { TNode<JSReceiver> next = iterator_assembler.IteratorStep( context, iterator, &exit, fast_iterator_result_map); TNode<Object> next_value = iterator_assembler.IteratorValue( context, next, fast_iterator_result_map); AddConstructorEntry(variant, context, collection, add_func, next_value, nullptr, &if_exception, &var_exception); Goto(&loop); } BIND(&if_exception); { IteratorCloseOnException(context, iterator); CallRuntime(Runtime::kReThrow, context, var_exception.value()); Unreachable(); } BIND(&exit); } RootIndex BaseCollectionsAssembler::GetAddFunctionNameIndex(Variant variant) { switch (variant) { case kMap: case kWeakMap: return RootIndex::kset_string; case kSet: case kWeakSet: return RootIndex::kadd_string; } UNREACHABLE(); } void BaseCollectionsAssembler::GotoIfInitialAddFunctionModified( Variant variant, TNode<NativeContext> native_context, TNode<HeapObject> collection, Label* if_modified) { STATIC_ASSERT(JSCollection::kAddFunctionDescriptorIndex == JSWeakCollection::kAddFunctionDescriptorIndex); // TODO(jgruber): Investigate if this should also fall back to full prototype // verification. static constexpr PrototypeCheckAssembler::Flags flags{ PrototypeCheckAssembler::kCheckPrototypePropertyConstness}; static constexpr int kNoContextIndex = -1; STATIC_ASSERT( (flags & PrototypeCheckAssembler::kCheckPrototypePropertyIdentity) == 0); using DescriptorIndexNameValue = PrototypeCheckAssembler::DescriptorIndexNameValue; DescriptorIndexNameValue property_to_check{ JSCollection::kAddFunctionDescriptorIndex, GetAddFunctionNameIndex(variant), kNoContextIndex}; PrototypeCheckAssembler prototype_check_assembler( state(), flags, native_context, GetInitialCollectionPrototype(variant, native_context), Vector<DescriptorIndexNameValue>(&property_to_check, 1)); TNode<HeapObject> prototype = LoadMapPrototype(LoadMap(collection)); Label if_unmodified(this); prototype_check_assembler.CheckAndBranch(prototype, &if_unmodified, if_modified); BIND(&if_unmodified); } TNode<JSObject> BaseCollectionsAssembler::AllocateJSCollection( TNode<Context> context, TNode<JSFunction> constructor, TNode<JSReceiver> new_target) { TNode<BoolT> is_target_unmodified = TaggedEqual(constructor, new_target); return Select<JSObject>( is_target_unmodified, [=] { return AllocateJSCollectionFast(constructor); }, [=] { return AllocateJSCollectionSlow(context, constructor, new_target); }); } TNode<JSObject> BaseCollectionsAssembler::AllocateJSCollectionFast( TNode<JSFunction> constructor) { CSA_ASSERT(this, IsConstructorMap(LoadMap(constructor))); TNode<Map> initial_map = CAST(LoadJSFunctionPrototypeOrInitialMap(constructor)); return AllocateJSObjectFromMap(initial_map); } TNode<JSObject> BaseCollectionsAssembler::AllocateJSCollectionSlow( TNode<Context> context, TNode<JSFunction> constructor, TNode<JSReceiver> new_target) { ConstructorBuiltinsAssembler constructor_assembler(this->state()); return constructor_assembler.FastNewObject(context, constructor, new_target); } void BaseCollectionsAssembler::GenerateConstructor( Variant variant, Handle<String> constructor_function_name, TNode<Object> new_target, TNode<IntPtrT> argc, TNode<Context> context) { const int kIterableArg = 0; CodeStubArguments args(this, argc); TNode<Object> iterable = args.GetOptionalArgumentValue(kIterableArg); Label if_undefined(this, Label::kDeferred); GotoIf(IsUndefined(new_target), &if_undefined); TNode<NativeContext> native_context = LoadNativeContext(context); TNode<JSObject> collection = AllocateJSCollection( context, GetConstructor(variant, native_context), CAST(new_target)); AddConstructorEntries(variant, context, native_context, collection, iterable); Return(collection); BIND(&if_undefined); ThrowTypeError(context, MessageTemplate::kConstructorNotFunction, HeapConstant(constructor_function_name)); } TNode<Object> BaseCollectionsAssembler::GetAddFunction( Variant variant, TNode<Context> context, TNode<Object> collection) { Handle<String> add_func_name = (variant == kMap || variant == kWeakMap) ? isolate()->factory()->set_string() : isolate()->factory()->add_string(); TNode<Object> add_func = GetProperty(context, collection, add_func_name); Label exit(this), if_notcallable(this, Label::kDeferred); GotoIf(TaggedIsSmi(add_func), &if_notcallable); GotoIfNot(IsCallable(CAST(add_func)), &if_notcallable); Goto(&exit); BIND(&if_notcallable); ThrowTypeError(context, MessageTemplate::kPropertyNotFunction, add_func, HeapConstant(add_func_name), collection); BIND(&exit); return add_func; } TNode<JSFunction> BaseCollectionsAssembler::GetConstructor( Variant variant, TNode<Context> native_context) { int index; switch (variant) { case kMap: index = Context::JS_MAP_FUN_INDEX; break; case kSet: index = Context::JS_SET_FUN_INDEX; break; case kWeakMap: index = Context::JS_WEAK_MAP_FUN_INDEX; break; case kWeakSet: index = Context::JS_WEAK_SET_FUN_INDEX; break; } return CAST(LoadContextElement(native_context, index)); } TNode<JSFunction> BaseCollectionsAssembler::GetInitialAddFunction( Variant variant, TNode<Context> native_context) { int index; switch (variant) { case kMap: index = Context::MAP_SET_INDEX; break; case kSet: index = Context::SET_ADD_INDEX; break; case kWeakMap: index = Context::WEAKMAP_SET_INDEX; break; case kWeakSet: index = Context::WEAKSET_ADD_INDEX; break; } return CAST(LoadContextElement(native_context, index)); } int BaseCollectionsAssembler::GetTableOffset(Variant variant) { switch (variant) { case kMap: return JSMap::kTableOffset; case kSet: return JSSet::kTableOffset; case kWeakMap: return JSWeakMap::kTableOffset; case kWeakSet: return JSWeakSet::kTableOffset; } UNREACHABLE(); } TNode<IntPtrT> BaseCollectionsAssembler::EstimatedInitialSize( TNode<Object> initial_entries, TNode<BoolT> is_fast_jsarray) { return Select<IntPtrT>( is_fast_jsarray, [=] { return SmiUntag(LoadFastJSArrayLength(CAST(initial_entries))); }, [=] { return IntPtrConstant(0); }); } void BaseCollectionsAssembler::GotoIfNotJSReceiver(const TNode<Object> obj, Label* if_not_receiver) { GotoIf(TaggedIsSmi(obj), if_not_receiver); GotoIfNot(IsJSReceiver(CAST(obj)), if_not_receiver); } TNode<Map> BaseCollectionsAssembler::GetInitialCollectionPrototype( Variant variant, TNode<Context> native_context) { int initial_prototype_index; switch (variant) { case kMap: initial_prototype_index = Context::INITIAL_MAP_PROTOTYPE_MAP_INDEX; break; case kSet: initial_prototype_index = Context::INITIAL_SET_PROTOTYPE_MAP_INDEX; break; case kWeakMap: initial_prototype_index = Context::INITIAL_WEAKMAP_PROTOTYPE_MAP_INDEX; break; case kWeakSet: initial_prototype_index = Context::INITIAL_WEAKSET_PROTOTYPE_MAP_INDEX; break; } return CAST(LoadContextElement(native_context, initial_prototype_index)); } TNode<BoolT> BaseCollectionsAssembler::HasInitialCollectionPrototype( Variant variant, TNode<Context> native_context, TNode<Object> collection) { TNode<Map> collection_proto_map = LoadMap(LoadMapPrototype(LoadMap(CAST(collection)))); return TaggedEqual(collection_proto_map, GetInitialCollectionPrototype(variant, native_context)); } TNode<Object> BaseCollectionsAssembler::LoadAndNormalizeFixedArrayElement( TNode<FixedArray> elements, TNode<IntPtrT> index) { TNode<Object> element = UnsafeLoadFixedArrayElement(elements, index); return Select<Object>(IsTheHole(element), [=] { return UndefinedConstant(); }, [=] { return element; }); } TNode<Object> BaseCollectionsAssembler::LoadAndNormalizeFixedDoubleArrayElement( TNode<HeapObject> elements, TNode<IntPtrT> index) { TVARIABLE(Object, entry); Label if_hole(this, Label::kDeferred), next(this); TNode<Float64T> element = LoadFixedDoubleArrayElement(CAST(elements), index, MachineType::Float64(), 0, INTPTR_PARAMETERS, &if_hole); { // not hole entry = AllocateHeapNumberWithValue(element); Goto(&next); } BIND(&if_hole); { entry = UndefinedConstant(); Goto(&next); } BIND(&next); return entry.value(); } class CollectionsBuiltinsAssembler : public BaseCollectionsAssembler { public: explicit CollectionsBuiltinsAssembler(compiler::CodeAssemblerState* state) : BaseCollectionsAssembler(state) {} // Check whether |iterable| is a JS_MAP_KEY_ITERATOR_TYPE or // JS_MAP_VALUE_ITERATOR_TYPE object that is not partially consumed and still // has original iteration behavior. void BranchIfIterableWithOriginalKeyOrValueMapIterator(TNode<Object> iterable, TNode<Context> context, Label* if_true, Label* if_false); // Check whether |iterable| is a JS_SET_TYPE or JS_SET_VALUE_ITERATOR_TYPE // object that still has original iteration behavior. In case of the iterator, // the iterator also must not have been partially consumed. void BranchIfIterableWithOriginalValueSetIterator(TNode<Object> iterable, TNode<Context> context, Label* if_true, Label* if_false); protected: template <typename IteratorType> TNode<HeapObject> AllocateJSCollectionIterator( const TNode<Context> context, int map_index, const TNode<HeapObject> collection); TNode<HeapObject> AllocateTable(Variant variant, TNode<IntPtrT> at_least_space_for) override; TNode<IntPtrT> GetHash(const TNode<HeapObject> key); TNode<IntPtrT> CallGetHashRaw(const TNode<HeapObject> key); TNode<Smi> CallGetOrCreateHashRaw(const TNode<HeapObject> key); // Transitions the iterator to the non obsolete backing store. // This is a NOP if the [table] is not obsolete. template <typename TableType> using UpdateInTransition = std::function<void(const TNode<TableType> table, const TNode<IntPtrT> index)>; template <typename TableType> std::pair<TNode<TableType>, TNode<IntPtrT>> Transition( const TNode<TableType> table, const TNode<IntPtrT> index, UpdateInTransition<TableType> const& update_in_transition); template <typename IteratorType, typename TableType> std::pair<TNode<TableType>, TNode<IntPtrT>> TransitionAndUpdate( const TNode<IteratorType> iterator); template <typename TableType> std::tuple<TNode<Object>, TNode<IntPtrT>, TNode<IntPtrT>> NextSkipHoles( TNode<TableType> table, TNode<IntPtrT> index, Label* if_end); // Specialization for Smi. // The {result} variable will contain the entry index if the key was found, // or the hash code otherwise. template <typename CollectionType> void FindOrderedHashTableEntryForSmiKey(TNode<CollectionType> table, TNode<Smi> key_tagged, TVariable<IntPtrT>* result, Label* entry_found, Label* not_found); void SameValueZeroSmi(TNode<Smi> key_smi, TNode<Object> candidate_key, Label* if_same, Label* if_not_same); // Specialization for heap numbers. // The {result} variable will contain the entry index if the key was found, // or the hash code otherwise. void SameValueZeroHeapNumber(TNode<Float64T> key_float, TNode<Object> candidate_key, Label* if_same, Label* if_not_same); template <typename CollectionType> void FindOrderedHashTableEntryForHeapNumberKey( TNode<CollectionType> table, TNode<HeapNumber> key_heap_number, TVariable<IntPtrT>* result, Label* entry_found, Label* not_found); // Specialization for bigints. // The {result} variable will contain the entry index if the key was found, // or the hash code otherwise. void SameValueZeroBigInt(TNode<BigInt> key, TNode<Object> candidate_key, Label* if_same, Label* if_not_same); template <typename CollectionType> void FindOrderedHashTableEntryForBigIntKey(TNode<CollectionType> table, TNode<BigInt> key_big_int, TVariable<IntPtrT>* result, Label* entry_found, Label* not_found); // Specialization for string. // The {result} variable will contain the entry index if the key was found, // or the hash code otherwise. template <typename CollectionType> void FindOrderedHashTableEntryForStringKey(TNode<CollectionType> table, TNode<String> key_tagged, TVariable<IntPtrT>* result, Label* entry_found, Label* not_found); TNode<IntPtrT> ComputeStringHash(TNode<String> string_key); void SameValueZeroString(TNode<String> key_string, TNode<Object> candidate_key, Label* if_same, Label* if_not_same); // Specialization for non-strings, non-numbers. For those we only need // reference equality to compare the keys. // The {result} variable will contain the entry index if the key was found, // or the hash code otherwise. If the hash-code has not been computed, it // should be Smi -1. template <typename CollectionType> void FindOrderedHashTableEntryForOtherKey(TNode<CollectionType> table, TNode<HeapObject> key_heap_object, TVariable<IntPtrT>* result, Label* entry_found, Label* not_found); template <typename CollectionType> void TryLookupOrderedHashTableIndex(const TNode<CollectionType> table, const TNode<Object> key, TVariable<IntPtrT>* result, Label* if_entry_found, Label* if_not_found); const TNode<Object> NormalizeNumberKey(const TNode<Object> key); void StoreOrderedHashMapNewEntry(const TNode<OrderedHashMap> table, const TNode<Object> key, const TNode<Object> value, const TNode<IntPtrT> hash, const TNode<IntPtrT> number_of_buckets, const TNode<IntPtrT> occupancy); void StoreOrderedHashSetNewEntry(const TNode<OrderedHashSet> table, const TNode<Object> key, const TNode<IntPtrT> hash, const TNode<IntPtrT> number_of_buckets, const TNode<IntPtrT> occupancy); // Create a JSArray with PACKED_ELEMENTS kind from a Map.prototype.keys() or // Map.prototype.values() iterator. The iterator is assumed to satisfy // IterableWithOriginalKeyOrValueMapIterator. This function will skip the // iterator and iterate directly on the underlying hash table. In the end it // will update the state of the iterator to 'exhausted'. TNode<JSArray> MapIteratorToList(TNode<Context> context, TNode<JSMapIterator> iterator); // Create a JSArray with PACKED_ELEMENTS kind from a Set.prototype.keys() or // Set.prototype.values() iterator, or a Set. The |iterable| is assumed to // satisfy IterableWithOriginalValueSetIterator. This function will skip the // iterator and iterate directly on the underlying hash table. In the end, if // |iterable| is an iterator, it will update the state of the iterator to // 'exhausted'. TNode<JSArray> SetOrSetIteratorToList(TNode<Context> context, TNode<HeapObject> iterable); void BranchIfMapIteratorProtectorValid(Label* if_true, Label* if_false); void BranchIfSetIteratorProtectorValid(Label* if_true, Label* if_false); // Builds code that finds OrderedHashTable entry for a key with hash code // {hash} with using the comparison code generated by {key_compare}. The code // jumps to {entry_found} if the key is found, or to {not_found} if the key // was not found. In the {entry_found} branch, the variable // entry_start_position will be bound to the index of the entry (relative to // OrderedHashTable::kHashTableStartIndex). // // The {CollectionType} template parameter stands for the particular instance // of OrderedHashTable, it should be OrderedHashMap or OrderedHashSet. template <typename CollectionType> void FindOrderedHashTableEntry( const TNode<CollectionType> table, const TNode<IntPtrT> hash, const std::function<void(TNode<Object>, Label*, Label*)>& key_compare, TVariable<IntPtrT>* entry_start_position, Label* entry_found, Label* not_found); TNode<Word32T> ComputeUnseededHash(TNode<IntPtrT> key); }; template <typename CollectionType> void CollectionsBuiltinsAssembler::FindOrderedHashTableEntry( const TNode<CollectionType> table, const TNode<IntPtrT> hash, const std::function<void(TNode<Object>, Label*, Label*)>& key_compare, TVariable<IntPtrT>* entry_start_position, Label* entry_found, Label* not_found) { // Get the index of the bucket. const TNode<IntPtrT> number_of_buckets = SmiUntag(CAST(UnsafeLoadFixedArrayElement( table, CollectionType::NumberOfBucketsIndex()))); const TNode<IntPtrT> bucket = WordAnd(hash, IntPtrSub(number_of_buckets, IntPtrConstant(1))); const TNode<IntPtrT> first_entry = SmiUntag(CAST(UnsafeLoadFixedArrayElement( table, bucket, CollectionType::HashTableStartIndex() * kTaggedSize))); // Walk the bucket chain. TNode<IntPtrT> entry_start; Label if_key_found(this); { TVARIABLE(IntPtrT, var_entry, first_entry); Label loop(this, {&var_entry, entry_start_position}), continue_next_entry(this); Goto(&loop); BIND(&loop); // If the entry index is the not-found sentinel, we are done. GotoIf(IntPtrEqual(var_entry.value(), IntPtrConstant(CollectionType::kNotFound)), not_found); // Make sure the entry index is within range. CSA_ASSERT( this, UintPtrLessThan( var_entry.value(), SmiUntag(SmiAdd( CAST(UnsafeLoadFixedArrayElement( table, CollectionType::NumberOfElementsIndex())), CAST(UnsafeLoadFixedArrayElement( table, CollectionType::NumberOfDeletedElementsIndex())))))); // Compute the index of the entry relative to kHashTableStartIndex. entry_start = IntPtrAdd(IntPtrMul(var_entry.value(), IntPtrConstant(CollectionType::kEntrySize)), number_of_buckets); // Load the key from the entry. const TNode<Object> candidate_key = UnsafeLoadFixedArrayElement( table, entry_start, CollectionType::HashTableStartIndex() * kTaggedSize); key_compare(candidate_key, &if_key_found, &continue_next_entry); BIND(&continue_next_entry); // Load the index of the next entry in the bucket chain. var_entry = SmiUntag(CAST(UnsafeLoadFixedArrayElement( table, entry_start, (CollectionType::HashTableStartIndex() + CollectionType::kChainOffset) * kTaggedSize))); Goto(&loop); } BIND(&if_key_found); *entry_start_position = entry_start; Goto(entry_found); } template <typename IteratorType> TNode<HeapObject> CollectionsBuiltinsAssembler::AllocateJSCollectionIterator( const TNode<Context> context, int map_index, const TNode<HeapObject> collection) { const TNode<Object> table = LoadObjectField(collection, JSCollection::kTableOffset); const TNode<NativeContext> native_context = LoadNativeContext(context); const TNode<Map> iterator_map = CAST(LoadContextElement(native_context, map_index)); const TNode<HeapObject> iterator = AllocateInNewSpace(IteratorType::kHeaderSize); StoreMapNoWriteBarrier(iterator, iterator_map); StoreObjectFieldRoot(iterator, IteratorType::kPropertiesOrHashOffset, RootIndex::kEmptyFixedArray); StoreObjectFieldRoot(iterator, IteratorType::kElementsOffset, RootIndex::kEmptyFixedArray); StoreObjectFieldNoWriteBarrier(iterator, IteratorType::kTableOffset, table); StoreObjectFieldNoWriteBarrier(iterator, IteratorType::kIndexOffset, SmiConstant(0)); return iterator; } TNode<HeapObject> CollectionsBuiltinsAssembler::AllocateTable( Variant variant, TNode<IntPtrT> at_least_space_for) { if (variant == kMap || variant == kWeakMap) { return AllocateOrderedHashTable<OrderedHashMap>(); } else { return AllocateOrderedHashTable<OrderedHashSet>(); } } TF_BUILTIN(MapConstructor, CollectionsBuiltinsAssembler) { TNode<Object> new_target = CAST(Parameter(Descriptor::kJSNewTarget)); TNode<IntPtrT> argc = ChangeInt32ToIntPtr( UncheckedCast<Int32T>(Parameter(Descriptor::kJSActualArgumentsCount))); TNode<Context> context = CAST(Parameter(Descriptor::kContext)); GenerateConstructor(kMap, isolate()->factory()->Map_string(), new_target, argc, context); } TF_BUILTIN(SetConstructor, CollectionsBuiltinsAssembler) { TNode<Object> new_target = CAST(Parameter(Descriptor::kJSNewTarget)); TNode<IntPtrT> argc = ChangeInt32ToIntPtr( UncheckedCast<Int32T>(Parameter(Descriptor::kJSActualArgumentsCount))); TNode<Context> context = CAST(Parameter(Descriptor::kContext)); GenerateConstructor(kSet, isolate()->factory()->Set_string(), new_target, argc, context); } TNode<Smi> CollectionsBuiltinsAssembler::CallGetOrCreateHashRaw( const TNode<HeapObject> key) { const TNode<ExternalReference> function_addr = ExternalConstant(ExternalReference::get_or_create_hash_raw()); const TNode<ExternalReference> isolate_ptr = ExternalConstant(ExternalReference::isolate_address(isolate())); MachineType type_ptr = MachineType::Pointer(); MachineType type_tagged = MachineType::AnyTagged(); TNode<Smi> result = CAST(CallCFunction(function_addr, type_tagged, std::make_pair(type_ptr, isolate_ptr), std::make_pair(type_tagged, key))); return result; } TNode<IntPtrT> CollectionsBuiltinsAssembler::CallGetHashRaw( const TNode<HeapObject> key) { const TNode<ExternalReference> function_addr = ExternalConstant(ExternalReference::orderedhashmap_gethash_raw()); const TNode<ExternalReference> isolate_ptr = ExternalConstant(ExternalReference::isolate_address(isolate())); MachineType type_ptr = MachineType::Pointer(); MachineType type_tagged = MachineType::AnyTagged(); TNode<Smi> result = CAST(CallCFunction(function_addr, type_tagged, std::make_pair(type_ptr, isolate_ptr), std::make_pair(type_tagged, key))); return SmiUntag(result); } TNode<IntPtrT> CollectionsBuiltinsAssembler::GetHash( const TNode<HeapObject> key) { TVARIABLE(IntPtrT, var_hash); Label if_receiver(this), if_other(this), done(this); Branch(IsJSReceiver(key), &if_receiver, &if_other); BIND(&if_receiver); { var_hash = LoadJSReceiverIdentityHash(key); Goto(&done); } BIND(&if_other); { var_hash = CallGetHashRaw(key); Goto(&done); } BIND(&done); return var_hash.value(); } void CollectionsBuiltinsAssembler::SameValueZeroSmi(TNode<Smi> key_smi, TNode<Object> candidate_key, Label* if_same, Label* if_not_same) { // If the key is the same, we are done. GotoIf(TaggedEqual(candidate_key, key_smi), if_same); // If the candidate key is smi, then it must be different (because // we already checked for equality above). GotoIf(TaggedIsSmi(candidate_key), if_not_same); // If the candidate key is not smi, we still have to check if it is a // heap number with the same value. GotoIfNot(IsHeapNumber(CAST(candidate_key)), if_not_same); const TNode<Float64T> candidate_key_number = LoadHeapNumberValue(CAST(candidate_key)); const TNode<Float64T> key_number = SmiToFloat64(key_smi); GotoIf(Float64Equal(candidate_key_number, key_number), if_same); Goto(if_not_same); } void CollectionsBuiltinsAssembler::BranchIfMapIteratorProtectorValid( Label* if_true, Label* if_false) { TNode<PropertyCell> protector_cell = MapIteratorProtectorConstant(); DCHECK(isolate()->heap()->map_iterator_protector().IsPropertyCell()); Branch( TaggedEqual(LoadObjectField(protector_cell, PropertyCell::kValueOffset), SmiConstant(Protectors::kProtectorValid)), if_true, if_false); } void CollectionsBuiltinsAssembler:: BranchIfIterableWithOriginalKeyOrValueMapIterator(TNode<Object> iterator, TNode<Context> context, Label* if_true, Label* if_false) { Label if_key_or_value_iterator(this), extra_checks(this); // Check if iterator is a keys or values JSMapIterator. GotoIf(TaggedIsSmi(iterator), if_false); TNode<Map> iter_map = LoadMap(CAST(iterator)); const TNode<Uint16T> instance_type = LoadMapInstanceType(iter_map); GotoIf(InstanceTypeEqual(instance_type, JS_MAP_KEY_ITERATOR_TYPE), &if_key_or_value_iterator); Branch(InstanceTypeEqual(instance_type, JS_MAP_VALUE_ITERATOR_TYPE), &if_key_or_value_iterator, if_false); BIND(&if_key_or_value_iterator); // Check that the iterator is not partially consumed. const TNode<Object> index = LoadObjectField(CAST(iterator), JSMapIterator::kIndexOffset); GotoIfNot(TaggedEqual(index, SmiConstant(0)), if_false); BranchIfMapIteratorProtectorValid(&extra_checks, if_false); BIND(&extra_checks); // Check if the iterator object has the original %MapIteratorPrototype%. const TNode<NativeContext> native_context = LoadNativeContext(context); const TNode<Object> initial_map_iter_proto = LoadContextElement( native_context, Context::INITIAL_MAP_ITERATOR_PROTOTYPE_INDEX); const TNode<HeapObject> map_iter_proto = LoadMapPrototype(iter_map); GotoIfNot(TaggedEqual(map_iter_proto, initial_map_iter_proto), if_false); // Check if the original MapIterator prototype has the original // %IteratorPrototype%. const TNode<Object> initial_iter_proto = LoadContextElement( native_context, Context::INITIAL_ITERATOR_PROTOTYPE_INDEX); const TNode<HeapObject> iter_proto = LoadMapPrototype(LoadMap(map_iter_proto)); Branch(TaggedEqual(iter_proto, initial_iter_proto), if_true, if_false); } void BranchIfIterableWithOriginalKeyOrValueMapIterator( compiler::CodeAssemblerState* state, TNode<Object> iterable, TNode<Context> context, compiler::CodeAssemblerLabel* if_true, compiler::CodeAssemblerLabel* if_false) { CollectionsBuiltinsAssembler assembler(state); assembler.BranchIfIterableWithOriginalKeyOrValueMapIterator( iterable, context, if_true, if_false); } void CollectionsBuiltinsAssembler::BranchIfSetIteratorProtectorValid( Label* if_true, Label* if_false) { const TNode<PropertyCell> protector_cell = SetIteratorProtectorConstant(); DCHECK(isolate()->heap()->set_iterator_protector().IsPropertyCell()); Branch( TaggedEqual(LoadObjectField(protector_cell, PropertyCell::kValueOffset), SmiConstant(Protectors::kProtectorValid)), if_true, if_false); } void CollectionsBuiltinsAssembler::BranchIfIterableWithOriginalValueSetIterator( TNode<Object> iterable, TNode<Context> context, Label* if_true, Label* if_false) { Label if_set(this), if_value_iterator(this), check_protector(this); TVARIABLE(BoolT, var_result); GotoIf(TaggedIsSmi(iterable), if_false); TNode<Map> iterable_map = LoadMap(CAST(iterable)); const TNode<Uint16T> instance_type = LoadMapInstanceType(iterable_map); GotoIf(InstanceTypeEqual(instance_type, JS_SET_TYPE), &if_set); Branch(InstanceTypeEqual(instance_type, JS_SET_VALUE_ITERATOR_TYPE), &if_value_iterator, if_false); BIND(&if_set); // Check if the set object has the original Set prototype. const TNode<Object> initial_set_proto = LoadContextElement( LoadNativeContext(context), Context::INITIAL_SET_PROTOTYPE_INDEX); const TNode<HeapObject> set_proto = LoadMapPrototype(iterable_map); GotoIfNot(TaggedEqual(set_proto, initial_set_proto), if_false); Goto(&check_protector); BIND(&if_value_iterator); // Check that the iterator is not partially consumed. const TNode<Object> index = LoadObjectField(CAST(iterable), JSSetIterator::kIndexOffset); GotoIfNot(TaggedEqual(index, SmiConstant(0)), if_false); // Check if the iterator object has the original SetIterator prototype. const TNode<NativeContext> native_context = LoadNativeContext(context); const TNode<Object> initial_set_iter_proto = LoadContextElement( native_context, Context::INITIAL_SET_ITERATOR_PROTOTYPE_INDEX); const TNode<HeapObject> set_iter_proto = LoadMapPrototype(iterable_map); GotoIfNot(TaggedEqual(set_iter_proto, initial_set_iter_proto), if_false); // Check if the original SetIterator prototype has the original // %IteratorPrototype%. const TNode<Object> initial_iter_proto = LoadContextElement( native_context, Context::INITIAL_ITERATOR_PROTOTYPE_INDEX); const TNode<HeapObject> iter_proto = LoadMapPrototype(LoadMap(set_iter_proto)); GotoIfNot(TaggedEqual(iter_proto, initial_iter_proto), if_false); Goto(&check_protector); BIND(&check_protector); BranchIfSetIteratorProtectorValid(if_true, if_false); } void BranchIfIterableWithOriginalValueSetIterator( compiler::CodeAssemblerState* state, TNode<Object> iterable, TNode<Context> context, compiler::CodeAssemblerLabel* if_true, compiler::CodeAssemblerLabel* if_false) { CollectionsBuiltinsAssembler assembler(state); assembler.BranchIfIterableWithOriginalValueSetIterator(iterable, context, if_true, if_false); } TNode<JSArray> CollectionsBuiltinsAssembler::MapIteratorToList( TNode<Context> context, TNode<JSMapIterator> iterator) { // Transition the {iterator} table if necessary. TNode<OrderedHashMap> table; TNode<IntPtrT> index; std::tie(table, index) = TransitionAndUpdate<JSMapIterator, OrderedHashMap>(iterator); CSA_ASSERT(this, IntPtrEqual(index, IntPtrConstant(0))); TNode<IntPtrT> size = LoadAndUntagObjectField(table, OrderedHashMap::NumberOfElementsOffset()); const ElementsKind kind = PACKED_ELEMENTS; TNode<Map> array_map = LoadJSArrayElementsMap(kind, LoadNativeContext(context)); TNode<JSArray> array = AllocateJSArray(kind, array_map, size, SmiTag(size), kAllowLargeObjectAllocation); TNode<FixedArray> elements = CAST(LoadElements(array)); const int first_element_offset = FixedArray::kHeaderSize - kHeapObjectTag; TNode<IntPtrT> first_to_element_offset = ElementOffsetFromIndex(IntPtrConstant(0), kind, 0); TVARIABLE( IntPtrT, var_offset, IntPtrAdd(first_to_element_offset, IntPtrConstant(first_element_offset))); TVARIABLE(IntPtrT, var_index, index); VariableList vars({&var_index, &var_offset}, zone()); Label done(this, {&var_index}), loop(this, vars), continue_loop(this, vars), write_key(this, vars), write_value(this, vars); Goto(&loop); BIND(&loop); { // Read the next entry from the {table}, skipping holes. TNode<Object> entry_key; TNode<IntPtrT> entry_start_position; TNode<IntPtrT> cur_index; std::tie(entry_key, entry_start_position, cur_index) = NextSkipHoles<OrderedHashMap>(table, var_index.value(), &done); // Decide to write key or value. Branch( InstanceTypeEqual(LoadInstanceType(iterator), JS_MAP_KEY_ITERATOR_TYPE), &write_key, &write_value); BIND(&write_key); { Store(elements, var_offset.value(), entry_key); Goto(&continue_loop); } BIND(&write_value); { CSA_ASSERT(this, InstanceTypeEqual(LoadInstanceType(iterator), JS_MAP_VALUE_ITERATOR_TYPE)); TNode<Object> entry_value = UnsafeLoadFixedArrayElement(table, entry_start_position, (OrderedHashMap::HashTableStartIndex() + OrderedHashMap::kValueOffset) * kTaggedSize); Store(elements, var_offset.value(), entry_value); Goto(&continue_loop); } BIND(&continue_loop); { // Increment the array offset and continue the loop to the next entry. var_index = cur_index; var_offset = IntPtrAdd(var_offset.value(), IntPtrConstant(kTaggedSize)); Goto(&loop); } } BIND(&done); // Set the {iterator} to exhausted. StoreObjectFieldRoot(iterator, JSMapIterator::kTableOffset, RootIndex::kEmptyOrderedHashMap); StoreObjectFieldNoWriteBarrier(iterator, JSMapIterator::kIndexOffset, SmiTag(var_index.value())); return UncheckedCast<JSArray>(array); } TF_BUILTIN(MapIteratorToList, CollectionsBuiltinsAssembler) { TNode<Context> context = CAST(Parameter(Descriptor::kContext)); TNode<JSMapIterator> iterator = CAST(Parameter(Descriptor::kSource)); Return(MapIteratorToList(context, iterator)); } TNode<JSArray> CollectionsBuiltinsAssembler::SetOrSetIteratorToList( TNode<Context> context, TNode<HeapObject> iterable) { TVARIABLE(OrderedHashSet, var_table); Label if_set(this), if_iterator(this), copy(this); const TNode<Uint16T> instance_type = LoadInstanceType(iterable); Branch(InstanceTypeEqual(instance_type, JS_SET_TYPE), &if_set, &if_iterator); BIND(&if_set); { // {iterable} is a JSSet. var_table = CAST(LoadObjectField(iterable, JSSet::kTableOffset)); Goto(&copy); } BIND(&if_iterator); { // {iterable} is a JSSetIterator. // Transition the {iterable} table if necessary. TNode<OrderedHashSet> iter_table; TNode<IntPtrT> iter_index; std::tie(iter_table, iter_index) = TransitionAndUpdate<JSSetIterator, OrderedHashSet>(CAST(iterable)); CSA_ASSERT(this, IntPtrEqual(iter_index, IntPtrConstant(0))); var_table = iter_table; Goto(&copy); } BIND(&copy); TNode<OrderedHashSet> table = var_table.value(); TNode<IntPtrT> size = LoadAndUntagObjectField(table, OrderedHashMap::NumberOfElementsOffset()); const ElementsKind kind = PACKED_ELEMENTS; TNode<Map> array_map = LoadJSArrayElementsMap(kind, LoadNativeContext(context)); TNode<JSArray> array = AllocateJSArray(kind, array_map, size, SmiTag(size), kAllowLargeObjectAllocation); TNode<FixedArray> elements = CAST(LoadElements(array)); const int first_element_offset = FixedArray::kHeaderSize - kHeapObjectTag; TNode<IntPtrT> first_to_element_offset = ElementOffsetFromIndex(IntPtrConstant(0), kind, 0); TVARIABLE( IntPtrT, var_offset, IntPtrAdd(first_to_element_offset, IntPtrConstant(first_element_offset))); TVARIABLE(IntPtrT, var_index, IntPtrConstant(0)); Label done(this), finalize(this, {&var_index}), loop(this, {&var_index, &var_offset}); Goto(&loop); BIND(&loop); { // Read the next entry from the {table}, skipping holes. TNode<Object> entry_key; TNode<IntPtrT> entry_start_position; TNode<IntPtrT> cur_index; std::tie(entry_key, entry_start_position, cur_index) = NextSkipHoles<OrderedHashSet>(table, var_index.value(), &finalize); Store(elements, var_offset.value(), entry_key); var_index = cur_index; var_offset = IntPtrAdd(var_offset.value(), IntPtrConstant(kTaggedSize)); Goto(&loop); } BIND(&finalize); GotoIf(InstanceTypeEqual(instance_type, JS_SET_TYPE), &done); // Set the {iterable} to exhausted if it's an iterator. StoreObjectFieldRoot(iterable, JSSetIterator::kTableOffset, RootIndex::kEmptyOrderedHashSet); StoreObjectFieldNoWriteBarrier(iterable, JSSetIterator::kIndexOffset, SmiTag(var_index.value())); Goto(&done); BIND(&done); return UncheckedCast<JSArray>(array); } TF_BUILTIN(SetOrSetIteratorToList, CollectionsBuiltinsAssembler) { TNode<Context> context = CAST(Parameter(Descriptor::kContext)); TNode<HeapObject> object = CAST(Parameter(Descriptor::kSource)); Return(SetOrSetIteratorToList(context, object)); } TNode<Word32T> CollectionsBuiltinsAssembler::ComputeUnseededHash( TNode<IntPtrT> key) { // See v8::internal::ComputeUnseededHash() TNode<Word32T> hash = TruncateIntPtrToInt32(key); hash = Int32Add(Word32Xor(hash, Int32Constant(0xFFFFFFFF)), Word32Shl(hash, Int32Constant(15))); hash = Word32Xor(hash, Word32Shr(hash, Int32Constant(12))); hash = Int32Add(hash, Word32Shl(hash, Int32Constant(2))); hash = Word32Xor(hash, Word32Shr(hash, Int32Constant(4))); hash = Int32Mul(hash, Int32Constant(2057)); hash = Word32Xor(hash, Word32Shr(hash, Int32Constant(16))); return Word32And(hash, Int32Constant(0x3FFFFFFF)); } template <typename CollectionType> void CollectionsBuiltinsAssembler::FindOrderedHashTableEntryForSmiKey( TNode<CollectionType> table, TNode<Smi> smi_key, TVariable<IntPtrT>* result, Label* entry_found, Label* not_found) { const TNode<IntPtrT> key_untagged = SmiUntag(smi_key); const TNode<IntPtrT> hash = ChangeInt32ToIntPtr(ComputeUnseededHash(key_untagged)); CSA_ASSERT(this, IntPtrGreaterThanOrEqual(hash, IntPtrConstant(0))); *result = hash; FindOrderedHashTableEntry<CollectionType>( table, hash, [&](TNode<Object> other_key, Label* if_same, Label* if_not_same) { SameValueZeroSmi(smi_key, other_key, if_same, if_not_same); }, result, entry_found, not_found); } template <typename CollectionType> void CollectionsBuiltinsAssembler::FindOrderedHashTableEntryForStringKey( TNode<CollectionType> table, TNode<String> key_tagged, TVariable<IntPtrT>* result, Label* entry_found, Label* not_found) { const TNode<IntPtrT> hash = ComputeStringHash(key_tagged); CSA_ASSERT(this, IntPtrGreaterThanOrEqual(hash, IntPtrConstant(0))); *result = hash; FindOrderedHashTableEntry<CollectionType>( table, hash, [&](TNode<Object> other_key, Label* if_same, Label* if_not_same) { SameValueZeroString(key_tagged, other_key, if_same, if_not_same); }, result, entry_found, not_found); } template <typename CollectionType> void CollectionsBuiltinsAssembler::FindOrderedHashTableEntryForHeapNumberKey( TNode<CollectionType> table, TNode<HeapNumber> key_heap_number, TVariable<IntPtrT>* result, Label* entry_found, Label* not_found) { const TNode<IntPtrT> hash = CallGetHashRaw(key_heap_number); CSA_ASSERT(this, IntPtrGreaterThanOrEqual(hash, IntPtrConstant(0))); *result = hash; const TNode<Float64T> key_float = LoadHeapNumberValue(key_heap_number); FindOrderedHashTableEntry<CollectionType>( table, hash, [&](TNode<Object> other_key, Label* if_same, Label* if_not_same) { SameValueZeroHeapNumber(key_float, other_key, if_same, if_not_same); }, result, entry_found, not_found); } template <typename CollectionType> void CollectionsBuiltinsAssembler::FindOrderedHashTableEntryForBigIntKey( TNode<CollectionType> table, TNode<BigInt> key_big_int, TVariable<IntPtrT>* result, Label* entry_found, Label* not_found) { const TNode<IntPtrT> hash = CallGetHashRaw(key_big_int); CSA_ASSERT(this, IntPtrGreaterThanOrEqual(hash, IntPtrConstant(0))); *result = hash; FindOrderedHashTableEntry<CollectionType>( table, hash, [&](TNode<Object> other_key, Label* if_same, Label* if_not_same) { SameValueZeroBigInt(key_big_int, other_key, if_same, if_not_same); }, result, entry_found, not_found); } template <typename CollectionType> void CollectionsBuiltinsAssembler::FindOrderedHashTableEntryForOtherKey( TNode<CollectionType> table, TNode<HeapObject> key_heap_object, TVariable<IntPtrT>* result, Label* entry_found, Label* not_found) { const TNode<IntPtrT> hash = GetHash(key_heap_object); CSA_ASSERT(this, IntPtrGreaterThanOrEqual(hash, IntPtrConstant(0))); *result = hash; FindOrderedHashTableEntry<CollectionType>( table, hash, [&](TNode<Object> other_key, Label* if_same, Label* if_not_same) { Branch(TaggedEqual(key_heap_object, other_key), if_same, if_not_same); }, result, entry_found, not_found); } TNode<IntPtrT> CollectionsBuiltinsAssembler::ComputeStringHash( TNode<String> string_key) { TVARIABLE(IntPtrT, var_result); Label hash_not_computed(this), done(this, &var_result); const TNode<IntPtrT> hash = ChangeInt32ToIntPtr(LoadNameHash(string_key, &hash_not_computed)); var_result = hash; Goto(&done); BIND(&hash_not_computed); var_result = CallGetHashRaw(string_key); Goto(&done); BIND(&done); return var_result.value(); } void CollectionsBuiltinsAssembler::SameValueZeroString( TNode<String> key_string, TNode<Object> candidate_key, Label* if_same, Label* if_not_same) { // If the candidate is not a string, the keys are not equal. GotoIf(TaggedIsSmi(candidate_key), if_not_same); GotoIfNot(IsString(CAST(candidate_key)), if_not_same); Branch(TaggedEqual(CallBuiltin(Builtins::kStringEqual, NoContextConstant(), key_string, candidate_key), TrueConstant()), if_same, if_not_same); } void CollectionsBuiltinsAssembler::SameValueZeroBigInt( TNode<BigInt> key, TNode<Object> candidate_key, Label* if_same, Label* if_not_same) { GotoIf(TaggedIsSmi(candidate_key), if_not_same); GotoIfNot(IsBigInt(CAST(candidate_key)), if_not_same); Branch(TaggedEqual(CallRuntime(Runtime::kBigIntEqualToBigInt, NoContextConstant(), key, candidate_key), TrueConstant()), if_same, if_not_same); } void CollectionsBuiltinsAssembler::SameValueZeroHeapNumber( TNode<Float64T> key_float, TNode<Object> candidate_key, Label* if_same, Label* if_not_same) { Label if_smi(this), if_keyisnan(this); GotoIf(TaggedIsSmi(candidate_key), &if_smi); GotoIfNot(IsHeapNumber(CAST(candidate_key)), if_not_same); { // {candidate_key} is a heap number. const TNode<Float64T> candidate_float = LoadHeapNumberValue(CAST(candidate_key)); GotoIf(Float64Equal(key_float, candidate_float), if_same); // SameValueZero needs to treat NaNs as equal. First check if {key_float} // is NaN. BranchIfFloat64IsNaN(key_float, &if_keyisnan, if_not_same); BIND(&if_keyisnan); { // Return true iff {candidate_key} is NaN. Branch(Float64Equal(candidate_float, candidate_float), if_not_same, if_same); } } BIND(&if_smi); { const TNode<Float64T> candidate_float = SmiToFloat64(CAST(candidate_key)); Branch(Float64Equal(key_float, candidate_float), if_same, if_not_same); } } TF_BUILTIN(OrderedHashTableHealIndex, CollectionsBuiltinsAssembler) { TNode<HeapObject> table = CAST(Parameter(Descriptor::kTable)); TNode<Smi> index = CAST(Parameter(Descriptor::kIndex)); Label return_index(this), return_zero(this); // Check if we need to update the {index}. GotoIfNot(SmiLessThan(SmiConstant(0), index), &return_zero); // Check if the {table} was cleared. STATIC_ASSERT(OrderedHashMap::NumberOfDeletedElementsOffset() == OrderedHashSet::NumberOfDeletedElementsOffset()); TNode<IntPtrT> number_of_deleted_elements = LoadAndUntagObjectField( table, OrderedHashMap::NumberOfDeletedElementsOffset()); STATIC_ASSERT(OrderedHashMap::kClearedTableSentinel == OrderedHashSet::kClearedTableSentinel); GotoIf(IntPtrEqual(number_of_deleted_elements, IntPtrConstant(OrderedHashMap::kClearedTableSentinel)), &return_zero); TVARIABLE(IntPtrT, var_i, IntPtrConstant(0)); TVARIABLE(Smi, var_index, index); Label loop(this, {&var_i, &var_index}); Goto(&loop); BIND(&loop); { TNode<IntPtrT> i = var_i.value(); GotoIfNot(IntPtrLessThan(i, number_of_deleted_elements), &return_index); STATIC_ASSERT(OrderedHashMap::RemovedHolesIndex() == OrderedHashSet::RemovedHolesIndex()); TNode<Smi> removed_index = CAST(LoadFixedArrayElement( CAST(table), i, OrderedHashMap::RemovedHolesIndex() * kTaggedSize)); GotoIf(SmiGreaterThanOrEqual(removed_index, index), &return_index); Decrement(&var_index); Increment(&var_i); Goto(&loop); } BIND(&return_index); Return(var_index.value()); BIND(&return_zero); Return(SmiConstant(0)); } template <typename TableType> std::pair<TNode<TableType>, TNode<IntPtrT>> CollectionsBuiltinsAssembler::Transition( const TNode<TableType> table, const TNode<IntPtrT> index, UpdateInTransition<TableType> const& update_in_transition) { TVARIABLE(IntPtrT, var_index, index); TVARIABLE(TableType, var_table, table); Label if_done(this), if_transition(this, Label::kDeferred); Branch(TaggedIsSmi( LoadObjectField(var_table.value(), TableType::NextTableOffset())), &if_done, &if_transition); BIND(&if_transition); { Label loop(this, {&var_table, &var_index}), done_loop(this); Goto(&loop); BIND(&loop); { TNode<TableType> table = var_table.value(); TNode<IntPtrT> index = var_index.value(); TNode<Object> next_table = LoadObjectField(table, TableType::NextTableOffset()); GotoIf(TaggedIsSmi(next_table), &done_loop); var_table = CAST(next_table); var_index = SmiUntag( CAST(CallBuiltin(Builtins::kOrderedHashTableHealIndex, NoContextConstant(), table, SmiTag(index)))); Goto(&loop); } BIND(&done_loop); // Update with the new {table} and {index}. update_in_transition(var_table.value(), var_index.value()); Goto(&if_done); } BIND(&if_done); return {var_table.value(), var_index.value()}; } template <typename IteratorType, typename TableType> std::pair<TNode<TableType>, TNode<IntPtrT>> CollectionsBuiltinsAssembler::TransitionAndUpdate( const TNode<IteratorType> iterator) { return Transition<TableType>( CAST(LoadObjectField(iterator, IteratorType::kTableOffset)), LoadAndUntagObjectField(iterator, IteratorType::kIndexOffset), [this, iterator](const TNode<TableType> table, const TNode<IntPtrT> index) { // Update the {iterator} with the new state. StoreObjectField(iterator, IteratorType::kTableOffset, table); StoreObjectFieldNoWriteBarrier(iterator, IteratorType::kIndexOffset, SmiTag(index)); }); } template <typename TableType> std::tuple<TNode<Object>, TNode<IntPtrT>, TNode<IntPtrT>> CollectionsBuiltinsAssembler::NextSkipHoles(TNode<TableType> table, TNode<IntPtrT> index, Label* if_end) { // Compute the used capacity for the {table}. TNode<IntPtrT> number_of_buckets = LoadAndUntagObjectField(table, TableType::NumberOfBucketsOffset()); TNode<IntPtrT> number_of_elements = LoadAndUntagObjectField(table, TableType::NumberOfElementsOffset()); TNode<IntPtrT> number_of_deleted_elements = LoadAndUntagObjectField( table, TableType::NumberOfDeletedElementsOffset()); TNode<IntPtrT> used_capacity = IntPtrAdd(number_of_elements, number_of_deleted_elements); TNode<Object> entry_key; TNode<IntPtrT> entry_start_position; TVARIABLE(IntPtrT, var_index, index); Label loop(this, &var_index), done_loop(this); Goto(&loop); BIND(&loop); { GotoIfNot(IntPtrLessThan(var_index.value(), used_capacity), if_end); entry_start_position = IntPtrAdd( IntPtrMul(var_index.value(), IntPtrConstant(TableType::kEntrySize)), number_of_buckets); entry_key = UnsafeLoadFixedArrayElement( table, entry_start_position, TableType::HashTableStartIndex() * kTaggedSize); Increment(&var_index); Branch(IsTheHole(entry_key), &loop, &done_loop); } BIND(&done_loop); return std::tuple<TNode<Object>, TNode<IntPtrT>, TNode<IntPtrT>>{ entry_key, entry_start_position, var_index.value()}; } TF_BUILTIN(MapPrototypeGet, CollectionsBuiltinsAssembler) { const TNode<Object> receiver = CAST(Parameter(Descriptor::kReceiver)); const TNode<Object> key = CAST(Parameter(Descriptor::kKey)); const TNode<Context> context = CAST(Parameter(Descriptor::kContext)); ThrowIfNotInstanceType(context, receiver, JS_MAP_TYPE, "Map.prototype.get"); const TNode<Object> table = LoadObjectField<Object>(CAST(receiver), JSMap::kTableOffset); TNode<Smi> index = CAST( CallBuiltin(Builtins::kFindOrderedHashMapEntry, context, table, key)); Label if_found(this), if_not_found(this); Branch(SmiGreaterThanOrEqual(index, SmiConstant(0)), &if_found, &if_not_found); BIND(&if_found); Return(LoadFixedArrayElement( CAST(table), SmiUntag(index), (OrderedHashMap::HashTableStartIndex() + OrderedHashMap::kValueOffset) * kTaggedSize)); BIND(&if_not_found); Return(UndefinedConstant()); } TF_BUILTIN(MapPrototypeHas, CollectionsBuiltinsAssembler) { const TNode<Object> receiver = CAST(Parameter(Descriptor::kReceiver)); const TNode<Object> key = CAST(Parameter(Descriptor::kKey)); const TNode<Context> context = CAST(Parameter(Descriptor::kContext)); ThrowIfNotInstanceType(context, receiver, JS_MAP_TYPE, "Map.prototype.has"); const TNode<Object> table = LoadObjectField(CAST(receiver), JSMap::kTableOffset); TNode<Smi> index = CAST( CallBuiltin(Builtins::kFindOrderedHashMapEntry, context, table, key)); Label if_found(this), if_not_found(this); Branch(SmiGreaterThanOrEqual(index, SmiConstant(0)), &if_found, &if_not_found); BIND(&if_found); Return(TrueConstant()); BIND(&if_not_found); Return(FalseConstant()); } const TNode<Object> CollectionsBuiltinsAssembler::NormalizeNumberKey( const TNode<Object> key) { TVARIABLE(Object, result, key); Label done(this); GotoIf(TaggedIsSmi(key), &done); GotoIfNot(IsHeapNumber(CAST(key)), &done); const TNode<Float64T> number = LoadHeapNumberValue(CAST(key)); GotoIfNot(Float64Equal(number, Float64Constant(0.0)), &done); // We know the value is zero, so we take the key to be Smi 0. // Another option would be to normalize to Smi here. result = SmiConstant(0); Goto(&done); BIND(&done); return result.value(); } TF_BUILTIN(MapPrototypeSet, CollectionsBuiltinsAssembler) { const TNode<Object> receiver = CAST(Parameter(Descriptor::kReceiver)); TNode<Object> key = CAST(Parameter(Descriptor::kKey)); const TNode<Object> value = CAST(Parameter(Descriptor::kValue)); const TNode<Context> context = CAST(Parameter(Descriptor::kContext)); ThrowIfNotInstanceType(context, receiver, JS_MAP_TYPE, "Map.prototype.set"); key = NormalizeNumberKey(key); const TNode<OrderedHashMap> table = LoadObjectField<OrderedHashMap>(CAST(receiver), JSMap::kTableOffset); TVARIABLE(IntPtrT, entry_start_position_or_hash, IntPtrConstant(0)); Label entry_found(this), not_found(this); TryLookupOrderedHashTableIndex<OrderedHashMap>( table, key, &entry_start_position_or_hash, &entry_found, &not_found); BIND(&entry_found); // If we found the entry, we just store the value there. StoreFixedArrayElement(table, entry_start_position_or_hash.value(), value, UPDATE_WRITE_BARRIER, kTaggedSize * (OrderedHashMap::HashTableStartIndex() + OrderedHashMap::kValueOffset)); Return(receiver); Label no_hash(this), add_entry(this), store_new_entry(this); BIND(&not_found); { // If we have a hash code, we can start adding the new entry. GotoIf(IntPtrGreaterThan(entry_start_position_or_hash.value(), IntPtrConstant(0)), &add_entry); // Otherwise, go to runtime to compute the hash code. entry_start_position_or_hash = SmiUntag(CallGetOrCreateHashRaw(CAST(key))); Goto(&add_entry); } BIND(&add_entry); TVARIABLE(IntPtrT, number_of_buckets); TVARIABLE(IntPtrT, occupancy); TVARIABLE(OrderedHashMap, table_var, table); { // Check we have enough space for the entry. number_of_buckets = SmiUntag(CAST(UnsafeLoadFixedArrayElement( table, OrderedHashMap::NumberOfBucketsIndex()))); STATIC_ASSERT(OrderedHashMap::kLoadFactor == 2); const TNode<WordT> capacity = WordShl(number_of_buckets.value(), 1); const TNode<IntPtrT> number_of_elements = SmiUntag( CAST(LoadObjectField(table, OrderedHashMap::NumberOfElementsOffset()))); const TNode<IntPtrT> number_of_deleted = SmiUntag(CAST(LoadObjectField( table, OrderedHashMap::NumberOfDeletedElementsOffset()))); occupancy = IntPtrAdd(number_of_elements, number_of_deleted); GotoIf(IntPtrLessThan(occupancy.value(), capacity), &store_new_entry); // We do not have enough space, grow the table and reload the relevant // fields. CallRuntime(Runtime::kMapGrow, context, receiver); table_var = LoadObjectField<OrderedHashMap>(CAST(receiver), JSMap::kTableOffset); number_of_buckets = SmiUntag(CAST(UnsafeLoadFixedArrayElement( table_var.value(), OrderedHashMap::NumberOfBucketsIndex()))); const TNode<IntPtrT> new_number_of_elements = SmiUntag(CAST(LoadObjectField( table_var.value(), OrderedHashMap::NumberOfElementsOffset()))); const TNode<IntPtrT> new_number_of_deleted = SmiUntag(CAST(LoadObjectField( table_var.value(), OrderedHashMap::NumberOfDeletedElementsOffset()))); occupancy = IntPtrAdd(new_number_of_elements, new_number_of_deleted); Goto(&store_new_entry); } BIND(&store_new_entry); // Store the key, value and connect the element to the bucket chain. StoreOrderedHashMapNewEntry(table_var.value(), key, value, entry_start_position_or_hash.value(), number_of_buckets.value(), occupancy.value()); Return(receiver); } void CollectionsBuiltinsAssembler::StoreOrderedHashMapNewEntry( const TNode<OrderedHashMap> table, const TNode<Object> key, const TNode<Object> value, const TNode<IntPtrT> hash, const TNode<IntPtrT> number_of_buckets, const TNode<IntPtrT> occupancy) { const TNode<IntPtrT> bucket = WordAnd(hash, IntPtrSub(number_of_buckets, IntPtrConstant(1))); TNode<Smi> bucket_entry = CAST(UnsafeLoadFixedArrayElement( table, bucket, OrderedHashMap::HashTableStartIndex() * kTaggedSize)); // Store the entry elements. const TNode<IntPtrT> entry_start = IntPtrAdd( IntPtrMul(occupancy, IntPtrConstant(OrderedHashMap::kEntrySize)), number_of_buckets); UnsafeStoreFixedArrayElement( table, entry_start, key, UPDATE_WRITE_BARRIER, kTaggedSize * OrderedHashMap::HashTableStartIndex()); UnsafeStoreFixedArrayElement( table, entry_start, value, UPDATE_WRITE_BARRIER, kTaggedSize * (OrderedHashMap::HashTableStartIndex() + OrderedHashMap::kValueOffset)); UnsafeStoreFixedArrayElement( table, entry_start, bucket_entry, SKIP_WRITE_BARRIER, kTaggedSize * (OrderedHashMap::HashTableStartIndex() + OrderedHashMap::kChainOffset)); // Update the bucket head. UnsafeStoreFixedArrayElement( table, bucket, SmiTag(occupancy), SKIP_WRITE_BARRIER, OrderedHashMap::HashTableStartIndex() * kTaggedSize); // Bump the elements count. const TNode<Smi> number_of_elements = CAST(LoadObjectField(table, OrderedHashMap::NumberOfElementsOffset())); StoreObjectFieldNoWriteBarrier(table, OrderedHashMap::NumberOfElementsOffset(), SmiAdd(number_of_elements, SmiConstant(1))); } TF_BUILTIN(MapPrototypeDelete, CollectionsBuiltinsAssembler) { const TNode<Object> receiver = CAST(Parameter(Descriptor::kReceiver)); const TNode<Object> key = CAST(Parameter(Descriptor::kKey)); const TNode<Context> context = CAST(Parameter(Descriptor::kContext)); ThrowIfNotInstanceType(context, receiver, JS_MAP_TYPE, "Map.prototype.delete"); const TNode<OrderedHashMap> table = LoadObjectField<OrderedHashMap>(CAST(receiver), JSMap::kTableOffset); TVARIABLE(IntPtrT, entry_start_position_or_hash, IntPtrConstant(0)); Label entry_found(this), not_found(this); TryLookupOrderedHashTableIndex<OrderedHashMap>( table, key, &entry_start_position_or_hash, &entry_found, &not_found); BIND(&not_found); Return(FalseConstant()); BIND(&entry_found); // If we found the entry, mark the entry as deleted. StoreFixedArrayElement(table, entry_start_position_or_hash.value(), TheHoleConstant(), UPDATE_WRITE_BARRIER, kTaggedSize * OrderedHashMap::HashTableStartIndex()); StoreFixedArrayElement(table, entry_start_position_or_hash.value(), TheHoleConstant(), UPDATE_WRITE_BARRIER, kTaggedSize * (OrderedHashMap::HashTableStartIndex() + OrderedHashMap::kValueOffset)); // Decrement the number of elements, increment the number of deleted elements. const TNode<Smi> number_of_elements = SmiSub( CAST(LoadObjectField(table, OrderedHashMap::NumberOfElementsOffset())), SmiConstant(1)); StoreObjectFieldNoWriteBarrier( table, OrderedHashMap::NumberOfElementsOffset(), number_of_elements); const TNode<Smi> number_of_deleted = SmiAdd(CAST(LoadObjectField( table, OrderedHashMap::NumberOfDeletedElementsOffset())), SmiConstant(1)); StoreObjectFieldNoWriteBarrier( table, OrderedHashMap::NumberOfDeletedElementsOffset(), number_of_deleted); const TNode<Smi> number_of_buckets = CAST( LoadFixedArrayElement(table, OrderedHashMap::NumberOfBucketsIndex())); // If there fewer elements than #buckets / 2, shrink the table. Label shrink(this); GotoIf(SmiLessThan(SmiAdd(number_of_elements, number_of_elements), number_of_buckets), &shrink); Return(TrueConstant()); BIND(&shrink); CallRuntime(Runtime::kMapShrink, context, receiver); Return(TrueConstant()); } TF_BUILTIN(SetPrototypeAdd, CollectionsBuiltinsAssembler) { const TNode<Object> receiver = CAST(Parameter(Descriptor::kReceiver)); TNode<Object> key = CAST(Parameter(Descriptor::kKey)); const TNode<Context> context = CAST(Parameter(Descriptor::kContext)); ThrowIfNotInstanceType(context, receiver, JS_SET_TYPE, "Set.prototype.add"); key = NormalizeNumberKey(key); const TNode<OrderedHashSet> table = LoadObjectField<OrderedHashSet>(CAST(receiver), JSMap::kTableOffset); TVARIABLE(IntPtrT, entry_start_position_or_hash, IntPtrConstant(0)); Label entry_found(this), not_found(this); TryLookupOrderedHashTableIndex<OrderedHashSet>( table, key, &entry_start_position_or_hash, &entry_found, &not_found); BIND(&entry_found); // The entry was found, there is nothing to do. Return(receiver); Label no_hash(this), add_entry(this), store_new_entry(this); BIND(&not_found); { // If we have a hash code, we can start adding the new entry. GotoIf(IntPtrGreaterThan(entry_start_position_or_hash.value(), IntPtrConstant(0)), &add_entry); // Otherwise, go to runtime to compute the hash code. entry_start_position_or_hash = SmiUntag(CallGetOrCreateHashRaw(CAST(key))); Goto(&add_entry); } BIND(&add_entry); TVARIABLE(IntPtrT, number_of_buckets); TVARIABLE(IntPtrT, occupancy); TVARIABLE(OrderedHashSet, table_var, table); { // Check we have enough space for the entry. number_of_buckets = SmiUntag(CAST(UnsafeLoadFixedArrayElement( table, OrderedHashSet::NumberOfBucketsIndex()))); STATIC_ASSERT(OrderedHashSet::kLoadFactor == 2); const TNode<WordT> capacity = WordShl(number_of_buckets.value(), 1); const TNode<IntPtrT> number_of_elements = SmiUntag( CAST(LoadObjectField(table, OrderedHashSet::NumberOfElementsOffset()))); const TNode<IntPtrT> number_of_deleted = SmiUntag(CAST(LoadObjectField( table, OrderedHashSet::NumberOfDeletedElementsOffset()))); occupancy = IntPtrAdd(number_of_elements, number_of_deleted); GotoIf(IntPtrLessThan(occupancy.value(), capacity), &store_new_entry); // We do not have enough space, grow the table and reload the relevant // fields. CallRuntime(Runtime::kSetGrow, context, receiver); table_var = LoadObjectField<OrderedHashSet>(CAST(receiver), JSMap::kTableOffset); number_of_buckets = SmiUntag(CAST(UnsafeLoadFixedArrayElement( table_var.value(), OrderedHashSet::NumberOfBucketsIndex()))); const TNode<IntPtrT> new_number_of_elements = SmiUntag(CAST(LoadObjectField( table_var.value(), OrderedHashSet::NumberOfElementsOffset()))); const TNode<IntPtrT> new_number_of_deleted = SmiUntag(CAST(LoadObjectField( table_var.value(), OrderedHashSet::NumberOfDeletedElementsOffset()))); occupancy = IntPtrAdd(new_number_of_elements, new_number_of_deleted); Goto(&store_new_entry); } BIND(&store_new_entry); // Store the key, value and connect the element to the bucket chain. StoreOrderedHashSetNewEntry(table_var.value(), key, entry_start_position_or_hash.value(), number_of_buckets.value(), occupancy.value()); Return(receiver); } void CollectionsBuiltinsAssembler::StoreOrderedHashSetNewEntry( const TNode<OrderedHashSet> table, const TNode<Object> key, const TNode<IntPtrT> hash, const TNode<IntPtrT> number_of_buckets, const TNode<IntPtrT> occupancy) { const TNode<IntPtrT> bucket = WordAnd(hash, IntPtrSub(number_of_buckets, IntPtrConstant(1))); TNode<Smi> bucket_entry = CAST(UnsafeLoadFixedArrayElement( table, bucket, OrderedHashSet::HashTableStartIndex() * kTaggedSize)); // Store the entry elements. const TNode<IntPtrT> entry_start = IntPtrAdd( IntPtrMul(occupancy, IntPtrConstant(OrderedHashSet::kEntrySize)), number_of_buckets); UnsafeStoreFixedArrayElement( table, entry_start, key, UPDATE_WRITE_BARRIER, kTaggedSize * OrderedHashSet::HashTableStartIndex()); UnsafeStoreFixedArrayElement( table, entry_start, bucket_entry, SKIP_WRITE_BARRIER, kTaggedSize * (OrderedHashSet::HashTableStartIndex() + OrderedHashSet::kChainOffset)); // Update the bucket head. UnsafeStoreFixedArrayElement( table, bucket, SmiTag(occupancy), SKIP_WRITE_BARRIER, OrderedHashSet::HashTableStartIndex() * kTaggedSize); // Bump the elements count. const TNode<Smi> number_of_elements = CAST(LoadObjectField(table, OrderedHashSet::NumberOfElementsOffset())); StoreObjectFieldNoWriteBarrier(table, OrderedHashSet::NumberOfElementsOffset(), SmiAdd(number_of_elements, SmiConstant(1))); } TF_BUILTIN(SetPrototypeDelete, CollectionsBuiltinsAssembler) { const TNode<Object> receiver = CAST(Parameter(Descriptor::kReceiver)); const TNode<Object> key = CAST(Parameter(Descriptor::kKey)); const TNode<Context> context = CAST(Parameter(Descriptor::kContext)); ThrowIfNotInstanceType(context, receiver, JS_SET_TYPE, "Set.prototype.delete"); const TNode<OrderedHashSet> table = LoadObjectField<OrderedHashSet>(CAST(receiver), JSMap::kTableOffset); TVARIABLE(IntPtrT, entry_start_position_or_hash, IntPtrConstant(0)); Label entry_found(this), not_found(this); TryLookupOrderedHashTableIndex<OrderedHashSet>( table, key, &entry_start_position_or_hash, &entry_found, &not_found); BIND(&not_found); Return(FalseConstant()); BIND(&entry_found); // If we found the entry, mark the entry as deleted. StoreFixedArrayElement(table, entry_start_position_or_hash.value(), TheHoleConstant(), UPDATE_WRITE_BARRIER, kTaggedSize * OrderedHashSet::HashTableStartIndex()); // Decrement the number of elements, increment the number of deleted elements. const TNode<Smi> number_of_elements = SmiSub( CAST(LoadObjectField(table, OrderedHashSet::NumberOfElementsOffset())), SmiConstant(1)); StoreObjectFieldNoWriteBarrier( table, OrderedHashSet::NumberOfElementsOffset(), number_of_elements); const TNode<Smi> number_of_deleted = SmiAdd(CAST(LoadObjectField( table, OrderedHashSet::NumberOfDeletedElementsOffset())), SmiConstant(1)); StoreObjectFieldNoWriteBarrier( table, OrderedHashSet::NumberOfDeletedElementsOffset(), number_of_deleted); const TNode<Smi> number_of_buckets = CAST( LoadFixedArrayElement(table, OrderedHashSet::NumberOfBucketsIndex())); // If there fewer elements than #buckets / 2, shrink the table. Label shrink(this); GotoIf(SmiLessThan(SmiAdd(number_of_elements, number_of_elements), number_of_buckets), &shrink); Return(TrueConstant()); BIND(&shrink); CallRuntime(Runtime::kSetShrink, context, receiver); Return(TrueConstant()); } TF_BUILTIN(MapPrototypeEntries, CollectionsBuiltinsAssembler) { const TNode<Object> receiver = CAST(Parameter(Descriptor::kReceiver)); const TNode<Context> context = CAST(Parameter(Descriptor::kContext)); ThrowIfNotInstanceType(context, receiver, JS_MAP_TYPE, "Map.prototype.entries"); Return(AllocateJSCollectionIterator<JSMapIterator>( context, Context::MAP_KEY_VALUE_ITERATOR_MAP_INDEX, CAST(receiver))); } TF_BUILTIN(MapPrototypeGetSize, CollectionsBuiltinsAssembler) { const TNode<Object> receiver = CAST(Parameter(Descriptor::kReceiver)); const TNode<Context> context = CAST(Parameter(Descriptor::kContext)); ThrowIfNotInstanceType(context, receiver, JS_MAP_TYPE, "get Map.prototype.size"); const TNode<OrderedHashMap> table = LoadObjectField<OrderedHashMap>(CAST(receiver), JSMap::kTableOffset); Return(LoadObjectField(table, OrderedHashMap::NumberOfElementsOffset())); } TF_BUILTIN(MapPrototypeForEach, CollectionsBuiltinsAssembler) { const char* const kMethodName = "Map.prototype.forEach"; TNode<Int32T> argc = UncheckedCast<Int32T>(Parameter(Descriptor::kJSActualArgumentsCount)); const TNode<Context> context = CAST(Parameter(Descriptor::kContext)); CodeStubArguments args(this, argc); const TNode<Object> receiver = args.GetReceiver(); const TNode<Object> callback = args.GetOptionalArgumentValue(0); const TNode<Object> this_arg = args.GetOptionalArgumentValue(1); ThrowIfNotInstanceType(context, receiver, JS_MAP_TYPE, kMethodName); // Ensure that {callback} is actually callable. Label callback_not_callable(this, Label::kDeferred); GotoIf(TaggedIsSmi(callback), &callback_not_callable); GotoIfNot(IsCallable(CAST(callback)), &callback_not_callable); TVARIABLE(IntPtrT, var_index, IntPtrConstant(0)); TVARIABLE(OrderedHashMap, var_table, CAST(LoadObjectField(CAST(receiver), JSMap::kTableOffset))); Label loop(this, {&var_index, &var_table}), done_loop(this); Goto(&loop); BIND(&loop); { // Transition {table} and {index} if there was any modification to // the {receiver} while we're iterating. TNode<IntPtrT> index = var_index.value(); TNode<OrderedHashMap> table = var_table.value(); std::tie(table, index) = Transition<OrderedHashMap>( table, index, [](const TNode<OrderedHashMap>, const TNode<IntPtrT>) {}); // Read the next entry from the {table}, skipping holes. TNode<Object> entry_key; TNode<IntPtrT> entry_start_position; std::tie(entry_key, entry_start_position, index) = NextSkipHoles<OrderedHashMap>(table, index, &done_loop); // Load the entry value as well. TNode<Object> entry_value = LoadFixedArrayElement( table, entry_start_position, (OrderedHashMap::HashTableStartIndex() + OrderedHashMap::kValueOffset) * kTaggedSize); // Invoke the {callback} passing the {entry_key}, {entry_value} and the // {receiver}. Call(context, callback, this_arg, entry_value, entry_key, receiver); // Continue with the next entry. var_index = index; var_table = table; Goto(&loop); } BIND(&done_loop); args.PopAndReturn(UndefinedConstant()); BIND(&callback_not_callable); { CallRuntime(Runtime::kThrowCalledNonCallable, context, callback); Unreachable(); } } TF_BUILTIN(MapPrototypeKeys, CollectionsBuiltinsAssembler) { const TNode<Object> receiver = CAST(Parameter(Descriptor::kReceiver)); const TNode<Context> context = CAST(Parameter(Descriptor::kContext)); ThrowIfNotInstanceType(context, receiver, JS_MAP_TYPE, "Map.prototype.keys"); Return(AllocateJSCollectionIterator<JSMapIterator>( context, Context::MAP_KEY_ITERATOR_MAP_INDEX, CAST(receiver))); } TF_BUILTIN(MapPrototypeValues, CollectionsBuiltinsAssembler) { const TNode<Object> receiver = CAST(Parameter(Descriptor::kReceiver)); const TNode<Context> context = CAST(Parameter(Descriptor::kContext)); ThrowIfNotInstanceType(context, receiver, JS_MAP_TYPE, "Map.prototype.values"); Return(AllocateJSCollectionIterator<JSMapIterator>( context, Context::MAP_VALUE_ITERATOR_MAP_INDEX, CAST(receiver))); } TF_BUILTIN(MapIteratorPrototypeNext, CollectionsBuiltinsAssembler) { const char* const kMethodName = "Map Iterator.prototype.next"; const TNode<Object> maybe_receiver = CAST(Parameter(Descriptor::kReceiver)); const TNode<Context> context = CAST(Parameter(Descriptor::kContext)); // Ensure that {maybe_receiver} is actually a JSMapIterator. Label if_receiver_valid(this), if_receiver_invalid(this, Label::kDeferred); GotoIf(TaggedIsSmi(maybe_receiver), &if_receiver_invalid); const TNode<Uint16T> receiver_instance_type = LoadInstanceType(CAST(maybe_receiver)); GotoIf( InstanceTypeEqual(receiver_instance_type, JS_MAP_KEY_VALUE_ITERATOR_TYPE), &if_receiver_valid); GotoIf(InstanceTypeEqual(receiver_instance_type, JS_MAP_KEY_ITERATOR_TYPE), &if_receiver_valid); Branch(InstanceTypeEqual(receiver_instance_type, JS_MAP_VALUE_ITERATOR_TYPE), &if_receiver_valid, &if_receiver_invalid); BIND(&if_receiver_invalid); ThrowTypeError(context, MessageTemplate::kIncompatibleMethodReceiver, StringConstant(kMethodName), maybe_receiver); BIND(&if_receiver_valid); TNode<JSMapIterator> receiver = CAST(maybe_receiver); // Check if the {receiver} is exhausted. TVARIABLE(Oddball, var_done, TrueConstant()); TVARIABLE(Object, var_value, UndefinedConstant()); Label return_value(this, {&var_done, &var_value}), return_entry(this), return_end(this, Label::kDeferred); // Transition the {receiver} table if necessary. TNode<OrderedHashMap> table; TNode<IntPtrT> index; std::tie(table, index) = TransitionAndUpdate<JSMapIterator, OrderedHashMap>(receiver); // Read the next entry from the {table}, skipping holes. TNode<Object> entry_key; TNode<IntPtrT> entry_start_position; std::tie(entry_key, entry_start_position, index) = NextSkipHoles<OrderedHashMap>(table, index, &return_end); StoreObjectFieldNoWriteBarrier(receiver, JSMapIterator::kIndexOffset, SmiTag(index)); var_value = entry_key; var_done = FalseConstant(); // Check how to return the {key} (depending on {receiver} type). GotoIf(InstanceTypeEqual(receiver_instance_type, JS_MAP_KEY_ITERATOR_TYPE), &return_value); var_value = LoadFixedArrayElement( table, entry_start_position, (OrderedHashMap::HashTableStartIndex() + OrderedHashMap::kValueOffset) * kTaggedSize); Branch(InstanceTypeEqual(receiver_instance_type, JS_MAP_VALUE_ITERATOR_TYPE), &return_value, &return_entry); BIND(&return_entry); { TNode<JSObject> result = AllocateJSIteratorResultForEntry(context, entry_key, var_value.value()); Return(result); } BIND(&return_value); { TNode<JSObject> result = AllocateJSIteratorResult(context, var_value.value(), var_done.value()); Return(result); } BIND(&return_end); { StoreObjectFieldRoot(receiver, JSMapIterator::kTableOffset, RootIndex::kEmptyOrderedHashMap); Goto(&return_value); } } TF_BUILTIN(SetPrototypeHas, CollectionsBuiltinsAssembler) { const TNode<Object> receiver = CAST(Parameter(Descriptor::kReceiver)); const TNode<Object> key = CAST(Parameter(Descriptor::kKey)); const TNode<Context> context = CAST(Parameter(Descriptor::kContext)); ThrowIfNotInstanceType(context, receiver, JS_SET_TYPE, "Set.prototype.has"); const TNode<Object> table = LoadObjectField(CAST(receiver), JSMap::kTableOffset); TVARIABLE(IntPtrT, entry_start_position, IntPtrConstant(0)); Label if_key_smi(this), if_key_string(this), if_key_heap_number(this), if_key_bigint(this), entry_found(this), not_found(this), done(this); GotoIf(TaggedIsSmi(key), &if_key_smi); TNode<Map> key_map = LoadMap(CAST(key)); TNode<Uint16T> key_instance_type = LoadMapInstanceType(key_map); GotoIf(IsStringInstanceType(key_instance_type), &if_key_string); GotoIf(IsHeapNumberMap(key_map), &if_key_heap_number); GotoIf(IsBigIntInstanceType(key_instance_type), &if_key_bigint); FindOrderedHashTableEntryForOtherKey<OrderedHashSet>( CAST(table), CAST(key), &entry_start_position, &entry_found, &not_found); BIND(&if_key_smi); { FindOrderedHashTableEntryForSmiKey<OrderedHashSet>( CAST(table), CAST(key), &entry_start_position, &entry_found, &not_found); } BIND(&if_key_string); { FindOrderedHashTableEntryForStringKey<OrderedHashSet>( CAST(table), CAST(key), &entry_start_position, &entry_found, &not_found); } BIND(&if_key_heap_number); { FindOrderedHashTableEntryForHeapNumberKey<OrderedHashSet>( CAST(table), CAST(key), &entry_start_position, &entry_found, &not_found); } BIND(&if_key_bigint); { FindOrderedHashTableEntryForBigIntKey<OrderedHashSet>( CAST(table), CAST(key), &entry_start_position, &entry_found, &not_found); } BIND(&entry_found); Return(TrueConstant()); BIND(&not_found); Return(FalseConstant()); } TF_BUILTIN(SetPrototypeEntries, CollectionsBuiltinsAssembler) { const TNode<Object> receiver = CAST(Parameter(Descriptor::kReceiver)); const TNode<Context> context = CAST(Parameter(Descriptor::kContext)); ThrowIfNotInstanceType(context, receiver, JS_SET_TYPE, "Set.prototype.entries"); Return(AllocateJSCollectionIterator<JSSetIterator>( context, Context::SET_KEY_VALUE_ITERATOR_MAP_INDEX, CAST(receiver))); } TF_BUILTIN(SetPrototypeGetSize, CollectionsBuiltinsAssembler) { const TNode<Object> receiver = CAST(Parameter(Descriptor::kReceiver)); const TNode<Context> context = CAST(Parameter(Descriptor::kContext)); ThrowIfNotInstanceType(context, receiver, JS_SET_TYPE, "get Set.prototype.size"); const TNode<OrderedHashSet> table = LoadObjectField<OrderedHashSet>(CAST(receiver), JSSet::kTableOffset); Return(LoadObjectField(table, OrderedHashSet::NumberOfElementsOffset())); } TF_BUILTIN(SetPrototypeForEach, CollectionsBuiltinsAssembler) { const char* const kMethodName = "Set.prototype.forEach"; TNode<Int32T> argc = UncheckedCast<Int32T>(Parameter(Descriptor::kJSActualArgumentsCount)); const TNode<Context> context = CAST(Parameter(Descriptor::kContext)); CodeStubArguments args(this, argc); const TNode<Object> receiver = args.GetReceiver(); const TNode<Object> callback = args.GetOptionalArgumentValue(0); const TNode<Object> this_arg = args.GetOptionalArgumentValue(1); ThrowIfNotInstanceType(context, receiver, JS_SET_TYPE, kMethodName); // Ensure that {callback} is actually callable. Label callback_not_callable(this, Label::kDeferred); GotoIf(TaggedIsSmi(callback), &callback_not_callable); GotoIfNot(IsCallable(CAST(callback)), &callback_not_callable); TVARIABLE(IntPtrT, var_index, IntPtrConstant(0)); TVARIABLE(OrderedHashSet, var_table, CAST(LoadObjectField(CAST(receiver), JSSet::kTableOffset))); Label loop(this, {&var_index, &var_table}), done_loop(this); Goto(&loop); BIND(&loop); { // Transition {table} and {index} if there was any modification to // the {receiver} while we're iterating. TNode<IntPtrT> index = var_index.value(); TNode<OrderedHashSet> table = var_table.value(); std::tie(table, index) = Transition<OrderedHashSet>( table, index, [](const TNode<OrderedHashSet>, const TNode<IntPtrT>) {}); // Read the next entry from the {table}, skipping holes. TNode<Object> entry_key; TNode<IntPtrT> entry_start_position; std::tie(entry_key, entry_start_position, index) = NextSkipHoles<OrderedHashSet>(table, index, &done_loop); // Invoke the {callback} passing the {entry_key} (twice) and the {receiver}. Call(context, callback, this_arg, entry_key, entry_key, receiver); // Continue with the next entry. var_index = index; var_table = table; Goto(&loop); } BIND(&done_loop); args.PopAndReturn(UndefinedConstant()); BIND(&callback_not_callable); { CallRuntime(Runtime::kThrowCalledNonCallable, context, callback); Unreachable(); } } TF_BUILTIN(SetPrototypeValues, CollectionsBuiltinsAssembler) { const TNode<Object> receiver = CAST(Parameter(Descriptor::kReceiver)); const TNode<Context> context = CAST(Parameter(Descriptor::kContext)); ThrowIfNotInstanceType(context, receiver, JS_SET_TYPE, "Set.prototype.values"); Return(AllocateJSCollectionIterator<JSSetIterator>( context, Context::SET_VALUE_ITERATOR_MAP_INDEX, CAST(receiver))); } TF_BUILTIN(SetIteratorPrototypeNext, CollectionsBuiltinsAssembler) { const char* const kMethodName = "Set Iterator.prototype.next"; const TNode<Object> maybe_receiver = CAST(Parameter(Descriptor::kReceiver)); const TNode<Context> context = CAST(Parameter(Descriptor::kContext)); // Ensure that {maybe_receiver} is actually a JSSetIterator. Label if_receiver_valid(this), if_receiver_invalid(this, Label::kDeferred); GotoIf(TaggedIsSmi(maybe_receiver), &if_receiver_invalid); const TNode<Uint16T> receiver_instance_type = LoadInstanceType(CAST(maybe_receiver)); GotoIf(InstanceTypeEqual(receiver_instance_type, JS_SET_VALUE_ITERATOR_TYPE), &if_receiver_valid); Branch( InstanceTypeEqual(receiver_instance_type, JS_SET_KEY_VALUE_ITERATOR_TYPE), &if_receiver_valid, &if_receiver_invalid); BIND(&if_receiver_invalid); ThrowTypeError(context, MessageTemplate::kIncompatibleMethodReceiver, StringConstant(kMethodName), maybe_receiver); BIND(&if_receiver_valid); TNode<JSSetIterator> receiver = CAST(maybe_receiver); // Check if the {receiver} is exhausted. TVARIABLE(Oddball, var_done, TrueConstant()); TVARIABLE(Object, var_value, UndefinedConstant()); Label return_value(this, {&var_done, &var_value}), return_entry(this), return_end(this, Label::kDeferred); // Transition the {receiver} table if necessary. TNode<OrderedHashSet> table; TNode<IntPtrT> index; std::tie(table, index) = TransitionAndUpdate<JSSetIterator, OrderedHashSet>(receiver); // Read the next entry from the {table}, skipping holes. TNode<Object> entry_key; TNode<IntPtrT> entry_start_position; std::tie(entry_key, entry_start_position, index) = NextSkipHoles<OrderedHashSet>(table, index, &return_end); StoreObjectFieldNoWriteBarrier(receiver, JSSetIterator::kIndexOffset, SmiTag(index)); var_value = entry_key; var_done = FalseConstant(); // Check how to return the {key} (depending on {receiver} type). Branch(InstanceTypeEqual(receiver_instance_type, JS_SET_VALUE_ITERATOR_TYPE), &return_value, &return_entry); BIND(&return_entry); { TNode<JSObject> result = AllocateJSIteratorResultForEntry( context, var_value.value(), var_value.value()); Return(result); } BIND(&return_value); { TNode<JSObject> result = AllocateJSIteratorResult(context, var_value.value(), var_done.value()); Return(result); } BIND(&return_end); { StoreObjectFieldRoot(receiver, JSSetIterator::kTableOffset, RootIndex::kEmptyOrderedHashSet); Goto(&return_value); } } template <typename CollectionType> void CollectionsBuiltinsAssembler::TryLookupOrderedHashTableIndex( const TNode<CollectionType> table, const TNode<Object> key, TVariable<IntPtrT>* result, Label* if_entry_found, Label* if_not_found) { Label if_key_smi(this), if_key_string(this), if_key_heap_number(this), if_key_bigint(this); GotoIf(TaggedIsSmi(key), &if_key_smi); TNode<Map> key_map = LoadMap(CAST(key)); TNode<Uint16T> key_instance_type = LoadMapInstanceType(key_map); GotoIf(IsStringInstanceType(key_instance_type), &if_key_string); GotoIf(IsHeapNumberMap(key_map), &if_key_heap_number); GotoIf(IsBigIntInstanceType(key_instance_type), &if_key_bigint); FindOrderedHashTableEntryForOtherKey<CollectionType>( table, CAST(key), result, if_entry_found, if_not_found); BIND(&if_key_smi); { FindOrderedHashTableEntryForSmiKey<CollectionType>( table, CAST(key), result, if_entry_found, if_not_found); } BIND(&if_key_string); { FindOrderedHashTableEntryForStringKey<CollectionType>( table, CAST(key), result, if_entry_found, if_not_found); } BIND(&if_key_heap_number); { FindOrderedHashTableEntryForHeapNumberKey<CollectionType>( table, CAST(key), result, if_entry_found, if_not_found); } BIND(&if_key_bigint); { FindOrderedHashTableEntryForBigIntKey<CollectionType>( table, CAST(key), result, if_entry_found, if_not_found); } } TF_BUILTIN(FindOrderedHashMapEntry, CollectionsBuiltinsAssembler) { const TNode<OrderedHashMap> table = CAST(Parameter(Descriptor::kTable)); const TNode<Object> key = CAST(Parameter(Descriptor::kKey)); TVARIABLE(IntPtrT, entry_start_position, IntPtrConstant(0)); Label entry_found(this), not_found(this); TryLookupOrderedHashTableIndex<OrderedHashMap>( table, key, &entry_start_position, &entry_found, &not_found); BIND(&entry_found); Return(SmiTag(entry_start_position.value())); BIND(&not_found); Return(SmiConstant(-1)); } class WeakCollectionsBuiltinsAssembler : public BaseCollectionsAssembler { public: explicit WeakCollectionsBuiltinsAssembler(compiler::CodeAssemblerState* state) : BaseCollectionsAssembler(state) {} protected: void AddEntry(TNode<EphemeronHashTable> table, TNode<IntPtrT> key_index, TNode<Object> key, TNode<Object> value, TNode<IntPtrT> number_of_elements); TNode<HeapObject> AllocateTable(Variant variant, TNode<IntPtrT> at_least_space_for) override; // Generates and sets the identity for a JSRececiver. TNode<Smi> CreateIdentityHash(TNode<Object> receiver); TNode<IntPtrT> EntryMask(TNode<IntPtrT> capacity); // Builds code that finds the EphemeronHashTable entry for a {key} using the // comparison code generated by {key_compare}. The key index is returned if // the {key} is found. using KeyComparator = std::function<void(TNode<Object> entry_key, Label* if_same)>; TNode<IntPtrT> FindKeyIndex(TNode<HeapObject> table, TNode<IntPtrT> key_hash, TNode<IntPtrT> entry_mask, const KeyComparator& key_compare); // Builds code that finds an EphemeronHashTable entry available for a new // entry. TNode<IntPtrT> FindKeyIndexForInsertion(TNode<HeapObject> table, TNode<IntPtrT> key_hash, TNode<IntPtrT> entry_mask); // Builds code that finds the EphemeronHashTable entry with key that matches // {key} and returns the entry's key index. If {key} cannot be found, jumps to // {if_not_found}. TNode<IntPtrT> FindKeyIndexForKey(TNode<HeapObject> table, TNode<Object> key, TNode<IntPtrT> hash, TNode<IntPtrT> entry_mask, Label* if_not_found); TNode<Word32T> InsufficientCapacityToAdd(TNode<IntPtrT> capacity, TNode<IntPtrT> number_of_elements, TNode<IntPtrT> number_of_deleted); TNode<IntPtrT> KeyIndexFromEntry(TNode<IntPtrT> entry); TNode<IntPtrT> LoadNumberOfElements(TNode<EphemeronHashTable> table, int offset); TNode<IntPtrT> LoadNumberOfDeleted(TNode<EphemeronHashTable> table, int offset = 0); TNode<EphemeronHashTable> LoadTable(TNode<JSWeakCollection> collection); TNode<IntPtrT> LoadTableCapacity(TNode<EphemeronHashTable> table); void RemoveEntry(TNode<EphemeronHashTable> table, TNode<IntPtrT> key_index, TNode<IntPtrT> number_of_elements); TNode<BoolT> ShouldRehash(TNode<IntPtrT> number_of_elements, TNode<IntPtrT> number_of_deleted); TNode<Word32T> ShouldShrink(TNode<IntPtrT> capacity, TNode<IntPtrT> number_of_elements); TNode<IntPtrT> ValueIndexFromKeyIndex(TNode<IntPtrT> key_index); }; void WeakCollectionsBuiltinsAssembler::AddEntry( TNode<EphemeronHashTable> table, TNode<IntPtrT> key_index, TNode<Object> key, TNode<Object> value, TNode<IntPtrT> number_of_elements) { // See EphemeronHashTable::AddEntry(). TNode<IntPtrT> value_index = ValueIndexFromKeyIndex(key_index); UnsafeStoreFixedArrayElement(table, key_index, key, UPDATE_EPHEMERON_KEY_WRITE_BARRIER); UnsafeStoreFixedArrayElement(table, value_index, value); // See HashTableBase::ElementAdded(). UnsafeStoreFixedArrayElement( table, EphemeronHashTable::kNumberOfElementsIndex, SmiFromIntPtr(number_of_elements), SKIP_WRITE_BARRIER); } TNode<HeapObject> WeakCollectionsBuiltinsAssembler::AllocateTable( Variant variant, TNode<IntPtrT> at_least_space_for) { // See HashTable::New(). CSA_ASSERT(this, IntPtrLessThanOrEqual(IntPtrConstant(0), at_least_space_for)); TNode<IntPtrT> capacity = HashTableComputeCapacity(at_least_space_for); // See HashTable::NewInternal(). TNode<IntPtrT> length = KeyIndexFromEntry(capacity); TNode<FixedArray> table = CAST( AllocateFixedArray(HOLEY_ELEMENTS, length, kAllowLargeObjectAllocation)); TNode<Map> map = HeapConstant(EphemeronHashTable::GetMap(ReadOnlyRoots(isolate()))); StoreMapNoWriteBarrier(table, map); StoreFixedArrayElement(table, EphemeronHashTable::kNumberOfElementsIndex, SmiConstant(0), SKIP_WRITE_BARRIER); StoreFixedArrayElement(table, EphemeronHashTable::kNumberOfDeletedElementsIndex, SmiConstant(0), SKIP_WRITE_BARRIER); StoreFixedArrayElement(table, EphemeronHashTable::kCapacityIndex, SmiFromIntPtr(capacity), SKIP_WRITE_BARRIER); TNode<IntPtrT> start = KeyIndexFromEntry(IntPtrConstant(0)); FillFixedArrayWithValue(HOLEY_ELEMENTS, table, start, length, RootIndex::kUndefinedValue); return table; } TNode<Smi> WeakCollectionsBuiltinsAssembler::CreateIdentityHash( TNode<Object> key) { TNode<ExternalReference> function_addr = ExternalConstant(ExternalReference::jsreceiver_create_identity_hash()); TNode<ExternalReference> isolate_ptr = ExternalConstant(ExternalReference::isolate_address(isolate())); MachineType type_ptr = MachineType::Pointer(); MachineType type_tagged = MachineType::AnyTagged(); return CAST(CallCFunction(function_addr, type_tagged, std::make_pair(type_ptr, isolate_ptr), std::make_pair(type_tagged, key))); } TNode<IntPtrT> WeakCollectionsBuiltinsAssembler::EntryMask( TNode<IntPtrT> capacity) { return IntPtrSub(capacity, IntPtrConstant(1)); } TNode<IntPtrT> WeakCollectionsBuiltinsAssembler::FindKeyIndex( TNode<HeapObject> table, TNode<IntPtrT> key_hash, TNode<IntPtrT> entry_mask, const KeyComparator& key_compare) { // See HashTable::FirstProbe(). TVARIABLE(IntPtrT, var_entry, WordAnd(key_hash, entry_mask)); TVARIABLE(IntPtrT, var_count, IntPtrConstant(0)); Label loop(this, {&var_count, &var_entry}), if_found(this); Goto(&loop); BIND(&loop); TNode<IntPtrT> key_index; { key_index = KeyIndexFromEntry(var_entry.value()); TNode<Object> entry_key = UnsafeLoadFixedArrayElement(CAST(table), key_index); key_compare(entry_key, &if_found); // See HashTable::NextProbe(). Increment(&var_count); var_entry = WordAnd(IntPtrAdd(var_entry.value(), var_count.value()), entry_mask); Goto(&loop); } BIND(&if_found); return key_index; } TNode<IntPtrT> WeakCollectionsBuiltinsAssembler::FindKeyIndexForInsertion( TNode<HeapObject> table, TNode<IntPtrT> key_hash, TNode<IntPtrT> entry_mask) { // See HashTable::FindInsertionEntry(). auto is_not_live = [&](TNode<Object> entry_key, Label* if_found) { // This is the the negative form BaseShape::IsLive(). GotoIf(Word32Or(IsTheHole(entry_key), IsUndefined(entry_key)), if_found); }; return FindKeyIndex(table, key_hash, entry_mask, is_not_live); } TNode<IntPtrT> WeakCollectionsBuiltinsAssembler::FindKeyIndexForKey( TNode<HeapObject> table, TNode<Object> key, TNode<IntPtrT> hash, TNode<IntPtrT> entry_mask, Label* if_not_found) { // See HashTable::FindEntry(). auto match_key_or_exit_on_empty = [&](TNode<Object> entry_key, Label* if_same) { GotoIf(IsUndefined(entry_key), if_not_found); GotoIf(TaggedEqual(entry_key, key), if_same); }; return FindKeyIndex(table, hash, entry_mask, match_key_or_exit_on_empty); } TNode<IntPtrT> WeakCollectionsBuiltinsAssembler::KeyIndexFromEntry( TNode<IntPtrT> entry) { // See HashTable::KeyAt(). // (entry * kEntrySize) + kElementsStartIndex + kEntryKeyIndex return IntPtrAdd( IntPtrMul(entry, IntPtrConstant(EphemeronHashTable::kEntrySize)), IntPtrConstant(EphemeronHashTable::kElementsStartIndex + EphemeronHashTable::kEntryKeyIndex)); } TNode<IntPtrT> WeakCollectionsBuiltinsAssembler::LoadNumberOfElements( TNode<EphemeronHashTable> table, int offset) { TNode<IntPtrT> number_of_elements = SmiUntag(CAST(UnsafeLoadFixedArrayElement( table, EphemeronHashTable::kNumberOfElementsIndex))); return IntPtrAdd(number_of_elements, IntPtrConstant(offset)); } TNode<IntPtrT> WeakCollectionsBuiltinsAssembler::LoadNumberOfDeleted( TNode<EphemeronHashTable> table, int offset) { TNode<IntPtrT> number_of_deleted = SmiUntag(CAST(UnsafeLoadFixedArrayElement( table, EphemeronHashTable::kNumberOfDeletedElementsIndex))); return IntPtrAdd(number_of_deleted, IntPtrConstant(offset)); } TNode<EphemeronHashTable> WeakCollectionsBuiltinsAssembler::LoadTable( TNode<JSWeakCollection> collection) { return CAST(LoadObjectField(collection, JSWeakCollection::kTableOffset)); } TNode<IntPtrT> WeakCollectionsBuiltinsAssembler::LoadTableCapacity( TNode<EphemeronHashTable> table) { return SmiUntag(CAST( UnsafeLoadFixedArrayElement(table, EphemeronHashTable::kCapacityIndex))); } TNode<Word32T> WeakCollectionsBuiltinsAssembler::InsufficientCapacityToAdd( TNode<IntPtrT> capacity, TNode<IntPtrT> number_of_elements, TNode<IntPtrT> number_of_deleted) { // This is the negative form of HashTable::HasSufficientCapacityToAdd(). // Return true if: // - more than 50% of the available space are deleted elements // - less than 50% will be available TNode<IntPtrT> available = IntPtrSub(capacity, number_of_elements); TNode<IntPtrT> half_available = WordShr(available, 1); TNode<IntPtrT> needed_available = WordShr(number_of_elements, 1); return Word32Or( // deleted > half IntPtrGreaterThan(number_of_deleted, half_available), // elements + needed available > capacity IntPtrGreaterThan(IntPtrAdd(number_of_elements, needed_available), capacity)); } void WeakCollectionsBuiltinsAssembler::RemoveEntry( TNode<EphemeronHashTable> table, TNode<IntPtrT> key_index, TNode<IntPtrT> number_of_elements) { // See EphemeronHashTable::RemoveEntry(). TNode<IntPtrT> value_index = ValueIndexFromKeyIndex(key_index); StoreFixedArrayElement(table, key_index, TheHoleConstant()); StoreFixedArrayElement(table, value_index, TheHoleConstant()); // See HashTableBase::ElementRemoved(). TNode<IntPtrT> number_of_deleted = LoadNumberOfDeleted(table, 1); StoreFixedArrayElement(table, EphemeronHashTable::kNumberOfElementsIndex, SmiFromIntPtr(number_of_elements), SKIP_WRITE_BARRIER); StoreFixedArrayElement(table, EphemeronHashTable::kNumberOfDeletedElementsIndex, SmiFromIntPtr(number_of_deleted), SKIP_WRITE_BARRIER); } TNode<BoolT> WeakCollectionsBuiltinsAssembler::ShouldRehash( TNode<IntPtrT> number_of_elements, TNode<IntPtrT> number_of_deleted) { // Rehash if more than 33% of the entries are deleted. return IntPtrGreaterThanOrEqual(WordShl(number_of_deleted, 1), number_of_elements); } TNode<Word32T> WeakCollectionsBuiltinsAssembler::ShouldShrink( TNode<IntPtrT> capacity, TNode<IntPtrT> number_of_elements) { // See HashTable::Shrink(). TNode<IntPtrT> quarter_capacity = WordShr(capacity, 2); return Word32And( // Shrink to fit the number of elements if only a quarter of the // capacity is filled with elements. IntPtrLessThanOrEqual(number_of_elements, quarter_capacity), // Allocate a new dictionary with room for at least the current // number of elements. The allocation method will make sure that // there is extra room in the dictionary for additions. Don't go // lower than room for 16 elements. IntPtrGreaterThanOrEqual(number_of_elements, IntPtrConstant(16))); } TNode<IntPtrT> WeakCollectionsBuiltinsAssembler::ValueIndexFromKeyIndex( TNode<IntPtrT> key_index) { return IntPtrAdd(key_index, IntPtrConstant(EphemeronHashTable::ShapeT::kEntryValueIndex - EphemeronHashTable::kEntryKeyIndex)); } TF_BUILTIN(WeakMapConstructor, WeakCollectionsBuiltinsAssembler) { TNode<Object> new_target = CAST(Parameter(Descriptor::kJSNewTarget)); TNode<IntPtrT> argc = ChangeInt32ToIntPtr( UncheckedCast<Int32T>(Parameter(Descriptor::kJSActualArgumentsCount))); TNode<Context> context = CAST(Parameter(Descriptor::kContext)); GenerateConstructor(kWeakMap, isolate()->factory()->WeakMap_string(), new_target, argc, context); } TF_BUILTIN(WeakSetConstructor, WeakCollectionsBuiltinsAssembler) { TNode<Object> new_target = CAST(Parameter(Descriptor::kJSNewTarget)); TNode<IntPtrT> argc = ChangeInt32ToIntPtr( UncheckedCast<Int32T>(Parameter(Descriptor::kJSActualArgumentsCount))); TNode<Context> context = CAST(Parameter(Descriptor::kContext)); GenerateConstructor(kWeakSet, isolate()->factory()->WeakSet_string(), new_target, argc, context); } TF_BUILTIN(WeakMapLookupHashIndex, WeakCollectionsBuiltinsAssembler) { TNode<EphemeronHashTable> table = CAST(Parameter(Descriptor::kTable)); TNode<Object> key = CAST(Parameter(Descriptor::kKey)); Label if_not_found(this); GotoIfNotJSReceiver(key, &if_not_found); TNode<IntPtrT> hash = LoadJSReceiverIdentityHash(key, &if_not_found); TNode<IntPtrT> capacity = LoadTableCapacity(table); TNode<IntPtrT> key_index = FindKeyIndexForKey(table, key, hash, EntryMask(capacity), &if_not_found); Return(SmiTag(ValueIndexFromKeyIndex(key_index))); BIND(&if_not_found); Return(SmiConstant(-1)); } TF_BUILTIN(WeakMapGet, WeakCollectionsBuiltinsAssembler) { const TNode<Object> receiver = CAST(Parameter(Descriptor::kReceiver)); const TNode<Object> key = CAST(Parameter(Descriptor::kKey)); const TNode<Context> context = CAST(Parameter(Descriptor::kContext)); Label return_undefined(this); ThrowIfNotInstanceType(context, receiver, JS_WEAK_MAP_TYPE, "WeakMap.prototype.get"); const TNode<EphemeronHashTable> table = LoadTable(CAST(receiver)); const TNode<Smi> index = CAST(CallBuiltin(Builtins::kWeakMapLookupHashIndex, context, table, key)); GotoIf(TaggedEqual(index, SmiConstant(-1)), &return_undefined); Return(LoadFixedArrayElement(table, SmiUntag(index))); BIND(&return_undefined); Return(UndefinedConstant()); } TF_BUILTIN(WeakMapPrototypeHas, WeakCollectionsBuiltinsAssembler) { const TNode<Object> receiver = CAST(Parameter(Descriptor::kReceiver)); const TNode<Object> key = CAST(Parameter(Descriptor::kKey)); const TNode<Context> context = CAST(Parameter(Descriptor::kContext)); Label return_false(this); ThrowIfNotInstanceType(context, receiver, JS_WEAK_MAP_TYPE, "WeakMap.prototype.has"); const TNode<EphemeronHashTable> table = LoadTable(CAST(receiver)); const TNode<Object> index = CallBuiltin(Builtins::kWeakMapLookupHashIndex, context, table, key); GotoIf(TaggedEqual(index, SmiConstant(-1)), &return_false); Return(TrueConstant()); BIND(&return_false); Return(FalseConstant()); } // Helper that removes the entry with a given key from the backing store // (EphemeronHashTable) of a WeakMap or WeakSet. TF_BUILTIN(WeakCollectionDelete, WeakCollectionsBuiltinsAssembler) { TNode<Context> context = CAST(Parameter(Descriptor::kContext)); TNode<JSWeakCollection> collection = CAST(Parameter(Descriptor::kCollection)); TNode<Object> key = CAST(Parameter(Descriptor::kKey)); Label call_runtime(this), if_not_found(this); GotoIfNotJSReceiver(key, &if_not_found); TNode<IntPtrT> hash = LoadJSReceiverIdentityHash(key, &if_not_found); TNode<EphemeronHashTable> table = LoadTable(collection); TNode<IntPtrT> capacity = LoadTableCapacity(table); TNode<IntPtrT> key_index = FindKeyIndexForKey(table, key, hash, EntryMask(capacity), &if_not_found); TNode<IntPtrT> number_of_elements = LoadNumberOfElements(table, -1); GotoIf(ShouldShrink(capacity, number_of_elements), &call_runtime); RemoveEntry(table, key_index, number_of_elements); Return(TrueConstant()); BIND(&if_not_found); Return(FalseConstant()); BIND(&call_runtime); Return(CallRuntime(Runtime::kWeakCollectionDelete, context, collection, key, SmiTag(hash))); } // Helper that sets the key and value to the backing store (EphemeronHashTable) // of a WeakMap or WeakSet. TF_BUILTIN(WeakCollectionSet, WeakCollectionsBuiltinsAssembler) { TNode<Context> context = CAST(Parameter(Descriptor::kContext)); TNode<JSWeakCollection> collection = CAST(Parameter(Descriptor::kCollection)); TNode<JSReceiver> key = CAST(Parameter(Descriptor::kKey)); TNode<Object> value = CAST(Parameter(Descriptor::kValue)); CSA_ASSERT(this, IsJSReceiver(key)); Label call_runtime(this), if_no_hash(this), if_not_found(this); TNode<EphemeronHashTable> table = LoadTable(collection); TNode<IntPtrT> capacity = LoadTableCapacity(table); TNode<IntPtrT> entry_mask = EntryMask(capacity); TVARIABLE(IntPtrT, var_hash, LoadJSReceiverIdentityHash(key, &if_no_hash)); TNode<IntPtrT> key_index = FindKeyIndexForKey(table, key, var_hash.value(), entry_mask, &if_not_found); StoreFixedArrayElement(table, ValueIndexFromKeyIndex(key_index), value); Return(collection); BIND(&if_no_hash); { var_hash = SmiUntag(CreateIdentityHash(key)); Goto(&if_not_found); } BIND(&if_not_found); { TNode<IntPtrT> number_of_deleted = LoadNumberOfDeleted(table); TNode<IntPtrT> number_of_elements = LoadNumberOfElements(table, 1); // TODO(pwong): Port HashTable's Rehash() and EnsureCapacity() to CSA. GotoIf(Word32Or(ShouldRehash(number_of_elements, number_of_deleted), InsufficientCapacityToAdd(capacity, number_of_elements, number_of_deleted)), &call_runtime); TNode<IntPtrT> insertion_key_index = FindKeyIndexForInsertion(table, var_hash.value(), entry_mask); AddEntry(table, insertion_key_index, key, value, number_of_elements); Return(collection); } BIND(&call_runtime); { CallRuntime(Runtime::kWeakCollectionSet, context, collection, key, value, SmiTag(var_hash.value())); Return(collection); } } TF_BUILTIN(WeakMapPrototypeDelete, CodeStubAssembler) { TNode<Context> context = CAST(Parameter(Descriptor::kContext)); TNode<Object> receiver = CAST(Parameter(Descriptor::kReceiver)); TNode<Object> key = CAST(Parameter(Descriptor::kKey)); ThrowIfNotInstanceType(context, receiver, JS_WEAK_MAP_TYPE, "WeakMap.prototype.delete"); Return(CallBuiltin(Builtins::kWeakCollectionDelete, context, receiver, key)); } TF_BUILTIN(WeakMapPrototypeSet, WeakCollectionsBuiltinsAssembler) { TNode<Context> context = CAST(Parameter(Descriptor::kContext)); TNode<Object> receiver = CAST(Parameter(Descriptor::kReceiver)); TNode<Object> key = CAST(Parameter(Descriptor::kKey)); TNode<Object> value = CAST(Parameter(Descriptor::kValue)); ThrowIfNotInstanceType(context, receiver, JS_WEAK_MAP_TYPE, "WeakMap.prototype.set"); Label throw_invalid_key(this); GotoIfNotJSReceiver(key, &throw_invalid_key); Return( CallBuiltin(Builtins::kWeakCollectionSet, context, receiver, key, value)); BIND(&throw_invalid_key); ThrowTypeError(context, MessageTemplate::kInvalidWeakMapKey, key); } TF_BUILTIN(WeakSetPrototypeAdd, WeakCollectionsBuiltinsAssembler) { TNode<Context> context = CAST(Parameter(Descriptor::kContext)); TNode<Object> receiver = CAST(Parameter(Descriptor::kReceiver)); TNode<Object> value = CAST(Parameter(Descriptor::kValue)); ThrowIfNotInstanceType(context, receiver, JS_WEAK_SET_TYPE, "WeakSet.prototype.add"); Label throw_invalid_value(this); GotoIfNotJSReceiver(value, &throw_invalid_value); Return(CallBuiltin(Builtins::kWeakCollectionSet, context, receiver, value, TrueConstant())); BIND(&throw_invalid_value); ThrowTypeError(context, MessageTemplate::kInvalidWeakSetValue, value); } TF_BUILTIN(WeakSetPrototypeDelete, CodeStubAssembler) { TNode<Context> context = CAST(Parameter(Descriptor::kContext)); TNode<Object> receiver = CAST(Parameter(Descriptor::kReceiver)); TNode<Object> value = CAST(Parameter(Descriptor::kValue)); ThrowIfNotInstanceType(context, receiver, JS_WEAK_SET_TYPE, "WeakSet.prototype.delete"); Return( CallBuiltin(Builtins::kWeakCollectionDelete, context, receiver, value)); } TF_BUILTIN(WeakSetPrototypeHas, WeakCollectionsBuiltinsAssembler) { const TNode<Object> receiver = CAST(Parameter(Descriptor::kReceiver)); const TNode<Object> key = CAST(Parameter(Descriptor::kKey)); const TNode<Context> context = CAST(Parameter(Descriptor::kContext)); Label return_false(this); ThrowIfNotInstanceType(context, receiver, JS_WEAK_SET_TYPE, "WeakSet.prototype.has"); const TNode<EphemeronHashTable> table = LoadTable(CAST(receiver)); const TNode<Object> index = CallBuiltin(Builtins::kWeakMapLookupHashIndex, context, table, key); GotoIf(TaggedEqual(index, SmiConstant(-1)), &return_false); Return(TrueConstant()); BIND(&return_false); Return(FalseConstant()); } } // namespace internal } // namespace v8
[ "commit-bot@chromium.org" ]
commit-bot@chromium.org
2351c3074a9b638370fb0a7a4406ddf32ff119a9
260e5dec446d12a7dd3f32e331c1fde8157e5cea
/Indi/SDK/Indi_INX2_T_06_Thugs_classes.hpp
fb613a3f1c72aaecb09fe7e0383683bc7c6a18b4
[]
no_license
jfmherokiller/TheOuterWorldsSdkDump
6e140fde4fcd1cade94ce0d7ea69f8a3f769e1c0
18a8c6b1f5d87bb1ad4334be4a9f22c52897f640
refs/heads/main
2023-08-30T09:27:17.723265
2021-09-17T00:24:52
2021-09-17T00:24:52
407,437,218
0
0
null
null
null
null
UTF-8
C++
false
false
660
hpp
#pragma once // TheOuterWorlds SDK #ifdef _MSC_VER #pragma pack(push, 0x8) #endif #include "Indi_INX2_T_06_Thugs_structs.hpp" namespace SDK { //--------------------------------------------------------------------------- //Classes //--------------------------------------------------------------------------- // BlueprintGeneratedClass INX2_T_06_Thugs.INX2_T_06_Thugs_C // 0x0000 (0x0238 - 0x0238) class UINX2_T_06_Thugs_C : public UTeamData { public: static UClass* StaticClass() { static auto ptr = UObject::FindClass("BlueprintGeneratedClass INX2_T_06_Thugs.INX2_T_06_Thugs_C"); return ptr; } }; } #ifdef _MSC_VER #pragma pack(pop) #endif
[ "peterpan0413@live.com" ]
peterpan0413@live.com
68679e735e4da5dda33865e09e7e0b0d015c596c
c4bcba4d8fd7a0e02970cc27b963d864fcef5e33
/nachos/code/filesys/synch_disk.hh
0ad366187ac841053bc30633f5f1111345761c02
[]
no_license
IvaanEr/SO2
13fa0f3cef16c5d55c9ca13253147bf820187197
1193532600c833ec66dcdb243d16213b989931e0
refs/heads/master
2021-01-22T22:07:32.387682
2018-08-09T21:01:13
2018-08-09T21:01:13
85,505,426
1
0
null
null
null
null
UTF-8
C++
false
false
2,010
hh
/// Data structures to export a synchronous interface to the raw disk device. /// /// Copyright (c) 1992-1993 The Regents of the University of California. /// 2016-2017 Docentes de la Universidad Nacional de Rosario. /// All rights reserved. See `copyright.h` for copyright notice and /// limitation of liability and disclaimer of warranty provisions. #ifndef NACHOS_FILESYS_SYNCHDISK__HH #define NACHOS_FILESYS_SYNCHDISK__HH #include "machine/disk.hh" #include "threads/synch.hh" /// The following class defines a "synchronous" disk abstraction. /// /// As with other I/O devices, the raw physical disk is an asynchronous /// device -- requests to read or write portions of the disk return /// immediately, and an interrupt occurs later to signal that the operation /// completed. (Also, the physical characteristics of the disk device assume /// that only one operation can be requested at a time). /// /// This class provides the abstraction that for any individual thread making /// a request, it waits around until the operation finishes before returning. class SynchDisk { public: /// Initialize a synchronous disk, by initializing the raw Disk. SynchDisk(const char* name); /// De-allocate the synch disk data. ~SynchDisk(); /// Read/write a disk sector, returning only once the data is actually /// read or written. These call `Disk::ReadRequest`/`WriteRequest` and /// then wait until the request is done. void ReadSector(int sectorNumber, char* data); void WriteSector(int sectorNumber, const char* data); /// Called by the disk device interrupt handler, to signal that the /// current disk operation is complete. void RequestDone(); private: Disk *disk; ///< Raw disk device. Semaphore *semaphore; ///< To synchronize requesting thread with the ///< interrupt handler. Lock *lock; ///< Only one read/write request can be sent to the disk at ///< a time. }; #endif
[ "ivan_ernandorena@hotmail.com" ]
ivan_ernandorena@hotmail.com
70c3883f6751d2b01ead1e97cd596b27a6b98500
72e44ac6fcf22e124dc9ad755e9d7fab120ab442
/cs160_series/C_Labs/lab1/TA_Guessing.cpp
8c3d308f747cae5ed8f4f94c5efb70c77c1d89f3
[]
no_license
jeffdeng1314/CS16x
2a550ee48d3d750b0fd8c2b349ab6620a4fef6f6
24204e4d87844c957b5c7a027b9c7a788527655d
refs/heads/master
2020-05-15T00:37:17.298336
2019-04-18T04:46:46
2019-04-18T04:46:46
182,014,947
0
0
null
null
null
null
UTF-8
C++
false
false
690
cpp
#include <iostream> #include <string> using namespace std; int main(){ int choice; string answer; do{ cout <<"Hi! Welcome to the guessing TA game!\n"; cout <<"Enter the following numbers to look for clues!"<<endl; cout <<"1) Hair color\n2) Gender\n3) Favorite animal\n4) Academic Standard\n5) Guess the name\n6) Quit the game\nYour choice: "<<endl; cin.clear(); cin >> choice; if (choice == 1){ cout << "\nWhat is the hair color of this TA?: "; cin >> answer; if (answer == "Blonde" || answer == "blonde"){ cout << "\nGood Job! You entered: " << answer << endl; }else { cout << "\nPlease try again" << endl; } } }while(choice!=6); }
[ "dengh@oregonstate.edu" ]
dengh@oregonstate.edu
6e8a9229b4abb7a9207e04cc07f06107cb2fe779
f9a19cc51d9eaed79beaff36248b58c3778cb6d6
/4.3.cpp
3a14f6506f6f37f82ed6fbc5e861b931f790f052
[]
no_license
europeec/ghhrmm
592c7f2394169e2d204ac002a52d3e56ea825a1e
bcf2ff595d43ceb3ac6bbb143601ca2280f4610f
refs/heads/master
2023-05-13T03:48:29.798569
2023-05-09T22:50:44
2023-05-09T22:50:44
204,330,283
0
0
null
null
null
null
UTF-8
C++
false
false
1,507
cpp
#include <iostream> using namespace std; struct CandyBar{ string name; double mass; int kalories; }; string input_name(){ string name; cout << "Введите имя: "; cin >> name; return name; } double input_mass(){ double mass; cout << "Введите массу: "; cin >> mass; return mass; } int input_kalories(){ int kalories; cout << "Введите калории: "; cin >> kalories; return kalories; } int main(){ CandyBar product1; CandyBar product2; CandyBar product3; product1.name = input_name(); product1.mass = input_mass(); product1.kalories = input_kalories(); // input product 2 product2.name = input_name(); product2.mass = input_mass(); product2.kalories = input_kalories(); // input product 3 product3.name = input_name(); product3.mass = input_mass(); product3.kalories = input_kalories(); // output cout << " OUTPUT PRODUCTS: "<< endl; cout << " \tnum " << "\t\t\tINFORMATION" << endl; cout << "1 product: " << product1.name << " | mass:" << product1.mass << " | kalories: " << product1.kalories; cout << endl; cout << "2 product: " << product2.name << " | mass:" << product2.mass << " | kalories: " << product2.kalories; cout << endl; cout << "3 product: " << product3.name << " | mass:" << product3.mass << " | kalories: " << product3.kalories; cout << endl; return 5; }
[ "leuropeec@ya.ru" ]
leuropeec@ya.ru
514084da67fded235dbb80d07aa2c695b0996fb6
8c5efc393fa0bc16dc7b4d3ca6ace6e12f410e3e
/template files/IPC031_2018_assignment_5_files (1)/IPC031_2017_assignment_5_files/main.cpp
565a8a640a8db2eb1701e229debf577cbf8fbf20
[]
no_license
huynguy97/Thesis-data
3a59638b0d5e530d4696b9fec8439418315796ba
49960524dbe33dfdb29f1b7ef5380621c1c266d8
refs/heads/master
2020-06-01T04:14:48.034712
2019-06-27T00:39:44
2019-06-27T00:39:44
190,630,928
0
0
null
null
null
null
UTF-8
C++
false
false
2,585
cpp
#include <iostream> #include <fstream> // for file I/O #include <cassert> // for assertion checking using namespace std; enum Action {Encrypt, Decrypt} ; int seed = 0 ; void initialise_pseudo_random (int r) { // pre-condition: assert (r > 0 && r <= 65536) ; /* post-condition: seed has value r. */ seed = r ; } int next_pseudo_random_number () { // pre-condition: assert (seed > 0 && seed <= 65536) ; /* post-condition: result value > 0 and result value <= 65536 and result value != seed at entry of function */ const int seed75 = seed * 75 ; int next = (seed75 & 65535) - (seed75 >> 16) ; if (next < 0) next += 65537 ; seed = next ; return next ; } char rotate_char (char a, int r, Action action) { // Pre-condition: // Post-condition: } void test_rotate_char () { // Pre-condition: // Post-condition: } bool open_input_and_output_file (ifstream& infile, ofstream& outfile) { // Pre-condition: // Post-condition: } Action get_user_action () {// Pre-condition: assert ( true ) ; /* Post-condition: result is the Action that the user has indicated that the program should encrypt / decrypt */ cout << "Do you want to encrypt the file? (y/n): " ; string answer ; cin >> answer ; if (answer == "y") return Encrypt; else return Decrypt; } int initial_encryption_value () {// Pre-conditie: assert (true) ; /* Post-condition: result is a value between 0 and 65355 (both inclusive) */ int initial_value = -1 ; while (initial_value < 0 || initial_value > 65535) { cout << "Please enter the initial coding value (greater or equal to 0 and less than 65536)" << endl ; cin >> initial_value ; } return initial_value ; } void use_OTP (ifstream& infile, ofstream& outfile, Action action, int initial_value) { // Pre-condition: // Post-condition: } int main() { const Action ACTION = get_user_action() ; ifstream input_file ; ofstream output_file ; if (!open_input_and_output_file (input_file,output_file)) { cout << "Program aborted." << endl ; return -1 ; } const int INITIAL_VALUE = initial_encryption_value () ; use_OTP (input_file,output_file,ACTION,INITIAL_VALUE); input_file.clear () ; output_file.clear () ; input_file.close () ; output_file.close () ; if (!input_file || !output_file) { cout << "Not all files were closed succesfully. The output might be incorrect." << endl ; return -1 ; } return 0 ; }
[ "h.nguyen@student.science.ru.nl" ]
h.nguyen@student.science.ru.nl
fa7821865ad290b80c69e240b36b1b574d34dd9e
b229effa2de079d0bbb1f7f4f83c6bc7e84e7934
/dictionary.h
635bf658938b34664a08a9dca2a9d697a1636217
[]
no_license
JustinWilson022/Scrabble-AI
65c23cfe35a2e403e40d7ea1b7b0c230e49bf51e
176d977e20d761b4dd0abd197c716a14f6b8b077
refs/heads/master
2023-07-19T08:56:19.524536
2021-09-07T06:21:55
2021-09-07T06:21:55
403,863,863
0
0
null
null
null
null
UTF-8
C++
false
false
1,839
h
#ifndef DICTIONARY_H #define DICTIONARY_H #include <unordered_set> #include <string> #include <map> #include <memory> #include <vector> class Dictionary { public: struct TrieNode { // when a node in trie is created // initialized to not be for a valid word // in the dictionary bool is_final = false; std::map<char, std::shared_ptr<TrieNode>> nexts; }; /* Creates a dictionary based on the specified config file Adds all the words into the Trie datastructures. */ static Dictionary read(const std::string& file_path); /* Returns whether `word` is in the dictionary or not. */ bool is_word(const std::string& word) const; /* This function returns a vector of letters that could possibly follow prefix. If a letter is a key in a node's `nexts`, it should be possible to make a word using it. */ std::vector<char> next_letters(const std::string& prefix) const; // Used for testing /* Returns root */ std::shared_ptr<TrieNode> get_root() const {return root;}; // Used for testing /* This function returns the node associated with prefix. This method starts with the current node as the root node (a.k.a the node associated with the empty string ""). The algorithm then iterates through each letter in prefix and for each letter It moves the current node pointer to the child associated with that letter. i.e. The node pointer in the current node's `nexts` keyed by the letter It then returns that node. If at any point the node cannot be found, return nullptr. */ std::shared_ptr<TrieNode> find_prefix(const std::string& prefix) const; // Used for testing private: std::shared_ptr<TrieNode> root; void add_word(const std::string& word); }; #endif
[ "justinvw@usc.edu" ]
justinvw@usc.edu
1395699ee052d3c7ad81fa3188e780cc0dece6ee
445a5834ffa8c7293a4a6016233cbab6bb92d5c4
/NDK/5/MyJni/jni/MyJni.cpp
1ded1ef66837fdb2e65773da71bae49b0fc87756
[]
no_license
unsummon/Jni_5
053a6df5de5f8f357e989b3eade48b8524484303
52b69f8c822f5d2787517bd357dc90af92e5c772
refs/heads/master
2021-01-01T05:45:43.181976
2016-04-17T14:31:25
2016-04-17T14:31:25
56,440,423
0
0
null
null
null
null
UTF-8
C++
false
false
1,209
cpp
#include "MyJNI.h" #include <stdio.h> #include <android/log.h> /* * Class: cr_myjni_MyJNI * Method: GetNumber * Signature: ()I */ JNIEXPORT jint JNICALL Java_cr_myjni_MyJNI_GetNumber (JNIEnv *env, jobject obj) { return 1; } /* * Class: cr_myjni_MyJNI * Method: GetNumber2 * Signature: ()I */ JNIEXPORT jint JNICALL Java_cr_myjni_MyJNI_GetNumber2 (JNIEnv *env, jclass cls) { return 2; } /* * Class: cr_myjni_MyJNI * Method: GetNumber3 * Signature: (Ljava/lang/String;)Ljava/lang/String; */ JNIEXPORT jstring JNICALL Java_cr_myjni_MyJNI_GetNumber3 (JNIEnv *env, jobject obj, jstring str) { int nLength = env->GetStringUTFLength(str); jboolean IsCopy = false; const char *psz = env->GetStringUTFChars(str, &IsCopy); //jclass cls = env->FindClass("Lcr/myjni/MyJNI;"); jclass cls = env->GetObjectClass(obj); __android_log_print(ANDROID_LOG_DEBUG, "jni", "FindClass"); jmethodID ShowMsg = env->GetMethodID(cls, "ShowMsg", "(Ljava/lang/String;)V"); __android_log_print(ANDROID_LOG_DEBUG, "jni", "GetMethodID"); env->CallVoidMethod(obj, ShowMsg, "JNI"); __android_log_print(ANDROID_LOG_DEBUG, "jni", "CallVoidMethod"); return env->NewStringUTF("123"); }
[ "schejiazhou@sina.com" ]
schejiazhou@sina.com
1eb508e7aca6e2e15e03a714075f01ba8c15b955
daa4dcb733d87e45993e2e79020fc83508394c28
/Cpp/task7/Array.hpp
a55a0427173f7ea2110d72ebfab1175d243ac1ab
[]
no_license
Leksoo/ITMO_Storage
4c70933c9d30cf523260c383b394b6adfc6262bc
450cb80d29acd2ce99fa83966789e10bb94d95ec
refs/heads/master
2023-01-23T10:14:42.472706
2021-01-30T13:13:00
2021-01-30T13:13:00
184,566,283
0
1
null
2023-01-05T03:57:31
2019-05-02T11:04:58
Jupyter Notebook
UTF-8
C++
false
false
2,014
hpp
// // Created by lekso on 12.11.2018. // #include<iostream> #include "Array.h" template<class T> Array<T>::Array(size_t size, const T &value) { mSize = size; // mData = new T[size]; <--- default constructor used // for (size_t i = 0; i < size; ++i) { // mData[i] = value; <--- assignment operator used // } mData = (T *) new int[size * sizeof(T)]; for (int i = 0; i < size; ++i) { new(mData + i) T(value); } } template<class T> Array<T>::Array(const Array &other) { mSize = other.mSize; mData = (T *) new int[mSize * sizeof(T)]; for (size_t i = 0; i < mSize; ++i) { new(mData + i) T(other[i]); } } template<class T> Array<T>::~Array() { cleanMemory(); } template<class T> Array<T> &Array<T>::operator=(const Array &other) { cleanMemory(); mSize = other.mSize; mData = (T *) new int[mSize * sizeof(T)]; for (size_t i = 0; i < mSize; ++i) { new(mData + i) T(other[i]); } return *this; } template<class T> size_t Array<T>::size() const { return mSize; } template<class T> T &Array<T>::operator[](size_t position) { return mData[position]; } template<class T> const T &Array<T>::operator[](size_t position) const { return mData[position]; } template<class T> void Array<T>::cleanMemory() { for (size_t i = 0; i < mSize; ++i) { mData[i].~T(); } delete[] (int *) mData; } template<class T, class C> T minimum(Array<T> &data, C comparator) { size_t minIndex = 0; for (size_t i = 1; i < data.size(); ++i) { if (comparator(data[i], data[minIndex])) { minIndex = i; } } return data[minIndex]; } template<class T> void flatten(const Array<T> &data, std::ostream &out) { for (size_t i = 0; i < data.size(); ++i) { out << data[i] << " "; } } template<class T> void flatten(const Array<Array<T>> &data, std::ostream &out) { for (size_t i = 0; i < data.size(); ++i) { flatten(data[i], out); } }
[ "leksoor@gmail.com" ]
leksoor@gmail.com
da00542b9e70092b4005abcf5c44ff107cd02e0d
fc7d5b988d885bd3a5ca89296a04aa900e23c497
/Programming/mbed-os-example-sockets/mbed-os/storage/blockdevice/source/ProfilingBlockDevice.cpp
f0fb090d3f9e5fa5f5a91afb7547d82ef15d3225
[ "Apache-2.0" ]
permissive
AlbinMartinsson/master_thesis
52746f035bc24e302530aabde3cbd88ea6c95b77
495d0e53dd00c11adbe8114845264b65f14b8163
refs/heads/main
2023-06-04T09:31:45.174612
2021-06-29T16:35:44
2021-06-29T16:35:44
334,069,714
3
1
Apache-2.0
2021-03-16T16:32:16
2021-01-29T07:28:32
C++
UTF-8
C++
false
false
2,729
cpp
/* mbed Microcontroller Library * Copyright (c) 2017 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * 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 "blockdevice/ProfilingBlockDevice.h" #include "stddef.h" namespace mbed { ProfilingBlockDevice::ProfilingBlockDevice(BlockDevice *bd) : _bd(bd) , _read_count(0) , _program_count(0) , _erase_count(0) { } int ProfilingBlockDevice::init() { return _bd->init(); } int ProfilingBlockDevice::deinit() { return _bd->deinit(); } int ProfilingBlockDevice::sync() { return _bd->sync(); } int ProfilingBlockDevice::read(void *b, bd_addr_t addr, bd_size_t size) { int err = _bd->read(b, addr, size); if (!err) { _read_count += size; } return err; } int ProfilingBlockDevice::program(const void *b, bd_addr_t addr, bd_size_t size) { int err = _bd->program(b, addr, size); if (!err) { _program_count += size; } return err; } int ProfilingBlockDevice::erase(bd_addr_t addr, bd_size_t size) { int err = _bd->erase(addr, size); if (!err) { _erase_count += size; } return err; } bd_size_t ProfilingBlockDevice::get_read_size() const { return _bd->get_read_size(); } bd_size_t ProfilingBlockDevice::get_program_size() const { return _bd->get_program_size(); } bd_size_t ProfilingBlockDevice::get_erase_size() const { return _bd->get_erase_size(); } bd_size_t ProfilingBlockDevice::get_erase_size(bd_addr_t addr) const { return _bd->get_erase_size(addr); } int ProfilingBlockDevice::get_erase_value() const { return _bd->get_erase_value(); } bd_size_t ProfilingBlockDevice::size() const { return _bd->size(); } void ProfilingBlockDevice::reset() { _read_count = 0; _program_count = 0; _erase_count = 0; } bd_size_t ProfilingBlockDevice::get_read_count() const { return _read_count; } bd_size_t ProfilingBlockDevice::get_program_count() const { return _program_count; } bd_size_t ProfilingBlockDevice::get_erase_count() const { return _erase_count; } const char *ProfilingBlockDevice::get_type() const { if (_bd != NULL) { return _bd->get_type(); } return NULL; } } // namespace mbed
[ "albmar-6@student.ltu.se" ]
albmar-6@student.ltu.se
8f2c88964d68de6b351773a2cc4aa1c37bde6c16
bea2e4112f2942225ac4cdaf641ec9176be53d06
/ARRAY/Longest subarrays of even and odds.cpp
3fac289e843f4f6a1b062a9d8128fbe2c9814324
[]
no_license
SakshamSoni-code/DSA--PRACTISE
ea2f31aa153722c76fcb8f4ca8d3226da663340a
da8c00a5f7e68bc89acce26aa5d627bf89c6e439
refs/heads/main
2023-08-20T10:06:23.795293
2021-09-21T08:03:36
2021-09-21T08:03:36
335,625,782
2
0
null
null
null
null
UTF-8
C++
false
false
786
cpp
/* You are given an array of size n. Find the maximum possible length of a subarray such that its elements are arranged alternately either as even and odd or odd and even . Example 1: Input: n = 5 a[] = {10,12,14,7,8} Output: 3 Explanation: The max length of subarray is 3 and the subarray is {14 7 8}. Here the array starts as an even element and has odd and even elements alternately. */ int maxEvenOdd(int arr[], int n) { int res=1,curr=1; for(int i=1;i<n;i++) { if((arr[i-1]%2==0 && arr[i]%2!=0) || (arr[i-1]%2!=0 && arr[i]%2==0)) { curr++; res=max(res,curr); } else { curr=1; // starting new subarray } } return res; }
[ "noreply@github.com" ]
SakshamSoni-code.noreply@github.com
325000c9b0ba68050b6c1e87ec6f6cad93f768c0
98eca557283fe549bf3438ec79c3f3b3fa46deba
/cpp/001_100/098.cpp
90d3c5e24dae256e10c93d7042dd58b71e629d77
[]
no_license
hilings/leetcode
cd9f14c6430872f4e6b9bed3460b03f31b82d5b9
b6e14cc3e5eb84eea13fbecfa9f2031caf1fab9a
refs/heads/master
2022-06-19T04:13:09.492736
2022-06-17T06:41:04
2022-06-17T06:41:04
33,797,308
0
0
null
null
null
null
UTF-8
C++
false
false
1,946
cpp
// // 098.cpp // leetcode // // Created by Hang Zhang on 1/12/16. // Copyright © 2016 Hilings Studio. All rights reserved. // #include <iostream> #include <vector> #include <deque> #include <limits> using namespace std; /** * Definition for a binary tree node. */ struct TreeNode { int val; TreeNode *left; TreeNode *right; TreeNode(int x) : val(x), left(NULL), right(NULL) {} }; class Solution { void building(deque<TreeNode*> q, vector<int> nodes) { if (nodes.empty()) return; if (nodes.front() != 0) { TreeNode *left = new TreeNode(nodes.front()); q.front()->left = left; q.push_back(left); } nodes.erase(nodes.begin()); if (nodes.empty()) return; if (nodes.front() != 0) { TreeNode *right = new TreeNode(nodes.front()); q.front()->right = right; q.push_back(right); } nodes.erase(nodes.begin()); q.pop_front(); building(q, nodes); } bool solve(TreeNode* root, long int min, long int max) { return !root || (root->val > min && root->val < max && solve(root->left, min, root->val) && solve(root->right, root->val, max)); } public: TreeNode* build(vector<int> nodes) { TreeNode *root = new TreeNode(nodes.front()); deque<TreeNode*> q {root}; nodes.erase(nodes.begin()); building(q, nodes); return root; } bool isValidBST(TreeNode* root) { return solve(root, numeric_limits<long int>::min(), numeric_limits<long int>::max()); } }; int main(int arg, char *argv[]) { // insert code here... cout << "LeetCode 098 Validate Binary Search Tree, C++ ...\n\n"; Solution sol; vector<int> nodes {1}; TreeNode *root = sol.build(nodes); bool r = sol.isValidBST(root); cout << (r ? "true" : "false") << '\n'; return 0; }
[ "hangzhang@HangRetina.local" ]
hangzhang@HangRetina.local
14bfed29472d7b5d4c7ba09fe0f9e712016074c2
1db66588fae1962234c4b11a5b214b7a9e4f3102
/string orai feladat.cpp
26ce30850fcc9f0b5111658032f35f9e4542ed00
[]
no_license
Krisztian16/XI.b
68b1b4bb8136de116f67df62f9a205bcb825dfe0
57e71a83e9749e7deeb7332ca58bf4c02291bfea
refs/heads/master
2020-07-31T06:13:16.159528
2020-02-11T07:14:53
2020-02-11T07:14:53
210,512,087
0
0
null
null
null
null
UTF-8
C++
false
false
332
cpp
#include <iostream> #include <string> #include <stdlib.h> using namespace std; int main() { string a=" "; int x; cin>>x; for(int i=0;i<x;i++){ a[i]=65+rand()%26; } a[x]='\n'; for(int i=0;i<x;i++){ cout<<a[i]; }cout<<endl; cout<<a; return 0; }
[ "noreply@github.com" ]
Krisztian16.noreply@github.com
6bcfa45771ca667180bbca2323a07b4a69f100a1
56f5b185d8103f3819ae0dd22d2b52e8ca7f74e6
/LehrMark_CSC_CIS_5_Winter_2018-master/Lab/Lab020618/Linear_And_Binary_Search_DynMem/main.cpp
62bf3af527d9edcaa37756220a0378c95ff524d2
[]
no_license
bj2594494/JungByeongju_CSC_CIS_17A_Spring_2018
8fc2dbf94b817f62c47363a91cd27cd13462fb99
2e1025a8a1b7e60626614200b9b9d675cdeff204
refs/heads/master
2020-04-10T22:07:21.003164
2018-05-15T05:42:57
2018-05-15T05:42:57
124,298,353
0
0
null
null
null
null
UTF-8
C++
false
false
3,253
cpp
/* * File: main.cpp * Author: Dr Mark E. Lehr * Created on February 6th, 2018, 10:50 AM * Purpose: All Pointer Notation * Dynamic Memory */ //System Libraries #include <iostream> //I/O Library #include <cstdlib> //Contains srand #include <ctime> //Time Library #include <cmath> //Math Library #include <iomanip> //Format Library using namespace std; //User Libraries //Global Constants - Math/Physics Constants, Conversions, // 2-D Array Dimensions //Function Prototypes float *fillAry(int); void prntAry(float *,int,int); void mrkSort(float *,int); float max(float *,int); int linear(float *,int,float); int binary(float *,int,float); //Execution Begins Here int main(int argc, char *argv[]) { //Setting the random number seed srand(static_cast<unsigned int>(time(0))); //Declare Variables int size=100; float *x; //Fill the array x=fillAry(size); //Sort the Array mrkSort(x,size); //Print the array prntAry(x,size,10); //Find a value cout<<"Value 101 found at position = "<<linear(x,size,101)<<endl; cout<<"Value 101 found at position = "<<binary(x,size,101)<<endl; cout<<"Value "<<x[50]<<" found at position = " <<linear(x,size,x[50])<<" using Linear Search"<<endl; cout<<"Value "<<x[50]<<" found at position = " <<binary(x,size,x[50])<<" using Binary Search"<<endl; //Deallocate Memory delete []x; //Exit stage right! return 0; } int binary(float *a,int n,float val){ //Declare the beginning and end of range with the mid-point int begRng=0; int endRng=n-1; //Take into account float tolerance float mx=max(a,n); float tol=1e-6f*mx;//Tolerance within 6 significant digits //Loop until found do{ int midPnt=(endRng+begRng)/2; //if(a[midPnt]==val)return midPnt; if(val>(a[midPnt]-tol)&&val<(*(a+midPnt)+tol))return midPnt; else if(val<a[midPnt])endRng=midPnt-1; else begRng=midPnt+1; }while(endRng>=begRng); return -1; } int linear(float *a,int n,float val){ //Declare a tolerance based on float data type //Correct way to find a float float mx=max(a,n); float tol=1e-6f*mx;//Tolerance within 6 significant digits for(int j=0;j<n-1;j++){ //if(val==a[j])return j;//Correct way to find an integer if(val>(*(a+j)-tol)&&val<(*(a+j)+tol))return j; } return -1; } float max(float *a,int n){ //Declare an initial value float mx=a[0]; for(int j=1;j<n;j++){ if(*(a+j)>mx)mx=*(a+j); } return mx; } void mrkSort(float *a,int n){ for(int j=0;j<n-1;j++){ for(int i=j+1;i<n;i++){ if(*(a+j)>*(a+i)){ float temp=*(a+j); *(a+j)=*(a+i); *(a+i)=temp; } } } } void prntAry(float *array,int n,int nCols){ cout<<endl; for(int i=0;i<n;i++){ cout<<*(array+i)<<" "; if(i%nCols==(nCols-1))cout<<endl; } cout<<endl; } float *fillAry(int n){ //Allocate memory float *array=new float[n]; for(int i=0;i<n;i++){ *(array+i)=rand()%90+10;//[10,99] } return array; }
[ "byeongju8282@gmail.com" ]
byeongju8282@gmail.com
621624a80d0fc3191a06d61e00b670d04f3612ef
04f7112bb9f33921cd39c027621c612b1c60f9cc
/Dali/dali-core/dali/public-api/object/property-notification.cpp
970a0f4e70822be7ded6d8f183e44e07806a1f2c
[]
no_license
zg2nets/windows-backend
c5cf568a3f865405a0b47c1208c9720fe00f0d02
8af57e6a295a810b51654d70af2e3e10b5a771bb
refs/heads/release
2020-09-10T01:54:58.611433
2020-02-21T04:29:24
2020-02-21T04:29:24
221,619,486
0
0
null
2020-02-21T04:29:25
2019-11-14T05:32:57
C++
UTF-8
C++
false
false
2,747
cpp
/* * Copyright (c) 2015 Samsung Electronics Co., Ltd. * * 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. * */ // CLASS HEADER #include <dali/public-api/object/property-notification.h> // INTERNAL INCLUDES #include <dali/public-api/math/quaternion.h> #include <dali/public-api/math/degree.h> #include <dali/public-api/math/radian.h> #include <dali/public-api/math/vector2.h> #include <dali/public-api/object/handle.h> #include <dali/internal/event/common/property-notification-impl.h> #include <stdio.h> namespace Dali { PropertyNotification::PropertyNotification() { } PropertyNotification::PropertyNotification(Internal::PropertyNotification* propertyNotification) : BaseHandle(propertyNotification) { } PropertyNotification PropertyNotification::DownCast( BaseHandle handle ) { return PropertyNotification( dynamic_cast<Dali::Internal::PropertyNotification*>(handle.GetObjectPtr()) ); } PropertyNotification::~PropertyNotification() { } PropertyNotification::PropertyNotification(const PropertyNotification& copy) : BaseHandle(copy) { } PropertyNotification& PropertyNotification::operator=(const PropertyNotification& rhs) { BaseHandle::operator=(rhs); return *this; } PropertyCondition PropertyNotification::GetCondition() { return GetImplementation(*this).GetCondition(); } const PropertyCondition& PropertyNotification::GetCondition() const { return GetImplementation(*this).GetCondition(); } Dali::Handle PropertyNotification::GetTarget() const { return GetImplementation(*this).GetTarget(); } Property::Index PropertyNotification::GetTargetProperty() const { return GetImplementation(*this).GetTargetProperty(); } void PropertyNotification::SetNotifyMode( NotifyMode mode ) { GetImplementation(*this).SetNotifyMode( mode ); } PropertyNotification::NotifyMode PropertyNotification::GetNotifyMode() { return GetImplementation(*this).GetNotifyMode(); } bool PropertyNotification::GetNotifyResult() const { return GetImplementation(*this).GetNotifyResult(); } PropertyNotifySignalType& PropertyNotification::NotifySignal() { return GetImplementation(*this).NotifySignal(); } } // namespace Dali
[ "noreply@github.com" ]
zg2nets.noreply@github.com
5c693aa3c51283f107ec00ad3b9995d0cdabca18
4f1d8676aaa73f8301a4d042787c10b683688c73
/BinNode/test.cpp
b934a22b577e50672ee56925c633796e2841c2ca
[]
no_license
zshiningstar/DATA_STRUCT
e7abc13187cbadf138104985ad9e81c3590b6169
b51775db6bfe653d662110f9f122932e1c721bcf
refs/heads/master
2023-05-02T19:11:12.561738
2021-05-30T04:06:05
2021-05-30T04:06:05
null
0
0
null
null
null
null
UTF-8
C++
false
false
96
cpp
#include "binnode_star.h" #include<iostream> using namespace std; int main() { return 0; }
[ "16603860375@163.com" ]
16603860375@163.com
ac8ea3dc5247315c8cfc4398b5cfcb1121b6a6be
ddd1302eb1d8c23a6dff09daae09e835a54bc0b0
/konversijamketotaldetik.cpp
e8026c50294320e120e2aeebc235e768dced47d0
[]
no_license
univmajalengka/201410018
460643423ccdab81cdfba5050eeafc038f71a5f5
b12d378483d1d9b32cf44175b527246af2286a24
refs/heads/main
2023-03-17T03:24:32.527668
2021-03-01T02:11:58
2021-03-01T02:11:58
311,772,785
0
0
null
null
null
null
UTF-8
C++
false
false
236
cpp
#include<iostream> using namespace std; int main() { int j,m,d,td; cout<<"Masukan Jam :"; cin>>j; cout<<"Masukan Menit :"; cin>>m; cout<<"Masukan Detik :"; cin>>d; td=(j*3600)+(m*60)+d; cout<<"Total Detik : "<<td; return 0; }
[ "asyaefudinz25@gmail.com" ]
asyaefudinz25@gmail.com
fd8b7a531671461da7e2ebd191d90ed67fb1aaf3
8b7fdf5100ebd616eb5ac9f2b14d1c8d6c4c0d8e
/frameworks/core/components/dialog/dialog_component.cpp
05947bc919e3c6945cbdb3e10e980b155f53cfaa
[ "Apache-2.0" ]
permissive
openharmony-sig-ci/ace_ace_engine
13f2728bce323b67ac94a34d2e9c0a941227c402
05ebe2d6d2674777f5dc64fd735088dcf1a42cd9
refs/heads/master
2023-07-25T02:26:10.854405
2021-09-10T01:48:59
2021-09-10T01:48:59
null
0
0
null
null
null
null
UTF-8
C++
false
false
32,384
cpp
/* * Copyright (c) 2021 Huawei Device Co., Ltd. * 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 "core/components/dialog/dialog_component.h" #include "base/geometry/dimension.h" #include "base/i18n/localization.h" #include "base/log/log.h" #include "base/resource/internal_resource.h" #include "base/utils/system_properties.h" #include "core/animation/curve_animation.h" #include "core/animation/curves.h" #include "core/animation/keyframe.h" #include "core/animation/keyframe_animation.h" #include "core/components/box/box_component.h" #include "core/components/button/button_theme.h" #include "core/components/common/layout/constants.h" #include "core/components/common/properties/color.h" #include "core/components/common/properties/decoration.h" #include "core/components/dialog/dialog_element.h" #include "core/components/dialog/render_dialog.h" #include "core/components/focus_collaboration/focus_collaboration_component.h" #include "core/components/focusable/focusable_component.h" #include "core/components/image/image_component.h" #include "core/components/scroll/scroll_component.h" #include "core/components/theme/theme_manager.h" #include "core/components/wrap/wrap_component.h" #include "core/pipeline/pipeline_context.h" namespace OHOS::Ace { namespace { constexpr double PHONE_ENTER_CURVE_X0 = 0.38; constexpr double PHONE_ENTER_CURVE_Y0 = 1.33; constexpr double PHONE_ENTER_CURVE_X1 = 0.60; constexpr double PHONE_ENTER_CURVE_Y1 = 1.0; constexpr double PHONE_OPACITY_MIDDLE_IN = 0.375; constexpr double PHONE_OPACITY_MIDDLE_OUT = 0.682; } // namespace const char CALLBACK_SUCCESS[] = "success"; const char CALLBACK_CANCEL[] = "cancel"; const char CALLBACK_COMPLETE[] = "complete"; const char DIALOG_TWEEN_NAME[] = "tween"; const int32_t DIALOG_BUTTONS_COUNT_WATCH = 2; const char DIALOG_OK[] = "common.ok"; const char DIALOG_CANCEL[] = "common.cancel"; const char SEPARATE[] = " "; RefPtr<Element> DialogComponent::CreateElement() { return AceType::MakeRefPtr<DialogElement>(); } RefPtr<RenderNode> DialogComponent::CreateRenderNode() { return RenderDialog::Create(); } void DialogComponent::BuildChild(const RefPtr<ThemeManager>& themeManager) { if (!themeManager) { return; } dialogTheme_ = AceType::DynamicCast<DialogTheme>(themeManager->GetTheme(DialogTheme::TypeId())); if (!dialogTheme_) { return; } if (!isDeviceTypeSet_) { deviceType_ = SystemProperties::GetDeviceType(); } auto box = AceType::MakeRefPtr<BoxComponent>(); auto backDecoration = AceType::MakeRefPtr<Decoration>(); backDecoration->SetBackgroundColor(backgroundColor_); Border border; border.SetBorderRadius(dialogTheme_->GetRadius()); backDecoration->SetBorder(border); if (deviceType_ == DeviceType::WATCH) { box->SetFlex(BoxFlex::FLEX_XY); } else { box->SetFlex(BoxFlex::FLEX_X); } box->SetBackDecoration(backDecoration); bool isLimit = true; if (height_.IsValid()) { box->SetHeight(height_.Value(), height_.Unit()); isLimit = false; } if (width_.IsValid()) { box->SetWidth(width_.Value(), width_.Unit()); isLimit = false; } if (isSetMargin_) { box->SetMargin(margin_); } auto transition = BuildAnimation(box); BuildDialogTween(transition, isLimit, margin_); auto focusCollaboration = AceType::MakeRefPtr<FocusCollaborationComponent>(); if (!HasCustomChild()) { std::list<RefPtr<Component>> columnChildren; auto column = AceType::MakeRefPtr<ColumnComponent>(FlexAlign::FLEX_START, FlexAlign::CENTER, columnChildren); column->SetMainAxisSize(MainAxisSize::MIN); BuildTitle(column); BuildContent(column); BuildActions(themeManager, column); BuildFocusChild(column, focusCollaboration); } else { // build custom child BuildFocusChild(customComponent_, focusCollaboration); } if (deviceType_ == DeviceType::WATCH) { auto scroll = AceType::MakeRefPtr<ScrollComponent>(focusCollaboration); box->SetChild(scroll); } else { box->SetChild(focusCollaboration); } box->SetTextDirection(GetTextDirection()); } void DialogComponent::BuildDialogTween(const RefPtr<TransitionComponent>& transition, bool isLimit, Edge margin) { auto dialogTween = AceType::MakeRefPtr<DialogTweenComponent>(); auto controller = AceType::MakeRefPtr<Animator>(context_); dialogTween->SetAnimator(controller); if (animator_) { animator_->AddProxyController(controller); } dialogTween->SetParentAnimator(animator_); dialogTween->SetAutoCancel(autoCancel_); dialogTween->SetChild(transition); dialogTween->SetTextDirection(GetTextDirection()); dialogTween->SetOnSuccessId(onSuccessId_); dialogTween->SetOnCancelId(onCancelId_); dialogTween->SetOnCompleteId(onCompleteId_); dialogTween->SetOnPositiveSuccessId(onPositiveSuccessId_); dialogTween->SetOnNegativeSuccessId(onNegativeSuccessId_); dialogTween->SetOnNeutralSuccessId(onNeutralSuccessId_); dialogTween->SetData(data_); dialogTween->SetDialogLimit(isLimit); if (isSetMargin_) { dialogTween->SetMargin(margin); } if (dialogTweenBox_) { const auto& dialogComposed = GenerateComposed("dialog", dialogTween, false); dialogTween->SetComposedId(dialogTweenComposedId_); dialogTween->SetCustomDialogId(customDialogId_); dialogTweenBox_->SetChild(dialogComposed); } } void DialogComponent::BuildFocusChild( const RefPtr<Component>& child, const RefPtr<FocusCollaborationComponent>& collaboration) { if (HasCustomChild()) { // for custom child collaboration->InsertChild(0, child); } else if (actions_.empty()) { auto focusable = AceType::MakeRefPtr<FocusableComponent>(child); focusable->SetFocusable(true); focusable->SetFocusNode(true); collaboration->InsertChild(0, focusable); } else { collaboration->InsertChild(0, child); } } void DialogComponent::BuildTitle(const RefPtr<ColumnComponent>& column) { if (!title_) { return; } auto titlePadding = AceType::MakeRefPtr<PaddingComponent>(); if (titlePadding_ == Edge::NONE) { titlePadding_ = (!content_ && actions_.empty()) ? dialogTheme_->GetTitleDefaultPadding() : dialogTheme_->GetTitleAdjustPadding(); } titlePadding->SetPadding(std::move(titlePadding_)); titlePadding->SetChild(title_); std::list<RefPtr<Component>> rowChildren; RefPtr<RowComponent> row; if (deviceType_ == DeviceType::PHONE) { row = AceType::MakeRefPtr<RowComponent>(FlexAlign::FLEX_START, FlexAlign::CENTER, rowChildren); } else { row = AceType::MakeRefPtr<RowComponent>(FlexAlign::CENTER, FlexAlign::CENTER, rowChildren); } row->SetStretchToParent(true); row->AppendChild(titlePadding); auto titleFlex = AceType::MakeRefPtr<FlexItemComponent>(0, 0, 0.0, row); column->AppendChild(GenerateComposed("dialogTitle", titleFlex, true)); } void DialogComponent::BuildContent(const RefPtr<ColumnComponent>& column) { if (!content_) { return; } auto contentPadding = AceType::MakeRefPtr<PaddingComponent>(); if (contentPadding_ == Edge::NONE) { if (!title_) { contentPadding_ = actions_.empty() ? dialogTheme_->GetDefaultPadding() : dialogTheme_->GetAdjustPadding(); } else { contentPadding_ = actions_.empty() ? dialogTheme_->GetContentDefaultPadding() : dialogTheme_->GetContentAdjustPadding(); } } contentPadding->SetPadding(std::move(contentPadding_)); RefPtr<FlexItemComponent> contentFlex; if (deviceType_ == DeviceType::WATCH) { contentPadding->SetChild(content_); contentFlex = AceType::MakeRefPtr<FlexItemComponent>(0, 0, 0.0, contentPadding); } else { auto scroll = AceType::MakeRefPtr<ScrollComponent>(content_); contentPadding->SetChild(scroll); contentFlex = AceType::MakeRefPtr<FlexItemComponent>(0, 1, 0.0, contentPadding); } column->AppendChild(GenerateComposed("dialogContent", contentFlex, true)); } void DialogComponent::BuildActions(const RefPtr<ThemeManager>& themeManager, const RefPtr<ColumnComponent>& column) { if (deviceType_ == DeviceType::WATCH) { BuildActionsForWatch(column); return; } if (actions_.empty()) { LOGW("the action is empty"); return; } auto actionsPadding = AceType::MakeRefPtr<PaddingComponent>(); actionsPadding->SetPadding(dialogTheme_->GetActionsPadding()); if (actions_.size() == 1) { // the button in dialog is one. std::list<RefPtr<Component>> rowChildren; auto row = AceType::MakeRefPtr<RowComponent>(FlexAlign::SPACE_AROUND, FlexAlign::FLEX_START, rowChildren); row->SetStretchToParent(true); row->AppendChild(AceType::MakeRefPtr<FlexItemComponent>( 1, 1, 0.0, BuildButton(actions_.front(), onPositiveSuccessId_, Edge::NONE, true))); actionsPadding->SetChild(row); } else if (actions_.size() == 2) { // the button in dialog is two. std::list<RefPtr<Component>> rowChildren; auto row = AceType::MakeRefPtr<RowComponent>(FlexAlign::SPACE_AROUND, FlexAlign::CENTER, rowChildren); row->SetStretchToParent(true); row->AppendChild(AceType::MakeRefPtr<FlexItemComponent>( 1, 1, 0.0, BuildButton(actions_.front(), onPositiveSuccessId_, Edge::NONE))); row->AppendChild(AceType::MakeRefPtr<FlexItemComponent>(0, 0, 0.0, BuildDivider(themeManager))); row->AppendChild(AceType::MakeRefPtr<FlexItemComponent>( 1, 1, 0.0, BuildButton(actions_.back(), onNegativeSuccessId_, Edge::NONE, true))); actionsPadding->SetChild(row); } else { // the button in dialog is more than two. std::list<RefPtr<Component>> wrapChildren; auto wrap = AceType::MakeRefPtr<WrapComponent>(wrapChildren); wrap->SetDialogStretch(true); wrap->SetMainAlignment(WrapAlignment::CENTER); wrap->SetSpacing(dialogTheme_->GetButtonSpacingHorizontal()); wrap->SetContentSpacing(dialogTheme_->GetButtonSpacingVertical()); int32_t num = 0; for (const auto& action : actions_) { ++num; if (num == 1) { wrap->AppendChild(BuildButton(action, onPositiveSuccessId_, Edge::NONE)); } else if (num == 2) { wrap->AppendChild(BuildButton(action, onNegativeSuccessId_, Edge::NONE, true)); } else if (num == 3) { wrap->AppendChild(BuildButton(action, onNeutralSuccessId_, Edge::NONE)); } else { break; } } actionsPadding->SetChild(wrap); } auto actionsFlex = AceType::MakeRefPtr<FlexItemComponent>(0, 0, 0.0, actionsPadding); column->AppendChild(actionsFlex); } void DialogComponent::BuildActionsForWatch(const OHOS::Ace::RefPtr<OHOS::Ace::ColumnComponent>& column) { if (actions_.empty() || actions_.size() != DIALOG_BUTTONS_COUNT_WATCH) { return; } std::list<RefPtr<Component>> rowChildren; auto row = AceType::MakeRefPtr<RowComponent>(FlexAlign::SPACE_BETWEEN, FlexAlign::FLEX_START, rowChildren); row->SetStretchToParent(true); row->AppendChild(BuildButton(actions_.front(), onPositiveSuccessId_, dialogTheme_->GetButtonPaddingRight())); row->AppendChild(BuildButton(actions_.back(), onNegativeSuccessId_, dialogTheme_->GetButtonPaddingLeft(), true)); auto actionsPadding = AceType::MakeRefPtr<PaddingComponent>(); actionsPadding->SetPadding(dialogTheme_->GetDefaultPadding()); actionsPadding->SetChild(row); auto actionsFlex = AceType::MakeRefPtr<FlexItemComponent>(0, 0, 0.0, actionsPadding); column->AppendChild(actionsFlex); } RefPtr<Component> DialogComponent::BuildButton( const RefPtr<ButtonComponent>& button, const EventMarker& callbackId, const Edge& edge, bool isAutoFocus) { button->SetClickedEventId(callbackId); button->SetAutoFocusState(isAutoFocus); auto buttonPadding = AceType::MakeRefPtr<PaddingComponent>(); buttonPadding->SetPadding(edge); buttonPadding->SetChild(button); return GenerateComposed("dialogButton", buttonPadding, true); } RefPtr<TransitionComponent> DialogComponent::BuildAnimation(const RefPtr<BoxComponent>& child) { if (deviceType_ == DeviceType::PHONE) { return BuildAnimationForPhone(child); } // Build scale animation for in. auto scaleFrameStart = AceType::MakeRefPtr<Keyframe<float>>(dialogTheme_->GetFrameStart(), dialogTheme_->GetScaleStart()); auto scaleFrameEnd = AceType::MakeRefPtr<Keyframe<float>>(dialogTheme_->GetFrameEnd(), dialogTheme_->GetScaleEnd()); auto scaleAnimationIn = AceType::MakeRefPtr<KeyframeAnimation<float>>(); scaleAnimationIn->AddKeyframe(scaleFrameStart); scaleAnimationIn->AddKeyframe(scaleFrameEnd); scaleAnimationIn->SetCurve(Curves::FRICTION); // Build opacity animation for in. auto opacityKeyframeStart = AceType::MakeRefPtr<Keyframe<float>>(dialogTheme_->GetFrameStart(), dialogTheme_->GetOpacityStart()); auto opacityKeyframeEnd = AceType::MakeRefPtr<Keyframe<float>>(dialogTheme_->GetFrameEnd(), dialogTheme_->GetOpacityEnd()); auto opacityAnimationIn = AceType::MakeRefPtr<KeyframeAnimation<float>>(); opacityAnimationIn->AddKeyframe(opacityKeyframeStart); opacityAnimationIn->AddKeyframe(opacityKeyframeEnd); opacityAnimationIn->SetCurve(Curves::FRICTION); // Build tween option for in TweenOption tweenOptionIn; tweenOptionIn.SetTransformFloatAnimation(AnimationType::SCALE, scaleAnimationIn); tweenOptionIn.SetOpacityAnimation(opacityAnimationIn); tweenOptionIn.SetDuration(dialogTheme_->GetAnimationDurationIn()); tweenOptionIn.SetFillMode(FillMode::FORWARDS); // Build scale animation for out. auto scaleFrameStartOut = AceType::MakeRefPtr<Keyframe<float>>(dialogTheme_->GetFrameStart(), dialogTheme_->GetScaleEnd()); auto scaleFrameEndOut = AceType::MakeRefPtr<Keyframe<float>>(dialogTheme_->GetFrameEnd(), dialogTheme_->GetScaleStart()); auto scaleAnimationOut = AceType::MakeRefPtr<KeyframeAnimation<float>>(); scaleAnimationOut->AddKeyframe(scaleFrameStartOut); scaleAnimationOut->AddKeyframe(scaleFrameEndOut); scaleAnimationOut->SetCurve(Curves::SMOOTH); // Build opacity animation for out. auto opacityKeyframeStartOut = AceType::MakeRefPtr<Keyframe<float>>(dialogTheme_->GetFrameStart(), dialogTheme_->GetOpacityEnd()); auto opacityKeyframeEndOut = AceType::MakeRefPtr<Keyframe<float>>(dialogTheme_->GetFrameEnd(), dialogTheme_->GetOpacityStart()); auto opacityAnimationOut = AceType::MakeRefPtr<KeyframeAnimation<float>>(); opacityAnimationOut->AddKeyframe(opacityKeyframeStartOut); opacityAnimationOut->AddKeyframe(opacityKeyframeEndOut); opacityAnimationOut->SetCurve(Curves::SMOOTH); // Build tween option for out TweenOption tweenOptionOut; tweenOptionOut.SetTransformFloatAnimation(AnimationType::SCALE, scaleAnimationOut); tweenOptionOut.SetOpacityAnimation(opacityAnimationOut); tweenOptionOut.SetDuration(dialogTheme_->GetAnimationDurationOut()); tweenOptionOut.SetFillMode(FillMode::FORWARDS); // Build transition auto transition = AceType::MakeRefPtr<TransitionComponent>(TweenComponent::AllocTweenComponentId(), DIALOG_TWEEN_NAME, child); transition->SetIsFirstFrameShow(false); transition->SetTransitionOption(tweenOptionIn, tweenOptionOut); return transition; } RefPtr<TransitionComponent> DialogComponent::BuildAnimationForPhone(const RefPtr<Component>& child) { // Build scale animation for in. auto scaleFrameStart = AceType::MakeRefPtr<Keyframe<float>>(dialogTheme_->GetFrameStart(), dialogTheme_->GetScaleStart()); auto scaleFrameEnd = AceType::MakeRefPtr<Keyframe<float>>(dialogTheme_->GetFrameEnd(), dialogTheme_->GetScaleEnd()); auto scaleAnimationIn = AceType::MakeRefPtr<KeyframeAnimation<float>>(); scaleAnimationIn->AddKeyframe(scaleFrameStart); scaleAnimationIn->AddKeyframe(scaleFrameEnd); auto dialogCurve = AceType::MakeRefPtr<CubicCurve>(PHONE_ENTER_CURVE_X0, PHONE_ENTER_CURVE_Y0, PHONE_ENTER_CURVE_X1, PHONE_ENTER_CURVE_Y1); scaleAnimationIn->SetCurve(dialogCurve); // Build opacity animation for in. auto opacityKeyframeStart = AceType::MakeRefPtr<Keyframe<float>>(dialogTheme_->GetFrameStart(), dialogTheme_->GetOpacityStart()); auto opacityKeyframeMiddle = AceType::MakeRefPtr<Keyframe<float>>(PHONE_OPACITY_MIDDLE_IN, dialogTheme_->GetOpacityEnd()); auto opacityKeyframeEnd = AceType::MakeRefPtr<Keyframe<float>>(dialogTheme_->GetFrameEnd(), dialogTheme_->GetOpacityEnd()); auto opacityAnimationIn = AceType::MakeRefPtr<KeyframeAnimation<float>>(); opacityAnimationIn->AddKeyframe(opacityKeyframeStart); opacityAnimationIn->AddKeyframe(opacityKeyframeMiddle); opacityAnimationIn->AddKeyframe(opacityKeyframeEnd); opacityAnimationIn->SetCurve(Curves::SHARP); // Build tween option for in TweenOption tweenOptionIn; tweenOptionIn.SetTransformFloatAnimation(AnimationType::SCALE, scaleAnimationIn); tweenOptionIn.SetOpacityAnimation(opacityAnimationIn); tweenOptionIn.SetDuration(dialogTheme_->GetAnimationDurationIn()); tweenOptionIn.SetFillMode(FillMode::FORWARDS); // Build scale animation for out. auto scaleFrameStartOut = AceType::MakeRefPtr<Keyframe<float>>(dialogTheme_->GetFrameStart(), dialogTheme_->GetScaleEnd()); auto opacityKeyframeMiddleOut = AceType::MakeRefPtr<Keyframe<float>>(PHONE_OPACITY_MIDDLE_OUT, dialogTheme_->GetOpacityEnd()); auto scaleFrameEndOut = AceType::MakeRefPtr<Keyframe<float>>(dialogTheme_->GetFrameEnd(), dialogTheme_->GetScaleStart()); auto scaleAnimationOut = AceType::MakeRefPtr<KeyframeAnimation<float>>(); scaleAnimationOut->AddKeyframe(scaleFrameStartOut); scaleAnimationOut->AddKeyframe(scaleFrameEndOut); scaleAnimationOut->SetCurve(Curves::SMOOTH); // Build opacity animation for out. auto opacityKeyframeStartOut = AceType::MakeRefPtr<Keyframe<float>>(dialogTheme_->GetFrameStart(), dialogTheme_->GetOpacityEnd()); auto opacityKeyframeEndOut = AceType::MakeRefPtr<Keyframe<float>>(dialogTheme_->GetFrameEnd(), dialogTheme_->GetOpacityStart()); auto opacityAnimationOut = AceType::MakeRefPtr<KeyframeAnimation<float>>(); opacityAnimationOut->AddKeyframe(opacityKeyframeStartOut); opacityAnimationOut->AddKeyframe(opacityKeyframeEndOut); opacityAnimationOut->SetCurve(Curves::SMOOTH); // Build tween option for out TweenOption tweenOptionOut; tweenOptionOut.SetTransformFloatAnimation(AnimationType::SCALE, scaleAnimationOut); tweenOptionOut.SetOpacityAnimation(opacityAnimationOut); tweenOptionOut.SetDuration(dialogTheme_->GetAnimationDurationOut()); tweenOptionOut.SetFillMode(FillMode::FORWARDS); auto transition = AceType::MakeRefPtr<TransitionComponent>(TweenComponent::AllocTweenComponentId(), DIALOG_TWEEN_NAME, child); transition->SetIsFirstFrameShow(false); transition->SetTransitionOption(tweenOptionIn, tweenOptionOut); return transition; } RefPtr<Component> DialogComponent::GenerateComposed( const std::string& name, const RefPtr<Component>& child, bool isDialogTweenChild) { const auto& pipelineContext = context_.Upgrade(); if (pipelineContext) { const auto& accessibilityManager = pipelineContext->GetAccessibilityManager(); if (accessibilityManager) { const auto& composedId = accessibilityManager->GenerateNextAccessibilityId(); const auto& composed = AceType::MakeRefPtr<ComposedComponent>(std::to_string(composedId), name, child); if (isDialogTweenChild) { accessibilityManager->CreateSpecializedNode(name, composedId, dialogTweenComposedId_); } else { dialogTweenComposedId_ = composedId; #if defined(WINDOWS_PLATFORM) || defined(MAC_PLATFORM) accessibilityManager->CreateSpecializedNode("inspectDialog", composedId, customDialogId_); #else accessibilityManager->CreateSpecializedNode(name, composedId, -1); #endif } return composed; } } return child; } RefPtr<Component> DialogComponent::BuildDivider(const RefPtr<ThemeManager>& themeManager) { if (!themeManager) { return nullptr; } auto padding = AceType::MakeRefPtr<PaddingComponent>(); auto dialogTheme = AceType::DynamicCast<DialogTheme>(themeManager->GetTheme(DialogTheme::TypeId())); if (!dialogTheme) { return nullptr; } if (SystemProperties::GetDeviceType() == DeviceType::TV) { padding->SetPadding(Edge(dialogTheme->GetButtonSpacingHorizontal(), Dimension(0.0, DimensionUnit::VP), Dimension(0.0, DimensionUnit::VP), Dimension(0.0, DimensionUnit::VP))); return padding; } padding->SetPadding(dialogTheme->GetDividerPadding()); auto dividerBox = AceType::MakeRefPtr<BoxComponent>(); dividerBox->SetWidth(dialogTheme->GetDividerWidth().Value(), dialogTheme->GetDividerWidth().Unit()); dividerBox->SetHeight(dialogTheme->GetDividerHeight().Value(), dialogTheme->GetDividerHeight().Unit()); auto backDecoration = AceType::MakeRefPtr<Decoration>(); backDecoration->SetBackgroundColor(dialogTheme->GetDividerColor()); dividerBox->SetBackDecoration(backDecoration); padding->SetChild(dividerBox); return padding; } RefPtr<DialogComponent> DialogBuilder::Build( const DialogProperties& dialogProperties, const WeakPtr<PipelineContext>& context) { auto pipelineContext = context.Upgrade(); if (!pipelineContext) { return RefPtr<DialogComponent>(); } auto themeManager = pipelineContext->GetThemeManager(); if (!themeManager) { return RefPtr<DialogComponent>(); } auto dialogTheme = AceType::DynamicCast<DialogTheme>(themeManager->GetTheme(DialogTheme::TypeId())); if (!dialogTheme) { return RefPtr<DialogComponent>(); } std::string data; auto dialog = AceType::MakeRefPtr<DialogComponent>(); dialog->SetContext(context); dialog->SetBackgroundColor(dialogTheme->GetBackgroundColor()); // Set title and content of dialog BuildTitleAndContent(dialog, dialogProperties, dialogTheme, data); // Set buttons of dialog BuildButtons(themeManager, dialog, dialogProperties.buttons, dialogTheme, data); // Build DialogTween auto controller = AceType::MakeRefPtr<Animator>(context); dialog->SetAnimator(controller); dialog->SetAutoCancel(dialogProperties.autoCancel); dialog->SetData(data); // Set eventMarker of dialog component if (!dialogProperties.callbacks.empty()) { for (const auto& callback : dialogProperties.callbacks) { if (callback.first == CALLBACK_SUCCESS) { dialog->SetOnSuccessId(callback.second); } if (callback.first == CALLBACK_CANCEL) { dialog->SetOnCancelId(callback.second); } if (callback.first == CALLBACK_COMPLETE) { dialog->SetOnCompleteId(callback.second); } } } return BuildAnimation(dialog, dialogTheme); } void DialogBuilder::BuildTitleAndContent(const RefPtr<DialogComponent>& dialog, const DialogProperties& dialogProperties, const RefPtr<DialogTheme>& dialogTheme, std::string& data) { auto deviceType = SystemProperties::GetDeviceType(); if ((deviceType != DeviceType::WATCH) && (!dialogProperties.title.empty())) { auto titleComponent = AceType::MakeRefPtr<TextComponent>(dialogProperties.title); auto style = dialogTheme->GetTitleTextStyle(); style.SetMaxLines(dialogTheme->GetTitleMaxLines()); style.SetTextOverflow(TextOverflow::ELLIPSIS); style.SetAdaptTextSize(style.GetFontSize(), dialogTheme->GetTitleMinFontSize()); titleComponent->SetTextStyle(style); titleComponent->SetFocusColor(style.GetTextColor()); dialog->SetTitle(titleComponent); data += dialogProperties.title + SEPARATE; } if (!dialogProperties.content.empty()) { auto contentComponent = AceType::MakeRefPtr<TextComponent>(dialogProperties.content); auto contentStyle = dialogTheme->GetContentTextStyle(); if (deviceType == DeviceType::WATCH) { std::vector<TextSizeGroup> preferTextSizeGroups; preferTextSizeGroups.push_back({ contentStyle.GetFontSize(), 1 }); preferTextSizeGroups.push_back({ dialogTheme->GetContentMinFontSize(), UINT32_MAX, TextOverflow::NONE }); contentStyle.SetPreferTextSizeGroups(preferTextSizeGroups); contentStyle.SetTextAlign(TextAlign::CENTER); } contentComponent->SetTextStyle(contentStyle); contentComponent->SetFocusColor(dialogTheme->GetContentTextStyle().GetTextColor()); dialog->SetContent(contentComponent); data += dialogProperties.content + SEPARATE; } } void DialogBuilder::BuildButtons(const RefPtr<ThemeManager>& themeManager, const RefPtr<DialogComponent>& dialog, const std::vector<std::pair<std::string, std::string>>& buttons, const RefPtr<DialogTheme>& dialogTheme, std::string& data) { if (SystemProperties::GetDeviceType() == DeviceType::WATCH) { BuildButtonsForWatch(themeManager, dialog, data); return; } if (buttons.empty()) { return; } auto buttonTheme = AceType::DynamicCast<ButtonTheme>(themeManager->GetTheme(ButtonTheme::TypeId())); if (!buttonTheme) { return; } std::list<RefPtr<ButtonComponent>> buttonComponents; for (const auto& button : buttons) { if (button.first.empty()) { continue; } data += button.first + SEPARATE; TextStyle buttonTextStyle = buttonTheme->GetTextStyle(); RefPtr<ButtonComponent> buttonComponent; if (!button.second.empty()) { buttonTextStyle.SetTextColor(Color::FromString(button.second)); buttonComponent = ButtonBuilder::Build(themeManager, button.first, buttonTextStyle, Color::FromString(button.second), true); } else { const Color TEXT_COLOR = Color::FromString("#0a59f4"); buttonTextStyle.SetTextColor(TEXT_COLOR); buttonComponent = ButtonBuilder::Build(themeManager, button.first, buttonTextStyle, TEXT_COLOR, true); } buttonTextStyle.SetAdaptTextSize(buttonTheme->GetMaxFontSize(), buttonTheme->GetMinFontSize()); buttonTextStyle.SetMaxLines(1); buttonTextStyle.SetTextOverflow(TextOverflow::ELLIPSIS); buttonComponent->SetBackgroundColor(dialogTheme->GetButtonBackgroundColor()); static const Color buttonHoverColor = Color::FromString("#0C000000"); buttonComponent->SetHoverColor(buttonHoverColor); buttonComponent->SetClickedColor(dialogTheme->GetButtonClickedColor()); buttonComponent->SetType(ButtonType::TEXT); buttonComponents.emplace_back(buttonComponent); } dialog->SetActions(buttonComponents); } void DialogBuilder::BuildButtonsForWatch( const RefPtr<ThemeManager>& themeManager, const RefPtr<DialogComponent>& dialog, std::string& data) { auto buttonTheme = AceType::DynamicCast<ButtonTheme>(themeManager->GetTheme(ButtonTheme::TypeId())); auto dialogTheme = AceType::DynamicCast<DialogTheme>(themeManager->GetTheme(DialogTheme::TypeId())); if (!buttonTheme || !dialogTheme) { return; } std::string buttonText; std::list<RefPtr<ButtonComponent>> buttonComponents; for (int32_t i = 1; i <= DIALOG_BUTTONS_COUNT_WATCH; ++i) { auto buttonPadding = AceType::MakeRefPtr<PaddingComponent>(); buttonPadding->SetPadding(buttonTheme->GetMinCircleButtonPadding()); RefPtr<ImageComponent> buttonIcon; if (i == 1) { buttonText = Localization::GetInstance()->GetEntryLetters(DIALOG_CANCEL); buttonIcon = AceType::MakeRefPtr<ImageComponent>(InternalResource::ResourceId::WRONG_SVG); } else { buttonText = Localization::GetInstance()->GetEntryLetters(DIALOG_OK); buttonIcon = AceType::MakeRefPtr<ImageComponent>(InternalResource::ResourceId::CORRECT_SVG); } data += buttonText + SEPARATE; buttonIcon->SetWidth(buttonTheme->GetMinCircleButtonIcon()); buttonIcon->SetHeight(buttonTheme->GetMinCircleButtonIcon()); buttonPadding->SetChild(buttonIcon); std::list<RefPtr<Component>> buttonChildren; buttonChildren.emplace_back(buttonPadding); auto buttonComponent = AceType::MakeRefPtr<ButtonComponent>(buttonChildren); buttonComponent->SetWidth(buttonTheme->GetMinCircleButtonDiameter()); buttonComponent->SetHeight(buttonTheme->GetMinCircleButtonDiameter()); buttonComponent->SetRectRadius(buttonTheme->GetMinCircleButtonDiameter() / 2.0); buttonComponent->SetBackgroundColor(buttonTheme->GetBgColor()); buttonComponent->SetClickedColor(buttonTheme->GetClickedColor()); if (i == 2) { buttonComponent->SetBackgroundColor(dialogTheme->GetButtonBackgroundColor()); buttonComponent->SetClickedColor(dialogTheme->GetButtonClickedColor()); } buttonComponent->SetFocusColor(buttonTheme->GetBgFocusColor()); buttonComponent->SetFocusAnimationColor(buttonTheme->GetBgFocusColor()); buttonComponent->SetAccessibilityText(buttonText); buttonComponents.emplace_back(buttonComponent); } dialog->SetActions(buttonComponents); } RefPtr<DialogComponent> DialogBuilder::BuildAnimation( const RefPtr<DialogComponent>& dialogChild, const RefPtr<DialogTheme>& dialogTheme) { auto tweenBox = AceType::MakeRefPtr<BoxComponent>(); auto decoration = AceType::MakeRefPtr<Decoration>(); decoration->SetBackgroundColor(Color(dialogTheme->GetMaskColorEnd())); tweenBox->SetBackDecoration(decoration); const auto& colorAnimation = AceType::MakeRefPtr<CurveAnimation<Color>>( dialogTheme->GetMaskColorStart(), dialogTheme->GetMaskColorEnd(), Curves::LINEAR); colorAnimation->SetEvaluator(AceType::MakeRefPtr<ColorEvaluator>()); // Build tween option of in TweenOption tweenOptionIn; tweenOptionIn.SetColorAnimation(colorAnimation); tweenOptionIn.SetDuration(dialogTheme->GetAnimationDurationIn()); tweenOptionIn.SetFillMode(FillMode::FORWARDS); // Build tween option of out const auto& colorAnimationOut = AceType::MakeRefPtr<CurveAnimation<Color>>( dialogTheme->GetMaskColorEnd(), dialogTheme->GetMaskColorStart(), Curves::LINEAR); colorAnimationOut->SetEvaluator(AceType::MakeRefPtr<ColorEvaluator>()); TweenOption tweenOptionOut; tweenOptionOut.SetColorAnimation(colorAnimationOut); tweenOptionOut.SetDuration(dialogTheme->GetAnimationDurationOut()); tweenOptionOut.SetFillMode(FillMode::FORWARDS); // Build transition auto transition = AceType::MakeRefPtr<TransitionComponent>(TweenComponent::AllocTweenComponentId(), "transition", tweenBox); transition->SetIsFirstFrameShow(false); transition->SetTransitionOption(tweenOptionIn, tweenOptionOut); dialogChild->SetChild(transition); dialogChild->SetDialogTweenBox(tweenBox); return dialogChild; } } // namespace OHOS::Ace
[ "mamingshuai1@huawei.com" ]
mamingshuai1@huawei.com
b1d4ac93d2f1041055060762250f7cd0dc38a5e9
f82a66b48457562b675013965dffc8867f618998
/C++/bot/main.cpp
e4d0248baff3164224b4f2a47d2af4a86fa563bb
[]
no_license
FayeWilliams/gencode
bdad9593363fa193d88a9a65dc981492f9c67d5d
c8e2140d99918efa52721a23566e3b6f98d2b39a
refs/heads/master
2021-01-25T05:11:20.622976
2014-03-02T14:12:54
2014-03-02T14:12:54
null
0
0
null
null
null
null
UTF-8
C++
false
false
727
cpp
// Faye Williams // 23 May 2006 // main.cpp // Main program file #include <iostream> #include "Speech.h" #include "Defines.h" using namespace std; int main() { Speech sentence; char buf[256] = {0}; char response[256] = {0}; bool negativeFormality = false; int type = 0; cout << "Waking bot... type 00, or say goodbye to exit" << endl; cout << "..." << endl; cout << "..." << endl; cout << "bot>hello." << endl; while(!negativeFormality) { cout << " >"; cin.getline(buf,256,'\n'); if (0 == memcmp( buf, "00", 2 )) { break; } sentence.SetBuffer(buf); sentence.EvaluateInput( response ); cout << "bot>" << response << endl; } return 0; }
[ "faye@fayes-imac.home" ]
faye@fayes-imac.home
9bd5004cf7d9925a9bf966219abbf16f0d4fa4b5
22938e866c53436c721074adda227e2a9d9185f6
/Day 05/ex05/Form.hpp
875866d67f157bfacb772d14111c4f7250f65180
[]
no_license
olehsamoilenko/Piscine-CPP
125a3f3ca575f8c6e5ea81fc05674a2b8e183399
dc7311b09892d06909f4d0a44aaacd5c7f2d7418
refs/heads/master
2020-06-02T11:23:10.661165
2019-07-04T17:40:14
2019-07-04T17:40:14
191,138,844
0
0
null
null
null
null
UTF-8
C++
false
false
2,968
hpp
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* Form.hpp :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: osamoile <marvin@42.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2019/07/01 12:23:47 by osamoile #+# #+# */ /* Updated: 2019/07/01 12:23:48 by osamoile ### ########.fr */ /* */ /* ************************************************************************** */ #ifndef FORM_HPP # define FORM_HPP #include <iostream> class Bureaucrat; class Form { public: Form(Form const &); Form(std::string name, int gradeSign, int gradeExec); Form(std::string name, int gradeSign, int gradeExec, std::string target); virtual ~Form(void); Form & operator=(Form const &); std::string getTarget(void) const; std::string getName(void) const; bool getSigned(void) const; int getGradeRequiredSign(void) const; int getGradeRequiredExec(void) const; void beSigned(Bureaucrat const & b); virtual void execute(Bureaucrat const & executor) const = 0; class GradeTooLowException : public std::exception { public: GradeTooLowException(void); GradeTooLowException(std::string msg); GradeTooLowException(GradeTooLowException const &); GradeTooLowException & operator=(GradeTooLowException const &); virtual ~GradeTooLowException(void) throw(); virtual const char * what() const throw(); private: std::string _msg; }; class GradeTooHighException : public std::exception { public: GradeTooHighException(void); GradeTooHighException(std::string msg); GradeTooHighException(GradeTooHighException const &); GradeTooHighException & operator=(GradeTooHighException const &); virtual ~GradeTooHighException(void) throw(); virtual const char * what() const throw(); private: std::string _msg; }; class FormNotSignedException : public std::exception { public: FormNotSignedException(void); FormNotSignedException(std::string msg); FormNotSignedException(FormNotSignedException const &); FormNotSignedException & operator=(FormNotSignedException const &); virtual ~FormNotSignedException(void) throw(); virtual const char * what() const throw(); private: std::string _msg; }; protected: Form(void); private: const std::string _name; bool _signed; const int _gradeRequiredSign; const int _gradeRequiredExec; std::string _target; }; std::ostream & operator<<(std::ostream & o, Form const & src); #endif
[ "osamoile@e1r6p7.unit.ua" ]
osamoile@e1r6p7.unit.ua
837f21f26fd291cc88c7a2eb50e8aa0535268512
34389129a98285960c2762ff4c828cfe5e1f6777
/FCollada/FCDocument/FCDTexture.h
e5134873addfbbd28cb825001ab1a84637bb4e8d
[ "MIT", "LicenseRef-scancode-x11-xconsortium-veillard" ]
permissive
rdb/fcollada
3d44b5134464e8157cf65458e49875ce1436b6b7
5b948b08514df5c0028888ff29969e291d6989c7
refs/heads/master
2021-09-23T12:20:51.266824
2021-01-06T13:49:54
2021-01-06T13:49:54
56,793,455
10
6
null
2021-09-14T16:45:48
2016-04-21T17:34:16
C
UTF-8
C++
false
false
4,645
h
/* Copyright (C) 2005-2007 Feeling Software Inc. Portions of the code are: Copyright (C) 2005-2007 Sony Computer Entertainment America MIT License: http://www.opensource.org/licenses/mit-license.php */ /* Based on the FS Import classes: Copyright (C) 2005-2006 Feeling Software Inc Copyright (C) 2005-2006 Autodesk Media Entertainment MIT License: http://www.opensource.org/licenses/mit-license.php */ /** @file FCDTexture.h This file contains the FCDTexture class. */ #ifndef _FCD_TEXTURE_H_ #define _FCD_TEXTURE_H_ #ifndef _FCD_ENTITY_H_ #include "FCDocument/FCDEntity.h" #endif // _FCD_ENTITY_H_ #ifndef _FU_DAE_ENUM_H_ #include "FUtils/FUDaeEnum.h" #endif // _FU_DAE_ENUM_H_ class FCDocument; class FCDEffectParameter; class FCDEffectParameterSampler; class FCDEffectStandard; class FCDImage; #if defined(WIN32) template <class T> class FCOLLADA_EXPORT FCDEffectParameterT; /**< Trick Doxygen. */ #elif defined(LINUX) || defined(__APPLE__) template <class T> class FCDEffectParameterT; /**< Trick Doxygen. */ #endif // LINUX typedef FCDEffectParameterT<int32> FCDEffectParameterInt; /**< An integer effect parameter. */ /** A COLLADA texture. Textures are used by the COMMON profile materials. As per the COLLADA 1.4 specification, a texture is used to match some texture coordinates with a surface sampler, on a given texturing channel. Therefore: textures hold the extra information necessary to place an image correctly onto polygon sets. This extra information includes the texturing coordinate transformations and the blend mode. @ingroup FCDEffect */ class FCOLLADA_EXPORT FCDTexture : public FCDObject { private: DeclareObjectType(FCDObject); FCDEffectStandard* parent; DeclareParameterPtr(FCDEffectParameterSampler, sampler, FC("Sampler")); // Points to the surface, which points to the image. DeclareParameterRef(FCDEffectParameterInt, set, FC("Set")); // Always preset, this parameter hold the map channel/uv set index DeclareParameterRef(FCDExtra, extra, FC("Extra Tree")); public: /** Constructor. Do not use directly. Instead, use the FCDEffectStandard::AddTexture function. @param document The COLLADA document that owns this texture. @param parent The standard effect that contains this texture. */ FCDTexture(FCDocument* document, FCDEffectStandard* parent = NULL); /** Destructor. */ virtual ~FCDTexture(); /** Access the parent standard effect or this texture. @return The parent effect.*/ FCDEffectStandard* GetParent() const { return parent; } /** Retrieves the image information for this texture. @return The image. This pointer will be NULL if this texture is not yet tied to a valid image. */ inline FCDImage* GetImage() { return const_cast<FCDImage*>(const_cast<const FCDTexture*>(this)->GetImage()); } const FCDImage* GetImage() const; /**< See above. */ /** Set the image information for this texture. This is a shortcut that generates the sampler/surface parameters to access the given image. @param image The image information. This pointer may be NULL to disconnect an image. */ void SetImage(FCDImage* image); /** Retrieves the surface sampler for this texture. @return The sampler. In the non-const method: the sampler will be created if it is currently missing and the parent is available. */ FCDEffectParameterSampler* GetSampler(); inline const FCDEffectParameterSampler* GetSampler() const { return sampler; } /**< See above. */ /** Sets the targeted sampler. @param _sampler The new sampler. */ inline void SetSampler(FCDEffectParameterSampler* _sampler) { sampler = _sampler; } /** Determines whether this texture targets a sampler. @return Whether the texture targets a sampler. */ inline bool HasSampler() { return sampler != NULL; } /** Retrieves the texture coordinate set to use with this texture. This information is duplicated from the material instance abstraction level. @return The effect parameter containing the set. */ inline FCDEffectParameterInt* GetSet() { return set; } inline const FCDEffectParameterInt* GetSet() const { return set; } /**< See above. */ /** Retrieves the extra information tied to this texture. @return The extra tree. */ inline FCDExtra* GetExtra() { return extra; } inline const FCDExtra* GetExtra() const { return extra; } /**< See above. */ /** Clones the texture. @param clone The cloned texture. If this pointer is NULL, a new texture is created and you will need to release this new texture. @return The cloned texture. This pointer will never be NULL. */ virtual FCDTexture* Clone(FCDTexture* clone = NULL) const; }; #endif // _FCD_TEXTURE_H_
[ "git@rdb.name" ]
git@rdb.name
f1a00839cc10b8c5d9af36ce008138831b7215cb
3b0e45cef8facfddb91ccc2fc5a5ee8fe482f6c3
/basic_class/basic_class_main.cpp
4ba998bbef69f1b9c02706e382361ceaaaf17c66
[]
no_license
sandeeptalan/basic_examples
a76f711c70e0b7db0a8c6676e59559cb0b0ebe0c
8a92a30a1a3d75adb019f5423b63fba3a647e414
refs/heads/master
2021-05-07T13:53:34.985614
2017-11-10T10:44:45
2017-11-10T10:44:45
109,709,707
0
0
null
null
null
null
UTF-8
C++
false
false
376
cpp
#include "basic_class.h" using namespace std; int main() { char to_pass[13] = "SandeepTalan"; cout << "Hello Basic Class!!!" << endl; basic b1(50, to_pass); strcpy(to_pass, "SarikaTalan"); basic b2(10, to_pass); basic b3(b1); //Copy Constructor b3 = b2; //Assignment Operator b3 = b3; //Self Assignment return 0; }
[ "talan.sandeep@gmail.com" ]
talan.sandeep@gmail.com
a8d2be6dbc0f863fded7b8ce8a6c6d7af8989e37
9a3f8c3d4afe784a34ada757b8c6cd939cac701d
/leetQueReconByHeight.cpp
54ccdee6388ed9ab0da80b0ea9825e1e11f3f8ec
[]
no_license
madhav-bits/Coding_Practice
62035a6828f47221b14b1d2a906feae35d3d81a8
f08d6403878ecafa83b3433dd7a917835b4f1e9e
refs/heads/master
2023-08-17T04:58:05.113256
2023-08-17T02:00:53
2023-08-17T02:00:53
106,217,648
1
1
null
null
null
null
UTF-8
C++
false
false
2,523
cpp
/* * //******************************************************406. Queue Reconstruction by Height.*********************************************** Suppose you have a random list of people standing in a queue. Each person is described by a pair of integers (h, k), where h is the height of the person and k is the number of people in front of this person who have a height greater than or equal to h. Write an algorithm to reconstruct the queue. Note: The number of people is less than 1,100. Example Input: [[7,0], [4,4], [7,1], [5,0], [6,1], [5,2]] Output: [[5,0], [7,0], [5,2], [6,1], [4,4], [7,1]] *******************************************************************TEST CASES:************************************************************ //These are the examples I had created, tweaked and worked on. [[7,0],[4,4],[7,1],[5,0],[6,1],[5,2],[4,2]] // Time Complexity: O(n^2). // Space Complexity: O(n). //********************************************************THIS IS LEET ACCEPTED CODE.*************************************************** */ //************************************************************Solution 1:************************************************************ //*****************************************************THIS IS LEET ACCEPTED CODE.*********************************************** // Time Complexity: O(n^2). // Space Complexity: O(n). // ****************************************************This is GREEDY ALGORITHM.****************************************************** // This is GREEDY Algorithm, first sorting the vector based on height, if height is equal, then sort based on #people above infront of him. Next // in the second iteration, we start from the beginning and insert the numbers(height) into the final result based on #infront of him. class Solution { public: vector<pair<int, int>> reconstructQueue(vector<pair<int, int>>& v) { //vector<pair<int, int>> v; sort(v.begin(), v.end(), [](const auto& lt, const auto& rt){ //Sort numbers based on height if equal based on #infront of him. return lt.first>rt.first || (lt.first== rt.first && lt.second<rt.second); }); vector<pair<int, int>> res; for(int i=0;i<v.size();i++){ // Iterating the sorted array. res.insert(res.begin()+v[i].second, v[i]); // Inserting the pair into the final res based on #infront of him. } return res; // Returning the final queue of persons. } };
[ "kasamsaimadhavk@gmail.com" ]
kasamsaimadhavk@gmail.com
a5e0c8937164404e414b415326c13670018e87f6
33035c05aad9bca0b0cefd67529bdd70399a9e04
/src/boost_spirit_include_qi_auto.hpp
a19cd18aaabab78545dacdf0998b13c7e763a6aa
[ "LicenseRef-scancode-unknown-license-reference", "BSL-1.0" ]
permissive
elvisbugs/BoostForArduino
7e2427ded5fd030231918524f6a91554085a8e64
b8c912bf671868e2182aa703ed34076c59acf474
refs/heads/master
2023-03-25T13:11:58.527671
2021-03-27T02:37:29
2021-03-27T02:37:29
null
0
0
null
null
null
null
UTF-8
C++
false
false
44
hpp
#include <boost/spirit/include/qi_auto.hpp>
[ "k@kekyo.net" ]
k@kekyo.net
7c1923a86e710779a9055118277aa734f691687d
68e06f34b77a3ba7e6cfb17e9cc441550d4c190b
/lab/Programa 3/Archivo.h
62aa58d25d74c2a3cc0d6036770ddf51a6ad91c0
[]
no_license
HernanIruegas/calidad-software
f492d52e54eba7b5f64543a6728b7f8aa2643bdf
c9d0b9a8e47d6320791a8cf8dfcf9f420926ae0c
refs/heads/master
2020-04-05T14:52:58.827500
2018-11-10T03:48:00
2018-11-10T03:48:00
156,944,802
0
0
null
null
null
null
UTF-8
C++
false
false
3,764
h
// Clase Archivo que guarda todos los valores resultado de las operaciones para realizar la regresión lineal // Hernán Iruegas Villarreal A00817021 // 14/04/2018 //_p=Archivo //_b=108 class Archivo { public: Archivo(); string getNombre(); double getSumXValues(); double getSumYValues(); double getAvgX(); double getAvgY(); double getSumSquaredXValues(); double getSumSquaredYValues(); double getSumXTimesYValues(); double getTheta0(); double getTheta1(); double getR(); double getRSquared(); double getYPrediction(); void setNombre( string sNombreArchivo ); //_d=7 void calculateInfoXAndY( vector<double> vAllXValues, vector<double> vAllYValues, int iNumberOfPairs ); void setTheta0( double fTheta0 ); void setTheta1( double fTheta1 ); void setR( double fR); void setRSquared( double fRSquared ); void setYPrediction( double fYPrediction ); private: string sNombreArchivo; double fSumXValues; double fSumYValues; double fAvgX; double fAvgY; double fSumSquaredXValues; double fSumSquaredYValues; double fSumXtimesYValues; double fTheta0; double fTheta1; double fR; double fRSquared; double fYPrediction; }; //_i Archivo::Archivo(){ sNombreArchivo = "default.txt"; fSumXValues = 0; fSumYValues = 0; fAvgX = 0; fAvgY = 0; fSumSquaredXValues = 0; fSumSquaredYValues = 0; fSumXtimesYValues = 0; fTheta0 = 0; fTheta1 = 0; fR = 0; fRSquared = 0; fYPrediction = 0; } //_i string Archivo::getNombre(){ return this -> sNombreArchivo; } //_i double Archivo::getSumXValues(){ return this -> fSumXValues; } //_i double Archivo::getSumYValues(){ return this -> fSumYValues; } //_i double Archivo::getAvgX(){ return this -> fAvgX; } //_i double Archivo::getAvgY(){ return this -> fAvgY; } //_i double Archivo::getSumSquaredXValues(){ return this -> fSumSquaredXValues; } //_i double Archivo::getSumSquaredYValues(){ return this -> fSumSquaredYValues; } //_i double Archivo::getSumXTimesYValues(){ return this -> fSumXtimesYValues; } //_i double Archivo::getTheta0(){ return this -> fTheta0; } //_i double Archivo::getTheta1(){ return this -> fTheta1; } //_i double Archivo::getR(){ return this -> fR; } //_i double Archivo::getRSquared(){ return this -> fRSquared; } //_i double Archivo::getYPrediction(){ return this -> fYPrediction; } //_i void Archivo::setNombre( string sNombreArchivo ){ this -> sNombreArchivo = sNombreArchivo; } //_d=14 //_i void Archivo::calculateInfoXAndY( vector<double> vAllXValues, vector<double> vAllYValues, int iNumberOfPairs ){ double fSumXValuesAux; double fSumYValuesAux; double fSumSquaredXValuesAux; double fSumSquaredYValuesAux; double fSumXtimesYValuesAux; for( int i = 0; i < iNumberOfPairs; i++ ){ fSumXValuesAux += vAllXValues[i]; fSumYValuesAux += vAllYValues[i]; fSumSquaredXValuesAux += ( vAllXValues[i] * vAllXValues[i] ); fSumSquaredYValuesAux += ( vAllYValues[i] * vAllYValues[i] ); fSumXtimesYValuesAux += ( vAllXValues[i] * vAllYValues[i] ); } this -> fSumXValues = fSumXValuesAux; this -> fSumYValues = fSumYValuesAux; this -> fAvgX = fSumXValuesAux / iNumberOfPairs; this -> fAvgY = fSumYValuesAux / iNumberOfPairs; this -> fSumSquaredXValues = fSumSquaredYValuesAux; this -> fSumSquaredYValues = fSumXtimesYValuesAux; } //_i void Archivo::setTheta0( double fTheta0 ){ this -> fTheta0 = fTheta0; } //_i void Archivo::setTheta1( double fTheta1 ){ this -> fTheta1 = fTheta1; } //_i void Archivo::setR( double fR){ this -> fR = fR; } //_i void Archivo::setRSquared( double fRSquared ){ this -> fRSquared = fRSquared; } //_i void Archivo::setYPrediction( double fYPrediction ){ this -> fYPrediction = fYPrediction; }
[ "hernaniruegas@hotmail.com" ]
hernaniruegas@hotmail.com
48eb5ea475d137c298746f7e366f589fcd674422
56d86a0dfecf725a178c2a7b2f282b8eed5880b5
/FileSystem.cpp
b2e8c7d244a036f41904518c9456d48387a62198
[]
no_license
SahoryHerrera/P3Lab6_SahoryCano
d5a531e80b4a9343148a378a53ff5aa3ce5eb9ec
4a872224684c68ee6342b69f024a561e8c0d6959
refs/heads/main
2023-04-26T02:09:13.625985
2021-05-29T01:53:21
2021-05-29T01:53:21
371,829,073
0
0
null
null
null
null
UTF-8
C++
false
false
153
cpp
#include "FileSystem.h" FileSystem::FileSystem() { } FileSystem::FileSystem(const FileSystem& orig) { } FileSystem::~FileSystem() { }
[ "noreply@github.com" ]
SahoryHerrera.noreply@github.com
a18f659206000ed71f2a8244085efd5ee268687b
04b1803adb6653ecb7cb827c4f4aa616afacf629
/components/autofill/core/browser/geo/phone_number_i18n.cc
d0ea183f79b5b4124f90e5a60477073a7bb382c2
[ "BSD-3-Clause" ]
permissive
Samsung/Castanets
240d9338e097b75b3f669604315b06f7cf129d64
4896f732fc747dfdcfcbac3d442f2d2d42df264a
refs/heads/castanets_76_dev
2023-08-31T09:01:04.744346
2021-07-30T04:56:25
2021-08-11T05:45:21
125,484,161
58
49
BSD-3-Clause
2022-10-16T19:31:26
2018-03-16T08:07:37
null
UTF-8
C++
false
false
16,786
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 "components/autofill/core/browser/geo/phone_number_i18n.h" #include <utility> #include "base/logging.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_piece.h" #include "base/strings/string_util.h" #include "base/strings/utf_string_conversions.h" #include "components/autofill/core/browser/autofill_data_util.h" #include "components/autofill/core/browser/data_model/autofill_profile.h" #include "components/autofill/core/browser/geo/autofill_country.h" #include "third_party/libphonenumber/phonenumber_api.h" namespace autofill { namespace { using ::i18n::phonenumbers::PhoneNumberUtil; // Formats the |phone_number| to the specified |format|. Returns the original // number if the operation is not possible. std::string FormatPhoneNumber(const std::string& phone_number, const std::string& country_code, PhoneNumberUtil::PhoneNumberFormat format) { ::i18n::phonenumbers::PhoneNumber parsed_number; PhoneNumberUtil* phone_number_util = PhoneNumberUtil::GetInstance(); if (phone_number_util->Parse(phone_number, country_code, &parsed_number) != PhoneNumberUtil::NO_PARSING_ERROR) { return phone_number; } std::string formatted_number; phone_number_util->Format(parsed_number, format, &formatted_number); return formatted_number; } std::string SanitizeRegion(const std::string& region, const std::string& app_locale) { if (region.length() == 2) return region; return AutofillCountry::CountryCodeForLocale(app_locale); } // Formats the given |number| as a human-readable string, and writes the result // into |formatted_number|. Also, normalizes the formatted number, and writes // that result into |normalized_number|. This function should only be called // with numbers already known to be valid, i.e. validation should be done prior // to calling this function. Note that the |country_code|, which determines // whether to format in the national or in the international format, is passed // in explicitly, as |number| might have an implicit country code set, even // though the original input lacked a country code. void FormatValidatedNumber(const ::i18n::phonenumbers::PhoneNumber& number, const base::string16& country_code, base::string16* formatted_number, base::string16* normalized_number) { PhoneNumberUtil::PhoneNumberFormat format = country_code.empty() ? PhoneNumberUtil::NATIONAL : PhoneNumberUtil::INTERNATIONAL; PhoneNumberUtil* phone_util = PhoneNumberUtil::GetInstance(); std::string processed_number; phone_util->Format(number, format, &processed_number); std::string region_code; phone_util->GetRegionCodeForNumber(number, &region_code); // Drop the leading '+' for US/CA numbers as some sites can't handle the "+", // and in these regions dialing "+1..." is the same as dialing "1...". // TODO(crbug/226778): Investigate whether the leading "+" is desirable in // other regions. Closed bug crbug/98911 contains additional context. std::string prefix; if (processed_number[0] == '+') { processed_number = processed_number.substr(1); if (region_code != "US" && region_code != "CA") prefix = "+"; } if (formatted_number) *formatted_number = base::UTF8ToUTF16(prefix + processed_number); if (normalized_number) { phone_util->NormalizeDigitsOnly(&processed_number); *normalized_number = base::UTF8ToUTF16(prefix + processed_number); } } // Returns false iff |str| contains any characters from the range 0-31 // (inclusive) or the "delete" character (127). This allows the characters in // 128-255 because |str| is assumed to be in UTF-8. Note that for all // multi-byte UTF-8 characters, every byte has its most significant bit set // (i.e., is in the range 128-255, inclusive), so all bytes <=127 are // single-byte characters. bool IsPrintable(base::StringPiece str) { for (unsigned char c : str) { if (c < 32 || c == 127) return false; } return true; } } // namespace namespace i18n { const size_t kMaxPhoneNumberSize = 40u; // Returns true if |phone_number| is a possible number. bool IsPossiblePhoneNumber( const ::i18n::phonenumbers::PhoneNumber& phone_number) { PhoneNumberUtil* phone_util = PhoneNumberUtil::GetInstance(); return phone_util->IsPossibleNumber(phone_number); } bool IsPossiblePhoneNumber(const std::string& phone_number, const std::string& country_code) { ::i18n::phonenumbers::PhoneNumber parsed_number; PhoneNumberUtil* phone_util = PhoneNumberUtil::GetInstance(); auto result = phone_util->ParseAndKeepRawInput(phone_number, country_code, &parsed_number); return result == ::i18n::phonenumbers::PhoneNumberUtil::NO_PARSING_ERROR && phone_util->IsPossibleNumber(parsed_number); } bool IsValidPhoneNumber(const std::string& phone_number, const std::string& country_code) { ::i18n::phonenumbers::PhoneNumber parsed_number; PhoneNumberUtil* phone_util = PhoneNumberUtil::GetInstance(); auto result = phone_util->ParseAndKeepRawInput(phone_number, country_code, &parsed_number); return result == ::i18n::phonenumbers::PhoneNumberUtil::NO_PARSING_ERROR && phone_util->IsValidNumber(parsed_number); } // Parses the number stored in |value| as it should be interpreted in the given // |default_region|, and stores the results into the remaining arguments. // The |default_region| should be sanitized prior to calling this function. bool ParsePhoneNumber(const base::string16& value, const std::string& default_region, base::string16* country_code, base::string16* city_code, base::string16* number, std::string* inferred_region, ::i18n::phonenumbers::PhoneNumber* i18n_number) { country_code->clear(); city_code->clear(); number->clear(); *i18n_number = ::i18n::phonenumbers::PhoneNumber(); if (value.size() > kMaxPhoneNumberSize) return false; std::string number_text; if (!base::UTF16ToUTF8(value.data(), value.size(), &number_text) || !base::IsStringUTF8(number_text) || !IsPrintable(number_text)) { return false; } // Parse phone number based on the region. PhoneNumberUtil* phone_util = PhoneNumberUtil::GetInstance(); // The |default_region| should already be sanitized. DCHECK_EQ(2U, default_region.size()); if (phone_util->ParseAndKeepRawInput(number_text, default_region, i18n_number) != PhoneNumberUtil::NO_PARSING_ERROR) { return false; } if (!IsPossiblePhoneNumber(*i18n_number)) return false; std::string national_significant_number; phone_util->GetNationalSignificantNumber(*i18n_number, &national_significant_number); int area_length = phone_util->GetLengthOfGeographicalAreaCode(*i18n_number); int destination_length = phone_util->GetLengthOfNationalDestinationCode(*i18n_number); // Some phones have a destination code in lieu of area code: mobile operators // in Europe, toll and toll-free numbers in USA, etc. From our point of view // these two types of codes are the same. if (destination_length > area_length) area_length = destination_length; if (area_length >= static_cast<int>(national_significant_number.size())) { // For some non-ASCII strings |destination_length| is bigger than phone // string size. It might be because of incorrect treating of non-ASCII // characters. return false; } std::string area_code; std::string subscriber_number; if (area_length > 0) { area_code = national_significant_number.substr(0, area_length); subscriber_number = national_significant_number.substr(area_length); } else { subscriber_number = national_significant_number; } *number = base::UTF8ToUTF16(subscriber_number); *city_code = base::UTF8ToUTF16(area_code); // Check if parsed number has a country code that was not inferred from the // region. if (i18n_number->has_country_code() && i18n_number->country_code_source() != ::i18n::phonenumbers::PhoneNumber::FROM_DEFAULT_COUNTRY) { *country_code = base::UTF8ToUTF16(base::NumberToString(i18n_number->country_code())); } // The region might be different from what we started with. phone_util->GetRegionCodeForNumber(*i18n_number, inferred_region); return true; } base::string16 NormalizePhoneNumber(const base::string16& value, const std::string& region) { DCHECK_EQ(2u, region.size()); base::string16 country_code, unused_city_code, unused_number; std::string unused_region; ::i18n::phonenumbers::PhoneNumber phone_number; if (!ParsePhoneNumber(value, region, &country_code, &unused_city_code, &unused_number, &unused_region, &phone_number)) { return base::string16(); // Parsing failed - do not store phone. } base::string16 normalized_number; FormatValidatedNumber(phone_number, country_code, nullptr, &normalized_number); return normalized_number; } bool ConstructPhoneNumber(const base::string16& country_code, const base::string16& city_code, const base::string16& number, const std::string& region, base::string16* whole_number) { DCHECK_EQ(2u, region.size()); whole_number->clear(); base::string16 unused_country_code, unused_city_code, unused_number; std::string unused_region; ::i18n::phonenumbers::PhoneNumber phone_number; if (!ParsePhoneNumber(country_code + city_code + number, region, &unused_country_code, &unused_city_code, &unused_number, &unused_region, &phone_number)) { return false; } FormatValidatedNumber(phone_number, country_code, whole_number, nullptr); return true; } bool PhoneNumbersMatch(const base::string16& number_a, const base::string16& number_b, const std::string& raw_region, const std::string& app_locale) { // TODO(crbug.com/953678): Maybe return true if two empty strings are given. // Sanitize the provided |raw_region| before trying to use it for parsing. const std::string region = SanitizeRegion(raw_region, app_locale); PhoneNumberUtil* phone_util = PhoneNumberUtil::GetInstance(); // Parse phone numbers based on the region ::i18n::phonenumbers::PhoneNumber i18n_number1; if (phone_util->Parse(base::UTF16ToUTF8(number_a), region, &i18n_number1) != PhoneNumberUtil::NO_PARSING_ERROR) { return false; } ::i18n::phonenumbers::PhoneNumber i18n_number2; if (phone_util->Parse(base::UTF16ToUTF8(number_b), region, &i18n_number2) != PhoneNumberUtil::NO_PARSING_ERROR) { return false; } switch (phone_util->IsNumberMatch(i18n_number1, i18n_number2)) { case PhoneNumberUtil::INVALID_NUMBER: case PhoneNumberUtil::NO_MATCH: return false; case PhoneNumberUtil::SHORT_NSN_MATCH: return false; case PhoneNumberUtil::NSN_MATCH: case PhoneNumberUtil::EXACT_MATCH: return true; } NOTREACHED(); return false; } base::string16 GetFormattedPhoneNumberForDisplay(const AutofillProfile& profile, const std::string& locale) { // Since the "+" is removed for some country's phone numbers, try to add a "+" // and see if it is a valid phone number for a country. // Having two "+" in front of a number has no effect on the formatted number. // The reason for this is international phone numbers for another country. For // example, without adding a "+", the US number 1-415-123-1234 for an AU // address would be wrongly formatted as +61 1-415-123-1234 which is invalid. std::string phone = base::UTF16ToUTF8( profile.GetInfo(AutofillType(PHONE_HOME_WHOLE_NUMBER), locale)); std::string tentative_intl_phone = "+" + phone; // Always favor the tentative international phone number if it's determined as // being a valid number. const std::string country_code = autofill::data_util::GetCountryCodeWithFallback(profile, locale); if (IsValidPhoneNumber(tentative_intl_phone, country_code)) { return base::UTF8ToUTF16( FormatPhoneNumber(tentative_intl_phone, country_code, PhoneNumberUtil::PhoneNumberFormat::INTERNATIONAL)); } if (IsValidPhoneNumber(phone, country_code)) { return base::UTF8ToUTF16( FormatPhoneNumber(phone, country_code, PhoneNumberUtil::PhoneNumberFormat::INTERNATIONAL)); } return base::UTF8ToUTF16(phone); } std::string FormatPhoneNationallyForDisplay(const std::string& phone_number, const std::string& country_code) { if (IsValidPhoneNumber(phone_number, country_code)) { return FormatPhoneNumber(phone_number, country_code, PhoneNumberUtil::PhoneNumberFormat::NATIONAL); } return phone_number; } std::string FormatPhoneForDisplay(const std::string& phone_number, const std::string& country_code) { if (IsValidPhoneNumber(phone_number, country_code)) { return FormatPhoneNumber(phone_number, country_code, PhoneNumberUtil::PhoneNumberFormat::INTERNATIONAL); } return phone_number; } std::string FormatPhoneForResponse(const std::string& phone_number, const std::string& country_code) { if (IsValidPhoneNumber(phone_number, country_code)) { return FormatPhoneNumber(phone_number, country_code, PhoneNumberUtil::PhoneNumberFormat::E164); } return phone_number; } PhoneObject::PhoneObject(const base::string16& number, const std::string& region) { DCHECK_EQ(2u, region.size()); // TODO(isherman): Autofill profiles should always have a |region| set, but in // some cases it should be marked as implicit. Otherwise, phone numbers // might behave differently when they are synced across computers: // [ http://crbug.com/100845 ]. Once the bug is fixed, add a DCHECK here to // verify. std::unique_ptr<::i18n::phonenumbers::PhoneNumber> i18n_number( new ::i18n::phonenumbers::PhoneNumber); if (ParsePhoneNumber(number, region, &country_code_, &city_code_, &number_, &region_, i18n_number.get())) { // The phone number was successfully parsed, so store the parsed version. // The formatted and normalized versions will be set on the first call to // the coresponding methods. i18n_number_ = std::move(i18n_number); } else { // Parsing failed. Store passed phone "as is" into |whole_number_|. whole_number_ = number; } } PhoneObject::PhoneObject(const PhoneObject& other) { *this = other; } PhoneObject::PhoneObject() {} PhoneObject::~PhoneObject() {} const base::string16& PhoneObject::GetFormattedNumber() const { if (i18n_number_ && formatted_number_.empty()) { FormatValidatedNumber(*i18n_number_, country_code_, &formatted_number_, &whole_number_); } return formatted_number_; } base::string16 PhoneObject::GetNationallyFormattedNumber() const { base::string16 formatted = whole_number_; if (i18n_number_) FormatValidatedNumber(*i18n_number_, base::string16(), &formatted, nullptr); return formatted; } const base::string16& PhoneObject::GetWholeNumber() const { if (i18n_number_ && whole_number_.empty()) { FormatValidatedNumber(*i18n_number_, country_code_, &formatted_number_, &whole_number_); } return whole_number_; } PhoneObject& PhoneObject::operator=(const PhoneObject& other) { if (this == &other) return *this; region_ = other.region_; if (other.i18n_number_) i18n_number_.reset( new ::i18n::phonenumbers::PhoneNumber(*other.i18n_number_)); else i18n_number_.reset(); country_code_ = other.country_code_; city_code_ = other.city_code_; number_ = other.number_; formatted_number_ = other.formatted_number_; whole_number_ = other.whole_number_; return *this; } } // namespace i18n } // namespace autofill
[ "sunny.nam@samsung.com" ]
sunny.nam@samsung.com
4e59be4754a7deea0b855eb3665c79c6c42809db
c3b62f3d508893784886f83a4cb27d5fb28fa21e
/semesters.cpp
827d4c5f96e7a5e929b3e1d86df34fae230a4cfb
[]
no_license
stenpety/h1-student-planner
55b5b79fb4043bf2c90acc50848adc1fcdcfa5c7
a9590dcf1620217215e2d4fa6cd45347a3391631
refs/heads/master
2020-03-22T06:57:39.474931
2019-04-08T07:33:10
2019-04-08T07:33:10
139,669,127
0
0
null
null
null
null
UTF-8
C++
false
false
4,210
cpp
#include "semesters.h" #include "ui_semesters.h" Semesters::Semesters(QWidget *parent) : QDialog(parent), ui(new Ui::Semesters) { ui->setupUi(this); setupDbModel(); setupTable(); /* New semester */ connect(ui->newSemesterButton, &QPushButton::pressed, this, &Semesters::showNewSemesterForm); /* Delete semester */ connect(ui->deleteSemesterButton, &QPushButton::pressed, this, &Semesters::deleteSemester); } Semesters::~Semesters() { delete ui; } void Semesters::setupDbModel() { semestersModel = new QSqlRelationalTableModel(ui->semestersTableView); semestersModel->setEditStrategy(QSqlTableModel::OnManualSubmit); semestersModel->setTable("semesters"); /* Set model headers */ semestersModel->setHeaderData(semestersModel->fieldIndex("semesterID"), Qt::Horizontal, tr("Semester")); semestersModel->setHeaderData(semestersModel->fieldIndex("startDate"), Qt::Horizontal, tr("Start Date")); semestersModel->setHeaderData(semestersModel->fieldIndex("endDate"), Qt::Horizontal, tr("End Date")); if (!semestersModel->select()) { QMessageBox::critical(this, "Unable to setup model", "Error creating table model: " + semestersModel->lastError().text()); return; } semestersModel->sort(1, Qt::AscendingOrder); } void Semesters::setupTable() { ui->semestersTableView->setModel(semestersModel); semestersDelegate = new QSqlRelationalDelegate(ui->semestersTableView); ui->semestersTableView->setItemDelegate(semestersDelegate); ui->semestersTableView->setColumnHidden(semestersModel->fieldIndex("id"), true); ui->semestersTableView->setSelectionMode(QAbstractItemView::SingleSelection); ui->semestersTableView->setSelectionBehavior(QAbstractItemView::SelectRows); semestersMapper = new QDataWidgetMapper(); semestersMapper->setSubmitPolicy(QDataWidgetMapper::ManualSubmit); semestersMapper->setModel(semestersModel); semestersMapper->setItemDelegate(semestersDelegate); connect(ui->semestersTableView->selectionModel(), &QItemSelectionModel::currentRowChanged, semestersMapper, &QDataWidgetMapper::setCurrentModelIndex); selectInSemestersTable(0); } void Semesters::selectInSemestersTable(const int index) { semestersMapper->setCurrentIndex(index); ui->semestersTableView->selectRow(index); } void Semesters::showNewSemesterForm() { auto newSemester = new NewSemester(); if (newSemester->exec()) { int rowCount = semestersModel->rowCount(); semestersModel->insertRows(rowCount, 1); semestersModel->setData(semestersModel->index(rowCount, 1), newSemester->getSemesterLineEditText()); semestersModel->setData(semestersModel->index(rowCount, 2), newSemester->getStartDate()); semestersModel->setData(semestersModel->index(rowCount, 3), newSemester->getEndDate()); semestersModel->submitAll(); ui->semestersTableView->resizeColumnsToContents(); } delete newSemester; } void Semesters::deleteSemester() { /* Index to delete = currently selected row */ int rowToDelete = semestersMapper->currentIndex(); /* Deletion dialog */ QMessageBox::StandardButton deleteDialog; QString semesterToDelete = semestersModel->record(rowToDelete).value(1).toString(); deleteDialog = QMessageBox::question(this, "Delete semester", "Delete " + semesterToDelete + "?\nAre you sure?", QMessageBox::Yes|QMessageBox::No); if (deleteDialog == QMessageBox::Yes) { if (!(semestersModel->removeRow(rowToDelete))) { QMessageBox::critical(this, "Unable to delete semester", "Error deleting semester: " + semestersModel->lastError().text()); return; } /* Apply changes to the DB */ semestersModel->submitAll(); semestersMapper->submit(); if (semestersModel->rowCount() > 0) { selectInSemestersTable(rowToDelete); } else { selectInSemestersTable(-1); } ui->semestersTableView->resizeColumnsToContents(); } }
[ "petr.stenin@gmail.com" ]
petr.stenin@gmail.com
d14e554221dc8a6e6c4b477ceaded13617403f36
8dc536fde88501d1c208414ee4fd854e25557050
/ContrastDetect.cpp
b70b96b6bea5c28d56cb00594f66cfab410c61b4
[]
no_license
qhadyn/VideoQualityDetection
f1eadf9d716524723fdd686e5443a89415ab25da
cdbc86cfae5ff4a478f57d12e79418b450663f1f
refs/heads/master
2023-08-03T06:13:58.305690
2021-09-25T08:59:02
2021-09-25T08:59:02
null
0
0
null
null
null
null
GB18030
C++
false
false
1,507
cpp
#include <iostream> #include <opencv2/opencv.hpp> //OpenCV头文件 #include <vector> #include "Detection.h" using namespace cv; using namespace std; class ContrastDetect : public Detection { public: void ContrastException(Mat InputImg, float& cast, float& da) { Mat GRAYimg; cvtColor(InputImg, GRAYimg, CV_BGR2GRAY); float a = 0; int Hist[256]; for (int i = 0; i < 256; i++) Hist[i] = 0; for (int i = 0; i < GRAYimg.rows; i++) { for (int j = 0; j < GRAYimg.cols; j++) { a += float(GRAYimg.at<uchar>(i, j) - 128);//在计算过程中,考虑128为亮度均值点,统计偏离的总数 int x = GRAYimg.at<uchar>(i, j); Hist[x]++; //统计每个亮度的次数 } } da = a / float(GRAYimg.rows * InputImg.cols); // float D = abs(da); float Ma = 0; for (int i = 0; i < 256; i++) { Ma += abs(i - 128 - da) * Hist[i]; } Ma /= float((GRAYimg.rows * GRAYimg.cols)); float M = abs(Ma); float K = D / M; cast = K; return; } int Detect(Mat imageData) { float brightcast, brightda; //cv::Mat imageData = cv::imread(src.c_str()); if (imageData.data == 0) { cerr << "Image reading error" << endl; system("pause"); return 3; } ContrastException(imageData, brightcast, brightda); if (brightcast > 1) { std::string brightDes = (brightda > 0) ? "偏亮" : "偏暗"; std::cout << "对比度异常:" << brightDes << std::endl; return 3; } return 0; } };
[ "31426319+ChengHaoHappy@users.noreply.github.com" ]
31426319+ChengHaoHappy@users.noreply.github.com