blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
4
201
content_id
stringlengths
40
40
detected_licenses
listlengths
0
85
license_type
stringclasses
2 values
repo_name
stringlengths
7
100
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
260 values
visit_date
timestamp[us]
revision_date
timestamp[us]
committer_date
timestamp[us]
github_id
int64
11.4k
681M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
17 values
gha_event_created_at
timestamp[us]
gha_created_at
timestamp[us]
gha_language
stringclasses
80 values
src_encoding
stringclasses
28 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
8
9.86M
extension
stringclasses
52 values
content
stringlengths
8
9.86M
authors
listlengths
1
1
author
stringlengths
0
119
d291f7ca968b19aae0f44d1ff319b51a59d1684d
6aea8c84fd22e5925d143430db5c6013f23f8e4c
/src/realm/parser/parser.cpp
b29835e32132d843d34f1fdebfef2246bf5caf68
[ "Apache-2.0", "LicenseRef-scancode-generic-export-compliance" ]
permissive
brinchj/realm-core
548ad7f3a551a38c93fd484a25a19392473c9804
df05d18755136db382cd8cffa26bcb8032ef3585
refs/heads/master
2020-03-17T14:27:34.638444
2018-05-16T13:50:47
2018-05-16T13:52:00
133,672,917
0
0
Apache-2.0
2018-05-16T13:50:21
2018-05-16T13:50:21
null
UTF-8
C++
false
false
26,703
cpp
//////////////////////////////////////////////////////////////////////////// // // Copyright 2015 Realm Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // //////////////////////////////////////////////////////////////////////////// #include "parser.hpp" #include <iostream> #include <pegtl.hpp> #include <pegtl/analyze.hpp> #include <pegtl/contrib/tracer.hpp> #include <realm/util/assert.hpp> // String tokens can't be followed by [A-z0-9_]. #define string_token_t(s) seq< TAOCPP_PEGTL_ISTRING(s), not_at< identifier_other > > using namespace tao::pegtl; namespace realm { namespace parser { // forward declarations struct expr; struct string_oper; struct symbolic_oper; struct pred; // strings struct unicode : list< seq< one< 'u' >, rep< 4, must< xdigit > > >, one< '\\' > > {}; struct escaped_char : one< '"', '\'', '\\', '/', 'b', 'f', 'n', 'r', 't', '0' > {}; struct escaped : sor< escaped_char, unicode > {}; struct unescaped : utf8::range< 0x20, 0x10FFFF > {}; struct chars : if_then_else< one< '\\' >, must< escaped >, unescaped > {}; struct dq_string_content : until< at< one< '"' > >, must< chars > > {}; struct dq_string : seq< one< '"' >, must< dq_string_content >, any > {}; struct sq_string_content : until< at< one< '\'' > >, must< chars > > {}; struct sq_string : seq< one< '\'' >, must< sq_string_content >, any > {}; // base64 encoded data struct b64_allowed : sor< disable< alnum >, one< '/' >, one< '+' >, one< '=' > > {}; struct b64_content : until< at< one< '"' > >, must< b64_allowed > > {}; struct base64 : seq< TAOCPP_PEGTL_ISTRING("B64\""), must< b64_content >, any > {}; // numbers struct minus : opt< one< '-' > > {}; struct dot : one< '.' > {}; struct float_num : sor< seq< plus< digit >, dot, star< digit > >, seq< star< digit >, dot, plus< digit > > > {}; struct hex_num : seq< one< '0' >, one< 'x', 'X' >, plus< xdigit > > {}; struct int_num : plus< digit > {}; struct number : seq< minus, sor< float_num, hex_num, int_num > > {}; struct timestamp_number : disable< number > {}; struct first_timestamp_number : disable< timestamp_number > {}; // Tseconds:nanoseconds struct internal_timestamp : seq< one< 'T' >, first_timestamp_number, one< ':' >, timestamp_number > {}; // T2017-09-28@23:12:60:288833 // YYYY-MM-DD@HH:MM:SS:NANOS nanos optional struct readable_timestamp : seq< first_timestamp_number, one< '-' >, timestamp_number, one< '-' >, timestamp_number, one< '@' >, timestamp_number, one< ':' >, timestamp_number, one< ':' >, timestamp_number, opt< seq< one< ':' >, timestamp_number > > > {}; struct timestamp : sor< internal_timestamp, readable_timestamp > {}; struct true_value : string_token_t("true") {}; struct false_value : string_token_t("false") {}; struct null_value : seq< sor< string_token_t("null"), string_token_t("nil") > > {}; // following operators must allow proceeding string characters struct min : TAOCPP_PEGTL_ISTRING(".@min.") {}; struct max : TAOCPP_PEGTL_ISTRING(".@max.") {}; struct sum : TAOCPP_PEGTL_ISTRING(".@sum.") {}; struct avg : TAOCPP_PEGTL_ISTRING(".@avg.") {}; // these operators are normal strings (no proceeding string characters) struct count : string_token_t(".@count") {}; struct size : string_token_t(".@size") {}; struct backlinks : string_token_t("@links") {}; struct one_key_path : seq< sor< alpha, one< '_', '$' > >, star< sor< alnum, one< '_', '-', '$' > > > > {}; struct backlink_path : seq< backlinks, dot, one_key_path, dot, one_key_path > {}; struct backlink_count : seq< disable< backlinks >, sor< disable< count >, disable< size > > > {}; struct single_collection_operators : sor< count, size > {}; struct key_collection_operators : sor< min, max, sum, avg > {}; // key paths struct key_path : list< sor< backlink_path, one_key_path >, one< '.' > > {}; struct key_path_prefix : disable< key_path > {}; struct key_path_suffix : disable< key_path > {}; struct collection_operator_match : sor< seq< key_path_prefix, key_collection_operators, key_path_suffix >, seq< opt< key_path_prefix, dot >, backlink_count >, seq< key_path_prefix, single_collection_operators > > {}; // argument struct argument_index : plus< digit > {}; struct argument : seq< one< '$' >, argument_index > {}; // subquery eg: SUBQUERY(items, $x, $x.name CONTAINS 'a' && $x.price > 5).@count struct subq_prefix : seq< string_token_t("subquery"), star< blank >, one< '(' > > {}; struct subq_suffix : one< ')' > {}; struct sub_path : disable < key_path > {}; struct sub_var_name : seq < one< '$' >, seq< sor< alpha, one< '_', '$' > >, star< sor< alnum, one< '_', '-', '$' > > > > > {}; struct sub_result_op : sor< count, size > {}; struct sub_preamble : seq< subq_prefix, pad< sub_path, blank >, one< ',' >, pad< sub_var_name, blank >, one< ',' > > {}; struct subquery : seq< sub_preamble, pad< pred, blank >, pad< subq_suffix, blank >, sub_result_op > {}; // list aggregate operations struct agg_target : seq< key_path > {}; struct agg_any : seq< sor< string_token_t("any"), string_token_t("some") >, plus<blank>, agg_target, pad< sor< string_oper, symbolic_oper >, blank >, expr > {}; struct agg_all : seq< string_token_t("all"), plus<blank>, agg_target, pad< sor< string_oper, symbolic_oper >, blank >, expr > {}; struct agg_none : seq< string_token_t("none"), plus<blank>, agg_target, pad< sor< string_oper, symbolic_oper >, blank >, expr > {}; struct agg_shortcut_pred : sor< agg_any, agg_all, agg_none > {}; // expressions and operators struct expr : sor< dq_string, sq_string, timestamp, number, argument, true_value, false_value, null_value, base64, collection_operator_match, subquery, key_path > {}; struct case_insensitive : TAOCPP_PEGTL_ISTRING("[c]") {}; struct eq : seq< sor< two< '=' >, one< '=' > >, star< blank >, opt< case_insensitive > >{}; struct noteq : seq< sor< tao::pegtl::string< '!', '=' >, tao::pegtl::string< '<', '>' > >, star< blank >, opt< case_insensitive > > {}; struct in: seq< string_token_t("in"), star< blank >, opt< case_insensitive > >{}; struct lteq : sor< tao::pegtl::string< '<', '=' >, tao::pegtl::string< '=', '<' > > {}; struct lt : one< '<' > {}; struct gteq : sor< tao::pegtl::string< '>', '=' >, tao::pegtl::string< '=', '>' > > {}; struct gt : one< '>' > {}; struct contains : string_token_t("contains") {}; struct begins : string_token_t("beginswith") {}; struct ends : string_token_t("endswith") {}; struct like : string_token_t("like") {}; struct sort_prefix : seq< string_token_t("sort"), star< blank >, one< '(' > > {}; struct distinct_prefix : seq< string_token_t("distinct"), star< blank >, one< '(' > > {}; struct ascending : seq< sor< string_token_t("ascending"), string_token_t("asc") > > {}; struct descending : seq< sor< string_token_t("descending"), string_token_t("desc") > > {}; struct descriptor_property : disable< key_path > {}; struct sort_param : seq< star< blank >, descriptor_property, plus< blank >, sor< ascending, descending >, star< blank > > {}; struct sort : seq< sort_prefix, sort_param, star< seq< one< ',' >, sort_param > >, one< ')' > > {}; struct distinct_param : seq< star< blank >, descriptor_property, star< blank > > {}; struct distinct : seq < distinct_prefix, distinct_param, star< seq< one< ',' >, distinct_param > >, one< ')' > > {}; struct descriptor_ordering : sor< sort, distinct > {}; struct string_oper : seq< sor< contains, begins, ends, like>, star< blank >, opt< case_insensitive > > {}; // "=" is equality and since other operators can start with "=" we must check equal last struct symbolic_oper : sor< noteq, lteq, lt, gteq, gt, eq, in > {}; // predicates struct comparison_pred : seq< expr, pad< sor< string_oper, symbolic_oper >, blank >, expr > {}; // we need to alias the group tokens because these are also used in other expressions above and we have to match // the predicate group tokens without also matching () in other expressions. struct begin_pred_group : one< '(' > {}; struct end_pred_group : one< ')' > {}; struct group_pred : if_must< begin_pred_group, pad< pred, blank >, end_pred_group > {}; struct true_pred : string_token_t("truepredicate") {}; struct false_pred : string_token_t("falsepredicate") {}; struct not_pre : seq< sor< one< '!' >, string_token_t("not") > > {}; struct atom_pred : seq< opt< not_pre >, pad< sor<group_pred, true_pred, false_pred, agg_shortcut_pred, comparison_pred>, blank >, star< pad< descriptor_ordering, blank > > > {}; struct and_op : pad< sor< two< '&' >, string_token_t("and") >, blank > {}; struct or_op : pad< sor< two< '|' >, string_token_t("or") >, blank > {}; struct or_ext : if_must< or_op, pred > {}; struct and_ext : if_must< and_op, pred > {}; struct and_pred : seq< atom_pred, star< and_ext > > {}; struct pred : seq< and_pred, star< or_ext > > {}; // state struct ParserState { std::vector<Predicate *> group_stack; std::vector<std::string> timestamp_input_buffer; std::string collection_key_path_prefix, collection_key_path_suffix; Expression::KeyPathOp pending_op; DescriptorOrderingState ordering_state; DescriptorOrderingState::SingleOrderingState temp_ordering; std::string subquery_path, subquery_var; std::vector<Predicate> subqueries; Predicate::ComparisonType pending_comparison_type; Predicate *current_group() { return group_stack.back(); } Predicate *last_predicate() { Predicate *pred = current_group(); while (pred->type != Predicate::Type::Comparison && pred->cpnd.sub_predicates.size()) { pred = &pred->cpnd.sub_predicates.back(); } return pred; } void add_predicate_to_current_group(Predicate::Type type) { current_group()->cpnd.sub_predicates.emplace_back(type, negate_next); negate_next = false; if (current_group()->cpnd.sub_predicates.size() > 1) { if (next_type == Predicate::Type::Or) { apply_or(); } else { apply_and(); } } } bool negate_next = false; Predicate::Type next_type = Predicate::Type::And; Expression* last_expression = nullptr; void add_collection_aggregate_expression() { add_expression(Expression(collection_key_path_prefix, pending_op, collection_key_path_suffix)); collection_key_path_prefix = ""; collection_key_path_suffix = ""; pending_op = Expression::KeyPathOp::None; } void apply_list_aggregate_operation() { last_predicate()->cmpr.compare_type = pending_comparison_type; pending_comparison_type = Predicate::ComparisonType::Unspecified; } void add_expression(Expression && exp) { Predicate *current = last_predicate(); if (current->type == Predicate::Type::Comparison && current->cmpr.expr[1].type == parser::Expression::Type::None) { current->cmpr.expr[1] = std::move(exp); last_expression = &(current->cmpr.expr[1]); } else { add_predicate_to_current_group(Predicate::Type::Comparison); last_predicate()->cmpr.expr[0] = std::move(exp); last_expression = &(last_predicate()->cmpr.expr[0]); } } void add_timestamp_from_buffer() { add_expression(Expression(std::move(timestamp_input_buffer))); // moving contents clears buffer } void apply_or() { Predicate *group = current_group(); if (group->type == Predicate::Type::Or) { return; } // convert to OR group->type = Predicate::Type::Or; if (group->cpnd.sub_predicates.size() > 2) { // split the current group into an AND group ORed with the last subpredicate Predicate new_sub(Predicate::Type::And); new_sub.cpnd.sub_predicates = std::move(group->cpnd.sub_predicates); group->cpnd.sub_predicates = { new_sub, std::move(new_sub.cpnd.sub_predicates.back()) }; group->cpnd.sub_predicates[0].cpnd.sub_predicates.pop_back(); } } void apply_and() { if (current_group()->type == Predicate::Type::And) { return; } auto &sub_preds = current_group()->cpnd.sub_predicates; auto second_last = sub_preds.end() - 2; if (second_last->type == Predicate::Type::And && !second_last->negate) { // make a new and group populated with the last two predicates second_last->cpnd.sub_predicates.push_back(std::move(sub_preds.back())); sub_preds.pop_back(); } else { // otherwise combine last two into a new AND group Predicate pred(Predicate::Type::And); pred.cpnd.sub_predicates.insert(pred.cpnd.sub_predicates.begin(), second_last, sub_preds.end()); sub_preds.erase(second_last, sub_preds.end()); sub_preds.emplace_back(std::move(pred)); } } }; // rules template< typename Rule > struct action : nothing< Rule > {}; #ifdef REALM_PARSER_PRINT_TOKENS #define DEBUG_PRINT_TOKEN(string) do { std::cout << string << std::endl; } while (0) #else #define DEBUG_PRINT_TOKEN(string) do { static_cast<void>(string); } while (0) #endif template<> struct action< and_op > { template< typename Input > static void apply(const Input&, ParserState& state) { DEBUG_PRINT_TOKEN("<and>"); state.next_type = Predicate::Type::And; } }; template<> struct action< or_op > { template< typename Input > static void apply(const Input&, ParserState & state) { DEBUG_PRINT_TOKEN("<or>"); state.next_type = Predicate::Type::Or; } }; #define EXPRESSION_ACTION(rule, type) \ template<> struct action< rule > { \ template< typename Input > \ static void apply(const Input& in, ParserState& state) { \ DEBUG_PRINT_TOKEN("expression:" + in.string() + #rule); \ state.add_expression(Expression(type, in.string())); }}; EXPRESSION_ACTION(dq_string_content, Expression::Type::String) EXPRESSION_ACTION(sq_string_content, Expression::Type::String) EXPRESSION_ACTION(key_path, Expression::Type::KeyPath) EXPRESSION_ACTION(number, Expression::Type::Number) EXPRESSION_ACTION(true_value, Expression::Type::True) EXPRESSION_ACTION(false_value, Expression::Type::False) EXPRESSION_ACTION(null_value, Expression::Type::Null) EXPRESSION_ACTION(argument_index, Expression::Type::Argument) EXPRESSION_ACTION(base64, Expression::Type::Base64) template<> struct action< timestamp > { template< typename Input > static void apply(const Input& in, ParserState & state) { DEBUG_PRINT_TOKEN(in.string()); state.add_timestamp_from_buffer(); } }; template<> struct action< first_timestamp_number > { template< typename Input > static void apply(const Input& in, ParserState & state) { DEBUG_PRINT_TOKEN(in.string()); // the grammer might attempt to match a timestamp and get part way and fail, // so everytime we start again we need to clear the buffer. state.timestamp_input_buffer.clear(); state.timestamp_input_buffer.push_back(in.string()); } }; template<> struct action< timestamp_number > { template< typename Input > static void apply(const Input& in, ParserState & state) { DEBUG_PRINT_TOKEN(in.string()); state.timestamp_input_buffer.push_back(in.string()); } }; template<> struct action< descriptor_property > { template< typename Input > static void apply(const Input& in, ParserState & state) { DEBUG_PRINT_TOKEN(in.string()); DescriptorOrderingState::PropertyState p; p.key_path = in.string(); p.ascending = false; // will be overwritten by the required order specification next state.temp_ordering.properties.push_back(p); } }; template<> struct action< ascending > { template< typename Input > static void apply(const Input& in, ParserState & state) { DEBUG_PRINT_TOKEN(in.string()); REALM_ASSERT_DEBUG(state.temp_ordering.properties.size() > 0); state.temp_ordering.properties.back().ascending = true; } }; template<> struct action< descending > { template< typename Input > static void apply(const Input& in, ParserState & state) { DEBUG_PRINT_TOKEN(in.string()); REALM_ASSERT_DEBUG(state.temp_ordering.properties.size() > 0); state.temp_ordering.properties.back().ascending = false; } }; template<> struct action< sort_prefix > { template< typename Input > static void apply(const Input& in, ParserState & state) { DEBUG_PRINT_TOKEN(in.string()); // This clears the temp buffer when a distinct clause starts. It makes sure there is no temp properties that // were added if previous properties started matching but it wasn't actuallly a full distinct/sort match state.temp_ordering.properties.clear(); } }; template<> struct action< distinct_prefix > { template< typename Input > static void apply(const Input& in, ParserState & state) { DEBUG_PRINT_TOKEN(in.string()); // This clears the temp buffer when a distinct clause starts. It makes sure there is no temp properties that // were added if previous properties started matching but it wasn't actuallly a full distinct/sort match state.temp_ordering.properties.clear(); } }; template<> struct action< sort > { template< typename Input > static void apply(const Input& in, ParserState & state) { DEBUG_PRINT_TOKEN(in.string()); state.temp_ordering.is_distinct = false; state.ordering_state.orderings.push_back(state.temp_ordering); state.temp_ordering.properties.clear(); } }; template<> struct action< distinct > { template< typename Input > static void apply(const Input& in, ParserState & state) { DEBUG_PRINT_TOKEN(in.string()); state.temp_ordering.is_distinct = true; state.ordering_state.orderings.push_back(state.temp_ordering); state.temp_ordering.properties.clear(); } }; template<> struct action< sub_path > { template< typename Input > static void apply(const Input& in, ParserState & state) { DEBUG_PRINT_TOKEN(in.string() + " SUB PATH"); state.subquery_path = in.string(); } }; template<> struct action< sub_var_name > { template< typename Input > static void apply(const Input& in, ParserState & state) { DEBUG_PRINT_TOKEN(in.string() + " SUB VAR NAME"); state.subquery_var = in.string(); } }; // the preamble acts as the opening for a sub predicate group which is the subquery conditions template<> struct action< sub_preamble > { template< typename Input > static void apply(const Input& in, ParserState & state) { DEBUG_PRINT_TOKEN(in.string() + "<BEGIN SUBQUERY CONDITIONS>"); Expression exp(Expression::Type::SubQuery); exp.subquery_path = state.subquery_path; exp.subquery_var = state.subquery_var; exp.subquery = std::make_shared<Predicate>(Predicate::Type::And); REALM_ASSERT_DEBUG(!state.subquery_var.empty() && !state.subquery_path.empty()); Predicate* sub_pred = exp.subquery.get(); state.add_expression(std::move(exp)); state.group_stack.push_back(sub_pred); } }; // once the whole subquery syntax is matched, we close the subquery group and add the expression template<> struct action< subquery > { template< typename Input > static void apply(const Input& in, ParserState & state) { DEBUG_PRINT_TOKEN(in.string() + "<END SUBQUERY CONDITIONS>"); state.group_stack.pop_back(); } }; #define COLLECTION_OPERATION_ACTION(rule, type) \ template<> struct action< rule > { \ template< typename Input > \ static void apply(const Input& in, ParserState& state) { \ DEBUG_PRINT_TOKEN("operation: " + in.string()); \ state.pending_op = type; }}; COLLECTION_OPERATION_ACTION(min, Expression::KeyPathOp::Min) COLLECTION_OPERATION_ACTION(max, Expression::KeyPathOp::Max) COLLECTION_OPERATION_ACTION(sum, Expression::KeyPathOp::Sum) COLLECTION_OPERATION_ACTION(avg, Expression::KeyPathOp::Avg) COLLECTION_OPERATION_ACTION(count, Expression::KeyPathOp::Count) COLLECTION_OPERATION_ACTION(size, Expression::KeyPathOp::SizeString) COLLECTION_OPERATION_ACTION(backlink_count, Expression::KeyPathOp::BacklinkCount) template<> struct action< key_path_prefix > { template< typename Input > static void apply(const Input& in, ParserState& state) { DEBUG_PRINT_TOKEN("key_path_prefix: " + in.string()); state.collection_key_path_prefix = in.string(); } }; template<> struct action< key_path_suffix > { template< typename Input > static void apply(const Input& in, ParserState& state) { DEBUG_PRINT_TOKEN("key_path_suffix: " + in.string()); state.collection_key_path_suffix = in.string(); } }; template<> struct action< collection_operator_match > { template< typename Input > static void apply(const Input& in, ParserState& state) { DEBUG_PRINT_TOKEN(in.string()); state.add_collection_aggregate_expression(); } }; #define LIST_AGG_OP_TYPE_ACTION(rule, type) \ template<> struct action< rule > { \ template< typename Input > \ static void apply(const Input& in, ParserState& state) { \ DEBUG_PRINT_TOKEN(in.string() + #rule); \ state.pending_comparison_type = type; }}; LIST_AGG_OP_TYPE_ACTION(agg_any, Predicate::ComparisonType::Any) LIST_AGG_OP_TYPE_ACTION(agg_all, Predicate::ComparisonType::All) LIST_AGG_OP_TYPE_ACTION(agg_none, Predicate::ComparisonType::None) template<> struct action< agg_shortcut_pred > { template< typename Input > static void apply(const Input& in, ParserState& state) { DEBUG_PRINT_TOKEN(in.string() + " Aggregate shortcut matched"); state.apply_list_aggregate_operation(); } }; template<> struct action< true_pred > { template< typename Input > static void apply(const Input& in, ParserState & state) { DEBUG_PRINT_TOKEN(in.string()); state.add_predicate_to_current_group(Predicate::Type::True); } }; template<> struct action< false_pred > { template< typename Input > static void apply(const Input& in, ParserState & state) { DEBUG_PRINT_TOKEN(in.string()); state.add_predicate_to_current_group(Predicate::Type::False); } }; #define OPERATOR_ACTION(rule, oper) \ template<> struct action< rule > { \ template< typename Input > \ static void apply(const Input& in, ParserState& state) { \ DEBUG_PRINT_TOKEN(in.string() + #oper); \ state.last_predicate()->cmpr.op = oper; }}; OPERATOR_ACTION(eq, Predicate::Operator::Equal) OPERATOR_ACTION(noteq, Predicate::Operator::NotEqual) OPERATOR_ACTION(in, Predicate::Operator::In) OPERATOR_ACTION(gteq, Predicate::Operator::GreaterThanOrEqual) OPERATOR_ACTION(gt, Predicate::Operator::GreaterThan) OPERATOR_ACTION(lteq, Predicate::Operator::LessThanOrEqual) OPERATOR_ACTION(lt, Predicate::Operator::LessThan) OPERATOR_ACTION(begins, Predicate::Operator::BeginsWith) OPERATOR_ACTION(ends, Predicate::Operator::EndsWith) OPERATOR_ACTION(contains, Predicate::Operator::Contains) OPERATOR_ACTION(like, Predicate::Operator::Like) template<> struct action< case_insensitive > { template< typename Input > static void apply(const Input& in, ParserState & state) { DEBUG_PRINT_TOKEN(in.string()); state.last_predicate()->cmpr.option = Predicate::OperatorOption::CaseInsensitive; } }; template<> struct action< begin_pred_group > { template< typename Input > static void apply(const Input&, ParserState & state) { DEBUG_PRINT_TOKEN("<begin_group>"); state.add_predicate_to_current_group(Predicate::Type::And); state.group_stack.push_back(state.last_predicate()); } }; template<> struct action< group_pred > { template< typename Input > static void apply(const Input&, ParserState & state) { DEBUG_PRINT_TOKEN("<end_group>"); state.group_stack.pop_back(); } }; template<> struct action< not_pre > { template< typename Input > static void apply(const Input&, ParserState & state) { DEBUG_PRINT_TOKEN("<not>"); state.negate_next = true; } }; template< typename Rule > struct error_message_control : tao::pegtl::normal< Rule > { static const std::string error_message; template< typename Input, typename ... States > static void raise(const Input& in, States&&...) { throw tao::pegtl::parse_error(error_message, in); } }; template<> const std::string error_message_control< chars >::error_message = "Invalid characters in string constant."; template< typename Rule> const std::string error_message_control< Rule >::error_message = "Invalid predicate."; ParserResult parse(const std::string &query) { DEBUG_PRINT_TOKEN(query); Predicate out_predicate(Predicate::Type::And); ParserState state; state.group_stack.push_back(&out_predicate); tao::pegtl::memory_input<> input(query, query); tao::pegtl::parse< must< pred, eof >, action, error_message_control >(input, state); if (out_predicate.type == Predicate::Type::And && out_predicate.cpnd.sub_predicates.size() == 1) { return ParserResult{ std::move(out_predicate.cpnd.sub_predicates.back()), state.ordering_state }; } return ParserResult{ out_predicate, state.ordering_state}; } size_t analyze_grammar() { return analyze<pred>(); } }}
[ "js@realm.io" ]
js@realm.io
e59c449a7551f6f322c8d8256625fe67cd1dc51a
ef187d259d33e97c7b9ed07dfbf065cec3e41f59
/work/atcoder/abc/abc011/B/answers/130553_zaki_.cpp
a3bfc075289d3eeded22b6c867426fa133d96432
[]
no_license
kjnh10/pcw
847f7295ea3174490485ffe14ce4cdea0931c032
8f677701bce15517fb9362cc5b596644da62dca8
refs/heads/master
2020-03-18T09:54:23.442772
2018-07-19T00:26:09
2018-07-19T00:26:09
134,586,379
0
0
null
null
null
null
UTF-8
C++
false
false
258
cpp
#include <bits/stdc++.h> using namespace std; int main(){ cin.tie(0); ios::sync_with_stdio(false); string s;cin>>s; char a=toupper(s[0]); cout<<a; for(int i=1;i<s.length();i++){ char b=tolower(s[i]); cout<<b; } cout<<endl; }
[ "kojinho10@gmail.com" ]
kojinho10@gmail.com
efb01e3aeb8e46111660106fdfb12628029cfee0
4314b9458f325a7824d8c5bb71a146fd0cf7bfdb
/Przewodnik/Element.cpp
033eade2209d21f939d69d3f397d256b41201b19
[]
no_license
sobanskikarol91/Electronic-Guide
e553fa6ca6177c96eebb140d82b5cb9b095ae2d2
f102c335638ddafdefcd7cd6e23a1e42396067a3
refs/heads/master
2020-03-18T23:40:54.109988
2018-06-04T15:45:34
2018-06-04T15:45:34
135,418,987
0
0
null
null
null
null
UTF-8
C++
false
false
253
cpp
#include "Element.h" Element::Element() :model("Nieznana"), kategoria("Nieznana") {} Element::Element(string nazwa, string kategoria) : model(nazwa), kategoria(kategoria) {} void Element::wyswietl() { koloruj_txt("Model: " + model, KOLOR::ZIELONY); }
[ "sobanskikarol91@gmail.com" ]
sobanskikarol91@gmail.com
3a2e09fff41b71f184a048416f96032858ead6a2
8ea3e8f19811c10668364fef391dfd0613e8aad7
/include/clasp/core/glue.h
a6ebd73482165fdd67aeb2b4df668ea059a5b90c
[]
no_license
guicho271828/clasp
f9833e18052a4a97130e1e44fec739dd10aa5a33
168fcc26eaebd8dbc41263140181fe94ed04dd9a
refs/heads/master
2023-02-04T07:15:43.184112
2020-12-13T15:59:54
2020-12-13T15:59:54
320,916,383
0
0
null
null
null
null
UTF-8
C++
false
false
8,401
h
/* File: glue.h */ /* Copyright (c) 2014, Christian E. Schafmeister CLASP is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. See directory 'clasp/licenses' for full details. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /* -^- */ #ifndef glue_H #define glue_H template <class to_class, class from_class> inline gctools::smart_ptr<to_class> safe_downcast(const gctools::smart_ptr<from_class> &c) { if (c.nilp()) return _Nil<to_class>(); gctools::smart_ptr<to_class> dc = gctools::dynamic_pointer_cast<to_class>(c); if (dc.objectp()) return dc; lisp_throwUnexpectedType(c, to_class::static_classSymbol()); return _Nil<to_class>(); } template <> inline gctools::smart_ptr<core::T_O> safe_downcast(const gctools::smart_ptr<core::T_O> &c) { return c; } template <> inline gctools::smart_ptr<core::Cons_O> safe_downcast(const gctools::smart_ptr<core::Cons_O> &c) { return c; } template <> inline gctools::smart_ptr<core::Symbol_O> safe_downcast(const gctools::smart_ptr<core::Symbol_O> &c) { return c; } /*! Downcast multiple_values< */ template <class to_class, class from_class> inline gctools::multiple_values<to_class> safe_downcast(const gctools::multiple_values<from_class> &c) { if (c.nilp()) return gctools::multiple_values<to_class>(_Nil<to_class>(), c.number_of_values()); gctools::multiple_values<to_class> dc = gctools::dynamic_pointer_cast<to_class>(c); if (dc.pointerp()) return dc; lisp_throwUnexpectedType(c, to_class::static_classSymbol()); // dummy return */ return gctools::multiple_values<to_class>(_Nil<to_class>(), 1); } template <> inline gctools::multiple_values<core::T_O> safe_downcast(const gctools::multiple_values<core::T_O> &c) { return c; } template <> inline gctools::multiple_values<core::Cons_O> safe_downcast(const gctools::multiple_values<core::Cons_O> &c) { return c; } template <> inline gctools::multiple_values<core::Symbol_O> safe_downcast(const gctools::multiple_values<core::Symbol_O> &c) { return c; } #define T_P const core::T_sp & namespace translate { /*! The second template argument can be std::true_type if the value passed to the from_object ctor should be used to construct the value or std::false_type if a default initialization value should be used */ template <class oClass, typename Doit = std::true_type> struct from_object { #if 0 typedef gctools::smart_ptr<oClass> DeclareType; DeclareType _v; from_object(T_P o) : _v(o.as<oClass>()) {}; #endif }; #if 0 template <> struct from_object<bool*,std::false_type> { typedef bool* DeclareType; bool _val; DeclareType _v; from_object(T_P o) : _val(false), _v(&_val) {}; }; template <> struct from_object<string&,std::false_type> { typedef string DeclareType; DeclareType _v; from_object(T_P o) : _v("") {}; }; #endif struct dont_adopt_pointer {}; struct adopt_pointer {}; /*! to_object takes a class to convert to an T_sp type and a template parameter that specifies if the pointer should be adopted or not adopted */ template <class oClass, class AdoptPolicy = dont_adopt_pointer> struct to_object { }; template <typename T> struct from_object<gctools::smart_ptr<T>, std::true_type> { typedef gctools::smart_ptr<T> ExpectedType; typedef gctools::smart_ptr<T> DeclareType; DeclareType _v; from_object(const core::T_sp &o) : _v(gc::As<gctools::smart_ptr<T>>(o)){}; }; template <> struct from_object<core::T_sp, std::true_type> { typedef core::T_sp ExpectedType; typedef core::T_sp DeclareType; DeclareType _v; from_object(const core::T_sp &o) : _v(o){}; }; template <typename T> struct from_object<gc::Nilable<gc::smart_ptr<T>>, std::true_type> { typedef gctools::Nilable<gc::smart_ptr<T>> ExpectedType; typedef ExpectedType DeclareType; DeclareType _v; from_object(const core::T_sp &o) : _v(o){}; }; template <class T> struct to_object<gctools::smart_ptr<T>> { static core::T_sp convert(const gctools::smart_ptr<T> &o) { return o; } }; template <class T> struct to_object<gc::Nilable<gctools::smart_ptr<T>>> { static core::T_sp convert(const gc::Nilable<gc::smart_ptr<T>> &o) { return static_cast<core::T_sp>(o); } }; }; #define __FROM_OBJECT_CONVERTER(oClass) \ namespace translate { \ template <> struct from_object<gctools::smart_ptr<oClass>, std::true_type> { \ typedef gctools::smart_ptr<oClass> ExpectedType; \ typedef gctools::smart_ptr<oClass> DeclareType; \ DeclareType _v; \ from_object(T_P o) : _v(o.as<oClass>()) {} \ }; \ }; #define __TO_OBJECT_CONVERTER(oClass) \ namespace translate { \ template <> struct to_object<gctools::smart_ptr<oClass>> { \ typedef gctools::smart_ptr<oClass> GivenType; \ static core::T_sp convert(GivenType o) { \ _G(); \ return o; \ } \ }; \ }; #define DECLARE_ENUM_SYMBOL_TRANSLATOR(enumType, psid) \ namespace translate { \ template <> struct from_object<enumType, std::true_type> { \ typedef enumType ExpectedType; \ typedef enumType DeclareType; \ DeclareType _v; \ from_object(T_P o) : _v(static_cast<DeclareType>(core::lisp_lookupEnumForSymbol(psid, o.as<core::Symbol_O>()))){}; \ }; \ template <> struct to_object<enumType> { \ typedef enumType GivenType; \ static core::T_sp convert(enumType e) { \ _G(); \ return core::lisp_lookupSymbolForEnum(psid, (int)(e)); \ } \ }; \ }; #define STREAMIO(classo) \ std::ostream &operator<<(std::ostream &os, gctools::smart_ptr<classo> p) { \ THROW_HARD_ERROR(boost::format("Illegal operator<<")); \ return os; \ } #define TRANSLATE(classo) // STREAMIO(classo); #endif
[ "chris.schaf@verizon.net" ]
chris.schaf@verizon.net
1c8881f2a2755dd40aed7bb39a2f5e3bcbb599a6
c3ac30228bfba25bf70bc5fe3a77c037cb21d3c5
/QPlayer Base FFPlayer/demux.cpp
07ededd03c8a3e5374b3b3a966c16d825b6984c0
[]
no_license
melonbo/ffmpeg
735a30a5f9cd79df458f765fc446600fcd7ccc67
fc40bace8ae1477f47c1872c703dd37445701d46
refs/heads/master
2020-05-07T19:09:09.454301
2019-08-27T16:08:34
2019-08-27T16:08:34
180,799,350
0
2
null
null
null
null
UTF-8
C++
false
false
134,969
cpp
#include "demux.h" #include "QPlayer.h" #include <QMessageBox> #include <QDebug> demux *pdemux; /* * Copyright (c) 2003 Fabrice Bellard * * This file is part of FFmpeg. * * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /** * @file * simple media player based on the FFmpeg libraries */ const char program_name[] = "ffplay"; const int program_birth_year = 2003; #define MAX_QUEUE_SIZE (15 * 1024 * 1024) #define MIN_FRAMES 25 #define EXTERNAL_CLOCK_MIN_FRAMES 2 #define EXTERNAL_CLOCK_MAX_FRAMES 10 /* Minimum SDL audio buffer size, in samples. */ #define SDL_AUDIO_MIN_BUFFER_SIZE 512 /* Calculate actual buffer size keeping in mind not cause too frequent audio callbacks */ #define SDL_AUDIO_MAX_CALLBACKS_PER_SEC 30 /* Step size for volume control in dB */ #define SDL_VOLUME_STEP (0.75) /* no AV sync correction is done if below the minimum AV sync threshold */ #define AV_SYNC_THRESHOLD_MIN 0.04 /* AV sync correction is done if above the maximum AV sync threshold */ #define AV_SYNC_THRESHOLD_MAX 0.1 /* If a frame duration is longer than this, it will not be duplicated to compensate AV sync */ #define AV_SYNC_FRAMEDUP_THRESHOLD 0.1 /* no AV correction is done if too big error */ #define AV_NOSYNC_THRESHOLD 10.0 /* maximum audio speed change to get correct sync */ #define SAMPLE_CORRECTION_PERCENT_MAX 10 /* external clock speed adjustment constants for realtime sources based on buffer fullness */ #define EXTERNAL_CLOCK_SPEED_MIN 0.900 #define EXTERNAL_CLOCK_SPEED_MAX 1.010 #define EXTERNAL_CLOCK_SPEED_STEP 0.001 /* we use about AUDIO_DIFF_AVG_NB A-V differences to make the average */ #define AUDIO_DIFF_AVG_NB 20 /* polls for possible required screen refresh at least this often, should be less than 1/fps */ #define REFRESH_RATE 0.01 #define CURSOR_HIDE_DELAY 1000000 #define USE_ONEPASS_SUBTITLE_RENDER 1 static int avpriv_isnanf(float x) { uint32_t v = av_float2int(x); if ((v & 0x7f800000) != 0x7f800000) return 0; return v & 0x007fffff; } static int avpriv_isnan(double x) { uint64_t v = av_double2int(x); if ((v & 0x7ff0000000000000) != 0x7ff0000000000000) return 0; return (v & 0x000fffffffffffff) && 1; } #define isnan(x) \ (sizeof(x) == sizeof(float) \ ? avpriv_isnanf(x) \ : avpriv_isnan(x)) /* options specified by the user */ static AVInputFormat *file_iformat; static const char *input_filename; static const char *window_title; static int default_width = 640; static int default_height = 480; static int screen_width = 0; static int screen_height = 0; static int screen_left = SDL_WINDOWPOS_CENTERED; static int screen_top = SDL_WINDOWPOS_CENTERED; static int audio_disable; static int video_disable; static int subtitle_disable; static const char* wanted_stream_spec[AVMEDIA_TYPE_NB] = {0}; static int seek_by_bytes = -1; static float seek_interval = 10; static int display_disable; static int borderless; static int startup_volume = 100; static int show_status = 1; static int av_sync_type = AV_SYNC_AUDIO_MASTER; static int64_t start_time = AV_NOPTS_VALUE; static int64_t duration = AV_NOPTS_VALUE; static int fast = 0; static int genpts = 0; static int lowres = 0; static int decoder_reorder_pts = -1; static int autoexit; static int exit_on_keydown; static int exit_on_mousedown; static int loop = 1; static int framedrop = -1; static int infinite_buffer = -1; static enum ShowMode show_mode = SHOW_MODE_NONE; static const char *audio_codec_name; static const char *subtitle_codec_name; static const char *video_codec_name; double rdftspeed = 0.02; static int64_t cursor_last_shown; static int cursor_hidden = 0; #if CONFIG_AVFILTER static const char **vfilters_list = NULL; static int nb_vfilters = 0; static char *afilters = NULL; #endif static int autorotate = 1; static int find_stream_info = 1; /* current context */ static int is_full_screen; static int64_t audio_callback_time; static AVPacket flush_pkt; #define FF_QUIT_EVENT (SDL_USEREVENT + 2) static SDL_Window *window; static SDL_Renderer *renderer; static SDL_RendererInfo renderer_info = {0}; static SDL_AudioDeviceID audio_dev; static const struct TextureFormatEntry { enum AVPixelFormat format; int texture_fmt; } sdl_texture_format_map[] = { { AV_PIX_FMT_RGB8, SDL_PIXELFORMAT_RGB332 }, { AV_PIX_FMT_RGB444, SDL_PIXELFORMAT_RGB444 }, { AV_PIX_FMT_RGB555, SDL_PIXELFORMAT_RGB555 }, { AV_PIX_FMT_BGR555, SDL_PIXELFORMAT_BGR555 }, { AV_PIX_FMT_RGB565, SDL_PIXELFORMAT_RGB565 }, { AV_PIX_FMT_BGR565, SDL_PIXELFORMAT_BGR565 }, { AV_PIX_FMT_RGB24, SDL_PIXELFORMAT_RGB24 }, { AV_PIX_FMT_BGR24, SDL_PIXELFORMAT_BGR24 }, { AV_PIX_FMT_0RGB32, SDL_PIXELFORMAT_RGB888 }, { AV_PIX_FMT_0BGR32, SDL_PIXELFORMAT_BGR888 }, { AV_PIX_FMT_NE(RGB0, 0BGR), SDL_PIXELFORMAT_RGBX8888 }, { AV_PIX_FMT_NE(BGR0, 0RGB), SDL_PIXELFORMAT_BGRX8888 }, { AV_PIX_FMT_RGB32, SDL_PIXELFORMAT_ARGB8888 }, { AV_PIX_FMT_RGB32_1, SDL_PIXELFORMAT_RGBA8888 }, { AV_PIX_FMT_BGR32, SDL_PIXELFORMAT_ABGR8888 }, { AV_PIX_FMT_BGR32_1, SDL_PIXELFORMAT_BGRA8888 }, { AV_PIX_FMT_YUV420P, SDL_PIXELFORMAT_IYUV }, { AV_PIX_FMT_YUYV422, SDL_PIXELFORMAT_YUY2 }, { AV_PIX_FMT_UYVY422, SDL_PIXELFORMAT_UYVY }, { AV_PIX_FMT_NONE, SDL_PIXELFORMAT_UNKNOWN }, }; #if CONFIG_AVFILTER static int opt_add_vfilter(void *optctx, const char *opt, const char *arg) { GROW_ARRAY(vfilters_list, nb_vfilters); vfilters_list[nb_vfilters - 1] = arg; return 0; } #endif static inline int cmp_audio_fmts(enum AVSampleFormat fmt1, int64_t channel_count1, enum AVSampleFormat fmt2, int64_t channel_count2) { /* If channel count == 1, planar and non-planar formats are the same */ if (channel_count1 == 1 && channel_count2 == 1) return av_get_packed_sample_fmt(fmt1) != av_get_packed_sample_fmt(fmt2); else return channel_count1 != channel_count2 || fmt1 != fmt2; } static inline int64_t get_valid_channel_layout(int64_t channel_layout, int channels) { if (channel_layout && av_get_channel_layout_nb_channels(channel_layout) == channels) return channel_layout; else return 0; } static int packet_queue_put_private(PacketQueue *q, AVPacket *pkt) { MyAVPacketList *pkt1; if (q->abort_request) return -1; pkt1 = (MyAVPacketList*) av_malloc(sizeof(MyAVPacketList)); if (!pkt1) return -1; pkt1->pkt = *pkt; pkt1->next = NULL; if (pkt == &flush_pkt) q->serial++; pkt1->serial = q->serial; if (!q->last_pkt) q->first_pkt = pkt1; else q->last_pkt->next = pkt1; q->last_pkt = pkt1; q->nb_packets++; q->size += pkt1->pkt.size + sizeof(*pkt1); q->duration += pkt1->pkt.duration; /* XXX: should duplicate packet data in DV case */ SDL_CondSignal(q->cond); return 0; } static int packet_queue_put(PacketQueue *q, AVPacket *pkt) { int ret; SDL_LockMutex(q->mutex); ret = packet_queue_put_private(q, pkt); SDL_UnlockMutex(q->mutex); if (pkt != &flush_pkt && ret < 0) av_packet_unref(pkt); return ret; } static int packet_queue_put_nullpacket(PacketQueue *q, int stream_index) { AVPacket pkt1, *pkt = &pkt1; av_init_packet(pkt); pkt->data = NULL; pkt->size = 0; pkt->stream_index = stream_index; return packet_queue_put(q, pkt); } /* packet queue handling */ static int packet_queue_init(PacketQueue *q) { memset(q, 0, sizeof(PacketQueue)); q->mutex = SDL_CreateMutex(); if (!q->mutex) { av_log(NULL, AV_LOG_FATAL, "SDL_CreateMutex(): %s\n", SDL_GetError()); return AVERROR(ENOMEM); } q->cond = SDL_CreateCond(); if (!q->cond) { av_log(NULL, AV_LOG_FATAL, "SDL_CreateCond(): %s\n", SDL_GetError()); return AVERROR(ENOMEM); } q->abort_request = 1; return 0; } static void packet_queue_flush(PacketQueue *q) { MyAVPacketList *pkt, *pkt1; SDL_LockMutex(q->mutex); for (pkt = q->first_pkt; pkt; pkt = pkt1) { pkt1 = pkt->next; av_packet_unref(&pkt->pkt); av_freep(&pkt); } q->last_pkt = NULL; q->first_pkt = NULL; q->nb_packets = 0; q->size = 0; q->duration = 0; SDL_UnlockMutex(q->mutex); } static void packet_queue_destroy(PacketQueue *q) { packet_queue_flush(q); SDL_DestroyMutex(q->mutex); SDL_DestroyCond(q->cond); } static void packet_queue_abort(PacketQueue *q) { SDL_LockMutex(q->mutex); q->abort_request = 1; SDL_CondSignal(q->cond); SDL_UnlockMutex(q->mutex); } static void packet_queue_start(PacketQueue *q) { SDL_LockMutex(q->mutex); q->abort_request = 0; packet_queue_put_private(q, &flush_pkt); SDL_UnlockMutex(q->mutex); } /* return < 0 if aborted, 0 if no packet and > 0 if packet. */ static int packet_queue_get(PacketQueue *q, AVPacket *pkt, int block, int *serial) { MyAVPacketList *pkt1; int ret; SDL_LockMutex(q->mutex); for (;;) { if (q->abort_request) { ret = -1; break; } pkt1 = q->first_pkt; if (pkt1) { q->first_pkt = pkt1->next; if (!q->first_pkt) q->last_pkt = NULL; q->nb_packets--; q->size -= pkt1->pkt.size + sizeof(*pkt1); q->duration -= pkt1->pkt.duration; *pkt = pkt1->pkt; if (serial) *serial = pkt1->serial; av_free(pkt1); ret = 1; break; } else if (!block) { ret = 0; break; } else { SDL_CondWait(q->cond, q->mutex); } } SDL_UnlockMutex(q->mutex); return ret; } static void decoder_init(Decoder *d, AVCodecContext *avctx, PacketQueue *queue, SDL_cond *empty_queue_cond) { memset(d, 0, sizeof(Decoder)); d->avctx = avctx; d->queue = queue; d->empty_queue_cond = empty_queue_cond; d->start_pts = AV_NOPTS_VALUE; d->pkt_serial = -1; } static int decoder_decode_frame(Decoder *d, AVFrame *frame, AVSubtitle *sub) { int ret = AVERROR(EAGAIN); for (;;) { AVPacket pkt; if (d->queue->serial == d->pkt_serial) { do { if (d->queue->abort_request) return -1; switch (d->avctx->codec_type) { case AVMEDIA_TYPE_VIDEO: ret = avcodec_receive_frame(d->avctx, frame); if (ret >= 0) { if (decoder_reorder_pts == -1) { frame->pts = frame->best_effort_timestamp; } else if (!decoder_reorder_pts) { frame->pts = frame->pkt_dts; } } break; case AVMEDIA_TYPE_AUDIO: ret = avcodec_receive_frame(d->avctx, frame); if (ret >= 0) { AVRational tb = (AVRational){1, frame->sample_rate}; if (frame->pts != AV_NOPTS_VALUE) frame->pts = av_rescale_q(frame->pts, d->avctx->pkt_timebase, tb); else if (d->next_pts != AV_NOPTS_VALUE) frame->pts = av_rescale_q(d->next_pts, d->next_pts_tb, tb); if (frame->pts != AV_NOPTS_VALUE) { d->next_pts = frame->pts + frame->nb_samples; d->next_pts_tb = tb; } } break; } if (ret == AVERROR_EOF) { d->finished = d->pkt_serial; avcodec_flush_buffers(d->avctx); return 0; } if (ret >= 0) return 1; } while (ret != AVERROR(EAGAIN)); } do { if (d->queue->nb_packets == 0) SDL_CondSignal(d->empty_queue_cond); if (d->packet_pending) { av_packet_move_ref(&pkt, &d->pkt); d->packet_pending = 0; } else { if (packet_queue_get(d->queue, &pkt, 1, &d->pkt_serial) < 0) return -1; } } while (d->queue->serial != d->pkt_serial); if (pkt.data == flush_pkt.data) { avcodec_flush_buffers(d->avctx); d->finished = 0; d->next_pts = d->start_pts; d->next_pts_tb = d->start_pts_tb; } else { if (d->avctx->codec_type == AVMEDIA_TYPE_SUBTITLE) { int got_frame = 0; ret = avcodec_decode_subtitle2(d->avctx, sub, &got_frame, &pkt); if (ret < 0) { ret = AVERROR(EAGAIN); } else { if (got_frame && !pkt.data) { d->packet_pending = 1; av_packet_move_ref(&d->pkt, &pkt); } ret = got_frame ? 0 : (pkt.data ? AVERROR(EAGAIN) : AVERROR_EOF); } } else { if (avcodec_send_packet(d->avctx, &pkt) == AVERROR(EAGAIN)) { av_log(d->avctx, AV_LOG_ERROR, "Receive_frame and send_packet both returned EAGAIN, which is an API violation.\n"); d->packet_pending = 1; av_packet_move_ref(&d->pkt, &pkt); } } av_packet_unref(&pkt); } } } static void decoder_destroy(Decoder *d) { av_packet_unref(&d->pkt); avcodec_free_context(&d->avctx); } static void frame_queue_unref_item(Frame *vp) { av_frame_unref(vp->frame); avsubtitle_free(&vp->sub); } static int frame_queue_init(FrameQueue *f, PacketQueue *pktq, int max_size, int keep_last) { int i; memset(f, 0, sizeof(FrameQueue)); if (!(f->mutex = SDL_CreateMutex())) { av_log(NULL, AV_LOG_FATAL, "SDL_CreateMutex(): %s\n", SDL_GetError()); return AVERROR(ENOMEM); } if (!(f->cond = SDL_CreateCond())) { av_log(NULL, AV_LOG_FATAL, "SDL_CreateCond(): %s\n", SDL_GetError()); return AVERROR(ENOMEM); } f->pktq = pktq; f->max_size = FFMIN(max_size, FRAME_QUEUE_SIZE); f->keep_last = !!keep_last; for (i = 0; i < f->max_size; i++) if (!(f->queue[i].frame = av_frame_alloc())) return AVERROR(ENOMEM); return 0; } static void frame_queue_destory(FrameQueue *f) { int i; for (i = 0; i < f->max_size; i++) { Frame *vp = &f->queue[i]; frame_queue_unref_item(vp); av_frame_free(&vp->frame); } SDL_DestroyMutex(f->mutex); SDL_DestroyCond(f->cond); } static void frame_queue_signal(FrameQueue *f) { SDL_LockMutex(f->mutex); SDL_CondSignal(f->cond); SDL_UnlockMutex(f->mutex); } static Frame *frame_queue_peek(FrameQueue *f) { return &f->queue[(f->rindex + f->rindex_shown) % f->max_size]; } static Frame *frame_queue_peek_next(FrameQueue *f) { return &f->queue[(f->rindex + f->rindex_shown + 1) % f->max_size]; } static Frame *frame_queue_peek_last(FrameQueue *f) { return &f->queue[f->rindex]; } static Frame *frame_queue_peek_writable(FrameQueue *f) { /* wait until we have space to put a new frame */ SDL_LockMutex(f->mutex); while (f->size >= f->max_size && !f->pktq->abort_request) { SDL_CondWait(f->cond, f->mutex); } SDL_UnlockMutex(f->mutex); if (f->pktq->abort_request) return NULL; return &f->queue[f->windex]; } static Frame *frame_queue_peek_readable(FrameQueue *f) { /* wait until we have a readable a new frame */ SDL_LockMutex(f->mutex); while (f->size - f->rindex_shown <= 0 && !f->pktq->abort_request) { SDL_CondWait(f->cond, f->mutex); } SDL_UnlockMutex(f->mutex); if (f->pktq->abort_request) return NULL; return &f->queue[(f->rindex + f->rindex_shown) % f->max_size]; } static void frame_queue_push(FrameQueue *f) { if (++f->windex == f->max_size) f->windex = 0; SDL_LockMutex(f->mutex); f->size++; SDL_CondSignal(f->cond); SDL_UnlockMutex(f->mutex); } static void frame_queue_next(FrameQueue *f) { if (f->keep_last && !f->rindex_shown) { f->rindex_shown = 1; return; } frame_queue_unref_item(&f->queue[f->rindex]); if (++f->rindex == f->max_size) f->rindex = 0; SDL_LockMutex(f->mutex); f->size--; SDL_CondSignal(f->cond); SDL_UnlockMutex(f->mutex); } /* return the number of undisplayed frames in the queue */ static int frame_queue_nb_remaining(FrameQueue *f) { return f->size - f->rindex_shown; } /* return last shown position */ static int64_t frame_queue_last_pos(FrameQueue *f) { Frame *fp = &f->queue[f->rindex]; if (f->rindex_shown && fp->serial == f->pktq->serial) return fp->pos; else return -1; } static void decoder_abort(Decoder *d, FrameQueue *fq) { packet_queue_abort(d->queue); frame_queue_signal(fq); SDL_WaitThread(d->decoder_tid, NULL); d->decoder_tid = NULL; packet_queue_flush(d->queue); } static inline void fill_rectangle(int x, int y, int w, int h) { SDL_Rect rect; rect.x = x; rect.y = y; rect.w = w; rect.h = h; if (w && h) SDL_RenderFillRect(renderer, &rect); } static int realloc_texture(SDL_Texture **texture, Uint32 new_format, int new_width, int new_height, SDL_BlendMode blendmode, int init_texture) { Uint32 format; int access, w, h; if (!*texture || SDL_QueryTexture(*texture, &format, &access, &w, &h) < 0 || new_width != w || new_height != h || new_format != format) { void *pixels; int pitch; if (*texture) SDL_DestroyTexture(*texture); if (!(*texture = SDL_CreateTexture(renderer, new_format, SDL_TEXTUREACCESS_STREAMING, new_width, new_height))) return -1; if (SDL_SetTextureBlendMode(*texture, blendmode) < 0) return -1; if (init_texture) { if (SDL_LockTexture(*texture, NULL, &pixels, &pitch) < 0) return -1; memset(pixels, 0, pitch * new_height); SDL_UnlockTexture(*texture); } av_log(NULL, AV_LOG_VERBOSE, "Created %dx%d texture with %s.\n", new_width, new_height, SDL_GetPixelFormatName(new_format)); } return 0; } static void calculate_display_rect(SDL_Rect *rect, int scr_xleft, int scr_ytop, int scr_width, int scr_height, int pic_width, int pic_height, AVRational pic_sar) { float aspect_ratio; int width, height, x, y; if (pic_sar.num == 0) aspect_ratio = 0; else aspect_ratio = av_q2d(pic_sar); if (aspect_ratio <= 0.0) aspect_ratio = 1.0; aspect_ratio *= (float)pic_width / (float)pic_height; /* XXX: we suppose the screen has a 1.0 pixel ratio */ height = scr_height; width = lrint(height * aspect_ratio) & ~1; if (width > scr_width) { width = scr_width; height = lrint(width / aspect_ratio) & ~1; } x = (scr_width - width) / 2; y = (scr_height - height) / 2; rect->x = scr_xleft + x; rect->y = scr_ytop + y; rect->w = FFMAX(width, 1); rect->h = FFMAX(height, 1); } static void get_sdl_pix_fmt_and_blendmode(int format, Uint32 *sdl_pix_fmt, SDL_BlendMode *sdl_blendmode) { int i; *sdl_blendmode = SDL_BLENDMODE_NONE; *sdl_pix_fmt = SDL_PIXELFORMAT_UNKNOWN; if (format == AV_PIX_FMT_RGB32 || format == AV_PIX_FMT_RGB32_1 || format == AV_PIX_FMT_BGR32 || format == AV_PIX_FMT_BGR32_1) *sdl_blendmode = SDL_BLENDMODE_BLEND; for (i = 0; i < FF_ARRAY_ELEMS(sdl_texture_format_map) - 1; i++) { if (format == sdl_texture_format_map[i].format) { *sdl_pix_fmt = sdl_texture_format_map[i].texture_fmt; return; } } } static int upload_texture(SDL_Texture **tex, AVFrame *frame, struct SwsContext **img_convert_ctx) { int ret = 0; Uint32 sdl_pix_fmt; SDL_BlendMode sdl_blendmode; get_sdl_pix_fmt_and_blendmode(frame->format, &sdl_pix_fmt, &sdl_blendmode); if (realloc_texture(tex, sdl_pix_fmt == SDL_PIXELFORMAT_UNKNOWN ? SDL_PIXELFORMAT_ARGB8888 : sdl_pix_fmt, frame->width, frame->height, sdl_blendmode, 0) < 0) return -1; switch (sdl_pix_fmt) { case SDL_PIXELFORMAT_UNKNOWN: /* This should only happen if we are not using avfilter... */ *img_convert_ctx = sws_getCachedContext(*img_convert_ctx, frame->width, frame->height, (AVPixelFormat)frame->format, frame->width, frame->height, AV_PIX_FMT_BGRA, sws_flags, NULL, NULL, NULL); if (*img_convert_ctx != NULL) { uint8_t *pixels[4]; int pitch[4]; if (!SDL_LockTexture(*tex, NULL, (void **)pixels, pitch)) { sws_scale(*img_convert_ctx, (const uint8_t * const *)frame->data, frame->linesize, 0, frame->height, pixels, pitch); SDL_UnlockTexture(*tex); } } else { av_log(NULL, AV_LOG_FATAL, "Cannot initialize the conversion context\n"); ret = -1; } break; case SDL_PIXELFORMAT_IYUV: if (frame->linesize[0] > 0 && frame->linesize[1] > 0 && frame->linesize[2] > 0) { ret = SDL_UpdateYUVTexture(*tex, NULL, frame->data[0], frame->linesize[0], frame->data[1], frame->linesize[1], frame->data[2], frame->linesize[2]); } else if (frame->linesize[0] < 0 && frame->linesize[1] < 0 && frame->linesize[2] < 0) { ret = SDL_UpdateYUVTexture(*tex, NULL, frame->data[0] + frame->linesize[0] * (frame->height - 1), -frame->linesize[0], frame->data[1] + frame->linesize[1] * (AV_CEIL_RSHIFT(frame->height, 1) - 1), -frame->linesize[1], frame->data[2] + frame->linesize[2] * (AV_CEIL_RSHIFT(frame->height, 1) - 1), -frame->linesize[2]); } else { av_log(NULL, AV_LOG_ERROR, "Mixed negative and positive linesizes are not supported.\n"); return -1; } break; default: if (frame->linesize[0] < 0) { ret = SDL_UpdateTexture(*tex, NULL, frame->data[0] + frame->linesize[0] * (frame->height - 1), -frame->linesize[0]); } else { ret = SDL_UpdateTexture(*tex, NULL, frame->data[0], frame->linesize[0]); } break; } return ret; } static void set_sdl_yuv_conversion_mode(AVFrame *frame) { #if SDL_VERSION_ATLEAST(2,0,8) SDL_YUV_CONVERSION_MODE mode = SDL_YUV_CONVERSION_AUTOMATIC; if (frame && (frame->format == AV_PIX_FMT_YUV420P || frame->format == AV_PIX_FMT_YUYV422 || frame->format == AV_PIX_FMT_UYVY422)) { if (frame->color_range == AVCOL_RANGE_JPEG) mode = SDL_YUV_CONVERSION_JPEG; else if (frame->colorspace == AVCOL_SPC_BT709) mode = SDL_YUV_CONVERSION_BT709; else if (frame->colorspace == AVCOL_SPC_BT470BG || frame->colorspace == AVCOL_SPC_SMPTE170M || frame->colorspace == AVCOL_SPC_SMPTE240M) mode = SDL_YUV_CONVERSION_BT601; } SDL_SetYUVConversionMode(mode); #endif } static void video_image_display(VideoState *is) { Frame *vp; Frame *sp = NULL; SDL_Rect rect; vp = frame_queue_peek_last(&is->pictq); if (is->subtitle_st) { if (frame_queue_nb_remaining(&is->subpq) > 0) { sp = frame_queue_peek(&is->subpq); if (vp->pts >= sp->pts + ((float) sp->sub.start_display_time / 1000)) { if (!sp->uploaded) { uint8_t* pixels[4]; int pitch[4]; int i; if (!sp->width || !sp->height) { sp->width = vp->width; sp->height = vp->height; } if (realloc_texture(&is->sub_texture, SDL_PIXELFORMAT_ARGB8888, sp->width, sp->height, SDL_BLENDMODE_BLEND, 1) < 0) return; for (i = 0; i < sp->sub.num_rects; i++) { AVSubtitleRect *sub_rect = sp->sub.rects[i]; sub_rect->x = av_clip(sub_rect->x, 0, sp->width ); sub_rect->y = av_clip(sub_rect->y, 0, sp->height); sub_rect->w = av_clip(sub_rect->w, 0, sp->width - sub_rect->x); sub_rect->h = av_clip(sub_rect->h, 0, sp->height - sub_rect->y); is->sub_convert_ctx = sws_getCachedContext(is->sub_convert_ctx, sub_rect->w, sub_rect->h, AV_PIX_FMT_PAL8, sub_rect->w, sub_rect->h, AV_PIX_FMT_BGRA, 0, NULL, NULL, NULL); if (!is->sub_convert_ctx) { av_log(NULL, AV_LOG_FATAL, "Cannot initialize the conversion context\n"); return; } if (!SDL_LockTexture(is->sub_texture, (SDL_Rect *)sub_rect, (void **)pixels, pitch)) { sws_scale(is->sub_convert_ctx, (const uint8_t * const *)sub_rect->data, sub_rect->linesize, 0, sub_rect->h, pixels, pitch); SDL_UnlockTexture(is->sub_texture); } } sp->uploaded = 1; } } else sp = NULL; } } calculate_display_rect(&rect, is->xleft, is->ytop, is->width, is->height, vp->width, vp->height, vp->sar); if (!vp->uploaded) { if (upload_texture(&is->vid_texture, vp->frame, &is->img_convert_ctx) < 0) return; vp->uploaded = 1; vp->flip_v = vp->frame->linesize[0] < 0; } set_sdl_yuv_conversion_mode(vp->frame); SDL_RenderCopyEx(renderer, is->vid_texture, NULL, &rect, 0, NULL, vp->flip_v ? (SDL_RendererFlip)SDL_FLIP_VERTICAL : (SDL_RendererFlip)0); set_sdl_yuv_conversion_mode(NULL); if (sp) { #if USE_ONEPASS_SUBTITLE_RENDER SDL_RenderCopy(renderer, is->sub_texture, NULL, &rect); #else int i; double xratio = (double)rect.w / (double)sp->width; double yratio = (double)rect.h / (double)sp->height; for (i = 0; i < sp->sub.num_rects; i++) { SDL_Rect *sub_rect = (SDL_Rect*)sp->sub.rects[i]; SDL_Rect target = {.x = rect.x + sub_rect->x * xratio, .y = rect.y + sub_rect->y * yratio, .w = sub_rect->w * xratio, .h = sub_rect->h * yratio}; SDL_RenderCopy(renderer, is->sub_texture, sub_rect, &target); } #endif } } static inline int compute_mod(int a, int b) { return a < 0 ? a%b + b : a%b; } static void video_audio_display(VideoState *s) { int i, i_start, x, y1, y, ys, delay, n, nb_display_channels; int ch, channels, h, h2; int64_t time_diff; int rdft_bits, nb_freq; for (rdft_bits = 1; (1 << rdft_bits) < 2 * s->height; rdft_bits++) ; nb_freq = 1 << (rdft_bits - 1); /* compute display index : center on currently output samples */ channels = s->audio_tgt.channels; nb_display_channels = channels; if (!s->paused) { int data_used= s->show_mode == SHOW_MODE_WAVES ? s->width : (2*nb_freq); n = 2 * channels; delay = s->audio_write_buf_size; delay /= n; /* to be more precise, we take into account the time spent since the last buffer computation */ if (audio_callback_time) { time_diff = av_gettime_relative() - audio_callback_time; delay -= (time_diff * s->audio_tgt.freq) / 1000000; } delay += 2 * data_used; if (delay < data_used) delay = data_used; i_start= x = compute_mod(s->sample_array_index - delay * channels, SAMPLE_ARRAY_SIZE); if (s->show_mode == SHOW_MODE_WAVES) { h = INT_MIN; for (i = 0; i < 1000; i += channels) { int idx = (SAMPLE_ARRAY_SIZE + x - i) % SAMPLE_ARRAY_SIZE; int a = s->sample_array[idx]; int b = s->sample_array[(idx + 4 * channels) % SAMPLE_ARRAY_SIZE]; int c = s->sample_array[(idx + 5 * channels) % SAMPLE_ARRAY_SIZE]; int d = s->sample_array[(idx + 9 * channels) % SAMPLE_ARRAY_SIZE]; int score = a - d; if (h < score && (b ^ c) < 0) { h = score; i_start = idx; } } } s->last_i_start = i_start; } else { i_start = s->last_i_start; } if (s->show_mode == SHOW_MODE_WAVES) { SDL_SetRenderDrawColor(renderer, 255, 255, 255, 255); /* total height for one channel */ h = s->height / nb_display_channels; /* graph height / 2 */ h2 = (h * 9) / 20; for (ch = 0; ch < nb_display_channels; ch++) { i = i_start + ch; y1 = s->ytop + ch * h + (h / 2); /* position of center line */ for (x = 0; x < s->width; x++) { y = (s->sample_array[i] * h2) >> 15; if (y < 0) { y = -y; ys = y1 - y; } else { ys = y1; } fill_rectangle(s->xleft + x, ys, 1, y); i += channels; if (i >= SAMPLE_ARRAY_SIZE) i -= SAMPLE_ARRAY_SIZE; } } SDL_SetRenderDrawColor(renderer, 0, 0, 255, 255); for (ch = 1; ch < nb_display_channels; ch++) { y = s->ytop + ch * h; fill_rectangle(s->xleft, y, s->width, 1); } } else { if (realloc_texture(&s->vis_texture, SDL_PIXELFORMAT_ARGB8888, s->width, s->height, SDL_BLENDMODE_NONE, 1) < 0) return; nb_display_channels= FFMIN(nb_display_channels, 2); if (rdft_bits != s->rdft_bits) { av_rdft_end(s->rdft); av_free(s->rdft_data); s->rdft = av_rdft_init(rdft_bits, DFT_R2C); s->rdft_bits = rdft_bits; s->rdft_data = (FFTSample*)av_malloc_array(nb_freq, 4 *sizeof(*s->rdft_data)); } if (!s->rdft || !s->rdft_data){ av_log(NULL, AV_LOG_ERROR, "Failed to allocate buffers for RDFT, switching to waves display\n"); s->show_mode = SHOW_MODE_WAVES; } else { FFTSample *data[2]; SDL_Rect rect = {.x = s->xpos, .y = 0, .w = 1, .h = s->height}; uint32_t *pixels; int pitch; for (ch = 0; ch < nb_display_channels; ch++) { data[ch] = s->rdft_data + 2 * nb_freq * ch; i = i_start + ch; for (x = 0; x < 2 * nb_freq; x++) { double w = (x-nb_freq) * (1.0 / nb_freq); data[ch][x] = s->sample_array[i] * (1.0 - w * w); i += channels; if (i >= SAMPLE_ARRAY_SIZE) i -= SAMPLE_ARRAY_SIZE; } av_rdft_calc(s->rdft, data[ch]); } /* Least efficient way to do this, we should of course * directly access it but it is more than fast enough. */ if (!SDL_LockTexture(s->vis_texture, &rect, (void **)&pixels, &pitch)) { pitch >>= 2; pixels += pitch * s->height; for (y = 0; y < s->height; y++) { double w = 1 / sqrt(nb_freq); int a = sqrt(w * sqrt(data[0][2 * y + 0] * data[0][2 * y + 0] + data[0][2 * y + 1] * data[0][2 * y + 1])); int b = (nb_display_channels == 2 ) ? sqrt(w * hypot(data[1][2 * y + 0], data[1][2 * y + 1])) : a; a = FFMIN(a, 255); b = FFMIN(b, 255); pixels -= pitch; *pixels = (a << 16) + (b << 8) + ((a+b) >> 1); } SDL_UnlockTexture(s->vis_texture); } SDL_RenderCopy(renderer, s->vis_texture, NULL, NULL); } if (!s->paused) s->xpos++; if (s->xpos >= s->width) s->xpos= s->xleft; } } static void stream_component_close(VideoState *is, int stream_index) { AVFormatContext *ic = is->ic; AVCodecParameters *codecpar; if (stream_index < 0 || stream_index >= ic->nb_streams) return; codecpar = ic->streams[stream_index]->codecpar; switch (codecpar->codec_type) { case AVMEDIA_TYPE_AUDIO: decoder_abort(&is->auddec, &is->sampq); SDL_CloseAudioDevice(audio_dev); decoder_destroy(&is->auddec); swr_free(&is->swr_ctx); av_freep(&is->audio_buf1); is->audio_buf1_size = 0; is->audio_buf = NULL; if (is->rdft) { av_rdft_end(is->rdft); av_freep(&is->rdft_data); is->rdft = NULL; is->rdft_bits = 0; } break; case AVMEDIA_TYPE_VIDEO: decoder_abort(&is->viddec, &is->pictq); decoder_destroy(&is->viddec); break; case AVMEDIA_TYPE_SUBTITLE: decoder_abort(&is->subdec, &is->subpq); decoder_destroy(&is->subdec); break; default: break; } ic->streams[stream_index]->discard = AVDISCARD_ALL; switch (codecpar->codec_type) { case AVMEDIA_TYPE_AUDIO: is->audio_st = NULL; is->audio_stream = -1; break; case AVMEDIA_TYPE_VIDEO: is->video_st = NULL; is->video_stream = -1; break; case AVMEDIA_TYPE_SUBTITLE: is->subtitle_st = NULL; is->subtitle_stream = -1; break; default: break; } } static void stream_close(VideoState *is) { /* XXX: use a special url_shutdown call to abort parse cleanly */ is->abort_request = 1; SDL_WaitThread(is->read_tid, NULL); /* close each stream */ if (is->audio_stream >= 0) stream_component_close(is, is->audio_stream); if (is->video_stream >= 0) stream_component_close(is, is->video_stream); if (is->subtitle_stream >= 0) stream_component_close(is, is->subtitle_stream); avformat_close_input(&is->ic); packet_queue_destroy(&is->videoq); packet_queue_destroy(&is->audioq); packet_queue_destroy(&is->subtitleq); /* free all pictures */ frame_queue_destory(&is->pictq); frame_queue_destory(&is->sampq); frame_queue_destory(&is->subpq); SDL_DestroyCond(is->continue_read_thread); sws_freeContext(is->img_convert_ctx); sws_freeContext(is->sub_convert_ctx); av_free(is->filename); if (is->vis_texture) SDL_DestroyTexture(is->vis_texture); if (is->vid_texture) SDL_DestroyTexture(is->vid_texture); if (is->sub_texture) SDL_DestroyTexture(is->sub_texture); av_free(is); } static void do_exit(VideoState *is) { if (is) { stream_close(is); } if (renderer) SDL_DestroyRenderer(renderer); if (window) SDL_DestroyWindow(window); uninit_opts(); #if CONFIG_AVFILTER av_freep(&vfilters_list); #endif avformat_network_deinit(); if (show_status) printf("\n"); SDL_Quit(); av_log(NULL, AV_LOG_QUIET, "%s", ""); exit(0); } static void sigterm_handler(int sig) { exit(123); } static void set_default_window_size(int width, int height, AVRational sar) { SDL_Rect rect; calculate_display_rect(&rect, 0, 0, INT_MAX, height, width, height, sar); default_width = rect.w; default_height = rect.h; } static int video_open(VideoState *is) { int w,h; if (screen_width) { w = screen_width; h = screen_height; } else { w = default_width; h = default_height; } if (!window_title) window_title = input_filename; SDL_SetWindowTitle(window, window_title); SDL_SetWindowSize(window, w, h); SDL_SetWindowPosition(window, screen_left, screen_top); if (is_full_screen) SDL_SetWindowFullscreen(window, SDL_WINDOW_FULLSCREEN_DESKTOP); SDL_ShowWindow(window); is->width = w; is->height = h; return 0; } /* display the current picture, if any */ static void video_display(VideoState *is) { if (!is->width) video_open(is); SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255); SDL_RenderClear(renderer); if (is->audio_st && is->show_mode != SHOW_MODE_VIDEO) video_audio_display(is); else if (is->video_st) video_image_display(is); // SDL_RenderPresent(renderer); } static double get_clock(Clock *c) { if (*c->queue_serial != c->serial) return NAN; if (c->paused) { return c->pts; } else { double time = av_gettime_relative() / 1000000.0; return c->pts_drift + time - (time - c->last_updated) * (1.0 - c->speed); } } static void set_clock_at(Clock *c, double pts, int serial, double time) { c->pts = pts; c->last_updated = time; c->pts_drift = c->pts - time; c->serial = serial; } static void set_clock(Clock *c, double pts, int serial) { double time = av_gettime_relative() / 1000000.0; set_clock_at(c, pts, serial, time); } static void set_clock_speed(Clock *c, double speed) { set_clock(c, get_clock(c), c->serial); c->speed = speed; } static void init_clock(Clock *c, int *queue_serial) { c->speed = 1; c->paused = 0; c->queue_serial = queue_serial; set_clock(c, NAN, -1); } static void sync_clock_to_slave(Clock *c, Clock *slave) { double clock = get_clock(c); double slave_clock = get_clock(slave); if (!isnan(slave_clock) && (isnan(clock) || fabs(clock - slave_clock) > AV_NOSYNC_THRESHOLD)) set_clock(c, slave_clock, slave->serial); } static int get_master_sync_type(VideoState *is) { if (is->av_sync_type == AV_SYNC_VIDEO_MASTER) { if (is->video_st) return AV_SYNC_VIDEO_MASTER; else return AV_SYNC_AUDIO_MASTER; } else if (is->av_sync_type == AV_SYNC_AUDIO_MASTER) { if (is->audio_st) return AV_SYNC_AUDIO_MASTER; else return AV_SYNC_EXTERNAL_CLOCK; } else { return AV_SYNC_EXTERNAL_CLOCK; } } /* get the current master clock value */ static double get_master_clock(VideoState *is) { double val; switch (get_master_sync_type(is)) { case AV_SYNC_VIDEO_MASTER: val = get_clock(&is->vidclk); break; case AV_SYNC_AUDIO_MASTER: val = get_clock(&is->audclk); break; default: val = get_clock(&is->extclk); break; } return val; } static void check_external_clock_speed(VideoState *is) { if (is->video_stream >= 0 && is->videoq.nb_packets <= EXTERNAL_CLOCK_MIN_FRAMES || is->audio_stream >= 0 && is->audioq.nb_packets <= EXTERNAL_CLOCK_MIN_FRAMES) { set_clock_speed(&is->extclk, FFMAX(EXTERNAL_CLOCK_SPEED_MIN, is->extclk.speed - EXTERNAL_CLOCK_SPEED_STEP)); } else if ((is->video_stream < 0 || is->videoq.nb_packets > EXTERNAL_CLOCK_MAX_FRAMES) && (is->audio_stream < 0 || is->audioq.nb_packets > EXTERNAL_CLOCK_MAX_FRAMES)) { set_clock_speed(&is->extclk, FFMIN(EXTERNAL_CLOCK_SPEED_MAX, is->extclk.speed + EXTERNAL_CLOCK_SPEED_STEP)); } else { double speed = is->extclk.speed; if (speed != 1.0) set_clock_speed(&is->extclk, speed + EXTERNAL_CLOCK_SPEED_STEP * (1.0 - speed) / fabs(1.0 - speed)); } } /* seek in the stream */ static void stream_seek(VideoState *is, int64_t pos, int64_t rel, int seek_by_bytes) { if (!is->seek_req) { is->seek_pos = pos; is->seek_rel = rel; is->seek_flags &= ~AVSEEK_FLAG_BYTE; if (seek_by_bytes) is->seek_flags |= AVSEEK_FLAG_BYTE; is->seek_req = 1; SDL_CondSignal(is->continue_read_thread); } } /* pause or resume the video */ static void stream_toggle_pause(VideoState *is) { if (is->paused) { is->frame_timer += av_gettime_relative() / 1000000.0 - is->vidclk.last_updated; if (is->read_pause_return != AVERROR(ENOSYS)) { is->vidclk.paused = 0; } set_clock(&is->vidclk, get_clock(&is->vidclk), is->vidclk.serial); } set_clock(&is->extclk, get_clock(&is->extclk), is->extclk.serial); is->paused = is->audclk.paused = is->vidclk.paused = is->extclk.paused = !is->paused; } static void toggle_pause(VideoState *is) { stream_toggle_pause(is); is->step = 0; } static void toggle_mute(VideoState *is) { is->muted = !is->muted; } static void update_volume(VideoState *is, int sign, double step) { double volume_level = is->audio_volume ? (20 * log(is->audio_volume / (double)SDL_MIX_MAXVOLUME) / log(10)) : -1000.0; int new_volume = lrint(SDL_MIX_MAXVOLUME * pow(10.0, (volume_level + sign * step) / 20.0)); is->audio_volume = av_clip(is->audio_volume == new_volume ? (is->audio_volume + sign) : new_volume, 0, SDL_MIX_MAXVOLUME); } static void step_to_next_frame(VideoState *is) { /* if the stream is paused unpause it, then step */ if (is->paused) stream_toggle_pause(is); is->step = 1; } static double compute_target_delay(double delay, VideoState *is) { double sync_threshold, diff = 0; /* update delay to follow master synchronisation source */ if (get_master_sync_type(is) != AV_SYNC_VIDEO_MASTER) { /* if video is slave, we try to correct big delays by duplicating or deleting a frame */ diff = get_clock(&is->vidclk) - get_master_clock(is); /* skip or repeat frame. We take into account the delay to compute the threshold. I still don't know if it is the best guess */ sync_threshold = FFMAX(AV_SYNC_THRESHOLD_MIN, FFMIN(AV_SYNC_THRESHOLD_MAX, delay)); if (!isnan(diff) && fabs(diff) < is->max_frame_duration) { if (diff <= -sync_threshold) delay = FFMAX(0, delay + diff); else if (diff >= sync_threshold && delay > AV_SYNC_FRAMEDUP_THRESHOLD) delay = delay + diff; else if (diff >= sync_threshold) delay = 2 * delay; } } av_log(NULL, AV_LOG_TRACE, "video: delay=%0.3f A-V=%f\n", delay, -diff); return delay; } static double vp_duration(VideoState *is, Frame *vp, Frame *nextvp) { if (vp->serial == nextvp->serial) { double duration = nextvp->pts - vp->pts; if (isnan(duration) || duration <= 0 || duration > is->max_frame_duration) return vp->duration; else return duration; } else { return 0.0; } } static void update_video_pts(VideoState *is, double pts, int64_t pos, int serial) { /* update current video pts */ set_clock(&is->vidclk, pts, serial); sync_clock_to_slave(&is->extclk, &is->vidclk); } /* called to display each frame */ static void video_refresh(void *opaque, double *remaining_time) { VideoState *is = (VideoState*)opaque; double time; Frame *sp, *sp2; if (!is->paused && get_master_sync_type(is) == AV_SYNC_EXTERNAL_CLOCK && is->realtime) check_external_clock_speed(is); if (!display_disable && is->show_mode != SHOW_MODE_VIDEO && is->audio_st) { time = av_gettime_relative() / 1000000.0; if (is->force_refresh || is->last_vis_time + rdftspeed < time) { video_display(is); is->last_vis_time = time; } *remaining_time = FFMIN(*remaining_time, is->last_vis_time + rdftspeed - time); } if (is->video_st) { retry: if (frame_queue_nb_remaining(&is->pictq) == 0) { // nothing to do, no picture to display in the queue } else { double last_duration, duration, delay; Frame *vp, *lastvp; /* dequeue the picture */ lastvp = frame_queue_peek_last(&is->pictq); vp = frame_queue_peek(&is->pictq); if (vp->serial != is->videoq.serial) { frame_queue_next(&is->pictq); goto retry; } if (lastvp->serial != vp->serial) is->frame_timer = av_gettime_relative() / 1000000.0; if (is->paused) goto display; /* compute nominal last_duration */ last_duration = vp_duration(is, lastvp, vp); delay = compute_target_delay(last_duration, is); time= av_gettime_relative()/1000000.0; if (time < is->frame_timer + delay) { *remaining_time = FFMIN(is->frame_timer + delay - time, *remaining_time); goto display; } is->frame_timer += delay; if (delay > 0 && time - is->frame_timer > AV_SYNC_THRESHOLD_MAX) is->frame_timer = time; SDL_LockMutex(is->pictq.mutex); if (!isnan(vp->pts)) update_video_pts(is, vp->pts, vp->pos, vp->serial); SDL_UnlockMutex(is->pictq.mutex); if (frame_queue_nb_remaining(&is->pictq) > 1) { Frame *nextvp = frame_queue_peek_next(&is->pictq); duration = vp_duration(is, vp, nextvp); if(!is->step && (framedrop>0 || (framedrop && get_master_sync_type(is) != AV_SYNC_VIDEO_MASTER)) && time > is->frame_timer + duration){ is->frame_drops_late++; frame_queue_next(&is->pictq); goto retry; } } if (is->subtitle_st) { while (frame_queue_nb_remaining(&is->subpq) > 0) { sp = frame_queue_peek(&is->subpq); if (frame_queue_nb_remaining(&is->subpq) > 1) sp2 = frame_queue_peek_next(&is->subpq); else sp2 = NULL; if (sp->serial != is->subtitleq.serial || (is->vidclk.pts > (sp->pts + ((float) sp->sub.end_display_time / 1000))) || (sp2 && is->vidclk.pts > (sp2->pts + ((float) sp2->sub.start_display_time / 1000)))) { if (sp->uploaded) { int i; for (i = 0; i < sp->sub.num_rects; i++) { AVSubtitleRect *sub_rect = sp->sub.rects[i]; uint8_t *pixels; int pitch, j; if (!SDL_LockTexture(is->sub_texture, (SDL_Rect *)sub_rect, (void **)&pixels, &pitch)) { for (j = 0; j < sub_rect->h; j++, pixels += pitch) memset(pixels, 0, sub_rect->w << 2); SDL_UnlockTexture(is->sub_texture); } } } frame_queue_next(&is->subpq); } else { break; } } } frame_queue_next(&is->pictq); is->force_refresh = 1; if (is->step && !is->paused) stream_toggle_pause(is); } display: /* display picture */ if (!display_disable && is->force_refresh && is->show_mode == SHOW_MODE_VIDEO && is->pictq.rindex_shown) video_display(is); } is->force_refresh = 0; if (show_status) { static int64_t last_time; int64_t cur_time; int aqsize, vqsize, sqsize; double av_diff; cur_time = av_gettime_relative(); if (!last_time || (cur_time - last_time) >= 30000) { aqsize = 0; vqsize = 0; sqsize = 0; if (is->audio_st) aqsize = is->audioq.size; if (is->video_st) vqsize = is->videoq.size; if (is->subtitle_st) sqsize = is->subtitleq.size; av_diff = 0; if (is->audio_st && is->video_st) av_diff = get_clock(&is->audclk) - get_clock(&is->vidclk); else if (is->video_st) av_diff = get_master_clock(is) - get_clock(&is->vidclk); else if (is->audio_st) av_diff = get_master_clock(is) - get_clock(&is->audclk); /* av_log(NULL, AV_LOG_INFO, "%7.2f %s:%7.3f fd=%4d aq=%5dKB vq=%5dKB sq=%5dB f=%"PRId64"/%"PRId64" \r", get_master_clock(is), (is->audio_st && is->video_st) ? "A-V" : (is->video_st ? "M-V" : (is->audio_st ? "M-A" : " ")), av_diff, is->frame_drops_early + is->frame_drops_late, aqsize / 1024, vqsize / 1024, sqsize, is->video_st ? is->viddec.avctx->pts_correction_num_faulty_dts : 0, is->video_st ? is->viddec.avctx->pts_correction_num_faulty_pts : 0); */ fflush(stdout); last_time = cur_time; } } } static int queue_picture(VideoState *is, AVFrame *src_frame, double pts, double duration, int64_t pos, int serial) { Frame *vp; #if defined(DEBUG_SYNC) printf("frame_type=%c pts=%0.3f\n", av_get_picture_type_char(src_frame->pict_type), pts); #endif if (!(vp = frame_queue_peek_writable(&is->pictq))) return -1; vp->sar = src_frame->sample_aspect_ratio; vp->uploaded = 0; vp->width = src_frame->width; vp->height = src_frame->height; vp->format = src_frame->format; vp->pts = pts; vp->duration = duration; vp->pos = pos; vp->serial = serial; set_default_window_size(vp->width, vp->height, vp->sar); av_frame_move_ref(vp->frame, src_frame); frame_queue_push(&is->pictq); return 0; } static int get_video_frame(VideoState *is, AVFrame *frame) { int got_picture; if ((got_picture = decoder_decode_frame(&is->viddec, frame, NULL)) < 0) return -1; if (got_picture) { double dpts = NAN; if (frame->pts != AV_NOPTS_VALUE) { dpts = av_q2d(is->video_st->time_base) * frame->pts; // qDebug("get a frame, pts = %f", dpts); pdemux->setCurrentTime((int)dpts); } frame->sample_aspect_ratio = av_guess_sample_aspect_ratio(is->ic, is->video_st, frame); if (framedrop>0 || (framedrop && get_master_sync_type(is) != AV_SYNC_VIDEO_MASTER)) { if (frame->pts != AV_NOPTS_VALUE) { double diff = dpts - get_master_clock(is); if (!isnan(diff) && fabs(diff) < AV_NOSYNC_THRESHOLD && diff - is->frame_last_filter_delay < 0 && is->viddec.pkt_serial == is->vidclk.serial && is->videoq.nb_packets) { is->frame_drops_early++; av_frame_unref(frame); got_picture = 0; } } } } return got_picture; } #if CONFIG_AVFILTER static int configure_filtergraph(AVFilterGraph *graph, const char *filtergraph, AVFilterContext *source_ctx, AVFilterContext *sink_ctx) { int ret, i; int nb_filters = graph->nb_filters; AVFilterInOut *outputs = NULL, *inputs = NULL; if (filtergraph) { outputs = avfilter_inout_alloc(); inputs = avfilter_inout_alloc(); if (!outputs || !inputs) { ret = AVERROR(ENOMEM); goto fail; } outputs->name = av_strdup("in"); outputs->filter_ctx = source_ctx; outputs->pad_idx = 0; outputs->next = NULL; inputs->name = av_strdup("out"); inputs->filter_ctx = sink_ctx; inputs->pad_idx = 0; inputs->next = NULL; if ((ret = avfilter_graph_parse_ptr(graph, filtergraph, &inputs, &outputs, NULL)) < 0) goto fail; } else { if ((ret = avfilter_link(source_ctx, 0, sink_ctx, 0)) < 0) goto fail; } /* Reorder the filters to ensure that inputs of the custom filters are merged first */ for (i = 0; i < graph->nb_filters - nb_filters; i++) FFSWAP(AVFilterContext*, graph->filters[i], graph->filters[i + nb_filters]); ret = avfilter_graph_config(graph, NULL); fail: avfilter_inout_free(&outputs); avfilter_inout_free(&inputs); return ret; } static int configure_video_filters(AVFilterGraph *graph, VideoState *is, const char *vfilters, AVFrame *frame) { enum AVPixelFormat pix_fmts[FF_ARRAY_ELEMS(sdl_texture_format_map)]; char sws_flags_str[512] = ""; char buffersrc_args[256]; int ret; AVFilterContext *filt_src = NULL, *filt_out = NULL, *last_filter = NULL; AVCodecParameters *codecpar = is->video_st->codecpar; AVRational fr = av_guess_frame_rate(is->ic, is->video_st, NULL); AVDictionaryEntry *e = NULL; int nb_pix_fmts = 0; int i, j; for (i = 0; i < renderer_info.num_texture_formats; i++) { for (j = 0; j < FF_ARRAY_ELEMS(sdl_texture_format_map) - 1; j++) { if (renderer_info.texture_formats[i] == sdl_texture_format_map[j].texture_fmt) { pix_fmts[nb_pix_fmts++] = sdl_texture_format_map[j].format; break; } } } pix_fmts[nb_pix_fmts] = AV_PIX_FMT_NONE; while ((e = av_dict_get(sws_dict, "", e, AV_DICT_IGNORE_SUFFIX))) { if (!strcmp(e->key, "sws_flags")) { av_strlcatf(sws_flags_str, sizeof(sws_flags_str), "%s=%s:", "flags", e->value); } else av_strlcatf(sws_flags_str, sizeof(sws_flags_str), "%s=%s:", e->key, e->value); } if (strlen(sws_flags_str)) sws_flags_str[strlen(sws_flags_str)-1] = '\0'; graph->scale_sws_opts = av_strdup(sws_flags_str); snprintf(buffersrc_args, sizeof(buffersrc_args), "video_size=%dx%d:pix_fmt=%d:time_base=%d/%d:pixel_aspect=%d/%d", frame->width, frame->height, frame->format, is->video_st->time_base.num, is->video_st->time_base.den, codecpar->sample_aspect_ratio.num, FFMAX(codecpar->sample_aspect_ratio.den, 1)); if (fr.num && fr.den) av_strlcatf(buffersrc_args, sizeof(buffersrc_args), ":frame_rate=%d/%d", fr.num, fr.den); if ((ret = avfilter_graph_create_filter(&filt_src, avfilter_get_by_name("buffer"), "ffplay_buffer", buffersrc_args, NULL, graph)) < 0) goto fail; ret = avfilter_graph_create_filter(&filt_out, avfilter_get_by_name("buffersink"), "ffplay_buffersink", NULL, NULL, graph); if (ret < 0) goto fail; if ((ret = av_opt_set_int_list(filt_out, "pix_fmts", pix_fmts, AV_PIX_FMT_NONE, AV_OPT_SEARCH_CHILDREN)) < 0) goto fail; last_filter = filt_out; /* Note: this macro adds a filter before the lastly added filter, so the * processing order of the filters is in reverse */ #define INSERT_FILT(name, arg) do { \ AVFilterContext *filt_ctx; \ \ ret = avfilter_graph_create_filter(&filt_ctx, \ avfilter_get_by_name(name), \ "ffplay_" name, arg, NULL, graph); \ if (ret < 0) \ goto fail; \ \ ret = avfilter_link(filt_ctx, 0, last_filter, 0); \ if (ret < 0) \ goto fail; \ \ last_filter = filt_ctx; \ } while (0) if (autorotate) { double theta = get_rotation(is->video_st); if (fabs(theta - 90) < 1.0) { INSERT_FILT("transpose", "clock"); } else if (fabs(theta - 180) < 1.0) { INSERT_FILT("hflip", NULL); INSERT_FILT("vflip", NULL); } else if (fabs(theta - 270) < 1.0) { INSERT_FILT("transpose", "cclock"); } else if (fabs(theta) > 1.0) { char rotate_buf[64]; snprintf(rotate_buf, sizeof(rotate_buf), "%f*PI/180", theta); INSERT_FILT("rotate", rotate_buf); } } if ((ret = configure_filtergraph(graph, vfilters, filt_src, last_filter)) < 0) goto fail; is->in_video_filter = filt_src; is->out_video_filter = filt_out; fail: return ret; } static int configure_audio_filters(VideoState *is, const char *afilters, int force_output_format) { static const enum AVSampleFormat sample_fmts[] = { AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }; int sample_rates[2] = { 0, -1 }; int64_t channel_layouts[2] = { 0, -1 }; int channels[2] = { 0, -1 }; AVFilterContext *filt_asrc = NULL, *filt_asink = NULL; char aresample_swr_opts[512] = ""; AVDictionaryEntry *e = NULL; char asrc_args[256]; int ret; avfilter_graph_free(&is->agraph); if (!(is->agraph = avfilter_graph_alloc())) return AVERROR(ENOMEM); while ((e = av_dict_get(swr_opts, "", e, AV_DICT_IGNORE_SUFFIX))) av_strlcatf(aresample_swr_opts, sizeof(aresample_swr_opts), "%s=%s:", e->key, e->value); if (strlen(aresample_swr_opts)) aresample_swr_opts[strlen(aresample_swr_opts)-1] = '\0'; av_opt_set(is->agraph, "aresample_swr_opts", aresample_swr_opts, 0); ret = snprintf(asrc_args, sizeof(asrc_args), "sample_rate=%d:sample_fmt=%s:channels=%d:time_base=%d/%d", is->audio_filter_src.freq, av_get_sample_fmt_name(is->audio_filter_src.fmt), is->audio_filter_src.channels, 1, is->audio_filter_src.freq); if (is->audio_filter_src.channel_layout) snprintf(asrc_args + ret, sizeof(asrc_args) - ret, ":channel_layout=0x%"PRIx64, is->audio_filter_src.channel_layout); ret = avfilter_graph_create_filter(&filt_asrc, avfilter_get_by_name("abuffer"), "ffplay_abuffer", asrc_args, NULL, is->agraph); if (ret < 0) goto end; ret = avfilter_graph_create_filter(&filt_asink, avfilter_get_by_name("abuffersink"), "ffplay_abuffersink", NULL, NULL, is->agraph); if (ret < 0) goto end; if ((ret = av_opt_set_int_list(filt_asink, "sample_fmts", sample_fmts, AV_SAMPLE_FMT_NONE, AV_OPT_SEARCH_CHILDREN)) < 0) goto end; if ((ret = av_opt_set_int(filt_asink, "all_channel_counts", 1, AV_OPT_SEARCH_CHILDREN)) < 0) goto end; if (force_output_format) { channel_layouts[0] = is->audio_tgt.channel_layout; channels [0] = is->audio_tgt.channels; sample_rates [0] = is->audio_tgt.freq; if ((ret = av_opt_set_int(filt_asink, "all_channel_counts", 0, AV_OPT_SEARCH_CHILDREN)) < 0) goto end; if ((ret = av_opt_set_int_list(filt_asink, "channel_layouts", channel_layouts, -1, AV_OPT_SEARCH_CHILDREN)) < 0) goto end; if ((ret = av_opt_set_int_list(filt_asink, "channel_counts" , channels , -1, AV_OPT_SEARCH_CHILDREN)) < 0) goto end; if ((ret = av_opt_set_int_list(filt_asink, "sample_rates" , sample_rates , -1, AV_OPT_SEARCH_CHILDREN)) < 0) goto end; } if ((ret = configure_filtergraph(is->agraph, afilters, filt_asrc, filt_asink)) < 0) goto end; is->in_audio_filter = filt_asrc; is->out_audio_filter = filt_asink; end: if (ret < 0) avfilter_graph_free(&is->agraph); return ret; } #endif /* CONFIG_AVFILTER */ static int audio_thread(void *arg) { VideoState *is = (VideoState*)arg; AVFrame *frame = av_frame_alloc(); Frame *af; #if CONFIG_AVFILTER int last_serial = -1; int64_t dec_channel_layout; int reconfigure; #endif int got_frame = 0; AVRational tb; int ret = 0; if (!frame) return AVERROR(ENOMEM); do { if ((got_frame = decoder_decode_frame(&is->auddec, frame, NULL)) < 0) goto the_end; if (got_frame) { tb = (AVRational){1, frame->sample_rate}; #if CONFIG_AVFILTER dec_channel_layout = get_valid_channel_layout(frame->channel_layout, frame->channels); reconfigure = cmp_audio_fmts(is->audio_filter_src.fmt, is->audio_filter_src.channels, frame->format, frame->channels) || is->audio_filter_src.channel_layout != dec_channel_layout || is->audio_filter_src.freq != frame->sample_rate || is->auddec.pkt_serial != last_serial; if (reconfigure) { char buf1[1024], buf2[1024]; av_get_channel_layout_string(buf1, sizeof(buf1), -1, is->audio_filter_src.channel_layout); av_get_channel_layout_string(buf2, sizeof(buf2), -1, dec_channel_layout); av_log(NULL, AV_LOG_DEBUG, "Audio frame changed from rate:%d ch:%d fmt:%s layout:%s serial:%d to rate:%d ch:%d fmt:%s layout:%s serial:%d\n", is->audio_filter_src.freq, is->audio_filter_src.channels, av_get_sample_fmt_name(is->audio_filter_src.fmt), buf1, last_serial, frame->sample_rate, frame->channels, av_get_sample_fmt_name(frame->format), buf2, is->auddec.pkt_serial); is->audio_filter_src.fmt = frame->format; is->audio_filter_src.channels = frame->channels; is->audio_filter_src.channel_layout = dec_channel_layout; is->audio_filter_src.freq = frame->sample_rate; last_serial = is->auddec.pkt_serial; if ((ret = configure_audio_filters(is, afilters, 1)) < 0) goto the_end; } if ((ret = av_buffersrc_add_frame(is->in_audio_filter, frame)) < 0) goto the_end; while ((ret = av_buffersink_get_frame_flags(is->out_audio_filter, frame, 0)) >= 0) { tb = av_buffersink_get_time_base(is->out_audio_filter); #endif if (!(af = frame_queue_peek_writable(&is->sampq))) goto the_end; af->pts = (frame->pts == AV_NOPTS_VALUE) ? NAN : frame->pts * av_q2d(tb); af->pos = frame->pkt_pos; af->serial = is->auddec.pkt_serial; af->duration = av_q2d((AVRational){frame->nb_samples, frame->sample_rate}); av_frame_move_ref(af->frame, frame); frame_queue_push(&is->sampq); #if CONFIG_AVFILTER if (is->audioq.serial != is->auddec.pkt_serial) break; } if (ret == AVERROR_EOF) is->auddec.finished = is->auddec.pkt_serial; #endif } } while (ret >= 0 || ret == AVERROR(EAGAIN) || ret == AVERROR_EOF); the_end: #if CONFIG_AVFILTER avfilter_graph_free(&is->agraph); #endif av_frame_free(&frame); return ret; } static int decoder_start(Decoder *d, int (*fn)(void *), void *arg) { packet_queue_start(d->queue); d->decoder_tid = SDL_CreateThread(fn, "decoder", arg); if (!d->decoder_tid) { av_log(NULL, AV_LOG_ERROR, "SDL_CreateThread(): %s\n", SDL_GetError()); return AVERROR(ENOMEM); } return 0; } static int video_thread(void *arg) { VideoState *is = (VideoState*)arg; AVFrame *frame = av_frame_alloc(); double pts; double duration; int ret; AVRational tb = is->video_st->time_base; AVRational frame_rate = av_guess_frame_rate(is->ic, is->video_st, NULL); #if CONFIG_AVFILTER AVFilterGraph *graph = avfilter_graph_alloc(); AVFilterContext *filt_out = NULL, *filt_in = NULL; int last_w = 0; int last_h = 0; enum AVPixelFormat last_format = -2; int last_serial = -1; int last_vfilter_idx = 0; if (!graph) { av_frame_free(&frame); return AVERROR(ENOMEM); } #endif if (!frame) { #if CONFIG_AVFILTER avfilter_graph_free(&graph); #endif return AVERROR(ENOMEM); } QPlayer *gui = (QPlayer *)pdemux->player; uint8_t *out_buffer; int dstWidth = gui->getPresentWidth(); int dstHeight = gui->getPresentHeight(); AVPixelFormat dstAV_PIX_FMT = AV_PIX_FMT_RGB32; AVFrame *pFrame,*pFrameYUV; // pFrame=av_frame_alloc(); pFrameYUV=av_frame_alloc(); out_buffer=(uint8_t *)av_malloc(avpicture_get_size(dstAV_PIX_FMT, dstWidth, dstHeight)); avpicture_fill((AVPicture *)pFrameYUV, out_buffer, dstAV_PIX_FMT, dstWidth, dstHeight); struct SwsContext *img_convert_ctx = sws_getContext(is->viddec.avctx->width, is->viddec.avctx->height, is->viddec.avctx->pix_fmt, dstWidth, dstHeight, dstAV_PIX_FMT, SWS_BICUBIC, NULL, NULL, NULL); for (;;) { ret = get_video_frame(is, frame); if (ret < 0) goto the_end; if (!ret) continue; #if CONFIG_AVFILTER if ( last_w != frame->width || last_h != frame->height || last_format != frame->format || last_serial != is->viddec.pkt_serial || last_vfilter_idx != is->vfilter_idx) { av_log(NULL, AV_LOG_DEBUG, "Video frame changed from size:%dx%d format:%s serial:%d to size:%dx%d format:%s serial:%d\n", last_w, last_h, (const char *)av_x_if_null(av_get_pix_fmt_name(last_format), "none"), last_serial, frame->width, frame->height, (const char *)av_x_if_null(av_get_pix_fmt_name(frame->format), "none"), is->viddec.pkt_serial); avfilter_graph_free(&graph); graph = avfilter_graph_alloc(); if ((ret = configure_video_filters(graph, is, vfilters_list ? vfilters_list[is->vfilter_idx] : NULL, frame)) < 0) { SDL_Event event; event.type = FF_QUIT_EVENT; event.user.data1 = is; SDL_PushEvent(&event); goto the_end; } filt_in = is->in_video_filter; filt_out = is->out_video_filter; last_w = frame->width; last_h = frame->height; last_format = frame->format; last_serial = is->viddec.pkt_serial; last_vfilter_idx = is->vfilter_idx; frame_rate = av_buffersink_get_frame_rate(filt_out); } ret = av_buffersrc_add_frame(filt_in, frame); if (ret < 0) goto the_end; while (ret >= 0) { is->frame_last_returned_time = av_gettime_relative() / 1000000.0; ret = av_buffersink_get_frame_flags(filt_out, frame, 0); if (ret < 0) { if (ret == AVERROR_EOF) is->viddec.finished = is->viddec.pkt_serial; ret = 0; break; } is->frame_last_filter_delay = av_gettime_relative() / 1000000.0 - is->frame_last_returned_time; if (fabs(is->frame_last_filter_delay) > AV_NOSYNC_THRESHOLD / 10.0) is->frame_last_filter_delay = 0; tb = av_buffersink_get_time_base(filt_out); #endif sws_scale(img_convert_ctx, (const uint8_t* const*)frame->data, frame->linesize, 0, is->viddec.avctx->height, pFrameYUV->data, pFrameYUV->linesize); QImage tmpImg((uchar*)out_buffer, dstWidth, dstHeight, QImage::Format_RGB32); QImage image = tmpImg.copy(); //把图像复制一份 传递给界面显示 pdemux->sendImg(image); duration = (frame_rate.num && frame_rate.den ? av_q2d((AVRational){frame_rate.den, frame_rate.num}) : 0); pts = (frame->pts == AV_NOPTS_VALUE) ? NAN : frame->pts * av_q2d(tb); ret = queue_picture(is, frame, pts, duration, frame->pkt_pos, is->viddec.pkt_serial); av_frame_unref(frame); #if CONFIG_AVFILTER if (is->videoq.serial != is->viddec.pkt_serial) break; } #endif if (ret < 0) goto the_end; } the_end: #if CONFIG_AVFILTER avfilter_graph_free(&graph); #endif av_frame_free(&frame); return 0; } static int subtitle_thread(void *arg) { VideoState *is = (VideoState*)arg; Frame *sp; int got_subtitle; double pts; for (;;) { if (!(sp = frame_queue_peek_writable(&is->subpq))) return 0; if ((got_subtitle = decoder_decode_frame(&is->subdec, NULL, &sp->sub)) < 0) break; pts = 0; if (got_subtitle && sp->sub.format == 0) { if (sp->sub.pts != AV_NOPTS_VALUE) pts = sp->sub.pts / (double)AV_TIME_BASE; sp->pts = pts; sp->serial = is->subdec.pkt_serial; sp->width = is->subdec.avctx->width; sp->height = is->subdec.avctx->height; sp->uploaded = 0; /* now we can update the picture count */ frame_queue_push(&is->subpq); } else if (got_subtitle) { avsubtitle_free(&sp->sub); } } return 0; } /* copy samples for viewing in editor window */ static void update_sample_display(VideoState *is, short *samples, int samples_size) { int size, len; size = samples_size / sizeof(short); while (size > 0) { len = SAMPLE_ARRAY_SIZE - is->sample_array_index; if (len > size) len = size; memcpy(is->sample_array + is->sample_array_index, samples, len * sizeof(short)); samples += len; is->sample_array_index += len; if (is->sample_array_index >= SAMPLE_ARRAY_SIZE) is->sample_array_index = 0; size -= len; } } /* return the wanted number of samples to get better sync if sync_type is video * or external master clock */ static int synchronize_audio(VideoState *is, int nb_samples) { int wanted_nb_samples = nb_samples; /* if not master, then we try to remove or add samples to correct the clock */ if (get_master_sync_type(is) != AV_SYNC_AUDIO_MASTER) { double diff, avg_diff; int min_nb_samples, max_nb_samples; diff = get_clock(&is->audclk) - get_master_clock(is); if (!isnan(diff) && fabs(diff) < AV_NOSYNC_THRESHOLD) { is->audio_diff_cum = diff + is->audio_diff_avg_coef * is->audio_diff_cum; if (is->audio_diff_avg_count < AUDIO_DIFF_AVG_NB) { /* not enough measures to have a correct estimate */ is->audio_diff_avg_count++; } else { /* estimate the A-V difference */ avg_diff = is->audio_diff_cum * (1.0 - is->audio_diff_avg_coef); if (fabs(avg_diff) >= is->audio_diff_threshold) { wanted_nb_samples = nb_samples + (int)(diff * is->audio_src.freq); min_nb_samples = ((nb_samples * (100 - SAMPLE_CORRECTION_PERCENT_MAX) / 100)); max_nb_samples = ((nb_samples * (100 + SAMPLE_CORRECTION_PERCENT_MAX) / 100)); wanted_nb_samples = av_clip(wanted_nb_samples, min_nb_samples, max_nb_samples); } av_log(NULL, AV_LOG_TRACE, "diff=%f adiff=%f sample_diff=%d apts=%0.3f %f\n", diff, avg_diff, wanted_nb_samples - nb_samples, is->audio_clock, is->audio_diff_threshold); } } else { /* too big difference : may be initial PTS errors, so reset A-V filter */ is->audio_diff_avg_count = 0; is->audio_diff_cum = 0; } } return wanted_nb_samples; } /** * Decode one audio frame and return its uncompressed size. * * The processed audio frame is decoded, converted if required, and * stored in is->audio_buf, with size in bytes given by the return * value. */ static int audio_decode_frame(VideoState *is) { int data_size, resampled_data_size; int64_t dec_channel_layout; av_unused double audio_clock0; int wanted_nb_samples; Frame *af; if (is->paused) return -1; do { #if defined(_WIN32) while (frame_queue_nb_remaining(&is->sampq) == 0) { if ((av_gettime_relative() - audio_callback_time) > 1000000LL * is->audio_hw_buf_size / is->audio_tgt.bytes_per_sec / 2) return -1; av_usleep (1000); } #endif if (!(af = frame_queue_peek_readable(&is->sampq))) return -1; frame_queue_next(&is->sampq); } while (af->serial != is->audioq.serial); data_size = av_samples_get_buffer_size(NULL, af->frame->channels, af->frame->nb_samples, (AVSampleFormat)af->frame->format, 1); dec_channel_layout = (af->frame->channel_layout && af->frame->channels == av_get_channel_layout_nb_channels(af->frame->channel_layout)) ? af->frame->channel_layout : av_get_default_channel_layout(af->frame->channels); wanted_nb_samples = synchronize_audio(is, af->frame->nb_samples); if (af->frame->format != is->audio_src.fmt || dec_channel_layout != is->audio_src.channel_layout || af->frame->sample_rate != is->audio_src.freq || (wanted_nb_samples != af->frame->nb_samples && !is->swr_ctx)) { swr_free(&is->swr_ctx); is->swr_ctx = swr_alloc_set_opts(NULL, is->audio_tgt.channel_layout, is->audio_tgt.fmt, is->audio_tgt.freq, dec_channel_layout, (AVSampleFormat)af->frame->format, af->frame->sample_rate, 0, NULL); if (!is->swr_ctx || swr_init(is->swr_ctx) < 0) { av_log(NULL, AV_LOG_ERROR, "Cannot create sample rate converter for conversion of %d Hz %s %d channels to %d Hz %s %d channels!\n", af->frame->sample_rate, av_get_sample_fmt_name((AVSampleFormat)af->frame->format), af->frame->channels, is->audio_tgt.freq, av_get_sample_fmt_name(is->audio_tgt.fmt), is->audio_tgt.channels); swr_free(&is->swr_ctx); return -1; } is->audio_src.channel_layout = dec_channel_layout; is->audio_src.channels = af->frame->channels; is->audio_src.freq = af->frame->sample_rate; is->audio_src.fmt = (AVSampleFormat)af->frame->format; } if (is->swr_ctx) { const uint8_t **in = (const uint8_t **)af->frame->extended_data; uint8_t **out = &is->audio_buf1; int out_count = (int64_t)wanted_nb_samples * is->audio_tgt.freq / af->frame->sample_rate + 256; int out_size = av_samples_get_buffer_size(NULL, is->audio_tgt.channels, out_count, is->audio_tgt.fmt, 0); int len2; if (out_size < 0) { av_log(NULL, AV_LOG_ERROR, "av_samples_get_buffer_size() failed\n"); return -1; } if (wanted_nb_samples != af->frame->nb_samples) { if (swr_set_compensation(is->swr_ctx, (wanted_nb_samples - af->frame->nb_samples) * is->audio_tgt.freq / af->frame->sample_rate, wanted_nb_samples * is->audio_tgt.freq / af->frame->sample_rate) < 0) { av_log(NULL, AV_LOG_ERROR, "swr_set_compensation() failed\n"); return -1; } } av_fast_malloc(&is->audio_buf1, &is->audio_buf1_size, out_size); if (!is->audio_buf1) return AVERROR(ENOMEM); len2 = swr_convert(is->swr_ctx, out, out_count, in, af->frame->nb_samples); if (len2 < 0) { av_log(NULL, AV_LOG_ERROR, "swr_convert() failed\n"); return -1; } if (len2 == out_count) { av_log(NULL, AV_LOG_WARNING, "audio buffer is probably too small\n"); if (swr_init(is->swr_ctx) < 0) swr_free(&is->swr_ctx); } is->audio_buf = is->audio_buf1; resampled_data_size = len2 * is->audio_tgt.channels * av_get_bytes_per_sample(is->audio_tgt.fmt); } else { is->audio_buf = af->frame->data[0]; resampled_data_size = data_size; } audio_clock0 = is->audio_clock; /* update the audio clock with the pts */ if (!isnan(af->pts)) is->audio_clock = af->pts + (double) af->frame->nb_samples / af->frame->sample_rate; else is->audio_clock = NAN; is->audio_clock_serial = af->serial; #ifdef DEBUG { static double last_clock; printf("audio: delay=%0.3f clock=%0.3f clock0=%0.3f\n", is->audio_clock - last_clock, is->audio_clock, audio_clock0); last_clock = is->audio_clock; } #endif return resampled_data_size; } /* prepare a new audio buffer */ static void sdl_audio_callback(void *opaque, Uint8 *stream, int len) { VideoState *is = (VideoState*)opaque; int audio_size, len1; audio_callback_time = av_gettime_relative(); while (len > 0) { if (is->audio_buf_index >= is->audio_buf_size) { audio_size = audio_decode_frame(is); if (audio_size < 0) { /* if error, just output silence */ is->audio_buf = NULL; is->audio_buf_size = SDL_AUDIO_MIN_BUFFER_SIZE / is->audio_tgt.frame_size * is->audio_tgt.frame_size; } else { if (is->show_mode != SHOW_MODE_VIDEO) update_sample_display(is, (int16_t *)is->audio_buf, audio_size); is->audio_buf_size = audio_size; } is->audio_buf_index = 0; } len1 = is->audio_buf_size - is->audio_buf_index; if (len1 > len) len1 = len; if (!is->muted && is->audio_buf && is->audio_volume == SDL_MIX_MAXVOLUME) memcpy(stream, (uint8_t *)is->audio_buf + is->audio_buf_index, len1); else { memset(stream, 0, len1); if (!is->muted && is->audio_buf) SDL_MixAudioFormat(stream, (uint8_t *)is->audio_buf + is->audio_buf_index, AUDIO_S16SYS, len1, is->audio_volume); } len -= len1; stream += len1; is->audio_buf_index += len1; } is->audio_write_buf_size = is->audio_buf_size - is->audio_buf_index; /* Let's assume the audio driver that is used by SDL has two periods. */ if (!isnan(is->audio_clock)) { set_clock_at(&is->audclk, is->audio_clock - (double)(2 * is->audio_hw_buf_size + is->audio_write_buf_size) / is->audio_tgt.bytes_per_sec, is->audio_clock_serial, audio_callback_time / 1000000.0); sync_clock_to_slave(&is->extclk, &is->audclk); } } static int audio_open(void *opaque, int64_t wanted_channel_layout, int wanted_nb_channels, int wanted_sample_rate, struct AudioParams *audio_hw_params) { SDL_AudioSpec wanted_spec, spec; const char *env; static const int next_nb_channels[] = {0, 0, 1, 6, 2, 6, 4, 6}; static const int next_sample_rates[] = {0, 44100, 48000, 96000, 192000}; int next_sample_rate_idx = FF_ARRAY_ELEMS(next_sample_rates) - 1; env = SDL_getenv("SDL_AUDIO_CHANNELS"); if (env) { wanted_nb_channels = atoi(env); wanted_channel_layout = av_get_default_channel_layout(wanted_nb_channels); } if (!wanted_channel_layout || wanted_nb_channels != av_get_channel_layout_nb_channels(wanted_channel_layout)) { wanted_channel_layout = av_get_default_channel_layout(wanted_nb_channels); wanted_channel_layout &= ~AV_CH_LAYOUT_STEREO_DOWNMIX; } wanted_nb_channels = av_get_channel_layout_nb_channels(wanted_channel_layout); wanted_spec.channels = wanted_nb_channels; wanted_spec.freq = wanted_sample_rate; if (wanted_spec.freq <= 0 || wanted_spec.channels <= 0) { av_log(NULL, AV_LOG_ERROR, "Invalid sample rate or channel count!\n"); return -1; } while (next_sample_rate_idx && next_sample_rates[next_sample_rate_idx] >= wanted_spec.freq) next_sample_rate_idx--; wanted_spec.format = AUDIO_S16SYS; wanted_spec.silence = 0; wanted_spec.samples = FFMAX(SDL_AUDIO_MIN_BUFFER_SIZE, 2 << av_log2(wanted_spec.freq / SDL_AUDIO_MAX_CALLBACKS_PER_SEC)); wanted_spec.callback = sdl_audio_callback; wanted_spec.userdata = opaque; while (!(audio_dev = SDL_OpenAudioDevice(NULL, 0, &wanted_spec, &spec, SDL_AUDIO_ALLOW_FREQUENCY_CHANGE | SDL_AUDIO_ALLOW_CHANNELS_CHANGE))) { av_log(NULL, AV_LOG_WARNING, "SDL_OpenAudio (%d channels, %d Hz): %s\n", wanted_spec.channels, wanted_spec.freq, SDL_GetError()); wanted_spec.channels = next_nb_channels[FFMIN(7, wanted_spec.channels)]; if (!wanted_spec.channels) { wanted_spec.freq = next_sample_rates[next_sample_rate_idx--]; wanted_spec.channels = wanted_nb_channels; if (!wanted_spec.freq) { av_log(NULL, AV_LOG_ERROR, "No more combinations to try, audio open failed\n"); return -1; } } wanted_channel_layout = av_get_default_channel_layout(wanted_spec.channels); } if (spec.format != AUDIO_S16SYS) { av_log(NULL, AV_LOG_ERROR, "SDL advised audio format %d is not supported!\n", spec.format); return -1; } if (spec.channels != wanted_spec.channels) { wanted_channel_layout = av_get_default_channel_layout(spec.channels); if (!wanted_channel_layout) { av_log(NULL, AV_LOG_ERROR, "SDL advised channel count %d is not supported!\n", spec.channels); return -1; } } audio_hw_params->fmt = AV_SAMPLE_FMT_S16; audio_hw_params->freq = spec.freq; audio_hw_params->channel_layout = wanted_channel_layout; audio_hw_params->channels = spec.channels; audio_hw_params->frame_size = av_samples_get_buffer_size(NULL, audio_hw_params->channels, 1, audio_hw_params->fmt, 1); audio_hw_params->bytes_per_sec = av_samples_get_buffer_size(NULL, audio_hw_params->channels, audio_hw_params->freq, audio_hw_params->fmt, 1); if (audio_hw_params->bytes_per_sec <= 0 || audio_hw_params->frame_size <= 0) { av_log(NULL, AV_LOG_ERROR, "av_samples_get_buffer_size failed\n"); return -1; } return spec.size; } /* open a given stream. Return 0 if OK */ static int stream_component_open(VideoState *is, int stream_index) { AVFormatContext *ic = is->ic; AVCodecContext *avctx; AVCodec *codec; const char *forced_codec_name = NULL; AVDictionary *opts = NULL; AVDictionaryEntry *t = NULL; int sample_rate, nb_channels; int64_t channel_layout; int ret = 0; int stream_lowres = lowres; if (stream_index < 0 || stream_index >= ic->nb_streams) return -1; avctx = avcodec_alloc_context3(NULL); if (!avctx) return AVERROR(ENOMEM); ret = avcodec_parameters_to_context(avctx, ic->streams[stream_index]->codecpar); if (ret < 0) goto fail; avctx->pkt_timebase = ic->streams[stream_index]->time_base; codec = avcodec_find_decoder(avctx->codec_id); switch(avctx->codec_type){ case AVMEDIA_TYPE_AUDIO : is->last_audio_stream = stream_index; forced_codec_name = audio_codec_name; break; case AVMEDIA_TYPE_SUBTITLE: is->last_subtitle_stream = stream_index; forced_codec_name = subtitle_codec_name; break; case AVMEDIA_TYPE_VIDEO : is->last_video_stream = stream_index; forced_codec_name = video_codec_name; break; } if (forced_codec_name) codec = avcodec_find_decoder_by_name(forced_codec_name); if (!codec) { if (forced_codec_name) av_log(NULL, AV_LOG_WARNING, "No codec could be found with name '%s'\n", forced_codec_name); else av_log(NULL, AV_LOG_WARNING, "No decoder could be found for codec %s\n", avcodec_get_name(avctx->codec_id)); ret = AVERROR(EINVAL); goto fail; } avctx->codec_id = codec->id; if (stream_lowres > codec->max_lowres) { av_log(avctx, AV_LOG_WARNING, "The maximum value for lowres supported by the decoder is %d\n", codec->max_lowres); stream_lowres = codec->max_lowres; } avctx->lowres = stream_lowres; if (fast) avctx->flags2 |= AV_CODEC_FLAG2_FAST; opts = filter_codec_opts(codec_opts, avctx->codec_id, ic, ic->streams[stream_index], codec); if (!av_dict_get(opts, "threads", NULL, 0)) av_dict_set(&opts, "threads", "auto", 0); if (stream_lowres) av_dict_set_int(&opts, "lowres", stream_lowres, 0); if (avctx->codec_type == AVMEDIA_TYPE_VIDEO || avctx->codec_type == AVMEDIA_TYPE_AUDIO) av_dict_set(&opts, "refcounted_frames", "1", 0); if ((ret = avcodec_open2(avctx, codec, &opts)) < 0) { goto fail; } if ((t = av_dict_get(opts, "", NULL, AV_DICT_IGNORE_SUFFIX))) { av_log(NULL, AV_LOG_ERROR, "Option %s not found.\n", t->key); ret = AVERROR_OPTION_NOT_FOUND; goto fail; } is->eof = 0; ic->streams[stream_index]->discard = AVDISCARD_DEFAULT; switch (avctx->codec_type) { case AVMEDIA_TYPE_AUDIO: #if CONFIG_AVFILTER { AVFilterContext *sink; is->audio_filter_src.freq = avctx->sample_rate; is->audio_filter_src.channels = avctx->channels; is->audio_filter_src.channel_layout = get_valid_channel_layout(avctx->channel_layout, avctx->channels); is->audio_filter_src.fmt = avctx->sample_fmt; if ((ret = configure_audio_filters(is, afilters, 0)) < 0) goto fail; sink = is->out_audio_filter; sample_rate = av_buffersink_get_sample_rate(sink); nb_channels = av_buffersink_get_channels(sink); channel_layout = av_buffersink_get_channel_layout(sink); } #else sample_rate = avctx->sample_rate; nb_channels = avctx->channels; channel_layout = avctx->channel_layout; #endif /* prepare audio output */ if ((ret = audio_open(is, channel_layout, nb_channels, sample_rate, &is->audio_tgt)) < 0) goto fail; is->audio_hw_buf_size = ret; is->audio_src = is->audio_tgt; is->audio_buf_size = 0; is->audio_buf_index = 0; /* init averaging filter */ is->audio_diff_avg_coef = exp(log(0.01) / AUDIO_DIFF_AVG_NB); is->audio_diff_avg_count = 0; /* since we do not have a precise anough audio FIFO fullness, we correct audio sync only if larger than this threshold */ is->audio_diff_threshold = (double)(is->audio_hw_buf_size) / is->audio_tgt.bytes_per_sec; is->audio_stream = stream_index; is->audio_st = ic->streams[stream_index]; decoder_init(&is->auddec, avctx, &is->audioq, is->continue_read_thread); if ((is->ic->iformat->flags & (AVFMT_NOBINSEARCH | AVFMT_NOGENSEARCH | AVFMT_NO_BYTE_SEEK)) && !is->ic->iformat->read_seek) { is->auddec.start_pts = is->audio_st->start_time; is->auddec.start_pts_tb = is->audio_st->time_base; } if ((ret = decoder_start(&is->auddec, audio_thread, is)) < 0) goto out; SDL_PauseAudioDevice(audio_dev, 0); break; case AVMEDIA_TYPE_VIDEO: is->video_stream = stream_index; is->video_st = ic->streams[stream_index]; decoder_init(&is->viddec, avctx, &is->videoq, is->continue_read_thread); if ((ret = decoder_start(&is->viddec, video_thread, is)) < 0) goto out; is->queue_attachments_req = 1; break; case AVMEDIA_TYPE_SUBTITLE: is->subtitle_stream = stream_index; is->subtitle_st = ic->streams[stream_index]; decoder_init(&is->subdec, avctx, &is->subtitleq, is->continue_read_thread); if ((ret = decoder_start(&is->subdec, subtitle_thread, is)) < 0) goto out; break; default: break; } goto out; fail: avcodec_free_context(&avctx); out: av_dict_free(&opts); return ret; } static int decode_interrupt_cb(void *ctx) { VideoState *is = (VideoState*)ctx; return is->abort_request; } static int stream_has_enough_packets(AVStream *st, int stream_id, PacketQueue *queue) { return stream_id < 0 || queue->abort_request || (st->disposition & AV_DISPOSITION_ATTACHED_PIC) || queue->nb_packets > MIN_FRAMES && (!queue->duration || av_q2d(st->time_base) * queue->duration > 1.0); } static int is_realtime(AVFormatContext *s) { if( !strcmp(s->iformat->name, "rtp") || !strcmp(s->iformat->name, "rtsp") || !strcmp(s->iformat->name, "sdp") ) return 1; if(s->pb && ( !strncmp(s->url, "rtp:", 4) || !strncmp(s->url, "udp:", 4) ) ) return 1; return 0; } /* this thread gets the stream from the disk or the network */ static int read_thread(void *arg) { VideoState *is = (VideoState*)arg; AVFormatContext *ic = NULL; int err, i, ret; int st_index[AVMEDIA_TYPE_NB]; AVPacket pkt1, *pkt = &pkt1; int64_t stream_start_time; int pkt_in_play_range = 0; AVDictionaryEntry *t; SDL_mutex *wait_mutex = SDL_CreateMutex(); int scan_all_pmts_set = 0; int64_t pkt_ts; if (!wait_mutex) { av_log(NULL, AV_LOG_FATAL, "SDL_CreateMutex(): %s\n", SDL_GetError()); ret = AVERROR(ENOMEM); goto fail; } memset(st_index, -1, sizeof(st_index)); is->last_video_stream = is->video_stream = -1; is->last_audio_stream = is->audio_stream = -1; is->last_subtitle_stream = is->subtitle_stream = -1; is->eof = 0; ic = avformat_alloc_context(); if (!ic) { av_log(NULL, AV_LOG_FATAL, "Could not allocate context.\n"); ret = AVERROR(ENOMEM); goto fail; } ic->interrupt_callback.callback = decode_interrupt_cb; ic->interrupt_callback.opaque = is; if (!av_dict_get(format_opts, "scan_all_pmts", NULL, AV_DICT_MATCH_CASE)) { av_dict_set(&format_opts, "scan_all_pmts", "1", AV_DICT_DONT_OVERWRITE); scan_all_pmts_set = 1; } err = avformat_open_input(&ic, is->filename, is->iformat, &format_opts); if (err < 0) { print_error(is->filename, err); ret = -1; goto fail; } if (scan_all_pmts_set) av_dict_set(&format_opts, "scan_all_pmts", NULL, AV_DICT_MATCH_CASE); if ((t = av_dict_get(format_opts, "", NULL, AV_DICT_IGNORE_SUFFIX))) { av_log(NULL, AV_LOG_ERROR, "Option %s not found.\n", t->key); ret = AVERROR_OPTION_NOT_FOUND; goto fail; } is->ic = ic; if (genpts) ic->flags |= AVFMT_FLAG_GENPTS; av_format_inject_global_side_data(ic); if (find_stream_info) { AVDictionary **opts = setup_find_stream_info_opts(ic, codec_opts); int orig_nb_streams = ic->nb_streams; err = avformat_find_stream_info(ic, opts); for (i = 0; i < orig_nb_streams; i++) av_dict_free(&opts[i]); av_freep(&opts); if (err < 0) { av_log(NULL, AV_LOG_WARNING, "%s: could not find codec parameters\n", is->filename); ret = -1; goto fail; } } if (ic->pb) ic->pb->eof_reached = 0; // FIXME hack, ffplay maybe should not use avio_feof() to test for the end if (seek_by_bytes < 0) seek_by_bytes = !!(ic->iformat->flags & AVFMT_TS_DISCONT) && strcmp("ogg", ic->iformat->name); is->max_frame_duration = (ic->iformat->flags & AVFMT_TS_DISCONT) ? 10.0 : 3600.0; if (!window_title && (t = av_dict_get(ic->metadata, "title", NULL, 0))) window_title = av_asprintf("%s - %s", t->value, input_filename); /* if seeking requested, we execute it */ if (start_time != AV_NOPTS_VALUE) { int64_t timestamp; timestamp = start_time; /* add the stream start time */ if (ic->start_time != AV_NOPTS_VALUE) timestamp += ic->start_time; ret = avformat_seek_file(ic, -1, INT64_MIN, timestamp, INT64_MAX, 0); if (ret < 0) { av_log(NULL, AV_LOG_WARNING, "%s: could not seek to position %0.3f\n", is->filename, (double)timestamp / AV_TIME_BASE); } } is->realtime = is_realtime(ic); if (show_status) av_dump_format(ic, 0, is->filename, 0); for (i = 0; i < ic->nb_streams; i++) { AVStream *st = ic->streams[i]; enum AVMediaType type = st->codecpar->codec_type; st->discard = AVDISCARD_ALL; if (type >= 0 && wanted_stream_spec[type] && st_index[type] == -1) if (avformat_match_stream_specifier(ic, st, wanted_stream_spec[type]) > 0) st_index[type] = i; } for (i = 0; i < AVMEDIA_TYPE_NB; i++) { if (wanted_stream_spec[i] && st_index[i] == -1) { // av_log(NULL, AV_LOG_ERROR, "Stream specifier %s does not match any %s stream\n", (AVMediaType)(wanted_stream_spec[i]), av_get_media_type_string(i)); st_index[i] = INT_MAX; } } if (!video_disable) st_index[AVMEDIA_TYPE_VIDEO] = av_find_best_stream(ic, AVMEDIA_TYPE_VIDEO, st_index[AVMEDIA_TYPE_VIDEO], -1, NULL, 0); if (!audio_disable) st_index[AVMEDIA_TYPE_AUDIO] = av_find_best_stream(ic, AVMEDIA_TYPE_AUDIO, st_index[AVMEDIA_TYPE_AUDIO], st_index[AVMEDIA_TYPE_VIDEO], NULL, 0); if (!video_disable && !subtitle_disable) st_index[AVMEDIA_TYPE_SUBTITLE] = av_find_best_stream(ic, AVMEDIA_TYPE_SUBTITLE, st_index[AVMEDIA_TYPE_SUBTITLE], (st_index[AVMEDIA_TYPE_AUDIO] >= 0 ? st_index[AVMEDIA_TYPE_AUDIO] : st_index[AVMEDIA_TYPE_VIDEO]), NULL, 0); is->show_mode = show_mode; if (st_index[AVMEDIA_TYPE_VIDEO] >= 0) { AVStream *st = ic->streams[st_index[AVMEDIA_TYPE_VIDEO]]; AVCodecParameters *codecpar = st->codecpar; AVRational sar = av_guess_sample_aspect_ratio(ic, st, NULL); if (codecpar->width) set_default_window_size(codecpar->width, codecpar->height, sar); } qDebug("stream index: video %d, audio %d, subtitle %d", st_index[AVMEDIA_TYPE_VIDEO], st_index[AVMEDIA_TYPE_AUDIO], st_index[AVMEDIA_TYPE_SUBTITLE]); /* open the streams */ if (st_index[AVMEDIA_TYPE_AUDIO] >= 0) { stream_component_open(is, st_index[AVMEDIA_TYPE_AUDIO]); //ic->streams[is->audio_stream]->time_base.den *= 2; int64_t audio_dur = ic->streams[is->audio_stream]->duration; double audio_q2d = av_q2d(ic->streams[is->audio_stream]->time_base); double audio_dura = audio_dur*audio_q2d; qDebug("info:----------------------------"); qDebug("audio_stream avrational num/den = %d/%d", ic->streams[is->audio_stream]->time_base.num, ic->streams[is->audio_stream]->time_base.den); qDebug("duration int64 %lld", audio_dur); qDebug("av q2d is %f", audio_q2d); qDebug("duration %f", audio_dura); } ret = -1; if (st_index[AVMEDIA_TYPE_VIDEO] >= 0) { ret = stream_component_open(is, st_index[AVMEDIA_TYPE_VIDEO]); //ic->streams[is->video_stream]->time_base.den *= 4; int64_t dur = ic->streams[is->video_stream]->duration; double q2d = av_q2d(ic->streams[is->video_stream]->time_base); double dura = dur*q2d; qDebug("info:----------------------------"); qDebug("video_stream avrational num/den = %d/%d", ic->streams[is->video_stream]->time_base.num, ic->streams[is->video_stream]->time_base.den); qDebug("duration int64 %lld", dur); qDebug("av q2d is %f", q2d); qDebug("duration %f", dura); qDebug("info:----------------------------"); pdemux->setDuration(dura); } if (is->show_mode == SHOW_MODE_NONE) is->show_mode = ret >= 0 ? SHOW_MODE_VIDEO : SHOW_MODE_RDFT; if (st_index[AVMEDIA_TYPE_SUBTITLE] >= 0) { stream_component_open(is, st_index[AVMEDIA_TYPE_SUBTITLE]); } if (is->video_stream < 0 && is->audio_stream < 0) { av_log(NULL, AV_LOG_FATAL, "Failed to open file '%s' or configure filtergraph\n", is->filename); ret = -1; goto fail; } if (infinite_buffer < 0 && is->realtime) infinite_buffer = 1; for (;;) { if (is->abort_request) break; if (is->paused != is->last_paused) { is->last_paused = is->paused; if (is->paused) is->read_pause_return = av_read_pause(ic); else av_read_play(ic); } #if CONFIG_RTSP_DEMUXER || CONFIG_MMSH_PROTOCOL if (is->paused && (!strcmp(ic->iformat->name, "rtsp") || (ic->pb && !strncmp(input_filename, "mmsh:", 5)))) { /* wait 10 ms to avoid trying to get another packet */ /* XXX: horrible */ SDL_Delay(10); continue; } #endif if (is->seek_req) { int64_t seek_target = is->seek_pos; int64_t seek_min = is->seek_rel > 0 ? seek_target - is->seek_rel + 2: INT64_MIN; int64_t seek_max = is->seek_rel < 0 ? seek_target - is->seek_rel - 2: INT64_MAX; // FIXME the +-2 is due to rounding being not done in the correct direction in generation // of the seek_pos/seek_rel variables ret = avformat_seek_file(is->ic, -1, seek_min, seek_target, seek_max, is->seek_flags); if (ret < 0) { av_log(NULL, AV_LOG_ERROR, "%s: error while seeking\n", is->ic->url); } else { if (is->audio_stream >= 0) { packet_queue_flush(&is->audioq); packet_queue_put(&is->audioq, &flush_pkt); } if (is->subtitle_stream >= 0) { packet_queue_flush(&is->subtitleq); packet_queue_put(&is->subtitleq, &flush_pkt); } if (is->video_stream >= 0) { packet_queue_flush(&is->videoq); packet_queue_put(&is->videoq, &flush_pkt); } if (is->seek_flags & AVSEEK_FLAG_BYTE) { set_clock(&is->extclk, NAN, 0); } else { set_clock(&is->extclk, seek_target / (double)AV_TIME_BASE, 0); } } is->seek_req = 0; is->queue_attachments_req = 1; is->eof = 0; if (is->paused) step_to_next_frame(is); } if (is->queue_attachments_req) { if (is->video_st && is->video_st->disposition & AV_DISPOSITION_ATTACHED_PIC) { AVPacket copy = { 0 }; if ((ret = av_packet_ref(&copy, &is->video_st->attached_pic)) < 0) goto fail; packet_queue_put(&is->videoq, &copy); packet_queue_put_nullpacket(&is->videoq, is->video_stream); } is->queue_attachments_req = 0; } /* if the queue are full, no need to read more */ if (infinite_buffer<1 && (is->audioq.size + is->videoq.size + is->subtitleq.size > MAX_QUEUE_SIZE || (stream_has_enough_packets(is->audio_st, is->audio_stream, &is->audioq) && stream_has_enough_packets(is->video_st, is->video_stream, &is->videoq) && stream_has_enough_packets(is->subtitle_st, is->subtitle_stream, &is->subtitleq)))) { /* wait 10 ms */ SDL_LockMutex(wait_mutex); SDL_CondWaitTimeout(is->continue_read_thread, wait_mutex, 10); SDL_UnlockMutex(wait_mutex); continue; } if (!is->paused && (!is->audio_st || (is->auddec.finished == is->audioq.serial && frame_queue_nb_remaining(&is->sampq) == 0)) && (!is->video_st || (is->viddec.finished == is->videoq.serial && frame_queue_nb_remaining(&is->pictq) == 0))) { if (loop != 1 && (!loop || --loop)) { stream_seek(is, start_time != AV_NOPTS_VALUE ? start_time : 0, 0, 0); } else if (autoexit) { ret = AVERROR_EOF; goto fail; } } ret = av_read_frame(ic, pkt); if (ret < 0) { if ((ret == AVERROR_EOF || avio_feof(ic->pb)) && !is->eof) { if (is->video_stream >= 0) packet_queue_put_nullpacket(&is->videoq, is->video_stream); if (is->audio_stream >= 0) packet_queue_put_nullpacket(&is->audioq, is->audio_stream); if (is->subtitle_stream >= 0) packet_queue_put_nullpacket(&is->subtitleq, is->subtitle_stream); is->eof = 1; } if (ic->pb && ic->pb->error) break; SDL_LockMutex(wait_mutex); SDL_CondWaitTimeout(is->continue_read_thread, wait_mutex, 10); SDL_UnlockMutex(wait_mutex); continue; } else { is->eof = 0; } /* check if packet is in play range specified by user, then queue, otherwise discard */ stream_start_time = ic->streams[pkt->stream_index]->start_time; pkt_ts = pkt->pts == AV_NOPTS_VALUE ? pkt->dts : pkt->pts; pkt_in_play_range = duration == AV_NOPTS_VALUE || (pkt_ts - (stream_start_time != AV_NOPTS_VALUE ? stream_start_time : 0)) * av_q2d(ic->streams[pkt->stream_index]->time_base) - (double)(start_time != AV_NOPTS_VALUE ? start_time : 0) / 1000000 <= ((double)duration / 1000000); if (pkt->stream_index == is->audio_stream && pkt_in_play_range) { packet_queue_put(&is->audioq, pkt); } else if (pkt->stream_index == is->video_stream && pkt_in_play_range && !(is->video_st->disposition & AV_DISPOSITION_ATTACHED_PIC)) { packet_queue_put(&is->videoq, pkt); } else if (pkt->stream_index == is->subtitle_stream && pkt_in_play_range) { packet_queue_put(&is->subtitleq, pkt); } else { av_packet_unref(pkt); } } ret = 0; fail: if (ic && !is->ic) avformat_close_input(&ic); if (ret != 0) { SDL_Event event; event.type = FF_QUIT_EVENT; event.user.data1 = is; SDL_PushEvent(&event); } SDL_DestroyMutex(wait_mutex); return 0; } static VideoState *stream_open(const char *filename, AVInputFormat *iformat) { VideoState *is; is = (VideoState*)av_mallocz(sizeof(VideoState)); if (!is) return NULL; is->filename = av_strdup(filename); if (!is->filename) goto fail; is->iformat = iformat; is->ytop = 0; is->xleft = 0; /* start video display */ if (frame_queue_init(&is->pictq, &is->videoq, VIDEO_PICTURE_QUEUE_SIZE, 1) < 0) goto fail; if (frame_queue_init(&is->subpq, &is->subtitleq, SUBPICTURE_QUEUE_SIZE, 0) < 0) goto fail; if (frame_queue_init(&is->sampq, &is->audioq, SAMPLE_QUEUE_SIZE, 1) < 0) goto fail; if (packet_queue_init(&is->videoq) < 0 || packet_queue_init(&is->audioq) < 0 || packet_queue_init(&is->subtitleq) < 0) goto fail; if (!(is->continue_read_thread = SDL_CreateCond())) { av_log(NULL, AV_LOG_FATAL, "SDL_CreateCond(): %s\n", SDL_GetError()); goto fail; } init_clock(&is->vidclk, &is->videoq.serial); init_clock(&is->audclk, &is->audioq.serial); init_clock(&is->extclk, &is->extclk.serial); is->audio_clock_serial = -1; if (startup_volume < 0) av_log(NULL, AV_LOG_WARNING, "-volume=%d < 0, setting to 0\n", startup_volume); if (startup_volume > 100) av_log(NULL, AV_LOG_WARNING, "-volume=%d > 100, setting to 100\n", startup_volume); startup_volume = av_clip(startup_volume, 0, 100); startup_volume = av_clip(SDL_MIX_MAXVOLUME * startup_volume / 100, 0, SDL_MIX_MAXVOLUME); is->audio_volume = startup_volume; is->muted = 0; is->av_sync_type = av_sync_type; is->read_tid = SDL_CreateThread(read_thread, "read_thread", is); if (!is->read_tid) { av_log(NULL, AV_LOG_FATAL, "SDL_CreateThread(): %s\n", SDL_GetError()); fail: stream_close(is); return NULL; } return is; } static void stream_cycle_channel(VideoState *is, int codec_type) { AVFormatContext *ic = is->ic; int start_index, stream_index; int old_index; AVStream *st; AVProgram *p = NULL; int nb_streams = is->ic->nb_streams; if (codec_type == AVMEDIA_TYPE_VIDEO) { start_index = is->last_video_stream; old_index = is->video_stream; } else if (codec_type == AVMEDIA_TYPE_AUDIO) { start_index = is->last_audio_stream; old_index = is->audio_stream; } else { start_index = is->last_subtitle_stream; old_index = is->subtitle_stream; } stream_index = start_index; if (codec_type != AVMEDIA_TYPE_VIDEO && is->video_stream != -1) { p = av_find_program_from_stream(ic, NULL, is->video_stream); if (p) { nb_streams = p->nb_stream_indexes; for (start_index = 0; start_index < nb_streams; start_index++) if (p->stream_index[start_index] == stream_index) break; if (start_index == nb_streams) start_index = -1; stream_index = start_index; } } for (;;) { if (++stream_index >= nb_streams) { if (codec_type == AVMEDIA_TYPE_SUBTITLE) { stream_index = -1; is->last_subtitle_stream = -1; goto the_end; } if (start_index == -1) return; stream_index = 0; } if (stream_index == start_index) return; st = is->ic->streams[p ? p->stream_index[stream_index] : stream_index]; if (st->codecpar->codec_type == codec_type) { /* check that parameters are OK */ switch (codec_type) { case AVMEDIA_TYPE_AUDIO: if (st->codecpar->sample_rate != 0 && st->codecpar->channels != 0) goto the_end; break; case AVMEDIA_TYPE_VIDEO: case AVMEDIA_TYPE_SUBTITLE: goto the_end; default: break; } } } the_end: if (p && stream_index != -1) stream_index = p->stream_index[stream_index]; av_log(NULL, AV_LOG_INFO, "Switch %s stream from #%d to #%d\n", av_get_media_type_string((AVMediaType)codec_type), old_index, stream_index); stream_component_close(is, old_index); stream_component_open(is, stream_index); } static void toggle_full_screen(VideoState *is) { is_full_screen = !is_full_screen; SDL_SetWindowFullscreen(window, is_full_screen ? SDL_WINDOW_FULLSCREEN_DESKTOP : 0); } static void toggle_audio_display(VideoState *is) { int next = is->show_mode; do { next = (next + 1) % SHOW_MODE_NB; } while (next != is->show_mode && (next == SHOW_MODE_VIDEO && !is->video_st || next != SHOW_MODE_VIDEO && !is->audio_st)); if (is->show_mode != next) { is->force_refresh = 1; is->show_mode = (ShowMode)next; } } static void refresh_loop_wait_event(VideoState *is, SDL_Event *event) { double remaining_time = 0.0; SDL_PumpEvents(); while (!SDL_PeepEvents(event, 1, SDL_GETEVENT, SDL_FIRSTEVENT, SDL_LASTEVENT)) { if (!cursor_hidden && av_gettime_relative() - cursor_last_shown > CURSOR_HIDE_DELAY) { SDL_ShowCursor(0); cursor_hidden = 1; } if (remaining_time > 0.0) av_usleep((int64_t)(remaining_time * 1000000.0)); remaining_time = REFRESH_RATE; if (is->show_mode != SHOW_MODE_NONE && (!is->paused || is->force_refresh)) video_refresh(is, &remaining_time); SDL_PumpEvents(); } } static void seek_chapter(VideoState *is, int incr) { int64_t pos = get_master_clock(is) * AV_TIME_BASE; int i; if (!is->ic->nb_chapters) return; /* find the current chapter */ for (i = 0; i < is->ic->nb_chapters; i++) { AVChapter *ch = is->ic->chapters[i]; if (av_compare_ts(pos, AV_TIME_BASE_Q, ch->start, ch->time_base) < 0) { i--; break; } } i += incr; i = FFMAX(i, 0); if (i >= is->ic->nb_chapters) return; av_log(NULL, AV_LOG_VERBOSE, "Seeking to chapter %d.\n", i); stream_seek(is, av_rescale_q(is->ic->chapters[i]->start, is->ic->chapters[i]->time_base, AV_TIME_BASE_Q), 0, 0); } /* handle an event sent by the GUI */ static void event_loop(VideoState *cur_stream) { SDL_Event event; double incr, pos, frac; for (;;) { double x; refresh_loop_wait_event(cur_stream, &event); switch (event.type) { case SDL_KEYDOWN: if (exit_on_keydown || event.key.keysym.sym == SDLK_ESCAPE || event.key.keysym.sym == SDLK_q) { do_exit(cur_stream); break; } // If we don't yet have a window, skip all key events, because read_thread might still be initializing... // if (!cur_stream->width) // continue; switch (event.key.keysym.sym) { case SDLK_f: toggle_full_screen(cur_stream); cur_stream->force_refresh = 1; break; case SDLK_p: case SDLK_SPACE: toggle_pause(cur_stream); break; case SDLK_m: toggle_mute(cur_stream); break; case SDLK_KP_MULTIPLY: case SDLK_0: update_volume(cur_stream, 1, SDL_VOLUME_STEP); break; case SDLK_KP_DIVIDE: case SDLK_9: update_volume(cur_stream, -1, SDL_VOLUME_STEP); break; case SDLK_s: // S: Step to next frame step_to_next_frame(cur_stream); break; case SDLK_a: stream_cycle_channel(cur_stream, AVMEDIA_TYPE_AUDIO); break; case SDLK_v: stream_cycle_channel(cur_stream, AVMEDIA_TYPE_VIDEO); break; case SDLK_c: stream_cycle_channel(cur_stream, AVMEDIA_TYPE_VIDEO); stream_cycle_channel(cur_stream, AVMEDIA_TYPE_AUDIO); stream_cycle_channel(cur_stream, AVMEDIA_TYPE_SUBTITLE); break; case SDLK_t: stream_cycle_channel(cur_stream, AVMEDIA_TYPE_SUBTITLE); break; case SDLK_w: #if CONFIG_AVFILTER if (cur_stream->show_mode == SHOW_MODE_VIDEO && cur_stream->vfilter_idx < nb_vfilters - 1) { if (++cur_stream->vfilter_idx >= nb_vfilters) cur_stream->vfilter_idx = 0; } else { cur_stream->vfilter_idx = 0; toggle_audio_display(cur_stream); } #else toggle_audio_display(cur_stream); #endif break; case SDLK_PAGEUP: if (cur_stream->ic->nb_chapters <= 1) { incr = 600.0; goto do_seek; } seek_chapter(cur_stream, 1); break; case SDLK_PAGEDOWN: if (cur_stream->ic->nb_chapters <= 1) { incr = -600.0; goto do_seek; } seek_chapter(cur_stream, -1); break; case SDLK_LEFT: incr = seek_interval ? -seek_interval : -10.0; goto do_seek; case SDLK_RIGHT: incr = seek_interval ? seek_interval : 10.0; goto do_seek; case SDLK_UP: incr = 60.0; goto do_seek; case SDLK_DOWN: incr = -60.0; case SDLK_g: incr = (int)event.user.data1; do_seek: if (seek_by_bytes) { pos = -1; if (pos < 0 && cur_stream->video_stream >= 0) pos = frame_queue_last_pos(&cur_stream->pictq); if (pos < 0 && cur_stream->audio_stream >= 0) pos = frame_queue_last_pos(&cur_stream->sampq); if (pos < 0) pos = avio_tell(cur_stream->ic->pb); if (cur_stream->ic->bit_rate) incr *= cur_stream->ic->bit_rate / 8.0; else incr *= 180000.0; pos += incr; stream_seek(cur_stream, pos, incr, 1); } else { pos = get_master_clock(cur_stream); if (isnan(pos)) pos = (double)cur_stream->seek_pos / AV_TIME_BASE; pos += incr; if (cur_stream->ic->start_time != AV_NOPTS_VALUE && pos < cur_stream->ic->start_time / (double)AV_TIME_BASE) pos = cur_stream->ic->start_time / (double)AV_TIME_BASE; stream_seek(cur_stream, (int64_t)(pos * AV_TIME_BASE), (int64_t)(incr * AV_TIME_BASE), 0); } break; default: break; } break; case SDL_MOUSEBUTTONDOWN: if (exit_on_mousedown) { do_exit(cur_stream); break; } if (event.button.button == SDL_BUTTON_LEFT) { static int64_t last_mouse_left_click = 0; if (av_gettime_relative() - last_mouse_left_click <= 500000) { toggle_full_screen(cur_stream); cur_stream->force_refresh = 1; last_mouse_left_click = 0; } else { last_mouse_left_click = av_gettime_relative(); } } case SDL_MOUSEMOTION: if (cursor_hidden) { SDL_ShowCursor(1); cursor_hidden = 0; } cursor_last_shown = av_gettime_relative(); if (event.type == SDL_MOUSEBUTTONDOWN) { if (event.button.button != SDL_BUTTON_RIGHT) break; x = event.button.x; } else { if (!(event.motion.state & SDL_BUTTON_RMASK)) break; x = event.motion.x; } if (seek_by_bytes || cur_stream->ic->duration <= 0) { uint64_t size = avio_size(cur_stream->ic->pb); stream_seek(cur_stream, size*x/cur_stream->width, 0, 1); } else { int64_t ts; int ns, hh, mm, ss; int tns, thh, tmm, tss; tns = cur_stream->ic->duration / 1000000LL; thh = tns / 3600; tmm = (tns % 3600) / 60; tss = (tns % 60); frac = x / cur_stream->width; ns = frac * tns; hh = ns / 3600; mm = (ns % 3600) / 60; ss = (ns % 60); av_log(NULL, AV_LOG_INFO, "Seek to %2.0f%% (%2d:%02d:%02d) of total duration (%2d:%02d:%02d) \n", frac*100, hh, mm, ss, thh, tmm, tss); ts = frac * cur_stream->ic->duration; if (cur_stream->ic->start_time != AV_NOPTS_VALUE) ts += cur_stream->ic->start_time; stream_seek(cur_stream, ts, 0, 0); } break; case SDL_WINDOWEVENT: switch (event.window.event) { case SDL_WINDOWEVENT_RESIZED: screen_width = cur_stream->width = event.window.data1; screen_height = cur_stream->height = event.window.data2; if (cur_stream->vis_texture) { SDL_DestroyTexture(cur_stream->vis_texture); cur_stream->vis_texture = NULL; } case SDL_WINDOWEVENT_EXPOSED: cur_stream->force_refresh = 1; } break; case SDL_QUIT: case FF_QUIT_EVENT: do_exit(cur_stream); break; default: break; } } } static int opt_frame_size(void *optctx, const char *opt, const char *arg) { av_log(NULL, AV_LOG_WARNING, "Option -s is deprecated, use -video_size.\n"); return opt_default(NULL, "video_size", arg); } static int opt_width(void *optctx, const char *opt, const char *arg) { screen_width = parse_number_or_die(opt, arg, OPT_INT64, 1, INT_MAX); return 0; } static int opt_height(void *optctx, const char *opt, const char *arg) { screen_height = parse_number_or_die(opt, arg, OPT_INT64, 1, INT_MAX); return 0; } static int opt_format(void *optctx, const char *opt, const char *arg) { file_iformat = av_find_input_format(arg); if (!file_iformat) { av_log(NULL, AV_LOG_FATAL, "Unknown input format: %s\n", arg); return AVERROR(EINVAL); } return 0; } static int opt_frame_pix_fmt(void *optctx, const char *opt, const char *arg) { av_log(NULL, AV_LOG_WARNING, "Option -pix_fmt is deprecated, use -pixel_format.\n"); return opt_default(NULL, "pixel_format", arg); } static int opt_sync(void *optctx, const char *opt, const char *arg) { if (!strcmp(arg, "audio")) av_sync_type = AV_SYNC_AUDIO_MASTER; else if (!strcmp(arg, "video")) av_sync_type = AV_SYNC_VIDEO_MASTER; else if (!strcmp(arg, "ext")) av_sync_type = AV_SYNC_EXTERNAL_CLOCK; else { av_log(NULL, AV_LOG_ERROR, "Unknown value for %s: %s\n", opt, arg); exit(1); } return 0; } static int opt_seek(void *optctx, const char *opt, const char *arg) { start_time = parse_time_or_die(opt, arg, 1); return 0; } static int opt_duration(void *optctx, const char *opt, const char *arg) { duration = parse_time_or_die(opt, arg, 1); return 0; } static int opt_show_mode(void *optctx, const char *opt, const char *arg) { // show_mode = !strcmp(arg, "video") ? SHOW_MODE_VIDEO : // !strcmp(arg, "waves") ? SHOW_MODE_WAVES : // !strcmp(arg, "rdft" ) ? SHOW_MODE_RDFT : // parse_number_or_die(opt, arg, OPT_INT, 0, SHOW_MODE_NB-1); return 0; } static void opt_input_file(void *optctx, const char *filename) { if (input_filename) { av_log(NULL, AV_LOG_FATAL, "Argument '%s' provided as input filename, but '%s' was already specified.\n", filename, input_filename); exit(1); } if (!strcmp(filename, "-")) filename = "pipe:"; input_filename = filename; } static int opt_codec(void *optctx, const char *opt, const char *arg) { const char *spec = strchr(opt, ':'); if (!spec) { av_log(NULL, AV_LOG_ERROR, "No media specifier was specified in '%s' in option '%s'\n", arg, opt); return AVERROR(EINVAL); } spec++; switch (spec[0]) { case 'a' : audio_codec_name = arg; break; case 's' : subtitle_codec_name = arg; break; case 'v' : video_codec_name = arg; break; default: av_log(NULL, AV_LOG_ERROR, "Invalid media specifier '%s' in option '%s'\n", spec, opt); return AVERROR(EINVAL); } return 0; } static int dummy; static const OptionDef options[] = { CMDUTILS_COMMON_OPTIONS { "x", HAS_ARG, { .func_arg = opt_width }, "force displayed width", "width" }, { "y", HAS_ARG, { .func_arg = opt_height }, "force displayed height", "height" }, { "s", HAS_ARG | OPT_VIDEO, { .func_arg = opt_frame_size }, "set frame size (WxH or abbreviation)", "size" }, { "fs", OPT_BOOL, { &is_full_screen }, "force full screen" }, { "an", OPT_BOOL, { &audio_disable }, "disable audio" }, { "vn", OPT_BOOL, { &video_disable }, "disable video" }, { "sn", OPT_BOOL, { &subtitle_disable }, "disable subtitling" }, { "ast", OPT_STRING | HAS_ARG | OPT_EXPERT, { &wanted_stream_spec[AVMEDIA_TYPE_AUDIO] }, "select desired audio stream", "stream_specifier" }, { "vst", OPT_STRING | HAS_ARG | OPT_EXPERT, { &wanted_stream_spec[AVMEDIA_TYPE_VIDEO] }, "select desired video stream", "stream_specifier" }, { "sst", OPT_STRING | HAS_ARG | OPT_EXPERT, { &wanted_stream_spec[AVMEDIA_TYPE_SUBTITLE] }, "select desired subtitle stream", "stream_specifier" }, { "ss", HAS_ARG, { .func_arg = opt_seek }, "seek to a given position in seconds", "pos" }, { "t", HAS_ARG, { .func_arg = opt_duration }, "play \"duration\" seconds of audio/video", "duration" }, { "bytes", OPT_INT | HAS_ARG, { &seek_by_bytes }, "seek by bytes 0=off 1=on -1=auto", "val" }, { "seek_interval", OPT_FLOAT | HAS_ARG, { &seek_interval }, "set seek interval for left/right keys, in seconds", "seconds" }, { "nodisp", OPT_BOOL, { &display_disable }, "disable graphical display" }, { "noborder", OPT_BOOL, { &borderless }, "borderless window" }, { "volume", OPT_INT | HAS_ARG, { &startup_volume}, "set startup volume 0=min 100=max", "volume" }, { "f", HAS_ARG, { .func_arg = opt_format }, "force format", "fmt" }, { "pix_fmt", HAS_ARG | OPT_EXPERT | OPT_VIDEO, { .func_arg = opt_frame_pix_fmt }, "set pixel format", "format" }, { "stats", OPT_BOOL | OPT_EXPERT, { &show_status }, "show status", "" }, { "fast", OPT_BOOL | OPT_EXPERT, { &fast }, "non spec compliant optimizations", "" }, { "genpts", OPT_BOOL | OPT_EXPERT, { &genpts }, "generate pts", "" }, { "drp", OPT_INT | HAS_ARG | OPT_EXPERT, { &decoder_reorder_pts }, "let decoder reorder pts 0=off 1=on -1=auto", ""}, { "lowres", OPT_INT | HAS_ARG | OPT_EXPERT, { &lowres }, "", "" }, { "sync", HAS_ARG | OPT_EXPERT, { .func_arg = opt_sync }, "set audio-video sync. type (type=audio/video/ext)", "type" }, { "autoexit", OPT_BOOL | OPT_EXPERT, { &autoexit }, "exit at the end", "" }, { "exitonkeydown", OPT_BOOL | OPT_EXPERT, { &exit_on_keydown }, "exit on key down", "" }, { "exitonmousedown", OPT_BOOL | OPT_EXPERT, { &exit_on_mousedown }, "exit on mouse down", "" }, { "loop", OPT_INT | HAS_ARG | OPT_EXPERT, { &loop }, "set number of times the playback shall be looped", "loop count" }, { "framedrop", OPT_BOOL | OPT_EXPERT, { &framedrop }, "drop frames when cpu is too slow", "" }, { "infbuf", OPT_BOOL | OPT_EXPERT, { &infinite_buffer }, "don't limit the input buffer size (useful with realtime streams)", "" }, { "window_title", OPT_STRING | HAS_ARG, { &window_title }, "set window title", "window title" }, { "left", OPT_INT | HAS_ARG | OPT_EXPERT, { &screen_left }, "set the x position for the left of the window", "x pos" }, { "top", OPT_INT | HAS_ARG | OPT_EXPERT, { &screen_top }, "set the y position for the top of the window", "y pos" }, #if CONFIG_AVFILTER { "vf", OPT_EXPERT | HAS_ARG, { .func_arg = opt_add_vfilter }, "set video filters", "filter_graph" }, { "af", OPT_STRING | HAS_ARG, { &afilters }, "set audio filters", "filter_graph" }, #endif { "rdftspeed", OPT_INT | HAS_ARG| OPT_AUDIO | OPT_EXPERT, { &rdftspeed }, "rdft speed", "msecs" }, { "showmode", HAS_ARG, { .func_arg = opt_show_mode}, "select show mode (0 = video, 1 = waves, 2 = RDFT)", "mode" }, { "default", HAS_ARG | OPT_AUDIO | OPT_VIDEO | OPT_EXPERT, { .func_arg = opt_default }, "generic catch all option", "" }, { "i", OPT_BOOL, { &dummy}, "read specified file", "input_file"}, { "codec", HAS_ARG, { .func_arg = opt_codec}, "force decoder", "decoder_name" }, { "acodec", HAS_ARG | OPT_STRING | OPT_EXPERT, { &audio_codec_name }, "force audio decoder", "decoder_name" }, { "scodec", HAS_ARG | OPT_STRING | OPT_EXPERT, { &subtitle_codec_name }, "force subtitle decoder", "decoder_name" }, { "vcodec", HAS_ARG | OPT_STRING | OPT_EXPERT, { &video_codec_name }, "force video decoder", "decoder_name" }, { "autorotate", OPT_BOOL, { &autorotate }, "automatically rotate video", "" }, { "find_stream_info", OPT_BOOL | OPT_INPUT | OPT_EXPERT, { &find_stream_info }, "read and decode the streams to fill missing information with heuristics" }, { NULL, }, }; static void show_usage(void) { av_log(NULL, AV_LOG_INFO, "Simple media player\n"); av_log(NULL, AV_LOG_INFO, "usage: %s [options] input_file\n", program_name); av_log(NULL, AV_LOG_INFO, "\n"); } void show_help_default(const char *opt, const char *arg) { av_log_set_callback(log_callback_help); show_usage(); show_help_options(options, "Main options:", 0, OPT_EXPERT, 0); show_help_options(options, "Advanced options:", OPT_EXPERT, 0, 0); printf("\n"); show_help_children(avcodec_get_class(), AV_OPT_FLAG_DECODING_PARAM); show_help_children(avformat_get_class(), AV_OPT_FLAG_DECODING_PARAM); #if !CONFIG_AVFILTER show_help_children(sws_get_class(), AV_OPT_FLAG_ENCODING_PARAM); #else show_help_children(avfilter_get_class(), AV_OPT_FLAG_FILTERING_PARAM); #endif printf("\nWhile playing:\n" "q, ESC quit\n" "f toggle full screen\n" "p, SPC pause\n" "m toggle mute\n" "9, 0 decrease and increase volume respectively\n" "/, * decrease and increase volume respectively\n" "a cycle audio channel in the current program\n" "v cycle video channel\n" "t cycle subtitle channel in the current program\n" "c cycle program\n" "w cycle video filters or show modes\n" "s activate frame-step mode\n" "left/right seek backward/forward 10 seconds or to custom interval if -seek_interval is set\n" "down/up seek backward/forward 1 minute\n" "page down/page up seek backward/forward 10 minutes\n" "right mouse click seek to percentage in file corresponding to fraction of width\n" "left double-click toggle full screen\n" ); } /* Called from the main */ int demux::ffplay_main() { int argc = 2 ; char arg0[] = "ffplay" ; char arg1[] = "F:\\share\\video\\earth01.mp4" ; // char arg1[] = "rtsp://184.72.239.149/vod/mp4://BigBuckBunny_175k.mov"; char **argv = new char *[argc+1]{ arg0 , arg1 } ; int flags; init_dynload(); av_log_set_flags(AV_LOG_SKIP_REPEATED); parse_loglevel(argc, argv, options); /* register all codecs, demux and protocols */ #if CONFIG_AVDEVICE avdevice_register_all(); #endif avformat_network_init(); init_opts(); signal(SIGINT , sigterm_handler); /* Interrupt (ANSI). */ signal(SIGTERM, sigterm_handler); /* Termination (ANSI). */ show_banner(argc, argv, options); parse_options(NULL, argc, argv, options, opt_input_file); if (display_disable) { video_disable = 1; } flags = SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_TIMER; if (audio_disable) flags &= ~SDL_INIT_AUDIO; else { /* Try to work around an occasional ALSA buffer underflow issue when the * period size is NPOT due to ALSA resampling by forcing the buffer size. */ if (!SDL_getenv("SDL_AUDIO_ALSA_SET_BUFFER_SIZE")) SDL_setenv("SDL_AUDIO_ALSA_SET_BUFFER_SIZE","1", 1); } if (display_disable) flags &= ~SDL_INIT_VIDEO; if (SDL_Init (flags)) { av_log(NULL, AV_LOG_FATAL, "Could not initialize SDL - %s\n", SDL_GetError()); av_log(NULL, AV_LOG_FATAL, "(Did you set the DISPLAY variable?)\n"); exit(1); } SDL_EventState(SDL_SYSWMEVENT, SDL_IGNORE); SDL_EventState(SDL_USEREVENT, SDL_IGNORE); av_init_packet(&flush_pkt); flush_pkt.data = (uint8_t *)&flush_pkt; display_disable = 1; if (!display_disable) { int flags = SDL_WINDOW_HIDDEN; if (borderless) flags |= SDL_WINDOW_BORDERLESS; else flags |= SDL_WINDOW_RESIZABLE; window = SDL_CreateWindow(program_name, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, default_width, default_height, flags); SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "linear"); if (window) { renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC); if (!renderer) { av_log(NULL, AV_LOG_WARNING, "Failed to initialize a hardware accelerated renderer: %s\n", SDL_GetError()); renderer = SDL_CreateRenderer(window, -1, 0); } if (renderer) { if (!SDL_GetRendererInfo(renderer, &renderer_info)) av_log(NULL, AV_LOG_VERBOSE, "Initialized %s renderer.\n", renderer_info.name); } } if (!window || !renderer || !renderer_info.num_texture_formats) { av_log(NULL, AV_LOG_FATAL, "Failed to create window or renderer: %s", SDL_GetError()); do_exit(NULL); } } is = stream_open(input_filename, file_iformat); if (!is) { av_log(NULL, AV_LOG_FATAL, "Failed to initialize VideoState!\n"); do_exit(NULL); } event_loop(is); /* never returns */ return 0; } class SleeperThread : public QThread { public: static void msleep(unsigned long msecs) { QThread::msleep(msecs); } }; demux::demux(QObject *parent) { pdemux = this; player = parent; m_rate = 1; } void demux::run() { ffplay_main(); } void demux::sendImg(QImage img) { emit sigRGBFrame(img); } void demux::setDuration(int duration) { emit sigDuration(duration); } void demux::setCurrentTime(int sec) { emit sigCurrentTime(sec); } void demux::setPlaySpeedUp(float rate) { m_rate = rate; int ret = get_master_sync_type(pdemux->is); qDebug("get_master_sync_type() %d", ret); ret = get_master_clock(pdemux->is); qDebug("get_master_clock() %d", ret); set_clock_speed(&is->vidclk, rate); set_clock_speed(&is->audclk, rate); set_clock_speed(&is->extclk, rate); } void demux::setPlaySpeedDown(float rate) { int ret = get_master_sync_type(pdemux->is); qDebug("get_master_sync_type() %d", ret); ret = get_master_clock(pdemux->is); qDebug("get_master_clock() %d", ret); set_clock_speed(&is->vidclk, rate); set_clock_speed(&is->audclk, rate); set_clock_speed(&is->extclk, rate); }
[ "guliqun1983@163.com" ]
guliqun1983@163.com
e1476d4636dba80964dd437cfc31258a6ba38c97
4eb18bac662678e4cd57d9352624e341201bde92
/ActorX_3DSMAX/ActorX.cpp
144097b36e995ca3f68afe774ba720397f780ba7
[ "BSD-3-Clause", "LicenseRef-scancode-unknown-license-reference" ]
permissive
Coeptis87/ActorX-1
8bc9ca337dd0bfd13b97814b7f340252b0ea7f82
9686ebc9766197c40c53a3093c483cc6fad42355
refs/heads/master
2020-12-23T13:26:47.761607
2020-01-30T08:10:05
2020-01-30T08:10:05
237,166,854
0
0
BSD-3-Clause
2020-01-30T08:09:10
2020-01-30T08:09:09
null
UTF-8
C++
false
false
6,394
cpp
// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved. // Licensed under the BSD license. See LICENSE.txt file in the project root for full license information. /***************************************************************** ActorX.cpp Actor eXporter for Unreal. Created by Erik de Neve Exports smooth-skinned meshes and arbitrary hierarchies of regular textured meshes, and their animation in offsetvector/quaternion timed-key format. Main structures: SceneIFC OurScene => Contains necessary current scene info i.e. the scene tree, current timings, etc. VActor TempActor => Contains reference skeleton+skin, accumulated animations. Revision 1.4 November 2000 - Moved everything around to help code re-use in Maya exporter. - Put in some bone-count checks to avoid creation of broken .PSA's. - Rev 1.6 Jan 2001 - Minor fixes Rev 1.7 Feb 2001 - Minor stuff / safer dynamic arrays..(?!) - Note: still gets pointer error related to memory deletion in the dyn. arrays in debug mode (known VC++ issue) Todo: - Debug the material-index override (the sorting & wedge remapping process ) - Fix 'get scene info'. - Fix the 'frame-0 reference pose must be accessible' requirement for non-biped(?) meshes. - Verify whether it's the somewhat arbitrary sign flips in the quats at '#inversion' cause the character to turn 90 degrees at export. - Verify mystery crash when editing/saving/loading multiple animation sequences are fixed... - Extend to export classic vertex mesh animations. - Enable more flexible 'nontextured' mesh export. - Extend to export textured level architecture brushes ? ..... - Find out why Max exporter still makes character turn 90 degrees at export. - Verify whether mystery crash on editing/saving/loading multiple animation sequences is fixed. - Extend to export textured new level-architecture 'static-brushes', with smoothing groups Rev 1.8 feb 2001 - Fixed base/class name getting erased between sessions. Rev 1.9 - 1.92 may 2001 - Batch processing option (Max) - Untextured vertices warning names specific mesh (max) - Persistent names & settings Todo: - ? option for persistent options (max & maya...) - ? first-draft vertex exporting ? - ? - ? Maya scaler modifier before root: accept / warn ? - ? ..... Rev may 2003 Todo - complete the unification into single project with build options for various Max Maya versions. The only project-specific files are now BrushExport, MayaInterface, MaxInterface ( and various resource files that may be in one but not the other ) #ifdef MAX #ifdef MAYA MAYAVER = 3, 4 etc MAXVER = 3,4 etc MAXCSVER=3.1, 3.2 etc ******************************************************************/ // Local includes #include "ActorX.h" #include "SceneIFC.h" #include "MaxInterface.h" // General parent-application independent globals. SceneIFC OurScene; VActor TempActor; TextFile DLog; TextFile AuxLog; TextFile MemLog; WinRegistry PluginReg; MaxPluginClass* GlobalPluginObject; #ifdef MAYA TCHAR PluginRegPath[] = _T("Software\\Epic Games\\ActorXMaya"); #endif #ifdef MAX TCHAR PluginRegPath[] = _T("Software\\Epic Games\\ActorXMax"); #endif // Path globals TCHAR DestPath[MAX_PATH]; TCHAR LogPath[MAX_PATH]; TCHAR to_path[MAX_PATH]; TCHAR to_animfile[MAX_PATH]; TCHAR to_skinfile[MAX_PATH]; //char to_brushfile[MAX_PATH], // to_brushpath[MAX_PATH]; TCHAR to_pathvtx[MAX_PATH]; TCHAR to_skinfilevtx[MAX_PATH]; TCHAR framerangestring[MAXINPUTCHARS]; TCHAR vertframerangestring[MAXINPUTCHARS]; TCHAR classname[MAX_PATH]; TCHAR basename[MAX_PATH]; TCHAR batchfoldername[MAX_PATH]; char materialnames[8][MAX_PATH]; TCHAR newsequencename[MAX_PATH]; void ResetPlugin() { // Clear all digested scenedata/animation/path settings etc. GlobalPluginObject = NULL; // Ensure global file/path strings are reset. to_path[0]=0; LogPath[0]=0; to_skinfile[0]=0; to_animfile[0]=0; newsequencename[0]=0; DestPath[0]=0; framerangestring[0]=0; vertframerangestring[0]=0; newsequencename[0]=0; for(INT t=0; t<8; t++) memset(materialnames[t], 0 ,MAX_PATH); // Set access to our registry path PluginReg.SetRegistryPath( PluginRegPath ); // Get all relevant ones from the registry.... INT SwitchPersistent; PluginReg.GetKeyValue(_T("PERSISTSETTINGS"), SwitchPersistent); if( SwitchPersistent ) { PluginReg.GetKeyValue(_T("DOPCX"), OurScene.DoTexPCX); PluginReg.GetKeyValue(_T("DOFIXROOT"),OurScene.DoFixRoot ); PluginReg.GetKeyValue(_T("DOCULLDUMMIES"),OurScene.DoCullDummies ); PluginReg.GetKeyValue(_T("DOTEXGEOM"),OurScene.DoTexGeom ); PluginReg.GetKeyValue(_T("DOPHYSGEOM"),OurScene.DoSkinGeom ); PluginReg.GetKeyValue(_T("DOSELGEOM"),OurScene.DoSelectedGeom); PluginReg.GetKeyValue(_T("DOSKIPSEL"),OurScene.DoSkipSelectedGeom); PluginReg.GetKeyValue(_T("DOEXPSEQ"),OurScene.DoExplicitSequences); PluginReg.GetKeyValue(_T("DOLOG"),OurScene.DoLog); // Maya specific ? //PluginReg.GetKeyValue(_T("QUICKSAVEDISK"),OurScene.QuickSaveDisk); //PluginReg.GetKeyValue(_T("DOFORCERATE"),OurScene.DoForceRate); //PluginReg.GetKeyValue(_T("PERSISTENTRATE"),OurScene.PersistentRate); //PluginReg.GetKeyValue(_T("DOREPLACEUNDERSCORES"),OurScene.DoReplaceUnderscores); PluginReg.GetKeyValue(_T("DOUNSMOOTH"),OurScene.DoUnSmooth); PluginReg.GetKeyValue(_T("DOEXPORTSCALE"),OurScene.DoExportScale); PluginReg.GetKeyValue(_T("DOTANGENTS"),OurScene.DoTangents); PluginReg.GetKeyValue(_T("DOAPPENDVERTEX"),OurScene.DoAppendVertex); PluginReg.GetKeyValue(_T("DOSCALEVERTEX"),OurScene.DoScaleVertex); } INT SwitchPersistPaths; PluginReg.GetKeyValue(_T("PERSISTPATHS"), SwitchPersistPaths); if( SwitchPersistPaths ) { PluginReg.GetKeyString(_T("BASENAME"), basename ); PluginReg.GetKeyString(_T("CLASSNAME"), classname ); PluginReg.GetKeyString(_T("TOPATH"), to_path ); _tcscpy(LogPath,to_path); PluginReg.GetKeyString(_T("TOANIMFILE"), to_animfile ); PluginReg.GetKeyString(_T("TOSKINFILE"), to_skinfile ); PluginReg.GetKeyString(_T("TOPATHVTX"), to_pathvtx ); PluginReg.GetKeyString(_T("TOSKINFILEVTX"), to_skinfilevtx ); } }
[ "git@gildor.org" ]
git@gildor.org
fda530b2957654d10953ec0fd06577b2d5bea91e
c20b459468fa359a6f4c545db72a211d38298909
/source/tree-graph/minimalTree.cpp
ae6d288782e1dc0e30ea3ee4aa4bf335638bc31d
[]
no_license
mycppfeed/Leetmap
e0340c6ecb85901c9555900a871e159a16940028
f1f31085de60adce9dabe5eb2e5c4d66a5ba1572
refs/heads/master
2021-11-04T00:13:19.882064
2019-04-26T21:18:30
2019-04-26T21:18:30
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,473
cpp
#include<iostream> typedef struct _Node { int data; struct _Node* left; struct _Node* right; } node; void insert(node** root, int data) { if(NULL == *root) { node* n = new node; n->data = data; n->left = n->right = NULL; *root = n; } else { if(data <= (*root)->data) { if((*root)->left) { insert(&((*root)->left), data); } else { node* n = new node; n->data = data; (*root)->left = n; } } else { if((*root)->right) { insert(&((*root)->left), data); } else { node* n = new node; n->data = data; (*root)->right = n; } } } } void minBST(node** root, int *arr, int start, int end) { if(start > end) { return; } int mid = start + (end - start)/2; insert(root, arr[mid]); //left half int left_end = mid -1; minBST(&((*root)->left), arr, start, left_end); //right half int right_start = mid +1; minBST(&((*root)->right), arr, right_start, end); } void deleteBST(node* root) { if(NULL == root) { return; } deleteBST(root->left); deleteBST(root->right); delete root; } void print(node* root) { if(NULL == root) { return; } print(root->left); std::cout << " "<< root->data ; print(root->right); delete root; } int main() { node* root = NULL; int arr[] = {1,2,3,4,5,6,7,8,9}; int end = sizeof(arr)/sizeof(arr[0]); minBST(&root, arr, 0, end-1); print(root); }
[ "sdasgup3@illinois.edu" ]
sdasgup3@illinois.edu
eb68082389c9d5eff48a1a50257e6e45cbb9b1e3
e62f6ac171a1c6c9f12159497c045e8bf302e6f6
/include/drivers/ata.h
5151ccadc611189d21e1f73fa1de1062c7931264
[]
no_license
ofirDubi/CoolOS
f6b7b1eade6578b8ffbd19bdfc8b7b6928c0a4f5
59149c355cf41c083ef445e67243a37f43dd544e
refs/heads/master
2018-09-06T07:56:10.163054
2018-01-16T11:43:47
2018-01-16T11:43:47
112,595,550
6
1
null
null
null
null
UTF-8
C++
false
false
1,939
h
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ /* * File: ata.h * Author: ofir123dubi * * Created on January 7, 2018, 10:38 AM */ #ifndef __COOLOS__ATA_H #define __COOLOS__ATA_H #include<hardwarecommunication/port.h> #include<common/types.h> namespace coolOS{ namespace drivers{ class AdvancedTechnologyAttachment{ protected: hardwarecommunication::Port<common::uint16_t> dataPort; //IO port hardwarecommunication::Port<common::uint8_t> errorPort; hardwarecommunication::Port<common::uint8_t> sectorCountPort; //how many sectors we want to read hardwarecommunication::Port<common::uint8_t> lbalLowPort; //logical block address hardwarecommunication::Port<common::uint8_t> lbalMidPort; hardwarecommunication::Port<common::uint8_t> lbalHighPort; hardwarecommunication::Port<common::uint8_t> devicePort; hardwarecommunication::Port<common::uint8_t> commandPort; //what do we want to do - read or write hardwarecommunication::Port<common::uint8_t> controlPort; //status messages bool master; //is it a handler for master or slave - 2 hard drives on the same bus common::uint16_t bytesPerSector; public: AdvancedTechnologyAttachment(common::uint16_t portBase, bool master); ~AdvancedTechnologyAttachment(); void Identify(); //maybe you can read how man bytes are in a sector - check void Read28(common::uint32_t sector, common::uint8_t* data, int count); void Write28(common::uint32_t sector, common::uint8_t* data, int count); void Flush(); //flush the cash of the hard drive }; } } #endif /* ATA_H */
[ "ofir123dubi@gmail.com" ]
ofir123dubi@gmail.com
8935b02ce8c3a87647639aa39cf2a89d96203d53
b1c06fcc909d57d102b00989fdbd9da91247a4a5
/Source/Tests/Engine/Engine.cpp
67b485b679fe9e06b7454c0a7fdc04ed5e20107c
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
TheophilusE/THEOE11
fa7b2b0be0bc8c9a667b57412b3362c9685a31cb
b5fa471d6d24fd5a2509f658706771093c8cdf08
refs/heads/master
2023-08-25T14:31:42.202426
2021-11-06T03:40:16
2021-11-06T03:40:16
410,686,889
0
0
null
null
null
null
UTF-8
C++
false
false
1,356
cpp
// // Copyright (c) 2017-2021 the rbfx project. // // 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 rhs // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR rhsWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR rhs DEALINGS IN // THE SOFTWARE. // #include "../CommonUtils.h" TEST_CASE("Engine started multiple times in same process") { { auto context = Tests::CreateCompleteTestContext(); } { auto context = Tests::CreateCompleteTestContext(); } }
[ "65521326+GodTHEO@users.noreply.github.com" ]
65521326+GodTHEO@users.noreply.github.com
4265741bf2a17b0521daec0ad6b3e8b9b07d27d1
08a297b183344689e8fcb03a1c365e84279c6592
/C/CppUtils/CppUtils/Vector3D.h
aafe4fea7d71e7527694e3d434bada4af33a93b6
[]
no_license
bgoose99/cpruitt-utils
64aca6a215412ac2d06546e60f5a93b11deba200
e7bb66e5e5d7166602e0dec5ef3e3a2a5730ee55
refs/heads/master
2020-05-18T18:20:06.716436
2018-01-10T12:50:07
2018-01-10T12:50:07
32,396,168
2
0
null
null
null
null
UTF-8
C++
false
false
8,313
h
#ifndef __Vector3D__ #define __Vector3D__ // local includes #include "ISerializable.h" /****************************************************************************** * *****************************************************************************/ class Vector3D : public ISerializable<Vector3D> { public: static const int SIZEOF; /*************************************************************************** * Constructor **************************************************************************/ Vector3D(); /*************************************************************************** * Constructor **************************************************************************/ Vector3D( const double &x, const double &y, const double &z ); /*************************************************************************** * Copy constructor **************************************************************************/ Vector3D( const Vector3D &vec ); /*************************************************************************** * Destructor **************************************************************************/ virtual ~Vector3D(); /*************************************************************************** * Returns the x component of this vector. **************************************************************************/ double X() const; /*************************************************************************** * Sets the x component of this vector. **************************************************************************/ void setX( const double &x ); /*************************************************************************** * Returns the y component of this vector. **************************************************************************/ double Y() const; /*************************************************************************** * Sets the y component of this vector. **************************************************************************/ void setY( const double &y ); /*************************************************************************** * Returns the z component of this vector. **************************************************************************/ double Z() const; /*************************************************************************** * Sets the z component of this vector. **************************************************************************/ void setZ( const double &z ); /*************************************************************************** * Returns the magnitude of this vector. **************************************************************************/ double magnitude() const; /*************************************************************************** * Returns the scalar distance between this vector and the supplied * vector. **************************************************************************/ double distance( const Vector3D &v ) const; /*************************************************************************** * Normalizes this vector. (Converts this vector to a unit vector.) **************************************************************************/ Vector3D &normalize(); /*************************************************************************** * Returns a normalized vector in the direction of this vector. **************************************************************************/ Vector3D normalized() const; /*************************************************************************** * Rotates this vector about the supplied axis by the supplied angle. * NOTE: angle must be in radians. Positive angles are measured CCW. **************************************************************************/ Vector3D &rotate( const Vector3D &axis, const double &angle ); /*************************************************************************** * Returns a vector that has been rotated about the supplied axis by * the supplied angle. **************************************************************************/ Vector3D rotated( const Vector3D &axis, const double &angle ) const; /*************************************************************************** * Assignment operator. **************************************************************************/ Vector3D &operator=( const Vector3D &vec ); /*************************************************************************** * Addition operator. **************************************************************************/ const Vector3D operator+( const Vector3D &vec ) const; /*************************************************************************** * Subtraction operator. **************************************************************************/ const Vector3D operator-( const Vector3D &vec ) const; /*************************************************************************** * Multiplication operator. **************************************************************************/ const Vector3D operator*( const double &scale ) const; /*************************************************************************** * Division operator. **************************************************************************/ const Vector3D operator/( const double &divisor ) const; /*************************************************************************** * Equality operator. **************************************************************************/ bool operator==( const Vector3D &vec ) const; /*************************************************************************** * Inequality operator. **************************************************************************/ bool operator!=( const Vector3D &vec ) const; /*************************************************************************** * Addition operator. **************************************************************************/ Vector3D &operator+=( const Vector3D &vec ); /*************************************************************************** * Subtraction operator. **************************************************************************/ Vector3D &operator-=( const Vector3D &vec ); /*************************************************************************** * Multiplication operator. **************************************************************************/ Vector3D &operator*=( const double &scale ); /*************************************************************************** * Division operator. **************************************************************************/ Vector3D &operator/=( const double &divisor ); /*************************************************************************** * Returns the cross product of the two supplied vectors. **************************************************************************/ static Vector3D crossProduct( const Vector3D &v1, const Vector3D &v2 ); /*************************************************************************** * Returns the scalar dot product of the two supplied vectors. **************************************************************************/ static double dotProduct( const Vector3D &v1, const Vector3D &v2 ); /*************************************************************************** * Serialization functions. **************************************************************************/ virtual void toBytes( char *buf ) const; virtual Vector3D &fromBytes( const char *buf ); virtual int binarySize() const; virtual void toBinaryStream( std::ostream &out ) const; virtual Vector3D &fromBinaryStream( std::istream &in ); private: double x; double y; double z; double mag; void calculateMagnitude(); }; #endif
[ "charlespruitt79@gmail.com@5557aa65-72ec-d561-3f1f-9a833d31c65a" ]
charlespruitt79@gmail.com@5557aa65-72ec-d561-3f1f-9a833d31c65a
a2640e43927939f0d9ec04efb29d384fc25b508e
b4f7073600455d0938d153a902e4e1a9d0b990ff
/practical_exercises/10_day_practice/day10/文件例题/12-5.cpp
6c40322943fbce1de1559810d797fcc97fac9d90
[]
no_license
Neflibatata/CPPThings
34784cb0d13b79484874e53e6f791a6448d283c2
52c5794f529396d438e447f5800836f56413cef5
refs/heads/master
2023-03-29T12:07:21.258987
2021-04-02T05:48:14
2021-04-02T05:48:14
353,918,825
5
0
null
null
null
null
GB18030
C++
false
false
575
cpp
//Eg12-5.cpp #include<iostream> #include<iomanip> using namespace std; int main(){ char c[30]="this is string"; double d=-1234.8976; cout<<setw(30)<<left<<setfill('*')<<c<<"----L1"<<endl; cout<<setw(30)<<right<<setfill('*')<<c<<"----L2"<<endl; //showbase显示数值的基数前缀 cout<<dec<<showbase<<showpoint<<setw(30)<<d<<"----L3"<<"\n"; //showpoint显示小数点 cout<<setw(30)<<showpoint<<setprecision(10)<<d<<"----L4"<<"\n"; //setbase(8)设置八进制 cout<<setw(30)<<setbase(16)<<100<<"----L5"<<"\n"; system("pause"); }
[ "1076119830@qq.com" ]
1076119830@qq.com
fcd78a4fdee7ec3927f1f15d972b18606a5ec72f
a4cc03a687fec33fb986990cf053c1a04804b6f1
/avs/libconfigutils/files/src/libs/threading/Executor.cpp
8538c8f057dc1234f3fb33603c8c3dd9c72b065b
[]
no_license
lindenis-org/lindenis-v833-package
93768d5ab5c6af90e67bca2b4ed22552ab5d8ae8
220e01731729a86a0aac2a9f65e20a0176af4588
refs/heads/master
2023-05-11T22:20:40.949440
2021-05-26T09:42:15
2021-05-27T08:24:18
371,616,812
6
2
null
null
null
null
UTF-8
C++
false
false
1,678
cpp
/* * Executor.cpp * * Copyright 2017 Amazon.com, Inc. or its affiliates. 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. * A copy of the License is located at * * http://aws.amazon.com/apache2.0/ * * or in the "license" file accompanying this file. This file 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 "threading/Executor.h" /* template <typename T, typename... Args> std::unique_ptr<T> make_unique(Args&&... args) { return std::unique_ptr<T>(new T(std::forward<Args>(args)...)); } m_taskThread{make_unique<TaskThread>(m_taskQueue)} */ namespace AW { std::shared_ptr<Executor> Executor::create(int numThreads) { return std::shared_ptr<Executor>(new Executor(numThreads)); } Executor::Executor(int numThreads) : m_taskQueue{std::make_shared<TaskQueue>()}, m_taskThreadPool{std::unique_ptr<TaskThreadPool>(new TaskThreadPool(m_taskQueue, numThreads))} { m_taskThreadPool->start(); } Executor::~Executor() { shutdown(); } void Executor::waitForSubmittedTasks() { std::promise<void> flushedPromise; auto flushedFuture = flushedPromise.get_future(); auto task = [&flushedPromise]() { flushedPromise.set_value(); }; submit(task); flushedFuture.get(); } void Executor::shutdown() { m_taskQueue->shutdown(); m_taskThreadPool.reset(); } bool Executor::isShutdown() { return m_taskQueue->isShutdown(); } }
[ "given@lindeni.com" ]
given@lindeni.com
a7c781819eb71cae4180b325cd4ea35e1436a22f
dfa7de41e6e14cd1e109362b67b843512a5adeaf
/Homework_1/Task_1.cpp
89abcb794751451235a5f3593abe50488bfc3482
[]
no_license
IskanderRyspaevUniDubna/HomeworkProgramming
7fcc76f63cb60ba524aeab7a2677f65c6bcf274c
d3c959f72f8391dfe6fcdc67b3e067df72ca6ac8
refs/heads/main
2023-07-17T11:17:21.912194
2021-08-20T16:03:49
2021-08-20T16:03:49
362,289,637
2
0
null
null
null
null
UTF-8
C++
false
false
253
cpp
#include <iostream> using namespace std; char comparison_of_numbers(int a, int b); int main() { return 0; } char comparison_of_numbers(int a, int b) { if (a > b) return '>'; if (a < b) return '<'; if (a == b) return '='; }
[ "noreply@github.com" ]
noreply@github.com
26772759d692e8286536e770c24964ee603d0c45
2aa9217158b25c2231f4040becde9747b50dc0f7
/raw2tiff.cc
b4c9c32c5644ac3b5c6b0ccc6b6392fb754c3aec
[]
no_license
yiannis/gsoc2009
18ddefee4b4d3beed9f39d8ebb1604c3aeba1146
bdb3c62659f14851ed3fdb271bfa48ea4767aa22
refs/heads/master
2016-09-06T06:03:41.797013
2010-05-05T19:30:35
2010-05-05T19:30:35
233,151
1
0
null
null
null
null
UTF-8
C++
false
false
693
cc
#include <string> #include <fstream> #include "RAW.hh" using namespace std; int main(int argc, char *argv[]) { if (argc < 2) { cerr << "Usage: " << argv[0] << " <raw image> [-i <icc_profile>]" << endl; return 1; } string profile; if (argc == 4 && argv[2][0] == '-' && argv[2][1] == 'i') profile = argv[3]; ofstream exif("exif.txt"); ofstream dcraw("dcraw.txt"); RAW raw(argv[1], profile); raw.print_libraw_version(); raw.open(); raw.print_dcraw_settings(dcraw); raw.print_exif_data(exif); raw.get_color_info(); if (profile == "oyranos") raw.get_oyranos_profile(); raw.open_profile(); raw.save_tiff(); return 0; }
[ "jonnyb@hol.gr" ]
jonnyb@hol.gr
e03f7f4cff8fdfa6ac3e9526e20337d383b9747b
7bb34b9837b6304ceac6ab45ce482b570526ed3c
/external/webkit/Source/WebCore/bindings/js/JSXMLHttpRequestUploadCustom.cpp
091c380ecf6899d9f1f16a752c23ef23a6ff941b
[ "LicenseRef-scancode-warranty-disclaimer", "LGPL-2.0-or-later", "GPL-1.0-or-later", "GPL-2.0-only", "LGPL-2.1-only", "LGPL-2.0-only", "BSD-2-Clause", "LicenseRef-scancode-other-copyleft", "Apache-2.0" ]
permissive
ghsecuritylab/android_platform_sony_nicki
7533bca5c13d32a8d2a42696344cc10249bd2fd8
526381be7808e5202d7865aa10303cb5d249388a
refs/heads/master
2021-02-28T20:27:31.390188
2013-10-15T07:57:51
2013-10-15T07:57:51
245,730,217
0
0
Apache-2.0
2020-03-08T00:59:27
2020-03-08T00:59:26
null
UTF-8
C++
false
false
2,034
cpp
/* * Copyright (C) 2008, 2009 Apple Inc. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "config.h" #include "JSXMLHttpRequestUpload.h" #include "DOMWindow.h" #include "Document.h" #include "Event.h" #include "Frame.h" #include "JSDOMWindowCustom.h" #include "JSEvent.h" #include "JSEventListener.h" #include "XMLHttpRequest.h" #include "XMLHttpRequestUpload.h" #include <runtime/Error.h> using namespace JSC; namespace WebCore { void JSXMLHttpRequestUpload::markChildren(MarkStack& markStack) { Base::markChildren(markStack); if (XMLHttpRequest* xmlHttpRequest = m_impl->associatedXMLHttpRequest()) markDOMObjectWrapper(markStack, *Heap::heap(this)->globalData(), xmlHttpRequest); m_impl->markJSEventListeners(markStack); } } // namespace WebCore
[ "gahlotpercy@gmail.com" ]
gahlotpercy@gmail.com
cdb7e517f6be44b3800053262ceed91347d159ba
401d235c1e18ea0dd05e3af66cac681f56eced4f
/lib/DS18B20_temperature_sensor/Temperature.h
ffe515e16a05f49820d9e24a76d0f919c73ebf7f
[]
no_license
tinysoul/ethercat-slaves
4da278ce957c3354012fb4b450440a19af54aac1
f521ec7d8f36b8995396493c0226864927967513
refs/heads/master
2023-05-26T18:31:56.693402
2020-12-01T10:56:53
2020-12-01T10:56:53
null
0
0
null
null
null
null
UTF-8
C++
false
false
3,569
h
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\ * Library implementing the software interface for a DS18B20+ temperature sensor. * * Hardware consists of a TO-92 three-pin device with a round side and a flat side. * * Pin "GND" should be connected to ground voltage. * * Pin "DQ" should be connected to a digital input/output pin. * * Pin "VDD" should be connected to a voltage between 3.0V and 5.5V. * * ┌──────────┐ * * │ O┼────────── 1 GND /───────\ * * │ O┼────────── 2 DQ / \ * * │ O┼────────── 3 VDD │ 3 2 1 │ * * └──────────┘ └───────────┘ * * CURVED SIDE VIEW (flat side on the bottom) PIN SIDE VIEW * * * * Created by P. Verton for the MARCH 3 team of Project MARCH * * Date: 09-APR-2018 * \* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #ifndef TEMPERATURE_ #define TEMPERATURE_ #include <mbed.h> #include "DS18B20.h" #ifdef DEBUG_DEC #undef DEBUG_DEC #endif #define DEBUG_DEC Serial * pc = NULL, int debugLevel = 0 class Temperature { public: //Constructors Temperature(PinName pin, DEBUG_DEC); //Public member functions //Reads the current sensor temperature // float return Temperature value in celsius. // Has value -999 if measurement is invalid. // Has value -1000 if device is disconnected. float read(DEBUG_DEC); //Initializes the device and makes sure all settings are correct. // int tries Number of times it should try to init the device. // default = 1 // int return Indicates whether it initialized succesfully. // 0 Indicates it initialized succesfully // -1 Indicates the device couldn't be found // -2 indicates the address CRC is incorrect // -3 Indicates the deviceID is incorrect int init(int tries = 1, DEBUG_DEC); private: //Private member functions //Class members //Temperature sensor peripheral DS18B20 * m_device; //Timer to see how long it has been since the last correct measurement Timer disconnectTimer; //Whether the disconnect Timer is running bool disconnectTimerRunning; //Whether the device is currently connected bool connected; //Previous (valid) measurement float previousResult; //Number of failed measurements in a row int numberOfFails; //Number of failed measurements in a row needed to assume the device is disconnected static const int maxNumberOfFails = 10; //Amount of time in seconds to wait before attempting to reconnect to the device when disconnected static constexpr float reconnectTime = 0.5; }; #endif //TEMPERATURE
[ "o.n.dehaas@student.tudelft.nl" ]
o.n.dehaas@student.tudelft.nl
d2ecabf1fc581ed4ba86ad0b7a492722595950e6
b2b23e3bd62aab8b729ebc0d99aeb5d37c5b75c3
/netc/Poller.cpp
a688965c6aca5e913d98cc17356659998ed89b50
[ "Apache-2.0" ]
permissive
loulousky/reactor
f410f47a847f1819f3133232d21777d87d04117d
06262d5ebbef3d8187584d856cdb1c65776e9eb0
refs/heads/master
2023-06-15T19:04:09.956329
2021-07-16T09:40:27
2021-07-16T09:40:27
null
0
0
null
null
null
null
UTF-8
C++
false
false
854
cpp
// // Created by suncx on 2020/8/17. // #include "Poller.h" #include "Ext.h" #include "Channel.h" #include "EventLoop.h" #include "PollPoller.h" #include "EpollPoller.h" #include "ConsoleStream.h" #include <cassert> #include <cstdlib> using reactor::net::Poller; Poller::Poller(EventLoop *loop) : loop(loop) {} void Poller::assert_in_loop_thread() const { assert(loop->is_in_created_thread()); } bool Poller::has_channel(Channel *channel) const { assert(loop->is_in_created_thread()); auto it = channel_map.find(channel->get_fd()); return it != channel_map.cend() and it->second == channel; } Poller *Poller::default_poller(EventLoop *loop) { // if (getenv("REACTOR_USE_EPOLL") != nullptr) { // return new EpollPoller(loop); // } else { // return new PollPoller(loop); // } return new EpollPoller(loop); }
[ "sun.chengxiong@foxmail.com" ]
sun.chengxiong@foxmail.com
bc5aed12d90dc07e702e77dc03085b5e2e9ec69d
99cc5ceee9a7fc92127bbc992b92cc3e6c23f7e0
/benchmarks/src/cuda/ispass2009/AES/aesCudaUtils.cpp
eca99b11e121e925d38d2f5b745f6aae05863544
[ "LicenseRef-scancode-unknown-license-reference", "BSD-2-Clause" ]
permissive
kiliakis/gpgpu-sim_simulations
676768f989c0dd6bd5118f3c6930fbb67eac3b0e
cbd8fa40d5716d18639f81a344d16cc9a3729df1
refs/heads/master
2020-03-29T22:30:09.999748
2018-11-07T10:25:22
2018-11-07T10:25:22
150,424,468
0
0
BSD-2-Clause
2018-09-26T12:41:28
2018-09-26T12:38:56
C
UTF-8
C++
false
false
13,292
cpp
/*************************************************************************** * Copyright (C) 2006 * * * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ /** @author Svetlin Manavski <svetlin@manavski.com> */ #include "aesCudaUtils.h" #include <string.h> extern unsigned Rcon[]; extern unsigned SBox[]; extern unsigned LogTable[]; extern unsigned ExpoTable[]; extern unsigned MODE; //------------------------------------------help-functions------------------------------------------------------- unsigned mySbox(unsigned num) { return SBox[num]; } unsigned myXor(unsigned num1, unsigned num2) { return num1 ^ num2; } //------------------------------------------help-functions------------------------------------------------------- //------------------------------------------AESCudaUtils----------------------------------------------------------- //------------------------------------------AESCudaUtils----------------------------------------------------------- //------------------------------------------AESCudaUtils----------------------------------------------------------- // gestisce la riga di commando unsigned commandLineManager(int argc, char *argv[]) { if ( argc<5 ) usage(); if ( argc%2 != 1) usage(); if ( (*argv[1] != 'e') && (*argv[1] != 'd') ) usage(); if ( ( strcmp(argv[2], "256") ) && ( strcmp(argv[2], "128") ) ) usage(); if (*argv[1] != 'e') MODE = 0; //controllo esistenza file in futuro return ( (argc-3) / 2 ); } void usage() { std::cout << "\nAES - CUDA by Svetlin Manavski" << std::endl; std::cout << "Version 0.90" << std::endl << std::endl; std::cout << "Usage:" << std::endl << std::endl; std::cout << "aescuda <e|d> <128|256> input1 key1 input2 key2 .... inputN keyN" << std::endl; std::cout << "e\t- means to encrypt the input file" << std::endl; std::cout << "d\t- means to decrypt the input file" << std::endl; std::cout << "128/256\t- selects the aes type" << std::endl << std::endl; std::cout << "input file maximum size: 34.603.007 bytes" << std::endl; std::cout << "key file must contain 32 or 16 elements in hex format separated by blanks\n\n"; exit(0); } bool file_exists(std::ifstream& name){ return name.good(); } long int fileSize(std::ifstream& f){ return f.tellg(); } //funzione principale unsigned initAesCuda(std::string myKeyFile, unsigned char myKeyBuffer[], const unsigned int myKeyBitsSize, std::string myInputFile, char inputArray[], const unsigned inputArraySize){ // path inputPath(myInputFile.c_str()); // path keyPath(myKeyFile.c_str()); std::ifstream inputPath(myInputFile.c_str(), std::ios::binary | std::ios::ate); std::ifstream keyPath(myKeyFile.c_str(), std::ios::binary | std::ios::ate); // if ( !exists(keyPath) ) if ( !file_exists(keyPath) ) throw std::string("file "+myKeyFile+" doesn't exist"); // if ( !exists(inputPath) ) if ( !file_exists(inputPath) ) throw std::string("file "+myInputFile+" doesn't exist"); if ( myKeyBitsSize!=256 && myKeyBitsSize!=128) throw std::string("cannot use a key dimension different from 256 or 128"); if ( !myKeyBuffer ) throw std::string("key array not allocated"); if ( !inputArray ) throw std::string("input array not allocated"); // boost::intmax_t inputFileSize = getFileSize(inputPath); // boost::intmax_t keyFileSize = getFileSize(keyPath); boost::intmax_t inputFileSize = fileSize(inputPath); boost::intmax_t keyFileSize = fileSize(keyPath); if ( keyFileSize==0 ) throw std::string("cannot use an empty input file"); if ( inputFileSize==0 ) throw std::string("cannot use an empty key file"); if ( inputFileSize > inputArraySize - 1 && MODE) throw std::string("cannot encrypt a file bigger than 34.603.007 bytes"); if ( inputFileSize > inputArraySize && !MODE) throw std::string("cannot decrypt a file bigger than 33MB"); //legge l'input readFromFileNotForm(myInputFile, inputArray, inputFileSize); std::vector<unsigned> keyArray(myKeyBitsSize/8); unsigned ekSize = (myKeyBitsSize != 256) ? 176 : 240; std::vector<unsigned> expKeyArray(ekSize); std::vector<unsigned> invExpKeyArray(ekSize); //legge la chiave readFromFileForm(myKeyFile, keyArray); std::cout << "\n###############################################################\n\n"; std::cout << "AES - CUDA by Svetlin Manavski)\n\n"; std::cout << "AES " << myKeyBitsSize << " is running...." << std::endl << std::endl; std::cout << "Input file size: " << inputFileSize << " Bytes" << std::endl << std::endl; std::cout << "Key: "; for (unsigned cnt=0; cnt<keyArray.size(); ++cnt) std::cout << std::hex << keyArray[cnt]; if (MODE){ //ENCRYPTION MODE //PADDING MANAGEMENT FOLLOWING THE PKCS STANDARD unsigned mod16 = inputFileSize % 16; unsigned div16 = inputFileSize / 16; unsigned padElem; if ( mod16 != 0 ) padElem = 16 - mod16; else padElem = 16; for (unsigned cnt = 0; cnt < padElem; ++cnt) inputArray[div16*16 + mod16 + cnt] = padElem; inputFileSize = inputFileSize + padElem; //IN THE ENCRYPTION MODE I NEED THE EXPANDED KEY expFunc(keyArray, expKeyArray); for (unsigned cnt=0; cnt<expKeyArray.size(); ++cnt){ unsigned val = expKeyArray[cnt]; unsigned char *pc = reinterpret_cast<unsigned char *>(&val); myKeyBuffer[cnt] = *(pc); } } else { //DECRYPTION MODE //IN THE ENCRYPTION MODE I NEED THE INVERSE EXPANDED KEY expFunc(keyArray, expKeyArray); invExpFunc(expKeyArray, invExpKeyArray); for (unsigned cnt=0; cnt<invExpKeyArray.size(); ++cnt){ unsigned val = invExpKeyArray[cnt]; unsigned char *pc = reinterpret_cast<unsigned char *>(&val); myKeyBuffer[cnt] = *(pc); } } std::cout << std::endl; return inputFileSize; } boost::intmax_t getFileSize(path &myPath){ if ( !exists(myPath) ) throw std::string("file "+myPath.string()+" doesn't exist"); return file_size(myPath); } //legge file non formattati come l'input void readFromFileNotForm(std::string &myPath, char *storingArray, unsigned dataSize){ //if ( !file_exists(myPath) ) // throw std::string("file doesn't exist"); if ( !storingArray ) throw std::string("readFromFileNotForm: array not allocated"); std::ifstream inStream; inStream.open( myPath.c_str(), std::ifstream::binary ); inStream.read(storingArray, dataSize); inStream.close(); } //legge file formattati come la chiave (esadecimali separati da spazi) void readFromFileForm(std::string &myPath, std::vector<unsigned> &storingArray){ //if ( !file_exists(inStream) ) // throw std::string("file doesn't exist"); if ( storingArray.size()!=32 && storingArray.size()!=16) throw std::string("readFromFileForm: storing array of wrong dimension"); std::ifstream inStream; inStream>>std::hex; inStream.open( myPath.c_str() ); for (unsigned cnt=0; cnt<storingArray.size(); ++cnt){ inStream >> storingArray[cnt]; if ( ( inStream.eof() ) && ( cnt != storingArray.size()-1 ) ) throw std::string("cannot use a key with less than 32 or 16 elements "); if ( ( !inStream.eof() ) && ( cnt == storingArray.size()-1 ) ) std::cout << "WARNING: your key file has more than 32 or 16 elements. It will be cut down to this threshold\n"; if ( inStream.fail() ) throw std::string("Check that your key file elements are in hexadecimal format separeted by blanks"); } inStream.close(); } //espande la chiave void expFunc(std::vector<unsigned> &keyArray, std::vector<unsigned> &expKeyArray){ if ( keyArray.size()!=32 && keyArray.size()!=16 ) throw std::string("expFunc: key array of wrong dimension"); if ( expKeyArray.size()!=240 && expKeyArray.size()!=176 ) throw std::string("expFunc: expanded key array of wrong dimension"); copy(keyArray.begin(), keyArray.end(), expKeyArray.begin()); unsigned cycles = (expKeyArray.size()!=240) ? 11 : 8; for (unsigned i=1; i<cycles; ++i){ singleStep(expKeyArray, i); } } void singleStep(std::vector<unsigned> &expKey, unsigned stepIdx){ if ( expKey.size()!=240 && expKey.size()!=176 ) throw std::string("singleStep: expanded key array of wrong dimension"); if ( stepIdx<1 && stepIdx>11 ) throw std::string("singleStep: index out of range"); unsigned num = (expKey.size()!=240) ? 16 : 32; unsigned idx = (expKey.size()!=240) ? 16*stepIdx : 32*stepIdx; copy(expKey.begin()+(idx)-4, expKey.begin()+(idx),expKey.begin()+(idx)); rotate(expKey.begin()+(idx), expKey.begin()+(idx)+1, expKey.begin()+(idx)+4); transform(expKey.begin()+(idx), expKey.begin()+(idx)+4, expKey.begin()+(idx), mySbox); expKey[idx] = expKey[idx] ^ Rcon[stepIdx-1]; transform(expKey.begin()+(idx), expKey.begin()+(idx)+4, expKey.begin()+(idx)-num, expKey.begin()+(idx), myXor); for (unsigned cnt=0; cnt<3; ++cnt){ copy(expKey.begin()+(idx)+4*cnt, expKey.begin()+(idx)+4*(cnt+1),expKey.begin()+(idx)+(4*(cnt+1))); transform(expKey.begin()+(idx)+4*(cnt+1), expKey.begin()+(idx)+4*(cnt+2), expKey.begin()+(idx)-(num-4*(cnt+1)), expKey.begin()+(idx)+4*(cnt+1), myXor); } if(stepIdx!=7 && expKey.size()!=176){ copy(expKey.begin()+(idx)+12, expKey.begin()+(idx)+16,expKey.begin()+(idx)+16); transform(expKey.begin()+(idx)+16, expKey.begin()+(idx)+20, expKey.begin()+(idx)+16, mySbox); transform(expKey.begin()+(idx)+16, expKey.begin()+(idx)+20, expKey.begin()+(idx)-(32-16), expKey.begin()+(idx)+16, myXor); for (unsigned cnt=4; cnt<7; ++cnt){ copy(expKey.begin()+(idx)+4*cnt, expKey.begin()+(idx)+4*(cnt+1),expKey.begin()+(idx)+(4*(cnt+1))); transform(expKey.begin()+(idx)+4*(cnt+1), expKey.begin()+(idx)+4*(cnt+2), expKey.begin()+(idx)-(32-4*(cnt+1)), expKey.begin()+(idx)+4*(cnt+1), myXor); } } } //espande la chiave inversa per la decriptazione void invExpFunc(std::vector<unsigned> &expKey, std::vector<unsigned> &invExpKey){ if ( expKey.size()!=240 && expKey.size()!=176 ) throw std::string("invExpFunc: expanded key array of wrong dimension"); if ( invExpKey.size()!=240 && invExpKey.size()!=176 ) throw std::string("invExpFunc: inverse expanded key array of wrong dimension"); std::vector<unsigned> temp(16); copy(expKey.begin(), expKey.begin()+16,invExpKey.end()-16); copy(expKey.end()-16, expKey.end(),invExpKey.begin()); unsigned cycles = (expKey.size()!=240) ? 10 : 14; for (unsigned cnt=1; cnt<cycles; ++cnt){ copy(expKey.end()-(16*cnt+16), expKey.end()-(16*cnt), temp.begin()); invMixColumn(temp); copy(temp.begin(), temp.end(), invExpKey.begin()+(16*cnt)); } } void invMixColumn(std::vector<unsigned> &temp){ if ( temp.size()!=16 ) throw std::string("invMixColumn: array of wrong dimension"); std::vector<unsigned> result(4); for(unsigned cnt=0; cnt<4; ++cnt){ result[0] = galoisProd(0x0e, temp[cnt*4]) ^ galoisProd(0x0b, temp[cnt*4+1]) ^ galoisProd(0x0d, temp[cnt*4+2]) ^ galoisProd(0x09, temp[cnt*4+3]); result[1] = galoisProd(0x09, temp[cnt*4]) ^ galoisProd(0x0e, temp[cnt*4+1]) ^ galoisProd(0x0b, temp[cnt*4+2]) ^ galoisProd(0x0d, temp[cnt*4+3]); result[2] = galoisProd(0x0d, temp[cnt*4]) ^ galoisProd(0x09, temp[cnt*4+1]) ^ galoisProd(0x0e, temp[cnt*4+2]) ^ galoisProd(0x0b, temp[cnt*4+3]); result[3] = galoisProd(0x0b, temp[cnt*4]) ^ galoisProd(0x0d, temp[cnt*4+1]) ^ galoisProd(0x09, temp[cnt*4+2]) ^ galoisProd(0x0e, temp[cnt*4+3]); copy(result.begin(), result.end(), temp.begin()+(4*cnt)); } } //prodotto di Galois di due numeri unsigned galoisProd(unsigned a, unsigned b){ if(a==0 || b==0) return 0; else { a = LogTable[a]; b = LogTable[b]; a = a+b; a = a % 255; a = ExpoTable[a]; return a; } } //scrive su file il risultato void writeToFile(const std::string &outPath, char *storingArray, boost::intmax_t dataSize, unsigned maxInputSize){ if ( !storingArray ) throw std::string("writeToFile: array not allocated"); if ( dataSize > maxInputSize) dataSize = maxInputSize; std::ofstream outStream; outStream.open( outPath.c_str() , std::ifstream::binary); if (!MODE) dataSize = dataSize - storingArray[dataSize-1]; outStream.write(storingArray, dataSize); outStream.close(); }
[ "konstantinos.iliakis@cern.ch" ]
konstantinos.iliakis@cern.ch
a1a7a6037ebd5694d5ffe3ee4fadf3f765446f85
16451b68e5a9da816e05a52465d8b0d118d7d40c
/data/tplcache/879ae476de6559a3e514d89fbeabde8c.inc
a54188e8459b96bcbd99a252a7d7c98ad5f5dcab
[]
no_license
winter2012/tian_ya_tu_ku
6e22517187ae47242d3fde16995f085a68c04280
82d2f8b73f6ed15686f59efa9a5ebb8117c18ae5
refs/heads/master
2020-06-20T17:42:14.565617
2019-07-16T12:02:09
2019-07-16T12:02:09
197,184,466
0
1
null
null
null
null
GB18030
C++
false
false
1,672
inc
{dede:pagestyle maxwidth='800' ddmaxwidth='170' row='3' col='3' value='2'/} {dede:comments}图集类型会采集时生成此配置是正常的,不过如果后面没有跟着img标记则表示规则无效{/dede:comments} {dede:img ddimg='' text='图 1'}/uploads/allimg/c130311/13629A44134530-1a22.jpg{/dede:img} {dede:img ddimg='' text='图 2'}/uploads/allimg/c130311/13629A44134530-1a22.jpg{/dede:img} {dede:img ddimg='' text='图 3'}/uploads/allimg/c130311/13629A441b150-220X.jpg{/dede:img} {dede:img ddimg='' text='图 4'}/uploads/allimg/c130311/13629A4430aP-3LQ.jpg{/dede:img} {dede:img ddimg='' text='图 5'}/uploads/allimg/c130311/13629A44364950-4R55.jpg{/dede:img} {dede:img ddimg='' text='图 6'}/uploads/allimg/c130311/13629A44423O0-5a41.jpg{/dede:img} {dede:img ddimg='' text='图 7'}/uploads/allimg/c130311/13629A444NJ0-DP3.jpg{/dede:img} {dede:img ddimg='' text='图 8'}/uploads/allimg/c130311/13629A44550a0-G064.jpg{/dede:img} {dede:img ddimg='' text='图 9'}/uploads/allimg/c130311/13629A44595420-UL5.jpg{/dede:img} {dede:img ddimg='' text='图 10'}/uploads/allimg/c130311/13629A44BM60-93C6.jpg{/dede:img} {dede:img ddimg='' text='图 11'}/uploads/allimg/c130311/13629A44J0T0-101606.jpg{/dede:img} {dede:img ddimg='' text='图 12'}/uploads/allimg/c130311/13629A44O2M0-119206.jpg{/dede:img} {dede:img ddimg='' text='图 13'}/uploads/allimg/c130311/13629A44TC50-1225I.jpg{/dede:img} {dede:img ddimg='' text='图 14'}/uploads/allimg/c130311/13629A44YZ30-139611.jpg{/dede:img} {dede:img ddimg='' text='图 15'}/uploads/allimg/c130311/13629A44946040-142R2.jpg{/dede:img} {dede:img ddimg='' text='图 16'}/uploads/allimg/c130311/13629A44c5540-152W3.jpg{/dede:img}
[ "winter2012102@gmail.com" ]
winter2012102@gmail.com
f904addf594aefdf1ceaba0c07af368e1882dac0
b6351cfb742128250a02064dae921735363c7c35
/src/Card.h
0db1aa0fa4a97243d9d21b0ba42db801ec297f30
[ "MIT" ]
permissive
KSouthwood/CppND-Capstone
9113ef550fa50bd40c79ba7e821845f273b830a1
ac95629a4ef81fb7177d7f346f094de3d4d217e9
refs/heads/master
2020-07-23T21:07:19.240623
2019-09-15T03:21:49
2019-09-15T03:21:49
207,706,535
0
0
null
null
null
null
UTF-8
C++
false
false
1,595
h
/* * The MIT License * * Copyright 2019 Keri Southwood-Smith. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ #ifndef CARD_H #define CARD_H #include <iostream> #include <string> #include <SDL2/SDL.h> class Card { public: Card(); Card(std::string rank_file, std::string suit_file, int val); virtual ~Card(); int GetValue(); SDL_Surface* GetRank(); SDL_Surface* GetSuit(); private: int value; SDL_Surface *rank; SDL_Surface *suit; std::string GetResourcePath(const std::string &subDir = ""); }; #endif /* CARD_H */
[ "keri.southwood@gmail.com" ]
keri.southwood@gmail.com
8bd8bd7ea7c89b65e95e0f577348038e50064727
96c6d154a673d6a780e94512d73630cacc726fe0
/sql/mySqlTest/mySqlTest/10_codeQuestion.cpp
2119bdb11ebcd33c2c529ceec947ad0e584d97b7
[]
no_license
wy1996-hub/Common-code-module
121b467ff7fd2f6d9959f25b161577642c33e56a
b4a3c61136ccf84fde5969f5b4165e82b17388ef
refs/heads/main
2023-06-08T02:41:07.816427
2021-07-01T13:42:15
2021-07-01T13:42:15
311,587,074
1
0
null
null
null
null
UTF-8
C++
false
false
239
cpp
#include <iostream> #include <opencv2\opencv.hpp> #include "LXMysql.h" using namespace std; using namespace cv; int main(int argc, char *argv[]) { LXMysql my; my.Init(); my.Close(); cout << "finish" << endl; getchar(); return 0; }
[ "1728587757@qq.com" ]
1728587757@qq.com
b5c40cc6b057f84215a7bdbfab02484631239f92
e992aa2b1ee29bc2da3b5a7870726ec3e8efeba7
/src/qt/bitcoinunits.cpp
4076f5b4b4c1ae8973c4a9da5e31b0641a72c95a
[ "MIT" ]
permissive
EarthcoinCash/EarthcoinCash
56d8c97456cb7b9bd33a21aed0844a4a7412d093
cec3a4af17eeed5b47c79925386ab23b7ef1edaf
refs/heads/master
2021-01-01T13:38:11.036653
2020-03-14T20:35:55
2020-03-14T20:35:55
239,302,398
1
0
null
null
null
null
UTF-8
C++
false
false
6,201
cpp
// Copyright (c) 2011-2018 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include <qt/bitcoinunits.h> #include <primitives/transaction.h> #include <QStringList> BitcoinUnits::BitcoinUnits(QObject *parent): QAbstractListModel(parent), unitlist(availableUnits()) { } QList<BitcoinUnits::Unit> BitcoinUnits::availableUnits() { QList<BitcoinUnits::Unit> unitlist; unitlist.append(BTC); unitlist.append(mBTC); unitlist.append(uBTC); unitlist.append(SAT); return unitlist; } bool BitcoinUnits::valid(int unit) { switch(unit) { case BTC: case mBTC: case uBTC: case SAT: return true; default: return false; } } QString BitcoinUnits::longName(int unit) { switch(unit) { case BTC: return QString("EarthcoinCashs"); case mBTC: return QString("miliEarthcoinCashs"); case uBTC: return QString("microEarthcoinCashs"); case SAT: return QString("satoEarthcoinCashs"); default: return QString("???"); } } QString BitcoinUnits::shortName(int unit) { switch(unit) { case uBTC: return QString::fromUtf8("bits"); case SAT: return QString("sat"); default: return longName(unit); } } QString BitcoinUnits::description(int unit) { switch(unit) { case BTC: return QString("EarthcoinCashs"); case mBTC: return QString("miliEarthcoinCashs (1 / 1" THIN_SP_UTF8 "000)"); case uBTC: return QString("microEarthcoinCashs (1 / 1" THIN_SP_UTF8 "000" THIN_SP_UTF8 "000)"); case SAT: return QString("satoEarthcoinCashs (sat) (1 / 100" THIN_SP_UTF8 "000" THIN_SP_UTF8 "000)"); default: return QString("???"); } } qint64 BitcoinUnits::factor(int unit) { switch(unit) { case BTC: return 100000000; case mBTC: return 100000; case uBTC: return 100; case SAT: return 1; default: return 100000000; } } int BitcoinUnits::decimals(int unit) { switch(unit) { case BTC: return 8; case mBTC: return 5; case uBTC: return 2; case SAT: return 0; default: return 0; } } QString BitcoinUnits::format(int unit, const CAmount& nIn, bool fPlus, SeparatorStyle separators) { // Note: not using straight sprintf here because we do NOT want // localized number formatting. if(!valid(unit)) return QString(); // Refuse to format invalid unit qint64 n = (qint64)nIn; qint64 coin = factor(unit); int num_decimals = decimals(unit); qint64 n_abs = (n > 0 ? n : -n); qint64 quotient = n_abs / coin; QString quotient_str = QString::number(quotient); // Use SI-style thin space separators as these are locale independent and can't be // confused with the decimal marker. QChar thin_sp(THIN_SP_CP); int q_size = quotient_str.size(); if (separators == separatorAlways || (separators == separatorStandard && q_size > 4)) for (int i = 3; i < q_size; i += 3) quotient_str.insert(q_size - i, thin_sp); if (n < 0) quotient_str.insert(0, '-'); else if (fPlus && n > 0) quotient_str.insert(0, '+'); if (num_decimals > 0) { qint64 remainder = n_abs % coin; QString remainder_str = QString::number(remainder).rightJustified(num_decimals, '0'); return quotient_str + QString(".") + remainder_str; } else { return quotient_str; } } // NOTE: Using formatWithUnit in an HTML context risks wrapping // quantities at the thousands separator. More subtly, it also results // in a standard space rather than a thin space, due to a bug in Qt's // XML whitespace canonicalisation // // Please take care to use formatHtmlWithUnit instead, when // appropriate. QString BitcoinUnits::formatWithUnit(int unit, const CAmount& amount, bool plussign, SeparatorStyle separators) { return format(unit, amount, plussign, separators) + QString(" ") + shortName(unit); } QString BitcoinUnits::formatHtmlWithUnit(int unit, const CAmount& amount, bool plussign, SeparatorStyle separators) { QString str(formatWithUnit(unit, amount, plussign, separators)); str.replace(QChar(THIN_SP_CP), QString(THIN_SP_HTML)); return QString("<span style='white-space: nowrap;'>%1</span>").arg(str); } bool BitcoinUnits::parse(int unit, const QString &value, CAmount *val_out) { if(!valid(unit) || value.isEmpty()) return false; // Refuse to parse invalid unit or empty string int num_decimals = decimals(unit); // Ignore spaces and thin spaces when parsing QStringList parts = removeSpaces(value).split("."); if(parts.size() > 2) { return false; // More than one dot } QString whole = parts[0]; QString decimals; if(parts.size() > 1) { decimals = parts[1]; } if(decimals.size() > num_decimals) { return false; // Exceeds max precision } bool ok = false; QString str = whole + decimals.leftJustified(num_decimals, '0'); if(str.size() > 18) { return false; // Longer numbers will exceed 63 bits } CAmount retvalue(str.toLongLong(&ok)); if(val_out) { *val_out = retvalue; } return ok; } QString BitcoinUnits::getAmountColumnTitle(int unit) { QString amountTitle = QObject::tr("Amount"); if (BitcoinUnits::valid(unit)) { amountTitle += " ("+BitcoinUnits::shortName(unit) + ")"; } return amountTitle; } int BitcoinUnits::rowCount(const QModelIndex &parent) const { Q_UNUSED(parent); return unitlist.size(); } QVariant BitcoinUnits::data(const QModelIndex &index, int role) const { int row = index.row(); if(row >= 0 && row < unitlist.size()) { Unit unit = unitlist.at(row); switch(role) { case Qt::EditRole: case Qt::DisplayRole: return QVariant(longName(unit)); case Qt::ToolTipRole: return QVariant(description(unit)); case UnitRole: return QVariant(static_cast<int>(unit)); } } return QVariant(); } CAmount BitcoinUnits::maxMoney() { return MAX_MONEY; }
[ "yanding2@outlook.com" ]
yanding2@outlook.com
d1ddadfc0ec4dae387d2aa01158e56e555682a74
a68ff133b0affb7208ae96ba1717caf07fc0cd7c
/Source/PluginProcessor.cpp
af97e72c186df29e380db736ee241fa0133d2b66
[]
no_license
Nazaroni/naron-eq
62ed4c97e2c3234a42b7f22e17c592ad89308763
0232f9daa284be56af783477b5e92c6299e592a8
refs/heads/main
2023-07-12T03:36:58.218337
2021-08-15T19:59:37
2021-08-15T19:59:37
370,818,917
0
0
null
2021-05-26T20:11:14
2021-05-25T20:23:40
C++
UTF-8
C++
false
false
19,387
cpp
/* ============================================================================== This file contains the basic framework code for a JUCE plugin processor. ============================================================================== */ #include "PluginProcessor.h" #include "PluginEditor.h" //============================================================================== SimpleEQAudioProcessor::SimpleEQAudioProcessor() #ifndef JucePlugin_PreferredChannelConfigurations : AudioProcessor (BusesProperties() #if ! JucePlugin_IsMidiEffect #if ! JucePlugin_IsSynth .withInput ("Input", juce::AudioChannelSet::stereo(), true) #endif .withOutput ("Output", juce::AudioChannelSet::stereo(), true) #endif ) #endif { } SimpleEQAudioProcessor::~SimpleEQAudioProcessor() { } //============================================================================== const juce::String SimpleEQAudioProcessor::getName() const { return JucePlugin_Name; } bool SimpleEQAudioProcessor::acceptsMidi() const { #if JucePlugin_WantsMidiInput return true; #else return false; #endif } bool SimpleEQAudioProcessor::producesMidi() const { #if JucePlugin_ProducesMidiOutput return true; #else return false; #endif } bool SimpleEQAudioProcessor::isMidiEffect() const { #if JucePlugin_IsMidiEffect return true; #else return false; #endif } double SimpleEQAudioProcessor::getTailLengthSeconds() const { return 0.0; } int SimpleEQAudioProcessor::getNumPrograms() { return 1; // NB: some hosts don't cope very well if you tell them there are 0 programs, // so this should be at least 1, even if you're not really implementing programs. } int SimpleEQAudioProcessor::getCurrentProgram() { return 0; } void SimpleEQAudioProcessor::setCurrentProgram (int index) { } const juce::String SimpleEQAudioProcessor::getProgramName (int index) { return {}; } void SimpleEQAudioProcessor::changeProgramName (int index, const juce::String& newName) { } //============================================================================== void SimpleEQAudioProcessor::prepareToPlay (double sampleRate, int samplesPerBlock) { // Use this method as the place to do any pre-playback // initialisation that you need.. juce::dsp::ProcessSpec spec; spec.maximumBlockSize = samplesPerBlock; spec.numChannels = 1; spec.sampleRate = sampleRate; leftChain.prepare(spec); rightChain.prepare(spec); auto chainSettings = getChainSettings(apvts); auto peakCoefficients = juce::dsp::IIR::Coefficients<float>::makePeakFilter(sampleRate, chainSettings.peakFreq, chainSettings.peakQuality, juce::Decibels::decibelsToGain(chainSettings.peakGainInDecibels)); *leftChain.get<ChainPositions::Peak>().coefficients = *peakCoefficients; *rightChain.get<ChainPositions::Peak>().coefficients = *peakCoefficients; auto cutCoefficients = juce::dsp::FilterDesign<float>::designIIRHighpassHighOrderButterworthMethod(chainSettings.lowCutFreq, sampleRate, 2 * (chainSettings.lowCutSlope + 1)); auto& leftLowCut = leftChain.get<ChainPositions::LowCut>(); leftLowCut.setBypassed<0>(true); leftLowCut.setBypassed<1>(true); leftLowCut.setBypassed<2>(true); leftLowCut.setBypassed<3>(true); switch ( chainSettings.lowCutSlope ) { case Slope_12: *leftLowCut.get<0>().coefficients = *cutCoefficients[0]; leftLowCut.setBypassed<0>(false); break; case Slope_24: *leftLowCut.get<0>().coefficients = *cutCoefficients[0]; leftLowCut.setBypassed<0>(false); *leftLowCut.get<1>().coefficients = *cutCoefficients[1]; leftLowCut.setBypassed<1>(false); break; case Slope_36: *leftLowCut.get<0>().coefficients = *cutCoefficients[0]; leftLowCut.setBypassed<0>(false); *leftLowCut.get<1>().coefficients = *cutCoefficients[1]; leftLowCut.setBypassed<1>(false); *leftLowCut.get<2>().coefficients = *cutCoefficients[2]; leftLowCut.setBypassed<2>(false); break; case Slope_48: *leftLowCut.get<0>().coefficients = *cutCoefficients[0]; leftLowCut.setBypassed<0>(false); *leftLowCut.get<1>().coefficients = *cutCoefficients[1]; leftLowCut.setBypassed<1>(false); *leftLowCut.get<2>().coefficients = *cutCoefficients[2]; leftLowCut.setBypassed<2>(false); *leftLowCut.get<3>().coefficients = *cutCoefficients[3]; leftLowCut.setBypassed<3>(false); break; default: break; } auto& rightLowCut = rightChain.get<ChainPositions::LowCut>(); rightLowCut.setBypassed<0>(true); rightLowCut.setBypassed<1>(true); rightLowCut.setBypassed<2>(true); rightLowCut.setBypassed<3>(true); switch ( chainSettings.lowCutSlope ) { case Slope_12: *rightLowCut.get<0>().coefficients = *cutCoefficients[0]; rightLowCut.setBypassed<0>(false); break; case Slope_24: *rightLowCut.get<0>().coefficients = *cutCoefficients[0]; rightLowCut.setBypassed<0>(false); *rightLowCut.get<1>().coefficients = *cutCoefficients[1]; rightLowCut.setBypassed<1>(false); break; case Slope_36: *rightLowCut.get<0>().coefficients = *cutCoefficients[0]; rightLowCut.setBypassed<0>(false); *rightLowCut.get<1>().coefficients = *cutCoefficients[1]; rightLowCut.setBypassed<1>(false); *rightLowCut.get<2>().coefficients = *cutCoefficients[2]; rightLowCut.setBypassed<2>(false); break; case Slope_48: *rightLowCut.get<0>().coefficients = *cutCoefficients[0]; rightLowCut.setBypassed<0>(false); *rightLowCut.get<1>().coefficients = *cutCoefficients[1]; rightLowCut.setBypassed<1>(false); *rightLowCut.get<2>().coefficients = *cutCoefficients[2]; rightLowCut.setBypassed<2>(false); *rightLowCut.get<3>().coefficients = *cutCoefficients[3]; rightLowCut.setBypassed<3>(false); break; default: break; } } void SimpleEQAudioProcessor::releaseResources() { // When playback stops, you can use this as an opportunity to free up any // spare memory, etc. } #ifndef JucePlugin_PreferredChannelConfigurations bool SimpleEQAudioProcessor::isBusesLayoutSupported (const BusesLayout& layouts) const { #if JucePlugin_IsMidiEffect juce::ignoreUnused (layouts); return true; #else // This is the place where you check if the layout is supported. // In this template code we only support mono or stereo. // Some plugin hosts, such as certain GarageBand versions, will only // load plugins that support stereo bus layouts. if (layouts.getMainOutputChannelSet() != juce::AudioChannelSet::mono() && layouts.getMainOutputChannelSet() != juce::AudioChannelSet::stereo()) return false; // This checks if the input layout matches the output layout #if ! JucePlugin_IsSynth if (layouts.getMainOutputChannelSet() != layouts.getMainInputChannelSet()) return false; #endif return true; #endif } #endif void SimpleEQAudioProcessor::processBlock (juce::AudioBuffer<float>& buffer, juce::MidiBuffer& midiMessages) { juce::ScopedNoDenormals noDenormals; auto totalNumInputChannels = getTotalNumInputChannels(); auto totalNumOutputChannels = getTotalNumOutputChannels(); // In case we have more outputs than inputs, this code clears any output // channels that didn't contain input data, (because these aren't // guaranteed to be empty - they may contain garbage). // This is here to avoid people getting screaming feedback // when they first compile a plugin, but obviously you don't need to keep // this code if your algorithm always overwrites all the output channels. for (auto i = totalNumInputChannels; i < totalNumOutputChannels; ++i) buffer.clear (i, 0, buffer.getNumSamples()); auto chainSettings = getChainSettings(apvts); updatePeakFilter(chainSettings); // auto peakCoefficients = juce::dsp::IIR::Coefficients<float>::makePeakFilter(getSampleRate(), // chainSettings.peakFreq, // chainSettings.peakQuality, // juce::Decibels::decibelsToGain(chainSettings.peakGainInDecibels)); // *leftChain.get<ChainPositions::Peak>().coefficients = *peakCoefficients; // *rightChain.get<ChainPositions::Peak>().coefficients = *peakCoefficients; auto cutCoefficients = juce::dsp::FilterDesign<float>::designIIRHighpassHighOrderButterworthMethod(chainSettings.lowCutFreq, getSampleRate(), 2 * (chainSettings.lowCutSlope + 1)); auto& leftLowCut = leftChain.get<ChainPositions::LowCut>(); leftLowCut.setBypassed<0>(true); leftLowCut.setBypassed<1>(true); leftLowCut.setBypassed<2>(true); leftLowCut.setBypassed<3>(true); switch ( chainSettings.lowCutSlope ) { case Slope_12: *leftLowCut.get<0>().coefficients = *cutCoefficients[0]; leftLowCut.setBypassed<0>(false); break; case Slope_24: *leftLowCut.get<0>().coefficients = *cutCoefficients[0]; leftLowCut.setBypassed<0>(false); *leftLowCut.get<1>().coefficients = *cutCoefficients[1]; leftLowCut.setBypassed<1>(false); break; case Slope_36: *leftLowCut.get<0>().coefficients = *cutCoefficients[0]; leftLowCut.setBypassed<0>(false); *leftLowCut.get<1>().coefficients = *cutCoefficients[1]; leftLowCut.setBypassed<1>(false); *leftLowCut.get<2>().coefficients = *cutCoefficients[2]; leftLowCut.setBypassed<2>(false); break; case Slope_48: *leftLowCut.get<0>().coefficients = *cutCoefficients[0]; leftLowCut.setBypassed<0>(false); *leftLowCut.get<1>().coefficients = *cutCoefficients[1]; leftLowCut.setBypassed<1>(false); *leftLowCut.get<2>().coefficients = *cutCoefficients[2]; leftLowCut.setBypassed<2>(false); *leftLowCut.get<3>().coefficients = *cutCoefficients[3]; leftLowCut.setBypassed<3>(false); break; default: break; } auto& rightLowCut = rightChain.get<ChainPositions::LowCut>(); rightLowCut.setBypassed<0>(true); rightLowCut.setBypassed<1>(true); rightLowCut.setBypassed<2>(true); rightLowCut.setBypassed<3>(true); switch ( chainSettings.lowCutSlope ) { case Slope_12: *rightLowCut.get<0>().coefficients = *cutCoefficients[0]; rightLowCut.setBypassed<0>(false); break; case Slope_24: *rightLowCut.get<0>().coefficients = *cutCoefficients[0]; rightLowCut.setBypassed<0>(false); *rightLowCut.get<1>().coefficients = *cutCoefficients[1]; rightLowCut.setBypassed<1>(false); break; case Slope_36: *rightLowCut.get<0>().coefficients = *cutCoefficients[0]; rightLowCut.setBypassed<0>(false); *rightLowCut.get<1>().coefficients = *cutCoefficients[1]; rightLowCut.setBypassed<1>(false); *rightLowCut.get<2>().coefficients = *cutCoefficients[2]; rightLowCut.setBypassed<2>(false); break; case Slope_48: *rightLowCut.get<0>().coefficients = *cutCoefficients[0]; rightLowCut.setBypassed<0>(false); *rightLowCut.get<1>().coefficients = *cutCoefficients[1]; rightLowCut.setBypassed<1>(false); *rightLowCut.get<2>().coefficients = *cutCoefficients[2]; rightLowCut.setBypassed<2>(false); *rightLowCut.get<3>().coefficients = *cutCoefficients[3]; rightLowCut.setBypassed<3>(false); break; default: break; } juce::dsp::AudioBlock<float> block(buffer); auto leftBlock = block.getSingleChannelBlock(0); auto rightBlock = block.getSingleChannelBlock(1); juce::dsp::ProcessContextReplacing<float> leftContext(leftBlock); juce::dsp::ProcessContextReplacing<float> rightContext(rightBlock); leftChain.process(leftContext); rightChain.process(rightContext); } //============================================================================== bool SimpleEQAudioProcessor::hasEditor() const { return true; // (change this to false if you choose to not supply an editor) } juce::AudioProcessorEditor* SimpleEQAudioProcessor::createEditor() { // return new SimpleEQAudioProcessorEditor (*this); return new juce::GenericAudioProcessorEditor(*this); } //============================================================================== void SimpleEQAudioProcessor::getStateInformation (juce::MemoryBlock& destData) { // You should use this method to store your parameters in the memory block. // You could do that either as raw data, or use the XML or ValueTree classes // as intermediaries to make it easy to save and load complex data. } void SimpleEQAudioProcessor::setStateInformation (const void* data, int sizeInBytes) { // You should use this method to restore your parameters from this memory block, // whose contents will have been created by the getStateInformation() call. } ChainSettings getChainSettings(juce::AudioProcessorValueTreeState& apvts) { ChainSettings settings; settings.lowCutFreq = apvts.getRawParameterValue("LowCut Freq")->load(); settings.highCutFreq = apvts.getRawParameterValue("HighCut Freq")->load(); settings.peakFreq = apvts.getRawParameterValue("Peak Freq")->load(); settings.peakGainInDecibels = apvts.getRawParameterValue("Peak Gain")->load(); settings.peakQuality = apvts.getRawParameterValue("Peak Quality")->load(); settings.lowCutSlope = static_cast<Slope>(apvts.getRawParameterValue("LowCut Slope")->load()); settings.highCutSlope = static_cast<Slope>(apvts.getRawParameterValue("HighCut Slope")->load()); return settings; } void SimpleEQAudioProcessor::updatePeakFilter(<#const ChainSettings &chainSettings#>) { auto peakCoefficients = juce::dsp::IIR::Coefficients<float>::makePeakFilter(getSampleRate(), chainSettings.peakFreq, chainSettings.peakQuality, juce::Decibels::decibelsToGain(chainSettings.peakGainInDecibels)); *leftChain.get<ChainPositions::Peak>().coefficients = *peakCoefficients; *rightChain.get<ChainPositions::Peak>().coefficients = *peakCoefficients; } juce::AudioProcessorValueTreeState::ParameterLayout SimpleEQAudioProcessor::createParameterLayout() { juce::AudioProcessorValueTreeState::ParameterLayout layout; layout.add(std::make_unique<juce::AudioParameterFloat>("LowCut Freq", "LowCut Freq", juce::NormalisableRange<float>(20.f, 20000.f, 1.f, 0.25f), 20.f)); layout.add(std::make_unique<juce::AudioParameterFloat>("HighCut Freq", "HighCut Freq", juce::NormalisableRange<float>(20.f, 20000.f, 1.f, 0.25f), 20000.f)); layout.add(std::make_unique<juce::AudioParameterFloat>("Peak Freq", "Peak Freq", juce::NormalisableRange<float>(20.f, 20000.f, 1.f, 0.25f), 750.f)); layout.add(std::make_unique<juce::AudioParameterFloat>("Peak Gain", "Peak Gain", juce::NormalisableRange<float>(-24.f, 24.f, 0.5f, 1.f), 0.0f)); layout.add(std::make_unique<juce::AudioParameterFloat>("Peak Quality", "Peak Quality", juce::NormalisableRange<float>(0.1f, 10.f, 0.05f, 1.f), 1.f)); juce::StringArray stringArray; for ( int i = 0; i < 4; ++i ) { juce::String str; str << (12 + i*12); str << " db/Oct"; stringArray.add(str); } layout.add(std::make_unique<juce::AudioParameterChoice>("LowCut Slope", "LowCut Slope", stringArray, 0)); layout.add(std::make_unique<juce::AudioParameterChoice>("HighCut Slope", "HighCut Slope", stringArray, 0)); return layout; } //============================================================================== // This creates new instances of the plugin.. juce::AudioProcessor* JUCE_CALLTYPE createPluginFilter() { return new SimpleEQAudioProcessor(); }
[ "nazar.malyy@gmail.com" ]
nazar.malyy@gmail.com
8bac48b5d05d96c70b0649232fc7ad897abd9295
31315e3a4d29eda95db818b32a78ddeff452ee04
/Codeforces/484A.cpp
bc2a0eda157312a11d9c5a58af7e20643deaeecf
[]
no_license
trunghai95/MyCPCodes
c3cb002308e522ab859fb8753f3b7c63cef29a6f
4f7a339dd3841dfc54d18ec446effa8641d9bd37
refs/heads/master
2022-12-12T22:52:26.120067
2022-12-03T04:36:13
2022-12-03T04:36:13
47,124,575
1
1
null
null
null
null
UTF-8
C++
false
false
714
cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; int test; ll a, b, res; int popcount(ll x) { int res = 0; while (x) { if (x&1) ++res; x >>= 1; } return res; } bool getbit(ll x, int pos) { return ((x >> pos) & 1) != 0; } int main() { scanf("%d", &test); while (test--) { scanf("%lld %lld", &a, &b); if (a == b) { printf("%lld\n", a); continue; } res = 0; int pos = 62; while (pos >= 0) { bool bit = getbit(a, pos); if (bit == getbit(b, pos)) { if (bit) res |= (1LL << pos); } else { res |= ((1LL << pos) - 1); break; } --pos; } if (popcount(res) < popcount(b)) res = b; printf("%lld\n", res); } return 0; }
[ "bthai.1995@gmail.com" ]
bthai.1995@gmail.com
4ceb3929c368b31e53b55944e2adfc354ab70e93
b1aea6dcf4973007afe90ad554416f39702c01f0
/Line.cpp
022d6bf22df7677545256dfbe23f2e97d1ab7b79
[]
no_license
yichangliao/DrawSquares
1c885ee8d915145054827291f1302baa812bd157
c49558d7b59d40c6cd5d96f3f90b4b89f13d6f12
refs/heads/main
2023-03-24T13:01:13.335150
2021-03-16T03:41:36
2021-03-16T03:41:36
348,200,229
0
0
null
null
null
null
UTF-8
C++
false
false
1,015
cpp
/******************************************************************************* ** Author: Yi Chang Liao ** Date: 12/08/2019 ** Description: Line.hpp is the Line object implementation file ** It contains: ** (1). member initialized constructor ** (2). virtual function for object to interact ** (3). *******************************************************************************/ #include "Line.hpp" #include <iostream> /******************************************************************************* ** Description: member initialized constructor. *******************************************************************************/ Line::Line(int x_t, int y_t): Space('+', x_t, y_t) { } /******************************************************************************* ** Description: function for object to interact *******************************************************************************/ void Line::interact() { std::cout<<"drawing"<<std::endl; }
[ "noreply@github.com" ]
noreply@github.com
e82c4bdb63b5acb6b5d4a79b5577baf7fe9eb484
ad74f7a42e8dec14ec7576252fcbc3fc46679f27
/WinMxDC/TAsyncSocket2.h
845757ac9bce74b89ab04fbd1d8e9e2bfc89f50a
[]
no_license
radtek/TrapperKeeper
56fed7afa259aee20d6d81e71e19786f2f0d9418
63f87606ae02e7c29608fedfdf8b7e65339b8e9a
refs/heads/master
2020-05-29T16:49:29.708375
2013-05-15T08:33:23
2013-05-15T08:33:23
null
0
0
null
null
null
null
UTF-8
C++
false
false
186
h
// TAsyncSocket2.h #ifndef T_ASYNC_SOCKET2_H #define T_ASYNC_SOCKET2_H #include "WAsyncSocket2.h" class TAsyncSocket2 : public WAsyncSocket2 { public: }; #endif // T_ASYNC_SOCKET2_H
[ "occupymyday@gmail.com" ]
occupymyday@gmail.com
b48e9257a2bc4ee354984564c3a72749e7dd0a5b
55e66aa5e9f7d5b5dbdc7ab9b485d500f8665835
/js_airsim_to_ros_library/include/js_airsim_to_ros_library/time_generated.h
005096c90acabc6fc1ea097360bb1275291ec16c
[ "MIT" ]
permissive
caomw/RecursiveStereoUAV
9b34d6e1f5a4bd78790e3b238d68d2e9a4c4dfa9
61294da9ae889156aad26540a22c900bac8d393e
refs/heads/master
2021-07-16T15:53:12.900687
2017-10-23T20:19:28
2017-10-23T20:19:28
null
0
0
null
null
null
null
UTF-8
C++
false
false
883
h
// automatically generated by the FlatBuffers compiler, do not modify #ifndef FLATBUFFERS_GENERATED_TIME_AIRSIM_TO_ROS_H_ #define FLATBUFFERS_GENERATED_TIME_AIRSIM_TO_ROS_H_ #include "flatbuffers/flatbuffers.h" namespace airsim_to_ros { struct time; MANUALLY_ALIGNED_STRUCT(4) time FLATBUFFERS_FINAL_CLASS { private: uint32_t sec_; uint32_t nsec_; public: time() { memset(this, 0, sizeof(time)); } time(const time &_o) { memcpy(this, &_o, sizeof(time)); } time(uint32_t _sec, uint32_t _nsec) : sec_(flatbuffers::EndianScalar(_sec)), nsec_(flatbuffers::EndianScalar(_nsec)) { } uint32_t sec() const { return flatbuffers::EndianScalar(sec_); } uint32_t nsec() const { return flatbuffers::EndianScalar(nsec_); } }; STRUCT_END(time, 8); } // namespace airsim_to_ros #endif // FLATBUFFERS_GENERATED_TIME_AIRSIM_TO_ROS_H_
[ "jonathan.schmalhofer@mytum.de" ]
jonathan.schmalhofer@mytum.de
f96a34e5171779dbb20f9c72d97b2dab8fc96737
ed7d7ef502f31f645506658e031ea228dc409729
/LCD/LCD_4bouttons_et_modification_var/LCD_25052021.ino
bf22641a715f52c3b43d2e889ec53e3c0ad2309f
[]
no_license
rc-enseignant/maquettemoteur
f20afed4425e052fc08fbd5981e5d509207d06dd
1e6bf6ad54d2d74039038dd7d0b53854646c72a8
refs/heads/main
2023-06-04T06:53:44.970753
2021-06-21T16:30:28
2021-06-21T16:30:28
null
0
0
null
null
null
null
UTF-8
C++
false
false
4,206
ino
#include <LCD16x2.h> #include <Wire.h> ///////////// Attention code adapté pour le LCD OLIMEX 16x2 int page = 1; boolean didMyOneTimeAction = false; LCD16x2 lcd; int buttons; const int Broche_BP_HAUT = 13; const int Broche_BP_BAS = 14; unsigned int RPM; int Temp; int Injection = 500; int Aallumage = 17000; int Reglage = 0; int Tempo = 3000; unsigned int Tempo2 = 5000; unsigned long Temps_Actuel; unsigned long Temps_Precedent = 0; unsigned long Temps_Precedent2 = 0; void setup() { Wire.begin(); Serial.begin(9600); } void loop() { // Serial.print("Tps_Actuel :"); Serial.print(Temps_Actuel); // Serial.print(" Tps_Precedent :"); Serial.print(Temps_Precedent); Temps_Actuel = millis(); buttons = lcd.readButtons(); Tempo2 = 7000; if(buttons == 14){ lcd.lcdClear(); page = 1; } if(buttons == 13){ lcd.lcdClear(); page = 2; } if(buttons == 11){ lcd.lcdClear(); page = 3; } if (page == 3){ lcd.lcdGoToXY(1,1); lcd.lcdWrite("VITESSE:"); lcd.lcdGoToXY(10,1); lcd.lcdWrite(RPM); lcd.lcdGoToXY(1,2); lcd.lcdWrite("TEMPERATURE:"); lcd.lcdGoToXY(13,2); lcd.lcdWrite(Temp); } if (page == 1) { buttons = lcd.readButtons(); /////////////////////////////PAGE 1 ////////////////////////////////////////////////////// //lcd.clear(); lcd.lcdGoToXY(1,1); lcd.lcdWrite("INJECTION:"); lcd.lcdGoToXY(11,1); lcd.lcdWrite(Injection); if ((buttons == 12) && (Temps_Actuel - Temps_Precedent >= Tempo)) { Temps_Precedent = Temps_Actuel; Temps_Precedent2 = Temps_Actuel; Reglage = 1; while (Reglage == 1) { buttons = lcd.readButtons(); Serial.println(Tempo2); if ( buttons == 13) { Injection = Injection + 10; Tempo2 = Tempo2 + 300; } if ( buttons == 14) { Injection = Injection - 10; Tempo2 = Tempo2 + 300; } if ( buttons == 7) { Injection = Injection + 100; Tempo2 = Tempo2 + 2000; } if ( buttons == 11) { Injection = Injection - 100; Tempo2 = Tempo2 + 2000; } // lcd.lcdClear(); lcd.lcdGoToXY(1,1); lcd.lcdWrite("INJECTION:"); lcd.lcdGoToXY(11,1); lcd.lcdWrite(Injection); lcd.lcdGoToXY(1,2); lcd.lcdWrite("REGLAGE"); Temps_Actuel = millis(); if (Temps_Actuel - Temps_Precedent2 >= Tempo2) { Reglage = 0; lcd.lcdClear(); Tempo2 = 7000; break; } } Temps_Precedent = Temps_Actuel; Temps_Precedent2 = Temps_Actuel; } } if (page == 2) { buttons = lcd.readButtons(); //////////////////////////PAGE 2 ////////////////////////////////// //lcd.clear(); lcd.lcdGoToXY(1,1); lcd.lcdWrite("AALLUMAGE:"); lcd.lcdGoToXY(11,1); lcd.lcdWrite(Aallumage); if ((buttons == 12) && (Temps_Actuel - Temps_Precedent >= Tempo)) { Temps_Precedent = Temps_Actuel; Temps_Precedent2 = Temps_Actuel; Reglage = 1; while (Reglage == 1) { buttons = lcd.readButtons(); Serial.println(Tempo2); if ( buttons == 13) { Aallumage = Aallumage + 25; Tempo2 = Tempo2 + 300; } if ( buttons == 14) { Aallumage = Aallumage - 25; Tempo2 = Tempo2 + 300; } if ( buttons == 7) { Aallumage = Aallumage + 500; Tempo2 = Tempo2 + 2000; } if ( buttons == 11) { Aallumage = Aallumage - 500; Tempo2 = Tempo2 + 2000; } // lcd.lcdClear(); lcd.lcdGoToXY(1,1); lcd.lcdWrite("AALLUMAGE:"); lcd.lcdGoToXY(11,1); lcd.lcdWrite(Aallumage); lcd.lcdGoToXY(1,2); lcd.lcdWrite("REGLAGE"); Temps_Actuel = millis(); if (Temps_Actuel - Temps_Precedent2 >= Tempo2) { Reglage = 0; lcd.lcdClear(); Tempo2 = 7000; break; } } Temps_Precedent = Temps_Actuel; Temps_Precedent2 = Temps_Actuel; } } //////////////////////////////////////////////////////////////////////// }
[ "noreply@github.com" ]
noreply@github.com
cd61c3a034bbff68374bb69a01849a4888a84dd0
f5d3f15095860bd6b56e22dc1e692b4a6cee084e
/src/qt/test/uritests.cpp
738a7a31392dbcf302a588357f5b6321aa26d881
[ "MIT" ]
permissive
modcrypto/brofist
052d23c20692ea49d0236470b59d549a2d0133f5
6019a1d6a9753071b73de4509943fcc605b698ee
refs/heads/master
2020-03-08T03:17:12.693725
2018-08-31T14:25:46
2018-08-31T14:25:46
127,886,344
2
2
MIT
2018-07-24T11:47:01
2018-04-03T09:44:37
C++
UTF-8
C++
false
false
4,299
cpp
// Copyright (c) 2009-2014 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "uritests.h" #include "guiutil.h" #include "walletmodel.h" #include <QUrl> void URITests::uriTests() { SendCoinsRecipient rv; QUrl uri; uri.setUrl(QString("brofist:XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg?req-dontexist=")); QVERIFY(!GUIUtil::parseBitcoinURI(uri, &rv)); uri.setUrl(QString("brofist:XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg?dontexist=")); QVERIFY(GUIUtil::parseBitcoinURI(uri, &rv)); QVERIFY(rv.address == QString("XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg")); QVERIFY(rv.label == QString()); QVERIFY(rv.amount == 0); uri.setUrl(QString("brofist:XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg?label=Some Example Address")); QVERIFY(GUIUtil::parseBitcoinURI(uri, &rv)); QVERIFY(rv.address == QString("XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg")); QVERIFY(rv.label == QString("Some Example Address")); QVERIFY(rv.amount == 0); uri.setUrl(QString("brofist:XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg?amount=0.001")); QVERIFY(GUIUtil::parseBitcoinURI(uri, &rv)); QVERIFY(rv.address == QString("XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg")); QVERIFY(rv.label == QString()); QVERIFY(rv.amount == 100000); uri.setUrl(QString("brofist:XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg?amount=1.001")); QVERIFY(GUIUtil::parseBitcoinURI(uri, &rv)); QVERIFY(rv.address == QString("XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg")); QVERIFY(rv.label == QString()); QVERIFY(rv.amount == 100100000); uri.setUrl(QString("brofist:XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg?amount=100&label=Some Example")); QVERIFY(GUIUtil::parseBitcoinURI(uri, &rv)); QVERIFY(rv.address == QString("XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg")); QVERIFY(rv.amount == 10000000000LL); QVERIFY(rv.label == QString("Some Example")); uri.setUrl(QString("brofist:XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg?message=Some Example Address")); QVERIFY(GUIUtil::parseBitcoinURI(uri, &rv)); QVERIFY(rv.address == QString("XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg")); QVERIFY(rv.label == QString()); QVERIFY(GUIUtil::parseBitcoinURI("brofist://XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg?message=Some Example Address", &rv)); QVERIFY(rv.address == QString("XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg")); QVERIFY(rv.label == QString()); uri.setUrl(QString("brofist:XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg?req-message=Some Example Address")); QVERIFY(GUIUtil::parseBitcoinURI(uri, &rv)); uri.setUrl(QString("brofist:XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg?amount=1,000&label=Some Example")); QVERIFY(!GUIUtil::parseBitcoinURI(uri, &rv)); uri.setUrl(QString("brofist:XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg?amount=1,000.0&label=Some Example")); QVERIFY(!GUIUtil::parseBitcoinURI(uri, &rv)); uri.setUrl(QString("brofist:XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg?amount=100&label=Some Example&message=Some Example Message&IS=1")); QVERIFY(GUIUtil::parseBitcoinURI(uri, &rv)); QVERIFY(rv.address == QString("XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg")); QVERIFY(rv.amount == 10000000000LL); QVERIFY(rv.label == QString("Some Example")); QVERIFY(rv.message == QString("Some Example Message")); QVERIFY(rv.fUseInstantSend == 1); uri.setUrl(QString("brofist:XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg?amount=100&label=Some Example&message=Some Example Message&IS=Something Invalid")); QVERIFY(GUIUtil::parseBitcoinURI(uri, &rv)); QVERIFY(rv.address == QString("XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg")); QVERIFY(rv.amount == 10000000000LL); QVERIFY(rv.label == QString("Some Example")); QVERIFY(rv.message == QString("Some Example Message")); QVERIFY(rv.fUseInstantSend != 1); uri.setUrl(QString("brofist:XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg?IS=1")); QVERIFY(GUIUtil::parseBitcoinURI(uri, &rv)); QVERIFY(rv.fUseInstantSend == 1); uri.setUrl(QString("brofist:XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg?IS=0")); QVERIFY(GUIUtil::parseBitcoinURI(uri, &rv)); QVERIFY(rv.fUseInstantSend != 1); uri.setUrl(QString("brofist:XwnLY9Tf7Zsef8gMGL2fhWA9ZmMjt4KPwg")); QVERIFY(GUIUtil::parseBitcoinURI(uri, &rv)); QVERIFY(rv.fUseInstantSend != 1); }
[ "admin@brofistcoin.su" ]
admin@brofistcoin.su
c589226fdcf2c685cf5c21201b6e775272ac909d
ff404ad7e3c5b2a76c72229b285877615ae3aadc
/cutlass/tools/profiler/src/cublas_helpers.h
6bb2f4e94b02ad6ab71d306301164021113fc5bf
[ "BSD-3-Clause" ]
permissive
HenryYihengXu/cuda
80ac34e1853aa2a5127c7519500bd521fb953363
6290b46752b7f2db9ed93ba4004d18c7d7bdd63e
refs/heads/master
2020-08-13T07:05:15.181009
2019-12-15T01:46:45
2019-12-15T01:46:45
214,928,446
0
0
null
null
null
null
UTF-8
C++
false
false
3,859
h
/*************************************************************************************************** * Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are permitted * provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright notice, this list of * conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * Neither the name of the NVIDIA CORPORATION nor the names of its contributors may be used * to endorse or promote products derived from this software without specific prior written * permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TOR (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * **************************************************************************************************/ /* \file \brief Helper functions for mapping CUTLASS concepts to cuBLAS. */ #pragma once #if CUTLASS_ENABLE_CUBLAS #include <cublas_v2.h> #include "cutlass/cutlass.h" #include "cutlass/library/library.h" ///////////////////////////////////////////////////////////////////////////////////////////////// namespace cutlass { namespace profiler { ///////////////////////////////////////////////////////////////////////////////////////////////// /// Converts a cuBLAS status to cutlass::Status Status get_cutlass_status(cublasStatus_t cublas); /// Maps a CUTLASS tensor layout to a cuBLAS transpose operation cublasOperation_t get_cublas_transpose_operation(library::LayoutTypeID layout); /// Maps a CUTLASS numeric type to a cuBLAS data type enumeration bool get_cublas_datatype(cublasDataType_t &data_type, library::NumericTypeID element_type); /// Gets the cublas algorithm given threadblock tile dimensions and math opcode class cublasGemmAlgo_t get_cublas_gemm_algo( int cta_m, int cta_n, int cta_k, library::OpcodeClassID opcode_class); /// Returns a status if cuBLAS can satisfy a particular GEMM description Status cublas_satisfies(library::GemmDescription const &desc); /// This is a helper class to create cublasHandle_t automatically on CublasCreate object creation and /// to destroy cublasHandle_t on CublasCreate object destruction. /// Additionaly, it provides implicit cast from CublasCreate's object to cublasHandle_t's object class CublasCreate { private: cublasHandle_t handle; cublasStatus_t status; public: CublasCreate() { status = cublasCreate(&handle); } ~CublasCreate() { cublasDestroy(handle); } /// Implicit cast CublasCreate object to cublasHandle_t operator cublasHandle_t() const { return handle; } /// returns cublasStatus_t for handle creation cublasStatus_t get_cublas_create_status() { return status; } }; ///////////////////////////////////////////////////////////////////////////////////////////////// } // namespace profiler } // namespace cutlass #endif // #if CUTLASS_ENABLE_CUBLAS
[ "xu443@wisc.edu" ]
xu443@wisc.edu
3252dab422d5a13d3cf0e964d93e03745cdbdedf
b8bcfac790be34eeaf5527f912da54bbb2fc2d48
/Tests/GPU/CudaGraphs/BuildingGraphs/main.cpp
a3dfadf6b7367ee8d32f0205c1e3cb19a625e4b9
[ "BSD-2-Clause" ]
permissive
zetwal/amrex
cabfbf636b5078e55170fa46e46d2d797034d04c
95995073ff23e4051330c9f96fd2d195d77b9468
refs/heads/master
2021-01-03T01:32:23.724017
2020-02-03T17:12:48
2020-02-03T17:12:48
239,858,821
1
0
NOASSERTION
2020-02-11T20:33:51
2020-02-11T20:33:50
null
UTF-8
C++
false
false
18,793
cpp
#include <AMReX.H> #include <AMReX_ParmParse.H> #include <AMReX_MultiFab.H> using namespace amrex; // MFIterLoop // Written as a seperate function for easy changes/testing. void MFIterLoopFunc(const Box &bx, double* val, Array4<Real> &a) { amrex::ParallelFor(bx, [=] AMREX_GPU_DEVICE (int i, int j, int k) { a(i,j,k) = *val; }); } // &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& int main (int argc, char* argv[]) { amrex::Initialize(argc, argv); amrex::Gpu::GraphSafeGuard gpu_gsg(true); { amrex::Print() << "amrex::Initialize complete." << "\n"; // AMREX_SPACEDIM: number of dimensions int n_cell, max_grid_size, Nghost, Ncomp; Vector<int> is_periodic(AMREX_SPACEDIM,1); // periodic in all direction by default // inputs parameters { // ParmParse is way of reading inputs from the inputs file ParmParse pp; // We need to get n_cell from the inputs file - this is the number of cells on each side of // a square (or cubic) domain. pp.get("n_cell",n_cell); // The domain is broken into boxes of size max_grid_size pp.get("max_grid_size",max_grid_size); // The domain is broken into boxes of size max_grid_size Nghost = 0; pp.query("nghost", Nghost); Ncomp = 1; pp.query("ncomp", Ncomp); } // make BoxArray and Geometry BoxArray ba; { IntVect dom_lo(AMREX_D_DECL( 0, 0, 0)); IntVect dom_hi(AMREX_D_DECL(n_cell-1, n_cell-1, n_cell-1)); Box domain(dom_lo, dom_hi); // Initialize the boxarray "ba" from the single box "bx" ba.define(domain); // Break up boxarray "ba" into chunks no larger than "max_grid_size" along a direction ba.maxSize(max_grid_size); } // How Boxes are distrubuted among MPI processes DistributionMapping dm(ba); // Malloc value for setval testing. Real* val; cudaMallocManaged(&val, sizeof(Real)); *val = 0.0; // Create the MultiFab and touch the data. // Ensures the data in on the GPU for all further testing. MultiFab x(ba, dm, Ncomp, Nghost); x.setVal(*val); amrex::Print() << "Number of boxes = " << x.size() << std::endl << std::endl; Real points = ba.numPts(); // &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& // Initial launch to remove any unknown costs in HtoD setup. { BL_PROFILE("Initial"); *val = 0.42; for (MFIter mfi(x); mfi.isValid(); ++mfi) { const Box bx = mfi.validbox(); Array4<Real> a = x.array(mfi); MFIterLoopFunc(bx, val, a); } amrex::Print() << "Initial sum = " << x.sum() << ". Expected = " << points*(*val) << std::endl; } // &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& // Launch without graphs { BL_PROFILE("Standard"); *val = 1.0; for (MFIter mfi(x); mfi.isValid(); ++mfi) { const Box bx = mfi.validbox(); Array4<Real> a = x.array(mfi); MFIterLoopFunc(bx, val, a); } amrex::Print() << "No Graph sum = " << x.sum() << ". Expected = " << points*(*val) << std::endl; } // &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& // Create one graph per MFIter iteration and execute them. { BL_PROFILE("IterPerGraph"); *val = 2.0; BL_PROFILE_VAR("CREATE: IterPerGraph", cgc); cudaGraph_t graph[x.local_size()]; cudaGraphExec_t graphExec[x.local_size()]; for (MFIter mfi(x); mfi.isValid(); ++mfi) { #if (__CUDACC_VER_MAJOR__ == 10) && (__CUDACC_VER_MINOR__ == 0) AMREX_GPU_SAFE_CALL(cudaStreamBeginCapture(amrex::Gpu::Device::cudaStream())); #else AMREX_GPU_SAFE_CALL(cudaStreamBeginCapture(amrex::Gpu::Device::cudaStream(), cudaStreamCaptureModeGlobal)); #endif const Box bx = mfi.validbox(); Array4<Real> a = x.array(mfi); MFIterLoopFunc(bx, val, a); AMREX_GPU_SAFE_CALL(cudaStreamEndCapture(amrex::Gpu::Device::cudaStream(), &(graph[mfi.LocalIndex()]))); } BL_PROFILE_VAR_STOP(cgc); BL_PROFILE_VAR("INSTANTIATE: IterPerGraph", cgi); for (int i = 0; i<x.local_size(); ++i) { AMREX_GPU_SAFE_CALL(cudaGraphInstantiate(&graphExec[i], graph[i], NULL, NULL, 0)); } BL_PROFILE_VAR_STOP(cgi); BL_PROFILE_VAR("LAUNCH: IterPerGraph", cgl); for (MFIter mfi(x); mfi.isValid(); ++mfi) { AMREX_GPU_SAFE_CALL(cudaGraphLaunch(graphExec[mfi.LocalIndex()], amrex::Gpu::Device::cudaStream())); } amrex::Gpu::Device::synchronize(); BL_PROFILE_VAR_STOP(cgl); amrex::Print() << "Graph-per-iter sum = " << x.sum() << ". Expected = " << points*(*val) << std::endl; } // &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& // Create one graph per CUDA stream and execute them. { BL_PROFILE("StreamPerGraph"); *val = 3.0; BL_PROFILE_VAR("CREATE: StreamPerGraph", cgc); cudaGraph_t graph[amrex::Gpu::numGpuStreams()]; cudaGraphExec_t graphExec[amrex::Gpu::numGpuStreams()]; for (MFIter mfi(x); mfi.isValid(); ++mfi) { if (mfi.LocalIndex() == 0) { for (int i=0; i<amrex::Gpu::numGpuStreams(); ++i) { amrex::Gpu::Device::setStreamIndex(i); #if (__CUDACC_VER_MAJOR__ == 10) && (__CUDACC_VER_MINOR__ == 0) AMREX_GPU_SAFE_CALL(cudaStreamBeginCapture(amrex::Gpu::Device::cudaStream())); #else AMREX_GPU_SAFE_CALL(cudaStreamBeginCapture(amrex::Gpu::Device::cudaStream(), cudaStreamCaptureModeGlobal)); #endif } amrex::Gpu::Device::setStreamIndex(mfi.tileIndex()); } // .................. const Box bx = mfi.validbox(); Array4<Real> a = x.array(mfi); MFIterLoopFunc(bx, val, a); // .................. if (mfi.LocalIndex() == (x.local_size() - 1) ) { for (int i=0; i<amrex::Gpu::numGpuStreams(); ++i) { amrex::Gpu::Device::setStreamIndex(i); AMREX_GPU_SAFE_CALL(cudaStreamEndCapture(amrex::Gpu::Device::cudaStream(), &(graph[i]))); } } } BL_PROFILE_VAR_STOP(cgc); BL_PROFILE_VAR("INSTANTIATE: StreamPerGraph", cgi); for (int i = 0; i<amrex::Gpu::numGpuStreams(); ++i) { AMREX_GPU_SAFE_CALL(cudaGraphInstantiate(&graphExec[i], graph[i], NULL, NULL, 0)); } BL_PROFILE_VAR_STOP(cgi); BL_PROFILE_VAR("LAUNCH: StreamPerGraph", cgl); for (int i = 0; i<amrex::Gpu::numGpuStreams(); ++i) { amrex::Gpu::Device::setStreamIndex(i); AMREX_GPU_SAFE_CALL(cudaGraphLaunch(graphExec[i], amrex::Gpu::Device::cudaStream())); } amrex::Gpu::Device::synchronize(); amrex::Gpu::Device::resetStreamIndex(); BL_PROFILE_VAR_STOP(cgl); amrex::Print() << "Graph-per-stream sum = " << x.sum() << ". Expected = " << points*(*val) << std::endl; } // &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& // Create a single graph for the MFIter loop: // an empty node at the start linked to each individually captured stream graph. { BL_PROFILE("IterGraph"); *val = 4.0; BL_PROFILE_VAR("CREATE: IterGraph", cgc); cudaGraph_t graph[x.local_size()]; cudaGraphExec_t graphExec; for (MFIter mfi(x); mfi.isValid(); ++mfi) { #if (__CUDACC_VER_MAJOR__ == 10) && (__CUDACC_VER_MINOR__ == 0) AMREX_GPU_SAFE_CALL(cudaStreamBeginCapture(amrex::Gpu::Device::cudaStream())); #else AMREX_GPU_SAFE_CALL(cudaStreamBeginCapture(amrex::Gpu::Device::cudaStream(), cudaStreamCaptureModeGlobal)); #endif // .................. const Box bx = mfi.validbox(); Array4<Real> a = x.array(mfi); MFIterLoopFunc(bx, val, a); // .................. AMREX_GPU_SAFE_CALL(cudaStreamEndCapture(amrex::Gpu::Device::cudaStream(), &(graph[mfi.LocalIndex()]))); } cudaGraph_t graphFull; cudaGraphNode_t emptyNode, placeholder; AMREX_GPU_SAFE_CALL(cudaGraphCreate(&graphFull, 0)); AMREX_GPU_SAFE_CALL(cudaGraphAddEmptyNode(&emptyNode, graphFull, &placeholder, 0)); for (int i=0; i<x.local_size(); ++i) { AMREX_GPU_SAFE_CALL(cudaGraphAddChildGraphNode(&placeholder, graphFull, &emptyNode, 1, graph[i])); } BL_PROFILE_VAR_STOP(cgc); BL_PROFILE_VAR("INSTANTIATE: IterGraph", cgi); AMREX_GPU_SAFE_CALL(cudaGraphInstantiate(&graphExec, graphFull, NULL, NULL, 0)); BL_PROFILE_VAR_STOP(cgi); BL_PROFILE_VAR("LAUNCH: IterGraph", cgl); amrex::Gpu::Device::setStreamIndex(0); AMREX_GPU_SAFE_CALL(cudaGraphLaunch(graphExec, amrex::Gpu::Device::cudaStream())); AMREX_GPU_SAFE_CALL(cudaGraphDestroy(graphFull)); amrex::Gpu::Device::synchronize(); amrex::Gpu::Device::resetStreamIndex(); BL_PROFILE_VAR_STOP(cgl); amrex::Print() << "Full-graph-iter sum = " << x.sum() << ". Expected = " << points*(*val) << std::endl; } // &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& // Create a single graph for the MFIter loop: // an empty node at the start linked to each individually captured stream graph. { BL_PROFILE("StreamGraph"); *val = 5.0; BL_PROFILE_VAR("CREATE: StreamGraph", cgc); cudaGraph_t graph[amrex::Gpu::numGpuStreams()]; cudaGraphExec_t graphExec; cudaEvent_t memcpy_event = {0}; cudaEventCreate(&memcpy_event); for (MFIter mfi(x); mfi.isValid(); ++mfi) { if (mfi.LocalIndex() == 0) { for (int i=0; i<amrex::Gpu::numGpuStreams(); ++i) { amrex::Gpu::Device::setStreamIndex(i); #if (__CUDACC_VER_MAJOR__ == 10) && (__CUDACC_VER_MINOR__ == 0) AMREX_GPU_SAFE_CALL(cudaStreamBeginCapture(amrex::Gpu::Device::cudaStream())); #else AMREX_GPU_SAFE_CALL(cudaStreamBeginCapture(amrex::Gpu::Device::cudaStream(), cudaStreamCaptureModeGlobal)); #endif } amrex::Gpu::Device::setStreamIndex(mfi.tileIndex()); } // .................. const Box bx = mfi.validbox(); Array4<Real> a = x.array(mfi); MFIterLoopFunc(bx, val, a); // .................. if (mfi.LocalIndex() == (x.local_size() - 1) ) { for (int i=0; i<amrex::Gpu::numGpuStreams(); ++i) { amrex::Gpu::Device::setStreamIndex(i); AMREX_GPU_SAFE_CALL(cudaStreamEndCapture(amrex::Gpu::Device::cudaStream(), &(graph[i]))); } } } cudaGraph_t graphFull; cudaGraphNode_t emptyNode, placeholder; AMREX_GPU_SAFE_CALL(cudaGraphCreate(&graphFull, 0)); AMREX_GPU_SAFE_CALL(cudaGraphAddEmptyNode(&emptyNode, graphFull, &placeholder, 0)); for (int i=0; i<amrex::Gpu::numGpuStreams(); ++i) { AMREX_GPU_SAFE_CALL(cudaGraphAddChildGraphNode(&placeholder, graphFull, &emptyNode, 1, graph[i])); } BL_PROFILE_VAR_STOP(cgc); BL_PROFILE_VAR("INSTANTIATE: StreamGraph", cgi); AMREX_GPU_SAFE_CALL(cudaGraphInstantiate(&graphExec, graphFull, NULL, NULL, 0)); BL_PROFILE_VAR_STOP(cgi); BL_PROFILE_VAR("LAUNCH: StreamGraph", cgl); amrex::Gpu::Device::setStreamIndex(0); AMREX_GPU_SAFE_CALL(cudaGraphLaunch(graphExec, amrex::Gpu::Device::cudaStream())); AMREX_GPU_SAFE_CALL(cudaGraphDestroy(graphFull)); amrex::Gpu::Device::synchronize(); amrex::Gpu::Device::resetStreamIndex(); BL_PROFILE_VAR_STOP(cgl); amrex::Print() << "Linked-graph-stream sum = " << x.sum() << ". Expected = " << points*(*val) << std::endl; } // &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& { BL_PROFILE("Indep - Streamless"); *val = 6.0; BL_PROFILE_VAR("CREATE: Indep - Streamless", cgc); cudaGraph_t graph[x.local_size()]; cudaGraphExec_t graphExec; for (MFIter mfi(x); mfi.isValid(); ++mfi) { amrex::Gpu::Device::setStreamIndex(0); #if (__CUDACC_VER_MAJOR__ == 10) && (__CUDACC_VER_MINOR__ == 0) AMREX_GPU_SAFE_CALL(cudaStreamBeginCapture(amrex::Gpu::Device::cudaStream())); #else AMREX_GPU_SAFE_CALL(cudaStreamBeginCapture(amrex::Gpu::Device::cudaStream(), cudaStreamCaptureModeGlobal)); #endif // .................. const Box bx = mfi.validbox(); Array4<Real> a = x.array(mfi); MFIterLoopFunc(bx, val, a); // .................. AMREX_GPU_SAFE_CALL(cudaStreamEndCapture(amrex::Gpu::Device::cudaStream(), &(graph[mfi.LocalIndex()]))); } cudaGraph_t graphFull; cudaGraphNode_t emptyNode, placeholder; AMREX_GPU_SAFE_CALL(cudaGraphCreate(&graphFull, 0)); AMREX_GPU_SAFE_CALL(cudaGraphAddEmptyNode(&emptyNode, graphFull, &placeholder, 0)); for (int i=0; i<x.local_size(); ++i) { AMREX_GPU_SAFE_CALL(cudaGraphAddChildGraphNode(&placeholder, graphFull, &emptyNode, 1, graph[i])); } BL_PROFILE_VAR_STOP(cgc); BL_PROFILE_VAR("INSTANTIATE: Indep - Streamless", cgi); /* constexpr int log_size = 1028; char graph_log[log_size]; graph_log[0]='\0'; cudaGraphInstantiate(&graphExec, graphFull, NULL, &(graph_log[0]), log_size); amrex::Print() << graph_log << std::endl; AMREX_GPU_ERROR_CHECK(); */ AMREX_GPU_SAFE_CALL(cudaGraphInstantiate(&graphExec, graphFull, NULL, NULL, 0)); BL_PROFILE_VAR_STOP(cgi); BL_PROFILE_VAR("LAUNCH: Indep - Streamless", cgl); amrex::Gpu::Device::setStreamIndex(0); AMREX_GPU_SAFE_CALL(cudaGraphLaunch(graphExec, amrex::Gpu::Device::cudaStream())); AMREX_GPU_SAFE_CALL(cudaGraphDestroy(graphFull)); amrex::Gpu::Device::synchronize(); amrex::Gpu::Device::resetStreamIndex(); BL_PROFILE_VAR_STOP(cgl); amrex::Print() << "Full-graph-independent-streamless sum = " << x.sum() << ". Expected = " << points*(*val) << std::endl; } // &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& { BL_PROFILE("Depend - Streamless"); *val = 7.0; BL_PROFILE_VAR("CREATE: Depend - Streamless", cgc); cudaGraph_t graph; cudaGraphExec_t graphExec; for (MFIter mfi(x); mfi.isValid(); ++mfi) { amrex::Gpu::Device::setStreamIndex(0); if (mfi.LocalIndex() == 0) { #if (__CUDACC_VER_MAJOR__ == 10) && (__CUDACC_VER_MINOR__ == 0) AMREX_GPU_SAFE_CALL(cudaStreamBeginCapture(amrex::Gpu::Device::cudaStream())); #else AMREX_GPU_SAFE_CALL(cudaStreamBeginCapture(amrex::Gpu::Device::cudaStream(), cudaStreamCaptureModeGlobal)); #endif } // .................. const Box bx = mfi.validbox(); Array4<Real> a = x.array(mfi); MFIterLoopFunc(bx, val, a); // .................. if (mfi.LocalIndex() == (x.local_size() - 1) ) { amrex::Gpu::Device::setStreamIndex(0); AMREX_GPU_SAFE_CALL(cudaStreamEndCapture(amrex::Gpu::Device::cudaStream(), &graph)); } } BL_PROFILE_VAR_STOP(cgc); BL_PROFILE_VAR("INSTANTIATE: Depend - Streamless", cgi); AMREX_GPU_SAFE_CALL(cudaGraphInstantiate(&graphExec, graph, NULL, NULL, 0)); BL_PROFILE_VAR_STOP(cgi); BL_PROFILE_VAR("LAUNCH: Depend - Streamless", cgl); amrex::Gpu::Device::setStreamIndex(0); AMREX_GPU_SAFE_CALL(cudaGraphLaunch(graphExec, amrex::Gpu::Device::cudaStream())); amrex::Gpu::Device::synchronize(); amrex::Gpu::Device::resetStreamIndex(); BL_PROFILE_VAR_STOP(cgl); amrex::Print() << "Linked-graph-dependent-streamless sum = " << x.sum() << ". Expected = " << points*(*val) << std::endl; } // &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& amrex::Print() << "Test Completed." << std::endl; } amrex::Finalize(); }
[ "kngott@lbl.gov" ]
kngott@lbl.gov
705af56587c906812bca9808fe35aacf3d2ac9f0
3c339fa082b2ed728aa263d657aa4d23bee18d1e
/jni/game/commond.cpp
41b3bd385cfecece88b5592da9b9c2fadb4dcbcf
[]
no_license
Francklyi/Game-Shot
08cb173872ec9aa3492e1df91706c758c1c919ad
18d27fe044125e761fe2004d55b2bb05d7359cd1
refs/heads/master
2021-01-10T17:25:18.739544
2015-11-19T03:28:56
2015-11-19T03:28:56
46,415,996
0
0
null
null
null
null
UTF-8
C++
false
false
226
cpp
#include "commond.h" #include "TextureFactory.h" #include "Screen2d.h" void initEngine() { //glsl=new GLSL(); pRenderManager=new RenderManager(); pTexFactory=new TextureFactory(); pScreen2d=new Screen2d(); }
[ "linyu_45@126.com" ]
linyu_45@126.com
2e87068bc522729d121797160552a7171b2a0ed4
12a07fa356cc73ea3fe305633255206c64de9298
/Peter_v250_src/Loader/BufList.h
fd749db6008f067b217da85b078f0e3777bfe94d
[ "LicenseRef-scancode-unknown-license-reference", "BSD-3-Clause" ]
permissive
inferno986return/gemtree-peter-mirror
8982df1b77260aa83734589c814b67a5b36f780a
e9e9bac2f806a0f6b7107d5e68725d167c62dc73
refs/heads/master
2021-06-24T10:45:19.113511
2018-12-06T16:12:08
2018-12-06T16:12:08
160,628,335
7
1
null
null
null
null
WINDOWS-1250
C++
false
false
4,616
h
/***************************************************************************\ * * * Buffer seznamů * * * \***************************************************************************/ ///////////////////////////////////////////////////////////////////////////// // struktura prvku seznamu (16 Bajtů) typedef struct LISTDATA_ { long Index; // (4) aktuální index seznamu long Size; // (4) velikost seznamu (položek) long Auto; // (4) automatická inkrementace indexu long Res; // (4) ... rezerva } LISTDATA; class CBufList { // ------------------------- interní proměnné a funkce ---------------------- private: // proměnné LISTDATA* m_Data; // ukazatel na data int m_Num; // počet platných položek v bufferu int m_Max; // velikost bufferu (položek) // vytvoření nové položky inline int NewItem() { int i = m_Num; // počet položek if (i >= m_Max) // není další položka? { NewData(); // vytvoření nových dat } m_Num = i + 1; return i; }; // vytvoření nových dat (odděleno kvůli lepší optimalizaci) void NewData(); // ---------------------------- veřejné funkce ------------------------------ public: // konstruktor a destruktor CBufList(); ~CBufList(); // statický konstruktor a destruktor void Init(); // statický konstruktor void Term(); // statický destruktor // zrušení všech položek v bufferu void DelAll(); // poskytnutí bufferu dat inline LISTDATA* Data() const { return m_Data; }; // poskytnutí počtu platných položek v bufferu inline int Num() const { return m_Num; }; // poskytnutí velikosti bufferu inline int Max() const { return m_Max; }; // kontrola platnosti položky inline BOOL IsValid(const int index) const { return ((DWORD)index < (DWORD)m_Num); }; inline BOOL IsNotValid(const int index) const { return ((DWORD)index >= (DWORD)m_Num); }; // poskytnutí přístupu k položce (bez kontroly indexu) inline LISTDATA& operator[] (const int index) { ASSERT(IsValid(index)); return m_Data[index]; } inline const LISTDATA& operator[] (const int index) const { ASSERT(IsValid(index)); return m_Data[index]; } inline LISTDATA& At(const int index) { ASSERT(IsValid(index)); return m_Data[index]; } inline const LISTDATA& At(const int index) const { ASSERT(IsValid(index)); return m_Data[index]; } // zjištění aktuálního indexu seznamu inline const int _fastcall Inx(int index) { return m_Data[index].Index; } // automatická inkrementace indexu inline void _fastcall AutoInc(int index) { // adresa položky seznamu LISTDATA* list = m_Data + index; // test, zda bude inkrementace if (list->Auto != 0) { // nový index int newindex = list->Index + list->Auto; // kontrola přetečení indexu int size = list->Size; if ((DWORD)newindex >= (DWORD)size) { while (newindex < 0) newindex += size; while (newindex >= size) newindex -= size; } // nastavení nového indexu list->Index = newindex; } } // automatická inkrementace indexu, vrací původní index inline int _fastcall AutoIncInx(int index) { // adresa položky seznamu LISTDATA* list = m_Data + index; // úschova původního indexu int result = list->Index; // test, zda bude inkrementace if (list->Auto != 0) { // nový index int newindex = result + list->Auto; // kontrola přetečení indexu int size = list->Size; if ((DWORD)newindex >= (DWORD)size) { while (newindex < 0) newindex += size; while (newindex >= size) newindex -= size; } // nastavení nového indexu list->Index = newindex; } // návrat původního indexu return result; } // poskytnutí položky (s kontrolou platnosti indexu) const LISTDATA& _fastcall Get(const int index) const; // nastavení položky (s kontrolou platnosti indexu) void _fastcall Set(const int index, const LISTDATA& data); // zrušení položek z konce bufferu void _fastcall Del(int num); // vytvoření prázdné položky (vrací index položky) int New(); // přidání položky (vrací index položky) int _fastcall Add(const LISTDATA& data); // duplikace položky (s kontrolou platnosti indexu, vrací index první položky) int _fastcall Dup(const int index); int _fastcall Dup(const int index, int num); // operátor přiřazení const CBufList& operator= (const CBufList& src); };
[ "inferno986returns@gmail.com" ]
inferno986returns@gmail.com
3d3e5183a0b4e5a577eebcf892f014500a4d0b52
f933b3960ba73367d95b510c196a5e13d9e77ab9
/trx/Walls32/tabarray.h
325b7cd59b36bcdece96be2a56ee55312a1a4eac
[]
no_license
victorursu/walls
7ba50033c1ad28f66e8a97bcf37248e527c878a1
fab6c82714d837acdc5ecb95c7cb36a5d0cbc903
refs/heads/master
2021-01-21T14:17:21.934574
2017-02-19T23:58:52
2017-02-19T23:58:52
null
0
0
null
null
null
null
UTF-8
C++
false
false
2,769
h
// tabarray.h : interface of the CTabArray class // Written by Gerry High // V1.2 4/13/94 // ///////////////////////////////////////////////////////////////////////////// // Modifications for my use (DMcK) -- // Must define one or both symbols in each pair below: // // T_TABS: enable top tab style // LR_TABS: enable Left/Right tab styles // // W_TABS: enable MS Word style tab outline // C_TABS: enable Chicago style tab outline (use with T_TABS only) #define T_TABS #undef LR_TABS #define W_TABS #undef C_TABS ///////////////////////////////////////////////////////////////////////////// #ifndef __MFX_TABARRAY_H__ #define __MFX_TABARRAY_H__ ///////////////////////////////////////////////////////////////////////////// // CTabInfo class CTabInfo : public CObject { public: CTabInfo() { m_tabWidth = 0; m_tabLabel = NULL; m_pView = NULL; m_mnemonic = (char)0; m_active=TRUE; } ~CTabInfo() { if(m_tabLabel) { delete m_tabLabel; } } int m_tabWidth; // width of tab char* m_tabLabel; // label of tab CWnd* m_pView; // pointer to CWnd object char m_mnemonic; // character of mnemonic BOOL m_active; // is this tab active? }; enum eLookAndFeel { LAF_CHICAGO,LAF_MSWORD}; enum eTabPosition { TABSONTOP, TABSONLEFT, TABSONLEFTBOT,TABSONRIGHT, TABSONRIGHTBOT, TABSONBOTTOM }; #define BKPEN()pDC->SelectObject(&blackPen) #define LTPEN()pDC->SelectObject(&lightPen) #define DKPEN()pDC->SelectObject(&darkPen) ///////////////////////////////////////////////////////////////////////////// // CTabArray class CTabArray : public CObArray { // Construction/Destruction public: CTabArray(); ~CTabArray(); // Attributes public: int m_curTab; // index of current tab int m_margin; // margin around tab "pages" int m_tabHeight; // height of a tab (including margins, etc.) eTabPosition m_position; // position of tabs int m_lfEscapement; // font escapement (rotation) BOOL m_frameBorderOn; // draw tab page frame? CFont* m_normalFont; // font of non-current tab CFont* m_boldFont; // font of current tab // Operations public: #ifdef C_TABS void drawChicagoTabs(CWnd* pWnd, CDC *pDC); #endif #ifdef W_TABS void drawMSWordTabs(CWnd* pWnd, CDC *pDC); #ifdef T_TABS void GetTabRect(RECT *pRect,int tabidx); #endif #endif // Implementation protected: CPen blackPen; CPen darkPen; CPen lightPen; CPen* pOldPen; #ifdef T_TABS void drawMSWordTopTabs(CWnd* pWnd, CDC *pDC); #endif #ifdef LR_TABS void drawMSWordLeftTabs(CWnd* pWnd, CDC *pDC); void drawMSWordRightTabs(CWnd* pWnd, CDC *pDC); #endif }; #endif /////////////////////////////////////////////////////////////////////////////
[ "jedwards@fastmail.com" ]
jedwards@fastmail.com
7b123118a0544b11420ded3659f09d459335fc1a
db557a30a28f77774cf4662c119a9197fb3ae0a0
/HelperFunctions/DebugReportCallbackListEntry.cpp
ec5aba1dde00b63d32afc2d229b316691f9b9f1d
[ "Apache-2.0" ]
permissive
dkaip/jvulkan-natives-Linux-x86_64
b076587525a5ee297849e08368f32d72098ae87e
ea7932f74e828953c712feea11e0b01751f9dc9b
refs/heads/master
2021-07-14T16:57:14.386271
2020-09-13T23:04:39
2020-09-13T23:04:39
183,515,517
0
0
null
null
null
null
UTF-8
C++
false
false
1,505
cpp
/* * Copyright 2019-2020 Douglas Kaip * * 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. */ /* * DebugCallbackListEntry.cpp * * Created on: Jul 22, 2018 * Author: Douglas Kaip */ #include "DebugReportCallbackListEntry.h" using namespace jvulkan; DebugReportCallbackListEntry::DebugReportCallbackListEntry(unsigned long long the1stKey, VkDebugReportCallbackEXT the2ndKey, jobject objectReference, jobject userData) : the1stKey(the1stKey), the2ndKey(the2ndKey), objectReference(objectReference), javaUserData(userData) {} DebugReportCallbackListEntry::~DebugReportCallbackListEntry() { } unsigned long long DebugReportCallbackListEntry::getThe1stKey() { return the1stKey; } VkDebugReportCallbackEXT DebugReportCallbackListEntry::getThe2ndKey() { return the2ndKey; } jobject DebugReportCallbackListEntry::getObjectReference() { return objectReference; } jobject DebugReportCallbackListEntry::getJavaUserData() { return javaUserData; }
[ "dkaip@earthlink.net" ]
dkaip@earthlink.net
04dfde7d4a96ba9e4f4a3f49e982a7782cc6ad1d
1b8ae41e4e43429ba6c21b49fdfa7312ddee23b3
/dp_labs_and_solutions/dp_labs_and_solutions/dp_cpp_labs_and_solutions/null_object/solution/unary_plus.h
3d035a222b4509b642098a8295d7bfcebc8e4e00
[]
no_license
Technipire/Cpp
9f8476a944497b82ce425a3d9191acb74337a129
78d4c89385216865b9a9f475055fca1ff600d2a4
refs/heads/master
2021-05-01T16:31:45.977554
2017-04-03T00:02:01
2017-04-03T00:02:01
32,282,437
1
0
null
null
null
null
UTF-8
C++
false
false
291
h
// unary_plus.h #ifndef unary_plus_header #define unary_plus_header class expression; class expression_visitor; #include "unary.h" class unary_plus : public unary { public: unary_plus(expression * a_operand1); virtual void accept(expression_visitor & a_expression_visitor); }; #endif
[ "andyxian510@gmail.com" ]
andyxian510@gmail.com
cc32ebda141b87f114049716e70b8d07baa4a02f
c3239e159a407b2df8d5cb66ef68dbb14d66e792
/1/5.cpp
b25e005c0d154b36b5680bfd6d40cb285f2c777b
[]
no_license
trsantos/cpp-primer
088ebe6fb528ba4207467e6e86ef4f2d4339b1df
ef9d22dcc05b5b4deb7677f874a756acadf12a96
refs/heads/master
2021-01-09T20:57:21.832000
2017-08-14T00:28:07
2017-08-14T00:28:07
65,816,025
0
0
null
null
null
null
UTF-8
C++
false
false
312
cpp
#include <iostream> int main() { std::cout << "Enter two numbers:" << std::endl; int v1 = 0, v2 = 0; std::cin >> v1 >> v2; std::cout << "The product of "; std::cout << v1; std::cout << " and "; std::cout << v2; std::cout << " is "; std::cout << v1 * v2; std::cout << std::endl; return 0; }
[ "trsantos1@gmail.com" ]
trsantos1@gmail.com
1de76a014c4108de878341af73d85b30c3322893
1d1b1645bd2770938afebb21cf394dd6263ccc03
/Intel_common/include/vaapi_utils_x11.h
10d5574a273e84c109d24d495706be4316117fe6
[]
no_license
masterofeye/RemoteThirdParty
42bdac053430c8c9f54970e94ccd6035427b8780
22169f1c4b7be3264fe9bb037acecd1478977d79
refs/heads/master
2021-01-21T14:28:27.560336
2017-07-11T10:40:08
2017-07-11T10:40:08
95,286,051
1
0
null
null
null
null
UTF-8
C++
false
false
2,581
h
/******************************************************************************\ Copyright (c) 2005-2015, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. This sample was distributed or derived from the Intel's Media Samples package. The original version of this sample may be obtained from https://software.intel.com/en-us/intel-media-server-studio or https://software.intel.com/en-us/media-client-solutions-support. \**********************************************************************************/ #ifndef __VAAPI_UTILS_X11_H__ #define __VAAPI_UTILS_X11_H__ #if defined(LIBVA_X11_SUPPORT) #include <va/va_x11.h> #include "vaapi_utils.h" class X11LibVA : public CLibVA { public: X11LibVA(void); virtual ~X11LibVA(void); void *GetXDisplay(void) { return m_display;} MfxLoader::XLib_Proxy & GetX11() { return m_x11lib; } MfxLoader::VA_X11Proxy & GetVAX11() { return m_vax11lib; } protected: Display* m_display; MfxLoader::XLib_Proxy m_x11lib; MfxLoader::VA_X11Proxy m_vax11lib; private: DISALLOW_COPY_AND_ASSIGN(X11LibVA); }; #endif // #if defined(LIBVA_X11_SUPPORT) #endif // #ifndef __VAAPI_UTILS_X11_H__
[ "kunadt@schleissheimer.de" ]
kunadt@schleissheimer.de
60e7d30918986bb440d21e1bc241aefa696383bd
3b44945eca9d1e59ba00d7d56280aa8311c3fe99
/ZegarDzialaNaDwaPrzekazniki/ZegarDzialaNaDwaPrzekazniki.ino
aa34d1ebc4a6945a7d3680680d1c5b19f6d425ce
[]
no_license
KrzysztofGiblewski/ArdoinoProgramatorCzasowy
30cde837da51229273c795299c28384c89f6ec87
6377b5025a032c7a1ef50c86f53218114f9383af
refs/heads/master
2020-04-07T10:04:02.937979
2019-01-03T17:59:24
2019-01-03T17:59:24
158,274,033
0
0
null
null
null
null
UTF-8
C++
false
false
3,866
ino
#include <LiquidCrystal.h> #include <Servo.h> #define PRZYCISK 7 #define PRZYCISKKK 8 #define PRZEKAZNIK 13 #define PRZEKAZNIK 10 unsigned long aktualnyCzas = 0; unsigned long zapamietanyCzas = 0; unsigned long roznicaCzasu = 0; int minuty = 5; int godziny = 16; int sekundy = 0; int wloncz =6; int wyloncz =22; int wlonczz =7; int wylonczz =21; int wlonczKarm1 =9; int wlonczKarm2 =16; int serwopozycja =0; int serwowloncz=16; int ilosc=3; //ile karmy podac ile razy posypać Servo myservo; // create servo object to control a servo const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2; LiquidCrystal lcd(rs, en, d4, d5, d6, d7); void setup(){ lcd.begin(16, 2); Serial.begin(9600); pinMode(7, INPUT_PULLUP); pinMode(8, INPUT_PULLUP); pinMode(13, OUTPUT); pinMode(10, OUTPUT); digitalWrite(13,HIGH); digitalWrite(10,HIGH); pinMode(LED_BUILTIN, OUTPUT); //wbudowana dioda led na plytce myservo.attach(9); // pin 9 sygnal dla serwa servo myservo.write(0); // ustawiam serwo na kąt 0 stopni } void loop(){ int sensorVal = digitalRead(7); //przycisk z masy do pinu 7 int sensorVal2 = digitalRead(8); //tu prubuje nastawiac czas dodaje 15 min a drugim przyciskiem odejmuje 1 min a dwa if (sensorVal2 ==LOW) { if (minuty>45) { minuty= (minuty+15)-60; if (godziny<24) godziny+=1; else godziny=1; } else minuty+=15; delay(500); } if (sensorVal == LOW) { if (minuty>0) minuty--; else { godziny--; minuty=59; } delay(500); } aktualnyCzas = millis(); //Pobierz liczbe milisekund od startu roznicaCzasu =aktualnyCzas -zapamietanyCzas; if (roznicaCzasu>=1000UL) { Serial.print("godzina: "); Serial.print(godziny); Serial.print(" : "); Serial.print(minuty); Serial.print(" : "); Serial.println(sekundy); digitalWrite(LED_BUILTIN, HIGH); //dodałem migającą diodę wbudowanaą na płytce delay(50); digitalWrite(LED_BUILTIN,LOW); //tu pulapki czasowe dla aktywacji przekaznikow if (godziny==wloncz){ digitalWrite(13,LOW); } if (godziny==wyloncz){ digitalWrite(13,HIGH); } if (godziny==wlonczz){ digitalWrite(10,LOW); } if (godziny==wylonczz){ digitalWrite(10,HIGH); } // pułapka dla serwa if (godziny==wlonczKarm1 && minuty ==0 && sekundy==0) for(int i=0; i<ilosc; i++) { myservo.write(180); delay(1000); myservo.write(0); delay(1000); sekundy+=2; } if (godziny==wlonczKarm2 && minuty ==0 && sekundy==0) for(int i=0; i<ilosc; i++) { myservo.write(180); delay(1000); myservo.write(0); delay(1000); sekundy+=2; } sekundy ++ ; if (sekundy == 60) { minuty++; sekundy = 0; } if (minuty ==60 ) { godziny ++ ; minuty = 0; } if(godziny == 24) { godziny = 0; } zapamietanyCzas = aktualnyCzas; lcd.setCursor(0,0); if (godziny <10) lcd.print(0); lcd.print(godziny); lcd.print(":"); if (minuty <10) lcd.print(0); lcd.print(minuty ); lcd.print(":"); if (sekundy <10) lcd.print(0); lcd.print(sekundy); lcd.print(" Karmie "); lcd.setCursor(0,1); // lcd.print(" "); // lcd.print(wloncz); // lcd.print("+"); // lcd.print(wyloncz); // lcd.print(" +"); // lcd.print(wlonczz); // lcd.print(" -"); // lcd.print(wylonczz); lcd.print("o "); lcd.print(wlonczKarm1); lcd.print(" i o "); lcd.print(wlonczKarm2); lcd.print(" *"); lcd.print(ilosc); lcd.print("syp"); } }
[ "krzysztofgiblewski@gmail.com" ]
krzysztofgiblewski@gmail.com
6c9c9e27474ac602cfaf0fe6dfd3946bfd4a8964
1880ae99db197e976c87ba26eb23a20248e8ee51
/tke/include/tencentcloud/tke/v20180525/model/LivenessOrReadinessProbe.h
5fd80828f7cd389b3fb7ea8ae03dc8ee0d9b7b0b
[ "Apache-2.0" ]
permissive
caogenwang/tencentcloud-sdk-cpp
84869793b5eb9811bb1eb46ed03d4dfa7ce6d94d
6e18ee6622697a1c60a20a509415b0ddb8bdeb75
refs/heads/master
2023-08-23T12:37:30.305972
2021-11-08T01:18:30
2021-11-08T01:18:30
null
0
0
null
null
null
null
UTF-8
C++
false
false
6,645
h
/* * Copyright (c) 2017-2019 THL A29 Limited, a Tencent company. 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. */ #ifndef TENCENTCLOUD_TKE_V20180525_MODEL_LIVENESSORREADINESSPROBE_H_ #define TENCENTCLOUD_TKE_V20180525_MODEL_LIVENESSORREADINESSPROBE_H_ #include <string> #include <vector> #include <map> #include <tencentcloud/core/utils/rapidjson/document.h> #include <tencentcloud/core/utils/rapidjson/writer.h> #include <tencentcloud/core/utils/rapidjson/stringbuffer.h> #include <tencentcloud/core/AbstractModel.h> #include <tencentcloud/tke/v20180525/model/Probe.h> #include <tencentcloud/tke/v20180525/model/HttpGet.h> #include <tencentcloud/tke/v20180525/model/Exec.h> #include <tencentcloud/tke/v20180525/model/TcpSocket.h> namespace TencentCloud { namespace Tke { namespace V20180525 { namespace Model { /** * 健康探针 */ class LivenessOrReadinessProbe : public AbstractModel { public: LivenessOrReadinessProbe(); ~LivenessOrReadinessProbe() = default; void ToJsonObject(rapidjson::Value &value, rapidjson::Document::AllocatorType& allocator) const; CoreInternalOutcome Deserialize(const rapidjson::Value &value); /** * 获取探针参数 注意:此字段可能返回 null,表示取不到有效值。 * @return Probe 探针参数 注意:此字段可能返回 null,表示取不到有效值。 */ Probe GetProbe() const; /** * 设置探针参数 注意:此字段可能返回 null,表示取不到有效值。 * @param Probe 探针参数 注意:此字段可能返回 null,表示取不到有效值。 */ void SetProbe(const Probe& _probe); /** * 判断参数 Probe 是否已赋值 * @return Probe 是否已赋值 */ bool ProbeHasBeenSet() const; /** * 获取HttpGet检测参数 注意:此字段可能返回 null,表示取不到有效值。 * @return HttpGet HttpGet检测参数 注意:此字段可能返回 null,表示取不到有效值。 */ HttpGet GetHttpGet() const; /** * 设置HttpGet检测参数 注意:此字段可能返回 null,表示取不到有效值。 * @param HttpGet HttpGet检测参数 注意:此字段可能返回 null,表示取不到有效值。 */ void SetHttpGet(const HttpGet& _httpGet); /** * 判断参数 HttpGet 是否已赋值 * @return HttpGet 是否已赋值 */ bool HttpGetHasBeenSet() const; /** * 获取容器内检测命令参数 注意:此字段可能返回 null,表示取不到有效值。 * @return Exec 容器内检测命令参数 注意:此字段可能返回 null,表示取不到有效值。 */ Exec GetExec() const; /** * 设置容器内检测命令参数 注意:此字段可能返回 null,表示取不到有效值。 * @param Exec 容器内检测命令参数 注意:此字段可能返回 null,表示取不到有效值。 */ void SetExec(const Exec& _exec); /** * 判断参数 Exec 是否已赋值 * @return Exec 是否已赋值 */ bool ExecHasBeenSet() const; /** * 获取TcpSocket检测的端口参数 注意:此字段可能返回 null,表示取不到有效值。 * @return TcpSocket TcpSocket检测的端口参数 注意:此字段可能返回 null,表示取不到有效值。 */ TcpSocket GetTcpSocket() const; /** * 设置TcpSocket检测的端口参数 注意:此字段可能返回 null,表示取不到有效值。 * @param TcpSocket TcpSocket检测的端口参数 注意:此字段可能返回 null,表示取不到有效值。 */ void SetTcpSocket(const TcpSocket& _tcpSocket); /** * 判断参数 TcpSocket 是否已赋值 * @return TcpSocket 是否已赋值 */ bool TcpSocketHasBeenSet() const; private: /** * 探针参数 注意:此字段可能返回 null,表示取不到有效值。 */ Probe m_probe; bool m_probeHasBeenSet; /** * HttpGet检测参数 注意:此字段可能返回 null,表示取不到有效值。 */ HttpGet m_httpGet; bool m_httpGetHasBeenSet; /** * 容器内检测命令参数 注意:此字段可能返回 null,表示取不到有效值。 */ Exec m_exec; bool m_execHasBeenSet; /** * TcpSocket检测的端口参数 注意:此字段可能返回 null,表示取不到有效值。 */ TcpSocket m_tcpSocket; bool m_tcpSocketHasBeenSet; }; } } } } #endif // !TENCENTCLOUD_TKE_V20180525_MODEL_LIVENESSORREADINESSPROBE_H_
[ "tencentcloudapi@tencent.com" ]
tencentcloudapi@tencent.com
c8b294cf10524e2097a47d75ef26b8b79a0ae725
03cd30e201f2594f9a12dd8f821470436ea65c59
/sketch_jul13a/sketch_jul13a.ino
84c240b4f6ff79c1d5b4e5e78177b3ab4a3a90ca
[]
no_license
seem-sky/Arduino-2
fec9402983c5f233d0a37a1207591d0eb2fe2d5b
9ca264b1b452db3dd9083b7ccf110ac8c5073a65
refs/heads/master
2020-12-11T04:12:33.273489
2015-06-30T07:55:44
2015-06-30T07:55:44
null
0
0
null
null
null
null
UTF-8
C++
false
false
430
ino
float value = -34.03; void setup() { // put your setup code here, to run once: Serial.begin(57600); randomSeed(analogRead(0)); } void loop() { char topic[128]; char message[128]; float value =+ random(-7500,15000) / 1000.0; sprintf (topic, "sensor/%s", "01"); dtostrf(value, 4, 2, message); Serial.print(topic); Serial.print(", "); Serial.println(message); delay(random(2500)); }
[ "stevetrease@gmail.com" ]
stevetrease@gmail.com
b94741c77ef97837dded81266966e16bddaea2e9
8d1f66104f69be5b6358ce4d4fc94aa72766dbec
/[Source]TMSRV/TNDeck100.h
cb6a5e621ebb2618c950fd1f11387955ef13e474
[]
no_license
DevNightCorp/Tantra-Online
afd33702dadc85ed6b725e607ebd1669876ee7db
6fe6f8677147d113b609e8d9311ff6789f664b9c
refs/heads/master
2020-08-28T19:56:19.987142
2019-10-30T07:42:11
2019-10-30T07:42:11
217,805,912
8
2
null
null
null
null
UHC
C++
false
false
828
h
/**************************************************************************************** 작성자 : 정재웅(spencerj@korea.com) 작성일 : 2003-09-09 수정자 : 수정일 : 프로젝트명 : 설명 : TNDeck class를 size 100으로만 고정해서 static으로 만들어놓은 것. ****************************************************************************************/ #ifndef __TNDeck100_h__ #define __TNDeck100_h__ #include <windows.h> class TNDeck100 { public : TNDeck100() ; ~TNDeck100() ; void Init() ; enum { eDeck_MaxSize = 100, }; //Public Operations public : byte Random() ; void Shuffle() ; void AddCard( byte a_byNum, int a_iCount ) ; void ClearCards() ; private : int m_iIndex ; //int m_iSize ; byte m_byrgCard[100] ; }; #endif
[ "noreply@github.com" ]
noreply@github.com
afaef3bf959f180d96db36a93a14e545634c0358
0eff74b05b60098333ad66cf801bdd93becc9ea4
/second/download/CMake/CMake/CMake-joern/Kitware_CMake_repos_function_1629.cpp
ca3d9b07f59df2ee666d3d9daea85966b16f6ad5
[]
no_license
niuxu18/logTracker-old
97543445ea7e414ed40bdc681239365d33418975
f2b060f13a0295387fe02187543db124916eb446
refs/heads/master
2021-09-13T21:39:37.686481
2017-12-11T03:36:34
2017-12-11T03:36:34
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,104
cpp
static int gnu_sparse_old_read(struct archive_read *a, struct tar *tar, const struct archive_entry_header_gnutar *header, size_t *unconsumed) { ssize_t bytes_read; const void *data; struct extended { struct gnu_sparse sparse[21]; char isextended[1]; char padding[7]; }; const struct extended *ext; if (gnu_sparse_old_parse(a, tar, header->sparse, 4) != ARCHIVE_OK) return (ARCHIVE_FATAL); if (header->isextended[0] == 0) return (ARCHIVE_OK); do { tar_flush_unconsumed(a, unconsumed); data = __archive_read_ahead(a, 512, &bytes_read); if (bytes_read < 0) return (ARCHIVE_FATAL); if (bytes_read < 512) { archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, "Truncated tar archive " "detected while reading sparse file data"); return (ARCHIVE_FATAL); } *unconsumed = 512; ext = (const struct extended *)data; if (gnu_sparse_old_parse(a, tar, ext->sparse, 21) != ARCHIVE_OK) return (ARCHIVE_FATAL); } while (ext->isextended[0] != 0); if (tar->sparse_list != NULL) tar->entry_offset = tar->sparse_list->offset; return (ARCHIVE_OK); }
[ "993273596@qq.com" ]
993273596@qq.com
cdcbb55e9ec4249eccc1264627b1294e0830a533
3ea34c23f90326359c3c64281680a7ee237ff0f2
/Data/1449/E
9cf31ea6569ba17d8c26cbd36806b23149401ba4
[]
no_license
lcnbr/EM
c6b90c02ba08422809e94882917c87ae81b501a2
aec19cb6e07e6659786e92db0ccbe4f3d0b6c317
refs/heads/master
2023-04-28T20:25:40.955518
2020-02-16T23:14:07
2020-02-16T23:14:07
null
0
0
null
null
null
null
UTF-8
C++
false
false
80,933
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | foam-extend: Open Source CFD | | \\ / O peration | Version: 4.0 | | \\ / A nd | Web: http://www.foam-extend.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volVectorField; location "Data/1449"; object E; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 -1 0 0 0 0]; internalField nonuniform List<vector> 4096 ( (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,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,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) (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,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,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) (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,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,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) (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,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,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) (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,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,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) (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,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,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) (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,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,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) (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,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,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) (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,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,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) (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) (-197746.71320402,104934.038708752,92812.6744952672) (-209190.041312665,100652.34162834,201350.374179592) (-235610.282591058,91649.969599346,345310.687171305) (-285504.935409026,77455.8726901336,553359.749890199) (-375541.132457717,58377.820837836,870523.061510088) (-537048.578644686,36404.2321674896,1371167.40798727) (-829428.838542582,16381.652293048,2184214.59423684) (-1357836.65070026,4129.13172447587,3537922.11321262) (-2239504.35066297,40.2714846013079,5777386.19239102) (-3120292.43801314,-302.959218928375,8897981.58962309) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-209209.206500959,225663.006632902,88480.2385768087) (-220739.175848772,217546.926725288,192324.829328636) (-247566.946381682,200399.23943916,331142.505870501) (-298641.434886037,173004.492335853,534235.321110825) (-391181.235759076,135270.020875741,848524.35683199) (-556563.437559563,90325.7874432157,1351166.23911583) (-852143.323855004,47747.1842364304,2171944.03102742) (-1378532.37407626,20801.9386365109,3533803.59819162) (-2253312.96224921,10198.3922668383,5776958.43965865) (-3126756.58822043,5212.27001884279,8898199.79864125) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-235414.768023819,380784.372867583,80293.4017891389) (-247143.719509358,369844.127858633,175139.920165153) (-274813.536691089,346591.433792358,303761.262503048) (-328411.560102818,308803.07658457,496374.23835715) (-426822.051321994,255013.186017492,803453.124537391) (-602432.615115865,187698.128767608,1308513.39832886) (-908176.274736908,119510.298351462,2144926.55895075) (-1430113.55359601,72693.5053068403,3523148.5458764) (-2286526.02873377,47957.4614196739,5771915.5054574) (-3141801.51977525,25994.2161459816,8892935.07910549) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-284170.594249939,595652.871008954,69302.0961085683) (-296076.793281455,583399.702164636,151823.315084023) (-324810.142884551,557323.720031771,265901.171729156) (-382098.187005163,514429.821568182,442372.6137507) (-490212.876113091,451628.654454702,735970.021426586) (-685490.610305882,368991.660614593,1240167.09988548) (-1015494.69029439,277201.409277381,2097970.67925396) (-1529919.00619205,202234.734684231,3498348.45606857) (-2347400.24931121,143776.368553353,5749929.79824606) (-3168349.49697405,77376.1957702006,8866897.315596) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-371438.768944569,910037.137418146,57054.5025353741) (-383326.831303885,898099.330261928,125681.705741965) (-412631.085658042,872746.017669233,222890.493762545) (-472974.590054737,830940.688961437,379354.216424031) (-591116.685608179,768994.016681624,653105.539805295) (-810765.393325244,684726.464873916,1148136.1288712) (-1178935.79349303,581421.266570743,2022852.06507087) (-1681887.99344056,467148.293898293,3439826.49929739) (-2435856.95505692,335903.924081973,5683555.89882575) (-3206708.31344158,178073.649346493,8789566.75869103) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-528943.361843404,1393875.62503072,45104.8742308372) (-540245.23459421,1383246.17185395,100203.26723302) (-568591.672654614,1360645.50063818,180895.45691869) (-628304.26435443,1322975.61271615,317164.797518411) (-747663.231178921,1265254.98853816,568567.056840792) (-971460.088871881,1180194.41269273,1044559.19789387) (-1340763.08796936,1058381.32845447,1908362.22397952) (-1820923.68042355,887964.654529028,3308469.54377233) (-2531692.01170189,650314.502509432,5525750.9770468) (-3254990.99994226,347203.028524906,8611612.59781055) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-818036.806064055,2177440.69248082,34471.7386139595) (-828024.159228693,2168243.60884134,77498.4608552636) (-853462.004803823,2148519.9019073,143086.064389963) (-907993.258301327,2114785.91866941,259269.016738027) (-1018832.39702047,2060042.01382902,483314.388467639) (-1229113.74957134,1970133.67334701,922488.877384693) (-1575696.79509382,1818932.38294376,1737634.61798924) (-2012296.99284285,1567309.41286051,3070586.8525006) (-2674510.19313563,1172825.32863505,5222586.21951056) (-3333782.4859465,639064.219045146,8264507.51493689) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-1346694.32530584,3498839.13683243,25295.8809542158) (-1354667.73628573,3490454.72635955,57752.4997217427) (-1375161.85017546,3472067.05550862,109367.196295894) (-1419517.72099352,3439180.39140622,204490.444552598) (-1510588.26874617,3381802.14863729,393318.578490485) (-1685378.97096239,3277700.17116196,771131.051637924) (-1975606.42635143,3079906.12644751,1485763.7344856) (-2329063.62919421,2706238.30522433,2675898.47131601) (-2933850.03186568,2093793.56814811,4688780.26366863) (-3484491.35154771,1186843.16323288,7625492.67102855) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-2231950.07105185,5713847.23305177,16941.9748324935) (-2237377.83475756,5705413.39056415,39361.1453854622) (-2251299.85873921,5686210.73578802,76517.323845242) (-2281135.94045794,5649734.92876924,147098.726940154) (-2341282.19406266,5581104.34764529,289078.721994839) (-2454368.4779054,5448029.2497055,573118.121356674) (-2644355.15397007,5185507.31483853,1111872.08693572) (-2926680.96181629,4681568.6276353,2063222.72634104) (-3412248.72311915,3787579.21889592,3781685.79871234) (-3747358.80963816,2277353.91841477,6438533.85316863) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-3116866.83349598,8822108.15421111,8605.91233663951) (-3119576.67013231,8813333.89034604,20262.0826870685) (-3126485.27937117,8792811.92314744,40146.1746988421) (-3141135.93138932,8752504.43457731,78512.6002801023) (-3170255.02697589,8673977.67485384,155894.300047453) (-3224705.57450739,8518196.493177,310432.631083347) (-3319781.09191414,8207938.85589093,607782.181945081) (-3480024.08467754,7600400.35861128,1168974.53564659) (-3746470.68417607,6431762.58582857,2271261.85288999) (-3773105.03259954,4160754.99350535,4160965.81039897) (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,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,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) (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) (29263160.0814993,93532.1843092188,81414.6298085572) (29244007.9819688,89121.7889846723,174948.42636355) (29200075.8221414,79698.8316245189,295417.098827603) (29118014.6437208,64375.2156791075,463375.912839773) (28971922.3730304,42809.6100958308,708956.406076921) (28712192.4883626,16942.2879332557,1078626.65995737) (28235775.1030511,-6328.49679484273,1655604.82397959) (27294260.5041379,-16592.728190089,2655954.00615255) (25169892.15899,-13775.9940413071,4896187.09936206) (19400719.0088386,-6764.95198629495,12017794.2133177) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (29243621.699839,199602.660055802,76952.2267346689) (29224457.3821132,191249.368466681,165481.698111859) (29180155.3510289,173252.576121494,280059.265025427) (29096540.5669892,143363.703727446,441742.383923005) (28946435.1926128,99711.9319424325,683077.242525646) (28679411.8052535,44485.5299290191,1055412.36653802) (28195723.1666592,-8292.17709003559,1645363.16514026) (27258141.6640165,-30818.0315980712,2658768.03927659) (25147433.0627666,-23044.8677901711,4903144.49683071) (19390880.5981361,-9859.17587433789,12024455.1431833) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (29199323.4232739,332152.280072726,68565.7975064776) (29180109.5468032,320966.185156065,147449.32332566) (29134969.5503172,296651.862962718,250120.558297281) (29047747.2459694,255215.058873458,397964.005900191) (28887287.427196,191664.933100192,627755.135045502) (28598416.2023572,104637.162073817,1002608.29424879) (28087039.3228625,12153.9084271463,1622800.21995333) (27158401.8845713,-27160.5244569517,2666480.88346614) (25089439.9515399,-12952.4846793016,4916276.12890262) (19366837.5614742,-589.432720607804,12034220.9133206) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (29118021.2831755,508405.511829774,57408.4996386147) (29098861.2812144,496192.060560113,123098.158559947) (29052645.8870125,469560.371534605,208587.228912172) (28959746.5196932,423579.395345651,334231.79456275) (28780220.7610443,350700.36992865,540616.32939805) (28441912.3089647,243665.880319276,910038.300703164) (27845479.2475936,113692.17261469,1583379.70744879) (26931319.1396662,50211.8627144574,2680622.78324024) (24972220.7647271,55260.2793398005,4928642.61400383) (19321828.3107732,38962.7631553582,12034766.2192019) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (28975090.1785443,752511.409732115,45218.7634299163) (28956352.5396176,741180.952547153,96404.1093425134) (28909910.0986203,716785.49870208,162491.406717877) (28812207.601481,675569.40646778,261172.81288111) (28610821.2853169,612377.218577861,433411.602127995) (28198354.7390975,523941.609185878,779869.349659793) (27411210.2219972,419516.897956749,1519752.21764865) (26510254.1556781,328053.452583353,2685622.0874823) (24788491.3117233,240000.753013973,4912386.95584895) (19254896.4015238,129743.787941933,11995854.8249181) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (28720855.6482328,1104707.36798493,33858.6404920837) (28703403.2811362,1095355.06944358,71889.6166864046) (28659178.3291782,1075655.37134748,121103.351029409) (28563301.2941009,1043177.59529648,197743.212566588) (28359619.6919139,993981.462996316,344709.6538765) (27935401.048851,922470.727249232,675173.006911461) (27138332.775048,823387.396458677,1428060.25421334) (26277111.2287263,696488.918931418,2597443.48753644) (24632086.7294495,507390.209444403,4802128.89877574) (19178173.0466568,268350.128920935,11866212.1200188) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (28249388.1309684,1648609.53303015,24526.5067434768) (28234201.838961,1641402.75317125,52106.4336472394) (28195025.358233,1626628.52531981,88499.5254592603) (28108041.6984407,1603122.23216406,148373.540670838) (27918198.9759022,1568168.21519332,273009.024372321) (27512596.8028537,1513762.44876734,575860.359250264) (26739627.1925085,1418894.87217176,1300882.50475598) (25962444.4387462,1250371.23731842,2408112.36360112) (24400506.5160578,913344.668994084,4562994.80367912) (19047244.5765906,488285.474735431,11597886.0041488) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (27307067.39113,2613364.23064034,17337.1947751422) (27295104.3208641,2607535.20739239,37286.2922252949) (27263911.8168632,2595722.47031137,64972.289016182) (27193666.0646239,2577405.80447054,113358.539913512) (27037309.9958312,2550982.12191196,218499.977438547) (26693311.5315145,2508567.01077601,480858.521774252) (26016860.2317532,2410994.91151417,1132145.43314825) (25509959.1022465,2108469.76065963,2070877.78718738) (23933098.6866802,1615263.92599474,4137863.42046188) (18744051.7108654,923902.351457454,11109557.0901478) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (25177211.7738354,4828543.90975079,11512.0848233894) (25169174.7387869,4822888.79354794,25459.5339446298) (25148350.0365709,4810716.03728876,46669.6804782616) (25102420.7898211,4789469.67641555,86902.687075238) (25004601.0035967,4751906.99482346,175948.225325484) (24805465.7557014,4677444.39217274,383090.219143038) (24446354.1720372,4509801.75197795,829427.661493192) (23941633.4409709,4127973.70252383,1577462.92566302) (22516807.4465447,3453147.31936549,3446376.97144962) (17821765.6166642,2251477.66791275,10185530.8375131) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (19403308.749329,11938328.5866642,5893.34908273677) (19399327.1344874,11932368.0340491,13363.9127830395) (19389124.6643667,11918823.1600284,25500.4551266397) (19367084.9089808,11893224.3490818,49378.5509114938) (19321629.5435756,11843835.9188842,101418.665120479) (19232171.7623295,11742513.5841289,215325.745148608) (19066418.3403611,11527318.1285486,447463.545123871) (18748830.9010478,11080032.249527,902403.621216609) (17822522.7830652,10177887.7275971,2244523.35456484) (14491251.9145658,7933626.47161977,7933871.21251357) (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,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,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) (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) (-509115.155756393,74099.7879864706,62321.8404481276) (-530215.805273349,69622.9425745603,131069.076294584) (-577896.018766128,59793.2609446557,213394.047436425) (-664676.693802836,42940.2336787695,317291.542460188) (-813114.522462279,17364.639327712,449110.189804063) (-1060711.75319792,-15805.9492058616,601966.771749445) (-1465545.05390061,-46370.9327685865,713804.252648666) (-2106286.01752243,-52713.9152998427,531211.080787819) (-3024958.678844,-36228.5736547957,-873563.116544617) (-3708137.53676676,-16596.1784195742,-7383964.00134067) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-531498.102969676,155522.950413015,57843.0315609205) (-552218.69247588,147069.291777921,121219.148125469) (-599384.402252001,128210.016070009,196488.537459889) (-686245.079905786,94695.0994803111,291665.709732179) (-836940.921144103,40618.4672209495,415934.386774736) (-1091237.56347899,-36503.5700905586,571427.76757072) (-1505537.16164569,-116983.335690541,707446.88997633) (-2140059.75142338,-130598.303409558,547679.084704801) (-3041884.99695265,-81094.4752987808,-853990.562753024) (-3714103.73353466,-33948.2244446158,-7367507.79387835) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-581447.562692303,251045.304035234,49395.0235228601) (-601454.551178734,239857.150234156,102317.654227433) (-647735.047957306,214484.202457804,162894.457293007) (-735376.078311723,167367.213226434,237492.059006866) (-893820.254662221,84633.3543948205,338731.244870144) (-1174276.74420783,-51874.2944670194,490941.306990472) (-1639257.15558214,-229433.459834677,693834.30075813) (-2257073.66085014,-254302.451599848,597160.385548618) (-3093207.08723984,-130245.693798279,-806894.965993151) (-3730528.26853854,-45638.6349432692,-7333692.3343029) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-670553.365092892,365494.926821415,38271.416661112) (-689481.498657665,353732.902660507,76884.8352855935) (-734416.112206517,326917.269638548,115660.158502704) (-823795.650138853,276103.691516948,154612.241223106) (-999822.167581503,181298.238558479,202136.676864099) (-1357134.09264772,70.6217890414033,313384.553399312) (-2054727.49803372,-320653.93436029,668958.164731099) (-2640148.80077031,-370938.027521424,721208.072268093) (-3221826.88110785,-128581.495273863,-722262.08924239) (-3765806.07435807,-28043.0689576556,-7288076.87891799) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-819977.284468899,498193.297812068,26515.4832014132) (-837362.089010225,488157.873240501,49951.5324281176) (-879782.831267382,466008.331830052,64699.7913031135) (-969131.366786041,426621.895785442,59666.9464805651) (-1165995.34206444,361121.507676809,20806.6959224017) (-1670072.51122472,260880.119494174,-7429.1602816507) (-3317842.43996648,146508.145577849,618607.812922725) (-3936288.06840313,94798.6395590852,963559.761102253) (-3474184.17804939,83475.1165158097,-621674.969735816) (-3823666.117401,52945.117209368,-7259954.24579908) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-1066239.1809689,633005.109145943,16429.4090467294) (-1081448.76617223,625931.668757264,27654.0520172434) (-1119449.57703415,611317.306507471,25119.3747309563) (-1202522.27780125,587752.148513895,-6040.9149165509) (-1393895.8746198,552376.983048519,-79634.4325757531) (-1896680.60648162,499482.224345554,-122008.490915699) (-3464223.60567625,424480.179281437,566722.247283766) (-4030963.68789011,381608.877885692,952133.316752556) (-3591560.95999423,275613.940887336,-652211.426996414) (-3881439.79244941,137307.108050957,-7312814.18755283) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-1468762.54746898,705952.008221256,9350.17054089572) (-1481285.61071781,701991.685540969,12923.9946148738) (-1513237.456182,695244.010384012,1406.49633215512) (-1585601.21890178,688530.582125683,-41582.6287583325) (-1761240.77762468,687067.93401256,-132687.435016638) (-2253546.97579733,694272.804976624,-197187.845817749) (-3888385.4308902,695893.767351461,523557.580689821) (-4411767.45614555,797623.366909203,845901.377736867) (-3768919.39136798,445731.926742063,-790644.309513187) (-3976761.8541327,184999.51651117,-7450183.89607133) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-2111271.46291548,483089.778058086,5347.47538748862) (-2120700.57747773,481226.702210165,6063.74823900834) (-2145078.94438791,479821.121776416,-5376.21072338611) (-2201789.52971351,485883.431899616,-43127.0749811478) (-2347072.51900719,518057.77102698,-125588.005978228) (-2798675.45152119,620487.682756576,-195669.509543732) (-4584081.5903287,840211.990479076,625100.480589511) (-3736822.98285448,539874.513372967,493777.810405649) (-3910470.14767863,198737.748788993,-1051512.78610346) (-4124465.59932423,1486.19301906074,-7635335.76124277) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-3032891.62919966,-946103.85799631,3443.43026836657) (-3038989.37754964,-947629.109415004,4609.74940881827) (-3054605.98943862,-949124.635101976,657.923475581585) (-3089447.27686666,-946410.156497861,-11034.0302602119) (-3169421.03719795,-931510.814399352,-23297.0128603375) (-3360826.99192116,-896281.630643866,23911.4393415603) (-3779368.71063172,-870605.122942455,324597.826610801) (-3916895.07238649,-1065279.08711048,152426.33163041) (-4277436.07451094,-1241509.91080518,-1248936.09654098) (-4345256.76219184,-1079274.84850272,-7637006.28498426) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-3714198.02368713,-7466351.7790635,1901.0852621701) (-3717149.88396314,-7468244.41133448,3139.79681098846) (-3724613.69299051,-7471489.24479203,3389.15503720399) (-3740692.61971502,-7474929.72909745,3832.64751141706) (-3775020.30998268,-7478753.23104476,11871.3088939954) (-3847083.30175278,-7490539.16310812,49530.2966193714) (-3980345.04911459,-7539972.66578039,129807.6201119) (-4128823.51753234,-7669644.72353678,-24025.933702871) (-4346536.97187284,-7645413.45653253,-1086916.24185861) (-4194649.94309321,-6558211.33731433,-6557931.50420909) (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,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,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) (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) (-602194.41978579,51828.0766005655,41251.1874288318) (-620098.417576053,47708.8382447224,83424.9614868136) (-659525.383298179,38386.6386788295,126667.687340037) (-728330.073491261,21455.0700974285,168865.996931031) (-839316.167048579,-6392.03713906174,201459.678656395) (-1009911.86461227,-46295.0555046565,196954.8455754) (-1255092.30741775,-86344.2795564412,72846.3786489746) (-1559143.34696809,-86497.2603362094,-387799.031569155) (-1802334.33952293,-53173.4665550646,-1557249.90433514) (-1566204.60409701,-22570.0912824087,-3676612.74572249) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-622554.524708985,105752.714910939,37131.7834289346) (-639428.262606849,98001.6837084618,74048.5080961622) (-676642.904941782,80030.4946588835,109663.154805891) (-741789.682202232,45693.9594991361,140968.867700627) (-847713.150543219,-16191.9584375425,161541.018398222) (-1013369.83740248,-119521.536439897,156899.77325696) (-1256949.24320757,-250683.347667864,72650.9229302673) (-1551751.7951403,-247642.737340664,-354511.556348344) (-1790370.07604126,-132472.404981709,-1526727.5388331) (-1558836.05763663,-50412.923706906,-3654152.38230665) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-667138.594203995,162067.088167969,29376.658254667) (-682048.792452657,151973.477175164,55999.1060618842) (-714894.03733398,127949.813756926,75238.7763405135) (-772495.16064157,79047.4012551762,79004.4169143238) (-867804.775991037,-21351.5565396801,58148.5363452757) (-1026643.7180782,-234736.320033695,25730.2938094334) (-1295013.50571514,-644902.699892217,75705.9961667989) (-1552225.59886954,-637439.716116505,-239345.087037965) (-1761357.91008056,-258953.920840683,-1444712.74833828) (-1540879.64071328,-80960.2694556006,-3603814.03041486) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-743816.029745019,216032.391559056,19297.3612610455) (-755970.501901164,205877.858699435,31881.9829802766) (-782406.904958114,181597.546922942,26225.0425658611) (-827796.734414586,130785.40240361,-21511.8743068396) (-902487.48070037,15125.8468694347,-155323.964597082) (-1049919.65641636,-312862.672961761,-384412.047900378) (-1583510.3970309,-1583773.17870865,83241.3299132289) (-1666372.72182316,-1667151.63124642,139177.166096002) (-1693915.15041325,-381011.4687022,-1266677.01673708) (-1504682.64074764,-85943.8114383923,-3522816.90836472) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-864854.350614376,251819.773193819,9089.68451071415) (-873818.965824426,243987.537552627,7436.88247172337) (-892291.06808072,226301.223618832,-24758.5574108282) (-919007.812418253,193213.526793391,-137310.236168398) (-937965.365060484,133181.702905743,-483396.069208664) (-845183.544339312,34183.0499147016,-1655330.75897054) (-5.59001106980264e-05,-1.53187857314981e-05,3.74278133367163e-05) (698.36005909001,-5.50516041545035,1425333.70913233) (-1424336.03841824,-33961.045771271,-971564.853429754) (-1439537.7754419,-4855.30386185104,-3436781.70296542) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-1045851.31241457,230253.953259338,1177.95138016056) (-1051776.12631502,225922.124952606,-10429.2758770304) (-1062944.80511491,217419.230423025,-58052.0546004598) (-1074432.86129143,204582.88711403,-197510.83143092) (-1060597.74647675,184894.619327425,-582521.875995653) (-897838.240897835,142430.73017024,-1689611.92183497) (-5.01938576641076e-05,-2.00430075257194e-05,2.86814312128173e-05) (856.389204613657,588.10099076144,1391226.60803205) (-1389927.86465752,98114.7641022603,-942482.2971782) (-1438820.14817946,41908.4478022709,-3431865.69311221) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-1298426.31537952,63144.0906805693,-3226.36951068774) (-1301825.2962605,62343.9749585667,-19108.5339739702) (-1307098.18634423,63241.1312544687,-71069.704643178) (-1306972.47126955,72229.9183692186,-217345.483530591) (-1269724.67576018,101116.355403925,-625083.321471594) (-1053118.76006753,149004.058155538,-1832084.86518669) (-0.00013482600823567,4.74616559228143e-05,3.85212329684196e-05) (454.017767227552,1472382.35225496,1488425.94045368) (-1487589.33320219,304048.326359143,-998837.679968992) (-1497087.16830724,37248.5686738819,-3473852.48666605) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-1605045.24154796,-438928.560328703,-4153.57035825825) (-1606677.88582225,-437418.816972913,-18413.4700822703) (-1608063.2420373,-429961.088142864,-62226.9530355531) (-1601279.30565027,-401931.815181624,-188575.443547958) (-1552876.14417344,-304366.258201228,-577289.204776568) (-1304034.90794484,58232.745051704,-1981158.43524909) (238.516205950077,1644773.37537305,1472211.58014815) (-1471757.30785901,359650.743424869,319877.513982774) (-1852417.64322501,-168365.665538398,-1265760.99857331) (-1622365.76278127,-219374.819486623,-3511237.44695575) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-1841060.90647549,-1628014.02142338,-2745.26162948332) (-1841723.71516788,-1626334.18005174,-11095.5609324069) (-1841758.40667689,-1619586.02312307,-34318.208713903) (-1836557.81426696,-1598005.79106051,-91133.6954347244) (-1812784.76324586,-1537355.75474099,-214780.472847043) (-1739899.46451435,-1382788.37970485,-394686.875497303) (-1644413.46529606,-1071843.19850501,186974.453045091) (-1884513.56677005,-1277450.37359923,-208305.935547237) (-2026379.13790349,-1310794.17565405,-1316934.36203903) (-1660727.25367738,-928793.463849834,-3292045.22619029) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-1588031.76283873,-3753069.10046236,-1111.18180941835) (-1588265.76818366,-3751948.21350362,-4381.26413701479) (-1588184.36206105,-3747616.42820998,-12780.1899795485) (-1586089.27599496,-3734816.24469429,-30573.0800658036) (-1578548.10979018,-3704157.57593359,-60243.4590656983) (-1562526.00882388,-3643830.81530444,-83758.3163950312) (-1557245.52038848,-3559978.94593812,-18722.0976880087) (-1642020.02601259,-3541144.77309119,-241831.189715785) (-1664883.64627448,-3299141.26434049,-935137.426627693) (-1331349.90607061,-2363758.01783278,-2363472.90966734) (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,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,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) (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) (-657124.824131889,31577.4686999188,23352.9356461785) (-669188.514545259,28457.2063151621,43985.8263002219) (-694737.179336417,21341.1855690821,57856.4367693783) (-736370.453224959,8059.58210470031,57837.2343983773) (-797492.986779944,-14757.4039032464,30771.4580329835) (-881030.527855053,-49758.3550983583,-48351.5236258767) (-983936.785605271,-88192.9940383143,-231314.051400038) (-1080149.31398149,-79135.7501586032,-631172.334228038) (-1070789.27556289,-41243.8306309676,-1321473.56755712) (-761533.98805182,-15218.9808657798,-2110925.2027365) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-672584.128588643,61389.8782456284,20217.1943339441) (-683120.994631457,55577.1915925854,36789.9410811287) (-704983.41107197,41952.2540909521,44519.3786894486) (-739337.8126418,15120.0238270479,35007.0674066711) (-787009.572260575,-36215.4485386003,-4238.4662406197) (-847769.798015345,-132777.727731423,-86819.1329946956) (-920973.642548294,-288705.307586002,-222282.420106285) (-1011730.428757,-248127.982450719,-593311.554197473) (-1025897.85003004,-103510.988453924,-1295516.62238573) (-741299.31611803,-32496.6893001458,-2095775.65546995) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-705681.073157873,85528.5959659346,14403.7612335705) (-713320.312321642,78177.7076625169,23074.7650326276) (-727990.99576645,60527.7391461527,17596.2384098956) (-747196.395963105,23807.2114209824,-16389.7138625044) (-763556.519734663,-55997.4118639074,-100856.006793572) (-759488.154146243,-257980.28530883,-242809.013148112) (-711481.795367507,-933340.118774889,-181705.912306864) (-781769.9903251,-751610.381157113,-448679.122144911) (-897415.23550383,-191604.027669313,-1224528.75750625) (-689767.02151705,-44821.1799076856,-2063316.88609495) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-760276.513858821,94952.0265532969,7037.05352643616) (-764082.229236326,88010.7735355206,5315.71498859258) (-769017.54512525,71700.0098173539,-19245.9155154717) (-766483.216890475,39551.4188171058,-96303.6404357057) (-731508.549618308,-20356.3796806989,-302923.603700982) (-584527.366248976,-108075.464813184,-918220.714364014) (-2.68701006260102e-05,-4.21818957641084e-06,1.31064835135156e-05) (-47.4270647155655,-66.7153750697373,111385.612912449) (-584946.564302113,-111500.664310383,-1077686.33655761) (-587891.376985641,-20866.0377229618,-2018432.74250436) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-840618.777302622,70699.0130241116,17.4402174332212) (-840563.141733054,65939.5415602005,-11167.1518986207) (-835797.945695462,55604.6145886844,-51564.8790552093) (-812420.312792549,37751.1831976189,-156352.143061425) (-734434.911407311,10498.4199698367,-390737.396365129) (-515229.671667629,-18506.812843368,-810259.921006622) (3.52245326535468e-06,-1.65416514508603e-06,-6.61487221092023e-05) (-6.01148395453413e-05,-8.73949282976944e-06,2.97238189456889e-06) (308.136820098794,365.790984208847,-986996.599967032) (-445714.916310735,-4205.82833396288,-1997479.66848716) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-947755.842963089,-22558.7131510429,-4837.74327633034) (-944651.462788068,-24310.2573934672,-21712.607849614) (-932535.036900896,-26872.2869008785,-69645.474574069) (-894467.100172085,-28072.0102021306,-183788.042293663) (-789660.836431752,-24343.1517404449,-419883.380628367) (-531423.028459252,-12930.8335853527,-791874.572324962) (-4.56034271491906e-07,-5.04546160331231e-06,-5.03301339483547e-05) (-4.48791668929118e-05,-1.71269746508417e-05,3.32321549581185e-06) (29.3306678381219,346.296626224476,-991614.070674283) (-424954.025480517,-16429.8243023291,-1993256.19740487) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-1070540.96152958,-243738.435068096,-6705.63193288476) (-1065658.48028673,-242687.713677295,-24494.9916228176) (-1049495.98394616,-237871.17916061,-71098.3017611627) (-1003639.66634905,-222225.854846521,-180277.26203728) (-883560.272781699,-182175.428791287,-408609.38796492) (-593608.732377428,-102038.728555476,-779011.520684899) (-6.80890959799354e-06,-7.78784520379779e-05,-5.89783161870095e-05) (-7.72409226181053e-05,-1.32081911254568e-06,2.91788753902398e-06) (23.509213737349,-60853.647384984,-1008560.47577581) (-457106.528397446,-88037.3087146616,-1976933.63127326) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-1167708.73600829,-675266.126306983,-5808.81430078643) (-1162572.02881515,-672737.381999331,-19865.0029858503) (-1146338.80289281,-663849.210437133,-55611.4108538213) (-1101395.59777123,-637344.66554914,-140376.308030236) (-982472.756852755,-564367.753850664,-328587.370291534) (-679948.218781326,-377720.642160666,-676992.145849866) (-8.99948728370235e-05,1.73827920964533e-06,7.38274442258665e-06) (-49.8690029900715,-53170.3574863093,-61010.7462783834) (-596026.720208548,-342380.703911581,-1035874.61276825) (-599512.294131788,-257745.646314469,-1889019.74381793) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-1137418.57559918,-1375480.09509508,-3428.36208820716) (-1133410.10213338,-1373328.34305501,-11151.0140670317) (-1121134.810487,-1366375.17862336,-29248.6420707029) (-1087878.45939021,-1347768.81879001,-67503.8437065794) (-999397.516456373,-1303268.88222605,-141989.962120682) (-754836.795026429,-1205517.15322261,-299256.120546657) (-151.519447753913,-984752.857259707,-53203.2905368493) (-605533.730718465,-1035031.11781049,-350322.366264267) (-818347.316165072,-949348.290387807,-951386.601526459) (-638983.717201704,-599454.64743169,-1631421.13688491) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-796438.723028134,-2165707.67043082,-1365.46447486171) (-794338.907927636,-2164310.35149371,-4310.3162921972) (-788167.050746353,-2159947.5896907,-10755.2165395693) (-772445.713068584,-2149049.08990493,-23118.5083510274) (-734902.685902186,-2125756.32825774,-44276.4862073259) (-652446.585509491,-2081375.04304464,-78498.0196996778) (-514177.061068959,-2002799.04362473,-103520.292654187) (-616596.654183722,-1899207.23156052,-264767.550733027) (-643011.477349437,-1634306.32660914,-601681.683436746) (-467867.576528104,-1032424.50470113,-1032194.15570982) (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,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,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) (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) (-684567.568212577,16214.0583441082,11228.6857365844) (-690981.571541221,14612.4592387424,18409.2834938063) (-703676.110725313,11144.7140862242,16203.5007964766) (-721873.350236456,5094.82971651627,-3388.43190854234) (-743712.529204746,-4278.7888488111,-52890.1006349326) (-766007.51702103,-16507.0956898571,-151406.015779098) (-782457.066140893,-25225.1861146943,-327660.549128785) (-775181.253034079,-10740.7996882798,-621887.810387913) (-683839.192364886,3603.18124727165,-1012441.07483317) (-429182.800810634,4968.25136277526,-1349760.51343715) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-694459.1902808,28475.8818231474,9613.23821312357) (-699322.495374531,25554.063933208,14873.1342617324) (-708195.937716216,19091.9634846489,10138.4115075527) (-718684.573505641,7343.92704741057,-12763.9249595036) (-726167.071700664,-12723.2951168806,-65161.9192513439) (-724782.677105843,-44481.9640812565,-160174.171769449) (-713976.243122541,-79216.6176158286,-313180.139694063) (-709892.816988941,-18198.3373237381,-607560.21382666) (-643660.426032811,24899.1424858467,-1011093.59906246) (-411649.351278452,18973.601319848,-1354748.91385911) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-714996.900264522,31091.7222667385,6699.98666305852) (-716958.591271148,27544.4502480872,8347.87929768524) (-718492.032267884,19594.2999894054,-1653.42070563327) (-713255.433719132,4606.12219862145,-32856.5781008209) (-688290.248984269,-23863.6800268547,-96982.4639412388) (-623034.606430872,-82962.0509363861,-194955.924801486) (-511641.19264819,-221914.72894844,-252098.416188191) (-517720.096661382,30066.7865352502,-564413.433710897) (-540669.466626827,120757.327561399,-1017017.38766346) (-371059.293753513,56998.656212093,-1373750.17031923) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-746938.224942531,14604.0202362226,3149.41311422575) (-745218.723677928,11524.0398369455,306.317966971223) (-737281.09772642,4920.35864045861,-16756.1880829123) (-710866.735487485,-6366.66110163531,-61399.8861856456) (-637380.294496411,-23266.853103304,-156124.968231091) (-450906.732242253,-38771.350496731,-333936.30267747) (-2.33904655142655e-05,-4.32513570723692e-06,-2.78009483473063e-06) (162.404488202988,62.7695958640159,-473646.389711292) (-330799.683347509,473709.865643718,-1080745.80874822) (-302203.463656033,121283.554587631,-1430718.62045337) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-789485.163284496,-36522.1128911093,-7.48089079061317) (-784363.343728225,-38214.5761081639,-6468.66295050879) (-767959.487358111,-41158.8107609011,-28227.9518865012) (-724283.633914373,-44302.8065696781,-78428.4852966356) (-619676.661053005,-44759.5967552874,-171693.991998959) (-395701.672199325,-34738.2442704427,-295255.097693551) (3.13312124127728e-06,-8.18689198235511e-07,-4.90057439235737e-06) (-5.3737719623872e-05,-3.47166830569142e-06,-8.25869405378718e-06) (416.365993325851,27.6292008665646,-1433157.41092823) (-222155.685790585,16503.2924393088,-1551936.37930005) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-836962.700954474,-145502.361166224,-1812.89373350325) (-829554.159316601,-145453.184102026,-9671.58921110972) (-807769.923271983,-143930.80954935,-31664.7040515779) (-754030.63187494,-137306.760864064,-79097.2180543355) (-633395.207898213,-118307.940143509,-161814.503199656) (-392165.797766473,-75158.1035823129,-260651.874580566) (-9.3241351606016e-08,-2.58075125812472e-06,-2.39360370587997e-11) (-3.78021783214502e-05,-3.74545347961249e-06,-6.80322733357734e-06) (78.1782233047483,274.993599373725,-1416669.29991588) (-208093.304617543,-48637.2126314693,-1568389.51570807) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-873021.937743853,-341122.204869428,-1899.18008253123) (-864839.936533516,-339763.299439418,-8407.60849835992) (-841634.310800064,-334824.242844103,-25375.8483497014) (-785898.497376803,-320055.926118319,-60367.8520676941) (-662269.597804252,-281146.720268262,-118819.746920388) (-413647.577485817,-188396.348434532,-185542.65695978) (-4.97883079342167e-06,-5.35171910051786e-06,-2.82740297480462e-11) (-6.45436547727958e-05,-4.8171610710846e-06,-1.1625588527867e-05) (29.5642227510914,-656902.837092963,-1465742.18150551) (-221214.016306963,-230425.403459694,-1519846.50276779) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-862893.789328433,-645234.260840125,-702.890709155997) (-855567.244056699,-643786.457358524,-3684.51754849615) (-835203.035043702,-638795.641065634,-10848.8871760717) (-786732.734494902,-623906.373143933,-21661.3034267838) (-677744.565365697,-581330.699502617,-26205.5156794864) (-444797.54907289,-452596.075463869,2843.54164141458) (-7.75239961675441e-05,-1.51707230931763e-05,-2.44903222875193e-06) (16.238764455458,-658597.258913508,-657041.321943122) (-305888.666214064,-564677.969692476,-1039404.24333809) (-282611.721291339,-297192.33203609,-1289537.88760214) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-748301.26727069,-1034917.93970916,566.370540540521) (-743086.408810012,-1034635.29996677,1091.51982542024) (-728954.350615153,-1033725.61413441,3841.03302234773) (-696211.150897987,-1032521.1080199,20788.4594060865) (-623498.529837619,-1038873.57942769,102432.352712403) (-457221.89707332,-1103138.01107774,455359.390373166) (-10.2267521764064,-1498726.86380658,-658603.736092175) (-313504.224348767,-1046037.73110582,-563192.770269555) (-400173.779048616,-773978.827301973,-772065.449776518) (-287423.972057045,-428328.495606467,-992489.031350803) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-462250.43701758,-1369827.45243911,721.226719407386) (-459626.500255163,-1370464.82639257,1838.34547272507) (-452733.826669857,-1372192.03030027,4871.53756209129) (-437532.003832437,-1376861.58349906,14298.3038051012) (-406553.646583945,-1390989.12187122,38064.8069304009) (-348268.815214865,-1428951.77142482,59700.7969828444) (-258651.796465988,-1488582.71197958,-205968.619447127) (-294851.889158564,-1282527.0205022,-291224.095075912) (-290422.212852829,-991210.129334152,-426582.057540333) (-193920.759122816,-564492.46309251,-564364.907459583) (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,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,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) (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) (-695607.569368325,6343.68432622723,4696.31682951629) (-698243.379664366,6280.84232790381,5677.28262475514) (-702668.655391514,6595.87217453809,-1926.04488358055) (-706795.992214782,8244.75095852028,-25248.1538637727) (-706970.603272202,13276.2417878571,-75266.3215841717) (-698077.493419255,24725.3701958491,-167921.715381792) (-673151.588857125,43233.5065960783,-320460.699261635) (-619575.669321958,54523.8873870652,-530590.170360826) (-500330.374860593,43780.2193942742,-757879.207259392) (-288790.840106827,22489.5941598202,-920760.762123026) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-700814.236133032,8054.29528015651,4644.43489829996) (-702375.647025495,8033.32441384695,5945.10446332139) (-704221.527841715,8879.25693130349,-312.690167945666) (-703288.118096579,12802.644271534,-20267.0388900206) (-694472.487785569,25204.0716655,-63889.4526827603) (-671777.504295444,57284.7754625958,-149454.030759904) (-634046.952519545,123045.455094429,-309195.269861256) (-597097.5891394,173931.814977965,-541398.425301707) (-489977.224676607,127881.219540725,-779182.626804368) (-284651.061516826,59547.5335553261,-943238.855961501) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-710888.855217199,-695.606384844645,4641.8566176772) (-710472.086357088,-562.723228432346,6751.39934589539) (-707373.880352687,923.866125890747,3588.63823610816) (-696047.31561819,7092.57375866459,-7909.40935196152) (-666310.172642066,27177.3747113969,-31862.7887400612) (-603152.146326806,89235.4099476893,-83695.8833292184) (-503620.172680241,289609.059301756,-258280.507504498) (-562542.6456182,547925.899255817,-587452.042825535) (-483366.660658402,330612.351987267,-847485.981240492) (-282052.698151065,125827.665051455,-1002772.70833908) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-724530.386974767,-27874.5957271361,4771.15137452561) (-721641.833291472,-27523.2861340939,8154.82389372827) (-712174.271363745,-25664.9676601159,9636.83131705731) (-686509.951504207,-19697.8651249213,12070.486217364) (-622821.367248466,-5472.26652966907,30161.2002104903) (-464642.452068489,16482.0538349251,116650.276149491) (-1.45531555661302e-05,3.00433736647308e-06,-1.04323297317993e-05) (-652216.955915437,48.3552579251218,-804769.74917314) (-557703.367783022,804969.034634877,-1052222.74738524) (-301343.953577641,201330.523249859,-1128585.11566202) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-738402.484590416,-83991.98060683,5034.70618560952) (-733342.794893239,-83348.5071921997,9839.37840873211) (-718316.118069657,-80876.1853037454,15407.2267639074) (-680736.825477949,-73969.414217149,26131.9674197104) (-592672.050687474,-58426.4727066408,52081.5632311502) (-396136.310439902,-31175.6645474988,100173.919854152) (5.07584096807893e-06,2.78571848734519e-07,9.60559470187586e-07) (-3.51961640136085e-05,-1.47889749765661e-06,-1.64321018979642e-05) (-1016865.33123433,-301.209060431195,-1655851.06292196) (-377324.625892774,30547.8779358311,-1329899.47750575) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-744958.563555247,-181535.588239005,5539.47023294844) (-738703.39383349,-180699.027229598,12039.2247872383) (-720912.029877463,-177708.648887153,22013.7949761267) (-678310.111328588,-169117.862831467,41441.7230440929) (-582387.796596677,-147214.110563116,79221.9495990359) (-378721.913599347,-96682.357872587,131284.758756996) (8.89413964022759e-07,-1.47942860545333e-07,1.83988445456914e-12) (-2.56806526856198e-05,1.10297051795746e-06,-1.47033918115599e-05) (-962910.034338998,226.529689521129,-1624916.7499844) (-380278.349681206,-61784.2046239055,-1360399.62236101) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-729780.093249922,-331006.157000707,6228.72426777479) (-723571.636144135,-330498.461256304,14759.8579050988) (-706535.929836926,-328349.238415493,30302.0664702997) (-666981.507104326,-320864.88345632,63132.0968226771) (-579329.806139974,-296660.828438673,129639.023033956) (-389017.7739759,-219590.351724868,227917.213376317) (-2.5861140648811e-06,-1.42519457337122e-06,-2.03060794581687e-12) (-3.52428533953969e-05,-7.50961300833917e-06,-2.06882198817104e-05) (-1055776.55409286,-962814.559967167,-1687040.29279003) (-379492.736659943,-291836.606163489,-1298709.17089746) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-669729.731100687,-530742.104599233,6571.88937078482) (-664750.415785294,-531392.819252203,16649.4190952807) (-651818.973217672,-532600.459508985,37516.5783627392) (-623839.992862036,-533410.942093969,87169.8953675226) (-566738.252649129,-527104.628293822,206607.382506103) (-440211.855750301,-465042.469570231,447473.807028875) (-4.52234759530464e-05,-2.45787677139995e-05,-6.94841969671008e-06) (-776980.009451263,-972058.023867361,-962982.590404325) (-556626.805352348,-658901.190673084,-1016157.82056013) (-281641.279348469,-301985.486309512,-1006979.38235698) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-535669.039161163,-749114.941792943,5740.60908417785) (-532531.668999338,-751395.346895527,15188.39691683) (-525144.845375121,-757676.728672857,36455.1608406672) (-512592.643159568,-773928.269920082,93353.9809283554) (-503870.331300488,-821964.291678602,268585.445776005) (-571969.791713152,-994171.104329023,912461.975174629) (-1182983.33043357,-1757279.70274018,-972144.707041044) (-580559.481850911,-1027256.19055814,-649891.282848118) (-385513.838016333,-664130.168544048,-659322.246009447) (-208844.70461531,-334779.66338612,-705107.336374569) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-306700.684854885,-907979.830320668,3315.13636503082) (-305235.351916241,-911162.872734673,8691.5138652573) (-302021.219386162,-919680.712279569,19982.8901882731) (-297180.539533528,-939482.374321366,45185.5302906532) (-295049.086944972,-984561.299229221,96277.978202293) (-314663.275286977,-1080752.22448596,149253.558431346) (-394593.305695775,-1229882.47158864,-242202.163490409) (-289945.663449579,-987552.680990589,-286811.898766946) (-210605.054080584,-700682.296394395,-330076.929688843) (-117809.506435087,-370508.003255003,-370459.842507688) (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,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,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) (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) (-698682.65857951,1119.08673728769,1956.0024739016) (-699588.802130322,2125.40393059162,1176.02100926619) (-700430.408833724,4991.8427398418,-6054.06828837153) (-699066.674691579,11686.4093217812,-25469.7951333574) (-691710.049905918,25751.2024098611,-66481.5509095016) (-672476.781209099,51012.3138052983,-143094.57692496) (-631607.788681368,82337.1507106569,-266975.527811374) (-552230.68273904,77016.2514095337,-411336.765803824) (-419631.1580848,54171.2719585274,-546207.254538147) (-229778.698560072,26650.5370010121,-631869.933085908) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-700681.504283675,-1990.37202662013,2976.72691455092) (-701273.630200984,-12.5855223593088,4012.69954299265) (-701562.957948764,5749.0221544569,596.950235427629) (-699556.288076649,20014.5881149144,-11463.0585776354) (-692257.151205813,53348.2530057584,-41275.4457532865) (-676139.091303834,125893.41614716,-111794.961086759) (-644612.716548497,253422.341542288,-272314.38788944) (-566626.761324585,208480.068253495,-434249.032548214) (-430782.180137365,134496.127366907,-573768.932495835) (-235379.89620572,62147.2543262592,-658536.815132188) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-703537.508745393,-14306.6698980435,4964.95139961911) (-703613.354729637,-11661.1308713532,9754.76512116022) (-702884.175187366,-3829.94605679868,14844.0281670995) (-699641.559145347,16646.6181171871,21806.2416919841) (-693070.783771844,70702.8207493539,31212.2850781662) (-689534.847602997,227765.273583381,15723.1289181349) (-710307.453863324,793099.086268021,-317266.33462451) (-621302.473967864,458247.762875828,-508274.200897176) (-467323.738678857,256298.142494198,-646119.138004009) (-251877.021152588,106537.378210393,-720684.938886616) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-704695.073633143,-41688.2628029973,7546.27956333286) (-704141.558670651,-39090.9498763856,17475.8239475482) (-702014.370579444,-31699.2780477111,35185.2551541631) (-696538.841900802,-13853.0212596374,75713.7849275791) (-689326.650239905,24727.2776480077,188194.61102036) (-714692.76155148,85029.0624315069,580981.131655226) (-1053810.82134158,121.933126160207,-652208.972318488) (-788220.996897172,652317.567604512,-710274.736065446) (-561676.520922643,345852.315140849,-795855.75557247) (-288783.892831394,125368.716835549,-827247.154943874) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-699638.388560128,-90463.6097088376,10011.2508755546) (-698550.980455109,-88564.0233850535,24692.5099460905) (-694847.224782465,-83343.3291616252,52867.6677728091) (-684366.814308149,-71485.7923984415,114130.42774181) (-654132.319236562,-48135.8006471439,248453.77458605) (-544969.392564482,-13759.138532474,496075.057674608) (-2.25065749461696e-05,7.08618297537979e-06,2.26915779050676e-05) (-1042200.62747547,-1.52623557798639,-1016755.36598835) (-725164.72693953,53691.4784103204,-1016295.13355261) (-343260.179498979,27614.0487575547,-952604.911868416) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-680978.856307381,-166215.846122256,11772.5291655551) (-679775.229434134,-165438.738790495,29719.0801716381) (-675837.434162756,-163219.666842622,64520.8221379291) (-664793.44612409,-157746.385752593,137264.750287581) (-631780.151091458,-144190.334429759,282711.638564978) (-512551.476530775,-107007.670796789,509789.733760719) (-2.03194352797204e-05,1.54838588718319e-05,1.52122935266012e-05) (-979913.682740522,169.459675162853,-962993.545720353) (-737357.941653855,-92556.2318698621,-1042297.92812532) (-353853.50810702,-60959.1499838728,-980149.570958078) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-637613.782017132,-270789.003565125,12406.8462100788) (-636771.631412711,-271559.222620103,31727.3253082615) (-634293.946611882,-273525.552125447,69791.2273660442) (-627926.248863308,-277676.456132015,150666.039504445) (-608577.751063999,-284071.849612487,319795.499611195) (-522180.399665592,-270777.049396257,616727.503900363) (-2.69877689732492e-05,2.36591193407151e-05,1.92755047543905e-05) (-1079738.8664657,-776876.964604701,-1055794.13535093) (-729767.288724109,-463627.336884856,-1010732.29570469) (-337983.193342862,-193990.827787864,-919210.161217782) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-555384.554115257,-396617.904151759,11483.7236012004) (-555222.64152685,-399131.73499535,29528.4617180057) (-555337.955602772,-405892.261807763,65414.1537854192) (-558086.301323177,-422158.076455187,144142.082569731) (-575465.113672837,-464212.661273665,333009.755254622) (-668718.685497149,-596738.638356704,887478.173961923) (-1208060.25103968,-1182777.35508925,-776930.289615497) (-812607.247667266,-775529.513057727,-742650.502946459) (-534022.843701793,-487721.242252689,-741160.559229172) (-262314.569546441,-229163.282648041,-725314.814171032) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-420866.976835455,-520220.906429393,8800.93995192579) (-421207.509903468,-524172.139144733,22517.1850054404) (-422806.63262381,-534602.990195998,48889.7006423676) (-429262.564795987,-558538.823531451,101940.369355055) (-453393.163969509,-613135.960027792,200386.500778202) (-532859.740159612,-736814.484039789,301352.294907744) (-725894.655386093,-968769.33933785,-369744.395891128) (-534403.39359885,-736549.563968346,-454880.433232579) (-356288.044514153,-489173.298570764,-482654.170416681) (-180666.444073453,-243727.940568089,-496267.773038485) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-230173.120004311,-601471.871082398,4723.39980243291) (-230487.810749852,-606074.9159145,11878.6354058095) (-231728.485353241,-617770.278046939,24753.1892238275) (-235787.771716135,-642402.875004853,47224.4728798389) (-247985.119033777,-689580.167863904,76604.7128047573) (-278049.309726587,-766102.804595799,69279.0678003775) (-321284.272342445,-835224.052873685,-137575.252017125) (-259043.792843974,-697532.942462381,-207493.744128696) (-179989.661078137,-490014.367279475,-237268.068422433) (-93467.9831475083,-252683.886342278,-252653.645935824) (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,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,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) (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) (-698857.87907092,-818.948987630858,994.169479036477) (-699320.616251175,468.517139631501,257.466460259434) (-699326.602776975,3888.77029156776,-4735.10988805183) (-696834.689308567,11232.3520487169,-18199.4473197837) (-687780.523588627,25238.0823393632,-47367.0559764403) (-664840.487603016,47353.1437304698,-102356.49331299) (-615566.605705781,69327.5537301014,-187725.230018679) (-523834.408039444,62646.4226986953,-278767.927416965) (-385285.094992218,43086.1954672765,-356200.185976828) (-205250.424101475,21101.794407463,-401830.254842886) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-698959.731170157,-4812.49191444007,2271.7698132915) (-699836.792947153,-2316.58204573237,3620.0317448213) (-701086.428602216,4478.08057093192,2554.19211890841) (-701488.841474065,19952.066232884,-4232.96866784095) (-698470.879851109,52512.9816344406,-25294.1393176242) (-686140.523569177,112472.382725403,-80411.9460472165) (-648989.14792296,187714.022708467,-194421.983651116) (-553858.196252703,153831.891058087,-298376.017082391) (-405809.052260888,97971.0649000968,-378234.01439169) (-215230.942535184,45662.6475624016,-422943.821217167) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-697618.790699378,-15492.1539390804,4760.94397862381) (-699340.640178478,-12198.3995648185,10370.0469465521) (-703074.22380806,-2965.54688443046,18003.7230226078) (-709688.213692339,19704.2300816184,28298.2137208617) (-721253.450658604,74382.1346919391,34611.7275501225) (-739860.151117011,202600.244701313,-5190.83091177287) (-749058.934393816,449594.130728847,-228319.458401657) (-632902.474450246,291373.396324296,-354260.963185493) (-455039.089914338,161998.137704022,-430572.684753934) (-237814.572698794,69675.1301097936,-468647.615755118) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-691521.93924881,-36640.8709517222,7975.58262830977) (-694391.437061266,-33461.5559750454,19488.6174291511) (-701561.60555311,-24506.1383449599,40576.4438633439) (-717454.246720371,-1680.42473916992,82876.5035037074) (-754684.694197257,59896.2616505532,162720.420502446) (-845855.521205124,254774.574350144,241708.850507259) (-1029846.10974379,1053958.45039651,-386620.180758193) (-798147.574827084,398358.88507215,-483679.091576127) (-542848.766393306,182403.579185048,-522912.287586493) (-274552.692280967,70927.2035175109,-538395.561544638) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-675653.159245991,-71674.3322597345,11048.2319938739) (-679661.50757251,-69615.3024170723,28312.5055533022) (-690158.748866402,-64183.483392018,63301.3746843004) (-715269.597053261,-51820.9292203733,144344.661910615) (-781668.398157434,-25737.9623382797,357514.964820323) (-992238.936618762,18709.100821659,1040849.98240309) (-1831000.89782524,82.3711072458694,-1042227.20418217) (-1048762.66914022,62335.7299918293,-699642.007437098) (-649591.974470256,41551.414299714,-634362.595021038) (-314399.153887023,17050.5577177512,-609346.974833238) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-643087.837521374,-122557.744832241,12992.3937865012) (-647861.243928402,-122167.261891639,33630.3677553372) (-660483.456290552,-121456.962791378,75549.8692824921) (-690628.26303424,-120709.432118308,170273.189090576) (-768227.813600039,-120879.878194148,401862.767455019) (-997614.125171784,-116571.084122844,1022205.60104053) (-1793052.00404447,-64.3224110714528,-979950.220191643) (-1077570.73583737,-99579.3272260858,-720378.109876873) (-672510.516930254,-84885.0390905148,-658789.081210241) (-324220.127449796,-45040.2165623732,-626331.687587337) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-585199.337727041,-188216.935612533,13244.7464902005) (-590178.804435552,-189705.596676885,34190.2542982881) (-603405.808785113,-194302.035710387,76147.1893905279) (-634809.002309751,-207652.440237684,169972.950956351) (-714756.674311172,-250836.478209931,406108.474219307) (-954162.028476301,-417185.692357343,1138704.71126452) (-1864610.90075886,-1207815.61392688,-1079486.9510048) (-1043428.91761568,-509662.130044655,-705714.097036257) (-633598.185524473,-267834.467565665,-618933.771760739) (-302407.67271395,-118298.933692278,-581250.575259746) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-493344.141299862,-261872.229140677,11614.8807127484) (-497857.166367084,-264875.605633937,29419.414510033) (-509707.086929855,-273146.767927426,62633.2780541552) (-536581.288512458,-293200.919412216,126676.744417967) (-597285.464326075,-342019.630512321,239680.247373593) (-733522.896069825,-460731.825287435,348030.59087636) (-985989.232425058,-700453.567512747,-381402.474152392) (-742413.028148863,-497239.313390817,-464019.510324638) (-486488.177334142,-309917.092991191,-469471.551266771) (-239613.612477425,-147458.430042625,-463013.011985428) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-361845.663271417,-329341.591130847,8448.04842613402) (-365286.318037837,-333288.534917667,20939.7858442321) (-374030.128945524,-343379.450470775,42395.9647092945) (-392850.227251314,-364950.116758061,77732.8245104658) (-430927.229684156,-407626.046161618,120873.305874409) (-499089.079058233,-481892.902480869,108263.721966464) (-575782.942912527,-564072.28457177,-178229.273448082) (-471947.881912109,-461162.626938035,-276761.471587601) (-323024.749129084,-312870.097905813,-307071.762058043) (-163035.189528594,-156515.92706814,-315645.519577388) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-192810.35183559,-371103.59561273,4399.23631316192) (-194642.283284108,-375419.774965248,10684.9488949976) (-199198.672065917,-385925.920729921,20701.6058668203) (-208522.377425278,-406509.449676047,34995.5444939466) (-225697.479896452,-441462.994277722,46544.8534727227) (-251499.02853919,-487946.470880632,26048.1406850865) (-270122.275042237,-513883.13242351,-75303.008763382) (-228589.66661219,-438486.52201289,-128433.23992031) (-160548.584011751,-310003.721683546,-150740.693208964) (-82311.0649230017,-159216.903005474,-159196.635496136) (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,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,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) (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) (-698490.447578175,-871.645576466886,504.214083721058) (-698961.064572881,-19.4305671896696,164.092972619372) (-698998.017240135,2168.44734887673,-2332.93991309568) (-696508.237409531,6635.40301933609,-9294.7948314667) (-687083.543762561,14614.4235426442,-24606.1982001728) (-662264.370271705,26106.8106203577,-53289.1261518414) (-608677.501377032,35959.7855685028,-96138.0160490966) (-512377.662310279,32680.0373230911,-140274.799101352) (-372087.645227141,22618.1904198264,-176090.439286254) (-196101.620707233,11140.6030679284,-196379.845748428) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-697752.450193519,-3408.71421548968,1329.78766238489) (-699046.385824143,-1770.33724379266,2290.28721597776) (-701253.511422946,2531.52008882376,2094.29729676415) (-703236.106670288,11801.0508215078,-1324.08530918742) (-701816.545801359,29764.4278077906,-13128.4236240809) (-688494.784255288,58774.8466261618,-43442.198943771) (-644748.496795679,87694.1382612297,-99417.2027637791) (-545123.172207036,74872.2392285935,-150344.428714948) (-394754.491264736,48795.2297649701,-187576.02905624) (-207254.8206644,23086.8660492162,-207498.413908309) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-694560.651447433,-9413.92265821844,2947.06919078297) (-697426.775753529,-7274.38514981556,6537.25267185893) (-703856.524213591,-1480.86808093134,11331.9412471448) (-715097.989431342,11912.829542794,16629.9382648653) (-731626.898581252,40933.3069653244,15834.5070299829) (-747297.742639054,96607.8135584292,-14560.8683802412) (-732507.530000333,168841.799180298,-112259.933692794) (-620086.55225006,126207.627544695,-176411.24420908) (-443649.650790518,74284.7922932046,-213290.245861139) (-230398.118369354,33013.4008208182,-230633.234962179) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-685214.746831457,-20748.8266492623,5027.71157369069) (-690169.564728654,-18714.5116158678,12245.9657071281) (-702353.905860994,-13097.1061043578,24654.5040384404) (-726977.840701186,506.608496633188,45584.3190654134) (-772515.241274262,32934.7256935909,71413.4474141556) (-843862.030440674,108441.480831207,57586.2893769282) (-901352.85881415,252878.533553965,-154943.695926379) (-746357.990224399,147811.037562136,-228336.690546505) (-518059.09431543,75728.2926893746,-254569.863020556) (-263536.541848204,31145.3115684689,-263717.924200968) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-664527.75947355,-38894.3318218321,7020.10540012878) (-671501.798231342,-37645.2321301112,17791.1165732043) (-689258.707705013,-34381.8748172109,38175.8441246699) (-727405.585370576,-27116.0683420441,77934.5092806628) (-805360.928879448,-12290.9759413287,146852.741637594) (-952255.324364131,13338.1877443759,201972.422469793) (-1154219.98212085,38088.417469657,-260018.377150293) (-894192.661823069,33626.7601524529,-300404.107057755) (-593853.747257799,18729.6561523556,-299143.697733199) (-294783.267508211,7292.82673154107,-294907.099275079) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-625860.802227352,-64346.0977348802,8224.73061902459) (-634041.626961185,-64243.7364192674,21003.6179409637) (-655016.71372112,-64208.5661626864,45363.5667170067) (-700297.851693186,-64749.5228523667,92666.6098862735) (-792968.036405096,-67332.5946273466,172448.451377351) (-965481.270448536,-73075.848322912,226729.632721388) (-1192227.84237471,-71566.2452714761,-264439.866207232) (-927823.856383093,-65315.3193194677,-315244.66618959) (-612630.725133655,-45870.9189502033,-310523.882883635) (-302130.768421302,-23173.4869071183,-302146.928273473) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-561865.322745864,-95935.6555531536,8255.54283709639) (-570089.751714281,-97029.4828532893,20952.2365498488) (-591035.537296092,-100320.532106575,44693.9310047144) (-635659.797897877,-109181.536030051,89976.7397705262) (-725617.958077021,-133187.303327512,166692.732236538) (-892369.675251905,-196430.950045554,228255.480734779) (-1120663.38492924,-329073.577605655,-258184.702760638) (-862559.401467505,-208560.374199008,-295809.164029274) (-566800.327409082,-120674.634837297,-287803.30625757) (-278972.839821257,-55493.0758106893,-278918.550246691) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-466394.338309427,-129955.853783805,7070.3952402171) (-473464.401324374,-131899.549719747,17547.6970639653) (-491031.818920085,-137152.592529782,35704.4894774034) (-526713.094638881,-149230.58696018,65885.3465339567) (-592561.192975143,-175450.105367806,103423.877223322) (-696002.405464949,-226127.199796542,95599.6363694313) (-791654.488680962,-290091.640612727,-137717.044367591) (-654021.225280045,-226659.781253487,-208009.440181919) (-446115.51428305,-146398.216090559,-222658.521979752) (-223456.610214377,-70848.5885838915,-223460.011469597) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-336902.371350387,-159929.472491143,5030.32678630501) (-342015.340048572,-162328.851161852,12188.6502391455) (-354213.584808712,-168310.847820542,23530.3613930938) (-377715.306166022,-180427.724725717,39592.5780733371) (-417283.452046256,-202207.252042765,52705.9471103959) (-469987.007993186,-234140.634377243,31617.3106260481) (-501656.836347407,-258283.06162111,-74317.3749306905) (-427413.264395054,-217722.843204679,-127788.930496557) (-299705.343099216,-150369.082102213,-147137.470514773) (-152590.802182322,-75769.9243771465,-152660.522067791) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (0,0,0) (-177429.99983703,-177899.9135121,2590.08902239703) (-180065.75296119,-180463.260509533,6147.96804716069) (-186201.829493387,-186527.677596994,11367.9552510826) (-197542.465585887,-197823.229220241,17783.5479062155) (-215304.931503247,-215564.468143705,20748.21561395) (-236048.410008425,-236297.10524366,7454.06794960359) (-243525.970818665,-243676.449029056,-33748.8488660215) (-209787.141157868,-209867.016056287,-60407.2014687363) (-149365.532309738,-149428.989420854,-72530.3458521073) (-76836.8791116955,-76885.1049946555,-76889.3510459051) (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,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,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) (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,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,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) (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,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,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) (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,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,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) (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,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,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) (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,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,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) (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,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,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) (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,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,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) (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,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,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) (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) ) ; boundaryField { fuel { type fixedValue; value uniform (0.1 0 0); } air { type fixedValue; value uniform (-0.1 0 0); } outlet { type zeroGradient; } frontAndBack { type empty; } } // ************************************************************************* //
[ "huberlulu@gmail.com" ]
huberlulu@gmail.com
19fe078614bf6febfd11168c9c41219b9c7e9ece
4c6eb9be5aabe23647954427ac915d096167ad9a
/include/IKBenchmark/Squat6D/Case4.hpp
3fd2b94d3f9951392db8347a0c194f84009c869c
[]
no_license
zdkhit/ik-performance-test
a0a5ff913e4d00ea0076950a5ea037175b506c0f
989d2a4e994db99ee4e4eaa726e20a08a2917dd8
refs/heads/master
2023-03-18T04:53:05.914265
2020-12-22T13:31:43
2020-12-22T13:31:43
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,025
hpp
#pragma once #include "SquatMotion.hpp" namespace IKBenchmark { namespace Squat6D { template <typename Scaler> class Case4 : public SquatMotion<Scaler> { public : Case4(); virtual ~Case4(); virtual void collect_log( typename SquatMotion<Scaler>::Model &, typename SquatMotion<Scaler>::IKSolverPtr &, const typename SquatMotion<Scaler>::BodyNames &move_body_names) override; virtual void collect_log( typename SquatMotion<Scaler>::Model &, typename SquatMotion<Scaler>::IKSolverPtr &, const typename SquatMotion<Scaler>::BodyNames &move_body_names, const typename SquatMotion<Scaler>::BodyNames &fixed_body_names) override; private : void set_benchmark_param(typename SquatMotion<Scaler>::BenchmarkConfig &); }; } }
[ "s16c1077hq@s.chibakoudai.jp" ]
s16c1077hq@s.chibakoudai.jp
0c2f59e97ebd49ebf881cbc2a1aa7f335c2b8511
79cc728daf0813ced0f855a824f42ac2d390e97e
/Cpp/cpp24/24-2/24-2.cpp
dfb96c3853f7998d0ba7a6f13f0bd093ccd218aa
[]
no_license
ueclectic/step-homeworks
ed2d7f3a6ccbb8dd7e3cf91b04fbf49c48ebf24b
37dab02cde52bc5b1ad447ccc8edd2dab67448ec
refs/heads/master
2021-06-01T08:23:12.741134
2016-03-11T17:16:54
2016-03-11T19:51:51
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,544
cpp
/* Создать класс для работы с матрицами. Предусмотреть, как минимум, функции для сложения матриц, умножения матриц, транспонирования и присваивания матриц друг другу, установку и получение произвольного элемента матрицы. Необходимо перегрузить соответствующие операторы. */ #include <iostream> #include "Matrix.h" #include <cstdlib> #include <ctime> #include <iomanip> using namespace std; ostream &operator<<(ostream &stream, const Matrix &output); void RandomInit(Matrix &source); void main() { srand(time(NULL)); Matrix a; cout << a; Matrix b(3, 5); RandomInit(b); a = b; cout <<"a:\n"<< a; cout << endl <<"b:\n"<< b << endl; Matrix c= a + b; cout <<"c=a+b:\n"<< c << endl; a++; cout << "transposed a:\n"<<a << endl; Matrix d; d= b*a; cout <<"d=b * (transposed a):\n"<< d << endl; } ostream &operator<<(ostream &stream, const Matrix &output) { for (int i = 0; i < output.GetVSize(); ++i) { cout << "\t"; for (int j = 0; j < output.GetHSize(); ++j) { stream <<setw(4)<<setfill(' ')<< output(i,j); } cout << endl; } return stream; } void RandomInit(Matrix &source) { for (int i = 0; i < source.GetVSize(); ++i) { for (int j = 0; j < source.GetHSize(); ++j) { source(i,j) = rand() % 10; } } }
[ "matviienkos@gmail.com@7c4d67bf-a6d6-bd9e-cbfa-6ceb9c08b31b" ]
matviienkos@gmail.com@7c4d67bf-a6d6-bd9e-cbfa-6ceb9c08b31b
5d1107b32c1434feb9acebc890fe042f167dbd92
9e0866d8bf10f883c498efb8e074187064d8b27e
/Szeminarium_2020_tavasz/Bukki_Daniel/junius/basketball_algowiki.cpp
8ba9100c9946e2082a8a3463984214702d0d1853
[]
no_license
lacitoo/Algowiki
9c8c8e9f5bbfbfd87efdac7c397082e16cbe6f10
f16c37050c707f62f6c900f83f2799f8e3016d7b
refs/heads/master
2022-10-05T00:01:17.237224
2020-06-10T09:00:49
2020-06-10T09:00:49
184,261,131
0
3
null
2020-06-10T09:00:50
2019-04-30T12:48:59
C++
ISO-8859-2
C++
false
false
1,358
cpp
#include <iostream> using namespace std; // Az osszmagasssag nagy lehet, hasznaljunk minel nagyobb egesz tipust typedef unsigned long long ulong; int main() { int N; cin >> N; // Beolvassuk a bal oldali sor magassagait int* L = new int[N]; for (int l = 0; l < N; ++l) cin >> L[l]; // Beolvassuk a jobb oldali sor magassagait int* R = new int[N]; for (int r = 0; r < N; ++r) cin >> R[r]; // Hatulrol indulva: ha senkit nem valasztunk, az osszmagassag minden esetben 0 ulong NMax = 0; ulong LMax = 0; ulong RMax = 0; // Visszafele haladva valasszunk jatekosokat for (int i = N - 1; i >= 0; --i) { // Az i-edik valasztas utani legnagyobb összmagassag ulong n = LMax > RMax ? LMax : RMax;// ha senkit nem valasztunk ulong l = L[i] + (RMax > NMax ? RMax : NMax);// ha a bal oldali jatekost valasztjuk ulong r = R[i] + (LMax > NMax ? LMax : NMax);// ha a jobb oldali jatekost valasztjuk // A kovetkezo korben mar ezekre az ertekekre hivatkozunk majd, mint eddigi legnagyobb osszegek NMax = n; LMax = l; RMax = r; } // A kezdeti valasztas mindegy (vagy bal, vagy jobb): amelyik nagyobb, az a valasz cout << (LMax > RMax ? LMax : RMax) << endl; return 0; }
[ "noreply@github.com" ]
noreply@github.com
8eede1139f9c6d2251e5b312bf0f6bbd8e982af6
302f9c5c5b4b150506db82669c4ccc11fdd53f7b
/shared/ebm_native/FindBestBoostingSplitsPairs.cpp
ffb5e05bd13db65fe5fb8d1666274c411253255d
[ "MIT" ]
permissive
stefanhgm/interpret
7403c46e43f6b0834dc5e2a447609b0f8d5c36a9
0a15fb6f3ab02c1b3a93a775d46598254c6b4490
refs/heads/master
2023-05-13T08:16:02.138020
2021-06-03T07:46:22
2021-06-03T07:46:22
288,154,260
1
0
MIT
2020-08-17T10:47:42
2020-08-17T10:47:42
null
UTF-8
C++
false
false
51,809
cpp
// Copyright (c) 2018 Microsoft Corporation // Licensed under the MIT license. // Author: Paul Koch <code@koch.ninja> #include "PrecompiledHeader.h" #include <stddef.h> // size_t, ptrdiff_t #include "ebm_native.h" // FloatEbmType #include "EbmInternal.h" // INLINE_ALWAYS #include "Logging.h" // EBM_ASSERT & LOG #include "SegmentedTensor.h" #include "EbmStatisticUtils.h" #include "FeatureAtomic.h" #include "FeatureGroup.h" #include "HistogramTargetEntry.h" #include "HistogramBucket.h" #include "Booster.h" #include "TensorTotalsSum.h" template<ptrdiff_t compilerLearningTypeOrCountTargetClasses> static FloatEbmType SweepMultiDiemensional( const HistogramBucket<IsClassification(compilerLearningTypeOrCountTargetClasses)> * const aHistogramBuckets, const FeatureGroup * const pFeatureGroup, size_t * const aiPoint, const size_t directionVectorLow, const unsigned int iDimensionSweep, const size_t cSamplesRequiredForChildSplitMin, const ptrdiff_t runtimeLearningTypeOrCountTargetClasses, HistogramBucket<IsClassification(compilerLearningTypeOrCountTargetClasses)> * const pHistogramBucketBestAndTemp, size_t * const piBestCut #ifndef NDEBUG , const HistogramBucket<IsClassification(compilerLearningTypeOrCountTargetClasses)> * const aHistogramBucketsDebugCopy , const unsigned char * const aHistogramBucketsEndDebug #endif // NDEBUG ) { constexpr bool bClassification = IsClassification(compilerLearningTypeOrCountTargetClasses); // don't LOG this! It would create way too much chatter! // TODO : optimize this function EBM_ASSERT(1 <= pFeatureGroup->GetCountFeatures()); EBM_ASSERT(iDimensionSweep < pFeatureGroup->GetCountFeatures()); EBM_ASSERT(0 == (directionVectorLow & (size_t { 1 } << iDimensionSweep))); const ptrdiff_t learningTypeOrCountTargetClasses = GET_LEARNING_TYPE_OR_COUNT_TARGET_CLASSES( compilerLearningTypeOrCountTargetClasses, runtimeLearningTypeOrCountTargetClasses ); const size_t cVectorLength = GetVectorLength(learningTypeOrCountTargetClasses); EBM_ASSERT(!GetHistogramBucketSizeOverflow(bClassification, cVectorLength)); // we're accessing allocated memory const size_t cBytesPerHistogramBucket = GetHistogramBucketSize(bClassification, cVectorLength); EBM_ASSERT(!IsMultiplyError(2, cBytesPerHistogramBucket)); // we're accessing allocated memory const size_t cBytesPerTwoHistogramBuckets = cBytesPerHistogramBucket << 1; size_t * const piBin = &aiPoint[iDimensionSweep]; *piBin = 0; size_t directionVectorHigh = directionVectorLow | size_t { 1 } << iDimensionSweep; const size_t cBins = pFeatureGroup->GetFeatureGroupEntries()[iDimensionSweep].m_pFeature->GetCountBins(); EBM_ASSERT(2 <= cBins); size_t iBestCut = 0; HistogramBucket<bClassification> * const pTotalsLow = GetHistogramBucketByIndex<bClassification>(cBytesPerHistogramBucket, pHistogramBucketBestAndTemp, 2); ASSERT_BINNED_BUCKET_OK(cBytesPerHistogramBucket, pTotalsLow, aHistogramBucketsEndDebug); HistogramBucket<bClassification> * const pTotalsHigh = GetHistogramBucketByIndex<bClassification>(cBytesPerHistogramBucket, pHistogramBucketBestAndTemp, 3); ASSERT_BINNED_BUCKET_OK(cBytesPerHistogramBucket, pTotalsHigh, aHistogramBucketsEndDebug); EBM_ASSERT(0 < cSamplesRequiredForChildSplitMin); FloatEbmType bestSplit = k_illegalGain; size_t iBin = 0; do { *piBin = iBin; TensorTotalsSum<compilerLearningTypeOrCountTargetClasses, 2>( runtimeLearningTypeOrCountTargetClasses, pFeatureGroup, aHistogramBuckets, aiPoint, directionVectorLow, pTotalsLow #ifndef NDEBUG , aHistogramBucketsDebugCopy , aHistogramBucketsEndDebug #endif // NDEBUG ); if(LIKELY(cSamplesRequiredForChildSplitMin <= pTotalsLow->GetCountSamplesInBucket())) { TensorTotalsSum<compilerLearningTypeOrCountTargetClasses, 2>( runtimeLearningTypeOrCountTargetClasses, pFeatureGroup, aHistogramBuckets, aiPoint, directionVectorHigh, pTotalsHigh #ifndef NDEBUG , aHistogramBucketsDebugCopy , aHistogramBucketsEndDebug #endif // NDEBUG ); if(LIKELY(cSamplesRequiredForChildSplitMin <= pTotalsHigh->GetCountSamplesInBucket())) { FloatEbmType splittingScore = FloatEbmType { 0 }; EBM_ASSERT(0 < pTotalsLow->GetCountSamplesInBucket()); EBM_ASSERT(0 < pTotalsHigh->GetCountSamplesInBucket()); FloatEbmType cLowSamplesInBucket = static_cast<FloatEbmType>(pTotalsLow->GetCountSamplesInBucket()); FloatEbmType cHighSamplesInBucket = static_cast<FloatEbmType>(pTotalsHigh->GetCountSamplesInBucket()); HistogramBucketVectorEntry<bClassification> * const pHistogramBucketVectorEntryLow = pTotalsLow->GetHistogramBucketVectorEntry(); HistogramBucketVectorEntry<bClassification> * const pHistogramBucketVectorEntryHigh = pTotalsHigh->GetHistogramBucketVectorEntry(); for(size_t iVector = 0; iVector < cVectorLength; ++iVector) { // TODO : we can make this faster by doing the division in ComputeNodeSplittingScore after we add all the numerators // (but only do this after we've determined the best node splitting score for classification, and the NewtonRaphsonStep for gain const FloatEbmType splittingScoreUpdate1 = EbmStatistics::ComputeNodeSplittingScore( pHistogramBucketVectorEntryLow[iVector].m_sumResidualError, cLowSamplesInBucket); EBM_ASSERT(std::isnan(splittingScoreUpdate1) || FloatEbmType { 0 } <= splittingScoreUpdate1); splittingScore += splittingScoreUpdate1; const FloatEbmType splittingScoreUpdate2 = EbmStatistics::ComputeNodeSplittingScore( pHistogramBucketVectorEntryHigh[iVector].m_sumResidualError, cHighSamplesInBucket); EBM_ASSERT(std::isnan(splittingScoreUpdate2) || FloatEbmType { 0 } <= splittingScoreUpdate2); splittingScore += splittingScoreUpdate2; } EBM_ASSERT(std::isnan(splittingScore) || FloatEbmType { 0 } <= splittingScore); // sumation of positive numbers should be positive // if we get a NaN result, we'd like to propagate it by making bestSplit NaN. The rules for NaN values say that non equality comparisons are // all false so, let's flip this comparison such that it should be true for NaN values. If the compiler violates NaN comparions rules, // no big deal. NaN values will get us soon and shut down boosting. if(UNLIKELY(/* DO NOT CHANGE THIS WITHOUT READING THE ABOVE. WE DO THIS STRANGE COMPARISON FOR NaN values*/ !(splittingScore <= bestSplit))) { bestSplit = splittingScore; iBestCut = iBin; ASSERT_BINNED_BUCKET_OK( cBytesPerHistogramBucket, GetHistogramBucketByIndex<bClassification>( cBytesPerHistogramBucket, pHistogramBucketBestAndTemp, 1 ), aHistogramBucketsEndDebug ); ASSERT_BINNED_BUCKET_OK( cBytesPerHistogramBucket, GetHistogramBucketByIndex<bClassification>(cBytesPerHistogramBucket, pTotalsLow, 1), aHistogramBucketsEndDebug ); memcpy(pHistogramBucketBestAndTemp, pTotalsLow, cBytesPerTwoHistogramBuckets); // this copies both pTotalsLow and pTotalsHigh } else { EBM_ASSERT(!std::isnan(splittingScore)); } } } ++iBin; } while(iBin < cBins - 1); *piBestCut = iBestCut; EBM_ASSERT(std::isnan(bestSplit) || bestSplit == k_illegalGain || FloatEbmType { 0 } <= bestSplit); // sumation of positive numbers should be positive return bestSplit; } template<ptrdiff_t compilerLearningTypeOrCountTargetClasses> class FindBestBoostingSplitPairsInternal final { public: FindBestBoostingSplitPairsInternal() = delete; // this is a static class. Do not construct WARNING_PUSH WARNING_DISABLE_UNINITIALIZED_LOCAL_VARIABLE static bool Func( EbmBoostingState * const pEbmBoostingState, const FeatureGroup * const pFeatureGroup, const size_t cSamplesRequiredForChildSplitMin, HistogramBucketBase * pAuxiliaryBucketZoneBase, HistogramBucketBase * const pTotalBase, HistogramBucketBase * const aHistogramBucketsBase, SegmentedTensor * const pSmallChangeToModelOverwriteSingleSamplingSet, FloatEbmType * const pTotalGain #ifndef NDEBUG , const HistogramBucketBase * const aHistogramBucketsDebugCopyBase , const unsigned char * const aHistogramBucketsEndDebug #endif // NDEBUG ) { constexpr bool bClassification = IsClassification(compilerLearningTypeOrCountTargetClasses); const ptrdiff_t runtimeLearningTypeOrCountTargetClasses = pEbmBoostingState->GetRuntimeLearningTypeOrCountTargetClasses(); const ptrdiff_t learningTypeOrCountTargetClasses = GET_LEARNING_TYPE_OR_COUNT_TARGET_CLASSES( compilerLearningTypeOrCountTargetClasses, pEbmBoostingState->GetRuntimeLearningTypeOrCountTargetClasses() ); const size_t cVectorLength = GetVectorLength(learningTypeOrCountTargetClasses); const size_t cBytesPerHistogramBucket = GetHistogramBucketSize(bClassification, cVectorLength); HistogramBucket<IsClassification(compilerLearningTypeOrCountTargetClasses)> * pAuxiliaryBucketZone = pAuxiliaryBucketZoneBase->GetHistogramBucket<bClassification>(); HistogramBucket<IsClassification(compilerLearningTypeOrCountTargetClasses)> * const pTotal = pTotalBase->GetHistogramBucket<bClassification>(); HistogramBucket<IsClassification(compilerLearningTypeOrCountTargetClasses)> * const aHistogramBuckets = aHistogramBucketsBase->GetHistogramBucket<bClassification>(); #ifndef NDEBUG const HistogramBucket<IsClassification(compilerLearningTypeOrCountTargetClasses)> * const aHistogramBucketsDebugCopy = aHistogramBucketsDebugCopyBase->GetHistogramBucket<bClassification>(); #endif // NDEBUG size_t aiStart[k_cDimensionsMax]; FloatEbmType splittingScore; const size_t cBinsDimension1 = pFeatureGroup->GetFeatureGroupEntries()[0].m_pFeature->GetCountBins(); const size_t cBinsDimension2 = pFeatureGroup->GetFeatureGroupEntries()[1].m_pFeature->GetCountBins(); EBM_ASSERT(2 <= cBinsDimension1); EBM_ASSERT(2 <= cBinsDimension2); FloatEbmType bestSplittingScore = k_illegalGain; size_t cutFirst1Best; size_t cutFirst1LowBest; size_t cutFirst1HighBest; HistogramBucket<bClassification> * pTotals1LowLowBest = GetHistogramBucketByIndex<bClassification>(cBytesPerHistogramBucket, pAuxiliaryBucketZone, 0); HistogramBucket<bClassification> * pTotals1LowHighBest = GetHistogramBucketByIndex<bClassification>(cBytesPerHistogramBucket, pAuxiliaryBucketZone, 1); HistogramBucket<bClassification> * pTotals1HighLowBest = GetHistogramBucketByIndex<bClassification>(cBytesPerHistogramBucket, pAuxiliaryBucketZone, 2); HistogramBucket<bClassification> * pTotals1HighHighBest = GetHistogramBucketByIndex<bClassification>(cBytesPerHistogramBucket, pAuxiliaryBucketZone, 3); ASSERT_BINNED_BUCKET_OK(cBytesPerHistogramBucket, pTotal, aHistogramBucketsEndDebug); EBM_ASSERT(0 < cSamplesRequiredForChildSplitMin); FloatEbmType splittingScoreParent = FloatEbmType { 0 }; EBM_ASSERT(0 < pTotal->GetCountSamplesInBucket()); const FloatEbmType cSamplesInParentBucket = static_cast<FloatEbmType>(pTotal->GetCountSamplesInBucket()); HistogramBucketVectorEntry<bClassification> * const pHistogramBucketVectorEntryTotal = pTotal->GetHistogramBucketVectorEntry(); for(size_t iVector = 0; iVector < cVectorLength; ++iVector) { // TODO : we can make this faster by doing the division in ComputeNodeSplittingScoreParent after we add all the numerators // (but only do this after we've determined the best node splitting score for classification, and the NewtonRaphsonStep for gain const FloatEbmType splittingScoreParentUpdate = EbmStatistics::ComputeNodeSplittingScore( pHistogramBucketVectorEntryTotal[iVector].m_sumResidualError, cSamplesInParentBucket ); EBM_ASSERT(std::isnan(splittingScoreParentUpdate) || FloatEbmType { 0 } <= splittingScoreParentUpdate); splittingScoreParent += splittingScoreParentUpdate; } EBM_ASSERT(std::isnan(splittingScoreParent) || FloatEbmType { 0 } <= splittingScoreParent); // sumation of positive numbers should be positive LOG_0(TraceLevelVerbose, "BoostMultiDimensional Starting FIRST bin sweep loop"); size_t iBin1 = 0; do { aiStart[0] = iBin1; splittingScore = FloatEbmType { 0 }; size_t cutSecond1LowBest; HistogramBucket<bClassification> * pTotals2LowLowBest = GetHistogramBucketByIndex<bClassification>(cBytesPerHistogramBucket, pAuxiliaryBucketZone, 4); HistogramBucket<bClassification> * pTotals2LowHighBest = GetHistogramBucketByIndex<bClassification>(cBytesPerHistogramBucket, pAuxiliaryBucketZone, 5); const FloatEbmType splittingScoreNew1 = SweepMultiDiemensional<compilerLearningTypeOrCountTargetClasses>( aHistogramBuckets, pFeatureGroup, aiStart, 0x0, 1, cSamplesRequiredForChildSplitMin, runtimeLearningTypeOrCountTargetClasses, pTotals2LowLowBest, &cutSecond1LowBest #ifndef NDEBUG , aHistogramBucketsDebugCopy , aHistogramBucketsEndDebug #endif // NDEBUG ); // if we get a NaN result, we'd like to propagate it by making bestSplit NaN. The rules for NaN values say that non equality comparisons are all // false so, let's flip this comparison such that it should be true for NaN values. If the compiler violates NaN comparions rules, no big deal. // NaN values will get us soon and shut down boosting. if(LIKELY(/* DO NOT CHANGE THIS WITHOUT READING THE ABOVE. WE DO THIS STRANGE COMPARISON FOR NaN values*/ !(k_illegalGain == splittingScoreNew1))) { EBM_ASSERT(std::isnan(splittingScoreNew1) || FloatEbmType { 0 } <= splittingScoreNew1); splittingScore += splittingScoreNew1; size_t cutSecond1HighBest; HistogramBucket<bClassification> * pTotals2HighLowBest = GetHistogramBucketByIndex<bClassification>(cBytesPerHistogramBucket, pAuxiliaryBucketZone, 8); HistogramBucket<bClassification> * pTotals2HighHighBest = GetHistogramBucketByIndex<bClassification>(cBytesPerHistogramBucket, pAuxiliaryBucketZone, 9); const FloatEbmType splittingScoreNew2 = SweepMultiDiemensional<compilerLearningTypeOrCountTargetClasses>( aHistogramBuckets, pFeatureGroup, aiStart, 0x1, 1, cSamplesRequiredForChildSplitMin, runtimeLearningTypeOrCountTargetClasses, pTotals2HighLowBest, &cutSecond1HighBest #ifndef NDEBUG , aHistogramBucketsDebugCopy , aHistogramBucketsEndDebug #endif // NDEBUG ); // if we get a NaN result, we'd like to propagate it by making bestSplit NaN. The rules for NaN values say that non equality comparisons are // all false so, let's flip this comparison such that it should be true for NaN values. If the compiler violates NaN comparions rules, // no big deal. NaN values will get us soon and shut down boosting. if(LIKELY(/* DO NOT CHANGE THIS WITHOUT READING THE ABOVE. WE DO THIS STRANGE COMPARISON FOR NaN values*/ !(k_illegalGain == splittingScoreNew2))) { EBM_ASSERT(std::isnan(splittingScoreNew2) || FloatEbmType { 0 } <= splittingScoreNew2); splittingScore += splittingScoreNew2; // if we get a NaN result, we'd like to propagate it by making bestSplit NaN. The rules for NaN values say that non equality comparisons // are all false so, let's flip this comparison such that it should be true for NaN values. If the compiler violates NaN comparions rules, // no big deal. NaN values will get us soon and shut down boosting. if(UNLIKELY(/* DO NOT CHANGE THIS WITHOUT READING THE ABOVE. WE DO THIS STRANGE COMPARISON FOR NaN values*/ !(splittingScore <= bestSplittingScore))) { bestSplittingScore = splittingScore; cutFirst1Best = iBin1; cutFirst1LowBest = cutSecond1LowBest; cutFirst1HighBest = cutSecond1HighBest; pTotals1LowLowBest->Copy(*pTotals2LowLowBest, cVectorLength); pTotals1LowHighBest->Copy(*pTotals2LowHighBest, cVectorLength); pTotals1HighLowBest->Copy(*pTotals2HighLowBest, cVectorLength); pTotals1HighHighBest->Copy(*pTotals2HighHighBest, cVectorLength); } else { EBM_ASSERT(!std::isnan(splittingScore)); } } else { EBM_ASSERT(!std::isnan(splittingScoreNew2)); EBM_ASSERT(k_illegalGain == splittingScoreNew2); } } else { EBM_ASSERT(!std::isnan(splittingScoreNew1)); EBM_ASSERT(k_illegalGain == splittingScoreNew1); } ++iBin1; } while(iBin1 < cBinsDimension1 - 1); bool bCutFirst2 = false; size_t cutFirst2Best; size_t cutFirst2LowBest; size_t cutFirst2HighBest; HistogramBucket<bClassification> * pTotals2LowLowBest = GetHistogramBucketByIndex<bClassification>(cBytesPerHistogramBucket, pAuxiliaryBucketZone, 12); HistogramBucket<bClassification> * pTotals2LowHighBest = GetHistogramBucketByIndex<bClassification>(cBytesPerHistogramBucket, pAuxiliaryBucketZone, 13); HistogramBucket<bClassification> * pTotals2HighLowBest = GetHistogramBucketByIndex<bClassification>(cBytesPerHistogramBucket, pAuxiliaryBucketZone, 14); HistogramBucket<bClassification> * pTotals2HighHighBest = GetHistogramBucketByIndex<bClassification>(cBytesPerHistogramBucket, pAuxiliaryBucketZone, 15); LOG_0(TraceLevelVerbose, "BoostMultiDimensional Starting SECOND bin sweep loop"); size_t iBin2 = 0; do { aiStart[1] = iBin2; splittingScore = FloatEbmType { 0 }; size_t cutSecond2LowBest; HistogramBucket<bClassification> * pTotals1LowLowBestInner = GetHistogramBucketByIndex<bClassification>(cBytesPerHistogramBucket, pAuxiliaryBucketZone, 16); HistogramBucket<bClassification> * pTotals1LowHighBestInner = GetHistogramBucketByIndex<bClassification>(cBytesPerHistogramBucket, pAuxiliaryBucketZone, 17); const FloatEbmType splittingScoreNew1 = SweepMultiDiemensional<compilerLearningTypeOrCountTargetClasses>( aHistogramBuckets, pFeatureGroup, aiStart, 0x0, 0, cSamplesRequiredForChildSplitMin, runtimeLearningTypeOrCountTargetClasses, pTotals1LowLowBestInner, &cutSecond2LowBest #ifndef NDEBUG , aHistogramBucketsDebugCopy , aHistogramBucketsEndDebug #endif // NDEBUG ); // if we get a NaN result, we'd like to propagate it by making bestSplit NaN. The rules for NaN values say that non equality comparisons are // all false so, let's flip this comparison such that it should be true for NaN values. If the compiler violates NaN comparions rules, no big deal. // NaN values will get us soon and shut down boosting. if(LIKELY(/* DO NOT CHANGE THIS WITHOUT READING THE ABOVE. WE DO THIS STRANGE COMPARISON FOR NaN values*/ !(k_illegalGain == splittingScoreNew1))) { EBM_ASSERT(std::isnan(splittingScoreNew1) || FloatEbmType { 0 } <= splittingScoreNew1); splittingScore += splittingScoreNew1; size_t cutSecond2HighBest; HistogramBucket<bClassification> * pTotals1HighLowBestInner = GetHistogramBucketByIndex<bClassification>(cBytesPerHistogramBucket, pAuxiliaryBucketZone, 20); HistogramBucket<bClassification> * pTotals1HighHighBestInner = GetHistogramBucketByIndex<bClassification>(cBytesPerHistogramBucket, pAuxiliaryBucketZone, 21); const FloatEbmType splittingScoreNew2 = SweepMultiDiemensional<compilerLearningTypeOrCountTargetClasses>( aHistogramBuckets, pFeatureGroup, aiStart, 0x2, 0, cSamplesRequiredForChildSplitMin, runtimeLearningTypeOrCountTargetClasses, pTotals1HighLowBestInner, &cutSecond2HighBest #ifndef NDEBUG , aHistogramBucketsDebugCopy , aHistogramBucketsEndDebug #endif // NDEBUG ); // if we get a NaN result, we'd like to propagate it by making bestSplit NaN. The rules for NaN values say that non equality comparisons are // all false so, let's flip this comparison such that it should be true for NaN values. If the compiler violates NaN comparions rules, // no big deal. NaN values will get us soon and shut down boosting. if(LIKELY(/* DO NOT CHANGE THIS WITHOUT READING THE ABOVE. WE DO THIS STRANGE COMPARISON FOR NaN values*/ !(k_illegalGain == splittingScoreNew2))) { EBM_ASSERT(std::isnan(splittingScoreNew2) || FloatEbmType { 0 } <= splittingScoreNew2); splittingScore += splittingScoreNew2; // if we get a NaN result, we'd like to propagate it by making bestSplit NaN. The rules for NaN values say that non equality comparisons // are all false so, let's flip this comparison such that it should be true for NaN values. If the compiler violates NaN comparions rules, // no big deal. NaN values will get us soon and shut down boosting. if(UNLIKELY(/* DO NOT CHANGE THIS WITHOUT READING THE ABOVE. WE DO THIS STRANGE COMPARISON FOR NaN values*/ !(splittingScore <= bestSplittingScore))) { bestSplittingScore = splittingScore; cutFirst2Best = iBin2; cutFirst2LowBest = cutSecond2LowBest; cutFirst2HighBest = cutSecond2HighBest; pTotals2LowLowBest->Copy(*pTotals1LowLowBestInner, cVectorLength); pTotals2LowHighBest->Copy(*pTotals1LowHighBestInner, cVectorLength); pTotals2HighLowBest->Copy(*pTotals1HighLowBestInner, cVectorLength); pTotals2HighHighBest->Copy(*pTotals1HighHighBestInner, cVectorLength); bCutFirst2 = true; } else { EBM_ASSERT(!std::isnan(splittingScore)); } } else { EBM_ASSERT(!std::isnan(splittingScoreNew2)); EBM_ASSERT(k_illegalGain == splittingScoreNew2); } } else { EBM_ASSERT(!std::isnan(splittingScoreNew1)); EBM_ASSERT(k_illegalGain == splittingScoreNew1); } ++iBin2; } while(iBin2 < cBinsDimension2 - 1); LOG_0(TraceLevelVerbose, "BoostMultiDimensional Done sweep loops"); FloatEbmType gain; // if we get a NaN result for bestSplittingScore, we might as well do less work and just create a zero split update right now. The rules // for NaN values say that non equality comparisons are all false so, let's flip this comparison such that it should be true for NaN values. // If the compiler violates NaN comparions rules, no big deal. NaN values will get us soon and shut down boosting. if(UNLIKELY(/* DO NOT CHANGE THIS WITHOUT READING THE ABOVE. WE DO THIS STRANGE COMPARISON FOR NaN values*/ !(k_illegalGain != bestSplittingScore))) { // there were no good cuts found, or we hit a NaN value #ifndef NDEBUG const bool bSetCountDivisions0 = #endif // NDEBUG pSmallChangeToModelOverwriteSingleSamplingSet->SetCountDivisions(0, 0); // we can't fail since we're setting this to zero, so no allocations. We don't in fact need the division array at all EBM_ASSERT(!bSetCountDivisions0); #ifndef NDEBUG const bool bSetCountDivisions1 = #endif // NDEBUG pSmallChangeToModelOverwriteSingleSamplingSet->SetCountDivisions(1, 0); // we can't fail since we're setting this to zero, so no allocations. We don't in fact need the division array at all EBM_ASSERT(!bSetCountDivisions1); // we don't need to call pSmallChangeToModelOverwriteSingleSamplingSet->EnsureValueCapacity, // since our value capacity would be 1, which is pre-allocated for(size_t iVector = 0; iVector < cVectorLength; ++iVector) { FloatEbmType prediction; if(bClassification) { prediction = EbmStatistics::ComputeSmallChangeForOneSegmentClassificationLogOdds( pHistogramBucketVectorEntryTotal[iVector].m_sumResidualError, pHistogramBucketVectorEntryTotal[iVector].GetSumDenominator() ); } else { EBM_ASSERT(IsRegression(compilerLearningTypeOrCountTargetClasses)); prediction = EbmStatistics::ComputeSmallChangeForOneSegmentRegression( pHistogramBucketVectorEntryTotal[iVector].m_sumResidualError, cSamplesInParentBucket ); } pSmallChangeToModelOverwriteSingleSamplingSet->GetValuePointer()[iVector] = prediction; } gain = FloatEbmType { 0 }; // no splits means no gain } else { EBM_ASSERT(!std::isnan(bestSplittingScore)); EBM_ASSERT(k_illegalGain != bestSplittingScore); if(bCutFirst2) { // if bCutFirst2 is true, then there definetly was a cut, so we don't have to check for zero cuts if(pSmallChangeToModelOverwriteSingleSamplingSet->SetCountDivisions(1, 1)) { LOG_0(TraceLevelWarning, "WARNING BoostMultiDimensional pSmallChangeToModelOverwriteSingleSamplingSet->SetCountDivisions(1, 1)"); return true; } pSmallChangeToModelOverwriteSingleSamplingSet->GetDivisionPointer(1)[0] = cutFirst2Best; if(cutFirst2LowBest < cutFirst2HighBest) { if(pSmallChangeToModelOverwriteSingleSamplingSet->EnsureValueCapacity(cVectorLength * 6)) { LOG_0( TraceLevelWarning, "WARNING BoostMultiDimensional pSmallChangeToModelOverwriteSingleSamplingSet->EnsureValueCapacity(cVectorLength * 6)" ); return true; } if(pSmallChangeToModelOverwriteSingleSamplingSet->SetCountDivisions(0, 2)) { LOG_0(TraceLevelWarning, "WARNING BoostMultiDimensional pSmallChangeToModelOverwriteSingleSamplingSet->SetCountDivisions(0, 2)"); return true; } pSmallChangeToModelOverwriteSingleSamplingSet->GetDivisionPointer(0)[0] = cutFirst2LowBest; pSmallChangeToModelOverwriteSingleSamplingSet->GetDivisionPointer(0)[1] = cutFirst2HighBest; } else if(cutFirst2HighBest < cutFirst2LowBest) { if(pSmallChangeToModelOverwriteSingleSamplingSet->EnsureValueCapacity(cVectorLength * 6)) { LOG_0( TraceLevelWarning, "WARNING BoostMultiDimensional pSmallChangeToModelOverwriteSingleSamplingSet->EnsureValueCapacity(cVectorLength * 6)" ); return true; } if(pSmallChangeToModelOverwriteSingleSamplingSet->SetCountDivisions(0, 2)) { LOG_0(TraceLevelWarning, "WARNING BoostMultiDimensional pSmallChangeToModelOverwriteSingleSamplingSet->SetCountDivisions(0, 2)"); return true; } pSmallChangeToModelOverwriteSingleSamplingSet->GetDivisionPointer(0)[0] = cutFirst2HighBest; pSmallChangeToModelOverwriteSingleSamplingSet->GetDivisionPointer(0)[1] = cutFirst2LowBest; } else { if(pSmallChangeToModelOverwriteSingleSamplingSet->SetCountDivisions(0, 1)) { LOG_0(TraceLevelWarning, "WARNING BoostMultiDimensional pSmallChangeToModelOverwriteSingleSamplingSet->SetCountDivisions(0, 1)"); return true; } if(pSmallChangeToModelOverwriteSingleSamplingSet->EnsureValueCapacity(cVectorLength * 4)) { LOG_0( TraceLevelWarning, "WARNING BoostMultiDimensional pSmallChangeToModelOverwriteSingleSamplingSet->EnsureValueCapacity(cVectorLength * 4)" ); return true; } pSmallChangeToModelOverwriteSingleSamplingSet->GetDivisionPointer(0)[0] = cutFirst2LowBest; } HistogramBucketVectorEntry<bClassification> * const pHistogramBucketVectorEntryTotals2LowLowBest = pTotals2LowLowBest->GetHistogramBucketVectorEntry(); HistogramBucketVectorEntry<bClassification> * const pHistogramBucketVectorEntryTotals2LowHighBest = pTotals2LowHighBest->GetHistogramBucketVectorEntry(); HistogramBucketVectorEntry<bClassification> * const pHistogramBucketVectorEntryTotals2HighLowBest = pTotals2HighLowBest->GetHistogramBucketVectorEntry(); HistogramBucketVectorEntry<bClassification> * const pHistogramBucketVectorEntryTotals2HighHighBest = pTotals2HighHighBest->GetHistogramBucketVectorEntry(); for(size_t iVector = 0; iVector < cVectorLength; ++iVector) { FloatEbmType predictionLowLow; FloatEbmType predictionLowHigh; FloatEbmType predictionHighLow; FloatEbmType predictionHighHigh; if(bClassification) { predictionLowLow = EbmStatistics::ComputeSmallChangeForOneSegmentClassificationLogOdds( pHistogramBucketVectorEntryTotals2LowLowBest[iVector].m_sumResidualError, pHistogramBucketVectorEntryTotals2LowLowBest[iVector].GetSumDenominator() ); predictionLowHigh = EbmStatistics::ComputeSmallChangeForOneSegmentClassificationLogOdds( pHistogramBucketVectorEntryTotals2LowHighBest[iVector].m_sumResidualError, pHistogramBucketVectorEntryTotals2LowHighBest[iVector].GetSumDenominator() ); predictionHighLow = EbmStatistics::ComputeSmallChangeForOneSegmentClassificationLogOdds( pHistogramBucketVectorEntryTotals2HighLowBest[iVector].m_sumResidualError, pHistogramBucketVectorEntryTotals2HighLowBest[iVector].GetSumDenominator() ); predictionHighHigh = EbmStatistics::ComputeSmallChangeForOneSegmentClassificationLogOdds( pHistogramBucketVectorEntryTotals2HighHighBest[iVector].m_sumResidualError, pHistogramBucketVectorEntryTotals2HighHighBest[iVector].GetSumDenominator() ); } else { EBM_ASSERT(IsRegression(compilerLearningTypeOrCountTargetClasses)); predictionLowLow = EbmStatistics::ComputeSmallChangeForOneSegmentRegression( pHistogramBucketVectorEntryTotals2LowLowBest[iVector].m_sumResidualError, static_cast<FloatEbmType>(pTotals2LowLowBest->GetCountSamplesInBucket()) ); predictionLowHigh = EbmStatistics::ComputeSmallChangeForOneSegmentRegression( pHistogramBucketVectorEntryTotals2LowHighBest[iVector].m_sumResidualError, static_cast<FloatEbmType>(pTotals2LowHighBest->GetCountSamplesInBucket()) ); predictionHighLow = EbmStatistics::ComputeSmallChangeForOneSegmentRegression( pHistogramBucketVectorEntryTotals2HighLowBest[iVector].m_sumResidualError, static_cast<FloatEbmType>(pTotals2HighLowBest->GetCountSamplesInBucket()) ); predictionHighHigh = EbmStatistics::ComputeSmallChangeForOneSegmentRegression( pHistogramBucketVectorEntryTotals2HighHighBest[iVector].m_sumResidualError, static_cast<FloatEbmType>(pTotals2HighHighBest->GetCountSamplesInBucket()) ); } if(cutFirst2LowBest < cutFirst2HighBest) { pSmallChangeToModelOverwriteSingleSamplingSet->GetValuePointer()[0 * cVectorLength + iVector] = predictionLowLow; pSmallChangeToModelOverwriteSingleSamplingSet->GetValuePointer()[1 * cVectorLength + iVector] = predictionLowHigh; pSmallChangeToModelOverwriteSingleSamplingSet->GetValuePointer()[2 * cVectorLength + iVector] = predictionLowHigh; pSmallChangeToModelOverwriteSingleSamplingSet->GetValuePointer()[3 * cVectorLength + iVector] = predictionHighLow; pSmallChangeToModelOverwriteSingleSamplingSet->GetValuePointer()[4 * cVectorLength + iVector] = predictionHighLow; pSmallChangeToModelOverwriteSingleSamplingSet->GetValuePointer()[5 * cVectorLength + iVector] = predictionHighHigh; } else if(cutFirst2HighBest < cutFirst2LowBest) { pSmallChangeToModelOverwriteSingleSamplingSet->GetValuePointer()[0 * cVectorLength + iVector] = predictionLowLow; pSmallChangeToModelOverwriteSingleSamplingSet->GetValuePointer()[1 * cVectorLength + iVector] = predictionLowLow; pSmallChangeToModelOverwriteSingleSamplingSet->GetValuePointer()[2 * cVectorLength + iVector] = predictionLowHigh; pSmallChangeToModelOverwriteSingleSamplingSet->GetValuePointer()[3 * cVectorLength + iVector] = predictionHighLow; pSmallChangeToModelOverwriteSingleSamplingSet->GetValuePointer()[4 * cVectorLength + iVector] = predictionHighHigh; pSmallChangeToModelOverwriteSingleSamplingSet->GetValuePointer()[5 * cVectorLength + iVector] = predictionHighHigh; } else { pSmallChangeToModelOverwriteSingleSamplingSet->GetValuePointer()[0 * cVectorLength + iVector] = predictionLowLow; pSmallChangeToModelOverwriteSingleSamplingSet->GetValuePointer()[1 * cVectorLength + iVector] = predictionLowHigh; pSmallChangeToModelOverwriteSingleSamplingSet->GetValuePointer()[2 * cVectorLength + iVector] = predictionHighLow; pSmallChangeToModelOverwriteSingleSamplingSet->GetValuePointer()[3 * cVectorLength + iVector] = predictionHighHigh; } } } else { if(pSmallChangeToModelOverwriteSingleSamplingSet->SetCountDivisions(0, 1)) { LOG_0(TraceLevelWarning, "WARNING BoostMultiDimensional pSmallChangeToModelOverwriteSingleSamplingSet->SetCountDivisions(0, 1)"); return true; } pSmallChangeToModelOverwriteSingleSamplingSet->GetDivisionPointer(0)[0] = cutFirst1Best; if(cutFirst1LowBest < cutFirst1HighBest) { if(pSmallChangeToModelOverwriteSingleSamplingSet->EnsureValueCapacity(cVectorLength * 6)) { LOG_0( TraceLevelWarning, "WARNING BoostMultiDimensional pSmallChangeToModelOverwriteSingleSamplingSet->EnsureValueCapacity(cVectorLength * 6)" ); return true; } if(pSmallChangeToModelOverwriteSingleSamplingSet->SetCountDivisions(1, 2)) { LOG_0(TraceLevelWarning, "WARNING BoostMultiDimensional pSmallChangeToModelOverwriteSingleSamplingSet->SetCountDivisions(1, 2)"); return true; } pSmallChangeToModelOverwriteSingleSamplingSet->GetDivisionPointer(1)[0] = cutFirst1LowBest; pSmallChangeToModelOverwriteSingleSamplingSet->GetDivisionPointer(1)[1] = cutFirst1HighBest; } else if(cutFirst1HighBest < cutFirst1LowBest) { if(pSmallChangeToModelOverwriteSingleSamplingSet->EnsureValueCapacity(cVectorLength * 6)) { LOG_0( TraceLevelWarning, "WARNING BoostMultiDimensional pSmallChangeToModelOverwriteSingleSamplingSet->EnsureValueCapacity(cVectorLength * 6)" ); return true; } if(pSmallChangeToModelOverwriteSingleSamplingSet->SetCountDivisions(1, 2)) { LOG_0(TraceLevelWarning, "WARNING BoostMultiDimensional pSmallChangeToModelOverwriteSingleSamplingSet->SetCountDivisions(1, 2)"); return true; } pSmallChangeToModelOverwriteSingleSamplingSet->GetDivisionPointer(1)[0] = cutFirst1HighBest; pSmallChangeToModelOverwriteSingleSamplingSet->GetDivisionPointer(1)[1] = cutFirst1LowBest; } else { if(pSmallChangeToModelOverwriteSingleSamplingSet->SetCountDivisions(1, 1)) { LOG_0(TraceLevelWarning, "WARNING BoostMultiDimensional pSmallChangeToModelOverwriteSingleSamplingSet->SetCountDivisions(1, 1)"); return true; } if(pSmallChangeToModelOverwriteSingleSamplingSet->EnsureValueCapacity(cVectorLength * 4)) { LOG_0( TraceLevelWarning, "WARNING BoostMultiDimensional pSmallChangeToModelOverwriteSingleSamplingSet->EnsureValueCapacity(cVectorLength * 4)" ); return true; } pSmallChangeToModelOverwriteSingleSamplingSet->GetDivisionPointer(1)[0] = cutFirst1LowBest; } HistogramBucketVectorEntry<bClassification> * const pHistogramBucketVectorEntryTotals1LowLowBest = pTotals1LowLowBest->GetHistogramBucketVectorEntry(); HistogramBucketVectorEntry<bClassification> * const pHistogramBucketVectorEntryTotals1LowHighBest = pTotals1LowHighBest->GetHistogramBucketVectorEntry(); HistogramBucketVectorEntry<bClassification> * const pHistogramBucketVectorEntryTotals1HighLowBest = pTotals1HighLowBest->GetHistogramBucketVectorEntry(); HistogramBucketVectorEntry<bClassification> * const pHistogramBucketVectorEntryTotals1HighHighBest = pTotals1HighHighBest->GetHistogramBucketVectorEntry(); for(size_t iVector = 0; iVector < cVectorLength; ++iVector) { FloatEbmType predictionLowLow; FloatEbmType predictionLowHigh; FloatEbmType predictionHighLow; FloatEbmType predictionHighHigh; if(bClassification) { predictionLowLow = EbmStatistics::ComputeSmallChangeForOneSegmentClassificationLogOdds( pHistogramBucketVectorEntryTotals1LowLowBest[iVector].m_sumResidualError, pHistogramBucketVectorEntryTotals1LowLowBest[iVector].GetSumDenominator() ); predictionLowHigh = EbmStatistics::ComputeSmallChangeForOneSegmentClassificationLogOdds( pHistogramBucketVectorEntryTotals1LowHighBest[iVector].m_sumResidualError, pHistogramBucketVectorEntryTotals1LowHighBest[iVector].GetSumDenominator() ); predictionHighLow = EbmStatistics::ComputeSmallChangeForOneSegmentClassificationLogOdds( pHistogramBucketVectorEntryTotals1HighLowBest[iVector].m_sumResidualError, pHistogramBucketVectorEntryTotals1HighLowBest[iVector].GetSumDenominator() ); predictionHighHigh = EbmStatistics::ComputeSmallChangeForOneSegmentClassificationLogOdds( pHistogramBucketVectorEntryTotals1HighHighBest[iVector].m_sumResidualError, pHistogramBucketVectorEntryTotals1HighHighBest[iVector].GetSumDenominator() ); } else { EBM_ASSERT(IsRegression(compilerLearningTypeOrCountTargetClasses)); predictionLowLow = EbmStatistics::ComputeSmallChangeForOneSegmentRegression( pHistogramBucketVectorEntryTotals1LowLowBest[iVector].m_sumResidualError, static_cast<FloatEbmType>(pTotals1LowLowBest->GetCountSamplesInBucket()) ); predictionLowHigh = EbmStatistics::ComputeSmallChangeForOneSegmentRegression( pHistogramBucketVectorEntryTotals1LowHighBest[iVector].m_sumResidualError, static_cast<FloatEbmType>(pTotals1LowHighBest->GetCountSamplesInBucket()) ); predictionHighLow = EbmStatistics::ComputeSmallChangeForOneSegmentRegression( pHistogramBucketVectorEntryTotals1HighLowBest[iVector].m_sumResidualError, static_cast<FloatEbmType>(pTotals1HighLowBest->GetCountSamplesInBucket()) ); predictionHighHigh = EbmStatistics::ComputeSmallChangeForOneSegmentRegression( pHistogramBucketVectorEntryTotals1HighHighBest[iVector].m_sumResidualError, static_cast<FloatEbmType>(pTotals1HighHighBest->GetCountSamplesInBucket()) ); } if(cutFirst1LowBest < cutFirst1HighBest) { pSmallChangeToModelOverwriteSingleSamplingSet->GetValuePointer()[0 * cVectorLength + iVector] = predictionLowLow; pSmallChangeToModelOverwriteSingleSamplingSet->GetValuePointer()[1 * cVectorLength + iVector] = predictionHighLow; pSmallChangeToModelOverwriteSingleSamplingSet->GetValuePointer()[2 * cVectorLength + iVector] = predictionLowHigh; pSmallChangeToModelOverwriteSingleSamplingSet->GetValuePointer()[3 * cVectorLength + iVector] = predictionHighLow; pSmallChangeToModelOverwriteSingleSamplingSet->GetValuePointer()[4 * cVectorLength + iVector] = predictionLowHigh; pSmallChangeToModelOverwriteSingleSamplingSet->GetValuePointer()[5 * cVectorLength + iVector] = predictionHighHigh; } else if(cutFirst1HighBest < cutFirst1LowBest) { pSmallChangeToModelOverwriteSingleSamplingSet->GetValuePointer()[0 * cVectorLength + iVector] = predictionLowLow; pSmallChangeToModelOverwriteSingleSamplingSet->GetValuePointer()[1 * cVectorLength + iVector] = predictionHighLow; pSmallChangeToModelOverwriteSingleSamplingSet->GetValuePointer()[2 * cVectorLength + iVector] = predictionLowLow; pSmallChangeToModelOverwriteSingleSamplingSet->GetValuePointer()[3 * cVectorLength + iVector] = predictionHighHigh; pSmallChangeToModelOverwriteSingleSamplingSet->GetValuePointer()[4 * cVectorLength + iVector] = predictionLowHigh; pSmallChangeToModelOverwriteSingleSamplingSet->GetValuePointer()[5 * cVectorLength + iVector] = predictionHighHigh; } else { pSmallChangeToModelOverwriteSingleSamplingSet->GetValuePointer()[0 * cVectorLength + iVector] = predictionLowLow; pSmallChangeToModelOverwriteSingleSamplingSet->GetValuePointer()[1 * cVectorLength + iVector] = predictionHighLow; pSmallChangeToModelOverwriteSingleSamplingSet->GetValuePointer()[2 * cVectorLength + iVector] = predictionLowHigh; pSmallChangeToModelOverwriteSingleSamplingSet->GetValuePointer()[3 * cVectorLength + iVector] = predictionHighHigh; } } } // for regression, bestSplittingScore and splittingScoreParent can be infinity. There is a super-super-super-rare case where we can have // splittingScoreParent overflow to +infinity due to numeric issues, but not bestSplittingScore, and then the subtration causes the result // to be -infinity. The universe will probably die of heat death before we get a -infinity value, but perhaps an adversarial dataset could // trigger it, and we don't want someone giving us data to use a vulnerability in our system, so check for it! gain = bestSplittingScore - splittingScoreParent; } // TODO: this gain value is untested. We should build a new test that compares the single feature gains to the multi-dimensional gains by // making a pair where one of the dimensions duplicates values in the 0 and 1 bin. Then the gain should be identical, if there is only 1 split allowed *pTotalGain = gain; return false; } WARNING_POP }; template<ptrdiff_t compilerLearningTypeOrCountTargetClassesPossible> class FindBestBoostingSplitPairsTarget final { public: FindBestBoostingSplitPairsTarget() = delete; // this is a static class. Do not construct INLINE_ALWAYS static bool Func( EbmBoostingState * const pEbmBoostingState, const FeatureGroup * const pFeatureGroup, const size_t cSamplesRequiredForChildSplitMin, HistogramBucketBase * pAuxiliaryBucketZone, HistogramBucketBase * const pTotal, HistogramBucketBase * const aHistogramBuckets, SegmentedTensor * const pSmallChangeToModelOverwriteSingleSamplingSet, FloatEbmType * const pTotalGain #ifndef NDEBUG , const HistogramBucketBase * const aHistogramBucketsDebugCopy , const unsigned char * const aHistogramBucketsEndDebug #endif // NDEBUG ) { static_assert(IsClassification(compilerLearningTypeOrCountTargetClassesPossible), "compilerLearningTypeOrCountTargetClassesPossible needs to be a classification"); static_assert(compilerLearningTypeOrCountTargetClassesPossible <= k_cCompilerOptimizedTargetClassesMax, "We can't have this many items in a data pack."); const ptrdiff_t runtimeLearningTypeOrCountTargetClasses = pEbmBoostingState->GetRuntimeLearningTypeOrCountTargetClasses(); EBM_ASSERT(IsClassification(runtimeLearningTypeOrCountTargetClasses)); EBM_ASSERT(runtimeLearningTypeOrCountTargetClasses <= k_cCompilerOptimizedTargetClassesMax); if(compilerLearningTypeOrCountTargetClassesPossible == runtimeLearningTypeOrCountTargetClasses) { return FindBestBoostingSplitPairsInternal<compilerLearningTypeOrCountTargetClassesPossible>::Func( pEbmBoostingState, pFeatureGroup, cSamplesRequiredForChildSplitMin, pAuxiliaryBucketZone, pTotal, aHistogramBuckets, pSmallChangeToModelOverwriteSingleSamplingSet, pTotalGain #ifndef NDEBUG , aHistogramBucketsDebugCopy , aHistogramBucketsEndDebug #endif // NDEBUG ); } else { return FindBestBoostingSplitPairsTarget<compilerLearningTypeOrCountTargetClassesPossible + 1>::Func( pEbmBoostingState, pFeatureGroup, cSamplesRequiredForChildSplitMin, pAuxiliaryBucketZone, pTotal, aHistogramBuckets, pSmallChangeToModelOverwriteSingleSamplingSet, pTotalGain #ifndef NDEBUG , aHistogramBucketsDebugCopy , aHistogramBucketsEndDebug #endif // NDEBUG ); } } }; template<> class FindBestBoostingSplitPairsTarget<k_cCompilerOptimizedTargetClassesMax + 1> final { public: FindBestBoostingSplitPairsTarget() = delete; // this is a static class. Do not construct INLINE_ALWAYS static bool Func( EbmBoostingState * const pEbmBoostingState, const FeatureGroup * const pFeatureGroup, const size_t cSamplesRequiredForChildSplitMin, HistogramBucketBase * pAuxiliaryBucketZone, HistogramBucketBase * const pTotal, HistogramBucketBase * const aHistogramBuckets, SegmentedTensor * const pSmallChangeToModelOverwriteSingleSamplingSet, FloatEbmType * const pTotalGain #ifndef NDEBUG , const HistogramBucketBase * const aHistogramBucketsDebugCopy , const unsigned char * const aHistogramBucketsEndDebug #endif // NDEBUG ) { static_assert(IsClassification(k_cCompilerOptimizedTargetClassesMax), "k_cCompilerOptimizedTargetClassesMax needs to be a classification"); EBM_ASSERT(IsClassification(pEbmBoostingState->GetRuntimeLearningTypeOrCountTargetClasses())); EBM_ASSERT(k_cCompilerOptimizedTargetClassesMax < pEbmBoostingState->GetRuntimeLearningTypeOrCountTargetClasses()); return FindBestBoostingSplitPairsInternal<k_dynamicClassification>::Func( pEbmBoostingState, pFeatureGroup, cSamplesRequiredForChildSplitMin, pAuxiliaryBucketZone, pTotal, aHistogramBuckets, pSmallChangeToModelOverwriteSingleSamplingSet, pTotalGain #ifndef NDEBUG , aHistogramBucketsDebugCopy , aHistogramBucketsEndDebug #endif // NDEBUG ); } }; extern bool FindBestBoostingSplitPairs( EbmBoostingState * const pEbmBoostingState, const FeatureGroup * const pFeatureGroup, const size_t cSamplesRequiredForChildSplitMin, HistogramBucketBase * pAuxiliaryBucketZone, HistogramBucketBase * const pTotal, HistogramBucketBase * const aHistogramBuckets, SegmentedTensor * const pSmallChangeToModelOverwriteSingleSamplingSet, FloatEbmType * const pTotalGain #ifndef NDEBUG , const HistogramBucketBase * const aHistogramBucketsDebugCopy , const unsigned char * const aHistogramBucketsEndDebug #endif // NDEBUG ) { const ptrdiff_t runtimeLearningTypeOrCountTargetClasses = pEbmBoostingState->GetRuntimeLearningTypeOrCountTargetClasses(); if(IsClassification(runtimeLearningTypeOrCountTargetClasses)) { return FindBestBoostingSplitPairsTarget<2>::Func( pEbmBoostingState, pFeatureGroup, cSamplesRequiredForChildSplitMin, pAuxiliaryBucketZone, pTotal, aHistogramBuckets, pSmallChangeToModelOverwriteSingleSamplingSet, pTotalGain #ifndef NDEBUG , aHistogramBucketsDebugCopy , aHistogramBucketsEndDebug #endif // NDEBUG ); } else { EBM_ASSERT(IsRegression(runtimeLearningTypeOrCountTargetClasses)); return FindBestBoostingSplitPairsInternal<k_regression>::Func( pEbmBoostingState, pFeatureGroup, cSamplesRequiredForChildSplitMin, pAuxiliaryBucketZone, pTotal, aHistogramBuckets, pSmallChangeToModelOverwriteSingleSamplingSet, pTotalGain #ifndef NDEBUG , aHistogramBucketsDebugCopy , aHistogramBucketsEndDebug #endif // NDEBUG ); } }
[ "interpretml@outlook.com" ]
interpretml@outlook.com
ec6fee89dd0ea8b2b3391b14191a416468a17c9f
6ed471f36e5188f77dc61cca24daa41496a6d4a0
/SDK/AcidExplosionEmitter_parameters.h
5a2e4cb447f7cdfe9fdc55e1d466ca4cf2f2356d
[]
no_license
zH4x-SDK/zARKSotF-SDK
77bfaf9b4b9b6a41951ee18db88f826dd720c367
714730f4bb79c07d065181caf360d168761223f6
refs/heads/main
2023-07-16T22:33:15.140456
2021-08-27T13:40:06
2021-08-27T13:40:06
400,521,086
0
0
null
null
null
null
UTF-8
C++
false
false
827
h
#pragma once #include "../SDK.h" // Name: ARKSotF, Version: 178.8.0 #ifdef _MSC_VER #pragma pack(push, 0x8) #endif namespace SDK { //--------------------------------------------------------------------------- // Parameters //--------------------------------------------------------------------------- // Function AcidExplosionEmitter.AcidExplosionEmitter_C.UserConstructionScript struct AAcidExplosionEmitter_C_UserConstructionScript_Params { }; // Function AcidExplosionEmitter.AcidExplosionEmitter_C.ExecuteUbergraph_AcidExplosionEmitter struct AAcidExplosionEmitter_C_ExecuteUbergraph_AcidExplosionEmitter_Params { int EntryPoint; // (Parm, ZeroConstructor, IsPlainOldData) }; } #ifdef _MSC_VER #pragma pack(pop) #endif
[ "zp2kshield@gmail.com" ]
zp2kshield@gmail.com
6a44dc0e22c1a0fbfd9df7a394e0f0c540ea8f88
27c85a9ffcd8f0a3ccbc5e2ccb8793feb0369ea8
/include/UECS/detail/RTSCmptTraits.inl
ce136e63aa0ebad1b12f1a1da419300099e2224f
[ "MIT" ]
permissive
armadi110/UECS
7fbc553c88de2f45ba83891ff0cedc51b6445b60
65aaf0a797b11859bedcb2f26c359cb4c247b383
refs/heads/master
2022-07-28T23:52:37.234282
2020-05-22T04:37:16
2020-05-22T04:37:16
null
0
0
null
null
null
null
UTF-8
C++
false
false
2,789
inl
#pragma once #include "../RTDCmptTraits.h" namespace Ubpa { template<typename Cmpt> void RTSCmptTraits::Register() { static_assert(std::is_copy_constructible_v<Cmpt>, "<Cmpt> must be copy-constructible"); static_assert(std::is_move_constructible_v<Cmpt>, "<Cmpt> must be move-constructible"); static_assert(std::is_destructible_v<Cmpt>, "<Cmpt> must be destructible"); constexpr CmptType type = CmptType::Of<Cmpt>(); sizeofs[type] = sizeof(Cmpt); alignments[type] = alignof(Cmpt); if constexpr (!std::is_trivially_destructible_v<Cmpt>) { destructors[type] = [](void* cmpt) { reinterpret_cast<Cmpt*>(cmpt)->~Cmpt(); }; } if constexpr (!std::is_trivially_move_constructible_v<Cmpt>) { move_constructors[type] = [](void* dst, void* src) { new(dst)Cmpt(std::move(*reinterpret_cast<Cmpt*>(src))); }; } if constexpr (!std::is_trivially_copy_constructible_v<Cmpt>) { copy_constructors[type] = [](void* dst, void* src) { new(dst)Cmpt(*reinterpret_cast<Cmpt*>(src)); }; } } template<typename Cmpt> void RTSCmptTraits::Deregister() { constexpr CmptType type = CmptType::Of<Cmpt>(); sizeofs.erase(type); alignments.erase(type); if constexpr (!std::is_trivially_destructible_v<Cmpt>) destructors.erase(type); if constexpr (!std::is_trivially_move_constructible_v<Cmpt>) move_constructors.erase(type); if constexpr (!std::is_trivially_copy_constructible_v<Cmpt>) copy_constructors.erase(type); } inline void RTSCmptTraits::Register(CmptType type) { const auto& rtdct = RTDCmptTraits().Instance(); auto size_target = rtdct.sizeofs.find(type); if (size_target == rtdct.sizeofs.end()) throw std::logic_error("RTSCmptTraits::Register: RTDCmptTraits hasn't registered <CmptType>"); sizeofs[type] = size_target->second; auto alignment_target = rtdct.alignments.find(type); if (alignment_target == rtdct.alignments.end()) alignments[type] = RTDCmptTraits::default_alignment; else alignments[type] = alignment_target->second; auto destructor_target = rtdct.destructors.find(type); auto copy_constructor_target = rtdct.copy_constructors.find(type); auto move_constructor_target = rtdct.move_constructors.find(type); if (destructor_target != rtdct.destructors.end()) destructors[type] = destructor_target->second; if (copy_constructor_target != rtdct.copy_constructors.end()) copy_constructors[type] = copy_constructor_target->second; if (move_constructor_target != rtdct.move_constructors.end()) move_constructors[type] = move_constructor_target->second; } inline void RTSCmptTraits::Deregister(CmptType type) noexcept { sizeofs.erase(type); alignments.erase(type); copy_constructors.erase(type); move_constructors.erase(type); destructors.erase(type); } }
[ "641614112@qq.com" ]
641614112@qq.com
a0a830b0bfd8eb09bc552393d527b341502f8cbf
cde01c5c60fef176da25ec06f5c3b63a4254daa4
/Lab0/Cpp/charts.cpp
f1ac8583699f15590de7ead7953f937b43d37aea
[]
no_license
mate0091/Algorithms
5cbc6303b892fd6b3b1da48ff66865917a1e1b08
a38f3ac36298d9163df245ff5a706ab87d16a5b0
refs/heads/master
2022-11-15T08:47:35.686071
2020-07-08T16:34:29
2020-07-08T16:34:29
278,141,500
0
0
null
null
null
null
UTF-8
C++
false
false
983
cpp
#include <stdio.h> #include <stdlib.h> #include <math.h> #include "Profiler.h" Profiler prof("Functions"); int fact(int n) { if(n) { return n * fact(n - 1); } return 1; } void createGroup(int step, int max_size) { for(int n = 1; n < max_size; n += step) { prof.countOperation("100_log_n", n, 100 * log(n)); prof.countOperation("2_n", n, pow(2, n)); prof.countOperation("2_n_fact", n, 2 * fact(n)); } for(int n = 1; n < max_size * 3; n += step) { prof.countOperation("n", n, n); prof.countOperation("10_n", n, 10 * n); prof.countOperation("0.5_n_2", n, 0.5 * n * n); } prof.createGroup("Functions_1", "n", "10_n", "0.5_n_2"); prof.createGroup("Functions_2", "2_n_fact"); prof.createGroup("Functions_3", "100_log_n", "2_n"); prof.showReport(); prof.reset(); } int main() { createGroup(1, 10); createGroup(1, 5); createGroup(1, 12); return 0; }
[ "mate.kelemen009@gmail.com" ]
mate.kelemen009@gmail.com
1c9a91538ac346e065263233dc8e938d2b60f892
cea82f8c7bfdbee74b28e6372c3a40bbdf6bccf1
/test-misc/quotesource-client.cpp
f6242eb9e6734133157479513ac9004cefe409c0
[]
no_license
asakul/libgoldmine
5de94469efd30f9f2a357d6c5d621d3578106984
69e498c02f7bb63d65bb8eb34422c8c3d96c7e22
refs/heads/master
2020-04-06T03:33:58.198160
2016-09-16T14:32:25
2016-09-16T14:32:25
56,564,310
0
0
null
null
null
null
UTF-8
C++
false
false
865
cpp
#include "quotesource/quotesourceclient.h" #include "goldmine/data.h" #include "cppio/iolinemanager.h" #include <boost/thread.hpp> #include <iostream> #include <cstdlib> #include <ctime> using namespace goldmine; class Sink : public QuoteSourceClient::Sink { public: void incomingTick(const std::string& ticker, const Tick& tick) { std::cout << "Incoming tick: " << ticker << ": " << tick.value.toDouble() << '\n'; } }; int main(int argc, char** argv) { if(argc < 2) { std::cerr << "Usage ./client <quotesource-endpoint>" << '\n'; return 1; } auto man = std::shared_ptr<cppio::IoLineManager>(cppio::createLineManager()); QuoteSourceClient client(man, argv[1]); auto sink = std::make_shared<Sink>(); client.registerSink(sink); client.startStream("t:FOOBAR"); while(true) { boost::this_thread::sleep_for(boost::chrono::seconds(1)); } }
[ "denis@kasan.ws" ]
denis@kasan.ws
b0469f43095298e7afc5ee2f0c17e90e688e3dd9
85aed0bcac5d6aea781dff64029c2d23fcba984b
/netserverLib/s_CDbGlobal.cpp
1e93381c42b0c6ddc266320268026ffb3b2930c6
[]
no_license
youdontknowme17/ura
3c76bf05eccd38b454b389841f1db49b59217e46
e31bc9fd9c2312175d250dc4dc1f9c656c7f2004
refs/heads/master
2020-03-28T15:49:00.379682
2018-09-15T09:57:49
2018-09-15T09:57:49
148,628,762
0
2
null
null
null
null
UTF-8
C++
false
false
3,406
cpp
/////////////////////////////////////////////////////////////////////////////// // s_CDbmanager.cpp // // class CDbList // class CDbmanager // // * History // 2002.05.30 jgkim Create // // Copyright 2002-2003 (c) Mincoms. All rights reserved. // // * Note : // /////////////////////////////////////////////////////////////////////////////// #include "stdafx.h" #include "s_CDbmanager.h" #include "GLogicData.h" #include "s_CCfg.h" #include <strstream> #include "GLCharAG.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif #define FMTSTR "%-8.8s %-8.8s %-8.8s %-8.8s\n" #define FMTSTR1 "%-8.8s %-8.8s %8.8ld %8.8ld\n" #define MONEYPRINT 12 /////////////////////////////////////////////////////////////////////////////// // DB_Initialize() // Description // Initialize Database // Arguments // // Return Value // Succeeded : DB_OK // Error : DB_ERROR /////////////////////////////////////////////////////////////////////////////// int DB_Initialize(void) { if (dbinit() == (char *)NULL) { return DB_ERROR; } // Install the user-supplied error-handling and message-handling routines. // dberrhandle((DBERRHANDLE_PROC)DB_err_handler); // dbmsghandle((DBMSGHANDLE_PROC)DB_msg_handler); return DB_OK; } /////////////////////////////////////////////////////////////////////////////// // DB_Shutdown(void) // Description // Shutdown all database connections. // Arguments // // Return Value // /////////////////////////////////////////////////////////////////////////////// void DB_Shutdown(void) { // Close the connection and exit database. dbexit(); // windows only dbwinexit(); } /////////////////////////////////////////////////////////////////////////////// // DB_err_handler() // Description // // Arguments // // Return Value // /////////////////////////////////////////////////////////////////////////////// int DB_err_handler(PDBPROCESS dbproc, int severity, int dberr, int oserr, char * dberrstr, char * oserrstr) { if (dberrstr != NULL) { CConsoleMessage::GetInstance()->Write(C_MSG_FILE_CONSOLE, "INFO:DB-LIBRARY %s", dberrstr); return DB_ERROR; } if (oserr != DBNOERR) { CConsoleMessage::GetInstance()->Write(C_MSG_FILE_CONSOLE, "ERROR:Operating-system error(%s)", oserrstr); return DB_ERROR; } /* CConsoleMessage::GetInstance()->Write(C_MSG_FILE_CONSOLE, "INFO:DB-Library %s", dberrstr); if (severity == EXCOMM && (oserr != DBNOERR || oserrstr)) CConsoleMessage::GetInstance()->Write(C_MSG_FILE_CONSOLE, "ERROR:Net-Lib (%d)%s", oserr, oserrstr); if (oserr != DBNOERR) CConsoleMessage::GetInstance()->Write(C_MSG_FILE_CONSOLE, "ERROR:Operating-system error:%s", oserrstr); */ if ((dbproc == NULL) || (DBDEAD(dbproc))) return(INT_EXIT); else return(INT_CANCEL); } /////////////////////////////////////////////////////////////////////////////// // DB_msg_handler() // Description // // Arguments // // Return Value // /////////////////////////////////////////////////////////////////////////////// int DB_msg_handler(PDBPROCESS dbproc, DBINT msgno, int msgstate, int severity, char * msgtext) { CConsoleMessage::GetInstance()->Write(C_MSG_FILE_CONSOLE, "ERROR:SQL Server message %ld, state %d, severity %d %s", msgno, msgstate, severity, msgtext); return DB_ERROR; }
[ "markcalimosa@gmail.com" ]
markcalimosa@gmail.com
1635d8dc6e56f2a0e4ecd78ba2bd888b2ff260d2
08b8cf38e1936e8cec27f84af0d3727321cec9c4
/data/crawl/wget/hunk_574.cpp
729fc03d344824b3e0ff03b13cdfcee68ae72493
[]
no_license
ccdxc/logSurvey
eaf28e9c2d6307140b17986d5c05106d1fd8e943
6b80226e1667c1e0760ab39160893ee19b0e9fb1
refs/heads/master
2022-01-07T21:31:55.446839
2018-04-21T14:12:43
2018-04-21T14:12:43
null
0
0
null
null
null
null
UTF-8
C++
false
false
899
cpp
"Adresár `%s' neexistuje.\n" "\n" -#: src/ftp.c:588 +#: src/ftp.c:730 msgid "==> CWD not required.\n" msgstr "==> CWD nie je potrebné.\n" -#: src/ftp.c:649 +#: src/ftp.c:791 msgid "Cannot initiate PASV transfer.\n" msgstr "Nemožno iniciovať prenos príkazom PASV.\n" -#: src/ftp.c:653 +#: src/ftp.c:795 msgid "Cannot parse PASV response.\n" msgstr "Nemôžem analyzovať odpoveď na PASV.\n" # , c-format -#: src/ftp.c:670 +#: src/ftp.c:812 #, c-format msgid "couldn't connect to %s port %d: %s\n" msgstr "nemôžem sa pripojiť k %s port %d: %s\n" # , c-format -#: src/ftp.c:718 +#: src/ftp.c:860 #, c-format msgid "Bind error (%s).\n" msgstr "Chyba pri operácii \"bind\" (%s).\n" -#: src/ftp.c:724 +#: src/ftp.c:866 msgid "Invalid PORT.\n" msgstr "Neplatný PORT.\n" -#: src/ftp.c:770 +#: src/ftp.c:912 msgid "" "\n" "REST failed, starting from scratch.\n"
[ "993273596@qq.com" ]
993273596@qq.com
dd1f74c822409d0854f881d6134e8c3997525ad2
1baf951f176c87713d6718a7841ea2e695f2ba2f
/2주차/예제/topic_first/src/simple_pub.cpp
50c957d2d19091037b35fb81ed3668374fcc8d82
[]
no_license
ing03201/study_ROS
5a454504f8f94c8e9a1f7eca191ff214282fe4c7
6e5c1885ccf0172ce3d7376ae0ade6dfb3c94fe3
refs/heads/master
2020-04-07T23:18:10.277362
2018-11-24T08:25:06
2018-11-24T08:25:06
158,806,799
0
0
null
null
null
null
UTF-8
C++
false
false
722
cpp
#include "ros/ros.h" #include "topic_first/simplemsg.h" #include <sstream> int main(int argc, char *argv[]){ ros::init(argc, argv, "simple_pub"); ros::NodeHandle n; ros::Publisher pub = n.advertise<topic_first::simplemsg>("chatter", 1000); ros::Rate loop_rate(10); int count = 0; while(ros::ok()) { topic_first::simplemsg msg; std::stringstream ss; ss << "hello world!" << count; msg.data = ss.str(); std::string id; n.param("/chatter id", id, std::string("no id registered")); msg.id = id; ROS_INFO("[%s] : %s ", msg.id.c_str(), msg.data.c_str()); pub.publish(msg); loop_rate.sleep(); ++count; } }
[ "ing03201@gmail.com" ]
ing03201@gmail.com
06e217ef46cbfe3c93a28197edea22c54f740096
cbd0d93632b38f6ed242766bb56dbc0b29f3f0a2
/src/UnrealCompiler/CompilerSettings.h
90492b44026c05a2de37abdd12d66dfd2cd38733
[ "Apache-2.0" ]
permissive
RtsAiResearch/IStrategizer
97b60c6d12d3cd71dbd952e45b37746fee8b61a6
2005060d40190041e4d541e23b6148336241d690
refs/heads/master
2020-05-17T08:24:29.666200
2017-03-06T06:42:53
2017-03-06T06:42:53
3,828,751
15
2
null
2017-03-06T06:42:53
2012-03-26T01:31:58
C++
UTF-8
C++
false
false
451
h
#ifndef COMPILERSETTINGS_H #define COMPILERSETTINGS_H #include <string> using namespace std; class CompilerSettings { public: static CompilerSettings& Instance() { static CompilerSettings instance; return instance; } string GrammarDefinitionPath() { return "Tiny(C)SDT.txt"; } string LexerDefinitionPath() { return "Tiny(C)Tokens.txt"; } #define g_CompilerSettings CompilerSettings::Instance() }; #endif // COMPILERSETTINGS_H
[ "mhesham.fcis@gmail.com" ]
mhesham.fcis@gmail.com
c451d8c5c5bb566349fcc2f6d2ea959f218524fa
ab97d80652186bd4944214545049cd9ede45d684
/simpleperf/read_elf_test.cpp
f2649e00a6d51e369fb99697248a28860212ccbb
[ "Apache-2.0" ]
permissive
maxime-poulain/android_system_extras
e95716b43f26bfab884261de5fb96075cc91556c
baaceaeff834b848f2b5c48b3d7744401ed900f1
refs/heads/master
2022-09-17T18:05:14.402947
2016-05-27T23:30:47
2016-05-27T23:30:47
null
0
0
null
null
null
null
UTF-8
C++
false
false
4,099
cpp
/* * Copyright (C) 2015 The Android Open Source Project * * 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 "read_elf.h" #include <gtest/gtest.h> #include <map> #include "get_test_data.h" #include "test_util.h" TEST(read_elf, GetBuildIdFromElfFile) { BuildId build_id; ASSERT_TRUE(GetBuildIdFromElfFile(GetTestData(ELF_FILE), &build_id)); ASSERT_EQ(build_id, BuildId(elf_file_build_id)); } TEST(read_elf, GetBuildIdFromEmbeddedElfFile) { BuildId build_id; ASSERT_TRUE(GetBuildIdFromEmbeddedElfFile(GetTestData(APK_FILE), NATIVELIB_OFFSET_IN_APK, NATIVELIB_SIZE_IN_APK, &build_id)); ASSERT_EQ(build_id, native_lib_build_id); } void ParseSymbol(const ElfFileSymbol& symbol, std::map<std::string, ElfFileSymbol>* symbols) { (*symbols)[symbol.name] = symbol; } static void CheckGlobalVariableSymbols(const std::map<std::string, ElfFileSymbol>& symbols) { auto pos = symbols.find("GlobalVar"); ASSERT_NE(pos, symbols.end()); ASSERT_FALSE(pos->second.is_func); } static void CheckFunctionSymbols(const std::map<std::string, ElfFileSymbol>& symbols) { auto pos = symbols.find("GlobalFunc"); ASSERT_NE(pos, symbols.end()); ASSERT_TRUE(pos->second.is_func); ASSERT_TRUE(pos->second.is_in_text_section); } void CheckElfFileSymbols(const std::map<std::string, ElfFileSymbol>& symbols) { CheckGlobalVariableSymbols(symbols); CheckFunctionSymbols(symbols); } TEST(read_elf, parse_symbols_from_elf_file_with_correct_build_id) { std::map<std::string, ElfFileSymbol> symbols; ASSERT_TRUE(ParseSymbolsFromElfFile(GetTestData(ELF_FILE), elf_file_build_id, std::bind(ParseSymbol, std::placeholders::_1, &symbols))); CheckElfFileSymbols(symbols); } TEST(read_elf, parse_symbols_from_elf_file_without_build_id) { std::map<std::string, ElfFileSymbol> symbols; ASSERT_TRUE(ParseSymbolsFromElfFile(GetTestData(ELF_FILE), BuildId(), std::bind(ParseSymbol, std::placeholders::_1, &symbols))); CheckElfFileSymbols(symbols); } TEST(read_elf, parse_symbols_from_elf_file_with_wrong_build_id) { BuildId build_id("01010101010101010101"); std::map<std::string, ElfFileSymbol> symbols; ASSERT_FALSE(ParseSymbolsFromElfFile(GetTestData(ELF_FILE), build_id, std::bind(ParseSymbol, std::placeholders::_1, &symbols))); } TEST(read_elf, ParseSymbolsFromEmbeddedElfFile) { std::map<std::string, ElfFileSymbol> symbols; ASSERT_TRUE(ParseSymbolsFromEmbeddedElfFile(GetTestData(APK_FILE), NATIVELIB_OFFSET_IN_APK, NATIVELIB_SIZE_IN_APK, native_lib_build_id, std::bind(ParseSymbol, std::placeholders::_1, &symbols))); CheckElfFileSymbols(symbols); } TEST(read_elf, ParseSymbolFromMiniDebugInfoElfFile) { std::map<std::string, ElfFileSymbol> symbols; ASSERT_TRUE(ParseSymbolsFromElfFile(GetTestData(ELF_FILE_WITH_MINI_DEBUG_INFO), BuildId(), std::bind(ParseSymbol, std::placeholders::_1, &symbols))); CheckFunctionSymbols(symbols); } TEST(read_elf, arm_mapping_symbol) { ASSERT_TRUE(IsArmMappingSymbol("$a")); ASSERT_FALSE(IsArmMappingSymbol("$b")); ASSERT_TRUE(IsArmMappingSymbol("$a.anything")); ASSERT_FALSE(IsArmMappingSymbol("$a_no_dot")); } TEST(read_elf, IsValidElfPath) { ASSERT_FALSE(IsValidElfPath("/dev/zero")); ASSERT_FALSE(IsValidElfPath("/sys/devices/system/cpu/online")); ASSERT_TRUE(IsValidElfPath(GetTestData(ELF_FILE))); }
[ "yabinc@google.com" ]
yabinc@google.com
eb77fd608114e3a7e265b7edf6b5c38420799b54
e4de1fcdc728bdfd0580fc07adefbfbb48d67892
/simplerpg/Rect.cpp
8de70690300a9f1cf9164b4a176996f7c6bc1d5b
[]
no_license
astrellon/SimpleRPG
1df00b5900deb624c7fe264b88d39a509f67df9c
ce9afb107925488c0a159664f3ea387a56ef559a
refs/heads/master
2021-01-19T20:18:28.767459
2011-11-03T20:58:54
2011-11-03T20:58:54
1,505,830
0
0
null
null
null
null
UTF-8
C++
false
false
788
cpp
#include "Rect.h" Rect::Rect() { mX = 0; mY = 0; mWidth = 0; mHeight = 0; } Rect::Rect(int x, int y, int width, int height) { mX = x; mY = y; mWidth = width; mHeight = height; } Rect::~Rect(void) { } void Rect::setWidth(const int &width) { if(width < 0) { setX(getX() + width); mWidth = -width; } else { mWidth = width; } } void Rect::setHeight(const int &height) { if(height < 0) { setY(getY() + height); mHeight = -height; } else { mHeight = height; } } void Rect::setRect(const int &x, const int &y, const int &width, const int &height) { setX(x); setY(y); setWidth(width); setHeight(height); } void Rect::setRect(const Vector2i &position, const Vector2i &size) { setX(position.x); setY(position.y); setWidth(size.x); setHeight(size.y); }
[ "sovereign250@gmail.com" ]
sovereign250@gmail.com
2e61fb9dae466d683b10f7e488d940b17ca1e2ad
3d85474e3ca2c9de7941477d0e06d7bdb867e6af
/088-merge-sorted-array.cpp
d4daaefbebad303c81d8753546dfcaef7490a1d7
[ "MIT" ]
permissive
nave7693/leetcode
9dd7c14d27e8f3abc974a50028709c236bdc03ef
8ff388cb17e87aa9053eaed3b84e7dc2be3e2e49
refs/heads/master
2020-05-22T08:02:27.292507
2017-08-28T18:20:46
2017-08-28T18:20:46
51,724,795
0
0
null
null
null
null
UTF-8
C++
false
false
797
cpp
// https://leetcode.com/problems/merge-sorted-array/ class Solution { public: void merge(vector<int>& nums1, int m, vector<int>& nums2, int n) { int index1 = m - 1; int index2 = n - 1; int mergeIndex = m + n - 1; while (index1 >= 0 && index2 >= 0) { int nextElement; if (nums1[index1] > nums2[index2]) { nums1[mergeIndex] = nums1[index1]; index1--; mergeIndex--; } else { nums1[mergeIndex] = nums2[index2]; index2--; mergeIndex--; } } while (index2 >= 0) { nums1[mergeIndex] = nums2[index2]; mergeIndex--; index2--; } } };
[ "nave7693@digitcastle.net" ]
nave7693@digitcastle.net
25573ecc5e9dbbe20a0be3234444b4fde5faefde
4bf7451ea5753a1138ed37b251585421486abd15
/src/qt/psbtoperationsdialog.cpp
6c3d3ad0e57e125664d22324ed7dff1b56c58af9
[ "MIT" ]
permissive
bitcoin-invest/bitcoin-invest
f81fa2f683530512989bff5c338ca91e664e178a
59119d63a9a695a81e2103cfa6c753acc928d534
refs/heads/main
2023-02-21T09:51:42.525312
2021-01-01T12:22:44
2021-01-01T12:22:44
325,972,447
0
0
null
null
null
null
UTF-8
C++
false
false
10,808
cpp
// Copyright (c) 2011-2020 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include <qt/psbtoperationsdialog.h> #include <core_io.h> #include <interfaces/node.h> #include <key_io.h> #include <node/psbt.h> #include <policy/policy.h> #include <qt/bitcoinunits.h> #include <qt/forms/ui_psbtoperationsdialog.h> #include <qt/guiutil.h> #include <qt/optionsmodel.h> #include <util/strencodings.h> #include <iostream> PSBTOperationsDialog::PSBTOperationsDialog( QWidget* parent, WalletModel* wallet_model, ClientModel* client_model) : QDialog(parent), m_ui(new Ui::PSBTOperationsDialog), m_wallet_model(wallet_model), m_client_model(client_model) { m_ui->setupUi(this); setWindowTitle("PSBT Operations"); connect(m_ui->signTransactionButton, &QPushButton::clicked, this, &PSBTOperationsDialog::signTransaction); connect(m_ui->broadcastTransactionButton, &QPushButton::clicked, this, &PSBTOperationsDialog::broadcastTransaction); connect(m_ui->copyToClipboardButton, &QPushButton::clicked, this, &PSBTOperationsDialog::copyToClipboard); connect(m_ui->saveButton, &QPushButton::clicked, this, &PSBTOperationsDialog::saveTransaction); connect(m_ui->closeButton, &QPushButton::clicked, this, &PSBTOperationsDialog::close); m_ui->signTransactionButton->setEnabled(false); m_ui->broadcastTransactionButton->setEnabled(false); } PSBTOperationsDialog::~PSBTOperationsDialog() { delete m_ui; } void PSBTOperationsDialog::openWithPSBT(PartiallySignedTransaction psbtx) { m_transaction_data = psbtx; bool complete; size_t n_could_sign; FinalizePSBT(psbtx); // Make sure all existing signatures are fully combined before checking for completeness. TransactionError err = m_wallet_model->wallet().fillPSBT(SIGHASH_ALL, false /* sign */, true /* bip32derivs */, m_transaction_data, complete, &n_could_sign); if (err != TransactionError::OK) { showStatus(tr("Failed to load transaction: %1") .arg(QString::fromStdString(TransactionErrorString(err).translated)), StatusLevel::ERR); return; } m_ui->broadcastTransactionButton->setEnabled(complete); m_ui->signTransactionButton->setEnabled(!complete && !m_wallet_model->wallet().privateKeysDisabled() && n_could_sign > 0); updateTransactionDisplay(); } void PSBTOperationsDialog::signTransaction() { bool complete; size_t n_signed; TransactionError err = m_wallet_model->wallet().fillPSBT(SIGHASH_ALL, true /* sign */, true /* bip32derivs */, m_transaction_data, complete, &n_signed); if (err != TransactionError::OK) { showStatus(tr("Failed to sign transaction: %1") .arg(QString::fromStdString(TransactionErrorString(err).translated)), StatusLevel::ERR); return; } updateTransactionDisplay(); if (!complete && n_signed < 1) { showStatus(tr("Could not sign any more inputs."), StatusLevel::WARN); } else if (!complete) { showStatus(tr("Signed %1 inputs, but more signatures are still required.").arg(n_signed), StatusLevel::INFO); } else { showStatus(tr("Signed transaction successfully. Transaction is ready to broadcast."), StatusLevel::INFO); m_ui->broadcastTransactionButton->setEnabled(true); } } void PSBTOperationsDialog::broadcastTransaction() { CMutableTransaction mtx; if (!FinalizeAndExtractPSBT(m_transaction_data, mtx)) { // This is never expected to fail unless we were given a malformed PSBT // (e.g. with an invalid signature.) showStatus(tr("Unknown error processing transaction."), StatusLevel::ERR); return; } CTransactionRef tx = MakeTransactionRef(mtx); std::string err_string; TransactionError error = BroadcastTransaction( *m_client_model->node().context(), tx, err_string, DEFAULT_MAX_RAW_TX_FEE_RATE.GetFeePerK(), /* relay */ true, /* await_callback */ false); if (error == TransactionError::OK) { showStatus(tr("Transaction broadcast successfully! Transaction ID: %1") .arg(QString::fromStdString(tx->GetHash().GetHex())), StatusLevel::INFO); } else { showStatus(tr("Transaction broadcast failed: %1") .arg(QString::fromStdString(TransactionErrorString(error).translated)), StatusLevel::ERR); } } void PSBTOperationsDialog::copyToClipboard() { CDataStream ssTx(SER_NETWORK, PROTOCOL_VERSION); ssTx << m_transaction_data; GUIUtil::setClipboard(EncodeBase64(ssTx.str()).c_str()); showStatus(tr("PSBT copied to clipboard."), StatusLevel::INFO); } void PSBTOperationsDialog::saveTransaction() { CDataStream ssTx(SER_NETWORK, PROTOCOL_VERSION); ssTx << m_transaction_data; QString selected_filter; QString filename_suggestion = ""; bool first = true; for (const CTxOut& out : m_transaction_data.tx->vout) { if (!first) { filename_suggestion.append("-"); } CTxDestination address; ExtractDestination(out.scriptPubKey, address); QString amount = BitcoinUnits::format(m_wallet_model->getOptionsModel()->getDisplayUnit(), out.nValue); QString address_str = QString::fromStdString(EncodeDestination(address)); filename_suggestion.append(address_str + "-" + amount); first = false; } filename_suggestion.append(".psbt"); QString filename = GUIUtil::getSaveFileName(this, tr("Save Transaction Data"), filename_suggestion, tr("Partially Signed Transaction (Binary) (*.psbt)"), &selected_filter); if (filename.isEmpty()) { return; } std::ofstream out(filename.toLocal8Bit().data()); out << ssTx.str(); out.close(); showStatus(tr("PSBT saved to disk."), StatusLevel::INFO); } void PSBTOperationsDialog::updateTransactionDisplay() { m_ui->transactionDescription->setText(QString::fromStdString(renderTransaction(m_transaction_data))); showTransactionStatus(m_transaction_data); } std::string PSBTOperationsDialog::renderTransaction(const PartiallySignedTransaction &psbtx) { QString tx_description = ""; CAmount totalAmount = 0; for (const CTxOut& out : psbtx.tx->vout) { CTxDestination address; ExtractDestination(out.scriptPubKey, address); totalAmount += out.nValue; tx_description.append(tr(" * Sends %1 to %2") .arg(BitcoinUnits::formatWithUnit(BitcoinUnits::BTCI, out.nValue)) .arg(QString::fromStdString(EncodeDestination(address)))); tx_description.append("<br>"); } PSBTAnalysis analysis = AnalyzePSBT(psbtx); tx_description.append(" * "); if (!*analysis.fee) { // This happens if the transaction is missing input UTXO information. tx_description.append(tr("Unable to calculate transaction fee or total transaction amount.")); } else { tx_description.append(tr("Pays transaction fee: ")); tx_description.append(BitcoinUnits::formatWithUnit(BitcoinUnits::BTCI, *analysis.fee)); // add total amount in all subdivision units tx_description.append("<hr />"); QStringList alternativeUnits; for (const BitcoinUnits::Unit u : BitcoinUnits::availableUnits()) { if(u != m_client_model->getOptionsModel()->getDisplayUnit()) { alternativeUnits.append(BitcoinUnits::formatHtmlWithUnit(u, totalAmount)); } } tx_description.append(QString("<b>%1</b>: <b>%2</b>").arg(tr("Total Amount")) .arg(BitcoinUnits::formatHtmlWithUnit(m_client_model->getOptionsModel()->getDisplayUnit(), totalAmount))); tx_description.append(QString("<br /><span style='font-size:10pt; font-weight:normal;'>(=%1)</span>") .arg(alternativeUnits.join(" " + tr("or") + " "))); } size_t num_unsigned = CountPSBTUnsignedInputs(psbtx); if (num_unsigned > 0) { tx_description.append("<br><br>"); tx_description.append(tr("Transaction has %1 unsigned inputs.").arg(QString::number(num_unsigned))); } return tx_description.toStdString(); } void PSBTOperationsDialog::showStatus(const QString &msg, StatusLevel level) { m_ui->statusBar->setText(msg); switch (level) { case StatusLevel::INFO: { m_ui->statusBar->setStyleSheet("QLabel { background-color : lightgreen }"); break; } case StatusLevel::WARN: { m_ui->statusBar->setStyleSheet("QLabel { background-color : orange }"); break; } case StatusLevel::ERR: { m_ui->statusBar->setStyleSheet("QLabel { background-color : red }"); break; } } m_ui->statusBar->show(); } size_t PSBTOperationsDialog::couldSignInputs(const PartiallySignedTransaction &psbtx) { size_t n_signed; bool complete; TransactionError err = m_wallet_model->wallet().fillPSBT(SIGHASH_ALL, false /* sign */, false /* bip32derivs */, m_transaction_data, complete, &n_signed); if (err != TransactionError::OK) { return 0; } return n_signed; } void PSBTOperationsDialog::showTransactionStatus(const PartiallySignedTransaction &psbtx) { PSBTAnalysis analysis = AnalyzePSBT(psbtx); size_t n_could_sign = couldSignInputs(psbtx); switch (analysis.next) { case PSBTRole::UPDATER: { showStatus(tr("Transaction is missing some information about inputs."), StatusLevel::WARN); break; } case PSBTRole::SIGNER: { QString need_sig_text = tr("Transaction still needs signature(s)."); StatusLevel level = StatusLevel::INFO; if (m_wallet_model->wallet().privateKeysDisabled()) { need_sig_text += " " + tr("(But this wallet cannot sign transactions.)"); level = StatusLevel::WARN; } else if (n_could_sign < 1) { need_sig_text += " " + tr("(But this wallet does not have the right keys.)"); // XXX wording level = StatusLevel::WARN; } showStatus(need_sig_text, level); break; } case PSBTRole::FINALIZER: case PSBTRole::EXTRACTOR: { showStatus(tr("Transaction is fully signed and ready for broadcast."), StatusLevel::INFO); break; } default: { showStatus(tr("Transaction status is unknown."), StatusLevel::ERR); break; } } }
[ "mail@bitcoin-invest.io" ]
mail@bitcoin-invest.io
166b7301c2793e4b6e48dbb22e8fa41cbfe94b15
440f814f122cfec91152f7889f1f72e2865686ce
/src/game_server/server/extension/cooling/cooling.h
ec0c42d52240a55e7f134a2f67acf4d713153bf5
[]
no_license
hackerlank/buzz-server
af329efc839634d19686be2fbeb700b6562493b9
f76de1d9718b31c95c0627fd728aba89c641eb1c
refs/heads/master
2020-06-12T11:56:06.469620
2015-12-05T08:03:25
2015-12-05T08:03:25
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,160
h
// // Summary: buzz source code. // // Author: Tony. // Email: tonyjobmails@gmail.com. // Last modify: 2013-03-25 17:52:24. // File name: cooling.h // // Description: // Define class Cooling. // #ifndef __GAME__SERVER__COOLING__COOLING__H #define __GAME__SERVER__COOLING__COOLING__H #include "core/base/noncopyable.h" #include "core/base/time_tick.h" #include "core/base/types.h" namespace game { namespace server { namespace cooling { class CoolingRole; class Cooling : public core::Noncopyable { public: Cooling(); ~Cooling(); bool Initialize(core::uint32 template_id); void Finalize(); // 是否冷却结束 bool CheckEnd() const; void Start(core::int64 elapse, core::int64 add_value = 0, core::int32 add_percent = 0); void End(); core::uint64 GetElapseTime() const; // 得到冷却结束时间 inline const core::TimestampMillisecond &GetEndTime() const { return this->end_time_; } private: // 冷却结束的时间戳 core::TimestampMillisecond end_time_; core::uint32 template_id_; }; } // namespace cooling } // namespace server } // namespace game #endif // __GAME__SERVER__COOLING__COOLING__H
[ "251729465@qq.com" ]
251729465@qq.com
e346aeb8ff0d8edb5d1df503d050b20584b1481c
4ffabcaae35b539ffd723881a24e50bca97b6061
/external/vulkancts/modules/vulkan/shaderrender/vktShaderRenderMatrixTests.hpp
894323c6f5daba7dc9ffb7db049e21ec1d78b544
[ "Apache-2.0", "LicenseRef-scancode-unknown-license-reference" ]
permissive
timur-losev/Vulkan-CTS
e1661b0dfb34aeccf546eed91b337c3b28d0f0d8
617f61f7d996886d48fc623c3138213218eee030
refs/heads/vulkan-cts-1.0
2020-12-03T05:33:45.052645
2016-03-03T18:00:41
2016-03-03T18:00:41
53,886,246
0
0
null
2016-03-14T19:39:12
2016-03-14T19:39:11
null
UTF-8
C++
false
false
1,754
hpp
#ifndef _VKTSHADERRENDERMATRIXTESTS_HPP #define _VKTSHADERRENDERMATRIXTESTS_HPP /*------------------------------------------------------------------------ * Vulkan Conformance Tests * ------------------------ * * Copyright (c) 2015 The Khronos Group Inc. * Copyright (c) 2015 Samsung Electronics Co., Ltd. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and/or associated documentation files (the * "Materials"), to deal in the Materials without restriction, including * without limitation the rights to use, copy, modify, merge, publish, * distribute, sublicense, and/or sell copies of the Materials, and to * permit persons to whom the Materials are furnished to do so, subject to * the following conditions: * * The above copyright notice(s) and this permission notice shall be included * in all copies or substantial portions of the Materials. * * THE MATERIALS ARE 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 * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. * *//*! * \file * \brief Shader matrix arithmetic tests. *//*--------------------------------------------------------------------*/ #include "tcuDefs.hpp" #include "tcuTestCase.hpp" namespace vkt { namespace sr { tcu::TestCaseGroup* createMatrixTests (tcu::TestContext& testCtx); } // sr } // vkt #endif // _VKTSHADERRENDERMATRIXTESTS_HPP
[ "pgal.u-szeged@partner.samsung.com" ]
pgal.u-szeged@partner.samsung.com
b710e392a634a44ca998f7df34f496a74b5421df
f0749232d54f17e3c321b0b90daaeb23b9faec82
/Online Judge Code/[Other] Online-Judge-Solutions-master_from github/SPOJ/Classical/2416 - Distinct Subsequences.cpp
21da1de3ea3081b56a760a7744bfc6c554bc3469
[]
no_license
tmuttaqueen/MyCodes
c9024a5b901e68e7c7466885eddbfcd31a5c9780
80ec40b26649029ad546ce8ce5bfec0b314b1f61
refs/heads/master
2020-04-18T22:20:51.845309
2019-05-16T18:11:02
2019-05-16T18:11:02
167,791,029
1
0
null
null
null
null
UTF-8
C++
false
false
733
cpp
#include <cstdio> #include <cstring> using namespace std; const int MOD = 1000000007; long long dp[100001]; int L,last[26]; char s[100001]; int main(){ int T; scanf("%d",&T); dp[0] = 1; while(T--){ scanf("%s",s); L = strlen(s); memset(last,-1,sizeof(last)); for(int i = 0;i < L;++i){ dp[i+1] = dp[i] << 1; if(dp[i+1] >= MOD) dp[i+1] -= MOD; if(last[s[i]-'A'] != -1){ dp[i+1] -= dp[last[s[i]-'A'] - 1]; if(dp[i+1] < 0) dp[i+1] += MOD; } last[s[i]-'A'] = i+1; } printf("%lld\n",dp[L]); } return 0; }
[ "1505002.tm@ugrad.cse.buet.ac.bd" ]
1505002.tm@ugrad.cse.buet.ac.bd
82e6d794c2161c7d2a9579cca11c26ccab20af30
d7ac06bfde8dcebe4a608c1400b370381d31418d
/ClientSide/structures.cpp
a7caaa5904c747255eba1faabf4e5f9c4fe08c08
[]
no_license
Kalito98/NETB380-Client-Server-Dictionary
89bc612050fedb40ff1465a4b858bd9c16e4fde1
f477a5c7550c59aed8417b9d5a0a4995c35efe41
refs/heads/master
2022-11-20T04:05:23.263387
2020-07-16T09:13:29
2020-07-16T09:13:29
255,307,271
0
0
null
null
null
null
UTF-8
C++
false
false
55
cpp
#include "structures.h" structures::structures() { }
[ "kaloyan.yanev98@gmail.com" ]
kaloyan.yanev98@gmail.com
f243e695dcfbc519d794a38d3e3220438510fae6
b4e5794699bc2e841776a21ead34c70f962ea2d5
/WorkerInfo/main.cpp
e54732faf185e707dfbeec74a99196a4f01ca641
[]
no_license
tangxinpeng/worker_info
bb800fa6acf4b09199c0d14b5d89307b95c23551
45eee98c350fa30eaab5eb28f63fce0b13694a18
refs/heads/master
2020-03-29T16:14:03.882922
2018-10-13T14:26:27
2018-10-13T14:26:27
null
0
0
null
null
null
null
GB18030
C++
false
false
5,023
cpp
#include"main.h" MYSQL* g_pConn; int SqlConn() { g_pConn = mysql_init(NULL); if (!g_pConn) { printf("Error %u: %s\n", mysql_errno(g_pConn), mysql_error(g_pConn)); return 0; } if (mysql_real_connect(g_pConn, "localhost", "root", "123456", "d_worker", 0, NULL, 0) == NULL) { printf("Error %u: %s\n", mysql_errno(g_pConn), mysql_error(g_pConn)); return 0; } mysql_query(g_pConn, "set names gbk"); //puts("数据库连接成功!"); return 1; } void Print(const char *sSQL) { printf("工号\t姓名\t工资\t入职日期\n"); MYSQL_ROW row; MYSQL_RES *res; if (sSQL == NULL) sSQL = "SELECT * FROM t_winfo"; mysql_query(g_pConn, sSQL); unsigned int i = 0; res = mysql_store_result(g_pConn); //res->row_count while (row = mysql_fetch_row(res)) { /*for (i = 0; i<mysql_num_fields(res); i++) { printf("%s\t", row[i]); }*/ printf("%s\t%s\t%s\t%s\n", row[0], row[1], row[2], row[3]); ++i; } printf("总共有 %d 条数据\n", i); system("pause"); } int PrintMenu() { system("cls"); puts("********************************"); puts("* *"); puts("* 1、按工号排序浏览 *"); puts("* 2、按姓名排序浏览 *"); puts("* 3、按工资排序浏览 *"); puts("* 0、退出 *"); puts("* *"); puts("********************************"); printf("请选择:"); int i = 0; scanf_s("%d", &i); switch (i) { case 1: Print("SELECT * FROM t_winfo ORDER BY winfo_numb"); break; case 2: Print("SELECT * FROM t_winfo ORDER BY winfo_name"); break; case 3: Print("SELECT * FROM t_winfo ORDER BY winfo_salary"); break; } return i; } int CheckNumb(int nNumb) { MYSQL_RES *res; char sSQL[64]; sprintf(sSQL,"SELECT * FROM t_winfo WHERE winfo_numb = '%d'" , nNumb); mysql_query(g_pConn, sSQL); res = mysql_store_result(g_pConn); //res->row_count if (res->row_count > 0) return 1; return 0; } void Modify() { int nNumb; printf_s("请输入您要修改的工号:"); scanf_s("%d", &nNumb); if (!nNumb) return; if (!CheckNumb(nNumb)) { printf_s("您输入的工号%d不存在!\n", nNumb); system("pause"); return; } printf_s("确定修改工号%d【y/n】:",nNumb); char c; scanf_s("\n%c", &c, (unsigned)sizeof(c)); if (c == 'y' || c == 'Y') { char sName[20], sDate[20]; float fSalary; printf_s("请输入新的姓名、工资、入职日期:"); scanf_s("%s%f%s", sName, (unsigned)sizeof(sName), &fSalary, sDate, (unsigned)sizeof(sDate)); char sSQL[256]; sprintf(sSQL, "UPDATE t_winfo SET winfo_name = '%s',winfo_salary = '%0.2f',winfo_date = '%s' WHERE winfo_numb = '%d'", sName, fSalary, sDate, nNumb); mysql_query(g_pConn, sSQL); Print(NULL); } } void Delete() { int nNumb; printf_s("请输入您要删除的工号:"); scanf_s("%d", &nNumb); if (!nNumb) return; if (!CheckNumb(nNumb)) { printf_s("您输入的工号%d不存在!\n", nNumb); system("pause"); return; } printf_s("确定删除工号%d【y/n】:", nNumb); char c; scanf_s("\n%c", &c, (unsigned)sizeof(c)); if (c == 'y' || c == 'Y') { char sSQL[64]; sprintf(sSQL, "DELETE FROM t_winfo WHERE winfo_numb = '%d'", nNumb); mysql_query(g_pConn, sSQL); Print(NULL); } } void Input() { int nNumb; printf_s("请输入工号:"); while (1) { scanf_s("%d", &nNumb); if (!nNumb) return; if (!CheckNumb(nNumb)) break; printf_s("工号%d已经存在,请重新输入:",nNumb); } char sName[20],sDate[20]; float fSalary; printf_s("请输入姓名、工资、入职日期:"); scanf_s("%s%f%s", sName, (unsigned)sizeof(sName), &fSalary, sDate, (unsigned)sizeof(sDate)); char sSQL[128]; sprintf(sSQL, "INSERT INTO t_winfo VALUES ('%d', '%s', '%0.2f', '%s')", nNumb,sName,fSalary,sDate); mysql_query(g_pConn, sSQL); Print(NULL); } int Menu() { system("cls"); puts("********************************"); puts("* 1、浏览所有信息 *"); puts("* 2、添加信息 *"); puts("* 3、删除信息 *"); puts("* 4、修改信息 *"); puts("* 5、查找信息 *"); puts("* 0、退出 *"); puts("********************************"); printf("请选择:"); int i = 0; scanf_s("%d", &i); switch (i) { case 1: //Print(NULL); while (PrintMenu()) ; break; case 2: Input(); break; case 3: Delete(); break; case 4: Modify(); break; case 5: while (FindMenu()) ; break; } return i; } void main() { if (!SqlConn()) return; puts("********************************"); puts("* *"); puts("* *"); puts("* 员工管理系统 *"); puts("* 2018.09 *"); puts("* *"); puts("* *"); puts("********************************"); system("pause"); while (Menu()) ; mysql_close(g_pConn); }
[ "978831608@qq.com" ]
978831608@qq.com
e4bf75e5dc8d472c513ca6a446f423ca429b1536
3329ff94ba44f5a575b5398985a33aa948b5f944
/0.00625/sprayCloud:rhoTrans_O2
d49f4b027e61575a5fd96d10fcb2fa29a74a06d5
[]
no_license
zlsherl/SKPS_simple
38cfac333dd65ed752e34c9f00b555d4255d2efc
0de13926915af0c7eaf1904fe57a8149a7741ba1
refs/heads/main
2023-05-26T20:03:42.391527
2021-06-12T10:24:09
2021-06-12T10:24:09
null
0
0
null
null
null
null
UTF-8
C++
false
false
994
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2012 | | \\ / A nd | Website: www.openfoam.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format binary; class volScalarField::Internal; arch "LSB;label=32;scalar=64"; location "0.00625"; object sprayCloud:rhoTrans_O2; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [1 0 0 0 0 0 0]; value uniform 0; // ************************************************************************* //
[ "krystek.pietrzak@gmail.com" ]
krystek.pietrzak@gmail.com
b5727fa07e441a31f1ac370d98def4d8aa6c455e
a38873fb106f5a056dbd2a49f3a2fecb9716870b
/PCShop/PCShop/ProductTypeDTO.h
a5d6e80b1e22c2b572f138e62a11cc6fc9752d1e
[]
no_license
PeterPavlovIvanov/C-Synthesis-and-Analysis-of-Algorithms
37529c5c0408d75837cf7a1e522b0343520f481d
c180b6fd5fc21e47e5d5aa491234462c5b7758cd
refs/heads/master
2022-10-10T03:31:25.535156
2022-09-22T17:50:38
2022-09-22T17:50:38
244,894,399
1
0
null
null
null
null
UTF-8
C++
false
false
564
h
#pragma once #include "ProductTypes.h" #include "Categories.h" #include "Models.h" #include "Brands.h" class ProductTypeDTO { public: ProductTypeDTO() { } ProductTypeDTO(PRODUCT_TYPES* productType) { this->productType = *productType; } ProductTypeDTO(PRODUCT_TYPES productType, CATEGORIES category, MODELS model, BRANDS brand) { this->productType=productType; this->category=category; this->brand=brand; this->model=model; } ~ProductTypeDTO() { } public: PRODUCT_TYPES productType; CATEGORIES category; MODELS model; BRANDS brand; };
[ "47712814+PeterPavlovIvanov@users.noreply.github.com" ]
47712814+PeterPavlovIvanov@users.noreply.github.com
2740dd0a4d470d1daf49b002e81600fa8131d83b
9bc0beeb37cd2c2cea01c9018244ae912dc6be27
/modules/drivers/smartereye/smartereye_handler.cc
f434e0358abc0503c3dfffbb3ca16fda41d2e79d
[ "Apache-2.0" ]
permissive
jinghaomiao/apollo
9af69412e0972c5e44a5fd01c4e2d6b60dc7e0d7
d58f852fc57af58c18c0a8892226c0e24aacb18c
refs/heads/master
2021-06-04T11:45:43.743449
2020-09-21T20:59:41
2020-09-21T20:59:41
96,828,443
7
6
Apache-2.0
2020-09-16T07:15:51
2017-07-10T22:57:40
C++
UTF-8
C++
false
false
1,794
cc
/****************************************************************************** * Copyright 2020 The Apollo 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 "modules/drivers/smartereye/smartereye_handler.h" #include <math.h> #include <iostream> #include <string> #include "third_party/camera_library/smartereye/include/LdwDataInterface.h" #include "third_party/camera_library/smartereye/include/disparityconvertor.h" #include "third_party/camera_library/smartereye/include/frameid.h" #include "third_party/camera_library/smartereye/include/obstacleData.h" #include "third_party/camera_library/smartereye/include/satpext.h" namespace apollo { namespace drivers { namespace smartereye { SmartereyeHandler::SmartereyeHandler(std::string name) : mName(name) { pCallbackFunc = nullptr; } SmartereyeHandler::~SmartereyeHandler() { pCallbackFunc = nullptr; } bool SmartereyeHandler::SetCallback(CallbackFunc ptr) { pCallbackFunc = ptr; return true; } void SmartereyeHandler::handleRawFrame(const RawImageFrame *rawFrame) { pCallbackFunc(const_cast<RawImageFrame *>(rawFrame)); } } // namespace smartereye } // namespace drivers } // namespace apollo
[ "xiaoxiangquan@gmail.com" ]
xiaoxiangquan@gmail.com
41d6f4fe713f0342e06af2862d067747637a3588
d84a900f50f30cfb9c6440497c5eeff132e0e275
/universal_robot/ur_kinematics/src/ur_moveit_plugin.cpp
2ee606dd14df7cb9fd5b432eb48eecc59edaec38
[]
no_license
dovanhuong/master_thesis_hci_robotics_june_2019
23bbbf205344b848d1764b6ae0d5c49045f29fbb
1cfde77acdb47c42dc339aaaf2ced83b82671d70
refs/heads/master
2022-01-05T19:54:21.157341
2019-07-15T05:29:43
2019-07-15T05:29:43
189,994,897
1
0
null
null
null
null
UTF-8
C++
false
false
31,583
cpp
/********************************************************************* * Software License Agreement (BSD License) * * Copyright (c) 2014, Georgia Tech * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. * * Neither the name of Georgia Tech nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. *********************************************************************/ /* Author: Kelsey Hawkins */ /* Based on orignal source from Willow Garage. License copied below */ /********************************************************************* * Software License Agreement (BSD License) * * Copyright (c) 2012, Willow Garage, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. * * Neither the name of Willow Garage nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. *********************************************************************/ /* Author: Sachin Chitta, David Lu!!, Ugo Cupcic */ #include <class_loader/class_loader.h> //#include <tf/transform_datatypes.h> #include <tf_conversions/tf_kdl.h> #include <kdl_parser/kdl_parser.hpp> // URDF, SRDF #include <urdf_model/model.h> #include <srdfdom/model.h> #include <moveit/rdf_loader/rdf_loader.h> // UR kin #include <ur_kinematics/ur_moveit_plugin.h> #include <ur_kinematics/ur_kin.h> //register KDLKinematics as a KinematicsBase implementation CLASS_LOADER_REGISTER_CLASS(ur_kinematics::URKinematicsPlugin, kinematics::KinematicsBase) namespace ur_kinematics { URKinematicsPlugin::URKinematicsPlugin():active_(false) {} void URKinematicsPlugin::getRandomConfiguration(KDL::JntArray &jnt_array, bool lock_redundancy) const { std::vector<double> jnt_array_vector(dimension_, 0.0); state_->setToRandomPositions(joint_model_group_); state_->copyJointGroupPositions(joint_model_group_, &jnt_array_vector[0]); for (std::size_t i = 0; i < dimension_; ++i) { if (lock_redundancy) if (isRedundantJoint(i)) continue; jnt_array(i) = jnt_array_vector[i]; } } bool URKinematicsPlugin::isRedundantJoint(unsigned int index) const { for (std::size_t j=0; j < redundant_joint_indices_.size(); ++j) if (redundant_joint_indices_[j] == index) return true; return false; } void URKinematicsPlugin::getRandomConfiguration(const KDL::JntArray &seed_state, const std::vector<double> &consistency_limits, KDL::JntArray &jnt_array, bool lock_redundancy) const { std::vector<double> values(dimension_, 0.0); std::vector<double> near(dimension_, 0.0); for (std::size_t i = 0 ; i < dimension_; ++i) near[i] = seed_state(i); // Need to resize the consistency limits to remove mimic joints std::vector<double> consistency_limits_mimic; for(std::size_t i = 0; i < dimension_; ++i) { if(!mimic_joints_[i].active) continue; consistency_limits_mimic.push_back(consistency_limits[i]); } joint_model_group_->getVariableRandomPositionsNearBy(state_->getRandomNumberGenerator(), values, near, consistency_limits_mimic); for (std::size_t i = 0; i < dimension_; ++i) { bool skip = false; if (lock_redundancy) for (std::size_t j = 0; j < redundant_joint_indices_.size(); ++j) if (redundant_joint_indices_[j] == i) { skip = true; break; } if (skip) continue; jnt_array(i) = values[i]; } } bool URKinematicsPlugin::checkConsistency(const KDL::JntArray& seed_state, const std::vector<double> &consistency_limits, const KDL::JntArray& solution) const { for (std::size_t i = 0; i < dimension_; ++i) if (fabs(seed_state(i) - solution(i)) > consistency_limits[i]) return false; return true; } bool URKinematicsPlugin::initialize(const std::string &robot_description, const std::string& group_name, const std::string& base_frame, const std::string& tip_frame, double search_discretization) { setValues(robot_description, group_name, base_frame, tip_frame, search_discretization); ros::NodeHandle private_handle("~"); rdf_loader::RDFLoader rdf_loader(robot_description_); const srdf::ModelSharedPtr &srdf = rdf_loader.getSRDF(); const urdf::ModelInterfaceSharedPtr &urdf_model = rdf_loader.getURDF(); if (!urdf_model || !srdf) { ROS_ERROR_NAMED("kdl","URDF and SRDF must be loaded for KDL kinematics solver to work."); return false; } robot_model_.reset(new robot_model::RobotModel(urdf_model, srdf)); robot_model::JointModelGroup* joint_model_group = robot_model_->getJointModelGroup(group_name); if (!joint_model_group) return false; if(!joint_model_group->isChain()) { ROS_ERROR_NAMED("kdl","Group '%s' is not a chain", group_name.c_str()); return false; } if(!joint_model_group->isSingleDOFJoints()) { ROS_ERROR_NAMED("kdl","Group '%s' includes joints that have more than 1 DOF", group_name.c_str()); return false; } KDL::Tree kdl_tree; if (!kdl_parser::treeFromUrdfModel(*urdf_model, kdl_tree)) { ROS_ERROR_NAMED("kdl","Could not initialize tree object"); return false; } if (!kdl_tree.getChain(base_frame_, getTipFrame(), kdl_chain_)) { ROS_ERROR_NAMED("kdl","Could not initialize chain object"); return false; } dimension_ = joint_model_group->getActiveJointModels().size() + joint_model_group->getMimicJointModels().size(); for (std::size_t i=0; i < joint_model_group->getJointModels().size(); ++i) { if(joint_model_group->getJointModels()[i]->getType() == moveit::core::JointModel::REVOLUTE || joint_model_group->getJointModels()[i]->getType() == moveit::core::JointModel::PRISMATIC) { ik_chain_info_.joint_names.push_back(joint_model_group->getJointModelNames()[i]); const std::vector<moveit_msgs::JointLimits> &jvec = joint_model_group->getJointModels()[i]->getVariableBoundsMsg(); ik_chain_info_.limits.insert(ik_chain_info_.limits.end(), jvec.begin(), jvec.end()); } } fk_chain_info_.joint_names = ik_chain_info_.joint_names; fk_chain_info_.limits = ik_chain_info_.limits; if(!joint_model_group->hasLinkModel(getTipFrame())) { ROS_ERROR_NAMED("kdl","Could not find tip name in joint group '%s'", group_name.c_str()); return false; } ik_chain_info_.link_names.push_back(getTipFrame()); fk_chain_info_.link_names = joint_model_group->getLinkModelNames(); joint_min_.resize(ik_chain_info_.limits.size()); joint_max_.resize(ik_chain_info_.limits.size()); for(unsigned int i=0; i < ik_chain_info_.limits.size(); i++) { joint_min_(i) = ik_chain_info_.limits[i].min_position; joint_max_(i) = ik_chain_info_.limits[i].max_position; } // Get Solver Parameters int max_solver_iterations; double epsilon; bool position_ik; private_handle.param("max_solver_iterations", max_solver_iterations, 500); private_handle.param("epsilon", epsilon, 1e-5); private_handle.param(group_name+"/position_only_ik", position_ik, false); ROS_DEBUG_NAMED("kdl","Looking in private handle: %s for param name: %s", private_handle.getNamespace().c_str(), (group_name+"/position_only_ik").c_str()); if(position_ik) ROS_INFO_NAMED("kdl","Using position only ik"); num_possible_redundant_joints_ = kdl_chain_.getNrOfJoints() - joint_model_group->getMimicJointModels().size() - (position_ik? 3:6); // Check for mimic joints bool has_mimic_joints = joint_model_group->getMimicJointModels().size() > 0; std::vector<unsigned int> redundant_joints_map_index; std::vector<kdl_kinematics_plugin::JointMimic> mimic_joints; unsigned int joint_counter = 0; for (std::size_t i = 0; i < kdl_chain_.getNrOfSegments(); ++i) { const robot_model::JointModel *jm = robot_model_->getJointModel(kdl_chain_.segments[i].getJoint().getName()); //first check whether it belongs to the set of active joints in the group if (jm->getMimic() == NULL && jm->getVariableCount() > 0) { kdl_kinematics_plugin::JointMimic mimic_joint; mimic_joint.reset(joint_counter); mimic_joint.joint_name = kdl_chain_.segments[i].getJoint().getName(); mimic_joint.active = true; mimic_joints.push_back(mimic_joint); ++joint_counter; continue; } if (joint_model_group->hasJointModel(jm->getName())) { if (jm->getMimic() && joint_model_group->hasJointModel(jm->getMimic()->getName())) { kdl_kinematics_plugin::JointMimic mimic_joint; mimic_joint.reset(joint_counter); mimic_joint.joint_name = kdl_chain_.segments[i].getJoint().getName(); mimic_joint.offset = jm->getMimicOffset(); mimic_joint.multiplier = jm->getMimicFactor(); mimic_joints.push_back(mimic_joint); continue; } } } for (std::size_t i = 0; i < mimic_joints.size(); ++i) { if(!mimic_joints[i].active) { const robot_model::JointModel* joint_model = joint_model_group->getJointModel(mimic_joints[i].joint_name)->getMimic(); for(std::size_t j=0; j < mimic_joints.size(); ++j) { if(mimic_joints[j].joint_name == joint_model->getName()) { mimic_joints[i].map_index = mimic_joints[j].map_index; } } } } mimic_joints_ = mimic_joints; // Setup the joint state groups that we need state_.reset(new robot_state::RobotState(robot_model_)); state_2_.reset(new robot_state::RobotState(robot_model_)); // Store things for when the set of redundant joints may change position_ik_ = position_ik; joint_model_group_ = joint_model_group; max_solver_iterations_ = max_solver_iterations; epsilon_ = epsilon; private_handle.param<std::string>("arm_prefix", arm_prefix_, ""); ur_joint_names_.push_back(arm_prefix_ + "shoulder_pan_joint"); ur_joint_names_.push_back(arm_prefix_ + "shoulder_lift_joint"); ur_joint_names_.push_back(arm_prefix_ + "elbow_joint"); ur_joint_names_.push_back(arm_prefix_ + "wrist_1_joint"); ur_joint_names_.push_back(arm_prefix_ + "wrist_2_joint"); ur_joint_names_.push_back(arm_prefix_ + "wrist_3_joint"); ur_link_names_.push_back(arm_prefix_ + "base_link"); // 0 ur_link_names_.push_back(arm_prefix_ + "ur_base_link"); // 1 ur_link_names_.push_back(arm_prefix_ + "shoulder_link"); // 2 ur_link_names_.push_back(arm_prefix_ + "upper_arm_link"); // 3 ur_link_names_.push_back(arm_prefix_ + "forearm_link"); // 4 ur_link_names_.push_back(arm_prefix_ + "wrist_1_link"); // 5 ur_link_names_.push_back(arm_prefix_ + "wrist_2_link"); // 6 ur_link_names_.push_back(arm_prefix_ + "wrist_3_link"); // 7 ur_link_names_.push_back(arm_prefix_ + "ee_link"); // 8 ur_joint_inds_start_ = getJointIndex(ur_joint_names_[0]); // check to make sure the serial chain is properly defined in the model int cur_ur_joint_ind, last_ur_joint_ind = ur_joint_inds_start_; for(int i=1; i<6; i++) { cur_ur_joint_ind = getJointIndex(ur_joint_names_[i]); if(cur_ur_joint_ind < 0) { ROS_ERROR_NAMED("kdl", "Kin chain provided in model doesn't contain standard UR joint '%s'.", ur_joint_names_[i].c_str()); return false; } if(cur_ur_joint_ind != last_ur_joint_ind + 1) { ROS_ERROR_NAMED("kdl", "Kin chain provided in model doesn't have proper serial joint order: '%s'.", ur_joint_names_[i].c_str()); return false; } last_ur_joint_ind = cur_ur_joint_ind; } // if successful, the kinematic chain includes a serial chain of the UR joints kdl_tree.getChain(getBaseFrame(), ur_link_names_.front(), kdl_base_chain_); kdl_tree.getChain(ur_link_names_.back(), getTipFrame(), kdl_tip_chain_); // weights for redundant solution selection ik_weights_.resize(6); if(private_handle.hasParam("ik_weights")) { private_handle.getParam("ik_weights", ik_weights_); } else { ik_weights_[0] = 1.0; ik_weights_[1] = 1.0; ik_weights_[2] = 0.1; ik_weights_[3] = 0.1; ik_weights_[4] = 0.3; ik_weights_[5] = 0.3; } active_ = true; ROS_DEBUG_NAMED("kdl","KDL solver initialized"); return true; } bool URKinematicsPlugin::setRedundantJoints(const std::vector<unsigned int> &redundant_joints) { if(num_possible_redundant_joints_ < 0) { ROS_ERROR_NAMED("kdl","This group cannot have redundant joints"); return false; } if(redundant_joints.size() > num_possible_redundant_joints_) { ROS_ERROR_NAMED("kdl","This group can only have %d redundant joints", num_possible_redundant_joints_); return false; } std::vector<unsigned int> redundant_joints_map_index; unsigned int counter = 0; for(std::size_t i=0; i < dimension_; ++i) { bool is_redundant_joint = false; for(std::size_t j=0; j < redundant_joints.size(); ++j) { if(i == redundant_joints[j]) { is_redundant_joint = true; counter++; break; } } if(!is_redundant_joint) { // check for mimic if(mimic_joints_[i].active) { redundant_joints_map_index.push_back(counter); counter++; } } } for(std::size_t i=0; i < redundant_joints_map_index.size(); ++i) ROS_DEBUG_NAMED("kdl","Redundant joint map index: %d %d", (int) i, (int) redundant_joints_map_index[i]); redundant_joints_map_index_ = redundant_joints_map_index; redundant_joint_indices_ = redundant_joints; return true; } int URKinematicsPlugin::getJointIndex(const std::string &name) const { for (unsigned int i=0; i < ik_chain_info_.joint_names.size(); i++) { if (ik_chain_info_.joint_names[i] == name) return i; } return -1; } int URKinematicsPlugin::getKDLSegmentIndex(const std::string &name) const { int i=0; while (i < (int)kdl_chain_.getNrOfSegments()) { if (kdl_chain_.getSegment(i).getName() == name) { return i+1; } i++; } return -1; } bool URKinematicsPlugin::timedOut(const ros::WallTime &start_time, double duration) const { return ((ros::WallTime::now()-start_time).toSec() >= duration); } bool URKinematicsPlugin::getPositionIK(const geometry_msgs::Pose &ik_pose, const std::vector<double> &ik_seed_state, std::vector<double> &solution, moveit_msgs::MoveItErrorCodes &error_code, const kinematics::KinematicsQueryOptions &options) const { const IKCallbackFn solution_callback = 0; std::vector<double> consistency_limits; return searchPositionIK(ik_pose, ik_seed_state, default_timeout_, solution, solution_callback, error_code, consistency_limits, options); } bool URKinematicsPlugin::searchPositionIK(const geometry_msgs::Pose &ik_pose, const std::vector<double> &ik_seed_state, double timeout, std::vector<double> &solution, moveit_msgs::MoveItErrorCodes &error_code, const kinematics::KinematicsQueryOptions &options) const { const IKCallbackFn solution_callback = 0; std::vector<double> consistency_limits; return searchPositionIK(ik_pose, ik_seed_state, timeout, solution, solution_callback, error_code, consistency_limits, options); } bool URKinematicsPlugin::searchPositionIK(const geometry_msgs::Pose &ik_pose, const std::vector<double> &ik_seed_state, double timeout, const std::vector<double> &consistency_limits, std::vector<double> &solution, moveit_msgs::MoveItErrorCodes &error_code, const kinematics::KinematicsQueryOptions &options) const { const IKCallbackFn solution_callback = 0; return searchPositionIK(ik_pose, ik_seed_state, timeout, solution, solution_callback, error_code, consistency_limits, options); } bool URKinematicsPlugin::searchPositionIK(const geometry_msgs::Pose &ik_pose, const std::vector<double> &ik_seed_state, double timeout, std::vector<double> &solution, const IKCallbackFn &solution_callback, moveit_msgs::MoveItErrorCodes &error_code, const kinematics::KinematicsQueryOptions &options) const { std::vector<double> consistency_limits; return searchPositionIK(ik_pose, ik_seed_state, timeout, solution, solution_callback, error_code, consistency_limits, options); } bool URKinematicsPlugin::searchPositionIK(const geometry_msgs::Pose &ik_pose, const std::vector<double> &ik_seed_state, double timeout, const std::vector<double> &consistency_limits, std::vector<double> &solution, const IKCallbackFn &solution_callback, moveit_msgs::MoveItErrorCodes &error_code, const kinematics::KinematicsQueryOptions &options) const { return searchPositionIK(ik_pose, ik_seed_state, timeout, solution, solution_callback, error_code, consistency_limits, options); } typedef std::pair<int, double> idx_double; bool comparator(const idx_double& l, const idx_double& r) { return l.second < r.second; } bool URKinematicsPlugin::searchPositionIK(const geometry_msgs::Pose &ik_pose, const std::vector<double> &ik_seed_state, double timeout, std::vector<double> &solution, const IKCallbackFn &solution_callback, moveit_msgs::MoveItErrorCodes &error_code, const std::vector<double> &consistency_limits, const kinematics::KinematicsQueryOptions &options) const { ros::WallTime n1 = ros::WallTime::now(); if(!active_) { ROS_ERROR_NAMED("kdl","kinematics not active"); error_code.val = error_code.NO_IK_SOLUTION; return false; } if(ik_seed_state.size() != dimension_) { ROS_ERROR_STREAM_NAMED("kdl","Seed state must have size " << dimension_ << " instead of size " << ik_seed_state.size()); error_code.val = error_code.NO_IK_SOLUTION; return false; } if(!consistency_limits.empty() && consistency_limits.size() != dimension_) { ROS_ERROR_STREAM_NAMED("kdl","Consistency limits be empty or must have size " << dimension_ << " instead of size " << consistency_limits.size()); error_code.val = error_code.NO_IK_SOLUTION; return false; } KDL::JntArray jnt_seed_state(dimension_); for(int i=0; i<dimension_; i++) jnt_seed_state(i) = ik_seed_state[i]; solution.resize(dimension_); KDL::ChainFkSolverPos_recursive fk_solver_base(kdl_base_chain_); KDL::ChainFkSolverPos_recursive fk_solver_tip(kdl_tip_chain_); KDL::JntArray jnt_pos_test(jnt_seed_state); KDL::JntArray jnt_pos_base(ur_joint_inds_start_); KDL::JntArray jnt_pos_tip(dimension_ - 6 - ur_joint_inds_start_); KDL::Frame pose_base, pose_tip; KDL::Frame kdl_ik_pose; KDL::Frame kdl_ik_pose_ur_chain; double homo_ik_pose[4][4]; double q_ik_sols[8][6]; // maximum of 8 IK solutions uint16_t num_sols; while(1) { if(timedOut(n1, timeout)) { ROS_DEBUG_NAMED("kdl","IK timed out"); error_code.val = error_code.TIMED_OUT; return false; } ///////////////////////////////////////////////////////////////////////////// // find transformation from robot base to UR base and UR tip to robot tip for(uint32_t i=0; i<jnt_pos_base.rows(); i++) jnt_pos_base(i) = jnt_pos_test(i); for(uint32_t i=0; i<jnt_pos_tip.rows(); i++) jnt_pos_tip(i) = jnt_pos_test(i + ur_joint_inds_start_ + 6); for(uint32_t i=0; i<jnt_seed_state.rows(); i++) solution[i] = jnt_pos_test(i); if(fk_solver_base.JntToCart(jnt_pos_base, pose_base) < 0) { ROS_ERROR_NAMED("kdl", "Could not compute FK for base chain"); return false; } if(fk_solver_tip.JntToCart(jnt_pos_tip, pose_tip) < 0) { ROS_ERROR_NAMED("kdl", "Could not compute FK for tip chain"); return false; } ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// // Convert into query for analytic solver tf::poseMsgToKDL(ik_pose, kdl_ik_pose); kdl_ik_pose_ur_chain = pose_base.Inverse() * kdl_ik_pose * pose_tip.Inverse(); kdl_ik_pose_ur_chain.Make4x4((double*) homo_ik_pose); #if KDL_OLD_BUG_FIX // in older versions of KDL, setting this flag might be necessary for(int i=0; i<3; i++) homo_ik_pose[i][3] *= 1000; // strange KDL fix #endif ///////////////////////////////////////////////////////////////////////////// // Do the analytic IK num_sols = inverse((double*) homo_ik_pose, (double*) q_ik_sols, jnt_pos_test(ur_joint_inds_start_+5)); uint16_t num_valid_sols; std::vector< std::vector<double> > q_ik_valid_sols; for(uint16_t i=0; i<num_sols; i++) { bool valid = true; std::vector< double > valid_solution; valid_solution.assign(6,0.0); for(uint16_t j=0; j<6; j++) { if((q_ik_sols[i][j] <= ik_chain_info_.limits[j].max_position) && (q_ik_sols[i][j] >= ik_chain_info_.limits[j].min_position)) { valid_solution[j] = q_ik_sols[i][j]; valid = true; continue; } else if ((q_ik_sols[i][j] > ik_chain_info_.limits[j].max_position) && (q_ik_sols[i][j]-2*M_PI > ik_chain_info_.limits[j].min_position)) { valid_solution[j] = q_ik_sols[i][j]-2*M_PI; valid = true; continue; } else if ((q_ik_sols[i][j] < ik_chain_info_.limits[j].min_position) && (q_ik_sols[i][j]+2*M_PI < ik_chain_info_.limits[j].max_position)) { valid_solution[j] = q_ik_sols[i][j]+2*M_PI; valid = true; continue; } else { valid = false; break; } } if(valid) { q_ik_valid_sols.push_back(valid_solution); } } // use weighted absolute deviations to determine the solution closest the seed state std::vector<idx_double> weighted_diffs; for(uint16_t i=0; i<q_ik_valid_sols.size(); i++) { double cur_weighted_diff = 0; for(uint16_t j=0; j<6; j++) { // solution violates the consistency_limits, throw it out double abs_diff = std::fabs(ik_seed_state[ur_joint_inds_start_+j] - q_ik_valid_sols[i][j]); if(!consistency_limits.empty() && abs_diff > consistency_limits[ur_joint_inds_start_+j]) { cur_weighted_diff = std::numeric_limits<double>::infinity(); break; } cur_weighted_diff += ik_weights_[j] * abs_diff; } weighted_diffs.push_back(idx_double(i, cur_weighted_diff)); } std::sort(weighted_diffs.begin(), weighted_diffs.end(), comparator); #if 0 printf("start\n"); printf(" q %1.2f, %1.2f, %1.2f, %1.2f, %1.2f, %1.2f\n", ik_seed_state[1], ik_seed_state[2], ik_seed_state[3], ik_seed_state[4], ik_seed_state[5], ik_seed_state[6]); for(uint16_t i=0; i<weighted_diffs.size(); i++) { int cur_idx = weighted_diffs[i].first; printf("diff %f, i %d, q %1.2f, %1.2f, %1.2f, %1.2f, %1.2f, %1.2f\n", weighted_diffs[i].second, cur_idx, q_ik_valid_sols[cur_idx][0], q_ik_valid_sols[cur_idx][1], q_ik_valid_sols[cur_idx][2], q_ik_valid_sols[cur_idx][3], q_ik_valid_sols[cur_idx][4], q_ik_valid_sols[cur_idx][5]); } printf("end\n"); #endif for(uint16_t i=0; i<weighted_diffs.size(); i++) { if(weighted_diffs[i].second == std::numeric_limits<double>::infinity()) { // rest are infinity, no more feasible solutions break; } // copy the best solution to the output int cur_idx = weighted_diffs[i].first; solution = q_ik_valid_sols[cur_idx]; // see if this solution passes the callback function test if(!solution_callback.empty()) solution_callback(ik_pose, solution, error_code); else error_code.val = error_code.SUCCESS; if(error_code.val == error_code.SUCCESS) { #if 0 std::vector<std::string> fk_link_names; fk_link_names.push_back(ur_link_names_.back()); std::vector<geometry_msgs::Pose> fk_poses; getPositionFK(fk_link_names, solution, fk_poses); KDL::Frame kdl_fk_pose; tf::poseMsgToKDL(fk_poses[0], kdl_fk_pose); printf("FK(solution) - pose \n"); for(int i=0; i<4; i++) { for(int j=0; j<4; j++) printf("%1.6f ", kdl_fk_pose(i, j)-kdl_ik_pose(i, j)); printf("\n"); } #endif return true; } } // none of the solutions were both consistent and passed the solution callback if(options.lock_redundant_joints) { ROS_DEBUG_NAMED("kdl","Will not pertubate redundant joints to find solution"); break; } if(dimension_ == 6) { ROS_DEBUG_NAMED("kdl","No other joints to pertubate, cannot find solution"); break; } // randomly pertubate other joints and try again if(!consistency_limits.empty()) { getRandomConfiguration(jnt_seed_state, consistency_limits, jnt_pos_test, false); } else { getRandomConfiguration(jnt_pos_test, false); } } ROS_DEBUG_NAMED("kdl","An IK that satisifes the constraints and is collision free could not be found"); error_code.val = error_code.NO_IK_SOLUTION; return false; } bool URKinematicsPlugin::getPositionFK(const std::vector<std::string> &link_names, const std::vector<double> &joint_angles, std::vector<geometry_msgs::Pose> &poses) const { ros::WallTime n1 = ros::WallTime::now(); if(!active_) { ROS_ERROR_NAMED("kdl","kinematics not active"); return false; } poses.resize(link_names.size()); if(joint_angles.size() != dimension_) { ROS_ERROR_NAMED("kdl","Joint angles vector must have size: %d",dimension_); return false; } KDL::Frame p_out; geometry_msgs::PoseStamped pose; tf::Stamped<tf::Pose> tf_pose; KDL::JntArray jnt_pos_in(dimension_); for(unsigned int i=0; i < dimension_; i++) { jnt_pos_in(i) = joint_angles[i]; } KDL::ChainFkSolverPos_recursive fk_solver(kdl_chain_); bool valid = true; for(unsigned int i=0; i < poses.size(); i++) { ROS_DEBUG_NAMED("kdl","End effector index: %d",getKDLSegmentIndex(link_names[i])); if(fk_solver.JntToCart(jnt_pos_in,p_out,getKDLSegmentIndex(link_names[i])) >=0) { tf::poseKDLToMsg(p_out,poses[i]); } else { ROS_ERROR_NAMED("kdl","Could not compute FK for %s",link_names[i].c_str()); valid = false; } } return valid; } const std::vector<std::string>& URKinematicsPlugin::getJointNames() const { return ik_chain_info_.joint_names; } const std::vector<std::string>& URKinematicsPlugin::getLinkNames() const { return ik_chain_info_.link_names; } } // namespace
[ "noreply@github.com" ]
noreply@github.com
4794f7e875838095e158d2816fb20cb9999e1461
60ed3c031a1ec7843b149c197e0b6681f01a3456
/archive/010_Alternate-Sum.cpp
158ad670a90d415791258251a3aed403dca03407
[]
no_license
chengzeyi/whu-acm-oj
e5b04f9c4d59fc03dcc289142acebddd680e4461
b97ddd82edc90413ec128bad61f4812f0ae6ea07
refs/heads/master
2020-08-15T00:32:59.288617
2019-12-01T09:52:29
2019-12-01T09:52:29
215,254,398
3
0
null
null
null
null
UTF-8
C++
false
false
892
cpp
#include <bits/stdc++.h> #define BOUND 2006 long long calcTotalValue(const std::vector<int> &q) { size_t n = q.size(); if (n == 0) { return 0; } long long total = *std::max_element(q.begin(), q.end()); for (size_t i = 0; i < n - 1; ++i) { total *= 2; if (total < 0) { total += BOUND; } total %= BOUND; } return (total >= 0) ? (total) : (total + BOUND); } #ifdef DEBUG #define cin _ss namespace std { stringstream _ss; } #endif int main(int argc, char *argv[]) { #ifdef DEBUG std::cin << R"(1 -1 2 0 4 3 1 3 2 0)"; #endif size_t n; while(std::cin >> n) { if (n == 0) { break; } std::vector<int> q(n); for (size_t i = 0; i < n; ++i) { std::cin >> q[i]; } std::cout << calcTotalValue(q) << std::endl; } return 0; }
[ "ichengzeyi@gmail.com" ]
ichengzeyi@gmail.com
a157d0410f4719368847e2d47c5088e4a58f9f16
3a49ecb20d178f25e5b796df394ac851f4b4780d
/main.cpp
a60e557977fbe440d359e7e2586805f6846b4068
[]
no_license
merabetam/MERABET
0fa55d022bdc857454c1b3d84a9e56a408c21a7e
384d4a025420115d22d91e4f2e46695cc82ca7e5
refs/heads/master
2021-01-24T18:38:20.668197
2017-04-20T15:25:34
2017-04-20T15:25:34
84,456,869
0
0
null
null
null
null
UTF-8
C++
false
false
996
cpp
#include "jpg.h" #include "mnist.h" #include <limits.h> float dist(float* v1, float* v2){ int i; float d=0; for (int i=0; i<784; i++){ d+= (v1[i]-v2[i])*(v1[i]-v2[i]); } return d; } float linear_classifier(float* w, float* x){ float d=0; for (int i=0; i<784; i++){ d+= w[i]*x[i]; }if (d>=0) {return 1; }return 0; } int main(){ float** images = read_mnist("train-images.idx3-ubyte"); float* labels = read_labels("train-labels.idx1-ubyte"); float** test_images = read_mnist("t10k-images.idx3-ubyte"); float* test_labels = read_labels("t10k-labels.idx1-ubyte"); float* w = new float[784]; for (int i=0; i<784; i++) { w[i]=(float) rand()*2/INT_MAX-1; }float E=0; for(int i=0; i<10000; i++) { printf("%u\n", i); int NN; }int inference = linear_classifier (w, test_images[i]); //save_jpg(test_images[i], 28, 28, "%u/%u.jpg", inference, i); if (inference != test_labels[i]){ E++; } printf ("erreur= %0.2f%%\n", (E*100)/i); } return 0; }
[ "noreply@github.com" ]
noreply@github.com
1f27ca0606c5b7abc649d6131b5b608b28051aa8
113e9efe00252564f64f5a5c2b0d826d63335627
/codes/LowestCommonAncestor.cpp
8240fc3c0b819cf69a0a011dbbbea320592ad16c
[]
no_license
adzo261/competitive-programming
5e2af033f5e957158d455acb513ba9f44a169b9c
c8baa4dc493fc7690e592132e979687f4948ce15
refs/heads/master
2020-12-04T11:14:15.750927
2020-10-11T08:18:17
2020-10-11T08:18:17
231,742,005
6
0
null
null
null
null
UTF-8
C++
false
false
2,906
cpp
#include <bits/stdc++.h> using namespace std; vector<long long> euler; long long tree[8*200010]; long long height[200010]; long long first[200010]; bool visited[200010]; vector<long long> g[200010]; long long n; void dfs(long long source,long long h) { visited[source]=true; first[source]=euler.size(); euler.push_back(source); height[source]=h; for(auto dest:g[source]) { if(!visited[dest]) { dfs(dest,h+1); euler.push_back(source); } } } void build(long long node,long long start,long long end) { if(start==end) { tree[node]=euler[start]; return; } long long mid=(start+end)/2; build(2*node,start,mid); build(2*node+1,mid+1,end); if(height[tree[2*node]]<height[tree[2*node+1]]) tree[node]=tree[2*node]; else tree[node]=tree[2*node+1]; } long long minimum(long long node,long long start,long long end,long long l,long long r) { if(start>end || start>r || end<l) return 10000000000; if(l<=start && end<=r) return tree[node]; long long mid=(start+end)>>1; long long a=minimum(2*node,start,mid,l,r); long long b=minimum(2*node+1,mid+1,end,l,r); if(a==10000000000) return b; else if(b==10000000000) return a; else if(height[a]<height[b]) return a; else return b; } long long lcs(long long a,long long b) { a=first[a],b=first[b]; if(a>b) swap(a,b); return minimum(1,0,euler.size()-1,a,b); } int main() { cin>>n; for(int i=0;i<n-1;i++) { long long ta,tb; cin>>ta>>tb; ta--,tb--; g[ta].push_back(tb); g[tb].push_back(ta); } memset(first,0,sizeof(first)); memset(height,0,sizeof(height)); memset(visited,0,sizeof(visited)); memset(tree,0,sizeof(tree)); euler.clear(); dfs(0,1); build(1,0,euler.size()-1); long long q; cin>>q; while(q--) { long long r,u,v; cin>>r>>u>>v; r--,u--,v--; /*Let w be the lca of u and v in 1 rooted tree if w is in the subtree of root r, then w is answer i.e case when two of lca(u,r)=r,lca(v,r)=r,lca(u,v)=w are equal and one is different w.r.t root 1 if r is in the subtree of w and u and v are also in the subtree of w but not in subtree of r,then w is answer i.e case when all of the three,lca(u,r)=w,lca(v,r)=w,lca(u,v)=w are equal w.r.t root 1 if r is in the subtree of u/v,then r is the answer i.e case when two of lca(u,r)=u/v,lca(v,r)=r,lca(u,v)=u/v are equal and one is different w.r.t root 1 Summary: find lca(u,v),lca(u,r),lca(v,r) and the odd man out is answer. If no odd man out exists, the common answer is itself the answer.*/ long long a,b,c; a=lcs(u,v),b=lcs(u,r),c=lcs(v,r); if(a==b && b==c) cout<<(a+1)<<endl; else if(a==b) cout<<(c+1)<<endl; else if(b==c) cout<<(a+1)<<endl; else cout<<(b+1)<<endl; } return 0; }
[ "adityazope261@gmail.com" ]
adityazope261@gmail.com
de90052aa8b2ed1e205a9d8514f018ffca13d7d7
c842c4895de8115303f4435f9c59af9133e2ceda
/obj_dir/VsimTop__Trace__Slow.cpp
4b426a44db07a85223152090caababf0a058874b
[]
no_license
Ziyue-Zhang/riscv-cpu
66bf02565ab9b882ccd37c41a5a9655017b8eb9e
540b3a19ff94d89c2b9802f1978ebd7c16828073
refs/heads/main
2023-01-13T16:14:31.876344
2020-11-22T16:49:25
2020-11-22T16:49:25
301,183,351
0
0
null
null
null
null
UTF-8
C++
false
false
149,902
cpp
// Verilated -*- C++ -*- // DESCRIPTION: Verilator output: Tracing implementation internals #include "verilated_vcd_c.h" #include "VsimTop__Syms.h" //====================== void VsimTop::trace(VerilatedVcdC* tfp, int, int) { tfp->spTrace()->addInitCb(&traceInit, __VlSymsp); traceRegister(tfp->spTrace()); } void VsimTop::traceInit(void* userp, VerilatedVcd* tracep, uint32_t code) { // Callback from tracep->open() VsimTop__Syms* __restrict vlSymsp = static_cast<VsimTop__Syms*>(userp); if (!Verilated::calcUnusedSigs()) { VL_FATAL_MT(__FILE__, __LINE__, __FILE__, "Turning on wave traces requires Verilated::traceEverOn(true) call before time 0."); } vlSymsp->__Vm_baseCode = code; tracep->module(vlSymsp->name()); tracep->scopeEscape(' '); VsimTop::traceInitTop(vlSymsp, tracep); tracep->scopeEscape('.'); } //====================== void VsimTop::traceInitTop(void* userp, VerilatedVcd* tracep) { VsimTop__Syms* __restrict vlSymsp = static_cast<VsimTop__Syms*>(userp); VsimTop* const __restrict vlTOPp VL_ATTR_UNUSED = vlSymsp->TOPp; // Body { vlTOPp->traceInitSub0(userp, tracep); } } void VsimTop::traceInitSub0(void* userp, VerilatedVcd* tracep) { VsimTop__Syms* __restrict vlSymsp = static_cast<VsimTop__Syms*>(userp); VsimTop* const __restrict vlTOPp VL_ATTR_UNUSED = vlSymsp->TOPp; const int c = vlSymsp->__Vm_baseCode; if (false && tracep && c) {} // Prevent unused // Body { tracep->declBit(c+514,"clock", false,-1); tracep->declBit(c+515,"reset", false,-1); tracep->declQuad(c+516,"io_diffTestIO_regfile_0", false,-1, 63,0); tracep->declQuad(c+518,"io_diffTestIO_regfile_1", false,-1, 63,0); tracep->declQuad(c+520,"io_diffTestIO_regfile_2", false,-1, 63,0); tracep->declQuad(c+522,"io_diffTestIO_regfile_3", false,-1, 63,0); tracep->declQuad(c+524,"io_diffTestIO_regfile_4", false,-1, 63,0); tracep->declQuad(c+526,"io_diffTestIO_regfile_5", false,-1, 63,0); tracep->declQuad(c+528,"io_diffTestIO_regfile_6", false,-1, 63,0); tracep->declQuad(c+530,"io_diffTestIO_regfile_7", false,-1, 63,0); tracep->declQuad(c+532,"io_diffTestIO_regfile_8", false,-1, 63,0); tracep->declQuad(c+534,"io_diffTestIO_regfile_9", false,-1, 63,0); tracep->declQuad(c+536,"io_diffTestIO_regfile_10", false,-1, 63,0); tracep->declQuad(c+538,"io_diffTestIO_regfile_11", false,-1, 63,0); tracep->declQuad(c+540,"io_diffTestIO_regfile_12", false,-1, 63,0); tracep->declQuad(c+542,"io_diffTestIO_regfile_13", false,-1, 63,0); tracep->declQuad(c+544,"io_diffTestIO_regfile_14", false,-1, 63,0); tracep->declQuad(c+546,"io_diffTestIO_regfile_15", false,-1, 63,0); tracep->declQuad(c+548,"io_diffTestIO_regfile_16", false,-1, 63,0); tracep->declQuad(c+550,"io_diffTestIO_regfile_17", false,-1, 63,0); tracep->declQuad(c+552,"io_diffTestIO_regfile_18", false,-1, 63,0); tracep->declQuad(c+554,"io_diffTestIO_regfile_19", false,-1, 63,0); tracep->declQuad(c+556,"io_diffTestIO_regfile_20", false,-1, 63,0); tracep->declQuad(c+558,"io_diffTestIO_regfile_21", false,-1, 63,0); tracep->declQuad(c+560,"io_diffTestIO_regfile_22", false,-1, 63,0); tracep->declQuad(c+562,"io_diffTestIO_regfile_23", false,-1, 63,0); tracep->declQuad(c+564,"io_diffTestIO_regfile_24", false,-1, 63,0); tracep->declQuad(c+566,"io_diffTestIO_regfile_25", false,-1, 63,0); tracep->declQuad(c+568,"io_diffTestIO_regfile_26", false,-1, 63,0); tracep->declQuad(c+570,"io_diffTestIO_regfile_27", false,-1, 63,0); tracep->declQuad(c+572,"io_diffTestIO_regfile_28", false,-1, 63,0); tracep->declQuad(c+574,"io_diffTestIO_regfile_29", false,-1, 63,0); tracep->declQuad(c+576,"io_diffTestIO_regfile_30", false,-1, 63,0); tracep->declQuad(c+578,"io_diffTestIO_regfile_31", false,-1, 63,0); tracep->declQuad(c+580,"io_diffTestIO_pc", false,-1, 63,0); tracep->declBit(c+582,"io_diffTestIO_valid", false,-1); tracep->declQuad(c+583,"io_coreIO_inst_readIO_addr", false,-1, 63,0); tracep->declQuad(c+585,"io_coreIO_inst_readIO_data", false,-1, 63,0); tracep->declBit(c+587,"io_coreIO_inst_readIO_en", false,-1); tracep->declQuad(c+588,"io_coreIO_data_readIO_addr", false,-1, 63,0); tracep->declQuad(c+590,"io_coreIO_data_readIO_data", false,-1, 63,0); tracep->declBit(c+592,"io_coreIO_data_readIO_en", false,-1); tracep->declQuad(c+593,"io_coreIO_data_writeIO_addr", false,-1, 63,0); tracep->declQuad(c+595,"io_coreIO_data_writeIO_data", false,-1, 63,0); tracep->declBit(c+597,"io_coreIO_data_writeIO_en", false,-1); tracep->declBus(c+598,"io_coreIO_data_writeIO_mask", false,-1, 7,0); tracep->declBit(c+514,"simTop clock", false,-1); tracep->declBit(c+515,"simTop reset", false,-1); tracep->declQuad(c+516,"simTop io_diffTestIO_regfile_0", false,-1, 63,0); tracep->declQuad(c+518,"simTop io_diffTestIO_regfile_1", false,-1, 63,0); tracep->declQuad(c+520,"simTop io_diffTestIO_regfile_2", false,-1, 63,0); tracep->declQuad(c+522,"simTop io_diffTestIO_regfile_3", false,-1, 63,0); tracep->declQuad(c+524,"simTop io_diffTestIO_regfile_4", false,-1, 63,0); tracep->declQuad(c+526,"simTop io_diffTestIO_regfile_5", false,-1, 63,0); tracep->declQuad(c+528,"simTop io_diffTestIO_regfile_6", false,-1, 63,0); tracep->declQuad(c+530,"simTop io_diffTestIO_regfile_7", false,-1, 63,0); tracep->declQuad(c+532,"simTop io_diffTestIO_regfile_8", false,-1, 63,0); tracep->declQuad(c+534,"simTop io_diffTestIO_regfile_9", false,-1, 63,0); tracep->declQuad(c+536,"simTop io_diffTestIO_regfile_10", false,-1, 63,0); tracep->declQuad(c+538,"simTop io_diffTestIO_regfile_11", false,-1, 63,0); tracep->declQuad(c+540,"simTop io_diffTestIO_regfile_12", false,-1, 63,0); tracep->declQuad(c+542,"simTop io_diffTestIO_regfile_13", false,-1, 63,0); tracep->declQuad(c+544,"simTop io_diffTestIO_regfile_14", false,-1, 63,0); tracep->declQuad(c+546,"simTop io_diffTestIO_regfile_15", false,-1, 63,0); tracep->declQuad(c+548,"simTop io_diffTestIO_regfile_16", false,-1, 63,0); tracep->declQuad(c+550,"simTop io_diffTestIO_regfile_17", false,-1, 63,0); tracep->declQuad(c+552,"simTop io_diffTestIO_regfile_18", false,-1, 63,0); tracep->declQuad(c+554,"simTop io_diffTestIO_regfile_19", false,-1, 63,0); tracep->declQuad(c+556,"simTop io_diffTestIO_regfile_20", false,-1, 63,0); tracep->declQuad(c+558,"simTop io_diffTestIO_regfile_21", false,-1, 63,0); tracep->declQuad(c+560,"simTop io_diffTestIO_regfile_22", false,-1, 63,0); tracep->declQuad(c+562,"simTop io_diffTestIO_regfile_23", false,-1, 63,0); tracep->declQuad(c+564,"simTop io_diffTestIO_regfile_24", false,-1, 63,0); tracep->declQuad(c+566,"simTop io_diffTestIO_regfile_25", false,-1, 63,0); tracep->declQuad(c+568,"simTop io_diffTestIO_regfile_26", false,-1, 63,0); tracep->declQuad(c+570,"simTop io_diffTestIO_regfile_27", false,-1, 63,0); tracep->declQuad(c+572,"simTop io_diffTestIO_regfile_28", false,-1, 63,0); tracep->declQuad(c+574,"simTop io_diffTestIO_regfile_29", false,-1, 63,0); tracep->declQuad(c+576,"simTop io_diffTestIO_regfile_30", false,-1, 63,0); tracep->declQuad(c+578,"simTop io_diffTestIO_regfile_31", false,-1, 63,0); tracep->declQuad(c+580,"simTop io_diffTestIO_pc", false,-1, 63,0); tracep->declBit(c+582,"simTop io_diffTestIO_valid", false,-1); tracep->declQuad(c+583,"simTop io_coreIO_inst_readIO_addr", false,-1, 63,0); tracep->declQuad(c+585,"simTop io_coreIO_inst_readIO_data", false,-1, 63,0); tracep->declBit(c+587,"simTop io_coreIO_inst_readIO_en", false,-1); tracep->declQuad(c+588,"simTop io_coreIO_data_readIO_addr", false,-1, 63,0); tracep->declQuad(c+590,"simTop io_coreIO_data_readIO_data", false,-1, 63,0); tracep->declBit(c+592,"simTop io_coreIO_data_readIO_en", false,-1); tracep->declQuad(c+593,"simTop io_coreIO_data_writeIO_addr", false,-1, 63,0); tracep->declQuad(c+595,"simTop io_coreIO_data_writeIO_data", false,-1, 63,0); tracep->declBit(c+597,"simTop io_coreIO_data_writeIO_en", false,-1); tracep->declBus(c+598,"simTop io_coreIO_data_writeIO_mask", false,-1, 7,0); tracep->declBit(c+514,"simTop mycore_clock", false,-1); tracep->declBit(c+515,"simTop mycore_reset", false,-1); tracep->declQuad(c+1,"simTop mycore_io_inst_readIO_addr", false,-1, 63,0); tracep->declQuad(c+585,"simTop mycore_io_inst_readIO_data", false,-1, 63,0); tracep->declQuad(c+3,"simTop mycore_io_data_readIO_addr", false,-1, 63,0); tracep->declQuad(c+590,"simTop mycore_io_data_readIO_data", false,-1, 63,0); tracep->declBit(c+5,"simTop mycore_io_data_readIO_en", false,-1); tracep->declQuad(c+6,"simTop mycore_io_data_writeIO_addr", false,-1, 63,0); tracep->declQuad(c+8,"simTop mycore_io_data_writeIO_data", false,-1, 63,0); tracep->declBit(c+10,"simTop mycore_io_data_writeIO_en", false,-1); tracep->declBus(c+11,"simTop mycore_io_data_writeIO_mask", false,-1, 7,0); tracep->declBit(c+12,"simTop mycore_wb_reg_valid", false,-1); tracep->declQuad(c+13,"simTop mycore__T_42_0", false,-1, 63,0); tracep->declQuad(c+15,"simTop mycore__T_42_1", false,-1, 63,0); tracep->declQuad(c+17,"simTop mycore__T_42_2", false,-1, 63,0); tracep->declQuad(c+19,"simTop mycore__T_42_3", false,-1, 63,0); tracep->declQuad(c+21,"simTop mycore__T_42_4", false,-1, 63,0); tracep->declQuad(c+23,"simTop mycore__T_42_5", false,-1, 63,0); tracep->declQuad(c+25,"simTop mycore__T_42_6", false,-1, 63,0); tracep->declQuad(c+27,"simTop mycore__T_42_7", false,-1, 63,0); tracep->declQuad(c+29,"simTop mycore__T_42_8", false,-1, 63,0); tracep->declQuad(c+31,"simTop mycore__T_42_9", false,-1, 63,0); tracep->declQuad(c+33,"simTop mycore__T_42_10", false,-1, 63,0); tracep->declQuad(c+35,"simTop mycore__T_42_11", false,-1, 63,0); tracep->declQuad(c+37,"simTop mycore__T_42_12", false,-1, 63,0); tracep->declQuad(c+39,"simTop mycore__T_42_13", false,-1, 63,0); tracep->declQuad(c+41,"simTop mycore__T_42_14", false,-1, 63,0); tracep->declQuad(c+43,"simTop mycore__T_42_15", false,-1, 63,0); tracep->declQuad(c+45,"simTop mycore__T_42_16", false,-1, 63,0); tracep->declQuad(c+47,"simTop mycore__T_42_17", false,-1, 63,0); tracep->declQuad(c+49,"simTop mycore__T_42_18", false,-1, 63,0); tracep->declQuad(c+51,"simTop mycore__T_42_19", false,-1, 63,0); tracep->declQuad(c+53,"simTop mycore__T_42_20", false,-1, 63,0); tracep->declQuad(c+55,"simTop mycore__T_42_21", false,-1, 63,0); tracep->declQuad(c+57,"simTop mycore__T_42_22", false,-1, 63,0); tracep->declQuad(c+59,"simTop mycore__T_42_23", false,-1, 63,0); tracep->declQuad(c+61,"simTop mycore__T_42_24", false,-1, 63,0); tracep->declQuad(c+63,"simTop mycore__T_42_25", false,-1, 63,0); tracep->declQuad(c+65,"simTop mycore__T_42_26", false,-1, 63,0); tracep->declQuad(c+67,"simTop mycore__T_42_27", false,-1, 63,0); tracep->declQuad(c+69,"simTop mycore__T_42_28", false,-1, 63,0); tracep->declQuad(c+71,"simTop mycore__T_42_29", false,-1, 63,0); tracep->declQuad(c+73,"simTop mycore__T_42_30", false,-1, 63,0); tracep->declQuad(c+75,"simTop mycore__T_42_31", false,-1, 63,0); tracep->declQuad(c+77,"simTop mycore_wb_reg_pc", false,-1, 63,0); tracep->declBit(c+514,"simTop mycore clock", false,-1); tracep->declBit(c+515,"simTop mycore reset", false,-1); tracep->declQuad(c+1,"simTop mycore io_inst_readIO_addr", false,-1, 63,0); tracep->declQuad(c+585,"simTop mycore io_inst_readIO_data", false,-1, 63,0); tracep->declQuad(c+3,"simTop mycore io_data_readIO_addr", false,-1, 63,0); tracep->declQuad(c+590,"simTop mycore io_data_readIO_data", false,-1, 63,0); tracep->declBit(c+5,"simTop mycore io_data_readIO_en", false,-1); tracep->declQuad(c+6,"simTop mycore io_data_writeIO_addr", false,-1, 63,0); tracep->declQuad(c+8,"simTop mycore io_data_writeIO_data", false,-1, 63,0); tracep->declBit(c+10,"simTop mycore io_data_writeIO_en", false,-1); tracep->declBus(c+11,"simTop mycore io_data_writeIO_mask", false,-1, 7,0); tracep->declBit(c+12,"simTop mycore wb_reg_valid", false,-1); tracep->declQuad(c+77,"simTop mycore wb_reg_pc", false,-1, 63,0); tracep->declBit(c+514,"simTop mycore cpath_clock", false,-1); tracep->declBit(c+515,"simTop mycore cpath_reset", false,-1); tracep->declQuad(c+79,"simTop mycore cpath_io_dat_dec_inst", false,-1, 63,0); tracep->declBit(c+81,"simTop mycore cpath_io_dat_exe_br_eq", false,-1); tracep->declBit(c+82,"simTop mycore cpath_io_dat_exe_br_lt", false,-1); tracep->declBit(c+83,"simTop mycore cpath_io_dat_exe_br_ltu", false,-1); tracep->declBus(c+84,"simTop mycore cpath_io_dat_exe_br_type", false,-1, 3,0); tracep->declBit(c+85,"simTop mycore cpath_io_dat_csr_eret", false,-1); tracep->declBit(c+86,"simTop mycore cpath_io_ctl_dec_stall", false,-1); tracep->declBus(c+87,"simTop mycore cpath_io_ctl_exe_pc_sel", false,-1, 1,0); tracep->declBus(c+88,"simTop mycore cpath_io_ctl_br_type", false,-1, 3,0); tracep->declBit(c+89,"simTop mycore cpath_io_ctl_if_kill", false,-1); tracep->declBit(c+90,"simTop mycore cpath_io_ctl_dec_kill", false,-1); tracep->declBus(c+91,"simTop mycore cpath_io_ctl_op1_sel", false,-1, 1,0); tracep->declBus(c+92,"simTop mycore cpath_io_ctl_op2_sel", false,-1, 2,0); tracep->declBus(c+93,"simTop mycore cpath_io_ctl_alu_fun", false,-1, 4,0); tracep->declBus(c+94,"simTop mycore cpath_io_ctl_wb_sel", false,-1, 2,0); tracep->declBit(c+95,"simTop mycore cpath_io_ctl_rf_wen", false,-1); tracep->declBus(c+96,"simTop mycore cpath_io_ctl_mem_fcn", false,-1, 1,0); tracep->declBus(c+97,"simTop mycore cpath_io_ctl_mem_typ", false,-1, 7,0); tracep->declBus(c+98,"simTop mycore cpath_io_ctl_mem_wid", false,-1, 2,0); tracep->declBus(c+99,"simTop mycore cpath_io_ctl_csr_cmd", false,-1, 2,0); tracep->declBit(c+100,"simTop mycore cpath_io_ctl_fencei", false,-1); tracep->declBit(c+85,"simTop mycore cpath_io_ctl_pipeline_kill", false,-1); tracep->declBit(c+514,"simTop mycore dpath_clock", false,-1); tracep->declBit(c+515,"simTop mycore dpath_reset", false,-1); tracep->declBit(c+86,"simTop mycore dpath_io_ctl_dec_stall", false,-1); tracep->declBus(c+87,"simTop mycore dpath_io_ctl_exe_pc_sel", false,-1, 1,0); tracep->declBus(c+88,"simTop mycore dpath_io_ctl_br_type", false,-1, 3,0); tracep->declBit(c+89,"simTop mycore dpath_io_ctl_if_kill", false,-1); tracep->declBit(c+90,"simTop mycore dpath_io_ctl_dec_kill", false,-1); tracep->declBus(c+91,"simTop mycore dpath_io_ctl_op1_sel", false,-1, 1,0); tracep->declBus(c+92,"simTop mycore dpath_io_ctl_op2_sel", false,-1, 2,0); tracep->declBus(c+93,"simTop mycore dpath_io_ctl_alu_fun", false,-1, 4,0); tracep->declBus(c+94,"simTop mycore dpath_io_ctl_wb_sel", false,-1, 2,0); tracep->declBit(c+95,"simTop mycore dpath_io_ctl_rf_wen", false,-1); tracep->declBus(c+96,"simTop mycore dpath_io_ctl_mem_fcn", false,-1, 1,0); tracep->declBus(c+97,"simTop mycore dpath_io_ctl_mem_typ", false,-1, 7,0); tracep->declBus(c+98,"simTop mycore dpath_io_ctl_mem_wid", false,-1, 2,0); tracep->declBus(c+99,"simTop mycore dpath_io_ctl_csr_cmd", false,-1, 2,0); tracep->declBit(c+100,"simTop mycore dpath_io_ctl_fencei", false,-1); tracep->declBit(c+85,"simTop mycore dpath_io_ctl_pipeline_kill", false,-1); tracep->declQuad(c+79,"simTop mycore dpath_io_dat_dec_inst", false,-1, 63,0); tracep->declBit(c+81,"simTop mycore dpath_io_dat_exe_br_eq", false,-1); tracep->declBit(c+82,"simTop mycore dpath_io_dat_exe_br_lt", false,-1); tracep->declBit(c+83,"simTop mycore dpath_io_dat_exe_br_ltu", false,-1); tracep->declBus(c+84,"simTop mycore dpath_io_dat_exe_br_type", false,-1, 3,0); tracep->declBit(c+85,"simTop mycore dpath_io_dat_csr_eret", false,-1); tracep->declQuad(c+1,"simTop mycore dpath_io_inst_readIO_addr", false,-1, 63,0); tracep->declQuad(c+585,"simTop mycore dpath_io_inst_readIO_data", false,-1, 63,0); tracep->declQuad(c+3,"simTop mycore dpath_io_data_readIO_addr", false,-1, 63,0); tracep->declQuad(c+590,"simTop mycore dpath_io_data_readIO_data", false,-1, 63,0); tracep->declBit(c+5,"simTop mycore dpath_io_data_readIO_en", false,-1); tracep->declQuad(c+6,"simTop mycore dpath_io_data_writeIO_addr", false,-1, 63,0); tracep->declQuad(c+8,"simTop mycore dpath_io_data_writeIO_data", false,-1, 63,0); tracep->declBit(c+10,"simTop mycore dpath_io_data_writeIO_en", false,-1); tracep->declBus(c+11,"simTop mycore dpath_io_data_writeIO_mask", false,-1, 7,0); tracep->declBit(c+12,"simTop mycore dpath_wb_reg_valid_0", false,-1); tracep->declQuad(c+13,"simTop mycore dpath__T_42_0_0", false,-1, 63,0); tracep->declQuad(c+15,"simTop mycore dpath__T_42_0_1", false,-1, 63,0); tracep->declQuad(c+17,"simTop mycore dpath__T_42_0_2", false,-1, 63,0); tracep->declQuad(c+19,"simTop mycore dpath__T_42_0_3", false,-1, 63,0); tracep->declQuad(c+21,"simTop mycore dpath__T_42_0_4", false,-1, 63,0); tracep->declQuad(c+23,"simTop mycore dpath__T_42_0_5", false,-1, 63,0); tracep->declQuad(c+25,"simTop mycore dpath__T_42_0_6", false,-1, 63,0); tracep->declQuad(c+27,"simTop mycore dpath__T_42_0_7", false,-1, 63,0); tracep->declQuad(c+29,"simTop mycore dpath__T_42_0_8", false,-1, 63,0); tracep->declQuad(c+31,"simTop mycore dpath__T_42_0_9", false,-1, 63,0); tracep->declQuad(c+33,"simTop mycore dpath__T_42_0_10", false,-1, 63,0); tracep->declQuad(c+35,"simTop mycore dpath__T_42_0_11", false,-1, 63,0); tracep->declQuad(c+37,"simTop mycore dpath__T_42_0_12", false,-1, 63,0); tracep->declQuad(c+39,"simTop mycore dpath__T_42_0_13", false,-1, 63,0); tracep->declQuad(c+41,"simTop mycore dpath__T_42_0_14", false,-1, 63,0); tracep->declQuad(c+43,"simTop mycore dpath__T_42_0_15", false,-1, 63,0); tracep->declQuad(c+45,"simTop mycore dpath__T_42_0_16", false,-1, 63,0); tracep->declQuad(c+47,"simTop mycore dpath__T_42_0_17", false,-1, 63,0); tracep->declQuad(c+49,"simTop mycore dpath__T_42_0_18", false,-1, 63,0); tracep->declQuad(c+51,"simTop mycore dpath__T_42_0_19", false,-1, 63,0); tracep->declQuad(c+53,"simTop mycore dpath__T_42_0_20", false,-1, 63,0); tracep->declQuad(c+55,"simTop mycore dpath__T_42_0_21", false,-1, 63,0); tracep->declQuad(c+57,"simTop mycore dpath__T_42_0_22", false,-1, 63,0); tracep->declQuad(c+59,"simTop mycore dpath__T_42_0_23", false,-1, 63,0); tracep->declQuad(c+61,"simTop mycore dpath__T_42_0_24", false,-1, 63,0); tracep->declQuad(c+63,"simTop mycore dpath__T_42_0_25", false,-1, 63,0); tracep->declQuad(c+65,"simTop mycore dpath__T_42_0_26", false,-1, 63,0); tracep->declQuad(c+67,"simTop mycore dpath__T_42_0_27", false,-1, 63,0); tracep->declQuad(c+69,"simTop mycore dpath__T_42_0_28", false,-1, 63,0); tracep->declQuad(c+71,"simTop mycore dpath__T_42_0_29", false,-1, 63,0); tracep->declQuad(c+73,"simTop mycore dpath__T_42_0_30", false,-1, 63,0); tracep->declQuad(c+75,"simTop mycore dpath__T_42_0_31", false,-1, 63,0); tracep->declQuad(c+77,"simTop mycore dpath_wb_reg_pc_0", false,-1, 63,0); tracep->declBit(c+514,"simTop mycore cpath clock", false,-1); tracep->declBit(c+515,"simTop mycore cpath reset", false,-1); tracep->declQuad(c+79,"simTop mycore cpath io_dat_dec_inst", false,-1, 63,0); tracep->declBit(c+81,"simTop mycore cpath io_dat_exe_br_eq", false,-1); tracep->declBit(c+82,"simTop mycore cpath io_dat_exe_br_lt", false,-1); tracep->declBit(c+83,"simTop mycore cpath io_dat_exe_br_ltu", false,-1); tracep->declBus(c+84,"simTop mycore cpath io_dat_exe_br_type", false,-1, 3,0); tracep->declBit(c+85,"simTop mycore cpath io_dat_csr_eret", false,-1); tracep->declBit(c+86,"simTop mycore cpath io_ctl_dec_stall", false,-1); tracep->declBus(c+87,"simTop mycore cpath io_ctl_exe_pc_sel", false,-1, 1,0); tracep->declBus(c+88,"simTop mycore cpath io_ctl_br_type", false,-1, 3,0); tracep->declBit(c+89,"simTop mycore cpath io_ctl_if_kill", false,-1); tracep->declBit(c+90,"simTop mycore cpath io_ctl_dec_kill", false,-1); tracep->declBus(c+91,"simTop mycore cpath io_ctl_op1_sel", false,-1, 1,0); tracep->declBus(c+92,"simTop mycore cpath io_ctl_op2_sel", false,-1, 2,0); tracep->declBus(c+93,"simTop mycore cpath io_ctl_alu_fun", false,-1, 4,0); tracep->declBus(c+94,"simTop mycore cpath io_ctl_wb_sel", false,-1, 2,0); tracep->declBit(c+95,"simTop mycore cpath io_ctl_rf_wen", false,-1); tracep->declBus(c+96,"simTop mycore cpath io_ctl_mem_fcn", false,-1, 1,0); tracep->declBus(c+97,"simTop mycore cpath io_ctl_mem_typ", false,-1, 7,0); tracep->declBus(c+98,"simTop mycore cpath io_ctl_mem_wid", false,-1, 2,0); tracep->declBus(c+99,"simTop mycore cpath io_ctl_csr_cmd", false,-1, 2,0); tracep->declBit(c+100,"simTop mycore cpath io_ctl_fencei", false,-1); tracep->declBit(c+85,"simTop mycore cpath io_ctl_pipeline_kill", false,-1); tracep->declBit(c+101,"simTop mycore cpath cs_rs1_oen", false,-1); tracep->declBit(c+102,"simTop mycore cpath cs_rs2_oen", false,-1); tracep->declBus(c+93,"simTop mycore cpath cs0_0", false,-1, 4,0); tracep->declBit(c+103,"simTop mycore cpath cs0_3", false,-1); tracep->declBus(c+96,"simTop mycore cpath cs0_4", false,-1, 1,0); tracep->declBus(c+104,"simTop mycore cpath cs0_7", false,-1, 2,0); tracep->declBit(c+105,"simTop mycore cpath cs0_8", false,-1); tracep->declBus(c+87,"simTop mycore cpath ctrl_exe_pc_sel", false,-1, 1,0); tracep->declBit(c+106,"simTop mycore cpath ifkill", false,-1); tracep->declBus(c+107,"simTop mycore cpath dec_rs1_addr", false,-1, 4,0); tracep->declBus(c+108,"simTop mycore cpath dec_rs2_addr", false,-1, 4,0); tracep->declBus(c+109,"simTop mycore cpath dec_wbaddr", false,-1, 4,0); tracep->declBit(c+110,"simTop mycore cpath dec_rs1_oen", false,-1); tracep->declBit(c+111,"simTop mycore cpath dec_rs2_oen", false,-1); tracep->declBus(c+112,"simTop mycore cpath exe_reg_wbaddr", false,-1, 4,0); tracep->declBit(c+113,"simTop mycore cpath exe_reg_is_csr", false,-1); tracep->declBit(c+114,"simTop mycore cpath exe_inst_is_load", false,-1); tracep->declBit(c+86,"simTop mycore cpath stall", false,-1); tracep->declBit(c+514,"simTop mycore dpath clock", false,-1); tracep->declBit(c+515,"simTop mycore dpath reset", false,-1); tracep->declBit(c+86,"simTop mycore dpath io_ctl_dec_stall", false,-1); tracep->declBus(c+87,"simTop mycore dpath io_ctl_exe_pc_sel", false,-1, 1,0); tracep->declBus(c+88,"simTop mycore dpath io_ctl_br_type", false,-1, 3,0); tracep->declBit(c+89,"simTop mycore dpath io_ctl_if_kill", false,-1); tracep->declBit(c+90,"simTop mycore dpath io_ctl_dec_kill", false,-1); tracep->declBus(c+91,"simTop mycore dpath io_ctl_op1_sel", false,-1, 1,0); tracep->declBus(c+92,"simTop mycore dpath io_ctl_op2_sel", false,-1, 2,0); tracep->declBus(c+93,"simTop mycore dpath io_ctl_alu_fun", false,-1, 4,0); tracep->declBus(c+94,"simTop mycore dpath io_ctl_wb_sel", false,-1, 2,0); tracep->declBit(c+95,"simTop mycore dpath io_ctl_rf_wen", false,-1); tracep->declBus(c+96,"simTop mycore dpath io_ctl_mem_fcn", false,-1, 1,0); tracep->declBus(c+97,"simTop mycore dpath io_ctl_mem_typ", false,-1, 7,0); tracep->declBus(c+98,"simTop mycore dpath io_ctl_mem_wid", false,-1, 2,0); tracep->declBus(c+99,"simTop mycore dpath io_ctl_csr_cmd", false,-1, 2,0); tracep->declBit(c+100,"simTop mycore dpath io_ctl_fencei", false,-1); tracep->declBit(c+85,"simTop mycore dpath io_ctl_pipeline_kill", false,-1); tracep->declQuad(c+79,"simTop mycore dpath io_dat_dec_inst", false,-1, 63,0); tracep->declBit(c+81,"simTop mycore dpath io_dat_exe_br_eq", false,-1); tracep->declBit(c+82,"simTop mycore dpath io_dat_exe_br_lt", false,-1); tracep->declBit(c+83,"simTop mycore dpath io_dat_exe_br_ltu", false,-1); tracep->declBus(c+84,"simTop mycore dpath io_dat_exe_br_type", false,-1, 3,0); tracep->declBit(c+85,"simTop mycore dpath io_dat_csr_eret", false,-1); tracep->declQuad(c+1,"simTop mycore dpath io_inst_readIO_addr", false,-1, 63,0); tracep->declQuad(c+585,"simTop mycore dpath io_inst_readIO_data", false,-1, 63,0); tracep->declQuad(c+3,"simTop mycore dpath io_data_readIO_addr", false,-1, 63,0); tracep->declQuad(c+590,"simTop mycore dpath io_data_readIO_data", false,-1, 63,0); tracep->declBit(c+5,"simTop mycore dpath io_data_readIO_en", false,-1); tracep->declQuad(c+6,"simTop mycore dpath io_data_writeIO_addr", false,-1, 63,0); tracep->declQuad(c+8,"simTop mycore dpath io_data_writeIO_data", false,-1, 63,0); tracep->declBit(c+10,"simTop mycore dpath io_data_writeIO_en", false,-1); tracep->declBus(c+11,"simTop mycore dpath io_data_writeIO_mask", false,-1, 7,0); tracep->declBit(c+12,"simTop mycore dpath wb_reg_valid_0", false,-1); tracep->declQuad(c+77,"simTop mycore dpath wb_reg_pc_0", false,-1, 63,0); tracep->declBit(c+514,"simTop mycore dpath regfile_clock", false,-1); tracep->declBit(c+515,"simTop mycore dpath regfile_reset", false,-1); tracep->declBus(c+107,"simTop mycore dpath regfile_io_rs1_addr", false,-1, 4,0); tracep->declQuad(c+115,"simTop mycore dpath regfile_io_rs1_data", false,-1, 63,0); tracep->declBus(c+108,"simTop mycore dpath regfile_io_rs2_addr", false,-1, 4,0); tracep->declQuad(c+117,"simTop mycore dpath regfile_io_rs2_data", false,-1, 63,0); tracep->declBus(c+119,"simTop mycore dpath regfile_io_waddr", false,-1, 4,0); tracep->declQuad(c+120,"simTop mycore dpath regfile_io_wdata", false,-1, 63,0); tracep->declBit(c+122,"simTop mycore dpath regfile_io_wen", false,-1); tracep->declQuad(c+13,"simTop mycore dpath regfile__T_42_0_0", false,-1, 63,0); tracep->declQuad(c+15,"simTop mycore dpath regfile__T_42_0_1", false,-1, 63,0); tracep->declQuad(c+17,"simTop mycore dpath regfile__T_42_0_2", false,-1, 63,0); tracep->declQuad(c+19,"simTop mycore dpath regfile__T_42_0_3", false,-1, 63,0); tracep->declQuad(c+21,"simTop mycore dpath regfile__T_42_0_4", false,-1, 63,0); tracep->declQuad(c+23,"simTop mycore dpath regfile__T_42_0_5", false,-1, 63,0); tracep->declQuad(c+25,"simTop mycore dpath regfile__T_42_0_6", false,-1, 63,0); tracep->declQuad(c+27,"simTop mycore dpath regfile__T_42_0_7", false,-1, 63,0); tracep->declQuad(c+29,"simTop mycore dpath regfile__T_42_0_8", false,-1, 63,0); tracep->declQuad(c+31,"simTop mycore dpath regfile__T_42_0_9", false,-1, 63,0); tracep->declQuad(c+33,"simTop mycore dpath regfile__T_42_0_10", false,-1, 63,0); tracep->declQuad(c+35,"simTop mycore dpath regfile__T_42_0_11", false,-1, 63,0); tracep->declQuad(c+37,"simTop mycore dpath regfile__T_42_0_12", false,-1, 63,0); tracep->declQuad(c+39,"simTop mycore dpath regfile__T_42_0_13", false,-1, 63,0); tracep->declQuad(c+41,"simTop mycore dpath regfile__T_42_0_14", false,-1, 63,0); tracep->declQuad(c+43,"simTop mycore dpath regfile__T_42_0_15", false,-1, 63,0); tracep->declQuad(c+45,"simTop mycore dpath regfile__T_42_0_16", false,-1, 63,0); tracep->declQuad(c+47,"simTop mycore dpath regfile__T_42_0_17", false,-1, 63,0); tracep->declQuad(c+49,"simTop mycore dpath regfile__T_42_0_18", false,-1, 63,0); tracep->declQuad(c+51,"simTop mycore dpath regfile__T_42_0_19", false,-1, 63,0); tracep->declQuad(c+53,"simTop mycore dpath regfile__T_42_0_20", false,-1, 63,0); tracep->declQuad(c+55,"simTop mycore dpath regfile__T_42_0_21", false,-1, 63,0); tracep->declQuad(c+57,"simTop mycore dpath regfile__T_42_0_22", false,-1, 63,0); tracep->declQuad(c+59,"simTop mycore dpath regfile__T_42_0_23", false,-1, 63,0); tracep->declQuad(c+61,"simTop mycore dpath regfile__T_42_0_24", false,-1, 63,0); tracep->declQuad(c+63,"simTop mycore dpath regfile__T_42_0_25", false,-1, 63,0); tracep->declQuad(c+65,"simTop mycore dpath regfile__T_42_0_26", false,-1, 63,0); tracep->declQuad(c+67,"simTop mycore dpath regfile__T_42_0_27", false,-1, 63,0); tracep->declQuad(c+69,"simTop mycore dpath regfile__T_42_0_28", false,-1, 63,0); tracep->declQuad(c+71,"simTop mycore dpath regfile__T_42_0_29", false,-1, 63,0); tracep->declQuad(c+73,"simTop mycore dpath regfile__T_42_0_30", false,-1, 63,0); tracep->declQuad(c+75,"simTop mycore dpath regfile__T_42_0_31", false,-1, 63,0); tracep->declBit(c+514,"simTop mycore dpath alu_clock", false,-1); tracep->declBit(c+515,"simTop mycore dpath alu_reset", false,-1); tracep->declQuad(c+123,"simTop mycore dpath alu_io_src1", false,-1, 63,0); tracep->declQuad(c+125,"simTop mycore dpath alu_io_src2", false,-1, 63,0); tracep->declBus(c+127,"simTop mycore dpath alu_io_op", false,-1, 4,0); tracep->declQuad(c+128,"simTop mycore dpath alu_io_res", false,-1, 63,0); tracep->declBit(c+130,"simTop mycore dpath alu_io_stall", false,-1); tracep->declBit(c+514,"simTop mycore dpath csr_clock", false,-1); tracep->declBit(c+515,"simTop mycore dpath csr_reset", false,-1); tracep->declBus(c+131,"simTop mycore dpath csr_io_inst", false,-1, 31,0); tracep->declBus(c+132,"simTop mycore dpath csr_io_csr_op", false,-1, 2,0); tracep->declQuad(c+133,"simTop mycore dpath csr_io_data_in", false,-1, 63,0); tracep->declBit(c+130,"simTop mycore dpath csr_io_has_stall", false,-1); tracep->declQuad(c+135,"simTop mycore dpath csr_io_in_mem_pc", false,-1, 63,0); tracep->declQuad(c+137,"simTop mycore dpath csr_io_in_exe_pc", false,-1, 63,0); tracep->declQuad(c+139,"simTop mycore dpath csr_io_in_dec_pc", false,-1, 63,0); tracep->declQuad(c+1,"simTop mycore dpath csr_io_in_if_pc", false,-1, 63,0); tracep->declBit(c+85,"simTop mycore dpath csr_io_is_redir", false,-1); tracep->declQuad(c+1,"simTop mycore dpath if_reg_pc", false,-1, 63,0); tracep->declBit(c+141,"simTop mycore dpath dec_reg_valid", false,-1); tracep->declQuad(c+79,"simTop mycore dpath dec_reg_inst", false,-1, 63,0); tracep->declQuad(c+139,"simTop mycore dpath dec_reg_pc", false,-1, 63,0); tracep->declBit(c+142,"simTop mycore dpath exe_reg_valid", false,-1); tracep->declQuad(c+143,"simTop mycore dpath exe_reg_inst", false,-1, 63,0); tracep->declQuad(c+137,"simTop mycore dpath exe_reg_pc", false,-1, 63,0); tracep->declBus(c+145,"simTop mycore dpath exe_reg_wbaddr", false,-1, 4,0); tracep->declQuad(c+123,"simTop mycore dpath exe_alu_op1", false,-1, 63,0); tracep->declQuad(c+125,"simTop mycore dpath brjmp_offset", false,-1, 63,0); tracep->declQuad(c+146,"simTop mycore dpath exe_reg_rs2_data", false,-1, 63,0); tracep->declBus(c+84,"simTop mycore dpath exe_reg_ctrl_br_type", false,-1, 3,0); tracep->declBus(c+127,"simTop mycore dpath exe_reg_ctrl_alu_fun", false,-1, 4,0); tracep->declBus(c+148,"simTop mycore dpath exe_reg_ctrl_wb_sel", false,-1, 2,0); tracep->declBit(c+149,"simTop mycore dpath exe_reg_ctrl_rf_wen", false,-1); tracep->declBus(c+150,"simTop mycore dpath exe_reg_ctrl_mem_fcn", false,-1, 1,0); tracep->declBus(c+151,"simTop mycore dpath exe_reg_ctrl_mem_typ", false,-1, 7,0); tracep->declBus(c+152,"simTop mycore dpath exe_reg_ctrl_mem_wid", false,-1, 2,0); tracep->declBus(c+153,"simTop mycore dpath exe_reg_ctrl_csr_cmd", false,-1, 2,0); tracep->declBit(c+154,"simTop mycore dpath mem_reg_valid", false,-1); tracep->declQuad(c+135,"simTop mycore dpath mem_reg_pc", false,-1, 63,0); tracep->declQuad(c+155,"simTop mycore dpath mem_reg_inst", false,-1, 63,0); tracep->declQuad(c+133,"simTop mycore dpath mem_reg_alu_out", false,-1, 63,0); tracep->declBus(c+157,"simTop mycore dpath mem_reg_wbaddr", false,-1, 4,0); tracep->declBit(c+158,"simTop mycore dpath mem_reg_ctrl_rf_wen", false,-1); tracep->declBus(c+159,"simTop mycore dpath mem_reg_ctrl_wb_sel", false,-1, 2,0); tracep->declBus(c+160,"simTop mycore dpath mem_reg_ctrl_mem_wid", false,-1, 2,0); tracep->declBus(c+132,"simTop mycore dpath mem_reg_ctrl_csr_cmd", false,-1, 2,0); tracep->declQuad(c+161,"simTop mycore dpath mem_reg_dram_data", false,-1, 63,0); tracep->declBit(c+12,"simTop mycore dpath wb_reg_valid", false,-1); tracep->declQuad(c+77,"simTop mycore dpath wb_reg_pc", false,-1, 63,0); tracep->declBus(c+119,"simTop mycore dpath wb_reg_wbaddr", false,-1, 4,0); tracep->declQuad(c+120,"simTop mycore dpath wb_reg_wbdata", false,-1, 63,0); tracep->declBit(c+122,"simTop mycore dpath wb_reg_ctrl_rf_wen", false,-1); tracep->declBit(c+130,"simTop mycore dpath alu_stall", false,-1); tracep->declQuad(c+163,"simTop mycore dpath if_pc_plus4", false,-1, 63,0); tracep->declQuad(c+165,"simTop mycore dpath exe_brjmp_target", false,-1, 63,0); tracep->declQuad(c+167,"simTop mycore dpath exe_adder_out", false,-1, 63,0); tracep->declQuad(c+169,"simTop mycore dpath if_pc_next", false,-1, 63,0); tracep->declBus(c+107,"simTop mycore dpath dec_rs1_addr", false,-1, 4,0); tracep->declBus(c+108,"simTop mycore dpath dec_rs2_addr", false,-1, 4,0); tracep->declBus(c+109,"simTop mycore dpath dec_wbaddr", false,-1, 4,0); tracep->declBus(c+171,"simTop mycore dpath imm_itype", false,-1, 11,0); tracep->declBus(c+172,"simTop mycore dpath imm_stype", false,-1, 11,0); tracep->declBus(c+173,"simTop mycore dpath imm_sbtype", false,-1, 11,0); tracep->declBus(c+174,"simTop mycore dpath imm_utype", false,-1, 19,0); tracep->declBus(c+175,"simTop mycore dpath imm_ujtype", false,-1, 19,0); tracep->declBus(c+176,"simTop mycore dpath imm_z", false,-1, 31,0); tracep->declQuad(c+177,"simTop mycore dpath imm_itype_sext", false,-1, 63,0); tracep->declQuad(c+179,"simTop mycore dpath imm_stype_sext", false,-1, 63,0); tracep->declQuad(c+181,"simTop mycore dpath imm_sbtype_sext", false,-1, 63,0); tracep->declQuad(c+183,"simTop mycore dpath imm_utype_sext", false,-1, 63,0); tracep->declQuad(c+185,"simTop mycore dpath imm_ujtype_sext", false,-1, 63,0); tracep->declQuad(c+187,"simTop mycore dpath dec_alu_op2", false,-1, 63,0); tracep->declQuad(c+189,"simTop mycore dpath mem_data", false,-1, 63,0); tracep->declQuad(c+191,"simTop mycore dpath mem_wbdata", false,-1, 63,0); tracep->declQuad(c+193,"simTop mycore dpath exe_alu_out", false,-1, 63,0); tracep->declQuad(c+195,"simTop mycore dpath dec_rs1_data", false,-1, 63,0); tracep->declQuad(c+197,"simTop mycore dpath dec_op1_data", false,-1, 63,0); tracep->declQuad(c+199,"simTop mycore dpath dec_op2_data", false,-1, 63,0); tracep->declQuad(c+201,"simTop mycore dpath exe_pc_plus4", false,-1, 63,0); tracep->declBit(c+514,"simTop mycore dpath regfile clock", false,-1); tracep->declBit(c+515,"simTop mycore dpath regfile reset", false,-1); tracep->declBus(c+107,"simTop mycore dpath regfile io_rs1_addr", false,-1, 4,0); tracep->declQuad(c+115,"simTop mycore dpath regfile io_rs1_data", false,-1, 63,0); tracep->declBus(c+108,"simTop mycore dpath regfile io_rs2_addr", false,-1, 4,0); tracep->declQuad(c+117,"simTop mycore dpath regfile io_rs2_data", false,-1, 63,0); tracep->declBus(c+119,"simTop mycore dpath regfile io_waddr", false,-1, 4,0); tracep->declQuad(c+120,"simTop mycore dpath regfile io_wdata", false,-1, 63,0); tracep->declBit(c+122,"simTop mycore dpath regfile io_wen", false,-1); {int i; for (i=0; i<32; i++) { tracep->declQuad(c+203+i*2,"simTop mycore dpath regfile regfile", true,(i+0), 63,0);}} tracep->declQuad(c+267,"simTop mycore dpath regfile regfile__T_1_data", false,-1, 63,0); tracep->declBus(c+107,"simTop mycore dpath regfile regfile__T_1_addr", false,-1, 4,0); tracep->declQuad(c+269,"simTop mycore dpath regfile regfile__T_4_data", false,-1, 63,0); tracep->declBus(c+108,"simTop mycore dpath regfile regfile__T_4_addr", false,-1, 4,0); tracep->declQuad(c+13,"simTop mycore dpath regfile regfile__T_10_data", false,-1, 63,0); tracep->declBus(c+599,"simTop mycore dpath regfile regfile__T_10_addr", false,-1, 4,0); tracep->declQuad(c+15,"simTop mycore dpath regfile regfile__T_11_data", false,-1, 63,0); tracep->declBus(c+600,"simTop mycore dpath regfile regfile__T_11_addr", false,-1, 4,0); tracep->declQuad(c+17,"simTop mycore dpath regfile regfile__T_12_data", false,-1, 63,0); tracep->declBus(c+601,"simTop mycore dpath regfile regfile__T_12_addr", false,-1, 4,0); tracep->declQuad(c+19,"simTop mycore dpath regfile regfile__T_13_data", false,-1, 63,0); tracep->declBus(c+602,"simTop mycore dpath regfile regfile__T_13_addr", false,-1, 4,0); tracep->declQuad(c+21,"simTop mycore dpath regfile regfile__T_14_data", false,-1, 63,0); tracep->declBus(c+603,"simTop mycore dpath regfile regfile__T_14_addr", false,-1, 4,0); tracep->declQuad(c+23,"simTop mycore dpath regfile regfile__T_15_data", false,-1, 63,0); tracep->declBus(c+604,"simTop mycore dpath regfile regfile__T_15_addr", false,-1, 4,0); tracep->declQuad(c+25,"simTop mycore dpath regfile regfile__T_16_data", false,-1, 63,0); tracep->declBus(c+605,"simTop mycore dpath regfile regfile__T_16_addr", false,-1, 4,0); tracep->declQuad(c+27,"simTop mycore dpath regfile regfile__T_17_data", false,-1, 63,0); tracep->declBus(c+606,"simTop mycore dpath regfile regfile__T_17_addr", false,-1, 4,0); tracep->declQuad(c+29,"simTop mycore dpath regfile regfile__T_18_data", false,-1, 63,0); tracep->declBus(c+607,"simTop mycore dpath regfile regfile__T_18_addr", false,-1, 4,0); tracep->declQuad(c+31,"simTop mycore dpath regfile regfile__T_19_data", false,-1, 63,0); tracep->declBus(c+608,"simTop mycore dpath regfile regfile__T_19_addr", false,-1, 4,0); tracep->declQuad(c+33,"simTop mycore dpath regfile regfile__T_20_data", false,-1, 63,0); tracep->declBus(c+609,"simTop mycore dpath regfile regfile__T_20_addr", false,-1, 4,0); tracep->declQuad(c+35,"simTop mycore dpath regfile regfile__T_21_data", false,-1, 63,0); tracep->declBus(c+610,"simTop mycore dpath regfile regfile__T_21_addr", false,-1, 4,0); tracep->declQuad(c+37,"simTop mycore dpath regfile regfile__T_22_data", false,-1, 63,0); tracep->declBus(c+611,"simTop mycore dpath regfile regfile__T_22_addr", false,-1, 4,0); tracep->declQuad(c+39,"simTop mycore dpath regfile regfile__T_23_data", false,-1, 63,0); tracep->declBus(c+612,"simTop mycore dpath regfile regfile__T_23_addr", false,-1, 4,0); tracep->declQuad(c+41,"simTop mycore dpath regfile regfile__T_24_data", false,-1, 63,0); tracep->declBus(c+613,"simTop mycore dpath regfile regfile__T_24_addr", false,-1, 4,0); tracep->declQuad(c+43,"simTop mycore dpath regfile regfile__T_25_data", false,-1, 63,0); tracep->declBus(c+614,"simTop mycore dpath regfile regfile__T_25_addr", false,-1, 4,0); tracep->declQuad(c+45,"simTop mycore dpath regfile regfile__T_26_data", false,-1, 63,0); tracep->declBus(c+615,"simTop mycore dpath regfile regfile__T_26_addr", false,-1, 4,0); tracep->declQuad(c+47,"simTop mycore dpath regfile regfile__T_27_data", false,-1, 63,0); tracep->declBus(c+616,"simTop mycore dpath regfile regfile__T_27_addr", false,-1, 4,0); tracep->declQuad(c+49,"simTop mycore dpath regfile regfile__T_28_data", false,-1, 63,0); tracep->declBus(c+617,"simTop mycore dpath regfile regfile__T_28_addr", false,-1, 4,0); tracep->declQuad(c+51,"simTop mycore dpath regfile regfile__T_29_data", false,-1, 63,0); tracep->declBus(c+618,"simTop mycore dpath regfile regfile__T_29_addr", false,-1, 4,0); tracep->declQuad(c+53,"simTop mycore dpath regfile regfile__T_30_data", false,-1, 63,0); tracep->declBus(c+619,"simTop mycore dpath regfile regfile__T_30_addr", false,-1, 4,0); tracep->declQuad(c+55,"simTop mycore dpath regfile regfile__T_31_data", false,-1, 63,0); tracep->declBus(c+620,"simTop mycore dpath regfile regfile__T_31_addr", false,-1, 4,0); tracep->declQuad(c+57,"simTop mycore dpath regfile regfile__T_32_data", false,-1, 63,0); tracep->declBus(c+621,"simTop mycore dpath regfile regfile__T_32_addr", false,-1, 4,0); tracep->declQuad(c+59,"simTop mycore dpath regfile regfile__T_33_data", false,-1, 63,0); tracep->declBus(c+622,"simTop mycore dpath regfile regfile__T_33_addr", false,-1, 4,0); tracep->declQuad(c+61,"simTop mycore dpath regfile regfile__T_34_data", false,-1, 63,0); tracep->declBus(c+623,"simTop mycore dpath regfile regfile__T_34_addr", false,-1, 4,0); tracep->declQuad(c+63,"simTop mycore dpath regfile regfile__T_35_data", false,-1, 63,0); tracep->declBus(c+624,"simTop mycore dpath regfile regfile__T_35_addr", false,-1, 4,0); tracep->declQuad(c+65,"simTop mycore dpath regfile regfile__T_36_data", false,-1, 63,0); tracep->declBus(c+625,"simTop mycore dpath regfile regfile__T_36_addr", false,-1, 4,0); tracep->declQuad(c+67,"simTop mycore dpath regfile regfile__T_37_data", false,-1, 63,0); tracep->declBus(c+626,"simTop mycore dpath regfile regfile__T_37_addr", false,-1, 4,0); tracep->declQuad(c+69,"simTop mycore dpath regfile regfile__T_38_data", false,-1, 63,0); tracep->declBus(c+627,"simTop mycore dpath regfile regfile__T_38_addr", false,-1, 4,0); tracep->declQuad(c+71,"simTop mycore dpath regfile regfile__T_39_data", false,-1, 63,0); tracep->declBus(c+628,"simTop mycore dpath regfile regfile__T_39_addr", false,-1, 4,0); tracep->declQuad(c+73,"simTop mycore dpath regfile regfile__T_40_data", false,-1, 63,0); tracep->declBus(c+629,"simTop mycore dpath regfile regfile__T_40_addr", false,-1, 4,0); tracep->declQuad(c+75,"simTop mycore dpath regfile regfile__T_41_data", false,-1, 63,0); tracep->declBus(c+630,"simTop mycore dpath regfile regfile__T_41_addr", false,-1, 4,0); tracep->declQuad(c+120,"simTop mycore dpath regfile regfile__T_9_data", false,-1, 63,0); tracep->declBus(c+119,"simTop mycore dpath regfile regfile__T_9_addr", false,-1, 4,0); tracep->declBit(c+631,"simTop mycore dpath regfile regfile__T_9_mask", false,-1); tracep->declBit(c+271,"simTop mycore dpath regfile regfile__T_9_en", false,-1); tracep->declBit(c+514,"simTop mycore dpath alu clock", false,-1); tracep->declBit(c+515,"simTop mycore dpath alu reset", false,-1); tracep->declQuad(c+123,"simTop mycore dpath alu io_src1", false,-1, 63,0); tracep->declQuad(c+125,"simTop mycore dpath alu io_src2", false,-1, 63,0); tracep->declBus(c+127,"simTop mycore dpath alu io_op", false,-1, 4,0); tracep->declQuad(c+128,"simTop mycore dpath alu io_res", false,-1, 63,0); tracep->declBit(c+130,"simTop mycore dpath alu io_stall", false,-1); tracep->declBit(c+514,"simTop mycore dpath alu mdu_clock", false,-1); tracep->declBit(c+515,"simTop mycore dpath alu mdu_reset", false,-1); tracep->declBit(c+272,"simTop mycore dpath alu mdu_io_start", false,-1); tracep->declQuad(c+123,"simTop mycore dpath alu mdu_io_a", false,-1, 63,0); tracep->declQuad(c+125,"simTop mycore dpath alu mdu_io_b", false,-1, 63,0); tracep->declBus(c+127,"simTop mycore dpath alu mdu_io_op", false,-1, 4,0); tracep->declBit(c+273,"simTop mycore dpath alu mdu_io_stall_req", false,-1); tracep->declQuad(c+274,"simTop mycore dpath alu mdu_io_mult_out", false,-1, 63,0); tracep->declBus(c+276,"simTop mycore dpath alu shamt", false,-1, 5,0); tracep->declBit(c+277,"simTop mycore dpath alu use_mdu", false,-1); tracep->declBit(c+514,"simTop mycore dpath alu mdu clock", false,-1); tracep->declBit(c+515,"simTop mycore dpath alu mdu reset", false,-1); tracep->declBit(c+272,"simTop mycore dpath alu mdu io_start", false,-1); tracep->declQuad(c+123,"simTop mycore dpath alu mdu io_a", false,-1, 63,0); tracep->declQuad(c+125,"simTop mycore dpath alu mdu io_b", false,-1, 63,0); tracep->declBus(c+127,"simTop mycore dpath alu mdu io_op", false,-1, 4,0); tracep->declBit(c+273,"simTop mycore dpath alu mdu io_stall_req", false,-1); tracep->declQuad(c+274,"simTop mycore dpath alu mdu io_mult_out", false,-1, 63,0); tracep->declQuad(c+278,"simTop mycore dpath alu mdu last_a", false,-1, 63,0); tracep->declQuad(c+280,"simTop mycore dpath alu mdu last_b", false,-1, 63,0); tracep->declBus(c+282,"simTop mycore dpath alu mdu last_op", false,-1, 4,0); tracep->declBit(c+283,"simTop mycore dpath alu mdu is_mult", false,-1); tracep->declArray(c+284,"simTop mycore dpath alu mdu res", false,-1, 127,0); tracep->declBus(c+288,"simTop mycore dpath alu mdu mult_cnt", false,-1, 6,0); tracep->declBus(c+289,"simTop mycore dpath alu mdu div_cnt", false,-1, 6,0); tracep->declBit(c+290,"simTop mycore dpath alu mdu sign_a", false,-1); tracep->declBit(c+291,"simTop mycore dpath alu mdu sign_wa", false,-1); tracep->declQuad(c+292,"simTop mycore dpath alu mdu abs_a", false,-1, 63,0); tracep->declBit(c+294,"simTop mycore dpath alu mdu sign_b", false,-1); tracep->declBit(c+295,"simTop mycore dpath alu mdu sign_wb", false,-1); tracep->declQuad(c+296,"simTop mycore dpath alu mdu abs_b", false,-1, 63,0); tracep->declArray(c+298,"simTop mycore dpath alu mdu res_ss", false,-1, 127,0); tracep->declArray(c+302,"simTop mycore dpath alu mdu res_su", false,-1, 127,0); tracep->declQuad(c+306,"simTop mycore dpath alu mdu res_divs", false,-1, 63,0); tracep->declQuad(c+308,"simTop mycore dpath alu mdu res_rems", false,-1, 63,0); tracep->declBus(c+310,"simTop mycore dpath alu mdu res_divsw", false,-1, 31,0); tracep->declBus(c+311,"simTop mycore dpath alu mdu res_remsw", false,-1, 31,0); tracep->declBit(c+312,"simTop mycore dpath alu mdu last_stall_req", false,-1); tracep->declArray(c+313,"simTop mycore dpath alu mdu front_val", false,-1, 64,0); tracep->declArray(c+316,"simTop mycore dpath alu mdu step_result", false,-1, 127,0); tracep->declBit(c+514,"simTop mycore dpath csr clock", false,-1); tracep->declBit(c+515,"simTop mycore dpath csr reset", false,-1); tracep->declBus(c+131,"simTop mycore dpath csr io_inst", false,-1, 31,0); tracep->declBus(c+132,"simTop mycore dpath csr io_csr_op", false,-1, 2,0); tracep->declQuad(c+133,"simTop mycore dpath csr io_data_in", false,-1, 63,0); tracep->declBit(c+130,"simTop mycore dpath csr io_has_stall", false,-1); tracep->declQuad(c+135,"simTop mycore dpath csr io_in_mem_pc", false,-1, 63,0); tracep->declQuad(c+137,"simTop mycore dpath csr io_in_exe_pc", false,-1, 63,0); tracep->declQuad(c+139,"simTop mycore dpath csr io_in_dec_pc", false,-1, 63,0); tracep->declQuad(c+1,"simTop mycore dpath csr io_in_if_pc", false,-1, 63,0); tracep->declBit(c+85,"simTop mycore dpath csr io_is_redir", false,-1); tracep->declQuad(c+320,"simTop mycore dpath csr reg_mtvec", false,-1, 63,0); tracep->declQuad(c+322,"simTop mycore dpath csr reg_mepc", false,-1, 63,0); tracep->declQuad(c+324,"simTop mycore dpath csr reg_mcause", false,-1, 63,0); tracep->declBit(c+326,"simTop mycore dpath csr reg_mie_mtip", false,-1); tracep->declBit(c+327,"simTop mycore dpath csr reg_mie_msip", false,-1); tracep->declBit(c+328,"simTop mycore dpath csr reg_mip_mtip", false,-1); tracep->declBit(c+329,"simTop mycore dpath csr reg_mip_msip", false,-1); tracep->declQuad(c+330,"simTop mycore dpath csr reg_mtval", false,-1, 63,0); tracep->declQuad(c+332,"simTop mycore dpath csr reg_mscratch", false,-1, 63,0); tracep->declBus(c+334,"simTop mycore dpath csr reg_mstatus_mpp", false,-1, 1,0); tracep->declBit(c+335,"simTop mycore dpath csr reg_mstatus_mpie", false,-1); tracep->declBit(c+336,"simTop mycore dpath csr reg_mstatus_mie", false,-1); tracep->declQuad(c+337,"simTop mycore dpath csr reg_pmpcfg0", false,-1, 63,0); tracep->declQuad(c+339,"simTop mycore dpath csr reg_pmpcfg1", false,-1, 63,0); tracep->declQuad(c+341,"simTop mycore dpath csr regs_pmpaddr_0", false,-1, 63,0); tracep->declQuad(c+343,"simTop mycore dpath csr regs_pmpaddr_1", false,-1, 63,0); tracep->declQuad(c+345,"simTop mycore dpath csr regs_pmpaddr_2", false,-1, 63,0); tracep->declQuad(c+347,"simTop mycore dpath csr regs_pmpaddr_3", false,-1, 63,0); tracep->declQuad(c+349,"simTop mycore dpath csr regs_pmpaddr_4", false,-1, 63,0); tracep->declQuad(c+351,"simTop mycore dpath csr regs_pmpaddr_5", false,-1, 63,0); tracep->declQuad(c+353,"simTop mycore dpath csr regs_pmpaddr_6", false,-1, 63,0); tracep->declQuad(c+355,"simTop mycore dpath csr regs_pmpaddr_7", false,-1, 63,0); tracep->declQuad(c+357,"simTop mycore dpath csr regs_pmpaddr_8", false,-1, 63,0); tracep->declQuad(c+359,"simTop mycore dpath csr regs_pmpaddr_9", false,-1, 63,0); tracep->declQuad(c+361,"simTop mycore dpath csr regs_pmpaddr_10", false,-1, 63,0); tracep->declQuad(c+363,"simTop mycore dpath csr regs_pmpaddr_11", false,-1, 63,0); tracep->declQuad(c+365,"simTop mycore dpath csr regs_pmpaddr_12", false,-1, 63,0); tracep->declQuad(c+367,"simTop mycore dpath csr regs_pmpaddr_13", false,-1, 63,0); tracep->declQuad(c+369,"simTop mycore dpath csr regs_pmpaddr_14", false,-1, 63,0); tracep->declQuad(c+371,"simTop mycore dpath csr regs_pmpaddr_15", false,-1, 63,0); tracep->declQuad(c+373,"simTop mycore dpath csr reg_mcycle", false,-1, 63,0); tracep->declQuad(c+375,"simTop mycore dpath csr reg_minstret", false,-1, 63,0); tracep->declQuad(c+377,"simTop mycore dpath csr regs_mhpmcounter_0", false,-1, 63,0); tracep->declQuad(c+379,"simTop mycore dpath csr regs_mhpmcounter_1", false,-1, 63,0); tracep->declQuad(c+381,"simTop mycore dpath csr regs_mhpmcounter_2", false,-1, 63,0); tracep->declQuad(c+383,"simTop mycore dpath csr regs_mhpmcounter_3", false,-1, 63,0); tracep->declQuad(c+385,"simTop mycore dpath csr regs_mhpmcounter_4", false,-1, 63,0); tracep->declQuad(c+387,"simTop mycore dpath csr regs_mhpmcounter_5", false,-1, 63,0); tracep->declQuad(c+389,"simTop mycore dpath csr regs_mhpmcounter_6", false,-1, 63,0); tracep->declQuad(c+391,"simTop mycore dpath csr regs_mhpmcounter_7", false,-1, 63,0); tracep->declQuad(c+393,"simTop mycore dpath csr regs_mhpmcounter_8", false,-1, 63,0); tracep->declQuad(c+395,"simTop mycore dpath csr regs_mhpmcounter_9", false,-1, 63,0); tracep->declQuad(c+397,"simTop mycore dpath csr regs_mhpmcounter_10", false,-1, 63,0); tracep->declQuad(c+399,"simTop mycore dpath csr regs_mhpmcounter_11", false,-1, 63,0); tracep->declQuad(c+401,"simTop mycore dpath csr regs_mhpmcounter_12", false,-1, 63,0); tracep->declQuad(c+403,"simTop mycore dpath csr regs_mhpmcounter_13", false,-1, 63,0); tracep->declQuad(c+405,"simTop mycore dpath csr regs_mhpmcounter_14", false,-1, 63,0); tracep->declQuad(c+407,"simTop mycore dpath csr regs_mhpmcounter_15", false,-1, 63,0); tracep->declQuad(c+409,"simTop mycore dpath csr regs_mhpmcounter_16", false,-1, 63,0); tracep->declQuad(c+411,"simTop mycore dpath csr regs_mhpmcounter_17", false,-1, 63,0); tracep->declQuad(c+413,"simTop mycore dpath csr regs_mhpmcounter_18", false,-1, 63,0); tracep->declQuad(c+415,"simTop mycore dpath csr regs_mhpmcounter_19", false,-1, 63,0); tracep->declQuad(c+417,"simTop mycore dpath csr regs_mhpmcounter_20", false,-1, 63,0); tracep->declQuad(c+419,"simTop mycore dpath csr regs_mhpmcounter_21", false,-1, 63,0); tracep->declQuad(c+421,"simTop mycore dpath csr regs_mhpmcounter_22", false,-1, 63,0); tracep->declQuad(c+423,"simTop mycore dpath csr regs_mhpmcounter_23", false,-1, 63,0); tracep->declQuad(c+425,"simTop mycore dpath csr regs_mhpmcounter_24", false,-1, 63,0); tracep->declQuad(c+427,"simTop mycore dpath csr regs_mhpmcounter_25", false,-1, 63,0); tracep->declQuad(c+429,"simTop mycore dpath csr regs_mhpmcounter_26", false,-1, 63,0); tracep->declQuad(c+431,"simTop mycore dpath csr regs_mhpmcounter_27", false,-1, 63,0); tracep->declQuad(c+433,"simTop mycore dpath csr regs_mhpmcounter_28", false,-1, 63,0); tracep->declQuad(c+435,"simTop mycore dpath csr reg_mcounterinhibit", false,-1, 63,0); tracep->declQuad(c+437,"simTop mycore dpath csr regs_mhpmevet_0", false,-1, 63,0); tracep->declQuad(c+439,"simTop mycore dpath csr regs_mhpmevet_1", false,-1, 63,0); tracep->declQuad(c+441,"simTop mycore dpath csr regs_mhpmevet_2", false,-1, 63,0); tracep->declQuad(c+443,"simTop mycore dpath csr regs_mhpmevet_3", false,-1, 63,0); tracep->declQuad(c+445,"simTop mycore dpath csr regs_mhpmevet_4", false,-1, 63,0); tracep->declQuad(c+447,"simTop mycore dpath csr regs_mhpmevet_5", false,-1, 63,0); tracep->declQuad(c+449,"simTop mycore dpath csr regs_mhpmevet_6", false,-1, 63,0); tracep->declQuad(c+451,"simTop mycore dpath csr regs_mhpmevet_7", false,-1, 63,0); tracep->declQuad(c+453,"simTop mycore dpath csr regs_mhpmevet_8", false,-1, 63,0); tracep->declQuad(c+455,"simTop mycore dpath csr regs_mhpmevet_9", false,-1, 63,0); tracep->declQuad(c+457,"simTop mycore dpath csr regs_mhpmevet_10", false,-1, 63,0); tracep->declQuad(c+459,"simTop mycore dpath csr regs_mhpmevet_11", false,-1, 63,0); tracep->declQuad(c+461,"simTop mycore dpath csr regs_mhpmevet_12", false,-1, 63,0); tracep->declQuad(c+463,"simTop mycore dpath csr regs_mhpmevet_13", false,-1, 63,0); tracep->declQuad(c+465,"simTop mycore dpath csr regs_mhpmevet_14", false,-1, 63,0); tracep->declQuad(c+467,"simTop mycore dpath csr regs_mhpmevet_15", false,-1, 63,0); tracep->declQuad(c+469,"simTop mycore dpath csr regs_mhpmevet_16", false,-1, 63,0); tracep->declQuad(c+471,"simTop mycore dpath csr regs_mhpmevet_17", false,-1, 63,0); tracep->declQuad(c+473,"simTop mycore dpath csr regs_mhpmevet_18", false,-1, 63,0); tracep->declQuad(c+475,"simTop mycore dpath csr regs_mhpmevet_19", false,-1, 63,0); tracep->declQuad(c+477,"simTop mycore dpath csr regs_mhpmevet_20", false,-1, 63,0); tracep->declQuad(c+479,"simTop mycore dpath csr regs_mhpmevet_21", false,-1, 63,0); tracep->declQuad(c+481,"simTop mycore dpath csr regs_mhpmevet_22", false,-1, 63,0); tracep->declQuad(c+483,"simTop mycore dpath csr regs_mhpmevet_23", false,-1, 63,0); tracep->declQuad(c+485,"simTop mycore dpath csr regs_mhpmevet_24", false,-1, 63,0); tracep->declQuad(c+487,"simTop mycore dpath csr regs_mhpmevet_25", false,-1, 63,0); tracep->declQuad(c+489,"simTop mycore dpath csr regs_mhpmevet_26", false,-1, 63,0); tracep->declQuad(c+491,"simTop mycore dpath csr regs_mhpmevet_27", false,-1, 63,0); tracep->declQuad(c+493,"simTop mycore dpath csr regs_mhpmevet_28", false,-1, 63,0); tracep->declBus(c+495,"simTop mycore dpath csr wire_csr_index", false,-1, 11,0); tracep->declBus(c+496,"simTop mycore dpath csr wire_csr_op", false,-1, 2,0); tracep->declBit(c+497,"simTop mycore dpath csr csr_read_only", false,-1); tracep->declBit(c+498,"simTop mycore dpath csr write_illegal", false,-1); tracep->declBit(c+499,"simTop mycore dpath csr csr_legal", false,-1); tracep->declBit(c+500,"simTop mycore dpath csr read_illegal", false,-1); tracep->declBit(c+501,"simTop mycore dpath csr exception_in_csr", false,-1); tracep->declBit(c+502,"simTop mycore dpath csr csr_read_enable", false,-1); tracep->declQuad(c+503,"simTop mycore dpath csr csr_read_data", false,-1, 63,0); tracep->declQuad(c+505,"simTop mycore dpath csr csr_write_data", false,-1, 63,0); tracep->declBit(c+507,"simTop mycore dpath csr csr_wen", false,-1); tracep->declBit(c+508,"simTop mycore dpath csr csr_isecall", false,-1); tracep->declBit(c+509,"simTop mycore dpath csr csr_isebreak", false,-1); tracep->declBit(c+510,"simTop mycore dpath csr csr_ismret", false,-1); tracep->declBit(c+511,"simTop mycore dpath csr csr_has_exception", false,-1); tracep->declBit(c+512,"simTop mycore dpath csr csr_has_interrupt", false,-1); tracep->declBus(c+513,"simTop mycore dpath csr prv_now", false,-1, 1,0); } } void VsimTop::traceRegister(VerilatedVcd* tracep) { // Body { tracep->addFullCb(&traceFullTop0, __VlSymsp); tracep->addChgCb(&traceChgTop0, __VlSymsp); tracep->addCleanupCb(&traceCleanup, __VlSymsp); } } void VsimTop::traceFullTop0(void* userp, VerilatedVcd* tracep) { VsimTop__Syms* __restrict vlSymsp = static_cast<VsimTop__Syms*>(userp); VsimTop* const __restrict vlTOPp VL_ATTR_UNUSED = vlSymsp->TOPp; // Body { vlTOPp->traceFullSub0(userp, tracep); } } void VsimTop::traceFullSub0(void* userp, VerilatedVcd* tracep) { VsimTop__Syms* __restrict vlSymsp = static_cast<VsimTop__Syms*>(userp); VsimTop* const __restrict vlTOPp VL_ATTR_UNUSED = vlSymsp->TOPp; vluint32_t* const oldp = tracep->oldp(vlSymsp->__Vm_baseCode); if (false && oldp) {} // Prevent unused // Variables WData/*127:0*/ __Vtemp62[4]; WData/*127:0*/ __Vtemp63[4]; WData/*127:0*/ __Vtemp64[4]; WData/*127:0*/ __Vtemp67[4]; WData/*127:0*/ __Vtemp68[4]; WData/*127:0*/ __Vtemp69[4]; WData/*127:0*/ __Vtemp71[4]; WData/*127:0*/ __Vtemp72[4]; WData/*127:0*/ __Vtemp73[4]; WData/*127:0*/ __Vtemp74[4]; WData/*127:0*/ __Vtemp75[4]; WData/*127:0*/ __Vtemp76[4]; WData/*127:0*/ __Vtemp77[4]; WData/*127:0*/ __Vtemp79[4]; // Body { tracep->fullQData(oldp+1,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__if_reg_pc),64); tracep->fullQData(oldp+3,(((4U == (IData)(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__exe_reg_ctrl_wb_sel)) ? vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT___T_151 : vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__alu_io_res)),64); tracep->fullBit(oldp+5,((1U == (IData)(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__exe_reg_ctrl_mem_fcn)))); tracep->fullQData(oldp+6,(vlTOPp->simTop__DOT__mycore__DOT__dpath_io_data_writeIO_addr),64); tracep->fullQData(oldp+8,(vlTOPp->simTop__DOT__mycore__DOT__dpath_io_data_writeIO_data),64); tracep->fullBit(oldp+10,((2U == (IData)(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__exe_reg_ctrl_mem_fcn)))); tracep->fullCData(oldp+11,((0xffU & (IData)(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT___T_235))),8); tracep->fullBit(oldp+12,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__wb_reg_valid)); tracep->fullQData(oldp+13,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__regfile__DOT__regfile [0U]),64); tracep->fullQData(oldp+15,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__regfile__DOT__regfile [1U]),64); tracep->fullQData(oldp+17,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__regfile__DOT__regfile [2U]),64); tracep->fullQData(oldp+19,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__regfile__DOT__regfile [3U]),64); tracep->fullQData(oldp+21,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__regfile__DOT__regfile [4U]),64); tracep->fullQData(oldp+23,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__regfile__DOT__regfile [5U]),64); tracep->fullQData(oldp+25,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__regfile__DOT__regfile [6U]),64); tracep->fullQData(oldp+27,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__regfile__DOT__regfile [7U]),64); tracep->fullQData(oldp+29,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__regfile__DOT__regfile [8U]),64); tracep->fullQData(oldp+31,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__regfile__DOT__regfile [9U]),64); tracep->fullQData(oldp+33,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__regfile__DOT__regfile [0xaU]),64); tracep->fullQData(oldp+35,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__regfile__DOT__regfile [0xbU]),64); tracep->fullQData(oldp+37,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__regfile__DOT__regfile [0xcU]),64); tracep->fullQData(oldp+39,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__regfile__DOT__regfile [0xdU]),64); tracep->fullQData(oldp+41,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__regfile__DOT__regfile [0xeU]),64); tracep->fullQData(oldp+43,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__regfile__DOT__regfile [0xfU]),64); tracep->fullQData(oldp+45,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__regfile__DOT__regfile [0x10U]),64); tracep->fullQData(oldp+47,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__regfile__DOT__regfile [0x11U]),64); tracep->fullQData(oldp+49,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__regfile__DOT__regfile [0x12U]),64); tracep->fullQData(oldp+51,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__regfile__DOT__regfile [0x13U]),64); tracep->fullQData(oldp+53,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__regfile__DOT__regfile [0x14U]),64); tracep->fullQData(oldp+55,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__regfile__DOT__regfile [0x15U]),64); tracep->fullQData(oldp+57,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__regfile__DOT__regfile [0x16U]),64); tracep->fullQData(oldp+59,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__regfile__DOT__regfile [0x17U]),64); tracep->fullQData(oldp+61,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__regfile__DOT__regfile [0x18U]),64); tracep->fullQData(oldp+63,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__regfile__DOT__regfile [0x19U]),64); tracep->fullQData(oldp+65,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__regfile__DOT__regfile [0x1aU]),64); tracep->fullQData(oldp+67,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__regfile__DOT__regfile [0x1bU]),64); tracep->fullQData(oldp+69,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__regfile__DOT__regfile [0x1cU]),64); tracep->fullQData(oldp+71,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__regfile__DOT__regfile [0x1dU]),64); tracep->fullQData(oldp+73,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__regfile__DOT__regfile [0x1eU]),64); tracep->fullQData(oldp+75,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__regfile__DOT__regfile [0x1fU]),64); tracep->fullQData(oldp+77,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__wb_reg_pc),64); tracep->fullQData(oldp+79,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst),64); tracep->fullBit(oldp+81,(vlTOPp->simTop__DOT__mycore__DOT__dpath_io_dat_exe_br_eq)); tracep->fullBit(oldp+82,(vlTOPp->simTop__DOT__mycore__DOT__dpath_io_dat_exe_br_lt)); tracep->fullBit(oldp+83,(vlTOPp->simTop__DOT__mycore__DOT__dpath_io_dat_exe_br_ltu)); tracep->fullCData(oldp+84,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__exe_reg_ctrl_br_type),4); tracep->fullBit(oldp+85,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr_io_is_redir)); tracep->fullBit(oldp+86,(vlTOPp->simTop__DOT__mycore__DOT__cpath__DOT__stall)); tracep->fullCData(oldp+87,(vlTOPp->simTop__DOT__mycore__DOT__cpath_io_ctl_exe_pc_sel),2); tracep->fullCData(oldp+88,(((0x3003ULL == (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) ? 0U : ((0x2003ULL == (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) ? 0U : ((0x6003ULL == (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) ? 0U : ((3ULL == (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) ? 0U : (IData)(vlTOPp->simTop__DOT__mycore__DOT__cpath__DOT___T_294)))))),4); tracep->fullBit(oldp+89,(vlTOPp->simTop__DOT__mycore__DOT__cpath_io_ctl_if_kill)); tracep->fullBit(oldp+90,((0U != (IData)(vlTOPp->simTop__DOT__mycore__DOT__cpath_io_ctl_exe_pc_sel)))); tracep->fullCData(oldp+91,(vlTOPp->simTop__DOT__mycore__DOT__cpath_io_ctl_op1_sel),2); tracep->fullCData(oldp+92,(vlTOPp->simTop__DOT__mycore__DOT__cpath_io_ctl_op2_sel),3); tracep->fullCData(oldp+93,(((0x3003ULL == (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) ? 0U : (IData)(vlTOPp->simTop__DOT__mycore__DOT__cpath__DOT___T_667))),5); tracep->fullCData(oldp+94,(((0x3003ULL == (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) ? 1U : ((0x2003ULL == (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) ? 1U : ((0x6003ULL == (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) ? 1U : ((3ULL == (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) ? 1U : ((0x4003ULL == (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) ? 1U : ((0x1003ULL == (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) ? 1U : ((0x5003ULL == (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) ? 1U : ((0x3023ULL == (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) ? 0U : (IData)(vlTOPp->simTop__DOT__mycore__DOT__cpath__DOT___T_734)))))))))),3); tracep->fullBit(oldp+95,(((0x3003ULL == (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) | ((0x2003ULL == (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) | ((0x6003ULL == (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) | ((3ULL == (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) | ((0x4003ULL == (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) | ((0x1003ULL == (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) | ((0x5003ULL == (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) | ((0x3023ULL != (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) & ((0x2023ULL != (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) & ((0x23ULL != (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) & ((0x1023ULL != (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) & ((0x17ULL == (0x7fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) | ((0x37ULL == (0x7fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) | ((0x13ULL == (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) | ((0x7013ULL == (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) | (IData)(vlTOPp->simTop__DOT__mycore__DOT__cpath__DOT___T_801)))))))))))))))))); tracep->fullCData(oldp+96,(((0x3003ULL == (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) ? 1U : (IData)(vlTOPp->simTop__DOT__mycore__DOT__cpath__DOT___T_963))),2); tracep->fullCData(oldp+97,(((0x3003ULL == (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) ? 0xffU : ((0x2003ULL == (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) ? 0xffU : ((0x6003ULL == (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) ? 0xffU : ((3ULL == (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) ? 0xffU : ((0x4003ULL == (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) ? 0xffU : ((0x1003ULL == (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) ? 0xffU : ((0x5003ULL == (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) ? 0xffU : ((0x3023ULL == (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) ? 0xffU : ((0x2023ULL == (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) ? 0xfU : ((0x23ULL == (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) ? 1U : ((0x1023ULL == (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) ? 3U : 0xffU)))))))))))),8); tracep->fullCData(oldp+98,(((0x3003ULL == (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) ? 6U : ((0x2003ULL == (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) ? 4U : ((0x6003ULL == (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) ? 5U : ((3ULL == (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) ? 0U : ((0x4003ULL == (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) ? 1U : ((0x1003ULL == (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) ? 2U : ((0x5003ULL == (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) ? 3U : 0U)))))))),3); tracep->fullCData(oldp+99,(((IData)(vlTOPp->simTop__DOT__mycore__DOT__cpath__DOT___T_1295) ? 1U : (IData)(vlTOPp->simTop__DOT__mycore__DOT__cpath__DOT__cs0_7))),3); tracep->fullBit(oldp+100,(((IData)(vlTOPp->simTop__DOT__mycore__DOT__cpath__DOT__cs0_8) | (IData)(vlTOPp->simTop__DOT__mycore__DOT__cpath__DOT___T_1313)))); tracep->fullBit(oldp+101,(((0x3003ULL == (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) | ((0x2003ULL == (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) | ((0x6003ULL == (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) | ((3ULL == (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) | ((0x4003ULL == (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) | ((0x1003ULL == (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) | ((0x5003ULL == (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) | ((0x3023ULL == (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) | ((0x2023ULL == (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) | (IData)(vlTOPp->simTop__DOT__mycore__DOT__cpath__DOT___T_511)))))))))))); tracep->fullBit(oldp+102,(((0x3003ULL != (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) & ((0x2003ULL != (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) & ((0x6003ULL != (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) & ((3ULL != (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) & ((0x4003ULL != (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) & ((0x1003ULL != (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) & ((0x5003ULL != (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) & ((0x3023ULL == (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) | ((0x2023ULL == (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) | (IData)(vlTOPp->simTop__DOT__mycore__DOT__cpath__DOT___T_585)))))))))))); tracep->fullBit(oldp+103,(((0x3003ULL == (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) | ((0x2003ULL == (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) | ((0x6003ULL == (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) | ((3ULL == (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) | ((0x4003ULL == (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) | ((0x1003ULL == (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) | (IData)(vlTOPp->simTop__DOT__mycore__DOT__cpath__DOT___T_884))))))))); tracep->fullCData(oldp+104,(vlTOPp->simTop__DOT__mycore__DOT__cpath__DOT__cs0_7),3); tracep->fullBit(oldp+105,(vlTOPp->simTop__DOT__mycore__DOT__cpath__DOT__cs0_8)); tracep->fullBit(oldp+106,(((IData)(vlTOPp->simTop__DOT__mycore__DOT__cpath__DOT___T_1288) | (IData)(vlTOPp->simTop__DOT__mycore__DOT__cpath__DOT___T_1289)))); tracep->fullCData(oldp+107,((0x1fU & (IData)( (vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst >> 0xfU)))),5); tracep->fullCData(oldp+108,((0x1fU & (IData)( (vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst >> 0x14U)))),5); tracep->fullCData(oldp+109,((0x1fU & (IData)( (vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst >> 7U)))),5); tracep->fullBit(oldp+110,(((0U == (IData)(vlTOPp->simTop__DOT__mycore__DOT__cpath_io_ctl_exe_pc_sel)) & ((0x3003ULL == (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) | ((0x2003ULL == (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) | ((0x6003ULL == (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) | ((3ULL == (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) | ((0x4003ULL == (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) | ((0x1003ULL == (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) | ((0x5003ULL == (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) | ((0x3023ULL == (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) | ((0x2023ULL == (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) | (IData)(vlTOPp->simTop__DOT__mycore__DOT__cpath__DOT___T_511))))))))))))); tracep->fullBit(oldp+111,(((0U == (IData)(vlTOPp->simTop__DOT__mycore__DOT__cpath_io_ctl_exe_pc_sel)) & ((0x3003ULL != (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) & ((0x2003ULL != (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) & ((0x6003ULL != (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) & ((3ULL != (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) & ((0x4003ULL != (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) & ((0x1003ULL != (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) & ((0x5003ULL != (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) & ((0x3023ULL == (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) | ((0x2023ULL == (0x707fULL & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst)) | (IData)(vlTOPp->simTop__DOT__mycore__DOT__cpath__DOT___T_585))))))))))))); tracep->fullCData(oldp+112,(vlTOPp->simTop__DOT__mycore__DOT__cpath__DOT__exe_reg_wbaddr),5); tracep->fullBit(oldp+113,(vlTOPp->simTop__DOT__mycore__DOT__cpath__DOT__exe_reg_is_csr)); tracep->fullBit(oldp+114,(vlTOPp->simTop__DOT__mycore__DOT__cpath__DOT__exe_inst_is_load)); tracep->fullQData(oldp+115,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__regfile_io_rs1_data),64); tracep->fullQData(oldp+117,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__regfile_io_rs2_data),64); tracep->fullCData(oldp+119,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__wb_reg_wbaddr),5); tracep->fullQData(oldp+120,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__wb_reg_wbdata),64); tracep->fullBit(oldp+122,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__wb_reg_ctrl_rf_wen)); tracep->fullQData(oldp+123,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__exe_alu_op1),64); tracep->fullQData(oldp+125,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__brjmp_offset),64); tracep->fullCData(oldp+127,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__exe_reg_ctrl_alu_fun),5); tracep->fullQData(oldp+128,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__alu_io_res),64); tracep->fullBit(oldp+130,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__alu_io_stall)); tracep->fullIData(oldp+131,((IData)(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__mem_reg_inst)),32); tracep->fullCData(oldp+132,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__mem_reg_ctrl_csr_cmd),3); tracep->fullQData(oldp+133,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__mem_reg_alu_out),64); tracep->fullQData(oldp+135,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__mem_reg_pc),64); tracep->fullQData(oldp+137,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__exe_reg_pc),64); tracep->fullQData(oldp+139,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_pc),64); tracep->fullBit(oldp+141,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_valid)); tracep->fullBit(oldp+142,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__exe_reg_valid)); tracep->fullQData(oldp+143,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__exe_reg_inst),64); tracep->fullCData(oldp+145,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__exe_reg_wbaddr),5); tracep->fullQData(oldp+146,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__exe_reg_rs2_data),64); tracep->fullCData(oldp+148,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__exe_reg_ctrl_wb_sel),3); tracep->fullBit(oldp+149,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__exe_reg_ctrl_rf_wen)); tracep->fullCData(oldp+150,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__exe_reg_ctrl_mem_fcn),2); tracep->fullCData(oldp+151,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__exe_reg_ctrl_mem_typ),8); tracep->fullCData(oldp+152,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__exe_reg_ctrl_mem_wid),3); tracep->fullCData(oldp+153,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__exe_reg_ctrl_csr_cmd),3); tracep->fullBit(oldp+154,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__mem_reg_valid)); tracep->fullQData(oldp+155,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__mem_reg_inst),64); tracep->fullCData(oldp+157,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__mem_reg_wbaddr),5); tracep->fullBit(oldp+158,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__mem_reg_ctrl_rf_wen)); tracep->fullCData(oldp+159,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__mem_reg_ctrl_wb_sel),3); tracep->fullCData(oldp+160,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__mem_reg_ctrl_mem_wid),3); tracep->fullQData(oldp+161,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__mem_reg_dram_data),64); tracep->fullQData(oldp+163,((4ULL + vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__if_reg_pc)),64); tracep->fullQData(oldp+165,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__exe_brjmp_target),64); tracep->fullQData(oldp+167,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__exe_adder_out),64); tracep->fullQData(oldp+169,(((IData)(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT___T_22) ? vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__if_reg_pc : ((0U == (IData)(vlTOPp->simTop__DOT__mycore__DOT__cpath_io_ctl_exe_pc_sel)) ? (4ULL + vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__if_reg_pc) : ((1U == (IData)(vlTOPp->simTop__DOT__mycore__DOT__cpath_io_ctl_exe_pc_sel)) ? vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__exe_brjmp_target : ((2U == (IData)(vlTOPp->simTop__DOT__mycore__DOT__cpath_io_ctl_exe_pc_sel)) ? vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__exe_adder_out : 0x4033ULL))))),64); tracep->fullSData(oldp+171,((0xfffU & (IData)( (vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst >> 0x14U)))),12); tracep->fullSData(oldp+172,(((0xfe0U & ((IData)( (vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst >> 0x19U)) << 5U)) | (0x1fU & (IData)( (vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst >> 7U))))),12); tracep->fullSData(oldp+173,(((0x800U & ((IData)( (vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst >> 0x1fU)) << 0xbU)) | ((0x400U & ((IData)( (vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst >> 7U)) << 0xaU)) | ((0x3f0U & ((IData)( (vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst >> 0x19U)) << 4U)) | (0xfU & (IData)( (vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst >> 8U))))))),12); tracep->fullIData(oldp+174,((0xfffffU & (IData)( (vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst >> 0xcU)))),20); tracep->fullIData(oldp+175,(((0x80000U & ((IData)( (vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst >> 0x1fU)) << 0x13U)) | ((0x7f800U & ((IData)((vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst >> 0xcU)) << 0xbU)) | ((0x400U & ((IData)( (vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst >> 0x14U)) << 0xaU)) | (0x3ffU & (IData)( (vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst >> 0x15U))))))),20); tracep->fullIData(oldp+176,((0x1fU & (IData)( (vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst >> 0xfU)))),32); tracep->fullQData(oldp+177,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__imm_itype_sext),64); tracep->fullQData(oldp+179,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__imm_stype_sext),64); tracep->fullQData(oldp+181,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__imm_sbtype_sext),64); tracep->fullQData(oldp+183,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__imm_utype_sext),64); tracep->fullQData(oldp+185,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__imm_ujtype_sext),64); tracep->fullQData(oldp+187,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_alu_op2),64); tracep->fullQData(oldp+189,(((0U == (IData)(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__mem_reg_ctrl_mem_wid)) ? vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT___T_174 : ((1U == (IData)(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__mem_reg_ctrl_mem_wid)) ? (QData)((IData)( (0xffU & (IData)(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__mem_reg_dram_data)))) : ((2U == (IData)(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__mem_reg_ctrl_mem_wid)) ? vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT___T_184 : ((3U == (IData)(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__mem_reg_ctrl_mem_wid)) ? (QData)((IData)( (0xffffU & (IData)(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__mem_reg_dram_data)))) : ((4U == (IData)(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__mem_reg_ctrl_mem_wid)) ? vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT___T_194 : ((5U == (IData)(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__mem_reg_ctrl_mem_wid)) ? (QData)((IData)(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__mem_reg_dram_data)) : vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__mem_reg_dram_data))))))),64); tracep->fullQData(oldp+191,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__mem_wbdata),64); tracep->fullQData(oldp+193,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__exe_alu_out),64); tracep->fullQData(oldp+195,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_rs1_data),64); tracep->fullQData(oldp+197,(((2U == (IData)(vlTOPp->simTop__DOT__mycore__DOT__cpath_io_ctl_op1_sel)) ? (QData)((IData)( (0x1fU & (IData)( (vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst >> 0xfU))))) : ((1U == (IData)(vlTOPp->simTop__DOT__mycore__DOT__cpath_io_ctl_op1_sel)) ? vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_pc : ((3U == (IData)(vlTOPp->simTop__DOT__mycore__DOT__cpath_io_ctl_op1_sel)) ? (QData)((IData)(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_rs1_data)) : vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_rs1_data)))),64); tracep->fullQData(oldp+199,(((IData)(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT___T_105) ? vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__exe_alu_out : ((IData)(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT___T_111) ? vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__mem_wbdata : ((IData)(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT___T_117) ? vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__wb_reg_wbdata : vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_alu_op2)))),64); tracep->fullQData(oldp+201,((4ULL + vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__exe_reg_pc)),64); tracep->fullQData(oldp+203,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__regfile__DOT__regfile[0]),64); tracep->fullQData(oldp+205,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__regfile__DOT__regfile[1]),64); tracep->fullQData(oldp+207,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__regfile__DOT__regfile[2]),64); tracep->fullQData(oldp+209,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__regfile__DOT__regfile[3]),64); tracep->fullQData(oldp+211,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__regfile__DOT__regfile[4]),64); tracep->fullQData(oldp+213,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__regfile__DOT__regfile[5]),64); tracep->fullQData(oldp+215,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__regfile__DOT__regfile[6]),64); tracep->fullQData(oldp+217,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__regfile__DOT__regfile[7]),64); tracep->fullQData(oldp+219,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__regfile__DOT__regfile[8]),64); tracep->fullQData(oldp+221,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__regfile__DOT__regfile[9]),64); tracep->fullQData(oldp+223,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__regfile__DOT__regfile[10]),64); tracep->fullQData(oldp+225,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__regfile__DOT__regfile[11]),64); tracep->fullQData(oldp+227,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__regfile__DOT__regfile[12]),64); tracep->fullQData(oldp+229,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__regfile__DOT__regfile[13]),64); tracep->fullQData(oldp+231,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__regfile__DOT__regfile[14]),64); tracep->fullQData(oldp+233,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__regfile__DOT__regfile[15]),64); tracep->fullQData(oldp+235,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__regfile__DOT__regfile[16]),64); tracep->fullQData(oldp+237,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__regfile__DOT__regfile[17]),64); tracep->fullQData(oldp+239,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__regfile__DOT__regfile[18]),64); tracep->fullQData(oldp+241,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__regfile__DOT__regfile[19]),64); tracep->fullQData(oldp+243,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__regfile__DOT__regfile[20]),64); tracep->fullQData(oldp+245,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__regfile__DOT__regfile[21]),64); tracep->fullQData(oldp+247,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__regfile__DOT__regfile[22]),64); tracep->fullQData(oldp+249,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__regfile__DOT__regfile[23]),64); tracep->fullQData(oldp+251,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__regfile__DOT__regfile[24]),64); tracep->fullQData(oldp+253,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__regfile__DOT__regfile[25]),64); tracep->fullQData(oldp+255,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__regfile__DOT__regfile[26]),64); tracep->fullQData(oldp+257,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__regfile__DOT__regfile[27]),64); tracep->fullQData(oldp+259,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__regfile__DOT__regfile[28]),64); tracep->fullQData(oldp+261,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__regfile__DOT__regfile[29]),64); tracep->fullQData(oldp+263,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__regfile__DOT__regfile[30]),64); tracep->fullQData(oldp+265,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__regfile__DOT__regfile[31]),64); tracep->fullQData(oldp+267,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__regfile__DOT__regfile [(0x1fU & (IData)( (vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst >> 0xfU)))]),64); tracep->fullQData(oldp+269,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__regfile__DOT__regfile [(0x1fU & (IData)( (vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__dec_reg_inst >> 0x14U)))]),64); tracep->fullBit(oldp+271,(((IData)(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__wb_reg_ctrl_rf_wen) & (0U != (IData)(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__wb_reg_wbaddr))))); tracep->fullBit(oldp+272,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__alu__DOT__mdu_io_start)); tracep->fullBit(oldp+273,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__alu__DOT__mdu_io_stall_req)); __Vtemp62[0U] = 1U; __Vtemp62[1U] = 0U; __Vtemp62[2U] = 0U; __Vtemp62[3U] = 0U; __Vtemp63[0U] = (~ vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__alu__DOT__mdu__DOT__res[0U]); __Vtemp63[1U] = (~ vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__alu__DOT__mdu__DOT__res[1U]); __Vtemp63[2U] = (~ vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__alu__DOT__mdu__DOT__res[2U]); __Vtemp63[3U] = (~ vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__alu__DOT__mdu__DOT__res[3U]); VL_ADD_W(4, __Vtemp64, __Vtemp62, __Vtemp63); __Vtemp67[0U] = 1U; __Vtemp67[1U] = 0U; __Vtemp67[2U] = 0U; __Vtemp67[3U] = 0U; __Vtemp68[0U] = (~ vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__alu__DOT__mdu__DOT__res[0U]); __Vtemp68[1U] = (~ vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__alu__DOT__mdu__DOT__res[1U]); __Vtemp68[2U] = (~ vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__alu__DOT__mdu__DOT__res[2U]); __Vtemp68[3U] = (~ vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__alu__DOT__mdu__DOT__res[3U]); VL_ADD_W(4, __Vtemp69, __Vtemp67, __Vtemp68); tracep->fullQData(oldp+274,(((IData)(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__alu__DOT__mdu__DOT__is_mult) ? ((0x19U == (IData)(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__exe_reg_ctrl_alu_fun)) ? vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__alu__DOT__mdu__DOT___T_268 : ((0x14U == (IData)(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__exe_reg_ctrl_alu_fun)) ? (((QData)((IData)( vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__alu__DOT__mdu__DOT__res[3U])) << 0x20U) | (QData)((IData)( vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__alu__DOT__mdu__DOT__res[2U]))) : ((0x13U == (IData)(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__exe_reg_ctrl_alu_fun)) ? (((QData)((IData)( ((1U & (IData)( (vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__exe_alu_op1 >> 0x3fU))) ? __Vtemp64[3U] : vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__alu__DOT__mdu__DOT__res[3U]))) << 0x20U) | (QData)((IData)( ((1U & (IData)( (vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__exe_alu_op1 >> 0x3fU))) ? __Vtemp64[2U] : vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__alu__DOT__mdu__DOT__res[2U])))) : ((0x12U == (IData)(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__exe_reg_ctrl_alu_fun)) ? (((QData)((IData)( ((IData)(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__alu__DOT__mdu__DOT___T_153) ? vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__alu__DOT__mdu__DOT__res[3U] : __Vtemp69[3U]))) << 0x20U) | (QData)((IData)( ((IData)(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__alu__DOT__mdu__DOT___T_153) ? vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__alu__DOT__mdu__DOT__res[2U] : __Vtemp69[2U])))) : ((0xdU == (IData)(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__exe_reg_ctrl_alu_fun)) ? (((QData)((IData)( vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__alu__DOT__mdu__DOT__res[1U])) << 0x20U) | (QData)((IData)( vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__alu__DOT__mdu__DOT__res[0U]))) : vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__alu__DOT__mdu__DOT___T_268))))) : ((0x10U == (IData)(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__exe_reg_ctrl_alu_fun)) ? ((0U != (IData)(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__brjmp_offset)) ? (((QData)((IData)( ((0x80000000U & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__alu__DOT__mdu__DOT__res[2U]) ? 0xffffffffU : 0U))) << 0x20U) | (QData)((IData)( vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__alu__DOT__mdu__DOT__res[2U]))) : vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__exe_alu_op1) : ((0xfU == (IData)(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__exe_reg_ctrl_alu_fun)) ? ((0U != (IData)(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__brjmp_offset)) ? (((QData)((IData)( ((0x80000000U & vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__alu__DOT__mdu__DOT__res_remsw) ? 0xffffffffU : 0U))) << 0x20U) | (QData)((IData)(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__alu__DOT__mdu__DOT__res_remsw))) : vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__exe_alu_op1) : vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__alu__DOT__mdu__DOT___T_405)))),64); tracep->fullCData(oldp+276,((0x3fU & (IData)(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__brjmp_offset))),6); tracep->fullBit(oldp+277,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__alu__DOT__use_mdu)); tracep->fullQData(oldp+278,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__alu__DOT__mdu__DOT__last_a),64); tracep->fullQData(oldp+280,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__alu__DOT__mdu__DOT__last_b),64); tracep->fullCData(oldp+282,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__alu__DOT__mdu__DOT__last_op),5); tracep->fullBit(oldp+283,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__alu__DOT__mdu__DOT__is_mult)); tracep->fullWData(oldp+284,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__alu__DOT__mdu__DOT__res),128); tracep->fullCData(oldp+288,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__alu__DOT__mdu__DOT__mult_cnt),7); tracep->fullCData(oldp+289,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__alu__DOT__mdu__DOT__div_cnt),7); tracep->fullBit(oldp+290,((1U & (IData)((vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__exe_alu_op1 >> 0x3fU))))); tracep->fullBit(oldp+291,((1U & (IData)((vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__exe_alu_op1 >> 0x1fU))))); tracep->fullQData(oldp+292,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__alu__DOT__mdu__DOT__abs_a),64); tracep->fullBit(oldp+294,((1U & (IData)((vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__brjmp_offset >> 0x3fU))))); tracep->fullBit(oldp+295,((1U & (IData)((vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__brjmp_offset >> 0x1fU))))); tracep->fullQData(oldp+296,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__alu__DOT__mdu__DOT__abs_b),64); __Vtemp71[0U] = 1U; __Vtemp71[1U] = 0U; __Vtemp71[2U] = 0U; __Vtemp71[3U] = 0U; __Vtemp72[0U] = (~ vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__alu__DOT__mdu__DOT__res[0U]); __Vtemp72[1U] = (~ vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__alu__DOT__mdu__DOT__res[1U]); __Vtemp72[2U] = (~ vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__alu__DOT__mdu__DOT__res[2U]); __Vtemp72[3U] = (~ vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__alu__DOT__mdu__DOT__res[3U]); VL_ADD_W(4, __Vtemp73, __Vtemp71, __Vtemp72); if (vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__alu__DOT__mdu__DOT___T_153) { __Vtemp74[0U] = vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__alu__DOT__mdu__DOT__res[0U]; __Vtemp74[1U] = vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__alu__DOT__mdu__DOT__res[1U]; __Vtemp74[2U] = vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__alu__DOT__mdu__DOT__res[2U]; __Vtemp74[3U] = vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__alu__DOT__mdu__DOT__res[3U]; } else { __Vtemp74[0U] = __Vtemp73[0U]; __Vtemp74[1U] = __Vtemp73[1U]; __Vtemp74[2U] = __Vtemp73[2U]; __Vtemp74[3U] = __Vtemp73[3U]; } tracep->fullWData(oldp+298,(__Vtemp74),128); __Vtemp75[0U] = 1U; __Vtemp75[1U] = 0U; __Vtemp75[2U] = 0U; __Vtemp75[3U] = 0U; __Vtemp76[0U] = (~ vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__alu__DOT__mdu__DOT__res[0U]); __Vtemp76[1U] = (~ vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__alu__DOT__mdu__DOT__res[1U]); __Vtemp76[2U] = (~ vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__alu__DOT__mdu__DOT__res[2U]); __Vtemp76[3U] = (~ vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__alu__DOT__mdu__DOT__res[3U]); VL_ADD_W(4, __Vtemp77, __Vtemp75, __Vtemp76); if ((1U & (IData)((vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__exe_alu_op1 >> 0x3fU)))) { __Vtemp79[0U] = __Vtemp77[0U]; __Vtemp79[1U] = __Vtemp77[1U]; __Vtemp79[2U] = __Vtemp77[2U]; __Vtemp79[3U] = __Vtemp77[3U]; } else { __Vtemp79[0U] = vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__alu__DOT__mdu__DOT__res[0U]; __Vtemp79[1U] = vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__alu__DOT__mdu__DOT__res[1U]; __Vtemp79[2U] = vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__alu__DOT__mdu__DOT__res[2U]; __Vtemp79[3U] = vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__alu__DOT__mdu__DOT__res[3U]; } tracep->fullWData(oldp+302,(__Vtemp79),128); tracep->fullQData(oldp+306,(((IData)(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__alu__DOT__mdu__DOT___T_153) ? (((QData)((IData)( vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__alu__DOT__mdu__DOT__res[1U])) << 0x20U) | (QData)((IData)( vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__alu__DOT__mdu__DOT__res[0U]))) : (1ULL + (~ (((QData)((IData)( vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__alu__DOT__mdu__DOT__res[1U])) << 0x20U) | (QData)((IData)( vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__alu__DOT__mdu__DOT__res[0U]))))))),64); tracep->fullQData(oldp+308,(((1U & (IData)( (vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__exe_alu_op1 >> 0x3fU))) ? (1ULL + (~ (((QData)((IData)( vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__alu__DOT__mdu__DOT__res[3U])) << 0x20U) | (QData)((IData)( vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__alu__DOT__mdu__DOT__res[2U]))))) : (((QData)((IData)( vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__alu__DOT__mdu__DOT__res[3U])) << 0x20U) | (QData)((IData)( vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__alu__DOT__mdu__DOT__res[2U]))))),64); tracep->fullIData(oldp+310,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__alu__DOT__mdu__DOT__res_divsw),32); tracep->fullIData(oldp+311,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__alu__DOT__mdu__DOT__res_remsw),32); tracep->fullBit(oldp+312,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__alu__DOT__mdu__DOT__last_stall_req)); tracep->fullWData(oldp+313,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__alu__DOT__mdu__DOT__front_val),65); tracep->fullWData(oldp+316,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__alu__DOT__mdu__DOT__step_result),128); tracep->fullQData(oldp+320,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__reg_mtvec),64); tracep->fullQData(oldp+322,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__reg_mepc),64); tracep->fullQData(oldp+324,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__reg_mcause),64); tracep->fullBit(oldp+326,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__reg_mie_mtip)); tracep->fullBit(oldp+327,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__reg_mie_msip)); tracep->fullBit(oldp+328,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__reg_mip_mtip)); tracep->fullBit(oldp+329,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__reg_mip_msip)); tracep->fullQData(oldp+330,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__reg_mtval),64); tracep->fullQData(oldp+332,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__reg_mscratch),64); tracep->fullCData(oldp+334,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__reg_mstatus_mpp),2); tracep->fullBit(oldp+335,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__reg_mstatus_mpie)); tracep->fullBit(oldp+336,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__reg_mstatus_mie)); tracep->fullQData(oldp+337,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__reg_pmpcfg0),64); tracep->fullQData(oldp+339,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__reg_pmpcfg1),64); tracep->fullQData(oldp+341,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__regs_pmpaddr_0),64); tracep->fullQData(oldp+343,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__regs_pmpaddr_1),64); tracep->fullQData(oldp+345,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__regs_pmpaddr_2),64); tracep->fullQData(oldp+347,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__regs_pmpaddr_3),64); tracep->fullQData(oldp+349,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__regs_pmpaddr_4),64); tracep->fullQData(oldp+351,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__regs_pmpaddr_5),64); tracep->fullQData(oldp+353,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__regs_pmpaddr_6),64); tracep->fullQData(oldp+355,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__regs_pmpaddr_7),64); tracep->fullQData(oldp+357,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__regs_pmpaddr_8),64); tracep->fullQData(oldp+359,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__regs_pmpaddr_9),64); tracep->fullQData(oldp+361,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__regs_pmpaddr_10),64); tracep->fullQData(oldp+363,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__regs_pmpaddr_11),64); tracep->fullQData(oldp+365,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__regs_pmpaddr_12),64); tracep->fullQData(oldp+367,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__regs_pmpaddr_13),64); tracep->fullQData(oldp+369,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__regs_pmpaddr_14),64); tracep->fullQData(oldp+371,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__regs_pmpaddr_15),64); tracep->fullQData(oldp+373,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__reg_mcycle),64); tracep->fullQData(oldp+375,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__reg_minstret),64); tracep->fullQData(oldp+377,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__regs_mhpmcounter_0),64); tracep->fullQData(oldp+379,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__regs_mhpmcounter_1),64); tracep->fullQData(oldp+381,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__regs_mhpmcounter_2),64); tracep->fullQData(oldp+383,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__regs_mhpmcounter_3),64); tracep->fullQData(oldp+385,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__regs_mhpmcounter_4),64); tracep->fullQData(oldp+387,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__regs_mhpmcounter_5),64); tracep->fullQData(oldp+389,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__regs_mhpmcounter_6),64); tracep->fullQData(oldp+391,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__regs_mhpmcounter_7),64); tracep->fullQData(oldp+393,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__regs_mhpmcounter_8),64); tracep->fullQData(oldp+395,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__regs_mhpmcounter_9),64); tracep->fullQData(oldp+397,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__regs_mhpmcounter_10),64); tracep->fullQData(oldp+399,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__regs_mhpmcounter_11),64); tracep->fullQData(oldp+401,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__regs_mhpmcounter_12),64); tracep->fullQData(oldp+403,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__regs_mhpmcounter_13),64); tracep->fullQData(oldp+405,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__regs_mhpmcounter_14),64); tracep->fullQData(oldp+407,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__regs_mhpmcounter_15),64); tracep->fullQData(oldp+409,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__regs_mhpmcounter_16),64); tracep->fullQData(oldp+411,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__regs_mhpmcounter_17),64); tracep->fullQData(oldp+413,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__regs_mhpmcounter_18),64); tracep->fullQData(oldp+415,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__regs_mhpmcounter_19),64); tracep->fullQData(oldp+417,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__regs_mhpmcounter_20),64); tracep->fullQData(oldp+419,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__regs_mhpmcounter_21),64); tracep->fullQData(oldp+421,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__regs_mhpmcounter_22),64); tracep->fullQData(oldp+423,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__regs_mhpmcounter_23),64); tracep->fullQData(oldp+425,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__regs_mhpmcounter_24),64); tracep->fullQData(oldp+427,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__regs_mhpmcounter_25),64); tracep->fullQData(oldp+429,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__regs_mhpmcounter_26),64); tracep->fullQData(oldp+431,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__regs_mhpmcounter_27),64); tracep->fullQData(oldp+433,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__regs_mhpmcounter_28),64); tracep->fullQData(oldp+435,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__reg_mcounterinhibit),64); tracep->fullQData(oldp+437,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__regs_mhpmevet_0),64); tracep->fullQData(oldp+439,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__regs_mhpmevet_1),64); tracep->fullQData(oldp+441,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__regs_mhpmevet_2),64); tracep->fullQData(oldp+443,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__regs_mhpmevet_3),64); tracep->fullQData(oldp+445,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__regs_mhpmevet_4),64); tracep->fullQData(oldp+447,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__regs_mhpmevet_5),64); tracep->fullQData(oldp+449,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__regs_mhpmevet_6),64); tracep->fullQData(oldp+451,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__regs_mhpmevet_7),64); tracep->fullQData(oldp+453,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__regs_mhpmevet_8),64); tracep->fullQData(oldp+455,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__regs_mhpmevet_9),64); tracep->fullQData(oldp+457,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__regs_mhpmevet_10),64); tracep->fullQData(oldp+459,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__regs_mhpmevet_11),64); tracep->fullQData(oldp+461,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__regs_mhpmevet_12),64); tracep->fullQData(oldp+463,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__regs_mhpmevet_13),64); tracep->fullQData(oldp+465,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__regs_mhpmevet_14),64); tracep->fullQData(oldp+467,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__regs_mhpmevet_15),64); tracep->fullQData(oldp+469,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__regs_mhpmevet_16),64); tracep->fullQData(oldp+471,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__regs_mhpmevet_17),64); tracep->fullQData(oldp+473,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__regs_mhpmevet_18),64); tracep->fullQData(oldp+475,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__regs_mhpmevet_19),64); tracep->fullQData(oldp+477,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__regs_mhpmevet_20),64); tracep->fullQData(oldp+479,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__regs_mhpmevet_21),64); tracep->fullQData(oldp+481,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__regs_mhpmevet_22),64); tracep->fullQData(oldp+483,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__regs_mhpmevet_23),64); tracep->fullQData(oldp+485,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__regs_mhpmevet_24),64); tracep->fullQData(oldp+487,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__regs_mhpmevet_25),64); tracep->fullQData(oldp+489,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__regs_mhpmevet_26),64); tracep->fullQData(oldp+491,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__regs_mhpmevet_27),64); tracep->fullQData(oldp+493,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__regs_mhpmevet_28),64); tracep->fullSData(oldp+495,((0xfffU & (IData)( (vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__mem_reg_inst >> 0x14U)))),12); tracep->fullCData(oldp+496,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__wire_csr_op),3); tracep->fullBit(oldp+497,((3U == (3U & (IData)( (vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__mem_reg_inst >> 0x1eU)))))); tracep->fullBit(oldp+498,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__write_illegal)); tracep->fullBit(oldp+499,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__csr_legal)); tracep->fullBit(oldp+500,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__read_illegal)); tracep->fullBit(oldp+501,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__exception_in_csr)); tracep->fullBit(oldp+502,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__csr_read_enable)); tracep->fullQData(oldp+503,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__csr_read_data),64); tracep->fullQData(oldp+505,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__csr_write_data),64); tracep->fullBit(oldp+507,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__csr_wen)); tracep->fullBit(oldp+508,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__csr_isecall)); tracep->fullBit(oldp+509,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__csr_isebreak)); tracep->fullBit(oldp+510,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__csr_ismret)); tracep->fullBit(oldp+511,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__csr_has_exception)); tracep->fullBit(oldp+512,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__csr_has_interrupt)); tracep->fullCData(oldp+513,(vlTOPp->simTop__DOT__mycore__DOT__dpath__DOT__csr__DOT__prv_now),2); tracep->fullBit(oldp+514,(vlTOPp->clock)); tracep->fullBit(oldp+515,(vlTOPp->reset)); tracep->fullQData(oldp+516,(vlTOPp->io_diffTestIO_regfile_0),64); tracep->fullQData(oldp+518,(vlTOPp->io_diffTestIO_regfile_1),64); tracep->fullQData(oldp+520,(vlTOPp->io_diffTestIO_regfile_2),64); tracep->fullQData(oldp+522,(vlTOPp->io_diffTestIO_regfile_3),64); tracep->fullQData(oldp+524,(vlTOPp->io_diffTestIO_regfile_4),64); tracep->fullQData(oldp+526,(vlTOPp->io_diffTestIO_regfile_5),64); tracep->fullQData(oldp+528,(vlTOPp->io_diffTestIO_regfile_6),64); tracep->fullQData(oldp+530,(vlTOPp->io_diffTestIO_regfile_7),64); tracep->fullQData(oldp+532,(vlTOPp->io_diffTestIO_regfile_8),64); tracep->fullQData(oldp+534,(vlTOPp->io_diffTestIO_regfile_9),64); tracep->fullQData(oldp+536,(vlTOPp->io_diffTestIO_regfile_10),64); tracep->fullQData(oldp+538,(vlTOPp->io_diffTestIO_regfile_11),64); tracep->fullQData(oldp+540,(vlTOPp->io_diffTestIO_regfile_12),64); tracep->fullQData(oldp+542,(vlTOPp->io_diffTestIO_regfile_13),64); tracep->fullQData(oldp+544,(vlTOPp->io_diffTestIO_regfile_14),64); tracep->fullQData(oldp+546,(vlTOPp->io_diffTestIO_regfile_15),64); tracep->fullQData(oldp+548,(vlTOPp->io_diffTestIO_regfile_16),64); tracep->fullQData(oldp+550,(vlTOPp->io_diffTestIO_regfile_17),64); tracep->fullQData(oldp+552,(vlTOPp->io_diffTestIO_regfile_18),64); tracep->fullQData(oldp+554,(vlTOPp->io_diffTestIO_regfile_19),64); tracep->fullQData(oldp+556,(vlTOPp->io_diffTestIO_regfile_20),64); tracep->fullQData(oldp+558,(vlTOPp->io_diffTestIO_regfile_21),64); tracep->fullQData(oldp+560,(vlTOPp->io_diffTestIO_regfile_22),64); tracep->fullQData(oldp+562,(vlTOPp->io_diffTestIO_regfile_23),64); tracep->fullQData(oldp+564,(vlTOPp->io_diffTestIO_regfile_24),64); tracep->fullQData(oldp+566,(vlTOPp->io_diffTestIO_regfile_25),64); tracep->fullQData(oldp+568,(vlTOPp->io_diffTestIO_regfile_26),64); tracep->fullQData(oldp+570,(vlTOPp->io_diffTestIO_regfile_27),64); tracep->fullQData(oldp+572,(vlTOPp->io_diffTestIO_regfile_28),64); tracep->fullQData(oldp+574,(vlTOPp->io_diffTestIO_regfile_29),64); tracep->fullQData(oldp+576,(vlTOPp->io_diffTestIO_regfile_30),64); tracep->fullQData(oldp+578,(vlTOPp->io_diffTestIO_regfile_31),64); tracep->fullQData(oldp+580,(vlTOPp->io_diffTestIO_pc),64); tracep->fullBit(oldp+582,(vlTOPp->io_diffTestIO_valid)); tracep->fullQData(oldp+583,(vlTOPp->io_coreIO_inst_readIO_addr),64); tracep->fullQData(oldp+585,(vlTOPp->io_coreIO_inst_readIO_data),64); tracep->fullBit(oldp+587,(vlTOPp->io_coreIO_inst_readIO_en)); tracep->fullQData(oldp+588,(vlTOPp->io_coreIO_data_readIO_addr),64); tracep->fullQData(oldp+590,(vlTOPp->io_coreIO_data_readIO_data),64); tracep->fullBit(oldp+592,(vlTOPp->io_coreIO_data_readIO_en)); tracep->fullQData(oldp+593,(vlTOPp->io_coreIO_data_writeIO_addr),64); tracep->fullQData(oldp+595,(vlTOPp->io_coreIO_data_writeIO_data),64); tracep->fullBit(oldp+597,(vlTOPp->io_coreIO_data_writeIO_en)); tracep->fullCData(oldp+598,(vlTOPp->io_coreIO_data_writeIO_mask),8); tracep->fullCData(oldp+599,(0U),5); tracep->fullCData(oldp+600,(1U),5); tracep->fullCData(oldp+601,(2U),5); tracep->fullCData(oldp+602,(3U),5); tracep->fullCData(oldp+603,(4U),5); tracep->fullCData(oldp+604,(5U),5); tracep->fullCData(oldp+605,(6U),5); tracep->fullCData(oldp+606,(7U),5); tracep->fullCData(oldp+607,(8U),5); tracep->fullCData(oldp+608,(9U),5); tracep->fullCData(oldp+609,(0xaU),5); tracep->fullCData(oldp+610,(0xbU),5); tracep->fullCData(oldp+611,(0xcU),5); tracep->fullCData(oldp+612,(0xdU),5); tracep->fullCData(oldp+613,(0xeU),5); tracep->fullCData(oldp+614,(0xfU),5); tracep->fullCData(oldp+615,(0x10U),5); tracep->fullCData(oldp+616,(0x11U),5); tracep->fullCData(oldp+617,(0x12U),5); tracep->fullCData(oldp+618,(0x13U),5); tracep->fullCData(oldp+619,(0x14U),5); tracep->fullCData(oldp+620,(0x15U),5); tracep->fullCData(oldp+621,(0x16U),5); tracep->fullCData(oldp+622,(0x17U),5); tracep->fullCData(oldp+623,(0x18U),5); tracep->fullCData(oldp+624,(0x19U),5); tracep->fullCData(oldp+625,(0x1aU),5); tracep->fullCData(oldp+626,(0x1bU),5); tracep->fullCData(oldp+627,(0x1cU),5); tracep->fullCData(oldp+628,(0x1dU),5); tracep->fullCData(oldp+629,(0x1eU),5); tracep->fullCData(oldp+630,(0x1fU),5); tracep->fullBit(oldp+631,(1U)); } }
[ "2846728884@qq.com" ]
2846728884@qq.com
25892cb495a32804909c9238169d3092a9f2d2ad
39b2682e2b488322469dda038c8ee3564556bb5a
/Results/Collagen/various_potentials/collagen_sim_results/collagen_anhar1/src/Eigenfunctions.hh
f50ecb2f441f285b128a88a5cb724b9bf5487568
[]
no_license
htailor/ucl_phd_thesis
8d9980c88258fa6733fdb88435985f783fa090ef
5697c1bef948ef94cbe777f0647904f60338594f
refs/heads/master
2021-01-18T18:17:50.486461
2013-12-29T21:14:53
2013-12-29T21:14:53
null
0
0
null
null
null
null
UTF-8
C++
false
false
200
hh
#ifndef INCLUDE_EIGENFUNCTIONS_HH #define INCLUDE_EIGENFUNCTIONS_HH #include <complex> using namespace std; complex<double> PSI_R(int s, double eta); complex<double> g(int r, double eta); #endif
[ "hemant_tailor_2010@hotmail.com" ]
hemant_tailor_2010@hotmail.com
3b55851e21fa7aebff5ce0d9f2448b627c5870a8
47de94fb364e9c5e7ef07c3d5a9529a7420d7e1c
/graph_trees/UV10505.cpp
08aca14c6ace0ae062cb435836df1eb8367a7b44
[]
no_license
Dainerx/Competitive-programming
5490c4acf2f82f5aa88955b5ab38083a7846b376
edb9757681d8c241b5b7c523591c1136e4ac9008
refs/heads/master
2021-01-19T22:05:40.931873
2019-05-21T15:37:07
2019-05-21T15:37:07
88,751,997
6
1
null
null
null
null
UTF-8
C++
false
false
2,739
cpp
#Bipartite Graph Check Level 2 #include <cmath> #include <climits> #include <queue> #include <vector> #include <map> #include <cstdlib> #include <fstream> #include <iomanip> #include <iostream> #include <sstream> // istringstream buffer(myString); #include <stack> #include <algorithm> #include <cstring> #include <cassert> #include <complex> using namespace std; #define MAX(a,b,c) max(a,max(b,c)) #define MIN(a,b,c) min(a,min(b,c)) #define FOR(i,a,b) for(int i=(a);i<(b);i++) #define FORJ(j,a,b) for(int j=(a);j<(b);j++) #define REV(i,b,a) for(int i=(a);i>=(b);i--) #define mp make_pair #define pb push_back #define fillTab(a,v) memset(a, v, sizeof a) #define sz(a) ((int)(a.size())) #define all(a) a.begin(), a.end() #define INDEX(arr,ind) (lower_bound(all(arr),ind)-arr.begin()) typedef vector<int> vi; typedef vector<vi> vvi; typedef pair<int, int> ii; bool mycomp(char c1, char c2) { return std::tolower(c1) < std::tolower(c2); } template<typename T, typename TT> ostream& operator<<(ostream &s, pair<T, TT> t) { return s << "(" << t.first << "," << t.second << ")"; } int n; vvi adj; int colors[300]; bool visited[300]; bool isBiPart; void enemies(int cur) { visited[cur] = true; FOR(i, 0, adj.at(cur).size()) { int v = adj[cur][i]; if (colors[v] != -1) { if (colors[v] == colors[cur]) { isBiPart = false; } } else colors[v] = 1 - colors[cur]; if (visited[v] == false) enemies(v); } return; } int main() { int M; cin >> M; while (M--) { cin >> n; adj.resize(300); fillTab(visited, false); FOR(i, 0, n) { int e; cin >> e; FORJ(j, 0, e) { int a; cin >> a; adj[i].pb(--a); adj[a].pb(i); } } int total = 0; FOR(i, 0, n) { if (visited[i] == false) { fillTab(colors, -1); isBiPart = true; colors[i] = 0; enemies(i); if (isBiPart) { int counter_0, counter_1; // counter_0 = counter_1 = 0; FOR(c, 0, n) { if (colors[c] == 0) counter_0++; else if (colors[c] == 1) counter_1++; } total += max(counter_0, counter_1); } } } cout << total; cout << endl; adj.clear(); } return 0; }
[ "noreply@github.com" ]
noreply@github.com
6cc9bd41fd28827e71bf5305b2ef184161376881
106e93bdacea5476487d220dfc763a6940babb53
/Game/hazard.cpp
bf3eed409c300f72202d8d2308598c8ede39a4e4
[]
no_license
Douglas-Pichard/Survive-It-
81381c560e5729e11440c5fb12a9ec83264fc153
c8bfdccd105ce4b596bb66bbbd008eef34e8dd44
refs/heads/master
2022-10-18T05:57:05.302716
2020-06-17T06:05:21
2020-06-17T06:05:21
266,086,920
0
0
null
null
null
null
UTF-8
C++
false
false
260
cpp
#include "hazard.h" #include "scene.h" Hazard::Hazard(std::string id) : Game_Object(id, "Texture.Lava") { _height = 50; _width = 50; _translation = Vector_2D(300, 425); } Hazard::~Hazard() { } void Hazard::simulate_AI(Uint32, Assets*, Input*, Scene*) { }
[ "7581@ait.nsw.edu.augit config user.name Douglas-Pichardgit commit -mgit config user.email 7581@ait.nsw.edu.au" ]
7581@ait.nsw.edu.augit config user.name Douglas-Pichardgit commit -mgit config user.email 7581@ait.nsw.edu.au
d4883b2f03f3de7261c835c52e92854b51682d7b
1a5d41db8c15baa889cd204a9f53aedf7acabbd2
/save.h
3009acf374f84e1ee4485a71fc81063d77adba34
[]
no_license
K-u-r-c/FizykaProjekt
b09562002a7391ed0b65f1dce009d9266475ebd2
286a38ab2f951e3ca25ed1e3ddc0728d24b720e1
refs/heads/main
2023-09-03T01:58:16.210177
2021-11-17T09:24:46
2021-11-17T09:24:46
426,578,417
0
0
null
null
null
null
UTF-8
C++
false
false
290
h
#pragma once #include <fstream> void removeDataFile(const char *filename) { remove(filename); } void saveData(double x, double y1, double y2) { std::ofstream myfile("data.txt", std::ios::out | std::ios::app); myfile << x << " " << y1 << " " << y2 << "\n"; myfile.close(); }
[ "jak.kurc@gmail.com" ]
jak.kurc@gmail.com
6b22f21b1510a1da94ef1578f17de0b383c80fab
9a3c44184a2e82d55f00bc34510aed927672e1ff
/Shadowmapping/Shadowmapping/src/executables/ScreenQuad.cpp
e6321c5d744d8063653fdd23be33644dbe5265b8
[]
no_license
Benebaby/OpenGL
0698aadf517a311c252672635a1d7531a13b386b
20c48db64e62ff5a8481ae563b3e441939acbbbb
refs/heads/master
2020-05-22T09:57:50.755897
2020-04-13T17:49:16
2020-04-13T17:49:16
183,394,550
0
0
null
null
null
null
UTF-8
C++
false
false
727
cpp
#include "ScreenQuad.h" ScreenQuad::ScreenQuad() { glGenVertexArrays(1, &VAO); glBindVertexArray(VAO); glGenBuffers(2, VBO); glBindBuffer(GL_ARRAY_BUFFER, VBO[0]); glBufferData(GL_ARRAY_BUFFER, sizeof(quadVertices), &quadVertices[0], GL_STATIC_DRAW); glEnableVertexAttribArray(0); glVertexAttribPointer(0, 2, GL_FLOAT, GL_FALSE, 0, 0); glBindBuffer(GL_ARRAY_BUFFER, VBO[1]); glBufferData(GL_ARRAY_BUFFER, sizeof(quadTexCoords), &quadTexCoords[0], GL_STATIC_DRAW); glEnableVertexAttribArray(1); glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, 0, 0); glBindBuffer(GL_ARRAY_BUFFER, 0); } void ScreenQuad::render() { glBindVertexArray(VAO); glDrawArrays(GL_TRIANGLES, 0, 6); } ScreenQuad::~ScreenQuad() { }
[ "Benedikt.Krieger@outlook.com" ]
Benedikt.Krieger@outlook.com
5a0ee9e52842472f32ae540f0fae774032e7e761
92e2aa1c7596a681be06e4c1d9c7cbae6c5c0140
/Polynomial/include/Polynomial.h
a2391f268a4eb3489074ecec62a49a1a0abc2458
[]
no_license
zxc525/zhang_xiaochen
00cf9c65abfd256f552f2a5e372876022e265040
6723cffb404e8b8829e2966e0362290610672582
refs/heads/master
2020-04-03T02:17:16.266900
2019-04-21T13:02:56
2019-04-21T13:02:56
154,952,036
0
0
null
null
null
null
UTF-8
C++
false
false
1,207
h
#ifndef POLYNOMIAL_H #define POLYNOMIAL_H #include<iostream> using namespace std; #include<iostream> struct Term{ double coef; int exp; Term * next; Term():coef(0), exp(0), next(NULL) {} Term(double _coef, int _exp = 0): coef(_coef), exp(_exp), next(NULL) {} }; class Polynomial{ Term poly; public: Polynomial() {} Polynomial(const Polynomial & rhs); Polynomial & operator + (const Polynomial & rhs); Polynomial & operator - (const Polynomial & rhs); Polynomial & operator * (const Polynomial & rhs); Polynomial & operator = (const Polynomial & rhs); Polynomial & operator += (const Polynomial & rhs); Polynomial & operator -= (const Polynomial & rhs); ~Polynomial(); void PolyClear(); int PolyLength() const; bool PolyEmpty() const; bool AddTerm(double coef, int exp); void Simplify(); Polynomial & AddPoly(const Polynomial & rhs); Polynomial & SubPoly(const Polynomial & rhs); Polynomial & MultPoly(const Polynomial & rhs); Polynomial & DivPoly(const Polynomial & rhs, Polynomial & rem); Polynomial & DivPoly(const Polynomial & rhs); void display() const; void Swap(Polynomial & rhs); private: void _Copy(const Polynomial & rhs); }; #endif // POLYNOMIAL_H
[ "1591073132@qq.com" ]
1591073132@qq.com
156c2ede88210c1cace9fb66f52b47e3425e7a8b
6ad4abd17004219e63ab4629ef9a7f62afc56246
/Jogo da Velha/Jogo da Velha/Jogo_velha.h
21919bf10114d0181edb92226c823004caccccdf
[]
no_license
LCSSchmidt/Jogo-Da-Velha-Trabalho
5da82c26f641e8a44d418e1b63f702bc1cb3418a
e0fdb8218c89492d9a8c20b92b1e90bc37642bed
refs/heads/master
2021-01-23T04:38:58.046473
2017-09-10T20:20:59
2017-09-10T20:20:59
102,450,787
0
0
null
null
null
null
ISO-8859-1
C++
false
false
2,982
h
#pragma once #include "stdafx.h" #include <iostream> using namespace std; #define TAMANHO_LINHA 3 #define TAMANHO_COLUNA 3 bool verificacao_de_esqueleto(int coluna, char linha_caracter, char mapa[TAMANHO_COLUNA][TAMANHO_LINHA]) { int A = 0; int B = 1; int C = 2; int linha = 4; if (linha_caracter == 'A') { linha = A; } else if (linha_caracter == 'B') { linha = B; } else { linha = C; } if (mapa[linha][coluna] == 'X' || mapa[linha][coluna] == 'O') { cout << "Casa já escolhida em alguma jogada anterior, escolha outra posição" << endl; return true; } return false; } void transformar_em_mapa_numerico(int mapa_inteiro[3][3], char mapa[3][3]) { for (int linha = 0; linha < 3; linha++) { for (int coluna = 0; coluna < 3; coluna++) { if (mapa[linha][coluna] == 'X') { mapa_inteiro[linha][coluna] = 1; } else if (mapa[linha][coluna] == 'O') { mapa_inteiro[linha][coluna] = 2; } } } } void atualizacao_de_esqueleto(int &jogador, int coluna, char linha, char mapa[3][3]) { switch (jogador) { case 1: if (linha == 'A') { for (int indice = 0; indice < 3; indice++) { if (coluna == indice) { mapa[0][coluna] = 'X'; } } } else if (linha == 'B') { for (int indice = 0; indice < 3; indice++) { if (coluna == indice) { mapa[1][coluna] = 'X'; } } } else { for (int indice = 0; indice < 3; indice++) { if (coluna == indice) { mapa[2][coluna] = 'X'; } } } jogador = 2; break; case 2: if (linha == 'A') { for (int indice = 0; indice < 3; indice++) { if (coluna == indice) { mapa[0][coluna] = 'O'; } } } else if (linha == 'B') { for (int indice = 0; indice < 3; indice++) { if (coluna == indice) { mapa[1][coluna] = 'O'; } } } else { for (int indice = 0; indice < 3; indice++) { if (coluna == indice) { mapa[2][coluna] = 'O'; } } } jogador = 1; break; } } void atualizacao_de_esqueleto(char &jogador, int coluna, char linha, char mapa[3][3]) { switch (jogador) { case '1': if (linha == 'A') { for (int indice = 0; indice < 3; indice++) { if (coluna == indice) { mapa[0][coluna] = 'X'; } } } else if (linha == 'B') { for (int indice = 0; indice < 3; indice++) { if (coluna == indice) { mapa[1][coluna] = 'X'; } } } else { for (int indice = 0; indice < 3; indice++) { if (coluna == indice) { mapa[2][coluna] = 'X'; } } } jogador = '2'; break; case '2': if (linha == 'A') { for (int indice = 0; indice < 3; indice++) { if (coluna == indice) { mapa[0][coluna] = 'O'; } } } else if (linha == 'B') { for (int indice = 0; indice < 3; indice++) { if (coluna == indice) { mapa[1][coluna] = 'O'; } } } else { for (int indice = 0; indice < 3; indice++) { if (coluna == indice) { mapa[2][coluna] = 'O'; } } } jogador = '1'; break; } } #pragma once
[ "stit_@LUSGO" ]
stit_@LUSGO
a232b513e4bcb885f25f21cc02c1b6d8b010cb6d
5671c626ee367c9aacb909cd76a06d2fadf941e2
/frameworks/core/components_v2/inspector/stepper_item_composed_element.cpp
5afa7370836037ce06d27ab44379363f66799458
[ "Apache-2.0" ]
permissive
openharmony/ace_ace_engine
fa3f2abad9866bbb329524fb039fa89dd9517592
c9be21d0e8cb9662d5f4f93184fdfdb538c9d4e1
refs/heads/master
2022-07-21T19:32:59.377634
2022-05-06T11:18:20
2022-05-06T11:18:20
400,083,641
2
1
null
null
null
null
UTF-8
C++
false
false
4,380
cpp
/* * Copyright (c) 2021-2022 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_v2/inspector/stepper_item_composed_element.h" #include "base/log/dump_log.h" #include "core/components/common/layout/constants.h" #include "core/components/stepper/render_stepper_item.h" #include "core/components_v2/inspector/utils.h" namespace OHOS::Ace::V2 { namespace { const std::unordered_map<std::string, std::function<std::string(const StepperItemComposedElement&)>> CREATE_JSON_MAP { { "prevLabel", [](const StepperItemComposedElement& inspector) { return inspector.GetPrevLabel(); } }, { "nextLabel", [](const StepperItemComposedElement& inspector) { return inspector.GetNextLabel(); } }, { "status", [](const StepperItemComposedElement& inspector) { return inspector.GetStatus(); } }, }; } void StepperItemComposedElement::Dump() { InspectorComposedElement::Dump(); for (const auto& value : CREATE_JSON_MAP) { DumpLog::GetInstance().AddDesc(std::string(value.first + ":").append(value.second(*this))); } } std::unique_ptr<JsonValue> StepperItemComposedElement::ToJsonObject() const { auto resultJson = InspectorComposedElement::ToJsonObject(); for (const auto& value : CREATE_JSON_MAP) { resultJson->Put(value.first.c_str(), value.second(*this).c_str()); } return resultJson; } std::string StepperItemComposedElement::GetPrevLabel() const { auto renderStepperItem = GetInspectorElement<RenderStepperItem>(StepperItemElement::TypeId()); if (!renderStepperItem) { return ""; } auto label = renderStepperItem->GetLabel(); return label.leftLabel; } std::string StepperItemComposedElement::GetNextLabel() const { auto renderStepperItem = GetInspectorElement<RenderStepperItem>(StepperItemElement::TypeId()); if (!renderStepperItem) { return ""; } auto label = renderStepperItem->GetLabel(); return label.rightLabel; } std::string StepperItemComposedElement::GetStatus() const { auto renderStepperItem = GetInspectorElement<RenderStepperItem>(StepperItemElement::TypeId()); if (!renderStepperItem) { return "ItemState.Normal"; } auto label = renderStepperItem->GetLabel(); auto status = label.initialStatus; if (status == "normal") { return "ItemState.Normal"; } else if (status == "disabled") { return "ItemState.Disabled"; } else if (status == "waiting") { return "ItemState.Waiting"; } else if (status == "skip") { return "ItemState.Skip"; } else { return "ItemState.Normal"; } } void StepperItemComposedElement::AddChildWithSlot(int32_t slot, const RefPtr<Component>& newComponent) { auto stepperItemV2 = GetContentElement<FlexElement>(FlexElement::TypeId()); if (!stepperItemV2) { LOGE("get GetStepperItemV2 failed"); return; } stepperItemV2->UpdateChildWithSlot(nullptr, newComponent, -1, -1); stepperItemV2->MarkDirty(); } void StepperItemComposedElement::UpdateChildWithSlot(int32_t slot, const RefPtr<Component>& newComponent) { auto stepperItemV2 = GetContentElement<FlexElement>(FlexElement::TypeId()); if (!stepperItemV2) { LOGE("get GetStepperItemV2 failed"); return; } auto child = stepperItemV2->GetFirstChild(); stepperItemV2->UpdateChildWithSlot(child, newComponent, -1, -1); stepperItemV2->MarkDirty(); } void StepperItemComposedElement::DeleteChildWithSlot(int32_t slot) { auto stepperItemV2 = GetContentElement<FlexElement>(FlexElement::TypeId()); if (!stepperItemV2) { LOGE("get GetStepperItemV2 failed"); return; } auto child = stepperItemV2->GetFirstChild(); stepperItemV2->UpdateChildWithSlot(child, nullptr, -1, -1); stepperItemV2->MarkDirty(); } } // namespace OHOS::Ace::V2
[ "zhuzijia@huawei.com" ]
zhuzijia@huawei.com
9daddc35be295e53daf50643c84a213e7caba84c
9505b1c216ab9044d30887be5b2612affbcb3896
/Source/TreeDrawGUI/changewidthvariation.cpp
91ffb0f98573cfccdcb365d80246534cdc668ec4
[ "BSL-1.0", "MIT" ]
permissive
Merrik44/Yggdrasil
11accdad8c38fd44a75c917029be6d6e8d3471c7
dcc44c7f4da8023ff7ff66d13caa870e8fa2c14f
refs/heads/master
2020-04-05T22:59:48.722740
2012-11-06T19:51:24
2012-11-06T19:51:24
6,003,037
0
1
null
null
null
null
UTF-8
C++
false
false
2,589
cpp
#include "changewidthvariation.h" ChangeWidthVariation::ChangeWidthVariation(WidthChanges cbo, WidthChanges cbf, QVector<long> branchesBeingModifiedIden, QVector<WidthChanges> obo, QVector<WidthChanges> obf, long id, Branch* tr) { currBranchOrig = cbo; currBranchFinal = cbf; branchIdentifiers = branchesBeingModifiedIden; otherBranchesOrig = obo; otherBranchesFinal = obf; branchIdentifier = id; setTree(tr); } void ChangeWidthVariation::apply() { Branch* tempTree = tree; setWidths(tempTree, branchIdentifier, currBranchFinal); for (int i = 0 ; i < branchIdentifiers.size() ; i++) { setWidths(tempTree, branchIdentifiers.value(i), otherBranchesFinal.value(i)); } } void ChangeWidthVariation::reverse() { Branch* tempTree = tree; //setBranchLength(tempTree, branchIdentifier, varType, origLength); setWidths(tempTree, branchIdentifier, currBranchOrig); for (int i = 0 ; i < branchIdentifiers.size() ; i++) setWidths(tempTree, branchIdentifiers.value(i), otherBranchesOrig.value(i)); //setBranchWidths(tempTree, branchIdentifiers.at(i), varType, origLengths.at(i)); } Branch* ChangeWidthVariation::getTree() { Branch* tempTree = tree; return tempTree; } void ChangeWidthVariation::setTree(Branch* tr) { Branch* tempTree = tr; tree = tempTree; } void ChangeWidthVariation::setWidths(Branch* tr, long id, WidthChanges wc) { if (tr->getIdentifier() == id) { if (tr->getIsSegment()) { tr->setCurveWidthVariation(wc.getVariation("smin"), "smin"); tr->setCurveWidthVariation(wc.getVariation("smax"), "smax"); tr->setCurveWidthVariation(wc.getVariation("emin"), "emin"); tr->setCurveWidthVariation(wc.getVariation("emax"), "emax"); } else { tr->setWidthVariation(wc.getVariation("smin"), "smin"); tr->setWidthVariation(wc.getVariation("smax"), "smax"); tr->setWidthVariation(wc.getVariation("emin"), "emin"); tr->setWidthVariation(wc.getVariation("emax"), "emax"); } } else for (int i = 0 ; i < tr->numChildren() ; i++) setWidths(tr->childAt(i), id, wc); } void ChangeWidthVariation::setBranchWidths(Branch* tr, long id, QString vt, float len) { if (tr->getIdentifier() == id) tr->setWidthVariation(len, vt); else for (int i = 0 ; i < tr->numChildren() ; i++) setBranchWidths(tr->childAt(i), id, vt, len); } QString ChangeWidthVariation::getType() { return "width"; }
[ "merrik44@live.com" ]
merrik44@live.com
e610fb0f27e2597170ddd20ee10ab6e74fd2a104
f02eeb00aab23ca323e27024f5e8ccb96610b874
/src/gcc/main.cc
5e157f717bc46f4702e8de5d47eb9e3d154c0f76
[ "MIT" ]
permissive
paule32/zwip-alpha
f1856953d51ef7e051c301e15061483c958d80d8
c82972593244b1f7979b2434e9bd373994201a85
refs/heads/main
2023-04-20T17:06:28.239430
2021-05-02T17:56:40
2021-05-02T17:56:40
362,907,674
0
0
null
null
null
null
UTF-8
C++
false
false
1,382
cc
// ------------------------------------------------------ // File : src/cross/dos/main.cc // // Autor : Jens Kallup <kallup.jens@web.de> - paule32 // License : (c) kallup.net - non-profit - 2021 // ----------------------------------------------------- # include "common.pch.hpp" using namespace kallup::String; using namespace kallup::Exception; // lambda [capture locals](arguments to lambda) std::function< void (std::wstring _text, std::wstring _title) > handleError = []( std::wstring _text, std::wstring _title) { // wchar_t s1[100] = { &text.c_str() }; // MessageBoxW(0, s1, title.c_str(), MB_OK); }; // ----------------------------------------------------- // main: EntryPoint of application. // ----------------------------------------------------- #ifdef WINDOWS #ifdef TARGET_DLL BOOL WINAPI DllMain( HINSTANCE hinstDLL , // handle to DLL module DWORD fdwReason, // reason for calling function LPVOID lpReserved) #else INT WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR pCmdLine, int nCmdShow) #endif #else int main(void) #endif { ErrorCode code = ErrorCode::success; String<Utf16> text = L"Hallo Welt!"; String<Utf16> title = L"Error"; // onError<ErrorCode, String<Utf16>, String<Utf16>>(code,text,title); #ifdef TARGET_DLL return true; #else return 0; #endif }
[ "kallup.jens@web.de" ]
kallup.jens@web.de
e5527fb3b7405b4a922006e26afb04e3100c0328
2c939787ce4bd10f49dd9626357ea3a4f7297e82
/Agar/NetMessages/NetMessages.h
69a63077658adfbcdd484b41faea896e92221c03
[]
no_license
lmsierra/Agar2.0
5899d93159e10b02e74898413b0b4612572dabf7
7e7ecc9d16b70e9f879aeb927607a512f76b2537
refs/heads/master
2021-01-23T13:32:04.702250
2017-09-07T00:31:43
2017-09-07T00:31:43
102,671,286
0
0
null
null
null
null
UTF-8
C++
false
false
3,432
h
#ifndef __NET_MESSAGE_H__ #define __NET_MESSAGE_H__ #include <vector> #include "EntityInformation.h" enum NetMessageType { MESSAGE_SNAPSHOT, MESSAGE_MOVEMENT, MESSAGE_PLAYER_JOIN, MESSAGE_EATEN, MESSAGE_FOOD_EATEN, MESSAGE_INIT, MESSAGE_DELETE_PLAYER, MESSAGE_UNKNOWN }; struct NetMessage { NetMessageType type; virtual int serialize(char* outBuff) { *reinterpret_cast< NetMessageType*>(outBuff) = type; return sizeof(NetMessage); } virtual void deserialize(char* inBuff) { type = *reinterpret_cast<NetMessageType*>(inBuff); } }; struct SnapshotMessage : public NetMessage { SnapshotMessage() { type = MESSAGE_SNAPSHOT; data = SnapshotInfo(); } SnapshotMessage(SnapshotInfo _data) { type = MESSAGE_SNAPSHOT; data = _data; } SnapshotInfo data; virtual int serialize (char* outBuff); virtual void deserialize (char* inBuff); }; struct InitMessage : public NetMessage { InitMessage(InitMessageInfo info) { type = MESSAGE_INIT; data = info; } InitMessage() { type = MESSAGE_INIT; data = InitMessageInfo(); } InitMessageInfo data; virtual int serialize (char* outBuff); virtual void deserialize (char* inBuff); }; struct MovePlayerMessage : public NetMessage { MovePlayerMessage() { type = MESSAGE_MOVEMENT; data = MovePlayerInfo(); } MovePlayerMessage(MovePlayerInfo _data) { type = MESSAGE_MOVEMENT; data = _data; } virtual int serialize(char* outBuff); virtual void deserialize(char* inBuff); MovePlayerInfo data; }; struct PlayerJoinMessage : public NetMessage { PlayerJoinMessage() { type = MESSAGE_PLAYER_JOIN; data = PlayerJoinInfo(); } PlayerJoinMessage(PlayerJoinInfo _data) { type = MESSAGE_PLAYER_JOIN; data = _data; } PlayerJoinInfo data; virtual int serialize(char* outBuff); virtual void deserialize(char* inBuff); }; struct PlayerEatenMessage : public NetMessage { PlayerEatenMessage() { type = MESSAGE_EATEN; data = PlayerEatenInfo(); } PlayerEatenMessage(PlayerEatenInfo _data) { type = MESSAGE_EATEN; data = _data; } virtual int serialize(char* outBuff); virtual void deserialize(char* inBuff); PlayerEatenInfo data; }; struct FoodEatenMessage : public NetMessage { FoodEatenMessage() { type = MESSAGE_FOOD_EATEN; data = FoodEatenInfo(); } FoodEatenMessage(FoodEatenInfo _data) { type = MESSAGE_FOOD_EATEN; data = _data; } virtual int serialize(char* outBuff); virtual void deserialize(char* inBuff); FoodEatenInfo data; }; struct DeletePlayerMessage : public NetMessage { DeletePlayerMessage() { type = MESSAGE_DELETE_PLAYER; data = DeletePlayerInfo(); } DeletePlayerMessage(DeletePlayerInfo _data) { type = MESSAGE_DELETE_PLAYER; data = _data; } virtual int serialize(char* outBuff); virtual void deserialize(char* inBuff); DeletePlayerInfo data; }; #endif /* __NET_MESSAGE_H__ */
[ "lmsierrod@gmail.com" ]
lmsierrod@gmail.com
af1080affc036ba2d3ec39518bc65fdabd3cd44a
b1544145744f9443a609d219a25ec58b5ad9898a
/Sims/math/bbox.h
72d160e5a26109b9ea433c241641d10cc53a4344
[]
no_license
mi2think/Sims
082ddb2b2f3f14ca7917e846c8bcfb237c3b8bca
38670724c2bea6723b13949537f0108a384435ea
refs/heads/master
2021-01-11T19:35:26.705960
2020-11-22T15:26:09
2020-11-22T15:26:09
66,848,431
0
0
null
null
null
null
UTF-8
C++
false
false
2,386
h
/******************************************************************** created: 2016/09/16 created: 16:9:2016 22:22 filename: D:\Code\Sims\Sims\math\bbox.h file path: D:\Code\Sims\Sims\math file base: bbox file ext: h author: mi2think@gmail.com purpose: Bounding Box/Sphere *********************************************************************/ #ifndef __BBOX_H__ #define __BBOX_H__ #include "math_fwd.h" #include "vector3.h" namespace sims { class BBox { public: Vector3f minP_; Vector3f maxP_; BBox() { Reset(); } BBox(const Vector3f& mi, const Vector3f& ma) : minP_(mi), maxP_(ma) {} BBox(const Vector3f& c, float radius) { Vector3f r(radius, radius, radius); minP_ = c - r; maxP_ = c + r; } // may restore sphere by InnerSphere BBox(const BBox& bbox) : minP_(bbox.minP_), maxP_(bbox.maxP_) {} BBox& operator=(const BBox& bbox) { minP_ = bbox.minP_; maxP_ = bbox.maxP_; return *this; } BBox& operator|=(const BBox& bbox) { return Union(bbox); } bool Valid() const { return minP_.x <= maxP_.x && minP_.y <= maxP_.y && minP_.z <= maxP_.z; } void Reset() { minP_.x = minP_.y = minP_.z = FLT_MAX; maxP_.x = maxP_.y = maxP_.z = FLT_MIN; } Vector3f Size() const { return maxP_ - minP_; } Vector3f Center() const { return (maxP_ + minP_) * 0.5f; } void Expand(float delta) { Vector3f v(delta, delta, delta); minP_ -= v; maxP_ += v; } bool Inside(const Vector3f& pt) const { return pt.x >= minP_.x && pt.x <= maxP_.x && pt.y >= minP_.y && pt.y <= maxP_.y && pt.z >= minP_.z && pt.z <= maxP_.z; } bool Overlaps(const BBox& bbox) const; float SurfaceArea() const { Vector3f size = Size(); return 2.f * (size.x * size.y + size.x * size.z + size.y * size.z); } float Volume() const { Vector3f size = Size(); return size.x * size.y * size.z; } void BoundingSphere(Vector3f& c, float& radius) const { c = Center(); radius = Inside(c) ? Distance(c, maxP_) : 0.f; } void InnerSphere(Vector3f& c, float& radius) const { c = Center(); Vector3f aSize = Size(); float d = aSize.x; if (d > aSize.y) d = aSize.y; if (d > aSize.z ) d = aSize.z; radius = Inside(c) ? 0.5f * d : 0.0f; } BBox& Union(const Vector3f& pt); BBox& Union(const BBox& bbox); BBox& Transform(const Matrix44f& m); }; bool Intersect(const BBox& bbox, const Ray& ray, float& t); } #endif
[ "mi2think@gmail.com" ]
mi2think@gmail.com
bddeb0aa1d069b6500bb03e047b7f3dce3bfd30c
15ca5b17f80e4d2990ada92c7411237f592d8501
/CheckerSquare.h
2f9787f4025363942f1f63e2b412d62aeefdbbe6
[]
no_license
muhdmirzamz/Board-Game-Collection
8e87e241769db012b728551f78ddde3c8446a938
3602e939995cc50d92f005c482ed344a7a5c613a
refs/heads/master
2020-05-18T17:19:00.136730
2014-01-15T05:18:05
2014-01-15T05:18:05
null
0
0
null
null
null
null
UTF-8
C++
false
false
222
h
#ifndef CHECKERSSQUARE_H #define CHECKERSSQUARE_H #include "Square.h" //Author Kevin Reid class CheckerSquare: public Square{ public: CheckerSquare(); bool isKing(); void promote(int player); }; #endif
[ "richard.kavanagh7@mail.dcu.ie" ]
richard.kavanagh7@mail.dcu.ie
03ef62c4494db05770426bf19af8522a8deacbf6
38c10c01007624cd2056884f25e0d6ab85442194
/remoting/base/util_unittest.cc
3f489b842e8a8ef36da8696151833ecb2c029443
[ "BSD-3-Clause" ]
permissive
zenoalbisser/chromium
6ecf37b6c030c84f1b26282bc4ef95769c62a9b2
e71f21b9b4b9b839f5093301974a45545dad2691
refs/heads/master
2022-12-25T14:23:18.568575
2016-07-14T21:49:52
2016-07-23T08:02:51
63,980,627
0
2
BSD-3-Clause
2022-12-12T12:43:41
2016-07-22T20:14:04
null
UTF-8
C++
false
false
4,056
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 <algorithm> #include "remoting/base/util.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h" namespace remoting { TEST(ReplaceLfByCrLfTest, Basic) { EXPECT_EQ("ab", ReplaceLfByCrLf("ab")); EXPECT_EQ("\r\nab", ReplaceLfByCrLf("\nab")); EXPECT_EQ("\r\nab\r\n", ReplaceLfByCrLf("\nab\n")); EXPECT_EQ("\r\nab\r\ncd", ReplaceLfByCrLf("\nab\ncd")); EXPECT_EQ("\r\nab\r\ncd\r\n", ReplaceLfByCrLf("\nab\ncd\n")); EXPECT_EQ("\r\n\r\nab\r\n\r\ncd\r\n\r\n", ReplaceLfByCrLf("\n\nab\n\ncd\n\n")); } TEST(ReplaceLfByCrLfTest, Speed) { int kLineSize = 128; std::string line(kLineSize, 'a'); line[kLineSize - 1] = '\n'; // Make a 10M string. int kLineNum = 10 * 1024 * 1024 / kLineSize; std::string buffer; buffer.resize(kLineNum * kLineSize); for (int i = 0; i < kLineNum; ++i) { memcpy(&buffer[i * kLineSize], &line[0], kLineSize); } // Convert the string. buffer = ReplaceLfByCrLf(buffer); // Check the converted string. EXPECT_EQ(static_cast<size_t>((kLineSize + 1) * kLineNum), buffer.size()); const char* p = &buffer[0]; for (int i = 0; i < kLineNum; ++i) { EXPECT_EQ(0, memcmp(&line[0], p, kLineSize - 1)); p += kLineSize - 1; EXPECT_EQ('\r', *p++); EXPECT_EQ('\n', *p++); } } TEST(ReplaceCrLfByLfTest, Basic) { EXPECT_EQ("ab", ReplaceCrLfByLf("ab")); EXPECT_EQ("\nab", ReplaceCrLfByLf("\r\nab")); EXPECT_EQ("\nab\n", ReplaceCrLfByLf("\r\nab\r\n")); EXPECT_EQ("\nab\ncd", ReplaceCrLfByLf("\r\nab\r\ncd")); EXPECT_EQ("\nab\ncd\n", ReplaceCrLfByLf("\r\nab\r\ncd\n")); EXPECT_EQ("\n\nab\n\ncd\n\n", ReplaceCrLfByLf("\r\n\r\nab\r\n\r\ncd\r\n\r\n")); EXPECT_EQ("\rab\rcd\r", ReplaceCrLfByLf("\rab\rcd\r")); } TEST(ReplaceCrLfByLfTest, Speed) { int kLineSize = 128; std::string line(kLineSize, 'a'); line[kLineSize - 2] = '\r'; line[kLineSize - 1] = '\n'; // Make a 10M string. int kLineNum = 10 * 1024 * 1024 / kLineSize; std::string buffer; buffer.resize(kLineNum * kLineSize); for (int i = 0; i < kLineNum; ++i) { memcpy(&buffer[i * kLineSize], &line[0], kLineSize); } // Convert the string. buffer = ReplaceCrLfByLf(buffer); // Check the converted string. EXPECT_EQ(static_cast<size_t>((kLineSize - 1) * kLineNum), buffer.size()); const char* p = &buffer[0]; for (int i = 0; i < kLineNum; ++i) { EXPECT_EQ(0, memcmp(&line[0], p, kLineSize - 2)); p += kLineSize - 2; EXPECT_EQ('\n', *p++); } } TEST(StringIsUtf8Test, Basic) { EXPECT_TRUE(StringIsUtf8("", 0)); EXPECT_TRUE(StringIsUtf8("\0", 1)); EXPECT_TRUE(StringIsUtf8("abc", 3)); EXPECT_TRUE(StringIsUtf8("\xc0\x80", 2)); EXPECT_TRUE(StringIsUtf8("\xe0\x80\x80", 3)); EXPECT_TRUE(StringIsUtf8("\xf0\x80\x80\x80", 4)); EXPECT_TRUE(StringIsUtf8("\xf8\x80\x80\x80\x80", 5)); EXPECT_TRUE(StringIsUtf8("\xfc\x80\x80\x80\x80\x80", 6)); // Not enough continuation characters EXPECT_FALSE(StringIsUtf8("\xc0", 1)); EXPECT_FALSE(StringIsUtf8("\xe0\x80", 2)); EXPECT_FALSE(StringIsUtf8("\xf0\x80\x80", 3)); EXPECT_FALSE(StringIsUtf8("\xf8\x80\x80\x80", 4)); EXPECT_FALSE(StringIsUtf8("\xfc\x80\x80\x80\x80", 5)); // One more continuation character than needed EXPECT_FALSE(StringIsUtf8("\xc0\x80\x80", 3)); EXPECT_FALSE(StringIsUtf8("\xe0\x80\x80\x80", 4)); EXPECT_FALSE(StringIsUtf8("\xf0\x80\x80\x80\x80", 5)); EXPECT_FALSE(StringIsUtf8("\xf8\x80\x80\x80\x80\x80", 6)); EXPECT_FALSE(StringIsUtf8("\xfc\x80\x80\x80\x80\x80\x80", 7)); // Invalid first byte EXPECT_FALSE(StringIsUtf8("\xfe\x80\x80\x80\x80\x80\x80", 7)); EXPECT_FALSE(StringIsUtf8("\xff\x80\x80\x80\x80\x80\x80", 7)); // Invalid continuation byte EXPECT_FALSE(StringIsUtf8("\xc0\x00", 2)); EXPECT_FALSE(StringIsUtf8("\xc0\x40", 2)); EXPECT_FALSE(StringIsUtf8("\xc0\xc0", 2)); } } // namespace remoting
[ "zeno.albisser@hemispherian.com" ]
zeno.albisser@hemispherian.com
5cad18403ad6a18e32e795ef64c40cdf92bf9c22
fc149911de6e614db6793c16ff322a78bdd5a162
/Algorithms/235/solution.cpp
06e0dd58bb9662b187f64d6d440533ca3f6a3f1b
[]
no_license
longf0720/leetcode
e3a5f5e9d495c39db3e1f1810460eb01e9b7622f
d5809e2d30002f40a653ece1ae70b0bb7978551e
refs/heads/master
2020-12-07T17:15:45.107904
2017-08-22T06:32:01
2017-08-22T06:32:01
95,451,981
0
0
null
null
null
null
UTF-8
C++
false
false
539
cpp
/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ class Solution { public: TreeNode* lowestCommonAncestor(TreeNode* root, TreeNode* p, TreeNode* q) { while(root) { if(p->val < root->val && q->val < root->val) root = root->left; else if(p->val>root->val && q->val>root->val) root = root->right; else break; } return root; } };
[ "longf0720@gmail.com" ]
longf0720@gmail.com
9cb91432c5045b84d820d7632588e43384129e3f
f6de34c1827198ab6cf457b2d646aa63e873fc0f
/src/huffman.cpp
4cbbdc1622e509ce7e930c94ce5ce598fce878d9
[]
no_license
Korshun/QZRcon
fbab00e43ddb791e7de199cacb19341add4f4c38
f81561a4ffb46869641d83d8ae625870a2cf1822
refs/heads/master
2020-12-03T06:31:09.369058
2015-09-16T18:22:24
2015-09-16T18:22:24
65,635,599
2
0
null
2016-08-13T20:27:52
2016-08-13T20:27:52
null
UTF-8
C++
false
false
9,905
cpp
// Version 5, released 5/13/2009. Compatible with Zandronum/Skulltag launchers and servers. #include <stdlib.h> #include <string.h> #include <stdio.h> #include <ctype.h> #include <math.h> #define USE_WINDOWS_DWORD #include "huffman.h" #define M_Malloc malloc /* QT WRAPPER */ // FIXME: 4 kilobytes max. QByteArray huffmanEncode(QByteArray data) { const unsigned char *in = (const unsigned char*)data.constData(); unsigned char out[4096]; int outlen; HUFFMAN_Encode(in, out, data.size(), &outlen); return QByteArray((char*)out, outlen); } QByteArray huffmanDecode(QByteArray data) { const unsigned char *in = (const unsigned char*)data.constData(); unsigned char out[4096]; int outlen; HUFFMAN_Decode(in, out, data.size(), &outlen); return QByteArray((char*)out, outlen); } //***************************************************************************** // PROTOTYPES static void huffman_BuildTree( float *freq ); static void huffman_PutBit( unsigned char *puf, int pos, int bit ); static int huffman_GetBit( const unsigned char *puf, int pos ); static void huffman_RecursiveFreeNode( huffnode_t *pNode ); //***************************************************************************** // VARIABLES int LastCompMessageSize = 0; static huffnode_t *HuffTree=0; static hufftab_t HuffLookup[256]; #ifdef _DEBUG static int HuffIn=0; static int HuffOut=0; #endif static unsigned char Masks[8]= { 0x1, 0x2, 0x4, 0x8, 0x10, 0x20, 0x40, 0x80 }; static float HuffFreq[256]= { 0.14473691, 0.01147017, 0.00167522, 0.03831121, 0.00356579, 0.03811315, 0.00178254, 0.00199644, 0.00183511, 0.00225716, 0.00211240, 0.00308829, 0.00172852, 0.00186608, 0.00215921, 0.00168891, 0.00168603, 0.00218586, 0.00284414, 0.00161833, 0.00196043, 0.00151029, 0.00173932, 0.00218370, 0.00934121, 0.00220530, 0.00381211, 0.00185456, 0.00194675, 0.00161977, 0.00186680, 0.00182071, 0.06421956, 0.00537786, 0.00514019, 0.00487155, 0.00493925, 0.00503143, 0.00514019, 0.00453520, 0.00454241, 0.00485642, 0.00422407, 0.00593387, 0.00458130, 0.00343687, 0.00342823, 0.00531592, 0.00324890, 0.00333388, 0.00308613, 0.00293776, 0.00258918, 0.00259278, 0.00377105, 0.00267488, 0.00227516, 0.00415997, 0.00248763, 0.00301555, 0.00220962, 0.00206990, 0.00270369, 0.00231694, 0.00273826, 0.00450928, 0.00384380, 0.00504728, 0.00221251, 0.00376961, 0.00232990, 0.00312574, 0.00291688, 0.00280236, 0.00252436, 0.00229461, 0.00294353, 0.00241201, 0.00366590, 0.00199860, 0.00257838, 0.00225860, 0.00260646, 0.00187256, 0.00266552, 0.00242641, 0.00219450, 0.00192082, 0.00182071, 0.02185930, 0.00157439, 0.00164353, 0.00161401, 0.00187544, 0.00186248, 0.03338637, 0.00186968, 0.00172132, 0.00148509, 0.00177749, 0.00144620, 0.00192442, 0.00169683, 0.00209439, 0.00209439, 0.00259062, 0.00194531, 0.00182359, 0.00159096, 0.00145196, 0.00128199, 0.00158376, 0.00171412, 0.00243433, 0.00345704, 0.00156359, 0.00145700, 0.00157007, 0.00232342, 0.00154198, 0.00140730, 0.00288807, 0.00152830, 0.00151246, 0.00250203, 0.00224420, 0.00161761, 0.00714383, 0.08188576, 0.00802537, 0.00119484, 0.00123805, 0.05632671, 0.00305156, 0.00105584, 0.00105368, 0.00099246, 0.00090459, 0.00109473, 0.00115379, 0.00261223, 0.00105656, 0.00124381, 0.00100326, 0.00127550, 0.00089739, 0.00162481, 0.00100830, 0.00097229, 0.00078864, 0.00107240, 0.00084409, 0.00265760, 0.00116891, 0.00073102, 0.00075695, 0.00093916, 0.00106880, 0.00086786, 0.00185600, 0.00608367, 0.00133600, 0.00075695, 0.00122077, 0.00566955, 0.00108249, 0.00259638, 0.00077063, 0.00166586, 0.00090387, 0.00087074, 0.00084914, 0.00130935, 0.00162409, 0.00085922, 0.00093340, 0.00093844, 0.00087722, 0.00108249, 0.00098598, 0.00095933, 0.00427593, 0.00496661, 0.00102775, 0.00159312, 0.00118404, 0.00114947, 0.00104936, 0.00154342, 0.00140082, 0.00115883, 0.00110769, 0.00161112, 0.00169107, 0.00107816, 0.00142747, 0.00279804, 0.00085922, 0.00116315, 0.00119484, 0.00128559, 0.00146204, 0.00130215, 0.00101551, 0.00091756, 0.00161184, 0.00236375, 0.00131872, 0.00214120, 0.00088875, 0.00138570, 0.00211960, 0.00094060, 0.00088083, 0.00094564, 0.00090243, 0.00106160, 0.00088659, 0.00114514, 0.00095861, 0.00108753, 0.00124165, 0.00427016, 0.00159384, 0.00170547, 0.00104431, 0.00091395, 0.00095789, 0.00134681, 0.00095213, 0.00105944, 0.00094132, 0.00141883, 0.00102127, 0.00101911, 0.00082105, 0.00158448, 0.00102631, 0.00087938, 0.00139290, 0.00114658, 0.00095501, 0.00161329, 0.00126542, 0.00113218, 0.00123661, 0.00101695, 0.00112930, 0.00317976, 0.00085346, 0.00101190, 0.00189849, 0.00105728, 0.00186824, 0.00092908, 0.00160896, }; //============================================================================= // // HUFFMAN_Construct // // Builds the Huffman tree. // //============================================================================= void HUFFMAN_Construct( void ) { #ifdef _DEBUG huffman_ZeroFreq(); #endif huffman_BuildTree(HuffFreq); // Free the table when the program closes. atexit( HUFFMAN_Destruct ); } //============================================================================= // // HUFFMAN_Destruct // // Frees memory allocated by the Huffman tree. // //============================================================================= void HUFFMAN_Destruct( void ) { huffman_RecursiveFreeNode( HuffTree ); free( HuffTree ); HuffTree = NULL; } //============================================================================= // // HUFFMAN_Encode // //============================================================================= void HUFFMAN_Encode(const unsigned char *in, unsigned char *out, int inlen, int *outlen ) { int i,j,bitat; unsigned int t; bitat=0; for (i=0;i<inlen;i++) { t=HuffLookup[in[i]].bits; for (j=0;j<HuffLookup[in[i]].len;j++) { huffman_PutBit(out+1,bitat+HuffLookup[in[i]].len-j-1,t&1); t>>=1; } bitat+=HuffLookup[in[i]].len; } *outlen=1+(bitat+7)/8; *out=8*((*outlen)-1)-bitat; if(*outlen >= inlen+1) { *out=0xff; memcpy(out+1,in,inlen); *outlen=inlen+1; } } //============================================================================= // // HUFFMAN_Decode // //============================================================================= void HUFFMAN_Decode(const unsigned char *in, unsigned char *out, int inlen, int *outlen ) { int bits,tbits; huffnode_t *tmp; if (*in==0xff) { memcpy(out,in+1,inlen-1); *outlen=inlen-1; return; } tbits=(inlen-1)*8-*in; bits=0; *outlen=0; while (bits<tbits) { tmp=HuffTree; do { if (huffman_GetBit(in+1,bits)) tmp=tmp->one; else tmp=tmp->zero; bits++; } while (tmp->zero); *out++=tmp->val; (*outlen)++; } } #ifdef _DEBUG static int freqs[256]; void huffman_ZeroFreq(void) { memset(freqs, 0, 256*sizeof(int)); } void CalcFreq(unsigned char *packet, int packetlen) { int ix; for (ix=0; ix<packetlen; ix++) { freqs[packet[ix]]++; } } void PrintFreqs(void) { int ix; float total=0; char string[100]; for (ix=0; ix<256; ix++) { total += freqs[ix]; } if (total>.01) { for (ix=0; ix<256; ix++) { sprintf(string, "\t%.8f,\n",((float)freqs[ix])/total); } } huffman_ZeroFreq(); } #endif void FindTab(huffnode_t *tmp,int len,unsigned int bits) { if (tmp->zero) { FindTab(tmp->zero,len+1,bits<<1); FindTab(tmp->one,len+1,(bits<<1)|1); return; } HuffLookup[tmp->val].len=len; HuffLookup[tmp->val].bits=bits; return; } //============================================================================= // // huffman_PutBit // //============================================================================= void huffman_PutBit(unsigned char *buf,int pos,int bit) { if (bit) buf[pos/8]|=Masks[pos%8]; else buf[pos/8]&=~Masks[pos%8]; } //============================================================================= // // huffman_GetBit // //============================================================================= int huffman_GetBit(const unsigned char *buf,int pos) { if (buf[pos/8]&Masks[pos%8]) return 1; else return 0; } //============================================================================= // // huffman_BuildTree // //============================================================================= void huffman_BuildTree( float *freq ) { float min1,min2; int i,j,minat1,minat2; huffnode_t *work[256]; huffnode_t *tmp; for (i=0;i<256;i++) { work[i]=(huffnode_s *)M_Malloc(sizeof(huffnode_t)); work[i]->val=(unsigned char)i; work[i]->freq=freq[i]; work[i]->zero=0; work[i]->one=0; HuffLookup[i].len=0; } for (i=0;i<255;i++) { minat1=-1; minat2=-1; min1=1E30; min2=1E30; for (j=0;j<256;j++) { if (!work[j]) continue; if (work[j]->freq<min1) { minat2=minat1; min2=min1; minat1=j; min1=work[j]->freq; } else if (work[j]->freq<min2) { minat2=j; min2=work[j]->freq; } } tmp= (huffnode_s *)M_Malloc(sizeof(huffnode_t)); tmp->zero=work[minat2]; tmp->one=work[minat1]; tmp->freq=work[minat2]->freq+work[minat1]->freq; tmp->val=0xff; work[minat1]=tmp; work[minat2]=0; } HuffTree=tmp; FindTab(HuffTree,0,0); } //============================================================================= // // huffman_RecursiveFreeNode // //============================================================================= static void huffman_RecursiveFreeNode( huffnode_t *pNode ) { if ( pNode->one ) { huffman_RecursiveFreeNode( pNode->one ); free( pNode->one ); pNode->one = NULL; } if ( pNode->zero ) { huffman_RecursiveFreeNode( pNode->zero ); free( pNode->zero ); pNode->zero = NULL; } }
[ "monsterovich@asus.(none)" ]
monsterovich@asus.(none)
442039a8f4da2f8e0ca860e95a23d0874b23dfee
cf3f2ef515dc502dec496858d186869f521d8162
/Code/Tools/FBuild/FBuildTest/Tests/TestProjectGeneration.cpp
3f2fbf897d40f72cec4c11195d1448495d1b7705
[ "LicenseRef-scancode-other-permissive", "LicenseRef-scancode-unknown-license-reference" ]
permissive
liamkf/fastbuild
080809c85600eb2766edf5a09e21ccd08d697826
7c63e69e8c7a63fa598fb23e61102a40ceba10b3
refs/heads/master
2021-01-17T11:32:36.300190
2018-02-06T20:42:14
2018-02-06T20:42:14
62,898,561
2
1
null
2016-07-08T15:26:57
2016-07-08T15:26:57
null
UTF-8
C++
false
false
18,138
cpp
// TestProjectGeneration.cpp //------------------------------------------------------------------------------ // Includes //------------------------------------------------------------------------------ #include "FBuildTest.h" // FBuild #include "Tools/FBuild/FBuildCore/Helpers/VSProjectGenerator.h" #include "Tools/FBuild/FBuildCore/FBuild.h" #include "Tools/FBuild/FBuildCore/Graph/NodeGraph.h" // Core #include "Core/FileIO/FileIO.h" #include "Core/FileIO/FileStream.h" #include "Core/Process/Thread.h" #include "Core/Strings/AStackString.h" #include "Core/Tracing/Tracing.h" // TestProjectGeneration //------------------------------------------------------------------------------ class TestProjectGeneration : public FBuildTest { private: DECLARE_TESTS // Tests void Test() const; void TestFunction() const; void TestFunction_NoRebuild() const; void TestFunction_Speed() const; // XCode void XCode() const; // Intellisense/CodeSense void IntellisenseAndCodeSense() const; // Helpers void VCXProj_Intellisense_Check( const char * projectFile ) const; void XCodeProj_CodeSense_Check( const char * projectFile ) const; }; // Register Tests //------------------------------------------------------------------------------ REGISTER_TESTS_BEGIN( TestProjectGeneration ) REGISTER_TEST( Test ) REGISTER_TEST( TestFunction ) REGISTER_TEST( TestFunction_NoRebuild ) REGISTER_TEST( TestFunction_Speed ) REGISTER_TEST( XCode ) REGISTER_TEST( IntellisenseAndCodeSense ) REGISTER_TESTS_END // Test //------------------------------------------------------------------------------ void TestProjectGeneration::Test() const { // work out where we are running, and find "Core" AStackString<> oldDir; TEST_ASSERT( FileIO::GetCurrentDir( oldDir ) ); AStackString<> baseDir( oldDir ); #if defined( __WINDOWS__ ) const char * codeLoc = baseDir.FindI( "\\code\\" ); #else const char * codeLoc = baseDir.FindI( "/code/" ); #endif TEST_ASSERT( codeLoc ); baseDir.SetLength( (uint32_t)( codeLoc - baseDir.Get() ) ); #if defined( __WINDOWS__ ) baseDir += "\\Code\\Core\\"; #else baseDir += "/Code/Core/"; #endif Array< AString > baseDirs; baseDirs.Append( baseDir ); VSProjectGenerator pg; // project name pg.SetProjectName( AStackString<>( "Core" ) ); pg.SetBasePaths( baseDirs ); Array< VSProjectConfig > configs; VSProjectConfig cfg; // commands cfg.m_BuildCommand = "fbuild -cache $(Project)-$(Config)-$(Platform)"; cfg.m_RebuildCommand = "fbuild -cache -clean $(Project)-$(Config)-$(Platform)"; // debugger cfg.m_LocalDebuggerCommand = "$(SolutionDir)..\\..\\..\\tmp\\$(Platform)\\$(Config)\\Tools\\FBuild\\FBuildTest\\FBuildTest.exe"; cfg.m_LocalDebuggerWorkingDirectory = "$(ProjectDir)"; cfg.m_LocalDebuggerCommandArguments = "-verbose"; cfg.m_LocalDebuggerEnvironment = "_NO_DEBUG_HEAP=1"; cfg.m_Platform = "Win32"; cfg.m_Config = "Debug"; configs.Append( cfg ); cfg.m_Config = "Profile"; configs.Append( cfg ); cfg.m_Config = "Release"; configs.Append( cfg ); cfg.m_Platform = "x64"; cfg.m_Config = "Debug"; configs.Append( cfg ); cfg.m_Config = "Profile"; configs.Append( cfg ); cfg.m_Config = "Release"; configs.Append( cfg ); // files Array< AString > files; FileIO::GetFiles( baseDir, AStackString<>( "*.cpp" ), true, &files ); FileIO::GetFiles( baseDir, AStackString<>( "*.h" ), true, &files ); pg.AddFiles( files ); // fileTypes Array< VSProjectFileType > fileTypes; { VSProjectFileType ft; ft.m_FileType = "CppForm"; ft.m_Pattern = "*\\Core\\Strings\\AString.h"; fileTypes.Append( ft ); } FBuild fBuild; // needed for NodeGraph::CleanPath AStackString<> projectFile( "../../../../tmp/Test/ProjectGeneration/Core.vcxproj" ); AStackString<> projectFileClean; NodeGraph::CleanPath( projectFile, projectFileClean ); const AString & vcxproj = pg.GenerateVCXProj( projectFileClean, configs, fileTypes ); const AString & filters = pg.GenerateVCXProjFilters( projectFileClean ); TEST_ASSERT( FileIO::EnsurePathExists( AStackString<>( "../../../../tmp/Test/ProjectGeneration/" ) ) ); FileStream f; TEST_ASSERT( f.Open( projectFileClean.Get(), FileStream::WRITE_ONLY ) ); TEST_ASSERT( f.Write( vcxproj.Get(), vcxproj.GetLength() ) == vcxproj.GetLength() ); f.Close(); TEST_ASSERT( f.Open( "../../../../tmp/Test/ProjectGeneration/Core.vcxproj.filters", FileStream::WRITE_ONLY ) ); TEST_ASSERT( f.Write( filters.Get(), filters.GetLength() ) == filters.GetLength() ); } // TestFunction //------------------------------------------------------------------------------ void TestProjectGeneration::TestFunction() const { AStackString<> project( "../../../../tmp/Test/ProjectGeneration/testproj.vcxproj" ); AStackString<> solution( "../../../../tmp/Test/ProjectGeneration/testsln.sln" ); AStackString<> filters( "../../../../tmp/Test/ProjectGeneration/testproj.vcxproj.filters" ); EnsureFileDoesNotExist( project ); EnsureFileDoesNotExist( solution ); EnsureFileDoesNotExist( filters ); FBuildOptions options; options.m_ConfigFile = "Data/TestProjectGeneration/fbuild.bff"; options.m_ForceCleanBuild = true; options.m_ShowSummary = true; // required to generate stats for node count checks FBuild fBuild( options ); TEST_ASSERT( fBuild.Initialize() ); TEST_ASSERT( fBuild.Build( AStackString<>( "TestSln" ) ) ); TEST_ASSERT( fBuild.SaveDependencyGraph( "../../../../tmp/Test/ProjectGeneration/fbuild.fdb" ) ); EnsureFileExists( project ); EnsureFileExists( solution ); EnsureFileExists( filters ); // Check stats // Seen, Built, Type CheckStatsNode ( 1, 1, Node::DIRECTORY_LIST_NODE ); CheckStatsNode ( 1, 1, Node::VCXPROJECT_NODE ); CheckStatsNode ( 1, 1, Node::SLN_NODE ); CheckStatsNode ( 1, 1, Node::ALIAS_NODE ); CheckStatsTotal( 4, 4 ); } // TestFunction_NoRebuild //------------------------------------------------------------------------------ void TestProjectGeneration::TestFunction_NoRebuild() const { AStackString<> project( "../../../../tmp/Test/ProjectGeneration/testproj.vcxproj" ); AStackString<> filters( "../../../../tmp/Test/ProjectGeneration/testproj.vcxproj.filters" ); EnsureFileExists( project ); EnsureFileExists( filters ); // Projects and Solutions must be "built" every time, but only write files when they change // so record the time before and after uint64_t dateTime1 = FileIO::GetFileLastWriteTime( project ); uint64_t dateTime2 = FileIO::GetFileLastWriteTime( filters ); // NTFS file resolution is 100ns and HFS is 1 second, // so sleep long enough to ensure an invalid write would modify the time #if defined( __WINDOWS__ ) Thread::Sleep( 1 ); // 1ms #elif defined( __OSX__ ) Thread::Sleep( 1000 ); // Work around low time resolution of HFS+ #elif defined( __LINUX__ ) Thread::Sleep( 1000 ); // Work around low time resolution of ext2/ext3/reiserfs and time caching used by used by others #endif // do build FBuildOptions options; options.m_ConfigFile = "Data/TestProjectGeneration/fbuild.bff"; options.m_ShowSummary = true; // required to generate stats for node count checks FBuild fBuild( options ); TEST_ASSERT( fBuild.Initialize( "../../../../tmp/Test/ProjectGeneration/fbuild.fdb" ) ); TEST_ASSERT( fBuild.Build( AStackString<>( "TestProj" ) ) ); // Make sure files have not been changed TEST_ASSERT( dateTime1 == FileIO::GetFileLastWriteTime( project ) ); TEST_ASSERT( dateTime2 == FileIO::GetFileLastWriteTime( filters ) ); // Check stats // Seen, Built, Type CheckStatsNode ( 1, 1, Node::DIRECTORY_LIST_NODE ); CheckStatsNode ( 1, 1, Node::VCXPROJECT_NODE ); CheckStatsNode ( 1, 1, Node::ALIAS_NODE ); CheckStatsTotal( 3, 3 ); } // TestFunction_Speed //------------------------------------------------------------------------------ void TestProjectGeneration::TestFunction_Speed() const { VSProjectGenerator pg; AStackString<> baseDir( "C:\\Windows\\System32" ); Array< AString > baseDirs; baseDirs.Append( baseDir ); // project name pg.SetProjectName( AStackString<>( "Big" ) ); pg.SetBasePaths( baseDirs ); // platforms Array< VSProjectConfig > configs; VSProjectConfig cfg; cfg.m_Platform = "Win32"; cfg.m_Config = "Debug"; configs.Append( cfg ); // files (about 5,000) Array< AString > files; FileIO::GetFiles( baseDir, AStackString<>( "*.mui" ), true, &files ); FileIO::GetFiles( baseDir, AStackString<>( "*.exe" ), true, &files ); FileIO::GetFiles( baseDir, AStackString<>( "*.dll" ), true, &files ); pg.AddFiles( files ); Array< VSProjectFileType > fileTypes; { VSProjectFileType ft; ft.m_FileType = "CppForm"; ft.m_Pattern = "Code\\Forms\\*.h"; fileTypes.Append( ft ); ft.m_FileType = "CppControl"; ft.m_Pattern = "Controls\\*.h"; fileTypes.Append( ft ); } AStackString<> projectFileName( "C:\\Windows\\System\\dummy.vcxproj" ); { Timer t; pg.GenerateVCXProj( projectFileName, configs, fileTypes ); float time = t.GetElapsed(); OUTPUT( "Gen vcxproj : %2.3fs\n", time ); } { Timer t; pg.GenerateVCXProjFilters( projectFileName ); float time = t.GetElapsed(); OUTPUT( "Gen vcxproj.filters: %2.3fs\n", time ); } } // IntellisenseAndCodeSense //------------------------------------------------------------------------------ void TestProjectGeneration::IntellisenseAndCodeSense() const { // Parse bff FBuildOptions options; options.m_ConfigFile = "Data/TestProjectGeneration/Intellisense/fbuild.bff"; FBuild fBuild( options ); TEST_ASSERT( fBuild.Initialize() ); // Generate project TEST_ASSERT( fBuild.Build( AStackString<>( "Intellisense" ) ) ); // Ensure VS Intellisense info is present VCXProj_Intellisense_Check( "../../../../tmp/Test/ProjectGeneration/Intellisense/ObjectList.vcxproj" ); VCXProj_Intellisense_Check( "../../../../tmp/Test/ProjectGeneration/Intellisense/Library.vcxproj" ); VCXProj_Intellisense_Check( "../../../../tmp/Test/ProjectGeneration/Intellisense/Executable.vcxproj" ); VCXProj_Intellisense_Check( "../../../../tmp/Test/ProjectGeneration/Intellisense/Test.vcxproj" ); // Ensure XCode CodeSense info is present XCodeProj_CodeSense_Check( "../../../../tmp/Test/ProjectGeneration/Intellisense/ObjectList.xcodeproj/project.pbxproj" ); XCodeProj_CodeSense_Check( "../../../../tmp/Test/ProjectGeneration/Intellisense/Library.xcodeproj/project.pbxproj" ); XCodeProj_CodeSense_Check( "../../../../tmp/Test/ProjectGeneration/Intellisense/Executable.xcodeproj/project.pbxproj" ); XCodeProj_CodeSense_Check( "../../../../tmp/Test/ProjectGeneration/Intellisense/Test.xcodeproj/project.pbxproj" ); } // VCXProj_Intellisense_Check //------------------------------------------------------------------------------ void TestProjectGeneration::VCXProj_Intellisense_Check( const char * projectFile ) const { // Read Project FileStream f; TEST_ASSERT( f.Open( projectFile, FileStream::READ_ONLY ) ); AString buffer; buffer.SetLength( (uint32_t)f.GetFileSize() ); TEST_ASSERT( f.ReadBuffer( buffer.Get(), f.GetFileSize() ) == f.GetFileSize() ); Array< AString > tokens; buffer.Tokenize( tokens, '\n' ); // Check bool definesOk = false; bool includesOk = false; for ( const AString & token : tokens ) { if ( token.Find( "NMakePreprocessorDefinitions" ) ) { TEST_ASSERT( token.Find( "INTELLISENSE_DEFINE" ) ); TEST_ASSERT( token.Find( "INTELLISENSE_SPACE_DEFINE" ) ); TEST_ASSERT( token.Find( "INTELLISENSE_SLASH_DEFINE" ) ); TEST_ASSERT( token.Find( "INTELLISENSE_SLASH_SPACE_DEFINE" ) ); TEST_ASSERT( token.Find( "INTELLISENSE_QUOTED_DEFINE" ) ); TEST_ASSERT( token.Find( "INTELLISENSE_QUOTED_SPACE_DEFINE" ) ); TEST_ASSERT( token.Find( "INTELLISENSE_QUOTED_SLASH_DEFINE" ) ); TEST_ASSERT( token.Find( "INTELLISENSE_QUOTED_SLASH_SPACE_DEFINE" ) ); definesOk = true; } else if ( token.Find( "NMakeIncludeSearchPath" ) ) { TEST_ASSERT( token.Find( "Intellisense\\Include\\Path" ) ); TEST_ASSERT( token.Find( "Intellisense\\Include\\Space\\Path" ) ); TEST_ASSERT( token.Find( "Intellisense\\Include\\Slash\\Path" ) ); TEST_ASSERT( token.Find( "Intellisense\\Include\\Slash\\Space\\Path" ) ); TEST_ASSERT( token.Find( "Intellisense\\Include\\Quoted\\Path" ) ); TEST_ASSERT( token.Find( "Intellisense\\Include\\Quoted\\Space\\Path" ) ); TEST_ASSERT( token.Find( "Intellisense\\Include\\Quoted\\Slash\\Path" ) ); TEST_ASSERT( token.Find( "Intellisense\\Include\\Quoted\\Slash\\Space\\Path" ) ); includesOk = true; } } TEST_ASSERT( definesOk ); TEST_ASSERT( includesOk ); } // XCodeProj_CodeSense_Check //------------------------------------------------------------------------------ void TestProjectGeneration::XCodeProj_CodeSense_Check( const char * projectFile ) const { // Read Project FileStream f; TEST_ASSERT( f.Open( projectFile, FileStream::READ_ONLY ) ); AString buffer; buffer.SetLength( (uint32_t)f.GetFileSize() ); TEST_ASSERT( f.ReadBuffer( buffer.Get(), f.GetFileSize() ) == f.GetFileSize() ); Array< AString > tokens; buffer.Tokenize( tokens, '\n' ); // Check const size_t NUM_DEFINES = 8; bool definesOk[ NUM_DEFINES ] = { false, false, false, false, false, false, false, false }; const size_t NUM_INCLUDES = 8; bool includesOk[ NUM_INCLUDES ] = { false, false, false, false, false, false, false, false }; bool inDefineSection = false; bool inIncludeSection = false; for ( const AString & token : tokens ) { // Check for start/end of sections if ( token.Find( "GCC_PREPROCESSOR_DEFINITIONS" ) ) { inDefineSection = true; continue; } if ( token.Find( "USER_HEADER_SEARCH_PATHS" ) ) { inIncludeSection = true; continue; } if ( token == "\t\t\t\t);" ) { if ( inDefineSection ) { inDefineSection = false; } else if ( inIncludeSection ) { inIncludeSection = false; } continue; } // Defines if ( inDefineSection ) { if ( token.Find( "INTELLISENSE_DEFINE" ) ) { definesOk[ 0 ] = true; } if ( token.Find( "INTELLISENSE_SPACE_DEFINE" ) ) { definesOk[ 1 ] = true; } if ( token.Find( "INTELLISENSE_SLASH_DEFINE" ) ) { definesOk[ 2 ] = true; } if ( token.Find( "INTELLISENSE_SLASH_SPACE_DEFINE" ) ) { definesOk[ 3 ] = true; } if ( token.Find( "INTELLISENSE_QUOTED_DEFINE" ) ) { definesOk[ 4 ] = true; } if ( token.Find( "INTELLISENSE_QUOTED_SPACE_DEFINE" ) ) { definesOk[ 5 ] = true; } if ( token.Find( "INTELLISENSE_QUOTED_SLASH_DEFINE" ) ) { definesOk[ 6 ] = true; } if ( token.Find( "INTELLISENSE_QUOTED_SLASH_SPACE_DEFINE" ) ) { definesOk[ 7 ] = true; } continue; } // Includes if ( inIncludeSection ) { if ( token.Find( "Intellisense/Include/Path" ) ) { includesOk[ 0 ] = true; } if ( token.Find( "Intellisense/Include/Space/Path" ) ) { includesOk[ 1 ] = true; } if ( token.Find( "Intellisense/Include/Slash/Path" ) ) { includesOk[ 2 ] = true; } if ( token.Find( "Intellisense/Include/Slash/Space/Path" ) ) { includesOk[ 3 ] = true; } if ( token.Find( "Intellisense/Include/Quoted/Path" ) ) { includesOk[ 4 ] = true; } if ( token.Find( "Intellisense/Include/Quoted/Space/Path" ) ) { includesOk[ 5 ] = true; } if ( token.Find( "Intellisense/Include/Quoted/Slash/Path" ) ) { includesOk[ 6 ] = true; } if ( token.Find( "Intellisense/Include/Quoted/Slash/Space/Path" ) ) { includesOk[ 7 ] = true; } continue; } } // Check we found them all for ( size_t i=0; i<NUM_DEFINES; ++i ) { TEST_ASSERT( definesOk[ i ] ); } for ( size_t i=0; i<NUM_INCLUDES; ++i ) { TEST_ASSERT( includesOk[ i ] ); } } // XCode //------------------------------------------------------------------------------ void TestProjectGeneration::XCode() const { AStackString<> project( "../../../../tmp/Test/ProjectGeneration/Test.xcodeproj/project.pbxproj" ); EnsureFileDoesNotExist( project ); // do build FBuildOptions options; options.m_ConfigFile = "Data/TestProjectGeneration/xcodeproject.bff"; options.m_ShowSummary = true; // required to generate stats for node count checks FBuild fBuild( options ); TEST_ASSERT( fBuild.Initialize() ); TEST_ASSERT( fBuild.Build( AStackString<>( "XCodeProj" ) ) ); // Check stats // Seen, Built, Type CheckStatsNode ( 0, 0, Node::DIRECTORY_LIST_NODE ); CheckStatsNode ( 1, 1, Node::XCODEPROJECT_NODE ); CheckStatsNode ( 1, 1, Node::ALIAS_NODE ); CheckStatsTotal( 2, 2 ); } //------------------------------------------------------------------------------
[ "franta.fulin@gmail.com" ]
franta.fulin@gmail.com
3f0f3ff6585c4875abfcc1e1baa6dc2d4e4fb8d8
8587a2d2bbbb5f23115fa5e6061134fdad7f3508
/cpp_Ehpub_Composition_Relate_Class/Man.cpp
67b4986c0e5259c473b84c01fcca467ced91ff85
[]
no_license
YoungWanHeeMOng/YoungWanHeeMOng
2dc50b508279a912f85c58d0f1f152760d69a250
2afc3f10322ccb840937e4a9600de3fa11c79fd1
refs/heads/main
2023-05-01T02:16:46.454059
2021-05-20T21:55:28
2021-05-20T21:55:28
366,675,224
1
0
null
null
null
null
UTF-8
C++
false
false
597
cpp
#include "Man.h" Man::Man() { eyes[0] = new Eye(true); eyes[1] = new Eye(false); } Man::~Man() { delete eyes[0]; delete eyes[1]; } void Man::Sleep() { cout << "======== Sleep =========" << endl; eyes[0]->Close(); eyes[1]->Close(); } void Man::Walk() { cout << "======== Walk =========" << endl; eyes[0]->Open(); eyes[1]->Open(); eyes[0]->See(); eyes[1]->See(); cout << "Go to front......" << endl; } void Man::Wink() { cout << "======== Wink =========" << endl; eyes[0]->Open(); eyes[1]->Close(); }
[ "noreply@github.com" ]
noreply@github.com
1f2cb2214ececd50091d026bc0359a94c92ddd96
6b9e941d5cfdd505b5e6015b5870a64841f24a61
/Hw2/Hw2/mazequeue.cpp
e0be1c7f7e368930717eac45cb4d186fc0b2a645
[]
no_license
sihanmin/Data-Structures
dc7d31aae0242fa5ed99c68c2f0bdb4f0813c55d
0f2195bd10919c2ce6cc877dcefbd6f37a8dd802
refs/heads/main
2023-01-01T06:05:43.707846
2020-10-20T12:23:41
2020-10-20T12:23:41
305,697,338
1
0
null
null
null
null
UTF-8
C++
false
false
1,696
cpp
//// //// mazequeue.cpp //// Hw2 //// //// Created by Mint MSH on 2/5/17. //// Copyright © 2017 Mint MSH. All rights reserved. //// // //#include <stdio.h> //#include <string> //#include <queue> //using namespace std; // //class Coord //{ //public: // Coord(int rr, int cc) : m_r(rr), m_c(cc) {} // int r() const { return m_r; } // int c() const { return m_c; } //private: // int m_r; // int m_c; //}; // //bool pathExists(string maze[], int nRows, int nCols, int sr, int sc, int er, int ec) //// Return true if there is a path from (sr,sc) to (er,ec) //// through the maze; return false otherwise //{ // queue<Coord> coordQueue; // declare a stack of Coords // coordQueue.push(Coord(sr,sc)); // maze[sr][sc] = 's'; // Coord cur(0,0); // // while (!coordQueue.empty()) // { // cur = coordQueue.front(); // coordQueue.pop(); // if (cur.r() == er && cur.c() == ec) // return true; // // if (maze[cur.r()-1][cur.c()] == '.') // { // coordQueue.push(Coord(cur.r()-1,cur.c())); // maze[cur.r()-1][cur.c()] = 's'; // } // if (maze[cur.r()][cur.c()+1] == '.') // { // coordQueue.push(Coord(cur.r(),cur.c()+1)); // maze[cur.r()][cur.c()+1] = 's'; // } // if (maze[cur.r()+1][cur.c()] == '.') // { // coordQueue.push(Coord(cur.r()+1,cur.c())); // maze[cur.r()+1][cur.c()] = 's'; // } // if (maze[cur.r()][cur.c()-1] == '.') // { // coordQueue.push(Coord(cur.r(),cur.c()-1)); // maze[cur.r()][cur.c()-1] = 's'; // } // } // return false; //}
[ "noreply@github.com" ]
noreply@github.com
8c7ea9554538653d982cb6956629bc9841e87bbb
e9524de67a41052b01a3c4e352d4b16344a92c6d
/wk1_d/rectangleXeno/src/ofApp.cpp
c4b4bd9d03072c1f4070641b6f69aefec80f54bd
[]
no_license
nyantee/ashen733__AlgoSims2016
62e0ea19caa7fd4f8b71a80b600b82e27977ddcd
d4a31b86dbe20b67ef9f07db36f0f04763544739
refs/heads/master
2021-01-12T13:24:44.483157
2016-12-16T02:07:54
2016-12-16T02:07:54
68,978,183
0
0
null
null
null
null
UTF-8
C++
false
false
2,174
cpp
#include "ofApp.h" //-------------------------------------------------------------- void ofApp::setup(){ // ofSetVerticalSync(true); ofEnableAlphaBlending(); myRect.pos.x = 10; myRect.pos.y = 10; pinkRec.pos.x = 20; pinkRec.pos.y = 50; blueRec.pos.x = 50; blueRec.pos.y = 20; greenRec.pos.x = 100; greenRec.pos.y = 50; } //-------------------------------------------------------------- void ofApp::update(){ myRect.xenoToPoint(mouseX, mouseY); pinkRec.xenoToPoint(mouseX, mouseY); blueRec.xenoToPoint(mouseX, mouseY); greenRec.xenoToPoint(mouseX, mouseY); } //-------------------------------------------------------------- void ofApp::draw(){ ofSetColor(255, 0, 255); myRect.draw(); ofSetColor(0, 0, 255); pinkRec.draw(); ofSetColor(255, 0, 0); blueRec.draw(); ofSetColor(0, 255, 0); greenRec.draw(); } //-------------------------------------------------------------- void ofApp::keyPressed(int key){ } //-------------------------------------------------------------- void ofApp::keyReleased(int key){ } //-------------------------------------------------------------- void ofApp::mouseMoved(int x, int y ){ } //-------------------------------------------------------------- void ofApp::mouseDragged(int x, int y, int button){ } //-------------------------------------------------------------- void ofApp::mousePressed(int x, int y, int button){ } //-------------------------------------------------------------- void ofApp::mouseReleased(int x, int y, int button){ } //-------------------------------------------------------------- void ofApp::mouseEntered(int x, int y){ } //-------------------------------------------------------------- void ofApp::mouseExited(int x, int y){ } //-------------------------------------------------------------- void ofApp::windowResized(int w, int h){ } //-------------------------------------------------------------- void ofApp::gotMessage(ofMessage msg){ } //-------------------------------------------------------------- void ofApp::dragEvent(ofDragInfo dragInfo){ }
[ "nyanteeasherman@Nyantees-MBP.wireless.newschool.edu" ]
nyanteeasherman@Nyantees-MBP.wireless.newschool.edu
4844ea169ecc7b808b87404ede8439105655069f
a7764174fb0351ea666faa9f3b5dfe304390a011
/inc/AdvApprox_Cutting.hxx
a8ad78f95350bc8d5fbc8b9a66aa6d7ddd40daa2
[]
no_license
uel-dataexchange/Opencascade_uel
f7123943e9d8124f4fa67579e3cd3f85cfe52d91
06ec93d238d3e3ea2881ff44ba8c21cf870435cd
refs/heads/master
2022-11-16T07:40:30.837854
2020-07-08T01:56:37
2020-07-08T01:56:37
276,290,778
0
0
null
null
null
null
UTF-8
C++
false
false
1,433
hxx
// This file is generated by WOK (CPPExt). // Please do not edit this file; modify original file instead. // The copyright and license terms as defined for the original file apply to // this header file considered to be the "object code" form of the original source. #ifndef _AdvApprox_Cutting_HeaderFile #define _AdvApprox_Cutting_HeaderFile #ifndef _Standard_HeaderFile #include <Standard.hxx> #endif #ifndef _Standard_Macro_HeaderFile #include <Standard_Macro.hxx> #endif #ifndef _Standard_Boolean_HeaderFile #include <Standard_Boolean.hxx> #endif #ifndef _Standard_Real_HeaderFile #include <Standard_Real.hxx> #endif //! to choose the way of cutting in approximation <br> class AdvApprox_Cutting { public: void* operator new(size_t,void* anAddress) { return anAddress; } void* operator new(size_t size) { return Standard::Allocate(size); } void operator delete(void *anAddress) { if (anAddress) Standard::Free((Standard_Address&)anAddress); } Standard_EXPORT virtual void Delete() ; Standard_EXPORT virtual ~AdvApprox_Cutting(){Delete();} Standard_EXPORT virtual Standard_Boolean Value(const Standard_Real a,const Standard_Real b,Standard_Real& cuttingvalue) const = 0; protected: private: }; // other Inline functions and methods (like "C++: function call" methods) #endif
[ "shoka.sho2@excel.co.jp" ]
shoka.sho2@excel.co.jp
c0e621ec1318ab2e6ccabb1e3d3a6292ffa8ddac
da659b9c71a3c89a71f1639669da93e315edb198
/AMG_Messenger/src/comando.cpp
3d132523f4d7e88c91e3c8fe38b791af25033a81
[]
no_license
amg1127/PROGRAMAS-DA-FACULDADE
941b732f1abc1c2b8859dd2b8f1ce5e580183153
48efcdb52e6a165d6980406909b3501212c0d2c4
refs/heads/master
2020-05-17T19:56:39.930515
2020-02-17T11:55:04
2020-02-17T11:55:04
183,930,907
0
0
null
null
null
null
UTF-8
C++
false
false
11,321
cpp
#include "comando.h" comando::comando () { DEBUGA("comando::comando ();"); NOVO_OBJETO (this->t, QTimer (this)); this->_Estado = QueEstado::Pronto; this->novalinha = QRegExp (QString("[\\r\\n]")); Q_ASSERT (this->novalinha.isValid()); this->_flag = true; QObject::connect (this->t, SIGNAL(timeout()), this, SLOT (timerTimeout())); QObject::connect (this, SIGNAL(readyRead()), this, SLOT(socketReadyRead())); QObject::connect (this, SIGNAL(connected()), this, SLOT(socketConnected())); QObject::connect (this, SIGNAL(connectionClosed()), this, SLOT(socketConnectionClosed())); QObject::connect (this, SIGNAL(error(int)), this, SLOT(socketError(int))); } comando::~comando () { DEBUGA("comando::~comando ();"); QObject::disconnect (this->t, 0, this, 0); QObject::disconnect (this, 0, this, 0); APAGA_OBJETO (this->t); } void comando::f__eu (const char *s) { DEBUGA("void comando::f__eu (const char *);"); this->f__eu (QString (s)); } void comando::f__eu (QString s) { DEBUGA("void comando::f__eu (QString);"); this->lstParams.append (s); this->f__eu (); } void comando::f__eu (void) { DEBUGA("void comando::f__eu (void);"); QString s(""); this->close(); this->t->stop(); if (! this->lstParams.isEmpty()) { s = this->lstParams[this->lstParams.count() - 1]; this->lstParams.clear(); } emit ErroComunicando (QString(s)); this->_Estado = QueEstado::Pronto; } void comando::AdicionaParametros (const char *str) { DEBUGA("void comando::AdicionaParametros (const char *);"); this->AdicionaParametros (QString (str)); } void comando::AdicionaParametros (QString str) { DEBUGA("void comando::AdicionaParametros (QString);"); QStringList s; QValueList<QString>::size_type i; s = QStringList::split (this->novalinha, str, true); for (i=0; i<s.count(); i++) if (this->_flag && this->_Estado == QueEstado::Pronto) this->lstParams.append (s[i]); else if (this->_Estado == QueEstado::ExecutandoComando) { this->lstRetorno.append (s[i]); this->lstBackup3.append (s[i]); } else { if (this->comandosNaFila.isEmpty()) this->comandosNaFila.append (s[i] + "\n"); else this->comandosNaFila.last() += s[i] + "\n"; } } void comando::EnviaDado (const char *msg) { DEBUGA("void comando::EnviaDado (const char *);"); int i = 0; while (msg[i]) i++; this->writeBlock (msg, i); this->writeBlock ("\n", 1); this->flush (); } void comando::EnviaDado (QString msg) { DEBUGA("void comando::EnviaDado (QString);"); this->EnviaDado ((const char*) msg.ascii()); } QueEstado::__QueEstado comando::Estado (void) { DEBUGA("QueEstado::__QueEstado comando::Estado (void);"); return (this->_Estado); } bool comando::Envia (const char *cmd) { DEBUGA("bool comando::Envia (const char *);"); return (this->Envia (QString (cmd))); } bool comando::Envia (QString cmd) { DEBUGA("bool comando::Envia (QString);"); QStringList s; int i; s = QStringList::split (this->novalinha, cmd, true); if (s.isEmpty()) return (false); if (this->_flag && this->_Estado == QueEstado::Pronto) { if (this->state() != QSocket::Connected) return (false); this->_Estado = QueEstado::EnviandoComando; for (i=s.count() - 1; i>=0; i--) this->lstParams.prepend (s[i]); this->EnviaDado (QString("CO ") + this->lstParams[0]); this->lstBackup.clear (); this->lstBackup.append (this->lstParams[0]); this->t->start (TEMPONEGOCIACAO, true); this->lstParams.remove (this->lstParams.begin()); } else { for (i=s.count() - 1; i>=0; i--) { if (this->comandosNaFila.isEmpty ()) { this->comandosNaFila.append (s[i]); } else { this->comandosNaFila.last() = s[i] + "\n" + this->comandosNaFila.last(); } } this->comandosNaFila.append (""); } return (true); } void comando::timerTimeout () { DEBUGA("void comando::timerTimeout ();"); this->f__eu ("ERRO Tempo limite estourou."); } void comando::socketConnectionClosed () { DEBUGA("void comando::socketConnectionClosed ();"); this->f__eu ("ERRO Conexao fechada inesperadamente pelo host remoto."); } void comando::socketError (int e) { DEBUGA("void comando::socketError (int);"); e++; e--; switch (e) { case QSocket::ErrConnectionRefused: this->f__eu ("ERRO Conexao recusada pelo host remoto."); break; case QSocket::ErrHostNotFound: this->f__eu ("ERRO Servidor nao encontrado."); break; case QSocket::ErrSocketRead: this->f__eu ("ERRO Leitura do socket falhou."); break; default: this->f__eu ("ERRO (nao-especificado)"); } } void comando::socketReadyRead () { DEBUGA("void comando::socketReadyRead ();"); QString linha, inicio, fim; QStringList s; int i, l; while (this->canReadLine()) { linha = this->readLine().stripWhiteSpace(); if (linha.length() < 2) continue; inicio = linha.left(2).stripWhiteSpace(); fim = linha.mid(2).stripWhiteSpace(); if (inicio.isEmpty()) { this->f__eu ("ERRO Comunicacao perdeu sincronismo."); return; } if (inicio == "CO") { if (fim.isEmpty()) { this->f__eu ("ERRO Comunicacao perdeu sincronismo."); return; } } if (this->_Estado == QueEstado::Pronto) { if (inicio != "CO") { this->f__eu ("ERRO Comunicacao perdeu sincronismo."); return; } this->lstParams.append (fim); this->lstBackup2.clear (); this->lstBackup2.append (fim); this->_Estado = QueEstado::RecebendoComando; this->t->start (TEMPONEGOCIACAO, true); this->EnviaDado ("OK"); } else if (this->_Estado == QueEstado::RecebendoComando) { if (inicio == "PA") { this->lstParams.append (fim); this->lstBackup2.append (fim); this->EnviaDado ("OK"); } else if (inicio == "EX") { this->_Estado = QueEstado::ExecutandoComando; this->lstRetorno.clear (); this->lstBackup3.clear (); emit ComandoRecebido (QStringList (this->lstParams)); this->lstParams.clear(); if (this->lstRetorno.isEmpty ()) { this->funcaosemnome(); } else { this->_Estado = QueEstado::EnviandoResComando; this->EnviaDado (QString("PA ") + this->lstRetorno.first()); this->lstRetorno.remove (this->lstRetorno.begin()); } } else { this->f__eu ("ERRO Comunicacao perdeu sincronismo."); return; } } else if (this->_Estado == QueEstado::EnviandoComando) { if (inicio != "OK") { this->f__eu ("ERRO Comunicacao perdeu sincronismo."); return; } if (this->lstParams.isEmpty()) { this->EnviaDado ("EX"); this->_Estado = QueEstado::RecebendoResComando; } else { this->EnviaDado (QString("PA ") + this->lstParams.first()); this->lstBackup.append (this->lstParams.first()); this->lstParams.remove (this->lstParams.begin()); } } else if (this->_Estado == QueEstado::RecebendoResComando) { if (inicio == "PA") { this->lstRetorno.append (fim); this->EnviaDado ("OK"); } else if (inicio == "EX") { this->_Estado = QueEstado::Pronto; this->t->stop (); this->_flag = false; emit ComandoExecutado (QStringList (this->lstBackup), QStringList (this->lstRetorno)); this->lstRetorno.clear (); this->_flag = true; if (! this->comandosNaFila.isEmpty()) { s = QStringList::split (this->novalinha, this->comandosNaFila.first(), true); this->comandosNaFila.remove (this->comandosNaFila.begin()); l = s.count(); if (l > 0) { for (i=1; i<l; i++) { this->AdicionaParametros (s[i]); } this->Envia (s.first()); } } } else if (inicio == "CO") { this->_Estado = QueEstado::Pronto; this->t->stop (); this->_flag = false; emit ComandoExecutado (QStringList (this->lstBackup), QStringList (this->lstRetorno)); this->lstRetorno.clear (); this->_flag = true; this->lstParams.append (fim); this->lstBackup2.clear (); this->lstBackup2.append (fim); this->_Estado = QueEstado::RecebendoComando; this->t->start (TEMPONEGOCIACAO, true); } else { this->f__eu ("ERRO Comunicacao perdeu sincronismo."); return; } } else if (this->_Estado == QueEstado::EnviandoResComando) { if (inicio != "OK") { this->f__eu ("ERRO Comunicacao perdeu sincronismo."); return; } if (this->lstRetorno.isEmpty ()) { this->funcaosemnome(); } else { this->EnviaDado (QString("PA ") + this->lstRetorno.first()); this->lstRetorno.remove (this->lstRetorno.begin()); } } else { this->f__eu ("ERRO Comunicacao perdeu sincronismo."); return; } } } void comando::connectToHost (QString host, Q_UINT16 port) { DEBUGA ("void comando::connectToHost (QString, Q_UINT16);"); QSocket::connectToHost (host, port); this->t->start (TEMPONEGOCIACAO, true); } void comando::socketConnected () { DEBUGA ("void comando::socketConnected ();"); if (this->_Estado == QueEstado::Pronto) this->t->stop (); } void comando::funcaosemnome (void) { DEBUGA("void comando::funcaosemnome (void);"); QStringList s; int i, l; this->t->stop (); this->_Estado = QueEstado::Pronto; this->_flag = false; emit RespostaEnviada (QStringList (this->lstBackup2), QStringList (this->lstBackup3)); this->lstBackup2.clear(); this->lstBackup3.clear(); this->_flag = true; if (this->comandosNaFila.isEmpty()) { this->EnviaDado ("EX"); } else { s = QStringList::split (this->novalinha, this->comandosNaFila.first(), true); this->comandosNaFila.remove (this->comandosNaFila.begin()); l = s.count(); if (l > 0) { for (i=1; i<l; i++) { this->AdicionaParametros (s[i]); } this->Envia (s.first()); } } }
[ "amg1127@5465fe1f-e9f4-4a51-a9b0-42098c041c11" ]
amg1127@5465fe1f-e9f4-4a51-a9b0-42098c041c11
d8f7848d0c4501a6d8b7381c1483ec3f6862eb60
d62f26f81313b318b597a08762412f153e597f23
/1013_Battle_Over_Cities/1013_Battle_Over_Cities.cpp
e138f8a9a90111f5999c9e8addfee9d28fea9b4e
[]
no_license
DenryDu/PAT-TestSet
bee75c53c60e4da62307103955e572831975cca5
afa0fdd363461bcea56d439cd92b50ed982c0f2c
refs/heads/master
2022-11-04T21:45:30.020075
2020-03-08T13:17:04
2020-03-08T13:17:04
244,071,586
2
0
null
null
null
null
UTF-8
C++
false
false
891
cpp
#include <bits/stdc++.h> using namespace std; bool ways[1001][1001]={false}; int numCity, numWays, numCheck; void dfs(int index, bool* vis){ vis[index]=true; for(int i=1;i<=numCity;i++){ if(ways[index][i]==true&&vis[i]==false) dfs(i,vis); } } void check(int c){ int count=-1; bool visited[1001]={false}; visited[c]=true; for(int i=1; i<=numCity;i++){ if(!visited[i]){ dfs(i, visited); count++; } } cout<<count; } int main(){ //cin>>numCity>>numWays>>numCheck; scanf("%d %d %d", &numCity, &numWays, &numCheck); for(int i=0;i<numWays;i++){ int c1,c2; //cin>>c1>>c2; scanf("%d %d", &c1, &c2); ways[c1][c2]=ways[c2][c1]=true; } for(int j =0;j<numCheck;j++){ int c; //cin>>c; scanf("%d", &c); check(c); if(j<numCheck-1) cout<<endl; } return 0; }
[ "2364549135@qq.com" ]
2364549135@qq.com
e081e6e6cf7a5beb85855ba0627b13ff632c098b
112edff83fd52f7cd2b217728ff0d322e9cc8fb1
/libs/kasten/core/io/abstractsynctoremotejob_p.hpp
3d3871fe87d2bf73d15223f07ffdd54dcc7e9df7
[]
no_license
otilrac/okteta
839ee73dd9fae5ffa2d967d059e6cac421fcaf8e
89741587627c8e25cafe608e1b91284b66fd9d42
refs/heads/master
2023-05-06T04:23:15.194076
2021-05-29T01:16:30
2021-05-29T01:16:30
null
0
0
null
null
null
null
UTF-8
C++
false
false
865
hpp
/* This file is part of the Kasten Framework, made within the KDE community. SPDX-FileCopyrightText: 2008-2009 Friedrich W. H. Kossebau <kossebau@kde.org> SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL */ #ifndef KASTEN_ABSTRACTSYNCTOREMOTEJOB_P_HPP #define KASTEN_ABSTRACTSYNCTOREMOTEJOB_P_HPP #include "abstractsynctoremotejob.hpp" namespace Kasten { class AbstractSyncToRemoteJobPrivate { public: explicit AbstractSyncToRemoteJobPrivate(AbstractSyncToRemoteJob* parent); virtual ~AbstractSyncToRemoteJobPrivate(); protected: AbstractSyncToRemoteJob* const q_ptr; }; inline AbstractSyncToRemoteJobPrivate::AbstractSyncToRemoteJobPrivate(AbstractSyncToRemoteJob* parent) : q_ptr(parent) {} inline AbstractSyncToRemoteJobPrivate::~AbstractSyncToRemoteJobPrivate() = default; } #endif
[ "kossebau@kde.org" ]
kossebau@kde.org
51b680c7b5240f5b9a10794db45b8a98249296b8
9c6593b0ae4378233cdeba469ef1df73a32e5885
/Cael/src/cael/AccelerationFunction.h
0e2520afcb93ef2681a12506c31c5527a2baf6ee
[]
no_license
Dominicinator/Cael
f12a2ae99d7ce128b6e2f8df4c2b9528b060e851
8cd672a0395975543c2d6c4e30bb1e1b7590711b
refs/heads/master
2022-12-14T01:52:48.327540
2020-09-10T07:22:08
2020-09-10T07:22:08
219,253,067
0
0
null
null
null
null
UTF-8
C++
false
false
1,118
h
#pragma once #include "Utility.h" #include "SimulationState.h" #include "BarnesHutTree.h" #include <iostream> namespace Cael { enum Methods { SQUARE, BARNESHUT }; class AccelerationFunction { public: AccelerationFunction(); virtual ~AccelerationFunction(); virtual void frameinit(const SimulationState & state); virtual vec2d get(const Particle & particle, const SimulationState & state); }; class SquareAccelerationFunction : public AccelerationFunction { public: SquareAccelerationFunction(); virtual ~SquareAccelerationFunction(); void frameinit(const SimulationState & state); vec2d get(const Particle & particle, const SimulationState & state); }; class DistanceMatrixAccelerationFunction : public AccelerationFunction { }; class BarnesHutAccelerationFunction : public AccelerationFunction { public: BarnesHutAccelerationFunction(); virtual ~BarnesHutAccelerationFunction(); void frameinit(const SimulationState & state); vec2d get(const Particle & particle, const SimulationState & state); }; AccelerationFunction* getAccelerationFunction(const Methods & method); }
[ "dominicdonahue@gmail.com" ]
dominicdonahue@gmail.com
229c1edf94baa1dbbec4788cbd6cf11c9bb17949
93343c49771b6e6f2952d03df7e62e6a4ea063bb
/LeetCode/32.cpp
2ffccae3b247cf5c8ab82a63f92ca4beab25ff77
[]
no_license
Kiritow/OJ-Problems-Source
5aab2c57ab5df01a520073462f5de48ad7cb5b22
1be36799dda7d0e60bd00448f3906b69e7c79b26
refs/heads/master
2022-10-21T08:55:45.581935
2022-09-24T06:13:47
2022-09-24T06:13:47
55,874,477
36
9
null
2018-07-07T00:03:15
2016-04-10T01:06:42
C++
UTF-8
C++
false
false
1,199
cpp
#include <algorithm> #include <stack> class Solution { public: int longestValidParentheses(string s) { int len = s.size(); int maxp = 0; stack<int> stk; for (int i = 0; i < len; i++) { if (s[i] == '(') { stk.push(i); } else // if (s[i] == ')') { // Stack not empty, and symbol matches. if (!stk.empty() && s[stk.top()]=='(') { // Pop matched pairs. stk.pop(); if (stk.empty()) { // From Start to i is a valid string. maxp = std::max(i + 1, maxp); } else { // From stk.top()+1 to i is a valid string. Length: i-(stk.top()+1)+1 maxp = std::max(i - stk.top(), maxp); } } else { // new start point (stub) stk.push(i); } } } return maxp; } };
[ "noreply@github.com" ]
noreply@github.com
0b4c888e501ad8cca06d9a1c55dfdc74863b32d8
91ec6f5b701e52c7c4cf99b58bf7eb1077b05be2
/ICPC/HBCPC2019题解/标程仅供参考/E.cpp
af36ee75a911292dc004b79ee21701ae4799f344
[]
no_license
MuMuloveU/ACM_contest_problem
c71653f56db0bc30175da5ef06969b8cf557b4d5
d253935c3dcc856fa4d20a6ccfd6a36d8a41970b
refs/heads/master
2023-03-18T17:22:15.705604
2020-09-01T10:11:16
2020-09-01T10:11:16
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,312
cpp
#include <bits/stdc++.h> using namespace std; const int maxn = 2e5 + 5; int n, m, t; int a[maxn]; int b[maxn]; struct bittree { int tree[maxn]; int lowbit(int x) { return x & -x; } int sum(int p) { int ret = 0; while (p) { ret += tree[p]; p -= lowbit(p); } return ret; } int update(int p, int x) { while (p <= n) { tree[p] += x; p += lowbit(p); } return 0; } int query(int l, int r) { if (l > r) { return 0; } return sum(r) - sum(l - 1); } int init() { memset(tree, 0, sizeof(tree)); return 0; } } tree[2]; int read() { int x; scanf("%d", &x); return x; } #define ck(x, l, r) if((x < l) || (x > r)) {\ return 0;} int main() { int i, j; n = read(); ck(n, 1, 1e5); tree[0].init(); tree[1].init(); for (i = 1; i <= n; i++) { b[read()] = i; a[i] = read(); ck(a[i], n, 2 * n); tree[1].update(i, 1); } for (i = 1; i <= n; i++) { tree[1].update(b[a[i]], -1); tree[0].update(b[a[i]], 1); printf("%d\n", tree[0].query(b[a[i]] + 1, n) + tree[1].query(1, b[a[i]] - 1)); } return 0; }
[ "229781766@qq.com" ]
229781766@qq.com