hexsha
stringlengths
40
40
size
int64
7
1.05M
ext
stringclasses
13 values
lang
stringclasses
1 value
max_stars_repo_path
stringlengths
4
269
max_stars_repo_name
stringlengths
5
108
max_stars_repo_head_hexsha
stringlengths
40
40
max_stars_repo_licenses
listlengths
1
9
max_stars_count
int64
1
191k
max_stars_repo_stars_event_min_datetime
stringlengths
24
24
max_stars_repo_stars_event_max_datetime
stringlengths
24
24
max_issues_repo_path
stringlengths
4
269
max_issues_repo_name
stringlengths
5
116
max_issues_repo_head_hexsha
stringlengths
40
40
max_issues_repo_licenses
listlengths
1
9
max_issues_count
int64
1
67k
max_issues_repo_issues_event_min_datetime
stringlengths
24
24
max_issues_repo_issues_event_max_datetime
stringlengths
24
24
max_forks_repo_path
stringlengths
4
269
max_forks_repo_name
stringlengths
5
116
max_forks_repo_head_hexsha
stringlengths
40
40
max_forks_repo_licenses
listlengths
1
9
max_forks_count
int64
1
105k
max_forks_repo_forks_event_min_datetime
stringlengths
24
24
max_forks_repo_forks_event_max_datetime
stringlengths
24
24
content
stringlengths
7
1.05M
avg_line_length
float64
1.21
330k
max_line_length
int64
6
990k
alphanum_fraction
float64
0.01
0.99
author_id
stringlengths
2
40
0a1c8727f3c2000aa50907fa3bb8fea195659d7d
14,493
cpp
C++
assembler_teleop/src/TeleopVirtualRobot.cpp
jacknlliu/assembler
91055547b595e3104c8b56c758949fe35643f07e
[ "MIT" ]
3
2018-05-04T07:06:51.000Z
2021-08-09T02:53:29.000Z
assembler_teleop/src/TeleopVirtualRobot.cpp
jacknlliu/assembler
91055547b595e3104c8b56c758949fe35643f07e
[ "MIT" ]
3
2017-10-14T14:12:41.000Z
2019-08-29T12:39:42.000Z
assembler_teleop/src/TeleopVirtualRobot.cpp
jacknlliu/assembler
91055547b595e3104c8b56c758949fe35643f07e
[ "MIT" ]
2
2020-12-29T06:19:52.000Z
2021-08-09T02:53:33.000Z
#include "assembler_teleop/TeleopVirtualRobot.h" #include "assembler_teleop/general_keyboard.h" // MoveIt! #include <moveit/robot_model_loader/robot_model_loader.h> #include <moveit/robot_model/robot_model.h> #include <moveit/robot_state/robot_state.h> // action lib #include <actionlib/client/simple_action_client.h> #include "control_msgs/FollowJointTrajectoryAction.h" #include <actionlib/client/terminal_state.h> #include "trajectory_msgs/JointTrajectoryPoint.h" #include <Eigen/Geometry> TeleopVirtualRobot::TeleopVirtualRobot(ros::NodeHandle & nh, RobotOperateMode op_mode): ac_("/arm_gazebo_controller/follow_joint_trajectory", true) ,arm_commander_("manipulator"), robot_model_loader_("robot_description") { ac_.waitForServer(); reached_goal_ = true; SetOperateMode(op_mode); // init data members command_send_period_ = 0.001; // unit: s control_executation_period_ = 0.008; // better to use moveit API get the joints names or use parse robot_description with group name std::vector<std::string> arm_joints_name; std::vector<std::string> tool_joints_name; nh_ = nh; // nh_.getParam("robot_joints/arm_joints", arm_joints_name); // nh_.getParam("robot_joints/tool_joints", tool_joints_name); arm_joints_name.push_back("shoulder_pan_joint"); arm_joints_name.push_back("shoulder_lift_joint"); arm_joints_name.push_back("elbow_joint"); arm_joints_name.push_back("wrist_1_joint"); arm_joints_name.push_back("wrist_2_joint"); arm_joints_name.push_back("wrist_3_joint"); tool_joints_name.push_back("bh_j11_joint"); tool_joints_name.push_back("bh_j12_joint"); tool_joints_name.push_back("bh_j22_joint"); tool_joints_name.push_back("bh_j32_joint"); // !!! moviet not provide empty parameter construct function, so we must initial our member in initial list firstly. // moveit::planning_interface::MoveGroupInterface move_group("manipulator"); // arm_commander_ = move_group; SetArmJointsName(arm_joints_name); SetToolJointsName(tool_joints_name); kinematic_model_ = robot_model_loader_.getModel(); kinematic_state_ = robot_state::RobotStatePtr(new robot_state::RobotState(kinematic_model_)); joint_model_group_ = kinematic_model_->getJointModelGroup("manipulator"); // connect haptic device bool device_connected = ConnectHapticDevice(); if (op_mode == RobotOperateMode::TELEOP_MODE); { assert(device_connected); } std::vector<double> stretch={1.0, 1.0, 1.0}; if (GetHapticDeviceHandler()->IsConnected()) { GetHapticDeviceHandler()->SetStretch(stretch); } } void TeleopVirtualRobot::start() { RegisterCallback(); // keep alive EnableRobot(); listen_input_thread_ = std::make_shared<std::thread>( boost::bind(&TeleopVirtualRobot::ListenInputThreadRun, this)); ros::AsyncSpinner spinner(2); spinner.start(); while (ros::ok() && (keepalive_ == true)) { ros::Duration(0.001).sleep(); // ROS_INFO("working in main loop"); // usleep(1000); } DisableRobot(); } TeleopVirtualRobot::~TeleopVirtualRobot() { DisableRobot(); } // callback member function void TeleopVirtualRobot::RegisterCallback() { sub_joint_state_ = nh_.subscribe("joint_states", 20, &TeleopVirtualRobot::JointStatesCallback, this); send_command_timer_ = nh_.createTimer(ros::Duration(0.008), &TeleopVirtualRobot::SendCommandTimer, this); } void TeleopVirtualRobot::JointStatesCallback(const sensor_msgs::JointState::ConstPtr& joint_msg) { val_lock_.lock(); // joint position joint_states_msg_ = *joint_msg; auto it = joint_msg->name.begin(); // dump data // not using hardcode, but will decrease the efficience for (size_t i = 0; i < tool_joints_name_.size(); i++) { it=std::find(joint_msg->name.begin(), joint_msg->name.end(),tool_joints_name_[i]); if (it != joint_msg->name.end()) { joints_position_[tool_joints_name_[i]] = joint_msg->position[it -joint_msg->name.begin()]; joints_velocity_[tool_joints_name_[i]] = joint_msg->velocity[it-joint_msg->name.begin()]; joints_effort_[tool_joints_name_[i]] = joint_msg->effort[it-joint_msg->name.begin()]; } } for (size_t i = 0; i < arm_joints_name_.size(); i++) { it=std::find(joint_msg->name.begin(), joint_msg->name.end(),arm_joints_name_[i]); if (it != joint_msg->name.end()) { joints_position_[arm_joints_name_[i]] = joint_msg->position[it -joint_msg->name.begin()]; joints_velocity_[arm_joints_name_[i]] = joint_msg->velocity[it-joint_msg->name.begin()]; joints_effort_[arm_joints_name_[i]] = joint_msg->effort[it-joint_msg->name.begin()]; } } val_lock_.unlock(); } void TeleopVirtualRobot::ToolWrechCallback(const geometry_msgs::WrenchStamped::ConstPtr& wrench_msg) { } geometry_msgs::PoseStamped TeleopVirtualRobot::GetCurrentArmEndPose() { // current end effector link is wrist_3_link in group "manipulator" return arm_commander_.getCurrentPose(arm_commander_.getEndEffectorLink()); } // void TeleopVirtualRobot::ToolPoseCallback(const geometry_msgs::PoseStamped::ConstPtr& tool_msg) // { // } // void TeleopVirtualRobot::ToolVelocityCallback(const geometry_msgs::TwistStamped::ConstPtr& vel_msg) // { // } // operate void TeleopVirtualRobot::SendCommandTimer(const ros::TimerEvent& event) { // delta handler pose add the end tool pose // get the new data from handler std::vector<double> new_position{0.0, 0.0, 0.0}; double haptic_end_move_pose[6] = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0}; Eigen::Affine3d end_pose_command = Eigen::Affine3d::Identity(); double end_velocity_cmd[6] = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0}; if (!haptic_dev_->IsLocked()) { if (haptic_dev_->IsConnected()) { // for TELEOP_MODE new_position = haptic_dev_->GetEndPosition(); val_lock_.lock(); for (int i=0;i<3;i++) { haptic_end_move_pose[i] = (new_position[i] - haptic_unlock_data_[i]) * haptic_dev_->GetStretch()[i]; } haptic_unlock_data_ = new_position; val_lock_.unlock(); ROS_INFO("get handler pos:[%1.5f, %1.5f, %1.5f]", new_position[0], new_position[1], new_position[2]); // map_pos[0] = -send[1]; // left, right // map_pos[2] = send[0]; // forward, backward // map_pos[1] = -send[2]; // up, down end_pose_command.translation() = Eigen::Vector3d(haptic_end_move_pose[1], - haptic_end_move_pose[0], haptic_end_move_pose[2]); // We use sample_period as velocity computing time, since we always // get/send position difference with the nearest sample data. end_velocity_cmd[0] = end_pose_command.translation()(0)/command_send_period_; end_velocity_cmd[1] = end_pose_command.translation()(1)/command_send_period_; end_velocity_cmd[2] = end_pose_command.translation()(2)/command_send_period_; SendPoseCmdToRobot(end_pose_command); } else { // for AUTO_MODE // if (operate_mode_ == AUTO_MODE) // { // doAutonomyOP(); // } } } } void TeleopVirtualRobot::SendPoseCmdToRobot(Eigen::Affine3d end_pose_cmd) { ROS_INFO("init end pose cmd is: %f , %f , %f", end_pose_cmd.translation()(0), end_pose_cmd.translation()(1), end_pose_cmd.translation()(2)); std::map<std::string, double> arm_joint_position; std::map<std::string, double> arm_joint_vel; std::map<std::string, double> arm_joint_acc; for (size_t i = 0; i < arm_joints_name_.size(); i++) { arm_joint_position[arm_joints_name_[i]] = 0.0; arm_joint_vel[arm_joints_name_[i]] = 0.0; arm_joint_acc[arm_joints_name_[i]] = 0.0; } // Get current robot end pose auto current_end_pose = GetCurrentArmEndPose(); ROS_INFO("current pose is %f, %f, %f", current_end_pose.pose.position.x, current_end_pose.pose.position.y, current_end_pose.pose.position.z); // end_pose_cmd = end_pose_cmd + current_end_pose; end_pose_cmd.translation()(0) = current_end_pose.pose.position.x + end_pose_cmd.translation()(0); end_pose_cmd.translation()(1) = current_end_pose.pose.position.y + end_pose_cmd.translation()(1); end_pose_cmd.translation()(2) = current_end_pose.pose.position.z + end_pose_cmd.translation()(2); Eigen::Quaterniond rot(current_end_pose.pose.orientation.w, current_end_pose.pose.orientation.x, current_end_pose.pose.orientation.y, current_end_pose.pose.orientation.z); end_pose_cmd.linear() = rot.toRotationMatrix() * end_pose_cmd.linear(); // using arm IK solver with moveit bool found_ik_solution = GetArmIK(end_pose_cmd, arm_joint_position); if (found_ik_solution) { for (size_t i = 0; i < arm_joints_name_.size(); i++) { // TODO: should not this velocity arm_joint_vel[arm_joints_name_[i]] = arm_joint_position[arm_joints_name_[i]]/command_send_period_ ; } ROS_INFO("we get the IK solution"); // send to robot using robot joint controller SendJointTrajectoryCmd(arm_joint_position, arm_joint_vel, arm_joint_acc); } } bool TeleopVirtualRobot::GetArmIK(Eigen::Affine3d end_pose, std::map<std::string, double> & ret) { // print model frame ROS_INFO("Model frame: %s", kinematic_model_->getModelFrame().c_str()); val_lock_.lock(); kinematic_state_->setVariableValues(joint_states_msg_); // update current state val_lock_.unlock(); kinematic_state_->update(); std::vector<double> joint_values; const std::vector<std::string> joint_names = joint_model_group_->getJointModelNames(); // do inverse kinematics bool found_ik = kinematic_state_->setFromIK(joint_model_group_, end_pose, 10, 0.1); // Now, we can print out the IK solution (if found): if (found_ik) { kinematic_state_->copyJointGroupPositions(joint_model_group_, joint_values); for(std::size_t i=0; i < joint_names.size(); ++i) { ROS_INFO("We get inverse Joint %s: %f", joint_names[i].c_str(), joint_values[i]); ROS_INFO("The current joint %s: %f", joint_names[i].c_str(), joints_position_[joint_names[i]]); } for (std::size_t i = 0; i < joint_names.size(); i++) { ret[joint_names[i]] = joint_values[i]; } } else { ROS_INFO("Did not find IK solution"); } return found_ik; } void TeleopVirtualRobot::SendJointTrajectoryCmd(std::map<std::string, double> position, std::map<std::string, double> vel, std::map<std::string, double> acc) { // using joint trajectory controller // we will send these joint value to the arm in gazebo use arm_controller ROS_INFO("Waiting for action server to start."); // wait for the action server to start ac_.waitForServer(); //will wait for infinite time ROS_INFO("Action server started, sending goal."); // send a goal to the action control_msgs::FollowJointTrajectoryGoal goal; for (auto it=position.begin(); it != position.end(); it++) { goal.trajectory.joint_names.push_back(it->first); } goal.trajectory.points.resize(1); int index = 0; goal.trajectory.points[index].positions.resize(position.size()); goal.trajectory.points[index].velocities.resize(position.size()); for (size_t i = 0; i < arm_joints_name_.size(); i++) { goal.trajectory.points[index].positions[i] = position[goal.trajectory.joint_names[i]]; goal.trajectory.points[index].velocities[i] = vel[goal.trajectory.joint_names[i]]; } goal.trajectory.points[index].time_from_start = ros::Duration(control_executation_period_); // duration for executing the trajectory ac_.sendGoal(goal); //wait for the action to return bool finished_before_timeout = ac_.waitForResult(ros::Duration(10.0)); if (finished_before_timeout) { actionlib::SimpleClientGoalState state = ac_.getState(); } else ROS_INFO("Action did not finish before the time out."); } // void TeleopVirtualRobot::DoAutonomyOP(); // // cartesian space move // int TeleopVirtualRobot::MoveEndSpeedL(double end_relative_pose[]); // int TeleopVirtualRobot::MoveEndL(double pose[], double a=1.2, double v=0.25, double t=0.02, double r=0); // int TeleopVirtualRobot::MoveEndRelativeL(double pose[], double a=1.2, double v=0.25, double t=0.02, double r=0); // int TeleopVirtualRobot::SetToolPose(double tool_pose[], int length); // // joint space move // int TeleopVirtualRobot::MoveServoj(double pose[], double a, double v, double t=0); // // get robot states // int TeleopVirtualRobot::GetCurrentJointStates(double angle[], int length); // int TeleopVirtualRobot::GetCurrentWrenchState(double wrech[], int length); // int TeleopVirtualRobot::GetToolPose(double tool_pose[], int length); // // stop // int TeleopVirtualRobot::halt(); // join the listenHandlerThread // // lock // void TeleopVirtualRobot::setHandlerLockFlag(bool flag); // bool TeleopVirtualRobot::isHandlerLocked() // { // } void TeleopVirtualRobot::SendSafetyCommand() { double init_vel[6]={0.0, 0.0, 0.0,0.0, 0.0, 0.0}; // speedL(init_vel); } void TeleopVirtualRobot::ListenInputThreadRun() { ROS_INFO("listen input thread run"); if (ros::ok() && keepalive_ ) { static int count = 0; double a[3] = {0.0, 0.0, 0.0}; char keyboard_input; while(ros::ok() && 'q' != (keyboard_input=getKbhit())) { if (keyboard_input == 'p') { count = (count+1)%2; SendSafetyCommand(); if (count%2) { val_lock_.lock(); haptic_unlock_data_ = haptic_dev_->GetEndPosition(); val_lock_.unlock(); haptic_dev_->SetLocked(false); ROS_INFO("Start getting handler data..."); } else { haptic_dev_->SetLocked(true); ROS_INFO("Stop getting handler data!"); } } // for avoiding cpu 100% std::this_thread::sleep_for(std::chrono::microseconds(1000)); } // we will exit this thread, we should keep all move stop! SendSafetyCommand(); ROS_INFO("Exit listen handler data"); haptic_dev_->SetLocked(true); // let's shutdown everything! keepalive_ = false; ros::shutdown(); } }
32.641892
157
0.678879
jacknlliu
0a1f81157651a74e62edf4e74d91cc04a20d0d72
2,872
cpp
C++
test/core/test_read_integrator.cpp
yutakasi634/Mjolnir
ab7a29a47f994111e8b889311c44487463f02116
[ "MIT" ]
12
2017-02-01T08:28:38.000Z
2018-08-25T15:47:51.000Z
test/core/test_read_integrator.cpp
Mjolnir-MD/Mjolnir
043df4080720837042c6b67a5495ecae198bc2b3
[ "MIT" ]
60
2019-01-14T08:11:33.000Z
2021-07-29T08:26:36.000Z
test/core/test_read_integrator.cpp
yutakasi634/Mjolnir
ab7a29a47f994111e8b889311c44487463f02116
[ "MIT" ]
8
2019-01-13T11:03:31.000Z
2021-08-01T11:38:00.000Z
#define BOOST_TEST_MODULE "test_read_integrator" #ifdef BOOST_TEST_DYN_LINK #include <boost/test/unit_test.hpp> #else #include <boost/test/included/unit_test.hpp> #endif #include <mjolnir/core/BoundaryCondition.hpp> #include <mjolnir/core/SimulatorTraits.hpp> #include <mjolnir/input/read_integrator.hpp> BOOST_AUTO_TEST_CASE(read_velocity_verlet_integrator) { mjolnir::LoggerManager::set_default_logger("test_read_integrator.log"); using real_type = double; using traits_type = mjolnir::SimulatorTraits<real_type, mjolnir::UnlimitedBoundary>; constexpr real_type tol = 1e-8; { using namespace toml::literals; const auto v = u8R"( delta_t = 0.1 )"_toml; const auto integr = mjolnir::read_velocity_verlet_integrator<traits_type>(v); BOOST_TEST(integr.delta_t() == 0.1, boost::test_tools::tolerance(tol)); } } BOOST_AUTO_TEST_CASE(read_underdamped_langevin_integrator) { mjolnir::LoggerManager::set_default_logger("test_read_integrator.log"); using real_type = double; using traits_type = mjolnir::SimulatorTraits<real_type, mjolnir::UnlimitedBoundary>; constexpr real_type tol = 1e-8; { using namespace toml::literals; const auto v = u8R"( delta_t = 0.1 integrator.seed = 1234 integrator.parameters = [ {index = 0, gamma = 0.1}, {index = 1, gamma = 0.2}, ] )"_toml; const auto integr = mjolnir::read_underdamped_langevin_integrator<traits_type>(v); BOOST_TEST(integr.delta_t() == 0.1, boost::test_tools::tolerance(tol)); BOOST_TEST(integr.parameters().size() == 2u); BOOST_TEST(integr.parameters().at(0) == 0.1, boost::test_tools::tolerance(tol)); BOOST_TEST(integr.parameters().at(1) == 0.2, boost::test_tools::tolerance(tol)); } } BOOST_AUTO_TEST_CASE(read_BAOAB_langevin_integrator) { mjolnir::LoggerManager::set_default_logger("test_read_integrator.log"); using real_type = double; using traits_type = mjolnir::SimulatorTraits<real_type, mjolnir::UnlimitedBoundary>; constexpr real_type tol = 1e-8; { using namespace toml::literals; const auto v = u8R"( delta_t = 0.1 integrator.seed = 1234 integrator.parameters = [ {index = 0, gamma = 0.1}, {index = 1, gamma = 0.2}, ] )"_toml; const auto integr = mjolnir::read_underdamped_langevin_integrator<traits_type>(v); BOOST_TEST(integr.delta_t() == 0.1, boost::test_tools::tolerance(tol)); BOOST_TEST(integr.parameters().size() == 2u); BOOST_TEST(integr.parameters().at(0) == 0.1, boost::test_tools::tolerance(tol)); BOOST_TEST(integr.parameters().at(1) == 0.2, boost::test_tools::tolerance(tol)); } }
35.45679
90
0.654596
yutakasi634
0a2153c886dbedee76fcba89030c671bb4b876aa
3,781
cpp
C++
ChessMateEngine/engine/move_selector.cpp
trflynn89/chessmate
92261c290edebd0f6c52aff84656b734467697ca
[ "MIT" ]
null
null
null
ChessMateEngine/engine/move_selector.cpp
trflynn89/chessmate
92261c290edebd0f6c52aff84656b734467697ca
[ "MIT" ]
null
null
null
ChessMateEngine/engine/move_selector.cpp
trflynn89/chessmate
92261c290edebd0f6c52aff84656b734467697ca
[ "MIT" ]
null
null
null
#include "move_selector.h" #include "movement/valid_move_set.h" #include <fly/fly.hpp> #include <algorithm> namespace chessmate { namespace { static const int s_posInfinity = 32767; static const int s_negInfinity = -32767; } // namespace //================================================================================================== MoveSelector::MoveSelector( const std::shared_ptr<MoveSet> &spMoveSet, const std::shared_ptr<BitBoard> &spBoard, const color_type &engineColor) : m_wpMoveSet(spMoveSet), m_wpBoard(spBoard), m_engineColor(engineColor), m_evaluator(engineColor) { FLY_UNUSED(m_engineColor); } //================================================================================================== Move MoveSelector::GetBestMove(const value_type &maxDepth) const { std::shared_ptr<BitBoard> spBoard = m_wpBoard.lock(); ValidMoveSet vms(m_wpMoveSet, spBoard); MoveList moves = vms.GetMyValidMoves(); value_type bestValue = s_negInfinity; Move bestMove; for (auto it = moves.begin(); it != moves.end(); ++it) { std::shared_ptr<BitBoard> spResult = result(spBoard, *it); value_type oldVal = bestValue; value_type min = minValue(spResult, maxDepth, s_negInfinity, s_posInfinity); bestValue = std::max(bestValue, min); if (bestValue > oldVal) { bestMove = *it; } } return bestMove; } //================================================================================================== value_type MoveSelector::maxValue( const std::shared_ptr<BitBoard> &spBoard, const value_type &depth, value_type alpha, value_type beta) const { ValidMoveSet vms(m_wpMoveSet, spBoard); value_type score = m_evaluator.Score(spBoard, vms); if (reachedEndState(depth, score)) { return score; } MoveList moves = vms.GetMyValidMoves(); value_type v = s_negInfinity; for (auto it = moves.begin(); it != moves.end(); ++it) { std::shared_ptr<BitBoard> spResult = result(spBoard, *it); v = std::max(v, minValue(spResult, depth - 1, alpha, beta)); if (score >= beta) { return v; } alpha = std::max(alpha, v); } return v; } //================================================================================================== value_type MoveSelector::minValue( const std::shared_ptr<BitBoard> &spBoard, const value_type &depth, value_type alpha, value_type beta) const { ValidMoveSet vms(m_wpMoveSet, spBoard); value_type score = m_evaluator.Score(spBoard, vms); if (reachedEndState(depth, score)) { return score; } MoveList moves = vms.GetMyValidMoves(); value_type v = s_posInfinity; for (auto it = moves.begin(); it != moves.end(); ++it) { std::shared_ptr<BitBoard> spResult = result(spBoard, *it); v = std::min(v, maxValue(spResult, depth - 1, alpha, beta)); if (score <= alpha) { return v; } beta = std::min(beta, v); } return v; } //================================================================================================== std::shared_ptr<BitBoard> MoveSelector::result(const std::shared_ptr<BitBoard> &spBoard, Move move) const { BitBoard copy(*spBoard); copy.MakeMove(move); return std::make_shared<BitBoard>(copy); } //================================================================================================== bool MoveSelector::reachedEndState(const value_type &depth, const value_type &score) const { return ((depth <= 1) || (score == s_posInfinity) || (score == s_negInfinity) || (score == 0)); } } // namespace chessmate
26.626761
100
0.533986
trflynn89
0a218c8b50f44fe32678084c7cdeeff0359fdbb0
2,743
cpp
C++
components/xtl/tests/stl/str_04.cpp
untgames/funner
c91614cda55fd00f5631d2bd11c4ab91f53573a3
[ "MIT" ]
7
2016-03-30T17:00:39.000Z
2017-03-27T16:04:04.000Z
components/xtl/tests/stl/str_04.cpp
untgames/Funner
c91614cda55fd00f5631d2bd11c4ab91f53573a3
[ "MIT" ]
4
2017-11-21T11:25:49.000Z
2018-09-20T17:59:27.000Z
components/xtl/tests/stl/str_04.cpp
untgames/Funner
c91614cda55fd00f5631d2bd11c4ab91f53573a3
[ "MIT" ]
4
2016-11-29T15:18:40.000Z
2017-03-27T16:04:08.000Z
//Тестирование find_first_not_of #include <stdio.h> #include <stl/string> using namespace stl; int main() { printf ("Results of str_04:\n"); // The first member function searches for a single character in a string string str1 ( "xddd-1234-abcd" ); printf ("The original string str1 is: '%s'\n", str1.c_str ()); string::size_type index; const string::size_type npos = string::npos; index = str1.find_first_not_of ("d", 2); if ( index != npos ) printf ("found str[%lu] = '%c'\n", index, str1 [index]); else printf ("The character 'd' was not found in str1.\n"); index = str1.find_first_not_of ("x"); if (index != npos ) printf ("found str[%lu] = '%c'\n", index, str1 [index]); else printf ("The character 'non x' was not found in str1.\n"); // The second member function searches a string for a substring as specified by a C-string string str2 ( "BBB-1111" ); printf ("The original string str2 is: '%s'\n", str2.c_str ()); const char *cstr2 = "B1"; index = str2.find_first_not_of (cstr2, 6); if (index != npos) printf ("found str[%lu] = '%c'\n", index, str2 [index]); else printf ("Elements of the substring 'B1' were not found in str2 after the 6th position.\n"); index = str2.find_first_not_of (cstr2); if ( index != npos ) printf ("found str[%lu] = '%c'\n", index, str2 [index]); else printf ("The substring 'B1' was not found in str2.\n"); string str3 ( "444-555-GGG" ); printf ("The original string str3 is: '%s'\n", str3.c_str ()); const char *cstr3 = "45G"; string::size_type index2 = str3.find_first_not_of (cstr3); if ( index2 != npos ) printf ("found str[%lu] = '%c'\n", index2, str3 [index2]); else printf ("Elements in str3 contain only characters in the string '45G'.\n"); index = str3.find_first_not_of (cstr3, index2 + 1, 2); if (index != npos) printf ("found str[%lu] = '%c'\n", index, str3 [index]); else printf ("Elements in str3 contain only characters in the string '45G'.\n"); // The fourth member function searches a string for a substring as specified by a string string str4 ( "12-ab-12-ab" ); printf ("The original string str4 is: '%s'\n", str4.c_str ()); string str4a ( "ba3" ); index = str4.find_first_not_of (str4a, 5); if (index != npos) printf ("found str[%lu] = '%c'\n", index, str4 [index]); else printf ("Elements other than those in the substring 'ba3' were not found in the string str4.\n"); string str4b ( "12" ); index = str4.find_first_not_of (str4b); if (index != npos ) printf ("found str[%lu] = '%c'\n", index, str4 [index]); else printf ("Elements other than those in the substring '12' were not found in the string str4.\n"); return 0; }
33.45122
100
0.637258
untgames
0a23228e4cbe1410a64afc44bf67c9fddb7a7b97
5,364
hpp
C++
ProMini_Slave/include/ArduinoNano_Iic.hpp
RafaelReyesCarmona/DucoCluster
755fa6ab57129afdc65050514e654660a6b9e8eb
[ "MIT" ]
null
null
null
ProMini_Slave/include/ArduinoNano_Iic.hpp
RafaelReyesCarmona/DucoCluster
755fa6ab57129afdc65050514e654660a6b9e8eb
[ "MIT" ]
null
null
null
ProMini_Slave/include/ArduinoNano_Iic.hpp
RafaelReyesCarmona/DucoCluster
755fa6ab57129afdc65050514e654660a6b9e8eb
[ "MIT" ]
null
null
null
/* * Project: DuinoCoinRig * File: ArduinoNano_Iic * Version: 0.2 * Purpose: Communication with the master * Author: Frank Niggemann */ /*********************************************************************************************************************** * Code Iic **********************************************************************************************************************/ void iicSetup() { pinMode(PIN_IIC_SDA, INPUT_PULLUP); pinMode(PIN_IIC_SCL, INPUT_PULLUP); Wire.begin(); for (int id=IIC_ID_MIN; id<IIC_ID_MAX; id++) { Wire.beginTransmission(id); int result = Wire.endTransmission(); if (result != 0) { iic_id = id; break; } } Wire.end(); logMessage("Address ID: "+String(iic_id)); Wire.begin(iic_id); Wire.onReceive(iicHandlerReceive); Wire.onRequest(iicHandlerRequest); ducoId = getDucoId(); logMessage("DUCO ID: "+ducoId); ledBlink(PIN_LED_ADDRESS, 250, 250); ledBlink(PIN_LED_ADDRESS, 250, 250); setState(SLAVE_STATE_FREE); } void iicHandlerReceive(int numBytes) { if (numBytes == 0) { return; } while (Wire.available()) { char c = Wire.read(); bufferReceive.write(c); } } void iicHandlerRequest() { char c = '\n'; if (bufferRequest.available() > 0 && bufferRequest.indexOf('\n') != -1) { c = bufferRequest.read(); } Wire.write(c); } void iicWorker() { if (bufferReceive.available() > 0 && bufferReceive.indexOf('\n') != -1) { setState(SLAVE_STATE_WORKING); logMessage("Request: "+String(bufferReceive)); String lastblockhash = bufferReceive.readStringUntil(','); String newblockhash = bufferReceive.readStringUntil(','); unsigned int difficulty = bufferReceive.readStringUntil('\n').toInt(); unsigned long startTime = micros(); unsigned int ducos1result = 0; if (difficulty < 655) ducos1result = Ducos1a.work(lastblockhash, newblockhash, difficulty); unsigned long endTime = micros(); unsigned long elapsedTime = endTime - startTime; while (bufferRequest.available()) bufferRequest.read(); bufferRequest.print(String(ducos1result) + "," + String(elapsedTime) + "," + ducoId + "\n"); setState(SLAVE_STATE_FREE); logMessage("Result: "+String(ducos1result) + "," + String(elapsedTime) + "," + ducoId); } } /* byte iic_id = 0; StreamString bufferReceive; String stringReceive = ""; StreamString bufferRequest; String stringRequest = ""; String lastBlockHash = ""; String nextBlockHash = ""; unsigned int ducos1aResult = 0; unsigned long microtimeStart = 0; unsigned long microtimeEnd = 0; unsigned long microtimeDifference = 0; String ducoId = ""; void iicSetup() { pinMode(WIRE_SDA, INPUT_PULLUP); pinMode(WIRE_SCL, INPUT_PULLUP); Wire.begin(); for (int id=IIC_ID_MIN; id<IIC_ID_MAX; id++) { Wire.beginTransmission(id); int result = Wire.endTransmission(); if (result != 0) { iic_id = id; break; } } Wire.end(); logMessage("Use ID: "+String(iic_id)); Wire.begin(iic_id); Wire.onReceive(iicHandlerReceive); Wire.onRequest(iicHandlerRequest); ducoId = getDucoId(); ledBlink(PIN_LED_ADDRESS, 250, 250); ledBlink(PIN_LED_ADDRESS, 250, 250); setState(SLAVE_STATE_FREE); } void iicHandlerReceive(int numBytes) { if (numBytes != 0) { while (Wire.available()) { char c = Wire.read(); bufferReceive.write(c); ledBlink(PIN_LED_ADDRESS, 100, 100); } } } void iicEvaluateBufferReceive() { if (bufferReceive.available() > 0 && bufferReceive.indexOf('\n') != -1) { if (bufferReceive.length() < 10) { } else { lastBlockHash = bufferReceive.readStringUntil(','); nextBlockHash = bufferReceive.readStringUntil(','); unsigned int difficulty = bufferReceive.readStringUntil('\n').toInt(); logMessage("Receive lastBlockHash: "+lastBlockHash); logMessage("Receive nextBlockHash: "+nextBlockHash); logMessage("Receive difficulty: "+String(difficulty)); if (lastBlockHash!="" && nextBlockHash!="") { setState(SLAVE_STATE_WORKING); digitalWrite(PIN_LED_WORKING, HIGH); microtimeStart = micros(); ducos1aResult = 0; if (difficulty < 655){ ducos1aResult = Ducos1a.work(lastBlockHash, nextBlockHash, difficulty); } logMessage("Calculated result: "+String(ducos1aResult)); microtimeEnd = micros(); microtimeDifference = microtimeEnd - microtimeStart; setState(SLAVE_STATE_READY); digitalWrite(PIN_LED_READY, HIGH); delay(100); iicSetBufferRequestStringJobResult(); } else { setState(SLAVE_STATE_ERROR); logMessage("ERROR"); } } } } void iicHandlerRequest() { char c = '\n'; if (bufferRequest.available() > 0 && bufferRequest.indexOf('\n') != -1) { c = bufferRequest.read(); } Wire.write(c); if (slaveState == SLAVE_STATE_RESULT_READY && bufferRequest.available() == 0) { setState(SLAVE_STATE_RESULT_SENT); } } void iicSetBufferRequestStringEmpty() { String request = ""; } void iicSetBufferRequestStringJobResult() { while (bufferRequest.available()) bufferRequest.read(); String request = String(ducos1aResult)+":"+String(microtimeDifference)+":"+ducoId+"\n"; logMessage(request); bufferRequest.print(request); setState(SLAVE_STATE_RESULT_SENT); } */
28.531915
120
0.634787
RafaelReyesCarmona
0a2426fc10dd21a7083989c1545325e579e1a868
153
cpp
C++
src/La Trop/map/map.cpp
branchwelder/SoftSysHedonisticHibiscus
c6c652191bb10fcbf2e6f990de84fa9a9211f459
[ "MIT" ]
null
null
null
src/La Trop/map/map.cpp
branchwelder/SoftSysHedonisticHibiscus
c6c652191bb10fcbf2e6f990de84fa9a9211f459
[ "MIT" ]
2
2020-07-17T20:01:46.000Z
2020-07-17T20:01:54.000Z
src/La Trop/map/map.cpp
branchwelder/SoftSysHedonisticHibiscus
c6c652191bb10fcbf2e6f990de84fa9a9211f459
[ "MIT" ]
null
null
null
// // map.cpp // La Trop // // Created by Sam Myers on 4/24/17. // Copyright © 2017 Hedonistic Hibiscus. All rights reserved. // #include "map.hpp"
15.3
62
0.633987
branchwelder
0a251785a9c469357a6cd7c1c93f59e78f6e22d1
243
hpp
C++
TemplateRPG/Items/special/other_items.hpp
davideberdin/Text-Turn-based-RPG-Template
3b1e88b6498b7473b3928e7188157a7d7f1ba844
[ "MIT" ]
1
2015-11-29T04:47:29.000Z
2015-11-29T04:47:29.000Z
TemplateRPG/Items/special/other_items.hpp
davideberdin/Text-Turn-based-RPG-Template
3b1e88b6498b7473b3928e7188157a7d7f1ba844
[ "MIT" ]
null
null
null
TemplateRPG/Items/special/other_items.hpp
davideberdin/Text-Turn-based-RPG-Template
3b1e88b6498b7473b3928e7188157a7d7f1ba844
[ "MIT" ]
null
null
null
// // other_items.hpp // TemplateRPG // // Created by Davide Berdin on 28/11/15. // Copyright © 2015 Davide Berdin. All rights reserved. // #ifndef other_items_hpp #define other_items_hpp #include <stdio.h> #endif /* other_items_hpp */
16.2
56
0.703704
davideberdin
0a2da9b4c2cc96a78f94d4e4b641a652457f26c5
8,737
cpp
C++
src/raytracer/misc/Computations.cpp
extramask93/RayTracer
ba7f46fb212971e47b296991a7a7e981fef50dda
[ "Unlicense" ]
null
null
null
src/raytracer/misc/Computations.cpp
extramask93/RayTracer
ba7f46fb212971e47b296991a7a7e981fef50dda
[ "Unlicense" ]
null
null
null
src/raytracer/misc/Computations.cpp
extramask93/RayTracer
ba7f46fb212971e47b296991a7a7e981fef50dda
[ "Unlicense" ]
null
null
null
// // Created by damian on 10.07.2020. // #include "Computations.h" #include <intersections/Intersections.h> #include <thread> #include <iostream> #include <misc/Shader.h> namespace rt { Computations prepareComputations(const Intersection &i, const Ray &ray,const rt::Intersections &intersections){ (void)intersections; Computations comp; comp.t = i.t(); comp.object = i.object(); comp.point = ray.position(comp.t); comp.eyev = -ray.direction(); comp.normalv = comp.object->normalAt(comp.point, intersections.size() > 0 ? intersections.front() : rt::Intersection(0, nullptr)); comp.inside = false; if(comp.normalv.dot(comp.eyev) < 0) { comp.inside = true; comp.normalv = -comp.normalv; } comp.reflectv = ray.direction().reflect(comp.normalv); comp.overPoint = comp.point + comp.normalv*EPSILON; comp.underPoint = comp.point - comp.normalv*EPSILON; /*refraction logic*/ if(intersections.size() > 0 ) { std::vector<const Shape *> containers; for (const auto &ii : intersections) { if (ii == i) { if (containers.empty()) { comp.n1 = 1.0; } else { comp.n1 = containers.back()->material().refractionIndex(); } } auto obj = std::find_if(containers.begin(), containers.end(), [&](const auto &o) { return o == i.object(); }); if (obj != containers.end()) { containers.erase(obj); } else { containers.push_back(ii.object()); } if (ii == i) { if (containers.empty()) { comp.n2 = 1.0; } else { comp.n2 = containers.back()->material().refractionIndex(); } } } } /******************/ return comp; } util::Color colorAt(const World &world, const Ray &ray, short callsLeft) { auto result = util::Color::BLACK; auto intersections = world.intersect(ray); if(intersections.hit().has_value()) { auto comps = prepareComputations(intersections.hit().value(), ray, intersections); result = result + rt::Shader::shadeHit(world, comps, callsLeft); } return result; //util::Color::BLACK; } /*Phong reflection model*/ util::Color lighting(const rt::Material &material,const rt::Shape &object, const rt::PointLight &light, const util::Tuple &position, const util::Tuple &eye, const util::Tuple &normal, bool inShadow) { auto effectiveColor = material.color() * light.intensity(); if(material.pattern() != nullptr) { effectiveColor = rt::patternAtObject(*material.pattern(), object, position); } //ambient is const util::Color ambient = effectiveColor * material.ambient(); if(inShadow) { return ambient; } auto lightVector = (light.position() - position).normalize(); auto light_dot_normal = lightVector.dot(normal);//cos(theta) util::Color diffuse(0, 0, 0); util::Color specular(0, 0, 0); if (light_dot_normal < 0) { diffuse = util::Color::BLACK; specular = util::Color::BLACK; } else { diffuse = effectiveColor * material.diffuse() * light_dot_normal; auto reflectVector = (-lightVector).reflect(normal); auto reflect_dot_eye = reflectVector.dot(eye); if (reflect_dot_eye <= 0) { specular = util::Color::BLACK; } else { auto factor = std::pow(reflect_dot_eye, material.shininess()); specular = effectiveColor * material.specular() * factor; } } return ambient + diffuse + specular; } util::Matrixd viewTransformation(const util::Tuple &from, const util::Tuple &to, const util::Tuple &up) { auto forwardv = (to - from).normalize(); auto upn = up.normalization(); auto leftv = forwardv.cross(upn); auto trueupv = leftv.cross(forwardv); auto orientationm = util::Matrixd(4,4); //TODO research where it comes from, scratchpixel.com orientationm << leftv.x(), leftv.y(), leftv.z(), 0, trueupv.x(), trueupv.y(), trueupv.z(),0, -forwardv.x(), -forwardv.y(), -forwardv.z(),0, 0,0,0,1; return orientationm*util::Matrixd::translation(-from.x(), -from.y(), -from.z()); } rt::Ray rayForPixel(const Camera &c, unsigned int px, unsigned int py) { double xoffset = (px + 0.5) * c.pixelSize(); double yoffset = (py + 0.5) * c.pixelSize(); double worldx = c.halfWidth() - xoffset; double worldy = c.halfHeight() -yoffset; auto pixel = c.transform().inverse() * util::Tuple::point(worldx,worldy,-1); auto origin = c.transform().inverse()*util::Tuple::point(0,0,0); auto direction = (pixel-origin).normalize(); return rt::Ray(origin, direction); } void renderSome(const unsigned from, const unsigned to,const Camera &c, const World &world, util::Canvas &canvas) { for(unsigned y = from; y < to; y++) { for(unsigned x = 0; x < c.hsize(); x++) { auto ray = rayForPixel(c,x,y); auto color = rt::colorAt(world,ray); canvas(x,y) = color; } } } util::Canvas render(const Camera &c, const World &world) { auto canvas = util::Canvas(c.hsize(),c.vsize()); const auto n = std::thread::hardware_concurrency(); std::vector<std::thread> threads; const auto step = c.vsize() / n; unsigned current =0; for(unsigned i = 0; i < n; i++) { threads.push_back(std::thread(renderSome,current, i == n-1? c.vsize(): current+step,std::ref(c),std::ref(world), std::ref(canvas))); current += step; } for(auto &thread: threads) { thread.join(); } return canvas; } bool isShadowed(const World &world, const util::Tuple &point) { (void)world; (void)point; auto direction = world.lights()[0].get()->position() - point; auto distance = direction.magnitude(); auto ray = rt::Ray(point,direction.normalization()); auto intersection = world.intersect(ray); if(intersection.hit().has_value() && intersection.hit()->t() < distance) { return true; } return false; } util::Color patternAtObject(const Pattern &pattern, const Shape &shape, const util::Tuple &point) { auto pointInObjectSpace = shape.worldToObject(point);//shape.transform().inverse()* point; auto pointInPatternSpace = pattern.transform().inverse() * pointInObjectSpace; return pattern.patternAt(pointInPatternSpace); } util::Color reflectedColor(const World &world, const Computations &comps, short callsLeft) { if(comps.object->material().reflective() ==0 || callsLeft < 1) { return util::Color(0,0,0); } auto reflectedRay = rt::Ray(comps.overPoint, comps.reflectv); auto newColor = rt::colorAt(world,reflectedRay,callsLeft-1); return newColor * comps.object->material().reflective(); } util::Color refractedColor(const World &world, const Computations &comps, short callsLeft) { auto transparency = comps.object->material().transparency(); if(equal(transparency,0.0) || callsLeft < 1){ return util::Color(0,0,0); } /*from the definition of Snell's Law*/ auto ratio = comps.n1 / comps.n2; auto cosi = comps.eyev.dot(comps.normalv); auto sin2t = std::pow(ratio,2) * (1-std::pow(cosi,2)); if(sin2t > 1.0) { // critical angle of 90 deg, so we need sint > 1 return util::Color(0,0,0); } auto cos_t = sqrt(1.0-sin2t); auto d = ratio*cosi- cos_t; auto normal = comps.normalv *d; auto eyeVector = comps.eyev *ratio; auto direction = normal-eyeVector; auto refractRay = rt::Ray(comps.underPoint,direction); auto color = rt::colorAt(world,refractRay,callsLeft-1) * comps.object->material().transparency(); return color; } double schlick(const Computations &comps) { auto c = comps.eyev.dot(comps.normalv); if(comps.n1 > comps.n2) { auto n = comps.n1/comps.n2; auto sin2t = pow(n,2) * (1.0-pow(c,2)); if(sin2t > 1.0) { return 1.0; } auto cost = sqrt(1.0-sin2t); c = cost; } auto r0 = pow((comps.n1 - comps.n2) / (comps.n1 + comps.n2),2); return r0 + (1.0-r0) * pow(1.0-c,5); } bool equal(double x, double y) { return std::fabs(x-y) < std::numeric_limits<double>::epsilon()*EPSILON; } std::pair<double, double> spherical_map(const util::Tuple &point) { auto theta = std::atan2(point.x(),point.z()); auto vec = util::Tuple::vector(point.x(),point.y(),point.z()); auto radius = vec.magnitude(); auto phi = acos(point.y() / radius); auto raw_u = theta / (2*math::pi<>); auto u = 1 - (raw_u + 0.5); auto v = 1 - phi / math::pi<>; return std::pair<double, double>(u,v); } std::pair<double, double> planar_map(const util::Tuple &point) { double u = point.x() - floor(point.x()); double v = point.z() - floor(point.z()); return std::make_pair(u,v); } std::pair<double, double> cylindrical_map(const util::Tuple &point) { auto theta = std::atan2(point.x(), point.z()); auto rawU = theta / (2*math::pi<>); auto u = 1 - (rawU + 0.5); auto v = point.y() - floor(point.y()); return std::make_pair(u,v); } }
33.996109
119
0.643241
extramask93
0a2e17982d67e6ab4bd9078d49fc7f981caa8c63
2,753
cxx
C++
vtk/8.1.0/src/ThirdParty/vtkm/vtk-m/vtkm/cont/testing/UnitTestRuntimeDeviceInformation.cxx
Fresher-Chen/tarsim
9d2ec1001ee82ca11325e4b1edb8f2843e36518b
[ "Apache-2.0" ]
1
2020-03-02T17:31:48.000Z
2020-03-02T17:31:48.000Z
vtk/8.1.0/src/ThirdParty/vtkm/vtk-m/vtkm/cont/testing/UnitTestRuntimeDeviceInformation.cxx
Fresher-Chen/tarsim
9d2ec1001ee82ca11325e4b1edb8f2843e36518b
[ "Apache-2.0" ]
1
2019-06-03T17:04:59.000Z
2019-06-05T15:13:28.000Z
ThirdParty/vtkm/vtk-m/vtkm/cont/testing/UnitTestRuntimeDeviceInformation.cxx
metux/vtk8
77f907913f20295e1eacdb3aba9ed72e2b3ae917
[ "BSD-3-Clause" ]
1
2020-07-20T06:43:49.000Z
2020-07-20T06:43:49.000Z
//============================================================================ // Copyright (c) Kitware, Inc. // All rights reserved. // See LICENSE.txt for details. // This software is distributed WITHOUT ANY WARRANTY; without even // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR // PURPOSE. See the above copyright notice for more information. // // Copyright 2014 National Technology & Engineering Solutions of Sandia, LLC (NTESS). // Copyright 2014 UT-Battelle, LLC. // Copyright 2014 Los Alamos National Security. // // Under the terms of Contract DE-NA0003525 with NTESS, // the U.S. Government retains certain rights in this software. // // Under the terms of Contract DE-AC52-06NA25396 with Los Alamos National // Laboratory (LANL), the U.S. Government retains certain rights in // this software. //============================================================================ #include <vtkm/cont/RuntimeDeviceInformation.h> //include all backends #include <vtkm/cont/cuda/DeviceAdapterCuda.h> #include <vtkm/cont/serial/DeviceAdapterSerial.h> #include <vtkm/cont/tbb/DeviceAdapterTBB.h> #include <vtkm/cont/testing/Testing.h> namespace { template <bool> struct DoesExist; template <typename DeviceAdapterTag> void detect_if_exists(DeviceAdapterTag tag) { using DeviceAdapterTraits = vtkm::cont::DeviceAdapterTraits<DeviceAdapterTag>; DoesExist<DeviceAdapterTraits::Valid>::Exist(tag); } template <> struct DoesExist<false> { template <typename DeviceAdapterTag> static void Exist(DeviceAdapterTag) { //runtime information for this device should return false vtkm::cont::RuntimeDeviceInformation<DeviceAdapterTag> runtime; VTKM_TEST_ASSERT(runtime.Exists() == false, "A backend with zero compile time support, can't have runtime support"); } }; template <> struct DoesExist<true> { template <typename DeviceAdapterTag> static void Exist(DeviceAdapterTag) { //runtime information for this device should return true vtkm::cont::RuntimeDeviceInformation<DeviceAdapterTag> runtime; VTKM_TEST_ASSERT(runtime.Exists() == true, "A backend with compile time support, should have runtime support"); } }; void Detection() { using SerialTag = ::vtkm::cont::DeviceAdapterTagSerial; using TBBTag = ::vtkm::cont::DeviceAdapterTagTBB; using CudaTag = ::vtkm::cont::DeviceAdapterTagCuda; //Verify that for each device adapter we compile code for, that it //has valid runtime support. detect_if_exists(CudaTag()); detect_if_exists(TBBTag()); detect_if_exists(SerialTag()); } } // anonymous namespace int UnitTestRuntimeDeviceInformation(int, char* []) { return vtkm::cont::testing::Testing::Run(Detection); }
31.284091
93
0.6996
Fresher-Chen
0a366e5ef4dd70030b5c693d13b4c55866647b54
2,876
cpp
C++
optimizing-c++/htt/htt.cpp
a1exwang/dirty-linux-experiments
fb7f89e32e066e764045ab5a50f96d11d6173afe
[ "MIT" ]
null
null
null
optimizing-c++/htt/htt.cpp
a1exwang/dirty-linux-experiments
fb7f89e32e066e764045ab5a50f96d11d6173afe
[ "MIT" ]
null
null
null
optimizing-c++/htt/htt.cpp
a1exwang/dirty-linux-experiments
fb7f89e32e066e764045ab5a50f96d11d6173afe
[ "MIT" ]
null
null
null
#include <x86intrin.h> #include <chrono> #include <thread> #include <iostream> #include <cstdlib> #include <vector> using namespace std; extern "C" int64_t loop_start(uint64_t n, uint64_t p); /** * These sample program illustrates Hyper threading bottlenecks. * When your load is ALU-bound, hyper threading will not increase performance. * * Run the program on a HTT enabled CPU * ./htt YOUR_CORE_COUNT * ./htt YOUR_HYPERTHREAD_COUNT * will result in similar results. * However, run * ./htt YOUR_CORE_COUNT * ./htt YOUR_CORE_COUNT/2 * should have quite different result(when YOUR_CORE_COUNT >= 2) */ int main(int argc, char **argv) { int64_t count = 1'000'000'000; int64_t ipl = 15; int64_t thread_count = atoi(argv[1]); { vector<thread> threads; std::cout << "ALU bound jobs" << std::endl; auto t0 = chrono::high_resolution_clock::now(); for (int thread_id = 0; thread_id < thread_count; thread_id++) { threads.emplace_back([=]() { auto t0 = chrono::high_resolution_clock::now(); loop_start(count, ipl - 2); // two additional cmp/jmp instructions auto t1 = chrono::high_resolution_clock::now(); cout << "thread " << thread_id << ": " << chrono::duration<float>(t1 - t0).count() << endl; }); } for (auto &thread : threads) { thread.join(); } auto t1 = chrono::high_resolution_clock::now(); cout << "process: " << chrono::duration<float>(t1 - t0).count() << endl; cout << "average: " << ipl * count * thread_count / chrono::duration<float>(t1 - t0).count()/1e9 << "G" << endl; } // { // vector<thread> threads; // std::cout << "ALU/cache bound jobs" << std::endl; // // auto t0 = chrono::high_resolution_clock::now(); // for (int thread_id = 0; thread_id < thread_count; thread_id++) { // threads.emplace_back([=]() { // volatile __m256 a = _mm256_set_ps(0, 0, 0, 1, 0, 0, 0, 0); // volatile __m256 b = _mm256_set_ps(1, 0, 0, 0, 0, 0, 0, 0); // volatile __m256 c = _mm256_set_ps(0, 1, 0, 0, 0, 0, 0, 0); // volatile __m256 d = _mm256_set_ps(0, 0, 1, 0, 0, 0, 0, 0); // auto t0 = chrono::high_resolution_clock::now(); // for (int64_t i = 0; i < count; i++) { // c = _mm256_add_ps(a, b); // a = _mm256_add_ps(c, d); // } // (void)a, b, c, d; // auto t1 = chrono::high_resolution_clock::now(); // cout << "thread " << thread_id << ": " << chrono::duration<float>(t1 - t0).count() << endl; // }); // } // for (auto &thread : threads) { // thread.join(); // } // auto t1 = chrono::high_resolution_clock::now(); // // cout << "process: " << chrono::duration<float>(t1 - t0).count() << endl; // cout << "average: " << ipl * count * thread_count / chrono::duration<float>(t1 - t0).count()/1e9 << "G" << endl; // } return 0; }
35.95
118
0.589013
a1exwang
0a3a6bb65101987190da33613fc09ffb2ac50080
3,231
cpp
C++
src/software/estop/arduino_util.cpp
jonl112/Software
61a028a98d5c0dd5e79bf055b231633290ddbf9f
[ "MIT" ]
null
null
null
src/software/estop/arduino_util.cpp
jonl112/Software
61a028a98d5c0dd5e79bf055b231633290ddbf9f
[ "MIT" ]
null
null
null
src/software/estop/arduino_util.cpp
jonl112/Software
61a028a98d5c0dd5e79bf055b231633290ddbf9f
[ "MIT" ]
null
null
null
#include "arduino_util.h" #include <stdlib.h> #include <unistd.h> #include <boost/filesystem.hpp> #include <boost/format.hpp> #include <iostream> #include "shared/constants.h" std::optional<std::string> ArduinoUtil::getArduinoPort() { auto devices = getSerialDevices(); for (auto device : devices) { std::optional<HwInfo> hwInfo = getInfo(device); if (hwInfo.has_value()) { if (hwInfo.value().vendor == ARDUINO_VENDOR_ID && hwInfo.value().product == ARDUINO_PRODUCT_ID) { std::string device_path = (boost::format("/dev/%1%") % device).str(); return device_path; } } } return std::nullopt; } std::optional<ArduinoUtil::HwInfo> ArduinoUtil::getInfo(std::string port) { // ported from // https://github.com/pyserial/pyserial/blob/bce419352b22b2605df6c2158f3e20a15b8061cb/serial/tools/list_ports_linux.py std::string device_path_string = (boost::format("/sys/class/tty/%1%/device") % port).str(); if (!boost::filesystem::is_directory(device_path_string)) { return std::nullopt; } boost::filesystem::path device_path = realpath(device_path_string.c_str(), NULL); boost::filesystem::path subsystem; boost::filesystem::path usb_interface_path; boost::filesystem::path usb_device_path; if (!boost::filesystem::is_directory(device_path / "subsystem")) { return std::nullopt; } subsystem = boost::filesystem::basename(realpath((device_path / "subsystem").c_str(), NULL)); if (subsystem == "usb-serial") { usb_interface_path = device_path.parent_path(); } else if (subsystem == "usb") { usb_interface_path = device_path; } else { return std::nullopt; } if (!usb_interface_path.empty()) { usb_device_path = usb_interface_path.parent_path(); std::optional<std::string> vendor = readFileLine(usb_device_path / "idVendor"); std::optional<std::string> product = readFileLine(usb_device_path / "idProduct"); if (vendor.has_value() && product.has_value()) { HwInfo hwInfo({vendor.value(), product.value()}); return hwInfo; } } return std::nullopt; } std::vector<std::string> ArduinoUtil::getSerialDevices() { boost::filesystem::path dev("/dev"); boost::filesystem::directory_iterator end_itr; std::vector<std::string> devices; for (boost::filesystem::directory_iterator itr(dev); itr != end_itr; ++itr) { std::string filename = itr->path().stem().string(); if (filename.find("ttyUSB") != std::string::npos || filename.find("ttyACM") != std::string::npos || filename.find("ttyS") != std::string::npos) { devices.push_back(filename); } } return devices; } std::optional<std::string> ArduinoUtil::readFileLine(boost::filesystem::path path) { boost::filesystem::ifstream f(path.c_str()); std::string res; if (f.is_open()) { std::getline(f, res); f.close(); return res; } return std::nullopt; }
26.268293
122
0.606004
jonl112
0a3de9fc68b1b66ee6e20cfbe266432b3dc9fa47
689
cpp
C++
OJ_Assignment/Ch01-Introduction/1004.1.19.cpp
Gerald-Gui/UCAS-Data-Structure
15b17f0a09fd1f736e8cd7595b2c6b969308e1c0
[ "MIT" ]
3
2021-04-01T09:52:17.000Z
2022-02-12T05:59:34.000Z
OJ_Assignment/Ch01-Introduction/1004.1.19.cpp
Gerald-Gui/UCAS-Data-Structure
15b17f0a09fd1f736e8cd7595b2c6b969308e1c0
[ "MIT" ]
null
null
null
OJ_Assignment/Ch01-Introduction/1004.1.19.cpp
Gerald-Gui/UCAS-Data-Structure
15b17f0a09fd1f736e8cd7595b2c6b969308e1c0
[ "MIT" ]
null
null
null
#include <iostream> #include <cstdio> #include <cstring> using namespace std; const unsigned int maxint = 0xffffffff; int main() { int n, arrsize; uint32_t * arr; cin >> n >> arrsize; if (n > arrsize || n <= 0) { printf("-1\n"); return 0; } arr = new uint32_t[arrsize]; memset(arr, 0, sizeof(uint32_t) * arrsize); arr[0] = 1; for (int i = 1; i < n; ++i) { if (arr[i - 1] > maxint / 2 / i) { printf("-1\n"); return 0; } else { arr[i] = arr[i - 1] * 2 * i; } } for (int i = 0; i < n; ++i) { printf("%u ", arr[i]); } printf("\n"); return 0; }
19.138889
47
0.445573
Gerald-Gui
0a3ef024c5160bb6b357d6757de7e859d1386126
6,987
cpp
C++
src/Character.cpp
laonious/hexgame
309771d4d9a7fe6b41631579ac76b3dfb42fc257
[ "Unlicense" ]
3
2018-09-04T15:48:00.000Z
2019-12-03T18:11:18.000Z
src/Character.cpp
laonious/hexgame
309771d4d9a7fe6b41631579ac76b3dfb42fc257
[ "Unlicense" ]
null
null
null
src/Character.cpp
laonious/hexgame
309771d4d9a7fe6b41631579ac76b3dfb42fc257
[ "Unlicense" ]
1
2018-09-05T07:48:10.000Z
2018-09-05T07:48:10.000Z
#include "Character.h" #include "HexMap.h" #include "HexUtils.h" #include "Pipeline.h" #include "ServiceLocator.h" #include <cmath> #include <fstream> void CharacterFileLoader::parseLine(const std::string &field, const std::string &data) { if (field.compare("name") == 0) { character->name = ParseString(data); ServiceLocator::getTextLog().addText("Character name: " + character->name); } else if (field.compare("maxhp") == 0) { character->stats.maxHitPoints = ParseInt(data); character->stats.hitPoints = character->stats.maxHitPoints; } else if (field.compare("speed") == 0) { character->stats.speed = ParseInt(data); } else if (field.compare("agility") == 0) { character->stats.agility = ParseInt(data); } else if (field.compare("model") == 0) { std::size_t spacemarker = data.find_first_of(" "); character->LoadMesh(data.substr(0, spacemarker).c_str()); character->m_Portrait.LoadMesh("data/meshes/actorportrait.obj"); character->m_PortraitHealthBar.LoadMesh( "data/meshes/actorportraithealthbar.obj"); character->m_PortraitHealthBar.setTexture("data/tiletextures/green.png"); if (spacemarker != std::string::npos) { character->setTexture(data.substr(spacemarker + 1).c_str()); character->m_Portrait.setTexture(data.substr(spacemarker + 1).c_str()); } } else if (field.compare("normalmap") == 0) { character->setNormalMap(data); printf("Setting Normal map\n"); } else if (field.compare("weapon") == 0) { Weapon *newWeapon = new Weapon; newWeapon->loadFromFile(data); character->setWeapon(newWeapon); character->addItem(newWeapon); } else if (field == "technique") { character->techniques.push_back(new Technique); character->techniques.back()->loadFromFile(data); } else if (field == "AI") { character->setAI(true); } else if (field == "portrait") { } } Character::Character() { name = std::string(""); moved = false; attacked = false; AI = false; Inventory.clear(); } Character::~Character() { movementData.clear(); for (auto item : Inventory) { delete item; } Inventory.clear(); for (auto tech : techniques) { delete tech; } techniques.clear(); } void Character::newTurn() { moved = false; attacked = false; } bool Character::loadFromFile(const std::string &fileName) { CharacterFileLoader loader(fileName); loader.setCharacter(this); loader.parseFile(); return 1; } void Character::setMovementData(std::map<std::pair<int, int>, int> value) { movementData = value; } //! given an input position, extract a movement vector from movementData void Character::executeMove(int i, int j) { std::pair<int, int> current = std::make_pair(i, j); moveList.push_back((Directions)movementData[current]); while (current != std::make_pair(Position.getI(), Position.getJ())) { Directions direction = (Directions)((movementData[current] + 3) % 6); current = std::make_pair(NeighborI(current.first, current.second, direction), NeighborJ(current.first, current.second, direction)); moveList.push_back((Directions)movementData[current]); incrementTurnCountdown(DELAYPERTILE / (float)(getSpeed())); } moveList.pop_back(); } void Character::decreaseHitPoints(int value) { stats.hitPoints = std::max(stats.hitPoints - value, 0); } void Character::increaseHitPoints(int value) { stats.hitPoints = std::min(stats.hitPoints + value, stats.maxHitPoints); } void Character::addItem(Item *value) { Inventory.push_back(value); } void Character::setWeapon(Weapon *value) { currentWeapon = value; } Weapon *Character::getCurrentWeapon() { return currentWeapon; } void Character::performAttack(Character *target) { std::string outputString; outputString = getName() + std::string(" is attacking ") + target->getName() + std::string(" with ") + getCurrentAttack()->getName() + std::string(":"); ServiceLocator::getTextLog().addText(outputString); getCurrentAttack()->perform(this, target); std::string output = target->getName(); output += std::string(" now has "); output += std::to_string(target->getHitPoints()); output += std::string("/"); output += std::to_string(target->getMaxHitPoints()); output += std::string(" HP."); ServiceLocator::getTextLog().addText(output); } int Character::simulateAttack(Character *target) { return getCurrentAttack()->calculateDamage(this, target); } void Character::printStatus() { std::string output; ServiceLocator::getTextLog().addText(getName(), textLogColor(0.f, 1.f, 1.f)); output = "HP: " + std::to_string(getHitPoints()) + "/" + std::to_string(getMaxHitPoints()); ServiceLocator::getTextLog().addText(output); output = "Countdown: " + std::to_string(getTurnCountdown()); ServiceLocator::getTextLog().addText(output); output = "Equipped Weapon: " + getCurrentWeapon()->getName(); ServiceLocator::getTextLog().addText(output); output = "Range: " + std::to_string(getCurrentWeapon()->getMinRange()) + "-" + std::to_string(getCurrentWeapon()->getMaxRange()); ServiceLocator::getTextLog().addText(output); output = "Damage: " + std::to_string(getCurrentWeapon()->getDamage()); ServiceLocator::getTextLog().addText(output); for (auto tech : techniques) { output = "Technique: " + tech->getName(); ServiceLocator::getTextLog().addText(output); output = " Damage: " + std::to_string(tech->getDamage()); output += " AOE: " + std::to_string(tech->getAOE()); ServiceLocator::getTextLog().addText(output); } } void Character::prepareWeaponAttack() { currentAttack.setMinRange(currentWeapon->getMinRange()); currentAttack.setMaxRange(currentWeapon->getMaxRange()); currentAttack.setDamage(currentWeapon->getDamageEffect()); currentAttack.setName(currentWeapon->getName()); }; void Character::prepareTechniqueAttack() { if (!currentTechnique) { currentTechnique = techniques.back(); } currentAttack.setMinRange(0); currentAttack.setMaxRange(currentTechnique->getRange()); currentAttack.setDamage(currentTechnique->getDamageEffect()); currentAttack.setName(currentTechnique->getName()); }; void Character::Render() { Actor::Render(); } bool Character::isAlive() const { return stats.hitPoints > 0; } void Character::RenderPortrait() { Vector3f objectPos = Pipeline::getInstance()->getObjectPos(); Vector3f newPos = objectPos; Pipeline::getInstance()->setObjectPos(Vector3f(objectPos.x, 0.f, 0.f)); Pipeline::getInstance()->setObjectScale( Vector3f(1, 1, getHitPointsPercent())); Pipeline::getInstance()->setObjectPos( Vector3f(objectPos.x, 0.f, objectPos.z - (1 - getHitPointsPercent()))); m_PortraitHealthBar.Render(); Pipeline::getInstance()->setObjectScale(Vector3f(1, 1, 1)); Pipeline::getInstance()->setObjectPos(objectPos); Pipeline::getInstance()->Scale(1, 1, 1); m_Portrait.Render(); }
33.753623
80
0.684843
laonious
0a432c95eaa8f35a40257072c7e15d9a4f7280d2
808
hpp
C++
lib/world/map.hpp
julienlopez/QCityBuilder
fe61a56bcdeda301211d49a9e358258eefafa14c
[ "MIT" ]
1
2019-03-19T03:14:22.000Z
2019-03-19T03:14:22.000Z
lib/world/map.hpp
julienlopez/QCityBuilder
fe61a56bcdeda301211d49a9e358258eefafa14c
[ "MIT" ]
11
2015-01-27T17:35:12.000Z
2018-08-13T07:48:35.000Z
lib/world/map.hpp
julienlopez/QCityBuilder
fe61a56bcdeda301211d49a9e358258eefafa14c
[ "MIT" ]
null
null
null
#ifndef MAP_HPP #define MAP_HPP #include "namespace_world.hpp" #include <utils/array2d.hpp> #include <utils/rect.hpp> BEGIN_NAMESPACE_WORLD class Map { public: enum class SquareType : unsigned char { Empty = 0, Building, Road }; using square_container_t = std::vector<utils::PointU>; Map(utils::SizeU size_); std::size_t width() const; std::size_t height() const; const utils::SizeU& size() const; bool squareIsEmpty(const utils::PointU& p) const; void placeBuilding(const utils::RectU& r); SquareType squareType(const utils::PointU& p) const; void addRoad(square_container_t squares); private: using type_container = utils::Array2D<SquareType>; type_container m_squares; }; END_NAMESPACE_WORLD #endif // MAP_HPP
17.565217
58
0.683168
julienlopez
0a432dc4fdf4557a745a7850ff44729a159d1a34
1,270
cpp
C++
main.cpp
NighttimeDriver50000/J1X0_IMU
1d9610f310e730134b3f472fd9ddb304ad7eb4e7
[ "MIT" ]
null
null
null
main.cpp
NighttimeDriver50000/J1X0_IMU
1d9610f310e730134b3f472fd9ddb304ad7eb4e7
[ "MIT" ]
null
null
null
main.cpp
NighttimeDriver50000/J1X0_IMU
1d9610f310e730134b3f472fd9ddb304ad7eb4e7
[ "MIT" ]
null
null
null
#include <iostream> #include <time.h> #include "inv_mpu_spi_wrapper.hpp" extern "C" { #include "inv_mpu.h" } using namespace std; #define LOOP_FREQUENCY (2) static volatile int received_sigterm = 0; static volatile int received_nb_signals = 0; static void sigterm_handler(int sig) { received_sigterm = sig; received_nb_signals++; if (received_nb_signals > 3) exit(123); } int main(int argc, char *argv[]) { const timespec req = {0, 1000000000L / LOOP_FREQUENCY}; timespec rem; // remainder of interrupted nanosleep (unused); struct int_param_s int_param; inv_mpu_spi_wrapper_init(); if (mpu_init(&int_param) != 0) { cerr << "ERROR: Failed to initialize MPU connection." << endl; return 1; } if (mpu_set_sensors(INV_XYZ_ACCEL) != 0) { cerr << "ERROR: Failed to enable accelerometer." << endl; return 1; } while (received_sigterm == 0) { // Sleep. nanosleep(&req, &rem); // Read the raw accelerometer. short accelerometer[3]; if (mpu_get_accel_reg(accelerometer, NULL) != 0) { cerr << "WARN: Failed to read acceleration." << endl; } cout << accelerometer[0] << "\t" << accelerometer[1] << "\t" << accelerometer[2] << endl; } inv_mpu_spi_wrapper_close(); return 0; }
20.483871
66
0.659055
NighttimeDriver50000
0a46dbeb7021722dceacef81b50700c9116d9984
574
hh
C++
src/Zynga/Framework/StorableObject/V1/Test/Mock/ValidNestedMap.hh
chintan-j-patel/zynga-hacklang-framework
d9893b8873e3c8c7223772fd3c94d2531760172a
[ "MIT" ]
19
2018-04-23T09:30:48.000Z
2022-03-06T21:35:18.000Z
src/Zynga/Framework/StorableObject/V1/Test/Mock/ValidNestedMap.hh
chintan-j-patel/zynga-hacklang-framework
d9893b8873e3c8c7223772fd3c94d2531760172a
[ "MIT" ]
22
2017-11-27T23:39:25.000Z
2019-08-09T08:56:57.000Z
src/Zynga/Framework/StorableObject/V1/Test/Mock/ValidNestedMap.hh
chintan-j-patel/zynga-hacklang-framework
d9893b8873e3c8c7223772fd3c94d2531760172a
[ "MIT" ]
28
2017-11-16T20:53:56.000Z
2021-01-04T11:13:17.000Z
<?hh // strict namespace Zynga\Framework\StorableObject\V1\Test\Mock; use Zynga\Framework\Type\V1\StringBox; use Zynga\Framework\StorableObject\V1\Base as StorableObjectBase; use Zynga\Framework\StorableObject\V1\StorableMap; use Zynga\Framework\StorableObject\V1\Test\Mock\Valid; class ValidNestedMap extends StorableObjectBase { public StorableMap<StringBox> $stringMap; public StorableMap<Valid> $validMap; public function __construct() { parent::__construct(); $this->stringMap = new StorableMap(); $this->validMap = new StorableMap(); } }
22.076923
65
0.763066
chintan-j-patel
0a49edde0124a86c6ca945d3368947d26b181ae1
2,568
cpp
C++
SJF Scheduling.cpp
Anikcb/Operating-System
3a39e86686fa24bfa72b56d5061c3c177a635863
[ "MIT" ]
null
null
null
SJF Scheduling.cpp
Anikcb/Operating-System
3a39e86686fa24bfa72b56d5061c3c177a635863
[ "MIT" ]
null
null
null
SJF Scheduling.cpp
Anikcb/Operating-System
3a39e86686fa24bfa72b56d5061c3c177a635863
[ "MIT" ]
null
null
null
#include<bits/stdc++.h> using namespace std; int burst_time[100]; int arrival_time[100]; int waiting_time[100]; int turnaround_time[100]; vector<int>v; void space_fun(int num) { for(int i=1;i<=num;i++)cout<<" "; } int check(int st) { int mn=1e5,pos=-1,mn_arr=1e5,result; for(int i=0;i<(int)v.size();i++) { if(arrival_time[v[i]]<=st) { if(burst_time[v[i]]<mn)mn=burst_time[v[i]],pos=i; } mn_arr=min(mn_arr,arrival_time[v[i]]); } if(pos==-1){ for(int i=0;i<(int)v.size();i++){ if(arrival_time[v[i]]<=mn_arr) { if(burst_time[v[i]]<mn)mn=burst_time[v[i]],pos=i; } } } result=v[pos]; v.erase(v.begin()+pos); return result; } void avg_time(int num_pro) { int total_wait_time=0,starting_time=0,total_turnaround_time=0; for(int i=1; i<=num_pro; i++) { int ch = check(starting_time); if(starting_time>arrival_time[ch]) { waiting_time[ch]=starting_time - arrival_time[ch]; starting_time+=burst_time[ch]; } else { starting_time+=burst_time[ch]; } turnaround_time[ch]=waiting_time[ch] + burst_time[ch]; total_wait_time+=waiting_time[ch]; total_turnaround_time+=turnaround_time[ch]; } cout<<"\n\n\n"<<endl; cout<<"Process"<<" "<<"Burst Time"<<" "<<"Arrival Time"<<" "<<"Waiting Time"<<" "<<"Turnaround Time"<<endl; for(int i=1;i<=num_pro;i++) { cout<<" "<<i; space_fun(10-(int)floor(log10(i) + 1)); cout<<burst_time[i]; space_fun(13-(int)floor(log10(burst_time[i]+1) + 1)); cout<<arrival_time[i]; space_fun(15-(int)floor(log10(arrival_time[i]+1) + 1)); cout<<waiting_time[i]; space_fun(15-(int)floor(log10(waiting_time[i]+1) + 1)); cout<<turnaround_time[i]<<endl; } cout<<"\n\n\n"<<endl; cout<<"Average Waiting Time: "<<(float)total_wait_time/num_pro<<endl; cout<<"Average Turnaround Time "<<(float)total_turnaround_time/num_pro<<endl; } int main() { int num_pro; cout<<"Number of Process: "; cin>>num_pro; cout<<"Arrival Times: "; for(int i=1; i<=num_pro; i++) { cin>>arrival_time[i]; v.push_back(i); } cout<<"Burst Times: "; for(int i=1; i<=num_pro; i++) { cin>>burst_time[i]; } avg_time(num_pro); }
25.68
120
0.528816
Anikcb
0a4aed3658df81e9e67245dafb8ecced652fd8c8
13,235
cpp
C++
private/shell/shell32/unicpp/sdwindow.cpp
King0987654/windows2000
01f9c2e62c4289194e33244aade34b7d19e7c9b8
[ "MIT" ]
11
2017-09-02T11:27:08.000Z
2022-01-02T15:25:24.000Z
private/shell/shell32/unicpp/sdwindow.cpp
King0987654/windows2000
01f9c2e62c4289194e33244aade34b7d19e7c9b8
[ "MIT" ]
null
null
null
private/shell/shell32/unicpp/sdwindow.cpp
King0987654/windows2000
01f9c2e62c4289194e33244aade34b7d19e7c9b8
[ "MIT" ]
14
2019-01-16T01:01:23.000Z
2022-02-20T15:54:27.000Z
#include "stdafx.h" #pragma hdrstop #include "stdenum.h" #define DM_SDFOLDER 0 // in DVOC.CPP extern DWORD GetViewOptionsForDispatch(void); //===================================================================== // ShellFolderView Class Definition... //===================================================================== class CShellFolderView : public IShellFolderViewDual, public IShellService, public CObjectSafety, public CObjectWithSite, protected CImpIConnectionPointContainer, protected CImpIExpDispSupport, protected CImpIDispatch { public: CShellFolderView(void); // IUnknown STDMETHODIMP QueryInterface(REFIID riid, void **ppv); STDMETHODIMP_(ULONG) AddRef(void); STDMETHODIMP_(ULONG) Release(void); // IDispatch virtual STDMETHODIMP GetTypeInfoCount(UINT * pctinfo) { return CImpIDispatch::GetTypeInfoCount(pctinfo); } virtual STDMETHODIMP GetTypeInfo(UINT itinfo, LCID lcid, ITypeInfo **pptinfo) { return CImpIDispatch::GetTypeInfo(itinfo, lcid, pptinfo); } virtual STDMETHODIMP GetIDsOfNames(REFIID riid, OLECHAR **rgszNames, UINT cNames, LCID lcid, DISPID * rgdispid) { return CImpIDispatch::GetIDsOfNames(riid, rgszNames, cNames, lcid, rgdispid); } virtual STDMETHODIMP Invoke(DISPID dispidMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS * pdispparams, VARIANT * pvarResult, EXCEPINFO * pexcepinfo, UINT * puArgErr); // ShellWindow STDMETHODIMP get_Application(IDispatch **ppid); STDMETHODIMP get_Parent(IDispatch **ppid); STDMETHODIMP get_Folder(Folder **ppid); STDMETHODIMP SelectedItems(FolderItems **ppid); STDMETHODIMP get_FocusedItem(FolderItem **ppid); STDMETHODIMP SelectItem(VARIANT *pvfi, int dwFlags); STDMETHODIMP PopupItemMenu(FolderItem * pfi, VARIANT vx, VARIANT vy, BSTR * pbs); STDMETHODIMP get_Script(IDispatch **ppid); STDMETHODIMP get_ViewOptions(long *plSetting); // IShellService methods. STDMETHODIMP SetOwner(IUnknown* punkOwner); // CImpIConnectionPoint STDMETHODIMP EnumConnectionPoints(LPENUMCONNECTIONPOINTS * ppEnum); // CObjectWithSite overriding virtual STDMETHODIMP SetSite(IUnknown *punkSite); private: ~CShellFolderView(void); HRESULT _GetFolder(); // CImpIExpDispSupport virtual CConnectionPoint* _FindCConnectionPointNoRef(BOOL fdisp, REFIID iid); LONG m_cRef; CFolder *m_psdf; // The shell folder we talk to ... IUnknown *m_punkOwner; // The owner object of us... IShellFolderView *m_psfvOwner; // The owners Shell folder view... HWND m_hwnd; // the hwnd for the window... // Embed our Connection Point object - implmentation in cnctnpt.cpp CConnectionPoint m_cpEvents; }; STDAPI CShellFolderView_CreateInstance(IUnknown* punkOuter, REFIID riid, void **ppvOut) { *ppvOut = NULL; HRESULT hr = E_OUTOFMEMORY; CShellFolderView* psfv = new CShellFolderView(); if (psfv) { hr = psfv->QueryInterface(riid, ppvOut); psfv->Release(); } return hr; } CShellFolderView::CShellFolderView(void) : CImpIDispatch(&LIBID_Shell32, 1, 0, &IID_IShellFolderViewDual), m_cRef(1), m_psdf(NULL) { DllAddRef(); m_cpEvents.SetOwner((IUnknown*)SAFECAST(this, IShellFolderViewDual*), &DIID_DShellFolderViewEvents); } CShellFolderView::~CShellFolderView(void) { TraceMsg(DM_SDFOLDER, "CShellFolderView::~CShellFolderView called"); // if we ever grabbed a shell folder for this window release it also if (m_psdf) { m_psdf->SetSite(NULL); m_psdf->Release(); } ASSERT(m_punkOwner == NULL); ASSERT(m_psfvOwner == NULL); DllRelease(); } STDMETHODIMP CShellFolderView::QueryInterface(REFIID riid, void **ppv) { static const QITAB qit[] = { QITABENT(CShellFolderView, IShellFolderViewDual), QITABENTMULTI(CShellFolderView, IDispatch, IShellFolderViewDual), QITABENT(CShellFolderView, IShellService), QITABENT(CShellFolderView, IConnectionPointContainer), QITABENT(CShellFolderView, IExpDispSupport), QITABENT(CShellFolderView, IObjectSafety), QITABENT(CShellFolderView, IObjectWithSite), { 0 }, }; return QISearch(this, qit, riid, ppv); } STDMETHODIMP_(ULONG) CShellFolderView::AddRef(void) { return ++m_cRef; } STDMETHODIMP_(ULONG) CShellFolderView::Release(void) { //CCosmoClient deletes this object during shutdown if (0 != --m_cRef) return m_cRef; delete this; return 0L; } //The ShellWindow implementation // let folder we have handle this. Probably won't work for webviews as this object // is not secure... STDMETHODIMP CShellFolderView::get_Application(IDispatch **ppid) { HRESULT hres = _GetFolder(); if (SUCCEEDED(hres)) hres = m_psdf->get_Application(ppid); return hres; } STDMETHODIMP CShellFolderView::get_Parent(IDispatch **ppid) { *ppid = NULL; return E_FAIL; } HRESULT CShellFolderView::_GetFolder() { if (m_psdf) return NOERROR; HRESULT hres; LPITEMIDLIST pidl = NULL; IShellFolder *psf = NULL; if (m_psfvOwner) { IDefViewFrame *pdvf; if (SUCCEEDED(m_psfvOwner->QueryInterface(IID_IDefViewFrame, (void**)&pdvf))) { if (SUCCEEDED(pdvf->GetShellFolder(&psf))) { if (SHGetIDListFromUnk(psf, &pidl) != S_OK) { psf->Release(); psf = NULL; } } pdvf->Release(); } if (!pidl) { LPCITEMIDLIST pidlT; hres = GetObjectSafely(m_psfvOwner, &pidlT, (UINT)-42); if (SUCCEEDED(hres)) { pidl = ILClone(pidlT); } } } if (pidl) { hres = CFolder_Create2(m_hwnd, pidl, psf, &m_psdf); if (_dwSafetyOptions && _punkSite && SUCCEEDED(hres)) { m_psdf->SetSite(_punkSite); hres = MakeSafeForScripting((IUnknown**)&m_psdf); } if (psf) psf->Release(); ILFree(pidl); } else hres = E_FAIL; return hres; } STDMETHODIMP CShellFolderView::SetSite(IUnknown *punkSite) { if (m_psdf) m_psdf->SetSite(punkSite); return CObjectWithSite::SetSite(punkSite); } STDMETHODIMP CShellFolderView::get_Folder(Folder **ppid) { *ppid = NULL; HRESULT hres = _GetFolder(); if (SUCCEEDED(hres)) hres = m_psdf->QueryInterface(IID_Folder, (void **)ppid); return hres; } STDMETHODIMP CShellFolderView::SelectedItems(FolderItems **ppid) { // We need to talk to the actual window under us HRESULT hres = _GetFolder(); if (FAILED(hres)) return hres; hres = CFolderItems_Create(m_psdf, TRUE, ppid); if (_dwSafetyOptions && SUCCEEDED(hres)) hres = MakeSafeForScripting((IUnknown**)ppid); return hres; } // NOTE: this returns an alias pointer, it is not allocated HRESULT GetObjectSafely(IShellFolderView *psfv, LPCITEMIDLIST *ppidl, UINT iType) { // cast needed because GetObject() is declared wrong, it returns a const ptr HRESULT hr = psfv->GetObject((LPITEMIDLIST *)ppidl, iType); if (SUCCEEDED(hr)) { // On the off chance this is coppied across process boundries... __try { // force a full deref this PIDL to generate a fault if cross process if (ILGetSize(*ppidl) > 0) hr = S_OK; // Don't free it as it was not cloned... } __except(SetErrorMode(SEM_NOGPFAULTERRORBOX), UnhandledExceptionFilter(GetExceptionInformation())) { *ppidl = NULL; hr = E_FAIL; } } return hr; } STDMETHODIMP CShellFolderView::get_FocusedItem(FolderItem **ppid) { // We need to talk to the actual window under us HRESULT hr = _GetFolder(); if (FAILED(hr)) return hr; *ppid = NULL; hr = S_FALSE; if (m_psfvOwner) { // Warning: // It is common for the following function to fail (which means no item has the focus). // So, do not save the return code from GetObjectSafely() into "hr" that will ruin the // S_FALSE value already stored there and result in script errors. (Bug #301306) // LPCITEMIDLIST pidl; if (SUCCEEDED(GetObjectSafely(m_psfvOwner, &pidl, (UINT)-2))) { hr = CFolderItem_Create(m_psdf, pidl, ppid); if (_dwSafetyOptions && SUCCEEDED(hr)) hr = MakeSafeForScripting((IUnknown**)ppid); } } else hr = E_FAIL; return hr; } // pvfi should be a "FolderItem" IDispatch STDMETHODIMP CShellFolderView::SelectItem(VARIANT *pvfi, int dwFlags) { HRESULT hr = E_FAIL; LPITEMIDLIST pidl = VariantToIDList(pvfi); if (pidl) { IShellView *psv; // use this to select the item... if (m_punkOwner && SUCCEEDED(m_punkOwner->QueryInterface(IID_IShellView, (void **)&psv))) { hr = psv->SelectItem(ILFindLastID(pidl), dwFlags); psv->Release(); } ILFree(pidl); } return hr; } STDMETHODIMP CShellFolderView::PopupItemMenu(FolderItem *pfi, VARIANT vx, VARIANT vy, BSTR * pbs) { return E_NOTIMPL; } STDMETHODIMP CShellFolderView::get_Script(IDispatch **ppid) { // Say that we got nothing... *ppid = NULL; // Assume we don't have one... if (!m_punkOwner) return S_FALSE; IShellView *psv; HRESULT hres = m_punkOwner->QueryInterface(IID_IShellView, (void **)&psv); if (SUCCEEDED(hres)) { // lets see if there is a IHTMLDocument that is below us now... IHTMLDocument *phtmld; hres = psv->GetItemObject(SVGIO_BACKGROUND, IID_IHTMLDocument, (void **)&phtmld); if (SUCCEEDED(hres)) { if (_dwSafetyOptions) hres = MakeSafeForScripting((IUnknown **)&phtmld); if (SUCCEEDED(hres)) { hres = phtmld->get_Script(ppid); phtmld->Release(); } } psv->Release(); } return hres; } STDMETHODIMP CShellFolderView::get_ViewOptions(long *plSetting) { *plSetting = (LONG)GetViewOptionsForDispatch(); return S_OK; } STDMETHODIMP CShellFolderView::SetOwner(IUnknown* punkOwner) { // Release any previous owners. (ATOMICRELEASE takes care of the null check) ATOMICRELEASE(m_psfvOwner); ATOMICRELEASE(m_punkOwner); // Set the new owner if any set then increment reference count... m_punkOwner = punkOwner; if (m_punkOwner) { m_punkOwner->AddRef(); m_punkOwner->QueryInterface(IID_IShellFolderView, (void **)&m_psfvOwner); if (!m_hwnd) { IShellView *psv; // this is gross, until we can merge the two models, create one of our // Window objects. if (SUCCEEDED(m_punkOwner->QueryInterface(IID_IShellView, (void **)&psv))) { HWND hwndFldr; psv->GetWindow(&hwndFldr); // Really gross, but assume parent HWND is the HWND we are after... m_hwnd = GetParent(hwndFldr); psv->Release(); } } } return NOERROR; } STDMETHODIMP CShellFolderView::EnumConnectionPoints(IEnumConnectionPoints **ppEnum) { return CreateInstance_IEnumConnectionPoints(ppEnum, 1, m_cpEvents.CastToIConnectionPoint()); } CConnectionPoint* CShellFolderView::_FindCConnectionPointNoRef(BOOL fdisp, REFIID iid) { if (IsEqualIID(iid, DIID_DShellFolderViewEvents) || (fdisp && IsEqualIID(iid, IID_IDispatch))) return &m_cpEvents; return NULL; } HRESULT CShellFolderView::Invoke(DISPID dispidMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS * pdispparams, VARIANT * pvarResult, EXCEPINFO * pexcepinfo, UINT * puArgErr) { HRESULT hr; if (dispidMember == DISPID_READYSTATE) return DISP_E_MEMBERNOTFOUND; // perf: what typeinfo would return. if (dispidMember == DISPID_WINDOWOBJECT) { IDispatch *pdisp; if (SUCCEEDED(get_Script(&pdisp))) { hr = pdisp->Invoke(dispidMember, riid, lcid, wFlags, pdispparams, pvarResult, pexcepinfo, puArgErr); pdisp->Release(); } else { hr = DISP_E_MEMBERNOTFOUND; } } else hr = CImpIDispatch::Invoke(dispidMember, riid, lcid, wFlags, pdispparams, pvarResult, pexcepinfo, puArgErr); return hr; }
29.875847
180
0.605893
King0987654
0a4aef98c14edfb926ac99bf26b4209e22e0115f
1,089
cpp
C++
src/ReadWrite/WriteImage.cpp
pateldeev/cs474
4aeb7c6a5317256e9e1f517d614a83b5b52f9f52
[ "Xnet", "X11" ]
null
null
null
src/ReadWrite/WriteImage.cpp
pateldeev/cs474
4aeb7c6a5317256e9e1f517d614a83b5b52f9f52
[ "Xnet", "X11" ]
null
null
null
src/ReadWrite/WriteImage.cpp
pateldeev/cs474
4aeb7c6a5317256e9e1f517d614a83b5b52f9f52
[ "Xnet", "X11" ]
null
null
null
#include <iostream> #include <fstream> #include "Image.h" #include "ReadWrite.h" int writeImage(const char fname[], const ImageType & image) { int i, j; int N, M, Q; unsigned char * charImage; std::ofstream ofp; image.getImageInfo(N, M, Q); charImage = (unsigned char *) new unsigned char [M * N]; // convert the integer values to unsigned char int val; for (i = 0; i < N; i++) { for (j = 0; j < M; j++) { image.getPixelVal(i, j, val); charImage[i * M + j] = (unsigned char) val; } } ofp.open(fname, std::ios::out | std::ios::binary); if (!ofp) { std::cout << "Can't open file: " << fname << std::endl; exit(1); } ofp << "P5" << std::endl; ofp << M << " " << N << std::endl; ofp << Q << std::endl; ofp.write(reinterpret_cast<char *> (charImage), (M * N) * sizeof (unsigned char)); if (ofp.fail()) { std::cout << "Can't write image " << fname << std::endl; exit(0); } ofp.close(); delete [] charImage; return 1; }
20.54717
86
0.513315
pateldeev
0a4ca286a8b0ca0c1b4f8da01c1c36ff51cf413b
4,883
cpp
C++
src/minisef/networksystem/networkserver.cpp
cstom4994/SourceEngineRebuild
edfd7f8ce8af13e9d23586318350319a2e193c08
[ "MIT" ]
6
2022-01-23T09:40:33.000Z
2022-03-20T20:53:25.000Z
src/minisef/networksystem/networkserver.cpp
cstom4994/SourceEngineRebuild
edfd7f8ce8af13e9d23586318350319a2e193c08
[ "MIT" ]
null
null
null
src/minisef/networksystem/networkserver.cpp
cstom4994/SourceEngineRebuild
edfd7f8ce8af13e9d23586318350319a2e193c08
[ "MIT" ]
1
2022-02-06T21:05:23.000Z
2022-02-06T21:05:23.000Z
//========= Copyright Valve Corporation, All rights reserved. ============// // // Purpose: // //===========================================================================// #include "networkserver.h" #include "networksystem.h" #include "icvar.h" #include "filesystem.h" #include "UDP_Socket.h" #include "sm_protocol.h" #include "NetChannel.h" #include "UDP_Process.h" #include <winsock.h> #include "networkclient.h" //----------------------------------------------------------------------------- // // Implementation of CPlayer // //----------------------------------------------------------------------------- CNetworkServer::CNetworkServer( ) { m_pSocket = new CUDPSocket; } CNetworkServer::~CNetworkServer() { delete m_pSocket; } bool CNetworkServer::Init( int nServerPort ) { if ( !m_pSocket->Init( nServerPort ) ) { Warning( "CNetworkServer: Unable to create socket!!!\n" ); return false; } return true; } void CNetworkServer::Shutdown() { m_pSocket->Shutdown(); } CNetChannel *CNetworkServer::FindNetChannel( const netadr_t& from ) { CPlayer *pl = FindPlayerByAddress( from ); if ( pl ) return &pl->m_NetChan; return NULL; } CPlayer *CNetworkServer::FindPlayerByAddress( const netadr_t& adr ) { int c = m_Players.Count(); for ( int i = 0; i < c; ++i ) { CPlayer *player = m_Players[ i ]; if ( player->GetRemoteAddress().CompareAdr( adr ) ) return player; } return NULL; } CPlayer *CNetworkServer::FindPlayerByNetChannel( INetChannel *chan ) { int c = m_Players.Count(); for ( int i = 0; i < c; ++i ) { CPlayer *player = m_Players[ i ]; if ( &player->m_NetChan == chan ) return player; } return NULL; } #define SPEW_MESSAGES #if defined( SPEW_MESSAGES ) #define SM_SPEW_MESSAGE( code, remote ) \ Warning( "Message: %s from '%s'\n", #code, remote ); #else #define SM_SPEW_MESSAGE( code, remote ) #endif // process a connectionless packet bool CNetworkServer::ProcessConnectionlessPacket( CNetPacket *packet ) { int code = packet->m_Message.ReadByte(); switch ( code ) { case c2s_connect: { SM_SPEW_MESSAGE( c2s_connect, packet->m_From.ToString() ); CPlayer *pl = FindPlayerByAddress( packet->m_From ); if ( pl ) { Warning( "Player already exists for %s\n", packet->m_From.ToString() ); } else { // Creates the connection pl = new CPlayer( this, packet->m_From ); m_Players.AddToTail( pl ); // Now send the conn accepted message AcceptConnection( packet->m_From ); } } break; default: { Warning( "CNetworkServer::ProcessConnectionlessPacket: Unknown code '%i' from '%s'\n", code, packet->m_From.ToString() ); } break; } return true; } void CNetworkServer::AcceptConnection( const netadr_t& remote ) { byte data[ 512 ]; bf_write buf( "CNetworkServer::AcceptConnection", data, sizeof( data ) ); buf.WriteLong( -1 ); buf.WriteByte( s2c_connect_accept ); m_pSocket->SendTo( remote, buf.GetData(), buf.GetNumBytesWritten() ); } void CNetworkServer::ReadPackets( void ) { UDP_ProcessSocket( m_pSocket, this, this ); int c = m_Players.Count(); for ( int i = c - 1; i >= 0 ; --i ) { if ( m_Players[ i ]->m_bMarkedForDeletion ) { CPlayer *pl = m_Players[ i ]; m_Players.Remove( i ); delete pl; } } } void CNetworkServer::SendUpdates() { int c = m_Players.Count(); for ( int i = 0; i < c; ++i ) { m_Players[ i ]->SendUpdate(); } } void CNetworkServer::OnConnectionStarted( INetChannel *pChannel ) { // Create a network event NetworkConnectionEvent_t *pConnection = g_pNetworkSystemImp->CreateNetworkEvent< NetworkConnectionEvent_t >( ); pConnection->m_nType = NETWORK_EVENT_CONNECTED; pConnection->m_pChannel = pChannel; } void CNetworkServer::OnConnectionClosing( INetChannel *pChannel, char const *reason ) { Warning( "OnConnectionClosing '%s'\n", reason ); CPlayer *pPlayer = FindPlayerByNetChannel( pChannel ); if ( pPlayer ) { pPlayer->Shutdown(); } // Create a network event NetworkDisconnectionEvent_t *pDisconnection = g_pNetworkSystemImp->CreateNetworkEvent< NetworkDisconnectionEvent_t >( ); pDisconnection->m_nType = NETWORK_EVENT_DISCONNECTED; pDisconnection->m_pChannel = pChannel; } void CNetworkServer::OnPacketStarted( int inseq, int outseq ) { } void CNetworkServer::OnPacketFinished() { } //----------------------------------------------------------------------------- // // Implementation of CPlayer // //----------------------------------------------------------------------------- CPlayer::CPlayer( CNetworkServer *server, netadr_t& remote ) : m_bMarkedForDeletion( false ) { m_NetChan.Setup( true, &remote, server->m_pSocket, "player", server ); } void CPlayer::Shutdown() { m_bMarkedForDeletion = true; m_NetChan.Shutdown( "received disconnect\n" ); } void CPlayer::SendUpdate() { if ( m_NetChan.CanSendPacket() ) { m_NetChan.SendDatagram( NULL ); } }
21.702222
121
0.632808
cstom4994
0a4cb9edec566a07e3e86a91be221479c3978078
2,677
cpp
C++
Practice/2018/2018.9.27/Luogu1295.cpp
SYCstudio/OI
6e9bfc17dbd4b43467af9b19aa2aed41e28972fa
[ "MIT" ]
4
2017-10-31T14:25:18.000Z
2018-06-10T16:10:17.000Z
Practice/2018/2018.9.27/Luogu1295.cpp
SYCstudio/OI
6e9bfc17dbd4b43467af9b19aa2aed41e28972fa
[ "MIT" ]
null
null
null
Practice/2018/2018.9.27/Luogu1295.cpp
SYCstudio/OI
6e9bfc17dbd4b43467af9b19aa2aed41e28972fa
[ "MIT" ]
null
null
null
#include<iostream> #include<cstdio> #include<cstdlib> #include<cstring> #include<algorithm> using namespace std; #define ll long long #define mem(Arr,x) memset(Arr,x,sizeof(Arr)) #define lson (now<<1) #define rson (lson|1) const int maxN=201000; const int inf=2147483647; const ll INF=1e17; class SegmentData { public: ll mnkey,mn,lz; SegmentData(){ mnkey=INF;mn=lz=0;return; } }; int n,m; ll Bk[maxN],Sm[maxN],Q[maxN]; SegmentData S[maxN<<2]; void Modify(int now,int l,int r,int pos,ll key); void Replace(int now,int l,int r,int ql,int qr,ll mx); ll Query(int now,int l,int r,int ql,int qr); void Update(int now); void PushDown(int now); void Delta(int now,ll nmx); void Outp(int now,int l,int r); int main(){ scanf("%d%d",&n,&m); for (int i=1;i<=n;i++) scanf("%lld",&Bk[i]),Sm[i]=Sm[i-1]+Bk[i]; Modify(1,0,n,0,0); //Outp(1,0,n); int L=1,R=1;Bk[0]=INF; for (int i=1;i<=n;i++){ while ((L<=R)&&(Bk[Q[R]]<=Bk[i])) R--; //cout<<"Q:"<<i<<" "<<Q[R]<<endl; Replace(1,0,n,Q[R],i-1,Bk[i]); Q[++R]=i; int p=lower_bound(&Sm[0],&Sm[n+1],Sm[i]-m)-Sm; while (Sm[p]<Sm[i]-m) p++; if (p>=i) p=i-1; ll f=Query(1,0,n,p,i-1); //cout<<i<<":"<<p<<" "<<f<<endl; Modify(1,0,n,i,f); //Outp(1,0,n); } printf("%lld\n",Query(1,0,n,n,n));return 0; } void Modify(int now,int l,int r,int pos,ll key){ if (l==r){ S[now].mnkey=S[now].mn=key;return; } PushDown(now); int mid=(l+r)>>1; if (pos<=mid) Modify(lson,l,mid,pos,key); else Modify(rson,mid+1,r,pos,key); Update(now);return; } void Replace(int now,int l,int r,int ql,int qr,ll mx){ if ((l==ql)&&(r==qr)){ Delta(now,mx);return; } PushDown(now); int mid=(l+r)>>1; if (qr<=mid) Replace(lson,l,mid,ql,qr,mx); else if (ql>=mid+1) Replace(rson,mid+1,r,ql,qr,mx); else{ Replace(lson,l,mid,ql,mid,mx); Replace(rson,mid+1,r,mid+1,qr,mx); } Update(now);return; } ll Query(int now,int l,int r,int ql,int qr){ if ((l==ql)&&(r==qr)) return S[now].mnkey; PushDown(now); int mid=(l+r)>>1; if (qr<=mid) return Query(lson,l,mid,ql,qr); else if (ql>=mid+1) return Query(rson,mid+1,r,ql,qr); else return min(Query(lson,l,mid,ql,mid),Query(rson,mid+1,r,mid+1,qr)); } void Update(int now){ S[now].mn=min(S[lson].mn,S[rson].mn); S[now].mnkey=min(S[lson].mnkey,S[rson].mnkey); return; } void PushDown(int now){ if (S[now].lz){ Delta(lson,S[now].lz);Delta(rson,S[now].lz); S[now].lz=0; } return; } void Delta(int now,ll nmx){ S[now].mnkey=S[now].mn+nmx; S[now].lz=nmx;return; } void Outp(int now,int l,int r){ if (l==r) cout<<"["<<l<<" "<<r<<"] "<<S[now].mnkey<<" "<<S[now].mn<<endl; if (l==r) return; int mid=(l+r)>>1;PushDown(now); Outp(lson,l,mid);Outp(rson,mid+1,r); return; }
22.123967
74
0.605902
SYCstudio
aeaa8fe0a1f9ad2666609dc10d64678dacd55ecc
1,682
hpp
C++
app/GUI/widgetPacks/CraftingWindow.hpp
isonil/survival
ecb59af9fcbb35b9c28fd4fe29a4628f046165c8
[ "MIT" ]
1
2017-05-12T10:12:41.000Z
2017-05-12T10:12:41.000Z
app/GUI/widgetPacks/CraftingWindow.hpp
isonil/Survival
ecb59af9fcbb35b9c28fd4fe29a4628f046165c8
[ "MIT" ]
null
null
null
app/GUI/widgetPacks/CraftingWindow.hpp
isonil/Survival
ecb59af9fcbb35b9c28fd4fe29a4628f046165c8
[ "MIT" ]
1
2019-01-09T04:05:36.000Z
2019-01-09T04:05:36.000Z
#ifndef APP_CRAFTING_WINDOW_HPP #define APP_CRAFTING_WINDOW_HPP #include "engine/util/Vec2.hpp" #include <vector> namespace engine { namespace GUI { class Window; class Button; class RectWidget; class Image; class Label; } } namespace app { class Character; class Structure; class CraftingWindow { public: CraftingWindow(const std::shared_ptr <Character> &character); CraftingWindow(const std::shared_ptr <Character> &character, const std::shared_ptr <Structure> &workbench); void update(); bool isClosed() const; bool hasWorkbench() const; Character &getCharacter() const; Structure &getWorkbench() const; static const float k_maxCharacterDistanceToWorkbench; private: struct Row { std::shared_ptr <engine::GUI::RectWidget> rect; std::shared_ptr <engine::GUI::Button> craftButton; std::shared_ptr <engine::GUI::Image> itemImage; std::shared_ptr <engine::GUI::Label> itemLabel; std::shared_ptr <engine::GUI::Label> priceLabel; std::shared_ptr <engine::GUI::Label> skillsRequirementLabel; }; void init(); void recreateRows(); static const engine::IntVec2 k_size; static const std::string k_title; static const int k_rowsCountPerPage; std::shared_ptr <Character> m_character; std::shared_ptr <Structure> m_workbench; std::shared_ptr <engine::GUI::Window> m_window; std::shared_ptr <engine::GUI::Button> m_nextButton; std::shared_ptr <engine::GUI::Button> m_previousButton; std::shared_ptr <engine::GUI::Label> m_pageLabel; std::vector <Row> m_rows; int m_rowsOffset; }; } // namespace app #endif // APP_CRAFTING_WINDOW_HPP
26.28125
111
0.706302
isonil
aeaaae6de38b505fc2ea3fcdf98ae4333abed1ac
7,512
cpp
C++
mpc_controller/ros_acado_bridge/ACADOtoolkit/acado/code_generation/linear_solvers/export_cholesky_solver.cpp
kurshakuz/graduation-project
352a94c2d3e24ce714460446342b612fbb6d1f52
[ "BSD-2-Clause" ]
2
2021-04-07T08:37:28.000Z
2021-09-30T09:38:22.000Z
mpc_controller/ros_acado_bridge/ACADOtoolkit/acado/code_generation/linear_solvers/export_cholesky_solver.cpp
kurshakuz/graduation-project
352a94c2d3e24ce714460446342b612fbb6d1f52
[ "BSD-2-Clause" ]
null
null
null
mpc_controller/ros_acado_bridge/ACADOtoolkit/acado/code_generation/linear_solvers/export_cholesky_solver.cpp
kurshakuz/graduation-project
352a94c2d3e24ce714460446342b612fbb6d1f52
[ "BSD-2-Clause" ]
2
2021-03-01T14:20:58.000Z
2021-06-21T12:34:33.000Z
/* * This file is part of ACADO Toolkit. * * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization. * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau, * Milan Vukov, Rien Quirynen, KU Leuven. * Developed within the Optimization in Engineering Center (OPTEC) * under supervision of Moritz Diehl. All rights reserved. * * ACADO Toolkit 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 3 of the License, or (at your option) any later version. * * ACADO Toolkit 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 ACADO Toolkit; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ /** * \file src/code_generation/export_cholesky_solver.cpp * \author Milan Vukov * \date 2014 */ #include <acado/code_generation/linear_solvers/export_cholesky_solver.hpp> using namespace std; BEGIN_NAMESPACE_ACADO ExportCholeskySolver::ExportCholeskySolver( UserInteraction* _userInteraction, const std::string& _commonHeaderName ) : ExportLinearSolver(_userInteraction, _commonHeaderName) { nColsB = 0; } ExportCholeskySolver::~ExportCholeskySolver() {} returnValue ExportCholeskySolver::init( unsigned _dimA, unsigned _numColsB, const std::string& _id ) { nRows = nCols = _dimA; nColsB = _numColsB; identifier = _id; A.setup("A", nRows, nCols, REAL, ACADO_LOCAL); B.setup("B", nRows, nColsB, REAL, ACADO_LOCAL); chol.setup(identifier + "_chol", A); solve.setup(identifier + "_solve", A, B); REUSE = false; return SUCCESSFUL_RETURN; } returnValue ExportCholeskySolver::setup() { unsigned flopsChol, flopsSolve; if (REUSE == true) return RET_NOT_IMPLEMENTED_YET; if( TRANSPOSE ) return ACADOERROR( RET_NOT_YET_IMPLEMENTED ); if (nRightHandSides > 0) return RET_NOT_IMPLEMENTED_YET; ExportVariable sum("sum", 1, 1, REAL, ACADO_LOCAL, true); ExportVariable div("div", 1, 1, REAL, ACADO_LOCAL, true); ExportVariable ret("ret", 1, 1, INT, ACADO_LOCAL, true); chol.addVariable( sum ); chol.addVariable( div ); chol.setReturnValue( ret ); chol.addStatement( ret == 0 ); // Approximate number of flops flopsChol = nRows * nRows * nRows / 3; if (flopsChol < 128) for(int ii = 0; ii < (int)nRows; ++ii) { for (int k = 0; k < ii; ++k) chol.addStatement( A.getElement(ii, k) == 0.0 ); /* j == i */ // sum = H[ii * nCols + ii]; chol.addStatement( sum == A.getElement(ii, ii) ); for(int k = (ii - 1); k >= 0; --k) // sum -= A[k*NVMAX + i] * A[k*NVMAX + i]; chol.addStatement( sum -= A.getElement(k, ii) * A.getElement(k, ii) ); chol << "if (" << sum.getFullName() << "< 0.0) return 1;\n"; // if ( sum > 0.0 ) // R[i*NVMAX + i] = sqrt( sum ); // else // { // hessianType = HST_SEMIDEF; // return THROWERROR( RET_HESSIAN_NOT_SPD ); // } chol << A.getElement(ii, ii).get(0, 0) << " = sqrt(" << sum.getFullName() << ");\n"; chol << div.getFullName() << " = 1.0 / " << A.getElement(ii, ii).get(0, 0) << ";\n"; /* j > i */ for(int jj = (ii + 1); jj < (int)nRows; ++jj) { // jj = FR_idx[j]; // sum = H[jj*NVMAX + ii]; chol.addStatement( sum == A.getElement(jj, ii) ); for(int k = (ii - 1); k >= 0; --k) // sum -= R[k * NVMAX + ii] * R[k * NVMAX + jj]; chol.addStatement( sum -= A.getElement(k, ii) * A.getElement(k, jj) ); // R[ii * NVMAX + jj] = sum / R[ii * NVMAX + ii]; chol.addStatement( A.getElement(ii, jj) == sum * div ); } } else { ExportIndex ii, jj, k; chol.acquire( ii ).acquire( jj ).acquire( k ); ExportForLoop iiLoop(ii, 0, nRows); ExportForLoop kLoop(k, 0, ii); kLoop.addStatement( A.getElement(ii, k) == 0.0 ); iiLoop.addStatement( kLoop ); iiLoop.addStatement( sum == A.getElement(ii, ii) ); ExportForLoop kLoop2(k, ii - 1, -1, -1); kLoop2.addStatement( sum -= A.getElement(k, ii) * A.getElement(k, ii) ); iiLoop.addStatement( kLoop2 ); iiLoop << "if (" << sum.getFullName() << "< 0.0) return 1;\n"; iiLoop << A.getElement(ii, ii).get(0, 0) << " = sqrt(" << sum.getFullName() << ");\n"; iiLoop << div.getFullName() << " = 1.0 / " << A.getElement(ii, ii).get(0, 0) << ";\n"; ExportForLoop jjLoop(jj, ii + 1, nRows); jjLoop.addStatement( sum == A.getElement(jj, ii) ); ExportForLoop kLoop3(k, ii - 1, -1, -1); kLoop3.addStatement( sum -= A.getElement(k, ii) * A.getElement(k, jj) ); jjLoop.addStatement( kLoop3 ); jjLoop.addStatement( A.getElement(ii, jj) == sum * div ); iiLoop.addStatement( jjLoop ); chol.addStatement( iiLoop ); chol.release( ii ).release( jj ).release( k ); } // // Setup evaluation of the solve function // Implements R^T X = B -> X = R^{-T} * B. B is replaced by the solution. // // Approximate number of flops flopsSolve = nRows * nRows * nColsB; solve.addVariable( sum ); if (flopsSolve < 128) for (unsigned col = 0; col < nColsB; ++col) for(int i = 0; i < int(nRows); ++i) { // sum = b[i]; solve.addStatement( sum == B.getElement(i, col) ); for(int j = 0; j < i; ++j) // sum -= R[j*NVMAX + i] * a[j]; solve.addStatement( sum-= A.getElement(j, i) * B.getElement(j, col) ); // TODO Error checking // if ( getAbs( R[i*NVMAX + i] ) > ZERO ) // a[i] = sum / R[i*NVMAX + i]; // else // return THROWERROR( RET_DIV_BY_ZERO ); solve << B.getElement(i, col).get(0, 0) << " = " << sum.getFullName() << " / " << A.getElement(i, i).get(0, 0) << ";\n"; } else { ExportIndex col, i, j; solve.acquire( col ).acquire( i ).acquire( j ); ExportForLoop colLoop(col, 0, nColsB); ExportForLoop iLoop(i, 0, nRows); iLoop.addStatement( sum == B.getElement(i, col) ); ExportForLoop jLoop(j, 0, i); jLoop.addStatement( sum-= A.getElement(j, i) * B.getElement(j, col) ); iLoop << jLoop; iLoop << B.getElement(i, col).get(0, 0) << " = " << sum.getFullName() << " / " << A.getElement(i, i).get(0, 0) << ";\n"; colLoop << iLoop; solve << colLoop; solve.release( col ).release( i ).release( j ); } return SUCCESSFUL_RETURN; } returnValue ExportCholeskySolver::getCode( ExportStatementBlock& code ) { code.addFunction( chol ); code.addFunction( solve ); return SUCCESSFUL_RETURN; } returnValue ExportCholeskySolver::getDataDeclarations( ExportStatementBlock& declarations, ExportStruct dataStruct ) const { return SUCCESSFUL_RETURN; } returnValue ExportCholeskySolver::getFunctionDeclarations( ExportStatementBlock& declarations ) const { declarations.addDeclaration( chol ); declarations.addDeclaration( solve ); return SUCCESSFUL_RETURN; } const ExportFunction& ExportCholeskySolver::getCholeskyFunction() const { return chol; } const ExportFunction& ExportCholeskySolver::getSolveFunction() const { return solve; } returnValue ExportCholeskySolver::appendVariableNames( std::stringstream& string ) { return SUCCESSFUL_RETURN; } CLOSE_NAMESPACE_ACADO // end of file.
28.240602
124
0.633387
kurshakuz
aeabd7358cb7200739ac913a280cbfcd9e702614
2,669
cpp
C++
HiroCamSDK/src/main/cpp/dependence/src/libmp4v2/src/atom_video.cpp
shirleyyuqi/UIFySim
15810480022003f5f84509229ef5acbd47e54172
[ "Apache-2.0" ]
1
2019-12-25T17:38:30.000Z
2019-12-25T17:38:30.000Z
HiroCamSDK/src/main/cpp/dependence/src/libmp4v2/src/atom_video.cpp
shirleyyuqi/UIFySim
15810480022003f5f84509229ef5acbd47e54172
[ "Apache-2.0" ]
1
2020-03-18T10:20:43.000Z
2020-03-18T10:20:43.000Z
mp4v2-2.0.0/src/atom_video.cpp
nichesuch/AirOrche
ab048fe01eb85633464ab676ff33e06c7fef1097
[ "MIT" ]
null
null
null
/* * The contents of this file are subject to the Mozilla Public * License Version 1.1 (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.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or * implied. See the License for the specific language governing * rights and limitations under the License. * * The Original Code is MPEG4IP. * * The Initial Developer of the Original Code is Cisco Systems Inc. * Portions created by Cisco Systems Inc. are * Copyright (C) Cisco Systems Inc. 2004. All Rights Reserved. * * Contributor(s): * Bill May wmay@cisco.com */ #include "src/impl.h" namespace mp4v2 { namespace impl { /////////////////////////////////////////////////////////////////////////////// MP4VideoAtom::MP4VideoAtom (MP4File &file, const char *type) : MP4Atom(file, type) { AddReserved(*this, "reserved1", 6); /* 0 */ AddProperty( /* 1 */ new MP4Integer16Property(*this, "dataReferenceIndex")); AddReserved(*this, "reserved2", 16); /* 2 */ AddProperty( /* 3 */ new MP4Integer16Property(*this, "width")); AddProperty( /* 4 */ new MP4Integer16Property(*this, "height")); AddReserved(*this, "reserved3", 14); /* 5 */ MP4StringProperty* pProp = new MP4StringProperty(*this, "compressorName"); pProp->SetFixedLength(32); pProp->SetCountedFormat(true); pProp->SetValue(""); AddProperty(pProp); /* 6 */ AddProperty(/* 7 */ new MP4Integer16Property(*this, "depth")); AddProperty(/* 8 */ new MP4Integer16Property(*this, "colorTableId")); ExpectChildAtom("smi ", Optional, OnlyOne); } void MP4VideoAtom::Generate() { MP4Atom::Generate(); ((MP4Integer16Property*)m_pProperties[1])->SetValue(1); // property reserved3 has non-zero fixed values static uint8_t reserved3[14] = { 0x00, 0x48, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, }; m_pProperties[5]->SetReadOnly(false); ((MP4BytesProperty*)m_pProperties[5])-> SetValue(reserved3, sizeof(reserved3)); m_pProperties[5]->SetReadOnly(true); // depth and color table id values - should be set later // as far as depth - color table is most likely 0xff ((MP4IntegerProperty *)m_pProperties[7])->SetValue(0x18); ((MP4IntegerProperty *)m_pProperties[8])->SetValue(0xffff); } /////////////////////////////////////////////////////////////////////////////// } } // namespace mp4v2::impl
29.988764
79
0.620457
shirleyyuqi
aead11d0a4d5056f721fdf7cd09985ff74eac382
14,040
cpp
C++
src/crl_camera/CRLPhysicalCamera.cpp
M-Gjerde/MultiSense
921a1a62757a4831bd51b2659e2bff670641d962
[ "MIT" ]
null
null
null
src/crl_camera/CRLPhysicalCamera.cpp
M-Gjerde/MultiSense
921a1a62757a4831bd51b2659e2bff670641d962
[ "MIT" ]
null
null
null
src/crl_camera/CRLPhysicalCamera.cpp
M-Gjerde/MultiSense
921a1a62757a4831bd51b2659e2bff670641d962
[ "MIT" ]
null
null
null
// // Created by magnus on 3/1/22. // #include <thread> #include <bitset> #include "CRLPhysicalCamera.h" #include <iostream> bool CRLPhysicalCamera::connect(const std::string& ip) { if (cameraInterface == nullptr) { cameraInterface = crl::multisense::Channel::Create(ip); if (cameraInterface != nullptr) { updateCameraInfo(); addCallbacks(); cameraInterface->setMtu(7200); // TODO Move and error check this line. Failed on Windows if Jumbo frames is disabled on ethernet device online = true; return true; } } return false; } void CRLPhysicalCamera::start(std::string string, std::string dataSourceStr) { crl::multisense::DataSource source = stringToDataSource(dataSourceStr); // Check if the stream has already been enabled first if (std::find(enabledSources.begin(), enabledSources.end(), source) != enabledSources.end()) { return; } uint32_t colorSource = crl::multisense::Source_Chroma_Rectified_Aux | crl::multisense::Source_Chroma_Rectified_Aux | crl::multisense::Source_Chroma_Aux | crl::multisense::Source_Chroma_Left | crl::multisense::Source_Chroma_Right; if (source & colorSource) enabledSources.push_back(crl::multisense::Source_Luma_Rectified_Aux); enabledSources.push_back(source); // Set mode first std::string delimiter = "x"; size_t pos = 0; std::string token; std::vector<uint32_t> widthHeightDepth; while ((pos = string.find(delimiter)) != std::string::npos) { token = string.substr(0, pos); widthHeightDepth.push_back(std::stoi(token)); string.erase(0, pos + delimiter.length()); } if (widthHeightDepth.size() != 3) { std::cerr << "Select valid mode\n"; return; } //this->selectDisparities(widthHeightDepth[2]); //this->selectResolution(widthHeightDepth[0], widthHeightDepth[1]); //this->selectFramerate(60); // Start stream for (auto src: enabledSources) { bool status = cameraInterface->startStreams(src); printf("Started stream %s status: %d\n", dataSourceToString(src).c_str(), status); } std::thread thread_obj(CRLPhysicalCamera::setDelayedPropertyThreadFunc, this); thread_obj.join(); } void CRLPhysicalCamera::setDelayedPropertyThreadFunc(void *context) { auto *app = static_cast<CRLPhysicalCamera *>(context); std::this_thread::sleep_until(std::chrono::system_clock::now() + std::chrono::seconds(1)); app->modeChange = true; app->play = true; } void CRLPhysicalCamera::stop(std::string dataSourceStr) { crl::multisense::DataSource src = stringToDataSource(dataSourceStr); // Check if the stream has been enabled before we attempt to stop it if (std::find(enabledSources.begin(), enabledSources.end(), src) == enabledSources.end()) { return; } std::vector<uint32_t>::iterator it; it = std::remove(enabledSources.begin(), enabledSources.end(), src); enabledSources.erase(it); /* std::vector<uint32_t>::iterator it; // Search and stop additional sources it = std::find(enabledSources.begin(), enabledSources.end(), crl::multisense::Source_Chroma_Rectified_Aux); if (it != enabledSources.end()) { src |= crl::multisense::Source_Luma_Rectified_Aux; } */ bool status = cameraInterface->stopStreams(src); printf("Stopped stream %s status: %d\n", dataSourceStr.c_str(), status); modeChange = true; } /* CRLBaseCamera::PointCloudData *CRLPhysicalCamera::getStream() { return meshData; } std::unordered_map<crl::multisense::DataSource, crl::multisense::image::Header> CRLPhysicalCamera::getImage() { return imagePointers; } CRLPhysicalCamera::~CRLPhysicalCamera() { if (meshData != nullptr && meshData->vertices != nullptr) free(meshData->vertices); } CRLBaseCamera::CameraInfo CRLPhysicalCamera::getInfo() { return CRLBaseCamera::cameraInfo; } // Pick an image size crl::multisense::image::Config CRLPhysicalCamera::getImageConfig() const { // Configure the sensor. crl::multisense::image::Config cfg; bool status = cameraInterface->getImageConfig(cfg); if (crl::multisense::Status_Ok != status) { printf("Failed to query image config: %d\n", status); } return cfg; } std::unordered_set<crl::multisense::DataSource> CRLPhysicalCamera::supportedSources() { // this method effectively restrics the supported sources for the classice libmultisense api std::unordered_set<crl::multisense::DataSource> ret; if (cameraInfo.supportedSources & crl::multisense::Source_Raw_Left) ret.insert(crl::multisense::Source_Raw_Left); if (cameraInfo.supportedSources & crl::multisense::Source_Raw_Right) ret.insert(crl::multisense::Source_Raw_Right); if (cameraInfo.supportedSources & crl::multisense::Source_Luma_Left) ret.insert(crl::multisense::Source_Luma_Left); if (cameraInfo.supportedSources & crl::multisense::Source_Luma_Right) ret.insert(crl::multisense::Source_Luma_Right); if (cameraInfo.supportedSources & crl::multisense::Source_Luma_Rectified_Left) ret.insert(crl::multisense::Source_Luma_Rectified_Left); if (cameraInfo.supportedSources & crl::multisense::Source_Luma_Rectified_Right) ret.insert(crl::multisense::Source_Luma_Rectified_Right); if (cameraInfo.supportedSources & crl::multisense::Source_Chroma_Aux) ret.insert(crl::multisense::Source_Chroma_Aux); if (cameraInfo.supportedSources & crl::multisense::Source_Chroma_Left) ret.insert(crl::multisense::Source_Chroma_Left); if (cameraInfo.supportedSources & crl::multisense::Source_Chroma_Right) ret.insert(crl::multisense::Source_Chroma_Right); if (cameraInfo.supportedSources & crl::multisense::Source_Disparity_Left) ret.insert(crl::multisense::Source_Disparity_Left); if (cameraInfo.supportedSources & crl::multisense::Source_Disparity_Right) ret.insert(crl::multisense::Source_Disparity_Right); if (cameraInfo.supportedSources & crl::multisense::Source_Disparity_Cost) ret.insert(crl::multisense::Source_Disparity_Cost); if (cameraInfo.supportedSources & crl::multisense::Source_Raw_Aux) ret.insert(crl::multisense::Source_Raw_Aux); if (cameraInfo.supportedSources & crl::multisense::Source_Luma_Aux) ret.insert(crl::multisense::Source_Luma_Aux); if (cameraInfo.supportedSources & crl::multisense::Source_Luma_Rectified_Aux) ret.insert(crl::multisense::Source_Luma_Rectified_Aux); if (cameraInfo.supportedSources & crl::multisense::Source_Chroma_Rectified_Aux) ret.insert(crl::multisense::Source_Chroma_Rectified_Aux); if (cameraInfo.supportedSources & crl::multisense::Source_Disparity_Aux) ret.insert(crl::multisense::Source_Disparity_Aux); return ret; } */ std::string CRLPhysicalCamera::dataSourceToString(crl::multisense::DataSource d) { switch (d) { case crl::multisense::Source_Raw_Left: return "Raw Left"; case crl::multisense::Source_Raw_Right: return "Raw Right"; case crl::multisense::Source_Luma_Left: return "Luma Left"; case crl::multisense::Source_Luma_Right: return "Luma Right"; case crl::multisense::Source_Luma_Rectified_Left: return "Luma Rectified Left"; case crl::multisense::Source_Luma_Rectified_Right: return "Luma Rectified Right"; case crl::multisense::Source_Chroma_Left: return "Color Left"; case crl::multisense::Source_Chroma_Right: return "Source Color Right"; case crl::multisense::Source_Disparity_Left: return "Disparity Left"; case crl::multisense::Source_Disparity_Cost: return "Disparity Cost"; case crl::multisense::Source_Jpeg_Left: return "Jpeg Left"; case crl::multisense::Source_Rgb_Left: return "Source Rgb Left"; case crl::multisense::Source_Lidar_Scan: return "Source Lidar Scan"; case crl::multisense::Source_Raw_Aux: return "Raw Aux"; case crl::multisense::Source_Luma_Aux: return "Luma Aux"; case crl::multisense::Source_Luma_Rectified_Aux: return "Luma Rectified Aux"; case crl::multisense::Source_Chroma_Aux: return "Color Aux"; case crl::multisense::Source_Chroma_Rectified_Aux: return "Color Rectified Aux"; case crl::multisense::Source_Disparity_Aux: return "Disparity Aux"; default: return "Unknown"; } } crl::multisense::DataSource CRLPhysicalCamera::stringToDataSource(const std::string &d) { if (d == "Raw Left") return crl::multisense::Source_Raw_Left; if (d == "Raw Right") return crl::multisense::Source_Raw_Right; if (d == "Luma Left") return crl::multisense::Source_Luma_Left; if (d == "Luma Right") return crl::multisense::Source_Luma_Right; if (d == "Luma Rectified Left") return crl::multisense::Source_Luma_Rectified_Left; if (d == "Luma Rectified Right") return crl::multisense::Source_Luma_Rectified_Right; if (d == "Color Left") return crl::multisense::Source_Chroma_Left; if (d == "Source Color Right") return crl::multisense::Source_Chroma_Right; if (d == "Disparity Left") return crl::multisense::Source_Disparity_Left; if (d == "Disparity Cost") return crl::multisense::Source_Disparity_Cost; if (d == "Jpeg Left") return crl::multisense::Source_Jpeg_Left; if (d == "Source Rgb Left") return crl::multisense::Source_Rgb_Left; if (d == "Source Lidar Scan") return crl::multisense::Source_Lidar_Scan; if (d == "Raw Aux") return crl::multisense::Source_Raw_Aux; if (d == "Luma Aux") return crl::multisense::Source_Luma_Aux; if (d == "Luma Rectified Aux") return crl::multisense::Source_Luma_Rectified_Aux; if (d == "Color Aux") return crl::multisense::Source_Chroma_Aux; if (d == "Color Rectified Aux") return crl::multisense::Source_Chroma_Rectified_Aux; if (d == "Disparity Aux") return crl::multisense::Source_Disparity_Aux; throw std::runtime_error(std::string{} + "Unknown Datasource: " + d); } void CRLPhysicalCamera::update() { for (auto src: enabledSources) { if (src == crl::multisense::Source_Disparity_Left) { // Reproject camera to 3D //stream = &imagePointers[crl::multisense::Source_Disparity_Left]; } } } void CRLPhysicalCamera::setup(uint32_t width, uint32_t height) { crl::multisense::image::Config c = cameraInfo.imgConf; kInverseMatrix = glm::mat4( glm::vec4(1 / c.fx(), 0, -(c.cx() * c.fx()) / (c.fx() * c.fy()), 0), glm::vec4(0, 1 / c.fy(), -c.cy() / c.fy(), 0), glm::vec4(0, 0, 1, 0), glm::vec4(0, 0, 0, 1)); kInverseMatrix = glm::transpose(kInverseMatrix); /* kInverseMatrix = glm::mat4(glm::vec4(c.fy() * c.tx(), 0, 0, -c.fy() * c.cx() * c.tx()), glm::vec4(0, c.fx() * c.tx(), 0, -c.fx() * c.cy() * c.tx()), glm::vec4(0, 0, 0, c.fx() * c.fy() * c.tx()), glm::vec4(0, 0, -c.fx(), c.fy() * 1)); kInverseMatrix = glm::mat4( glm::vec4(1/c.fx(), 0, -(c.cx()*c.fx())/(c.fx() * c.fy()), 0), glm::vec4(0, 1/c.fy(), -c.cy() / c.fy(), 0), glm::vec4(0, 0, 1, 0), glm::vec4(0, 0, 0, 1)); */ // Load calibration data } void CRLPhysicalCamera::updateCameraInfo() { cameraInterface->getImageConfig(cameraInfo.imgConf); cameraInterface->getNetworkConfig(cameraInfo.netConfig); cameraInterface->getVersionInfo(cameraInfo.versionInfo); cameraInterface->getDeviceInfo(cameraInfo.devInfo); cameraInterface->getDeviceModes(cameraInfo.supportedDeviceModes); cameraInterface->getImageCalibration(cameraInfo.camCal); cameraInterface->getEnabledStreams(cameraInfo.supportedSources); } void CRLPhysicalCamera::streamCallback(const crl::multisense::image::Header &image) { auto &buf = buffers_[image.source]; // TODO: make this a method of the BufferPair or something std::scoped_lock lock(buf.swap_lock); if (buf.inactiveCBBuf != nullptr) // initial state { cameraInterface->releaseCallbackBuffer(buf.inactiveCBBuf); } imagePointers[image.source] = image; buf.inactiveCBBuf = cameraInterface->reserveCallbackBuffer(); buf.inactive = image; } void CRLPhysicalCamera::imageCallback(const crl::multisense::image::Header &header, void *userDataP) { auto cam = reinterpret_cast<CRLPhysicalCamera *>(userDataP); cam->streamCallback(header); } void CRLPhysicalCamera::addCallbacks() { for (auto e: cameraInfo.supportedDeviceModes) cameraInfo.supportedSources |= e.supportedDataSources; // reserve double_buffers for each stream uint_fast8_t num_sources = 0; crl::multisense::DataSource d = cameraInfo.supportedSources; while (d) { num_sources += (d & 1); d >>= 1; } // --- initializing our callback buffers --- std::size_t bufSize = 1024 * 1024 * 10; // 10mb for every image, like in LibMultiSense for (int i = 0; i < (num_sources * 2 + 1); ++i) // double-buffering for each stream, plus one for handling if those are full { cameraInfo.rawImages.push_back(new uint8_t[bufSize]); } // use these buffers instead of the default cameraInterface->setLargeBuffers(cameraInfo.rawImages, bufSize); // finally, add our callback if (cameraInterface->addIsolatedCallback(imageCallback, cameraInfo.supportedSources, this) != crl::multisense::Status_Ok) { std::cerr << "Adding callback failed!\n"; } }
39.327731
147
0.664245
M-Gjerde
aeb691fe67483e4925723ef8042719561bc3483b
2,301
cpp
C++
src/third_party/wiredtiger/test/cppsuite/test_harness/core/component.cpp
benety/mongo
203430ac9559f82ca01e3cbb3b0e09149fec0835
[ "Apache-2.0" ]
null
null
null
src/third_party/wiredtiger/test/cppsuite/test_harness/core/component.cpp
benety/mongo
203430ac9559f82ca01e3cbb3b0e09149fec0835
[ "Apache-2.0" ]
null
null
null
src/third_party/wiredtiger/test/cppsuite/test_harness/core/component.cpp
benety/mongo
203430ac9559f82ca01e3cbb3b0e09149fec0835
[ "Apache-2.0" ]
null
null
null
/*- * Public Domain 2014-present MongoDB, Inc. * Public Domain 2008-2014 WiredTiger, Inc. * * This is free and unencumbered software released into the public domain. * * Anyone is free to copy, modify, publish, use, compile, sell, or * distribute this software, either in source code form or as a compiled * binary, for any purpose, commercial or non-commercial, and by any * means. * * In jurisdictions that recognize copyright laws, the author or authors * of this software dedicate any and all copyright interest in the * software to the public domain. We make this dedication for the benefit * of the public at large and to the detriment of our heirs and * successors. We intend this dedication to be an overt act of * relinquishment in perpetuity of all present and future rights to this * software under copyright law. * * 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 BE LIABLE FOR ANY CLAIM, DAMAGES OR * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. */ #include "component.h" #include "test_harness/util/api_const.h" namespace test_harness { component::component(const std::string &name, configuration *config) : _config(config), _name(name) { } component::~component() { delete _config; } void component::load() { logger::log_msg(LOG_INFO, "Loading component: " + _name); _enabled = _config->get_optional_bool(ENABLED, true); _throttle = throttle(_config); /* If we're not enabled we shouldn't be running. */ _running = _enabled; } void component::run() { logger::log_msg(LOG_INFO, "Running component: " + _name); while (_enabled && _running) { do_work(); _throttle.sleep(); } } void component::do_work() { /* Not implemented. */ } bool component::enabled() const { return (_enabled); } void component::end_run() { _running = false; } void component::finish() { logger::log_msg(LOG_INFO, "Running finish stage of component: " + _name); } } // namespace test_harness
26.755814
99
0.71621
benety
aeb74f694820238042f898779f0855bcf64e853b
3,871
cpp
C++
akmenu4/arm9/source/ui/uisettings.cpp
lifehackerhansol/akrpg
6ffbe0e73ec205e7e7d2f4e6bbe69cfd0603ae6f
[ "MIT" ]
null
null
null
akmenu4/arm9/source/ui/uisettings.cpp
lifehackerhansol/akrpg
6ffbe0e73ec205e7e7d2f4e6bbe69cfd0603ae6f
[ "MIT" ]
null
null
null
akmenu4/arm9/source/ui/uisettings.cpp
lifehackerhansol/akrpg
6ffbe0e73ec205e7e7d2f4e6bbe69cfd0603ae6f
[ "MIT" ]
null
null
null
/*--------------------------------------------------------------------------------- Copyright (C) 2007 Acekard, www.acekard.com Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ---------------------------------------------------------------------------------*/ #include "ui.h" #include "uisettings.h" #include "inifile.h" cUISettings::cUISettings() { showCalendar = true; formFrameColor = RGB15(23,25,4); formBodyColor = RGB15(30,29,22); formTextColor = RGB15(17,12,0); formTitleTextColor = RGB15(11,11,11); buttonTextColor = RGB15(17,12,0); spinBoxNormalColor = RGB15(0,0,31); spinBoxFocusColor = RGB15(0,31,0); spinBoxTextColor = RGB15(31,31,31); spinBoxTextHighLightColor = RGB15(31,31,31); spinBoxFrameColor = RGB15(11,11,11); listViewBarColor1 = RGB15(0,11,19); listViewBarColor2 = RGB15(0,5,9); listTextColor = 0; listTextHighLightColor = 0; popMenuTextColor = RGB15(0,0,0); popMenuTextHighLightColor = RGB15(31,31,31); popMenuBarColor = RGB15(0,11,19); } cUISettings::~cUISettings() { } void cUISettings::loadSettings() { CIniFile ini( SFN_UI_SETTINGS ); showCalendar = ini.GetInt( "global settings", "showCalendar", showCalendar ); formFrameColor = ini.GetInt( "global settings", "formFrameColor", formFrameColor ); formBodyColor = ini.GetInt( "global settings", "formBodyColor", formBodyColor ); formTextColor = ini.GetInt( "global settings", "formTextColor", formTextColor ); formTitleTextColor = ini.GetInt( "global settings", "formTitleTextColor", formTitleTextColor ); buttonTextColor = ini.GetInt( "global settings", "buttonTextColor", buttonTextColor ); spinBoxNormalColor = ini.GetInt( "global settings", "spinBoxNormalColor", spinBoxNormalColor ); spinBoxFocusColor = ini.GetInt( "global settings", "spinBoxFocusColor", spinBoxFocusColor ); spinBoxTextColor = ini.GetInt( "global settings", "spinBoxTextColor", spinBoxTextColor ); spinBoxTextHighLightColor = ini.GetInt( "global settings", "spinBoxTextHighLightColor", spinBoxTextHighLightColor ); spinBoxFrameColor = ini.GetInt( "global settings", "spinBoxFrameColor", spinBoxFrameColor ); listViewBarColor1 = ini.GetInt( "global settings", "listViewBarColor1", listViewBarColor1 ); listViewBarColor2 = ini.GetInt( "global settings", "listViewBarColor2", listViewBarColor2 ); listTextColor = ini.GetInt( "global settings", "listTextColor", listTextColor ); listTextHighLightColor = ini.GetInt( "global settings", "listTextHighLightColor", listTextHighLightColor ); popMenuTextColor = ini.GetInt( "global settings", "popMenuTextColor", popMenuTextColor ); popMenuTextHighLightColor = ini.GetInt( "global settings", "popMenuTextHighLightColor", popMenuTextHighLightColor ); popMenuBarColor = ini.GetInt( "global settings", "popMenuBarColor", popMenuBarColor ); }
43.011111
120
0.718677
lifehackerhansol
aebb08a2b4518fcfd7b6e94719f4b0c2bad58865
2,306
cpp
C++
src/Telnet/CmdLineRegistry.cpp
vinthewrench/FooServer
1e00a80df41235d29c6402cb8ae4d1f7bbbe07a6
[ "MIT" ]
null
null
null
src/Telnet/CmdLineRegistry.cpp
vinthewrench/FooServer
1e00a80df41235d29c6402cb8ae4d1f7bbbe07a6
[ "MIT" ]
null
null
null
src/Telnet/CmdLineRegistry.cpp
vinthewrench/FooServer
1e00a80df41235d29c6402cb8ae4d1f7bbbe07a6
[ "MIT" ]
null
null
null
// // CmdLineRegistry.cpp // // Created by Vincent Moscaritolo on 4/6/21. // #include <sstream> #include <iostream> #include <iomanip> #include "CmdLineRegistry.hpp" #include "CmdLineHelp.hpp" CmdLineRegistry *CmdLineRegistry::sharedInstance = 0; CmdLineRegistry::CmdLineRegistry(){ _commandMap.clear(); } CmdLineRegistry::~CmdLineRegistry(){ _commandMap.clear(); } void CmdLineRegistry::registerCommand(string_view name, cmdHandler_t cb){ string str = string(name); std::transform(str.begin(), str.end(), str.begin(), ::tolower); _commandMap[str] = cb; } void CmdLineRegistry::removeCommand(const string name){ string str = name; std::transform(str.begin(), str.end(), str.begin(), ::tolower); _commandMap.erase(str); }; vector<string> CmdLineRegistry::matchesForCmd( const string cmd){ vector<string> options = registeredCommands(); vector<string> results; string search = cmd; std::transform(search.begin(), search.end(), search.begin(), ::tolower); for(auto str :options){ if(str.find(search) == 0){ results.push_back(str); } } sort(results.begin(), results.end()); return results; } vector<string> CmdLineRegistry::registeredCommands(){ vector<string> results; results.clear(); for(auto it = _commandMap.begin(); it != _commandMap.end(); ++it) { // ignore built in commands. if(it->first == CMD_WELCOME) continue; results.push_back( string(it->first)); }; return results; } CmdLineRegistry::cmdHandler_t CmdLineRegistry::handlerForCmd( const string cmd){ cmdHandler_t func = NULL; auto it = _commandMap.find(cmd); if(it != _commandMap.end()){ func = it->second; } return func; } // MARK: - help string CmdLineRegistry::helpForCmd( stringvector params){ std::ostringstream oss; if(params.size() == 0){ // do generic help auto str = CmdLineHelp::shared()->helpForCmd(""); oss << " ?\r\n" << str << "\r\n"; } else { string cmd = params.at(0); std::transform(cmd.begin(), cmd.end(), cmd.begin(), ::tolower); if(cmd == "help"){ auto str = CmdLineHelp::shared()->helpForCmd(params.size() >1?params.at(1):""); oss << "\r\n" << str << "\r\n"; } else { auto str = CmdLineHelp::shared()->helpForCmd(cmd); oss << " ?\r\n" << str << "\r\n"; } } return oss.str(); }
20.589286
83
0.654814
vinthewrench
aebecd48c6f11466a99c5486da998a4bdeac832e
1,755
cpp
C++
NYP_Framework_Week08_SOLUTION/Base/Source/SceneGraph/UpdateTransformation.cpp
KianMarvi/Assignment
8133acec4dd65bc49316aec8deb3961035bdef27
[ "MIT" ]
null
null
null
NYP_Framework_Week08_SOLUTION/Base/Source/SceneGraph/UpdateTransformation.cpp
KianMarvi/Assignment
8133acec4dd65bc49316aec8deb3961035bdef27
[ "MIT" ]
8
2019-12-29T17:17:00.000Z
2020-02-07T08:08:01.000Z
NYP_Framework_Week08_SOLUTION/Base/Source/SceneGraph/UpdateTransformation.cpp
KianMarvi/Assignment
8133acec4dd65bc49316aec8deb3961035bdef27
[ "MIT" ]
null
null
null
#include "UpdateTransformation.h" CUpdateTransformation::CUpdateTransformation() : curSteps(0) , deltaSteps(1) , minSteps(0) , maxSteps(0) { Update_Mtx.SetToIdentity(); Update_Mtx_REVERSED.SetToIdentity(); } CUpdateTransformation::~CUpdateTransformation() { } // Reset the transformation matrix to identity matrix void CUpdateTransformation::Reset(void) { Update_Mtx.SetToIdentity(); Update_Mtx_REVERSED.SetToIdentity(); } // Update the steps void CUpdateTransformation::Update(void) { curSteps += deltaSteps; if ((curSteps >= maxSteps) || (curSteps <= minSteps)) { deltaSteps *= -1; } } // Apply a translation to the Update Transformation Matrix void CUpdateTransformation::ApplyUpdate(const float dx, const float dy, const float dz) { Update_Mtx.SetToTranslation(dx, dy, dz); Update_Mtx_REVERSED.SetToTranslation(-dx, -dy, -dz); } // Apply a rotation to the Update Transformation Matrix void CUpdateTransformation::ApplyUpdate(const float angle, const float rx, const float ry, const float rz) { Update_Mtx.SetToRotation(angle, rx, ry, rz); Update_Mtx_REVERSED.SetToRotation(-angle, rx, ry, rz); } // Set the minSteps and maxSteps void CUpdateTransformation::SetSteps(const int minSteps, const int maxSteps) { this->minSteps = minSteps; this->maxSteps = maxSteps; } // Get the minSteps and maxSteps void CUpdateTransformation::GetSteps(int& minSteps, int& maxSteps) { minSteps = this->minSteps; maxSteps = this->maxSteps; } // Get the direction of update bool CUpdateTransformation::GetDirection(void) const { if (deltaSteps == -1) return false; return true; } // Get the Update_Mtx Mtx44 CUpdateTransformation::GetUpdateTransformation(void) { if (deltaSteps == -1) return Update_Mtx_REVERSED; return Update_Mtx; }
23.4
106
0.756695
KianMarvi
aec2cd8d25f33e6972d435b5b4c5d2b0780563a9
43,881
cpp
C++
ycsb-bench/FPTree/fptree.cpp
mkatsa/PENVMTool
c63de91036cd84d36cd8ac54f2033ea141a292dc
[ "Apache-2.0" ]
1
2022-03-22T15:16:56.000Z
2022-03-22T15:16:56.000Z
ycsb-bench/FPTree/fptree.cpp
mkatsa/PENVMTool
c63de91036cd84d36cd8ac54f2033ea141a292dc
[ "Apache-2.0" ]
null
null
null
ycsb-bench/FPTree/fptree.cpp
mkatsa/PENVMTool
c63de91036cd84d36cd8ac54f2033ea141a292dc
[ "Apache-2.0" ]
null
null
null
// Copyright (c) Simon Fraser University. All rights reserved. // Licensed under the MIT license. // // Authors: // George He <georgeh@sfu.ca> // Duo Lu <luduol@sfu.ca> // Tianzheng Wang <tzwang@sfu.ca> #include "fptree.h" #ifdef PMEM inline bool file_pool_exists(const std::string& name) { return ( access( name.c_str(), F_OK ) != -1 ); } #endif BaseNode::BaseNode() { this->isInnerNode = false; } InnerNode::InnerNode() { this->isInnerNode = true; this->nKey = 0; } InnerNode::InnerNode(uint64_t key, BaseNode* left, BaseNode* right) { this->isInnerNode = true; this->keys[0] = key; this->p_children[0] = left; this->p_children[1] = right; this->nKey = 1; } void InnerNode::init(uint64_t key, BaseNode* left, BaseNode* right) { this->isInnerNode = true; this->keys[0] = key; this->p_children[0] = left; this->p_children[1] = right; this->nKey = 1; } InnerNode::InnerNode(const InnerNode& inner) { memcpy(this, &inner, sizeof(struct InnerNode)); } InnerNode::~InnerNode() { for (size_t i = 0; i < this->nKey; i++) { delete this->p_children[i]; } } #ifndef PMEM LeafNode::LeafNode() { this->isInnerNode = false; this->bitmap.clear(); this->p_next = nullptr; this->lock.store(0, std::memory_order_acquire); } LeafNode::LeafNode(const LeafNode& leaf) { memcpy(this, &leaf, sizeof(struct LeafNode)); } LeafNode& LeafNode::operator=(const LeafNode& leaf) { memcpy(this, &leaf, sizeof(struct LeafNode)); return *this; } #endif void InnerNode::removeKey(uint64_t index, bool remove_right_child = true) { assert(this->nKey > index && "Remove key index out of range!"); this->nKey--; std::memmove(this->keys + index, this->keys + index + 1, (this->nKey-index)*sizeof(uint64_t)); if (remove_right_child) index ++; std::memmove(this->p_children + index, this->p_children + index + 1, (this->nKey - index + 1)*sizeof(BaseNode*)); } void InnerNode::addKey(uint64_t index, uint64_t key, BaseNode* child, bool add_child_right = true) { assert(this->nKey >= index && "Insert key index out of range!"); std::memmove(this->keys+index+1, this->keys+index, (this->nKey-index)*sizeof(uint64_t)); // move keys this->keys[index] = key; if (add_child_right) index ++; std::memmove(this->p_children+index+1, this->p_children+index, (this->nKey-index+1)*sizeof(BaseNode*)); this->p_children[index] = child; this->nKey++; } inline uint64_t InnerNode::findChildIndex(uint64_t key) { auto lower = std::lower_bound(this->keys, this->keys + this->nKey, key); uint64_t idx = lower - this->keys; if (idx < this->nKey && *lower == key) idx++; return idx; } inline void LeafNode::addKV(struct KV kv) { uint64_t idx = this->bitmap.first_zero(); assert(idx < MAX_LEAF_SIZE && "Insert kv out of bound!"); this->fingerprints[idx] = getOneByteHash(kv.key); this->kv_pairs[idx] = kv; this->bitmap.set(idx); } inline uint64_t LeafNode::findKVIndex(uint64_t key) { size_t key_hash = getOneByteHash(key); for (uint64_t i = 0; i < MAX_LEAF_SIZE; i++) { if (this->bitmap.test(i) == 1 && this->fingerprints[i] == key_hash && this->kv_pairs[i].key == key) { return i; } } return MAX_LEAF_SIZE; } uint64_t LeafNode::minKey() { uint64_t min_key = -1, i = 0; for (; i < MAX_LEAF_SIZE; i++) { if (this->bitmap.test(i) && this->kv_pairs[i].key < min_key) min_key = this->kv_pairs[i].key; } assert(min_key != -1 && "minKey called for empty leaf!"); return min_key; } void LeafNode::getStat(uint64_t key, LeafNodeStat& lstat) { lstat.count = 0; lstat.min_key = -1; lstat.kv_idx = MAX_LEAF_SIZE; uint64_t cur_key = -1; for (size_t counter = 0; counter < MAX_LEAF_SIZE; counter ++) { if (this->bitmap.test(counter)) // if find a valid entry { lstat.count ++; cur_key = this->kv_pairs[counter].key; if (cur_key == key) // if the entry is key lstat.kv_idx = counter; else if (cur_key < lstat.min_key) lstat.min_key = cur_key; } } } inline LeafNode* FPtree::maxLeaf(BaseNode* node) { while(node->isInnerNode) { node = reinterpret_cast<InnerNode*> (node)->p_children[reinterpret_cast<InnerNode*> (node)->nKey]; } return reinterpret_cast<LeafNode*> (node); } #ifdef PMEM static TOID(struct Log) allocLogArray() { TOID(struct Log) array = POBJ_ROOT(pop, struct Log); POBJ_ALLOC(pop, &array, struct Log, sizeof(struct Log) * sizeLogArray, NULL, NULL); if (TOID_IS_NULL(array)) { fprintf(stderr, "POBJ_ALLOC\n"); return OID_NULL; } for (uint64_t i = 0; i < sizeLogArray; i++) { if (POBJ_ALLOC(pop, &D_RW(array)[i], struct Log, sizeof(struct Log), NULL, NULL)) { fprintf(stderr, "pmemobj_alloc\n"); } } return array.oid; } static TOID(struct Log) root_LogArray; void FPtree::recover() { root_LogArray = POBJ_ROOT(pop, struct Log); for (uint64_t i = 1; i < sizeLogArray / 2; i++) { recoverSplit(&D_RW(root_LogArray)[i]); } for (uint64_t i = sizeLogArray / 2; i < sizeLogArray; i++) { recoverDelete(&D_RW(root_LogArray)[i]); } } #endif FPtree::FPtree() { root = nullptr; #ifdef PMEM const char *path = "/mnt/pmem1/test_pool"; if (file_pool_exists(path) == 0) { if ((pop = pmemobj_create(path, POBJ_LAYOUT_NAME(FPtree), PMEMOBJ_POOL_SIZE, 0666)) == NULL) perror("failed to create pool\n"); root_LogArray = allocLogArray(); } else { if ((pop = pmemobj_open(path, POBJ_LAYOUT_NAME(FPtree))) == NULL) perror("failed to open pool\n"); else { recover(); bulkLoad(1); } } root_LogArray = POBJ_ROOT(pop, struct Log); // Avoid push root object to Queue, i = 1 for (uint64_t i = 1; i < sizeLogArray / 2; i++) // push persistent array to splitLogQueue { D_RW(root_LogArray)[i].PCurrentLeaf = OID_NULL; D_RW(root_LogArray)[i].PLeaf = OID_NULL; splitLogQueue.push(&D_RW(root_LogArray)[i]); } for (uint64_t i = sizeLogArray / 2; i < sizeLogArray; i++) // second half of array use as delete log { D_RW(root_LogArray)[i].PCurrentLeaf = OID_NULL; D_RW(root_LogArray)[i].PLeaf = OID_NULL; deleteLogQueue.push(&D_RW(root_LogArray)[i]); } #else bitmap_idx = MAX_LEAF_SIZE; #endif } FPtree::FPtree(int i) { root = nullptr; #ifdef PMEM char path[50]; snprintf(path, 50, "/mnt/pmem1/test_pool%d", i); path[strlen(path)] = '\0'; if (file_pool_exists(path) == 0) { if ((pop = pmemobj_create(path, POBJ_LAYOUT_NAME(FPtree), PMEMOBJ_POOL_SIZE, 0666)) == NULL) perror("failed to create pool\n"); root_LogArray = allocLogArray(); } else { if ((pop = pmemobj_open(path, POBJ_LAYOUT_NAME(FPtree))) == NULL) perror("failed to open pool\n"); else { recover(); bulkLoad(1); } } root_LogArray = POBJ_ROOT(pop, struct Log); // Avoid push root object to Queue, i = 1 for (uint64_t i = 1; i < sizeLogArray / 2; i++) // push persistent array to splitLogQueue { D_RW(root_LogArray)[i].PCurrentLeaf = OID_NULL; D_RW(root_LogArray)[i].PLeaf = OID_NULL; splitLogQueue.push(&D_RW(root_LogArray)[i]); } for (uint64_t i = sizeLogArray / 2; i < sizeLogArray; i++) // second half of array use as delete log { D_RW(root_LogArray)[i].PCurrentLeaf = OID_NULL; D_RW(root_LogArray)[i].PLeaf = OID_NULL; deleteLogQueue.push(&D_RW(root_LogArray)[i]); } #else bitmap_idx = MAX_LEAF_SIZE; #endif } FPtree::~FPtree() { #ifdef PMEM pmemobj_close(pop); #else if (root != nullptr) delete root; #endif } inline static uint8_t getOneByteHash(uint64_t key) { uint8_t oneByteHashKey = std::_Hash_bytes(&key, sizeof(key), 1) & 0xff; return oneByteHashKey; } #ifdef PMEM static void showList() { TOID(struct List) ListHead = POBJ_ROOT(pop, struct List); TOID(struct LeafNode) leafNode = D_RO(ListHead)->head; while (!TOID_IS_NULL(leafNode)) { for (size_t i = 0; i < MAX_LEAF_SIZE; i++) { if (D_RO(leafNode)->bitmap.test(i)) std::cout << "(" << D_RO(leafNode)->kv_pairs[i].key << " | " << D_RO(leafNode)->kv_pairs[i].value << ")" << ", "; } std::cout << std::endl; leafNode = D_RO(leafNode)->p_next; } } static int constructLeafNode(PMEMobjpool *pop, void *ptr, void *arg) { struct LeafNode *node = (struct LeafNode *)ptr; struct argLeafNode *a = (struct argLeafNode *)arg; node->isInnerNode = a->isInnerNode; node->bitmap = a->bitmap; memcpy(node->fingerprints, a->fingerprints, sizeof(a->fingerprints)); memcpy(node->kv_pairs, a->kv_pairs, sizeof(a->kv_pairs)); node->p_next = TOID_NULL(struct LeafNode); node->lock = a->lock; pmemobj_persist(pop, node, a->size); return 0; } #endif void FPtree::printFPTree(std::string prefix, BaseNode* root) { if (root) { if (root->isInnerNode) { InnerNode* node = reinterpret_cast<InnerNode*> (root); printFPTree(" " + prefix, node->p_children[node->nKey]); for (int64_t i = node->nKey-1; i >= 0; i--) { std::cout << prefix << node->keys[i] << std::endl; printFPTree(" " + prefix, node->p_children[i]); } } else { LeafNode* node = reinterpret_cast<LeafNode*> (root); for (int64_t i = MAX_LEAF_SIZE-1; i >= 0; i--) { if (node->bitmap.test(i) == 1) std::cout << prefix << node->kv_pairs[i].key << "," << node->kv_pairs[i].value << std::endl; } } } } inline LeafNode* FPtree::findLeaf(uint64_t key) { if (!root) return nullptr; if (!root->isInnerNode) return reinterpret_cast<LeafNode*> (root); InnerNode* cursor = reinterpret_cast<InnerNode*> (root); while (cursor->isInnerNode) { cursor = reinterpret_cast<InnerNode*> (cursor->p_children[cursor->findChildIndex(key)]); } return reinterpret_cast<LeafNode*> (cursor); } inline LeafNode* FPtree::findLeafAndPushInnerNodes(uint64_t key) { if (!root) return nullptr; stack_innerNodes.clear(); if (!root->isInnerNode) { stack_innerNodes.push(nullptr); return reinterpret_cast<LeafNode*> (root); } InnerNode* cursor = reinterpret_cast<InnerNode*> (root); while (cursor->isInnerNode) { stack_innerNodes.push(cursor); cursor = reinterpret_cast<InnerNode*> (cursor->p_children[cursor->findChildIndex(key)]); } return reinterpret_cast<LeafNode*> (cursor); } uint64_t FPtree::find(uint64_t key) { LeafNode* pLeafNode; volatile uint64_t idx; tbb::speculative_spin_rw_mutex::scoped_lock lock_find; while (true) { lock_find.acquire(speculative_lock, false); if ((pLeafNode = findLeaf(key)) == nullptr) { lock_find.release(); break; } if (pLeafNode->lock) { lock_find.release(); continue; } idx = pLeafNode->findKVIndex(key); lock_find.release(); return (idx != MAX_LEAF_SIZE ? pLeafNode->kv_pairs[idx].value : 0 ); } return 0; } void FPtree::splitLeafAndUpdateInnerParents(LeafNode* reachedLeafNode, Result decision, struct KV kv, bool updateFunc = false, uint64_t prevPos = MAX_LEAF_SIZE) { uint64_t splitKey; #ifdef PMEM TOID(struct LeafNode) insertNode = pmemobj_oid(reachedLeafNode); #else LeafNode* insertNode = reachedLeafNode; #endif if (decision == Result::Split) { splitKey = splitLeaf(reachedLeafNode); // split and link two leaves if (kv.key >= splitKey) // select one leaf to insert insertNode = reachedLeafNode->p_next; } #ifdef PMEM uint64_t slot = D_RW(insertNode)->bitmap.first_zero(); assert(slot < MAX_LEAF_SIZE && "Slot idx out of bound"); D_RW(insertNode)->kv_pairs[slot] = kv; D_RW(insertNode)->fingerprints[slot] = getOneByteHash(kv.key); pmemobj_persist(pop, &D_RO(insertNode)->kv_pairs[slot], sizeof(struct KV)); pmemobj_persist(pop, &D_RO(insertNode)->fingerprints[slot], SIZE_ONE_BYTE_HASH); if (!updateFunc) { D_RW(insertNode)->bitmap.set(slot); } else { Bitset tmpBitmap = D_RW(insertNode)->bitmap; tmpBitmap.reset(prevPos); tmpBitmap.set(slot); D_RW(insertNode)->bitmap = tmpBitmap; } pmemobj_persist(pop, &D_RO(insertNode)->bitmap, sizeof(D_RO(insertNode)->bitmap)); #else if (updateFunc) insertNode->kv_pairs[prevPos].value = kv.value; else insertNode->addKV(kv); #endif if (decision == Result::Split) { LeafNode* newLeafNode; #ifdef PMEM newLeafNode = (struct LeafNode *) pmemobj_direct((reachedLeafNode->p_next).oid); #else newLeafNode = reachedLeafNode->p_next; #endif tbb::speculative_spin_rw_mutex::scoped_lock lock_split; uint64_t mid = MAX_INNER_SIZE / 2, new_splitKey, insert_pos; InnerNode* cur, *parent, *newInnerNode; BaseNode* child; short i = 0, idx; /*---------------- Second Critical Section -----------------*/ lock_split.acquire(speculative_lock); if (!root->isInnerNode) // splitting when tree has only root { cur = new InnerNode(); cur->init(splitKey, reachedLeafNode, newLeafNode); root = cur; } else // need to retraverse & update parent { cur = reinterpret_cast<InnerNode*> (root); while(cur->isInnerNode) { inners[i] = cur; idx = std::lower_bound(cur->keys, cur->keys + cur->nKey, kv.key) - cur->keys; if (idx < cur->nKey && cur->keys[idx] == kv.key) // TODO: this should always be false idx ++; ppos[i++] = idx; cur = reinterpret_cast<InnerNode*> (cur->p_children[idx]); } parent = inners[--i]; child = newLeafNode; while (true) { insert_pos = ppos[i--]; if (parent->nKey < MAX_INNER_SIZE) { parent->addKey(insert_pos, splitKey, child); break; } else { newInnerNode = new InnerNode(); parent->nKey = mid; if (insert_pos != mid) { new_splitKey = parent->keys[mid]; std::copy(parent->keys + mid + 1, parent->keys + MAX_INNER_SIZE, newInnerNode->keys); std::copy(parent->p_children + mid + 1, parent->p_children + MAX_INNER_SIZE + 1, newInnerNode->p_children); newInnerNode->nKey = MAX_INNER_SIZE - mid - 1; if (insert_pos < mid) parent->addKey(insert_pos, splitKey, child); else newInnerNode->addKey(insert_pos - mid - 1, splitKey, child); } else { new_splitKey = splitKey; std::copy(parent->keys + mid, parent->keys + MAX_INNER_SIZE, newInnerNode->keys); std::copy(parent->p_children + mid, parent->p_children + MAX_INNER_SIZE + 1, newInnerNode->p_children); newInnerNode->p_children[0] = child; newInnerNode->nKey = MAX_INNER_SIZE - mid; } splitKey = new_splitKey; if (parent == root) { cur = new InnerNode(splitKey, parent, newInnerNode); root = cur; break; } parent = inners[i]; child = newInnerNode; } } } newLeafNode->Unlock(); lock_split.release(); /*---------------- End of Second Critical Section -----------------*/ } } void FPtree::updateParents(uint64_t splitKey, InnerNode* parent, BaseNode* child) { uint64_t mid = floor(MAX_INNER_SIZE / 2); uint64_t new_splitKey, insert_pos; while (true) { if (parent->nKey < MAX_INNER_SIZE) { insert_pos = parent->findChildIndex(splitKey); parent->addKey(insert_pos, splitKey, child); return; } else { InnerNode* newInnerNode = new InnerNode(); insert_pos = std::lower_bound(parent->keys, parent->keys + MAX_INNER_SIZE, splitKey) - parent->keys; if (insert_pos < mid) { // insert into parent node new_splitKey = parent->keys[mid]; parent->nKey = mid; std::memmove(newInnerNode->keys, parent->keys + mid + 1, (MAX_INNER_SIZE - mid - 1)*sizeof(uint64_t)); std::memmove(newInnerNode->p_children, parent->p_children + mid + 1, (MAX_INNER_SIZE - mid)*sizeof(BaseNode*)); newInnerNode->nKey = MAX_INNER_SIZE - mid - 1; parent->addKey(insert_pos, splitKey, child); } else if (insert_pos > mid) { // insert into new innernode new_splitKey = parent->keys[mid]; parent->nKey = mid; std::memmove(newInnerNode->keys, parent->keys + mid + 1, (MAX_INNER_SIZE - mid - 1)*sizeof(uint64_t)); std::memmove(newInnerNode->p_children, parent->p_children + mid + 1, (MAX_INNER_SIZE - mid)*sizeof(BaseNode*)); newInnerNode->nKey = MAX_INNER_SIZE - mid - 1; newInnerNode->addKey(insert_pos - mid - 1, splitKey, child); } else { // only insert child to new innernode, splitkey does not change new_splitKey = splitKey; parent->nKey = mid; std::memmove(newInnerNode->keys, parent->keys + mid, (MAX_INNER_SIZE - mid)*sizeof(uint64_t)); std::memmove(newInnerNode->p_children, parent->p_children + mid, (MAX_INNER_SIZE - mid + 1)*sizeof(BaseNode*)); newInnerNode->p_children[0] = child; newInnerNode->nKey = MAX_INNER_SIZE - mid; } splitKey = new_splitKey; if (parent == root) { root = new InnerNode(splitKey, parent, newInnerNode); return; } parent = stack_innerNodes.pop(); child = newInnerNode; } } } bool FPtree::update(struct KV kv) { tbb::speculative_spin_rw_mutex::scoped_lock lock_update; LeafNode* reachedLeafNode; volatile uint64_t prevPos; volatile Result decision = Result::Abort; while (decision == Result::Abort) { // std::this_thread::sleep_for(std::chrono::nanoseconds(1)); lock_update.acquire(speculative_lock, false); if ((reachedLeafNode = findLeaf(kv.key)) == nullptr) { lock_update.release(); return false; } if (!reachedLeafNode->Lock()) { lock_update.release(); continue; } prevPos = reachedLeafNode->findKVIndex(kv.key); if (prevPos == MAX_LEAF_SIZE) // key not found { reachedLeafNode->Unlock(); lock_update.release(); return false; } decision = reachedLeafNode->isFull() ? Result::Split : Result::Update; lock_update.release(); } splitLeafAndUpdateInnerParents(reachedLeafNode, decision, kv, true, prevPos); reachedLeafNode->Unlock(); return true; } bool FPtree::insert(struct KV kv) { tbb::speculative_spin_rw_mutex::scoped_lock lock_insert; if (!root) // if tree is empty { lock_insert.acquire(speculative_lock, true); if (!root) { #ifdef PMEM struct argLeafNode args(kv); TOID(struct List) ListHead = POBJ_ROOT(pop, struct List); TOID(struct LeafNode) *dst = &D_RW(ListHead)->head; POBJ_ALLOC(pop, dst, struct LeafNode, args.size, constructLeafNode, &args); D_RW(ListHead)->head = *dst; pmemobj_persist(pop, &D_RO(ListHead)->head, sizeof(D_RO(ListHead)->head)); root = (struct BaseNode *) pmemobj_direct((*dst).oid); #else root = new LeafNode(); reinterpret_cast<LeafNode*>(root)->lock = 1; reinterpret_cast<LeafNode*> (root)->addKV(kv); reinterpret_cast<LeafNode*>(root)->lock = 0; #endif lock_insert.release(); return true; } lock_insert.release(); } Result decision = Result::Abort; InnerNode* cursor; LeafNode* reachedLeafNode; uint64_t nKey; int idx; /*---------------- First Critical Section -----------------*/ { TBB_BEGIN: lock_insert.acquire(speculative_lock, false); reachedLeafNode = findLeaf(kv.key); if (!reachedLeafNode->Lock()) { lock_insert.release(); goto TBB_BEGIN; } idx = reachedLeafNode->findKVIndex(kv.key); if (idx != MAX_LEAF_SIZE) reachedLeafNode->Unlock(); else decision = reachedLeafNode->isFull() ? Result::Split : Result::Insert; lock_insert.release(); } /*---------------- End of First Critical Section -----------------*/ if (decision == Result::Abort) // kv already exists return false; splitLeafAndUpdateInnerParents(reachedLeafNode, decision, kv); reachedLeafNode->Unlock(); return true; } uint64_t FPtree::splitLeaf(LeafNode* leaf) { uint64_t splitKey = findSplitKey(leaf); #ifdef PMEM TOID(struct LeafNode) *dst = &(leaf->p_next); TOID(struct LeafNode) nextLeafNode = leaf->p_next; // Get uLog from splitLogQueue Log* log; if (!splitLogQueue.pop(log)) { assert("Split log queue pop error!"); } //set uLog.PCurrentLeaf to persistent address of Leaf log->PCurrentLeaf = pmemobj_oid(leaf); pmemobj_persist(pop, &(log->PCurrentLeaf), SIZE_PMEM_POINTER); // Copy the content of Leaf into NewLeaf struct argLeafNode args(leaf); log->PLeaf = *dst; POBJ_ALLOC(pop, dst, struct LeafNode, args.size, constructLeafNode, &args); for (size_t i = 0; i < MAX_LEAF_SIZE; i++) { if (D_RO(*dst)->kv_pairs[i].key < splitKey) D_RW(*dst)->bitmap.reset(i); } // Persist(NewLeaf.Bitmap) pmemobj_persist(pop, &D_RO(*dst)->bitmap, sizeof(D_RO(*dst)->bitmap)); // Leaf.Bitmap = inverse(NewLeaf.Bitmap) leaf->bitmap = D_RO(*dst)->bitmap; if constexpr (MAX_LEAF_SIZE != 1) leaf->bitmap.flip(); // Persist(Leaf.Bitmap) pmemobj_persist(pop, &leaf->bitmap, sizeof(leaf->bitmap)); // Persist(Leaf.Next) D_RW(*dst)->p_next = nextLeafNode; pmemobj_persist(pop, &D_RO(*dst)->p_next, sizeof(D_RO(*dst)->p_next)); // reset uLog log->PCurrentLeaf = OID_NULL; log->PLeaf = OID_NULL; pmemobj_persist(pop, &(log->PCurrentLeaf), SIZE_PMEM_POINTER); pmemobj_persist(pop, &(log->PLeaf), SIZE_PMEM_POINTER); splitLogQueue.push(log); #else LeafNode* newLeafNode = new LeafNode(*leaf); for (size_t i = 0; i < MAX_LEAF_SIZE; i++) { if (newLeafNode->kv_pairs[i].key < splitKey) newLeafNode->bitmap.reset(i); } leaf->bitmap = newLeafNode->bitmap; leaf->bitmap.flip(); leaf->p_next = newLeafNode; #endif return splitKey; } uint64_t FPtree::findSplitKey(LeafNode* leaf) { KV tempArr[MAX_LEAF_SIZE]; memcpy(tempArr, leaf->kv_pairs, sizeof(leaf->kv_pairs)); // TODO: find median in one pass instead of sorting std::sort(std::begin(tempArr), std::end(tempArr), [] (const KV& kv1, const KV& kv2){ return kv1.key < kv2.key; }); uint64_t mid = floor(MAX_LEAF_SIZE / 2); uint64_t splitKey = tempArr[mid].key; return splitKey; } #ifdef PMEM void FPtree::recoverSplit(Log* uLog) { if (TOID_IS_NULL(uLog->PCurrentLeaf)) { return; } if (TOID_IS_NULL(uLog->PLeaf)) { uLog->PCurrentLeaf = OID_NULL; uLog->PLeaf = OID_NULL; return; } else { LeafNode* leaf = (struct LeafNode *) pmemobj_direct((uLog->PCurrentLeaf).oid); uint64_t splitKey = findSplitKey(leaf); if (leaf->isFull()) // Crashed before inverse the current leaf { for (size_t i = 0; i < MAX_LEAF_SIZE; i++) { if (D_RO(uLog->PLeaf)->kv_pairs[i].key < splitKey) D_RW(uLog->PLeaf)->bitmap.reset(i); } // Persist(NewLeaf.Bitmap) pmemobj_persist(pop, &D_RO(uLog->PLeaf)->bitmap, sizeof(D_RO(uLog->PLeaf)->bitmap)); // Leaf.Bitmap = inverse(NewLeaf.Bitmap) D_RW(uLog->PCurrentLeaf)->bitmap = D_RO(uLog->PLeaf)->bitmap; if constexpr (MAX_LEAF_SIZE != 1) D_RW(uLog->PCurrentLeaf)->bitmap.flip(); // Persist(Leaf.Bitmap) pmemobj_persist(pop, &D_RO(uLog->PCurrentLeaf)->bitmap, sizeof(D_RO(uLog->PCurrentLeaf)->bitmap)); // Persist(Leaf.Next) D_RW(uLog->PCurrentLeaf)->p_next = uLog->PLeaf; pmemobj_persist(pop, &D_RO(uLog->PLeaf)->p_next, sizeof(D_RO(uLog->PLeaf)->p_next)); // reset uLog uLog->PCurrentLeaf = OID_NULL; uLog->PLeaf = OID_NULL; return; } else // Crashed after inverse the current leaf { // Leaf.Bitmap = inverse(NewLeaf.Bitmap) if constexpr (MAX_LEAF_SIZE != 1) D_RW(uLog->PCurrentLeaf)->bitmap.flip(); // Persist(Leaf.Bitmap) pmemobj_persist(pop, &D_RO(uLog->PCurrentLeaf)->bitmap, sizeof(D_RO(uLog->PCurrentLeaf)->bitmap)); // Persist(Leaf.Next) D_RW(uLog->PCurrentLeaf)->p_next = uLog->PLeaf; pmemobj_persist(pop, &D_RO(uLog->PLeaf)->p_next, sizeof(D_RO(uLog->PLeaf)->p_next)); // reset uLog uLog->PCurrentLeaf = OID_NULL; uLog->PLeaf = OID_NULL; return; } } } #endif void FPtree::removeLeafAndMergeInnerNodes(short i, short indexNode_level) { InnerNode* temp, *left, *right, *parent = inners[i]; uint64_t left_idx, new_key = 0, child_idx = ppos[i]; if (child_idx == 0) { new_key = parent->keys[0]; parent->removeKey(child_idx, false); if (indexNode_level >= 0 && inners[indexNode_level] != parent) inners[indexNode_level]->keys[ppos[indexNode_level] - 1] = new_key; } else parent->removeKey(child_idx - 1, true); while (!parent->nKey) // parent has no key, merge with sibling { if (parent == root) // entire tree stores 1 kv, convert the only leafnode into root { temp = reinterpret_cast<InnerNode*> (root); root = parent->p_children[0]; delete temp; break; } parent = inners[--i]; child_idx = ppos[i]; left_idx = child_idx; if (!(child_idx != 0 && tryBorrowKey(parent, child_idx, child_idx-1)) && !(child_idx != parent->nKey && tryBorrowKey(parent, child_idx, child_idx+1))) // if cannot borrow from any siblings { if (left_idx != 0) left_idx --; left = reinterpret_cast<InnerNode*> (parent->p_children[left_idx]); right = reinterpret_cast<InnerNode*> (parent->p_children[left_idx + 1]); if (left->nKey == 0) { right->addKey(0, parent->keys[left_idx], left->p_children[0], false); delete left; parent->removeKey(left_idx, false); } else { left->addKey(left->nKey, parent->keys[left_idx], right->p_children[0]); delete right; parent->removeKey(left_idx); } } else break; } } bool FPtree::deleteKey(uint64_t key) { LeafNode* leaf, *sibling; InnerNode *parent, *cur; tbb::speculative_spin_rw_mutex::scoped_lock lock_delete; Result decision = Result::Abort; LeafNodeStat lstat; short i, idx, indexNode_level, sib_level; while (decision == Result::Abort) { i = 0; indexNode_level = -1, sib_level = -1; sibling = nullptr; /*---------------- Critical Section -----------------*/ lock_delete.acquire(speculative_lock, true); if (!root) { lock_delete.release(); return false;} // empty tree cur = reinterpret_cast<InnerNode*> (root); while (cur->isInnerNode) { inners[i] = cur; idx = std::lower_bound(cur->keys, cur->keys + cur->nKey, key) - cur->keys; if (idx < cur->nKey && cur->keys[idx] == key) // just found index node { indexNode_level = i; idx ++; } if (idx != 0) sib_level = i; ppos[i++] = idx; cur = reinterpret_cast<InnerNode*> (cur->p_children[idx]); } parent = inners[--i]; leaf = reinterpret_cast<LeafNode*> (cur); if (!leaf->Lock()) { lock_delete.release(); continue; } leaf->getStat(key, lstat); if (lstat.kv_idx == MAX_LEAF_SIZE) // key not found { decision = Result::NotFound; leaf->Unlock(); } else if (lstat.count > 1) // leaf contains key and other keys { if (indexNode_level >= 0) // key appears in an inner node, need to replace inners[indexNode_level]->keys[ppos[indexNode_level] - 1] = lstat.min_key; decision = Result::Remove; } else // leaf contains key only { if (parent) // try lock left sibling if exist, then remove leaf from parent and update inner nodes { if (sib_level >= 0) // left sibling exists { cur = reinterpret_cast<InnerNode*> (inners[sib_level]->p_children[ppos[sib_level] - 1]); while (cur->isInnerNode) cur = reinterpret_cast<InnerNode*> (cur->p_children[cur->nKey]); sibling = reinterpret_cast<LeafNode*> (cur); if (!sibling->Lock()) { lock_delete.release(); leaf->Unlock(); continue; } } removeLeafAndMergeInnerNodes(i, indexNode_level); } decision = Result::Delete; } lock_delete.release(); /*---------------- Critical Section -----------------*/ } if (decision == Result::Remove) { leaf->bitmap.reset(lstat.kv_idx); #ifdef PMEM TOID(struct LeafNode) lf = pmemobj_oid(leaf); pmemobj_persist(pop, &D_RO(lf)->bitmap, sizeof(D_RO(lf)->bitmap)); #endif leaf->Unlock(); } else if (decision == Result::Delete) { #ifdef PMEM TOID(struct LeafNode) lf = pmemobj_oid(leaf); // Get uLog from deleteLogQueue Log* log; if (!deleteLogQueue.pop(log)) { assert("Delete log queue pop error!"); } //set uLog.PCurrentLeaf to persistent address of Leaf log->PCurrentLeaf = lf; pmemobj_persist(pop, &(log->PCurrentLeaf), SIZE_PMEM_POINTER); if (sibling) // set and persist sibling's p_next, then unlock sibling node { TOID(struct LeafNode) sib = pmemobj_oid(sibling); log->PLeaf = sib; pmemobj_persist(pop, &(log->PLeaf), SIZE_PMEM_POINTER); D_RW(sib)->p_next = D_RO(lf)->p_next; pmemobj_persist(pop, &D_RO(sib)->p_next, sizeof(D_RO(sib)->p_next)); sibling->Unlock(); } else if (parent) // the node to delete is left most node, set and persist list head instead { TOID(struct List) ListHead = POBJ_ROOT(pop, struct List); D_RW(ListHead)->head = D_RO(lf)->p_next; pmemobj_persist(pop, &D_RO(ListHead)->head, sizeof(D_RO(ListHead)->head)); } else { TOID(struct List) ListHead = POBJ_ROOT(pop, struct List); D_RW(ListHead)->head = OID_NULL; pmemobj_persist(pop, &D_RO(ListHead)->head, sizeof(D_RO(ListHead)->head)); root = nullptr; } POBJ_FREE(&lf); // reset uLog log->PCurrentLeaf = OID_NULL; log->PLeaf = OID_NULL; pmemobj_persist(pop, &(log->PCurrentLeaf), SIZE_PMEM_POINTER); pmemobj_persist(pop, &(log->PLeaf), SIZE_PMEM_POINTER); deleteLogQueue.push(log); #else if (sibling) { sibling->p_next = leaf->p_next; sibling->Unlock(); } else if (!parent) root = nullptr; delete leaf; #endif } return decision != Result::NotFound; } #ifdef PMEM void FPtree::recoverDelete(Log* uLog) { TOID(struct List) ListHead = POBJ_ROOT(pop, struct List); TOID(struct LeafNode) PHead = D_RW(ListHead)->head; if( (!TOID_IS_NULL(uLog->PCurrentLeaf)) && (!TOID_IS_NULL(PHead)) ) { D_RW(uLog->PLeaf)->p_next = D_RO(uLog->PCurrentLeaf)->p_next; pmemobj_persist(pop, &D_RO(uLog->PLeaf)->p_next, SIZE_PMEM_POINTER); D_RW(uLog->PLeaf)->Unlock(); POBJ_FREE(&(uLog->PCurrentLeaf)); } else { if ( (!TOID_IS_NULL(uLog->PCurrentLeaf)) && ((struct LeafNode *) pmemobj_direct((uLog->PCurrentLeaf).oid) == (struct LeafNode *) pmemobj_direct(PHead.oid)) ) { PHead = D_RO(uLog->PCurrentLeaf)->p_next; pmemobj_persist(pop, &PHead, SIZE_PMEM_POINTER); POBJ_FREE(&(uLog->PCurrentLeaf)); } else { if ( (!TOID_IS_NULL(uLog->PCurrentLeaf)) && ((struct LeafNode *) pmemobj_direct((D_RO(uLog->PCurrentLeaf)->p_next).oid) == (struct LeafNode *) pmemobj_direct(PHead.oid)) ) POBJ_FREE(&(uLog->PCurrentLeaf)); else { /* reset uLog */ } } } // reset uLog uLog->PCurrentLeaf = OID_NULL; uLog->PLeaf = OID_NULL; return; } #endif bool FPtree::tryBorrowKey(InnerNode* parent, uint64_t receiver_idx, uint64_t sender_idx) { InnerNode* sender = reinterpret_cast<InnerNode*> (parent->p_children[sender_idx]); if (sender->nKey <= 1) // sibling has only 1 key, cannot borrow return false; InnerNode* receiver = reinterpret_cast<InnerNode*> (parent->p_children[receiver_idx]); if (receiver_idx < sender_idx) // borrow from right sibling { receiver->addKey(0, parent->keys[receiver_idx], sender->p_children[0]); parent->keys[receiver_idx] = sender->keys[0]; sender->removeKey(0, false); } else // borrow from left sibling { receiver->addKey(0, receiver->keys[0], sender->p_children[sender->nKey], false); parent->keys[sender_idx] = sender->keys[sender->nKey-1]; sender->removeKey(sender->nKey-1); } return true; } inline uint64_t FPtree::minKey(BaseNode* node) { while (node->isInnerNode) node = reinterpret_cast<InnerNode*> (node)->p_children[0]; return reinterpret_cast<LeafNode*> (node)->minKey(); } LeafNode* FPtree::minLeaf(BaseNode* node) { while(node->isInnerNode) node = reinterpret_cast<InnerNode*> (node)->p_children[0]; return reinterpret_cast<LeafNode*> (node); } void FPtree::sortKV() { uint64_t j = 0; for (uint64_t i = 0; i < MAX_LEAF_SIZE; i++) if (this->current_leaf->bitmap.test(i)) this->volatile_current_kv[j++] = this->current_leaf->kv_pairs[i]; this->size_volatile_kv = j; std::sort(std::begin(this->volatile_current_kv), std::begin(this->volatile_current_kv) + this->size_volatile_kv, [] (const KV& kv1, const KV& kv2){ return kv1.key < kv2.key; }); } void FPtree::scanInitialize(uint64_t key) { if (!root) return; this->current_leaf = root->isInnerNode? findLeaf(key) : reinterpret_cast<LeafNode*> (root); while (this->current_leaf != nullptr) { this->sortKV(); for (uint64_t i = 0; i < this->size_volatile_kv; i++) { if (this->volatile_current_kv[i].key >= key) { this->bitmap_idx = i; return; } } #ifdef PMEM this->current_leaf = (struct LeafNode *) pmemobj_direct((this->current_leaf->p_next).oid); #else this->current_leaf = this->current_leaf->p_next; #endif } } KV FPtree::scanNext() { assert(this->current_leaf != nullptr && "Current scan node was deleted!"); struct KV kv = this->volatile_current_kv[this->bitmap_idx++]; if (this->bitmap_idx == this->size_volatile_kv) { #ifdef PMEM this->current_leaf = (struct LeafNode *) pmemobj_direct((this->current_leaf->p_next).oid); #else this->current_leaf = this->current_leaf->p_next; #endif if (this->current_leaf != nullptr) { this->sortKV(); this->bitmap_idx = 0; } } return kv; } bool FPtree::scanComplete() { return this->current_leaf == nullptr; } uint64_t FPtree::rangeScan(uint64_t key, uint64_t scan_size, char* result) { LeafNode* leaf, * next_leaf; std::vector<KV> records; records.reserve(scan_size); uint64_t i; tbb::speculative_spin_rw_mutex::scoped_lock lock_scan; while (true) { lock_scan.acquire(speculative_lock, false); if ((leaf = findLeaf(key)) == nullptr) { lock_scan.release(); return 0; } if (!leaf->Lock()) { lock_scan.release(); continue; } for (i = 0; i < MAX_LEAF_SIZE; i++) if (leaf->bitmap.test(i) && leaf->kv_pairs[i].key >= key) records.push_back(leaf->kv_pairs[i]); while (records.size() < scan_size) { #ifdef PMEM if (TOID_IS_NULL(leaf->p_next)) break; next_leaf = (struct LeafNode *) pmemobj_direct((leaf->p_next).oid); #else if ((next_leaf = leaf->p_next) == nullptr) break; #endif while (!next_leaf->Lock()) std::this_thread::sleep_for(std::chrono::nanoseconds(1)); leaf->Unlock(); leaf = next_leaf; for (i = 0; i < MAX_LEAF_SIZE; i++) if (leaf->bitmap.test(i)) records.push_back(leaf->kv_pairs[i]); } lock_scan.release(); break; } if (leaf && leaf->lock == 1) leaf->Unlock(); std::sort(records.begin(), records.end(), [] (const KV& kv1, const KV& kv2) { return kv1.key < kv2.key; }); // result = new char[sizeof(KV) * records.size()]; i = records.size() > scan_size? scan_size : records.size(); memcpy(result, records.data(), sizeof(KV) * i); return i; } #ifdef PMEM bool FPtree::bulkLoad(float load_factor = 1) { TOID(struct List) ListHead = POBJ_ROOT(pop, struct List); TOID(struct LeafNode) cursor = D_RW(ListHead)->head; if (TOID_IS_NULL(cursor)) { this->root = nullptr; return true; } if (TOID_IS_NULL(D_RO(cursor)->p_next)) { root = (struct BaseNode *) pmemobj_direct(cursor.oid); return true;} std::vector<uint64_t> min_keys; std::vector<LeafNode*> child_nodes; uint64_t total_leaves = 0; LeafNode* temp_leafnode; while(!TOID_IS_NULL(cursor)) // record min keys and leaf nodes { temp_leafnode = (struct LeafNode *) pmemobj_direct(cursor.oid); child_nodes.push_back(temp_leafnode); min_keys.push_back(temp_leafnode->minKey()); cursor = D_RW(cursor)->p_next; } total_leaves = min_keys.size(); min_keys.erase(min_keys.begin()); InnerNode* new_root = new InnerNode(); uint64_t idx = 0; uint64_t root_size = total_leaves <= MAX_INNER_SIZE ? total_leaves : MAX_INNER_SIZE + 1; for (; idx < root_size; idx++) // recovery the root node { if (idx < root_size - 1) new_root->keys[idx] = min_keys[idx]; new_root->p_children[idx] = child_nodes[idx]; } new_root->nKey = root_size - 1; this->root = reinterpret_cast<BaseNode*> (new_root); if (total_leaves > MAX_INNER_SIZE) { idx--; right_most_innnerNode = reinterpret_cast<InnerNode*>(this->root); for (; idx < min_keys.size(); idx++) // Index entries for leaf pages always entered into right-most index page { findLeafAndPushInnerNodes(min_keys[idx]); right_most_innnerNode = stack_innerNodes.pop(); updateParents(min_keys[idx], right_most_innnerNode, child_nodes[idx+1]); } } return true; } #endif /* Use case uint64_t tick = rdtsc(); Put program between std::cout << rdtsc() - tick << std::endl; */ uint64_t rdtsc(){ unsigned int lo,hi; __asm__ __volatile__ ("rdtsc" : "=a" (lo), "=d" (hi)); return ((uint64_t)hi << 32) | lo; }
33.471396
131
0.548825
mkatsa
aec3745ccfbe2778822a6bac7782b542316635fa
424
cpp
C++
Dataset/Leetcode/train/9/404.cpp
kkcookies99/UAST
fff81885aa07901786141a71e5600a08d7cb4868
[ "MIT" ]
null
null
null
Dataset/Leetcode/train/9/404.cpp
kkcookies99/UAST
fff81885aa07901786141a71e5600a08d7cb4868
[ "MIT" ]
null
null
null
Dataset/Leetcode/train/9/404.cpp
kkcookies99/UAST
fff81885aa07901786141a71e5600a08d7cb4868
[ "MIT" ]
null
null
null
class Solution { public: bool XXX(int x) { if (x < 0)//负数全部排除 { return false; } else if (0 <= x && x < 10)//1位数都是 { return true; } else { string src, dest; while (x)//先将数字转换为字符 { src += x % 10; x /= 10; } dest = src;//记录原字符 reverse(src.begin(),src.end());//将其反转 if (dest == src)//若源字符串和反转串不一致就不是回文串 { return true; } return false; } } };
13.25
40
0.478774
kkcookies99
aec41824da20a509025fbe466e62fd40970fc2aa
3,221
cc
C++
driver/mmio/coherent_allocator.cc
ghollingworth/libedgetpu
d37e668cd9ef0e657b9e4e413df53f370532e87e
[ "Apache-2.0" ]
99
2020-06-09T05:52:44.000Z
2022-03-08T06:06:55.000Z
driver/mmio/coherent_allocator.cc
ghollingworth/libedgetpu
d37e668cd9ef0e657b9e4e413df53f370532e87e
[ "Apache-2.0" ]
35
2020-06-09T15:00:26.000Z
2022-03-15T10:22:32.000Z
driver/mmio/coherent_allocator.cc
ghollingworth/libedgetpu
d37e668cd9ef0e657b9e4e413df53f370532e87e
[ "Apache-2.0" ]
23
2020-06-09T14:50:54.000Z
2022-03-15T11:18:16.000Z
// Copyright 2019 Google LLC // // 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 "driver/mmio/coherent_allocator.h" #include "api/buffer.h" #include "port/aligned_malloc.h" #include "port/errors.h" #include "port/status_macros.h" #include "port/std_mutex_lock.h" #include "port/stringprintf.h" namespace platforms { namespace darwinn { namespace driver { namespace { constexpr const size_t kDefaultMaxCoherentBytes = 0x10000; constexpr const size_t kDefaultAlignmentBytes = 8; } // namespace CoherentAllocator::CoherentAllocator(int alignment_bytes, size_t size_bytes) : alignment_bytes_(alignment_bytes), total_size_bytes_(size_bytes) { CHECK_GT(total_size_bytes_, 0); } CoherentAllocator::CoherentAllocator() : CoherentAllocator(kDefaultAlignmentBytes, kDefaultMaxCoherentBytes) {} Status CoherentAllocator::Open() { StdMutexLock lock(&mutex_); if (coherent_memory_base_ != nullptr) { return FailedPreconditionError("Device already open."); } ASSIGN_OR_RETURN(coherent_memory_base_, DoOpen(total_size_bytes_)); return Status(); // OK } StatusOr<char *> CoherentAllocator::DoOpen(size_t size_bytes) { char *mem_base = static_cast<char *>(aligned_malloc(total_size_bytes_, alignment_bytes_)); if (mem_base == nullptr) { return FailedPreconditionError( StringPrintf("Could not malloc %zu bytes.", total_size_bytes_)); } memset(mem_base, 0, size_bytes); return mem_base; // OK } StatusOr<Buffer> CoherentAllocator::Allocate(size_t size_bytes) { StdMutexLock lock(&mutex_); if (size_bytes == 0) { return FailedPreconditionError("Allocate null size."); } if (coherent_memory_base_ == nullptr) { return FailedPreconditionError("Not Opened."); } if ((allocated_bytes_ + size_bytes) > total_size_bytes_) { return FailedPreconditionError(StringPrintf( "CoherentAllocator: Allocate size = %zu and no memory (total = %zu).", size_bytes, total_size_bytes_)); } char *p = coherent_memory_base_ + allocated_bytes_; // Power of 2 pointer arithmetic: align the block boundary on chip specific // byte alignment size_t mask = alignment_bytes_ - 1; allocated_bytes_ += (size_bytes + mask) & ~mask; return Buffer(p, size_bytes); } Status CoherentAllocator::DoClose(char *mem_base, size_t size_bytes) { if (mem_base != nullptr) { aligned_free(mem_base); } return Status(); // OK } Status CoherentAllocator::Close() { StdMutexLock lock(&mutex_); auto status = DoClose(coherent_memory_base_, total_size_bytes_); // Resets state. allocated_bytes_ = 0; coherent_memory_base_ = nullptr; return status; } } // namespace driver } // namespace darwinn } // namespace platforms
29.281818
79
0.737659
ghollingworth
aec4fa5f013ce3542d2a8234f7c2c087f2eb5e70
15,288
cpp
C++
ess/src/v20201111/model/FlowCreateApprover.cpp
suluner/tencentcloud-sdk-cpp
a56c73cc3f488c4d1e10755704107bb15c5e000d
[ "Apache-2.0" ]
null
null
null
ess/src/v20201111/model/FlowCreateApprover.cpp
suluner/tencentcloud-sdk-cpp
a56c73cc3f488c4d1e10755704107bb15c5e000d
[ "Apache-2.0" ]
null
null
null
ess/src/v20201111/model/FlowCreateApprover.cpp
suluner/tencentcloud-sdk-cpp
a56c73cc3f488c4d1e10755704107bb15c5e000d
[ "Apache-2.0" ]
null
null
null
/* * 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. */ #include <tencentcloud/ess/v20201111/model/FlowCreateApprover.h> using TencentCloud::CoreInternalOutcome; using namespace TencentCloud::Ess::V20201111::Model; using namespace std; FlowCreateApprover::FlowCreateApprover() : m_approverTypeHasBeenSet(false), m_organizationNameHasBeenSet(false), m_requiredHasBeenSet(false), m_approverNameHasBeenSet(false), m_approverMobileHasBeenSet(false), m_approverIdCardNumberHasBeenSet(false), m_approverIdCardTypeHasBeenSet(false), m_recipientIdHasBeenSet(false), m_userIdHasBeenSet(false), m_isFullTextHasBeenSet(false), m_preReadTimeHasBeenSet(false), m_notifyTypeHasBeenSet(false), m_verifyChannelHasBeenSet(false) { } CoreInternalOutcome FlowCreateApprover::Deserialize(const rapidjson::Value &value) { string requestId = ""; if (value.HasMember("ApproverType") && !value["ApproverType"].IsNull()) { if (!value["ApproverType"].IsInt64()) { return CoreInternalOutcome(Core::Error("response `FlowCreateApprover.ApproverType` IsInt64=false incorrectly").SetRequestId(requestId)); } m_approverType = value["ApproverType"].GetInt64(); m_approverTypeHasBeenSet = true; } if (value.HasMember("OrganizationName") && !value["OrganizationName"].IsNull()) { if (!value["OrganizationName"].IsString()) { return CoreInternalOutcome(Core::Error("response `FlowCreateApprover.OrganizationName` IsString=false incorrectly").SetRequestId(requestId)); } m_organizationName = string(value["OrganizationName"].GetString()); m_organizationNameHasBeenSet = true; } if (value.HasMember("Required") && !value["Required"].IsNull()) { if (!value["Required"].IsBool()) { return CoreInternalOutcome(Core::Error("response `FlowCreateApprover.Required` IsBool=false incorrectly").SetRequestId(requestId)); } m_required = value["Required"].GetBool(); m_requiredHasBeenSet = true; } if (value.HasMember("ApproverName") && !value["ApproverName"].IsNull()) { if (!value["ApproverName"].IsString()) { return CoreInternalOutcome(Core::Error("response `FlowCreateApprover.ApproverName` IsString=false incorrectly").SetRequestId(requestId)); } m_approverName = string(value["ApproverName"].GetString()); m_approverNameHasBeenSet = true; } if (value.HasMember("ApproverMobile") && !value["ApproverMobile"].IsNull()) { if (!value["ApproverMobile"].IsString()) { return CoreInternalOutcome(Core::Error("response `FlowCreateApprover.ApproverMobile` IsString=false incorrectly").SetRequestId(requestId)); } m_approverMobile = string(value["ApproverMobile"].GetString()); m_approverMobileHasBeenSet = true; } if (value.HasMember("ApproverIdCardNumber") && !value["ApproverIdCardNumber"].IsNull()) { if (!value["ApproverIdCardNumber"].IsString()) { return CoreInternalOutcome(Core::Error("response `FlowCreateApprover.ApproverIdCardNumber` IsString=false incorrectly").SetRequestId(requestId)); } m_approverIdCardNumber = string(value["ApproverIdCardNumber"].GetString()); m_approverIdCardNumberHasBeenSet = true; } if (value.HasMember("ApproverIdCardType") && !value["ApproverIdCardType"].IsNull()) { if (!value["ApproverIdCardType"].IsString()) { return CoreInternalOutcome(Core::Error("response `FlowCreateApprover.ApproverIdCardType` IsString=false incorrectly").SetRequestId(requestId)); } m_approverIdCardType = string(value["ApproverIdCardType"].GetString()); m_approverIdCardTypeHasBeenSet = true; } if (value.HasMember("RecipientId") && !value["RecipientId"].IsNull()) { if (!value["RecipientId"].IsString()) { return CoreInternalOutcome(Core::Error("response `FlowCreateApprover.RecipientId` IsString=false incorrectly").SetRequestId(requestId)); } m_recipientId = string(value["RecipientId"].GetString()); m_recipientIdHasBeenSet = true; } if (value.HasMember("UserId") && !value["UserId"].IsNull()) { if (!value["UserId"].IsString()) { return CoreInternalOutcome(Core::Error("response `FlowCreateApprover.UserId` IsString=false incorrectly").SetRequestId(requestId)); } m_userId = string(value["UserId"].GetString()); m_userIdHasBeenSet = true; } if (value.HasMember("IsFullText") && !value["IsFullText"].IsNull()) { if (!value["IsFullText"].IsBool()) { return CoreInternalOutcome(Core::Error("response `FlowCreateApprover.IsFullText` IsBool=false incorrectly").SetRequestId(requestId)); } m_isFullText = value["IsFullText"].GetBool(); m_isFullTextHasBeenSet = true; } if (value.HasMember("PreReadTime") && !value["PreReadTime"].IsNull()) { if (!value["PreReadTime"].IsUint64()) { return CoreInternalOutcome(Core::Error("response `FlowCreateApprover.PreReadTime` IsUint64=false incorrectly").SetRequestId(requestId)); } m_preReadTime = value["PreReadTime"].GetUint64(); m_preReadTimeHasBeenSet = true; } if (value.HasMember("NotifyType") && !value["NotifyType"].IsNull()) { if (!value["NotifyType"].IsString()) { return CoreInternalOutcome(Core::Error("response `FlowCreateApprover.NotifyType` IsString=false incorrectly").SetRequestId(requestId)); } m_notifyType = string(value["NotifyType"].GetString()); m_notifyTypeHasBeenSet = true; } if (value.HasMember("VerifyChannel") && !value["VerifyChannel"].IsNull()) { if (!value["VerifyChannel"].IsArray()) return CoreInternalOutcome(Core::Error("response `FlowCreateApprover.VerifyChannel` is not array type")); const rapidjson::Value &tmpValue = value["VerifyChannel"]; for (rapidjson::Value::ConstValueIterator itr = tmpValue.Begin(); itr != tmpValue.End(); ++itr) { m_verifyChannel.push_back((*itr).GetString()); } m_verifyChannelHasBeenSet = true; } return CoreInternalOutcome(true); } void FlowCreateApprover::ToJsonObject(rapidjson::Value &value, rapidjson::Document::AllocatorType& allocator) const { if (m_approverTypeHasBeenSet) { rapidjson::Value iKey(rapidjson::kStringType); string key = "ApproverType"; iKey.SetString(key.c_str(), allocator); value.AddMember(iKey, m_approverType, allocator); } if (m_organizationNameHasBeenSet) { rapidjson::Value iKey(rapidjson::kStringType); string key = "OrganizationName"; iKey.SetString(key.c_str(), allocator); value.AddMember(iKey, rapidjson::Value(m_organizationName.c_str(), allocator).Move(), allocator); } if (m_requiredHasBeenSet) { rapidjson::Value iKey(rapidjson::kStringType); string key = "Required"; iKey.SetString(key.c_str(), allocator); value.AddMember(iKey, m_required, allocator); } if (m_approverNameHasBeenSet) { rapidjson::Value iKey(rapidjson::kStringType); string key = "ApproverName"; iKey.SetString(key.c_str(), allocator); value.AddMember(iKey, rapidjson::Value(m_approverName.c_str(), allocator).Move(), allocator); } if (m_approverMobileHasBeenSet) { rapidjson::Value iKey(rapidjson::kStringType); string key = "ApproverMobile"; iKey.SetString(key.c_str(), allocator); value.AddMember(iKey, rapidjson::Value(m_approverMobile.c_str(), allocator).Move(), allocator); } if (m_approverIdCardNumberHasBeenSet) { rapidjson::Value iKey(rapidjson::kStringType); string key = "ApproverIdCardNumber"; iKey.SetString(key.c_str(), allocator); value.AddMember(iKey, rapidjson::Value(m_approverIdCardNumber.c_str(), allocator).Move(), allocator); } if (m_approverIdCardTypeHasBeenSet) { rapidjson::Value iKey(rapidjson::kStringType); string key = "ApproverIdCardType"; iKey.SetString(key.c_str(), allocator); value.AddMember(iKey, rapidjson::Value(m_approverIdCardType.c_str(), allocator).Move(), allocator); } if (m_recipientIdHasBeenSet) { rapidjson::Value iKey(rapidjson::kStringType); string key = "RecipientId"; iKey.SetString(key.c_str(), allocator); value.AddMember(iKey, rapidjson::Value(m_recipientId.c_str(), allocator).Move(), allocator); } if (m_userIdHasBeenSet) { rapidjson::Value iKey(rapidjson::kStringType); string key = "UserId"; iKey.SetString(key.c_str(), allocator); value.AddMember(iKey, rapidjson::Value(m_userId.c_str(), allocator).Move(), allocator); } if (m_isFullTextHasBeenSet) { rapidjson::Value iKey(rapidjson::kStringType); string key = "IsFullText"; iKey.SetString(key.c_str(), allocator); value.AddMember(iKey, m_isFullText, allocator); } if (m_preReadTimeHasBeenSet) { rapidjson::Value iKey(rapidjson::kStringType); string key = "PreReadTime"; iKey.SetString(key.c_str(), allocator); value.AddMember(iKey, m_preReadTime, allocator); } if (m_notifyTypeHasBeenSet) { rapidjson::Value iKey(rapidjson::kStringType); string key = "NotifyType"; iKey.SetString(key.c_str(), allocator); value.AddMember(iKey, rapidjson::Value(m_notifyType.c_str(), allocator).Move(), allocator); } if (m_verifyChannelHasBeenSet) { rapidjson::Value iKey(rapidjson::kStringType); string key = "VerifyChannel"; iKey.SetString(key.c_str(), allocator); value.AddMember(iKey, rapidjson::Value(rapidjson::kArrayType).Move(), allocator); for (auto itr = m_verifyChannel.begin(); itr != m_verifyChannel.end(); ++itr) { value[key.c_str()].PushBack(rapidjson::Value().SetString((*itr).c_str(), allocator), allocator); } } } int64_t FlowCreateApprover::GetApproverType() const { return m_approverType; } void FlowCreateApprover::SetApproverType(const int64_t& _approverType) { m_approverType = _approverType; m_approverTypeHasBeenSet = true; } bool FlowCreateApprover::ApproverTypeHasBeenSet() const { return m_approverTypeHasBeenSet; } string FlowCreateApprover::GetOrganizationName() const { return m_organizationName; } void FlowCreateApprover::SetOrganizationName(const string& _organizationName) { m_organizationName = _organizationName; m_organizationNameHasBeenSet = true; } bool FlowCreateApprover::OrganizationNameHasBeenSet() const { return m_organizationNameHasBeenSet; } bool FlowCreateApprover::GetRequired() const { return m_required; } void FlowCreateApprover::SetRequired(const bool& _required) { m_required = _required; m_requiredHasBeenSet = true; } bool FlowCreateApprover::RequiredHasBeenSet() const { return m_requiredHasBeenSet; } string FlowCreateApprover::GetApproverName() const { return m_approverName; } void FlowCreateApprover::SetApproverName(const string& _approverName) { m_approverName = _approverName; m_approverNameHasBeenSet = true; } bool FlowCreateApprover::ApproverNameHasBeenSet() const { return m_approverNameHasBeenSet; } string FlowCreateApprover::GetApproverMobile() const { return m_approverMobile; } void FlowCreateApprover::SetApproverMobile(const string& _approverMobile) { m_approverMobile = _approverMobile; m_approverMobileHasBeenSet = true; } bool FlowCreateApprover::ApproverMobileHasBeenSet() const { return m_approverMobileHasBeenSet; } string FlowCreateApprover::GetApproverIdCardNumber() const { return m_approverIdCardNumber; } void FlowCreateApprover::SetApproverIdCardNumber(const string& _approverIdCardNumber) { m_approverIdCardNumber = _approverIdCardNumber; m_approverIdCardNumberHasBeenSet = true; } bool FlowCreateApprover::ApproverIdCardNumberHasBeenSet() const { return m_approverIdCardNumberHasBeenSet; } string FlowCreateApprover::GetApproverIdCardType() const { return m_approverIdCardType; } void FlowCreateApprover::SetApproverIdCardType(const string& _approverIdCardType) { m_approverIdCardType = _approverIdCardType; m_approverIdCardTypeHasBeenSet = true; } bool FlowCreateApprover::ApproverIdCardTypeHasBeenSet() const { return m_approverIdCardTypeHasBeenSet; } string FlowCreateApprover::GetRecipientId() const { return m_recipientId; } void FlowCreateApprover::SetRecipientId(const string& _recipientId) { m_recipientId = _recipientId; m_recipientIdHasBeenSet = true; } bool FlowCreateApprover::RecipientIdHasBeenSet() const { return m_recipientIdHasBeenSet; } string FlowCreateApprover::GetUserId() const { return m_userId; } void FlowCreateApprover::SetUserId(const string& _userId) { m_userId = _userId; m_userIdHasBeenSet = true; } bool FlowCreateApprover::UserIdHasBeenSet() const { return m_userIdHasBeenSet; } bool FlowCreateApprover::GetIsFullText() const { return m_isFullText; } void FlowCreateApprover::SetIsFullText(const bool& _isFullText) { m_isFullText = _isFullText; m_isFullTextHasBeenSet = true; } bool FlowCreateApprover::IsFullTextHasBeenSet() const { return m_isFullTextHasBeenSet; } uint64_t FlowCreateApprover::GetPreReadTime() const { return m_preReadTime; } void FlowCreateApprover::SetPreReadTime(const uint64_t& _preReadTime) { m_preReadTime = _preReadTime; m_preReadTimeHasBeenSet = true; } bool FlowCreateApprover::PreReadTimeHasBeenSet() const { return m_preReadTimeHasBeenSet; } string FlowCreateApprover::GetNotifyType() const { return m_notifyType; } void FlowCreateApprover::SetNotifyType(const string& _notifyType) { m_notifyType = _notifyType; m_notifyTypeHasBeenSet = true; } bool FlowCreateApprover::NotifyTypeHasBeenSet() const { return m_notifyTypeHasBeenSet; } vector<string> FlowCreateApprover::GetVerifyChannel() const { return m_verifyChannel; } void FlowCreateApprover::SetVerifyChannel(const vector<string>& _verifyChannel) { m_verifyChannel = _verifyChannel; m_verifyChannelHasBeenSet = true; } bool FlowCreateApprover::VerifyChannelHasBeenSet() const { return m_verifyChannelHasBeenSet; }
30.273267
157
0.699241
suluner
aec6d145325c12f73507b85aeee31a2a9738846e
1,330
cpp
C++
machine-learning/small-tasks/f-score.cpp
nothingelsematters/university
5561969b1b11678228aaf7e6660e8b1a93d10294
[ "WTFPL" ]
1
2018-06-03T17:48:50.000Z
2018-06-03T17:48:50.000Z
machine-learning/small-tasks/f-score.cpp
nothingelsematters/University
b1e188cb59e5a436731b92c914494626a99e1ae0
[ "WTFPL" ]
null
null
null
machine-learning/small-tasks/f-score.cpp
nothingelsematters/University
b1e188cb59e5a436731b92c914494626a99e1ae0
[ "WTFPL" ]
14
2019-04-07T21:27:09.000Z
2021-12-05T13:37:25.000Z
#include <iostream> #include <iomanip> long double harmonic_mean(long double a, long double b) { return a + b == 0 ? 0 : 2 * a * b / (a + b); } int main() { size_t size; std::cin >> size; unsigned int sum = 0; unsigned int column[size] = {}; unsigned int row[size] = {}; unsigned int trace[size]; for (size_t i = 0; i < size; ++i) { for (size_t j = 0; j < size; ++j) { unsigned int value; std::cin >> value; if (i == j) { trace[i] = value; } sum += value; row[i] += value; column[j] += value; } } long double precision = 0; long double recall = 0; long double score = 0; for (size_t i = 0; i < size; ++i) { long double local_precision = row[i] == 0 ? 0 : (double) trace[i] / row[i]; long double local_recall = column[i] == 0 ? 0 : (double) trace[i] / column[i]; long double weight = row[i]; precision += local_precision * weight; recall += local_recall * weight; score += harmonic_mean(local_precision, local_recall) * weight; } std::cout << std::setprecision(9) << harmonic_mean(precision, recall) / sum << '\n' // macro << score / sum << '\n'; // micro return 0; }
25.09434
86
0.502256
nothingelsematters
aec923f14b582423c7c0faad661e1a3bfc8b1fa1
1,792
tpp
C++
src/hypro/algorithms/reachability/contexts/ContextFactory.tpp
hypro/hypro
52ae4ffe0a8427977fce8d7979fffb82a1bc28f6
[ "MIT" ]
22
2016-10-05T12:19:01.000Z
2022-01-23T09:14:41.000Z
src/hypro/algorithms/reachability/contexts/ContextFactory.tpp
hypro/hypro
52ae4ffe0a8427977fce8d7979fffb82a1bc28f6
[ "MIT" ]
23
2017-05-08T15:02:39.000Z
2021-11-03T16:43:39.000Z
src/hypro/algorithms/reachability/contexts/ContextFactory.tpp
hypro/hypro
52ae4ffe0a8427977fce8d7979fffb82a1bc28f6
[ "MIT" ]
12
2017-06-07T23:51:09.000Z
2022-01-04T13:06:21.000Z
#include "ContextFactory.h" namespace hypro { template <typename State> IContext* ContextFactory<State>::createContext( const std::shared_ptr<Task<State>>& t, const Strategy<State>& strat, WorkQueue<std::shared_ptr<Task<State>>>* localQueue, WorkQueue<std::shared_ptr<Task<State>>>* localCEXQueue, Flowpipe<State>& localSegments, hypro::ReachabilitySettings& settings ) { if(SettingsProvider<State>::getInstance().getStrategy().getParameters(t->btInfo.btLevel).representation_type == representation_name::polytope_t){ DEBUG("hydra.worker", "Using TPoly context!"); return new TemplatePolyhedronContext<State>(t,strat,localQueue,localCEXQueue,localSegments,settings); } if ( SettingsProvider<State>::getInstance().useDecider() ) { auto locType = SettingsProvider<State>::getInstance().getLocationTypeMap().find( t->treeNode->getStateAtLevel( t->btInfo.btLevel ).getLocation() )->second; if ( locType == hypro::LOCATIONTYPE::TIMEDLOC ) { // either use on full timed automa or if context switch is enabled if ( SettingsProvider<State>::getInstance().isFullTimed() || SettingsProvider<State>::getInstance().useContextSwitch() ) { DEBUG( "hydra.worker", "Using full timed context!" ); return new TimedContext<State>( t, strat, localQueue, localCEXQueue, localSegments, settings ); } } else if ( locType == hypro::LOCATIONTYPE::RECTANGULARLOC ) { DEBUG( "hydra.worker", "Using lti context, but actually is rectangular!" ); return new LTIContext<State>( t, strat, localQueue, localCEXQueue, localSegments, settings ); } } DEBUG( "hydra.worker", "Using standard LTI context!" ); return new LTIContext<State>( t, strat, localQueue, localCEXQueue, localSegments, settings ); } } // namespace hypro
54.30303
157
0.719866
hypro
aecd3731ef690d74bce0b394957ff12c0fcff50f
485
cpp
C++
Nova/abyss/vulkan/context.cpp
TWoolhouse/Nova
793d4057d9553a1bf8bcb7205449837b14a72874
[ "MIT" ]
1
2021-12-18T16:28:59.000Z
2021-12-18T16:28:59.000Z
Nova/abyss/vulkan/context.cpp
TWoolhouse/Nova
793d4057d9553a1bf8bcb7205449837b14a72874
[ "MIT" ]
null
null
null
Nova/abyss/vulkan/context.cpp
TWoolhouse/Nova
793d4057d9553a1bf8bcb7205449837b14a72874
[ "MIT" ]
null
null
null
#include "npch.h" #include "context.h" #include "instance.h" #include "surface.h" namespace Nova::abyss { Context::Context(const std::string_view& name) : alloc(nullptr) { nova_bark_init("[Abyss] <Vulkan> ..."); create_instance(*this, name); create_surface(*this); nova_bark_init("[Abyss] Done!"); } Context::~Context() { nova_bark_term("[Abyss] ..."); vkDestroySurfaceKHR(instance, surface, *this); destroy_instance(*this); nova_bark_term("[Abyss] Done!"); } }
22.045455
66
0.676289
TWoolhouse
aece5efffcdb23bbd05e0f4a8f1176eacfa9941d
2,601
cpp
C++
Siv3D/src/Siv3D/NoiseGenerator/SivNoiseGenerator.cpp
yumetodo/OpenSiv3D
ea191438ecbc64185f5df3d9f79dffc6757e4192
[ "MIT" ]
7
2020-04-26T11:06:02.000Z
2021-09-05T16:42:31.000Z
Siv3D/src/Siv3D/NoiseGenerator/SivNoiseGenerator.cpp
yumetodo/OpenSiv3D
ea191438ecbc64185f5df3d9f79dffc6757e4192
[ "MIT" ]
10
2020-04-26T13:25:36.000Z
2022-03-01T12:34:44.000Z
Siv3D/src/Siv3D/NoiseGenerator/SivNoiseGenerator.cpp
yumetodo/OpenSiv3D
ea191438ecbc64185f5df3d9f79dffc6757e4192
[ "MIT" ]
2
2020-05-11T08:23:23.000Z
2020-08-08T12:33:30.000Z
//----------------------------------------------- // // This file is part of the Siv3D Engine. // // Copyright (c) 2008-2019 Ryo Suzuki // Copyright (c) 2016-2019 OpenSiv3D Project // // Licensed under the MIT License. // //----------------------------------------------- # include <Siv3D/NoiseGenerator.hpp> # include "NoiseGeneratorDetail.hpp" namespace s3d { NoiseGenerator::NoiseGenerator() : pImpl(std::make_shared<NoiseGeneratorDetail>()) { } NoiseGenerator::NoiseGenerator(const int32 xSize, const int32 ySize, const int32 zSize) : pImpl(std::make_shared<NoiseGeneratorDetail>(xSize, ySize, zSize)) { } NoiseGenerator::~NoiseGenerator() { } void NoiseGenerator::seed(const int32 seed) { pImpl->seed(seed); } void NoiseGenerator::generate(const NoiseType type, const double frequency, const double xScale, const double yScale, const double zScale, const double xOffset, const double yOffset, const double zOffset) { pImpl->generate(type, frequency, xScale, yScale, zScale, xOffset, yOffset, zOffset); } void NoiseGenerator::setFractalParameters(const int32 octaves, const double lacunarity, const double gain, const FractalType fractalType) { pImpl->setFractalParameters(octaves, lacunarity, gain, fractalType); } void NoiseGenerator::setCellularParameters( const CellularDistanceFunction cellularDistanceFunction, const CellularReturnType cellularReturnType, const NoiseType cellularNoiseLookupType, const double cellularNoiseLookupFrequency, const int32 cellularDistanceIndex0, const int32 cellularDistanceIndex1, const double cellularJitter) { pImpl->setCellularParameters(cellularDistanceFunction, cellularReturnType, cellularNoiseLookupType, cellularNoiseLookupFrequency, cellularDistanceIndex0, cellularDistanceIndex1, cellularJitter); } void NoiseGenerator::setPerturbParameters( const PerturbType perturbType, const double perturbAmp, const double perturbFrequency, const double perturbNormalizeLength) { pImpl->setPerturbParameters(perturbType, perturbAmp, perturbFrequency, perturbNormalizeLength); } void NoiseGenerator::setFractalPerturbParameters( const int32 perturbOctaves, const double perturbLacunarity, const double perturbGain) { pImpl->setFractalPerturbParameters(perturbOctaves, perturbLacunarity, perturbGain); } int32 NoiseGenerator::xSize() const { return pImpl->xSize(); } int32 NoiseGenerator::ySize() const { return pImpl->ySize(); } int32 NoiseGenerator::zSize() const { return pImpl->zSize(); } const float* NoiseGenerator::data() const { return pImpl->data(); } }
27.670213
196
0.749327
yumetodo
aece9d416b2e1cb5c05d72447e7f5be1e13e8916
1,959
cpp
C++
src/inertial/imu_interpolator.cpp
jstraub/tdp
dcab53662be5b88db1538cf831707b07ab96e387
[ "MIT-feh" ]
1
2017-10-17T19:25:47.000Z
2017-10-17T19:25:47.000Z
src/inertial/imu_interpolator.cpp
jstraub/tdp
dcab53662be5b88db1538cf831707b07ab96e387
[ "MIT-feh" ]
1
2018-05-02T06:04:06.000Z
2018-05-02T06:04:06.000Z
src/inertial/imu_interpolator.cpp
jstraub/tdp
dcab53662be5b88db1538cf831707b07ab96e387
[ "MIT-feh" ]
5
2017-09-17T18:46:20.000Z
2019-03-11T12:52:57.000Z
/* Copyright (c) 2016, Julian Straub <jstraub@csail.mit.edu> Licensed * under the MIT license. See the license file LICENSE. */ #include <iomanip> #include <tdp/inertial/imu_interpolator.h> namespace tdp { void ImuInterpolator::Start() { receiveImu_.Set(true); receiverThread_ = std::thread([&]() { tdp::ImuObs imuObs; tdp::ImuObs imuObsPrev; int numCalib = 0; while(receiveImu_.Get()) { if (imu_ && imu_->GrabNext(imuObs)) { if (out_ && record_.Get()) out_->WriteStream(imuObs); if (!calibrated_ && numReceived_.Get() > 10 && imuObs.omega.norm() < 2./180.*M_PI) { gyro_bias_ += imuObs.omega; gravity0_ += imuObs.acc; numCalib ++; std::cout << "rotVel: " << std::setprecision(3) << imuObs.omega.norm()*180./M_PI << "\tacc: " << std::setprecision(3) << imuObs.acc.norm() << std::endl; } else if (!calibrated_ && numReceived_.Get() > 10) { calibrated_ = true; gyro_bias_ /= numCalib; gravity0_ /= numCalib; std::cout << "IMU calibrated. gyro " << gyro_bias_.transpose() << " gravity: " << gravity0_.transpose() << std::endl; } else { imuObs.omega -= gyro_bias_; } Eigen::Matrix<float,6,1> se3 = Eigen::Matrix<float,6,1>::Zero(); se3.topRows(3) = imuObs.omega; if (numReceived_.Get() == 0) { Ts_wi_.Add(imuObs.t_host, tdp::SE3f()); } else { int64_t dt_ns = imuObs.t_device - imuObsPrev.t_device; Ts_wi_.Add(imuObs.t_host, se3, dt_ns); } imuObsPrev = imuObs; numReceived_.Increment(); } std::this_thread::sleep_for(std::chrono::microseconds(100)); } }); } void ImuInterpolator::Stop() { receiveImu_.Set(false); receiverThread_.join(); } }
32.65
75
0.53854
jstraub
aed30bdabeeb57f2d1140cbb35e0babf9f062166
6,273
cxx
C++
xp_comm_proj/rd_dbase/dbfhdr.cxx
avs/express-community
c699a68330d3b678b7e6bcea823e0891b874049c
[ "Apache-2.0" ]
3
2020-08-03T08:52:20.000Z
2021-04-10T11:55:49.000Z
xp_comm_proj/rd_dbase/dbfhdr.cxx
avs/express-community
c699a68330d3b678b7e6bcea823e0891b874049c
[ "Apache-2.0" ]
null
null
null
xp_comm_proj/rd_dbase/dbfhdr.cxx
avs/express-community
c699a68330d3b678b7e6bcea823e0891b874049c
[ "Apache-2.0" ]
1
2021-06-08T18:16:45.000Z
2021-06-08T18:16:45.000Z
// // This file contains the source code for the dBASE file header object. // This object provides utilities to read and manage a dBASE (dbf) // header record. // #include <stdio.h> #ifdef MSDOS #include <basetsd.h> #endif #include "dbfhdr.h" #include "gsbyteu.h" static DBF_ByteUtil_c ByteUtil; // used to swap bytes // // Define constant for the # of bytes in the first part of the // header // const unsigned long HeaderPart1BufferLength = 12; // // Define constants for the start of header record items. // const unsigned long VersionStart = 0; const unsigned long DateStart = 1; const unsigned long NumberOfRowsStart = 4; const unsigned long HeaderLengthStart = 8; const unsigned long RowLengthStart = 10; // // Define constants for the lengths of header record items. // const unsigned long VersionSize = 1; const unsigned long DateSize = 3; const unsigned long NumberOfRowsSize = 4; const unsigned long HeaderLengthSize = 2; const unsigned long RowLengthSize = 2; // // The default constructor. If this is used, then the FileName method // should be used to set the file name and the FileStream method MUST // be used to set the file stream. The file must have already been // opened before this constructor is called. // XP_GIS_DBF_Header_c::XP_GIS_DBF_Header_c() { _FileName = NULL; _FileStream = NULL; } // // The overloaded constructor. This version sets the file name and // file stream. The file must have already been opened before this // constructor is called. // XP_GIS_DBF_Header_c::XP_GIS_DBF_Header_c(const char *DBFFileName, ifstream &DBFFileStream) { _FileName = NULL; _FileStream = NULL; FileName(DBFFileName); FileStream(DBFFileStream); ReadHeader(); } // // The destructor. When destroyed, this object does not close the file. // XP_GIS_DBF_Header_c::~XP_GIS_DBF_Header_c() { } // // The copy constructor. // XP_GIS_DBF_Header_c::XP_GIS_DBF_Header_c(const XP_GIS_DBF_Header_c &object) { *this = object; } // // The assignment operator. // XP_GIS_DBF_Header_c &XP_GIS_DBF_Header_c::operator=( const XP_GIS_DBF_Header_c &object) { strcpy(_FileName,object.FileName()); _FileStream = object._FileStream; _Version = object._Version; _HeaderLength = object._HeaderLength; _RowLength = object._RowLength; _NumberOfRows = object._NumberOfRows; strcpy(_Date,object._Date); return *this; } // // Method to set the dBASE file name. // const char *XP_GIS_DBF_Header_c::FileName(const char *DBFFileName) { _FileName = (char *) DBFFileName; return (_FileName); } // // Method to set the dBASE file stream. // ifstream &XP_GIS_DBF_Header_c::FileStream(ifstream &DBFFileStream) { _FileStream = &DBFFileStream; return *_FileStream; } // // Method to read the dBASE file header. // If succesful, this method returns XP_GIS_OK. Otherwise, it // returns one of the following: // XP_GIS_NOT_OPEN // XP_GIS_SEEK_ERROR // XP_GIS_EOF // XP_GIS_READ_ERROR // XP_GIS_IO_ERROR // XP_GIS_BAD_MAGIC_NUMBER // unsigned long XP_GIS_DBF_Header_c::ReadHeader() { unsigned char HeaderPart1Buffer[HeaderPart1BufferLength]; unsigned short TemporaryShort; #ifdef MSDOS UINT32 TemporaryInt; #else uint32_t TemporaryInt; #endif // // Make sure the file is open. // #ifdef MSDOS if (!_FileStream->is_open()) { return XP_GIS_NOT_OPEN; } #endif // // Seek to the start of the file. // if (!_FileStream->seekg(0,ios::beg)) { return XP_GIS_SEEK_ERROR; } // // Read the header. // if (!_FileStream->read((char*)HeaderPart1Buffer,HeaderPart1BufferLength)) { if (_FileStream->eof()) { return XP_GIS_EOF; } else { return XP_GIS_READ_ERROR; } } if (_FileStream->gcount() != HeaderPart1BufferLength) { return XP_GIS_IO_ERROR; } // // Parse out the magic number // if (HeaderPart1Buffer[VersionStart] != 3) { return XP_GIS_BAD_MAGIC_NUMBER; } _Version = (unsigned long) HeaderPart1Buffer[VersionStart]; // // Parse out the date. // _Date[0] = '1'; _Date[1] = '9'; sprintf(&_Date[2],"%2.2d",(int) HeaderPart1Buffer[DateStart]); _Date[4] = '/'; // separator sprintf(&_Date[5],"%2.2d",(int) HeaderPart1Buffer[DateStart+1]); _Date[7] = '/'; // separator sprintf(&_Date[8],"%2.2d",(int) HeaderPart1Buffer[DateStart+2]); _Date[10] = '\0'; // terminator // // Parse out the number of rows. // if (ByteUtil.ByteOrder() != DBF_ByteUtil_c::LITTLE_ENDIAN) { ByteUtil.SwapBytes4(NumberOfRowsSize, &HeaderPart1Buffer[NumberOfRowsStart]); } memcpy(&TemporaryInt, &HeaderPart1Buffer[NumberOfRowsStart], NumberOfRowsSize); _NumberOfRows = (unsigned long) TemporaryInt; // // Parse out the number of bytes in the header // if (ByteUtil.ByteOrder() != DBF_ByteUtil_c::LITTLE_ENDIAN) { ByteUtil.SwapBytes2(HeaderLengthSize, &HeaderPart1Buffer[HeaderLengthStart]); } memcpy(&TemporaryShort, &HeaderPart1Buffer[HeaderLengthStart], HeaderLengthSize); _HeaderLength = (unsigned long) TemporaryShort; // // Parse out the number of bytes in each row // if (ByteUtil.ByteOrder() != DBF_ByteUtil_c::LITTLE_ENDIAN) { ByteUtil.SwapBytes2(RowLengthSize, &HeaderPart1Buffer[RowLengthStart]); } memcpy(&TemporaryShort, &HeaderPart1Buffer[RowLengthStart], RowLengthSize); _RowLength = (unsigned long) TemporaryShort; return XP_GIS_OK; } // // Method to print the file header. // void XP_GIS_DBF_Header_c::PrintHeader(ostream &PrintStream) const { PrintStream << "DBF file header for " << _FileName << endl; PrintStream << " Version = " << _Version << endl; PrintStream << " Date = " << _Date << endl; PrintStream << " HeaderLength = " << _HeaderLength << endl; PrintStream << " RowLength = " << _RowLength << endl; PrintStream << " NumberOfRows = " << _NumberOfRows << endl; }
23.671698
85
0.65774
avs
aed37aa5bda8e541a9e7765ce99e4f600394c716
1,297
cpp
C++
src/host/common/usb_device.cpp
coolacid/EspTinyUSB
317daf338807e0e2be12e8edec0023cebecdc4ab
[ "MIT" ]
250
2020-07-20T20:09:40.000Z
2022-03-30T04:39:53.000Z
src/host/common/usb_device.cpp
coolacid/EspTinyUSB
317daf338807e0e2be12e8edec0023cebecdc4ab
[ "MIT" ]
77
2020-07-21T13:47:55.000Z
2022-03-30T12:20:28.000Z
src/host/common/usb_device.cpp
coolacid/EspTinyUSB
317daf338807e0e2be12e8edec0023cebecdc4ab
[ "MIT" ]
44
2020-08-14T04:11:24.000Z
2022-03-19T01:20:02.000Z
#include "esp_log.h" #include "usb_device.hpp" USBhostDevice::USBhostDevice() { } USBhostDevice::~USBhostDevice() { } esp_err_t USBhostDevice::allocate(size_t _size) { size_t out_worst_case_size = 50 + _size; ESP_LOGI("", "allocate with new size: %d [%d]", _size, out_worst_case_size); esp_err_t err = 0; for (size_t i = 0; i < 2; i++) { err = usb_host_transfer_alloc(64, 0, &xfer_out[i]); if (ESP_OK == err) { usb_device_handle_t handle = _host->deviceHandle(); xfer_out[i]->device_handle = handle; xfer_out[i]->context = this; } } err = usb_host_transfer_alloc(out_worst_case_size, 0, &xfer_in); xfer_in->device_handle = _host->deviceHandle(); xfer_in->context = this; err = usb_host_transfer_alloc(out_worst_case_size, 0, &xfer_write); xfer_write->device_handle = _host->deviceHandle(); xfer_write->context = this; err = usb_host_transfer_alloc(out_worst_case_size, 0, &xfer_read); xfer_read->device_handle = _host->deviceHandle(); xfer_read->context = this; err = usb_host_transfer_alloc(64, 0, &xfer_ctrl); xfer_ctrl->device_handle = _host->deviceHandle(); xfer_ctrl->context = this; xfer_ctrl->bEndpointAddress = 0; return err; }
24.942308
80
0.655359
coolacid
aed4bcede82e27e822d14f3a4a2514cac7fab7f5
1,816
cpp
C++
src/base/IndexBuffer.cpp
kostrykin/Carna
099783bb7f8a6f52fcc8ccd4666e491cf0aa864c
[ "BSD-3-Clause" ]
null
null
null
src/base/IndexBuffer.cpp
kostrykin/Carna
099783bb7f8a6f52fcc8ccd4666e491cf0aa864c
[ "BSD-3-Clause" ]
null
null
null
src/base/IndexBuffer.cpp
kostrykin/Carna
099783bb7f8a6f52fcc8ccd4666e491cf0aa864c
[ "BSD-3-Clause" ]
3
2015-07-23T12:10:14.000Z
2021-06-08T16:07:05.000Z
/* * Copyright (C) 2010 - 2015 Leonid Kostrykin * * Chair of Medical Engineering (mediTEC) * RWTH Aachen University * Pauwelsstr. 20 * 52074 Aachen * Germany * */ #include <Carna/base/glew.h> #include <Carna/base/IndexBuffer.h> namespace Carna { namespace base { // ---------------------------------------------------------------------------------- // IndexBufferBase // ---------------------------------------------------------------------------------- const unsigned int IndexBufferBase::TYPE_UINT_8 = GL_UNSIGNED_BYTE; const unsigned int IndexBufferBase::TYPE_UINT_16 = GL_UNSIGNED_SHORT; const unsigned int IndexBufferBase::TYPE_UINT_32 = GL_UNSIGNED_INT; const unsigned int IndexBufferBase::PRIMITIVE_TYPE_TRIANGLES = GL_TRIANGLES; const unsigned int IndexBufferBase::PRIMITIVE_TYPE_TRIANGLE_STRIP = GL_TRIANGLE_STRIP; const unsigned int IndexBufferBase::PRIMITIVE_TYPE_TRIANGLE_FAN = GL_TRIANGLE_FAN; const unsigned int IndexBufferBase::PRIMITIVE_TYPE_LINES = GL_LINES; const unsigned int IndexBufferBase::PRIMITIVE_TYPE_LINE_STRIP = GL_LINE_STRIP; const unsigned int IndexBufferBase::PRIMITIVE_TYPE_LINE_LOOP = GL_LINE_LOOP; const unsigned int IndexBufferBase::PRIMITIVE_TYPE_POINTS = GL_POINTS; IndexBufferBase::IndexBufferBase( unsigned int type, unsigned int primitiveType ) : BaseBuffer( GL_ELEMENT_ARRAY_BUFFER ) , type( type ) , primitiveType( primitiveType ) { } void IndexBufferBase::copy( const void* bufferPtr, std::size_t bufferSize, std::size_t elementsCount ) { valid = true; setSize( elementsCount ); glBindBuffer( GL_ELEMENT_ARRAY_BUFFER, id ); glBufferData( GL_ELEMENT_ARRAY_BUFFER, bufferSize, bufferPtr, GL_STATIC_DRAW ); } } // namespace Carna :: base } // namespace Carna
29.290323
102
0.682269
kostrykin
aed5f87bd00067fe657b6c61aee8dda14c13eb09
1,015
cpp
C++
src/console/src/console_gear.cpp
RoyAwesome/raoe
d9350cf50bb2cd1d313df2944fb6a48354142ae8
[ "MIT" ]
null
null
null
src/console/src/console_gear.cpp
RoyAwesome/raoe
d9350cf50bb2cd1d313df2944fb6a48354142ae8
[ "MIT" ]
null
null
null
src/console/src/console_gear.cpp
RoyAwesome/raoe
d9350cf50bb2cd1d313df2944fb6a48354142ae8
[ "MIT" ]
null
null
null
/* Copyright 2022 Roy Awesome's Open Engine (RAOE) 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 "console_gear.hpp" #include "engine.hpp" namespace RAOE::Gears { const std::string ConsoleGearName("Global::Console::ConsoleGear"); ConsoleGear::ConsoleGear(RAOE::Cogs::BaseCog& in_cog) : RAOE::Cogs::Gear(in_cog) , console_ptr(std::make_unique<RAOE::Console::DisplayConsole>(in_cog.engine())) { } } RAOE_DEFINE_GEAR(ConsoleGear, RAOE::Gears::ConsoleGear)
30.757576
87
0.722167
RoyAwesome
aed934728e11f056dfd6c7496b23afa0d402b252
1,130
cpp
C++
src/server/sqlrbindvariabletranslation.cpp
laigor/sqlrelay-non-english-fixes-
7803f862ddbf88bca078c50d621c64c22fc0a405
[ "PHP-3.01", "CC-BY-3.0" ]
16
2018-04-23T09:58:33.000Z
2022-01-31T13:40:20.000Z
src/server/sqlrbindvariabletranslation.cpp
laigor/sqlrelay-non-english-fixes-
7803f862ddbf88bca078c50d621c64c22fc0a405
[ "PHP-3.01", "CC-BY-3.0" ]
null
null
null
src/server/sqlrbindvariabletranslation.cpp
laigor/sqlrelay-non-english-fixes-
7803f862ddbf88bca078c50d621c64c22fc0a405
[ "PHP-3.01", "CC-BY-3.0" ]
4
2020-12-23T12:17:54.000Z
2022-01-04T20:46:34.000Z
// Copyright (c) 1999-2018 David Muse // See the file COPYING for more information #include <sqlrelay/sqlrserver.h> class sqlrbindvariabletranslationprivate { friend class sqlrbindvariabletranslation; private: sqlrbindvariabletranslations *_bvts; domnode *_parameters; }; sqlrbindvariabletranslation::sqlrbindvariabletranslation( sqlrservercontroller *cont, sqlrbindvariabletranslations *bvts, domnode *parameters) { pvt=new sqlrbindvariabletranslationprivate; pvt->_bvts=bvts; pvt->_parameters=parameters; } sqlrbindvariabletranslation::~sqlrbindvariabletranslation() { delete pvt; } bool sqlrbindvariabletranslation::run(sqlrserverconnection *sqlrcon, sqlrservercursor *sqlrcur) { return true; } const char *sqlrbindvariabletranslation::getError() { return NULL; } sqlrbindvariabletranslations *sqlrbindvariabletranslation:: getBindVariableTranslations() { return pvt->_bvts; } domnode *sqlrbindvariabletranslation::getParameters() { return pvt->_parameters; } void sqlrbindvariabletranslation::endTransaction(bool commit) { } void sqlrbindvariabletranslation::endSession() { }
23.061224
68
0.79292
laigor
aee05ae09abe8b68c650c5bfbaabeeeed0e20759
130
hpp
C++
include/git.hpp
fcharlie/git-analyze-sync
1c974ac4b6f695c01ee666aff60d7817f6c0acaf
[ "MIT" ]
1
2021-02-18T06:12:13.000Z
2021-02-18T06:12:13.000Z
include/git.hpp
fcharlie/git-analyze-sync
1c974ac4b6f695c01ee666aff60d7817f6c0acaf
[ "MIT" ]
1
2021-08-28T14:08:30.000Z
2021-08-28T14:09:32.000Z
include/git.hpp
fcharlie/git-analyze-sync
1c974ac4b6f695c01ee666aff60d7817f6c0acaf
[ "MIT" ]
1
2021-08-28T14:00:29.000Z
2021-08-28T14:00:29.000Z
//// GIT BASE HEAD #ifndef AZE_GIT_BASE_HPP #define AZE_GIT_BASE_HPP #include "details/git.hpp" #include "details/git.ipp" #endif
18.571429
26
0.769231
fcharlie
aee119ebe9faf08b7fb22f61ba2d49e1ba1003ba
715
cpp
C++
SPOJ/NSTEPS(Adhoc maths).cpp
abusomani/DS-Algo
b81b592b4ccb6c1c8a1c5275f1411ba4e91977ba
[ "Unlicense" ]
null
null
null
SPOJ/NSTEPS(Adhoc maths).cpp
abusomani/DS-Algo
b81b592b4ccb6c1c8a1c5275f1411ba4e91977ba
[ "Unlicense" ]
null
null
null
SPOJ/NSTEPS(Adhoc maths).cpp
abusomani/DS-Algo
b81b592b4ccb6c1c8a1c5275f1411ba4e91977ba
[ "Unlicense" ]
null
null
null
//Sometimes I feel like giving up, then I remember I have a lot of motherfuckers to prove wrong! //@BEGIN OF SOURCE CODE ( By Abhishek Somani) #include <bits/stdc++.h> using namespace std; #define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0) typedef long long ll; ll MOD = 1000000007; int main() { fastio; //freopen('input.txt','r',stdin); //freopen('output.txt','w',stdout); ll T; cin>>T; while(T--) { ll N,K,x,y; cin>>x>>y; if(x%2 == 0 and ((x == y+2) or (x == y))) cout<<(x+y)<<endl; else if(x%2 == 1 and ((x == y+2) or (x == y))) cout<<(x+y-1)<<endl; else cout<<"No Number"<<endl; } return 0; } // END OF SOURCE CODE
23.833333
96
0.562238
abusomani
aee533fff11c8b2bcded6fe74787c3fd75f94e48
2,733
cpp
C++
src/RenderObject.cpp
NTForked/DiscreteElasticRods
e28dac56149553437da8aea51b377be1b5b57cbf
[ "MIT" ]
51
2017-05-19T06:50:08.000Z
2022-03-27T21:00:13.000Z
src/RenderObject.cpp
NTForked/DiscreteElasticRods
e28dac56149553437da8aea51b377be1b5b57cbf
[ "MIT" ]
4
2017-05-03T00:28:58.000Z
2020-01-30T12:32:16.000Z
src/RenderObject.cpp
NTForked/DiscreteElasticRods
e28dac56149553437da8aea51b377be1b5b57cbf
[ "MIT" ]
11
2015-04-01T09:21:51.000Z
2020-07-30T08:48:45.000Z
#include "RenderObject.h" #include "Utils.h" RenderObject::RenderObject(unsigned id, const Mesh *mesh): m_id(id), m_mesh(mesh) { m_transform.identity(); calcBoundaries(); } RenderObject::RenderObject(const Mesh* mesh, const mg::Matrix4D &transform): m_id(-1), m_mesh(mesh), m_transform(transform) { calcBoundaries(); } RenderObject::RenderObject(unsigned id, const Mesh* mesh, const mg::Matrix4D& transform): m_id(id), m_mesh(mesh), m_transform(transform) { calcBoundaries(); } void RenderObject::setTransform(const mg::Matrix4D &t) { m_transform = t; typedef std::vector<CollisionShape>::iterator Iter; for (Iter it = m_collisionShapes.begin(); it != m_collisionShapes.end(); ++it) { it->updateTransform(m_transform); } m_boundingRadius = mg::transform_vector(m_transform, m_meshBoundingRadius * mg::Ox).length(); m_boundingRadius = std::max(m_boundingRadius, mg::transform_vector(m_transform, m_meshBoundingRadius * mg::Oy).length()); m_boundingRadius = std::max(m_boundingRadius, mg::transform_vector(m_transform, m_meshBoundingRadius * mg::Oz).length()); } void RenderObject::calcBoundaries() { if (!m_mesh || !m_mesh->m_vertices.size()) { m_meshAABB.reshape(mg::Vec3D(0,0,0), mg::Vec3D(0,0,0)); return; } mg::Vec3D vmin = *(m_mesh->m_vertices.begin()); mg::Vec3D vmax = vmin; typedef std::vector<mg::Vec3D>::const_iterator VIter; for (VIter it = m_mesh->m_vertices.begin() + 1; it != m_mesh->m_vertices.end(); ++it) { const mg::Vec3D &vert = (*it); vmin[0] = std::min(vert[0], vmin[0]); vmin[1] = std::min(vert[1], vmin[1]); vmin[2] = std::min(vert[2], vmin[2]); vmax[0] = std::max(vert[0], vmax[0]); vmax[1] = std::max(vert[1], vmax[1]); vmax[2] = std::max(vert[2], vmax[2]); } m_meshAABB.reshape(vmin, vmax); m_meshBoundingRadius = m_meshAABB.getBoundingRadius(); m_boundingRadius = mg::transform_vector(m_transform, m_meshBoundingRadius * mg::Ox).length(); m_boundingRadius = std::max(m_boundingRadius, mg::transform_vector(m_transform, m_meshBoundingRadius * mg::Oy).length()); m_boundingRadius = std::max(m_boundingRadius, mg::transform_vector(m_transform, m_meshBoundingRadius * mg::Oz).length()); } void RenderObject::addCollisionShape(const CollisionShape& shape) { const auto idx = m_collisionShapes.size(); m_collisionShapes.push_back(shape); m_collisionShapes[idx].updateTransform(m_transform); } bool RenderObject::isInsideObject(const mg::Vec3D& p, mg::Vec3D &o_collisionPoint, mg::Vec3D &o_normal) const { typedef std::vector<CollisionShape>::const_iterator Iter; for (Iter it = m_collisionShapes.begin(); it != m_collisionShapes.end(); ++it) { if (it->isInside(p, o_collisionPoint, o_normal)) { return true; } } return false; }
32.152941
122
0.714965
NTForked
aee8e1ff4446833de7a3f606486e0799613fef81
2,840
cpp
C++
src/custom/test/manager.cpp
kxz18/MegEngine
88c1eedbd716805244b35bdda57c3cea5efe734d
[ "Apache-2.0" ]
null
null
null
src/custom/test/manager.cpp
kxz18/MegEngine
88c1eedbd716805244b35bdda57c3cea5efe734d
[ "Apache-2.0" ]
null
null
null
src/custom/test/manager.cpp
kxz18/MegEngine
88c1eedbd716805244b35bdda57c3cea5efe734d
[ "Apache-2.0" ]
null
null
null
/** * \file src/custom/test/manager.cpp * MegEngine is Licensed under the Apache License, Version 2.0 (the "License") * * Copyright (c) 2014-2021 Megvii Inc. All rights reserved. * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT ARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ #include "megbrain_build_config.h" #if MGB_CUSTOM_OP #include "megbrain/custom/manager.h" #include "megbrain/custom/custom.h" #include "gtest/gtest.h" #define MANAGER_TEST_LOG 0 namespace custom { TEST(TestOpManager, TestOpManager) { CustomOpManager *com = CustomOpManager::inst(); com->insert("Op1", CUSTOM_OP_VERSION); com->insert("Op2", CUSTOM_OP_VERSION); std::shared_ptr<CustomOp> ptr = com->find_or_reg("Op3", CUSTOM_OP_VERSION); ASSERT_TRUE(ptr != nullptr); std::vector<std::string> op_names = com->op_name_list(); std::vector<RunTimeId> op_ids = com->op_id_list(); ASSERT_TRUE(op_names.size() == 3); ASSERT_TRUE(op_ids.size() == 3); #if MANAGER_TEST_LOG for (std::string &name: op_names) { std::cout << name << std::endl; } #endif for (std::string &name: op_names) { std::shared_ptr<const CustomOp> op = com->find(name); ASSERT_TRUE(op != nullptr); ASSERT_TRUE(op->op_type() == name); RunTimeId id = com->to_id(name); ASSERT_TRUE(com->find(id) == op); } for (RunTimeId &id: op_ids) { std::shared_ptr<const CustomOp> op = com->find(id); ASSERT_TRUE(op != nullptr); ASSERT_TRUE(op->runtime_id() == id); std::string name = com->to_name(id); ASSERT_TRUE(com->find(name) == op); } ASSERT_FALSE(com->erase("Op0")); #if MANAGER_TEST_LOG for (auto &name: com->op_name_list()) { std::cout << name << std::endl; } #endif ASSERT_TRUE(com->erase("Op1")); ASSERT_TRUE(com->erase(com->to_id("Op2"))); ASSERT_TRUE(com->op_id_list().size() == 1); ASSERT_TRUE(com->op_name_list().size() == 1); ASSERT_TRUE(com->op_name_list()[0] == "Op3"); ptr.reset(); ASSERT_TRUE(com->erase("Op3")); } TEST(TestOpManager, TestOpReg) { CUSTOM_OP_REG(Op1) .add_inputs(2) .add_outputs(3) .add_input("lhs") .add_param("param1", 1) .add_param("param2", 3.45); CUSTOM_OP_REG(Op2) .add_input("lhs") .add_input("rhs") .add_output("out") .add_param("param1", "test") .add_param("param2", true) .add_param("", "no name"); (void)_Op1; (void)_Op2; #if MANAGER_TEST_LOG for (const auto &name: CustomOpManager::inst()->op_name_list()) { std::cout << CustomOpManager::inst()->find(name)->str() << std::endl; } #endif } } #endif
27.572816
89
0.621127
kxz18
aee92e6a1097cae65f1cdf7bd7db8e938d768b2c
10,040
cpp
C++
glscene/source/ResourceRef.cpp
Morozov-5F/glsdk
bff2b5074681bf3d2c438216e612d8a0ed80cead
[ "MIT" ]
2
2020-09-13T20:38:14.000Z
2020-09-13T20:38:23.000Z
glscene/source/ResourceRef.cpp
Morozov-5F/glsdk
bff2b5074681bf3d2c438216e612d8a0ed80cead
[ "MIT" ]
1
2021-01-10T13:39:51.000Z
2021-01-12T10:50:56.000Z
glscene/source/ResourceRef.cpp
Morozov-5F/glsdk
bff2b5074681bf3d2c438216e612d8a0ed80cead
[ "MIT" ]
null
null
null
#include "pch.h" #include <glload/gl_all.hpp> #include "glscene/ResourceRef.h" #include "ResourceData.h" namespace glscene { std::string ResourceMultiplyDefinedException::GetErrorName( const std::string &resourceId, const std::string &resourceType ) { return std::string("The resourceId '") + resourceId + "' is already in use in the '" + resourceType + "' system."; } std::string ResourceNotFoundException::GetErrorName( const std::string &resourceId, const std::string &resourceType ) { return std::string("The resourceId '") + resourceId + "' of type '" + resourceType + "' was not found."; } std::string UniformResourceTypeMismatchException::GetErrorName( const std::string &resourceId, const std::string &uniformType, const std::string &givenType ) { return std::string("Attempting to set the uniform resourceId '") + resourceId + "', which is of type '" + uniformType + "', with a type of " + givenType + "."; } SamplerInfo::SamplerInfo() : magFilter(gl::NEAREST) , minFilter(gl::NEAREST) , maxAniso(1.0f) , compareFunc(boost::none) , edgeFilterS(gl::CLAMP_TO_EDGE) , edgeFilterT(gl::CLAMP_TO_EDGE) , edgeFilterR(gl::CLAMP_TO_EDGE) {} void ResourceRef::DefineUniform( const boost::string_ref &resourceId, const std::string &uniformName, float data ) { m_data.get().DefineUniform(resourceId, uniformName, VectorTypes(data)); } void ResourceRef::DefineUniform( const boost::string_ref &resourceId, const std::string &uniformName, glm::vec2 data ) { m_data.get().DefineUniform(resourceId, uniformName, VectorTypes(data)); } void ResourceRef::DefineUniform( const boost::string_ref &resourceId, const std::string &uniformName, glm::vec3 data ) { m_data.get().DefineUniform(resourceId, uniformName, VectorTypes(data)); } void ResourceRef::DefineUniform( const boost::string_ref &resourceId, const std::string &uniformName, glm::vec4 data ) { m_data.get().DefineUniform(resourceId, uniformName, VectorTypes(data)); } void ResourceRef::DefineUniform( const boost::string_ref &resourceId, const std::string &uniformName, int data ) { m_data.get().DefineUniform(resourceId, uniformName, IntVectorTypes(data)); } void ResourceRef::DefineUniform( const boost::string_ref &resourceId, const std::string &uniformName, glm::ivec2 data ) { m_data.get().DefineUniform(resourceId, uniformName, IntVectorTypes(data)); } void ResourceRef::DefineUniform( const boost::string_ref &resourceId, const std::string &uniformName, glm::ivec3 data ) { m_data.get().DefineUniform(resourceId, uniformName, IntVectorTypes(data)); } void ResourceRef::DefineUniform( const boost::string_ref &resourceId, const std::string &uniformName, glm::ivec4 data ) { m_data.get().DefineUniform(resourceId, uniformName, IntVectorTypes(data)); } void ResourceRef::DefineUniform( const boost::string_ref &resourceId, const std::string &uniformName, unsigned int data ) { m_data.get().DefineUniform(resourceId, uniformName, UIntVectorTypes(data)); } void ResourceRef::DefineUniform( const boost::string_ref &resourceId, const std::string &uniformName, glm::uvec2 data ) { m_data.get().DefineUniform(resourceId, uniformName, UIntVectorTypes(data)); } void ResourceRef::DefineUniform( const boost::string_ref &resourceId, const std::string &uniformName, glm::uvec3 data ) { m_data.get().DefineUniform(resourceId, uniformName, UIntVectorTypes(data)); } void ResourceRef::DefineUniform( const boost::string_ref &resourceId, const std::string &uniformName, glm::uvec4 data ) { m_data.get().DefineUniform(resourceId, uniformName, UIntVectorTypes(data)); } void ResourceRef::DefineUniform( const boost::string_ref &resourceId, const std::string &uniformName, glm::mat2 data ) { m_data.get().DefineUniform(resourceId, uniformName, MatrixTypes(data)); } void ResourceRef::DefineUniform( const boost::string_ref &resourceId, const std::string &uniformName, glm::mat3 data ) { m_data.get().DefineUniform(resourceId, uniformName, MatrixTypes(data)); } void ResourceRef::DefineUniform( const boost::string_ref &resourceId, const std::string &uniformName, glm::mat4 data ) { m_data.get().DefineUniform(resourceId, uniformName, MatrixTypes(data)); } void ResourceRef::SetUniform( const boost::string_ref &resourceId, float data ) { m_data.get().SetUniform(resourceId, VectorTypes(data)); } void ResourceRef::SetUniform( const boost::string_ref &resourceId, glm::vec2 data ) { m_data.get().SetUniform(resourceId, VectorTypes(data)); } void ResourceRef::SetUniform( const boost::string_ref &resourceId, glm::vec3 data ) { m_data.get().SetUniform(resourceId, VectorTypes(data)); } void ResourceRef::SetUniform( const boost::string_ref &resourceId, glm::vec4 data ) { m_data.get().SetUniform(resourceId, VectorTypes(data)); } void ResourceRef::SetUniform( const boost::string_ref &resourceId, int data ) { m_data.get().SetUniform(resourceId, IntVectorTypes(data)); } void ResourceRef::SetUniform( const boost::string_ref &resourceId, glm::ivec2 data ) { m_data.get().SetUniform(resourceId, IntVectorTypes(data)); } void ResourceRef::SetUniform( const boost::string_ref &resourceId, glm::ivec3 data ) { m_data.get().SetUniform(resourceId, IntVectorTypes(data)); } void ResourceRef::SetUniform( const boost::string_ref &resourceId, glm::ivec4 data ) { m_data.get().SetUniform(resourceId, IntVectorTypes(data)); } void ResourceRef::SetUniform( const boost::string_ref &resourceId, unsigned int data ) { m_data.get().SetUniform(resourceId, UIntVectorTypes(data)); } void ResourceRef::SetUniform( const boost::string_ref &resourceId, glm::uvec2 data ) { m_data.get().SetUniform(resourceId, UIntVectorTypes(data)); } void ResourceRef::SetUniform( const boost::string_ref &resourceId, glm::uvec3 data ) { m_data.get().SetUniform(resourceId, UIntVectorTypes(data)); } void ResourceRef::SetUniform( const boost::string_ref &resourceId, glm::uvec4 data ) { m_data.get().SetUniform(resourceId, UIntVectorTypes(data)); } void ResourceRef::SetUniform( const boost::string_ref &resourceId, glm::mat2 data ) { m_data.get().SetUniform(resourceId, MatrixTypes(data)); } void ResourceRef::SetUniform( const boost::string_ref &resourceId, glm::mat3 data ) { m_data.get().SetUniform(resourceId, MatrixTypes(data)); } void ResourceRef::SetUniform( const boost::string_ref &resourceId, glm::mat4 data ) { m_data.get().SetUniform(resourceId, MatrixTypes(data)); } void ResourceRef::DefineTexture( const boost::string_ref &resourceId, GLuint textureObj, GLenum target, bool claimOwnership ) { m_data.get().DefineTexture(resourceId, textureObj, target, claimOwnership); } void ResourceRef::DefineTextureIncomplete( const boost::string_ref &resourceId ) { m_data.get().DefineTextureIncomplete(resourceId); } void ResourceRef::DefineSampler( const boost::string_ref &resourceId, const SamplerInfo &data ) { m_data.get().DefineSampler(resourceId, data); } void ResourceRef::SetSamplerLODBias( const boost::string_ref &resourceId, float bias ) { m_data.get().SetSamplerLODBias(resourceId, bias); } void ResourceRef::DefineMesh( const boost::string_ref &resourceId, glmesh::Mesh *pMesh, bool claimOwnership ) { m_data.get().DefineMesh(resourceId, pMesh, claimOwnership); } void ResourceRef::DefineMesh( const boost::string_ref &resourceId, glscene::Drawable *pMesh, bool claimOwnership /*= true*/ ) { m_data.get().DefineMesh(resourceId, pMesh, claimOwnership); } void ResourceRef::DefineMeshIncomplete( const boost::string_ref &resourceId ) { m_data.get().DefineMeshIncomplete(resourceId); } void ResourceRef::DefineProgram( const boost::string_ref &resourceId, GLuint program, const ProgramInfo &programInfo, bool claimOwnership ) { m_data.get().DefineProgram(resourceId, program, programInfo, claimOwnership); } void ResourceRef::DefineUniformBufferBinding( const boost::string_ref &resourceId, GLuint bufferObject, GLintptr offset, GLsizeiptr size, bool claimOwnership ) { m_data.get().DefineUniformBufferBinding(resourceId, bufferObject, offset, size, claimOwnership); } void ResourceRef::DefineUniformBufferBinding( const boost::string_ref &resourceId, GLuint bufferObject, GLintptr offset, bool claimOwnership ) { m_data.get().DefineUniformBufferBinding(resourceId, bufferObject, offset, claimOwnership); } void ResourceRef::DefineUniformBufferBindingIncomplete( const boost::string_ref &resourceId, GLsizeiptr size ) { m_data.get().DefineUniformBufferBindingIncomplete(resourceId, size); } void ResourceRef::DefineStorageBufferBinding( const boost::string_ref &resourceId, GLuint bufferObject, GLintptr offset, GLsizeiptr size, bool claimOwnership ) { m_data.get().DefineStorageBufferBinding(resourceId, bufferObject, offset, size, claimOwnership); } void ResourceRef::DefineStorageBufferBinding( const boost::string_ref &resourceId, GLuint bufferObject, GLintptr offset, bool claimOwnership ) { m_data.get().DefineStorageBufferBinding(resourceId, bufferObject, offset, claimOwnership); } void ResourceRef::DefineStorageBufferBindingIncomplete( const boost::string_ref &resourceId, GLsizeiptr size ) { m_data.get().DefineStorageBufferBindingIncomplete(resourceId, size); } void ResourceRef::DefineCamera( const boost::string_ref &resourceId, const glutil::ViewData &initialView, const glutil::ViewScale &viewScale, glutil::MouseButtons actionButton, bool bRightKeyboardCtrls ) { m_data.get().DefineCamera(resourceId, initialView, viewScale, actionButton, bRightKeyboardCtrls); } glutil::ViewPole & ResourceRef::GetCamera( const boost::string_ref &resourceId ) { return m_data.get().GetCamera(resourceId); } }
36.245487
127
0.735159
Morozov-5F
aef187e33dbf7062d00aa0bb3907cf9eb6e92098
667
cpp
C++
c++_for_programmers/01_basics/3_enums.cpp
Joy110900/cpp
3d8c582d5b1d3af47d44ae3cef2f6015e272f287
[ "MIT" ]
null
null
null
c++_for_programmers/01_basics/3_enums.cpp
Joy110900/cpp
3d8c582d5b1d3af47d44ae3cef2f6015e272f287
[ "MIT" ]
null
null
null
c++_for_programmers/01_basics/3_enums.cpp
Joy110900/cpp
3d8c582d5b1d3af47d44ae3cef2f6015e272f287
[ "MIT" ]
null
null
null
/*Enum example*/ /* Enum is a user defined datatype which is initialised as below. */ #include <iostream> using namespace std; int main() { //define MONTHS as having 12 possible values enum MONTH {Jan, Feb, Mar, Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec}; // Jan is assigned 0, Feb is assigned 1 and so on. //define bestMonth as a variable type MONTHS MONTH bestMonth; //assign bestMonth one of the values of MONTHS bestMonth = Jan; //now we can check the value of bestMonths just //like any other variable if(bestMonth == Jan) { cout<<"I'm not so sure January is the best month\n"; } return 0; }
23
122
0.646177
Joy110900
aef288d79580780fb962856320b1fb494d05d53f
12,516
cpp
C++
BulletLeague3D/ModulePlayer.cpp
AaronGCProg/RacingBullet3D
d64b852b3b6eb53c1285d4e49746f842645e721a
[ "MIT" ]
null
null
null
BulletLeague3D/ModulePlayer.cpp
AaronGCProg/RacingBullet3D
d64b852b3b6eb53c1285d4e49746f842645e721a
[ "MIT" ]
null
null
null
BulletLeague3D/ModulePlayer.cpp
AaronGCProg/RacingBullet3D
d64b852b3b6eb53c1285d4e49746f842645e721a
[ "MIT" ]
null
null
null
#include "Globals.h" #include "Application.h" #include "ModulePlayer.h" #include "Primitive.h" #include "PhysBody3D.h" #include "ModuleSceneIntro.h" ModulePlayer::ModulePlayer(Application* app, bool start_enabled, int playerNum) : Module(app, start_enabled), vehicle(NULL), playerNum(playerNum) { turn = acceleration = brake = 0.0f; groundRayCast = { 0,0,0 }; goalNum = 0; // INPUTS FOR EACH PLAYER Forward[0] = {SDL_SCANCODE_W }; Forward[1] = { SDL_SCANCODE_UP }; Backward[0] = { SDL_SCANCODE_S}; Backward[1] = { SDL_SCANCODE_DOWN }; Right[0] = { SDL_SCANCODE_D }; Right[1] = { SDL_SCANCODE_RIGHT }; Left[0] = { SDL_SCANCODE_A }; Left[1] = { SDL_SCANCODE_LEFT }; Jump[0] = { SDL_SCANCODE_SPACE }; Jump[1] = { SDL_SCANCODE_KP_0 }; Turbo[0] = { SDL_SCANCODE_LSHIFT }; Turbo[1] = { SDL_SCANCODE_RSHIFT }; Brake[0] = { SDL_SCANCODE_B }; Brake[1] = { SDL_SCANCODE_KP_1 }; SwapCamera[0] = { SDL_SCANCODE_R }; SwapCamera[1] = { SDL_SCANCODE_KP_5 }; switch (playerNum) { case 1: initialPos = { 0, 6, -160 }; break; case 2: initialPos = { 0, 6, 160 }; break; } } ModulePlayer::~ModulePlayer() {} // Load assets bool ModulePlayer::Start() { LOG("Loading player"); // Car properties ---------------------------------------- //All chassis parts car.num_chassis = 5; car.chassis = new Chassis[car.num_chassis]; //front mudward car.chassis[0].chassis_size.Set(2, 0.5, 1); car.chassis[0].chassis_offset.Set(0, 1.f, 2.5f); //back mudward car.chassis[1].chassis_size.Set(2, 0.5, 1); car.chassis[1].chassis_offset.Set(0, 1.f, -2.5f); //spoiler car.chassis[2].chassis_size.Set(0.1f, 0.6f, 0.2f); car.chassis[2].chassis_offset.Set(-0.5, 1.6f, -2.75f); car.chassis[3].chassis_size.Set(0.1f, 0.6f, 0.2f); car.chassis[3].chassis_offset.Set(0.5, 1.6f, -2.75f); car.chassis[4].chassis_size.Set(2.f, 0.2f, 0.4f); car.chassis[4].chassis_offset.Set(0.f, 2.f, -2.75f); car.chassis_size.Set(2, 1, 4); car.chassis_offset.Set(0, 1, 0); car.mass = 540.0f; car.suspensionStiffness = 15.88f; car.suspensionCompression = 0.83f; car.suspensionDamping = 1.0f; car.maxSuspensionTravelCm = 1000.0f; car.frictionSlip = 50.5; car.maxSuspensionForce = 6000.0f; // Wheel properties --------------------------------------- float connection_height = 1.2f; float wheel_radius = 0.6f; float wheel_width = 0.5f; float suspensionRestLength = 0.8f; // Don't change anything below this line ------------------ float half_width = car.chassis_size.x * 0.5f; float half_length = car.chassis_size.z * 0.5f; vec3 direction(0, -1, 0); vec3 axis(-1, 0, 0); car.num_wheels = 4; car.wheels = new Wheel[car.num_wheels]; // FRONT-LEFT ------------------------ car.wheels[0].connection.Set(half_width - 0.3f * wheel_width, connection_height, half_length - wheel_radius); car.wheels[0].direction = direction; car.wheels[0].axis = axis; car.wheels[0].suspensionRestLength = suspensionRestLength; car.wheels[0].radius = wheel_radius; car.wheels[0].width = wheel_width; car.wheels[0].front = true; car.wheels[0].drive = true; car.wheels[0].brake = false; car.wheels[0].steering = true; // FRONT-RIGHT ------------------------ car.wheels[1].connection.Set(-half_width + 0.4f * wheel_width, connection_height, half_length - wheel_radius); car.wheels[1].direction = direction; car.wheels[1].axis = axis; car.wheels[1].suspensionRestLength = suspensionRestLength; car.wheels[1].radius = wheel_radius; car.wheels[1].width = wheel_width; car.wheels[1].front = true; car.wheels[1].drive = true; car.wheels[1].brake = false; car.wheels[1].steering = true; // REAR-LEFT ------------------------ car.wheels[2].connection.Set(half_width - 0.3f * wheel_width, connection_height, -half_length + wheel_radius); car.wheels[2].direction = direction; car.wheels[2].axis = axis; car.wheels[2].suspensionRestLength = suspensionRestLength; car.wheels[2].radius = wheel_radius; car.wheels[2].width = wheel_width; car.wheels[2].front = false; car.wheels[2].drive = false; car.wheels[2].brake = true; car.wheels[2].steering = false; // REAR-RIGHT ------------------------ car.wheels[3].connection.Set(-half_width + 0.3f * wheel_width, connection_height, -half_length + wheel_radius); car.wheels[3].direction = direction; car.wheels[3].axis = axis; car.wheels[3].suspensionRestLength = suspensionRestLength; car.wheels[3].radius = wheel_radius; car.wheels[3].width = wheel_width; car.wheels[3].front = false; car.wheels[3].drive = false; car.wheels[3].brake = true; car.wheels[3].steering = false; jumpImpulse = false; canDrift = false; secondJump = false; turbo = INITIAL_TURBO; vehicle = App->physics->AddVehicle(car); vehicle->collision_listeners.add(this); vehicle->cntType = CNT_VEHICLE; vehicle->SetPos(initialPos.x, initialPos.y, initialPos.z); if (playerNum == 2) { mat4x4 trans; vehicle->GetTransform(&trans); trans.rotate(180, {0, -1, 0}); vehicle->SetTransform(&trans); } return true; } // Unload assets bool ModulePlayer::CleanUp() { LOG("Unloading player"); return true; } update_status ModulePlayer::PreUpdate(float dt) { if(App->scene_intro->state != MT_STOP && App->scene_intro->state != MT_RESTARTING) PlayerInputs(); return UPDATE_CONTINUE; } // Update: draw background update_status ModulePlayer::Update(float dt) { groundRayCast = App->physics->RayCast({ this->vehicle->GetPos().x,this->vehicle->GetPos().y+1, this->vehicle->GetPos().z }, vehicle->GetDown()); if (length(groundRayCast) < 2.f ) { fieldContact = true; secondJump = false; jumpImpulse = false; vehicle->Push(0.0f, -STICK_FORCE/4, 0.0f); } else fieldContact = false; return UPDATE_CONTINUE; } update_status ModulePlayer::PostUpdate(float dt) { return UPDATE_CONTINUE; } bool ModulePlayer::Draw() { vehicle->Render(playerNum); return true; } // World to Local forces translation btVector3 ModulePlayer::WorldToLocal(float x, float y, float z) { btVector3 relativeForce = btVector3(x, y, z); btMatrix3x3& localRot = vehicle->myBody->getWorldTransform().getBasis(); btVector3 correctedForce = localRot * relativeForce; return correctedForce; } void ModulePlayer::OnCollision(PhysBody3D* body1, PhysBody3D* body2) { if (body1->cntType == CNT_VEHICLE && body2->cntType == CNT_LITTLE_BOOST) { if (body2->sensorOnline) { turbo += 12.0f; App->audio->PlayFx(App->scene_intro->boostUpFx); } } if (body1->cntType == CNT_VEHICLE && body2->cntType == CNT_BIG_BOOST) { if (body2->sensorOnline) { turbo += 100.0f; App->audio->PlayFx(App->scene_intro->boostUpFx); } } if (turbo > 100.0f) turbo = 100.0f; } bool ModulePlayer::Reset() { mat4x4 mat; btTransform identity; identity.setIdentity(); identity.getOpenGLMatrix(&mat); switch (playerNum) { case 1: break; case 2: mat.rotate(180, { 0, -1, 0 }); break; } vehicle->SetTransform(&mat); vehicle->ResetSpeed(); vehicle->SetPos(initialPos.x, initialPos.y, initialPos.z); this->turbo = 33.f; return true; } void ModulePlayer::PlayerInputs() { turn = acceleration = brake = 0.0f; if (App->input->GetKey(Forward[playerNum - 1]) == KEY_REPEAT && fieldContact && vehicle->GetKmh() < 180) { if(vehicle->GetKmh() <= 0) acceleration = MAX_ACCELERATION * 5; else acceleration = MAX_ACCELERATION; vehicle->Push(0.0f, -STICK_FORCE, 0.0f); } else if (App->input->GetKey(Forward[playerNum - 1]) == KEY_REPEAT && !fieldContact) { if (vehicle->myBody->getAngularVelocity().length() < CAP_ACROBATIC_SPEED) { if (vehicle->myBody->getAngularVelocity().length() < SMOOTH_ACROBATIC_SPEED) vehicle->myBody->applyTorque(WorldToLocal(5000.0f, 0.0f, 0.0f)); else vehicle->myBody->applyTorque(WorldToLocal(500.0f, 0.0f, 0.0f)); } } if (App->input->GetKey(Left[playerNum - 1]) == KEY_REPEAT && fieldContact) { if (turn < TURN_DEGREES && !canDrift) turn += TURN_DEGREES; else if (turn > -TURN_DEGREES && canDrift) { turn += TURN_DEGREES; vehicle->myBody->applyTorque(WorldToLocal(0.0f, 20000.0f, 0.0f)); } vehicle->Push(0.0f, -STICK_FORCE, 0.0f); } else if (App->input->GetKey(Left[playerNum - 1]) == KEY_REPEAT && !fieldContact) { if (vehicle->myBody->getAngularVelocity().length() < CAP_ACROBATIC_SPEED) { if (secondJump) { if (vehicle->myBody->getAngularVelocity().length() < SMOOTH_ACROBATIC_SPEED) vehicle->myBody->applyTorque(WorldToLocal(0.0f, 0.0f, -5000.0f)); else vehicle->myBody->applyTorque(WorldToLocal(0.0f, 0.0f, -500.0f)); } else { if (vehicle->myBody->getAngularVelocity().length() < SMOOTH_ACROBATIC_SPEED) vehicle->myBody->applyTorque(WorldToLocal(0.0f, 5000.0f, 0.0f)); else vehicle->myBody->applyTorque(WorldToLocal(0.0f, 500.0f, 0.0f)); } } } if (App->input->GetKey(Right[playerNum - 1]) == KEY_REPEAT && fieldContact) { if (turn > -TURN_DEGREES && !canDrift) turn -= TURN_DEGREES; else if (turn > -TURN_DEGREES && canDrift) { turn -= TURN_DEGREES; vehicle->myBody->applyTorque(WorldToLocal(0.0f, -20000.0f, 0.0f)); } vehicle->Push(0.0f, -STICK_FORCE, 0.0f); } else if (App->input->GetKey(Right[playerNum - 1]) == KEY_REPEAT && !fieldContact) { if (vehicle->myBody->getAngularVelocity().length() < CAP_ACROBATIC_SPEED) { if (secondJump) { if (vehicle->myBody->getAngularVelocity().length() < SMOOTH_ACROBATIC_SPEED) vehicle->myBody->applyTorque(WorldToLocal(0.0f, 0.0f, 5000.0f)); else vehicle->myBody->applyTorque(WorldToLocal(0.0f, 0.0f, 500.0f)); } else { if (vehicle->myBody->getAngularVelocity().length() < SMOOTH_ACROBATIC_SPEED) vehicle->myBody->applyTorque(WorldToLocal(0.0f, -5000.0f, 0.0f)); else vehicle->myBody->applyTorque(WorldToLocal(0.0f, -500.0f, 0.0f)); } } } if (App->input->GetKey(Backward[playerNum - 1]) == KEY_REPEAT && fieldContact && vehicle->GetKmh() > -120) { if (vehicle->GetKmh() >= 0) acceleration = -MAX_ACCELERATION * 5; else acceleration = -MAX_ACCELERATION; vehicle->Push(0.0f, -STICK_FORCE, 0.0f); } else if (App->input->GetKey(Backward[playerNum - 1]) == KEY_REPEAT && !fieldContact) { if (vehicle->myBody->getAngularVelocity().length() < CAP_ACROBATIC_SPEED) { if (vehicle->myBody->getAngularVelocity().length() < SMOOTH_ACROBATIC_SPEED) vehicle->myBody->applyTorque(WorldToLocal(-5000.0f, 0.0f, 0.0f)); else vehicle->myBody->applyTorque(WorldToLocal(-500.0f, 0.0f, 0.0f)); } } if (App->input->GetKey(Jump[playerNum - 1]) == KEY_DOWN && fieldContact) { vehicle->myBody->setAngularVelocity({ 0,0,0 }); vehicle->Push(0.0f, JUMP_FORCE, 0.0f); fieldContact = false; } else if (App->input->GetKey(Jump[playerNum - 1]) == KEY_DOWN && !fieldContact && !secondJump) { secondJump = true; vehicle->Push(0.0f, IMPULSE_FORCE, 0.0f); if (App->input->GetKey(Forward[playerNum - 1]) == KEY_REPEAT) { jumpImpulse = true; vehicle->myBody->applyCentralForce(WorldToLocal(0.0f, 0.0f, 300000.0f)); vehicle->myBody->applyTorque(WorldToLocal(115000.0f, 0.0f, 0.0f)); } else if (App->input->GetKey(Backward[playerNum - 1]) == KEY_REPEAT) { jumpImpulse = true; vehicle->myBody->applyCentralForce(WorldToLocal(0.0f, 0.0f, -300000.0f)); vehicle->myBody->applyTorque(WorldToLocal(-115000.0f, 0.0f, 0.0f)); } else if (App->input->GetKey(Right[playerNum - 1]) == KEY_REPEAT) { jumpImpulse = true; vehicle->myBody->applyCentralForce(WorldToLocal(-400000.0f, 0.0f, 0.0f)); vehicle->myBody->applyTorque(WorldToLocal(0.0f, 0.0f, 45000.0f)); } else if (App->input->GetKey(Left[playerNum - 1]) == KEY_REPEAT) { jumpImpulse = true; vehicle->myBody->applyCentralForce(WorldToLocal(400000.0f, 0.0f, 0.0f)); vehicle->myBody->applyTorque(WorldToLocal(0.0f, 0.0f, -45000.0f)); } } if (App->input->GetKey(Brake[playerNum - 1]) == KEY_REPEAT) { brake = BRAKE_POWER; canDrift = true; } else if (App->input->GetKey(Brake[playerNum - 1]) == KEY_UP) canDrift = false; if (App->input->GetKey(Turbo[playerNum - 1]) == KEY_REPEAT && turbo > 0) { vehicle->myBody->applyCentralImpulse(WorldToLocal(0.0f, 0.0f, 125.0f)); turbo -= 0.5f; } if (App->input->GetKey(SwapCamera[playerNum - 1]) == KEY_DOWN) { if (playerNum == 1) App->camera->lookAtBall = !App->camera->lookAtBall; else App->camera_2->lookAtBall = !App->camera_2->lookAtBall; } vehicle->ApplyEngineForce(acceleration); vehicle->Turn(turn); vehicle->Brake(brake); }
25.336032
145
0.669942
AaronGCProg
aef6455a1994b330528cb71b4c48989a81e4d09c
478
cpp
C++
UVa/Competitive_Programming_Exercises/03-Problem_Solving_Paradigms/02-Divide_and_Conquer/01-Binary_Search/00679.cpp
TISparta/competitive-programming-solutions
31987d4e67bb874bf15653565c6418b5605a20a8
[ "MIT" ]
1
2018-01-30T13:21:30.000Z
2018-01-30T13:21:30.000Z
UVa/Competitive_Programming_Exercises/03-Problem_Solving_Paradigms/02-Divide_and_Conquer/01-Binary_Search/00679.cpp
TISparta/competitive-programming-solutions
31987d4e67bb874bf15653565c6418b5605a20a8
[ "MIT" ]
null
null
null
UVa/Competitive_Programming_Exercises/03-Problem_Solving_Paradigms/02-Divide_and_Conquer/01-Binary_Search/00679.cpp
TISparta/competitive-programming-solutions
31987d4e67bb874bf15653565c6418b5605a20a8
[ "MIT" ]
1
2018-08-29T13:26:50.000Z
2018-08-29T13:26:50.000Z
#include <bits/stdc++.h> using namespace std; int tc, x, y, lim; vector <int> a[20], b[20]; int main(){ a[0].push_back(1); for(int i = 1; i < 20; i++){ lim = 1 << i - 1; for(int j = 0; j < lim; j++) a[i].push_back(a[i - 1][j] << 1); for(int j = 0; j < lim; j++) a[i].push_back((a[i - 1][j] << 1) + 1); } scanf("%d", &tc); while(tc--){ scanf("%d %d", &x, &y); printf("%d\n",a[x - 1][y - 1]); } return(0); }
19.916667
48
0.414226
TISparta
aef65053772c0e749712a0e9098b68c6d3582b9d
6,989
cpp
C++
autotests/KPropertySetTest.cpp
KDE/kproperty
3286ad09e44e913fbd033fa65a8bd104111f5870
[ "BSD-3-Clause" ]
9
2015-12-29T20:09:07.000Z
2020-12-01T06:45:29.000Z
autotests/KPropertySetTest.cpp
KDE/kproperty
3286ad09e44e913fbd033fa65a8bd104111f5870
[ "BSD-3-Clause" ]
null
null
null
autotests/KPropertySetTest.cpp
KDE/kproperty
3286ad09e44e913fbd033fa65a8bd104111f5870
[ "BSD-3-Clause" ]
2
2018-03-12T06:48:09.000Z
2020-09-20T02:18:49.000Z
/* This file is part of the KDE project Copyright (C) 2017 Jarosław Staniek <staniek@kde.org> This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This 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 Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include <QtTest> #include <KPropertySet> namespace QTest { //! For convenience. bool qCompare(const QByteArray &val1, const char* val2, const char *actual, const char *expected, const char *file, int line) { return QTest::qCompare(val1, QByteArray(val2), actual, expected, file, line); } } class KPropertySetTest : public QObject { Q_OBJECT private Q_SLOTS: void testEmpty(); void testGroupNameForProperty(); private: void testPropertiesForEmpty(const KPropertySet &set, const char *context); }; void KPropertySetTest::testEmpty() { KPropertySet empty; testPropertiesForEmpty(empty, "empty"); empty.clear(); testPropertiesForEmpty(empty, "after empty.clear()"); KPropertySet emptyCopy(empty); testPropertiesForEmpty(emptyCopy, "emptyCopy"); emptyCopy.clear(); testPropertiesForEmpty(emptyCopy, "after emptyCopy.clear()"); KPropertySet emptyCopy2; emptyCopy2 = KPropertySet(); testPropertiesForEmpty(emptyCopy2, "emptyCopy2"); emptyCopy2.clear(); testPropertiesForEmpty(emptyCopy2, "after emptyCopy2.clear()"); QObject parent; const KPropertySet emptyWithParent(&parent); QCOMPARE(&parent, emptyWithParent.parent()); } void KPropertySetTest::testPropertiesForEmpty(const KPropertySet &set, const char *context) { qDebug() << context; QVERIFY(!set.parent()); QVERIFY(set.isEmpty()); QCOMPARE(set.count(), 0); QVERIFY(!set.isReadOnly()); QVERIFY(!set.hasVisibleProperties()); QCOMPARE(set.groupNames().count(), 0); QVERIFY(set.propertyValues().isEmpty()); } void KPropertySetTest::testGroupNameForProperty() { { KPropertySet set; QVERIFY2(set.groupNameForProperty("foo").isEmpty(), "No property in empty"); } { KPropertySet set; KProperty *foo = new KProperty("foo"); set.addProperty(foo); QCOMPARE(set.groupNameForProperty("foo"), "common"); QCOMPARE(set.groupNameForProperty(*foo), "common"); QVERIFY2(set.groupNameForProperty("bar").isEmpty(), "No property in !empty"); set.removeProperty(foo); QVERIFY2(set.groupNameForProperty("foo").isEmpty(), "No property after removal"); foo = new KProperty("foo"); set.addProperty(foo); set.removeProperty("foo"); QVERIFY2(set.groupNameForProperty("foo").isEmpty(), "No property after removal 2"); foo = new KProperty("foo"); set.addProperty(foo, "someGroup"); QCOMPARE(set.groupNameForProperty(*foo), "somegroup"); QCOMPARE(set.groupNameForProperty("foo"), "somegroup"); KProperty bar("bar"); QVERIFY2(set.groupNameForProperty(bar).isEmpty(), "No property in !empty 2"); } } /* TODO KPropertySelector::KPropertySelector() KPropertySetIterator::KPropertySetIterator(KPropertySet const&) KPropertySetIterator::KPropertySetIterator(KPropertySet const&, KPropertySelector const&) KPropertySetIterator::operator++() KPropertySetIterator::setOrder(KPropertySetIterator::Order) KPropertySetIterator::skipNotAcceptable() KPropertySetPrivate::KPropertySetPrivate(KPropertySet*) KPropertySetPrivate::addProperty(KProperty*, QByteArray const&) KPropertySetPrivate::addRelatedProperty(KProperty*, KProperty*) const KPropertySetPrivate::addToGroup(QByteArray const&, KProperty*) KPropertySetPrivate::clear() KPropertySetPrivate::copyAttributesFrom(KPropertySetPrivate const&) KPropertySetPrivate::copyPropertiesFrom(QList<KProperty*>::const_iterator const&, QList<KProperty*>::const_iterator const&, KPropertySet const&) KPropertySetPrivate::hasGroups() const KPropertySetPrivate::indexOfPropertyInGroup(KProperty const*) const KPropertySetPrivate::indexOfProperty(KProperty const*) const KPropertySetPrivate::informAboutClearing(bool*) KPropertySetPrivate::removeFromGroup(KProperty*) KPropertySetPrivate::removeProperty(KProperty*) + KPropertySet::KPropertySet(KPropertySet const&) OK KPropertySet::KPropertySet(QObject*) KPropertySet::aboutToBeCleared() KPropertySet::aboutToBeDeleted() KPropertySet::aboutToDeleteProperty(KPropertySet&, KProperty&) KPropertySet::addProperty(KProperty*, QByteArray const&) KPropertySet::changePropertyIfExists(QByteArray const&, QVariant const&) KPropertySet::changeProperty(QByteArray const&, QVariant const&) KPropertySet::clear() KPropertySet::contains(QByteArray const&) const KPropertySet::count(KPropertySelector const&) const KPropertySet::count() const KPropertySet::debug() const KPropertySet::groupCaption(QByteArray const&) const KPropertySet::groupIconName(QByteArray const&) const OK KPropertySet::groupNameForProperty(const QByteArray &propertyName) const; OK KPropertySet::groupNameForProperty(const KProperty &property) const; KPropertySet::groupNames() const KPropertySet::hasProperties(KPropertySelector const&) const KPropertySet::hasVisibleProperties() const + KPropertySet::isEmpty() const KPropertySet::isReadOnly() const KPropertySet::operator=(KPropertySet const&) KPropertySet::operator[](QByteArray const&) const KPropertySet::previousSelection() const KPropertySet::propertyChangedInternal(KPropertySet&, KProperty&) KPropertySet::propertyChanged(KPropertySet&, KProperty&) KPropertySet::propertyNamesForGroup(QByteArray const&) const KPropertySet::propertyReset(KPropertySet&, KProperty&) KPropertySet::propertyValues() const KPropertySet::propertyValue(QByteArray const&, QVariant const&) const KPropertySet::property(QByteArray const&) const KPropertySet::readOnlyFlagChanged() KPropertySet::removeProperty(KProperty*) KPropertySet::removeProperty(QByteArray const&) KPropertySet::setGroupCaption(QByteArray const&, QString const&) KPropertySet::setGroupIconName(QByteArray const&, QString const&) KPropertySet::setPreviousSelection(QByteArray const&) KPropertySet::setReadOnly(bool) */ QTEST_GUILESS_MAIN(KPropertySetTest) #include "KPropertySetTest.moc"
40.633721
148
0.737731
KDE
aef9ece3a8db2a41fdfd31d983bd33449d35f811
2,009
hpp
C++
include/GDE/Core/CoreTypes.hpp
genbetadev/Genbeta-Dev-Engine
1bda1f92a927c7657df7fcc6460474c9ef8ac9cd
[ "MIT" ]
3
2016-05-04T23:36:27.000Z
2021-05-02T06:46:50.000Z
include/GDE/Core/CoreTypes.hpp
fordream/Genbeta-Dev-Engine
1bda1f92a927c7657df7fcc6460474c9ef8ac9cd
[ "MIT" ]
3
2015-01-13T22:45:29.000Z
2019-03-07T16:35:37.000Z
include/GDE/Core/CoreTypes.hpp
fordream/Genbeta-Dev-Engine
1bda1f92a927c7657df7fcc6460474c9ef8ac9cd
[ "MIT" ]
4
2015-01-16T14:41:41.000Z
2020-04-21T21:12:19.000Z
#ifndef GDE_CORE_TYPES_HPP #define GDE_CORE_TYPES_HPP #include <map> #include <string> namespace GDE { // Fowards Declarations class App; class Scene; class SceneManager; class ConfigReader; class ConfigCreate; /// Nivel o tipo de Log enum LogLevel { Debug = 0, Info = 1, Warning = 2, Error = 3 }; /// Enumaración con los posibles valores de retorno de la Aplicación enum StatusType { // Values from -99 to 99 are common Error and Good status responses StatusAppMissingAsset = -4, ///< Application failed due to missing asset file StatusAppStackEmpty = -3, ///< Application States stack is empty StatusAppInitFailed = -2, ///< Application initialization failed StatusError = -1, ///< General error status response StatusAppOK = 0, ///< Application quit without error StatusNoError = 0, ///< General no error status response StatusFalse = 0, ///< False status response StatusTrue = 1, ///< True status response StatusOK = 1 ///< OK status response // Values from +-100 to +-199 are reserved for File status responses }; /// Tipo de dato para identidicar las escenas typedef std::string sceneID; /// Declare NameValue typedef which is used for config section maps typedef std::map<const std::string, const std::string> typeNameValue; /// Declare NameValueIter typedef which is used for name,value pair maps typedef std::map<const std::string, const std::string>::iterator typeNameValueIter; /// Almacena el número de línea, nombre de archivo y nombre de función. struct SourceContext { SourceContext (const char *file, unsigned int line, const char *function) : file(file) , line(line) , function(function) { } const char *file; const int line; const char *function; }; typedef void (*LogHandler) (std::ostream &os, GDE::LogLevel level, const std::string &message, const std::string &date, const std::string &time, const GDE::SourceContext &context ); } // namespace GDE #endif // GDE_CORE_TYPES_HPP
25.1125
83
0.708313
genbetadev
aefed9da8ddac4d637d8ec4be04f3dcb33077578
725
cpp
C++
tests/std/tests/Dev10_563443_empty_vector_begin_plus_zero/test.cpp
isra-fel/STL
6ae9a578b4f52193dc523922c943a2214a873577
[ "Apache-2.0" ]
8,232
2019-09-16T22:51:24.000Z
2022-03-31T03:55:39.000Z
tests/std/tests/Dev10_563443_empty_vector_begin_plus_zero/test.cpp
isra-fel/STL
6ae9a578b4f52193dc523922c943a2214a873577
[ "Apache-2.0" ]
2,263
2019-09-17T05:19:55.000Z
2022-03-31T21:05:47.000Z
tests/std/tests/Dev10_563443_empty_vector_begin_plus_zero/test.cpp
isra-fel/STL
6ae9a578b4f52193dc523922c943a2214a873577
[ "Apache-2.0" ]
1,276
2019-09-16T22:51:40.000Z
2022-03-31T03:30:05.000Z
// Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #include <array> #include <assert.h> #include <deque> #include <stdlib.h> #include <string> #include <vector> using namespace std; template <typename C> void test() { C c; const typename C::const_iterator i = c.begin(); const typename C::const_iterator j = c.begin() + 0; const typename C::const_iterator k = c.end(); const typename C::const_iterator l = c.end() + 0; assert(i == j); assert(i == k); assert(i == l); } int main() { test<vector<int>>(); test<deque<int>>(); test<string>(); test<array<int, 0>>(); test<vector<bool>>(); }
21.323529
59
0.591724
isra-fel
4e0747a7edc4b251f829e1d34a5abcc1e125929d
70,129
cxx
C++
PWGJE/PWGJE/AliAnalysisTaskJetProperties.cxx
maroozm/AliPhysics
22ec256928cfdf8f800e05bfc1a6e124d90b6eaf
[ "BSD-3-Clause" ]
114
2017-03-03T09:12:23.000Z
2022-03-03T20:29:42.000Z
PWGJE/PWGJE/AliAnalysisTaskJetProperties.cxx
maroozm/AliPhysics
22ec256928cfdf8f800e05bfc1a6e124d90b6eaf
[ "BSD-3-Clause" ]
19,637
2017-01-16T12:34:41.000Z
2022-03-31T22:02:40.000Z
PWGJE/PWGJE/AliAnalysisTaskJetProperties.cxx
maroozm/AliPhysics
22ec256928cfdf8f800e05bfc1a6e124d90b6eaf
[ "BSD-3-Clause" ]
1,021
2016-07-14T22:41:16.000Z
2022-03-31T05:15:51.000Z
// ************************************************************************************** // * * // * Task for Jet properties and jet shape analysis in PWG4 Jet Task Force Train for pp * // * * // ************************************************************************************** /************************************************************************** * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * * * Author: The ALICE Off-line Project. * * Contributors are mentioned in the code where appropriate. * * * * Permission to use, copy, modify and distribute this software and its * * documentation strictly for non-commercial purposes is hereby granted * * without fee, provided that the above copyright notice appears in all * * copies and that both the copyright notice and this permission notice * * appear in the supporting documentation. The authors make no claims * * about the suitability of this software for any purpose. It is * * provided "as is" without express or implied warranty. * **************************************************************************/ /* $Id: */ #include "TList.h" #include "TH1F.h" #include "TH2F.h" #include "TH3F.h" #include "TString.h" #include "THnSparse.h" #include "TProfile.h" #include "TFile.h" #include "TKey.h" #include "TRandom3.h" #include "AliAODInputHandler.h" #include "AliAODHandler.h" #include "AliESDEvent.h" #include "AliAODMCParticle.h" #include "AliAODJet.h" #include "AliGenPythiaEventHeader.h" #include "AliGenHijingEventHeader.h" #include "AliInputEventHandler.h" #include "AliAnalysisHelperJetTasks.h" #include "AliAnalysisManager.h" #include "AliAnalysisTaskSE.h" #include "AliVParticle.h" #include "AliAODTrack.h" #include "AliVEvent.h" #include "AliAnalysisTaskJetProperties.h" ClassImp(AliAnalysisTaskJetProperties) //_________________________________________________________________________________// AliAnalysisTaskJetProperties::AliAnalysisTaskJetProperties() : AliAnalysisTaskSE() ,fESD(0) ,fAOD(0) ,fAODJets(0) ,fAODExtension(0) ,fNonStdFile("") ,fBranchJets("jets") ,fTrackType(kTrackAOD) ,fJetRejectType(0) ,fRejectPileup(1) ,fUseAODInputJets(kTRUE) ,fFilterMask(0) ,fUsePhysicsSelection(kTRUE) ,fMaxVertexZ(10) ,fNContributors(2) ,fTrackPtCut(0) ,fTrackEtaMin(0) ,fTrackEtaMax(0) ,fJetPtCut(0) ,fJetEtaMin(0) ,fJetEtaMax(0) ,fAvgTrials(0) ,fJetRadius(0.4) ,fJetList(0) ,fTrackList(0) ,fTrackListUE(0) ,fTrackListJet(0) ,fCommonHistList(0) ,fh1EvtSelection(0) ,fh1VertexNContributors(0) ,fh1VertexZ(0) ,fh1Xsec(0) ,fh1Trials(0) ,fh1PtHard(0) ,fh1PtHardTrials(0) ,fh2EtaJet(0) ,fh2PhiJet(0) ,fh2PtJet(0) ,fh1PtJet(0) ,fh2NtracksJet(0) ,fProNtracksJet(0) ,fh2EtaTrack(0) ,fh2PhiTrack(0) ,fh2PtTrack(0) ,fh2FF(0) ,fh2Ksi(0) ,fh2DelEta(0) ,fh2DelPhi(0) ,fh2DelR(0) ,fh1PtLeadingJet(0) ,fh2NtracksLeadingJet(0) ,fProNtracksLeadingJet(0) ,fh2DelR80pcNch(0) ,fProDelR80pcNch(0) ,fh2DelR80pcPt(0) ,fProDelR80pcPt(0) ,fh2AreaCh(0) ,fProAreaCh(0) ,fh3PtDelRNchSum(0) ,fh3PtDelRPtSum(0) ,fProDiffJetShape(0) ,fProIntJetShape(0) ,fh1PtSumInJetConeUE(0) ,fh2NtracksLeadingJetUE(0) ,fProNtracksLeadingJetUE(0) ,fh2DelR80pcNchUE(0) ,fProDelR80pcNchUE(0) ,fh2DelR80pcPtUE(0) ,fProDelR80pcPtUE(0) ,fh2AreaChUE(0) ,fProAreaChUE(0) ,fh3PtDelRNchSumUE(0) ,fh3PtDelRPtSumUE(0) ,fProDiffJetShapeUE(0) ,fProIntJetShapeUE(0) ,fh1CorrJetPt(0) ,fh2CorrPtTrack1(0) ,fh2CorrFF1(0) ,fh2CorrKsi1(0) ,fh2CorrjT1(0) ,fh1JetPtvsTrkSum(0) { for(Int_t ii=0; ii<13; ii++){ if(ii<6){ fh2CorrPt1Pt2[ii] = NULL; fh2CorrZ1Z2[ii] = NULL; fh2CorrKsi1Ksi2[ii] = NULL; fh2CorrjT1jT2[ii] = NULL; } fProDelRNchSum[ii] = NULL; fProDelRPtSum[ii] = NULL; fProDiffJetShapeA[ii] = NULL; fProIntJetShapeA[ii] = NULL; fProDelRNchSumUE[ii] = NULL; fProDelRPtSumUE[ii] = NULL; fProDiffJetShapeAUE[ii] = NULL; fProIntJetShapeAUE[ii] = NULL; }//ii loop // default constructor } //_________________________________________________________________________________// AliAnalysisTaskJetProperties::AliAnalysisTaskJetProperties(const char *name) : AliAnalysisTaskSE(name) ,fESD(0) ,fAOD(0) ,fAODJets(0) ,fAODExtension(0) ,fNonStdFile("") ,fBranchJets("jets") ,fTrackType(kTrackAOD) ,fJetRejectType(0) ,fRejectPileup(1) ,fUseAODInputJets(kTRUE) ,fFilterMask(0) ,fUsePhysicsSelection(kTRUE) ,fMaxVertexZ(10) ,fNContributors(2) ,fTrackPtCut(0) ,fTrackEtaMin(0) ,fTrackEtaMax(0) ,fJetPtCut(0) ,fJetEtaMin(0) ,fJetEtaMax(0) ,fAvgTrials(0) ,fJetRadius(0.4) ,fJetList(0) ,fTrackList(0) ,fTrackListUE(0) ,fTrackListJet(0) ,fCommonHistList(0) ,fh1EvtSelection(0) ,fh1VertexNContributors(0) ,fh1VertexZ(0) ,fh1Xsec(0) ,fh1Trials(0) ,fh1PtHard(0) ,fh1PtHardTrials(0) ,fh2EtaJet(0) ,fh2PhiJet(0) ,fh2PtJet(0) ,fh1PtJet(0) ,fh2NtracksJet(0) ,fProNtracksJet(0) ,fh2EtaTrack(0) ,fh2PhiTrack(0) ,fh2PtTrack(0) ,fh2FF(0) ,fh2Ksi(0) ,fh2DelEta(0) ,fh2DelPhi(0) ,fh2DelR(0) ,fh1PtLeadingJet(0) ,fh2NtracksLeadingJet(0) ,fProNtracksLeadingJet(0) ,fh2DelR80pcNch(0) ,fProDelR80pcNch(0) ,fh2DelR80pcPt(0) ,fProDelR80pcPt(0) ,fh2AreaCh(0) ,fProAreaCh(0) ,fh3PtDelRNchSum(0) ,fh3PtDelRPtSum(0) ,fProDiffJetShape(0) ,fProIntJetShape(0) ,fh1PtSumInJetConeUE(0) ,fh2NtracksLeadingJetUE(0) ,fProNtracksLeadingJetUE(0) ,fh2DelR80pcNchUE(0) ,fProDelR80pcNchUE(0) ,fh2DelR80pcPtUE(0) ,fProDelR80pcPtUE(0) ,fh2AreaChUE(0) ,fProAreaChUE(0) ,fh3PtDelRNchSumUE(0) ,fh3PtDelRPtSumUE(0) ,fProDiffJetShapeUE(0) ,fProIntJetShapeUE(0) ,fh1CorrJetPt(0) ,fh2CorrPtTrack1(0) ,fh2CorrFF1(0) ,fh2CorrKsi1(0) ,fh2CorrjT1(0) ,fh1JetPtvsTrkSum(0) { for(Int_t ii=0; ii<13; ii++){ if(ii<6){ fh2CorrPt1Pt2[ii] = NULL; fh2CorrZ1Z2[ii] = NULL; fh2CorrKsi1Ksi2[ii] = NULL; fh2CorrjT1jT2[ii] = NULL; } fProDelRNchSum[ii] = NULL; fProDelRPtSum[ii] = NULL; fProDiffJetShapeA[ii] = NULL; fProIntJetShapeA[ii] = NULL; fProDelRNchSumUE[ii] = NULL; fProDelRPtSumUE[ii] = NULL; fProDiffJetShapeAUE[ii] = NULL; fProIntJetShapeAUE[ii] = NULL; }//ii loop // constructor DefineOutput(1,TList::Class()); } //_________________________________________________________________________________// AliAnalysisTaskJetProperties::~AliAnalysisTaskJetProperties() { // destructor if(fJetList) delete fJetList; if(fTrackList) delete fTrackList; if(fTrackListUE) delete fTrackListUE; if(fTrackListJet) delete fTrackListJet; } //_________________________________________________________________________________// Bool_t AliAnalysisTaskJetProperties::Notify() { // // Implemented Notify() to read the cross sections // and number of trials from pyxsec.root // (taken from AliAnalysisTaskJetSpectrum2) // if(fDebug > 1) Printf("AliAnalysisTaskJetProperties::Notify()"); TTree *tree = AliAnalysisManager::GetAnalysisManager()->GetTree(); Float_t xsection = 0; Float_t ftrials = 1; fAvgTrials = 1; if(tree){ TFile *curfile = tree->GetCurrentFile(); if (!curfile) { Error("Notify","No current file"); return kFALSE; } if(!fh1Xsec||!fh1Trials){ Printf("%s%d No Histogram fh1Xsec",(char*)__FILE__,__LINE__); return kFALSE; } AliAnalysisHelperJetTasks::PythiaInfoFromFile(curfile->GetName(),xsection,ftrials); fh1Xsec->Fill("<#sigma>",xsection); // construct a poor man average trials Float_t nEntries = (Float_t)tree->GetTree()->GetEntries(); if(ftrials>=nEntries && nEntries>0.)fAvgTrials = ftrials/nEntries; } return kTRUE; } //_________________________________________________________________________________// void AliAnalysisTaskJetProperties::UserCreateOutputObjects() { //(Here, event selection part is taken from AliAnalysisTaskFramentationFunction) // create output objects if(fDebug > 1) Printf("AliAnalysisTaskJetProperties::UserCreateOutputObjects()"); // create list of tracks and jets fJetList = new TList(); fJetList->SetOwner(kFALSE); fTrackList = new TList(); fTrackList->SetOwner(kFALSE); fTrackListUE = new TList(); fTrackListUE->SetOwner(kFALSE); fTrackListJet = new TList(); fTrackListJet->SetOwner(kFALSE); // Create histograms / output container OpenFile(1); fCommonHistList = new TList(); fCommonHistList->SetOwner(); Bool_t oldStatus = TH1::AddDirectoryStatus(); TH1::AddDirectory(kFALSE); // Histograms/TProfiles fh1EvtSelection = new TH1F("fh1EvtSelection", "Event Selection", 6, -0.5, 5.5); fh1EvtSelection->GetXaxis()->SetBinLabel(1,"ACCEPTED"); fh1EvtSelection->GetXaxis()->SetBinLabel(2,"event selection: rejected"); fh1EvtSelection->GetXaxis()->SetBinLabel(3,"event class: rejected"); fh1EvtSelection->GetXaxis()->SetBinLabel(4,"vertex Ncontr: rejected"); fh1EvtSelection->GetXaxis()->SetBinLabel(5,"vertex z: rejected"); fh1EvtSelection->GetXaxis()->SetBinLabel(6,"pile up: rejected"); fh1VertexNContributors = new TH1F("fh1VertexNContributors", "Vertex N contributors", 2500,-.5, 2499.5); fh1VertexZ = new TH1F("fh1VertexZ", "Vertex z distribution", 30, -15., 15.); fh1Xsec = new TProfile("fh1Xsec","xsec from pyxsec.root",1,0,1); fh1Xsec->GetXaxis()->SetBinLabel(1,"<#sigma>"); fh1Trials = new TH1F("fh1Trials","trials from pyxsec.root",1,0,1); fh1Trials->GetXaxis()->SetBinLabel(1,"#sum{ntrials}"); fh1PtHard = new TH1F("fh1PtHard","PYTHIA Pt hard;p_{T,hard}",350,-.5,349.5); fh1PtHardTrials = new TH1F("fh1PtHardTrials","PYTHIA Pt hard weight with trials;p_{T,hard}",350,-.5,349.5); Int_t kNbinsPtSlice=20; Float_t xMinPtSlice=0.0; Float_t xMaxPtSlice=100.0; Int_t kNbinsEta=40; Float_t xMinEta=-2.0; Float_t xMaxEta=2.0; Int_t kNbinsPhi=90; Float_t xMinPhi=0.0; Float_t xMaxPhi=TMath::TwoPi(); Int_t kNbinsPt=250; Float_t xMinPt=0.0; Float_t xMaxPt=250.0; Int_t kNbinsNtracks=50; Float_t xMinNtracks=0.0; Float_t xMaxNtracks=50.0; Int_t kNbinsFF=200; Float_t xMinFF=-0.05; Float_t xMaxFF=1.95; Int_t kNbinsKsi=80; Float_t xMinKsi=0.; Float_t xMaxKsi = 8.0; Int_t kNbinsDelR1D=50; Float_t xMinDelR1D=0.0; Float_t xMaxDelR1D=1.0; Int_t kNbinsjT=100; Float_t xMinjT=0.0; Float_t xMaxjT=10.0; fh2EtaJet = new TH2F("EtaJet","EtaJet", kNbinsPtSlice, xMinPtSlice, xMaxPtSlice, kNbinsEta, xMinEta, xMaxEta); fh2PhiJet = new TH2F("PhiJet","PhiJet", kNbinsPtSlice, xMinPtSlice, xMaxPtSlice, kNbinsPhi, xMinPhi, xMaxPhi); fh2PtJet = new TH2F("PtJet","PtJet", kNbinsPtSlice, xMinPtSlice, xMaxPtSlice, kNbinsPt, xMinPt, xMaxPt); fh1PtJet = new TH1F("PtJet1D","PtJet1D", kNbinsPt, xMinPt, xMaxPt); fh2NtracksJet = new TH2F("NtracksJet","NtracksJet", kNbinsPtSlice, xMinPtSlice, xMaxPtSlice, kNbinsNtracks, xMinNtracks, xMaxNtracks); fProNtracksJet = new TProfile("AvgNoOfTracksJet","AvgNoOfTracksJet", kNbinsPtSlice, xMinPtSlice, xMaxPtSlice, xMinNtracks, xMaxNtracks); fh2EtaTrack = new TH2F("EtaTrack","EtaTrack", kNbinsPtSlice, xMinPtSlice, xMaxPtSlice, kNbinsEta, xMinEta, xMaxEta); fh2PhiTrack = new TH2F("PhiTrack","PhiTrack", kNbinsPtSlice, xMinPtSlice, xMaxPtSlice, kNbinsPhi, xMinPhi, xMaxPhi); fh2PtTrack = new TH2F("PtTrack","PtTrack", kNbinsPtSlice, xMinPtSlice, xMaxPtSlice, 2*kNbinsPt, xMinPt, xMaxPt); fh2FF = new TH2F("FF","FF", kNbinsPtSlice, xMinPtSlice, xMaxPtSlice, kNbinsFF, xMinFF, xMaxFF); fh2Ksi = new TH2F("Ksi","Ksi", kNbinsPtSlice, xMinPtSlice, xMaxPtSlice, kNbinsKsi, xMinKsi, xMaxKsi); fh2DelEta = new TH2F("DelEta","DelEta", kNbinsPtSlice, xMinPtSlice, xMaxPtSlice, kNbinsEta, xMinEta, xMaxEta); fh2DelPhi = new TH2F("DelPhi","DelPhi", kNbinsPtSlice, xMinPtSlice, xMaxPtSlice, kNbinsPhi, xMinPhi, xMaxPhi); fh2DelR = new TH2F("DelR","DelR", kNbinsPtSlice, xMinPtSlice, xMaxPtSlice, kNbinsDelR1D, xMinDelR1D, xMaxDelR1D); Int_t kNbinsDelR=100; Float_t xMinDelR=0.0; Float_t xMaxDelR=1.0; Int_t kNbinsPtSliceJS=100; Float_t xMinPtSliceJS=0.0; Float_t xMaxPtSliceJS=250.0; fh1PtLeadingJet = new TH1F("PtLeadingJet","PtLeadingJet", kNbinsPt, xMinPt, xMaxPt); fh2NtracksLeadingJet = new TH2F("NtracksLeadingJet","NtracksLeadingJet", kNbinsPtSliceJS, xMinPtSliceJS, xMaxPtSliceJS, kNbinsNtracks, xMinNtracks, xMaxNtracks); fProNtracksLeadingJet = new TProfile("AvgNoOfTracksLeadingJet","AvgNoOfTracksLeadingJet", kNbinsPtSliceJS, xMinPtSliceJS, xMaxPtSliceJS, xMinNtracks, xMaxNtracks); fh2DelR80pcNch = new TH2F("delR80pcNch","delR80pcNch", kNbinsPtSliceJS, xMinPtSliceJS, xMaxPtSliceJS, kNbinsDelR, xMinDelR, xMaxDelR); fProDelR80pcNch = new TProfile("AvgdelR80pcNch","AvgdelR80pcNch", kNbinsPtSliceJS, xMinPtSliceJS, xMaxPtSliceJS, xMinDelR, xMaxDelR); fh2DelR80pcPt = new TH2F("delR80pcPt","delR80pcPt", kNbinsPtSliceJS, xMinPtSliceJS, xMaxPtSliceJS, kNbinsDelR, xMinDelR, xMaxDelR); fProDelR80pcPt = new TProfile("AvgdelR80pcPt","AvgdelR80pcPt", kNbinsPtSliceJS, xMinPtSliceJS, xMaxPtSliceJS, xMinDelR, xMaxDelR); fh2AreaCh = new TH2F("Area","Area", kNbinsPtSliceJS, xMinPtSliceJS, xMaxPtSliceJS, 72, 0.0, TMath::Pi()); fProAreaCh = new TProfile("AvgArea","AvgArea", kNbinsPtSliceJS, xMinPtSliceJS, xMaxPtSliceJS, 0.0, TMath::Pi()); fh3PtDelRNchSum = new TH3F("PtDelRNchSum","PtDelRNchSum", kNbinsPtSliceJS, xMinPtSliceJS, xMaxPtSliceJS, kNbinsDelR1D, xMinDelR1D, xMaxDelR1D, kNbinsNtracks, xMinNtracks, xMaxNtracks); fh3PtDelRPtSum = new TH3F("PtDelRPtSum","PtDelRPtSum", kNbinsPtSliceJS, xMinPtSliceJS, xMaxPtSliceJS, kNbinsDelR1D, xMinDelR1D, xMaxDelR1D, kNbinsPt, xMinPt, xMaxPt); fProDiffJetShape = new TProfile("DiffJetShape","DiffJetShape", 10,0.0,1.0,0.0,250.0); fProIntJetShape = new TProfile("IntJetShape","IntJetShape", 10,0.0,1.0,0.0,250.0); fh1PtSumInJetConeUE = new TH1F("PtSumInJetConeUE","PtSumInJetConeUE", 500, 0., 100.); fh2NtracksLeadingJetUE = new TH2F("NtracksLeadingJetUE","NtracksLeadingJetUE", kNbinsPtSliceJS, xMinPtSliceJS, xMaxPtSliceJS, kNbinsNtracks, xMinNtracks, xMaxNtracks); fProNtracksLeadingJetUE = new TProfile("AvgNoOfTracksLeadingJetUE","AvgNoOfTracksLeadingJetUE", kNbinsPtSliceJS, xMinPtSliceJS, xMaxPtSliceJS, xMinNtracks, xMaxNtracks); fh2DelR80pcNchUE = new TH2F("delR80pcNchUE","delR80pcNchUE", kNbinsPtSliceJS, xMinPtSliceJS, xMaxPtSliceJS, kNbinsDelR, xMinDelR, xMaxDelR); fProDelR80pcNchUE = new TProfile("AvgdelR80pcNchUE","AvgdelR80pcNchUE", kNbinsPtSliceJS, xMinPtSliceJS, xMaxPtSliceJS, xMinDelR, xMaxDelR); fh2DelR80pcPtUE = new TH2F("delR80pcPtUE","delR80pcPtUE", kNbinsPtSliceJS, xMinPtSliceJS, xMaxPtSliceJS, kNbinsDelR, xMinDelR, xMaxDelR); fProDelR80pcPtUE = new TProfile("AvgdelR80pcPtUE","AvgdelR80pcPtUE", kNbinsPtSliceJS, xMinPtSliceJS, xMaxPtSliceJS, xMinDelR, xMaxDelR); fh2AreaChUE = new TH2F("AreaUE","AreaUE", kNbinsPtSliceJS, xMinPtSliceJS, xMaxPtSliceJS, 72, 0.0, TMath::Pi()); fProAreaChUE = new TProfile("AvgAreaUE","AvgAreaUE", kNbinsPtSliceJS, xMinPtSliceJS, xMaxPtSliceJS, 0.0, TMath::Pi()); fh3PtDelRNchSumUE = new TH3F("PtDelRNchSumUE","PtDelRNchSumUE", kNbinsPtSliceJS, xMinPtSliceJS, xMaxPtSliceJS, kNbinsDelR1D, xMinDelR1D, xMaxDelR1D, kNbinsNtracks, xMinNtracks, xMaxNtracks); fh3PtDelRPtSumUE = new TH3F("PtDelRPtSumUE","PtDelRPtSumUE", kNbinsPtSliceJS, xMinPtSliceJS, xMaxPtSliceJS, kNbinsDelR1D, xMinDelR1D, xMaxDelR1D, kNbinsPt, xMinPt, xMaxPt); fProDiffJetShapeUE = new TProfile("DiffJetShapeUE","DiffJetShapeUE", 10,0.0,1.0,0.0,250.0); fProIntJetShapeUE = new TProfile("IntJetShapeUE","IntJetShapeUE", 10,0.0,1.0,0.0,250.0); fh1CorrJetPt = new TH1F("JetPtCorr","JetPtCorr", kNbinsPt, xMinPt, xMaxPt); fh2CorrPtTrack1 = new TH2F("TrackPtCorr", "TrackPtCorr", kNbinsPtSlice, xMinPtSlice, xMaxPtSlice, 2*kNbinsPt, xMinPt, xMaxPt); fh2CorrFF1 = new TH2F("FFCorr","FFCorr", kNbinsPtSlice, xMinPtSlice, xMaxPtSlice, kNbinsFF, xMinFF, xMaxFF); fh2CorrKsi1 = new TH2F("KsiCorr","KsiCorr", kNbinsPtSlice, xMinPtSlice, xMaxPtSlice, kNbinsKsi, xMinKsi, xMaxKsi); fh2CorrjT1 = new TH2F("jTCorr","jTCorr", kNbinsPtSlice, xMinPtSlice, xMaxPtSlice, kNbinsjT, xMinjT, xMaxjT); fh1JetPtvsTrkSum = new TH1F("diffJetPt_TrkPtSum","diffJetPt_TrkPtSum", 500, -250., 250.); TString title; for(Int_t ii=0; ii<13; ii++){ if(ii==0)title = "_JetPt20to25"; if(ii==1)title = "_JetPt25to30"; if(ii==2)title = "_JetPt20to30"; if(ii==3)title = "_JetPt30to35"; if(ii==4)title = "_JetPt35to40"; if(ii==5)title = "_JetPt30to40"; if(ii==6)title = "_JetPt40to50"; if(ii==7)title = "_JetPt50to60"; if(ii==8)title = "_JetPt40to60"; if(ii==9) title = "_JetPt60to70"; if(ii==10)title = "_JetPt70to80"; if(ii==11)title = "_JetPt60to80"; if(ii==12)title = "_JetPt80to100"; fProDelRNchSum[ii] = new TProfile(Form("AvgNchSumDelR%s",title.Data()),Form("AvgNchSumDelR%s",title.Data()), kNbinsDelR1D, xMinDelR1D, xMaxDelR1D, xMinNtracks, xMaxNtracks); fProDelRPtSum[ii] = new TProfile(Form("AvgPtSumDelR%s",title.Data()),Form("AvgPtSumDelR%s",title.Data()), kNbinsDelR1D, xMinDelR1D, xMaxDelR1D, xMinPt, xMaxPt); fProDelRNchSum[ii] ->GetXaxis()->SetTitle("R"); fProDelRNchSum[ii] ->GetYaxis()->SetTitle("<NchSum>"); fProDelRPtSum[ii] ->GetXaxis()->SetTitle("R"); fProDelRPtSum[ii] ->GetYaxis()->SetTitle("<PtSum>"); fProDiffJetShapeA[ii] = new TProfile(Form("DiffJetShape%s",title.Data()),Form("DiffJetShape%s",title.Data()), 10,0.0,1.0,0.0,250.0); fProIntJetShapeA[ii] = new TProfile(Form("IntJetShape%s",title.Data()),Form("IntJetShape%s",title.Data()), 10,0.0,1.0,0.0,250.0); fProDiffJetShapeA[ii]->GetXaxis()->SetTitle("R"); fProDiffJetShapeA[ii]->GetYaxis()->SetTitle("Diff jet shape"); fProIntJetShapeA[ii]->GetXaxis()->SetTitle("R"); fProIntJetShapeA[ii]->GetYaxis()->SetTitle("Integrated jet shape"); fCommonHistList->Add(fProDelRNchSum[ii]); fCommonHistList->Add(fProDelRPtSum[ii]); fCommonHistList->Add(fProDiffJetShapeA[ii]); fCommonHistList->Add(fProIntJetShapeA[ii]); fProDelRNchSumUE[ii] = new TProfile(Form("AvgNchSumDelR%sUE",title.Data()),Form("AvgNchSumDelR%sUE",title.Data()), kNbinsDelR1D, xMinDelR1D, xMaxDelR1D, xMinNtracks, xMaxNtracks); fProDelRPtSumUE[ii] = new TProfile(Form("AvgPtSumDelR%sUE",title.Data()),Form("AvgPtSumDelR%sUE",title.Data()), kNbinsDelR1D, xMinDelR1D, xMaxDelR1D, xMinPt, xMaxPt); fProDelRNchSumUE[ii] ->GetXaxis()->SetTitle("R"); fProDelRNchSumUE[ii] ->GetYaxis()->SetTitle("<N_{ch}^{Sum,UE}>"); fProDelRPtSumUE[ii] ->GetXaxis()->SetTitle("R"); fProDelRPtSumUE[ii] ->GetYaxis()->SetTitle("<p_{T}^{sum, UE}>"); fProDiffJetShapeAUE[ii] = new TProfile(Form("DiffJetShape%sUE",title.Data()),Form("DiffJetShape%sUE",title.Data()), 10,0.0,1.0,0.0,250.0); fProIntJetShapeAUE[ii] = new TProfile(Form("IntJetShape%sUE",title.Data()),Form("IntJetShape%sUE",title.Data()), 10,0.0,1.0,0.0,250.0); fProDiffJetShapeAUE[ii]->GetXaxis()->SetTitle("R"); fProDiffJetShapeAUE[ii]->GetYaxis()->SetTitle("Diff jet shape UE"); fProIntJetShapeAUE[ii]->GetXaxis()->SetTitle("R"); fProIntJetShapeAUE[ii]->GetYaxis()->SetTitle("Integrated jet shape UE"); fCommonHistList->Add(fProDelRNchSumUE[ii]); fCommonHistList->Add(fProDelRPtSumUE[ii]); fCommonHistList->Add(fProDiffJetShapeAUE[ii]); fCommonHistList->Add(fProIntJetShapeAUE[ii]); }//ii loop fh2EtaJet ->GetXaxis()->SetTitle("JetPt"); fh2EtaJet ->GetYaxis()->SetTitle("JetEta"); fh2PhiJet ->GetXaxis()->SetTitle("JetPt"); fh2PhiJet ->GetYaxis()->SetTitle("JetPhi"); fh2PtJet ->GetXaxis()->SetTitle("JetPt"); fh2PtJet ->GetYaxis()->SetTitle("JetPt"); fh1PtJet ->GetXaxis()->SetTitle("JetPt"); fh1PtJet ->GetYaxis()->SetTitle("#jets"); fh2NtracksJet ->GetXaxis()->SetTitle("JetPt"); fh2NtracksJet ->GetYaxis()->SetTitle("#tracks"); fProNtracksJet->GetXaxis()->SetTitle("JetPt"); fProNtracksJet->GetYaxis()->SetTitle("AgvNtracks"); fh2EtaTrack ->GetXaxis()->SetTitle("JetPt"); fh2EtaTrack ->GetYaxis()->SetTitle("TrackEta"); fh2PhiTrack ->GetXaxis()->SetTitle("JetPt"); fh2PhiTrack ->GetYaxis()->SetTitle("TrackPhi"); fh2PtTrack ->GetXaxis()->SetTitle("JetPt"); fh2PtTrack ->GetYaxis()->SetTitle("TrackPt"); fh2FF ->GetXaxis()->SetTitle("JetPt"); fh2FF ->GetYaxis()->SetTitle("FF"); fh2Ksi ->GetXaxis()->SetTitle("JetPt"); fh2Ksi ->GetYaxis()->SetTitle("Ksi"); fh2DelEta ->GetXaxis()->SetTitle("JetPt"); fh2DelEta ->GetYaxis()->SetTitle("DelEta"); fh2DelPhi ->GetXaxis()->SetTitle("JetPt"); fh2DelPhi ->GetYaxis()->SetTitle("DelPhi"); fh2DelR ->GetXaxis()->SetTitle("JetPt"); fh2DelR ->GetYaxis()->SetTitle("DelR"); fh1PtLeadingJet ->GetXaxis()->SetTitle("JetPt"); fh1PtLeadingJet ->GetYaxis()->SetTitle("#leading jets"); fh2NtracksLeadingJet ->GetXaxis()->SetTitle("JetPt"); fh2NtracksLeadingJet ->GetYaxis()->SetTitle("#tracks leading jet"); fProNtracksLeadingJet ->GetXaxis()->SetTitle("JetPt"); fProNtracksLeadingJet ->GetYaxis()->SetTitle("AvgNtracks leading jet"); fh2DelR80pcNch ->GetXaxis()->SetTitle("JetPt"); fh2DelR80pcNch ->GetYaxis()->SetTitle("R containing 80% of tracks"); fProDelR80pcNch ->GetXaxis()->SetTitle("JetPt"); fProDelR80pcNch ->GetYaxis()->SetTitle("<R> containing 80% of tracks"); fh2DelR80pcPt ->GetXaxis()->SetTitle("JetPt"); fh2DelR80pcPt ->GetYaxis()->SetTitle("R containing 80% of pT"); fProDelR80pcPt ->GetXaxis()->SetTitle("JetPt"); fProDelR80pcPt ->GetYaxis()->SetTitle("<R> containing 80% of pT"); fh2AreaCh ->GetXaxis()->SetTitle("JetPt"); fh2AreaCh ->GetYaxis()->SetTitle("Jet area"); fProAreaCh ->GetXaxis()->SetTitle("JetPt"); fProAreaCh ->GetYaxis()->SetTitle("<jet area>"); fh3PtDelRNchSum ->GetXaxis()->SetTitle("JetPt"); fh3PtDelRNchSum ->GetYaxis()->SetTitle("R"); fh3PtDelRNchSum->GetZaxis()->SetTitle("NchSum"); fh3PtDelRPtSum ->GetXaxis()->SetTitle("JetPt"); fh3PtDelRPtSum ->GetYaxis()->SetTitle("R"); fh3PtDelRPtSum ->GetZaxis()->SetTitle("PtSum"); fProDiffJetShape->GetXaxis()->SetTitle("R"); fProDiffJetShape->GetYaxis()->SetTitle("Diff jet shape"); fProIntJetShape->GetXaxis()->SetTitle("R"); fProIntJetShape->GetYaxis()->SetTitle("Integrated jet shape"); fh1PtSumInJetConeUE ->GetXaxis()->SetTitle("p_{T}^{sum, UE}(in cone R)"); fh1PtSumInJetConeUE ->GetYaxis()->SetTitle("#leading jets"); fh2NtracksLeadingJetUE ->GetXaxis()->SetTitle("JetPt"); fh2NtracksLeadingJetUE ->GetYaxis()->SetTitle("#tracks UE"); fProNtracksLeadingJetUE ->GetXaxis()->SetTitle("JetPt"); fProNtracksLeadingJetUE ->GetYaxis()->SetTitle("AvgNtracks UE"); fh2DelR80pcNchUE ->GetXaxis()->SetTitle("JetPt"); fh2DelR80pcNchUE ->GetYaxis()->SetTitle("R containing 80% of tracks"); fProDelR80pcNchUE ->GetXaxis()->SetTitle("JetPt"); fProDelR80pcNchUE ->GetYaxis()->SetTitle("<R> containing 80% of tracks"); fh2DelR80pcPtUE ->GetXaxis()->SetTitle("JetPt"); fh2DelR80pcPtUE ->GetYaxis()->SetTitle("R containing 80% of pT"); fProDelR80pcPtUE ->GetXaxis()->SetTitle("JetPt"); fProDelR80pcPtUE ->GetYaxis()->SetTitle("<R> containing 80% of pT"); fh2AreaChUE ->GetXaxis()->SetTitle("JetPt"); fh2AreaChUE ->GetYaxis()->SetTitle("UE area"); fProAreaChUE ->GetXaxis()->SetTitle("JetPt"); fProAreaChUE ->GetYaxis()->SetTitle("<UE area>"); fh3PtDelRNchSumUE ->GetXaxis()->SetTitle("JetPt"); fh3PtDelRNchSumUE ->GetYaxis()->SetTitle("R"); fh3PtDelRNchSumUE->GetZaxis()->SetTitle("NchSumUE"); fh3PtDelRPtSumUE ->GetXaxis()->SetTitle("JetPt"); fh3PtDelRPtSumUE ->GetYaxis()->SetTitle("R"); fh3PtDelRPtSumUE ->GetZaxis()->SetTitle("PtSumUE"); fProDiffJetShapeUE->GetXaxis()->SetTitle("R"); fProDiffJetShapeUE->GetYaxis()->SetTitle("Diff jet shape UE"); fProIntJetShapeUE->GetXaxis()->SetTitle("R"); fProIntJetShapeUE->GetYaxis()->SetTitle("Integrated jet shape UE"); fh1CorrJetPt ->GetXaxis()->SetTitle("JetPt"); fh1CorrJetPt ->GetYaxis()->SetTitle("#jets"); fh2CorrPtTrack1 ->GetXaxis()->SetTitle("JetPt"); fh2CorrPtTrack1 ->GetYaxis()->SetTitle("pt_track"); fh2CorrFF1 ->GetXaxis()->SetTitle("JetPt"); fh2CorrFF1 ->GetYaxis()->SetTitle("z_track"); fh2CorrKsi1 ->GetXaxis()->SetTitle("JetPt"); fh2CorrKsi1 ->GetYaxis()->SetTitle("ksi_track"); fh2CorrjT1 ->GetXaxis()->SetTitle("JetPt"); fh2CorrjT1 ->GetYaxis()->SetTitle("jt_track"); fh1JetPtvsTrkSum->GetXaxis()->SetTitle("JetPt-TrkPtSum"); fCommonHistList->Add(fh1EvtSelection); fCommonHistList->Add(fh1VertexNContributors); fCommonHistList->Add(fh1VertexZ); fCommonHistList->Add(fh1Xsec); fCommonHistList->Add(fh1Trials); fCommonHistList->Add(fh1PtHard); fCommonHistList->Add(fh1PtHardTrials); fCommonHistList->Add(fh2EtaJet); fCommonHistList->Add(fh2PhiJet); fCommonHistList->Add(fh2PtJet); fCommonHistList->Add(fh1PtJet); fCommonHistList->Add(fh2NtracksJet); fCommonHistList->Add(fProNtracksJet); fCommonHistList->Add(fh2EtaTrack); fCommonHistList->Add(fh2PhiTrack); fCommonHistList->Add(fh2PtTrack); fCommonHistList->Add(fh2FF); fCommonHistList->Add(fh2Ksi); fCommonHistList->Add(fh2DelEta); fCommonHistList->Add(fh2DelPhi); fCommonHistList->Add(fh2DelR); fCommonHistList->Add(fh1PtLeadingJet); fCommonHistList->Add(fh2NtracksLeadingJet); fCommonHistList->Add(fProNtracksLeadingJet); fCommonHistList->Add(fh2DelR80pcNch); fCommonHistList->Add(fProDelR80pcNch); fCommonHistList->Add(fh2DelR80pcPt); fCommonHistList->Add(fProDelR80pcPt); fCommonHistList->Add(fh2AreaCh); fCommonHistList->Add(fProAreaCh); fCommonHistList->Add(fh3PtDelRNchSum); fCommonHistList->Add(fh3PtDelRPtSum); fCommonHistList->Add(fProDiffJetShape); fCommonHistList->Add(fProIntJetShape); fCommonHistList->Add(fh1PtSumInJetConeUE); fCommonHistList->Add(fh2NtracksLeadingJetUE); fCommonHistList->Add(fProNtracksLeadingJetUE); fCommonHistList->Add(fh2DelR80pcNchUE); fCommonHistList->Add(fProDelR80pcNchUE); fCommonHistList->Add(fh2DelR80pcPtUE); fCommonHistList->Add(fProDelR80pcPtUE); fCommonHistList->Add(fh2AreaChUE); fCommonHistList->Add(fProAreaChUE); fCommonHistList->Add(fh3PtDelRNchSumUE); fCommonHistList->Add(fh3PtDelRPtSumUE); fCommonHistList->Add(fProDiffJetShapeUE); fCommonHistList->Add(fProIntJetShapeUE); fCommonHistList->Add(fh1CorrJetPt); fCommonHistList->Add(fh2CorrPtTrack1); fCommonHistList->Add(fh2CorrFF1); fCommonHistList->Add(fh2CorrKsi1); fCommonHistList->Add(fh2CorrjT1); fCommonHistList->Add(fh1JetPtvsTrkSum); TString titleCorr; for(Int_t jj=0; jj<6; jj++){ if(jj == 0)titleCorr = "_JetPt10to20"; if(jj == 1)titleCorr = "_JetPt20to30"; if(jj == 2)titleCorr = "_JetPt30to40"; if(jj == 3)titleCorr = "_JetPt40to60"; if(jj == 4)titleCorr = "_JetPt60to80"; if(jj == 5)titleCorr = "_JetPt80to100"; fh2CorrPt1Pt2[jj] = new TH2F(Form("CorrPt1Pt2%s",titleCorr.Data()),Form("CorrPt1Pt2%s",titleCorr.Data()), 2*kNbinsPt, xMinPt, xMaxPt, 2*kNbinsPt, xMinPt, xMaxPt); fh2CorrZ1Z2[jj] = new TH2F(Form("CorrZ1Z2%s",titleCorr.Data()),Form("CorrZ1Z2%s",titleCorr.Data()), kNbinsFF, xMinFF, xMaxFF, kNbinsFF, xMinFF, xMaxFF); fh2CorrKsi1Ksi2[jj] = new TH2F(Form("CorrKsi1Ksi2%s",titleCorr.Data()),Form("CorrKsi1Ksi2%s",titleCorr.Data()), kNbinsKsi, xMinKsi, xMaxKsi, kNbinsKsi, xMinKsi, xMaxKsi); fh2CorrjT1jT2[jj] = new TH2F(Form("CorrjT1jT2%s",titleCorr.Data()),Form("CorrjT1jT2%s",titleCorr.Data()), kNbinsjT, xMinjT, xMaxjT, kNbinsjT, xMinjT, xMaxjT); fh2CorrPt1Pt2[jj] ->GetXaxis()->SetTitle("pt_track1"); fh2CorrZ1Z2[jj] ->GetXaxis()->SetTitle("z_track1"); fh2CorrKsi1Ksi2[jj] ->GetXaxis()->SetTitle("ksi_track1"); fh2CorrjT1jT2[jj] ->GetXaxis()->SetTitle("jt_track1"); fh2CorrPt1Pt2[jj] ->GetYaxis()->SetTitle("pt_track2"); fh2CorrZ1Z2[jj] ->GetYaxis()->SetTitle("z_track2"); fh2CorrKsi1Ksi2[jj] ->GetYaxis()->SetTitle("ksi_track2"); fh2CorrjT1jT2[jj] ->GetYaxis()->SetTitle("jt_track2"); fCommonHistList->Add(fh2CorrPt1Pt2[jj]); fCommonHistList->Add(fh2CorrZ1Z2[jj]); fCommonHistList->Add(fh2CorrKsi1Ksi2[jj]); fCommonHistList->Add(fh2CorrjT1jT2[jj]); }//jj loop // =========== Switch on Sumw2 for all histos =========== for (Int_t i=0; i<fCommonHistList->GetEntries(); ++i){ TH1 *h1 = dynamic_cast<TH1*>(fCommonHistList->At(i)); if (h1) h1->Sumw2(); else{ TProfile *hPro = dynamic_cast<TProfile*>(fCommonHistList->At(i)); if(hPro) hPro->Sumw2(); } } TH1::AddDirectory(oldStatus); PostData(1, fCommonHistList); } //_________________________________________________________________________________// void AliAnalysisTaskJetProperties::Init() { // Initialization if(fDebug > 1) Printf("AliAnalysisTaskJetProperties::Init()"); } //_________________________________________________________________________________// void AliAnalysisTaskJetProperties::UserExec(Option_t *) { // Main loop // Called for each event if(fDebug > 2) Printf("AliAnalysisTaskJetProperties::UserExec()"); //if(fDebug > 1) Printf("Analysis event #%5d", (Int_t) fEntry); // Trigger selection AliInputEventHandler* inputHandler = (AliInputEventHandler*) ((AliAnalysisManager::GetAnalysisManager())->GetInputEventHandler()); if(!(inputHandler->IsEventSelected() & AliVEvent::kMB)){ if(inputHandler->InheritsFrom("AliESDInputHandler") && fUsePhysicsSelection){ // PhysicsSelection only with ESD input fh1EvtSelection->Fill(1.); if (fDebug > 2 ) Printf(" Trigger Selection: event REJECTED ... "); PostData(1, fCommonHistList); return; } } fESD = dynamic_cast<AliESDEvent*>(InputEvent()); if(!fESD){ if(fDebug>2) Printf("%s:%d ESDEvent not found in the input", (char*)__FILE__,__LINE__); } fMCEvent = MCEvent(); if(!fMCEvent){ if(fDebug>2) Printf("%s:%d MCEvent not found in the input", (char*)__FILE__,__LINE__); } // get AOD event from input/ouput TObject* handler = AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler(); if( handler && handler->InheritsFrom("AliAODInputHandler") ) { fAOD = ((AliAODInputHandler*)handler)->GetEvent(); if(fUseAODInputJets) fAODJets = fAOD; if (fDebug > 2) Printf("%s:%d AOD event from input", (char*)__FILE__,__LINE__); } else { handler = AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler(); if( handler && handler->InheritsFrom("AliAODHandler") ) { fAOD = ((AliAODHandler*)handler)->GetAOD(); fAODJets = fAOD; if (fDebug > 2) Printf("%s:%d AOD event from output", (char*)__FILE__,__LINE__); } } if(!fAODJets && !fUseAODInputJets){ // case we have AOD in input & output and want jets from output TObject* outHandler = AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler(); if( outHandler && outHandler->InheritsFrom("AliAODHandler") ) { fAODJets = ((AliAODHandler*)outHandler)->GetAOD(); if (fDebug > 2) Printf("%s:%d jets from output AOD", (char*)__FILE__,__LINE__); } } if(fNonStdFile.Length()!=0){ // case we have an AOD extension - fetch the jets from the extended output AliAODHandler *aodH = dynamic_cast<AliAODHandler*>(AliAnalysisManager::GetAnalysisManager()->GetOutputEventHandler()); fAODExtension = (aodH?aodH->GetExtension(fNonStdFile.Data()):0); if(!fAODExtension){ if(fDebug>2)Printf("AODExtension not found for %s",fNonStdFile.Data()); } } if(!fAOD){ Printf("%s:%d AODEvent not found", (char*)__FILE__,__LINE__); return; } if(!fAODJets){ Printf("%s:%d AODEvent with jet branch not found", (char*)__FILE__,__LINE__); return; } // *** vertex cut *** AliAODVertex* primVtx = fAOD->GetPrimaryVertex(); Int_t nTracksPrim = primVtx->GetNContributors(); fh1VertexNContributors->Fill(nTracksPrim); if (fDebug > 2) Printf("%s:%d primary vertex selection: %d", (char*)__FILE__,__LINE__,nTracksPrim); //if(!nTracksPrim){ if(nTracksPrim<fNContributors){ if (fDebug > 2) Printf("%s:%d primary vertex selection: event REJECTED...",(char*)__FILE__,__LINE__); fh1EvtSelection->Fill(3.); PostData(1, fCommonHistList); return; } if(fRejectPileup && AliAnalysisHelperJetTasks::IsPileUp()){ if (fDebug > 2) Printf("%s:%d SPD pileup : event REJECTED...",(char*)__FILE__,__LINE__); fh1EvtSelection->Fill(6.); PostData(1, fCommonHistList); return; }//pile up rejection fh1VertexZ->Fill(primVtx->GetZ()); if(TMath::Abs(primVtx->GetZ())>fMaxVertexZ){ if (fDebug > 2) Printf("%s:%d primary vertex z = %f: event REJECTED...",(char*)__FILE__,__LINE__,primVtx->GetZ()); fh1EvtSelection->Fill(4.); PostData(1, fCommonHistList); return; } TString primVtxName(primVtx->GetName()); if(primVtxName.CompareTo("TPCVertex",TString::kIgnoreCase) == 1){ if (fDebug > 2) Printf("%s:%d primary vertex selection: TPC vertex, event REJECTED...",(char*)__FILE__,__LINE__); fh1EvtSelection->Fill(5.); PostData(1, fCommonHistList); return; } if (fDebug > 2) Printf("%s:%d event ACCEPTED ...",(char*)__FILE__,__LINE__); fh1EvtSelection->Fill(0.); //___ get MC information __________________________________________________________________ Double_t ptHard = 0.; Double_t nTrials = 1; // trials for MC trigger weight for real data if(fMCEvent){ AliGenEventHeader* genHeader = fMCEvent->GenEventHeader(); if(genHeader){ AliGenPythiaEventHeader* pythiaGenHeader = dynamic_cast<AliGenPythiaEventHeader*>(genHeader); AliGenHijingEventHeader* hijingGenHeader = 0x0; if(pythiaGenHeader){ if(fDebug>2) Printf("%s:%d pythiaGenHeader found", (char*)__FILE__,__LINE__); nTrials = pythiaGenHeader->Trials(); ptHard = pythiaGenHeader->GetPtHard(); fh1PtHard->Fill(ptHard); fh1PtHardTrials->Fill(ptHard,nTrials); } else { // no pythia, hijing? if(fDebug>2) Printf("%s:%d no pythiaGenHeader found", (char*)__FILE__,__LINE__); hijingGenHeader = dynamic_cast<AliGenHijingEventHeader*>(genHeader); if(!hijingGenHeader){ Printf("%s:%d no pythiaGenHeader or hjingGenHeader found", (char*)__FILE__,__LINE__); } else { if(fDebug>2) Printf("%s:%d hijingGenHeader found", (char*)__FILE__,__LINE__); } } fh1Trials->Fill("#sum{ntrials}",fAvgTrials); } } //___ fetch jets __________________________________________________________________________ Int_t nJ = GetListOfJets(fJetList); Int_t nJets = 0; if(nJ>=0) nJets = fJetList->GetEntries(); if(fDebug>2){ Printf("%s:%d Selected jets: %d %d",(char*)__FILE__,__LINE__,nJ,nJets); if(nJ != nJets) Printf("%s:%d Mismatch Selected Jets: %d %d",(char*)__FILE__,__LINE__,nJ,nJets); } FillJetProperties(fJetList); FillJetShape(fJetList); FillJetShapeUE(fJetList); FillFFCorr(fJetList); fJetList->Clear(); //Post output data. PostData(1, fCommonHistList); }//UserExec //_________________________________________________________________________________// void AliAnalysisTaskJetProperties::Terminate(Option_t *) { // terminated if(fDebug > 1) printf("AliAnalysisTaskJetProperties::Terminate() \n"); } //_________________________________________________________________________________// Int_t AliAnalysisTaskJetProperties::GetListOfJets(TList *list) { //this functionality is motivated by AliAnalysisTaskFragmentationFunction if(fDebug > 2) printf("AliAnalysisTaskJetProperties::GetListOfJets() \n"); // fill list of jets selected according to type if(!list){ if(fDebug>2) Printf("%s:%d no input list", (char*)__FILE__,__LINE__); return -1; } if(fBranchJets.Length()==0){ Printf("%s:%d no jet branch specified", (char*)__FILE__,__LINE__); if(fDebug>2)fAOD->Print(); return 0; } TClonesArray *aodJets = 0; if(fBranchJets.Length()) aodJets = dynamic_cast<TClonesArray*>(fAODJets->FindListObject(fBranchJets.Data())); if(!aodJets) aodJets = dynamic_cast<TClonesArray*>(fAODJets->GetList()->FindObject(fBranchJets.Data())); if(fAODExtension&&!aodJets) aodJets = dynamic_cast<TClonesArray*>(fAODExtension->GetAOD()->FindListObject(fBranchJets.Data())); if(!aodJets){ if(fBranchJets.Length())Printf("%s:%d no jet array with name %s in AOD", (char*)__FILE__,__LINE__,fBranchJets.Data()); if(fDebug>2)fAOD->Print(); return 0; } Int_t nJets = 0; for(Int_t ijet=0; ijet<aodJets->GetEntries(); ijet++){ AliAODJet *tmp = dynamic_cast<AliAODJet*>(aodJets->At(ijet)); if(!tmp) continue; if( tmp->Pt() < fJetPtCut ) continue; if( tmp->Eta() < fJetEtaMin || tmp->Eta() > fJetEtaMax)continue; if(fJetRejectType==kReject1Track && tmp->GetRefTracks()->GetEntriesFast()==1)continue;//rejecting 1track jet if... list->Add(tmp); nJets++; }//ij loop list->Sort(); return nJets; } //_________________________________________________________________________________// Int_t AliAnalysisTaskJetProperties::GetListOfJetTracks(TList* list, const AliAODJet* jet) { //this functionality is motivated by AliAnalysisTaskFragmentationFunction if(fDebug > 3) printf("AliAnalysisTaskJetProperties::GetListOfJetTracks() \n"); // list of jet tracks from trackrefs Int_t nTracks = jet->GetRefTracks()->GetEntriesFast(); Int_t NoOfTracks=0; for (Int_t itrack=0; itrack<nTracks; itrack++) { if(fTrackType==kTrackUndef){ if(fDebug>3)Printf("%s:%d unknown track type %d in AOD", (char*)__FILE__,__LINE__,kTrackUndef); return 0; }//if else if(fTrackType == kTrackAOD){ AliAODTrack* trackAod = dynamic_cast<AliAODTrack*>(jet->GetRefTracks()->At(itrack)); if(!trackAod){ AliError("expected ref track not found "); continue; } list->Add(trackAod); NoOfTracks++; }//if else if(fTrackType==kTrackAODMC){ AliAODMCParticle* trackmc = dynamic_cast<AliAODMCParticle*>(jet->GetRefTracks()->At(itrack)); if(!trackmc){ AliError("expected ref trackmc not found "); continue; } list->Add(trackmc); NoOfTracks++; }//if else if (fTrackType==kTrackKine){ AliVParticle* trackkine = dynamic_cast<AliVParticle*>(jet->GetRefTracks()->At(itrack)); if(!trackkine){ AliError("expected ref trackkine not found "); continue; } list->Add(trackkine); NoOfTracks++; }//if }//itrack loop list->Sort(); return NoOfTracks; }//initial loop //_________________________________________________________________________________// void AliAnalysisTaskJetProperties::FillJetProperties(TList *jetlist){ //filling up the histograms jets and tracks inside jet if(fDebug > 2) printf("AliAnalysisTaskJetProperties::FillJetProperties() \n"); for(Int_t iJet=0; iJet < jetlist->GetEntries(); iJet++){ Float_t JetPt;Float_t JetPhi;Float_t JetEta; // Float_t JetE; AliAODJet *jet = dynamic_cast<AliAODJet*>(jetlist->At(iJet)); if(!jet)continue; JetEta = jet->Eta(); JetPhi = jet->Phi(); JetPt = jet->Pt(); // JetE = jet->E(); fh2EtaJet ->Fill(JetPt,JetEta); fh2PhiJet ->Fill(JetPt,JetPhi); fh2PtJet ->Fill(JetPt,JetPt); fh1PtJet ->Fill(JetPt); fTrackListJet->Clear(); Int_t nJT = GetListOfJetTracks(fTrackListJet,jet); Int_t nJetTracks = 0; if(nJT>=0) nJetTracks = fTrackListJet->GetEntries(); if(fDebug>2){ Printf("%s:%d Jet tracks: %d %d",(char*)__FILE__,__LINE__,nJT,nJetTracks); if(nJT != nJetTracks) Printf("%s:%d Mismatch Jet Tracks: %d %d",(char*)__FILE__,__LINE__,nJT,nJetTracks); } fh2NtracksJet ->Fill(JetPt,fTrackListJet->GetEntries()); fProNtracksJet ->Fill(JetPt,fTrackListJet->GetEntries()); for (Int_t j =0; j< fTrackListJet->GetEntries(); j++){ if(fTrackType==kTrackUndef)continue; Float_t TrackEta=-99.0; Float_t TrackPt=-99.0; Float_t TrackPhi=-99.0; Float_t FF=-99.0; Float_t DelEta=-99.0; Float_t DelPhi=-99.0; Float_t DelR=-99.0; // Float_t AreaJ=-99.0; Float_t Ksi=-99.0; if(fTrackType==kTrackAOD){ AliAODTrack *trackaod = dynamic_cast<AliAODTrack*>(fTrackListJet->At(j)); if(!trackaod)continue; TrackEta = trackaod->Eta(); TrackPhi = trackaod->Phi(); TrackPt = trackaod->Pt(); }//if kTrackAOD else if(fTrackType==kTrackAODMC){ AliAODMCParticle* trackmc = dynamic_cast<AliAODMCParticle*>(fTrackListJet->At(j)); if(!trackmc)continue; TrackEta = trackmc->Eta(); TrackPhi = trackmc->Phi(); TrackPt = trackmc->Pt(); }//if kTrackAODMC else if(fTrackType==kTrackKine){ AliVParticle* trackkine = dynamic_cast<AliVParticle*>(fTrackListJet->At(j)); if(!trackkine)continue; TrackEta = trackkine->Eta(); TrackPhi = trackkine->Phi(); TrackPt = trackkine->Pt(); }//kTrackKine if(JetPt)FF = TrackPt/JetPt; if(FF)Ksi = TMath::Log(1./FF); DelEta = TMath::Abs(JetEta - TrackEta); DelPhi = TMath::Abs(JetPhi - TrackPhi); if(DelPhi>TMath::Pi())DelPhi = TMath::Abs(DelPhi-TMath::TwoPi()); DelR = TMath::Sqrt(DelEta*DelEta + DelPhi*DelPhi); // AreaJ = TMath::Pi()*DelR*DelR; fh2EtaTrack ->Fill(JetPt,TrackEta); fh2PhiTrack ->Fill(JetPt,TrackPhi); fh2PtTrack ->Fill(JetPt,TrackPt); fh2FF ->Fill(JetPt,FF); fh2Ksi ->Fill(JetPt,Ksi); fh2DelEta ->Fill(JetPt,DelEta); fh2DelPhi ->Fill(JetPt,DelPhi); fh2DelR ->Fill(JetPt,DelR); }//track loop fTrackListJet->Clear(); }//iJet loop }//FillJetProperties //_________________________________________________________________________________// void AliAnalysisTaskJetProperties::FillFFCorr(TList *jetlist){ //filling up the histograms jets and tracks inside jet if(fDebug > 2) printf("AliAnalysisTaskJetProperties::FillFFCorr() \n"); for(Int_t iJet=0; iJet < jetlist->GetEntries(); iJet++){ Float_t JetPt;Float_t JetTheta; AliAODJet *jet = dynamic_cast<AliAODJet*>(jetlist->At(iJet)); if(!jet)continue; JetTheta = jet->Theta(); JetPt = jet->Pt(); fh1CorrJetPt -> Fill(JetPt); fTrackListJet->Clear(); Int_t nJT = GetListOfJetTracks(fTrackListJet,jet); Int_t nJetTracks = 0; if(nJT>=0) nJetTracks = fTrackListJet->GetEntries(); if(fDebug>2){ Printf("%s:%d Jet tracks: %d %d",(char*)__FILE__,__LINE__,nJT,nJetTracks); if(nJT != nJetTracks) Printf("%s:%d Mismatch Jet Tracks: %d %d",(char*)__FILE__,__LINE__,nJT,nJetTracks); }//fDebug Float_t TotPt = 0.; for (Int_t j =0; j< fTrackListJet->GetEntries(); j++){ if(fTrackType==kTrackUndef)continue; Float_t TrackPt1=-99.0; Float_t TrackPt2=-99.0; Float_t FF1=-99.0; Float_t FF2=-99.0; Float_t Ksi1=-99.0; Float_t Ksi2=-99.0; Float_t TrackTheta1=0.0; Float_t TrackTheta2=0.0; Float_t DelTheta1=0.0; Float_t DelTheta2=0.0; Float_t jT1=-99.0; Float_t jT2=-99.0; if(fTrackType==kTrackAOD){ AliAODTrack *trackaod = dynamic_cast<AliAODTrack*>(fTrackListJet->At(j)); if(!trackaod)continue; TrackTheta1 = trackaod->Theta(); TrackPt1 = trackaod->Pt(); }//if kTrackAOD else if(fTrackType==kTrackAODMC){ AliAODMCParticle* trackmc = dynamic_cast<AliAODMCParticle*>(fTrackListJet->At(j)); if(!trackmc)continue; TrackTheta1 = trackmc->Theta(); TrackPt1 = trackmc->Pt(); }//if kTrackAODMC else if(fTrackType==kTrackKine){ AliVParticle* trackkine = dynamic_cast<AliVParticle*>(fTrackListJet->At(j)); if(!trackkine)continue; TrackTheta1 = trackkine->Theta(); TrackPt1 = trackkine->Pt(); }//kTrackKine TotPt += TrackPt1; if(JetPt)FF1 = TrackPt1/JetPt; if(FF1)Ksi1 = TMath::Log(1./FF1); DelTheta1 = TMath::Abs(JetTheta - TrackTheta1); jT1 = TrackPt1 * TMath::Sin(DelTheta1); fh2CorrPtTrack1 ->Fill(JetPt,TrackPt1); fh2CorrFF1 ->Fill(JetPt,FF1); fh2CorrKsi1 ->Fill(JetPt,Ksi1); fh2CorrjT1 ->Fill(JetPt,jT1); for (Int_t jj =j+1; jj< fTrackListJet->GetEntries(); jj++){ if(fTrackType==kTrackUndef)continue; if(fTrackType==kTrackAOD){ AliAODTrack *trackaod2 = dynamic_cast<AliAODTrack*>(fTrackListJet->At(jj)); if(!trackaod2)continue; TrackTheta2 = trackaod2->Theta(); TrackPt2 = trackaod2->Pt(); }//if kTrackAOD else if(fTrackType==kTrackAODMC){ AliAODMCParticle* trackmc2 = dynamic_cast<AliAODMCParticle*>(fTrackListJet->At(jj)); if(!trackmc2)continue; TrackTheta2 = trackmc2->Theta(); TrackPt2 = trackmc2->Pt(); }//if kTrackAODMC else if(fTrackType==kTrackKine){ AliVParticle* trackkine2 = dynamic_cast<AliVParticle*>(fTrackListJet->At(jj)); if(!trackkine2)continue; TrackTheta2 = trackkine2->Theta(); TrackPt2 = trackkine2->Pt(); }//kTrackKine if(JetPt)FF2 = TrackPt2/JetPt; if(FF2)Ksi2 = TMath::Log(1./FF2); DelTheta2 = TMath::Abs(JetTheta - TrackTheta2); jT2 = TrackPt2 * TMath::Sin(DelTheta2); Float_t ptmin=10.; Float_t ptmax=20.0; for(Int_t iBin=0; iBin<6; iBin++){ if(iBin == 0)ptmin=10.; ptmax=20.; if(iBin == 1)ptmin=20.; ptmax=30.; if(iBin == 2)ptmin=30.; ptmax=40.; if(iBin == 3)ptmin=40.; ptmax=60.; if(iBin == 4)ptmin=60.; ptmax=80.; if(iBin == 5)ptmin=80.; ptmax=100.; if(JetPt>ptmin && JetPt <= ptmax){ fh2CorrPt1Pt2[iBin] ->Fill(TrackPt1,TrackPt2); fh2CorrZ1Z2[iBin] ->Fill(FF1,FF2); fh2CorrKsi1Ksi2[iBin]->Fill(Ksi1,Ksi2); fh2CorrjT1jT2[iBin] ->Fill(jT1,jT2); }//if loop }//iBin loop }//inside track loop }//outer track loop Float_t diff_JetPt_TrkPtSum = JetPt - TotPt; fh1JetPtvsTrkSum->Fill(diff_JetPt_TrkPtSum); TotPt = 0.; fTrackListJet->Clear(); }//iJet loop }//FillFFCorr //_________________________________________________________________________________// void AliAnalysisTaskJetProperties::FillJetShape(TList *jetlist){ //filling up the histograms if(fDebug > 2) printf("AliAnalysisTaskJetProperties::FillJetShape() \n"); Float_t JetEta; Float_t JetPhi; Float_t JetPt; AliAODJet *jet = dynamic_cast<AliAODJet*>(jetlist->At(0));//Leading jet only if(jet){ JetEta = jet->Eta(); JetPhi = jet->Phi(); JetPt = jet->Pt(); fh1PtLeadingJet->Fill(JetPt); Float_t NchSumA[50] = {0.}; Float_t PtSumA[50] = {0.}; Float_t delRPtSum80pc = 0; Float_t delRNtrkSum80pc = 0; Float_t PtSumDiffShape[10] = {0.0}; Float_t PtSumIntShape[10] = {0.0}; Int_t kNbinsR = 10; fTrackListJet->Clear(); Int_t nJT = GetListOfJetTracks(fTrackListJet,jet); Int_t nJetTracks = 0; if(nJT>=0) nJetTracks = fTrackListJet->GetEntries(); if(fDebug>3){ Printf("%s:%d Jet tracks: %d %d",(char*)__FILE__,__LINE__,nJT,nJetTracks); if(nJT != nJetTracks) Printf("%s:%d Mismatch Jet Tracks: %d %d",(char*)__FILE__,__LINE__,nJT,nJetTracks); } fh2NtracksLeadingJet->Fill(JetPt,nJetTracks); fProNtracksLeadingJet->Fill(JetPt,nJetTracks); Int_t *index = new Int_t [nJetTracks];//dynamic array containing index Float_t *delRA = new Float_t [nJetTracks];//dynamic array containing delR Float_t *delEtaA = new Float_t [nJetTracks];//dynamic array containing delEta Float_t *delPhiA = new Float_t [nJetTracks];//dynamic array containing delPhi Float_t *trackPtA = new Float_t [nJetTracks];//dynamic array containing pt-track Float_t *trackEtaA = new Float_t [nJetTracks];//dynamic array containing eta-track Float_t *trackPhiA = new Float_t [nJetTracks];//dynamic array containing phi-track for(Int_t ii=0; ii<nJetTracks; ii++){ index[ii] = 0; delRA[ii] = 0.; delEtaA[ii] = 0.; delPhiA[ii] = 0.; trackPtA[ii] = 0.; trackEtaA[ii] = 0.; trackPhiA[ii] = 0.; }//ii loop for (Int_t j =0; j< nJetTracks; j++){ if(fTrackType==kTrackUndef)continue; Float_t TrackEta=-99.0; Float_t TrackPt=-99.0; Float_t TrackPhi=-99.0; Float_t DelEta=-99.0; Float_t DelPhi=-99.0; Float_t DelR=-99.0; Float_t AreaJ=-99.0; if(fTrackType==kTrackAOD){ AliAODTrack *trackaod = dynamic_cast<AliAODTrack*>(fTrackListJet->At(j)); if(!trackaod)continue; TrackEta = trackaod->Eta(); TrackPhi = trackaod->Phi(); TrackPt = trackaod->Pt(); }//if kTrackAOD else if(fTrackType==kTrackAODMC){ AliAODMCParticle* trackmc = dynamic_cast<AliAODMCParticle*>(fTrackListJet->At(j)); if(!trackmc)continue; TrackEta = trackmc->Eta(); TrackPhi = trackmc->Phi(); TrackPt = trackmc->Pt(); }//if kTrackAODMC else if(fTrackType==kTrackKine){ AliVParticle* trackkine = dynamic_cast<AliVParticle*>(fTrackListJet->At(j)); if(!trackkine)continue; TrackEta = trackkine->Eta(); TrackPhi = trackkine->Phi(); TrackPt = trackkine->Pt(); }//if kTrackKine DelEta = TMath::Abs(JetEta - TrackEta); DelPhi = TMath::Abs(JetPhi - TrackPhi); if(DelPhi>TMath::Pi())DelPhi = TMath::Abs(DelPhi-TMath::TwoPi()); DelR = TMath::Sqrt(DelEta*DelEta + DelPhi*DelPhi); AreaJ = TMath::Pi()*DelR*DelR; fh2AreaCh ->Fill(JetPt,AreaJ); fProAreaCh->Fill(JetPt,AreaJ); delRA[j] = DelR; delEtaA[j] = DelEta; delPhiA[j] = DelPhi; trackPtA[j] = TrackPt; trackEtaA[j] = TrackEta; trackPhiA[j] = TrackPhi; //calculating diff and integrated jet shapes Float_t kDeltaR = 0.1; Float_t RMin = kDeltaR/2.0; Float_t RMax = kDeltaR/2.0; Float_t tmpR = 0.05; for(Int_t ii1=0; ii1<kNbinsR;ii1++){ if((DelR > (tmpR-RMin)) && (DelR <=(tmpR+RMax)))PtSumDiffShape[ii1]+= TrackPt; if(DelR>0.0 && DelR <=(tmpR+RMax))PtSumIntShape[ii1]+= TrackPt; tmpR += 0.1; }//ii1 loop for(Int_t ibin=1; ibin<=50; ibin++){ Float_t xlow = 0.02*(ibin-1); Float_t xup = 0.02*ibin; if( xlow <= DelR && DelR < xup){ NchSumA[ibin-1]++; PtSumA[ibin-1]+= TrackPt; }//if loop }//for ibin loop }//track loop fTrackListJet->Clear(); //--------------------- Float_t tmp1R = 0.05; for(Int_t jj1=0; jj1<kNbinsR;jj1++){ if(JetPt>20 && JetPt<=100){ fProDiffJetShape->Fill(tmp1R,PtSumDiffShape[jj1]/JetPt); fProIntJetShape ->Fill(tmp1R,PtSumIntShape[jj1]/JetPt); } Float_t jetPtMin0=20.0; Float_t jetPtMax0=30.0; for(Int_t k=0; k<13; k++){ if(k==0) {jetPtMin0=20.0;jetPtMax0=25.0;} if(k==1) {jetPtMin0=25.0;jetPtMax0=30.0;} if(k==2) {jetPtMin0=20.0;jetPtMax0=30.0;} if(k==3) {jetPtMin0=30.0;jetPtMax0=35.0;} if(k==4) {jetPtMin0=35.0;jetPtMax0=40.0;} if(k==5) {jetPtMin0=30.0;jetPtMax0=40.0;} if(k==6) {jetPtMin0=40.0;jetPtMax0=50.0;} if(k==7) {jetPtMin0=50.0;jetPtMax0=60.0;} if(k==8) {jetPtMin0=40.0;jetPtMax0=60.0;} if(k==9) {jetPtMin0=60.0;jetPtMax0=70.0;} if(k==10){jetPtMin0=70.0;jetPtMax0=80.0;} if(k==11){jetPtMin0=60.0;jetPtMax0=80.0;} if(k==12){jetPtMin0=80.0;jetPtMax0=100.0;} if(JetPt>jetPtMin0 && JetPt<=jetPtMax0){ fProDiffJetShapeA[k]->Fill(tmp1R,PtSumDiffShape[jj1]/JetPt); fProIntJetShapeA[k] ->Fill(tmp1R,PtSumIntShape[jj1]/JetPt); }//if }//k loop tmp1R +=0.1; }//jj1 loop //----------------------// Float_t PtSum = 0; Int_t NtrkSum = 0; Bool_t iflagPtSum = kFALSE; Bool_t iflagNtrkSum = kFALSE; TMath::Sort(nJetTracks,delRA,index,0); for(Int_t ii=0; ii<nJetTracks; ii++){ NtrkSum ++; PtSum += trackPtA[index[ii]]; /* cout << index[ii] << "\t" << delR[ii] << "\t" << delEta[ii]<< "\t" << delPhi[ii]<< "\t" << trackPt[ii]<< "\t" << trackEta[ii]<< "\t" << trackPhi[ii]<< "\t DelR " << delR[index[ii]] << endl; */ if(!iflagNtrkSum){ if((Float_t)NtrkSum/(Float_t)nJetTracks > 0.79){ delRNtrkSum80pc = delRA[index[ii]]; iflagNtrkSum = kTRUE; }//if NtrkSum }//if iflag if(!iflagPtSum){ if(PtSum/JetPt >= 0.8000){ delRPtSum80pc = delRA[index[ii]]; iflagPtSum = kTRUE; }//if PtSum }//if iflag }//track loop 2nd delete [] index; delete [] delRA; delete [] delEtaA; delete [] delPhiA; delete [] trackPtA; delete [] trackEtaA; delete [] trackPhiA; fh2DelR80pcNch ->Fill(JetPt,delRNtrkSum80pc); fProDelR80pcNch->Fill(JetPt,delRNtrkSum80pc); fh2DelR80pcPt ->Fill(JetPt,delRPtSum80pc); fProDelR80pcPt ->Fill(JetPt,delRPtSum80pc); for(Int_t ibin=0; ibin<50; ibin++){ Float_t iR = 0.02*ibin + 0.01; fh3PtDelRNchSum->Fill(JetPt,iR,NchSumA[ibin]); fh3PtDelRPtSum ->Fill(JetPt,iR,PtSumA[ibin]); Float_t jetPtMin=20.0; Float_t jetPtMax=30.0; for(Int_t k=0; k<13; k++){ if(k==0) {jetPtMin=20.0;jetPtMax=25.0;} if(k==1) {jetPtMin=25.0;jetPtMax=30.0;} if(k==2) {jetPtMin=20.0;jetPtMax=30.0;} if(k==3) {jetPtMin=30.0;jetPtMax=35.0;} if(k==4) {jetPtMin=35.0;jetPtMax=40.0;} if(k==5) {jetPtMin=30.0;jetPtMax=40.0;} if(k==6) {jetPtMin=40.0;jetPtMax=50.0;} if(k==7) {jetPtMin=50.0;jetPtMax=60.0;} if(k==8) {jetPtMin=40.0;jetPtMax=60.0;} if(k==9) {jetPtMin=60.0;jetPtMax=70.0;} if(k==10){jetPtMin=70.0;jetPtMax=80.0;} if(k==11){jetPtMin=60.0;jetPtMax=80.0;} if(k==12){jetPtMin=80.0;jetPtMax=100.0;} if(JetPt>jetPtMin && JetPt<jetPtMax){ fProDelRNchSum[k]->Fill(iR,NchSumA[ibin]); fProDelRPtSum[k]->Fill(iR,PtSumA[ibin]); }//if }//k loop }//ibin loop }//if(jet) }//FillJetShape() //_________________________________________________________________________________// void AliAnalysisTaskJetProperties::FillJetShapeUE(TList *jetlist){ //filling up the histograms if(fDebug > 2) printf("AliAnalysisTaskJetProperties::FillJetShape() \n"); AliAODJet *jet = dynamic_cast<AliAODJet*>(jetlist->At(0));//Leading jet only if(jet){ Double_t jetMom[3]; jet->PxPyPz(jetMom); TVector3 jet3mom(jetMom); // Rotate phi and keep eta unchanged const Double_t alpha = TMath::Pi()/2.; Double_t etaTilted = jet3mom.Eta(); Double_t phiTilted = TVector2::Phi_0_2pi(jet3mom.Phi()) + alpha; if(phiTilted > 2*TMath::Pi()) phiTilted = phiTilted - 2*TMath::Pi(); Double_t JetPt = jet->Pt(); Float_t NchSumA[50] = {0.}; Float_t PtSumA[50] = {0.}; Float_t delRPtSum80pc = 0; Float_t delRNtrkSum80pc = 0; Float_t PtSumDiffShape[10] = {0.0}; Float_t PtSumIntShape[10] = {0.0}; Int_t kNbinsR = 10; //Int_t nTracks = GetListOfTracks(fTrackList,fTrackType); fTrackList->Clear(); GetListOfTracks(fTrackList,fTrackType); Double_t sumPtPerp = 0; //if(fDebug > 100) printf("Cone radius for bckg. = %f Track type = %d\n",fJetRadius, fTrackType); fTrackListUE->Clear(); GetTracksTiltedwrpJetAxis(alpha, fTrackList, fTrackListUE,jet,fJetRadius,sumPtPerp); fTrackList->Clear(); fh1PtSumInJetConeUE->Fill(sumPtPerp); Int_t nTracksUE = fTrackListUE->GetEntries(); fh2NtracksLeadingJetUE->Fill(JetPt,nTracksUE); fProNtracksLeadingJetUE->Fill(JetPt,nTracksUE); Int_t *index = new Int_t [nTracksUE];//dynamic array containing index Float_t *delRA = new Float_t [nTracksUE];//dynamic array containing delR Float_t *delEtaA = new Float_t [nTracksUE];//dynamic array containing delEta Float_t *delPhiA = new Float_t [nTracksUE];//dynamic array containing delPhi Float_t *trackPtA = new Float_t [nTracksUE];//dynamic array containing pt-track Float_t *trackEtaA = new Float_t [nTracksUE];//dynamic array containing eta-track Float_t *trackPhiA = new Float_t [nTracksUE];//dynamic array containing phi-track for(Int_t ii=0; ii<nTracksUE; ii++){ index[ii] = 0; delRA[ii] = 0.; delEtaA[ii] = 0.; delPhiA[ii] = 0.; trackPtA[ii] = 0.; trackEtaA[ii] = 0.; trackPhiA[ii] = 0.; }//ii loop for (Int_t j =0; j< nTracksUE; j++){ if(fTrackType==kTrackUndef)continue; Float_t TrackEta=-99.0; Float_t TrackPt=-99.0; Float_t TrackPhi=-99.0; Float_t DelEta=-99.0; Float_t DelPhi=-99.0; Float_t DelR=-99.0; Float_t AreaJ=-99.0; if(fTrackType==kTrackAOD){ AliAODTrack *trackaod = dynamic_cast<AliAODTrack*>(fTrackListUE->At(j)); if(!trackaod)continue; TrackEta = trackaod->Eta(); TrackPhi = trackaod->Phi(); TrackPt = trackaod->Pt(); //if(fDebug > 100) printf("FillJetShapeUE itrack, trackPt %d, %f\n",j,TrackPt); }//if kTrackAOD else if(fTrackType==kTrackAODMC){ AliAODMCParticle* trackmc = dynamic_cast<AliAODMCParticle*>(fTrackListUE->At(j)); if(!trackmc)continue; TrackEta = trackmc->Eta(); TrackPhi = trackmc->Phi(); TrackPt = trackmc->Pt(); //if(fDebug > 100) printf("FillJetShapeUE itrack, trackPt %d, %f\n",j,TrackPt); }//if kTrackAODMC else if(fTrackType==kTrackKine){ AliVParticle* trackkine = dynamic_cast<AliVParticle*>(fTrackListUE->At(j)); if(!trackkine)continue; TrackEta = trackkine->Eta(); TrackPhi = trackkine->Phi(); TrackPt = trackkine->Pt(); //if(fDebug > 100) printf("FillJetShapeUE itrack, trackPt %d, %f\n",j,TrackPt); }//if kTrackKine DelEta = TMath::Abs(etaTilted - TrackEta); DelPhi = TMath::Abs(phiTilted - TrackPhi); if(DelPhi>TMath::Pi())DelPhi = TMath::Abs(DelPhi-TMath::TwoPi()); DelR = TMath::Sqrt(DelEta*DelEta + DelPhi*DelPhi); AreaJ = TMath::Pi()*DelR*DelR; fh2AreaChUE ->Fill(JetPt,AreaJ); fProAreaChUE->Fill(JetPt,AreaJ); delRA[j] = DelR; delEtaA[j] = DelEta; delPhiA[j] = DelPhi; trackPtA[j] = TrackPt; trackEtaA[j] = TrackEta; trackPhiA[j] = TrackPhi; //calculating diff and integrated jet shapes Float_t kDeltaR = 0.1; Float_t RMin = kDeltaR/2.0; Float_t RMax = kDeltaR/2.0; Float_t tmpR = 0.05; for(Int_t ii1=0; ii1<kNbinsR;ii1++){ if((DelR > (tmpR-RMin)) && (DelR <=(tmpR+RMax)))PtSumDiffShape[ii1]+= TrackPt; if(DelR>0.0 && DelR <=(tmpR+RMax))PtSumIntShape[ii1]+= TrackPt; tmpR += 0.1; }//ii1 loop for(Int_t ibin=1; ibin<=50; ibin++){ Float_t xlow = 0.02*(ibin-1); Float_t xup = 0.02*ibin; if( xlow <= DelR && DelR < xup){ NchSumA[ibin-1]++; PtSumA[ibin-1]+= TrackPt; }//if loop }//for ibin loop }//track loop fTrackListUE->Clear(); //--------------------- Float_t tmp1R = 0.05; for(Int_t jj1=0; jj1<kNbinsR;jj1++){ if(JetPt>20 && JetPt<=100){ fProDiffJetShapeUE->Fill(tmp1R,PtSumDiffShape[jj1]/JetPt); fProIntJetShapeUE ->Fill(tmp1R,PtSumIntShape[jj1]/JetPt); } Float_t jetPtMin0=20.0; Float_t jetPtMax0=30.0; for(Int_t k=0; k<13; k++){ if(k==0) {jetPtMin0=20.0;jetPtMax0=25.0;} if(k==1) {jetPtMin0=25.0;jetPtMax0=30.0;} if(k==2) {jetPtMin0=20.0;jetPtMax0=30.0;} if(k==3) {jetPtMin0=30.0;jetPtMax0=35.0;} if(k==4) {jetPtMin0=35.0;jetPtMax0=40.0;} if(k==5) {jetPtMin0=30.0;jetPtMax0=40.0;} if(k==6) {jetPtMin0=40.0;jetPtMax0=50.0;} if(k==7) {jetPtMin0=50.0;jetPtMax0=60.0;} if(k==8) {jetPtMin0=40.0;jetPtMax0=60.0;} if(k==9) {jetPtMin0=60.0;jetPtMax0=70.0;} if(k==10){jetPtMin0=70.0;jetPtMax0=80.0;} if(k==11){jetPtMin0=60.0;jetPtMax0=80.0;} if(k==12){jetPtMin0=80.0;jetPtMax0=100.0;} if(JetPt>jetPtMin0 && JetPt<=jetPtMax0){ fProDiffJetShapeAUE[k]->Fill(tmp1R,PtSumDiffShape[jj1]/JetPt); fProIntJetShapeAUE[k] ->Fill(tmp1R,PtSumIntShape[jj1]/JetPt); }//if }//k loop tmp1R +=0.1; }//jj1 loop //----------------------// Float_t PtSum = 0; Int_t NtrkSum = 0; Bool_t iflagPtSum = kFALSE; Bool_t iflagNtrkSum = kFALSE; TMath::Sort(nTracksUE,delRA,index,0); for(Int_t ii=0; ii<nTracksUE; ii++){ NtrkSum ++; PtSum += trackPtA[index[ii]]; /* cout << index[ii] << "\t" << delR[ii] << "\t" << delEta[ii]<< "\t" << delPhi[ii]<< "\t" << trackPt[ii]<< "\t" << trackEta[ii]<< "\t" << trackPhi[ii]<< "\t DelR " << delR[index[ii]] << endl; */ if(!iflagNtrkSum){ if((Float_t)NtrkSum/(Float_t)nTracksUE > 0.79){ delRNtrkSum80pc = delRA[index[ii]]; iflagNtrkSum = kTRUE; }//if NtrkSum }//if iflag if(!iflagPtSum){ if(PtSum/JetPt >= 0.8000){ delRPtSum80pc = delRA[index[ii]]; iflagPtSum = kTRUE; }//if PtSum }//if iflag }//track loop 2nd delete [] index; delete [] delRA; delete [] delEtaA; delete [] delPhiA; delete [] trackPtA; delete [] trackEtaA; delete [] trackPhiA; fh2DelR80pcNchUE ->Fill(JetPt,delRNtrkSum80pc); fProDelR80pcNchUE->Fill(JetPt,delRNtrkSum80pc); fh2DelR80pcPtUE ->Fill(JetPt,delRPtSum80pc); fProDelR80pcPtUE ->Fill(JetPt,delRPtSum80pc); for(Int_t ibin=0; ibin<50; ibin++){ Float_t iR = 0.02*ibin + 0.01; fh3PtDelRNchSumUE->Fill(JetPt,iR,NchSumA[ibin]); fh3PtDelRPtSumUE ->Fill(JetPt,iR,PtSumA[ibin]); Float_t jetPtMin=20.0; Float_t jetPtMax=30.0; for(Int_t k=0; k<13; k++){ if(k==0) {jetPtMin=20.0;jetPtMax=25.0;} if(k==1) {jetPtMin=25.0;jetPtMax=30.0;} if(k==2) {jetPtMin=20.0;jetPtMax=30.0;} if(k==3) {jetPtMin=30.0;jetPtMax=35.0;} if(k==4) {jetPtMin=35.0;jetPtMax=40.0;} if(k==5) {jetPtMin=30.0;jetPtMax=40.0;} if(k==6) {jetPtMin=40.0;jetPtMax=50.0;} if(k==7) {jetPtMin=50.0;jetPtMax=60.0;} if(k==8) {jetPtMin=40.0;jetPtMax=60.0;} if(k==9) {jetPtMin=60.0;jetPtMax=70.0;} if(k==10){jetPtMin=70.0;jetPtMax=80.0;} if(k==11){jetPtMin=60.0;jetPtMax=80.0;} if(k==12){jetPtMin=80.0;jetPtMax=100.0;} if(JetPt>jetPtMin && JetPt<jetPtMax){ fProDelRNchSumUE[k]->Fill(iR,NchSumA[ibin]); fProDelRPtSumUE[k]->Fill(iR,PtSumA[ibin]); }//if }//k loop }//ibin loop }//if(jet) }//FillJetShapeUE() //_________________________________________________________________________________// void AliAnalysisTaskJetProperties::GetTracksTiltedwrpJetAxis(Float_t alpha, TList* inputlist, TList* outputlist, const AliAODJet* jet, Double_t radius,Double_t& sumPt){ //This part is inherited from AliAnalysisTaskFragmentationFunction.cxx // List of tracks in cone perpendicular to the jet azimuthal direction Double_t jetMom[3]; jet->PxPyPz(jetMom); TVector3 jet3mom(jetMom); // Rotate phi and keep eta unchanged Double_t etaTilted = jet3mom.Eta();//no change in eta Double_t phiTilted = TVector2::Phi_0_2pi(jet3mom.Phi()) + alpha;//rotate phi by alpha if(phiTilted > 2*TMath::Pi()) phiTilted = phiTilted - 2*TMath::Pi(); for (Int_t itrack=0; itrack<inputlist->GetSize(); itrack++){ if(fTrackType==kTrackUndef)continue; Double_t trackMom[3]; if(fTrackType==kTrackAOD){ AliAODTrack *trackaod = dynamic_cast<AliAODTrack*>(inputlist->At(itrack)); if(!trackaod)continue; trackaod->PxPyPz(trackMom); TVector3 track3mom(trackMom); Double_t deta = track3mom.Eta() - etaTilted; Double_t dphi = TMath::Abs(track3mom.Phi() - phiTilted); if (dphi > TMath::Pi()) dphi = 2. * TMath::Pi() - dphi; Double_t dR = TMath::Sqrt(deta * deta + dphi * dphi); if(dR<=radius){ outputlist->Add(trackaod); sumPt += trackaod->Pt(); //if(fDebug > 100) printf("GetTracksTiltewrpJetAxis itrack, trackPt %d, %f\n",itrack,track3mom.Pt()); }//if dR<=radius }//if kTrackAOD else if(fTrackType==kTrackAODMC){ AliAODMCParticle* trackmc = dynamic_cast<AliAODMCParticle*>(inputlist->At(itrack)); if(!trackmc)continue; trackmc->PxPyPz(trackMom); TVector3 track3mom(trackMom); Double_t deta = track3mom.Eta() - etaTilted; Double_t dphi = TMath::Abs(track3mom.Phi() - phiTilted); if (dphi > TMath::Pi()) dphi = 2. * TMath::Pi() - dphi; Double_t dR = TMath::Sqrt(deta * deta + dphi * dphi); if(dR<=radius){ outputlist->Add(trackmc); sumPt += trackmc->Pt(); //if(fDebug > 100) printf("GetTracksTiltewrpJetAxis itrack, trackPt %d, %f\n",itrack,track3mom.Pt()); }//if dR<=radius }//if kTrackAODMC else if(fTrackType==kTrackKine){ AliVParticle* trackkine = dynamic_cast<AliVParticle*>(inputlist->At(itrack)); if(!trackkine)continue; trackkine->PxPyPz(trackMom); TVector3 track3mom(trackMom); Double_t deta = track3mom.Eta() - etaTilted; Double_t dphi = TMath::Abs(track3mom.Phi() - phiTilted); if (dphi > TMath::Pi()) dphi = 2. * TMath::Pi() - dphi; Double_t dR = TMath::Sqrt(deta * deta + dphi * dphi); if(dR<=radius){ outputlist->Add(trackkine); sumPt += trackkine->Pt(); //if(fDebug > 100) printf("GetTracksTiltewrpJetAxis itrack, trackPt %d, %f\n",itrack,track3mom.Pt()); }//if dR<=radius }//kTrackKine }//itrack }//initial loop //-----------------------------------------------// Int_t AliAnalysisTaskJetProperties::GetListOfTracks(TList *list, Int_t type) { //This part is inherited from AliAnalysisTaskFragmentationFunction.cxx (and modified) // fill list of tracks selected according to type if(fDebug > 3) Printf("%s:%d Selecting tracks with %d", (char*)__FILE__,__LINE__,type); if(!list){ if(fDebug>3) Printf("%s:%d no input list", (char*)__FILE__,__LINE__); return -1; } if(!fAOD) return -1; if(!fAOD->GetTracks()) return 0; if(type==kTrackUndef) return 0; Int_t iCount = 0; if(type==kTrackAOD){ // all rec. tracks, esd filter mask, within acceptance for(Int_t it=0; it<fAOD->GetNumberOfTracks(); ++it){ AliAODTrack *tr = dynamic_cast<AliAODTrack*>(fAOD->GetTrack(it)); if(!tr) AliFatal("Not a standard AOD"); if(!tr)continue; if((fFilterMask>0)&&!(tr->TestFilterBit(fFilterMask)))continue;//selecting filtermask if(tr->Eta() < fTrackEtaMin || tr->Eta() > fTrackEtaMax) continue; if(tr->Pt() < fTrackPtCut) continue; list->Add(tr); iCount++; }//track loop }//if type else if (type==kTrackKine){ // kine particles, primaries, charged only within acceptance if(!fMCEvent) return iCount; for(Int_t it=0; it<fMCEvent->GetNumberOfTracks(); ++it){ if(!fMCEvent->IsPhysicalPrimary(it))continue;//selecting only primaries AliMCParticle* part = (AliMCParticle*) fMCEvent->GetTrack(it); if(!part)continue; if(part->Particle()->GetPDG()->Charge()==0)continue;//removing neutrals if(part->Eta() < fTrackEtaMin || part->Eta() > fTrackEtaMax) continue;//eta cut if(part->Pt() < fTrackPtCut)continue;//pt cut list->Add(part); iCount++; }//track loop }//if type else if (type==kTrackAODMC) { // MC particles (from AOD), physical primaries, charged only within acceptance if(!fAOD) return -1; TClonesArray *tca = dynamic_cast<TClonesArray*>(fAOD->FindListObject(AliAODMCParticle::StdBranchName())); if(!tca)return iCount; for(int it=0; it<tca->GetEntriesFast(); ++it){ AliAODMCParticle *part = dynamic_cast<AliAODMCParticle*>(tca->At(it)); if(!part)continue; if(!part->IsPhysicalPrimary())continue; if(part->Charge()==0) continue; if(part->Eta() > fTrackEtaMax || part->Eta() < fTrackEtaMin)continue; if(part->Pt() < fTrackPtCut) continue; list->Add(part); iCount++; }//track loop }//if type list->Sort(); return iCount; } //_______________________________________________________________________________
39.156337
168
0.652227
maroozm
4e07ffded9aab7c634229dcf72f6f1acfc7061d6
403
cpp
C++
Applications/calculator/main.cpp
Butterzz1288/ButterOS
4faee625eba83bd22bc8d180e0c4136f543c3404
[ "BSD-2-Clause" ]
5
2021-11-25T10:53:24.000Z
2022-03-31T08:17:45.000Z
Applications/calculator/main.cpp
Butterzz1288/ButterOS
4faee625eba83bd22bc8d180e0c4136f543c3404
[ "BSD-2-Clause" ]
null
null
null
Applications/calculator/main.cpp
Butterzz1288/ButterOS
4faee625eba83bd22bc8d180e0c4136f543c3404
[ "BSD-2-Clause" ]
null
null
null
#include <Lemon/GUI/Window.h> #include <Lemon/GUI/Messagebox.h> #include <Lemon/System/Spawn.h> Lemon::GUI::Window* window; window = new Lemon::GUI::Window("Addition", {600, 348}, WINDOW_FLAGS_RESIZABLE, Lemon::GUI::WindowType::GUI); box = new Lemon::GUI::textInput("Input 1") box = new Lemon::GUI::textInput("Input 2") type RES == Lemon::GUI::textInput("Input 1") + Lemon::GUI::textInput("Input 2")
36.636364
109
0.702233
Butterzz1288
4e0e0a55682db38fc988fc71a7b830d5ba500dd4
9,786
cpp
C++
speedcc/lua-support/src/native/SCLuaRegisterSCDateTimeDate.cpp
kevinwu1024/SpeedCC
7b32e3444236d8aebf8198ebc3fede8faf201dee
[ "MIT" ]
7
2018-03-10T02:01:49.000Z
2021-09-14T15:42:10.000Z
speedcc/lua-support/src/native/SCLuaRegisterSCDateTimeDate.cpp
kevinwu1024/SpeedCC
7b32e3444236d8aebf8198ebc3fede8faf201dee
[ "MIT" ]
null
null
null
speedcc/lua-support/src/native/SCLuaRegisterSCDateTimeDate.cpp
kevinwu1024/SpeedCC
7b32e3444236d8aebf8198ebc3fede8faf201dee
[ "MIT" ]
1
2018-03-10T02:01:58.000Z
2018-03-10T02:01:58.000Z
/**************************************************************************** Copyright (c) 2017-2020 Kevin Wu (Wu Feng) github: http://github.com/kevinwu1024 Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://opensource.org/licenses/MIT 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 NON INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ #include "platform/CCPlatformConfig.h" #include "../../../base/SCDateTime.h" #include "../../../base/SCString.h" #include "scripting/lua-bindings/manual/CCComponentLua.h" #include "scripting/lua-bindings/manual/tolua_fix.h" #include "scripting/lua-bindings/manual/LuaBasicConversions.h" #include "SCLuaUtils.h" NAMESPACE_SPEEDCC_BEGIN #define SCLUA_MODULE "Date" #define SCLUA_CLASSTYPE_LUA "sc.SCDateTime." SCLUA_MODULE #define SCLUA_CLASSTYPE_CPP SCDateTime::Date #define SCLUA_MODULE_BASE "" #ifdef __cplusplus extern "C" { #endif SCLUA_SCCREATE_FUNC_IMPLEMENT(SCDateTimeDate) SCLUA_SCCLONE_FUNC_IMPLEMENT(SCDateTimeDate) int lua_speedcc_SCDateTimeDate_createYMD(lua_State* tolua_S) { SCLUA_CHECK_LUA_TABLE(tolua_S); auto nArgc = lua_gettop(tolua_S) - 1; if (nArgc == 3) { int arg0,arg1,arg2; bool ok = true; ok = luaval_to_int32(tolua_S, 2, &arg0, "sc.SCDateTime.Date:createYMD"); SCLUA_CHECK_LUA_ARG(tolua_S, ok); ok = luaval_to_int32(tolua_S, 3, &arg1, "sc.SCDateTime.Date:createYMD"); SCLUA_CHECK_LUA_ARG(tolua_S, ok); ok = luaval_to_int32(tolua_S, 4, &arg2, "sc.SCDateTime.Date:createYMD"); SCLUA_CHECK_LUA_ARG(tolua_S, ok); auto obj = SCMemAllocator::newObject<SCLUA_CLASSTYPE_CPP>(arg0, arg1, arg2); tolua_pushusertype_and_takeownership(tolua_S, (void*)obj, SCLUA_CLASSTYPE_LUA); return 1; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", SCLUA_CLASSTYPE_LUA, nArgc, 3); return 0; } int lua_speedcc_SCDateTimeDate_createWithJD(lua_State* tolua_S) { SCLUA_CHECK_LUA_TABLE(tolua_S); auto nArgc = lua_gettop(tolua_S) - 1; if (nArgc == 1) { INT64 arg0; bool ok = true; ok = luaval_to_long_long(tolua_S, 2, &arg0, "sc.SCDateTime.Date:createWithJD"); SCLUA_CHECK_LUA_ARG(tolua_S, ok); auto obj = SCMemAllocator::newObject<SCLUA_CLASSTYPE_CPP>(arg0); tolua_pushusertype_and_takeownership(tolua_S, (void*)obj, SCLUA_CLASSTYPE_LUA); return 1; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", SCLUA_CLASSTYPE_LUA, nArgc, 1); return 0; } int lua_speedcc_SCDateTimeDate_isValid(lua_State* tolua_S) { SCLUA_CHECK_LUA_USERTYPE(tolua_S); auto nArgc = lua_gettop(tolua_S) - 1; if (nArgc == 0) { auto pInstance = (SCLUA_CLASSTYPE_CPP*)tolua_tousertype(tolua_S, 1, 0); SCLUA_CHECK_LUA_INSTANCE(tolua_S, pInstance); auto result = pInstance->isValid(); lua_pushboolean(tolua_S, result); return 1; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", SCLUA_CLASSTYPE_LUA, nArgc, 1); return 0; } int lua_speedcc_SCDateTimeDate_getWeekCountOfYear(lua_State* tolua_S) { SCLUA_CHECK_LUA_USERTYPE(tolua_S); auto nArgc = lua_gettop(tolua_S) - 1; if (nArgc == 0) { auto pInstance = (SCLUA_CLASSTYPE_CPP*)tolua_tousertype(tolua_S, 1, 0); SCLUA_CHECK_LUA_INSTANCE(tolua_S, pInstance); auto result = pInstance->getWeekCountOfYear(); lua_pushinteger(tolua_S, result); return 1; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", SCLUA_CLASSTYPE_LUA, nArgc, 1); return 0; } int lua_speedcc_SCDateTimeDate_getDayCountOfMonth(lua_State* tolua_S) { SCLUA_CHECK_LUA_USERTYPE(tolua_S); auto nArgc = lua_gettop(tolua_S) - 1; if (nArgc == 0) { auto pInstance = (SCLUA_CLASSTYPE_CPP*)tolua_tousertype(tolua_S, 1, 0); SCLUA_CHECK_LUA_INSTANCE(tolua_S, pInstance); auto result = pInstance->getDayCountOfMonth(); lua_pushinteger(tolua_S, result); return 1; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", SCLUA_CLASSTYPE_LUA, nArgc, 1); return 0; } int lua_speedcc_SCDateTimeDate_getDayCountOfYear(lua_State* tolua_S) { SCLUA_CHECK_LUA_USERTYPE(tolua_S); auto nArgc = lua_gettop(tolua_S) - 1; if (nArgc == 0) { auto pInstance = (SCLUA_CLASSTYPE_CPP*)tolua_tousertype(tolua_S, 1, 0); SCLUA_CHECK_LUA_INSTANCE(tolua_S, pInstance); auto result = pInstance->getDayCountOfYear(); lua_pushinteger(tolua_S, result); return 1; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", SCLUA_CLASSTYPE_LUA, nArgc, 1); return 0; } int lua_speedcc_SCDateTimeDate_getYear(lua_State* tolua_S) { SCLUA_CHECK_LUA_USERTYPE(tolua_S); auto nArgc = lua_gettop(tolua_S) - 1; if (nArgc == 0) { auto pInstance = (SCLUA_CLASSTYPE_CPP*)tolua_tousertype(tolua_S, 1, 0); SCLUA_CHECK_LUA_INSTANCE(tolua_S, pInstance); lua_pushinteger(tolua_S, pInstance->nYear); return 1; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", SCLUA_CLASSTYPE_LUA, nArgc, 0); return 0; } int lua_speedcc_SCDateTimeDate_setYear(lua_State* tolua_S) { SCLUA_CHECK_LUA_USERTYPE(tolua_S); auto nArgc = lua_gettop(tolua_S) - 1; if (nArgc == 1) { auto pInstance = (SCLUA_CLASSTYPE_CPP*)tolua_tousertype(tolua_S, 1, 0); SCLUA_CHECK_LUA_INSTANCE(tolua_S, pInstance); int arg0; bool ok = true; ok = luaval_to_int32(tolua_S, 2, &arg0, "sc.SCDateTime.Date:createWithJD"); SCLUA_CHECK_LUA_ARG(tolua_S, ok); pInstance->nYear = arg0; lua_pushinteger(tolua_S, arg0); return 1; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", SCLUA_CLASSTYPE_LUA, nArgc, 1); return 0; } int lua_speedcc_SCDateTimeDate_getMonth(lua_State* tolua_S) { SCLUA_CHECK_LUA_USERTYPE(tolua_S); auto nArgc = lua_gettop(tolua_S) - 1; if (nArgc == 1) { auto pInstance = (SCLUA_CLASSTYPE_CPP*)tolua_tousertype(tolua_S, 1, 0); SCLUA_CHECK_LUA_INSTANCE(tolua_S, pInstance); lua_pushinteger(tolua_S, pInstance->nMonth); return 1; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", SCLUA_CLASSTYPE_LUA, nArgc, 1); return 0; } int lua_speedcc_SCDateTimeDate_setMonth(lua_State* tolua_S) { SCLUA_CHECK_LUA_USERTYPE(tolua_S); auto nArgc = lua_gettop(tolua_S) - 1; if (nArgc == 1) { auto pInstance = (SCLUA_CLASSTYPE_CPP*)tolua_tousertype(tolua_S, 1, 0); SCLUA_CHECK_LUA_INSTANCE(tolua_S, pInstance); int arg0; bool ok = true; ok = luaval_to_int32(tolua_S, 2, &arg0, "sc.SCDateTime.Date:createWithJD"); SCLUA_CHECK_LUA_ARG(tolua_S, ok); pInstance->nMonth = arg0; lua_pushinteger(tolua_S, arg0); return 1; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", SCLUA_CLASSTYPE_LUA, nArgc, 1); return 0; } int lua_speedcc_SCDateTimeDate_getDay(lua_State* tolua_S) { SCLUA_CHECK_LUA_USERTYPE(tolua_S); auto nArgc = lua_gettop(tolua_S) - 1; if (nArgc == 1) { auto pInstance = (SCLUA_CLASSTYPE_CPP*)tolua_tousertype(tolua_S, 1, 0); SCLUA_CHECK_LUA_INSTANCE(tolua_S, pInstance); lua_pushinteger(tolua_S, pInstance->nDay); return 1; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", SCLUA_CLASSTYPE_LUA, nArgc, 1); return 0; } int lua_speedcc_SCDateTimeDate_setDay(lua_State* tolua_S) { SCLUA_CHECK_LUA_USERTYPE(tolua_S); auto nArgc = lua_gettop(tolua_S) - 1; if (nArgc == 1) { auto pInstance = (SCLUA_CLASSTYPE_CPP*)tolua_tousertype(tolua_S, 1, 0); SCLUA_CHECK_LUA_INSTANCE(tolua_S, pInstance); int arg0; bool ok = true; ok = luaval_to_int32(tolua_S, 2, &arg0, "sc.SCDateTime.Date:createWithJD"); SCLUA_CHECK_LUA_ARG(tolua_S, ok); pInstance->nDay = arg0; lua_pushinteger(tolua_S, arg0); return 1; } luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d\n ", SCLUA_CLASSTYPE_LUA, nArgc, 1); return 0; } SCLUA_SCDESTRUCT_FUNC_IMPLEMENT(SCDateTimeDate) ///------------ SCDateTime::Date int lua_register_speedcc_SCDateTimeDate(lua_State* tolua_S) { tolua_usertype(tolua_S, SCLUA_CLASSTYPE_LUA); tolua_cclass(tolua_S, SCLUA_MODULE, SCLUA_CLASSTYPE_LUA, SCLUA_MODULE_BASE, lua_speedcc_SCDateTimeDate_destruct); tolua_beginmodule(tolua_S, SCLUA_MODULE); tolua_function(tolua_S, "create", lua_speedcc_SCDateTimeDate_create); tolua_function(tolua_S, "clone", lua_speedcc_SCDateTimeDate_clone); tolua_function(tolua_S, "createYMD", lua_speedcc_SCDateTimeDate_createYMD); tolua_function(tolua_S, "createWithJD", lua_speedcc_SCDateTimeDate_createWithJD); tolua_function(tolua_S, "isValid", lua_speedcc_SCDateTimeDate_isValid); tolua_function(tolua_S, "getWeekCountOfYear", lua_speedcc_SCDateTimeDate_getWeekCountOfYear); tolua_function(tolua_S, "getDayCountOfMonth", lua_speedcc_SCDateTimeDate_getDayCountOfMonth); tolua_function(tolua_S, "getDayCountOfYear", lua_speedcc_SCDateTimeDate_getDayCountOfYear); tolua_variable(tolua_S, "year", lua_speedcc_SCDateTimeDate_getYear, lua_speedcc_SCDateTimeDate_setYear); tolua_variable(tolua_S, "month", lua_speedcc_SCDateTimeDate_getMonth, lua_speedcc_SCDateTimeDate_setMonth); tolua_variable(tolua_S, "day", lua_speedcc_SCDateTimeDate_getDay, lua_speedcc_SCDateTimeDate_setDay); tolua_endmodule(tolua_S); return 1; } #ifdef __cplusplus } #endif NAMESPACE_SPEEDCC_END
28.614035
114
0.747394
kevinwu1024
4e0f1c6eb87b82cea1b56682a957f6a7adb696b1
245
cc
C++
Emscripten/em_asm_/em_asm_.cc
stephenfire/Book-DISO-WebAssembly
35054b59caa4284680d7dd73bf2637de5631caa7
[ "MIT" ]
57
2018-02-14T02:12:00.000Z
2022-03-04T09:12:26.000Z
Emscripten/em_asm_/em_asm_.cc
stephenfire/Book-DISO-WebAssembly
35054b59caa4284680d7dd73bf2637de5631caa7
[ "MIT" ]
15
2018-08-23T12:37:53.000Z
2021-05-09T10:22:27.000Z
Emscripten/em_asm_/em_asm_.cc
stephenfire/Book-DISO-WebAssembly
35054b59caa4284680d7dd73bf2637de5631caa7
[ "MIT" ]
15
2019-01-27T09:35:19.000Z
2022-02-03T13:56:03.000Z
#include <emscripten.h> #include <iostream> using namespace std; int main (int argc, char **argv) { int x = 100; int y = EM_ASM_({ console.log("This value is from C++: ", $0); return 10; }, x); cout << y << endl; return 0; }
16.333333
48
0.579592
stephenfire
4e0ff903226b52853d94e2bc191ba3dd2bf2b2de
5,381
cpp
C++
Engine/Source/Developer/CrashDebugHelper/Private/Windows/CrashDebugHelperWindows.cpp
windystrife/UnrealEngine_NVIDIAGameWork
b50e6338a7c5b26374d66306ebc7807541ff815e
[ "MIT" ]
1
2022-01-29T18:36:12.000Z
2022-01-29T18:36:12.000Z
Engine/Source/Developer/CrashDebugHelper/Private/Windows/CrashDebugHelperWindows.cpp
windystrife/UnrealEngine_NVIDIAGameWork
b50e6338a7c5b26374d66306ebc7807541ff815e
[ "MIT" ]
null
null
null
Engine/Source/Developer/CrashDebugHelper/Private/Windows/CrashDebugHelperWindows.cpp
windystrife/UnrealEngine_NVIDIAGameWork
b50e6338a7c5b26374d66306ebc7807541ff815e
[ "MIT" ]
null
null
null
// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved. #include "CrashDebugHelperWindows.h" #include "CrashDebugHelperPrivate.h" #include "WindowsPlatformStackWalkExt.h" #include "Misc/Parse.h" #include "Misc/CommandLine.h" #include "EngineVersion.h" #include "ISourceControlModule.h" #include "WindowsHWrapper.h" #include "AllowWindowsPlatformTypes.h" #include <DbgHelp.h> bool FCrashDebugHelperWindows::CreateMinidumpDiagnosticReport( const FString& InCrashDumpFilename ) { const bool bSyncSymbols = FParse::Param( FCommandLine::Get(), TEXT( "SyncSymbols" ) ); const bool bAnnotate = FParse::Param( FCommandLine::Get(), TEXT( "Annotate" ) ); const bool bNoTrim = FParse::Param(FCommandLine::Get(), TEXT("NoTrimCallstack")); const bool bUseSCC = bSyncSymbols || bAnnotate; if( bUseSCC ) { InitSourceControl( false ); } FWindowsPlatformStackWalkExt WindowsStackWalkExt( CrashInfo ); const bool bReady = WindowsStackWalkExt.InitStackWalking(); bool bHasAtLeastThreeValidFunctions = false; if( bReady && WindowsStackWalkExt.OpenDumpFile( InCrashDumpFilename ) ) { if (CrashInfo.BuiltFromCL != FCrashInfo::INVALID_CHANGELIST) { // Get the build version and modules paths. FCrashModuleInfo ExeFileVersion; WindowsStackWalkExt.GetExeFileVersionAndModuleList(ExeFileVersion); // Init Symbols bool bInitSymbols = false; if (CrashInfo.bMutexPDBCache && !CrashInfo.PDBCacheLockName.IsEmpty()) { // Scoped lock UE_LOG(LogCrashDebugHelper, Log, TEXT("Locking for InitSymbols()")); FSystemWideCriticalSection PDBCacheLock(CrashInfo.PDBCacheLockName, FTimespan::FromMinutes(10.0)); if (PDBCacheLock.IsValid()) { bInitSymbols = InitSymbols(WindowsStackWalkExt, bSyncSymbols); } UE_LOG(LogCrashDebugHelper, Log, TEXT("Unlocking after InitSymbols()")); } else { bInitSymbols = InitSymbols(WindowsStackWalkExt, bSyncSymbols); } if (bInitSymbols) { // Get all the info we should ever need about the modules WindowsStackWalkExt.GetModuleInfoDetailed(); // Get info about the system that created the minidump WindowsStackWalkExt.GetSystemInfo(); // Get all the thread info WindowsStackWalkExt.GetThreadInfo(); // Get exception info WindowsStackWalkExt.GetExceptionInfo(); // Get the callstacks for each thread bHasAtLeastThreeValidFunctions = WindowsStackWalkExt.GetCallstacks(!bNoTrim) >= 3; // Sync the source file where the crash occurred if (CrashInfo.SourceFile.Len() > 0) { const bool bMutexSourceSync = FParse::Param(FCommandLine::Get(), TEXT("MutexSourceSync")); FString SourceSyncLockName; FParse::Value(FCommandLine::Get(), TEXT("SourceSyncLock="), SourceSyncLockName); if (bMutexSourceSync && !SourceSyncLockName.IsEmpty()) { // Scoped lock UE_LOG(LogCrashDebugHelper, Log, TEXT("Locking for SyncAndReadSourceFile()")); const FTimespan GlobalLockWaitTimeout = FTimespan::FromSeconds(30.0); FSystemWideCriticalSection SyncSourceLock(SourceSyncLockName, GlobalLockWaitTimeout); if (SyncSourceLock.IsValid()) { SyncAndReadSourceFile(bSyncSymbols, bAnnotate, CrashInfo.BuiltFromCL); } UE_LOG(LogCrashDebugHelper, Log, TEXT("Unlocking after SyncAndReadSourceFile()")); } else { SyncAndReadSourceFile(bSyncSymbols, bAnnotate, CrashInfo.BuiltFromCL); } } } else { UE_LOG(LogCrashDebugHelper, Warning, TEXT("InitSymbols failed")); } } else { UE_LOG( LogCrashDebugHelper, Warning, TEXT( "Invalid built from changelist" ) ); } } else { UE_LOG( LogCrashDebugHelper, Warning, TEXT( "Failed to open crash dump file: %s" ), *InCrashDumpFilename ); } if( bUseSCC ) { ShutdownSourceControl(); } return bHasAtLeastThreeValidFunctions; } bool FCrashDebugHelperWindows::InitSymbols(FWindowsPlatformStackWalkExt& WindowsStackWalkExt, bool bSyncSymbols) { // CrashInfo now contains a changelist to lookup a label for if (bSyncSymbols) { FindSymbolsAndBinariesStorage(); bool bPDBCacheEntryValid = false; const bool bSynced = SyncModules(bPDBCacheEntryValid); // Without symbols we can't decode the provided minidump. if (!bSynced) { return false; } if (!bPDBCacheEntryValid) { // early-out option const bool bForceUsePDBCache = FParse::Param(FCommandLine::Get(), TEXT("ForceUsePDBCache")); if (bForceUsePDBCache) { UE_LOG(LogCrashDebugHelper, Log, TEXT("No cached symbols available. Exiting due to -ForceUsePDBCache.")); return false; } } } // Initialise the symbol options WindowsStackWalkExt.InitSymbols(); // Set the symbol path based on the loaded modules WindowsStackWalkExt.SetSymbolPathsFromModules(); return true; } void FCrashDebugHelperWindows::SyncAndReadSourceFile(bool bSyncSymbols, bool bAnnotate, int32 BuiltFromCL) { if (bSyncSymbols && BuiltFromCL > 0) { UE_LOG(LogCrashDebugHelper, Log, TEXT("Using CL %i to sync crash source file"), BuiltFromCL); SyncSourceFile(); } // Try to annotate the file if requested bool bAnnotationSuccessful = false; if (bAnnotate) { bAnnotationSuccessful = AddAnnotatedSourceToReport(); } // If annotation is not requested, or failed, add the standard source context if (!bAnnotationSuccessful) { AddSourceToReport(); } } #include "HideWindowsPlatformTypes.h"
29.404372
112
0.733135
windystrife
4e14b8d9c33441c8e4cf4b7b77834f5889b1154e
14,267
cxx
C++
inetsrv/query/query/dllreg.cxx
npocmaka/Windows-Server-2003
5c6fe3db626b63a384230a1aa6b92ac416b0765f
[ "Unlicense" ]
17
2020-11-13T13:42:52.000Z
2021-09-16T09:13:13.000Z
inetsrv/query/query/dllreg.cxx
sancho1952007/Windows-Server-2003
5c6fe3db626b63a384230a1aa6b92ac416b0765f
[ "Unlicense" ]
2
2020-10-19T08:02:06.000Z
2020-10-19T08:23:18.000Z
inetsrv/query/query/dllreg.cxx
sancho1952007/Windows-Server-2003
5c6fe3db626b63a384230a1aa6b92ac416b0765f
[ "Unlicense" ]
14
2020-11-14T09:43:20.000Z
2021-08-28T08:59:57.000Z
//+------------------------------------------------------------------------- // // Microsoft Windows // Copyright (C) Microsoft Corporation, 1997 - 1999. // // File: dllreg.cxx // // Contents: Null and Plain Text filter registration // // History: 06-May-97 KrishnaN Created // 06-Jun-97 mohamedn CiDSO registration // //-------------------------------------------------------------------------- #include <pch.cxx> #pragma hdrstop #include <qryreg.hxx> #include <ciregkey.hxx> #include <olectl.h> #include <FNReg.h> extern "C" STDAPI FsciDllUnregisterServer(void); extern "C" STDAPI FsciDllRegisterServer(void); extern "C" STDAPI CifrmwrkDllUnregisterServer(void); extern "C" STDAPI CifrmwrkDllRegisterServer(void); extern const LPWSTR g_wszProviderName; static const REGENTRIES s_rgMSIDXSRegInfo[] = { { 0, L"MSIDXS", NULL, g_wszProviderName }, { 0, L"MSIDXS\\Clsid", NULL, L"{F9AE8980-7E52-11d0-8964-00C04FD611D7}" }, { 0, L"CLSID\\{F9AE8980-7E52-11d0-8964-00C04FD611D7}", NULL, L"MSIDXS" }, { 0, L"CLSID\\{F9AE8980-7E52-11d0-8964-00C04FD611D7}\\ProgID", NULL, L"MSIDXS.1" }, { 0, L"CLSID\\{F9AE8980-7E52-11d0-8964-00C04FD611D7}\\VersionIndependentProgID", NULL, L"MSIDXS" }, { 0, L"CLSID\\{F9AE8980-7E52-11d0-8964-00C04FD611D7}\\InprocServer32", NULL, L"%s" }, { 0, L"CLSID\\{F9AE8980-7E52-11d0-8964-00C04FD611D7}\\InprocServer32", L"ThreadingModel", L"Both" }, { 0, L"CLSID\\{F9AE8980-7E52-11d0-8964-00C04FD611D7}\\OLE DB Provider", NULL, g_wszProviderName }, { 0, L"MSIDXS ErrorLookup", NULL, L"Microsoft OLE DB Error Lookup for Indexing Service"}, { 0, L"MSIDXS ErrorLookup\\Clsid", NULL, L"{F9AE8981-7E52-11d0-8964-00C04FD611D7}"}, { 0, L"CLSID\\{F9AE8981-7E52-11d0-8964-00C04FD611D7}", NULL, L"MSIDXS ErrorLookup" }, { 0, L"CLSID\\{F9AE8981-7E52-11d0-8964-00C04FD611D7}\\ProgID", NULL, L"MSIDXSErrorLookup.1" }, { 0, L"CLSID\\{F9AE8981-7E52-11d0-8964-00C04FD611D7}\\VersionIndependentProgID",NULL, L"MSIDXSErrorLookup" }, { 0, L"CLSID\\{F9AE8981-7E52-11d0-8964-00C04FD611D7}\\InprocServer32", NULL, L"%s" }, { 0, L"CLSID\\{F9AE8981-7E52-11d0-8964-00C04FD611D7}\\InprocServer32", L"ThreadingModel", L"Both" }, { 0, L"CLSID\\{F9AE8980-7E52-11d0-8964-00C04FD611D7}\\ExtendedErrors", NULL, L"Extended Error Service"}, { 0, L"CLSID\\{F9AE8980-7E52-11d0-8964-00C04FD611D7}\\ExtendedErrors\\{F9AE8981-7E52-11d0-8964-00C04FD611D7}", NULL, L"MSIDXS Error Lookup"}, }; static const REGENTRIES s_rgDBErrRegInfo[] = { { 0, L"CI ErrorLookup", NULL, L"Microsoft OLE DB Error Lookup for Content Index"}, { 0, L"CI ErrorLookup\\Clsid", NULL, L"{B02C2D1E-C26B-11d0-9940-00C04FC2F410}"}, { 0, L"CLSID\\{B02C2D1E-C26B-11d0-9940-00C04FC2F410}", NULL, L"CI ErrorLookup" }, { 0, L"CLSID\\{B02C2D1E-C26B-11d0-9940-00C04FC2F410}\\ProgID", NULL, L"CIErrorLookup.1" }, { 0, L"CLSID\\{B02C2D1E-C26B-11d0-9940-00C04FC2F410}\\VersionIndependentProgID", NULL, L"CIErrorLookup" }, { 0, L"CLSID\\{B02C2D1E-C26B-11d0-9940-00C04FC2F410}\\InprocServer32", NULL, L"%s" }, { 0, L"CLSID\\{B02C2D1E-C26B-11d0-9940-00C04FC2F410}\\InprocServer32", L"ThreadingModel", L"Both" }, { 0, L"CLSID\\{D7A2B01A-A47D-11d0-8C55-00C04FC2DB8D}\\ExtendedErrors", NULL, L"Extended Error Service"}, { 0, L"CLSID\\{D7A2B01A-A47D-11d0-8C55-00C04FC2DB8D}\\ExtendedErrors\\{B02C2D1E-C26B-11d0-9940-00C04FC2F410}", NULL, L"CI Error Lookup"}, }; static const REGENTRIES s_rgICmdRegInfo[] = { { 0, L"CLSID\\{C7B6C04A-CBB5-11d0-BB4C-00C04FC2F410}", NULL, L"IndexServer Simple Command Creator" }, { 0, L"CLSID\\{C7B6C04A-CBB5-11d0-BB4C-00C04FC2F410}\\ProgID", NULL, L"ISSimpleCommandCreator.1" }, { 0, L"CLSID\\{C7B6C04A-CBB5-11d0-BB4C-00C04FC2F410}\\VersionIndependentProgID", NULL, L"ISSimpleCommandCreator" }, { 0, L"CLSID\\{C7B6C04A-CBB5-11d0-BB4C-00C04FC2F410}\\InprocServer32", NULL, L"%s" }, { 0, L"CLSID\\{C7B6C04A-CBB5-11d0-BB4C-00C04FC2F410}\\InprocServer32", L"ThreadingModel", L"Both" }, }; static const REGENTRIES s_rgCiDSOInfo[] = { { 0, L".cidso", NULL, L"Microsoft.CiDSO" }, { 0, L"Microsoft.CiDSO", NULL, L"Microsoft Content Index OLE DB Provider" }, { 0, L"Microsoft.CiDSO\\CLSID", NULL, L"{D7A2B01A-A47D-11d0-8C55-00C04FC2DB8D}" }, { 0, L"CLSID\\{D7A2B01A-A47D-11d0-8C55-00C04FC2DB8D}", NULL, L"Microsoft Content Index OLE DB Provider" }, { 0, L"CLSID\\{D7A2B01A-A47D-11d0-8C55-00C04FC2DB8D}\\ProgID", NULL, L"Microsoft.CiDSO.1" }, { 0, L"CLSID\\{D7A2B01A-A47D-11d0-8C55-00C04FC2DB8D}\\VersionIndependentProgID", NULL, L"Microsoft.CiDSO" }, { 0, L"CLSID\\{D7A2B01A-A47D-11d0-8C55-00C04FC2DB8D}\\OLE DB Provider", NULL, L"Microsoft Content Index OLE DB Provider" }, { 0, L"CLSID\\{D7A2B01A-A47D-11d0-8C55-00C04FC2DB8D}\\InprocServer32", NULL, L"%s" }, { 0, L"CLSID\\{D7A2B01A-A47D-11d0-8C55-00C04FC2DB8D}\\InprocServer32", L"ThreadingModel", L"Both" } }; //+------------------------------------------------------------------------- // // Function: DllRegisterServer // // Synopsis: Registers all that needs to be registered for this dll. // // Returns: Success or failure of registration. // // // History: 01-May-1997 KrishnaN Created Header. // //-------------------------------------------------------------------------- extern "C" STDAPI DllRegisterServer(void) { SCODE sc = S_OK; CTranslateSystemExceptions xlate; TRY { sc = RegisterServer(HKEY_CLASSES_ROOT, sizeof(s_rgMSIDXSRegInfo)/sizeof(s_rgMSIDXSRegInfo[0]), s_rgMSIDXSRegInfo); if (S_OK == sc) sc = RegisterServer(HKEY_CLASSES_ROOT, sizeof(s_rgICmdRegInfo)/sizeof(s_rgICmdRegInfo[0]), s_rgICmdRegInfo); // // create the CICommon registry key so all dependents of query.dll can // set/get non-framework registry entries there. // HKEY hKey; if (S_OK == sc && ERROR_SUCCESS == RegOpenKey( HKEY_LOCAL_MACHINE, wcsRegControlSubKey, &hKey )) { HKEY hCommonKey; DWORD dwDisp; // create the subkey if (ERROR_SUCCESS == RegCreateKeyEx( hKey, wcsRegCommonAdmin, 0, 0, 0, KEY_ALL_ACCESS, 0, &hCommonKey, &dwDisp ) ) { RegCloseKey(hCommonKey); } else { sc = SELFREG_E_CLASS; } RegCloseKey(hKey); } else sc = SELFREG_E_CLASS; if (FAILED(sc)) return SELFREG_E_CLASS; sc = FsciDllRegisterServer(); if (FAILED(sc)) return sc; sc = CifrmwrkDllRegisterServer(); if (FAILED(sc)) return sc; sc = FNPrxDllRegisterServer(); } CATCH( CException, e ) { sc = e.GetErrorCode(); } END_CATCH return sc; } //DllRegisterServer //+------------------------------------------------------------------------- // // Function: DllUnregisterServer // // Synopsis: Unregisters all that needs to be unregistered for this dll. // // Returns: Success or failure of registration. // // // History: 01-May-1997 KrishnaN Created Header. // //-------------------------------------------------------------------------- extern "C" STDAPI DllUnregisterServer(void) { SCODE sc = S_OK; SCODE sc2 = S_OK; SCODE sc3 = S_OK; SCODE sc4 = S_OK; SCODE sc5 = S_OK; SCODE sc6 = S_OK; SCODE sc7 = S_OK; CTranslateSystemExceptions xlate; TRY { sc = UnRegisterServer(HKEY_CLASSES_ROOT, sizeof(s_rgDBErrRegInfo)/sizeof(s_rgDBErrRegInfo[0]), s_rgDBErrRegInfo); sc2 = UnRegisterServer(HKEY_CLASSES_ROOT, sizeof(s_rgCiDSOInfo)/sizeof(s_rgCiDSOInfo[0]), s_rgCiDSOInfo); sc3 = UnRegisterServer(HKEY_CLASSES_ROOT, sizeof(s_rgICmdRegInfo)/sizeof(s_rgICmdRegInfo[0]), s_rgICmdRegInfo); sc4 = RegisterServer(HKEY_CLASSES_ROOT, sizeof(s_rgMSIDXSRegInfo)/sizeof(s_rgMSIDXSRegInfo[0]), s_rgMSIDXSRegInfo); sc5 = FsciDllUnregisterServer(); sc6 = CifrmwrkDllUnregisterServer(); sc7 = FNPrxDllUnregisterServer(); } CATCH( CException, e ) { sc = e.GetErrorCode(); } END_CATCH if ( FAILED(sc) || FAILED(sc2) || FAILED(sc3) || FAILED(sc4) || FAILED(sc5) || FAILED(sc6) || FAILED(sc7) ) return SELFREG_E_CLASS; return S_OK; } //DllUnregisterServer //+------------------------------------------------------------------------- // // Function: RegisterServer // // Synopsis: Registers all the entries passed. // // Arguments: [hKey] -- Registry key for the entries. // [cEntries] -- Number of entries in the array. // [rgEntries] -- Array of registry entr/values. // // Returns: Success or failure of registration. // // History: 01-May-1997 KrishnaN Created // //-------------------------------------------------------------------------- extern HANDLE g_hCurrentDll; #define MAX_REGISTRY_LEN 300 HRESULT RegisterServer (const HKEY hKey, const ULONG cEntries, const REGENTRIES rgEntries[]) { ULONG i; HKEY hk; DWORD dwDisposition; LONG stat; XArray<WCHAR> xwszFileName(MAX_PATH+1); XArray<WCHAR> xwszBuff(MAX_REGISTRY_LEN+1); int cch = 0; Win4Assert( g_hCurrentDll ); if ( 0 == GetModuleFileName( (HINSTANCE)g_hCurrentDll, xwszFileName.Get(), xwszFileName.Count()) ) return E_FAIL; // // Make a clean start. // We ignore errors here. // UnRegisterServer(hKey, cEntries, rgEntries); // // Loop through rgEntries, and put everything in it. // Every entry is based on HKEY_CLASSES_ROOT. // for (i=0; i < cEntries; i++) { // // Create the Key. If it exists, we open it. // Thus we can still change the value below. // stat = RegCreateKeyEx( hKey, rgEntries[i].strRegKey, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hk, &dwDisposition ); if (stat != ERROR_SUCCESS ) return E_FAIL; // Assign a value, if we have one. if (rgEntries[i].strValue) { cch = swprintf( xwszBuff.Get(), rgEntries[i].strValue, xwszFileName.Get() ); stat = RegSetValueEx( hk, rgEntries[i].strValueName, 0, rgEntries[i].fExpand ? REG_EXPAND_SZ : REG_SZ, (BYTE *) xwszBuff.Get(), sizeof(WCHAR) * (wcslen(xwszBuff.Get()) + 1)); if (stat != ERROR_SUCCESS ) return E_FAIL; } RegCloseKey( hk ); } return S_OK; } //+------------------------------------------------------------------------- // // Function: UnRegisterServer // // Synopsis: Unregisters all the entries passed. // // Arguments: [hKey] -- Registry key for the entries. // [cEntries] -- Number of entries in the array. // [rgEntries] -- Array of registry entr/values. // // Returns: Success or failure of unregistration. // // History: 01-May-1997 KrishnaN Created // //-------------------------------------------------------------------------- HRESULT UnRegisterServer ( const HKEY hKey, const ULONG cEntries, const REGENTRIES rgEntries[] ) { ULONG i; int iNumErrors = 0; LONG stat; // Delete all table entries. Loop in reverse order, since they // are entered in a basic-to-complex order. // for (i = cEntries; i > 0; i--) { stat = RegDeleteKey( HKEY_CLASSES_ROOT, rgEntries[i-1].strRegKey ); if (stat != ERROR_SUCCESS && stat != ERROR_FILE_NOT_FOUND) { iNumErrors++; } } // // We fail on error, since that gives proper message to end user. // DllRegisterServer should ignore these errors. // return iNumErrors ? E_FAIL : S_OK; }
37.944149
150
0.498563
npocmaka
4e164e5e843306462759f02ac2622bea6e19ede9
10,419
cxx
C++
Tracing/TraceEdit/cellexport.cxx
tostathaina/farsight
7e9d6d15688735f34f7ca272e4e715acd11473ff
[ "Apache-2.0" ]
8
2016-07-22T11:24:19.000Z
2021-04-10T04:22:31.000Z
Tracing/TraceEdit/cellexport.cxx
YanXuHappygela/Farsight
1711b2a1458c7e035edd21fe0019a1f7d23fcafa
[ "Apache-2.0" ]
null
null
null
Tracing/TraceEdit/cellexport.cxx
YanXuHappygela/Farsight
1711b2a1458c7e035edd21fe0019a1f7d23fcafa
[ "Apache-2.0" ]
7
2016-07-21T07:39:17.000Z
2020-01-29T02:03:27.000Z
/***************************************************************************************** // File dialog for autocellexport to save individual traces in swc and jpg files. // // You are given the options of saving swc files, jpg files, or both in the chosen // // directory you choose. You can also name the files as you wish or use default names. // *****************************************************************************************/ #include "cellexport.h" SaveCellExportDialog::SaveCellExportDialog(QWidget* parent, QString curdirectoryswc, QString curdirectoryjpg, QString swcfileName, QString jpgfileName, bool changeswcfileName, bool changejpgfileName) : QDialog(parent) { this->curdirectoryswc = curdirectoryswc; this->curdirectoryjpg = curdirectoryjpg; saveclicked = false; // SWC files directory setup QLabel *swclabel = new QLabel(tr("Directory for SWC files:")); swcdirectoryComboBox = createComboBox(curdirectoryswc); swclabel->setBuddy(swcdirectoryComboBox); swcbrowseButton = createButton(tr("&Browse..."), SLOT(swcBrowse())); swcmoreButton = new QPushButton(tr("&More...")); swcmoreButton->setCheckable(true); // JPG files directory setup QLabel *jpglabel = new QLabel(tr("Directory for JPG files:")); jpgdirectoryComboBox = createComboBox(curdirectoryjpg); jpglabel->setBuddy(jpgdirectoryComboBox); jpgbrowseButton = createButton(tr("&Browse..."), SLOT(jpgBrowse())); jpgmoreButton = new QPushButton(tr("&More...")); jpgmoreButton->setCheckable(true); // SWC files: customize naming files setup (original filename, "cell_1", or new name with numbers) swcextension = new QWidget; originalswcfileNameButton = new QRadioButton(tr("Keep original filename"), swcextension); originalswcfileNameButton->setChecked(true); renumberswcfileNameButton = new QRadioButton(tr("Label files by xyz: (ex. cell_20_32_3)"), swcextension); renameswcfileNameButton = new QRadioButton(tr("Rename and auto-assign number to swc files"), swcextension); QLabel *swcLineEditLabel = new QLabel(tr("Custom name:")); nameswcfileNameLine = new QLineEdit(swcextension); connect(swcmoreButton, SIGNAL(toggled(bool)), swcextension, SLOT(setVisible(bool))); connect(nameswcfileNameLine, SIGNAL(textChanged(const QString &)), this, SLOT(swcfilenaming())); // JPG files: customize naming files setup (original filename, "cell_1", or new name with numbers) jpgextension = new QWidget; originaljpgfileNameButton = new QRadioButton(tr("Keep original filename"), jpgextension); originaljpgfileNameButton->setChecked(true); renumberjpgfileNameButton = new QRadioButton(tr("Label files by xyz: (ex. cell_20_32_3)"), jpgextension); renamejpgfileNameButton = new QRadioButton(tr("Rename and auto-assign number to jpg files"), jpgextension); QLabel *jpgLineEditLabel = new QLabel(tr("Custom name:")); namejpgfileNameLine = new QLineEdit(jpgextension); connect(jpgmoreButton, SIGNAL(toggled(bool)), jpgextension, SLOT(setVisible(bool))); connect(namejpgfileNameLine, SIGNAL(textChanged(const QString &)), this, SLOT(jpgfilenaming())); // Create layout QHBoxLayout *swcdirLayout = new QHBoxLayout(); swcdirLayout->addWidget(swclabel); swcdirLayout->addWidget(swcdirectoryComboBox); QHBoxLayout *jpgdirLayout = new QHBoxLayout(); jpgdirLayout->addWidget(jpglabel); jpgdirLayout->addWidget(jpgdirectoryComboBox); QVBoxLayout* swcextensionLayout = new QVBoxLayout(); swcextensionLayout->addWidget(originalswcfileNameButton); swcextensionLayout->addWidget(renumberswcfileNameButton); swcextensionLayout->addWidget(renameswcfileNameButton); swcextensionLayout->addWidget(nameswcfileNameLine); swcextension->setLayout(swcextensionLayout); QVBoxLayout* jpgextensionLayout = new QVBoxLayout(); jpgextensionLayout->addWidget(originaljpgfileNameButton); jpgextensionLayout->addWidget(renumberjpgfileNameButton); jpgextensionLayout->addWidget(renamejpgfileNameButton); jpgextensionLayout->addWidget(namejpgfileNameLine); jpgextension->setLayout(jpgextensionLayout); OkButton = new QPushButton(tr("Ok")); OkButton->setDefault(true); connect(OkButton, SIGNAL(clicked()), this, SLOT(save())); CancelButton = new QPushButton(tr("Cancel")); connect(CancelButton, SIGNAL(clicked()), this, SLOT(close())); // Different layout //QVBoxLayout *leftswcLayout = new QVBoxLayout(); //leftswcLayout->addLayout(swcdirLayout); //leftswcLayout->addWidget(swcextension); //leftswcLayout->addStretch(); //QVBoxLayout *swcButtonLayout = new QVBoxLayout(); //swcButtonLayout->addWidget(swcbrowseButton); //swcButtonLayout->addWidget(swcmoreButton); //swcButtonLayout->addStretch(); //QHBoxLayout *fullswcLayout = new QHBoxLayout(); //fullswcLayout->addLayout(leftswcLayout); //fullswcLayout->addLayout(swcButtonLayout); //QVBoxLayout *leftjpgLayout = new QVBoxLayout(); //leftjpgLayout->addLayout(jpgdirLayout); //leftjpgLayout->addWidget(jpgextension); //leftjpgLayout->addStretch(); //QVBoxLayout *jpgButtonLayout = new QVBoxLayout(); //jpgButtonLayout->addWidget(jpgbrowseButton); //jpgButtonLayout->addWidget(jpgmoreButton); //jpgButtonLayout->addStretch(); //QHBoxLayout *fulljpgLayout = new QHBoxLayout(); //fulljpgLayout->addLayout(leftjpgLayout); //fulljpgLayout->addLayout(jpgButtonLayout); QHBoxLayout *bottomLayout = new QHBoxLayout(); bottomLayout->addWidget(OkButton); bottomLayout->addWidget(CancelButton); //QVBoxLayout *MainLayout = new QVBoxLayout(); //MainLayout->addLayout(fullswcLayout); //MainLayout->addLayout(fulljpgLayout); //MainLayout->addLayout(bottomLayout); //MainLayout->setSizeConstraint(QLayout::SetFixedSize); // QGridLayout - the 1st number: initial row index, the 2nd number: initial column index, // the 3rd number: rowSpan, and the 4th number: columnSpan. saveSWCGroupBox = new QGroupBox(tr("Save SWC files")); saveSWCGroupBox->setCheckable(true); QGridLayout *swcLayout = new QGridLayout(saveSWCGroupBox); swcLayout->addLayout(swcdirLayout,0,0); swcLayout->addWidget(swcbrowseButton,0,2); swcLayout->addWidget(swcmoreButton,1,2,Qt::AlignTop); swcLayout->addWidget(swcextension,1,0); saveJPGGroupBox = new QGroupBox(tr("Save JPG files")); saveJPGGroupBox->setCheckable(true); QGridLayout *jpgLayout = new QGridLayout(saveJPGGroupBox); jpgLayout->addLayout(jpgdirLayout,0,0); jpgLayout->addWidget(jpgbrowseButton,0,2); jpgLayout->addWidget(jpgmoreButton,1,2,Qt::AlignTop); jpgLayout->addWidget(jpgextension,1,0); QGridLayout *cellexportLayout = new QGridLayout; cellexportLayout->addWidget(saveSWCGroupBox,0,0); cellexportLayout->addWidget(saveJPGGroupBox,1,0); cellexportLayout->addLayout(bottomLayout,5,0,Qt::AlignRight); //cellexportLayout->addWidget(OkButton,5,0); //cellexportLayout->addWidget(CancelButton,5,1); //cellexportLayout->setSizeConstraint(QLayout::SetFixedSize); setLayout(cellexportLayout); setWindowTitle(tr("Export Cells")); resize(500,250); swcextension->hide(); jpgextension->hide(); } // Specify folder to save swc file void SaveCellExportDialog::swcBrowse() { curdirectoryswc = QFileDialog::getExistingDirectory(this, tr("Choose Directory for SWC files"), QFileInfo(curdirectoryswc).dir().canonicalPath()); if (!curdirectoryswc.isEmpty()) { if (swcdirectoryComboBox->findText(curdirectoryswc) == -1) { swcdirectoryComboBox->addItem(curdirectoryswc); } swcdirectoryComboBox->setCurrentIndex(swcdirectoryComboBox->findText(curdirectoryswc)); } } // Specify folder to save jpg file void SaveCellExportDialog::jpgBrowse() { curdirectoryjpg = QFileDialog::getExistingDirectory(this, tr("Choose Directory for JPG files"), QFileInfo(curdirectoryjpg).dir().canonicalPath()); if (!curdirectoryjpg.isEmpty()) { if (jpgdirectoryComboBox->findText(curdirectoryjpg) == -1) { jpgdirectoryComboBox->addItem(curdirectoryjpg); } jpgdirectoryComboBox->setCurrentIndex(jpgdirectoryComboBox->findText(curdirectoryjpg)); } } //checkmark rename button if rename text is changed void SaveCellExportDialog::swcfilenaming() { renameswcfileNameButton->setChecked(true); } void SaveCellExportDialog::jpgfilenaming() { renamejpgfileNameButton->setChecked(true); } void SaveCellExportDialog::save() { saveclicked = true; //check if directory exist, otherwise make directory curdirectoryswc = swcdirectoryComboBox->currentText(); QDir SWCdirectory(curdirectoryswc); if(!SWCdirectory.exists()) { SWCdirectory.mkdir(curdirectoryswc); } curdirectoryjpg = jpgdirectoryComboBox->currentText(); QDir JPGdirectory(curdirectoryjpg); if(!JPGdirectory.exists()) { JPGdirectory.mkdir(curdirectoryjpg); } QDialog::accept(); //save and close export cell dialog } QPushButton *SaveCellExportDialog::createButton(const QString &text, const char *member) { QPushButton *button = new QPushButton(text); connect(button, SIGNAL(clicked()), this, member); return button; } QComboBox *SaveCellExportDialog::createComboBox(const QString &text) { QComboBox *comboBox = new QComboBox; comboBox->setEditable(true); comboBox->addItem(text); comboBox->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); return comboBox; } // return directory to save files QString SaveCellExportDialog::getSWCDir() { if (!saveSWCGroupBox->isChecked()) { curdirectoryswc.clear(); } return curdirectoryswc; } QString SaveCellExportDialog::getJPGDir() { if (!saveJPGGroupBox->isChecked()) { curdirectoryjpg.clear(); } return curdirectoryjpg; } //customize the swc filename QString SaveCellExportDialog::getSWCfileName() { if (renameswcfileNameButton->isChecked()) { swcfileName = nameswcfileNameLine->text(); } else { swcfileName.clear(); } return swcfileName; } //customize the jpg filename QString SaveCellExportDialog::getJPGfileName() { if (renamejpgfileNameButton->isChecked()) { jpgfileName = namejpgfileNameLine->text(); } else { jpgfileName.clear(); } return jpgfileName; } //decide whether to keep original filename or change it bool SaveCellExportDialog::differentSWCfileName() { if (originalswcfileNameButton->isChecked()) { changeswcfileName = false; } else { changeswcfileName = true; } return changeswcfileName; } bool SaveCellExportDialog::differentJPGfileName() { if (originaljpgfileNameButton->isChecked()) { changejpgfileName = false; } else { changejpgfileName = true; } return changejpgfileName; } bool SaveCellExportDialog::getSave() { return saveclicked; }
34.73
199
0.758422
tostathaina
4e1b0734caad480a361ef9049621f122aed0c125
876
hpp
C++
include/elasty/cloth-sim-object.hpp
0x0c/elasty
3995cacbefa8d7f39249e9f75fa291828e2e7c2d
[ "MIT" ]
null
null
null
include/elasty/cloth-sim-object.hpp
0x0c/elasty
3995cacbefa8d7f39249e9f75fa291828e2e7c2d
[ "MIT" ]
null
null
null
include/elasty/cloth-sim-object.hpp
0x0c/elasty
3995cacbefa8d7f39249e9f75fa291828e2e7c2d
[ "MIT" ]
null
null
null
#ifndef cloth_sim_object_hpp #define cloth_sim_object_hpp #include <elasty/sim-object.hpp> #include <string> #include <Eigen/Core> #include <Eigen/Geometry> namespace elasty { class ClothSimObject : public SimObject { public: enum class Strategy { Bending, IsometricBending, Cross, }; using TriangleList = Eigen::Matrix<int32_t, Eigen::Dynamic, 3, Eigen::RowMajor>; ClothSimObject(const std::string& obj_path, const double distance_stiffness = 0.90, const double bending_stiffness = 0.50, const Eigen::Affine3d& transform = Eigen::Affine3d::Identity(), const Strategy strategy = Strategy::IsometricBending); TriangleList m_triangle_list; }; } #endif /* cloth_sim_object_hpp */
25.028571
88
0.606164
0x0c
4e206c705787e9fb8d030f1e407867ad49c4d54c
226,423
cpp
C++
bnn/src/network/output/hls-syn/lfcW1A1-pynqZ1-Z2/sol1/syn/systemc/Matrix_Vector_Activa_1_2.cpp
IceyFong/Lutification
3e42d34d6840d5deb84407aad5c58216527a4b0a
[ "BSD-3-Clause" ]
null
null
null
bnn/src/network/output/hls-syn/lfcW1A1-pynqZ1-Z2/sol1/syn/systemc/Matrix_Vector_Activa_1_2.cpp
IceyFong/Lutification
3e42d34d6840d5deb84407aad5c58216527a4b0a
[ "BSD-3-Clause" ]
null
null
null
bnn/src/network/output/hls-syn/lfcW1A1-pynqZ1-Z2/sol1/syn/systemc/Matrix_Vector_Activa_1_2.cpp
IceyFong/Lutification
3e42d34d6840d5deb84407aad5c58216527a4b0a
[ "BSD-3-Clause" ]
null
null
null
#include "Matrix_Vector_Activa_1.h" #include "AESL_pkg.h" using namespace std; namespace ap_rtl { void Matrix_Vector_Activa_1::thread_ap_clk_no_reset_() { if ( ap_rst.read() == ap_const_logic_1) { ap_CS_fsm = ap_ST_fsm_state1; } else { ap_CS_fsm = ap_NS_fsm.read(); } if ( ap_rst.read() == ap_const_logic_1) { ap_done_reg = ap_const_logic_0; } else { if (esl_seteq<1,1,1>(ap_const_logic_1, ap_continue.read())) { ap_done_reg = ap_const_logic_0; } else if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_state7.read()))) { ap_done_reg = ap_const_logic_1; } } if ( ap_rst.read() == ap_const_logic_1) { ap_enable_reg_pp0_iter0 = ap_const_logic_0; } else { if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && !esl_seteq<1,1,1>(ap_const_lv1_0, exitcond_i_fu_1686_p2.read()))) { ap_enable_reg_pp0_iter0 = ap_const_logic_0; } else if ((esl_seteq<1,1,1>(ap_CS_fsm_state1.read(), ap_const_lv1_1) && !esl_seteq<1,1,1>(ap_condition_300.read(), ap_const_boolean_1))) { ap_enable_reg_pp0_iter0 = ap_const_logic_1; } } if ( ap_rst.read() == ap_const_logic_1) { ap_enable_reg_pp0_iter1 = ap_const_logic_0; } else { if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,1,1>(ap_const_lv1_0, exitcond_i_fu_1686_p2.read()))) { ap_enable_reg_pp0_iter1 = ap_const_logic_1; } else if (((esl_seteq<1,1,1>(ap_CS_fsm_state1.read(), ap_const_lv1_1) && !esl_seteq<1,1,1>(ap_condition_300.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && !esl_seteq<1,1,1>(ap_const_lv1_0, exitcond_i_fu_1686_p2.read())))) { ap_enable_reg_pp0_iter1 = ap_const_logic_0; } } if ( ap_rst.read() == ap_const_logic_1) { ap_enable_reg_pp0_iter2 = ap_const_logic_0; } else { if (!((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0)))) { ap_enable_reg_pp0_iter2 = ap_enable_reg_pp0_iter1.read(); } } if ( ap_rst.read() == ap_const_logic_1) { ap_enable_reg_pp0_iter3 = ap_const_logic_0; } else { if (!((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0)))) { ap_enable_reg_pp0_iter3 = ap_enable_reg_pp0_iter2.read(); } } if ( ap_rst.read() == ap_const_logic_1) { ap_enable_reg_pp0_iter4 = ap_const_logic_0; } else { if (!((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0)))) { ap_enable_reg_pp0_iter4 = ap_enable_reg_pp0_iter3.read(); } else if ((esl_seteq<1,1,1>(ap_CS_fsm_state1.read(), ap_const_lv1_1) && !esl_seteq<1,1,1>(ap_condition_300.read(), ap_const_boolean_1))) { ap_enable_reg_pp0_iter4 = ap_const_logic_0; } } if (((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_7F)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_7E)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_7D)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_7C)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_7B)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_7A)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_79)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_78)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_77)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_76)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_75)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_74)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_73)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_72)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_71)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_70)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_6F)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_6E)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_6D)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_6C)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_6B)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_6A)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_69)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_68)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_67)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_66)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_65)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_64)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_63)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_62)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_61)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_60)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_5F)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_5E)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_5D)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_5C)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_5B)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_5A)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_59)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_58)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_57)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_56)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_55)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_54)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_53)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_52)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_51)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_50)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_4F)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_4E)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_4D)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_4C)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_4B)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_4A)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_49)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_48)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_47)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_46)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_45)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_44)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_43)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_42)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_41)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_40)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_3F)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_3E)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_3D)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_3C)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_3B)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_3A)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_39)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_38)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_37)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_36)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_35)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_34)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_33)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_32)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_31)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_30)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_2F)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_2E)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_2D)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_2C)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_2B)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_2A)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_29)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_28)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_27)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_26)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_25)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_24)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_23)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_22)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_21)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_20)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_1F)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_1E)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_1D)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_1C)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_1B)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_1A)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_19)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_18)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_17)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_16)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_15)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_14)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_13)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_12)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_11)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_10)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_F)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_E)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_D)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_C)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_B)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_A)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_9)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_8)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_7)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_6)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_5)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_4)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_3)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_2)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_1)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_0)))) { ap_phi_precharge_reg_pp0_iter2_act_m_val_V_reg_1402 = in_V_V_dout.read(); } else if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))))) { ap_phi_precharge_reg_pp0_iter2_act_m_val_V_reg_1402 = ap_phi_precharge_reg_pp0_iter1_act_m_val_V_reg_1402.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter0.read()) && esl_seteq<1,1,1>(ap_const_lv1_0, exitcond_i_fu_1686_p2.read()))) { i_i_reg_1391 = i_fu_1691_p2.read(); } else if ((esl_seteq<1,1,1>(ap_CS_fsm_state1.read(), ap_const_lv1_1) && !esl_seteq<1,1,1>(ap_condition_300.read(), ap_const_boolean_1))) { i_i_reg_1391 = ap_const_lv32_0; } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter0.read()) && esl_seteq<1,1,1>(ap_const_lv1_0, exitcond_i_fu_1686_p2.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_5_i_fu_1732_p2.read()))) { nf_assign_fu_976 = p_i_fu_1758_p3.read(); } else if ((esl_seteq<1,1,1>(ap_CS_fsm_state1.read(), ap_const_lv1_1) && !esl_seteq<1,1,1>(ap_condition_300.read(), ap_const_boolean_1))) { nf_assign_fu_976 = ap_const_lv32_0; } if ( ap_rst.read() == ap_const_logic_1) { real_start_status_reg = ap_const_logic_0; } else { if (!esl_seteq<1,1,1>(ap_const_logic_0, start_full_n.read())) { real_start_status_reg = ap_const_logic_0; } else if ((esl_seteq<1,1,1>(ap_const_logic_0, start_full_n.read()) && esl_seteq<1,1,1>(ap_const_logic_1, internal_ap_ready.read()))) { real_start_status_reg = ap_const_logic_1; } } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter0.read()) && esl_seteq<1,1,1>(ap_const_lv1_0, exitcond_i_fu_1686_p2.read()) && esl_seteq<1,1,1>(ap_const_lv1_0, tmp_5_i_fu_1732_p2.read()))) { sf_3_fu_460 = sf_fu_1726_p2.read(); } else if (((esl_seteq<1,1,1>(ap_CS_fsm_state1.read(), ap_const_lv1_1) && !esl_seteq<1,1,1>(ap_condition_300.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter0.read()) && esl_seteq<1,1,1>(ap_const_lv1_0, exitcond_i_fu_1686_p2.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_5_i_fu_1732_p2.read())))) { sf_3_fu_460 = ap_const_lv32_0; } if ( ap_rst.read() == ap_const_logic_1) { start_control_reg = ap_const_logic_0; } else { if ((esl_seteq<1,1,1>(ap_const_logic_1, real_start.read()) && (esl_seteq<1,1,1>(ap_const_logic_1, internal_ap_ready.read()) || esl_seteq<1,1,1>(ap_const_logic_0, start_once_reg.read())))) { start_control_reg = ap_const_logic_1; } else if ((esl_seteq<1,1,1>(ap_const_logic_1, start_control_reg.read()) && esl_seteq<1,1,1>(ap_const_logic_1, start_full_n.read()))) { start_control_reg = ap_const_logic_0; } } if ( ap_rst.read() == ap_const_logic_1) { start_once_reg = ap_const_logic_0; } else { if (esl_seteq<1,1,1>(ap_const_logic_1, real_start.read())) { start_once_reg = ap_const_logic_1; } else if (esl_seteq<1,1,1>(ap_const_logic_0, ap_start.read())) { start_once_reg = ap_const_logic_0; } } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_5_i_reg_8361.read()))) { tile_assign_fu_456 = p_2_i_fu_3090_p3.read(); } else if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,1,1>(ap_const_lv1_0, tmp_5_i_reg_8361.read()))) { tile_assign_fu_456 = tile_fu_3079_p2.read(); } else if ((esl_seteq<1,1,1>(ap_CS_fsm_state1.read(), ap_const_lv1_1) && !esl_seteq<1,1,1>(ap_condition_300.read(), ap_const_boolean_1))) { tile_assign_fu_456 = ap_const_lv32_0; } if (!((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0)))) { accu_0_0_V_reg_9312 = accu_0_0_V_fu_5919_p2.read(); accu_0_10_V_reg_9362 = accu_0_10_V_fu_6799_p2.read(); accu_0_11_V_reg_9367 = accu_0_11_V_fu_6887_p2.read(); accu_0_12_V_reg_9372 = accu_0_12_V_fu_6975_p2.read(); accu_0_13_V_reg_9377 = accu_0_13_V_fu_7063_p2.read(); accu_0_14_V_reg_9382 = accu_0_14_V_fu_7151_p2.read(); accu_0_15_V_reg_9387 = accu_0_15_V_fu_7239_p2.read(); accu_0_1_V_reg_9317 = accu_0_1_V_fu_6007_p2.read(); accu_0_2_V_reg_9322 = accu_0_2_V_fu_6095_p2.read(); accu_0_3_V_reg_9327 = accu_0_3_V_fu_6183_p2.read(); accu_0_4_V_reg_9332 = accu_0_4_V_fu_6271_p2.read(); accu_0_5_V_reg_9337 = accu_0_5_V_fu_6359_p2.read(); accu_0_6_V_reg_9342 = accu_0_6_V_fu_6447_p2.read(); accu_0_7_V_reg_9347 = accu_0_7_V_fu_6535_p2.read(); accu_0_8_V_reg_9352 = accu_0_8_V_fu_6623_p2.read(); accu_0_9_V_reg_9357 = accu_0_9_V_fu_6711_p2.read(); ap_pipeline_reg_pp0_iter2_tmp_4_i_reg_8341 = ap_pipeline_reg_pp0_iter1_tmp_4_i_reg_8341.read(); ap_pipeline_reg_pp0_iter2_tmp_5_i_reg_8361 = ap_pipeline_reg_pp0_iter1_tmp_5_i_reg_8361.read(); ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361 = ap_pipeline_reg_pp0_iter2_tmp_5_i_reg_8361.read(); tmp_41_0_1_i_reg_8597 = tmp_41_0_1_i_fu_3144_p2.read(); tmp_41_0_2_i_reg_8602 = tmp_41_0_2_i_fu_3172_p2.read(); tmp_41_0_3_i_reg_8607 = tmp_41_0_3_i_fu_3200_p2.read(); tmp_41_0_4_i_reg_8612 = tmp_41_0_4_i_fu_3228_p2.read(); tmp_41_0_5_i_reg_8617 = tmp_41_0_5_i_fu_3256_p2.read(); tmp_41_0_6_i_reg_8622 = tmp_41_0_6_i_fu_3284_p2.read(); tmp_41_0_7_i_reg_8627 = tmp_41_0_7_i_fu_3312_p2.read(); tmp_41_0_i_reg_8592 = tmp_41_0_i_fu_3116_p2.read(); tmp_41_10_1_i_reg_8997 = tmp_41_10_1_i_fu_4752_p2.read(); tmp_41_10_2_i_reg_9002 = tmp_41_10_2_i_fu_4772_p2.read(); tmp_41_10_3_i_reg_9007 = tmp_41_10_3_i_fu_4792_p2.read(); tmp_41_10_4_i_reg_9012 = tmp_41_10_4_i_fu_4812_p2.read(); tmp_41_10_5_i_reg_9017 = tmp_41_10_5_i_fu_4832_p2.read(); tmp_41_10_6_i_reg_9022 = tmp_41_10_6_i_fu_4852_p2.read(); tmp_41_10_7_i_reg_9027 = tmp_41_10_7_i_fu_4872_p2.read(); tmp_41_10_i_reg_8992 = tmp_41_10_i_fu_4732_p2.read(); tmp_41_11_1_i_reg_9037 = tmp_41_11_1_i_fu_4908_p2.read(); tmp_41_11_2_i_reg_9042 = tmp_41_11_2_i_fu_4928_p2.read(); tmp_41_11_3_i_reg_9047 = tmp_41_11_3_i_fu_4948_p2.read(); tmp_41_11_4_i_reg_9052 = tmp_41_11_4_i_fu_4968_p2.read(); tmp_41_11_5_i_reg_9057 = tmp_41_11_5_i_fu_4988_p2.read(); tmp_41_11_6_i_reg_9062 = tmp_41_11_6_i_fu_5008_p2.read(); tmp_41_11_7_i_reg_9067 = tmp_41_11_7_i_fu_5028_p2.read(); tmp_41_11_i_reg_9032 = tmp_41_11_i_fu_4888_p2.read(); tmp_41_12_1_i_reg_9077 = tmp_41_12_1_i_fu_5064_p2.read(); tmp_41_12_2_i_reg_9082 = tmp_41_12_2_i_fu_5084_p2.read(); tmp_41_12_3_i_reg_9087 = tmp_41_12_3_i_fu_5104_p2.read(); tmp_41_12_4_i_reg_9092 = tmp_41_12_4_i_fu_5124_p2.read(); tmp_41_12_5_i_reg_9097 = tmp_41_12_5_i_fu_5144_p2.read(); tmp_41_12_6_i_reg_9102 = tmp_41_12_6_i_fu_5164_p2.read(); tmp_41_12_7_i_reg_9107 = tmp_41_12_7_i_fu_5184_p2.read(); tmp_41_12_i_reg_9072 = tmp_41_12_i_fu_5044_p2.read(); tmp_41_13_1_i_reg_9117 = tmp_41_13_1_i_fu_5220_p2.read(); tmp_41_13_2_i_reg_9122 = tmp_41_13_2_i_fu_5240_p2.read(); tmp_41_13_3_i_reg_9127 = tmp_41_13_3_i_fu_5260_p2.read(); tmp_41_13_4_i_reg_9132 = tmp_41_13_4_i_fu_5280_p2.read(); tmp_41_13_5_i_reg_9137 = tmp_41_13_5_i_fu_5300_p2.read(); tmp_41_13_6_i_reg_9142 = tmp_41_13_6_i_fu_5320_p2.read(); tmp_41_13_7_i_reg_9147 = tmp_41_13_7_i_fu_5340_p2.read(); tmp_41_13_i_reg_9112 = tmp_41_13_i_fu_5200_p2.read(); tmp_41_14_1_i_reg_9157 = tmp_41_14_1_i_fu_5376_p2.read(); tmp_41_14_2_i_reg_9162 = tmp_41_14_2_i_fu_5396_p2.read(); tmp_41_14_3_i_reg_9167 = tmp_41_14_3_i_fu_5416_p2.read(); tmp_41_14_4_i_reg_9172 = tmp_41_14_4_i_fu_5436_p2.read(); tmp_41_14_5_i_reg_9177 = tmp_41_14_5_i_fu_5456_p2.read(); tmp_41_14_6_i_reg_9182 = tmp_41_14_6_i_fu_5476_p2.read(); tmp_41_14_7_i_reg_9187 = tmp_41_14_7_i_fu_5496_p2.read(); tmp_41_14_i_reg_9152 = tmp_41_14_i_fu_5356_p2.read(); tmp_41_15_1_i_reg_9197 = tmp_41_15_1_i_fu_5532_p2.read(); tmp_41_15_2_i_reg_9202 = tmp_41_15_2_i_fu_5552_p2.read(); tmp_41_15_3_i_reg_9207 = tmp_41_15_3_i_fu_5572_p2.read(); tmp_41_15_4_i_reg_9212 = tmp_41_15_4_i_fu_5592_p2.read(); tmp_41_15_5_i_reg_9217 = tmp_41_15_5_i_fu_5612_p2.read(); tmp_41_15_6_i_reg_9222 = tmp_41_15_6_i_fu_5632_p2.read(); tmp_41_15_7_i_reg_9227 = tmp_41_15_7_i_fu_5652_p2.read(); tmp_41_15_i_reg_9192 = tmp_41_15_i_fu_5512_p2.read(); tmp_41_1_1_i_reg_8637 = tmp_41_1_1_i_fu_3348_p2.read(); tmp_41_1_2_i_reg_8642 = tmp_41_1_2_i_fu_3368_p2.read(); tmp_41_1_3_i_reg_8647 = tmp_41_1_3_i_fu_3388_p2.read(); tmp_41_1_4_i_reg_8652 = tmp_41_1_4_i_fu_3408_p2.read(); tmp_41_1_5_i_reg_8657 = tmp_41_1_5_i_fu_3428_p2.read(); tmp_41_1_6_i_reg_8662 = tmp_41_1_6_i_fu_3448_p2.read(); tmp_41_1_7_i_reg_8667 = tmp_41_1_7_i_fu_3468_p2.read(); tmp_41_1_i_reg_8632 = tmp_41_1_i_fu_3328_p2.read(); tmp_41_2_1_i_reg_8677 = tmp_41_2_1_i_fu_3504_p2.read(); tmp_41_2_2_i_reg_8682 = tmp_41_2_2_i_fu_3524_p2.read(); tmp_41_2_3_i_reg_8687 = tmp_41_2_3_i_fu_3544_p2.read(); tmp_41_2_4_i_reg_8692 = tmp_41_2_4_i_fu_3564_p2.read(); tmp_41_2_5_i_reg_8697 = tmp_41_2_5_i_fu_3584_p2.read(); tmp_41_2_6_i_reg_8702 = tmp_41_2_6_i_fu_3604_p2.read(); tmp_41_2_7_i_reg_8707 = tmp_41_2_7_i_fu_3624_p2.read(); tmp_41_2_i_reg_8672 = tmp_41_2_i_fu_3484_p2.read(); tmp_41_3_1_i_reg_8717 = tmp_41_3_1_i_fu_3660_p2.read(); tmp_41_3_2_i_reg_8722 = tmp_41_3_2_i_fu_3680_p2.read(); tmp_41_3_3_i_reg_8727 = tmp_41_3_3_i_fu_3700_p2.read(); tmp_41_3_4_i_reg_8732 = tmp_41_3_4_i_fu_3720_p2.read(); tmp_41_3_5_i_reg_8737 = tmp_41_3_5_i_fu_3740_p2.read(); tmp_41_3_6_i_reg_8742 = tmp_41_3_6_i_fu_3760_p2.read(); tmp_41_3_7_i_reg_8747 = tmp_41_3_7_i_fu_3780_p2.read(); tmp_41_3_i_reg_8712 = tmp_41_3_i_fu_3640_p2.read(); tmp_41_4_1_i_reg_8757 = tmp_41_4_1_i_fu_3816_p2.read(); tmp_41_4_2_i_reg_8762 = tmp_41_4_2_i_fu_3836_p2.read(); tmp_41_4_3_i_reg_8767 = tmp_41_4_3_i_fu_3856_p2.read(); tmp_41_4_4_i_reg_8772 = tmp_41_4_4_i_fu_3876_p2.read(); tmp_41_4_5_i_reg_8777 = tmp_41_4_5_i_fu_3896_p2.read(); tmp_41_4_6_i_reg_8782 = tmp_41_4_6_i_fu_3916_p2.read(); tmp_41_4_7_i_reg_8787 = tmp_41_4_7_i_fu_3936_p2.read(); tmp_41_4_i_reg_8752 = tmp_41_4_i_fu_3796_p2.read(); tmp_41_5_1_i_reg_8797 = tmp_41_5_1_i_fu_3972_p2.read(); tmp_41_5_2_i_reg_8802 = tmp_41_5_2_i_fu_3992_p2.read(); tmp_41_5_3_i_reg_8807 = tmp_41_5_3_i_fu_4012_p2.read(); tmp_41_5_4_i_reg_8812 = tmp_41_5_4_i_fu_4032_p2.read(); tmp_41_5_5_i_reg_8817 = tmp_41_5_5_i_fu_4052_p2.read(); tmp_41_5_6_i_reg_8822 = tmp_41_5_6_i_fu_4072_p2.read(); tmp_41_5_7_i_reg_8827 = tmp_41_5_7_i_fu_4092_p2.read(); tmp_41_5_i_reg_8792 = tmp_41_5_i_fu_3952_p2.read(); tmp_41_6_1_i_reg_8837 = tmp_41_6_1_i_fu_4128_p2.read(); tmp_41_6_2_i_reg_8842 = tmp_41_6_2_i_fu_4148_p2.read(); tmp_41_6_3_i_reg_8847 = tmp_41_6_3_i_fu_4168_p2.read(); tmp_41_6_4_i_reg_8852 = tmp_41_6_4_i_fu_4188_p2.read(); tmp_41_6_5_i_reg_8857 = tmp_41_6_5_i_fu_4208_p2.read(); tmp_41_6_6_i_reg_8862 = tmp_41_6_6_i_fu_4228_p2.read(); tmp_41_6_7_i_reg_8867 = tmp_41_6_7_i_fu_4248_p2.read(); tmp_41_6_i_reg_8832 = tmp_41_6_i_fu_4108_p2.read(); tmp_41_7_1_i_reg_8877 = tmp_41_7_1_i_fu_4284_p2.read(); tmp_41_7_2_i_reg_8882 = tmp_41_7_2_i_fu_4304_p2.read(); tmp_41_7_3_i_reg_8887 = tmp_41_7_3_i_fu_4324_p2.read(); tmp_41_7_4_i_reg_8892 = tmp_41_7_4_i_fu_4344_p2.read(); tmp_41_7_5_i_reg_8897 = tmp_41_7_5_i_fu_4364_p2.read(); tmp_41_7_6_i_reg_8902 = tmp_41_7_6_i_fu_4384_p2.read(); tmp_41_7_7_i_reg_8907 = tmp_41_7_7_i_fu_4404_p2.read(); tmp_41_7_i_reg_8872 = tmp_41_7_i_fu_4264_p2.read(); tmp_41_8_1_i_reg_8917 = tmp_41_8_1_i_fu_4440_p2.read(); tmp_41_8_2_i_reg_8922 = tmp_41_8_2_i_fu_4460_p2.read(); tmp_41_8_3_i_reg_8927 = tmp_41_8_3_i_fu_4480_p2.read(); tmp_41_8_4_i_reg_8932 = tmp_41_8_4_i_fu_4500_p2.read(); tmp_41_8_5_i_reg_8937 = tmp_41_8_5_i_fu_4520_p2.read(); tmp_41_8_6_i_reg_8942 = tmp_41_8_6_i_fu_4540_p2.read(); tmp_41_8_7_i_reg_8947 = tmp_41_8_7_i_fu_4560_p2.read(); tmp_41_8_i_reg_8912 = tmp_41_8_i_fu_4420_p2.read(); tmp_41_9_1_i_reg_8957 = tmp_41_9_1_i_fu_4596_p2.read(); tmp_41_9_2_i_reg_8962 = tmp_41_9_2_i_fu_4616_p2.read(); tmp_41_9_3_i_reg_8967 = tmp_41_9_3_i_fu_4636_p2.read(); tmp_41_9_4_i_reg_8972 = tmp_41_9_4_i_fu_4656_p2.read(); tmp_41_9_5_i_reg_8977 = tmp_41_9_5_i_fu_4676_p2.read(); tmp_41_9_6_i_reg_8982 = tmp_41_9_6_i_fu_4696_p2.read(); tmp_41_9_7_i_reg_8987 = tmp_41_9_7_i_fu_4716_p2.read(); tmp_41_9_i_reg_8952 = tmp_41_9_i_fu_4576_p2.read(); } if ((!((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter3.read()))) { accu_V_0_0_i_fu_392 = accu_0_0_V_fu_5919_p2.read(); accu_V_0_10_i_fu_432 = accu_0_10_V_fu_6799_p2.read(); accu_V_0_11_i_fu_436 = accu_0_11_V_fu_6887_p2.read(); accu_V_0_12_i_fu_440 = accu_0_12_V_fu_6975_p2.read(); accu_V_0_13_i_fu_444 = accu_0_13_V_fu_7063_p2.read(); accu_V_0_14_i_fu_448 = accu_0_14_V_fu_7151_p2.read(); accu_V_0_15_i_fu_452 = accu_0_15_V_fu_7239_p2.read(); accu_V_0_1_i_fu_396 = accu_0_1_V_fu_6007_p2.read(); accu_V_0_2_i_fu_400 = accu_0_2_V_fu_6095_p2.read(); accu_V_0_3_i_fu_404 = accu_0_3_V_fu_6183_p2.read(); accu_V_0_4_i_fu_408 = accu_0_4_V_fu_6271_p2.read(); accu_V_0_5_i_fu_412 = accu_0_5_V_fu_6359_p2.read(); accu_V_0_6_i_fu_416 = accu_0_6_V_fu_6447_p2.read(); accu_V_0_7_i_fu_420 = accu_0_7_V_fu_6535_p2.read(); accu_V_0_8_i_fu_424 = accu_0_8_V_fu_6623_p2.read(); accu_V_0_9_i_fu_428 = accu_0_9_V_fu_6711_p2.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))))) { ap_pipeline_reg_pp0_iter1_exitcond_i_reg_8319 = exitcond_i_reg_8319.read(); ap_pipeline_reg_pp0_iter1_nf_assign_load_reg_8365 = nf_assign_load_reg_8365.read(); ap_pipeline_reg_pp0_iter1_tmp_4_i_reg_8341 = tmp_4_i_reg_8341.read(); ap_pipeline_reg_pp0_iter1_tmp_5_i_reg_8361 = tmp_5_i_reg_8361.read(); ap_pipeline_reg_pp0_iter1_tmp_i_reg_8328 = tmp_i_reg_8328.read(); exitcond_i_reg_8319 = exitcond_i_fu_1686_p2.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))))) { inElem_V_2_reg_8375 = inElem_V_2_fu_2155_p130.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,1,1>(ap_const_lv1_0, exitcond_i_fu_1686_p2.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_5_i_fu_1732_p2.read()))) { nf_assign_load_reg_8365 = nf_assign_fu_976.read(); tmp_6_i_reg_8370 = tmp_6_i_fu_1752_p2.read(); } if ((!((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter2_tmp_5_i_reg_8361.read()))) { threshs3_m_threshold_11_reg_9417 = threshs3_m_threshold_4_q0.read(); threshs3_m_threshold_13_reg_9422 = threshs3_m_threshold_3_q0.read(); threshs3_m_threshold_15_reg_9427 = threshs3_m_threshold_2_q0.read(); threshs3_m_threshold_17_reg_9432 = threshs3_m_threshold_1_q0.read(); threshs3_m_threshold_19_reg_9437 = threshs3_m_threshold_q0.read(); threshs3_m_threshold_1_reg_9392 = threshs3_m_threshold_15_q0.read(); threshs3_m_threshold_21_reg_9442 = threshs3_m_threshold_13_q0.read(); threshs3_m_threshold_23_reg_9447 = threshs3_m_threshold_12_q0.read(); threshs3_m_threshold_25_reg_9452 = threshs3_m_threshold_11_q0.read(); threshs3_m_threshold_27_reg_9457 = threshs3_m_threshold_10_q0.read(); threshs3_m_threshold_29_reg_9462 = threshs3_m_threshold_9_q0.read(); threshs3_m_threshold_31_reg_9467 = threshs3_m_threshold_8_q0.read(); threshs3_m_threshold_3_reg_9397 = threshs3_m_threshold_14_q0.read(); threshs3_m_threshold_5_reg_9402 = threshs3_m_threshold_7_q0.read(); threshs3_m_threshold_7_reg_9407 = threshs3_m_threshold_6_q0.read(); threshs3_m_threshold_9_reg_9412 = threshs3_m_threshold_5_q0.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,1,1>(ap_const_lv1_0, exitcond_i_fu_1686_p2.read()))) { tmp_4_i_reg_8341 = tmp_4_i_fu_1720_p2.read(); tmp_5_i_reg_8361 = tmp_5_i_fu_1732_p2.read(); tmp_i_reg_8328 = tmp_i_fu_1700_p2.read(); } if ((esl_seteq<1,1,1>(ap_CS_fsm_state1.read(), ap_const_lv1_1) && !esl_seteq<1,1,1>(ap_condition_300.read(), ap_const_boolean_1))) { tmp_6149_reg_8314 = tmp_6149_fu_1670_p2.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,1,1>(ap_const_lv1_0, exitcond_i_fu_1686_p2.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_fu_1700_p2.read()))) { tmp_6150_reg_8337 = tmp_6150_fu_1713_p1.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,1,1>(ap_const_lv1_0, exitcond_i_fu_1686_p2.read()) && esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_fu_1700_p2.read()))) { tmp_6151_reg_8332 = tmp_6151_fu_1709_p1.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_2F))) { tmp_V_100_fu_652 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_30))) { tmp_V_101_fu_656 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_31))) { tmp_V_102_fu_660 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_32))) { tmp_V_103_fu_664 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_33))) { tmp_V_104_fu_668 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_34))) { tmp_V_105_fu_672 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_35))) { tmp_V_106_fu_676 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_36))) { tmp_V_107_fu_680 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_37))) { tmp_V_108_fu_684 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_38))) { tmp_V_109_fu_688 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_39))) { tmp_V_110_fu_692 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_3A))) { tmp_V_111_fu_696 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_3B))) { tmp_V_112_fu_700 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_3C))) { tmp_V_113_fu_704 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_3D))) { tmp_V_114_fu_708 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_3E))) { tmp_V_115_fu_712 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_3F))) { tmp_V_116_fu_716 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_40))) { tmp_V_117_fu_720 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_41))) { tmp_V_118_fu_724 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_42))) { tmp_V_119_fu_728 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_43))) { tmp_V_120_fu_732 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_44))) { tmp_V_121_fu_736 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_45))) { tmp_V_122_fu_740 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_46))) { tmp_V_123_fu_744 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_47))) { tmp_V_124_fu_748 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_48))) { tmp_V_125_fu_752 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_49))) { tmp_V_126_fu_756 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_4A))) { tmp_V_127_fu_760 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_4B))) { tmp_V_128_fu_764 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_4C))) { tmp_V_129_fu_768 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_4D))) { tmp_V_130_fu_772 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_4E))) { tmp_V_131_fu_776 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_4F))) { tmp_V_132_fu_780 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_50))) { tmp_V_133_fu_784 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_51))) { tmp_V_134_fu_788 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_52))) { tmp_V_135_fu_792 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_53))) { tmp_V_136_fu_796 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_54))) { tmp_V_137_fu_800 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_55))) { tmp_V_138_fu_804 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_56))) { tmp_V_139_fu_808 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_57))) { tmp_V_140_fu_812 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_58))) { tmp_V_141_fu_816 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_59))) { tmp_V_142_fu_820 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_5A))) { tmp_V_143_fu_824 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_5B))) { tmp_V_144_fu_828 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_5C))) { tmp_V_145_fu_832 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_5D))) { tmp_V_146_fu_836 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_5E))) { tmp_V_147_fu_840 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_5F))) { tmp_V_148_fu_844 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_60))) { tmp_V_149_fu_848 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_61))) { tmp_V_150_fu_852 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_62))) { tmp_V_151_fu_856 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_63))) { tmp_V_152_fu_860 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_64))) { tmp_V_153_fu_864 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_65))) { tmp_V_154_fu_868 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_66))) { tmp_V_155_fu_872 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_67))) { tmp_V_156_fu_876 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_68))) { tmp_V_157_fu_880 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_69))) { tmp_V_158_fu_884 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_6A))) { tmp_V_159_fu_888 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_6B))) { tmp_V_160_fu_892 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_6C))) { tmp_V_161_fu_896 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_6D))) { tmp_V_162_fu_900 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_6E))) { tmp_V_163_fu_904 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_6F))) { tmp_V_164_fu_908 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_70))) { tmp_V_165_fu_912 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_71))) { tmp_V_166_fu_916 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_72))) { tmp_V_167_fu_920 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_73))) { tmp_V_168_fu_924 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_74))) { tmp_V_169_fu_928 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_75))) { tmp_V_170_fu_932 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_76))) { tmp_V_171_fu_936 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_77))) { tmp_V_172_fu_940 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_78))) { tmp_V_173_fu_944 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_79))) { tmp_V_174_fu_948 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_7A))) { tmp_V_175_fu_952 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_7B))) { tmp_V_176_fu_956 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_7C))) { tmp_V_177_fu_960 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_7D))) { tmp_V_178_fu_964 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_7E))) { tmp_V_179_fu_968 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_7F))) { tmp_V_180_fu_972 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_1))) { tmp_V_54_fu_468 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_2))) { tmp_V_55_fu_472 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_3))) { tmp_V_56_fu_476 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_4))) { tmp_V_57_fu_480 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_5))) { tmp_V_58_fu_484 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_6))) { tmp_V_59_fu_488 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_7))) { tmp_V_60_fu_492 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_8))) { tmp_V_61_fu_496 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_9))) { tmp_V_62_fu_500 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_A))) { tmp_V_63_fu_504 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_B))) { tmp_V_64_fu_508 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_C))) { tmp_V_65_fu_512 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_D))) { tmp_V_66_fu_516 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_E))) { tmp_V_67_fu_520 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_F))) { tmp_V_68_fu_524 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_10))) { tmp_V_69_fu_528 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_11))) { tmp_V_70_fu_532 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_12))) { tmp_V_71_fu_536 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_13))) { tmp_V_72_fu_540 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_14))) { tmp_V_73_fu_544 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_15))) { tmp_V_74_fu_548 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_16))) { tmp_V_75_fu_552 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_17))) { tmp_V_76_fu_556 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_18))) { tmp_V_77_fu_560 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_19))) { tmp_V_78_fu_564 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_1A))) { tmp_V_79_fu_568 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_1B))) { tmp_V_80_fu_572 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_1C))) { tmp_V_81_fu_576 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_1D))) { tmp_V_82_fu_580 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_1E))) { tmp_V_83_fu_584 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_1F))) { tmp_V_84_fu_588 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_20))) { tmp_V_85_fu_592 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_21))) { tmp_V_86_fu_596 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_22))) { tmp_V_87_fu_600 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_23))) { tmp_V_88_fu_604 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_24))) { tmp_V_89_fu_608 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_25))) { tmp_V_90_fu_612 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_26))) { tmp_V_91_fu_616 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_27))) { tmp_V_92_fu_620 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_28))) { tmp_V_93_fu_624 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_29))) { tmp_V_94_fu_628 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_2A))) { tmp_V_95_fu_632 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_2B))) { tmp_V_96_fu_636 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_2C))) { tmp_V_97_fu_640 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_2D))) { tmp_V_98_fu_644 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_2E))) { tmp_V_99_fu_648 = in_V_V_dout.read(); } if ((esl_seteq<1,1,1>(ap_const_lv1_1, ap_CS_fsm_pp0_stage0.read()) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(exitcond_i_reg_8319.read(), ap_const_lv1_0) && !esl_seteq<1,1,1>(ap_const_lv1_0, tmp_i_reg_8328.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,7,7>(tmp_6150_reg_8337.read(), ap_const_lv7_0))) { tmp_V_fu_464 = in_V_V_dout.read(); } } void Matrix_Vector_Activa_1::thread_ap_NS_fsm() { switch (ap_CS_fsm.read().to_uint64()) { case 1 : if (!esl_seteq<1,1,1>(ap_condition_300.read(), ap_const_boolean_1)) { ap_NS_fsm = ap_ST_fsm_pp0_stage0; } else { ap_NS_fsm = ap_ST_fsm_state1; } break; case 2 : if ((!(esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && !esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter3.read())) && !(!((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter0.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, exitcond_i_fu_1686_p2.read()) && !esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read())))) { ap_NS_fsm = ap_ST_fsm_pp0_stage0; } else if (((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && !esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter3.read())) || (!((esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read()) && esl_seteq<1,1,1>(ap_condition_308.read(), ap_const_boolean_1)) || (esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter4.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, ap_pipeline_reg_pp0_iter3_tmp_5_i_reg_8361.read()) && esl_seteq<1,1,1>(out_V_V_full_n.read(), ap_const_logic_0))) && esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter0.read()) && !esl_seteq<1,1,1>(ap_const_lv1_0, exitcond_i_fu_1686_p2.read()) && !esl_seteq<1,1,1>(ap_const_logic_1, ap_enable_reg_pp0_iter1.read())))) { ap_NS_fsm = ap_ST_fsm_state7; } else { ap_NS_fsm = ap_ST_fsm_pp0_stage0; } break; case 4 : ap_NS_fsm = ap_ST_fsm_state1; break; default : ap_NS_fsm = "XXX"; break; } } }
94.06855
341
0.713828
IceyFong
4e26668966a1c7e7bfc1789acf6637fae71f1fd5
15,052
cpp
C++
wikidiff2/Wikidiff2.cpp
uesp/uesp-setup
353a09cd199cffb1c339f34080775bb9c6c07918
[ "MIT" ]
null
null
null
wikidiff2/Wikidiff2.cpp
uesp/uesp-setup
353a09cd199cffb1c339f34080775bb9c6c07918
[ "MIT" ]
null
null
null
wikidiff2/Wikidiff2.cpp
uesp/uesp-setup
353a09cd199cffb1c339f34080775bb9c6c07918
[ "MIT" ]
null
null
null
/** * Diff formatter, based on code by Steinar H. Gunderson, converted to work with the * Dairiki diff engine by Tim Starling * * GPL. */ #include <stdio.h> #include <string.h> #include <sstream> #include <stdarg.h> #include "Wikidiff2.h" #include <regex> void Wikidiff2::diffLines(const StringVector & lines1, const StringVector & lines2, int numContextLines, int maxMovedLines) { // first do line-level diff StringDiff linediff(lines1, lines2); int from_index = 1, to_index = 1; // Should a line number be printed before the next context line? // Set to true initially so we get a line number on line 1 bool showLineNumber = true; if (needsJSONFormat()) { result += "{\"diff\": ["; } for (int i = 0; i < linediff.size(); ++i) { int n, j, n1, n2; // Line 1 changed, show heading with no leading context if (linediff[i].op != DiffOp<String>::copy && i == 0) { printBlockHeader(1, 1); } switch (linediff[i].op) { case DiffOp<String>::add: // inserted lines n = linediff[i].to.size(); for (j=0; j<n; j++) { if (!printMovedLineDiff(linediff, i, j, maxMovedLines, from_index, to_index+j)) { printAdd(*linediff[i].to[j], from_index, to_index+j); } } to_index += n; break; case DiffOp<String>::del: // deleted lines n = linediff[i].from.size(); for (j=0; j<n; j++) { if (!printMovedLineDiff(linediff, i, j, maxMovedLines, from_index+j, to_index)) { printDelete(*linediff[i].from[j], from_index+j, to_index); } } from_index += n; break; case DiffOp<String>::copy: // copy/context n = linediff[i].from.size(); for (j=0; j<n; j++) { if ((i != 0 && j < numContextLines) /*trailing*/ || (i != linediff.size() - 1 && j >= n - numContextLines)) /*leading*/ { if (showLineNumber) { printBlockHeader(from_index, to_index); showLineNumber = false; } printContext(*linediff[i].from[j], from_index, to_index); } else { showLineNumber = true; } from_index++; to_index++; } break; case DiffOp<String>::change: // replace, i.e. we do a word diff between the two sets of lines n1 = linediff[i].from.size(); n2 = linediff[i].to.size(); n = std::min(n1, n2); for (j=0; j<n; j++) { printWordDiff(*linediff[i].from[j], *linediff[i].to[j], from_index+j, to_index+j); } from_index += n; to_index += n; break; } // Not first line anymore, don't show line number by default showLineNumber = false; } if (needsJSONFormat()) { result += "]}"; } } bool Wikidiff2::printMovedLineDiff(StringDiff & linediff, int opIndex, int opLine, int maxMovedLines, int leftLine, int rightLine) { // helper fn creates 64-bit lookup key from opIndex and opLine auto makeKey = [](int index, int line) { return uint64_t(index) << 32 | line; }; auto makeAnchorName = [](int index, int line, bool lhs) { char ch[2048]; snprintf(ch, sizeof(ch), "movedpara_%d_%d_%s", index, line, lhs? "lhs": "rhs"); return String(ch); }; // check whether this paragraph immediately follows the other. // if so, they will be matched up next to each other and displayed as a change, not a move. auto isNext = [] (int opIndex, int opLine, int otherIndex, int otherLine) { if(otherIndex==opIndex && otherLine==opLine+1) return true; if(otherIndex==opIndex+1 && otherLine==0) return true; return false; }; // compare positions of moved lines, return true if moved downwards auto movedir = [] (int opIndex, int opLine, int otherIndex, int otherLine) { return (otherIndex > opIndex) || (otherIndex == opIndex && otherLine > opLine); }; #ifdef DEBUG_MOVED_LINES auto debugPrintf = [this](const char *fmt, ...) { char ch[2048]; va_list ap; va_start(ap, fmt); vsnprintf(ch, sizeof(ch), fmt, ap); va_end(ap); result += "<tr><td /><td class=\"diff-context\" colspan=3>"; result += ch; result += "</td></tr>"; }; #else auto debugPrintf = [](...) { }; #endif if(!allowPrintMovedLineDiff(linediff, maxMovedLines)) { debugPrintf("printMovedLineDiff: diff too large (maxMovedLines=%ld), not detecting moved lines", maxMovedLines); return false; } debugPrintf("printMovedLineDiff (...), %d, %d\n", opIndex, opLine); bool printLeft = linediff[opIndex].op == DiffOp<String>::del ? true : false; bool printRight = !printLeft; // check whether this op actually refers to the diff map entry auto cmpDiffMapEntries = [&](int otherIndex, int otherLine) -> bool { // check whether the other paragraph already exists in the diff map. uint64_t otherKey = makeKey(otherIndex, otherLine); auto it = diffMap.find(otherKey); if (it != diffMap.end()) { // if found, check whether it refers to the current paragraph. auto other = it->second; bool cmp = (printLeft ? other->opIndexFrom == opIndex && other->opLineFrom == opLine : other->opIndexTo == opIndex && other->opLineTo == opLine); if(!cmp && (printLeft ? other->lhsDisplayed : other->rhsDisplayed)) { // the paragraph was already moved to a different place. a move operation can only have one source and one destination. debugPrintf("printMovedLineDiff(..., %d, %d): excluding this candidate (multiple potential matches). op=%s, printLeft %s, otheridx/line %d/%d, found %d/%d, other->lhsDisplayed %s, other->rhsDisplayed %s", opIndex, opLine, linediff[opIndex].op == DiffOp<String>::add ? "add": linediff[opIndex].op == DiffOp<String>::del ? "del": "???", printLeft ? "true" : "false", otherIndex, otherLine, (printLeft ? other->opIndexFrom : other->opIndexTo), (printLeft? other->opLineFrom: other->opLineTo), other->lhsDisplayed ? "true" : "false", other->rhsDisplayed ? "true" : "false"); return false; } // the entry in the diff map refers to this paragraph. debugPrintf("printMovedLineDiff(..., %d, %d): diffMap entry refers to this paragraph (or other side not displayed). op=%s, printLeft %s, otheridx/line %d/%d, found %d/%d", opIndex, opLine, linediff[opIndex].op == DiffOp<String>::add ? "add": linediff[opIndex].op == DiffOp<String>::del ? "del": "???", printLeft ? "true" : "false", otherIndex, otherLine, (printLeft ? other->opIndexFrom : other->opIndexTo), (printLeft? other->opLineFrom: other->opLineTo)); return true; } // no entry in the diffMap. debugPrintf("printMovedLineDiff(..., %d, %d): no diffMap entry found. op=%s, printLeft %s, otheridx/line %d/%d", opIndex, opLine, linediff[opIndex].op == DiffOp<String>::add ? "add": linediff[opIndex].op == DiffOp<String>::del ? "del": "???", printLeft ? "true" : "false", otherIndex, otherLine); return true; }; // look for corresponding moved line for the opposite case in moved-line-map // if moved line exists: // print diff to the moved line, omitting the left/right side for added/deleted line uint64_t key = makeKey(opIndex, opLine); auto it = diffMap.find(key); if (it != diffMap.end()) { auto best = it->second; int otherIndex = linediff[opIndex].op == DiffOp<String>::add ? best->opIndexFrom : best->opIndexTo; int otherLine = linediff[opIndex].op == DiffOp<String>::add ? best->opLineFrom : best->opLineTo; if(!cmpDiffMapEntries(otherIndex, otherLine)) return false; if(isNext(otherIndex, otherLine, opIndex, opLine)) { debugPrintf("this one was already shown as a change, not displaying again..."); return true; } else { // XXXX todo: we already have the diff, don't have to do it again, just have to print it printWordDiff(*linediff[best->opIndexFrom].from[best->opLineFrom], *linediff[best->opIndexTo].to[best->opLineTo], leftLine, rightLine, printLeft, printRight, makeAnchorName(opIndex, opLine, printLeft), makeAnchorName(otherIndex, otherLine, !printLeft), movedir(opIndex,opLine, otherIndex,otherLine)); } if(printLeft) best->lhsDisplayed = true; else best->rhsDisplayed = true; debugPrintf("found in diffmap. copy: %d, del: %d, add: %d, change: %d, similarity: %.4f\n" "from: (%d,%d) to: (%d,%d)\n", best->ds.opCharCount[DiffOp<Word>::copy], best->ds.opCharCount[DiffOp<Word>::del], best->ds.opCharCount[DiffOp<Word>::add], best->ds.opCharCount[DiffOp<Word>::change], best->ds.charSimilarity, best->opIndexFrom, best->opLineFrom, best->opIndexTo, best->opLineTo); return true; } debugPrintf("nothing found in moved-line-map"); // else: // try to find a corresponding moved line in deleted/added lines int otherOp = (linediff[opIndex].op == DiffOp<String>::add ? DiffOp<String>::del : DiffOp<String>::add); std::shared_ptr<DiffMapEntry> found = nullptr; for (int i = 0; i < linediff.size(); ++i) { if (linediff[i].op == otherOp) { auto& lines = (linediff[opIndex].op == DiffOp<String>::add ? linediff[i].from : linediff[i].to); for (int k = 0; k < lines.size(); ++k) { auto it= diffMap.find(makeKey(i, k)); if(it!=diffMap.end()) { auto found = it->second; debugPrintf("found: lhsDisplayed=%s, rhsDisplayed=%s\n", found->lhsDisplayed? "true": "false", found->rhsDisplayed? "true": "false"); if( (printLeft && found->lhsDisplayed) || (printRight && found->rhsDisplayed) ) { debugPrintf("%chs already displayed, not considering this one", printLeft? 'l': 'r'); continue; } } WordVector words1, words2; std::shared_ptr<DiffMapEntry> tmp; TextUtil::explodeWords(*lines[k], words1); bool potentialMatch = false; if (otherOp == DiffOp<String>::del) { TextUtil::explodeWords(*linediff[opIndex].to[opLine], words2); tmp = std::make_shared<DiffMapEntry>(words2, words1, i, k, opIndex, opLine); potentialMatch = cmpDiffMapEntries(tmp->opIndexFrom, tmp->opLineFrom); } else { TextUtil::explodeWords(*linediff[opIndex].from[opLine], words2); tmp = std::make_shared<DiffMapEntry>(words1, words2, opIndex, opLine, i, k); potentialMatch = cmpDiffMapEntries(tmp->opIndexTo, tmp->opLineTo); } if (!found || (tmp->ds.charSimilarity > found->ds.charSimilarity) && potentialMatch) { found= tmp; } } } } if(found) debugPrintf("candidate found with similarity %.2f (from %d:%d to %d:%d)", found->ds.charSimilarity, found->opIndexFrom, found->opLineFrom, found->opIndexTo, found->opLineTo); // if candidate exists: // add candidate to moved-line-map twice, for add/del case // print diff to the moved line, omitting the left/right side for added/deleted line if (found && found->ds.charSimilarity > movedLineThreshold()) { // if we displayed a diff to the found block before, don't display this one as moved. int otherIndex = linediff[opIndex].op == DiffOp<String>::add ? found->opIndexFrom : found->opIndexTo; int otherLine = linediff[opIndex].op == DiffOp<String>::add ? found->opLineFrom : found->opLineTo; if(!cmpDiffMapEntries(otherIndex, otherLine)) return false; if(diffMap.find(makeKey(otherIndex, otherLine)) != diffMap.end()) { debugPrintf("found existing diffMap entry -- not overwriting."); return false; } if(printLeft) found->lhsDisplayed = true; else found->rhsDisplayed = true; diffMap[key] = found; diffMap[makeKey(otherIndex, otherLine)] = found; debugPrintf("inserting (%d,%d) + (%d,%d)", opIndex, opLine, otherIndex, otherLine); if(isNext(opIndex, opLine, otherIndex, otherLine)) { debugPrintf("This one immediately follows, displaying as change..."); printWordDiff(*linediff[found->opIndexFrom].from[found->opLineFrom], *linediff[found->opIndexTo].to[found->opLineTo], leftLine, rightLine); found->lhsDisplayed = true; found->rhsDisplayed = true; } else { // XXXX todo: we already have the diff, don't have to do it again, just have to print it printWordDiff(*linediff[found->opIndexFrom].from[found->opLineFrom], *linediff[found->opIndexTo].to[found->opLineTo], leftLine, rightLine, printLeft, printRight, makeAnchorName(opIndex, opLine, printLeft), makeAnchorName(otherIndex, otherLine, !printLeft), movedir(opIndex,opLine, otherIndex,otherLine)); } debugPrintf("copy: %d, del: %d, add: %d, change: %d, similarity: %.4f\n" "from: (%d,%d) to: (%d,%d)\n", found->ds.opCharCount[DiffOp<Word>::copy], found->ds.opCharCount[DiffOp<Word>::del], found->ds.opCharCount[DiffOp<Word>::add], found->ds.opCharCount[DiffOp<Word>::change], found->ds.charSimilarity, found->opIndexFrom, found->opLineFrom, found->opIndexTo, found->opLineTo); return true; } return false; } void Wikidiff2::debugPrintWordDiff(WordDiff & worddiff) { for (unsigned i = 0; i < worddiff.size(); ++i) { DiffOp<Word> & op = worddiff[i]; switch (op.op) { case DiffOp<Word>::copy: result += "Copy\n"; break; case DiffOp<Word>::del: result += "Delete\n"; break; case DiffOp<Word>::add: result += "Add\n"; break; case DiffOp<Word>::change: result += "Change\n"; break; } result += "From: "; bool first = true; for (int j=0; j<op.from.size(); j++) { if (first) { first = false; } else { result += ", "; } result += "("; result += op.from[j]->whole() + ")"; } result += "\n"; result += "To: "; first = true; for (int j=0; j<op.to.size(); j++) { if (first) { first = false; } else { result += ", "; } result += "("; result += op.to[j]->whole() + ")"; } result += "\n\n"; } } void Wikidiff2::printHtmlEncodedText(const String & input) { size_t start = 0; size_t end = input.find_first_of("<>&"); while (end != String::npos) { if (end > start) { result.append(input, start, end - start); } switch (input[end]) { case '<': result.append("&lt;"); break; case '>': result.append("&gt;"); break; default /*case '&'*/: result.append("&amp;"); } start = end + 1; end = input.find_first_of("<>&", start); } // Append the rest of the string after the last special character if (start < input.size()) { result.append(input, start, input.size() - start); } } void Wikidiff2::explodeLines(const String & text, StringVector &lines) { String::const_iterator ptr = text.begin(); while (ptr != text.end()) { String::const_iterator ptr2 = std::find(ptr, text.end(), '\n'); lines.push_back(String(ptr, ptr2)); ptr = ptr2; if (ptr != text.end()) { ++ptr; } } } const Wikidiff2::String & Wikidiff2::execute(const String & text1, const String & text2, int numContextLines, int maxMovedLines) { // Allocate some result space to avoid excessive copying result.clear(); result.reserve(text1.size() + text2.size() + 10000); // Split input strings into lines StringVector lines1; StringVector lines2; explodeLines(text1, lines1); explodeLines(text2, lines2); // Do the diff diffLines(lines1, lines2, numContextLines, maxMovedLines); // Return a reference to the result buffer return result; } const Wikidiff2::String Wikidiff2::toString(long input) { StringStream stream; stream << input; return String(stream.str()); } bool Wikidiff2::needsJSONFormat() { return false; }
34.287016
209
0.65493
uesp
89ed15d5ca81281b699841d2d4af850564034645
3,295
cpp
C++
ds/security/services/smartcrd/server/scardsvr/waitsam.cpp
npocmaka/Windows-Server-2003
5c6fe3db626b63a384230a1aa6b92ac416b0765f
[ "Unlicense" ]
17
2020-11-13T13:42:52.000Z
2021-09-16T09:13:13.000Z
ds/security/services/smartcrd/server/scardsvr/waitsam.cpp
sancho1952007/Windows-Server-2003
5c6fe3db626b63a384230a1aa6b92ac416b0765f
[ "Unlicense" ]
2
2020-10-19T08:02:06.000Z
2020-10-19T08:23:18.000Z
ds/security/services/smartcrd/server/scardsvr/waitsam.cpp
sancho1952007/Windows-Server-2003
5c6fe3db626b63a384230a1aa6b92ac416b0765f
[ "Unlicense" ]
14
2020-11-14T09:43:20.000Z
2021-08-28T08:59:57.000Z
/*++ Copyright (C) Microsoft Corporation, 1998 - 1999 Module Name: waitsam Abstract: This module provides back-door access to some internal NT routines. This is needed to get at the SAM Startup Event -- it has an illegal name from the Win32 routines, so we have to sneak back and pull it up from NT directly. Author: Doug Barlow (dbarlow) 5/3/1998 Notes: As taken from code suggested by MacM --*/ #define __SUBROUTINE__ #if !defined(_X86_) && !defined(_ALPHA_) #define _X86_ 1 #endif #ifndef _WIN32_WINNT #define _WIN32_WINNT 0x0400 #ifndef UNICODE #define UNICODE // Force this module to use UNICODE. #endif #endif #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN 1 #endif extern "C" { #include <nt.h> #include <ntrtl.h> #include <nturtl.h> #include <ntlsa.h> } #include <windows.h> /*++ AccessSAMEvent: This procedure opens the handle to the SAM Startup Event handle. Arguments: None Return Value: The handle, or NULL on an error. Author: Doug Barlow (dbarlow) 5/3/1998 --*/ #undef __SUBROUTINE__ #define __SUBROUTINE__ DBGT("AccessSAMEvent") HANDLE AccessSAMEvent( void) { NTSTATUS Status = STATUS_SUCCESS; UNICODE_STRING EventName; OBJECT_ATTRIBUTES EventAttributes; CHandleObject EventHandle(DBGT("Event Handle from AccessSAMEvent")); // // Open the event // RtlInitUnicodeString( &EventName, L"\\SAM_SERVICE_STARTED" ); InitializeObjectAttributes( &EventAttributes, &EventName, 0, 0, NULL ); Status = NtCreateEvent( &EventHandle, SYNCHRONIZE, &EventAttributes, NotificationEvent, FALSE ); // // If the event already exists, just open it. // if( Status == STATUS_OBJECT_NAME_EXISTS || Status == STATUS_OBJECT_NAME_COLLISION ) { Status = NtOpenEvent( &EventHandle, SYNCHRONIZE, &EventAttributes ); } return EventHandle; } /*++ WaitForSAMEvent: This procedure can be used to wait for the SAM Startup event using NT internal calls. I don't know how to specify a timeout value, so this routine isn't complete. Arguments: hSamActive supplies the handle to the SAM Startup Event. dwTimeout supplies the time to wait for the startup event, in milliseconds. Return Value: TRUE - The event was set. FALSE - The timeout expired Throws: Any errors are thrown as DWORD status codes. Author: Doug Barlow (dbarlow) 5/3/1998 --*/ #undef __SUBROUTINE__ #define __SUBROUTINE__ DBGT("WaitForSAMEvent") BOOL WaitForSAMEvent( HANDLE hSamActive, DWORD dwTimeout) { NTSTATUS Status = STATUS_SUCCESS; Status = NtWaitForSingleObject(hSamActive, TRUE, NULL); return Status; } /*++ CloseSamEvent: This procedure uses the NT internal routine to close a handle. Arguments: hSamActive supplies the handle to be closed. Return Value: None Author: Doug Barlow (dbarlow) 5/3/1998 --*/ #undef __SUBROUTINE__ #define __SUBROUTINE__ DBGT("CloseSAMEvent") void CloseSAMEvent( HANDLE hSamActive) { NtClose(hSamActive); }
18.407821
90
0.65736
npocmaka
89ed2835a07b2ca5ef38bcdd9efbcd1b02580d25
503
cpp
C++
src/10-2-1-26.cpp
XuZhixuan/cpp_homework
31bcfd9a8df4df3af354240dfa2d72ed3b62057e
[ "MIT" ]
3
2019-10-20T17:22:17.000Z
2021-01-13T04:32:55.000Z
src/10-2-1-26.cpp
XuZhixuan/cpp_homework
31bcfd9a8df4df3af354240dfa2d72ed3b62057e
[ "MIT" ]
null
null
null
src/10-2-1-26.cpp
XuZhixuan/cpp_homework
31bcfd9a8df4df3af354240dfa2d72ed3b62057e
[ "MIT" ]
null
null
null
#include <iostream> #include <cmath> double fun(double); int main() { using namespace std; float lower, upper; cin >> lower; cin >> upper; double step = (upper - lower) / 200; double sum = 0; double temp = 0; for (int i = 0; i < 200; i++) { temp = fun(lower); lower += step; temp += fun(lower); temp *= step / 2; sum += temp; } cout << sum << endl; return 0; } double fun(double x) { using namespace std; return sin(x) + exp(x); }
12.897436
38
0.532803
XuZhixuan
89ed9c9b2bee0a2efa6d1784ae4b2c1a3cc5f598
2,548
cpp
C++
tests/methodTask.cpp
DylanZA/eslang
341ed66b3c1a5cfbb0f859bfe1146e88697f59fd
[ "MIT" ]
15
2017-09-19T02:12:04.000Z
2021-05-01T13:12:51.000Z
tests/methodTask.cpp
DylanZA/eslang
341ed66b3c1a5cfbb0f859bfe1146e88697f59fd
[ "MIT" ]
null
null
null
tests/methodTask.cpp
DylanZA/eslang
341ed66b3c1a5cfbb0f859bfe1146e88697f59fd
[ "MIT" ]
null
null
null
#include <eslang/Context.h> #include <eslang/Logging.h> #include <gtest/gtest.h> #include "TestCommon.h" namespace s { class MethodCounter : public Process { public: int const kMax; MethodCounter(ProcessArgs i, int m = 256) : Process(std::move(i)), kMax(m) {} LIFETIMECHECK; MethodTask<int> subRun(int n) { LIFETIMECHECK; if (n > 0) { co_return co_await subRun(n - 1) + 1; } co_return 0; } ProcessTask run() { int our_value = co_await subRun(kMax); ASSERT_EQ(our_value, kMax); } }; class MethodBasic : public Process { public: using Process::Process; LIFETIMECHECK; MethodTask<int> retIntCoro(int i) { LIFETIMECHECK; co_return i; } MethodTask<> doNothingCoro() { LIFETIMECHECK; co_return; } ProcessTask run() { auto a = WaitingYield{}; auto c = doNothingCoro(); ASSERT_EQ(5, co_await retIntCoro(5)); co_await a; co_await c; } }; class MethodThrows : public Process { public: using Process::Process; LIFETIMECHECK; MethodTask<int> throwCoro(int i) { LIFETIMECHECK; co_await WaitingYield{}; ESLANGEXCEPT(); co_return i; } ProcessTask run() { LIFETIMECHECK; co_await throwCoro(5); FAIL(); } }; class MethodStackInversion : public Process { public: using Process::Process; LIFETIMECHECK; MethodTask<> C(bool should_sleep, int& finished) { LIFETIMECHECK; if (should_sleep) { co_await sleep(std::chrono::milliseconds(1)); } ++finished; } MethodTask<> B(bool should_sleep, int& finished) { LIFETIMECHECK; int i = 0; co_await C(true, i); EXPECT_EQ(1, i); if (should_sleep) { co_await sleep(std::chrono::milliseconds(1)); } co_await C(false, i); EXPECT_EQ(2, i); ++finished; } MethodTask<> A(int& finished) { LIFETIMECHECK; int i = 0; co_await B(false, i); EXPECT_EQ(1, i); co_await sleep(std::chrono::milliseconds(1)); co_await B(true, i); EXPECT_EQ(2, i); co_await B(true, i); EXPECT_EQ(3, i); ++finished; } ProcessTask run() { LIFETIMECHECK; int i = 0; ScopeRun sr([&] { EXPECT_EQ(i, 1); }); co_await A(i); } }; } template <class T> void run() { s::Context c; auto starter = c.spawn<T>(); c.run(); lifetimeChecker.check(); } TEST(MethodTask, Counter) { run<s::MethodCounter>(); } TEST(MethodTask, Basic) { run<s::MethodBasic>(); } TEST(MethodTask, Throws) { run<s::MethodThrows>(); } TEST(MethodTask, StackInversion) { run<s::MethodStackInversion>(); }
19.751938
79
0.628728
DylanZA
89efb0aca813eae615cb58674ae17bf1b0185498
5,105
cpp
C++
released_plugins/v3d_plugins/neurontracing_neutube/src_neutube/neurolabi/gui/zstackaccessor.cpp
zzhmark/vaa3d_tools
3ca418add85a59ac7e805d55a600b78330d7e53d
[ "MIT" ]
1
2021-12-27T19:14:03.000Z
2021-12-27T19:14:03.000Z
released_plugins/v3d_plugins/neurontracing_neutube/src_neutube/neurolabi/gui/zstackaccessor.cpp
zzhmark/vaa3d_tools
3ca418add85a59ac7e805d55a600b78330d7e53d
[ "MIT" ]
1
2016-12-03T05:33:13.000Z
2016-12-03T05:33:13.000Z
released_plugins/v3d_plugins/neurontracing_neutube/src_neutube/neurolabi/gui/zstackaccessor.cpp
zzhmark/vaa3d_tools
3ca418add85a59ac7e805d55a600b78330d7e53d
[ "MIT" ]
null
null
null
#include "zstackaccessor.h" #include <string.h> #include "tz_image_io.h" #include "tz_file_list.h" using namespace std; //Suppor 100M buffer int ZStackAccessor::m_capacity = 104857600; ZStackAccessor::ZStackAccessor() { m_buffer = NULL; m_bufferZStart = 0; m_width = 0; m_height = 0; m_byteNumberPerVoxel = 2; m_bufferDepth = 0; m_planeSize = 0; m_area = 0; m_rowSize = 0; } int ZStackAccessor::bufferDepthCapacity() { int planeSize = m_width * m_height * m_byteNumberPerVoxel; if (planeSize == 0) { return 0; } return m_capacity / planeSize; } int ZStackAccessor::bufferDepth() { return m_bufferDepth; } int ZStackAccessor::stackDepth() { return static_cast<int>(m_fileList.size()); } void ZStackAccessor::updateBuffer(int z) { int bdepth = bufferDepth(); int newBufferZStart = m_bufferZStart; int zStart = newBufferZStart; //The first image to load int depth = 0; //Number of images to be loaded in the buffer int bufferShift = 0; //Shift of the buffer to load new image if ((z >= m_bufferZStart + bdepth) || (z < m_bufferZStart)) { newBufferZStart = max(0, z - bdepth / 2); newBufferZStart = min(newBufferZStart, stackDepth() - bdepth); zStart = newBufferZStart; int planeSize = m_width * m_height * m_byteNumberPerVoxel; if (m_buffer != NULL) { if (newBufferZStart != m_bufferZStart) { depth = bdepth; int availableStart = m_bufferZStart; int availableDepth = 0; int zShift = -1; if (newBufferZStart > m_bufferZStart) { int bufferEnd = m_bufferZStart + bdepth; if (newBufferZStart < bufferEnd) { zShift = 0; availableStart = newBufferZStart - m_bufferZStart; availableDepth = bdepth - availableStart; bufferShift = availableDepth; zStart += availableDepth; } } else { if (newBufferZStart + bdepth > m_bufferZStart) { availableStart = 0; availableDepth = newBufferZStart + bdepth - m_bufferZStart; zShift = m_bufferZStart - newBufferZStart; } } if (availableDepth > 0) { depth -= availableDepth; memmove((char*)m_buffer + zShift * planeSize, (char*)m_buffer + availableStart * planeSize, planeSize * availableDepth); } } } else { m_bufferDepth = min(static_cast<int>(m_fileList.size()), bufferDepthCapacity()); m_buffer = (uint16_t*) malloc(m_width * m_height * bufferDepth() * m_byteNumberPerVoxel); depth = bufferDepth(); newBufferZStart = max(0, z - depth / 2); newBufferZStart = min(newBufferZStart, stackDepth() - depth); zStart = newBufferZStart; } } loadImage(bufferShift, zStart, depth); m_bufferZStart = newBufferZStart; } void ZStackAccessor::loadImage(int bufferShift, int zStart, int depth) { int planeSize = m_width * m_height * m_byteNumberPerVoxel; char *buffer = (char*) m_buffer + planeSize * bufferShift; for (int i = 0; i < depth; i++) { Stack *stack = Read_Stack_U(m_fileList[i + zStart].c_str()); memcpy((char*)buffer + planeSize * i, stack->array, planeSize); Kill_Stack(stack); } } void ZStackAccessor::attachFileList(std::string dirPath, std::string ext) { File_List *fileList = File_List_Load_Dir(dirPath.c_str(), ext.c_str(), NULL); File_List_Sort_By_Number(fileList); m_fileList.resize(fileList->file_number); for (int i = 0; i < fileList->file_number; i++) { m_fileList[i] = fileList->file_path[i]; } if (m_fileList.size() > 0) { Stack *stack = Read_Stack_U(fileList->file_path[0]); m_width = stack->width; m_height = stack->height; m_byteNumberPerVoxel = stack->kind; m_area = m_width * m_height; m_planeSize = m_area * m_byteNumberPerVoxel; m_rowSize = m_width * m_byteNumberPerVoxel; Kill_Stack(stack); } } void ZStackAccessor::exportBuffer(std::string filePath) { int depth = min(stackDepth(), bufferDepth()); if ((m_buffer != NULL) && (depth > 0)) { Stack stack; stack.array = (uint8*) m_buffer; stack.width = m_width; stack.height = m_height; stack.depth = depth; stack.kind = m_byteNumberPerVoxel; stack.text = const_cast<char*>(""); Write_Stack_U(filePath.c_str(), &stack, NULL); } } double ZStackAccessor::voxel(int x, int y, int z) { updateBuffer(z); z -= m_bufferZStart; return m_buffer[z * m_width * m_height + y * m_width + x]; } void* ZStackAccessor::rowPointer(int y, int z) { updateBuffer(z); z-= m_bufferZStart; char *buffer = (char*) m_buffer + (z * m_area + y * m_width) * m_byteNumberPerVoxel; return static_cast<void*>(buffer); } void* ZStackAccessor::planePointer(int z) { updateBuffer(z); z-= m_bufferZStart; char *buffer = (char*) m_buffer + z * m_planeSize; return static_cast<void*>(buffer); } void* ZStackAccessor::wholePointer() { if (bufferDepth() >= stackDepth()) { return static_cast<void*>(m_buffer); } return NULL; }
26.045918
79
0.646425
zzhmark
89f361df2f866028bcf6ca3433e4d10791657ae1
449
cpp
C++
6 star Problem Solving/Algorithms/String/Beautiful Binary String.cpp
TheCodeAlpha26/Hackerrank-Demystified
03713a8f3a05e5d6dfed6f6808b06340558e2310
[ "Apache-2.0" ]
6
2021-04-26T17:09:54.000Z
2021-07-08T17:36:16.000Z
6 star Problem Solving/Algorithms/String/Beautiful Binary String.cpp
TheCodeAlpha26/Hackerrank-Demystified
03713a8f3a05e5d6dfed6f6808b06340558e2310
[ "Apache-2.0" ]
null
null
null
6 star Problem Solving/Algorithms/String/Beautiful Binary String.cpp
TheCodeAlpha26/Hackerrank-Demystified
03713a8f3a05e5d6dfed6f6808b06340558e2310
[ "Apache-2.0" ]
null
null
null
#include <bits/stdc++.h> using namespace std; int beautifulBinaryString(string s) { int c=0; for(int i=0;i<s.size()-2;i++) if(s[i]=='0'&&s[i+1]=='1'&&s[i+2]=='0') { c++; i+=2; } return(c); } int main() { int n; cin >> n; string b; cin>>b; int result = beautifulBinaryString(b); cout << result << "\n"; return 0; }
19.521739
53
0.407572
TheCodeAlpha26
89f43b6498c438f50f0e47087ae9536bb2b23999
6,209
cpp
C++
AntiAirborne/Sources/battle/ParatrooperNode.cpp
beardog-ukr/ubiquitous-spork
7f75d8f40dff70a965e901a4190dd35d64599441
[ "Unlicense" ]
null
null
null
AntiAirborne/Sources/battle/ParatrooperNode.cpp
beardog-ukr/ubiquitous-spork
7f75d8f40dff70a965e901a4190dd35d64599441
[ "Unlicense" ]
null
null
null
AntiAirborne/Sources/battle/ParatrooperNode.cpp
beardog-ukr/ubiquitous-spork
7f75d8f40dff70a965e901a4190dd35d64599441
[ "Unlicense" ]
null
null
null
#include "ParatrooperNode.h" using namespace anti_airborne; #include "ZOrderConstTypes.h" #include "ZOrderConstValues.h" #include "SixCatsLogger.h" #include "SixCatsLoggerMacro.h" #include <sstream> USING_NS_CC; using namespace std; //static const int kAngleManipulationActionTag = 21; //static const int kDistanceManipulationActionTag = 22; //static const float kAngleChangeInterval = 0.5; static const float kFadeinInterval = 3.0; static const float kFallingInterval = 20.0; static const struct { string body; string parachute; } kElementSpriteFileNames = { .body = "anti_aiborne/paratrooper/gunner_jump_00", .parachute = "anti_aiborne/paratrooper/para", }; static const int kJumpAnimationTag = 69; static const string kJumpAnimationName = "paratrooper_jump"; static const string kRunAnimationName = "paratrooper_run"; static const int kScreenMiddle = 640; static const int kEscapePointLeft = -30; static const int kEscapePointRight = 1280 + 30; static const float kEscapeVelocity = 75 / 1.0; // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ParatrooperNode::ParatrooperNode() { alive = true; } // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ParatrooperNode::~ParatrooperNode() { C6_F1(c6, "here"); } // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ParatrooperNode* ParatrooperNode::create(shared_ptr<SixCatsLogger> inC6) { ParatrooperNode *pRet = new(std::nothrow) ParatrooperNode(); if (pRet ==nullptr) { return nullptr; } pRet->setLogger(inC6); if (!pRet->initSelf()) { delete pRet; pRet = nullptr; return nullptr; } pRet->autorelease(); return pRet; } // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . void ParatrooperNode::doDie() { alive = false; parachute->stopAllActions(); body->stopAllActions(); stopAllActions(); body->runAction(FadeOut::create(kFadeinInterval)); parachute->runAction(FadeOut::create(kFadeinInterval)); } // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . void ParatrooperNode::doDrop(CallFunc *escapeNotifier) { C6_D6(c6, "Do drop with delay: ", dropDelay, "Drop point ", dropPoint.x, ":", dropPoint.y); setPosition(dropPoint); // --- para Sequence* seqPara = Sequence::create(DelayTime::create(dropDelay), FadeIn::create(kFadeinInterval), DelayTime::create(kFallingInterval-kFadeinInterval*2), FadeOut::create(kFadeinInterval), nullptr); parachute->runAction(seqPara); // --- body CallFunc* cf = CallFunc::create([this]() { this->body->setOpacity(255); }); Sequence* seqBody = Sequence::create(DelayTime::create(dropDelay), cf, nullptr); body->runAction(seqBody); // --- body animation Animation* animationE = AnimationCache::getInstance()->getAnimation(kJumpAnimationName); Animate* animateE = Animate::create(animationE); Repeat* ra = Repeat::create(animateE, 100); ra->setTag(kJumpAnimationTag); body->runAction(ra); // --- fall + escape Vec2 destinationPoint(dropPoint.x, body->getContentSize().height/2); MoveTo* fallMT = MoveTo::create(kFallingInterval, destinationPoint); MoveTo* escapeMT; CallFunc* animationLaunchCF = CallFunc::create([this] { this->launchRunningAnimation(); });; if (dropPoint.x < kScreenMiddle) { Vec2 escapePoint(kEscapePointLeft, destinationPoint.y); float escapeTime = (dropPoint.x - escapePoint.x)/kEscapeVelocity; escapeMT = MoveTo::create(escapeTime, escapePoint); } else { Vec2 escapePoint(kEscapePointRight, destinationPoint.y); const float escapeTime = (escapePoint.x - dropPoint.x)/kEscapeVelocity; escapeMT = MoveTo::create(escapeTime, escapePoint); } Sequence* seqFallEscape = Sequence::create(DelayTime::create(dropDelay), fallMT, animationLaunchCF, escapeMT, escapeNotifier, nullptr); runAction(seqFallEscape); } // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . bool ParatrooperNode::initBaseSprites() { body = Sprite::createWithSpriteFrameName(kElementSpriteFileNames.body); if (body == nullptr) { C6_W2(c6, "Failed to open: ", kElementSpriteFileNames.body); return false; } body->setOpacity(0); addChild(body, kBattleSceneZO.paraBody); // --- parachute = Sprite::createWithSpriteFrameName(kElementSpriteFileNames.parachute); if (parachute == nullptr) { C6_W2(c6, "Failed to open: ", kElementSpriteFileNames.parachute); return false; } parachute->setOpacity(0); parachute->setPosition(Vec2(0, 20)); addChild(parachute, kBattleSceneZO.parachute); return true; } // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . bool ParatrooperNode::initSelf() { if (!initBaseSprites()) { return false; } return true; } // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . bool ParatrooperNode::isAlive() const { return alive; } // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . void ParatrooperNode::launchRunningAnimation() { C6_D1(c6, "here"); Animation* animationE = AnimationCache::getInstance()->getAnimation(kRunAnimationName); Animate* animateE = Animate::create(animationE); body->stopAllActionsByTag(kJumpAnimationTag); body->runAction(RepeatForever::create(animateE)); if (getPosition().x < kScreenMiddle) {// mirror soldier if it goes left body->setScaleX(-1); } } // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . void ParatrooperNode::setDropParameters(const float inTravelDelay, const Vec2& inDropPoint) { dropDelay = inTravelDelay; dropPoint = inDropPoint; } // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
29.708134
99
0.57626
beardog-ukr
89fea8d9c89cbe560fa72909fff68fc44e8052f9
943
cpp
C++
source/EvaluationChain.cpp
vt4a2h/prcxx
04794048f21cec548fa750b78239f920eef1bb60
[ "MIT" ]
1
2022-01-04T17:55:55.000Z
2022-01-04T17:55:55.000Z
source/EvaluationChain.cpp
vt4a2h/prcxx
04794048f21cec548fa750b78239f920eef1bb60
[ "MIT" ]
null
null
null
source/EvaluationChain.cpp
vt4a2h/prcxx
04794048f21cec548fa750b78239f920eef1bb60
[ "MIT" ]
null
null
null
// // MIT License // // Copyright (c) 2020-present Vitaly Fanaskov // // prcxx -- Yet another C++ property library // Project home: https://github.com/vt4a2h/prcxx // // See LICENSE file for the further details. // #include "prcxx/EvaluationChain.hpp" namespace prcxx { bool EvaluationChain::empty() const { return properties.empty(); } bool EvaluationChain::contains_error() const { return !last_error.text.empty(); } void EvaluationChain::push(IObservableWeakPtr ref) { properties.push(std::move(ref)); } IObservableWeakPtr EvaluationChain::top() { return properties.top(); } void EvaluationChain::pop() { properties.pop(); } void EvaluationChain::register_error(Error error) { last_error = std::move(error); } Error EvaluationChain::extract_last_error() { Error tmp; std::swap(tmp, last_error); return tmp; } Error EvaluationChain::error() const { return last_error; } } // namespace prcxx
16.258621
50
0.700954
vt4a2h
89ff92912fe7e51166d943cc1a89b652ff4b53c1
3,866
cpp
C++
GraphicsMagick.NET/Drawables/DrawableAffine.cpp
dlemstra/GraphicsMagick.NET
332718f2315c3752eaeb84f4a6a30a553441e79e
[ "ImageMagick", "Apache-2.0" ]
35
2015-10-18T19:49:52.000Z
2022-01-18T05:30:46.000Z
GraphicsMagick.NET/Drawables/DrawableAffine.cpp
elyor0529/GraphicsMagick.NET
332718f2315c3752eaeb84f4a6a30a553441e79e
[ "ImageMagick", "Apache-2.0" ]
12
2016-07-22T16:05:03.000Z
2020-02-26T15:21:03.000Z
GraphicsMagick.NET/Drawables/DrawableAffine.cpp
elyor0529/GraphicsMagick.NET
332718f2315c3752eaeb84f4a6a30a553441e79e
[ "ImageMagick", "Apache-2.0" ]
12
2016-02-24T12:11:50.000Z
2021-07-12T18:20:12.000Z
//================================================================================================= // Copyright 2014-2015 Dirk Lemstra <https://graphicsmagick.codeplex.com/> // // Licensed under the ImageMagick License (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.imagemagick.org/script/license.php // // Unless required by applicable law or agreed to in writing, software distributed under the // License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either // express or implied. See the License for the specific language governing permissions and // limitations under the License. //================================================================================================= #include "Stdafx.h" #include "DrawableAffine.h" namespace GraphicsMagick { //============================================================================================== DrawableAffine::DrawableAffine(double scaleX, double scaleY, double shearX, double shearY, double translateX, double translateY) { BaseValue = new Magick::DrawableAffine(scaleX, scaleY, shearX, shearY, translateX, translateY); } //============================================================================================== DrawableAffine::DrawableAffine(Matrix^ matrix) { Throw::IfNull("matrix", matrix); BaseValue = new Magick::DrawableAffine((double)matrix->Elements[0], (double)matrix->Elements[1], (double)matrix->Elements[2], (double)matrix->Elements[3], (double)matrix->Elements[4], (double)matrix->Elements[5]); } //============================================================================================== double DrawableAffine::ScaleX::get() { return Value->sx(); } //============================================================================================== void DrawableAffine::ScaleX::set(double value) { Value->sx(value); } //============================================================================================== double DrawableAffine::ScaleY::get() { return Value->sy(); } //============================================================================================== void DrawableAffine::ScaleY::set(double value) { Value->sy(value); } //============================================================================================== double DrawableAffine::ShearX::get() { return Value->rx(); } //============================================================================================== void DrawableAffine::ShearX::set(double value) { Value->rx(value); } //============================================================================================== double DrawableAffine::ShearY::get() { return Value->ry(); } //============================================================================================== void DrawableAffine::ShearY::set(double value) { Value->ry(value); } //============================================================================================== double DrawableAffine::TranslateX::get() { return Value->tx(); } //============================================================================================== void DrawableAffine::TranslateX::set(double value) { Value->tx(value); } //============================================================================================== double DrawableAffine::TranslateY::get() { return Value->ty(); } //============================================================================================== void DrawableAffine::TranslateY::set(double value) { Value->ty(value); } //============================================================================================== }
40.694737
100
0.38955
dlemstra
d60020f0254390e3b1d98b622875861c7b262861
10,521
cpp
C++
src/Scheme.cpp
nizikawa-worms/wkTerrainSync
676bcb981b2cc1bba80e8928fceb3731d40beb63
[ "WTFPL" ]
7
2021-04-19T14:30:03.000Z
2022-01-14T16:44:47.000Z
src/Scheme.cpp
nizikawa-worms/wkTerrainSync
676bcb981b2cc1bba80e8928fceb3731d40beb63
[ "WTFPL" ]
1
2022-01-27T09:09:05.000Z
2022-01-27T10:17:41.000Z
src/Scheme.cpp
nizikawa-worms/wkTerrainSync
676bcb981b2cc1bba80e8928fceb3731d40beb63
[ "WTFPL" ]
null
null
null
#include "Scheme.h" #include "Hooks.h" #include "Missions.h" #include "Packets.h" #include "LobbyChat.h" #include "Utils.h" #include "Config.h" #include "WaLibc.h" #include "Frontend.h" #include "Debugf.h" namespace fs = std::filesystem; void Scheme::dumpSchemeFromResources(int id, std::filesystem::path path) { // if(std::filesystem::exists(path)) return; try { HMODULE hModule = NULL; HRSRC hResource = FindResource(hModule, MAKEINTRESOURCE(id), "SCHEMES"); if(!hResource) throw std::runtime_error("FindResource failed"); HGLOBAL hMemory = LoadResource(hModule, hResource); if(!hMemory) throw std::runtime_error("LoadResource failed"); DWORD dwSize = SizeofResource(hModule, hResource); if(!dwSize) throw std::runtime_error("SizeofResource failed"); LPVOID lpAddress = LockResource(hMemory); if(!lpAddress) throw std::runtime_error("LockResource failed"); FILE * pf = fopen((Config::getWaDir() / path).string().c_str(), "wb"); if(pf) { fwrite(lpAddress, dwSize, 1, pf); fclose(pf); } else throw std::runtime_error("Failed to save .wsc"); } catch (std::exception & e) { debugf("dumping resource: %d failed, reason: %s\n", id, e.what()); } } int __stdcall Scheme::hookSetWscScheme(DWORD schemestruct, char * path, char flag, bool * out) { // printf("hookSetWscScheme struct: 0x%X path: %s flag: %d out: 0x%X\n", schemestruct, path, flag, out); return origSetWscScheme(schemestruct, path, flag, out); } std::pair<int, size_t> Scheme::getSchemeVersionAndSize() { size_t schemesize = 0; int retv; _asm lea eax, schemesize _asm push eax _asm mov esi, addrSchemeStruct _asm call addrGetSchemeVersion _asm mov retv, eax // debugf("Scheme version: %d size: %d\n", retv, schemesize); return {retv, schemesize}; } int (__stdcall *origGetBuiltinSchemeName)(); int __stdcall Scheme::hookGetBuiltinSchemeName() { int a1, a2, retv; _asm mov a1, eax _asm mov a2, ecx _asm mov eax, a1 _asm mov ecx, a2 _asm call origGetBuiltinSchemeName _asm mov retv, eax if(a2 == 4) WaLibc::CStringFromString((void*)(a1+12), 0, (void*)missionDefaultSchemeName.c_str(), missionDefaultSchemeName.length()); return retv; } char **Scheme::callGetBuiltinSchemeName(int id) { _asm mov eax, addrSchemeStruct _asm mov ecx, id _asm call hookGetBuiltinSchemeName return (char**)(addrSchemeStruct+12); } int __stdcall Scheme::hookSetBuiltinScheme(DWORD schemestruct, int id) { if(Missions::getFlagInjectingWam() || flagReadingWam) { return 0; } return origSetBuiltinScheme(schemestruct, id); } void Scheme::setMissionWscScheme(std::filesystem::path wam) { std::string wscpath, wscname; fs::path providedwsc = wam.parent_path() / (wam.stem().string() + ".wsc"); bool out; if(fs::exists(providedwsc)) { hookSetWscScheme(addrSchemeStruct, (char*)providedwsc.string().c_str(), 0, &out); wscname = missionCustomSchemeName; } else { hookSetWscScheme(addrSchemeStruct, (char*)missionDefaultSchemePath.c_str(), 0, &out); wscname = missionDefaultSchemeName; } callReadWamSchemeSettings(wam.string()); callReadWamSchemeOptions(wam.string()); if(Packets::isHost()) { callRefreshOnlineMultiplayerSchemeDisplay(); origSendWscScheme(LobbyChat::getLobbyHostScreen(), 0); } else if(!Packets::isClient()) { callRefreshOfflineMultiplayerSchemeDisplay(); } setSchemeName(wscname); } DWORD Scheme::getAddrSchemeStruct() { return addrSchemeStruct; } void Scheme::callSetBuiltinScheme(int id) { origSetBuiltinScheme(addrSchemeStruct, id); static std::map<int, int> namemap = { {0, 970}, {2, 972}, {3, 971}, {4, 971}, {5, 981}, {6, 973}, {7, 974}, {8, 980}, {9, 971}, {10, 978}, {11, 971}, {12, 979}, {13, 976}, {14, 977}, {15, 975}, {16, 982} }; if(namemap.find(id - 1) != namemap.end()) { setSchemeName(Frontend::origGetTextById(namemap.at(id - 1))); } else { setSchemeName(Frontend::origGetTextById(971)); } if(Packets::isHost()) { callRefreshOnlineMultiplayerSchemeDisplay(); origSendWscScheme(LobbyChat::getLobbyHostScreen(), 0); } else if(!Packets::isClient()) { callRefreshOfflineMultiplayerSchemeDisplay(); } } void Scheme::loadSchemeFromBytestr(std::string data) { if(data.size() < 0x1E8) { // Utils::hexDump("Loaded 3.8 scheme", data.data(), data.size()); memcpy((char *) (addrSchemeStruct + 0x14), data.data(), data.size()); debugf("Restored scheme from replay json\n"); } else { MessageBoxA(0, "Replay json file contains embedded WAM scheme, but it exceeds allowed scheme size.", Config::getFullStr().c_str(), MB_ICONERROR); } } std::optional<std::string> Scheme::saveSchemeToBytestr() { auto info = getSchemeVersionAndSize(); int builtinscheme = *(int*)(Scheme::getAddrSchemeStruct() + 0x8); if(builtinscheme != 4) { // save custom scheme in json size_t size = 0; switch(info.first) { default: case 1: size = 0xDD - 5; break; case 2: size = 0x129 - 5; break; case 3: size = 0x129 + info.second - 5; break; } std::string scheme = std::string((char*)(Scheme::getAddrSchemeStruct() + 0x14), size); return {scheme}; } return {}; } void Scheme::setSchemeName(std::string name) { if(Config::isDontRenameSchemeComboBox()) return; DWORD comboScheme = 0; if(Packets::isHost()) { auto host = LobbyChat::getLobbyHostScreen(); if(host) comboScheme = host + 0x425B0; } else if(!Packets::isClient()) { auto offline = LobbyChat::getLobbyOfflineScreen(); if(offline) comboScheme = offline + 0x2B3A0; } if(comboScheme) { HWND comboSchemeHwnd = *(HWND*)((DWORD)comboScheme + 0x20); SetWindowTextA(comboSchemeHwnd, name.c_str()); } } int (__stdcall *origReadWamSchemeSettings)(); int __stdcall Scheme::hookReadWamSchemeSettings() { int params, retv; _asm mov params, eax if(!Missions::getFlagInjectingWam()) { _asm mov eax, params _asm call origReadWamSchemeSettings _asm mov retv, eax } return retv; } int (__stdcall *origReadWamSchemeOptions)(); int __stdcall Scheme::hookReadWamSchemeOptions() { int params, retv; _asm mov params, eax // if(!Missions::getFlagInjectingWam()) { _asm mov eax, params _asm call origReadWamSchemeOptions _asm mov retv, eax // } return retv; } int Scheme::callReadWamSchemeSettings(std::string wampath) { Missions::WAMLoaderParams params; memset((void*)&params, 0, sizeof(params)); params.path = (char*)wampath.c_str(); flagReadingWam = true; int retv; _asm lea eax, params _asm call origReadWamSchemeSettings flagReadingWam = false; return retv; } int Scheme::callReadWamSchemeOptions(std::string wampath) { Missions::WAMLoaderParams params; memset((void*)&params, 0, sizeof(params)); params.path = (char*)wampath.c_str(); flagReadingWam = true; int retv; _asm lea eax, params _asm call origReadWamSchemeOptions _asm mov retv, eax flagReadingWam = false; return retv; } void Scheme::callRefreshOfflineMultiplayerSchemeDisplay() { DWORD screen = LobbyChat::getLobbyOfflineScreen(); if(screen) { _asm mov eax, screen _asm call addrRefreshOfflineMultiplayerSchemeDisplay } } void Scheme::callRefreshOnlineMultiplayerSchemeDisplay() { DWORD screen = LobbyChat::getLobbyHostScreen(); if(screen) { _asm mov eax, screen _asm call addrRefreshOnlineMultiplayerSchemeDisplay } } void Scheme::install() { DWORD addrGetSchemeSettingsFromWam = _ScanPattern("GetSchemeSettingsFromWam", "\x57\x6A\x04\x68\x00\x00\x00\x00\x8B\xF8\xE8\x00\x00\x00\x00\x83\xF8\xFF\x75\x04\x0B\xC0\x5F\xC3\x8B\x47\x0C\x56\x8B\x35\x00\x00\x00\x00\x50\x6A\x00\x68\x00\x00\x00\x00\x68\x00\x00\x00\x00\xFF\xD6", "????????xxx????xxxxxxxxxxxxxxx????xxxx????x????xx"); DWORD addrGetBuiltinSchemeName = _ScanPattern("GetBuiltinSchemeName", "\x83\xC1\xFF\x83\xF9\x10\x0F\x87\x00\x00\x00\x00\xFF\x24\x8D\x00\x00\x00\x00\x83\xC0\x0C\x50\xBA\x00\x00\x00\x00\xE8\x00\x00\x00\x00\xB8\x00\x00\x00\x00\xC3", "??????xx????xxx????xxxxx????x????x????x"); DWORD addrSetWscScheme = _ScanPattern("SetWscScheme", "\x6A\xFF\x68\x00\x00\x00\x00\x64\xA1\x00\x00\x00\x00\x50\x64\x89\x25\x00\x00\x00\x00\x81\xEC\x00\x00\x00\x00\x53\x55\x8B\xAC\x24\x00\x00\x00\x00\x56\x8B\xB4\x24\x00\x00\x00\x00\x57\x8D\x4C\x24\x20", "???????xx????xxxx????xx????xxxxx????xxxx????xxxxx"); addrGetSchemeVersion = _ScanPattern("GetSchemeVersion", "\xB8\x00\x00\x00\x00\xB9\x00\x00\x00\x00\x2B\xC8\x8D\x64\x24\x00\x8A\x94\x06\x00\x00\x00\x00\x3A\x14\x01\x75\x38\x83\xE8\x01\x75\xEF\x33\xC9\x8D\x86\x00\x00\x00\x00\x8D\xA4\x24\x00\x00\x00\x00", "??????????xxxxxxxxx????xxxxxxxxxxxxxx????xxx????"); origSendWscScheme = (int (__stdcall *)(DWORD,char)) _ScanPattern("SendWscScheme", "\x55\x8B\xEC\x83\xE4\xF8\x81\xEC\x00\x00\x00\x00\x56\x57\xBF\x00\x00\x00\x00\xE8\x00\x00\x00\x00\x8B\x4D\x08\x89\x81\x00\x00\x00\x00\x8B\x15\x00\x00\x00\x00\xA0\x00\x00\x00\x00\x66\xC7\x44\x24\x00\x00\x00", "??????xx????xxx????x????xxxxx????xx????x????xxxx???"); DWORD addrReadWamSchemeSettings = _ScanPattern("ReadWamSchemeSettings", "\x57\x6A\x04\x68\x00\x00\x00\x00\x8B\xF8\xE8\x00\x00\x00\x00\x83\xF8\xFF\x75\x04\x0B\xC0\x5F\xC3\x8B\x47\x0C\x56\x8B\x35\x00\x00\x00\x00\x50", "????????xxx????xxxxxxxxxxxxxxx????x"); DWORD addrReadWamSchemeOptions = _ScanPattern("ReadWamSchemeOptions", "\x51\x53\x55\x56\x8B\x35\x00\x00\x00\x00\x57\x8B\xF8\x8B\x47\x0C\x50\x6A\x00\x68\x00\x00\x00\x00\x68\x00\x00\x00\x00\xFF\xD6\xA2\x00\x00\x00\x00", "??????????xxxxxxxxxx????x????xxx????"); addrRefreshOfflineMultiplayerSchemeDisplay = _ScanPattern("RefreshOfflineMultiplayerSchemeDisplay", "\x51\x56\x57\x8B\xF8\xA0\x00\x00\x00\x00\x3C\x02\x75\x07\xB8\x00\x00\x00\x00\xEB\x0F\x33\xC9\x84\xC0\x0F\x95\xC1\x81\xC1\x00\x00\x00\x00\x8B\xC1\x8D\xB7\x00\x00\x00\x00", "??????????xxxxx????xxxxxxxxxxx????xxxx????"); addrRefreshOnlineMultiplayerSchemeDisplay = _ScanPattern("RefreshOnlineMultiplayerSchemeDisplay", "\x51\x56\x57\x8B\xF8\x0F\xBE\x05\x00\x00\x00\x00\x89\x87\x00\x00\x00\x00\x0F\xBE\x0D\x00\x00\x00\x00\x89\x8F\x00\x00\x00\x00\x8B\xCF\xE8\x00\x00\x00\x00", "??????xx????xx????xxx????xx????xxx????"); addrSchemeStruct = *(DWORD*)(addrGetSchemeSettingsFromWam + 0x4); addrSchemeStructAmmo = addrSchemeStruct + 0xEC; DWORD addrSetBuiltinScheme = (addrGetSchemeSettingsFromWam + 0xF + *(DWORD*)(addrGetSchemeSettingsFromWam + 0xB)); debugf("addrSchemeStruct: 0x%X addrSetBuiltinScheme: 0x%X\n", addrSchemeStruct, addrSetBuiltinScheme); _HookDefault(SetWscScheme); _HookDefault(GetBuiltinSchemeName); _HookDefault(SetBuiltinScheme); _HookDefault(ReadWamSchemeSettings); _HookDefault(ReadWamSchemeOptions); dumpSchemeFromResources(286, missionDefaultSchemePath); }
36.658537
332
0.719323
nizikawa-worms
d600c8b96bfa216bb9a9f73f08857aa103979207
6,786
cpp
C++
src/main.cpp
jclc/tiralabra-compression
1b4a2375d006e10718ff7887ba36d94e5f7a3c1f
[ "MIT" ]
null
null
null
src/main.cpp
jclc/tiralabra-compression
1b4a2375d006e10718ff7887ba36d94e5f7a3c1f
[ "MIT" ]
2
2017-04-15T16:06:11.000Z
2017-05-11T21:50:58.000Z
src/main.cpp
jclc/tiralabra-compression
1b4a2375d006e10718ff7887ba36d94e5f7a3c1f
[ "MIT" ]
null
null
null
#include <iostream> #include <fstream> #include <string> #include <memory> #include <chrono> #include "input.hpp" #include "output.hpp" #include <thread> #include <cmath> #include "encoder.hpp" #include "decoder.hpp" #include "progressbar.hpp" #include "tempfilenames.hpp" void printHelp() { std::cout << "tiralabra-compression" << std::endl << "Usage: tiracomp [options] <input file> [output file]\n" << std::endl << "If output file is not specified, output will be printed to stdout" << std::endl << "Options:" << std::endl << " -h: Print this help message" << std::endl << " -v: Verbose output" << std::endl << " -b: Benchmark mode" << std::endl << " -w <word size>: Define word size in bits when encoding (12 or 16)" << std::endl << " -i: Only print file info" << std::endl << " -n: Null output (disregard output, useful for benchmark)" << std::endl; } int main(int argc, char** argv) { // Initialise default values std::string inFileName = ""; std::string outFileName = ""; // If unset, write output to stdout bool benchmark = false; bool verbose = false; bool nullOutput = false; // If true, throw away the output bool printInfo = false; // If true, print info and exit without operating int bitSize = 12; int jobs = 1; std::shared_ptr<ProgressBar> progress = nullptr; std::chrono::time_point<std::chrono::system_clock> timestampStart; std::chrono::time_point<std::chrono::system_clock> timestampEnd; for (int i = 1; i < argc; ++i) { if (argv[i][0] != '-') { if (inFileName == "") { inFileName = argv[i]; } else if (outFileName == "") { outFileName = argv[i]; } else { std::cerr << "Too many arguments: " << argv[i] << std::endl; return EXIT_FAILURE; } } else { // Iterate through all short opts in a single argument // eg. -vb -> use options v and b int j = 1; int paramsToSkip = 0; // If an option takes a parameter, add to this int value_w; // Value for option -w int value_j; // Value for option -j while ((argv[i][j] != '\0')) { switch (argv[i][j]) { case '?': // fallthrough case 'h': printHelp(); return EXIT_SUCCESS; case 'b': benchmark = true; break; case 'v': verbose = true; break; case 'n': nullOutput = true; break; case 'i': printInfo = true; break; case 'w': ++paramsToSkip; if (i + paramsToSkip >= argc) { std::cerr << "No value given for word option -w" << std::endl; return EXIT_FAILURE; } value_w = std::atoi(argv[i + paramsToSkip]); if (value_w != MIN_BIT_SIZE && value_w != MAX_BIT_SIZE) { std::cerr << "Invalid value " << value_w << " for option -w (must be either " << MIN_BIT_SIZE << " or " << MAX_BIT_SIZE << ")" << std::endl; return EXIT_FAILURE; } bitSize = value_w; break; // case 'j': // ++paramsToSkip; // if (i+paramsToSkip >= argc) { // std::cerr << "No value given for option -j" << std::endl; // return EXIT_FAILURE; // } // value_j = std::atoi(argv[i + paramsToSkip]); // if (value_j < MIN_JOBS || value_j > MAX_JOBS) { // std::cerr << "Invalid value " << value_j // << " for option -j (must be between " // << MIN_JOBS << " and " << MAX_JOBS << ")" << std::endl; // return EXIT_FAILURE; // } // jobs = value_j; // for (int i = 0; i < jobs; ++i) { // std::cout << getTempFileName() << std::endl; // } // return 0; // break; default: std::cerr << "Unknown option -" << argv[i][j] << std::endl; return EXIT_FAILURE; } ++j; } i += paramsToSkip; } } if (inFileName == "") { std::cerr << "No input file given (use -h for help)" << std::endl; return EXIT_FAILURE; } if (inFileName == outFileName) { std::cerr << "Input file and output file cannot be the same" << std::endl; return EXIT_FAILURE; } Input input; if (!input.openFile(inFileName) || input.getOpMode() == UNKNOWN) { std::cerr << "Error opening file " << inFileName << std::endl; return EXIT_FAILURE; } else if (input.getOpMode() == COMPRESS && input.getFileSize() == 0) { std::cerr << "File " << inFileName << " is empty" << std::endl; return EXIT_FAILURE; } if (verbose || printInfo) { OpMode opmode = input.getOpMode(); if (!printInfo) { std::cout << (opmode == COMPRESS ? "Compressing" : "Decompressing") << " file " << inFileName << std::endl; progress = std::shared_ptr<ProgressBar>(new ProgressBar(jobs)); } else { std::cout << "File is " << (opmode == COMPRESS ? "uncompressed" : "compressed") << std::endl; } if (opmode == DECOMPRESS) { std::cout << "Bit size: " << (int) input.getBitSize() << std::endl; std::cout << "Original size: " << input.getOriginalSize() << std::endl; } std::cout << "File size: " << input.getFileSize() << std::endl; if (opmode == DECOMPRESS && input.getOriginalSize() != 0) { float compressRatio = (float) input.getFileSize() / input.getOriginalSize(); std::cout << "Compression ratio: " << std::round(compressRatio * 1000) / 1000 << std::endl; } if (!printInfo) { if (opmode == COMPRESS) std::cout << "Encoding with bit size: " << bitSize << std::endl; if (nullOutput) std::cout << "Discarding output" << std::endl; else if (outFileName != "") std::cout << "Writing output to " << outFileName << std::endl; else std::cout << "Writing output to stdout" << std::endl; } } if (printInfo) return EXIT_SUCCESS; std::shared_ptr<Output> output; if (nullOutput) { output = std::shared_ptr<Output>(new NullOutput()); } else if (outFileName == "") { output = std::shared_ptr<Output>(new StreamOutput()); } else { output = std::shared_ptr<Output>(new FileOutput()); if (!(*output).openFile(outFileName)) { std::cerr << "Cannot write to file " << outFileName << std::endl; return EXIT_FAILURE; } } if (progress) progress->start(); if (benchmark) timestampStart = std::chrono::system_clock::now(); if (input.getOpMode() == COMPRESS) { Encoder encoder; try { encoder.encode(input, *output, bitSize, progress); } catch (std::exception e) { std::cerr << "Error encoding: " << e.what() << std::endl; return EXIT_FAILURE; } } else if (input.getOpMode() == DECOMPRESS) { Decoder decoder; input.setBounds(8, input.getFileSize() - 24); decoder.decode(input, *output, progress); } if (benchmark) timestampEnd = std::chrono::system_clock::now(); if (progress) progress->stop(); if (benchmark) std::cout << "Time elapsed: " << std::chrono::duration_cast<std::chrono::milliseconds> (timestampEnd - timestampStart).count() << " ms" << std::endl; return EXIT_SUCCESS; }
30.294643
89
0.595933
jclc
d601747ccb7268afd879de7522813e6ef338ef4f
3,178
cpp
C++
src/editor/Widgets/VerbWidget.cpp
tedvalson/NovelTea
f731951f25936cb7f5ff23e543e0301c1b5bfe82
[ "MIT" ]
null
null
null
src/editor/Widgets/VerbWidget.cpp
tedvalson/NovelTea
f731951f25936cb7f5ff23e543e0301c1b5bfe82
[ "MIT" ]
null
null
null
src/editor/Widgets/VerbWidget.cpp
tedvalson/NovelTea
f731951f25936cb7f5ff23e543e0301c1b5bfe82
[ "MIT" ]
null
null
null
#include "VerbWidget.hpp" #include "ui_VerbWidget.h" #include <NovelTea/ProjectData.hpp> #include <NovelTea/Verb.hpp> #include <QDebug> VerbWidget::VerbWidget(const std::string &idName, QWidget *parent) : EditorTabWidget(parent) , ui(new Ui::VerbWidget) { m_idName = idName; ui->setupUi(this); load(); MODIFIER(ui->lineEditName, &QLineEdit::textChanged); MODIFIER(ui->scriptEditDefault, &ScriptEdit::textChanged); MODIFIER(ui->scriptEditConditional, &ScriptEdit::textChanged); MODIFIER(ui->horizontalSlider, &QSlider::valueChanged); MODIFIER(ui->propertyEditor, &PropertyEditor::valueChanged); } VerbWidget::~VerbWidget() { delete ui; } QString VerbWidget::tabText() const { return QString::fromStdString(idName()); } EditorTabWidget::Type VerbWidget::getType() const { return EditorTabWidget::Verb; } void VerbWidget::saveData() const { if (m_verb) { std::vector<std::string> actionStructure; for (auto lineEdit : m_lineEdits) actionStructure.push_back(lineEdit->text().toStdString()); m_verb->setName(ui->lineEditName->text().toStdString()); m_verb->setScriptDefault(ui->scriptEditDefault->toPlainText().toStdString()); m_verb->setScriptConditional(ui->scriptEditConditional->toPlainText().toStdString()); m_verb->setActionStructure(actionStructure); m_verb->setProperties(ui->propertyEditor->getValue()); Proj.set<NovelTea::Verb>(m_verb, idName()); } } void VerbWidget::loadData() { m_verb = Proj.get<NovelTea::Verb>(idName()); qDebug() << "Loading verb data... " << QString::fromStdString(idName()); if (!m_verb) { // Object is new, so show it as modified setModified(); m_verb = std::make_shared<NovelTea::Verb>(); } ui->lineEditName->setText(QString::fromStdString(m_verb->getName())); ui->scriptEditDefault->setPlainText(QString::fromStdString(m_verb->getScriptDefault())); ui->scriptEditConditional->setPlainText(QString::fromStdString(m_verb->getScriptConditional())); ui->horizontalSlider->setValue(m_verb->getObjectCount()); ui->propertyEditor->setValue(m_verb->getProperties()); loadActionStructure(); } void VerbWidget::loadActionStructure() { m_lineEdits.clear(); QLayoutItem *child; while ((child = ui->layoutActionStructure->takeAt(0)) != 0) { delete child->widget(); delete child; } addLineEdit(); for (int i = 0; i < m_verb->getObjectCount(); ++i) { auto label = new QLabel; label->setText(QString("object%1").arg(i+1)); label->setMargin(10); ui->layoutActionStructure->addWidget(label); addLineEdit(); } for (int i = 0; i < m_lineEdits.size(); ++i) { auto &lineEdit = m_lineEdits[i]; std::string str; if (i < m_verb->getActionStructure().size()) str = m_verb->getActionStructure()[i]; if (i == 0 && str.empty()) str = m_verb->getName(); lineEdit->setText(QString::fromStdString(str)); MODIFIER(lineEdit, &QLineEdit::textChanged); } } void VerbWidget::addLineEdit() { auto lineEdit = new QLineEdit; lineEdit->setAlignment(Qt::AlignHCenter); ui->layoutActionStructure->addWidget(lineEdit); m_lineEdits.push_back(lineEdit); } void VerbWidget::on_horizontalSlider_valueChanged(int value) { m_verb->setObjectCount(value); loadActionStructure(); }
26.483333
97
0.724984
tedvalson
d6026da06043db22c7ffe76028b4b7418bac6c79
5,059
hpp
C++
src/libmarsvk/include/mvk/ComputePipeline.hpp
zmichaels11/mvk
67ee3dcca1db39c7ad076864b8d5ba006e5d5cda
[ "BSD-3-Clause" ]
null
null
null
src/libmarsvk/include/mvk/ComputePipeline.hpp
zmichaels11/mvk
67ee3dcca1db39c7ad076864b8d5ba006e5d5cda
[ "BSD-3-Clause" ]
null
null
null
src/libmarsvk/include/mvk/ComputePipeline.hpp
zmichaels11/mvk
67ee3dcca1db39c7ad076864b8d5ba006e5d5cda
[ "BSD-3-Clause" ]
null
null
null
#pragma once #include <cstddef> #include <memory> #include <utility> #include "volk.h" #include "mvk/Pipeline.hpp" #include "mvk/PipelineLayout.hpp" #include "mvk/PipelineShaderStageCreateInfo.hpp" namespace mvk { class Device; class PipelineCache; class DescriptorSetLayout; class ComputePipeline; //! A unique-ptr wrapper for a ComputePipeline object. using UPtrComputePipeline = std::unique_ptr<ComputePipeline>; //! A Pipeline object for Compute operations. /*! ComputePipelines consist of a single static compute shader stage and the pipeline layout. See: <a href="https://vulkan.lunarg.com/doc/view/1.0.33.0/linux/vkspec.chunked/ch09s01.html">Compute Pipelines</a> */ class ComputePipeline : public virtual Pipeline { public: //! ComputePipeline construction parameters. struct CreateInfo { unsigned int flags; /*!< Additional construction parameters. */ PipelineShaderStageCreateInfo stage; /*!< The stage describing the compute shader. */ PipelineLayout::CreateInfo layoutInfo; /*!< The PipelineLayout descriptor struct. */ }; //! Constructs a ComputePipeline-typed unique_ptr pointing to null. /*! \return a unique_ptr<ComputePipeline> pointing to nullptr. */ static inline UPtrComputePipeline unique_null() { return std::unique_ptr<ComputePipeline>(); } private: CreateInfo _info; VkPipeline _handle; PipelineCache * _cache; PipelineLayout * _layout; ComputePipeline(const ComputePipeline&) = delete; ComputePipeline& operator= (const ComputePipeline&) = delete; public: //! Constructs a ComputePipeline object holding nothing. ComputePipeline() : _handle(VK_NULL_HANDLE), _cache(nullptr), _layout(nullptr) {} //! Constructs a ComputePipeline object. /*! \param cache is the PipelineCache to allocate from. \param createInfo is the construction parameters. */ ComputePipeline(PipelineCache * cache, const CreateInfo& createInfo); //! Move-constructs a ComputePipeline. /*! \param from the other ComputePipeline. */ ComputePipeline(ComputePipeline&& from) noexcept: _info(std::move(from._info)), _handle(std::exchange(from._handle, nullptr)), _cache(std::move(from._cache)), _layout(std::move(from._layout)) {} //! Deletes the ComputePipeline and releases any resources. ~ComputePipeline() noexcept; //! Move-assigns a ComputePipeline. /*! \param from the other ComputePipeline. */ ComputePipeline& operator= (ComputePipeline&& from) noexcept; //! Retrieves the construction parameters. /*! \return a const reference to an immutable copy of the construction parameters. */ inline const CreateInfo& getInfo() const noexcept { return _info; } //! Retrieves the PipelineBindPoint /*! \return PipelineBindPoint::COMPUTE */ virtual PipelineBindPoint getBindPoint() const noexcept; //! Explicitly releases the ComputePipleline resources back to the PipelineCache. /*! This method is called implicitly by the deconstructor if the Vulkan resources still exist on object deconstruction. */ virtual void release(); //! Retrieves the Device. /*! \return the Device. */ virtual Device * getDevice() const noexcept; //! Retrieves the PipelineCache this ComputePipeline was allocated from. /*! \return the PipelineCache. */ virtual PipelineCache * getPipelineCache() const noexcept; //! Retrieves the PipelineLayout describing inputs and outputs of this ComputePipeline. virtual PipelineLayout * getPipelineLayout() const noexcept; //! Retrieves a DescriptorSetLayout from this Pipeline. /*! \param index is the index of the DescriptorSetLayout if there is more than 1. \return the DescriptorSetLayout. */ virtual DescriptorSetLayout * getDescriptorSetLayout(std::ptrdiff_t index) const noexcept; //! Retrieves a list of all DescriptorSetLayouts of this ComputePipeline in order. /*! \return vector of all DescriptorSetLayouts */ virtual std::vector<DescriptorSetLayout * > getDescriptorSetLayouts() const noexcept; //! Retrieves the underlying Vulkan handle. /*! \return the handle */ virtual VkPipeline getHandle() const noexcept; //! Implicitly casts to the underlying Vulkan handle. inline operator VkPipeline() const noexcept { return getHandle(); } }; }
33.726667
127
0.627594
zmichaels11
d604d7002f6c58f71ac7b27100e2897d237ce421
36,020
cc
C++
tesseract-recognize.cc
mauvilsa/tesseract-recognize
5bace16f3201565264e058bd594df43cfaca9fd4
[ "MIT" ]
34
2017-04-13T16:12:14.000Z
2021-09-13T18:12:25.000Z
tesseract-recognize.cc
mauvilsa/tesseract-recognize
5bace16f3201565264e058bd594df43cfaca9fd4
[ "MIT" ]
7
2017-07-17T12:16:53.000Z
2021-08-10T06:07:14.000Z
tesseract-recognize.cc
mauvilsa/tesseract-recognize
5bace16f3201565264e058bd594df43cfaca9fd4
[ "MIT" ]
7
2017-07-24T09:11:47.000Z
2021-06-15T17:21:26.000Z
/** * Tool that does layout analysis and OCR using tesseract providing results in Page XML format * * @version $Version: 2021.02.09$ * @author Mauricio Villegas <mauricio_ville@yahoo.com> * @copyright Copyright (c) 2015-present, Mauricio Villegas <mauricio_ville@yahoo.com> * @link https://github.com/mauvilsa/tesseract-recognize * @license MIT License */ /*** Includes *****************************************************************/ #include <algorithm> #include <string> using std::string; #include <regex> #include <set> #include <sstream> #include <iterator> #include <getopt.h> #include <../leptonica/allheaders.h> #include <../tesseract/baseapi.h> #include "PageXML.h" /*** Definitions **************************************************************/ static char tool[] = "tesseract-recognize"; static char version[] = "Version: 2021.02.09"; char gb_page_ns[] = "http://schema.primaresearch.org/PAGE/gts/pagecontent/2013-07-15"; char gb_default_lang[] = "eng"; char gb_default_xpath[] = "//_:TextRegion"; char gb_default_output[] = "-"; char *gb_output = gb_default_output; char *gb_lang = gb_default_lang; char *gb_tessdata = NULL; int gb_psm = tesseract::PSM_AUTO; int gb_oem = tesseract::OEM_DEFAULT; bool gb_onlylayout = false; bool gb_textlevels[] = { false, false, false, false }; bool gb_textatlayout = true; char *gb_xpath = gb_default_xpath; char *gb_image = NULL; int gb_density = 300; bool gb_inplace = false; bool gb_save_crops = false; enum { LEVEL_REGION = 0, LEVEL_LINE, LEVEL_WORD, LEVEL_GLYPH }; const char* levelStrings[] = { "region", "line", "word", "glyph" }; inline static int parseLevel( const char* level ) { int levels = sizeof(levelStrings) / sizeof(levelStrings[0]); for( int n=0; n<levels; n++ ) if( ! strcmp(levelStrings[n],level) ) return n; return -1; } int gb_layoutlevel = LEVEL_LINE; enum { OPTION_OUTPUT = 'o', OPTION_HELP = 'h', OPTION_VERSION = 'v', OPTION_TESSDATA = 256, OPTION_LANG , OPTION_LAYOUTLEVEL , OPTION_TEXTLEVELS , OPTION_ONLYLAYOUT , OPTION_SAVECROPS , OPTION_XPATH , OPTION_IMAGE , OPTION_DENSITY , OPTION_PSM , OPTION_OEM , OPTION_INPLACE }; static char gb_short_options[] = "o:hv"; static struct option gb_long_options[] = { { "output", required_argument, NULL, OPTION_OUTPUT }, { "help", no_argument, NULL, OPTION_HELP }, { "version", no_argument, NULL, OPTION_VERSION }, { "tessdata", required_argument, NULL, OPTION_TESSDATA }, { "lang", required_argument, NULL, OPTION_LANG }, { "psm", required_argument, NULL, OPTION_PSM }, { "oem", required_argument, NULL, OPTION_OEM }, { "layout-level", required_argument, NULL, OPTION_LAYOUTLEVEL }, { "text-levels", required_argument, NULL, OPTION_TEXTLEVELS }, { "only-layout", no_argument, NULL, OPTION_ONLYLAYOUT }, { "save-crops", no_argument, NULL, OPTION_SAVECROPS }, { "xpath", required_argument, NULL, OPTION_XPATH }, { "image", required_argument, NULL, OPTION_IMAGE }, { "density", required_argument, NULL, OPTION_DENSITY }, { "inplace", no_argument, NULL, OPTION_INPLACE }, { 0, 0, 0, 0 } }; /*** Functions ****************************************************************/ #define strbool( cond ) ( ( cond ) ? "true" : "false" ) void print_usage() { fprintf( stderr, "Description: Layout analysis and OCR using tesseract providing results in Page XML format\n" ); fprintf( stderr, "Usage: %s [OPTIONS] (IMAGE+|PDF+|PAGEXML)\n", tool ); fprintf( stderr, "Options:\n" ); fprintf( stderr, " --lang LANG Language used for OCR (def.=%s)\n", gb_lang ); fprintf( stderr, " --tessdata PATH Location of tessdata (def.=%s)\n", gb_tessdata ); fprintf( stderr, " --psm MODE Page segmentation mode (def.=%d)\n", gb_psm ); #if TESSERACT_VERSION >= 0x040000 fprintf( stderr, " --oem MODE OCR engine mode (def.=%d)\n", gb_oem ); #endif fprintf( stderr, " --layout-level LEVEL Layout output level: region, line, word, glyph (def.=%s)\n", levelStrings[gb_layoutlevel] ); fprintf( stderr, " --text-levels L1[,L2]+ Text output level(s): region, line, word, glyph (def.=layout-level)\n" ); fprintf( stderr, " --only-layout Only perform layout analysis, no OCR (def.=%s)\n", strbool(gb_onlylayout) ); fprintf( stderr, " --save-crops Saves cropped images (def.=%s)\n", strbool(gb_save_crops) ); fprintf( stderr, " --xpath XPATH xpath for selecting elements to process (def.=%s)\n", gb_xpath ); fprintf( stderr, " --image IMAGE Use given image instead of one in Page XML\n" ); fprintf( stderr, " --density DENSITY Density in dpi for pdf rendering (def.=%d)\n", gb_density ); fprintf( stderr, " --inplace Overwrite input XML with result (def.=%s)\n", strbool(gb_inplace) ); fprintf( stderr, " -o, --output Output page xml file (def.=%s)\n", gb_output ); fprintf( stderr, " -h, --help Print this usage information and exit\n" ); fprintf( stderr, " -v, --version Print version and exit\n" ); fprintf( stderr, "\n" ); int r = system( "tesseract --help-psm 2>&1 | sed '/^ *[02] /d; s| (Default)||;' 1>&2" ); if( r != 0 ) fprintf( stderr, "warning: tesseract command not found in path\n" ); #if TESSERACT_VERSION >= 0x040000 fprintf( stderr, "\n" ); r += system( "tesseract --help-oem 1>&2" ); #endif fprintf( stderr, "Examples:\n" ); fprintf( stderr, " %s -o out.xml in1.png in2.png ### Multiple images as input\n", tool ); fprintf( stderr, " %s -o out.xml in.tiff ### TIFF possibly with multiple frames\n", tool ); fprintf( stderr, " %s -o out.xml --density 200 in.pdf\n", tool ); fprintf( stderr, " %s -o out.xml --xpath //_:Page in.xml ### Empty page xml recognize the complete pages\n", tool ); fprintf( stderr, " %s -o out.xml --psm 1 in.png ### Detect page orientation pages\n", tool ); fprintf( stderr, " %s -o out.xml --xpath \"//_:TextRegion[@id='r1']\" --layout-level word --only-layout in.xml ### Detect text lines and words only in TextRegion with id=r1\n", tool ); } void setCoords( tesseract::ResultIterator* iter, tesseract::PageIteratorLevel iter_level, PageXML& page, xmlNodePtr& xelem, int x, int y, tesseract::Orientation orientation = tesseract::ORIENTATION_PAGE_UP ) { int left, top, right, bottom; int pagenum = page.getPageNumber(xelem); iter->BoundingBox( iter_level, &left, &top, &right, &bottom ); std::vector<cv::Point2f> points; if ( left == 0 && top == 0 && right == (int)page.getPageWidth(pagenum) && bottom == (int)page.getPageHeight(pagenum) ) points = { cv::Point2f(0,0), cv::Point2f(0,0) }; else { cv::Point2f tl(x+left,y+top); cv::Point2f tr(x+right,y+top); cv::Point2f br(x+right,y+bottom); cv::Point2f bl(x+left,y+bottom); switch( orientation ) { case tesseract::ORIENTATION_PAGE_UP: points = { tl, tr, br, bl }; break; case tesseract::ORIENTATION_PAGE_RIGHT: points = { tr, br, bl, tl }; break; case tesseract::ORIENTATION_PAGE_LEFT: points = { bl, tl, tr, br }; break; case tesseract::ORIENTATION_PAGE_DOWN: points = { br, bl, tl, tr }; break; } } page.setCoords( xelem, points ); } void setLineCoords( tesseract::ResultIterator* iter, tesseract::PageIteratorLevel iter_level, PageXML& page, xmlNodePtr& xelem, int x, int y, tesseract::Orientation orientation ) { setCoords( iter, iter_level, page, xelem, x, y, orientation ); std::vector<cv::Point2f> coords = page.getPoints( xelem ); int x1, y1, x2, y2; iter->Baseline( iter_level, &x1, &y1, &x2, &y2 ); cv::Point2f b_p1(x+x1,y+y1), b_p2(x+x2,y+y2); cv::Point2f baseline_p1, baseline_p2; if ( ! page.intersection( b_p1, b_p2, coords[0], coords[3], baseline_p1 ) || ! page.intersection( b_p1, b_p2, coords[1], coords[2], baseline_p2 ) ) { std::string lid = page.getAttr(xelem,"id"); fprintf(stderr,"warning: no intersection between baseline and bounding box sides id=%s\n",lid.c_str()); std::vector<cv::Point2f> baseline = { cv::Point2f(x+x1,y+y1), cv::Point2f(x+x2,y+y2) }; page.setBaseline( xelem, baseline ); return; } std::vector<cv::Point2f> baseline = { baseline_p1, baseline_p2 }; page.setBaseline( xelem, baseline ); double up1 = cv::norm( baseline_p1 - coords[0] ); double up2 = cv::norm( baseline_p2 - coords[1] ); double down1 = cv::norm( baseline_p1 - coords[3] ); double down2 = cv::norm( baseline_p2 - coords[2] ); double height = 0.5*( up1 + up2 + down1 + down2 ); double offset = height <= 0.0 ? 0.0 : 0.5*( down1 + down2 ) / height; page.setPolystripe( xelem, height <= 0.0 ? 1.0 : height, offset, false ); } void setTextEquiv( tesseract::ResultIterator* iter, tesseract::PageIteratorLevel iter_level, PageXML& page, xmlNodePtr& xelem ) { double conf = 0.01*iter->Confidence( iter_level ); char* text = iter->GetUTF8Text( iter_level ); std::string stext(text); stext = std::regex_replace( stext, std::regex("^\\s+|\\s+$"), "$1" ); page.setTextEquiv( xelem, stext.c_str(), &conf ); delete[] text; } template<typename Out> void split( const std::string &s, char delim, Out result ) { std::stringstream ss(s); std::string item; while( std::getline(ss, item, delim) ) *(result++) = item; } std::set<int> parsePagesSet( std::string range ) { std::set<int> pages_set; std::vector<std::string> parts; split( range, ',', std::back_inserter(parts) ); for( auto part : parts ) { std::string::size_type dash_pos = part.find('-'); if( dash_pos == std::string::npos ) pages_set.insert(stoi(part)); else for( int num=stoi(part.substr(0, dash_pos)); num<=stoi(part.substr(dash_pos+1)); num++ ) pages_set.insert(num); } return pages_set; } /*** Program ******************************************************************/ int main( int argc, char *argv[] ) { /// Disable debugging and informational messages from Leptonica. /// setMsgSeverity(L_SEVERITY_ERROR); /// Parse input arguments /// int n,m; std::stringstream test; std::string token; while ( ( n = getopt_long(argc,argv,gb_short_options,gb_long_options,&m) ) != -1 ) switch ( n ) { case OPTION_TESSDATA: gb_tessdata = optarg; break; case OPTION_LANG: gb_lang = optarg; break; case OPTION_PSM: gb_psm = atoi(optarg); if( gb_psm < tesseract::PSM_AUTO_OSD || gb_psm == tesseract::PSM_AUTO_ONLY || gb_psm >= tesseract::PSM_COUNT ) { fprintf( stderr, "%s: error: invalid page segmentation mode: %s\n", tool, optarg ); return 1; } break; #if TESSERACT_VERSION >= 0x040000 case OPTION_OEM: gb_oem = atoi(optarg); if( gb_oem < tesseract::OEM_TESSERACT_ONLY || gb_oem >= tesseract::OEM_COUNT ) { fprintf( stderr, "%s: error: invalid OCR engine mode: %s\n", tool, optarg ); return 1; } break; #endif case OPTION_LAYOUTLEVEL: gb_layoutlevel = parseLevel(optarg); if( gb_layoutlevel == -1 ) { fprintf( stderr, "%s: error: invalid level: %s\n", tool, optarg ); return 1; } break; case OPTION_TEXTLEVELS: test = std::stringstream(optarg); while( std::getline(test, token, ',') ) { int textlevel = parseLevel(token.c_str()); if( textlevel == -1 ) { fprintf( stderr, "%s: error: invalid level: %s\n", tool, token.c_str() ); return 1; } gb_textlevels[textlevel] = true; gb_textatlayout = false; } break; case OPTION_ONLYLAYOUT: gb_onlylayout = true; break; case OPTION_SAVECROPS: gb_save_crops = true; break; case OPTION_XPATH: gb_xpath = optarg; break; case OPTION_IMAGE: gb_image = optarg; break; case OPTION_DENSITY: gb_density = atoi(optarg); break; case OPTION_INPLACE: gb_inplace = true; break; case OPTION_OUTPUT: gb_output = optarg; break; case OPTION_HELP: print_usage(); return 0; case OPTION_VERSION: fprintf( stderr, "%s %s\n", tool, version+9 ); fprintf( stderr, "compiled against PageXML %s\n", PageXML::version() ); #ifdef TESSERACT_VERSION_STR fprintf( stderr, "compiled against tesseract %s, linked with %s\n", TESSERACT_VERSION_STR, tesseract::TessBaseAPI::Version() ); #else fprintf( stderr, "linked with tesseract %s\n", tesseract::TessBaseAPI::Version() ); #endif return 0; default: fprintf( stderr, "%s: error: incorrect input argument: %s\n", tool, argv[optind-1] ); return 1; } /// Default text level /// if ( gb_textatlayout ) gb_textlevels[gb_layoutlevel] = true; /// Check that there is at least one non-option argument /// if ( optind >= argc ) { fprintf( stderr, "%s: error: at least one input file must be provided, see usage with --help\n", tool ); return 1; } /// Initialize tesseract just for layout or with given language and tessdata path/// tesseract::TessBaseAPI *tessApi = new tesseract::TessBaseAPI(); if ( gb_onlylayout && gb_psm != tesseract::PSM_AUTO_OSD ) tessApi->InitForAnalysePage(); else #if TESSERACT_VERSION >= 0x040000 if ( tessApi->Init( gb_tessdata, gb_lang, (tesseract::OcrEngineMode)gb_oem ) ) { #else if ( tessApi->Init( gb_tessdata, gb_lang) ) { #endif fprintf( stderr, "%s: error: could not initialize tesseract\n", tool ); return 1; } tessApi->SetPageSegMode( (tesseract::PageSegMode)gb_psm ); PageXML page; int num_pages = 0; bool pixRelease = false; std::vector<NamedImage> images; tesseract::ResultIterator* iter = NULL; std::regex reIsXml(".+\\.xml$|^-$",std::regex_constants::icase); std::regex reIsTiff(".+\\.tif{1,2}(|\\[[-, 0-9]+\\])$",std::regex_constants::icase); std::regex reIsPdf(".+\\.pdf(|\\[[-, 0-9]+\\])$",std::regex_constants::icase); std::regex reImagePageNum("(.+)\\[([-, 0-9]+)\\]$"); std::cmatch base_match; char *input_file = argv[optind]; bool input_xml = std::regex_match(input_file,base_match,reIsXml); /// Inplace only when XML input and output not specified /// if ( gb_inplace && ( ! input_xml || strcmp(gb_output,"-") ) ) { fprintf( stderr, "%s: warning: ignoring --inplace option, output to %s\n", tool, gb_output ); gb_inplace = false; } /// Info for process element /// char tool_info[128]; if ( gb_onlylayout ) snprintf( tool_info, sizeof tool_info, "%s_v%.10s tesseract_v%s", tool, version+9, tesseract::TessBaseAPI::Version() ); else snprintf( tool_info, sizeof tool_info, "%s_v%.10s tesseract_v%s lang=%s", tool, version+9, tesseract::TessBaseAPI::Version(), gb_lang ); /// Loop through input files /// for ( ; optind < argc; optind++ ) { input_file = argv[optind]; input_xml = std::regex_match(input_file,base_match,reIsXml); bool input_tiff = std::regex_match(input_file,base_match,reIsTiff); bool input_pdf = std::regex_match(input_file,base_match,reIsPdf); /// Get selected pages for tiff/pdf if given /// std::set<int> pages_set; std::string page_sel; std::string input_file_str = std::string(input_file); if ( input_tiff || input_pdf ) { if( std::regex_match(input_file, base_match, reImagePageNum) ) { pages_set = parsePagesSet(base_match[2].str()); page_sel = std::string(base_match[2].str()); input_file_str = std::string(base_match[1].str()); } } /// Input is xml /// if ( input_xml ) { if ( num_pages > 0 ) { fprintf( stderr, "%s: error: only a single page xml allowed as input\n", tool ); return 1; } try { page.loadXml( input_file ); // if input_file is "-" xml is read from stdin } catch ( const std::exception& e ) { fprintf( stderr, "%s: error: problems reading xml file: %s\n%s\n", tool, input_file, e.what() ); return 1; } if ( gb_image != NULL ) { if ( page.count("//_:Page") > 1 ) { fprintf( stderr, "%s: error: specifying image with multipage xml input not supported\n", tool ); return 1; } page.loadImage( 0, gb_image ); } num_pages += page.count("//_:Page"); if ( gb_psm == tesseract::PSM_AUTO_OSD && page.count("//_:ImageOrientation") > 0 ) { fprintf( stderr, "%s: error: refusing to use OSD on page xml that already contains ImageOrientation elements\n", tool ); return 1; } std::vector<xmlNodePtr> sel = page.select(gb_xpath); int selPages = 0; for ( n=0; n<(int)sel.size(); n++ ) if ( page.nodeIs( sel[n], "Page" ) ) selPages++; if ( selPages > 0 && selPages != (int)sel.size() ) { fprintf( stderr, "%s: error: xpath can select Page or non-Page elements but not a mixture of both: %s\n", tool, gb_xpath ); return 1; } if ( selPages == 0 ) { pixRelease = true; images = page.crop( (std::string(gb_xpath)+"/_:Coords").c_str(), NULL, false ); page.releaseImages(); } else { for ( n=0; n<(int)sel.size(); n++ ) { NamedImage namedimage; namedimage.image = NULL; namedimage.node = sel[n]; images.push_back( namedimage ); num_pages++; } } } /// Input is tiff image /// else if ( input_tiff ) { pixRelease = true; /// Read input image /// PIXA* tiffimage = pixaReadMultipageTiff( input_file_str.c_str() ); if ( tiffimage == NULL || tiffimage->n == 0 ) { fprintf( stderr, "%s: error: problems reading tiff image: %s\n", tool, input_file ); return 1; } if ( pages_set.size() > 0 && tiffimage->n <= *pages_set.rbegin() ) { fprintf( stderr, "%s: error: invalid page selection (%s) on tiff with %d pages\n", tool, page_sel.c_str(), tiffimage->n+1 ); return 1; } for ( n=0; n<tiffimage->n; n++ ) { if ( pages_set.size() > 0 && pages_set.find(n) == pages_set.end() ) continue; PageImage image = pixClone(tiffimage->pix[n]); std::string pagepath = input_file_str+"["+std::to_string(n)+"]"; NamedImage namedimage; namedimage.image = image; if ( num_pages == 0 ) namedimage.node = page.newXml( tool_info, pagepath.c_str(), pixGetWidth(image), pixGetHeight(image), gb_page_ns ); else namedimage.node = page.addPage( pagepath.c_str(), pixGetWidth(image), pixGetHeight(image) ); images.push_back( namedimage ); num_pages++; } pixaDestroy(&tiffimage); } /// Input is pdf /// else if ( input_pdf ) { std::vector< std::pair<double,double> > pdf_pages = gsGetPdfPageSizes(input_file_str); if ( pages_set.size() > 0 && (int)pdf_pages.size() <= *pages_set.rbegin() ) { fprintf( stderr, "%s: error: invalid page selection (%s) on pdf with %d pages\n", tool, page_sel.c_str(), (int)pdf_pages.size() ); return 1; } for ( n=0; n<(int)pdf_pages.size(); n++ ) { if ( pages_set.size() > 0 && pages_set.find(n) == pages_set.end() ) continue; std::string pagepath = input_file_str+"["+std::to_string(n)+"]"; NamedImage namedimage; namedimage.image = NULL; if ( num_pages == 0 ) namedimage.node = page.newXml( tool_info, pagepath.c_str(), (int)(0.5+pdf_pages[n].first), (int)(0.5+pdf_pages[n].second), gb_page_ns ); else namedimage.node = page.addPage( pagepath.c_str(), (int)(0.5+pdf_pages[n].first), (int)(0.5+pdf_pages[n].second) ); images.push_back( namedimage ); num_pages++; } } /// Input is image /// else { /// Read input image /// PageImage image = pixRead( input_file ); if ( image == NULL ) { fprintf( stderr, "%s: error: problems reading image: %s\n", tool, input_file ); return 1; } NamedImage namedimage; namedimage.image = NULL; if ( num_pages == 0 ) namedimage.node = page.newXml( tool_info, input_file, pixGetWidth(image), pixGetHeight(image), gb_page_ns ); else namedimage.node = page.addPage( input_file, pixGetWidth(image), pixGetHeight(image) ); num_pages++; pixDestroy(&image); images.push_back( namedimage ); } } page.processStart(tool_info); /// Loop through all images to process /// for ( n=0; n<(int)images.size(); n++ ) { xmlNodePtr xpg = page.closest( "Page", images[n].node ); if ( images[n].image == NULL ) { try { page.loadImage(xpg, NULL, true, gb_density ); images[n].image = page.getPageImage(n); } catch ( const std::exception& e ) { fprintf( stderr, "%s: error: problems loading page image: %s :: %s\n", tool, page.getPageImageFilename(n).c_str(), e.what() ); return 1; } } tessApi->SetImage( images[n].image ); if ( gb_save_crops && input_xml ) { std::string fout = std::string("crop_")+std::to_string(n)+"_"+images[n].id+".png"; fprintf( stderr, "%s: writing cropped image: %s\n", tool, fout.c_str() ); pixWriteImpliedFormat( fout.c_str(), images[n].image, 0, 0 ); } /// For xml input setup node level /// xmlNodePtr node = NULL; int node_level = -1; if ( input_xml ) { node = images[n].node->parent; if ( page.nodeIs( node, "TextRegion" ) ) node_level = LEVEL_REGION; else if ( page.nodeIs( node, "TextLine" ) ) { node_level = LEVEL_LINE; if ( gb_psm != tesseract::PSM_SINGLE_LINE && gb_psm != tesseract::PSM_RAW_LINE ) { fprintf( stderr, "%s: error: for xml input selecting text lines, valid page segmentation modes are %d and %d\n", tool, tesseract::PSM_SINGLE_LINE, tesseract::PSM_RAW_LINE ); return 1; } } else if ( page.nodeIs( node, "Word" ) ) { node_level = LEVEL_WORD; if ( gb_psm != tesseract::PSM_SINGLE_WORD && gb_psm != tesseract::PSM_CIRCLE_WORD ) { fprintf( stderr, "%s: error: for xml input selecting words, valid page segmentation modes are %d and %d\n", tool, tesseract::PSM_SINGLE_WORD, tesseract::PSM_CIRCLE_WORD ); return 1; } } else if ( page.nodeIs( node, "Glyph" ) ) { node_level = LEVEL_GLYPH; if ( gb_psm != tesseract::PSM_SINGLE_CHAR ) { fprintf( stderr, "%s: error: for xml input selecting glyphs, the only valid page segmentation mode is %d\n", tool, tesseract::PSM_SINGLE_CHAR ); return 1; } } if ( gb_layoutlevel < node_level ) { fprintf( stderr, "%s: error: layout level lower than xpath selection level\n", tool ); return 1; } } /// Perform layout analysis /// if ( gb_onlylayout && gb_psm != tesseract::PSM_AUTO_OSD ) iter = (tesseract::ResultIterator*)( tessApi->AnalyseLayout() ); /// Perform recognition /// else { tessApi->Recognize( 0 ); iter = tessApi->GetIterator(); } if ( iter != NULL && ! iter->Empty( tesseract::RIL_BLOCK ) ) { /// Orientation and Script Detection /// tesseract::Orientation orientation; tesseract::WritingDirection writing_direction; tesseract::TextlineOrder textline_order; float deskew_angle; iter->Orientation( &orientation, &writing_direction, &textline_order, &deskew_angle ); if ( gb_psm == tesseract::PSM_AUTO_OSD ) { if ( deskew_angle != 0.0 ) page.setProperty( xpg, "deskewAngle", deskew_angle ); switch ( orientation ) { case tesseract::ORIENTATION_PAGE_RIGHT: page.setProperty( xpg, "apply-image-orientation", -90 ); break; case tesseract::ORIENTATION_PAGE_LEFT: page.setProperty( xpg, "apply-image-orientation", 90 ); break; case tesseract::ORIENTATION_PAGE_DOWN: page.setProperty( xpg, "apply-image-orientation", 180 ); break; default: break; } switch ( writing_direction ) { case tesseract::WRITING_DIRECTION_LEFT_TO_RIGHT: page.setProperty( xpg, "readingDirection", "left-to-right" ); break; case tesseract::WRITING_DIRECTION_RIGHT_TO_LEFT: page.setProperty( xpg, "readingDirection", "right-to-left" ); break; case tesseract::WRITING_DIRECTION_TOP_TO_BOTTOM: page.setProperty( xpg, "readingDirection", "top-to-bottom" ); break; } switch ( textline_order ) { case tesseract::TEXTLINE_ORDER_LEFT_TO_RIGHT: page.setProperty( xpg, "textLineOrder", "left-to-right" ); break; case tesseract::TEXTLINE_ORDER_RIGHT_TO_LEFT: page.setProperty( xpg, "textLineOrder", "right-to-left" ); break; case tesseract::TEXTLINE_ORDER_TOP_TO_BOTTOM: page.setProperty( xpg, "textLineOrder", "top-to-bottom" ); break; } } /// Loop through blocks /// int block = 0; while ( gb_layoutlevel >= LEVEL_REGION ) { /// Skip non-text blocks /// /* 0 PT_UNKNOWN, // Type is not yet known. Keep as the first element. 1 PT_FLOWING_TEXT, // Text that lives inside a column. 2 PT_HEADING_TEXT, // Text that spans more than one column. 3 PT_PULLOUT_TEXT, // Text that is in a cross-column pull-out region. 4 PT_EQUATION, // Partition belonging to an equation region. 5 PT_INLINE_EQUATION, // Partition has inline equation. 6 PT_TABLE, // Partition belonging to a table region. 7 PT_VERTICAL_TEXT, // Text-line runs vertically. 8 PT_CAPTION_TEXT, // Text that belongs to an image. 9 PT_FLOWING_IMAGE, // Image that lives inside a column. 10 PT_HEADING_IMAGE, // Image that spans more than one column. 11 PT_PULLOUT_IMAGE, // Image that is in a cross-column pull-out region. 12 PT_HORZ_LINE, // Horizontal Line. 13 PT_VERT_LINE, // Vertical Line. 14 PT_NOISE, // Lies outside of any column. */ if ( iter->BlockType() > PT_CAPTION_TEXT ) { if ( ! iter->Next( tesseract::RIL_BLOCK ) ) break; continue; } block++; xmlNodePtr xreg = NULL; std::string rid = "b" + std::to_string(block); /// If xml input and region selected, prepend id to rid and set xreg to node /// if ( node_level == LEVEL_REGION ) { rid = std::string(images[n].id) + "_" + rid; xreg = node; } /// If it is multipage, prepend page number to rid /// if ( num_pages > 1 ) rid = std::string("pg") + std::to_string(1+page.getPageNumber(xpg)) + "_" + rid; /// Otherwise add block as TextRegion element /// if ( node_level < LEVEL_REGION ) { xreg = page.addTextRegion( xpg, rid.c_str() ); /// Set block bounding box and text /// setCoords( iter, tesseract::RIL_BLOCK, page, xreg, images[n].x, images[n].y ); if ( ! gb_onlylayout && gb_textlevels[LEVEL_REGION] ) setTextEquiv( iter, tesseract::RIL_BLOCK, page, xreg ); } /// Set rotation and reading direction /// /*tesseract::Orientation orientation; tesseract::WritingDirection writing_direction; tesseract::TextlineOrder textline_order; float deskew_angle;*/ iter->Orientation( &orientation, &writing_direction, &textline_order, &deskew_angle ); if ( ! input_xml || node_level <= LEVEL_REGION ) { if ( deskew_angle != 0.0 ) page.setProperty( xpg, "deskewAngle", deskew_angle ); PAGEXML_READ_DIRECTION direct = PAGEXML_READ_DIRECTION_LTR; switch( writing_direction ) { case tesseract::WRITING_DIRECTION_LEFT_TO_RIGHT: direct = PAGEXML_READ_DIRECTION_LTR; break; case tesseract::WRITING_DIRECTION_RIGHT_TO_LEFT: direct = PAGEXML_READ_DIRECTION_RTL; break; case tesseract::WRITING_DIRECTION_TOP_TO_BOTTOM: direct = PAGEXML_READ_DIRECTION_TTB; break; } page.setReadingDirection( xreg, direct ); /*float orient = 0.0; switch( orientation ) { case tesseract::ORIENTATION_PAGE_UP: orient = 0.0; break; case tesseract::ORIENTATION_PAGE_RIGHT: orient = -90.0; break; case tesseract::ORIENTATION_PAGE_LEFT: orient = 90.0; break; case tesseract::ORIENTATION_PAGE_DOWN: orient = 180.0; break; } page.setRotation( xreg, orient );*/ } /// Loop through paragraphs in current block /// int para = 0; while ( gb_layoutlevel >= LEVEL_REGION ) { para++; /// Loop through lines in current paragraph /// int line = 0; while ( gb_layoutlevel >= LEVEL_LINE ) { line++; xmlNodePtr xline = NULL; /// If xml input and line selected, set xline to node /// if ( node_level == LEVEL_LINE ) xline = node; /// Otherwise add TextLine element /// else if ( node_level < LEVEL_LINE ) { std::string lid = rid + "_p" + std::to_string(para) + "_l" + std::to_string(line); xline = page.addTextLine( xreg, lid.c_str() ); } /// Set line bounding box, baseline and text /// if ( xline != NULL ) { setLineCoords( iter, tesseract::RIL_TEXTLINE, page, xline, images[n].x, images[n].y, orientation ); if ( ! gb_onlylayout && gb_textlevels[LEVEL_LINE] ) setTextEquiv( iter, tesseract::RIL_TEXTLINE, page, xline ); } /// Loop through words in current text line /// while ( gb_layoutlevel >= LEVEL_WORD ) { xmlNodePtr xword = NULL; /// If xml input and word selected, set xword to node /// if ( node_level == LEVEL_WORD ) xword = node; /// Otherwise add Word element /// else if ( node_level < LEVEL_WORD ) xword = page.addWord( xline ); /// Set word bounding box and text /// if ( xword != NULL ) { setCoords( iter, tesseract::RIL_WORD, page, xword, images[n].x, images[n].y, orientation ); if ( ! gb_onlylayout && gb_textlevels[LEVEL_WORD] ) setTextEquiv( iter, tesseract::RIL_WORD, page, xword ); } /// Loop through symbols in current word /// while ( gb_layoutlevel >= LEVEL_GLYPH ) { /// Set xglyph to node or add new Glyph element depending on the case /// xmlNodePtr xglyph = node_level == LEVEL_GLYPH ? node : page.addGlyph( xword ); /// Set symbol bounding box and text /// setCoords( iter, tesseract::RIL_SYMBOL, page, xglyph, images[n].x, images[n].y, orientation ); if ( ! gb_onlylayout && gb_textlevels[LEVEL_GLYPH] ) setTextEquiv( iter, tesseract::RIL_SYMBOL, page, xglyph ); if ( iter->IsAtFinalElement( tesseract::RIL_WORD, tesseract::RIL_SYMBOL ) ) break; iter->Next( tesseract::RIL_SYMBOL ); } // while ( gb_layoutlevel >= LEVEL_GLYPH ) { if ( iter->IsAtFinalElement( tesseract::RIL_TEXTLINE, tesseract::RIL_WORD ) ) break; iter->Next( tesseract::RIL_WORD ); } // while ( gb_layoutlevel >= LEVEL_WORD ) { if ( iter->IsAtFinalElement( tesseract::RIL_PARA, tesseract::RIL_TEXTLINE ) ) break; iter->Next( tesseract::RIL_TEXTLINE ); } // while ( gb_layoutlevel >= LEVEL_LINE ) { if ( iter->IsAtFinalElement( tesseract::RIL_BLOCK, tesseract::RIL_PARA ) ) break; iter->Next( tesseract::RIL_PARA ); } // while ( gb_layoutlevel >= LEVEL_REGION ) { if ( ! iter->Next( tesseract::RIL_BLOCK ) ) break; } // while ( gb_layoutlevel >= LEVEL_REGION ) { } // if ( iter != NULL && ! iter->Empty( tesseract::RIL_BLOCK ) ) { page.releaseImage(xpg); } // for ( n=0; n<(int)images.size(); n++ ) { /// Apply image orientations /// std::vector<xmlNodePtr> sel = page.select("//_:Page[_:Property/@key='apply-image-orientation']"); for ( n=(int)sel.size()-1; n>=0; n-- ) { int angle = atoi( page.getPropertyValue( sel[n], "apply-image-orientation" ).c_str() ); if ( angle ) page.rotatePage( -angle, sel[n], true ); page.rmElems( page.select("_:Property[@key='apply-image-orientation']", sel[n]) ); std::vector<xmlNodePtr> lines = page.select(".//_:TextLine",sel[n]); /// Fix image orientation using baselines /// if ( lines.size() > 0 ) { double domangle = page.getDominantBaselinesOrientation(lines); angle = 0; if ( domangle >= M_PI/4 && domangle < 3*M_PI/4 ) angle = -90; else if ( domangle <= -M_PI/4 && domangle > -3*M_PI/4 ) angle = 90; else if ( domangle >= 3*M_PI/4 || domangle <= -3*M_PI/4 ) angle = 180; if ( angle ) page.rotatePage(angle, sel[n], true); } } /// Fill in "0,0 0,0" Word Coords /// sel = page.select("//_:Word[_:Coords/@points='0,0 0,0']"); for ( n=(int)sel.size()-1; n>=0; n-- ) { xmlNodePtr elem = sel[n]; xmlNodePtr elem_pre = page.selectNth("preceding-sibling::_:Word[_:Coords/@points!='0,0 0,0']", -1, elem); xmlNodePtr elem_fol = page.selectNth("following-sibling::_:Word[_:Coords/@points!='0,0 0,0']", 0, elem); if ( elem_pre == NULL && elem_fol == NULL ) { page.setCoords(elem, page.getPoints(page.parent(elem))); page.setProperty(elem, "coords-unk-filler"); continue; } std::vector<cv::Point2f> pts_pre = page.getPoints(elem_pre); std::vector<cv::Point2f> pts_fol = page.getPoints(elem_fol); std::vector<cv::Point2f> pts; if ( elem_pre != NULL && elem_fol != NULL ) { pts.push_back(pts_pre[1]); pts.push_back(pts_fol[0]); pts.push_back(pts_fol[3]); pts.push_back(pts_pre[2]); } else if ( elem_pre != NULL ) { cv::Point2f upper = pts_pre[1] - pts_pre[0]; cv::Point2f lower = pts_pre[2] - pts_pre[3]; upper = upper/cv::norm(upper) + pts_pre[1]; lower = lower/cv::norm(lower) + pts_pre[2]; pts.push_back(pts_pre[1]); pts.push_back(upper); pts.push_back(lower); pts.push_back(pts_pre[2]); } else { cv::Point2f upper = pts_fol[0] - pts_fol[1]; cv::Point2f lower = pts_fol[3] - pts_fol[2]; upper = upper/cv::norm(upper) + pts_fol[0]; lower = lower/cv::norm(lower) + pts_fol[3]; pts.push_back(upper); pts.push_back(pts_fol[0]); pts.push_back(pts_fol[3]); pts.push_back(lower); } page.setCoords(elem, pts); page.setProperty(elem, "coords-unk-filler"); } /// Try to make imageFilename be a relative path w.r.t. the output XML /// if ( ! input_xml && ! gb_inplace && strcmp(gb_output,"-") ) page.relativizeImageFilename(gb_output); /// Write resulting XML /// int bytes = page.write( gb_inplace ? input_file : gb_output ); if ( bytes <= 0 ) fprintf( stderr, "%s: error: problems writing to output xml\n", tool ); /// Release resources /// if ( pixRelease ) for ( n=0; n<(int)images.size(); n++ ) pixDestroy(&(images[n].image)); tessApi->End(); delete tessApi; delete iter; return bytes <= 0 ? 1 : 0; }
40.931818
209
0.598751
mauvilsa
d607276feed1876d7426297fa7dd6a9fab4b7381
1,561
cpp
C++
src/c++/methods/CommentsInstanceMethods.cpp
TestingTravis/modioSDK
b15c4442a8acdb4bf690a846232399eaf9fe18f6
[ "MIT" ]
null
null
null
src/c++/methods/CommentsInstanceMethods.cpp
TestingTravis/modioSDK
b15c4442a8acdb4bf690a846232399eaf9fe18f6
[ "MIT" ]
null
null
null
src/c++/methods/CommentsInstanceMethods.cpp
TestingTravis/modioSDK
b15c4442a8acdb4bf690a846232399eaf9fe18f6
[ "MIT" ]
null
null
null
#include "c++/ModIOInstance.h" namespace modio { void Instance::getAllModComments(u32 mod_id, modio::FilterCreator &filter, const std::function<void(const modio::Response &response, const std::vector<modio::Comment> &comments)> &callback) { const struct GetAllModCommentsCall *get_all_mod_comments_call = new GetAllModCommentsCall{callback}; get_all_mod_comments_calls[this->current_call_id] = (GetAllModCommentsCall *)get_all_mod_comments_call; modioGetAllModComments((void *)new u32(this->current_call_id), mod_id, *filter.getFilter(), &onGetAllModComments); this->current_call_id++; } void Instance::getModComment(u32 mod_id, u32 comment_id, const std::function<void(const modio::Response &response, const modio::Comment &comment)> &callback) { const struct GetModCommentCall *get_mod_comment_call = new GetModCommentCall{callback}; get_mod_comment_calls[this->current_call_id] = (GetModCommentCall *)get_mod_comment_call; modioGetModComment((void *)new u32(this->current_call_id), mod_id, comment_id, &onGetModComment); this->current_call_id++; } void Instance::deleteModComment(u32 mod_id, u32 comment_id, const std::function<void(const modio::Response &response)> &callback) { const struct GenericCall *delete_mod_comment_call = new GenericCall{callback}; delete_mod_comment_calls[this->current_call_id] = (GenericCall *)delete_mod_comment_call; modioDeleteModComment((void *)new u32(this->current_call_id), mod_id, comment_id, &onDeleteModComment); this->current_call_id++; } } // namespace modio
44.6
189
0.778988
TestingTravis
d61a1cca8333efa64a7526312a72713da091f7a9
2,567
hpp
C++
OfferReview/OfferReview/01_38/26_SubstructureInTree/SubstructureInTree.hpp
chm994483868/HMDailyLearningRecord
95ff0a5347927ce4527bcdd70374e5be22bfc60d
[ "MIT" ]
2
2021-06-26T08:07:04.000Z
2021-08-03T06:05:40.000Z
OfferReview/OfferReview/01_38/26_SubstructureInTree/SubstructureInTree.hpp
chm994483868/HMDailyLearningRecord
95ff0a5347927ce4527bcdd70374e5be22bfc60d
[ "MIT" ]
null
null
null
OfferReview/OfferReview/01_38/26_SubstructureInTree/SubstructureInTree.hpp
chm994483868/HMDailyLearningRecord
95ff0a5347927ce4527bcdd70374e5be22bfc60d
[ "MIT" ]
null
null
null
// // SubstructureInTree.hpp // OfferReview // // Created by CHM on 2020/7/29. // Copyright © 2020 CHM. All rights reserved. // #ifndef SubstructureInTree_hpp #define SubstructureInTree_hpp #include <stdio.h> namespace SubstructureInTree { // 26:树的子结构 // 题目:输入两棵二叉树A和B,判断B是不是A的子结构。 struct BinaryTreeNode { double m_dbValue; BinaryTreeNode* m_pLeft; BinaryTreeNode* m_pRight; }; bool doesTree1HaveTree2(BinaryTreeNode* pRoot1, BinaryTreeNode* pRoot2); bool equal(double num1, double num2); bool hasSubtree(BinaryTreeNode* pRoot1, BinaryTreeNode* pRoot2); // 辅助代码 BinaryTreeNode* CreateBinaryTreeNode(double dbValue); void ConnectTreeNodes(BinaryTreeNode* pParent, BinaryTreeNode* pLeft, BinaryTreeNode* pRight); void DestroyTree(BinaryTreeNode* pRoot); // 测试代码 void Test(char* testName, BinaryTreeNode* pRoot1, BinaryTreeNode* pRoot2, bool expected); // 树中结点含有分叉,树B是树A的子结构 // 8 8 // / \ / \ // 8 7 9 2 // / \ // 9 2 // / \ // 4 7 void Test1(); // 树中结点含有分叉,树B不是树A的子结构 // 8 8 // / \ / \ // 8 7 9 2 // / \ // 9 3 // / \ // 4 7 void Test2(); // 树中结点只有左子结点,树B是树A的子结构 // 8 8 // / / // 8 9 // / / // 9 2 // / // 2 // / // 5 void Test3(); // 树中结点只有左子结点,树B不是树A的子结构 // 8 8 // / / // 8 9 // / / // 9 3 // / // 2 // / // 5 void Test4(); // 树中结点只有右子结点,树B是树A的子结构 // 8 8 // \ \ // 8 9 // \ \ // 9 2 // \ // 2 // \ // 5 void Test5(); // 树A中结点只有右子结点,树B不是树A的子结构 // 8 8 // \ \ // 8 9 // \ / \ // 9 3 2 // \ // 2 // \ // 5 void Test6(); // 树 A 为空树 void Test7(); // 树 B 为空树 void Test8(); // 树A和树B都为空 void Test9(); void Test(); } #endif /* SubstructureInTree_hpp */
23.550459
94
0.3806
chm994483868
d61dfb0f234a9e2d183888452ae7a80373d8809d
742
cpp
C++
Codeforces/Codeforces 1200 1400/1178B.cpp
Superdanby/YEE
49a6349dc5644579246623b480777afbf8031fcd
[ "MIT" ]
1
2019-09-07T15:56:05.000Z
2019-09-07T15:56:05.000Z
Codeforces/Codeforces 1200 1400/1178B.cpp
Superdanby/YEE
49a6349dc5644579246623b480777afbf8031fcd
[ "MIT" ]
null
null
null
Codeforces/Codeforces 1200 1400/1178B.cpp
Superdanby/YEE
49a6349dc5644579246623b480777afbf8031fcd
[ "MIT" ]
null
null
null
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main(int argc, char const *argv[]) { string inp; cin >> inp; vector<ll> left(inp.length(), 0), right(inp.length(), 0); for (size_t i = 2, j = inp.length() - 3; i < inp.length(); ++i, --j) { if (inp[i - 1] == 'v' && inp[i - 2] == 'v') left[i] = left[i - 1] + 1; else left[i] = left[i - 1]; if (inp[j + 1] == 'v' && inp[j + 2] == 'v') right[j] = right[j + 1] + 1; else right[j] = right[j + 1]; } ll ans = 0; for (size_t i = 0; i < inp.length(); ++i) if (inp[i] =='o') ans += left[i] * right[i]; cout << ans << "\n"; return 0; }
24.733333
72
0.421833
Superdanby
d6202244b11c5b42952b1c447fa48887abbc05fd
2,521
cpp
C++
src/ssl/Exception.cpp
Good-Pudge/OkHttpFork
b179350d6262f281c1c27d69d944c62f536fe1ba
[ "BSL-1.0", "Apache-2.0", "OpenSSL" ]
10
2019-02-21T06:21:48.000Z
2022-02-22T08:01:24.000Z
src/ssl/Exception.cpp
Good-Pudge/OkHttpFork
b179350d6262f281c1c27d69d944c62f536fe1ba
[ "BSL-1.0", "Apache-2.0", "OpenSSL" ]
2
2018-02-04T20:16:46.000Z
2018-02-04T20:19:00.000Z
src/ssl/Exception.cpp
Good-Pudge/OkHttpFork
b179350d6262f281c1c27d69d944c62f536fe1ba
[ "BSL-1.0", "Apache-2.0", "OpenSSL" ]
10
2018-10-15T10:17:00.000Z
2022-02-17T02:28:51.000Z
// // Created by Good_Pudge. // #include "Util.hpp" #include <ohf/ssl/Exception.hpp> namespace ohf { namespace ssl { std::string get_error(Exception::Code code) { std::string m_what; switch(code) { case ohf::Exception::Code::SSL_CREATE_ERROR: m_what = "SSL create error: "; break; case ohf::Exception::Code::SSL_CREATE_CONTEXT_ERROR: m_what = "SSL create context error: "; break; case ohf::Exception::Code::SSL_CREATE_CONNECTION_ERROR: m_what = "SSL create connection error: "; break; case ohf::Exception::Code::SSL_ERROR: m_what = "SSL error: "; break; case ohf::Exception::Code::SSL_ACCEPT_ERROR: m_what = "SSL accept error: "; break; case ohf::Exception::Code::SSL_FAILED_TO_USE_CERTIFICATE_FILE: m_what = "SSL failed to use certificate file: "; break; case ohf::Exception::Code::SSL_FAILED_TO_USE_PRIVATE_KEY_FILE: m_what = "SSL failed to use private key file: "; break; case ohf::Exception::Code::SSL_FAILED_TO_VERIFY_PRIVATE_KEY: m_what = "SSL failed to verify private key: "; break; case ohf::Exception::Code::SSL_PROTOCOL_DOES_NOT_SUPPORTED: m_what = "SSL protocol doesn't supported: "; break; default: { throw ohf::Exception(Exception::Code::INVALID_EXCEPTION_CODE, "Invalid exception code: " + std::to_string((Int32) code)); } } return m_what; } Exception::Exception(const Code &code) : ohf::Exception(code, get_error(code)), ssl_code(0) { m_what += (ssl_message = getOpenSSLError()); } Exception::Exception(const Exception::Code &code, const SSL &ssl, Int32 retCode) : Exception(code) { ssl_code = SSL_get_error(ssl.pImpl->ssl, retCode); } Int32 Exception::sslCode() const noexcept { return ssl_code; } std::string Exception::sslMessage() const noexcept { return ssl_message; } } }
36.536232
108
0.503372
Good-Pudge
d62036c96de9ba6e8889edad3ab32b8b439d6f04
1,106
cpp
C++
FrameWorkCode/TreeItem.cpp
sans-sehgal/OpenOCR_Correct
18424cd4d887a25c7cfc1743f1f975196b749deb
[ "BSD-3-Clause" ]
6
2021-12-03T05:42:26.000Z
2022-03-09T01:25:16.000Z
FrameWorkCode/TreeItem.cpp
sans-sehgal/OpenOCR_Correct
18424cd4d887a25c7cfc1743f1f975196b749deb
[ "BSD-3-Clause" ]
101
2021-08-18T04:12:43.000Z
2022-03-27T17:31:20.000Z
FrameWorkCode/TreeItem.cpp
sans-sehgal/OpenOCR_Correct
18424cd4d887a25c7cfc1743f1f975196b749deb
[ "BSD-3-Clause" ]
4
2021-08-21T13:37:21.000Z
2022-02-26T06:00:27.000Z
#pragma once #include "TreeItem.h" #include "Filters.h" TreeItem::~TreeItem() { qDeleteAll(mChildItems); } void TreeItem::append_child(TreeItem * child) { mChildItems.append(child); } TreeItem * TreeItem::child(int row) { if(row < 0 || row >= mChildItems.size()) return nullptr; return mChildItems.at(row); } int TreeItem::child_count() const { return mChildItems.count(); } int TreeItem::column_count() const { return mItemData.count(); } QVariant TreeItem::data(int column) const { if(column < 0 || column >= mItemData.size()) return QVariant(); return mItemData.at(column); } TreeItem * TreeItem::find(QString & str) { for (auto & v : mItemData) { //if (std::string(v.typeName()) == "Filter") { auto name = (QString*) v.data(); if (str == *name) { return this; } //} } TreeItem *t; for (auto p : mChildItems) { if (t = p->find(str)) return t; } return nullptr; } int TreeItem::row() const { if (mParentItem) return mParentItem->mChildItems.indexOf(const_cast<TreeItem*>(this)); return 0; } TreeItem * TreeItem::parentItem() { return mParentItem; }
16.507463
71
0.659132
sans-sehgal
d621d41f5406af4cac6f7bf1158e7c7047acf386
1,496
cc
C++
test/log_stream_unittest.cc
Mercy1101/my_log
593dddc9cc4d7b6f2fa51176c7f83429fe43c266
[ "MIT" ]
null
null
null
test/log_stream_unittest.cc
Mercy1101/my_log
593dddc9cc4d7b6f2fa51176c7f83429fe43c266
[ "MIT" ]
null
null
null
test/log_stream_unittest.cc
Mercy1101/my_log
593dddc9cc4d7b6f2fa51176c7f83429fe43c266
[ "MIT" ]
null
null
null
/// Copyright (c) 2019,2020 Lijiancong. All rights reserved. /// /// Use of this source code is governed by a MIT license /// that can be found in the License file. #include "log_stream.hpp" #include <catch2/catch.hpp> #include "profiler.hpp" TEST_CASE("log_stream 简单测试", "log") { LOG(TRACE) << "string" << " " << 33 << " " << 55.0; LOG(DEBUG) << "string" << " " << 33 << " " << 55.0; LOG(INFO) << "string" << " " << 33 << " " << 55.0; LOG(WARN) << "string" << " " << 33 << " " << 55.0; LOG(ERROR) << "string" << " " << 33 << " " << 55.0; LOG(CRITICAL) << "string" << " " << 33 << " " << 55.0; } TEST_CASE("log_stream效能测试", "log2") { for (auto i = 0; i < 10; i++) { PROFILER_F(); for (auto x = 0; x < 1000; x++) { LOG(TRACE) << "string" << " " << 33 << " " << 55.0; LOG(DEBUG) << "string" << " " << 33 << " " << 55.0; LOG(INFO) << "string" << " " << 33 << " " << 55.0; LOG(WARN) << "string" << " " << 33 << " " << 55.0; LOG(ERROR) << "string" << " " << 33 << " " << 55.0; LOG(CRITICAL) << "string" << " " << 33 << " " << 55.0; } } } TEST_CASE("log_stream 特殊值测试", "log3") { LOG(TRACE) << ("string"); LOG(DEBUG) << ("string"); LOG(INFO) << ("string"); LOG(WARN) << ("string"); LOG(ERROR) << ("string"); LOG(CRITICAL) << ("string"); }
27.2
60
0.407754
Mercy1101
d6230b0105f396a22f3275ea218d38487a4e3995
3,607
hpp
C++
include/Org/BouncyCastle/Crypto/Parameters/DesParameters.hpp
darknight1050/BeatSaber-Quest-Codegen
a6eeecc3f0e8f6079630f9a9a72b3121ac7b2032
[ "Unlicense" ]
null
null
null
include/Org/BouncyCastle/Crypto/Parameters/DesParameters.hpp
darknight1050/BeatSaber-Quest-Codegen
a6eeecc3f0e8f6079630f9a9a72b3121ac7b2032
[ "Unlicense" ]
null
null
null
include/Org/BouncyCastle/Crypto/Parameters/DesParameters.hpp
darknight1050/BeatSaber-Quest-Codegen
a6eeecc3f0e8f6079630f9a9a72b3121ac7b2032
[ "Unlicense" ]
null
null
null
// Autogenerated from CppHeaderCreator // Created by Sc2ad // ========================================================================= #pragma once // Begin includes #include "extern/beatsaber-hook/shared/utils/typedefs.h" // Including type: Org.BouncyCastle.Crypto.Parameters.KeyParameter #include "Org/BouncyCastle/Crypto/Parameters/KeyParameter.hpp" #include "extern/beatsaber-hook/shared/utils/il2cpp-utils-methods.hpp" #include "extern/beatsaber-hook/shared/utils/il2cpp-utils-properties.hpp" #include "extern/beatsaber-hook/shared/utils/il2cpp-utils-fields.hpp" #include "extern/beatsaber-hook/shared/utils/utils.h" // Completed includes // Type namespace: Org.BouncyCastle.Crypto.Parameters namespace Org::BouncyCastle::Crypto::Parameters { // Size: 0x18 #pragma pack(push, 1) // Autogenerated type: Org.BouncyCastle.Crypto.Parameters.DesParameters class DesParameters : public Org::BouncyCastle::Crypto::Parameters::KeyParameter { public: // Creating value type constructor for type: DesParameters DesParameters() noexcept {} // Get static field: static private readonly System.Byte[] DES_weak_keys static ::Array<uint8_t>* _get_DES_weak_keys(); // Set static field: static private readonly System.Byte[] DES_weak_keys static void _set_DES_weak_keys(::Array<uint8_t>* value); // static public System.Boolean IsWeakKey(System.Byte[] key, System.Int32 offset) // Offset: 0x123C3CC static bool IsWeakKey(::Array<uint8_t>* key, int offset); // static public System.Boolean IsWeakKey(System.Byte[] key) // Offset: 0x123C604 static bool IsWeakKey(::Array<uint8_t>* key); // static public System.Byte SetOddParity(System.Byte b) // Offset: 0x123C884 static uint8_t SetOddParity(uint8_t b); // static public System.Void SetOddParity(System.Byte[] bytes) // Offset: 0x123C8A4 static void SetOddParity(::Array<uint8_t>* bytes); // static private System.Void .cctor() // Offset: 0x123C980 static void _cctor(); // public System.Void .ctor(System.Byte[] key) // Offset: 0x123C26C // Implemented from: Org.BouncyCastle.Crypto.Parameters.KeyParameter // Base method: System.Void KeyParameter::.ctor(System.Byte[] key) template<::il2cpp_utils::CreationType creationType = ::il2cpp_utils::CreationType::Temporary> static DesParameters* New_ctor(::Array<uint8_t>* key) { static auto ___internal__logger = ::Logger::get().WithContext("Org::BouncyCastle::Crypto::Parameters::DesParameters::.ctor"); return THROW_UNLESS((::il2cpp_utils::New<DesParameters*, creationType>(key))); } // public System.Void .ctor(System.Byte[] key, System.Int32 keyOff, System.Int32 keyLen) // Offset: 0x123C66C // Implemented from: Org.BouncyCastle.Crypto.Parameters.KeyParameter // Base method: System.Void KeyParameter::.ctor(System.Byte[] key, System.Int32 keyOff, System.Int32 keyLen) template<::il2cpp_utils::CreationType creationType = ::il2cpp_utils::CreationType::Temporary> static DesParameters* New_ctor(::Array<uint8_t>* key, int keyOff, int keyLen) { static auto ___internal__logger = ::Logger::get().WithContext("Org::BouncyCastle::Crypto::Parameters::DesParameters::.ctor"); return THROW_UNLESS((::il2cpp_utils::New<DesParameters*, creationType>(key, keyOff, keyLen))); } }; // Org.BouncyCastle.Crypto.Parameters.DesParameters #pragma pack(pop) } DEFINE_IL2CPP_ARG_TYPE(Org::BouncyCastle::Crypto::Parameters::DesParameters*, "Org.BouncyCastle.Crypto.Parameters", "DesParameters");
56.359375
134
0.712503
darknight1050
d624b48f9cc20fcb15c28a498237a6c04a8fa8d6
4,204
cpp
C++
src/base/ossimAdjustableParameterInfo.cpp
vladislav-horbatiuk/ossim
82417ad868fac022672335e1684bdd91d662c18c
[ "MIT" ]
251
2015-10-20T09:08:11.000Z
2022-03-22T18:16:38.000Z
src/base/ossimAdjustableParameterInfo.cpp
IvanLJF/ossim
2e0143f682b9884a09ff2598ef8737f29e44fbdf
[ "MIT" ]
73
2015-11-02T17:12:36.000Z
2021-11-15T17:41:47.000Z
src/base/ossimAdjustableParameterInfo.cpp
IvanLJF/ossim
2e0143f682b9884a09ff2598ef8737f29e44fbdf
[ "MIT" ]
146
2015-10-15T16:00:15.000Z
2022-03-22T12:37:14.000Z
//******************************************************************* // Copyright (C) 2000 ImageLinks Inc. // // License: See top level LICENSE.txt file. // // Author: Garrett Potts // //************************************************************************* // $Id: ossimAdjustableParameterInfo.cpp 11347 2007-07-23 13:01:59Z gpotts $ #include <sstream> #include <algorithm> #include <ossim/base/ossimAdjustableParameterInfo.h> #include <ossim/base/ossimUnitTypeLut.h> #include <ossim/base/ossimKeywordNames.h> #include <ossim/base/ossimCommon.h> // static const char* PARAM_NAME_KW = "name"; // static const char* PARAM_UNITS_KW = "units"; static const char* PARAM_KW = "parameter"; static const char* PARAM_SIGMA_KW = "sigma"; static const char* PARAM_CENTER_KW = "center"; static const char* PARAM_LOCK_FLAG_KW = "lock_flag"; std::ostream& operator <<(std::ostream& out, const ossimAdjustableParameterInfo& data) { out << "description: " << data.theDescription << std::endl << "center: " << data.theCenter << std::endl << "parameter: " << data.theParameter << std::endl << "sigma: " << data.theSigma << std::endl << "units: " << (ossimUnitTypeLut::instance()->getEntryString(data.theUnit)) << std::endl << "locked: " << (data.theLockFlag?"true":"false") << std::endl; return out; } ossimString ossimAdjustableParameterInfo::getUnitAsString()const { return ossimUnitTypeLut::instance()->getEntryString((int)theUnit); } void ossimAdjustableParameterInfo::setCenter(double center) { if(!theLockFlag) { theCenter = center; } } double ossimAdjustableParameterInfo::getCenter()const { return theCenter; } double ossimAdjustableParameterInfo::computeOffset()const { return theCenter + theSigma*theParameter; } void ossimAdjustableParameterInfo::setOffset(ossim_float64 value) { if(!theLockFlag) { double minValue = theCenter - theSigma; double maxValue = theCenter + theSigma; double x = 0.0; if(std::abs(theSigma) > DBL_EPSILON) { x = (value - theCenter)/theSigma; value = theCenter + x*theSigma; if(value < minValue) { x = -1; } else if(value > maxValue) { x = 1.0; } theParameter = x; } } } bool ossimAdjustableParameterInfo::loadState(const ossimKeywordlist& kwl, const ossimString& prefix) { const char* param = kwl.find(prefix, PARAM_KW); const char* sigma = kwl.find(prefix, PARAM_SIGMA_KW); const char* center = kwl.find(prefix, PARAM_CENTER_KW); const char* unit = kwl.find(prefix, ossimKeywordNames::UNITS_KW); const char* locked = kwl.find(prefix, PARAM_LOCK_FLAG_KW); theDescription = kwl.find(prefix, ossimKeywordNames::DESCRIPTION_KW); if(param) { theParameter = ossimString(param).toDouble(); } else { theParameter = 0.0; } if(unit) { theUnit = (ossimUnitType)(ossimUnitTypeLut::instance()->getEntryNumber(unit)); } else { theUnit = OSSIM_UNIT_UNKNOWN; } if(sigma) { theSigma = ossimString(sigma).toDouble(); } else { theSigma = 0.0; } if(center) { theCenter = ossimString(center).toDouble(); } else { theCenter = 0.0; } if(locked) { theLockFlag = ossimString(locked).toBool(); } return true; } bool ossimAdjustableParameterInfo::saveState(ossimKeywordlist& kwl, const ossimString& prefix)const { kwl.add(prefix, ossimKeywordNames::DESCRIPTION_KW, theDescription, true); kwl.add(prefix, ossimKeywordNames::UNITS_KW, ossimUnitTypeLut::instance()->getEntryString(theUnit), true); kwl.add(prefix, PARAM_KW, theParameter, true); kwl.add(prefix, PARAM_SIGMA_KW, theSigma, true); kwl.add(prefix, PARAM_CENTER_KW, theCenter, true); kwl.add(prefix, PARAM_LOCK_FLAG_KW, theLockFlag, true); return true; }
27.298701
89
0.596575
vladislav-horbatiuk
d62745605e1ad49759010b0e6da70446dda2987e
938
cpp
C++
Problem/src/SimpleProblem.cpp
tut-cc/DiceTilingMeu
d07d6e27370385ff7b4bce48f34f64bb1caa41ee
[ "MIT" ]
8
2015-10-12T05:39:06.000Z
2016-08-20T06:12:26.000Z
Problem/src/SimpleProblem.cpp
tut-cc/DiceTilingMeu
d07d6e27370385ff7b4bce48f34f64bb1caa41ee
[ "MIT" ]
null
null
null
Problem/src/SimpleProblem.cpp
tut-cc/DiceTilingMeu
d07d6e27370385ff7b4bce48f34f64bb1caa41ee
[ "MIT" ]
null
null
null
#include "SimpleProblem.hpp" #include <string> #include <iostream> SimpleProblem::SimpleProblem() : field([](){ std::vector<std::string> list; for (int i = 0; i < 32; ++i) { std::string str; std::cin >> str; list.push_back( str ); } return list; }()), stones([this](){ std::vector<std::vector<std::string>> stones; std::cin >> num; for(int i = 0; i < num; ++i) { std::vector<std::string> stone; for(int i = 0; i < 8; ++i) { std::string str; std::cin >> str; stone.push_back(str); } stones.push_back(stone); } return stones; }()) {} std::vector<std::string> SimpleProblem::get_field_str() const { return field; } std::vector<std::vector<std::string>> SimpleProblem::get_stones_str() const { return stones; } std::vector<std::string> SimpleProblem::get_stone_str(int idx) const { return stones[ idx ]; } int SimpleProblem::num_of_stones() const { return num; }
19.142857
75
0.614072
tut-cc
d628b15b7336c5d05c275d4421ee0aa981992da8
234
cpp
C++
solved/11054.cpp
goutomroy/uva.onlinejudge
5ce09d9e370ad78eabd0fd500ef77ce804e2d0f2
[ "MIT" ]
null
null
null
solved/11054.cpp
goutomroy/uva.onlinejudge
5ce09d9e370ad78eabd0fd500ef77ce804e2d0f2
[ "MIT" ]
null
null
null
solved/11054.cpp
goutomroy/uva.onlinejudge
5ce09d9e370ad78eabd0fd500ef77ce804e2d0f2
[ "MIT" ]
null
null
null
#include<stdio.h> #include<math.h> void main( ) { long n,work,prework,i,wine; while(scanf("%ld",&n)==1 && n!=0) { work=prework=0; for(i=0;i<n;i++) { scanf("%ld",&wine); work+=abs(prework); prework+=wine; } printf("%ld\n",work); } }
12.315789
34
0.594017
goutomroy
d62b88a1c0df56df0d339305aee9f48e8cfcafcb
45,230
cpp
C++
tsim_example/hardware/chisel/build/verilator/VTestAccel.cpp
BenjaminTu/TsimTest
4874af4130b32cfb7af522f0f7718c7ded1572a7
[ "Apache-2.0" ]
null
null
null
tsim_example/hardware/chisel/build/verilator/VTestAccel.cpp
BenjaminTu/TsimTest
4874af4130b32cfb7af522f0f7718c7ded1572a7
[ "Apache-2.0" ]
null
null
null
tsim_example/hardware/chisel/build/verilator/VTestAccel.cpp
BenjaminTu/TsimTest
4874af4130b32cfb7af522f0f7718c7ded1572a7
[ "Apache-2.0" ]
null
null
null
// Verilated -*- C++ -*- // DESCRIPTION: Verilator output: Design implementation internals // See VTestAccel.h for the primary calling header #include "VTestAccel.h" #include "VTestAccel__Syms.h" #include "verilated_dpi.h" //-------------------- void VTestAccel::eval() { VL_DEBUG_IF(VL_DBG_MSGF("+++++TOP Evaluate VTestAccel::eval\n"); ); VTestAccel__Syms* __restrict vlSymsp = this->__VlSymsp; // Setup global symbol table VTestAccel* __restrict vlTOPp VL_ATTR_UNUSED = vlSymsp->TOPp; #ifdef VL_DEBUG // Debug assertions _eval_debug_assertions(); #endif // VL_DEBUG // Initialize if (VL_UNLIKELY(!vlSymsp->__Vm_didInit)) _eval_initial_loop(vlSymsp); // Evaluate till stable int __VclockLoop = 0; QData __Vchange = 1; do { VL_DEBUG_IF(VL_DBG_MSGF("+ Clock loop\n");); vlSymsp->__Vm_activity = true; _eval(vlSymsp); if (VL_UNLIKELY(++__VclockLoop > 100)) { // About to fail, so enable debug to see what's not settling. // Note you must run make with OPT=-DVL_DEBUG for debug prints. int __Vsaved_debug = Verilated::debug(); Verilated::debug(1); __Vchange = _change_request(vlSymsp); Verilated::debug(__Vsaved_debug); VL_FATAL_MT(__FILE__,__LINE__,__FILE__,"Verilated model didn't converge"); } else { __Vchange = _change_request(vlSymsp); } } while (VL_UNLIKELY(__Vchange)); } void VTestAccel::_eval_initial_loop(VTestAccel__Syms* __restrict vlSymsp) { vlSymsp->__Vm_didInit = true; _eval_initial(vlSymsp); vlSymsp->__Vm_activity = true; // Evaluate till stable int __VclockLoop = 0; QData __Vchange = 1; do { _eval_settle(vlSymsp); _eval(vlSymsp); if (VL_UNLIKELY(++__VclockLoop > 100)) { // About to fail, so enable debug to see what's not settling. // Note you must run make with OPT=-DVL_DEBUG for debug prints. int __Vsaved_debug = Verilated::debug(); Verilated::debug(1); __Vchange = _change_request(vlSymsp); Verilated::debug(__Vsaved_debug); VL_FATAL_MT(__FILE__,__LINE__,__FILE__,"Verilated model didn't DC converge"); } else { __Vchange = _change_request(vlSymsp); } } while (VL_UNLIKELY(__Vchange)); } //-------------------- // Internal Methods VL_INLINE_OPT void VTestAccel::__Vdpiimwrap_TestAccel__DOT__sim_shell__DOT__mod_sim__DOT__VTASimDPI_TOP(CData& sim_wait, CData& sim_exit) { VL_DEBUG_IF(VL_DBG_MSGF("+ VTestAccel::__Vdpiimwrap_TestAccel__DOT__sim_shell__DOT__mod_sim__DOT__VTASimDPI_TOP\n"); ); // Body unsigned char sim_wait__Vcvt; unsigned char sim_exit__Vcvt; VTASimDPI(&sim_wait__Vcvt, &sim_exit__Vcvt); sim_wait = (0xffU & sim_wait__Vcvt); sim_exit = (0xffU & sim_exit__Vcvt); } VL_INLINE_OPT void VTestAccel::__Vdpiimwrap_TestAccel__DOT__sim_shell__DOT__mod_host__DOT__VTAHostDPI_TOP(CData& req_valid, CData& req_opcode, CData& req_addr, IData& req_value, const CData req_deq, const CData resp_valid, const IData resp_value) { VL_DEBUG_IF(VL_DBG_MSGF("+ VTestAccel::__Vdpiimwrap_TestAccel__DOT__sim_shell__DOT__mod_host__DOT__VTAHostDPI_TOP\n"); ); // Body unsigned char req_valid__Vcvt; unsigned char req_opcode__Vcvt; unsigned char req_addr__Vcvt; unsigned int req_value__Vcvt; unsigned char req_deq__Vcvt; req_deq__Vcvt = req_deq; unsigned char resp_valid__Vcvt; resp_valid__Vcvt = resp_valid; unsigned int resp_value__Vcvt; resp_value__Vcvt = resp_value; VTAHostDPI(&req_valid__Vcvt, &req_opcode__Vcvt, &req_addr__Vcvt, &req_value__Vcvt, req_deq__Vcvt, resp_valid__Vcvt, resp_value__Vcvt); req_valid = (0xffU & req_valid__Vcvt); req_opcode = (0xffU & req_opcode__Vcvt); req_addr = (0xffU & req_addr__Vcvt); req_value = req_value__Vcvt; } VL_INLINE_OPT void VTestAccel::__Vdpiimwrap_TestAccel__DOT__sim_shell__DOT__mod_mem__DOT__VTAMemDPI_TOP(const CData req_valid, const CData req_opcode, const CData req_len, const QData req_addr, const CData wr_valid, const QData wr_value, CData& rd_valid, QData& rd_value, const CData rd_ready) { VL_DEBUG_IF(VL_DBG_MSGF("+ VTestAccel::__Vdpiimwrap_TestAccel__DOT__sim_shell__DOT__mod_mem__DOT__VTAMemDPI_TOP\n"); ); // Body unsigned char req_valid__Vcvt; req_valid__Vcvt = req_valid; unsigned char req_opcode__Vcvt; req_opcode__Vcvt = req_opcode; unsigned char req_len__Vcvt; req_len__Vcvt = req_len; unsigned long long req_addr__Vcvt; req_addr__Vcvt = req_addr; unsigned char wr_valid__Vcvt; wr_valid__Vcvt = wr_valid; unsigned long long wr_value__Vcvt; wr_value__Vcvt = wr_value; unsigned char rd_valid__Vcvt; unsigned long long rd_value__Vcvt; unsigned char rd_ready__Vcvt; rd_ready__Vcvt = rd_ready; VTAMemDPI(req_valid__Vcvt, req_opcode__Vcvt, req_len__Vcvt, req_addr__Vcvt, wr_valid__Vcvt, wr_value__Vcvt, &rd_valid__Vcvt, &rd_value__Vcvt, rd_ready__Vcvt); rd_valid = (0xffU & rd_valid__Vcvt); rd_value = rd_value__Vcvt; } VL_INLINE_OPT void VTestAccel::_sequent__TOP__1(VTestAccel__Syms* __restrict vlSymsp) { VL_DEBUG_IF(VL_DBG_MSGF("+ VTestAccel::_sequent__TOP__1\n"); ); VTestAccel* __restrict vlTOPp VL_ATTR_UNUSED = vlSymsp->TOPp; // Variables // Begin mtask footprint all: VL_SIG8(__Vtask_TestAccel__DOT__sim_shell__DOT__mod_host__DOT__VTAHostDPI__1__req_valid,7,0); VL_SIG8(__Vtask_TestAccel__DOT__sim_shell__DOT__mod_host__DOT__VTAHostDPI__1__req_opcode,7,0); VL_SIG8(__Vtask_TestAccel__DOT__sim_shell__DOT__mod_host__DOT__VTAHostDPI__1__req_addr,7,0); VL_SIG8(__Vtask_TestAccel__DOT__sim_shell__DOT__mod_mem__DOT__VTAMemDPI__2__rd_valid,7,0); VL_SIG8(__Vdly__TestAccel__DOT__vta_accel__DOT__rf__DOT__state,0,0); VL_SIG(__Vtask_TestAccel__DOT__sim_shell__DOT__mod_host__DOT__VTAHostDPI__1__req_value,31,0); VL_SIGW(__Vtemp2,95,0,3); VL_SIGW(__Vtemp4,319,0,10); VL_SIGW(__Vtemp5,319,0,10); VL_SIGW(__Vtemp7,95,0,3); VL_SIGW(__Vtemp8,95,0,3); VL_SIGW(__Vtemp9,95,0,3); VL_SIGW(__Vtemp11,95,0,3); VL_SIGW(__Vtemp12,127,0,4); VL_SIGW(__Vtemp13,127,0,4); VL_SIGW(__Vtemp14,127,0,4); VL_SIGW(__Vtemp15,95,0,3); VL_SIGW(__Vtemp16,95,0,3); VL_SIGW(__Vtemp17,95,0,3); VL_SIGW(__Vtemp20,95,0,3); VL_SIGW(__Vtemp21,127,0,4); VL_SIGW(__Vtemp22,127,0,4); VL_SIGW(__Vtemp23,127,0,4); VL_SIGW(__Vtemp24,95,0,3); VL_SIGW(__Vtemp25,95,0,3); VL_SIGW(__Vtemp26,95,0,3); VL_SIGW(__Vtemp34,95,0,3); VL_SIGW(__Vtemp36,319,0,10); VL_SIGW(__Vtemp37,319,0,10); VL_SIGW(__Vtemp39,95,0,3); VL_SIGW(__Vtemp40,95,0,3); VL_SIGW(__Vtemp41,95,0,3); VL_SIG64(__Vtask_TestAccel__DOT__sim_shell__DOT__mod_mem__DOT__VTAMemDPI__2__rd_value,63,0); // Body __Vdly__TestAccel__DOT__vta_accel__DOT__rf__DOT__state = vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT__state; // ALWAYS at /Users/benjamintu/Desktop/research/tvm/vta/apps/tsim_example/hardware/chisel/build/chisel/TestAccel.v:593 if (VL_UNLIKELY((((~ vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT__reg_4) & (IData)(vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__overallAccum_io_valid)) & (~ (IData)(vlTOPp->reset))))) { VL_EXTEND_WQ(65,64, __Vtemp2, vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__overallAccum__DOT__reg__024); VL_EXTEND_WQ(319,64, __Vtemp4, vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__sliceAccum__DOT__reg__024); VL_SHIFTL_WWI(319,319,8, __Vtemp5, __Vtemp4, (0xffU & vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT__reg_2)); VL_EXTEND_WQ(65,63, __Vtemp7, (VL_ULL(0x7fffffffffffffff) & (((QData)((IData)( __Vtemp5[1U])) << 0x20U) | (QData)((IData)( __Vtemp5[0U]))))); VL_ADD_W(3, __Vtemp8, __Vtemp2, __Vtemp7); __Vtemp9[0U] = __Vtemp8[0U]; __Vtemp9[1U] = __Vtemp8[1U]; __Vtemp9[2U] = (1U & __Vtemp8[2U]); VL_FWRITEF(0x80000002U,"slice sum: %20# \n", 65,__Vtemp9); } // ALWAYS at /Users/benjamintu/Desktop/research/tvm/vta/apps/tsim_example/hardware/chisel/build/chisel/TestAccel.v:593 if (VL_UNLIKELY((((~ vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT__reg_5) & (5U == (IData)(vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__state))) & (~ (IData)(vlTOPp->reset))))) { VL_EXTEND_WQ(65,64, __Vtemp11, vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__sliceAccum__DOT__reg__024); VL_EXTEND_WQ(128,64, __Vtemp12, vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__reg1); VL_EXTEND_WQ(128,64, __Vtemp13, vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__reg2); VL_MUL_W(4, __Vtemp14, __Vtemp12, __Vtemp13); VL_EXTEND_WQ(65,63, __Vtemp15, (VL_ULL(0x7fffffffffffffff) & (((QData)((IData)( __Vtemp14[1U])) << 0x20U) | (QData)((IData)( __Vtemp14[0U]))))); VL_ADD_W(3, __Vtemp16, __Vtemp11, __Vtemp15); __Vtemp17[0U] = __Vtemp16[0U]; __Vtemp17[1U] = __Vtemp16[1U]; __Vtemp17[2U] = (1U & __Vtemp16[2U]); VL_FWRITEF(0x80000002U,"slice sum: %20# \n", 65,__Vtemp17); } // ALWAYS at /Users/benjamintu/Desktop/research/tvm/vta/apps/tsim_example/hardware/chisel/build/chisel/VTAMemDPI.v:88 if (((IData)(vlTOPp->reset) | (IData)(vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_mem__DOT_____05Freset))) { vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_mem__DOT_____05Frd_valid = 0U; vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_mem__DOT_____05Frd_value = VL_ULL(0); } else { vlTOPp->__Vdpiimwrap_TestAccel__DOT__sim_shell__DOT__mod_mem__DOT__VTAMemDPI_TOP( ((IData)(vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT___T_121) | (5U == (IData)(vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__state))), (5U == (IData)(vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__state)), 0U, ((IData)(vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT___T_121) ? ((1U == (IData)(vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__state)) ? vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__raddr1 : vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__raddr2) : vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__waddr), (IData)(vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__overallAccum__DOT__ready), vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__overallAccum__DOT__reg__024, __Vtask_TestAccel__DOT__sim_shell__DOT__mod_mem__DOT__VTAMemDPI__2__rd_valid, __Vtask_TestAccel__DOT__sim_shell__DOT__mod_mem__DOT__VTAMemDPI__2__rd_value, ((2U == (IData)(vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__state)) | (4U == (IData)(vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__state)))); vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_mem__DOT_____05Frd_valid = __Vtask_TestAccel__DOT__sim_shell__DOT__mod_mem__DOT__VTAMemDPI__2__rd_valid; vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_mem__DOT_____05Frd_value = __Vtask_TestAccel__DOT__sim_shell__DOT__mod_mem__DOT__VTAMemDPI__2__rd_value; } // ALWAYS at /Users/benjamintu/Desktop/research/tvm/vta/apps/tsim_example/hardware/chisel/build/chisel/VTAHostDPI.v:79 if (((IData)(vlTOPp->reset) | (IData)(vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_host__DOT_____05Freset))) { vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_host__DOT_____05Freq_valid = 0U; vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_host__DOT_____05Freq_opcode = 0U; vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_host__DOT_____05Freq_addr = 0U; vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_host__DOT_____05Freq_value = 0U; } else { vlTOPp->__Vdpiimwrap_TestAccel__DOT__sim_shell__DOT__mod_host__DOT__VTAHostDPI_TOP(__Vtask_TestAccel__DOT__sim_shell__DOT__mod_host__DOT__VTAHostDPI__1__req_valid, __Vtask_TestAccel__DOT__sim_shell__DOT__mod_host__DOT__VTAHostDPI__1__req_opcode, __Vtask_TestAccel__DOT__sim_shell__DOT__mod_host__DOT__VTAHostDPI__1__req_addr, __Vtask_TestAccel__DOT__sim_shell__DOT__mod_host__DOT__VTAHostDPI__1__req_value, ((~ (IData)(vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT__state)) & (IData)(vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_host_dpi_req_valid)), (IData)(vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT__state), vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT__rdata); vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_host__DOT_____05Freq_valid = __Vtask_TestAccel__DOT__sim_shell__DOT__mod_host__DOT__VTAHostDPI__1__req_valid; vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_host__DOT_____05Freq_opcode = __Vtask_TestAccel__DOT__sim_shell__DOT__mod_host__DOT__VTAHostDPI__1__req_opcode; vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_host__DOT_____05Freq_addr = __Vtask_TestAccel__DOT__sim_shell__DOT__mod_host__DOT__VTAHostDPI__1__req_addr; vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_host__DOT_____05Freq_value = __Vtask_TestAccel__DOT__sim_shell__DOT__mod_host__DOT__VTAHostDPI__1__req_value; } // ALWAYS at /Users/benjamintu/Desktop/research/tvm/vta/apps/tsim_example/hardware/chisel/build/chisel/TestAccel.v:879 if (VL_UNLIKELY((((2U == (IData)(vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__state)) & (IData)(vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_mem_dpi_rd_valid)) & (~ (IData)(vlTOPp->reset))))) { VL_FWRITEF(0x80000002U,"slice inputs1: %3# \n", 8,(0xffU & (IData)(vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_mem_dpi_rd_bits))); } if (VL_UNLIKELY((((4U == (IData)(vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__state)) & (IData)(vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_mem_dpi_rd_valid)) & (~ (IData)(vlTOPp->reset))))) { VL_FWRITEF(0x80000002U,"slice inputs2: %3#\n\n", 8,(0xffU & (IData)(vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_mem_dpi_rd_bits))); } // ALWAYS at /Users/benjamintu/Desktop/research/tvm/vta/apps/tsim_example/hardware/chisel/build/chisel/VTAHostDPI.v:67 vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_host_dpi_req_opcode = (1U & (IData)(vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_host__DOT_____05Freq_opcode)); // ALWAYS at /Users/benjamintu/Desktop/research/tvm/vta/apps/tsim_example/hardware/chisel/build/chisel/TestAccel.v:363 if (vlTOPp->reset) { __Vdly__TestAccel__DOT__vta_accel__DOT__rf__DOT__state = 0U; } else { if (vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT___T_74) { if (vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT___T_77) { __Vdly__TestAccel__DOT__vta_accel__DOT__rf__DOT__state = 1U; } } else { if (vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT__state) { __Vdly__TestAccel__DOT__vta_accel__DOT__rf__DOT__state = 0U; } } } // ALWAYS at /Users/benjamintu/Desktop/research/tvm/vta/apps/tsim_example/hardware/chisel/build/chisel/TestAccel.v:879 if ((0U == (IData)(vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__state))) { vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__cnt = 0U; } else { if ((6U == (IData)(vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__state))) { vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__cnt = vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT___T_158; } } // ALWAYS at /Users/benjamintu/Desktop/research/tvm/vta/apps/tsim_example/hardware/chisel/build/chisel/TestAccel.v:593 if (vlTOPp->reset) { vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__sliceAccum__DOT__ready = 0U; } else { if ((1U & vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT__reg_5)) { vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__sliceAccum__DOT__ready = 0U; } else { if ((5U == (IData)(vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__state))) { vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__sliceAccum__DOT__ready = 1U; } } } vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT__state = __Vdly__TestAccel__DOT__vta_accel__DOT__rf__DOT__state; // ALWAYS at /Users/benjamintu/Desktop/research/tvm/vta/apps/tsim_example/hardware/chisel/build/chisel/TestAccel.v:593 vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__sliceAccum__DOT__reg__024 = ((IData)(vlTOPp->reset) ? VL_ULL(0) : (((QData)((IData)( vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__sliceAccum__DOT___GEN_2[1U])) << 0x20U) | (QData)((IData)( vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__sliceAccum__DOT___GEN_2[0U])))); // ALWAYS at /Users/benjamintu/Desktop/research/tvm/vta/apps/tsim_example/hardware/chisel/build/chisel/TestAccel.v:879 if (((2U == (IData)(vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__state)) & (IData)(vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_mem_dpi_rd_valid))) { vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__reg1 = (QData)((IData)((0xffU & (IData)(vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_mem_dpi_rd_bits)))); } // ALWAYS at /Users/benjamintu/Desktop/research/tvm/vta/apps/tsim_example/hardware/chisel/build/chisel/TestAccel.v:879 if (((4U == (IData)(vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__state)) & (IData)(vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_mem_dpi_rd_valid))) { vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__reg2 = (QData)((IData)((0xffU & (IData)(vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_mem_dpi_rd_bits)))); } // ALWAYS at /Users/benjamintu/Desktop/research/tvm/vta/apps/tsim_example/hardware/chisel/build/chisel/VTAMemDPI.v:68 vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_mem__DOT_____05Freset = vlTOPp->reset; // ALWAYS at /Users/benjamintu/Desktop/research/tvm/vta/apps/tsim_example/hardware/chisel/build/chisel/TestAccel.v:593 vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__overallAccum__DOT__reg__024 = ((IData)(vlTOPp->reset) ? VL_ULL(0) : (((QData)((IData)( vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__overallAccum__DOT___GEN_2[1U])) << 0x20U) | (QData)((IData)( vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__overallAccum__DOT___GEN_2[0U])))); // ALWAYS at /Users/benjamintu/Desktop/research/tvm/vta/apps/tsim_example/hardware/chisel/build/chisel/TestAccel.v:879 if ((0U == (IData)(vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__state))) { vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__waddr = (((QData)((IData)(vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT__reg_11)) << 0x20U) | (QData)((IData)(vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT__reg_10))); } // ALWAYS at /Users/benjamintu/Desktop/research/tvm/vta/apps/tsim_example/hardware/chisel/build/chisel/TestAccel.v:879 if ((0U == (IData)(vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__state))) { vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__raddr1 = (((QData)((IData)(vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT__reg_7)) << 0x20U) | (QData)((IData)(vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT__reg_6))); } else { if ((6U == (IData)(vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__state))) { vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__raddr1 = vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT___T_115; } } // ALWAYS at /Users/benjamintu/Desktop/research/tvm/vta/apps/tsim_example/hardware/chisel/build/chisel/TestAccel.v:879 if ((0U == (IData)(vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__state))) { vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__raddr2 = (((QData)((IData)(vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT__reg_9)) << 0x20U) | (QData)((IData)(vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT__reg_8))); } else { if ((6U == (IData)(vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__state))) { vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__raddr2 = vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT___T_118; } } // ALWAYS at /Users/benjamintu/Desktop/research/tvm/vta/apps/tsim_example/hardware/chisel/build/chisel/VTAHostDPI.v:61 vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_host__DOT_____05Freset = vlTOPp->reset; // ALWAYS at /Users/benjamintu/Desktop/research/tvm/vta/apps/tsim_example/hardware/chisel/build/chisel/VTAHostDPI.v:67 vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_host_dpi_req_valid = (1U & (IData)(vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_host__DOT_____05Freq_valid)); // ALWAYS at /Users/benjamintu/Desktop/research/tvm/vta/apps/tsim_example/hardware/chisel/build/chisel/TestAccel.v:363 if (vlTOPp->reset) { vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT__rdata = 0U; } else { if (vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT___T_235) { vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT__rdata = ((0U == (IData)(vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_host_dpi_req_addr)) ? vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT__reg_0 : ((4U == (IData)(vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_host_dpi_req_addr)) ? vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT__reg_1 : ((8U == (IData)(vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_host_dpi_req_addr)) ? vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT__reg_2 : ((0xcU == (IData)(vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_host_dpi_req_addr)) ? vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT__reg_3 : ((0x10U == (IData)(vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_host_dpi_req_addr)) ? vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT__reg_4 : ((0x14U == (IData)(vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_host_dpi_req_addr)) ? vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT__reg_5 : ((0x18U == (IData)(vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_host_dpi_req_addr)) ? vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT__reg_6 : ((0x1cU == (IData)(vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_host_dpi_req_addr)) ? vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT__reg_7 : ( (0x20U == (IData)(vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_host_dpi_req_addr)) ? vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT__reg_8 : ((0x24U == (IData)(vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_host_dpi_req_addr)) ? vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT__reg_9 : ((0x28U == (IData)(vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_host_dpi_req_addr)) ? vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT__reg_10 : ((0x2cU == (IData)(vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_host_dpi_req_addr)) ? vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT__reg_11 : 0U)))))))))))); } } vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT___T_74 = (1U & (~ (IData)(vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT__state))); vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT___T_158 = ((IData)(1U) + vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__cnt); // ALWAYS at /Users/benjamintu/Desktop/research/tvm/vta/apps/tsim_example/hardware/chisel/build/chisel/VTAMemDPI.v:74 vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_mem_dpi_rd_bits = vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_mem__DOT_____05Frd_value; vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT___T_115 = (VL_ULL(1) + vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__raddr1); vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT___T_118 = (VL_ULL(1) + vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__raddr2); vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT___T_77 = ((IData)(vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_host_dpi_req_valid) & (~ (IData)(vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_host_dpi_req_opcode))); vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT___T_80 = ((~ (IData)(vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT__state)) & (IData)(vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_host_dpi_req_valid)); // ALWAYS at /Users/benjamintu/Desktop/research/tvm/vta/apps/tsim_example/hardware/chisel/build/chisel/TestAccel.v:363 if (vlTOPp->reset) { vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT__reg_6 = 0U; } else { if (vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT___T_195) { vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT__reg_6 = vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_host_dpi_req_value; } } // ALWAYS at /Users/benjamintu/Desktop/research/tvm/vta/apps/tsim_example/hardware/chisel/build/chisel/TestAccel.v:363 if (vlTOPp->reset) { vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT__reg_7 = 0U; } else { if (vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT___T_201) { vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT__reg_7 = vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_host_dpi_req_value; } } // ALWAYS at /Users/benjamintu/Desktop/research/tvm/vta/apps/tsim_example/hardware/chisel/build/chisel/TestAccel.v:363 if (vlTOPp->reset) { vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT__reg_8 = 0U; } else { if (vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT___T_207) { vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT__reg_8 = vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_host_dpi_req_value; } } // ALWAYS at /Users/benjamintu/Desktop/research/tvm/vta/apps/tsim_example/hardware/chisel/build/chisel/TestAccel.v:363 if (vlTOPp->reset) { vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT__reg_9 = 0U; } else { if (vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT___T_213) { vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT__reg_9 = vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_host_dpi_req_value; } } // ALWAYS at /Users/benjamintu/Desktop/research/tvm/vta/apps/tsim_example/hardware/chisel/build/chisel/TestAccel.v:363 if (vlTOPp->reset) { vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT__reg_10 = 0U; } else { if (vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT___T_219) { vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT__reg_10 = vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_host_dpi_req_value; } } // ALWAYS at /Users/benjamintu/Desktop/research/tvm/vta/apps/tsim_example/hardware/chisel/build/chisel/TestAccel.v:363 if (vlTOPp->reset) { vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT__reg_11 = 0U; } else { if (vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT___T_225) { vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT__reg_11 = vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_host_dpi_req_value; } } // ALWAYS at /Users/benjamintu/Desktop/research/tvm/vta/apps/tsim_example/hardware/chisel/build/chisel/TestAccel.v:363 if (vlTOPp->reset) { vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT__reg_2 = 0U; } else { if (vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT___T_171) { vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT__reg_2 = vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_host_dpi_req_value; } } // ALWAYS at /Users/benjamintu/Desktop/research/tvm/vta/apps/tsim_example/hardware/chisel/build/chisel/TestAccel.v:363 if (vlTOPp->reset) { vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT__reg_5 = 0U; } else { if (vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT___T_189) { vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT__reg_5 = vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_host_dpi_req_value; } } // ALWAYS at /Users/benjamintu/Desktop/research/tvm/vta/apps/tsim_example/hardware/chisel/build/chisel/VTAHostDPI.v:67 vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_host_dpi_req_addr = vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_host__DOT_____05Freq_addr; // ALWAYS at /Users/benjamintu/Desktop/research/tvm/vta/apps/tsim_example/hardware/chisel/build/chisel/TestAccel.v:363 if (vlTOPp->reset) { vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT__reg_3 = 0U; } else { if (vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT___T_177) { vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT__reg_3 = vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_host_dpi_req_value; } } // ALWAYS at /Users/benjamintu/Desktop/research/tvm/vta/apps/tsim_example/hardware/chisel/build/chisel/TestAccel.v:363 if (vlTOPp->reset) { vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT__reg_1 = 0U; } else { if (vlTOPp->TestAccel__DOT__vta_accel__DOT__ce_io_ecnt_0_valid) { vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT__reg_1 = vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__cycles; } else { if (vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT___T_165) { vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT__reg_1 = vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_host_dpi_req_value; } } } vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT___T_235 = ((IData)(vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT___T_80) & (~ (IData)(vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_host_dpi_req_opcode))); vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT___T_156 = ((IData)(vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT___T_80) & (IData)(vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_host_dpi_req_opcode)); vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT___T_165 = ((IData)(vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT___T_156) & (4U == (IData)(vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_host_dpi_req_addr))); vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT___T_171 = ((IData)(vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT___T_156) & (8U == (IData)(vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_host_dpi_req_addr))); vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT___T_177 = ((IData)(vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT___T_156) & (0xcU == (IData)(vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_host_dpi_req_addr))); vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT___T_189 = ((IData)(vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT___T_156) & (0x14U == (IData)(vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_host_dpi_req_addr))); vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT___T_195 = ((IData)(vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT___T_156) & (0x18U == (IData)(vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_host_dpi_req_addr))); vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT___T_201 = ((IData)(vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT___T_156) & (0x1cU == (IData)(vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_host_dpi_req_addr))); vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT___T_207 = ((IData)(vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT___T_156) & (0x20U == (IData)(vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_host_dpi_req_addr))); vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT___T_213 = ((IData)(vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT___T_156) & (0x24U == (IData)(vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_host_dpi_req_addr))); vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT___T_219 = ((IData)(vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT___T_156) & (0x28U == (IData)(vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_host_dpi_req_addr))); vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT___T_225 = ((IData)(vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT___T_156) & (0x2cU == (IData)(vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_host_dpi_req_addr))); // ALWAYS at /Users/benjamintu/Desktop/research/tvm/vta/apps/tsim_example/hardware/chisel/build/chisel/TestAccel.v:879 vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__cycles = ((IData)(vlTOPp->reset) ? 0U : ((0U == (IData)(vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__state)) ? 0U : vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT___T_110)); vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT___T_110 = ((IData)(1U) + vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__cycles); // ALWAYS at /Users/benjamintu/Desktop/research/tvm/vta/apps/tsim_example/hardware/chisel/build/chisel/TestAccel.v:879 if (vlTOPp->reset) { vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__state = 0U; } else { if (vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT___T_88) { if ((1U & vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT__reg_0)) { vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__state = 1U; } } else { if (vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT___T_89) { vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__state = 2U; } else { if (vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT___T_90) { if (vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_mem_dpi_rd_valid) { vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__state = 3U; } } else { if (vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT___T_91) { vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__state = 4U; } else { if (vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT___T_92) { if (vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_mem_dpi_rd_valid) { vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__state = 5U; } } else { if (vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT___T_93) { vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__state = 6U; } else { if (vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT___T_94) { vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__state = ((IData)(vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT___T_99) ? 0U : 1U); } } } } } } } } vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT___T_99 = (vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__cnt == (vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT__reg_3 - (IData)(1U))); // ALWAYS at /Users/benjamintu/Desktop/research/tvm/vta/apps/tsim_example/hardware/chisel/build/chisel/VTAMemDPI.v:74 vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_mem_dpi_rd_valid = (1U & (IData)(vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_mem__DOT_____05Frd_valid)); vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT___T_88 = (0U == (IData)(vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__state)); vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT___T_89 = (1U == (IData)(vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__state)); vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT___T_90 = (2U == (IData)(vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__state)); vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT___T_91 = (3U == (IData)(vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__state)); vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT___T_92 = (4U == (IData)(vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__state)); vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT___T_93 = (5U == (IData)(vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__state)); vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT___T_94 = (6U == (IData)(vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__state)); vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT___T_121 = ((1U == (IData)(vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__state)) | (3U == (IData)(vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__state))); VL_EXTEND_WQ(65,64, __Vtemp20, vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__sliceAccum__DOT__reg__024); VL_EXTEND_WQ(128,64, __Vtemp21, vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__reg1); VL_EXTEND_WQ(128,64, __Vtemp22, vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__reg2); VL_MUL_W(4, __Vtemp23, __Vtemp21, __Vtemp22); VL_EXTEND_WQ(65,63, __Vtemp24, (VL_ULL(0x7fffffffffffffff) & (((QData)((IData)( __Vtemp23[1U])) << 0x20U) | (QData)((IData)( __Vtemp23[0U]))))); VL_ADD_W(3, __Vtemp25, __Vtemp20, __Vtemp24); VL_EXTEND_WQ(65,64, __Vtemp26, vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__sliceAccum__DOT__reg__024); vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__sliceAccum__DOT___GEN_2[0U] = ((1U & vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT__reg_5) ? 0U : ((5U == (IData)(vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__state)) ? __Vtemp25[0U] : __Vtemp26[0U])); vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__sliceAccum__DOT___GEN_2[1U] = ((1U & vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT__reg_5) ? 0U : ((5U == (IData)(vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__state)) ? __Vtemp25[1U] : __Vtemp26[1U])); vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__sliceAccum__DOT___GEN_2[2U] = (1U & ((1U & vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT__reg_5) ? 0U : ((5U == (IData)(vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__state)) ? __Vtemp25[2U] : __Vtemp26[2U]))); vlTOPp->TestAccel__DOT__vta_accel__DOT__ce_io_ecnt_0_valid = ((6U == (IData)(vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__state)) & (IData)(vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT___T_99)); // ALWAYS at /Users/benjamintu/Desktop/research/tvm/vta/apps/tsim_example/hardware/chisel/build/chisel/TestAccel.v:363 if (vlTOPp->reset) { vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT__reg_0 = 0U; } else { if (vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__ready) { vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT__reg_0 = 2U; } else { if (vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT___T_159) { vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT__reg_0 = vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_host_dpi_req_value; } } } vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT___T_159 = ((IData)(vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT___T_156) & (0U == (IData)(vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_host_dpi_req_addr))); // ALWAYS at /Users/benjamintu/Desktop/research/tvm/vta/apps/tsim_example/hardware/chisel/build/chisel/TestAccel.v:879 vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__ready = vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__overallAccum__DOT__ready; // ALWAYS at /Users/benjamintu/Desktop/research/tvm/vta/apps/tsim_example/hardware/chisel/build/chisel/TestAccel.v:593 if (vlTOPp->reset) { vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__overallAccum__DOT__ready = 0U; } else { if ((1U & vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT__reg_4)) { vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__overallAccum__DOT__ready = 0U; } else { if (vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__overallAccum_io_valid) { vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__overallAccum__DOT__ready = 1U; } } } vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__overallAccum_io_valid = ((6U == (IData)(vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__state)) & (IData)(vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT___T_99)); // ALWAYS at /Users/benjamintu/Desktop/research/tvm/vta/apps/tsim_example/hardware/chisel/build/chisel/TestAccel.v:363 if (vlTOPp->reset) { vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT__reg_4 = 0U; } else { if (vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT___T_183) { vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT__reg_4 = vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_host_dpi_req_value; } } vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT___T_183 = ((IData)(vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT___T_156) & (0x10U == (IData)(vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_host_dpi_req_addr))); VL_EXTEND_WQ(65,64, __Vtemp34, vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__overallAccum__DOT__reg__024); VL_EXTEND_WQ(319,64, __Vtemp36, vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__sliceAccum__DOT__reg__024); VL_SHIFTL_WWI(319,319,8, __Vtemp37, __Vtemp36, (0xffU & vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT__reg_2)); VL_EXTEND_WQ(65,63, __Vtemp39, (VL_ULL(0x7fffffffffffffff) & (((QData)((IData)( __Vtemp37[1U])) << 0x20U) | (QData)((IData)( __Vtemp37[0U]))))); VL_ADD_W(3, __Vtemp40, __Vtemp34, __Vtemp39); VL_EXTEND_WQ(65,64, __Vtemp41, vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__overallAccum__DOT__reg__024); vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__overallAccum__DOT___GEN_2[0U] = ((1U & vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT__reg_4) ? 0U : ((IData)(vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__overallAccum_io_valid) ? __Vtemp40[0U] : __Vtemp41[0U])); vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__overallAccum__DOT___GEN_2[1U] = ((1U & vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT__reg_4) ? 0U : ((IData)(vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__overallAccum_io_valid) ? __Vtemp40[1U] : __Vtemp41[1U])); vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__overallAccum__DOT___GEN_2[2U] = (1U & ((1U & vlTOPp->TestAccel__DOT__vta_accel__DOT__rf__DOT__reg_4) ? 0U : ((IData)(vlTOPp->TestAccel__DOT__vta_accel__DOT__ce__DOT__overallAccum_io_valid) ? __Vtemp40[2U] : __Vtemp41[2U]))); // ALWAYS at /Users/benjamintu/Desktop/research/tvm/vta/apps/tsim_example/hardware/chisel/build/chisel/VTAHostDPI.v:67 vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_host_dpi_req_value = vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_host__DOT_____05Freq_value; } VL_INLINE_OPT void VTestAccel::_sequent__TOP__2(VTestAccel__Syms* __restrict vlSymsp) { VL_DEBUG_IF(VL_DBG_MSGF("+ VTestAccel::_sequent__TOP__2\n"); ); VTestAccel* __restrict vlTOPp VL_ATTR_UNUSED = vlSymsp->TOPp; // Variables // Begin mtask footprint all: VL_SIG8(__Vtask_TestAccel__DOT__sim_shell__DOT__mod_sim__DOT__VTASimDPI__0__sim_wait,7,0); VL_SIG8(__Vtask_TestAccel__DOT__sim_shell__DOT__mod_sim__DOT__VTASimDPI__0__sim_exit,7,0); // Body // ALWAYS at /Users/benjamintu/Desktop/research/tvm/vta/apps/tsim_example/hardware/chisel/build/chisel/VTASimDPI.v:72 if (VL_UNLIKELY((1U == (IData)(vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_sim__DOT_____05Fexit)))) { VL_FINISH_MT("/Users/benjamintu/Desktop/research/tvm/vta/apps/tsim_example/hardware/chisel/build/chisel/VTASimDPI.v",74,""); } // ALWAYS at /Users/benjamintu/Desktop/research/tvm/vta/apps/tsim_example/hardware/chisel/build/chisel/VTASimDPI.v:46 if (((IData)(vlTOPp->reset) | (IData)(vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_sim__DOT_____05Freset))) { vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_sim__DOT_____05Fwait = 0U; vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_sim__DOT_____05Fexit = 0U; } else { vlTOPp->__Vdpiimwrap_TestAccel__DOT__sim_shell__DOT__mod_sim__DOT__VTASimDPI_TOP(__Vtask_TestAccel__DOT__sim_shell__DOT__mod_sim__DOT__VTASimDPI__0__sim_wait, __Vtask_TestAccel__DOT__sim_shell__DOT__mod_sim__DOT__VTASimDPI__0__sim_exit); vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_sim__DOT_____05Fwait = __Vtask_TestAccel__DOT__sim_shell__DOT__mod_sim__DOT__VTASimDPI__0__sim_wait; vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_sim__DOT_____05Fexit = __Vtask_TestAccel__DOT__sim_shell__DOT__mod_sim__DOT__VTASimDPI__0__sim_exit; } // ALWAYS at /Users/benjamintu/Desktop/research/tvm/vta/apps/tsim_example/hardware/chisel/build/chisel/VTASimDPI.v:60 vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_sim__DOT__wait_reg = ((~ ((IData)(vlTOPp->reset) | (IData)(vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_sim__DOT_____05Freset))) & (1U == (IData)(vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_sim__DOT_____05Fwait))); vlTOPp->sim_wait = vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_sim__DOT__wait_reg; // ALWAYS at /Users/benjamintu/Desktop/research/tvm/vta/apps/tsim_example/hardware/chisel/build/chisel/VTASimDPI.v:41 vlTOPp->TestAccel__DOT__sim_shell__DOT__mod_sim__DOT_____05Freset = vlTOPp->reset; } void VTestAccel::_eval(VTestAccel__Syms* __restrict vlSymsp) { VL_DEBUG_IF(VL_DBG_MSGF("+ VTestAccel::_eval\n"); ); VTestAccel* __restrict vlTOPp VL_ATTR_UNUSED = vlSymsp->TOPp; // Body if (((IData)(vlTOPp->clock) & (~ (IData)(vlTOPp->__Vclklast__TOP__clock)))) { vlTOPp->_sequent__TOP__1(vlSymsp); vlTOPp->__Vm_traceActivity = (2U | vlTOPp->__Vm_traceActivity); } if (((IData)(vlTOPp->sim_clock) & (~ (IData)(vlTOPp->__Vclklast__TOP__sim_clock)))) { vlTOPp->_sequent__TOP__2(vlSymsp); vlTOPp->__Vm_traceActivity = (4U | vlTOPp->__Vm_traceActivity); } // Final vlTOPp->__Vclklast__TOP__clock = vlTOPp->clock; vlTOPp->__Vclklast__TOP__sim_clock = vlTOPp->sim_clock; } VL_INLINE_OPT QData VTestAccel::_change_request(VTestAccel__Syms* __restrict vlSymsp) { VL_DEBUG_IF(VL_DBG_MSGF("+ VTestAccel::_change_request\n"); ); VTestAccel* __restrict vlTOPp VL_ATTR_UNUSED = vlSymsp->TOPp; // Body return (vlTOPp->_change_request_1(vlSymsp)); } VL_INLINE_OPT QData VTestAccel::_change_request_1(VTestAccel__Syms* __restrict vlSymsp) { VL_DEBUG_IF(VL_DBG_MSGF("+ VTestAccel::_change_request_1\n"); ); VTestAccel* __restrict vlTOPp VL_ATTR_UNUSED = vlSymsp->TOPp; // Body // Change detection QData __req = false; // Logically a bool return __req; } #ifdef VL_DEBUG void VTestAccel::_eval_debug_assertions() { VL_DEBUG_IF(VL_DBG_MSGF("+ VTestAccel::_eval_debug_assertions\n"); ); // Body if (VL_UNLIKELY((clock & 0xfeU))) { Verilated::overWidthError("clock");} if (VL_UNLIKELY((reset & 0xfeU))) { Verilated::overWidthError("reset");} if (VL_UNLIKELY((sim_clock & 0xfeU))) { Verilated::overWidthError("sim_clock");} } #endif // VL_DEBUG
55.70197
408
0.775525
BenjaminTu
d62bc6167214d511203aec3feca9318565bff4ae
972
cpp
C++
State.cpp
nathiss/ticTacToe
e51866b66dda3fe92e82450a7732ad175eb1c96c
[ "MIT" ]
null
null
null
State.cpp
nathiss/ticTacToe
e51866b66dda3fe92e82450a7732ad175eb1c96c
[ "MIT" ]
null
null
null
State.cpp
nathiss/ticTacToe
e51866b66dda3fe92e82450a7732ad175eb1c96c
[ "MIT" ]
null
null
null
#include "State.hpp" State::Type State::type = State::MENU; State::State() { } State::~State() { } void State::clear(sf::Color color) { window->clear(color); } void State::display() { window->display(); } void State::run() { pollEvent(); update(); clear(bag->get<sf::Color>("color.bg")); draw(); display(); } void State::setType(State::Type t) { type = t; } State::Type State::getType() { return type; } bool State::mouseOver(const sf::Text& button) const { const sf::Vector2i& mouse = sf::Mouse::getPosition(*window); const sf::Vector2f& position = button.getPosition(); const sf::FloatRect& bounds = button.getGlobalBounds(); if(mouse.x >= position.x && mouse.x <= position.x + bounds.width && mouse.y >= position.y && mouse.y <= position.y + bounds.height) return true; return false; } float State::centerHorizontally(sf::FloatRect bounds) const { return (window->getSize().x - bounds.width) / 2.f; }
17.357143
69
0.631687
nathiss
d63017b15ecaa6d29a1338a6d85bc3750a226912
1,812
hpp
C++
interpreter/IDuckPro_AST/src/interpreter/Token.hpp
PS-Group/compiler-theory-samples
c916af50eb42020024257ecd17f9be1580db7bf0
[ "MIT" ]
null
null
null
interpreter/IDuckPro_AST/src/interpreter/Token.hpp
PS-Group/compiler-theory-samples
c916af50eb42020024257ecd17f9be1580db7bf0
[ "MIT" ]
null
null
null
interpreter/IDuckPro_AST/src/interpreter/Token.hpp
PS-Group/compiler-theory-samples
c916af50eb42020024257ecd17f9be1580db7bf0
[ "MIT" ]
null
null
null
#pragma once #include <string> struct TokenPos { size_t line; size_t column; TokenPos() :line(0), column(0) { } TokenPos(size_t vLine, size_t vColumn) :line(vLine), column(vColumn) { } }; class Token { public: enum Type { Type_EOF, Type_LBRACKET, Type_RBRACKET, Type_SEMICOLON, Type_IDENTIFIER, Type_ILLEGAL }; Token() :_type(Type_EOF) { } explicit Token(Type type, const TokenPos &start, const TokenPos &end) :_type(type) ,_start(start) ,_end(end) { } explicit Token(Type type, const size_t &sline, const size_t &scolumn, const size_t &eline, const size_t &ecolumn) :_type(type) ,_start(sline, scolumn) ,_end(eline, ecolumn) { } std::string classify() const { switch (_type) { case Type_EOF: return "end of line"; case Type_LBRACKET: return "left bracket"; case Type_RBRACKET: return "right bracket"; case Type_SEMICOLON: return "semicolon"; case Type_IDENTIFIER: return "identifier"; default: return "illegal"; } } Type getType() const { return _type; } void setValue(std::string const& value) { _value = value; } const std::string &getValue() const { return _value; } const TokenPos &getStartPos() const { return _start; } const TokenPos &getEndPos() const { return _end; } private: Type _type; std::string _value; TokenPos _start; TokenPos _end; };
17.09434
62
0.509934
PS-Group
d630bdf3a014147a45ffdf8137e1ee9f87d00937
441
cpp
C++
Mini lista para Iniciantes/aula01-Ex01.cpp
Suricat0Br/Programacao-em-C
a04b5b8e3dbbf82fcec4888d7bdf888bdc53d715
[ "Apache-2.0" ]
null
null
null
Mini lista para Iniciantes/aula01-Ex01.cpp
Suricat0Br/Programacao-em-C
a04b5b8e3dbbf82fcec4888d7bdf888bdc53d715
[ "Apache-2.0" ]
null
null
null
Mini lista para Iniciantes/aula01-Ex01.cpp
Suricat0Br/Programacao-em-C
a04b5b8e3dbbf82fcec4888d7bdf888bdc53d715
[ "Apache-2.0" ]
null
null
null
#include <stdlib.h> #include <iostream> #include<stdio.h> //Faça um Programa que peça as 4 notas bimestrais e mostre a média. int main() { int i; float nota, media; printf("Ola, Bem vindo(a) ao software de cadastro de notas!\n\n"); for(i = 0; i<4; i++){ printf("Insira sua %d nota:\n",(i+1)); scanf("%f",&nota); media = media + nota; } system("cls"); printf("Media do aluno = %.1f\n",(media/i)); }
23.210526
70
0.582766
Suricat0Br
d63744912ee0b717d77967f1755ba91f73670b46
13,220
cpp
C++
VGP334/02_HelloModel/GameState.cpp
CyroPCJr/OmegaEngine
65fbd6cff54266a9c934e3a875a4493d26758661
[ "MIT" ]
1
2021-04-23T19:18:12.000Z
2021-04-23T19:18:12.000Z
VGP334/02_HelloModel/GameState.cpp
CyroPCJr/OmegaEngine
65fbd6cff54266a9c934e3a875a4493d26758661
[ "MIT" ]
null
null
null
VGP334/02_HelloModel/GameState.cpp
CyroPCJr/OmegaEngine
65fbd6cff54266a9c934e3a875a4493d26758661
[ "MIT" ]
1
2021-06-15T10:42:08.000Z
2021-06-15T10:42:08.000Z
#include "GameState.h" #include "GameState.h" #include <ImGui/Inc/imgui.h> using namespace Omega::Graphics; using namespace Omega::Input; using namespace Omega::Math; namespace { void SimpleDrawCamera(const Camera& camera) { auto defaultMatView = camera.GetViewMatrix(); Vector3 cameraPosition = camera.GetPosition(); Vector3 cameraRight = { defaultMatView._11, defaultMatView._21, defaultMatView._31 }; Vector3 cameraUp = { defaultMatView._12, defaultMatView._22, defaultMatView._32 }; Vector3 cameraLook = { defaultMatView._13, defaultMatView._23, defaultMatView._33 }; //SimpleDraw::AddSphere(cameraPosition, 0.1f, Colors::White, 6, 8); SimpleDraw::AddLine(cameraPosition, cameraPosition + cameraRight, Colors::Red); SimpleDraw::AddLine(cameraPosition, cameraPosition + cameraUp, Colors::Green); SimpleDraw::AddLine(cameraPosition, cameraPosition + cameraLook, Colors::Blue); } } void GameState::Initialize() { GraphicsSystem::Get()->SetClearColor(Colors::Black); mDefaultCamera.SetNearPlane(0.1f); mDefaultCamera.SetFarPlane(300.0f); mDefaultCamera.SetPosition({ 0.0f, 130.0f, -150.0f }); mDefaultCamera.SetLookAt({ 0.0f, 100.0f, 0.0f }); mDebugCamera.SetNearPlane(0.001f); mDebugCamera.SetFarPlane(10000.0f); mDebugCamera.SetPosition({ 0.0f, 10.0f, -30.0f }); mDebugCamera.SetLookAt({ 0.0f, 0.0f, 0.0f }); mLightCamera.SetDirection(Normalize({ 1.0f, -1.0f, 1.0f })); mLightCamera.SetNearPlane(1.0f); mLightCamera.SetFarPlane(200.0f); mLightCamera.SetFov(1.0f); mLightCamera.SetAspectRatio(1.0f); mActiveCamera = &mDefaultCamera; mTransformBuffer.Initialize(); mLightBuffer.Initialize(); mMaterialBuffer.Initialize(); mSettingsBuffer.Initialize(); mPostProcessingSettingsBuffer.Initialize(); mDirectionalLight.direction = Normalize({ 1.0f, -1.0f, 1.0f }); mDirectionalLight.ambient = { 0.8f, 0.8f, 0.8f, 1.0f }; mDirectionalLight.diffuse = { 0.75f, 0.75f, 0.75f, 1.0f }; mDirectionalLight.specular = { 0.5f, 0.5f, 0.5f, 1.0f }; mMaterial.ambient = { 0.8f, 0.8f, 0.8f, 1.0f }; mMaterial.diffuse = { 0.8f, 0.8f, 0.8f, 1.0f }; mMaterial.specular = { 0.5f, 0.5f, 0.5f, 1.0f }; mMaterial.power = 40.0f; mSettings.specularMapWeight = 1.0f; mSettings.bumpMapWeight = 0.0f; mSettings.normalMapWeight = 0.0f; mSettings.aoMapWeight = 1.0f; mSettings.brightness = 3.5f; mSettings.useShadow = 1; mSettings.depthBias = 0.0003f; mVertexShader.Initialize("../../Assets/Shaders/Standard.fx", BoneVertex::Format); mPixelShader.Initialize("../../Assets/Shaders/Standard.fx"); mSampler.Initialize(Sampler::Filter::Anisotropic, Sampler::AddressMode::Wrap); auto graphicsSystem = GraphicsSystem::Get(); constexpr uint32_t depthMapSize = 4096; mDepthMapRenderTarget.Initialize(depthMapSize, depthMapSize, RenderTarget::Format::RGBA_U32); mDepthMapVertexShader.Initialize("../../Assets/Shaders/DepthMap.fx", Vertex::Format); mDepthMapPixelShader.Initialize("../../Assets/Shaders/DepthMap.fx"); mDepthMapConstantBuffer.Initialize(); mShadowConstantBuffer.Initialize(); mRenderTarget.Initialize( graphicsSystem->GetBackBufferWidth(), graphicsSystem->GetBackBufferHeight(), RenderTarget::Format::RGBA_U8); mAnimation = AnimationBuilder() .SetTime(0.0f) .AddPositionKey(Vector3(0.0f, 1.0f, 0.0f)) .AddRotationKey(Quaternion::Identity) .AddScaleKey(Vector3(1.0f, 1.0f, 1.0f)) .SetTime(5.0f) .AddPositionKey(Vector3(0.0f, 1.0f, 0.0f)) //.AddRotationKey(Quaternion::RotationAxis(Vector3(0.0f, 1.0f, 0.0f), 90.0f)) .GetAnimation(); // Initialize and load model from assimp //mModel.Initialize("../../Assets/Models/mutant.model"); mModel.Initialize("../../Assets/Models/Breaking_Dance/Breakdance.model"); mBoneMatrices.resize(mModel.skeleton.bones.size()); // calcualte the bone matrices UpdateBindPose(mModel.skeleton.root, mBoneMatrices, false); // Final transformation matrix for (size_t i = 0; i < mBoneMatrices.size(); ++i) { boneTransformData.boneTransforms[i] = Transpose(mModel.skeleton.bones[i]->offsetTransform * mBoneMatrices[i]); } mBoneTransformBuffer.Initialize(); } void GameState::Terminate() { mBoneTransformBuffer.Terminate(); mModel.Terminate(); mRenderTarget.Terminate(); mShadowConstantBuffer.Terminate(); mDepthMapConstantBuffer.Terminate(); mDepthMapPixelShader.Terminate(); mDepthMapVertexShader.Terminate(); mDepthMapRenderTarget.Terminate(); mAOMap.Terminate(); mNormalMap.Terminate(); mDisplacementMap.Terminate(); mSpecularMap.Terminate(); mDiffuseMap.Terminate(); mSampler.Terminate(); mPixelShader.Terminate(); mVertexShader.Terminate(); mSettingsBuffer.Terminate(); mMaterialBuffer.Terminate(); mLightBuffer.Terminate(); mTransformBuffer.Terminate(); } void GameState::Update(float deltaTime) { auto inputSystem = InputSystem::Get(); const float kMoveSpeed = inputSystem->IsKeyDown(KeyCode::LSHIFT) ? 100.0f : 10.0f; const float kTurnSpeed = 1.0f; if (inputSystem->IsKeyDown(KeyCode::W)) { mDefaultCamera.Walk(kMoveSpeed * deltaTime); mLightCamera.Walk(kMoveSpeed * deltaTime); //mTankPosition.z += kMoveSpeed * deltaTime; } if (inputSystem->IsKeyDown(KeyCode::S)) { mActiveCamera->Walk(-kMoveSpeed * deltaTime); } if (inputSystem->IsKeyDown(KeyCode::D)) { mActiveCamera->Strafe(kMoveSpeed * deltaTime); } if (inputSystem->IsKeyDown(KeyCode::A)) { mActiveCamera->Strafe(-kMoveSpeed * deltaTime); } if (inputSystem->IsMouseDown(MouseButton::RBUTTON)) { mActiveCamera->Yaw(inputSystem->GetMouseMoveX() * kTurnSpeed * deltaTime); mActiveCamera->Pitch(inputSystem->GetMouseMoveY() * kTurnSpeed * deltaTime); } mAnimationTime += deltaTime; mLightCamera.SetDirection(mDirectionalLight.direction); mViewFrustumVertices = { // Near plane { -1.0f, -1.0f, 0.0f }, { -1.0f, 1.0f, 0.0f }, { 1.0f, 1.0f, 0.0f }, { 1.0f, -1.0f, 0.0f }, // Far plane { -1.0f, -1.0f, 1.0f }, { -1.0f, 1.0f, 1.0f }, { 1.0f, 1.0f, 1.0f }, { 1.0f, -1.0f, 1.0f }, }; auto defaultMatView = mDefaultCamera.GetViewMatrix(); auto defaultMatProj = mDefaultCamera.GetPerspectiveMatrix(); auto invViewProj = Inverse(defaultMatView * defaultMatProj); for (auto& vertex : mViewFrustumVertices) { vertex = TransformCoord(vertex, invViewProj); } const auto& lightLook = mLightCamera.GetDirection(); auto lightSide = Normalize(Cross(Vector3::YAxis, lightLook)); auto lightUp = Normalize(Cross(lightLook, lightSide)); float minX = FLT_MAX, maxX = -FLT_MAX; float minY = FLT_MAX, maxY = -FLT_MAX; float minZ = FLT_MAX, maxZ = -FLT_MAX; for (auto& vertex : mViewFrustumVertices) { float projectX = Dot(lightSide, vertex); minX = Min(minX, projectX); maxX = Max(maxX, projectX); float projectY = Dot(lightUp, vertex); minY = Min(minY, projectY); maxY = Max(maxY, projectY); float projectZ = Dot(lightLook, vertex); minZ = Min(minZ, projectZ); maxZ = Max(maxZ, projectZ); } mLightCamera.SetPosition( lightSide + (minX + maxX) * 0.5f + lightUp + (minY + maxY) * 0.5f + lightLook + (minZ + maxZ) * 0.5f ); mLightCamera.SetNearPlane(minZ - 300.0f); mLightCamera.SetFarPlane(maxZ); mLightProjectMatrix = mLightCamera.GetOrthoGraphiMatrix(maxX - minX, maxY - minY); auto v0 = lightSide * minX + lightUp * minY + lightLook * minZ; auto v1 = lightSide * minX + lightUp * maxY + lightLook * minZ; auto v2 = lightSide * maxX + lightUp * maxY + lightLook * minZ; auto v3 = lightSide * maxX + lightUp * minY + lightLook * minZ; auto v4 = lightSide * minX + lightUp * minY + lightLook * maxZ; auto v5 = lightSide * minX + lightUp * maxY + lightLook * maxZ; auto v6 = lightSide * maxX + lightUp * maxY + lightLook * maxZ; auto v7 = lightSide * maxX + lightUp * minY + lightLook * maxZ; SimpleDraw::AddLine(v0, v1, Colors::Yellow); SimpleDraw::AddLine(v1, v2, Colors::Yellow); SimpleDraw::AddLine(v2, v3, Colors::Yellow); SimpleDraw::AddLine(v3, v0, Colors::Yellow); SimpleDraw::AddLine(v0, v4, Colors::Red); SimpleDraw::AddLine(v1, v5, Colors::Red); SimpleDraw::AddLine(v2, v6, Colors::Red); SimpleDraw::AddLine(v3, v7, Colors::Red); SimpleDraw::AddLine(v4, v5, Colors::Red); SimpleDraw::AddLine(v5, v6, Colors::Red); SimpleDraw::AddLine(v6, v7, Colors::Red); SimpleDraw::AddLine(v7, v4, Colors::Red); SimpleDrawCamera(mLightCamera); } void GameState::Render() { mDepthMapRenderTarget.BeginRender(); DrawDepthMap(); mDepthMapRenderTarget.EndRender(); mRenderTarget.BindPS(0); DrawScene(); mRenderTarget.UnBindPS(0); } void GameState::DebugUI() { ImGui::Begin("Settings", nullptr, ImGuiWindowFlags_AlwaysAutoResize); if (ImGui::CollapsingHeader("Camera", ImGuiTreeNodeFlags_DefaultOpen)) { bool lightCamera = mActiveCamera == &mLightCamera; if (ImGui::Checkbox("Use Light Camera", &lightCamera)) { mActiveCamera = lightCamera ? &mLightCamera : &mDefaultCamera; } bool debugCamera = mActiveCamera == &mDebugCamera; if (ImGui::Checkbox("Use Debug Camera", &debugCamera)) { mActiveCamera = debugCamera ? &mDebugCamera : &mDefaultCamera; } ImGui::Image( mDepthMapRenderTarget.GetShaderResourceView(), { 150.0f, 150.0f }, { 0.0f, 0.0f }, { 1.0f, 1.0f }, { 1.0f, 1.0f, 1.0f, 1.0f }, { 1.0f, 1.0f, 1.0f, 1.0f } ); } ImGui::Checkbox("Show Skeleton", &mIsSkeleton); ImGui::End(); } void GameState::DrawDepthMap() { mDepthMapVertexShader.Bind(); mDepthMapPixelShader.Bind(); auto matViewLight = mLightCamera.GetViewMatrix(); auto matProjLight = mLightProjectMatrix;// mLightCamera.GetPerspectiveMatrix(); mDepthMapConstantBuffer.BindVS(0); //for (auto& position : mTankPositions) //{ // //} /*auto matTrans = Matrix4::Translation(position); auto matRot = Matrix4::RotationX(mTankRotation.x) * Matrix4::RotationY(mTankRotation.y);*/ //auto matWorld = matRot * matTrans; auto matWorld = mAnimation.GetTransform(mAnimationTime);// matRot* matTrans; auto wvp = Transpose(matWorld * matViewLight * matProjLight); mDepthMapConstantBuffer.Update(wvp); mModel.Draw(); } void GameState::DrawScene() { auto matView = mActiveCamera->GetViewMatrix(); auto matProj = mActiveCamera->GetPerspectiveMatrix(); auto matViewLight = mLightCamera.GetViewMatrix(); auto matProjLight = mLightProjectMatrix; //mLightCamera.GetPerspectiveMatrix(); mLightBuffer.Update(mDirectionalLight); mLightBuffer.BindVS(1); mLightBuffer.BindPS(1); mMaterialBuffer.Update(mMaterial); mMaterialBuffer.BindVS(2); mMaterialBuffer.BindPS(2); mSettingsBuffer.Update(mSettings); mSettingsBuffer.BindVS(3); mSettingsBuffer.BindPS(3); mSampler.BindVS(); mSampler.BindPS(); mDiffuseMap.BindPS(0); mSpecularMap.BindPS(1); mDisplacementMap.BindVS(2); mNormalMap.BindPS(3); mAOMap.BindPS(4); mDepthMapRenderTarget.BindPS(5); mVertexShader.Bind(); mPixelShader.Bind(); mTransformBuffer.BindVS(0); mShadowConstantBuffer.BindVS(4); mBoneTransformBuffer.BindVS(5); auto matWorld = mAnimation.GetTransform(mAnimationTime); TransformData transformData; transformData.world = Transpose(matWorld); transformData.wvp = Transpose(matWorld * matView * matProj); transformData.viewPosition = mActiveCamera->GetPosition(); mTransformBuffer.Update(transformData); auto wvpLight = Transpose(matWorld * matViewLight * matProjLight); mShadowConstantBuffer.Update(wvpLight); mBoneTransformBuffer.Update(boneTransformData); if (!mIsSkeleton) { mModel.Draw(); } else { for (auto& bones : mModel.skeleton.bones) { DrawSkeleton(bones.get(), mBoneMatrices); } } SettingsData settings; settings.specularMapWeight = 0.0f; settings.bumpMapWeight = 0.0f; settings.normalMapWeight = 0.0f; settings.aoMapWeight = 0.0f; settings.useShadow = 1; mSettingsBuffer.Update(settings); SimpleDraw::AddLine(mViewFrustumVertices[0], mViewFrustumVertices[1], Colors::White); SimpleDraw::AddLine(mViewFrustumVertices[1], mViewFrustumVertices[2], Colors::White); SimpleDraw::AddLine(mViewFrustumVertices[2], mViewFrustumVertices[3], Colors::White); SimpleDraw::AddLine(mViewFrustumVertices[3], mViewFrustumVertices[0], Colors::White); SimpleDraw::AddLine(mViewFrustumVertices[0], mViewFrustumVertices[4], Colors::White); SimpleDraw::AddLine(mViewFrustumVertices[1], mViewFrustumVertices[5], Colors::White); SimpleDraw::AddLine(mViewFrustumVertices[2], mViewFrustumVertices[6], Colors::White); SimpleDraw::AddLine(mViewFrustumVertices[3], mViewFrustumVertices[7], Colors::White); SimpleDraw::AddLine(mViewFrustumVertices[4], mViewFrustumVertices[5], Colors::White); SimpleDraw::AddLine(mViewFrustumVertices[5], mViewFrustumVertices[6], Colors::White); SimpleDraw::AddLine(mViewFrustumVertices[6], mViewFrustumVertices[7], Colors::White); SimpleDraw::AddLine(mViewFrustumVertices[7], mViewFrustumVertices[4], Colors::White); SimpleDrawCamera(mDefaultCamera); SimpleDraw::Render(*mActiveCamera); }
31.778846
113
0.710287
CyroPCJr
d63c01f88d79ba06c15e4f77dd4f2423c0380760
2,376
hpp
C++
c/src/xkms/XKMSKeyBinding.hpp
douglascrp/xmlsec-mityc-sinadura
cf63024481914be33ae3a06ef1cc7629dd59aa0f
[ "Apache-2.0" ]
null
null
null
c/src/xkms/XKMSKeyBinding.hpp
douglascrp/xmlsec-mityc-sinadura
cf63024481914be33ae3a06ef1cc7629dd59aa0f
[ "Apache-2.0" ]
null
null
null
c/src/xkms/XKMSKeyBinding.hpp
douglascrp/xmlsec-mityc-sinadura
cf63024481914be33ae3a06ef1cc7629dd59aa0f
[ "Apache-2.0" ]
2
2018-08-10T18:54:23.000Z
2018-08-10T18:56:27.000Z
/* * Copyright 2004-2005 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * 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. */ /* * XSEC * * XKMSKeyBinding := Interface for KeyBinding elements * * $Id: XKMSKeyBinding.hpp 351364 2005-06-04 11:30:26Z blautenb $ * */ #ifndef XKMSKEYBINDING_INCLUDE #define XKMSKEYBINDING_INCLUDE // XSEC Includes #include <xsec/framework/XSECDefs.hpp> #include <xsec/xkms/XKMSKeyBindingAbstractType.hpp> /** * @ingroup xkms */ /** * @brief Interface definition for the KeyBinding elements * * The \<KeyBinding\> Element is used in a result message to a client * to provide information on a particular key. * * The schema definition for KeyBinding is as follows : * * \verbatim <!-- KeyBinding --> <element name="KeyBinding" type="xkms:KeyBindingType"/> <complexType name="KeyBindingType"> <complexContent> <extension base="xkms:UnverifiedKeyBindingType"> <sequence> <element ref="xkms:Status"/> </sequence> </extension> </complexContent> </complexType> <!-- /KeyBinding -->\endverbatim */ class XKMSStatus; class XKMSKeyBinding : public XKMSKeyBindingAbstractType { /** @name Constructors and Destructors */ //@{ protected: XKMSKeyBinding() {}; public: virtual ~XKMSKeyBinding() {}; //@} /** @name Status handling */ //@{ /** * \brief Obtain the status element for this KeyBinding * * The \<Status\> element is used to describe to the caller the * validity of they key being described. This call is used to * obtain the status element * * @return A pointer to the XKMSStatus element */ virtual XKMSStatus * getStatus(void) const = 0; //@} private: // Unimplemented XKMSKeyBinding(const XKMSKeyBinding &); XKMSKeyBinding & operator = (const XKMSKeyBinding &); }; #endif /* XKMSKEYBINDING_INCLUDE */
22.846154
75
0.690236
douglascrp
d646a6e4ee87c9c9bf70d990b57780443f314a5a
20,081
cpp
C++
wdbecmbd/CrdWdbeVec/PnlWdbeVecDetail_blks.cpp
mpsitech/wdbe-WhizniumDBE
27360ce6569dc55098a248b8a0a4b7e3913a6ce6
[ "MIT" ]
4
2020-10-27T14:33:25.000Z
2021-08-07T20:55:42.000Z
wdbecmbd/CrdWdbeVec/PnlWdbeVecDetail_blks.cpp
mpsitech/wdbe-WhizniumDBE
27360ce6569dc55098a248b8a0a4b7e3913a6ce6
[ "MIT" ]
null
null
null
wdbecmbd/CrdWdbeVec/PnlWdbeVecDetail_blks.cpp
mpsitech/wdbe-WhizniumDBE
27360ce6569dc55098a248b8a0a4b7e3913a6ce6
[ "MIT" ]
null
null
null
/** * \file PnlWdbeVecDetail_blks.cpp * job handler for job PnlWdbeVecDetail (implementation of blocks) * \copyright (C) 2016-2020 MPSI Technologies GmbH * \author Alexander Wirthmueller (auto-generation) * \date created: 28 Nov 2020 */ // IP header --- ABOVE using namespace std; using namespace Sbecore; using namespace Xmlio; /****************************************************************************** class PnlWdbeVecDetail::VecVDo ******************************************************************************/ uint PnlWdbeVecDetail::VecVDo::getIx( const string& sref ) { string s = StrMod::lc(sref); if (s == "butsaveclick") return BUTSAVECLICK; if (s == "buthkuviewclick") return BUTHKUVIEWCLICK; if (s == "butopteditclick") return BUTOPTEDITCLICK; return(0); }; string PnlWdbeVecDetail::VecVDo::getSref( const uint ix ) { if (ix == BUTSAVECLICK) return("ButSaveClick"); if (ix == BUTHKUVIEWCLICK) return("ButHkuViewClick"); if (ix == BUTOPTEDITCLICK) return("ButOptEditClick"); return(""); }; /****************************************************************************** class PnlWdbeVecDetail::ContIac ******************************************************************************/ PnlWdbeVecDetail::ContIac::ContIac( const uint numFPupTyp , const uint numFPupHkt , const vector<uint>& numsFLstOpt , const string& TxfOpt ) : Block() { this->numFPupTyp = numFPupTyp; this->numFPupHkt = numFPupHkt; this->numsFLstOpt = numsFLstOpt; this->TxfOpt = TxfOpt; mask = {NUMFPUPTYP, NUMFPUPHKT, NUMSFLSTOPT, TXFOPT}; }; bool PnlWdbeVecDetail::ContIac::readJSON( Json::Value& sup , bool addbasetag ) { clear(); bool basefound; Json::Value& me = sup; if (addbasetag) me = sup["ContIacWdbeVecDetail"]; basefound = (me != Json::nullValue); if (basefound) { if (me.isMember("numFPupTyp")) {numFPupTyp = me["numFPupTyp"].asUInt(); add(NUMFPUPTYP);}; if (me.isMember("numFPupHkt")) {numFPupHkt = me["numFPupHkt"].asUInt(); add(NUMFPUPHKT);}; if (Jsonio::extractUintvec(me, "numsFLstOpt", numsFLstOpt)) add(NUMSFLSTOPT); if (me.isMember("TxfOpt")) {TxfOpt = me["TxfOpt"].asString(); add(TXFOPT);}; }; return basefound; }; bool PnlWdbeVecDetail::ContIac::readXML( xmlXPathContext* docctx , string basexpath , bool addbasetag ) { clear(); bool basefound; if (addbasetag) basefound = checkUclcXPaths(docctx, basexpath, basexpath, "ContIacWdbeVecDetail"); else basefound = checkXPath(docctx, basexpath); string itemtag = "ContitemIacWdbeVecDetail"; if (basefound) { if (extractUintAttrUclc(docctx, basexpath, itemtag, "Ci", "sref", "numFPupTyp", numFPupTyp)) add(NUMFPUPTYP); if (extractUintAttrUclc(docctx, basexpath, itemtag, "Ci", "sref", "numFPupHkt", numFPupHkt)) add(NUMFPUPHKT); if (extractUintvecAttrUclc(docctx, basexpath, itemtag, "Ci", "sref", "numsFLstOpt", numsFLstOpt)) add(NUMSFLSTOPT); if (extractStringAttrUclc(docctx, basexpath, itemtag, "Ci", "sref", "TxfOpt", TxfOpt)) add(TXFOPT); }; return basefound; }; void PnlWdbeVecDetail::ContIac::writeJSON( Json::Value& sup , string difftag ) { if (difftag.length() == 0) difftag = "ContIacWdbeVecDetail"; Json::Value& me = sup[difftag] = Json::Value(Json::objectValue); me["numFPupTyp"] = numFPupTyp; me["numFPupHkt"] = numFPupHkt; Jsonio::writeUintvec(me, "numsFLstOpt", numsFLstOpt); me["TxfOpt"] = TxfOpt; }; void PnlWdbeVecDetail::ContIac::writeXML( xmlTextWriter* wr , string difftag , bool shorttags ) { if (difftag.length() == 0) difftag = "ContIacWdbeVecDetail"; string itemtag; if (shorttags) itemtag = "Ci"; else itemtag = "ContitemIacWdbeVecDetail"; xmlTextWriterStartElement(wr, BAD_CAST difftag.c_str()); writeUintAttr(wr, itemtag, "sref", "numFPupTyp", numFPupTyp); writeUintAttr(wr, itemtag, "sref", "numFPupHkt", numFPupHkt); writeUintvecAttr(wr, itemtag, "sref", "numsFLstOpt", numsFLstOpt); writeStringAttr(wr, itemtag, "sref", "TxfOpt", TxfOpt); xmlTextWriterEndElement(wr); }; set<uint> PnlWdbeVecDetail::ContIac::comm( const ContIac* comp ) { set<uint> items; if (numFPupTyp == comp->numFPupTyp) insert(items, NUMFPUPTYP); if (numFPupHkt == comp->numFPupHkt) insert(items, NUMFPUPHKT); if (compareUintvec(numsFLstOpt, comp->numsFLstOpt)) insert(items, NUMSFLSTOPT); if (TxfOpt == comp->TxfOpt) insert(items, TXFOPT); return(items); }; set<uint> PnlWdbeVecDetail::ContIac::diff( const ContIac* comp ) { set<uint> commitems; set<uint> diffitems; commitems = comm(comp); diffitems = {NUMFPUPTYP, NUMFPUPHKT, NUMSFLSTOPT, TXFOPT}; for (auto it = commitems.begin(); it != commitems.end(); it++) diffitems.erase(*it); return(diffitems); }; /****************************************************************************** class PnlWdbeVecDetail::ContInf ******************************************************************************/ PnlWdbeVecDetail::ContInf::ContInf( const string& TxtSrf , const string& TxtHku ) : Block() { this->TxtSrf = TxtSrf; this->TxtHku = TxtHku; mask = {TXTSRF, TXTHKU}; }; void PnlWdbeVecDetail::ContInf::writeJSON( Json::Value& sup , string difftag ) { if (difftag.length() == 0) difftag = "ContInfWdbeVecDetail"; Json::Value& me = sup[difftag] = Json::Value(Json::objectValue); me["TxtSrf"] = TxtSrf; me["TxtHku"] = TxtHku; }; void PnlWdbeVecDetail::ContInf::writeXML( xmlTextWriter* wr , string difftag , bool shorttags ) { if (difftag.length() == 0) difftag = "ContInfWdbeVecDetail"; string itemtag; if (shorttags) itemtag = "Ci"; else itemtag = "ContitemInfWdbeVecDetail"; xmlTextWriterStartElement(wr, BAD_CAST difftag.c_str()); writeStringAttr(wr, itemtag, "sref", "TxtSrf", TxtSrf); writeStringAttr(wr, itemtag, "sref", "TxtHku", TxtHku); xmlTextWriterEndElement(wr); }; set<uint> PnlWdbeVecDetail::ContInf::comm( const ContInf* comp ) { set<uint> items; if (TxtSrf == comp->TxtSrf) insert(items, TXTSRF); if (TxtHku == comp->TxtHku) insert(items, TXTHKU); return(items); }; set<uint> PnlWdbeVecDetail::ContInf::diff( const ContInf* comp ) { set<uint> commitems; set<uint> diffitems; commitems = comm(comp); diffitems = {TXTSRF, TXTHKU}; for (auto it = commitems.begin(); it != commitems.end(); it++) diffitems.erase(*it); return(diffitems); }; /****************************************************************************** class PnlWdbeVecDetail::StatApp ******************************************************************************/ void PnlWdbeVecDetail::StatApp::writeJSON( Json::Value& sup , string difftag , const uint ixWdbeVExpstate , const bool LstOptAlt , const uint LstOptNumFirstdisp ) { if (difftag.length() == 0) difftag = "StatAppWdbeVecDetail"; Json::Value& me = sup[difftag] = Json::Value(Json::objectValue); me["srefIxWdbeVExpstate"] = VecWdbeVExpstate::getSref(ixWdbeVExpstate); me["LstOptAlt"] = LstOptAlt; me["LstOptNumFirstdisp"] = LstOptNumFirstdisp; }; void PnlWdbeVecDetail::StatApp::writeXML( xmlTextWriter* wr , string difftag , bool shorttags , const uint ixWdbeVExpstate , const bool LstOptAlt , const uint LstOptNumFirstdisp ) { if (difftag.length() == 0) difftag = "StatAppWdbeVecDetail"; string itemtag; if (shorttags) itemtag = "Si"; else itemtag = "StatitemAppWdbeVecDetail"; xmlTextWriterStartElement(wr, BAD_CAST difftag.c_str()); writeStringAttr(wr, itemtag, "sref", "srefIxWdbeVExpstate", VecWdbeVExpstate::getSref(ixWdbeVExpstate)); writeBoolAttr(wr, itemtag, "sref", "LstOptAlt", LstOptAlt); writeUintAttr(wr, itemtag, "sref", "LstOptNumFirstdisp", LstOptNumFirstdisp); xmlTextWriterEndElement(wr); }; /****************************************************************************** class PnlWdbeVecDetail::StatShr ******************************************************************************/ PnlWdbeVecDetail::StatShr::StatShr( const bool TxfOptValid , const bool ButSaveAvail , const bool ButSaveActive , const bool TxtSrfActive , const bool PupTypActive , const bool TxtHkuActive , const bool ButHkuViewAvail , const bool ButHkuViewActive , const bool LstOptActive , const bool ButOptEditAvail ) : Block() { this->TxfOptValid = TxfOptValid; this->ButSaveAvail = ButSaveAvail; this->ButSaveActive = ButSaveActive; this->TxtSrfActive = TxtSrfActive; this->PupTypActive = PupTypActive; this->TxtHkuActive = TxtHkuActive; this->ButHkuViewAvail = ButHkuViewAvail; this->ButHkuViewActive = ButHkuViewActive; this->LstOptActive = LstOptActive; this->ButOptEditAvail = ButOptEditAvail; mask = {TXFOPTVALID, BUTSAVEAVAIL, BUTSAVEACTIVE, TXTSRFACTIVE, PUPTYPACTIVE, TXTHKUACTIVE, BUTHKUVIEWAVAIL, BUTHKUVIEWACTIVE, LSTOPTACTIVE, BUTOPTEDITAVAIL}; }; void PnlWdbeVecDetail::StatShr::writeJSON( Json::Value& sup , string difftag ) { if (difftag.length() == 0) difftag = "StatShrWdbeVecDetail"; Json::Value& me = sup[difftag] = Json::Value(Json::objectValue); me["TxfOptValid"] = TxfOptValid; me["ButSaveAvail"] = ButSaveAvail; me["ButSaveActive"] = ButSaveActive; me["TxtSrfActive"] = TxtSrfActive; me["PupTypActive"] = PupTypActive; me["TxtHkuActive"] = TxtHkuActive; me["ButHkuViewAvail"] = ButHkuViewAvail; me["ButHkuViewActive"] = ButHkuViewActive; me["LstOptActive"] = LstOptActive; me["ButOptEditAvail"] = ButOptEditAvail; }; void PnlWdbeVecDetail::StatShr::writeXML( xmlTextWriter* wr , string difftag , bool shorttags ) { if (difftag.length() == 0) difftag = "StatShrWdbeVecDetail"; string itemtag; if (shorttags) itemtag = "Si"; else itemtag = "StatitemShrWdbeVecDetail"; xmlTextWriterStartElement(wr, BAD_CAST difftag.c_str()); writeBoolAttr(wr, itemtag, "sref", "TxfOptValid", TxfOptValid); writeBoolAttr(wr, itemtag, "sref", "ButSaveAvail", ButSaveAvail); writeBoolAttr(wr, itemtag, "sref", "ButSaveActive", ButSaveActive); writeBoolAttr(wr, itemtag, "sref", "TxtSrfActive", TxtSrfActive); writeBoolAttr(wr, itemtag, "sref", "PupTypActive", PupTypActive); writeBoolAttr(wr, itemtag, "sref", "TxtHkuActive", TxtHkuActive); writeBoolAttr(wr, itemtag, "sref", "ButHkuViewAvail", ButHkuViewAvail); writeBoolAttr(wr, itemtag, "sref", "ButHkuViewActive", ButHkuViewActive); writeBoolAttr(wr, itemtag, "sref", "LstOptActive", LstOptActive); writeBoolAttr(wr, itemtag, "sref", "ButOptEditAvail", ButOptEditAvail); xmlTextWriterEndElement(wr); }; set<uint> PnlWdbeVecDetail::StatShr::comm( const StatShr* comp ) { set<uint> items; if (TxfOptValid == comp->TxfOptValid) insert(items, TXFOPTVALID); if (ButSaveAvail == comp->ButSaveAvail) insert(items, BUTSAVEAVAIL); if (ButSaveActive == comp->ButSaveActive) insert(items, BUTSAVEACTIVE); if (TxtSrfActive == comp->TxtSrfActive) insert(items, TXTSRFACTIVE); if (PupTypActive == comp->PupTypActive) insert(items, PUPTYPACTIVE); if (TxtHkuActive == comp->TxtHkuActive) insert(items, TXTHKUACTIVE); if (ButHkuViewAvail == comp->ButHkuViewAvail) insert(items, BUTHKUVIEWAVAIL); if (ButHkuViewActive == comp->ButHkuViewActive) insert(items, BUTHKUVIEWACTIVE); if (LstOptActive == comp->LstOptActive) insert(items, LSTOPTACTIVE); if (ButOptEditAvail == comp->ButOptEditAvail) insert(items, BUTOPTEDITAVAIL); return(items); }; set<uint> PnlWdbeVecDetail::StatShr::diff( const StatShr* comp ) { set<uint> commitems; set<uint> diffitems; commitems = comm(comp); diffitems = {TXFOPTVALID, BUTSAVEAVAIL, BUTSAVEACTIVE, TXTSRFACTIVE, PUPTYPACTIVE, TXTHKUACTIVE, BUTHKUVIEWAVAIL, BUTHKUVIEWACTIVE, LSTOPTACTIVE, BUTOPTEDITAVAIL}; for (auto it = commitems.begin(); it != commitems.end(); it++) diffitems.erase(*it); return(diffitems); }; /****************************************************************************** class PnlWdbeVecDetail::Tag ******************************************************************************/ void PnlWdbeVecDetail::Tag::writeJSON( const uint ixWdbeVLocale , Json::Value& sup , string difftag ) { if (difftag.length() == 0) difftag = "TagWdbeVecDetail"; Json::Value& me = sup[difftag] = Json::Value(Json::objectValue); if (ixWdbeVLocale == VecWdbeVLocale::ENUS) { me["CptSrf"] = "identifier"; me["CptTyp"] = "type"; me["CptHku"] = "hook"; me["CptOpt"] = "options"; }; me["Cpt"] = StrMod::cap(VecWdbeVTag::getTitle(VecWdbeVTag::DETAIL, ixWdbeVLocale)); }; void PnlWdbeVecDetail::Tag::writeXML( const uint ixWdbeVLocale , xmlTextWriter* wr , string difftag , bool shorttags ) { if (difftag.length() == 0) difftag = "TagWdbeVecDetail"; string itemtag; if (shorttags) itemtag = "Ti"; else itemtag = "TagitemWdbeVecDetail"; xmlTextWriterStartElement(wr, BAD_CAST difftag.c_str()); if (ixWdbeVLocale == VecWdbeVLocale::ENUS) { writeStringAttr(wr, itemtag, "sref", "CptSrf", "identifier"); writeStringAttr(wr, itemtag, "sref", "CptTyp", "type"); writeStringAttr(wr, itemtag, "sref", "CptHku", "hook"); writeStringAttr(wr, itemtag, "sref", "CptOpt", "options"); }; writeStringAttr(wr, itemtag, "sref", "Cpt", StrMod::cap(VecWdbeVTag::getTitle(VecWdbeVTag::DETAIL, ixWdbeVLocale))); xmlTextWriterEndElement(wr); }; /****************************************************************************** class PnlWdbeVecDetail::DpchAppData ******************************************************************************/ PnlWdbeVecDetail::DpchAppData::DpchAppData() : DpchAppWdbe(VecWdbeVDpch::DPCHAPPWDBEVECDETAILDATA) { }; string PnlWdbeVecDetail::DpchAppData::getSrefsMask() { vector<string> ss; string srefs; if (has(JREF)) ss.push_back("jref"); if (has(CONTIAC)) ss.push_back("contiac"); StrMod::vectorToString(ss, srefs); return(srefs); }; void PnlWdbeVecDetail::DpchAppData::readJSON( Json::Value& sup , bool addbasetag ) { clear(); bool basefound; Json::Value& me = sup; if (addbasetag) me = sup["DpchAppWdbeVecDetailData"]; basefound = (me != Json::nullValue); if (basefound) { if (me.isMember("scrJref")) {jref = Scr::descramble(me["scrJref"].asString()); add(JREF);}; if (contiac.readJSON(me, true)) add(CONTIAC); } else { contiac = ContIac(); }; }; void PnlWdbeVecDetail::DpchAppData::readXML( xmlXPathContext* docctx , string basexpath , bool addbasetag ) { clear(); string scrJref; bool basefound; if (addbasetag) basefound = checkUclcXPaths(docctx, basexpath, basexpath, "DpchAppWdbeVecDetailData"); else basefound = checkXPath(docctx, basexpath); if (basefound) { if (extractStringUclc(docctx, basexpath, "scrJref", "", scrJref)) { jref = Scr::descramble(scrJref); add(JREF); }; if (contiac.readXML(docctx, basexpath, true)) add(CONTIAC); } else { contiac = ContIac(); }; }; /****************************************************************************** class PnlWdbeVecDetail::DpchAppDo ******************************************************************************/ PnlWdbeVecDetail::DpchAppDo::DpchAppDo() : DpchAppWdbe(VecWdbeVDpch::DPCHAPPWDBEVECDETAILDO) { ixVDo = 0; }; string PnlWdbeVecDetail::DpchAppDo::getSrefsMask() { vector<string> ss; string srefs; if (has(JREF)) ss.push_back("jref"); if (has(IXVDO)) ss.push_back("ixVDo"); StrMod::vectorToString(ss, srefs); return(srefs); }; void PnlWdbeVecDetail::DpchAppDo::readJSON( Json::Value& sup , bool addbasetag ) { clear(); bool basefound; Json::Value& me = sup; if (addbasetag) me = sup["DpchAppWdbeVecDetailDo"]; basefound = (me != Json::nullValue); if (basefound) { if (me.isMember("scrJref")) {jref = Scr::descramble(me["scrJref"].asString()); add(JREF);}; if (me.isMember("srefIxVDo")) {ixVDo = VecVDo::getIx(me["srefIxVDo"].asString()); add(IXVDO);}; } else { }; }; void PnlWdbeVecDetail::DpchAppDo::readXML( xmlXPathContext* docctx , string basexpath , bool addbasetag ) { clear(); string scrJref; string srefIxVDo; bool basefound; if (addbasetag) basefound = checkUclcXPaths(docctx, basexpath, basexpath, "DpchAppWdbeVecDetailDo"); else basefound = checkXPath(docctx, basexpath); if (basefound) { if (extractStringUclc(docctx, basexpath, "scrJref", "", scrJref)) { jref = Scr::descramble(scrJref); add(JREF); }; if (extractStringUclc(docctx, basexpath, "srefIxVDo", "", srefIxVDo)) { ixVDo = VecVDo::getIx(srefIxVDo); add(IXVDO); }; } else { }; }; /****************************************************************************** class PnlWdbeVecDetail::DpchEngData ******************************************************************************/ PnlWdbeVecDetail::DpchEngData::DpchEngData( const ubigint jref , ContIac* contiac , ContInf* continf , Feed* feedFLstOpt , Feed* feedFPupHkt , Feed* feedFPupTyp , StatShr* statshr , const set<uint>& mask ) : DpchEngWdbe(VecWdbeVDpch::DPCHENGWDBEVECDETAILDATA, jref) { if (find(mask, ALL)) this->mask = {JREF, CONTIAC, CONTINF, FEEDFLSTOPT, FEEDFPUPHKT, FEEDFPUPTYP, STATAPP, STATSHR, TAG}; else this->mask = mask; if (find(this->mask, CONTIAC) && contiac) this->contiac = *contiac; if (find(this->mask, CONTINF) && continf) this->continf = *continf; if (find(this->mask, FEEDFLSTOPT) && feedFLstOpt) this->feedFLstOpt = *feedFLstOpt; if (find(this->mask, FEEDFPUPHKT) && feedFPupHkt) this->feedFPupHkt = *feedFPupHkt; if (find(this->mask, FEEDFPUPTYP) && feedFPupTyp) this->feedFPupTyp = *feedFPupTyp; if (find(this->mask, STATSHR) && statshr) this->statshr = *statshr; }; string PnlWdbeVecDetail::DpchEngData::getSrefsMask() { vector<string> ss; string srefs; if (has(JREF)) ss.push_back("jref"); if (has(CONTIAC)) ss.push_back("contiac"); if (has(CONTINF)) ss.push_back("continf"); if (has(FEEDFLSTOPT)) ss.push_back("feedFLstOpt"); if (has(FEEDFPUPHKT)) ss.push_back("feedFPupHkt"); if (has(FEEDFPUPTYP)) ss.push_back("feedFPupTyp"); if (has(STATAPP)) ss.push_back("statapp"); if (has(STATSHR)) ss.push_back("statshr"); if (has(TAG)) ss.push_back("tag"); StrMod::vectorToString(ss, srefs); return(srefs); }; void PnlWdbeVecDetail::DpchEngData::merge( DpchEngWdbe* dpcheng ) { DpchEngData* src = (DpchEngData*) dpcheng; if (src->has(JREF)) {jref = src->jref; add(JREF);}; if (src->has(CONTIAC)) {contiac = src->contiac; add(CONTIAC);}; if (src->has(CONTINF)) {continf = src->continf; add(CONTINF);}; if (src->has(FEEDFLSTOPT)) {feedFLstOpt = src->feedFLstOpt; add(FEEDFLSTOPT);}; if (src->has(FEEDFPUPHKT)) {feedFPupHkt = src->feedFPupHkt; add(FEEDFPUPHKT);}; if (src->has(FEEDFPUPTYP)) {feedFPupTyp = src->feedFPupTyp; add(FEEDFPUPTYP);}; if (src->has(STATAPP)) add(STATAPP); if (src->has(STATSHR)) {statshr = src->statshr; add(STATSHR);}; if (src->has(TAG)) add(TAG); }; void PnlWdbeVecDetail::DpchEngData::writeJSON( const uint ixWdbeVLocale , Json::Value& sup ) { Json::Value& me = sup["DpchEngWdbeVecDetailData"] = Json::Value(Json::objectValue); if (has(JREF)) me["scrJref"] = Scr::scramble(jref); if (has(CONTIAC)) contiac.writeJSON(me); if (has(CONTINF)) continf.writeJSON(me); if (has(FEEDFLSTOPT)) feedFLstOpt.writeJSON(me); if (has(FEEDFPUPHKT)) feedFPupHkt.writeJSON(me); if (has(FEEDFPUPTYP)) feedFPupTyp.writeJSON(me); if (has(STATAPP)) StatApp::writeJSON(me); if (has(STATSHR)) statshr.writeJSON(me); if (has(TAG)) Tag::writeJSON(ixWdbeVLocale, me); }; void PnlWdbeVecDetail::DpchEngData::writeXML( const uint ixWdbeVLocale , xmlTextWriter* wr ) { xmlTextWriterStartElement(wr, BAD_CAST "DpchEngWdbeVecDetailData"); xmlTextWriterWriteAttribute(wr, BAD_CAST "xmlns", BAD_CAST "http://www.mpsitech.com/wdbe"); if (has(JREF)) writeString(wr, "scrJref", Scr::scramble(jref)); if (has(CONTIAC)) contiac.writeXML(wr); if (has(CONTINF)) continf.writeXML(wr); if (has(FEEDFLSTOPT)) feedFLstOpt.writeXML(wr); if (has(FEEDFPUPHKT)) feedFPupHkt.writeXML(wr); if (has(FEEDFPUPTYP)) feedFPupTyp.writeXML(wr); if (has(STATAPP)) StatApp::writeXML(wr); if (has(STATSHR)) statshr.writeXML(wr); if (has(TAG)) Tag::writeXML(ixWdbeVLocale, wr); xmlTextWriterEndElement(wr); };
29.88244
164
0.656143
mpsitech
d647597753feac195611ad369ff8b913dba5c048
2,235
cpp
C++
FindCriticalProcess.cpp
chk141/Homework-of-C-Language
b2d0d2b67abd55d51febb21c3eb6ce4a682e2cff
[ "BSD-3-Clause" ]
255
2018-07-06T08:59:32.000Z
2022-03-31T07:54:53.000Z
FindCriticalProcess.cpp
chk141/Homework-of-C-Language
b2d0d2b67abd55d51febb21c3eb6ce4a682e2cff
[ "BSD-3-Clause" ]
4
2019-08-25T06:21:44.000Z
2021-12-20T03:07:15.000Z
FindCriticalProcess.cpp
chk141/Homework-of-C-Language
b2d0d2b67abd55d51febb21c3eb6ce4a682e2cff
[ "BSD-3-Clause" ]
105
2018-08-31T16:51:51.000Z
2022-03-10T22:10:34.000Z
#include <stdio.h> #include <Windows.h> #include <Psapi.h> #pragma comment(lib, "Psapi.lib") #pragma comment(lib,"Advapi32.lib") #define ProcessBreakOnTermination 29 typedef int ProcessInformationClass; typedef NTSTATUS(NTAPI * _NtQueryInformationProcess)( HANDLE ProcessHandle, ProcessInformationClass informationClass, PVOID ProcessInformation, ULONG ProcessInformationLength, PULONG ReturnLength ); BOOL EnableDebugPrivilege(BOOL fEnable) { BOOL fOk = FALSE; HANDLE hToken; if (OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES, &hToken)) { TOKEN_PRIVILEGES tp; tp.PrivilegeCount = 1; LookupPrivilegeValue(NULL, SE_DEBUG_NAME, &tp.Privileges[0].Luid); tp.Privileges[0].Attributes = fEnable ? SE_PRIVILEGE_ENABLED : 0; AdjustTokenPrivileges(hToken, FALSE, &tp, sizeof(tp), NULL, NULL); fOk = (GetLastError() == ERROR_SUCCESS); CloseHandle(hToken); } return(fOk); } BOOL CheckProcess(DWORD pid) { printf("[%4d] ",pid); HANDLE hProcess; hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pid); if (hProcess == NULL) { printf("System\n"); return 0; } NTSTATUS status; ULONG breakOnTermination; _NtQueryInformationProcess NtQueryInformationProcess = (_NtQueryInformationProcess)GetProcAddress(GetModuleHandleA("NtDll.dll"), "NtQueryInformationProcess"); if (!NtQueryInformationProcess) { printf("[!]Could not find NtQueryInformationProcess entry point in NTDLL.DLL\n"); return 0; } status = NtQueryInformationProcess(hProcess, ProcessBreakOnTermination, &breakOnTermination, sizeof(ULONG), NULL); if (status<0) printf("[!]NtQueryInformationProcess error\n"); if (breakOnTermination == 1) printf("Critical[!]\n"); else printf("Normal\n"); } BOOL EnumProcess() { DWORD aProcesses[1024], cbNeeded, cProcesses; unsigned int i; if (!EnumProcesses(aProcesses, sizeof(aProcesses), &cbNeeded)) { printf("[!]EnumProcesses error\n"); return 0; } cProcesses = cbNeeded / sizeof(DWORD); for (i = 0; i < cProcesses; i++) if (aProcesses[i] != 0) { CheckProcess(aProcesses[i]); } return 1; } int main(int argc, char *argv[]) { printf("[*]Try to find the critical process\n\n"); printf("[PID] [Type]\n"); printf("====== =======\n"); EnumProcess(); }
25.988372
159
0.725727
chk141
d647eaac3930291b4b98b7283dd33ceb8deeb8d6
1,955
cpp
C++
src/flowcontrol/returnblock.cpp
dendisuhubdy/coriander
7df182981e5c4a8e043fea25d272d025a953f06d
[ "Apache-2.0" ]
644
2017-05-21T05:25:20.000Z
2022-03-25T04:18:14.000Z
src/flowcontrol/returnblock.cpp
hughperkins/cuda-ir-to-opencl
7c6b65bc08a25a6bce21efe7b86be8fa985597af
[ "Apache-2.0" ]
82
2017-05-21T15:19:24.000Z
2022-01-30T01:41:44.000Z
src/flowcontrol/returnblock.cpp
hughperkins/cuda-ir-to-opencl
7c6b65bc08a25a6bce21efe7b86be8fa985597af
[ "Apache-2.0" ]
88
2017-05-21T01:31:16.000Z
2022-01-31T09:28:17.000Z
// Copyright Hugh Perkins 2016 // 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 "flowcontrolinstructions.h" #include "ir-to-opencl.h" #include <iostream> #include <sstream> using namespace std; using namespace llvm; namespace cocl { namespace flowcontrol { ReturnBlock::ReturnBlock() { gotoFree = true; isExit = true; } int ReturnBlock::getNumChildren() const { return 0; } Block *ReturnBlock::getChild(int idx) { throw runtime_error("illegal request"); } std::string ReturnBlock::generateCl(std::string indent, bool noLabel) { dumped = true; string gencode = ""; gencode += dumpInstruction(indent, retInst); return gencode; } void ReturnBlock::walk(std::function<void(Block *block)> fn) { fn(this); } string ReturnBlock::blockType() const { return "ReturnBlock"; } void ReturnBlock::dump(set<const Block *> &seen, string indent) const { cout << indent << "*** ReturnBlock " << this->id << gotoFreeString() << isExitString() << uncontainedJumpsString() << endl; } void ReturnBlock::replaceSuccessor(Block *oldChild, Block *newChild) { throw runtime_error("couldnt find old child"); } void ReturnBlock::replaceChildOrSuccessor(Block *oldChild, Block *newChild) { throw runtime_error("couldnt find old child"); } int ReturnBlock::numSuccessors() const { return 0; } Block *ReturnBlock::getSuccessor(int idx) { throw runtime_error("illegal request"); } } // flowcontrol } // cocl
29.179104
127
0.719182
dendisuhubdy
d649c297cb189aab00fe797a913a428155e44923
1,485
hh
C++
src/include/meadow/dhalia.hh
cagelight/meadow
9638ce5a1f18be3da3ace157b937e41cd65c6ec1
[ "MIT" ]
null
null
null
src/include/meadow/dhalia.hh
cagelight/meadow
9638ce5a1f18be3da3ace157b937e41cd65c6ec1
[ "MIT" ]
null
null
null
src/include/meadow/dhalia.hh
cagelight/meadow
9638ce5a1f18be3da3ace157b937e41cd65c6ec1
[ "MIT" ]
null
null
null
#pragma once /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -------------------------------------------------------------------------------------------------------------------------------- ================================================================================================================================ ████████▄ ▄█ █▄ ▄████████ ▄█ ▄█ ▄████████ ███ ▀███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███▌ ███ ███ ███ ███ ▄███▄▄▄▄███▄▄ ███ ███ ███ ███▌ ███ ███ ███ ███ ▀▀███▀▀▀▀███▀ ▀███████████ ███ ███▌ ▀███████████ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ███ ▄███ ███ ███ ███ ███ ███▌ ▄ ███ ███ ███ ████████▀ ███ █▀ ███ █▀ █████▄▄██ █▀ ███ █▀ <================================================================> Generic asynchronous TCP reactor ================================================================================================================================ -------------------------------------------------------------------------------------------------------------------------------- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ namespace meadow::dhalia { }
49.5
128
0.040404
cagelight
d64e09197a3f0e439b5b3ba4589813b3b59b90dd
946
cc
C++
ports/www/chromium-legacy/newport/files/patch-chrome_browser_extensions_install__signer.cc
danielfojt/DeltaPorts
5710b4af4cacca5eb1ac577df304c788c07c4217
[ "BSD-2-Clause-FreeBSD" ]
null
null
null
ports/www/chromium-legacy/newport/files/patch-chrome_browser_extensions_install__signer.cc
danielfojt/DeltaPorts
5710b4af4cacca5eb1ac577df304c788c07c4217
[ "BSD-2-Clause-FreeBSD" ]
null
null
null
ports/www/chromium-legacy/newport/files/patch-chrome_browser_extensions_install__signer.cc
danielfojt/DeltaPorts
5710b4af4cacca5eb1ac577df304c788c07c4217
[ "BSD-2-Clause-FreeBSD" ]
null
null
null
--- chrome/browser/extensions/install_signer.cc.orig 2019-03-17 20:14:24 UTC +++ chrome/browser/extensions/install_signer.cc @@ -293,13 +293,13 @@ void LogRequestStartHistograms() { DCHECK(g_single_thread_checker.Get().CalledOnValidThread()); // Process::Current().CreationTime is only defined on some platforms. -#if defined(OS_MACOSX) || defined(OS_WIN) || defined(OS_LINUX) +#if defined(OS_MACOSX) || defined(OS_WIN) || defined(OS_LINUX) || defined(OS_BSD) const base::Time process_creation_time = base::Process::Current().CreationTime(); UMA_HISTOGRAM_COUNTS_1M( "ExtensionInstallSigner.UptimeAtTimeOfRequest", (base::Time::Now() - process_creation_time).InSeconds()); -#endif // defined(OS_MACOSX) || defined(OS_WIN) || defined(OS_LINUX) +#endif // defined(OS_MACOSX) || defined(OS_WIN) || defined(OS_LINUX) || defined(OS_BSD) base::TimeDelta delta; base::TimeTicks now = base::TimeTicks::Now();
49.789474
89
0.718816
danielfojt
d64f30d0b518162b311046829ac62e773319ccee
3,897
cpp
C++
lib/jit/generation/engine/stream.cpp
listenlink/isaac
b0a265ee45337f92f1e8e9f2fb08a057292b0240
[ "MIT" ]
17
2017-01-22T10:40:52.000Z
2021-12-01T07:42:40.000Z
lib/jit/generation/engine/stream.cpp
listenlink/isaac
b0a265ee45337f92f1e8e9f2fb08a057292b0240
[ "MIT" ]
3
2017-01-19T07:17:29.000Z
2017-02-08T06:07:48.000Z
lib/jit/generation/engine/stream.cpp
listenlink/isaac
b0a265ee45337f92f1e8e9f2fb08a057292b0240
[ "MIT" ]
13
2017-01-10T13:21:03.000Z
2021-08-11T11:44:06.000Z
/* Copyright 2015-2017 Philippe Tillet * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files * (the "Software"), to deal in the Software without restriction, * including without limitation the rights to use, copy, modify, merge, * publish, distribute, sublicense, and/or sell copies of the Software, * and to permit persons to whom the Software is furnished to do so, * subject to the following conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "isaac/jit/generation/engine/stream.h" #include "isaac/tools/cpp/string.hpp" namespace isaac { kernel_generation_stream::kgenstream::kgenstream(std::ostringstream& oss,unsigned int const & tab_count) : oss_(oss), tab_count_(tab_count) { } int kernel_generation_stream::kgenstream::sync() { for (unsigned int i=0; i<tab_count_;++i) oss_ << " "; std::string next = str(); oss_ << next; str(""); return !oss_; } kernel_generation_stream::kgenstream:: ~kgenstream() { pubsync(); } void kernel_generation_stream::process(std::string& str) { #define ADD_KEYWORD(NAME, OPENCL_NAME, CUDA_NAME) tools::find_and_replace(str, "$" + std::string(NAME), (backend_==driver::CUDA)?CUDA_NAME:OPENCL_NAME); ADD_KEYWORD("GLOBAL_IDX_0", "get_global_id(0)", "(blockIdx.x*blockDim.x + threadIdx.x)") ADD_KEYWORD("GLOBAL_IDX_1", "get_global_id(1)", "(blockIdx.y*blockDim.y + threadIdx.y)") ADD_KEYWORD("GLOBAL_IDX_2", "get_global_id(2)", "(blockIdx.z*blockDim.z + threadIdx.z)") ADD_KEYWORD("GLOBAL_SIZE_0", "get_global_size(0)", "(blockDim.x*gridDim.x)") ADD_KEYWORD("GLOBAL_SIZE_1", "get_global_size(1)", "(blockDim.y*gridDim.y)") ADD_KEYWORD("GLOBAL_SIZE_2", "get_global_size(2)", "(blockDim.z*gridDim.z)") ADD_KEYWORD("LOCAL_IDX_0", "get_local_id(0)", "threadIdx.x") ADD_KEYWORD("LOCAL_IDX_1", "get_local_id(1)", "threadIdx.y") ADD_KEYWORD("LOCAL_IDX_2", "get_local_id(2)", "threadIdx.z") ADD_KEYWORD("LOCAL_SIZE_0", "get_local_size(0)", "blockDim.x") ADD_KEYWORD("LOCAL_SIZE_1", "get_local_size(1)", "blockDim.y") ADD_KEYWORD("LOCAL_SIZE_2", "get_local_size(2)", "blockDim.z") ADD_KEYWORD("GROUP_IDX_0", "get_group_id(0)", "blockIdx.x") ADD_KEYWORD("GROUP_IDX_1", "get_group_id(1)", "blockIdx.y") ADD_KEYWORD("GROUP_IDX_2", "get_group_id(2)", "blockIdx.z") ADD_KEYWORD("GROUP_SIZE_0", "get_ng(0)", "GridDim.x") ADD_KEYWORD("GROUP_SIZE_1", "get_ng(1)", "GridDim.y") ADD_KEYWORD("GROUP_SIZE_2", "get_ng(2)", "GridDim.z") ADD_KEYWORD("LOCAL_BARRIER", "barrier(CLK_LOCAL_MEM_FENCE)", "__syncthreads()") ADD_KEYWORD("LOCAL_PTR", "__local", "") ADD_KEYWORD("LOCAL", "__local", "__shared__") ADD_KEYWORD("GLOBAL", "__global", "") ADD_KEYWORD("SIZE_T", "int", "int") ADD_KEYWORD("KERNEL", "__kernel", "extern \"C\" __global__") ADD_KEYWORD("MAD", "mad", "fma") #undef ADD_KEYWORD } kernel_generation_stream::kernel_generation_stream(driver::backend_type backend) : std::ostream(new kgenstream(oss,tab_count_)), tab_count_(0), backend_(backend) { } kernel_generation_stream::~kernel_generation_stream() { delete rdbuf(); } std::string kernel_generation_stream::str() { std::string next = oss.str(); process(next); return next; } void kernel_generation_stream::inc_tab() { ++tab_count_; } void kernel_generation_stream::dec_tab() { --tab_count_; } }
34.794643
161
0.737234
listenlink
d6504513e7835627bac13803c23aedb0f90dc74a
355
cpp
C++
src/11000/11399.cpp14.cpp
upple/BOJ
e6dbf9fd17fa2b458c6a781d803123b14c18e6f1
[ "MIT" ]
8
2018-04-12T15:54:09.000Z
2020-06-05T07:41:15.000Z
src/11000/11399.cpp14.cpp
upple/BOJ
e6dbf9fd17fa2b458c6a781d803123b14c18e6f1
[ "MIT" ]
null
null
null
src/11000/11399.cpp14.cpp
upple/BOJ
e6dbf9fd17fa2b458c6a781d803123b14c18e6f1
[ "MIT" ]
null
null
null
#include<iostream> #include<algorithm> using namespace std; int main() { int no_person, ans=0; cin>>no_person; int *line=new int[no_person]; for(int i=0; i<no_person; i++) cin>>line[i]; sort(line, line+no_person); for(int i=0; i<no_person; i++) ans+=line[i]*(no_person-i); cout<<ans<<endl; return 0; }
16.136364
35
0.585915
upple